text:
<?php

/**
 * This code was generated by
 * \ / _    _  _|   _  _
 * | (_)\/(_)(_|\/| |(/_  v1.0.0
 * /       /
 */

namespace Twilio\Rest\IpMessaging\V1\Service\Channel;

use Twilio\Options;
use Twilio\Values;

abstract class MessageOptions {
    /**
     * @param string $from The from
     * @param string $attributes The attributes
     * @return CreateMessageOptions Options builder
     */
    public static function create($from = Values::NONE, $attributes = Values::NONE) {
        return new CreateMessageOptions($from, $attributes);
    }

    /**
     * @param string $body The body
     * @param string $attributes The attributes
     * @return UpdateMessageOptions Options builder
     */
    public static function update($body = Values::NONE, $attributes = Values::NONE) {
        return new UpdateMessageOptions($body, $attributes);
    }
}

class CreateMessageOptions extends Options {
    /**
     * @param string $from The from
     * @param string $attributes The attributes
     */
    public function __construct($from = Values::NONE, $attributes = Values::NONE) {
        $this->options['from'] = $from;
        $this->options['attributes'] = $attributes;
    }

    /**
     * The from
     *
     * @param string $from The from
     * @return $this Fluent Builder
     */
    public function setFrom($from) {
        $this->options['from'] = $from;
        return $this;
    }

    /**
     * The attributes
     *
     * @param string $attributes The attributes
     * @return $this Fluent Builder
     */
    public function setAttributes($attributes) {
        $this->options['attributes'] = $attributes;
        return $this;
    }

    /**
     * Provide a friendly representation
     *
     * @return string Machine friendly representation
     */
    public function __toString() {
        $options = array();
        foreach ($this->options as $key => $value) {
            if ($value != Values::NONE) {
                $options[] = "$key=$value";
            }
        }
        return '[Twilio.IpMessaging.V1.CreateMessageOptions ' . implode(' ', $options) . ']';
    }
}

class UpdateMessageOptions extends Options {
    /**
     * @param string $body The body
     * @param string $attributes The attributes
     */
    public function __construct($body = Values::NONE, $attributes = Values::NONE) {
        $this->options['body'] = $body;
        $this->options['attributes'] = $attributes;
    }

    /**
     * The body
     *
     * @param string $body The body
     * @return $this Fluent Builder
     */
    public function setBody($body) {
        $this->options['body'] = $body;
        return $this;
    }

    /**
     * The attributes
     *
     * @param string $attributes The attributes
     * @return $this Fluent Builder
     */
    public function setAttributes($attributes) {
        $this->options['attributes'] = $attributes;
        return $this;
    }

    /**
     * Provide a friendly representation
     *
     * @return string Machine friendly representation
     */
    public function __toString() {
        $options = array();
        foreach ($this->options as $key => $value) {
            if ($value != Values::NONE) {
                $options[] = "$key=$value";
            }
        }
        return '[Twilio.IpMessaging.V1.UpdateMessageOptions ' . implode(' ', $options) . ']';
    }
}


text:
ACCEPTED

#### According to
Index Fungorum

#### Published in
Bull. Herb. Boissier 3(1): 56 (1895)

#### Original name
Thelephora rufofulva Mont.

### Remarks
null

redpajama_set_name: RedPajamaGithub


text:
var _typeof = typeof Symbol === "function" && typeof Symbol.iterator === "symbol" ? function (obj) { return typeof obj; } : function (obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; };

/* Tabulator v4.2.5 (c) Oliver Folkerd */

var SelectRow = function SelectRow(table) {
	this.table = table; //hold Tabulator object
	this.selecting = false; //flag selecting in progress
	this.lastClickedRow = false; //last clicked row
	this.selectPrev = []; //hold previously selected element for drag drop selection
	this.selectedRows = []; //hold selected rows
};

SelectRow.prototype.clearSelectionData = function (silent) {
	this.selecting = false;
	this.lastClickedRow = false;
	this.selectPrev = [];
	this.selectedRows = [];

	if (!silent) {
		this._rowSelectionChanged();
	}
};

SelectRow.prototype.initializeRow = function (row) {
	var self = this,
	    element = row.getElement();

	// trigger end of row selection
	var endSelect = function endSelect() {

		setTimeout(function () {
			self.selecting = false;
		}, 50);

		document.body.removeEventListener("mouseup", endSelect);
	};

	row.modules.select = { selected: false };

	//set row selection class
	if (self.table.options.selectableCheck.call(this.table, row.getComponent())) {
		element.classList.add("tabulator-selectable");
		element.classList.remove("tabulator-unselectable");

		if (self.table.options.selectable && self.table.options.selectable != "highlight") {
			if (self.table.options.selectableRangeMode && self.table.options.selectableRangeMode === "click") {
				element.addEventListener("click", function (e) {
					if (e.shiftKey) {
						self.lastClickedRow = self.lastClickedRow || row;

						var lastClickedRowIdx = self.table.rowManager.getDisplayRowIndex(self.lastClickedRow);
						var rowIdx = self.table.rowManager.getDisplayRowIndex(row);

						var fromRowIdx = lastClickedRowIdx <= rowIdx ? lastClickedRowIdx : rowIdx;
						var toRowIdx = lastClickedRowIdx >= rowIdx ? lastClickedRowIdx : rowIdx;

						var rows = self.table.rowManager.getDisplayRows().slice(0);
						var toggledRows = rows.splice(fromRowIdx, toRowIdx - fromRowIdx + 1);

						if (e.ctrlKey) {
							toggledRows.forEach(function (toggledRow) {
								if (toggledRow !== self.lastClickedRow) {
									self.toggleRow(toggledRow);
								}
							});
							self.lastClickedRow = row;
						} else {
							self.deselectRows();
							self.selectRows(toggledRows);
						}
					} else if (e.ctrlKey) {
						self.toggleRow(row);
						self.lastClickedRow = row;
					} else {
						self.deselectRows();
						self.selectRows(row);
						self.lastClickedRow = row;
					}
				});
			} else {
				element.addEventListener("click", function (e) {
					if (!self.selecting) {
						self.toggleRow(row);
					}
				});

				element.addEventListener("mousedown", function (e) {
					if (e.shiftKey) {
						self.selecting = true;

						self.selectPrev = [];

						document.body.addEventListener("mouseup", endSelect);
						document.body.addEventListener("keyup", endSelect);

						self.toggleRow(row);

						return false;
					}
				});

				element.addEventListener("mouseenter", function (e) {
					if (self.selecting) {
						self.toggleRow(row);

						if (self.selectPrev[1] == row) {
							self.toggleRow(self.selectPrev[0]);
						}
					}
				});

				element.addEventListener("mouseout", function (e) {
					if (self.selecting) {
						self.selectPrev.unshift(row);
					}
				});
			}
		}
	} else {
		element.classList.add("tabulator-unselectable");
		element.classList.remove("tabulator-selectable");
	}
};

//toggle row selection
SelectRow.prototype.toggleRow = function (row) {
	if (this.table.options.selectableCheck.call(this.table, row.getComponent())) {
		if (row.modules.select && row.modules.select.selected) {
			this._deselectRow(row);
		} else {
			this._selectRow(row);
		}
	}
};

//select a number of rows
SelectRow.prototype.selectRows = function (rows) {
	var self = this;

	switch (typeof rows === "undefined" ? "undefined" : _typeof(rows)) {
		case "undefined":
			self.table.rowManager.rows.forEach(function (row) {
				self._selectRow(row, true, true);
			});

			self._rowSelectionChanged();
			break;

		case "boolean":
			if (rows === true) {
				self.table.rowManager.activeRows.forEach(function (row) {
					self._selectRow(row, true, true);
				});

				self._rowSelectionChanged();
			}
			break;

		default:
			if (Array.isArray(rows)) {
				rows.forEach(function (row) {
					self._selectRow(row, true, true);
				});

				self._rowSelectionChanged();
			} else {
				self._selectRow(rows, false, true);
			}
			break;
	}
};

//select an individual row
SelectRow.prototype._selectRow = function (rowInfo, silent, force) {
	var index;

	//handle max row count
	if (!isNaN(this.table.options.selectable) && this.table.options.selectable !== true && !force) {
		if (this.selectedRows.length >= this.table.options.selectable) {
			if (this.table.options.selectableRollingSelection) {
				this._deselectRow(this.selectedRows[0]);
			} else {
				return false;
			}
		}
	}

	var row = this.table.rowManager.findRow(rowInfo);

	if (row) {
		if (this.selectedRows.indexOf(row) == -1) {
			if (!row.modules.select) {
				row.modules.select = {};
			}

			row.modules.select.selected = true;
			row.getElement().classList.add("tabulator-selected");

			this.selectedRows.push(row);

			if (!silent) {
				this.table.options.rowSelected.call(this.table, row.getComponent());
				this._rowSelectionChanged();
			}
		}
	} else {
		if (!silent) {
			console.warn("Selection Error - No such row found, ignoring selection:" + rowInfo);
		}
	}
};

SelectRow.prototype.isRowSelected = function (row) {
	return this.selectedRows.indexOf(row) !== -1;
};

//deselect a number of rows
SelectRow.prototype.deselectRows = function (rows) {
	var self = this,
	    rowCount;

	if (typeof rows == "undefined") {

		rowCount = self.selectedRows.length;

		for (var i = 0; i < rowCount; i++) {
			self._deselectRow(self.selectedRows[0], true);
		}

		self._rowSelectionChanged();
	} else {
		if (Array.isArray(rows)) {
			rows.forEach(function (row) {
				self._deselectRow(row, true);
			});

			self._rowSelectionChanged();
		} else {
			self._deselectRow(rows);
		}
	}
};

//deselect an individual row
SelectRow.prototype._deselectRow = function (rowInfo, silent) {
	var self = this,
	    row = self.table.rowManager.findRow(rowInfo),
	    index;

	if (row) {
		index = self.selectedRows.findIndex(function (selectedRow) {
			return selectedRow == row;
		});

		if (index > -1) {

			if (!row.modules.select) {
				row.modules.select = {};
			}

			row.modules.select.selected = false;
			row.getElement().classList.remove("tabulator-selected");
			self.selectedRows.splice(index, 1);

			if (!silent) {
				self.table.options.rowDeselected.call(this.table, row.getComponent());
				self._rowSelectionChanged();
			}
		}
	} else {
		if (!silent) {
			console.warn("Deselection Error - No such row found, ignoring selection:" + rowInfo);
		}
	}
};

SelectRow.prototype.getSelectedData = function () {
	var data = [];

	this.selectedRows.forEach(function (row) {
		data.push(row.getData());
	});

	return data;
};

SelectRow.prototype.getSelectedRows = function () {

	var rows = [];

	this.selectedRows.forEach(function (row) {
		rows.push(row.getComponent());
	});

	return rows;
};

SelectRow.prototype._rowSelectionChanged = function () {
	this.table.options.rowSelectionChanged.call(this.table, this.getSelectedData(), this.getSelectedRows());
};

Tabulator.prototype.registerModule("selectRow", SelectRow);


text:
const React = require('react');
const { PureComponent } = require('react');
const { View, Text } = require('react-native');

const FAB = 'fab';

class TopTabScreen extends PureComponent {
  static options() {
    return {
      topBar: {
        title: {
          color: 'black',
          fontSize: 16,
          fontFamily: 'HelveticaNeue-Italic'
        }
      },
      fab: {
        id: FAB,
        backgroundColor: 'blue',
        clickColor: 'blue',
        rippleColor: 'aquamarine'
      }
    };
  }

  render() {
    return (
      <View style={styles.root}>
        <Text style={styles.h1}>{this.props.text || 'Top Tab Screen'}</Text>
        <Text style={styles.footer}>{`this.props.componentId = ${this.props.componentId}`}</Text>
      </View>
    );
  }
}

module.exports = TopTabScreen;

const styles = {
  root: {
    flexGrow: 1,
    justifyContent: 'center',
    alignItems: 'center',
    backgroundColor: '#f5fcff'
  },
  h1: {
    fontSize: 24,
    textAlign: 'center',
    margin: 10
  },
  h2: {
    fontSize: 12,
    textAlign: 'center',
    margin: 10
  },
  footer: {
    fontSize: 10,
    color: '#888',
    marginTop: 10
  }
};


text:
package com.github.antiad.AntiAd;

import com.github.antiad.AntiAd.model.Config;
import com.github.antiad.AntiAd.model.Core;
import org.bukkit.entity.Player;
import org.junit.Assert;
import org.junit.Before;
import org.junit.Ignore;
import org.junit.Test;
import org.mockito.Mock;
import org.mockito.Mockito;
import org.mockito.MockitoAnnotations;

public class CheckTest {

    public CheckTest() {
    }

    @Mock
    private AntiAd plugin;
    @Mock
    private Core core;
    @Mock
    private Config config;
    @Mock
    private Adfinder adfinder;
    @Mock
    private Player player;

    @Before
    public void before() {
        MockitoAnnotations.initMocks(this);
        Mockito.when(core.getConfig()).thenReturn(config);
        Mockito.when(core.getPlugin()).thenReturn(plugin);
        Mockito.when(plugin.getAdfinder()).thenReturn(adfinder);
        Mockito.when(config.isSpamDetection()).thenReturn(true);

    }

    @Test
    public void testAllAdfinderMethodsAreCalled() {

        Check check = new Check(core, player);

        check.check("Hello World", 1, true);

        Mockito.verify(adfinder).checkForAdvertising(check);
        Mockito.verify(adfinder).checkForCaps(check);
        Mockito.verify(adfinder).checkForSpam(check);
        Assert.assertFalse(check.isAdvertisement());
        Assert.assertFalse(check.isCaps());
        Assert.assertFalse(check.isSpam());
    }

    @Test
    public void testOnlyAdvertisementAdfinderMethodsAreCalled() {

        Mockito.when(core.getConfig().isSpamDetection()).thenReturn(false);

        Check check = new Check(core, player);

        check.check("Hello World", 1, true);

        Mockito.verify(adfinder).checkForAdvertising(check);
        Mockito.verify(adfinder, Mockito.never()).checkForCaps(check);
        Mockito.verify(adfinder, Mockito.never()).checkForSpam(check);
        Assert.assertFalse(check.isAdvertisement());
        Assert.assertFalse(check.isCaps());
        Assert.assertFalse(check.isSpam());
    }

    @Test
    public void testOtherChecksAreSkippedWhenAdvertisementsAreDetected() {
        Mockito.when(core.getConfig().isSpamDetection()).thenReturn(true);
        Mockito.when(adfinder.checkForAdvertising(Mockito.any(Check.class))).thenReturn(1);

        Check check = new Check(core, player);

        check.check("Hello World", 1, true);

        Mockito.verify(adfinder).checkForAdvertising(check);
        Mockito.verify(adfinder, Mockito.never()).checkForCaps(check);
        Mockito.verify(adfinder, Mockito.never()).checkForSpam(check);
        Assert.assertTrue(check.isAdvertisement());
        Assert.assertFalse(check.isCaps());
        Assert.assertFalse(check.isSpam());
    }

    @Ignore
    @Test
    public void testOtherChecksAreStillRunWhenWhitelistedAdvertisementsAreDetected() {
        Check check = new Check(core, player);
        check.check("Hello World", 1, true);

        Mockito.verify(adfinder).checkForAdvertising(check);
        Mockito.verify(adfinder).checkForCaps(check);
        Mockito.verify(adfinder).checkForSpam(check);
        Assert.assertFalse(check.isAdvertisement());
        Assert.assertFalse(check.isCaps());
        Assert.assertFalse(check.isSpam());
    }

}


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 wvlet.airframe.launcher;

import java.lang.annotation.ElementType;
import java.lang.annotation.Retention;
import java.lang.annotation.RetentionPolicy;
import java.lang.annotation.Target;

/**
 * Annotation for specifying command-line options.
 */
@Retention(RetentionPolicy.RUNTIME)
@Target({ElementType.FIELD, ElementType.METHOD, ElementType.PARAMETER})
public @interface option {

    /**
     * Comma-separated list of option prefixes. For example, "-h,--help" handles option "-h" and
     * "--help". If no prefix is specified, this parameter is handled as a nested option.
     */
    String prefix() default "";

    /**
     * Description of the option, used to generate a help message of this
     * command-line option.
     */
    String description() default "";

    /**
     * If this option is used as a switch to display help messages of commands, set this value to true.
     */
    boolean isHelp() default false;
}


text:
import $ from 'jquery';
import * as ko from 'knockout';

import huePubSub from 'utils/huePubSub';
import { hueLocalStorage } from 'utils/storageUtils';

ko.bindingHandlers.splitDraggable = {
  init: function (element, valueAccessor) {
    const options = ko.unwrap(valueAccessor());
    let leftPanelWidth =
      hueLocalStorage(options.appName + '_left_panel_width') != null
        ? Math.max(hueLocalStorage(options.appName + '_left_panel_width'), 250)
        : 250;
    let rightPanelWidth =
      hueLocalStorage(options.appName + '_right_panel_width') != null
        ? Math.max(hueLocalStorage(options.appName + '_right_panel_width'), 250)
        : 290;

    const containerSelector = options.containerSelector || '.panel-container';
    const contentPanelSelector = options.contentPanelSelector || '.content-panel';

    const onPosition = options.onPosition || function () {};

    const hasLeftPanel = !!options.leftPanelVisible;
    const hasRightPanel = !!options.rightPanelVisible;

    const isRightPanel = !!options.isRightPanel;

    const $resizer = $(element);
    const $leftPanel = $('.left-panel');
    const $rightPanel = $('.right-panel');
    const $contentPanel = $(contentPanelSelector);
    const $container = $(containerSelector);

    const positionPanels = function () {
      if (isRightPanel) {
        const oppositeWidth =
          hasLeftPanel && ko.unwrap(options.leftPanelVisible)
            ? $leftPanel.width() + $resizer.width()
            : 0;
        const totalWidth = $container.width() - oppositeWidth;
        if (ko.unwrap(options.rightPanelVisible) && ko.unwrap(options.rightPanelAvailable)) {
          $resizer.show();
          rightPanelWidth = Math.min(rightPanelWidth, $container.width() - 100);
          const contentPanelWidth = totalWidth - rightPanelWidth - $resizer.width();
          $rightPanel.css('width', rightPanelWidth + 'px');
          $contentPanel.css('width', contentPanelWidth + 'px');
          $resizer.css('left', $container.width() - rightPanelWidth - $resizer.width() + 'px');
          $contentPanel.css('right', rightPanelWidth + $resizer.width() + 'px');
        } else {
          if (oppositeWidth === 0) {
            $contentPanel.css('width', '100%');
          } else {
            $contentPanel.css('width', totalWidth);
          }
          $contentPanel.css('right', '0');
          $resizer.hide();
        }
      } else {
        const oppositeWidth =
          hasRightPanel &&
          ko.unwrap(options.rightPanelVisible) &&
          ko.unwrap(options.rightPanelAvailable)
            ? $rightPanel.width() + $resizer.width()
            : 0;
        const totalWidth = $container.width() - oppositeWidth;
        if (ko.unwrap(options.leftPanelVisible)) {
          $resizer.show();
          leftPanelWidth = Math.min(leftPanelWidth, totalWidth - 100);
          const contentPanelWidth = totalWidth - leftPanelWidth - $resizer.width();
          $leftPanel.css('width', leftPanelWidth + 'px');
          $contentPanel.css('width', contentPanelWidth + 'px');
          $resizer.css('left', leftPanelWidth + 'px');
          $contentPanel.css('left', leftPanelWidth + $resizer.width() + 'px');
        } else {
          if (oppositeWidth === 0) {
            $contentPanel.css('width', '100%');
          } else {
            $contentPanel.css('width', totalWidth);
          }
          $contentPanel.css('left', '0');
          $resizer.hide();
        }
      }
      onPosition();
    };

    if (ko.isObservable(options.leftPanelVisible)) {
      options.leftPanelVisible.subscribe(positionPanels);
    }

    if (ko.isObservable(options.rightPanelVisible)) {
      options.rightPanelVisible.subscribe(positionPanels);
    }

    if (ko.isObservable(options.rightPanelAvailable)) {
      options.rightPanelAvailable.subscribe(positionPanels);
    }

    let dragTimeout = -1;
    $resizer.draggable({
      axis: 'x',
      containment: $container,
      drag: function (event, ui) {
        if (isRightPanel) {
          ui.position.left = Math.min($container.width() - 200, ui.position.left);
        } else {
          ui.position.left = Math.min(
            $container.width() - $container.position().left - 200,
            Math.max(250, ui.position.left)
          );
        }

        window.clearTimeout(dragTimeout);
        dragTimeout = window.setTimeout(() => {
          if (isRightPanel) {
            const oppositeWidth =
              hasLeftPanel && ko.unwrap(options.leftPanelVisible)
                ? $leftPanel.width() + $resizer.width()
                : 0;
            const totalWidth = $container.width() - oppositeWidth;
            rightPanelWidth = $container.width() - ui.position.left;
            $rightPanel.css('width', rightPanelWidth + 'px');
            $contentPanel.css('width', totalWidth - rightPanelWidth + 'px');
            // $contentPanel.css("right", rightPanelWidth + $resizer.width());
          } else {
            const oppositeWidth =
              hasRightPanel && ko.unwrap(options.rightPanelVisible)
                ? $rightPanel.width() + $resizer.width()
                : 0;
            const totalWidth = $container.width() - oppositeWidth;
            leftPanelWidth = ui.position.left;
            $leftPanel.css('width', leftPanelWidth + 'px');
            $contentPanel.css('width', totalWidth - leftPanelWidth - $resizer.width() + 'px');
            $contentPanel.css('left', leftPanelWidth + $resizer.width());
          }
          onPosition();
        }, 10);
      },
      stop: function () {
        if (isRightPanel) {
          hueLocalStorage(options.appName + '_right_panel_width', rightPanelWidth);
        } else {
          hueLocalStorage(options.appName + '_left_panel_width', leftPanelWidth);
        }
        window.setTimeout(positionPanels, 100);
        huePubSub.publish('split.panel.resized');
      }
    });

    let positionTimeout = -1;
    $(window).resize(() => {
      window.clearTimeout(positionTimeout);
      positionTimeout = window.setTimeout(() => {
        positionPanels();
      }, 1);
    });

    function initialPositioning() {
      if (!$container.is(':visible')) {
        window.setTimeout(initialPositioning, 50);
      } else {
        positionPanels();
        // Even though the container is visible some slow browsers might not
        // have rendered the panels
        window.setTimeout(positionPanels, 100);
      }
    }

    initialPositioning();
  }
};


text:
<?php

namespace AcistGroup\DoaManagerBundle\Entity;

use Doctrine\ORM\EntityRepository;

/**
 * ShipperRepository
 *
 * This class was generated by the Doctrine ORM. Add your own custom
 * repository methods below.
 */
class ShipperRepository extends EntityRepository
{
}


text:
/*
 * This file is generated by jOOQ.
 */
package stroom.storedquery.impl.db.jooq.tables.records;

import stroom.storedquery.impl.db.jooq.tables.Query;

import org.jooq.Field;
import org.jooq.Record1;
import org.jooq.Record11;
import org.jooq.Row11;
import org.jooq.impl.UpdatableRecordImpl;

/**
 * This class is generated by jOOQ.
 */
@SuppressWarnings({ "all", "unchecked", "rawtypes" })
public class QueryRecord extends UpdatableRecordImpl<QueryRecord> implements Record11<Integer, Integer, Long, String, Long, String, String, String, String, String, Boolean> {

    private static final long serialVersionUID = 1L;

    /**
     * Setter for stroom.query.id.
     */
    public void setId(Integer value) {
        set(0, value);
    }

    /**
     * Getter for stroom.query.id.
     */
    public Integer getId() {
        return (Integer) get(0);
    }

    /**
     * Setter for stroom.query.version.
     */
    public void setVersion(Integer value) {
        set(1, value);
    }

    /**
     * Getter for stroom.query.version.
     */
    public Integer getVersion() {
        return (Integer) get(1);
    }

    /**
     * Setter for stroom.query.create_time_ms.
     */
    public void setCreateTimeMs(Long value) {
        set(2, value);
    }

    /**
     * Getter for stroom.query.create_time_ms.
     */
    public Long getCreateTimeMs() {
        return (Long) get(2);
    }

    /**
     * Setter for stroom.query.create_user.
     */
    public void setCreateUser(String value) {
        set(3, value);
    }

    /**
     * Getter for stroom.query.create_user.
     */
    public String getCreateUser() {
        return (String) get(3);
    }

    /**
     * Setter for stroom.query.update_time_ms.
     */
    public void setUpdateTimeMs(Long value) {
        set(4, value);
    }

    /**
     * Getter for stroom.query.update_time_ms.
     */
    public Long getUpdateTimeMs() {
        return (Long) get(4);
    }

    /**
     * Setter for stroom.query.update_user.
     */
    public void setUpdateUser(String value) {
        set(5, value);
    }

    /**
     * Getter for stroom.query.update_user.
     */
    public String getUpdateUser() {
        return (String) get(5);
    }

    /**
     * Setter for stroom.query.dashboard_uuid.
     */
    public void setDashboardUuid(String value) {
        set(6, value);
    }

    /**
     * Getter for stroom.query.dashboard_uuid.
     */
    public String getDashboardUuid() {
        return (String) get(6);
    }

    /**
     * Setter for stroom.query.component_id.
     */
    public void setComponentId(String value) {
        set(7, value);
    }

    /**
     * Getter for stroom.query.component_id.
     */
    public String getComponentId() {
        return (String) get(7);
    }

    /**
     * Setter for stroom.query.name.
     */
    public void setName(String value) {
        set(8, value);
    }

    /**
     * Getter for stroom.query.name.
     */
    public String getName() {
        return (String) get(8);
    }

    /**
     * Setter for stroom.query.data.
     */
    public void setData(String value) {
        set(9, value);
    }

    /**
     * Getter for stroom.query.data.
     */
    public String getData() {
        return (String) get(9);
    }

    /**
     * Setter for stroom.query.favourite.
     */
    public void setFavourite(Boolean value) {
        set(10, value);
    }

    /**
     * Getter for stroom.query.favourite.
     */
    public Boolean getFavourite() {
        return (Boolean) get(10);
    }

    // -------------------------------------------------------------------------
    // Primary key information
    // -------------------------------------------------------------------------

    @Override
    public Record1<Integer> key() {
        return (Record1) super.key();
    }

    // -------------------------------------------------------------------------
    // Record11 type implementation
    // -------------------------------------------------------------------------

    @Override
    public Row11<Integer, Integer, Long, String, Long, String, String, String, String, String, Boolean> fieldsRow() {
        return (Row11) super.fieldsRow();
    }

    @Override
    public Row11<Integer, Integer, Long, String, Long, String, String, String, String, String, Boolean> valuesRow() {
        return (Row11) super.valuesRow();
    }

    @Override
    public Field<Integer> field1() {
        return Query.QUERY.ID;
    }

    @Override
    public Field<Integer> field2() {
        return Query.QUERY.VERSION;
    }

    @Override
    public Field<Long> field3() {
        return Query.QUERY.CREATE_TIME_MS;
    }

    @Override
    public Field<String> field4() {
        return Query.QUERY.CREATE_USER;
    }

    @Override
    public Field<Long> field5() {
        return Query.QUERY.UPDATE_TIME_MS;
    }

    @Override
    public Field<String> field6() {
        return Query.QUERY.UPDATE_USER;
    }

    @Override
    public Field<String> field7() {
        return Query.QUERY.DASHBOARD_UUID;
    }

    @Override
    public Field<String> field8() {
        return Query.QUERY.COMPONENT_ID;
    }

    @Override
    public Field<String> field9() {
        return Query.QUERY.NAME;
    }

    @Override
    public Field<String> field10() {
        return Query.QUERY.DATA;
    }

    @Override
    public Field<Boolean> field11() {
        return Query.QUERY.FAVOURITE;
    }

    @Override
    public Integer component1() {
        return getId();
    }

    @Override
    public Integer component2() {
        return getVersion();
    }

    @Override
    public Long component3() {
        return getCreateTimeMs();
    }

    @Override
    public String component4() {
        return getCreateUser();
    }

    @Override
    public Long component5() {
        return getUpdateTimeMs();
    }

    @Override
    public String component6() {
        return getUpdateUser();
    }

    @Override
    public String component7() {
        return getDashboardUuid();
    }

    @Override
    public String component8() {
        return getComponentId();
    }

    @Override
    public String component9() {
        return getName();
    }

    @Override
    public String component10() {
        return getData();
    }

    @Override
    public Boolean component11() {
        return getFavourite();
    }

    @Override
    public Integer value1() {
        return getId();
    }

    @Override
    public Integer value2() {
        return getVersion();
    }

    @Override
    public Long value3() {
        return getCreateTimeMs();
    }

    @Override
    public String value4() {
        return getCreateUser();
    }

    @Override
    public Long value5() {
        return getUpdateTimeMs();
    }

    @Override
    public String value6() {
        return getUpdateUser();
    }

    @Override
    public String value7() {
        return getDashboardUuid();
    }

    @Override
    public String value8() {
        return getComponentId();
    }

    @Override
    public String value9() {
        return getName();
    }

    @Override
    public String value10() {
        return getData();
    }

    @Override
    public Boolean value11() {
        return getFavourite();
    }

    @Override
    public QueryRecord value1(Integer value) {
        setId(value);
        return this;
    }

    @Override
    public QueryRecord value2(Integer value) {
        setVersion(value);
        return this;
    }

    @Override
    public QueryRecord value3(Long value) {
        setCreateTimeMs(value);
        return this;
    }

    @Override
    public QueryRecord value4(String value) {
        setCreateUser(value);
        return this;
    }

    @Override
    public QueryRecord value5(Long value) {
        setUpdateTimeMs(value);
        return this;
    }

    @Override
    public QueryRecord value6(String value) {
        setUpdateUser(value);
        return this;
    }

    @Override
    public QueryRecord value7(String value) {
        setDashboardUuid(value);
        return this;
    }

    @Override
    public QueryRecord value8(String value) {
        setComponentId(value);
        return this;
    }

    @Override
    public QueryRecord value9(String value) {
        setName(value);
        return this;
    }

    @Override
    public QueryRecord value10(String value) {
        setData(value);
        return this;
    }

    @Override
    public QueryRecord value11(Boolean value) {
        setFavourite(value);
        return this;
    }

    @Override
    public QueryRecord values(Integer value1, Integer value2, Long value3, String value4, Long value5, String value6, String value7, String value8, String value9, String value10, Boolean value11) {
        value1(value1);
        value2(value2);
        value3(value3);
        value4(value4);
        value5(value5);
        value6(value6);
        value7(value7);
        value8(value8);
        value9(value9);
        value10(value10);
        value11(value11);
        return this;
    }

    // -------------------------------------------------------------------------
    // Constructors
    // -------------------------------------------------------------------------

    /**
     * Create a detached QueryRecord
     */
    public QueryRecord() {
        super(Query.QUERY);
    }

    /**
     * Create a detached, initialised QueryRecord
     */
    public QueryRecord(Integer id, Integer version, Long createTimeMs, String createUser, Long updateTimeMs, String updateUser, String dashboardUuid, String componentId, String name, String data, Boolean favourite) {
        super(Query.QUERY);

        setId(id);
        setVersion(version);
        setCreateTimeMs(createTimeMs);
        setCreateUser(createUser);
        setUpdateTimeMs(updateTimeMs);
        setUpdateUser(updateUser);
        setDashboardUuid(dashboardUuid);
        setComponentId(componentId);
        setName(name);
        setData(data);
        setFavourite(favourite);
    }
}


text:
package models

// import (
// 	"github.com/messagedb/messagedb/meta/schema"
// 	"github.com/messagedb/messagedb/meta/utils"
//
// 	"gopkg.in/mgo.v2/bson"
// )
//
// // Instance
// var Conversation *ConversationModel
//
// // ConversationModel represents the storage model for a schema.Conversation
// type ConversationModel struct {
// 	*storage.Model
// }
//
// // New creates a new Conversation model
// func (m *ConversationModel) New() *schema.Conversation {
// 	conversation := schema.NewConversation()
// 	return storage.CreateDocument(conversation).(*schema.Conversation)
// }
//
// // FindByID returns a conversation based on the ID provided
// func (m *ConversationModel) FindByID(id interface{}) (*schema.Conversation, error) {
// 	conversation := &schema.Conversation{}
// 	err := m.FindId(utils.ObjectId(id)).One(conversation)
// 	if err != nil {
// 		return nil, err
// 	}
// 	return conversation, nil
// }
//
// // FindAllByNamespaceID returns all the conversations that belongs to the namespace ID
// func (m *ConversationModel) FindAllByNamespaceID(namespaceID interface{}) ([]*schema.Conversation, error) {
// 	var conversations []*schema.Conversation
// 	err := m.Find(bson.M{"namespace.id": utils.ObjectId(namespaceID)}).All(&conversations)
// 	if err != nil {
// 		return nil, err
// 	}
// 	return conversations, nil
// }
//
// // FindAllByNamespacePath returns all the conversations that belongs to the namespace path
// func (m *ConversationModel) FindAllByNamespacePath(namespacePath string) ([]*schema.Conversation, error) {
// 	var conversations []*schema.Conversation
// 	err := m.Find(bson.M{"namespace.path": namespacePath}).All(&conversations)
// 	if err != nil {
// 		return nil, err
// 	}
// 	return conversations, nil
// }

// func init() {
// 	Conversation = storage.RegisterModel(schema.Conversation{}, "conversations", func(col *mgo.Collection) interface{} {
// 		return &ConversationModel{storage.NewModel(col)}
// 	}).(*ConversationModel)
//
// 	// create required indexes in MongoDB
// 	indexes := []mgo.Index{}
//
// 	indexes = append(indexes, mgo.Index{
// 		Key:        []string{"namespace.id, conversation_type, last_active_at"},
// 		Unique:     false,
// 		DropDups:   false,
// 		Background: true, // See notes.
// 		Sparse:     false,
// 	})
//
// 	indexes = append(indexes, mgo.Index{
// 		Key:        []string{"namespace.path, conversation_type, last_active_at"},
// 		Unique:     false,
// 		DropDups:   false,
// 		Background: true, // See notes.
// 		Sparse:     false,
// 	})
//
// 	indexes = append(indexes, mgo.Index{
// 		Key:        []string{"title"},
// 		Unique:     false,
// 		DropDups:   false,
// 		Background: true, // See notes.
// 		Sparse:     false,
// 	})
//
// 	for _, index := range indexes {
// 		err := Organization.EnsureIndex(index)
// 		if err != nil {
// 			log.Panicf("Failed to ensure index on 'users' Collection: %v", index)
// 		}
// 	}
//
// }


text:
layout: page
title: Charm International Show
date: 2016-05-24
author: Michelle Melendez
tags: weekly links, java
status: published
summary: Duis venenatis turpis quis eros pharetra, ac gravida tellus.
banner: images/banner/meeting-01.jpg
booking:
  startDate: 06/27/2017
  endDate: 07/01/2017
  ctyhocn: DENGDHX
  groupCode: CIS
published: true
---
Nullam aliquam risus quis dui aliquam luctus. Nullam consequat suscipit metus, quis consequat tortor. Nulla lorem turpis, consequat id pretium in, iaculis vitae lorem. Sed porttitor, urna a tincidunt finibus, est dolor sagittis dolor, ac faucibus orci turpis ut velit. Nunc porta sed ipsum vitae iaculis. Nunc consectetur sem nisl, nec euismod tortor scelerisque id. Cum sociis natoque penatibus et magnis dis parturient montes, nascetur ridiculus mus.

1 Etiam elementum ex vitae faucibus vestibulum
1 Donec et nulla consequat tortor luctus laoreet vitae ut erat.

Curabitur malesuada ex felis. Nullam mattis dapibus ornare. Suspendisse sodales sapien et porta laoreet. Proin sit amet elit in arcu iaculis molestie. Nullam ut dolor non enim ullamcorper efficitur eu laoreet tortor. Aliquam et iaculis ex. Cras est magna, pretium at nulla quis, sagittis lobortis lorem. Donec aliquam orci vitae consectetur convallis. Vivamus convallis in libero ut pharetra. Donec sed varius lacus. Aenean iaculis sit amet ante non venenatis. Mauris quis tincidunt nibh. Mauris sagittis non ex ac eleifend. Ut volutpat cursus turpis, eget euismod ligula blandit sed. Aliquam et rutrum ante. Integer posuere mollis ipsum sit amet eleifend.


text:
namespace Envoy {
namespace Upstream {

CdsApiPtr CdsApiImpl::create(const envoy::config::core::v3::ConfigSource& cds_config,
                             const xds::core::v3::ResourceLocator* cds_resources_locator,
                             ClusterManager& cm, Stats::Scope& scope,
                             ProtobufMessage::ValidationVisitor& validation_visitor) {
  return CdsApiPtr{
      new CdsApiImpl(cds_config, cds_resources_locator, cm, scope, validation_visitor)};
}

CdsApiImpl::CdsApiImpl(const envoy::config::core::v3::ConfigSource& cds_config,
                       const xds::core::v3::ResourceLocator* cds_resources_locator,
                       ClusterManager& cm, Stats::Scope& scope,
                       ProtobufMessage::ValidationVisitor& validation_visitor)
    : Envoy::Config::SubscriptionBase<envoy::config::cluster::v3::Cluster>(validation_visitor,
                                                                           "name"),
      helper_(cm, "cds"), cm_(cm), scope_(scope.createScope("cluster_manager.cds.")) {
  const auto resource_name = getResourceName();
  if (cds_resources_locator == nullptr) {
    subscription_ = cm_.subscriptionFactory().subscriptionFromConfigSource(
        cds_config, Grpc::Common::typeUrl(resource_name), *scope_, *this, resource_decoder_, {});
  } else {
    subscription_ = cm.subscriptionFactory().collectionSubscriptionFromUrl(
        *cds_resources_locator, cds_config, resource_name, *scope_, *this, resource_decoder_);
  }
}

void CdsApiImpl::onConfigUpdate(const std::vector<Config::DecodedResourceRef>& resources,
                                const std::string& version_info) {
  auto all_existing_clusters = cm_.clusters();
  // Exclude the clusters which CDS wants to add.
  for (const auto& resource : resources) {
    all_existing_clusters.active_clusters_.erase(resource.get().name());
    all_existing_clusters.warming_clusters_.erase(resource.get().name());
  }
  Protobuf::RepeatedPtrField<std::string> to_remove_repeated;
  for (const auto& [cluster_name, _] : all_existing_clusters.active_clusters_) {
    UNREFERENCED_PARAMETER(_);
    *to_remove_repeated.Add() = cluster_name;
  }
  for (const auto& [cluster_name, _] : all_existing_clusters.warming_clusters_) {
    UNREFERENCED_PARAMETER(_);
    // Do not add the cluster twice when the cluster is both active and warming.
    if (all_existing_clusters.active_clusters_.count(cluster_name) == 0) {
      *to_remove_repeated.Add() = cluster_name;
    }
  }
  onConfigUpdate(resources, to_remove_repeated, version_info);
}

void CdsApiImpl::onConfigUpdate(const std::vector<Config::DecodedResourceRef>& added_resources,
                                const Protobuf::RepeatedPtrField<std::string>& removed_resources,
                                const std::string& system_version_info) {
  auto exception_msgs =
      helper_.onConfigUpdate(added_resources, removed_resources, system_version_info);
  runInitializeCallbackIfAny();
  if (!exception_msgs.empty()) {
    throw EnvoyException(
        fmt::format("Error adding/updating cluster(s) {}", absl::StrJoin(exception_msgs, ", ")));
  }
}

void CdsApiImpl::onConfigUpdateFailed(Envoy::Config::ConfigUpdateFailureReason reason,
                                      const EnvoyException*) {
  ASSERT(Envoy::Config::ConfigUpdateFailureReason::ConnectionFailure != reason);
  // We need to allow server startup to continue, even if we have a bad
  // config.
  runInitializeCallbackIfAny();
}

void CdsApiImpl::runInitializeCallbackIfAny() {
  if (initialize_callback_) {
    initialize_callback_();
    initialize_callback_ = nullptr;
  }
}

} // namespace Upstream
} // namespace Envoy


text:
// Code generated by lister-gen. DO NOT EDIT.

package v1alpha1

import (
	v1alpha1 "github.com/knative/observability/pkg/apis/sink/v1alpha1"
	"k8s.io/apimachinery/pkg/api/errors"
	"k8s.io/apimachinery/pkg/labels"
	"k8s.io/client-go/tools/cache"
)

// ClusterLogSinkLister helps list ClusterLogSinks.
type ClusterLogSinkLister interface {
	// List lists all ClusterLogSinks in the indexer.
	List(selector labels.Selector) (ret []*v1alpha1.ClusterLogSink, err error)
	// ClusterLogSinks returns an object that can list and get ClusterLogSinks.
	ClusterLogSinks(namespace string) ClusterLogSinkNamespaceLister
	ClusterLogSinkListerExpansion
}

// clusterLogSinkLister implements the ClusterLogSinkLister interface.
type clusterLogSinkLister struct {
	indexer cache.Indexer
}

// NewClusterLogSinkLister returns a new ClusterLogSinkLister.
func NewClusterLogSinkLister(indexer cache.Indexer) ClusterLogSinkLister {
	return &clusterLogSinkLister{indexer: indexer}
}

// List lists all ClusterLogSinks in the indexer.
func (s *clusterLogSinkLister) List(selector labels.Selector) (ret []*v1alpha1.ClusterLogSink, err error) {
	err = cache.ListAll(s.indexer, selector, func(m interface{}) {
		ret = append(ret, m.(*v1alpha1.ClusterLogSink))
	})
	return ret, err
}

// ClusterLogSinks returns an object that can list and get ClusterLogSinks.
func (s *clusterLogSinkLister) ClusterLogSinks(namespace string) ClusterLogSinkNamespaceLister {
	return clusterLogSinkNamespaceLister{indexer: s.indexer, namespace: namespace}
}

// ClusterLogSinkNamespaceLister helps list and get ClusterLogSinks.
type ClusterLogSinkNamespaceLister interface {
	// List lists all ClusterLogSinks in the indexer for a given namespace.
	List(selector labels.Selector) (ret []*v1alpha1.ClusterLogSink, err error)
	// Get retrieves the ClusterLogSink from the indexer for a given namespace and name.
	Get(name string) (*v1alpha1.ClusterLogSink, error)
	ClusterLogSinkNamespaceListerExpansion
}

// clusterLogSinkNamespaceLister implements the ClusterLogSinkNamespaceLister
// interface.
type clusterLogSinkNamespaceLister struct {
	indexer   cache.Indexer
	namespace string
}

// List lists all ClusterLogSinks in the indexer for a given namespace.
func (s clusterLogSinkNamespaceLister) List(selector labels.Selector) (ret []*v1alpha1.ClusterLogSink, err error) {
	err = cache.ListAllByNamespace(s.indexer, s.namespace, selector, func(m interface{}) {
		ret = append(ret, m.(*v1alpha1.ClusterLogSink))
	})
	return ret, err
}

// Get retrieves the ClusterLogSink from the indexer for a given namespace and name.
func (s clusterLogSinkNamespaceLister) Get(name string) (*v1alpha1.ClusterLogSink, error) {
	obj, exists, err := s.indexer.GetByKey(s.namespace + "/" + name)
	if err != nil {
		return nil, err
	}
	if !exists {
		return nil, errors.NewNotFound(v1alpha1.Resource("clusterlogsink"), name)
	}
	return obj.(*v1alpha1.ClusterLogSink), nil
}


text:
package id.co.metrodata;

import java.util.ArrayList;
import java.util.List;

import org.json.JSONObject;

public class JavaTester {

	/**
	 * @param args
	 */
	public static void main(String[] args) {
		//String url = "http://earthquake.usgs.gov/earthquakes/feed/geojsonp/2.5/week";
		String url = "https://login.salesforce.com/services/oauth2/token?grant_type=password&client_id=3MVG9xOCXq4ID1uEcTLh_Hpmux7N.Tc.0DR1OSUgpjhmWU3OHGB5mTd.5tJL93j92_4k3v1SxmYDLK615qKYD&client_secret=596107376026049304&username=radit.sdo@mii.demo&password=metrodata.2";
		//String url = "https://na17.salesforce.com/services/apexrest/ActivitiesBarcodeScannerREST/";
		//String accesstoken = "00Do0000000Ht2i!AQcAQMZhnbMwajKsS5lbDD5ws8GOXhm3QOoTFyY.du_yriyKGHSUzRXT.e42OFfmDiyWHy0D01LI9P02sSkbMOiBGqD0mHVL";

		System.out.println(url);

		JSONParser jParser = new JSONParser();
		JSONObject json = jParser.postJSONObjectFromURL(url);
		//JSONArray json = jParser.getJSONFromUrl(url, accesstoken);
		System.out.println(json);
		System.out.println(json.get("access_token"));

		List<String> list_values = new ArrayList<String>();
		list_values.add(json.getString("access_token"));

        /*
		try{
			for(int i=0; i<json.length(); i++){
				JSONObject c = json.getJSONObject(i);

				list_values.add(c.getString("access_token"));
				//list_values.add(c.getString("Subject"));
			}
		} catch (JSONException e){
			e.printStackTrace();
		}
		*/

		System.out.println(list_values);

	}

}


text:
package com.hotels.styx.proxy.interceptors;

import com.hotels.styx.api.HttpInterceptor.Chain;
import com.hotels.styx.api.LiveHttpRequest;
import org.junit.jupiter.api.Test;

import static com.hotels.styx.api.LiveHttpRequest.get;
import static com.hotels.styx.api.LiveHttpResponse.response;
import static com.hotels.styx.proxy.interceptors.RequestRecordingChain.requestRecordingChain;
import static com.hotels.styx.proxy.interceptors.ReturnResponseChain.returnsResponse;
import static com.hotels.styx.support.matchers.IsOptional.isAbsent;
import static io.netty.handler.codec.http.HttpHeaders.Names.CONTENT_LENGTH;
import static io.netty.handler.codec.http.HttpHeaders.Names.TRANSFER_ENCODING;
import static io.netty.handler.codec.http.HttpHeaders.Values.CHUNKED;
import static org.hamcrest.MatcherAssert.assertThat;
import static org.hamcrest.core.Is.is;

public class UnexpectedRequestContentLengthRemoverTest {
    final Chain ANY_RESPONSE_HANDLER = returnsResponse(response().build());
    final UnexpectedRequestContentLengthRemover interceptor = new UnexpectedRequestContentLengthRemover();

    @Test
    public void removesContentLengthIfBothContentLengthAndChunkedHeaderExists() throws Exception {
        LiveHttpRequest request = get("/foo")
                .header(CONTENT_LENGTH, "50")
                .header(TRANSFER_ENCODING, CHUNKED).build();

        LiveHttpRequest interceptedRequest = interceptRequest(request);

        assertThat(interceptedRequest.contentLength(), isAbsent());
        assertThat(interceptedRequest.chunked(), is(true));
    }

    private LiveHttpRequest interceptRequest(LiveHttpRequest request) {
        RequestRecordingChain recording = requestRecordingChain(ANY_RESPONSE_HANDLER);
        interceptor.intercept(request, recording);
        return recording.recordedRequest();
    }
}


text:
namespace carrt_demo
{

class CARRTDemoProgram
{
public:
    // Our Interface with MoveIt
    boost::scoped_ptr<move_group_interface::MoveGroup> move_group_;

    // Baxter Helper
    baxter_control::BaxterUtilities baxter_util_;

    //NodeHandle
    ros::NodeHandle nh;

    CARRTDemoProgram()
    {
        // Create MoveGroup for the Right_Arm
        move_group_.reset(new move_group_interface::MoveGroup("right_arm"));
        move_group_->setPlanningTime(30.0);

        // Let Everything Load
        ros::Duration(1.0).sleep();

        // Enable Baxter
        if(!baxter_util_.enableBaxter())
            return;

        StartRoutine();

        //geometry_msgs::PoseStamped ee_pose;
        //while(ros::ok()) {
        //    ee_pose = move_group_->getCurrentPose("right_gripper_l_finger");
        //    ROS_INFO_STREAM_NAMED("carrt_demo", "Postion (X, Y, Z): (" << ee_pose.pose.position.x << ", " << ee_pose.pose.position.y << ", " << ee_pose.pose.position.z << ")");
        //    ros::Duration(4.0).sleep();
        //}

        // Move to gravity neutral position
        baxter_util_.positionBaxterNeutral();

        // Disable servos
        baxter_util_.disableBaxter();

    }

    bool StartRoutine() {
        while(ros::ok()) {
            geometry_msgs::Pose pos;
            pos.position.x = 1;
            pos.position.y = 1;
            pos.position.z = 1;
            pos.orientation.x = 0;
            pos.orientation.y = 0;
            pos.orientation.z = 0;
            pos.orientation.w = 0;
            move_group_->setRandomTarget();
            move_group_->setStartStateToCurrentState();
            moveit::planning_interface::MoveGroup::Plan plan;
            if(move_group_->plan(plan)) {
              ROS_INFO("Planning Successful!");
              move_group_->execute(plan);
            }
            else {
              ROS_WARN("Planned failed! Not moving");
            }
        }
    }
};

} //namespace

int main(int argc, char **argv) {
    //Start our ROS Node with an Async Thread Spinner (1 Thread)
    ros::init(argc, argv, "carrt_demo_program");
    ros::AsyncSpinner spinner(1);
    spinner.start();

    carrt_demo::CARRTDemoProgram();

    ros::shutdown();

    return 0;
} //main


text:
import os

from airflow.hooks.base_hook import BaseHook
from airflow.exceptions import AirflowException

from azure.common.client_factory import get_client_from_auth_file
from azure.common.credentials import ServicePrincipalCredentials

from azure.mgmt.containerinstance import ContainerInstanceManagementClient
from zope.deprecation import deprecation

class AzureContainerInstanceHook(BaseHook):
    """
    A hook to communicate with Azure Container Instances.

    This hook requires a service principal in order to work.
    After creating this service principal
    (Azure Active Directory/App Registrations), you need to fill in the
    client_id (Application ID) as login, the generated password as password,
    and tenantId and subscriptionId in the extra's field as a json.

    :param conn_id: connection id of a service principal which will be used
        to start the container instance
    :type conn_id: str
    """

    def __init__(self, conn_id='azure_default'):
        self.conn_id = conn_id
        self.connection = self.get_conn()

    def get_conn(self):
        conn = self.get_connection(self.conn_id)
        key_path = conn.extra_dejson.get('key_path', False)
        if key_path:
            if key_path.endswith('.json'):
                self.log.info('Getting connection using a JSON key file.')
                return get_client_from_auth_file(ContainerInstanceManagementClient,
                                                 key_path)
            else:
                raise AirflowException('Unrecognised extension for key file.')

        if os.environ.get('AZURE_AUTH_LOCATION'):
            key_path = os.environ.get('AZURE_AUTH_LOCATION')
            if key_path.endswith('.json'):
                self.log.info('Getting connection using a JSON key file.')
                return get_client_from_auth_file(ContainerInstanceManagementClient,
                                                 key_path)
            else:
                raise AirflowException('Unrecognised extension for key file.')

        credentials = ServicePrincipalCredentials(
            client_id=conn.login,
            secret=conn.password,
            tenant=conn.extra_dejson['tenantId']
        )

        subscription_id = conn.extra_dejson['subscriptionId']
        return ContainerInstanceManagementClient(credentials, str(subscription_id))

    def create_or_update(self, resource_group, name, container_group):
        """
        Create a new container group

        :param resource_group: the name of the resource group
        :type resource_group: str
        :param name: the name of the container group
        :type name: str
        :param container_group: the properties of the container group
        :type container_group: azure.mgmt.containerinstance.models.ContainerGroup
        """
        self.connection.container_groups.create_or_update(resource_group,
                                                          name,
                                                          container_group)

    @deprecation.deprecate("get_state_exitcode_details() is deprecated. Related method is get_state()")
    def get_state_exitcode_details(self, resource_group, name):
        """
        Get the state and exitcode of a container group

        :param resource_group: the name of the resource group
        :type resource_group: str
        :param name: the name of the container group
        :type name: str
        :return: A tuple with the state, exitcode, and details.
            If the exitcode is unknown 0 is returned.
        :rtype: tuple(state,exitcode,details)
        """
        cg_state = self.get_state(resource_group, name)
        c_state = cg_state.containers[0].instance_view.current_state
        return (c_state.state, c_state.exit_code, c_state.detail_status)

    @deprecation.deprecate("get_messages() is deprecated. Related method is get_state()")
    def get_messages(self, resource_group, name):
        """
        Get the messages of a container group

        :param resource_group: the name of the resource group
        :type resource_group: str
        :param name: the name of the container group
        :type name: str
        :return: A list of the event messages
        :rtype: list[str]
        """
        cg_state = self.get_state(resource_group, name)
        instance_view = cg_state.containers[0].instance_view
        return [event.message for event in instance_view.events]

    def get_state(self, resource_group, name):
        """
        Get the state of a container group

        :param resource_group: the name of the resource group
        :type resource_group: str
        :param name: the name of the container group
        :type name: str
        :return: ContainerGroup
        :rtype: ~azure.mgmt.containerinstance.models.ContainerGroup
        """
        return self.connection.container_groups.get(resource_group,
                                                    name,
                                                    raw=False)

    def get_logs(self, resource_group, name, tail=1000):
        """
        Get the tail from logs of a container group

        :param resource_group: the name of the resource group
        :type resource_group: str
        :param name: the name of the container group
        :type name: str
        :param tail: the size of the tail
        :type tail: int
        :return: A list of log messages
        :rtype: list[str]
        """
        logs = self.connection.container.list_logs(resource_group, name, name, tail=tail)
        return logs.content.splitlines(True)

    def delete(self, resource_group, name):
        """
        Delete a container group

        :param resource_group: the name of the resource group
        :type resource_group: str
        :param name: the name of the container group
        :type name: str
        """
        self.connection.container_groups.delete(resource_group, name)

    def exists(self, resource_group, name):
        """
        Test if a container group exists

        :param resource_group: the name of the resource group
        :type resource_group: str
        :param name: the name of the container group
        :type name: str
        """
        for container in self.connection.container_groups.list_by_resource_group(resource_group):
            if container.name == name:
                return True
        return False


text:
class AddAdminPageAttributeToPages < ActiveRecord::Migration
  def self.up
    add_column :pages, :admin, :boolean

    @pages= Page.find(:all)
    @pages.each do |page|
      page.update_attribute(:admin, false)
    end

  end

  def self.down
    remove_column :pages, :admin
  end
end


text:
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
	xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
	<modelVersion>4.0.0</modelVersion>

	<groupId>com.github.openais</groupId>
	<artifactId>openais</artifactId>
	<version>0.1.0-SNAPSHOT</version>
	<packaging>jar</packaging>

	<name>openais</name>
	<url>http://maven.apache.org</url>

	<properties>
		<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
		<project.reporting.outputEncoding>UTF-8</project.reporting.outputEncoding>
		<slf4j.version>1.7.10</slf4j.version>
	</properties>

	<dependencies>
		<!-- Testing -->
		<dependency>
			<groupId>junit</groupId>
			<artifactId>junit</artifactId>
			<version>4.13.1</version>
			<scope>test</scope>
			<exclusions>
				<exclusion>
					<artifactId>hamcrest-core</artifactId>
					<groupId>org.hamcrest</groupId>
				</exclusion>
			</exclusions>
		</dependency>
		<dependency>
			<groupId>org.hamcrest</groupId>
			<artifactId>hamcrest-all</artifactId>
			<version>1.3</version>
			<scope>test</scope>
		</dependency>
		<dependency>
			<groupId>org.mockito</groupId>
			<artifactId>mockito-all</artifactId>
			<version>1.10.19</version>
			<scope>test</scope>
		</dependency>

		<!-- Logging -->
		<dependency>
			<groupId>org.slf4j</groupId>
			<artifactId>slf4j-api</artifactId>
			<version>${slf4j.version}</version>
		</dependency>

		<!-- Testing -->
		<dependency>
			<groupId>ch.qos.logback</groupId>
			<artifactId>logback-classic</artifactId>
			<version>1.2.0</version>
			<scope>test</scope>
		</dependency>

	</dependencies>
	<build>
		<plugins>
			<plugin>
				<groupId>org.apache.maven.plugins</groupId>
				<artifactId>maven-compiler-plugin</artifactId>
				<version>3.2</version>
				<configuration>
					<source>1.8</source>
					<target>1.8</target>
					<debug>true</debug>
				</configuration>
			</plugin>
			<plugin>
				<groupId>org.apache.maven.plugins</groupId>
				<artifactId>maven-surefire-plugin</artifactId>
				<version>2.18.1</version>
			</plugin>
		</plugins>
	</build>
</project>


text:
/*
 * DO NOT EDIT.  THIS FILE IS GENERATED FROM ../../../dist/idl\nsIPopupWindowManager.idl
 */

#ifndef __gen_nsIPopupWindowManager_h__
#define __gen_nsIPopupWindowManager_h__

#ifndef __gen_nsISupports_h__
#include "nsISupports.h"
#endif

/* For IDL files that don't want to include root IDL files. */
#ifndef NS_NO_VTABLE
#define NS_NO_VTABLE
#endif
class nsIPrincipal; /* forward declaration */

/* starting interface:    nsIPopupWindowManager */
#define NS_IPOPUPWINDOWMANAGER_IID_STR "66386aa9-2088-4bae-82c7-9f58bc02be64"

#define NS_IPOPUPWINDOWMANAGER_IID \
  {0x66386aa9, 0x2088, 0x4bae, \
    { 0x82, 0xc7, 0x9f, 0x58, 0xbc, 0x02, 0xbe, 0x64 }}

class NS_NO_VTABLE nsIPopupWindowManager : public nsISupports {
 public:

  NS_DECLARE_STATIC_IID_ACCESSOR(NS_IPOPUPWINDOWMANAGER_IID)

  enum {
    ALLOW_POPUP = 1U,
    DENY_POPUP = 2U,
    ALLOW_POPUP_WITH_PREJUDICE = 3U
  };

  /* uint32_t testPermission (in nsIPrincipal principal); */
  NS_IMETHOD TestPermission(nsIPrincipal *principal, uint32_t *_retval) = 0;

};

  NS_DEFINE_STATIC_IID_ACCESSOR(nsIPopupWindowManager, NS_IPOPUPWINDOWMANAGER_IID)

/* Use this macro when declaring classes that implement this interface. */
#define NS_DECL_NSIPOPUPWINDOWMANAGER \
  NS_IMETHOD TestPermission(nsIPrincipal *principal, uint32_t *_retval) override;

/* Use this macro to declare functions that forward the behavior of this interface to another object. */
#define NS_FORWARD_NSIPOPUPWINDOWMANAGER(_to) \
  NS_IMETHOD TestPermission(nsIPrincipal *principal, uint32_t *_retval) override { return _to TestPermission(principal, _retval); }

/* Use this macro to declare functions that forward the behavior of this interface to another object in a safe way. */
#define NS_FORWARD_SAFE_NSIPOPUPWINDOWMANAGER(_to) \
  NS_IMETHOD TestPermission(nsIPrincipal *principal, uint32_t *_retval) override { return !_to ? NS_ERROR_NULL_POINTER : _to->TestPermission(principal, _retval); }

#if 0
/* Use the code below as a template for the implementation class for this interface. */

/* Header file */
class nsPopupWindowManager : public nsIPopupWindowManager
{
public:
  NS_DECL_ISUPPORTS
  NS_DECL_NSIPOPUPWINDOWMANAGER

  nsPopupWindowManager();

private:
  ~nsPopupWindowManager();

protected:
  /* additional members */
};

/* Implementation file */
NS_IMPL_ISUPPORTS(nsPopupWindowManager, nsIPopupWindowManager)

nsPopupWindowManager::nsPopupWindowManager()
{
  /* member initializers and constructor code */
}

nsPopupWindowManager::~nsPopupWindowManager()
{
  /* destructor code */
}

/* uint32_t testPermission (in nsIPrincipal principal); */
NS_IMETHODIMP nsPopupWindowManager::TestPermission(nsIPrincipal *principal, uint32_t *_retval)
{
    return NS_ERROR_NOT_IMPLEMENTED;
}

/* End of implementation class template. */
#endif

#define NS_POPUPWINDOWMANAGER_CONTRACTID "@mozilla.org/PopupWindowManager;1"

#endif /* __gen_nsIPopupWindowManager_h__ */


text:
package com.ryanchapin.tests.finra.calculator;

import org.jmock.auto.Mock;
import org.jmock.integration.junit4.JUnit4Mockery;

public class BaseTest
{
	protected static final String SPACE = " ";

	protected static final String INPUT_QUEUE_NAME  = "InputQueue";
	protected static final String OUTPUT_QUEUE_NAME = "OutputQueue";

	protected static final String PROBLEM1           = "1 + 1 + 2";
	protected static final String PROBLEM1_ANSWER    = PROBLEM1 + " = 4";
	protected static final int    PROBLEM1_ANSER_INT = 4;

	protected static final String PROBLEM2           = "2 + 3 - 4";
	protected static final String PROBLEM2_ANSWER    = PROBLEM2 + " = 1";
	protected static final int    PROBLEM2_ANSER_INT = 1;

	protected static final String PROBLEM3           = "4 - 9 + 11 + 4";
	protected static final String PROBLEM3_ANSWER    = PROBLEM3 + " = 10";
	protected static final int    PROBLEM3_ANSER_INT = 10;

	protected static final String PROBLEM4           = "50 - 75 + 20 - 10";
	protected static final String PROBLEM4_ANSWER    = PROBLEM4 + " = -15";
	protected static final int    PROBLEM4_ANSER_INT = -15;

	protected static final String PROBLEM5           = "1061 - 655 + 10905 - 14 + 17068 + 81";
	protected static final String PROBLEM5_ANSWER    = PROBLEM4 + " = 28446";
	protected static final int    PROBLEM5_ANSER_INT = 28446;

	protected JUnit4Mockery mockery = new JUnit4Mockery();

	@Mock
	protected ProblemQueue mockInputQueue;

	@Mock
	protected ProblemQueue mockOutputQueue;
}


text:
<!DOCTYPE html>

		<meta charset="utf-8">
		<meta http-equiv="X-UA-Compatible" content="IE=edge">
		<meta name="viewport" content="width=device-width, initial-scale=1">

		<title><?php echo isset($title) ? $title : 'Apparel Television : The Most Popular Bangladeshi Online Television' ; ?></title>

		<meta property="og:title" content="<?php echo isset($title) ? $title : 'Apparel Television : The Most Popular Bangladeshi Online Television';?>"/>
		<meta property="og:type" content="Website"/>
		<meta property="og:site_name" content="Apparel Television"/>
		<meta property="og:url" content="<?php echo $actual_link = (isset($_SERVER['HTTPS']) ? "https" : "http") . "://$_SERVER[HTTP_HOST]$_SERVER[REQUEST_URI]"; ?>"/>
		<meta property="og:image:width" content="600"/>
		<meta property="og:image:height" content="315"/>
		<meta property="og:image" content="<?php echo isset($image) ? 'http://www.appareltelevision.com'.$image : 'http://www.appareltelevision.com/assets/frontend/images/apparel_television.JPG'?>"/>
		<meta property="og:description" content="<?php echo isset($title) ? $title : 'The Most Popular Bangladeshi Online Apparel Television. Provide Apparel Related Video.';?>"/>
		<meta property="og:site_name" content="Apparel Television"/>
		<meta name="fb:app_id" property="fb:app_id" content="1544846228893581"/>

		<meta name="keywords" content="apparel television,tv,online tv bd,television,bangla tv,apparel tv,apparel news"/>

		<meta name="description" content="<?php echo isset($title) ? $title : 'The Most Popular Bangladeshi Online Apparel Television. Provide Apparel Related Video.' ; ?>"/>

		<meta name="robots" content="index, follow"/>

		<link rel="shortcut icon" href="http://theapparelnews.com/images/favicon.png" />

		<link rel="canonical" href="<?php echo $actual_link = (isset($_SERVER['HTTPS']) ? "https" : "http") . "://$_SERVER[HTTP_HOST]$_SERVER[REQUEST_URI]"; ?>">
		<link href="<?php echo base_url(); ?>assets/frontend/css/style.css" rel="stylesheet">
		<link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/css/bootstrap.min.css">

		<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/4.5.0/css/font-awesome.min.css">

		<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/ionicons/2.0.1/css/ionicons.min.css">

			 <?php $this->load->view('home/header.php'); ?>

			 <?php $this->load->view('home/menu.php'); ?>

			  <?php
					if(isset($content))
					{
						echo $content;
					}
			?>

			 <?php $this->load->view('home/footer.php'); ?>


text:
class WidgetList : public QWidget
{
    Q_OBJECT

public:
    WidgetList(QWidget *parent = 0);
    ~WidgetList();

    void addWidget(QWidget*);
    void removeWidget(QWidget*);

    QList<QWidget*> getListWidget() const;
    QWidget* takeAt(int) const;
    int count() const;

private:
    QVBoxLayout* layout_;
};

#endif // WIDGETLIST_H


text:
FROM mcr.microsoft.com/dotnet/core/aspnet:3.1-buster-slim AS base
WORKDIR /app
EXPOSE 80
EXPOSE 443

FROM mcr.microsoft.com/dotnet/core/sdk:3.1-buster AS build
COPY ["src/HelloWorld/HelloWorld.csproj", "src/HelloWorld/"]
RUN dotnet restore "src/HelloWorld/HelloWorld.csproj"
COPY . .
WORKDIR "/src/HelloWorld"
RUN ls -al
RUN dotnet build "HelloWorld.csproj" --configuration Debug -o /app/build

FROM build AS publish
RUN dotnet publish "HelloWorld.csproj" --configuration Debug -o /app/publish

FROM base AS final
WORKDIR /app
COPY --from=publish /app/publish .
ENTRYPOINT ["dotnet", "HelloWorld.dll"]


text:
package fr.ouest_insa.network;

import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStream;
import java.io.InputStreamReader;
import java.net.URL;
import java.nio.charset.Charset;

import org.json.JSONException;
import org.json.JSONObject;

/**
 * This class run in background to don't stop the UI.<br>
 * This class retrieve data from the API with a HTTP request.
 * @author Loïc Pelleau
 */
public class RetrieveDetails extends Retrieve<JSONObject> {
	public RetrieveDetails(String url) {
		super(url);
	}

	@Override
	protected String getFromJSON(JSONObject json) {
		try {
			return json.getString("summary");
		} catch (JSONException e) {
			e.printStackTrace();
		}
		return null;
	}

	@Override
	public JSONObject readJsonFromUrl(String url) throws IOException,
			JSONException {
		InputStream is = new URL(url).openStream();
		try {
			BufferedReader rd = new BufferedReader(new InputStreamReader(is,
					Charset.forName("UTF-8")));
			String jsonText = readAll(rd);
			return new JSONObject(jsonText);
		} finally {
			is.close();
		}
	}
}


text:
namespace syncer_v2 {

// The state passed from ModelTypeProcessor to Sync thread during DataType
// activation.
struct SYNC_EXPORT ActivationContext {
  ActivationContext();
  ~ActivationContext();

  // Initial DataTypeState at the moment of activation.
  sync_pb::DataTypeState data_type_state;

  // The ModelTypeProcessor for the worker. Note that this is owned because
  // it is generally a proxy object to the real processor.
  scoped_ptr<ModelTypeProcessor> type_processor;
};

}  // namespace syncer_v2

#endif  // SYNC_INTERNAL_API_PUBLIC_ACTIVATION_CONTEXT_H_


text:
PingFederate custom IDP adapter that can be chained with other adapters to restrict the number of access tokens issued to a user. For example to limit the devices a user can authenticate from.

### System Requirements / Dependencies

Requires:
 - PingFederate 7.2.x or higher
 - Apache Commons Logging

### Installation

1. Compile the plugin in (refer to the [PingFederate server SDK documentation] for details on compiling PingFederate plug-ins)
2. Copy the resulting .jar file to the <pf_home>/server/default/deploy folder (on all nodes and admin instances).
3. Restart PingFederate

[PingFederate server SDK documentation]: http://documentation.pingidentity.com/display/PF/SDK+Developer%27s+Guide

### Configuration

Once the plug-in has been deployed and the PingFederate instance restarted, launch the PingFederate admin console:

1. Add a new Adapter instance under: IDP Configuration > Adapters
2. Name the instance and select the appropriate adapter from the "type" list
3. Refer to the inline documentation to configure the adapter

### Disclaimer

This software is open sourced by Ping Identity but not supported commercially as such. Any questions/issues should go to the Github issues tracker or discuss on the [Ping Identity developer communities] . See also the DISCLAIMER file in this directory.

[Ping Identity developer communities]: https://community.pingidentity.com/collaborate


text:
// @noUnusedLocals: true
// @noUnusedParameters: true

////export class Example {
////    constructor(private readonly arg: any) {
////    }
////}

verify.codeFix({
    description: "Remove declaration for: 'arg'",
    newFileContent:
`export class Example {
    constructor() {
    }
}`,
});


text:
var Page            = require("./page");

var leaderboard = {
    pageTitle: "High Scores",
    columnHeaders: [
        ["Level", "Score"],
        ["=====", "====="]
    ],
    pageFields: [],
    columnStyle: "spread",
    board: null
};

leaderboard.populate = function(hiScores) {
    "use strict";
    this.pageFields = this.columnHeaders.concat(hiScores);
    this.board = new Page(this.pageTitle, this.pageFields, this.columnStyle);
};

module.exports = leaderboard;


text:
package com.vaadin.pturczyk.geolocationprovider.gwt.client;

import com.vaadin.shared.communication.ClientRpc;

/**
 * GeoLocation Client Rpc.
 */
public interface GeoLocationProviderClientRpc extends ClientRpc {
	/**
	 * Requests geo location information
	 */
	public void requestGeoLocation();
}


text:
using System;
using System.Globalization;
using System.Linq;
using System.Windows.Data;
using LiveCharts;

namespace Wpf.CartesianChart.Energy_Predictions
{
    public class ReverseConverter : IValueConverter
    {
        public object Convert(object value, Type targetType, object parameter, CultureInfo culture)
        {
            return ((SeriesCollection) value).Reverse();
        }

        public object ConvertBack(object value, Type targetType, object parameter, CultureInfo culture)
        {
            throw new NotImplementedException();
        }
    }
}


text:
/*
 Simple/small/fast Pseudo-Random Number Generator support.

 For when rand()/random() are too big/slow/etc.
 */

#ifndef PRNG_H
#define PRNG_H

#include <stdint.h>

#include "V0p2_Main.h"

// "RNG8" 8-bit 'ultra fast' PRNG suitable for 8-bit microcontrollers: low bits probably least good.
// NOT in any way suitable for crypto, but may be good to help avoid TX collisions, etc.
// C/o: http://www.electro-tech-online.com/general-electronics-chat/124249-ultra-fast-pseudorandom-number-generator-8-bit.html
// Reseed with 3 bytes of state.
void seedRNG8(uint8_t s1, uint8_t s2, uint8_t s3); // Originally called 'init_rnd()'.
// Get 1 byte of uniformly-distributed unsigned values.
uint8_t randRNG8(); // Originally called 'randomize()'.
#ifdef UNIT_TESTS
// Reset to known state; only allow in unit testing as this destroys any residual entropy.
void resetRNG8();
#endif

// Get a boolean from RNG8.
// Avoids suspect low-order bit(s).
static inline bool randRNG8NextBoolean() { return(0 != (0x8 & randRNG8())); }

#endif


text:
"""
Script to generate contributor and pull request lists

This script generates contributor and pull request lists for release
changelogs using Github v3 protocol. Use requires an authentication token in
order to have sufficient bandwidth, you can get one following the directions at
`<https://help.github.com/articles/creating-an-access-token-for-command-line-use/>_
Don't add any scope, as the default is read access to public information. The
token may be stored in an environment variable as you only get one chance to
see it.

Usage::

    $ ./tools/announce.py <token> <revision range>

The output is utf8 rst.

Dependencies
------------

- gitpython
- pygithub
- git >= 2.29.0

Some code was copied from scipy `tools/gh_list.py` and `tools/authors.py`.

Examples
--------

From the bash command line with $GITHUB token::

    $ ./tools/announce $GITHUB v1.13.0..v1.14.0 > 1.14.0-changelog.rst

"""
import os
import sys
import re
from git import Repo
from github import Github

if sys.version_info[:2] < (3, 6):
    raise RuntimeError("Python version must be >= 3.6")

this_repo = Repo(os.path.join(os.path.dirname(__file__), ".."))

author_msg =\
"""
A total of %d people contributed to this release.  People with a "+" by their
names contributed a patch for the first time.
"""

pull_request_msg =\
"""
A total of %d pull requests were merged for this release.
"""

def get_authors(revision_range):
    lst_release, cur_release = [r.strip() for r in revision_range.split('..')]
    authors_pat = r'^.*\t(.*)$'

    # authors and co-authors in current and previous releases.
    grp1 = '--group=author'
    grp2 = '--group=trailer:co-authored-by'
    cur = this_repo.git.shortlog('-s', grp1, grp2, revision_range)
    pre = this_repo.git.shortlog('-s', grp1, grp2, lst_release)
    authors_cur = set(re.findall(authors_pat, cur, re.M))
    authors_pre = set(re.findall(authors_pat, pre, re.M))

    # Ignore the bot Homu.
    authors_cur.discard('Homu')
    authors_pre.discard('Homu')

    # Ignore the bot dependabot-preview
    authors_cur.discard('dependabot-preview')
    authors_pre.discard('dependabot-preview')

    # Append '+' to new authors.
    authors_new = [s + ' +' for s in authors_cur - authors_pre]
    authors_old = [s for s in authors_cur & authors_pre]
    authors = authors_new + authors_old
    authors.sort()
    return authors

def get_pull_requests(repo, revision_range):
    prnums = []

    # From regular merges
    merges = this_repo.git.log(
        '--oneline', '--merges', revision_range)
    issues = re.findall(r"Merge pull request \#(\d*)", merges)
    prnums.extend(int(s) for s in issues)

    # From Homu merges (Auto merges)
    issues = re. findall(r"Auto merge of \#(\d*)", merges)
    prnums.extend(int(s) for s in issues)

    # From fast forward squash-merges
    commits = this_repo.git.log(
        '--oneline', '--no-merges', '--first-parent', revision_range)
    issues = re.findall(r'^.*\((\#|gh-|gh-\#)(\d+)\)$', commits, re.M)
    prnums.extend(int(s[1]) for s in issues)

    # get PR data from github repo
    prnums.sort()
    prs = [repo.get_pull(n) for n in prnums]
    return prs

def main(token, revision_range):
    lst_release, cur_release = [r.strip() for r in revision_range.split('..')]

    github = Github(token)
    github_repo = github.get_repo('numpy/numpy')

    # document authors
    authors = get_authors(revision_range)
    heading = "Contributors"
    print()
    print(heading)
    print("="*len(heading))
    print(author_msg % len(authors))

    for s in authors:
        print('* ' + s)

    # document pull requests
    pull_requests = get_pull_requests(github_repo, revision_range)
    heading = "Pull requests merged"
    pull_msg = "* `#{0} <{1}>`__: {2}"

    print()
    print(heading)
    print("="*len(heading))
    print(pull_request_msg % len(pull_requests))

    for pull in pull_requests:
        title = re.sub(r"\s+", " ", pull.title.strip())
        if len(title) > 60:
            remainder = re.sub(r"\s.*$", "...", title[60:])
            if len(remainder) > 20:
                remainder = title[:80] + "..."
            else:
                title = title[:60] + remainder
        print(pull_msg.format(pull.number, pull.html_url, title))

if __name__ == "__main__":
    from argparse import ArgumentParser

    parser = ArgumentParser(description="Generate author/pr lists for release")
    parser.add_argument('token', help='github access token')
    parser.add_argument('revision_range', help='<revision>..<revision>')
    args = parser.parse_args()
    main(args.token, args.revision_range)


text:
package com.scottescue.dropwizard.entitymanager;

import org.hibernate.jpa.HibernateEntityManager;
import org.junit.Test;

import javax.persistence.EntityManager;
import javax.persistence.LockModeType;
import javax.persistence.TransactionRequiredException;
import java.util.HashMap;

import static org.assertj.core.api.Assertions.assertThat;
import static org.mockito.Mockito.*;

public class SharedEntityManagerFactoryTest {
    final private EntityManager entityManager = mock(EntityManager.class);
    final private EntityManagerContext entityManagerContext = mock(EntityManagerContext.class);
    final private SharedEntityManagerFactory sharedEntityManagerFactory = new SharedEntityManagerFactory();

    @Test(expected = TransactionRequiredException.class)
    public void requiresTransactionForPersist() {
        createProxy().persist(new Object());
    }

    @Test(expected = TransactionRequiredException.class)
    public void requiresTransactionForMerge() {
        createProxy().merge(new Object());
    }

    @Test(expected = TransactionRequiredException.class)
    public void requiresTransactionForRemove() {
        createProxy().remove(new Object());
    }

    @Test(expected = TransactionRequiredException.class)
    public void requiresTransactionForFlush() {
        createProxy().flush();
    }

    @Test(expected = TransactionRequiredException.class)
    public void requiresTransactionForRefresh() {
        createProxy().refresh(new Object());
    }

    @Test(expected = TransactionRequiredException.class)
    public void requiresTransactionForRefreshWithProperties() {
        createProxy().refresh(new Object(), new HashMap<>());
    }

    @Test(expected = TransactionRequiredException.class)
    public void requiresTransactionForRefreshWithLockMode() {
        createProxy().refresh(new Object(), LockModeType.NONE);
    }

    @Test(expected = TransactionRequiredException.class)
    public void requiresTransactionForRefreshWithPropertiesAndLockMode() {
        createProxy().refresh(new Object(), LockModeType.NONE, new HashMap<>());
    }

    @Test(expected = TransactionRequiredException.class)
    public void requiresTransactionForJoinTransaction() {
        createProxy().joinTransaction();
    }

    @Test
    public void unwrappingProxyReturnsProxy() {
        EntityManager entityManagerProxy = createProxy();
        EntityManager foundProxy = entityManagerProxy.unwrap(entityManagerProxy.getClass());
        assertThat(foundProxy).isSameAs(entityManagerProxy);
        verifyNoMoreInteractions(entityManager);
    }

    @Test
    public void unwrappingNullReturnsEntityManager() {
        EntityManager em = createProxy().unwrap(null);
        assertThat(em).isSameAs(entityManager);
    }

    @Test
    public void delegatesToUnwrapForNonProxyClass() {
        HibernateEntityManager mockHibernateEm = mock(HibernateEntityManager.class);
        when(entityManager.unwrap(HibernateEntityManager.class)).thenReturn(mockHibernateEm);

        HibernateEntityManager foundHibernateEm = createProxy().unwrap(HibernateEntityManager.class);
        verify(entityManager).unwrap(HibernateEntityManager.class);
        assertThat(foundHibernateEm).isSameAs(mockHibernateEm);
    }

    @Test
    public void doesNotDelegateToClose() {
        createProxy().close();
        verify(entityManager, never()).close();
    }

    @Test
    public void doesNotDelegateToIsOpen() {
        createProxy().isOpen();
        verify(entityManager, never()).isOpen();
    }

    @Test
    public void isAlwaysOpen() {
        assertThat(createProxy().isOpen()).isTrue();
    }

    @Test(expected = IllegalStateException.class)
    public void getTransactionThrowsException() {
        createProxy().getTransaction();
    }

    @Test
    public void delegatesToFind() {
        Class type = Class.class;
        Object primaryKey = new Object();
        createProxy().find(type, primaryKey);
        verify(entityManager).find(type, primaryKey);
    }

    private EntityManager createProxy() {
        when(entityManagerContext.currentEntityManager()).thenReturn(entityManager);
        return sharedEntityManagerFactory.build(entityManagerContext);
    }
}


text:
<?xml version="1.0" encoding="UTF-8"?>
<project xmlns="http://maven.apache.org/POM/4.0.0"
         xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
         xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
    <modelVersion>4.0.0</modelVersion>

    <groupId>ru.kurotkin</groupId>
    <artifactId>HomeWork13</artifactId>
    <version>1.0-SNAPSHOT</version>

    <dependencies>
        <dependency>
            <groupId>com.mashape.unirest</groupId>
            <artifactId>unirest-java</artifactId>
            <version>1.4.9</version>
        </dependency>
        <dependency>
            <groupId>org.apache.httpcomponents</groupId>
            <artifactId>httpclient</artifactId>
            <version>4.3.6</version>
        </dependency>
        <dependency>
            <groupId>org.apache.httpcomponents</groupId>
            <artifactId>httpasyncclient</artifactId>
            <version>4.0.2</version>
        </dependency>
        <dependency>
            <groupId>org.apache.httpcomponents</groupId>
            <artifactId>httpmime</artifactId>
            <version>4.3.6</version>
        </dependency>
        <dependency>
            <groupId>org.json</groupId>
            <artifactId>json</artifactId>
            <version>20140107</version>
        </dependency>
        <dependency>
            <groupId>com.fasterxml.jackson.core</groupId>
            <artifactId>jackson-databind</artifactId>
            <version>2.9.1</version>
        </dependency>
    </dependencies>

    <build>
        <plugins>
            <plugin>
                <groupId>com.zenjava</groupId>
                <artifactId>javafx-maven-plugin</artifactId>
                <version>2.0</version>
                <configuration>
                    <mainClass>com.kurotkin.YouTubeSearcher</mainClass>
                </configuration>
            </plugin>
        </plugins>
    </build>

</project>


text:
<?xml version="1.0" encoding="utf-8"?>
<shape xmlns:android="http://schemas.android.com/apk/res/android" android:shape="oval">
    <solid android:color="#000"/>
    <size
        android:width="46dp"
        android:height="46dp" />
</shape>


text:
A program running the classic "Hello, world." learning example.

## How to Compile

With a minimal Pony installation, in the same directory as this README file run `ponyc`. You should see content building the necessary packages, which ends with:

```console
...
Generating
 Reachability
 Selector painting
 Data prototypes
 Data types
 Function prototypes
 Functions
 Descriptors
Optimising
Writing ./helloworld.o
Linking ./helloworld
```

## How to Run

Once `helloworld` has been compiled, in the same directory as this README file run `./helloworld`. You should see a brief hello.

```console
$ ./helloworld
Hello, world.
```

## Program Modifications

Modify the program to say hello to a specific name by first commandline argument -- when no argument is given, default to the world.

```console
$ ./helloworld Ryan
Hello, Ryan.
```

```console
$ ./helloworld
Hello, world.
```


text:
package org.dmfs.xml.objectpull;

import static org.junit.Assert.assertEquals;

import java.util.Arrays;
import java.util.HashSet;
import java.util.Set;

import org.dmfs.xmlobjects.ElementDescriptor;
import org.dmfs.xmlobjects.QualifiedName;
import org.dmfs.xmlobjects.XmlContext;
import org.dmfs.xmlobjects.builder.SetObjectBuilder;
import org.dmfs.xmlobjects.builder.StringObjectBuilder;
import org.dmfs.xmlobjects.pull.ParserContext;
import org.dmfs.xmlobjects.pull.XmlObjectPullParserException;
import org.junit.Test;

public class SetObjectBuilderTest
{
	XmlContext testContext = new XmlContext();

	ElementDescriptor<String> childElement = ElementDescriptor.register("child", StringObjectBuilder.INSTANCE, testContext);
	ElementDescriptor<Set<String>> setElement = ElementDescriptor.register("set", new SetObjectBuilder<String>(childElement, true), testContext);
	ElementDescriptor<Set<String>> setElementNonNull = ElementDescriptor.register("set-non-null", new SetObjectBuilder<String>(childElement, false),
		testContext);

	@Test
	public void testElementDescriptorNull() throws XmlObjectPullParserException
	{
		SetObjectBuilder<String> builder = new SetObjectBuilder<String>(childElement, true);
		ParserContext pc = new ParserContext();

		// test get without recycled set
		assertEquals(makeSet(), builder.get(setElement, null, pc));

		// test get with recycled set, that's not empty
		assertEquals(makeSet(), builder.get(setElement, makeSet("1", "2", "3"), pc));

		// test adding an attribute
		assertEquals(makeSet(), builder.update(setElement, makeSet(), QualifiedName.get("testattr"), "testvalue", pc));

		// test adding a text
		assertEquals(makeSet(), builder.update(setElement, makeSet(), "text value", pc));
		assertEquals(makeSet("1"), builder.update(setElement, makeSet("1"), "text value", pc));
		assertEquals(makeSet("1", "abc"), builder.update(setElement, makeSet("1", "abc"), "text value", pc));

		// test adding child elements
		assertEquals(makeSet("1"), builder.update(setElement, makeSet(), childElement, "1", pc));
		assertEquals(makeSet("1", "2"), builder.update(setElement, makeSet("1"), childElement, "2", pc));
		assertEquals(makeSet("1", "abc", "text value"), builder.update(setElement, makeSet("1", "abc"), childElement, "text value", pc));

		// test adding null elements
		assertEquals(makeSet((String) null), builder.update(setElement, makeSet(), childElement, null, pc));
		assertEquals(makeSet("1", null), builder.update(setElement, makeSet("1"), childElement, null, pc));
		assertEquals(makeSet("1", "abc", null), builder.update(setElement, makeSet("1", "abc"), childElement, null, pc));
	}

	@Test
	public void testElementDescriptorNonNull() throws XmlObjectPullParserException
	{
		SetObjectBuilder<String> builder = new SetObjectBuilder<String>(childElement, false);
		ParserContext pc = new ParserContext();

		// test get without recycled set
		assertEquals(makeSet(), builder.get(setElementNonNull, null, pc));

		// test get with recycled set, that's not empty
		assertEquals(makeSet(), builder.get(setElementNonNull, makeSet("1", "2", "3"), pc));

		// test adding an attribute
		assertEquals(makeSet(), builder.update(setElementNonNull, makeSet(), QualifiedName.get("testattr"), "testvalue", pc));

		// test adding a text
		assertEquals(makeSet(), builder.update(setElementNonNull, makeSet(), "text value", pc));
		assertEquals(makeSet("1"), builder.update(setElementNonNull, makeSet("1"), "text value", pc));
		assertEquals(makeSet("1", "abc"), builder.update(setElementNonNull, makeSet("1", "abc"), "text value", pc));

		// test adding child elements
		assertEquals(makeSet("1"), builder.update(setElementNonNull, makeSet(), childElement, "1", pc));
		assertEquals(makeSet("1", "2"), builder.update(setElementNonNull, makeSet("1"), childElement, "2", pc));
		assertEquals(makeSet("1", "abc", "text value"), builder.update(setElementNonNull, makeSet("1", "abc"), childElement, "text value", pc));

		// test adding null elements
		assertEquals(makeSet(), builder.update(setElementNonNull, makeSet(), childElement, null, pc));
		assertEquals(makeSet("1"), builder.update(setElementNonNull, makeSet("1"), childElement, null, pc));
		assertEquals(makeSet("1", "abc"), builder.update(setElementNonNull, makeSet("1", "abc"), childElement, null, pc));
	}

	private static Set<String> makeSet(String... strings)
	{
		return new HashSet<String>(Arrays.asList(strings));
	}
}


text:
package com.blebail.blog.sample.account;

import com.blebail.blog.sample.fixtures.CustomFixtures;
import com.blebail.blog.sample.fixtures.SharedFixtures;
import com.blebail.blog.sample.fixtures.SqlFixture;
import com.blebail.blog.sample.fixtures.SqlMemoryDatabase;
import org.junit.jupiter.api.BeforeEach;
import org.junit.jupiter.api.Test;
import org.junit.jupiter.api.extension.RegisterExtension;

import static org.assertj.core.api.Assertions.assertThat;

public final class AccountRepositoryTest {

    private AccountRepository accountRepository;

    @RegisterExtension
    public static SqlMemoryDatabase sqlMemoryDatabase = new SqlMemoryDatabase();

    @RegisterExtension
    public SqlFixture sqlFixture = new SqlFixture(
            sqlMemoryDatabase,
            SharedFixtures.insertDefaultAccounts()
    );

    @BeforeEach
    void setUp() {
        // Here JdbcAccountRepository is a plain simple implementation of AccountRepository,
        // nothing interesting in the context of this post
        accountRepository = new JdbcAccountRepository(sqlMemoryDatabase.dataSource());
    }

    @Test
    void shouldFindAllAccounts() {
        sqlFixture.readOnly();

        assertThat(accountRepository.findAll())
                .containsOnly(SharedFixtures.adminAccount, SharedFixtures.userAccount);
    }

    @Test
    void shouldFindAccountByUsername() {
        sqlFixture.readOnly();

        assertThat(accountRepository.findByUsername("admin"))
                .contains(SharedFixtures.adminAccount);
    }

    @Test
    void shouldFindInactiveAccounts() {
        sqlFixture.inject(CustomFixtures.insertInactiveAccount());

        assertThat(accountRepository.findInactives())
                .containsOnly(CustomFixtures.inactiveAccount);
    }
}


text:
export * from './component';
export * from './foundation';
export { cssClasses as helperTextCssClasses, strings as helperTextStrings } from './constants';
//# sourceMappingURL=index.js.map


text:
author: jeffatwood
comments: true
date: 2010-12-02 10:44:09+00:00
layout: post
redirect_from: /2010/12/stack-exchange-moderator-elections-begin
hero:
slug: stack-exchange-moderator-elections-begin
title: Stack Exchange Moderator Elections Begin
wordpress_id: 6225
tags:
- company
- moderators
- stackexchange
- community
---

Back in July, we [appointed Moderators Pro Tempore](http://blog.stackoverflow.com/2010/07/moderator-pro-tempore/) for the nascent [Stack Exchange 2.0 communities](http://stackexchange.com/sites). Leadership is critical to any community's success, and the bootstrapping of a community often requires those leaders to be appointed before the community is large enough or organized enough to elect them itself.

Our fellow [moderators Pro Tempore](http://blog.stackoverflow.com/2010/07/moderator-pro-tempore/) have been instrumental in keeping their communities tidy and on track through the public beta and beyond. Now that the earliest Stack Exchange 2.0 sites have been fully public for [over 60 days](http://blog.stackoverflow.com/2010/10/our-first-area-51-site-goes-public/), we believe at least some of the communities are ready to take the last important step towards self governance -- by **electing their own moderators**. As we've said from the very first days of the Stack Overflow beta:

We don't run Stack Overflow. You do.

Every site under our banner has the same philosophy. The community is the source of everything useful that happens to exist on our websites. We gladly reciprocate by **trusting you to lead and govern your own community**. Democratically elected community moderators are the ultimate goal of, and foundation for, every site in our network.

[![](https://i.stack.imgur.com/WrD0O.jpg)](http://www.life.com/image/95883094)

While we've had [multiple moderator appointments and elections on the trilogy](http://blog.stackoverflow.com/tags/moderators/) -- culminating in our most recent [2010 Stack Overflow moderator election](http://blog.stackoverflow.com/2010/02/stack-overflow-2010-moderator-election-results/) -- they have been much more ad-hoc than I would have liked.

This time, we've put all our prior experience into **making moderator elections a first class function built into every site we operate**. While it's still subject to a bit of change, we've started our [first community moderator election on mathematics](http://math.stackexchange.com/election).

There are three phases in each election, all available from the same page:

1. **Nominations** -- seven days

    In the nomination phase, any community member in good standing with at least **300** reputation may nominate themselves -- and _only_ themselves -- as a candidate in the moderator election. Nominations require writing a brief introduction explaining to the greater community why the candidate would make a good community moderator. Comments are encouraged in this phase, along with plenty of editing to make the introduction better, but there is no voting. The top **30** nominees (ordered by reputation) proceed to the primary phase unless they opt to withdraw.

    Note: If there are **10** or less candidates at the end of this phase, we skip directly to Election.

2. **Primary** -- four days

    In the primary phase, all community members with at least **150** reputation can cast an up or down vote on each candidate, resulting in a public tally. No comments are allowed in the primary; any opinions on the suitability of each candidate should be expressed as a simple up or down primary vote. The top **10** candidates by score will proceed on to the election phase, unless they opt to withdraw.

3. **Election** -- four days

    Once the election begins, there will be per-user site notifications to all eligible voters. In the election phase, all community members with at least **150** reputation can cast three votes: 1st choice, 2nd choice, and 3rd choice. All votes are private until the election is complete, at which point the election data file (the vote totals for all the candidates; no identification of who voted for whom) will be freely and permanently downloadable by anyone. We will calculate the winners using [OpenSTV](http://www.openstv.org/) and the Meek STV method.

In a little over two weeks, the election process should hopefully produce **three new democratically elected community moderators!** We're going to run through the full process on math first, as they have an urgent need for community moderators, and also so we can see how this new election format works and refine it before going full steam ahead.

Democracy is a highly imperfect process. But it is a _participatory_ imperfect process. Please participate in the [math community moderator election](http://math.stackexchange.com/election) -- even if only as an observer -- and give us feedback on how we can improve the moderator election process to better serve _your_ community.