text:
const scope         = require('./scope');
const events        = require('./utils/events');
const browser       = require('./utils/browser');
const iFinder       = require('./utils/interactionFinder');
const pointerEvents = require('./pointerEvents/base');

const { window } = require('./utils/window');

const toString = Object.prototype.toString;

if (!window.Array.isArray) {
  window.Array.isArray = function (obj) {
    return toString.call(obj) === '[object Array]';
  };
}

if (!String.prototype.trim) {
  String.prototype.trim = function () {
    return this.replace(/^[\s\uFEFF\xA0]+|[\s\uFEFF\xA0]+$/g, '');
  };
}

// http://www.quirksmode.org/dom/events/click.html
// >Events leading to dblclick
//
// IE8 doesn't fire down event before dblclick.
// This workaround tries to fire a tap and doubletap after dblclick
function onIE8Dblclick (event) {
  const eventTarget = event.target;
  const interaction = iFinder.search(event, event.type, eventTarget);

  if (!interaction) { return; }

  if (interaction.prevTap
      && event.clientX === interaction.prevTap.clientX
      && event.clientY === interaction.prevTap.clientY
      && eventTarget   === interaction.prevTap.target) {

    interaction.downTargets[0] = eventTarget;
    interaction.downTimes  [0] = new Date().getTime();

    pointerEvents.fire({
      interaction,
      event,
      eventTarget,
      pointer: event,
      type: 'tap',
    });
  }
}

if (browser.isIE8) {
  const selectFix = function (event) {
    for (const interaction of scope.interactions) {
      if (interaction.interacting()) {
        interaction.target.checkAndPreventDefault(event);
      }
    }
  };

  const onDocIE8 = function onDocIE8 ({ doc, win }, signalName) {
    const eventMethod = signalName.indexOf('listen') === 0
      ? events.add : events.remove;

    // For IE's lack of Event#preventDefault
    eventMethod(doc, 'selectstart', selectFix);

    if (pointerEvents) {
      eventMethod(doc, 'dblclick', onIE8Dblclick);
    }
  };

  scope.signals.on('add-document'   , onDocIE8);
  scope.signals.on('remove-document', onDocIE8);
}

module.exports = null;

redpajama_set_name: RedPajamaGithub


text:
<?php

namespace app\models;

use yii\db\ActiveRecord;

class Category extends ActiveRecord
{
    const TYPE_ENTRY = 'entry';
    const TYPE_CATEGORY = 'category';

    /**
     * Prepare data for frontend controller
     * @return array
     */
    public static function getPreparedJsonEntries()
    {
        $entries = Entry::find()->orderBy('name')->asArray()->all();
        $categories = Category::find()->orderBy('name')->asArray()->all();

        // Sort entries
        $sortedEntries = [];
        foreach ($entries as $k=>$e) {
            $e['type'] = self::TYPE_ENTRY;
            $sortedEntries[$e['category']][] = $e;
        }

        return static::recursiveTree($categories, $sortedEntries);
    }

    /**
     * Recursive method to build tree structure
     * @param array $elements
     * @param array $entries
     * @param int $parentId
     * @return array
     */
    private static function recursiveTree(array $elements, array $entries, $parentId = 0) {
        $new = [];
        foreach($elements as $element) {
            if($element['subcategory'] == $parentId) {
                $element['type'] = self::TYPE_CATEGORY;
                $children = self::recursiveTree($elements, $entries, $element['id']);
                $element['items'] = [];
                if($children) {
                    $element['items'] = $children;
                }
                if(isset($entries[$element['id']])) {
                    $element['items'] = array_merge($entries[$element['id']], $element['items']);
                }
                $new[] = $element;
            }
        }
        return $new;
    }
}


text:
Title: Scroll with ThinkPad's trackpoint in Fedora
Summary: Change the behavior of ThinkPad's middle touchpad button in Fedora to facilitate scrolling.
Tags: Fedora, ThinkPad, T450, Linux, laptop, scroll, trackpoint

I [installed a T450 touchpad in my
T440]({filename}/blog/2015-03-22-t450-touchpad-on-t440-upgrade.md), and it works
great in [Fedora with Kernel
4.0]({filename}/blog/2015-03-24-get-the-t450-touchpad-to-work-on-fedora.md).

However, [I
found](http://www.reddit.com/r/thinkpad/comments/3064vb/is_it_possible_to_scroll_using_only_the/)
that it is possible to change so holding down the middle touchpad button while
pushing the trackpoint facilitates scrolling. By default the middle touchpad
button behaves just as a regular mouse's scroll wheel button, which is not as
functional.

Achieving the former behavior on Fedora in X is [explained on
Thinkwiki](http://www.thinkwiki.org/wiki/How_to_configure_the_TrackPoint#xorg.conf.d).
Basically you only have to create the file
`/etc/X11/xorg.conf.d/20-thinkpad.conf` with the following content:

    Section "InputClass"
      Identifier	"Trackpoint Wheel Emulation"
      MatchProduct	"TPPS/2 IBM TrackPoint|DualPoint Stick|Synaptics Inc. Composite TouchPad / TrackPoint|ThinkPad USB Keyboard with TrackPoint|USB Trackpoint pointing device|Composite TouchPad / TrackPoint"
      MatchDevicePath	"/dev/input/event*"
      Option		"EmulateWheel"		"true"
      Option		"EmulateWheelButton"	"2"
      Option		"Emulate3Buttons"	"false"
      Option		"XAxisMapping"		"6 7"
      Option		"YAxisMapping"		"4 5"
    EndSection

What is especially great with this solution is that pasting from the [X window
selection clipboard](http://en.wikipedia.org/wiki/X_Window_selection) still
works by clicking the middle touchpad button; while holding it down instead
triggers the scrolling behavior.

The problem though is that resizing windows in Gnome Shell is, in one way, done
by holding down the super key, *the scroll button* and moving the cursor at the
same time. This is shown in the following picture:

This obviously collides with the edited middle touchpad button behavior. I
explained on
[ask.fedoraproject.org](https://ask.fedoraproject.org/en/question/66163/resize-windows-with-super-right-click-instead-of-super-middle-click/)
how one can change the resizing from using the middle mouse button to the right
mouse button instead, which then works great on a ThinkPad. To summarize the
steps you have to do:

1. Install Gnome Tweak Tool: `$ sudo dnf install gnome-tweak-tool`
2. Open Tweak Tool and go to the page *Windows*.
3. Toggle on *Resize with Secondary-click*.


text:
function online_bhvana(data)
% Eyelid trace is saved to memory (trials and metadata) even in no-save trial.

metadata=getappdata(0,'metadata');
trials=getappdata(0,'trials');
if isfield(trials,'eye'), if length(trials.eye)>metadata.eye.trialnum2+1, trials.eye=[]; end, end
if metadata.eye.trialnum2==1, trials.eye=[]; end

% ------ eyelid trace, which will be saved to 'trials' ----
[trace,time]=vid2eyetrace(data,metadata,metadata.cam.thresh);
trace=(trace-metadata.cam.calib_offset)/metadata.cam.calib_scale;

trials.eye(metadata.eye.trialnum2).time=time*1e3;
trials.eye(metadata.eye.trialnum2).trace=trace;
trials.eye(metadata.eye.trialnum2).stimtype=lower(metadata.stim.type);
trials.eye(metadata.eye.trialnum2).isi=NaN;

trials.eye(metadata.eye.trialnum2).stimtime.st{1}=0; % for CS
trials.eye(metadata.eye.trialnum2).stimtime.en{1}=metadata.stim.c.csdur;
trials.eye(metadata.eye.trialnum2).stimtime.cchan(1)=3;
trials.eye(metadata.eye.trialnum2).stimtime.st{2}=metadata.stim.c.isi;
trials.eye(metadata.eye.trialnum2).stimtime.en{2}=metadata.stim.c.usdur; % for US
trials.eye(metadata.eye.trialnum2).stimtime.cchan(2)=2;
trials.eye(metadata.eye.trialnum2).isi=metadata.stim.c.isi;

% --- this may be useful for offline analysis ----
metadata.eye.ts0=time(1)*1e3;
metadata.eye.ts_interval=mode(diff(time*1e3));
metadata.eye.trace=trace;

% --- save results to memory ----
setappdata(0,'trials',trials);
setappdata(0,'metadata',metadata);


text:
namespace PokerTell.LiveTracker.Interfaces
{
    using System.Collections.Generic;
    using System.Windows;

    using Tools.WPF.Interfaces;

    public interface IPlayerStatusViewModel
    {
        bool IsPresent { get; set; }

        IHarringtonMViewModel HarringtonM { get; }

        IOverlayHoleCardsViewModel HoleCards { get; }

        IPlayerStatusViewModel ShowHoleCardsFor(int duration, string holecards);

        IPlayerStatusViewModel InitializeWith(IPositionViewModel holeCardsPosition, IPositionViewModel harringtonMPosition);
    }
}


text:
<?php

namespace Mos\HTMLForm;

/**
 * Example of CFormModel implementation.
 *
 */
class CFMCheckboxMultiple extends \Mos\HTMLForm\CFormModel
{
    /**
     * Constructor
     *
     */
    public function __construct()
    {
        parent::__construct(
            [
                "id" => __CLASS__,
            ],
            [
                "items" => [
                    "type"        => "checkbox-multiple",
                    "values"      => ["tomato", "potato", "apple", "pear", "banana"],
                    "checked"     => ["potato", "pear"],
                ],
                "submit" => [
                    "type"      => "submit",
                    "callback"  => [$this, "callbackSubmit"],
                ],
                "submit-fail" => [
                    "type"      => "submit",
                    "callback"  => [$this, "callbackSubmitFail"],
                ],
            ]
        );
    }

    /**
     * Callback for submit-button.
     *
     */
    public function callbackSubmit()
    {
        $this->AddOutput("
#callbackSubmit()
");

        // Get the selected items as an array
        $items = $this->value("items");
        $itemsAsString = implode(", ", $items);
        $this->AddOutput("
Selected items are: '$itemsAsString'.");

        $this->AddOutput("
" . print_r($_POST, 1) . "
");
        $this->AddOutput("
" . print_r($this["items"], 1) . "
");
        $this->saveInSession = true;

        return true;
    }

    /**
     * Callback for submit-button.
     *
     */
    public function callbackSubmitFail()
    {
        $this->AddOutput("
#callbackSubmitFail()
");
        $this->AddOutput("
Form was submitted but I failed to process/save/validate it
");
        return false;
    }
}


text:
le-auth-provider-firebase
=========

**Connect le-auth-service to Firebase**

## Installation

  `npm install le-auth-provider-firebase`

## Usage

```
  var mandrillAPIKey = /* your api key */
  var EmailProvider = require('le-email-provider-mandrill');
  var provider = new EmailProvider(mandrillAPIKey);
```

## Tests

* `npm test` to run unit tests once
* `gulp tdd` to run unit and e2e tests when tests change
* `gulp coverage` to run unit tests and create a code coverage report

## Contributing

Please follow the project's [conventions](https://github.com/castle-dev/le-auth-provider-firebase/blob/develop/CONTRIBUTING.md) or your changes will not be accepted

## Release History

* 0.1.0 Initial release


text:
/**
 * DataTables has a built in type called 'html' which will strip HTML tags
 * from a search string, but it doesn't cope with nested HTML inside another
 * element's attributes (for example DOM0 events with have HTML in them). This
 * plug-in function overrules the built-in method and provides complete HTML
 * tag removal. Note that this function is not included in DataTables by
 * default because it is slightly slower than the built-in method, which is
 * good enough for by far the majority of use cases.
 *  @name html
 *  @anchor html_column
 *  @author <i>guillimon</i>
 *
 *  @example
 *    $(document).ready(function() {
 *        var oTable = $('#example').dataTable({
 *            "aoColumns": [
 *                "sType": "html",
 *                null
 *            ]
 *        });
 *    } );
 */

jQuery.fn.dataTableExt.ofnSearch['html'] = function ( sData ) {
	var n = document.createElement('div');
	n.innerHTML = sData;
	if ( n.textContent ) {
		return n.textContent.replace(/\n/g," ");
	} else {
		return n.innerText.replace(/\n/g," ");
	}
};


text:
package org.springframework.boot.docs.data.nosql.ldap.repositories;

class User {

}


text:
title: covid-watch2
articlename: >-
  Remote Monitoring of Patients with Covid-19: Design, implementation, and
  outcomes of the first 3,000 patients in COVID Watch
date: '2020-07-21'
summary: >-
  An innovation team at the University of Pennsylvania Health System
  demonstrates how an automated text-messaging system can remotely monitor
  patients with confirmed or suspected Covid-19 at home and quickly support
  worsening patients with human care.
authors: 'Anna U. Morgan, MD, MSc, MSHP, Mohan Balachandran, MA, MS, David Do, MD, Doreen Lam, BA, Andrew Parambath, BA, MEd, Krisda H. Chaiyachati, MD, MPH, MSHP, Nancy M. Bonalumi, DNP, RN, CEN, FAEN, Susan C. Day, MD, MPH, Kathleen C. Lee, MD & David A. Asch, MD, MBA'
source: 'https://catalyst.nejm.org/doi/full/10.1056/CAT.20.0342'
journal: NEJM CAT
---


text:
using static Lucene.Net.Search.Similarities.SimilarityBase;

namespace Lucene.Net.Search.Similarities
{

    ///
    /// An approximation of the I(ne) model.
    /// <para/>
    /// @lucene.experimental
    ///
    public class BasicModelIF : BasicModel
    {
        ///
        /// Sole constructor: parameter-free
        public BasicModelIF()
        {
        }

        public override sealed float Score(BasicStats stats, float tfn)
        {
            long N = stats.NumberOfDocuments;
            long F = stats.TotalTermFreq;
            return tfn * (float)(Log2(1 + (N + 1) / (F + 0.5)));
        }

        public override string ToString()
        {
            return "I(F)";
        }
    }
}


text:
Write a program that cleans up user-entered phone numbers so that they can be sent SMS messages.

The rules are as follows:

- If the phone number is less than 10 digits assume that it is bad
  number
- If the phone number is 10 digits assume that it is good
- If the phone number is 11 digits and the first number is 1, trim the 1
  and use the last 10 digits
- If the phone number is 11 digits and the first number is not 1, then
  it is a bad number
- If the phone number is more than 11 digits assume that it is a bad
  number

We've provided tests, now make them pass.

Hint: Only make one test pass at a time. Disable the others, then flip
each on in turn after you get the current failing one to pass.

* * * *

For installation and learning resources, refer to the
[exercism help page](http://exercism.io/languages/ruby).

For running the tests provided, you will need the Minitest gem. Open a
terminal window and run the following command to install minitest:

    gem install minitest

If you would like color output, you can `require 'minitest/pride'` in
the test file, or note the alternative instruction, below, for running
the test file.

In order to run the test, you can run the test file from the exercise
directory. For example, if the test suite is called
`hello_world_test.rb`, you can run the following command:

    ruby hello_world_test.rb

To include color from the command line:

    ruby -rminitest/pride hello_world_test.rb

The test files may have the execution bit set so you may also be able to
run it like this:

    ./hello_world_test.rb

## Source

Event Manager by JumpstartLab [view source](http://tutorials.jumpstartlab.com/projects/eventmanager.html)


text:
#include <vector>
#include <algorithm>
#include <iostream>
#include <boost/spirit/include/phoenix1_operators.hpp>
#include <boost/spirit/include/phoenix1_primitives.hpp>
#include <boost/spirit/include/phoenix1_statements.hpp>
#include <boost/spirit/include/phoenix1_special_ops.hpp>

using namespace std;
using namespace phoenix;

int
main()
{
    int init[] = { 2, 10, 4, 5, 1, 6, 8, 3, 9, 7 };
    vector<int> c(init, init + 10);
    typedef vector<int>::iterator iterator;

    //  Print all odd contents of an stl container c
    for_each(c.begin(), c.end(),
        if_(arg1 % 2 == 1)
        [
            cout << arg1 << ' '
        ]
    );

    return 0;
}


text:
function nB = getNBatch( obj )
% GETNBATCH  Get number of batches in nlsaSymmetricDistance_batch object
%
% Modified  2014/05/01

nB = getNBatch( getPartition( obj ) );


text:
#include <linux/i2c.h>
#include <linux/slab.h>
#include <linux/irq.h>
#include <linux/interrupt.h>
#include <linux/delay.h>
#include <linux/version.h>
#include <linux/gpio.h>
#include <linux/clk.h>
#include <linux/regulator/consumer.h>
#include <linux/videodev2.h>
#include <linux/videodev2_exynos_camera.h>
#include <linux/module.h>
#include <linux/moduleparam.h>
#include <linux/platform_device.h>
#ifdef CONFIG_OF
#include <linux/of_gpio.h>
#endif
#include <media/v4l2-ctrls.h>
#include <media/v4l2-device.h>
#include <media/v4l2-subdev.h>
#include <mach/exynos-fimc-is-sensor.h>

#include "fimc-is-hw.h"
#include "fimc-is-core.h"
#include "fimc-is-device-sensor.h"
#include "fimc-is-resourcemgr.h"
#include "fimc-is-device-4e5.h"

#define SENSOR_NAME "S5K4E5"

static int sensor_4e5_init(struct v4l2_subdev *subdev, u32 val)
{
	int ret = 0;
	struct fimc_is_module_enum *module;

	BUG_ON(!subdev);

	module = (struct fimc_is_module_enum *)v4l2_get_subdevdata(subdev);

	pr_info("[MOD:D:%d] %s(%d)\n", module->id, __func__, val);

	return ret;
}

static const struct v4l2_subdev_core_ops core_ops = {
	.init = sensor_4e5_init
};

static const struct v4l2_subdev_ops subdev_ops = {
	.core = &core_ops
};

int sensor_4e5_probe(struct i2c_client *client,
	const struct i2c_device_id *id)
{
	int ret = 0;
	struct fimc_is_core *core;
	struct v4l2_subdev *subdev_module;
	struct fimc_is_module_enum *module;
	struct fimc_is_device_sensor *device;
	struct sensor_open_extended *ext;

	BUG_ON(!fimc_is_dev);

	core = (struct fimc_is_core *)dev_get_drvdata(fimc_is_dev);
	if (!core) {
		probe_err("core device is not yet probed");
		return -EPROBE_DEFER;
	}

	device = &core->sensor[SENSOR_S5K4E5_INSTANCE];

	subdev_module = kzalloc(sizeof(struct v4l2_subdev), GFP_KERNEL);
	if (!subdev_module) {
		err("subdev_module is NULL");
		ret = -ENOMEM;
		goto p_err;
	}

	module = &device->module_enum[atomic_read(&core->resourcemgr.rsccount_module)];
	atomic_inc(&core->resourcemgr.rsccount_module);
	clear_bit(FIMC_IS_MODULE_GPIO_ON, &module->state);
	module->sensor_id = SENSOR_NAME_S5K4E5;
	module->subdev = subdev_module;
	module->device = SENSOR_S5K4E5_INSTANCE;
	module->client = client;
	module->pixel_width = 2560 + 16;
	module->pixel_height = 1920 + 10;
	module->active_width = 2560;
	module->active_height = 1920;
	module->max_framerate = 30;
	module->position = SENSOR_POSITION_REAR;
	module->mode = CSI_MODE_CH0_ONLY;
	module->lanes = CSI_DATA_LANES_4;
	module->sensor_maker = "SLSI";
	module->sensor_name = "S5K4E5";
	module->setfile_name = "setfile_4e5.bin";
	module->cfgs = 0;
	module->cfg = NULL;
	module->ops = NULL;
	module->private_data = NULL;

	ext = &module->ext;
	ext->mipi_lane_num = module->lanes;
	ext->I2CSclk = I2C_L0;

	ext->sensor_con.product_name = 0;

	ext->actuator_con.product_name = ACTUATOR_NAME_DWXXXX;
	ext->actuator_con.peri_type = SE_I2C;
	ext->actuator_con.peri_setting.i2c.channel = SENSOR_CONTROL_I2C1;

	ext->flash_con.product_name = FLADRV_NAME_KTD267;
	ext->flash_con.peri_type = SE_GPIO;
	ext->flash_con.peri_setting.gpio.first_gpio_port_no = 17;
	ext->flash_con.peri_setting.gpio.second_gpio_port_no = 16;

	ext->from_con.product_name = FROMDRV_NAME_NOTHING;

	ext->companion_con.product_name = COMPANION_NAME_NOTHING;

	if (client) {
		v4l2_i2c_subdev_init(subdev_module, client, &subdev_ops);
	} else {
		v4l2_subdev_init(subdev_module, &subdev_ops);
	}

	v4l2_set_subdevdata(subdev_module, module);
	v4l2_set_subdev_hostdata(subdev_module, device);
	snprintf(subdev_module->name, V4L2_SUBDEV_NAME_SIZE, "sensor-subdev.%d", module->id);

p_err:
	probe_info("%s(%d)\n", __func__, ret);
	return ret;
}


text:
using System.Collections.Generic;

namespace WinHomeMeal
{
    public class Dish
    {
        public int Id { get; set; }
        public string Name { get; set; }
        public int CategoryId { get; set; }
        public virtual Category Category { get; set; }
        public virtual List<Ingredient> Ingredients { get; set; }
        public virtual List<DishImage> DishImages { get; set; }

    }

    public class DishImage
    {
        public int Id { get; set; }
        public int DishId { get;  set; }
        public byte[] Image { get; set; }
        public virtual Dish Dish { get; set; }

    }

}


text:
from django.core.mail import EmailMultiAlternatives
from django.template.loader import render_to_string
from django.utils.html import strip_tags
from django.db import models

TEMPLATE_CHOICES = (
    ('emails/default_email.html', 'Generic'),
)

# Create your models here.
class Email(models.Model):
    subject = models.CharField(max_length=255)
    from_email = models.CharField(max_length=255)
    to_email = models.CharField(max_length=255, blank=True)
    template = models.CharField(max_length=255, choices=TEMPLATE_CHOICES, default='emails/default_email.html')

    class Meta:
        abstract = True

    def send(self, context):
        html = render_to_string(self.template, context)
        text = strip_tags(html)
        msg = EmailMultiAlternatives(self.subject, text, self.from_email, [self.to_email])
        msg.attach_alternative(html, "text/html")
        msg.send()
        return

class DefaultEmail(Email):
    from_email = "default@example.com"

    def save(self):
        context = {'text': 'HelloWorld'}
        self.send(context)
        super(DefaultEmail, self).save()

    def __str__(self):
        return self.to_email

# Create custom Email models here.


text:
package org.faudroids.doublestacks.google;

import java.io.Serializable;

/**
 * Something which can send messages!
 */
public interface MessageSender {

	void sendMessage(Serializable data, boolean reliable);

}


text:
.TinyTools.ToggleSwitch {
	display: inline-block;
	font-size: 11px;
	font-weight: bold;
	border: 1px solid #888;
	border-radius: 3px;
	overflow: hidden;
	color: #eee;
	position: relative;
	-moz-box-sizing: border-box;
	-webkit-box-sizing: border-box;
	box-sizing: border-box;
	cursor: pointer;
}

	.TinyTools.ToggleSwitch .NubWrapper {
		height: 100%;
		width: 100%;
		position: absolute;
		left: 0;
		top: 0;
		-moz-transition: opacity 1s;
		-o-transition: opacity 1s;
		-webkit-transition: opacity 1s;
		transition: opacity 1s;
	}

		.TinyTools.ToggleSwitch .NubWrapper.Disabled {
			opacity: .5;
		}

		.TinyTools.ToggleSwitch .NubWrapper > * {
			-moz-transition: left .5s ease-in-out, right .5s ease-in-out;
			-o-transition: left .5s ease-in-out, right .5s ease-in-out;
			-webkit-transition: left .5s ease-in-out, right .5s ease-in-out;
			transition: left .5s ease-in-out, right .5s ease-in-out;
		}

		.TinyTools.ToggleSwitch .NubWrapper .OnSide,
		.TinyTools.ToggleSwitch .NubWrapper .OffSide,
		.TinyTools.ToggleSwitch .NubWrapper .Nub {
			display: table;
			vertical-align: middle;
			width: 50%;
			height: 100%;
			text-align: center;
			position: absolute;
			top: 0;
		}

		.TinyTools.ToggleSwitch .NubWrapper .OnSide {
			right: -50%;
			background: #590032;
			background: -moz-linear-gradient(top, #590032 0%, #980061 100%); /* FF3.6+ */
			background: -webkit-gradient(linear, left top, left bottom, color-stop(0%,#590032), color-stop(100%,#980061)); /* Chrome,Safari4+ */
			background: -webkit-linear-gradient(top, #590032 0%,#980061 100%); /* Chrome10+,Safari5.1+ */
			background: -o-linear-gradient(top, #590032 0%,#980061 100%); /* Opera 11.10+ */
			background: -ms-linear-gradient(top, #590032 0%,#980061 100%); /* IE10+ */
			background: linear-gradient(to bottom, #590032 0%,#980061 100%); /* W3C */
		}

		.TinyTools.ToggleSwitch .NubWrapper .OffSide {
			left: 0;
			background: #666;
			background: -moz-linear-gradient(top, #666 0%, #999 100%); /* FF3.6+ */
			background: -webkit-gradient(linear, left top, left bottom, color-stop(0%,#666), color-stop(100%,#999)); /* Chrome,Safari4+ */
			background: -webkit-linear-gradient(top, #666 0%,#999 100%); /* Chrome10+,Safari5.1+ */
			background: -o-linear-gradient(top, #666 0%,#999 100%); /* Opera 11.10+ */
			background: -ms-linear-gradient(top, #666 0%,#999 100%); /* IE10+ */
			background: linear-gradient(to bottom, #666 0%,#999 100%); /* W3C */
		}

			.TinyTools.ToggleSwitch .NubWrapper .OnSide span,
			.TinyTools.ToggleSwitch .NubWrapper .OffSide span {
				display: table-cell;
				vertical-align: middle;
			}

		.TinyTools.ToggleSwitch .NubWrapper .Nub {
			left: 50%;
			background: #eee;
			background: -moz-linear-gradient(top, #fff 0%, #eee 100%); /* FF3.6+ */
			background: -webkit-gradient(linear, left top, left bottom, color-stop(0%,#fff), color-stop(100%,#eee)); /* Chrome,Safari4+ */
			background: -webkit-linear-gradient(top, #fff 0%,#eee 100%); /* Chrome10+,Safari5.1+ */
			background: -o-linear-gradient(top, #fff 0%,#eee 100%); /* Opera 11.10+ */
			background: -ms-linear-gradient(top, #fff 0%,#eee 100%); /* IE10+ */
			background: linear-gradient(to bottom, #fff 0%,#eee 100%); /* W3C */
		}

		.TinyTools.ToggleSwitch .NubWrapper.Checked .OnSide {
			right: 0;
		}

		.TinyTools.ToggleSwitch .NubWrapper.Checked .OffSide {
			left: -50%;
		}

		.TinyTools.ToggleSwitch .NubWrapper.Checked .Nub {
			left: 0;
		}


text:
/*
 * Add the location object to the scope
 */
define([], function() {
  return function($rootScope, $location) {
    $rootScope.location = $location;
  };
});


text:
using System;
using System.Collections.Generic;
using Umbraco.Core.Models;
using Umbraco.Web;
using System.Web;
using System.Linq;
using System.ComponentModel.DataAnnotations;
using ConcreteContentTypes.Core.Models;
using ConcreteContentTypes.Core.Interfaces;
using Newtonsoft.Json;

using System;
using GlobalManifesto.Products.Models.Media;
using Umbraco.Examine.Linq.Attributes;
using ConcreteContentTypes.Core.Extensions;

namespace GlobalManifesto.Products.Models.Content
{
	 [NodeTypeAlias("Product")]
 	public partial class Product : UmbracoContent
	{
		public override string ContentTypeAlias { get { return "Product"; } }

		private IPublishedContent _image = null;
		public IPublishedContent Image
		{
			get
			{
				if (_image == null)
				{
					int? contentId = Content.GetPropertyValue<int?>("image", this.GetPropertiesRecursively);

					if (contentId.HasValue)
					{

						_image = UmbracoContext.Current.MediaCache.GetById(contentId.Value);

					}
				}
				return _image;
			}
		}

		private IEnumerable<IPublishedContent> _children = null;
		[JsonIgnore]
		public IEnumerable<IPublishedContent> Children
		{
			get
			{
				if (_children == null && this.Content != null)
					_children = this.Content.Children;

				return _children;
			}
		}

		public Product()
			: base()
		{
		}

		public Product(string name, IConcreteModel parent)
			: this(name, parent.Id)
		{
		}

		public Product(string name, int parentId)
			: base()
		{
			this.Name = name;
			this.ParentId = parentId;
		}

		public Product(int contentId, bool getPropertiesRecursively = false)
			: base(contentId, getPropertiesRecursively)
		{
		}

		public Product(IPublishedContent content, bool getPropertiesRecursively = false)
			: base(content, getPropertiesRecursively)
		{
		}

		public override void Init(IPublishedContent content)
		{
			base.Init(content);

		}

	}
}


text:
using System;
using Microsoft.Win32.SafeHandles;

namespace Whathecode.Interop
{
	/// <summary>
	///   A wrapper class for a token handle.
	/// </summary>
	public sealed class SafeTokenHandle : SafeHandleZeroOrMinusOneIsInvalid
	{
		public SafeTokenHandle()
			: base( true ) {}

		public SafeTokenHandle( IntPtr handle )
			: base( true )
		{
			SetHandle( handle );
		}

		protected override bool ReleaseHandle()
		{
			return Kernel32.CloseHandle( handle );
		}
	}
}


text:
<?php namespace Fisharebest\Localization\Language;

use Fisharebest\Localization\PluralRule\PluralRuleOneTwoOther;
use Fisharebest\Localization\Territory\TerritorySe;

class LanguageSmj extends AbstractLanguage implements LanguageInterface {
	public function code() {
		return 'smj';
	}

	public function defaultTerritory() {
		return new TerritorySe;
	}

	public function pluralRule() {
		return new PluralRuleOneTwoOther;
	}
}


text:
from datetime import datetime

from django.conf import settings
from django.core.urlresolvers import reverse

from onadata.apps.main.views import delete_data
from onadata.apps.viewer.models.parsed_instance import ParsedInstance
from onadata.apps.logger.models.instance import Instance
from onadata.libs.utils import common_tags
from test_base import TestBase

class TestFormAPIDelete(TestBase):

    def setUp(self):
        TestBase.setUp(self)
        self._create_user_and_login()
        self._publish_transportation_form_and_submit_instance()
        self.delete_url = reverse(delete_data, kwargs={
            'username': self.user.username,
            'id_string': self.xform.id_string
        })
        self.mongo_args = {
            'username': self.user.username, 'id_string': self.xform.id_string,
            'query': "{}", 'limit': 1,
            'sort': '{"_id":-1}', 'fields': '["_id","_uuid"]'}

    def _get_data(self):
        cursor = ParsedInstance.query_mongo(**self.mongo_args)
        records = list(record for record in cursor)
        return records

    def test_get_request_does_not_delete(self):
        # not allowed 405
        count = Instance.objects.filter(deleted_at=None).count()
        response = self.anon.get(self.delete_url)
        self.assertEqual(response.status_code, 405)
        self.assertEqual(
            Instance.objects.filter(deleted_at=None).count(), count)

    def test_anon_user_cant_delete(self):
        # Only authenticated user are allowed to access the url
        count = Instance.objects.filter(deleted_at=None).count()
        instance = Instance.objects.filter(
            xform=self.xform).latest('date_created')
        # delete
        params = {'id': instance.id}
        response = self.anon.post(self.delete_url, params)
        self.assertEqual(response.status_code, 302)
        self.assertIn("accounts/login/?next=", response["Location"])
        self.assertEqual(
            Instance.objects.filter(deleted_at=None).count(), count)

    def test_delete_shared(self):
        #Test if someone can delete data from a shared form
        self.xform.shared = True
        self.xform.save()
        self._create_user_and_login("jo")
        count = Instance.objects.filter(deleted_at=None).count()
        instance = Instance.objects.filter(
            xform=self.xform).latest('date_created')
        # delete
        params = {'id': instance.id}
        response = self.client.post(self.delete_url, params)
        self.assertEqual(response.status_code, 403)
        self.assertEqual(
            Instance.objects.filter(deleted_at=None).count(), count)

    def test_owner_can_delete(self):
        #Test if Form owner can delete
        #check record exist before delete and after delete
        count = Instance.objects.filter(deleted_at=None).count()
        instance = Instance.objects.filter(
            xform=self.xform).latest('date_created')
        self.assertEqual(instance.deleted_at, None)
        # delete
        params = {'id': instance.id}
        response = self.client.post(self.delete_url, params)
        self.assertEqual(response.status_code, 200)
        self.assertEqual(
            Instance.objects.filter(deleted_at=None).count(), count - 1)
        instance = Instance.objects.get(id=instance.id)
        self.assertTrue(isinstance(instance.deleted_at, datetime))
        self.assertNotEqual(instance.deleted_at, None)
        query = '{"_id": %s}' % instance.id
        self.mongo_args.update({"query": query})
        #check that query_mongo will not return the deleted record
        after = ParsedInstance.query_mongo(**self.mongo_args)
        self.assertEqual(len(after), count - 1)

    def test_delete_updates_mongo(self):
        count = Instance.objects.filter(
            xform=self.xform, deleted_at=None).count()
        instance = Instance.objects.filter(
            xform=self.xform).latest('date_created')
        # delete
        params = {'id': instance.id}
        response = self.client.post(self.delete_url, params)
        self.assertEqual(response.status_code, 200)
        self.assertEqual(
            Instance.objects.filter(
                xform=self.xform, deleted_at=None).count(), count - 1)
        # check that instance's deleted_at is set
        instance = Instance.objects.get(id=instance.id)
        self.assertTrue(isinstance(instance.deleted_at, datetime))
        # check mongo record was marked as deleted
        cursor = settings.MONGO_DB.instances.find(
            {common_tags.ID: instance.id})
        self.assertEqual(cursor.count(), 1)
        record = cursor.next()
        self.assertIsNotNone(record[common_tags.DELETEDAT])


text:
import amqp

from .interfaces import Transport

class AmqpTransport(Transport):

    def __init__(self, host, username, password, queue):

        self._connection = amqp.Connection(
            host,
            userid=username,
            password=password,
        )
        self._channel = self._connection.channel()
        self._queue = queue

        self._channel.queue_declare(self._queue)

        self._message_map = {}

    def send(self, message):

        msg = amqp.Message(
            message.json(),
            content_type='application/json',
        )

        self._channel.basic_publish(msg, routing_key=self._queue)

    def fetch(self):

        payload = self._channel.basic_get(self._queue)
        if payload is None:
            return None
        message = self.message_from_payload(payload.body)
        self._message_map[message] = payload
        return message

    def complete(self, message):

        payload = self._message_map[message]
        self._channel.basic_ack(payload.delivery_tag)
        del self._message_map[message]

    def close(self):

        self._connection.close()


text:
namespace morphie {
namespace util {

std::set<string> SplitToSet(const string& str, char delim) {
  std::vector<string> vec = SplitToVector(str, delim);
  return std::set<string>(vec.begin(), vec.end());
}

std::vector<string> SplitToVector(const string& str, char delim) {
  if (str.empty()) {
    return {""};
  }
  std::vector<string> strings;
  std::stringstream stream(str);
  string token;
  while (std::getline(stream, token, delim)) {
    strings.push_back(token);
  }
  if (str.back() == delim) {
    strings.push_back("");
  }
  return strings;
}

string StrCat(const string& str1, const string& str2) {
  return StrCat(str1, str2, "", "", "", "");
}

string StrCat(const string& str1, const string& str2, const string& str3) {
  return StrCat(str1, str2, str3, "", "", "");
}

string StrCat(const string& str1, const string& str2, const string& str3,
              const string& str4) {
  return StrCat(str1, str2, str3, str4, "", "");
}

string StrCat(const string& str1, const string& str2, const string& str3,
              const string& str4, const string& str5) {
  return StrCat(str1, str2, str3, str4, str5, "");
}

string StrCat(const string& str1, const string& str2, const string& str3,
              const string& str4, const string& str5, const string& str6) {
  string out;
  StrAppend(&out, str1, str2, str3, str4, str5, str6);
  return out;
}

void StrAppend(string* out, const string& str1) {
  StrAppend(out, str1, "", "", "", "", "");
}

void StrAppend(string* out, const string& str1, const string& str2) {
  StrAppend(out, str1, str2, "", "", "", "");
}

void StrAppend(string* out, const string& str1, const string& str2,
               const string& str3) {
  StrAppend(out, str1, str2, str3, "", "", "");
}

void StrAppend(string* out, const string& str1, const string& str2,
               const string& str3, const string& str4) {
  StrAppend(out, str1, str2, str3, str4, "", "");
}

void StrAppend(string* out, const string& str1, const string& str2,
               const string& str3, const string& str4, const string& str5) {
  StrAppend(out, str1, str2, str3, str4, str5, "");
}

void StrAppend(string* out, const string& str1, const string& str2,
               const string& str3, const string& str4, const string& str5,
               const string& str6) {
  out->reserve(out->size() + str1.size() + str2.size() + str3.size() +
               str4.size() + str5.size() + str6.size());
  *out += str1;
  *out += str2;
  *out += str3;
  *out += str4;
  *out += str5;
  *out += str6;
}

}  // namespace util
}  // namespace morphie


text:
package se.jkrau.mclib.loader;

import se.jkrau.mclib.MCLib;
import se.jkrau.mclib.craft.Craft;

import java.util.Map;

/**
 * TODO: There seems to be more than what's here.  To be documented when a final plan goes for this.
 */
public class ByteArrayLoader extends Loader {
	public ByteArrayLoader(MCLib lib) {
		super(lib);
	}

	public ByteArrayLoader(Filter filter, Craft[] craftArray, Map<String, Craft> craftMap) {
		super(filter, craftArray, craftMap);
	}

	public byte[] loadClass(byte[] array, String name) {
		return this.injectClass(array, name);
	}
}


text:
using FluentlyHttpClient;
using Microsoft.Extensions.Logging;
using NFluent;
using Slabs.Experimental.ConsoleClient.Testify;
using System;
using System.Threading.Tasks;

namespace Slabs.Experimental.ConsoleClient.Tests
{

	public class Common_TermsAndConditionsTest : ITest
	{
		private readonly ILogger _logger;
		private readonly IFluentHttpClient _fluentHttpClient;

		public Common_TermsAndConditionsTest(ILogger<Common_TermsAndConditionsTest> logger, IFluentHttpClientFactory fluentHttpClientFactory)
		{
			_logger = logger;
			_fluentHttpClient = fluentHttpClientFactory.GetCommonClient();
		}

		public async Task Execute()
		{
			var result = await _fluentHttpClient.Get<TermsAndConditionsResponse>("/api/profile/terms-and-conditions/latest");

			var response = await _fluentHttpClient.CreateRequest("/api/profile/terms-and-conditions/latest")
				.AsGet()
				.ReturnAsResponse<TermsAndConditionsResponse>();
			response.EnsureSuccessStatusCode();

			var timeTaken = response.GetTimeTaken();
			Check.That(timeTaken).IsLessThan(TimeSpan.FromMilliseconds(250));
			Check.That(result).IsNotNull();
			Check.That(result.Id).IsStrictlyGreaterThan(0);

			_logger.LogInformation("[{service}] complete", nameof(Common_TermsAndConditionsTest));
		}
	}

	public class TermsAndConditionsResponse
	{
		public int Id { get; set; }
		public DateTime PublicationDate { get; set; }
		public string Content { get; set; }
	}

	public static class CommonTests
	{
		public static TestGroupBuilder GetGroup()
		{
			return new TestGroupBuilder()
				.Add<Common_TermsAndConditionsTest>("terms-and-conditions")
				;
		}

		public static TestSuiteBuilder AddCommonTests(this TestSuiteBuilder testSuiteBuilder, int repeat = 1)
		{
			testSuiteBuilder.Add(GetGroup(), repeat);
			return testSuiteBuilder;
		}

	}
}


text:
package com.yandex.money.api.model;

import com.google.gson.annotations.SerializedName;
import com.yandex.money.api.time.DateTime;

import static com.yandex.money.api.util.Common.checkNotEmpty;
import static com.yandex.money.api.util.Common.checkNotNull;

/**
 * Describes avatar from {@link com.yandex.money.api.methods.wallet.AccountInfo}.
 */
public final class Avatar {

    /**
     * url to avatar
     */
    @SerializedName("url")
    public final String url;

    /**
     * avatar change time
     */
    @SuppressWarnings("WeakerAccess")
    @SerializedName("ts")
    public final DateTime timestamp;

    /**
     * Constructor.
     *
     * @param url url to avatar
     * @param timestamp avatar change time
     */
    public Avatar(String url, DateTime timestamp) {
        this.url = checkNotEmpty(url, "url");
        this.timestamp = checkNotNull(timestamp, "timestamp");
    }

    @Override
    public boolean equals(Object o) {
        if (this == o) return true;
        if (o == null || getClass() != o.getClass()) return false;

        Avatar avatar = (Avatar) o;

        //noinspection SimplifiableIfStatement
        if (url != null ? !url.equals(avatar.url) : avatar.url != null) return false;
        return timestamp != null ? timestamp.equals(avatar.timestamp) : avatar.timestamp == null;
    }

    @Override
    public int hashCode() {
        int result = url != null ? url.hashCode() : 0;
        result = 31 * result + (timestamp != null ? timestamp.hashCode() : 0);
        return result;
    }

    @Override
    public String toString() {
        return "Avatar{" +
                "url='" + url + '\'' +
                ", timestamp=" + timestamp +
                '}';
    }
}


text:
// 2012 - 2019 Soverance Studios
// https://soverance.com

// 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.

#pragma once

#include "Blueprint/UserWidget.h"
#include "PlayerStatAttribute.h"
#include "Environment/Hangar.h"
#include "Management/CommonLibrary.h"
#include "HangarMenu.generated.h"

UCLASS()
class ENDLESSREACHHD_API UHangarMenu : public UUserWidget
{
	GENERATED_BODY()

public:

	UHangarMenu(const FObjectInitializer& ObjectInitializer);

	// Player Stat Attributes Array
	UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = Attributes)
	TArray<FPlayerStatAttribute> Attributes;

	// The Ship Type Attribute - used to determine the ship's physical appearance
	UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = Attributes)
	FPlayerStatAttribute ShipType;

	// The Health Attribute - used to upgrade the ship's maximum health value
	UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = Attributes)
	FPlayerStatAttribute Health;

	// The Thruster Attribute - used to upgrade the ship's thrusters
	UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = Attributes)
	FPlayerStatAttribute Thruster;

	// The Cannon Attribute - used to upgrade the ship's main cannons
	UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = Attributes)
	FPlayerStatAttribute Cannon;

	// The Laser Attribute - used to upgrade the ship's forward laser
	UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = Attributes)
	FPlayerStatAttribute Laser;

	// The Magnet Attribute - used to upgrade the ship's magnet feature
	UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = Attributes)
	FPlayerStatAttribute Magnet;

	// The Missiles Attribute - used to upgrade the ship's homing missles
	UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = Attributes)
	FPlayerStatAttribute Missiles;

	// The Shield Attribute - used to upgrade the ship's energy shield
	UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = Attributes)
	FPlayerStatAttribute Shield;

	// The Bomb Attribute - used to upgrade the ship's nuclear bomb
	UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = Attributes)
	FPlayerStatAttribute Bomb;

	// The number of orbs the player has collected since the last time they returned to the outpost
	UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = Player)
	FText Player_OrbCount;

	// The index of the menu, indicating which panel is currently active
	UPROPERTY(Category = Controls, EditAnywhere, BlueprintReadWrite)
	int32 MenuIndex;

	/* Whether the hanger menu can be navigated; i.e., the player is allowed to press left or right to move the menu panels in that direction */
	UPROPERTY(Category = Controls, EditAnywhere, BlueprintReadWrite)
	bool bCanNavigate;

	// Move the menu index to the left by one
	UFUNCTION(BlueprintNativeEvent, BlueprintCallable, Category = Controls)
	void MoveLeft();

	// Move the menu index to the right by one
	UFUNCTION(BlueprintNativeEvent, BlueprintCallable, Category = Controls)
	void MoveRight();

	// Move the menu to the appropriate index
	UFUNCTION(BlueprintNativeEvent, BlueprintCallable, Category = Controls)
	void SetMenuIndex();

	// Reconfigures the display of the corresponding feature to match the current upgrade level
	UFUNCTION(BlueprintCallable, Category = Controls)
	void SetUpgradeLevel(int32 Level, int32 UpgradeCost);

	// Plays the appropriate upgrade UI animation
	UFUNCTION(BlueprintNativeEvent, BlueprintCallable, Category = Controls)
	void PlayUpgradeAnim(int32 Level, int32 NewCost);

	// Called to notify the user if the menu experiences an error
	UFUNCTION(BlueprintCallable, Category = Controls)
	void NotifyError();

	/** Sound to play when the menu encounters an error */
	UPROPERTY(Category = Audio, EditAnywhere, BlueprintReadWrite)
	USoundCue* S_ErrorNotify;

	/** Sound to play when the menu switches panels */
	UPROPERTY(Category = Audio, EditAnywhere, BlueprintReadWrite)
	USoundCue* S_CursorNotify;

	/** Sound to play when an upgrade occurs */
	UPROPERTY(Category = Audio, EditAnywhere, BlueprintReadWrite)
	USoundCue* S_UpgradeNotify;

	/** Reference to the Hangar object itself in game */
	UPROPERTY(Category = Audio, EditAnywhere, BlueprintReadWrite)
	AHangar* Hangar;

	// Prompt the player to exit the hangar
	UFUNCTION(BlueprintNativeEvent, BlueprintCallable, Category = Controls)
	void PromptExit();

	// Returns to the upgrade menu from the exit prompt, when the player selects "NO"
	UFUNCTION(BlueprintNativeEvent, BlueprintCallable, Category = Controls)
	void ReturnToUpgradeMenu();

	// The index of the exit prompt menu - basically just yes or no, so it's binary  (0 = yes, 1 = no)
	UPROPERTY(Category = Controls, EditAnywhere, BlueprintReadWrite)
	int32 ExitPromptIndex;

	/* Whether the hanger menu is prompting for exit */
	UPROPERTY(Category = Controls, EditAnywhere, BlueprintReadWrite)
	bool bIsPromptingExit;

	// Begin the launch sequence to exit the hangar
	UFUNCTION(BlueprintCallable, Category = Controls)
	void InitLaunchSequence();
};


text:
package org.neo4j.ogm.metadata;

import org.junit.Test;
import org.neo4j.ogm.domain.annotations.ids.ValidAnnotations;
import org.neo4j.ogm.domain.invalid.ids.InvalidAnnotations;
import org.neo4j.ogm.exception.core.MetadataException;

public class InvalidIdAnnotationTest {

    private MetaData metaData;

    @Test(expected = MetadataException.class)
    public void shouldRejectTwoIdsOnSameClass() {
        createMetadataAndCheckIdentityField(InvalidAnnotations.TwoIdsOnSameClass.class.getName());
    }

    @Test(expected = MetadataException.class)
    public void shouldRejectNeitherGraphIdOrId() {
        createMetadataAndCheckIdentityField(InvalidAnnotations.NeitherGraphIdOrId.class.getName());
    }

    @Test(expected = MetadataException.class)
    public void shouldRejectChildHasPrimaryIndexExtendsAndParentHasId() {
        metaData = new MetaData(ValidAnnotations.Basic.class.getName(),
            InvalidAnnotations.ChildHasPrimaryIndexExtendsAndParentHasId.class.getName());
    }

    @Test(expected = MetadataException.class)
    public void shouldRejectUuidGenerationStrategyWithIdTypeNotUuid() {
        createMetadataAndCheckIdentityField(InvalidAnnotations.UuidGenerationStrategyWithIdTypeNotUuid.class.getName());
    }

    @Test(expected = MetadataException.class)
    public void shouldRejectGeneratedValueWithoutID() {
        createMetadataAndCheckIdentityField(InvalidAnnotations.GeneratedValueWithoutID.class.getName());
    }

    private void createMetadataAndCheckIdentityField(String name) {
        metaData = new MetaData(name);
        metaData.classInfo(name).identityField();
    }

}


text:
namespace display {

struct GammaRampRGBEntry;
struct DisplayConfigurationParams;

namespace test {

// Strings returned by TestNativeDisplayDelegate::GetActionsAndClear() to
// describe various actions that were performed.
const char kInit[] = "init";
const char kTakeDisplayControl[] = "take";
const char kRelinquishDisplayControl[] = "relinquish";

// String returned by TestNativeDisplayDelegate::GetActionsAndClear() if no
// actions were requested.
const char kNoActions[] = "";

// Returns a string describing a TestNativeDisplayDelegate::Configure()
// call.
std::string GetCrtcAction(
    const display::DisplayConfigurationParams& display_config_params);

// Returns a string describing a TestNativeDisplayDelegate::SetHDCPState() call.
std::string GetSetHDCPStateAction(int64_t display_id,
                                  HDCPState state,
                                  ContentProtectionMethod protection_method);

// Returns a string describing a TestNativeDisplayDelegate::SetColorMatrix()
// call.
std::string SetColorMatrixAction(int64_t display_id,
                                 const std::vector<float>& color_matrix);

// Returns a string describing a TestNativeDisplayDelegate::SetGammaCorrection()
// call.
std::string SetGammaCorrectionAction(
    int64_t display_id,
    const std::vector<display::GammaRampRGBEntry>& degamma_lut,
    const std::vector<display::GammaRampRGBEntry>& gamma_lut);

// Returns a string describing a TestNativedisplaydelegate::SetPrivacyScreen()
// call.
std::string SetPrivacyScreenAction(int64_t display_id, bool enabled);

// Joins a sequence of strings describing actions (e.g. kScreenDim) such
// that they can be compared against a string returned by
// ActionLogger::GetActionsAndClear().  The list of actions must be
// terminated by a NULL pointer.
std::string JoinActions(const char* action, ...);

}  // namespace test
}  // namespace display

#endif  // UI_DISPLAY_MANAGER_TEST_ACTION_LOGGER_UTIL_H_


text:
/*

   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.
*/

package client

import (
	"errors"
	"fmt"
	"net/url"
	"strconv"

	"github.com/apache/trafficcontrol/lib/go-tc"
)

// Creates a new Content Invalidation Job
func (to *Session) CreateInvalidationJob(job tc.InvalidationJobInput) (tc.Alerts, ReqInf, error) {
	var alerts tc.Alerts
	reqInf, err := to.post(`/jobs`, job, nil, &alerts)
	return alerts, reqInf, err
}

// Deletes a Content Invalidation Job
func (to *Session) DeleteInvalidationJob(jobID uint64) (tc.Alerts, ReqInf, error) {
	var alerts tc.Alerts
	reqInf, err := to.del(fmt.Sprintf("/jobs?id=%d", jobID), nil, &alerts)
	return alerts, reqInf, err

}

// Updates a Content Invalidation Job
func (to *Session) UpdateInvalidationJob(job tc.InvalidationJob) (tc.Alerts, ReqInf, error) {
	var alerts tc.Alerts
	reqInf, err := to.put(fmt.Sprintf(`/jobs?id=%d`, *job.ID), job, nil, &alerts)
	return alerts, reqInf, err
}

// GetJobs returns a list of Jobs.
// If deliveryServiceID or userID are not nil, only jobs for that delivery service or belonging to
// that user are returned. Both deliveryServiceID and userID may be nil.
//
// Deprecated, use GetInvalidationJobs instead
func (to *Session) GetJobs(deliveryServiceID *int, userID *int) ([]tc.Job, ReqInf, error) {
	params := url.Values{}
	if deliveryServiceID != nil {
		params.Add("dsId", strconv.Itoa(*deliveryServiceID))
	}
	if userID != nil {
		params.Add("userId", strconv.Itoa(*userID))
	}
	path := "/jobs?" + params.Encode()
	data := struct {
		Response []tc.Job `json:"response"`
	}{}
	reqInf, err := to.get(path, nil, &data)
	return data.Response, reqInf, err
}

// Returns a list of Content Invalidation Jobs visible to your Tenant, filtered according to
// ds and user
//
// Either or both of ds and user may be nil, but when they are not they cause filtering of the
// returned jobs by Delivery Service and Traffic Ops user, respectively.
//
// ds may be a uint, int, or float64 indicating the integral, unique identifier of the desired
// Delivery Service (in the case of a float64 the fractional part is dropped, e.g. 3.45 -> 3), or
// it may be a string, in which case it should be the xml_id of the desired Delivery Service, or it
// may be an actual tc.DeliveryService or tc.DeliveryServiceNullable structure.
//
// Likewise, user may be a uint, int or float64 indicating the integral, unique identifier of the
// desired user (in the case of a float64 the fractional part is dropped, e.g. 3.45 -> 3), or it may
// be a string, in which case it should be the username of the desired user, or it may be an actual
// tc.User or tc.UserCurrent structure.
func (to *Session) GetInvalidationJobs(ds *interface{}, user *interface{}) ([]tc.InvalidationJob, ReqInf, error) {
	const DSIDKey = "dsId"
	const DSKey = "deliveryService"
	const UserKey = "userId"
	const CreatedKey = "createdBy"

	params := url.Values{}
	if ds != nil {
		d := *ds
		switch t := d.(type) {
		case uint:
			params.Add(DSIDKey, strconv.FormatUint(uint64(d.(uint)), 10))
		case float64:
			params.Add(DSIDKey, strconv.FormatInt(int64(d.(float64)), 10))
		case int:
			params.Add(DSIDKey, strconv.FormatInt(int64(d.(int)), 10))
		case string:
			params.Add(DSKey, d.(string))
		case tc.DeliveryServiceNullable:
			if d.(tc.DeliveryServiceNullable).XMLID != nil {
				params.Add(DSKey, *d.(tc.DeliveryServiceNullable).XMLID)
			} else if d.(tc.DeliveryServiceNullable).ID != nil {
				params.Add(DSIDKey, strconv.FormatInt(int64(*d.(tc.DeliveryServiceNullable).ID), 10))
			} else {
				return nil, ReqInf{}, errors.New("no non-nil identifier on passed Delivery Service")
			}
		default:
			return nil, ReqInf{}, fmt.Errorf("invalid type for argument 'ds': %T*", t)
		}
	}
	if user != nil {
		u := *user
		switch t := u.(type) {
		case uint:
			params.Add(UserKey, strconv.FormatUint(uint64(u.(uint)), 10))
		case float64:
			params.Add(UserKey, strconv.FormatInt(int64(u.(float64)), 10))
		case int:
			params.Add(UserKey, strconv.FormatInt(u.(int64), 10))
		case string:
			params.Add(CreatedKey, u.(string))
		case tc.User:
			if u.(tc.User).Username != nil {
				params.Add(CreatedKey, *u.(tc.User).Username)
			} else if u.(tc.User).ID != nil {
				params.Add(UserKey, strconv.FormatInt(int64(*u.(tc.User).ID), 10))
			} else {
				return nil, ReqInf{}, errors.New("no non-nil identifier on passed User")
			}
		case tc.UserCurrent:
			if u.(tc.UserCurrent).UserName != nil {
				params.Add(CreatedKey, *u.(tc.UserCurrent).UserName)
			} else if u.(tc.UserCurrent).ID != nil {
				params.Add(UserKey, strconv.FormatInt(int64(*u.(tc.UserCurrent).ID), 10))
			} else {
				return nil, ReqInf{}, errors.New("no non-nil identifier on passed UserCurrent")
			}
		default:
			return nil, ReqInf{}, fmt.Errorf("invalid type for argument 'user': %T*", t)
		}
	}
	path := "/jobs"
	if len(params) > 0 {
		path += "?" + params.Encode()
	}

	data := struct {
		Response []tc.InvalidationJob `json:"response"`
	}{}
	reqInf, err := to.get(path, nil, &data)
	return data.Response, reqInf, err
}


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

<title>Symbols (dollar-script 0.4.5195 API)</title>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<meta name="date" content="2017-09-28">
<link rel="stylesheet" type="text/css" href="../../../../../stylesheet.css" title="Style">
<link rel="stylesheet" type="text/css" href="../../../../../jquery/jquery-ui.css" title="Style">

JavaScript is disabled on your browser.

Skip navigation links

Overview

Package

Class

Use

Tree

Deprecated

Index

Help

Prev Class

Next Class

Frames

No Frames

All Classes

SEARCH:
<input type="text" id="search" value=" " disabled="disabled">
<input type="reset" id="reset" value=" " disabled="disabled">

JavaScript is disabled on your browser.

Summary:

Nested |

Field |

Constr |

Method

Detail:

Field |

Constr |

Method

Package dollar.internal.runtime.script.parser

Class Symbols

java.lang.Object

dollar.internal.runtime.script.parser.Symbols

public final class Symbols
extends java.lang.Object

Field Summary

Fields

Modifier and Type
Field
Description

static @NotNull Op
ALL

static @NotNull Op
AND

static @NotNull java.util.function.Function<dollar.api.Value[],dollar.api.Type>
ANY_TYPE_F

static @NotNull KeywordDef
AS

static @NotNull Op
ASSERT

static @NotNull Op
ASSERT_EQ_REACT

static @NotNull Op
ASSERT_EQ_UNREACT

static @NotNull Op
ASSIGNMENT

static @NotNull Op
ASSIGNMENT_CONSTRAINT

static @NotNull Op
AVG

static @NotNull KeywordDef
BLOCK

static @NotNull Op
BLOCK_OP

static @NotNull java.util.function.Function<dollar.api.Value[],dollar.api.Type>
BOOL_TYPE_F

static @NotNull Op
BUILTIN_OP

static @NotNull Op
CAST

static @NotNull Op
CAUSES

static @NotNull Op
CHOOSE

static @NotNull Op
CLASS_OP

static @NotNull Op
COLLECT_OP

static @NotNull SymbolDef
COMMA

static @NotNull KeywordDef
CONST

static @NotNull Op
CREATE

static @NotNull Op
DEBUG

static @NotNull Op
DEC

static @NotNull KeywordDef
DEF

static @NotNull Op
DEFAULT

static @NotNull Op
DEFINITION

static @NotNull Op
DEFINITION_CONSTRAINT

static @NotNull Op
DESTROY

static @NotNull Op
DIVIDE

static @NotNull SymbolDef
DOLLAR

static @NotNull Op
DRAIN

static @NotNull Op
EACH

static @NotNull Op
ELSE

static @NotNull Op
EQUALITY

static @NotNull Op
ERR

static @NotNull Op
ERROR

static @NotNull KeywordDef
EVERY

static @NotNull Op
EVERY_OP

static @NotNull KeywordDef
EXPORT

static @NotNull KeywordDef
FALSE

static @NotNull java.util.function.Function<dollar.api.Value[],dollar.api.Type>
FIRST_TYPE_F

static @NotNull Op
FIX

static @NotNull KeywordDef
FOR

static @NotNull Op
FOR_OP

static @NotNull Op
FORK

static @NotNull KeywordDef
FROM

static @NotNull Op
FUNCTION_NAME_OP

static @NotNull Op
GT

static @NotNull Op
GT_EQUALS

static @NotNull Op
IF_OP

static @NotNull Op
IN

static @NotNull Op
INC

static @NotNull Op
INEQUALITY_OPERATOR

static @NotNull KeywordDef
INFINITY

static @NotNull java.util.function.Function<dollar.api.Value[],dollar.api.Type>
INTEGER_TYPE_F

static @NotNull Op
IS_OP

static @NotNull java.util.List<java.lang.String>
KEYWORD_STRINGS

static @NotNull SymbolDef
LEFT_BRACE

static @NotNull SymbolDef
LEFT_BRACKET

static @NotNull SymbolDef
LEFT_PAREN

static @NotNull Op
LIST_OP

static @NotNull java.util.function.Function<dollar.api.Value[],dollar.api.Type>
LIST_TYPE_F

static @NotNull Op
LT

static @NotNull Op
LT_EQUALS

static @NotNull Op
MAP_OP

static @NotNull java.util.function.Function<dollar.api.Value[],dollar.api.Type>
MAP_TYPE_F

static @NotNull Op
MAX

static @NotNull Op
MEMBER

static @NotNull Op
MIN

static @NotNull Op
MINUS

static @NotNull Op
MOD

static @NotNull Op
MODULE_OP

static @NotNull Op
MULTIPLY

static @NotNull KeywordDef
MUTATE

static @NotNull Op
NEGATE

static @NotNull Op
NEW_OP

static @NotNull SymbolDef
NEWLINE

static @NotNull KeywordDef
NO

static @NotNull Op
NOT

static @NotNull KeywordDef
NULL

static @NotNull java.util.List<Op>
OPERATORS

static @NotNull Op
OR

static @NotNull Op
OUT

static @NotNull KeywordDef
OVER

static @NotNull Op
PAIR

static @NotNull Op
PARALLEL

static @NotNull Op
PARAM_OP

static @NotNull Op
PAUSE

static @NotNull KeywordDef
PERIOD

static @NotNull Op
PIPE_OP

static @NotNull Op
PLUS

static @NotNull Op
PRINT

static @NotNull Op
PRODUCT

static @NotNull Op
PUBLISH

static @NotNull KeywordDef
PURE

static @NotNull Op
PURE_OP

static @NotNull Op
RANGE

static @NotNull java.util.function.Function<dollar.api.Value[],dollar.api.Type>
RANGE_TYPE_F

static @NotNull Op
READ_OP

static @NotNull Op
READ_SIMPLE

static @NotNull Op
REDUCE

static @NotNull Op
REVERSE

static @NotNull java.util.function.Function<dollar.api.Value[],dollar.api.Type>
RHS_TYPE_F

static @NotNull SymbolDef
RIGHT_BRACE

static @NotNull SymbolDef
RIGHT_BRACKET

static @NotNull SymbolDef
RIGHT_PAREN

static @NotNull Op
SCRIPT_OP

static @NotNull SymbolDef
SEMI_COLON

static @NotNull Op
SERIAL

static @NotNull Op
SIZE

static @NotNull Op
SORT

static @NotNull Op
SPLIT

static @NotNull Op
START

static @NotNull Op
STATE

static @NotNull Op
STOP

static @NotNull Op
SUBSCRIBE

static @NotNull Op
SUBSCRIBE_ASSIGN

static @NotNull Op
SUBSCRIPT_OP

static @NotNull Op
SUM

static @NotNull java.util.List<java.lang.String>
SYMBOL_STRINGS

static @NotNull KeywordDef
THIS

static @NotNull KeywordDef
TO

static @NotNull KeywordDef
TRUE

static @NotNull Op
TRUTHY

static @NotNull Op
UNIQUE

static @NotNull Op
UNIT_OP

static @NotNull KeywordDef
UNLESS

static @NotNull Op
UNPAUSE

static @NotNull KeywordDef
UNTIL

static @NotNull KeywordDef
VAR

static @NotNull Op
VAR_USAGE_OP

static @NotNull KeywordDef
VOID

static @NotNull java.util.function.Function<dollar.api.Value[],dollar.api.Type>
VOID_TYPE_F

static @NotNull KeywordDef
VOLATILE

static @NotNull Op
WHEN

static @NotNull Op
WHEN_ASSIGN

static @NotNull Op
WHILE_OP

static @NotNull Op
WINDOW_OP

static @NotNull KeywordDef
WITH

static @NotNull Op
WRITE_OP

static @NotNull Op
WRITE_SIMPLE

static @NotNull KeywordDef
YES

Constructor Summary

Constructors

Constructor
Description

Symbols()

Method Summary

All Methods Static Methods Concrete Methods

Modifier and Type
Method
Description

static void
main(@NotNull java.lang.String[] args)

static void
mainx(@NotNull java.lang.String[] args)

Methods inherited from class java.lang.Object

clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait

Field Detail

COMMA

@NotNull
public static final @NotNull SymbolDef COMMA

ANY_TYPE_F

@NotNull
public static final @NotNull java.util.function.Function<dollar.api.Value[],dollar.api.Type> ANY_TYPE_F

BOOL_TYPE_F

@NotNull
public static final @NotNull java.util.function.Function<dollar.api.Value[],dollar.api.Type> BOOL_TYPE_F

FIRST_TYPE_F

@NotNull
public static final @NotNull java.util.function.Function<dollar.api.Value[],dollar.api.Type> FIRST_TYPE_F

INTEGER_TYPE_F

@NotNull
public static final @NotNull java.util.function.Function<dollar.api.Value[],dollar.api.Type> INTEGER_TYPE_F

LIST_TYPE_F

@NotNull
public static final @NotNull java.util.function.Function<dollar.api.Value[],dollar.api.Type> LIST_TYPE_F

MAP_TYPE_F

@NotNull
public static final @NotNull java.util.function.Function<dollar.api.Value[],dollar.api.Type> MAP_TYPE_F

RANGE_TYPE_F

@NotNull
public static final @NotNull java.util.function.Function<dollar.api.Value[],dollar.api.Type> RANGE_TYPE_F

RHS_TYPE_F

@NotNull
public static final @NotNull java.util.function.Function<dollar.api.Value[],dollar.api.Type> RHS_TYPE_F

VOID_TYPE_F

@NotNull
public static final @NotNull java.util.function.Function<dollar.api.Value[],dollar.api.Type> VOID_TYPE_F

AS

@NotNull
public static final @NotNull KeywordDef AS

AVG

@NotNull
public static final @NotNull Op AVG

BLOCK

@NotNull
public static final @NotNull KeywordDef BLOCK

BLOCK_OP

@NotNull
public static final @NotNull Op BLOCK_OP

AND

@NotNull
public static final @NotNull Op AND

ASSERT_EQ_REACT

@NotNull
public static final @NotNull Op ASSERT_EQ_REACT

ASSERT_EQ_UNREACT

@NotNull
public static final @NotNull Op ASSERT_EQ_UNREACT

BUILTIN_OP

@NotNull
public static final @NotNull Op BUILTIN_OP

CAST

@NotNull
public static final @NotNull Op CAST

CHOOSE

@NotNull
public static final @NotNull Op CHOOSE

CLASS_OP

@NotNull
public static final @NotNull Op CLASS_OP

CONST

@NotNull
public static final @NotNull KeywordDef CONST

DEF

@NotNull
public static final @NotNull KeywordDef DEF

DOLLAR

@NotNull
public static final @NotNull SymbolDef DOLLAR

EQUALITY

@NotNull
public static final @NotNull Op EQUALITY

EVERY

@NotNull
public static final @NotNull KeywordDef EVERY

EXPORT

@NotNull
public static final @NotNull KeywordDef EXPORT

FALSE

@NotNull
public static final @NotNull KeywordDef FALSE

DEC

@NotNull
public static final @NotNull Op DEC

DEFAULT

@NotNull
public static final @NotNull Op DEFAULT

DEFINITION

@NotNull
public static final @NotNull Op DEFINITION

DEFINITION_CONSTRAINT

@NotNull
public static final @NotNull Op DEFINITION_CONSTRAINT

FIX

@NotNull
public static final @NotNull Op FIX

FOR

@NotNull
public static final @NotNull KeywordDef FOR

FORK

@NotNull
public static final @NotNull Op FORK

FROM

@NotNull
public static final @NotNull KeywordDef FROM

FUNCTION_NAME_OP

@NotNull
public static final @NotNull Op FUNCTION_NAME_OP

GT

@NotNull
public static final @NotNull Op GT

GT_EQUALS

@NotNull
public static final @NotNull Op GT_EQUALS

IF_OP

@NotNull
public static final @NotNull Op IF_OP

IN

@NotNull
public static final @NotNull Op IN

INC

@NotNull
public static final @NotNull Op INC

INEQUALITY_OPERATOR

@NotNull
public static final @NotNull Op INEQUALITY_OPERATOR

INFINITY

@NotNull
public static final @NotNull KeywordDef INFINITY

IS_OP

@NotNull
public static final @NotNull Op IS_OP

KEYWORD_STRINGS

@NotNull
public static final @NotNull java.util.List<java.lang.String> KEYWORD_STRINGS

LEFT_BRACE

@NotNull
public static final @NotNull SymbolDef LEFT_BRACE

LEFT_BRACKET

@NotNull
public static final @NotNull SymbolDef LEFT_BRACKET

LEFT_PAREN

@NotNull
public static final @NotNull SymbolDef LEFT_PAREN

ALL

@NotNull
public static final @NotNull Op ALL

DRAIN

@NotNull
public static final @NotNull Op DRAIN

EACH

@NotNull
public static final @NotNull Op EACH

LIST_OP

@NotNull
public static final @NotNull Op LIST_OP

LT

@NotNull
public static final @NotNull Op LT

LT_EQUALS

@NotNull
public static final @NotNull Op LT_EQUALS

MAP_OP

@NotNull
public static final @NotNull Op MAP_OP

MAX

@NotNull
public static final @NotNull Op MAX

MEMBER

@NotNull
public static final @NotNull Op MEMBER

MIN

@NotNull
public static final @NotNull Op MIN

MOD

@NotNull
public static final @NotNull Op MOD

MODULE_OP

@NotNull
public static final @NotNull Op MODULE_OP

MUTATE

@NotNull
public static final @NotNull KeywordDef MUTATE

NEGATE

@NotNull
public static final @NotNull Op NEGATE

NEWLINE

@NotNull
public static final @NotNull SymbolDef NEWLINE

NEW_OP

@NotNull
public static final @NotNull Op NEW_OP

NO

@NotNull
public static final @NotNull KeywordDef NO

NOT

@NotNull
public static final @NotNull Op NOT

NULL

@NotNull
public static final @NotNull KeywordDef NULL

OPERATORS

@NotNull
public static final @NotNull java.util.List<Op> OPERATORS

OR

@NotNull
public static final @NotNull Op OR

OVER

@NotNull
public static final @NotNull KeywordDef OVER

PAIR

@NotNull
public static final @NotNull Op PAIR

PARALLEL

@NotNull
public static final @NotNull Op PARALLEL

PARAM_OP

@NotNull
public static final @NotNull Op PARAM_OP

PERIOD

@NotNull
public static final @NotNull KeywordDef PERIOD

PIPE_OP

@NotNull
public static final @NotNull Op PIPE_OP

PRODUCT

@NotNull
public static final @NotNull Op PRODUCT

PURE

@NotNull
public static final @NotNull KeywordDef PURE

PURE_OP

@NotNull
public static final @NotNull Op PURE_OP

RANGE

@NotNull
public static final @NotNull Op RANGE

READ_OP

@NotNull
public static final @NotNull Op READ_OP

READ_SIMPLE

@NotNull
public static final @NotNull Op READ_SIMPLE

REDUCE

@NotNull
public static final @NotNull Op REDUCE

REVERSE

@NotNull
public static final @NotNull Op REVERSE

ASSIGNMENT

@NotNull
public static final @NotNull Op ASSIGNMENT

CAUSES

@NotNull
public static final @NotNull Op CAUSES

DIVIDE

@NotNull
public static final @NotNull Op DIVIDE

ELSE

@NotNull
public static final @NotNull Op ELSE

MINUS

@NotNull
public static final @NotNull Op MINUS

MULTIPLY

@NotNull
public static final @NotNull Op MULTIPLY

PLUS

@NotNull
public static final @NotNull Op PLUS

RIGHT_BRACE

@NotNull
public static final @NotNull SymbolDef RIGHT_BRACE

RIGHT_BRACKET

@NotNull
public static final @NotNull SymbolDef RIGHT_BRACKET

RIGHT_PAREN

@NotNull
public static final @NotNull SymbolDef RIGHT_PAREN

SCRIPT_OP

@NotNull
public static final @NotNull Op SCRIPT_OP

SEMI_COLON

@NotNull
public static final @NotNull SymbolDef SEMI_COLON

SERIAL

@NotNull
public static final @NotNull Op SERIAL

SIZE

@NotNull
public static final @NotNull Op SIZE

SORT

@NotNull
public static final @NotNull Op SORT

SPLIT

@NotNull
public static final @NotNull Op SPLIT

STATE

@NotNull
public static final @NotNull Op STATE

SUBSCRIBE

@NotNull
public static final @NotNull Op SUBSCRIBE

SUBSCRIBE_ASSIGN

@NotNull
public static final @NotNull Op SUBSCRIBE_ASSIGN

SUBSCRIPT_OP

@NotNull
public static final @NotNull Op SUBSCRIPT_OP

SUM

@NotNull
public static final @NotNull Op SUM

SYMBOL_STRINGS

@NotNull
public static final @NotNull java.util.List<java.lang.String> SYMBOL_STRINGS

THIS

@NotNull
public static final @NotNull KeywordDef THIS

TO

@NotNull
public static final @NotNull KeywordDef TO

TRUE

@NotNull
public static final @NotNull KeywordDef TRUE

TRUTHY

@NotNull
public static final @NotNull Op TRUTHY

UNIQUE

@NotNull
public static final @NotNull Op UNIQUE

UNIT_OP

@NotNull
public static final @NotNull Op UNIT_OP

UNLESS

@NotNull
public static final @NotNull KeywordDef UNLESS

UNTIL

@NotNull
public static final @NotNull KeywordDef UNTIL

VAR

@NotNull
public static final @NotNull KeywordDef VAR

VAR_USAGE_OP

@NotNull
public static final @NotNull Op VAR_USAGE_OP

VOID

@NotNull
public static final @NotNull KeywordDef VOID

ASSERT

@NotNull
public static final @NotNull Op ASSERT

ASSIGNMENT_CONSTRAINT

@NotNull
public static final @NotNull Op ASSIGNMENT_CONSTRAINT

COLLECT_OP

@NotNull
public static final @NotNull Op COLLECT_OP

CREATE

@NotNull
public static final @NotNull Op CREATE

DEBUG

@NotNull
public static final @NotNull Op DEBUG

DESTROY

@NotNull
public static final @NotNull Op DESTROY

ERR

@NotNull
public static final @NotNull Op ERR

ERROR

@NotNull
public static final @NotNull Op ERROR

EVERY_OP

@NotNull
public static final @NotNull Op EVERY_OP

FOR_OP

@NotNull
public static final @NotNull Op FOR_OP

OUT

@NotNull
public static final @NotNull Op OUT

PAUSE

@NotNull
public static final @NotNull Op PAUSE

PRINT

@NotNull
public static final @NotNull Op PRINT

PUBLISH

@NotNull
public static final @NotNull Op PUBLISH

START

@NotNull
public static final @NotNull Op START

STOP

@NotNull
public static final @NotNull Op STOP

UNPAUSE

@NotNull
public static final @NotNull Op UNPAUSE

VOLATILE

@NotNull
public static final @NotNull KeywordDef VOLATILE

WHEN

@NotNull
public static final @NotNull Op WHEN

WHEN_ASSIGN

@NotNull
public static final @NotNull Op WHEN_ASSIGN

WHILE_OP

@NotNull
public static final @NotNull Op WHILE_OP

WINDOW_OP

@NotNull
public static final @NotNull Op WINDOW_OP

WITH

@NotNull
public static final @NotNull KeywordDef WITH

WRITE_OP

@NotNull
public static final @NotNull Op WRITE_OP

WRITE_SIMPLE

@NotNull
public static final @NotNull Op WRITE_SIMPLE

YES

@NotNull
public static final @NotNull KeywordDef YES

Constructor Detail

Symbols

public Symbols()

Method Detail

main

public static void main(@NotNull
                        @NotNull java.lang.String[] args)

mainx

public static void mainx(@NotNull
                         @NotNull java.lang.String[] args)

Skip navigation links

Overview

Package

Class

Use

Tree

Deprecated

Index

Help

Prev Class

Next Class

Frames

No Frames

All Classes

JavaScript is disabled on your browser.

Summary:

Nested |

Field |

Constr |

Method

Detail:

Field |

Constr |

Method

Copyright © 2017. All rights reserved.


text:
using System.Data;
using Umbraco.Core.Configuration;
using Umbraco.Core.Logging;
using Umbraco.Core.Persistence.SqlSyntax;

namespace Umbraco.Core.Persistence.Migrations.Upgrades.TargetVersionSix
{
    [Migration("6.0.0", 1, Constants.System.UmbracoMigrationName)]
    public class UpdateCmsPropertyTypeGroupTable : MigrationBase
    {
        public UpdateCmsPropertyTypeGroupTable(ISqlSyntaxProvider sqlSyntax, ILogger logger) : base(sqlSyntax, logger)
        {
        }

        public override void Up()
        {
            Alter.Table("cmsPropertyTypeGroup").AddColumn("parentGroupId").AsInt16().Nullable();

            Create.ForeignKey("FK_cmsPropertyTypeGroup_cmsPropertyTypeGroup_id")
                .FromTable("cmsPropertyTypeGroup").ForeignColumn("parentGroupId")
                .ToTable("cmsPropertyTypeGroup").PrimaryColumn("id").OnDeleteOrUpdate(Rule.None);
        }

        public override void Down()
        {
            Delete.ForeignKey().FromTable("cmsPropertyTypeGroup").ForeignColumn("parentGroupId").ToTable("cmsPropertyTypeGroup").PrimaryColumn("id");

            Delete.Column("parentGroupId").FromTable("cmsPropertyTypeGroup");
        }
    }
}


text:
@interface ViewController ()

@end

@implementation ViewController

- (void)viewDidLoad {
    [super viewDidLoad];
    NSString *dbFliePath = [NSSearchPathForDirectoriesInDomains(NSDocumentDirectory, NSUserDomainMask, YES).lastObject stringByAppendingPathComponent:@"test.sqlite"];
    FMDatabase *db = [FMDatabase databaseWithPath:dbFliePath];
    if ([db open]) {
        if([db executeUpdate:@"create table if not exists student(id integer primary key, name text, height real)"])
        {
            BOOL isInsert = [db executeUpdate:@"insert into student(name, height) values ('Maggie', 1.66)"];
            if (isInsert) {

              FMResultSet *resultSet = [db executeQuery:@"select * from student"];
                while ([resultSet next]) {
                    int idValue = [resultSet intForColumn:@"id"];
                    NSString *name = [resultSet stringForColumn:@"name"];
                    double height = [resultSet doubleForColumn:@"height"];
                    NSLog(@"%d---%@-----%g",idValue, name, height);
                }
            }
        }
    }
    [db close];
}

- (void)didReceiveMemoryWarning {
    [super didReceiveMemoryWarning];
    // Dispose of any resources that can be recreated.
}

@end


text:
1. [](#bugfix)
    * Dependency from the `Login Plugin` removed. Plugin can now be used without the `Admin Panel`.

# v1.0.2
##  02/17/2017

1. [](#bugfix)
    * Fixed a problem with the Grav Admin Plugin ([Issue #2](https://github.com/cworreschk/grav-plugin-vimeo/issues/2))

# v1.0.1
##  01/09/2017

1. [](#improved)
    * Added french translation (@MATsxm)

# v1.0.0
##  01/05/2017

1. [](#new)
    * Embed Vimeo videos and configure the player
    * Override the player parameters for each page
    * Button to add Vimeo videos in the content editor
    * Twig functions to embed Vimeo videos in your templates
    * Multi-Language Support


text:
import { get } from '@ember/object';
import { inject as service } from '@ember/service';
import LinkComponent from '@ember/routing/link-component';

export default LinkComponent.extend({
  sideMenu: service(),

  menuId: 'default',

  click() {
    get(this, 'sideMenu').close(get(this, 'menuId'));
  }
});


text:
import mongoose from 'mongoose';

const STORY = mongoose.model('Story', new mongoose.Schema({
  id: mongoose.Schema.Types.ObjectId,
  _author: { type: mongoose.Schema.Types.ObjectId, ref: 'User' },
  summary: String,
  content: { type: String, max: 5000, required: true },
  createdAt: { type: Date, default: Date.now },
  likes: [{ type: mongoose.Schema.Types.ObjectId, ref: 'User' }],
  dislikes: [{ type: mongoose.Schema.Types.ObjectId, ref: 'User' }],
  comments: [{ type: mongoose.Schema.Types.ObjectId, ref: 'Comment' }]
}));

export default STORY;


text:
If the ``If-Match: "<timestamp>"`` request header is provided as described in
the :ref:`section about timestamps <server-timestamps>`, and if the list has
changed meanwhile, a |status-412| error is returned.

If the ``If-None-Match: *`` request header is provided, and if the provided ``data``
contains an ``id`` field, and if there is already an existing object with this ``id``,
a |status-412| error is returned.

.. important::

    If the posted object has an ``id`` field, it will be taken into account.

    However, if a object already exists with the same ``id``, a |status-200| response
    is returned with the existing object in body (instead of |status-201|).
    See https://github.com/Kinto/kinto/issues/140

Validation
----------

If the posted values are invalid (e.g. *field value is not an integer*)
an error response is returned with |status-400|.

See :ref:`details on error responses <error-responses>`.

Permissions
-----------

In the JSON request payloads, an optional ``permissions`` attribute can be provided.

The :ref:`current user id <api-current-userid>` **is always added** among the ``write`` principals.

See :ref:`api-permissions-payload`.


text:
/* $FreeBSD$ */
/*	$OpenBSD: nfsm_subs.h,v 1.11 2000/01/05 20:50:52 millert Exp $	*/
/*	$NetBSD: nfsm_subs.h,v 1.10 1996/03/20 21:59:56 fvdl Exp $	*/

/*-
 * copyright (c) 2003
 * the regents of the university of michigan
 * all rights reserved
 *
 * permission is granted to use, copy, create derivative works and redistribute
 * this software and such derivative works for any purpose, so long as the name
 * of the university of michigan is not used in any advertising or publicity
 * pertaining to the use or distribution of this software without specific,
 * written prior authorization.  if the above copyright notice or any other
 * identification of the university of michigan is included in any copy of any
 * portion of this software, then the disclaimer below must also be included.
 *
 * this software is provided as is, without representation from the university
 * of michigan as to its fitness for any purpose, and without warranty by the
 * university of michigan of any kind, either express or implied, including
 * without limitation the implied warranties of merchantability and fitness for
 * a particular purpose. the regents of the university of michigan shall not be
 * liable for any damages, including special, indirect, incidental, or
 * consequential damages, with respect to any claim arising out of or in
 * connection with the use of the software, even if it has been or is hereafter
 * advised of the possibility of such damages.
 */

/*-
 * Copyright (c) 1989, 1993
 *	The Regents of the University of California.  All rights reserved.
 *
 * This code is derived from software contributed to Berkeley by
 * Rick Macklem at The University of Guelph.
 *
 * Redistribution and use in source and binary forms, with or without
 * modification, are permitted provided that the following conditions
 * are met:
 * 1. Redistributions of source code must retain the above copyright
 *    notice, this list of conditions and the following disclaimer.
 * 2. Redistributions in binary form must reproduce the above copyright
 *    notice, this list of conditions and the following disclaimer in the
 *    documentation and/or other materials provided with the distribution.
 * 4. Neither the name of the University nor the names of its contributors
 *    may be used to endorse or promote products derived from this software
 *    without specific prior written permission.
 *
 * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
 * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
 * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
 * ARE DISCLAIMED.  IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
 * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
 * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
 * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
 * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
 * SUCH DAMAGE.
 *
 *	@(#)nfsm_subs.h	8.2 (Berkeley) 3/30/95
 */

#ifndef _RPC_RPCM_SUBS_H_
#define _RPC_RPCM_SUBS_H_

/*
 * Now for the macros that do the simple stuff and call the functions
 * for the hard stuff.
 * These macros use several vars. declared in rpcm_reqhead and these
 * vars. must not be used elsewhere unless you are careful not to corrupt
 * them. The vars. starting with pN and tN (N=1,2,3,..) are temporaries
 * that may be used so long as the value is not expected to retained
 * after a macro.
 * I know, this is kind of dorkey, but it makes the actual op functions
 * fairly clean and deals with the mess caused by the xdr discriminating
 * unions.
 */

#define	rpcm_build(a,c,s) \
		{ if ((s) > M_TRAILINGSPACE(mb)) { \
			mb2 = m_get(M_WAITOK, MT_DATA); \
			if ((s) > MLEN) \
				panic("build > MLEN"); \
			mb->m_next = mb2; \
			mb = mb2; \
			mb->m_len = 0; \
			bpos = mtod(mb, caddr_t); \
		} \
		(a) = (c)(bpos); \
		mb->m_len += (s); \
		bpos += (s); }

#define	rpcm_dissect(a, c, s) \
		{ t1 = mtod(md, caddr_t)+md->m_len-dpos; \
		if (t1 >= (s)) { \
			(a) = (c)(dpos); \
			dpos += (s); \
		} else if ((t1 = rpcm_disct(&md, &dpos, (s), t1, &cp2)) != 0){ \
			error = t1; \
			goto rpcmout; \
		} else { \
			(a) = (c)cp2; \
		} }

#if 0
#define rpcm_mtouio(p,s) \
		if ((s) > 0 && \
		   (t1 = rpcm_mbuftouio(&md,(p),(s),&dpos)) != 0) { \
			error = t1; \
			goto rpcmout; \
		}
#endif

#define rpcm_rndup(a)	(((a)+3)&(~0x3))

#define	rpcm_adv(s) \
		{ t1 = mtod(md, caddr_t)+md->m_len-dpos; \
		if (t1 >= (s)) { \
			dpos += (s); \
		} else if ((t1 = rpc_adv(&md, &dpos, (s), t1)) != 0) { \
			error = t1; \
			goto rpcmout; \
		} }

#define RPCMADV(m, s)   (m)->m_data += (s)

#endif /* _RPC_RPCM_SUBS_H_ */


text:
<?php
/**
 * Created by PhpStorm.
 * User: philippsester
 * Date: 15.09.20
 * Time: 17:57
 */

namespace Enhavo\Bundle\ShopBundle\Menu;

use Enhavo\Bundle\AppBundle\Menu\Menu\BaseMenu;
use Symfony\Component\OptionsResolver\OptionsResolver;

class TaxRateMenu extends BaseMenu
{
    public function configureOptions(OptionsResolver $resolver)
    {
        parent::configureOptions($resolver);

        $resolver->setDefaults([
            'icon' => 'work',
            'label' =>  'tax.label.tax_rate',
            'translation_domain' => 'EnhavoShopBundle',
            'route' => 'sylius_tax_rate_index',
            'role' => 'ROLE_SYLIUS_TAX_RATE_INDEX',
        ]);
    }

    public function getType()
    {
        return 'shop_tax_rate';
    }
}


text:
<?xml version="1.0" encoding="UTF-8"?>
<beans xmlns="http://www.springframework.org/schema/beans"
       xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
       xmlns:dubbo="http://code.alibabatech.com/schema/dubbo"
       xsi:schemaLocation="http://www.springframework.org/schema/beans
        http://www.springframework.org/schema/beans/spring-beans.xsd
        http://code.alibabatech.com/schema/dubbo
        http://code.alibabatech.com/schema/dubbo/dubbo.xsd
        ">

    <!-- consumer application name -->
    <dubbo:application name="test-consumer"  />

    <!-- registry address, used for consumer to discover services -->
    <!--<dubbo:registry address="multicast://224.5.6.7:1234" />-->
    <dubbo:registry protocol="zookeeper" address="192.168.18.254:2181" />

    <!-- which service to consume? -->
    <dubbo:reference id="testService" interface="cn.mf.dubbo.service.TestService" />

</beans>


text:
This page lists all documentation markdown files for Google Mock **(the
current git version)**
-- **if you use a former version of Google Mock, please read the
documentation for that specific version instead (e.g. by checking out
the respective git branch/tag).**

  * [ForDummies](ForDummies.md) -- start here if you are new to Google Mock.
  * [CheatSheet](CheatSheet.md) -- a quick reference.
  * [CookBook](CookBook.md) -- recipes for doing various tasks using Google Mock.
  * [FrequentlyAskedQuestions](FrequentlyAskedQuestions.md) -- check here before asking a question on the mailing list.

To contribute code to Google Mock, read:

  * [CONTRIBUTING](../CONTRIBUTING.md) -- read this _before_ writing your first patch.
  * [Pump Manual](../../googletest/docs/PumpManual.md) -- how we generate some of Google Mock's source files.