text:
<?php

namespace Siefa\Globales\GeograficosBundle\Entity;

use Doctrine\ORM\Mapping as ORM;
use Gedmo\Mapping\Annotation as Gedmo;
use Siefa\CommonsBundle\Model\Entity\SiefaEntity;
use Symfony\Component\Validator\Constraints as Assert;
use Symfony\Bridge\Doctrine\Validator\Constraints\UniqueEntity;

/**
 * Pais
 *
 * @ORM\Table(name="pais")
 * @ORM\Entity
 * @UniqueEntity("codigo")
 * @Gedmo\SoftDeleteable(fieldName="deletedAt", timeAware=false)
 */
class Pais extends SiefaEntity
{
    /**
     * @var integer
     *
     * @ORM\Column(name="pais_id", type="integer", nullable=false)
     * @ORM\Id
     * @ORM\GeneratedValue(strategy="SEQUENCE")
     * @ORM\SequenceGenerator(sequenceName="pais_pais_id_seq", allocationSize=1, initialValue=1)
     */
    private $paisId;

    /**
     * @var \DateTime
     * @Gedmo\Timestampable(on="create")
     * @Gedmo\Timestampable(on="update")
     * @ORM\Column(name="fecha_registro", type="datetime", nullable=false)
     */
    private $fechaRegistro;

    /**
     * @var string
     * @Assert\NotBlank()
     * @ORM\Column(name="codigo", type="string", length=5, nullable=false)
     */
    private $codigo;

    /**
     * @var string
     * @Assert\NotBlank()
     * @ORM\Column(name="descripcion", type="string", length=250, nullable=false)
     */
    private $descripcion;

    /**
     * @var datetime
     * @ORM\Column(name="deleted_at", type="datetime", nullable=true)
     */
    private $deletedAt;

    /**
     * Get paisId
     *
     * @return integer
     */
    public function getPaisId()
    {
        return $this->paisId;
    }

    /**
     * Set fechaRegistro
     *
     * @param \DateTime $fechaRegistro
     * @return Pais
     */
    public function setFechaRegistro($fechaRegistro)
    {
        $this->fechaRegistro = $fechaRegistro;

        return $this;
    }

    /**
     * Get fechaRegistro
     *
     * @return \DateTime
     */
    public function getFechaRegistro()
    {
        return $this->fechaRegistro;
    }

    /**
     * Set codigo
     *
     * @param string $codigo
     * @return Pais
     */
    public function setCodigo($codigo)
    {
        $this->codigo = $codigo;

        return $this;
    }

    /**
     * Get codigo
     *
     * @return string
     */
    public function getCodigo()
    {
        return $this->codigo;
    }

    /**
     * Set descripcion
     *
     * @param string $descripcion
     * @return Pais
     */
    public function setDescripcion($descripcion)
    {
        $this->descripcion = $descripcion;

        return $this;
    }

    /**
     * Get descripcion
     *
     * @return string
     */
    public function getDescripcion()
    {
        return $this->descripcion;
    }

    /**
     * Set deletedAt
     *
     * @param boolean $deletedAt
     * @return Pais
     */
    public function setDeletedAt($deletedAt)
    {
        $this->deletedAt = $deletedAt;

        return $this;
    }

    /**
     * Get deletedAt
     *
     * @return boolean
     */
    public function getDeletedAt()
    {
        return $this->deletedAt;
    }

    public function __toString() {
        return $this->descripcion;
    }
}

redpajama_set_name: RedPajamaGithub


text:
// Copyright 2014 The Go Authors. All rights reserved.
// Use of this source code is governed by a BSD-style
// license that can be found in the LICENSE file.

// Test that pthread_cancel works as expected
// (NPTL uses SIGRTMIN to implement thread cancelation)
// See https://golang.org/issue/6997
package cgotest

/*
#cgo CFLAGS: -pthread
#cgo LDFLAGS: -pthread
extern int StartThread();
extern int CancelThread();
*/
import "C"

import "testing"
import "time"

func test6997(t *testing.T) {
	r := C.StartThread()
	if r != 0 {
		t.Error("pthread_create failed")
	}
	c := make(chan C.int)
	go func() {
		time.Sleep(500 * time.Millisecond)
		c <- C.CancelThread()
	}()

	select {
	case r = <-c:
		if r == 0 {
			t.Error("pthread finished but wasn't canceled??")
		}
	case <-time.After(30 * time.Second):
		t.Error("hung in pthread_cancel/pthread_join")
	}
}


text:
// RUN: %libomp-compile-and-run
#include <stdio.h>
#include <stdlib.h>
#include "omp_testsuite.h"
#include "omp_my_sleep.h"

#define CFSMAX_SIZE 1000
#define MAX_TIME 0.01

#ifdef SLEEPTIME
#undef SLEEPTIME
#define SLEEPTIME 0.0005
#endif

int test_omp_for_schedule_static()
{
  int threads;
  int i,lasttid;
  int * tids;
  int notout;
  int maxiter;
  int chunk_size;
  int counter = 0;
  int tmp_count=1;
  int lastthreadsstarttid = -1;
  int result = 1;

  chunk_size = 7;
  tids = (int *) malloc (sizeof (int) * (CFSMAX_SIZE + 1));
  notout = 1;
  maxiter = 0;

  #pragma omp parallel shared(tids,counter)
  {  /* begin of parallel*/
    #pragma omp single
    {
      threads = omp_get_num_threads ();
    }  /* end of single */
  }  /* end of parallel */

  if (threads < 2) {
    omp_set_num_threads(2);
    threads = 2;
  }
  fprintf (stderr,"Using an internal count of %d\nUsing a specified"
    " chunksize of %d\n", CFSMAX_SIZE, chunk_size);
  tids[CFSMAX_SIZE] = -1;  /* setting endflag */
  #pragma omp parallel shared(tids)
  { /* begin of parallel */
    double count;
    int tid;
    int j;

    tid = omp_get_thread_num ();

    #pragma omp for nowait schedule(static,chunk_size)
    for(j = 0; j < CFSMAX_SIZE; ++j) {
      count = 0.;
      #pragma omp flush(maxiter)
      if (j > maxiter) {
        #pragma omp critical
        {
          maxiter = j;
        }
      }
      /*printf ("thread %d sleeping\n", tid);*/
      while (notout && (count < MAX_TIME) && (maxiter == j)) {
        #pragma omp flush(maxiter,notout)
        my_sleep (SLEEPTIME);
        count += SLEEPTIME;
        printf(".");
      }
#ifdef VERBOSE
      if (count > 0.) printf(" waited %lf s\n", count);
#endif
      /*printf ("thread %d awake\n", tid);*/
      tids[j] = tid;
#ifdef VERBOSE
      printf("%d finished by %d\n",j,tid);
#endif
    } /* end of for */
    notout = 0;
    #pragma omp flush(maxiter,notout)
  } /* end of parallel */

  /**** analysing the data in array tids ****/

  lasttid = tids[0];
  tmp_count = 0;

  for (i = 0; i < CFSMAX_SIZE + 1; ++i) {
    /* If the work  was done by the same thread increase tmp_count by one. */
    if (tids[i] == lasttid) {
      tmp_count++;
#ifdef VERBOSE
      fprintf (stderr, "%d: %d \n", i, tids[i]);
#endif
      continue;
    }

    /* Check if the next thread had has the right thread number. When finding
     * threadnumber -1 the end should be reached.
     */
    if (tids[i] == (lasttid + 1) % threads || tids[i] == -1) {
      /* checking for the right chunk size */
      if (tmp_count == chunk_size) {
        tmp_count = 1;
        lasttid = tids[i];
#ifdef VERBOSE
        fprintf (stderr, "OK\n");
#endif
      } else {
        /* If the chunk size was wrong, check if the end was reached */
        if (tids[i] == -1) {
          if (i == CFSMAX_SIZE) {
            fprintf (stderr, "Last thread had chunk size %d\n",
              tmp_count);
            break;
          } else {
            fprintf (stderr, "ERROR: Last thread (thread with"
              " number -1) was found before the end.\n");
            result = 0;
          }
        } else {
          fprintf (stderr, "ERROR: chunk size was %d. (assigned"
            " was %d)\n", tmp_count, chunk_size);
          result = 0;
        }
      }
    } else {
      fprintf(stderr, "ERROR: Found thread with number %d (should be"
        " inbetween 0 and %d).", tids[i], threads - 1);
      result = 0;
    }
#ifdef VERBOSE
    fprintf (stderr, "%d: %d \n", i, tids[i]);
#endif
  }

  return result;
}

int main()
{
  int i;
  int num_failed=0;

  for(i = 0; i < REPETITIONS; i++) {
    if(!test_omp_for_schedule_static()) {
      num_failed++;
    }
  }
  return num_failed;
}


text:
package ch.ethz.scu.obit.common.settings;

import java.util.ArrayList;

/**
 * Global settings for the Annotation Tool, combining both Application and User
 * settings.
 *
 * This is the favorite entry point for all settings management in the
 * Annotation Tool, since the GlobalSettingsManager takes care of properly
 * managing and synchronizing both Application and User Settings.
 *
 * The GlobalSettingsManager offers read-only access to the applications
 * settings and read-write access to the user settings. There is no explicit
 * save() method for user settings, that are persisted automatically on
 * modification.
 *
 * The UserSettingsManager and UserSettings classes are only visible within
 * their containing package, to avoid exposing user settings management
 * capabilities independently of the Application and Global Settings.
 *
 * In contrast, the AppSettingsManager class can be directly accessed from
 * external packages. This is meant to facilitate the interaction with the
 * application settings by the Annotation Tool Admin app, that only manages them
 * and ignores the User settings.
 *
 * Please notice, that direct access to the application settings through the
 * AppSettingsManager allows to both read applications settings from disk and
 * write them back modified. It is recommended not to use this direct access
 * from the Annotation Tool, since by modifying the application settings without
 * synchronizing with the user settings you can create an inconsistent state.
 * Use the GlobalSettingsManager class instead.
 *
 * @author Aaron Ponti
 *
 */
public class GlobalSettingsManager {

	protected String currentOpenBISURL;
	protected AppSettingsManager appManager = null;
	protected UserSettingsManager userManager = null;

	/**
	 * Constructor
	 */
	public GlobalSettingsManager() {

		// Load applications settings
		appManager = new AppSettingsManager();

		// Load user settings
		userManager = new UserSettingsManager(appManager.getAllConfigurationNames());

		// If the user has a favorite server, set if as active
		appManager.setActiveConfiguration(userManager.getFavoriteConfigurationName());

	}

	/**
	 * Set the active server.
	 *
	 * @param openBISURL Server URL.
	 */
	public void setActiveConfiguration(String configurationName) {
		appManager.setActiveConfiguration(configurationName);
		userManager.setActiveConfiguration(configurationName);
	}

	/**
	 * Get the name of the active configuration.
	 *
	 * @return name of the active configuration.
	 */
	public AppSettings getActiveConfiguration() {
		return appManager.getActiveConfiguration();
	}

	/**
	 * Get all configurations
	 *
	 * @return List of all configurations.
	 */
	public ArrayList<AppSettings> getAllConfigurations() {
		return appManager.getAllConfigurations();
	}

	/**
	 * Get all configuration names
	 *
	 * @return List of all configuration names.
	 */
	public ArrayList<String> getAllConfigurationNames() {
		return appManager.getAllConfigurationNames();
	}

	/**
	 * Returns whether the client should accept self-signed certificates from the
	 * server.
	 *
	 * This is an Application Setting.
	 *
	 * @return "yes" if the client should except and accept self-signed
	 *         certificates, or "no" otherwise.
	 */
	public String acceptSelfSignedCertificates() {
		return appManager.getSettingValue("AcceptSelfSignedCertificates");
	}

	/**
	 * Get user data root directory (without user subfolder).
	 *
	 * This is an Application Setting.
	 *
	 * @return user data root directory.
	 */
	public String getUserDataRootDir() {
		return appManager.getSettingValue("UserDataDir");
	}

	/**
	 * Get openBIS server URL.
	 *
	 * This is an Application Setting.
	 *
	 * @return openBIS server URL.
	 */
	public String getOpenBISURL() {
		return appManager.getSettingValue("OpenBISURL");
	}

	/**
	 * Get Datamover incoming directory.
	 *
	 * This is an Application Setting.
	 *
	 * @return Datamover incoming directory.
	 */
	public String getDatamoverIncomingDir() {
		return appManager.getSettingValue("DatamoverIncomingDir");
	}

	/**
	 * Return the acquisition station.
	 *
	 * This is an Application Setting.
	 *
	 * @return the acquisition station.
	 */
	public String getAcquisitionStation() {
		return appManager.getSettingValue("AcquisitionStation");
	}

	/**
	 * Return the acquisition station human-friendly name.
	 *
	 * This is an Application Setting.
	 *
	 * @return the acquisition station.
	 */
	public String getAcquisitionStationFriendlyHostName() {
		return appManager.getSettingValue("HumanFriendlyHostName");
	}

	/**
	 * Returns whether the marker file to trigger registration shold be created
	 * after moving the data to the Datamover incoming folder.
	 *
	 * This is an Application Setting.
	 *
	 * @return "yes" if the marker should be created, or "no" otherwise.
	 */
	public String createMarkerFileInDatamoverIncomingFolder() {
		return appManager.getSettingValue("CreateMarkerFile");
	}

	/**
	 * Set the user's favorite configuration..
	 *
	 * The configuration must be one of those defined by the Annotation Tool Admin
	 * application and stored in the application settings.
	 *
	 * This is a User Setting.
	 *
	 * @param configurationName name of the favorite configuration.
	 * @return true if the favorite configuration could be set successfully, false
	 *         otherwise.
	 */
	public boolean setFavoriteConfiguration(String configurationName) {
		return userManager.storeFavoriteConfiguration(configurationName);
	}

	/**
	 * Get the user's favorite configuration.
	 *
	 * This is a User Setting.
	 *
	 * @return the URL of the server to use.
	 */
	public String getFavoriteConfigurationName() {
		return userManager.getFavoriteConfigurationName();
	}

	/**
	 * Set the default project for the active server.
	 *
	 * Please notice that the validation of the passed project identifier must be
	 * done externally. The GlobalSettingsManager, UserSettingsManager and
	 * UserSettings classes do not attempt to check the passed identifier against
	 * openBIS.
	 *
	 * This is a User Setting.
	 *
	 * @param project openBIS identifier of the project.
	 * @return true if the project could be set successfully, false otherwise.
	 */
	public boolean setDefaultProject(String project) {
		return userManager.storeDefaultProject(project);
	}

	/**
	 * Get the default project for the activer server.
	 *
	 * This is a User Setting.
	 *
	 * @return openBIS identifier of the project.
	 */
	public String getDefaultProject() {
		return userManager.getDefaultProject();
	}

	/**
	 * Checks that the configuration files are valid and ready to use.
	 *
	 * @return true if the configuration is valid, false otherwise.
	 * @throws Exception if the configuration is not valid for some reason. The
	 *                   exception message contains the actual explanation and is
	 *                   meant to be shown to the user (e.g. in a dialog).
	 */
	static public boolean isConfigurationValid() throws Exception {

		// Check whether the application has been set up already.
		// If not, we inform the user and quit.
		if (!AppSettingsManager.settingsFileExists()) {
			throw (new Exception("The application has not ben configured yet.\n"
					+ "Please ask an administrator to do it for you.\n\n" + "The application will close now."));
		}

		// Read the application settings
		AppSettingsManager manager = new AppSettingsManager();

		// Check
		if (!manager.isFileRead()) {
			throw (new Exception(
					"The application settings could not be read.\n" + "Please ask an administrator to re-configure the "
							+ "application.\n\n" + "The application will close now."));
		}

		if (!manager.isFileCurrent()) {
			throw (new Exception(
					"The application settings are obsolete.\n" + "Please ask an administrator to re-configure the "
							+ "application.\n\n" + "The application will close now."));
		}

		if (!manager.isFileValid()) {
			throw (new Exception("The application settings are not valid.\n"
					+ "Please ask an administrator to reconfigure the application.\n\n"
					+ "The application will close now."));
		}

		return true;
	}

}


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

namespace StarWRPG.Models
{
    public class NautolanPreset : SpeciesPreset
    {
        public override string SpeciesName
        {
            get { return "Nautolan"; }
        }

        public override string SpecialAbilities
        {
            get { return "Nautolans begin the game with one rank in Athletics." + AUTOMATIC; }
        }

        public override uint MaxWounds
        {
            get { return 11; }
        }

        public override uint MaxStrain
        {
            get { return 9; }
        }

        public override uint StartingXP
        {
            get { return 100; }
        }

        public override Characteristics InitializeCharacteristics()
        {
            return new Characteristics(3, 2, 2, 2, 1, 2);
        }

        public override List<Skill> InitializeSkills()
        {
            return new List<Skill>()
            {
                new AthleticsSkill(Characteristics.Brawn) { Rank = 1 },
            };
        }

        public override List<Talent> InitializeTalents()
        {
            return new List<Talent>
            {
                new Talent
                {
                    Name = "Amphibious",
                    Description = "Nautolans may breathe underwater without penalty and never suffer movement" +
                                  "penalties for traveling through water.",
                    PageNumber = 59,
                }
            };
        }
    }
}


text:
package com.crystalplanet.obsidianpoker.game.card;

import java.util.Comparator;

public class Card implements Comparable<Card> {
    public static final Comparator<Card> COMPARE_SUIT = new Comparator<Card>() {
        @Override
        public int compare(Card l, Card r) {
            return r == null ? 1 : l == null ? -1 : l.suit.compareTo(r.suit);
        }
    };

    public static final Comparator<Card> COMPARE_RANK = new Comparator<Card>() {
        @Override
        public int compare(Card l, Card r) {
            return r == null ? 1 : l == null ? -1 : l.rank.compareTo(r.rank);
        }
    };

    private CardSuit suit;
    private CardRank rank;

    public Card(CardSuit suit, CardRank rank) {
        this.suit = suit;
        this.rank = rank;
    }

    public CardSuit suit() {
        return suit;
    }

    public CardRank rank() {
        return rank;
    }

    @Override
    public boolean equals(Object other) {
        return other != null && other instanceof Card && hashCode() == other.hashCode();
    }

    @Override
    public int hashCode() {
        return 16*suit.hashCode() + rank.hashCode();
    }

    @Override
    public int compareTo(Card other) {
        return COMPARE_RANK.compare(this, other);
    }
}


text:
// -*- c++ -*-

#ifndef _SIGC_ADAPTOR_HPP_
#define _SIGC_ADAPTOR_HPP_

#include <sigc++/adaptors/bind.h>
#include <sigc++/adaptors/bind_return.h>
#include <sigc++/adaptors/hide.h>
#include <sigc++/adaptors/retype_return.h>
#include <sigc++/adaptors/retype.h>
#include <sigc++/adaptors/compose.h>
#include <sigc++/adaptors/exception_catch.h>
#include <sigc++/adaptors/track_obj.h>

#endif /* _SIGC_ADAPTOR_HPP_ */


text:
#ifndef _NETND6_HEADERS_H_
#define _NETND6_HEADERS_H_

#include <neticmp6/icmp6_header.h>
#include <netipv6/ipv6.h>

/*********************************************************************
* Partial IP packet header for Argument validation.
**********************************************************************
*   +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
*   |Version| Traffic Class |           Flow Label                  |
*   +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
*   |         Payload Length        |  Next Header  |   Hop Limit   |
*   +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
*   .                                                               .
*   .                                                               .
**********************************************************************/
typedef struct NETSTD_PACKED
{
    uint8_t   version__tclass      ;   /* 4-bit Internet Protocol version number = 6, 8-bit traffic class field. */
    uint8_t   tclass__flowl        ;   /* 20-bit flow label. */
    uint16_t   flowl               ;
    uint16_t   length              ;   /* Length of the IPv6
                                        * payload, i.e., the rest of the packet following
                                        * this IPv6 header, in octets. */
    uint8_t   next_header          ;   /* Identifies the type of header
                                        * immediately following the IPv6 header.  Uses the
                                        * same values as the IPv4 Protocol field [RFC-1700
                                        * et seq.].*/
    uint8_t   hop_limit            ;   /* Decremented by 1 by
                                        * each node that forwards the packet. The packet
                                        * is discarded if Hop Limit is decremented to
                                        * zero. */
} partial_ipv6_header_t;

/**********************************************************************
* Neighbor Solicitation Message Format (RFC 4861)
***********************************************************************
* Nodes send Neighbor Solicitations to request the link-layer address
* of a target node while also providing their own link-layer address to
* the target.
*
*    +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
*    |     Type      |     Code      |          Checksum             |
*    +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
*    |                           Reserved                            |
*    +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
*    |                                                               |
*    +                                                               +
*    |                                                               |
*    +                       Target Address                          +
*    |                                                               |
*    +                                                               +
*    |                                                               |
*    +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
*    |   Options ...
*    +-+-+-+-+-+-+-+-+-+-+-+-
***********************************************************************/
typedef struct NETSTD_PACKED
{
    fnet_icmp6_header_t icmp6_header    ;
    uint8_t             _reserved[4]    ;
    ipv6_addr_t         target_addr     ;
} fnet_nd6_ns_header_t;

/**********************************************************************
* Neighbor Advertisement Message Format (RFC 4861)
***********************************************************************
* A node sends Neighbor Advertisements in response to Neighbor
* Solicitations and sends unsolicited Neighbor Advertisements in order
* to (unreliably) propagate new information quickly.
*
*	 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
*    |     Type      |     Code      |          Checksum             |
*    +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
*    |R|S|O|                     Reserved                            |
*    +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
*    |                                                               |
*    +                                                               +
*    |                                                               |
*    +                       Target Address                          +
*    |                                                               |
*    +                                                               +
*    |                                                               |
*    +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
*    |   Options ...
*    +-+-+-+-+-+-+-+-+-+-+-+-
***********************************************************************/
typedef struct NETSTD_PACKED
{
    fnet_icmp6_header_t icmp6_header    ;
    uint8_t             flag            ;
    uint8_t             _reserved[3]    ;
    ipv6_addr_t         target_addr     ;
} fnet_nd6_na_header_t;
/* NA flags.*/
#define FNET_ND6_NA_FLAG_ROUTER      (0x80U) /* Router flag. When set, the R-bit indicates that
                                             * the sender is a router. The R-bit is used by
                                             * Neighbor Unreachability Detection to detect a
                                             * router that changes to a host.*/
#define FNET_ND6_NA_FLAG_SOLICITED   (0x40U) /* Solicited flag. When set, the S-bit indicates that
                                             * the advertisement was sent in response to a
                                             * Neighbor Solicitation from the Destination address.
                                             * The S-bit is used as a reachability confirmation
                                             * for Neighbor Unreachability Detection. It MUST NOT
                                             * be set in multicast advertisements or in
                                             * unsolicited unicast advertisements.*/
#define FNET_ND6_NA_FLAG_OVERRIDE    (0x20U) /* Override flag. When set, the O-bit indicates that
                                             * the advertisement should override an existing cache
                                             * entry and update the cached link-layer address.
                                             * When it is not set the advertisement will not
                                             * update a cached link-layer address though it will
                                             * update an existing Neighbor Cache entry for which
                                             * no link-layer address is known. It SHOULD NOT be
                                             * set in solicited advertisements for anycast
                                             * addresses and in solicited proxy advertisements.
                                             * It SHOULD be set in other solicited advertisements
                                             * and in unsolicited advertisements.*/

/**********************************************************************
* Redirect Message Format (RFC 4861)
***********************************************************************
* Routers send Redirect packets to inform a host of a better first-hop
* node on the path to a destination.
*
*	 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
*    |     Type      |     Code      |          Checksum             |
*    +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
*    |                           Reserved                            |
*    +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
*    |                                                               |
*    +                                                               +
*    |                                                               |
*    +                       Target Address                          +
*    |                                                               |
*    +                                                               +
*    |                                                               |
*    +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
*    |                                                               |
*    +                                                               +
*    |                                                               |
*    +                    Destination Address                        +
*    |                                                               |
*    +                                                               +
*    |                                                               |
*    +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
*    |   Options ...
*    +-+-+-+-+-+-+-+-+-+-+-+-
***********************************************************************/

typedef struct NETSTD_PACKED
{
    fnet_icmp6_header_t icmp6_header        ;
    uint8_t             _reserved[4]        ;
    ipv6_addr_t         target_addr         ;
    ipv6_addr_t         destination_addr    ;
} fnet_nd6_rd_header_t;

/**********************************************************************
* Router Solicitation Message Format
***********************************************************************
* Hosts send Router Solicitations in order to prompt routers to
* generate Router Advertisements quickly.
*
*    +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
*    |     Type      |     Code      |          Checksum             |
*    +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
*    |                           Reserved                            |
*    +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
*    |   Options ...
*    +-+-+-+-+-+-+-+-+-+-+-+-
***********************************************************************/
typedef struct NETSTD_PACKED
{
    fnet_icmp6_header_t icmp6_header    ;
    uint8_t             _reserved[4]    ;
} fnet_nd6_rs_header_t;

/**********************************************************************
* Router Advertisement Message Format
***********************************************************************
* Routers send out Router Advertisement messages periodically, or in
* response to Router Solicitations.
*
*    +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
*    |     Type      |     Code      |          Checksum             |
*    +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
*    | Cur Hop Limit |M|O|  Reserved |       Router Lifetime         |
*    +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
*    |                      Reachable Time                           |
*    +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
*    |                      Retrans Timer                            |
*    +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
*    |   Options ...
*    +-+-+-+-+-+-+-+-+-+-+-+-
***********************************************************************/

typedef struct NETSTD_PACKED
{
    fnet_icmp6_header_t icmp6_header    ;   /* ICMPv6 header.*/
    uint8_t             cur_hop_limit   ;   /* 8-bit unsigned integer. The default value that
                                             * should be placed in the Hop Count field of the IP
                                             * header for outgoing IP packets. A value of zero
                                             * means unspecified (by this router). */
    uint8_t             flag            ;   /* ND6_RS_FLAG_M and/or ND6_RS_FLAG_O flags.*/
    uint16_t            router_lifetime ;   /* 16-bit unsigned integer. The lifetime associated
                                             * with the default router in units of seconds. The
                                             * field can contain values up to 65535 and receivers
                                             * should handle any value, while the sending rules in
                                             * Section 6 limit the lifetime to 9000 seconds. A
                                             * Lifetime of 0 indicates that the router is not a
                                             * default router and SHOULD NOT appear on the default
                                             * router list. The Router Lifetime applies only to
                                             * the router's usefulness as a default router; it
                                             * does not apply to information contained in other
                                             * message fields or options. Options that need time
                                             * limits for their information include their own
                                             * lifetime fields.*/
    uint32_t            reachable_time  ;   /* 32-bit unsigned integer. The time, in
                                             * milliseconds, that a node assumes a neighbor is
                                             * reachable after having received a reachability
                                             * confirmation. Used by the Neighbor Unreachability
                                             * Detection algorithm (see Section 7.3). A value of
                                             * zero means unspecified (by this router). */
    uint32_t            retrans_timer   ;   /* 32-bit unsigned integer. The time, in
                                             * milliseconds, between retransmitted Neighbor
                                             * Solicitation messages. Used by address resolution
                                             * and the Neighbor Unreachability Detection algorithm
                                             * (see Sections 7.2 and 7.3). A value of zero means
                                             * unspecified (by this router).*/
} fnet_nd6_ra_header_t;

/* RA flags */
#define FNET_ND6_RA_FLAG_M   (0x80U) /* 1-bit "Managed address configuration" flag. When
                                     * set, it indicates that addresses are available via
                                     * Dynamic Host Configuration Protocol [DHCPv6].
                                     * If the M flag is set, the O flag is redundant and
                                     * can be ignored because DHCPv6 will return all
                                     * available configuration information.*/
#define FNET_ND6_RA_FLAG_O   (0x40U) /* 1-bit "Other configuration" flag. When set, it
                                     * indicates that other configuration information is
                                     * available via DHCPv6. Examples of such information
                                     * are DNS-related information or information on other
                                     * servers within the network.*/
/* Note: If neither M nor O flags are set, this indicates that no
 * information is available via DHCPv6.*/

/* ND option types (RFC4861). */
#define FNET_ND6_OPTION_SOURCE_LLA          (1U)     /* Source Link-layer Address.*/
#define FNET_ND6_OPTION_TARGET_LLA          (2U)     /* Target Link-layer Address.*/
#define FNET_ND6_OPTION_PREFIX              (3U)     /* Prefix Information.*/
#define FNET_ND6_OPTION_REDIRECTED_HEADER   (4U)     /* Redirected Header.*/
#define FNET_ND6_OPTION_MTU                 (5U)     /* MTU. */
#define FNET_ND6_OPTION_RDNSS               (25U)    /* RDNSS RFC6106. */

/***********************************************************************
 * ND option header
 ***********************************************************************/
typedef struct NETSTD_PACKED
{
    uint8_t type      ;   /* Identifier of the type of option.*/
    uint8_t length    ;   /* The length of the option
                           * (including the type and length fields) in units of
                           * 8 octets.  The value 0 is invalid.  Nodes MUST
                           * silently discard an ND packet that contains an
                           * option with length zero.*/
} fnet_nd6_option_header_t;

/***********************************************************************
 * Source/Target Link-layer Address option header:
 *  +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
 *  |     Type      |     Length    |       Link-Layer Address ...
 *  +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
 ***********************************************************************/
typedef struct NETSTD_PACKED
{
    fnet_nd6_option_header_t    option_header   ;   /* Option general header.*/
    uint8_t                     addr[6]         ;   /* The length of the option. Can be more or less than 6.*/
} fnet_nd6_option_lla_header_t;

/***********************************************************************
 * MTU option header:
 *  +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
 *  |     Type      |     Length    |           Reserved            |
 *  +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
 *  |                          MTU                                  |
 *  +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
 ***********************************************************************/
typedef struct NETSTD_PACKED
{
    fnet_nd6_option_header_t    option_header   ;   /* Option general header.*/
    uint8_t                     _reserved[2]    ;
    uint32_t                    mtu             ;   /* The recommended MTU for the link.*/
} fnet_nd6_option_mtu_header_t;

/***********************************************************************
 * Prefix Information option header:
 *  +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
 *  |     Type      |     Length    | Prefix Length |L|A| Reserved1 |
 *  +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
 *  |                         Valid Lifetime                        |
 *  +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
 *  |                       Preferred Lifetime                      |
 *  +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
 *  |                           Reserved2                           |
 *  +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
 *  |                                                               |
 *  +                                                               +
 *  |                                                               |
 *  +                             Prefix                            +
 *  |                                                               |
 *  +                                                               +
 *  |                                                               |
 *  +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
 ***********************************************************************/
typedef struct NETSTD_PACKED
{
    fnet_nd6_option_header_t    option_header   ;   /* Option general header.*/
    uint8_t                     prefix_length   ;   /* The number of leading bits
                                                     * in the Prefix that are valid. The value ranges
                                                     * from 0 to 128. The prefix length field provides
                                                     * necessary information for on-link determination
                                                     * (when combined with the L flag in the prefix
                                                     * information option). It also assists with address
                                                     * autoconfiguration as specified in [ADDRCONF], for
                                                     * which there may be more restrictions on the prefix
                                                     * length.*/
    uint8_t                     flag            ;   /* ND6_OPTION_FLAG_L and/or ND6_OPTION_FLAG_O flags.*/
    uint32_t                    valid_lifetime  ;   /* The length of time in
                                                     * seconds (relative to the time the packet is sent)
                                                     * that the prefix is valid for the purpose of on-link
                                                     * determination. A value of all one bits
                                                     * (0xffffffff) represents infinity. The Valid
                                                     * Lifetime is also used by [ADDRCONF].*/
    uint32_t                    prefered_lifetime ; /* The length of time in
                                                     * seconds (relative to the time the packet is sent)
                                                     * that addresses generated from the prefix via
                                                     * stateless address autoconfiguration remain
                                                     * preferred [ADDRCONF]. A value of all one bits
                                                     * (0xffffffff) represents infinity. See [ADDRCONF].
                                                     * Note that the value of this field MUST NOT exceed
                                                     * the Valid Lifetime field to avoid preferring
                                                     * addresses that are no longer valid.*/
    uint32_t                    _reserved       ;
    ipv6_addr_t                 prefix          ;   /* An IP address or a prefix of an IP address. The
                                                     * Prefix Length field contains the number of valid
                                                     * leading bits in the prefix. The bits in the prefix
                                                     * after the prefix length are reserved and MUST be
                                                     * initialized to zero by the sender and ignored by
                                                     * the receiver. A router SHOULD NOT send a prefix
                                                     * option for the link-local prefix and a host SHOULD
                                                     * ignore such a prefix option.*/

} fnet_nd6_option_prefix_header_t;

#define FNET_ND6_OPTION_FLAG_L  (0x80U)  /* 1-bit on-link flag. When set, indicates that this
                                         * prefix can be used for on-link determination. When
                                         * not set the advertisement makes no statement about
                                         * on-link or off-link properties of the prefix. In
                                         * other words, if the L flag is not set a host MUST
                                         * NOT conclude that an address derived from the
                                         * prefix is off-link. That is, it MUST NOT update a
                                         * previous indication that the address is on-link.*/
#define FNET_ND6_OPTION_FLAG_A  (0x40U)  /* 1-bit autonomous address-configuration flag. When
                                         * set indicates that this prefix can be used for
                                         * stateless address configuration as specified in
                                         * [ADDRCONF].*/

/***********************************************************************
 * Recursive DNS Server header (RFC 6106):
 *   +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
 *   |     Type      |     Length    |           Reserved            |
 *   +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
 *   |                           Lifetime                            |
 *   +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
 *   |                                                               |
 *   :            Addresses of IPv6 Recursive DNS Servers            :
 *   |                                                               |
 *   +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
 ***********************************************************************/
typedef struct NETSTD_PACKED
{
    fnet_nd6_option_header_t    option_header   ;   /* Option general header.*/
    uint16_t                    _reserved       ;
    uint32_t                    lifetime        ;   /* The maximum time, in
                                                     * seconds (relative to the time the packet is sent),
                                                     * over which this RDNSS address MAY be used for name
                                                     * resolution.*/
    ipv6_addr_t                 address[1]      ;   /* One or more 128-bit IPv6 addresses of the recursive
                                                     * DNS servers.  The number of addresses is determined
                                                     * by the Length field.  That is, the number of
                                                     * addresses is equal to (Length - 1) / 2.*/
} fnet_nd6_option_rdnss_header_t;

#endif


text:
<?php

declare(strict_types=1);

namespace Fixtures;

class QueryHandler
{

	const RESULT = 'query-result';

	/** @var bool */
	private $called = FALSE;

	public function handle(Query $query)
	{
		$this->called = TRUE;
		return self::RESULT;
	}

	public function isCalled(): bool
	{
		return $this->called;
	}

}


text: Machine Learning


text:
<!DOCTYPE html>

  <meta charset="utf-8">
  <meta http-equiv="X-UA-Compatible" content="IE=edge">
  <title>Suit Admin - App</title>
  <meta name="description" content="">
  <meta name="viewport" content="width=device-width, initial-scale=1">
  <link rel="stylesheet" href="bower_components/html5-boilerplate/css/normalize.css">
  <link rel="stylesheet" href="bower_components/html5-boilerplate/css/main.css">
  <link rel="stylesheet" href="styles/main.css">
  <link rel="stylesheet" href="styles/components.css">

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

home

users

order

login

parts

Suit Admin

 from the Yeoman team

Angular seed app: v


text:
FROM node:7.9.0-alpine

# Set a working directory
WORKDIR /usr/src/app

# Copy application files
COPY . .

# Install Node.js dependencies
RUN yarn install --production --no-progress

RUN webpack

CMD [ "node", "build/_server.js" ]


text:
/*
 * lock.c - Lock a directory by using a lock file.
 */
#ifndef _GNU_SOURCE
#define _GNU_SOURCE
#endif
#include <lock/lock.h>
#include <xpath/xpath.h>
#include <stddef.h>
#include <unistd.h>
#include <stdio.h>
#include <stdlib.h>
#include <string.h>

#ifdef __APPLE__
#include <libproc.h>
#endif

static lock_t LOCK_create(const char * lock_fn, pid_t pid);
static int LOCK_get_process_name(char ** name, pid_t pid);

/*
 * Returns LOCK_NEW if a new lock is created, LOCK_OVERWRITE if an existing
 * lock file was overwritten or a negative result in case of an error.
 *
 * Flags:
 *
 *  LOCK_QUIT_IF_EXIST: do not check the lock file but simply consider the
 *                      database locked if a lock file exists in the path.
 */
lock_t lock_lock(const char * path, int flags)
{
    pid_t pid = getpid();
    pid_t ppid = 0;
    char * lock_fn;
    char * proc_name = NULL;
    char * pproc_name = NULL;
    char strpid[10];
    int is_locked;
    FILE * fp;
    lock_t lock_rc;

    /* initialize strpid to zero */
    memset(&strpid, 0, sizeof(strpid));

    if (asprintf(&lock_fn, "%s%s", path, ".lock") < 0)
    {
        return LOCK_MEM_ALLOC_ERR;
    }

    fp = fopen(lock_fn, "r");

    if (fp != NULL)
    {
        if (flags & LOCK_QUIT_IF_EXIST)
        {
            fclose(fp);
            free(lock_fn);
            return LOCK_IS_LOCKED_ERR;
        }

        if (fread(strpid, sizeof(char), 9, fp))
        {
            ppid = strtoul(strpid, NULL, 10);
        }
        fclose(fp);

        if (!ppid)
        {
            free(lock_fn);
            return LOCK_READ_ERR;
        }

        if (ppid == pid)
        {
            /*
             * The process id in the existing lock file is the same as 'this'
             * process, we therefore can overwrite the lock.
             */
            lock_rc = LOCK_create(lock_fn, pid);
            free(lock_fn);
            return lock_rc;
        }

        if (LOCK_get_process_name(&proc_name, pid))
        {
            free(lock_fn);
            return LOCK_MEM_ALLOC_ERR;
        }

        if (proc_name == NULL)
        {
            free(lock_fn);
            return LOCK_PROCESS_NAME_ERR;
        }

        if (LOCK_get_process_name(&pproc_name, ppid))
        {
            free(proc_name);
            free(lock_fn);
            return LOCK_MEM_ALLOC_ERR;
        }

        /*
         * If the process id in the lock file does not exist or if the
         * process id is in use by another program than siridb we can
         * assume the lock is not valid.
         */
        is_locked = (pproc_name != NULL && strcmp(proc_name, pproc_name) == 0);

        free(proc_name);
        free(pproc_name);

        if (is_locked)
        {
            free(lock_fn);
            return LOCK_IS_LOCKED_ERR;
        }
    }

    lock_rc = LOCK_create(lock_fn, pid);
    free(lock_fn);

    return lock_rc;
}

/*
 * Returns LOCK_REMOVED if successful or something else in case of an error.
 */
lock_t lock_unlock(const char * path)
{
    char * lock_fn;
    lock_t lock_rc;

    if (asprintf(&lock_fn, "%s%s", path, ".lock") < 0)
    {
        return LOCK_MEM_ALLOC_ERR;
    }

    lock_rc = (unlink(lock_fn)) ? LOCK_UNLINK_ERR : LOCK_REMOVED;
    free(lock_fn);

    return lock_rc;
}

/*
 * Returns a message by lock result code.
 */
const char * lock_str(lock_t rc)
{
    switch (rc)
    {
    case LOCK_IS_LOCKED_ERR:
        return "Database is locked by another process";
    case LOCK_PROCESS_NAME_ERR:
        return "Error occurred while reading process name";
    case LOCK_WRITE_ERR:
        return "Error occurred while writing the lock file";
    case LOCK_READ_ERR:
        return "Error occurred while reading existing lock file";
    case LOCK_UNLINK_ERR:
        return "Error occurred while removing the lock file";
    case LOCK_MEM_ALLOC_ERR:
        return "Memory allocation error occurred";
    case LOCK_REMOVED:
        return "Database is successfully unlocked";
    case LOCK_NEW:
        return "Database is successfully locked with a new lock file";
    case LOCK_OVERWRITE:
        return
            "Database is successfully locked but a lock file existed which "
            "indicates that the database was not closed correctly last time";
    }
    return "Unknown type";
}

/*
 * Returns LOCK_NEW if a new lock is created, LOCK_OVERWRITE if an existing
 * lock file was overwritten or LOCK_WRITE_ERR in case of an error.
 */
static lock_t LOCK_create(const char * lock_fn, pid_t pid)
{
    lock_t rc_success = (!xpath_file_exist(lock_fn)) ?
            LOCK_NEW : LOCK_OVERWRITE;

    FILE * fp = fopen(lock_fn, "w");
    if (fp == NULL)
    {
        return LOCK_WRITE_ERR;
    }
    if (fprintf(fp, "%d", pid) < 0)
    {
        fclose(fp);
        return LOCK_WRITE_ERR;
    }
    return (fclose(fp)) ? LOCK_WRITE_ERR : rc_success;
}

/*
 * Returns 0 if successful or -1 in case of a memory allocation error.
 *
 * When successful, name contains the process name by process id or NULL
 * if the process is not found.
 *
 * In case 'name' is not NULL, 'calloc' is used to set the value and should
 * be destroyed using free(). When -1 is returned 'name' is always NULL.
 */
#ifdef __APPLE__
static int LOCK_get_process_name(char ** name, pid_t pid)
{
    struct proc_bsdinfo proc;

    int st = proc_pidinfo(
            pid,
            PROC_PIDTBSDINFO,
            0,
            &proc,
            PROC_PIDTBSDINFO_SIZE);

    if (st == 0)
    {
        return 0;
    }
    else if (st != PROC_PIDTBSDINFO_SIZE)
    {
        return -1;
    }

    *name = strdup(proc.pbi_comm);

    if (*name == NULL)
    {
        return -1;
    }

    return 0;
}
#else
static int LOCK_get_process_name(char ** name, pid_t pid)
{
    size_t n = 1024;
    *name = (char *) calloc(n, sizeof(char));

    if (*name == NULL)
    {
        return -1;
    }
    else
    {
        sprintf(*name, "/proc/%d/comm", pid);
        FILE * fp = fopen(*name, "r");
        if (fp == NULL)
        {
            /* most likely the file does not exist */
            free(*name);
            *name = NULL;
        }
        else
        {
            ssize_t size = getline(name, &n, fp);
            fclose(fp);
            if(size > 0)
            {
                if((*name)[size - 1] == '\n')
                {
                    (*name)[size - 1] = 0;
                }
            } else if (size < 0)
            {
                free(*name);
                *name = NULL;
                return -1;
            }
        }
    }
    return 0;
}
#endif


text:
<!DOCTYPE html>

        <title>Example 2: Terminal</title>
        <link href='//fonts.googleapis.com/css?family=Inconsolata:700' rel='stylesheet' type='text/css'>


text:
@org.osgi.annotation.versioning.Version("1.0.0")
package io.primeval.saga.websocket;


text:
'use strict'
const joi = require('joi')

module.exports =  joi.object().keys({
  gateway: joi.string(),
  account_foreign_key: joi.any().required(),
  account_foreign_id: joi.any().required(),
  foreign_key: joi.any(),
  foreign_id: joi.any().required(),
  payment_details: joi.object()
}).unknown()


text:
#ifndef HARBOL_OBJPOOL_INCLUDED
#	define HARBOL_OBJPOOL_INCLUDED

#ifdef __cplusplus
extern "C" {
#endif

#include "../harbol_common_defines.h"
#include "../harbol_common_includes.h"

struct HarbolObjPool {
	uint8_t
		*mem, // Beginning of memory pool
		*next // Num of next free block
	;
	size_t
		size, // Num of blocks.
		objsize, // size of each block
		free_blocks // Num of remaining blocks
	;
};

#define EMPTY_HARBOL_OBJPOOL    { NULL,NULL,0,0,0 }

HARBOL_EXPORT struct HarbolObjPool harbol_objpool_create(size_t objsize, size_t len);
HARBOL_EXPORT NO_NULL struct HarbolObjPool harbol_objpool_from_buffer(void *buf, size_t objsize, size_t len);
HARBOL_EXPORT NO_NULL bool harbol_objpool_clear(struct HarbolObjPool *objpool);

HARBOL_EXPORT NO_NULL void *harbol_objpool_alloc(struct HarbolObjPool *objpool);
HARBOL_EXPORT NEVER_NULL(1) bool harbol_objpool_free(struct HarbolObjPool *objpool, void *ptr);
HARBOL_EXPORT NO_NULL bool harbol_objpool_cleanup(struct HarbolObjPool *objpool, void **ptrref);
/********************************************************************/

#ifdef __cplusplus
}
#endif

#endif /* HARBOL_OBJPOOL_INCLUDED */


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

<META http-equiv="Content-Type" content="text/html; charset=utf-8">
<TITLE>
Uses of Class org.apache.solr.common.cloud.ClusterState (Solr 4.4.0 API)
</TITLE>

<META NAME="date" CONTENT="2013-07-19">

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

      Overview
      Package
      Class
    Use
      Tree
      Deprecated
      Help

 PREV
 NEXT

  FRAMES
 NO FRAMES

  All Classes

Uses of Class
org.apache.solr.common.cloud.ClusterState

Packages that use ClusterState

org.apache.solr.common.cloud
Common Solr Cloud and ZooKeeper related classes reused on both clients & server.

Uses of ClusterState in org.apache.solr.common.cloud

Methods in org.apache.solr.common.cloud that return ClusterState

 ClusterState
ZkStateReader.getClusterState()

static ClusterState
ClusterState.load(Integer version,
     byte[] bytes,
     Set<String> liveNodes)

          Create ClusterState from json string that is typically stored in zookeeper.

static ClusterState
ClusterState.load(SolrZkClient zkClient,
     Set<String> liveNodes)

          Create ClusterState by reading the current state from zookeeper.

      Overview
      Package
      Class
    Use
      Tree
      Deprecated
      Help

 PREV
 NEXT

  FRAMES
 NO FRAMES

  All Classes

          Copyright © 2000-2013 Apache Software Foundation.  All Rights Reserved.


text:
//
//  ATPlayer.m
//  ATPlayer
//
//  Created by Marc on 08/01/15.
//  Copyright (c) 2015 Asperity. All rights reserved.
//

#import "ATPlayer.h"

@interface ATPlayer ()

/** Main AVPlayer */
@property (nonatomic, strong) AVPlayer                          *player;
/** Timer used for updating controls delegate, given video status */
@property (nonatomic, strong) NSTimer                           *myTimer;
/** Loading view */
//@property (nonatomic, strong) EPLoadingView             *loadingView;
/** Boolean for muted status */
@property (nonatomic, assign) BOOL                              isMuted;

@property (nonatomic, strong) AVPictureInPictureController      *pipVC;

@end

@implementation ATPlayer

/**************************************************************************************************/
#pragma mark - Init methods

- (instancetype)initWithContentURL:(NSURL *)contentURL {
    [self setPlayerWithURL:contentURL];
    self.displayCurrentTime = YES;
    self.displaySeekBar = YES;

    self.myTimer = [NSTimer scheduledTimerWithTimeInterval:0.1
                                                    target:self
                                                  selector:@selector(displayMyCurrentTime:)
                                                  userInfo:nil
                                                   repeats:YES];

    return self;
}

- (void)setPlayerWithURL:(NSURL *)contentURL {
    [self cleanPlayer];
//    [self.loadingView animateLoader];
    AVAsset *asset = [AVURLAsset URLAssetWithURL:contentURL
                                         options:nil];
    AVPlayerItem *currentItem = [AVPlayerItem playerItemWithAsset:asset];
    self.player = [AVPlayer playerWithPlayerItem:currentItem];
//    [self.player addObserver:self forKeyPath:@"status" options:0 context:nil];
//    [self.player addObserver:self forKeyPath:@"externalPlaybackActive" options:0 context:nil];

    [self.containerView setPlayer:self.player];
//    [self.containerView.layer removeAllAnimations];

//    [[NSNotificationCenter defaultCenter] addObserver:self
//                                             selector:@selector(playerItemDidReachEnd:)
//                                                 name:AVPlayerItemDidPlayToEndTimeNotification
//                                               object:[self.player currentItem]];

    //[self.view bringSubviewToFront:self.loadingContainerView];

    [self.player setMuted:self.isMuted];
}

//- (void)observeValueForKeyPath:(NSString *)keyPath ofObject:(id)object
//                        change:(NSDictionary *)change context:(void *)context {
//    if (object == self.player && [keyPath isEqualToString:@"status"]) {
//        if (self.player.status == AVPlayerStatusReadyToPlay) {
////            [self.loadingView stopLoader];
//            [self.view bringSubviewToFront:self.containerView];
//            [self.view sendSubviewToBack:self.loadingContainerView];
//        } else if (self.player.currentItem.status == AVPlayerStatusFailed) {
//            // Show picto ?
//        }
//    // Airplay
//    } else if (object == self.player && [keyPath isEqualToString:@"externalPlaybackActive"]) {
//        if (self.player.isExternalPlaybackActive) {
//            [self.delegate connectedAirPlay];
//        } else {
//            [self.delegate disconnectedAirPlay];
//        }
//    }
//}

/**************************************************************************************************/
#pragma mark - UIViewController override

- (void)viewDidLoad {
    [super viewDidLoad];

    [self.containerView setClipsToBounds:YES];

//    self.loadingView = (EPLoadingView *)[EPLoadingView viewFromNib];
//    [self.loadingContainerView addSubview:self.loadingView];

//    self.castView = (EPCastView *)[EPCastView viewFromNib];
//    [self.view addSubview:self.castView];
//    self.castView.hidden = YES;

    self.chromecastIsConnected = NO;
}

- (void)viewWillAppear:(BOOL)animated {
    [super viewWillAppear:animated];

    [self.containerView setPlayer:self.player];
    [self.containerView.layer removeAllAnimations];

    self.pipVC = [[AVPictureInPictureController alloc] initWithPlayerLayer:(AVPlayerLayer *)self.containerView.layer];
    [self.pipVC setDelegate:self];

    [self.player play];
}

- (void)viewDidLayoutSubviews {
    [super viewDidLayoutSubviews];

//    self.castView.displaySeekbar = self.displaySeekBar;
//   self.loadingView.frame = self.loadingContainerView.bounds;
//    self.castView.frame = self.view.bounds;

//    if (self.isFillScreen) {
//        CGFloat height = [UIApplication isPortrait] ? [UIApplication getLandscapeFrame].size.width : [UIApplication getLandscapeFrame].size.height;
//        CGFloat width = height * (16. / 9.);
//
//        ((AVPlayerLayer *)[self.containerView layer]).bounds = CGRectMake(0.,
//                                                                          0.,
//                                                                          width,
//                                                                          height);
//    } else if (IS_IPHONE4 && ![UIApplication isPortrait]) {
//            CGFloat width = [UIApplication getLandscapeFrame].size.width;
//            CGFloat height = width * (9. / 16.);;
//            ((AVPlayerLayer *)[self.containerView layer]).bounds = CGRectMake(0.,
//                                                                              0.,
//                                                                              width,
//                                                                              height);
//    } else
    {
        ((AVPlayerLayer *)[self.containerView layer]).bounds = self.view.bounds;
    }
//    if (self.chromecastIsConnected) {
//        [self.view bringSubviewToFront:self.castView];
//    }
}

- (void)dealloc {
    [self cleanPlayer];
}

- (void)cleanPlayer {
    if (self.player) {
        [self.player pause];
        [self.player removeObserver:self
                         forKeyPath:@"status"];
        [self.player removeObserver:self
                         forKeyPath:@"externalPlaybackActive"];

        [[NSNotificationCenter defaultCenter] removeObserver:self];
        self.player = nil;
    }
}

- (void)fillScreen {
    if (!self.chromecastIsConnected) {
        self.isFillScreen = YES;
        [self viewDidLayoutSubviews];
    }
}

- (void)setDefaultVideoFrame {
    self.isFillScreen = NO;
    [self viewDidLayoutSubviews];
}

/**************************************************************************************************/
#pragma mark - Status getters

- (BOOL)isAirplayActive {
    return self.player.isExternalPlaybackActive;
}

/**************************************************************************************************/
#pragma mark - Timer delegate

- (void)displayMyCurrentTime:(NSTimer *)timer {
    if (self.player.currentItem) {
//        [self.seekDelegate displayMyCurrentTime:self.player.currentItem];
    }
}

/**************************************************************************************************/
#pragma mark - Player actions

- (void)seekToTime:(NSInteger)time {
    [self.player seekToTime:CMTimeMake(time, 1)];
}

- (void)seekToPercent:(float)percent {
    [self seekToTime:percent * CMTimeGetSeconds([self.player.currentItem duration])];
}

- (void)seekToTime:(NSInteger)time withTolerance:(CMTime)timeTolerance {
    [self.player seekToTime:CMTimeMake(time, 1)
            toleranceBefore:timeTolerance
             toleranceAfter:timeTolerance];
}

- (void)togglePlay {
    if (self.player.rate > 0.) {
        [self.player pause];
    } else {
        [self.player play];
    }
}

- (void)pause {
    [self.player pause];
}

- (void)resume {
    [self.player play];
}

- (void)setMuted:(BOOL)muted {
    self.isMuted = muted;
    [self.player setMuted:muted];
}

- (CMTime)getCurrentTime {
    return self.player.currentItem.currentTime;
}

- (IBAction)clickPIP:(id)sender {

    if ([AVPictureInPictureController isPictureInPictureSupported] && self.pipVC.isPictureInPicturePossible) {
        [self.pipVC startPictureInPicture];
    }
}

- (void)pictureInPictureControllerWillStartPictureInPicture:(AVPictureInPictureController *)pictureInPictureController {
}

- (void)pictureInPictureControllerDidStartPictureInPicture:(AVPictureInPictureController *)pictureInPictureController {
}

- (void)pictureInPictureControllerFailedToStartPictureInPicture:(AVPictureInPictureController *)pictureInPictureController withError:(NSError *)error {
}

- (void)pictureInPictureControllerDidStopPictureInPicture:(AVPictureInPictureController *)pictureInPictureController {
}

- (void)pictureInPictureController:(AVPictureInPictureController *)pictureInPictureController restoreUserInterfaceForPictureInPictureStopWithCompletionHandler:(void (^)(BOOL restored))completionHandler {
    [self.pipVC stopPictureInPicture];
    completionHandler(YES);
}

/**************************************************************************************************/
#pragma mark - AVPlayer notification delegate

- (void)playerItemDidReachEnd:(NSNotification *)notification {
    int durationSeconds = (int)CMTimeGetSeconds([self.player.currentItem duration]) % 60;
    int currentSeconds = (int)CMTimeGetSeconds([self.player.currentItem currentTime]) % 60;

    if (currentSeconds >= durationSeconds - 1) {
        [[NSNotificationCenter defaultCenter] removeObserver:self];
        [[NSNotificationCenter defaultCenter] postNotificationName:@"EPVideoFinished"
                                                            object:self];
    }
}

@end


text:
sap.ui.define(['jquery.sap.global', 'sap/ui/core/Renderer'],
	function(jQuery, Renderer) {
	"use strict";

	/**
	 * ObjectNumber renderer.
	 * @namespace
	 */
	var ObjectNumberRenderer = {
	};

	/**
	 * Renders the HTML for the given control, using the provided {@link sap.ui.core.RenderManager}.
	 *
	 * @param {sap.ui.core.RenderManager} oRm the RenderManager that can be used for writing to the render output buffer
	 * @param {sap.ui.core.Control} oControl an object representation of the control that should be rendered
	 */
	ObjectNumberRenderer.render = function(oRm, oON) {
		var sTooltip,
			sTextDir = oON.getTextDirection(),
			sTextAlign = oON.getTextAlign(),
			bPageRTL = sap.ui.getCore().getConfiguration().getRTL(),
			oRB = sap.ui.getCore().getLibraryResourceBundle("sap.m"),
			sARIAStateText = "";

		// write the HTML into the render manager
		oRm.write("<div"); // Number begins
		oRm.writeControlData(oON);

		// write the tooltip
		sTooltip = oON.getTooltip_AsString();
		if (sTooltip) {
			oRm.writeAttributeEscaped("title", sTooltip);
		}

		oRm.addClass("sapMObjectNumber");
		if (oON.getEmphasized()) {
			oRm.addClass("sapMObjectNumberEmph");
		}
		oRm.addClass(oON._sCSSPrefixObjNumberStatus + oON.getState());

		sTextDir && oRm.writeAttribute("dir", sTextDir.toLowerCase());
		if (sTextAlign) {
			sTextAlign = Renderer.getTextAlign(sTextAlign, sTextDir);
			if (sTextAlign) {
				oRm.addStyle("text-align", sTextAlign);
			}
		}

		oRm.writeClasses();
		oRm.writeStyles();

		// ARIA
		oRm.writeAccessibilityState({
			labelledby: oON.getId() + "-state"
		});

		oRm.write(">");

		oRm.write("");
		oRm.writeEscaped(oON.getNumber());
		oRm.write(""); // Number text ends

		oRm.write("");

		var unit = oON.getUnit();
		if (!unit) {
			unit = oON.getNumberUnit();
		}
		oRm.writeEscaped(unit);
		oRm.write(""); // Number unit ends

		if (oON.getState() != sap.ui.core.ValueState.None) {

			// Hidden state element for ARIA
			oRm.write("");

			switch (oON.getState()) {
				case sap.ui.core.ValueState.Error:
					sARIAStateText = oRB.getText("OBJECTNUMBER_ARIA_VALUE_STATE_ERROR");
					break;
				case sap.ui.core.ValueState.Warning:
					sARIAStateText = oRB.getText("OBJECTNUMBER_ARIA_VALUE_STATE_WARNING");
					break;
				case sap.ui.core.ValueState.Success:
					sARIAStateText = oRB.getText("OBJECTNUMBER_ARIA_VALUE_STATE_SUCCESS");
					break;
			}

			oRm.write(sARIAStateText);
			oRm.write(""); // Hidden state ends
		}

		oRm.write("
"); // Number ends
	};

	/**
	 * Gets text alignment by calling the Renderer function getTextAlign
	 *
	 * @param {sap.ui.core.TextAlign}
	 *            sTextAlign text align
	 * @param {sap.ui.core.TextDirection}
	 *            sTextDir text direction
	 * @private
	 */
	ObjectNumberRenderer._getTextAlignment = function(sTextAlign, sTextDir) {
		sTextAlign = Renderer.getTextAlign(sTextAlign, sTextDir);

		return sTextAlign;
	};

	return ObjectNumberRenderer;

}, /* bExport= */ true);


text:
package com.intellij.psi.search.scope.packageSet;

import com.intellij.icons.AllIcons;
import com.intellij.ide.IdeBundle;
import com.intellij.openapi.components.ServiceManager;
import com.intellij.openapi.components.State;
import com.intellij.openapi.components.Storage;
import com.intellij.openapi.components.StoragePathMacros;
import com.intellij.openapi.project.Project;
import com.intellij.util.xmlb.SkipDefaultValuesSerializationFilters;
import com.intellij.util.xmlb.XmlSerializer;
import com.intellij.util.xmlb.annotations.XCollection;
import org.jdom.Element;
import org.jetbrains.annotations.NotNull;

import javax.swing.*;
import java.util.ArrayList;
import java.util.List;

@State(name = "NamedScopeManager", storages = @Storage(StoragePathMacros.WORKSPACE_FILE))
public class NamedScopeManager extends NamedScopesHolder {
  public OrderState myOrderState = new OrderState();

  public NamedScopeManager(final Project project) {
    super(project);
  }

  @NotNull
  public static NamedScopeManager getInstance(Project project) {
    return ServiceManager.getService(project, NamedScopeManager.class);
  }

  @Override
  public void loadState(@NotNull Element state) {
    super.loadState(state);
    XmlSerializer.deserializeInto(myOrderState, state);
  }

  @NotNull
  @Override
  public Element getState() {
    Element state = super.getState();
    XmlSerializer.serializeInto(myOrderState, state, new SkipDefaultValuesSerializationFilters());
    return state;
  }

  @NotNull
  @Override
  public String getDisplayName() {
    return IdeBundle.message("local.scopes.node.text");
  }

  @Override
  public Icon getIcon() {
    return AllIcons.Ide.LocalScope;
  }

  public static class OrderState {
    @XCollection(elementName = "scope", valueAttributeName = "name", propertyElementName = "order")
    public List<String> myOrder = new ArrayList<>();

    @Override
    public boolean equals(Object o) {
      if (this == o) return true;
      if (o == null || getClass() != o.getClass()) return false;

      OrderState state = (OrderState)o;
      return !(myOrder != null ? !myOrder.equals(state.myOrder) : state.myOrder != null);
    }

    @Override
    public int hashCode() {
      return myOrder != null ? myOrder.hashCode() : 0;
    }
  }
}


text:
using UnityEngine;
using System.Collections;

public class Damager : MonoBehaviour
{
    private HealthBar healthBar;

    // Use this for initialization
    void Start()
    {
        healthBar = GameObject.Find("HealthBar").GetComponent<HealthBar>();
    }

    // Update is called once per frame
    void Update()
    {
    }

    void OnCollisionEnter2D(Collision2D collision)
    {
        GameObject rain = collision.gameObject;
        if (rain.name.Contains("Left") || rain.name.Contains("Right") || rain.name.Equals("Floor"))
            return;
        float v = rain.GetComponent<Rigidbody2D>().velocity.magnitude;
        if (v <= 5) v = 0;

        if (rain.name.Contains("Clone"))
        {
            bool torso = gameObject.name.Contains("torso");
            int damage = rain.GetComponent<RainDamage>().getDamage();
            Debug.Log(damage);
            if (damage < 0)
            {
                if (!torso)
                {
                    healthBar.healDamage(0 - (10 * damage));
                    Destroy(rain);
                }
            }
            else
            {
                float multiplier;
                if (torso)
                {
                    multiplier = 0.5f;
                    Debug.Log("Torso ouch!");
                }
                else
                    multiplier = 1.0f;
                healthBar.takeDamage(damage * v * multiplier);
            }
        }
    }
}


text:
require_relative '../helpers'

describe "Ruby DevPack" do

  include Helpers

  describe "tools" do
    it "installs Ruby 2.2.1" do
      run_cmd("ruby -v").should match('2.2.1')
    end
    it "installs RubyGems 2.4.5" do
      run_cmd("gem -v").should match("2.4.5")
    end
    it "installs Git 1.9.5" do
      run_cmd("git --version").should match('git version 1.9.5')
    end
    it "installs kdiff3" do
      marker_file = "#{BUILD_DIR}/merged.md"
      begin
        run_cmd("kdiff3 README.md README.md --auto -cs LineEndStyle=0 -o #{marker_file}")
        File.exist?(marker_file).should be true
      ensure
        File.delete(marker_file) if File.exist?(marker_file)
      end
    end
    it "installs clink 0.4.4" do
      run_cmd("#{BUILD_DIR}/tools/clink/clink.bat version").should match('Clink v0.4.4')
    end
  end

  describe "environment" do
    it "sets HOME to X:/home" do
      env_match "HOME=#{BUILD_DIR}/home"
    end
    it "sets TERM=rxvt" do
      env_match "TERM=rxvt"
    end
    it "sets ANSICON=true" do
      env_match "ANSICON=true"
    end
    it "sets RI to use plain format" do
      env_match "RI=--format bs"
    end
    it "sets SSL_CERT_FILE to X:/home/cacert.pem" do
      env_match "SSL_CERT_FILE=#{BUILD_DIR}/home/cacert.pem"
    end
  end

  describe "aliases" do
    it "aliases `bundle exec` to `be`" do
      run_cmd("doskey /macros").should match('be=bundle exec $*')
    end
    it "aliases `sublime_text` to `vi`" do
      run_cmd("doskey /macros").should match('vi=sublime_text $*')
    end
  end

  describe "ruby installations" do

    describe "system ruby" do
      it "provides the default `ruby` command" do
        run_cmd("which ruby").should match(convert_slashes("#{SYSTEM_RUBY}/bin/ruby.EXE"))
      end
      it "provides the default `gem` command" do
        run_cmd("which gem").should match(convert_slashes("#{SYSTEM_RUBY}/bin/gem"))
      end
      it "uses the system ruby gemdir" do
        run_cmd("#{SYSTEM_RUBY}/bin/gem environment gemdir").should match("#{SYSTEM_RUBY}/lib/ruby/gems/2.2.0")
      end
      it "has 'bundler (1.8.4)' gem installed" do
        gem_installed "bundler", "1.8.4"
      end
    end
  end
end


text:
// --------------------------------------------------------------------------------------------------------------------
// <copyright file="IIPAddressChecker.cs" company="Marcin Smółka">
//   Copyright (c) Marcin Smółka. All rights reserved.
// </copyright>
// <summary>
//   The IPAddressChecker interface.
// </summary>
// --------------------------------------------------------------------------------------------------------------------

namespace ZNetCS.AspNetCore.IPFiltering;

#region Usings

using System.Collections.Generic;
using System.Net;

using NetTools;

#endregion

/// <summary>
/// The IPAddressChecker interface.
/// </summary>
public interface IIPAddressChecker
{
    #region Public Methods

    /// <summary>
    /// Checks if IP address is allowed.
    /// </summary>
    /// <param name="ipAddress">
    /// The IP address.
    /// </param>
    /// <param name="whitelist">
    /// The whitelist.
    /// </param>
    /// <param name="blacklist">
    /// The blacklist.
    /// </param>
    /// <param name="blockLevel">
    /// The default block level.
    /// </param>
    /// <returns>
    /// Returns <see langword="true"/> if IP address is allowed, otherwise <see langword="false"/>.
    /// </returns>
    bool IsAllowed(IPAddress? ipAddress, ICollection<IPAddressRange> whitelist, ICollection<IPAddressRange> blacklist, DefaultBlockLevel blockLevel);

    #endregion
}


text:
package com.link_intersystems.jdbc.test.db.sakila;

import com.link_intersystems.test.UnitTest;
import com.link_intersystems.jdbc.test.DBAssertions;
import org.junit.jupiter.api.BeforeEach;

import java.sql.Connection;
import java.sql.SQLException;

import static org.junit.jupiter.api.Assertions.assertEquals;

/**
 * @author René Link {@literal <rene.link@link-intersystems.com>}
 */
@UnitTest
public abstract class AbstractDBExtensionTest {

    protected Connection connection;
    protected DBAssertions dbAssertions;

    @BeforeEach
    void setUp(Connection connection) throws SQLException {
        this.connection = connection;
        dbAssertions = new DBAssertions(connection);
    }

}


text:
require 'rubygems'
require 'bundler/setup'
Bundler.require :default, :test

require 'capybara/dsl'
Capybara.app = OOP.new

class IntegrationTest < MiniTest::Spec
  include Capybara::DSL
  register_spec_type(/integration$/, self)
end

Turn.config.format = :dot


text:
package org.carlspring.strongbox.users.domain;

import static java.util.stream.Collectors.toSet;

import java.io.Serializable;
import java.util.Collections;
import java.util.Set;

import javax.annotation.concurrent.Immutable;

import org.carlspring.strongbox.users.dto.PathPrivilegesDto;
import org.carlspring.strongbox.users.dto.RepositoryPrivilegesDto;
import org.carlspring.strongbox.users.dto.RepositoryPrivileges;

import com.google.common.collect.ImmutableSet;

/**
 * @author Przemyslaw Fusik
 */
@Immutable
public class RepositoryPrivilegesData
        implements Serializable, RepositoryPrivileges
{

    private final String repositoryId;

    private final Set<Privileges> repositoryPrivileges;

    private final Set<PathPrivilegesData> pathPrivileges;

    public RepositoryPrivilegesData(final RepositoryPrivilegesDto delegate)
    {
        this.repositoryId = delegate.getRepositoryId();
        this.repositoryPrivileges = immuteRepositoryPrivileges(delegate.getRepositoryPrivileges());
        this.pathPrivileges = immutePathPrivileges(delegate.getPathPrivileges());
    }

    private Set<Privileges> immuteRepositoryPrivileges(final Set<Privileges> set)
    {
        return set != null ? ImmutableSet.copyOf(set)
                : Collections.emptySet();
    }

    private Set<PathPrivilegesData> immutePathPrivileges(final Set<PathPrivilegesDto> source)
    {
        return source != null ?
               ImmutableSet.copyOf(source.stream().map(PathPrivilegesData::new).collect(toSet())) :
               Collections.emptySet();
    }

    public String getRepositoryId()
    {
        return repositoryId;
    }

    public Set<Privileges> getRepositoryPrivileges()
    {
        return repositoryPrivileges;
    }

    public Set<PathPrivilegesData> getPathPrivileges()
    {
        return pathPrivileges;
    }
}


text:
package com.podcopic.animationlib.androidsimplifiedanimation.Views;

import android.support.v7.app.AppCompatActivity;
import android.os.Bundle;
import android.view.View;

import com.podcopic.animationlib.androidsimplifiedanimation.R;
import com.podcopic.animationlib.library.AnimationType;
import com.podcopic.animationlib.library.StartSmartAnimation;

public class SpecialView extends AppCompatActivity {

    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_special_view);
    }

    public void animationStart(View v){

        if(v.getId() == (R.id.drop_out)){
            StartSmartAnimation.startAnimation(v, AnimationType.DropOut, 2000, 0, false,100);
        }
        else if(v.getId() == (R.id.landing)){
            StartSmartAnimation.startAnimation(v, AnimationType.Landing, 2000 , 0 ,true ,100);
        }
        else if(v.getId() == (R.id.hinge)){
            StartSmartAnimation.startAnimation(v, AnimationType.Hinge, 2000 , 0 ,true ,100);
        }
        else if(v.getId() == (R.id.roll_in)){
            StartSmartAnimation.startAnimation(v, AnimationType.RollIn, 2000 , 0 ,false ,100);
        }
        else if(v.getId() == (R.id.roll_out)){
            StartSmartAnimation.startAnimation(v, AnimationType.RollOut, 2000 , 0 , true ,100);
        }
    }
}


text:
<?php

namespace Misd\GuzzleBundle\DependencyInjection\Compiler;

use Symfony\Component\DependencyInjection\Compiler\CompilerPassInterface;
use Symfony\Component\DependencyInjection\ContainerBuilder;
use Symfony\Component\DependencyInjection\Reference;

/**
 * Add the bundle's listeners to Guzzle service builder.
 *
 * @author Chris Wilkinson <chris.wilkinson@admin.cam.ac.uk>
 */
class ServiceBuilderCompilerPass implements CompilerPassInterface
{
    /**
     * {@inheritdoc}
     */
    public function process(ContainerBuilder $container)
    {
        foreach ($container->findTaggedServiceIds('misd_guzzle.plugin') as $plugin => $attributes) {
            $container->getDefinition('guzzle.service_builder')
                ->addMethodCall('addGlobalPlugin', array(new Reference($plugin)));
        }
    }
}


text:
import { useAppSelector } from '#CA/hooks'
import { MzHeader } from '#CC/header/MzHeader'
import { MzColumn, MzTable } from '#CC/table/MzTable'
import { useLocal, useSession } from '#CH/useLocal'
import { useData } from '#CH/useOnce'
import { EditOutlined, UnorderedListOutlined } from '@ant-design/icons'
import { Button, Radio, Space } from 'antd'
import { Link, useNavigate } from 'react-router-dom'
import './DiscGroups.scss'

import { IGroupCount } from '#DT/disc'
import { compareGroups, formatUpdate } from '#DU/group-utils'
import { isJustUpdate } from '#RU/check'
import { apiToGroups, linkToGroups } from '#RU/links'

const adminCols = buildColumns()
const guestCols = adminCols.filter((col) => !['edit', 'item'].includes(col.key))

export default function DiscGroups() {
  const navigate = useNavigate()
  const hasBasic = useAppSelector((state) => state.session.hasBasic)

  const [filter, setFilter] = useLocal('groups-filter', 'top')
  const [isMore, setIsMore] = useSession('groups-ismore', false)

  const getPub = filter === 'top' && isMore === true
  const apiUrl = apiToGroups(`?filter=${getPub ? 'pub' : filter}`)

  const { data: groups, ...state } = useData<IGroupCount[]>(apiUrl, {
    refreshDeps: [apiUrl],
  })

  const lastCols = hasBasic && filter === 'all' ? adminCols : guestCols

  return (

      <MzHeader
        title="推荐列表"
        state={state}
        items={[
          {
            key: 'K1',
            label: '添加列表',
            onClick: () => navigate(linkToGroups(`/add`)),
            disabled: !hasBasic,
          },
          {
            key: 'K2',
            label: '设置过滤',
            children: [
              {
                key: 'S1',
                label: <Radio checked={filter === 'top' && isMore !== true}>显示推荐列表</Radio>,
                onClick: () => {
                  setFilter('top')
                  setIsMore(false)
                },
              },
              {
                key: 'S2',
                label: <Radio checked={filter === 'pub' || isMore === true}>显示公开列表</Radio>,
                onClick: () => setFilter('pub'),
              },
              {
                key: 'S3',
                label: <Radio checked={filter === 'all'}>管理所有列表</Radio>,
                onClick: () => {
                  setFilter('all')
                  setIsMore(false)
                },
                disabled: !hasBasic,
              },
            ],
          },
        ]}
      />
      {groups && (
        <Space direction="vertical" style={{ width: '100%' }}>
          <MzTable
            tag="groups"
            rows={groups}
            cols={lastCols}
            trClass={trClass}
            defaultSort={compareGroups}
          />
          {filter === 'top' && isMore === false && (
            <Button type="link" onClick={() => setIsMore(true)}>
              点击加载更多列表
            </Button>
          )}
        </Space>
      )}

  )
}

function trClass(t: IGroupCount) {
  return { warning: t.viewType === 'PrivateList' }
}

function buildColumns(): MzColumn<IGroupCount>[] {
  return [
    {
      key: 'idx',
      title: '#',
      format: (row, idx) => idx + 1,
    },
    {
      key: 'title',
      title: '列表标题',
      format: (row) => {
        let color = isJustUpdate(row.modifyTime, 1) ? 'red' : '#C67532'
        return (

            <Link to={linkToGroups(`/${row.key}/discs`)}>{row.title}</Link>
            ({row.discCount})

        )
      },
    },
    {
      key: 'update',
      title: '最后更新',
      format: formatUpdate,
    },
    {
      key: 'edit',
      title: '编辑列表',
      format: (row) => {
        return (
          <Link to={linkToGroups(`/${row.key}`)}>
            <EditOutlined />
          </Link>
        )
      },
    },
    {
      key: 'item',
      title: '增减碟片',
      format: (row) => {
        return (
          <Link to={linkToGroups(`/${row.key}/discs/edit`)}>
            <UnorderedListOutlined />
          </Link>
        )
      },
    },
  ]
}


text:
SYNONYM

#### According to
Index Fungorum

#### Published in
null

#### Original name
Cercophora cainia Mukerji, R.N. Kumar & N. Singh

### Remarks
null


text:
package org.apache.hadoop.hive.ql.exec.vector.ptf;

import org.apache.hadoop.hive.ql.exec.vector.VectorizedRowBatch;

/**
 * This is a convenience VectorizedRowBatch to be used by VectorPTFGroupBatches.
 */
public class BufferedVectorizedRowBatch extends VectorizedRowBatch {
  boolean isLastGroupBatch;

  public BufferedVectorizedRowBatch(int numCols) {
    super(numCols);
  }
}


text:
using System;
using System.Collections.Generic;
using Microsoft.PSharp;

namespace ReplicatingStorage
{
    internal class StorageNode : Machine
    {
        #region events

        /// <summary>
        /// Used to configure the storage node.
        /// </summary>
        public class ConfigureEvent : Event
        {
            public MachineId Environment;
            public MachineId NodeManager;
            public int Id;

            public ConfigureEvent(MachineId env, MachineId manager, int id)
                : base()
            {
                this.Environment = env;
                this.NodeManager = manager;
                this.Id = id;
            }
        }

        public class StoreRequest : Event
        {
            public int Command;

            public StoreRequest(int cmd)
                : base()
            {
                this.Command = cmd;
            }
        }

        public class SyncReport : Event
        {
            public int NodeId;
            public int Data;

            public SyncReport(int id, int data)
                : base()
            {
                this.NodeId = id;
                this.Data = data;
            }
        }

        public class SyncRequest : Event
        {
            public int Data;

            public SyncRequest(int data)
                : base()
            {
                this.Data = data;
            }
        }

        internal class ShutDown : Event { }
        private class LocalEvent : Event { }

        #endregion

        #region fields

        /// <summary>
        /// The environment.
        /// </summary>
        private MachineId Environment;

        /// <summary>
        /// The storage node manager.
        /// </summary>
        private MachineId NodeManager;

        /// <summary>
        /// The storage node id.
        /// </summary>
        private int NodeId;

        /// <summary>
        /// The data that this storage node contains.
        /// </summary>
        private int Data;

        /// <summary>
        /// The sync report timer.
        /// </summary>
        private MachineId SyncTimer;

        #endregion

        #region states

        [Start]
        [OnEntry(nameof(EntryOnInit))]
        [OnEventDoAction(typeof(ConfigureEvent), nameof(Configure))]
        [OnEventGotoState(typeof(LocalEvent), typeof(Active))]
        [DeferEvents(typeof(SyncTimer.Timeout))]
        class Init : MachineState { }

        void EntryOnInit()
        {
            this.Data = 0;
            this.SyncTimer = this.CreateMachine(typeof(SyncTimer));
            this.Send(this.SyncTimer, new SyncTimer.ConfigureEvent(this.Id));
        }

        void Configure()
        {
            this.Environment = (this.ReceivedEvent as ConfigureEvent).Environment;
            this.NodeManager = (this.ReceivedEvent as ConfigureEvent).NodeManager;
            this.NodeId = (this.ReceivedEvent as ConfigureEvent).Id;

            Console.WriteLine("\n [StorageNode-{0}] is up and running.\n", this.NodeId);

            this.Monitor<LivenessMonitor>(new LivenessMonitor.NotifyNodeCreated(this.NodeId));
            this.Send(this.Environment, new Environment.NotifyNode(this.Id));

            this.Raise(new LocalEvent());
        }

        [OnEventDoAction(typeof(StoreRequest), nameof(Store))]
        [OnEventDoAction(typeof(SyncRequest), nameof(Sync))]
        [OnEventDoAction(typeof(SyncTimer.Timeout), nameof(GenerateSyncReport))]
        [OnEventDoAction(typeof(Environment.FaultInject), nameof(Terminate))]
        class Active : MachineState { }

        void Store()
        {
            var cmd = (this.ReceivedEvent as StoreRequest).Command;
            this.Data += cmd;
            Console.WriteLine("\n [StorageNode-{0}] is applying command {1}.\n", this.NodeId, cmd);
            this.Monitor<LivenessMonitor>(new LivenessMonitor.NotifyNodeUpdate(this.NodeId, this.Data));
        }

        void Sync()
        {
            var data = (this.ReceivedEvent as SyncRequest).Data;
            this.Data = data;
            Console.WriteLine("\n [StorageNode-{0}] is syncing with data {1}.\n", this.NodeId, this.Data);
            this.Monitor<LivenessMonitor>(new LivenessMonitor.NotifyNodeUpdate(this.NodeId, this.Data));
        }

        void GenerateSyncReport()
        {
            this.Send(this.NodeManager, new SyncReport(this.NodeId, this.Data));
        }

        void Terminate()
        {
            this.Monitor<LivenessMonitor>(new LivenessMonitor.NotifyNodeFail(this.NodeId));
            this.Send(this.SyncTimer, new Halt());
            this.Raise(new Halt());
        }

        #endregion

        protected override int HashedState
        {
            get
            {
                int hash = 19;
                hash = hash * 31 + NodeId;
                hash = hash * 31 + Data;
                return hash;
            }
        }
    }
}


text:
from setuptools import find_packages, setup

import polygraphy_reshape_destroyer

import os

def main():
    # We change to the project root directory so that `setup.py` is usable from any directory.
    ROOT_DIR = os.path.dirname(os.path.abspath(__file__))
    os.chdir(ROOT_DIR)

    setup(
        # NOTE: You will want to edit most of these fields for your custom extension module.
        name="polygraphy_reshape_destroyer",
        version=polygraphy_reshape_destroyer.__version__,
        description="Polygraphy Reshape Destroyer: Destroyer Of Reshapes",
        long_description=open("README.md", "r", encoding="utf-8").read(),
        url="https://github.com/NVIDIA/TensorRT/tree/main/tools/Polygraphy",
        author="NVIDIA",
        author_email="svc_tensorrt@nvidia.com",
        classifiers=[
            "Intended Audience :: Developers",
            "Programming Language :: Python :: 3",
        ],
        license="Apache 2.0",
        install_requires=[
            "polygraphy",
            # Our included loader needs ONNX-GraphSurgeon to modify the model.
            "onnx_graphsurgeon",
        ],
        packages=find_packages(exclude=("tests", "tests.*")),
        # The format of the entry_points is:
        # {
        #   "polygraphy.run.plugins"    # Polygraphy run entrypoint (this should not be changed)
        #      : ["<name-of-plugin>=module.<submodule...>:object"]
        # }
        entry_points={
            "polygraphy.run.plugins": [
                "reshape-destroyer=polygraphy_reshape_destroyer.export:export_argument_groups",
            ]
        },
        zip_safe=True,
        python_requires=">=3.6",
    )

if __name__ == "__main__":
    main()


text:
package com.nielsmasdorp.speculum.di;

import java.lang.annotation.Retention;
import java.lang.annotation.RetentionPolicy;

import javax.inject.Scope;

/**
 * @author Niels Masdorp (NielsMasdorp)
 */
@Scope
@Retention(RetentionPolicy.RUNTIME)
public @interface PerActivity { }


text:
export TMPDIR=.
bibtex2html --sort-as-bibtex \
            --style files_for_latex_pdf/siamplain \
            --header '
Bibliography
' \
            riemann.bib


text:
package org.apereo.cas.config;

import org.apereo.cas.adaptors.yubikey.YubiKeyAccountRegistry;
import org.apereo.cas.adaptors.yubikey.YubiKeyAccountValidator;
import org.apereo.cas.adaptors.yubikey.dao.DynamoDbYubiKeyAccountRegistry;
import org.apereo.cas.adaptors.yubikey.dao.DynamoDbYubiKeyFacilitator;
import org.apereo.cas.configuration.CasConfigurationProperties;
import org.apereo.cas.configuration.features.CasFeatureModule;
import org.apereo.cas.dynamodb.AmazonDynamoDbClientFactory;
import org.apereo.cas.util.crypto.CipherExecutor;
import org.apereo.cas.util.spring.boot.ConditionalOnFeatureEnabled;

import lombok.val;
import org.springframework.beans.factory.annotation.Qualifier;
import org.springframework.boot.autoconfigure.AutoConfiguration;
import org.springframework.boot.autoconfigure.condition.ConditionalOnMissingBean;
import org.springframework.boot.context.properties.EnableConfigurationProperties;
import org.springframework.cloud.context.config.annotation.RefreshScope;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.ScopedProxyMode;
import software.amazon.awssdk.services.dynamodb.DynamoDbClient;

/**
 * This is {@link DynamoDbYubiKeyConfiguration}.
 *
 * @author Misagh Moayyed
 * @since 6.3.0
 */
@EnableConfigurationProperties(CasConfigurationProperties.class)
@ConditionalOnFeatureEnabled(feature = CasFeatureModule.FeatureCatalog.YubiKey, module = "dynamodb")
@AutoConfiguration
public class DynamoDbYubiKeyConfiguration {

    @RefreshScope(proxyMode = ScopedProxyMode.DEFAULT)
    @Bean
    public DynamoDbYubiKeyFacilitator yubikeyDynamoDbFacilitator(
        final CasConfigurationProperties casProperties,
        @Qualifier("yubikeyDynamoDbClient")
        final DynamoDbClient yubikeyDynamoDbClient) {
        val db = casProperties.getAuthn().getMfa().getYubikey().getDynamoDb();
        val f = new DynamoDbYubiKeyFacilitator(db, yubikeyDynamoDbClient);
        if (!db.isPreventTableCreationOnStartup()) {
            f.createTable(db.isDropTablesOnStartup());
        }
        return f;
    }

    @RefreshScope(proxyMode = ScopedProxyMode.DEFAULT)
    @Bean
    @ConditionalOnMissingBean(name = "yubikeyDynamoDbClient")
    public DynamoDbClient yubikeyDynamoDbClient(final CasConfigurationProperties casProperties) {
        val db = casProperties.getAuthn().getMfa().getYubikey().getDynamoDb();
        val factory = new AmazonDynamoDbClientFactory();
        return factory.createAmazonDynamoDb(db);
    }

    @RefreshScope(proxyMode = ScopedProxyMode.DEFAULT)
    @Bean
    public YubiKeyAccountRegistry yubiKeyAccountRegistry(
        @Qualifier("yubikeyDynamoDbFacilitator")
        final DynamoDbYubiKeyFacilitator yubikeyDynamoDbFacilitator,
        @Qualifier("yubiKeyAccountValidator")
        final YubiKeyAccountValidator yubiKeyAccountValidator,
        @Qualifier("yubikeyAccountCipherExecutor")
        final CipherExecutor yubikeyAccountCipherExecutor) {
        val registry = new DynamoDbYubiKeyAccountRegistry(yubiKeyAccountValidator, yubikeyDynamoDbFacilitator);
        registry.setCipherExecutor(yubikeyAccountCipherExecutor);
        return registry;
    }
}


text:
  Charentenay est
       un village
       situé dans le département de Yonne en Bourgogne. Elle comptait 257 habitants en 2008.

À coté de Charentenay sont localisées les communes de
Fouronnes à 4 km, 147 habitants,
Courson-les-Carrières localisée à 5 km, 853 habitants,
Merry-Sec à 4 km, 176 habitants,
Fontenay-sous-Fouronnes à 5 km, 75 habitants,
Val-de-Mercy située à 4 km, 366 habitants,
Mouffy à 2 km, 113 habitants,
 entre autres. De plus, Charentenay est située à seulement 16 km de Auxerre.

Si vous pensez demenager à Charentenay, vous pourrez aisément trouver une maison à acheter.

Le parc d'habitations, à Charentenay, était réparti en 2011 en dix appartements et 169 maisons soit
 un marché plutôt équilibré.


text:
<?php

namespace WellCommerce\Bundle\PaymentBundle\Repository;

use WellCommerce\Bundle\CoreBundle\Repository\RepositoryInterface;

/**
 * Interface PaymentRepositoryInterface
 *
 * @author  Adam Piotrowski <adam@wellcommerce.org>
 */
interface PaymentRepositoryInterface extends RepositoryInterface
{
}


text:
<!DOCTYPE html>

    <title>Redirecting...</title>
    <link rel="canonical" href="https://sendgrid.com/docs/User_Guide/Marketing_Campaigns/overview.html"/>
    <meta http-equiv="content-type" content="text/html; charset=utf-8" />
    <meta http-equiv="refresh" content="0; url=https://sendgrid.com/docs/User_Guide/Marketing_Campaigns/overview.html" />

Redirecting...

Click here if you are not redirected.