text:
INSERT INTO SC_ADMIN_MODULE (ADMIN_MODULE_ID, NAME, MODULE_KEY, ICON, DISPLAY_ORDER) VALUES (-1,'Catalog','SCMerchandising', 'icon-barcode', 100);
INSERT INTO SC_ADMIN_MODULE (ADMIN_MODULE_ID, NAME, MODULE_KEY, ICON, DISPLAY_ORDER) VALUES (-2,'Content','SCContentManagement', 'icon-file', 200);
INSERT INTO SC_ADMIN_MODULE (ADMIN_MODULE_ID, NAME, MODULE_KEY, ICON, DISPLAY_ORDER) VALUES (-3,'Customer Care','SCCustomerCare', 'icon-heart', 300);
INSERT INTO SC_ADMIN_MODULE (ADMIN_MODULE_ID, NAME, MODULE_KEY, ICON, DISPLAY_ORDER) VALUES (-6,'Design','SCDesign', 'icon-picture', 400);
INSERT INTO SC_ADMIN_MODULE (ADMIN_MODULE_ID, NAME, MODULE_KEY, ICON, DISPLAY_ORDER) VALUES (-7,'Site Updates','SCWorkflow', 'icon-refresh', 500);
INSERT INTO SC_ADMIN_MODULE (ADMIN_MODULE_ID, NAME, MODULE_KEY, ICON, DISPLAY_ORDER) VALUES (-4,'Security','SCOpenAdmin', 'icon-user', 600);
INSERT INTO SC_ADMIN_MODULE (ADMIN_MODULE_ID, NAME, MODULE_KEY, ICON, DISPLAY_ORDER) VALUES (-5,'Settings','SCModuleConfiguration', 'icon-gear', 700);

--
-- Create SC SECTIONS (These modules are required for the admin left navigation)
--
INSERT INTO SC_ADMIN_SECTION (ADMIN_SECTION_ID, DISPLAY_ORDER, ADMIN_MODULE_ID, NAME, SECTION_KEY, URL, CEILING_ENTITY) VALUES (-1, 1000, -1, 'Category', 'Category', '/category', 'org.sparkcommerce.core.catalog.domain.Category');
INSERT INTO SC_ADMIN_SECTION (ADMIN_SECTION_ID, DISPLAY_ORDER, ADMIN_MODULE_ID, NAME, SECTION_KEY, URL, CEILING_ENTITY) VALUES (-2, 2000, -1, 'Product', 'Product', '/product', 'org.sparkcommerce.core.catalog.domain.Product');
INSERT INTO SC_ADMIN_SECTION (ADMIN_SECTION_ID, DISPLAY_ORDER, ADMIN_MODULE_ID, NAME, SECTION_KEY, URL, CEILING_ENTITY) VALUES (-3, 3000, -1, 'Product Options', 'ProductOptions', '/product-options', 'org.sparkcommerce.core.catalog.domain.ProductOption');
INSERT INTO SC_ADMIN_SECTION (ADMIN_SECTION_ID, DISPLAY_ORDER, ADMIN_MODULE_ID, NAME, SECTION_KEY, URL, CEILING_ENTITY) VALUES (-4, 4000, -1, 'Offer', 'Offer', '/offer', 'org.sparkcommerce.core.offer.domain.Offer');

INSERT INTO SC_ADMIN_SECTION (ADMIN_SECTION_ID, DISPLAY_ORDER, ADMIN_MODULE_ID, NAME, SECTION_KEY, URL, CEILING_ENTITY) VALUES (-5, 1000, -2, 'Pages', 'Pages', '/pages', 'org.sparkcommerce.cms.page.domain.Page');
INSERT INTO SC_ADMIN_SECTION (ADMIN_SECTION_ID, DISPLAY_ORDER, ADMIN_MODULE_ID, NAME, SECTION_KEY, URL, CEILING_ENTITY) VALUES (-7, 2000, -2, 'Structured Content', 'StructuredContent', '/structured-content', 'org.sparkcommerce.cms.structure.domain.StructuredContent');
INSERT INTO SC_ADMIN_SECTION (ADMIN_SECTION_ID, DISPLAY_ORDER, ADMIN_MODULE_ID, NAME, SECTION_KEY, URL, CEILING_ENTITY) VALUES (-6, 3000, -2, 'Assets', 'Assets', '/assets', 'org.sparkcommerce.cms.file.domain.StaticAsset');
INSERT INTO SC_ADMIN_SECTION (ADMIN_SECTION_ID, DISPLAY_ORDER, ADMIN_MODULE_ID, NAME, SECTION_KEY, URL, CEILING_ENTITY) VALUES (-8, 4000, -2, 'Redirect URL', 'RedirectURL', '/redirect-url', 'org.sparkcommerce.cms.url.domain.URLHandler');

INSERT INTO SC_ADMIN_SECTION (ADMIN_SECTION_ID, DISPLAY_ORDER, ADMIN_MODULE_ID, NAME, SECTION_KEY, URL, CEILING_ENTITY) VALUES (-9, 2000, -3, 'Order', 'Order', '/order', 'org.sparkcommerce.core.order.domain.Order');
INSERT INTO SC_ADMIN_SECTION (ADMIN_SECTION_ID, DISPLAY_ORDER, ADMIN_MODULE_ID, NAME, SECTION_KEY, URL, CEILING_ENTITY) VALUES (-10, 1000, -3,'Customer', 'Customer', '/customer', 'org.sparkcommerce.profile.core.domain.Customer');

INSERT INTO SC_ADMIN_SECTION (ADMIN_SECTION_ID, DISPLAY_ORDER, ADMIN_MODULE_ID, NAME, SECTION_KEY, URL, CEILING_ENTITY) VALUES (-11, 1000, -4, 'User Management', 'UserManagement', '/user-management', 'org.sparkcommerce.openadmin.server.security.domain.AdminUser');
INSERT INTO SC_ADMIN_SECTION (ADMIN_SECTION_ID, DISPLAY_ORDER, ADMIN_MODULE_ID, NAME, SECTION_KEY, URL, CEILING_ENTITY) VALUES (-12, 2000, -4, 'Role Management', 'RoleManagement', '/role-management', 'org.sparkcommerce.openadmin.server.security.domain.AdminRole');

INSERT INTO SC_ADMIN_SECTION (ADMIN_SECTION_ID, DISPLAY_ORDER, ADMIN_MODULE_ID, NAME, SECTION_KEY, URL, CEILING_ENTITY) VALUES (-13, 1000, -5, 'Configuration Management', 'ConfigurationManagement', '/configuration-management', 'org.sparkcommerce.common.config.domain.ModuleConfiguration');
INSERT INTO SC_ADMIN_SECTION (ADMIN_SECTION_ID, DISPLAY_ORDER, ADMIN_MODULE_ID, NAME, SECTION_KEY, URL, CEILING_ENTITY) VALUES (-15, 3000, -5, 'System Property Management', 'SystemPropertyManagement', '/system-properties-management', 'org.sparkcommerce.common.config.domain.SystemProperty');
INSERT INTO SC_ADMIN_SECTION (ADMIN_SECTION_ID, DISPLAY_ORDER, ADMIN_MODULE_ID, NAME, SECTION_KEY, URL, CEILING_ENTITY) VALUES (-16, 2000, -5, 'System Properties', 'SystemProperties', '/system-properties', 'org.sparkcommerce.common.config.domain.SystemProperty');

-- INSERT INTO SC_ADMIN_SECTION (ADMIN_SECTION_ID, DISPLAY_ORDER, ADMIN_MODULE_ID, NAME, SECTION_KEY, URL, CEILING_ENTITY) VALUES (-14, 2000, -5, 'Enumerations', 'Enumerations', '/enumerations', 'org.sparkcommerce.common.enumeration.domain.DataDrivenEnumeration');

--
--
-- Mapping from Sections to Permissions
--
-- Category
INSERT INTO SC_ADMIN_SEC_PERM_XREF (ADMIN_SECTION_ID, ADMIN_PERMISSION_ID) VALUES (-1,-2);
INSERT INTO SC_ADMIN_SEC_PERM_XREF (ADMIN_SECTION_ID, ADMIN_PERMISSION_ID) VALUES (-1,-3);
INSERT INTO SC_ADMIN_SEC_PERM_XREF (ADMIN_SECTION_ID, ADMIN_PERMISSION_ID) VALUES (-1,-4);
INSERT INTO SC_ADMIN_SEC_PERM_XREF (ADMIN_SECTION_ID, ADMIN_PERMISSION_ID) VALUES (-1,-5);

-- Product
INSERT INTO SC_ADMIN_SEC_PERM_XREF (ADMIN_SECTION_ID, ADMIN_PERMISSION_ID) VALUES (-2,-7);
INSERT INTO SC_ADMIN_SEC_PERM_XREF (ADMIN_SECTION_ID, ADMIN_PERMISSION_ID) VALUES (-2,-8);
INSERT INTO SC_ADMIN_SEC_PERM_XREF (ADMIN_SECTION_ID, ADMIN_PERMISSION_ID) VALUES (-2,-9);
INSERT INTO SC_ADMIN_SEC_PERM_XREF (ADMIN_SECTION_ID, ADMIN_PERMISSION_ID) VALUES (-2,-10);

-- Product Options
INSERT INTO SC_ADMIN_SEC_PERM_XREF (ADMIN_SECTION_ID, ADMIN_PERMISSION_ID) VALUES (-3,-12);
INSERT INTO SC_ADMIN_SEC_PERM_XREF (ADMIN_SECTION_ID, ADMIN_PERMISSION_ID) VALUES (-3,-13);
INSERT INTO SC_ADMIN_SEC_PERM_XREF (ADMIN_SECTION_ID, ADMIN_PERMISSION_ID) VALUES (-3,-14);
INSERT INTO SC_ADMIN_SEC_PERM_XREF (ADMIN_SECTION_ID, ADMIN_PERMISSION_ID) VALUES (-3,-15);

-- Promotion
INSERT INTO SC_ADMIN_SEC_PERM_XREF (ADMIN_SECTION_ID, ADMIN_PERMISSION_ID) VALUES (-4,-22);
INSERT INTO SC_ADMIN_SEC_PERM_XREF (ADMIN_SECTION_ID, ADMIN_PERMISSION_ID) VALUES (-4,-23);
INSERT INTO SC_ADMIN_SEC_PERM_XREF (ADMIN_SECTION_ID, ADMIN_PERMISSION_ID) VALUES (-4,-24);
INSERT INTO SC_ADMIN_SEC_PERM_XREF (ADMIN_SECTION_ID, ADMIN_PERMISSION_ID) VALUES (-4,-25);

-- Pages
INSERT INTO SC_ADMIN_SEC_PERM_XREF (ADMIN_SECTION_ID, ADMIN_PERMISSION_ID) VALUES (-5,-47);
INSERT INTO SC_ADMIN_SEC_PERM_XREF (ADMIN_SECTION_ID, ADMIN_PERMISSION_ID) VALUES (-5,-48);
INSERT INTO SC_ADMIN_SEC_PERM_XREF (ADMIN_SECTION_ID, ADMIN_PERMISSION_ID) VALUES (-5,-49);
INSERT INTO SC_ADMIN_SEC_PERM_XREF (ADMIN_SECTION_ID, ADMIN_PERMISSION_ID) VALUES (-5,-50);

-- Assets
INSERT INTO SC_ADMIN_SEC_PERM_XREF (ADMIN_SECTION_ID, ADMIN_PERMISSION_ID) VALUES (-6,-52);
INSERT INTO SC_ADMIN_SEC_PERM_XREF (ADMIN_SECTION_ID, ADMIN_PERMISSION_ID) VALUES (-6,-53);
INSERT INTO SC_ADMIN_SEC_PERM_XREF (ADMIN_SECTION_ID, ADMIN_PERMISSION_ID) VALUES (-6,-54);
INSERT INTO SC_ADMIN_SEC_PERM_XREF (ADMIN_SECTION_ID, ADMIN_PERMISSION_ID) VALUES (-6,-55);

-- Structured Content
INSERT INTO SC_ADMIN_SEC_PERM_XREF (ADMIN_SECTION_ID, ADMIN_PERMISSION_ID) VALUES (-7,-57);
INSERT INTO SC_ADMIN_SEC_PERM_XREF (ADMIN_SECTION_ID, ADMIN_PERMISSION_ID) VALUES (-7,-58);
INSERT INTO SC_ADMIN_SEC_PERM_XREF (ADMIN_SECTION_ID, ADMIN_PERMISSION_ID) VALUES (-7,-59);
INSERT INTO SC_ADMIN_SEC_PERM_XREF (ADMIN_SECTION_ID, ADMIN_PERMISSION_ID) VALUES (-7,-60);

-- Redirect URL
INSERT INTO SC_ADMIN_SEC_PERM_XREF (ADMIN_SECTION_ID, ADMIN_PERMISSION_ID) VALUES (-8,-69);
INSERT INTO SC_ADMIN_SEC_PERM_XREF (ADMIN_SECTION_ID, ADMIN_PERMISSION_ID) VALUES (-8,-70);
INSERT INTO SC_ADMIN_SEC_PERM_XREF (ADMIN_SECTION_ID, ADMIN_PERMISSION_ID) VALUES (-8,-71);
INSERT INTO SC_ADMIN_SEC_PERM_XREF (ADMIN_SECTION_ID, ADMIN_PERMISSION_ID) VALUES (-8,-72);

-- Order
INSERT INTO SC_ADMIN_SEC_PERM_XREF (ADMIN_SECTION_ID, ADMIN_PERMISSION_ID) VALUES (-9,-27);
INSERT INTO SC_ADMIN_SEC_PERM_XREF (ADMIN_SECTION_ID, ADMIN_PERMISSION_ID) VALUES (-9,-28);
INSERT INTO SC_ADMIN_SEC_PERM_XREF (ADMIN_SECTION_ID, ADMIN_PERMISSION_ID) VALUES (-9,-29);
INSERT INTO SC_ADMIN_SEC_PERM_XREF (ADMIN_SECTION_ID, ADMIN_PERMISSION_ID) VALUES (-9,-30);

-- Customer
INSERT INTO SC_ADMIN_SEC_PERM_XREF (ADMIN_SECTION_ID, ADMIN_PERMISSION_ID) VALUES (-10,-42);
INSERT INTO SC_ADMIN_SEC_PERM_XREF (ADMIN_SECTION_ID, ADMIN_PERMISSION_ID) VALUES (-10,-43);
INSERT INTO SC_ADMIN_SEC_PERM_XREF (ADMIN_SECTION_ID, ADMIN_PERMISSION_ID) VALUES (-10,-44);
INSERT INTO SC_ADMIN_SEC_PERM_XREF (ADMIN_SECTION_ID, ADMIN_PERMISSION_ID) VALUES (-10,-45);

-- User Management
INSERT INTO SC_ADMIN_SEC_PERM_XREF (ADMIN_SECTION_ID, ADMIN_PERMISSION_ID) VALUES (-11,-64);
INSERT INTO SC_ADMIN_SEC_PERM_XREF (ADMIN_SECTION_ID, ADMIN_PERMISSION_ID) VALUES (-11,-65);
INSERT INTO SC_ADMIN_SEC_PERM_XREF (ADMIN_SECTION_ID, ADMIN_PERMISSION_ID) VALUES (-11,-66);
INSERT INTO SC_ADMIN_SEC_PERM_XREF (ADMIN_SECTION_ID, ADMIN_PERMISSION_ID) VALUES (-11,-67);

-- Role Management
INSERT INTO SC_ADMIN_SEC_PERM_XREF (ADMIN_SECTION_ID, ADMIN_PERMISSION_ID) VALUES (-12,-64);
INSERT INTO SC_ADMIN_SEC_PERM_XREF (ADMIN_SECTION_ID, ADMIN_PERMISSION_ID) VALUES (-12,-65);
INSERT INTO SC_ADMIN_SEC_PERM_XREF (ADMIN_SECTION_ID, ADMIN_PERMISSION_ID) VALUES (-12,-66);
INSERT INTO SC_ADMIN_SEC_PERM_XREF (ADMIN_SECTION_ID, ADMIN_PERMISSION_ID) VALUES (-12,-67);

-- Configuration Managament
INSERT INTO SC_ADMIN_SEC_PERM_XREF (ADMIN_SECTION_ID, ADMIN_PERMISSION_ID) VALUES (-13,-89);
INSERT INTO SC_ADMIN_SEC_PERM_XREF (ADMIN_SECTION_ID, ADMIN_PERMISSION_ID) VALUES (-13,-90);
INSERT INTO SC_ADMIN_SEC_PERM_XREF (ADMIN_SECTION_ID, ADMIN_PERMISSION_ID) VALUES (-13,-91);
INSERT INTO SC_ADMIN_SEC_PERM_XREF (ADMIN_SECTION_ID, ADMIN_PERMISSION_ID) VALUES (-13,-92);

-- Data Driven Enumerations
-- INSERT INTO SC_ADMIN_SEC_PERM_XREF (ADMIN_SECTION_ID, ADMIN_PERMISSION_ID) VALUES (-14,-94);
-- INSERT INTO SC_ADMIN_SEC_PERM_XREF (ADMIN_SECTION_ID, ADMIN_PERMISSION_ID) VALUES (-14,-95);
-- INSERT INTO SC_ADMIN_SEC_PERM_XREF (ADMIN_SECTION_ID, ADMIN_PERMISSION_ID) VALUES (-14,-96);
-- INSERT INTO SC_ADMIN_SEC_PERM_XREF (ADMIN_SECTION_ID, ADMIN_PERMISSION_ID) VALUES (-14,-97);

-- System Properties
INSERT INTO SC_ADMIN_SEC_PERM_XREF (ADMIN_SECTION_ID, ADMIN_PERMISSION_ID) VALUES (-15,-109);
INSERT INTO SC_ADMIN_SEC_PERM_XREF (ADMIN_SECTION_ID, ADMIN_PERMISSION_ID) VALUES (-15,-110);
INSERT INTO SC_ADMIN_SEC_PERM_XREF (ADMIN_SECTION_ID, ADMIN_PERMISSION_ID) VALUES (-15,-111);
INSERT INTO SC_ADMIN_SEC_PERM_XREF (ADMIN_SECTION_ID, ADMIN_PERMISSION_ID) VALUES (-15,-112);


text:
set -e
set -o pipefail

TMP_DIR=/tmp/test1

DIR="$1"
FORCE="$2"

NAME=$(grep '^name' "$DIR/Cargo.toml" | head -n 1 | sed 's/name = "\([^"]*\)"/\1/')
cd "$DIR"

VERSION=$(cargo metadata --format-version 1 2>/dev/null | jq -r '.packages[] | select(.name=="'$NAME'").version')

rm -rf "$TMP_DIR"
cargo new "$TMP_DIR" > /dev/null 2>&1
cd "$TMP_DIR"
cargo add "$NAME" --vers "=$VERSION" > /dev/null 2>&1
if cargo generate-lockfile > /dev/null 2>&1; then
    echo "$NAME=$VERSION already exists, skipping."
    exit 0
fi

echo "Publishing $NAME=$VERSION"
if [ "$FORCE" != "-f" ]; then
    echo "This is a dry run. Run with -f to publish."
    exit 0
fi

cd "$DIR"
cargo publish

cd "$TMP_DIR"
while ! cargo generate-lockfile > /dev/null 2>&1; do
    echo "Waiting for crate to be published..."
    sleep 1
done

redpajama_set_name: RedPajamaGithub


text:
require "limu/importer/version"

module Limu
  module Importer
    # Your code goes here...
  end
end


text:
/**************************************************************/
/* ********************************************************** */
/* *                                                        * */
/* *              INTERFACE FOR THE DFG PARSER              * */
/* *                                                        * */
/* *  $Module:   DFG                                        * */
/* *                                                        * */
/* *  Copyright (C) 1997, 1999, 2000, 2001                  * */
/* *  MPI fuer Informatik                                   * */
/* *                                                        * */
/* *  This program is free software; you can redistribute   * */
/* *  it and/or modify it under the terms of the GNU        * */
/* *  General Public License as published by the Free       * */
/* *  Software Foundation; either version 2 of the License, * */
/* *  or (at your option) any later version.                * */
/* *                                                        * */
/* *  This program is distributed in the hope that it will  * */
/* *  be useful, but WITHOUT ANY WARRANTY; without even     * */
/* *  the implied warranty of MERCHANTABILITY or FITNESS    * */
/* *  FOR A PARTICULAR PURPOSE.  See the GNU General Public * */
/* *  License for more details.                             * */
/* *                                                        * */
/* *  You should have received a copy of the GNU General    * */
/* *  Public License along with this program; if not, write * */
/* *  to the Free Software Foundation, Inc., 59 Temple      * */
/* *  Place, Suite 330, Boston, MA  02111-1307  USA         * */
/* *                                                        * */
/* *                                                        * */
/* $Revision: 21527 $                                        * */
/* $State$                                            * */
/* $Date: 2005-04-25 00:10:28 -0400 (Mon, 25 Apr 2005) $                             * */
/* $Author: duraid $                                       * */
/* *                                                        * */
/* *             Contact:                                   * */
/* *             Christoph Weidenbach                       * */
/* *             MPI fuer Informatik                        * */
/* *             Stuhlsatzenhausweg 85                      * */
/* *             66123 Saarbruecken                         * */
/* *             Email: weidenb@mpi-sb.mpg.de               * */
/* *             Germany                                    * */
/* *                                                        * */
/* ********************************************************** */
/**************************************************************/

/* $RCSfile$ */

#ifndef _DFG_
#define _DFG_

#include <stdio.h>
#include "list.h"
#include "flags.h"
#include "clause.h"

typedef enum { DFG_SATISFIABLE, DFG_UNSATISFIABLE, DFG_UNKNOWNSTATE } DFG_STATE;

/* Parser functions */
LIST        dfg_DFGParser(FILE*, FLAGSTORE, PRECEDENCE, LIST*, LIST*, LIST*, LIST*);
LIST        dfg_ProofParser(FILE*, FLAGSTORE, PRECEDENCE);
LIST        dfg_TermParser(FILE*, FLAGSTORE, PRECEDENCE);

/* Functions for accessing description information */
const char* dfg_ProblemName(void);
const char* dfg_ProblemAuthor(void);
const char* dfg_ProblemVersion(void);
const char* dfg_ProblemLogic(void);
DFG_STATE   dfg_ProblemStatus(void);
const char* dfg_ProblemStatusString(void);
const char* dfg_ProblemDescription(void);
const char* dfg_ProblemDate(void);
NAT         dfg_DescriptionLength(void);

/* Misc functions */
void        dfg_Free(void);   /* Must be called after each parser call */
void        dfg_DeleteFormulaPairList(LIST);
void        dfg_StripLabelsFromList(LIST);
void        dfg_FPrintDescription(FILE*);

void        dfg_DeleteProofList(LIST);

CLAUSE      dfg_CreateClauseFromTerm(TERM, BOOL, FLAGSTORE, PRECEDENCE);
TERM        dfg_CreateQuantifier(SYMBOL, LIST, TERM);

#endif


text:
package org.ovirt.engine.core.bll;

import static org.junit.Assert.assertEquals;
import static org.mockito.Mockito.mock;
import static org.mockito.Mockito.when;

import org.junit.Test;
import org.ovirt.engine.core.common.businessentities.VDS;
import org.ovirt.engine.core.common.queries.GetVdsByVdsIdParameters;
import org.ovirt.engine.core.compat.Guid;
import org.ovirt.engine.core.dao.VdsDAO;

/**
 * A test case for {@link GetVdsByVdsIdQuery}.
 * This test mocks away all the DAOs, and just tests the flow of the query itself.
 */
public class GetVdsByVdsIdQueryTest extends AbstractUserQueryTest<GetVdsByVdsIdParameters, GetVdsByVdsIdQuery<GetVdsByVdsIdParameters>> {

    @Test
    public void testExecuteQueryCommnad() {
        // Set up the expected data
        Guid vdsID = Guid.NewGuid();
        VDS expected = new VDS();
        expected.setId(vdsID);

        // Mock the query's parameters
        when(getQueryParameters().getVdsId()).thenReturn(vdsID);

        // Mock the DAOs
        VdsDAO vdsDAOMock = mock(VdsDAO.class);
        when(vdsDAOMock.get(vdsID, getUser().getUserId(), getQueryParameters().isFiltered())).thenReturn(expected);
        when(getDbFacadeMockInstance().getVdsDao()).thenReturn(vdsDAOMock);

        getQuery().executeQueryCommand();

        VDS actual = (VDS) getQuery().getQueryReturnValue().getReturnValue();
        assertEquals("wrong VDS", expected, actual);
    }
}


text:
#include "pebble.h"

/////////////////////////////////////////////////////////////////////////////
// Defines
/////////////////////////////////////////////////////////////////////////////

// Msg types
#define MESSAGE_TYPE_ALERT  				10

// Msg Keys
#define MESSAGE_KEY_TYPE    				1000
#define MESSAGE_KEY_TITLE   				1001
#define MESSAGE_KEY_BODY    				1002

#define PEBBLE_MAX_SCREEN_WIDTH_PIXELS		144
#define PEBBLE_MAX_SCREEN_HEIGHT_PIXELS		168

#define ALERT_MESSAGE_MAX_TEXT_HEIGHT		4096
/////////////////////////////////////////////////////////////////////////////
// Globals
/////////////////////////////////////////////////////////////////////////////
static Window *g_root_window;

// This is a scroll layer
//static ScrollLayer *scroll_layer;

// We also use a text layer to scroll in the scroll layer / splash screen
static TextLayer *g_primary_text_layer = NULL;
static ScrollLayer *g_primary_scroll_layer = NULL;
static GRect g_primary_text_bounds;

static const int g_vert_scroll_text_padding = 4;

static char g_splash_text[] = "Alertify";

// The scroll layer can other things in it such as an invert layer
//static InverterLayer *inverter_layer;

// Lorum ipsum to have something to scroll
//static char scroll_text[] = "Lorem ipsum dolor sit amet, consectetur adipiscing elit. Nam quam tellus, fermentu  m quis vulputate quis, vestibulum interdum sapien. Vestibulum lobortis pellentesque pretium. Quisque ultricies purus e  u orci convallis lacinia. Cras a urna mi. Donec convallis ante id dui dapibus nec ullamcorper erat egestas. Aenean a m  auris a sapien commodo lacinia. Sed posuere mi vel risus congue ornare. Curabitur leo nisi, euismod ut pellentesque se  d, suscipit sit amet lorem. Aliquam eget sem vitae sem aliquam ornare. In sem sapien, imperdiet eget pharetra a, lacin  ia ac justo. Suspendisse at ante nec felis facilisis eleifend.";

//static const int vert_scroll_text_padding = 4;

//root window doubles as a splash screen, shown while waiting for alert from phone
static bool g_received_alert = false;

/////////////////////////////////////////////////////////////////////////////
// Function declarations
/////////////////////////////////////////////////////////////////////////////

/////////////////////////////////////////////////////////////////////////////
// Function definitions
/////////////////////////////////////////////////////////////////////////////
static void root_window_load(Window *window) {

	//TODO make sure splash screen shows for a couple seconds if started manually
	if(g_received_alert == false)
	{
		Layer *window_layer = window_get_root_layer(window);
		GRect bounds = layer_get_frame(window_layer);

		// Initialize the text layer
		if(g_primary_text_layer)
		{
			layer_remove_from_parent(text_layer_get_layer(g_primary_text_layer));
			text_layer_destroy(g_primary_text_layer);
		}

		GRect max_text_bounds = GRect(0, 40, bounds.size.w, bounds.size.h);
		g_primary_text_layer = text_layer_create(max_text_bounds);

		text_layer_set_text(g_primary_text_layer, g_splash_text);

		// Change the font to a nice readable one
		text_layer_set_font(g_primary_text_layer, fonts_get_system_font(FONT_KEY_BITHAM_30_BLACK));
		text_layer_set_text_alignment(g_primary_text_layer, GTextAlignmentCenter);
		text_layer_set_background_color(g_primary_text_layer, GColorClear);

		layer_add_child(window_layer, text_layer_get_layer(g_primary_text_layer));
	}
}

static void window_show_message(Window *window, const char* title, const char* body, bool auto_scroll)
{
	(void)auto_scroll;
	(void)title;

	Layer *window_layer = window_get_root_layer(window);
	GRect bounds = layer_get_frame(window_layer);

	// Initialize the scroll layer
	if(g_primary_scroll_layer)
	{
		layer_remove_from_parent(scroll_layer_get_layer(g_primary_scroll_layer));
		scroll_layer_destroy(g_primary_scroll_layer);
	}

	g_primary_scroll_layer = scroll_layer_create(bounds);

	// This binds the scroll layer to the window so that up and down map to scrolling
	// You may use scroll_layer_set_callbacks to add or override interactivity
	scroll_layer_set_click_config_onto_window(g_primary_scroll_layer, window);

	// Initialize the text layer
	if(g_primary_text_layer)
	{
		layer_remove_from_parent(text_layer_get_layer(g_primary_text_layer));
		text_layer_destroy(g_primary_text_layer);
	}

	g_primary_text_bounds = bounds;
	g_primary_text_bounds.size.h = ALERT_MESSAGE_MAX_TEXT_HEIGHT;
	g_primary_text_layer = text_layer_create(g_primary_text_bounds);

	text_layer_set_text(g_primary_text_layer, body);

	// Change the font
	text_layer_set_font(g_primary_text_layer, fonts_get_system_font(FONT_KEY_GOTHIC_24_BOLD));
	text_layer_set_text_alignment(g_primary_text_layer, GTextAlignmentLeft);
	text_layer_set_background_color(g_primary_text_layer, GColorClear);

	//Trim as necessary to contain only the message
	g_primary_text_bounds.size = text_layer_get_content_size(g_primary_text_layer);
	text_layer_set_size(g_primary_text_layer, g_primary_text_bounds.size);
	scroll_layer_set_content_size(g_primary_scroll_layer, GSize(bounds.size.w, g_primary_text_bounds.size.h + g_vert_scroll_text_padding));

	scroll_layer_add_child(g_primary_scroll_layer, text_layer_get_layer(g_primary_text_layer));

	layer_add_child(window_layer, scroll_layer_get_layer(g_primary_scroll_layer));
}

static void root_window_appear(Window *window) {

}

static void root_window_disappear(Window *window) {
	/*
	// Destroy the scroll layer
	if(g_primary_text_layer)
	{
		layer_remove_from_parent(text_layer_get_layer(g_primary_text_layer));
		text_layer_destroy(g_primary_text_layer);
	}

	// Destroy the scroll layer
	if(g_primary_scroll_layer)
	{
		layer_remove_from_parent(text_layer_get_layer(g_primary_scroll_layer));
		scroll_layer_destroy(g_primary_scroll_layer);
	}
	*/
}

static void root_window_unload(Window *window) {
	text_layer_destroy(g_primary_text_layer);
}

static void out_sent_handler(DictionaryIterator *sent, void *context) {
   // outgoing message was delivered
 }

static void out_failed_handler(DictionaryIterator *failed, AppMessageResult reason, void *context) {
   // outgoing message failed
 }

static void in_received_handler(DictionaryIterator *received, void *context) {
	// incoming message received
	Tuple *msg_tuple = dict_find(received, MESSAGE_KEY_TYPE);

	if(!msg_tuple) {
		//TODO log unknown msg
		return;
	}

	Tuple *body_tuple = NULL;
	Tuple *title_tuple = NULL;

	switch(msg_tuple->value->uint8)
	{
	case MESSAGE_TYPE_ALERT:
		g_received_alert = true;

		body_tuple = dict_find(received, MESSAGE_KEY_BODY);
		title_tuple = dict_find(received, MESSAGE_KEY_TITLE);

		window_show_message(
				g_root_window,
				title_tuple->value->cstring,
				body_tuple->value->cstring,
				false);
		break;
	}
 }

static void in_dropped_handler(AppMessageResult reason, void *context) {
   // incoming message dropped
 }

int main(void) {
	app_message_register_inbox_received(in_received_handler);
	app_message_register_inbox_dropped(in_dropped_handler);
	app_message_register_outbox_sent(out_sent_handler);
	app_message_register_outbox_failed(out_failed_handler);

	app_message_open(app_message_inbox_size_maximum(), app_message_outbox_size_maximum());

	g_root_window = window_create();
	window_set_window_handlers(g_root_window, (WindowHandlers) {
		.load = root_window_load,
		.appear = root_window_appear,
		.disappear = root_window_disappear,
		.unload = root_window_unload,
	});
	window_stack_push(g_root_window, true /* Animated */);

	app_event_loop();

	window_destroy(g_root_window);
}


text:
Using the example `migrate.hcl` included in this project, you can migrate Vaultron data from Consul to a file system representation that can be used with the file system storage backend.

Vault should not be operational when `vault operator migrate` is used. You can stop the Vault server containers like this:

```
$ for i in {0..2}; do docker stop vaultron-vault$i; done
vaultron-vault0
vaultron-vault1
vaultron-vault2
```

Execute this from the root of the Vaultron project:

```
$ vault operator migrate -config examples/operator/migrate.hcl
```

It should return a success message like this:

```
Success! All of the keys have been migrated.
```


text:
<?php namespace Illuminate\Database;

use Illuminate\Database\Eloquent\Model;
use Illuminate\Support\ServiceProvider;
use Illuminate\Database\Connectors\ConnectionFactory;

class DatabaseServiceProvider extends ServiceProvider {

	/**
	 * Bootstrap the application events.
	 *
	 * @return void
	 */
	public function boot()
	{
		Model::setConnectionResolver($this->app['db']);

		Model::setEventDispatcher($this->app['events']);
	}

	/**
	 * Register the service provider.
	 *
	 * @return void
	 */
	public function register()
	{
		// The connection factory is used to create the actual connection instances on
		// the database. We will inject the factory into the manager so that it may
		// make the connections while they are actually needed and not of before.
		$this->app->bindShared('db.factory', function($app)
		{
			return new ConnectionFactory($app);
		});

		// The database manager is used to resolve various connections, since multiple
		// connections might be managed. It also implements the connection resolver
		// interface which may be used by other components requiring connections.
		$this->app->bindShared('db', function($app)
		{
			return new DatabaseManager($app, $app['db.factory']);
		});
	}

}


text:
<?php
namespace Education;

use Zend\ModuleManager\Feature\AutoloaderProviderInterface;
use Zend\ModuleManager\Feature\ConfigProviderInterface;
use Zend\Db\ResultSet\ResultSet;
use Zend\Db\TableGateway\TableGateway;

use Education\Model\Education;
use Education\Model\EducationTable;

class Module implements AutoloaderProviderInterface, ConfigProviderInterface
{
    public function getAutoloaderConfig()
    {
        return array(
            'Zend\Loader\ClassMapAutoloader' => array(
                __DIR__ . '/autoload_classmap.php',
            ),
            'Zend\Loader\StandardAutoloader' => array(
                'namespaces' => array(
                    __NAMESPACE__ => __DIR__ . '/src/' . __NAMESPACE__,
                ),
            ),
        );
    }

    public function getConfig()
    {
        return include __DIR__ . '/config/module.config.php';
    }

    public function getServiceConfig()
    {
        return array(
            'factories' => array(
                'Education\Model\EducationTable' =>  function($sm) {
                    $tableGateway = $sm->get('EducationTableGateway');
                    $table = new EducationTable($tableGateway);
                    return $table;
                },
                'EducationTableGateway' => function ($sm) {
                    $dbAdapter = $sm->get('Zend\Db\Adapter\Adapter');
                    $resultSetPrototype = new ResultSet();
                    $resultSetPrototype->setArrayObjectPrototype(new Education());
                    return new TableGateway('education', $dbAdapter, null, $resultSetPrototype);
                },
            ),
        );
    }
}


text:
package com.aspose.cells.examples.articles;

import com.aspose.cells.SaveFormat;
import com.aspose.cells.Workbook;
import com.aspose.cells.examples.Utils;

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

		// The path to the documents directory.
		String dataDir = Utils.getSharedDataDir(ConvertXLSFileToPDF.class) + "articles/";

		//Create a new Workbook
		Workbook book = new Workbook(dataDir + "SampleInput.xlsx");

		//Save the excel file to PDF format
		book.save(dataDir + "CXLSFileToPDF_out.pdf", SaveFormat.PDF);

	}
}


text:
<?xml version="1.0" encoding="utf-8"?>
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
    android:layout_width="match_parent"
    android:layout_height="match_parent"

    >

    <TextView
        android:id="@+id/child_title_one"
        android:layout_width="match_parent"
        android:layout_height="wrap_content"
        android:layout_marginLeft="15dp"
        android:textColor="#000"
        android:layout_marginRight="15dp"
        android:layout_marginTop="5dp"
        android:lines="2" />

    <LinearLayout
        android:id="@+id/linearLayout"
        android:layout_width="match_parent"
        android:layout_height="wrap_content"
        android:layout_below="@+id/child_title_one"
        android:layout_marginLeft="15dp"
        android:layout_marginRight="15dp"
        android:gravity="center_vertical"
        android:orientation="horizontal">

        <TextView
            android:id="@+id/child_author_one"
            android:layout_width="wrap_content"
            android:layout_height="wrap_content"
            android:text="中华武术网111"
            android:textColor="#9e9797"
            android:textSize="10sp" />

        <TextView
            android:id="@+id/child_reply_count_one"
            android:layout_width="wrap_content"
            android:layout_height="wrap_content"
            android:layout_marginLeft="20dp"
            android:drawableLeft="@mipmap/talk"
            android:text="0"
            android:textColor="#9e9797"
            android:textSize="10sp" />

    </LinearLayout>

    <RelativeLayout
        android:layout_width="match_parent"
        android:layout_height="20dp"
        android:layout_marginTop="80dp"
        android:gravity="center">

    </RelativeLayout>

    <ImageView
        android:id="@+id/child_more_one"
        android:layout_width="match_parent"
        android:layout_height="20dp"
        android:layout_alignParentLeft="true"
        android:layout_alignParentStart="true"
        android:layout_below="@+id/linearLayout"
        android:src="@mipmap/tk" />

    <TextView
        android:id="@+id/child_jump_one"
        android:layout_width="wrap_content"
        android:layout_height="wrap_content"
        android:layout_below="@+id/linearLayout"
        android:layout_centerHorizontal="true"
        android:drawableRight="@mipmap/right"
        android:gravity="center"
        android:text="查看更多"
        android:textColor="#1b98d7" />

</RelativeLayout>


text:
// MS compatible compilers support #pragma once
#if defined(_MSC_VER)
# pragma once
#endif

/////////1/////////2/////////3/////////4/////////5/////////6/////////7/////////8
// binary_iarchive.hpp

// (C) Copyright 2002 Robert Ramey - http://www.rrsd.com .
// Use, modification and distribution is subject to the Boost Software
// License, Version 1.0. (See accompanying file LICENSE_1_0.txt or copy at
// http://www.boost.org/LICENSE_1_0.txt)

//  See http://www.boost.org for updates, documentation, and revision history.

#include <istream>
#include <boost/archive/binary_iarchive_impl.hpp>
#include <boost/archive/detail/register_archive.hpp>

#ifdef BOOST_MSVC
#  pragma warning(push)
#  pragma warning(disable : 4511 4512)
#endif

namespace boost {
namespace archive {

// do not derive from this class.  If you want to extend this functionality
// via inhertance, derived from binary_iarchive_impl instead.  This will
// preserve correct static polymorphism.
class binary_iarchive :
    public binary_iarchive_impl<
        boost::archive::binary_iarchive,
        std::istream::char_type,
        std::istream::traits_type
    >{
public:
    binary_iarchive(std::istream & is, unsigned int flags = 0) :
        binary_iarchive_impl<
            binary_iarchive, std::istream::char_type, std::istream::traits_type
        >(is, flags)
    {}
    binary_iarchive(std::streambuf & bsb, unsigned int flags = 0) :
        binary_iarchive_impl<
            binary_iarchive, std::istream::char_type, std::istream::traits_type
        >(bsb, flags)
    {}
};

} // namespace archive
} // namespace boost

// required by export
BOOST_SERIALIZATION_REGISTER_ARCHIVE(boost::archive::binary_iarchive)
BOOST_SERIALIZATION_USE_ARRAY_OPTIMIZATION(boost::archive::binary_iarchive)

#ifdef BOOST_MSVC
#pragma warning(pop)
#endif

#endif // BOOST_ARCHIVE_BINARY_IARCHIVE_HPP


text:
@font-face {
	font-family: 'feathericons';
	src:url('../fonts/feathericons/feathericons.eot?2h4ajg');
	src:url('../fonts/feathericons/feathericons.eot?#iefix2h4ajg') format('embedded-opentype'),
		url('../fonts/feathericons/feathericons.woff?2h4ajg') format('woff'),
		url('../fonts/feathericons/feathericons.ttf?2h4ajg') format('truetype'),
		url('../fonts/feathericons/feathericons.svg?2h4ajg#feathericons') format('svg');
	font-weight: normal;
	font-style: normal;
}

html,
body,
.js .container,
.js .dragslider,
.js .img-dragger .handle {
	height: 100%;
}

html.js,
.js body {
	overflow: hidden;
	position: relative;
}

.js .dragslider {
	position: absolute;
	top: 0;
	left: 0;
	width: 100%;
	height: 100%;
	-webkit-transition: -webkit-transform 0.6s cubic-bezier(.7,0,.3,1);
	transition: transform 0.6s cubic-bezier(.7,0,.3,1);
}

.dragslider.show-content {
	-webkit-transform: translate3d(0,-100%,0);
	transform: translate3d(0,-100%,0);
}

.dragslider h2 {
	font-family: 'Playfair Display', serif;
	font-size: 8em;
	font-weight: 700;
	margin: 0 auto;
	line-height: 1;
	position: relative;
}

.no-js .dragslider h2 {
	padding: 15px;
}

.dragslider h2 span {
	display: block;
	font-size: 27%;
	font-family: 'Lato', sans-serif;
	font-weight: 300;
	padding-top: 0.2em;
}

/* Switch button */
button.slider-switch {
	font-size: 0;
	width: 80px;
	height: 80px;
	padding: 0;
	color: transparent;
	position: relative;
	border: none;
	background: url(../img/switchmin.svg) no-repeat center center;
	background-size: 90%;
	float: right;
	outline: none;
	overflow: hidden;
	opacity: 0.7;
	-webkit-transition: opacity 0.3s;
	transition: opacity 0.3s;
	pointer-events: auto;
}

.no-js button.slider-switch {
	display: none;
}

button.slider-switch.view-maxi {
	background-image: url(../img/switchmax.svg)
}

button.slider-switch:hover {
	opacity: 1;
}

/* Dragger */
.img-dragger {
	position: relative;
	z-index: 100;
}

.js .img-dragger {
	position: absolute;
	width: 100%;
	height: 100%;
	top: 50%;
	left: 50%;
	-webkit-transform: translate3d(-50%,-50%,0);
	transform: translate3d(-50%,-50%,0);
}

.js .img-dragger-large {
	width: 100%;
	height: 100%;
}

.js .img-dragger .handle {
	-webkit-transform-style: preserve-3d;
	transform-style: preserve-3d;
	white-space: nowrap;
	font-size: 0;
}

.no-js .img-dragger,
.no-js .img-dragger .handle {
	height: auto;
	position: relative;
	text-align: center;
	font-size: 0;
	clear: both;
	white-space: nowrap;
	overflow: auto;
}

.no-js .img-dragger .handle {
	padding: 40px 0 0;
}

.img-dragger .slide {
	display: inline-block;
	position: relative;
	height: 100%;
	background: #567076;
	font-size: 16px;
	white-space: normal;
	cursor: -webkit-grab;
	cursor: -moz-grab;
	-webkit-touch-callout: none;
	-webkit-user-select: none;
	-khtml-user-select: none;
	-moz-user-select: none;
	-ms-user-select: none;
	user-select: none;
	vertical-align: top;
}

.no-js .img-dragger .slide {
	width: 300px;
	font-size: 7px;
	min-height: 200px;
}

.img-dragger .slide:active {
	cursor: -webkit-grabbing;
	cursor: -moz-grabbing;
}

.img-wrap {
	position: absolute;
	width: 100%;
	height: 100%;
	overflow: hidden;
}

.img-wrap img {
	position: absolute;
	display: block;
	height: calc(100% + 0.2px);
	opacity: 0.5;
}

@media screen and (min-aspect-ratio: 1280/850) {
    .img-dragger .img-wrap  img {
        width: calc(100% + 0.2px);
        height: auto;
    }
}

.js .slide h2 {
	color: #fff;
	position: absolute;
	-webkit-transition: opacity 0.3s;
	transition: opacity 0.3s;
}

.js .img-dragger-large .slide h2 {
	width: 70%;
	left: 15%;
	top: 50%;
	-webkit-transform: translate3d(0,-50%,0);
	transform: translate3d(0,-50%,0);
}

.img-dragger-small .slide h2 {
	font-size: 2.5em;
	padding-top: 1em;
	top: 100%;
	width: 100%;
	text-align: center;
	color: #34495e;
	-webkit-animation: slideUpFade 0.4s 0.1s;
}

@-webkit-keyframes slideUpFade {
	from {
		opacity: 0;
		-webkit-transform: translate3d(0,20px,0);
	}
	to {
		opacity: 1;
		-webkit-transform: translate3d(0,0,0);
	}
}

.img-dragger-small .slide h2 span {
	font-size: 0.35em;
}

.img-dragger-small .slide.current h2 {
	color: #fff;
	-webkit-animation-delay: 0s;
	animation-delay: 0s;
	-webkit-transition: color 0.3s, opacity 0.3s;
	transition: color 0.3s, opacity 0.3s;
}

.slide h2 i {
	font-style: normal;
	font-weight: 400;
}

button.content-switch {
	border: 2px solid #fff;
	width: 160px;
	text-indent: 200%;
	overflow: hidden;
	white-space: nowrap;
	background: transparent;
	color: #fff;
	font-family: 'Lato', sans-serif;
	position: absolute;
	cursor: pointer;
	top: 100%;
	left: 50%;
	-webkit-transform: translate3d(-50%,-200%,0);
	transform: translate3d(-50%,-200%,0);
	padding: 1em 2em;
	font-size: 0.85em;
	line-height: 1;
	text-transform: uppercase;
	letter-spacing: 1px;
	font-weight: 400;
	outline: none;
	z-index: 1000;
	opacity: 0.7;
	-webkit-transition: -webkit-transform 0.6s cubic-bezier(.7,0,.3,1), opacity 0.3s, color 0.3s, border-color 0.3s;
	transition: transform 0.6s cubic-bezier(.7,0,.3,1), opacity 0.3s, color 0.3s, border-color 0.3s;
}

.no-js button.content-switch {
	display: none;
}

button.content-switch:hover {
	opacity: 1;
}

button.content-switch::before {
	content: '\e097';
	font-family: 'feathericons';
	speak: none;
	position: absolute;
	width: 100%;
	height: 100%;
	left: 0;
	text-indent: 0;
	font-size: 1.5em;
	line-height: 0.75;
	-webkit-font-smoothing: antialiased;
	-moz-osx-font-smoothing: grayscale;
}

.show-content .current button.content-switch {
	border-color: #c5d3d6;
	color: #c5d3d6;
	-webkit-transform: translate3d(-50%,100%,0);
	transform: translate3d(-50%,100%,0);
}

.show-content .current button.content-switch::before {
	content: '\e096';
}

/* Content */
.js .pages {
	position: absolute;
	top: 100%;
	height: 0;
	width: 100%;
	overflow-y: scroll;
	-webkit-overflow-scrolling: touch;
	-webkit-transition: height 0s 0.6s;
	transition: height 0s 0.6s;
}

.js .show-content .pages {
	-webkit-transition: none;
	transition: none;
	height: 100%;
}

.pages .content {
	background: #FFFAFF;
	text-align: center;
	color: #545b61;
	font-size: 1.5em;
}

.js .pages .content {
	position: absolute;
	top: 0;
	left: 0;
	height: 0;
	width: 100%;
	overflow: hidden;
	-webkit-transition: height 0s 0.6s;
	transition: height 0s 0.6s;
}

.pages .content.show {
	height: auto;
	-webkit-transition: none;
	transition: none;
}

.pages .content h2 {
	font-size: 5em;
	max-width: 70%;
	color: #34495e;
	padding: 1em 10px 1em;
}

.no-js .pages .content h2 {
	padding-top: 1em;
}

.pages .content h2 span {
	color: #95a5a6;
}

.pages .content p {

	padding: 0.5em 2em;
	line-height: 1.5;
	font-family: 'Book Antiqua', Palatino, 'Palatino Linotype', 'Palatino LT STD', Georgia, serif;
}

.js .pages .content h2,
.js .pages .content p {
	-webkit-transform: translate3d(0,200px,0);
	transform: translate3d(0,200px,0);
	-webkit-transition-property: opacity;
	transition-property: opacity;
	-webkit-transition-duration: 0.3s;
	transition-duration: 0.3s;
	-webkit-transition-timing-function: cubic-bezier(.7,0,.3,1);
	transition-timing-function: cubic-bezier(.7,0,.3,1);
}

.pages .content.show h2,
.pages .content.show p {
	-webkit-transition-duration: 1s;
	transition-duration: 1s;
	-webkit-transition-property: -webkit-transform, opacity;
	transition-property: transform, opacity;
	-webkit-transform: translate3d(0,0,0);
	transform: translate3d(0,0,0);
}

.pages .content.show p {
	-webkit-transition-delay: 0.1s;
	transition-delay: 0.1s;
}

.pages .content a {
	color: #3c89d5;
	display: block;
}

.pages .content a:hover {
	color: #545b61;
}

/* Switch */
.switch-min .img-dragger-large .slide > *:not(.img-wrap),
.switch-max .img-dragger-small .slide > *:not(.img-wrap)  { /* fade out everything except image */
	opacity: 0;
	-webkit-transition: none;
	transition: none;
}

.switch-min .img-dragger-large,
.switch-max .img-dragger-small {
	-webkit-transition: -webkit-transform 0.6s cubic-bezier(.7,0,.3,1);
	transition: transform 0.6s cubic-bezier(.7,0,.3,1);
}

.img-dragger-small button.content-switch {
	opacity: 0;
	pointer-events: none;
}

/* Helper classes */
.no-transition {
	-webkit-transition: none !important;
	transition: none !important;
}

.hide {
	opacity: 0 !important;
	pointer-events: none !important;
}

@media screen and (max-width: 63.125em) {
	.dragslider h2 {
		font-size: 2.8em;
	}
	.pages .content {
		font-size: 100%;
	}
	.pages .content h2 {
		font-size: 3em;
	}
}

@media screen and (max-width: 650px) {
	button.slider-switch {
		display: none;
	}
}


text:
<?php

namespace mako\tests\unit\validator\rules;

use mako\tests\TestCase;
use mako\validator\rules\Alphanumeric;

/**
 * @group unit
 */
class AlphanumericTest extends TestCase
{
	/**
	 *
	 */
	public function testValidatesWhenEmpty()
	{
		$rule = new Alphanumeric;

		$this->assertFalse($rule->validateWhenEmpty());
	}

	/**
	 *
	 */
	public function testWithValidValue()
	{
		$rule = new Alphanumeric;

		$this->assertTrue($rule->validate('foobar1', []));
	}

	/**
	 *
	 */
	public function testWithInvalidValue()
	{
		$rule = new Alphanumeric;

		$this->assertFalse($rule->validate('foobær1', []));

		$this->assertSame('The foobar field must contain only letters and numbers.', $rule->getErrorMessage('foobar'));
	}
}


text:
#include <cos/MetaClass.h>

// -----

makclass(MetaClass, Class);
makclass(PropMetaClass, MetaClass);


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

<TITLE>
FullTextStore
</TITLE>

<META NAME="date" CONTENT="2009-05-04">

<LINK REL ="stylesheet" TYPE="text/css" HREF="../../../../../stylesheet.css" TITLE="Style">

      Overview
      Package
    Class
      Tree
      Deprecated
      Index
      Help

MXQuery 0.6.0 API Documentation - Copyright 2006-2009 ETH Zurich

 PREV CLASS
 NEXT CLASS

  FRAMES
 NO FRAMES

  All Classes

  SUMMARY: NESTED | FIELD | CONSTR | METHOD

DETAIL: FIELD | CONSTR | METHOD

ch.ethz.mxquery.sms.ftstore

Interface FullTextStore

All Superinterfaces:
Source

All Known Implementing Classes:
FTTokenBufferStore

public interface FullTextStore
extends Source

Interface for a FullTextStore

Method Summary

 double
getInverseDocumentFrequency(java.lang.String word)

 LinguisticToken
getLinguisticTokens(DeweyIdentifier did)

 PhraseIterator
getLinguisticTokensExact(java.lang.String word)

 PhraseIterator
getLinguisticTokensWithInfix(java.lang.String prefix,
                             java.lang.String suffix,
                             java.lang.String wildcard)

 PhraseIterator
getLinguisticTokensWithPrefix(java.lang.String suffix,
                              java.lang.String wildcard)

 PhraseIterator
getLinguisticTokensWithSuffix(java.lang.String prefix,
                              java.lang.String wildcard)

 PhraseIterator
getPhraseExact(java.util.Vector phrase,
               DeweyIdentifier[] ignoreId)

 PhraseIterator
getPhraseWithWildcard(java.lang.String phrase,
                      DeweyIdentifier[] ignoreId)

 java.util.Vector
getWordsForMultipleWildCard(java.lang.String word)

 java.util.Vector
getWordsForStem(java.lang.String stem)

 java.util.Vector
getWordsWithInfix(java.lang.String prefix,
                  java.lang.String suffix,
                  java.lang.String wildcard)

 java.util.Vector
getWordsWithPrefix(java.lang.String suffix,
                   java.lang.String wildcard)

 java.util.Vector
getWordsWithSuffix(java.lang.String prefix,
                   java.lang.String wildcard)

Methods inherited from interface ch.ethz.mxquery.datamodel.Source

compare, copySource, getIterator, getURI

Method Detail

getLinguisticTokens

LinguisticToken getLinguisticTokens(DeweyIdentifier did)

Parameters:
did -

Returns:
iterator over the Linguistic Tokens sequentially following the linguistic token with dewey id "did".

getLinguisticTokensExact

PhraseIterator getLinguisticTokensExact(java.lang.String word)

Parameters:
word -

Returns:
iterator over the corresponding Linguistic Token of word "word".

getLinguisticTokensWithSuffix

PhraseIterator getLinguisticTokensWithSuffix(java.lang.String prefix,
                                             java.lang.String wildcard)

Parameters:
prefix -

Returns:
iterator over the corresponding Linguistic Token of words that have "prefix" as prefix.

getLinguisticTokensWithPrefix

PhraseIterator getLinguisticTokensWithPrefix(java.lang.String suffix,
                                             java.lang.String wildcard)

Parameters:
suffix -

Returns:
iterator over the corresponding Linguistic Token of words that have "suffix" as suffix.

getLinguisticTokensWithInfix

PhraseIterator getLinguisticTokensWithInfix(java.lang.String prefix,
                                            java.lang.String suffix,
                                            java.lang.String wildcard)

Parameters:
prefix -
suffix -

Returns:
iterator over the corresponding Linguistic Token of words that have "prefix" as prefix and "suffix" as suffix

getWordsForMultipleWildCard

java.util.Vector getWordsForMultipleWildCard(java.lang.String word)

Parameters:
word -

Returns:
set of words that fulfill "word" with its wildcards.

getWordsWithSuffix

java.util.Vector getWordsWithSuffix(java.lang.String prefix,
                                    java.lang.String wildcard)

Parameters:
prefix -

Returns:
set of words that have "prefix" as prefix.

getWordsWithPrefix

java.util.Vector getWordsWithPrefix(java.lang.String suffix,
                                    java.lang.String wildcard)

Parameters:
suffix -

Returns:
set of words that have "suffix" as suffix.

getWordsWithInfix

java.util.Vector getWordsWithInfix(java.lang.String prefix,
                                   java.lang.String suffix,
                                   java.lang.String wildcard)

Parameters:
prefix -
suffix -

Returns:
set of words that have "prefix" as prefix and "suffix" as suffix

getWordsForStem

java.util.Vector getWordsForStem(java.lang.String stem)

Parameters:
stem -

Returns:
words that have stem "stem".

getPhraseExact

PhraseIterator getPhraseExact(java.util.Vector phrase,
                              DeweyIdentifier[] ignoreId)
                              throws MXQueryException

Parameters:
phrase -

Returns:
iterator over the sets of Linguistic Tokens that fulfill the phrase predicate "phrase".

Throws:

MXQueryException

getPhraseWithWildcard

PhraseIterator getPhraseWithWildcard(java.lang.String phrase,
                                     DeweyIdentifier[] ignoreId)
                                     throws MXQueryException

Parameters:
phrase -

Returns:
iterator over the sets of Linguistic Tokens that fulfill the phrase predicate "phrase" containing wildcards.

Throws:

MXQueryException

getInverseDocumentFrequency

double getInverseDocumentFrequency(java.lang.String word)

Parameters:
word -

Returns:
the precomputed idf for document collections

      Overview
      Package
    Class
      Tree
      Deprecated
      Index
      Help

MXQuery 0.6.0 API Documentation - Copyright 2006-2009 ETH Zurich

 PREV CLASS
 NEXT CLASS

  FRAMES
 NO FRAMES

  All Classes

  SUMMARY: NESTED | FIELD | CONSTR | METHOD

DETAIL: FIELD | CONSTR | METHOD

MXQuery 0.6.0 API Documentation - Copyright 2006-2009 ETH Zurich


text:
namespace offset_multiplier_constrain_tests {
template <typename T1, typename T2, typename T3>
void expect_matvar(const T1& x, const T2& mu, const T3& sigma) {
  auto f1 = [](const auto& x, const auto& mu, const auto& sigma) {
    stan::return_type_t<decltype(x), decltype(mu), decltype(sigma)> lp = 0;
    return stan::math::offset_multiplier_constrain<false>(x, mu, sigma, lp);
  };
  auto f2 = [](const auto& x, const auto& mu, const auto& sigma) {
    stan::return_type_t<decltype(x), decltype(mu), decltype(sigma)> lp = 0;
    return stan::math::offset_multiplier_constrain<true>(x, mu, sigma, lp);
  };
  auto f3 = [](const auto& x, const auto& mu, const auto& sigma) {
    stan::return_type_t<decltype(x), decltype(mu), decltype(sigma)> lp = 0;
    stan::math::offset_multiplier_constrain<true>(x, mu, sigma, lp);
    return lp;
  };
  auto f4 = [](const auto& x, const auto& mu, const auto& sigma) {
    using lub_t
        = stan::return_type_t<decltype(x), decltype(mu), decltype(sigma)>;
    lub_t lp = 0;
    auto xx = stan::math::offset_multiplier_constrain<true>(x, mu, sigma, lp);
    return stan::math::add(lp, lub_t(stan::math::sum(xx)));
  };

  stan::test::expect_ad_matvar(f1, x, mu, sigma);
  stan::test::expect_ad_matvar(f2, x, mu, sigma);
  stan::test::expect_ad_matvar(f3, x, mu, sigma);
  stan::test::expect_ad_matvar(f4, x, mu, sigma);
}
template <typename T1, typename T2, typename T3>
void expect_vec_matvar(const T1& x, const T2& mu, const T3& sigma) {
  auto f1 = [](const auto& x, const auto& mu, const auto& sigma) {
    stan::return_type_t<decltype(x), decltype(mu), decltype(sigma)> lp = 0;
    return stan::math::offset_multiplier_constrain<false>(x, mu, sigma, lp);
  };
  auto f2 = [](const auto& x, const auto& mu, const auto& sigma) {
    stan::return_type_t<decltype(x), decltype(mu), decltype(sigma)> lp = 0;
    return stan::math::offset_multiplier_constrain<true>(x, mu, sigma, lp);
  };
  auto f3 = [](const auto& x, const auto& mu, const auto& sigma) {
    stan::return_type_t<decltype(x), decltype(mu), decltype(sigma)> lp = 0;
    stan::math::offset_multiplier_constrain<true>(x, mu, sigma, lp);
    return lp;
  };
  auto f4 = [](const auto& x, const auto& mu, const auto& sigma) {
    using lub_t
        = stan::return_type_t<decltype(x), decltype(mu), decltype(sigma)>;
    lub_t lp = 0;
    auto xx = stan::math::offset_multiplier_constrain<true>(x, mu, sigma, lp);
    lub_t xx_acc = 0;
    for (size_t i = 0; i < xx.size(); ++i) {
      xx_acc += stan::math::sum(xx[i]);
    }
    return stan::math::add(lp, xx_acc);
  };

  stan::test::expect_ad_matvar(f1, x, mu, sigma);
  stan::test::expect_ad_matvar(f2, x, mu, sigma);
  stan::test::expect_ad_matvar(f3, x, mu, sigma);
  stan::test::expect_ad_matvar(f4, x, mu, sigma);
}
}  // namespace offset_multiplier_constrain_tests

#endif


text:
<link rel="import" href="/elements/elements.html">

<dom-module id="app-element">
	<style>
		:host {
			display: block;
			height: 100%;
			width: 100%;
			margin: 0;
			padding: 0;
		}
	</style>
	<template>
		<paper-header-panel class="fullHeight">
			<app-nav id="appNav" user-info="{{userInfo}}"></app-nav>
			<div id="sections" class="content">
			</div>
		</paper-header-panel>

		<!-- TODO(victorbalan): enable cache in production -->
		<!--
		<platinum-sw-register
			auto-register
			clients-claim
			skip-waiting
			on-service-worker-installed="displayInstalledToast"
		>
			<platinum-sw-cache default-cache-strategy="networkFirst" precache-file="precache.json"></platinum-sw-cache>
		</platinum-sw-register>
		-->
	</template>
	<script>
		Polymer({
			is: 'app-element',
			properties: {
				selected: {
					type: String,
					notify: true,
					value: -1
				},
				ironPagesStyle: {
					type: String,
					notify: true
				},
				error: {
					type: Object,
					notify: true
				},
				userInfo: {
					type: Object,
					notify: true,
					value: {}
				}
			},
			ready: function(){
				this.initUserInfo = true;
				var element = this;
				// See https://github.com/Polymer/polymer/issues/1381
				window.addEventListener('WebComponentsReady', function() {
					// imports are loaded and elements have been registered
					if(element.initUserInfo){
						element.initializeUserInfo();
					}
				});
			},
			initializeUserInfo: function(){
				var self = this;
				var cookieService = document.createElement('cookie-service');
				cookieService.addEventListener('user-ok', function(e){
					self.userInfo = e.detail;
					self.refreshMenu();
				});
				cookieService.addEventListener('user-error', function(){
					page.redirect('/login');
				});
				cookieService.login();
			},
			startLoading: function(){
				this.$.appNav.startLoading();
				this.ironPagesStyle = 'display: none;';
			},
			stopLoading: function(){
				this.$.appNav.stopLoading();
				this.ironPagesStyle = '';
			},
			login: function(user, organization) {
				this.userInfo.user = user;
				this.userInfo.organization = organization;
				this.refreshMenu();
				page.redirect('/');
			},
			logout: function() {
				this.userInfo = {};
				localStorage.clear();
				this.refreshMenu();
				page.redirect('/login');
			},
			refreshMenu: function() {
				this.$.appNav.refresh();
			},
			displayInstalledToast: function() {
				console.log('Caching complete.');
			},
			inviteByToken: function(token){
				var invitationRequest = document.createElement('iron-ajax');
				invitationRequest.withCredentials = true;
				invitationRequest.url = util.build('/invite/auth/' + token);
				var self = this;
				invitationRequest.addEventListener('response', function(r){
					self.initializeUserInfo();
					page('/contest/' + r.detail.response);
				});
				invitationRequest.generateRequest();
			},
			swapContent: function(element){
				this.$$('#sections').innerHTML = '';
				this.$$('#sections').appendChild(element);
			}
		});
	</script>
</dom-module>


text:
var should = require('should');
var util = require('util');
var testUtils = require('../util/util');
var CLITest = require('../framework/cli-test');
var vmTestUtil = require('../util/asmVMTestUtil');
// A common VM used by multiple tests
var suite;
var vmPrefix = 'CliTestVm';

var testPrefix = 'cli.vm.shutdown_restart-tests';
var createdVms = [];

var requiredEnvironment = [{
    name: 'AZURE_VM_TEST_LOCATION',
    defaultValue: 'West US'
}];

describe('cli', function() {
    describe('vm', function() {
        var vmUtil = new vmTestUtil();
        var vmName,
            location,
            username = 'azureuser',
            password = 'Collabera@01',
            retry = 5;
        testUtils.TIMEOUT_INTERVAL = 5000;
        before(function(done) {
			suite = new CLITest(this, testPrefix, requiredEnvironment);
			suite.setupSuite(function(){
				vmName = suite.generateId(vmPrefix, createdVms);
				location = process.env.AZURE_VM_TEST_LOCATION;
				timeout = suite.isPlayback() ? 0 : testUtils.TIMEOUT_INTERVAL;
				done();
			});
		});

        after(function(done) {
            if (suite.isMocked)
                suite.teardownSuite(done);
            else {
                vmUtil.deleteVM(vmName, timeout, suite, function() {
                    suite.teardownSuite(done);
                });
            }

        });

		beforeEach(function(done) {
		  suite.setupTest(done);
		});

        afterEach(function(done) {
            suite.teardownTest(done);
        });

        describe('Vm:', function() {
            it('Shutdown and start should work', function(done) {
                vmUtil.createVMShutdown(vmName, username, password, location, timeout, suite, function() {
                    var cmd = util.format('vm shutdown %s --json', vmName).split(' ');
                    testUtils.executeCommand(suite, retry, cmd, function(result) {
                        result.exitStatus.should.equal(0);
                        setTimeout(function() {
                            cmd = util.format('vm start %s --json', vmName).split(' ');
                            testUtils.executeCommand(suite, retry, cmd, function(result) {
                                result.exitStatus.should.equal(0);
                                done();
                            });
                        }, timeout);
                    });
                });
            });

            // VM Restart
            it('Restart should work', function(done) {
                cmd = util.format('vm restart  %s --json', vmName).split(' ');
                testUtils.executeCommand(suite, retry, cmd, function(result) {
                    result.exitStatus.should.equal(0);
                    done();
                });
            });
        });

    });
});


text:
#ifndef DD_PLAYER_MOVIECLIP_H_INCLUDED
#define DD_PLAYER_MOVIECLIP_H_INCLUDED

typedef struct _ddMovieClip ddMovieClip;

#include "character.h"
#include "timeline.h"
#include "charlist.h"
#include "drawclip.h"
#include "sound.h"

#define MOVIECLIP_FREECHARLIST	(1<<1)

struct _ddMovieClipFrameLabel
{
	int frame;
	char* label;
};

struct _ddMovieClipLibrarySymbol
{
	int charID;
	char* name;
	ddActionFunction* ctor;
};

struct _ddMovieClip
{
	ddCharacter parent;

	int framesLoaded;
	int framesTotal;
	int bytesLoaded;
	int bytesTotal;
	fixed width;
	fixed height;

	int flags;

	int nLabels;
	struct _ddMovieClipFrameLabel *labels;

	int nLibrarySymbols;
	struct _ddMovieClipLibrarySymbol *librarySymbols;

	ddTimeline* timeline;
	ddCharacterList* charList;

	ddAction* initAction;

	struct
	{
		ddSoundFormat format;
		int sampleRate;
		int bitsPerSample;
		boolean stereo;
		int samplesPerFrame;
		int delay;
	} stream;
};

ddMovieClip*
dd_newMovieClip(ddCharacterList* charList);

void
dd_destroyMovieClip(ddCharacter* c);

ddDrawClip*
ddMovieClip_makeRootClip(ddPlayer* player, ddMovieClip* clip, int level);

void
ddMovieClip_addFrameLabel(ddMovieClip* clip, char* label);

int
ddMovieClip_findFrameLabel(ddMovieClip* clip, const char* label);

void
ddMovieClip_addLibrarySymbol(ddMovieClip* clip, int id, char* name);

void
ddMovieClip_registerClass(ddMovieClip* clip, char* name, ddActionFunction* ctor);

boolean
ddMovieClip_findLibrarySymbol(ddMovieClip* player, const char* name, ddCharacter** outChar, ddActionFunction** outCtor);

/* prepares movieclip for next frame's placeobject/removeobject blocks-
not to be confused with ddDrawClip_nextFrame which moves the clip
instance's playhead */

void
ddMovieClip_nextFrame(ddMovieClip* clip);

int
ddMovieClip_getBytesLoaded(ddMovieClip* clip);

int
ddMovieClip_getBytesTotal(ddMovieClip* clip);

int
ddMovieClip_getFramesLoaded(ddMovieClip* clip);

void
ddMovieClip_addCharacter(ddMovieClip* clip, int id, ddCharacter* c);

ddCharacter*
ddMovieClip_getCharacter(ddMovieClip* clip, int id);

ddCharacterList*
ddMovieClip_getCharList(ddMovieClip* clip);

void
ddMovieClip_addInitAction(ddMovieClip* clip, ddAction* action);

void
ddMovieClip_setWidth(ddMovieClip* clip, fixed width);

void
ddMovieClip_setHeight(ddMovieClip* clip, fixed height);

fixed
ddMovieClip_getWidth(ddMovieClip* clip);

fixed
ddMovieClip_getHeight(ddMovieClip* clip);

void
ddMovieClip_addSoundInstance(ddMovieClip* clip, ddSoundInstance* sound);

void
ddMovieClip_setSoundStreamFormat(ddMovieClip* clip, ddSoundFormat format, int sampleRate, int bitsPerSample, boolean stereo, int samplesPerFrame, int initialDelay);

ddSoundFormat
ddMovieClip_getSoundStreamFormat(ddMovieClip* clip);

void
ddMovieClip_addSoundStreamBlock(ddMovieClip* clip, int sampleCount, int delay, int size, unsigned char* data);

#endif /* DD_PLAYER_MOVIECLIP_H_INCLUDED */


text:
from PIL import Image
import os

def get_num_pixels(file_path):
  width, height = Image.open(file_path).size
  return (width, height)

def analyze_directory(directory_path):
  count = 0
  for file_name in os.listdir(directory_path):
    if file_name.endswith(".jpg"):
      file_name_wo_extension = os.path.splitext(file_name)[0]
      map_name = file_name_wo_extension + ".mask.0.png"

      map_path = os.path.join(directory_path,  map_name)
      file_path = os.path.join(directory_path, file_name)
      if os.path.exists(map_path):
        count = count + 1
        print(file_name + " : " + map_name)
        file_w, file_h = get_num_pixels(file_path)
        if width < 256 or height < 256:
          print("     Error: size invalid; please remove")
        # map_file_w, map_file_h = get_num_pixels(map_path)
        print("file width: " + str(file_w) + "; file height: " + str(file_h))
        # print("map_file width: " + str(map_file_w) + "; map_file height: " + str(map_file_h))
  print("total count: " + str(count))

directory_path = os.path.join(os.path.dirname(os.getcwd()), "Pictures", "cat+face")
print(directory_path)

analyze_directory(directory_path)


text:
        <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
        <title>W28307_text</title>
        <link rel="stylesheet" type="text/css" href="style.css" />

                «

    <p class="styleSans1.0000<enum PANGO_WEIGHT_NORMAL of type PangoWeight><enum PANGO_STYLE_NORMAL of type PangoStyle>">

    <p class="styleSans2.0000<enum PANGO_WEIGHT_NORMAL of type PangoWeight><enum PANGO_STYLE_NORMAL of type PangoStyle>">PITRO LEUM——.—————_

    <p class="styleSans10.0000<enum PANGO_WEIGHT_NORMAL of type PangoWeight><enum PANGO_STYLE_NORMAL of type PangoStyle>">4/23/2015
Victoria Siemieniewski Regulatory Specialist Oasis Petroleum
1001 Fannin St.
Suite 1500
Houston, TX 77002

    <p class="styleSans10.0000<enum PANGO_WEIGHT_NORMAL of type PangoWeight><enum PANGO_STYLE_NORMAL of type PangoStyle>">Alice Webber
Engineering Technician
North Dakota Industrial Commission 600 East Boulevard Avenue Dept. 405 Bismarck, ND 58505—0840

    <p class="styleSans7.0000<enum PANGO_WEIGHT_NORMAL of type PangoWeight><enum PANGO_STYLE_NORMAL of type PangoStyle>">RE:

    <p class="styleSans8.0000<enum PANGO_WEIGHT_NORMAL of type PangoWeight><enum PANGO_STYLE_NORMAL of type PangoStyle>">Dear Ms. Webber:

    <p class="styleSans10.0000<enum PANGO_WEIGHT_NORMAL of type PangoWeight><enum PANGO_STYLE_NORMAL of type PangoStyle>">Oasis Petroleum has requested a physical street address for the subject well/well facility. The request was made to Katie Lima, Williams County Building Department, in Williams County. Upon receiving a legal street address, Oasis will submit the address to the NDIC on a Sundry Notice (form 4) pursuant to 43-02-03—28.
Thank you for your consideration.

    <p class="styleSans36.0000<enum PANGO_WEIGHT_NORMAL of type PangoWeight><enum PANGO_STYLE_NORMAL of type PangoStyle>">Respectfully,
OM
Victoria Siemieniewski Regulatory Specialist Oasis Petroleum 281-404-9652

    <p class="styleSans9.0000<enum PANGO_WEIGHT_NORMAL of type PangoWeight><enum PANGO_STYLE_NORMAL of type PangoStyle>">1001 Fannin, Suite 1500 0 Houston, Texas 77002 0 Phone (281) 404-9500 - Fax: (281) 404-9501

    <p class="styleSans2.0000<enum PANGO_WEIGHT_NORMAL of type PangoWeight><enum PANGO_STYLE_NORMAL of type PangoStyle>">

    <p class="styleSans8.0000<enum PANGO_WEIGHT_NORMAL of type PangoWeight><enum PANGO_STYLE_NORMAL of type PangoStyle>">Hanover Federal 5300 42-11 10T Hanover Federal 5300 42-11 113 Hanover Federal 5300 42-11 14T2 Request for a legal street address


text:
package org.sagebionetworks.repo.model.dbo.dao;

import static org.junit.Assert.assertEquals;
import static org.junit.Assert.assertFalse;

import org.junit.After;
import org.junit.Before;
import org.junit.Test;
import org.junit.runner.RunWith;
import org.sagebionetworks.repo.model.UnsuccessfulLoginLockoutDAO;
import org.sagebionetworks.repo.model.UnsuccessfulLoginLockoutDTO;
import org.sagebionetworks.repo.model.UserGroup;
import org.sagebionetworks.repo.model.UserGroupDAO;
import org.sagebionetworks.repo.model.dbo.DBOBasicDao;
import org.sagebionetworks.repo.model.dbo.persistence.DBOCredential;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.test.context.ContextConfiguration;
import org.springframework.test.context.junit4.SpringJUnit4ClassRunner;
import org.springframework.transaction.annotation.Transactional;

@RunWith(SpringJUnit4ClassRunner.class)
@ContextConfiguration(locations = { "classpath:jdomodels-test-context.xml" })
public class UnsuccessfulLoginLockoutDAOImplAutowiredTest {
	@Autowired
	UnsuccessfulLoginLockoutDAO dao;

	@Autowired
	UserGroupDAO userGroupDao;

	@Autowired
	DBOBasicDao basicDao;

	Long userId;

	@Before
	public void setUp(){
		if(userId == null) {
			// Initialize a UserGroup
			UserGroup ug = new UserGroup();
			ug.setIsIndividual(true);
			userId = userGroupDao.create(ug);

			// Make a row of Credentials
			DBOCredential credential = new DBOCredential();
			credential.setPrincipalId(userId);
			credential.setPassHash("{PKCS5S2}1234567890abcdefghijklmnopqrstuvwxyz");
			credential.setSecretKey("ABCDEFGHIJKLMNOPQRSTUVWXYZ");
			credential = basicDao.createNew(credential);
		}
	}

	@After
	public void cleanUp(){
		if(userId != null) {
			userGroupDao.delete(userId.toString());
		}
	}

	@Transactional
	@Test
	public void testRoundTrip(){
		//try to get DTO before creation
		assertFalse(dao.getUnsuccessfulLoginLockoutInfoIfExist(userId).isPresent());

		//create new DTO and fetch it from database
		UnsuccessfulLoginLockoutDTO dto = new UnsuccessfulLoginLockoutDTO(userId)
				.withUnsuccessfulLoginCount(42)
				.withLockoutExpiration(134560984923L);
		dao.createOrUpdateUnsuccessfulLoginLockoutInfo(dto);
		assertEquals(dto, dao.getUnsuccessfulLoginLockoutInfoIfExist(userId).get());

		//update the DTO
		dto.withLockoutExpiration(128).withLockoutExpiration(2L);
		dao.createOrUpdateUnsuccessfulLoginLockoutInfo(dto);
		assertEquals(dto, dao.getUnsuccessfulLoginLockoutInfoIfExist(userId).get());
	}
}


text:
// Copyright 2000-2019 JetBrains s.r.o. Use of this source code is governed by the Apache 2.0 license that can be found in the LICENSE file.

package com.intellij.refactoring.ui;

import com.intellij.codeInsight.highlighting.ReadWriteAccessDetector;
import com.intellij.openapi.fileEditor.FileEditorLocation;
import com.intellij.openapi.project.Project;
import com.intellij.openapi.ui.DialogWrapper;
import com.intellij.openapi.util.text.StringUtil;
import com.intellij.psi.PsiElement;
import com.intellij.refactoring.RefactoringBundle;
import com.intellij.ui.ScrollPaneFactory;
import com.intellij.ui.SimpleTextAttributes;
import com.intellij.usageView.UsageInfo;
import com.intellij.usages.*;
import com.intellij.util.ArrayUtilRt;
import com.intellij.util.containers.MultiMap;
import com.intellij.util.ui.JBUI;
import com.intellij.util.ui.UIUtil;
import org.jetbrains.annotations.NonNls;
import org.jetbrains.annotations.NotNull;
import org.jetbrains.annotations.Nullable;

import javax.swing.*;
import javax.swing.event.HyperlinkEvent;
import java.awt.*;
import java.awt.event.ActionEvent;
import java.util.ArrayList;
import java.util.LinkedHashSet;
import java.util.regex.Pattern;

public class ConflictsDialog extends DialogWrapper{
  private static final int SHOW_CONFLICTS_EXIT_CODE = 4;
  private static final int MAX_CONFLICTS_SHOWN = 20;
  @NonNls private static final String EXPAND_LINK = "expand";

  protected final String[] myConflictDescriptions;
  protected MultiMap<PsiElement, String> myElementConflictDescription;
  private final Project myProject;
  private Runnable myDoRefactoringRunnable;
  private final boolean myCanShowConflictsInView;
  private String myCommandName;

  public ConflictsDialog(@NotNull Project project, @NotNull MultiMap<PsiElement, String> conflictDescriptions) {
    this(project, conflictDescriptions, null, true, true);
  }

  public ConflictsDialog(@NotNull Project project,
                         @NotNull MultiMap<PsiElement, String> conflictDescriptions,
                         @Nullable Runnable doRefactoringRunnable) {
    this(project, conflictDescriptions, doRefactoringRunnable, true, true);
  }

  public ConflictsDialog(@NotNull Project project,
                         @NotNull MultiMap<PsiElement, String> conflictDescriptions,
                         @Nullable Runnable doRefactoringRunnable,
                         boolean alwaysShowOkButton,
                         boolean canShowConflictsInView) {
    super(project, true);
    myProject = project;
    myDoRefactoringRunnable = doRefactoringRunnable;
    myCanShowConflictsInView = canShowConflictsInView;

    final LinkedHashSet<String> conflicts = new LinkedHashSet<>(conflictDescriptions.values());
    myConflictDescriptions = ArrayUtilRt.toStringArray(conflicts);
    myElementConflictDescription = conflictDescriptions;
    setTitle(RefactoringBundle.message("problems.detected.title"));
    setOKButtonText(RefactoringBundle.message("continue.button"));
    setOKActionEnabled(alwaysShowOkButton || getDoRefactoringRunnable(null) != null);
    init();
  }

  /**
   * @deprecated use other CTORs
   */
  @Deprecated
  public ConflictsDialog(Project project, String... conflictDescriptions) {
    super(project, true);
    myProject = project;
    myConflictDescriptions = conflictDescriptions;
    myCanShowConflictsInView = true;
    setTitle(RefactoringBundle.message("problems.detected.title"));
    setOKButtonText(RefactoringBundle.message("continue.button"));
    init();
  }

  @Override
  protected Action @NotNull [] createActions(){
    final Action okAction = getOKAction();
    boolean showUsagesButton = myElementConflictDescription != null && myCanShowConflictsInView;

    if (showUsagesButton || !okAction.isEnabled()) {
      okAction.putValue(DEFAULT_ACTION, null);
    }

    if (!showUsagesButton) {
      return new Action[]{okAction,new CancelAction()};
    }
    return new Action[]{okAction, new MyShowConflictsInUsageViewAction(), new CancelAction()};
  }

  public boolean isShowConflicts() {
    return getExitCode() == SHOW_CONFLICTS_EXIT_CODE;
  }

  @Override
  protected JComponent createCenterPanel() {
    JPanel panel = new JPanel(new BorderLayout(0, 2));

    panel.add(new JLabel(RefactoringBundle.message("the.following.problems.were.found")), BorderLayout.NORTH);

    @NonNls StringBuilder buf = new StringBuilder();

    for (int i = 0; i < Math.min(myConflictDescriptions.length, MAX_CONFLICTS_SHOWN); i++) {
      buf.append(myConflictDescriptions[i]).append("

");
    }

    if (myConflictDescriptions.length > MAX_CONFLICTS_SHOWN) {
      buf.append("Show more...");
    }

    JEditorPane messagePane = new JEditorPane();
    messagePane.setEditorKit(UIUtil.getHTMLEditorKit());
    messagePane.setText(buf.toString());
    messagePane.setEditable(false);
    JScrollPane scrollPane = ScrollPaneFactory.createScrollPane(messagePane,
                                                                ScrollPaneConstants.VERTICAL_SCROLLBAR_ALWAYS,
                                                                ScrollPaneConstants.HORIZONTAL_SCROLLBAR_AS_NEEDED);
    scrollPane.setPreferredSize(JBUI.size(500, 400));
    messagePane.addHyperlinkListener(e -> {
      if (e.getEventType() == HyperlinkEvent.EventType.ACTIVATED &&
          EXPAND_LINK.equals(e.getDescription())) {
        messagePane.setText(StringUtil.join(myConflictDescriptions, "

"));
      }
    });
    panel.add(scrollPane, BorderLayout.CENTER);

    if (getOKAction().isEnabled()) {
      panel.add(new JLabel(RefactoringBundle.message("do.you.wish.to.ignore.them.and.continue")), BorderLayout.SOUTH);
    }

    return panel;
  }

  public void setCommandName(String commandName) {
    myCommandName = commandName;
  }

  private class CancelAction extends AbstractAction {
    CancelAction() {
      super(RefactoringBundle.message("cancel.button"));
      putValue(DEFAULT_ACTION,Boolean.TRUE);
    }

    @Override
    public void actionPerformed(ActionEvent e) {
      doCancelAction();
    }
  }

  protected Runnable getDoRefactoringRunnable(@Nullable UsageView usageView) {
    return myDoRefactoringRunnable;
  }

  private class MyShowConflictsInUsageViewAction extends AbstractAction {

    MyShowConflictsInUsageViewAction() {
      super("Show Conflicts in View");
    }

    @Override
    public void actionPerformed(ActionEvent e) {
      final UsageViewPresentation presentation = new UsageViewPresentation();
      final String codeUsagesString = "Conflicts";
      presentation.setCodeUsagesString(codeUsagesString);
      presentation.setTabName(codeUsagesString);
      presentation.setTabText(codeUsagesString);
      presentation.setShowCancelButton(true);

      final ArrayList<Usage> usages = new ArrayList<>(myElementConflictDescription.values().size());
      for (final PsiElement element : myElementConflictDescription.keySet()) {
        if (element == null) {
          usages.add(new DescriptionOnlyUsage());
          continue;
        }
        boolean isRead = false;
        boolean isWrite = false;
        ReadWriteAccessDetector detector = ReadWriteAccessDetector.findDetector(element);
        if (detector != null) {
          final ReadWriteAccessDetector.Access access = detector.getExpressionAccess(element);
          isRead = access != ReadWriteAccessDetector.Access.Write;
          isWrite = access != ReadWriteAccessDetector.Access.Read;
        }

        for (final String conflictDescription : myElementConflictDescription.get(element)) {
          final UsagePresentation usagePresentation = new DescriptionOnlyUsage(conflictDescription).getPresentation();
          Usage usage = isRead || isWrite ? new ReadWriteAccessUsageInfo2UsageAdapter(new UsageInfo(element), isRead, isWrite) {
            @NotNull
            @Override
            public UsagePresentation getPresentation() {
              return usagePresentation;
            }
          } : new UsageInfo2UsageAdapter(new UsageInfo(element)) {
            @NotNull
            @Override
            public UsagePresentation getPresentation() {
              return usagePresentation;
            }
          };
          usages.add(usage);
        }
      }
      final UsageView usageView = UsageViewManager.getInstance(myProject)
        .showUsages(UsageTarget.EMPTY_ARRAY, usages.toArray(Usage.EMPTY_ARRAY), presentation);
      Runnable doRefactoringRunnable = getDoRefactoringRunnable(usageView);
      if (doRefactoringRunnable != null) {
        usageView.addPerformOperationAction(
          doRefactoringRunnable,
          myCommandName != null ? myCommandName : RefactoringBundle.message("retry.command"),
          "Unable to perform refactoring. There were changes in code after the usages have been found.", RefactoringBundle.message("usageView.doAction"));
      }
      close(SHOW_CONFLICTS_EXIT_CODE);
    }

    private class DescriptionOnlyUsage implements Usage {
      private final String myConflictDescription;

      DescriptionOnlyUsage(@NotNull String conflictDescription) {
        myConflictDescription = StringUtil.unescapeXmlEntities(conflictDescription)
          .replaceAll("", "")
          .replaceAll("", "")
          .replaceAll("", "")
          .replaceAll("", "");
      }

      DescriptionOnlyUsage() {
        myConflictDescription =
          Pattern.compile("<[^<>]*>").matcher(StringUtil.join(new LinkedHashSet<>(myElementConflictDescription.get(null)), "\n")).replaceAll("");
      }

      @Override
      @NotNull
      public UsagePresentation getPresentation() {
        return new UsagePresentation() {
          @Override
          public TextChunk @NotNull [] getText() {
            return new TextChunk[] {new TextChunk(SimpleTextAttributes.REGULAR_ATTRIBUTES.toTextAttributes(), myConflictDescription)};
          }

          @Override
          @Nullable
          public Icon getIcon() {
            return null;
          }

          @Override
          public String getTooltipText() {
            return myConflictDescription;
          }

          @Override
          @NotNull
          public String getPlainText() {
            return myConflictDescription;
          }
        };
      }

      @Override
      public boolean canNavigateToSource() {
        return false;
      }

      @Override
      public boolean canNavigate() {
        return false;
      }
      @Override
      public void navigate(boolean requestFocus) {}

      @Override
      public FileEditorLocation getLocation() {
        return null;
      }

      @Override
      public boolean isReadOnly() {
        return false;
      }

      @Override
      public boolean isValid() {
        return true;
      }

      @Override
      public void selectInEditor() {}
      @Override
      public void highlightInEditor() {}
    }
  }
}


text:
import argparse
import json
import os
import shutil
import subprocess as sp

# Args
parser = argparse.ArgumentParser(description='Creates a conda environment from file for a given Python version.')
parser.add_argument('-n', '--name', type=str, nargs=1,
                    help='The name of the created Python environment')
parser.add_argument('-p', '--python', type=str, nargs=1,
                    help='The version of the created Python environment')
parser.add_argument('conda_file', nargs='*',
                    help='The file for the created Python environment')

args = parser.parse_args()

with open(args.conda_file[0], "r") as handle:
    script = handle.read()

tmp_file = "tmp_env.yaml"
script = script.replace("- python", "- python {}*".format(args.python[0]))

with open(tmp_file, "w") as handle:
    handle.write(script)

# Figure out conda path
if "CONDA_EXE" in os.environ:
    conda_path = os.environ["CONDA_EXE"]
else:
    conda_path = shutil.which("conda")

print("CONDA ENV NAME  {}".format(args.name[0]))
print("PYTHON VERSION  {}".format(args.python[0]))
print("CONDA FILE NAME {}".format(args.conda_file[0]))
print("CONDA path      {}".format(conda_path))

sp.call("{} env create -n {} -f {}".format(conda_path, args.name[0], tmp_file), shell=True)
os.unlink(tmp_file)


text:
/*
Package api provides koko's connector funcitionlity as API.
*/
package api

import (
	"fmt"
	"net"
	"os"
	"syscall"

	"github.com/containernetworking/plugins/pkg/ns"
	"github.com/vishvananda/netlink"

	"github.com/docker/docker/client"
	"golang.org/x/net/context"
)

// VEth is a structure to descrive veth interfaces.
type VEth struct {
	NsName   string      // What's the network namespace?
	LinkName string      // And what will we call the link.
	IPAddr   []net.IPNet // (optional) Slice of IPv4/v6 address.
	MirrorEgress string  // (optional) source interface for egress mirror
	MirrorIngress string // (optional) source interface for ingress mirror
}

// VxLan is a structure to descrive vxlan endpoint.
type VxLan struct {
	ParentIF string // parent interface name
	ID       int    // VxLan ID
	IPAddr   net.IP // VxLan destination address
}

// VLan is a structure to descrive vlan endpoint.
type VLan struct {
	ParentIF string // parent interface name
	ID       int    // VLan ID
}

// MacVLan is a structure to descrive vlan endpoint.
type MacVLan struct {
	ParentIF string			// parent interface name
	Mode	 netlink.MacvlanMode	// MacVlan mode
}

// MakeVethPair makes veth pair and returns its link.
func MakeVethPair(name, peer string, mtu int) (netlink.Link, error) {
	veth := &netlink.Veth{
		LinkAttrs: netlink.LinkAttrs{
			Name:  name,
			Flags: net.FlagUp,
			MTU:   mtu,
		},
		PeerName: peer,
	}

	if err := netlink.LinkAdd(veth); err != nil {
		return nil, err
	}
	return veth, nil
}

// GetVethPair takes two link names and create a veth pair and return
//both links.
func GetVethPair(name1 string, name2 string) (link1 netlink.Link,
	link2 netlink.Link, err error) {
	link1, err = MakeVethPair(name1, name2, 1500)
	if err != nil {
		switch {
		case os.IsExist(err):
			err = fmt.Errorf(
				"container veth name provided (%v) "+
					"already exists", name1)
			return
		default:
			err = fmt.Errorf("failed to make veth pair: %v", err)
			return
		}
	}

	if link2, err = netlink.LinkByName(name2); err != nil {
		err = fmt.Errorf("Failed to lookup %q: %v\n", name2, err)
	}

	return
}

// AddVxLanInterface creates VxLan interface by given vxlan object
func AddVxLanInterface(vxlan VxLan, devName string) (err error) {
	var parentIF netlink.Link

	if parentIF, err = netlink.LinkByName(vxlan.ParentIF); err != nil {
		return fmt.Errorf("Failed to get %s: %v", vxlan.ParentIF, err)
	}

	vxlanconf := netlink.Vxlan{
		LinkAttrs: netlink.LinkAttrs{
			Name:   devName,
			TxQLen: 1000,
		},
		VxlanId:      vxlan.ID,
		VtepDevIndex: parentIF.Attrs().Index,
		Group:        vxlan.IPAddr,
		Port:         4789,
		Learning:     true,
		L2miss:       true,
		L3miss:       true,
	}
	err = netlink.LinkAdd(&vxlanconf)

	if err != nil {
		return fmt.Errorf("Failed to add vxlan %s: %v", devName, err)
	}
	return nil
}

// AddVLanInterface creates VLan interface by given vlan object
func AddVLanInterface(vlan VLan, devName string) (err error) {
	var parentIF netlink.Link

	if parentIF, err = netlink.LinkByName(vlan.ParentIF); err != nil {
		return fmt.Errorf("Failed to get %s: %v", vlan.ParentIF, err)
	}

	vlanconf := netlink.Vlan{
		LinkAttrs: netlink.LinkAttrs{
			Name:   devName,
			ParentIndex: parentIF.Attrs().Index,
		},
		VlanId: vlan.ID,
	}

	if err = netlink.LinkAdd(&vlanconf); err != nil {
		return fmt.Errorf("Failed to add vlan %s: %v", devName, err)
	}
	return nil
}

// AddMacVLanInterface creates MacVLan interface by given macvlan object
func AddMacVLanInterface(macvlan MacVLan, devName string) (err error) {
	var parentIF netlink.Link

	if parentIF, err = netlink.LinkByName(macvlan.ParentIF); err != nil {
		return fmt.Errorf("Failed to get %s: %v", macvlan.ParentIF, err)
	}

	macvlanconf := netlink.Macvlan{
		LinkAttrs: netlink.LinkAttrs{
			Name:   devName,
			ParentIndex: parentIF.Attrs().Index,
		},
		Mode: macvlan.Mode,
	}

	if err = netlink.LinkAdd(&macvlanconf); err != nil {
		return fmt.Errorf("Failed to add vlan %s: %v", devName, err)
	}
	return nil
}

// GetDockerContainerNS retrieves container's network namespace from
// docker container id, given as containerID.
func GetDockerContainerNS(containerID string) (namespace string, err error) {
	ctx := context.Background()
	cli, err := client.NewEnvClient()
	if err != nil {
		panic(err)
	}

	cli.NegotiateAPIVersion(ctx)

	json, err := cli.ContainerInspect(ctx, containerID)
	if err != nil {
		err = fmt.Errorf("failed to get container info: %v", err)
		return
	}
	if json.NetworkSettings == nil {
		err = fmt.Errorf("failed to get container info: %v", err)
		return
	}
	namespace = fmt.Sprintf("/proc/%d/ns/net", json.State.Pid)
	return
}

// SetIngressMirror sets TC to mirror ingress from given port
// as MirrorIngress.
func (veth *VEth) SetIngressMirror() (err error) {
	var linkSrc, linkDest netlink.Link

	if linkSrc, err = netlink.LinkByName(veth.MirrorIngress); err != nil {
		return fmt.Errorf("failed to lookup %q in %q: %v",
			veth.MirrorIngress, veth.NsName, err)
	}

	if linkDest, err = netlink.LinkByName(veth.LinkName); err != nil {
		return fmt.Errorf("failed to lookup %q in %q: %v",
			veth.LinkName, veth.NsName, err)
	}

	// tc qdisc add dev $SRC_IFACE ingress
	qdisc := &netlink.Ingress{
		QdiscAttrs: netlink.QdiscAttrs{
			LinkIndex: linkSrc.Attrs().Index,
			Handle: netlink.MakeHandle(0xffff, 0),
			Parent: netlink.HANDLE_INGRESS,
		},
	}
	if err = netlink.QdiscAdd(qdisc); err != nil {
		if ! os.IsExist(err) {
			return err
		}
	}

	// tc filter add dev $SRC_IFACE parent fffff:
	// protocol all
	// u32 match u32 0 0
	// action mirred egress mirror dev $DST_IFACE
	filter := &netlink.U32 {
		FilterAttrs: netlink.FilterAttrs {
			LinkIndex: linkSrc.Attrs().Index,
			Parent: netlink.MakeHandle(0xffff, 0),
			Protocol: syscall.ETH_P_ALL,
		},
		Sel: &netlink.TcU32Sel{
			Keys: []netlink.TcU32Key {
				netlink.TcU32Key{
					Mask: 0x0,
					Val: 0,
				},
			},
			Flags: netlink.TC_U32_TERMINAL,
		},
		Actions: []netlink.Action{
			&netlink.MirredAction{
				ActionAttrs: netlink.ActionAttrs{
					Action: netlink.TC_ACT_PIPE,
				},
				MirredAction: netlink.TCA_EGRESS_MIRROR,
				Ifindex: linkDest.Attrs().Index,
			},
		},
	}

	if err = netlink.FilterAdd(filter); err != nil {
		return err
	}
	return nil
}

// SetEgressMirror sets TC to mirror egress from given port
// as MirrorEgress.
func (veth *VEth) SetEgressMirror() (err error) {
	var linkSrc, linkDest netlink.Link

	if linkSrc, err = netlink.LinkByName(veth.MirrorEgress); err != nil {
		return fmt.Errorf("failed to lookup %q in %q: %v",
			veth.MirrorEgress, veth.NsName, err)
	}

	if linkSrc.Attrs().TxQLen == 0 {
		return fmt.Errorf("veth qlen must be non zero!")
	}

	if linkDest, err = netlink.LinkByName(veth.LinkName); err != nil {
		return fmt.Errorf("failed to lookup %q in %q: %v",
			veth.LinkName, veth.NsName, err)
	}

	// tc qdisc add dev <SRC> handle 1: root prio
	qdisc := netlink.NewPrio(
		netlink.QdiscAttrs{
			LinkIndex: linkSrc.Attrs().Index,
			Handle: netlink.MakeHandle(1, 0),
			Parent: netlink.HANDLE_ROOT,
		})
	if err = netlink.QdiscAdd(qdisc); err != nil {
		if ! os.IsExist(err) {
			return err
		}
	}
	// tc filter add dev $SRC_IFACE parent 1:
	// protocol all
	// u32 match u32 0 0
	// action mirred egress mirror dev $DST_IFACE
	u32SelKeys := []netlink.TcU32Key {
		netlink.TcU32Key{
			Mask: 0x0,
			Val: 0,
		},
	}
	filter := &netlink.U32 {
		FilterAttrs: netlink.FilterAttrs {
			LinkIndex: linkSrc.Attrs().Index,
			Parent: netlink.MakeHandle(1, 0),
			Protocol: syscall.ETH_P_ALL,
		},
		Sel: &netlink.TcU32Sel{
			Keys: u32SelKeys,
			Flags: netlink.TC_U32_TERMINAL,
		},
		Actions: []netlink.Action{
			&netlink.MirredAction{
				ActionAttrs: netlink.ActionAttrs{
					Action: netlink.TC_ACT_PIPE,
				},
				MirredAction: netlink.TCA_EGRESS_MIRROR,
				Ifindex: linkDest.Attrs().Index,
			},
		},
	}

	if err = netlink.FilterAdd(filter); err != nil {
		return err
	}
	return nil
}

// UnsetIngressMirror sets TC to mirror ingress from given port
// as MirrorIngress.
func (veth *VEth) UnsetIngressMirror() (err error) {
	var linkSrc netlink.Link

	if linkSrc, err = netlink.LinkByName(veth.MirrorIngress); err != nil {
		return fmt.Errorf("failed to lookup %q in %q: %v",
			veth.MirrorIngress, veth.NsName, err)
	}

	// tc qdisc add dev $SRC_IFACE ingress
	qdisc := &netlink.Ingress{
		QdiscAttrs: netlink.QdiscAttrs{
			LinkIndex: linkSrc.Attrs().Index,
			Handle: netlink.MakeHandle(0xffff, 0),
			Parent: netlink.HANDLE_INGRESS,
		},
	}
	if err = netlink.QdiscDel(qdisc); err != nil {
		return err
	}

	return nil
}

// UnsetEgressMirror sets TC to mirror egress from given port
// as MirrorEgress.
func (veth *VEth) UnsetEgressMirror() (err error) {
	var linkSrc netlink.Link

	if linkSrc, err = netlink.LinkByName(veth.MirrorEgress); err != nil {
		return fmt.Errorf("failed to lookup %q in %q: %v",
			veth.MirrorEgress, veth.NsName, err)
	}

	// tc qdisc add dev <SRC> handle 1: root prio
	qdisc := netlink.NewPrio(
		netlink.QdiscAttrs{
			LinkIndex: linkSrc.Attrs().Index,
			Handle: netlink.MakeHandle(1, 0),
			Parent: netlink.HANDLE_ROOT,
		})
	if err = netlink.QdiscDel(qdisc); err != nil {
		return err
	}
	return nil
}

// SetVethLink is low-level handler to set IP address onveth links given
// a single VEth data object.
// ...primarily used privately by makeVeth().
func (veth *VEth) SetVethLink(link netlink.Link) (err error) {
	var vethNs ns.NetNS

	if veth.NsName == "" {
		if vethNs, err = ns.GetCurrentNS(); err != nil {
			return fmt.Errorf("%v", err)
		}
	} else {
		if vethNs, err = ns.GetNS(veth.NsName); err != nil {
			return fmt.Errorf("%v", err)
		}
	}

	defer vethNs.Close()
	if err = netlink.LinkSetNsFd(link, int(vethNs.Fd())); err != nil {
		return fmt.Errorf("%v", err)
	}

	err = vethNs.Do(func(_ ns.NetNS) error {
		link, err := netlink.LinkByName(veth.LinkName)
		if err != nil {
			return fmt.Errorf("failed to lookup %q in %q: %v",
				veth.LinkName, vethNs.Path(), err)
		}

		if err = netlink.LinkSetUp(link); err != nil {
			return fmt.Errorf("failed to set %q up: %v",
				veth.LinkName, err)
		}

		// Conditionally set the IP address.
		for i := 0; i < len(veth.IPAddr); i++ {
			addr := &netlink.Addr{IPNet: &veth.IPAddr[i], Label: ""}
			if err = netlink.AddrAdd(link, addr); err != nil {
				return fmt.Errorf(
					"failed to add IP addr %v to %q: %v",
					addr, veth.LinkName, err)
			}
		}

		if veth.MirrorIngress != "" {
			if err = veth.SetIngressMirror(); err != nil {
				netlink.LinkDel(link)
				return fmt.Errorf(
					"Failed to set tc ingress mirror :%v",
				err)
			}
		}
		if veth.MirrorEgress != "" {
			if err = veth.SetEgressMirror(); err != nil {
				netlink.LinkDel(link)
				return fmt.Errorf(
					"Failed to set tc egress mirror: %v", err)
			}
		}
		return nil
	})

	return err
}

// RemoveVethLink is low-level handler to get interface handle in
// container/netns namespace and remove it.
func (veth *VEth) RemoveVethLink() (err error) {
	var vethNs ns.NetNS
	var link netlink.Link

	if veth.NsName == "" {
		if vethNs, err = ns.GetCurrentNS(); err != nil {
			return fmt.Errorf("%v", err)
		}
	} else {
		if vethNs, err = ns.GetNS(veth.NsName); err != nil {
			return fmt.Errorf("%v", err)
		}
	}
	defer vethNs.Close()

	err = vethNs.Do(func(_ ns.NetNS) error {
		if veth.MirrorIngress != "" {
			if err = veth.UnsetIngressMirror(); err != nil {
				return fmt.Errorf(
					"Failed to unset tc ingress mirror :%v",
				err)
			}
		}
		if veth.MirrorEgress != "" {
			if err = veth.UnsetEgressMirror(); err != nil {
				return fmt.Errorf(
					"Failed to unset tc egress mirror: %v",
				err)
			}
		}

		if link, err = netlink.LinkByName(veth.LinkName); err != nil {
			return fmt.Errorf("failed to lookup %q in %q: %v",
				veth.LinkName, vethNs.Path(), err)
		}

		if err = netlink.LinkDel(link); err != nil {
			return fmt.Errorf("failed to remove link %q in %q: %v",
				veth.LinkName, vethNs.Path(), err)
		}
		return nil
	})

	return err
}

// MakeVeth is top-level handler to create veth links given two VEth data
// objects: veth1 and veth2.
func MakeVeth(veth1 VEth, veth2 VEth) (error) {
	link1, link2, err := GetVethPair(veth1.LinkName, veth2.LinkName)
	if err != nil {
		return err
	}

	if err:= veth1.SetVethLink(link1); err != nil {
		return err
	}
	if err:= veth2.SetVethLink(link2); err != nil {
		return err
	}
	return nil
}

// MakeVxLan makes vxlan interface and put it into container namespace
func MakeVxLan(veth1 VEth, vxlan VxLan) (err error) {
	var link netlink.Link

	if err = AddVxLanInterface(vxlan, veth1.LinkName); err != nil {
		return fmt.Errorf("vxlan add failed: %v", err)
	}

	if link, err = netlink.LinkByName(veth1.LinkName); err != nil {
		return fmt.Errorf("Cannot get %s: %v", veth1.LinkName, err)
	}

	if err = veth1.SetVethLink(link); err != nil {
		return fmt.Errorf("Cannot add IPaddr/netns failed: %v", err)
	}

	if veth1.MirrorIngress != "" {
		if err = veth1.SetIngressMirror(); err != nil {
			netlink.LinkDel(link)
			return fmt.Errorf(
				"Failed to set tc ingress mirror :%v",
				err)
		}
	}
	if veth1.MirrorEgress != "" {
		if err = veth1.SetEgressMirror(); err != nil {
			netlink.LinkDel(link)
			return fmt.Errorf(
				"Failed to set tc egress mirror: %v", err)
		}
	}
	return nil
}

// MakeVLan makes vlan interface
func MakeVLan(veth1 VEth, vlan VLan) (err error) {
	var link netlink.Link

	if err = AddVLanInterface(vlan, veth1.LinkName); err != nil {
		return fmt.Errorf("vlan add failed: %v", err)
	}

	if link, err = netlink.LinkByName(veth1.LinkName); err != nil {
		return fmt.Errorf("Cannot get %s: %v", veth1.LinkName, err)
	}
	if err = veth1.SetVethLink(link); err != nil {
		return fmt.Errorf("Cannot add IPaddr/netns failed: %v", err)
	}

	if veth1.MirrorIngress != "" {
		if err = veth1.SetIngressMirror(); err != nil {
			netlink.LinkDel(link)
			return fmt.Errorf(
				"Failed to set tc ingress mirror :%v",
				err)
		}
	}
	if veth1.MirrorEgress != "" {
		if err = veth1.SetEgressMirror(); err != nil {
			netlink.LinkDel(link)
			return fmt.Errorf(
				"Failed to set tc egress mirror: %v", err)
		}
	}
	return nil
}

// MakeMacVLan makes macvlan interface
func MakeMacVLan(veth1 VEth, macvlan MacVLan) (err error) {
	var link netlink.Link

	if err = AddMacVLanInterface(macvlan, veth1.LinkName); err != nil {
		return fmt.Errorf("macvlan add failed: %v", err)
	}

	if link, err = netlink.LinkByName(veth1.LinkName); err != nil {
		return fmt.Errorf("Cannot get %s: %v", veth1.LinkName, err)
	}

	if err = veth1.SetVethLink(link); err != nil {
		fmt.Errorf("Cannot add IPaddr/netns failed: %v", err)
	}
	if veth1.MirrorIngress != "" {
		if err = veth1.SetIngressMirror(); err != nil {
			netlink.LinkDel(link)
			return fmt.Errorf(
				"Failed to set tc ingress mirror :%v",
				err)
		}
	}
	if veth1.MirrorEgress != "" {
		if err = veth1.SetEgressMirror(); err != nil {
			netlink.LinkDel(link)
			return fmt.Errorf(
				"Failed to set tc egress mirror: %v", err)
		}
	}
	return err
}


text:
// File:  mainFrame.h
// Created:  5/31/2013
// Author:  K. Loux
// Description:  The main application window.
// History:

#ifndef _MAIN_FRAME_H_
#define _MAIN_FRAME_H_

// wxWidgets headers
#include <wx/wx.h>

// Local headers
#include "xmlConversionFactors.h"
#include "converter.h"

// wxWidgets forward declarations
class wxNotebook;
class wxNotebookEvent;

class MainFrame : public wxFrame
{
public:
	MainFrame();
	~MainFrame() = default;

private:
	void CreateControls();
	void SetProperties();

	void EnforcePageConfiguration(const bool& saveConfig = true);
	void AddNotebookPage(const XMLConversionFactors::FactorGroup& group);

	wxNotebook *notebook;
	wxTextCtrl *input;
	wxTextCtrl *output;
	wxStaticText *inUnits;
	wxStaticText *outUnits;

	wxListBox *GetInputUnitsBox() const;
	wxListBox *GetOutputUnitsBox() const;
	wxWindow *GetControlOnActiveTab(int id) const;

	enum ControlID
	{
		idInput = wxID_HIGHEST + 1,
		idOutput,
		idOptions,
		idClipboard,
		idSwap
	};

	void OnTextChangeEvent(wxCommandEvent& event);
	void OnSelectionChangeEvent(wxCommandEvent& event);
	void OnTabChangeEvent(wxNotebookEvent& event);
	void OnOptionsButton(wxCommandEvent& event);
	void OnClipboardButton(wxCommandEvent& event);
	void OnSwapButton(wxCommandEvent& event);
	void OnClose(wxCloseEvent& event);
	void OnSize(wxSizeEvent& event);

	void UpdateConversion();

	XMLConversionFactors xml;
	Converter converter;

	const wxString configFileName;
	void LoadConfiguration();
	void SaveConfiguration();

	DECLARE_EVENT_TABLE();
};

#endif// _MAIN_FRAME_H_


text:
<component name="libraryTable">
  <library name="support-annotations-21.0.2">
    <CLASSES>
      <root url="jar://C:/Program Files (x86)/Android/sdk/extras/android/m2repository/com/android/support/support-annotations/21.0.2/support-annotations-21.0.2.jar!/" />
    </CLASSES>
    <JAVADOC />
    <SOURCES>
      <root url="jar://C:/Program Files (x86)/Android/sdk/extras/android/m2repository/com/android/support/support-annotations/21.0.2/support-annotations-21.0.2-sources.jar!/" />
    </SOURCES>
  </library>
</component>


text:
import test from 'ava';
import { PipelineAggregationBase } from '../../src/aggregations/pipeline-aggregations';
import {
    validatedCorrectly,
    nameTypeExpectStrategy,
    makeSetsOptionMacro
} from '../_macros';

const getInstance = bucketsPath =>
    new PipelineAggregationBase('my_agg', 'my_type', '', bucketsPath);

const setsOption = makeSetsOptionMacro(
    getInstance,
    nameTypeExpectStrategy('my_agg', 'my_type')
);

test(validatedCorrectly, getInstance, 'gapPolicy', ['skip', 'insert_zeros']);
test(setsOption, 'bucketsPath', { param: 'my_buckets_path' });
test(setsOption, 'gapPolicy', { param: 'insert_zeros' });
test(setsOption, 'format', { param: 'my_format' });

test('constructor sets buckets_path', t => {
    const value = getInstance('my_buckets_path').toJSON();
    const expected = {
        my_agg: {
            my_type: {
                buckets_path: 'my_buckets_path'
            }
        }
    };
    t.deepEqual(value, expected);
});


text:
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
-- =============================================
-- Author:		richa
-- Create date: 2013-03-06
-- Description:	Get the current version of the entity data, key fields and cached associations.
-- (Can return key fields for multiple storage accounts if the same version exists
-- on multiple accounts).
-- =============================================
USE IndexDatastore;
IF OBJECT_ID('dbo.GetEntityIndexEntry') IS NULL
	EXEC('CREATE PROCEDURE dbo.GetEntityIndexEntry AS BEGIN SET NOCOUNT ON; END')
GO

ALTER PROCEDURE dbo.GetEntityIndexEntry
	@ExternalEntityId UNIQUEIDENTIFIER
AS
BEGIN
	SET NOCOUNT ON;

	-- The purpose of the transaction in this case is to guard consistency
	-- between the version in EntityId table and Associations table
	SET TRANSACTION ISOLATION LEVEL REPEATABLE READ
	BEGIN TRANSACTION EntityCurrentVersion

    -- Get indexed properties
	SELECT
		xId AS 'ExternalEntityId',
		StorageType AS 'StorageType',
		Version AS 'Version',
		CreateDate AS 'CreateDate',
		LastModifiedDate AS 'LastModifiedDate',
		HomeStorageAccountName AS 'HomeStorageAccountName',
		LastModifiedUser AS 'LastModifiedUser',
		SchemaVersion AS 'SchemaVersion',
		ExternalName AS 'ExternalName',
		EntityCategory AS 'EntityCategory',
		ExternalType AS 'ExternalType',
		Active AS 'Active'
	FROM dbo.EntityId WHERE xId = @ExternalEntityId

	-- Gets current version key fields (null for version)
	EXEC dbo.GetEntityKeyFieldsForVersion @ExternalEntityId, NULL;

	-- Get associations
	EXEC dbo.GetAssociationsCurrent @ExternalEntityId;

	COMMIT TRANSACTION EntityCurrentVersion

	-- Return data sets for the key fields and the associations
	RETURN;
END
GO