text:
tm_default_settings() {
    echo "########################################################################"
    echo "# TimeMachine detault settings                                         #"
    echo "########################################################################"
    echo "* Disable Time Machine prompts for the new disks"
    defaults write com.apple.TimeMachine DoNotOfferNewDisksForBackup -bool true

    echo "* Disable local Time Machine snapshots"
    sudo tmutil disablelocal 2>/dev/null
    if [ "$(defaults read /Library/Preferences/com.apple.TimeMachine MobileBackups)" == "0" ]; then
        echo "  - Local Backups disabled"
    fi
}
tm_exclude() {
    path=$1
    if [ -n "${path}" ]; then
        echo "* Excluding path from the TimeMachine: ${path}"
        if [ -e "${path}" ]; then
            sudo tmutil addexclusion -p "${path}"
            sudo tmutil isexcluded "${path}" || echo "  - Error: the ${path} not added"
        else
            echo "  - Error: path '${path}' not exists"
        fi
    fi
}

tm_exclude_all() {
    echo "########################################################################"
    echo "# TimeMachine add exclude paths                                        #"
    echo "########################################################################"
    tm_exclude "${HOME}/.docker"
    tm_exclude "${HOME}/Library/Containers/com.docker.docker"
    tm_exclude "${HOME}/VirtualBox VMs"

    tm_exclude "${HOME}/Library/Caches"

    tm_exclude "${HOME}/Applications/Games"
    tm_exclude "${HOME}/Downloads"
    tm_exclude "${HOME}/Music"
    tm_exclude "${HOME}/Movies"

    tm_exclude "$(ls -d ${HOME}/Documents/OneDrive* 2>/dev/null | head -n 1)"
    tm_exclude "/Users/shared"
    tm_exclude "/var/dump-data"
    tm_exclude "/var/tmp"
}

calculate_backup_size() {
    location=$(tmutil machinedirectory)
    echo "Current TimeMachine backup location: ${location}"
    tmutil calculatedrift "${location}"
}

tm_default_settings
tm_exclude_all


text:
package de.espend.idea.shopware.reference.provider;

import com.intellij.codeInsight.lookup.LookupElement;
import com.intellij.codeInsight.lookup.LookupElementBuilder;
import com.intellij.psi.PsiElement;
import com.intellij.psi.PsiElementResolveResult;
import com.intellij.psi.PsiPolyVariantReferenceBase;
import com.intellij.psi.ResolveResult;
import com.jetbrains.php.lang.psi.elements.StringLiteralExpression;
import de.espend.idea.shopware.ShopwarePluginIcons;
import de.espend.idea.shopware.util.ShopwareUtil;
import org.jetbrains.annotations.NotNull;
import org.jetbrains.annotations.Nullable;

import java.util.ArrayList;
import java.util.List;

/**
 * @author Daniel Espendiller <daniel@espendiller.net>
 */
public class ControllerReferenceProvider extends PsiPolyVariantReferenceBase<PsiElement> {

    final private String content;
    final private String moduleName;

    public ControllerReferenceProvider(StringLiteralExpression stringLiteralExpression, @Nullable String moduleName) {
        super(stringLiteralExpression);
        this.content = stringLiteralExpression.getContents();
        this.moduleName = moduleName != null ? moduleName : "frontend";
    }

    @NotNull
    @Override
    public ResolveResult[] multiResolve(boolean b) {
        final List<PsiElement> targets = new ArrayList<>();

        ShopwareUtil.collectControllerClass(getElement().getProject(), (phpClass, moduleName1, controllerName) -> {
            if (controllerName.equalsIgnoreCase(content)) {
                targets.add(phpClass);
            }
        }, moduleName);

        return PsiElementResolveResult.createResults(targets);
    }

    @NotNull
    @Override
    public Object[] getVariants() {

        final List<LookupElement> lookupElements = new ArrayList<>();

        ShopwareUtil.collectControllerClass(getElement().getProject(), (phpClass, moduleName1, controllerName) -> lookupElements.add(LookupElementBuilder.create(ShopwareUtil.toCamelCase(controllerName, true))
            .withIcon(ShopwarePluginIcons.SHOPWARE)
            .withTypeText(phpClass.getPresentableFQN(), true)
        ), moduleName);

        return lookupElements.toArray();
    }
}

redpajama_set_name: RedPajamaGithub


text:
global.my_job_target = 'appid_to_asin'; // must be filled
global.job_settings = { // it does not matter too much for this option
	'client_job_request_count': 5,
	'web_access_interval': 5000, // how long wait for next web visit, set this to prevent blocking from IP.
	'connection_try_max': 10,
};
///////// configuration end ///////////
console.log('reading configuration for %s...', global.my_job_target);

var client = require('./client_base.js');
client.main();


text:
using System.Net;
using System.Net.Http;
using System.Text;
using System.Web;
using System.Web.Http;
using sdk_lpl_mvc5;
using sdk_lpl_mvc5.Models;
using sdk_lpl_mvc5.Utils;
using sdk_lpl_mvc5.Filters;

namespace sdk_lpl_mvc5.Controllers
{
    /// <summary>
    /// Ce service a pour but de mettre à jour les comptes utilisateurs sur les plateformes partenaire pour la propagation de l'abonnement à partir des paramètres fourni par LPL.
    /// Ce service sera exécuter lors de la reconduite d'un abonnement (si l'utilisateur a reconduit son paiement mensuel). Les données d'entrées fournies par LPL seront sérialisées en JSON dans le body de la requête.
    /// </summary>
    /// <param name="body">Contient les informations de l'utilisateur, cryptées avec AES puis encodé en base64</param>
    /// <returns>Retourne une chaine de caractère cryptée et encodée contenant les informations de validation </returns>
    public class MajCompteController : ApiController
    {
        [HttpPut]
        [Route("ws/majCompte")]
        [CheckHeader]
        public HttpResponseMessage UpdateAccount()
        {
            var body = Request.Content.ReadAsStringAsync().Result;

            UpdateAccountModel account =
                JsonConvert.DeserializeObject<UpdateAccountModel>(Encrypt.DecryptRJ256(body,
                    Config.AESKey, Config.IV));

            // TODO : à modifier
            // Ajoutez ici votre logique de verification des donnees en base à partir de l'objet UpdateAccountModel
            // Exemple de composition du modele à partir des donnees en base
            ValidationResponseModel model = new ValidationResponseModel
            {
                IsValid = true,
                CodeUtilisateur = account.CodeUtilisateur,
                PartenaireID = Config.PartID
            };

            string json = Encrypt.EncryptRJ256(JsonConvert.SerializeObject(model), Config.AESKey, Config.IV);

            string timeStampHeader = Timestamp.UnixTimestamp().ToString();
            string concat = string.Concat(Config.PartID.ToString(), "+", timeStampHeader, "+", Config.CodeSecret);

            HttpContext.Current.Response.AddHeader("X-TS", timeStampHeader);
            HttpContext.Current.Response.AddHeader("X-PART", Config.PartID.ToString());
            HttpContext.Current.Response.AddHeader("X-LPL", Hash.SHA1Hash(Encoding.UTF8.GetBytes(concat)));

            var resp = new HttpResponseMessage(HttpStatusCode.OK)
            {
                Content = new StringContent(json, Encoding.UTF8, "text/plain")
            };

            return resp;
        }
    }
}


text:
package org.cfg4j.provider;

import static org.assertj.core.api.Assertions.assertThat;
import static org.mockito.ArgumentMatchers.any;
import static org.mockito.ArgumentMatchers.anyString;
import static org.mockito.ArgumentMatchers.eq;
import static org.mockito.Mockito.mock;
import static org.mockito.Mockito.when;

import com.codahale.metrics.MetricRegistry;
import com.codahale.metrics.Timer;
import org.junit.jupiter.api.BeforeEach;
import org.junit.jupiter.api.Test;
import org.junit.jupiter.api.extension.ExtendWith;
import org.mockito.Mock;
import org.mockito.junit.jupiter.MockitoExtension;

import java.util.LinkedList;
import java.util.List;
import java.util.Properties;

@ExtendWith(MockitoExtension.class)
class MeteredConfigurationProviderTest {

  private interface ConfigPojo {
  }

  @Mock
  private SimpleConfigurationProvider delegate;

  @Mock
  private MetricRegistry metricRegistry;

  private MeteredConfigurationProvider provider;

  @BeforeEach
  void setUp() {
    Timer timer = mock(Timer.class);
    when(timer.time()).thenReturn(mock(Timer.Context.class));
    when(metricRegistry.timer(anyString())).thenReturn(timer);

    provider = new MeteredConfigurationProvider(metricRegistry, "configProvider", delegate);
  }

  @Test
  void allConfigurationAsPropertiesCallsDelegate() {
    Properties properties = new Properties();
    when(delegate.allConfigurationAsProperties()).thenReturn(properties);

    assertThat(provider.allConfigurationAsProperties()).isEqualTo(properties);
  }

  @Test
  void getPropertyCallsDelegate() {
    when(delegate.getProperty("test.property", boolean.class)).thenReturn(true);

    assertThat(provider.getProperty("test.property", boolean.class)).isTrue();
  }

  @Test
  void getProperty2CallsDelegate() {
    @SuppressWarnings("Convert2Diamond")
    GenericType<List<String>> genericType = new GenericType<List<String>>() {
    };
    when(delegate.getProperty(eq("test.property"), eq(genericType))).thenReturn(new LinkedList<>());

    List<String> property = provider.getProperty("test.property", genericType);
    assertThat(property).isEmpty();
  }

  @Test
  void bindCallsDelegate() {
    ConfigPojo configPojo = new ConfigPojo() {
    };
    when(delegate.bind(any(ConfigurationProvider.class), eq(""), eq(ConfigPojo.class))).thenReturn(configPojo);

    assertThat(provider.bind("", ConfigPojo.class)).isEqualTo(configPojo);
  }
}


text:
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
const experimental_utils_1 = require("@typescript-eslint/experimental-utils");
const util_1 = require("../util");
exports.default = util_1.createRule({
    name: 'comma-spacing',
    meta: {
        type: 'suggestion',
        docs: {
            description: 'Enforces consistent spacing before and after commas',
            category: 'Stylistic Issues',
            recommended: false,
            extendsBaseRule: true,
        },
        fixable: 'whitespace',
        schema: [
            {
                type: 'object',
                properties: {
                    before: {
                        type: 'boolean',
                        default: false,
                    },
                    after: {
                        type: 'boolean',
                        default: true,
                    },
                },
                additionalProperties: false,
            },
        ],
        messages: {
            unexpected: `There should be no space {{loc}} ','.`,
            missing: `A space is required {{loc}} ','.`,
        },
    },
    defaultOptions: [
        {
            before: false,
            after: true,
        },
    ],
    create(context, [{ before: spaceBefore, after: spaceAfter }]) {
        const sourceCode = context.getSourceCode();
        const tokensAndComments = sourceCode.tokensAndComments;
        const ignoredTokens = new Set();
        /**
         * Adds null elements of the ArrayExpression or ArrayPattern node to the ignore list
         * @param node node to evaluate
         */
        function addNullElementsToIgnoreList(node) {
            let previousToken = sourceCode.getFirstToken(node);
            for (const element of node.elements) {
                let token;
                if (element === null) {
                    token = sourceCode.getTokenAfter(previousToken);
                    if (token && util_1.isCommaToken(token)) {
                        ignoredTokens.add(token);
                    }
                }
                else {
                    token = sourceCode.getTokenAfter(element);
                }
                previousToken = token;
            }
        }
        /**
         * Adds type parameters trailing comma token to the ignore list
         * @param node node to evaluate
         */
        function addTypeParametersTrailingCommaToIgnoreList(node) {
            const param = node.params[node.params.length - 1];
            const afterToken = sourceCode.getTokenAfter(param);
            if (afterToken && util_1.isCommaToken(afterToken)) {
                ignoredTokens.add(afterToken);
            }
        }
        /**
         * Validates the spacing around a comma token.
         * @param commaToken The token representing the comma
         * @param prevToken The last token before the comma
         * @param nextToken The first token after the comma
         */
        function validateCommaSpacing(commaToken, prevToken, nextToken) {
            if (prevToken &&
                util_1.isTokenOnSameLine(prevToken, commaToken) &&
                spaceBefore !== sourceCode.isSpaceBetween(prevToken, commaToken)) {
                context.report({
                    node: commaToken,
                    data: {
                        loc: 'before',
                    },
                    messageId: spaceBefore ? 'missing' : 'unexpected',
                    fix: fixer => spaceBefore
                        ? fixer.insertTextBefore(commaToken, ' ')
                        : fixer.replaceTextRange([prevToken.range[1], commaToken.range[0]], ''),
                });
            }
            if (nextToken && util_1.isClosingParenToken(nextToken)) {
                return;
            }
            if (!spaceAfter && nextToken && nextToken.type === experimental_utils_1.AST_TOKEN_TYPES.Line) {
                return;
            }
            if (nextToken &&
                util_1.isTokenOnSameLine(commaToken, nextToken) &&
                spaceAfter !== sourceCode.isSpaceBetween(commaToken, nextToken)) {
                context.report({
                    node: commaToken,
                    data: {
                        loc: 'after',
                    },
                    messageId: spaceAfter ? 'missing' : 'unexpected',
                    fix: fixer => spaceAfter
                        ? fixer.insertTextAfter(commaToken, ' ')
                        : fixer.replaceTextRange([commaToken.range[1], nextToken.range[0]], ''),
                });
            }
        }
        return {
            TSTypeParameterDeclaration: addTypeParametersTrailingCommaToIgnoreList,
            ArrayExpression: addNullElementsToIgnoreList,
            ArrayPattern: addNullElementsToIgnoreList,
            'Program:exit'() {
                tokensAndComments.forEach((token, i) => {
                    if (!util_1.isCommaToken(token)) {
                        return;
                    }
                    const prevToken = tokensAndComments[i - 1];
                    const nextToken = tokensAndComments[i + 1];
                    validateCommaSpacing(token, util_1.isCommaToken(prevToken) || ignoredTokens.has(token)
                        ? null
                        : prevToken, util_1.isCommaToken(nextToken) || ignoredTokens.has(token)
                        ? null
                        : nextToken);
                });
            },
        };
    },
});
//# sourceMappingURL=comma-spacing.js.map


text:
<?php

// No direct access.
defined('_JEXEC') or die;

JHtml::addIncludePath(JPATH_COMPONENT.'/helpers/html');
JHtml::_('behavior.tooltip');
JHtml::_('behavior.formvalidation');
JHtml::_('behavior.keepalive');
$user = JFactory::getUser();
$canDo = TemplatesHelper::getActions();
?>

<form action="<?php echo JRoute::_('index.php?option=com_templates&layout=edit&id='.(int) $this->item->id); ?>" method="post" name="adminForm" id="style-form" class="form-validate">

		<fieldset class="adminform">
			<legend><?php echo JText::_('JDETAILS');?></legend>

<?php echo $this->form->getLabel('title'); ?>
			<?php echo $this->form->getInput('title'); ?>

<?php echo $this->form->getLabel('template'); ?>
			<?php echo $this->form->getInput('template'); ?>
			<?php echo $this->form->getLabel('client_id'); ?>
			<?php echo $this->form->getInput('client_id'); ?>
			<input type="text" size="35" value="<?php echo $this->item->client_id == 0 ? JText::_('JSITE') : JText::_('JADMINISTRATOR'); ?>	" class="readonly" readonly="readonly" />

<?php echo $this->form->getLabel('home'); ?>
			<?php echo $this->form->getInput('home'); ?>

			<?php if ($this->item->id) : ?>

<?php echo $this->form->getLabel('id'); ?>
				<?php echo $this->item->id; ?>

			<?php endif; ?>

			<?php if ($this->item->xml) : ?>
				<?php if ($text = trim($this->item->xml->description)) : ?>

						<?php echo JText::_('COM_TEMPLATES_TEMPLATE_DESCRIPTION'); ?>

					<?php echo JText::_($text); ?>
				<?php endif; ?>
			<?php else : ?>

<?php echo JText::_('COM_TEMPLATES_ERR_XML'); ?>

			<?php endif; ?>

		</fieldset>
		<input type="hidden" name="task" value="" />
		<?php echo JHtml::_('form.token'); ?>

	<?php echo JHtml::_('sliders.start', 'template-sliders-'.$this->item->id); ?>

		<?php //get the menu parameters that are automatically set but may be modified.
			echo $this->loadTemplate('options'); ?>

	<?php echo JHtml::_('sliders.end'); ?>

	<?php if ($user->authorise('core.edit', 'com_menu') && $this->item->client_id==0):?>
		<?php if ($canDo->get('core.edit.state')) : ?>

			<?php echo $this->loadTemplate('assignment'); ?>

			<?php endif; ?>
		<?php endif;?>

</form>


text:
import { shallow, mount } from "enzyme";
import { TabsNavigationItem } from "dremio-ui-lib";

import TabsNavigation from "./TabsNavigation";

describe("TabsNavigation", () => {
  let minimalProps;
  let commonProps;
  beforeEach(() => {
    minimalProps = {
      activeTab: "overview",
      changeTab: sinon.spy(),
    };
    commonProps = {
      ...minimalProps,
    };
  });

  it("should render with minimal props without exploding", () => {
    const wrapper = shallow(<TabsNavigation {...minimalProps} />);
    expect(wrapper).to.have.length(1);
  });

  it("should render Overview tab as active by default", () => {
    const wrapper = mount(<TabsNavigation {...minimalProps} />);
    const activeTab = wrapper.find(".-active");
    expect(activeTab).to.have.length(1);
    expect(activeTab.text()).to.be.eql('{"0":{"id":"Common.Overview"}}');
  });

  it("should render tabs: Overview, Details, Acceleration, and Profiles by default", () => {
    const wrapper = mount(<TabsNavigation {...minimalProps} />);
    const tabs = wrapper.find(TabsNavigationItem);
    const expectedLabels = [
      '{"0":{"id":"Common.Overview"}}',
      '{"0":{"id":"Common.Details"}}',
      '{"0":{"id":"Acceleration.Acceleration"}}',
      '{"0":{"id":"Job.Profiles"}}',
    ];
    expect(tabs).to.have.length(expectedLabels.length);
    expect(tabs.map((i) => i.text())).to.be.eql(expectedLabels);
  });

  it("should render tabs: Overview, Details, Acceleration, and Profile when job has single profile", () => {
    const props = {
      ...commonProps,
      attemptDetails: Immutable.fromJS([{ profileUrl: "profileUrl" }]),
    };
    const wrapper = mount(<TabsNavigation {...props} />);
    const tabs = wrapper.find(TabsNavigationItem);
    const expectedLabels = [
      '{"0":{"id":"Common.Overview"}}',
      '{"0":{"id":"Common.Details"}}',
      '{"0":{"id":"Acceleration.Acceleration"}}',
      '{"0":{"id":"Job.Profile"}}',
    ];
    expect(tabs).to.have.length(expectedLabels.length);
    expect(tabs.map((i) => i.text())).to.be.eql(expectedLabels);
  });
});


text:
using System;
using Microsoft.VisualStudio.TestTools.UnitTesting;

namespace Nucleo.Validation
{
	[TestClass]
	public class EmptyValidationTypeTest
	{
		#region " Tests "

		[TestMethod]
		public void CreatingEmptyValidatorReturnsEmptyProperties()
		{
			EmptyValidationType empty = new EmptyValidationType();
			Assert.AreEqual(true, empty.IsEmpty);
			Assert.IsNull(empty.Name);
			Assert.AreEqual(0, empty.Level);
		}

		[TestMethod]
		public void EmptyStaticPropertyMatchesEmptyValidationType()
		{
			Assert.IsTrue(ValidationType.Empty.IsEmpty);
			Assert.IsInstanceOfType(ValidationType.Empty, typeof(EmptyValidationType));
		}

		#endregion
	}
}


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

namespace Google\Cloud\Retail\V2;

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

/**
 * Auto-complete parameters.
 *
 * Generated from protobuf message google.cloud.retail.v2.CompleteQueryRequest
 */
class CompleteQueryRequest extends \Google\Protobuf\Internal\Message
{
    /**
     * Required. Catalog for which the completion is performed.
     * Full resource name of catalog, such as
     * `projects/*/locations/global/catalogs/default_catalog`.
     *
     * Generated from protobuf field string catalog = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = {
     */
    private $catalog = '';
    /**
     * Required. The query used to generate suggestions.
     * The maximum number of allowed characters is 255.
     *
     * Generated from protobuf field string query = 2 [(.google.api.field_behavior) = REQUIRED];
     */
    private $query = '';
    /**
     * Required field. A unique identifier for tracking visitors. For example,
     * this could be implemented with an HTTP cookie, which should be able to
     * uniquely identify a visitor on a single device. This unique identifier
     * should not change if the visitor logs in or out of the website.
     * The field must be a UTF-8 encoded string with a length limit of 128
     * characters. Otherwise, an INVALID_ARGUMENT error is returned.
     *
     * Generated from protobuf field string visitor_id = 7;
     */
    private $visitor_id = '';
    /**
     * Note that this field applies for `user-data` dataset only. For requests
     * with `cloud-retail` dataset, setting this field has no effect.
     * The language filters applied to the output suggestions. If set, it should
     * contain the language of the query. If not set, suggestions are returned
     * without considering language restrictions. This is the BCP-47 language
     * code, such as "en-US" or "sr-Latn". For more information, see [Tags for
     * Identifying Languages](https://tools.ietf.org/html/bcp47). The maximum
     * number of language codes is 3.
     *
     * Generated from protobuf field repeated string language_codes = 3;
     */
    private $language_codes;
    /**
     * The device type context for completion suggestions.
     * It is useful to apply different suggestions on different device types, e.g.
     * `DESKTOP`, `MOBILE`. If it is empty, the suggestions are across all device
     * types.
     * Supported formats:
     * * `UNKNOWN_DEVICE_TYPE`
     * * `DESKTOP`
     * * `MOBILE`
     * * A customized string starts with `OTHER_`, e.g. `OTHER_IPHONE`.
     *
     * Generated from protobuf field string device_type = 4;
     */
    private $device_type = '';
    /**
     * Determines which dataset to use for fetching completion. "user-data" will
     * use the imported dataset through
     * [CompletionService.ImportCompletionData][google.cloud.retail.v2.CompletionService.ImportCompletionData].
     * "cloud-retail" will use the dataset generated by cloud retail based on user
     * events. If leave empty, it will use the "user-data".
     * Current supported values:
     * * user-data
     * * cloud-retail:
     *   This option requires enabling auto-learning function first. See
     *   [guidelines](https://cloud.google.com/retail/docs/completion-overview#generated-completion-dataset).
     *
     * Generated from protobuf field string dataset = 6;
     */
    private $dataset = '';
    /**
     * Completion max suggestions. If left unset or set to 0, then will fallback
     * to the configured value
     * [CompletionConfig.max_suggestions][google.cloud.retail.v2.CompletionConfig.max_suggestions].
     * The maximum allowed max suggestions is 20. If it is set higher, it will be
     * capped by 20.
     *
     * Generated from protobuf field int32 max_suggestions = 5;
     */
    private $max_suggestions = 0;

    /**
     * Constructor.
     *
     * @param array $data {
     *     Optional. Data for populating the Message object.
     *
     *     @type string $catalog
     *           Required. Catalog for which the completion is performed.
     *           Full resource name of catalog, such as
     *           `projects/*/locations/global/catalogs/default_catalog`.
     *     @type string $query
     *           Required. The query used to generate suggestions.
     *           The maximum number of allowed characters is 255.
     *     @type string $visitor_id
     *           Required field. A unique identifier for tracking visitors. For example,
     *           this could be implemented with an HTTP cookie, which should be able to
     *           uniquely identify a visitor on a single device. This unique identifier
     *           should not change if the visitor logs in or out of the website.
     *           The field must be a UTF-8 encoded string with a length limit of 128
     *           characters. Otherwise, an INVALID_ARGUMENT error is returned.
     *     @type array<string>|\Google\Protobuf\Internal\RepeatedField $language_codes
     *           Note that this field applies for `user-data` dataset only. For requests
     *           with `cloud-retail` dataset, setting this field has no effect.
     *           The language filters applied to the output suggestions. If set, it should
     *           contain the language of the query. If not set, suggestions are returned
     *           without considering language restrictions. This is the BCP-47 language
     *           code, such as "en-US" or "sr-Latn". For more information, see [Tags for
     *           Identifying Languages](https://tools.ietf.org/html/bcp47). The maximum
     *           number of language codes is 3.
     *     @type string $device_type
     *           The device type context for completion suggestions.
     *           It is useful to apply different suggestions on different device types, e.g.
     *           `DESKTOP`, `MOBILE`. If it is empty, the suggestions are across all device
     *           types.
     *           Supported formats:
     *           * `UNKNOWN_DEVICE_TYPE`
     *           * `DESKTOP`
     *           * `MOBILE`
     *           * A customized string starts with `OTHER_`, e.g. `OTHER_IPHONE`.
     *     @type string $dataset
     *           Determines which dataset to use for fetching completion. "user-data" will
     *           use the imported dataset through
     *           [CompletionService.ImportCompletionData][google.cloud.retail.v2.CompletionService.ImportCompletionData].
     *           "cloud-retail" will use the dataset generated by cloud retail based on user
     *           events. If leave empty, it will use the "user-data".
     *           Current supported values:
     *           * user-data
     *           * cloud-retail:
     *             This option requires enabling auto-learning function first. See
     *             [guidelines](https://cloud.google.com/retail/docs/completion-overview#generated-completion-dataset).
     *     @type int $max_suggestions
     *           Completion max suggestions. If left unset or set to 0, then will fallback
     *           to the configured value
     *           [CompletionConfig.max_suggestions][google.cloud.retail.v2.CompletionConfig.max_suggestions].
     *           The maximum allowed max suggestions is 20. If it is set higher, it will be
     *           capped by 20.
     * }
     */
    public function __construct($data = NULL) {
        \GPBMetadata\Google\Cloud\Retail\V2\CompletionService::initOnce();
        parent::__construct($data);
    }

    /**
     * Required. Catalog for which the completion is performed.
     * Full resource name of catalog, such as
     * `projects/*/locations/global/catalogs/default_catalog`.
     *
     * Generated from protobuf field string catalog = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = {
     * @return string
     */
    public function getCatalog()
    {
        return $this->catalog;
    }

    /**
     * Required. Catalog for which the completion is performed.
     * Full resource name of catalog, such as
     * `projects/*/locations/global/catalogs/default_catalog`.
     *
     * Generated from protobuf field string catalog = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = {
     * @param string $var
     * @return $this
     */
    public function setCatalog($var)
    {
        GPBUtil::checkString($var, True);
        $this->catalog = $var;

        return $this;
    }

    /**
     * Required. The query used to generate suggestions.
     * The maximum number of allowed characters is 255.
     *
     * Generated from protobuf field string query = 2 [(.google.api.field_behavior) = REQUIRED];
     * @return string
     */
    public function getQuery()
    {
        return $this->query;
    }

    /**
     * Required. The query used to generate suggestions.
     * The maximum number of allowed characters is 255.
     *
     * Generated from protobuf field string query = 2 [(.google.api.field_behavior) = REQUIRED];
     * @param string $var
     * @return $this
     */
    public function setQuery($var)
    {
        GPBUtil::checkString($var, True);
        $this->query = $var;

        return $this;
    }

    /**
     * Required field. A unique identifier for tracking visitors. For example,
     * this could be implemented with an HTTP cookie, which should be able to
     * uniquely identify a visitor on a single device. This unique identifier
     * should not change if the visitor logs in or out of the website.
     * The field must be a UTF-8 encoded string with a length limit of 128
     * characters. Otherwise, an INVALID_ARGUMENT error is returned.
     *
     * Generated from protobuf field string visitor_id = 7;
     * @return string
     */
    public function getVisitorId()
    {
        return $this->visitor_id;
    }

    /**
     * Required field. A unique identifier for tracking visitors. For example,
     * this could be implemented with an HTTP cookie, which should be able to
     * uniquely identify a visitor on a single device. This unique identifier
     * should not change if the visitor logs in or out of the website.
     * The field must be a UTF-8 encoded string with a length limit of 128
     * characters. Otherwise, an INVALID_ARGUMENT error is returned.
     *
     * Generated from protobuf field string visitor_id = 7;
     * @param string $var
     * @return $this
     */
    public function setVisitorId($var)
    {
        GPBUtil::checkString($var, True);
        $this->visitor_id = $var;

        return $this;
    }

    /**
     * Note that this field applies for `user-data` dataset only. For requests
     * with `cloud-retail` dataset, setting this field has no effect.
     * The language filters applied to the output suggestions. If set, it should
     * contain the language of the query. If not set, suggestions are returned
     * without considering language restrictions. This is the BCP-47 language
     * code, such as "en-US" or "sr-Latn". For more information, see [Tags for
     * Identifying Languages](https://tools.ietf.org/html/bcp47). The maximum
     * number of language codes is 3.
     *
     * Generated from protobuf field repeated string language_codes = 3;
     * @return \Google\Protobuf\Internal\RepeatedField
     */
    public function getLanguageCodes()
    {
        return $this->language_codes;
    }

    /**
     * Note that this field applies for `user-data` dataset only. For requests
     * with `cloud-retail` dataset, setting this field has no effect.
     * The language filters applied to the output suggestions. If set, it should
     * contain the language of the query. If not set, suggestions are returned
     * without considering language restrictions. This is the BCP-47 language
     * code, such as "en-US" or "sr-Latn". For more information, see [Tags for
     * Identifying Languages](https://tools.ietf.org/html/bcp47). The maximum
     * number of language codes is 3.
     *
     * Generated from protobuf field repeated string language_codes = 3;
     * @param array<string>|\Google\Protobuf\Internal\RepeatedField $var
     * @return $this
     */
    public function setLanguageCodes($var)
    {
        $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::STRING);
        $this->language_codes = $arr;

        return $this;
    }

    /**
     * The device type context for completion suggestions.
     * It is useful to apply different suggestions on different device types, e.g.
     * `DESKTOP`, `MOBILE`. If it is empty, the suggestions are across all device
     * types.
     * Supported formats:
     * * `UNKNOWN_DEVICE_TYPE`
     * * `DESKTOP`
     * * `MOBILE`
     * * A customized string starts with `OTHER_`, e.g. `OTHER_IPHONE`.
     *
     * Generated from protobuf field string device_type = 4;
     * @return string
     */
    public function getDeviceType()
    {
        return $this->device_type;
    }

    /**
     * The device type context for completion suggestions.
     * It is useful to apply different suggestions on different device types, e.g.
     * `DESKTOP`, `MOBILE`. If it is empty, the suggestions are across all device
     * types.
     * Supported formats:
     * * `UNKNOWN_DEVICE_TYPE`
     * * `DESKTOP`
     * * `MOBILE`
     * * A customized string starts with `OTHER_`, e.g. `OTHER_IPHONE`.
     *
     * Generated from protobuf field string device_type = 4;
     * @param string $var
     * @return $this
     */
    public function setDeviceType($var)
    {
        GPBUtil::checkString($var, True);
        $this->device_type = $var;

        return $this;
    }

    /**
     * Determines which dataset to use for fetching completion. "user-data" will
     * use the imported dataset through
     * [CompletionService.ImportCompletionData][google.cloud.retail.v2.CompletionService.ImportCompletionData].
     * "cloud-retail" will use the dataset generated by cloud retail based on user
     * events. If leave empty, it will use the "user-data".
     * Current supported values:
     * * user-data
     * * cloud-retail:
     *   This option requires enabling auto-learning function first. See
     *   [guidelines](https://cloud.google.com/retail/docs/completion-overview#generated-completion-dataset).
     *
     * Generated from protobuf field string dataset = 6;
     * @return string
     */
    public function getDataset()
    {
        return $this->dataset;
    }

    /**
     * Determines which dataset to use for fetching completion. "user-data" will
     * use the imported dataset through
     * [CompletionService.ImportCompletionData][google.cloud.retail.v2.CompletionService.ImportCompletionData].
     * "cloud-retail" will use the dataset generated by cloud retail based on user
     * events. If leave empty, it will use the "user-data".
     * Current supported values:
     * * user-data
     * * cloud-retail:
     *   This option requires enabling auto-learning function first. See
     *   [guidelines](https://cloud.google.com/retail/docs/completion-overview#generated-completion-dataset).
     *
     * Generated from protobuf field string dataset = 6;
     * @param string $var
     * @return $this
     */
    public function setDataset($var)
    {
        GPBUtil::checkString($var, True);
        $this->dataset = $var;

        return $this;
    }

    /**
     * Completion max suggestions. If left unset or set to 0, then will fallback
     * to the configured value
     * [CompletionConfig.max_suggestions][google.cloud.retail.v2.CompletionConfig.max_suggestions].
     * The maximum allowed max suggestions is 20. If it is set higher, it will be
     * capped by 20.
     *
     * Generated from protobuf field int32 max_suggestions = 5;
     * @return int
     */
    public function getMaxSuggestions()
    {
        return $this->max_suggestions;
    }

    /**
     * Completion max suggestions. If left unset or set to 0, then will fallback
     * to the configured value
     * [CompletionConfig.max_suggestions][google.cloud.retail.v2.CompletionConfig.max_suggestions].
     * The maximum allowed max suggestions is 20. If it is set higher, it will be
     * capped by 20.
     *
     * Generated from protobuf field int32 max_suggestions = 5;
     * @param int $var
     * @return $this
     */
    public function setMaxSuggestions($var)
    {
        GPBUtil::checkInt32($var);
        $this->max_suggestions = $var;

        return $this;
    }

}


text:
using System;
using System.Windows.Forms;

namespace SortingVisualizer
{
    static class Program
    {
        /// <summary>
        /// The main entry point for the application.
        /// </summary>
        [STAThread]
        static void Main()
        {
            Application.EnableVisualStyles();
            Application.SetCompatibleTextRenderingDefault(false);
            Application.Run(new Form1());
        }
    }
}


text:
using System;
using System.Threading.Tasks;
using Microsoft.Extensions.Logging.Abstractions;
using Microsoft.WindowsAzure.Storage.Table;
using Microsoft.Extensions.Configuration;
using Orleans.Runtime;
using Orleans.Hosting;
using Orleans;
using Orleans.Configuration;
using Orleans.Runtime.Configuration;
using Orleans.Streaming.EventHubs;
using Orleans.TestingHost;
using Tester.TestStreamProviders;
using ServiceBus.Tests.TestStreamProviders.EventHub;
using Tester.StreamingTests;
using TestExtensions;
using Xunit;
using Xunit.Abstractions;
using Orleans.Streams;
using Orleans.ServiceBus.Providers;
using Tester;
using Microsoft.Extensions.DependencyInjection.Extensions;

namespace ServiceBus.Tests.StreamingTests
{
    [TestCategory("EventHub"), TestCategory("Streaming"), TestCategory("Functional")]
    public class EHClientStreamTests : TestClusterPerTest
    {
        private const string StreamProviderName = "EventHubStreamProvider";
        private const string StreamNamespace = "StreamNamespace";
        private const string EHPath = "ehorleanstest";
        private const string EHConsumerGroup = "orleansnightly";

        private readonly ITestOutputHelper output;
        private readonly ClientStreamTestRunner runner;
        public EHClientStreamTests(ITestOutputHelper output)
        {
            this.output = output;
            runner = new ClientStreamTestRunner(this.HostedCluster);
        }

        protected override void ConfigureTestCluster(TestClusterBuilder builder)
        {
            TestUtils.CheckForEventHub();
            builder.AddSiloBuilderConfigurator<MySiloBuilderConfigurator>();
            builder.AddClientBuilderConfigurator<MyClientBuilderConfigurator>();
        }

        private class MySiloBuilderConfigurator : ISiloBuilderConfigurator
        {
            public void Configure(ISiloHostBuilder hostBuilder)
            {
                hostBuilder
                    .AddPersistentStreams(StreamProviderName, TestEventHubStreamAdapterFactory.Create, b=>
                    {
                        b.Configure<SiloMessagingOptions>(ob => ob.Configure(options => options.ClientDropTimeout = TimeSpan.FromSeconds(5)));
                        b.Configure<EventHubOptions>(ob => ob.Configure(options =>
                        {
                            options.ConnectionString = TestDefaultConfiguration.EventHubConnectionString;
                            options.ConsumerGroup = EHConsumerGroup;
                            options.Path = EHPath;
                        }));
                        b.ConfigureComponent<AzureTableStreamCheckpointerOptions, IStreamQueueCheckpointerFactory>(
                            EventHubCheckpointerFactory.CreateFactory,
                            ob => ob.Configure(options =>
                            {
                                options.ConnectionString = TestDefaultConfiguration.DataConnectionString;
                                options.PersistInterval = TimeSpan.FromSeconds(10);
                            }));
                    })
                    .AddMemoryGrainStorage("PubSubStore")
                    .ConfigureServices(services => services.TryAddSingleton<IEventHubDataAdapter, EventHubDataAdapter>());
            }
        }

        private class MyClientBuilderConfigurator : IClientBuilderConfigurator
        {
            public void Configure(IConfiguration configuration, IClientBuilder clientBuilder)
            {
                clientBuilder
                    .AddPersistentStreams(StreamProviderName, TestEventHubStreamAdapterFactory.Create, b=>b
                        .Configure<EventHubOptions>(ob=>ob.Configure(options =>
                        {
                            options.ConnectionString = TestDefaultConfiguration.EventHubConnectionString;
                            options.ConsumerGroup = EHConsumerGroup;
                            options.Path = EHPath;
                        })))
                    .ConfigureServices(services => services.TryAddSingleton<IEventHubDataAdapter, EventHubDataAdapter>());
            }
        }

        [SkippableFact(Skip="https://github.com/dotnet/orleans/issues/5657")]
        public async Task EHStreamProducerOnDroppedClientTest()
        {
            logger.Info("************************ EHStreamProducerOnDroppedClientTest *********************************");
            await runner.StreamProducerOnDroppedClientTest(StreamProviderName, StreamNamespace);
        }

        [SkippableFact(Skip="https://github.com/dotnet/orleans/issues/5634")]
        public async Task EHStreamConsumerOnDroppedClientTest()
        {
            logger.Info("************************ EHStreamConsumerOnDroppedClientTest *********************************");
            await runner.StreamConsumerOnDroppedClientTest(StreamProviderName, StreamNamespace, output,
                    () => TestAzureTableStorageStreamFailureHandler.GetDeliveryFailureCount(StreamProviderName, NullLoggerFactory.Instance), true);
        }
    }
}


text:
package org.wikipedia.dataclient.okhttp;

import android.content.Context;

import androidx.annotation.NonNull;

import com.bumptech.glide.Glide;
import com.bumptech.glide.GlideBuilder;
import com.bumptech.glide.Registry;
import com.bumptech.glide.annotation.GlideModule;
import com.bumptech.glide.integration.okhttp3.OkHttpUrlLoader;
import com.bumptech.glide.load.DecodeFormat;
import com.bumptech.glide.load.model.GlideUrl;
import com.bumptech.glide.module.AppGlideModule;
import com.bumptech.glide.request.RequestOptions;

import java.io.InputStream;

/**
 * NOTE: do not convert this class to Kotlin yet. The Glide annotation does not support it.
 */
@GlideModule
public class OkHttpGlideModule extends AppGlideModule {
    @Override
    public void registerComponents(@NonNull Context context, Glide glide, @NonNull Registry registry) {
        glide.getRegistry().replace(GlideUrl.class, InputStream.class,
                new OkHttpUrlLoader.Factory(OkHttpConnectionFactory.getClient()));
    }

    @Override
    public void applyOptions(@NonNull Context context, @NonNull GlideBuilder builder) {
        builder.setDefaultRequestOptions(new RequestOptions().format(DecodeFormat.PREFER_RGB_565));
    }
}


text:
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
    xmlns:tools="http://schemas.android.com/tools"
    android:layout_width="match_parent"
    android:layout_height="match_parent"
    android:orientation="vertical">

    <com.github.snakeice.realmdroid.scrolltable.IHorizontalScrollView
        android:id="@+id/scroll_header_horizontal"
        android:layout_width="match_parent"
        android:layout_height="@dimen/table_top_title_height"
        android:layout_marginLeft="@dimen/table_left_title_width"
        tools:ignore="RtlHardcoded">

        <com.github.snakeice.realmdroid.scrolltable.TopTitleView
            android:id="@+id/header_horizontal"
            android:layout_width="wrap_content"
            android:layout_height="match_parent"/>

    </com.github.snakeice.realmdroid.scrolltable.IHorizontalScrollView>

    <LinearLayout
        android:layout_width="match_parent"
        android:layout_height="0dp"
        android:layout_weight="1"
        android:orientation="horizontal">

        <com.github.snakeice.realmdroid.scrolltable.VerticalScrollView
            android:id="@+id/scroll_vertical"
            android:layout_width="wrap_content"
            android:layout_height="wrap_content">

            <LinearLayout
                android:layout_width="wrap_content"
                android:layout_height="wrap_content"
                android:orientation="horizontal">

                <com.github.snakeice.realmdroid.scrolltable.LeftTitleView
                    android:id="@+id/header_vertical"
                    android:layout_width="@dimen/table_left_title_width"
                    android:layout_height="wrap_content"
                    android:layout_marginBottom="24dp"/>

                <com.github.snakeice.realmdroid.scrolltable.IHorizontalScrollView
                    android:id="@+id/scroll_horizontal"
                    android:layout_width="match_parent"
                    android:layout_height="match_parent">

                    <com.github.snakeice.realmdroid.scrolltable.CustomTableView
                        android:layout_marginTop="@dimen/table_default_margin_top"
                        android:id="@+id/content_view"
                        android:layout_width="wrap_content"
                        android:layout_height="wrap_content"/>

                </com.github.snakeice.realmdroid.scrolltable.IHorizontalScrollView>
            </LinearLayout>

        </com.github.snakeice.realmdroid.scrolltable.VerticalScrollView>
    </LinearLayout>

</LinearLayout>


text: Data Science Specialization from Johns Hopkins University and Coursera


text: See the [DeepDive tutorial in the documentation](../../doc/example-spouse.md) for full detail.


text:
CREATE TABLE PERSON_APPOINTMENT (
  APPOINTMENT_ID NUMBER NOT NULL,
  PERSON_ID VARCHAR2(40) NOT NULL,
  UNIT_NUMBER VARCHAR2(8) NOT NULL,
  APPOINTMENT_START_DATE DATE,
  APPOINTMENT_END_DATE DATE,
  APPOINTMENT_TYPE_CODE VARCHAR2(3),
  JOB_TITLE VARCHAR2(50),
  PREFERED_JOB_TITLE VARCHAR2(51),
  JOB_CODE VARCHAR2(6) NOT NULL,
  SALARY NUMBER(12,2),
  update_timestamp  date         not null,
  update_user       varchar2 (60) not null,
  VER_NBR NUMBER(8,0) DEFAULT 1 NOT NULL,
  OBJ_ID VARCHAR2(36) NOT NULL
);

ALTER TABLE PERSON_APPOINTMENT ADD CONSTRAINT PERSON_APPOINTMENT_PK PRIMARY KEY (APPOINTMENT_ID);

CREATE SEQUENCE SEQ_PERSON_APPOINTMENT INCREMENT BY 1 START WITH 1000 NOCYCLE;


text:
static int run = -1;

void on_connect(struct mosquitto *mosq, void *obj, int rc)
{
	if(rc){
		exit(1);
	}else{
		mosquitto_disconnect(mosq);
	}
}

void on_disconnect(struct mosquitto *mosq, void *obj, int rc)
{
	run = rc;
}

int main(int argc, char *argv[])
{
	int rc;
	struct mosquitto *mosq;

	mosquitto_lib_init();

	mosq = mosquitto_new("08-ssl-connect-no-auth", true, NULL);
	mosquitto_tls_opts_set(mosq, 1, "tlsv1", NULL);
	//mosquitto_tls_set(mosq, "../ssl/test-root-ca.crt", NULL, NULL, NULL, NULL);
	mosquitto_tls_set(mosq, "../ssl/all-ca.crt", NULL, NULL, NULL, NULL);
	mosquitto_connect_callback_set(mosq, on_connect);
	mosquitto_disconnect_callback_set(mosq, on_disconnect);

	rc = mosquitto_connect(mosq, "localhost", 1888, 60);

	while(run == -1){
		mosquitto_loop(mosq, -1, 1);
	}

	mosquitto_lib_cleanup();
	return run;
}


text:
category: "Volunteering"
icon: "red heart"
title: "Volunteer Mentor, Vets Who Code"
date_string: "2019-2022"
location: "Remote"
order: 2
---
Help servicemembers transition from military to software development roles through the Vets Who Code nonprofit organization.


text:
#include "cairoint.h"

/**
 * cairo_debug_reset_static_data:
 *
 * Resets all static data within cairo to its original state,
 * (ie. identical to the state at the time of program invocation). For
 * example, all caches within cairo will be flushed empty.
 *
 * This function is intended to be useful when using memory-checking
 * tools such as valgrind. When valgrind's memcheck analyzes a
 * cairo-using program without a call to cairo_debug_reset_static_data,
 * it will report all data reachable via cairo's static objects as
 * "still reachable". Calling cairo_debug_reset_static_data just prior
 * to program termination will make it easier to get squeaky clean
 * reports from valgrind.
 *
 * WARNING: It is only safe to call this function when there are no
 * active cairo objects remaining, (ie. the appropriate destroy
 * functions have been called as necessary). If there are active cairo
 * objects, this call is likely to cause a crash, (eg. an assertion
 * failure due to a hash table being destroyed when non-empty).
 **/
void
cairo_debug_reset_static_data (void)
{
#if CAIRO_HAS_XLIB_SURFACE
    _cairo_xlib_surface_reset_static_data ();
    _cairo_xlib_screen_reset_static_data ();
#endif

    _cairo_font_reset_static_data ();

#if CAIRO_HAS_FT_FONT
    _cairo_ft_font_reset_static_data ();
#endif
}


text:
<?xml version="1.0" encoding="UTF-8"?>
<project xmlns="http://maven.apache.org/POM/4.0.0"
         xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
         xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
    <parent>
        <artifactId>hangout-filters</artifactId>
        <groupId>ctrip</groupId>
        <version>0.4.0</version>
    </parent>
    <modelVersion>4.0.0</modelVersion>

    <artifactId>hangout-filters-rename</artifactId>
    <dependencies>
        <dependency>
            <groupId>ctrip</groupId>
            <artifactId>hangout-core</artifactId>
            <version>0.4.0</version>
        </dependency>
    </dependencies>

</project>


text:
// Copyright 2015 Google Inc. All Rights Reserved.
//
// 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.

using Google.Api.Gax;
using Google.Apis.Download;
using System;
using System.IO;
using System.Threading;
using System.Threading.Tasks;
using Object = Google.Apis.Storage.v1.Data.Object;

namespace Google.Storage.V1
{
    public sealed partial class StorageClientImpl : StorageClient
    {
        /// <inheritdoc />
        public override void DownloadObject(
            string bucket,
            string objectName,
            Stream destination,
            DownloadObjectOptions options = null,
            IProgress<IDownloadProgress> progress = null)
        {
            var baseUri = GetBaseUri(bucket, objectName);
            DownloadObjectImpl(baseUri, destination, options, progress);
        }

        /// <inheritdoc />
        public override Task DownloadObjectAsync(
            string bucket,
            string objectName,
            Stream destination,
            DownloadObjectOptions options = null,
            CancellationToken cancellationToken = default(CancellationToken),
            IProgress<IDownloadProgress> progress = null)
        {
            var baseUri = GetBaseUri(bucket, objectName);
            return DownloadObjectAsyncImpl(baseUri, destination, options, cancellationToken, progress);
        }

        /// <inheritdoc />
        public override void DownloadObject(
            Object source,
            Stream destination,
            DownloadObjectOptions options = null,
            IProgress<IDownloadProgress> progress = null)
        {
            var baseUri = GetBaseUri(source);
            DownloadObjectImpl(baseUri, destination, options, progress);
        }

        /// <inheritdoc />
        public override Task DownloadObjectAsync(
            Object source,
            Stream destination,
            DownloadObjectOptions options = null,
            CancellationToken cancellationToken = default(CancellationToken),
            IProgress<IDownloadProgress> progress = null)
        {
            var baseUri = GetBaseUri(source);
            return DownloadObjectAsyncImpl(baseUri, destination, options, cancellationToken, progress);
        }

        /// <summary>
        /// Constructs the media URL of an object from its bucket and name. This does not include the generation
        /// or any GaxPreconditions. The returned string will always have a query parameter, so later query parameters
        /// can unconditionally be appended with an "&" prefix.
        /// </summary>
        private static string GetBaseUri(string bucket, string objectName)
        {
            ValidateBucketName(bucket);
            GaxPreconditions.CheckNotNull(objectName, nameof(objectName));
            return $"https://www.googleapis.com/download/storage/v1/b/{bucket}/o/{Uri.EscapeDataString(objectName)}?alt=media";
        }

        /// <summary>
        /// Obtains the media URL of an object from its bucket and name.
        /// The returned string will always have a query parameter, so later query parameters
        /// can unconditionally be appended with an "&" prefix.
        /// </summary>
        private string GetBaseUri(Object source)
        {
            ValidateObject(source, nameof(source));
            return GetBaseUri(source.Bucket, source.Name);
        }

        private void DownloadObjectImpl(
            string baseUri,
            Stream destination,
            DownloadObjectOptions options,
            IProgress<IDownloadProgress> progress)
        {
            // URI will definitely not be null; that's constructed internally.
            GaxPreconditions.CheckNotNull(destination, nameof(destination));
            var downloader = new MediaDownloader(Service);
            options?.ModifyDownloader(downloader);
            string uri = options == null ? baseUri : options.GetUri(baseUri);
            if (progress != null)
            {
                downloader.ProgressChanged += progress.Report;
                progress.Report(InitialDownloadProgress.Instance);
            }
            var result = downloader.Download(uri, destination);
            if (result.Status == DownloadStatus.Failed)
            {
                throw result.Exception;
            }
        }

        private async Task DownloadObjectAsyncImpl(
            string baseUri,
            Stream destination,
            DownloadObjectOptions options,
            CancellationToken cancellationToken,
            IProgress<IDownloadProgress> progress)
        {
            GaxPreconditions.CheckNotNull(destination, nameof(destination));
            var downloader = new MediaDownloader(Service);
            options?.ModifyDownloader(downloader);
            string uri = options == null ? baseUri : options.GetUri(baseUri);
            if (progress != null)
            {
                downloader.ProgressChanged += progress.Report;
                // Avoid reporting progress synchronously in the original call.
                await Task.Yield();
                progress.Report(InitialDownloadProgress.Instance);
            }
            var result = await downloader.DownloadAsync(uri, destination, cancellationToken).ConfigureAwait(false);
            if (result.Status == DownloadStatus.Failed)
            {
                throw result.Exception;
            }
        }

        // MediaDownloader doesn't report progress until the first chunk has been fetched. It can be useful to
        // report a status of "not started" immediately. This implementation of IDownloadProgress does that.
        private sealed class InitialDownloadProgress : IDownloadProgress
        {
            internal static readonly IDownloadProgress Instance = new InitialDownloadProgress();

            public long BytesDownloaded => 0;
            public Exception Exception => null;
            public DownloadStatus Status => DownloadStatus.NotStarted;
        }
    }
}


text:
namespace lslboost { namespace mpl {

template<
      typename Tag1
    , typename Tag2
    >
struct divides_impl
    : if_c<
          ( BOOST_MPL_AUX_NESTED_VALUE_WKND(int, Tag1)
              > BOOST_MPL_AUX_NESTED_VALUE_WKND(int, Tag2)
            )

        , aux::cast2nd_impl< divides_impl< Tag1,Tag1 >,Tag1, Tag2 >
        , aux::cast1st_impl< divides_impl< Tag2,Tag2 >,Tag1, Tag2 >
        >::type
{
};

/// for Digital Mars C++/compilers with no CTPS/TTP support
template<> struct divides_impl< na,na >
{
    template< typename U1, typename U2 > struct apply
    {
        typedef apply type;
        BOOST_STATIC_CONSTANT(int, value  = 0);
    };
};

template< typename Tag > struct divides_impl< na,Tag >
{
    template< typename U1, typename U2 > struct apply
    {
        typedef apply type;
        BOOST_STATIC_CONSTANT(int, value  = 0);
    };
};

template< typename Tag > struct divides_impl< Tag,na >
{
    template< typename U1, typename U2 > struct apply
    {
        typedef apply type;
        BOOST_STATIC_CONSTANT(int, value  = 0);
    };
};

template< typename T > struct divides_tag
{
    typedef typename T::tag type;
};

template<
      typename BOOST_MPL_AUX_NA_PARAM(N1)
    , typename BOOST_MPL_AUX_NA_PARAM(N2)
    , typename N3 = na, typename N4 = na, typename N5 = na
    >
struct divides
    : divides< divides< divides< divides< N1,N2 >, N3>, N4>, N5>
{
};

template<
      typename N1, typename N2, typename N3, typename N4
    >
struct divides< N1,N2,N3,N4,na >

    : divides< divides< divides< N1,N2 >, N3>, N4>
{
    BOOST_MPL_AUX_LAMBDA_SUPPORT_SPEC(
          5
        , divides
        , ( N1, N2, N3, N4, na )
        )
};

template<
      typename N1, typename N2, typename N3
    >
struct divides< N1,N2,N3,na,na >

    : divides< divides< N1,N2 >, N3>
{
    BOOST_MPL_AUX_LAMBDA_SUPPORT_SPEC(
          5
        , divides
        , ( N1, N2, N3, na, na )
        )
};

template<
      typename N1, typename N2
    >
struct divides< N1,N2,na,na,na >
    : divides_impl<
          typename divides_tag<N1>::type
        , typename divides_tag<N2>::type
        >::template apply< N1,N2 >::type
{
    BOOST_MPL_AUX_LAMBDA_SUPPORT_SPEC(
          5
        , divides
        , ( N1, N2, na, na, na )
        )

};

BOOST_MPL_AUX_NA_SPEC2(2, 5, divides)

}}

namespace lslboost { namespace mpl {
template<>
struct divides_impl< integral_c_tag,integral_c_tag >
{
    template< typename N1, typename N2 > struct apply

        : integral_c<
              typename aux::largest_int<
                  typename N1::value_type
                , typename N2::value_type
                >::type
            , ( BOOST_MPL_AUX_VALUE_WKND(N1)::value
                  / BOOST_MPL_AUX_VALUE_WKND(N2)::value
                )
            >
    {
    };
};

}}


text:
class RemoveWinningCardFromGame < ActiveRecord::Migration
  def up
    remove_column :games, :winning_card_id
  end

  def down
    add_column :games, :winning_card_id, :integer
  end
end


text: {{:: 'page-not-found.instruction' | translate}}


text:
package sarama

import (
	"fmt"
	"time"
)

type ConfigSource int8

func (s ConfigSource) String() string {
	switch s {
	case SourceUnknown:
		return "Unknown"
	case SourceTopic:
		return "Topic"
	case SourceDynamicBroker:
		return "DynamicBroker"
	case SourceDynamicDefaultBroker:
		return "DynamicDefaultBroker"
	case SourceStaticBroker:
		return "StaticBroker"
	case SourceDefault:
		return "Default"
	}
	return fmt.Sprintf("Source Invalid: %d", int(s))
}

const (
	SourceUnknown ConfigSource = iota
	SourceTopic
	SourceDynamicBroker
	SourceDynamicDefaultBroker
	SourceStaticBroker
	SourceDefault
)

type DescribeConfigsResponse struct {
	Version      int16
	ThrottleTime time.Duration
	Resources    []*ResourceResponse
}

type ResourceResponse struct {
	ErrorCode int16
	ErrorMsg  string
	Type      ConfigResourceType
	Name      string
	Configs   []*ConfigEntry
}

type ConfigEntry struct {
	Name      string
	Value     string
	ReadOnly  bool
	Default   bool
	Source    ConfigSource
	Sensitive bool
	Synonyms  []*ConfigSynonym
}

type ConfigSynonym struct {
	ConfigName  string
	ConfigValue string
	Source      ConfigSource
}

func (r *DescribeConfigsResponse) encode(pe packetEncoder) (err error) {
	pe.putInt32(int32(r.ThrottleTime / time.Millisecond))
	if err = pe.putArrayLength(len(r.Resources)); err != nil {
		return err
	}

	for _, c := range r.Resources {
		if err = c.encode(pe, r.Version); err != nil {
			return err
		}
	}

	return nil
}

func (r *DescribeConfigsResponse) decode(pd packetDecoder, version int16) (err error) {
	r.Version = version
	throttleTime, err := pd.getInt32()
	if err != nil {
		return err
	}
	r.ThrottleTime = time.Duration(throttleTime) * time.Millisecond

	n, err := pd.getArrayLength()
	if err != nil {
		return err
	}

	r.Resources = make([]*ResourceResponse, n)
	for i := 0; i < n; i++ {
		rr := &ResourceResponse{}
		if err := rr.decode(pd, version); err != nil {
			return err
		}
		r.Resources[i] = rr
	}

	return nil
}

func (r *DescribeConfigsResponse) key() int16 {
	return 32
}

func (r *DescribeConfigsResponse) version() int16 {
	return r.Version
}

func (r *DescribeConfigsResponse) headerVersion() int16 {
	return 0
}

func (r *DescribeConfigsResponse) requiredVersion() KafkaVersion {
	switch r.Version {
	case 1:
		return V1_0_0_0
	case 2:
		return V2_0_0_0
	default:
		return V0_11_0_0
	}
}

func (r *ResourceResponse) encode(pe packetEncoder, version int16) (err error) {
	pe.putInt16(r.ErrorCode)

	if err = pe.putString(r.ErrorMsg); err != nil {
		return err
	}

	pe.putInt8(int8(r.Type))

	if err = pe.putString(r.Name); err != nil {
		return err
	}

	if err = pe.putArrayLength(len(r.Configs)); err != nil {
		return err
	}

	for _, c := range r.Configs {
		if err = c.encode(pe, version); err != nil {
			return err
		}
	}
	return nil
}

func (r *ResourceResponse) decode(pd packetDecoder, version int16) (err error) {
	ec, err := pd.getInt16()
	if err != nil {
		return err
	}
	r.ErrorCode = ec

	em, err := pd.getString()
	if err != nil {
		return err
	}
	r.ErrorMsg = em

	t, err := pd.getInt8()
	if err != nil {
		return err
	}
	r.Type = ConfigResourceType(t)

	name, err := pd.getString()
	if err != nil {
		return err
	}
	r.Name = name

	n, err := pd.getArrayLength()
	if err != nil {
		return err
	}

	r.Configs = make([]*ConfigEntry, n)
	for i := 0; i < n; i++ {
		c := &ConfigEntry{}
		if err := c.decode(pd, version); err != nil {
			return err
		}
		r.Configs[i] = c
	}
	return nil
}

func (r *ConfigEntry) encode(pe packetEncoder, version int16) (err error) {
	if err = pe.putString(r.Name); err != nil {
		return err
	}

	if err = pe.putString(r.Value); err != nil {
		return err
	}

	pe.putBool(r.ReadOnly)

	if version <= 0 {
		pe.putBool(r.Default)
		pe.putBool(r.Sensitive)
	} else {
		pe.putInt8(int8(r.Source))
		pe.putBool(r.Sensitive)

		if err := pe.putArrayLength(len(r.Synonyms)); err != nil {
			return err
		}
		for _, c := range r.Synonyms {
			if err = c.encode(pe, version); err != nil {
				return err
			}
		}
	}

	return nil
}

// https://cwiki.apache.org/confluence/display/KAFKA/KIP-226+-+Dynamic+Broker+Configuration
func (r *ConfigEntry) decode(pd packetDecoder, version int16) (err error) {
	if version == 0 {
		r.Source = SourceUnknown
	}
	name, err := pd.getString()
	if err != nil {
		return err
	}
	r.Name = name

	value, err := pd.getString()
	if err != nil {
		return err
	}
	r.Value = value

	read, err := pd.getBool()
	if err != nil {
		return err
	}
	r.ReadOnly = read

	if version == 0 {
		defaultB, err := pd.getBool()
		if err != nil {
			return err
		}
		r.Default = defaultB
		if defaultB {
			r.Source = SourceDefault
		}
	} else {
		source, err := pd.getInt8()
		if err != nil {
			return err
		}
		r.Source = ConfigSource(source)
		r.Default = r.Source == SourceDefault
	}

	sensitive, err := pd.getBool()
	if err != nil {
		return err
	}
	r.Sensitive = sensitive

	if version > 0 {
		n, err := pd.getArrayLength()
		if err != nil {
			return err
		}
		r.Synonyms = make([]*ConfigSynonym, n)

		for i := 0; i < n; i++ {
			s := &ConfigSynonym{}
			if err := s.decode(pd, version); err != nil {
				return err
			}
			r.Synonyms[i] = s
		}
	}
	return nil
}

func (c *ConfigSynonym) encode(pe packetEncoder, version int16) (err error) {
	err = pe.putString(c.ConfigName)
	if err != nil {
		return err
	}

	err = pe.putString(c.ConfigValue)
	if err != nil {
		return err
	}

	pe.putInt8(int8(c.Source))

	return nil
}

func (c *ConfigSynonym) decode(pd packetDecoder, version int16) error {
	name, err := pd.getString()
	if err != nil {
		return err
	}
	c.ConfigName = name

	value, err := pd.getString()
	if err != nil {
		return err
	}
	c.ConfigValue = value

	source, err := pd.getInt8()
	if err != nil {
		return err
	}
	c.Source = ConfigSource(source)
	return nil
}


text:
[![Gem Version](https://badge.fury.io/rb/wamp_rails.svg)](https://badge.fury.io/rb/wamp_rails)
[![Circle CI](https://circleci.com/gh/ericchapman/ruby_wamp_rails/tree/master.svg?&style=shield&circle-token=87db2e55d2e79a174739f61f7ce42c1351533598)](https://circleci.com/gh/ericchapman/ruby_wamp_rails/tree/master)
[![Codecov](https://img.shields.io/codecov/c/github/ericchapman/ruby_wamp_rails/master.svg)](https://codecov.io/github/ericchapman/ruby_wamp_rails)

This library allows the GEM [wamp_client](https://github.com/ericchapman/ruby_wamp_client)
to be integrated into a Rails application.

The 'wamp_client' GEM uses the Event Machine implementation of Web Sockets to
connect to the WAMP router.  This requires the Rails application to spin off
an independent thread where the EM reactor will run.

The library also wraps the connection logic under the library so that the
Rails application doesn't need to handle it.

All calls to the library are implemented as "commands".  When a call is made to
the client, the library will create a command and do the following

 - If the thread is the same thread as the EM reactor, it will immediately
   execute the command
 - Else place the command into the queue that the reactor will check on every
   tick

This ensures that the Rails application does not need to worry about the thread.

This however has the side effect where all calls to the library are executed
synchronously (they will block the current thread) unless the callback is nil.

## Revision History

 - v0.0.2:
   - Added 'routes' to the client
 - v0.0.1:
   - Initial Revision

## Installation

Add this line to your application's Gemfile:

```ruby
gem 'wamp_rails'
```

And then execute:

    $ bundle

Or install it yourself as:

    $ gem install wamp_rails

## Usage

### Connection

The client is initialized as shown below.  The options are the same as
'wamp_client' with the addition of the 'name' option which is used for
logging.

``` ruby
options = {
  name: 'main router',
  uri: 'ws://router.example.com,
  realm: 'realm1'
}

wamp_client = WampRails::Client.new(options)
wamp_client.open
```

### Commands

The client currently supports the following commands from the WampClient library

 - call
 - publish
 - register
 - subscribe

The methods have the same parameters as the WampClient library

### Controllers

The 'register' and 'subscribe' commands require 'handlers' to be implemented.
In order to ensure thread safety and consistency with Rails, the handlers
are implemented as 'controller' classes.

When a call or publish is received, the library will instantiate the supplied
class with following methods available

 - args (Array) - The arguments
 - kwargs (Hash) - The keyword arguments
 - details (Hash) - The details
 - client [WampRails::Client) - The client.  This can be used if the
   handler needs to send a Wamp message

#### Procedure
To create a register controller, create a class that subclasses from
'WampRails::Controller::Procedure' and implements 'handler'.  See below

``` ruby
class MyRegisterController < WampRails:::Controller::Procedure

  def handler
    the_args = self.args
    the_kwargs = self.kwargs
    the_details = self.details
    the_client = self.client

    # Do Something

    # Return the result (see WampClient for more details on implementing procedures)
    true
  end

end
```

#### Subscription
To create a subscribe controller, create a class that subclasses from
'WampRails::Controller::Subscription' and implements 'handler'.  See below

``` ruby
class MySubscribeController < WampRails:::Controller::Subscription

  def handler
    the_args = self.args
    the_kwargs = self.kwargs
    the_details = self.details
    the_client = self.client

    # Do Something

  end

end
```

#### Routes

Routes are created using the 'routes' block.  This must be called BEFORE
'open'.  Below is an example

``` ruby
options = {
  uri: 'ws://router.example.com,
  realm: 'realm1'
}

wamp_client = WampRails::Client.new(options)

# Configure the Routes
wamp_client.routes do
  add_subscription 'topic', MySubscriptionClass
  add_subscription 'topic.*', MyWildcardSubscriptionClass, {wildcard: true}

  add_procedure 'procedure.', MyPrefixProcedureClass, {prefix: true}
end

wamp_client.open
```

When 'routes' is used, the client object will automatically re-register/subscribe
to the procedures/topics on reconnect.  Otherwise if 'register' or 'subscribe'
are going to be called directly, then the system must wait for the connection
to become active by calling

``` ruby
wamp_client.wait_for_active
```


text:
var Component = new Brick.Component();
Component.requires = {
    yahoo: ['colorpicker'],
    mod: [
        {name: 'sys', files: ['container.js']}
    ]
};
Component.entryPoint = function(NS){

    var L = YAHOO.lang,
        API = NS.API,
        buildTemplate = this.buildTemplate;

    var ColorPickerPanel = function(color, callback){
        this.color = color;
        this.callback = callback;
        ColorPickerPanel.superclass.constructor.call(this, {
            width: '450px',
            height: '280px',
            fixedcenter: true,
            overflow: false
        });
    };
    YAHOO.extend(ColorPickerPanel, Brick.widget.Dialog, {
        initTemplate: function(){
            buildTemplate(this, 'panel');
            return this._TM.replace('panel');
        },
        onLoad: function(){
            var TM = this._TM;

            this.picker = new YAHOO.widget.ColorPicker(TM.getEl('panel.picker'), {
                images: {
                    PICKER_THUMB: "/modules/pictab/i/picker_thumb.png",
                    HUE_THUMB: "/modules/pictab/i/hue_thumb.png"
                }
            });

            this.picker.setValue(YAHOO.util.Color.hex2rgb(this.color));

            var __self = this;
            this.picker.on("rgbChange", function(o){
                __self.color = YAHOO.util.Color.rgb2hex(o.newValue);
            });
        },
        destroy: function(){
            ColorPickerPanel.superclass.destroy.call(this);
        },
        onClick: function(el){
            var tp = this._TId['panel'];
            switch (el.id) {
                case tp['bselect']:
                    this.selectColor();
                    return true;
                case tp['bcancel']:
                    this.close();
                    return true;
            }
            return false;
        },
        selectColor: function(){
            if (L.isFunction(this.callback)){
                this.callback(this.color);
            }
            this.close();
        }
    });
    NS.ColorPickerPanel = ColorPickerPanel;

};