text:
package ech042.mods.containersandrails;

import ech042.mods.containersandrails.init.CRBlocks;
import ech042.mods.containersandrails.init.CRItems;
import ech042.mods.containersandrails.utility.LogHelper;
import net.minecraftforge.fml.common.Mod;
import net.minecraftforge.fml.common.Mod.Instance;
import net.minecraftforge.fml.common.Mod.EventHandler;
import net.minecraftforge.fml.common.SidedProxy;
import net.minecraftforge.fml.common.event.FMLInitializationEvent;
import net.minecraftforge.fml.common.event.FMLPostInitializationEvent;
import net.minecraftforge.fml.common.event.FMLPreInitializationEvent;

@Mod(modid = ContainersAndRails.MODID, version = ContainersAndRails.VERSIONFINAL)
public class ContainersAndRails
{
   // Static variables relating for the mod
   public static final String MODID = "containersandrails";
   public static final String MODNAME = "Containers and Rails";
   public static final String VERSIONMAJOR = "0";
   public static final String VERSIONMINOR = "1";
   public static final String VERSIONBUILD = "a";
   public static final String VERSIONFINAL = VERSIONMAJOR + "." + VERSIONMINOR + VERSIONBUILD;

   public static final String COMMON_PROXY = "ech042.mods.containersandrails.CommonProxy";
   public static final String CLIENT_PROXY = "ech042.mods.containersandrails.client.ClientProxy";

   @SidedProxy(clientSide = ContainersAndRails.CLIENT_PROXY, serverSide = ContainersAndRails.COMMON_PROXY)
   public static CommonProxy proxy;

   @Instance(ContainersAndRails.MODID)
   public static ContainersAndRails instance;

   public ContainersAndRailsTab creativeTab;

   @EventHandler
   public void preInit(FMLPreInitializationEvent event)
   {
      LogHelper.info("PreInitialization...");

      this.creativeTab = new ContainersAndRailsTab();

      // Initialise and register items
      CRItems.init();
      CRItems.register();
      CRItems.registerRecipes();

      // Initialise and register blocks
      CRBlocks.init();
      CRBlocks.register();
      CRBlocks.registerRecipes();
   }

   @EventHandler
   public void init(FMLInitializationEvent event)
   {
      // some example code
      LogHelper.info("Initialization...");
      proxy.registerRenderInformation();
   }

   @EventHandler
   public void postInit(FMLPostInitializationEvent event)
   {
      System.out.println("Post-initialisation");
   }
}


text:
clear;
close all;
clc;

% Specify the folder where the files live. Right now they are all on my
% Samsung External SSD.
myFolder = '/Volumes/SAMSUNG_SSD_256GB/ADV_CV/2-25_VIDAUD/EXPORTS';
[video_file_names, audio_file_names] = retrieveFileNames(myFolder);

video_file_names

%Read video file
vidObj = VideoReader(char(video_file_names(7)));
video_fps = vidObj.FrameRate;

% Count the number of frames in the video file (must manually count,
% since the MATLAB video object is not 100% accurate)
num_vid_frames = 0;
while hasFrame(vidObj)
      readFrame(vidObj);
      num_vid_frames = num_vid_frames + 1;
end
num_vid_frames
numFrames = ceil(vidObj.FrameRate*vidObj.Duration)

redpajama_set_name: RedPajamaGithub


text:
<!--remove-start-->
# LED - RGB (PCA9685)

Run with:
```bash
node eg/led-rgb-PCA9685.js
```
<!--remove-end-->

```javascript
var five = require("johnny-five");

five.Board().on("ready", function() {

  // Initialize the RGB LED
  var led = new five.Led.RGB({
    pins: {
      red: 0,
      green: 1,
      blue: 2
    },
    controller: "PCA9685"
  });

  // RGB LED alternate constructor
  // This will normalize an array of pins in [r, g, b]
  // order to an object (like above) that's shaped like:
  // {
  //   red: r,
  //   green: g,
  //   blue: b
  // }
  // var led = new five.Led.RGB({
  //   pins: [0, 1, 2],
  //   controller: "PCA9685"
  // });

  // Add led to REPL (optional)
  this.repl.inject({
    led: led
  });

});

```

## Breadboard/Illustration

![docs/breadboard/led-rgb-PCA9685.png](breadboard/led-rgb-PCA9685.png)
[docs/breadboard/led-rgb-PCA9685.fzz](breadboard/led-rgb-PCA9685.fzz)

<!--remove-start-->
## License
Copyright (c) 2012, 2013, 2014 Rick Waldron <waldron.rick@gmail.com>
Licensed under the MIT license.
Copyright (c) 2014, 2015 The Johnny-Five Contributors
Licensed under the MIT license.
<!--remove-end-->


text:
package org.jboss.migration.wfly10.config.task.update;

import org.jboss.migration.core.jboss.ContentHashToPathMapper;
import org.jboss.migration.core.jboss.JBossServerConfiguration;
import org.jboss.migration.core.task.ServerMigrationTaskResult;
import org.jboss.migration.core.task.TaskContext;
import org.jboss.migration.core.task.component.TaskRunnable;

import java.nio.file.Path;

/**
 * @author emmartins
 */
public class MigrateContent implements TaskRunnable {

    private final byte[] contentHash;
    private final JBossServerConfiguration sourceConfiguration;
    private final JBossServerConfiguration targetConfiguration;

    public MigrateContent(byte[] contentHash, JBossServerConfiguration sourceConfiguration, JBossServerConfiguration targetConfiguration) {
        this.contentHash = contentHash;
        this.sourceConfiguration = sourceConfiguration;
        this.targetConfiguration = targetConfiguration;
    }

    @Override
    public ServerMigrationTaskResult run(TaskContext context) {
        final Path contentPath = new ContentHashToPathMapper().apply(contentHash);
        final Path contentSource = sourceConfiguration.getContentDir().resolve(contentPath);
        context.getLogger().infof("Source content's path: %s", contentSource);
        final Path contentTarget = targetConfiguration.getContentDir().resolve(contentPath);
        context.getLogger().infof("Target content's path: %s", contentTarget);
        if (!contentSource.equals(contentTarget)) {
            context.getMigrationFiles().copy(contentSource, contentTarget);
            context.getLogger().infof("Source's content %s migrated to %s.", contentSource, contentTarget);
            return ServerMigrationTaskResult.SUCCESS;
        } else {
            context.getLogger().infof("Source equals target content path, skipping content migration");
            return  ServerMigrationTaskResult.SKIPPED;
        }
    }
}


text:
package com.smartdevicelink.proxy.rpc;

import android.support.annotation.NonNull;

import com.smartdevicelink.protocol.enums.FunctionID;
import com.smartdevicelink.proxy.RPCResponse;
import com.smartdevicelink.proxy.rpc.enums.Result;

import java.util.Hashtable;

/**
 * Add SubMenu Response is sent, when AddSubMenu has been called
 * @since SmartDeviceLink 1.0
 */
public class AddSubMenuResponse extends RPCResponse {
	/**
	 * Constructs a new AddSubMenuResponse object
	 */

    public AddSubMenuResponse() {
        super(FunctionID.ADD_SUB_MENU.toString());
    }
    public AddSubMenuResponse(Hashtable<String, Object> hash) {
        super(hash);
    }
    /**
     * Constructs a new AddSubMenuResponse object
     * @param success whether the request is successfully processed
     * @param resultCode whether the request is successfully processed
     */
    public AddSubMenuResponse(@NonNull Boolean success, @NonNull Result resultCode) {
        this();
        setSuccess(success);
        setResultCode(resultCode);
    }
}


text:
<?php

namespace yii\bootstrap\bootswatch;

use yii\web\AssetBundle;

class YetiAsset extends AssetBundle
{

    public $sourcePath = '@bower/bootswatch/yeti';

    public $depends = ['yii\bootstrap\BootstrapAsset'];

    public $css = ['bootstrap.min.css'];
}


text:
package org.apache.hadoop.hive.ql.udf.generic;

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

import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.apache.hadoop.hive.ql.exec.Description;
import org.apache.hadoop.hive.ql.exec.UDFArgumentTypeException;
import org.apache.hadoop.hive.ql.exec.vector.VectorizedUDAFs;
import org.apache.hadoop.hive.ql.exec.vector.expressions.aggregates.gen.*;
import org.apache.hadoop.hive.ql.metadata.HiveException;
import org.apache.hadoop.hive.ql.parse.SemanticException;
import org.apache.hadoop.hive.ql.udf.generic.GenericUDAFStd.GenericUDAFStdEvaluator;
import org.apache.hadoop.hive.ql.udf.generic.GenericUDAFStdSample.GenericUDAFStdSampleEvaluator;
import org.apache.hadoop.hive.ql.udf.generic.GenericUDAFVarianceSample.GenericUDAFVarianceSampleEvaluator;
import org.apache.hadoop.hive.ql.util.JavaDataModel;
import org.apache.hadoop.hive.serde2.io.DoubleWritable;
import org.apache.hadoop.hive.serde2.objectinspector.ObjectInspector;
import org.apache.hadoop.hive.serde2.objectinspector.ObjectInspectorFactory;
import org.apache.hadoop.hive.serde2.objectinspector.PrimitiveObjectInspector;
import org.apache.hadoop.hive.serde2.objectinspector.StructField;
import org.apache.hadoop.hive.serde2.objectinspector.StructObjectInspector;
import org.apache.hadoop.hive.serde2.objectinspector.primitive.DoubleObjectInspector;
import org.apache.hadoop.hive.serde2.objectinspector.primitive.LongObjectInspector;
import org.apache.hadoop.hive.serde2.objectinspector.primitive.PrimitiveObjectInspectorFactory;
import org.apache.hadoop.hive.serde2.objectinspector.primitive.PrimitiveObjectInspectorUtils;
import org.apache.hadoop.hive.serde2.typeinfo.PrimitiveTypeInfo;
import org.apache.hadoop.hive.serde2.typeinfo.TypeInfo;
import org.apache.hadoop.io.LongWritable;
import org.apache.hadoop.util.StringUtils;

/**
 * Compute the variance. This class is extended by: GenericUDAFVarianceSample
 * GenericUDAFStd GenericUDAFStdSample
 *
 */
@Description(name = "variance,var_pop",
    value = "_FUNC_(x) - Returns the variance of a set of numbers")
public class GenericUDAFVariance extends AbstractGenericUDAFResolver {

  static final Logger LOG = LoggerFactory.getLogger(GenericUDAFVariance.class.getName());

  public static enum VarianceKind {
    NONE,
    VARIANCE,
    VARIANCE_SAMPLE,
    STANDARD_DEVIATION,
    STANDARD_DEVIATION_SAMPLE;

    public static final Map<String,VarianceKind> nameMap = new HashMap<String,VarianceKind>();
    static
    {
      nameMap.put("variance", VARIANCE);
      nameMap.put("var_pop", VARIANCE);

      nameMap.put("var_samp", VARIANCE_SAMPLE);

      nameMap.put("std", STANDARD_DEVIATION);
      nameMap.put("stddev", STANDARD_DEVIATION);
      nameMap.put("stddev_pop", STANDARD_DEVIATION);

      nameMap.put("stddev_samp", STANDARD_DEVIATION_SAMPLE);
    }
  };

  public static boolean isVarianceFamilyName(String name) {
    return (VarianceKind.nameMap.get(name) != null);
  }

  public static boolean isVarianceNull(long count, VarianceKind varianceKind) {
    switch (varianceKind) {
    case VARIANCE:
    case STANDARD_DEVIATION:
      return (count == 0);
    case VARIANCE_SAMPLE:
    case STANDARD_DEVIATION_SAMPLE:
      return (count <= 1);
    default:
      throw new RuntimeException("Unexpected variance kind " + varianceKind);
    }
  }

  /*
   * Use when calculating intermediate variance and count > 1.
   *
   * NOTE: count has been incremented; sum included value.
   */
  public static double calculateIntermediate(
      long count, double sum, double value, double variance) {
    double t = count * value - sum;
    variance += (t * t) / ((double) count * (count - 1));
    return variance;
  }

  /*
   * Use when merging variance and partialCount > 0 and mergeCount > 0.
   *
   * NOTE: mergeCount and mergeSum do not include partialCount and partialSum yet.
   */
  public static double calculateMerge(
      long partialCount, long mergeCount, double partialSum, double mergeSum,
      double partialVariance, double mergeVariance) {

    final double doublePartialCount = (double) partialCount;
    final double doubleMergeCount = (double) mergeCount;

    double t = (doublePartialCount / doubleMergeCount) * mergeSum - partialSum;
    mergeVariance +=
        partialVariance + ((doubleMergeCount / doublePartialCount) /
            (doubleMergeCount + doublePartialCount)) * t * t;
    return mergeVariance;
  }

  /*
   * Calculate the variance family {VARIANCE, VARIANCE_SAMPLE, STANDARD_DEVIATION, or
   * STANDARD_DEVIATION_SAMPLE) result when count > 1.  Public so vectorization code can
   * use it, etc.
   */
  public static double calculateVarianceFamilyResult(double variance, long count,
      VarianceKind varianceKind) {
    final double result;
    switch (varianceKind) {
    case VARIANCE:
      result = GenericUDAFVarianceEvaluator.calculateVarianceResult(variance, count);
      break;
    case VARIANCE_SAMPLE:
      result = GenericUDAFVarianceSampleEvaluator.calculateVarianceSampleResult(variance, count);
      break;
    case STANDARD_DEVIATION:
      result = GenericUDAFStdEvaluator.calculateStdResult(variance, count);
      break;
    case STANDARD_DEVIATION_SAMPLE:
      result = GenericUDAFStdSampleEvaluator.calculateStdSampleResult(variance, count);
      break;
    default:
      throw new RuntimeException("Unexpected variance kind " + varianceKind);
    }
    return result;
  }

  @Override
  public GenericUDAFEvaluator getEvaluator(TypeInfo[] parameters) throws SemanticException {
    if (parameters.length != 1) {
      throw new UDFArgumentTypeException(parameters.length - 1,
          "Exactly one argument is expected.");
    }

    if (parameters[0].getCategory() != ObjectInspector.Category.PRIMITIVE) {
      throw new UDFArgumentTypeException(0,
          "Only primitive type arguments are accepted but "
          + parameters[0].getTypeName() + " is passed.");
    }
    switch (((PrimitiveTypeInfo) parameters[0]).getPrimitiveCategory()) {
    case BYTE:
    case SHORT:
    case INT:
    case LONG:
    case FLOAT:
    case DOUBLE:
    case STRING:
    case VARCHAR:
    case CHAR:
    case TIMESTAMP:
    case DECIMAL:
      return new GenericUDAFVarianceEvaluator();
    case BOOLEAN:
    case DATE:
    default:
      throw new UDFArgumentTypeException(0,
          "Only numeric or string type arguments are accepted but "
          + parameters[0].getTypeName() + " is passed.");
    }
  }

  /**
   * Evaluate the variance using the algorithm described by Chan, Golub, and LeVeque in
   * "Algorithms for computing the sample variance: analysis and recommendations"
   * The American Statistician, 37 (1983) pp. 242--247.
   *
   * variance = variance1 + variance2 + n/(m*(m+n)) * pow(((m/n)*t1 - t2),2)
   *
   * where: - variance is sum[x-avg^2] (this is actually n times the variance)
   * and is updated at every step. - n is the count of elements in chunk1 - m is
   * the count of elements in chunk2 - t1 = sum of elements in chunk1, t2 =
   * sum of elements in chunk2.
   *
   * This algorithm was proven to be numerically stable by J.L. Barlow in
   * "Error analysis of a pairwise summation algorithm to compute sample variance"
   * Numer. Math, 58 (1991) pp. 583--590
   *
   */
  @VectorizedUDAFs({
    VectorUDAFVarLong.class, VectorUDAFVarLongComplete.class,
    VectorUDAFVarDouble.class, VectorUDAFVarDoubleComplete.class,
    VectorUDAFVarDecimal.class, VectorUDAFVarDecimalComplete.class,
    VectorUDAFVarTimestamp.class, VectorUDAFVarTimestampComplete.class,
    VectorUDAFVarPartial2.class, VectorUDAFVarFinal.class})
  public static class GenericUDAFVarianceEvaluator extends GenericUDAFEvaluator {

    // For PARTIAL1 and COMPLETE
    private transient PrimitiveObjectInspector inputOI;

    // For PARTIAL2 and FINAL
    private transient StructObjectInspector soi;
    private transient StructField countField;
    private transient StructField sumField;
    private transient StructField varianceField;
    private LongObjectInspector countFieldOI;
    private DoubleObjectInspector sumFieldOI;

    // For PARTIAL1 and PARTIAL2
    private Object[] partialResult;

    // For FINAL and COMPLETE
    private DoubleWritable result;

    @Override
    public ObjectInspector init(Mode m, ObjectInspector[] parameters) throws HiveException {
      assert (parameters.length == 1);
      super.init(m, parameters);

      // init input
      if (mode == Mode.PARTIAL1 || mode == Mode.COMPLETE) {
        inputOI = (PrimitiveObjectInspector) parameters[0];
      } else {
        soi = (StructObjectInspector) parameters[0];

        countField = soi.getStructFieldRef("count");
        sumField = soi.getStructFieldRef("sum");
        varianceField = soi.getStructFieldRef("variance");

        countFieldOI = (LongObjectInspector) countField
            .getFieldObjectInspector();
        sumFieldOI = (DoubleObjectInspector) sumField.getFieldObjectInspector();
      }

      // init output
      if (mode == Mode.PARTIAL1 || mode == Mode.PARTIAL2) {
        // The output of a partial aggregation is a struct containing
        // a long count and doubles sum and variance.

        ArrayList<ObjectInspector> foi = new ArrayList<ObjectInspector>();

        foi.add(PrimitiveObjectInspectorFactory.writableLongObjectInspector);
        foi.add(PrimitiveObjectInspectorFactory.writableDoubleObjectInspector);
        foi.add(PrimitiveObjectInspectorFactory.writableDoubleObjectInspector);

        ArrayList<String> fname = new ArrayList<String>();
        fname.add("count");
        fname.add("sum");
        fname.add("variance");

        partialResult = new Object[3];
        partialResult[0] = new LongWritable(0);
        partialResult[1] = new DoubleWritable(0);
        partialResult[2] = new DoubleWritable(0);

        return ObjectInspectorFactory.getStandardStructObjectInspector(fname,
            foi);

      } else {
        setResult(new DoubleWritable(0));
        return PrimitiveObjectInspectorFactory.writableDoubleObjectInspector;
      }
    }

    @AggregationType(estimable = true)
    static class StdAgg extends AbstractAggregationBuffer {
      long count; // number of elements
      double sum; // sum of elements
      double variance; // sum[x-avg^2] (this is actually n times the variance)
      @Override
      public int estimate() { return JavaDataModel.PRIMITIVES2 * 3; }
    };

    @Override
    public AggregationBuffer getNewAggregationBuffer() throws HiveException {
      StdAgg result = new StdAgg();
      reset(result);
      return result;
    }

    @Override
    public void reset(AggregationBuffer agg) throws HiveException {
      StdAgg myagg = (StdAgg) agg;
      myagg.count = 0;
      myagg.sum = 0;
      myagg.variance = 0;
    }

    private boolean warned = false;

    @Override
    public void iterate(AggregationBuffer agg, Object[] parameters)
        throws HiveException {
      assert (parameters.length == 1);
      Object p = parameters[0];
      if (p != null) {
        StdAgg myagg = (StdAgg) agg;
        try {
          double v = PrimitiveObjectInspectorUtils.getDouble(p, inputOI);
          myagg.count++;
          myagg.sum += v;
          if(myagg.count > 1) {
            myagg.variance = calculateIntermediate(
                myagg.count, myagg.sum, v, myagg.variance);
          }
        } catch (NumberFormatException e) {
          if (!warned) {
            warned = true;
            LOG.warn(getClass().getSimpleName() + " "
                + StringUtils.stringifyException(e));
            LOG.warn(getClass().getSimpleName()
                + " ignoring similar exceptions.");
          }
        }
      }
    }

    @Override
    public Object terminatePartial(AggregationBuffer agg) throws HiveException {
      StdAgg myagg = (StdAgg) agg;
      ((LongWritable) partialResult[0]).set(myagg.count);
      ((DoubleWritable) partialResult[1]).set(myagg.sum);
      ((DoubleWritable) partialResult[2]).set(myagg.variance);
      return partialResult;
    }

    @Override
    public void merge(AggregationBuffer agg, Object partial) throws HiveException {
      if (partial != null) {
        StdAgg myagg = (StdAgg) agg;

        Object partialCount = soi.getStructFieldData(partial, countField);
        Object partialSum = soi.getStructFieldData(partial, sumField);
        Object partialVariance = soi.getStructFieldData(partial, varianceField);

        long n = myagg.count;
        long m = countFieldOI.get(partialCount);

        if (n == 0) {
          // Just copy the information since there is nothing so far
          myagg.variance = sumFieldOI.get(partialVariance);
          myagg.count = countFieldOI.get(partialCount);
          myagg.sum = sumFieldOI.get(partialSum);
          return;
        }

        if (m != 0 && n != 0) {
          // Merge the two partials

          double a = myagg.sum;
          double b = sumFieldOI.get(partialSum);

          myagg.variance =
              calculateMerge(
                  /* partialCount */ m, /* mergeCount */ n,
                  /* partialSum */ b, /* mergeSum */ a,
                  sumFieldOI.get(partialVariance), myagg.variance);

          myagg.count += m;
          myagg.sum += b;
        }
      }
    }

    /*
     * Calculate the variance result when count > 1.  Public so vectorization code can use it, etc.
     */
    public static double calculateVarianceResult(double variance, long count) {
      final double result = variance / count;
      return result;
    }

    @Override
    public Object terminate(AggregationBuffer agg) throws HiveException {
      StdAgg myagg = (StdAgg) agg;

      if (myagg.count == 0) { // SQL standard - return null for zero elements
        return null;
      } else {
        if (myagg.count > 1) {
          getResult().set(
              calculateVarianceResult(myagg.variance, myagg.count));
        } else { // for one element the variance is always 0
          getResult().set(0);
        }
        return getResult();
      }
    }

    public void setResult(DoubleWritable result) {
      this.result = result;
    }

    public DoubleWritable getResult() {
      return result;
    }
  }

}


text:
import json
import logging
import six

from blinkpy.common.host_mock import MockHost
from blinkpy.common.system.log_testing import LoggingTestCase
from blinkpy.web_tests.port.test import TestPort
from blinkpy.web_tests.servers.wptserve import WPTServe

class TestWPTServe(LoggingTestCase):
    def setUp(self):
        super(TestWPTServe, self).setUp()
        self.host = MockHost()
        self.port = TestPort(self.host)
        self.host.filesystem.write_text_file(
            '/mock-checkout/third_party/blink/web_tests/'
            'external/wpt/config.json', '{"ports": {}, "aliases": []}')
        # crbug.com/1308877: `web_test_runner.Worker.__del__` can log:
        #   worker/0 cleaning up
        #   worker/0 killing driver
        # to its module's logger when the worker is garbage collected. Since
        # this test case asserts the root logger outputs certain numbers of
        # lines, we temporarily prevent propagation so the expected output is
        # not polluted.
        logging.getLogger('blinkpy.web_tests.controllers.'
                          'web_test_runner').propagate = False

    def tearDown(self):
        logging.getLogger('blinkpy.web_tests.controllers.'
                          'web_test_runner').propagate = True

    # pylint: disable=protected-access

    def test_init_start_cmd_without_ws_handlers(self):
        server = WPTServe(self.port, '/foo')
        expected_start_cmd = [
            self.port.python3_command(),
            '-u',
            '/mock-checkout/third_party/wpt_tools/wpt/wpt',
            'serve',
            '--config',
            server._config_file,
            '--doc_root',
            '/mock-checkout/third_party/blink/web_tests/external/wpt',
        ]
        if six.PY3:
            expected_start_cmd.append('--webtransport-h3')

        self.assertEqual(server._start_cmd, expected_start_cmd)

    def test_init_start_cmd_with_ws_handlers(self):
        self.host.filesystem.maybe_make_directory(
            '/mock-checkout/third_party/blink/web_tests/external/wpt/websockets/handlers'
        )
        server = WPTServe(self.port, '/foo')
        expected_start_cmd = [
            self.port.python3_command(),
            '-u',
            '/mock-checkout/third_party/wpt_tools/wpt/wpt',
            'serve',
            '--config',
            server._config_file,
            '--doc_root',
            '/mock-checkout/third_party/blink/web_tests/external/wpt',
            '--ws_doc_root',
            '/mock-checkout/third_party/blink/web_tests/external/wpt/websockets/handlers',
        ]
        if six.PY3:
            expected_start_cmd.append('--webtransport-h3')

        self.assertEqual(server._start_cmd, expected_start_cmd)

    def test_init_env(self):
        server = WPTServe(self.port, '/foo')
        self.assertEqual(
            server._env, {
                'MOCK_ENVIRON_COPY': '1',
                'PATH': '/bin:/mock/bin',
                'PYTHONPATH': '/mock-checkout/third_party/pywebsocket3/src'
            })

    def test_prepare_config(self):
        server = WPTServe(self.port, '/foo')
        server._prepare_config()
        config = json.loads(
            self.port._filesystem.read_text_file(server._config_file))
        self.assertEqual(len(config['aliases']), 1)
        self.assertDictEqual(config['aliases'][0], {
            'url-path': '/gen/',
            'local-dir': '/mock-checkout/out/Release/gen'
        })

    def test_start_with_stale_pid(self):
        # Allow asserting about debug logs.
        self.set_logging_level(logging.DEBUG)

        self.host.filesystem.write_text_file('/log_file_dir/access_log', 'foo')
        self.host.filesystem.write_text_file('/log_file_dir/error_log', 'foo')
        self.host.filesystem.write_text_file('/tmp/pidfile', '7')

        server = WPTServe(self.port, '/log_file_dir')
        server._pid_file = '/tmp/pidfile'
        server._check_that_all_ports_are_available = lambda: True
        server._is_server_running_on_all_ports = lambda: True

        server.start()
        # PID file should be overwritten (MockProcess.pid == 42)
        self.assertEqual(server._pid, 42)
        self.assertEqual(self.host.filesystem.read_text_file(server._pid_file),
                         '42')
        # Config file should exist.
        json.loads(self.port._filesystem.read_text_file(server._config_file))

        logs = self.logMessages()
        self.assertEqual(len(logs), 4)
        self.assertEqual(logs[:2], [
            'DEBUG: stale wptserve pid file, pid 7\n',
            'DEBUG: pid 7 is not running\n',
        ])
        self.assertTrue(logs[-2].startswith('DEBUG: Starting wptserve server'))
        self.assertEqual(logs[-1],
                         'DEBUG: wptserve successfully started (pid = 42)\n')

    def test_start_with_unkillable_zombie_process(self):
        # Allow asserting about debug logs.
        self.set_logging_level(logging.DEBUG)

        self.host.filesystem.write_text_file('/log_file_dir/access_log', 'foo')
        self.host.filesystem.write_text_file('/log_file_dir/error_log', 'foo')
        self.host.filesystem.write_text_file('/tmp/pidfile', '7')

        server = WPTServe(self.port, '/log_file_dir')
        server._pid_file = '/tmp/pidfile'
        server._check_that_all_ports_are_available = lambda: True
        server._is_server_running_on_all_ports = lambda: True

        # Simulate a process that never gets killed.
        self.host.executive.check_running_pid = lambda _: True

        server.start()
        self.assertEqual(server._pid, 42)
        self.assertEqual(self.host.filesystem.read_text_file(server._pid_file),
                         '42')

        # In this case, we'll try to kill the process repeatedly,
        # then give up and just try to start a new process anyway.
        logs = self.logMessages()
        self.assertEqual(len(logs), 43)
        self.assertEqual(logs[:2], [
            'DEBUG: stale wptserve pid file, pid 7\n',
            'DEBUG: pid 7 is running, killing it\n'
        ])
        self.assertTrue(logs[-2].startswith('DEBUG: Starting wptserve server'))
        self.assertEqual(logs[-1],
                         'DEBUG: wptserve successfully started (pid = 42)\n')

    def test_stop_running_server_removes_temp_files(self):
        server = WPTServe(self.port, '/foo')
        server._stop_running_server()
        self.assertFalse(self.host.filesystem.exists(server._pid_file))
        self.assertFalse(self.host.filesystem.exists(server._config_file))


text:
namespace blink {

class MemoryRegion {
    USING_FAST_MALLOC(MemoryRegion);
public:
    MemoryRegion(Address base, size_t size)
        : m_base(base)
        , m_size(size)
    {
        ASSERT(size > 0);
    }

    bool contains(Address addr) const
    {
        return m_base <= addr && addr < (m_base + m_size);
    }

    bool contains(const MemoryRegion& other) const
    {
        return contains(other.m_base) && contains(other.m_base + other.m_size - 1);
    }

    void release();
    WARN_UNUSED_RETURN bool commit();
    void decommit();

    Address base() const { return m_base; }
    size_t size() const { return m_size; }

private:
    Address m_base;
    size_t m_size;
};

// A PageMemoryRegion represents a chunk of reserved virtual address
// space containing a number of blink heap pages. On Windows, reserved
// virtual address space can only be given back to the system as a
// whole. The PageMemoryRegion allows us to do that by keeping track
// of the number of pages using it in order to be able to release all
// of the virtual address space when there are no more pages using it.
class PageMemoryRegion : public MemoryRegion {
public:
    ~PageMemoryRegion();

    void pageDeleted(Address page)
    {
        markPageUnused(page);
        if (!--m_numPages)
            delete this;
    }

    void markPageUsed(Address page)
    {
        ASSERT(!m_inUse[index(page)]);
        m_inUse[index(page)] = true;
    }

    void markPageUnused(Address page)
    {
        m_inUse[index(page)] = false;
    }

    static PageMemoryRegion* allocateLargePage(size_t size)
    {
        return allocate(size, 1);
    }

    static PageMemoryRegion* allocateNormalPages()
    {
        return allocate(blinkPageSize * blinkPagesPerRegion, blinkPagesPerRegion);
    }

    BasePage* pageFromAddress(Address address)
    {
        ASSERT(contains(address));
        if (!m_inUse[index(address)])
            return nullptr;
        if (m_isLargePage)
            return pageFromObject(base());
        return pageFromObject(address);
    }

private:
    PageMemoryRegion(Address base, size_t, unsigned numPages);

    unsigned index(Address address)
    {
        ASSERT(contains(address));
        if (m_isLargePage)
            return 0;
        size_t offset = blinkPageAddress(address) - base();
        ASSERT(offset % blinkPageSize == 0);
        return offset / blinkPageSize;
    }

    static PageMemoryRegion* allocate(size_t, unsigned numPages);

    bool m_isLargePage;
    bool m_inUse[blinkPagesPerRegion];
    unsigned m_numPages;
};

// A RegionTree is a simple binary search tree of PageMemoryRegions sorted
// by base addresses.
class RegionTree {
    USING_FAST_MALLOC(RegionTree);
public:
    explicit RegionTree(PageMemoryRegion* region)
        : m_region(region)
        , m_left(nullptr)
        , m_right(nullptr)
    {
    }

    ~RegionTree()
    {
        delete m_left;
        delete m_right;
    }

    PageMemoryRegion* lookup(Address);
    static void add(RegionTree*, RegionTree**);
    static void remove(PageMemoryRegion*, RegionTree**);

private:
    PageMemoryRegion* m_region;
    RegionTree* m_left;
    RegionTree* m_right;

    static RegionTree* s_regionTree;
};

// Representation of the memory used for a Blink heap page.
//
// The representation keeps track of two memory regions:
//
// 1. The virtual memory reserved from the system in order to be able
//    to free all the virtual memory reserved.  Multiple PageMemory
//    instances can share the same reserved memory region and
//    therefore notify the reserved memory region on destruction so
//    that the system memory can be given back when all PageMemory
//    instances for that memory are gone.
//
// 2. The writable memory (a sub-region of the reserved virtual
//    memory region) that is used for the actual heap page payload.
//
// Guard pages are created before and after the writable memory.
class PageMemory {
    USING_FAST_MALLOC(PageMemory);
public:
    ~PageMemory()
    {
        __lsan_unregister_root_region(m_writable.base(), m_writable.size());
        m_reserved->pageDeleted(writableStart());
    }

    WARN_UNUSED_RETURN bool commit()
    {
        m_reserved->markPageUsed(writableStart());
        return m_writable.commit();
    }

    void decommit()
    {
        m_reserved->markPageUnused(writableStart());
        m_writable.decommit();
    }

    void markUnused() { m_reserved->markPageUnused(writableStart()); }

    PageMemoryRegion* region() { return m_reserved; }

    Address writableStart() { return m_writable.base(); }

    static PageMemory* setupPageMemoryInRegion(PageMemoryRegion*, size_t pageOffset, size_t payloadSize);

    // Allocate a virtual address space for one blink page with the
    // following layout:
    //
    //    [ guard os page | ... payload ... | guard os page ]
    //    ^---{ aligned to blink page size }
    //
    // The returned page memory region will be zeroed.
    //
    static PageMemory* allocate(size_t payloadSize);

private:
    PageMemory(PageMemoryRegion* reserved, const MemoryRegion& writable);

    PageMemoryRegion* m_reserved;
    MemoryRegion m_writable;
};

} // namespace blink

#endif


text:
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

<meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/>
<meta http-equiv="X-UA-Compatible" content="IE=9"/>
<meta name="generator" content="Doxygen 1.8.13"/>
<meta name="viewport" content="width=device-width, initial-scale=1"/>
<title>libguac: guacamole/socket-wsa.h File Reference</title>
<link href="tabs.css" rel="stylesheet" type="text/css"/>

<link href="search/search.css" rel="stylesheet" type="text/css"/>

<link href="doxygen.css" rel="stylesheet" type="text/css" />

libguac
    0.9.14

guacamole

Functions

socket-wsa.h File Reference

Provides an implementation of guac_socket specific to the Windows Socket API (aka WSA or "winsock").
More...

Go to the source code of this file.

Functions

guac_socket * 	guac_socket_open_wsa (SOCKET sock)

 	Creates a new guac_socket which will use the Windows Socket API (aka WSA or "winsock") for all communication.  More...

Detailed Description

Provides an implementation of guac_socket specific to the Windows Socket API (aka WSA or "winsock").

This header will only be available if libguac was built with WSA support.

Function Documentation

◆ guac_socket_open_wsa()

          guac_socket* guac_socket_open_wsa
          (
          SOCKET
          sock	)

Creates a new guac_socket which will use the Windows Socket API (aka WSA or "winsock") for all communication.

Freeing this guac_socket will automatically close the associated SOCKET handle.

Parameters

sock	The WSA SOCKET handle to use for the connection underlying the created guac_socket.

Returns

A newly-allocated guac_socket which will transparently use the Windows Socket API for all communication.

<address class="footer">
Generated by

 1.8.13
</address>


text:
FullScreenMario.FullScreenMario.settings.maps = {
    "mapDefault": "1-1",
    "locationDefault": "0",
    "groupTypes": ["Character", "Solid", "Scenery", "Text"],
    "requireEntrance": true,
    "screenAttributes": [
        "gravity",
        "setting",
        "time",
        "underwater",
        "floor",
        "jumpmod",
        "maxyvel",
        "maxyvelinv",
        "notime",
        "nokeys",
        "canscroll"
    ],
    "screenVariables": {
        "bottomDeathDifference": function (GameStarter) {
            return GameStarter.unitsize * 12;
        },
        "bottomPlatformMax": function (GameStarter) {
            var area = GameStarter.AreaSpawner.getArea(),
                diff = GameStarter.MapScreener.bottomDeathDifference;

            if (!area) {
                return -1;
            }

            return (area.floor + diff) * GameStarter.unitsize;
        },
        "gravity": function (GameStarter) {
            var area = GameStarter.AreaSpawner.getArea();

            if (area && area.underwater) {
                return GameStarter.gravity / 2.8;
            }

            return GameStarter.gravity;
        }
    },
    "onSpawn": FullScreenMario.FullScreenMario.prototype.addPreThing,
    "macros": {
        "Example": FullScreenMario.FullScreenMario.prototype.macroExample,
        "Fill": FullScreenMario.FullScreenMario.prototype.macroFillPreThings,
        "Pattern": FullScreenMario.FullScreenMario.prototype.macroFillPrePattern,
        "Floor": FullScreenMario.FullScreenMario.prototype.macroFloor,
        "Pipe": FullScreenMario.FullScreenMario.prototype.macroPipe,
        "PipeCorner": FullScreenMario.FullScreenMario.prototype.macroPipeCorner,
        "Tree": FullScreenMario.FullScreenMario.prototype.macroTree,
        "Shroom": FullScreenMario.FullScreenMario.prototype.macroShroom,
        "Water": FullScreenMario.FullScreenMario.prototype.macroWater,
        "CastleSmall": FullScreenMario.FullScreenMario.prototype.macroCastleSmall,
        "CastleLarge": FullScreenMario.FullScreenMario.prototype.macroCastleLarge,
        "Ceiling": FullScreenMario.FullScreenMario.prototype.macroCeiling,
        "Bridge": FullScreenMario.FullScreenMario.prototype.macroBridge,
        "Scale": FullScreenMario.FullScreenMario.prototype.macroScale,
        "PlatformGenerator": FullScreenMario.FullScreenMario.prototype.macroPlatformGenerator,
        "WarpWorld": FullScreenMario.FullScreenMario.prototype.macroWarpWorld,
        "CheepsStart": FullScreenMario.FullScreenMario.prototype.macroCheepsStart,
        "CheepsStop": FullScreenMario.FullScreenMario.prototype.macroCheepsStop,
        "BulletBillsStart": FullScreenMario.FullScreenMario.prototype.macroBulletBillsStart,
        "BulletBillsStop": FullScreenMario.FullScreenMario.prototype.macroBulletBillsStop,
        "LakituStop": FullScreenMario.FullScreenMario.prototype.macroLakituStop,
        "StartInsideCastle": FullScreenMario.FullScreenMario.prototype.macroStartInsideCastle,
        "EndOutsideCastle": FullScreenMario.FullScreenMario.prototype.macroEndOutsideCastle,
        "EndInsideCastle": FullScreenMario.FullScreenMario.prototype.macroEndInsideCastle,
        "Section": FullScreenMario.FullScreenMario.prototype.macroSection,
        "SectionPass": FullScreenMario.FullScreenMario.prototype.macroSectionPass,
        "SectionFail": FullScreenMario.FullScreenMario.prototype.macroSectionFail,
        "SectionDecider": FullScreenMario.FullScreenMario.prototype.macroSectionDecider
    },
    "entrances": {
        "Normal": FullScreenMario.FullScreenMario.prototype.mapEntranceNormal,
        "Plain": FullScreenMario.FullScreenMario.prototype.mapEntrancePlain,
        "Castle": FullScreenMario.FullScreenMario.prototype.mapEntranceCastle,
        "Walking": FullScreenMario.FullScreenMario.prototype.mapEntranceWalking,
        "Vine": FullScreenMario.FullScreenMario.prototype.mapEntranceVine,
        "PipeVertical": FullScreenMario.FullScreenMario.prototype.mapEntrancePipeVertical,
        "PipeHorizontal": FullScreenMario.FullScreenMario.prototype.mapEntrancePipeHorizontal,
    },
    "patterns": (function (patterns) {
        var pattern,
            i;
        for (i in patterns) {
            if (patterns.hasOwnProperty(i)) {
                pattern = patterns[i];
                if (!pattern.length) {
                    continue;
                }

                // Pattern's last array should previously be ["blank", width]
                pattern.width = pattern[pattern.length - 1][1];
                pattern.pop();
            }
        }
        return patterns;
    })({
        "BackRegular": [
            ["HillLarge", 0, 0],
            ["Cloud1", 68, 68],
            ["Bush3", 92, 0],
            ["HillSmall", 128, 0],
            ["Cloud1", 156, 76],
            ["Bush1", 188, 0],
            ["Cloud3", 220, 68],
            ["Cloud2", 292, 76],
            ["Bush2", 332, 0],
            ["Blank", 384]
        ],
        "BackCloud": [
            ["Cloud2", 28, 64],
            ["Cloud1", 76, 32],
            ["Cloud2", 148, 72],
            ["Cloud1", 228, 0],
            ["Cloud1", 284, 32],
            ["Cloud1", 308, 40],
            ["Cloud1", 372, 0],
            ["Blank", 384]
        ],
        "BackFence": [
            ["PlantSmall", 88, 0],
            ["PlantLarge", 104, 0],
            ["Fence", 112, 0, 32],
            ["Cloud1", 148, 68],
            ["PlantLarge", 168, 0],
            ["PlantSmall", 184, 0],
            ["PlantSmall", 192, 0],
            ["Cloud1", 220, 76],
            ["Cloud2", 244, 68],
            ["Fence", 304, 0, 16],
            ["PlantSmall", 320, 0],
            ["Fence", 328, 0],
            ["PlantLarge", 344, 0],
            ["Cloud1", 364, 76],
            ["Cloud2", 388, 68],
            ["Blank", 384]
        ],
        "BackFenceMin": [
            ["PlantLarge", 104, 0],
            ["Fence", 112, 0, 32],
            ["Cloud1", 148, 68],
            ["PlantLarge", 168, 0],
            ["PlantSmall", 184, 0],
            ["PlantSmall", 192, 0],
            ["Cloud1", 220, 76],
            ["Cloud2", 244, 68],
            ["Fence", 304, 0, 16],
            ["PlantSmall", 320, 0],
            ["Fence", 328, 0],
            ["Cloud1", 364, 76],
            ["Cloud2", 388, 68],
            ["Blank", 384]
        ],
        "BackFenceMin2": [
            ["Cloud2", 4, 68],
            ["PlantSmall", 88, 0],
            ["PlantLarge", 104, 0],
            ["Fence", 112, 0],
            ["Fence", 128, 0, 16],
            ["Cloud1", 148, 68],
            // ["PlantLarge", 168, 0],
            ["PlantSmall", 184, 0],
            ["PlantSmall", 192, 0],
            ["Cloud1", 220, 76],
            ["Cloud2", 244, 68],
            ["Fence", 304, 0, 16],
            ["PlantSmall", 320, 0],
            ["Fence", 328, 0],
            ["PlantLarge", 344, 0],
            ["Cloud1", 364, 76],
            ["Cloud2", 388, 68],
            ["Blank", 384]
        ],
        "BackFenceMin3": [
            ["Cloud2", 4, 68],
            ["PlantSmall", 88, 0],
            ["PlantLarge", 104, 0],
            ["Fence", 112, 0, 4],
            ["Cloud1", 148, 68],
            ["PlantSmall", 184, 0],
            ["PlantSmall", 192, 0],
            ["Cloud1", 220, 76],
            ["Cloud2", 244, 68],
            ["Cloud1", 364, 76],
            ["Cloud2", 388, 68],
            ["Blank", 384]
        ]
    }),
    "library": {}
};


text:
module.exports = function (grunt, options) {
  return {
    options: {
      files: ['package.json', 'bower.json'],
      updateConfigs: ['pkg', 'bwr'],
      commit: true,
      commitMessage: 'Release v%VERSION%',
      commitFiles: ['.'],
      createTag: true,
      tagName: 'v%VERSION%',
      tagMessage: 'Version %VERSION%',
      push: true,
      pushTo: 'origin master',
      gitDescribeOptions: '--tags --always --abbrev=1 --dirty=-d',
      globalReplace: false,
      prereleaseName: false,
      regExp: false
    }
  };
};


text:
package ru.vaadin.addon.highchart.model.options;

/**
 * Абстрактный класс для возврата родительского класса
 * Created by Petr Gusarov on 31.03.17.
 */
public abstract class Parent<T> {

    protected T parent;

    public Parent(T parent) {
        this.parent = parent;
    }

    public T and() {
        return parent;
    }

}


text:
set -e

python2 setup.py install --record install_log.txt --user "$@"


text:
const a = 1;

// noinspection GraphQLUnresolvedReference
const QUERY = gql`

    type Query {
        a: ID
        field(arg: ID): Int
    }

    type <error descr="\"User\" must define one or more fields"><error descr="The field type 'UnknownType' is not present when resolving type 'User'">User</error></error> {
        name: UnknownType
    }

    query {
        a
        bcd
        field(bar: 2)
    }

`;


text:
const labsUtil = require('../../../services/labs');
const common = require('../../../lib/common');

const labs = {
    subscribers(req, res, next) {
        if (labsUtil.isSet('subscribers') === true) {
            return next();
        } else {
            return next(new common.errors.NotFoundError());
        }
    }
};

module.exports = labs;


text:
namespace SC
{
	class PowCommand : public Command
	{
	public:
		PowCommand() { name = "pow"; }
		virtual std::string Usage() override { return "pow <number> <power>"; }
		virtual bool Exec(std::vector<std::string> argv) override
		{
			if (argv.size() != 3)
			{
				return false;
			}
			else
			{
				float num = std::stof(argv[1]);
				float power = std::stof(argv[2]);
				LogConsole("Pow(" + argv[1] + "," + argv[2] + ") = " + std::to_string(pow(num, power)))
				return true;
			}
		}

	protected:

	};
}

#endif


text:
define([
  '../core'
], function(Vertebrae) {

  if (typeof define === 'function' && define.amd) {
    define('vertebrae', ['jquery', 'backbone', 'underscore'], function() {
      return Vertebrae;
    });
  }

});


text:
package com.wandrell.pattern.test.integration.repository.access.sqlite.springjdbc;

import org.springframework.test.context.ContextConfiguration;
import org.springframework.test.context.TestPropertySource;

import com.wandrell.pattern.test.util.config.context.PersistenceContextPaths;
import com.wandrell.pattern.test.util.config.context.RepositoryContextPaths;
import com.wandrell.pattern.test.util.config.context.TestContextPaths;
import com.wandrell.pattern.test.util.config.properties.DatabaseScriptsPropertiesPaths;
import com.wandrell.pattern.test.util.config.properties.JdbcPropertiesPaths;
import com.wandrell.pattern.test.util.config.properties.PersistenceProviderPropertiesPaths;
import com.wandrell.pattern.test.util.config.properties.QueryPropertiesPaths;
import com.wandrell.pattern.test.util.config.properties.RepositoryPropertiesPaths;
import com.wandrell.pattern.test.util.config.properties.TestPropertiesPaths;
import com.wandrell.pattern.test.util.config.properties.UserPropertiesPaths;
import com.wandrell.pattern.test.util.test.integration.repository.access.AbstractITQuery;

/**
 * Integration tests for
 * {@link com.wandrell.pattern.repository.spring.SpringJdbcRepository
 * SpringJDBCRepository} implementing {@code AbstractITQuery}, using a SQLite
 * database and Spring JDBC.
 *
 * @author Bernardo Martínez Garrido
 * @see com.wandrell.pattern.repository.spring.SpringJdbcRepository
 *      SpringJDBCRepository
 */
@ContextConfiguration(locations = { TestContextPaths.DEFAULT,
        PersistenceContextPaths.SPRING_JDBC,
        RepositoryContextPaths.SPRING_JDBC })
@TestPropertySource(locations = { QueryPropertiesPaths.JDBC_QUERY,
        RepositoryPropertiesPaths.SPRING_JDBC, TestPropertiesPaths.ENTITY,
        PersistenceProviderPropertiesPaths.SPRING_JDBC,
        UserPropertiesPaths.DEFAULT, DatabaseScriptsPropertiesPaths.PLAIN,
        JdbcPropertiesPaths.SQLITE }, properties = {
                "jdbc.url=jdbc:sqlite:target/sqlite_test_spring_jdbc.db" })
public final class ITQuerySqliteSpringJdbcRepository extends AbstractITQuery {

    /**
     * Default constructor.
     */
    public ITQuerySqliteSpringJdbcRepository() {
        super();
    }

}


text:
require 'chef/resource/package'

class Chef
  class Resource
    class HartPackage < Chef::Resource::Package
      resource_name :hab_package
      provides :hab_package

      property :bldr_url, String, default: 'https://bldr.habitat.sh'
      property :channel, String, default: 'stable'
      property :auth_token, String
      property :binlink, [true, false, :force], default: false
      property :keep_latest, String
      property :exclude, String
      property :no_deps, [true, false], default: false
    end
  end
end


text:
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">

<title>org.springframework.mock.env (Spring Framework 4.3.3.RELEASE API)</title>
<meta name="date" content="2016-09-19">
<link rel="stylesheet" type="text/css" href="../../../../stylesheet.css" title="Style">

org.springframework.mock.env

Classes

MockEnvironment

MockPropertySource


text:
<?php

namespace Magento\Paypal\Controller\Express;

class Cancel extends \Magento\Paypal\Controller\Express\AbstractExpress\Cancel
{
    /**
     * Config mode type
     *
     * @var string
     */
    protected $_configType = 'Magento\Paypal\Model\Config';

    /**
     * Config method type
     *
     * @var string
     */
    protected $_configMethod = \Magento\Paypal\Model\Config::METHOD_WPP_EXPRESS;

    /**
     * Checkout mode type
     *
     * @var string
     */
    protected $_checkoutType = 'Magento\Paypal\Model\Express\Checkout';
}


text:
typedef  struct {
 rocksdb_options_t *options;
} lrocksdb_options_t;

typedef  struct {
 rocksdb_writeoptions_t *writeoptions;
} lrocksdb_writeoptions_t;

typedef  struct {
 rocksdb_readoptions_t *readoptions;
} lrocksdb_readoptions_t;

typedef  struct {
 rocksdb_restore_options_t *restoreoptions;
} lrocksdb_restoreoptions_t;

typedef struct {
  rocksdb_t *db;
  lrocksdb_options_t *options;
  unsigned char open;
  unsigned char read_only;
} lrocksdb_t;

typedef struct {
  rocksdb_backup_engine_t *backup_engine;
} lrocksdb_backup_engine_t;

typedef struct {
  rocksdb_writebatch_t *writebatch;
} lrocksdb_writebatch_t;

typedef struct {
  rocksdb_iterator_t *iter;
} lrocksdb_iterator_t;

#endif


text:
// Copyright 2016 Google Inc. All Rights Reserved.
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
//     http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.

using GoogleCloudExtension.Utils;
using System;
using System.Windows.Input;
using System.Windows.Media;

namespace GoogleCloudExtension.UserPrompt
{
    /// <summary>
    /// This class is the view model for the user prompt dialog.
    /// </summary>
    public class UserPromptWindowViewModel : ViewModelBase
    {
        private readonly UserPromptWindow _owner;
        private readonly UserPromptWindow.Options _options;

        /// <summary>
        /// The prompt to use in the dialog.
        /// </summary>
        public string Prompt => _options.Prompt?.Replace(@"\r\n", Environment.NewLine);

        /// <summary>
        /// The message to display.
        /// </summary>
        public string Message => _options.Message?.Replace(@"\r\n", Environment.NewLine);

        /// <summary>
        /// The error details to show in the dialog.
        /// </summary>
        public string ErrorDetails => _options.ErrorDetails;

        /// <summary>
        /// Returns true if there are error details to show.
        /// </summary>
        public bool HasErrorDetails => ErrorDetails != null;

        /// <summary>
        /// The icon to use for the dialog.
        /// </summary>
        public ImageSource Icon => _options.Icon;

        /// <summary>
        /// Whether there's an icon to show or no.
        /// </summary>
        public bool HasIcon => Icon != null;

        /// <summary>
        /// The command to execute in the action button.
        /// </summary>
        public ICommand ActionCommand { get; }

        /// <summary>
        /// The caption for the action button.
        /// </summary>
        public string ActionButtonCaption => _options.ActionButtonCaption;

        /// <summary>
        /// Returns whether there is an action button.
        /// </summary>
        public bool HasActionButton => !string.IsNullOrEmpty(_options.ActionButtonCaption);

        /// <summary>
        /// Negation of <seealso cref="HasActionButton"/> which helps with bindings in the Xaml.
        /// </summary>
        public bool DoesNotHaveActionButton => !HasActionButton;

        /// <summary>
        /// The caption for the cancel button.
        /// </summary>
        public string CancelButtonCaption => _options.CancelButtonCaption;

        /// <summary>
        /// The final result of the dialog, true if the user pressed the action button, false if the
        /// user cancelled out, either by pressing the cancel button or closing the dialog.
        /// </summary>
        public bool Result { get; private set; }

        public UserPromptWindowViewModel(UserPromptWindow owner, UserPromptWindow.Options options)
        {
            _owner = owner;
            _options = options;

            ActionCommand = new ProtectedCommand(OnActionCommand);
        }

        private void OnActionCommand()
        {
            Result = true;
            _owner.Close();
        }
    }
}


text:
/**
 * @function isObject
 *
 * @description
 * test if the item a object
 *
 * @param {*} object the object to test
 * @returns {boolean} is the item a object
 */
export default function isObject(object) {
  return typeof object === 'object' && !!object && object.constructor === Object;
}


text:
package br.com.demo.repository;

import org.springframework.data.jpa.repository.Query;
import org.springframework.data.repository.PagingAndSortingRepository;
import org.springframework.data.repository.query.Param;

import br.com.demo.model.Tarifa;

public interface TarifaRepository extends PagingAndSortingRepository<Tarifa, Long> {

	@Query("SELECT t.taxa FROM Tarifa t JOIN t.origem o JOIN t.destino d "
			+ "WHERE o.codigo = :origem AND d.codigo = :destino")
	double findByOrigemAndDestino(
			@Param("origem") String origem,
			@Param("destino") String destino);
}


text:
import * as React from "react";
import { createFragmentContainer, graphql } from "react-relay"
import { FairSubApp_fair } from "v2/__generated__/FairSubApp_fair.graphql"
import { BackLink } from "v2/Components/Links/BackLink"
import { FairMetaFragmentContainer as FairMeta } from "./Components/FairMeta"
import { useSystemContext } from "v2/System"
import { userIsAdmin } from "v2/Utils/user"
import { HttpError } from "found"

interface FairAppProps {
  fair: FairSubApp_fair
}

const FairApp: React.FC<FairAppProps> = ({ children, fair }) => {
  // If a fair's profile is inaccessible, that means it's private, which in turn means
  // the fair is only visible to admins.
  const { user } = useSystemContext()
  if (!fair.profile && !userIsAdmin(user)) {
    throw new HttpError(404)
  }

  return (
    <>
      <FairMeta fair={fair} />

      <BackLink my={2} to={`/fair/${fair.slug}`}>
        Back to {fair.name}
      </BackLink>

      {children}
    </>
  )
}

// Top-level route needs to be exported for bundle splitting in the router
export const FairSubAppFragmentContainer = createFragmentContainer(FairApp, {
  fair: graphql`
    fragment FairSubApp_fair on Fair {
      ...FairMeta_fair
      id
      name
      slug
      profile {
        __typename
      }
    }
  `,
})


text:
/*
+-----------------------------------------------------------------------------+

	@grahamzibar presents:

		 _______  _______  _______  _______           _______           _______
		(       )(  ___  )(  ____ )(  ____ )|\     /|(  ____ \|\     /|(  ____ \
		| () () || (   ) || (    )|| (    )|| )   ( || (    \/| )   ( || (    \/
		| || || || |   | || (____)|| (____)|| (___) || (__    | |   | || (_____
		| |(_)| || |   | ||     __)|  _____)|  ___  ||  __)   | |   | |(_____  )
		| |   | || |   | || (\ (   | (      | (   ) || (      | |   | |      ) |
		| )   ( || (___) || ) \ \__| )      | )   ( || (____/\| (___) |/\____) |
		|/     \|(_______)|/   \__/|/       |/     \|(_______/(_______)\_______)

	* version 0.1.0 - ALPHA
	* https://www.github.com/grahamzibar/Morpheus

	* What if I told you... this is not an animation library?

+-----------------------------------------------------------------------------+
*/
(function MorpheusModule(_win) {
	/* Namespacing */
	var Morpheus = _win.Morpheus = new Object();

	/*

		CONSTANTS

	*/
	Morpheus.LINEAR = 'linear';
	Morpheus.EASE = 'ease';
	Morpheus.EASE_IN = 'ease-in';
	Morpheus.EASE_OUT = 'ease-out';
	Morpheus.EASE_IN_OUT = 'ease-in-out';
	Morpheus.EASE_OUT_IN = 'ease-out-in';
	Morpheus.ELASTIC = [0.64, 0.57, 0.67, 1.53];

	Morpheus.LEFT = 'left';
	Morpheus.RIGHT = 'right';
	Morpheus.CENTER = 'center';

	Morpheus.THREE_D = 'preserve-3d';
	Morpheus.FLAT = 'flat';

	Morpheus.PIXELS = 'px';
	Morpheus.PERCENT = '%';
	Morpheus.RADIANS = 'rad';
	Morpheus.DEGREES = 'deg';

	Morpheus.PREFIX = '';
	Morpheus.TRANSITION_END = 'transitionend';
	Morpheus.TRANSFORM = 'transform';
	Morpheus.FILTER = 'filter';

	/* Setup */
	(function setup(win, morph) {
		if (win.requestAnimationFrame || win.webkitRequestAnimationFrame) {
			morph.PREFIX = '-webkit-';
			morph.TRANSITION_END = 'webkitTransitionEnd';
			morph.TRANSFORM = '-webkit-transform';
			morph.FILTER = '-webkit-filter';
			win.requestAnimationFrame = win.webkitRequestAnimationFrame;
		} else if (win.oRequestAnimationFrame) {
			morph.PREFIX = '-o-';
			morph.TRANSITION_END = 'otransitionend';
			morph.TRANSFORM = '-o-transform';
			morph.FILTER = '-o-filter';
			win.requestAnimationFrame = win.oRequestAnimationFrame;
		} else if (win.mozRequestAnimationFrame) {
			morph.PREFIX = '-moz-';
			morph.TRANSFORM = '-moz-transform';
			morph.FILTER = '-moz-filter';
			win.requestAnimationFrame = win.mozRequestAnimationFrame;
		} else if (win.msRequestAnimationFrame) {
			morph.PREFIX = '-ms-';
			morph.TRANSFORM = '-ms-transform';
			morph.FILTER = '-ms-filter';
			win.requestAnimationFrame = win.msRequestAnimationFrame;
		} else {
			console.error('No polyfill exists yet. Sorry \'bout it.');
			// We need a polyfill fo requestAnimationFrame
			// TODO later.
		}
	})(_win, Morpheus);

	/*

		CLASSES

	*/
	var Vector = function Vector(x, y, z) {
		this.x = x != null ? x : 0.0;
		this.y = y != null ? y : 0.0;
		this.z = z != null ? z : 0.0;
	};
	Vector.prototype.set = function(x, y, z) {
		this.x = x;
		if (y != null) {
			this.y = y;
			if (z != null)
				this.z = z;
		}
	};

	var Collection = function Collection() {
		var _collection = new Array();
		var _cache = {};

		this.collection = _collection;

		function reset_cache(coll) {
			var cache = {}
			for (var i = 0, l = coll.length; i < l; i++)
				cache[coll[i].key] = i;
			return cache;
		};

		function get_index(obj, key) {
			return typeof obj[key] === 'number' ? obj[key] : -1;
		};

		this.add = function(value) {
			var index = _cache[value.key];
			if (typeof index !== 'number')
				index = _cache[value.key] = _collection.length;
			_collection[index] = value;
		};

		this.get = function(key) {
			var i = get_index(_cache, key);
			if (i < 0)
				return null;
			return _collection[i];
		};

		this.remove = function(key) {
			var i = get_index(_cache, key);
			if (i > -1) {
				_collection.splice(i, 1);
				_cache = reset_cache(_collection);
			}
		};
	};

	var Style = function Style(_name, _value, _unit) {
		this.key = _name;
		this.name = _name;
		this.value = _value;
		this.unit = _unit != null ? _unit : '';
	};

	var StyleCollection = function StyleCollection() {
		this.inheritFrom = Collection;
		this.inheritFrom();
		delete this.inheritFrom;
	};

	var Transition = function Transition(_property) {
		this.key = _property;
		this.property = _property;
		this.duration = 500;
		this.delay = 0;
		this.timing = Morpheus.LINEAR;
	};

	var TransitionCollection = function TransitionCollection() {
		this.inheritFrom = Collection;
		this.inheritFrom();
		delete this.inheritFrom;
	};

	var Transform = function Transform() {
		this.translate = new Vector();
		this.translateUnit = 'px';
		this.scale = new Vector(1, 1, 1);
		this.rotate = new Vector();
		this.rotateUnit = 'rad';

		this.origin = new Vector(Morpheus.CENTER, Morpheus.CENTER, Morpheus.CENTER);
		this.style = Morpheus.THREE_D;
	};

	Morpheus.CSSRenderer = function CSSRenderer(_el) {
		var _prefix = Morpheus.PREFIX;

		var onEnterFrame = function(e) {
			var output = '';
			var styles = _el.styles;
			var transitions = _el.transitions;
			var transform = _el.transform;

			if (styles) {
				for (var i = 0, len = styles.collection.length; i < len; i++)
					output += renderStyle(styles.collection[i]);
			}
			var p = _prefix;
			if (transitions)
				output += renderTransitionCollection(transitions, p);
			if (transform)
				output += renderTransform(transform, p);
			setCSS.call(_el, output);
		};

		var renderStyle = function(style) {
			var output = style.name;
			output += ':';
			output += style.value;
			output += style.unit;
			output += ';';
			return output;
		};

		var renderTransitionCollection = function(tc, p) {
			var output = p + 'transition:';
			for (var i = 0, ts = tc.collection, len = ts.length; i < len; i++) {
				if (i)
					output += ', ';
				output += renderTransition(ts[i]);
			}
			output += ';';
			return output;
		};

		var renderTransition = function(transition) {
			var space = ' ';
			var t = transition.property;
			t += space;
			t += transition.duration;
			t += 'ms';
			t += space;
			t += transition.timing;
			t += space;
			t += transition.delay;
			t += 'ms';
			return t;
		};

		var renderTransform = function(transform, p) {
			var space = ' ';
			var t = p + 'transform:translate3d';
			t += renderVector(transform.translate, transform.translateUnit);

			t += space;

			t += 'rotateX(';
			t += transform.rotate.x;
			t += transform.rotateUnit;
			t += ')';
			t += 'rotateY(';
			t += transform.rotate.y;
			t += transform.rotateUnit;
			t += ')';
			t += 'rotateZ(';
			t += transform.rotate.z;
			t += transform.rotateUnit;
			t += ')';

			t += space;

			t += 'scale3d';
			t += renderVector(transform.scale);
			t += ';';

			t += 'transform-origin:';
			t += transform.origin.x;
			t += space;
			t += transform.origin.y;
			t += space;
			t += transform.origin.z;
			t += ';';

			t += 'transform-style:';
			t += transform.style;
			t += ';';

			return t;
		};

		var renderVector = function(vector, unit) {
			unit = unit != null ? unit : '';
			var coord = '(';
			coord += vector.x;
			if (vector.x)
				coord += unit;
			coord += ', ';
			coord += vector.y;
			if (vector.y)
				coord += unit;
			coord += ', ';
			coord += vector.z;
			if (vector.z)
				coord += unit;
			coord += ')';

			return coord;
		};

		this.step = function() {
			requestAnimationFrame(onEnterFrame);
		};

		this.step();
	};

	/*

		FUNCTIONS

	*/
	var getStyle = function(property) {
		if (document.defaultView && document.defaultView.getComputedStyle)
			return document.defaultView.getComputedStyle(this, false).getPropertyValue(property);
		if (this.currentStyle) {
			return this.currentStyle[property.replace(/\-(\w)/g, function (strMatch, p1) {
				return p1.toUpperCase();
			})];
		}
		return null;
	};

	var getStyleNumber = function(property, unit) {
		var value = this.getStyle(property);
		if (unit)
			value = value.split(unit)[0];
		return Number(value);
	};

	var setStyle = function(property, value, unit) {
		if (!this.styles)
			this.styles = new StyleCollection();

		this.styles.add(new Style(property, value, unit));

		if (!this.renderer)
			this.renderer = new Morpheus.CSSRenderer(this);
		this.renderer.step();
	};

	var removeStyle = function(property) {
		if (!this.styles)
			return;

		this.styles.remove(property);

		if (!this.renderer)
			this.renderer = new Morpheus.CSSRenderer(this);
		this.renderer.step();
	};

	var setCSS = function(css) {
		if (typeof this.style.cssText != 'undefined')
			this.style.cssText = css;
		else
			this.setAttribute('style', css);
	};

	var translation = function(x, y, z, unit) {
		if (!this.transform)
			this.transform = new Transform();

		this.transform.translate.x = x;
		this.transform.translate.y = y;
		if (z != null) {
			if (arguments.length === 3 && typeof z !== 'number')
				this.transform.translateUnit = z;
			else
				this.transform.z = z;
		}
		if (unit)
			this.transform.translateUnit = unit;

		if (!this.renderer)
			this.renderer = new Morpheus.CSSRenderer(this);
		this.renderer.step();
	};

	var scale = function(x, y, z) {
		if (!this.transform)
			this.transform = new Transform();

		this.transform.scale.x = x;
		this.transform.scale.y = y;
		if (z != null)
			this.transform.scale.z = z;

		if (!this.renderer)
			this.renderer = new Morpheus.CSSRenderer(this);
		this.renderer.step();
	};

	var rotate = function(x, y, z, unit) {
		if (!this.transform)
			this.transform = new Transform();

		this.transform.rotate.x = x;
		this.transform.rotate.y = y;
		this.transform.rotate.z = z;
		if (unit)
			this.transform.rotateUnit = unit;

		if (!this.renderer)
			this.renderer = new Morpheus.CSSRenderer(this);
		this.renderer.step();
	};

	var setOrigin = function(x, y, z) {
		if (!this.transform)
			this.transform = new Transform();
		this.transform.origin.x = x;
		if (y != null) {
			this.transform.origin.y = y;
			if (z != null)
				this.transform.origin.z = z;
		}
		if (!this.renderer)
			this.renderer = new Morpheus.CSSRenderer(this);
		this.renderer.step();
	};

	function get_css_string(val) {
		if (val.constructor === Array)
			return 'cubic-bezier(' + val.join(', ') + ')';
		return val;
	};

	var addTransition = function(property, duration, timing, delay) {
		if (!this.transitions)
			this.transitions = new TransitionCollection();

		var transition = this.transitions.get(property);
		if (!transition)
			transition = new Transition(property);

		if (duration)
			transition.duration = duration;
		if (timing)
			transition.timing = get_css_string(timing);
		if (delay)
			transition.delay = delay;

		this.transitions.add(transition);
	};

	var removeTransition = function(property) {
		if (this.transitions)
			this.transitions.remove(property);
	};

	var hasTransition = function(property) {
		return this.transitions && !!this.transitions.get(property);
	};

	/*

		EXTENSION

	*/
	var HTMLElement = _win.HTMLElement;

	HTMLElement.prototype.setCSS = setCSS;
	HTMLElement.prototype.getStyle = getStyle;
	HTMLElement.prototype.getStyleNumber = getStyleNumber;
	HTMLElement.prototype.setStyle = setStyle;
	HTMLElement.prototype.removeStyle = removeStyle;

	HTMLElement.prototype.translation = translation;
	HTMLElement.prototype.scale = scale;
	HTMLElement.prototype.rotate = rotate;
	HTMLElement.prototype.setOrigin = setOrigin;

	HTMLElement.prototype.addTransition = addTransition;
	HTMLElement.prototype.removeTransition = removeTransition;
	HTMLElement.prototype.hasTransition = hasTransition;
})(window);


text:
package com.facebook.buck.step;

import build.bazel.remote.execution.v2.ExecutedActionMetadata;
import com.facebook.buck.core.build.execution.context.ExecutionContext;
import com.facebook.buck.core.exceptions.ExceptionWithContext;
import com.facebook.buck.core.exceptions.HumanReadableException;
import com.facebook.buck.core.exceptions.WrapsException;
import com.facebook.buck.util.string.MoreStrings;
import com.google.common.collect.ImmutableList;
import java.util.Optional;
import java.util.OptionalInt;

public class StepFailedException extends Exception implements WrapsException, ExceptionWithContext {

  private static final int KEEP_FIRST_CHARS = 4 * 80;

  private final Step step;
  private final String description;
  private final OptionalInt exitCode;
  private Optional<ExecutedActionMetadata> executedActionMetadata;

  /** Callers should use {@link #createForFailingStepWithExitCode} unless in a unit test. */
  private StepFailedException(
      Throwable cause, Step step, String description, OptionalInt exitCode) {
    super(cause);
    this.step = step;
    this.description = description;
    this.exitCode = exitCode;
    this.executedActionMetadata = Optional.empty();
  }

  @Override
  public String getMessage() {
    return getCause().getMessage() + System.lineSeparator() + "  " + getContext().get();
  }

  /** Creates a StepFailedException based on a StepExecutionResult. */
  public static StepFailedException createForFailingStepWithExitCode(
      Step step, ExecutionContext context, StepExecutionResult executionResult) {
    int exitCode = executionResult.getExitCode();
    StringBuilder messageBuilder = new StringBuilder();
    messageBuilder.append(String.format("Command failed with exit code %d.", exitCode));
    ImmutableList<String> executedCommand = executionResult.getExecutedCommand();
    if (!executedCommand.isEmpty()) {
      appendToErrorMessage(messageBuilder, "command", executedCommand.toString(), true);
    }
    executionResult
        .getStderr()
        .ifPresent(stderr -> appendToErrorMessage(messageBuilder, "stderr", stderr, false));

    StepFailedException ret =
        new StepFailedException(
            executionResult
                .getCause()
                .map(cause -> new HumanReadableException(cause, messageBuilder.toString()))
                .orElse(new HumanReadableException(messageBuilder.toString())),
            step,
            descriptionForStep(step, context),
            OptionalInt.of(exitCode));
    return ret;
  }

  /** Same as above but includes RE action metadata */
  public static StepFailedException createForFailingStepWithExitCode(
      Step step,
      ExecutionContext context,
      StepExecutionResult executionResult,
      ExecutedActionMetadata executedActionMetadata) {
    StepFailedException ret =
        StepFailedException.createForFailingStepWithExitCode(step, context, executionResult);
    ret.executedActionMetadata = Optional.of(executedActionMetadata);
    return ret;
  }

  private static StringBuilder appendToErrorMessage(
      StringBuilder messageBuilder, String name, String value, boolean truncate) {
    return messageBuilder
        .append(System.lineSeparator())
        .append(System.lineSeparator())
        .append(name)
        .append(": ")
        .append(truncate ? MoreStrings.truncateTail(value, KEEP_FIRST_CHARS) : value);
  }

  static StepFailedException createForFailingStepWithException(
      Step step, ExecutionContext context, Throwable throwable) {
    return new StepFailedException(
        throwable, step, descriptionForStep(step, context), OptionalInt.empty());
  }

  private static String descriptionForStep(Step step, ExecutionContext context) {
    return context.getVerbosity().shouldPrintCommand()
        ? step.getDescription(context)
        : step.getShortName();
  }

  public Step getStep() {
    return step;
  }

  public OptionalInt getExitCode() {
    return exitCode;
  }

  public Optional<ExecutedActionMetadata> getExecutedActionMetadata() {
    return executedActionMetadata;
  }

  @Override
  public Optional<String> getContext() {
    return Optional.of(String.format("When running <%s>.", description));
  }
}


text:
#!/bin/bash
if [[ $EUID -ne 0 ]]; then
   echo -e "\033[31;1m You must be root to do this. \033[0m" 1>&2
   exit 100
fi

echo -e "\033[36;1m Setting up Dark Night Skin \033[0m"

cat > /usr/share/mc/skins/darknight.ini <<EOF
[skin]
    description = Dark Night skin

[Lines]
    horiz=─
    vert=│
    lefttop=┌
    righttop=┐
    leftbottom=└
    rightbottom=┘
    topmiddle=─
    bottommiddle=─
    leftmiddle=├
    rightmiddle=┤
    cross=┼
    dhoriz=─
    dvert=│
    dlefttop=┌
    drighttop=┐
    dleftbottom=└
    drightbottom=┘
    dtopmiddle=─
    dbottommiddle=─
    dleftmiddle=├
    drightmiddle=┤

[core]
    _default_ = gray;black
    # Also applies on the function key hints at the bottom
    selected = brightred;
    # Also applies on field names of file pane and the selected files
    # information at the bottom of file pane
    marked = yellow;
    markselect = brightred;
    gauge = ;white
    input = brightred;gray
    inputunchanged=brightred;gray
    disabled=gray;lightgray
    reverse = black;lightgray

[dialog]
    dfocus = brightred;
    dhotnormal = brightred;
    dhotfocus = brightred;

[error]
    _default_ = white;red
    errdhotnormal = yellow;red
    errdhotfocus = yellow;lightgray
# Must match /{usr/,}etc/mc/filehighlight.ini, or ~/.mc/filehighlight.ini
[filehighlight]
    directory = lightgray;
    executable = green;
    symlink = cyan;
    stalelink = lightgray;red;
    device = brown;
    # Such as socket, fifo
    special = brown;
    # Linux core dump file
    core = red;
    temp = black;green;
    archive = red;
    doc = green;
    source = cyan;
    media = magenta;
    graph = magenta;
    database = blue;

[menu]
    menuhot = brightred;
    menusel = brightred;
    menuhotsel = brightred;

[help]
    helpitalic = red;
    helpbold = blue;
    helplink = white;
    helpslink = white;brightred
# Untouched except removing _default_
[editor]
    editbold = yellow;blue
    editmarked = black;cyan
    editwhitespace = brightblue;blue
    linestate = white;cyan
# Untoched
[viewer]
    viewunderline = brightred;blue
# Added
[popupmenu]
    _default_=lightgray;blue
    menusel=black;cyan
    menutitle=lightgray;blue

[statusbar]
    _default_=black;cyan

[buttonbar]
    hotkey=brightred;
    button=lightgray;
EOF
sleep 5

echo -e "\033[36;1m Setting up ini config \033[0m"

INI_FILE=/home/*/.config/mc/ini

if [ -f $INI_FILE ];
then
    sed -i 's/^skin=[a-zA-Z0-9]*/skin=darknight/' $INI_FILE
else
    echo -e "\033[31;1m Error: ini config file does not exists. \033[0m"
    echo " Run MC for the first time then exit then run the installation again."
    echo " "
    exit 100
fi

sleep 5

echo -e "\033[32;1m Complete! \033[0m"


text:
<?xml version="1.0" encoding="utf-8"?>

<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
                xmlns:tools="http://schemas.android.com/tools"
                xmlns:app="http://schemas.android.com/apk/res-auto"
                android:layout_width="match_parent"
                android:layout_height="match_parent">

    <ListView
        android:id="@android:id/list"
        android:layout_width="match_parent"
        android:layout_height="match_parent"
        tools:listitem="@layout/single_skill_item"/>

</RelativeLayout>


text:
<?xml version="1.0" encoding="UTF-8"?>
<sem:triples uri="http://www.lds.org/vrl/publications-and-documents/geneology-and-history/genealogical-word-list-hungarian-publication" xmlns:sem="http://marklogic.com/semantics">
  <sem:triple>
    <sem:subject>http://www.lds.org/vrl/publications-and-documents/geneology-and-history/genealogical-word-list-hungarian-publication</sem:subject>
    <sem:predicate>http://www.w3.org/2004/02/skos/core#prefLabel</sem:predicate>
    <sem:object datatype="xsd:string" xml:lang="eng">Genealogical Word List. Hungarian (Publication)</sem:object>
  </sem:triple>
  <sem:triple>
    <sem:subject>http://www.lds.org/vrl/publications-and-documents/geneology-and-history/genealogical-word-list-hungarian-publication</sem:subject>
    <sem:predicate>http://www.w3.org/2004/02/skos/core#inScheme</sem:predicate>
    <sem:object datatype="sem:iri">http://www.lds.org/concept-scheme/vrl</sem:object>
  </sem:triple>
  <sem:triple>
    <sem:subject>http://www.lds.org/vrl/publications-and-documents/geneology-and-history/genealogical-word-list-hungarian-publication</sem:subject>
    <sem:predicate>http://www.lds.org/core#entityType</sem:predicate>
    <sem:object datatype="sem:iri">http://www.lds.org/Topic</sem:object>
  </sem:triple>
</sem:triples>


text:
/*----------------------------------------------------------------------------*/
/*  font.h                                                                    */
/*----------------------------------------------------------------------------*/
/*  copyright         : (C) 2002 by Dao Hai Lam                               */
/*                      VISC Software & Security Consultant Company           */
/*                      Hall 3, Quang Trung Software City                     */
/*                      Tan Chanh Hiep Ward, District 12,                     */
/*                      Ho Chi Minh city, VIETNAM                             */
/*  website           : http://www.visc-network.com                           */
/*  email             : lam@visc-network.com                                  */
/*  last modify       : Sun,  4 Aug 2002 15:34:55 +0700                       */
/*----------------------------------------------------------------------------*/
/*                                                                            */
/*   This program is free software; you can redistribute it and/or modify     */
/*   it under the terms of the GNU General Public License as published by     */
/*   the Free Software Foundation; either version 2 of the License, or        */
/*   (at your option) any later version.                                      */
/*                                                                            */
/*----------------------------------------------------------------------------*/
#ifndef __FONT_H
#define __FONT_H
/*----------------------------------------------------------------------------*/
#include "vkeydefs.h"
/*----------------------------------------------------------------------------*/
void VKCreateFontDialog();
void VKDestroyFontDialog();
void VKShowFontDialog();
void VKHideFontDialog();
/*----------------------------------------------------------------------------*/
#endif


text:
package org.apache.eagle.alert.engine.perf;

import com.esotericsoftware.kryo.Kryo;
import com.esotericsoftware.kryo.io.Input;
import com.esotericsoftware.kryo.io.Output;
import org.apache.commons.io.FilenameUtils;
import org.apache.eagle.alert.engine.coordinator.StreamPartition;
import org.apache.eagle.alert.engine.coordinator.StreamSortSpec;
import org.apache.eagle.alert.engine.model.PartitionedEvent;
import org.apache.eagle.alert.engine.model.StreamEvent;
import org.junit.Assert;
import org.junit.Before;
import org.junit.Test;

import java.io.FileInputStream;
import java.io.FileOutputStream;
import java.io.Serializable;
import java.util.ArrayList;
import java.util.List;

/**
 * Since 5/13/16.
 */
public class TestSerDeserPer {
    Object[] data = null;

    @Before
    public void before() {
        int max = 100;
        StringBuilder sb = new StringBuilder();
        for (int i = 0; i < max; i++) {
            sb.append("a");
        }
        data = new Object[] {sb.toString()};
    }

    private String getTmpPath() {
        return System.getProperty("java.io.tmpdir");
    }

    @Test
    public void testSerDeserPerf() throws Exception {
        Kryo kryo = new Kryo();
        String outputPath = FilenameUtils.concat(getTmpPath(), "file.bin");
        Output output = new Output(new FileOutputStream(outputPath));
        for (int i = 0; i < 1000; i++) {
            kryo.writeObject(output, constructPE());
        }
        output.close();
        Input input = new Input(new FileInputStream(outputPath));
        PartitionedEvent someObject = kryo.readObject(input, PartitionedEvent.class);
        input.close();
        Assert.assertTrue(someObject.getData().length == 1);
    }

    private PartitionedEvent constructPE() {
        StreamEvent e = new StreamEvent();
        e.setStreamId("testStreamId");
        e.setTimestamp(1463159382000L);
        e.setData(data);
        StreamPartition sp = new StreamPartition();
        List<String> col = new ArrayList<>();
        col.add("host");
        sp.setColumns(col);
        StreamSortSpec sortSpec = new StreamSortSpec();
        sortSpec.setWindowMargin(30000);
        sortSpec.setWindowPeriod("PT1M");
        sp.setSortSpec(sortSpec);
        sp.setStreamId("testStreamId");
        sp.setType(StreamPartition.Type.GROUPBY);
        PartitionedEvent pe = new PartitionedEvent();
        pe.setEvent(e);
        pe.setPartition(sp);
        pe.setPartitionKey(1000);
        return pe;
    }

    @Test
    public void testSerDeserPerf2() throws Exception {
        Kryo kryo = new Kryo();
        String outputPath = FilenameUtils.concat(getTmpPath(), "file2.bin");
        Output output = new Output(new FileOutputStream(outputPath));
        for (int i = 0; i < 1000; i++) {
            kryo.writeObject(output, constructNewPE());
        }
        output.close();
        Input input = new Input(new FileInputStream(outputPath));
        NewPartitionedEvent someObject = kryo.readObject(input, NewPartitionedEvent.class);
        input.close();
        Assert.assertTrue(someObject.getData().length == 1);
    }

    private NewPartitionedEvent constructNewPE() {
        NewPartitionedEvent pe = new NewPartitionedEvent();
        pe.setStreamId("testStreamId");
        pe.setTimestamp(1463159382000L);
        pe.setData(data);

        pe.setType(StreamPartition.Type.GROUPBY);
        List<String> col = new ArrayList<>();
        col.add("host");
        pe.setColumns(col);
        pe.setPartitionKey(1000);

        pe.setWindowMargin(30000);
        pe.setWindowPeriod("PT1M");
        return pe;
    }

    @Test
    public void testSerDeserPerf3() throws Exception {
        Kryo kryo = new Kryo();
        String outputPath = FilenameUtils.concat(getTmpPath(), "file3.bin");
        Output output = new Output(new FileOutputStream(outputPath));
        for (int i = 0; i < 1000; i++) {
            kryo.writeObject(output, constructNewPE2());
        }
        output.close();
        Input input = new Input(new FileInputStream(outputPath));
        NewPartitionedEvent2 someObject = kryo.readObject(input, NewPartitionedEvent2.class);
        input.close();
        Assert.assertTrue(someObject.getData().length == 1);
    }

    private NewPartitionedEvent2 constructNewPE2() {
        NewPartitionedEvent2 pe = new NewPartitionedEvent2();
        pe.setStreamId(100);
        pe.setTimestamp(1463159382000L);
        pe.setData(data);

        pe.setType(1);
        int[] col = new int[1];
        col[0] = 1;
        pe.setColumns(col);
        pe.setPartitionKey(1000);

        pe.setWindowMargin(30000);
        pe.setWindowPeriod(60);
        return pe;
    }

    public static class NewPartitionedEvent implements Serializable {
        private static final long serialVersionUID = -3840016190614238593L;
        // basic
        private String streamId;
        private long timestamp;
        private Object[] data;

        // stream partition
        private StreamPartition.Type type;
        private List<String> columns = new ArrayList<>();
        private long partitionKey;

        // sort spec
        private String windowPeriod = "";
        private long windowMargin = 30 * 1000;

        public NewPartitionedEvent() {
        }

        public String getStreamId() {
            return streamId;
        }

        public void setStreamId(String streamId) {
            this.streamId = streamId;
        }

        public long getTimestamp() {
            return timestamp;
        }

        public void setTimestamp(long timestamp) {
            this.timestamp = timestamp;
        }

        public Object[] getData() {
            return data;
        }

        public void setData(Object[] data) {
            this.data = data;
        }

        public StreamPartition.Type getType() {
            return type;
        }

        public void setType(StreamPartition.Type type) {
            this.type = type;
        }

        public List<String> getColumns() {
            return columns;
        }

        public void setColumns(List<String> columns) {
            this.columns = columns;
        }

        public long getPartitionKey() {
            return partitionKey;
        }

        public void setPartitionKey(long partitionKey) {
            this.partitionKey = partitionKey;
        }

        public String getWindowPeriod() {
            return windowPeriod;
        }

        public void setWindowPeriod(String windowPeriod) {
            this.windowPeriod = windowPeriod;
        }

        public long getWindowMargin() {
            return windowMargin;
        }

        public void setWindowMargin(long windowMargin) {
            this.windowMargin = windowMargin;
        }
    }

    public static class NewPartitionedEvent2 implements Serializable {
        private static final long serialVersionUID = -3840016190614238593L;
        // basic
        private int streamId;
        private long timestamp;
        private Object[] data;

        // stream partition
        private int type;
        private int[] columns;
        private long partitionKey;

        // sort spec
        private long windowPeriod;
        private long windowMargin = 30 * 1000;

        public NewPartitionedEvent2() {
        }

        public int getStreamId() {
            return streamId;
        }

        public void setStreamId(int streamId) {
            this.streamId = streamId;
        }

        public int getType() {
            return type;
        }

        public void setType(int type) {
            this.type = type;
        }

        public int[] getColumns() {
            return columns;
        }

        public void setColumns(int[] columns) {
            this.columns = columns;
        }

        public long getPartitionKey() {
            return partitionKey;
        }

        public void setPartitionKey(long partitionKey) {
            this.partitionKey = partitionKey;
        }

        public long getWindowPeriod() {
            return windowPeriod;
        }

        public void setWindowPeriod(long windowPeriod) {
            this.windowPeriod = windowPeriod;
        }

        public long getTimestamp() {
            return timestamp;
        }

        public void setTimestamp(long timestamp) {
            this.timestamp = timestamp;
        }

        public Object[] getData() {
            return data;
        }

        public void setData(Object[] data) {
            this.data = data;
        }

        public long getWindowMargin() {
            return windowMargin;
        }

        public void setWindowMargin(long windowMargin) {
            this.windowMargin = windowMargin;
        }
    }
}


text:
{{greetingCtrl.item.id ? 'Edit' : 'Add'}} Greeting

<form name="greetingForm" class="form-horizontal" novalidate ng-submit="greetingCtrl.save()">

            * Content

                <input type="text" name="content" class="form-control" ng-model="greetingCtrl.item.content"
                       autofocus="true" required />

Please fill
                    in the content

        Cancel
        <input type="submit" class="btn btn-primary" value="{{greetingCtrl.item.id ? 'Update' : 'Submit'}}"
               ng-disabled="greetingForm.$pristine || greetingForm.$invalid"/>

</form>


text:
package com.zhuinden.simplestack;

import android.os.Parcelable;
import android.util.SparseArray;

import com.zhuinden.statebundle.StateBundle;

import javax.annotation.Nonnull;
import javax.annotation.Nullable;

/**
 * A container for the view hierarchy state and an optional Bundle.
 *
 * A {@link SavedState} represents the state of the screen that is bound to a given key.
 */
public class SavedState {
    private Object key;
    private SparseArray<Parcelable> viewHierarchyState;
    private StateBundle bundle;
    private StateBundle viewBundle;

    private SavedState() {
    }

    @Nonnull
    public Object getKey() {
        return key;
    }

    @Nonnull
    public SparseArray<Parcelable> getViewHierarchyState() {
        return viewHierarchyState;
    }

    public void setViewHierarchyState(SparseArray<Parcelable> viewHierarchyState) {
        this.viewHierarchyState = viewHierarchyState;
    }

    @Nullable
    public StateBundle getBundle() {
        return bundle;
    }

    @Nullable
    StateBundle getViewBundle() {
        return viewBundle;
    }

    public void setBundle(@Nullable StateBundle bundle) { // should be non-null
        this.bundle = bundle;
    }

    void setViewBundle(@Nullable StateBundle viewBundle) {
        this.viewBundle = viewBundle;
    }

    public static Builder builder() {
        return new Builder();
    }

    /**
     * A builder class that allows creating SavedState instances.
     *
     * Keys are not optional.
     */
    public static class Builder {
        private Object key;
        private SparseArray<Parcelable> viewHierarchyState = new SparseArray<>();
        private StateBundle bundle = new StateBundle();
        private StateBundle viewBundle;

        Builder() {
        }

        public Builder setKey(@Nonnull Object key) {
            if(key == null) {
                throw new IllegalArgumentException("Key cannot be null");
            }
            this.key = key;
            return this;
        }

        public Builder setViewHierarchyState(@Nonnull SparseArray<Parcelable> viewHierarchyState) {
            if(viewHierarchyState == null) {
                throw new IllegalArgumentException("Provided sparse array for view hierarchy state cannot be null");
            }
            this.viewHierarchyState = viewHierarchyState;
            return this;
        }

        public Builder setBundle(@Nullable StateBundle bundle) {  // should be non-null
            this.bundle = bundle;
            return this;
        }

        Builder setViewBundle(@Nullable StateBundle viewBundle) {
            this.viewBundle = viewBundle;
            return this;
        }

        public SavedState build() {
            if(key == null) {
                throw new IllegalStateException("You cannot create a SavedState without associating a Key with it.");
            }
            SavedState savedState = new SavedState();
            savedState.key = key;
            savedState.viewHierarchyState = viewHierarchyState;
            savedState.bundle = bundle;
            savedState.viewBundle = viewBundle;
            return savedState;
        }
    }

    @Override
    public boolean equals(Object obj) {
        if(obj == null) {
            return false;
        }
        if(!(obj instanceof SavedState)) {
            return false;
        }
        return ((SavedState) obj).getKey().equals(this.key);
    }

    @Override
    public int hashCode() {
        return key.hashCode();
    }
}


text:
using System.Collections.Generic;
using System.IO;
using System.Text;
using System.Diagnostics.Contracts;
using System;

// Disable the "this variable is not used" warning as every field would imply it.
#pragma warning disable 0414
// Disable the "this variable is never assigned to".
#pragma warning disable 0067
// Disable the "this event is never assigned to".
#pragma warning disable 0649
// Disable the "this variable is never used".
#pragma warning disable 0169
// Disable the "new keyword not required" warning.
#pragma warning disable 0109
// Disable the "extern without DllImport" warning.
#pragma warning disable 0626
// Disable the "could hide other member" warning, can happen on certain properties.
#pragma warning disable 0108

namespace System.ServiceModel
{
  [AttributeUsage(AttributeTargets.All)]
  sealed public partial class OperationBehaviorAttribute : Attribute, System.ServiceModel.Description.IOperationBehavior
  {
    #region Methods and constructors
    public OperationBehaviorAttribute()
    {
    }

    void System.ServiceModel.Description.IOperationBehavior.AddBindingParameters(System.ServiceModel.Description.OperationDescription description, System.ServiceModel.Channels.BindingParameterCollection parameters)
    {
    }

    void System.ServiceModel.Description.IOperationBehavior.ApplyClientBehavior(System.ServiceModel.Description.OperationDescription description, System.ServiceModel.Dispatcher.ClientOperation proxy)
    {
    }

    void System.ServiceModel.Description.IOperationBehavior.ApplyDispatchBehavior(System.ServiceModel.Description.OperationDescription description, System.ServiceModel.Dispatcher.DispatchOperation dispatch)
    {
    }

    void System.ServiceModel.Description.IOperationBehavior.Validate(System.ServiceModel.Description.OperationDescription description)
    {
    }
    #endregion

    #region Properties and indexers
    public bool AutoDisposeParameters
    {
      get
      {
        return default(bool);
      }
      set
      {
      }
    }

    public ImpersonationOption Impersonation
    {
      get
      {
        return default(ImpersonationOption);
      }
      set
      {
      }
    }

    public ReleaseInstanceMode ReleaseInstanceMode
    {
      get
      {
        return default(ReleaseInstanceMode);
      }
      set
      {
      }
    }

    public bool TransactionAutoComplete
    {
      get
      {
        return default(bool);
      }
      set
      {
      }
    }

    public bool TransactionScopeRequired
    {
      get
      {
        return default(bool);
      }
      set
      {
      }
    }
    #endregion
  }
}


text:
<?php namespace App\Models;

use Illuminate\Database\Eloquent\Model as Model;
use Illuminate\Database\Eloquent\SoftDeletes;

/**
 * App\Models\Element
 *
 * @property integer $id
 * @property \Carbon\Carbon $created_at
 * @property \Carbon\Carbon $updated_at
 * @property \Carbon\Carbon $deleted_at
 * @property integer $created_user_id
 * @property integer $updated_user_id
 * @property integer $schema_id
 * @property string $name
 * @property string $label
 * @property string $definition
 * @property string $comment
 * @property string $type
 * @property integer $is_subproperty_of
 * @property string $parent_uri
 * @property string $uri
 * @property integer $status_id
 * @property string $language
 * @property string $note
 * @property string $domain
 * @property string $orange
 * @property boolean $is_deprecated Boolean. Has this class/property been deprecated
 * @property string $url
 * @property string $lexical_alias
 * @property-read \App\Models\User $UserCreator
 * @property-read \App\Models\User $UserUpdater
 * @property-read \App\Models\ElementSet $ElementSet
 * @property-read \App\Models\Element $ParentElement
 * @property-read \App\Models\Status $Status
 * @property-read \Illuminate\Database\Eloquent\Collection|\App\Models\Discuss[] $Discussions
 * @property-read \Illuminate\Database\Eloquent\Collection|\App\Models\ElementProperty[] $ElementProperties
 * @property-read \Illuminate\Database\Eloquent\Collection|\App\Models\ElementProperty[] $RelatedElementProperties
 * @property-read \Illuminate\Database\Eloquent\Collection|\App\Models\ElementPropertyHistory[] $ElementPropertyHistories
 * @property-read \Illuminate\Database\Eloquent\Collection|\App\Models\ElementPropertyHistory[] $RelatedElementPropertyHistories
 * @method static \Illuminate\Database\Query\Builder|\App\Models\Element whereId($value)
 * @method static \Illuminate\Database\Query\Builder|\App\Models\Element whereCreatedAt($value)
 * @method static \Illuminate\Database\Query\Builder|\App\Models\Element whereUpdatedAt($value)
 * @method static \Illuminate\Database\Query\Builder|\App\Models\Element whereDeletedAt($value)
 * @method static \Illuminate\Database\Query\Builder|\App\Models\Element whereCreatedUserId($value)
 * @method static \Illuminate\Database\Query\Builder|\App\Models\Element whereUpdatedUserId($value)
 * @method static \Illuminate\Database\Query\Builder|\App\Models\Element whereSchemaId($value)
 * @method static \Illuminate\Database\Query\Builder|\App\Models\Element whereName($value)
 * @method static \Illuminate\Database\Query\Builder|\App\Models\Element whereLabel($value)
 * @method static \Illuminate\Database\Query\Builder|\App\Models\Element whereDefinition($value)
 * @method static \Illuminate\Database\Query\Builder|\App\Models\Element whereComment($value)
 * @method static \Illuminate\Database\Query\Builder|\App\Models\Element whereType($value)
 * @method static \Illuminate\Database\Query\Builder|\App\Models\Element whereIsSubpropertyOf($value)
 * @method static \Illuminate\Database\Query\Builder|\App\Models\Element whereParentUri($value)
 * @method static \Illuminate\Database\Query\Builder|\App\Models\Element whereUri($value)
 * @method static \Illuminate\Database\Query\Builder|\App\Models\Element whereStatusId($value)
 * @method static \Illuminate\Database\Query\Builder|\App\Models\Element whereLanguage($value)
 * @method static \Illuminate\Database\Query\Builder|\App\Models\Element whereNote($value)
 * @method static \Illuminate\Database\Query\Builder|\App\Models\Element whereDomain($value)
 * @method static \Illuminate\Database\Query\Builder|\App\Models\Element whereOrange($value)
 * @method static \Illuminate\Database\Query\Builder|\App\Models\Element whereIsDeprecated($value)
 * @method static \Illuminate\Database\Query\Builder|\App\Models\Element whereUrl($value)
 * @method static \Illuminate\Database\Query\Builder|\App\Models\Element whereLexicalAlias($value)
 */
class Element extends Model
{
    use SoftDeletes;

    protected $table = 'reg_schema_property';

    protected $dates = ['deleted_at'];

    protected $fillable = array('deleted_at', 'name', 'label', 'definition', 'comment', 'type', 'parent_uri', 'uri',
        'language', 'note', 'domain', 'orange', 'is_deprecated', 'url', 'lexical_alias');

    /**
     * The attributes that should be casted to native types.
     *
     * @var array
     */
    protected $casts = [
        "id" => "integer",
        "created_user_id" => "integer",
        "updated_user_id" => "integer",
        "schema_id" => "integer",
        "name" => "string",
        "label" => "string",
        "definition" => "string",
        "comment" => "string",
        "type" => "string",
        "is_subproperty_of" => "integer",
        "parent_uri" => "string",
        "uri" => "string",
        "status_id" => "integer",
        "language" => "string",
        "note" => "string",
        "domain" => "string",
        "orange" => "string",
        "is_deprecated" => "boolean",
        "url" => "string",
        "lexical_alias" => "string"
    ];

    public static $rules = [

    ];

    public function UserCreator()
    {
        return $this->belongsTo('App\Models\User', 'created_user_id', 'id');
    }

    public function UserUpdater()
    {
        return $this->belongsTo('App\Models\User', 'updated_user_id', 'id');
    }

    public function ElementSet()
    {
        return $this->belongsTo('App\Models\ElementSet', 'schema_id', 'id');
    }

    public function ParentElement()
    {
        return $this->belongsTo('App\Models\Element', 'is_subproperty_of', 'id');
    }

    public function Status()
    {
        return $this->belongsTo('App\Models\Status', 'status_id', 'id');
    }

    public function Discussions()
    {
        return $this->hasMany('App\Models\Discuss', 'schema_property_id', 'id');
    }

    public function ElementProperties()
    {
        return $this->hasMany('App\Models\ElementProperty', 'schema_property_id', 'id');
    }

    public function RelatedElementProperties()
    {
        return $this->hasMany('App\Models\ElementProperty', 'related_schema_property_id', 'id');
    }

    public function ElementPropertyHistories()
    {
        return $this->hasMany('App\Models\ElementPropertyHistory', 'schema_property_id', 'id');
    }

    public function RelatedElementPropertyHistories()
    {
        return $this->hasMany('App\Models\ElementPropertyHistory', 'related_schema_property_id', 'id');
    }

}


text:
layout: home
title: Borislav Stanimirov
stylesheet: homepage
---