text:
<?php

use Cake\Core\Plugin;
use Cake\Routing\RouteBuilder;
use Cake\Routing\Router;
use Cake\Routing\Route\DashedRoute;

/**
 * The default class to use for all routes
 *
 * The following route classes are supplied with CakePHP and are appropriate
 * to set as the default:
 *
 * - Route
 * - InflectedRoute
 * - DashedRoute
 *
 * If no call is made to `Router::defaultRouteClass()`, the class used is
 * `Route` (`Cake\Routing\Route\Route`)
 *
 * Note that `Route` does not do any inflections on URLs which will result in
 * inconsistently cased URLs when used with `:plugin`, `:controller` and
 * `:action` markers.
 *
 * Cache: Routes are cached to improve performance, check the RoutingMiddleware
 * constructor in your `src/Application.php` file to change this behavior.
 *
 */
Router::defaultRouteClass(DashedRoute::class);

Router::scope('/', function (RouteBuilder $routes) {
    $routes->prefix('admin', function ($routes) {
        $routes->connect('/', ['plugin' => 'Permission', 'controller' => 'Users', 'action' => 'login']);
        $routes->fallbacks(DashedRoute::class);
    });

    /**
     * Here, we are connecting '/' (base path) to a controller called 'Pages',
     * its action called 'display', and we pass a param to select the view file
     * to use (in this case, src/Template/Pages/home.ctp)...
     */
    $routes->connect('/', ['controller' => 'Pages', 'action' => 'index']);

    /**
     * ...and connect the rest of 'Pages' controller's URLs.
     */
    $routes->connect('/about', ['controller' => 'Pages', 'action' => 'about']);
    $routes->connect('/contact', ['controller' => 'Pages', 'action' => 'contact']);
    $routes->connect('/pages/*', ['controller' => 'Pages', 'action' => 'index']);

    /**
     * Connect catchall routes for all controllers.
     *
     * Using the argument `DashedRoute`, the `fallbacks` method is a shortcut for
     *    `$routes->connect('/:controller', ['action' => 'index'], ['routeClass' => 'DashedRoute']);`
     *    `$routes->connect('/:controller/:action/*', [], ['routeClass' => 'DashedRoute']);`
     *
     * Any route class can be used with this method, such as:
     * - DashedRoute
     * - InflectedRoute
     * - Route
     * - Or your own route class
     *
     * You can remove these routes once you've connected the
     * routes you want in your application.
     */
    $routes->fallbacks(DashedRoute::class);
});

/**
 * Load all plugin routes. See the Plugin documentation on
 * how to customize the loading of plugin routes.
 */
Plugin::routes();


text:
ACCEPTED

#### According to
Index Fungorum

#### Published in
Mycologia 35(6): 602 (1943)

#### Original name
Leciographa floridana E.K. Cash

### Remarks
null

redpajama_set_name: RedPajamaGithub


text:
<?php

/**
 * Менеджер системного модуля
 */
class SystemManager extends Ab_ModuleManager {

    /**
     * @var SystemManager
     */
    public static $instance;

    public function __construct(SystemModule $module){
        parent::__construct($module);

        SystemManager::$instance = $this;
    }

    public function IsAdminRole(){
        if ($this->IsRolesDisable()){
            return true;
        }
        return $this->IsRoleEnable(Ab_CoreSystemAction::ADMIN);
    }

    private $_adminManager = null;

    public function GetAdminManager(){
        if (empty($this->_adminManager)){
            require_once 'classes/admin.php';
            $this->_adminManager = new SystemManager_Admin($this);
        }
        return $this->_adminManager;
    }

    public function AJAX($d){
        $ret = $this->GetAdminManager()->AJAX($d);

        if (empty($ret)){
            $ret = new stdClass();
            $ret->err = 500;
        }

        return $ret;
    }

    public function Bos_MenuData(){
        if (!$this->IsAdminRole()){
            return null;
        }
        $i18n = $this->module->I18n();
        return array(
            array(
                "name" => "config",
                "title" => $i18n->Translate('bosmenu.config'),
                "icon" => "/modules/user/images/cpanel-24.png",
                "url" => "sys/wspace/ws",
                "parent" => "controlPanel"
            )
        );
    }

    public function Bos_SummaryData(){
        if (!$this->IsAdminRole()){
            return;
        }

        $i18n = $this->module->I18n();
        return array(
            array(
                "module" => "sys",
                "component" => "summary",
                "widget" => "SummaryWidget",
                "title" => $i18n->Translate('bosmenu.config'),
            )
        );
    }
}


text:
package kvm

import (
	"fmt"
	"unsafe"

	"golang.org/x/sys/unix"
)

var (
	runDataSize    int
	hasGuestPCID   bool
	cpuidSupported = cpuidEntries{nr: _KVM_NR_CPUID_ENTRIES}
)

func updateSystemValues(fd int) error {
	// Extract the mmap size.
	sz, _, errno := unix.RawSyscall(unix.SYS_IOCTL, uintptr(fd), _KVM_GET_VCPU_MMAP_SIZE, 0)
	if errno != 0 {
		return fmt.Errorf("getting VCPU mmap size: %v", errno)
	}

	// Save the data.
	runDataSize = int(sz)

	// Must do the dance to figure out the number of entries.
	_, _, errno = unix.RawSyscall(
		unix.SYS_IOCTL,
		uintptr(fd),
		_KVM_GET_SUPPORTED_CPUID,
		uintptr(unsafe.Pointer(&cpuidSupported)))
	if errno != 0 && errno != unix.ENOMEM {
		// Some other error occurred.
		return fmt.Errorf("getting supported CPUID: %v", errno)
	}

	// The number should now be correct.
	_, _, errno = unix.RawSyscall(
		unix.SYS_IOCTL,
		uintptr(fd),
		_KVM_GET_SUPPORTED_CPUID,
		uintptr(unsafe.Pointer(&cpuidSupported)))
	if errno != 0 {
		// Didn't work with the right number.
		return fmt.Errorf("getting supported CPUID (2nd attempt): %v", errno)
	}

	// Success.
	return nil
}


text:
const Helper = require('../_helper');
const createHTML = require('../_HTML');
const createList = require('../_list');
const obtainMethod = require('../../filters/orchestrionRolls/obtainMethods');
const localisationStrings = require('../../filters/orchestrionRolls/localisationStrings');

module.exports = new Helper("OrchestrionRoll", "orchestrionRolls", {
  api: 'Orchestrion',
  columns: [
    'Description_de',
    'Description_en',
    'Description_fr',
    'Description_ja',
    'ID',
    'Name_de',
    'Name_en',
    'Name_fr',
    'Name_ja',
    'GamePatch.ID',
    'OrchestrionUiparam.OrchestrionCategory.ID',
    'OrchestrionUiparam.Order'
  ],
  list: true,
  v3: true,
  format: (data, args) => {
    const items = args[1];

    const response = {
      localisation: localisationStrings,
      data: data.filter(entry => entry.OrchestrionUiparam.OrchestrionCategory.ID).map(entry => {
        const result = {
          category: entry.OrchestrionUiparam.OrchestrionCategory.ID,
          description: {
            de: entry.Description_de,
            en: entry.Description_en && entry.Description_en.split(' ').map(c => c.charAt(0).toUpperCase() + c.slice(1)).join(' '),
            fr: entry.Description_fr,
            jp: entry.Description_ja
          },
          icon: 14267,
          id: entry.ID,
          name: {
            de: entry.Name_de,
            en: entry.Name_en && entry.Name_en.split(' ').map(c => c.charAt(0).toUpperCase() + c.slice(1)).join(' '),
            fr: entry.Name_fr,
            jp: entry.Name_ja
          },
          order: entry.OrchestrionUiparam.Order
        }

        const item = items['orchestrion-rolls']
          .filter(item => item.awards === result.id)[0]

        result.patch = (item && item.patch) || entry.GamePatch.ID;

        if (!item || item.untradable)
          result.untradable = true;

        const method = obtainMethod(result, args && args[0], item);
        result.ref = method && !(method instanceof Array) ? [method] : method;

        return result;
      })
    }

    let methods = 0;
    const available = response.data.filter(d => {
      const m = d.ref && d.ref.filter(r => !r.promo && r.available).length;
      methods += m || 0;
      return m;
    }).length;

    createHTML("orchestrion-rolls", {
      data: response.data,
      emoji: "🎶",
      list: true,
      title: 'Orchestrion Rolls List | Apkallu Falls',
      description: `There are ${methods} ways to obtain the ${available} orchestrion rolls available right now in-game in Final Fantasy XIV. Here's how you obtain all of them.`,
      section: "Orchestrion Rolls"
    }, undefined, () => {});

    return response;
  }
}, (data, base, _helperCreateJSONFn) => {
  createList("orchestrion-rolls", data, base, _helperCreateJSONFn);
});


text:
require "formula"

class Hatari < Formula
  homepage "http://hatari.tuxfamily.org"
  head "http://hg.tuxfamily.org/mercurialroot/hatari/hatari", :using => :hg, :branch => "default"
  url "http://download.tuxfamily.org/hatari/1.8.0/hatari-1.8.0.tar.bz2"
  sha1 "08d950c3156c764b87ac0ae03c4f350febff9567"

  depends_on :x11
  depends_on "cmake" => :build
  depends_on "libpng"
  depends_on "sdl"

  def install
    system "./configure", "--prefix=#{prefix}", "--disable-osx-bundle"
    system "make install"
  end
end


text:
<!DOCTYPE html>

    <meta charset="utf-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1">
    <meta name="description" content="">
    <meta name="author" content="">

    <title>Eventyr for unge - En reiseguide for unge</title>

    <link href="css/bootstrap.min.css" rel="stylesheet">

    <link href="css/stylish-portfolio.css" rel="stylesheet">

    <link href="font-awesome/css/font-awesome.min.css" rel="stylesheet" type="text/css">
    <link href="https://fonts.googleapis.com/css?family=Source+Sans+Pro:300,400,700,300italic,400italic,700italic" rel="stylesheet" type="text/css">

              Hovedside

              Otta

              Lillehammer

              Kristiansund

              Om prosjektet

          <img class="first-slide" src="https://e.edim.co/123957345/16736431_1113247855470805_2099068895_n.jpg?Expires=1494507685&Signature=Ngv4taiS-C0JnayGF4NzjCAQ1deA-Yv26NGkPl1Hj4rH6do9tUcbHO7eyrmVZdeeuoqWqJ3nBxKqKLRtz5Oqi2~XTJJkNQsQOifrq9YyL3gsyNz3ob97xMUqKdI4qaW1yrn~AHa-UxuDcqpeZqMbCz3IftbUwmNz3jQrMvUSN8wJ0xJOZW6oHSyjPVARnL7V55RLXm0HU5HIJkRbKae8vXlppy~wwl1TtWtYbWC-DAxSepCvLlzpZatIevNkryfLzTPXRYGXlOE80AiRMTipzFEWgyZQUbFjNNZHD6MT75rffmpl0Rjp~awFwo4~~liii9v3sCFnSGqs154TetUMgQ__&Key-Pair-Id=APKAJMSU6JYPN6FG5PBQ" alt="First slide">

Eventyr for unge

En reiseguide for unge.

Eventyr for unge

En reiseguide for unge.

Eventyr for unge

En reiseguide for unge.

        Previous

        Next

First featurette heading. It'll blow your mind.

Donec ullamcorper nulla non metus auctor fringilla. Vestibulum id ligula porta felis euismod semper. Praesent commodo cursus magna, vel scelerisque nisl consectetur. Fusce dapibus, tellus ac cursus commodo.

Curling og Ishockey

På Lalm er det egen Ishockey- og curlingbane. Der er det mulighet for tilreisende å spille ishockey og curling på Lalm. Dette er det eneste hockey anlegget mellom Trondheim og Lillehammer. Først ble ishockey anlegget bygget i 2013-2014, og senere bygget de også curlingbane, og banene står ved siden av hverandre. For mere informasjon besøk hjemmesiden deres Lalmhockey

Riding - Hjerkinn

På Hjerkinn har de fjellridning for alle mennesker, uansett erfaring og alder. For å være med på tur alene er aldersgrensen 12 år, men om foresatte er med er aldersgrensen 10 år. På rideturen blir det delt inn i grupper etter erfaring, slik at alle får maksimalt utbytte av turen (merk: fart). På Hjerkinn bruker de kun islandshest, så man kan få prøvd seg i både tølt, trav og galopp. På grunn av størrelsen på islandshesten, er maksvekten på ridningen 95 kg.

På Hjerkinn kan man velge mellom dagstur, 2, 3, eller 6 døgns opphold ute i naturen. Turene går over vidder og fjell, og man bestiger topper med utsikt over Rondane og Dovrefjell. På lørdagene har de satt opp turer inn i moskusens rike. Der kan dere se moskus, villrein og hester på fjellbeite.

Back to top

© 2016 Company, Inc. · Privacy · Terms


text:
.strength-container {
  position: relative;
}
.strength-container .strength-input {
  width: 100%;
  padding-right: 20px;
}
.strength-container .strength-meter {
  position: absolute;
  top: 15%;
  right: 6px;
  width: 4px;
  height: 70%;
  overflow: hidden;
  background-color: #ccc;
  border-radius: 1px;
}
.strength-container .strength-score {
  position: absolute;
  bottom: 0;
  width: 100%;
  height: 0;
  color: transparent;
  -webkit-transition: width .6s ease 0s;
       -o-transition: width .6s ease 0s;
          transition: width .6s ease 0s;
}
.strength-container .show-password-wrap {
  position: absolute;
}
.strength-container .strength-invalid.strength-score {
  height: 25%;
  background-color: #f96868;
}
.strength-container .strength-weak.strength-score {
  height: 50%;
  background-color: #f2a654;
}
.strength-container .strength-good.strength-score {
  height: 75%;
  background-color: #57c7d4;
}
.strength-container .strength-strong.strength-score {
  height: 100%;
  background-color: #46be8a;
}


text:
package net.sourceforge.easyml.marshalling.java.time;

import net.sourceforge.easyml.InvalidFormatException;
import net.sourceforge.easyml.marshalling.AbstractStrategy;
import net.sourceforge.easyml.marshalling.MarshalContext;
import net.sourceforge.easyml.marshalling.SimpleStrategy;
import net.sourceforge.easyml.marshalling.UnmarshalContext;

import java.time.Instant;
import java.time.format.DateTimeParseException;

/**
 * InstantStrategy class that implements the {@linkplain SimpleStrategy}
 * interface for the {@linkplain Instant}. This implementation is thread-safe.
 *
 * @author Victor Cordis ( cordis.victor at gmail.com)
 * @version 1.5.1
 * @since 1.5.1
 */
public final class InstantStrategy extends AbstractStrategy implements SimpleStrategy<Instant> {

    /**
     * Constant defining the value used for the strategy name.
     */
    public static final String NAME = "instant";
    /**
     * Constant defining the singleton instance.
     */
    public static final InstantStrategy INSTANCE = new InstantStrategy();

    private InstantStrategy() {
    }

    /**
     * {@inheritDoc }
     */
    @Override
    public boolean strict() {
        return true;
    }

    /**
     * {@inheritDoc }
     */
    @Override
    public Class<Instant> target() {
        return Instant.class;
    }

    /**
     * {@inheritDoc }
     */
    @Override
    public boolean appliesTo(Class<Instant> c) {
        return c == Instant.class;
    }

    /**
     * {@inheritDoc }
     */
    @Override
    public String name() {
        return NAME;
    }

    /**
     * {@inheritDoc }
     */
    @Override
    public String marshal(Instant target, MarshalContext ctx) {
        return target.toString();
    }

    /**
     * {@inheritDoc }
     */
    @Override
    public Instant unmarshal(String text, UnmarshalContext ctx) {
        try {
            return Instant.parse(text);
        } catch (DateTimeParseException dtpX) {
            throw new InvalidFormatException(ctx.readerPositionDescriptor(), dtpX);
        }
    }
}


text:
package org.apache.activemq.artemis.jms.example;

import org.apache.activemq.artemis.api.jms.JMSFactoryType;
import org.apache.activemq.artemis.core.config.impl.SecurityConfiguration;
import org.apache.activemq.artemis.jms.server.JMSServerManager;
import org.apache.activemq.artemis.jms.server.embedded.EmbeddedJMS;
import org.apache.activemq.artemis.spi.core.security.ActiveMQSecurityManagerImpl;

import javax.jms.Connection;
import javax.jms.ConnectionFactory;
import javax.jms.MessageConsumer;
import javax.jms.MessageProducer;
import javax.jms.Queue;
import javax.jms.Session;
import javax.jms.TextMessage;
import java.util.ArrayList;
import java.util.Date;
import java.util.List;

/**
 * This example demonstrates how to run an ActiveMQ Artemis embedded with JMS
 */
public class EmbeddedExample {

   public static void main(final String[] args) throws Exception {
      EmbeddedJMS jmsServer = new EmbeddedJMS();

      SecurityConfiguration securityConfig = new SecurityConfiguration();
      securityConfig.addUser("guest", "guest");
      securityConfig.addRole("guest", "guest");
      securityConfig.setDefaultUser("guest");
      jmsServer.setSecurityManager(new ActiveMQSecurityManagerImpl(securityConfig));

      jmsServer.start();
      System.out.println("Started Embedded JMS Server");

      JMSServerManager jmsServerManager = jmsServer.getJMSServerManager();
      List<String> connectors = new ArrayList<String>();
      connectors.add("in-vm");
      jmsServerManager.createConnectionFactory("ConnectionFactory", false, JMSFactoryType.CF, connectors, "ConnectionFactory");
      jmsServerManager.createQueue(false, "exampleQueue", null, false, "queue/exampleQueue");

      ConnectionFactory cf = (ConnectionFactory) jmsServer.lookup("ConnectionFactory");
      Queue queue = (Queue) jmsServer.lookup("queue/exampleQueue");

      // Step 10. Send and receive a message using JMS API
      Connection connection = null;
      try {
         connection = cf.createConnection();
         Session session = connection.createSession(false, Session.AUTO_ACKNOWLEDGE);
         MessageProducer producer = session.createProducer(queue);
         TextMessage message = session.createTextMessage("Hello sent at " + new Date());
         System.out.println("Sending message: " + message.getText());
         producer.send(message);
         MessageConsumer messageConsumer = session.createConsumer(queue);
         connection.start();
         TextMessage messageReceived = (TextMessage) messageConsumer.receive(1000);
         System.out.println("Received message:" + messageReceived.getText());
      }
      finally {
         if (connection != null) {
            connection.close();
         }

         // Step 11. Stop the JMS server
         jmsServer.stop();
         System.out.println("Stopped the JMS Server");
      }
   }
}


text:
import sys
import unittest

from pyacter.facter import Facter

class PyacterFactCacheFunctions(unittest.TestCase):

    def test_cache_facter(self):

        f1 = Facter()
        f2 = Facter()
        f1facts = f1.facts()
        f2facts = f2.facts()

        self.assertEqual(f1facts['fqdn'], f2facts['fqdn'])

        self.assertTrue(Facter.__FACTER_HANDLER__)
        f1.clear()

        self.assertFalse(Facter.__FACTER_HANDLER__)

if __name__ == '__main__':
    unittest.main()


text:
class EmployeesController < ApplicationController
  #before_filter :checkadmin, :except => [:index, :edit,:update, :show]
  layout 'admin/home'

  def code_image
    @image_data = Employee.find(params[:id])
    send_data(@image_data.photo, :type     => "image/jpeg",
              :filename => "photo.jpg",
              :disposition => 'inline')
  end

  # GETs should be safe (see http://www.w3.org/2001/tag/doc/whenToUseGet.html)
  # verify :method => :post, :only => [ :destroy, :create, :update ],
  #         :redirect_to => { :action => :list }

  def select_role
    @roles = Role.find(:all).collect { |role|  ["#{role.title}", role.id ] }
  end

  def select_department
    @departments = Department.find(:all).collect { |department| ["#{department.name}", department.id ] }
  end

  def select_designation
    @designations = Designation.find(:all).collect { |designation| ["#{designation.name}", designation.id ] }
  end

  def index
    #@employee_pages, @employees = paginate :employees, :order => "employee_id ASC", :per_page => 10
    @employees = Employee.find(:all)
    if current_user.role.title != "Admin"
      employee = Employee.find_by_user_id(current_user)
      if employee.blank?
        redirect_to '/404.html'
        return
      end
      redirect_to employee_path(employee.id)
    end
  end

  def show
    select_role
    @employee = Employee.find(params[:id])
  end

  def new
    @employee = Employee.new
    select_role
    select_department
    select_designation
  end

  def create
    select_role
    select_department
    select_designation
    params[:employee].delete('image_file') if params[:employee][:image_file].blank?
    @employee = Employee.new(params[:employee])
    if @employee.save
      #@employee_leave_status= EmployeeLeaveStatus.new
      #     @employee_leave_status.employee_id = @employee.id
      #     @employee_leave_status.year = Time.now.strftime("%Y").to_i
      #     @employee_leave_status.save
      add_employee_department(@employee, params[:department][:id])
      flash[:notice] = 'Employee was successfully created.'
      redirect_to( :action => 'index')
    else
      render :action => 'new'
    end
  end

  def edit
    @employee = Employee.find(params[:id])
    select_role
    select_department
    select_designation
  end

  def update
    select_department
    select_role
    select_designation
    @employee = Employee.find(params[:id])
    #params[:employee].delete('employee_id') if ( session[:rolename] != "admin" and params[:employee][:employee_id] )
    #params[:employee].delete('image_file') if params[:employee][:image_file].blank?
    if not params[:department].blank?
      add_employee_department(@employee.id, params[:department][:id])
    end
    if @employee.update_attributes(params[:employee])
      flash[:notice] = 'Employee was successfully updated.'
      redirect_to employee_path(@employee)
    else
      render :action => 'edit'
    end
  end

  def destroy
    Employee.find(params[:id]).destroy
    flash[:notice] = 'Employee was successfully deleted.'
    redirect_to employees_path
  end

  def add_employee_department(emp_id, dept_id)
    emp_dept = EmployeeDepartment.find_emp_dept(emp_id, dept_id)
    if emp_dept.blank?
      emp_dept = EmployeeDepartment.new("employee_id" => emp_id, "department_id" => dept_id )
      emp_dept.save!
    elsif
      emp_dept.first.department_id = dept_id
      emp_dept.first.save!
    end
  end
end


text:
<?php

namespace PhpBench\Benchmark;

use Symfony\Component\Finder\Finder;

class CollectionBuilder
{
    private $finder;
    private $baseDir;
    private $benchmarkBuilder;

    public function __construct(BenchmarkBuilder $benchmarkBuilder, Finder $finder = null, $baseDir = null)
    {
        $this->benchmarkBuilder = $benchmarkBuilder;
        $this->finder = $finder ?: new Finder();
        $this->baseDir = $baseDir;
    }

    public function buildCollection($path, array $subjectFilter = array(), array $groupFilter = array())
    {
        if ($this->baseDir && '/' !== substr($path, 0, 1)) {
            $path = realpath($this->baseDir . '/' . $path);
        }

        if (!file_exists($path)) {
            throw new \InvalidArgumentException(sprintf(
                'File or directory "%s" does not exist',
                $path
            ));
        }

        if (is_dir($path)) {
            $this->finder->in($path)
                ->name('*Bench.php');
        } else {
            $this->finder->in(dirname($path))
                ->name(basename($path));
        }

        $benchmarks = array();

        foreach ($this->finder as $file) {
            if (!is_file($file)) {
                continue;
            }

            $benchmark = $this->benchmarkBuilder->build($file->getPathname(), $subjectFilter, $groupFilter);

            if (null === $benchmark) {
                continue;
            }

            $benchmarks[] = $benchmark;
        }

        return new Collection($benchmarks);
    }
}


text:
package org.synchronoss.cloud.nio.multipart;

import org.synchronoss.cloud.nio.stream.storage.StreamStorage;

import java.util.List;
import java.util.Map;

/**
 * <p> {@code NioMultipartParserListener} providing empty implementation of all the callbacks.
 *
 * @author Silvano Riz
 */
public class AbstractNioMultipartListener implements NioMultipartParserListener{

    @Override
    public void onPartFinished(StreamStorage partBodyStreamStorage, Map<String, List<String>> headersFromPart) {
        // Empty implementation
    }

    @Override
    public void onAllPartsFinished() {
        // Empty implementation
    }

    @Override
    public void onNestedPartStarted(Map<String, List<String>> headersFromParentPart) {
        // Empty implementation
    }

    @Override
    public void onNestedPartFinished() {
        // Empty implementation
    }

    @Override
    public void onError(String message, Throwable cause) {
        // Empty implementation
    }
}


text:
<?xml version="1.0" encoding="utf-8"?>
<PreferenceScreen xmlns:android="http://schemas.android.com/apk/res/android"
    xmlns:app="http://schemas.android.com/apk/res-auto">

    <ListPreference
        android:defaultValue="@string/screen_orientation_default"
        android:entries="@array/screen_orientation_entries"
        android:entryValues="@array/screen_orientation_values"
        android:key="@string/screen_orientation_key"
        android:summary="%s"
        android:title="@string/screen_orientation_title" />

    <SwitchPreference
        android:defaultValue="false"
        android:key="@string/sleep_mode_key"
        android:summaryOff="@string/sleep_mode_summary_off"
        android:summaryOn="@string/sleep_mode_summary_on"
        android:title="@string/sleep_mode_title" />

    <PreferenceCategory android:title="@string/color_pref_category_title">
        <com.jaredrummler.android.colorpicker.ColorPreferenceCompat
            android:key="@string/color_console_text_key"
            android:title="@string/color_console_text_title"
            app:cpv_showAlphaSlider="true" />

        <com.jaredrummler.android.colorpicker.ColorPreferenceCompat
            android:key="@string/color_console_background_key"
            android:title="@string/color_console_background_title"
            app:cpv_showAlphaSlider="true" />

        <Preference
            android:key="@string/color_console_clear_key"
            android:title="@string/display_clear" />

    </PreferenceCategory>

</PreferenceScreen>


text:
package io.undertow.websockets.jsr.test.annotated;

import jakarta.websocket.CloseReason;
import jakarta.websocket.OnClose;
import jakarta.websocket.OnMessage;
import jakarta.websocket.Session;
import jakarta.websocket.server.PathParam;
import jakarta.websocket.server.ServerEndpoint;
import java.util.concurrent.CountDownLatch;
import java.util.concurrent.TimeUnit;

/**
 * @author Stuart Douglas
 */
@ServerEndpoint(value = "/chat/{user}", subprotocols = {"foo", "bar", "configured-proto"})
public class MessageEndpoint {

    public static volatile CloseReason closeReason;
    private static volatile CountDownLatch closeLatch = new CountDownLatch(1);

    @OnMessage
    public String handleMessage(Session session, final String message, @PathParam("user") String user) {
        String proto = session.getNegotiatedSubprotocol();
        return message + " " + user + (proto.isEmpty() ? "" : " (protocol=" + proto + ")");
    }

    @OnClose
    public void close(CloseReason c) {
        closeReason = c;
        closeLatch.countDown();
    }

    public static  CloseReason getReason() throws InterruptedException {
        closeLatch.await(10, TimeUnit.SECONDS);
        return closeReason;
    }

    public static void reset() {
        closeLatch = new CountDownLatch(1);
        closeReason = null;
    }

}


text:
require "formula"
require "ostruct"

module Homebrew
  module_function

  def deps
    mode = OpenStruct.new(
      installed?: ARGV.include?("--installed"),
      tree?: ARGV.include?("--tree"),
      all?: ARGV.include?("--all"),
      topo_order?: ARGV.include?("-n"),
      union?: ARGV.include?("--union"),
    )

    if mode.installed? && mode.tree?
      puts_deps_tree Formula.installed
    elsif mode.all?
      puts_deps Formula
    elsif mode.tree?
      raise FormulaUnspecifiedError if ARGV.named.empty?
      puts_deps_tree ARGV.formulae
    elsif ARGV.named.empty?
      raise FormulaUnspecifiedError unless mode.installed?
      puts_deps Formula.installed
    else
      all_deps = deps_for_formulae(ARGV.formulae, !ARGV.one?, &(mode.union? ? :| : :&))
      all_deps = all_deps.select(&:installed?) if mode.installed?
      all_deps = all_deps.map(&method(:dep_display_name)).uniq
      all_deps.sort! unless mode.topo_order?
      puts all_deps
    end
  end

  def dep_display_name(d)
    ARGV.include?("--full-name") ? d.to_formula.full_name : d.name
  end

  def deps_for_formula(f, recursive = false)
    includes = []
    ignores = []
    if ARGV.include? "--include-build"
      includes << "build?"
    else
      ignores << "build?"
    end
    if ARGV.include? "--include-optional"
      includes << "optional?"
    else
      ignores << "optional?"
    end
    ignores << "recommended?" if ARGV.include? "--skip-recommended"

    if recursive
      deps = f.recursive_dependencies do |dependent, dep|
        if dep.recommended?
          Dependency.prune if ignores.include?("recommended?") || dependent.build.without?(dep)
        elsif dep.optional?
          Dependency.prune if !includes.include?("optional?") && !dependent.build.with?(dep)
        elsif dep.build?
          Dependency.prune unless includes.include?("build?")
        end
      end
      reqs = f.recursive_requirements do |dependent, req|
        if req.recommended?
          Requirement.prune if ignores.include?("recommended?") || dependent.build.without?(req)
        elsif req.optional?
          Requirement.prune if !includes.include?("optional?") && !dependent.build.with?(req)
        elsif req.build?
          Requirement.prune unless includes.include?("build?")
        end
      end
    else
      deps = f.deps.reject do |dep|
        ignores.any? { |ignore| dep.send(ignore) } && includes.none? { |include| dep.send(include) }
      end
      reqs = f.requirements.reject do |req|
        ignores.any? { |ignore| req.send(ignore) } && includes.none? { |include| req.send(include) }
      end
    end

    deps + reqs.select(&:default_formula?).map(&:to_dependency)
  end

  def deps_for_formulae(formulae, recursive = false, &block)
    formulae.map { |f| deps_for_formula(f, recursive) }.inject(&block)
  end

  def puts_deps(formulae)
    formulae.each do |f|
      deps = deps_for_formula(f).sort_by(&:name).map(&method(:dep_display_name))
      puts "#{f.full_name}: #{deps.join(" ")}"
    end
  end

  def puts_deps_tree(formulae)
    formulae.each do |f|
      puts "#{f.full_name} (required dependencies)"
      recursive_deps_tree(f, "")
      puts
    end
  end

  def recursive_deps_tree(f, prefix)
    reqs = f.requirements.select(&:default_formula?)
    deps = f.deps.default
    max = reqs.length - 1
    reqs.each_with_index do |req, i|
      chr = if i == max && deps.empty?
        "└──"
      else
        "├──"
      end
      puts prefix + "#{chr} :#{dep_display_name(req.to_dependency)}"
    end
    max = deps.length - 1
    deps.each_with_index do |dep, i|
      chr = if i == max
        "└──"
      else
        "├──"
      end
      prefix_ext = (i == max) ? "    " : "│   "
      puts prefix + "#{chr} #{dep_display_name(dep)}"
      recursive_deps_tree(Formulary.factory(dep.name), prefix + prefix_ext)
    end
  end
end


text:
package signature.model.impl;

import signature.model.IClassDefinition;
import signature.model.IPackage;

import java.io.Serializable;
import java.util.Arrays;
import java.util.List;
import java.util.Set;

@SuppressWarnings("serial")
public class SigPackage extends SigAnnotatableElement implements IPackage,
        Serializable {

    private String name;
    private Set<IClassDefinition> classes = Uninitialized.unset();

    public SigPackage(String name) {
        this.name = name;
    }

    public String getName() {
        return name;
    }

    public List<String> getPackageFragments() {
        return Arrays.asList(name.split("\\."));
    }

    public Set<IClassDefinition> getClasses() {
        return classes;
    }

    public void setClasses(Set<IClassDefinition> classes) {
        this.classes = classes;
    }

    @Override
    public String toString() {
        StringBuilder builder = new StringBuilder();
        builder.append("package: ");
        builder.append(getName());
        return builder.toString();
    }
}


text:
package com.toddfast.mutagen.cassandra.impl.baseline;

import com.datastax.driver.core.Session;
import com.toddfast.mutagen.MutagenException;
import com.toddfast.mutagen.Mutation;
import com.toddfast.mutagen.cassandra.AbstractCassandraMutation;
import com.toddfast.mutagen.cassandra.CassandraMutagen;
import com.toddfast.mutagen.cassandra.MutationStatus;
import com.toddfast.mutagen.cassandra.utils.DBUtils;

public class BaseLine {
    // Fields
    private Session session;

    private String baselineVersion;

    private CassandraMutagen mutagen;

    // Methods
    public BaseLine(CassandraMutagen mutagen, Session session) {
        this(mutagen, session, "000000000001");
    }

    public BaseLine(CassandraMutagen mutagen, Session session, String baselineVersion) {
        this.setMutagen(mutagen);
        this.setSession(session);
        this.setBaselineVersion(baselineVersion);
    }

    public void baseLine() throws MutagenException {
        DBUtils.createSchemaVersionTable(getSession());
        if (!DBUtils.isEmptyVersionTable(getSession()))
            throw new MutagenException("Tabble Version is not empty, please clean before executing baseline");
        dummyPlanExecution();
    }

    // Dummy execution of all mutations with state inferior of equal to lastCompletedState
    private void dummyPlanExecution() {

        for (Mutation<String> m : getMutagen().getMutationsPlan(false).getMutations()) {
            try {
                dummyExecution((AbstractCassandraMutation) m);
            } catch (Exception e) {
                throw new MutagenException("Dummy execution failed for mutation : " + m.toString(), e);
            }
        }
        if (!DBUtils.isVersionIdPresent(getSession(), getBaselineVersion())) {
            DBUtils.appendVersionRecord(getSession(), getBaselineVersion(), "", "", 0, MutationStatus.BASELINE.getValue());
        }
    }

    /**
     * dummy execution.
     */
    public void dummyExecution(AbstractCassandraMutation mutation) {
        String version = mutation.getResultingState().getID();

        // caculate the checksum
        String checksum = mutation.getChecksum();

        // append version record
        if (version.compareTo(getBaselineVersion()) < 0) {
            DBUtils.appendVersionRecord(getSession(), version, mutation.getResourceName(), checksum, 0, MutationStatus.BEFORE_BASELINE.getValue());
        } else if (version.compareTo(getBaselineVersion()) == 0) {
            DBUtils.appendVersionRecord(getSession(), version, mutation.getResourceName(), checksum, 0, MutationStatus.BASELINE.getValue());
        }
    }

    // getter and setter
    public Session getSession() {
        return session;
    }

    public void setSession(Session session) {
        this.session = session;
    }

    public String getBaselineVersion() {
        return baselineVersion;
    }

    public void setBaselineVersion(String baselineVersion) {
        this.baselineVersion = baselineVersion;
    }

    public CassandraMutagen getMutagen() {
        return mutagen;
    }

    public void setMutagen(CassandraMutagen mutagen) {
        this.mutagen = mutagen;
    }

}


text:
package com.intellij.lang.ant.dom;

import com.intellij.util.xml.Attribute;
import com.intellij.util.xml.Convert;
import com.intellij.util.xml.GenericAttributeValue;

import java.io.File;
import java.util.Iterator;
import java.util.List;

/**
 * @author Eugene Zhuravlev
 *         Date: Aug 10, 2010
 */
public interface AntDomClasspathElement {
  @Attribute("classpath")
  @Convert(value = AntMultiPathStringConverter.class)
  GenericAttributeValue<List<File>> getClasspath();

  @Attribute("classpathref")
  @Convert(value = AntDomRefIdConverter.class)
  GenericAttributeValue<AntDomElement> getClasspathRef();

  Iterator<AntDomElement> getAntChildrenIterator();
}


text:
<?php namespace CupOfTea\YouTube\Resource;

use CupOfTea\YouTube\Abstraction\Resource;
use CupOfTea\YouTube\Traits\HasSubResources;

class i18n extends Resource
{
    use HasSubResources;

    /**
     * Available SubResources for this API.
     *
     * @var array
     */
    protected $available_subresources = ['language', 'region'];
}


text:
<?php
    session_start();
    date_default_timezone_set("UTC");
    require_once('../../../credentials.php');
    include '../../dbh.php';
    include('../../vendor/autoload.php');
    require_once('../../email/Email.php');
    $date = date("Y-m-d H:i:s", time());
    $addNotif = $conn->prepare("INSERT INTO notifications (post_id, user_id, target_id, notification_type, date) VALUES (?, ?, ?, ?, ?)");
    $addNotif->bind_param("iiiss", $tID, $uid, $tid, $type, $date);

    $getUser = $conn->prepare("SELECT users.uid, users.email, talk.talkID FROM users, talk WHERE users.username = ? AND talk.userID = ? AND talk.date = ?");
    $getUser->bind_param("sis", $username, $userid, $mdate);

    if(isset($_SESSION['uid'])) {
        $username = preg_replace('/\s+/', '', $_POST['username']);
        $mdate = $_POST['date'];
        $userid = $_SESSION['uid'];
        if($getUser->execute()) {
            $getUser->bind_result($targetid, $email, $talkID);
            if($getUser->fetch()) {
                $tid = $targetid;
                $tID = $talkID;
                $uid = $userid;
                $type = 'mentioned';
                $date = date("Y-m-d H:i:s", time());
                $target_email = $email;
                $target_username = $username;
                $user_username = $_SESSION['username'];

                $getUser->close();
                if($addNotif->execute()) {
                    $addNotif->close();
                    $email = new Email($target_username, $target_email, 'notifications@nxtdrop.com', $user_username.' mentioned you.', '');
                    $email->setTID($tID);
                    if($email->sendEmail('mentionNotification')) {
                        die('GOOD');
                    }
                } else {
                    die('DB1');
                }
            } else {
                die('DB2');
            }
        } else {
            die('DB3');
        }
    }

?>


text:
module System.Texrunner
  ( runTex
  , runTex'
  , prettyPrintLog
  ) where

import           Control.Applicative
import qualified Data.ByteString.Char8      as C8 hiding (concatMap)
import           Data.ByteString.Lazy.Char8 as LC8 hiding (concatMap)
import           Data.Maybe

import           System.Directory
import           System.Environment
import           System.Exit
import           System.FilePath
import           System.IO
import           System.IO.Temp
import           System.Process

import           System.Texrunner.Parse

-- | Same as 'runTex'' but runs Tex in a temporary system directory.
runTex :: String     -- ^ Tex command
       -> [String]   -- ^ Additional arguments
       -> [FilePath] -- ^ Additional Tex input paths
       -> ByteString -- ^ Source Tex file
       -> IO (ExitCode, TexLog, Maybe ByteString)
runTex command args extras source =
  withSystemTempDirectory "texrunner." $ \path ->
    runTex' path command args extras source

-- | Run Tex program in the given directory. Additional Tex inputs are
--   for filepaths to things like images that Tex can refer to.
runTex' :: FilePath   -- ^ Directory to run Tex in
        -> String     -- ^ Tex command
        -> [String]   -- ^ Additional arguments
        -> [FilePath] -- ^ Additional Tex inputs
        -> ByteString -- ^ Source Tex file
        -> IO (ExitCode, TexLog, Maybe ByteString)
runTex' path command args extras source = do

  LC8.writeFile (path </> "texrunner.tex") source

  environment <- extraTexInputs (path:extras) <$> getEnvironment

  let p = (proc command ("texrunner.tex" : args))
            { cwd     = Just path
            , std_in  = CreatePipe
            , std_out = CreatePipe
            , env     = Just environment
            }

  (Just inH, Just outH, _, pHandle) <- createProcess p

  hClose inH
  a <- C8.hGetContents outH -- backup log

  hClose outH
  exitC <- waitForProcess pHandle

  pdfExists <- doesFileExist (path </> "texrunner.pdf")
  pdfFile   <- if pdfExists
                  then Just <$> LC8.readFile (path </> "texrunner.pdf")
                  else return Nothing

  logExists <- doesFileExist (path </> "texrunner.log")
  logFile   <- if logExists
                  then Just <$> C8.readFile (path </> "texrunner.log")
                  else return Nothing

  -- pdfFile <- optional $ LC8.readFile (path </> "texrunner.pdf")
  -- logFile <- optional $ C8.readFile (path </> "texrunner.log")

  return (exitC, parseLog $ fromMaybe a logFile, pdfFile)

-- | Add a list of paths to the tex
extraTexInputs :: [FilePath] -> [(String,String)] -> [(String,String)]
extraTexInputs []      = id
extraTexInputs inputss = alter f "TEXINPUTS"
  where
    f Nothing  = Just inputs
    f (Just x) = Just (inputs ++ [searchPathSeparator] ++ x)
    --
    inputs = concatMap (++ [searchPathSeparator]) inputss
    -- inputs = intercalate [searchPathSeparator] inputss

-- Alter can be used to insert, delete or update an element. Similar to alter
-- in Data.Map.
alter :: Eq k => (Maybe a -> Maybe a) -> k -> [(k,a)] -> [(k,a)]
alter f k = go
  where
    go []         = maybeToList ((,) k <$> f Nothing)
    go ((k',x):xs)
      | k' == k   = case f (Just x) of
                      Just x' -> (k',x') : xs
                      Nothing -> xs
      | otherwise = (k',x) : go xs


text:
use alloc_uni;

use core::ptr;
use core::mem::size_of;

use rlibc::memset;

use hal::arch::defs::PAGE_SIZE;

use hal::mmu::{Vaddr, Maddr, Pfn, Mfn};

use hal::arch::mmu::{PageEntry, PageFlags};

use hal::xen::boot::start_info;

use hal::xen::memory::{MmuUpdate, MapFlags};
use hal::xen::memory::{mmu_update, update_va_mapping};

/// Add an admin frame (ex: add a new page table)
unsafe fn add_admin_frame(table: *const PageEntry,
                          offset: usize) -> Result<(), i32> {
    let admin_page = alloc_uni::__rust_allocate(PAGE_SIZE, PAGE_SIZE);

    if admin_page == ptr::null_mut() {
        panic!("Cannot allocate a new admin page");
    }

    // Clear the page before mapping it
    memset(admin_page, 0, PAGE_SIZE);

    let admin_page_vaddr = Vaddr::from_ptr(admin_page);
    let admin_page_pfn = Pfn::from(admin_page_vaddr);
    let admin_page_pte = PageEntry::from(admin_page_pfn);
    let admin_page_mfn = Mfn::from(admin_page_pfn);
    let admin_page_maddr = Maddr::from(admin_page_mfn);

    let ret = update_va_mapping(admin_page_vaddr,
                                PageEntry::new(*admin_page_maddr).set(PageFlags::Present),
                                MapFlags::InvlpgLocal);
    if ret < 0 {
        return Err(ret);
    }

    let table_mfn = Mfn::from(Vaddr::from_ptr(table));
    let table_mach = Maddr::from(table_mfn).incr(offset * size_of::<PageEntry>());

    let update = MmuUpdate::new(*table_mach, admin_page_pte.value());

    let ret = mmu_update(&update, 1, ptr::null_mut());

    if ret < 0 {
        Err(ret)
    } else {
        Ok(())
    }
}

unsafe fn extract_table_entry(table: *const PageEntry,
                              offset: usize) -> Result<*const PageEntry, i32> {
    let mut entry = *table.offset(offset as isize);

    if !entry.has(PageFlags::Present) {
        try!(add_admin_frame(table, offset));

        entry = *table.offset(offset as isize);
        if !entry.has(PageFlags::Present) {
            panic!("BUG: Admin frame was not added properly");
        }
    }

    Ok(Vaddr::from(entry).as_ptr())
}

/// Map a single physical page into virtual address space
pub unsafe fn map_page(addr: Vaddr, mfn: Mfn) -> Result<(), i32> {
    let mut table = (*start_info).pt_base as *const PageEntry;
    let mut offset;

    if cfg!(target_arch = "x86_64") {
        // Extract the page directory pointer table from the page map
        // level 4 offset table
        offset = addr.l4_offset();
        table = try!(extract_table_entry(table, offset));
    }

    // Extract the page directory table from the page directory
    // pointer table
    offset = addr.l3_offset();
    table = try!(extract_table_entry(table, offset));

    // Extract the page table from the page directory
    offset = addr.l2_offset();
    table = try!(extract_table_entry(table, offset));

    let page_table_mfn = Mfn::from(Vaddr::from_ptr(table));
    let new_pte = PageEntry::from(mfn);
    let pt_value = addr.l1_offset() * size_of::<PageEntry>();
    let page_table_addr = Maddr::from(page_table_mfn).incr(pt_value);

    let update = MmuUpdate::new(*page_table_addr, new_pte.value());

    let ret = mmu_update(&update, 1, ptr::null_mut());

    if ret < 0 {
        Err(ret)
    } else {
        Ok(())
    }
}

/// Map `count` physical pages into virtual address space
pub unsafe fn map_contiguous(mut addr: Vaddr, mut pfn_base: Pfn,
                             count: usize) -> Result<(), i32> {
    for _ in 0..count {
        try!(map_page(addr, Mfn::from(pfn_base)));

        pfn_base += 1;
        addr = addr.incr(PAGE_SIZE);
    }

    Ok(())
}

/// Map non contiguous machine frames into virtual address space
pub unsafe fn map_non_contiguous_mfn(mut addr: Vaddr,
                                     mfn_list: &[Mfn]) -> Result<(), i32> {
    for &mfn in mfn_list {
        try!(map_page(addr, mfn));

        addr = addr.incr(PAGE_SIZE);
    }

    Ok(())
}


text:
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
	android:layout_width="fill_parent" android:layout_height="?android:attr/listPreferredItemHeight"
	android:padding="6dip">
	<CheckBox
	    android:id="@+id/account_row_account_enabled"
	    android:layout_width="wrap_content"
	    android:layout_height="fill_parent"
	    android:gravity="center_vertical"
	    android:layout_weight="1"/>

	<TextView
	    android:id="@+id/account_row_account_name"
	    android:layout_width="wrap_content"
	    android:layout_height="fill_parent"
	    android:layout_weight="20"
	    android:gravity="center_vertical"
	    android:text="Test account" />

	<ImageView
	    android:id="@+id/account_row_account_next"
	    android:layout_width="wrap_content"
	    android:layout_weight="1"
	    android:layout_height="wrap_content" />
</LinearLayout>


text:
//Licensed under MIT License see LICENSE.TXT in project root folder
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using SQLite;

namespace RFIDModuleScan.Core.Data
{
    public class ModuleScan : IDBEntity
    {
        [PrimaryKey]
        public Guid ID { get; set; }
        public Guid FieldScanID { get; set; }
        public Guid LoadID { get; set; }
        public string ModuleID { get; set; }
        public string SerialNumber { get; set; }
        public int BarcodeType { get; set; }
        public decimal Latitude { get; set; }
        public decimal Longitude { get; set; }
        public DateTime TimeStamp { get; set; }
        public DateTime TransmitTime { get; set; }
        public bool Transmitted { get; set; }
        public string Note { get; set; }

        public ModuleScan()
        {
            ID = Guid.Empty;
            Transmitted = false;
        }

        public string AdjustedModuleID
        {
            get
            {
                if (ModuleID == null)
                {
                    return "";
                }

                if (ModuleID.StartsWith("3500B9880611"))
                {
                    char[] chars = ModuleID.ToCharArray();
                    if (chars.Length >= 15)
                    {
                        chars[14] = '0';
                    }
                    return new string(chars);
                }
                else
                {
                    return ModuleID;
                }
            }
        }

        public string GetTableHeader()
        {
            return "ID,FieldScanID,LoadID,SerialNumber,ModuleID,BarcodeType,Latitude,Longitude,Timestamp,TransmitTime,Transmitted,Note";
        }

        public string GetCSVLine()
        {
            string result = "";
            result += FileHelper.EscapeForCSV(ID.ToString()) + ",";
            result += FileHelper.EscapeForCSV(FieldScanID.ToString()) + ",";
            result += FileHelper.EscapeForCSV(LoadID.ToString()) + ",";
            result += FileHelper.EscapeForCSV(SerialNumber) + ",";
            result += FileHelper.EscapeForCSV(AdjustedModuleID) + ",";
            result += FileHelper.EscapeForCSV(BarcodeType.ToString()) + ",";

            if (Latitude.ToString() == "0")
            {
                result += ",";
            }
            else
            {
                result += FileHelper.EscapeForCSV(Latitude.ToString()) + ",";
            }

            if (Longitude.ToString() == "0")
            {
                result += ",";
            }
            else
            {
                result += FileHelper.EscapeForCSV(Longitude.ToString()) + ",";
            }

            result += FileHelper.EscapeForCSV(TimeStamp.ToString("MM/dd/yyyy hh:mm tt")) + ",";
            result += FileHelper.EscapeForCSV(TransmitTime.ToString("MM/dd/yyyy hh:mm tt")) + ",";
            result += FileHelper.EscapeForCSV(Transmitted.ToString()) + ",";
            result += FileHelper.EscapeForCSV(Note);

            return result;

        }
    }
}


text:
<?php
# Generated by the protocol buffer compiler.  DO NOT EDIT!
# source: google/cloud/compute/v1/compute.proto

namespace Google\Cloud\Compute\V1;

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

/**
 *
 * Generated from protobuf message google.cloud.compute.v1.InstancesSetMachineResourcesRequest
 */
class InstancesSetMachineResourcesRequest extends \Google\Protobuf\Internal\Message
{
    /**
     * A list of the type and count of accelerator cards attached to the instance.
     *
     * Generated from protobuf field repeated .google.cloud.compute.v1.AcceleratorConfig guest_accelerators = 463595119;
     */
    private $guest_accelerators;

    /**
     * Constructor.
     *
     * @param array $data {
     *     Optional. Data for populating the Message object.
     *
     *     @type array<\Google\Cloud\Compute\V1\AcceleratorConfig>|\Google\Protobuf\Internal\RepeatedField $guest_accelerators
     *           A list of the type and count of accelerator cards attached to the instance.
     * }
     */
    public function __construct($data = NULL) {
        \GPBMetadata\Google\Cloud\Compute\V1\Compute::initOnce();
        parent::__construct($data);
    }

    /**
     * A list of the type and count of accelerator cards attached to the instance.
     *
     * Generated from protobuf field repeated .google.cloud.compute.v1.AcceleratorConfig guest_accelerators = 463595119;
     * @return \Google\Protobuf\Internal\RepeatedField
     */
    public function getGuestAccelerators()
    {
        return $this->guest_accelerators;
    }

    /**
     * A list of the type and count of accelerator cards attached to the instance.
     *
     * Generated from protobuf field repeated .google.cloud.compute.v1.AcceleratorConfig guest_accelerators = 463595119;
     * @param array<\Google\Cloud\Compute\V1\AcceleratorConfig>|\Google\Protobuf\Internal\RepeatedField $var
     * @return $this
     */
    public function setGuestAccelerators($var)
    {
        $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::MESSAGE, \Google\Cloud\Compute\V1\AcceleratorConfig::class);
        $this->guest_accelerators = $arr;

        return $this;
    }

}