text:
namespace Microsoft.Azure.Management.Sql.Models
{
    using Microsoft.Rest;
    using Microsoft.Rest.Serialization;
    using Newtonsoft.Json;
    using System.Linq;

    /// <summary>
    /// A long term retention policy.
    /// </summary>
    [Rest.Serialization.JsonTransformation]
    public partial class ManagedInstanceLongTermRetentionPolicy : ProxyResource
    {
        /// <summary>
        /// Initializes a new instance of the
        /// ManagedInstanceLongTermRetentionPolicy class.
        /// </summary>
        public ManagedInstanceLongTermRetentionPolicy()
        {
            CustomInit();
        }

        /// <summary>
        /// Initializes a new instance of the
        /// ManagedInstanceLongTermRetentionPolicy class.
        /// </summary>
        /// <param name="id">Resource ID.</param>
        /// <param name="name">Resource name.</param>
        /// <param name="type">Resource type.</param>
        /// <param name="weeklyRetention">The weekly retention policy for an
        /// LTR backup in an ISO 8601 format.</param>
        /// <param name="monthlyRetention">The monthly retention policy for an
        /// LTR backup in an ISO 8601 format.</param>
        /// <param name="yearlyRetention">The yearly retention policy for an
        /// LTR backup in an ISO 8601 format.</param>
        /// <param name="weekOfYear">The week of year to take the yearly backup
        /// in an ISO 8601 format.</param>
        public ManagedInstanceLongTermRetentionPolicy(string id = default(string), string name = default(string), string type = default(string), string weeklyRetention = default(string), string monthlyRetention = default(string), string yearlyRetention = default(string), int? weekOfYear = default(int?))
            : base(id, name, type)
        {
            WeeklyRetention = weeklyRetention;
            MonthlyRetention = monthlyRetention;
            YearlyRetention = yearlyRetention;
            WeekOfYear = weekOfYear;
            CustomInit();
        }

        /// <summary>
        /// An initialization method that performs custom operations like setting defaults
        /// </summary>
        partial void CustomInit();

        /// <summary>
        /// Gets or sets the weekly retention policy for an LTR backup in an
        /// ISO 8601 format.
        /// </summary>
        [JsonProperty(PropertyName = "properties.weeklyRetention")]
        public string WeeklyRetention { get; set; }

        /// <summary>
        /// Gets or sets the monthly retention policy for an LTR backup in an
        /// ISO 8601 format.
        /// </summary>
        [JsonProperty(PropertyName = "properties.monthlyRetention")]
        public string MonthlyRetention { get; set; }

        /// <summary>
        /// Gets or sets the yearly retention policy for an LTR backup in an
        /// ISO 8601 format.
        /// </summary>
        [JsonProperty(PropertyName = "properties.yearlyRetention")]
        public string YearlyRetention { get; set; }

        /// <summary>
        /// Gets or sets the week of year to take the yearly backup in an ISO
        /// 8601 format.
        /// </summary>
        [JsonProperty(PropertyName = "properties.weekOfYear")]
        public int? WeekOfYear { get; set; }

    }
}


text:
package net.daergoth.homewire;

import com.vaadin.annotations.Theme;
import com.vaadin.navigator.View;
import com.vaadin.navigator.ViewDisplay;
import com.vaadin.server.VaadinRequest;
import com.vaadin.spring.annotation.SpringUI;
import com.vaadin.spring.annotation.SpringViewDisplay;
import com.vaadin.ui.Component;
import com.vaadin.ui.UI;
import com.vaadin.ui.VerticalLayout;
import net.daergoth.homewire.controlpanel.ControlPanelView;
import net.daergoth.homewire.flow.FlowView;
import net.daergoth.homewire.home.HomeView;
import net.daergoth.homewire.setup.SetupView;
import net.daergoth.homewire.statistic.StatisticView;
import org.vaadin.teemusa.sidemenu.SideMenu;
import org.vaadin.teemusa.sidemenu.SideMenuUI;

@Theme("homewire")
@SpringUI
@SideMenuUI
@SpringViewDisplay
public class BaseUI extends UI implements ViewDisplay {

  private VerticalLayout springViewDisplay;

  @Override
  protected void init(VaadinRequest request) {
    SideMenu menu = new SideMenu();
    menu.setMenuCaption("HomeWire");
    menu.addMenuItem("Home", () -> {
      getUI().getNavigator().navigateTo(HomeView.VIEW_NAME);
    });
    menu.addMenuItem("Control Panel", () -> {
      getUI().getNavigator().navigateTo(ControlPanelView.VIEW_NAME);
    });
    menu.addMenuItem("Flows", () -> {
      getUI().getNavigator().navigateTo(FlowView.VIEW_NAME);
    });
    menu.addMenuItem("Statistics", () -> {
      getUI().getNavigator().navigateTo(StatisticView.VIEW_NAME);
    });
    menu.addMenuItem("Setup", () -> {
      getUI().getNavigator().navigateTo(SetupView.VIEW_NAME);
    });
    setContent(menu);

    springViewDisplay = new VerticalLayout();
    springViewDisplay.setSizeFull();
    springViewDisplay.setMargin(true);
    springViewDisplay.setSpacing(true);

    menu.setContent(springViewDisplay);

  }

  @Override
  public void showView(View view) {
    springViewDisplay.removeAllComponents();
    springViewDisplay.addComponent((Component) view);
  }

}

redpajama_set_name: RedPajamaGithub


text:
layout: default
title: Conference Panels
permalink: /panels-list/
image: union-chairs-header.jpg
modal: all
---

{% include top-section.html %}

{% include panel-lists.html %}

{% include partners.html %}


text:
<?php

namespace SMW\Tests\Maintenance;

use SMW\Maintenance\ConceptCacheRebuilder;
use SMW\DIConcept;

/**
 * @covers \SMW\Maintenance\ConceptCacheRebuilder
 * @group semantic-mediawiki
 *
 * @license GNU GPL v2+
 * @since 1.9.2
 *
 * @author mwjames
 */
class ConceptCacheRebuilderTest extends \PHPUnit_Framework_TestCase {

	public function testCanConstruct() {

		$store = $this->getMockForAbstractClass( '\SMW\Store' );

		$settings = $this->getMockBuilder( '\SMW\Settings' )
			->disableOriginalConstructor()
			->getMock();

		$this->assertInstanceOf(
			'\SMW\Maintenance\ConceptCacheRebuilder',
			new ConceptCacheRebuilder( $store, $settings )
		);
	}

	/**
	 * @depends testCanConstruct
	 */
	public function testRebuildWithoutOptionsAndActions() {

		$store = $this->getMockForAbstractClass( '\SMW\Store' );

		$settings = $this->getMockBuilder( '\SMW\Settings' )
			->disableOriginalConstructor()
			->getMock();

		$instance = new ConceptCacheRebuilder(
			$store,
			$settings
		);

		$this->assertFalse( $instance->rebuild() );
	}

	/**
	 * @dataProvider actionProvider
	 */
	public function testRebuildFullConceptWithoutRangeSelectionOnMockStore( $action ) {

		$concept = new DIConcept( 'Foo', '', '', '', '' );

		$concept->setCacheStatus( 'full' );
		$concept->setCacheDate( '1358515326' );
		$concept->setCacheCount( '1000' );

		$instance = $this->acquireInstanceFor( $concept );

		$instance->setParameters( array(
			$action => true
		) );

		$this->assertTrue( $instance->rebuild() );
	}

	/**
	 * @dataProvider actionProvider
	 */
	public function testRebuildEmptyConceptWithoutRangeSelectionOnMockStore( $action ) {

		$concept = new DIConcept( 'Foo', '', '', '', '' );
		$concept->setCacheStatus( 'empty' );

		$instance = $this->acquireInstanceFor( $concept );

		$instance->setParameters( array(
			$action => true
		) );

		$this->assertTrue( $instance->rebuild() );
	}

	/**
	 * @dataProvider actionProvider
	 */
	public function testRebuildFullConceptWithRangeSelectionOnMockStore( $action ) {

		$concept = new DIConcept( 'Foo', '', '', '', '' );

		$concept->setCacheStatus( 'full' );
		$concept->setCacheDate( '1358515326' );
		$concept->setCacheCount( '1000' );

		$instance = $this->acquireInstanceFor( $concept );

		$instance->setParameters( array(
			$action => true,
			's'     => 0,
			'e'     => 90000
		) );

		$this->assertTrue( $instance->rebuild() );
	}

	/**
	 * @dataProvider actionProvider
	 */
	public function testRebuildSingleEmptyConceptWithRangeSelectionOnMockStore( $action ) {

		$concept = new DIConcept( 'Foo', '', '', '', '' );
		$concept->setCacheStatus( 'empty' );

		$instance = $this->acquireInstanceFor( $concept );

		$instance->setParameters( array(
			$action => true,
			's'     => 0,
			'e'     => 90000
		) );

		$this->assertTrue( $instance->rebuild() );
	}

	/**
	 * @dataProvider actionProvider
	 */
	public function testRebuildSingleFullConceptOnMockStore( $action ) {

		$concept = new DIConcept( 'Foo', '', '', '', '' );

		$concept->setCacheStatus( 'full' );
		$concept->setCacheDate( '1358515326' );
		$concept->setCacheCount( '1000' );

		$instance = $this->acquireInstanceFor( $concept );

		$instance->setParameters( array(
			$action   => true,
			'old'     => 10,
			'concept' => 'Bar'
		) );

		$this->assertTrue( $instance->rebuild() );
	}

	/**
	 * @dataProvider actionProvider
	 */
	public function testRebuildWithNullConceptOnMockStore( $action ) {

		$instance = $this->acquireInstanceFor( null );

		$instance->setParameters( array(
			$action   => true,
			'concept' => 'Bar'
		) );

		$this->assertTrue( $instance->rebuild() );
	}

	private function acquireInstanceFor( $concept = null ) {

		$expectedToRun = $concept !== null ? $this->any() : $this->never();
		$refreshConceptCacheReturn = $concept !== null ? $concept->getConceptQuery() : null;

		$row = new \stdClass;
		$row->page_namespace = 0;
		$row->page_title = 1;

		$database = $this->getMockBuilder( '\SMW\MediaWiki\Database' )
			->disableOriginalConstructor()
			->getMock();

		$database->expects( $expectedToRun )
			->method( 'select' )
			->will( $this->returnValue( array( $row ) ) );

		$store = $this->getMockBuilder( 'SMWSQLStore3' )
			->disableOriginalConstructor()
			->getMock();

		$store->expects( $this->once() )
			->method( 'getConceptCacheStatus' )
			->will( $this->returnValue( $concept ) );

		$store->expects( $expectedToRun )
			->method( 'refreshConceptCache' )
			->will( $this->returnValue( array( $refreshConceptCacheReturn ) ) );

		$store->expects( $expectedToRun )
			->method( 'getConnection' )
			->will( $this->returnValue( $database ) );

		$settings = $this->getMockBuilder( '\SMW\Settings' )
			->disableOriginalConstructor()
			->getMock();

		$instance = new ConceptCacheRebuilder(
			$store,
			$settings
		);

		$instance->setParameters( array(
			'quiet' => true,
		) );

		return $instance;
	}

	public function actionProvider() {
		return array(
			array( 'status' ),
			array( 'create' ),
			array( 'delete' )
		);
	}

}


text:
Constructor de autómatas finitos no deterministas

Para usarlo solo hay que:

* Descargar el ZIP
* Abrir index.html
* Agregar un automata desde un .txt o directo en el primer textarea
* Pulsar "Extraer"
* Listo, ya está el automata cargado y se pueden validar las palabras con ese autómata, al igual que editar el formulario y el 2do textarea para agregar/quitar/modificar transiciones, estados, etc.. y los cambios se verán reflejados en tiempo real.

https://developer.mozilla.org/es/docs/Web/JavaScript/Introducci%C3%B3n_a_JavaScript_orientado_a_objetos


text:
<?php

namespace PhpConsole;

class Auth {

	const PASSWORD_HASH_SALT = 'NeverChangeIt:)';

	protected $publicKeyByIp;
	protected $passwordHash;

	/**
	 * @param string $password Common password for all clients
	 * @param bool $publicKeyByIp Set public key depending on client IP
	 */
	public function __construct($password, $publicKeyByIp = true) {
		$this->publicKeyByIp = $publicKeyByIp;
		$this->passwordHash = $this->getPasswordHash($password);
	}

	protected final function hash($string) {
		return hash('sha256', $string);
	}

	/**
	 * Get password hash like on client
	 * @param $password
	 * @return string
	 */
	protected final function getPasswordHash($password) {
		return $this->hash($password . self::PASSWORD_HASH_SALT);
	}

	/**
	 * Get authorization result data for client
	 * @param ClientAuth|null $clientAuth
	 * @return ServerAuthStatus
	 */
	public final function getServerAuthStatus(ClientAuth $clientAuth = null) {
		$serverAuthStatus = new ServerAuthStatus();
		$serverAuthStatus->publicKey = $this->getPublicKey();
		$serverAuthStatus->isSuccess = $clientAuth && $this->isValidAuth($clientAuth);
		return $serverAuthStatus;
	}

	/**
	 * Check if client authorization data is valid
	 * @param ClientAuth $clientAuth
	 * @return bool
	 */
	public final function isValidAuth(ClientAuth $clientAuth) {
		return $clientAuth->publicKey === $this->getPublicKey() && $clientAuth->token === $this->getToken();
	}

	/**
	 * Get client unique identification
	 * @return string
	 */
	protected function getClientUid() {
		$clientUid = '';
		if($this->publicKeyByIp) {
			if(isset($_SERVER['REMOTE_ADDR'])) {
				$clientUid .= $_SERVER['REMOTE_ADDR'];
			}
			if(isset($_SERVER['HTTP_X_FORWARDED_FOR'])) {
				$clientUid .= $_SERVER['HTTP_X_FORWARDED_FOR'];
			}
		}
		return $clientUid;
	}

	/**
	 * Get authorization session public key for current client
	 * @return string
	 */
	protected function getPublicKey() {
		return $this->hash($this->getClientUid() . $this->passwordHash);
	}

	/**
	 * Get string signature for current password & public key
	 * @param $string
	 * @return string
	 */
	public final function getSignature($string) {
		return $this->hash($this->passwordHash . $this->getPublicKey() . $string);
	}

	/**
	 * Get expected valid client authorization token
	 * @return string
	 */
	private final function getToken() {
		return $this->hash($this->passwordHash . $this->getPublicKey());
	}
}


text:
/**
* Author: Sanhu Li
* Date & Time: 01/30/2015 01:57
* Description: Compiler assignment 1
*/
#include <string.h>
#include "SymTab.h"
#include "stdlib.h"

/**
* The hash function I use to make less collisions.
*
* Try to add up all the ASCII value of the chars in input
*/
unsigned int hash(const char *input) {
    unsigned int sum = 0;
    int i, len = (int) strlen(input);

    for (i = 0; i < len; ++i) {
        sum += input[i];
    }

    return sum;
}

struct SymTab *CreateSymTab(int Size) {
    struct SymTab *symTab;
    int i;

    if (Size < 0) {
        return NULL;
    }

    symTab = malloc(sizeof(struct SymTab));
    symTab->Size = Size;
    symTab->Contents = malloc(Size * sizeof(struct SymEntry *));

    for (i = 0; i < Size - 1; ++i) {
        symTab->Contents[i] = NULL;
    }

    return symTab;
}

void DestroySymTab(struct SymTab *ATable) {
    struct SymEntry *entry, *tmp;

    if (ATable == NULL) {
        return;
    }

    entry = FirstEntry(ATable);

    while (entry != NULL) {
        tmp = entry;
        entry = NextEntry(ATable, entry);
        free(tmp->Name);
//        Do not free the Attributes, because it may not be initialize yet
//        and the space may not be able to be freed
//        free(tmp->Attributes);
        free(tmp);
    }

    free(ATable->Contents);
    free(ATable);
}

bool EnterName(struct SymTab *ATable, const char *Name, struct SymEntry **AnEntry) {
    int index, size;
    struct SymEntry *tmp;
    //  Find the Entry with the Name:
    struct SymEntry *entry;

    if (ATable == NULL || Name == NULL || AnEntry == NULL) {
        return false;
    }

    size = ATable->Size;
    entry = FindName(ATable, Name);

    //      if found:
    //          return a pointer to the Entry as AnEntry parameter
    //          return false
    if (entry != NULL) {
        *AnEntry = entry;
        return false;
    }

    //      if not found:
    //          Get the hash of the Name to find the position of the bucket
    //          Create a new Entry
    //          Put the Entry in the first position
    //          return true
    index = hash(Name) % size;
    *AnEntry = malloc(sizeof(struct SymEntry));
    (*AnEntry)->Name = strdup(Name);
    (*AnEntry)->Attributes = NULL;
    tmp = ATable->Contents[index];
    ATable->Contents[index] = *AnEntry;
    (*AnEntry)->Next = tmp;
    return true;
}

struct SymEntry *FindName(struct SymTab *ATable, const char *Name) {
    //  Compute the hash for Name to get the index of the bucket
    int index = hash(Name) % ATable->Size;

    //  Go to that linked list and try to find an Entry with the name
    struct SymEntry *list = ATable->Contents[index];

    //  if no elements in the hash bucket
    if (list == NULL) {
        return false;
    }

    while (list != NULL) {
        //  found it
        if (!strcmp(list->Name, Name)) {
            return list;
        }
        list = list->Next;
    }
    //  if not found
    return NULL;
}

void SetAttr(struct SymEntry *AnEntry, void *Attributes) {
    AnEntry->Attributes = Attributes;
}

void *GetAttr(struct SymEntry *AnEntry) {
    return AnEntry->Attributes;
}

const char *GetName(struct SymEntry *AnEntry) {
    return AnEntry->Name;
}

struct SymEntry *FirstEntry(struct SymTab *ATable) {
    int i, size = ATable->Size;
    struct SymEntry *entry = NULL;

    if (size <= 0) {
        return NULL;
    }

    //  Search the SymTab to find the first element
    for (i = 0; i < size; ++i) {
        entry = ATable->Contents[i];
        if (entry != NULL) {
            return entry;
        }
    }
    return entry;
}

struct SymEntry *NextEntry(struct SymTab *ATable, struct SymEntry *AnEntry) {
    const char *Name = AnEntry->Name;
    int index, size;
    //  Try to find the Entry in the SymTab
    struct SymEntry *entry = FindName(ATable, Name);
    if (entry == NULL) {
        return NULL;
    }

    if (entry->Next != NULL) {
        return entry->Next;
    }

    //  Get the index of the bucket
    size = ATable->Size;
    index = hash(Name) % size;
    while (++index < size) {
        if (ATable->Contents[index] != NULL) {
            return ATable->Contents[index];
        }
    }
    return NULL;
}


text:
package me.ci.BasicMatch;

import org.bukkit.ChatColor;
import org.bukkit.Material;
import org.bukkit.inventory.ItemStack;

public class FlagMarker extends Marker{
	private final ItemStack red;
	private final ItemStack blue;
	private final ItemStack neutral;
	public FlagMarker(String name, String simpleName, boolean doubleCenter, boolean block){
		super(name, simpleName, null, doubleCenter, block);
		red = new ItemStack(Material.WOOL, 1, (short)14);
		blue = new ItemStack(Material.WOOL, 1, (short)9);
		neutral = new ItemStack(Material.WOOL, 1, (short)0);
	}
	@Override
	public ItemStack getArmorStandHelmet(){
		if(getName().startsWith(ChatColor.RED.toString()))
			return red;
		if(getName().startsWith(ChatColor.BLUE.toString()))
			return blue;
		return neutral;
	}
}


text:
var browser = require('file-manager-js');

module.exports = function (app, isLoggedIn) {
  app.all('/browser/browse', isLoggedIn, browser.browse)
  app.post('/uploader/upload', isLoggedIn, browser.upload)
}


text:
from __future__ import unicode_literals

from django.db import migrations, models

class Migration(migrations.Migration):

    dependencies = [
        ('logger', '0002_auto_20161231_1740'),
    ]

    operations = [
        migrations.AddField(
            model_name='requestlogger',
            name='sha1',
            field=models.CharField(blank=True, default=None, max_length=40, null=True, verbose_name='SHA1'),
        ),
    ]


text:
package br.com.semanalixozero.app;

import android.util.Log;
import com.crashlytics.android.Crashlytics;
import timber.log.Timber;

/**
 * @author Filipe Bezerra
 */
class ReleaseTree extends Timber.Tree {

    private static final int MAX_LOG_LENGTH = 4000;

    @Override protected boolean isLoggable(final String tag, final int priority) {
        return !(priority == Log.VERBOSE || priority == Log.DEBUG || priority == Log.INFO);
    }

    @Override protected void log(
            final int priority, final String tag, final String message, final Throwable t) {
        if (isLoggable(tag, priority)) {
            if (priority == Log.ERROR && t != null) {
                Crashlytics.logException(t);
            }

            if (message.length() < MAX_LOG_LENGTH) {
                if (priority == Log.ASSERT) {
                    Log.wtf(tag, message);
                } else {
                    Log.println(priority, tag, message);
                }
                return;
            }

            // Split by line, then ensure each line can fit into Log's maximum length.
            for (int i = 0, length = message.length(); i < length; i++) {
                int newline = message.indexOf('\n', i);
                newline = newline != -1 ? newline : length;
                do {
                    int end = Math.min(newline, i + MAX_LOG_LENGTH);
                    String part = message.substring(i, end);
                    if (priority == Log.ASSERT) {
                        Log.wtf(tag, part);
                    } else {
                        Log.println(priority, tag, part);
                    }
                    i = end;
                } while (i < newline);
            }
        }
    }
}


text:
package com.qoomon.banking.swift.bcsmessage;

/**
 * Created by qoomon on 03/08/16.
 */
public class BCSMessageParseException extends Exception {

    public BCSMessageParseException(String message) {
        super(message);
    }
}


text:
@implementation ImagePerform

+ (instancetype)sharedImagePerform
{
    static ImagePerform *s_imagePerform = nil;
    static dispatch_once_t onceToken;
    dispatch_once(&onceToken, ^{
        s_imagePerform = [ImagePerform new];
    });

    return s_imagePerform;
}

- (BOOL)saveWithName:(NSString *)imageName image:(UIImage *)image
{
    NSArray * paths = NSSearchPathForDirectoriesInDomains(NSLibraryDirectory, NSUserDomainMask, YES);
    NSString * path = [paths objectAtIndex:0];
    path = [path stringByAppendingPathComponent:kImageFolderName];
    [[NSFileManager defaultManager] createDirectoryAtPath:path withIntermediateDirectories:YES attributes:nil error:nil];
    NSString * imagePath = [path stringByAppendingPathComponent:imageName];
    [UIImagePNGRepresentation(image) writeToFile:imagePath atomically:YES];

    return YES;

}

- (UIImage *)loadWithName:(NSString *)imageName
{
    UIImage *image = [UIImage imageNamed:imageName];
    if (image != nil)
    {
        return image;
    }

    NSArray * paths = NSSearchPathForDirectoriesInDomains(NSLibraryDirectory, NSUserDomainMask, YES);
    NSString * path = [paths objectAtIndex:0];
    path = [path stringByAppendingPathComponent:kImageFolderName];
    NSString * imagePath = [path stringByAppendingPathComponent:imageName];
    if ([[NSFileManager defaultManager] fileExistsAtPath:imagePath] == NO)
    {
        return nil;
    }

    NSData * data = [[NSFileManager defaultManager] contentsAtPath:imagePath];
    return [UIImage imageWithData:data];
}

@end


text:
type: post100
title:  Change API
categories: XAP100NET
weight: 400
parent: the-gigaspace-interface-overview.html
---

The `ISpaceProxy.Change` and the `ChangeSet` allows updating existing objects in Space, by specifying only the required change instead of passing the entire updated object.

<br>

{{%fpanel%}}

[Overview](./change-api.html){{<wbr>}}
Change API overview.

[Advanced Change Options](./change-api-advanced.html){{<wbr>}}
Obtaining Change detailed results.

{{%/fpanel%}}


text:
package logger

import (
	"bytes"
	"fmt"
	"strings"

	"github.com/Sirupsen/logrus"
)

// StdOutFormatter formats log messages from the router component.
type StdOutFormatter struct {
}

// Format rewrites a log entry for stdout as a byte array.
func (f *StdOutFormatter) Format(entry *logrus.Entry) ([]byte, error) {
	b := &bytes.Buffer{}
	fmt.Fprintf(b, "[%s] - %s\n", strings.ToUpper(entry.Level.String()), entry.Message)
	return b.Bytes(), nil
}


text:
require 'open3'

module QA
  module Service
    module Shellout
      CommandError = Class.new(StandardError)

      module_function

      ##
      # TODO, make it possible to use generic QA framework classes
      # as a library - gitlab-org/gitlab-qa#94
      #
      def shell(command)
        puts "Executing `#{command}`"

        Open3.popen2e(*command) do |_in, out, wait|
          out.each { |line| puts line }

          if wait.value.exited? && wait.value.exitstatus.nonzero?
            raise CommandError, "Command `#{command}` failed!"
          end
        end
      end
    end
  end
end


text:
#ifndef FOURIERDESCRIPTOR_H
#define FOURIERDESCRIPTOR_H

#include <fstream>
#include <iostream>

#include "opencv2/highgui/highgui.hpp"
#include <opencv2/opencv.hpp>

using namespace std;
using namespace cv;

/**
 * @brief The FourierDescriptor class computes the fourier descriptor of a hand and matches it with a class of a dictionary
 *
 *
 The class implements several distance metrics (L2 norm,L1 norm and canberra) that can be used in order to know the distance from a query binary mask to a dictionary class.

 */
class FourierDescriptor
{
public:
    FourierDescriptor();
    FourierDescriptor(const string &fileName);
    void loadDictionary(const string &fileName);
    int findMatchInDictionary(vector<Point2i> &boundary, string &distMetric, double &distance, int numFDtoUse=0, int newBoundaryLength=64);
    void calcCentroidDistFD(vector<Point2i> &boundary, int numFD, Mat &dst, int newBoundaryLength=64);
    int findMatchInDictionary(Mat &testFD, string &distMetric, double &distance );
    ~FourierDescriptor();

private:
    int sizeDict,numFDdict;
    Mat *FDdict;
    vector<int> dictClass;

};

#endif // FOURIERDESCRIPTOR_H


text:
using System;
using Shouldly.Tests.Strings;
using Xunit;

namespace Shouldly.Tests.ShouldBe.WithTolerance
{
    public class DoubleScenario
    {
        [Fact]
        public void DoubleScenarioShouldFail()
        {
            const double pi = Math.PI;
            Verify.ShouldFail(() =>
pi.ShouldBe(3.24d, 0.01d, "Some additional context"),

errorWithSource:
@"pi
    should be within
0.01d
    of
3.24d
    but was
3.14159265358979d

Additional Info:
    Some additional context",

    errorWithoutSource:
@"3.14159265358979d
    should be within
0.01d
    of
3.24d
    but was not

Additional Info:
    Some additional context");
        }

        [Fact]
        public void ShouldPass()
        {
            const double pi = Math.PI;
            pi.ShouldBe(3.14d, 0.01d);
        }
    }
}


text:
/***
* Inferno Engine v4 2015-2017
* Written by Tomasz "Rex Dex" Jonarski
*
* [#filter: platform #]
***/

#pragma once

//-----------------------------------------------------------------------------

#include <stdlib.h>
#include <stdarg.h>
#include <stddef.h>
#include <stdint.h>
#include <utility>
#include <cwctype>
#include <clocale>
#include <numeric>
#include <unordered_set>

//-----------------------------------------------------------------------------

// System headers
#if defined(_WIN64)

    // Define the more universal macro
    #define PLATFORM_X64
    #define PLATFORM_64BIT
    #define PLATFORM_WINDOWS
    #define PLATFORM_LITTLEENDIAN
    #define PLATFORM_MSVC
    #define PLATFORM_NAME "pc"
    #define PLATFORM_WINAPI

#elif defined(_WIN32)

    // Define the more universal macro
    #define PLATFORM_X86
    #define PLATFORM_WIN32
    #define PLATFORM_32BIT
    #define PLATFORM_WINDOWS
    #define PLATFORM_LITTLEENDIAN
    #define PLATFORM_MSVC
    #define PLATFORM_NAME "pc"
    #define PLATFORM_WINAPI

#elif defined(__linux__)

    #define PLATFORM_NAME "linux"
    #define PLATFORM_LINUX
    #define PLATFORM_POSIX
    #define PLATFORM_LITTLEENDIAN

    #if defined (__clang__)
        #define PLATFORM_CLANG
    #elif defined(__GNUC__)
        #define PLATFORM_GCC
    #else
        #error "Unrecognized compiler (not a gcc or clang)"
    #endif

    #define _MSC_FULL_VER 0

    #define strcpy_s strcpy
    #define strcat_s strcat
    #define vsprintf_s vsprintf
    #define _strnicmp strncasecmp

    // detect CPU platform
    #if defined(__i386__)
        #define PLATFORM_X86
        #define PLATFORM_32BIT
    #elif defined(__amd64__)
        #define PLATFORM_X64
        #define PLATFORM_64BIT
    #elif defined(__arm__)
        #define PLATFORM_ARM
        #define PLATFORM_32BIT
    #else
        #error "Unrecognized CPU platform"
    #endif

    #include <unistd.h>

#else

    // Unknown platform
    #error "Please define platform crap"

#endif

// Sizes
#ifdef PLATFORM_32BIT

    // Maximum reasonable sizes for IO and memory operations
    #define MAX_IO_SIZE (512ULL << 20)
    #define MAX_MEM_SIZE (512ULL << 20)
    #define MAX_SIZE_T (~(size_t)0U)

#elif defined(PLATFORM_64BIT)

    // Maximum reasonable sizes for IO and memory operations
    #define MAX_IO_SIZE (4ULL << 30)
    #define MAX_MEM_SIZE (64ULL << 30)
    #define MAX_SIZE_T (~(size_t)0ULL)

#endif

// CPU specific shit
#if defined(__i386__) || defined(__amd64__) || defined(_M_AMD64) || defined(_M_IX86)

    // MSVC bull
    #ifdef PLATFORM_MSVC
        #include <intrin.h>
    #endif

    // SSE
    #if defined(__SSE__) || (defined(_M_IX86_FP) && (_M_IX86_FP >= 1)) || defined(_M_AMD64)
        #define PLATFORM_SSE
        #include <xmmintrin.h>
    #endif

    // SSE2
    #if defined(__SSE2__) || (defined(_M_IX86_FP) && (_M_IX86_FP >= 2)) || defined(_M_AMD64)
        #define PLATFORM_SSE2
        #include <emmintrin.h>
    #endif

    // SSE3
    #if defined(__SSE3__) || (defined(_M_IX86_FP) && (_M_IX86_FP >= 2)) || defined(_M_AMD64)
        #define PLATFORM_SSE3
        #include <pmmintrin.h>
    #endif

    // SSE4
    #if defined(__SSE4_1__) || (defined(_M_IX86_FP) && (_M_IX86_FP >= 2)) || defined(_M_AMD64)
        #define PLATFORM_SSE41
        #include <smmintrin.h>
    #endif

    // SSE specific macros
    #define _MM_SHUFFLE_REV(x,y,z,w) _MM_SHUFFLE(w,z,y,x)

#endif

// Disable some warnings under MSVC
#ifdef PLATFORM_MSVC

    // Disable some more anoying level 4 Warnings
    #pragma warning ( disable: 4100 ) // unused function parameter
    #pragma warning ( disable: 4127 ) // conditional expression is constant
    #pragma warning ( disable: 4189 ) // local variable is initialized but not referenced
    #pragma warning ( disable: 4714 ) // function '' marked as __forceinline not inlined
    #pragma warning ( disable: 4324 ) // '' : structure was padded due to __declspec(align())
    #pragma warning ( disable: 4985 ) // attributes not present on previous declaration.
    #pragma warning ( disable: 4275 ) // dll linkage inconsistency
    #pragma warning ( disable: 4251 ) // dll interface
    #pragma warning ( disable: 4530 ) //  C++ exception handler used, but unwind semantics are not enabled.Specify / EHsc
    #pragma warning ( disable: 4091 ) // 'typedef ' : ignored on left of '' when no variable is declared
    #pragma warning ( disable: 4505 ) // unreferenced local function has been removed
    #pragma warning ( disable: 4200 ) // nonstandard extension used : zero - sized array in struct / union
    #pragma warning ( disable: 4359 ) // '' : Alignment specifier is less than actual alignment(4), and will be ignored.
	#pragma warning ( disable: 4624 ) // destructor was implicitly defined as deleted
	#pragma warning ( disable: 4389 ) // '==' : signed / unsigned mismatch
	#pragma warning ( disable: 4018 ) //  '<' : signed / unsigned mismatch
	#pragma warning ( disable: 4244 ) // anoying MS shit
	#pragma warning ( disable: 4267 ) //  'argument' : conversion from 'size_t' to 'const Uint32', possible loss of data
	#pragma warning ( disable: 4201 ) //: nonstandard extension used : nameless struct / union

    #define TYPE_ALIGN_GLUE(x) x
    #define TYPE_ALIGN(x,y) __declspec(align( x )) TYPE_ALIGN_GLUE(y)
    #define TYPE_TLS __declspec(thread)

#ifdef PLATFORM_64BIT
    #define TYPE_UNALIGNED __unaligned
#else
    #define TYPE_UNALIGNED
#endif

    #define INLINE inline
    #define FORCEINLINE __forceinline

    #define BYTESWAP_16(x) _byteswap_ushort(x)
    #define BYTESWAP_32(x) _byteswap_ulong(x)
    #define BYTESWAP_64(x) _byteswap_uin64(x)

    #define SPRINTF_S(buf, size, ...) sprintf_s(buf, size, __VA_ARGS__ )

#elif defined(PLATFORM_GCC)

    #define TYPE_ALIGN(x, type) type alignas(x)
    #define TYPE_TLS __thread
    #define TYPE_UNALIGNED

    #define INLINE inline
    //#define FORCEINLINE __attribute__((always_inline)) inline
    #define FORCEINLINE inline

    #define BYTESWAP_16(x) (Uint16)__builtin_bswap16((Uint16)x)
    #define BYTESWAP_32(x) (Uint32)__builtin_bswap32((Uint32)x)
    #define BYTESWAP_64(x) (Uint64)__builtin_bswap64((Uint64)x)

    #define SPRINTF_S(buf, size, ...) sprintf(buf, __VA_ARGS__)
    #define _stricmp strcasecmp
    #define strncpy_s strncpy
    #define strcpy_s strcpy

#elif defined(PLATFORM_CLANG)

    #define TYPE_ALIGN(x, type) type alignas(x)
    #define TYPE_TLS __thread
    #define TYPE_UNALIGNED

    #define INLINE inline
    #define FORCEINLINE inline

    #define BYTESWAP_16(x) (Uint16)__builtin_bswap16((Uint16)x)
    #define BYTESWAP_32(x) (Uint32)__builtin_bswap32((Uint32)x)
    #define BYTESWAP_64(x) (Uint64)__builtin_bswap64((Uint64)x)

    #define SPRINTF_S(buf, size, ...) sprintf(buf, __VA_ARGS__)
    #define _stricmp strcasecmp
    #define strncpy_s strncpy
    #define strcpy_s strcpy

#else

    #error "Unsupported compiler"

#endif

#define CAN_YIELD

#define VA_ARGS(...) , ##__VA_ARGS__

// TODO: Move this to build system
// TODO: Disables IPv6 and high datagram bandwidth tests on Travis CI
#if defined(PLATFORM_LINUX)
    #define FUCKED_UP_NETSTACK
#elif defined(PLATFORM_WINDOWS)
    #define BUILD_WITH_DEVTOOLS
    //#define BUILD_WITH_GAME
#endif

// magic
#define memzero(ptr, size) memset(ptr, 0, size)

namespace std {

    template<typename T>
    void hash_combine(std::size_t &seed, T const &key) {
        std::hash<T> hasher;
        seed ^= hasher(key) + 0x9e3779b9 + (seed << 6) + (seed >> 2);
    }

    template<typename T1, typename T2>
    struct hash<std::pair<T1, T2>> {
        std::size_t operator()(std::pair<T1, T2> const &p) const {
            std::size_t seed1(0);
            hash_combine(seed1, p.first);
            hash_combine(seed1, p.second);
            return seed1;
        }
    };
}


text:
var operation_names = require('./operation_names');
var Chain = require('./chain');
var operation_packager = require('./operation_packager');
var contextUtils = require('./chain_context');
var utils = require('./utils');

var WrappedTypedArray = function (source, parts, globalContext) {
  this.source = source;
  this.parts = parts;
  this.globalContext = globalContext;
};

WrappedTypedArray.prototype.map = function(mapper, context) {
  return this.__operation(operation_names.MAP, mapper, context);
};

WrappedTypedArray.prototype.filter = function(predicate, context) {
  return this.__operation(operation_names.FILTER, predicate, context);
};

WrappedTypedArray.prototype.reduce = function(reducer, seed, identityReducer, identity, context) {
  if (!utils.isFunction(identityReducer)) {
    context = identity;
    identity = identityReducer;
    identityReducer = reducer;
  }
  return this.__operation(operation_names.REDUCE, reducer, context, seed, identity, identityReducer);
};

WrappedTypedArray.prototype.__operation = function(name, code, localContext, seed, identity, identityCode) {
  var operation = operation_packager(name, code, seed, identity, identityCode);
  var chainContext = contextUtils.extendChainContext(0, localContext);
  var options = {
    source: this.source,
    parts: this.parts,
    operation: operation,
    globalContext: this.globalContext,
    chainContext: chainContext
  };
  return new Chain(options);
};

module.exports = WrappedTypedArray;


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

    <LinearLayout
        android:layout_width="match_parent"
        android:layout_height="wrap_content"
        android:layout_gravity="center_vertical"
        android:orientation="vertical"
        android:paddingLeft="16dp"
        android:paddingRight="16dp">

        <TextView
            android:id="@+id/title"
            android:layout_width="match_parent"
            android:layout_height="wrap_content"
            android:text="title"
            android:textColor="@color/text_color_black"
            android:textStyle="bold"
            />

        <TextView
            android:id="@+id/sub_title"
            android:layout_width="match_parent"
            android:layout_height="wrap_content"
            android:layout_marginTop="4dp"
            android:text="sub title"
            android:textColor="@color/text_color_grey"
            android:textSize="12dp"/>
    </LinearLayout>

    <ImageView
        android:id="@+id/indicator"
        android:layout_width="wrap_content"
        android:layout_height="wrap_content"
        android:layout_gravity="center_vertical|right"
        android:layout_marginRight="16dp"
        android:src="@mipmap/ic_switch_on"/>

    <View
        android:layout_width="match_parent"
        android:layout_height="1px"
        android:layout_gravity="bottom"
        android:background="@color/divider"/>
</merge>


text:
@implementation iosVC
- (id)init
{
    self = [super init];
    if (self) {
    }
    return self;
}

-(void)reloadData{

}

- (int)getBannerHeight:(UIDeviceOrientation)orientation {
    if (UIInterfaceOrientationIsLandscape(orientation)) {
        return 32;
    } else {
        return 50;
    }
}

- (int)getBannerHeight {
    return [self getBannerHeight:[UIDevice currentDevice].orientation];
}

@end


text:
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

    <meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
    <title>Db::get_byteswapped()</title>
    <link rel="stylesheet" href="apiReference.css" type="text/css" />
    <meta name="generator" content="DocBook XSL Stylesheets V1.73.2" />
    <link rel="start" href="index.html" title="Berkeley DB C++ API Reference" />
    <link rel="up" href="db.html" title="Chapter 2.  The Db Handle" />
    <link rel="prev" href="dbget_bt_minkey.html" title="Db::get_bt_minkey()" />
    <link rel="next" href="dbget_cachesize.html" title="Db::get_cachesize()" />

          Db::get_byteswapped()

          Prev
          Chapter 2.
                The Db Handle

           Next

Db::get_byteswapped()

#include <db_cxx.h>

int
Db::get_byteswapped(int *isswapped);

        The Db::get_byteswapped() method returns
        whether the underlying database
        files were created on an architecture of the same byte order as the
        current one, or if they were not (that is, big-endian on a
        little-endian machine, or vice versa). This information may be used to
        determine whether application data needs to be adjusted for this
        architecture or not.

         The Db::get_byteswapped() method may not be called before the
         Db::open()  method is called.

         The Db::get_byteswapped()

                method either returns a non-zero error value or throws an
                exception that encapsulates a non-zero error value on
                failure, and returns 0 on success.

Parameters

isswapped

                          If the underlying database files were created on an architecture of
                          the same byte order as the current one, 0 is stored into the memory
                          location referenced by isswapped.  If
                          the underlying database files were created on an architecture of a
                          different byte order as the current one, 1 is stored into the memory
                          location referenced by isswapped.

Errors

                         The Db::get_byteswapped()

                method may fail and throw a DbException
                exception, encapsulating one of the following non-zero errors, or return one
                of the following non-zero errors:

EINVAL

                If the method was called before Db::open()
                was called; or if an invalid flag value or parameter was specified.

Class

                Db

See Also

                     Database and Related Methods

          Prev

            Up

           Next

          Db::get_bt_minkey()

            Home

           Db::get_cachesize()


text:
<?php

/* FOSCommentBundle:Thread:new.html.twig */
class __TwigTemplate_f24f7fe478532964fc42e89444c3e60c391950ac7f97eca0b993ad079d121c52 extends Sonata\CacheBundle\Twig\TwigTemplate14
{
    public function __construct(Twig_Environment $env)
    {
        parent::__construct($env);

        $this->parent = false;

        $this->blocks = array(
            'fos_comment_form_fields' => array($this, 'block_fos_comment_form_fields'),
            'fos_comment_form_submit' => array($this, 'block_fos_comment_form_submit'),
        );
    }

    protected function doDisplay(array $context, array $blocks = array())
    {
        // line 11
        echo "
<form class=\"fos_comment_comment_form\" action=\"";
        // line 12
        echo $this->env->getExtension('routing')->getUrl("fos_comment_post_threads");
        echo "\" method=\"POST\">

    ";
        // line 14
        $this->displayBlock('fos_comment_form_fields', $context, $blocks);
        // line 23
        echo "
    <div class=\"fos_comment_submit\">
        ";
        // line 25
        $this->displayBlock('fos_comment_form_submit', $context, $blocks);
        // line 28
        echo "    </div>

</form>
";
    }

    // line 14
    public function block_fos_comment_form_fields($context, array $blocks = array())
    {
        // line 15
        echo "        ";
        echo $this->env->getExtension('form')->renderer->searchAndRenderBlock((isset($context["form"]) ? $context["form"] : $this->getContext($context, "form")), 'errors');
        echo "
        ";
        // line 16
        echo $this->env->getExtension('form')->renderer->searchAndRenderBlock($this->getAttribute((isset($context["form"]) ? $context["form"] : $this->getContext($context, "form")), "id", array()), 'errors');
        echo "
        ";
        // line 17
        echo $this->env->getExtension('form')->renderer->searchAndRenderBlock($this->getAttribute((isset($context["form"]) ? $context["form"] : $this->getContext($context, "form")), "id", array()), 'widget');
        echo "
        ";
        // line 18
        echo $this->env->getExtension('form')->renderer->searchAndRenderBlock($this->getAttribute((isset($context["form"]) ? $context["form"] : $this->getContext($context, "form")), "permalink", array()), 'errors');
        echo "
        ";
        // line 19
        echo $this->env->getExtension('form')->renderer->searchAndRenderBlock($this->getAttribute((isset($context["form"]) ? $context["form"] : $this->getContext($context, "form")), "permalink", array()), 'widget');
        echo "

        ";
        // line 21
        echo $this->env->getExtension('form')->renderer->searchAndRenderBlock((isset($context["form"]) ? $context["form"] : $this->getContext($context, "form")), 'rest');
        echo "
    ";
    }

    // line 25
    public function block_fos_comment_form_submit($context, array $blocks = array())
    {
        // line 26
        echo "            <input type=\"submit\" value=\"";
        echo $this->env->getExtension('translator')->getTranslator()->trans("fos_comment_comment_new_submit", array(), "FOSCommentBundle");
        echo "\" />
        ";
    }

    public function getTemplateName()
    {
        return "FOSCommentBundle:Thread:new.html.twig";
    }

    public function isTraitable()
    {
        return false;
    }

    public function getDebugInfo()
    {
        return array (  78 => 26,  75 => 25,  69 => 21,  64 => 19,  60 => 18,  56 => 17,  52 => 16,  47 => 15,  44 => 14,  37 => 28,  35 => 25,  31 => 23,  29 => 14,  24 => 12,  21 => 11,);
    }
}


text:
using System;

class ReadPrintCompanyAndManagerInfo
{
    static void Main()
    {
        Console.WriteLine("Write company name, address, phone number, fax number and web site:");
        string name = Console.ReadLine();
        string address = Console.ReadLine();
        string phoneNumber = Console.ReadLine();
        string faxNumber = Console.ReadLine();
        string webSite = Console.ReadLine();
        Console.WriteLine("Write company manager first name, last name, age and a phone number:");
        string firstName = Console.ReadLine();
        string lastName = Console.ReadLine();
        string age = Console.ReadLine();
        string managerPhoneNum = Console.ReadLine();
        Console.WriteLine("Company information:\nname :{0}\naddress : {1}\nphone number : {2}\nfax number : {3}\nweb site : {4}", name, address, phoneNumber, faxNumber, webSite);
        Console.WriteLine("Manager information:\nname :{0} {1}\nage : {2}\nphone number : {3}", firstName, lastName, age, managerPhoneNum);
    }
}


text:
/**
 * Created by sbering on 12/12/13.
 */

var LocalStrategy = require('passport-local').Strategy,
    GoogleStrategy = require('passport-google').Strategy,
    hash = require('../utils/hash');

module.exports = function(app, passport, config) {

    // setup how we serialize to cookie
    passport.serializeUser(function(user, done) {
       console.log('serializing user: ' + user.id);
       done(null, user.id);
    });

    // setup how we load a user from the cookie id
    passport.deserializeUser(function(id, done) {
       var User = app.get('models').User;

       console.log('locating user: ' + id);
       User.find({ where: { id: id } })
       .error(function(err) {
           console.log('unable to locate user: ' + id);
           done(err);
       })
       .success(function(user) {
           console.log('loaded user: ' + user.displayName);
           console.log(user.mapmyfitness_id);
           done(null, user);
       });
    });

    // set up our local authentication strategy
    passport.use(new LocalStrategy(
        {
            usernameField: 'username',
            passwordField: 'password'
        },
        function(username, password, done) {
            console.log('logging in to passport local via: ' + username + ' with password: ' + password);
            var UserCredential = app.get('models').UserCredential;
            var User = app.get('models').User;
            UserCredential.find({
                where: { username: username },
                include: [User]
            })
            .error(function(err) {
                return done(err);
            })
            .success(function(credential) {
                if (!credential) {
                    console.log('unable to locate userCredential by username');
                    return done(null, false, { message: "Incorrect username" });
                }

                console.log(credential);

                // hash the provided password and see if it matches the one on file
                hash(password, credential.passwordsalt, function(err, hash) {
                    if (err) {
                        console.log('password does not match password on file.');
                        return done(err);
                    }
                    if (hash == credential.passwordhash) {
                        console.log('password matches password on file for user');
                        var user = credential.user;
                        console.log(user);
                        return done(null, user);
                    }

                    // password does not match
                    console.log('password does not match password on file.');
                    return done(null, false, { message: "Incorrect password." });
                })
            });
        }
    ));

    // set up google authentication strategy
    passport.use(new GoogleStrategy(
        {
            returnURL: 'http://localhost:3000/auth/google/return',
            realm: 'http://localhost:3000'
        },
        function(identifier, profile, done) {
            var User = $app.get('models').User;
            User.findOrCreate({ provider: 'google', provider_id: identifier }, {
                displayName: profile.displayName,
                givenName: profile.name.givenName,
                middleName: profile.name.middleName,
                familyName: profile.name.familyName
            })
            .success(function(user, created) {
                console.log(user);
                console.log('New user? ' + created);
            });
        }
    ));
};


text:
package org.apache.ignite.internal.processors.cache.datastructures.partitioned;

import org.apache.ignite.cache.CacheAtomicityMode;
import org.apache.ignite.internal.processors.cache.datastructures.GridCacheAbstractQueueFailoverDataConsistencySelfTest;

import static org.apache.ignite.cache.CacheAtomicityMode.TRANSACTIONAL;

/**
 * Queue failover test for transactional cache.
 */
public class GridCachePartitionedQueueFailoverDataConsistencySelfTest extends
    GridCacheAbstractQueueFailoverDataConsistencySelfTest {
    /** {@inheritDoc} */
    @Override protected CacheAtomicityMode collectionCacheAtomicityMode() {
        return TRANSACTIONAL;
    }
}


text:
from sphinx import addnodes

def fix_toc_entries(app, doctree):
    # Get the docname; I don't know why this isn't just passed in to the
    # callback
    # This seems a bit unreliable as it's undocumented, but it's not "private"
    # either:
    docname = app.builder.env.temp_data['docname']
    if app.builder.env.metadata[docname].get('tocdepth', 0) != 0:
        # We need to reprocess any TOC nodes in the doctree and make sure all
        # the files listed in any TOCs are noted
        for treenode in doctree.traverse(addnodes.toctree):
            app.builder.env.note_toctree(docname, treenode)

def setup(app):

    app.connect('doctree-read', fix_toc_entries)

    return {'parallel_read_safe': True,
            'parallel_write_safe': True}


text:
from twilio.rest import Client

# Your Account Sid and Auth Token from twilio.com/user/account
account_sid = "ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX"
auth_token = "your_auth_token"
client = Client(account_sid, auth_token)

participant = client \
    .conferences("CFbbe4632a3c49700934481addd5ce1659") \
    .participants("CA386025c9bf5d6052a1d1ea42b4d16662") \
    .update(hold=True, hold_url="www.myapp.com/hold")

print(participant.hold)


text:
using FakeItEasy;
using Serenity.Abstractions;
using Serenity.Web;
using Xunit;

namespace Serenity.Test
{
    [Collection("AvoidParallel")]
    public partial class LogicOperatorPermissionServiceTests
    {
        [Fact]
        public void ShouldDelegateSimplePermissionsToUnderlyingOne()
        {
            var ps = A.Fake<IPermissionService>();
            var expected = false;
            A.CallTo(() => ps.HasPermission(A<string>.Ignored))
                .ReturnsLazily(s => expected);

            var lops = new LogicOperatorPermissionService(ps);
            Assert.False(lops.HasPermission(""));
            Assert.False(lops.HasPermission("A"));
            Assert.False(lops.HasPermission("B:C"));

            expected = true;
            Assert.True( lops.HasPermission(""));
            Assert.True( lops.HasPermission("A"));
            Assert.True( lops.HasPermission("B:C"));
        }

        private IPermissionService FakeService()
        {
            var ps = A.Fake<IPermissionService>();
            A.CallTo(() => ps.HasPermission("T")).Returns(true);
            A.CallTo(() => ps.HasPermission("F")).Returns(false);
            A.CallTo(() => ps.HasPermission("Y")).Returns(true);
            A.CallTo(() => ps.HasPermission("N")).Returns(false);
            return ps;
        }

        [Fact]
        public void ReturnsFalseForOrWhenAllFalse()
        {
            var lops = new LogicOperatorPermissionService(FakeService());
            Assert.False(lops.HasPermission("F|N"));
            Assert.False(lops.HasPermission("N|F"));
            Assert.False(lops.HasPermission("N|N|N"));
            Assert.False(lops.HasPermission("N|N|F|F"));
            Assert.False(lops.HasPermission("N|F|N|F"));
        }

        [Fact]
        public void ReturnsTrueForOrWhenAllTrue()
        {
            var lops = new LogicOperatorPermissionService(FakeService());
            Assert.True( lops.HasPermission("T|Y"));
            Assert.True( lops.HasPermission("Y|T"));
            Assert.True( lops.HasPermission("Y|Y|Y"));
            Assert.True( lops.HasPermission("Y|Y|T|T"));
            Assert.True( lops.HasPermission("Y|T|Y|T"));
        }

        [Fact]
        public void ReturnsTrueForOrWhenSomeTrue()
        {
            var lops = new LogicOperatorPermissionService(FakeService());
            Assert.True( lops.HasPermission("T|F"));
            Assert.True( lops.HasPermission("Y|N"));
            Assert.True( lops.HasPermission("N|Y|N"));
            Assert.True( lops.HasPermission("F|F|T|T"));
            Assert.True( lops.HasPermission("N|Y|N|F|N|N"));
        }

        [Fact]
        public void ReturnsFalseForAndWhenAllFalse()
        {
            var lops = new LogicOperatorPermissionService(FakeService());
            Assert.False(lops.HasPermission("F&N"));
            Assert.False(lops.HasPermission("N&F"));
            Assert.False(lops.HasPermission("N&N&N"));
            Assert.False(lops.HasPermission("N&N&F&F"));
            Assert.False(lops.HasPermission("N&F&N&F"));
        }

        [Fact]
        public void ReturnsTrueForAndWhenAllTrue()
        {
            var lops = new LogicOperatorPermissionService(FakeService());
            Assert.True( lops.HasPermission("T&Y"));
            Assert.True( lops.HasPermission("Y&T"));
            Assert.True( lops.HasPermission("Y&Y&Y"));
            Assert.True( lops.HasPermission("Y&Y&T&T"));
            Assert.True( lops.HasPermission("Y&T&Y&T"));
        }

        [Fact]
        public void ReturnsFalseForAndWhenSomeFalse()
        {
            var lops = new LogicOperatorPermissionService(FakeService());
            Assert.False(lops.HasPermission("T&F"));
            Assert.False(lops.HasPermission("Y&N"));
            Assert.False(lops.HasPermission("T&Y&N"));
            Assert.False(lops.HasPermission("T&T&F&T"));
            Assert.False(lops.HasPermission("N&Y&N&F&N&N"));
        }

        [Fact]
        public void AndTakesPrecedenceOverOr()
        {
            var lops = new LogicOperatorPermissionService(FakeService());
            Assert.False(lops.HasPermission("F|T&F"));
            Assert.False(lops.HasPermission("F|F&T"));
            Assert.True( lops.HasPermission("T|F&T"));
            Assert.False(lops.HasPermission("F&T|F&T"));
            Assert.False(lops.HasPermission("T&F|F|F&T"));
            Assert.False(lops.HasPermission("T&T&T&F|F&F&F&T"));
            Assert.True( lops.HasPermission("T&T&T&F|T&T|F&F&F&T"));
        }
    }
}


text:
function updateClock() {
  var currentTime = new Date();

  var currentHours = currentTime.getHours();
  var currentMinutes = currentTime.getMinutes();
  var currentSeconds = currentTime.getSeconds();

  currentMinutes = ( currentMinutes < 10 ? "0" : "" ) + currentMinutes;
  currentSeconds = ( currentSeconds < 10 ? "0" : "" ) + currentSeconds;

  var currentTimeString = currentHours + ":" + currentMinutes + ":" + currentSeconds;

  document.getElementById("clock").firstChild.nodeValue = currentTimeString;
}


text:
package io.dropwizard.jersey.sessions;

import com.sun.jersey.api.client.ClientResponse;
import com.sun.jersey.api.client.WebResource;
import com.sun.jersey.test.framework.AppDescriptor;
import com.sun.jersey.test.framework.JerseyTest;
import com.sun.jersey.test.framework.WebAppDescriptor;
import io.dropwizard.logging.LoggingFactory;
import org.junit.Test;

import javax.ws.rs.core.MediaType;
import javax.ws.rs.core.NewCookie;
import java.util.List;

import static org.assertj.core.api.Assertions.assertThat;

public class FlashProviderTest extends JerseyTest {
    static {
        LoggingFactory.bootstrap();
    }

    @Override
    protected AppDescriptor configure() {
        return new WebAppDescriptor.Builder("io.dropwizard.jersey.sessions").build();
    }

    @Test
    public void passesInHttpSessions() throws Exception {
        final ClientResponse firstResponse = resource().path("/flash/")
                                                       .type(MediaType.TEXT_PLAIN)
                                                       .post(ClientResponse.class, "Mr. Peeps");

        final List<NewCookie> cookies = firstResponse.getCookies();
        firstResponse.close();

        final WebResource.Builder builder =
                resource().path("/flash/").accept(MediaType.TEXT_PLAIN);

        for (NewCookie cookie : cookies) {
            builder.cookie(cookie);
        }

        final ClientResponse secondResponse = builder.get(ClientResponse.class);
        assertThat(secondResponse.getEntity(String.class))
                .isEqualTo("Mr. Peeps");

        final WebResource.Builder anotherBuilder =
                resource().path("/flash/").accept(MediaType.TEXT_PLAIN);

        for (NewCookie cookie : cookies) {
            anotherBuilder.cookie(cookie);
        }

        final String thirdResponse = anotherBuilder.get(String.class);
        assertThat(thirdResponse)
                .isEqualTo("null");
    }
}


text:
#pragma once
#include <aws/transcribe/TranscribeService_EXPORTS.h>
#include <aws/core/utils/memory/stl/AWSString.h>
#include <aws/core/utils/memory/stl/AWSVector.h>
#include <aws/transcribe/model/Tag.h>
#include <utility>

namespace Aws
{
template<typename RESULT_TYPE>
class AmazonWebServiceResult;

namespace Utils
{
namespace Json
{
  class JsonValue;
} // namespace Json
} // namespace Utils
namespace TranscribeService
{
namespace Model
{
  class AWS_TRANSCRIBESERVICE_API ListTagsForResourceResult
  {
  public:
    ListTagsForResourceResult();
    ListTagsForResourceResult(const Aws::AmazonWebServiceResult<Aws::Utils::Json::JsonValue>& result);
    ListTagsForResourceResult& operator=(const Aws::AmazonWebServiceResult<Aws::Utils::Json::JsonValue>& result);

    /**
     *
The Amazon Resource Name (ARN) specified in your request.

     */
    inline const Aws::String& GetResourceArn() const{ return m_resourceArn; }

    /**
     *
The Amazon Resource Name (ARN) specified in your request.

     */
    inline void SetResourceArn(const Aws::String& value) { m_resourceArn = value; }

    /**
     *
The Amazon Resource Name (ARN) specified in your request.

     */
    inline void SetResourceArn(Aws::String&& value) { m_resourceArn = std::move(value); }

    /**
     *
The Amazon Resource Name (ARN) specified in your request.

     */
    inline void SetResourceArn(const char* value) { m_resourceArn.assign(value); }

    /**
     *
The Amazon Resource Name (ARN) specified in your request.

     */
    inline ListTagsForResourceResult& WithResourceArn(const Aws::String& value) { SetResourceArn(value); return *this;}

    /**
     *
The Amazon Resource Name (ARN) specified in your request.

     */
    inline ListTagsForResourceResult& WithResourceArn(Aws::String&& value) { SetResourceArn(std::move(value)); return *this;}

    /**
     *
The Amazon Resource Name (ARN) specified in your request.

     */
    inline ListTagsForResourceResult& WithResourceArn(const char* value) { SetResourceArn(value); return *this;}

    /**
     *
Lists all tags associated with the given transcription job, vocabulary,
     * model, or resource.

     */
    inline const Aws::Vector<Tag>& GetTags() const{ return m_tags; }

    /**
     *
Lists all tags associated with the given transcription job, vocabulary,
     * model, or resource.

     */
    inline void SetTags(const Aws::Vector<Tag>& value) { m_tags = value; }

    /**
     *
Lists all tags associated with the given transcription job, vocabulary,
     * model, or resource.

     */
    inline void SetTags(Aws::Vector<Tag>&& value) { m_tags = std::move(value); }

    /**
     *
Lists all tags associated with the given transcription job, vocabulary,
     * model, or resource.

     */
    inline ListTagsForResourceResult& WithTags(const Aws::Vector<Tag>& value) { SetTags(value); return *this;}

    /**
     *
Lists all tags associated with the given transcription job, vocabulary,
     * model, or resource.

     */
    inline ListTagsForResourceResult& WithTags(Aws::Vector<Tag>&& value) { SetTags(std::move(value)); return *this;}

    /**
     *
Lists all tags associated with the given transcription job, vocabulary,
     * model, or resource.

     */
    inline ListTagsForResourceResult& AddTags(const Tag& value) { m_tags.push_back(value); return *this; }

    /**
     *
Lists all tags associated with the given transcription job, vocabulary,
     * model, or resource.

     */
    inline ListTagsForResourceResult& AddTags(Tag&& value) { m_tags.push_back(std::move(value)); return *this; }

  private:

    Aws::String m_resourceArn;

    Aws::Vector<Tag> m_tags;
  };

} // namespace Model
} // namespace TranscribeService
} // namespace Aws


text:
package org.apache.accumulo.server.monitor.servlets.trace;

import java.util.Date;

import org.apache.accumulo.core.trace.TraceFormatter;
import org.apache.accumulo.server.monitor.util.celltypes.StringType;
import org.apache.accumulo.trace.thrift.RemoteSpan;

/**
 *
 */
public class ShowTraceLinkType extends StringType<RemoteSpan> {
  @Override
  public String format(Object obj) {
    if (obj == null)
      return "-";
    RemoteSpan span = (RemoteSpan) obj;
    return String.format("%s", Long.toHexString(span.traceId), TraceFormatter.formatDate(new Date(span.start)));
  }

  @Override
  public int compare(RemoteSpan o1, RemoteSpan o2) {
    if (o1 == null && o2 == null)
      return 0;
    else if (o1 == null)
      return -1;
    else if (o2 == null)
      return 1;
    return o1.start < o2.start ? -1 : (o1.start == o2.start ? 0 : 1);
  }
}


text:
NSString *const innerChartName = @"Inner";
NSString *const outerChartName = @"Outer";

@implementation DonutChart

+(void)load
{
    [super registerPlotItem:self];
}

-(id)init
{
    if ( (self = [super init]) ) {
        title = @"Donut Chart";
    }

    return self;
}

-(void)killGraph
{
    [super killGraph];
}

-(void)dealloc
{
    [plotData release];
    [super dealloc];
}

-(void)generateData
{
    if ( plotData == nil ) {
        plotData = [[NSMutableArray alloc] initWithObjects:
                    [NSNumber numberWithDouble:20.0],
                    [NSNumber numberWithDouble:30.0],
                    [NSNumber numberWithDouble:60.0],
                    nil];
    }
}

-(void)renderInLayer:(CPTGraphHostingView *)layerHostingView withTheme:(CPTTheme *)theme
{
#if TARGET_IPHONE_SIMULATOR || TARGET_OS_IPHONE
    CGRect bounds = layerHostingView.bounds;
#else
    CGRect bounds = NSRectToCGRect(layerHostingView.bounds);
#endif

    CPTGraph *graph = [[[CPTXYGraph alloc] initWithFrame:bounds] autorelease];
    [self addGraph:graph toHostingView:layerHostingView];
    [self applyTheme:theme toGraph:graph withDefault:[CPTTheme themeNamed:kCPTDarkGradientTheme]];

    graph.title = title;
    CPTMutableTextStyle *textStyle = [CPTMutableTextStyle textStyle];
    textStyle.color                = [CPTColor grayColor];
    textStyle.fontName             = @"Helvetica-Bold";
    textStyle.fontSize             = bounds.size.height / 20.0f;
    graph.titleTextStyle           = textStyle;
    graph.titleDisplacement        = CGPointMake(0.0f, bounds.size.height / 18.0f);
    graph.titlePlotAreaFrameAnchor = CPTRectAnchorTop;

    graph.plotAreaFrame.masksToBorder = NO;

    // Graph padding
    float boundsPadding = bounds.size.width / 20.0f;
    graph.paddingLeft   = boundsPadding;
    graph.paddingTop    = graph.titleDisplacement.y * 2;
    graph.paddingRight  = boundsPadding;
    graph.paddingBottom = boundsPadding;

    graph.axisSet = nil;

    CPTMutableLineStyle *whiteLineStyle = [CPTMutableLineStyle lineStyle];
    whiteLineStyle.lineColor = [CPTColor whiteColor];

    CPTMutableShadow *whiteShadow = [CPTMutableShadow shadow];
    whiteShadow.shadowOffset     = CGSizeMake(2.0, -4.0);
    whiteShadow.shadowBlurRadius = 4.0;
    whiteShadow.shadowColor      = [[CPTColor whiteColor] colorWithAlphaComponent:0.25];

    // Add pie chart
    CPTPieChart *piePlot = [[CPTPieChart alloc] init];
    piePlot.dataSource = self;
    piePlot.pieRadius  = MIN(0.7 * (layerHostingView.frame.size.height - 2 * graph.paddingLeft) / 2.0,
                             0.7 * (layerHostingView.frame.size.width - 2 * graph.paddingTop) / 2.0);
    CGFloat innerRadius = piePlot.pieRadius / 2.0;
    piePlot.pieInnerRadius  = innerRadius + 5.0;
    piePlot.identifier      = outerChartName;
    piePlot.borderLineStyle = whiteLineStyle;
    piePlot.startAngle      = M_PI_4;
    piePlot.endAngle        = 3.0 * M_PI_4;
    piePlot.sliceDirection  = CPTPieDirectionCounterClockwise;
    piePlot.shadow          = whiteShadow;
    piePlot.delegate        = self;
    [graph addPlot:piePlot];
    [piePlot release];

    // Add another pie chart
    piePlot                 = [[CPTPieChart alloc] init];
    piePlot.dataSource      = self;
    piePlot.pieRadius       = innerRadius - 5.0;
    piePlot.identifier      = innerChartName;
    piePlot.borderLineStyle = whiteLineStyle;
    piePlot.startAngle      = M_PI_4;
    piePlot.sliceDirection  = CPTPieDirectionClockwise;
    piePlot.shadow          = whiteShadow;
    piePlot.delegate        = self;
    [graph addPlot:piePlot];
    [piePlot release];
}

-(void)pieChart:(CPTPieChart *)plot sliceWasSelectedAtRecordIndex:(NSUInteger)index
{
    NSLog(@"%@ slice was selected at index %lu. Value = %@", plot.identifier, (unsigned long)index, [plotData objectAtIndex:index]);
}

#pragma mark -
#pragma mark Plot Data Source Methods

-(NSUInteger)numberOfRecordsForPlot:(CPTPlot *)plot
{
    return [plotData count];
}

-(NSNumber *)numberForPlot:(CPTPlot *)plot field:(NSUInteger)fieldEnum recordIndex:(NSUInteger)index
{
    NSNumber *num;

    if ( fieldEnum == CPTPieChartFieldSliceWidth ) {
        num = [plotData objectAtIndex:index];
    }
    else {
        return [NSNumber numberWithInt:index];
    }

    return num;
}

-(CPTLayer *)dataLabelForPlot:(CPTPlot *)plot recordIndex:(NSUInteger)index
{
    static CPTMutableTextStyle *whiteText = nil;

    CPTTextLayer *newLayer = nil;

    if ( [(NSString *)plot.identifier isEqualToString:outerChartName] ) {
        if ( !whiteText ) {
            whiteText       = [[CPTMutableTextStyle alloc] init];
            whiteText.color = [CPTColor whiteColor];
        }

        newLayer                 = [[[CPTTextLayer alloc] initWithText:[NSString stringWithFormat:@"%.0f", [[plotData objectAtIndex:index] floatValue]] style:whiteText] autorelease];
        newLayer.fill            = [CPTFill fillWithColor:[CPTColor darkGrayColor]];
        newLayer.cornerRadius    = 5.0;
        newLayer.paddingLeft     = 3.0;
        newLayer.paddingTop      = 3.0;
        newLayer.paddingRight    = 3.0;
        newLayer.paddingBottom   = 3.0;
        newLayer.borderLineStyle = [CPTLineStyle lineStyle];
    }

    return newLayer;
}

-(CGFloat)radialOffsetForPieChart:(CPTPieChart *)pieChart recordIndex:(NSUInteger)index
{
    CGFloat result = 0.0;

    if ( [(NSString *)pieChart.identifier isEqualToString:outerChartName] ) {
        result = (index == 0 ? 15.0 : 0.0);
    }
    return result;
}

@end


text:
import React, { Component } from 'react';

import {
  ScrollView,
  StyleSheet,
  Text,
  View
} from 'react-native';

import * as firebase from 'firebase';
import * as colors from '../../../common/colors';
import * as themoviedb from '../../../services/movies-service';
import * as userService from '../../../services/user-service';

import Icon from 'react-native-vector-icons/MaterialCommunityIcons';

import FavoriteList from './favorite-list';

export default class Favorites extends Component {

  constructor(props) {
    super(props);

    this.state = {
      saved: [],
      viewed: [],
      favorite: []
    };
  }

  componentDidMount() {
    let user = firebase.auth().currentUser;

    if (user) {

      firebase.database().ref('users/' + user.uid + '/list/favorite').on('value', (snapshot) => {
        if (snapshot.val()) {
          let favoritesListLimit = [];

          for (let i = 0; i < snapshot.val().length; i++) {
            if (i < 2) {
              favoritesListLimit.unshift(snapshot.val()[i]);
            }
          }

          this.setState({
            favorite: favoritesListLimit
          });
        } else {
          this.setState({
            favorite: []
          });
        }
      });

      firebase.database().ref('users/' + user.uid + '/list/saved').on('value', (snapshot) => {
        if (snapshot.val()) {
          let favoritesListLimit = [];

          for (let i = 0; i < snapshot.val().length; i++) {
            if (i < 2) {
              favoritesListLimit.unshift(snapshot.val()[i]);
            }
          }

          this.setState({
            saved: favoritesListLimit
          });
        } else {
          this.setState({
            saved: []
          });
        }
      });

      firebase.database().ref('users/' + user.uid + '/list/viewed').on('value', (snapshot) => {
        if (snapshot.val()) {
          let favoritesListLimit = [];

          for (let i = 0; i < snapshot.val().length; i++) {
            if (i < 2) {
              favoritesListLimit.unshift(snapshot.val()[i]);
            }
          }

          this.setState({
            viewed: favoritesListLimit
          });
        } else {
          this.setState({
            viewed: []
          });
        }
      });

    }

  }

  render() {
    return (
      <ScrollView style={styles.container}>
        <FavoriteList title="Las quiero ver" list={this.state.saved} type="saved" />
        <FavoriteList title="Las he visto" list={this.state.viewed} type="viewed" />
        <FavoriteList title="Mis favoritas" list={this.state.favorite} type="favorite" />
      </ScrollView>
    );
  }

}

const styles = StyleSheet.create({
  container: {
    // height: height,
    paddingHorizontal: 10,
    paddingVertical: 15
  }
});


text:
package com.microsoft.azure.management.containerinstance.v2018_04_01.implementation;

import com.microsoft.azure.arm.model.implementation.WrapperImpl;
import com.microsoft.azure.management.containerinstance.v2018_04_01.ContainerLogs;
import rx.functions.Func1;
import rx.Observable;
import com.microsoft.azure.management.containerinstance.v2018_04_01.Logs;

class ContainerLogsImpl extends WrapperImpl<ContainerLogsInner> implements ContainerLogs {
    private final ContainerInstanceManager manager;

    ContainerLogsImpl(ContainerInstanceManager manager) {
        super(manager.inner().containerLogs());
        this.manager = manager;
    }

    public ContainerInstanceManager manager() {
        return this.manager;
    }

    @Override
    public Observable<Logs> listAsync(String resourceGroupName, String containerGroupName, String containerName) {
        ContainerLogsInner client = this.inner();
        return client.listAsync(resourceGroupName, containerGroupName, containerName)
        .map(new Func1<LogsInner, Logs>() {
            @Override
            public Logs call(LogsInner inner) {
                return new LogsImpl(inner, manager());
            }
        });
    }

}


text:
ACCEPTED

#### According to
International Plant Names Index

#### Published in
null

#### Original name
Micromeria myrtifolia Boiss. & Hohen.

### Remarks
null


text:
= 0.0.9
* okay, this time we are totally setting the headers correctly

= 0.0.8
* do not coerce headers

= 0.0.7
* support for setting custom email headers. Give us the hassssh.

= 0.0.6
* support for setting layouts

= 0.0.5
* Fixed bug where the subject was not being set correctly.
* The ActionMailer object used behind the scenese is now available through #mailer


text:
//============================================================
//
//  input.h - Win32 implementation of MAME input routines
//
//============================================================
//
//  Copyright Aaron Giles
//  All rights reserved.
//
//  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 'MAME' 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 AARON GILES ''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 AARON GILES BE LIABLE FOR ANY DIRECT,
//  INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
//  DAMAGE (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.
//
//============================================================

#ifndef __INPUT_H
#define __INPUT_H

//============================================================
//  PROTOTYPES
//============================================================

void wininput_init(running_machine &machine);
void wininput_poll(running_machine &machine);

BOOL wininput_handle_mouse_button(int button, int down, int x, int y);
BOOL wininput_handle_raw(HANDLE device);

int wininput_should_hide_mouse(void);

int wininput_vkey_for_mame_code(input_code code);

#endif /* __INPUT_H */


text:
namespace Wake.Serialization
{
    public interface ISerializer
    {
        byte[] Serialize(object data);
        T Deserialize<T>(byte[] data, int offset, int length);
    }
}


text:
Atom's iconic One Dark theme, and one of the most installed [themes](https://marketplace.visualstudio.com/search?target=VSCode&category=Themes&sortBy=Installs) for VS Code!

## SPONSORS

[![codestream](https://alt-images.codestream.com/codestream_logo_onedarkpro.png)](https://sponsorlink.codestream.com/?utm_source=vscmarket&utm_campaign=onedarkpro&utm_medium=banner)

Eliminate context switching and costly distractions. Create and merge PRs and perform code reviews from inside your IDE while using jump-to-definition, your keybindings, and other IDE favorites.
 [Learn more](https://sponsorlink.codestream.com/?utm_source=vscmarket&utm_campaign=onedarkpro&utm_medium=banner).

## SCREENSHOT
![ScreenShot](https://cdn.jsdelivr.net/gh/binaryify/onedark-pro/screenshots/normal.png)

### Italic
![ScreenShot](https://cdn.jsdelivr.net/gh/binaryify/onedark-pro/screenshots/italic.png)

### Default theme
![ScreenShot](https://cdn.jsdelivr.net/gh/binaryify/onedark-pro/screenshots/editor1.png)

### Flat theme
![ScreenShot](https://cdn.jsdelivr.net/gh/binaryify/onedark-pro/screenshots/editorflat.png)

### Terminal
![ScreenShot](https://cdn.jsdelivr.net/gh/binaryify/onedark-pro/screenshots/terminal.png)

### Setting
![ScreenShot](https://cdn.jsdelivr.net/gh/binaryify/onedark-pro/screenshots/setting.png)

### Built in themes
![built-in themes](https://cdn.jsdelivr.net/gh/binaryify/onedark-pro/screenshots/built-in-themes.png)

## Markdown preview style

![Markdown](https://cdn.jsdelivr.net/gh/binaryify/onedark-pro/screenshots/markdown.png)
You can toggle whether to use markdown style in vscode setting (default use)

### Tweaks & theming

If you want to play around with new colors, use the setting
`workbench.colorCustomizations` to customize the currently selected theme. For
example, you can add this snippet in your "settings.json" file:

```json
"workbench.colorCustomizations": {
  "tab.activeBackground": "#282c34",
  "activityBar.background": "#282c34",
  "sideBar.background": "#282c34"
}
```

or use the setting `editor.tokenColorCustomizations`

```json
"editor.tokenColorCustomizations": {
  "[One Dark Pro]": {
    "textMateRules": [
      {
        "scope": ["source.python"],
        "settings": {
          "foreground": "#e06c75"
        }
      }
    ]
  }
}
```
#### Italic
You could set this in your setting.json to make code be italic
```json
"editor.tokenColorCustomizations": {
    "textMateRules": [
      {
        "name": "italic font",
        "scope": [
          "comment",
          "keyword",
          "storage",
          "keyword.control",
          "keyword.control.from",
          "keyword.control.flow",
          "keyword.operator.new",
          "keyword.control.import",
          "keyword.control.export",
          "keyword.control.default",
          "keyword.control.trycatch",
          "keyword.control.conditional",
          "storage.type",
          "storage.type.class",
          "storage.modifier.tsx",
          "storage.type.function",
          "storage.modifier.async",
          "variable.language",
          "variable.language.this",
          "variable.language.super",
          "meta.class",
          "meta.var.expr",
          "constant.language.null",
          "support.type.primitive",
          "entity.name.method.js",
          "entity.other.attribute-name",
          "punctuation.definition.comment",
          "text.html.basic entity.other.attribute-name",
          "tag.decorator.js entity.name.tag.js",
          "tag.decorator.js punctuation.definition.tag.js",
          "source.js constant.other.object.key.js string.unquoted.label.js",
        ],
        "settings": {
          "fontStyle": "italic",
        }
      },
    ]
  }
```

[more info](https://binaryify.github.io/OneDark-Pro)

Please check the official documentation,
[Theme Color Reference](https://code.visualstudio.com/docs/getstarted/theme-color-reference) and
[Theme Color](https://code.visualstudio.com/docs/getstarted/themes), for more helpful information.

[More info](https://code.visualstudio.com/updates/v1_15#_user-definable-syntax-highlighting-colors)

## CHANGELOG

[CHANGELOG.MD](https://github.com/Binaryify/OneDark-Pro/blob/master/CHANGELOG.md)
## DOCS & CONTRIBUTE

This document
([https://binaryify.github.io/OneDark-Pro/](https://binaryify.github.io/OneDark-Pro/))
includes instructions on how to install and edit the theme.

To help with documentation, first fork and clone this repository.

`cd` to the `OneDark-Pro` folder

Run `yarn`

Then run
`npm run docs` to serve the documentation
locally at `localhost:3000`.

### Contributors

This project exists thanks to all the people who contribute.
[![Contributors](https://opencollective.com/OneDark-Pro/contributors.svg?width=890)](https://github.com/Binaryify/OneDark-Pro/graphs/contributors)

### Backers

### Sponsors

Support this project by becoming a sponsor. Your logo will show up here with a link to your website.


text:
<?php

namespace Elastification\Client\Request\V090x\Bulk;

use Elastification\Client\Request\Shared\Bulk\AbstractBulkIndexRequest;
use Elastification\Client\Response\V090x\BulkResponse;
use Elastification\Client\Serializer\SerializerInterface;

/**
 * Class BulkCreateRequest
 * @package Elastification\Client\Request\V090x\Bulk
 */
class BulkIndexRequest extends AbstractBulkIndexRequest
{

    /**
     * @param string                                                $rawData
     * @param \Elastification\Client\Serializer\SerializerInterface $serializer
     * @param array                                                 $serializerParams
     *
     * @return BulkResponse
     * @author Daniel Wendlandt
     */
    public function createResponse(
        $rawData,
        SerializerInterface $serializer,
        array $serializerParams = array()
    ) {

        return new BulkResponse($rawData, $serializer, $serializerParams);
    }

    /**
     * gets a response class name that is supported by this class
     *
     * @return string
     * @author Daniel Wendlandt
     */
    public function getSupportedClass()
    {
        return 'Elastification\Client\Response\V090x\BulkResponse';
    }
}


text:
package org.oauthsimple.builder.api;

import org.oauthsimple.extractors.AccessTokenExtractor;
import org.oauthsimple.extractors.JsonTokenExtractor;
import org.oauthsimple.model.OAuthConfig;
import org.oauthsimple.utils.OAuthEncoder;
import org.oauthsimple.utils.Preconditions;

public class ViadeoApi extends DefaultApi20 {
	private static final String AUTHORIZE_URL = "https://secure.viadeo.com/oauth-provider/authorize2?client_id=%s&redirect_uri=%s&response_type=%s";
	private static final String SCOPED_AUTHORIZE_URL = AUTHORIZE_URL
			+ "&scope=%s";

	@Override
	public AccessTokenExtractor getAccessTokenExtractor() {
		return new JsonTokenExtractor();
	}

	@Override
	public String getAccessTokenEndpoint(OAuthConfig config) {
		return "https://secure.viadeo.com/oauth-provider/access_token2?grant_type="
				+ config.getGrantType().getTypeValue();
	}

	@Override
	public String getAuthorizationUrl(OAuthConfig config) {
		Preconditions
				.checkValidUrl(config.getCallback(),
						"Must provide a valid url as callback. Viadeo does not support OOB");

		// Append scope if present
		if (config.hasScope()) {
			return String.format(SCOPED_AUTHORIZE_URL, config.getApiKey(),
					OAuthEncoder.encode(config.getCallback()), config
							.getResponseType().getTypeValue(), OAuthEncoder
							.encode(config.getScope()));
		} else {
			return String.format(AUTHORIZE_URL, config.getApiKey(),
					OAuthEncoder.encode(config.getCallback()), config
							.getResponseType().getTypeValue());
		}
	}
}


text:
from django.contrib import admin
from .models import WalletMasterKeys
# Register your models here.

class MasterAdmin(admin.ModelAdmin):
    readonly_fields = ('encrypted_mnemonic', )

admin.site.register(WalletMasterKeys, MasterAdmin)


text:
package com.giyeok.dexdio.dexreader.structs;

import com.giyeok.dexdio.dexreader.value.Container;
import com.giyeok.dexdio.dexreader.value.Int;

public class class_def_item extends Container {

	public class_def_item() {
		super(new NamedValue[] {
				new NamedValue("class_idx", new Int()),
				new NamedValue("access_flags", new Int()),
				new NamedValue("superclass_idx", new Int()),
				new NamedValue("interfaces_off", new Int()),
				new NamedValue("source_file_idx", new Int()),
				new NamedValue("annotations_off", new Int()),
				new NamedValue("class_data_off", new Int()),
				new NamedValue("static_values_off", new Int()),
		});
	}

	public long class_idx() {
		return ((Int) find("class_idx")).getUnsignedValue();
	}

	public long access_flags() {
		return ((Int) find("access_flags")).getUnsignedValue();
	}

	public long superclass_idx() {
		return ((Int) find("superclass_idx")).getUnsignedValue();
	}

	public long interfaces_off() {
		return ((Int) find("interfaces_off")).getUnsignedValue();
	}

	public long source_file_idx() {
		return ((Int) find("source_file_idx")).getUnsignedValue();
	}

	public long annotations_off() {
		return ((Int) find("annotations_off")).getUnsignedValue();
	}

	public long class_data_off() {
		return ((Int) find("class_data_off")).getUnsignedValue();
	}

	public long static_values_off() {
		return ((Int) find("static_values_off")).getUnsignedValue();
	}
}


text:
package org.apache.dubbo.rpc;

import org.apache.dubbo.common.utils.StringUtils;

import java.util.HashMap;
import java.util.Map;

/**
 *
 */
public abstract class AbstractResult implements Result {
    protected Map<String, String> attachments = new HashMap<String, String>();

    protected Object result;

    protected Throwable exception;

    @Override
    public Map<String, String> getAttachments() {
        return attachments;
    }

    @Override
    public void setAttachments(Map<String, String> map) {
        this.attachments = map == null ? new HashMap<String, String>() : map;
    }

    @Override
    public void addAttachments(Map<String, String> map) {
        if (map == null) {
            return;
        }
        if (this.attachments == null) {
            this.attachments = new HashMap<String, String>();
        }
        this.attachments.putAll(map);
    }

    @Override
    public String getAttachment(String key) {
        return attachments.get(key);
    }

    @Override
    public String getAttachment(String key, String defaultValue) {
        String result = attachments.get(key);
        if (StringUtils.isEmpty(result)) {
            result = defaultValue;
        }
        return result;
    }

    @Override
    public void setAttachment(String key, String value) {
        attachments.put(key, value);
    }

}