text:
<!doctype html>

    <meta name="viewport" content="width=device-width, initial-scale=1" charset="UTF-8">
    <title>LinkActivityResult</title>
<link href="../../../images/logo-icon.svg" rel="icon" type="image/svg">

<link href="../../../styles/style.css" rel="Stylesheet">
<link href="../../../styles/jetbrains-mono.css" rel="Stylesheet">
<link href="../../../styles/main.css" rel="Stylesheet">
<link href="../../../styles/prism.css" rel="Stylesheet">
<link href="../../../styles/logo-styles.css" rel="Stylesheet">

stripe-android

        <button id="theme-toggle-button"></button>

link/com.stripe.android.link/LinkActivityResult

Link<wbr>Activity<wbr>Result

sealed class LinkActivityResult : Parcelable

<button class="section-tab" data-active="" data-togglable="Types">Types</button><button class="section-tab" data-togglable="Functions">Functions</button><button class="section-tab" data-togglable="Properties">Properties</button><button class="section-tab" data-togglable="Inheritors">Inheritors</button>

Types

Canceled

Link copied to clipboard

data class Canceled(val reason: LinkActivityResult.Canceled.Reason) : LinkActivityResult

The user cancelled the Link flow without completing it.

Completed

Link copied to clipboard

object Completed : LinkActivityResult

Indicates that the flow was completed successfully and the Stripe Intent was confirmed.

Failed

Link copied to clipboard

data class Failed(val error: Throwable) : LinkActivityResult

Something went wrong. See error for more information.

Functions

describe<wbr>Contents

Link copied to clipboard

abstract fun describeContents(): Int

write<wbr>To<wbr>Parcel

Link copied to clipboard

abstract fun writeToParcel(p0: Parcel, p1: Int)

Properties

result<wbr>Code

Link copied to clipboard

val resultCode: Int

Inheritors

Completed

Link copied to clipboard

Canceled

Link copied to clipboard

Failed

Link copied to clipboard

        © 2022 CopyrightGenerated by dokka

redpajama_set_name: RedPajamaGithub


text:
    <bx_repeat:items>

                    <bx_repeat:stars></bx_repeat:stars>

                    <bx_repeat:slider></bx_repeat:slider>

__label__

    </bx_repeat:items>


text:
  ((pdmTracer) && ((pdmTracer)->trace(PDMTracer::Messages)))

#define PDMTraceRestartMessages(pdmTracer) \
  ((pdmTracer) && ((pdmTracer)->trace(PDMTracer::RestartMessages)))

namespace DeterministicFiniteAutomaton {

  // forward declaration of the PushDownMachine class
  class PushDownMachine;

  /// \brief A PushDownMachine::Tracer object is used to trace a
  /// given PushDownMachine's state transitions.
  class PDMTracer {

    public:

      /// \brief An enumeration of the known TraceConditions. This
      /// enumeration is used to selectively turn on/off specific trace
      /// messages.
      enum TraceConditions {
        All=~0L,
        Messages=1,
        NFAState=2,
        DFAState=4,
        AutomataStack=8,
        PDMState=16,
        CurStreamPosition=32,
        StackPushes=64,
        StackPops=128,
//        StackSwaps=256,
        CheckForRestarts=512,
        PDMRestarts=1024,
        PDMMatch=2048,
        PDMDone=4096,
        PDMFailedWithStream=8192,
        PDMNextDFAState=16384,
        PDMFailedBackTrack=32768,
        PDMBackTrack=65536,
        PDMErrorReturn=131072,
        RestartMessages=262144,
        PDMTokens=524288,
        Progress=(PDMMatch|CurStreamPosition|RestartMessages),
//        PDMStack=(StackPushes|StackPops|StackSwaps),
        PDMStack=(StackPushes|StackPops),
        SimpleState=(NFAState|DFAState|AutomataStack|PDMTokens|PDMState),
        Transitions=(PDMErrorReturn|PDMBackTrack|PDMFailedBackTrack|PDMNextDFAState|PDMFailedWithStream|PDMDone|PDMMatch)
      };

      /// \brief Create a new PDMTracer instance.
      PDMTracer(const char *aMessage, FILE *aTraceFile = NULL) {
        pdm        = NULL;
        message    = aMessage;
        traceFile  = aTraceFile;
        conditions = 0; // trace nothing unless told to do so
      }

      /// \brief Destroy the tracer.
      ~PDMTracer(void) {
        pdm       = NULL; // we do not own the PDM
        message   = NULL; // we do not own the message
        traceFile = NULL; // we do not own the FILE
      }

      /// \brief Set one or more trace conditions (see TraceConditions
      /// above).
      void setCondition(uint64_t someConditions) {
        conditions |= someConditions;
      }

      /// \brief Clear one or more trace conditions (see TraceConditions
      /// above).
      void clearCondition(uint64_t someConditions) {
        conditions &= ~someConditions;
      }

      /// \brief Return true if the provided conditions match the
      /// current conditions for this tracer.
      bool trace(uint64_t someConditions) {
        return (conditions & someConditions);
      }

      /// \brief Sets the associated PushDownMachine
      void setPDM(PushDownMachine *aPDM) {
        pdm = aPDM;
        if (traceFile && conditions) fprintf(traceFile, "PDMTracer: %s\n", message);
      }

      /// \brief Report the PushDownMachine's current state.
      void reportState(size_t indent = 0);

      /// \brief Report the PushDownMachine's current stack.
      void reportAutomataStack(size_t indent = 0);

      /// \brief Report the NFA::State.
      void reportNFAState(NFA::State *nfaState, size_t indent = 0);

      /// \brief Report the DFA state (and all NFA::States in the bitset).
      void reportDFAState(size_t indent = 0);

      /// \brief Report the character provided.
      void reportChar(utf8Char_t curChar, size_t indent = 0);

      /// \brief Report the current token.
      void reportTokens(size_t indent = 0);

      /// \brief Report the string that *has* *been* read.
      void reportStreamPrefix();

      /// \brief Report the string that has *not* been read yet.
      void reportStreamPostfix();

      /// \brief Report a push.
      void push(const char *message, size_t indent = 0);

      /// \brief Report a pop.
      void pop(const char *message0,
               const char *message1 = "",
               size_t indent = 0);

      /// \brief Report that the PushDownMachine is checking for a
      /// restart state.
      void checkForRestart(size_t indent = 0);

      /// \brief Trace the use of a restart state transition.
      void restart(size_t indent = 0);

      /// \brief Report that a match has been found.
      void match(NFA::State *nfaState, size_t indent = 0);

      /// \brief Report the successfull recognition of a stream.
      void done(size_t indent = 0);

      /// \brief Report the recognition failure with some stream still
      /// unread.
      void failedWithStream(size_t indent = 0);

      /// \brief Report the transition to a new DFA state.
      void nextDFAState(size_t indent = 0);

      /// \brief Report the recognition failure with no more
      /// backtracking avaiable.
      void failedBacktrack(size_t indent = 0);

      /// \brief Report that the PushDownMachine is backtracking.
      void backtrack(size_t indent = 0);

      /// \brief Report that the PushDownMachine has failed by reaching
      /// code which should not have been reached.
      void errorReturn(size_t indent = 0);

    protected:

      /// \brief The currently associated PushDownMachine.
      ///
      /// Used to access the internal state of the PDM.
      PushDownMachine *pdm;

      /// \brief A message associated with this Tracer.
      const char *message;

      /// \brief Whether or not to trace the state transitions.
      FILE *traceFile;

      /// \brief The BitSet of trace conditions
      uint64_t conditions;

  }; // class Tracer

};  // namespace DeterministicFiniteAutomaton

#endif


text:
using namespace hare;
using namespace hare::net;

int main() {
  LOG_INFO << "pid = " << getpid();
  EventLoop loop;
  InetAddress listenAddr(2037);
  TimeServer server(&loop, listenAddr);
  server.start();
  loop.loop();
}


text:
package com.google.cloud.baremetalsolution.v2.samples;

// [START baremetalsolution_v2_generated_BareMetalSolution_GetNetwork_async]
import com.google.api.core.ApiFuture;
import com.google.cloud.baremetalsolution.v2.BareMetalSolutionClient;
import com.google.cloud.baremetalsolution.v2.GetNetworkRequest;
import com.google.cloud.baremetalsolution.v2.Network;
import com.google.cloud.baremetalsolution.v2.NetworkName;

public class AsyncGetNetwork {

  public static void main(String[] args) throws Exception {
    asyncGetNetwork();
  }

  public static void asyncGetNetwork() throws Exception {
    // This snippet has been automatically generated and should be regarded as a code template only.
    // It will require modifications to work:
    // - It may require correct/in-range values for request initialization.
    // - It may require specifying regional endpoints when creating the service client as shown in
    // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
    try (BareMetalSolutionClient bareMetalSolutionClient = BareMetalSolutionClient.create()) {
      GetNetworkRequest request =
          GetNetworkRequest.newBuilder()
              .setName(NetworkName.of("[PROJECT]", "[LOCATION]", "[NETWORK]").toString())
              .build();
      ApiFuture<Network> future = bareMetalSolutionClient.getNetworkCallable().futureCall(request);
      // Do something.
      Network response = future.get();
    }
  }
}
// [END baremetalsolution_v2_generated_BareMetalSolution_GetNetwork_async]


text:
// Copyright (c) .NET Core Community. All rights reserved.
// Licensed under the MIT License. See License.txt in the project root for license information.

using System;
using System.Diagnostics;
using System.Threading.Tasks;
using DotNetCore.CAP.Diagnostics;
using DotNetCore.CAP.Messages;
using DotNetCore.CAP.Persistence;
using DotNetCore.CAP.Serialization;
using DotNetCore.CAP.Transport;
using Microsoft.Extensions.DependencyInjection;
using Microsoft.Extensions.Logging;
using Microsoft.Extensions.Options;

namespace DotNetCore.CAP.Internal
{
    internal class MessageSender : IMessageSender
    {
        private readonly ILogger _logger;
        private readonly IServiceProvider _serviceProvider;

        private readonly IDataStorage _dataStorage;
        private readonly ISerializer _serializer;
        private readonly ITransport _transport;
        private readonly IOptions<CapOptions> _options;

        // ReSharper disable once InconsistentNaming
        protected static readonly DiagnosticListener s_diagnosticListener = new(CapDiagnosticListenerNames.DiagnosticListenerName);

        public MessageSender(
            ILogger<MessageSender> logger,
            IServiceProvider serviceProvider)
        {
            _logger = logger;
            _serviceProvider = serviceProvider;

            _options = serviceProvider.GetRequiredService<IOptions<CapOptions>>();
            _dataStorage = serviceProvider.GetRequiredService<IDataStorage>();
            _serializer = serviceProvider.GetRequiredService<ISerializer>();
            _transport = serviceProvider.GetRequiredService<ITransport>();
        }

        public async Task<OperateResult> SendAsync(MediumMessage message)
        {
            bool retry;
            OperateResult result;
            do
            {
                var executedResult = await SendWithoutRetryAsync(message);
                result = executedResult.Item2;
                if (result == OperateResult.Success)
                {
                    return result;
                }
                retry = executedResult.Item1;
            } while (retry);

            return result;
        }

        private async Task<(bool, OperateResult)> SendWithoutRetryAsync(MediumMessage message)
        {
            var transportMsg = await _serializer.SerializeAsync(message.Origin);

            var tracingTimestamp = TracingBefore(transportMsg, _transport.BrokerAddress);

            var result = await _transport.SendAsync(transportMsg);

            if (result.Succeeded)
            {
                await SetSuccessfulState(message);

                TracingAfter(tracingTimestamp, transportMsg, _transport.BrokerAddress);

                return (false, OperateResult.Success);
            }
            else
            {
                TracingError(tracingTimestamp, transportMsg, _transport.BrokerAddress, result);

                var needRetry = await SetFailedState(message, result.Exception!);

                return (needRetry, OperateResult.Failed(result.Exception!));
            }
        }

        private async Task SetSuccessfulState(MediumMessage message)
        {
            message.ExpiresAt = DateTime.Now.AddSeconds(_options.Value.SucceedMessageExpiredAfter);
            await _dataStorage.ChangePublishStateAsync(message, StatusName.Succeeded);
        }

        private async Task<bool> SetFailedState(MediumMessage message, Exception ex)
        {
            var needRetry = UpdateMessageForRetry(message);

            message.Origin.AddOrUpdateException(ex);
            message.ExpiresAt = message.Added.AddDays(15);

            await _dataStorage.ChangePublishStateAsync(message, StatusName.Failed);

            return needRetry;
        }

        private bool UpdateMessageForRetry(MediumMessage message)
        {
            var retries = ++message.Retries;
            var retryCount = Math.Min(_options.Value.FailedRetryCount, 3);
            if (retries >= retryCount)
            {
                if (retries == _options.Value.FailedRetryCount)
                {
                    try
                    {
                        _options.Value.FailedThresholdCallback?.Invoke(new FailedInfo
                        {
                            ServiceProvider = _serviceProvider,
                            MessageType = MessageType.Publish,
                            Message = message.Origin
                        });

                        _logger.SenderAfterThreshold(message.DbId, _options.Value.FailedRetryCount);
                    }
                    catch (Exception ex)
                    {
                        _logger.ExecutedThresholdCallbackFailed(ex);
                    }
                }
                return false;
            }

            _logger.SenderRetrying(message.DbId, retries);

            return true;
        }

        #region tracing

        private long? TracingBefore(TransportMessage message, BrokerAddress broker)
        {
            if (s_diagnosticListener.IsEnabled(CapDiagnosticListenerNames.BeforePublish))
            {
                var eventData = new CapEventDataPubSend()
                {
                    OperationTimestamp = DateTimeOffset.UtcNow.ToUnixTimeMilliseconds(),
                    Operation = message.GetName(),
                    BrokerAddress = broker,
                    TransportMessage = message
                };

                s_diagnosticListener.Write(CapDiagnosticListenerNames.BeforePublish, eventData);

                return eventData.OperationTimestamp;
            }

            return null;
        }

        private void TracingAfter(long? tracingTimestamp, TransportMessage message, BrokerAddress broker)
        {
            if (tracingTimestamp != null && s_diagnosticListener.IsEnabled(CapDiagnosticListenerNames.AfterPublish))
            {
                var now = DateTimeOffset.UtcNow.ToUnixTimeMilliseconds();
                var eventData = new CapEventDataPubSend()
                {
                    OperationTimestamp = now,
                    Operation = message.GetName(),
                    BrokerAddress = broker,
                    TransportMessage = message,
                    ElapsedTimeMs = now - tracingTimestamp.Value
                };

                s_diagnosticListener.Write(CapDiagnosticListenerNames.AfterPublish, eventData);
            }
        }

        private void TracingError(long? tracingTimestamp, TransportMessage message, BrokerAddress broker, OperateResult result)
        {
            if (tracingTimestamp != null && s_diagnosticListener.IsEnabled(CapDiagnosticListenerNames.ErrorPublish))
            {
                var ex = new PublisherSentFailedException(result.ToString(), result.Exception);
                var now = DateTimeOffset.UtcNow.ToUnixTimeMilliseconds();

                var eventData = new CapEventDataPubSend()
                {
                    OperationTimestamp = now,
                    Operation = message.GetName(),
                    BrokerAddress = broker,
                    TransportMessage = message,
                    ElapsedTimeMs = now - tracingTimestamp.Value,
                    Exception = ex
                };

                s_diagnosticListener.Write(CapDiagnosticListenerNames.ErrorPublish, eventData);
            }
        }

        #endregion
    }
}


text:
package com.azure.cosmos;

import com.azure.cosmos.implementation.TestConfigurations;
import com.azure.cosmos.models.ThroughputProperties;

public class ThroughputPropertiesCodeSnippet {
    public static void main(String[] args) throws Exception {

        CosmosAsyncClient client = new CosmosClientBuilder()
                                       .endpoint(TestConfigurations.HOST)
                                       .key(TestConfigurations.MASTER_KEY)
                                       .buildAsyncClient();

        final String databaseName = "testDB";
        int throughput = 5000;
        ThroughputProperties properties = ThroughputProperties.createAutoscaledThroughput(throughput);
        client.createDatabase(databaseName, properties).block();
        client.close();
    }
}


text:
<?php

/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */

/**
 * Description of redirHelper
 *
 * @author alvaro
 */
class redirHelper {

    protected $parameters = array();

    public function go( $url ){
        header("Location: ".$url);
    }

    public function setUrlParameter( $name , $value){
        $this->parameters[$name] = $value;
        return $this->parameters;
    }

    protected function getUrlParameters(){
        $params = '';
        foreach ( $this->parameters as $name => $value ){
            $params .= $name.'/'.$value.'/';
        }
        return $params;
    }

    public function getCurrentAction(){
        global $start;
        return $start->_action;
    }

    public function getCurrentController(){
        global $start;
        return $start->_controller;
    }

    public function goToController( $controller ){
        $this->go($controller.'/teste/'.$this->getUrlParameters());
    }

    public function goToAction( $action ){
        $this->go( $this->getCurrentController() . '/' . $action . '/' . $this->getUrlParameters());
    }

    public function goToControllerAction( $controller , $action ){
        $this->go( $controller . '/' . $action . '/' . $this->getUrlParameters());
    }

    public function goToIndex(){
        $this->go($this->goToController('index'));
    }

    public function goToUrl( $url ){
        $this->go( $url );
    }

}

?>


text:
package org.jrebirth.af.presentation.ui.qanda;

import javafx.animation.Animation;
import javafx.animation.Interpolator;
import javafx.animation.ParallelTransitionBuilder;
import javafx.animation.ScaleTransitionBuilder;
import javafx.animation.TranslateTransitionBuilder;
import javafx.geometry.Pos;
import javafx.scene.CacheHint;
import javafx.scene.layout.BorderPane;
import javafx.scene.layout.StackPane;
import javafx.scene.layout.StackPaneBuilder;
import javafx.scene.paint.Color;
import javafx.scene.text.Text;
import javafx.scene.text.TextAlignment;
import javafx.scene.text.TextBuilder;
import javafx.util.Duration;

import org.jrebirth.af.api.exception.CoreException;
import org.jrebirth.af.presentation.resources.PrezColors;
import org.jrebirth.af.presentation.ui.base.AbstractSlideView;

/**
 *
 * The class QandAView.
 *
 * @author Sébastien Bordes
 */
public class QandAView extends AbstractSlideView<QandAModel, BorderPane, QandAController> {

    /** The first text. */
    private Text firstText;

    /** The second text. */
    private Text secondText;

    /** The answer transition. */
    private Animation transition;

    /**
     * Default Constructor.
     *
     * @param model the splash view model
     *
     * @throws CoreException if build fails
     */
    public QandAView(final QandAModel model) throws CoreException {
        super(model);
    }

    /**
     * {@inheritDoc}
     */
    @Override
    protected void initView() {

        node().getStyleClass().add(model().getStyleClass() == null ? "qandaContainer" : model().getStyleClass());

        this.firstText = TextBuilder.create()
                                    // .text(getModel().getQuestion())
                                    // .styleClass("firstText")
                                    .textAlignment(TextAlignment.JUSTIFY)
                                    // .wrappingWidth(600)
                                    .smooth(true)
                                    .cache(true)
                                    .cacheHint(CacheHint.SPEED)
                                    .fill(model().getStyleClass() == null ? Color.WHITE : PrezColors.SPLASH_TEXT.get())
                                    .scaleX(1)
                                    .scaleY(1)
                                    .build();

        this.secondText = TextBuilder.create()
                                     // .text(getModel().getAnswer())
                                     // .styleClass("secondText")
                                     .textAlignment(TextAlignment.JUSTIFY)
                                     // .wrappingWidth(600)
                                     .smooth(true)
                                     .cache(true)
                                     .cacheHint(CacheHint.SPEED)
                                     .fill(model().getStyleClass() == null ? Color.WHITE : PrezColors.SPLASH_TEXT.get())
                                     .scaleX(0)
                                     .scaleY(0)
                                     .build();

        final StackPane sp = StackPaneBuilder.create()
                                             .children(this.firstText, this.secondText)
                                             .build();

        StackPane.setAlignment(this.firstText, Pos.CENTER);
        StackPane.setAlignment(this.secondText, Pos.CENTER);

        BorderPane.setAlignment(sp, Pos.CENTER);

        node().setCenter(sp);
    }

    /**
     * {@inheritDoc}
     */
    @Override
    public void start() {

    }

    /**
     * @return Returns the questionTransition.
     */
    Animation getTransition() {
        if (this.transition == null) {
            this.transition =

            ParallelTransitionBuilder.create().children(
                                                        ScaleTransitionBuilder.create()
                                                                              .node(this.firstText)
                                                                              .duration(Duration.millis(800))
                                                                              .interpolator(Interpolator.EASE_IN)
                                                                              .fromX(1)
                                                                              .fromY(1)
                                                                              .toX(0)
                                                                              .toY(0)
                                                                              .build(),
                                                        TranslateTransitionBuilder.create()
                                                                                .node(this.firstText)
                                                                                .duration(Duration.millis(800))
                                                                                .interpolator(Interpolator.EASE_IN)
                                                                                .fromY(0)
                                                                                .toY(600)
                                                                                .build(),
                                                        ScaleTransitionBuilder.create()
                                                                              .node(this.secondText)
                                                                              // .delay(Duration.millis(200))
                                                                              .duration(Duration.millis(1000))
                                                                              .interpolator(Interpolator.EASE_IN)
                                                                              .fromX(100)
                                                                              .fromY(100)
                                                                              .toX(1)
                                                                              .toY(1)
                                                                              .build(),
                                                        TranslateTransitionBuilder.create()
                                                                                .node(this.secondText)
                                                                                .duration(Duration.millis(800))
                                                                                .interpolator(Interpolator.EASE_IN)
                                                                                .fromY(-600)
                                                                                .toY(0)
                                                                                .build())
                                     .build();

        }
        return this.transition;
    }

    /**
     * {@inheritDoc}
     */
    @Override
    public void reload() {
        // Nothing to do yet
    }

    /**
     * {@inheritDoc}
     */
    @Override
    public void hide() {
        // Nothing to do yet
    }

    public void showNext(final String current, final String next) {

        if (current == null) {
            this.firstText.setText(next);
        } else {
            this.firstText.setText(current);
            this.secondText.setText(next);

            getTransition().setRate(1);
            getTransition().play();
        }
    }

    public void showPrevious(final String current, final String previous) {
        if (current == null) {
            this.firstText.setText(previous);
        } else {
            this.firstText.setText(previous);
            this.secondText.setText(current);
            getTransition().setRate(-1);
            getTransition().play();
        }
    }

}


text:
# Trimble Connect Org Service Client .NET Release Notes

## [1.0.50] - 2021-08-10
* Updated the `Newtonsoft.Json` module to the latest version (12.0.3) for netstandard2.0 Targetframework to fix the whitesource vulnerability.
* Updated the `Trimble.Identity.OAuth.Password` module to the latest version (1.0.18).
* Updated the `Trimble.Connect.Client.Common` module to the latest version (1.0.65).

## [1.0.49] - 2021-06-10
* Updated the `Trimble.Identity.OAuth.Password` module to the latest version (1.0.15) and adapted to the changes.

## [1.0.48] - 2021-04-26
* Updated the `Trimble.Connect.Client.Common` module to the latest version (1.0.60) and adapted to the changes.

## [1.0.47] - 2021-04-20
* Fixed handling of region specific service URLs in the client configuration.
* Fixed tests to work with the stage version of the TC client.
* Changed the test user account.
* Updated the `Trimble.Connect.Client.Common` module to the latest version (1.0.58).
* Updated the `Trimble.Identity.OAuth.Password` module to the latest version (1.0.13).
* Updated the `Trimble.Connect.Client.Common` module to the latest version (1.0.57).

## [1.0.46] - 2021-03-05
* Added support for node meta-data.

## [1.0.45] - 2021-02-15
* Added automatic encoding of URI segments and parameters in requests. This is a _**potentially breaking change**_ for applications which have been doing the encoding on the application side.
* Updated the `Trimble.Diagnostics` dependency to the latest version (2.0.13).
* Updated the `NUnit` dependency to the latest version (3.13.1).

## [1.0.44] - 2021-02-03
* Updated the TC logo image url for the nuget package.
* Updated the `Trimble.Connect.Client.Common` dependency to the latest version (1.0.55).

## [1.0.43-beta] - 2020-10-23
* Added support for searching nodes in trees and forests.
* Breaking change: Removed `ListAllTreesRequest`, `ListAllNodesRequest`, `ListAllNodeVersionsRequest` (use `ListTreesRequest`, `ListNodesRequest`, `ListNodeVersionsRequest` instead).
* Updated the `Trimble.Connect.Client.Common` dependency to the latest version (1.0.52-beta).

## [1.0.42-beta] - 2020-10-06
* Added support for initializing the OrgClient with Trimble Connect project location. RegionsConfig.InitializeFromServerAsync() should be called in this case to initialize regions.

## [1.0.41-beta] - 2020-10-02
* Made the tree UAC policies more restrictive in tests.
* Updated the `Trimble.Connect.Client.Common` dependency to the latest version (1.0.51-beta).

## [1.0.40-beta] - 2020-10-01
* Fixed potential null reference problem related to handling node geometries.
* Updated the `Trimble.Connect.Client.Common` dependency to the latest version (1.0.50-beta).

## [1.0.39-beta] - 2020-09-02
* Fixed project file and updated the dependencies of the test project.

## [1.0.38-beta] - 2020-08-28
* Added DeleteNodeGeometry operation

## [1.0.36-beta] - 2020-08-27
* Support deep insert nodes as part of the tree creation API
* Support upsert semantic on tree and node operations
* Removed changeset API endpoints that support tree upsert semantic added in `1.0.35-beta`
* Renamed `UpdateTreeRequest`->`UpsertTreeRequest`, `UpdateNodeRequest`->`UpsertNodeRequest`, `UpdateTreeWithChangeSetRequest`->`UpsertTreeModel`
* Renamed all properties `ID`->`Id`

## [1.0.35-beta] - 2020-08-11
* All changeset API wrappers now use new `scope` query parameter instead of passing parameters in the request body (breaking change)
* Added support for tree operations in the changeset API
* Added new changeset API endpoints that support tree upsert semantic

## [1.0.34-beta] - 2020-08-07
* Using portable debug symbols.
* Updated the `Trimble.Connect.Client.Common` dependency to the latest version (1.0.48-beta).

## [1.0.33-beta] - 2020-08-07
* Updated the release notes link.
* Updated the `Trimble.Connect.Client.Common` dependency to the latest version (1.0.47-beta).

## [1.0.32-beta] - 2020-07-31
* Added support for node geometries.
* Fix for the concurrency support on UpdateNode operation.
* Updated the dependencies.

## [1.0.31-beta] - 2020-07-29
* Generating NuGet symbols package in the new (snupkg) format.

## [1.0.30-beta] - 2020-07-29
* No longer supporting uap10.0 target (uap platform specific target deprecated as .netstandard 2.0 target should work for uap platforms from 10.0.16299 onwards).

## [1.0.29-beta] - 2020-07-27
* Created beta version NuGet package.

## [1.0.28-beta] - 2020-07-27
* Created beta version NuGet package.

## [1.0.27] - 2020-07-27
* No longer supporting .NET Standard 1.4.

## [1.0.26] - 2020-07-08
* Renamed the test methods related to generic batch-get functionality.

## [1.0.25] - 2020-07-06
* Updated dependencies: `Trimble.Connect.Client.Common` (1.0.43), `Trimble.Identity.OAuth.Password` (1.0.7).
* Excluded leftover files from SonarQube scans from the WhiteSource scans.

## [1.0.24] - 2020-07-02
* Fixed comparison to default value for arguments of type RequestType (fixing Sonar bugs).

## [1.0.23] - 2020-07-01
* Added configuration file for WhiteSource scan.
* Prevented StyleCop from propagating to consuming modules.
* Using the leatest version (1.0.41) of the **_`Trimble.Connect.Client.Common`_** module.

## [1.0.22] - 2020-06-26
* Fixed handling unprocessed nodes in change sets.

## [1.0.21] - 2020-06-25
* Updated release notes.

## [1.0.20] - 2020-06-24
* Batch-get related small fixes.

## [1.0.19] - 2020-06-11
* Replaced usages of resource arrays with `IList<Resource>` for more convenient utilization.

## [1.0.18] - 2020-06-09
* Minor improvements (eg. using `IList<string>` instead of string arrays where applicable).

## [1.0.17] - 2020-06-04
* Take in use the Trimble Identity OAuth providers in the test code

## [1.0.16] - 2020-06-03
* Minor cleanups and refactorings
* Fixed null value handling for UserClaims.UAT.

## [1.0.15] - 2020-06-02
* Token management infrastructure taken in use with `ICredentialsProvider`
* Naming for Subscription API simplified
* `IRequest.UseAuthorization` parameter removed
* dependency on `Trimble.Identity` removed in tests
* Fixed the Linux/OSX compartibility
* netstandard2.0 target added to align with the `Trimble.Connect.Client.Common` targets
* Fixed exception thown on null arguments (`InvalidDataException` -> `ArgumentNullException`)

## [1.0.14] - 2020-05-27
* Using the latest version (1.0.33) of the **_`Trimble.Connect.Client.Common`_** module.

## [1.0.13] - 2020-05-25
* Using the leatest version (1.0.32) of the **_`Trimble.Connect.Client.Common`_** module.
* Refactored the request model classes (added more properties for more flexibility).
* Refactored the request sending mechanism, now also using the binary file client amongside the object client for large content.
* Exposed generic request sending mechinism through the public interface of the client class, making it possible to generically support future request type without modifying the .NET SDK.
* Added model classes, request methods and tests related to batch-get functionality.
* Added model classes, request methods and tests related to change set functionality.
* Added utility classes for sending and receiving, serializing and deserializing NDJSON content.
* Moved the validation from **_`IModel`_**/**_`OrgModel`_** to **_`IRequest`_**/**_`OrgRequest`_** because validation is only needed for request model classes.
* Simplified and consolidated the validation of all request model classes.
* Refactored the creation of baseline test data and made it more robust.
* Improved documentation comments
* Re-organized the model classes into subfolders.
* Simplified the names of some model classes.
* Added support for generic extra properties in request classes (ability to send to the service properties which are not yet supported in the .NET SDK)(forward compatibility).
* Added support for generic extra properties in model classes (ability to receive from the service properties which are not yet supported in the .NET SDK)(forward compatibility).
* Added support for extra query parameters in request classes (which are not yet supported by the .NET SDK)(forward compatibility).
* Added support for sending generic requests to the service (which are not yet supported in the .NET SDK)(forward compatibility).

## [1.0.12] - 2020-04-29
* Using the leatest version (1.0.16) of the **_`Trimble.Connect.Client.Common`_** module.
* Added model classes, request methods and tests related to tree policies.
* Added model classes, request methods and tests related to nodes, node links and node versions.
* Added model classes, request methods and tests related to subscribing to notifications.
* Added more test related to trees and nodes.
* Made sure that all properties of request model classes which are not meant to be serialized will be ignored during serialization.
* Simplified the inheritance hierarchy of requests (removed abstract base class **_`Request`_**).
* Separated generic data model related fuctionality out of the request interface and base class (**_`IRequest`_**, **_`OrgRequest`_**) into its own interface and base class (**_`IModel`_**, **_`OrgModel`_**).
* Implemented validation for all model classes.
* Re-organized source files into subfolders.
* Using PROD TID URI and a different user account for the unit tests.
* Cleaned up the settings files.
* Changed default assembly file version from x.y.0.0 to x.y.9999.9999 to make debug builds distinguishable from official builds.
* Changed the user agent literal for this module from `org-client` to `tc-client-org`.

## [1.0.11] - 2020-04-21
* Using the leatest version (1.0.14) of the **_`Trimble.Connect.Client.Common`_** module.
* Added model classes, request methods and tests related to trees.
* Moved the request-specific details from the request methods into the request model classes and created unified request dispatching mechanism.
* Implemented unified basic request validation mechanism.
* Re-organized source files into subfolders.

## [1.0.10] - 2020-04-08

* Adapted the code to use the leatest version (1.0.11) of the **_`Trimble.Connect.Client.Common`_** module.
* Re-organized the **_`OrgClient`_** class by moving the request implementations into the **_`OrgClient.Requests`_** partial class.
* Simplified the inheritance hierarchy of the test classes.
* Aligned the model classes with the [Org service REST API documentation](https://app.swaggerhub.com/apis/Trimble-Connect/org-prod/v1#/)
* Re-organized source files into subfolders.
* Cleaned up and updated package references.
* Fixed StyleCop warnings and enabled automatic StyleCop scan during build.
* Updated release notes to use a more standardized format.

## [1.0.9] - 2020-03-27

* Code refactored to build a skeleton with design patterns to follow (naming, **_`IClient`_**, **_`IClientConfig`_**, no controller layer).

## [1.0.8] - 2020-03-26

* Reverse **_`MSBuild.Sdk.Extras`_** dependency updated.

## [1.0.7] - 2020-03-26

* **_`MSBuild.Sdk.Extras`_** dependency updated.

## [1.0.6] - 2020-03-26

* Using Trimble Connect .NET Client Common module (code common to CDM services has moved into this module).

## [1.0.5] - 2020-03-13

## [1.0.4] - 2020-03-10

## [1.0.3] - 2020-03-10

## 1.0.0

* Initial skeleton project. Empty interfaces and tests. Might require restructure still.


text:
using System.Data.Entity;
using System.Linq;

namespace AppServiceOverview.Data
{
    using System;
    using System.Collections.Generic;
    using System.Threading.Tasks;

    /// <summary>
    /// Defines a contract that is used to interact with the database.
    /// </summary>
    public interface IDbContext : IDisposable
    {
        /// <summary>
        /// Gets the set of entities represented in the database.
        /// </summary>
        /// <typeparam name="TEntity">The type of entity</typeparam>
        /// <returns>A <see cref="DbSet"/> for the requested entity</returns>
        IDbSet<TEntity> DbSet<TEntity>() where TEntity : class;

        /// <summary>
        /// Gets a set of entities represented in the database.
        /// </summary>
        /// <typeparam name="TEntity">The type of entity</typeparam>
        /// <returns>A <see cref="DbSet"/> for the requested entity</returns>
        IQueryable<TEntity> Query<TEntity>() where TEntity : class;

        /// <summary>
        /// Execute a raw sql query that returns an enumerable of entities.
        /// </summary>
        /// <param name="sql">The SQL query</param>
        /// <param name="parameters">The parameters to use in the command.</param>
        /// <returns>An enumerable of entities</returns>
        int SqlCommand(string sql, params object[] parameters);

        /// <summary>
        /// Execute a raw sql query that returns an enumerable of entities.
        /// </summary>
        /// <typeparam name="TEntity">The entity.</typeparam>
        /// <param name="sql">The SQL query</param>
        /// <param name="parameters">The parameters to use in the query.</param>
        /// <returns>An enumerable of entities</returns>
        IEnumerable<TEntity> SqlQuery<TEntity>(string sql, params object[] parameters);

        /// <summary>
        /// Execute a raw sql query that returns an enumerable of entities.
        /// </summary>
        /// <param name="sql">The SQL query</param>
        /// <param name="parameters">The parameters to use in the command.</param>
        /// <returns>An enumerable of entities</returns>
        Task<int> SqlCommandAsync(string sql, params object[] parameters);

        /// <summary>
        /// Execute a raw sql query that returns an enumerable of entities.
        /// </summary>
        /// <typeparam name="TEntity">The entity.</typeparam>
        /// <param name="sql">The SQL query</param>
        /// <param name="parameters">The parameters to use in the query.</param>
        /// <returns>An enumerable of entities</returns>
        Task<List<TEntity>> SqlQueryAsync<TEntity>(string sql, params object[] parameters) where TEntity : class;

        /// <summary>
        /// Saves changes tracked by the context to the database.
        /// </summary>
        /// <returns>The number of affected rows.</returns>
        int SaveChanges();

        /// <summary>
        /// Saves changes tracked by the context to the database.
        /// </summary>
        /// <returns>The number of affected rows.</returns>
        Task<int> SaveChangesAsync();

        /// <summary>
        /// Marks the entity as Modified in the context. (Useful after attaching it to a DbSet)
        /// </summary>
        /// <typeparam name="TEntity">The entity type.</typeparam>
        /// <param name="entity">The entity.</param>
        void MarkAsModified<TEntity>(TEntity entity) where TEntity : class;
    }
}


text:
package org.succlz123.androidpixeldimengenerator.plugin;

import javax.swing.*;

/**
 * Created by succlz123 on 16/6/22.
 */
public class InputPanel {
    private JPanel contentPane;

    private JLabel text1;
    private JLabel text2;
    private JTextField textField1;
    private JTextField textField2;

    private JLabel text3;
    private JLabel text4;
    private JTextArea textPixel;

    public InputPanel() {
        textPixel.setLineWrap(true);
        textPixel.setWrapStyleWord(true);
        textPixel.setText("1920 1080\n1280 720");
    }

    public JPanel getComponent() {
        return contentPane;
    }

    public String getPositiveNumber() {
        return textField1.getText();
    }

    public String getNegativeNumber() {
        return textField2.getText();
    }

    public String getTextPixel() {
        return textPixel.getText();
    }
}


text:
/**
 * Support and FAQ: visit Atmel Support
 */

#ifndef SYSTEM_SAM3U_H_INCLUDED
#define SYSTEM_SAM3U_H_INCLUDED

/* @cond 0 */
/**INDENT-OFF**/
#ifdef __cplusplus
extern "C" {
#endif
/**INDENT-ON**/
/* @endcond */

#include <stdint.h>
#include <compiler.h>

extern uint32_t SystemCoreClock;	/* System Clock Frequency (Core Clock) */

/**
 * @brief Setup the microcontroller system.
 * Initialize the System and update the SystemCoreClock variable.
 */
void SystemInit(void);

/**
 * @brief Updates the SystemCoreClock with current core Clock
 * retrieved from cpu registers.
 */
void SystemCoreClockUpdate(void);

/**
 * Initialize flash.
 */
void system_init_flash(uint32_t ul_clk);

/* @cond 0 */
/**INDENT-OFF**/
#ifdef __cplusplus
}
#endif
/**INDENT-ON**/
/* @endcond */

#endif /* SYSTEM_SAM3U_H_INCLUDED */


text:
var path = require('path');
var webpack = require('webpack');
require('dotenv').config();

var LessPluginCleanCSS = require('less-plugin-clean-css');
var ExtractTextPlugin = require('extract-text-webpack-plugin');

const GLOBALS = {
  'process.env.NODE_ENV': JSON.stringify(process.env.NODE_ENV),
  __DEV__: process.env.NODE_ENV !== 'production'
};

module.exports = {

  devtool: 'source-map',
  noInfo: true,
  debug: false,

  entry : [
    './src/index'
  ],

  module : {
    loaders : [
      { test: /\.(jpe?g|png|gif|svg)$/i, loaders: ['file']},
      { test: /\.(xml)$/i, loaders: ['file']},
      { test: /\.(ttf|eot)$/, loader: 'file' },
      {
        test: /\.js$/,
        loaders: ['babel'],
        include: path.join(__dirname, 'src')
      },
      {
        test: /\.less$/,
        loader: ExtractTextPlugin.extract('css!less')
      }
    ]
  },

  plugins  : [
    new ExtractTextPlugin('../css/styles.css'),
    new webpack.optimize.DedupePlugin(),
    new webpack.optimize.UglifyJsPlugin(),
    new webpack.optimize.OccurenceOrderPlugin(),
    new webpack.DefinePlugin(GLOBALS) //Tells React to build in prod mode. https://facebook.github.io/react/downloads.html
  ],

  output : {
    path: path.join(__dirname, 'dist/js'),
    filename: 'bundle.js',
    publicPath: '/js/'
  },

  lessLoader : {
    lessPlugins: [
      new LessPluginCleanCSS({advanced: true})
    ]
  }
};


text:
module LunarShell
  module Satellites
    class ClearController < LunarShell::SatellitesController
      def run
      end
    end
  end
end


text:
from __future__ import unicode_literals, print_function

from ..language import Language
from ..attrs import LANG
from .language_data import *

class Swedish(Language):
    lang = 'sv'

    class Defaults(Language.Defaults):
        lex_attr_getters = dict(Language.Defaults.lex_attr_getters)
        lex_attr_getters[LANG] = lambda text: 'sv'

        tokenizer_exceptions = TOKENIZER_EXCEPTIONS
        stop_words = STOP_WORDS


text:
/*
 *
 * University of Luxembourg
 * Laboratory of Algorithmics, Cryptology and Security (LACS)
 *
 * FELICS - Fair Evaluation of Lightweight Cryptographic Systems
 *
 * Copyright (C) 2015 University of Luxembourg
 *
 * Written in 2015 by Daniel Dinu <dumitru-daniel.dinu@uni.lu>
 *
 * This file is part of FELICS.
 *
 * FELICS is free software; you can redistribute it and/or modify
 * it under the terms of the GNU General Public License as published by
 * the Free Software Foundation; either version 3 of the License, or
 * (at your option) any later version.
 *
 * FELICS is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 * GNU General Public License for more details.
 *
 * You should have received a copy of the GNU General Public License
 * along with this program; if not, see <http://www.gnu.org/licenses/>.
 *
 */

#include <stdint.h>

#include "cipher.h"
#include "constants.h"
#include "primitives.h"

#define RK(x, y) READ_ROUND_KEY_DOUBLE_WORD(x[y])

void Encrypt(uint8_t *block, uint8_t *roundKeys)
{
	uint32_t* blk = (uint32_t*) block;
	uint32_t* rk = (uint32_t*) roundKeys;
	uint32_t tmp;
	int8_t i;

	uint32_t b0 = blk[0];
	uint32_t b1 = blk[1];
	uint32_t b2 = blk[2];
	uint32_t b3 = blk[3];

	for (i = 0; i < NUMBER_OF_ROUNDS; ++i, rk += 4) {
		b3 = rotr((b2 ^ RK(rk, 3)) + (b3 ^ RK(rk, 1)), 3);
		b2 = rotr((b1 ^ RK(rk, 2)) + (b2 ^ RK(rk, 1)), 5);
		b1 = rotl((b0 ^ RK(rk, 0)) + (b1 ^ RK(rk, 1)), 9);

		tmp = b0;
		b0 = b1;
		b1 = b2;
		b2 = b3;
		b3 = tmp;
	}

	blk[0] = b0;
	blk[1] = b1;
	blk[2] = b2;
	blk[3] = b3;
}


text:
package org.gnieh.logback.config;

import com.typesafe.config.Config;

/**
 * Typesafe config loader interface.
 */
@FunctionalInterface
public interface ConfigLoader {
    Config load() throws Exception;
}


text:
package dae.prefabs.parameters;

import dae.components.ComponentType;
import java.util.logging.Level;
import java.util.logging.Logger;

/**
 *
 * @author Koen Samyn
 */
public class EnumListParameter extends Parameter{
    private Object[] choices;
    private Class enumClass;
    /**
     * Creates a new EnumListParameter object.
     * @param componentType componentType the component type of the parameter.
     * @param type the type of the parameter
     * @param id the id of the parameter.
     */
    public EnumListParameter(ComponentType componentType, String type, String id){
        super(componentType, type, id);
    }

    /**
     * Sets the enum class of this enum list parameter.
     * @param className the name of the enum class.
     */
    public void setEnumClass(String className){
        try {
            enumClass = Class.forName(className);
            choices = enumClass.getEnumConstants();
        } catch (ClassNotFoundException ex) {
            Logger.getLogger("DArtE").log(Level.SEVERE, null, ex);
        }
    }

    /**
     * Converts the string to the correct enum value.
     * @param value
     * @return
     */
    public Object getEnum(String value){
        return Enum.valueOf(enumClass, value);
    }

    /**
     * Gets the list of choices from this EnumList parameter.
     * @return the list of choices as an array.
     */
    public Object[] getChoices() {
        return choices;
    }
}


text:
package org.springframework.jmx.export;

import java.util.Date;

/**
 * @author Rob Harrop
 */
public class DateRange {

	private Date startDate;

	private Date endDate;

	public Date getStartDate() {
		return startDate;
	}

	public void setStartDate(Date startDate) {
		this.startDate = startDate;
	}

	public Date getEndDate() {
		return endDate;
	}

	public void setEndDate(Date endDate) {
		this.endDate = endDate;
	}

}


text:
import Euclidean3 = require('davinci-blade/Euclidean3');

/**
 * Constructs and returns a Euclidean 3D vector from its cartesian components.
 * @param x The x component of the vector.
 * @param y The y component of the vector.
 * @param z The z component of the vector.
 */
var vectorE3 = function(x: number, y: number, z: number): Euclidean3 {
    return new Euclidean3(0, x, y, z, 0, 0, 0, 0);
};
export = vectorE3;


text:
class Solution {
public:
    vector<string> wordsAbbreviation(vector<string>& dict) {
        unordered_map<string, unordered_set<string>> abbr_to_word;
        unordered_map<string, string> word_to_abbr;

        for (const auto& word : dict) {
            const auto prefix = word.substr(0, 1);
            abbr_to_word[toAbbr(prefix, word)].emplace(word);
        }

        for (const auto& kvp : abbr_to_word) {
            if (kvp.second.size() > 1) {
                for (const auto& word : kvp.second) {
                    for (int i = 2; i < word.length(); ++i) {
                        const auto prefix = word.substr(0, i);
                        if (isUnique(prefix, kvp.second)) {
                            word_to_abbr[word] = toAbbr(prefix, word);
                            break;
                        }
                    }
                }
            } else {
                word_to_abbr[*kvp.second.begin()] = kvp.first;
            }
        }

        vector<string> result;
        for (const auto& word : dict) {
            result.emplace_back(word_to_abbr[word]);
        }
        return result;
    }

private:
    bool isUnique(const string& prefix, const unordered_set<string>& words) {
        return 1 == count_if(words.begin(), words.end(),
                             [&prefix](const string& word) {
                                 return !word.compare(0, prefix.length(), prefix);
                             });
    }

    string toAbbr(const string& prefix, const string& word) {
        string abbr = prefix;
        abbr += to_string(word.length() - 1 - prefix.length());
        abbr += word.back();
        return abbr.length() < word.length() ? abbr : word;
    }
};


text:
title: Tribonacci non-divisors
localeTitle: 非除数三角
---
## 问题225:Tribonacci非除数

这是一个存根。 [帮助我们的社区扩展它](https://github.com/freecodecamp/guides/tree/master/src/pages/certifications/coding-interview-prep/project-euler/problem-225-tribonacci-non-divisors/index.md) 。

[这种快速风格指南有助于确保您的拉取请求被接受](https://github.com/freecodecamp/guides/blob/master/README.md) 。


text:
extern NSString * const ACOParserErrorDomain;

typedef NS_ENUM(NSUInteger, ACOParserError) {
    ACOParserErrorUnexpectedEndOfFile = 1,
    ACOParserErrorUnknownVersion = 2,
};

@interface NSError (ACOParserError)

+ (instancetype)aco_parserErrorWithType:(ACOParserError)error;

@end


text:
package org.nd4j.linalg.api.ops.impl.scalar;

import org.nd4j.autodiff.samediff.SDVariable;
import org.nd4j.autodiff.samediff.SameDiff;
import org.nd4j.imports.NoOpNameFoundException;
import org.nd4j.linalg.api.ndarray.INDArray;
import org.nd4j.linalg.api.ops.BaseScalarOp;
import org.nd4j.linalg.api.ops.BaseTransformOp;

import java.util.List;

/**
 * Element-wise "Replace NaN" implementation as Op
 *
 * @author raver119@gmail.com
 */
public class ReplaceNans extends BaseScalarOp {

    private double set;

    public ReplaceNans(SameDiff sameDiff, SDVariable i_v, boolean inPlace, double set) {
        super(sameDiff, i_v, set, inPlace);
        this.set = set;
    }

    public ReplaceNans(SameDiff sameDiff, SDVariable i_v, Object[] extraArgs, double set) {
        super(sameDiff, i_v, set, extraArgs);
        this.set = set;
    }

    public ReplaceNans() {

    }

    public ReplaceNans(INDArray x, double set) {
        super(x, null, x, set);
        this.set = set;
        this.extraArgs = new Object[] {set};
    }

    public ReplaceNans(INDArray x, INDArray z, double set) {
        super(x, z, set);
        this.set = set;
        this.extraArgs = new Object[] {set};
    }

    @Override
    public int opNum() {
        return 37;
    }

    @Override
    public String opName() {
        return "replace_nans";
    }

    @Override
    public String onnxName() {
        throw new NoOpNameFoundException("No onnx op opName found for " +  opName());
    }

    @Override
    public String tensorflowName() {
        throw new NoOpNameFoundException("No tensorflow op opName found for " +  opName());
    }

    @Override
    public List<SDVariable> doDiff(List<SDVariable> f1) {
        return null;
    }
}


text:
#ifndef DCSTACK_H
#define DCSTACK_H

#include "dcmtk/config/osconfig.h"    /* make sure OS specific configuration is included first */
#include "dcmtk/ofstd/oftypes.h"
#include "dcmtk/dcmdata/dcdefine.h"

class DcmObject;    // forward declaration

/** helper class used by DcmStack.  Maintains a single stack entry.
 */
class DCMTK_DCMDATA_EXPORT DcmStackNode
{
public:
    /** constructor.
     *  @param obj object pointer for this stack entry
     */
    DcmStackNode(DcmObject *obj);

    /// destructor, non virtual.
    ~DcmStackNode();

    /** return pointer maintained by this entry
     *  @return object pointer
     */
    DcmObject *value() const;

private:
    /// private undefined copy constructor
    DcmStackNode(const DcmStackNode &);

    /// private undefined copy assignment operator
    DcmStackNode &operator=(const DcmStackNode &);

    /// pointer to next stack entry, NULL if last one
    DcmStackNode *link;

    /// pointer to object referenced by this stack entry
    DcmObject *objNodeValue;

    /// class DcmStack directly manipulates the pointer chain
    friend class DcmStack;
};

/** this class manages a stack of pointers to DcmObject instances.
 *  The objects pointed to are never touched, e.g. deleted.
 */
class DCMTK_DCMDATA_EXPORT DcmStack
{
public:
    /// default constructor, creates empty stack
    DcmStack();

    /** copy constructor. Only pointers to objects are copied,
     *  the DcmObject instances are not duplicated.
     *  @param arg stack to copy from
     */
    DcmStack(const DcmStack& arg);

    /// destructor, not virtual. Do not derive from this class.
    ~DcmStack();

    /** copy assignment operator.  Only pointers to objects are copied,
     *  the DcmObject instances are not duplicated.
     *  @param arg object to assign from
     *  @return reference to this object
     */
    DcmStack& operator=(const DcmStack &arg);

    /** comparison operator, needed for MSVC5.
     *  @param arg stack to compare to
     *  @return true if stacks are equal, false otherwise
     */
    OFBool operator==(const DcmStack& arg) const;

    /** dummy comparison operator, needed for MSVC5.
     *  @param arg stack to compare to
     *  @return true if the cardinality of this stack is smaller than the
     *     cardinality of arg, or if the cardinality is equal and pointer
     *     comparison, from the top to the bottom of the stack results
     *     in a smaller pointer for this stack.
     */
    OFBool operator<(const DcmStack& arg) const;

    /** push new pointer do DcmObject instance on stack
     *  @param obj object pointer to push on stack
     *  @return pointer passed as obj
     */
    DcmObject* push( DcmObject *obj );

    /** removes uppermost entry from stack and returns it.
     *  @return uppermost stack entry
     */
    DcmObject* pop();

    /** returns uppermost entry of stack without removing it.
     *  @returns uppermost stack entry
     */
    DcmObject* top() const;

    /** returns n-th element from stack without removing it.
     *  @return n-th element from stack
     */
    DcmObject* elem(const unsigned long number) const;

    /** checks if the stack is empty
     *  @return true if stack is empty, false otherwise
     */
    OFBool empty() const;

    /** returns cardinality (number of entries) of the stack
     *  @return cardinality of stack
     */
    unsigned long card() const;

    /** returns the stack to default-constructed state, i.e. empty state.
     */
    void clear();

private:
    /// pointer to the upmost stack entry, NULL if empty
    DcmStackNode *topNode_;

    /// current cardinality of the stack
    unsigned long cardinality_;
};

#endif  // DCSTACK_H


text:
// Copyright 2009 the Sputnik authors.  All rights reserved.
/**
 * String.prototype.toLocaleLowerCase()
 *
 * @path ch15/15.5/15.5.4/15.5.4.17/S15.5.4.17_A1_T8.js
 * @description Call toLocaleLowerCase() function of Infinity
 */

Number.prototype.toLocaleLowerCase = String.prototype.toLocaleLowerCase;

if (Infinity.toLocaleLowerCase()!== "infinity") {
  $ERROR('#1: Number.prototype.toLocaleLowerCase = String.prototype.toLocaleLowerCase; Infinity.toLocaleLowerCase()=== "infinity". Actual: '+Infinity.toLocaleLowerCase());
}


text:
package org.commcare.core.interfaces;

import org.commcare.cases.ledger.Ledger;
import org.commcare.cases.model.Case;
import org.commcare.cases.model.StorageIndexedTreeElementModel;
import org.javarosa.core.model.IndexedFixtureIdentifier;
import org.javarosa.core.model.User;
import org.javarosa.core.model.instance.FormInstance;
import org.javarosa.core.model.instance.TreeElement;
import org.javarosa.core.services.storage.IStorageUtilityIndexed;

import java.util.Set;

/**
 *  Interface to be implemented by sandboxes for a user's CommCare instance data
 *
 *  @author wpride1
 */
public abstract class UserSandbox {

    private String syncToken;

    public abstract IStorageUtilityIndexed<Case> getCaseStorage();

    public abstract IStorageUtilityIndexed<Ledger> getLedgerStorage();

    public abstract IStorageUtilityIndexed<User> getUserStorage();

    /**
     * Get user-level (encrypted) storage for a storage-indexed fixture
     */
    public abstract IStorageUtilityIndexed<StorageIndexedTreeElementModel> getIndexedFixtureStorage(String fixtureName);

    /**
     * Setup indexed fixture storage table and indexes over that table.
     * Must clear existing data associated with the given fixture.
     */
    public abstract void setupIndexedFixtureStorage(String fixtureName,
                                                    StorageIndexedTreeElementModel exampleEntry,
                                                    Set<String> indices);

    /**
     * Gets the base and child name associated with a fixture id.
     *
     * For example, gets 'products' and 'products' for the data instance
     * "instance('commtrack:products')/products/product/..."
     */
    public abstract IndexedFixtureIdentifier getIndexedFixtureIdentifier(String fixtureName);

    /**
     * Associates a fixture with a base name and child name.
     *
     * For example, to instantiate a data instance like "instance('commtrack:products')/products/product/..."
     * we must associate 'commtrack:products' with the 'products' base name and the 'product' child name.
     */
    public abstract void setIndexedFixturePathBases(String fixtureName, String baseName, String childName, TreeElement attrs);

    public abstract IStorageUtilityIndexed<FormInstance> getUserFixtureStorage();

    public abstract IStorageUtilityIndexed<FormInstance> getAppFixtureStorage();

    public abstract User getLoggedInUser();

    public abstract User getLoggedInUserUnsafe() throws RuntimeException;

    public abstract void setLoggedInUser(User user);

    public void setSyncToken(String syncToken){
        this.syncToken = syncToken;
    }

    public String getSyncToken(){
        return syncToken;
    }
}


text:
<?php

/**
 * Swaggy Jenkins
 * PHP version 7.4
 *
 * @package OpenAPIServer
 * @author  OpenAPI Generator team
 * @link    https://github.com/openapitools/openapi-generator
 */

/**
 * Jenkins API clients generated from Swagger / Open API specification
 * The version of the OpenAPI document: 1.5.1-pre.0
 * Contact: blah@cliffano.com
 * Generated by: https://github.com/openapitools/openapi-generator.git
 */

/**
 * NOTE: This class is auto generated by the openapi generator program.
 * https://github.com/openapitools/openapi-generator
 * Please update the test case below to test the model.
 */
namespace OpenAPIServer\Model;

use PHPUnit\Framework\TestCase;
use OpenAPIServer\Model\BranchImplpermissions;

/**
 * BranchImplpermissionsTest Class Doc Comment
 *
 * @package OpenAPIServer\Model
 * @author  OpenAPI Generator team
 * @link    https://github.com/openapitools/openapi-generator
 *
 * @coversDefaultClass \OpenAPIServer\Model\BranchImplpermissions
 */
class BranchImplpermissionsTest extends TestCase
{

    /**
     * Setup before running any test cases
     */
    public static function setUpBeforeClass(): void
    {
    }

    /**
     * Setup before running each test case
     */
    public function setUp(): void
    {
    }

    /**
     * Clean up after running each test case
     */
    public function tearDown(): void
    {
    }

    /**
     * Clean up after running all test cases
     */
    public static function tearDownAfterClass(): void
    {
    }

    /**
     * Test "BranchImplpermissions"
     */
    public function testBranchImplpermissions()
    {
        $testBranchImplpermissions = new BranchImplpermissions();
        $namespacedClassname = BranchImplpermissions::getModelsNamespace() . '\\BranchImplpermissions';
        $this->assertSame('\\' . BranchImplpermissions::class, $namespacedClassname);
        $this->assertTrue(
            class_exists($namespacedClassname),
            sprintf('Assertion failed that "%s" class exists', $namespacedClassname)
        );
        $this->markTestIncomplete(
            'Test of "BranchImplpermissions" model has not been implemented yet.'
        );
    }

    /**
     * Test attribute "create"
     */
    public function testPropertyCreate()
    {
        $this->markTestIncomplete(
            'Test of "create" property in "BranchImplpermissions" model has not been implemented yet.'
        );
    }

    /**
     * Test attribute "read"
     */
    public function testPropertyRead()
    {
        $this->markTestIncomplete(
            'Test of "read" property in "BranchImplpermissions" model has not been implemented yet.'
        );
    }

    /**
     * Test attribute "start"
     */
    public function testPropertyStart()
    {
        $this->markTestIncomplete(
            'Test of "start" property in "BranchImplpermissions" model has not been implemented yet.'
        );
    }

    /**
     * Test attribute "stop"
     */
    public function testPropertyStop()
    {
        $this->markTestIncomplete(
            'Test of "stop" property in "BranchImplpermissions" model has not been implemented yet.'
        );
    }

    /**
     * Test attribute "class"
     */
    public function testPropertyClass()
    {
        $this->markTestIncomplete(
            'Test of "class" property in "BranchImplpermissions" model has not been implemented yet.'
        );
    }

    /**
     * Test getOpenApiSchema static method
     * @covers ::getOpenApiSchema
     */
    public function testGetOpenApiSchema()
    {
        $schemaArr = BranchImplpermissions::getOpenApiSchema();
        $this->assertIsArray($schemaArr);
    }
}


text:
# Version
include(SequoiaEditorVersion)

# Git version string
sequoia_get_git_head_revision(git_refspec git_hash)
string(SUBSTRING ${git_hash} 0 7 git_hash_short)
if(NOT DEFINED SEQUOIA_EDITOR_GIT_HASH OR NOT "${SEQUOIA_EDITOR_GIT_HASH}" STREQUAL "${git_hash_short}")
  set(SEQUOIA_EDITOR_GIT_HASH "${git_hash_short}"
      CACHE INTERNAL "git hash (short) of current head" FORCE)
endif()

# Assemble full version string
string(TOLOWER ${SEQUOIA_ARCHITECTURE_STRING} architecture)
string(TOLOWER ${SEQUOIA_PLATFORM_STRING} platform)
string(TOLOWER ${CMAKE_CXX_COMPILER_ID} compiler)
set(compiler "${compiler}-${CMAKE_CXX_COMPILER_VERSION}")
set(SEQUOIA_EDITOR_FULL_VERSION
    "${SEQUOIA_EDITOR_VERSION}-${SEQUOIA_EDITOR_GIT_HASH}-${architecture}-${platform}-${compiler}"
    CACHE STRING "Full version string of Sequoia" FORCE)
mark_as_advanced(SEQUOIA_EDITOR_FULL_VERSION)

# Installation definitions
set(SEQUOIA_EDITOR_INSTALL_BIN_DIR bin
    CACHE INTERNAL "Relative path of the binary install location" FORCE)
set(SEQUOIA_EDITOR_INSTALL_INCLUDE_DIR include
    CACHE INTERNAL "Relative path of the include install location" FORCE)
set(SEQUOIA_EDITOR_INSTALL_LIB_DIR lib
    CACHE INTERNAL "Relative path of the library install location " FORCE)
set(SEQUOIA_EDITOR_INSTALL_CMAKE_DIR cmake/sequoia-engine
    CACHE INTERNAL "Relative path of the cmake install location" FORCE)


text:
package org.apache.commons.vfs2;

/**
 * This interface is used to select files when traversing the direct children of the base.
 *
 * @author Commons VFS team
 */
public interface FileFilter
{
    /**
     * Determines if a file or folder should be selected.
     *
     * @param fileInfo the file or folder to select.
     * @return true if the file should be selected.
     */
    boolean accept(final FileSelectInfo fileInfo);
}


text:
@interface SpeechInputLocaleMatchConfig : UpdatableArray

// Access to singleton object.
+ (instancetype)sharedInstance;

// The SpeechInputLocaleMatches loaded from the plist.
@property(nonatomic, readonly) NSArray* matches;

@end

// Object describing the locale codes that match a single supported locale.
@interface SpeechInputLocaleMatch : NSObject

// Designated initializer.
- (instancetype)initWithDictionary:(NSDictionary*)matchDict
    NS_DESIGNATED_INITIALIZER;
- (instancetype)init NS_UNAVAILABLE;

// The locale code that should be used as the default code for the locale codes
// found in |matchingLocaleCodes|.
@property(nonatomic, readonly) NSString* matchedLocaleCode;

// The locale codes that should be matched with |matchedLocaleCode|.
@property(nonatomic, readonly) NSArray* matchingLocaleCodes;

// The languages that use |matchedLocaleCode| as a default.
@property(nonatomic, readonly) NSArray* matchingLanguages;

@end

#endif  // IOS_CHROME_BROWSER_VOICE_SPEECH_INPUT_LOCALE_MATCH_CONFIG_H_


text:
'use strict';
// Declare app level module which depends on filters, and services
angular.module('myApp', ['ngRoute', 'ngCookies', 'myApp.filters', 'myApp.services', 'myApp.directives', 'myApp.controllers'])
.config(['$routeProvider', '$locationProvider',
    function($routeProvider, $locationProvider) {
        $routeProvider.when('/play/:comp/:group', {
            templateUrl: 'partials/partial1.html',
            controller: 'MyCtrl1'
        });
        $routeProvider.when('/edit/:comp?', {
            templateUrl: 'partials/partial4.html',
            controller: 'MyCtrl4'
        });
        $routeProvider.when('/about', {
            templateUrl: 'partials/about.html',
            controller: 'MyCtrl2'
        });
        $routeProvider.otherwise({
            redirectTo: '/edit/'
        });
        // use the HTML5 History API (for clean urls)
        $locationProvider.html5Mode(true);
    }
]);


text:
/**
 * @file libohigrove/analog-in.c
 * @author Marco Giammarini <m.giammarini@warcomeb.it>
 * @brief
 */

#include "analog-in.h"

void OhiGroveAnalogIn_init (OhiGroveAnalogIn_Device* dev)
{
    dev->pin = OhiGrove_getAnalogPin(dev->connector,OHIGROVE_PIN_NUMBER_1);

    if (dev->pin != ADC_PINS_NONE)
    {
    	dev->device = OhiGrove_getAnalogDevice(dev->connector,OHIGROVE_PIN_NUMBER_1);
    	dev->channel = OhiGrove_getAnalogChannel(dev->connector,OHIGROVE_PIN_NUMBER_1);

        Adc_enablePin(dev->device,dev->pin);
    }
    else
    {
    	return; /* TODO: add errors! */
    }
}

uint16_t OhiGroveAnalogIn_get (OhiGroveAnalogIn_Device* dev)
{
    uint16_t result;

    Adc_readValue(dev->device,dev->channel,&result,ADC_INPUTTYPE_SINGLE_ENDED);
    return result;
}


text:
namespace grpc_event_engine {
namespace experimental {

namespace {
std::atomic<absl::AnyInvocable<std::unique_ptr<EventEngine>()>*>
    g_event_engine_factory{nullptr};
std::atomic<EventEngine*> g_event_engine{nullptr};
}  // namespace

void SetDefaultEventEngineFactory(
    absl::AnyInvocable<std::unique_ptr<EventEngine>()> factory) {
  delete g_event_engine_factory.exchange(
      new absl::AnyInvocable<std::unique_ptr<EventEngine>()>(
          std::move(factory)));
}

std::unique_ptr<EventEngine> CreateEventEngine() {
  if (auto* factory = g_event_engine_factory.load()) {
    return (*factory)();
  }
  return DefaultEventEngineFactory();
}

EventEngine* GetDefaultEventEngine() {
  EventEngine* engine = g_event_engine.load(std::memory_order_acquire);
  if (engine == nullptr) {
    auto* created = CreateEventEngine().release();
    if (g_event_engine.compare_exchange_strong(engine, created,
                                               std::memory_order_acq_rel,
                                               std::memory_order_acquire)) {
      engine = created;
    } else {
      delete created;
    }
  }
  return engine;
}

void ResetDefaultEventEngine() {
  delete g_event_engine.exchange(nullptr, std::memory_order_acq_rel);
}

}  // namespace experimental
}  // namespace grpc_event_engine


text:
<?xml version="1.0" encoding="utf-8"?><!-- Copyright (C) 2013 Menny Even-Danan

     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.
-->
<resources xmlns:android="http://schemas.android.com/apk/res/android">

    <style name="LeanDark" parent="@style/AnyKeyboardBaseTheme">
        <item name="android:background">@drawable/lean_dark_keyboard_background</item>
        <item name="keyVerticalGap">@dimen/plain_theme_key_horizontal_gap</item>
        <item name="keyBackground">@drawable/lean_dark_btn</item>
        <item name="keyPreviewBackground">@drawable/lean_dark_popup_keyboard_background</item>
        <item name="suggestionBackgroundImage">@drawable/lean_dark_candidates_background</item>

        <!-- I said Lean theme, so no garbage on the screen please. -->
        <item name="keyboardNameTextColor">#F666</item>
        <item name="hintTextSize">0px</item>

        <item name="keyTextStyle">normal</item>
        <item name="shadowRadius">0px</item>

        <item name="previewAnimationType">extend_key</item>
    </style>

    <style name="LeanDarkPopup" parent="@style/AnyKeyboardPopupBaseTheme">
        <item name="android:background">@drawable/lean_dark_popup_keyboard_background</item>
        <item name="keyBackground">@drawable/lean_dark_btn_popup</item>
        <item name="keyTextStyle">normal</item>
        <item name="shadowRadius">0px</item>
    </style>

    <style name="LeanDark2" parent="@style/LeanDark">
        <item name="keyTextSize">@dimen/lean_key_text_size</item>
        <item name="keyTextStyle">bold</item>
        <item name="hintTextSize">@dimen/key_hint_text_size</item>
    </style>

    <style name="LeanDarkPopup2" parent="@style/LeanDarkPopup">
        <item name="keyTextSize">@dimen/lean_key_text_size</item>
        <item name="keyTextStyle">bold</item>
    </style>

    <style name="LeanDarkBig" parent="@style/LeanDark2">
        <item name="keyNormalHeight">@dimen/big_key_height</item>
        <item name="keySmallHeight">@dimen/big_key_half_height</item>
        <item name="keyLargeHeight">@dimen/big_key_tall_height</item>
        <item name="keyTextSize">@dimen/lean_big_key_text_size</item>
    </style>

    <style name="LeanDarkPopupBig" parent="@style/LeanDarkPopup2">
        <item name="keyNormalHeight">@dimen/big_key_height</item>
        <item name="keySmallHeight">@dimen/big_key_half_height</item>
        <item name="keyLargeHeight">@dimen/big_key_tall_height</item>
        <item name="keyTextSize">@dimen/lean_big_key_text_size</item>
    </style>

    <style name="LeanDarkGray" parent="@style/LeanDark">
        <item name="android:background">@drawable/lean_dark_gray_keyboard_background</item>
        <item name="suggestionBackgroundImage">@drawable/lean_dark_gray_candidates_background</item>
    </style>
</resources>


text:
package es.molabs.jdbc.mapper;

import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;
import java.io.Reader;
import java.sql.Blob;
import java.sql.Clob;
import java.sql.SQLException;

import es.molabs.jdbc.exception.DbException;

public final class DbRowMapperUtils
{
	private DbRowMapperUtils()
	{
	}

	public static String blobToString(Blob blob)
	{
		if (blob == null) return null;

		try
		{
			int offset = -1;
			int chunkSize = 1024;
			long blobLength = blob.length();

			if (chunkSize > blobLength)
			{
				chunkSize = (int)blobLength;
			}

			char buffer[] = new char[chunkSize];

			StringBuilder stringBuilder = new StringBuilder();
			Reader reader = new InputStreamReader(blob.getBinaryStream());

			while ((offset = reader.read(buffer)) != -1)
			{
				stringBuilder.append(buffer, 0, offset);
			}

			return stringBuilder.toString();
		}
		catch (SQLException SQLe)
		{
			throw new DbException(SQLe);
		}
		catch (IOException IOe)
		{
			throw new DbException(IOe);
		}
	}

	public static String clobToString(Clob clob) throws SQLException
	{
		if (clob == null) return null;

		try
		{
			Reader reader = clob.getCharacterStream();
	        BufferedReader bufferedReader = new BufferedReader(reader);

	        // The text length should not be greater than Integer.MAX_VALUE
	        StringBuilder stringBuilder = new StringBuilder((int) clob.length());

			String line = null;
	        while ((line = bufferedReader.readLine()) != null)
	        {
	        	stringBuilder.append(line);
	        }

	        bufferedReader.close();

	        return stringBuilder.toString();
		}
		catch (IOException IOe)
		{
			throw new SQLException(IOe);
		}
	}
}


text:
import * as React from "react"
import { CreateEvent } from "../components/events/CreateEvent"

export const CreateEventView = () => (
    <div>
        <CreateEvent />
    </div>
)


text:
// Copyright (c) Microsoft.  All Rights Reserved.  Licensed under the Apache License, Version 2.0.  See License.txt in the project root for license information.

using System;
using System.Collections;
using System.Collections.Immutable;
using Microsoft.CodeAnalysis.CodeStyle;
using Microsoft.CodeAnalysis.Diagnostics;
using Microsoft.CodeAnalysis.LanguageServices;
using Microsoft.CodeAnalysis.Options;
using Microsoft.CodeAnalysis.Text;

namespace Microsoft.CodeAnalysis.UseCollectionInitializer
{
    internal abstract partial class AbstractUseCollectionInitializerDiagnosticAnalyzer<
        TSyntaxKind,
        TExpressionSyntax,
        TStatementSyntax,
        TObjectCreationExpressionSyntax,
        TMemberAccessExpressionSyntax,
        TInvocationExpressionSyntax,
        TExpressionStatementSyntax,
        TVariableDeclaratorSyntax>
        : AbstractCodeStyleDiagnosticAnalyzer
        where TSyntaxKind : struct
        where TExpressionSyntax : SyntaxNode
        where TStatementSyntax : SyntaxNode
        where TObjectCreationExpressionSyntax : TExpressionSyntax
        where TMemberAccessExpressionSyntax : TExpressionSyntax
        where TInvocationExpressionSyntax : TExpressionSyntax
        where TExpressionStatementSyntax : TStatementSyntax
        where TVariableDeclaratorSyntax : SyntaxNode
    {
        public override bool OpenFileOnly(Workspace workspace) => false;
        public override DiagnosticAnalyzerCategory GetAnalyzerCategory() => DiagnosticAnalyzerCategory.SemanticDocumentAnalysis;

        protected AbstractUseCollectionInitializerDiagnosticAnalyzer()
            : base(IDEDiagnosticIds.UseCollectionInitializerDiagnosticId,
                   new LocalizableResourceString(nameof(FeaturesResources.Simplify_collection_initialization), FeaturesResources.ResourceManager, typeof(FeaturesResources)),
                   new LocalizableResourceString(nameof(FeaturesResources.Collection_initialization_can_be_simplified), FeaturesResources.ResourceManager, typeof(FeaturesResources)))
        {
        }

        protected override void InitializeWorker(AnalysisContext context)
            => context.RegisterCompilationStartAction(OnCompilationStart);

        private void OnCompilationStart(CompilationStartAnalysisContext context)
        {
            var ienumerableType = context.Compilation.GetTypeByMetadataName(typeof(IEnumerable).FullName);
            if (ienumerableType != null)
            {
                context.RegisterSyntaxNodeAction(
                    nodeContext => AnalyzeNode(nodeContext, ienumerableType),
                    GetObjectCreationSyntaxKind());
            }
        }

        protected abstract bool AreCollectionInitializersSupported(SyntaxNodeAnalysisContext context);
        protected abstract TSyntaxKind GetObjectCreationSyntaxKind();

        private void AnalyzeNode(SyntaxNodeAnalysisContext context, INamedTypeSymbol ienumerableType)
        {
            if (!AreCollectionInitializersSupported(context))
            {
                return;
            }

            var semanticModel = context.SemanticModel;
            var objectCreationExpression = (TObjectCreationExpressionSyntax)context.Node;
            var language = objectCreationExpression.Language;
            var syntaxTree = objectCreationExpression.SyntaxTree;
            var cancellationToken = context.CancellationToken;

            var optionSet = context.Options.GetDocumentOptionSetAsync(syntaxTree, cancellationToken).GetAwaiter().GetResult();
            if (optionSet == null)
            {
                return;
            }

            var option = optionSet.GetOption(CodeStyleOptions.PreferCollectionInitializer, language);
            if (!option.Value)
            {
                // not point in analyzing if the option is off.
                return;
            }

            // Object creation can only be converted to collection initializer if it
            // implements the IEnumerable type.
            var objectType = context.SemanticModel.GetTypeInfo(objectCreationExpression, cancellationToken);
            if (objectType.Type == null || !objectType.Type.AllInterfaces.Contains(ienumerableType))
            {
                return;
            }

            var matches = ObjectCreationExpressionAnalyzer<TExpressionSyntax, TStatementSyntax, TObjectCreationExpressionSyntax, TMemberAccessExpressionSyntax, TInvocationExpressionSyntax, TExpressionStatementSyntax, TVariableDeclaratorSyntax>.Analyze(
                semanticModel, GetSyntaxFactsService(), objectCreationExpression, cancellationToken);

            if (matches == null || matches.Value.Length == 0)
            {
                return;
            }

            var containingStatement = objectCreationExpression.FirstAncestorOrSelf<TStatementSyntax>();
            var nodes = ImmutableArray.Create<SyntaxNode>(containingStatement).AddRange(matches.Value);
            var syntaxFacts = GetSyntaxFactsService();
            if (syntaxFacts.ContainsInterleavedDirective(nodes, cancellationToken))
            {
                return;
            }

            var locations = ImmutableArray.Create(objectCreationExpression.GetLocation());

            var severity = option.Notification.Value;
            context.ReportDiagnostic(Diagnostic.Create(
                CreateDescriptorWithSeverity(severity),
                objectCreationExpression.GetLocation(),
                additionalLocations: locations));

            FadeOutCode(context, optionSet, matches.Value, locations);
        }

        private void FadeOutCode(
            SyntaxNodeAnalysisContext context,
            OptionSet optionSet,
            ImmutableArray<TExpressionStatementSyntax> matches,
            ImmutableArray<Location> locations)
        {
            var syntaxTree = context.Node.SyntaxTree;

            var fadeOutCode = optionSet.GetOption(
                CodeStyleOptions.PreferCollectionInitializer_FadeOutCode, context.Node.Language);
            if (!fadeOutCode)
            {
                return;
            }

            var syntaxFacts = GetSyntaxFactsService();

            foreach (var match in matches)
            {
                var expression = syntaxFacts.GetExpressionOfExpressionStatement(match);

                if (syntaxFacts.IsInvocationExpression(expression))
                {
                    var arguments = syntaxFacts.GetArgumentsOfInvocationExpression(expression);
                    var location1 = Location.Create(syntaxTree, TextSpan.FromBounds(
                        match.SpanStart, arguments[0].SpanStart));

                    context.ReportDiagnostic(Diagnostic.Create(
                        UnnecessaryWithSuggestionDescriptor, location1, additionalLocations: locations));

                    context.ReportDiagnostic(Diagnostic.Create(
                        UnnecessaryWithoutSuggestionDescriptor,
                        Location.Create(syntaxTree, TextSpan.FromBounds(
                            arguments.Last().FullSpan.End,
                            match.Span.End)),
                        additionalLocations: locations));
                }
            }
        }

        protected abstract ISyntaxFactsService GetSyntaxFactsService();
    }
}


text:
// simple stream object to handle apache gitpubsub json events
var Stream    = require('stream').Stream,
    libraries = require('../libraries');

module.exports = function apache_gitpubsub_parser(callback) {
    var s = new Stream();
    s.writable = true;
    s.write = function(data) {
        try {
            var json = data.toString();
            json = json.substr(0,json.length-3); // get rid of trailing comma
            json = JSON.parse(json);
            if (json.stillalive) return true; // if its just a keepalive ping ignore it
            if (json.commit) {
                // make sure this is a commit for a library we track
                if (json.commit.project in libraries.paths) {
                    callback(json.commit.project, json.commit.sha, json.commit.ref);
                }
            }
        } catch(e) {
            console.error('[GITPUBSUB] [ERROR]: ' + new Date() + ' ' + e.message);
            console.error('[GITPUBSUB] [ERROR] Attempted to parse: ' + json);
        }
        return true;
    };
    return s;
};


text:
if [ "${TRAVIS_PULL_REQUEST}" = "false" ]; then
	echo '$TRAVIS_PULL_REQUEST is false, skipping tests'
	exit 0
else
	echo '$TRAVIS_PULL_REQUEST is not false ($TRAVIS_PULL_REQUEST), running tests'
	make test
	make dialyzer
fi


text:
import {PromiseResolver} from 'chrome://resources/js/promise_resolver.m.js';
import {$} from 'chrome://resources/js/util.m.js';
import {PAGE_HASH} from 'chrome://sys-internals/constants.js';
import {handleUpdateData, initialize, isInfoPage, lineChart, promiseResolvers} from 'chrome://sys-internals/index.js';

import {getTestData} from './test_util.js';

suite('Page_Switch', function() {
  suiteSetup('Wait for the page initialize.', function() {
    const testData = getTestData([
      {idle: 100, kernel: 100, total: 100, user: 100},
      {idle: 100, kernel: 100, total: 100, user: 100},
      {idle: 100, kernel: 100, total: 100, user: 100},
      {idle: 100, kernel: 100, total: 100, user: 100},
      {idle: 100, kernel: 100, total: 100, user: 100},
      {idle: 100, kernel: 100, total: 100, user: 100},
      {idle: 100, kernel: 100, total: 100, user: 100},
      {idle: 100, kernel: 100, total: 100, user: 100},
      {idle: 100, kernel: 100, total: 100, user: 100},
    ]);
    initialize();
    return promiseResolvers.waitSysInternalsInitialized.promise.then(
        function() {
          handleUpdateData(testData, 1000);
          return Promise.resolve();
        });
  });

  function checkInfoPage() {
    assertEquals(location.hash, PAGE_HASH.INFO);
    assertEquals($('drawer-title').innerText, 'Info');
    assertFalse($('infopage-root').hasAttribute('hidden'));
    assertFalse(lineChart.shouldRender());
  }

  function checkChartPage(hash) {
    assertEquals(location.hash, hash);
    assertEquals($('drawer-title').innerText, hash.slice(1));
    assertTrue($('infopage-root').hasAttribute('hidden'));

    assertTrue(lineChart.shouldRender());
    if (hash === PAGE_HASH.CPU) {
      assertEquals(lineChart.subCharts_[0].dataSeriesList_.length, 0);
      assertEquals(lineChart.subCharts_[1].dataSeriesList_.length, 9);
      assertEquals(lineChart.menu_.buttons_.length, 9);
    } else if (hash === PAGE_HASH.MEMORY) {
      assertEquals(lineChart.subCharts_[0].dataSeriesList_.length, 2);
      assertEquals(lineChart.subCharts_[1].dataSeriesList_.length, 2);
      assertEquals(lineChart.menu_.buttons_.length, 4);
    } else if (hash === PAGE_HASH.ZRAM) {
      assertEquals(lineChart.subCharts_[0].dataSeriesList_.length, 2);
      assertEquals(lineChart.subCharts_[1].dataSeriesList_.length, 3);
      assertEquals(lineChart.menu_.buttons_.length, 5);
    } else {
      assertNotReached();
    }
  }

  function clickDrawerBtn(btnIndex) {
    $('nav-menu-btn').click();
    const infoBtn = document.getElementsByClassName('drawer-item')[btnIndex];
    infoBtn.click();
  }

  function goPage(hash, btnIndex) {
    promiseResolvers.waitOnHashChangeCompleted = new PromiseResolver();
    clickDrawerBtn(btnIndex);
    return promiseResolvers.waitOnHashChangeCompleted.promise.then(function() {
      if (hash === PAGE_HASH.INFO) {
        checkInfoPage();
      } else {
        checkChartPage(hash);
      }
      return Promise.resolve();
    });
  }

  test('Switch test', function() {
    assertTrue(isInfoPage());
    return goPage(PAGE_HASH.CPU, 1)
        .then(function() {
          return goPage(PAGE_HASH.ZRAM, 3);
        })
        .then(function() {
          return goPage(PAGE_HASH.MEMORY, 2);
        })
        .then(function() {
          return goPage(PAGE_HASH.CPU, 1);
        })
        .then(function() {
          return goPage(PAGE_HASH.INFO, 0);
        })
        .then(function() {
          return goPage(PAGE_HASH.MEMORY, 2);
        });
  });
});


text:
{-# LANGUAGE OverloadedStrings #-}
{-# LANGUAGE RecordWildCards #-}
{-# LANGUAGE StrictData #-}
{-# LANGUAGE TupleSections #-}

-- | http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-logs-logstream.html

module Stratosphere.Resources.LogsLogStream where

import Stratosphere.ResourceImports

-- | Full data type definition for LogsLogStream. See 'logsLogStream' for a
-- more convenient constructor.
data LogsLogStream =
  LogsLogStream
  { _logsLogStreamLogGroupName :: Val Text
  , _logsLogStreamLogStreamName :: Maybe (Val Text)
  } deriving (Show, Eq)

instance ToResourceProperties LogsLogStream where
  toResourceProperties LogsLogStream{..} =
    ResourceProperties
    { resourcePropertiesType = "AWS::Logs::LogStream"
    , resourcePropertiesProperties =
        hashMapFromList $ catMaybes
        [ (Just . ("LogGroupName",) . toJSON) _logsLogStreamLogGroupName
        , fmap (("LogStreamName",) . toJSON) _logsLogStreamLogStreamName
        ]
    }

-- | Constructor for 'LogsLogStream' containing required fields as arguments.
logsLogStream
  :: Val Text -- ^ 'llsLogGroupName'
  -> LogsLogStream
logsLogStream logGroupNamearg =
  LogsLogStream
  { _logsLogStreamLogGroupName = logGroupNamearg
  , _logsLogStreamLogStreamName = Nothing
  }

-- | http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-logs-logstream.html#cfn-logs-logstream-loggroupname
llsLogGroupName :: Lens' LogsLogStream (Val Text)
llsLogGroupName = lens _logsLogStreamLogGroupName (\s a -> s { _logsLogStreamLogGroupName = a })

-- | http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-logs-logstream.html#cfn-logs-logstream-logstreamname
llsLogStreamName :: Lens' LogsLogStream (Maybe (Val Text))
llsLogStreamName = lens _logsLogStreamLogStreamName (\s a -> s { _logsLogStreamLogStreamName = a })


text:
describe('element by position / jms - equals value check (sub root level)', function () {

  var actualMsg = `<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
  <testRootElement xmlns="http://www.testing.com/integration/event">
    <subRootElement>
      <checkJustTheValue>hello</checkJustTheValue>
      <emptyElement></emptyElement>
    </subRootElement>
  </testRootElement>`;

  it('should report a mismatch where an element\'s actual value does not match the expected value', function () {
    var expectedMessage = [
      {parentPath: 'testRootElement.subRootElement', element: 'checkJustTheValue', elementPosition: 1, equals: 'helloo'}
    ];

    var result = messageCheckr({
      type: 'jms',
      verbose: true,
      actualMsg: actualMsg,
      expectedMsg: expectedMessage,
      expectedRootElement: 'testRootElement'
    });

    assert.equal(result.allChecksPassed, false);
    assert.deepEqual(result.checks[1], {
      actual: 'hello',
      expected: 'helloo',
      description: 'Check actual value hello is equal to helloo',
      pass: false,
      target: {parentPath: 'testRootElement.subRootElement', element: 'checkJustTheValue', elementPosition: 1}
    });
  });

  it('should report a mismatch where an element\'s actual value does not match the expected value (actual value is blank)', function () {
    var expectedMessage = [
      {parentPath: 'testRootElement.subRootElement', element: 'emptyElement', elementPosition: 2, equals: 'something'}
    ];

    var result = messageCheckr({
      type: 'jms',
      verbose: true,
      actualMsg: actualMsg,
      expectedMsg: expectedMessage,
      expectedRootElement: 'testRootElement'
    });

    assert.equal(result.allChecksPassed, false);
    assert.deepEqual(result.checks[1], {
      actual: '',
      expected: 'something',
      description: 'Check actual value  is equal to something',
      pass: false,
      target: {parentPath: 'testRootElement.subRootElement', element: 'emptyElement', elementPosition: 2}
    });
  });

  it('should report a match where an attribute\'s actual value matches the expected value', function () {
    var expectedMessage = [
      {parentPath: 'testRootElement.subRootElement', element: 'checkJustTheValue', elementPosition: 1, equals: 'hello'}
    ];

    var result = messageCheckr({
      type: 'jms',
      verbose: true,
      actualMsg: actualMsg,
      expectedMsg: expectedMessage,
      expectedRootElement: 'testRootElement'
    });

    assert.equal(result.allChecksPassed, true);
    assert.deepEqual(result.checks[1], {
      actual: 'hello',
      expected: 'hello',
      description: 'Check actual value hello is equal to hello',
      pass: true,
      target: {parentPath: 'testRootElement.subRootElement', element: 'checkJustTheValue', elementPosition: 1}
    });
  });

  it('should report a match where an attribute\'s actual value matches the expected value (actual value is blank)', function () {
    var expectedMessage = [
      {parentPath: 'testRootElement.subRootElement', element: 'emptyElement', elementPosition: 2, equals: ''}
    ];

    var result = messageCheckr({
      type: 'jms',
      verbose: true,
      actualMsg: actualMsg,
      expectedMsg: expectedMessage,
      expectedRootElement: 'testRootElement'
    });

    assert.equal(result.allChecksPassed, true);
    assert.deepEqual(result.checks[1], {
      actual: '',
      expected: '',
      description: 'Check actual value  is equal to ',
      pass: true,
      target: {parentPath: 'testRootElement.subRootElement', element: 'emptyElement', elementPosition: 2}
    });
  });
});


text:
package com.github.magicsky.vimcppgeneratorservice.ast.visitors;

import com.google.common.collect.Lists;
import lombok.Getter;
import org.eclipse.cdt.core.dom.ast.IASTInitializer;

import java.util.List;

/**
 * @author garcia.relax@gmail.com
 */
public class ASTInitializersVisitor extends BaseASTVisitor {

    @Getter
    private List<IASTInitializer> initializers = Lists.newArrayList();

    public ASTInitializersVisitor() {
        super();
    }

    public int visit(IASTInitializer initializer) {
        initializers.add(initializer);
		return PROCESS_CONTINUE;
	}

}


text:
package com.ligadata.MetadataAPI.Utility

import java.io.File

import com.ligadata.MetadataAPI.MetadataAPIImpl

import scala.io.Source
import org.apache.logging.log4j._
/**
 * Created by dhaval on 8/13/15.
 */
object ConfigService {
  private val userid: Option[String] = Some("metadataapi")
  val loggerName = this.getClass.getName
  lazy val logger = LogManager.getLogger(loggerName)

 def uploadClusterConfig(input: String): String ={
   var response = ""
   var configFileDir: String = ""
   //val gitMsgFile = "https://raw.githubusercontent.com/ligadata-dhaval/Kamanja/master/HelloWorld_Msg_Def.json"
   if (input == "") {
     configFileDir = MetadataAPIImpl.GetMetadataAPIConfig.getProperty("CONFIG_FILES_DIR")
     if (configFileDir == null) {
       response = "CONFIG_FILES_DIR property missing in the metadata API configuration"
     } else {
       //verify the directory where messages can be present
       IsValidDir(configFileDir) match {
         case true => {
           //get all files with json extension
           val types: Array[File] = new java.io.File(configFileDir).listFiles.filter(_.getName.endsWith(".json"))
           types.length match {
             case 0 => {
               println("Configs not found at " + configFileDir)
               response="Configs not found at " + configFileDir
             }
             case option => {
               val configDefs = getUserInputFromMainMenu(types)
               for (configDef <- configDefs) {
                 response += MetadataAPIImpl.UploadConfig(configDef.toString, userid, "configuration")
               }
             }
           }
         }
         case false => {
           //println("Message directory is invalid.")
           response = "Config directory is invalid."
         }
       }
     }
   } else {
     //input provided
     var message = new File(input.toString)
     val configDef = Source.fromFile(message).mkString
     response = MetadataAPIImpl.UploadConfig(configDef.toString, userid, "configuration")
   }
   response
 }

  def uploadCompileConfig(input: String): String ={
    var response = ""
    var configFileDir: String = ""
    //val gitMsgFile = "https://raw.githubusercontent.com/ligadata-dhaval/Kamanja/master/HelloWorld_Msg_Def.json"
    if (input == "") {
      configFileDir = MetadataAPIImpl.GetMetadataAPIConfig.getProperty("CONFIG_FILES_DIR")
      if (configFileDir == null) {
        response = "CONFIG_FILES_DIR property missing in the metadata API configuration"
      } else {
        //verify the directory where messages can be present
        IsValidDir(configFileDir) match {
          case true => {
            //get all files with json extension
            val types: Array[File] = new java.io.File(configFileDir).listFiles.filter(_.getName.endsWith(".json"))
            types.length match {
              case 0 => {
                println("Configs not found at " + configFileDir)
                response="Configs not found at " + configFileDir
              }
              case option => {
                val configDefs = getUserInputFromMainMenu(types)
                for (configDef <- configDefs) {
                  response += MetadataAPIImpl.UploadModelsConfig(configDef.toString, userid, "configuration")
                }
              }
            }
          }
          case false => {
            //println("Message directory is invalid.")
            response = "Config directory is invalid."
          }
        }
      }
    } else {
      //input provided
      var message = new File(input.toString)
      val configDef = Source.fromFile(message).mkString
      response = MetadataAPIImpl.UploadModelsConfig(configDef.toString, userid, "configuration")
    }
    response
  }
  def dumpAllCfgObjects: String ={
    var response=""
    try{
      response= MetadataAPIImpl.GetAllCfgObjects("JSON", userid)
    }
    catch {
      case e: Exception => {
        response=e.getStackTrace.toString
      }
    }
    response

  }
  def removeEngineConfig: String ={
    var response="TO BE IMPLEMENTED"
    response
  }

  def IsValidDir(dirName: String): Boolean = {
    val iFile = new File(dirName)
    if (!iFile.exists) {
      println("The File Path (" + dirName + ") is not found: ")
      false
    } else if (!iFile.isDirectory) {
      println("The File Path (" + dirName + ") is not a directory: ")
      false
    } else
      true
  }

  def   getUserInputFromMainMenu(messages: Array[File]): Array[String] = {
    var listOfMsgDef: Array[String] = Array[String]()
    var srNo = 0
    println("\nPick a Config Definition file(s) from below choices\n")
    for (message <- messages) {
      srNo += 1
      println("[" + srNo + "]" + message)
    }
    print("\nEnter your choice(If more than 1 choice, please use commas to seperate them): \n")
    val userOptions: List[Int] = Console.readLine().filter(_ != '\n').split(',').filter(ch => (ch != null && ch != "")).map(_.trim.toInt).toList
    //check if user input valid. If not exit
    for (userOption <- userOptions) {
      userOption match {
        case userOption if (1 to srNo).contains(userOption) => {
          //find the file location corresponding to the message
          var message = messages(userOption - 1)
          //process message
          val messageDef = Source.fromFile(message).mkString
          listOfMsgDef = listOfMsgDef :+ messageDef
        }
        case _ => {
          println("Unknown option: ")
        }
      }
    }
    listOfMsgDef
  }
}


text:
<!DOCTYPE html>

    <link href="../../../resources/css/bootstrap.min.css" rel="stylesheet" media="screen" th:href="@{/resources/css/bootstrap.min.css}"/>

            <button type="button" class="navbar-toggle" data-toggle="collapse" data-target=".nav-collapse">

            </button>
            Pactera Pulse

Home

About

Contact