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

#include "chromeos/network/managed_network_configuration_handler.h"

#include "base/memory/ptr_util.h"
#include "base/values.h"
#include "chromeos/network/managed_network_configuration_handler_impl.h"
#include "chromeos/network/network_ui_data.h"
#include "chromeos/network/onc/onc_utils.h"
#include "third_party/cros_system_api/dbus/service_constants.h"

namespace chromeos {

ManagedNetworkConfigurationHandler::~ManagedNetworkConfigurationHandler() =
    default;

// static
std::unique_ptr<ManagedNetworkConfigurationHandler>
ManagedNetworkConfigurationHandler::InitializeForTesting(
    NetworkStateHandler* network_state_handler,
    NetworkProfileHandler* network_profile_handler,
    NetworkDeviceHandler* network_device_handler,
    NetworkConfigurationHandler* network_configuration_handler,
    UIProxyConfigService* ui_proxy_config_service) {
  auto* handler = new ManagedNetworkConfigurationHandlerImpl();
  handler->Init(network_state_handler, network_profile_handler,
                network_configuration_handler, network_device_handler,
                /*prohibitied_technologies_handler=*/nullptr);
  handler->set_ui_proxy_config_service(ui_proxy_config_service);
  return base::WrapUnique(handler);
}

}  // namespace chromeos

redpajama_set_name: RedPajamaGithub


text:
namespace Fixtures.AdditionalProperties
{
    using Models;
    using Newtonsoft.Json;

    /// <summary>
    /// **This example has a working backend hosted in Heroku**
    ///
    /// </summary>
    public partial interface IPetStoreonHeroku : System.IDisposable
    {
        /// <summary>
        /// The base URI of the service.
        /// </summary>
        System.Uri BaseUri { get; set; }

        /// <summary>
        /// Gets or sets json serialization settings.
        /// </summary>
        JsonSerializerSettings SerializationSettings { get; }

        /// <summary>
        /// Gets or sets json deserialization settings.
        /// </summary>
        JsonSerializerSettings DeserializationSettings { get; }

        /// <summary>
        /// Gets the IGet.
        /// </summary>
        IGet Get { get; }

        /// <summary>
        /// Gets the IPost.
        /// </summary>
        IPost Post { get; }

        /// <summary>
        /// Gets the IPut.
        /// </summary>
        IPut Put { get; }

    }
}


text:
const template = require('./template.html');

export default class Convolver {
  constructor(audioContext, viewContainer, settings) {
    // Create and connect up nodes
    const splitterNode = audioContext.createGain();
    splitterNode.gain.value = 1;

    const convolverNode = audioContext.createConvolver();
    convolverNode.normalize = true;

    const dryGainNode = audioContext.createGain();

    const wetGainNode = audioContext.createGain();

    const mergerNode = audioContext.createGain();
    mergerNode.gain.value = 1;

    splitterNode.connect(convolverNode);
    splitterNode.connect(dryGainNode);
    convolverNode.connect(wetGainNode);
    dryGainNode.connect(mergerNode);
    wetGainNode.connect(mergerNode);

    // Settings
    const responses = [];
    let activeResponseIdx = null; // index into responses
    let wetness; // dry/wet setting
    let bypass; // boolean

    const updateGains = () => {
      if (bypass || (activeResponseIdx === null)) {
        dryGainNode.gain.value = 1;
        wetGainNode.gain.value = 0;
      } else {
        dryGainNode.gain.value = Math.sqrt(1 - wetness);
        wetGainNode.gain.value = Math.sqrt(wetness);
      }
    };

    const setWetness = (v) => {
      wetness = v;
      if ((wetness < 0) && (wetness > 1)) {
        throw new Error('internal error');
      }
      updateGains();
      dryWetElem.value = v;
    };

    const setBypass = (v) => {
      bypass = v;
      if (typeof(bypass) !== 'boolean') {
        throw new Error('internal error');
      }
      updateGains();
      // TODO: update bypass control when it exists
    };

    const setActiveResponse = (idx) => {
      if (idx === null) {
        activeResponseIdx = idx;
        convolverNode.buffer = null; // probably not necessary but might catch bugs
      } else {
        const rb = responses[idx].responseBuffer;
        if (rb) {
          activeResponseIdx = idx;
          convolverNode.buffer = rb;
        } else {
          console.warn('Warning: Can\'t switch to response, buffer is missing');
        }
      }
      responseSelectElem.value = activeResponseIdx;
      updateResponseInfo();
      updateGains(); // because null/non-null repsonse changes gains
    };

    const addResponse = (name, responseFileData, makeActive) => {
      const responseInfo = {
        name,
        responseBuffer: null, // null means still loading
        responseFileData,
      };
      const addedIdx = responses.length;
      responses.push(responseInfo);

      updateResponseSelector();

      audioContext.decodeAudioData(responseFileData, (audioBuffer) => {
        // Successfully decoded to an AudioBuffer
        responseInfo.responseBuffer = audioBuffer;
        updateResponseSelector();
        if (makeActive) {
          setActiveResponse(addedIdx);
        }
      }, () => {
        console.warn('Failed to decode audio file');
      });
    };

    const removeActiveResponse = () => {
      responses.splice(activeResponseIdx, 1);
      if (responses.length === 0) {
        setActiveResponse(null);
      } else {
        setActiveResponse(activeResponseIdx-1);
      }
      updateResponseSelector();
    };

    this.inputs = {
      'audio': {type: 'audio', node: splitterNode},
    };
    this.outputs = {
      'audio': {type: 'audio', node: mergerNode},
    };

    viewContainer.innerHTML = template;

    const responseSelectElem = viewContainer.querySelector('.response-select');
    const updateResponseSelector = () => {
      responseSelectElem.innerHTML = '';
      for (let i = 0; i < responses.length; i++) {
        const r = responses[i];
        const optionElem = document.createElement('option');
        optionElem.textContent = r.name;
        optionElem.value = i;
        if (!r.responseBuffer) {
          optionElem.disabled = true;
        }
        responseSelectElem.appendChild(optionElem);
      }
      responseSelectElem.value = activeResponseIdx;
    };
    responseSelectElem.addEventListener('input', () => {
      setActiveResponse(+responseSelectElem.value);
    });

    const dryWetElem = viewContainer.querySelector('.dry-wet');
    dryWetElem.addEventListener('input', () => {
      setWetness(+dryWetElem.value);
    });

    const activeResponseNameElem = viewContainer.querySelector('.active-response-name');
    const activeResponseDurationElem = viewContainer.querySelector('.active-response-duration');
    const activeResponseDeleteElem = viewContainer.querySelector('.active-response-delete');
    const updateResponseInfo = () => {
      if (activeResponseIdx === null) {
        activeResponseNameElem.textContent = '';
        activeResponseDurationElem.textContent = ''
         activeResponseDeleteElem.style.visibility = 'hidden';
      } else {
        activeResponseNameElem.textContent = responses[activeResponseIdx].name;
        activeResponseDurationElem.textContent = responses[activeResponseIdx].responseBuffer.duration.toFixed(3) + 's';
        activeResponseDeleteElem.style.visibility = 'visible';
      }
    };

    activeResponseDeleteElem.addEventListener('click', () => {
      removeActiveResponse();
    });

    // Handle drag and drop of IRs
    const dropElem = viewContainer;

    const isFilesTransfer = (dt) => {
      for (const t of dt.types) {
        if (t === 'Files') {
          return true;
        }
      }
    };

    const extractAudioFileFromDataTransfer = (dt) => {
      if (isFilesTransfer(dt)) {
        const files = dt.files;
        const file = files[0];
        if (file.type.startsWith('audio/')) {
          return file;
        }
      }

      return null;
    };

    dropElem.addEventListener('dragover', e => {
      if (isFilesTransfer(e.dataTransfer)) {
        e.dataTransfer.dropEffect = 'copy';
        e.preventDefault();
        e.stopPropagation();
      }
    }, false);

    dropElem.addEventListener('drop', e => {
      const file = extractAudioFileFromDataTransfer(e.dataTransfer);
      if (file) {
        e.preventDefault();
        e.stopPropagation();

        // Got what appears to be audio, try decoding it
        const reader = new FileReader();
        reader.onload = () => {
          addResponse(file.name, reader.result, true);
        }
        reader.readAsArrayBuffer(file);
      }
    }, false);

    // Load settings or defaults
    if (!settings) {
      settings = {
        responses: [],
        activeResponseIdx: null,
        bypass: false,
        wetness: 0.5,
      };
    }

    // Enact settings
    for (let ri = 0; ri < settings.responses.length; ri++) {
      addResponse(settings.responses[ri].name, settings.responses[ri].responseFileData, (ri === settings.activeResponseIdx));
    }
    updateResponseSelector();
    if (activeResponseIdx === null) {
      setActiveResponse(null);
    }
    setWetness(settings.wetness);
    setBypass(settings.bypass);

    this.save = () => {
      return {
        responses: responses.map(r => ({name: r.name, responseFileData: r.responseFileData})),
        activeResponseIdx,
        bypass,
        wetness,
      };
    };
  }
}

Convolver.blockName = 'Convolver';
Convolver.helpText =
`Convolver is an audio convolver, typically used for applying reverb.

A special audio sample called an "impulse response" is used to capture the sound of a space. An impulse response sounds like a single loud click or clap recorded in a reverberating space. Using that impulse response, the same reverberation can be applied to any audio you want using a process called "convolution".

To load an impulse repsonse into Convolver, drag and drop the audio file onto the Convolver panel. Multiple responses can be added, and switched betweeb using the dropdown menu. The Dry↔Wet slider sets the mix between between the original "dry" input sound and the "wet" convolved sound in the output.

Many impulse responses can be found for free on the internet. Also, percussive samples such as cymbals, snares, and claps can be used as impulse responses to get unusual reverb-type sounds.`;


text:
<!DOCTYPE html>

    <meta http-equiv="refresh" content="0;URL=../../libc/fn.get_osfhandle.html">

Redirecting to ../../libc/fn.get_osfhandle.html...


text:
{% extends "base.html" %}
{% import "bootstrap/wtf.html" as wtf %}

{% block title %}Hippopotamus{% endblock %}

{% block page_content %}

Hello, {% if current_user.is_authenticated() %}{{ current_user.username }}{% else %}Stranger{% endif %}!

This is Crispy Hippopotamus, the website that let's you play chess against some of the greatest open-source chess AI's ever made.

    {% if current_user.is_authenticated() %}
        Start playing chess!
    {% else %}
        Register to get started!

Or login if you've already signed up.

    {% endif %}

The local date and time is {{ moment(current_time).format('LLL') }}.

That was {{ moment(current_time).fromNow(refresh=True) }}.

{% endblock %}


text:
package org.apache.kafka.streams.state.internals;

import org.apache.kafka.common.serialization.Serde;
import org.apache.kafka.common.utils.Time;
import org.apache.kafka.streams.processor.StateStore;
import org.apache.kafka.streams.state.StoreBuilder;

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

abstract public class AbstractStoreBuilder<K, V, T extends StateStore> implements StoreBuilder<T> {
    private Map<String, String> logConfig = new HashMap<>();
    protected final String name;
    final Serde<K> keySerde;
    final Serde<V> valueSerde;
    final Time time;
    boolean enableCaching;
    boolean enableLogging = true;

    public AbstractStoreBuilder(final String name,
                                final Serde<K> keySerde,
                                final Serde<V> valueSerde,
                                final Time time) {
        Objects.requireNonNull(name, "name can't be null");
        Objects.requireNonNull(time, "time can't be null");
        this.name = name;
        this.keySerde = keySerde;
        this.valueSerde = valueSerde;
        this.time = time;
    }

    @Override
    public StoreBuilder<T> withCachingEnabled() {
        enableCaching = true;
        return this;
    }

    @Override
    public StoreBuilder<T> withCachingDisabled() {
        enableCaching = false;
        return this;
    }

    @Override
    public StoreBuilder<T> withLoggingEnabled(final Map<String, String> config) {
        Objects.requireNonNull(config, "config can't be null");
        enableLogging = true;
        logConfig = config;
        return this;
    }

    @Override
    public StoreBuilder<T> withLoggingDisabled() {
        enableLogging = false;
        logConfig.clear();
        return this;
    }

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

    @Override
    public boolean loggingEnabled() {
        return enableLogging;
    }

    @Override
    public String name() {
        return name;
    }
}


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

namespace SintegraBr.Common
{
    [AttributeUsage(AttributeTargets.Property)]
    public class SintegraCamposAttribute : Attribute
    {
        public SintegraCamposAttribute(int ordem, string campo, string tipo, int tamanho, int qtdCasasDecimais, bool isObrigatorio)
        {
            OrdemAtt = ordem;
            CampoAtt = campo;
            TipoAtt = tipo;
            TamanhoAtt = tamanho;
            QtdCasasAtt = qtdCasasDecimais;
            IsObrigatorioAtt = isObrigatorio;
        }

        protected int OrdemAtt;

        public int Ordem => OrdemAtt;

        protected string CampoAtt;

        public string Campo => CampoAtt;

        protected string TipoAtt;

        public string Tipo => TipoAtt;

        protected int TamanhoAtt;

        public int Tamanho => TamanhoAtt;

        protected int QtdCasasAtt;

        public int QtdCasas => QtdCasasAtt;

        protected bool IsObrigatorioAtt;

        public bool IsObrigatorio => IsObrigatorioAtt;
    }
}


text:
var config = {};

// The port the web interface will bind to
config.port = 3000;

config.asterisk = {};

// Asterisk configuration
config.asterisk.host = "";
config.asterisk.port = 5038;
config.asterisk.username = "admin";
config.asterisk.secret = "";

// Queues configuration (#: 'name')
config.queues = { 4000: 'RedAnt', 4999: 'Prometech', 6000: 'Support' };

module.exports = config;


text:
namespace Packets
{
    class CGTeamLeave:    public Packet
    {
        public:
            CGTeamLeave(){};
            virtual        ~CGTeamLeave(){};

            //公用接口
            virtual BOOL            Read( SocketInputStream& iStream ) ;
            virtual BOOL            Write( SocketOutputStream& oStream )const ;
            virtual UINT            Execute( Player* pPlayer ) ;

            virtual PacketID_t        GetPacketID()const { return PACKET_CG_TEAMLEAVE ; }
            virtual UINT            GetPacketSize()const { return sizeof(GUID_t) ; }

    public :
        VOID                SetGUID( GUID_t guid ){    m_GUID = guid ; }
        GUID_t                GetGUID( ){ return m_GUID ; }

    public :
        GUID_t                m_GUID ;    //离开队伍的人

    };

    class CGTeamLeaveFactory: public    PacketFactory
    {
        public:
            Packet*        CreatePacket() { return new CGTeamLeave() ; }
            PacketID_t    GetPacketID()const            { return PACKET_CG_TEAMLEAVE ; }
            UINT        GetPacketMaxSize()const        { return sizeof(GUID_t); }
    };

    class CGTeamLeaveHandler
    {
        public:
            static UINT Execute(CGTeamLeave* pPacket,Player* pPlayer);
    };

}

using namespace Packets;

#endif