text:
/*************************************************
*      Perl-Compatible Regular Expressions       *
*************************************************/

/* PCRE is a library of functions to support regular expressions whose syntax
and semantics are as close as possible to those of the Perl 5 language.

                       Written by Philip Hazel
     Original API code Copyright (c) 1997-2012 University of Cambridge
          New API code Copyright (c) 2016-2017 University of Cambridge

-----------------------------------------------------------------------------
Redistribution and use in source and binary forms, with or without
modification, are permitted provided that the following conditions are met:

    * Redistributions of source code must retain the above copyright notice,
      this list of conditions and the following disclaimer.

    * Redistributions in binary form must reproduce the above copyright
      notice, this list of conditions and the following disclaimer in the
      documentation and/or other materials provided with the distribution.

    * Neither the name of the University of Cambridge nor the names of its
      contributors may be used to endorse or promote products derived from
      this software without specific prior written permission.

THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE
LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
POSSIBILITY OF SUCH DAMAGE.
-----------------------------------------------------------------------------
*/

#ifdef HAVE_CONFIG_H
#include "config.h"
#endif

#include "pcre2_internal.h"

/*************************************************
*          Default malloc/free functions         *
*************************************************/

/* Ignore the "user data" argument in each case. */

static void *default_malloc(size_t size, void *data)
{
(void)data;
return malloc(size);
}

static void default_free(void *block, void *data)
{
(void)data;
free(block);
}

/*************************************************
*        Get a block and save memory control     *
*************************************************/

/* This internal function is called to get a block of memory in which the
memory control data is to be stored at the start for future use.

Arguments:
  size        amount of memory required
  memctl      pointer to a memctl block or NULL

Returns:      pointer to memory or NULL on failure
*/

extern void *
PRIV(memctl_malloc)(size_t size, pcre2_memctl *memctl)
{
pcre2_memctl *newmemctl;
void *yield = (memctl == NULL)? malloc(size) :
  memctl->malloc(size, memctl->memory_data);
if (yield == NULL) return NULL;
newmemctl = (pcre2_memctl *)yield;
if (memctl == NULL)
  {
  newmemctl->malloc = default_malloc;
  newmemctl->free = default_free;
  newmemctl->memory_data = NULL;
  }
else *newmemctl = *memctl;
return yield;
}

/*************************************************
*          Create and initialize contexts        *
*************************************************/

/* Initializing for compile and match contexts is done in separate, private
functions so that these can be called from functions such as pcre2_compile()
when an external context is not supplied. The initializing functions have an
option to set up default memory management. */

PCRE2_EXP_DEFN pcre2_general_context * PCRE2_CALL_CONVENTION
pcre2_general_context_create(void *(*private_malloc)(size_t, void *),
  void (*private_free)(void *, void *), void *memory_data)
{
pcre2_general_context *gcontext;
if (private_malloc == NULL) private_malloc = default_malloc;
if (private_free == NULL) private_free = default_free;
gcontext = private_malloc(sizeof(pcre2_real_general_context), memory_data);
if (gcontext == NULL) return NULL;
gcontext->memctl.malloc = private_malloc;
gcontext->memctl.free = private_free;
gcontext->memctl.memory_data = memory_data;
return gcontext;
}

/* A default compile context is set up to save having to initialize at run time
when no context is supplied to the compile function. */

const pcre2_compile_context PRIV(default_compile_context) = {
  { default_malloc, default_free, NULL },    /* Default memory handling */
  NULL,                                      /* Stack guard */
  NULL,                                      /* Stack guard data */
  PRIV(default_tables),                      /* Character tables */
  PCRE2_UNSET,                               /* Max pattern length */
  BSR_DEFAULT,                               /* Backslash R default */
  NEWLINE_DEFAULT,                           /* Newline convention */
  PARENS_NEST_LIMIT,                         /* As it says */
  0 };                                       /* Extra options */

/* The create function copies the default into the new memory, but must
override the default memory handling functions if a gcontext was provided. */

PCRE2_EXP_DEFN pcre2_compile_context * PCRE2_CALL_CONVENTION
pcre2_compile_context_create(pcre2_general_context *gcontext)
{
pcre2_compile_context *ccontext = PRIV(memctl_malloc)(
  sizeof(pcre2_real_compile_context), (pcre2_memctl *)gcontext);
if (ccontext == NULL) return NULL;
*ccontext = PRIV(default_compile_context);
if (gcontext != NULL)
  *((pcre2_memctl *)ccontext) = *((pcre2_memctl *)gcontext);
return ccontext;
}

/* A default match context is set up to save having to initialize at run time
when no context is supplied to a match function. */

const pcre2_match_context PRIV(default_match_context) = {
  { default_malloc, default_free, NULL },
#ifdef SUPPORT_JIT
  NULL,
  NULL,
#endif
  NULL,
  NULL,
  PCRE2_UNSET,   /* Offset limit */
  HEAP_LIMIT,
  MATCH_LIMIT,
  MATCH_LIMIT_DEPTH };

/* The create function copies the default into the new memory, but must
override the default memory handling functions if a gcontext was provided. */

PCRE2_EXP_DEFN pcre2_match_context * PCRE2_CALL_CONVENTION
pcre2_match_context_create(pcre2_general_context *gcontext)
{
pcre2_match_context *mcontext = PRIV(memctl_malloc)(
  sizeof(pcre2_real_match_context), (pcre2_memctl *)gcontext);
if (mcontext == NULL) return NULL;
*mcontext = PRIV(default_match_context);
if (gcontext != NULL)
  *((pcre2_memctl *)mcontext) = *((pcre2_memctl *)gcontext);
return mcontext;
}

/* A default convert context is set up to save having to initialize at run time
when no context is supplied to the convert function. */

const pcre2_convert_context PRIV(default_convert_context) = {
  { default_malloc, default_free, NULL },    /* Default memory handling */
#ifdef _WIN32
  CHAR_BACKSLASH,                            /* Default path separator */
  CHAR_GRAVE_ACCENT                          /* Default escape character */
#else  /* Not Windows */
  CHAR_SLASH,                                /* Default path separator */
  CHAR_BACKSLASH                             /* Default escape character */
#endif
  };

/* The create function copies the default into the new memory, but must
override the default memory handling functions if a gcontext was provided. */

PCRE2_EXP_DEFN pcre2_convert_context * PCRE2_CALL_CONVENTION
pcre2_convert_context_create(pcre2_general_context *gcontext)
{
pcre2_convert_context *ccontext = PRIV(memctl_malloc)(
  sizeof(pcre2_real_convert_context), (pcre2_memctl *)gcontext);
if (ccontext == NULL) return NULL;
*ccontext = PRIV(default_convert_context);
if (gcontext != NULL)
  *((pcre2_memctl *)ccontext) = *((pcre2_memctl *)gcontext);
return ccontext;
}

/*************************************************
*              Context copy functions            *
*************************************************/

PCRE2_EXP_DEFN pcre2_general_context * PCRE2_CALL_CONVENTION
pcre2_general_context_copy(pcre2_general_context *gcontext)
{
pcre2_general_context *new =
  gcontext->memctl.malloc(sizeof(pcre2_real_general_context),
  gcontext->memctl.memory_data);
if (new == NULL) return NULL;
memcpy(new, gcontext, sizeof(pcre2_real_general_context));
return new;
}

PCRE2_EXP_DEFN pcre2_compile_context * PCRE2_CALL_CONVENTION
pcre2_compile_context_copy(pcre2_compile_context *ccontext)
{
pcre2_compile_context *new =
  ccontext->memctl.malloc(sizeof(pcre2_real_compile_context),
  ccontext->memctl.memory_data);
if (new == NULL) return NULL;
memcpy(new, ccontext, sizeof(pcre2_real_compile_context));
return new;
}

PCRE2_EXP_DEFN pcre2_match_context * PCRE2_CALL_CONVENTION
pcre2_match_context_copy(pcre2_match_context *mcontext)
{
pcre2_match_context *new =
  mcontext->memctl.malloc(sizeof(pcre2_real_match_context),
  mcontext->memctl.memory_data);
if (new == NULL) return NULL;
memcpy(new, mcontext, sizeof(pcre2_real_match_context));
return new;
}

PCRE2_EXP_DEFN pcre2_convert_context * PCRE2_CALL_CONVENTION
pcre2_convert_context_copy(pcre2_convert_context *ccontext)
{
pcre2_convert_context *new =
  ccontext->memctl.malloc(sizeof(pcre2_real_convert_context),
  ccontext->memctl.memory_data);
if (new == NULL) return NULL;
memcpy(new, ccontext, sizeof(pcre2_real_convert_context));
return new;
}

/*************************************************
*              Context free functions            *
*************************************************/

PCRE2_EXP_DEFN void PCRE2_CALL_CONVENTION
pcre2_general_context_free(pcre2_general_context *gcontext)
{
if (gcontext != NULL)
  gcontext->memctl.free(gcontext, gcontext->memctl.memory_data);
}

PCRE2_EXP_DEFN void PCRE2_CALL_CONVENTION
pcre2_compile_context_free(pcre2_compile_context *ccontext)
{
if (ccontext != NULL)
  ccontext->memctl.free(ccontext, ccontext->memctl.memory_data);
}

PCRE2_EXP_DEFN void PCRE2_CALL_CONVENTION
pcre2_match_context_free(pcre2_match_context *mcontext)
{
if (mcontext != NULL)
  mcontext->memctl.free(mcontext, mcontext->memctl.memory_data);
}

PCRE2_EXP_DEFN void PCRE2_CALL_CONVENTION
pcre2_convert_context_free(pcre2_convert_context *ccontext)
{
if (ccontext != NULL)
  ccontext->memctl.free(ccontext, ccontext->memctl.memory_data);
}

/*************************************************
*             Set values in contexts             *
*************************************************/

/* All these functions return 0 for success or PCRE2_ERROR_BADDATA if invalid
data is given. Only some of the functions are able to test the validity of the
data. */

/* ------------ Compile context ------------ */

PCRE2_EXP_DEFN int PCRE2_CALL_CONVENTION
pcre2_set_character_tables(pcre2_compile_context *ccontext,
  const unsigned char *tables)
{
ccontext->tables = tables;
return 0;
}

PCRE2_EXP_DEFN int PCRE2_CALL_CONVENTION
pcre2_set_bsr(pcre2_compile_context *ccontext, uint32_t value)
{
switch(value)
  {
  case PCRE2_BSR_ANYCRLF:
  case PCRE2_BSR_UNICODE:
  ccontext->bsr_convention = value;
  return 0;

  default:
  return PCRE2_ERROR_BADDATA;
  }
}

PCRE2_EXP_DEFN int PCRE2_CALL_CONVENTION
pcre2_set_max_pattern_length(pcre2_compile_context *ccontext, PCRE2_SIZE length)
{
ccontext->max_pattern_length = length;
return 0;
}

PCRE2_EXP_DEFN int PCRE2_CALL_CONVENTION
pcre2_set_newline(pcre2_compile_context *ccontext, uint32_t newline)
{
switch(newline)
  {
  case PCRE2_NEWLINE_CR:
  case PCRE2_NEWLINE_LF:
  case PCRE2_NEWLINE_CRLF:
  case PCRE2_NEWLINE_ANY:
  case PCRE2_NEWLINE_ANYCRLF:
  case PCRE2_NEWLINE_NUL:
  ccontext->newline_convention = newline;
  return 0;

  default:
  return PCRE2_ERROR_BADDATA;
  }
}

PCRE2_EXP_DEFN int PCRE2_CALL_CONVENTION
pcre2_set_parens_nest_limit(pcre2_compile_context *ccontext, uint32_t limit)
{
ccontext->parens_nest_limit = limit;
return 0;
}

PCRE2_EXP_DEFN int PCRE2_CALL_CONVENTION
pcre2_set_compile_extra_options(pcre2_compile_context *ccontext, uint32_t options)
{
ccontext->extra_options = options;
return 0;
}

PCRE2_EXP_DEFN int PCRE2_CALL_CONVENTION
pcre2_set_compile_recursion_guard(pcre2_compile_context *ccontext,
  int (*guard)(uint32_t, void *), void *user_data)
{
ccontext->stack_guard = guard;
ccontext->stack_guard_data = user_data;
return 0;
}

/* ------------ Match context ------------ */

PCRE2_EXP_DEFN int PCRE2_CALL_CONVENTION
pcre2_set_callout(pcre2_match_context *mcontext,
  int (*callout)(pcre2_callout_block *, void *), void *callout_data)
{
mcontext->callout = callout;
mcontext->callout_data = callout_data;
return 0;
}

PCRE2_EXP_DEFN int PCRE2_CALL_CONVENTION
pcre2_set_heap_limit(pcre2_match_context *mcontext, uint32_t limit)
{
mcontext->heap_limit = limit;
return 0;
}

PCRE2_EXP_DEFN int PCRE2_CALL_CONVENTION
pcre2_set_match_limit(pcre2_match_context *mcontext, uint32_t limit)
{
mcontext->match_limit = limit;
return 0;
}

PCRE2_EXP_DEFN int PCRE2_CALL_CONVENTION
pcre2_set_depth_limit(pcre2_match_context *mcontext, uint32_t limit)
{
mcontext->depth_limit = limit;
return 0;
}

PCRE2_EXP_DEFN int PCRE2_CALL_CONVENTION
pcre2_set_offset_limit(pcre2_match_context *mcontext, PCRE2_SIZE limit)
{
mcontext->offset_limit = limit;
return 0;
}

/* This function became obsolete at release 10.30. It is kept as a synonym for
backwards compatibility. */

PCRE2_EXP_DEFN int PCRE2_CALL_CONVENTION
pcre2_set_recursion_limit(pcre2_match_context *mcontext, uint32_t limit)
{
return pcre2_set_depth_limit(mcontext, limit);
}

PCRE2_EXP_DEFN int PCRE2_CALL_CONVENTION
pcre2_set_recursion_memory_management(pcre2_match_context *mcontext,
  void *(*mymalloc)(size_t, void *), void (*myfree)(void *, void *),
  void *mydata)
{
(void)mcontext;
(void)mymalloc;
(void)myfree;
(void)mydata;
return 0;
}

/* ------------ Convert context ------------ */

PCRE2_EXP_DEFN int PCRE2_CALL_CONVENTION
pcre2_set_glob_separator(pcre2_convert_context *ccontext, uint32_t separator)
{
if (separator != CHAR_SLASH && separator != CHAR_BACKSLASH &&
    separator != CHAR_DOT) return PCRE2_ERROR_BADDATA;
ccontext->glob_separator = separator;
return 0;
}

PCRE2_EXP_DEFN int PCRE2_CALL_CONVENTION
pcre2_set_glob_escape(pcre2_convert_context *ccontext, uint32_t escape)
{
if (escape > 255 || (escape != 0 && !ispunct(escape)))
  return PCRE2_ERROR_BADDATA;
ccontext->glob_escape = escape;
return 0;
}

/* End of pcre2_context.c */


text:
package org.hibernate.test.annotations.derivedidentities.e1.b;
import javax.persistence.Entity;
import javax.persistence.Id;

/**
 * @author Emmanuel Bernard
 */
@Entity
public class Employee {
	@Id
	long empId;
	String empName;
}

redpajama_set_name: RedPajamaGithub


text:
EmailAddress::EmailAddress(const QString & address, const QString & name)
{
    this->address = address;
    this->name = name;
}

EmailAddress::~EmailAddress()
{
}

void EmailAddress::setName(const QString & name)
{
    this->name = name;
}

void EmailAddress::setAddress(const QString & address)
{
    this->address = address;
}

const QString & EmailAddress::getName() const
{
    return name;
}

const QString & EmailAddress::getAddress() const
{
    return address;
}


text:
Helper function to convert pxs to rems

- [Sass Docs](https://www.boltdesignsystem.com/docs/#tools: px-to-rem)

## Install
```bash
npm install @bolt/tools-px-to-rem
```


text:
'''
Created on 2013.09.07.
'''

import sys

from node.sensor.sensor_daemon import SensorDaemon

def main():
    sys.path.append('/home/pi/ahead')
    sensorDaemon = SensorDaemon()
    sensorDaemon.startTempHumDaemon()
    sensorDaemon.startLuxDaemon()
    sensorDaemon.startDistanceDaemon()
    sensorDaemon.startMotionDaemon()
    sensorDaemon.startPowerDaemon()
    print("OS Platform: " + sys.platform)
    print("Main thread finished!")
    return 0

if __name__ == '__main__':
    main()


text:
package blasd.apex.core.primitive;

import static org.junit.Assert.assertEquals;

import java.util.Random;
import java.util.stream.IntStream;

import org.junit.Assert;
import org.junit.Test;

// https://github.com/javolution/javolution/blob/master/src/test/java/org/javolution/text/TypeFormatTest.java
public class ApexParserHelperTest {

	@Test
	public void parseDouble_One() {
		Assert.assertEquals(1.0, ApexParserHelper.parseDouble("1.0"), 0);
		Assert.assertEquals(1.0, ApexParserHelper.parseDouble("1"), 0);
	}

	@Test
	public void parseDouble_Zero() {
		Assert.assertEquals(0.0, ApexParserHelper.parseDouble("0.0"), 0);
		Assert.assertEquals(0.0, ApexParserHelper.parseDouble("0"), 0);
	}

	@Test
	public void parseDouble_NaN() {
		Assert.assertTrue(Double.isNaN(ApexParserHelper.parseDouble(Double.toString(Double.NaN))));
	}

	@Test
	public void parseDouble_Infinity() {
		Assert.assertTrue(Double.isInfinite(ApexParserHelper.parseDouble(Double.toString(Double.POSITIVE_INFINITY))));
		Assert.assertTrue(Double.isInfinite(ApexParserHelper.parseDouble(Double.toString(Double.NEGATIVE_INFINITY))));
	}

	@Test
	public void parseDouble_random() {
		Random r = new Random(0);

		IntStream.range(0, 10000).forEach(i -> {
			double d = r.nextInt(1000) * r.nextDouble();

			Assert.assertEquals(d, ApexParserHelper.parseDouble(Double.toString(d)), 0.00000001D);
		});
	}

	@Test(expected = NumberFormatException.class)
	public void parseDoubleThrowsExceptionIfStringDoesNotRepresentADouble() {
		ApexParserHelper.parseDouble("aaaa");
	}

	@Test
	public void parseDoubleWithExplicitPositiveNumber() {
		Assert.assertEquals("+15 Parsed", 15.0, ApexParserHelper.parseDouble("+15.0"), 0);
	}

	@Test
	public void parseDoubleWithNegativeNumber() {
		Assert.assertEquals("-15 Parsed", -15.0, ApexParserHelper.parseDouble("-15.0"), 0);
	}

	@Test
	public void parseDouble_MultipleZeroPrefix() {
		Assert.assertEquals(15.0, ApexParserHelper.parseDouble("00015.0"), 0);
		Assert.assertEquals(15.0, ApexParserHelper.parseDouble("+00015.0"), 0);
		Assert.assertEquals(15.0, ApexParserHelper.parseDouble("00015"), 0);
		Assert.assertEquals(15.0, ApexParserHelper.parseDouble("+00015"), 0);
	}

	// * TypeFormat.format(0.2, a) = "0.2" // 17 or 16 digits (as long as lossless conversion), remove trailing zeros.
	// * TypeFormat.format(0.2, 17, false, false, a) = "0.20000000000000001" // Closest 17 digits number.
	// * TypeFormat.format(0.2, 19, false, false, a) = "0.2000000000000000111" // Closest 19 digits.
	// * TypeFormat.format(0.2, 4, false, false, a) = "0.2" // Fixed-point notation, remove trailing zeros.
	// * TypeFormat.format(0.2, 4, false, true, a) = "0.2000" // Fixed-point notation, fixed number of digits.
	// * TypeFormat.format(0.2, 4, true, false, a) = "2.0E-1" // Scientific notation, remove trailing zeros.
	// * TypeFormat.format(0.2, 4, true, true, a) = "2.000E-1" // Scientific notation, fixed number of digits.
	@Test
	public void parseDouble_JavolutionTypeFormatExamples() {
		Assert.assertEquals(0.2D, ApexParserHelper.parseDouble("0.20000000000000001"), 0);
		Assert.assertEquals(0.2D, ApexParserHelper.parseDouble("0.2000000000000000111"), 0);
		Assert.assertEquals(0.2D, ApexParserHelper.parseDouble("0.2"), 0);
		Assert.assertEquals(0.2D, ApexParserHelper.parseDouble("0.2000"), 0);
		Assert.assertEquals(0.2D, ApexParserHelper.parseDouble("2.0E-1"), 0);
		Assert.assertEquals(0.2D, ApexParserHelper.parseDouble("2.000E-1"), 0);
	}

	@Test
	public void parseFloat() {
		Assert.assertEquals("1.0 Parsed", 1.0f, ApexParserHelper.parseFloat("1.0"), 0);
	}

	@Test(expected = NumberFormatException.class)
	public void parseFloatThrowsExceptionIfStringDoesNotRepresentAFloat() {
		ApexParserHelper.parseFloat("aaaa");
	}

	@Test
	public void parseFloatWithExplicitPositiveNumber() {
		assertEquals("+15 Parsed", 15.0f, ApexParserHelper.parseFloat("+15.0"), 0);
	}

	@Test
	public void parseFloatWithNegativeNumber() {
		assertEquals("-15 Parsed", -15.0f, ApexParserHelper.parseFloat("-15.0"), 0);
	}

}


text:
package main.behavior_design_patterns.interpreter;

public class InterpreterContext {

	public String getBinaryFormat(int i) {
		return Integer.toBinaryString(i);
	}

	public String getHexaDecimalFormat(int i) {
		return Integer.toHexString(i);
	}

}


text:
/**
 * Things related to the HTTP interface of the login service.
 *
 * @author olle.hallin@crisp.se
 */
package io.codekvast.login.http;


text:
import pytest
import time
from O365 import Account
from O365.utils import FileSystemTokenBackend
from tests import config

TEST_SCOPES = ['offline_access', 'Channel.ReadBasic.All',
               'ChannelMessage.Read.All', 'ChannelMessage.Send',
               'Chat.ReadWrite', 'ChatMember.ReadWrite', 'Team.ReadBasic.All',
               'User.Read', 'Presence.Read', 'Channel.Create',
               'TeamsAppInstallation.ReadForTeam']

@pytest.fixture(scope='module')
def teams():
    token_backend = FileSystemTokenBackend('.//')
    credentials = (config.CLIENT_ID, config.CLIENT_SECRET)
    account = Account(credentials, scopes=TEST_SCOPES,
                      token_backend=token_backend)
    yield account.teams()

class TestTeams:

    def test_get_my_presence(self, teams):
        my_presence = teams.get_my_presence()
        assert my_presence
        assert my_presence.object_id

    def test_get_my_teams(self, teams):
        my_teams = teams.get_my_teams()
        assert my_teams
        for team in my_teams:
            assert team.main_resource == '/teams/{}'.format(team.object_id)

    def test_get_my_chats(self, teams):
        my_chats = teams.get_my_chats()
        assert my_chats
        for chat in my_chats:
            assert chat.main_resource == '/chats/{}'.format(chat.object_id)

    def test_get_channels(self, teams):
        my_teams = teams.get_my_teams()
        assert my_teams
        for team in my_teams:
            channels = teams.get_channels(team.object_id)
            assert channels
            for channel in channels:
                assert channel.main_resource == '/channels/{}'.format(
                    channel.object_id)

    def test_create_channel(self, teams):
        my_teams = teams.get_my_teams()
        assert my_teams
        team_id = my_teams[0].object_id
        display_name = 'My Test Channel {}'.format(time.time())
        description = 'My Description'
        channel = teams.create_channel(team_id, display_name,
                                       description)
        assert channel
        assert channel.display_name == display_name
        assert channel.description == description
        assert channel.main_resource == '/channels/{}'.format(
            channel.object_id)

    def test_get_channel(self, teams):
        my_teams = teams.get_my_teams()
        assert my_teams
        for team in my_teams:
            channels = teams.get_channels(team.object_id)
            assert channels
            for channel in channels:
                this_channel = teams.get_channel(team.object_id,
                                                 channel.object_id)
                assert this_channel.main_resource == '/channels/{}'.format(
                    this_channel.object_id)

    def test_get_apps_in_team(self, teams):
        my_teams = teams.get_my_teams()
        assert my_teams
        for team in my_teams:
            apps = teams.get_apps_in_team(team.object_id)
            assert apps
            for app in apps:
                assert app.object_id

class TestTeam:

    def test_get_channels(self, teams):
        my_teams = teams.get_my_teams()
        assert my_teams
        for team in my_teams:
            channels = team.get_channels()
            assert channels
            for channel in channels:
                assert channel.main_resource == '/teams/{}/channels/{}'.format(
                    team.object_id, channel.object_id)

    def test_get_channel(self, teams):
        my_teams = teams.get_my_teams()
        assert my_teams
        for team in my_teams:
            channels = team.get_channels()
            assert channels
            for channel in channels:
                this_channel = team.get_channel(channel.object_id)
                assert this_channel.main_resource == '/teams/{}/channels/{}'.format(
                    team.object_id, this_channel.object_id)

class TestChannel:

    def test_get_messages(self, teams):
        my_teams = teams.get_my_teams()
        assert my_teams
        for team in my_teams:
            channels = team.get_channels()
            assert channels
            for channel in channels:
                messages = channel.get_messages()
                for message in messages:
                    assert message.main_resource == '/teams/{}/channels/{}/messages/{}'.format(
                        team.object_id, channel.object_id, message.object_id)

    def test_get_message(self, teams):
        my_teams = teams.get_my_teams()
        assert my_teams
        for team in my_teams:
            channels = team.get_channels()
            assert channels
            for channel in channels:
                messages = channel.get_messages()
                for message in messages:
                    this_message = channel.get_message(message.object_id)
                    assert this_message.main_resource == '/teams/{}/channels/{}/messages/{}'.format(
                        team.object_id, channel.object_id,
                        this_message.object_id)

    def test_send_message(self, teams):
        my_teams = teams.get_my_teams()
        assert my_teams
        channels = my_teams[0].get_channels()
        assert channels

        content_text = 'My Test Text'
        message_text = channels[0].send_message(content_text)
        assert message_text.content == content_text
        assert message_text.content_type == 'text'

        content_html = '
My Test HTML
'
        message_html = channels[0].send_message(content_html,
                                                content_type='html')
        assert message_html.content == content_html
        assert message_html.content_type == 'html'

class TestChat:

    def test_get_messages(self, teams):
        my_chats = teams.get_my_chats()
        assert my_chats
        for chat in my_chats:
            messages = chat.get_messages()
            assert messages
            for message in messages:
                assert message.main_resource == '/chats/{}/messages/{}'.format(
                    chat.object_id, message.object_id)

    def test_get_message(self, teams):
        my_chats = teams.get_my_chats()
        assert my_chats
        for chat in my_chats:
            messages = chat.get_messages()
            assert messages
            for message in messages:
                this_message = chat.get_message(message.object_id)
                assert this_message.main_resource == '/chats/{}/messages/{}'.format(
                    chat.object_id, this_message.object_id)

    def test_send_message(self, teams):
        my_chats = teams.get_my_chats()
        assert my_chats
        chat = my_chats[0]

        content_text = 'My Test Text'
        message_text = chat.send_message(content_text)
        assert message_text.content == content_text
        assert message_text.content_type == 'text'

        content_html = '
My Test HTML
'
        message_html = chat.send_message(content_html, content_type='html')
        assert message_html.content == content_html
        assert message_html.content_type == 'html'

    def test_get_members(self, teams):
        my_chats = teams.get_my_chats()
        assert my_chats
        for chat in my_chats:
            members = chat.get_members()
            assert members
            for member in members:
                assert member.main_resource == '/chats/{}/members/{}'.format(
                    chat.object_id, member.object_id)

    def test_get_member(self, teams):
        my_chats = teams.get_my_chats()
        assert my_chats
        for chat in my_chats:
            members = chat.get_members()
            assert members
            for member in members:
                this_member = chat.get_member(member.object_id)
                assert this_member.main_resource == '/chats/{}/members/{}'.format(
                    chat.object_id, this_member.object_id)

class TestChannelMessage:

    def test_get_replies(self, teams):
        count = 0
        my_teams = teams.get_my_teams()
        assert my_teams
        for team in my_teams:
            channels = team.get_channels()
            assert channels
            for channel in channels:
                messages = channel.get_messages()
                for message in messages:
                    replies = message.get_replies()

                    for reply in replies:
                        count += 1
                        assert reply.main_resource == '/teams/{}/channels/{}/messages/{}/replies/{}'.format(
                            team.object_id, channel.object_id,
                            message.object_id, reply.object_id)
        assert count

    def test_get_reply(self, teams):
        count = 0
        my_teams = teams.get_my_teams()
        assert my_teams
        for team in my_teams:
            channels = team.get_channels()
            assert channels
            for channel in channels:
                messages = channel.get_messages()
                for message in messages:
                    replies = message.get_replies()

                    for reply in replies:
                        count += 1
                        this_reply = message.get_reply(reply.object_id)
                        assert this_reply.main_resource == '/teams/{}/channels/{}/messages/{}/replies/{}'.format(
                            team.object_id, channel.object_id,
                            message.object_id, this_reply.object_id)
        assert count

    def test_send_reply(self, teams):
        my_teams = teams.get_my_teams()
        assert my_teams
        channels = my_teams[0].get_channels()
        assert channels
        messages = channels[0].get_messages()
        assert messages

        message = None
        for _ in messages:
            message = _
            break

        content_text = 'My Test Text'
        reply_text = message.send_reply(content_text)
        assert reply_text.content == content_text
        assert reply_text.content_type == 'text'

        content_html = '
My Test HTML
'
        reply_html = message.send_reply(content_html,
                                                content_type='html')
        assert reply_html.content == content_html
        assert reply_html.content_type == 'html'


text:
FROM php:fpm
MAINTAINER huangwc@easecloud.cn

ENV TZ=Asia/Shanghai

COPY ./build.sh /var/www/

RUN bash /var/www/build.sh && rm -f /var/www/build.sh

CMD ["php-fpm"]


text:
<?php
namespace App\Listeners\Teamwork;

use Teamwork;

class JoinTeamListener
{
    /**
     * See if the session contains an invite token on login and try to accept it.
     * @param mixed $event
     */
    public function handle($event)
    {
        if (session('invite_token')) {
            if ($invite = Teamwork::getInviteFromAcceptToken(session('invite_token'))) {
                Teamwork::acceptInvite($invite);
            }
            session()->forget('invite_token');
        }
    }
}


text:
import React, { Component } from 'react';
import {
  AppRegistry,
  AsyncStorage,
  ListView,
  NavigatorIOS,
  Image,
  StyleSheet,
  Text,
  TextInput,
  TouchableHighlight,
  View,
} from 'react-native';

import PlayDates from './PlayDates';
import MainScene from './MainScene';
import MapScene from './MapScene';
import UserDogs from './UserDogs';

const styles = require('./style.js')

class PlayDateCreate extends Component {
  constructor(props) {
    super(props);
    this.state={
      name: '',
      address: '',
      time_day: '',
      description: '',
      userID: false,
    };
  }

  componentDidMount() {
    AsyncStorage.getItem("userID").then((value) => {
      console.log('current.val '+ value);
        this.setState({userID: value});
    }).done();
  }

  getMarkerLatlng(address) {
    address = address.toLowerCase().trim();
    var url = "https://maps.googleapis.com/maps/api/geocode/json?address=" + address + "&key=AIzaSyA-ZuNXFqKCOUj3Lmkv25H5AyBn-GO6-OY"
    return fetch(url).then((res) => res.json());
    // when using this method chain with this code to get the laglng in an object
    // then((res) => console.log(res.results[0].geometry.location))
  }

  persistPlayDate(res) {
    var coordsJSONStringified = JSON.stringify(res.results[0].geometry.location);
    coordsJSONStringified = coordsJSONStringified.replace('"lat"', '"latitude"');
    coordsJSONStringified = coordsJSONStringified.replace('"lng"', '"longitude"');

    let data = {
      method: 'POST',
      body: JSON.stringify({
        name: this.state.name,
        time_day: this.state.time_day,
        address: this.state.address,
        location: coordsJSONStringified,
        description: this.state.description,
        user_id: this.state.userID,
      }),
      headers: {
        'Accept':       'application/json',
        'Content-Type': 'application/json'
      }
    }

    fetch('http://localhost:3000/playdates', data)
      .then((response) => response.json())  // promise
      .then((responseData) => {
        console.log(responseData);
        // Goes back to the map scene
        // this.props.navigator.popN(2);

        // Goes back to PlayDate list.
        this.props.navigator.pop({
          title: 'Your Playdates',
          component: PlayDates,
          leftButtonTitle: ' ',
          loaded: false,
        });
      })
      .catch((error) => console.log("An error occurred! " + error))
      .done();
  }

  createGroupPressed() {

    this.getMarkerLatlng(this.state.address)
      .then((res) => { this.persistPlayDate(res); })
      .catch((error) => console.log("An error occured! " + error))
      .done();

    // Hardcode a random location in San Francisco
    // var loc = "{\"latitude\": " + (Math.random()*(37.8-37.71)+37.71).toString() + ", \"longitude\": " + ((Math.random()*(122.48-122.39)+122.39)* -1).toString() + "}";
    // console.log('loc:');
    // console.log(loc);
    //
    // let data = {
    //   method: 'POST',
    //   body: JSON.stringify({
    //     name: this.state.name,
    //     time_day: this.state.time_day,
    //     address: this.state.address,
    //     // location: locResults.results[0].geometry.location,
    //     location: loc,
    //     description: this.state.description,
    //     user_id: this.state.userID
    //   }),
    //   headers: {
    //     'Accept':       'application/json',
    //     'Content-Type': 'application/json'
    //   }
    // }
    //
    // fetch('http://localhost:3000/playdates', data)
    //   .then((response) => response.json())  // promise
    //   .then((responseData) => {
    //     console.log(responseData)
    //     // Goes back to the map scene
    //     this.props.navigator.popN(2);
    //   })
    //   .catch((error) => console.log("An error occurred! " + error))
    //   .done();
  }

  render() {
    return (
      <View style={styles.container}>
        <View style={styles.innerContainer}>

          <Text style={[styles.pageHeading, {color: 'black'}]}>
            Create your new Playdate
          </Text>

          <TextInput
            style={styles.inputText}
            value={this.state.name}
            placeholder="Playdate Name"
            onChangeText={(text) => this.setState({name: text})}
          />

          <TextInput
            style={styles.inputText}
            value={this.state.address}
            placeholder="Address"
            onChangeText={(text) => this.setState({address: text})}
          />

          <TextInput
            style={styles.inputText}
            value={this.state.time_day}
            placeholder="Time & Day of Week"
            onChangeText={(text) => this.setState({time_day: text})}
          />

          <TextInput
            style={[styles.inputText, styles.textArea]}
            value={this.state.description}
            multiline={true}
            placeholder="Description"
            onChangeText={(text) => this.setState({description: text})}
          />

          <TouchableHighlight
            style={styles.submitButton}
            onPress={() => this.createGroupPressed()}>
            <Text style={styles.buttonText}>Create Playdate</Text>
          </TouchableHighlight>
        </View>
      </View>
    );
  }
}

// const styles = StyleSheet.create({
//   container: {
//     flex: 1,
//     alignItems: 'center',
//     justifyContent: 'center',
//   },
//   text: {
//     fontSize: 14,
//   },
//   button: {
//     borderWidth: 2,
//     borderRadius: 12,
//     padding: 10,
//     backgroundColor: 'antiquewhite'
//   },
//   inputText: {
//     height: 30,
//     borderColor: 'gray',
//     borderWidth: 1,
//     borderRadius: 16,
//     padding: 10,
//     backgroundColor: '#EBFAFF',
//     marginBottom: 10,
//   },
//   textArea: {
//     height: 100,
//   },
//   label: {
//     fontSize: 14,
//   }
// });

module.exports = PlayDateCreate;


text:
<?php

namespace App;

use Illuminate\Database\Eloquent\Factories\HasFactory;
use Illuminate\Database\Eloquent\Model;

class Survey extends Model
{
    use HasFactory;

    protected $table = 'surveys';

    protected $fillable = [
        'client_id',
        'title',
        'content',
        'dateStart',
        'dateEnd',
        'mandatory',
        'passwordConfirmationRequired',
        'qualification_id'
    ];

    protected $dates = [
        'dateStart',
        'dateEnd',
    ];

    public function client()
    {
        return $this->belongsTo(Client::class);
    }

    public function qualification()
    {
        return $this->belongsTo(Qualification::class);
    }

    public function users()
    {
        return $this->hasManyThrough(
            User::class,
            Survey_user::class,
            'survey_id', // survey key on Survey_user table...
            'id', // Foreign key on Users table...
            'id', // Local key on survey table...
            'user_id' // user key on Survey_user table...
        );
    }

    public function survey_user()
    {
        return $this->hasMany(Survey_user::class);
    }

}


text:
<link rel="import" href="../../bower_components/polymer/polymer.html">
<link rel="import" href="../../bower_components/iron-flex-layout/iron-flex-layout-classes.html">
<link rel="import" href="../../bower_components/paper-material/paper-material.html">
<link rel="import" href="../../bower_components/paper-input/paper-input.html">
<link rel="import" href="../../bower_components/paper-button/paper-button.html">
<link rel="import" href="../../bower_components/lancie-card/lancie-card.html">

<dom-module id="lancie-password-reset-request-success">
  <template>
    <style include="iron-flex iron-flex-alignment"></style>
    <style>
      :host {
        display: block;
      }
    </style>

    <lancie-card heading="Mail sent">
      <div class="card-content">
        If there is an account linked to the given address, we have sent an email to that address with instructions on how to change your password.
      </div>
    </lancie-card>
  </template>
  <script>
  'use strict';

  (function() {
    Polymer({
      is: 'lancie-password-reset-request-success'
    });
  })();
  </script>
</dom-module>


text:
{% extends "./assembly-steps-template.md" %}

{% block heroimage %}
  ![](/images/speaker-module/hero.jpg)
{% endblock %}

{% block title %}Speaker module{% endblock %}

{% block intro %}
The speaker module houses a miniature 4W speaker which can be attached directly
to the speaker output of the OpsoroHAT. The module can be mounted either
straight or perpendicular to the grid using two M3x10 cap screws.
{% endblock %}

{% block parts %}
* 1 set of [laser-cut plastic parts](./appendix/custom-components.md#speaker-module) (6 pieces)
* 4× [M3x6 cap screws](./appendix/vendor-components.md#fasteners)
* 6× [M3 nuts](./appendix/vendor-components.md#fasteners)
* 1× [miniature 4 Ohm 4W speaker](./appendix/vendor-components.md#speaker)
* 40cm of speaker cable
* 2× [dupont crimp connectors](./appendix/vendor-components.md#dupont-connectors)
* 1× [dupont 1x2 crimp housing](./appendix/vendor-components.md#dupont-connectors)
{% endblock %}

{% block tools %}
* [hex key 2.5mm](./appendix/tools.md#hex-key)
* [wire strippers](./appendix/tools.md#stripper)
* [DuPont crimping tool](./appendix/tools.md#dupont)
* [soldering iron](./appendix/tools.md#soldering-iron)
{% endblock %}

{% set model = false %}
{% block model %}/assets/iris/eye_full test.iris/index.html{% endblock %}

{% block steps %}
{{ super() }}

### Step 1
![](/images/speaker-module/1.jpg)
Strip the insulation from both ends of the wire. Split the two conductors over a
distance of 1cm on both ends.

### Step 2
![](/images/speaker-module/2.jpg)
Using a dupont crimp tool, attach two crimp connectors to one end of the cable.

### Step 3
![](/images/speaker-module/3.jpg)
Insert the crimp connectors into the crimp housing. Mind the orientation of the
little barb on the crimp connector. Push until you hear it click into position.

### Step 4
![](/images/speaker-module/4.jpg)
Tin the ends of cable, then solder them to the tabs of the miniature speaker.
The polarity of the wires does not matter.

### Step 5
![](/images/speaker-module/5.jpg)
Attach the miniature speaker to the front plate of the speaker module using four
M3x6 cap screws. The screws attach from the back so that the screw heads are
hidden inside once the module is finished.

### Step 6
![](/images/speaker-module/6.jpg)
Insert an M3 nut into the hexagonal hole of the bottom plate. Snap the side
plate onto the bottom plate so that the nut stays in place.

### Step 7
![](/images/speaker-module/7.jpg)
Slide the top place (with speaker attached) into place.

### Step 8
![](/images/speaker-module/8.jpg)
Insert another M3 nut into the bottom place, and then snap the second side plate
onto the bottom plate.

### Step 9
![](/images/speaker-module/9.jpg)
Insert two M3 nuts into the hexagonal openings of the side plates, and then snap
the short side plate into place.

> **Hint** A spare M3 screw can be handy to keep the nuts in place while you
> maneuver the plate into place.

### Step 10
![](/images/speaker-module/10.jpg)
Insert the speaker cable through the circular opening in the remaining side
plate.

### Step 11
![](/images/speaker-module/11.jpg)
Snap the remaining side plate into place. The module is now ready for use!

{% endblock %}


text:
package httap

import (
	"fmt"
	"net"
	"reflect"
	"strings"
)

type AddrList []*net.TCPAddr

type AddrError struct {
	str string
	err error
}

func FindInterfaces() (intfsWithAddress []string) {
	intfs, err := net.Interfaces()
	if err != nil {
		return
	}

	for _, intf := range intfs {
		addrs, err := intf.Addrs()

		/* VMWare interfaces are not supported by libpcap. */
		if err == nil && len(addrs) > 0 && !strings.HasPrefix(intf.Name, "vmnet") {
			intfsWithAddress = append(intfsWithAddress, intf.Name)
		}
	}
	return
}

func ResolveAddrList(strs []string) (AddrList, error) {
	return resolveAddrListOrPatterns(strs, false)
}

func ResolveAddrPatterns(strs []string) (AddrList, error) {
	return resolveAddrListOrPatterns(strs, true)
}

func resolveAddrListOrPatterns(strs []string, expand bool) (addrs AddrList, err error) {
	var str string

	defer func() {
		if r := recover(); r != nil {
			err = &AddrError{str, r.(error)}
		}
	}()

	for _, str = range strs {
		host, port := splitAddr(str)

		if expand && host == "" {
			ips, err := net.InterfaceAddrs()
			if err != nil {
				panic(err)
			}

			for _, ip := range ips {
				addrs = addrs.AddResolved(ip.(*net.IPNet).IP.String(), port)
			}
		} else {
			addrs = addrs.AddResolved(host, port)
		}
	}

	return
}

func (addrs AddrList) AddResolved(host, port string) AddrList {
	resolved, err := net.ResolveTCPAddr("tcp", net.JoinHostPort(host, port))
	if err != nil {
		panic(err)
	}

	for _, item := range addrs {
		if reflect.DeepEqual(resolved, item) {
			return addrs
		}
	}
	return append(addrs, resolved)
}

func (addrs AddrList) String() string {
	var ipv4Addrs, ipv6Addrs []string
	for _, addr := range addrs {
		if p4 := addr.IP.To4(); len(p4) == net.IPv4len {
			ipv4Addrs = append(ipv4Addrs, addr.String())
		} else {
			ipv6Addrs = append(ipv6Addrs, addr.String())
		}
	}
	return strings.Join(append(ipv4Addrs, ipv6Addrs...), ", ")
}

func (addrs AddrList) Filter() string {
	var parts []string
	for _, addr := range addrs {
		parts = append(parts, fmt.Sprintf("(dst host %s and tcp dst port %d)", addr.IP, addr.Port))
	}
	return strings.Join(parts, " or ")
}

func (addrs AddrList) RequiresPromisc() bool {
	ips, err := net.InterfaceAddrs()
	if err != nil {
		return true
	}

Addrs:
	for _, addr := range addrs {
		for _, ip := range ips {
			if reflect.DeepEqual(addr.IP, ip.(*net.IPNet).IP) {
				continue Addrs
			}
		}
		return true
	}
	return false
}

func (e *AddrError) Error() string {
	return fmt.Sprintf("cannot resolve %s (%s)", e.str, e.err)
}

func splitAddr(addr string) (string, string) {
	if !hasPort(addr) {
		addr = addr + ":80"
	}

	host, port, err := net.SplitHostPort(addr)
	if err != nil {
		panic(err)
	}

	if host == "*" {
		host = ""
	}
	return host, port
}

func hasPort(addr string) bool {
	return strings.LastIndex(addr, ":") > strings.LastIndex(addr, "]")
}


text:
package com.google.android.apps.forscience.whistlepunk.review.labels;

import android.os.Bundle;
import androidx.appcompat.app.ActionBar;
import androidx.appcompat.app.AppCompatActivity;
import android.view.LayoutInflater;
import android.view.Menu;
import android.view.MenuInflater;
import android.view.View;
import android.view.ViewGroup;
import com.google.android.apps.forscience.whistlepunk.NoteViewHolder;
import com.google.android.apps.forscience.whistlepunk.R;
import com.google.android.apps.forscience.whistlepunk.accounts.AppAccount;
import com.google.android.apps.forscience.whistlepunk.filemetadata.Label;

/** Details view controller for a TriggerLabel. */
public class TriggerLabelDetailsFragment extends LabelDetailsFragment {

  public static TriggerLabelDetailsFragment newInstance(
      AppAccount appAccount, String experimentId, String trialId, Label originalLabel) {
    TriggerLabelDetailsFragment result = new TriggerLabelDetailsFragment();
    Bundle args = new Bundle();
    args.putString(LabelDetailsActivity.ARG_ACCOUNT_KEY, appAccount.getAccountKey());
    args.putString(LabelDetailsActivity.ARG_EXPERIMENT_ID, experimentId);
    args.putString(LabelDetailsActivity.ARG_TRIAL_ID, trialId);
    args.putParcelable(LabelDetailsActivity.ARG_LABEL, originalLabel);
    result.setArguments(args);
    return result;
  }

  public TriggerLabelDetailsFragment() {
    // Required empty public constructor
  }

  @Override
  public View onCreateView(
      LayoutInflater inflater, ViewGroup container, final Bundle savedInstanceState) {
    setHasOptionsMenu(true);
    View rootView =
        inflater.inflate(R.layout.sensor_readings_label_details_fragment, container, false);

    NoteViewHolder.loadTriggerIntoList(
        (ViewGroup) rootView.findViewById(R.id.snapshot_values_list), originalLabel, appAccount);

    setupCaption(rootView);
    setupDetails(rootView);

    return rootView;
  }

  @Override
  public void onCreateOptionsMenu(Menu menu, MenuInflater inflater) {
    inflater.inflate(R.menu.menu_sensor_item_label_details, menu);

    ActionBar actionBar = ((AppCompatActivity) getActivity()).getSupportActionBar();
    if (actionBar != null) {
      actionBar.setTitle(
          getActivity().getResources().getString(R.string.trigger_label_details_title));
    }

    super.onCreateOptionsMenu(menu, inflater);
  }
}


text:
{% load i18n %}

  {% for code, language in all_languages %}
    {% if code == request.LANGUAGE_CODE %}

{{ language }}

    {% else %}

        <form action="{% url "set_language" %}" method="POST">
          {% csrf_token %}
          <input type="hidden" name="next" value="{{ request.path }}" />
          <input type="hidden" name="language" value="{{ code }}" />
          <button class="btn btn-link" type="submit">
            {{ language }}
          </button>
        </form>

    {% endif %}
  {% endfor %}
  {% if show_languages|length != all_languages|length %}

      <button class="btn btn-link" id="show-all-languages">
        {% trans "Show all" %}...
      </button>

  {% endif %}


text:
package com.javarush.task.task11.task1115;

/*
От школьника до квалифицированного раба
*/

public class Solution {
    public static void main(String[] args) {
    }

    public class Schoolboy {

    }

    public class Student extends Schoolboy {

    }

    public class Worker extends Student {

    }

    public class Slave extends Worker {

    }

}


text:
@implementation UIBaseCollectionViewCell

- (void)awakeFromNib {
    // Initialization code
}

- (CGSize)getCellSize
{
    CGSize size = CGSizeMake(self.contentView.frame.size.width, self.contentView.frame.size.height);
    return size;
}

@end


text:
from DeleteScheduledDeliveryTime import *
from ScheduleNewsletterDelivery import *
from GetNewsletterScheduleTime import *


text:
DATE=$(date +%Y%m%d)
TIME=$(date +%H%M%S)
#
# If executed with command line options, then instead of running installer
#+the arguments should be used to modify the variables.
if [ ${#} -gt 1 ]; then
    sed -i "s:^${1}=.*$:${1}=${2}:"g ${0}
    exit 0
fi
#*************************************************************************
# NOTE: This package does not follow the typical configure-build-install *
#+format, but uses an installer.                                         *
#^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
#
# Dependencies
#*************
#
# Preparation
#*************
source ${HOME}/.blfs_profile
# Other common preparations:
#source loadqt4
#pathappend /opt/lxqt/share XDG_DATA_DIRS
#
# Options
#********
# Set kernel version before running! Then unset to avoid future mistakes
# Can also set in environment.
#TGT_KVER=
if ! [ ${TGT_KVER} ]; then
    echo "Please set target kernel version (TGT_KVER) before running"
    exit 1
fi
# May choose one of many different premade config files
XORG_CONF="10-nvidia.conf"
# Uncomment to keep build files and sources
#PRESERVE_BUILD=1
# Uncomment to build only, do NOT install or modify system
#BUILD_ONLY=1
# Uncomment one to force including or skipping end configuration, resp.
#TREATASNEW=1
#TREATASOLD=1
#
# Name of program, with version and package/archive type
PROG=nvidia_kmod
# Alternate program name; in case it doesn't match my conventions;
# My conventions are: no capitals; only '-' between name and version,
#+replace any other '-' with '_'. PROG_ALT fits e.g. download url.
PROG_ALT=NVIDIA-Linux-x86_64
VERSION=361.18
# In this case it's just the extension, not really an archive type.
ARCHIVE=run
# optional suffix of "-no-compat32" depending on which version is needed
if [ $(uname -m) = "x86_64" ]; then
    SUFFIX="-no-compat32"
else
    SUFFIX=
fi
#
# Useful paths
# This is the directory in which we store any downloaded files; by default it
#+is the directory from which this script was executed.
WORKING_DIR=$PWD
# This is where the root of the package directory will be found
PKGDIR=${WORKING_DIR}/${PROG}-${VERSION}${SUFFIX}
# This is where the sources are
SRCDIR=${PKGDIR}
# Source dir build
#BUILDDIR=${SRCDIR}
# Subdirectory build
BUILDDIR=${SRCDIR}/kernel
# Parallel-directory build
#BUILDDIR=${SRCDIR}/../build
# Directory containing this script
SCRIPTDIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)"
#
# Downloads; obtain and verify package(s); or specify repo to clone and type
DL_URL=ftp://download.nvidia.com/XFree86/Linux-x86_64
DL_ALT=
MD5=29a88f1538d622cebf751593396053e4
SHASUM=
SHAALG=1
REPO=
# VCS=[git,hg,svn,...]; usually used as VERSION
#VCS=${VERSION}
BRANCH=master
# Prepare sources - PATCHDIR default is in blfs_profile; only specify non-def.
#PATCHDIR=${WORKING_DIR}/patches
#PATCH=${PROG}-${VERSION}.patch
if [ ${PATCH} ]; then
    [ -f ${PATCHDIR}/${PATCH} ] ||
        (echo "Patch ${PATCHDIR}/${PATCH} needed but not found" && exit 1)
fi
# Configure; prepare build
PREFICKS=/usr
SYSCONFDER=/etc
LOCALST8DER=/var
MANDER=/usr/share/man
DOCDER=/usr/share/doc/${PROG}-${VERSION}
# CONFIGURE: ${SRCDIR}/configure, cmake, qmake, ./autogen.sh, or other/undefined/blank
CONFIGURE=""
#
# Flags
#*******
# -j${PARALLEL} included by default; uncomment this to force nonparallel build
#PARALLEL=1
#
# CMake
#^^^^^^^
# Use this if CMake source root is different from SRCDIR
#CMAKE_SRC_ROOT=
#
# Another common cmake parameter is the build type; defaults to Release or
#+uncomment below
#CBUILDTYPE=RelWithDebInfo
#
#Specify CMake generator
#CMAKE_GEN='Unix Makefiles'
#
# Pass them in... (these are in addition to the defaults; see below)
CONFIG_FLAGS=""
MAKE="make"
MAKE_FLAGS="SYSSRC=/lib/modules/${TGT_KVER}/build module"
TEST=
TEST_FLAGS="-k"
INSTALL=""
INSTALL_FLAGS=""
#
# Additional/optional configurations: bootscript, group, user, ...
BOOTSCRIPT=
PROGGROUP=
PROGGROUPNUM=
PROGUSER=
PROGUSERNUM=${PROGGROUPNUM}
USRCMNT=
#
# Common commands
INSTALL_USER='install -v -Dm644'
INSTALL_BINUSER='install -v -Dm755'
INSTALL_DIRUSER='install -vd'
INSTALL_ROOT="as_root ${INSTALL_USER} -o root -g root"
INSTALL_BINROOT="as_root ${INSTALL_BINUSER} -o root -g root"
INSTALL_DIRROOT="as_root ${INSTALL_DIRUSER} -o root -g root"
#****************************************************************************#
################ No variable settings below this line! #######################
#****************************************************************************#
#
# Standard configuration settings
#*********************************
# CMake
#^^^^^^^
if [ "x${CONFIGURE:$((${#CONFIGURE}-5)):5}" = "xcmake" ]; then
    [ "${CMAKE_SRC_ROOT}" ] || CMAKE_SRC_ROOT=${SRCDIR}
    [ "${CBUILDTYPE}" ]     || CBUILDTYPE="Release"
    CONFIG_FLAGS="-DCMAKE_INSTALL_PREFIX=${PREFICKS} \
                  -DCMAKE_BUILD_TYPE=Release         \
                  -Wno-dev ${CONFIG_FLAGS} ${CMAKE_SRC_ROOT}"
# configure
#^^^^^^^^^^^
elif [ "x${CONFIGURE:$((${#CONFIGURE}-10)):10}" = "x/configure" ]; then
    [ "${CFG_PREFIX_FLAG}" ]        || CFG_PREFIX_FLAG="--prefix"
    [ "${CFG_SYSCONFDIR_FLAG}" ]    || CFG_SYSCONFDIR_FLAG="--sysconfdir"
    [ "${CFG_LOCALSTATEDIR_FLAG}" ] || CFG_LOCALSTATEDIR_FLAG="--localstatedir"
    [ "${CFG_DOCDIR_FLAG}" ]        || CFG_DOCDIR_FLAG="--docdir"
    [ "${CFG_MANDIR_FLAG}" ]        || CFG_MANDIR_FLAG="--mandir"
    CONFIG_FLAGS="${CFG_PREFIX_FLAG}=${PREFICKS}           \
                  ${CFG_SYSCONFDIR_FLAG}=${SYSCONFDER}     \
                  ${CFG_LOCALSTATEDIR_FLAG}=${LOCALST8DER} \
                  ${CFG_DOCDIR_FLAG}=${DOCDER}             \
                  ${CFG_MANDIR_FLAG}=${MANDER}             \
                  ${CONFIG_FLAGS}"
# Leave place for other possible configuration utilities to set up
# For now, just do-nothing placeholder command
# QMake
#^^^^^^^
elif [ "x${CONFIGURE:$((${#CONFIGURE}-5)):5}" = "xqmake" ]; then
    CONFIG_FLAGS="${CONFIG_FLAGS}"
# Autogen
#^^^^^^^^^
elif [ "x${CONFIGURE:$((${#CONFIGURE}-11)):11}" = "x/autogen.sh" ]; then
    CONFIG_FLAGS="${CONFIG_FLAGS}"
# Default
#^^^^^^^^^
else
    CONFIG_FLAGS="${CONFIG_FLAGS}"
fi
#
# Default make flags
#********************
MAKE_FLAGS="   -j${PARALLEL} ${MAKE_FLAGS}"
TEST_FLAGS="   -j${PARALLEL} ${TEST_FLAGS}"
INSTALL_FLAGS="-j${PARALLEL} ${INSTALL_FLAGS}"
#
# Create Group and/or User
#**************************
if [ "${PROGGROUP}" ]; then
    if ! (cat /etc/group | grep ${PROGGROUP} > /dev/null); then
        pathappend /usr/sbin
        as_root groupadd -g ${PROGGROUPNUM} ${PROGGROUP}
    fi
    if [ "${PROGUSER}" ]; then
        if ! (cat /etc/passwd | grep $PROGUSER > /dev/null); then
        as_root useradd -c "${USRCMNT}" -d /var/run/${PROGUSER} \
                -u ${PROGUSERNUM} -g $PROGGROUP -s /bin/false $PROGUSER
        pathremove /usr/sbin
        fi
    fi
elif [ "${PROGUSER}" ]; then
    if ! (cat /etc/passwd | grep $PROGUSER > /dev/null); then
    as_root useradd -c "${USRCMNT}" -d /var/run/${PROGUSER} \
            -u ${PROGUSERNUM} -s /bin/false $PROGUSER
    pathremove /usr/sbin
    fi
fi
#
# Check for previous installation
#*********************************
PROCEED="yes"
REINSTALL=0
grep "^${PROG//-/_}-" /list-$CHRISTENED"-"$SURNAME > /dev/null && ((\!$?)) &&\
    REINSTALL=1 && echo "Previous installation detected, proceed?" && read PROCEED
[ "${PROCEED}" = "yes" ] || [ "${PROCEED}" = "y" ] || exit 0
#
((TREATASNEW)) && REINSTALL=0
((TREATASOLD)) && REINSTALL=1
# Obtain package
#****************
if [ "${VCS}" ]; then
    if [ "${VCS}" == "git" -o ${VCS} == "hg" ]; then
        VCS_CMD="clone"
        BRANCH_FLAG="-b"
    elif [ "${VCS}" == "svn" ]; then
        VCS_CMD="co"
        BRANCH_FLAG=
    else
        echo "error: unkown value for VCS; aborting."
        exit 1
    fi
#
    # Preserve any previous builds; Ensure empty target directory
    #*************************************************************
    num=1
    while [ -d ${PKGDIR}${INC} ]; do
        INC="-${num}"
        ((num++))
    done
    if [ ${num} -gt 1 ]; then
        as_root mv ${PKGDIR} ${PKGDIR}${INC}
    fi
#
    # Clone Repository
    #******************
    ${VCS} ${VCS_CMD} ${BRANCH_FLAG} ${BRANCH} ${REPO} ${PKGDIR}
#
else
    # Download Package
    #******************
    if ! [ -f ${PROG}-${VERSION}${SUFFIX}.${ARCHIVE} ]; then
        wget ${DL_URL}/${VERSION}/${PROG_ALT}-${VERSION}${SUFFIX}.${ARCHIVE} \
            -O ${WORKING_DIR}/${PROG}-${VERSION}${SUFFIX}.${ARCHIVE} || FAIL_DL=1
        # FTP/alt Download:
        if (($FAIL_DL)) && [ "$DL_ALT" ]; then
            wget ${DL_ALT}/${VERSION}/${PROG_ALT}-${VERSION}${SUFFIX}.${ARCHIVE} \
            -O ${WORKING_DIR}/${PROG}-${VERSION}${SUFFIX}.${ARCHIVE} &&
            FAIL_DL=0 || FAIL_DL=2
        fi
        if [ $((FAIL_DL)) == 1 ]; then
            echo "Download failed! Find alternate link and try again."
            exit 1
        elif (($FAIL_DL)); then
            echo "${FAIL_DL} downloads failed! Find alternate link and try again."
            exit 1
        fi
    fi
#
# Verify package
    #****************
    if [ "${SHASUM}" ]; then
        echo "${SHASUM}  ${WORKING_DIR}/${PROG}-${VERSION}${SUFFIX}.${ARCHIVE}" |
                shasum -a ${SHAALG} -c ;\
            ( exit ${PIPESTATUS[0]} )
    elif [ "${MD5}" ]; then
        echo "${MD5} ${WORKING_DIR}/${PROG}-${VERSION}${SUFFIX}.${ARCHIVE}" | md5sum -c ;\
            ( exit ${PIPESTATUS[0]} )
    fi
#
    # Preserve any previous builds
    #******************************
    num=1
    while [ -d ${PKGDIR}${INC} ]; do
        INC="-${num}"
        ((num++))
    done
    if [ ${num} -gt 1 ]; then
        as_root mv ${PKGDIR} ${PKGDIR}${INC}
    fi
#
    # Extract package
    #*****************
    chmod u+x ${WORKING_DIR}/${PROG}-${VERSION}${SUFFIX}.${ARCHIVE}
    ${WORKING_DIR}/${PROG}-${VERSION}${SUFFIX}.${ARCHIVE} --extract-only
    mv ${WORKING_DIR}/${PROG_ALT}-${VERSION}${SUFFIX} ${SRCDIR}

fi # End "if [ ${VCS} ]..."
#
# Begin Installation
#********************
# Change to source directory
#^^^^^^^^^^^^^^^^^^^^^^^^^^^
pushd ${SRCDIR}
# Apply patch if necessary
#^^^^^^^^^^^^^^^^^^^^^^^^^^
[ "${PATCH}" ] && patch -Np1 < ${PATCHDIR}/${PATCH}
#
# Create build directory
#^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
[ -d ${BUILDDIR} ] || mkdir -v ${BUILDDIR}
pushd ${BUILDDIR}
#
# Autogen if necessary
#^^^^^^^^^^^^^^^^^^^^^
#${SRCDIR}/autogen.sh
#
# ... or autoreconf if only configure.ac or configure.in are present
#autoreconf ${SRCDIR}
#
# Pre-config -- additional actions to take before running configuration
#^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
#
#
# Configure
#^^^^^^^^^^^
if [ "${CONFIGURE}" ]; then
    if [ ${CMAKE_GEN} ]; then
        ${CONFIGURE} -G "${CMAKE_GEN}" ${CONFIG_FLAGS}
    else
        ${CONFIGURE} ${CONFIG_FLAGS}
    fi
fi
#
# Post-config modifications before building
#^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
#
#
# Build (doesn't apply to this package)
#^^^^^^^
${MAKE} ${MAKE_FLAGS}
#
# Test (optional)
#^^^^^^^^^^^^^^^^^
if [ "${TEST}" ]; then
    [ -d ${WORKING_DIR}/logs ] || mkdir -v ${WORKING_DIR}/logs
    ${MAKE} ${TEST_FLAGS} ${TEST} 2>&1 | \
        tee ${WORKING_DIR}/logs/${PROG}-${VERSION}-${DATE}.check || (exit 0)
    STAT=${PIPESTATUS[0]}
    if (( STAT )); then
        echo "Some tests failed; log in ../logs/$(basename $0)-log"
        echo "Pull up another terminal and check the output"
        echo "Shall we proceed? (say "'"yes"'" or "'"y"'" to proceed)"
        read PROCEED
        [ "$PROCEED" = "y" ] || [ "$PROCEED" = "yes" ]
    fi
fi
#
# Install
#^^^^^^^^^
#if ! ((BUILD_ONLY)); then
#    as_root ${INSTALL} ${INSTALL_FLAGS}
#fi
#
# Post-install actions (e.g. install documentation; some configuration)
#^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
# All commands in this section will be executed, even for upgrades and
#+reinstalls. To set a command to be executed only once, put it in the
#+Configuration section below.
#
# Install kernel module to versioned location
${INSTALL_DIRROOT} ${PREFICKS}/lib/nvidia/${VERSION}/kernel/${TGT_KVER}/modules
${INSTALL_ROOT} ${BUILDDIR}/*.ko \
        ${PREFICKS}/lib/nvidia/${VERSION}/kernel/${TGT_KVER}/modules/
# Symlink kernel module to be used by target kernel
${INSTALL_DIRROOT} /lib/modules/${TGT_KVER}/kernel/drivers/video
ln -sfv ${PREFICKS}/lib/nvidia/${VERSION}/kernel/${TGT_KVER}/modules/*.ko \
        /lib/modules/$TGT_KVER/kernel/drivers/video/
#
# Leave and delete build directory, unless preservation specified in options
#^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
popd    # Back to $SRCDIR
popd    # Back to $WORKING_DIR
if ! ((PRESERVE_BUILD)) && ! ((BUILD_ONLY)); then
    as_root rm -rf ${BUILDDIR}
else
    as_root mv ${BUILDDIR} ${WORKING_DIR}/${PROG}-${VERSION}-build-${DATE}
fi
as_root rm -rf ${PKGDIR}
[ -e ${WORKING_DIR}/${PROG}-${VERSION}${SUFFIX}.${ARCHIVE} ] &&
    as_root rm ${WORKING_DIR}/${PROG}-${VERSION}${SUFFIX}.${ARCHIVE}
#
# Add to installed list for this computer:
if ! ((BUILD_ONLY)); then
    echo "${PROG//-/_}-${VERSION}${SUFFIX}" >> /list-${CHRISTENED}-${SURNAME}
fi
#
# Stop here unless this is first install
#^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
((REINSTALL)) && exit 0 || (exit 0)
###################################################
#
# Init Script
#*************
if ! ((BUILD_ONLY)) && [ "${BOOTSCRIPT}" ]; then
    pushd ${BLFSDIR}/blfs-bootscripts-${BLFS_BOOTSCRIPTS_VER}
    as_root make install-${BOOTSCRIPT}
    popd
fi
#
###################################################
#
# Configuration
#***************
# This is where we put the main configuration; doesn't get repeated on
#+successive installs or updates unless specified otherwise.
#
as_root tee -a /etc/modprobe.d/blacklist << "EOF"
blacklist nouveau
EOF
#
if [ -f ${SYSCONFDER}/X11/xorg.conf.d/${XORG_CONF} ]; then
    mv -v ${SYSCONFDER}/X11/xorg.conf.d/${XORG_CONF} \
          ${SYSCONFDER}/X11/xorg.conf.d/${XORG_CONF}.bak
fi
as_root install -v -Dm644 -o root -g root \
    ${BLFSDIR}/files/etc/X11/xorg.conf.d/${XORG_CONF} /etc/X11/xorg.conf.d/
###################################################


text:
#ifndef TEXTIDOUTPUT_H
#define TEXTIDOUTPUT_H

#include <fstream>
#include <string>

#include <Playlist.h>
#include <IOutputStrategy.h>

namespace SoundCity
{
  /**
   * Module de sortie au format texte.
   */

  class TextIDOutput : public IOutputStrategy{
  public:
    TextIDOutput();
    /**
     * Permet de restituer la playlist générée à l'utilisateur.
     * @param playlist La playlist générée.
     */
    void format(std::string fileName, Playlist playlist);

  private:
    std::ofstream file;
  };
}

#endif //TEXTIDOUTPUT_H


text:
module LanguageService
  def self.label(id)
    ISO_639.find_by_code(id).try(:english_name) || id
  end
end


text:
%change directory to isotopedistribution folder
cd ('..');

%enter folder and filename.
% saves molecules to IsotopeFit\IsotopeDistribution\folder\file.ifm
folder='folder_for_ifm_file';
file='molecules';

% DONT CARE ABOUT THE FOLLOWING LINES
% -------------------------------------------------------
% If file exists, delete it and generate a new one
if exist(['molecules',filesep,folder,filesep,file,'.ifm'])==2
    fprintf('Old File removed.\n');
    delete(['molecules',filesep,folder,filesep,file,'.ifm']);
end
% -------------------------------------------------------
% CARE AGAIN

%set threshold for isotope abundance
th=1e-3;
%set threshold for minimum peak distance
mapprox=1e-4;

%list of cluster numbers. this can be written directly into generate
%function
nC60=[1,2,4]; %[C60]1, [C60]2 and [C60]4
nCO2=[0:60]; %[CO2]n with n from 0 to 60

%-------------------------------------------  generate clusters:

% C60 with CO2 attached, normal and hydrogenated species (n(H)= 0 or 1):
generate_cluster_ifm(folder,file,{'C60' 'CO2' 'H'},{nC60 nCO2 [0 1]},mapprox,th);

% attach H20 to isolated CO2's:
generate_cluster_ifm(folder,file,{'CO2' 'H2O'},{nCO2 [0 1]},mapprox,th);

%doubly charged ions:
generate_cluster_ifm(folder,file,{'C60' 'CO2'},{nC60 nCO2},mapprox,th,{'C60++' 'CO2'},2);

%-------------------------------------------  generate clusters end
cd ('..');

% for generation of single files, use generate_cluster function:
% --> i.e. generate_cluster_ifm(folder,{'C60' 'CO2' 'H'},{nC60 nCO2 [0 1]},mapprox,th);
% no filename needed!
% but ifm files are recommended!


text: Custom build of Entypo from http://fontello.com


text:
namespace Ciscordpp {

    class Client {
    public:
        enum class ClientType
        {
            Userbot,
            Bot
        };
        Client(ClientType type, scy::uv::Loop* loop = scy::uv::defaultLoop());
        ~Client();

        void setUsername(std::string username);
        void setPassword(std::string pass);
        void setToken(std::string token);
        void run();

        scy::Signal<void(Message&)> MessageRecieved;
        scy::Signal<void(std::string, std::exception&)> Error;
        scy::Signal<void(void)> Ready;
        scy::Signal<void(int)> ShardReady;
        scy::Signal<void(void)> Resumed;
        scy::Signal<void(scy::MutableBuffer&)> RawRecieved;
        scy::Signal<void(scy::MutableBuffer&)> RawSent;
        scy::Signal<void(Message&)> MessageDeleted;
        scy::Signal<void(Message&, Message&)> MessageEdited;
        scy::Signal<void(Reaction&, User&)> ReactionAdded;
        scy::Signal<void(Reaction&, User&)> ReactionRemoved;
        scy::Signal<void(Message&, Reaction*, int)> ReactionsCleared;
        scy::Signal<void(Channel&)> ChannelCreated;
        scy::Signal<void(Channel&)> ChannelDeleted;
        scy::Signal<void(Channel&, Channel&)> ChannelUpdated;
        scy::Signal<void(Channel&, scy::DateTime)> ChannelPinsUpdated;
        scy::Signal<void(Member&)> MemberJoined;
        scy::Signal<void(Member&)> MemberLeft;
        scy::Signal<void(Member&, Member&)> MemberUpdated;
        scy::Signal<void(Guild&)> GuildJoined;
        scy::Signal<void(Guild&)> GuildLeft;
        scy::Signal<void(Guild&, Guild&)> GuildUpdated;
        scy::Signal<void(Role&)> GuildRoleCreated;
        scy::Signal<void(Role&)> GuildRoleDeleted;
        scy::Signal<void(Role&, Role&)> GuildRoleUpdated;
        scy::Signal<void(std::vector<Emoji>&, std::vector<Emoji>&)> GuildEmojiUpdated;
        scy::Signal<void(Guild&)> GuildAvailable;
        scy::Signal<void(Guild&)> GuildUnavailable;
        scy::Signal<void(Member&, Member&)> VoiceStateUpdated;
        scy::Signal<void(Member&)> MemberBanned;
        scy::Signal<void(Guild&, User&)> MemberUnbanned;
        scy::Signal<void(Channel&, User&)> ChannelTyping;
        scy::Signal<void(Channel&, User&)> GroupJoined;
        scy::Signal<void(Channel&, User&)> GroupLeft;
        scy::Signal<void(Relationship&)> RelationshipAdded;
        scy::Signal<void(Relationship&)> RelationshipDeleted;
    private:
        HTTPClient client;
    };
}

#endif //CISCORDPP_CLIENT_H


text:
/*
 * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except
 * in compliance with the License. You may obtain a copy of the License at
 *
 * http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software distributed under the License
 * is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express
 * or implied. See the License for the specific language governing permissions and limitations under
 * the License.
 */
/*
 * This code was generated by https://github.com/googleapis/google-api-java-client-services/
 * Modify at your own risk.
 */

package com.google.api.services.speech.v1.model;

/**
 * Describes the progress of a long-running `LongRunningRecognize` call. It is included in the
 * `metadata` field of the `Operation` returned by the `GetOperation` call of the
 * `google::longrunning::Operations` service.
 *
 *
 This is the Java data model class that specifies how to parse/serialize into the JSON that is
 * transmitted over HTTP when working with the Cloud Speech-to-Text API. For a detailed explanation
 * see:
 * https://developers.google.com/api-client-library/java/google-http-java-client/json
 *

 *
 * @author Google, Inc.
 */
@SuppressWarnings("javadoc")
public final class LongRunningRecognizeMetadata extends com.google.api.client.json.GenericJson {

  /**
   * Time of the most recent processing update.
   * The value may be {@code null}.
   */
  @com.google.api.client.util.Key
  private String lastUpdateTime;

  /**
   * Approximate percentage of audio processed thus far. Guaranteed to be 100 when the audio is
   * fully processed and the results are available.
   * The value may be {@code null}.
   */
  @com.google.api.client.util.Key
  private java.lang.Integer progressPercent;

  /**
   * Time when the request was received.
   * The value may be {@code null}.
   */
  @com.google.api.client.util.Key
  private String startTime;

  /**
   * Time of the most recent processing update.
   * @return value or {@code null} for none
   */
  public String getLastUpdateTime() {
    return lastUpdateTime;
  }

  /**
   * Time of the most recent processing update.
   * @param lastUpdateTime lastUpdateTime or {@code null} for none
   */
  public LongRunningRecognizeMetadata setLastUpdateTime(String lastUpdateTime) {
    this.lastUpdateTime = lastUpdateTime;
    return this;
  }

  /**
   * Approximate percentage of audio processed thus far. Guaranteed to be 100 when the audio is
   * fully processed and the results are available.
   * @return value or {@code null} for none
   */
  public java.lang.Integer getProgressPercent() {
    return progressPercent;
  }

  /**
   * Approximate percentage of audio processed thus far. Guaranteed to be 100 when the audio is
   * fully processed and the results are available.
   * @param progressPercent progressPercent or {@code null} for none
   */
  public LongRunningRecognizeMetadata setProgressPercent(java.lang.Integer progressPercent) {
    this.progressPercent = progressPercent;
    return this;
  }

  /**
   * Time when the request was received.
   * @return value or {@code null} for none
   */
  public String getStartTime() {
    return startTime;
  }

  /**
   * Time when the request was received.
   * @param startTime startTime or {@code null} for none
   */
  public LongRunningRecognizeMetadata setStartTime(String startTime) {
    this.startTime = startTime;
    return this;
  }

  @Override
  public LongRunningRecognizeMetadata set(String fieldName, Object value) {
    return (LongRunningRecognizeMetadata) super.set(fieldName, value);
  }

  @Override
  public LongRunningRecognizeMetadata clone() {
    return (LongRunningRecognizeMetadata) super.clone();
  }

}


text:
goTo.file("/dir/a.ts");
verify.codeFix({
    description: "Generate types for 'plus'",
    newFileContent: {}, // no change
    commands: [{
        type: "generate types",
        file: "/dir/a.ts",
        fileToGenerateTypesFor: "/dir/node_modules/plus/index.js",
        outputFileName: "/dir/base/myTypes/plus.d.ts",
    }],
});


text:
@layout('_layout/dashboard/index')
@section('title')Galeri Foto@endsection
@section('nama-kelurahan')Lumajang@endsection

@section('content')

Nama Album ABC

					<button class="btn btn-sm btn-default" data-toggle="modal" data-target="#modal-tambah"> unggah foto</button>
					<button class="btn btn-sm btn-default"> segarkan</button>

					<input type="text" class="form-control" placeholder="cari di album">

						<button class="btn btn-default"></button>

					@for($i=0; $i < 12; $i++)

					@endfor

← Baru

Lama →

@endsection

@section('modal')

				<button type="button" class="close" data-dismiss="modal" aria-label="Close">×</button>

Foto Album

				<form action="#">

						Judul Foto
						<input type="text" class="form-control" name="nama" placeholder="judul foto" />

						Unggah
						<input type="file" name="foto" />

Maksimal 1MB

						<button class="btn btn-primary"> tambah</button>
						<button class="btn btn-warning" type="reset"> bersihkan</button>

				</form>

@endsection

@section('style')

@endsection


text:
    {{entityHeader}} :

        <input type="password" class="form-control" id="{{ctrl.controlId}}" name="{{ctrl.controlId}}" ng-model="entity" ng-required="required" ng-pattern="patternText" placeholder="{{placeHolder}}" ng-disabled="disable" />

            {{helpText}}


text:
> {%= description %}

## Install
{%= include("install") %}

## Usage

Create a new instance of `Tags`:

```js
var Tags = require('{%= name %}');
var html = new Tags();
```

### Tags

Generate a function to create any HTML tag:

```js
var apple = html.addTag('apple');

// pass text as the first parameter, and an object of
// attributes as the second param.
console.log(apple('a', {href: 'b'})
//=> '<apple href="b">a</apple>'

// or pass text as a property
console.log(apple({href: 'b', text: 'a'})
//=> '<apple href="b">a</apple>'
```

#### Default attributes

Pass default attributes as a second paramter:

```js
var css = html.addTag('link', {rel: 'stylesheet'});
console.log(css({href: 'styles.css'}));
//=> <link href="styles.css" rel="stylesheet">
```

### As Handlebars helpers

To create a [handlebars](handlebarsjs.com) helper:

```js
Handlebars.registerHelper('orange', tag.addTag('orange'));

var tmpl = Handlebars.compile('{{{orange "This is text" href=link}}}');
console.log(tmpl({link: 'about/us.html'}));
//=> '<orange href="about/us.html">This is text</orange>'
```

## Author
{%= include("author") %}

## License
{%= copyright() %}
{%= license() %}

***

{%= include("footer") %}


text:
package com.android.volley.toolbox;

import java.io.IOException;
import java.io.InputStream;
import java.util.zip.GZIPInputStream;

import org.apache.http.HttpEntity;
import org.apache.http.entity.HttpEntityWrapper;

public class InflatingEntity extends HttpEntityWrapper {
    public InflatingEntity(HttpEntity wrapped) {
        super(wrapped);
    }

    @Override
    public InputStream getContent() throws IOException {
        return new GZIPInputStream(wrappedEntity.getContent());
    }

    @Override
    public long getContentLength() {
        return wrappedEntity.getContentLength();
    }
}


text:
class Chef
  class Provider
    class Easy < Chef::Provider
      def load_current_resource
        true
      end

      def action_sell
        true
      end

      def action_buy
        true
      end
    end
  end
end


text:
<!DOCTYPE html>
<html xmlns="http://www.w3.org/1999/xhtml">

<head>
    <title>Advertisement</title>
    <meta name="viewport" content="width=device-width, initial-scale=1.0"/>
    <link rel="stylesheet" type="text/css" href="webjars/bootstrap/3.3.5/css/bootstrap.min.css" />
    <script type="text/javascript" src="/js/requests.js"></script>
</head>

<body>

</body>
</html>


text:
<?php

/**
 * @runTestsInSeparateProcesses
 */
class KeyCollisionTest extends ObjectStorageTestCase
{

    /**
     *
     */
    public function testFileWhenThereIsDirWithTheSameKey()
    {
        $objectStorage = $this->getInstance();

        $objectStorage->set(
                [
                    'key' => 'data1/data2',
                    'body' => 'data'
                ]
        );
        $this->assertTrue($this->checkState('46fe6220dc64b1fdac801a01f30f9296
objects/data1/data2: data
'));

        $this->expectException('\IvoPetkov\ObjectStorage\ErrorException');
        $objectStorage->set(
                [
                    'key' => 'data1',
                    'body' => 'data'
                ]
        );
    }

    /**
     *
     */
    public function testDirWhenThereIsFileWithTheSameKey()
    {
        $objectStorage = $this->getInstance();

        $objectStorage->set(
                [
                    'key' => 'data1',
                    'body' => 'data'
                ]
        );
        $this->assertTrue($this->checkState('eaa438b85d60666c5b30b3ed8f4affc6
objects/data1: data
'));

        $this->expectException('\IvoPetkov\ObjectStorage\ErrorException');
        $objectStorage->set(
                [
                    'key' => 'data1/data2',
                    'body' => 'data'
                ]
        );
    }

    /**
     *
     */
    public function testGetKeyWhenItsDir()
    {
        $objectStorage = $this->getInstance();

        $this->createFile($this->getDataDir() . '/objects/data1/key1', 'content');
        $result = $objectStorage->get([
            'key' => 'data1',
            'result' => ['key', 'body']
        ]);

        $this->assertTrue($result === null);

        $this->assertTrue($this->checkState('3fb020a8835e135fb296ad20b43ba773
objects/data1/key1: content
'));
    }

    /**
     *
     */
    public function testDeleteKeyWhenItsDir()
    {
        $objectStorage = $this->getInstance();

        $this->createFile($this->getDataDir() . '/objects/data1/key1', 'content');

        $objectStorage->delete([
            'key' => 'data1'
        ]);

        $this->assertTrue($this->checkState('3fb020a8835e135fb296ad20b43ba773
objects/data1/key1: content
'));
    }

}


text:
set -e

. $(dirname $0)/../settings.sh

echo "Creating package..."
cd $SOURCE_DIR
sbt package
cd -
echo "Done."

# note: in a real world scenario the package would be uploaded to a corporate repository


text:
using System;
using NetRuntimeSystem = System;
using System.ComponentModel;
using NetOffice.Attributes;

namespace NetOffice.OfficeApi
{
	/// <summary>
	/// DispatchInterface BulletFormat2
	/// SupportByVersion Office, 12,14,15,16
	/// </summary>
	/// <remarks> Docs: <see href="https://docs.microsoft.com/en-us/office/vba/api/Office.BulletFormat2"/> </remarks>
	[SupportByVersion("Office", 12,14,15,16)]
	[EntityType(EntityType.IsDispatchInterface)]
 	public class BulletFormat2 : _IMsoDispObj
	{
		#pragma warning disable

		#region Type Information

		/// <summary>
		/// Instance Type
		/// </summary>
		[EditorBrowsable(EditorBrowsableState.Advanced), Browsable(false), Category("NetOffice"), CoreOverridden]
		public override Type InstanceType
		{
			get
			{
				return LateBindingApiWrapperType;
			}
		}

        private static Type _type;

		[EditorBrowsable(EditorBrowsableState.Never), Browsable(false)]
        public static Type LateBindingApiWrapperType
        {
            get
            {
                if (null == _type)
                    _type = typeof(BulletFormat2);
                return _type;
            }
        }

        #endregion

		#region Ctor

		/// <param name="factory">current used factory core</param>
		/// <param name="parentObject">object there has created the proxy</param>
		/// <param name="proxyShare">proxy share instead if com proxy</param>
		public BulletFormat2(Core factory, ICOMObject parentObject, COMProxyShare proxyShare) : base(factory, parentObject, proxyShare)
		{
		}

		///<param name="factory">current used factory core</param>
		///<param name="parentObject">object there has created the proxy</param>
        ///<param name="comProxy">inner wrapped COM proxy</param>
		public BulletFormat2(Core factory, ICOMObject parentObject, object comProxy) : base(factory, parentObject, comProxy)
		{

		}

        ///<param name="parentObject">object there has created the proxy</param>
        ///<param name="comProxy">inner wrapped COM proxy</param>
        [EditorBrowsable(EditorBrowsableState.Never), Browsable(false)]
		public BulletFormat2(ICOMObject parentObject, object comProxy) : base(parentObject, comProxy)
		{
		}

		///<param name="factory">current used factory core</param>
		///<param name="parentObject">object there has created the proxy</param>
        ///<param name="comProxy">inner wrapped COM proxy</param>
        ///<param name="comProxyType">Type of inner wrapped COM proxy"</param>
		[EditorBrowsable(EditorBrowsableState.Never), Browsable(false)]
		public BulletFormat2(Core factory, ICOMObject parentObject, object comProxy, NetRuntimeSystem.Type comProxyType) : base(factory, parentObject, comProxy, comProxyType)
		{

		}

		///<param name="parentObject">object there has created the proxy</param>
        ///<param name="comProxy">inner wrapped COM proxy</param>
        ///<param name="comProxyType">Type of inner wrapped COM proxy"</param>
        [EditorBrowsable(EditorBrowsableState.Never), Browsable(false)]
		public BulletFormat2(ICOMObject parentObject, object comProxy, NetRuntimeSystem.Type comProxyType) : base(parentObject, comProxy, comProxyType)
		{
		}

		///<param name="replacedObject">object to replaced. replacedObject are not usable after this action</param>
		[EditorBrowsable(EditorBrowsableState.Never), Browsable(false)]
		public BulletFormat2(ICOMObject replacedObject) : base(replacedObject)
		{
		}

		[EditorBrowsable(EditorBrowsableState.Never), Browsable(false)]
		public BulletFormat2() : base()
		{
		}

		/// <param name="progId">registered progID</param>
		[EditorBrowsable(EditorBrowsableState.Never), Browsable(false)]
		public BulletFormat2(string progId) : base(progId)
		{
		}

		#endregion

		#region Properties

		/// <summary>
		/// SupportByVersion Office 12, 14, 15, 16
		/// Get
		/// Unknown COM Proxy
		/// </summary>
		/// <remarks> Docs: <see href="https://docs.microsoft.com/en-us/office/vba/api/Office.BulletFormat2.Parent"/> </remarks>
		[SupportByVersion("Office", 12,14,15,16), ProxyResult]
		public object Parent
		{
			get
			{
				return Factory.ExecuteReferencePropertyGet(this, "Parent");
			}
		}

		/// <summary>
		/// SupportByVersion Office 12, 14, 15, 16
		/// Get/Set
		/// </summary>
		/// <remarks> Docs: <see href="https://docs.microsoft.com/en-us/office/vba/api/Office.BulletFormat2.Character"/> </remarks>
		[SupportByVersion("Office", 12,14,15,16)]
		public Int32 Character
		{
			get
			{
				return Factory.ExecuteInt32PropertyGet(this, "Character");
			}
			set
			{
				Factory.ExecuteValuePropertySet(this, "Character", value);
			}
		}

		/// <summary>
		/// SupportByVersion Office 12, 14, 15, 16
		/// Get
		/// </summary>
		/// <remarks> Docs: <see href="https://docs.microsoft.com/en-us/office/vba/api/Office.BulletFormat2.Font"/> </remarks>
		[SupportByVersion("Office", 12,14,15,16)]
		public NetOffice.OfficeApi.Font2 Font
		{
			get
			{
				return Factory.ExecuteKnownReferencePropertyGet<NetOffice.OfficeApi.Font2>(this, "Font", NetOffice.OfficeApi.Font2.LateBindingApiWrapperType);
			}
		}

		/// <summary>
		/// SupportByVersion Office 12, 14, 15, 16
		/// Get
		/// </summary>
		/// <remarks> Docs: <see href="https://docs.microsoft.com/en-us/office/vba/api/Office.BulletFormat2.Number"/> </remarks>
		[SupportByVersion("Office", 12,14,15,16)]
		public Int32 Number
		{
			get
			{
				return Factory.ExecuteInt32PropertyGet(this, "Number");
			}
		}

		/// <summary>
		/// SupportByVersion Office 12, 14, 15, 16
		/// Get/Set
		/// </summary>
		/// <remarks> Docs: <see href="https://docs.microsoft.com/en-us/office/vba/api/Office.BulletFormat2.RelativeSize"/> </remarks>
		[SupportByVersion("Office", 12,14,15,16)]
		public Single RelativeSize
		{
			get
			{
				return Factory.ExecuteSinglePropertyGet(this, "RelativeSize");
			}
			set
			{
				Factory.ExecuteValuePropertySet(this, "RelativeSize", value);
			}
		}

		/// <summary>
		/// SupportByVersion Office 12, 14, 15, 16
		/// Get/Set
		/// </summary>
		/// <remarks> Docs: <see href="https://docs.microsoft.com/en-us/office/vba/api/Office.BulletFormat2.StartValue"/> </remarks>
		[SupportByVersion("Office", 12,14,15,16)]
		public Int32 StartValue
		{
			get
			{
				return Factory.ExecuteInt32PropertyGet(this, "StartValue");
			}
			set
			{
				Factory.ExecuteValuePropertySet(this, "StartValue", value);
			}
		}

		/// <summary>
		/// SupportByVersion Office 12, 14, 15, 16
		/// Get/Set
		/// </summary>
		/// <remarks> Docs: <see href="https://docs.microsoft.com/en-us/office/vba/api/Office.BulletFormat2.Style"/> </remarks>
		[SupportByVersion("Office", 12,14,15,16)]
		public NetOffice.OfficeApi.Enums.MsoNumberedBulletStyle Style
		{
			get
			{
				return Factory.ExecuteEnumPropertyGet<NetOffice.OfficeApi.Enums.MsoNumberedBulletStyle>(this, "Style");
			}
			set
			{
				Factory.ExecuteEnumPropertySet(this, "Style", value);
			}
		}

		/// <summary>
		/// SupportByVersion Office 12, 14, 15, 16
		/// Get/Set
		/// </summary>
		/// <remarks> Docs: <see href="https://docs.microsoft.com/en-us/office/vba/api/Office.BulletFormat2.Type"/> </remarks>
		[SupportByVersion("Office", 12,14,15,16)]
		public NetOffice.OfficeApi.Enums.MsoBulletType Type
		{
			get
			{
				return Factory.ExecuteEnumPropertyGet<NetOffice.OfficeApi.Enums.MsoBulletType>(this, "Type");
			}
			set
			{
				Factory.ExecuteEnumPropertySet(this, "Type", value);
			}
		}

		/// <summary>
		/// SupportByVersion Office 12, 14, 15, 16
		/// Get/Set
		/// </summary>
		/// <remarks> Docs: <see href="https://docs.microsoft.com/en-us/office/vba/api/Office.BulletFormat2.UseTextColor"/> </remarks>
		[SupportByVersion("Office", 12,14,15,16)]
		public NetOffice.OfficeApi.Enums.MsoTriState UseTextColor
		{
			get
			{
				return Factory.ExecuteEnumPropertyGet<NetOffice.OfficeApi.Enums.MsoTriState>(this, "UseTextColor");
			}
			set
			{
				Factory.ExecuteEnumPropertySet(this, "UseTextColor", value);
			}
		}

		/// <summary>
		/// SupportByVersion Office 12, 14, 15, 16
		/// Get/Set
		/// </summary>
		/// <remarks> Docs: <see href="https://docs.microsoft.com/en-us/office/vba/api/Office.BulletFormat2.UseTextFont"/> </remarks>
		[SupportByVersion("Office", 12,14,15,16)]
		public NetOffice.OfficeApi.Enums.MsoTriState UseTextFont
		{
			get
			{
				return Factory.ExecuteEnumPropertyGet<NetOffice.OfficeApi.Enums.MsoTriState>(this, "UseTextFont");
			}
			set
			{
				Factory.ExecuteEnumPropertySet(this, "UseTextFont", value);
			}
		}

		/// <summary>
		/// SupportByVersion Office 12, 14, 15, 16
		/// Get/Set
		/// </summary>
		/// <remarks> Docs: <see href="https://docs.microsoft.com/en-us/office/vba/api/Office.BulletFormat2.Visible"/> </remarks>
		[SupportByVersion("Office", 12,14,15,16)]
		public NetOffice.OfficeApi.Enums.MsoTriState Visible
		{
			get
			{
				return Factory.ExecuteEnumPropertyGet<NetOffice.OfficeApi.Enums.MsoTriState>(this, "Visible");
			}
			set
			{
				Factory.ExecuteEnumPropertySet(this, "Visible", value);
			}
		}

		#endregion

		#region Methods

		/// <summary>
		/// SupportByVersion Office 12, 14, 15, 16
		/// </summary>
		/// <remarks> Docs: <see href="https://docs.microsoft.com/en-us/office/vba/api/Office.BulletFormat2.Picture"/> </remarks>
		/// <param name="fileName">string fileName</param>
		[SupportByVersion("Office", 12,14,15,16)]
		public void Picture(string fileName)
		{
			 Factory.ExecuteMethod(this, "Picture", fileName);
		}

		#endregion

		#pragma warning restore
	}
}


text:
"use strict";

const assert         = require("chai").assert;
const ChildProcess   = require("child-process-promise");
const co             = require("co");
const NodeGit        = require("nodegit");
const path           = require("path");

const ConfigUtil          = require("./config_util");
const DoWorkQueue         = require("./do_work_queue");
const GitUtil             = require("./git_util");
const TreeUtil            = require("./tree_util");

/**
 * Return a sharded path for the specified `sha`, e.g.
 * "aabbffffffffffffffff" becomes: "aa/bb/ffffffffffffffff".  The behavior is
 * undefined unless `sha` contains at least five characters.
 *
 * @param {String} sha
 * @return {String}
 */
exports.shardSha = function (sha) {
    return path.join(sha.substr(0, 2), sha.substr(2, 2), sha.substr(4));
};

/**
 * This is a workaround for a missing libgit2 feature.  Normally, we
 * would use something like Reference.createMatching, but it doesn't support
 * asserting that a ref didn't previously exist.  See
 * https://github.com/libgit2/libgit2/pull/5842
 */
const updateRef = co.wrap(function*(repo, refName, commit, old, reflog) {
    try {
        yield ChildProcess.exec(
            `git -C ${repo.path()} update-ref -m '${reflog}' ${refName} \
${commit} ${old}`);
        return true;
    } catch (e) {
        return false;
    }
});

const tryWriteNotes = co.wrap(function *(repo, refName, contents) {
    // We're going to directly write the tree/commit for a new
    // note containing `contents`.

    let currentTree = null;
    const parents = [];
    const ref = yield GitUtil.getReference(repo, refName);
    if (null !== ref) {
        const currentCommit = yield repo.getCommit(ref.target());
        parents.push(currentCommit);
        currentTree = yield currentCommit.getTree();
    }
    const odb = yield repo.odb();
    const changes = {};
    const ODB_BLOB = 3;
    const BLOB = NodeGit.TreeEntry.FILEMODE.BLOB;
    const writeBlob = co.wrap(function *(sha) {
        const content = contents[sha];
        const blobId = yield odb.write(content, content.length, ODB_BLOB);
        const sharded = exports.shardSha(sha);
        changes[sharded] = new TreeUtil.Change(blobId, BLOB);
    });
    yield DoWorkQueue.doInParallel(Object.keys(contents), writeBlob);

    const newTree = yield TreeUtil.writeTree(repo, currentTree, changes);
    const sig = yield ConfigUtil.defaultSignature(repo);
    const commit = yield NodeGit.Commit.create(repo,
                                               null,
                                               sig,
                                               sig,
                                               null,
                                               "git-meta updating notes",
                                               newTree,
                                               parents.length,
                                               parents);

    let old;
    if (null === ref) {
        old = "0000000000000000000000000000000000000000";
    } else {
        old = ref.target().tostrS();
    }
    return yield updateRef(repo, refName, commit.tostrS(), old, "updated");
});

/**
 * Write the specified `contents` to the note having the specified `refName` in
 * the specified `repo`.
 *
 * Writing notes oneo-at-a-time is slow.  This method let's you write them in
 * bulk, far more efficiently.
 *
 * @param {NodeGit.Repository} repo
 * @param {String}             refName
 * @param {Object}             contents    SHA to data
 */
exports.writeNotes = co.wrap(function *(repo, refName, contents) {
    assert.instanceOf(repo, NodeGit.Repository);
    assert.isString(refName);
    assert.isObject(contents);

    if (0 === Object.keys(contents).length) {
        // Nothing to do if no contents; no point in making an empty commit or
        // in making clients check themselves.
        return;                                                       // RETURN
    }

    const retryCount = 3;
    let success;
    function sleep(ms) {
        return new Promise(resolve => setTimeout(resolve, ms));
    }
    for (let i = 0; i < retryCount; i++) {
        success = yield tryWriteNotes(repo, refName, contents);
        if (success) {
            return;
        } else {
            let suffix;
            if (i === retryCount - 1) {
                suffix = "giving up";
            } else {
                suffix = "retrying";
                yield sleep(500);
            }
            console.warn(`Failed to update notes ref ${refName}, ${suffix}`);
        }
    }
    if (!success) {
        throw new Error("Failed to update notes ref ${refName} after retries");
    }
});

/**
 * Load, into the specified `result`, note entries found in the specified
 * `tree`, prefixing their key with the specified `basePath`.  If subtrees are
 * found, recurse.  Use the specified `repo` to read trees from their IDs.
 *
 * @param {Object}       result
 * @param {NodeGit.Tree} tree
 * @param {String}       basePath
 */
const processTree = co.wrap(function *(result, repo, tree, basePath) {
    const entries = tree.entries();
    const processEntry = co.wrap(function *(e) {
        const fullPath = basePath + e.name();
        if (e.isBlob()) {
            const blob = yield e.getBlob();
            result[fullPath] = blob.toString();
        } else if (e.isTree()) {
            // Recurse if we find a tree,

            const id = e.id();
            const nextTree = yield repo.getTree(id);
            yield processTree(result, repo, nextTree, fullPath);
        }
        // Ignore anything that's neither blob nor tree.
    });
    yield DoWorkQueue.doInParallel(entries, processEntry);
});

/**
 * Return the contents of the note having the specified `refName` in the
 * specified `repo` or an empty object if no such note exists.
 *
 * Reading notes one-at-a-time is slow.  This method lets you read them all at
 * once for a given ref.
 *
 * @param {NodeGit.Repository} repo
 * @param {String}             refName
 * @return {Object} sha to content
 */
exports.readNotes = co.wrap(function *(repo, refName) {
    assert.instanceOf(repo, NodeGit.Repository);
    assert.isString(refName);

    const ref = yield GitUtil.getReference(repo, refName);
    if (null === ref) {
        return {};
    }
    const result = {};
    const commit = yield repo.getCommit(ref.target());
    const tree = yield commit.getTree();
    yield processTree(result, repo, tree, "");
    return result;
});

/**
 * Return the result of transforming the specified `map` so that each of the
 * (string) values are replaced by the result of JSON parsing them.
 *
 * @param {Object} map     string to string
 * @return {Object} map    string to object
 */
exports.parseNotes = function (map) {
    const result = {};
    for (let key in map) {
        result[key] = JSON.parse(map[key]);
    }
    return result;
};


text:
/// Copyright (c) 2012 Ecma International.  All rights reserved.
/**
 * @path ch15/15.2/15.2.3/15.2.3.6/15.2.3.6-3-221.js
 * @description Object.defineProperty - 'Attributes' is a Boolean object that uses Object's [[Get]] method to access the 'get' property (8.10.5 step 7.a)
 */

function testcase() {
        var obj = {};

        var boolObj = new Boolean(true);

        boolObj.get = function () {
            return "booleanGetProperty";
        };

        Object.defineProperty(obj, "property", boolObj);

        return obj.property === "booleanGetProperty";
    }
runTestCase(testcase);


text:
{-# LANGUAGE TypeFamilies #-}

module ShouldFail where

-- must fail: Repeated type variable
class C4 a where
  data S4 a a :: *


text:
Diagramme de Gantt pour les tâches
======================

Le but de ce diagramme de Gantt est de montrer une vue d'ensemble du temps utilisé en fonction de l'ensemble des tâches d'un projet donné.

- Le diagramme de Gantt est disponible depuis le « sélecteur de vue »
- Seuls les gestionnaires de projet peuvent accéder à cette section

![Gantt Chart](screenshots/gantt-chart-project.png)

- La **date de début** et la **date de fin** des tâches sont utilisées pour créer le graphique
- Les tâches peuvent être redimensionnées et déplacées horizontalement avec votre souris
- Il n'y a pas de glisser-déposer vertical
- La barre est de la même couleur que la tâche
- Chaque barre affiche un niveau de progression en pourcentage, qui est calculé en utilisant la position de la colonne dans le tableau
- Pour correspondre au modèle du Kanban, les tâches peuvent être ordonnées suivant leur position dans le tableau ou suivant les dates de début
- Les nouvelles tâches crées avec cette vue seront affichées sur le tableau en position 1 de la première colonne
- Les tâches sont affichées en noir quand il n'existe ni date de début ni date d'échéance définies

![Tâche non définie](screenshots/gantt-chart-not-defined.png)


text:
module StashEngine
  module EmbargoesHelper
  end
end


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

namespace Telestrations.Tests.Models
{
    public class TestWordRepository : IWordRepository
    {
        public List<string> GetQuestionWords(int count)
        {
            var words = new List<string>();
            for (int i = 0; i < count; i++)
            {
                words.Add("hoge" + i.ToString());
            }

            return words;
        }
    }
}


text:
package sample

import (
	"fmt"
	"github.com/aliyun/aliyun-oss-go-sdk/oss"
)

// BucketAccessMonitorSample  how to set, get the bucket access monitor.
func BucketAccessMonitorSample() {
	// New client
	client, err := oss.New(endpoint, accessID, accessKey)
	if err != nil {
		HandleError(err)
	}
	access := oss.PutBucketAccessMonitor{
		Status: "Enabled",
	}
	// put bucket access monitor
	err = client.PutBucketAccessMonitor(bucketName, access)
	if err != nil {
		HandleError(err)
	}
	fmt.Println("put bucket access monitor success!")

	// put bucket access monitor in xml format

	xml := `<?xml version="1.0" encoding="UTF-8"?>
<AccessMonitorConfiguration>
  <Status>Enabled</Status>
</AccessMonitorConfiguration>
`
	err = client.PutBucketAccessMonitorXml(bucketName, xml)
	if err != nil {
		HandleError(err)
	}
	fmt.Println("put bucket access monitor in xml format success!")

	// get bucket access monitor
	result, err := client.GetBucketAccessMonitor(bucketName)
	if err != nil {
		HandleError(err)
	}
	fmt.Printf("bucket access monitor config is:%s\n", result.Status)

	// get bucket access monitor in xml format
	xmlData, err := client.GetBucketAccessMonitorXml(bucketName)
	if err != nil {
		HandleError(err)
	}
	fmt.Printf("bucket access monitor config is:%s\n", xmlData)

	fmt.Println("BucketAccessMonitorSample completed")

}