text:
var mysql = require('mysql');

module.exports = function(options) {

    var db1 = mysql.createConnection({
        host: options.host,
		port: options.port,
        user: options.user,
        password: options.password,
        multipleStatements: true
    });

    var db2 = mysql.createConnection({
        host: options.host,
		port: options.port,
        user: options.user,
        password: options.password,
        database: options.database,
        multipleStatements: true
    });

    function checkIfDatabaseExists(callback) {
        var sql = 'show databases like "' + options.database + '"';
        db1.query(sql, function(err, result) {
            if (err) return callback(err);
            var exists = result.length > 0;
            return callback(null, exists);
        });
    }

    function createDatabase(exists, callback) {
        if (exists) return callback();
        console.log('| Database does not exist');
        console.log('| Creating database');
        var sql = 'CREATE DATABASE ' + options.database + ' CHARACTER SET utf8 COLLATE utf8_general_ci';
        db1.query(sql, function(err) {
            if (err) return callback(err);
            console.log('| Database created successfully');
            callback();
        });
    }

    function checkIfLockTableExists(callback) {
        var sql = 'show tables like "database_update_lock"';
        db2.query(sql, function(err, result) {
            if (err) return callback(err);
            var exists = result.length > 0;
            return callback(null, exists);
        });
    }

    function createDatabaseUpdateLockTable(exists, callback) {
        if (exists) return callback();
        console.log('| Database update lock table missing');
        console.log('| Creating missing table');
        var sql = 'create table database_update_lock (' +
            'id int unsigned primary key not null,' +
            'lastLockedAt datetime null,' +
            'lockedWith varchar(36) null,' +
            'lastLockedByIp varchar(15) null)';
        db2.query(sql, function(err) {
            if (err) return callback(err);
            console.log('| Table created successfully');
            insertInitialLockRow(function(err) {
                if (err) return callback(err);
                callback();
            });
        });
    }

    function insertInitialLockRow(callback) {
        var sql = 'insert into database_update_lock (id) values (?)';
        db2.query(sql, [1], callback);
    }

    function checkIfScriptHistoryTableExists(callback) {
        var sql = 'show tables like "database_script_history"';
        db2.query(sql, function(err, result) {
            if (err) return callback(err);
            var exists = result.length > 0;
            callback(null, exists);
        });
    }

    function createScriptHistory(exists, callback) {
        if (exists) return callback();
        console.log('| Database script history table missing');
        console.log('| Creating missing table');
        var sql = 'create table database_script_history (' +
                    'version int unsigned not null,' +
                    'createdAt datetime null,' +
                    'name varchar(100),' +
                    'status varchar(10) null,' +
                    'index (version))';
        db2.query(sql, function(err) {
            if (err) return callback(err);
            console.log('| Table created successfully');
            callback();
        });
    }

    function checkIfRoutineHistoryTableExists(callback) {
        var sql = 'show tables like "database_routine_history"';
        db2.query(sql, function(err, result) {
            if (err) return callback(err);
            var exists = result.length > 0;
            callback(null, exists);
        });
    }

    function createProcHistory(exists, callback) {
        if (exists) return callback();
        console.log('| Database routine history table missing');
        console.log('| Creating missing table');
        var sql = 'create table database_routine_history (' +
                    'id int unsigned auto_increment not null primary key,' +
                    'name varchar(100) not null,' +
                    'md5 varchar(32) not null,' +
                    'createdAt datetime null,' +
                    'status varchar(10),' +
                    'index (name))';

        db2.query(sql, function(err) {
            if (err) return callback(err);
            console.log('| Table created successfully');
            callback();
        });
    }

    return {
        checkIfDatabaseExists: checkIfDatabaseExists,
        createDatabase: createDatabase,
        checkIfLockTableExists: checkIfLockTableExists,
        createDatabaseUpdateLockTable: createDatabaseUpdateLockTable,
        checkIfScriptHistoryTableExists: checkIfScriptHistoryTableExists,
        createScriptHistory: createScriptHistory,
        checkIfProcHistoryTableExists: checkIfRoutineHistoryTableExists,
        createProcHistory: createProcHistory
    };
};


text:
.clearfix, .timeTable .timeTable-days::after, .timeTable .timeTable-hour::after {
  content: "";
  clear: both;
  display: block;
  visibility: hidden;
  height: 0; }

.timeTable {
  background-color: #eee;
  padding: 0.5em;
  margin-top: 0.5em;
  border: 0.1em solid #666;
  box-shadow: 0.1em 0.1em 0.5em 0.01em #ccc;
  padding: 0.2em; }
.timeTable ul {
  list-style: none;
  margin: 0;
  padding: 0; }
.timeTable .timeTable-day {
  float: left;
  background-color: #fff;
  width: calc(16.66667% - 0.25em); }
.timeTable .timeTable-day:not(:first-child) {
  margin-left: 0.3em; }
.timeTable .timeTable-dayCaption {
  display: block;
  margin-top: 0;
  margin-bottom: 0.5em;
  text-align: center;
  padding: 0.2em 0.5em;
  box-shadow: 0 0 0.2em 0 #999;
  border-bottom: 0.15em solid #eee;
  background-color: #999;
  color: #eee; }
.timeTable .timeTable-hour {
  padding: 0.25em; }
.timeTable .timeTable-hour:hover {
  background-color: #ffffcc;
  transition: background-color 1s ease 0s; }
.timeTable .timeTable-hour + .timeTable-hour {
  border-top: 0.1em dotted #ccc; }
.timeTable .timeTable-hour .time-block {
  float: left;
  padding-right: 0.5em; }
.timeTable .timeTable-hour .time-block .start {
  font-size: 2em;
  display: block;
  margin: 0;
  padding: 0; }
.timeTable .timeTable-hour .name {
  display: block;
  word-break: break-all; }
.timeTable .timeTable-hour:not(.timeTable-break) .name {
  font-size: 1.2em;
  font-weight: 700; }
.timeTable .timeTable-hour.timeTable-break .name {
  font-size: 1.5em;
  font-weight: 500; }
.timeTable .timeTable-hour .doz {
  display: block;
  font-size: 0.8em;
  color: #666;
  clear: both; }
.timeTable .timeTable-hour .room {
  float: right; }

/*# sourceMappingURL=style.css.map */

redpajama_set_name: RedPajamaGithub


text:
//
// DO NOT MODIFY! THIS IS AUTOGENERATED FILE!
//
namespace Xilium.CefGlue
{
    using System;
    using System.Collections.Generic;
    using System.Diagnostics;
    using System.Runtime.InteropServices;
    using Xilium.CefGlue.Interop;

    // Role: HANDLER
    public abstract unsafe partial class CefSetCookieCallback
    {
        private static Dictionary<IntPtr, CefSetCookieCallback> _roots = new Dictionary<IntPtr, CefSetCookieCallback>();

        private int _refct;
        private cef_set_cookie_callback_t* _self;

        protected object SyncRoot { get { return this; } }

        private cef_set_cookie_callback_t.add_ref_delegate _ds0;
        private cef_set_cookie_callback_t.release_delegate _ds1;
        private cef_set_cookie_callback_t.has_one_ref_delegate _ds2;
        private cef_set_cookie_callback_t.on_complete_delegate _ds3;

        protected CefSetCookieCallback()
        {
            _self = cef_set_cookie_callback_t.Alloc();

            _ds0 = new cef_set_cookie_callback_t.add_ref_delegate(add_ref);
            _self->_base._add_ref = Marshal.GetFunctionPointerForDelegate(_ds0);
            _ds1 = new cef_set_cookie_callback_t.release_delegate(release);
            _self->_base._release = Marshal.GetFunctionPointerForDelegate(_ds1);
            _ds2 = new cef_set_cookie_callback_t.has_one_ref_delegate(has_one_ref);
            _self->_base._has_one_ref = Marshal.GetFunctionPointerForDelegate(_ds2);
            _ds3 = new cef_set_cookie_callback_t.on_complete_delegate(on_complete);
            _self->_on_complete = Marshal.GetFunctionPointerForDelegate(_ds3);
        }

        ~CefSetCookieCallback()
        {
            Dispose(false);
        }

        private void Dispose()
        {
            Dispose(true);
            GC.SuppressFinalize(this);
        }

        protected virtual void Dispose(bool disposing)
        {
            if (_self != null)
            {
                cef_set_cookie_callback_t.Free(_self);
                _self = null;
            }
        }

        private void add_ref(cef_set_cookie_callback_t* self)
        {
            lock (SyncRoot)
            {
                var result = ++_refct;
                if (result == 1)
                {
                    lock (_roots) { _roots.Add((IntPtr)_self, this); }
                }
            }
        }

        private int release(cef_set_cookie_callback_t* self)
        {
            lock (SyncRoot)
            {
                var result = --_refct;
                if (result == 0)
                {
                    lock (_roots) { _roots.Remove((IntPtr)_self); }
                    Dispose();
                    return 1;
                }
                return 0;
            }
        }

        private int has_one_ref(cef_set_cookie_callback_t* self)
        {
            lock (SyncRoot) { return _refct == 1 ? 1 : 0; }
        }

        internal cef_set_cookie_callback_t* ToNative()
        {
            add_ref(_self);
            return _self;
        }

        [Conditional("DEBUG")]
        private void CheckSelf(cef_set_cookie_callback_t* self)
        {
            if (_self != self) throw ExceptionBuilder.InvalidSelfReference();
        }

    }
}


text:
{-# LANGUAGE ImplicitParams #-}
module Language.LazyZ.Syntax where

import Control.Applicative (pure, some, (<$>), (*>), (<*>), (<*), (<$))
import Data.Char (isSpace, ord)
import Data.Function
import Data.List
import Text.Parsec
import Text.Parsec.String
import Text.Parsec.Language (haskellStyle)
import Text.Parsec.Expr
import qualified Text.Parsec.Token as T
import Data.Void
import Language.LazyZ.Program (ExprP(..))
import Language.LazyK.Syntax (ccParser)
import Data.Combinator.Expr (Expr(..))
import Data.Combinator.Church
import Control.Monad.Identity
import qualified Codec.Binary.UTF8.String as UTF8

type OpTable = OperatorTable String () Identity (ExprP Void)

primNat :: Integer -> ExprP Void
primNat n = Apply (Var "prim_nat") $
    LiftExpr (encodeInteger n)

primList :: [ExprP e] -> ExprP e
primList xs = Apply (Var "prim_list") $
    Lambda "cons" $ Lambda "nil"
    $ foldr (\y ys -> Var "cons" `Apply` y `Apply` ys) (Var "nil") xs

literal :: (?optable :: OpTable) => Parser (ExprP Void)
literal = primNat <$> natural
    <|> primList <$> map (primNat.fromIntegral) <$> UTF8.encode <$> stringLiteral
    <|> primNat <$> toEnum <$> fromEnum <$> charLiteral
    <|> (symbol "[" *> (primList <$> expr `sepBy` symbol ",") <* symbol "]")

lexer = T.makeTokenParser haskellStyle

identifier = T.identifier lexer <|> parens operator
natural = T.natural lexer
stringLiteral = T.stringLiteral lexer
charLiteral = T.charLiteral lexer
parens = T.parens lexer
whiteSpace = T.whiteSpace lexer
lexeme = T.lexeme lexer
symbol = T.symbol lexer
operator = T.operator lexer
reservedOp = T.reservedOp lexer

indentLevel = length . takeWhile isSpace

parseDecs :: OpTable -> Parser [(String, ExprP Void)]
parseDecs t = do
    let ?optable = t
    some definition

parseOpTable :: Parser OpTable
parseOpTable = map (map snd)
    <$> groupBy ((==) `on` fst)
    <$> sortBy (compare `on` (negate.fst))
    <$> concat
    <$> many (spaces *> def <* char ';') where
    def = pure <$> (try (infixp "--#infixl" AssocLeft)
            <|> try (infixp "--#infixr" AssocRight)
            <|> try (infixp "--#infix" AssocNone))
        <|> (many (satisfy (/=';')) *> pure [])
    infixp s a = lexeme $ do
        string s
        whiteSpace
        p <- natural
        whiteSpace
        op <- operator
        return (p, Infix ((\x y -> Var op `Apply` x `Apply` y) <$ reservedOp op) a)

definition :: (?optable :: OpTable) => Parser (String, ExprP Void)
definition = lexeme $ do
    whiteSpace
    name <- identifier
    args <- many (whiteSpace *> identifier)
    symbol "="
    definition <- expr
    whiteSpace
    char ';'
    return (name, construct args definition)

construct :: (?optable :: OpTable) => [String] -> ExprP e -> ExprP e
construct (x:xs) e = currying x xs e
construct [] e = e

currying p [] e = Lambda p e
currying p (p':ps) e = Lambda p (currying p' ps e)

lambda :: (?optable :: OpTable) => Parser (ExprP Void)
lambda = (char 'λ' <|> char '\\')
    >> currying <$> identifier <*> many (whiteSpace *> identifier)
    <*> (whiteSpace *> string "->" *> expr)

quote :: (?optable :: OpTable) => Parser (ExprP a)
quote = string "[|" *> (vacuous <$> LiftExpr <$> (ccParser :: Parser (Expr Void))) <* string "|]"

term :: (?optable :: OpTable) => Parser (ExprP Void)
term = whiteSpace *> term' <* whiteSpace where
    term' = try section
        <|> parens expr
        <|> lambda
        <|> try quote
        <|> literal
        <|> Var <$> identifier

termA :: (?optable :: OpTable) => Parser (ExprP Void)
termA = foldl Apply <$> term <*> many term

section :: (?optable :: OpTable) => Parser (ExprP Void)
section = Var <$> (char '(' *> operator <* char ')')

expr :: (?optable :: OpTable) => Parser (ExprP Void)
expr = buildExpressionParser ?optable termA where


text:
package fr.inra.maiage.bibliome.alvisnlp.bibliomefactory.library;

import java.io.UnsupportedEncodingException;
import java.security.MessageDigest;
import java.security.NoSuchAlgorithmException;

import javax.xml.bind.DatatypeConverter;

import fr.inra.maiage.bibliome.alvisnlp.core.corpus.expressions.Function;
import fr.inra.maiage.bibliome.alvisnlp.core.corpus.expressions.FunctionLibrary;
import fr.inra.maiage.bibliome.alvisnlp.core.corpus.expressions.Library;

@Library("hash")
public abstract class HashLibrary extends FunctionLibrary {
	public static final String NAME = "hash";

	private static final String hash(String algo, String s) {
		try {
			MessageDigest md = MessageDigest.getInstance(algo);
			md.update(s.getBytes("UTF-8"));
			byte[] digest = md.digest();
			return DatatypeConverter.printHexBinary(digest);
		}
		catch (NoSuchAlgorithmException|UnsupportedEncodingException e) {
			throw new RuntimeException(e);
		}
	}

	@Function
	public static final String md2(String s) {
		return hash("MD2", s);
	}

	@Function
	public static final String md5(String s) {
		return hash("MD5", s);
	}

	@Function(firstFtor = "sha-1")
	public static final String sha1(String s) {
		return hash("SHA-1", s);
	}

	@Function(firstFtor = "sha-256")
	public static final String sha256(String s) {
		return hash("SHA-256", s);
	}

	@Function(firstFtor = "sha-512")
	public static final String sha512(String s) {
		return hash("SHA-512", s);
	}
}


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

package com.azure.core.serializer.avro.jackson;

import com.azure.core.experimental.serializer.AvroSerializer;
import com.azure.core.util.logging.ClientLogger;
import com.fasterxml.jackson.dataformat.avro.AvroMapper;

import java.io.IOException;
import java.io.UncheckedIOException;
import java.util.Objects;

/**
 * Fluent builder class that configures and instantiates instances of {@link JacksonAvroSerializer}.
 *
 * @see JacksonAvroSerializer
 */
public class JacksonAvroSerializerBuilder {
    private final ClientLogger logger = new ClientLogger(JacksonAvroSerializerBuilder.class);

    private String schema;
    private AvroMapper avroMapper;

    /**
     * Instantiates a new instance of {@link JacksonAvroSerializer} based on the configurations set on the builder.
     *
     * @return A new instance of {@link JacksonAvroSerializer}.
     * @throws NullPointerException If {@code schema} is {@code null}.
     * @throws UncheckedIOException If {@code schema} cannot be parsed.
     */
    public AvroSerializer build() {
        Objects.requireNonNull(schema, "'schema' cannot be null.");

        AvroMapper buildAvroMapper = (avroMapper == null) ? new AvroMapper() : avroMapper;
        try {
            return new JacksonAvroSerializer(buildAvroMapper.schemaFrom(schema), buildAvroMapper);
        } catch (IOException ex) {
            throw logger.logExceptionAsError(new UncheckedIOException(ex));
        }
    }

    /**
     * Configures the schema that will be associated to the {@link JacksonAvroSerializer} when {@link #build()} is
     * called.
     *
     * @param schema Avro schema to associate to the serializer that is built.
     * @return The updated JacksonAvroSerializerBuilder object.
     */
    public JacksonAvroSerializerBuilder schema(String schema) {
        this.schema = schema;
        return this;
    }

    /**
     * Configures the {@link AvroMapper} that will be used to serialize objects to Avro streams and deserialize Avro
     * streams to objects.
     * <p>
     * If {@code avroMapper} is {@code null} {@link AvroMapper#AvroMapper()} will be used.
     *
     * @param avroMapper The {@link AvroMapper} that will serialize to and deserialize Avro.
     * @return The updated JacksonAvroSerializerBuilder object.
     */
    public JacksonAvroSerializerBuilder avroMapper(AvroMapper avroMapper) {
        this.avroMapper = avroMapper;
        return this;
    }
}


text:
package metricapp.entity.notification;

import org.springframework.data.annotation.CreatedDate;
import org.springframework.data.annotation.Id;
import org.springframework.data.annotation.TypeAlias;
import org.springframework.data.mongodb.core.index.Indexed;
import org.springframework.data.mongodb.core.mapping.Document;

import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;
import metricapp.entity.event.ArtifactScope;
import metricapp.entity.event.Event;
import metricapp.entity.event.EventPhase;
import metricapp.utility.RandomGenerator;

@Data
@AllArgsConstructor
@NoArgsConstructor
@TypeAlias("metricapp.Notification")
@Document(collection = "notifications")
public class Notification {

	@Id
	private String id;
	private String eventId;
	@CreatedDate
	private Long creationDate;
	private EventPhase eventPhase;
	private String authorId;
	private ArtifactScope artifactScope;
	private String artifactId;
	private String description;
	@Indexed
	private String recipient;
	private boolean read;

	public static Notification fromEvent(Event event, String recipient) {
		Notification notification = new Notification();
		notification.setEventId(event.getId());
		notification.setCreationDate(event.getCreationDate());
		notification.setEventPhase(event.getEventPhase());
		notification.setAuthorId(event.getAuthorId());
		notification.setArtifactScope(event.getArtifactScope());
		notification.setArtifactId(event.getArtifactId());
		notification.setDescription(event.getDescription());
		notification.setRecipient(recipient);
		notification.setRead(false);
		return notification;
	}

	public static Notification randomNotification(){
		Notification notification = new Notification();

		notification.setId(RandomGenerator.randomString());
		notification.setEventId(RandomGenerator.randomString());
		notification.setCreationDate(RandomGenerator.randomLong());
		notification.setEventPhase(RandomGenerator.randomEnum(EventPhase.class));
		notification.setAuthorId(RandomGenerator.randomString());
		notification.setArtifactScope(RandomGenerator.randomEnum(ArtifactScope.class));
		notification.setArtifactId(RandomGenerator.randomString());
		notification.setDescription(RandomGenerator.randomString());
		notification.setRecipient(RandomGenerator.randomString());
		notification.setRead(RandomGenerator.randomBoolean());

		return notification;
	}

}


text:
namespace arrow {

class Array;
class DataType;
struct ArrayData;

namespace compute {

class FunctionContext;

/// \brief Invoke hash table kernel on input array, returning any output
/// values. Implementations should be thread-safe
class ARROW_EXPORT HashKernel : public UnaryKernel {
 public:
  // XXX why are those methods exposed?
  virtual Status Reset() = 0;
  virtual Status Append(FunctionContext* ctx, const ArrayData& input) = 0;
  virtual Status Flush(Datum* out) = 0;
  virtual Status GetDictionary(std::shared_ptr<ArrayData>* out) = 0;
};

/// \since 0.8.0
/// \note API not yet finalized
ARROW_EXPORT
Status GetUniqueKernel(FunctionContext* ctx, const std::shared_ptr<DataType>& type,
                       std::unique_ptr<HashKernel>* kernel);

ARROW_EXPORT
Status GetDictionaryEncodeKernel(FunctionContext* ctx,
                                 const std::shared_ptr<DataType>& type,
                                 std::unique_ptr<HashKernel>* kernel);

/// \brief Compute unique elements from an array-like object
/// \param[in] context the FunctionContext
/// \param[in] datum array-like input
/// \param[out] out result as Array
///
/// \since 0.8.0
/// \note API not yet finalized
ARROW_EXPORT
Status Unique(FunctionContext* context, const Datum& datum, std::shared_ptr<Array>* out);

/// \brief Dictionary-encode values in an array-like object
/// \param[in] context the FunctionContext
/// \param[in] data array-like input
/// \param[out] out result with same shape and type as input
///
/// \since 0.8.0
/// \note API not yet finalized
ARROW_EXPORT
Status DictionaryEncode(FunctionContext* context, const Datum& data, Datum* out);

// TODO(wesm): Define API for incremental dictionary encoding

// TODO(wesm): Define API for regularizing DictionaryArray objects with
// different dictionaries

// class DictionaryEncoder {
//  public:
//   virtual Encode(const Datum& data, Datum* out) = 0;
// };

//
// ARROW_EXPORT
// Status DictionaryEncode(FunctionContext* context, const Datum& data,
//                         const Array& prior_dictionary, Datum* out);

// TODO(wesm): Implement these next
// ARROW_EXPORT
// Status Match(FunctionContext* context, const Datum& values, const Datum& member_set,
//              Datum* out);

// ARROW_EXPORT
// Status IsIn(FunctionContext* context, const Datum& values, const Datum& member_set,
//             Datum* out);

// ARROW_EXPORT
// Status CountValues(FunctionContext* context, const Datum& values,
//                    std::shared_ptr<Array>* out_uniques,
//                    std::shared_ptr<Array>* out_counts);

}  // namespace compute
}  // namespace arrow

#endif  // ARROW_COMPUTE_KERNELS_HASH_H


text:
/* eslint-disable */
import * as railroad from 'railroad-diagrams';
/* eslint-enable */
import styles from 'railroad-diagrams/railroad-diagrams.css';

export default function render(elem) {
  const $e = $(elem);
  try {
    const diagramSource = $e.text();

    // context for eval
    /* eslint-disable */
    var Diagram = railroad.Diagram;
    var ComplexDiagram = railroad.ComplexDiagram;
    var Sequence = railroad.Sequence;
    var Stack = railroad.Stack;
    var OptionalSequence = railroad.OptionalSequence;
    var Choice = railroad.Choice;
    var MultipleChoice = railroad.MultipleChoice;
    var Optional = railroad.Optional;
    var OneOrMore = railroad.OneOrMore;
    var ZeroOrMore = railroad.ZeroOrMore;
    var Terminal = railroad.Terminal;
    var NonTerminal = railroad.NonTerminal;
    var Comment = railroad.Comment;
    var Skip = railroad.Skip;
    /* eslint-enable */

    const result = eval(diagramSource).format(); // eslint-disable-line no-eval
    elem.innerHTML = ''; // eslint-disable-line
    result.addTo(elem);
    $e.find('railroad-diagram').attr('class', styles['railroad-diagram']);
  } catch (err) {
    console.log(err);
  }
}


text:
#ifndef RUBY_THREAD_PTHREAD_H
#define RUBY_THREAD_PTHREAD_H

#ifdef HAVE_PTHREAD_NP_H
#include <pthread_np.h>
#endif

#define RB_NATIVETHREAD_LOCK_INIT PTHREAD_MUTEX_INITIALIZER
#define RB_NATIVETHREAD_COND_INIT { PTHREAD_COND_INITIALIZER, }

typedef struct rb_thread_cond_struct {
    pthread_cond_t cond;
#ifdef HAVE_CLOCKID_T
    clockid_t clockid;
#endif
} rb_nativethread_cond_t;

typedef struct native_thread_data_struct {
    struct list_node ubf_list;
    rb_nativethread_cond_t sleep_cond;
} native_thread_data_t;

#undef except
#undef try
#undef leave
#undef finally

typedef struct rb_global_vm_lock_struct {
    /* fast path */
    unsigned long acquired;
    rb_nativethread_lock_t lock;

    /* slow path */
    volatile unsigned long waiting;
    rb_nativethread_cond_t cond;

    /* yield */
    rb_nativethread_cond_t switch_cond;
    rb_nativethread_cond_t switch_wait_cond;
    int need_yield;
    int wait_yield;
} rb_global_vm_lock_t;

#endif /* RUBY_THREAD_PTHREAD_H */


text:
package org.apache.isis.core.metamodel.facets.param.autocomplete.method;

import java.lang.reflect.Method;
import java.util.Collections;
import java.util.List;

import org.apache.isis.core.commons.lang.ObjectExtensions;
import org.apache.isis.core.metamodel.adapter.ObjectAdapter;
import org.apache.isis.core.metamodel.adapter.mgr.AdapterManager;
import org.apache.isis.core.metamodel.facetapi.FacetHolder;
import org.apache.isis.core.metamodel.facets.ImperativeFacet;
import org.apache.isis.core.metamodel.facets.param.autocomplete.ActionParameterAutoCompleteFacetAbstract;
import org.apache.isis.core.metamodel.facets.param.autocomplete.MinLengthUtil;
import org.apache.isis.core.metamodel.spec.ObjectSpecification;
import org.apache.isis.core.metamodel.spec.SpecificationLoader;
import org.apache.isis.core.metamodel.facets.CollectionUtils;

public class ActionParameterAutoCompleteFacetViaMethod extends ActionParameterAutoCompleteFacetAbstract implements ImperativeFacet {

    private final Method method;
    private final Class<?> choicesType;
    private final int minLength;

    public ActionParameterAutoCompleteFacetViaMethod(final Method method, final Class<?> choicesType, final FacetHolder holder, final SpecificationLoader specificationLookup, final AdapterManager adapterManager) {
        super(holder, specificationLookup, adapterManager);
        this.method = method;
        this.choicesType = choicesType;
        this.minLength = MinLengthUtil.determineMinLength(method);
    }

    /**
     * Returns a singleton list of the {@link Method} provided in the
     * constructor.
     */
    @Override
    public List<Method> getMethods() {
        return Collections.singletonList(method);
    }

    @Override
    public Intent getIntent(final Method method) {
        return Intent.CHOICES_OR_AUTOCOMPLETE;
    }

    @Override
    public int getMinLength() {
        return minLength;
    }

    @Override
    public boolean impliesResolve() {
        return true;
    }

    @Override
    public boolean impliesObjectChanged() {
        return false;
    }

    @Override
    public Object[] autoComplete(ObjectAdapter owningAdapter, String searchArg) {
        final Object options = ObjectAdapter.InvokeUtils.invoke(method, owningAdapter, searchArg);
        if (options == null) {
            return new Object[0];
        }
        if (options.getClass().isArray()) {
            return ObjectExtensions.asArray(options);
        } else {
            final ObjectSpecification specification = getSpecification(choicesType);
            return CollectionUtils.getCollectionAsObjectArray(options, specification, getAdapterManager());
        }
    }

    @Override
    protected String toStringValues() {
        return "method=" + method + ",type=" + choicesType;
    }

}


text: Rails.application.config.session_store :cookie_store, key: '_hello_world_session'


text:
var express = require('express');
var mongoose = require('mongoose');
var bodyParser = require('body-parser');

var app = express();
var router = require('./config/routes');
var config = require('./config/env/' + (process.env.NODE_ENV || 'development'));

var port = process.env.PORT || config.port;

var logger = require('./config/logger')(app);

mongoose.connect(process.env.MONGO_URI || config.mongoUri);

app.use(bodyParser.urlencoded({ extended: true }));
app.use(bodyParser.json());

app.use('/v1', router);

app.listen(port, function() {
  logger.info('Express is listening on port: ' + port);
});

module.exports = app;


text:
describe('Page', function() {

    beforeEach(function() {

        var mockDriver = {
            get: sinon.stub(),
            getTitle: sinon.stub(),
            debugger: sinon.stub(),
            findElement: sinon.stub(),
            findElements: sinon.stub(),
            getCurrentUrl: sinon.stub(),
            addMockModule: sinon.stub(),
            clearMockModules: sinon.stub(),
            browser: sinon.stub()
        };

        global.protractor = {
            By:  {
                id: sinon.stub(),
                css: sinon.stub(),
                xpath: sinon.stub(),
                name: sinon.stub(),
                tagName: sinon.stub(),
                className: sinon.stub(),
                linkText: sinon.stub(),
                partialLinkText: sinon.stub(),
                js: sinon.stub(),
                binding: sinon.stub(),
                select: sinon.stub(),
                selectedOption: sinon.stub(),
                input: sinon.stub(),
                model: sinon.stub(),
                textarea: sinon.stub(),
                repeater: sinon.stub(),
                buttonText: sinon.stub(),
                partialButtonText: sinon.stub(),
                cssContainingText: sinon.stub()
            }
        };

        global.browser = mockDriver;

        var mockSerializer = {
            serialize: sinon.stub().returns("serialized script")
        };

        this.mockURL = {
            url: 'fake/url',
            addPath: sinon.stub(),
            addParams: sinon.stub()
        };

        var Page = Sandbox.require('../lib/astrolabe/page', {
            requires: {
                "./utils/url": sinon.stub().withArgs('/').returns(this.mockURL),
                "./utils/serializer": sinon.stub().returns(mockSerializer)
            }
        });

        this.page = new Page();
    });

    it('should have a title', function() {

        this.page.driver.getTitle.returns('page title');

        this.page.title.should.be.string('page title');
    });

    it('should have a currentUrl', function() {

        this.page.driver.getCurrentUrl.returns('http://currentUrl.com');

        this.page.currentUrl.should.be.string('http://currentUrl.com');
    });

    it('should have a baseUrl', function() {

        this.page.driver.baseUrl = 'http://baseUrl.com';

        this.page.baseUrl.should.be.string('http://baseUrl.com');
    });

    it('should find an element', function() {

        this.page.findElement('pageFindElementBy');

        this.page.driver.findElement.should.have.been.calledWithExactly('pageFindElementBy');
    });

    it('should find elements', function() {

        this.page.findElements('pageFindElementsBy');

        this.page.driver.findElements.should.have.been.calledWithExactly('pageFindElementsBy');
    });

    describe('find', function () {
        var selectorStrategies = [ 'id',
                                   'css',
                                   'xpath',
                                   'name',
                                   'tagName',
                                   'className',
                                   'linkText',
                                   'partialLinkText',
                                   'js',
                                   'binding',
                                   'select',
                                   'selectedOption',
                                   'input',
                                   'model',
                                   'textarea',
                                   'repeater',
                                   'buttonText',
                                   'partialButtonText',
                                   'cssContainingText'];

        describe('api', function () {
            selectorStrategies.forEach(function (scenario) {
                it('should find by ' + scenario, function () {
                    this.page.find.by[scenario](scenario);
                    this.page.by[scenario].should.have.been.calledOnce;
                    this.page.driver.findElement.should.have.been.calledOnce;
                    this.page.by[scenario].should.have.been.calledWithExactly(scenario);
                });
            });
        });

        describe('all api', function () {
            selectorStrategies.forEach(function (scenario) {
                it('should find all by ' + scenario, function () {
                    this.page.find.all.by[scenario](scenario);
                    this.page.by[scenario].should.have.been.calledOnce;
                    this.page.driver.findElements.should.have.been.calledOnce;
                    this.page.by[scenario].should.have.been.calledWithExactly(scenario);
                });
            });
        });
    });

    describe('exceptions', function() {
        it('should throw an exception', function() {

            var exception = this.page.exception('CustomException');
            expect(exception.thro).to.throw(exception);

        });
    });

    describe('debug', function() {

        it('should debug a page', function() {

            this.page.debug();

            this.page.driver.debugger.should.have.been.calledOnce;
        });
    });

    describe('go', function() {

        it('should go to / by default', function() {

            this.page.go();

            this.page.driver.get.should.have.been.calledWithExactly('fake/url');
        });

        it('should add paths to base url', function() {

            this.page.go('testPath');

            this.mockURL.addPath.should.have.been.calledOnce;
            this.mockURL.addPath.should.have.been.calledWithExactly('testPath');

            this.mockURL.addParams.should.not.have.been.called;
        });

        it('should add params to base url', function() {

            this.page.go({ test: 'param' });

            this.mockURL.addParams.should.have.been.calledOnce;
            this.mockURL.addParams.should.have.been.calledWithExactly({ test: 'param' });

            this.mockURL.addPath.should.not.have.been.called;
        });

        it('should add paths and params to base url', function() {

            this.page.go('testPath', { test: 'param' }, 'anotherPath');

            this.mockURL.addPath.should.have.been.calledTwice;
            this.mockURL.addPath.firstCall.should.have.been.calledWithExactly('testPath');
            this.mockURL.addPath.secondCall.should.have.been.calledWithExactly('anotherPath');

            this.mockURL.addParams.should.have.been.calledOnce;
            this.mockURL.addParams.should.have.been.calledWithExactly({ test: 'param' });
        });
    });

    describe('mockBackend', function() {

        it('should add a mock angular module with run config', function() {

            this.page.mockBackend(function() { return "test"; });

            this.page.driver.addMockModule.should.have.been.calledOnce;
            this.page.driver.addMockModule.should.have.been.calledWithExactly('httpBackendMock', 'angular.module(\'httpBackendMock\', [\'ngMockE2E\']).run(serialized script);');
        });
    });

    describe('mockModule', function() {

        it('should add a mock angular module', function() {

            this.page.mockModule('myModule', { test: "script" });

            this.page.driver.addMockModule.should.have.been.calledOnce;
            this.page.driver.addMockModule.should.have.been.calledWithExactly('myModuleMock', 'angular.module(\'myModuleMock\', []).value(\'myModule\', serialized script);');
        });
    });

    describe('clearMocks', function() {

        it('should clear all mock angular modules', function() {

            this.page.clearMocks();

            this.page.driver.clearMockModules.should.have.been.calledOnce;
        });
    });
});


text:
<phpunit bootstrap="vendor/autoload.php">
    <testsuites>
        <testsuite name="model-generator">
            <directory>tests</directory>
        </testsuite>
    </testsuites>
</phpunit>


text:
package com.cloud.network.guru;

import com.cloud.dc.Pod;
import com.cloud.dc.StorageNetworkIpAddressVO;
import com.cloud.deploy.DeployDestination;
import com.cloud.deploy.DeploymentPlan;
import com.cloud.exception.InsufficientAddressCapacityException;
import com.cloud.exception.InsufficientVirtualNetworkCapacityException;
import com.cloud.network.Network;
import com.cloud.network.NetworkProfile;
import com.cloud.network.Networks.AddressFormat;
import com.cloud.network.Networks.BroadcastDomainType;
import com.cloud.network.Networks.Mode;
import com.cloud.network.Networks.TrafficType;
import com.cloud.network.StorageNetworkManager;
import com.cloud.network.dao.NetworkDao;
import com.cloud.network.dao.NetworkVO;
import com.cloud.offering.NetworkOffering;
import com.cloud.user.Account;
import com.cloud.utils.net.NetUtils;
import com.cloud.vm.Nic.ReservationStrategy;
import com.cloud.vm.NicProfile;
import com.cloud.vm.ReservationContext;
import com.cloud.vm.VirtualMachineProfile;

import javax.inject.Inject;

import org.slf4j.Logger;
import org.slf4j.LoggerFactory;

public class StorageNetworkGuru extends PodBasedNetworkGuru implements NetworkGuru {
    private static final Logger s_logger = LoggerFactory.getLogger(StorageNetworkGuru.class);
    private static final TrafficType[] TrafficTypes = {TrafficType.Storage};
    @Inject
    StorageNetworkManager _sNwMgr;
    @Inject
    NetworkDao _nwDao;

    protected StorageNetworkGuru() {
        super();
    }

    @Override
    public Network design(final NetworkOffering offering, final DeploymentPlan plan, final Network userSpecified, final Account owner) {
        if (!canHandle(offering)) {
            return null;
        }

        final NetworkVO config =
                new NetworkVO(offering.getTrafficType(), Mode.Static, BroadcastDomainType.Native, offering.getId(), Network.State.Setup, plan.getDataCenterId(),
                        plan.getPhysicalNetworkId(), offering.getRedundantRouter());
        return config;
    }

    protected boolean canHandle(final NetworkOffering offering) {
        if (isMyTrafficType(offering.getTrafficType()) && offering.isSystemOnly()) {
            return true;
        } else {
            s_logger.trace("It's not storage network offering, skip it.");
            return false;
        }
    }

    @Override
    public Network implement(final Network network, final NetworkOffering offering, final DeployDestination destination, final ReservationContext context)
            throws InsufficientVirtualNetworkCapacityException {
        assert network.getTrafficType() == TrafficType.Storage : "Why are you sending this configuration to me " + network;
        if (!_sNwMgr.isStorageIpRangeAvailable(destination.getDataCenter().getId())) {
            return super.implement(network, offering, destination, context);
        }
        return network;
    }

    @Override
    public NicProfile allocate(final Network network, final NicProfile nic, final VirtualMachineProfile vm) throws InsufficientVirtualNetworkCapacityException,
            InsufficientAddressCapacityException {
        assert network.getTrafficType() == TrafficType.Storage : "Well, I can't take care of this config now can I? " + network;
        if (!_sNwMgr.isStorageIpRangeAvailable(network.getDataCenterId())) {
            return super.allocate(network, nic, vm);
        }

        return new NicProfile(ReservationStrategy.Start, null, null, null, null);
    }

    @Override
    public void reserve(final NicProfile nic, final Network network, final VirtualMachineProfile vm, final DeployDestination dest, final ReservationContext context)
            throws InsufficientVirtualNetworkCapacityException, InsufficientAddressCapacityException {
        if (!_sNwMgr.isStorageIpRangeAvailable(dest.getDataCenter().getId())) {
            super.reserve(nic, network, vm, dest, context);
            return;
        }

        final Pod pod = dest.getPod();
        Integer vlan;

        final StorageNetworkIpAddressVO ip = _sNwMgr.acquireIpAddress(pod.getId());
        if (ip == null) {
            throw new InsufficientAddressCapacityException("Unable to get a storage network ip address", Pod.class, pod.getId());
        }

        vlan = ip.getVlan();
        nic.setIPv4Address(ip.getIpAddress());
        nic.setMacAddress(NetUtils.long2Mac(NetUtils.createSequenceBasedMacAddress(ip.getMac())));
        nic.setFormat(AddressFormat.Ip4);
        nic.setIPv4Netmask(ip.getNetmask());
        nic.setBroadcastType(BroadcastDomainType.Storage);
        nic.setIPv4Gateway(ip.getGateway());
        if (vlan != null) {
            nic.setBroadcastUri(BroadcastDomainType.Storage.toUri(vlan));
        } else {
            nic.setBroadcastUri(null);
        }
        nic.setIsolationUri(null);
        s_logger.debug("Allocated a storage nic " + nic + " for " + vm);
    }

    @Override
    public boolean release(final NicProfile nic, final VirtualMachineProfile vm, final String reservationId) {
        final Network nw = _nwDao.findById(nic.getNetworkId());
        if (!_sNwMgr.isStorageIpRangeAvailable(nw.getDataCenterId())) {
            return super.release(nic, vm, reservationId);
        }

        _sNwMgr.releaseIpAddress(nic.getIPv4Address());
        s_logger.debug("Release an storage ip " + nic.getIPv4Address());
        nic.deallocate();
        return true;
    }

    @Override
    public void deallocate(final Network network, final NicProfile nic, final VirtualMachineProfile vm) {
        // TODO Auto-generated method stub

    }

    @Override
    public void updateNicProfile(final NicProfile profile, final Network network) {
        // TODO Auto-generated method stub

    }

    @Override
    public void shutdown(final NetworkProfile network, final NetworkOffering offering) {
        // TODO Auto-generated method stub

    }

    @Override
    public boolean trash(final Network network, final NetworkOffering offering) {
        // TODO Auto-generated method stub
        return false;
    }

    @Override
    public void updateNetworkProfile(final NetworkProfile networkProfile) {
        // TODO Auto-generated method stub

    }

    @Override
    public TrafficType[] getSupportedTrafficType() {
        return TrafficTypes;
    }

    @Override
    public boolean isMyTrafficType(final TrafficType type) {
        for (final TrafficType t : TrafficTypes) {
            if (t == type) {
                return true;
            }
        }
        return false;
    }
}


text:
ACCEPTED

#### According to
Index Fungorum

#### Published in
null

#### Original name
Calicium viride subsp. deminuens Vain.

### Remarks
null


text:
require 'test_helper'
require 'rails_ops/authorization_backend/can_can_can'
require 'cancancan'

class RailsOps::Operation::UpdateLazyAuthTest < ActiveSupport::TestCase
  include TestHelper

  BASIC_OP = Class.new(RailsOps::Operation::Model::Update) do
    model ::Group

    model_authorization_action :update, lazy: true

    def perform
      fail osparams.exception if osparams.exception
      @done = true
    end
  end

  ABILITY = Class.new do
    include CanCan::Ability

    def initialize(read: false, update: false)
      can :read, Group if read
      can :update, Group if update
    end
  end

  setup do
    Group.delete_all
    Group.create!(id: 1, name: 'Group')
    RailsOps.config.authorization_backend = 'RailsOps::AuthorizationBackend::CanCanCan'
  end

  def test_unpermitted_read
    ctx = RailsOps::Context.new(ability: ABILITY.new)
    assert_raises CanCan::AccessDenied do
      BASIC_OP.new(ctx, id: 1)
    end
  end

  def test_permitted_read
    ctx = RailsOps::Context.new(ability: ABILITY.new(read: true))
    assert_nothing_raised do
      BASIC_OP.new(ctx, id: 1)
    end
  end

  def test_unpermitted_update
    ctx = RailsOps::Context.new(ability: ABILITY.new(read: true))
    op = BASIC_OP.new(ctx, id: 1)
    assert_raises CanCan::AccessDenied do
      op.run!
    end
  end

  def test_permitted_update
    ctx = RailsOps::Context.new(ability: ABILITY.new(read: true, update: true))
    op = BASIC_OP.new(ctx, id: 1)
    assert_nothing_raised do
      op.run!
    end
  end
end


text:
package org.apache.directory.api.asn1.ber;

import java.nio.ByteBuffer;

import org.apache.directory.api.asn1.ber.grammar.Grammar;
import org.apache.directory.api.asn1.ber.tlv.TLV;
import org.apache.directory.api.asn1.ber.tlv.TLVStateEnum;

/**
 * Every ASN1 container must implement this interface.
 *
 * @author Apache Directory Project
 */
public interface Asn1Container
{
    /**
     * Gets the current stream containing the bytes to decode
     *
     * @return The current stream
     */
    ByteBuffer getStream();

    /**
     * Stores the Stream being decoded
     *
     * @param stream The stream being decoded
     */
    void setStream( ByteBuffer stream );

    /**
     * Gets the current grammar state
     *
     * @return Returns the current grammar state
     */
    TLVStateEnum getState();

    /**
     * Sets the new current state
     *
     * @param state The new state
     */
    void setState( TLVStateEnum state );

    /**
     * Gets the currentTLV
     *
     * @return Returns the current TLV being decoded
     */
    TLV getCurrentTLV();

    /**
     * Sets the current TLV
     *
     * @param tlv The current TLV
     */
    void setCurrentTLV( TLV tlv );

    /**
     * Gets the grammar
     *
     * @return Returns the grammar used to decode a LdapMessage.
     */
    @SuppressWarnings("rawtypes")
    Grammar getGrammar();

    /**
     * Gets the transition
     *
     * @return Returns the transition from the previous state to the new state
     */
    Enum<?> getTransition();

    /**
     * Updates the transition from a state to another
     *
     * @param transition The transition to set
     */
    void setTransition( Enum<?> transition );

    /**
     * @return The parent TLV.
     */
    TLV getParentTLV();

    /**
     * Sets the parent TLV
     *
     * @param parentTLV The new parent TLV
     */
    void setParentTLV( TLV parentTLV );

    /**
     * Checks that we can have a end state after this transition
     *
     * @return true if this can be the last transition
     */
    boolean isGrammarEndAllowed();

    /**
     * Sets the flag to allow a end transition
     *
     * @param grammarEndAllowed true or false, depending on the next transition
     * being an end or not.
     */
    void setGrammarEndAllowed( boolean grammarEndAllowed );

    /**
     * Gets a new TLV id
     * @return a unique value representing the current TLV id
     */
    int getNewTlvId();

    /**
     * Gets the current TLV id
     * @return a unique value representing the current TLV id
     */
    int getTlvId();

    /**
     * @return The number of decoded bytes for this message. This is used
     * to control the PDU size and avoid PDU exceeding the maximum allowed
     * size to break the server.
     */
    int getDecodeBytes();

    /**
     * Increment the decodedBytes by the latest received buffer's size.
     * @param nb The buffer size.
     */
    void incrementDecodeBytes( int nb );

    /**
     * @return The maximum PDU size.
     */
    int getMaxPDUSize();

    /**
     * Set the maximum PDU size.
     * @param maxPDUSize The maximum PDU size (if negative or null, will be
     * replaced by the max integer value)
     */
    void setMaxPDUSize( int maxPDUSize );

    /**
     * Move backward in the stream to the first byte for a given TLV. This is useful when we have
     * read some Tag and Length in order to define the next transition, and if this transition
     * do a grammar switch.
     * @param tlv The TLV to roll-back
     */
    void rewind();

    /**
     * Update the parent's length
     */
    void updateParent();

    /**
     * @return true if the container should gather the value into itself, false
     * if the decoding of the Value part should be done immediately for
     * constructed types.
     */
    boolean isGathering();

    /**
     * Set the isGathering flag
     * @param isGathering true to ask the Asn1Decoder to gather the data
     * into the container. If not set, the default value is 'false'
     */
    void setGathering( boolean isGathering );
}


text:
var myModule = angular.module("MyModule", []);
myModule.directive("hello", function() {
    return {
    	restrict:"AE",
    	transclude:true,
    	template:"
Hello everyone!

"
    }
});


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">
    <title>Get Lucid</title>

    <link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/semantic-ui/2.1.0/semantic.min.css">
    <link rel="stylesheet" href="/get-lucid/css/styles.css">

Get Lucid

        <?php if(isset($_SESSION['username'])) { ?>

Logged in as <?php echo $_SESSION['username']; ?>

        <?php }; ?>

          Home
          Dreams
          <?php if(isset($_SESSION['username'])) { ?>
             Logout
          <?php } else { ?>
             Login
          <?php } ?>


text:
<!DOCTYPE HTML>

    <meta charset="utf-8">
    <link rel="shortcut icon" href="./favicon.ico" />
    <title>CrossedUp</title>
    <link rel="stylesheet" href="./fonts/fira.css">
    <link rel="stylesheet" type="text/css" href="/fonts/stylesheet.css">
    <link rel="stylesheet" type="text/css" href="/stylesheets/stylesheet.css">
    <link rel="stylesheet" type="text/css" href="/stylesheets/reset.css">
    <link rel="stylesheet" type="text/css" href="/stylesheets/font-awesome.min.css">

        	    Placeholder text, I hate parallax scrolling

        	    "Holy smokes there's even more!"

Crossed
up

          18 Jul 2014

          Website Designs

        « Prev

          1

          2

          3

          4

        Next »

About me

My name's Raphael Ho.
This is my blog.

©2014 Raphael Ho


text:
class Base:
    def __init__(self, client):
        self.client = client


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

package com.google.cloud.compute.v1;

/**
 *
 *
 *

 *

 *
 * Protobuf type {@code google.cloud.compute.v1.SslPolicyReference}
 */
public final class SslPolicyReference extends com.google.protobuf.GeneratedMessageV3
    implements
    // @@protoc_insertion_point(message_implements:google.cloud.compute.v1.SslPolicyReference)
    SslPolicyReferenceOrBuilder {
  private static final long serialVersionUID = 0L;
  // Use SslPolicyReference.newBuilder() to construct.
  private SslPolicyReference(com.google.protobuf.GeneratedMessageV3.Builder<?> builder) {
    super(builder);
  }

  private SslPolicyReference() {
    sslPolicy_ = "";
  }

  @java.lang.Override
  @SuppressWarnings({"unused"})
  protected java.lang.Object newInstance(UnusedPrivateParameter unused) {
    return new SslPolicyReference();
  }

  @java.lang.Override
  public final com.google.protobuf.UnknownFieldSet getUnknownFields() {
    return this.unknownFields;
  }

  public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() {
    return com.google.cloud.compute.v1.Compute
        .internal_static_google_cloud_compute_v1_SslPolicyReference_descriptor;
  }

  @java.lang.Override
  protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable
      internalGetFieldAccessorTable() {
    return com.google.cloud.compute.v1.Compute
        .internal_static_google_cloud_compute_v1_SslPolicyReference_fieldAccessorTable
        .ensureFieldAccessorsInitialized(
            com.google.cloud.compute.v1.SslPolicyReference.class,
            com.google.cloud.compute.v1.SslPolicyReference.Builder.class);
  }

  private int bitField0_;
  public static final int SSL_POLICY_FIELD_NUMBER = 295190213;
  private volatile java.lang.Object sslPolicy_;
  /**
   *
   *
   *

   * URL of the SSL policy resource. Set this to empty string to clear any existing SSL policy associated with the target proxy resource.
   *

   *
   * optional string ssl_policy = 295190213;
   *
   * @return Whether the sslPolicy field is set.
   */
  @java.lang.Override
  public boolean hasSslPolicy() {
    return ((bitField0_ & 0x00000001) != 0);
  }
  /**
   *
   *
   *

   * URL of the SSL policy resource. Set this to empty string to clear any existing SSL policy associated with the target proxy resource.
   *

   *
   * optional string ssl_policy = 295190213;
   *
   * @return The sslPolicy.
   */
  @java.lang.Override
  public java.lang.String getSslPolicy() {
    java.lang.Object ref = sslPolicy_;
    if (ref instanceof java.lang.String) {
      return (java.lang.String) ref;
    } else {
      com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref;
      java.lang.String s = bs.toStringUtf8();
      sslPolicy_ = s;
      return s;
    }
  }
  /**
   *
   *
   *

   * URL of the SSL policy resource. Set this to empty string to clear any existing SSL policy associated with the target proxy resource.
   *

   *
   * optional string ssl_policy = 295190213;
   *
   * @return The bytes for sslPolicy.
   */
  @java.lang.Override
  public com.google.protobuf.ByteString getSslPolicyBytes() {
    java.lang.Object ref = sslPolicy_;
    if (ref instanceof java.lang.String) {
      com.google.protobuf.ByteString b =
          com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref);
      sslPolicy_ = b;
      return b;
    } else {
      return (com.google.protobuf.ByteString) ref;
    }
  }

  private byte memoizedIsInitialized = -1;

  @java.lang.Override
  public final boolean isInitialized() {
    byte isInitialized = memoizedIsInitialized;
    if (isInitialized == 1) return true;
    if (isInitialized == 0) return false;

    memoizedIsInitialized = 1;
    return true;
  }

  @java.lang.Override
  public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io.IOException {
    if (((bitField0_ & 0x00000001) != 0)) {
      com.google.protobuf.GeneratedMessageV3.writeString(output, 295190213, sslPolicy_);
    }
    getUnknownFields().writeTo(output);
  }

  @java.lang.Override
  public int getSerializedSize() {
    int size = memoizedSize;
    if (size != -1) return size;

    size = 0;
    if (((bitField0_ & 0x00000001) != 0)) {
      size += com.google.protobuf.GeneratedMessageV3.computeStringSize(295190213, sslPolicy_);
    }
    size += getUnknownFields().getSerializedSize();
    memoizedSize = size;
    return size;
  }

  @java.lang.Override
  public boolean equals(final java.lang.Object obj) {
    if (obj == this) {
      return true;
    }
    if (!(obj instanceof com.google.cloud.compute.v1.SslPolicyReference)) {
      return super.equals(obj);
    }
    com.google.cloud.compute.v1.SslPolicyReference other =
        (com.google.cloud.compute.v1.SslPolicyReference) obj;

    if (hasSslPolicy() != other.hasSslPolicy()) return false;
    if (hasSslPolicy()) {
      if (!getSslPolicy().equals(other.getSslPolicy())) return false;
    }
    if (!getUnknownFields().equals(other.getUnknownFields())) return false;
    return true;
  }

  @java.lang.Override
  public int hashCode() {
    if (memoizedHashCode != 0) {
      return memoizedHashCode;
    }
    int hash = 41;
    hash = (19 * hash) + getDescriptor().hashCode();
    if (hasSslPolicy()) {
      hash = (37 * hash) + SSL_POLICY_FIELD_NUMBER;
      hash = (53 * hash) + getSslPolicy().hashCode();
    }
    hash = (29 * hash) + getUnknownFields().hashCode();
    memoizedHashCode = hash;
    return hash;
  }

  public static com.google.cloud.compute.v1.SslPolicyReference parseFrom(java.nio.ByteBuffer data)
      throws com.google.protobuf.InvalidProtocolBufferException {
    return PARSER.parseFrom(data);
  }

  public static com.google.cloud.compute.v1.SslPolicyReference parseFrom(
      java.nio.ByteBuffer data, com.google.protobuf.ExtensionRegistryLite extensionRegistry)
      throws com.google.protobuf.InvalidProtocolBufferException {
    return PARSER.parseFrom(data, extensionRegistry);
  }

  public static com.google.cloud.compute.v1.SslPolicyReference parseFrom(
      com.google.protobuf.ByteString data)
      throws com.google.protobuf.InvalidProtocolBufferException {
    return PARSER.parseFrom(data);
  }

  public static com.google.cloud.compute.v1.SslPolicyReference parseFrom(
      com.google.protobuf.ByteString data,
      com.google.protobuf.ExtensionRegistryLite extensionRegistry)
      throws com.google.protobuf.InvalidProtocolBufferException {
    return PARSER.parseFrom(data, extensionRegistry);
  }

  public static com.google.cloud.compute.v1.SslPolicyReference parseFrom(byte[] data)
      throws com.google.protobuf.InvalidProtocolBufferException {
    return PARSER.parseFrom(data);
  }

  public static com.google.cloud.compute.v1.SslPolicyReference parseFrom(
      byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry)
      throws com.google.protobuf.InvalidProtocolBufferException {
    return PARSER.parseFrom(data, extensionRegistry);
  }

  public static com.google.cloud.compute.v1.SslPolicyReference parseFrom(java.io.InputStream input)
      throws java.io.IOException {
    return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input);
  }

  public static com.google.cloud.compute.v1.SslPolicyReference parseFrom(
      java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry)
      throws java.io.IOException {
    return com.google.protobuf.GeneratedMessageV3.parseWithIOException(
        PARSER, input, extensionRegistry);
  }

  public static com.google.cloud.compute.v1.SslPolicyReference parseDelimitedFrom(
      java.io.InputStream input) throws java.io.IOException {
    return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input);
  }

  public static com.google.cloud.compute.v1.SslPolicyReference parseDelimitedFrom(
      java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry)
      throws java.io.IOException {
    return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(
        PARSER, input, extensionRegistry);
  }

  public static com.google.cloud.compute.v1.SslPolicyReference parseFrom(
      com.google.protobuf.CodedInputStream input) throws java.io.IOException {
    return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input);
  }

  public static com.google.cloud.compute.v1.SslPolicyReference parseFrom(
      com.google.protobuf.CodedInputStream input,
      com.google.protobuf.ExtensionRegistryLite extensionRegistry)
      throws java.io.IOException {
    return com.google.protobuf.GeneratedMessageV3.parseWithIOException(
        PARSER, input, extensionRegistry);
  }

  @java.lang.Override
  public Builder newBuilderForType() {
    return newBuilder();
  }

  public static Builder newBuilder() {
    return DEFAULT_INSTANCE.toBuilder();
  }

  public static Builder newBuilder(com.google.cloud.compute.v1.SslPolicyReference prototype) {
    return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype);
  }

  @java.lang.Override
  public Builder toBuilder() {
    return this == DEFAULT_INSTANCE ? new Builder() : new Builder().mergeFrom(this);
  }

  @java.lang.Override
  protected Builder newBuilderForType(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) {
    Builder builder = new Builder(parent);
    return builder;
  }
  /**
   *
   *
   *

   *

   *
   * Protobuf type {@code google.cloud.compute.v1.SslPolicyReference}
   */
  public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder<Builder>
      implements
      // @@protoc_insertion_point(builder_implements:google.cloud.compute.v1.SslPolicyReference)
      com.google.cloud.compute.v1.SslPolicyReferenceOrBuilder {
    public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() {
      return com.google.cloud.compute.v1.Compute
          .internal_static_google_cloud_compute_v1_SslPolicyReference_descriptor;
    }

    @java.lang.Override
    protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable
        internalGetFieldAccessorTable() {
      return com.google.cloud.compute.v1.Compute
          .internal_static_google_cloud_compute_v1_SslPolicyReference_fieldAccessorTable
          .ensureFieldAccessorsInitialized(
              com.google.cloud.compute.v1.SslPolicyReference.class,
              com.google.cloud.compute.v1.SslPolicyReference.Builder.class);
    }

    // Construct using com.google.cloud.compute.v1.SslPolicyReference.newBuilder()
    private Builder() {}

    private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) {
      super(parent);
    }

    @java.lang.Override
    public Builder clear() {
      super.clear();
      sslPolicy_ = "";
      bitField0_ = (bitField0_ & ~0x00000001);
      return this;
    }

    @java.lang.Override
    public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() {
      return com.google.cloud.compute.v1.Compute
          .internal_static_google_cloud_compute_v1_SslPolicyReference_descriptor;
    }

    @java.lang.Override
    public com.google.cloud.compute.v1.SslPolicyReference getDefaultInstanceForType() {
      return com.google.cloud.compute.v1.SslPolicyReference.getDefaultInstance();
    }

    @java.lang.Override
    public com.google.cloud.compute.v1.SslPolicyReference build() {
      com.google.cloud.compute.v1.SslPolicyReference result = buildPartial();
      if (!result.isInitialized()) {
        throw newUninitializedMessageException(result);
      }
      return result;
    }

    @java.lang.Override
    public com.google.cloud.compute.v1.SslPolicyReference buildPartial() {
      com.google.cloud.compute.v1.SslPolicyReference result =
          new com.google.cloud.compute.v1.SslPolicyReference(this);
      int from_bitField0_ = bitField0_;
      int to_bitField0_ = 0;
      if (((from_bitField0_ & 0x00000001) != 0)) {
        to_bitField0_ |= 0x00000001;
      }
      result.sslPolicy_ = sslPolicy_;
      result.bitField0_ = to_bitField0_;
      onBuilt();
      return result;
    }

    @java.lang.Override
    public Builder clone() {
      return super.clone();
    }

    @java.lang.Override
    public Builder setField(
        com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) {
      return super.setField(field, value);
    }

    @java.lang.Override
    public Builder clearField(com.google.protobuf.Descriptors.FieldDescriptor field) {
      return super.clearField(field);
    }

    @java.lang.Override
    public Builder clearOneof(com.google.protobuf.Descriptors.OneofDescriptor oneof) {
      return super.clearOneof(oneof);
    }

    @java.lang.Override
    public Builder setRepeatedField(
        com.google.protobuf.Descriptors.FieldDescriptor field, int index, java.lang.Object value) {
      return super.setRepeatedField(field, index, value);
    }

    @java.lang.Override
    public Builder addRepeatedField(
        com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) {
      return super.addRepeatedField(field, value);
    }

    @java.lang.Override
    public Builder mergeFrom(com.google.protobuf.Message other) {
      if (other instanceof com.google.cloud.compute.v1.SslPolicyReference) {
        return mergeFrom((com.google.cloud.compute.v1.SslPolicyReference) other);
      } else {
        super.mergeFrom(other);
        return this;
      }
    }

    public Builder mergeFrom(com.google.cloud.compute.v1.SslPolicyReference other) {
      if (other == com.google.cloud.compute.v1.SslPolicyReference.getDefaultInstance()) return this;
      if (other.hasSslPolicy()) {
        bitField0_ |= 0x00000001;
        sslPolicy_ = other.sslPolicy_;
        onChanged();
      }
      this.mergeUnknownFields(other.getUnknownFields());
      onChanged();
      return this;
    }

    @java.lang.Override
    public final boolean isInitialized() {
      return true;
    }

    @java.lang.Override
    public Builder mergeFrom(
        com.google.protobuf.CodedInputStream input,
        com.google.protobuf.ExtensionRegistryLite extensionRegistry)
        throws java.io.IOException {
      if (extensionRegistry == null) {
        throw new java.lang.NullPointerException();
      }
      try {
        boolean done = false;
        while (!done) {
          int tag = input.readTag();
          switch (tag) {
            case 0:
              done = true;
              break;
            case -1933445590:
              {
                sslPolicy_ = input.readStringRequireUtf8();
                bitField0_ |= 0x00000001;
                break;
              } // case -1933445590
            default:
              {
                if (!super.parseUnknownField(input, extensionRegistry, tag)) {
                  done = true; // was an endgroup tag
                }
                break;
              } // default:
          } // switch (tag)
        } // while (!done)
      } catch (com.google.protobuf.InvalidProtocolBufferException e) {
        throw e.unwrapIOException();
      } finally {
        onChanged();
      } // finally
      return this;
    }

    private int bitField0_;

    private java.lang.Object sslPolicy_ = "";
    /**
     *
     *
     *

     * URL of the SSL policy resource. Set this to empty string to clear any existing SSL policy associated with the target proxy resource.
     *

     *
     * optional string ssl_policy = 295190213;
     *
     * @return Whether the sslPolicy field is set.
     */
    public boolean hasSslPolicy() {
      return ((bitField0_ & 0x00000001) != 0);
    }
    /**
     *
     *
     *

     * URL of the SSL policy resource. Set this to empty string to clear any existing SSL policy associated with the target proxy resource.
     *

     *
     * optional string ssl_policy = 295190213;
     *
     * @return The sslPolicy.
     */
    public java.lang.String getSslPolicy() {
      java.lang.Object ref = sslPolicy_;
      if (!(ref instanceof java.lang.String)) {
        com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref;
        java.lang.String s = bs.toStringUtf8();
        sslPolicy_ = s;
        return s;
      } else {
        return (java.lang.String) ref;
      }
    }
    /**
     *
     *
     *

     * URL of the SSL policy resource. Set this to empty string to clear any existing SSL policy associated with the target proxy resource.
     *

     *
     * optional string ssl_policy = 295190213;
     *
     * @return The bytes for sslPolicy.
     */
    public com.google.protobuf.ByteString getSslPolicyBytes() {
      java.lang.Object ref = sslPolicy_;
      if (ref instanceof String) {
        com.google.protobuf.ByteString b =
            com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref);
        sslPolicy_ = b;
        return b;
      } else {
        return (com.google.protobuf.ByteString) ref;
      }
    }
    /**
     *
     *
     *

     * URL of the SSL policy resource. Set this to empty string to clear any existing SSL policy associated with the target proxy resource.
     *

     *
     * optional string ssl_policy = 295190213;
     *
     * @param value The sslPolicy to set.
     * @return This builder for chaining.
     */
    public Builder setSslPolicy(java.lang.String value) {
      if (value == null) {
        throw new NullPointerException();
      }
      bitField0_ |= 0x00000001;
      sslPolicy_ = value;
      onChanged();
      return this;
    }
    /**
     *
     *
     *

     * URL of the SSL policy resource. Set this to empty string to clear any existing SSL policy associated with the target proxy resource.
     *

     *
     * optional string ssl_policy = 295190213;
     *
     * @return This builder for chaining.
     */
    public Builder clearSslPolicy() {
      bitField0_ = (bitField0_ & ~0x00000001);
      sslPolicy_ = getDefaultInstance().getSslPolicy();
      onChanged();
      return this;
    }
    /**
     *
     *
     *

     * URL of the SSL policy resource. Set this to empty string to clear any existing SSL policy associated with the target proxy resource.
     *

     *
     * optional string ssl_policy = 295190213;
     *
     * @param value The bytes for sslPolicy to set.
     * @return This builder for chaining.
     */
    public Builder setSslPolicyBytes(com.google.protobuf.ByteString value) {
      if (value == null) {
        throw new NullPointerException();
      }
      checkByteStringIsUtf8(value);
      bitField0_ |= 0x00000001;
      sslPolicy_ = value;
      onChanged();
      return this;
    }

    @java.lang.Override
    public final Builder setUnknownFields(final com.google.protobuf.UnknownFieldSet unknownFields) {
      return super.setUnknownFields(unknownFields);
    }

    @java.lang.Override
    public final Builder mergeUnknownFields(
        final com.google.protobuf.UnknownFieldSet unknownFields) {
      return super.mergeUnknownFields(unknownFields);
    }

    // @@protoc_insertion_point(builder_scope:google.cloud.compute.v1.SslPolicyReference)
  }

  // @@protoc_insertion_point(class_scope:google.cloud.compute.v1.SslPolicyReference)
  private static final com.google.cloud.compute.v1.SslPolicyReference DEFAULT_INSTANCE;

  static {
    DEFAULT_INSTANCE = new com.google.cloud.compute.v1.SslPolicyReference();
  }

  public static com.google.cloud.compute.v1.SslPolicyReference getDefaultInstance() {
    return DEFAULT_INSTANCE;
  }

  private static final com.google.protobuf.Parser<SslPolicyReference> PARSER =
      new com.google.protobuf.AbstractParser<SslPolicyReference>() {
        @java.lang.Override
        public SslPolicyReference parsePartialFrom(
            com.google.protobuf.CodedInputStream input,
            com.google.protobuf.ExtensionRegistryLite extensionRegistry)
            throws com.google.protobuf.InvalidProtocolBufferException {
          Builder builder = newBuilder();
          try {
            builder.mergeFrom(input, extensionRegistry);
          } catch (com.google.protobuf.InvalidProtocolBufferException e) {
            throw e.setUnfinishedMessage(builder.buildPartial());
          } catch (com.google.protobuf.UninitializedMessageException e) {
            throw e.asInvalidProtocolBufferException().setUnfinishedMessage(builder.buildPartial());
          } catch (java.io.IOException e) {
            throw new com.google.protobuf.InvalidProtocolBufferException(e)
                .setUnfinishedMessage(builder.buildPartial());
          }
          return builder.buildPartial();
        }
      };

  public static com.google.protobuf.Parser<SslPolicyReference> parser() {
    return PARSER;
  }

  @java.lang.Override
  public com.google.protobuf.Parser<SslPolicyReference> getParserForType() {
    return PARSER;
  }

  @java.lang.Override
  public com.google.cloud.compute.v1.SslPolicyReference getDefaultInstanceForType() {
    return DEFAULT_INSTANCE;
  }
}