text:
package org.jkiss.dbeaver.team.git.ui.internal;

import org.eclipse.osgi.util.NLS;

public class GITMessages extends NLS {
	static final String BUNDLE_NAME = "org.jkiss.dbeaver.team.git.ui.internal.GITResources"; //$NON-NLS-1$

	public static String project_share_handler_notifications_title_project_added;
	public static String project_share_handler_notifications_text_project_added;
	public static String project_share_handler_menu_element_text_add;

    static {
		// initialize resource bundle
		NLS.initializeMessages(BUNDLE_NAME, GITMessages.class);
	}

	private GITMessages() {
	}
}

redpajama_set_name: RedPajamaGithub


text:
package ravtrix.backpackerbuddy.activities.createdestination;

import java.util.Calendar;
import java.util.HashMap;

/**
 * Created by Ravinder on 10/4/16.
 */

class DestinationPresenter implements IDestinationPresenter {

    private IDestinationView view;
    private DestinationInteractor destinationInteractor;

    DestinationPresenter(IDestinationView view) {
        this.view = view;
        this.destinationInteractor = new DestinationInteractor();
    }

    @Override
    public void insertTravelRetrofit(HashMap<String, String> travelSpot) {
        destinationInteractor.insertTravelSpotRetrofit(travelSpot, new OnRetrofitDestinationListener() {
            @Override
            public void onSuccess() {
                view.hideProgressDialog();
                view.startDestinationFrag();
            }

            @Override
            public void onFailure() {
                view.hideProgressDialog();
                view.showToastError();
            }
        });
    }

    @Override
    public boolean isDateValid(Calendar from, Calendar to) {
        return destinationInteractor.isDateValid(from, to);
    }

    @Override
    public void onDestroy() {
        view = null;
    }
}


text:
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.Stroke = void 0;
const AnimatableColor_1 = require("./AnimatableColor");
class Stroke {
    constructor() {
        this.width = 0;
    }
    load(data) {
        if (data === undefined) {
            return;
        }
        if (data.color !== undefined) {
            this.color = AnimatableColor_1.AnimatableColor.create(this.color, data.color);
        }
        if (data.width !== undefined) {
            this.width = data.width;
        }
        if (data.opacity !== undefined) {
            this.opacity = data.opacity;
        }
    }
}
exports.Stroke = Stroke;


text:
package com.pacoapp.paco.sensors.android;

import java.util.concurrent.CountDownLatch;
import java.util.concurrent.ExecutionException;
import java.util.concurrent.Future;
import java.util.concurrent.TimeUnit;
import java.util.concurrent.TimeoutException;

import org.slf4j.Logger;
import org.slf4j.LoggerFactory;

import com.pacoapp.paco.sensors.StepSensor;

import android.content.Context;
import android.content.pm.PackageManager;
import android.hardware.Sensor;
import android.hardware.SensorEvent;
import android.hardware.SensorEventListener;
import android.hardware.SensorManager;

public class AndroidKitKatStepSensor implements StepSensor {

  private static Logger Log = LoggerFactory.getLogger(AndroidKitKatStepSensor.class);

  private Context context;

  public AndroidKitKatStepSensor(Context context) {
    super();
    this.context = context;
  }

  public Integer getStepCount() {
    if (context.getPackageManager().hasSystemFeature(PackageManager.FEATURE_SENSOR_STEP_COUNTER)) {
      SensorManager mSensorManager = ((SensorManager) context.getSystemService(Context.SENSOR_SERVICE));
      Sensor mStepCountSensor = mSensorManager.getDefaultSensor(Sensor.TYPE_STEP_COUNTER);
      if (mStepCountSensor == null) {
        return -1;
      }

      StepCountSensorFuture future = new StepCountSensorFuture(mSensorManager, mStepCountSensor, SensorManager.SENSOR_DELAY_NORMAL);
      try {
        return future.get();
      } catch (InterruptedException e) {
        e.printStackTrace();
      } catch (ExecutionException e) {
        e.printStackTrace();
      }
    }
    return -1;

  }

  public class StepCountSensorFuture implements Future<Integer> {

    private volatile Integer result = null;
    private volatile boolean cancelled = false;
    private final CountDownLatch countDownLatch;
    private SensorEventListener listener;
    private SensorManager sensorManager;

    public StepCountSensorFuture(SensorManager mSensorManager, Sensor mStepCountSensor, int sensorDelayNormal) {
      this.sensorManager = mSensorManager;

      countDownLatch = new CountDownLatch(1);

      this.listener = new SensorEventListener() {
        public void onAccuracyChanged(Sensor sensor, int accuracy) {
          Log.debug("onAccuracyChanged - accuracy: " + accuracy);
        }

        public void onSensorChanged(SensorEvent event) {
          if (event.sensor.getType() == Sensor.TYPE_STEP_COUNTER) {
            final Integer f = Integer.valueOf((int)event.values[0]);
            sensorManager.unregisterListener(this);
            onResult(f);
          } else {
            onResult(-1);
            Log.debug("Unknown sensor type");
          }
        }
      };
      sensorManager.registerListener(listener, mStepCountSensor, sensorDelayNormal);
    }

    @Override
    public boolean cancel(final boolean mayInterruptIfRunning) {
        if (isDone()) {
            return false;
        } else {
            countDownLatch.countDown();
            cancelled = true;
            return !isDone();
        }
    }

    @Override
    public Integer get() throws InterruptedException, ExecutionException {
        countDownLatch.await();
        return result;
    }

    @Override
    public Integer get(final long timeout, final TimeUnit unit)
            throws InterruptedException, ExecutionException, TimeoutException {
        countDownLatch.await(timeout, unit);
        return result;
    }

    @Override
    public boolean isCancelled() {
        return cancelled;
    }

    @Override
    public boolean isDone() {
        return countDownLatch.getCount() == 0;
    }

    public void onResult(final Integer result) {
        this.result = result;
        countDownLatch.countDown();
    }

}

}


text:
<?php

class getconf {

	var $config;

	function get_server_config($server_id, $section = '') {
		global $app;

		if(!is_array($this->config[$server_id])) {
			$app->uses('ini_parser');
			$server_id = intval($server_id);
			$server = $app->db->queryOneRecord('SELECT config FROM server WHERE server_id = '.$server_id);
			$this->config[$server_id] = $app->ini_parser->parse_ini_string(stripslashes($server['config']));
		}

		if($section == '') {
			return $this->config[$server_id];
		} else {
			return $this->config[$server_id][$section];
		}
	}

	public function get_global_config($section = '') {
		global $app;

		if(!@is_array($this->config['global'])) {
			$app->uses('ini_parser');
			$tmp = $app->db->queryOneRecord('SELECT config FROM sys_ini WHERE sysini_id = 1');
			$this->config['global'] = $app->ini_parser->parse_ini_string(stripslashes($tmp['config']));
		}
		return ($section == '') ? $this->config['global'] : $this->config['global'][$section];
	}
}

?>


text:
package com.amazonaws.services.cloudformation.model;

import java.io.Serializable;
import javax.annotation.Generated;

/**
 *

 * The field that AWS CloudFormation will change, such as the name of a resource's property, and whether the resource
 * will be recreated.
 *

 *
 * @see AWS API Documentation
 */
@Generated("com.amazonaws:aws-java-sdk-code-generator")
public class ResourceTargetDefinition implements Serializable, Cloneable {

    /**
     *

     * Indicates which resource attribute is triggering this update, such as a change in the resource attribute's
     * Metadata, Properties, or Tags.
     *

     */
    private String attribute;
    /**
     *

     * If the Attribute value is Properties, the name of the property. For all other
     * attributes, the value is null.
     *

     */
    private String name;
    /**
     *

     * If the Attribute value is Properties, indicates whether a change to this property
     * causes the resource to be recreated. The value can be Never, Always, or
     * Conditionally. To determine the conditions for a Conditionally recreation, see the
     * update behavior for that property in the AWS CloudFormation User Guide.
     *

     */
    private String requiresRecreation;

    /**
     *

     * Indicates which resource attribute is triggering this update, such as a change in the resource attribute's
     * Metadata, Properties, or Tags.
     *

     *
     * @param attribute
     *        Indicates which resource attribute is triggering this update, such as a change in the resource attribute's
     *        Metadata, Properties, or Tags.
     * @see ResourceAttribute
     */

    public void setAttribute(String attribute) {
        this.attribute = attribute;
    }

    /**
     *

     * Indicates which resource attribute is triggering this update, such as a change in the resource attribute's
     * Metadata, Properties, or Tags.
     *

     *
     * @return Indicates which resource attribute is triggering this update, such as a change in the resource
     *         attribute's Metadata, Properties, or Tags.
     * @see ResourceAttribute
     */

    public String getAttribute() {
        return this.attribute;
    }

    /**
     *

     * Indicates which resource attribute is triggering this update, such as a change in the resource attribute's
     * Metadata, Properties, or Tags.
     *

     *
     * @param attribute
     *        Indicates which resource attribute is triggering this update, such as a change in the resource attribute's
     *        Metadata, Properties, or Tags.
     * @return Returns a reference to this object so that method calls can be chained together.
     * @see ResourceAttribute
     */

    public ResourceTargetDefinition withAttribute(String attribute) {
        setAttribute(attribute);
        return this;
    }

    /**
     *

     * Indicates which resource attribute is triggering this update, such as a change in the resource attribute's
     * Metadata, Properties, or Tags.
     *

     *
     * @param attribute
     *        Indicates which resource attribute is triggering this update, such as a change in the resource attribute's
     *        Metadata, Properties, or Tags.
     * @see ResourceAttribute
     */

    public void setAttribute(ResourceAttribute attribute) {
        withAttribute(attribute);
    }

    /**
     *

     * Indicates which resource attribute is triggering this update, such as a change in the resource attribute's
     * Metadata, Properties, or Tags.
     *

     *
     * @param attribute
     *        Indicates which resource attribute is triggering this update, such as a change in the resource attribute's
     *        Metadata, Properties, or Tags.
     * @return Returns a reference to this object so that method calls can be chained together.
     * @see ResourceAttribute
     */

    public ResourceTargetDefinition withAttribute(ResourceAttribute attribute) {
        this.attribute = attribute.toString();
        return this;
    }

    /**
     *

     * If the Attribute value is Properties, the name of the property. For all other
     * attributes, the value is null.
     *

     *
     * @param name
     *        If the Attribute value is Properties, the name of the property. For all other
     *        attributes, the value is null.
     */

    public void setName(String name) {
        this.name = name;
    }

    /**
     *

     * If the Attribute value is Properties, the name of the property. For all other
     * attributes, the value is null.
     *

     *
     * @return If the Attribute value is Properties, the name of the property. For all other
     *         attributes, the value is null.
     */

    public String getName() {
        return this.name;
    }

    /**
     *

     * If the Attribute value is Properties, the name of the property. For all other
     * attributes, the value is null.
     *

     *
     * @param name
     *        If the Attribute value is Properties, the name of the property. For all other
     *        attributes, the value is null.
     * @return Returns a reference to this object so that method calls can be chained together.
     */

    public ResourceTargetDefinition withName(String name) {
        setName(name);
        return this;
    }

    /**
     *

     * If the Attribute value is Properties, indicates whether a change to this property
     * causes the resource to be recreated. The value can be Never, Always, or
     * Conditionally. To determine the conditions for a Conditionally recreation, see the
     * update behavior for that property in the AWS CloudFormation User Guide.
     *

     *
     * @param requiresRecreation
     *        If the Attribute value is Properties, indicates whether a change to this
     *        property causes the resource to be recreated. The value can be Never, Always, or
     *        Conditionally. To determine the conditions for a Conditionally recreation, see
     *        the update behavior for that property in the AWS CloudFormation User Guide.
     * @see RequiresRecreation
     */

    public void setRequiresRecreation(String requiresRecreation) {
        this.requiresRecreation = requiresRecreation;
    }

    /**
     *

     * If the Attribute value is Properties, indicates whether a change to this property
     * causes the resource to be recreated. The value can be Never, Always, or
     * Conditionally. To determine the conditions for a Conditionally recreation, see the
     * update behavior for that property in the AWS CloudFormation User Guide.
     *

     *
     * @return If the Attribute value is Properties, indicates whether a change to this
     *         property causes the resource to be recreated. The value can be Never, Always,
     *         or Conditionally. To determine the conditions for a Conditionally recreation,
     *         see the update behavior for that property in the AWS CloudFormation User Guide.
     * @see RequiresRecreation
     */

    public String getRequiresRecreation() {
        return this.requiresRecreation;
    }

    /**
     *

     * If the Attribute value is Properties, indicates whether a change to this property
     * causes the resource to be recreated. The value can be Never, Always, or
     * Conditionally. To determine the conditions for a Conditionally recreation, see the
     * update behavior for that property in the AWS CloudFormation User Guide.
     *

     *
     * @param requiresRecreation
     *        If the Attribute value is Properties, indicates whether a change to this
     *        property causes the resource to be recreated. The value can be Never, Always, or
     *        Conditionally. To determine the conditions for a Conditionally recreation, see
     *        the update behavior for that property in the AWS CloudFormation User Guide.
     * @return Returns a reference to this object so that method calls can be chained together.
     * @see RequiresRecreation
     */

    public ResourceTargetDefinition withRequiresRecreation(String requiresRecreation) {
        setRequiresRecreation(requiresRecreation);
        return this;
    }

    /**
     *

     * If the Attribute value is Properties, indicates whether a change to this property
     * causes the resource to be recreated. The value can be Never, Always, or
     * Conditionally. To determine the conditions for a Conditionally recreation, see the
     * update behavior for that property in the AWS CloudFormation User Guide.
     *

     *
     * @param requiresRecreation
     *        If the Attribute value is Properties, indicates whether a change to this
     *        property causes the resource to be recreated. The value can be Never, Always, or
     *        Conditionally. To determine the conditions for a Conditionally recreation, see
     *        the update behavior for that property in the AWS CloudFormation User Guide.
     * @see RequiresRecreation
     */

    public void setRequiresRecreation(RequiresRecreation requiresRecreation) {
        withRequiresRecreation(requiresRecreation);
    }

    /**
     *

     * If the Attribute value is Properties, indicates whether a change to this property
     * causes the resource to be recreated. The value can be Never, Always, or
     * Conditionally. To determine the conditions for a Conditionally recreation, see the
     * update behavior for that property in the AWS CloudFormation User Guide.
     *

     *
     * @param requiresRecreation
     *        If the Attribute value is Properties, indicates whether a change to this
     *        property causes the resource to be recreated. The value can be Never, Always, or
     *        Conditionally. To determine the conditions for a Conditionally recreation, see
     *        the update behavior for that property in the AWS CloudFormation User Guide.
     * @return Returns a reference to this object so that method calls can be chained together.
     * @see RequiresRecreation
     */

    public ResourceTargetDefinition withRequiresRecreation(RequiresRecreation requiresRecreation) {
        this.requiresRecreation = requiresRecreation.toString();
        return this;
    }

    /**
     * Returns a string representation of this object. This is useful for testing and debugging. Sensitive data will be
     * redacted from this string using a placeholder value.
     *
     * @return A string representation of this object.
     *
     * @see java.lang.Object#toString()
     */
    @Override
    public String toString() {
        StringBuilder sb = new StringBuilder();
        sb.append("{");
        if (getAttribute() != null)
            sb.append("Attribute: ").append(getAttribute()).append(",");
        if (getName() != null)
            sb.append("Name: ").append(getName()).append(",");
        if (getRequiresRecreation() != null)
            sb.append("RequiresRecreation: ").append(getRequiresRecreation());
        sb.append("}");
        return sb.toString();
    }

    @Override
    public boolean equals(Object obj) {
        if (this == obj)
            return true;
        if (obj == null)
            return false;

        if (obj instanceof ResourceTargetDefinition == false)
            return false;
        ResourceTargetDefinition other = (ResourceTargetDefinition) obj;
        if (other.getAttribute() == null ^ this.getAttribute() == null)
            return false;
        if (other.getAttribute() != null && other.getAttribute().equals(this.getAttribute()) == false)
            return false;
        if (other.getName() == null ^ this.getName() == null)
            return false;
        if (other.getName() != null && other.getName().equals(this.getName()) == false)
            return false;
        if (other.getRequiresRecreation() == null ^ this.getRequiresRecreation() == null)
            return false;
        if (other.getRequiresRecreation() != null && other.getRequiresRecreation().equals(this.getRequiresRecreation()) == false)
            return false;
        return true;
    }

    @Override
    public int hashCode() {
        final int prime = 31;
        int hashCode = 1;

        hashCode = prime * hashCode + ((getAttribute() == null) ? 0 : getAttribute().hashCode());
        hashCode = prime * hashCode + ((getName() == null) ? 0 : getName().hashCode());
        hashCode = prime * hashCode + ((getRequiresRecreation() == null) ? 0 : getRequiresRecreation().hashCode());
        return hashCode;
    }

    @Override
    public ResourceTargetDefinition clone() {
        try {
            return (ResourceTargetDefinition) super.clone();
        } catch (CloneNotSupportedException e) {
            throw new IllegalStateException("Got a CloneNotSupportedException from Object.clone() " + "even though we're Cloneable!", e);
        }
    }

}


text:
import { IWebpackCLI } from "webpack-cli";

const WEBPACK_PACKAGE = process.env.WEBPACK_PACKAGE || "webpack";

class ConfigTestCommand {
  async apply(cli: IWebpackCLI): Promise<void> {
    await cli.makeCommand(
      {
        name: "configtest [config-path]",
        alias: "t",
        description: "Validate a webpack configuration.",
        pkg: "@webpack-cli/configtest",
        dependencies: [WEBPACK_PACKAGE],
      },
      [],
      async (configPath: string | undefined): Promise<void> => {
        cli.webpack = await cli.loadWebpack();

        const config = await cli.loadConfig(configPath ? { config: [configPath] } : {});
        const configPaths = new Set<string>();

        if (Array.isArray(config.options)) {
          config.options.forEach((options) => {
            if (config.path.get(options)) {
              configPaths.add(config.path.get(options) as string);
            }
          });
        } else {
          if (config.path.get(config.options)) {
            configPaths.add(config.path.get(config.options) as string);
          }
        }

        if (configPaths.size === 0) {
          cli.logger.error("No configuration found.");
          process.exit(2);
        }

        cli.logger.info(`Validate '${Array.from(configPaths).join(" ,")}'.`);

        try {
          cli.webpack.validate(config.options);
        } catch (error) {
          if (cli.isValidationError(error as Error)) {
            cli.logger.error((error as Error).message);
          } else {
            cli.logger.error(error);
          }

          process.exit(2);
        }

        cli.logger.success("There are no validation errors in the given webpack configuration.");
      },
    );
  }
}

export default ConfigTestCommand;


text:
<?php

require_once __DIR__.'/Base.php';

use Model\Task;
use Model\TaskFinder;
use Model\TaskCreation;
use Model\ProjectActivity;
use Model\Project;

class ProjectActivityTest extends Base
{
    public function testDecode()
    {
        $e = new ProjectActivity($this->container);
        $input = array('test');
        $serialized = serialize($input);
        $json = json_encode($input);

        $this->assertEquals($input, $e->decode($serialized));
        $this->assertEquals($input, $e->decode($json));
    }

    public function testCreation()
    {
        $e = new ProjectActivity($this->container);
        $tc = new TaskCreation($this->container);
        $tf = new TaskFinder($this->container);
        $p = new Project($this->container);

        $this->assertEquals(1, $p->create(array('name' => 'Project #1')));
        $this->assertEquals(1, $tc->create(array('title' => 'Task #1', 'project_id' => 1)));
        $this->assertEquals(2, $tc->create(array('title' => 'Task #2', 'project_id' => 1)));

        $this->assertTrue($e->createEvent(1, 1, 1, Task::EVENT_CLOSE, array('task' => $tf->getbyId(1))));
        $this->assertTrue($e->createEvent(1, 2, 1, Task::EVENT_UPDATE, array('task' => $tf->getById(2))));
        $this->assertFalse($e->createEvent(1, 1, 0, Task::EVENT_OPEN, array('task' => $tf->getbyId(1))));

        $events = $e->getProject(1);

        $this->assertNotEmpty($events);
        $this->assertTrue(is_array($events));
        $this->assertEquals(2, count($events));
        $this->assertEquals(time(), $events[0]['date_creation'], '', 1);
        $this->assertEquals(Task::EVENT_UPDATE, $events[0]['event_name']);
        $this->assertEquals(Task::EVENT_CLOSE, $events[1]['event_name']);
    }

    public function testFetchAllContent()
    {
        $e = new ProjectActivity($this->container);
        $tc = new TaskCreation($this->container);
        $tf = new TaskFinder($this->container);
        $p = new Project($this->container);

        $this->assertEquals(1, $p->create(array('name' => 'Project #1')));
        $this->assertEquals(1, $tc->create(array('title' => 'Task #1', 'project_id' => 1)));

        $nb_events = 80;

        for ($i = 0; $i < $nb_events; $i++) {
            $this->assertTrue($e->createEvent(1, 1, 1, Task::EVENT_UPDATE, array('task' => $tf->getbyId(1))));
        }

        $events = $e->getProject(1);

        $this->assertNotEmpty($events);
        $this->assertTrue(is_array($events));
        $this->assertEquals(50, count($events));
        $this->assertEquals('admin', $events[0]['author']);
        $this->assertNotEmpty($events[0]['event_title']);
        $this->assertNotEmpty($events[0]['event_content']);
    }

    public function testCleanup()
    {
        $e = new ProjectActivity($this->container);
        $tc = new TaskCreation($this->container);
        $tf = new TaskFinder($this->container);
        $p = new Project($this->container);

        $this->assertEquals(1, $p->create(array('name' => 'Project #1')));
        $this->assertEquals(1, $tc->create(array('title' => 'Task #1', 'project_id' => 1)));

        $max = 15;
        $nb_events = 100;

        for ($i = 0; $i < $nb_events; $i++) {
            $this->assertTrue($e->createEvent(1, 1, 1, Task::EVENT_CLOSE, array('task' => $tf->getbyId(1))));
        }

        $this->assertEquals($nb_events, $this->container['db']->table('project_activities')->count());
        $e->cleanup($max);

        $events = $e->getProject(1);

        $this->assertNotEmpty($events);
        $this->assertTrue(is_array($events));
        $this->assertEquals($max, count($events));
        $this->assertEquals(100, $events[0]['id']);
        $this->assertEquals(99, $events[1]['id']);
        $this->assertEquals(86, $events[14]['id']);

        // Cleanup during task creation

        $nb_events = ProjectActivity::MAX_EVENTS + 10;

        for ($i = 0; $i < $nb_events; $i++) {
            $this->assertTrue($e->createEvent(1, 1, 1, Task::EVENT_CLOSE, array('task' => $tf->getbyId(1))));
        }

        $this->assertEquals(ProjectActivity::MAX_EVENTS, $this->container['db']->table('project_activities')->count());
    }
}


text:
#include <functional>
#include <memory>

#include "tensorflow/core/framework/allocator.h"
#include "tensorflow/core/framework/fake_input.h"
#include "tensorflow/core/framework/node_def_builder.h"
#include "tensorflow/core/framework/op_kernel.h"
#include "tensorflow/core/framework/summary.pb.h"
#include "tensorflow/core/framework/tensor.h"
#include "tensorflow/core/framework/types.h"
#include "tensorflow/core/framework/types.pb.h"
#include "tensorflow/core/kernels/ops_testutil.h"
#include "tensorflow/core/kernels/ops_util.h"
#include "tensorflow/core/lib/core/status_test_util.h"
#include "tensorflow/core/lib/histogram/histogram.h"
#include "tensorflow/core/lib/strings/str_util.h"
#include "tensorflow/core/lib/strings/strcat.h"
#include "tensorflow/core/platform/env.h"
#include "tensorflow/core/platform/logging.h"
#include "tensorflow/core/platform/protobuf.h"
#include "tensorflow/core/platform/test.h"

namespace tensorflow {
namespace {

static void EXPECT_SummaryMatches(const Summary& actual,
                                  const string& expected_str) {
  Summary expected;
  CHECK(protobuf::TextFormat::ParseFromString(expected_str, &expected));
  EXPECT_EQ(expected.DebugString(), actual.DebugString());
}

class SummaryScalarOpTest : public OpsTestBase {
 protected:
  void MakeOp(DataType dt) {
    TF_ASSERT_OK(NodeDefBuilder("myop", "ScalarSummary")
                     .Input(FakeInput())
                     .Input(FakeInput(dt))
                     .Finalize(node_def()));
    TF_ASSERT_OK(InitOp());
  }
};

TEST_F(SummaryScalarOpTest, SimpleFloat) {
  MakeOp(DT_FLOAT);

  // Feed and run
  AddInputFromArray<string>(TensorShape({3}), {"tag1", "tag2", "tag3"});
  AddInputFromArray<float>(TensorShape({3}), {1.0f, -0.73f, 10000.0f});
  TF_ASSERT_OK(RunOpKernel());

  // Check the output size.
  Tensor* out_tensor = GetOutput(0);
  ASSERT_EQ(0, out_tensor->dims());
  Summary summary;
  ParseProtoUnlimited(&summary, out_tensor->scalar<string>()());
  EXPECT_SummaryMatches(summary, R"(
      value { tag: 'tag1' simple_value: 1.0 }
      value { tag: 'tag2' simple_value: -0.73 }
      value { tag: 'tag3' simple_value: 10000.0 }
  )");
}

TEST_F(SummaryScalarOpTest, SimpleDouble) {
  MakeOp(DT_DOUBLE);

  // Feed and run
  AddInputFromArray<string>(TensorShape({3}), {"tag1", "tag2", "tag3"});
  AddInputFromArray<double>(TensorShape({3}), {1.0, -0.73, 10000.0});
  TF_ASSERT_OK(RunOpKernel());

  // Check the output size.
  Tensor* out_tensor = GetOutput(0);
  ASSERT_EQ(0, out_tensor->dims());
  Summary summary;
  ParseProtoUnlimited(&summary, out_tensor->scalar<string>()());
  EXPECT_SummaryMatches(summary, R"(
      value { tag: 'tag1' simple_value: 1.0 }
      value { tag: 'tag2' simple_value: -0.73 }
      value { tag: 'tag3' simple_value: 10000.0 }
  )");
}

TEST_F(SummaryScalarOpTest, SimpleHalf) {
  MakeOp(DT_HALF);

  // Feed and run
  AddInputFromList<string>(TensorShape({3}), {"tag1", "tag2", "tag3"});
  AddInputFromList<Eigen::half>(TensorShape({3}), {1.0, -2.0, 10000.0});
  TF_ASSERT_OK(RunOpKernel());

  // Check the output size.
  Tensor* out_tensor = GetOutput(0);
  ASSERT_EQ(0, out_tensor->dims());
  Summary summary;
  ParseProtoUnlimited(&summary, out_tensor->scalar<string>()());
  EXPECT_SummaryMatches(summary, R"(
      value { tag: 'tag1' simple_value: 1.0 }
      value { tag: 'tag2' simple_value: -2.0 }
      value { tag: 'tag3' simple_value: 10000.0 }
  )");
}

TEST_F(SummaryScalarOpTest, Error_MismatchedSize) {
  MakeOp(DT_FLOAT);

  // Feed and run
  AddInputFromArray<string>(TensorShape({2}), {"tag1", "tag2"});
  AddInputFromArray<float>(TensorShape({3}), {1.0f, -0.73f, 10000.0f});
  Status s = RunOpKernel();
  EXPECT_TRUE(str_util::StrContains(s.ToString(), "not the same shape")) << s;
}

TEST_F(SummaryScalarOpTest, Error_WrongDimsTags) {
  MakeOp(DT_FLOAT);

  // Feed and run
  AddInputFromArray<string>(TensorShape({2, 1}), {"tag1", "tag2"});
  AddInputFromArray<float>(TensorShape({2}), {1.0f, -0.73f});
  Status s = RunOpKernel();
  EXPECT_TRUE(
      str_util::StrContains(s.ToString(), "tags and values not the same shape"))
      << s;
}

TEST_F(SummaryScalarOpTest, Error_WrongDimsValues) {
  MakeOp(DT_FLOAT);

  // Feed and run
  AddInputFromArray<string>(TensorShape({2}), {"tag1", "tag2"});
  AddInputFromArray<float>(TensorShape({2, 1}), {1.0f, -0.73f});
  Status s = RunOpKernel();
  EXPECT_TRUE(
      str_util::StrContains(s.ToString(), "tags and values not the same shape"))
      << s;
}

// --------------------------------------------------------------------------
// SummaryHistoOp
// --------------------------------------------------------------------------
class SummaryHistoOpTest : public OpsTestBase {
 protected:
  void MakeOp(DataType dt) {
    TF_ASSERT_OK(NodeDefBuilder("myop", "HistogramSummary")
                     .Input(FakeInput())
                     .Input(FakeInput(dt))
                     .Finalize(node_def()));
    TF_ASSERT_OK(InitOp());
  }
};

TEST_F(SummaryHistoOpTest, SimpleFloat) {
  MakeOp(DT_FLOAT);

  // Feed and run
  AddInputFromArray<string>(TensorShape({}), {"taghisto"});
  AddInputFromArray<float>(TensorShape({3, 2}),
                           {0.1f, -0.7f, 4.1f, 4., 5.f, 4.f});
  TF_ASSERT_OK(RunOpKernel());

  // Check the output size.
  Tensor* out_tensor = GetOutput(0);
  ASSERT_EQ(0, out_tensor->dims());
  Summary summary;
  ParseProtoUnlimited(&summary, out_tensor->scalar<string>()());
  ASSERT_EQ(summary.value_size(), 1);
  EXPECT_EQ(summary.value(0).tag(), "taghisto");
  histogram::Histogram histo;
  EXPECT_TRUE(histo.DecodeFromProto(summary.value(0).histo()));
  EXPECT_EQ(
      "Count: 6  Average: 2.7500  StdDev: 2.20\n"
      "Min: -0.7000  Median: 3.9593  Max: 5.0000\n"
      "------------------------------------------------------\n"
      "[      -0.76,      -0.69 )       1  16.667%  16.667% ###\n"
      "[      0.093,        0.1 )       1  16.667%  33.333% ###\n"
      "[        3.8,        4.2 )       3  50.000%  83.333% ##########\n"
      "[        4.6,        5.1 )       1  16.667% 100.000% ###\n",
      histo.ToString());
}

TEST_F(SummaryHistoOpTest, SimpleDouble) {
  MakeOp(DT_DOUBLE);

  // Feed and run
  AddInputFromArray<string>(TensorShape({}), {"taghisto"});
  AddInputFromArray<double>(TensorShape({3, 2}), {0.1, -0.7, 4.1, 4., 5., 4.});
  TF_ASSERT_OK(RunOpKernel());

  // Check the output size.
  Tensor* out_tensor = GetOutput(0);
  ASSERT_EQ(0, out_tensor->dims());
  Summary summary;
  ParseProtoUnlimited(&summary, out_tensor->scalar<string>()());
  ASSERT_EQ(summary.value_size(), 1);
  EXPECT_EQ(summary.value(0).tag(), "taghisto");
  histogram::Histogram histo;
  EXPECT_TRUE(histo.DecodeFromProto(summary.value(0).histo()));
  EXPECT_EQ(
      "Count: 6  Average: 2.7500  StdDev: 2.20\n"
      "Min: -0.7000  Median: 3.9593  Max: 5.0000\n"
      "------------------------------------------------------\n"
      "[      -0.76,      -0.69 )       1  16.667%  16.667% ###\n"
      "[      0.093,        0.1 )       1  16.667%  33.333% ###\n"
      "[        3.8,        4.2 )       3  50.000%  83.333% ##########\n"
      "[        4.6,        5.1 )       1  16.667% 100.000% ###\n",
      histo.ToString());
}

TEST_F(SummaryHistoOpTest, SimpleHalf) {
  MakeOp(DT_HALF);

  // Feed and run
  AddInputFromList<string>(TensorShape({}), {"taghisto"});
  AddInputFromList<Eigen::half>(TensorShape({3, 2}),
                                {0.1, -0.7, 4.1, 4., 5., 4.});
  TF_ASSERT_OK(RunOpKernel());

  // Check the output size.
  Tensor* out_tensor = GetOutput(0);
  ASSERT_EQ(0, out_tensor->dims());
  Summary summary;
  ParseProtoUnlimited(&summary, out_tensor->scalar<string>()());
  ASSERT_EQ(summary.value_size(), 1);
  EXPECT_EQ(summary.value(0).tag(), "taghisto");
  histogram::Histogram histo;
  EXPECT_TRUE(histo.DecodeFromProto(summary.value(0).histo()));
  EXPECT_EQ(
      "Count: 6  Average: 2.7502  StdDev: 2.20\n"
      "Min: -0.7002  Median: 3.9593  Max: 5.0000\n"
      "------------------------------------------------------\n"
      "[      -0.76,      -0.69 )       1  16.667%  16.667% ###\n"
      "[      0.093,        0.1 )       1  16.667%  33.333% ###\n"
      "[        3.8,        4.2 )       3  50.000%  83.333% ##########\n"
      "[        4.6,        5.1 )       1  16.667% 100.000% ###\n",
      histo.ToString());
}

TEST_F(SummaryHistoOpTest, Error_WrongDimsTags) {
  MakeOp(DT_FLOAT);

  // Feed and run
  AddInputFromArray<string>(TensorShape({2, 1}), {"tag1", "tag2"});
  AddInputFromArray<float>(TensorShape({2}), {1.0f, -0.73f});
  Status s = RunOpKernel();
  EXPECT_TRUE(str_util::StrContains(s.ToString(), "tags must be scalar")) << s;
}

TEST_F(SummaryHistoOpTest, Error_TooManyTagValues) {
  MakeOp(DT_FLOAT);

  // Feed and run
  AddInputFromArray<string>(TensorShape({2}), {"tag1", "tag2"});
  AddInputFromArray<float>(TensorShape({2, 1}), {1.0f, -0.73f});
  Status s = RunOpKernel();
  EXPECT_TRUE(str_util::StrContains(s.ToString(), "tags must be scalar")) << s;
}

// --------------------------------------------------------------------------
// SummaryMergeOp
// --------------------------------------------------------------------------
class SummaryMergeOpTest : public OpsTestBase {
 protected:
  void MakeOp(int num_inputs) {
    TF_ASSERT_OK(NodeDefBuilder("myop", "MergeSummary")
                     .Input(FakeInput(num_inputs))
                     .Finalize(node_def()));
    TF_ASSERT_OK(InitOp());
  }
};

TEST_F(SummaryMergeOpTest, Simple) {
  MakeOp(1);

  // Feed and run
  Summary s1;
  ASSERT_TRUE(protobuf::TextFormat::ParseFromString(
      "value { tag: \"tag1\" simple_value: 1.0 } "
      "value { tag: \"tag2\" simple_value: -0.73 } ",
      &s1));
  Summary s2;
  ASSERT_TRUE(protobuf::TextFormat::ParseFromString(
      "value { tag: \"tag3\" simple_value: 10000.0 }", &s2));
  Summary s3;
  ASSERT_TRUE(protobuf::TextFormat::ParseFromString(
      "value { tag: \"tag4\" simple_value: 11.0 }", &s3));

  AddInputFromArray<string>(
      TensorShape({3}),
      {s1.SerializeAsString(), s2.SerializeAsString(), s3.SerializeAsString()});
  TF_ASSERT_OK(RunOpKernel());

  // Check the output size.
  Tensor* out_tensor = GetOutput(0);
  ASSERT_EQ(0, out_tensor->dims());
  Summary summary;
  ParseProtoUnlimited(&summary, out_tensor->scalar<string>()());

  EXPECT_SummaryMatches(summary,
                        "value { tag: \"tag1\" simple_value: 1.0 } "
                        "value { tag: \"tag2\" simple_value: -0.73 } "
                        "value { tag: \"tag3\" simple_value: 10000.0 }"
                        "value { tag: \"tag4\" simple_value: 11.0 }");
}

TEST_F(SummaryMergeOpTest, Simple_MultipleInputs) {
  MakeOp(3);

  // Feed and run
  Summary s1;
  ASSERT_TRUE(protobuf::TextFormat::ParseFromString(
      "value { tag: \"tag1\" simple_value: 1.0 } "
      "value { tag: \"tag2\" simple_value: -0.73 } ",
      &s1));
  Summary s2;
  ASSERT_TRUE(protobuf::TextFormat::ParseFromString(
      "value { tag: \"tag3\" simple_value: 10000.0 }", &s2));
  Summary s3;
  ASSERT_TRUE(protobuf::TextFormat::ParseFromString(
      "value { tag: \"tag4\" simple_value: 11.0 }", &s3));

  AddInputFromArray<string>(TensorShape({}), {s1.SerializeAsString()});
  AddInputFromArray<string>(TensorShape({}), {s2.SerializeAsString()});
  AddInputFromArray<string>(TensorShape({}), {s3.SerializeAsString()});
  TF_ASSERT_OK(RunOpKernel());

  // Check the output size.
  Tensor* out_tensor = GetOutput(0);
  ASSERT_EQ(0, out_tensor->dims());
  Summary summary;
  ParseProtoUnlimited(&summary, out_tensor->scalar<string>()());

  EXPECT_SummaryMatches(summary,
                        "value { tag: \"tag1\" simple_value: 1.0 } "
                        "value { tag: \"tag2\" simple_value: -0.73 } "
                        "value { tag: \"tag3\" simple_value: 10000.0 }"
                        "value { tag: \"tag4\" simple_value: 11.0 }");
}

TEST_F(SummaryMergeOpTest, Error_MismatchedSize) {
  MakeOp(1);

  // Feed and run
  Summary s1;
  ASSERT_TRUE(protobuf::TextFormat::ParseFromString(
      "value { tag: \"tag1\" simple_value: 1.0 } "
      "value { tag: \"tagduplicate\" simple_value: -0.73 } ",
      &s1));
  Summary s2;
  ASSERT_TRUE(protobuf::TextFormat::ParseFromString(
      "value { tag: \"tagduplicate\" simple_value: 1.0 } ", &s2));
  AddInputFromArray<string>(TensorShape({2}),
                            {s1.SerializeAsString(), s2.SerializeAsString()});
  Status s = RunOpKernel();
  EXPECT_TRUE(str_util::StrContains(s.ToString(), "Duplicate tag")) << s;
}

}  // namespace
}  // namespace tensorflow


text:
namespace blink {

class LocalFrame;
class Node;
class SentNodes;

// This class is used to create the NodeHolder, and start the ContentCaptureTask
// when necessary. The ContentCaptureManager is owned by main frame.
class CORE_EXPORT ContentCaptureManager
    : public GarbageCollected<ContentCaptureManager> {
 public:
  explicit ContentCaptureManager(LocalFrame& local_frame_root);
  virtual ~ContentCaptureManager();

  // Schedules ContentCaptureTask if it isn't already scheduled.
  void ScheduleTaskIfNeeded();

  // Invokes when the |node_holder| asscociated LayoutText will be destroyed.
  void OnLayoutTextWillBeDestroyed(const Node& node);

  // Invokes when scroll position was changed.
  void OnScrollPositionChanged();

  // Invokes when text node content was changed.
  void OnNodeTextChanged(Node& node);

  // Invokes when the local_frame_root shutdown.
  void Shutdown();

  virtual void Trace(Visitor*);

  ContentCaptureTask* GetContentCaptureTaskForTesting() const {
    return content_capture_idle_task_;
  }

 protected:
  virtual ContentCaptureTask* CreateContentCaptureTask();
  TaskSession& GetTaskSessionForTesting() const { return *task_session_; }

 private:
  void NotifyNodeDetached(const Node& node);
  void ScheduleTask(ContentCaptureTask::ScheduleReason reason);

  Member<ContentCaptureTask> content_capture_idle_task_;

  Member<LocalFrame> local_frame_root_;

  // Indicates if the first NodeHolder is created.
  bool first_node_holder_created_ = false;

  Member<TaskSession> task_session_;

  // A set of weak reference of the node that has been sent.
  Member<SentNodes> sent_nodes_;
};

}  // namespace blink

#endif  // THIRD_PARTY_BLINK_RENDERER_CORE_CONTENT_CAPTURE_CONTENT_CAPTURE_MANAGER_H_


text:
package com.jcwhatever.nucleus.storage.settings;

/**
 * Mixin interface that defines a class as implementing a settings manager.
 */
public interface ISettable {

    /**
     * Get the settings manager.
     */
    ISettingsManager getSettingsManager();
}


text:
<?php

use Illuminate\Database\Seeder;
use App\Trio;

class TriosDevTableSeeder extends Seeder
{
    /**
     * Run the database seeds.
     *
     * @return void
     */
    public function run()
    {
        $faker = Faker\Factory::create('en_US');
        for($i=0;$i<100;$i++){
            //Below a rand or mt_rand function can be used
            $sentenceLength = $faker->numberBetween(4,7);
            $explanationLength = $faker->numberBetween(2,5);
            Trio::create([
                'sentence1' => $faker->sentence($sentenceLength),
                'sentence2' => $faker->sentence($sentenceLength),
                'sentence3' => $faker->sentence($sentenceLength),
                'explanation1' => implode(' ', $faker->sentences($explanationLength)),
                'explanation2' => implode(' ', $faker->sentences($explanationLength)),
                'explanation3' => implode(' ', $faker->sentences($explanationLength)),
                'answer' => $faker->word
            ]);
        }
    }
}


text:
package org.apache.jena.examples;

import java.io.InputStream;

import com.hp.hpl.jena.query.Dataset;
import com.hp.hpl.jena.query.Query;
import com.hp.hpl.jena.query.QueryExecution;
import com.hp.hpl.jena.query.QueryExecutionFactory;
import com.hp.hpl.jena.query.QueryFactory;
import com.hp.hpl.jena.query.QuerySolution;
import com.hp.hpl.jena.query.ReadWrite;
import com.hp.hpl.jena.query.ResultSet;
import com.hp.hpl.jena.rdf.model.Literal;
import com.hp.hpl.jena.tdb.TDBFactory;
import com.hp.hpl.jena.tdb.TDBLoader;
import com.hp.hpl.jena.tdb.base.file.Location;
import com.hp.hpl.jena.tdb.sys.TDBInternal;
import com.hp.hpl.jena.util.FileManager;

public class ExampleTDB_02 {

    public static void main(String[] args) {
        FileManager fm = FileManager.get();
        fm.addLocatorClassLoader(ExampleTDB_02.class.getClassLoader());
        InputStream in = fm.open("data/data.nt");

        Location location = new Location ("target/TDB");

        // Load some initial data
        TDBLoader.load(TDBInternal.getBaseDatasetGraphTDB(TDBFactory.createDatasetGraph(location)), in, false);

        String queryString =
            "PREFIX foaf: <http://xmlns.com/foaf/0.1/> " +
            "SELECT ?name WHERE { " +
            "    ?person foaf:mbox <mailto:alice@example.org> . " +
            "    ?person foaf:name ?name . " +
            "}";

        Dataset dataset = TDBFactory.createDataset(location);
        dataset.begin(ReadWrite.READ);
        try {
            Query query = QueryFactory.create(queryString);
            QueryExecution qexec = QueryExecutionFactory.create(query, dataset);
            try {
                ResultSet results = qexec.execSelect();
                while ( results.hasNext() ) {
                    QuerySolution soln = results.nextSolution();
                    Literal name = soln.getLiteral("name");
                    System.out.println(name);
                }
            } finally {
                qexec.close();
            }
        } finally {
            dataset.end();
        }
    }

}


text:
DECLARE_WINDOW_PROPERTY_TYPE(aura::client::DispatcherClient*);

namespace aura {
namespace client {

DEFINE_LOCAL_WINDOW_PROPERTY_KEY(DispatcherClient*, kDispatcherClientKey, NULL);

void SetDispatcherClient(Window* root_window, DispatcherClient* client) {
  DCHECK_EQ(root_window->GetRootWindow(), root_window);
  root_window->SetProperty(kDispatcherClientKey, client);
}

DispatcherClient* GetDispatcherClient(Window* root_window) {
  if (root_window)
    DCHECK_EQ(root_window->GetRootWindow(), root_window);
  return root_window ? root_window->GetProperty(kDispatcherClientKey) : NULL;
}

}  // namespace client
}  // namespace aura


text:
package fr.isep.simizer.laws;

import java.lang.reflect.Constructor;

/**
 * A class representing a probability distribution.
 *

 * Probability distributions are used throughout the application to
 * mathematically define the randomness present in the simulation.  Custom
 * {@code Law}s can be defined to provide clients, servers, and the network with
 * non-standard or application-specific behavior.
 *

 * A subclass should override the {@link #nextValue()} method to define its
 * custom behavior.
 */
public abstract class Law {

  /**
   * Instantiates a {@code Law} subclass from a string representation.
   *

   * The string should be specified as
   * {@code <class>,<number of parameters>,<optional parameter>}.  The final
   * parameter is both optional and varies depending on the particular
   * distribution law.  See the concrete subclasses for its usage in each
   * situation.
   *

   * This method will always return a valid {@code Law} subclass, unless an
   * error occurs, in which case an {@link Exception} will be thrown.
   *
   * @param definition a string representing the law
   * @return a valid instance of a subclass of the Law class
   * @throws Exception if an error occurs while performing the instantiation
   */
  public static Law loadLaw(String definition) throws Exception {
    Law lawInstance = null;

    String[] args = definition.split(",");

    // find the name of the class to instantiate
    Class lawClass = Class.forName(args[0]);

    // find the constructor for the specified number of arguments
    for (Constructor cs : lawClass.getConstructors()) {
      int argumentCount = args.length - 1;  // skip the class, but use others
      Class[] parameters = cs.getParameterTypes();
      if (parameters.length == argumentCount) {
        Object[] values = new Object[parameters.length];

        int index = 0;
        for (Class cls : parameters) {
          if (cls.equals(Integer.class)) {
            values[index] = Integer.parseInt(args[index + 1]);
          } else if (cls.equals(Double.class)) {
            values[index] = Double.parseDouble(args[index + 1]);
          } else {
            throw new RuntimeException("Could not parse Law argument.");
          }
          index++;
        }

        lawInstance = (Law) cs.newInstance(values);
      }
    }

    // make sure that we found a valid constructor before setting the parameter
    if (lawInstance == null) {
      throw new NullPointerException("Unable to instantiate Law.");
    }

    return lawInstance;
  }

  private Integer upperBound = null;

  /**
   * Initializes an instance of the {@code Law} class.
   */
  public Law() {}

  /**
   * Sets the upper bound for the {@code Law}.
   *

   * Once set, this {@code Law} will only return values in the range {@code [0,
   * upperBound)}.  This can be useful if a {@code Law} is being used to select
   * values from some sort of a collection with a strict upper bound.
   *

   * To remove an upper bound that has previously been set, use {@link
   * #removeUpperBound()}.
   *
   * @param upperBound the upper bound to use
   */
  public void setUpperBound(int upperBound) {
    this.upperBound = upperBound;
  }

  /**
   * Removes the upper bound restriction for this {@code Law} instance.
   */
  public void removeUpperBound() {
    this.upperBound = null;
  }

  /**
   * Generates the next random value for this {@code Law}.
   *

   * If there is an upper bound specified, then this method will return a value
   * in the range [0, upperBound).  Otherwise, this will return any valid
   * non-negative value from the Law's distribution.
   *

   * If a generated value is outside of this range, new values will be generated
   * until one is within the acceptable range.
   *
   * @return a value from the distribution
   */
  public int nextValue() {
    int result;
    do {
      result = generateNextValue();
    } while (result < 0
              || (this.upperBound != null && result >= this.upperBound));
    return result;
  }

  /**
   * Generates the next value from the distribution.
   *

   * This should not enforce any restriction on the upper bound.  That logic is
   * handled internally within the Law class.
   *
   * @return a value from the distribution
   */
  protected abstract int generateNextValue();
}


text:
module ProMotion
  class WebScreen < ViewController
    include ProMotion::WebScreenModule
  end
end


text:
extern "Java"
{
  namespace org
  {
    namespace omg
    {
      namespace CORBA
      {
          class SetOverrideType;
      }
    }
  }
}

class org::omg::CORBA::SetOverrideType : public ::java::lang::Object
{

public: // actually protected
  SetOverrideType(jint);
public:
  static ::org::omg::CORBA::SetOverrideType * from_int(jint);
  virtual ::java::lang::String * toString();
  virtual jint value();
private:
  static const jlong serialVersionUID = -2761857189425106972LL;
public:
  static const jint _ADD_OVERRIDE = 1;
  static const jint _SET_OVERRIDE = 0;
  static ::org::omg::CORBA::SetOverrideType * ADD_OVERRIDE;
  static ::org::omg::CORBA::SetOverrideType * SET_OVERRIDE;
private:
  jint __attribute__((aligned(__alignof__( ::java::lang::Object)))) _value;
public:
  static ::java::lang::Class class$;
};

#endif // __org_omg_CORBA_SetOverrideType__


text:
var Logger = require("logger");

var Part = require("stored-objects/part");
var Project = require("stored-objects/project");
var Ship = require("stored-objects/ship");
var Stage = require("stored-objects/stage");
var ShipPart = require("stored-objects/ship-part");

kmptoolApp.controller('ShipListCtrl'
    , [ "$scope", "kmpSvc", "$timeout", "kmpData"
    , function($scope, kmpSvc, $timeout, kmpData) {

        function loadShips() {
            if (!$scope.gCurrentProject) {
                Logger.infoi("Can not load ships because there is no current project");
                return;
            }

            Logger.infoi("Loading ships for "+$scope.gCurrentProject.name);

            Ship.forProject($scope.gCurrentProject).toArray()
                .then(function(list) {

                    list.sort(function(a,b) {
                        //return a.order - b.order;
                        aname = a.name.toLowerCase();
                        bname = b.name.toLowerCase();
                        if (aname > b.name) return 1;
                        if (aname < bname) return -1;
                        return 0;
                    });

                    Logger.infoi("Got list of ships ",list);
                    $timeout(function() {
                        $scope.ships = list;
                    });
                })
                .catch(function(err) {
                    kmpSvc.showError(err);
                });
        }

        loadShips();
        $scope.$watch("gCurrentProject", loadShips);

        $scope.selectShip = function(ship) {

        }

        $scope.deleteShip = function(ship) {

        }

        $scope.addNewShip = function() {

            Logger.infoi("Add ship");

            if (!$scope.gCurrentProject) {
                kmpSvc.showError("Can not add a ship without a current project");
                return;
            }

            var name = ($scope.newShipName || "").trim();
            if (!name) {
                Logger.infoi("Ignoring add ship because name is null");
                return;
            }

            var newShip = new Ship($scope.gCurrentProject);
            newShip.name = name;
            newShip.save().then(function() {
                loadShips();
                $timeout(function() {
                    $scope.newShipName = "";
                });
            });
        }

    }])


text:
<?php

namespace Jarvis\Command\Vagrant;

use Symfony\Component\Console\Input\InputInterface;
use Symfony\Component\Console\Output\OutputInterface;

class StatusCommand extends BaseCommand
{
    /**
     * {@inheritdoc}
     */
    protected function configure()
    {
        $this->setName('vagrant:status');
        $this->setDescription('Outputs status of the vagrant machine');
    }

    /**
     * {@inheritdoc}
     */
    protected function execute(InputInterface $input, OutputInterface $output)
    {
        $this->getVagrantExec()->exec('status');
    }
}


text:
console.log( 'bar' );
//# sourceMappingURL=bar.js.map


text:
'use strict';

// MODULES //

var bench = require( '@stdlib/bench' );
var pow = require( '@stdlib/math/base/special/pow' );
var pkg = require( './../package.json' ).name;
var Float32Array = require( './../lib' );

// FUNCTIONS //

/**
* Updates an accumulated value.
*
* @private
* @param {*} acc - accumulated value
* @param {*} value - array element
* @returns {*} accumulated value
*/
function fcn( acc, value ) {
	return acc + value + 1.0;
}

/**
* Creates a benchmark function.
*
* @private
* @param {PositiveInteger} len - array length
* @returns {Function} benchmark function
*/
function createBenchmark( len ) {
	var arr = new Float32Array( len );
	return benchmark;

	/**
	* Benchmark function.
	*
	* @private
	* @param {Benchmark} b - benchmark instance
	*/
	function benchmark( b ) {
		var out;
		var i;

		b.tic();
		for ( i = 0; i < b.iterations; i++ ) {
			out = arr.reduce( fcn );
			if ( out !== out ) {
				b.fail( 'should not return NaN' );
			}
		}
		b.toc();
		if ( out !== out ) {
			b.fail( 'should not return NaN' );
		}
		b.pass( 'benchmark finished' );
		b.end();
	}
}

// MAIN //

/**
* Main execution sequence.
*
* @private
*/
function main() {
	var len;
	var min;
	var max;
	var f;
	var i;

	min = 1; // 10^min
	max = 6; // 10^max

	for ( i = min; i <= max; i++ ) {
		len = pow( 10, i );
		f = createBenchmark( len );
		bench( pkg+':reduce:len='+len, f );
	}
}

main();


text:
package com.cgz.capa.logic.scoring.impl;

import org.junit.Test;
import org.junit.runner.RunWith;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Qualifier;
import org.springframework.test.context.ContextConfiguration;
import org.springframework.test.context.junit4.SpringJUnit4ClassRunner;

@RunWith(SpringJUnit4ClassRunner.class)
@ContextConfiguration("classpath:spring-config.xml")
public class BasicResultAnalyserTest {

    @Autowired
    @Qualifier("BasicResultAnalyser")
    private BasicResultAnalyser basicResultAnalyser;

    @Test
    public void testAnalise() throws Exception {

        //TODO
    }
}


text:
class CPIDController
{
public:
    // Pointers
    float*		m_pInput;
    float*		m_pOutput;
    float*		m_pSetpoint;

    // Attributes
    uint32_t	m_lastTime_ms;
    uint32_t	m_samplingPeriod_ms;

    int8_t		m_controllerDirection;

    bool		m_isActive;
    bool		m_isInitialized;

    float		m_kp;                  // * (P)roportional Tuning Parameter
    float		m_ki;                  // * (I)ntegral Tuning Parameter
    float		m_kd;                  // * (D)erivative Tuning Parameter

    float		m_displayKp;
    float		m_displayKi;
    float		m_displayKd;

    float		m_pTerm;
    float		m_iTerm;
    float		m_dTerm;

    float		m_lastInput;
    float		m_outputMin;
    float		m_outputMax;

    // Methods
    CPIDController( float kpIn, float kiIn, float kdIn, float outputMinIn, float outputMaxIn, int8_t directionIn, uint32_t samplingPeriodIn_ms );

    void Initialize( float* inputIn, float* outputIn, float* setpointIn );
    virtual void Compute() = 0;
    void Activate();
    void Deactivate();
};

class CPIDControllerAngular : public CPIDController
{
public:
    CPIDControllerAngular( float kpIn, float kiIn, float kdIn, float outputMinIn, float outputMaxIn, int8_t directionIn, uint32_t samplingPeriodIn_ms )
        : CPIDController( kpIn, kiIn, kdIn,	outputMinIn, outputMaxIn, directionIn, samplingPeriodIn_ms )
    {

    }

    virtual void Compute();
};

class CPIDControllerLinear : public CPIDController
{
public:
    CPIDControllerLinear( float kpIn, float kiIn, float kdIn, float outputMinIn, float outputMaxIn, int8_t directionIn, uint32_t samplingPeriodIn_ms )
        : CPIDController( kpIn, kiIn, kdIn,	outputMinIn, outputMaxIn, directionIn, samplingPeriodIn_ms )
    {

    }
    virtual void Compute();
};


text:
package org.kurento.test.config;

import static org.kurento.commons.PropertiesManager.getProperty;
import static org.kurento.test.config.TestConfiguration.TEST_REPORT_DEFAULT;
import static org.kurento.test.config.TestConfiguration.TEST_REPORT_PROPERTY;

import java.io.BufferedWriter;
import java.io.File;
import java.io.FileWriter;
import java.io.IOException;
import java.io.PrintWriter;
import java.util.Date;

import org.kurento.commons.exception.KurentoException;
import org.kurento.test.browser.Browser;
import org.kurento.test.docker.Docker;

/**
 * Test report, to compile information of the test result in a HTML page.
 *
 * @author Boni Garcia (bgarcia@gsyc.es)
 * @since 6.0.0
 */
public class TestReport {

  private static TestReport singleton;

  protected String testReport = getProperty(TEST_REPORT_PROPERTY, TEST_REPORT_DEFAULT);
  protected static final String RETURN = "\r\n";
  protected static final int WIDTH_PERCENTAGE = 95;

  protected PrintWriter writer;
  protected String extraInfoHtml;
  protected String extraErrorHtml;
  protected int numRetries;

  public static TestReport getSingleton(String name, int numRetries) {
    if (singleton == null) {
      synchronized (Docker.class) {
        if (singleton == null) {
          singleton = new TestReport(name, numRetries, null);
        }
      }
    }
    return singleton;
  }

  public static TestReport getSingleton(String name, int numRetries, String htmlHeader) {
    if (singleton == null) {
      synchronized (Docker.class) {
        if (singleton == null) {
          singleton = new TestReport(name, numRetries, htmlHeader);
        }
      }
    }
    return singleton;
  }

  public TestReport(String name, int numRetries, String htmlHeader) {
    try {
      this.numRetries = numRetries;
      this.extraInfoHtml = "";
      this.extraErrorHtml = "";
      String title = name == null ? "Tests report [" + new Date() + "]" : name;
      File file = new File(testReport);
      boolean exists = file.exists();
      writer = new PrintWriter(new BufferedWriter(new FileWriter(file, true)));
      if (!exists) {
        initPage();
        if (htmlHeader != null) {
          appendHtml(htmlHeader);
        }
      }
      appendTitle(title);
      writer.flush();
    } catch (IOException e) {
      throw new KurentoException(e);
    }
  }

  public void initPage() {
    String kurentoLogoPng = "http://files.openvidu.io/img/kurento.png";
    appendHtml("<link rel='shortcut icon' href='" + kurentoLogoPng + "' type='image/png' />");
    appendHtml(
        "");
    appendHtml("");
    appendHtml("");
    appendHtml("");
    appendHtml("

Kurento Test Framework Report

");
  }

  public void appendTitle(String text) {
    writer.println("
" + escapeHtml(text) + "
");
    writer.flush();
  }

  public void appendHeader(String text) {
    writer.println("
" + escapeHtml(text) + "
");
    writer.flush();
  }

  public void carriageReturn() {
    writer.println("
");
    writer.flush();
  }

  public void appendLine() {
    writer.println("
");
    writer.flush();
  }

  public String getCode(String text) {
    String code = "<button type='button' onclick=\"saveAs(new Blob([$(this).next().val()], "
        + "{type: 'text/plain;charset=utf-8'}), ($(this).prev().text() ? "
        + "$(this).prev().text() : $(this).prev().prev().text()) + '.log');\">Save</button>";
    code += "<textarea readonly style='width:" + WIDTH_PERCENTAGE + "%; height:150px;' wrap='off'>";
    code += text;
    code += "</textarea>

";
    return code;
  }

  public void appendCode(String text) {
    writer.println(getCode(text));
    writer.flush();
  }

  public void appendCode(Object[] text) {
    String allText = "";
    for (Object o : text) {
      allText += o.toString() + RETURN;
    }
    appendCode(allText);
  }

  public void appendText(Object[] text) {
    for (Object o : text) {
      writer.println(escapeHtml(o.toString()) + "
");
    }
    writer.flush();
  }

  public void appendText(String text) {
    writer.println(escapeHtml(text));
    writer.flush();
  }

  public void appendSuccess(String text) {
    writer.println("
" + escapeHtml(text) + "
");
    writer.flush();
  }

  public void appendWarning(String text) {
    writer.println("
" + escapeHtml(text) + "
");
    writer.flush();
  }

  public void appendError(String text) {
    writer.println("
" + escapeHtml(text) + "
");
    writer.flush();
  }

  public void appendHtml(String html) {
    writer.println(html);
    writer.flush();
  }

  public void appendTrace(String text) {
    writer.println("
" + text + "
");
    writer.flush();
  }

  public String escapeHtml(String text) {
    StringBuilder builder = new StringBuilder();
    boolean previousWasASpace = false;
    for (char c : text.toCharArray()) {
      if (c == ' ') {
        if (previousWasASpace) {
          builder.append(" ");
          previousWasASpace = false;
          continue;
        }
        previousWasASpace = true;
      } else {
        previousWasASpace = false;
      }
      switch (c) {
        case '<':
          builder.append("<");
          break;
        case '>':
          builder.append(">");
          break;
        case '&':
          builder.append("&");
          break;
        case '"':
          builder.append(""");
          break;
        case '\n':
          builder.append("
");
          break;
        case '\t':
          builder.append("     ");
          break;
        default:
          if (c < 128) {
            builder.append(c);
          } else {
            builder.append("&#").append((int) c).append(";");
          }
      }
    }
    return builder.toString();
  }

  public void appendException(Throwable throwable, TestScenario testScenario) {
    appendHtml("Error description");
    appendCode(throwable.getClass().getName() + " : " + throwable.getMessage());
    appendHtml("Error trace");
    appendCode(throwable.getStackTrace());
    boolean saucelabsTitle = false;
    if (testScenario != null) {
      for (Browser bc : testScenario.getBrowserMap().values()) {
        if (bc.getScope() == BrowserScope.SAUCELABS) {
          if (!saucelabsTitle) {
            appendHtml("Saucelabs job(s)
");
            saucelabsTitle = true;
          }
          String jobId = bc.getJobId();
          appendHtml(
              "" + bc.getId() + "
");
        }
      }
      if (saucelabsTitle) {
        carriageReturn();
      }
    }
  }

  public void addExtraInfoText(String text) {
    extraInfoHtml += escapeHtml(text);
  }

  public void addExtraInfoHtml(String html) {
    extraInfoHtml += html;
  }

  public void addExtraErrorText(String text) {
    extraErrorHtml += escapeHtml(text);
  }

  public void addExtraErrorHtml(String html) {
    extraErrorHtml += html;
  }

  public void flushExtraInfoHtml() {
    if (!extraInfoHtml.isEmpty()) {
      appendHtml(extraInfoHtml);
      extraInfoHtml = "";
    }
  }

  public void flushExtraErrorHtml() {
    if (!extraErrorHtml.isEmpty()) {
      appendHtml(extraErrorHtml);
      extraErrorHtml = "";
    }
  }
}


text:
<?xml version="1.0"?>
<?xml-model href="http://download.ros.org/schema/package_format3.xsd" schematypens="http://www.w3.org/2001/XMLSchema"?>
<package format="3">
    <name>rj_geometry_msgs</name>
    <version>0.0.0</version>
    <description>TODO: Package description</description>
    <maintainer email="kylestach99@gmail.com">Kyle Stachowicz</maintainer>
    <maintainer email="oswinso@gmail.com">Oswin So</maintainer>
    <license>TODO: License declaration</license>

    <buildtool_depend>ament_cmake</buildtool_depend>
    <buildtool_depend>rosidl_default_generators</buildtool_depend>

    <depend>std_msgs</depend>

    <member_of_group>rosidl_interface_packages</member_of_group>

    <export>
        <build_type>ament_cmake</build_type>
    </export>
</package>


text:
using crypto::SecureHash;

namespace {
// This class makes sure that the CRX digital signature is valid
// and well formed.
class CRXValidator {
 public:
  explicit CRXValidator(FILE* crx_file) : valid_(false) {
    extensions::CrxFile::Header header;
    size_t len = fread(&header, 1, sizeof(header), crx_file);
    if (len < sizeof(header))
      return;

    extensions::CrxFile::Error error;
    scoped_ptr<extensions::CrxFile> crx(
        extensions::CrxFile::Parse(header, &error));
    if (!crx.get())
      return;

    std::vector<uint8> key(header.key_size);
    len = fread(&key[0], sizeof(uint8), header.key_size, crx_file);
    if (len < header.key_size)
      return;

    std::vector<uint8> signature(header.signature_size);
    len = fread(&signature[0], sizeof(uint8), header.signature_size, crx_file);
    if (len < header.signature_size)
      return;

    crypto::SignatureVerifier verifier;
    if (!verifier.VerifyInit(extension_misc::kSignatureAlgorithm,
                             sizeof(extension_misc::kSignatureAlgorithm),
                             &signature[0], signature.size(),
                             &key[0], key.size())) {
      // Signature verification initialization failed. This is most likely
      // caused by a public key in the wrong format (should encode algorithm).
      return;
    }

    const size_t kBufSize = 8 * 1024;
    scoped_ptr<uint8[]> buf(new uint8[kBufSize]);
    while ((len = fread(buf.get(), 1, kBufSize, crx_file)) > 0)
      verifier.VerifyUpdate(buf.get(), len);

    if (!verifier.VerifyFinal())
      return;

    public_key_.swap(key);
    valid_ = true;
  }

  bool valid() const { return valid_; }

  const std::vector<uint8>& public_key() const { return public_key_; }

 private:
  bool valid_;
  std::vector<uint8> public_key_;
};

// Deserialize the CRX manifest. The top level must be a dictionary.
// TODO(cpu): add a specific attribute check to a component json that the
// extension unpacker will reject, so that a component cannot be installed
// as an extension.
base::DictionaryValue* ReadManifest(const base::FilePath& unpack_path) {
  base::FilePath manifest =
      unpack_path.Append(FILE_PATH_LITERAL("manifest.json"));
  if (!file_util::PathExists(manifest))
    return NULL;
  JSONFileValueSerializer serializer(manifest);
  std::string error;
  scoped_ptr<base::Value> root(serializer.Deserialize(NULL, &error));
  if (!root.get())
    return NULL;
  if (!root->IsType(base::Value::TYPE_DICTIONARY))
    return NULL;
  return static_cast<base::DictionaryValue*>(root.release());
}

}  // namespace.

ComponentUnpacker::ComponentUnpacker(const std::vector<uint8>& pk_hash,
                                     const base::FilePath& path,
                                     ComponentInstaller* installer)
  : error_(kNone) {
  if (pk_hash.empty() || path.empty()) {
    error_ = kInvalidParams;
    return;
  }
  // First, validate the CRX header and signature. As of today
  // this is SHA1 with RSA 1024.
  ScopedStdioHandle file(file_util::OpenFile(path, "rb"));
  if (!file.get()) {
    error_ = kInvalidFile;
    return;
  }
  CRXValidator validator(file.get());
  if (!validator.valid()) {
    error_ = kInvalidFile;
    return;
  }
  file.Close();

  // File is valid and the digital signature matches. Now make sure
  // the public key hash matches the expected hash. If they do we fully
  // trust this CRX.
  uint8 hash[32];
  scoped_ptr<SecureHash> sha256(SecureHash::Create(SecureHash::SHA256));
  sha256->Update(&(validator.public_key()[0]), validator.public_key().size());
  sha256->Finish(hash, arraysize(hash));

  if (!std::equal(pk_hash.begin(), pk_hash.end(), hash)) {
    error_ = kInvalidId;
    return;
  }
  // We want the temporary directory to be unique and yet predictable, so
  // we can easily find the package in a end user machine.
  std::string dir(
      base::StringPrintf("CRX_%s", base::HexEncode(hash, 6).c_str()));
  unpack_path_ = path.DirName().AppendASCII(dir.c_str());
  if (file_util::DirectoryExists(unpack_path_)) {
    if (!file_util::Delete(unpack_path_, true)) {
      unpack_path_.clear();
      error_ = kUzipPathError;
      return;
    }
  }
  if (!file_util::CreateDirectory(unpack_path_)) {
    unpack_path_.clear();
    error_ = kUzipPathError;
    return;
  }
  if (!zip::Unzip(path, unpack_path_)) {
    error_ = kUnzipFailed;
    return;
  }
  scoped_ptr<base::DictionaryValue> manifest(ReadManifest(unpack_path_));
  if (!manifest.get()) {
    error_ = kBadManifest;
    return;
  }
  if (!installer->Install(*manifest, unpack_path_)) {
    error_ = kInstallerError;
    return;
  }
  // Installation successful. The directory is not our concern now.
  unpack_path_.clear();
}

ComponentUnpacker::~ComponentUnpacker() {
  if (!unpack_path_.empty()) {
    file_util::Delete(unpack_path_, true);
  }
}


text:
'use strict';

angular.module('adminApp.elasticSearch', [])
.controller('ElasticSearchCtrl', ['$scope', '$http', '$filter', 'settings', function($scope, $http, $filter, settings) {
  var apiURL = settings.apiURL;

  //TODO update when account has gender or profile image url
  $scope.searchProducts = function(pageNo, limit) {
      $scope.products = [];
        $http.post(apiURL + "/search/products", {
                                                        product: this.product,
                                                        not_product: this.not_product,
                                                        source: this.source,
                                                        not_source: this.not_source,
                                                        epc_high: this.epc_high,
                                                        epc_low: this.epc_low,
                                                        price_high: this.price_high,
                                                        price_low: this.price_low,
                                                        merchant: this.merchant,
                                                        not_merchant: this.not_merchant,
                                                        country: this.country,
                                                        category: this.category,
                                                        expiration: $filter('date')(this.expiration, "yyyyMMdd0000"),
                                                        listingid:  this.listingid,
                                                        asin:       this.asin,
                                                        upc:        this.upc,
                                                        offerid:    this.offerid,
                                                        page: pageNo,
                                                        per_page: limit
                                                      }
            )
            .success(function(data, status, headers, config) {
                if(data != null && data["hits"] != null && data["hits"]["hits"] != null) {
                    $scope.products = data.hits.hits;
                    if($scope.source == 'shz')
                        $scope.checkOfferExists($scope.products);
                    $scope.totalItems = data["hits"]["total"]
                }
            })
            .error(function(data, status, headers, config) {
                alert(data);
            });
  }
  $scope.formatExpirationDate = function(date) {
      return new Date(date.substr(0, 4), date.substr(4,2), date.substr(6,2))
  }
  $scope.checkOfferExists = function(products) {
      $scope.offers = {}
      for(index = 0; index < products.length; ++index) {
          product = products[index];
          productId = product["_source"]["listingId"];
            $scope.offers[productId] = "Checking...";
            $http.get(apiURL + "/products/check_offer_exists/" + productId)
                .success(function(data, status, headers, config) {
                   $scope.offers[data.product_id] = "OK";
                }).error(function(data, status, headers, config) {
                    $scope.offers[data.product_id] = "None";
                });
      }
  }
  // Pagination
    $scope.pageChanged = function() {
        console.log('Page changed to: ' + $scope.currentPage);
        $scope.searchProducts($scope.currentPage, $scope.perPage)
    };

    $scope.setPage = function (pageNo) {
        $scope.currentPage = pageNo;
    };
    $scope.queryProducts = function() {
        $scope.totalItems = 0;
        $scope.currentPage = 1;
        $scope.maxSize = 5;
        $scope.perPage = 25;
        $scope.searchProducts($scope.currentPage, $scope.perPage);
    }
  $scope.queryProducts();
}]);


text:
#include <set>

#include "ignite/odbc/utility.h"
#include "ignite/odbc/system/odbc_constants.h"

#include "ignite/odbc/dsn_config.h"

using ignite::odbc::config::Configuration;

#define BUFFER_SIZE 1024
#define CONFIG_FILE "ODBC.INI"

namespace ignite
{
    namespace odbc
    {
        void ThrowLastSetupError()
        {
            DWORD code;
            char msg[BUFFER_SIZE];

            SQLInstallerError(1, &code, msg, sizeof(msg), NULL);

            std::stringstream buf;

            buf << "Message: \"" << msg << "\", Code: " << code;

            throw IgniteError(IgniteError::IGNITE_ERR_GENERIC, buf.str().c_str());
        }

        void WriteDsnString(const char* dsn, const char* key, const char* value)
        {
            if (!SQLWritePrivateProfileString(dsn, key, value, CONFIG_FILE))
                ThrowLastSetupError();
        }

        std::string ReadDsnString(const char* dsn, const std::string& key, const std::string& dflt)
        {
            char buf[BUFFER_SIZE];

            memset(buf, 0, sizeof(buf));

            SQLGetPrivateProfileString(dsn, key.c_str(), dflt.c_str(), buf, sizeof(buf), CONFIG_FILE);

            return std::string(buf);
        }

        int ReadDsnInt(const char* dsn, const std::string& key, int dflt)
        {
            char buf[BUFFER_SIZE];

            memset(buf, 0, sizeof(buf));

            std::string dflt0 = common::LexicalCast<std::string>(dflt);

            SQLGetPrivateProfileString(dsn, key.c_str(), dflt0.c_str(), buf, sizeof(buf), CONFIG_FILE);

            return common::LexicalCast<int, std::string>(buf);
        }

        bool ReadDsnBool(const char* dsn, const std::string& key, bool dflt)
        {
            char buf[BUFFER_SIZE];

            memset(buf, 0, sizeof(buf));

            std::string dflt0 = dflt ? "true" : "false";

            SQLGetPrivateProfileString(dsn, key.c_str(), dflt0.c_str(), buf, sizeof(buf), CONFIG_FILE);

            return std::string(buf) == "true";
        }

        void ReadDsnConfiguration(const char* dsn, Configuration& config)
        {
            std::string address = ReadDsnString(dsn, Configuration::Key::address, config.GetAddress());

            std::string server = ReadDsnString(dsn, Configuration::Key::server, config.GetHost());

            uint16_t port = ReadDsnInt(dsn, Configuration::Key::port, config.GetTcpPort());

            std::string schema = ReadDsnString(dsn, Configuration::Key::schema, config.GetSchema());

            bool distributedJoins = ReadDsnBool(dsn, Configuration::Key::distributedJoins, config.IsDistributedJoins());

            bool enforceJoinOrder = ReadDsnBool(dsn, Configuration::Key::enforceJoinOrder, config.IsEnforceJoinOrder());

            bool replicatedOnly = ReadDsnBool(dsn, Configuration::Key::replicatedOnly, config.IsReplicatedOnly());

            bool collocated = ReadDsnBool(dsn, Configuration::Key::collocated, config.IsCollocated());

            bool lazy = ReadDsnBool(dsn, Configuration::Key::lazy, config.IsLazy());

            bool skipReducerOnUpdate =
                ReadDsnBool(dsn, Configuration::Key::skipReducerOnUpdate, config.IsSkipReducerOnUpdate());

            std::string version = ReadDsnString(dsn, Configuration::Key::protocolVersion,
                config.GetProtocolVersion().ToString());

            int32_t pageSize = ReadDsnInt(dsn, Configuration::Key::pageSize, config.GetPageSize());

            if (pageSize <= 0)
                pageSize = config.GetPageSize();

            std::string sslMode = ReadDsnString(dsn, Configuration::Key::sslMode, config.GetSslMode());

            std::string sslKeyFile = ReadDsnString(dsn, Configuration::Key::sslKeyFile, config.GetSslKeyFile());

            std::string sslCertFile = ReadDsnString(dsn, Configuration::Key::sslCertFile, config.GetSslCertFile());

            std::string sslCaFile = ReadDsnString(dsn, Configuration::Key::sslCaFile, config.GetSslCaFile());

            config.SetAddress(address);
            config.SetHost(server);
            config.SetTcpPort(port);
            config.SetSchema(schema);
            config.SetDistributedJoins(distributedJoins);
            config.SetEnforceJoinOrder(enforceJoinOrder);
            config.SetReplicatedOnly(replicatedOnly);
            config.SetCollocated(collocated);
            config.SetLazy(lazy);
            config.SetSkipReducerOnUpdate(skipReducerOnUpdate);
            config.SetProtocolVersion(version);
            config.SetPageSize(pageSize);
            config.SetSslMode(sslMode);
            config.SetSslKeyFile(sslKeyFile);
            config.SetSslCertFile(sslCertFile);
            config.SetSslCaFile(sslCaFile);
        }
    }
}


text:
/*
 * WARNING! DO NOT EDIT THIS FILE DIRECTLY!
 *
 * This file was generated automatically and any changes may be lost.
 */
#ifndef __HW_PMC_REGISTERS_H__
#define __HW_PMC_REGISTERS_H__

#include "MK64F12.h"
#include "fsl_bitband.h"

/*
 * MK64F12 PMC
 *
 * Power Management Controller
 *
 * Registers defined in this header file:
 * - HW_PMC_LVDSC1 - Low Voltage Detect Status And Control 1 register
 * - HW_PMC_LVDSC2 - Low Voltage Detect Status And Control 2 register
 * - HW_PMC_REGSC - Regulator Status And Control register
 *
 * - hw_pmc_t - Struct containing all module registers.
 */

#define HW_PMC_INSTANCE_COUNT (1U) /*!< Number of instances of the PMC module. */

/*******************************************************************************
 * HW_PMC_LVDSC1 - Low Voltage Detect Status And Control 1 register
 ******************************************************************************/

/*!
 * @brief HW_PMC_LVDSC1 - Low Voltage Detect Status And Control 1 register (RW)
 *
 * Reset value: 0x10U
 *
 * This register contains status and control bits to support the low voltage
 * detect function. This register should be written during the reset initialization
 * program to set the desired controls even if the desired settings are the same
 * as the reset settings. While the device is in the very low power or low
 * leakage modes, the LVD system is disabled regardless of LVDSC1 settings. To protect
 * systems that must have LVD always on, configure the Power Mode Protection
 * (PMPROT) register of the SMC module (SMC_PMPROT) to disallow any very low power or
 * low leakage modes from being enabled. See the device's data sheet for the
 * exact LVD trip voltages. The LVDV bits are reset solely on a POR Only event. The
 * register's other bits are reset on Chip Reset Not VLLS. For more information
 * about these reset types, refer to the Reset section details.
 */
typedef union _hw_pmc_lvdsc1
{
    uint8_t U;
    struct _hw_pmc_lvdsc1_bitfields
    {
        uint8_t LVDV : 2;              /*!< [1:0] Low-Voltage Detect Voltage Select */
        uint8_t RESERVED0 : 2;         /*!< [3:2]  */
        uint8_t LVDRE : 1;             /*!< [4] Low-Voltage Detect Reset Enable */
        uint8_t LVDIE : 1;             /*!< [5] Low-Voltage Detect Interrupt Enable */
        uint8_t LVDACK : 1;            /*!< [6] Low-Voltage Detect Acknowledge */
        uint8_t LVDF : 1;              /*!< [7] Low-Voltage Detect Flag */
    } B;
} hw_pmc_lvdsc1_t;

/*!
 * @name Constants and macros for entire PMC_LVDSC1 register
 */
/*@{*/
#define HW_PMC_LVDSC1_ADDR(x)    ((x) + 0x0U)

#define HW_PMC_LVDSC1(x)         (*(__IO hw_pmc_lvdsc1_t *) HW_PMC_LVDSC1_ADDR(x))
#define HW_PMC_LVDSC1_RD(x)      (HW_PMC_LVDSC1(x).U)
#define HW_PMC_LVDSC1_WR(x, v)   (HW_PMC_LVDSC1(x).U = (v))
#define HW_PMC_LVDSC1_SET(x, v)  (HW_PMC_LVDSC1_WR(x, HW_PMC_LVDSC1_RD(x) |  (v)))
#define HW_PMC_LVDSC1_CLR(x, v)  (HW_PMC_LVDSC1_WR(x, HW_PMC_LVDSC1_RD(x) & ~(v)))
#define HW_PMC_LVDSC1_TOG(x, v)  (HW_PMC_LVDSC1_WR(x, HW_PMC_LVDSC1_RD(x) ^  (v)))
/*@}*/

/*
 * Constants & macros for individual PMC_LVDSC1 bitfields
 */

/*!
 * @name Register PMC_LVDSC1, field LVDV[1:0] (RW)
 *
 * Selects the LVD trip point voltage (V LVD ).
 *
 * Values:
 * - 00 - Low trip point selected (V LVD = V LVDL )
 * - 01 - High trip point selected (V LVD = V LVDH )
 * - 10 - Reserved
 * - 11 - Reserved
 */
/*@{*/
#define BP_PMC_LVDSC1_LVDV   (0U)          /*!< Bit position for PMC_LVDSC1_LVDV. */
#define BM_PMC_LVDSC1_LVDV   (0x03U)       /*!< Bit mask for PMC_LVDSC1_LVDV. */
#define BS_PMC_LVDSC1_LVDV   (2U)          /*!< Bit field size in bits for PMC_LVDSC1_LVDV. */

/*! @brief Read current value of the PMC_LVDSC1_LVDV field. */
#define BR_PMC_LVDSC1_LVDV(x) (HW_PMC_LVDSC1(x).B.LVDV)

/*! @brief Format value for bitfield PMC_LVDSC1_LVDV. */
#define BF_PMC_LVDSC1_LVDV(v) ((uint8_t)((uint8_t)(v) << BP_PMC_LVDSC1_LVDV) & BM_PMC_LVDSC1_LVDV)

/*! @brief Set the LVDV field to a new value. */
#define BW_PMC_LVDSC1_LVDV(x, v) (HW_PMC_LVDSC1_WR(x, (HW_PMC_LVDSC1_RD(x) & ~BM_PMC_LVDSC1_LVDV) | BF_PMC_LVDSC1_LVDV(v)))
/*@}*/

/*!
 * @name Register PMC_LVDSC1, field LVDRE[4] (RW)
 *
 * This write-once bit enables LVDF events to generate a hardware reset.
 * Additional writes are ignored.
 *
 * Values:
 * - 0 - LVDF does not generate hardware resets
 * - 1 - Force an MCU reset when LVDF = 1
 */
/*@{*/
#define BP_PMC_LVDSC1_LVDRE  (4U)          /*!< Bit position for PMC_LVDSC1_LVDRE. */
#define BM_PMC_LVDSC1_LVDRE  (0x10U)       /*!< Bit mask for PMC_LVDSC1_LVDRE. */
#define BS_PMC_LVDSC1_LVDRE  (1U)          /*!< Bit field size in bits for PMC_LVDSC1_LVDRE. */

/*! @brief Read current value of the PMC_LVDSC1_LVDRE field. */
#define BR_PMC_LVDSC1_LVDRE(x) (BITBAND_ACCESS8(HW_PMC_LVDSC1_ADDR(x), BP_PMC_LVDSC1_LVDRE))

/*! @brief Format value for bitfield PMC_LVDSC1_LVDRE. */
#define BF_PMC_LVDSC1_LVDRE(v) ((uint8_t)((uint8_t)(v) << BP_PMC_LVDSC1_LVDRE) & BM_PMC_LVDSC1_LVDRE)

/*! @brief Set the LVDRE field to a new value. */
#define BW_PMC_LVDSC1_LVDRE(x, v) (BITBAND_ACCESS8(HW_PMC_LVDSC1_ADDR(x), BP_PMC_LVDSC1_LVDRE) = (v))
/*@}*/

/*!
 * @name Register PMC_LVDSC1, field LVDIE[5] (RW)
 *
 * Enables hardware interrupt requests for LVDF.
 *
 * Values:
 * - 0 - Hardware interrupt disabled (use polling)
 * - 1 - Request a hardware interrupt when LVDF = 1
 */
/*@{*/
#define BP_PMC_LVDSC1_LVDIE  (5U)          /*!< Bit position for PMC_LVDSC1_LVDIE. */
#define BM_PMC_LVDSC1_LVDIE  (0x20U)       /*!< Bit mask for PMC_LVDSC1_LVDIE. */
#define BS_PMC_LVDSC1_LVDIE  (1U)          /*!< Bit field size in bits for PMC_LVDSC1_LVDIE. */

/*! @brief Read current value of the PMC_LVDSC1_LVDIE field. */
#define BR_PMC_LVDSC1_LVDIE(x) (BITBAND_ACCESS8(HW_PMC_LVDSC1_ADDR(x), BP_PMC_LVDSC1_LVDIE))

/*! @brief Format value for bitfield PMC_LVDSC1_LVDIE. */
#define BF_PMC_LVDSC1_LVDIE(v) ((uint8_t)((uint8_t)(v) << BP_PMC_LVDSC1_LVDIE) & BM_PMC_LVDSC1_LVDIE)

/*! @brief Set the LVDIE field to a new value. */
#define BW_PMC_LVDSC1_LVDIE(x, v) (BITBAND_ACCESS8(HW_PMC_LVDSC1_ADDR(x), BP_PMC_LVDSC1_LVDIE) = (v))
/*@}*/

/*!
 * @name Register PMC_LVDSC1, field LVDACK[6] (WORZ)
 *
 * This write-only field is used to acknowledge low voltage detection errors.
 * Write 1 to clear LVDF. Reads always return 0.
 */
/*@{*/
#define BP_PMC_LVDSC1_LVDACK (6U)          /*!< Bit position for PMC_LVDSC1_LVDACK. */
#define BM_PMC_LVDSC1_LVDACK (0x40U)       /*!< Bit mask for PMC_LVDSC1_LVDACK. */
#define BS_PMC_LVDSC1_LVDACK (1U)          /*!< Bit field size in bits for PMC_LVDSC1_LVDACK. */

/*! @brief Format value for bitfield PMC_LVDSC1_LVDACK. */
#define BF_PMC_LVDSC1_LVDACK(v) ((uint8_t)((uint8_t)(v) << BP_PMC_LVDSC1_LVDACK) & BM_PMC_LVDSC1_LVDACK)

/*! @brief Set the LVDACK field to a new value. */
#define BW_PMC_LVDSC1_LVDACK(x, v) (BITBAND_ACCESS8(HW_PMC_LVDSC1_ADDR(x), BP_PMC_LVDSC1_LVDACK) = (v))
/*@}*/

/*!
 * @name Register PMC_LVDSC1, field LVDF[7] (RO)
 *
 * This read-only status field indicates a low-voltage detect event.
 *
 * Values:
 * - 0 - Low-voltage event not detected
 * - 1 - Low-voltage event detected
 */
/*@{*/
#define BP_PMC_LVDSC1_LVDF   (7U)          /*!< Bit position for PMC_LVDSC1_LVDF. */
#define BM_PMC_LVDSC1_LVDF   (0x80U)       /*!< Bit mask for PMC_LVDSC1_LVDF. */
#define BS_PMC_LVDSC1_LVDF   (1U)          /*!< Bit field size in bits for PMC_LVDSC1_LVDF. */

/*! @brief Read current value of the PMC_LVDSC1_LVDF field. */
#define BR_PMC_LVDSC1_LVDF(x) (BITBAND_ACCESS8(HW_PMC_LVDSC1_ADDR(x), BP_PMC_LVDSC1_LVDF))
/*@}*/

/*******************************************************************************
 * HW_PMC_LVDSC2 - Low Voltage Detect Status And Control 2 register
 ******************************************************************************/

/*!
 * @brief HW_PMC_LVDSC2 - Low Voltage Detect Status And Control 2 register (RW)
 *
 * Reset value: 0x00U
 *
 * This register contains status and control bits to support the low voltage
 * warning function. While the device is in the very low power or low leakage modes,
 * the LVD system is disabled regardless of LVDSC2 settings. See the device's
 * data sheet for the exact LVD trip voltages. The LVW trip voltages depend on LVWV
 * and LVDV. LVWV is reset solely on a POR Only event. The other fields of the
 * register are reset on Chip Reset Not VLLS. For more information about these
 * reset types, refer to the Reset section details.
 */
typedef union _hw_pmc_lvdsc2
{
    uint8_t U;
    struct _hw_pmc_lvdsc2_bitfields
    {
        uint8_t LVWV : 2;              /*!< [1:0] Low-Voltage Warning Voltage Select */
        uint8_t RESERVED0 : 3;         /*!< [4:2]  */
        uint8_t LVWIE : 1;             /*!< [5] Low-Voltage Warning Interrupt Enable */
        uint8_t LVWACK : 1;            /*!< [6] Low-Voltage Warning Acknowledge */
        uint8_t LVWF : 1;              /*!< [7] Low-Voltage Warning Flag */
    } B;
} hw_pmc_lvdsc2_t;

/*!
 * @name Constants and macros for entire PMC_LVDSC2 register
 */
/*@{*/
#define HW_PMC_LVDSC2_ADDR(x)    ((x) + 0x1U)

#define HW_PMC_LVDSC2(x)         (*(__IO hw_pmc_lvdsc2_t *) HW_PMC_LVDSC2_ADDR(x))
#define HW_PMC_LVDSC2_RD(x)      (HW_PMC_LVDSC2(x).U)
#define HW_PMC_LVDSC2_WR(x, v)   (HW_PMC_LVDSC2(x).U = (v))
#define HW_PMC_LVDSC2_SET(x, v)  (HW_PMC_LVDSC2_WR(x, HW_PMC_LVDSC2_RD(x) |  (v)))
#define HW_PMC_LVDSC2_CLR(x, v)  (HW_PMC_LVDSC2_WR(x, HW_PMC_LVDSC2_RD(x) & ~(v)))
#define HW_PMC_LVDSC2_TOG(x, v)  (HW_PMC_LVDSC2_WR(x, HW_PMC_LVDSC2_RD(x) ^  (v)))
/*@}*/

/*
 * Constants & macros for individual PMC_LVDSC2 bitfields
 */

/*!
 * @name Register PMC_LVDSC2, field LVWV[1:0] (RW)
 *
 * Selects the LVW trip point voltage (VLVW). The actual voltage for the warning
 * depends on LVDSC1[LVDV].
 *
 * Values:
 * - 00 - Low trip point selected (VLVW = VLVW1)
 * - 01 - Mid 1 trip point selected (VLVW = VLVW2)
 * - 10 - Mid 2 trip point selected (VLVW = VLVW3)
 * - 11 - High trip point selected (VLVW = VLVW4)
 */
/*@{*/
#define BP_PMC_LVDSC2_LVWV   (0U)          /*!< Bit position for PMC_LVDSC2_LVWV. */
#define BM_PMC_LVDSC2_LVWV   (0x03U)       /*!< Bit mask for PMC_LVDSC2_LVWV. */
#define BS_PMC_LVDSC2_LVWV   (2U)          /*!< Bit field size in bits for PMC_LVDSC2_LVWV. */

/*! @brief Read current value of the PMC_LVDSC2_LVWV field. */
#define BR_PMC_LVDSC2_LVWV(x) (HW_PMC_LVDSC2(x).B.LVWV)

/*! @brief Format value for bitfield PMC_LVDSC2_LVWV. */
#define BF_PMC_LVDSC2_LVWV(v) ((uint8_t)((uint8_t)(v) << BP_PMC_LVDSC2_LVWV) & BM_PMC_LVDSC2_LVWV)

/*! @brief Set the LVWV field to a new value. */
#define BW_PMC_LVDSC2_LVWV(x, v) (HW_PMC_LVDSC2_WR(x, (HW_PMC_LVDSC2_RD(x) & ~BM_PMC_LVDSC2_LVWV) | BF_PMC_LVDSC2_LVWV(v)))
/*@}*/

/*!
 * @name Register PMC_LVDSC2, field LVWIE[5] (RW)
 *
 * Enables hardware interrupt requests for LVWF.
 *
 * Values:
 * - 0 - Hardware interrupt disabled (use polling)
 * - 1 - Request a hardware interrupt when LVWF = 1
 */
/*@{*/
#define BP_PMC_LVDSC2_LVWIE  (5U)          /*!< Bit position for PMC_LVDSC2_LVWIE. */
#define BM_PMC_LVDSC2_LVWIE  (0x20U)       /*!< Bit mask for PMC_LVDSC2_LVWIE. */
#define BS_PMC_LVDSC2_LVWIE  (1U)          /*!< Bit field size in bits for PMC_LVDSC2_LVWIE. */

/*! @brief Read current value of the PMC_LVDSC2_LVWIE field. */
#define BR_PMC_LVDSC2_LVWIE(x) (BITBAND_ACCESS8(HW_PMC_LVDSC2_ADDR(x), BP_PMC_LVDSC2_LVWIE))

/*! @brief Format value for bitfield PMC_LVDSC2_LVWIE. */
#define BF_PMC_LVDSC2_LVWIE(v) ((uint8_t)((uint8_t)(v) << BP_PMC_LVDSC2_LVWIE) & BM_PMC_LVDSC2_LVWIE)

/*! @brief Set the LVWIE field to a new value. */
#define BW_PMC_LVDSC2_LVWIE(x, v) (BITBAND_ACCESS8(HW_PMC_LVDSC2_ADDR(x), BP_PMC_LVDSC2_LVWIE) = (v))
/*@}*/

/*!
 * @name Register PMC_LVDSC2, field LVWACK[6] (WORZ)
 *
 * This write-only field is used to acknowledge low voltage warning errors.
 * Write 1 to clear LVWF. Reads always return 0.
 */
/*@{*/
#define BP_PMC_LVDSC2_LVWACK (6U)          /*!< Bit position for PMC_LVDSC2_LVWACK. */
#define BM_PMC_LVDSC2_LVWACK (0x40U)       /*!< Bit mask for PMC_LVDSC2_LVWACK. */
#define BS_PMC_LVDSC2_LVWACK (1U)          /*!< Bit field size in bits for PMC_LVDSC2_LVWACK. */

/*! @brief Format value for bitfield PMC_LVDSC2_LVWACK. */
#define BF_PMC_LVDSC2_LVWACK(v) ((uint8_t)((uint8_t)(v) << BP_PMC_LVDSC2_LVWACK) & BM_PMC_LVDSC2_LVWACK)

/*! @brief Set the LVWACK field to a new value. */
#define BW_PMC_LVDSC2_LVWACK(x, v) (BITBAND_ACCESS8(HW_PMC_LVDSC2_ADDR(x), BP_PMC_LVDSC2_LVWACK) = (v))
/*@}*/

/*!
 * @name Register PMC_LVDSC2, field LVWF[7] (RO)
 *
 * This read-only status field indicates a low-voltage warning event. LVWF is
 * set when VSupply transitions below the trip point, or after reset and VSupply is
 * already below VLVW. LVWF may be 1 after power-on reset, therefore, to use LVW
 * interrupt function, before enabling LVWIE, LVWF must be cleared by writing
 * LVWACK first.
 *
 * Values:
 * - 0 - Low-voltage warning event not detected
 * - 1 - Low-voltage warning event detected
 */
/*@{*/
#define BP_PMC_LVDSC2_LVWF   (7U)          /*!< Bit position for PMC_LVDSC2_LVWF. */
#define BM_PMC_LVDSC2_LVWF   (0x80U)       /*!< Bit mask for PMC_LVDSC2_LVWF. */
#define BS_PMC_LVDSC2_LVWF   (1U)          /*!< Bit field size in bits for PMC_LVDSC2_LVWF. */

/*! @brief Read current value of the PMC_LVDSC2_LVWF field. */
#define BR_PMC_LVDSC2_LVWF(x) (BITBAND_ACCESS8(HW_PMC_LVDSC2_ADDR(x), BP_PMC_LVDSC2_LVWF))
/*@}*/

/*******************************************************************************
 * HW_PMC_REGSC - Regulator Status And Control register
 ******************************************************************************/

/*!
 * @brief HW_PMC_REGSC - Regulator Status And Control register (RW)
 *
 * Reset value: 0x04U
 *
 * The PMC contains an internal voltage regulator. The voltage regulator design
 * uses a bandgap reference that is also available through a buffer as input to
 * certain internal peripherals, such as the CMP and ADC. The internal regulator
 * provides a status bit (REGONS) indicating the regulator is in run regulation.
 * This register is reset on Chip Reset Not VLLS and by reset types that trigger
 * Chip Reset not VLLS. See the Reset section details for more information.
 */
typedef union _hw_pmc_regsc
{
    uint8_t U;
    struct _hw_pmc_regsc_bitfields
    {
        uint8_t BGBE : 1;              /*!< [0] Bandgap Buffer Enable */
        uint8_t RESERVED0 : 1;         /*!< [1]  */
        uint8_t REGONS : 1;            /*!< [2] Regulator In Run Regulation Status */
        uint8_t ACKISO : 1;            /*!< [3] Acknowledge Isolation */
        uint8_t BGEN : 1;              /*!< [4] Bandgap Enable In VLPx Operation */
        uint8_t RESERVED1 : 3;         /*!< [7:5]  */
    } B;
} hw_pmc_regsc_t;

/*!
 * @name Constants and macros for entire PMC_REGSC register
 */
/*@{*/
#define HW_PMC_REGSC_ADDR(x)     ((x) + 0x2U)

#define HW_PMC_REGSC(x)          (*(__IO hw_pmc_regsc_t *) HW_PMC_REGSC_ADDR(x))
#define HW_PMC_REGSC_RD(x)       (HW_PMC_REGSC(x).U)
#define HW_PMC_REGSC_WR(x, v)    (HW_PMC_REGSC(x).U = (v))
#define HW_PMC_REGSC_SET(x, v)   (HW_PMC_REGSC_WR(x, HW_PMC_REGSC_RD(x) |  (v)))
#define HW_PMC_REGSC_CLR(x, v)   (HW_PMC_REGSC_WR(x, HW_PMC_REGSC_RD(x) & ~(v)))
#define HW_PMC_REGSC_TOG(x, v)   (HW_PMC_REGSC_WR(x, HW_PMC_REGSC_RD(x) ^  (v)))
/*@}*/

/*
 * Constants & macros for individual PMC_REGSC bitfields
 */

/*!
 * @name Register PMC_REGSC, field BGBE[0] (RW)
 *
 * Enables the bandgap buffer.
 *
 * Values:
 * - 0 - Bandgap buffer not enabled
 * - 1 - Bandgap buffer enabled
 */
/*@{*/
#define BP_PMC_REGSC_BGBE    (0U)          /*!< Bit position for PMC_REGSC_BGBE. */
#define BM_PMC_REGSC_BGBE    (0x01U)       /*!< Bit mask for PMC_REGSC_BGBE. */
#define BS_PMC_REGSC_BGBE    (1U)          /*!< Bit field size in bits for PMC_REGSC_BGBE. */

/*! @brief Read current value of the PMC_REGSC_BGBE field. */
#define BR_PMC_REGSC_BGBE(x) (BITBAND_ACCESS8(HW_PMC_REGSC_ADDR(x), BP_PMC_REGSC_BGBE))

/*! @brief Format value for bitfield PMC_REGSC_BGBE. */
#define BF_PMC_REGSC_BGBE(v) ((uint8_t)((uint8_t)(v) << BP_PMC_REGSC_BGBE) & BM_PMC_REGSC_BGBE)

/*! @brief Set the BGBE field to a new value. */
#define BW_PMC_REGSC_BGBE(x, v) (BITBAND_ACCESS8(HW_PMC_REGSC_ADDR(x), BP_PMC_REGSC_BGBE) = (v))
/*@}*/

/*!
 * @name Register PMC_REGSC, field REGONS[2] (RO)
 *
 * This read-only field provides the current status of the internal voltage
 * regulator.
 *
 * Values:
 * - 0 - Regulator is in stop regulation or in transition to/from it
 * - 1 - Regulator is in run regulation
 */
/*@{*/
#define BP_PMC_REGSC_REGONS  (2U)          /*!< Bit position for PMC_REGSC_REGONS. */
#define BM_PMC_REGSC_REGONS  (0x04U)       /*!< Bit mask for PMC_REGSC_REGONS. */
#define BS_PMC_REGSC_REGONS  (1U)          /*!< Bit field size in bits for PMC_REGSC_REGONS. */

/*! @brief Read current value of the PMC_REGSC_REGONS field. */
#define BR_PMC_REGSC_REGONS(x) (BITBAND_ACCESS8(HW_PMC_REGSC_ADDR(x), BP_PMC_REGSC_REGONS))
/*@}*/

/*!
 * @name Register PMC_REGSC, field ACKISO[3] (W1C)
 *
 * Reading this field indicates whether certain peripherals and the I/O pads are
 * in a latched state as a result of having been in a VLLS mode. Writing 1 to
 * this field when it is set releases the I/O pads and certain peripherals to their
 * normal run mode state. After recovering from a VLLS mode, user should restore
 * chip configuration before clearing ACKISO. In particular, pin configuration
 * for enabled LLWU wakeup pins should be restored to avoid any LLWU flag from
 * being falsely set when ACKISO is cleared.
 *
 * Values:
 * - 0 - Peripherals and I/O pads are in normal run state.
 * - 1 - Certain peripherals and I/O pads are in an isolated and latched state.
 */
/*@{*/
#define BP_PMC_REGSC_ACKISO  (3U)          /*!< Bit position for PMC_REGSC_ACKISO. */
#define BM_PMC_REGSC_ACKISO  (0x08U)       /*!< Bit mask for PMC_REGSC_ACKISO. */
#define BS_PMC_REGSC_ACKISO  (1U)          /*!< Bit field size in bits for PMC_REGSC_ACKISO. */

/*! @brief Read current value of the PMC_REGSC_ACKISO field. */
#define BR_PMC_REGSC_ACKISO(x) (BITBAND_ACCESS8(HW_PMC_REGSC_ADDR(x), BP_PMC_REGSC_ACKISO))

/*! @brief Format value for bitfield PMC_REGSC_ACKISO. */
#define BF_PMC_REGSC_ACKISO(v) ((uint8_t)((uint8_t)(v) << BP_PMC_REGSC_ACKISO) & BM_PMC_REGSC_ACKISO)

/*! @brief Set the ACKISO field to a new value. */
#define BW_PMC_REGSC_ACKISO(x, v) (BITBAND_ACCESS8(HW_PMC_REGSC_ADDR(x), BP_PMC_REGSC_ACKISO) = (v))
/*@}*/

/*!
 * @name Register PMC_REGSC, field BGEN[4] (RW)
 *
 * BGEN controls whether the bandgap is enabled in lower power modes of
 * operation (VLPx, LLS, and VLLSx). When on-chip peripherals require the bandgap voltage
 * reference in low power modes of operation, set BGEN to continue to enable the
 * bandgap operation. When the bandgap voltage reference is not needed in low
 * power modes, clear BGEN to avoid excess power consumption.
 *
 * Values:
 * - 0 - Bandgap voltage reference is disabled in VLPx , LLS , and VLLSx modes.
 * - 1 - Bandgap voltage reference is enabled in VLPx , LLS , and VLLSx modes.
 */
/*@{*/
#define BP_PMC_REGSC_BGEN    (4U)          /*!< Bit position for PMC_REGSC_BGEN. */
#define BM_PMC_REGSC_BGEN    (0x10U)       /*!< Bit mask for PMC_REGSC_BGEN. */
#define BS_PMC_REGSC_BGEN    (1U)          /*!< Bit field size in bits for PMC_REGSC_BGEN. */

/*! @brief Read current value of the PMC_REGSC_BGEN field. */
#define BR_PMC_REGSC_BGEN(x) (BITBAND_ACCESS8(HW_PMC_REGSC_ADDR(x), BP_PMC_REGSC_BGEN))

/*! @brief Format value for bitfield PMC_REGSC_BGEN. */
#define BF_PMC_REGSC_BGEN(v) ((uint8_t)((uint8_t)(v) << BP_PMC_REGSC_BGEN) & BM_PMC_REGSC_BGEN)

/*! @brief Set the BGEN field to a new value. */
#define BW_PMC_REGSC_BGEN(x, v) (BITBAND_ACCESS8(HW_PMC_REGSC_ADDR(x), BP_PMC_REGSC_BGEN) = (v))
/*@}*/

/*******************************************************************************
 * hw_pmc_t - module struct
 ******************************************************************************/
/*!
 * @brief All PMC module registers.
 */
#pragma pack(1)
typedef struct _hw_pmc
{
    __IO hw_pmc_lvdsc1_t LVDSC1;           /*!< [0x0] Low Voltage Detect Status And Control 1 register */
    __IO hw_pmc_lvdsc2_t LVDSC2;           /*!< [0x1] Low Voltage Detect Status And Control 2 register */
    __IO hw_pmc_regsc_t REGSC;             /*!< [0x2] Regulator Status And Control register */
} hw_pmc_t;
#pragma pack()

/*! @brief Macro to access all PMC registers. */
/*! @param x PMC module instance base address. */
/*! @return Reference (not a pointer) to the registers struct. To get a pointer to the struct,
 *     use the '&' operator, like <code>&HW_PMC(PMC_BASE)</code>. */
#define HW_PMC(x)      (*(hw_pmc_t *)(x))

#endif /* __HW_PMC_REGISTERS_H__ */
/* v33/140401/2.1.0 */
/* EOF */


text:
Like-Water
==========

Magic 8-Ball / Oblique Strategies app for creative writing, written in Kivy / Python. Target platforms: Mac OS X, Android, ios.