text:
CREATE PROCEDURE [dbo].[uspGetBillOfMaterials]
    @StartProductID [int],
    @CheckDate [datetime]
AS
BEGIN
    SET NOCOUNT ON;

    -- Use recursive query to generate a multi-level Bill of Material (i.e. all level 1
    -- components of a level 0 assembly, all level 2 components of a level 1 assembly)
    -- The CheckDate eliminates any components that are no longer used in the product on this date.
    WITH [BOM_cte]([ProductAssemblyID], [ComponentID], [ComponentDesc], [PerAssemblyQty], [StandardCost], [ListPrice], [BOMLevel], [RecursionLevel]) -- CTE name and columns
    AS (
        SELECT b.[ProductAssemblyID], b.[ComponentID], p.[Name], b.[PerAssemblyQty], p.[StandardCost], p.[ListPrice], b.[BOMLevel], 0 -- Get the initial list of components for the bike assembly
        FROM [Production].[BillOfMaterials] b
            INNER JOIN [Production].[Product] p
            ON b.[ComponentID] = p.[ProductID]
        WHERE b.[ProductAssemblyID] = @StartProductID
            AND @CheckDate >= b.[StartDate]
            AND @CheckDate <= ISNULL(b.[EndDate], @CheckDate)
        UNION ALL
        SELECT b.[ProductAssemblyID], b.[ComponentID], p.[Name], b.[PerAssemblyQty], p.[StandardCost], p.[ListPrice], b.[BOMLevel], [RecursionLevel] + 1 -- Join recursive member to anchor
        FROM [BOM_cte] cte
            INNER JOIN [Production].[BillOfMaterials] b
            ON b.[ProductAssemblyID] = cte.[ComponentID]
            INNER JOIN [Production].[Product] p
            ON b.[ComponentID] = p.[ProductID]
        WHERE @CheckDate >= b.[StartDate]
            AND @CheckDate <= ISNULL(b.[EndDate], @CheckDate)
        )
    -- Outer select from the CTE
    SELECT b.[ProductAssemblyID], b.[ComponentID], b.[ComponentDesc], SUM(b.[PerAssemblyQty]) AS [TotalQuantity] , b.[StandardCost], b.[ListPrice], b.[BOMLevel], b.[RecursionLevel]
    FROM [BOM_cte] b
    GROUP BY b.[ComponentID], b.[ComponentDesc], b.[ProductAssemblyID], b.[BOMLevel], b.[RecursionLevel], b.[StandardCost], b.[ListPrice]
    ORDER BY b.[BOMLevel], b.[ProductAssemblyID], b.[ComponentID]
    OPTION (MAXRECURSION 25)
END;
GO
EXECUTE sp_addextendedproperty @name = N'MS_Description', @value = N'Stored procedure using a recursive query to return a multi-level bill of material for the specified ProductID.', @level0type = N'SCHEMA', @level0name = N'dbo', @level1type = N'PROCEDURE', @level1name = N'uspGetBillOfMaterials';


text:
//
//  ZJInfoCount.m
//  ZJWeibo
//
//  Created by dibadalu on 15/11/9.
//  Copyright (c) 2015年 dibadalu. All rights reserved.
//

#import "ZJInfoCount.h"
#import <MJExtension.h>

@implementation ZJInfoCount

/**
 *  归档的实现
 */
MJCodingImplementation;

@end

redpajama_set_name: RedPajamaGithub


text:
package gov.nih.nci.caintegrator.web.action.study.management;

import gov.nih.nci.caintegrator.domain.annotation.SurvivalLengthUnitsEnum;
import gov.nih.nci.caintegrator.domain.annotation.SurvivalValueDefinition;
import gov.nih.nci.caintegrator.domain.annotation.SurvivalValueTypeEnum;

/**
 * Since s:select items have to link back to a String, these are placeholders for that on the form.
 */
public class DefineSurvivalDefinitionActionForm {

    private String survivalValueDefinitionId;
    private String survivalValueDefinitionName;
    private String survivalStartDateId;
    private String survivalDeathDateId;
    private String lastFollowupDateId;
    private SurvivalValueTypeEnum survivalValueType;
    private String survivalLengthId;
    private SurvivalLengthUnitsEnum survivalLengthUnits;
    private String survivalStatusId;
    private String valueForCensored;

    /**
     * @return the survivalValueDefinitionId
     */
    public String getSurvivalValueDefinitionId() {
        return survivalValueDefinitionId;
    }
    /**
     * @param survivalValueDefinitionId the survivalValueDefinitionId to set
     */
    public void setSurvivalValueDefinitionId(String survivalValueDefinitionId) {
        this.survivalValueDefinitionId = survivalValueDefinitionId;
    }
    /**
     * @return the survivalValueDefinitionName
     */
    public String getSurvivalValueDefinitionName() {
        return survivalValueDefinitionName;
    }
    /**
     * @param survivalValueDefinitionName the survivalValueDefinitionName to set
     */
    public void setSurvivalValueDefinitionName(String survivalValueDefinitionName) {
        this.survivalValueDefinitionName = survivalValueDefinitionName;
    }
    /**
     * @return the survivalStartDateId
     */
    public String getSurvivalStartDateId() {
        return survivalStartDateId;
    }
    /**
     * @param survivalStartDateId the survivalStartDateId to set
     */
    public void setSurvivalStartDateId(String survivalStartDateId) {
        this.survivalStartDateId = survivalStartDateId;
    }
    /**
     * @return the survivalDeathDateId
     */
    public String getSurvivalDeathDateId() {
        return survivalDeathDateId;
    }
    /**
     * @param survivalDeathDateId the survivalDeathDateId to set
     */
    public void setSurvivalDeathDateId(String survivalDeathDateId) {
        this.survivalDeathDateId = survivalDeathDateId;
    }
    /**
     * @return the lastFollowupDateId
     */
    public String getLastFollowupDateId() {
        return lastFollowupDateId;
    }
    /**
     * @param lastFollowupDateId the lastFollowupDateId to set
     */
    public void setLastFollowupDateId(String lastFollowupDateId) {
        this.lastFollowupDateId = lastFollowupDateId;
    }

    /**
     * @return the survivalValueType
     */
    public SurvivalValueTypeEnum getSurvivalValueType() {
        return survivalValueType;
    }
    /**
     * @param survivalValueType the survivalValueType to set
     */
    public void setSurvivalValueType(SurvivalValueTypeEnum survivalValueType) {
        this.survivalValueType = survivalValueType;
    }
    /**
     * @return the survivalLengthId
     */
    public String getSurvivalLengthId() {
        return survivalLengthId;
    }
    /**
     * @param survivalLengthId the survivalLengthId to set
     */
    public void setSurvivalLengthId(String survivalLengthId) {
        this.survivalLengthId = survivalLengthId;
    }
    /**
     * @return the survivalLengthUnits
     */
    public SurvivalLengthUnitsEnum getSurvivalLengthUnits() {
        return survivalLengthUnits;
    }
    /**
     * @param survivalLengthUnits the survivalLengthUnits to set
     */
    public void setSurvivalLengthUnits(SurvivalLengthUnitsEnum survivalLengthUnits) {
        this.survivalLengthUnits = survivalLengthUnits;
    }
    /**
     * @return the survivalStatusId
     */
    public String getSurvivalStatusId() {
        return survivalStatusId;
    }
    /**
     * @param survivalStatusId the survivalStatusId to set
     */
    public void setSurvivalStatusId(String survivalStatusId) {
        this.survivalStatusId = survivalStatusId;
    }
    /**
     * @return the valueForCensored
     */
    public String getValueForCensored() {
        return valueForCensored;
    }
    /**
     * @param valueForCensored the valueForCensored to set
     */
    public void setValueForCensored(String valueForCensored) {
        this.valueForCensored = valueForCensored;
    }
    /**
     * Clears all the variables to null.
     */
    public void clear() {
        setSurvivalValueType(SurvivalValueTypeEnum.DATE);
        survivalValueDefinitionId = null;
        survivalStartDateId = null;
        survivalDeathDateId = null;
        lastFollowupDateId = null;
        survivalLengthId = null;
        survivalLengthUnits = null;
        survivalStatusId = null;
        valueForCensored = null;
    }

    /**
     * Loads the string IDs to their proper values so that they can show up the current values in the JSP.
     * @param survivalValueDefinition - Values to load from.
     */
    public void load(SurvivalValueDefinition survivalValueDefinition) {
        if (survivalValueDefinition != null) {
            setSurvivalValueDefinitionId(String.valueOf(survivalValueDefinition.getId()));
            setSurvivalValueDefinitionName(survivalValueDefinition.getName());
            setSurvivalValueType(survivalValueDefinition.getSurvivalValueType());
            if (survivalValueDefinition.getSurvivalStartDate() != null) {
                setSurvivalStartDateId(String.valueOf(survivalValueDefinition.getSurvivalStartDate().getId()));
            }
            if (survivalValueDefinition.getDeathDate() != null) {
                setSurvivalDeathDateId(String.valueOf(survivalValueDefinition.getDeathDate().getId()));
            }
            if (survivalValueDefinition.getLastFollowupDate() != null) {
                setLastFollowupDateId(String.valueOf(survivalValueDefinition.getLastFollowupDate().getId()));
            }
            if (survivalValueDefinition.getSurvivalLength() != null) {
                setSurvivalLengthId(String.valueOf(survivalValueDefinition.getSurvivalLength().getId()));
            }
            if (survivalValueDefinition.getSurvivalStatus() != null) {
                setSurvivalStatusId(String.valueOf(survivalValueDefinition.getSurvivalStatus().getId()));
            }
            setSurvivalLengthUnits(survivalValueDefinition.getSurvivalLengthUnits());
            setValueForCensored(survivalValueDefinition.getValueForCensored());
        }
    }

}


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.Configuration;
using Shorcut_Virus_Remover.UI;

namespace Shorcut_Virus_Remover
{
    public partial class ScanHistory : Form
    {
        public ScanHistory()
        {
            InitializeComponent();
        }

        private void scan_HistoryBindingNavigatorSaveItem_Click(object sender, EventArgs e)
        {

        }

        private void ScanHistory_Load(object sender, EventArgs e)
        {
            // TODO: This line of code loads data into the 'shortcut_Virus_RemoverDataSet.Scan_History' table. You can move, or remove it, as needed.
            this.scan_HistoryTableAdapter.Fill(this.shortcut_Virus_RemoverDataSet.Scan_History);

        }

        private void Loginbutton1_Click(object sender, EventArgs e)
        {
            //Changing form
            History Hform = new History();

            this.Hide();
            Hform.Show();
        }
    }
}


text:
package biz.neustar.ultra.rest.dto;

import com.fasterxml.jackson.annotation.JsonInclude;
import com.fasterxml.jackson.annotation.JsonInclude.Include;
import com.google.common.base.Objects;

/**
 * The Class RestrictAccessIP.
 *
 * @author yash.khatri The Class RestrictAccessIP
 */
@JsonInclude(Include.NON_NULL)
public class RestrictAccessIP {

    /**
     * Start IP.
     */
    private String startIP;

    /**
     * End IP.
     */
    private String endIP;

    /**
     * The CIDR.
     */
    private String cidr;

    /**
     * The single IP for restriction.
     */
    private String singleIP;

    /**
     * Comment.
     */
    private String comment;

    /**
     * The application.
     */
    private AccessRestrictionApplication application;

    /**
     * Instantiates a new restrict access ip. Empty Constructor
     */
    public RestrictAccessIP() {
        super();
    }

    /**
     * Instantiates a new restrict access ip. Parameterized constructor.
     *
     * @param startIP     the start ip
     * @param endIP       the end ip
     * @param cidr        the cidr
     * @param singleIP    the single ip
     * @param comment     the comment
     * @param application the application
     */
    public RestrictAccessIP(String startIP, String endIP, String cidr, String singleIP, String comment,
            AccessRestrictionApplication application) {
        super();
        this.startIP = startIP;
        this.endIP = endIP;
        this.cidr = cidr;
        this.singleIP = singleIP;
        this.comment = comment;
        this.application = application;
    }

    /**
     * Gets the start ip.
     *
     * @return the start ip
     */
    public String getStartIP() {
        return startIP;
    }

    /**
     * Sets the start ip.
     *
     * @param startIP the new start ip
     */
    public void setStartIP(String startIP) {
        this.startIP = startIP;
    }

    /**
     * Gets the end ip.
     *
     * @return the end ip
     */
    public String getEndIP() {
        return endIP;
    }

    /**
     * Sets the end ip.
     *
     * @param endIP the new end ip
     */
    public void setEndIP(String endIP) {
        this.endIP = endIP;
    }

    /**
     * Gets the cidr.
     *
     * @return the cidr
     */
    public String getCidr() {
        return cidr;
    }

    /**
     * Sets the cidr.
     *
     * @param cidr the new cidr
     */
    public void setCidr(String cidr) {
        this.cidr = cidr;
    }

    /**
     * Gets the single ip.
     *
     * @return the single ip
     */
    public String getSingleIP() {
        return singleIP;
    }

    /**
     * Sets the single ip.
     *
     * @param singleIP the new single ip
     */
    public void setSingleIP(String singleIP) {
        this.singleIP = singleIP;
    }

    /**
     * Gets the comment.
     *
     * @return the comment
     */
    public String getComment() {
        return comment;
    }

    /**
     * Sets the comment.
     *
     * @param comment the new comment
     */
    public void setComment(String comment) {
        this.comment = comment;
    }

    /**
     * Gets the application.
     *
     * @return the application
     */
    public AccessRestrictionApplication getApplication() {
        return application;
    }

    /**
     * Sets the application.
     *
     * @param application the new application
     */
    public void setApplication(AccessRestrictionApplication application) {
        this.application = application;
    }

    @Override
    public String toString() {
        return "RestrictAccessIP [startIP=" + startIP + ", endIP=" + endIP + ", cidr=" + cidr + ", singleIP=" + singleIP
                + ", comment=" + comment + ", application=" + application + "]";
    }

    @Override
    public int hashCode() {
        return Objects.hashCode(getStartIP(), getEndIP(), getCidr(), getSingleIP(), getComment(), getApplication());
    }

    @Override
    public boolean equals(Object obj) {
        boolean isEqual = true;
        if (!(obj instanceof RestrictAccessIP)) {
            return false;
        }
        final RestrictAccessIP other = (RestrictAccessIP) obj;
        isEqual = Objects.equal(getApplication(), other.getApplication()) && Objects.equal(getCidr(), other.getCidr())
                && Objects.equal(getComment(), other.getComment()) && Objects.equal(getSingleIP(), other.getSingleIP())
                && Objects.equal(getStartIP(), other.getStartIP()) && Objects.equal(getEndIP(), other.getEndIP());
        return isEqual;
    }

}


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

import { jqxGridComponent } from '../../../jqwidgets-ts/angular_jqxgrid'

@Component({
    selector: 'app-root',
    templateUrl: './app.component.html'
})

export class AppComponent {
    @ViewChild('myGrid') myGrid: jqxGridComponent;

    firstNames: string[] =
    [
        'Andrew', 'Nancy', 'Shelley', 'Regina', 'Yoshi', 'Antoni', 'Mayumi', 'Ian', 'Peter', 'Lars', 'Petra', 'Martin', 'Sven', 'Elio', 'Beate', 'Cheryl', 'Michael', 'Guylene'
    ];

    lastNames: string[] =
    [
        'Fuller', 'Davolio', 'Burke', 'Murphy', 'Nagase', 'Saavedra', 'Ohno', 'Devling', 'Wilson', 'Peterson', 'Winkler', 'Bein', 'Petersen', 'Rossi', 'Vileid', 'Saylor', 'Bjorn', 'Nodier'
    ];

    productNames: string[] =
    [
        'Black Tea', 'Green Tea', 'Caffe Espresso', 'Doubleshot Espresso', 'Caffe Latte', 'White Chocolate Mocha', 'Cramel Latte', 'Caffe Americano', 'Cappuccino', 'Espresso Truffle', 'Espresso con Panna', 'Peppermint Mocha Twist'
    ];

    priceValues: string[] =
    [
        '2.25', '1.5', '3.0', '3.3', '4.5', '3.6', '3.8', '2.5', '5.0', '1.75', '3.25', '4.0'
    ];

    generaterow(): any {
        let row = {};
        let productindex = Math.floor(Math.random() * this.productNames.length);
        let price = parseFloat(this.priceValues[productindex]);
        let quantity = 1 + Math.round(Math.random() * 10);
        row['firstname'] = this.firstNames[Math.floor(Math.random() * this.firstNames.length)];
        row['lastname'] = this.lastNames[Math.floor(Math.random() * this.lastNames.length)];
        row['productname'] = this.productNames[productindex];
        row['price'] = price;
        row['quantity'] = quantity;
        row['total'] = price * quantity;
        return row;
    }

    generateData(): any {
        let data = {};

        for (let i = 0; i < 10; i++) {
            let row = this.generaterow();
            data[i] = row;
        }
        return data;
    }

    source: any =
    {
        localdata: this.generateData(),
        datatype: 'local',
        datafields:
        [
            { name: 'firstname', type: 'string' },
            { name: 'lastname', type: 'string' },
            { name: 'productname', type: 'string' },
            { name: 'quantity', type: 'number' },
            { name: 'price', type: 'number' },
            { name: 'total', type: 'number' }
        ]
    };

    dataAdapter: any = new jqx.dataAdapter(this.source);

    columns: any[] =
    [
        { text: 'First Name', datafield: 'firstname', width: 200 },
        { text: 'Last Name', datafield: 'lastname', width: 200 },
        { text: 'Product', datafield: 'productname', width: 180 },
        { text: 'Quantity', datafield: 'quantity', width: 80, cellsalign: 'right' },
        { text: 'Unit Price', datafield: 'price', width: 90, cellsalign: 'right', cellsformat: 'c2' },
        { text: 'Total', datafield: 'total', cellsalign: 'right', cellsformat: 'c2' }
    ];

    rendertoolbar = (toolbar: any): void => {
        let container = document.createElement('div');
        container.style.margin = '5px';

        let buttonContainer1 = document.createElement('div');
        let buttonContainer2 = document.createElement('div');
        let buttonContainer3 = document.createElement('div');
        let buttonContainer4 = document.createElement('div');

        buttonContainer1.id = 'buttonContainer1';
        buttonContainer2.id = 'buttonContainer2';
        buttonContainer3.id = 'buttonContainer3';
        buttonContainer4.id = 'buttonContainer4';

        buttonContainer1.style.cssText = 'float: left';
        buttonContainer2.style.cssText = 'float: left; margin-left: 5px';
        buttonContainer3.style.cssText = 'float: left; margin-left: 5px';
        buttonContainer4.style.cssText = 'float: left; margin-left: 5px';

        container.appendChild(buttonContainer1);
        container.appendChild(buttonContainer2);
        container.appendChild(buttonContainer3);
        container.appendChild(buttonContainer4);
        toolbar[0].appendChild(container);

        let addRowButton = jqwidgets.createInstance('#buttonContainer1', 'jqxButton', { width: 105, value: 'Add New Row' });
        let addMultipleRowsButton = jqwidgets.createInstance('#buttonContainer2', 'jqxButton', { width: 170, value: 'Add Multiple New Rows' });
        let deleteRowButton = jqwidgets.createInstance('#buttonContainer3', 'jqxButton', { width: 150, value: 'Delete Selected Row' });
        let updateRowButton = jqwidgets.createInstance('#buttonContainer4', 'jqxButton', { width: 155, value: 'Update Selected Row' });

        addRowButton.addEventHandler('click', () => {
            let datarow = this.generaterow();
            this.myGrid.addrow(null, datarow);
        })

        addMultipleRowsButton.addEventHandler('click', () => {
            this.myGrid.beginupdate();
            for (let i = 0; i < 10; i++) {
                let datarow = this.generaterow();
                this.myGrid.addrow(null, datarow);
            }
            this.myGrid.endupdate();
        })

        deleteRowButton.addEventHandler('click', () => {
            let selectedrowindex = this.myGrid.getselectedrowindex();
            let rowscount = this.myGrid.getdatainformation().rowscount;
            if (selectedrowindex >= 0 && selectedrowindex < parseFloat(rowscount)) {
                let id = this.myGrid.getrowid(selectedrowindex);
                this.myGrid.deleterow(id);
            }
        })

        updateRowButton.addEventHandler('click', () => {
            let datarow = this.generaterow();
            let selectedrowindex = this.myGrid.getselectedrowindex();
            let rowscount = this.myGrid.getdatainformation().rowscount;
            if (selectedrowindex >= 0 && selectedrowindex < parseFloat(rowscount)) {
                let id = this.myGrid.getrowid(selectedrowindex);
                this.myGrid.updaterow(id, datarow);
                this.myGrid.ensurerowvisible(selectedrowindex);
            }
        })
    };
}


text:
keybindings = keybindings or { up = {}, down = {} }
keybinder = {}

function keybinder.bind( key, func, func2 )
    if type(func) ~= 'function' then
        error 'Second parameter (key down func) must be a function'
    end
    if func2 and type(func2) ~= 'function' then
        error 'Thrid parameter (key release func) must be a function or nil )'
    end

    keybindings.down[key] = func
    keybindings.up[key] = func2
end

function keybinder.keypressed( key )
    if keybindings.down[key] then
        keybindings.down[key](key)
    end
end

function keybinder.keyreleased( key )
    if keybindings.up[key] then
        keybindings.up[key]( key )
    end
end

function keybinder.unbind( key )
    keybindings.down[key] = nil
    keybindings.up[key] = nil
end

function keybinder.list()
    local skiplist={}
    skiplist[keybindings] = true
    skiplist[gui] = true
    print 'Key down list'
    for k,v in pairs( keybindings.down ) do
        key = table.keyOf( KeyCodes, k )
        print( key, getName(v, skiplist) )
    end

    print 'Key up list'
    for k,v in pairs( keybindings.up ) do
        key = table.keyOf( KeyCodes, k )
        print( key, getName(v, skiplist) )
    end
end

bind = keybinder.bind
unbind = keybinder.unbind


text:
<!DOCTYPE html PUBLIC
	"-//W3C//DTD XHTML 1.0 Transitional//EN"
	"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

<meta http-equiv="Content-Type" content="text/html; charset=utf-8"/>
<title>Dienst nicht verfügbar</title>

Dienst nicht verfügbar

Unser System wird derzeit gewartet. Bitte versuchen Sie es später noch einmal.

Vielen Dank.

<?php echo date('d.m.Y H:i:s',$data['time']) .' '. $data['version']; ?>


text:
<?xml version="1.0" encoding="UTF-8"?>
<!--
  ~ Licensed to the Apache Software Foundation (ASF) under one or more
  ~ contributor license agreements.  See the NOTICE file distributed with
  ~ this work for additional information regarding copyright ownership.
  ~ The ASF licenses this file to You under the Apache License, Version 2.0
  ~ (the "License"); you may not use this file except in compliance with
  ~ the License.  You may obtain a copy of the License at
  ~
  ~    http://www.apache.org/licenses/LICENSE-2.0
  ~
  ~ Unless required by applicable law or agreed to in writing, software
  ~ distributed under the License is distributed on an "AS IS" BASIS,
  ~ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  ~ See the License for the specific language governing permissions and
  ~ limitations under the License.
  -->
<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>
  <parent>
    <groupId>org.apache.spark</groupId>
    <artifactId>spark-parent</artifactId>
    <version>0.8.1-incubating</version>
    <relativePath>../pom.xml</relativePath>
  </parent>

  <groupId>org.apache.spark</groupId>
  <artifactId>spark-yarn_2.9.3</artifactId>
  <packaging>jar</packaging>
  <name>Spark Project YARN Support</name>
  <url>http://spark.incubator.apache.org/</url>

  <dependencies>
    <dependency>
      <groupId>${akka.group}</groupId>
      <artifactId>akka-actor</artifactId>
    </dependency>
    <dependency>
      <groupId>${akka.group}</groupId>
      <artifactId>akka-remote</artifactId>
    </dependency>
    <dependency>
      <groupId>${akka.group}</groupId>
      <artifactId>akka-slf4j</artifactId>
    </dependency>
    <dependency>
      <groupId>${akka.group}</groupId>
      <artifactId>akka-zeromq</artifactId>
    </dependency>
    <dependency>
      <groupId>org.apache.spark</groupId>
      <artifactId>spark-core_2.9.3</artifactId>
      <version>${project.version}</version>
    </dependency>
    <dependency>
      <groupId>org.apache.hadoop</groupId>
      <artifactId>hadoop-yarn-api</artifactId>
    </dependency>
    <dependency>
      <groupId>org.apache.hadoop</groupId>
      <artifactId>hadoop-yarn-common</artifactId>
    </dependency>
    <dependency>
      <groupId>org.apache.hadoop</groupId>
      <artifactId>hadoop-yarn-client</artifactId>
    </dependency>
    <dependency>
      <groupId>org.apache.hadoop</groupId>
      <artifactId>hadoop-client</artifactId>
      <version>${yarn.version}</version>
    </dependency>
    <dependency>
      <groupId>org.apache.avro</groupId>
      <artifactId>avro</artifactId>
    </dependency>
    <dependency>
      <groupId>org.apache.avro</groupId>
      <artifactId>avro-ipc</artifactId>
    </dependency>
    <dependency>
      <groupId>org.scalatest</groupId>
      <artifactId>scalatest_2.9.3</artifactId>
      <scope>test</scope>
    </dependency>
    <dependency>
      <groupId>org.mockito</groupId>
      <artifactId>mockito-all</artifactId>
      <scope>test</scope>
    </dependency>
  </dependencies>

  <build>
    <outputDirectory>target/scala-${scala.version}/classes</outputDirectory>
    <testOutputDirectory>target/scala-${scala.version}/test-classes</testOutputDirectory>
    <plugins>
      <plugin>
        <groupId>org.apache.maven.plugins</groupId>
        <artifactId>maven-shade-plugin</artifactId>
        <configuration>
          <shadedArtifactAttached>false</shadedArtifactAttached>
          <outputFile>${project.build.directory}/${project.artifactId}-${project.version}-shaded.jar</outputFile>
          <artifactSet>
            <includes>
              <include>*:*</include>
            </includes>
          </artifactSet>
          <filters>
            <filter>
              <artifact>*:*</artifact>
              <excludes>
                <exclude>META-INF/*.SF</exclude>
                <exclude>META-INF/*.DSA</exclude>
                <exclude>META-INF/*.RSA</exclude>
              </excludes>
            </filter>
          </filters>
        </configuration>
        <executions>
          <execution>
            <phase>package</phase>
            <goals>
              <goal>shade</goal>
            </goals>
            <configuration>
              <transformers>
                <transformer implementation="org.apache.maven.plugins.shade.resource.ServicesResourceTransformer" />
                <transformer implementation="org.apache.maven.plugins.shade.resource.AppendingTransformer">
                  <resource>reference.conf</resource>
                </transformer>
              </transformers>
            </configuration>
          </execution>
        </executions>
      </plugin>
      <plugin>
        <groupId>org.apache.maven.plugins</groupId>
        <artifactId>maven-antrun-plugin</artifactId>
        <executions>
          <execution>
            <phase>test</phase>
            <goals>
              <goal>run</goal>
            </goals>
            <configuration>
              <exportAntProperties>true</exportAntProperties>
              <tasks>
                <property name="spark.classpath" refid="maven.test.classpath" />
                <property environment="env" />
                <fail message="Please set the SCALA_HOME (or SCALA_LIBRARY_PATH if scala is on the path) environment variables and retry.">
                  <condition>
                    <not>
                      <or>
                        <isset property="env.SCALA_HOME" />
                        <isset property="env.SCALA_LIBRARY_PATH" />
                      </or>
                    </not>
                  </condition>
                </fail>
              </tasks>
            </configuration>
          </execution>
        </executions>
      </plugin>
      <plugin>
        <groupId>org.scalatest</groupId>
        <artifactId>scalatest-maven-plugin</artifactId>
        <configuration>
          <environmentVariables>
            <SPARK_HOME>${basedir}/..</SPARK_HOME>
            <SPARK_TESTING>1</SPARK_TESTING>
            <SPARK_CLASSPATH>${spark.classpath}</SPARK_CLASSPATH>
          </environmentVariables>
        </configuration>
      </plugin>
    </plugins>
  </build>
</project>


text:
checkout() {

	#rm -rf /tmp/mwl-android-gradle

	export ANDROID_HOME=/home/ricardo/android-studio/sdk

	export PATH=$PATH:$ANDROID_HOME/bin

	export PATH=$PATH:/home/ricardo/gradle-1.12/bin

	export PATH=$PATH:/home/ricardo/android-studio/sdk/platform-tools

	checkout_project "mwl-android-gradle" "develop"

	cd mwl-android-gradle

	checkout_project "mwl-android-sdk" "develop"

	checkout_project "mwl-android-core" "feature/refactory_test_jenkins"

	checkout_project "mwl-android-tim-emprego" "feature/setup_robotium"

	checkout_project "mwl-android-claro-fittipaldi" "master"

	gradle assemble -b build.gradle --stacktrace

}

checkout_project() {
	if [ ! -d "$1" ]; then
		git clone https://ricardobaumann:01081951@bitbucket.org/zynkmobile/$1
	fi

	cd $1

	git fetch && git checkout $2

	git pull origin $2

	cd ..
}

checkout


text:
<?php

use Hubzero\Content\Migration\Base;

// No direct access
defined('_HZEXEC_') or die();

/**
 * Migration script to drop misnamed field that can get left behind during upgrades
 **/
class Migration20160907102400ComCourses extends Base
{
	public function up()
	{
		if ($this->db->tableHasField('#__courses_form_respondents', 'attempts'))
		{
			$query = "ALTER TABLE `#__courses_form_respondents` DROP `attempts`;";
			$this->db->setQuery($query);
			$this->db->query();
		}
	}

	public function down()
	{
	}
}


text:
Order: 70
Title: Jenkins
Description: Details on the Jenkins support in GitVersion
RedirectFrom: docs/build-server-support/build-server/jenkins
---

## SCM Settings

When setting up a Jenkins project for GitVersion, it is necessary to add a few _Behaviors_ to the SCM settings to ensure that GitVersion has enough information:

*   Advanced clone behaviors
    *   Enable `Fetch tags`
    *   Enable `Honor refspec on intial clone`
*   Check out to matching local branch
*   Prune stale remote-tracking branches
*   Specify ref specs
    *   Ref Spec: `+refs/heads/*:refs/remotes/@{remote}/*`

## Usage

Integrating GitVersion into your Jenkins build varies based on the project type: Freestyle vs. Pipeline.

### Freestyle Projects

Injecting environment variables is not supported in Jenkins natively, but
Jenkins plugins exist that provide this functionality. Of these plugins
[EnvInject][env-inject] appears to be the most popular with over 20k downloads per month.

To inject the GitVersion variables as environment variables for a build job
using [EnvInject][env-inject], do the following:

1.  Add an **Execute Windows batch command** build step with _Command_:
    `gitversion /output buildserver`
2.  Add an **Inject environment variables** build step and use value
    'gitversion.properties' for the _Properties File Path_ parameter

This assumes GitVersion.exe is available on the command line.

You can verify correct injection of environment variables by adding another
"Execute Windows batch command" build step with the following _Command_:

```shell
@echo Retrieving some GitVersion environment variables:
@echo %GitVersion_SemVer%
@echo %GitVersion_BranchName%
@echo %GitVersion_AssemblySemVer%
@echo %GitVersion_MajorMinorPatch%
@echo %GitVersion_Sha%
```

### Pipeline Projects

For pipeline projects, GitVersion variables can be accessed by reading the `gitversion.properties` file using the [Pipeline Utility Steps][pipeline-utility-steps] plugin. Variables from a property file are not automatically merged with the environment variables, but they can be accessed within a script block.

In a pipeline stage:

1.  Run GitVersion with the flag for _buildserver_ output (this only works when run from Jenkins, specifically when the `JENKINS_URL` environment variable is defined):

```groovy
sh 'gitversion /output buildserver'`
```

2.  Add a script block to read the properties file, assign environment variables as needed:

```groovy
script {
    def props = readProperties file: 'gitversion.properties'

    env.GitVersion_SemVer = props.GitVersion_SemVer
    env.GitVersion_BranchName = props.GitVersion_BranchName
    env.GitVersion_AssemblySemVer = props.GitVersion_AssemblySemVer
    env.GitVersion_MajorMinorPatch = props.GitVersion_MajorMinorPatch
    env.GitVersion_Sha = props.GitVersion_Sha
}
```

[env-inject]: https://wiki.jenkins-ci.org/display/JENKINS/EnvInject+Plugin
[pipeline-utility-steps]: https://plugins.jenkins.io/pipeline-utility-steps


text:
@interface TimeTool : NSObject
@property (nonatomic, strong) NSDate *loginDate;
+ (void)saveLoginDate:(NSDate *)loginDate;

+ (NSDate *)unarchiveLoginDate;

+ (void)clearTimeFile;
@end


text:
namespace {
const char kErrorCannotHaveMultipleSessions[] =
    "Multiple Wi-Fi Display sessions are not supported";
const char kErrorSinkNotAvailable[] = "The sink is not available";
}  // namespace

namespace extensions {

using namespace api::display_source;

WiFiDisplaySessionServiceImpl::WiFiDisplaySessionServiceImpl(
    DisplaySourceConnectionDelegate* delegate,
    mojo::InterfaceRequest<WiFiDisplaySessionService> request)
    : binding_(this, std::move(request)),
      delegate_(delegate),
      sink_state_(SINK_STATE_NONE),
      sink_id_(DisplaySourceConnectionDelegate::kInvalidSinkId),
      weak_factory_(this) {
  delegate_->AddObserver(this);
}

WiFiDisplaySessionServiceImpl::~WiFiDisplaySessionServiceImpl() {
  delegate_->RemoveObserver(this);
  Disconnect();
}

// static
void WiFiDisplaySessionServiceImpl::BindToRequest(
    content::BrowserContext* browser_context,
    mojo::InterfaceRequest<WiFiDisplaySessionService> request) {
  DisplaySourceConnectionDelegate* delegate =
      DisplaySourceConnectionDelegateFactory::GetForBrowserContext(
          browser_context);
  CHECK(delegate);

  new WiFiDisplaySessionServiceImpl(delegate, std::move(request));
}

void WiFiDisplaySessionServiceImpl::SetClient(
    WiFiDisplaySessionServiceClientPtr client) {
  DCHECK(client);
  DCHECK(!client_);
  client_ = std::move(client);
  client_.set_connection_error_handler(
      base::Bind(&WiFiDisplaySessionServiceImpl::OnClientConnectionError,
                 weak_factory_.GetWeakPtr()));
}

void WiFiDisplaySessionServiceImpl::Connect(int32_t sink_id,
                                            int32_t auth_method,
                                            const mojo::String& auth_data) {
  DCHECK(client_);
  // We support only one Wi-Fi Display session at a time.
  if (delegate_->connection()) {
    client_->OnConnectRequestHandled(false, kErrorCannotHaveMultipleSessions);
    return;
  }

  const DisplaySourceSinkInfoList& sinks = delegate_->last_found_sinks();
  auto found = std::find_if(
      sinks.begin(), sinks.end(),
      [sink_id](DisplaySourceSinkInfoPtr ptr) { return ptr->id == sink_id; });
  if (found == sinks.end() || (*found)->state != SINK_STATE_DISCONNECTED) {
    client_->OnConnectRequestHandled(false, kErrorSinkNotAvailable);
    return;
  }
  AuthenticationInfo auth_info;
  if (auth_method != AUTHENTICATION_METHOD_NONE) {
    DCHECK(auth_method <= AUTHENTICATION_METHOD_LAST);
    auth_info.method = static_cast<AuthenticationMethod>(auth_method);
    auth_info.data = scoped_ptr<std::string>(new std::string(auth_data));
  }
  auto on_error = base::Bind(&WiFiDisplaySessionServiceImpl::OnConnectFailed,
                             weak_factory_.GetWeakPtr(), sink_id);
  delegate_->Connect(sink_id, auth_info, on_error);
  sink_id_ = sink_id;
  sink_state_ = (*found)->state;
  DCHECK(sink_state_ == SINK_STATE_CONNECTING);
  client_->OnConnectRequestHandled(true, "");
}

void WiFiDisplaySessionServiceImpl::Disconnect() {
  if (sink_id_ == DisplaySourceConnectionDelegate::kInvalidSinkId) {
    // The connection might drop before this call has arrived.
    // Renderer should have been notified already.
    return;
  }

  const DisplaySourceSinkInfoList& sinks = delegate_->last_found_sinks();
  auto found = std::find_if(
      sinks.begin(), sinks.end(),
      [this](DisplaySourceSinkInfoPtr ptr) { return ptr->id == sink_id_; });
  DCHECK(found != sinks.end());
  DCHECK((*found)->state == SINK_STATE_CONNECTED ||
         (*found)->state == SINK_STATE_CONNECTING);

  auto on_error = base::Bind(&WiFiDisplaySessionServiceImpl::OnDisconnectFailed,
                             weak_factory_.GetWeakPtr(), sink_id_);
  delegate_->Disconnect(on_error);
}

void WiFiDisplaySessionServiceImpl::SendMessage(const mojo::String& message) {
  if (sink_id_ == DisplaySourceConnectionDelegate::kInvalidSinkId) {
    // The connection might drop before this call has arrived.
    return;
  }
  auto connection = delegate_->connection();
  DCHECK(connection);
  DCHECK_EQ(sink_id_, connection->GetConnectedSink()->id);
  connection->SendMessage(message);
}

void WiFiDisplaySessionServiceImpl::OnSinkMessage(const std::string& message) {
  DCHECK(delegate_->connection());
  DCHECK_NE(sink_id_, DisplaySourceConnectionDelegate::kInvalidSinkId);
  DCHECK(client_);
  client_->OnMessage(message);
}

void WiFiDisplaySessionServiceImpl::OnSinksUpdated(
    const DisplaySourceSinkInfoList& sinks) {
  if (sink_id_ == DisplaySourceConnectionDelegate::kInvalidSinkId)
    return;
  // The initialized sink id means that the client should have
  // been initialized as well.
  DCHECK(client_);
  auto found = std::find_if(
      sinks.begin(), sinks.end(),
      [this](DisplaySourceSinkInfoPtr ptr) { return ptr->id == sink_id_; });
  if (found == sinks.end()) {
    client_->OnError(ERROR_TYPE_CONNECTION_ERROR, "The sink has disappeared");
    client_->OnTerminated();
    sink_id_ = DisplaySourceConnectionDelegate::kInvalidSinkId;
  }

  SinkState actual_state = (*found)->state;

  if (actual_state == sink_state_)
    return;

  if (actual_state == SINK_STATE_CONNECTED) {
    auto connection = delegate_->connection();
    DCHECK(connection);
    auto on_message = base::Bind(&WiFiDisplaySessionServiceImpl::OnSinkMessage,
                                 weak_factory_.GetWeakPtr());
    connection->SetMessageReceivedCallback(on_message);
    client_->OnConnected(connection->GetLocalAddress());
  }

  if (actual_state == SINK_STATE_DISCONNECTED) {
    client_->OnDisconnectRequestHandled(true, "");
    client_->OnTerminated();
    sink_id_ = DisplaySourceConnectionDelegate::kInvalidSinkId;
  }

  sink_state_ = actual_state;
}

void WiFiDisplaySessionServiceImpl::OnConnectionError(
    int sink_id,
    DisplaySourceErrorType type,
    const std::string& description) {
  if (sink_id != sink_id_)
    return;
  DCHECK(client_);
  client_->OnError(type, description);
}

void WiFiDisplaySessionServiceImpl::OnConnectFailed(
    int sink_id,
    const std::string& message) {
  if (sink_id != sink_id_)
    return;
  DCHECK(client_);
  client_->OnError(ERROR_TYPE_CONNECTION_ERROR, message);
}

void WiFiDisplaySessionServiceImpl::OnDisconnectFailed(
    int sink_id,
    const std::string& message) {
  if (sink_id != sink_id_)
    return;
  DCHECK(client_);
  client_->OnDisconnectRequestHandled(false, message);
}

void WiFiDisplaySessionServiceImpl::OnClientConnectionError() {
  DLOG(ERROR) << "IPC connection error";
  delete this;
}

}  // namespace extensions


text:
package gudusoft.gsqlparser.sql2xml.model;

import org.simpleframework.xml.Element;

public class assigned_row
{

	@Element
	private contextually_typed_row_value_expression contextually_typed_row_value_expression = new contextually_typed_row_value_expression( );

	public contextually_typed_row_value_expression getContextually_typed_row_value_expression( )
	{
		return contextually_typed_row_value_expression;
	}

}


text:
Easy Graph Visual Tests

Easy Graph Helper Tests


text:
Devolve is a simple singleton class for a dynamic thread pool and associated job queue.
The constructor is automatically invoked by the first call to
instance() and
starts a listener thread that listens for worker connections on a configurable port. Client
threads can add jobs by calling add() at any time.

When a worker connects, the pool listener spawns a new proxy thread dedicated to that
worker and resumes listening. All proxy threads run an infinite loop performing these
steps within:

1. Dequeue job from the job queue (blocking if the queue is empty).
2. If what was just dequeued was the QUIT token, put it back on the queue so other
   proxy threads can see it, close socket and terminate.
3. Otherwise, send job data to worker and wait for result.
4. Put result string in job object and resume step 1.

Any number of workers may connect and process jobs; currently select() is used to listen
for connections so that may limit the number of workers to 1024. When the select is
replaced by epoll, this limit should go away.

Any client thread can terminate the pool by invoking
close();
this causes the pool listener to write the __QUIT__ token to the job queue, wait for all
worker proxy threads to
end and then terminate; no new connections are accepted.

Jobs enqueued must be objects that respond to
get\_work() and
put\_result() methods. The first must return a string that
is sent to the worker; this can be a normal string or the result of marshalling an
object. The second should take a single argument which will be either:
+ __nil__, indicating that the worker crashed or some unexpected problem was encountered
  in the protocol or a bug in the worker code; or
+ the result string sent by the worker.

The put\_result() method can re-enqueue the job if the
argument is __nil__; if non-__nil__, it can dispose of the result in any suitable way,
for example, unmarshal the result (if it is not a plain string), write it to a file or a
database, add it to objects, etc. The get\_work() method
allows clients to delay fetching the actual data until it is about to be sent to a worker
without consuming memory while the job is in the queue. The application can decide whether
this string is a plain string or one that needs to be unmarshalled into an object by the
worker; the thread pool does not care.

Each worker __must__ have a unique name, which should be a short string. Workers should
do the following after connecting:

1. Send the name using socket.puts.

2. Send the process id using socket.puts.

3. Enter an infinite loop with these steps:

    1. Read a short string  using socket.gets; if this
       string is the __QUIT__ token, close the socket and terminate. Otherwise, convert it
       to an integer, say __n__, denoting the size (in bytes) of the data string to come.

    2. Read the data string of length __n__ bytes (clients can decide whether this is a
       plain string or one that needs to be unmarshalled into an object; the thread pool
       does not care).

    3. Process the input, wrap it in a Result object,
       marshal that object and send it back to the boss; it will be passed unchanged to
       the put\_result() method of the corresponding job
       object. Since the result string is a marshalled
       Result
       object, it should *never* be __nil__.

The sample application under the example subdirectory
illustrates usage. It is intended to be run on Ubuntu Linux systems. Run the boss like
this:

    cd example
    ruby -w deb-pkg.rb

Now run as many workers as you have cores, one in each terminal window where the
worker name should be different for each worker, w1, w2, etc.:

    cd example
    ruby -w worker.rb -n w1 -b localhost

Appending the -h option to either the boss or worker
invocation will display a short summary of available options.
On completion, you should see a short message indicating the number of package stanzas
processed and log files named boss.log,
w1.log, w2.log, etc.

Some performance numbers are given below.

## Performance:

The example application parses package descriptions on an Ubuntu Linux machine from the
file /var/lib/dpkg/status. Here are some details of a
couple of runs:

Data file: /var/lib/dpkg/status on an Ubuntu 12.04 system
with: 2239086 bytes, 51317 lines, 2184 package stanzas.

Machines: M1 = Intel Core i3 laptop, running Ubuntu 12.04; M2 = AMD Quad core Phenom
desktop, running Ubuntu 10.04.

Each time is the average completion time of all the worker processes; this is a better
indicator of performance than the completion time of the boss since the listener thread
has a 30s socket timeout which makes timing unreliable. The times are also affected by
the number of stanzas included in each job and controlled by the "-s" option; for example,
worker completion times drop by half when we use "-s 8".

Column titles (except the first) are the number of workers.

Machine	 1	 2	 3	 4

M1	44s	22s	15s	11s

M2	32s	16s	11s	8s

## Other similar tools

There are of course other tools (such as Drb and EventMachine) but they seemed more
geared towards web servers than the rather simple distributed computation I was
interested in. Some scenarios in which I find 'devolve' useful:

1. Generating large number of combinatorial objects such as graphs, permutations, etc.
   and farming out the analysis of those objects to worker processes.
2. Parsing a large file (or set of files) such as the lists of Debian packages where
   the files are naturally separated into stanzas that can be independently parsed by
   worker processes.

## Contact

I appreciate feedback, so if you have any questions, suggestions or patches, please
send me email: amberarrow at gmail with the usual extension. Thanks.


text:
<!DOCTYPE html>

    <meta http-equiv="refresh" content="0;URL=../../openssl_sys/constant.NID_id_cmc_getCert.html">

Redirecting to ../../openssl_sys/constant.NID_id_cmc_getCert.html...


text:
<?php

namespace Bono\Provider;

/**
 * LanguageProvider
 *
 * @category   PHP_Framework
 * @package    Bono
 * @subpackage Provider
 * @author     Ganesha <reekoheek@gmail.com>
 * @copyright  2014 PT Sagara Xinix Solusitama
 * @license    https://raw.github.com/xinix-technology/bono/master/LICENSE MIT
 * @version    0.10.0
 * @link       http://xinix.co.id/products/bono
 */
class LanguageProvider extends Provider
{
    protected $options = array(
        'lang' => 'en-US',
        'debug' => true,
    );

    protected $language = null;

    protected $dictionaries = array();

    protected $baseDirectories = array(
        array(),
        array(),
        array(),
        array(),
        array(),
        array(),
        array(),
        array(),
        array(),
        array(),
    );

    /**
     * [initialize description]
     *
     * @return [type] [description]
     */
    public function initialize()
    {
        $lang = $this;

        if (is_callable($this->options['lang'])) {
            $this->options['lang'] = call_user_func($this->options['lang']);
        }

        if ($p = realpath(rtrim($this->app->config('bono.base.path'), DIRECTORY_SEPARATOR))) {
            $this->addBaseDirectory($p, 9);
        }

        $d = explode(DIRECTORY_SEPARATOR.'src', __DIR__);
        $this->addBaseDirectory($d[0]);

        $this->app->container->singleton('lang', function () use ($lang) {
            return $lang;
        });
    }

    public function translate($words)
    {
        $translated = $this->getTranslation($words, $this->lang());

        if (1 === func_num_args()) {
            return $translated;
        }

        $args = func_get_args();
        if (is_array($args[1])) {
            $params = $args[1];
        } else {
            $params = array_slice($args, 1);
        }

        foreach ($params as $key => $value) {
            $translated = str_replace('{'.$key.'}', $value, $translated);
        }

        return $translated;
    }

    public function lang($lang = null)
    {
        if ($lang) {
            $this->language = $lang;
            return $this;
        } else {
            return strtolower(str_replace('_', '-', trim($this->language ?: val($this->options['lang']))));
        }
    }

    public function loadLanguageDirectory($dir)
    {
        $dictionary = array();
        if (is_dir($dir)) {
            $files = glob($dir.'/*.php');
            foreach ($files as $file) {
                $arr = include($file);
                $dictionary = array_merge($dictionary, $arr);
            }
        }
        return $dictionary;
    }

    public function getTranslation($words, $lang)
    {
        $dictionary = $this->getDictionary($lang);
        if (isset($dictionary[$words])) {
            return $dictionary[$words];
        }
        return $words;
    }

    public function getDictionary($lang)
    {

        if (!isset($this->dictionaries[$lang])) {
            $fallbackLang = explode('-', $lang);
            $fallbackLang = $fallbackLang[0];

            $dictionary = array();

            foreach ($this->baseDirectories as $dirs) {
                foreach ($dirs as $dir) {
                    $dictionary = array_merge($dictionary, $this->loadLanguageDirectory($dir.'/lang/'.$fallbackLang));
                    $dictionary = array_merge($dictionary, $this->loadLanguageDirectory($dir.'/lang/'.$lang));
                }
            }

            $this->dictionaries[$lang] = $dictionary;
        }

        return $this->dictionaries[$lang];
    }

    /**
     * [addBaseDirectory description]
     *
     * @param [type]  $p        [description]
     * @param integer $priority [description]
     *
     * @return [type] [description]
     */
    public function addBaseDirectory($p, $priority = 0)
    {
        $this->baseDirectories[$priority][] = $p;
    }
}


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

#include "pass_fixture.h"
#include "pass_utils.h"

namespace {

using namespace spvtools;

// A pass turning all none debug line instructions into Nop.
class NopifyPass : public opt::Pass {
 public:
  const char* name() const override { return "NopifyPass"; }
  Status Process(ir::Module* module) override {
    bool modified = false;
    module->ForEachInst(
        [&modified](ir::Instruction* inst) {
          inst->ToNop();
          modified = true;
        },
        /* run_on_debug_line_insts = */ false);
    return modified ? Status::SuccessWithChange : Status::SuccessWithoutChange;
  }
};

using PassTestForLineDebugInfo = PassTest<::testing::Test>;

// This test's purpose to show our implementation choice: line debug info is
// preserved even if the following instruction is killed. It serves as a guard
// of potential behavior changes.
TEST_F(PassTestForLineDebugInfo, KeepLineDebugInfo) {
  // clang-format off
  const char* text =
               "OpCapability Shader "
          "%1 = OpExtInstImport \"GLSL.std.450\" "
               "OpMemoryModel Logical GLSL450 "
               "OpEntryPoint Vertex %2 \"main\" "
          "%3 = OpString \"minimal.vert\" "
               "OpNoLine "
               "OpLine %3 10 10 "
       "%void = OpTypeVoid "
               "OpLine %3 100 100 "
          "%5 = OpTypeFunction %void "
          "%2 = OpFunction %void None %5 "
               "OpLine %3 1 1 "
               "OpNoLine "
               "OpLine %3 2 2 "
               "OpLine %3 3 3 "
          "%6 = OpLabel "
               "OpLine %3 4 4 "
               "OpNoLine "
               "OpReturn "
               "OpLine %3 4 4 "
               "OpNoLine "
               "OpFunctionEnd ";
  // clang-format on

  const char* result_keep_nop =
      "OpNop\n"
      "OpNop\n"
      "OpNop\n"
      "OpNop\n"
      "OpNop\n"
      "OpNoLine\n"
      "OpLine %3 10 10\n"
      "OpNop\n"
      "OpLine %3 100 100\n"
      "OpNop\n"
      "OpNop\n"
      "OpLine %3 1 1\n"
      "OpNoLine\n"
      "OpLine %3 2 2\n"
      "OpLine %3 3 3\n"
      "OpNop\n"
      "OpLine %3 4 4\n"
      "OpNoLine\n"
      "OpNop\n"
      "OpLine %3 4 4\n"
      "OpNoLine\n"
      "OpNop\n";
  SinglePassRunAndCheck<NopifyPass>(text, result_keep_nop,
                                    /* skip_nop = */ false);
  const char* result_skip_nop =
      "OpNoLine\n"
      "OpLine %3 10 10\n"
      "OpLine %3 100 100\n"
      "OpLine %3 1 1\n"
      "OpNoLine\n"
      "OpLine %3 2 2\n"
      "OpLine %3 3 3\n"
      "OpLine %3 4 4\n"
      "OpNoLine\n"
      "OpLine %3 4 4\n"
      "OpNoLine\n";
  SinglePassRunAndCheck<NopifyPass>(text, result_skip_nop,
                                    /* skip_nop = */ true);
}

}  // anonymous namespace


text:
import datetime
from sqlalchemy import *

# http://docs.sqlalchemy.org/en/latest/dialects/postgresql.html#sqlalchemy.dialects.postgresql.JSONB
from sqlalchemy.ext.mutable import MutableDict
from sqlalchemy.dialects.postgresql import JSONB

from follows.db import Base

class Item(Base):
    __tablename__ = 'items'

    id = Column(String(32), primary_key=True)
    data = Column(MutableDict.as_mutable(JSONB(none_as_null=True)))
    created_by = Column(String(32)) # uuid4
    created_ts = Column(DateTime, default=datetime.datetime.now)
    updated_ts = Column(DateTime, default=datetime.datetime.now, onupdate=datetime.datetime.now)


text:
/* eslint-env jest, node */
/* eslint no-sync: "off" */

import fs from 'fs';
import path from 'path';

import { reducer } from '../reducer';
import { restoreActions } from '../actions';
import { commitToServer } from '../server';
import '../components/aws-cloud-credentials';
import '../components/aws-cluster-info';
import '../components/aws-submit-keys';
import '../components/aws-vpc';
import '../components/bm-credentials';
import '../components/bm-hostname';
import '../components/bm-matchbox';
import '../components/bm-nodeforms';
import '../components/bm-sshkeys';
import '../components/certificate-authority';
import '../components/cluster-type';
import '../components/nodes';
import '../components/users';

const structureOnly = (obj) => {
  const toString = Object.prototype.toString;

  if (toString.call(obj) === '[object Object]') {
    const ret = {};
    Object.keys(obj).forEach(k => {
      ret[k] = structureOnly(obj[k]);
    });
    return ret;
  }

  if (Array.isArray(obj)) {
    return [];
  }

  return '';
};

const initialState = reducer(undefined, {type: 'Some Initial Action'});

const tests = [
  {
    description: 'works with bare metal',
    expected: 'metal-out.json',
    state: 'metal-in.json',
  },
  {
    description: 'works with AWS',
    expected: 'aws-custom-vpc-out.json',
    state: 'aws-custom-vpc-in.json',
  },
  {
    description: 'works with AWS (existing VPC)',
    expected: 'aws-existing-vpc-out.json',
    state: 'aws-existing-vpc-in.json',
  },
];

let dispatch;

beforeEach(() => {
  dispatch = jest.fn();
});

const readExample = filename => {
  let json;
  try {
    json = JSON.parse(fs.readFileSync(path.resolve(__dirname, `examples/${filename}`), 'utf8'));
  } catch (e) {
    console.warn(`${filename} is not json`);
    throw e;
  }
  return json;
};

/* eslint-disable max-nested-callbacks */
describe('progress file example', () => {
  tests.forEach(t => {
    it(t.description, () => {
      const restored = reducer(initialState, restoreActions.restore(readExample(t.state)));

      global.fetch = jest.fn(() => Promise.resolve({
        ok: true,
        blob: () => Promise.resolve('success'),
        text: () => Promise.reject('failed'),
        json: () => Promise.resolve({}),
      }));

      // TODO: wait for this action to finish & then check expected state
      commitToServer(false, false)(dispatch, () => restored);

      expect(fetch.mock.calls.length).toBe(1);
      const body = JSON.parse(fetch.mock.calls[0][1].body);

      expect(readExample(t.expected)).toEqual(body);
    });
  });
});
/* eslint-enable max-nested-callbacks */


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

    <TITLE>
        DebugSampler (Apache JMeter API)
    </TITLE>

    <META NAME="keywords" CONTENT="org.apache.jmeter.sampler.DebugSampler class">

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

                    Overview
                    Package
                      Class

                    Tree

                    Deprecated
                    Index
                    Help

            Apache JMeter

             PREV CLASS
             NEXT CLASS

            FRAMES
             NO FRAMES

                All Classes

            SUMMARY: NESTED | FIELD | CONSTR | METHOD

            DETAIL: FIELD | CONSTR | METHOD

        org.apache.jmeter.sampler

    Class DebugSampler

java.lang.Object
  org.apache.jmeter.testelement.AbstractTestElement
      org.apache.jmeter.samplers.AbstractSampler
          org.apache.jmeter.sampler.DebugSampler

All Implemented Interfaces:

Cloneable, Sampler,
        Serializable, TestBean, TestElement

public class DebugSampler

extends AbstractSampler

implements TestBean

    The Debug Sampler can be used to "sample" JMeter variables, JMeter properties and System Properties.

See Also:

Serialized Form

            Field Summary

        Fields inherited from interface org.apache.jmeter.testelement.TestElement

        COMMENTS, ENABLED, GUI_CLASS, NAME, TEST_CLASS

            Constructor Summary

        DebugSampler()

            Method Summary

             boolean
        isDisplayJMeterProperties()

             boolean
        isDisplayJMeterVariables()

             boolean
        isDisplaySystemProperties()

             SampleResult
        sample(Entry e)

                      Obtains statistics about the given Entry, and
            packages the information
            into a SampleResult.

             void
        setDisplayJMeterProperties(boolean displayJMeterPropterties)

             void
        setDisplayJMeterVariables(boolean displayJMeterVariables)

             void
        setDisplaySystemProperties(boolean displaySystemProperties)

        Methods inherited from class org.apache.jmeter.testelement.AbstractTestElement

        addProperty,
            addTestElement,
            canRemove, clear, clearTemporary,
            clone, emptyTemporary,
            equals,
            getComment, getName, getProperty,
            getPropertyAsBoolean,
            getPropertyAsBoolean,
            getPropertyAsDouble,
            getPropertyAsFloat,
            getPropertyAsInt,
            getPropertyAsInt,
            getPropertyAsLong,
            getPropertyAsString,
            getPropertyAsString,
            getThreadContext,
            getThreadName,
            hashCode, isEnabled,
            isRunningVersion,
            isTemporary,
            logProperties,
            mergeIn,
            propertyIterator,
            recoverRunningVersion,
            removeProperty,
            setComment,
            setName,
            setProperty,
            setProperty,
            setProperty,
            setProperty,
            setProperty,
            setProperty,
            setProperty,
            setRunningVersion,
            setTemporary,
            setThreadContext,
            setThreadName,
            traverse,
            traverseCollection,
            traverseMap,
            traverseProperty

        Methods inherited from class java.lang.Object

        finalize, getClass, notify, notifyAll, toString, wait, wait, wait

        Methods inherited from interface org.apache.jmeter.testelement.TestElement

        addTestElement,
            canRemove, clear, clone, getComment, getName, getProperty,
            getPropertyAsBoolean,
            getPropertyAsBoolean,
            getPropertyAsDouble,
            getPropertyAsFloat,
            getPropertyAsInt,
            getPropertyAsInt,
            getPropertyAsLong,
            getPropertyAsString,
            getPropertyAsString,
            getThreadContext,
            getThreadName, isEnabled, isRunningVersion,
            isTemporary,
            propertyIterator,
            recoverRunningVersion,
            removeProperty,
            setComment,
            setName,
            setProperty,
            setProperty,
            setProperty,
            setProperty,
            setProperty,
            setProperty,
            setProperty,
            setRunningVersion,
            setTemporary,
            setThreadContext,
            setThreadName,
            traverse

            Constructor Detail

    DebugSampler

public DebugSampler()

            Method Detail

    sample

public SampleResult sample(Entry e)

Description copied from interface: Sampler

Obtains statistics about the given Entry, and packages the information
        into a SampleResult.

Specified by:

sample
                in interface Sampler

    isDisplayJMeterVariables

public boolean isDisplayJMeterVariables()

    setDisplayJMeterVariables

public void setDisplayJMeterVariables(boolean displayJMeterVariables)

    isDisplayJMeterProperties

public boolean isDisplayJMeterProperties()

    setDisplayJMeterProperties

public void setDisplayJMeterProperties(boolean displayJMeterPropterties)

    isDisplaySystemProperties

public boolean isDisplaySystemProperties()

    setDisplaySystemProperties

public void setDisplaySystemProperties(boolean displaySystemProperties)

                    Overview
                    Package
                      Class

                    Tree

                    Deprecated
                    Index
                    Help

            Apache JMeter

             PREV CLASS
             NEXT CLASS

            FRAMES
             NO FRAMES

                All Classes

            SUMMARY: NESTED | FIELD | CONSTR | METHOD

            DETAIL: FIELD | CONSTR | METHOD

Copyright © 1998-2009 Apache Software Foundation. All Rights Reserved.


text:
package com.mytest.internet.result.body;

import com.google.gson.annotations.SerializedName;

/**
 * Created by Jason on 2016/11/28.
 */

public class UserLoginResultBody {

    @SerializedName("id")
    private int id;
    @SerializedName("last_name")
    private String last_name;
    @SerializedName("first_name")
    private String first_name;
    @SerializedName("birthday")
    private UserBirthdayTime birthday;
    @SerializedName("weight")
    private float weight;
    @SerializedName("length")
    private int length;
    @SerializedName("sex")
    private int sex;
    @SerializedName("last_longitude")
    private int last_longitude;
    @SerializedName("latitude")
    private int last_latitude;
    @SerializedName("email")
    private String email;
    @SerializedName("verified_email")
    private boolean verified_email;

    public int getId() {
        return id;
    }

    public void setId(int id) {
        this.id = id;
    }

    public String getLast_name() {
        return last_name;
    }

    public void setLast_name(String last_name) {
        this.last_name = last_name;
    }

    public String getFirst_name() {
        return first_name;
    }

    public void setFirst_name(String first_name) {
        this.first_name = first_name;
    }

    public UserBirthdayTime getBirthday() {
        return birthday;
    }

    public void setBirthday(UserBirthdayTime birthday) {
        this.birthday = birthday;
    }

    public float getWeight() {
        return weight;
    }

    public void setWeight(float weight) {
        this.weight = weight;
    }

    public int getLength() {
        return length;
    }

    public void setLength(int length) {
        this.length = length;
    }

    public int getSex() {
        return sex;
    }

    public void setSex(int sex) {
        this.sex = sex;
    }

    public int getLast_longitude() {
        return last_longitude;
    }

    public void setLast_longitude(int last_longitude) {
        this.last_longitude = last_longitude;
    }

    public int getLast_latitude() {
        return last_latitude;
    }

    public void setLast_latitude(int last_latitude) {
        this.last_latitude = last_latitude;
    }

    public String getEmail() {
        return email;
    }

    public void setEmail(String email) {
        this.email = email;
    }

    public boolean isVerified_email() {
        return verified_email;
    }

    public void setVerified_email(boolean verified_email) {
        this.verified_email = verified_email;
    }
}


text:
// <copyright file="JetConfigurationManagerTest.cs" company="Logikfabrik">
//   Copyright (c) 2016 anton(at)logikfabrik.se. Licensed under the MIT license.
// </copyright>

namespace Logikfabrik.Umbraco.Jet.Test.Configuration
{
    using Jet.Configuration;
    using Shouldly;
    using Xunit;

    public class JetConfigurationManagerTest
    {
        [Theory]
        [InlineData(SynchronizationModes.DataTypes)]
        [InlineData(SynchronizationModes.DocumentTypes)]
        [InlineData(SynchronizationModes.MediaTypes)]
        [InlineData(SynchronizationModes.MemberTypes)]
        public void CanGetDefaultSynchronizationMode(SynchronizationModes synchronize)
        {
            JetConfigurationManager.Synchronize.HasFlag(synchronize).ShouldBeTrue();
        }
    }
}


text:
<?php

namespace Mpociot\ApiDoc\Tests\Fixtures;

use Illuminate\Http\Request;
use Illuminate\Routing\Controller;

class TestController extends Controller
{
    public function dummy()
    {
        return '';
    }

    /**
     * Example title.
     * This will be the long description.
     * It can also be multiple lines long.
     */
    public function parseMethodDescription()
    {
        return '';
    }

    public function parseFormRequestRules(TestRequest $request)
    {
        return '';
    }

    public function addRouteBindingsToRequestClass(DynamicRequest $request)
    {
        return '';
    }

    public function checkCustomHeaders(Request $request)
    {
        return $request->headers->all();
    }

    public function fetchRouteResponse()
    {
        $fixture = new \stdClass();
        $fixture->id = 1;
        $fixture->name = 'banana';
        $fixture->color = 'red';
        $fixture->weight = 300;
        $fixture->delicious = 1;

        return [
            'id' => (int) $fixture->id,
            'name' => ucfirst($fixture->name),
            'color' => ucfirst($fixture->color),
            'weight' => $fixture->weight.' grams',
            'delicious' => (bool) $fixture->delicious,
        ];
    }

    public function dependencyInjection(DependencyInjection $dependency, TestRequest $request)
    {
        return '';
    }

    public function utf8()
    {
        return ['result' => 'Лорем ипсум долор сит амет'];
    }

    /**
     * @hideFromAPIDocumentation
     */
    public function skip()
    {
    }
}


text:
@interface IGIdenticon ()

+ (uint32_t)hashWithData:(NSData *)data;
+ (NSArray *)cellTypes;
+ (void)renderIdenticonCellOnContext:(CGContextRef)context position:(CGPoint)position size:(CGFloat)size cellType:(NSInteger)cellType turn:(NSInteger)turn isInvert:(BOOL)isInvert foregroundColor:(UIColor *)foregroundColor backgroundColor:(UIColor *)backgroundColor;

@end

@implementation IGIdenticon

+ (UIImage *)identiconWithString:(NSString *)string size:(CGFloat)size
{
	return [IGIdenticon identiconWithString:string size:size backgroundColor:nil];
}

+ (UIImage *)identiconWithString:(NSString *)string size:(CGFloat)size backgroundColor:(UIColor *)backgroundColor
{
	NSData *data = [string dataUsingEncoding:NSUTF8StringEncoding];

	return [IGIdenticon identiconWithData:data size:size backgroundColor:backgroundColor];
}

+ (UIImage *)identiconWithData:(NSData *)data size:(CGFloat)size
{
	return [IGIdenticon identiconWithData:data size:size backgroundColor:nil];
}

+ (UIImage *)identiconWithData:(NSData *)data size:(CGFloat)size backgroundColor:(UIColor *)backgroundColor
{
	uint32_t hash32 = [IGIdenticon hashWithData:data];

	return [IGIdenticon identiconWithUInt32:hash32 size:size backgroundColor:backgroundColor];
}

+ (UIImage *)identiconWithUInt32:(uint32_t)number size:(CGFloat)size
{
	return [IGIdenticon identiconWithUInt32:number size:size backgroundColor:nil];
}

+ (UIImage *)identiconWithUInt32:(uint32_t)number size:(CGFloat)size backgroundColor:(UIColor *)backgroundColor
{
	if (size <= 0)
	{
		return [UIImage new];
	}

	if (backgroundColor == nil) {
		backgroundColor = [UIColor whiteColor];
	}

	NSInteger middleCellType = [[[IGIdenticon centerCellTypes] objectAtIndex:(number & 3)] integerValue];
	BOOL middleIsInvert = ((number >> 2) & 1) != 0;

	NSInteger cornerCellType = (number >> 3) & 15;
	BOOL cornerIsInvert = ((number >> 7) & 1) != 0;
	BOOL cornerTurn = (number >> 8) & 3;

	NSInteger sideCellType = (number >> 10) & 15;
	BOOL sideIsInvert = ((number >> 14) & 1) != 0;
	BOOL sideTurn = (number >> 15) & 3;

	NSInteger blue = (number >> 16) & 31;
	NSInteger green = (number >> 21) & 31;
	NSInteger red = (number >> 27) & 31;
	UIColor *foregroundColor = [UIColor colorWithRed:(red * 8) / 255.0f green:(green * 8) / 255.0f blue:(blue * 8) / 255.0f alpha:1];

	UIGraphicsBeginImageContextWithOptions(CGSizeMake(size, size), NO, [[UIScreen mainScreen] scale]);
	CGContextRef imageContext = UIGraphicsGetCurrentContext();

	NSUInteger cellSize = (NSUInteger)(size + 0.5f) / 4;

	// middle cell
	[IGIdenticon renderIdenticonCellOnContext:imageContext position:CGPointMake(cellSize, cellSize) size:cellSize cellType:middleCellType turn:0 isInvert:middleIsInvert foregroundColor:foregroundColor backgroundColor:backgroundColor];
	[IGIdenticon renderIdenticonCellOnContext:imageContext position:CGPointMake(cellSize, cellSize * 2) size:cellSize cellType:middleCellType turn:0 isInvert:middleIsInvert foregroundColor:foregroundColor backgroundColor:backgroundColor];
	[IGIdenticon renderIdenticonCellOnContext:imageContext position:CGPointMake(cellSize * 2, cellSize * 2) size:cellSize cellType:middleCellType turn:0 isInvert:middleIsInvert foregroundColor:foregroundColor backgroundColor:backgroundColor];
	[IGIdenticon renderIdenticonCellOnContext:imageContext position:CGPointMake(cellSize * 2, cellSize) size:cellSize cellType:middleCellType turn:0 isInvert:middleIsInvert foregroundColor:foregroundColor backgroundColor:backgroundColor];

	// side patchs, starting from top and moving clock-wise
	[IGIdenticon renderIdenticonCellOnContext:imageContext position:CGPointMake(cellSize, 0) size:cellSize cellType:sideCellType turn:sideTurn++ isInvert:sideIsInvert foregroundColor:foregroundColor backgroundColor:backgroundColor];
	[IGIdenticon renderIdenticonCellOnContext:imageContext position:CGPointMake(cellSize * 3, cellSize) size:cellSize cellType:sideCellType turn:sideTurn++ isInvert:sideIsInvert foregroundColor:foregroundColor backgroundColor:backgroundColor];
	[IGIdenticon renderIdenticonCellOnContext:imageContext position:CGPointMake(cellSize * 2, cellSize * 3) size:cellSize cellType:sideCellType turn:sideTurn++ isInvert:sideIsInvert foregroundColor:foregroundColor backgroundColor:backgroundColor];
	[IGIdenticon renderIdenticonCellOnContext:imageContext position:CGPointMake(0, cellSize * 2) size:cellSize cellType:sideCellType turn:sideTurn++ isInvert:sideIsInvert foregroundColor:foregroundColor backgroundColor:backgroundColor];
	[IGIdenticon renderIdenticonCellOnContext:imageContext position:CGPointMake(0, cellSize) size:cellSize cellType:sideCellType turn:sideTurn++ isInvert:sideIsInvert foregroundColor:foregroundColor backgroundColor:backgroundColor];
	[IGIdenticon renderIdenticonCellOnContext:imageContext position:CGPointMake(cellSize * 2, 0) size:cellSize cellType:sideCellType turn:sideTurn++ isInvert:sideIsInvert foregroundColor:foregroundColor backgroundColor:backgroundColor];
	[IGIdenticon renderIdenticonCellOnContext:imageContext position:CGPointMake(cellSize * 3, cellSize * 2) size:cellSize cellType:sideCellType turn:sideTurn++ isInvert:sideIsInvert foregroundColor:foregroundColor backgroundColor:backgroundColor];
	[IGIdenticon renderIdenticonCellOnContext:imageContext position:CGPointMake(cellSize, cellSize * 3) size:cellSize cellType:sideCellType turn:sideTurn++ isInvert:sideIsInvert foregroundColor:foregroundColor backgroundColor:backgroundColor];

	// corner patchs, starting from top left and moving clock-wise
	[IGIdenticon renderIdenticonCellOnContext:imageContext position:CGPointMake(0, 0) size:cellSize cellType:cornerCellType turn:cornerTurn++ isInvert:cornerIsInvert foregroundColor:foregroundColor backgroundColor:backgroundColor];
	[IGIdenticon renderIdenticonCellOnContext:imageContext position:CGPointMake(cellSize * 3, 0) size:cellSize cellType:cornerCellType turn:cornerTurn++ isInvert:cornerIsInvert foregroundColor:foregroundColor backgroundColor:backgroundColor];
	[IGIdenticon renderIdenticonCellOnContext:imageContext position:CGPointMake(cellSize * 3, cellSize * 3) size:cellSize cellType:cornerCellType turn:cornerTurn++ isInvert:cornerIsInvert foregroundColor:foregroundColor backgroundColor:backgroundColor];
	[IGIdenticon renderIdenticonCellOnContext:imageContext position:CGPointMake(0, cellSize * 3) size:cellSize cellType:cornerCellType turn:cornerTurn++ isInvert:cornerIsInvert foregroundColor:foregroundColor backgroundColor:backgroundColor];

	UIImage *identicon = UIGraphicsGetImageFromCurrentImageContext();
	UIGraphicsEndImageContext();

	return identicon;
}

#pragma mark - private metods

+ (uint32_t)hashWithData:(NSData *)data
{
	const char *bytesArray = [data bytes];
	unsigned char hashBuffer[CC_MD4_DIGEST_LENGTH];
	CC_MD4(bytesArray, data.length, hashBuffer);

	uint32_t hash32 = 0;
	hash32 |= (uint32_t)hashBuffer[0];
	hash32 |= ((uint32_t)hashBuffer[1]) << 8u;
	hash32 |= ((uint32_t)hashBuffer[2]) << 16u;
	hash32 |= ((uint32_t)hashBuffer[3]) << 24u;

	return hash32;
}

+ (NSArray *)cellTypes
{
	NSArray *cellTypes = @[
                           @[@0, @4, @24, @20],
                           @[@0, @4, @20],
                           @[@2, @24, @20],
                           @[@0, @2, @20, @22],
                           @[@2, @14, @22, @10],
                           @[@0, @14, @24, @22],
                           @[@2, @24, @22, @13, @11, @22, @2],
                           @[@0, @14, @22],
                           @[@6, @8, @18, @16],
                           @[@4, @20, @10, @12, @2],
                           @[@0, @2, @12, @10],
                           @[@10, @14, @22],
                           @[@20, @12, @24],
                           @[@10, @2, @12],
                           @[@0, @2, @10],
                           @[@0, @4, @24, @20]
                           ];

	return cellTypes;
}

+ (NSArray *)centerCellTypes
{
	return @[@0, @4, @8, @15];
}

+ (void)renderIdenticonCellOnContext:(CGContextRef)context position:(CGPoint)position size:(CGFloat)size cellType:(NSInteger)cellType turn:(NSInteger)turn isInvert:(BOOL)isInvert foregroundColor:(UIColor *)foregroundColor backgroundColor:(UIColor *)backgroundColor
{
	NSArray *cellTypes = [IGIdenticon cellTypes];

	cellType = cellType % cellTypes.count;
	turn = turn % 4;
	if (cellType == 15) {
		isInvert = !isInvert;
	}

	NSArray *vertices = [cellTypes objectAtIndex:cellType];
	CGFloat offset = size / 2.0f;
	CGFloat scale = size / 4.0f;

	CGContextSaveGState(context);

	// paint background
	UIColor *fillColor = isInvert ? foregroundColor : backgroundColor;
	CGContextSetFillColorWithColor(context, fillColor.CGColor);
	CGContextFillRect(context, CGRectMake(position.x, position.y, size, size));

	// build patch path
	CGContextTranslateCTM(context, position.x + offset, position.y + offset);
	CGContextRotateCTM(context, turn * M_PI / 2);

	CGMutablePathRef path = CGPathCreateMutable();

	CGPoint vertice;
	vertice.x = [[vertices objectAtIndex:0] integerValue] % 5 * scale - offset;
	vertice.y = (NSInteger)([[vertices objectAtIndex:0] integerValue] / 5) * scale - offset;
	CGPathMoveToPoint(path, NULL, vertice.x, vertice.y);

	for (NSNumber *verticleNumber in vertices) {
		vertice.x = ([verticleNumber integerValue] % 5) * scale - offset;
		vertice.y = ([verticleNumber integerValue] / 5) * scale - offset;
		CGPathAddLineToPoint(path, NULL, vertice.x, vertice.y);
	}
	CGPathCloseSubpath(path);

	CGContextAddPath(context, path);

	fillColor = isInvert ? backgroundColor : foregroundColor;
	CGContextSetFillColorWithColor(context, fillColor.CGColor);
	CGContextDrawPath(context, kCGPathFill);

	CGPathRelease(path);

	CGContextRestoreGState(context);
}

@end


text:
from flask import url_for, g
from common.base import EPBase
from service.resources.authentication import auth
from common.db import TDepartment

class EPDepartment(EPBase):
    @auth.login_required
    def get(self):
        department = []
        try:
            for dep in self.session.query(TDepartment).\
                    order_by(TDepartment.nazwa.asc()).\
                    all():
                department.append(
                    {'id': dep.wydzial_id,
                     'name': dep.nazwa})
        finally:
            self.session.close()
        if len(department):
            uri = url_for('EPAnnounceConst'.lower(), id=department[0]['id'], limit=10, offset=0)
        else:
            uri = url_for('EPAnnounceConst'.lower(), id=0, limit=10, offset=0)
        return super(EPDepartment, self).get(
            {'department': department,
             'uri': uri})


text:
# CodesWholesale PHP SDK
CodesWholesale.com is an API-driven wholesale platform for digital game distribution. This is the CodesWholesale SDK for PHP that will enable developers to easily integrate API with any PHP-based application.

## Installation
You can install **codeswholesale-sdk-php** via Composer or by downloading the source.

### Via Composer:

**codeswholesale-sdk-php** is available on Packagist as the [codeswholesale/sdk](https://packagist.org/packages/codeswholesale/sdk) package.

Install Composer on your project root

    curl -sS https://getcomposer.org/installer | php

Or download it from official page: https://getcomposer.org/download/

Configure the **codeswholesale/sdk** dependency in your 'composer.json' file:

    "require": {
        "codeswholesale/sdk": "2.1"
    }

Install the latest SDK with its dependencies on your project root

    php composer.phar install

## Create your CodesWholesale account

If you don't have an account yet, sign up at
[CodesWholesale](https://app.codeswholesale.com) and set up your API credentials:

1. Create a [CodesWholesale](https://app.codeswholesale.com) account and
   create your API keys in WEB API tab, under your profile name link. Save your keys in safe place. Your API password is visible only once.

### Getting Started

1.  **Require the CodesWholesale PHP SDK** via the composer auto loader

    ```php
    require 'vendor/autoload.php';
    ```

2.  **Configure the client** using the API keys

    ```php

    $params = [
       /**
        * API Keys
        * These are test api keys that can be used for testing your integration:
        */
        'cw.client_id' => 'ff72ce315d1259e822f47d87d02d261e',
        'cw.client_secret' => '$2a$10$E2jVWDADFA5gh6zlRVcrlOOX01Q/HJoT6hXuDMJxek.YEo.lkO2T6',
        /**
         * CodesWholesale ENDPOINT
         */
        'cw.endpoint_uri' => \CodesWholesale\CodesWholesale::SANDBOX_ENDPOINT,
        /**
         * Due to security reasons, you should use SessionStorage only while testing.
         * In order to go live, you should change it to database storage.
        */
        'cw.token_storage' => new \CodesWholesale\Storage\TokenSessionStorage()
    ];

    $clientBuilder = new \CodesWholesale\ClientBuilder($params);
    $client = $clientBuilder->build();

    ```
For production release, please remember to switch from SANDBOX endpoint to LIVE endpoint.

3.  **List all available platforms, regions, languages on the CodesWholesale platform**

    ```php
    $platforms = $client->getPlatforms()
    $regions   = $client->getRegions();
    $languages = $client->getLanguages();
    ```

4.  **List all products from the price list**

    ```php
    $products = $client->getProducts();
    foreach($products as $product) {
        $product->getName(); // the name of product
        $product->getStockQuantity(); // current stock quantity
        $product->getImageUrl(ImageType::SMALL) // product image url
    }
    ```

5.  **List all products from price list by language/platform/region**

    ```php
     $products = $client->getProducts([
           "language" => [
               "Multilanguage",
               "fr"
            ],
            "platform" => [
                "Steam"
            ],
            "region" => [
                "WORLDWIDE"
            ]
        ]);

    foreach($products as $product) {
        $product->getName(); // the name of product
        $product->getStockQuantity(); // current stock quantity
        $product->getImageUrl(ImageType::SMALL) // product image url
    }
    ```

6.  **List all products from price list from the last 60 days**

    ```php
    $products = $client->getProducts([
        "inStockDaysAgo" => 60
    ]);

    foreach($products as $product) {
        $product->getName(); // the name of product
        $product->getStockQuantity(); // current stock quantity
        $product->getImageUrl(ImageType::SMALL) // product image url
    }
    ```

7.  **Fetch invoice for your order**

    ```php
    $orderInvoice = Invoice::get($createdOrder->getOrderId());
    $invoicePath = Base64Writer::writeInvoice($orderInvoice, "./invoices");
    ```

8.  **Screen your customer before completing order**

    ```php
    $securityInformation = Security::check(
        "devteam@codeswholesale.com",
        "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_10_4) AppleWebKit/600.7.12 (KHTML, like Gecko) Version/8.0.7 Safari/600.7.12",
        "devteam-payment@codeswholesale.com",
        "81.90.190.200"
    );

    $ipBlacklisted = $security->isIpBlacklisted();
    $torIp = $security->isTorIp();
    $domainBlackListed = $security->isDomainBlacklisted();
    $subdomain = $security->isSubDomain();
    ```

9.  **Check your order history**

    ```php
    $orders = Order::getHistory("2017-12-11", "2017-12-12");

    foreach ($orderList as $order) {
        $order->getOrderId();
        $order->getClientOrderId();
        $order->getTotalPrice() ;
        $order->getStatus();
        $order->getCreatedOn();
    }
    ```

10.  **Single product details**

    ```php
    $product = \CodesWholesale\Resource\Product::get($productHref);
    ```

11.  **Retrieve product description**

    ```php
    $productDescription = \CodesWholesale\Resource\ProductDescription::get($product->getDescriptionHref());

    $productDescription->getLocalizedTitles(); // localized titles
    $productDescription->getPegiRating(); // pegi rating
    $productDescription->getPlatform(); // platform such as PC/Mac
    $productDescription->getFactSheets(); // description in different langauges
    $productDescription->getReleases(); // release dates
    $productDescription->getEditions(); // editions
    $productDescription->getDeveloperHomepage(); // game developer homepage
    $productDescription->getKeywords(); // keywords
    $productDescription->getGameLanguages(); // languages
    $productDescription->getOfficialTitle(); // official title
    $productDescription->getDeveloperName(); // game developer name
    $productDescription->getEanCodes(); // EAN codes
    $productDescription->getLastUpdate(); // last game update
    $productDescription->getCategory(); // category of game
    $productDescription->getPhotos(); // urls photo
    $productDescription->getExtensionPacks(); // extension packs
    $productDescription->getVideos(); // urls video
    $productDescription->getProductId(); // product id
    ```

12.  **Retrieve account details, balance value and available credit**

    ```php
    $account = $client->getAccount();
    $account->getFullName(); // name of account
    $account->getEmail(); // email
    $account->getTotalToUse(); // total money to use, balance + credit
    $account->getCurrentBalance(); // current balance value
    $account->getCurrentCredit(); // current credit value
    ```

13.  **Create order**

    ```php
    $createdOrder = Order::createOrder(
            [
                [
                    "productId" => "6313677f-5219-47e4-a067-7401f55c5a3a",
                    "quantity" => "2",
                ],
            ], null);

    foreach ($createdOrder->getProducts() as $product) {

         $product->getProductId();
         $product->getUnitPrice();

         foreach ($product->getCodes() as $code) {
              $code->getCodeId();

              if ($code->isPreOrder()) {
                  echo "<b>Code has been pre-ordered!</b>" . " <br>";
              }

              if ($code->isText()) {
                  echo "Text code to use: <b>" . $code->getCode() . "</b><br>";
              }

              if ($code->isImage()) {
                  $fullPath = \CodesWholesale\Util\Base64Writer::writeImageCode($code, "./my-codes");
                  echo "Product has been saved in <b>" . $fullPath . "</b><br>";
              }
         }
    }
    ```

14.  **Receive notifications about product changes via Codeswholesale postback request**

     To receive notifications from CodesWholesale, first you have to configure your postback URL that will be responsible for handling CodesWholesale requests. In order to do that, follow these steps:

    - Sign in to [CodesWholesale](https://app.codeswholesale.com/)
    - Go to API tab
    - Configure and test your post back url

    If the URL has been successfully configured, you should be able to handle CodesWholesale requests as follow

    ```php
    $client->registerStockAndPriceChangeHandler(function (array $stockAndPriceChanges) {
        foreach ($stockAndPriceChanges as $stockAndPriceChange) {
            /**
             * Here you can save changes to your database
             *
             * @var StockAndPriceChange $stockAndPriceChange
             */
            echo $stockAndPriceChange->getProductId();
            echo $stockAndPriceChange->getQuantity();

            $prices = $stockAndPriceChange->getPrices();

            foreach ($prices as $price) {
                /**
                 * @var Price $price
                 */
                echo $price->getRange();
                echo $price->getValue();
            }

            echo "<hr>";
        }
    });

    $client->registerHidingProductHandler(function (Notification $notification) {
        /**
         * Here you can request for product which was hidden or just hide it
         * using provided productId
         */
        echo $notification->getProductId();
    });

    $client->registerPreOrderAssignedHandler(function (AssignedPreOrder $notification) {
        /**
         * Here you can request for ordered product using productId
         */
        echo $notification->getOrderId();
    });

    $client->registerUpdateProductHandler(function (Notification $notification) {
        /**
         * Here you can request product which was updated.
         * It can be image, name or other product parameter.
         */
        echo $notification->getProductId();
    });

    $client->registerNewProductHandler(function(Notification $notification) {
        /**
         * Here you can request product which was updated.
         * It can be image, name or other product parameter.
         */
        echo $notification->getProductId();
    });

    $client->handle(SIGNATURE);
    ```
 If you send test request from the API tab and your script is configured to work with sandbox environment, it will download ten fake images.

You can check "examples" directory for more samples and details.

## Copyright & Licensing

Copyright © 2014 Codeswholesale

This project is licensed under the [Apache 2.0 Open Source License](http://www.apache.org/licenses/LICENSE-2.0).

For additional information, please see:

  1.  fkooman OAuth2 client: https://github.com/fkooman/php-oauth-client


text:
import React from 'react';
import styles from '../styles/app.scss';
import { Motion, spring } from 'react-motion';

const AppHeader = () =>
    <Motion defaultStyle={{ y: -40 }} style={{ y: spring(0) }}>
    {intStyle =>

ERP Lite

    }
    </Motion>;

export default AppHeader;


text:
<!DOCTYPE html>

    <meta charset="UTF-8" />
    <title>JavaScript Prettifier</title>
    <link rel="stylesheet" type="text/css" href="style.css" />

JavaScript Prettifier

      Parses the code with
      Acorn and prints it with
      Astring.

    <textarea
      id="console"
      rows="10"
      placeholder="Type your code here"
      spellcheck="false"
    ></textarea>

      <input type="checkbox" id="comments" /> Include comments
      <input
          type="number"
          id="indentation"
          value="2"
          min="0"
          step="1"
          style="width: 3em"
        />
        Indentation spaces
      <input type="checkbox" id="ast" /> Only show the AST
      <button id="setlink">Set link</button>


text: void LoadCnf(int *wff, VariableID nvarsptr, int nclausesptr, VariableID ** dataptr);


text:
/*	$OpenBSD: siop_pci.c,v 1.2 2001/03/01 17:14:28 krw Exp $ */
/*	$NetBSD: siop_pci.c,v 1.8 2000/05/15 07:53:17 bouyer Exp $	*/

/*
 * Copyright (c) 2000 Manuel Bouyer.
 *
 * Redistribution and use in source and binary forms, with or without
 * modification, are permitted provided that the following conditions
 * are met:
 * 1. Redistributions of source code must retain the above copyright
 *    notice, this list of conditions and the following disclaimer.
 * 2. Redistributions in binary form must reproduce the above copyright
 *    notice, this list of conditions and the following disclaimer in the
 *    documentation and/or other materials provided with the distribution.
 * 3. All advertising materials mentioning features or use of this software
 *    must display the following acknowledgement:
 *	This product includes software developed by Manuel Bouyer
 * 4. The name of the author may not be used to endorse or promote products
 *    derived from this software without specific prior written permission.
 *
 * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR
 * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
 * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
 * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
 * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
 * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
 * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
 * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
 * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
 */

/* SYM53c8xx PCI-SCSI I/O Processors driver: PCI front-end */

#include <sys/param.h>
#include <sys/systm.h>
#include <sys/device.h>
#include <sys/kernel.h>

#include <dev/pci/pcireg.h>
#include <dev/pci/pcivar.h>

#include <scsi/scsi_all.h>
#include <scsi/scsiconf.h>

#include <dev/ic/siopvar.h>
#include <dev/pci/siop_pci_common.h>

int     siop_pci_match __P((struct device *, void *, void *));
void    siop_pci_attach __P((struct device *, struct device *, void *));

struct cfattach siop_pci_ca = {
	sizeof(struct siop_pci_softc), siop_pci_match, siop_pci_attach
};

int
siop_pci_match(parent, match, aux)
	struct device *parent;
	void *match;
	void *aux;
{
	struct pci_attach_args *pa = aux;
	const struct siop_product_desc *pp;

	/* see if it's a known product */
	pp = siop_lookup_product(pa->pa_id, PCI_REVISION(pa->pa_class));
	if (pp)
		return 1;
	return 0;
}

void
siop_pci_attach(parent, self, aux)
	struct device *parent, *self;
	void *aux;
{
	struct pci_attach_args *pa = aux;
	struct siop_pci_softc *sc = (struct siop_pci_softc *)self;

	if (siop_pci_attach_common(sc, pa) == 0)
		return;

	siop_attach(&sc->siop);
}


text:
require 'spec_helper'

RSpec.describe 'DSL - Transfers - Generic' do
  let(:client)        { setup_client }
  let(:client_id)     { 'client-id' }
  let(:client_secret) { 'client-secret' }

  let(:request_headers) do
    { 'X-Something' => '42' }
  end

  before do
    client.config.environment = FidorApi::Environment::Future.new
  end

  describe '#transfers' do
    before do
      stub_fetch_request(
        endpoint:      %r{/transfers},
        response_body: [
          { id: '92bf870d-d914-4757-8691-7f8092a77e0e' },
          { id: 'ff5ac034-6cd1-4740-b582-dada99ed0257' }
        ]
      )
    end

    it 'returns an array of internal-transfer objects' do
      transfers = client.transfers
      expect(transfers).to be_instance_of FidorApi::Collection

      transfer = transfers.first
      expect(transfer).to be_instance_of FidorApi::Model::Transfer::Generic
      expect(transfer.id).to eq '92bf870d-d914-4757-8691-7f8092a77e0e'
    end
  end

  describe '#transfer' do
    before do
      stub_fetch_request(
        endpoint:      %r{/transfers/92bf870d-d914-4757-8691-7f8092a77e0e},
        response_body: { id: '92bf870d-d914-4757-8691-7f8092a77e0e' }
      )
    end

    it 'returns an array of internal-transfer objects' do
      transfer = client.transfer '92bf870d-d914-4757-8691-7f8092a77e0e'
      expect(transfer).to be_instance_of FidorApi::Model::Transfer::Generic
      expect(transfer.id).to eq '92bf870d-d914-4757-8691-7f8092a77e0e'
    end
  end

  describe '#new_transfer' do
    let(:subject) { 'Hello World' }

    it 'returns a new instance of the internal-transfer model' do
      transfer = client.new_transfer(subject: subject)
      expect(transfer).to be_instance_of FidorApi::Model::Transfer::Generic
      expect(transfer.subject).to eq subject
    end
  end

  describe '#create_transfer' do
    let(:subject)         { 'Hello World' }
    let(:confirmable_url) { 'https://api.example.com/confirmable/actions/15fcc0cb-b741-4e96-b4bf-bb5b2ce79609' }

    context 'when the api accepts the transfer' do
      before do
        stub_create_request(
          endpoint:         %r{/transfers},
          request_headers:  request_headers,
          response_body:    { id: '92bf870d-d914-4757-8691-7f8092a77e0e' },
          response_headers: { 'Location' => '', 'X-Fidor-Confirmation-Path' => confirmable_url }
        )
      end

      it 'assigns the id attribute' do
        transfer = client.create_transfer({ subject: subject }, headers: request_headers)
        expect(transfer).to be_instance_of FidorApi::Model::Transfer::Generic
        expect(transfer.id).to eq '92bf870d-d914-4757-8691-7f8092a77e0e'
      end

      it 'assigns the confirmable_action_attribute' do
        transfer = client.create_transfer({ subject: subject }, headers: request_headers)
        expect(transfer.confirmable_action_id).to eq '15fcc0cb-b741-4e96-b4bf-bb5b2ce79609'
      end
    end

    context 'when the api rejects the transfer' do
      before do
        stub_create_request(endpoint: %r{/transfers}, response_body: errors, status: 422)
      end

      let(:errors) do
        {
          'status' => '422',
          'errors' => [
            { 'field' => 'base', 'message' => 'Something went wrong' },
            { 'field' => 'amount', 'key' => 'invalid' }
          ]
        }
      end

      it 'assigns the errors' do
        transfer = client.create_transfer(subject: subject)
        expect(transfer).to be_instance_of FidorApi::Model::Transfer::Generic
        expect(transfer.errors.full_messages).to eq [
          'Something went wrong',
          'Amount is invalid'
        ]
      end
    end
  end

  describe '#update_transfer' do
    let(:subject) { 'Hello World' }

    context 'when the api accepts the transfer' do
      before do
        stub_update_request(
          endpoint:        %r{/transfers/92bf870d-d914-4757-8691-7f8092a77e0e},
          request_headers: request_headers,
          response_body:   { id: '92bf870d-d914-4757-8691-7f8092a77e0e' }
        )
      end

      it 'returns the updated object' do
        transfer = client.update_transfer('92bf870d-d914-4757-8691-7f8092a77e0e', { subject: subject }, headers: request_headers)
        expect(transfer).to be_instance_of FidorApi::Model::Transfer::Generic
        expect(transfer.subject).to eq subject
      end
    end
  end

  describe '#confirm_transfer' do
    before do
      stub_update_request(
        endpoint:         %r{/transfers/92bf870d-d914-4757-8691-7f8092a77e0e/confirm},
        request_headers:  request_headers,
        response_headers: { 'Location' => location },
        status:           303
      )
    end

    let(:location) { 'https://auth.example.com/confirmable/eb5e8e0d-4611-4124-a1c5-f0b1afad250b' }

    it 'returns the value from the location header' do
      return_value = client.confirm_transfer('92bf870d-d914-4757-8691-7f8092a77e0e', headers: request_headers)
      expect(return_value).to eq location
    end
  end
end


text:
"""
Test with a live instance
"""

from flask_testing import LiveServerTestCase

from knowhow import create_app, db

class LiveServerBase(LiveServerTestCase):
    def create_app(self):
        app = create_app('testing')
        app.config['LIVESERVER_PORT'] = 8943
        return app

    def setUp(self):
        self.app = self.create_app()
        self.client = self.app.test_client()
        self.app_context = self.app.app_context()
        self.app_context.push()
        db.create_all()

    def tearDown(self):
        db.session.rollback()
        db.session.remove()
        db.drop_all()
        self.app_context.pop()


text:
<?php
namespace Home\Controller;
use Think\Controller;
class InfoController extends Controller {
    public function index(){
    	$count = M('info')->count();
    	$page = new \Org\Util\Page($count, 15);
    	$limit = $page->firstRow.','.$page->listRows;

    	$this->info = M('info')->order('id desc')->limit($limit)->field('id,title,updated_at')->select();
    	$this->page = $page->show();
    	$this->display('Info/index');
    }
}
?>