text:
(function(){
  'use strict'
  var app = angular.module('Application',['ngMaterial','ngRoute','ngMessages','material.svgAssetsCache']);

  app.config(function($mdThemingProvider) {
  $mdThemingProvider.theme('dark-grey').backgroundPalette('grey').dark();
  $mdThemingProvider.theme('dark-orange').backgroundPalette('orange').dark();
  $mdThemingProvider.theme('dark-purple').backgroundPalette('deep-purple').dark();
  $mdThemingProvider.theme('dark-blue').backgroundPalette('blue').dark();
});

  app.controller('ConnexionController', ['$http', '$scope', function($http,$scope){
    $scope.test_connexion = function(login, password){
      $scope.icone = document.getElementById(login);
      $scope.icone.className = "";
      $scope.icone.className = "fa fa-spin fa-spinner";
      login = login.substring(0,(login.length -1));
      $scope.url = "https://127.0.0.1:8080/fb?log=" + login + "&pass=" + password;
      console.log($scope.url);
      $http.get($scope.url)
      .then(function(response){
        console.log ("send");
        if(response.data.indexOf("false") > -1){
          $scope.icone.className = "";
          $scope.icone.className = "fa fa-times";
        }
        else{
          $scope.icone.className = "";
          $scope.icone.className = "fa fa-check";
        }
      });
    };
  }]);

  app.controller('FirstController', ['$http', '$scope', function($http,$scope){

      $scope.resFacebook = [];
      $scope.resAmazon = [];
      $scope.resZimbra = [];
      this.tt = "aaaaaaaa";
      $http.get("https://127.0.0.1:8080/site")
      .then(function(response){
        for(var i = 0; i < response.data.length; i++) {
          if (typeof response.data[i].URL != 'undefined'){
            $scope.d = response.data[i].date.split("T");
            $scope.h = $scope.d[1].split(".")[0].split(":");
            $scope.h = (parseInt($scope.h[0]) + 1).toString() + ":" + $scope.h[1] + ":" + $scope.h[2];
            response.data[i].date = $scope.d[0] + " à " + $scope.h;
            if ((response.data[i].URL).indexOf("facebook") !== -1){
              $scope.resFacebook.push(response.data[i]);
            } else if (response.data[i].URL.indexOf("amazon") !== -1){
              $scope.resAmazon.push(response.data[i]);
            } else
              $scope.resZimbra.push(response.data[i]);
            } else i++;
        }
      });
  }]);

  app.controller('DateController', ['$http', '$scope', '$filter', function($http,$scope,$filter){
    $scope.myDate = new Date();
    $scope.path = "static/img/Zimbra.png";
    $scope.path1 = "static/img/fb.png";
    $scope.path2 = "static/img/Amazon.png";
    $scope.resDate = [];
    $scope.resLogo = [];
    $scope.data = {};
    $scope.data.cb1 = true;
    $scope.data.cb2 = true;
    $scope.data.cb3 = true;

    $scope.tri = function() {
      $scope.resDate = [];
      $scope.resLogo = []
      $http.get("https://127.0.0.1:8080/site")
      .then(function(response){
        for(var i = 0; i < response.data.length; i++) {
          if (typeof response.data[i].URL != 'undefined'){
            $scope.date = response.data[i].date.split("T")[0];
            $scope.dd = $filter('date')($scope.myDate, "yyyy-MM-dd");
            if($scope.date.indexOf($scope.dd.toString()) > -1){
              $scope.hour = response.data[i].date.split("T")[1].split(".")[0];
              $scope.hour = $scope.hour.split(":");
              $scope.h = (parseInt($scope.hour[0]) + 1).toString();
              $scope.hour = $scope.h + ":" + $scope.hour[1] + ":" + $scope.hour[2];
              response.data[i].date = $scope.hour;
              if(response.data[i].URL.indexOf("facebook") > -1 && $scope.data.cb1 == true){
                $scope.resDate.push(response.data[i]);
                $scope.resLogo.push($scope.path1);
              }
              if(response.data[i].URL.indexOf("amazon") > -1 && $scope.data.cb2 == true){
                $scope.resDate.push(response.data[i]);
                $scope.resLogo.push($scope.path2);
              }
              if(response.data[i].URL.indexOf("insa") > -1 && $scope.data.cb3 == true){
                $scope.resDate.push(response.data[i]);
                $scope.resLogo.push($scope.path);
              }
            }
          }
        }
      });

    };

  }]);

  app.controller('SiteController', ['$http', '$scope', function($http,$scope){

      $scope.joursFB = [];
      $scope.nbFB = [];

      $scope.joursAmazon = [];
      $scope.nbAmazon = [];

      $scope.joursZimbra = [];
      $scope.nbZimbra = [];

      $scope.joursAll = [];
      $scope.nbAll = [];

      $scope.ctx1 = document.getElementById("myChart1");
      $scope.ctxf = document.getElementById("myChart2");
      $scope.ctxA= document.getElementById("myChart3");
      $scope.ctAutres= document.getElementById("myChart4");
      $scope.ctxZ= document.getElementById("myChartZ");

      $http.get("https://127.0.0.1:8080/site")
      .then(function(response){
        for(var i = 0; i < response.data.length; i++) {
          if (typeof response.data[i].URL != 'undefined'){
            $scope.date = response.data[i].date.split('T')[0].split("-");
            $scope.date = $scope.date[2] +"/" + $scope.date[1] + "/" + $scope.date[0].split('0')[1];
            if($scope.joursAll.indexOf($scope.date) >= 0){
                $scope.nbAll[$scope.joursAll.indexOf($scope.date)] = $scope.nbAll[$scope.joursAll.indexOf($scope.date)] + 1;
            }else {
                        $scope.joursAll.push($scope.date);
                        $scope.nbAll[$scope.joursAll.indexOf($scope.date)] = 1;
            }

            if ((response.data[i].URL).indexOf("facebook") !== -1){
              $scope.date = response.data[i].date.split('T')[0].split("-");
              $scope.datef = $scope.date[2] +"/" + $scope.date[1] + "/" + $scope.date[0].split('0')[1];

              if($scope.joursFB.indexOf($scope.datef) >= 0){
                $scope.nbFB[$scope.joursFB.indexOf($scope.datef)] = $scope.nbFB[$scope.joursFB.indexOf($scope.datef)] + 1;

              }
              else{
                $scope.joursFB.push($scope.datef);
                $scope.nbFB[$scope.joursFB.indexOf($scope.datef)] = 1;

              }
            }
            if ((response.data[i].URL).indexOf("insa-lyon") !== -1){
              $scope.date = response.data[i].date.split('T')[0].split("-");
              $scope.dateZ = $scope.date[2] +"/" + $scope.date[1] + "/" + $scope.date[0].split('0')[1];

              if($scope.joursZimbra.indexOf($scope.dateZ) >= 0){
                $scope.nbFB[$scope.joursZimbra.indexOf($scope.dateZ)] = $scope.nbZimbra[$scope.joursZimbra.indexOf($scope.dateZ)] + 1;

              }
              else{
                $scope.joursZimbra.push($scope.dateZ);
                $scope.nbZimbra[$scope.joursZimbra.indexOf($scope.dateZ)] = 1;

              }
            }

            if ((response.data[i].URL).indexOf("amazon") !== -1){
              $scope.date = response.data[i].date.split('T')[0].split("-");
              $scope.dateA = $scope.date[2] +"/" + $scope.date[1] + "/" + $scope.date[0].split('0')[1];

              if($scope.joursAmazon.indexOf($scope.datef) >= 0){
                $scope.nbAmazon[$scope.joursAmazon.indexOf($scope.dateA)] = $scope.nbAmazon[$scope.joursAmazon.indexOf($scope.dateA)] + 1;

              }
              else{
                $scope.joursAmazon.push($scope.dateA);
                $scope.nbAmazon[$scope.joursAmazon.indexOf($scope.dateA)] = 1;
                console.log($scope.dateA);

              }

            if ((response.data[i].URL).indexOf("amazon") === -1 && (response.data[i].URL).indexOf("zimbra") === -1)  {
                $scope.date = response.data[i].date.split('T')[0].split("-");
                $scope.dateAu = $scope.date[2] +"/" + $scope.date[1] + "/" + $scope.date[0].split('0')[1];
                if($scope.joursAutres.indexOf($scope.dateAu) >= 0){
                  $scope.nbAutres[$scope.joursAutres.indexOf($scope.dateAu)] = $scope.nbAutres[$scope.joursAutres.indexOf($scope.dateAu)] + 1;

                }

                else{
                  $scope.joursAutres.push($scope.dateAu);
                  $scope.nbAutres[$scope.joursAutres.indexOf($scope.dateAu)] = 1;

                }

              }

            }
          }
          }

        });

      $scope.option = {
        title: {
          display: true,
          text: "Nombre d'identifiants récupérés par jour"
        },
        responsive: true,
        legend: {
          display: false
        },
        scales: {
          xAxes: [{
            display: true,
            ticks: {
              beginAtZero: true
            },
            scaleLabel: {
              display: true,
              labelString: "Date"
            }
          }],
          yAxes: [{
            display: true,
            ticks: {
              beginAtZero: true
            },
            scaleLabel: {
              display: true,
              labelString: "Occurences"
            }
          }]
        }
      };

      $scope.donneesfb = {
        labels: $scope.joursFB,
        datasets: [
          {
            backgroundColor: 'rgba(54, 162, 235, 0.2)',
            borderColor: 'rgba(54, 162, 235, 1)',
            fill: true,
            spanGaps: false,
            lineTension: 0.1,
            data: $scope.nbFB
          }
        ]
      };
      $scope.donneesZ = {
        labels: $scope.joursZimbra,
        datasets: [
          {
            backgroundColor: 'rgba(54, 162, 235, 0.2)',
            borderColor: 'rgba(54, 162, 235, 1)',
            fill: true,
            spanGaps: false,
            lineTension: 0.1,
            data: $scope.nbZimbra
          }
        ]
      };
      $scope.donneesAutres = {
        labels: $scope.joursAutres,
        datasets: [
          {
            backgroundColor: 'rgba(54, 162, 235, 0.2)',
            borderColor: 'rgba(54, 162, 235, 1)',
            fill: true,
            spanGaps: false,
            lineTension: 0.1,
            data: $scope.nbAutres
          }
        ]
      };

      $scope.donneesA = {
        labels: $scope.joursAmazon,
        datasets: [
          {
            backgroundColor: 'rgba(54, 162, 235, 0.2)',
            borderColor: 'rgba(54, 162, 235, 1)',
            fill: true,
            spanGaps: false,
            lineTension: 0.1,
            data: $scope.nbAmazon
          }
        ]
      };
      $scope.donneesall = {
        labels: $scope.joursAll,
        datasets: [
          {
            backgroundColor: 'rgba(54, 162, 235, 0.2)',
            borderColor: 'rgba(54, 162, 235, 1)',
            fill: true,
            spanGaps: false,
            lineTension: 0.1,
            data: $scope.nbAll
          }
        ]
      };
//Charte facebook
$scope.myBarChart = new Chart($scope.ctxf, {
        type: 'line',
        data: $scope.donneesfb,
        options: $scope.option
      });
$scope.myBarChart = new Chart($scope.ctxZ, {
        type: 'line',
        data: $scope.donneesZ,
        options: $scope.option
      });
//charte pour tous les sites
$scope.myBarChart = new Chart($scope.ctx1, {
        type: 'line',
        data: $scope.donneesall,
        options: $scope.option
      });

// chart Amazon
$scope.myBarChartA = new Chart($scope.ctxA, {
        type: 'line',
        data: $scope.donneesA,
        options: $scope.option
      });

$scope.myBarChartAutres = new Chart($scope.ctAutres, {
        type: 'line',
        data: $scope.donneesAutres,
        options: $scope.option
      });

  }]);

  app.controller('ChartController', ['$http', '$scope', function($http,$scope){
      $scope.nbIdentifiants = [0,0,0];
      $scope.sites = ["Facebook", "Amazon", "Zimbra"];
      $scope.background_color = ['rgba(255, 99, 132, 0.2)','rgba(54, 162, 235, 0.2)','rgba(255, 206, 86, 0.2)'];
      $scope.border_color = ['rgba(255,99,132,1)','rgba(54, 162, 235, 1)','rgba(255, 206, 86, 1)'];
      $scope.ctx = document.getElementById("myChart");

      $http.get("https://127.0.0.1:8080/site")
      .then(function(response){
        for(var i = 0; i < response.data.length; i++) {
          if (typeof response.data[i].URL != 'undefined'){
            if ((response.data[i].URL).indexOf("facebook") !== -1){
              $scope.nbIdentifiants[0] = $scope.nbIdentifiants[0] + 1;
            } else if (response.data[i].URL.indexOf("amazon") !== -1){
              $scope.nbIdentifiants[1] = $scope.nbIdentifiants[1] + 1;
            } else
            $scope.nbIdentifiants[2] = $scope.nbIdentifiants[2] + 1;
            } else i++;
        }
      });

      $scope.option = {
        title: {
          display: true,
          text: "Nombre d'identifiants récupérés par site"
        },
        responsive: true,
        legend: {
          display: false
        },
        scales: {
          xAxes: [{
            display: true,
            ticks: {
              min: 0,
              stepSize: 1
            },
            scaleLabel: {
              display: true,
              labelString: "Sites"
            }
          }],
          yAxes: [{
            display: true,
            ticks: {
              min: 0,
              stepSize: 1
            },
            scaleLabel: {
              display: true,
              labelString: "Occurences"
            }
          }]
        }
      };

      $scope.donnees = {
        labels: $scope.sites,
        datasets: [
          {
            backgroundColor: $scope.background_color,
            borderColor: $scope.border_color,
            borderWidth: 1,
            data: $scope.nbIdentifiants
          }
        ]
      };

      $scope.myBarChart = new Chart($scope.ctx, {
        type: 'bar',
        data: $scope.donnees,
       options: $scope.option
      });

//chare google id/jours

$scope.ctxxx = document.getElementById("myChart4");
$scope.myBarChart = new Chart($scope.ctxxx, {
        type: 'bar',
        data: $scope.donnees,
        options: $scope.option
      });

  }]);

app.controller('LeftCtrl', function ($scope, $timeout, $mdSidenav, $log) {

    $scope.toggleLeft = buildDelayedToggler('left');

    function change_tabs(){

    }

    function debounce(func, wait, context) {
       var timer;

       return function debounced() {
         var context = $scope,
             args = Array.prototype.slice.call(arguments);
         $timeout.cancel(timer);
         timer = $timeout(function() {
           timer = undefined;
           func.apply(context, args);
         }, wait || 10);
       };
 }

    function buildDelayedToggler(navID) {
      return debounce(function() {
        // Component lookup should always be available since we are not using `ng-if`
        $mdSidenav(navID)
          .toggle()
          .then(function () {
            $log.debug("toggle " + navID + " is done");
          });
      }, 200);
    }

    $scope.close = function () {
      // Component lookup should always be available since we are not using `ng-if`
      $mdSidenav('left').close()
        .then(function () {
          $log.debug("close LEFT is done");
        });

    };
  });

})();


text:
brickscape.5minlab.com

## Build
```bash
pip install -r requirements.txt
./main.py

# build result : /docs
```

redpajama_set_name: RedPajamaGithub


text:
package vh.Map;

/**
 * @author ane
 *
 * @version 2:26:57 PM 2014
 *
 */
public class User implements Comparable<User> {

	private String firstName;
	private String lastName;
	private int salary;

	public User(String firstName, String lastName, int salary) {
		super();
		this.firstName = firstName;
		this.lastName = lastName;
		this.salary = salary;
	}

	public String getFirstName() {
		return firstName;
	}

	public void setFirstName(String firstName) {
		this.firstName = firstName;
	}

	public String getLastName() {
		return lastName;
	}

	public void setLastName(String lastName) {
		this.lastName = lastName;
	}

	public int getSalary() {
		return salary;
	}

	public void setSalary(int salary) {
		this.salary = salary;
	}

	@Override
	public String toString() {
	    return firstName + " " + lastName + " " + salary;
	}

	@Override
	public int compareTo(User o) {
		// TODO Auto-generated method stub
		return this.firstName.compareTo(o.firstName);
	}
}


text:
package com.azure.resourcemanager.hdinsight.generated;

import com.azure.core.util.BinaryData;
import com.azure.resourcemanager.hdinsight.models.EncryptionInTransitProperties;
import org.junit.jupiter.api.Assertions;
import org.junit.jupiter.api.Test;

public final class EncryptionInTransitPropertiesTests {
    @Test
    public void testDeserialize() {
        EncryptionInTransitProperties model =
            BinaryData
                .fromString("{\"isEncryptionInTransitEnabled\":false}")
                .toObject(EncryptionInTransitProperties.class);
        Assertions.assertEquals(false, model.isEncryptionInTransitEnabled());
    }

    @Test
    public void testSerialize() {
        EncryptionInTransitProperties model =
            new EncryptionInTransitProperties().withIsEncryptionInTransitEnabled(false);
        model = BinaryData.fromObject(model).toObject(EncryptionInTransitProperties.class);
        Assertions.assertEquals(false, model.isEncryptionInTransitEnabled());
    }
}


text:
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout
    xmlns:android="http://schemas.android.com/apk/res/android"
    android:layout_width="match_parent"
    android:layout_height="match_parent"
    android:background="@color/colorBgGary"
    android:orientation="vertical">
    <include layout="@layout/activity_base_title"/>

    <TextView
        android:layout_width="match_parent"
        android:layout_height="@dimen/dm180"
        android:background="@color/colorWhite"
        android:gravity="left|center_vertical"
        android:paddingLeft="@dimen/dm040"
        android:paddingRight="@dimen/dm020"
        android:text="2.您家庭预计进行证券投资的资金占家庭现有总资产(不含自住、自用房产及汽车等固定资产)的比例是"
        android:textColor="@color/titleText"
        android:textSize="@dimen/dm028"/>
    <View
        android:layout_width="match_parent"
        android:layout_height="1dp"
        android:background="@color/gray"/>
    <LinearLayout
        android:id="@+id/ll_myself_rvaluate_first"
        android:layout_width="match_parent"
        android:layout_height="@dimen/dm090"
        android:background="@color/colorWhite"
        android:orientation="horizontal">
        <RelativeLayout
            android:layout_width="wrap_content"
            android:layout_height="wrap_content"
            android:layout_gravity="center">
            <ImageView
                android:id="@+id/iv_myself_rvaluate_first_noselect"
                android:layout_width="@dimen/dm035"
                android:layout_height="@dimen/dm035"
                android:visibility="invisible"
                android:layout_marginLeft="@dimen/dm040"
                android:src="@drawable/icon_no_select"/>
            <ImageView
                android:id="@+id/iv_myself_rvaluate_first_select"
                android:layout_width="@dimen/dm035"
                android:layout_height="@dimen/dm035"
                android:layout_marginLeft="@dimen/dm040"
                android:src="@drawable/icon_select"
                android:visibility="visible"/>
        </RelativeLayout>
        <TextView
            android:layout_width="match_parent"
            android:layout_height="@dimen/dm090"
            android:background="@color/colorWhite"
            android:gravity="left|center_vertical"
            android:paddingLeft="@dimen/dm030"
            android:text="70%以上"
            android:textColor="@color/titleText"
            android:textSize="@dimen/dm028"/>
    </LinearLayout>
    <View
        android:layout_width="match_parent"
        android:layout_height="1dp"
        android:background="@color/colorQuestionGary"/>
    <LinearLayout
        android:id="@+id/ll_myself_rvaluate_second"
        android:layout_width="match_parent"
        android:layout_height="@dimen/dm090"
        android:background="@color/colorWhite"
        android:orientation="horizontal">
        <RelativeLayout
            android:layout_width="wrap_content"
            android:layout_height="wrap_content"
            android:layout_gravity="center">
            <ImageView
                android:id="@+id/iv_myself_rvaluate_second_noselect"
                android:layout_width="@dimen/dm035"
                android:layout_height="@dimen/dm035"
                android:layout_marginLeft="@dimen/dm040"
                android:src="@drawable/icon_no_select"/>
            <ImageView
                android:id="@+id/iv_myself_rvaluate_second_select"
                android:layout_width="@dimen/dm035"
                android:layout_height="@dimen/dm035"
                android:layout_marginLeft="@dimen/dm040"
                android:src="@drawable/icon_select"
                android:visibility="invisible"/>
        </RelativeLayout>
        <TextView
            android:layout_width="match_parent"
            android:layout_height="@dimen/dm090"
            android:background="@color/colorWhite"
            android:gravity="left|center_vertical"
            android:paddingLeft="@dimen/dm030"
            android:text="50%-70%"
            android:textColor="@color/titleText"
            android:textSize="@dimen/dm028"/>
    </LinearLayout>
    <View
        android:layout_width="match_parent"
        android:layout_height="1dp"
        android:background="@color/colorQuestionGary"/>
    <LinearLayout
        android:id="@+id/ll_myself_rvaluate_third"
        android:layout_width="match_parent"
        android:layout_height="@dimen/dm090"
        android:background="@color/colorWhite"
        android:orientation="horizontal">
        <RelativeLayout
            android:layout_width="wrap_content"
            android:layout_height="wrap_content"
            android:layout_gravity="center">
            <ImageView
                android:id="@+id/iv_myself_rvaluate_third_noselect"
                android:layout_width="@dimen/dm035"
                android:layout_height="@dimen/dm035"
                android:layout_marginLeft="@dimen/dm040"
                android:src="@drawable/icon_no_select"/>
            <ImageView
                android:id="@+id/iv_myself_rvaluate_third_select"
                android:layout_width="@dimen/dm035"
                android:layout_height="@dimen/dm035"
                android:layout_marginLeft="@dimen/dm040"
                android:visibility="invisible"
                android:src="@drawable/icon_select"/>
        </RelativeLayout>
        <TextView
            android:layout_width="match_parent"
            android:layout_height="@dimen/dm090"
            android:background="@color/colorWhite"
            android:gravity="left|center_vertical"
            android:paddingLeft="@dimen/dm030"
            android:text="30%-50%"
            android:textColor="@color/titleText"
            android:textSize="@dimen/dm028"/>
    </LinearLayout>
    <View
        android:layout_width="match_parent"
        android:layout_height="1dp"
        android:background="@color/colorQuestionGary"/>
    <LinearLayout
        android:id="@+id/ll_myself_rvaluate_fourth"
        android:layout_width="match_parent"
        android:layout_height="@dimen/dm090"
        android:background="@color/colorWhite"
        android:orientation="horizontal">
        <RelativeLayout
            android:layout_width="wrap_content"
            android:layout_height="wrap_content"
            android:layout_gravity="center">
            <ImageView
                android:id="@+id/iv_myself_rvaluate_fourth_noselect"
                android:layout_width="@dimen/dm035"
                android:layout_height="@dimen/dm035"
                android:layout_marginLeft="@dimen/dm040"
                android:src="@drawable/icon_no_select"/>
            <ImageView
                android:id="@+id/iv_myself_rvaluate_fourth_select"
                android:layout_width="@dimen/dm035"
                android:layout_height="@dimen/dm035"
                android:layout_marginLeft="@dimen/dm040"
                android:src="@drawable/icon_select"
                android:visibility="invisible"/>
        </RelativeLayout>
        <TextView
            android:layout_width="match_parent"
            android:layout_height="@dimen/dm090"
            android:background="@color/colorWhite"
            android:gravity="left|center_vertical"
            android:paddingLeft="@dimen/dm030"
            android:text="10%-30%"
            android:textColor="@color/titleText"
            android:textSize="@dimen/dm028"/>
    </LinearLayout>
    <View
        android:layout_width="match_parent"
        android:layout_height="1dp"
        android:background="@color/colorQuestionGary"/>
    <LinearLayout
        android:id="@+id/ll_myself_rvaluate_fifth"
        android:layout_width="match_parent"
        android:layout_height="@dimen/dm090"
        android:background="@color/colorWhite"
        android:orientation="horizontal">
        <RelativeLayout
            android:layout_width="wrap_content"
            android:layout_height="wrap_content"
            android:layout_gravity="center">
            <ImageView
                android:id="@+id/iv_myself_rvaluate_fifth_noselect"
                android:layout_width="@dimen/dm035"
                android:layout_height="@dimen/dm035"
                android:layout_marginLeft="@dimen/dm040"
                android:src="@drawable/icon_no_select"/>
            <ImageView
                android:id="@+id/iv_myself_rvaluate_fifth_select"
                android:layout_width="@dimen/dm035"
                android:layout_height="@dimen/dm035"
                android:layout_marginLeft="@dimen/dm040"
                android:src="@drawable/icon_select"
                android:visibility="invisible"/>
        </RelativeLayout>
        <TextView
            android:layout_width="match_parent"
            android:layout_height="@dimen/dm090"
            android:background="@color/colorWhite"
            android:gravity="left|center_vertical"
            android:paddingLeft="@dimen/dm030"
            android:text="10%以下"
            android:textColor="@color/titleText"
            android:textSize="@dimen/dm028"/>
    </LinearLayout>
    <View
        android:layout_width="match_parent"
        android:layout_height="1dp"
        android:background="@color/gray"/>
    <RelativeLayout
        android:id="@+id/rl_myself_rvaluate_confirm"
        android:layout_width="match_parent"
        android:layout_height="@dimen/dm090"
        android:background="@color/colorWhite">
        <LinearLayout
            android:layout_width="wrap_content"
            android:layout_height="wrap_content"
            android:layout_centerInParent="true"
            android:orientation="horizontal">
            <TextView
                android:layout_width="wrap_content"
                android:layout_height="wrap_content"
                android:background="@color/colorWhite"
                android:text="继续"
                android:textColor="@color/colorTitle"
                android:textSize="@dimen/dm030"/>
            <ImageView
                android:layout_width="@dimen/dm035"
                android:layout_gravity="center"
                android:layout_marginLeft="@dimen/dm010"
                android:layout_height="@dimen/dm020"
                android:src="@drawable/myself_next"/>
        </LinearLayout>

    </RelativeLayout>

</LinearLayout>


text:
import flask
from flask import Blueprint
from flask import Flask

from supplychainpy.reporting.blueprints.models import InventoryAnalysis, MasterSkuList, \
    Recommendations, ProfileRecommendation
from supplychainpy.reporting.config.settings import ProdConfig
from supplychainpy.reporting.extensions import db

recommendations_blueprint = Blueprint('recommendations', __name__, template_folder='templates')

app = Flask(__name__)
app.config.from_object(ProdConfig)

@recommendations_blueprint.route('/recommended/<string:sku_id>', methods=['GET'])
def recommended(sku_id: str = None):
    """The route to the rest api for retrieving recommendations for a SKU.

    Args:
        sku_id:     The SKU ID for a product.
    Returns:

    """
    """Rest api for sku level recommendations."""
    sku = db.session.query(MasterSkuList).filter(MasterSkuList.id == sku_id).first()
    inventory = db.session.query(InventoryAnalysis.id).filter(InventoryAnalysis.sku_id == sku.id).first()
    recommend = db.session.query(Recommendations.statement).filter(Recommendations.analysis_id == inventory.id).all()
    return flask.jsonify(json_list=recommend)

@recommendations_blueprint.route('/feed', methods=['GET'])
def recommendations():
    recommend = db.session.query(Recommendations).all()
    profile = db.session.query(ProfileRecommendation).all()
    inventory = db.session.query(InventoryAnalysis).all()
    return flask.render_template('feed.html', inventory=inventory, profile=profile, recommendations=recommend)


text:
using System;
using System.Collections.Generic;
using System.Text;
using NUnit.Framework;
using System.Collections;
using libsecondlife.StructuredData;

namespace libsecondlife.Tests
{
    /// <summary>
    /// XmlLLSDTests is a suite of tests for libsl implementation of the LLSD XML format.
    ///
    /// </summary>
    [TestFixture]
    public class XmlLLSDTests
    {
        /// <summary>
        /// Test that the sample LLSD supplied by Linden Lab is properly deserialized.
        /// The LLSD string in the test is a pared down version of the sample on the blog.
        /// http://wiki.secondlife.com/wiki/LLSD
        /// </summary>
        [Test]
        public void DeserializeLLSDSample()
        {
            LLSD theLLSD = null;
            LLSDMap map = null;
            LLSD tempLLSD = null;
            LLSDUUID tempUUID = null;
            LLSDString tempStr = null;
            LLSDReal tempReal = null;

            String testLLSD = @"<?xml version='1.0' encoding='UTF-8'?>
            <llsd>
                <map>
	                <key>region_id</key>
	                <uuid>67153d5b-3659-afb4-8510-adda2c034649</uuid>
	                <key>scale</key>
	                <string>one minute</string>
	                <key>simulator statistics</key>
	                <map>
		                <key>time dilation</key>
		                <real>0.9878624</real>
		                <key>sim fps</key>
		                <real>44.38898</real>
		                <key>agent updates per second</key>
		                <real>nan</real>
		                <key>total task count</key>
		                <real>4</real>
		                <key>active task count</key>
		                <real>0</real>
		                <key>pending uploads</key>
		                <real>0.0001096525</real>
	                </map>
                </map>
            </llsd>";

            //Deserialize the string
            byte[] bytes = Encoding.UTF8.GetBytes(testLLSD);
            theLLSD = LLSDParser.DeserializeXml(bytes);

            //Confirm the contents
            Assert.IsNotNull(theLLSD);
            Assert.IsTrue(theLLSD is LLSDMap);
            Assert.IsTrue(theLLSD.Type == LLSDType.Map);
            map = (LLSDMap)theLLSD;

            tempLLSD = map["region_id"];
            Assert.IsNotNull(tempLLSD);
            Assert.IsTrue(tempLLSD is LLSDUUID);
            Assert.IsTrue(tempLLSD.Type == LLSDType.UUID);
            tempUUID = (LLSDUUID)tempLLSD;
            Assert.AreEqual(new LLUUID("67153d5b-3659-afb4-8510-adda2c034649"), tempUUID.AsUUID());

            tempLLSD = map["scale"];
            Assert.IsNotNull(tempLLSD);
            Assert.IsTrue(tempLLSD is LLSDString);
            Assert.IsTrue(tempLLSD.Type == LLSDType.String);
            tempStr = (LLSDString)tempLLSD;
            Assert.AreEqual("one minute", tempStr.AsString());

            tempLLSD = map["simulator statistics"];
            Assert.IsNotNull(tempLLSD);
            Assert.IsTrue(tempLLSD is LLSDMap);
            Assert.IsTrue(tempLLSD.Type == LLSDType.Map);
            map = (LLSDMap)tempLLSD;

            tempLLSD = map["time dilation"];
            Assert.IsNotNull(tempLLSD);
            Assert.IsTrue(tempLLSD is LLSDReal);
            Assert.IsTrue(tempLLSD.Type == LLSDType.Real);
            tempReal = (LLSDReal)tempLLSD;

            Assert.AreEqual(0.9878624d, tempReal.AsReal());
            //TODO - figure out any relevant rounding variability for 64 bit reals
            tempLLSD = map["sim fps"];
            Assert.IsNotNull(tempLLSD);
            Assert.IsTrue(tempLLSD is LLSDReal);
            Assert.IsTrue(tempLLSD.Type == LLSDType.Real);
            tempReal = (LLSDReal)tempLLSD;
            Assert.AreEqual(44.38898d, tempReal.AsReal());

            tempLLSD = map["agent updates per second"];
            Assert.IsNotNull(tempLLSD);
            Assert.IsTrue(tempLLSD is LLSDReal);
            Assert.IsTrue(tempLLSD.Type == LLSDType.Real);
            tempReal = (LLSDReal)tempLLSD;
            Assert.AreEqual(Double.NaN, tempLLSD.AsReal());

            tempLLSD = map["total task count"];
            Assert.IsNotNull(tempLLSD);
            Assert.IsTrue(tempLLSD is LLSDReal);
            Assert.IsTrue(tempLLSD.Type == LLSDType.Real);
            tempReal = (LLSDReal)tempLLSD;
            Assert.AreEqual(4.0d, tempReal.AsReal());

            tempLLSD = map["active task count"];
            Assert.IsNotNull(tempLLSD);
            Assert.IsTrue(tempLLSD is LLSDReal);
            Assert.IsTrue(tempLLSD.Type == LLSDType.Real);
            tempReal = (LLSDReal)tempLLSD;
            Assert.AreEqual(0.0d, tempReal.AsReal());

            tempLLSD = map["pending uploads"];
            Assert.IsNotNull(tempLLSD);
            Assert.IsTrue(tempLLSD is LLSDReal);
            Assert.IsTrue(tempLLSD.Type == LLSDType.Real);
            tempReal = (LLSDReal)tempLLSD;
            Assert.AreEqual(0.0001096525d, tempReal.AsReal());

        }

        /// <summary>
        /// Test that various Real representations are parsed correctly.
        /// </summary>
        [Test]
        public void DeserializeReals()
        {
            LLSD theLLSD = null;
            LLSDArray array = null;
            LLSDReal tempReal = null;

            String testLLSD = @"<?xml version='1.0' encoding='UTF-8'?>
            <llsd>
                <array>
                    <real>44.38898</real>
		            <real>nan</real>
		            <real>4</real>
                    <real>-13.333</real>
                    <real/>
                </array>
            </llsd>";
            //Deserialize the string
            byte[] bytes = Encoding.UTF8.GetBytes(testLLSD);
            theLLSD = LLSDParser.DeserializeXml(bytes);

            Assert.IsTrue(theLLSD is LLSDArray);
            array = (LLSDArray)theLLSD;

            Assert.AreEqual(LLSDType.Real, array[0].Type);
            tempReal = (LLSDReal)array[0];
            Assert.AreEqual(44.38898d, tempReal.AsReal());

            Assert.AreEqual(LLSDType.Real, array[1].Type);
            tempReal = (LLSDReal)array[1];
            Assert.AreEqual(Double.NaN, tempReal.AsReal());

            Assert.AreEqual(LLSDType.Real, array[2].Type);
            tempReal = (LLSDReal)array[2];
            Assert.AreEqual(4.0d, tempReal.AsReal());

            Assert.AreEqual(LLSDType.Real, array[3].Type);
            tempReal = (LLSDReal)array[3];
            Assert.AreEqual(-13.333d, tempReal.AsReal());

            Assert.AreEqual(LLSDType.Real, array[4].Type);
            tempReal = (LLSDReal)array[4];
            Assert.AreEqual(0d, tempReal.AsReal());
        }

        /// <summary>
        /// Test that various String representations are parsed correctly.
        /// </summary>
        [Test]
        public void DeserializeStrings()
        {
            LLSD theLLSD = null;
            LLSDArray array = null;
            LLSDString tempStr = null;

            String testLLSD = @"<?xml version='1.0' encoding='UTF-8'?>
            <llsd>
                <array>
                    <string>Kissling</string>
                    <string>Attack ships on fire off the shoulder of Orion</string>
                    <string>< > & ' "</string>
                    <string/>
                </array>
            </llsd>";
            //Deserialize the string
            byte[] bytes = Encoding.UTF8.GetBytes(testLLSD);
            theLLSD = LLSDParser.DeserializeXml(bytes);

            Assert.IsTrue(theLLSD is LLSDArray);
            array = (LLSDArray)theLLSD;

            Assert.AreEqual(LLSDType.String, array[0].Type);
            tempStr = (LLSDString)array[0];
            Assert.AreEqual("Kissling", tempStr.AsString());

            Assert.AreEqual(LLSDType.String, array[1].Type);
            tempStr = (LLSDString)array[1];
            Assert.AreEqual("Attack ships on fire off the shoulder of Orion", tempStr.AsString());

            Assert.AreEqual(LLSDType.String, array[2].Type);
            tempStr = (LLSDString)array[2];
            Assert.AreEqual("< > & \' \"", tempStr.AsString());

            Assert.AreEqual(LLSDType.String, array[3].Type);
            tempStr = (LLSDString)array[3];
            Assert.AreEqual("", tempStr.AsString());

        }

        /// <summary>
        /// Test that various Integer representations are parsed correctly.
        /// These tests currently only test for values within the range of a
        /// 32 bit signed integer, even though the LLSD specification says
        /// the type is a 64 bit signed integer, because LLSInteger is currently
        /// implemented using int, a.k.a. Int32.  Not testing Int64 range until
        /// it's understood if there was a design reason for the Int32.
        /// </summary>
        [Test]
        public void DeserializeIntegers()
        {
            LLSD theLLSD = null;
            LLSDArray array = null;
            LLSDInteger tempInt = null;

            String testLLSD = @"<?xml version='1.0' encoding='UTF-8'?>
            <llsd>
                <array>
                    <integer>2147483647</integer>
		            <integer>-2147483648</integer>
		            <integer>0</integer>
                    <integer>013</integer>
                    <integer/>
                </array>
            </llsd>";
            //Deserialize the string
            byte[] bytes = Encoding.UTF8.GetBytes(testLLSD);
            theLLSD = LLSDParser.DeserializeXml(bytes);

            Assert.IsTrue(theLLSD is LLSDArray);
            array = (LLSDArray)theLLSD;

            Assert.AreEqual(LLSDType.Integer, array[0].Type);
            tempInt = (LLSDInteger)array[0];
            Assert.AreEqual(2147483647, tempInt.AsInteger());

            Assert.AreEqual(LLSDType.Integer, array[1].Type);
            tempInt = (LLSDInteger)array[1];
            Assert.AreEqual(-2147483648, tempInt.AsInteger());

            Assert.AreEqual(LLSDType.Integer, array[2].Type);
            tempInt = (LLSDInteger)array[2];
            Assert.AreEqual(0, tempInt.AsInteger());

            Assert.AreEqual(LLSDType.Integer, array[3].Type);
            tempInt = (LLSDInteger)array[3];
            Assert.AreEqual(13, tempInt.AsInteger());

            Assert.AreEqual(LLSDType.Integer, array[4].Type);
            tempInt = (LLSDInteger)array[4];
            Assert.AreEqual(0, tempInt.AsInteger());
        }

        /// <summary>
        /// Test that various UUID representations are parsed correctly.
        /// </summary>
        [Test]
        public void DeserializeUUID()
        {
            LLSD theLLSD = null;
            LLSDArray array = null;
            LLSDUUID tempUUID = null;

            String testLLSD = @"<?xml version='1.0' encoding='UTF-8'?>
            <llsd>
                <array>
                    <uuid>d7f4aeca-88f1-42a1-b385-b9db18abb255</uuid>
                    <uuid/>
                </array>
            </llsd>";
            //Deserialize the string
            byte[] bytes = Encoding.UTF8.GetBytes(testLLSD);
            theLLSD = LLSDParser.DeserializeXml(bytes);

            Assert.IsTrue(theLLSD is LLSDArray);
            array = (LLSDArray)theLLSD;

            Assert.AreEqual(LLSDType.UUID, array[0].Type);
            tempUUID = (LLSDUUID)array[0];
            Assert.AreEqual(new LLUUID("d7f4aeca-88f1-42a1-b385-b9db18abb255"), tempUUID.AsUUID());

            Assert.AreEqual(LLSDType.UUID, array[1].Type);
            tempUUID = (LLSDUUID)array[1];
            Assert.AreEqual(LLUUID.Zero, tempUUID.AsUUID());
        }

        /// <summary>
        /// Test that various date representations are parsed correctly.
        /// </summary>
        [Test]
        public void DeserializeDates()
        {
            LLSD theLLSD = null;
            LLSDArray array = null;
            LLSDDate tempDate = null;
            DateTime testDate;

            String testLLSD = @"<?xml version='1.0' encoding='UTF-8'?>
            <llsd>
                <array>
                    <date>2006-02-01T14:29:53Z</date>
                    <date>1999-01-01T00:00:00Z</date>
                    <date/>
                </array>
            </llsd>";
            //Deserialize the string
            byte[] bytes = Encoding.UTF8.GetBytes(testLLSD);
            theLLSD = LLSDParser.DeserializeXml(bytes);

            Assert.IsTrue(theLLSD is LLSDArray);
            array = (LLSDArray)theLLSD;

            Assert.AreEqual(LLSDType.Date, array[0].Type);
            tempDate = (LLSDDate)array[0];
            DateTime.TryParse("2006-02-01T14:29:53Z", out testDate);
            Assert.AreEqual(testDate, tempDate.AsDate());

            Assert.AreEqual(LLSDType.Date, array[1].Type);
            tempDate = (LLSDDate)array[1];
            DateTime.TryParse("1999-01-01T00:00:00Z", out testDate);
            Assert.AreEqual(testDate, tempDate.AsDate());

            Assert.AreEqual(LLSDType.Date, array[2].Type);
            tempDate = (LLSDDate)array[2];
            Assert.AreEqual(Helpers.Epoch, tempDate.AsDate());
        }

        /// <summary>
        /// Test that various Boolean representations are parsed correctly.
        /// </summary>
        [Test]
        public void DeserializeBoolean()
        {
            LLSD theLLSD = null;
            LLSDArray array = null;
            LLSDBoolean tempBool = null;

            String testLLSD = @"<?xml version='1.0' encoding='UTF-8'?>
            <llsd>
                <array>
                    <boolean>1</boolean>
                    <boolean>true</boolean>
                    <boolean>0</boolean>
                    <boolean>false</boolean>
                    <boolean/>
                </array>
            </llsd>";
            //Deserialize the string
            byte[] bytes = Encoding.UTF8.GetBytes(testLLSD);
            theLLSD = LLSDParser.DeserializeXml(bytes);

            Assert.IsTrue(theLLSD is LLSDArray);
            array = (LLSDArray)theLLSD;

            Assert.AreEqual(LLSDType.Boolean, array[0].Type);
            tempBool = (LLSDBoolean)array[0];
            Assert.AreEqual(true, tempBool.AsBoolean());

            Assert.AreEqual(LLSDType.Boolean, array[1].Type);
            tempBool = (LLSDBoolean)array[1];
            Assert.AreEqual(true, tempBool.AsBoolean());

            Assert.AreEqual(LLSDType.Boolean, array[2].Type);
            tempBool = (LLSDBoolean)array[2];
            Assert.AreEqual(false, tempBool.AsBoolean());

            Assert.AreEqual(LLSDType.Boolean, array[3].Type);
            tempBool = (LLSDBoolean)array[3];
            Assert.AreEqual(false, tempBool.AsBoolean());

            Assert.AreEqual(LLSDType.Boolean, array[4].Type);
            tempBool = (LLSDBoolean)array[4];
            Assert.AreEqual(false, tempBool.AsBoolean());
        }

        /// <summary>
        /// Test that binary elements are parsed correctly.
        /// </summary>
        [Test]
        public void DeserializeBinary()
        {
            LLSD theLLSD = null;
            LLSDArray array = null;
            LLSDBinary tempBinary = null;

            String testLLSD = @"<?xml version='1.0' encoding='UTF-8'?>
            <llsd>
                <array>
                    <binary encoding='base64'>cmFuZG9t</binary>
                    <binary>dGhlIHF1aWNrIGJyb3duIGZveA==</binary>
                    <binary/>
                </array>
            </llsd>";

            //Deserialize the string
            byte[] bytes = Encoding.UTF8.GetBytes(testLLSD);
            theLLSD = LLSDParser.DeserializeXml(bytes);

            Assert.IsTrue(theLLSD is LLSDArray);
            array = (LLSDArray)theLLSD;

            Assert.AreEqual(LLSDType.Binary, array[0].Type);
            tempBinary = (LLSDBinary)array[0];
            byte[] testData1 = {114, 97, 110, 100, 111, 109};
            TestBinary(tempBinary, testData1);

            Assert.AreEqual(LLSDType.Binary, array[1].Type);
            tempBinary = (LLSDBinary)array[1];
            byte[] testData2 = {116, 104, 101, 32, 113, 117, 105, 99, 107, 32, 98,
                                114, 111, 119, 110, 32, 102, 111, 120};
            TestBinary(tempBinary, testData2);

            Assert.AreEqual(LLSDType.Binary, array[1].Type);
            tempBinary = (LLSDBinary)array[2];
            Assert.AreEqual(0, tempBinary.AsBinary().Length);
        }

        /// <summary>
        /// Asserts that the contents of the LLSDBinary match the values and length
        /// of the supplied byte array
        /// </summary>
        /// <param name="inBinary"></param>
        /// <param name="inExpected"></param>
        private void TestBinary(LLSDBinary inBinary, byte[] inExpected)
        {
            byte[] binary = inBinary.AsBinary();
            Assert.AreEqual(inExpected.Length, binary.Length);
            for (int i = 0; i < inExpected.Length; i++)
            {
                if (inExpected[i] != binary[i])
                {
                    Assert.Fail("Expected " + inExpected[i].ToString() + " at position " + i.ToString() +
                        " but saw " + binary[i].ToString());
                }
            }
        }

        /// <summary>
        /// Test that undefened elements are parsed correctly.
        /// Currently this just checks that there is no error since undefined has no
        /// value and there is no LLSD child class for Undefined elements - the
        /// current implementation generates an instance of LLSD
        /// </summary>
        [Test]
        public void DeserializeUndef()
        {
            LLSD theLLSD = null;

            String testLLSD = @"<?xml version='1.0' encoding='UTF-8'?>
            <llsd>
                <undef/>
            </llsd>";
            //Deserialize the string
            byte[] bytes = Encoding.UTF8.GetBytes(testLLSD);
            theLLSD = LLSDParser.DeserializeXml(bytes);

            Assert.IsTrue(theLLSD is LLSD);
        }

        /// <summary>
        /// Test that various URI representations are parsed correctly.
        /// </summary>
        [Test]
        public void DeserializeURI()
        {
            LLSD theLLSD = null;
            LLSDArray array = null;
            LLSDURI tempURI = null;

            String testLLSD = @"<?xml version='1.0' encoding='UTF-8'?>
            <llsd>
                <array>
                    <uri>http://sim956.agni.lindenlab.com:12035/runtime/agents</uri>
                    <uri/>
                </array>
            </llsd>";
            //Deserialize the string
            byte[] bytes = Encoding.UTF8.GetBytes(testLLSD);
            theLLSD = LLSDParser.DeserializeXml(bytes);

            Assert.IsTrue(theLLSD is LLSDArray);
            array = (LLSDArray)theLLSD;

            Assert.AreEqual(LLSDType.URI, array[0].Type);
            tempURI = (LLSDURI)array[0];
            Uri testURI = new Uri(@"http://sim956.agni.lindenlab.com:12035/runtime/agents");
            Assert.AreEqual(testURI, tempURI.AsUri());

            Assert.AreEqual(LLSDType.URI, array[1].Type);
            tempURI = (LLSDURI)array[1];
            Assert.AreEqual("", tempURI.AsUri().ToString());
        }

        /// <summary>
        /// Test some nested containers.  This is not a very deep or complicated LLSD graph
        /// but it should reveal basic nesting issues.
        /// </summary>
        [Test]
        public void DeserializeNestedContainers()
        {
            LLSD theLLSD = null;
            LLSDArray array = null;
            LLSDMap map = null;
            LLSD tempLLSD = null;

            String testLLSD = @"<?xml version='1.0' encoding='UTF-8'?>
            <llsd>
                <array>
                    <map>
                        <key>Map One</key>
                        <map>
                            <key>Array One</key>
                            <array>
                                <integer>1</integer>
                                <integer>2</integer>
                            </array>
                        </map>
                    </map>
                    <array>
                        <string>A</string>
                        <string>B</string>
                        <array>
                            <integer>1</integer>
                            <integer>4</integer>
                            <integer>9</integer>
                        </array>
                    </array>
                </array>
            </llsd>";
            //Deserialize the string
            byte[] bytes = Encoding.UTF8.GetBytes(testLLSD);
            theLLSD = LLSDParser.DeserializeXml(bytes);

            Assert.IsTrue(theLLSD is LLSDArray);
            array = (LLSDArray)theLLSD;
            Assert.AreEqual(2, array.Count);

            //The first element of top level array, a map
            Assert.AreEqual(LLSDType.Map, array[0].Type);
            map = (LLSDMap)array[0];
            //First nested map
            tempLLSD = map["Map One"];
            Assert.IsNotNull(tempLLSD);
            Assert.AreEqual(LLSDType.Map, tempLLSD.Type);
            map = (LLSDMap)tempLLSD;
            //First nested array
            tempLLSD = map["Array One"];
            Assert.IsNotNull(tempLLSD);
            Assert.AreEqual(LLSDType.Array, tempLLSD.Type);
            array = (LLSDArray)tempLLSD;
            Assert.AreEqual(2, array.Count);

            array = (LLSDArray)theLLSD;
            //Second element of top level array, an array
            tempLLSD = array[1];
            Assert.AreEqual(LLSDType.Array, tempLLSD.Type);
            array = (LLSDArray)tempLLSD;
            Assert.AreEqual(3, array.Count);
            //Nested array
            tempLLSD = array[2];
            Assert.AreEqual(LLSDType.Array, tempLLSD.Type);
            array = (LLSDArray)tempLLSD;
            Assert.AreEqual(3, array.Count);
        }

    }
}


text:
package cucumber.contrib.grammar.java;

import com.google.common.collect.FluentIterable;
import com.google.common.collect.Lists;

import java.util.List;

/**
 * @author @aloyer
 */
public class PackageEntry extends Describable {
    private final String name;
    private final List<ClassEntry> classEntries;
    private final List<PackageEntry> subPkgEntries;

    public PackageEntry(String name) {
        this.name = name;
        this.classEntries = Lists.newArrayList();
        this.subPkgEntries = Lists.newArrayList();
    }

    public String name() {
        return name;
    }

    public void declareClass(ClassEntry classEntry) {
        classEntries.add(classEntry);
    }

    public void declareSubPackage(PackageEntry subPkgEntry) {
        subPkgEntries.add(subPkgEntry);
    }

    public boolean hasEntries() {
        return hasSubPackageEntries() || hasClassEntries();
    }

    public boolean hasSubPackageEntries() {
        return !subPkgEntries.isEmpty();
    }

    public boolean hasClassEntries() {
        return !classEntries.isEmpty();
    }

    public FluentIterable<PackageEntry> subPackages() {
        return FluentIterable.from(subPkgEntries);
    }

    public FluentIterable<ClassEntry> classes() {
        return FluentIterable.from(classEntries);
    }

    public FluentIterable<MethodEntry> matchingEntries(String text) {
        List<MethodEntry> matches = Lists.newArrayList();
        for (PackageEntry subGroup : subPkgEntries) {
            subGroup.matchingEntries(text).copyInto(matches);
        }
        for (ClassEntry clazz : classEntries) {
            clazz.matchingEntries(text).copyInto(matches);
        }
        return FluentIterable.from(matches);
    }

}


text:
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">

<title>ParameterBind (Hibernate JavaDocs)</title>
<meta name="date" content="2014-03-03">
<link rel="stylesheet" type="text/css" href="../../../../stylesheet.css" title="Style">

JavaScript is disabled on your browser.

Overview

Package

Class

Use

Tree

Deprecated

Index

Help

Prev Class

Next Class

Frames

No Frames

All Classes

Summary:

Nested |

Field |

Constr |

Method

Detail:

Field |

Constr |

Method

org.hibernate.jpa.spi

Interface ParameterBind<T>

All Known Implementing Classes:

BaseQueryImpl.ParameterBindImpl

public interface ParameterBind<T>

Represents the value currently bound to a particular (bindable) parameter.

Method Summary

Methods

Modifier and Type
Method and Description

TemporalType
getSpecifiedTemporalType()

T
getValue()

Method Detail

getValue

T getValue()

Access the bound value

Returns:

The bound value

getSpecifiedTemporalType

TemporalType getSpecifiedTemporalType()

The temporal type that will be used to "interpret" Date-like values (if applicable).

Returns:

The temporal type, or null

Overview

Package

Class

Use

Tree

Deprecated

Index

Help

Prev Class

Next Class

Frames

No Frames

All Classes

Summary:

Nested |

Field |

Constr |

Method

Detail:

Field |

Constr |

Method

Copyright © 2001-2014 Red Hat, Inc.  All Rights Reserved.


text:
FROM golang:1.7

RUN mkdir -p /go/src/github.com/pagarme/teleport/
WORKDIR /go/src/github.com/pagarme/teleport/

ADD . /go/src/github.com/pagarme/teleport/

RUN go get -u github.com/jteeuwen/go-bindata/...

RUN make install


text:
export const skinsExamples = `
<Layout gap={0} justifyItems="center">
  <CloseButton />
  <Box backgroundColor="D10">
    <CloseButton skin="light" />
  </Box>
  <Box backgroundColor="Y30">
    <CloseButton skin="dark" />
  </Box>
  <CloseButton skin="standardFilled" />
  <Box backgroundColor="B20">
    <CloseButton skin="lightFilled" />
  </Box>
  <CloseButton skin="transparent" />
</Layout>
`;

export const customExamples = `
<Layout gap={0} justifyItems="center">
  <Box backgroundColor="B20">
    <CloseButton skin="lightFilled"><Icons.Help /></CloseButton>
  </Box>
  <Box backgroundColor="B20">
    <CloseButton skin="lightFilled"/>
</Box>
</Layout>
`;

export const sizesExamples = `
<Layout gap={0} justifyItems="center" alignItems="center">
  <CloseButton />
  <CloseButton size="medium" />
  <CloseButton size="large" />
</Layout>
`;

export const custom = `
<Layout cols={3} gap={0} justifyItems="center">
  <Box direction="vertical" align="center">

An <a/> tag

    <CloseButton as="a" href="https://www.wix.com" target="_blank" skin="transparent" />
  </Box>
  <Box direction="vertical" align="center">

A react router <Link/> tag

    <CloseButton as={Link} skin="premium" to="/home" skin="transparent" />
  </Box>
  <Box direction="vertical" align="center">

A native <button/> tag

    <CloseButton as="button" onClick={() => alert('yay')} skin="transparent" />
  </Box>
</Layout>
`;


text:
module SFML.ForeignUtils where

import Foreign
import Foreign.C
import Foreign.Storable
import Control.Monad
import Control.Applicative
import Control.Concurrent
import Data.Char
import Data.ByteString (ByteString)
import qualified Data.ByteString.Internal as BSI
import Data.Word
import Data.Bits ((.|.), (.&.))
import Data.List (foldl')

withT :: Storable a => a -> (Ptr a -> IO b) -> IO b
withT = with

castWithT :: Storable a => a -> (Ptr b -> IO c) -> IO c
castWithT x a = with x (a.castPtr)

cToEnum :: Enum a => CInt -> a
cToEnum e = toEnum (fromIntegral e)

cFromEnum :: Enum a => a -> CInt
cFromEnum e = fromIntegral (fromEnum e)

withByteString :: a -> ByteString -> (Ptr a -> IO b) -> IO b
withByteString _ bytes m =
  let (bytesFPtr, offset, _len) = BSI.toForeignPtr bytes
  in withForeignPtr bytesFPtr $ \bytesPtr ->
      m (plusPtr (castPtr bytesPtr) offset)

withByteStringLen :: a -> ByteString -> ((Ptr a, CULong) -> IO b) -> IO b
withByteStringLen typeWit bytes m =
  let (bytesFPtr, offset, len) = BSI.toForeignPtr bytes
  in withForeignPtr bytesFPtr $ \bytesPtr ->
      m (castPtr (plusPtr bytesPtr offset), fromIntegral len)

withByteStringLenSizeOf :: (Storable a) => a -> ByteString -> ((Ptr a, CULong) -> IO b) -> IO b
withByteStringLenSizeOf typeWit bytes m =
  let (bytesFPtr, offset, len) = BSI.toForeignPtr bytes
  in withForeignPtr bytesFPtr $ \bytesPtr ->
      m (castPtr (plusPtr bytesPtr offset), fromIntegral (len `div` sizeOf typeWit))

withMaybe :: (a -> (Ptr a -> IO b) -> IO b) -> Maybe a -> (Ptr a -> IO b) -> IO b
withMaybe withFoo Nothing act = act nullPtr
withMaybe withFoo (Just x) act = withFoo x act

fromNull :: (Ptr a -> IO b) -> Ptr a -> IO (Maybe b)
fromNull conv ptr | ptr == nullPtr = return Nothing
                  | otherwise = fmap Just $ conv ptr

withUnicodeString :: String -> (Ptr CUInt -> IO a) -> IO a
withUnicodeString str act= do
  allocaArray len $ \arr -> do
  pokeElemOff arr (len - 1) 0
  forM_ (zip str [0..]) $ \(char, i) -> do
    pokeElemOff arr i (fromIntegral . ord $ char)
  act arr
 where len = length str + 1

fromUnicodeString :: Ptr CUInt -> IO String
fromUnicodeString ptr = go ptr 0
  where
    go ptr i = do
      c <- fmap (chr . fromIntegral) $ peekElemOff ptr i
      if c == '\NUL'
        then return ""
        else do
        rest <- go ptr (i + 1)
        return (c:rest)

enumsToCULong :: (Enum a) => [a] -> CULong
enumsToCULong styles = foldl' ((. fromIntegral . fromEnum) . (.|.)) 0 styles

cuLongToEnums :: (Enum a) => CULong -> [a]
cuLongToEnums x = map (toEnum . fromIntegral) . filter (/=0) . map ((x .&.) . shiftL 1) $ [0.. (bitSize x) - 1]

waitFor :: IO Bool -> IO ()
waitFor isDone = ()<$ forkIO wait
  where wait = do
          done <- isDone
          if done
            then return ()
            else threadDelay 100000 >> wait


text:
package com.teamname.goaton.components;

import com.badlogic.gdx.math.Rectangle;
import com.badlogic.gdx.math.Vector2;
import com.badlogic.gdx.physics.box2d.BodyDef;
import com.badlogic.gdx.physics.box2d.Contact;
import com.badlogic.gdx.physics.box2d.FixtureDef;
import com.badlogic.gdx.physics.box2d.PolygonShape;
import com.teamname.goaton.*;

/**
 * Created by kpidding on 1/31/16.
 */
public class PlayerTriggerComponent extends Component {
    private Message toSend;
    private boolean fireOnce;
    private boolean fired;
    private Rectangle rect;
    public void create()
    {
        BodyDef bodyDef = new BodyDef();
        bodyDef.type = BodyDef.BodyType.StaticBody;
        bodyDef.position.set(this.gameObject.getPosition());
        this.gameObject.addPhysicsBody(GoatonWorld.world.createBody(bodyDef));

        PolygonShape rect = new PolygonShape();
        rect.setAsBox(this.rect.getWidth(), this.rect.getHeight());

        FixtureDef fixtureDef = new FixtureDef();
        fixtureDef.shape = rect;
        fixtureDef.isSensor = true;
        fixtureDef.filter.categoryBits = ObjectTypes.BOUNDARY;
        fixtureDef.filter.maskBits = ObjectTypes.PLAYER;

        fixtureDef.restitution = 0;
        this.gameObject.getBody().createFixture(fixtureDef);
        gameObject.setPosition(new Vector2(this.rect.x + this.rect.width , this.rect.y + this.rect.height));
        rect.dispose();

    }

    public PlayerTriggerComponent(float x, float y, float wd, float ht, Message msgToSend, boolean fireOnce) {
        rect = new Rectangle(x/ GoatonWorld.TILE_SIZE, y/GoatonWorld.TILE_SIZE,wd/GoatonWorld.TILE_SIZE,ht/GoatonWorld.TILE_SIZE);
        toSend = msgToSend;
        this.fireOnce = fireOnce;
    }

    @Override
    protected void onCollisionEnter(Contact collision, GameObject other) {
        if(!fireOnce || !fired)
        {
            GoatonWorld.sendGlobalMessage(toSend);
            fired = true;
        }
    }

    @Override
    public String getID() {
        return "PlayerTriggerComponent";
    }

    @Override
    public Component cloneComponent() {
        return null;
    }
}


text:
<?php

namespace Ruudk\Payment\MollieBundle\DependencyInjection;

use Symfony\Component\Config\Definition\Builder\TreeBuilder;
use Symfony\Component\Config\Definition\ConfigurationInterface;

class Configuration implements ConfigurationInterface
{
    /**
     * @return TreeBuilder
     */
    public function getConfigTreeBuilder()
    {
        $treeBuilder = new TreeBuilder();
        $rootNode = $treeBuilder->root('ruudk_payment_mollie');

        $rootNode
            ->children()
                ->scalarNode('api_key')
                    ->isRequired()
                    ->cannotBeEmpty()
                ->end()
                ->booleanNode('logger')
                    ->defaultTrue()
                ->end()
            ->end()

            ->fixXmlConfig('method')
            ->children()
                ->arrayNode('methods')
                    ->isRequired()
                    ->cannotBeEmpty()
                    ->prototype('scalar')
                    ->end()
                ->end()
            ->end()
        ;

        return $treeBuilder;
    }
}


text:
import os

from wa import Workload, Parameter
from wa.framework.exception import ConfigError, WorkloadError

class ShellScript(Workload):

    name = 'shellscript'
    description = """
    Runs an arbitrary shellscript on the target.

    """

    parameters = [
        Parameter('script_file', mandatory=True,
                  description='''
                  The path (on the host) to the shell script file. This must be
                  an absolute path (though it may contain ~).
                  '''),
        Parameter('argstring', default='',
                  description='A string that should contain arguments passed to the script.'),
        Parameter('as_root', kind=bool, default=False,
                  description='Specify whether the script should be run as root.'),
        Parameter('timeout', kind=int, default=60,
                  description='Timeout, in seconds, for the script run time.'),
    ]

    def initialize(self, context):
        if self.as_root and not self.target.is_rooted:
            raise WorkloadError('Cannot run script as root -- target appears to be unrooted.')

        self.script_file = os.path.expanduser(self.script_file)
        if not os.path.isfile(self.script_file):
            raise ConfigError('Can\'t access file (is the path correct?): {}'.format(self.script_file))
        self.output = None
        self.command = None
        self.on_target_script_file = None

    def setup(self, context):
        self.on_target_script_file = self.target.get_workpath(os.path.basename(self.script_file))
        self.target.push(self.script_file, self.on_target_script_file)
        self.command = 'sh {} {}'.format(self.on_target_script_file, self.argstring)

    def run(self, context):
        self.output = self.target.execute(self.command, timeout=self.timeout, as_root=self.as_root)

    def extract_results(self, context):
        with open(os.path.join(context.output_directory, 'output.txt'), 'w') as wfh:
            wfh.write(self.output)

    def teardown(self, context):
        if self.cleanup_assets:
            self.target.remove(self.on_target_script_file)


text:
namespace _04.Froggy
{
    using System.Collections;
    using System.Collections.Generic;
    using System.Linq;

    public class Stones<T> : IEnumerable<T>
    {
        private T[] stonesCollection;

        public Stones(IEnumerable<T> numbers)
        {
            this.stonesCollection = numbers.ToArray();
        }

        public IEnumerator<T> GetEnumerator()
        {
            for (int i = 0; i < this.stonesCollection.Length; i += 2)
            {
                yield return this.stonesCollection[i];
            }

            var lastOddIndex = this.stonesCollection.Length % 2 == 0
                ? this.stonesCollection.Length - 1
                : this.stonesCollection.Length - 2;

            for (int i = lastOddIndex; i >= 0; i -= 2)
            {
                    yield return this.stonesCollection[i];
            }
        }

        IEnumerator IEnumerable.GetEnumerator()
        {
            return this.GetEnumerator();
        }
    }
}


text:
<?php
// Version: 1.1; Who

$txt['who_hidden'] = 'hmm... no idea, sorry';
$txt['who_admin'] = 'Viewing the Admin portal';
$txt['who_moderate'] = 'Viewing the moderator portal';
$txt['who_generic'] = 'Viewing the %1$s';
$txt['who_unknown'] = 'Unknown Action';
$txt['who_user'] = 'User';
$txt['who_time'] = 'Time';
$txt['who_action'] = 'Action';
$txt['who_show1'] = 'Show ';
$txt['who_show_members_only'] = 'Members Only';
$txt['who_show_guests_only'] = 'Guests Only';
$txt['who_show_spiders_only'] = 'Spiders Only';
$txt['who_show_all'] = 'Everyone';
$txt['who_no_online_spiders'] = 'There are currently no spiders online.';
$txt['who_no_online_guests'] = 'There are currently no guests online.';
$txt['who_no_online_members'] = 'There are currently no members online.';

$txt['whospider_login'] = 'Viewing the login page.';
$txt['whospider_register'] = 'Viewing the registration page.';
$txt['whospider_reminder'] = 'Viewing the reminder page.';

$txt['whoall_activate'] = 'Activating their account.';
$txt['whoall_buddy'] = 'Modifying their buddy list.';
$txt['whoall_coppa'] = 'Filling out parent/guardian consent form.';
$txt['whoall_credits'] = 'Viewing credits page.';
$txt['whoall_emailuser'] = 'Sending email to another member.';
$txt['whoall_groups'] = 'Viewing the member groups page.';
$txt['whoall_help'] = 'Viewing the help page.';
$txt['whoall_quickhelp'] = 'Viewing a help popup.';
$txt['whoall_pm'] = 'Viewing their messages.';
$txt['whoall_auth'] = 'Logging into the forum.';
$txt['whoall_login'] = 'Viewing the login page.';
$txt['whoall_login2'] = 'Viewing the login page.';
$txt['whoall_logout'] = 'Logging out of the forum.';
$txt['whoall_markasread'] = 'Marking topics read or unread.';
$txt['whoall_mentions'] = 'Viewing their mentions list.';
$txt['whoall_modifykarma_applaud'] = 'Applauding a member.';
$txt['whoall_modifykarma_smite'] = 'Smiting a member.';
$txt['whoall_news'] = 'Viewing the news.';
$txt['whoall_notify'] = 'Changing their notification settings.';
$txt['whoall_notifyboard'] = 'Changing their notification settings.';
$txt['whoall_openidreturn'] = 'Logging in using OpenID.';
$txt['whoall_quickmod'] = 'Moderating a board.';
$txt['whoall_recent'] = 'Viewing a list of recent topics.';
$txt['whoall_register'] = 'Registering for an account on the forum.';
$txt['whoall_reminder'] = 'Requesting a password reminder.';
$txt['whoall_reporttm'] = 'Reporting a topic to a moderator.';
$txt['whoall_spellcheck'] = 'Using the spellchecker';
$txt['whoall_unread'] = 'Viewing unread topics since their last visit.';
$txt['whoall_unreadreplies'] = 'Viewing unread replies since their last visit.';
$txt['whoall_who'] = 'Viewing Who\'s Online.';

$txt['whoall_collapse_collapse'] = 'Collapsing a category.';
$txt['whoall_collapse_expand'] = 'Expanding a category.';
$txt['whoall_pm_removeall'] = 'Removing all their messages.';
$txt['whoall_pm_send'] = 'Sending a message.';
$txt['whoall_pm_send2'] = 'Sending a message.';

$txt['whotopic_announce'] = 'Announcing the topic "%2$s".';
$txt['whotopic_attachapprove'] = 'Approving an attachment.';
$txt['whotopic_dlattach'] = 'Viewing an attachment.';
$txt['whotopic_deletemsg'] = 'Deleting a message.';
$txt['whotopic_editpoll'] = 'Editing the poll in "%2$s".';
$txt['whotopic_editpoll2'] = 'Editing the poll in "%2$s".';
$txt['whotopic_jsmodify'] = 'Modifying a post in "%2$s".';
$txt['whotopic_likes'] = 'Liking a message in the topic "%2$s".';
$txt['whotopic_lock'] = 'Locking the topic "%2$s".';
$txt['whotopic_lockvoting'] = 'Locking the poll in "%2$s".';
$txt['whotopic_mergetopics'] = 'Merging the topic "%2$s" with another topic.';
$txt['whotopic_movetopic'] = 'Moving the topic "%2$s" to another board.';
$txt['whotopic_movetopic2'] = 'Moving the topic "%2$s" to another board.';
$txt['whotopic_post'] = 'Posting in %2$s.';
$txt['whotopic_post2'] = 'Posting in %2$s.';
$txt['whotopic_printpage'] = 'Printing the topic "%2$s".';
$txt['whotopic_quickmod2'] = 'Moderating the topic %2$s.';
$txt['whotopic_poll_remove'] = 'Removing the poll in "%2$s".';
$txt['whotopic_removetopic2'] = 'Removing the topic %2$s.';
$txt['whotopic_sendtopic'] = 'Sending the topic "%2$s" to a friend.';
$txt['whotopic_splittopics'] = 'Splitting the topic "%2$s" into two topics.';
$txt['whotopic_sticky'] = 'Pinned the topic "%2$s".';
$txt['whotopic_unwatch'] = 'Stopped watching a topic.';
$txt['whotopic_vote'] = 'Voting in %2$s.';
$txt['whotopic_watch'] = 'Started watching a topic.';

$txt['whopost_quotefast'] = 'Quoting a post from "%2$s".';

$txt['whoadmin_editagreement'] = 'Editing the registration agreement.';
$txt['whoadmin_featuresettings'] = 'Editing forum features and options.';
$txt['whoadmin_modlog'] = 'Viewing the moderator log.';
$txt['whoadmin_serversettings'] = 'Editing the forum settings.';
$txt['whoadmin_packageget'] = 'Getting packages.';
$txt['whoadmin_packages'] = 'Viewing the package manager.';
$txt['whoadmin_permissions'] = 'Editing the forum permissions.';
$txt['whoadmin_pgdownload'] = 'Downloading a package.';
$txt['whoadmin_theme'] = 'Editing the theme settings.';
$txt['whoadmin_trackip'] = 'Tracking an IP address.';

$txt['whoallow_manageboards'] = 'Editing the board and category settings.';
$txt['whoallow_admin'] = 'Viewing the administration center.';
$txt['whoallow_ban'] = 'Editing the ban list.';
$txt['whoallow_boardrecount'] = 'Recounting the forum totals.';
$txt['whoallow_calendar'] = 'Viewing the calendar.';
$txt['whoallow_editnews'] = 'Editing the news.';
$txt['whoallow_mailing'] = 'Sending a forum email.';
$txt['whoallow_maintain'] = 'Performing routine forum maintenance.';
$txt['whoallow_manageattachments'] = 'Managing the attachments.';
$txt['whoallow_moderate'] = 'Viewing the Moderation Center.';
$txt['whoallow_memberlist'] = 'Viewing the member list.';
$txt['whoallow_optimizetables'] = 'Optimizing the database tables.';
$txt['whoallow_repairboards'] = 'Repairing the database tables.';
$txt['whoallow_search'] = 'Searching the forum.';
$txt['whoallow_search_results'] = 'Viewing the results of a search.';
$txt['whoallow_setcensor'] = 'Editing the censor text.';
$txt['whoallow_setreserve'] = 'Editing the reserved names.';
$txt['whoallow_stats'] = 'Viewing the forum stats.';
$txt['whoallow_viewErrorLog'] = 'Viewing the error log.';
$txt['whoallow_viewmembers'] = 'Viewing a list of members.';

$txt['who_topic'] = 'Viewing the topic %2$s.';
$txt['who_board'] = 'Viewing the board %2$s.';
$txt['who_index'] = 'Viewing the board index of {forum_name}.';
$txt['who_viewprofile'] = 'Viewing %2$s\'s profile.';
$txt['who_profile'] = 'Editing the profile of %2$s.';
$txt['who_post'] = 'Posting a new topic in %2$s.';
$txt['who_poll'] = 'Posting a new poll in %2$s.';
$txt['who_topicbyemail'] = 'Email starting a new topic in %2$s.';

$txt['whotopic_postbyemail'] = 'Email posting in %2$s.';
$txt['whoall_pm_byemail'] = 'Sending a personal message by email.';

// Overrides the already defined strings to get clean results in the table
$txt['today'] = '%1$s';
$txt['yesterday'] = '%1$s';


text:
#include "ifmap/ifmap_update_queue.h"

#include <boost/checked_delete.hpp>
#include <boost/assign/list_of.hpp>

#include <sandesh/sandesh_types.h>
#include <sandesh/sandesh.h>
#include <sandesh/request_pipeline.h>

#include "ifmap/ifmap_exporter.h"
#include "ifmap/ifmap_link.h"
#include "ifmap/ifmap_sandesh_context.h"
#include "ifmap/ifmap_server.h"
#include "ifmap/ifmap_server_show_types.h"

// Convention for SetSequence():
// If we are inserting the item in the middle of the Q, we set its sequence to
// the same value as its successor. If its the last item in the Q, it gets the
// next available sequence number.
void IFMapUpdateQueue::SetSequence(IFMapListEntry *item) {
    IFMapListEntry *next = Next(item);
    item->set_sequence(next ? next->get_sequence(): ++sequence_);
}

// Insert 'item' at the end of the list.
void IFMapUpdateQueue::PushbackIntoList(IFMapListEntry *item) {
    list_.push_back(*item);
    SetSequence(item);
    item->set_queue_insert_at_to_now();
}

// Insert 'item' before 'ptr'.
void IFMapUpdateQueue::InsertIntoListBefore(IFMapListEntry *ptr,
                                            IFMapListEntry *item) {
    list_.insert(list_.iterator_to(*ptr), *item);
    SetSequence(item);
    item->set_queue_insert_at_to_now();
}

// Insert 'item' after 'ptr'.
void IFMapUpdateQueue::InsertIntoListAfter(IFMapListEntry *ptr,
                                           IFMapListEntry *item) {
    list_.insert(++list_.iterator_to(*ptr), *item);
    SetSequence(item);
    item->set_queue_insert_at_to_now();
}

void IFMapUpdateQueue::EraseFromList(IFMapListEntry *item) {
    list_.erase(list_.iterator_to(*item));
    item->set_sequence(NULL_SEQUENCE);
}

IFMapUpdateQueue::IFMapUpdateQueue(IFMapServer *server) : server_(server),
        sequence_(0) {
    PushbackIntoList(&tail_marker_);
}

struct IFMapListEntryDisposer {
    void operator()(IFMapListEntry *ptr) {
        boost::checked_delete(ptr);
    }
};

void IFMapUpdateQueue::ClearAndDisposeList() {
    list_.clear_and_dispose(IFMapListEntryDisposer());
}

IFMapUpdateQueue::~IFMapUpdateQueue() {
    EraseFromList(&tail_marker_);
    ClearAndDisposeList();
}

bool IFMapUpdateQueue::Enqueue(IFMapUpdate *update) {
    assert(!update->advertise().empty());
    bool tm_last = false;
    if (GetLast() == tail_marker()) {
        tm_last = true;
    }
    PushbackIntoList(update);
    return tm_last;
}

void IFMapUpdateQueue::Dequeue(IFMapUpdate *update) {
    EraseFromList(update);
}

IFMapMarker *IFMapUpdateQueue::GetMarker(int bit) {
    MarkerMap::iterator loc = marker_map_.find(bit);
    if (loc == marker_map_.end()) {
        return NULL;
    }
    return loc->second;
}

void IFMapUpdateQueue::Join(int bit) {
    IFMapMarker *marker = &tail_marker_;
    marker->mask.set(bit);
    marker_map_.insert(std::make_pair(bit, marker));
}

void IFMapUpdateQueue::Leave(int bit) {
    MarkerMap::iterator loc = marker_map_.find(bit);
    assert(loc != marker_map_.end());
    IFMapMarker *marker = loc->second;

    BitSet reset_bs;
    reset_bs.set(bit);

    // Start with the first element after the client's marker
    for (List::iterator iter = list_.iterator_to(*marker), next;
         iter != list_.end(); iter = next) {
        IFMapListEntry *item = iter.operator->();
        next = ++iter;
        if (item->IsMarker()) {
            continue;
        }
        IFMapUpdate *update = static_cast<IFMapUpdate *>(item);
        update->AdvertiseReset(reset_bs);
        if (update->advertise().empty()) {
            Dequeue(update);
        }

        // Update may be freed.
        server_->exporter()->StateUpdateOnDequeue(update, reset_bs, true);
    }

    marker_map_.erase(loc);
    marker->mask.reset(bit);
    if ((marker != &tail_marker_)  && (marker->mask.empty())) {
        EraseFromList(marker);
        delete marker;
    }
}

void IFMapUpdateQueue::MarkerMerge(IFMapMarker *dst, IFMapMarker *src,
                                   const BitSet &mmove) {
    //
    // Set the bits in dst and update the MarkerMap.  Be sure to set the dst
    // before we reset the src since bitset maybe a reference to src->mask.
    // Call to operator|=()
    //
    dst->mask |= mmove;
    for (size_t i = mmove.find_first();
         i != BitSet::npos; i = mmove.find_next(i)) {
        MarkerMap::iterator loc = marker_map_.find(i);
        assert(loc != marker_map_.end());
        loc->second = dst;
    }
    // Reset the bits in the src and get rid of it in case it's now empty.
    src->mask.Reset(mmove);
    if (src->mask.empty()) {
        assert(src != &tail_marker_);
        EraseFromList(src);
        delete src;
    }
}

IFMapMarker* IFMapUpdateQueue::MarkerSplit(IFMapMarker *marker,
                                           IFMapListEntry *current,
                                           const BitSet &msplit, bool before) {
    assert(!msplit.empty());
    IFMapMarker *new_marker = new IFMapMarker();

    // call to operator=()
    new_marker->mask = msplit;
    marker->mask.Reset(msplit);
    assert(!marker->mask.empty());

    for (size_t i = msplit.find_first();
         i != BitSet::npos; i = msplit.find_next(i)) {
        MarkerMap::iterator loc = marker_map_.find(i);
        assert(loc != marker_map_.end());
        loc->second = new_marker;
    }
    if (before) {
        // Insert new_marker before current
        InsertIntoListBefore(current, new_marker);
    } else {
        // Insert new_marker after current
        InsertIntoListAfter(current, new_marker);
    }
    return new_marker;
}

IFMapMarker* IFMapUpdateQueue::MarkerSplitBefore(IFMapMarker *marker,
                                                 IFMapListEntry *current,
                                                 const BitSet &msplit) {
    bool before = true;
    IFMapMarker *ret_marker = MarkerSplit(marker, current, msplit, before);
    return ret_marker;
}

IFMapMarker* IFMapUpdateQueue::MarkerSplitAfter(IFMapMarker *marker,
                                                IFMapListEntry *current,
                                                const BitSet &msplit) {
    bool before = false;
    IFMapMarker *ret_marker = MarkerSplit(marker, current, msplit, before);
    return ret_marker;
}

// Insert marker before current
void IFMapUpdateQueue::MoveMarkerBefore(IFMapMarker *marker,
                                        IFMapListEntry *current) {
    if (marker != current) {
        EraseFromList(marker);
        InsertIntoListBefore(current, marker);
    }
}

// Insert marker after current
void IFMapUpdateQueue::MoveMarkerAfter(IFMapMarker *marker,
                                       IFMapListEntry *current) {
    if (marker != current) {
        EraseFromList(marker);
        InsertIntoListAfter(current, marker);
    }
}

IFMapListEntry *IFMapUpdateQueue::Previous(IFMapListEntry *current) {
    List::iterator iter = list_.iterator_to(*current);
    if (iter == list_.begin()) {
        return NULL;
    }
    --iter;
    return iter.operator->();
}

IFMapListEntry *IFMapUpdateQueue::GetLast() {
    // the list must always have the tail_marker
    assert(!list_.empty());
    List::reverse_iterator riter;
    riter = list_.rbegin();
    return riter.operator->();
}

IFMapListEntry * IFMapUpdateQueue::Next(IFMapListEntry *current) {
    List::iterator iter = list_.iterator_to(*current);
    if (++iter == list_.end()) {
        return NULL;
    }
    return iter.operator->();
}

bool IFMapUpdateQueue::empty() const {
    return (list_.begin().operator->() == &tail_marker_) &&
            (list_.rbegin().operator->() == &tail_marker_);
}

int IFMapUpdateQueue::size() const {
    return (int)list_.size();
}

void IFMapUpdateQueue::PrintQueue() {
    int i = 0;
    IFMapListEntry *item;
    List::iterator iter = list_.iterator_to(list_.front());
    while (iter != list_.end()) {
        item = iter.operator->();
        if (item->IsMarker()) {
            IFMapMarker *marker = static_cast<IFMapMarker *>(item);
            if (marker == &tail_marker_) {
                std::cout << i << ". Tail Marker: " << item;
            } else {
                std::cout << i << ". Marker: " << item;
            }
            std::cout << " clients:";
            for (size_t j = marker->mask.find_first();
                j != BitSet::npos; j = marker->mask.find_next(j)) {
                std::cout << " " << j;
            }
            std::cout << std::endl;
        }
        if (item->IsUpdate()) {
            std::cout << i << ". Update: " << item << " ";
        }
        if (item->IsDelete()) {
            std::cout << i << ". Delete: " << item << " ";
        }
        if (item->IsUpdate() || item->IsDelete()) {
            IFMapUpdate *update = static_cast<IFMapUpdate *>(item);
            const IFMapObjectPtr ref = update->data();
            if (ref.type == IFMapObjectPtr::NODE) {
                std::cout << "node <";
                std::cout << ref.u.node->name() << ">" << std::endl;
            } else if (ref.type == IFMapObjectPtr::LINK) {
                std::cout << ref.u.link->ToString() << std::endl;
            }
        }

        iter++;
        i++;
    }
    std::cout << "**End of queue**" << std::endl;
}

// almost everything in this class is static since we dont really want to
// intantiate this class
class ShowIFMapUpdateQueue {
public:
    static const int kMaxElementsPerRound = 50;

    struct ShowData : public RequestPipeline::InstData {
        std::vector<UpdateQueueShowEntry> send_buffer;
    };

    static RequestPipeline::InstData *AllocBuffer(int stage) {
        return static_cast<RequestPipeline::InstData *>(new ShowData);
    }

    struct TrackerData : public RequestPipeline::InstData {
        // init as 1 indicates we need to init 'first' to begin() since there is
        // no way to initialize an iterator here.
        TrackerData() : init(1) { }
        int init;
        std::vector<UpdateQueueShowEntry>::const_iterator first;
    };

    static RequestPipeline::InstData *AllocTracker(int stage) {
        return static_cast<RequestPipeline::InstData *>(new TrackerData);
    }

    static void CopyNode(UpdateQueueShowEntry *dest, IFMapListEntry *src,
                         IFMapUpdateQueue *queue);
    static bool BufferStage(const Sandesh *sr,
                            const RequestPipeline::PipeSpec ps, int stage,
                            int instNum, RequestPipeline::InstData *data);
    static bool SendStage(const Sandesh *sr, const RequestPipeline::PipeSpec ps,
                          int stage, int instNum,
                          RequestPipeline::InstData *data);
};

void ShowIFMapUpdateQueue::CopyNode(UpdateQueueShowEntry *dest,
                                    IFMapListEntry *src,
                                    IFMapUpdateQueue *queue) {
    if (src->IsUpdate() || src->IsDelete()) {
        IFMapUpdate *update = static_cast<IFMapUpdate *>(src);
        const IFMapObjectPtr ref = update->data();
        if (ref.type == IFMapObjectPtr::NODE) {
            dest->node_name = "<![CDATA[" + ref.u.node->name() + "]]>";
        } else if (ref.type == IFMapObjectPtr::LINK) {
            dest->node_name = "<![CDATA[" + ref.u.link->ToString() + "]]>";
        }
        if (src->IsUpdate()) {
            dest->qe_type = "Update";
        }
        if (src->IsDelete()) {
            dest->qe_type = "Delete";
        }
        dest->qe_bitset = update->advertise().ToNumberedString();
    }
    if (src->IsMarker()) {
        IFMapMarker *marker = static_cast<IFMapMarker *>(src);
        dest->node_name = "Marker";
        if (marker == queue->tail_marker()) {
            dest->qe_type = "Tail-Marker";
        } else {
            dest->qe_type = "Marker";
        }
        dest->qe_bitset = marker->mask.ToNumberedString();
    }
    dest->queue_insert_ago = src->queue_insert_ago_str();
    dest->sequence = src->get_sequence();
}

bool ShowIFMapUpdateQueue::BufferStage(const Sandesh *sr,
                                       const RequestPipeline::PipeSpec ps,
                                       int stage, int instNum,
                                       RequestPipeline::InstData *data) {
    const IFMapUpdateQueueShowReq *request =
        static_cast<const IFMapUpdateQueueShowReq *>(ps.snhRequest_.get());
    IFMapSandeshContext *sctx =
        static_cast<IFMapSandeshContext *>(request->module_context("IFMap"));
    ShowData *show_data = static_cast<ShowData *>(data);

    IFMapUpdateQueue *queue = sctx->ifmap_server()->queue();
    assert(queue);
    show_data->send_buffer.reserve(queue->list_.size());

    IFMapUpdateQueue::List::iterator iter =
        queue->list_.iterator_to(queue->list_.front());
    while (iter != queue->list_.end()) {
        IFMapListEntry *item = iter.operator->();

        UpdateQueueShowEntry dest;
        CopyNode(&dest, item, queue);
        show_data->send_buffer.push_back(dest);

        iter++;
    }

    return true;
}

// Can be called multiple times i.e. approx total/kMaxElementsPerRound
bool ShowIFMapUpdateQueue::SendStage(const Sandesh *sr,
                                     const RequestPipeline::PipeSpec ps,
                                     int stage, int instNum,
                                     RequestPipeline::InstData *data) {
    const RequestPipeline::StageData *prev_stage_data = ps.GetStageData(0);
    const ShowIFMapUpdateQueue::ShowData &show_data =
        static_cast<const ShowIFMapUpdateQueue::ShowData &>
                                                (prev_stage_data->at(0));
    // Data for this stage
    TrackerData *tracker_data = static_cast<TrackerData *>(data);

    std::vector<UpdateQueueShowEntry> dest_buffer;
    std::vector<UpdateQueueShowEntry>::const_iterator first, last;
    bool more = false;

    if (tracker_data->init) {
        first = show_data.send_buffer.begin();
        tracker_data->init = 0;
    } else {
        first = tracker_data->first;
    }
    int rem_num = show_data.send_buffer.end() - first;
    int send_num = (rem_num < kMaxElementsPerRound) ? rem_num :
                                                      kMaxElementsPerRound;
    last = first + send_num;
    copy(first, last, back_inserter(dest_buffer));
    // Decide if we want to be called again.
    if ((rem_num - send_num) > 0) {
        more = true;
    } else {
        more = false;
    }
    const IFMapUpdateQueueShowReq *request =
        static_cast<const IFMapUpdateQueueShowReq *>(ps.snhRequest_.get());
    IFMapUpdateQueueShowResp *response = new IFMapUpdateQueueShowResp();
    response->set_queue(dest_buffer);
    response->set_context(request->context());
    response->set_more(more);
    response->Response();
    tracker_data->first = first + send_num;

    // Return 'false' to be called again
    return (!more);
}

void IFMapUpdateQueueShowReq::HandleRequest() const {

    RequestPipeline::StageSpec s0, s1;
    TaskScheduler *scheduler = TaskScheduler::GetInstance();

    // 2 stages - first: gather/read, second: send

    s0.taskId_ = scheduler->GetTaskId("db::IFMapTable");
    s0.allocFn_ = ShowIFMapUpdateQueue::AllocBuffer;
    s0.cbFn_ = ShowIFMapUpdateQueue::BufferStage;
    s0.instances_.push_back(0);

    // control-node ifmap show command task
    s1.taskId_ = scheduler->GetTaskId("cn_ifmap::ShowCommand");
    s1.allocFn_ = ShowIFMapUpdateQueue::AllocTracker;
    s1.cbFn_ = ShowIFMapUpdateQueue::SendStage;
    s1.instances_.push_back(0);

    RequestPipeline::PipeSpec ps(this);
    ps.stages_= boost::assign::list_of(s0)(s1);
    RequestPipeline rp(ps);
}


text:
require 'action_dispatch/middleware/session/abstract_store'

# When ORM was switched, but another ORM's model class still exists in session
# (Devise saves User model to session), ActionDispatch raises ActionDispatch::Session::SessionRestoreError
# and app can't be started unless you delete your browser's cookie data.
# To prevent this situation, detect this problem here and reset session data
# so user can make another login via Devise.

ActionDispatch::Session::StaleSessionCheck.module_eval do
  def stale_session_check!
    yield
  rescue ArgumentError
    {}
  end
end


text:
<?php
# Generated by the protocol buffer compiler.  DO NOT EDIT!
# source: google/privacy/dlp/v2/dlp.proto

namespace Google\Cloud\Dlp\V2;

use Google\Protobuf\Internal\GPBType;
use Google\Protobuf\Internal\RepeatedField;
use Google\Protobuf\Internal\GPBUtil;

/**
 * Replace each input value with a value randomly selected from the dictionary.
 *
 * Generated from protobuf message google.privacy.dlp.v2.ReplaceDictionaryConfig
 */
class ReplaceDictionaryConfig extends \Google\Protobuf\Internal\Message
{
    protected $type;

    /**
     * Constructor.
     *
     * @param array $data {
     *     Optional. Data for populating the Message object.
     *
     *     @type \Google\Cloud\Dlp\V2\CustomInfoType\Dictionary\WordList $word_list
     *           A list of words to select from for random replacement. The
     *           [limits](https://cloud.google.com/dlp/limits) page contains details about
     *           the size limits of dictionaries.
     * }
     */
    public function __construct($data = NULL) {
        \GPBMetadata\Google\Privacy\Dlp\V2\Dlp::initOnce();
        parent::__construct($data);
    }

    /**
     * A list of words to select from for random replacement. The
     * [limits](https://cloud.google.com/dlp/limits) page contains details about
     * the size limits of dictionaries.
     *
     * Generated from protobuf field .google.privacy.dlp.v2.CustomInfoType.Dictionary.WordList word_list = 1;
     * @return \Google\Cloud\Dlp\V2\CustomInfoType\Dictionary\WordList|null
     */
    public function getWordList()
    {
        return $this->readOneof(1);
    }

    public function hasWordList()
    {
        return $this->hasOneof(1);
    }

    /**
     * A list of words to select from for random replacement. The
     * [limits](https://cloud.google.com/dlp/limits) page contains details about
     * the size limits of dictionaries.
     *
     * Generated from protobuf field .google.privacy.dlp.v2.CustomInfoType.Dictionary.WordList word_list = 1;
     * @param \Google\Cloud\Dlp\V2\CustomInfoType\Dictionary\WordList $var
     * @return $this
     */
    public function setWordList($var)
    {
        GPBUtil::checkMessage($var, \Google\Cloud\Dlp\V2\CustomInfoType\Dictionary\WordList::class);
        $this->writeOneof(1, $var);

        return $this;
    }

    /**
     * @return string
     */
    public function getType()
    {
        return $this->whichOneof("type");
    }

}


text:
/* Contact */

.Contact {
	display: -webkit-box;
	display: -moz-box;
	display: -ms-flexbox;
	display: -webkit-flex;
	-webkit-flex-wrap: wrap;
	-ms-flex-wrap: wrap;
	flex-wrap: wrap;
	display: flex;
}

.ContactMap,
.ContactForm {
	padding: 0 1em;
	height: 100%;
	width: 100%;
	overflow-y: auto;
	overflow-x: hidden;
}

/* Contact Form */

.ContactForm {
	padding: 2.25em 0 0;
}

/* Form Title */

.Contact-title {
	font-size: 1em;
	width: 100%;
	margin: 0 0 1em;
}

.Contact-title h1 {
	color: #3e2723;
	font-size: 2.25em;
	font-weight: 900;
	text-align: center;
}

/* Form Wrapper and Field */

.ContactForm-wrapper,
.ContactForm-field {
	display: -webkit-box;
	display: -moz-box;
	display: -ms-flexbox;
	display: -webkit-flex;
	display: flex;
	-webkit-flex-direction: column;
	-ms-flex-direction: column;
	flex-direction: column;
}

.ContactForm-wrapper {
	padding: 0 1em;
	width: 100%;
}

/* Form Field */

.ContactForm-field {
	padding: 0 1.5em;
	width: 100%;
}

.ContactForm-field--submit {
	padding: 0;
}

.ContactForm-field ::-webkit-input-placeholder {
	color: #795548;
}

.ContactForm-field :-moz-placeholder {
	color: #795548;
}

.ContactForm-field ::-moz-placeholder {
	color: #795548;
}

.ContactForm-field :focus::-webkit-input-placeholder {
	color: #8d6e63;
}

.ContactForm-field :focus:-moz-placeholder {
	color: #8d6e63;
}

.ContactForm-field :focus::-moz-placeholder {
	color: #8d6e63;
}

.ContactForm-field input,
.ContactForm-field label,
.ContactForm-field textarea {
	color: #4e342e;
	border: none;
	background: none;
	width: 100%;
}

.ContactForm-field input,
.ContactForm-field textarea {
	border-bottom-style: solid;
	border-bottom-width: 1px;
	border-bottom-color: #795548;
	margin: 1px 0 .5em;
	order: 2;
	-webkit-transition: background .3s;
	-moz-transition: background .3s;
	-ms-transition: background .3s;
	-o-transition: background .3s;
	transition: background .3s;
}

.ContactForm-field input:focus,
.ContactForm-field textarea:focus {
	border-bottom-width: 2px;
	border-bottom-color: #795548;
	margin-top: 0;
}

.ContactForm-field input:invalid,
.ContactForm-field textarea:invalid {
	border-bottom-width: 2px;
	border-bottom-color: #795548;
	background: none;
	-webkit-box-shadow: none;
	-moz-box-shadow: none;
	box-shadow: none;
}

.ContactForm-field input {
	font-size: 1em;
	line-height: 1;
	padding: 1em 0 .5em;
}

.ContactForm-field--name input {
	font-weight: 500;
}

.ContactForm-field label {
	color: #3e2723;
	display: none;
	font-size: .75em;
	padding: 1.333333333em 0 0;
}

.ContactForm-field textarea + label {
	order: 1;
	display: block;
}

.ContactForm-field textarea:focus + label {
	color: #3e2723;
}

.ContactForm-field textarea {
	font-size: 1em;
	line-height: 1.5;
	min-height: 4em;
	min-width: 100%;
	padding: .5em 0;
}

.ContactForm-field .ContactForm-submit {
	color: #795548;
	cursor: pointer;
	border: none;
	padding: .625em .5em;
	margin: .5em;
	font-weight: 600;
	text-transform: uppercase;
	width: 6em;
}

.ContactForm-field .ContactForm-submit:hover,
.ContactForm-field .ContactForm-submit:focus {
	background-color: #e0e0e0;
	margin: .5em;
}

.ContactMap-map {
	height: 8em;
	margin-bottom: 2.25em;
	width: 100%;
}

@media (min-width: 36em) {

	.ContactForm-wrapper {
		width: 100%;
	}

}

@media (min-width: 48em) {

	.ContactMap,
	.ContactForm {
		width: 50%;
	}

	.ContactForm {
		border-top: none;
	}

	.ContactMap-map {
		height: 14em;
		margin-bottom: 1em;
	}

}

@media (min-width: 72em) {

	.ContactForm-field textarea {
		font-size: 1em;
		line-height: 1.5;
		min-height: 6em;
		min-width: 100%;
		padding: .5em 0;
	}

	.ContactMap-map {
		height: 16em;
		margin: 2.25em 0 1em;
		padding: 0 1em;
	}

}

@media (min-width: 96em) {

	.ContactMap-map {
		height: 24em;
		margin-bottom: 2.25em;
	}

}