text:
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows.Forms;
using System.Data.SqlClient;

namespace QLThuVien
{
    public partial class frmtimkiemsach : Form
    {
        OpenFileDialog file;
        SqlConnection cnn;
        public frmtimkiemsach()
        {
            InitializeComponent();
            cnn = new SqlConnection("Data Source=.;Initial Catalog=QLThuVien;Integrated Security=True");
        }
        private void frmtimkiemsach_Load(object sender, EventArgs e)
        {
            loaddlsach();
        }
        private DataTable docsachtheoTinhTrang(string tinhtrang)
        {
            //Download source code mien phi tai Sharecode.vn
            string chuoikn = "select * from SACH where TinhTrang=@TinhTrang";
            SqlCommand cmd = new SqlCommand(chuoikn, cnn);
            DataTable sach = new DataTable();
            cmd.CommandType = CommandType.StoredProcedure;
            cmd.Parameters.AddWithValue("@TinhTrang", tinhtrang);
            try
            {
                cnn.Open();
                sach.Load(cmd.ExecuteReader());
            }
            catch (Exception)
            {

            }
            finally
            {
                if (cnn != null)
                {
                    cnn.Close();
                }
            }

            return sach;
        }
        private DataTable docsachtheoma(string ma)
        {
	DataTable sach = new DataTable();
            cmd.CommandType = CommandType.StoredProcedure;
            string chuoikn = "select * from SACH where MaSach LIKE @MaSach";
            SqlCommand cmd = new SqlCommand(chuoikn, cnn);
            DataTable sach = new DataTable();
            cmd.CommandType = CommandType.StoredProcedure;
            cmd.Parameters.AddWithValue("@MaSach", ma);
            try
            {
                 cnn.Open();
            sach.Load(cmd.ExecuteReader());
            }
            catch (Exception)
            {

            }
            finally
                {
                    if (cnn!=null)
                    {
                        cnn.Close();
                    }
                }

            return sach;
        }
        private DataTable docsachtheoten(string TEN)
        {
            //Download source code mien phi tai Sharecode.vn
            string chuoikn = "select * from SACH where TenSach=@TenSach";
            SqlCommand cmd = new SqlCommand(chuoikn, cnn);
            DataTable sach = new DataTable();
            cmd.CommandType = CommandType.StoredProcedure;
            cmd.Parameters.AddWithValue("@TenSach", TEN);
            try
            {
                cnn.Open();
                sach.Load(cmd.ExecuteReader());
            }
            catch (Exception)
            {

            }
            finally
            {
                if (cnn != null)
                {
                    cnn.Close();
                }
            }

            return sach;
        }
        private DataTable docsachsoluong(string SoLuong)
        {
            string chuoikn = "select * from SACH where SoLuong=@SoLuong";
            SqlCommand cmd = new SqlCommand(chuoikn, cnn);
            DataTable sach = new DataTable();
            cmd.CommandType = CommandType.StoredProcedure;
            cmd.Parameters.AddWithValue("@SoLuong", SoLuong);
            try
            {
                cnn.Open();
                sach.Load(cmd.ExecuteReader());
            }
            catch (Exception)
            {

            }
            finally
            {
                if (cnn != null)
                {
                    cnn.Close();
                }
            }

            return sach;
        }
        private DataTable docsachtheonam(string NamXB)
        {
            string chuoikn = "select * from SACH where NamXB=@NamXB";
            SqlCommand cmd = new SqlCommand(chuoikn, cnn);
            DataTable sach = new DataTable();
            cmd.CommandType = CommandType.StoredProcedure;
            cmd.Parameters.AddWithValue("@NamXB", NamXB);
            try
            {
                cnn.Open();
                sach.Load(cmd.ExecuteReader());
            }
            catch (Exception)
            {

            }
            finally
            {
                if (cnn != null)
                {
                    cnn.Close();
                }
            }

            return sach;
        }
        private DataTable docsachNXB(string NXB)
        {
            string chuoikn = "select * from SACH where NXB=@NXB";
            SqlCommand cmd = new SqlCommand(chuoikn, cnn);
            DataTable sach = new DataTable();
            cmd.CommandType = CommandType.StoredProcedure;
            cmd.Parameters.AddWithValue("@NXB", NXB);
            try
            {
                cnn.Open();
                sach.Load(cmd.ExecuteReader());
            }
            catch (Exception)
            {

            }
            finally
            {
                if (cnn != null)
                {
                    cnn.Close();
                }
            }

            return sach;
        }
        private DataTable docsachTheLoai(string TheLoai)
        {
            string chuoikn = "select * from SACH where TheLoai=@TheLoai";
            SqlCommand cmd = new SqlCommand(chuoikn, cnn);
            DataTable sach = new DataTable();
            cmd.CommandType = CommandType.StoredProcedure;
            cmd.Parameters.AddWithValue("@TheLoai", TheLoai);
            try
            {
                cnn.Open();
                sach.Load(cmd.ExecuteReader());
            }
            catch (Exception)
            {

            }
            finally
            {
                if (cnn != null)
                {
                    cnn.Close();
                }
            }

            return sach;
        }
        private DataTable docsachTG(string TG)
        {
            string chuoikn = "select * from SACH where TG=@TG";
            SqlCommand cmd = new SqlCommand(chuoikn, cnn);
            DataTable sach = new DataTable();
            cmd.CommandType = CommandType.StoredProcedure;
            cmd.Parameters.AddWithValue("@TG", TG);
            try
            {
                cnn.Open();
                sach.Load(cmd.ExecuteReader());
            }
            catch (Exception)
            {

            }
            finally
            {
                if (cnn != null)
                {
                    cnn.Close();
                }
            }

            return sach;
        }
        private void btntimkiem_Click_1(object sender, EventArgs e)
        {
            if (txtMasach.Text!=null)
            {
                dgvthongtin.DataSource = docsachtheoma(txtMasach.Text);
            }
            if (txtTensach.Text != null)
            {
                dgvthongtin.DataSource = docsachtheoten(txtTensach.Text);
            }
            if (txtnamxb.Text != null)
            {
                dgvthongtin.DataSource = docsachtheonam(txtnamxb.Text);
            }
            if (txtsoluong.Text != null)
            {
                dgvthongtin.DataSource = docsachsoluong(txtsoluong.Text);
            }
            if (txtnxb.Text != null)
            {
                dgvthongtin.DataSource = docsachNXB(txtnxb.Text);
            }
            if (txttheloaisach.Text != null)
            {
                dgvthongtin.DataSource = docsachTheLoai(txttheloaisach.Text);
            }
            if (txttg.Text != null)
            {
                dgvthongtin.DataSource = docsachTG(txttg.Text);
            }
        }
        #region load len luoi
        private DataTable docsach()
        {
            SqlCommand cmd = new SqlCommand();
            cmd.CommandText = "sp_LOADSACH";
            cmd.CommandType = CommandType.StoredProcedure;
            cmd.Connection = cnn;
            DataTable sach = new DataTable();
            cnn.Open();
            sach.Load(cmd.ExecuteReader());
            cnn.Close();
            return sach;
        }
        private void loaddlsach()
        {
            dgvthongtin.DataSource = docsach();
            lbltong.ForeColor = Color.Red;
            lbltong.Text = (dgvthongtin.Rows.Count).ToString()+ " quyển";
        }
        #endregion
        #region xử lý bingding
        private void data_bingding()
        {
            txtMasach.DataBindings.Add("Text", dgvthongtin.DataSource, "MaSach");
            txtTensach.DataBindings.Add("Text", dgvthongtin.DataSource, "TenSach");
            txttheloaisach.DataBindings.Add("Text", dgvthongtin.DataSource, "TheLoai");
            txttinhtrang.DataBindings.Add("Text", dgvthongtin.DataSource, "TinhTrang");
            txtsoluong.DataBindings.Add("Text", dgvthongtin.DataSource, "SoLuong");
            txtnxb.DataBindings.Add("Text", dgvthongtin.DataSource, "NXB");
            txtnamxb.DataBindings.Add("Text", dgvthongtin.DataSource, "NamXB");
            txttg.DataBindings.Add("Text", dgvthongtin.DataSource, "TG");
            PICHINH.DataBindings.Add("Image", dgvthongtin.DataSource, "Hinh", true);
        }
        private void huy_bingding()
        {
            if (txtMasach.DataBindings != null)
                txtMasach.DataBindings.Clear();
            if (txtTensach.DataBindings != null)
                txtTensach.DataBindings.Clear();
            if (txttheloaisach.DataBindings != null)
                txttheloaisach.DataBindings.Clear();
            if (txttinhtrang.DataBindings != null)
                txttinhtrang.DataBindings.Clear();
            if (txtsoluong.DataBindings != null)
                txtsoluong.DataBindings.Clear();
            if (txtnxb.DataBindings != null)
                txtnxb.DataBindings.Clear();
            if (txtnamxb.DataBindings != null)
                txtnamxb.DataBindings.Clear();
            if (txttg.DataBindings != null)
                txttg.DataBindings.Clear();
            if (PICHINH.DataBindings != null)
                PICHINH.DataBindings.Clear();
        }
        private void tieudecotsach()
        {
            dgvthongtin.Columns[0].HeaderText = "Mã Sách";
            dgvthongtin.Columns[1].HeaderText = "Tên Sách";
            dgvthongtin.Columns[2].HeaderText = "Thể Loại";
            dgvthongtin.Columns[3].HeaderText = "Tình Trạng";
            dgvthongtin.Columns[4].HeaderText = "Số Lượng";
            dgvthongtin.Columns[5].HeaderText = "Mã NXB";
            dgvthongtin.Columns[6].HeaderText = "Năm NXB";
            dgvthongtin.Columns[7].HeaderText = "Mã TG";
            dgvthongtin.Columns[8].HeaderText = "Hình";
        }
        #endregion
        #region Lấy hình
        private void BTNHINH_Click(object sender, EventArgs e)
        {
            openFileDialog1.ShowDialog();
            openFileDialog1.Filter = "Image file(*.jpg)|*.jpg";
            string tenanh = openFileDialog1.FileName;
            Bitmap anh = new Bitmap(tenanh);
            PICHINH.SizeMode = PictureBoxSizeMode.Zoom;
            PICHINH.Image = (Image)anh;
            PICHINH.Text = "Đường dẫn file ảnh : " + tenanh;
            PICHINH.Text = tenanh;
        }
        #endregion

    }
}


text:
//
//  LZBPageTransition.h
//  LZBViewControllerTransitionAnimation
//
//  Created by apple on 16/6/17.
//  Copyright © 2016年 apple. All rights reserved.
//

#import "LZBBaseTransition.h"

@interface LZBPageTransition : LZBBaseTransition

/**
 *  截图是否包括导航条,默认是Yes
 */
@property (nonatomic, assign) BOOL screenShotIsIncludeNavigatebar;

/**
 *  翻页是否增加阴影效果,默认是NO
 */
@property (nonatomic, assign) BOOL shadowIsEnable;

@end

redpajama_set_name: RedPajamaGithub


text:
package com.gochinatv.cdn.api.service;

import com.alibaba.fastjson.JSONObject;

public interface CdnEncryptionService{

	public void testScope();

	 /**
     * 获取动态防盗链的码
     * @param token
     * @return
     */
	public JSONObject getCdnKey(String token) throws Exception;

	/**
	 * 加密播放地址url
	 * @param url
	 * @param st   过期时间单位秒
	 * @return
	 * @throws Exception
	 */
	public JSONObject getPlayUrl(String url,int st) throws Exception;
}


text:
// Copyright (c) Microsoft Corporation. All rights reserved.
// Licensed under the MIT License.

package com.azure.resourcemanager.authorization.models;

import com.azure.core.annotation.Fluent;
import com.azure.core.http.rest.PagedFlux;
import com.azure.resourcemanager.authorization.fluent.models.ADGroupInner;
import com.azure.resourcemanager.resources.fluentcore.model.Appliable;
import com.azure.resourcemanager.resources.fluentcore.model.Creatable;
import com.azure.resourcemanager.resources.fluentcore.model.HasInnerModel;
import com.azure.resourcemanager.resources.fluentcore.model.Updatable;

import java.util.List;

/** An immutable client-side representation of an Azure AD group. */
@Fluent
public interface ActiveDirectoryGroup
    extends ActiveDirectoryObject, HasInnerModel<ADGroupInner>, Updatable<ActiveDirectoryGroup.Update> {
    /** @return security enabled field. */
    boolean securityEnabled();

    /** @return mail field. */
    String mail();

    /**
     * Lists the members in the group.
     *
     * @return a list of the members
     */
    List<ActiveDirectoryObject> listMembers();

    /**
     * Lists the members in the group.
     *
     * @return a list of the members
     */
    PagedFlux<ActiveDirectoryObject> listMembersAsync();

    /** Container interface for all the definitions that need to be implemented. */
    interface Definition extends DefinitionStages.Blank, DefinitionStages.WithEmailAlias, DefinitionStages.WithCreate {
    }

    /** Grouping of all the AD group definition stages. */
    interface DefinitionStages {
        /** The first stage of the AD group definition. */
        interface Blank extends WithEmailAlias {
        }

        /** An AD Group definition allowing mail nickname to be specified. */
        interface WithEmailAlias {
            WithCreate withEmailAlias(String mailNickname);
        }

        /** An AD Group definition allowing members to be added. */
        interface WithMember {
            /**
             * Add a member based on its object id. The member can be a user, a group, a service principal, or an
             * application.
             *
             * @param objectId the Active Directory object's id
             * @return the next AD Group definition stage
             */
            WithCreate withMember(String objectId);

            /**
             * Adds a user as a member in the group.
             *
             * @param user the Active Directory user to add
             * @return the next AD group definition stage
             */
            WithCreate withMember(ActiveDirectoryUser user);

            /**
             * Adds a group as a member in the group.
             *
             * @param group the Active Directory group to add
             * @return the next AD group definition stage
             */
            WithCreate withMember(ActiveDirectoryGroup group);

            /**
             * Adds a service principal as a member in the group.
             *
             * @param servicePrincipal the service principal to add
             * @return the next AD group definition stage
             */
            WithCreate withMember(ServicePrincipal servicePrincipal);
        }

        /**
         * An AD group definition with sufficient inputs to create a new group in the cloud, but exposing additional
         * optional inputs to specify.
         */
        interface WithCreate extends Creatable<ActiveDirectoryGroup>, WithMember {
        }
    }

    /** Grouping of all the AD group update stages. */
    interface UpdateStages {
        /** An AD Group definition allowing members to be added or removed. */
        interface WithMember {
            /**
             * Adds a member based on its object id. The member can be a user, a group, a service principal, or an
             * application.
             *
             * @param objectId the Active Directory object's id
             * @return the next AD Group update stage
             */
            Update withMember(String objectId);

            /**
             * Adds a user as a member in the group.
             *
             * @param user the Active Directory user to add
             * @return the next AD group update stage
             */
            Update withMember(ActiveDirectoryUser user);

            /**
             * Adds a group as a member in the group.
             *
             * @param group the Active Directory group to add
             * @return the next AD group update stage
             */
            Update withMember(ActiveDirectoryGroup group);

            /**
             * Adds a service principal as a member in the group.
             *
             * @param servicePrincipal the service principal to add
             * @return the next AD group update stage
             */
            Update withMember(ServicePrincipal servicePrincipal);

            /**
             * Removes a member based on its object id.
             *
             * @param objectId the Active Directory object's id
             * @return the next AD Group update stage
             */
            Update withoutMember(String objectId);

            /**
             * Removes a user as a member in the group.
             *
             * @param user the Active Directory user to remove
             * @return the next AD group update stage
             */
            Update withoutMember(ActiveDirectoryUser user);

            /**
             * Removes a group as a member in the group.
             *
             * @param group the Active Directory group to remove
             * @return the next AD group update stage
             */
            Update withoutMember(ActiveDirectoryGroup group);

            /**
             * Removes a service principal as a member in the group.
             *
             * @param servicePrincipal the service principal to remove
             * @return the next AD group update stage
             */
            Update withoutMember(ServicePrincipal servicePrincipal);
        }
    }

    /** The template for a group update operation, containing all the settings that can be modified. */
    interface Update extends Appliable<ActiveDirectoryGroup>, UpdateStages.WithMember {
    }
}


text:
BOOL woc_class_swizzleMethodAndStore(Class class, SEL original, IMP replacement, IMP *store)
{
    IMP imp = NULL;
    Method method = class_getInstanceMethod(class, original);
    if (method) {
        const char *type = method_getTypeEncoding(method);
        imp = class_replaceMethod(class, original, replacement, type);
        if (!imp) {
            imp = method_getImplementation(method);
        }
    }
    if (imp && store) { *store = imp; }
    return (imp != NULL);
}

@implementation NSObject (WOCObjC)

+ (BOOL)swizzle:(SEL)original with:(IMP)replacement store:(IMP *)store {
    return woc_class_swizzleMethodAndStore(self, original, replacement, store);
}

@end


text:
function SalesAnalysisController($scope, Statistics, Shops, Employes, Items) {
  //controller initialization
  $scope.$watch('currentMerchant.merchant', function () {
    if ($scope.currentMerchant.merchant['address']) {
      $scope.init();
    }
  })
  $scope.init = function () {
    $scope.analysisModel = 'merchant';
    $scope.periodModel = 'lastWeek';
    $scope.unitModel = 'daily';
    $scope.untilDate = new Date();  //change here for natural week or month
    $scope.dualChart = true;
    $scope.shopsDiv = true;
    $scope.statisticsDeep = 1;
    $scope.tableHeader = ['name', 'sale', 'percentage', 'crr', 'yyb'];
    $scope.tableHeaderDisplay = ['商店名称', '销售额(元)', '百分比', '环比', '同比'];
    $scope.tableColumnSort = { sortColumn: 'percentage', reverse: true };
    $scope.primaryChart = basicChartInit();
    $scope.offChart = basicChartInit();
    $scope.shopHashMap = {
      Set : function(key,value){this[key] = value},
      Get : function(key){return this[key]},
      Contains : function(key){return this.Get(key) == null?false:true},
      Remove : function(key){delete this[key]}
    };
    $scope.headers = ['name', 'sale', 'percentage', 'crr', 'yyb']
    $scope.headersZ = ['商店名称', '销售额(元)', '百分比', '环比', '同比']
    $scope.columnSort = { sortColumn: 'percentage', reverse: true };
    $scope.primaryKeyID = $scope.currentMerchant.merchant.id;
    $scope.primaryName = undefined;
    $scope.virginEmployee = 0;
    $scope.virginItem = 0;
    $scope.refreshComplete = undefined;
//    setTimeout(showAllShops, 200);
    widthFunctions();
  }
  function showAllShops() {
    $('#showAll').click();
  }

  //empty basic chart initialization
  function basicChartInit() {
    var chart = {};
    chart.displayed = true;
    chart.cssStyle = "height:350px; width:100%;text-align: right;";
    chart.data = {"cols": [], "rows": []};
    chart.options = {
      "isStacked": "false",
      "fill": 50,
      "displayExactValues": true,
      "vAxis": {
        "title": "人民币(元)",
        "gridlines": {"count": 10},
        "titleTextStyle": {italic: false, bold: true},
        "baseline": 0
      },
      "hAxis": {
        "title": "时间",
        "maxAlternation": 1,
        "slantedText": false,
        "titleTextStyle": {italic: false, bold: true}
      }
    };
    return chart
  }

  //chart configuration
  function chartConfig(chart, type, title, cols, legend, callback) {
    chart.type = type;
    chart.data.cols = cols;
    chart.data.rows = [];
    chart.options.title = title;
    chart.options.legend = legend;
    if ($scope.dualChart == false){
      $scope.primaryChartFull = "col-lg-12";
      return callback()
    } else{
      $scope.primaryChartFull = "col-lg-8";
      return callback()
    }
  }

  //set cols for division chart
  function colSet(primaryCols, primaryType, primaryTitle, primaryLegend, callback) {
    primaryCols = [
      {id: "period", label: "周期", type: "string"}
    ];
    $scope.shopsResult.forEach(function (item) {  //each item is a shop
      var shop = {};
      shop.id = "sales";
      shop.label = item.name;
      shop.type = "number";
      primaryCols.push(shop);
    })
    chartConfig($scope.primaryChart, primaryType, primaryTitle, primaryCols, primaryLegend, callback);
  }

  //chart handler
  function chartHandler(callback) {
    var chart = basicChartInit();
    var primaryType = 'AreaChart';
    var primaryTitle = ($scope.primaryName == undefined) ? '商户销售趋势' : $scope.primaryName + '销售趋势';
    var primaryLegend = ($scope.shopsDiv != false) ? 'null' : 'none';
    if ($scope.shopsDiv == true) {
      var primaryCols = [];
      if ($scope.analysisModel == 'merchant'){
        Shops.query({merchantID: $scope.primaryStatParam.keyID, '$fields': {id: 1, merchantID: 1, name: 1}}, function (result){
          $scope.shopsResult = result;
          colSet(primaryCols, primaryType, primaryTitle, primaryLegend, callback);
        })
      }
      if ($scope.analysisModel == 'shop'){
        Employes.query({'shopID': $scope.primaryStatParam.keyID, $fields: {id: 1, shopID: 1, name: 1}}, function (result){
          $scope.shopsResult = result; //should not have used this name
          colSet(primaryCols, primaryType, primaryTitle, primaryLegend, callback);
        })
      }
      if ($scope.analysisModel == 'shopItem'){
        Items.query({merchantID: 'e20dccdf039b3874', $fields: {id: 1, shopID: 1, name: 1}}, function (result){
          $scope.shopsResult = result; //should not have used this name
          colSet(primaryCols, primaryType, primaryTitle, primaryLegend, callback);
        })
      }
    }
    if ($scope.shopsDiv == false) {
      var primaryCols = [
        {id: "period", label: "周期", type: "string"},
        {id: "sales", label: "销售", type: "number"}
      ];
      chartConfig($scope.primaryChart, primaryType, primaryTitle, primaryCols, primaryLegend, callback);
    }
    if ($scope.dualChart == true) {
      var offType = 'PieChart';
      var offTitle = '商店销售比例';
      if ($scope.analysisModel == 'merchant')
        offTitle = '商店销售比例';
      if ($scope.analysisModel == 'shop')
        offTitle = '员工销售比例';
      if ($scope.analysisModel == 'item')
        offTitle = '商品销售比例';
      var offLegend = {position: 'left'};
      var offCols = [
        {id: "period", label: "周期", type: "string"},
        {id: "sales", label: "销售", type: "number"}
      ];
      chartConfig($scope.offChart, offType, offTitle, offCols, offLegend, function(){});
    }
  }

  //set row text
  function rowSet(statParam, chart, rows, until, callback) {
    for (var i = $scope.pLimit, j = 0; i > 0; i--) {
      var d = Statistics.periodDate(until - i + 1, statParam.period);
      var day = moment(d).weekday();
      switch (day) {
        case 0: day = '日'; break;
        case 1: day = '一'; break;
        case 2: day = '二'; break;
        case 3: day = '三'; break;
        case 4: day = '四'; break;
        case 5: day = '五'; break;
        case 6: day = '六'; break;
      }
      var flag = false;
      var c = {c: []};
      for (var k = 0; k < chart.data.cols.length; k++)
        c.c.push({v: 0});
      c.c[0] = {v: (d.getMonth() + 1) + '月' + d.getDate() + '日(' + day + ')'};
      flag = true;
      if (flag == true) {
        rows.push(c);
      }
    }
    return callback();
  }

  //initialize statistics parameters
  function statParamInit(keyIDs) {
    console.log($scope.analysisModel);
    var statParam = {}
    if ($scope.analysisModel == "item"){
      statParam.itemID = $scope.currentItem.id;
      statParam.target="deals";
    } else {
      statParam.itemID = undefined;
      statParam.target="bills";
    }
    statParam.keyID = keyIDs;
    statParam.limit = 1000;
    statParam.period = $scope.unitModel;
    if ($scope.periodModel == 'lastWeek') {
      $scope.pLimit = 7;
      $scope.untilDate = new Date();
      $scope.stdt = moment($scope.untilDate).subtract('days', $scope.pLimit - 1).toDate()
    }
    if ($scope.periodModel == 'lastMonth') {
      $scope.pLimit = 30;
      $scope.untilDate = new Date();
      $scope.stdt = moment($scope.untilDate).subtract('days', $scope.pLimit - 1).toDate()
    }
    if ($scope.periodModel == 'custom') {
      $scope.pLimit = $scope.dateRange.endDate.diff($scope.dateRange.startDate, 'days') + 1;
      $scope.untilDate = $scope.dateRange.endDate.toDate();
      $scope.stdt = $scope.dateRange.startDate.toDate();
      if ($scope.pLimit >= 120)
        statParam.period = "weekly";
      else
        statParam.period = "daily";
    }
    if (statParam.period == "weekly")
      $scope.pLimit = Math.floor($scope.pLimit / 7);
    if (statParam.period == "monthly")
      $scope.pLimit = Math.floor($scope.pLimit / 30);
    return statParam;
  }

  //set sale numbers
  function saleSet(rows, until, statParam, chart, callback) {
    if ($scope.statisticsDeep == 1) {
      Statistics.query(statParam, function (result) {
        result.forEach(function (item) {
          var v = item.value;
          var c = rows[v.statAt - until + $scope.pLimit - 1];
          if ($scope.analysisModel == "item")
            c.c[1] = {v: v.sumPrice / 100, f: v.sumPrice / 100 + "元\n共: " + v.count + "次"};
          else
            c.c[1] = {v: v.sale.total / 100, f: v.sale.total / 100 + "元\n共: " + v.sale.count + "次"};
        })
        chart.data.rows = rows;
        return callback();
      })
    }
    if ($scope.statisticsDeep == 2) {
      $scope.shopKeyIDs = [];
      $scope.shopsResult.forEach(function (item, index) {
        $scope.shopKeyIDs.push(item.id);
        $scope.shopHashMap.Set(item.id, index);
//        console.log(item.id)
        $scope.shopHashMap.Set(index, item.name);
      })
      if ($scope.analysisModel == 'shopItem'){
        statParam.keyID = $scope.currentShop.id;
        statParam.itemID = $scope.shopKeyIDs;
        statParam.target = 'deals';
      }
      else
        statParam.keyID = $scope.shopKeyIDs;
//      console.log(statParam)
      Statistics.query(statParam, function (result){
        $scope.statResult = result;
        result.forEach(function(item) {
          var v = item.value;
          var c = rows[v.statAt - until + $scope.pLimit - 1];
          var index = $scope.shopHashMap.Get(item.id.split('#')[0]);
//          console.log(item.id)
          if ($scope.analysisModel == 'shopItem'){
            index = $scope.shopHashMap.Get(item.id.split('#')[2]);
            c.c[index + 1] = {v: v.sumPrice / 100, f: v.sumPrice / 100 + "元\n共: " + v.count + "次"};
          }
          else
            c.c[index + 1] = {v: v.sale.total / 100, f: v.sale.total / 100 + "元\n共: " + v.sale.count + "次"};
        })
        chart.data.rows = rows;
        return callback();
      })
    }
  }

  Array.prototype.contains = function(obj) {
    var i = this.length;
    while (i--) {
      if (this[i] === obj) {
        return true;
      }
    }
    return false;
  }

  function sumSet(statParam, chart, callback) {
    $scope.tbRows = [];
    var hist = {};
    var names = [];
    var ids = [];
    var total = 0;
    $scope.statResult.map(function (a){
      var index =  $scope.shopHashMap.Get(a.id.split('#')[0]);
      if ($scope.analysisModel == 'shopItem')
        index =  $scope.shopHashMap.Get(a.id.split('#')[2]);
      var name = $scope.shopHashMap.Get(index);
      if ($scope.analysisModel == 'shopItem')
        total += a.value.sumPrice/100;
      else
        total += a.value.sale.total/100;
      if (!names.contains(name)){
        names.push(name);
        if ($scope.analysisModel == 'shopItem')
          ids.push(a.id.split('#')[2]);
        else
          ids.push(a.id.split('#')[0]);
      }
      if(name in hist){
        if ($scope.analysisModel == 'shopItem'){
          hist[name] += a.value.sumPrice/100;
          hist[name+"#"] += a.value.quantity;
        }
        else
          hist[name] += a.value.sale.total/100;
      }
      else{
        if ($scope.analysisModel == 'shopItem'){
          hist[name] = a.value.sumPrice/100;
          hist[name+"#"] = a.value.quantity;     //for quantity
        }
        else
          hist[name] = a.value.sale.total/100;
      }
    })
    for (var counter = 0; counter < names.length; counter ++) {
      var tbRow = {};
      tbRow.name = names[counter];
      tbRow.id = ids[counter];
      tbRow.sale = parseFloat(hist[names[counter]].toFixed(1));
      tbRow.quantity = parseInt(hist[names[counter]+"#"]);
//      console.log(tbRow.sale);
      tbRow.percentage = parseFloat((100 * tbRow.sale / total).toFixed(1));
//      console.log(tbRow.percentage);
      $scope.tbRows.push(tbRow);
      var content = {c:[
        {v: names[counter]},
        {v: Number(hist[names[counter]].toFixed(1))}
      ]};
      chart.data.rows.push(content);
    }
    return callback();
  }
  var refresh = false
  function refreshChart() {
    if (refresh == true) return;
    refresh = true;
    var primaryID = $scope.primaryKeyID || $scope.currentMerchant.merchant.id;
    if ($scope.analysisModel == 'merchant')
      primaryID = $scope.currentMerchant.merchant.id;
    $scope.refreshComplete = false;
    console.log('refreshing')
    if (true) {
      $scope.primaryStatParam = statParamInit(primaryID)
      fillChart($scope.primaryStatParam)
    }
  }
  function fillChart(statParam) {
    if ($scope.periodModel != 'custom'){
      $scope.unitModel = 'daily';
      $scope.dateRange = {
        endDate: moment($scope.untilDate),
        startDate: moment().subtract('days', $scope.pLimit - 1)
      };
    }
    chartHandler(function (){
      var rows = []
      var until = Statistics.until($scope.untilDate, statParam.period);
      statParam.end = until;
      statParam.start = until - $scope.pLimit;
      rowSet(statParam, $scope.primaryChart, rows, until, function (){
//        if ($scope.analysisModel == 'shopItem')
//          console.log(statParam);
        saleSet(rows, until, statParam, $scope.primaryChart, function() {
          console.log('Sale Set to primary chart completed'); //if load is to be added, this is the place
          if ($scope.dualChart == true)
            sumSet(statParam, $scope.offChart, function (){$scope.refreshComplete = true;})
          refresh = false;
        });
        $scope.weekDisable = moment($scope.untilDate).diff(moment($scope.stdt), 'days') <= 7 ? true : false
        $scope.monthDisable = moment($scope.untilDate).diff(moment($scope.stdt), 'days') <= 30 ? true : false
      });
    });
  }
  $scope.lvlMove = function (tbRow, analysisModel){
    $scope.primaryKeyID = tbRow.id || tbRow;
    $scope.primaryName = tbRow.name || undefined;
    if($scope.analysisModel == 'merchant'){
      $scope.analysisModel = analysisModel || 'shop';
      $scope.currentShops = $scope.tbRows;
      $scope.currentShop = tbRow;
      refreshChart();
      return;
    }
    else if($scope.analysisModel == 'shop'){
      $scope.analysisModel = analysisModel || 'employee';
      $scope.currentEmployees = $scope.tbRows;
      $scope.currentEmployee = tbRow;
      if (analysisModel == "merchant") {
        refreshChart();
      } else
        $scope.shopsDiv = false;
      return;
    }
    else if($scope.analysisModel == 'shopItem'){
      console.log('here')
      $scope.analysisModel = analysisModel || 'item';
      $scope.currentItems = $scope.tbRows;
      $scope.currentItem = tbRow;
      if (analysisModel == "merchant") {
        refreshChart();
      } else
        $scope.shopsDiv = false;
      return;
    }
    //temporary treat
    else if($scope.analysisModel == 'employee'){
      $scope.analysisModel = analysisModel || 'employee';
      refreshChart();
    }
    else if($scope.analysisModel == 'item'){
      $scope.analysisModel = analysisModel || 'item';
      refreshChart();
    }
  }

  $scope.$watch('currentShop', function (){
    if ($scope.currentMerchant.merchant['address']) {
      if ($scope.currentShop == undefined)
        return;
      $scope.primaryKeyID = $scope.currentShop.id || undefined;
      $scope.primaryName = $scope.currentShop.name;
      refreshChart();
    }
  })

  $scope.$watch('currentEmployee', function (){
    if ($scope.currentMerchant.merchant['address']) {
      if ($scope.currentEmployee == undefined)
        return;
      $scope.primaryKeyID = $scope.currentEmployee.id || undefined;
      $scope.primaryName = $scope.currentEmployee.name;
      console.log($scope.shopsDiv);
      console.log($scope.currentEmployee.name);
      if ($scope.virginEmployee == 0) {
        if ($scope.currentEmployee.name == undefined) {
          refreshChart();
        } else {
          $scope.virginEmployee ++;
          return;
        }
      } else
        refreshChart();
    }
  })

  $scope.$watch('currentItem', function (){
    if ($scope.currentMerchant.merchant['address']) {
      if ($scope.currentItem == undefined)
        return;
//      $scope.primaryKeyID = $scope.currentItem.id || undefined;
      $scope.primaryKeyID = $scope.currentShop.id || undefined;
      $scope.primaryName = $scope.currentItem.name;
      console.log($scope.primaryKeyID);
      if ($scope.virginItem == 0) {
        if($scope.currentItem.name == undefined){
          refreshChart();
        } else {
          $scope.virginItem ++;
          return;
        }
      } else
        refreshChart();
    }
  })

  $scope.$watch('analysisModel', function(){
    if ($scope.currentMerchant.merchant['address']) {
      if ($scope.analysisModel == 'merchant')
        $scope.headersZ = ['商店名称', '销售额(元)', '百分比', '环比', '同比'];
      if ($scope.analysisModel == 'shop')
        $scope.headersZ = ['员工姓名', '销售额(元)', '百分比', '环比', '同比'];
      if ($scope.analysisModel == 'shopItem') {
        $scope.headers = ['name', 'sale', 'percentage', 'quantity', 'crr', 'yyb']
        $scope.headersZ = ['商品名称', '销售额(元)', '百分比', '销售量(个)', '环比', '同比'];
      }
      if ($scope.analysisModel == 'shop' || $scope.analysisModel == 'shopItem')
        refreshChart();
    }
  })

  $scope.$watch('analysisModel', function (){
    if ($scope.currentMerchant.merchant['address']) {
      if ($scope.analysisModel != 'employee')
        $scope.virginEmployee = 0;
      if ($scope.analysisModel != 'item')
        $scope.virginItem = 0;
    }
  })

  $scope.$watch('shopsDiv', function() {
    if ($scope.currentMerchant.merchant['address']) {
      console.log('attempt to refresh caused by shopsDiv')
      if ($scope.statisticsDeep == 1) {
        $scope.statisticsDeep = 2;
        $scope.dualChart = true;
        refreshChart()
      } else {
        $scope.statisticsDeep = 1;
        $scope.dualChart = false;
        refreshChart()
      }
    }

  })
  $scope.$watch('unitModel', function () {
    if ($scope.currentMerchant.merchant['address']) {
      console.log('attempt to refresh caused by unitModel')
      refreshChart()
    }
  })
  $scope.$watch('periodModel', function () {
    if ($scope.currentMerchant.merchant['address']) {
      console.log('attempt to refresh caused by perodModel')
      if ($scope.periodModel != 'custom')
        refreshChart();
    }
  })
  $scope.$watch('dateRange', function(){
    if ($scope.currentMerchant.merchant['address']) {
      console.log('attempt to refresh caused by dateRange')
      $scope.unitModel = 'daily';
      refreshChart();
    }
  })
  //google chart utilities
  $scope.chartReady = function () {
    fixGoogleChartsBarsBootstrap();
  }
  function fixGoogleChartsBarsBootstrap() {
    $(".google-visualization-table-table img[width]").each(function (index, img) {
      $(img).css("width", $(img).attr("width")).css("height", $(img).attr("height"));
    });
  }
}


text:
using System;
namespace MvvmMobile.Sample.Core.Model
{
    public class Motorcycle : IMotorcycle
    {
        public Guid Id { get; set; }
        public string Brand { get; set; }
        public string Model { get; set; }
        public int Year { get; set; }

        public override string ToString()
        {
            return $"{Brand} {Model} ({Year})";
        }
    }
}


text:
package com.xsolla.android.sdk.view.adapter;

import android.content.Context;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import android.widget.BaseAdapter;
import android.widget.TextView;

import com.xsolla.android.sdk.R;
import com.xsolla.android.sdk.api.model.util.XUtils.XActiveComponent;
import com.xsolla.android.sdk.view.widget.IconTextView;

import java.util.ArrayList;

/**
 *
 */
public class MenuElementsAdapter extends BaseAdapter {

    private Context                     mContext;
    private ArrayList<XActiveComponent> mList;

    public MenuElementsAdapter(Context mContext, ArrayList<XActiveComponent> mList) {
        this.mContext = mContext;
        this.mList = mList;
    }

    @Override
    public int getCount() {
        return mList.size();
    }

    @Override
    public XActiveComponent getItem(int position) {
        return mList.get(position);
    }

    @Override
    public long getItemId(int position) {
        return position;
    }

    @Override
    public View getView(int position, View convertView, ViewGroup parent) {
        ViewHolder holder;
        if(convertView == null){
            holder = new ViewHolder();
            LayoutInflater inflater = (LayoutInflater) mContext.getSystemService(Context.LAYOUT_INFLATER_SERVICE);
            convertView = inflater.inflate(R.layout.xsolla_shop_menu_elem, null);
            holder.icon = (IconTextView) convertView.findViewById(R.id.xsolla_icon);
            holder.tvTitle = (TextView) convertView.findViewById(R.id.xsolla_tv_title);

            convertView.setTag(holder);
        } else {
            holder = (ViewHolder)convertView.getTag();
        }

        XActiveComponent item = getItem(position);
        holder.icon.setText(item.getIcon());
        holder.tvTitle.setText(item.getTitle());
        return convertView;
    }

    class ViewHolder {
        IconTextView    icon;
        TextView        tvTitle;
    }

}


text:
package com.leo.cattle.domain.interactor;

import com.leo.cattle.domain.repository.UserRepository;

import javax.inject.Inject;

import rx.Observable;

/**
 * Created by leobui on 3/9/2016.
 */
public class SignInUseCase extends UseCase {

    private  String userEmail;
    private  String userPassword;
    private final UserRepository userRepository;

    @Inject
    public SignInUseCase(UserRepository userRepository,
                         com.leo.cattle.domain.executor.ThreadExecutor threadExecutor, com.leo.cattle.domain.executor.PostExecutionThread postExecutionThread) {
        super(threadExecutor, postExecutionThread);
        this.userRepository = userRepository;
    }

    @Override protected Observable buildUseCaseObservable() {
        return this.userRepository.askForSignIn(this.userEmail, this.userPassword);
    }
    public void passParamForSignIn(String userEmail, String userPassword){
        this.userEmail = userEmail;
        this.userPassword = userPassword;
    }
}


text:
import { Component, Input } from '@angular/core';

@Component({
  selector: 'app-side-navigation',
  templateUrl: './side-navigation.component.html',
  styleUrls: ['./side-navigation.component.less']
})
export class SideNavigationComponent {

  @Input() navigation: SideNavigationItem[];

  open: boolean = true;

}

export interface SideNavigationItem {
  icon: string;
  title: string;
  path: string;
}


text:
package com.google.api.generator.engine.ast;

import com.google.auto.value.AutoValue;
import com.google.common.base.Preconditions;
import com.google.common.collect.ImmutableList;
import com.google.common.collect.ImmutableMap;
import java.util.Collections;
import java.util.List;

@AutoValue
public abstract class IfStatement implements Statement {
  public abstract Expr conditionExpr();

  public abstract ImmutableList<Statement> body();

  public abstract ImmutableMap<Expr, List<Statement>> elseIfs(); // Optional.

  public abstract ImmutableList<Statement> elseBody(); // Optional.

  @Override
  public void accept(AstNodeVisitor visitor) {
    visitor.visit(this);
  }

  public static Builder builder() {
    return new AutoValue_IfStatement.Builder()
        .setElseIfs(ImmutableMap.of())
        .setElseBody(Collections.emptyList());
  }

  @AutoValue.Builder
  public abstract static class Builder {
    public abstract Builder setConditionExpr(Expr expr);

    public abstract Builder setBody(List<Statement> body);

    public abstract Builder setElseBody(List<Statement> elseBody);

    public Builder addElseIf(Expr conditionExpr, List<Statement> body) {
      elseIfsBuilder().put(conditionExpr, body);
      return this;
    }

    abstract ImmutableMap.Builder<Expr, List<Statement>> elseIfsBuilder();

    abstract Builder setElseIfs(ImmutableMap<Expr, List<Statement>> elseIfBlocks);

    abstract IfStatement autoBuild();

    public IfStatement build() {
      IfStatement ifStatement = autoBuild();
      NodeValidator.checkNoNullElements(ifStatement.body(), "body", "if-statement");
      NodeValidator.checkNoNullElements(ifStatement.elseIfs(), "else-ifs", "if-statement");
      NodeValidator.checkNoNullElements(ifStatement.elseBody(), "else-body", "if-statement");

      Preconditions.checkState(
          ifStatement.conditionExpr().type().equals(TypeNode.BOOLEAN),
          "If-condition must be a boolean-typed expression");
      return ifStatement;
    }
  }
}


text:
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text.RegularExpressions;
using Examine;
using Examine.LuceneEngine.Providers;
using Lucene.Net.Analysis;
using Lucene.Net.Index;
using Lucene.Net.QueryParsers;
using Lucene.Net.Search;
using Lucene.Net.Store;
using Umbraco.Core;
using Version = Lucene.Net.Util.Version;
using Umbraco.Core.Logging;
using System.Threading;

namespace Umbraco.Examine
{
    /// <summary>
    /// Extension methods for the LuceneIndex
    /// </summary>
    public static class ExamineExtensions
    {
        /// <summary>
        /// Matches a culture iso name suffix
        /// </summary>
        /// <remarks>
        /// myFieldName_en-us will match the "en-us"
        /// </remarks>
        internal static readonly Regex CultureIsoCodeFieldNameMatchExpression = new Regex("^([_\\w]+)_([a-z]{2}-[a-z0-9]{2,4})$", RegexOptions.Compiled);

        private static bool _isConfigured = false;
        private static object _configuredInit = null;
        private static object _isConfiguredLocker = new object();

        /// <summary>
        /// Called on startup to configure each index.
        /// </summary>
        /// <remarks>
        /// Configures and unlocks all Lucene based indexes registered with the <see cref="IExamineManager"/>.
        /// </remarks>
        internal static void ConfigureIndexes(this IExamineManager examineManager, IMainDom mainDom, ILogger logger)
        {
            LazyInitializer.EnsureInitialized(
                ref _configuredInit,
                ref _isConfigured,
                ref _isConfiguredLocker,
                () =>
                {
                    examineManager.ConfigureLuceneIndexes(logger, !mainDom.IsMainDom);
                    return null;
                });
        }

        //TODO: We need a public method here to just match a field name against CultureIsoCodeFieldNameMatchExpression

        /// <summary>
        /// Returns all index fields that are culture specific (suffixed)
        /// </summary>
        /// <param name="index"></param>
        /// <param name="culture"></param>
        /// <returns></returns>
        public static IEnumerable<string> GetCultureFields(this IUmbracoIndex index, string culture)
        {
            var allFields = index.GetFields();
            // ReSharper disable once LoopCanBeConvertedToQuery
            foreach (var field in allFields)
            {
                var match = CultureIsoCodeFieldNameMatchExpression.Match(field);
                if (match.Success && match.Groups.Count == 3 && culture.InvariantEquals(match.Groups[2].Value))
                    yield return field;
            }
        }

        /// <summary>
        /// Returns all index fields that are culture specific (suffixed) or invariant
        /// </summary>
        /// <param name="index"></param>
        /// <param name="culture"></param>
        /// <returns></returns>
        public static IEnumerable<string> GetCultureAndInvariantFields(this IUmbracoIndex index, string culture)
        {
            var allFields = index.GetFields();
            // ReSharper disable once LoopCanBeConvertedToQuery
            foreach (var field in allFields)
            {
                var match = CultureIsoCodeFieldNameMatchExpression.Match(field);
                if (match.Success && match.Groups.Count == 3 && culture.InvariantEquals(match.Groups[2].Value))
                {
                    yield return field; //matches this culture field
                }
                else if (!match.Success)
                {
                    yield return field; //matches no culture field (invariant)
                }

            }
        }

        internal static bool TryParseLuceneQuery(string query)
        {
            // TODO: I'd assume there would be a more strict way to parse the query but not that i can find yet, for now we'll
            // also do this rudimentary check
            if (!query.Contains(":"))
                return false;

            try
            {
                //This will pass with a plain old string without any fields, need to figure out a way to have it properly parse
                var parsed = new QueryParser(Version.LUCENE_30, "nodeName", new KeywordAnalyzer()).Parse(query);
                return true;
            }
            catch (ParseException)
            {
                return false;
            }
            catch (Exception)
            {
                return false;
            }
        }

        /// <summary>
        /// Forcibly unlocks all lucene based indexes
        /// </summary>
        /// <remarks>
        /// This is not thread safe, use with care
        /// </remarks>
        internal static void ConfigureLuceneIndexes(this IExamineManager examineManager, ILogger logger, bool disableExamineIndexing)
        {
            foreach (var luceneIndexer in examineManager.Indexes.OfType<LuceneIndex>())
            {
                //We now need to disable waiting for indexing for Examine so that the appdomain is shutdown immediately and doesn't wait for pending
                //indexing operations. We used to wait for indexing operations to complete but this can cause more problems than that is worth because
                //that could end up halting shutdown for a very long time causing overlapping appdomains and many other problems.
                luceneIndexer.WaitForIndexQueueOnShutdown = false;

                if (disableExamineIndexing) continue; //exit if not enabled, we don't need to unlock them if we're not maindom

                //we should check if the index is locked ... it shouldn't be! We are using simple fs lock now and we are also ensuring that
                //the indexes are not operational unless MainDom is true
                var dir = luceneIndexer.GetLuceneDirectory();
                if (IndexWriter.IsLocked(dir))
                {
                    logger.Info(typeof(ExamineExtensions), "Forcing index {IndexerName} to be unlocked since it was left in a locked state", luceneIndexer.Name);
                    IndexWriter.Unlock(dir);
                }
            }
        }

        /// <summary>
        /// Checks if the index can be read/opened
        /// </summary>
        /// <param name="indexer"></param>
        /// <param name="ex">The exception returned if there was an error</param>
        /// <returns></returns>
        public static bool IsHealthy(this LuceneIndex indexer, out Exception ex)
        {
            try
            {
                using (indexer.GetIndexWriter().GetReader())
                {
                    ex = null;
                    return true;
                }
            }
            catch (Exception e)
            {
                ex = e;
                return false;
            }
        }

        /// <summary>
        /// Return the number of indexed documents in Lucene
        /// </summary>
        /// <param name="indexer"></param>
        /// <returns></returns>
        public static int GetIndexDocumentCount(this LuceneIndex indexer)
        {
            if (!((indexer.GetSearcher() as LuceneSearcher)?.GetLuceneSearcher() is IndexSearcher searcher))
                return 0;

            using (searcher)
            using (var reader = searcher.IndexReader)
            {
                return reader.NumDocs();
            }
        }

        /// <summary>
        /// Return the total number of fields in the index
        /// </summary>
        /// <param name="indexer"></param>
        /// <returns></returns>
        public static int GetIndexFieldCount(this LuceneIndex indexer)
        {
            if (!((indexer.GetSearcher() as LuceneSearcher)?.GetLuceneSearcher() is IndexSearcher searcher))
                return 0;

            using (searcher)
            using (var reader = searcher.IndexReader)
            {
                return reader.GetFieldNames(IndexReader.FieldOption.ALL).Count;
            }
        }

    }
}


text:
// file      : Test/Synch/Inline/inline.cpp
// author    : Boris Kolpackov <boris@kolpackov.net>
// copyright : Copyright (c) 2002-2003 Boris Kolpackov
// license   : http://kolpackov.net/license.html

//
// This is a link-time test to detect any problems with inline functions
// (notably missing inline specifier).
//

/* FUZZ: disable check_for_improper_main_declaration */

#include "Utility/Synch/Policy/Null.hpp"

int
main ()
{
}

//$Id: inline.cpp 80826 2008-03-04 14:51:23Z wotte $


text:
// Copyright 2020 Google LLC
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
//     https://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.
//
// ** This file is automatically generated by gapic-generator-typescript. **
// ** https://github.com/googleapis/gapic-generator-typescript **
// ** All changes to this file may be overwritten. **

/* eslint-disable node/no-missing-require, no-unused-vars */
const {DatastoreStore} = require('@google-cloud/connect-datastore');
const {Datastore} = require('@google-cloud/datastore');

function main() {
  const store = new DatastoreStore({
    dataset: new Datastore(),
  });
}

main();


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

<TITLE>
ObjectWithBoundedBox
</TITLE>

<META NAME="date" CONTENT="2008-12-19">

<LINK REL ="stylesheet" TYPE="text/css" HREF="../../stylesheet.css" TITLE="Style">

      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

gameframework.base

Interface ObjectWithBoundedBox

All Known Subinterfaces:
Movable, MoveBlocker, Overlappable

All Known Implementing Classes:
GameMovable, Ghost, Jail, Pacgum, Pacman, SuperPacgum, TeleportPairOfPoints, Wall

public interface ObjectWithBoundedBox

Method Summary

 java.awt.Rectangle
getBoundingBox()

Method Detail

getBoundingBox

java.awt.Rectangle getBoundingBox()

      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


text:
package org.thinkinghub.gateway.oauth.exception;

@SuppressWarnings("serial")
public class UserCancelOAuthException extends OAuthProcessingException{
    public UserCancelOAuthException(String errCode, String errMsg) {
        super(errCode, errMsg);
    }

    public String getGWErrorCode(){
        return "GW20004";
    }
}


text:
<md-card>
  <md-card-content>

Create power!

        <power-chooser [formGroup]="powerForm"></power-chooser>

            <button md-raised-button (click)="submit()">Create Power</button>

            <button md-raised-button (click)="back()">Back</button>

        <md-progress-spinner  class="list-progress-bar-container" color="primary" mode="indeterminate"></md-progress-spinner>

  </md-card-content>
</md-card>


text:
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
  <modelVersion>4.0.0</modelVersion>

  <artifactId>camunda-qa-wildfly-runtime</artifactId>
  <packaging>jar</packaging>

  <name>camunda BPM - QA Wildfly Test Runtime</name>

  <properties>
    <jboss.assembly.location>../../distro/wildfly/assembly/target/assembly-${project.version}/assembly-${project.version}/server</jboss.assembly.location>
  </properties>

  <parent>
    <groupId>org.camunda.bpm.qa</groupId>
    <artifactId>camunda-qa</artifactId>
    <version>7.3.0-SNAPSHOT</version>
  </parent>

  <dependencies>
    <dependency>
      <!-- make sure it comes after assembly in the build -->
      <groupId>org.camunda.bpm.wildfly</groupId>
      <artifactId>camunda-wildfly-assembly</artifactId>
      <version>${project.version}</version>
      <type>pom</type>
      <scope>test</scope>
    </dependency>

    <!--
      database drivers
      we deploy all and only activate one with a *-ds.xml database deployment
    -->
    <dependency>
      <groupId>com.h2database</groupId>
      <artifactId>h2</artifactId>
      <scope>runtime</scope>
    </dependency>
    <dependency>
      <groupId>mysql</groupId>
      <artifactId>mysql-connector-java</artifactId>
      <scope>runtime</scope>
    </dependency>
    <dependency>
      <groupId>com.ibm.db2.jcc</groupId>
      <artifactId>db2jcc4</artifactId>
      <scope>runtime</scope>
    </dependency>
    <dependency>
      <groupId>com.oracle.jdbc</groupId>
      <artifactId>ojdbc6</artifactId>
      <scope>runtime</scope>
    </dependency>
    <dependency>
      <groupId>com.microsoft.sqlserver</groupId>
      <artifactId>sqljdbc4</artifactId>
      <scope>runtime</scope>
    </dependency>
    <dependency>
      <groupId>org.postgresql</groupId>
      <artifactId>postgresql</artifactId>
      <scope>runtime</scope>
    </dependency>

    <dependency>
      <groupId>org.python</groupId>
      <artifactId>jython</artifactId>
      <scope>runtime</scope>
    </dependency>
    <dependency>
      <groupId>org.jruby</groupId>
      <artifactId>jruby-complete</artifactId>
      <scope>runtime</scope>
    </dependency>
  </dependencies>

  <build>
    <resources>
      <resource>
        <directory>src/main/standalone</directory>
        <filtering>true</filtering>
        <includes>
          <include>configuration/standalone.xml</include>
          <include>deployments/${jboss.datasource.filename}</include>
        </includes>
      </resource>
      <resource>
        <directory>src/main/modules</directory>
        <filtering>true</filtering>
      </resource>
      <resource>
        <directory>src/main/domain</directory>
        <filtering>true</filtering>
        <includes>
          <include>configuration/domain.xml</include>
          <include>configuration/host.xml</include>
        </includes>
      </resource>
    </resources>
    <plugins>
      <!-- create sources to be used by camunda-bpm-platform-ee -->
      <plugin>
        <groupId>org.codehaus.mojo</groupId>
        <artifactId>build-helper-maven-plugin</artifactId>
        <executions>
          <execution>
            <id>add-resources</id>
            <phase>verify</phase>
            <goals>
              <goal>add-resource</goal>
            </goals>
            <configuration>
              <resources>
                <resource>
                  <directory>src/main</directory>
                  <includes>
                    <include>**/*.xml</include>
                  </includes>
                </resource>
              </resources>
            </configuration>
          </execution>
        </executions>
      </plugin>
      <plugin>
        <groupId>org.apache.maven.plugins</groupId>
        <artifactId>maven-source-plugin</artifactId>
        <executions>
          <execution>
            <id>attach-sources</id>
            <phase>verify</phase>
            <goals>
              <goal>jar-no-fork</goal>
            </goals>
            <configuration>
              <forceCreation>true</forceCreation>
              <!-- exclude otherwise there would be duplicates in -sources.jar -->
              <excludes>
                <exclude>deployments/**/*</exclude>
                <exclude>configuration/**/*</exclude>
                <exclude>**/configuration/**/*</exclude>
              </excludes>
            </configuration>
          </execution>
        </executions>
      </plugin>
    </plugins>
  </build>

  <profiles>
    <profile>
      <id>wildfly</id>
      <build>
        <plugins>
          <plugin>
            <groupId>org.apache.maven.plugins</groupId>
            <artifactId>maven-dependency-plugin</artifactId>
            <executions>
              <execution>
                <id>unpack-server</id>
                <phase>generate-resources</phase>
                <goals>
                  <goal>unpack</goal>
                </goals>
                <inherited>false</inherited>
                <configuration>
                  <artifactItems>
                    <artifactItem>
                      <groupId>org.camunda.bpm.wildfly</groupId>
                      <artifactId>camunda-wildfly-assembly</artifactId>
                      <version>${project.version}</version>
                      <type>tar.gz</type>
                      <overWrite>true</overWrite>
                      <outputDirectory>target/</outputDirectory>
                    </artifactItem>
                  </artifactItems>
                </configuration>
              </execution>
            </executions>
          </plugin>
          <plugin>
            <groupId>org.apache.maven.plugins</groupId>
            <artifactId>maven-antrun-plugin</artifactId>
            <executions>
              <execution>
                <id>copy-distro</id>
                <phase>package</phase>
                <goals>
                  <goal>run</goal>
                </goals>
                <configuration>
                  <target unless="maven.test.skip">
                    <copy todir="${wildfly.runtime.location}/modules" overwrite="true">
                      <fileset dir="src/main/modules" />
                    </copy>

                  </target>
                </configuration>
              </execution>
              <execution>
                <id>copy-test-dependencies</id>
                <phase>package</phase>
                <goals>
                  <goal>run</goal>
                </goals>
                <configuration>
                  <target unless="maven.test.skip">
                    <dependencyfilesets scopes="runtime" />

                    <copy todir="${wildfly.runtime.location}/modules" flatten="false" overwrite="true">
                      <fileset refid="maven.project.dependencies" />
                      <regexpmapper from="^(.*)/([^/]+)/([^/]*)$$" to="\1/main/\3" handledirsep="yes" />
                    </copy>

                    <replace dir="${wildfly.runtime.location}/modules">
                      <include name="**/module.xml" />
                      <replacefilter token="@project.version@" value="${project.version}" />
                      <replacefilter token="@version.db2@" value="${version.db2}" />
                      <replacefilter token="@version.h2@" value="${version.h2}" />
                      <replacefilter token="@version.mysql@" value="${version.mysql}" />
                      <replacefilter token="@version.oracle@" value="${version.oracle}" />
                      <replacefilter token="@version.postgresql@" value="${version.postgresql}" />
                      <replacefilter token="@version.sqlserver@" value="${version.sqlserver}" />
                    </replace>

                  </target>
                </configuration>
              </execution>
            </executions>
          </plugin>
          <!-- copy filtered configuration resources -->
          <plugin>
            <groupId>org.apache.maven.plugins</groupId>
            <artifactId>maven-resources-plugin</artifactId>
            <configuration>
              <delimiters>
                <delimiter>${*}</delimiter>
              </delimiters>
              <useDefaultDelimiters>false</useDefaultDelimiters>
            </configuration>
            <executions>
              <execution>
                <id>copy-resources</id>
                <phase>package</phase>
                <goals>
                  <goal>resources</goal>
                </goals>
                <configuration>
                  <overwrite>true</overwrite>
                  <outputDirectory>${wildfly.runtime.location}/standalone</outputDirectory>
                </configuration>
              </execution>
            </executions>
          </plugin>
        </plugins>
      </build>
    </profile>

    <profile>
      <id>wildfly-domain</id>
      <build>
        <plugins>
          <plugin>
            <groupId>org.apache.maven.plugins</groupId>
            <artifactId>maven-dependency-plugin</artifactId>
            <executions>
              <execution>
                <id>unpack-server</id>
                <phase>generate-resources</phase>
                <goals>
                  <goal>unpack</goal>
                </goals>
                <inherited>false</inherited>
                <configuration>
                  <artifactItems>
                    <artifactItem>
                      <groupId>org.camunda.bpm.wildfly</groupId>
                      <artifactId>camunda-wildfly-assembly</artifactId>
                      <version>${project.version}</version>
                      <type>tar.gz</type>
                      <overWrite>true</overWrite>
                      <outputDirectory>target/</outputDirectory>
                    </artifactItem>
                  </artifactItems>
                </configuration>
              </execution>
            </executions>
          </plugin>
          <plugin>
            <groupId>org.apache.maven.plugins</groupId>
            <artifactId>maven-antrun-plugin</artifactId>
            <executions>
              <execution>
                <id>copy-distro</id>
                <phase>package</phase>
                <goals>
                  <goal>run</goal>
                </goals>
                <configuration>
                  <target unless="maven.test.skip">
                    <copy todir="${wildfly.runtime.location}/modules" overwrite="true">
                      <fileset dir="src/main/modules" />
                    </copy>

                  </target>
                </configuration>
              </execution>
              <execution>
                <id>copy-test-dependencies</id>
                <phase>package</phase>
                <goals>
                  <goal>run</goal>
                </goals>
                <configuration>
                  <target unless="maven.test.skip">
                    <dependencyfilesets scopes="runtime" />

                    <copy todir="${wildfly.runtime.location}/modules" flatten="false">
                      <fileset refid="maven.project.dependencies" />
                      <regexpmapper from="^(.*)/([^/]+)/([^/]*)$$" to="\1/main/\3" handledirsep="yes" />
                    </copy>

                    <replace dir="${wildfly.runtime.location}/modules">
                      <include name="**/module.xml" />
                      <replacefilter token="@project.version@" value="${project.version}" />
                      <replacefilter token="@version.db2@" value="${version.db2}" />
                      <replacefilter token="@version.h2@" value="${version.h2}" />
                      <replacefilter token="@version.mysql@" value="${version.mysql}" />
                      <replacefilter token="@version.oracle@" value="${version.oracle}" />
                      <replacefilter token="@version.postgresql@" value="${version.postgresql}" />
                      <replacefilter token="@version.sqlserver@" value="${version.sqlserver}" />
                    </replace>

                    <!-- delete h2 shipped with wildfly because it causes deadlocks -->
                    <delete dir="${wildfly.runtime.location}/modules/system/layers/base/com/h2database/" />

                  </target>
                </configuration>
              </execution>
            </executions>
          </plugin>
          <!-- copy filtered configuration resources -->
          <plugin>
            <groupId>org.apache.maven.plugins</groupId>
            <artifactId>maven-resources-plugin</artifactId>
            <configuration>
              <delimiters>
                <delimiter>${*}</delimiter>
              </delimiters>
              <useDefaultDelimiters>false</useDefaultDelimiters>
            </configuration>
            <executions>
              <execution>
                <id>copy-resources</id>
                <phase>package</phase>
                <goals>
                  <goal>resources</goal>
                </goals>
                <configuration>
                  <overwrite>true</overwrite>
                  <outputDirectory>${wildfly.runtime.location}/domain</outputDirectory>
                </configuration>
              </execution>
            </executions>
          </plugin>
        </plugins>
      </build>
    </profile>

    <profile>
      <id>install-test-runtime</id>
      <build>
        <plugins>
          <plugin>
            <groupId>org.apache.maven.plugins</groupId>
            <artifactId>maven-assembly-plugin</artifactId>
            <executions>
              <execution>
                <id>assemble</id>
                <phase>package</phase>
                <goals>
                  <goal>single</goal>
                </goals>
                <configuration>
                  <descriptors>
                    <descriptor>assembly.xml</descriptor>
                  </descriptors>
                  <finalName>camunda-qa-wildfly-runtime-${project.version}</finalName>
                  <appendAssemblyId>false</appendAssemblyId>
                  <outputDirectory>target/</outputDirectory>
                  <workDirectory>target/assembly/work</workDirectory>
                  <tarLongFileMode>gnu</tarLongFileMode>
                </configuration>
              </execution>
            </executions>
          </plugin>
        </plugins>
      </build>
    </profile>
  </profiles>
</project>


text:
using System.IO;
using Microsoft.VisualStudio.TestTools.UnitTesting;
using Revenj.DomainPatterns;
using System;
using Revenj;

namespace ClientTest
{
	[TestClass]
	public class ReportingTests
	{
		private IServiceProvider locator;
		private ITemplaterService tService;
		private IReportingProxy rProxy;

		public ReportingTests()
		{
			locator = Common.StartClient();
			tService = locator.Resolve<ITemplaterService>();
			rProxy = locator.Resolve<IReportingProxy>();
		}

		[TestMethod]
		public void Populate()
		{
			var repo = locator.Resolve<ISearchableRepository<Test.Foo>>();
			var result = tService.Populate("test.docx", repo.FindAll().Result[0]);
			using (var fs = new FileStream("test.docx", FileMode.Create, FileAccess.Write))
			{
				result.Result.CopyTo(fs);
			}
		}

		[TestMethod]
		public void CreateReport()
		{
			var spec = new Test.Foo.searchByBar { name = "fail123" };
			var result = tService.Populate<Test.Foo>("test.docx", spec);
			using (var fs = new FileStream("test.docx", FileMode.Create, FileAccess.Write))
			{
				result.Result.CopyTo(fs);
			}
		}

		[TestMethod]
		public void CreateReportWithoutSpecification()
		{
			var result = tService.Populate<Test.Foo>("test.docx", (ISpecification<Test.Foo>)null);
			using (var fs = new FileStream("test.docx", FileMode.Create, FileAccess.Write))
			{
				result.Result.CopyTo(fs);
			}
		}

		[TestMethod]
		public void CreateReportWithExpressionSpecification()
		{
			var repo = locator.Resolve<ISearchableRepository<Test.Foo>>();
			var spec = ExpressionSpecificationHelper.Builder<Test.Foo>(repo, it => it.bar.Contains("123")).Specification;

			var result = tService.Populate<Test.Foo>("test.docx", spec);
			using (var fs = new FileStream("test.docx", FileMode.Create, FileAccess.Write))
			{
				result.Result.CopyTo(fs);
			}
		}

		// TODO
		[TestMethod]
		public void PopulateReport()
		{
			var result = rProxy.Populate(new Test.FooReport { uri = "fail123" }).Result;
			Assert.AreEqual("fail123", result.foo.URI);
		}

		[TestMethod]
		public void CreateOlapWithSpecification()
		{
			/*
			var order = new Dictionary<string, bool>();
			order.Add("bar", true);
			var OC = rProxy.OlapCube<Test.FooCube, Test.FooCube.findByBar>(new Test.FooCube.findByBar { query = "fail123" }, "test.docx", new[] { "bar", "num" }, null, order);
			var res = OC.Result;
			Assert.IsTrue(res != null);
			*/
			var cube = new Test.FooCube();
			var pdf = cube.CreatePdf(new[] { "bar" }, new[] { "count", "total", "average" });
			var fs = new FileStream("imba.docx", FileMode.Create);
			pdf.CopyTo(fs);
			fs.Close();
			var fi = new FileInfo("imba.docx");
			Assert.IsTrue(fi.Length > 0);
		}
	}
}


text:
(function(){

module.exports = function(modulus) {
  var help = new modulus.help('Environment Variables', modulus);

  // list command
  help.add('list', function() {
    this.line('env list'.verbose);
    this.line('Lists all environment variables for a project.'.input);
    this.line('    -p, --project-name    Name of the project to list environment variables for.'.input);
  });

  modulus.program
    .command('env list')
    .description('Lists all environment variables for a project.')
    .on('--help', help.commands.list)
    .action(function () {
      modulus.runCommand(modulus.commands.env.list, [modulus.program.projectName], true);
    });

  // set command
  help.add('set', function() {
    this.line('env set <name> <value>'.verbose);
    this.line('Sets a environment variable for a project.'.input);
    this.line('  options:'.input);
    this.line('    -p, --project-name    Name of the project to set an environment variable for.'.input);
  });

  modulus.program
    .command('env set','<name> <value>')
    .description('Sets an environment variable for a project.')
    .on('--help', help.commands.set)
    .action(function(name, value){
      modulus.runCommand(modulus.commands.env.set, [modulus.program.projectName, name, value], true);
    });

  // export command
  help.add('export', function() {
    this.line('env export <file>'.verbose);
    this.line('Export environment variables for a project into a JSON file.'.input);
    this.line('  options:'.input);
    this.line('    -p, --project-name    Name of the project to export environment variables for.'.input);
  });

  modulus.program
    .command('env export','<file>')
    .description('Export environment variables for a project into a JSON file.')
    .on('--help', help.commands.export)
    .action(function(file){
      modulus.runCommand(modulus.commands.env.export, [modulus.program.projectName, file], true);
    });

  // load command
  help.add('load', function() {
    this.line('env load <file>'.verbose);
    this.line('Set environment variables for a project using data loaded from a JSON file.'.input);
    this.line('  options:'.input);
    this.line('    -p, --project-name    Name of the project to load environment variables for.'.input);
  });

  modulus.program
    .command('env load','<file>')
    .description('Set environment variables for a project using data loaded from a JSON file.')
    .on('--help', help.commands.set)
    .action(function(file){
      modulus.runCommand(modulus.commands.env.load, [modulus.program.projectName, file], true);
    });

  // get command
  help.add('get', function() {
    this.line('env get <name>'.verbose);
    this.line('Gets an environment variable for a project.'.input);
    this.line('  options:'.input);
    this.line('    -p, --project-name    Name of the project to get an environment variable for.'.input);
  });

  modulus.program
    .command('env get','<name>')
    .description('Gets an environment variable for a project.')
    .on('--help', help.commands.get)
    .action(function(name){
      modulus.runCommand(modulus.commands.env.get, [modulus.program.projectName, name], true);
    });

  // delete command
  help.add('delete', function() {
    this.line('env delete <name>'.verbose);
    this.line('Removes an environment variable for a project.'.input);
    this.line('  options:'.input);
    this.line('    -p, --project-name    Name of the project to delete an environment variable from.'.input);
  });

  modulus.program
    .command('env delete','<name>')
    .description('Removes an environment variable for a project.')
    .on('--help', help.commands.delete)
    .action(function(name){
      modulus.runCommand(modulus.commands.env.delete, [modulus.program.projectName, name], true);
    });

  // Generic help for env commands
  modulus.program
    .command('env')
    .description('Lists available env commands.')
    .on('--help', help.getPrinter())
    .action(help.getPrinter());

  return {
    base : 'env',
    help : help
  };
};

})();


text:
'use strict';

angular.module('angularApp', [ 'ui.bootstrap'])
  .config(['$routeProvider', function ($routeProvider) {
    $routeProvider
      .when('/home', {
        templateUrl: 'views/home.html',
        controller: 'HomeCtrl'
      })
      .when('/play', {
        templateUrl: 'views/play.html',
        controller: 'PlayCtrl'
      })
      .when('/play/{key}', {
        templateUrl: 'views/play.html',
        controller: 'PlayCtrl'
      })
      .when('/list', {
        templateUrl: 'views/list.html',
        controller: 'ListCtrl'
      })
      .otherwise({
        redirectTo: '/home'
      });
  }])
  .config(['$compileProvider', function ($compileProvider) {
    $compileProvider.urlSanitizationWhitelist(/^\s*(https?|ftp|mailto|file|tel):/);
  }]);


text:
package gov.niarl.his.privacyca;

import javax.crypto.spec.*;
import java.io.*;

/**
 *
This class is for the TCG's TPM_SYMMETRIC_KEY structure.

 * @author schawki
 *
 */
public class TpmSymmetricKey {
	private byte[] keyBlob;
	private int algorithmId;
	private short encScheme;

	public TpmSymmetricKey() {
		keyBlob = TpmUtils.hexStringToByteArray("");
	}
	/**
	 * Instantiate a new TpmSymmetricKey from a byte array.
	 *
	 * @param blob The key bytes to use.
	 * @throws TpmUtils.TpmUnsignedConversionException
	 * @throws TpmUtils.TpmBytestreamResouceException
	 */
	public TpmSymmetricKey(byte [] blob)
			throws TpmUtils.TpmUnsignedConversionException,
			TpmUtils.TpmBytestreamResouceException {
		ByteArrayInputStream bs = new ByteArrayInputStream(blob);
		algorithmId = TpmUtils.getUINT32(bs);
		encScheme = TpmUtils.getUINT16(bs);
		short temp = TpmUtils.getUINT16(bs);
		keyBlob = TpmUtils.getBytes(bs, (int)temp);
	}
	/**
	 *
	 * @return The secret key in the form of a SecretKeySpec.
	 */
	public SecretKeySpec getSecretKey() {
		String algorithm = this.getAlgorithmStr();
		SecretKeySpec symKey = new SecretKeySpec(keyBlob, algorithm);
		return symKey;
	}
	/**
	 * Set the secret key with a SecretKeySpec.
	 *
	 * @param newKeySpec New secret key.
	 */
	public void setSecretKey(SecretKeySpec newKeySpec) {
		keyBlob = newKeySpec.getEncoded();
	}
	/**
	 *
	 * @return The algorithm ID defined for this symmetric key.
	 */
	public int getAlgorithmId() {
		return algorithmId;
	}
	/**
	 * Set the algorithm ID for this symmetric key.
	 *
	 * @param newAlgId New algorithm ID.
	 */
	public void setAlgorithmId(int newAlgId) {
		algorithmId = newAlgId;
	}
	/**
	 *
	 * @return Human-readable report of the TpmSymmetricKey.
	 */
	public String getAlgorithmStr(){
		String returnVal = "";
		switch (algorithmId){
		case TpmKeyParams.TPM_ALG_DES:
			returnVal = "DES";
			break;
		case TpmKeyParams.TPM_ALG_3DES:
			returnVal = "DESede";
			break;
		case TpmKeyParams.TPM_ALG_AES:
		case TpmKeyParams.TPM_ALG_AES192:
		case TpmKeyParams.TPM_ALG_AES256:
			returnVal = "AES";
			break;
		default:
			returnVal = "Error";
			break;
		}
		return returnVal;
	}
	/**
	 *
	 * @return The set encryption scheme.
	 */
	public short getEncScheme() {
		return encScheme;
	}
	/**
	 * Set the encryption scheme.
	 *
	 * @param newEncScheme New encryption scheme.
	 */
	public void setEncScheme(short newEncScheme) {
		encScheme = newEncScheme;
	}
	/**
	 *
	 * @return The encryption scheme as a string.
	 */
	public String getEncSchemeStr(){
		String returnVal = "";
		switch (encScheme){
		case TpmKeyParams.TPM_ES_NONE:
			returnVal = "NONE/NoPadding";
			break;
		case TpmKeyParams.TPM_ES_SYM_CBC_PKCS5PAD:
			returnVal = "CBC/PKCS5Padding";
			break;
		default:
			returnVal = "Error";
			break;
		}
		return returnVal;
	}
	/**
	 *
	 * @return Symmetric key blob, as a byte array.
	 */
	public byte [] getKeyBlob() {
		return keyBlob;
	}
	/**
	 * Set a new key symmetric key by byte blob.
	 *
	 * @param newKeyBlob New key.
	 */
	public void setKeyBlob(byte [] newKeyBlob) {
		keyBlob = newKeyBlob;
	}
	/**
	 * Serialize the TpmSymmetricKey structure.
	 *
	 * @return Byte array form of TpmSymmetricKey.
	 * @throws TpmUtils.TpmUnsignedConversionException
	 */
	public byte [] toByteArray() throws TpmUtils.TpmUnsignedConversionException {
		byte[] algoId = TpmUtils.intToByteArray(algorithmId);
		byte[] encSchm = TpmUtils.shortToByteArray(encScheme);
		byte[] size = TpmUtils.shortToByteArray((short)keyBlob.length);
		int x = algoId.length + encSchm.length + size.length + keyBlob.length; //calculate # of bytes in structure
		byte [] returnArray = new byte[x];
		System.arraycopy(algoId, 0, returnArray, 0, algoId.length);
		System.arraycopy(encSchm, 0, returnArray, algoId.length, encSchm.length);
		System.arraycopy(size, 0, returnArray, algoId.length + encSchm.length, size.length);
		System.arraycopy(keyBlob, 0, returnArray, algoId.length + encSchm.length + size.length, keyBlob.length);
		return returnArray;
	}
}


text:
using System;
using System.Collections.Generic;
using System.Linq;
using System.Security.Cryptography;
using System.Text;
using System.Threading.Tasks;

namespace FreeBird.Infrastructure.Utilities.Encryption
{
    public static class EncryptionUtility
    {
        public static string GenerateSalt()
        {
            byte[] data = new byte[0x10];
            new RNGCryptoServiceProvider().GetBytes(data);
            return Convert.ToBase64String(data);
        }

        public static string EncryptSHA1(string input, string salt)
        {
            // 将密码和salt值转换成字节形式并连接起来
            byte[] bytes = Encoding.Unicode.GetBytes(input);
            byte[] src = Convert.FromBase64String(salt);
            byte[] dst = new byte[src.Length + bytes.Length];
            Buffer.BlockCopy(src, 0, dst, 0, src.Length);
            Buffer.BlockCopy(bytes, 0, dst, src.Length, bytes.Length);

            // 选择算法,对连接后的值进行散列
            HashAlgorithm algorithm = HashAlgorithm.Create("SHA1");
            byte[] inArray = algorithm.ComputeHash(dst);

            // 以字符串形式返回散列值
            return Convert.ToBase64String(inArray);
        }

    }
}


text:
package com.twelvemonkeys.servlet.jsp.droplet.taglib;

import javax.servlet.jsp.tagext.TagData;
import javax.servlet.jsp.tagext.TagExtraInfo;

/**
 * TagExtraInfo for ValueOf.
 * @todo More meaningful response to the user.
 *
 * @author Harald Kuhr
 * @author last modified by $Author: haku $
 *
 * @version $Revision: #1 $, ($Date: 2008/05/05 $)
 *
 */

public class ValueOfTEI extends TagExtraInfo {

    public boolean isValid(TagData pTagData) {
        Object nameAttr = pTagData.getAttribute("name");
        Object paramAttr = pTagData.getAttribute("param");

        if ((nameAttr != null && paramAttr == null) || (nameAttr == null && paramAttr != null)) {
            return true; // Exactly one of name or param set
        }

        // Either both or none,
        return false;
    }
}


text:
/* $Id: UIWizardNewVDPageExpert.h $ */
/** @file
 * VBox Qt GUI - UIWizardNewVDPageExpert class declaration.
 */

/*
 * Copyright (C) 2006-2012 Oracle Corporation
 *
 * This file is part of VirtualBox Open Source Edition (OSE), as
 * available from http://www.virtualbox.org. This file is free software;
 * you can redistribute it and/or modify it under the terms of the GNU
 * General Public License (GPL) as published by the Free Software
 * Foundation, in version 2 as it comes in the "COPYING" file of the
 * VirtualBox OSE distribution. VirtualBox OSE is distributed in the
 * hope that it will be useful, but WITHOUT ANY WARRANTY of any kind.
 */

#ifndef __UIWizardNewVDPageExpert_h__
#define __UIWizardNewVDPageExpert_h__

/* Local includes: */
#include "UIWizardNewVDPageBasic1.h"
#include "UIWizardNewVDPageBasic2.h"
#include "UIWizardNewVDPageBasic3.h"

/* Forward declarations: */
class QGroupBox;

/* Expert page of the New Virtual Hard Drive wizard: */
class UIWizardNewVDPageExpert : public UIWizardPage,
                                public UIWizardNewVDPage1,
                                public UIWizardNewVDPage2,
                                public UIWizardNewVDPage3
{
    Q_OBJECT;
    Q_PROPERTY(CMediumFormat mediumFormat READ mediumFormat WRITE setMediumFormat);
    Q_PROPERTY(qulonglong mediumVariant READ mediumVariant WRITE setMediumVariant);
    Q_PROPERTY(QString mediumPath READ mediumPath);
    Q_PROPERTY(qulonglong mediumSize READ mediumSize WRITE setMediumSize);

public:

    /* Constructor: */
    UIWizardNewVDPageExpert(const QString &strDefaultName, const QString &strDefaultPath, qulonglong uDefaultSize);

protected:

    /* Wrapper to access 'this' from base part: */
    UIWizardPage* thisImp() { return this; }
    /* Wrapper to access 'wizard-field' from base part: */
    QVariant fieldImp(const QString &strFieldName) const { return UIWizardPage::field(strFieldName); }

private slots:

    /* Medium format stuff: */
    void sltMediumFormatChanged();

    /* Location editors stuff: */
    void sltSelectLocationButtonClicked();
    /* Size editors stuff: */
    void sltSizeSliderValueChanged(int iValue);
    void sltSizeEditorTextChanged(const QString &strValue);

private:

    /* Translation stuff: */
    void retranslateUi();

    /* Prepare stuff: */
    void initializePage();

    /* Validation stuff: */
    bool isComplete() const;
    bool validatePage();

    /* Widgets: */
    QGroupBox *m_pFormatCnt;
    QGroupBox *m_pVariantCnt;
    QGroupBox *m_pLocationCnt;
    QGroupBox *m_pSizeCnt;
};

#endif // __UIWizardNewVDPageExpert_h__


text:
@interface ABI42_0_0EXHapticsModule : ABI42_0_0UMExportedModule
@end


text:
/*! \file DeltaDistributionFunction.cpp
 *  \author Jared Hoberock
 *  \brief Implementation of DeltaDistributionFunction class.
 */

#include "DeltaDistributionFunction.h"

float DeltaDistributionFunction
  ::evaluatePdf(const Vector &wo,
                const DifferentialGeometry &dg,
                const Vector &wi) const
{
  return 0;
} // end DeltaDistributionFunction::evaluatePdf()

float DeltaDistributionFunction
  ::evaluatePdf(const Vector &wo,
                const DifferentialGeometry &dg,
                const Vector &wi,
                const bool delta,
                const ComponentIndex component) const
{
  return delta ? 1.0f : 0.0f;
} // end DeltaDistributionFunction::evaluatePdf()

bool DeltaDistributionFunction
  ::isSpecular(void) const
{
  return true;
} // end DeltaDistributionFunction::isSpecular()


text:
package org.testng.test.osgi;

import static org.assertj.core.api.Assertions.assertThat;
import static org.ops4j.pax.exam.CoreOptions.options;
import static org.testng.test.osgi.DefaultTestngOsgiOptions.defaultTestngOsgiOptions;

import java.lang.reflect.Method;
import org.ops4j.pax.exam.Configuration;
import org.ops4j.pax.exam.Option;
import org.ops4j.pax.exam.spi.reactors.ExamReactorStrategy;
import org.ops4j.pax.exam.spi.reactors.PerMethod;
import org.ops4j.pax.exam.testng.listener.PaxExam;
import org.testng.annotations.Listeners;
import org.testng.annotations.Test;

/**
 * The purpose of the class is to ensure {@code postgresql} bundle activation does not fail in case
 * {@code org.osgi.service.jdbc} is not available.
 */
@Listeners(PaxExam.class)
@ExamReactorStrategy(PerMethod.class)
public class PlainOsgiTest {
  @Configuration
  public Option[] config() {
    return options(defaultTestngOsgiOptions());
  }

  @Test
  public void versionShouldStartWithDigit() throws Exception {
    Class<?> versionClass = Class.forName("org.testng.internal.Version");
    Method getVersionStringMethod = versionClass.getMethod("getVersionString");
    Object version = getVersionStringMethod.invoke(null);

    assertThat(version)
        .matches(
            (v) -> String.valueOf(v).length() > 0 && Character.isDigit(String.valueOf(v).charAt(0)),
            "Version.getVersionString() should start with a digit");
  }
}


text:
using UnityEngine;
using MidiJack;

public class KnobIndicator : MonoBehaviour
{
    public int knobNumber;

    void Awake()
    {
        transform.localScale = Vector3.zero;
    }

    void Update()
    {
        var s = MidiMaster.GetKnob(knobNumber);
        transform.localScale = new Vector3(1, s, 1);
    }
}


text:
module DropboxApi
  class ResultBuilder
    def initialize(response_data)
      @response_data = response_data
    end

    def error_summary
      @response_data["error_summary"]
    end

    def error
      @response_data["error"]
    end

    def has_error?
      !error_summary.nil?
    end

    def success?
      !has_error?
    end

    def build(result_class)
      result_class.new(@response_data)
    end

    def build_error(error_type)
      error_type.build(error_summary, error)
    end
  end
end


text:
import pscheduler
import uuid

from flask import request

def arg_boolean(name):
    """Determine if a boolean argument is part of a request.  The
    argument is considered true if it is 'true', 'yes' or '1' or if it
    is present but has no value.  Otherwise it is considered False."""
    argval = request.args.get(name)
    if argval is None:
        return False;
    argval = argval.lower()
    if argval in [ '', 'true', 'yes', '1' ]:
        return True
    return False

def arg_datetime(name):
    """Fetch and validate an argument as an ISO8601 date and time,
    returning a datetime if specificed, None if not and throwing a
    ValueError if invalid."""
    argval = request.args.get(name)
    if argval is None:
        return None
    timestamp = pscheduler.iso8601_as_datetime(argval)
    if timestamp is None:
        raise ValueError("Invalid timestamp; expecting ISO8601.")
    return timestamp

def arg_cardinal(name):
    """Fetch and validate an argument as a cardinal number."""
    argval = request.args.get(name)
    if argval is None:
        return None
    try:
        cardinal = int(argval)
        if cardinal < 1:
            raise ValueError
    except ValueError:
        raise ValueError("Invalid cardinal; expecting integer > 0")
    return cardinal

def arg_integer(name):
    """Fetch and validate an argument as an integer."""
    argval = request.args.get(name)
    if argval is None:
        return None
    try:
        integer = int(argval)
    except ValueError:
        raise ValueError("Invalid integer.")
    return integer

def arg_json(name, max_schema=None):
    """Fetch and validate an argument as JSON"""
    argval = request.args.get(name)
    if argval is None:
        return None
    # These will throw a ValueError if something's wrong.
    json = pscheduler.json_load(argval)
    if max_schema is not None:
        pscheduler.json_check_schema(json, max_schema)
    return json

def arg_string(name):
    """Fetch an argument as a string"""
    return request.args.get(name)

def arg_uuid(name):
    """Fetch and validate an argument as a UUID"""
    argval = request.args.get(name)
    if argval is None:
        return None
    # This will throw a ValueError if something's wrong.
    return str(uuid.UUID(argval))

def is_expanded():
    return arg_boolean('expanded')

def arg_api():
    """
    Determine the API level in the request.
    """
    return arg_integer('api')


text:
var onReady = require('kwf/on-ready');

onReady.onRender('.customClass', function(el) {
    Kwf.EyeCandy.Switch.Display(el, {container: '.customContent', link: '.customLink'});
} , {defer: true});

QUnit.asyncTest("Switch Display - Click Open (Async Container Show)", function( assert ) {
    expect( 2 );
    var switchLink = $('.first .customLink');
    $(switchLink).trigger('click');

    setTimeout(function() {
        var container = $('.first .customContent');
        assert.ok( $(container).is(':visible') ? true : false, 'Container visible' );
    }, 500);

    setTimeout(function() {
        $(switchLink).trigger('click');
    }, 1500);

    setTimeout(function() {
        var container = $('.first .customContent');
        assert.ok( $(container).is(':hidden') ? true : false, 'Container hidden' );
        QUnit.start();
    }, 3000);
});


text:
ButterflyCoin development tree
=====================================

ButterflyCoin is a PoS-based cryptocurrency.

http://www.butterflycoin.info

About Butterflypay
------------------
Why a (FLY) free currency (butterflycoin) this expression?

Yes, please check the following documents Anyone know, BTC transaction
information, this is the most important block composed of technical components,
A> B> C ......> more.A OR B and MORE This will be the query fails,
anonymous pubkey bitpat technology, you can send message to any people .

good luck A (SPEED) Fast Money (butterflycoin), our team focused on understanding
the transaction information - until Learn BTC block composition, repeatedly
confirmed the composition of the transactions and understand very comprehensive,
butterflycoin will be in when you send <= You can freely use your BFC A (safe) safe currency (51%? Oh no it will not be possible POSV2 rejected 51% distributed DDOS 51%, more and more server)

License
-------

Butterflycoin Core is released under the terms of the MIT license. See [COPYING](COPYING) for more
information or see http://opensource.org/licenses/MIT.

Development process
-------------------

Developers work in their own trees, then submit pull requests when
they think their feature or bug fix is ready.

The patch will be accepted if there is broad consensus that it is a
good thing.  Developers should expect to rework and resubmit patches
if they don't match the project's coding conventions (see coding.txt)
or are controversial.

The master branch is regularly built and tested, but is not guaranteed
to be completely stable. Tags are regularly created to indicate new
stable release versions of ButterflyCoin.

Feature branches are created when there are major new features being
worked on by several people.

From time to time a pull request will become outdated. If this occurs, and
the pull is no longer automatically mergeable; a comment on the pull will
be used to issue a warning of closure. The pull will be closed 15 days
after the warning if action is not taken by the author. Pull requests closed
in this manner will have their corresponding issue labeled 'stagnant'.

Issues with no commits will be given a similar warning, and closed after
15 days from their last activity. Issues closed in this manner will be
labeled 'stale'.

Testing
-------

Testing and code review is the bottleneck for development; we get more pull
requests than we can review and test on short notice. Please be patient and help out by testing
other people's pull requests, and remember this is a security-critical project where any mistake might cost people
lots of money.