text:
package org.hibernate.validator.test.util;

import java.io.InputStream;
import java.lang.annotation.Annotation;
import java.util.ArrayList;
import java.util.Iterator;
import java.util.List;
import java.util.Locale;
import java.util.Set;
import javax.validation.Configuration;
import javax.validation.ConstraintViolation;
import javax.validation.Path;
import javax.validation.Validation;
import javax.validation.Validator;
import javax.validation.metadata.PropertyDescriptor;
import javax.validation.spi.ValidationProvider;

import org.slf4j.Logger;

import org.hibernate.validator.HibernateValidator;
import org.hibernate.validator.HibernateValidatorConfiguration;
import org.hibernate.validator.engine.PathImpl;
import org.hibernate.validator.util.LoggerFactory;

import static org.testng.Assert.assertEquals;
import static org.testng.Assert.assertTrue;
import static org.testng.FileAssert.fail;

/**
 * Tests for the ReflectionHelper.
 *
 * @author Hardy Ferentschik
 */
public class TestUtil {
	private static final Logger log = LoggerFactory.make();

	private static Validator hibernateValidator;

	private TestUtil() {
	}

	public static Validator getValidator() {
		if ( hibernateValidator == null ) {
			Configuration configuration = getConfiguration( Locale.ENGLISH );
			configuration.traversableResolver( new DummyTraversableResolver() );
			hibernateValidator = configuration.buildValidatorFactory().getValidator();
		}
		return hibernateValidator;
	}

	public static Configuration<HibernateValidatorConfiguration> getConfiguration() {
		return getConfiguration( HibernateValidator.class, Locale.ENGLISH );
	}

	public static Configuration<HibernateValidatorConfiguration> getConfiguration(Locale locale) {
		return getConfiguration( HibernateValidator.class, locale );
	}

	public static <T extends Configuration<T>, U extends ValidationProvider<T>> T getConfiguration(Class type) {
		return getConfiguration( type, Locale.ENGLISH );
	}

	public static <T extends Configuration<T>, U extends ValidationProvider<T>> T getConfiguration(Class type, Locale locale) {
		Locale.setDefault( locale );
		return Validation.byProvider( type ).configure();
	}

	/**
	 * @param path The path to the xml file which should server as validation.xml for the returned
	 * Validator.
	 *
	 * @return A Validator instance which respects the configuration specified in the file with the path
	 *         path.
	 */
	public static Validator getValidatorWithCustomConfiguration(String path) {
		Thread.currentThread().setContextClassLoader( new CustomValidationXmlClassLoader( path ) );
		return getConfiguration().buildValidatorFactory().getValidator();
	}

	public static PropertyDescriptor getPropertyDescriptor(Class<?> clazz, String property) {
		Validator validator = getValidator();
		return validator.getConstraintsForClass( clazz ).getConstraintsForProperty( property );
	}

	public static <T> void assertCorrectConstraintViolationMessages(Set<ConstraintViolation<T>> violations, String... messages) {
		List<String> actualMessages = new ArrayList<String>();
		for ( ConstraintViolation<?> violation : violations ) {
			actualMessages.add( violation.getMessage() );
		}

		assertEquals( actualMessages.size(), messages.length, "Wrong number of error messages" );

		for ( String expectedMessage : messages ) {
			assertTrue(
					actualMessages.contains( expectedMessage ),
					"The message '" + expectedMessage + "' should have been in the list of actual messages: " + actualMessages
			);
			actualMessages.remove( expectedMessage );
		}
		assertTrue(
				actualMessages.isEmpty(), "Actual messages contained more messages as specified expected messages"
		);
	}

	public static <T> void assertCorrectConstraintTypes(Set<ConstraintViolation<T>> violations, Class<?>... expectedConstraintTypes) {
		List<String> actualConstraintTypes = new ArrayList<String>();
		for ( ConstraintViolation<?> violation : violations ) {
			actualConstraintTypes.add(
					( ( Annotation ) violation.getConstraintDescriptor().getAnnotation() ).annotationType().getName()
			);
		}

		assertEquals(
				expectedConstraintTypes.length, actualConstraintTypes.size(), "Wrong number of constraint types."
		);

		for ( Class<?> expectedConstraintType : expectedConstraintTypes ) {
			assertTrue(
					actualConstraintTypes.contains( expectedConstraintType.getName() ),
					"The constraint type " + expectedConstraintType.getName() + " should have been violated."
			);
		}
	}

	public static <T> void assertCorrectPropertyPaths(Set<ConstraintViolation<T>> violations, String... propertyPaths) {
		List<Path> propertyPathsOfViolations = new ArrayList<Path>();
		for ( ConstraintViolation<?> violation : violations ) {
			propertyPathsOfViolations.add( violation.getPropertyPath() );
		}

		for ( String propertyPath : propertyPaths ) {
			Path expectedPath = PathImpl.createPathFromString( propertyPath );
			boolean containsPath = false;
			for ( Path actualPath : propertyPathsOfViolations ) {
				if ( assertEqualPaths( expectedPath, actualPath ) ) {
					containsPath = true;
					break;
				}
			}
			if ( !containsPath ) {
				fail( expectedPath + " is not in the list of path instances contained in the actual constraint violations: " + propertyPathsOfViolations );
			}
		}
	}

	public static void assertConstraintViolation(ConstraintViolation violation, String errorMessage, Class rootBean, Object invalidValue, String propertyPath) {
		assertEquals(
				violation.getPropertyPath(),
				PathImpl.createPathFromString( propertyPath ),
				"Wrong propertyPath"
		);
		assertConstraintViolation( violation, errorMessage, rootBean, invalidValue );
	}

	public static void assertConstraintViolation(ConstraintViolation violation, String errorMessage, Class rootBean, Object invalidValue) {
		assertEquals(
				violation.getInvalidValue(),
				invalidValue,
				"Wrong invalid value"
		);
		assertConstraintViolation( violation, errorMessage, rootBean );
	}

	public static void assertConstraintViolation(ConstraintViolation violation, String errorMessage, Class rootBean) {
		assertEquals(
				violation.getRootBean().getClass(),
				rootBean,
				"Wrong root bean type"
		);
		assertConstraintViolation( violation, errorMessage );
	}

	public static void assertConstraintViolation(ConstraintViolation violation, String message) {
		assertEquals( violation.getMessage(), message, "Wrong message" );
	}

	public static void assertNumberOfViolations(Set violations, int expectedViolations) {
		assertEquals( violations.size(), expectedViolations, "Wrong number of constraint violations" );
	}

	public static boolean assertEqualPaths(Path p1, Path p2) {
		Iterator<Path.Node> p1Iterator = p1.iterator();
		Iterator<Path.Node> p2Iterator = p2.iterator();
		while ( p1Iterator.hasNext() ) {
			Path.Node p1Node = p1Iterator.next();
			if ( !p2Iterator.hasNext() ) {
				return false;
			}
			Path.Node p2Node = p2Iterator.next();

			// do the comparison on the node values
			if ( p2Node.getName() == null ) {
				if ( p1Node.getName() != null ) {
					return false;
				}
			}
			else if ( !p2Node.getName().equals( p1Node.getName() ) ) {
				return false;
			}

			if ( p2Node.isInIterable() != p1Node.isInIterable() ) {
				return false;
			}

			if ( p2Node.getIndex() == null ) {
				if ( p1Node.getIndex() != null ) {
					return false;
				}
			}
			else if ( !p2Node.getIndex().equals( p1Node.getIndex() ) ) {
				return false;
			}

			if ( p2Node.getKey() == null ) {
				if ( p1Node.getKey() != null ) {
					return false;
				}
			}
			else if ( !p2Node.getKey().equals( p1Node.getKey() ) ) {
				return false;
			}
		}

		return !p2Iterator.hasNext();
	}

	private static class CustomValidationXmlClassLoader extends ClassLoader {
		private final String customValidationXmlPath;

		CustomValidationXmlClassLoader(String pathToCustomValidationXml) {
			super( CustomValidationXmlClassLoader.class.getClassLoader() );
			customValidationXmlPath = pathToCustomValidationXml;
		}

		public InputStream getResourceAsStream(String path) {
			String finalPath = path;
			if ( "META-INF/validation.xml".equals( path ) ) {
				log.info( "Using {} as validation.xml", customValidationXmlPath );
				finalPath = customValidationXmlPath;
			}
			return super.getResourceAsStream( finalPath );
		}
	}
}


text:
'use strict';

/**
 * @ngdoc function
 * @name clientApp.controller:MainCtrl
 * @description
 * # MainCtrl
 * Controller of the clientApp
 */
angular.module('clientApp')
  .controller('MainCtrl', function ($scope,$routeParams) {
    $scope.active_users=[];
    $scope.crashed_instances =[];
    $scope.live_feed = [];
    $scope.selectedTool = $routeParams.toolname;

    $scope.default_user = {session_id:-1};
    $scope.selected_user = $scope.default_user;
    $scope.showActiveToolName = function(){
      alert($scope.selectedTool);
    }
    $scope.IsSelected=function(active_user){
      return $scope.selected_user==active_user;
    }
    $scope.clicked_active_user= function(active_user){
      if(active_user==$scope.selected_user)
          $scope.selected_user =$scope.default_user;
      else
          $scope.selected_user=active_user;
      console.log("--------------------" + $scope.selected_user.session_id);
    };
    $scope.IsSelectedTool = function( ) {
      return function( item ) {
        if($scope.selectedTool=="all")
          return true;
        return item.tool ==$scope.selectedTool;
      };
    };

    $scope.IsSelectedSession = function( ) {
      return function( item ) {
        return item.session_id ==  $scope.selected_user.session_id||
        $scope.selected_user.session_id==-1;
      };
    };

    $scope.GetSelectedSession = function(){
       if($scope.selected_user.session_id==-1){
         return "All sessions";
       }
       return  $scope.selected_user.session_id;
    }

    $scope.getActiveInstance = function(){
      var active_instances=0;
      if($scope.selectedTool=="all")
        return  $scope.active_users.length;
      for(var index = 0 ;index<$scope.active_users.length;index++){
          if($scope.active_users[index].tool == $scope.selectedTool)
            active_instances++;
      }
      return active_instances;
    }

    $scope.getCrashedInstance = function(){
      var count=0;
      if($scope.selectedTool=="all")
        return  $scope.crashed_instances.length;
      for(var index = 0 ;index<$scope.crashed_instances.length;index++){
          if($scope.crashed_instances[index].tool == $scope.selectedTool)
            count++;
      }
      return count;
    }
    $scope.submitCommand =function(_command,_session_id){
      if(_command){
        var data = {
          command     : _command,
          session_id  : _session_id
        }
        socket.emit('command',data);
      }
    }

    var set_active_user = function(activeuserlist){
        $scope.active_instances = activeuserlist.length;
        $scope.active_users=activeuserlist;
    }
    var add_log = function(log_data){
      var is_error= log_data.msg.match(/error/i);
      var image_name = "3.png";
      if(is_error)
          image_name ="1.png";

      var feed ={ image_path  : "images/"+image_name,
                  timestamp   : moment().format('h:mm:ss:a'),
                  msg         : log_data.msg,
                  username    : log_data.username,
                  session_id  : log_data.session_id};
      $scope.live_feed.push(feed);
    }

     socket.on('list_active_users',function(activeuserlist){
       // $scope.$apply more details @
       //http://jimhoskins.com/2012/12/17/angularjs-and-apply.html
        setTimeout(
          $scope.$apply(function(){
            set_active_user(activeuserlist)
          }),0);
    });

    socket.on('crashed', function(data){
        setTimeout(
          $scope.$apply(function(){
            $scope.crashed_instances = data;
          })
        ,0)
    });

    socket.on('log', function(log_data){
      setTimeout(
        $scope.$apply(function(){
          add_log(log_data)})
          ,0);
    });
  });

redpajama_set_name: RedPajamaGithub


text:
<!DOCTYPE html>

		<meta charset="utf-8">
		<meta http-equiv="X-UA-Compatible" content="IE=edge">
		<title>Exploration Header - Slider Revolution</title>
		<meta name="description" content="Slider Revolution Example" />
		<meta name="keywords" content="fullscreen image, grid layout, flexbox grid, transition" />
		<meta name="author" content="ThemePunch" />
		<meta name="viewport" content="width=device-width, initial-scale=1">

		<link href="http://fonts.googleapis.com/css?family=Roboto%3A700%2C500%2C900%2C400" rel="stylesheet" property="stylesheet" type="text/css" media="all" />

		<link rel="stylesheet" type="text/css" href="../../revolution/fonts/pe-icon-7-stroke/css/pe-icon-7-stroke.css">
		<link rel="stylesheet" type="text/css" href="../../revolution/fonts/font-awesome/css/font-awesome.css">

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

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

			<link href="http://fonts.googleapis.com/css?family=Roboto%3A700%2C300" rel="stylesheet" property="stylesheet" type="text/css" media="all" />
			<link rel="stylesheet" type="text/css" href="../../assets/css/noneed.css">

				Online Documentation

	<li data-index="rs-3204" data-transition="slideoververtical" data-slotamount="default" data-hideafterloop="0" data-hideslideonmobile="off"  data-easein="default" data-easeout="default" data-masterspeed="default"  data-thumb="../../assets/images/news1-1-100x50.jpg"  data-rotate="0"  data-fstransition="fade" data-fsmasterspeed="2000" data-fsslotamount="7" data-saveperformance="off"  data-title="DISCOVERY OF NATURAL WONDERS" data-param1="What our team has found in the wild" data-param2="" data-param3="" data-param4="" data-param5="" data-param6="" data-param7="" data-param8="" data-param9="" data-param10="" data-description="">

		<div class="tp-caption  "
			 id="slide-3204-layer-1"
			 data-x="['left','left','left','left']" data-hoffset="['94','114','76','26']"
			 data-y="['top','top','top','top']" data-voffset="['213','193','95','85']"
						data-fontsize="['60','45','35','25']"
			data-lineheight="['60','45','35','30']"
			data-width="['600','560','340','260']"
			data-height="none"
			data-whitespace="normal"

			data-type="text"
			data-basealign="slide"
			data-responsive_offset="off"
			data-responsive="off"
			data-frames='[{"from":"y:50px;opacity:0;","speed":1500,"to":"o:1;","delay":500,"ease":"Power4.easeOut"},{"delay":"wait","speed":300,"to":"opacity:0;","ease":"nothing"}]'
			data-textAlign="['left','left','left','left']"
			data-paddingtop="[0,0,0,0]"
			data-paddingright="[0,0,0,0]"
			data-paddingbottom="[0,0,0,0]"
			data-paddingleft="[0,0,0,0]"

			style="z-index: 5; min-width: 600px; max-width: 600px; white-space: normal; font-size: 60px; line-height: 60px; font-weight: 700; color: rgba(255, 255, 255, 1.00);font-family:Roboto;border-width:0px;">DISCOVERY OF NATURAL WONDERS

		<div class="tp-caption tp-shape tp-shapewrapper "
			 id="slide-3204-layer-2"
			 data-x="['left','left','left','left']" data-hoffset="['50','70','50','0']"
			 data-y="['top','top','top','top']" data-voffset="['220','200','100','90']"
						data-width="8"
			data-height="['104','77','59','48']"
			data-whitespace="normal"

			data-type="shape"
			data-basealign="slide"
			data-responsive_offset="off"
			data-responsive="off"
			data-frames='[{"from":"sY:0;","speed":1500,"to":"o:1;","delay":500,"ease":"Power4.easeOut"},{"delay":"wait","speed":300,"to":"opacity:0;","ease":"nothing"}]'
			data-textAlign="['left','left','left','left']"
			data-paddingtop="[0,0,0,0]"
			data-paddingright="[0,0,0,0]"
			data-paddingbottom="[0,0,0,0]"
			data-paddingleft="[0,0,0,0]"

			style="z-index: 6;background-color:rgba(255, 204, 0, 1.00);border-color:rgba(0, 0, 0, 0);border-width:0px;">

		<div class="tp-caption  "
			 id="slide-3204-layer-3"
			 data-x="['left','left','left','left']" data-hoffset="['98','118','76','26']"
			 data-y="['top','top','top','top']" data-voffset="['358','302','184','163']"
						data-width="['600','560','340','260']"
			data-height="none"
			data-whitespace="normal"

			data-type="text"
			data-basealign="slide"
			data-responsive_offset="off"
			data-responsive="off"
			data-frames='[{"from":"y:50px;opacity:0;","speed":1500,"to":"o:1;","delay":650,"ease":"Power4.easeOut"},{"delay":"wait","speed":300,"to":"opacity:0;","ease":"nothing"}]'
			data-textAlign="['left','left','left','left']"
			data-paddingtop="[0,0,0,0]"
			data-paddingright="[0,0,0,0]"
			data-paddingbottom="[0,0,0,0]"
			data-paddingleft="[0,0,0,0]"

			style="z-index: 7; min-width: 600px; max-width: 600px; white-space: normal; font-size: 17px; line-height: 22px; font-weight: 500; color: rgba(255, 255, 255, 0.85);font-family:Roboto;border-width:0px;letter-spacing:2px;">GETTING BACK INTO THE GREAT OUTDOORS FOR ADVENTURE AND MYSTERY.

		<div class="tp-caption rev-btn "
			 id="slide-3204-layer-4"
			 data-x="['left','left','left','left']" data-hoffset="['50','70','50','26']"
			 data-y="['top','top','top','top']" data-voffset="['465','401','285','276']"
						data-fontweight="['900','700','700','700']"
			data-width="none"
			data-height="none"
			data-whitespace="nowrap"

			data-type="button"
			data-basealign="slide"
			data-responsive_offset="off"
			data-responsive="off"
			data-frames='[{"from":"y:50px;opacity:0;","speed":1500,"to":"o:1;","delay":800,"ease":"Power4.easeOut"},{"delay":"wait","speed":300,"to":"opacity:0;","ease":"nothing"},{"frame":"hover","speed":"0","ease":"Power1.easeInOut","to":"o:1;rX:0;rY:0;rZ:0;z:0;","style":"c:rgba(0, 0, 0, 1.00);bg:rgba(255, 204, 0, 1.00);bw:2px 2px 2px 2px;"}]'
			data-textAlign="['left','left','left','left']"
			data-paddingtop="[0,0,0,0]"
			data-paddingright="[45,45,45,45]"
			data-paddingbottom="[0,0,0,0]"
			data-paddingleft="[45,45,45,45]"

			style="z-index: 8; white-space: nowrap; font-size: 15px; line-height: 50px; font-weight: 900; color: rgba(255, 204, 0, 1.00);font-family:Roboto;background-color:rgba(0, 0, 0, 0);border-color:rgba(255, 204, 0, 1.00);border-style:solid;border-width:2px;outline:none;box-shadow:none;box-sizing:border-box;-moz-box-sizing:border-box;-webkit-box-sizing:border-box;letter-spacing:3px;cursor:pointer;">READ ARTICLE

	<li data-index="rs-3205" data-transition="slideoververtical" data-slotamount="default" data-hideafterloop="0" data-hideslideonmobile="off"  data-easein="default" data-easeout="default" data-masterspeed="default"  data-thumb="../../assets/images/news2-1-100x50.jpg"  data-rotate="0"  data-saveperformance="off"  data-title="TRADITIONAL PEOPLE OF INDIA" data-param1="We spend a year in India for you" data-param2="" data-param3="" data-param4="" data-param5="" data-param6="" data-param7="" data-param8="" data-param9="" data-param10="" data-description="">

		<div class="tp-caption  "
			 id="slide-3205-layer-1"
			 data-x="['left','left','left','left']" data-hoffset="['94','84','76','26']"
			 data-y="['top','top','top','top']" data-voffset="['213','193','95','85']"
						data-fontsize="['60','45','35','25']"
			data-lineheight="['60','45','35','30']"
			data-width="['600','560','340','260']"
			data-height="none"
			data-whitespace="normal"

			data-type="text"
			data-basealign="slide"
			data-responsive_offset="off"
			data-responsive="off"
			data-frames='[{"from":"y:50px;opacity:0;","speed":1500,"to":"o:1;","delay":500,"ease":"Power4.easeOut"},{"delay":"wait","speed":300,"to":"opacity:0;","ease":"nothing"}]'
			data-textAlign="['left','left','left','left']"
			data-paddingtop="[0,0,0,0]"
			data-paddingright="[0,0,0,0]"
			data-paddingbottom="[0,0,0,0]"
			data-paddingleft="[0,0,0,0]"

			style="z-index: 9; min-width: 600px; max-width: 600px; white-space: normal; font-size: 60px; line-height: 60px; font-weight: 700; color: rgba(255, 255, 255, 1.00);font-family:Roboto;border-width:0px;">TRADITIONAL PEOPLE OF INDIA

		<div class="tp-caption tp-shape tp-shapewrapper "
			 id="slide-3205-layer-2"
			 data-x="['left','left','left','left']" data-hoffset="['50','40','50','0']"
			 data-y="['top','top','top','top']" data-voffset="['220','200','100','90']"
						data-width="8"
			data-height="['104','77','59','48']"
			data-whitespace="normal"

			data-type="shape"
			data-basealign="slide"
			data-responsive_offset="off"
			data-responsive="off"
			data-frames='[{"from":"sY:0;","speed":1500,"to":"o:1;","delay":500,"ease":"Power4.easeOut"},{"delay":"wait","speed":300,"to":"opacity:0;","ease":"nothing"}]'
			data-textAlign="['left','left','left','left']"
			data-paddingtop="[0,0,0,0]"
			data-paddingright="[0,0,0,0]"
			data-paddingbottom="[0,0,0,0]"
			data-paddingleft="[0,0,0,0]"

			style="z-index: 10;background-color:rgba(255, 204, 0, 1.00);border-color:rgba(0, 0, 0, 0);border-width:0px;">

		<div class="tp-caption  "
			 id="slide-3205-layer-3"
			 data-x="['left','left','left','left']" data-hoffset="['98','88','76','26']"
			 data-y="['top','top','top','top']" data-voffset="['358','302','184','163']"
						data-width="['600','560','340','260']"
			data-height="none"
			data-whitespace="normal"

			data-type="text"
			data-basealign="slide"
			data-responsive_offset="off"
			data-responsive="off"
			data-frames='[{"from":"y:50px;opacity:0;","speed":1500,"to":"o:1;","delay":650,"ease":"Power4.easeOut"},{"delay":"wait","speed":300,"to":"opacity:0;","ease":"nothing"}]'
			data-textAlign="['left','left','left','left']"
			data-paddingtop="[0,0,0,0]"
			data-paddingright="[0,0,0,0]"
			data-paddingbottom="[0,0,0,0]"
			data-paddingleft="[0,0,0,0]"

			style="z-index: 11; min-width: 600px; max-width: 600px; white-space: normal; font-size: 17px; line-height: 22px; font-weight: 500; color: rgba(255, 255, 255, 0.85);font-family:Roboto;border-width:0px;letter-spacing:2px;">WHO WE MET AND WHAT WE HAVE SEEN DURING OUR YEAR INDIA.

		<div class="tp-caption rev-btn "
			 id="slide-3205-layer-4"
			 data-x="['left','left','left','left']" data-hoffset="['50','40','50','26']"
			 data-y="['top','top','top','top']" data-voffset="['465','411','285','254']"
						data-fontweight="['900','700','700','700']"
			data-width="none"
			data-height="none"
			data-whitespace="nowrap"

			data-type="button"
			data-basealign="slide"
			data-responsive_offset="off"
			data-responsive="off"
			data-frames='[{"from":"y:50px;opacity:0;","speed":1500,"to":"o:1;","delay":800,"ease":"Power4.easeOut"},{"delay":"wait","speed":300,"to":"opacity:0;","ease":"nothing"},{"frame":"hover","speed":"0","ease":"Power1.easeInOut","to":"o:1;rX:0;rY:0;rZ:0;z:0;","style":"c:rgba(0, 0, 0, 1.00);bg:rgba(255, 204, 0, 1.00);bw:2px 2px 2px 2px;"}]'
			data-textAlign="['left','left','left','left']"
			data-paddingtop="[0,0,0,0]"
			data-paddingright="[45,45,45,45]"
			data-paddingbottom="[0,0,0,0]"
			data-paddingleft="[45,45,45,45]"

			style="z-index: 12; white-space: nowrap; font-size: 15px; line-height: 50px; font-weight: 900; color: rgba(255, 204, 0, 1.00);font-family:Roboto;background-color:rgba(0, 0, 0, 0);border-color:rgba(255, 204, 0, 1.00);border-style:solid;border-width:2px;outline:none;box-shadow:none;box-sizing:border-box;-moz-box-sizing:border-box;-webkit-box-sizing:border-box;letter-spacing:3px;cursor:pointer;">READ ARTICLE

	<li data-index="rs-3206" data-transition="slideoververtical" data-slotamount="default" data-hideafterloop="0" data-hideslideonmobile="off"  data-easein="default" data-easeout="default" data-masterspeed="default"  data-thumb="../../assets/images/news3-2-100x50.jpg"  data-rotate="0"  data-saveperformance="off"  data-title="OUR ARCTIC CIRCLE EXPEDITION" data-param1="Read all the details about it here" data-param2="" data-param3="" data-param4="" data-param5="" data-param6="" data-param7="" data-param8="" data-param9="" data-param10="" data-description="">

		<div class="tp-caption tp-shape tp-shapewrapper "
			 id="slide-3206-layer-5"
			 data-x="['left','left','left','left']" data-hoffset="['0','0','0','0']"
			 data-y="['top','top','top','top']" data-voffset="['0','0','0','0']"
						data-width="['750','680','440','300']"
			data-height="full"
			data-whitespace="normal"
			data-visibility="['on','on','on','off']"

			data-type="shape"
			data-basealign="slide"
			data-responsive_offset="off"
			data-responsive="off"
			data-frames='[{"from":"x:left;","speed":500,"to":"o:1;","delay":0,"ease":"Power4.easeOut"},{"delay":"wait","speed":500,"to":"x:left;","ease":"Power4.easeOut"}]'
			data-textAlign="['left','left','left','left']"
			data-paddingtop="[0,0,0,0]"
			data-paddingright="[0,0,0,0]"
			data-paddingbottom="[0,0,0,0]"
			data-paddingleft="[0,0,0,0]"

			style="z-index: 13;background-color:rgba(33, 42, 64, 1.00);border-color:rgba(0, 0, 0, 0.50);border-width:0px;">

		<div class="tp-caption  "
			 id="slide-3206-layer-1"
			 data-x="['left','left','left','left']" data-hoffset="['94','84','76','26']"
			 data-y="['top','top','top','top']" data-voffset="['213','193','95','85']"
						data-fontsize="['60','45','35','25']"
			data-lineheight="['60','45','35','30']"
			data-width="['600','560','340','260']"
			data-height="none"
			data-whitespace="normal"

			data-type="text"
			data-basealign="slide"
			data-responsive_offset="off"
			data-responsive="off"
			data-frames='[{"from":"y:50px;opacity:0;","speed":1500,"to":"o:1;","delay":500,"ease":"Power4.easeOut"},{"delay":"wait","speed":300,"to":"opacity:0;","ease":"nothing"}]'
			data-textAlign="['left','left','left','left']"
			data-paddingtop="[0,0,0,0]"
			data-paddingright="[0,0,0,0]"
			data-paddingbottom="[0,0,0,0]"
			data-paddingleft="[0,0,0,0]"

			style="z-index: 14; min-width: 600px; max-width: 600px; white-space: normal; font-size: 60px; line-height: 60px; font-weight: 700; color: rgba(255, 255, 255, 1.00);font-family:Roboto;border-width:0px;">OUR ARCTIC CIRCLE EXPEDITION

		<div class="tp-caption tp-shape tp-shapewrapper "
			 id="slide-3206-layer-2"
			 data-x="['left','left','left','left']" data-hoffset="['50','40','50','0']"
			 data-y="['top','top','top','top']" data-voffset="['220','200','100','90']"
						data-width="8"
			data-height="['104','77','59','48']"
			data-whitespace="normal"

			data-type="shape"
			data-basealign="slide"
			data-responsive_offset="off"
			data-responsive="off"
			data-frames='[{"from":"sY:0;","speed":1500,"to":"o:1;","delay":500,"ease":"Power4.easeOut"},{"delay":"wait","speed":300,"to":"opacity:0;","ease":"nothing"}]'
			data-textAlign="['left','left','left','left']"
			data-paddingtop="[0,0,0,0]"
			data-paddingright="[0,0,0,0]"
			data-paddingbottom="[0,0,0,0]"
			data-paddingleft="[0,0,0,0]"

			style="z-index: 15;background-color:rgba(255, 204, 0, 1.00);border-color:rgba(0, 0, 0, 0);border-width:0px;">

		<div class="tp-caption  "
			 id="slide-3206-layer-3"
			 data-x="['left','left','left','left']" data-hoffset="['98','88','76','26']"
			 data-y="['top','top','top','top']" data-voffset="['358','302','184','163']"
						data-width="['600','560','340','260']"
			data-height="none"
			data-whitespace="normal"

			data-type="text"
			data-basealign="slide"
			data-responsive_offset="off"
			data-responsive="off"
			data-frames='[{"from":"y:50px;opacity:0;","speed":1500,"to":"o:1;","delay":650,"ease":"Power4.easeOut"},{"delay":"wait","speed":300,"to":"opacity:0;","ease":"nothing"}]'
			data-textAlign="['left','left','left','left']"
			data-paddingtop="[0,0,0,0]"
			data-paddingright="[0,0,0,0]"
			data-paddingbottom="[0,0,0,0]"
			data-paddingleft="[0,0,0,0]"

			style="z-index: 16; min-width: 600px; max-width: 600px; white-space: normal; font-size: 17px; line-height: 22px; font-weight: 500; color: rgba(255, 255, 255, 0.85);font-family:Roboto;border-width:0px;letter-spacing:2px;">WHAT WE EXPERIENCED IN THE SNOW AND 50° BELOW ZERO.

		<div class="tp-caption rev-btn "
			 id="slide-3206-layer-4"
			 data-x="['left','left','left','left']" data-hoffset="['50','40','50','26']"
			 data-y="['top','top','top','top']" data-voffset="['465','411','285','254']"
						data-fontweight="['900','700','700','700']"
			data-width="none"
			data-height="none"
			data-whitespace="nowrap"

			data-type="button"
			data-basealign="slide"
			data-responsive_offset="off"
			data-responsive="off"
			data-frames='[{"from":"y:50px;opacity:0;","speed":1500,"to":"o:1;","delay":800,"ease":"Power4.easeOut"},{"delay":"wait","speed":300,"to":"opacity:0;","ease":"nothing"},{"frame":"hover","speed":"0","ease":"Power1.easeInOut","to":"o:1;rX:0;rY:0;rZ:0;z:0;","style":"c:rgba(0, 0, 0, 1.00);bg:rgba(255, 204, 0, 1.00);bw:2px 2px 2px 2px;"}]'
			data-textAlign="['left','left','left','left']"
			data-paddingtop="[0,0,0,0]"
			data-paddingright="[45,45,45,45]"
			data-paddingbottom="[0,0,0,0]"
			data-paddingleft="[45,45,45,45]"

			style="z-index: 17; white-space: nowrap; font-size: 15px; line-height: 50px; font-weight: 900; color: rgba(255, 204, 0, 1.00);font-family:Roboto;background-color:rgba(0, 0, 0, 0);border-color:rgba(255, 204, 0, 1.00);border-style:solid;border-width:2px;outline:none;box-shadow:none;box-sizing:border-box;-moz-box-sizing:border-box;-webkit-box-sizing:border-box;letter-spacing:3px;cursor:pointer;">READ ARTICLE

		<div class="tp-caption  "
			 id="slide-3206-layer-7"
			 data-x="['left','left','left','left']" data-hoffset="['95','85','123','69']"
			 data-y="['top','top','top','top']" data-voffset="['163','143','52','53']"
						data-width="['600','560','290','215']"
			data-height="none"
			data-whitespace="normal"

			data-type="text"
			data-basealign="slide"
			data-responsive_offset="off"
			data-responsive="off"
			data-frames='[{"from":"y:-50px;opacity:0;","speed":1500,"to":"o:1;","delay":500,"ease":"Power4.easeOut"},{"delay":"wait","speed":300,"to":"opacity:0;","ease":"nothing"}]'
			data-textAlign="['left','left','left','left']"
			data-paddingtop="[0,0,0,0]"
			data-paddingright="[0,0,0,0]"
			data-paddingbottom="[0,0,0,0]"
			data-paddingleft="[0,0,0,0]"

			style="z-index: 18; min-width: 600px; max-width: 600px; white-space: normal; font-size: 17px; line-height: 22px; font-weight: 400; color: rgba(60, 214, 255, 1.00);font-family:Roboto;border-width:0px;letter-spacing:2px;">POPULAR

		<div class="tp-caption tp-shape tp-shapewrapper "
			 id="slide-3206-layer-6"
			 data-x="['left','left','left','left']" data-hoffset="['49','39','79','28']"
			 data-y="['top','top','top','top']" data-voffset="['159','139','49','49']"
						data-width="30"
			data-height="30"
			data-whitespace="nowrap"

			data-type="shape"
			data-basealign="slide"
			data-responsive_offset="off"
			data-responsive="off"
			data-frames='[{"from":"y:-50px;opacity:0;","speed":1500,"to":"o:1;","delay":500,"ease":"Power4.easeOut"},{"delay":"wait","speed":300,"to":"opacity:0;","ease":"nothing"}]'
			data-textAlign="['left','left','left','left']"
			data-paddingtop="[0,0,0,0]"
			data-paddingright="[0,0,0,0]"
			data-paddingbottom="[0,0,0,0]"
			data-paddingleft="[0,0,0,0]"

			style="z-index: 19;background-color:rgba(60, 214, 255, 1.00);border-color:rgba(0, 0, 0, 0);border-width:0px;border-radius:50% 50% 50% 50%;">

		<div class="tp-caption   tp-svg-layer"
			 id="slide-3206-layer-9"
			 data-x="['left','left','left','left']" data-hoffset="['52','42','82','31']"
			 data-y="['top','top','top','top']" data-voffset="['163','143','53','53']"
						data-width="23"
			data-height="23"
			data-whitespace="nowrap"

			data-type="svg"
			data-svg_src="../../assets/images/ic_trending_up_24px.svg"
			data-svg_idle="sc:transparent;sw:0;sda:0;sdo:0;"
			data-basealign="slide"
			data-responsive_offset="off"
			data-responsive="off"
			data-frames='[{"from":"y:-50px;opacity:0;","speed":1500,"to":"o:1;","delay":500,"ease":"Power4.easeOut"},{"delay":"wait","speed":300,"to":"opacity:0;","ease":"nothing"}]'
			data-textAlign="['left','left','left','left']"
			data-paddingtop="[0,0,0,0]"
			data-paddingright="[0,0,0,0]"
			data-paddingbottom="[0,0,0,0]"
			data-paddingleft="[0,0,0,0]"

			style="z-index: 20; min-width: 23px; max-width: 23px; max-width: 23px; max-width: 23px; color: rgba(33, 42, 64, 1.00);border-width:0px;">

	<li data-index="rs-3207" data-transition="slideoververtical" data-slotamount="default" data-hideafterloop="0" data-hideslideonmobile="off"  data-easein="default" data-easeout="default" data-masterspeed="default"  data-thumb="../../assets/images/youtubecover-1-100x50.jpg"  data-rotate="0"  data-saveperformance="off"  data-title="WILDLIFE IN 4K YOUTUBE VIDEO" data-param1="Created by Jacob + Katie Schwarz" data-param2="" data-param3="" data-param4="" data-param5="" data-param6="" data-param7="" data-param8="" data-param9="" data-param10="" data-description="">

		<div class="tp-caption  "
			 id="slide-3207-layer-1"
			 data-x="['left','left','left','left']" data-hoffset="['94','84','76','26']"
			 data-y="['top','top','top','top']" data-voffset="['213','193','95','85']"
						data-fontsize="['60','45','35','25']"
			data-lineheight="['60','45','35','30']"
			data-width="['600','560','340','260']"
			data-height="none"
			data-whitespace="normal"

			data-type="text"
			data-basealign="slide"
			data-responsive_offset="off"
			data-responsive="off"
			data-frames='[{"from":"y:50px;opacity:0;","speed":1500,"to":"o:1;","delay":500,"ease":"Power4.easeOut"},{"delay":"wait","speed":300,"to":"opacity:0;","ease":"nothing"}]'
			data-textAlign="['left','left','left','left']"
			data-paddingtop="[0,0,0,0]"
			data-paddingright="[0,0,0,0]"
			data-paddingbottom="[0,0,0,0]"
			data-paddingleft="[0,0,0,0]"

			style="z-index: 21; min-width: 600px; max-width: 600px; white-space: normal; font-size: 60px; line-height: 60px; font-weight: 700; color: rgba(255, 255, 255, 1.00);font-family:Roboto;border-width:0px;">WILDLIFE IN 4K YOUTUBE VIDEO

		<div class="tp-caption tp-shape tp-shapewrapper "
			 id="slide-3207-layer-2"
			 data-x="['left','left','left','left']" data-hoffset="['50','40','50','0']"
			 data-y="['top','top','top','top']" data-voffset="['220','200','100','90']"
						data-width="8"
			data-height="['104','77','59','48']"
			data-whitespace="normal"

			data-type="shape"
			data-basealign="slide"
			data-responsive_offset="off"
			data-responsive="off"
			data-frames='[{"from":"sY:0;","speed":1500,"to":"o:1;","delay":500,"ease":"Power4.easeOut"},{"delay":"wait","speed":300,"to":"opacity:0;","ease":"nothing"}]'
			data-textAlign="['left','left','left','left']"
			data-paddingtop="[0,0,0,0]"
			data-paddingright="[0,0,0,0]"
			data-paddingbottom="[0,0,0,0]"
			data-paddingleft="[0,0,0,0]"

			style="z-index: 22;background-color:rgba(255, 204, 0, 1.00);border-color:rgba(0, 0, 0, 0);border-width:0px;">

		<div class="tp-caption  "
			 id="slide-3207-layer-3"
			 data-x="['left','left','left','left']" data-hoffset="['98','88','76','26']"
			 data-y="['top','top','top','top']" data-voffset="['358','302','184','163']"
						data-width="['600','560','340','260']"
			data-height="none"
			data-whitespace="normal"

			data-type="text"
			data-basealign="slide"
			data-responsive_offset="off"
			data-responsive="off"
			data-frames='[{"from":"y:50px;opacity:0;","speed":1500,"to":"o:1;","delay":650,"ease":"Power4.easeOut"},{"delay":"wait","speed":300,"to":"opacity:0;","ease":"nothing"}]'
			data-textAlign="['left','left','left','left']"
			data-paddingtop="[0,0,0,0]"
			data-paddingright="[0,0,0,0]"
			data-paddingbottom="[0,0,0,0]"
			data-paddingleft="[0,0,0,0]"

			style="z-index: 23; min-width: 600px; max-width: 600px; white-space: normal; font-size: 17px; line-height: 22px; font-weight: 500; color: rgba(255, 255, 255, 0.85);font-family:Roboto;border-width:0px;letter-spacing:2px;">CREATED BY JACOB + KATIE SCHWARZ.

		<a class="tp-caption rev-btn "
 href="https://www.youtube.com/watch?v=xDMP3i36naA" target="_blank"			 id="slide-3207-layer-4"
			 data-x="['left','left','left','left']" data-hoffset="['50','40','50','26']"
			 data-y="['top','top','top','top']" data-voffset="['465','411','285','254']"
						data-fontweight="['900','700','700','700']"
			data-width="none"
			data-height="none"
			data-whitespace="nowrap"

			data-type="button"
			data-actions=''
			data-basealign="slide"
			data-responsive_offset="off"
			data-responsive="off"
			data-frames='[{"from":"y:50px;opacity:0;","speed":1500,"to":"o:1;","delay":800,"ease":"Power4.easeOut"},{"delay":"wait","speed":300,"to":"opacity:0;","ease":"nothing"},{"frame":"hover","speed":"0","ease":"Power1.easeInOut","to":"o:1;rX:0;rY:0;rZ:0;z:0;","style":"c:rgba(0, 0, 0, 1.00);bg:rgba(255, 204, 0, 1.00);bw:2px 2px 2px 2px;"}]'
			data-textAlign="['left','left','left','left']"
			data-paddingtop="[0,0,0,0]"
			data-paddingright="[45,45,45,45]"
			data-paddingbottom="[0,0,0,0]"
			data-paddingleft="[45,45,45,45]"

			style="z-index: 24; white-space: nowrap; font-size: 15px; line-height: 50px; font-weight: 900; color: rgba(255, 204, 0, 1.00);font-family:Roboto;background-color:rgba(0, 0, 0, 0);border-color:rgba(255, 204, 0, 1.00);border-style:solid;border-width:2px;outline:none;box-shadow:none;box-sizing:border-box;-moz-box-sizing:border-box;-webkit-box-sizing:border-box;letter-spacing:3px;cursor:pointer;">GO TO VIDEO

Your Slider Revolution jQuery Plugin

Slider Revolution is an innovative, responsive Slider Plugin that displays your content the beautiful way. Whether it's a Slider, Carousel, Hero Scene or even a whole Front Page.
The visual drag & drop editor will help you to create your Sliders and tell your own stories in no time!

Find the Documentation ?

We would always recommend to use our online documentation however you can find also our embeded local documentation zipped in the Documentation folder. Online Documentation and FAQ Page is regulary updated. You will find More examples, Visit us also at http://themepunch.com !

Learn how to build your Slider!

Navigation Examples !

You find many Examples for All Skins and Positions of Navigation examples in the examples/Navigation folder. Based on these prepared examples you can build your own navigation skins. Feel free to copy and paste the markups after your requests in your own documents.

Customize the interaction with your visitor!

Layer and Slide Transitions

We prepared a small List of Transition and a light weight Markup Builder in the  examples/Transitions folder. This will help you to get an overview how the Slider and Layer Transitions works. Copy the Markups of the generated Slide and Layer Animation Examples and paste it into your own Documents.

Eye Catching Effects!

Slider Revolution

                Features
                Usage Examples
                Online Documentation

Resources

                FAQ Database
                ThemePunch.com
                Newsletter
                Plugins
                Themes

More Versions

                WordPress
                Prestashop
                Magento
                OpenCart
                Drupal

Follow Us


text:
import tear from "../tear";
import tearOwn from "../tearOwn";
import { wannabeEmptyObjects } from "../../__tests__/commons";

describe("tear / tearOwn", () => {
    const baseFoo = Object.create({ a: 1 }, { b: { value: 2 } });
    const foo = Object.create(baseFoo, {
        c: { value: 3 },
        d: { value: 4, enumerable: true }
    });

    it("should transform an object in two lists, one containing its keys, the other containing the corresponding values", () => {
        expect(tear({ a: 1, b: 2, c: 3 })).toStrictEqual([["a", "b", "c"], [1, 2, 3]]);
        expect(tearOwn({ a: 1, b: 2, c: 3 })).toStrictEqual([["a", "b", "c"], [1, 2, 3]]);
    });

    it("should work with array-like objects", () => {
        const r1 = [["0", "1", "2"], [1, 2, 3]];
        const r2 = [["0", "1", "2"], ["a", "b", "c"]];

        expect(tear([1, 2, 3])).toStrictEqual(r1);
        expect(tear("abc")).toStrictEqual(r2);
        expect(tearOwn([1, 2, 3])).toStrictEqual(r1);
        expect(tearOwn("abc")).toStrictEqual(r2);
    });

    it("should keep `undefined` values in the result", () => {
        const source = { a: null, b: void 0 };
        const result = [["a", "b"], [null, void 0]];

        expect(tear(source)).toStrictEqual(result);
        expect(tearOwn(source)).toStrictEqual(result);
    });

    it("should throw an exception if called without arguments", () => {
        expect(tear).toThrow();
        expect(tearOwn).toThrow();
    });

    it("should throw an exception if supplied with `null` or `undefined`", () => {
        expect(() => { tear(null); }).toThrow();
        expect(() => { tear(void 0); }).toThrow();
        expect(() => { tearOwn(null); }).toThrow();
        expect(() => { tearOwn(void 0); }).toThrow();
    });

    it("should consider other values as empty objects", () => {
        wannabeEmptyObjects.forEach(function (value) {
            expect(tear(value)).toStrictEqual([[], []]);
            expect(tearOwn(value)).toStrictEqual([[], []]);
        });
    });

    describe("tear", () => {
        it("should use all the enumerable properties of the source object, inherited or not", () => {
            expect(tear(foo)).toStrictEqual([["d", "a"], [4, 1]]);
        });
    });

    describe("tearOwn", () => {
        it("should use only the own enumerable properties of the source object", () => {
            expect(tearOwn(foo)).toStrictEqual([["d"], [4]]);
        });
    });
});


text:
package fake

import (
	network "github.com/openshift/origin/pkg/network/apis/network"
	v1 "k8s.io/apimachinery/pkg/apis/meta/v1"
	labels "k8s.io/apimachinery/pkg/labels"
	schema "k8s.io/apimachinery/pkg/runtime/schema"
	types "k8s.io/apimachinery/pkg/types"
	watch "k8s.io/apimachinery/pkg/watch"
	testing "k8s.io/client-go/testing"
)

// FakeClusterNetworks implements ClusterNetworkInterface
type FakeClusterNetworks struct {
	Fake *FakeNetwork
}

var clusternetworksResource = schema.GroupVersionResource{Group: "network.openshift.io", Version: "", Resource: "clusternetworks"}

var clusternetworksKind = schema.GroupVersionKind{Group: "network.openshift.io", Version: "", Kind: "ClusterNetwork"}

// Get takes name of the clusterNetwork, and returns the corresponding clusterNetwork object, and an error if there is any.
func (c *FakeClusterNetworks) Get(name string, options v1.GetOptions) (result *network.ClusterNetwork, err error) {
	obj, err := c.Fake.
		Invokes(testing.NewRootGetAction(clusternetworksResource, name), &network.ClusterNetwork{})
	if obj == nil {
		return nil, err
	}
	return obj.(*network.ClusterNetwork), err
}

// List takes label and field selectors, and returns the list of ClusterNetworks that match those selectors.
func (c *FakeClusterNetworks) List(opts v1.ListOptions) (result *network.ClusterNetworkList, err error) {
	obj, err := c.Fake.
		Invokes(testing.NewRootListAction(clusternetworksResource, clusternetworksKind, opts), &network.ClusterNetworkList{})
	if obj == nil {
		return nil, err
	}

	label, _, _ := testing.ExtractFromListOptions(opts)
	if label == nil {
		label = labels.Everything()
	}
	list := &network.ClusterNetworkList{ListMeta: obj.(*network.ClusterNetworkList).ListMeta}
	for _, item := range obj.(*network.ClusterNetworkList).Items {
		if label.Matches(labels.Set(item.Labels)) {
			list.Items = append(list.Items, item)
		}
	}
	return list, err
}

// Watch returns a watch.Interface that watches the requested clusterNetworks.
func (c *FakeClusterNetworks) Watch(opts v1.ListOptions) (watch.Interface, error) {
	return c.Fake.
		InvokesWatch(testing.NewRootWatchAction(clusternetworksResource, opts))
}

// Create takes the representation of a clusterNetwork and creates it.  Returns the server's representation of the clusterNetwork, and an error, if there is any.
func (c *FakeClusterNetworks) Create(clusterNetwork *network.ClusterNetwork) (result *network.ClusterNetwork, err error) {
	obj, err := c.Fake.
		Invokes(testing.NewRootCreateAction(clusternetworksResource, clusterNetwork), &network.ClusterNetwork{})
	if obj == nil {
		return nil, err
	}
	return obj.(*network.ClusterNetwork), err
}

// Update takes the representation of a clusterNetwork and updates it. Returns the server's representation of the clusterNetwork, and an error, if there is any.
func (c *FakeClusterNetworks) Update(clusterNetwork *network.ClusterNetwork) (result *network.ClusterNetwork, err error) {
	obj, err := c.Fake.
		Invokes(testing.NewRootUpdateAction(clusternetworksResource, clusterNetwork), &network.ClusterNetwork{})
	if obj == nil {
		return nil, err
	}
	return obj.(*network.ClusterNetwork), err
}

// Delete takes name of the clusterNetwork and deletes it. Returns an error if one occurs.
func (c *FakeClusterNetworks) Delete(name string, options *v1.DeleteOptions) error {
	_, err := c.Fake.
		Invokes(testing.NewRootDeleteAction(clusternetworksResource, name), &network.ClusterNetwork{})
	return err
}

// DeleteCollection deletes a collection of objects.
func (c *FakeClusterNetworks) DeleteCollection(options *v1.DeleteOptions, listOptions v1.ListOptions) error {
	action := testing.NewRootDeleteCollectionAction(clusternetworksResource, listOptions)

	_, err := c.Fake.Invokes(action, &network.ClusterNetworkList{})
	return err
}

// Patch applies the patch and returns the patched clusterNetwork.
func (c *FakeClusterNetworks) Patch(name string, pt types.PatchType, data []byte, subresources ...string) (result *network.ClusterNetwork, err error) {
	obj, err := c.Fake.
		Invokes(testing.NewRootPatchSubresourceAction(clusternetworksResource, name, data, subresources...), &network.ClusterNetwork{})
	if obj == nil {
		return nil, err
	}
	return obj.(*network.ClusterNetwork), err
}


text:
Deface::Override.new(
    :original => 'b720ad784958259c77d83d6f906cbdac2439ade9',
    :virtual_path => 'spree/admin/products/_form',
    :name => 'add_expires_on_field_to_admin_product_form',
    :insert_after => 'div[data-hook="admin_product_form_available_on"]',
    :text => '<div data-hook="admin_product_form_expires_on">
        <%= f.field_container :expires_on, class: [\'form-group\'] do %>
          <%= f.label :expires_on, Spree.t(:expires_on) %>
          <%= f.error_message_on :expires_on %>
          <%= f.text_field :expires_on, value: datepicker_field_value(@product.expires_on), class: \'datepicker form-control\' %>
        <% end %>
      </div>'
)


text:
TEST(HelloTest, Greet) {
  EXPECT_STREQ("Hello", "Hello");
}


text:
<?php
namespace Chaos\ORM\Collection;

use Chaos\ORM\Contrat\DataStoreInterface;
use Chaos\ORM\Contrat\HasParentsInterface;

use Chaos\ORM\ORMException;
use Chaos\ORM\Document;
use Chaos\ORM\Model;
use Chaos\ORM\Collection\Collection;

/**
 * `Through` provide context-specific features for working with sets of data persisted by a backend data store.
 */
class Through implements DataStoreInterface, HasParentsInterface, \ArrayAccess, \Iterator, \Countable
{
    /**
     * A reference to this object's parent `Document` object.
     *
     * @var object
     */
    protected $_parent = null;

    /**
     * The schema to which this collection is bound. This
     * is usually the schema that executed the query which created this object.
     *
     * @var object
     */
    protected $_schema = null;

    /**
     * A reference to this object's parent `Document` object.
     *
     * @var object
     */
    protected $_through = null;

    /**
     * A reference to this object's parent `Document` object.
     *
     * @var object
     */
    protected $_using = null;

    /**
     * Creates an alias on an other collection.
     *
     * @param array $config Possible options are:
     *                      - `'parent'`    _object_ : The parent instance.
     *                      - `'schema'`    _object_ : The attached schema.
     *                      - `'through'`   _object_ : A collection instance.
     *                      - `'using'`     _string_ : The field name to extract from collection's entities.
     *                      - `'data'`      _array_  : Some data to set on the collection.
     */
    public function __construct($config = [])
    {
        $defaults = [
            'parent'  => null,
            'schema'  => null,
            'through' => null,
            'using'   => null,
            'exists'  => false
        ];
        $config += $defaults;
        $this->_parent = $config['parent'];
        $this->_schema = $config['schema'];
        $this->_through = $config['through'];
        $this->_using = $config['using'];

        foreach (['parent', 'schema', 'through', 'using'] as $name) {
            if (!$config[$name]) {
                throw new ORMException("Invalid through collection, `'{$name}'` is empty.");
            }
            $key = '_' . $name;
            $this->{$key} = $config[$name];
        }

        // Existing tags will require valid pivot ID, so existing data must be setted through the pivot table.
        if (!empty($config['exists'])) {
            return;
        }

        if ($this->_parent->has($this->_through)) {
            if (isset($config['data'])) {
                $this->_merge($config['data'], $config['exists']);
            }
            return;
        }

        $this->_parent->{$this->_through} = [];

        $config['data'] = isset($config['data']) ? $config['data'] : [];

        $this->amend($config['data'], ['exists' => $config['exists']]);
    }

    /**
     * Merge pivot data based on entities ids
     *
     * @param array   $data   The pivot data.
     * @param boolean $exists The existance value.
     */
    protected function _merge($data, $exists)
    {
        if (!$data) {
            $this->_parent->get($this->_through)->clear();
            return;
        }

        $pivot = $this->_parent->{$this->_through};

        $relThrough = $this->_parent->schema()->relation($this->_through);
        $through = $relThrough->to();
        $schema = $through::definition();
        $rel = $schema->relation($this->_using);
        $fromKey = $rel->keys('from');
        $toKey = $rel->keys('to');

        $i = 0;

        while ($i < $pivot->count()) {
            $found = false;
            $entity = $pivot->get($i);
            $id1 = $entity->get($fromKey);
            if ($id1 === null) {
                $pivot->splice($i, 1);
                continue;
            }
            foreach ($data as $key => $item) {
                $isDocument = $item instanceof Document;
                $id2 = $isDocument ? $item->get($toKey) : (isset($item[$toKey]) ?$item[$toKey] : null);

                if ((string) $id1 === (string) $id2) {
                    if ($isDocument) {
                        $entity->set($this->_using, $item);
                    } else {
                        $entity->get($this->_using)->amend($item);
                    }
                    unset($data[$key]);
                    $i++;
                    $found = true;
                    break;
                }
            }
            if (!$found) {
                $pivot->splice($i, 1);
            }
        }

        foreach ($data as $entity) {
            $this[] = $entity;
        }
    }

    /**
     * Get parents.
     *
     * @return Map Returns the parents map.
     */
    public function parents()
    {
        return $this->_parent->{$this->_through}->parents();
    }

    /**
     * Set a parent.
     *
     * @param  pbject $parent The parent instance to set.
     * @param  string $from   The parent from field to set.
     * @return self
     */
    public function setParent($parent, $from)
    {
        $this->_parent->{$this->_through}->setParent($parent, $from);
        return $this;
    }

    /**
     * Unset a parent.
     *
     * @param  object $parent The parent instance to unset.
     * @return self
     */
    public function unsetParent($parent)
    {
        $this->_parent->{$this->_through}->unsetParent($parent);
        return $this;
    }

    /**
     * Disconnect the collection from its graph (i.e parents).
     * Note: It has nothing to do with persistance
     *
     * @return self
     */
    public function disconnect()
    {
        $this->_parent->{$this->_through}->disconnect();
        return $this;
    }

    /**
     * Gets/sets the schema instance.
     *
     * @param  Object schema The schema instance to set or none to get it.
     * @return Object        The schema instance or `$this` on set.
     */
    public function schema()
    {
        return $this->_schema;
    }

    /**
     * Gets the base basePath.
     *
     * @return string
     */
    public function basePath()
    {
        return '';
    }

    /**
     * Gets the meta datas.
     *
     * @return array .
     */
    public function meta()
    {
        return $this->_parent->{$this->_through}->meta();
    }

    /**
     * Handles dispatching of methods against all items in the collection.
     *
     * @param  string $method The name of the method to call on each instance in the collection.
     * @param  mixed  $params The parameters to pass on each method call.
     *
     * @return mixed          Returns either an array of the return values of the methods, or the
     *                        return values wrapped in a `Collection` instance.
     */
    public function invoke($method, $params = [])
    {
        $data = [];
        $isCallable = is_callable($params);

        foreach ($this as $key => $object) {
            $callParams = $isCallable ? $params($object, $key, $this) : $params;
            $data[$key] = call_user_func_array([$object, $method], $callParams);
        }

        return new Collection(compact('data'));
    }

    /**
     * Gets an `Entity` object.
     *
     * @param  integer $offset The offset.
     * @return mixed          Returns an `Entity` object if exists otherwise returns `undefined`.
     */
    public function get($offset = null)
    {
        if (!func_num_args()) {
            $data = [];
            foreach ($this as $value) {
                $data[] = $value;
            }
            return $data;
        }
        if ($entity = $this->_parent->{$this->_through}->get($offset)) {
            return $entity->{$this->_using};
        }
        return;
    }

    /**
     * Sets data to a specified offset and wraps all data array in its appropriate object type.
     *
     * @param  mixed   $offset  The offset. If offset is `null` data is simply appended to the set.
     * @param  mixed   $data    An array or an entity instance to set.
     * @return self             Return `this`.
     */
    public function set($offset = null, $data = [])
    {
        $name = $this->_through;
        $this->_parent->{$name}->set($offset, $this->_item($data));
        return $this;
    }

    /**
     * Sets data to a specified offset and wraps all data array in its appropriate object type.
     *
     * @param  mixed $offset  The offset. If offset is `null` data is simply appended to the set.
     * @param  mixed $data    An array or an entity instance to set.
     * @param  array $options Method options:
     *                        - `'exists'` _boolean_: Determines whether or not this entity exists
     * @return self           Return `this`.
     */
    public function setAt($offset = null, $data = [], $options = [])
    {
        $name = $this->_through;
        $this->_parent->{$name}->set($offset, $this->_item($data, $options), $options);
        return $this;
    }

    /**
     * Adds data into the `Collection` instance.
     *
     * @param  mixed   $data    An array or an entity instance to set.
     * @return self             Return `this`.
     */
    public function push($data = [])
    {
        $name = $this->_through;
        $this->_parent->{$name}->push($offset, $this->_item($data));
        return $this;
    }

    /**
     * Create a pivot instance.
     *
     * @param  mixed $data    The data.
     * @param  array $options Method options:
     *                        - `'exists'` _boolean_: Determines whether or not this entity exists
     * @return mixed          The pivot instance.
     */
    protected function _item($data, $options = [])
    {
        $name = $this->_through;
        $parent = $this->_parent;
        $relThrough = $parent->schema()->relation($name);
        $through = $relThrough->to();
        $id = $this->_parent->id();
        $item = $through::create($id !== null ? $relThrough->match($this->_parent) : [], $options);
        $item->setAt($this->_using, $data, $options);
        return $item;
    }

    /**
     * Returns a boolean indicating whether an offset exists for the
     * current `Collection`.
     *
     * @param  string $offset String or integer indicating the offset or
     *                        index of an entity in the set.
     * @return boolean        Result.
     */
    public function offsetExists($offset)
    {
        return $this->_parent->{$this->_through}->offsetExists($offset);
    }

    /**
     * Gets an `Entity` object using PHP's array syntax, i.e. `$documents[3]` or `$records[5]`.
     *
     * @param  mixed $offset The offset.
     * @return mixed         Returns an `Entity` object if exists otherwise returns `null`.
     */
    public function offsetGet($offset)
    {
        return $this->get($offset);
    }

    /**
     * Adds the specified object to the `Collection` instance, and assigns associated metadata to
     * the added object.
     *
     * @param  string $offset The offset to assign the value to.
     * @param  mixed  $data   The entity object to add.
     * @return mixed          Returns the set `Entity` object.
     */
    public function offsetSet($offset, $data)
    {
        return $this->set($offset, $data);
    }

    /**
     * Unset an offset.
     *
     * @param integer $offset The offset to unset.
     */
    public function offsetUnset($offset)
    {
        unset($this->_parent->{$this->_through}[$offset]);
    }

    /**
     * Alias to `offsetExists()`.
     *
     * @param  string  $name Property name.
     * @return boolean
     */
    public function has($name)
    {
        return $this->offsetExists($name);
    }

    /**
     * Alias to `offsetUnset()`.
     *
     * @param  string  $name Property name.
     * @return boolean
     */
    public function unset($name)
    {
        return $this->offsetUnset($name);
    }

    /**
     * Amend the collection modifications.
     *
     * @return self
     */
    public function amend($data = null, $options = []) {
        $name = $this->_through;
        if ($data !== null) {
            foreach ($data as $value) {
                $item = $this->_item($value, $options);
                $this->_parent->get($name)->setAt(null, $item, $options);
                $item->amend();
            }
        }
        $this->_parent->get($name)->amend();
        return $this;
    }

    /**
     * Merges another collection to this collection.
     *
     * @param  mixed   $collection   A collection.
     * @param  boolean $preserveKeys If `true` use the key value as a hash to avoid duplicates.
     *
     * @return object                Return the merged collection.
     */
    public function merge($collection, $preserveKeys = false)
    {
        foreach($collection as $key => $value) {
            $preserveKeys ? $this[$key] = $value : $this[] = $value;
        }
        return $this;
    }

    /**
     * Clear the collection
     *
     * @return self This collection instance.
     */
    public function clear()
    {
        $this->_parent->{$this->_through}->clear();
        return $this;
    }

    /**
     * Returns the item keys.
     *
     * @return array The keys of the items.
     */
    public function keys()
    {
        return $this->_parent->{$this->_through}->keys();
    }

    /**
     * Returns the currently pointed to record's unique key.
     *
     * @param  boolean $full If true, returns the complete key.
     * @return mixed
     */
    public function key($full = false)
    {
        return $this->_parent->{$this->_through}->key();
    }

    /**
     * Returns the currently pointed to record in the set.
     *
     * @return object `Record`
     */
    public function current()
    {
        $entity = $this->_parent->{$this->_through}->current();
        if ($entity) {
            return $entity->{$this->_using};
        }
    }

    /**
     * Moves backward to the previous item.  If already at the first item,
     * moves to the last one.
     *
     * @return mixed The current item after moving or the last item on failure.
     */
    public function prev()
    {
        $entity = $this->_parent->{$this->_through}->prev();
        if ($entity) {
            return $entity->{$this->_using};
        }
    }

    /**
     * Returns the next document in the set, and advances the object's internal pointer. If the end
     * of the set is reached, a new document will be fetched from the data source connection handle
     * If no more documents can be fetched, returns `null`.
     *
     * @return mixed Returns the next document in the set, or `false`, if no more documents are
     *               available.
     */
    public function next()
    {
        $entity = $this->_parent->{$this->_through}->next();
        if ($entity) {
            return $entity->{$this->_using};
        }
    }

    /**
     * Rewinds the collection to the beginning.
     */
    public function rewind()
    {
        $this->_parent->{$this->_through}->rewind();
        return $this->current();
    }

    /**
     * Moves forward to the last item.
     *
     * @return mixed The current item after moving.
     */
    public function end()
    {
        $this->_parent->{$this->_through}->end();
        return $this->current();
    }

    /**
     * Checks if current position is valid.
     *
     * @return boolean `true` if valid, `false` otherwise.
     */
    public function valid()
    {
        return $this->_parent->{$this->_through}->valid();
    }

    /**
     * Counts the items of the object.
     *
     * @return integer Returns the number of items in the collection.
     */
    public function count()
    {
        return $this->_parent->{$this->_through}->count();
    }

    /**
     * Return the collection indexed by an arbitrary field name.
     *
     * @param  string  $field   The field name to use for indexing
     * @param  boolean $byIndex If `true` return index numbers attached to the index instead of documents.
     * @return object           The indexed collection
     */
    public function indexBy($field, $byIndex = false)
    {
        $indexes = [];
        $collection = $this->_parent->{$this->_through};

        foreach ($this as $key => $document) {
            if (!($document instanceof Document)) {
                throw new ORMException("Only document can be indexed.");
            }

            $index = $document[$field];
            $indexes[$index][] = $byIndex ? $key : $document;
        }
        return $indexes;
    }

    /**
     * Find the index of an item (not optimized for negative fromIndex).
     *
     * @param  mixed   $item      The item to look for.
     * @param  integer $fromIndex The index to start the search at If the provided index value is a negative number,
     *                            it is taken as the offset from the end of the array.
     *                            Note: if the provided index is negative, the array is still searched from front to back
     * @return integer            The first index of the element in the array; -1 if not found.
     */
    public function indexOf($item, $fromIndex = 0)
    {
        $index = max($fromIndex >= 0 ? $fromIndex : $this->count() + $fromIndex, 0);
        $collection = $this->_parent->{$this->_through};
        $cpt = 0;

        foreach ($collection as $key => $entity) {
            $cpt++;
            if ($cpt < $index + 1) {
                continue;
            }
            if ($entity[$this->_using] === $item) {
                return $key;
            }
            $index++;
        }
        return -1;
    }

    /**
     * Find the last index of an item (not optimized for negative fromIndex).
     *
     * @param  mixed   $item      The item to look for.
     * @param  integer $fromIndex The index to start the search at If the provided index value is a negative number,
     *                            it is taken as the offset from the end of the array.
     *                            Note: if the provided index is negative, the array is still searched from front to back
     * @return integer            The first index of the element in the array; -1 if not found.
     */
    public function lastIndexOf($item, $fromIndex = 0)
    {
        $index = max($fromIndex >= 0 ? $fromIndex : $this->count() + $fromIndex, 0);
        $collection = $this->_parent->{$this->_through};
        $cpt = 0;
        $result = -1;

        foreach ($collection as $key => $entity) {
            $cpt++;
            if ($cpt < $index + 1) {
                continue;
            }
            if ($entity[$this->_using] === $item) {
                $result = $key;
            }
            $index++;
        }
        return $result;
    }

    /**
     * Find the index of an entity with a defined id.
     *
     * @param  mixed        $id The entity id to look for.
     * @return integer|null     The entity's index number in the collection or `-1` if not found.
     */
    public function indexOfId($id)
    {
        $collection = $this->_parent->{$this->_through};

        foreach ($collection as $key => $entity) {
            if (!($entity instanceof Model)) {
                throw new ORMException('Error, `indexOfId()` is only available on models.');
            }
            if ($entity[$this->_using]->id() === $id) {
                return $key;
            }
        }
        return -1;
    }

    /**
     * Filters a copy of the items in the collection.
     *
     * @param  Closure $closure The closure to use for filtering, or an array of key/value pairs to match.
     * @return object           Returns a collection of the filtered items.
     */
    public function filter($closure)
    {
        $data = [];
        foreach ($this as $val) {
            if ($closure($val)) {
                $data[] = $val;
            }
        }
        return new Collection(compact('data'));
    }

    /**
     * Applies a closure to all items in the collection.
     *
     * @param  Closure $closure The closure to apply.
     * @return object           This collection instance.
     */
    public function apply($closure)
    {
        foreach ($this as $key => $val) {
            $this->offsetSet($key, $closure($val, $key, $this));
        }
        return $this;
    }

    /**
     * Applies a closure to a copy of all data in the collection
     * and returns the result.
     *
     * @param  Closure $closure The closure to apply.
     * @return mixed            Returns the set of filtered values inside a `Collection`.
     */
    public function map($closure)
    {
        $data = [];
        foreach ($this as $val) {
            $data[] = $closure($val);
        }
        return new Collection(compact('data'));
    }

    /**
     * Reduces, or folds, a collection down to a single value
     *
     * @param  Closure $closure The filter to apply.
     * @param  mixed   $initial Initial value.
     * @return mixed            The reduced value.
     */
    public function reduce($closure, $initial = false)
    {
        $result = $initial;
        foreach ($this as $val) {
            $result = $closure($result, $val);
        }
        return $result;
    }

    /**
     * Extracts a slice of $length items starting at position $offset from the Collection.
     *
     * If $length is null it returns all elements from $offset to the end of the Collection.
     * Keys have to be preserved by this method. Calling this method will only return the
     * selected slice and NOT change the elements contained in the collection slice is called on.
     *
     * @param  integer $start        The start offset.
     * @param  integer $end          The end offset.
     * @return object                Returns a collection instance.
     */
    public function slice($start, $end = null)
    {
        $result = $this->_parent->{$this->_through}->slice($start, $end);

        $data = [];
        foreach ($result as $key => $value) {
            $data[$key] = $value->{$this->_using};
        }
        return new Collection(compact('data'));
    }

   /**
    * Changes the contents of an array by removing existing elements and/or adding new elements.
    *
    * @param  integer  offset The offset value.
    * @param  integer  length The number of element to extract.
    * @return Array           An array containing the deleted elements.
    */
    public function splice($offset, $length = 0)
    {
        $result = $this->_parent->{$this->_through}->splice($offset, $length);

        $data = [];
        foreach ($result as $key => $value) {
            $data[$key] = $value->{$this->_using};
        }
        return new Collection(compact('data'));
    }

    /**
     * Eager loads relations.
     *
     * @param array $relations The relations to eager load.
     */
    public function embed($relations)
    {
        $this->schema()->embed($this, $relations);
    }

    /**
     * Converts the current state of the data structure to an array.
     *
     * @param  array $options The options array.
     * @return array          Returns the array value of the data in this `Collection`.
     */
    public function data($options = [])
    {
        return $this->to('array', $options);
    }

    /**
     * Validates the collection.
     *
     * @param  array   $options Validates option.
     * @return boolean
     */
    public function validates($options = [])
    {
        $success = true;
        foreach ($this as $entity) {
            if (!$entity->validates($options)) {
                $success = false;
            }
        }
        return $success;
    }

    /**
     * Returns the errors from the last validate call.
     *
     * @return array The occured errors.
     */
    public function errors($options = [])
    {
        $errors = [];
        $errored = false;
        foreach ($this as $entity) {
            $result = $entity->errors();
            $errors[] = $result;
            if ($result) {
                $errored = true;
            }
        }
        return $errored ? $errors : [];
    }

    /**
     * Exports a `Collection` object to another format.
     *
     * The supported values of `format` depend on the registered handlers.
     *
     * Once the appropriate handlers are registered, a `Collection` instance can be converted into
     * any handler-supported format, i.e.:
     *
     * ```php
     * $collection->to('json'); // returns a JSON string
     * $collection->to('xml'); // returns an XML string
     * ```
     *
     * @param  string $format  By default the only supported value is `'array'`. However, additional
     *                         format handlers can be registered using the `formats()` method.
     * @param  array  $options Options for converting the collection.
     * @return mixed           The converted collection.
     */
    public function to($format, $options = [])
    {
        return Collection::format($format, $this, $options);
    }
}


text:
package at.fhj.swd14.pse.repository.internal;

import at.fhj.swd14.pse.person.Hobby;
import at.fhj.swd14.pse.person.HobbyRepository;

import javax.ejb.Local;
import javax.ejb.Singleton;

/**
 * Repository class for hobby entity
 *
 * @author Patrick Kainz
 */
@Local
@Singleton
public class HobbyRepositoryImpl
        extends AbstractPersonInformationRepositoryImpl<Hobby>
        implements HobbyRepository {

    public HobbyRepositoryImpl() {
        super(Hobby.class);
    }

}


text:
<?xml version="1.0" encoding="utf-8"?>
<!-- $Revision: 334762 $ -->
<refentry xml:id="recursiveiterator.getchildren" xmlns="http://docbook.org/ns/docbook">
 <refnamediv>
  <refname>RecursiveIterator::getChildren</refname>
  <refpurpose>Returns an iterator for the current entry.</refpurpose>
 </refnamediv>
 <refsect1 role="description">
  &reftitle.description;
  <methodsynopsis>
   <modifier>public</modifier> <type>RecursiveIterator</type><methodname>RecursiveIterator::getChildren</methodname>
   <void/>
  </methodsynopsis>
  <para>
   Returns an iterator for the current iterator entry.
  </para>
 </refsect1>

 <refsect1 role="parameters">
  &reftitle.parameters;
  &no.function.parameters;
 </refsect1>

 <refsect1 role="returnvalues">
  &reftitle.returnvalues;
  <para>
   An iterator for the current entry.
  </para>
 </refsect1>

 <refsect1 role="seealso">
  &reftitle.seealso;
  <para>
   <simplelist>
    <member><function>RecursiveIterator::hasChildren</function></member>
   </simplelist>
  </para>
 </refsect1>

</refentry>

<!-- Keep this comment at the end of the file
Local variables:
mode: sgml
sgml-omittag:t
sgml-shorttag:t
sgml-minimize-attributes:nil
sgml-always-quote-attributes:t
sgml-indent-step:1
sgml-indent-data:t
indent-tabs-mode:nil
sgml-parent-document:nil
sgml-default-dtd-file:"~/.phpdoc/manual.ced"
sgml-exposed-tags:nil
sgml-local-catalogs:nil
sgml-local-ecat-files:nil
End:
vim600: syn=xml fen fdm=syntax fdl=2 si
vim: et tw=78 syn=sgml
vi: ts=1 sw=1
-->


text:
package org.thingsboard.server.actors.service;

import lombok.extern.slf4j.Slf4j;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.thingsboard.server.actors.AbstractTbActor;
import org.thingsboard.server.actors.ActorSystemContext;
import org.thingsboard.server.actors.ProcessFailureStrategy;
import org.thingsboard.server.actors.TbActor;
import org.thingsboard.server.actors.TbActorCtx;
import org.thingsboard.server.common.msg.TbActorMsg;

@Slf4j
public abstract class ContextAwareActor extends AbstractTbActor {

    public static final int ENTITY_PACK_LIMIT = 1024;

    protected final ActorSystemContext systemContext;

    public ContextAwareActor(ActorSystemContext systemContext) {
        super();
        this.systemContext = systemContext;
    }

    @Override
    public boolean process(TbActorMsg msg) {
        if (log.isDebugEnabled()) {
            log.debug("Processing msg: {}", msg);
        }
        if (!doProcess(msg)) {
            log.warn("Unprocessed message: {}!", msg);
        }
        return false;
    }

    protected abstract boolean doProcess(TbActorMsg msg);

    @Override
    public ProcessFailureStrategy onProcessFailure(Throwable t) {
        log.debug("[{}] Processing failure: ", getActorRef().getActorId(), t);
        return doProcessFailure(t);
    }

    protected ProcessFailureStrategy doProcessFailure(Throwable t) {
        if (t instanceof Error) {
            return ProcessFailureStrategy.stop();
        } else {
            return ProcessFailureStrategy.resume();
        }
    }
}


text:
package com.apptentive.android.sdk.module.messagecenter.model;

import android.app.Notification;
import android.content.Context;
import androidx.core.app.NotificationCompat;
import android.view.View;

public class ApptentiveToastNotification {

	private Context context;
	/**
	 * In Seconds
	 */
	private long duration = 5;
	/**
	 *
	 */
	private Notification notificationDelegate;

	private Builder builder;

	private boolean isSticky = false;

	private boolean activateStatusBar = false;

	private int code;
	private CharSequence titleStr;
	private CharSequence msgStr;
	private int iconRes;
	private String imageUrl;
	private View customView;

	private ApptentiveToastNotification(Context context) {
		this.context = context;
	}

	public static class Builder extends NotificationCompat.Builder {

		private ApptentiveToastNotification apptentiveNotification;

		public Builder(Context context) {
			super(context);
			apptentiveNotification = new ApptentiveToastNotification(context);
		}

		/**
		 * Set the first line of text in the platform notification template.
		 */
		public Builder setContentTitle(CharSequence title) {
			apptentiveNotification.setTitle(title);
			super.setContentTitle(title);
			return this;
		}

		/**
		 * Set the second line of text in the platform notification template.
		 */
		public Builder setContentText(CharSequence text) {
			apptentiveNotification.setMessage(text);
			super.setContentText(text);
			return this;
		}

		public Builder setSmallIcon(int icon) {
			apptentiveNotification.setIcon(icon);
			return this;
		}

		public Builder setIcon(int icon) {
			super.setSmallIcon(icon);
			return this;
		}

		public Builder setSticky(boolean isSticky) {
			apptentiveNotification.setSticky(isSticky);
			return this;
		}

		public ApptentiveToastNotification buildApptentiveToastNotification() {
			apptentiveNotification.setNotification(this.build());
			apptentiveNotification.setNotificationBuilder(this);
			return apptentiveNotification;
		}

		private Notification buildDefaultSilentNotification() {
			super.setSmallIcon(apptentiveNotification.getIcon());
			setDefaults(0);
			return this.build();
		}
	}

	protected void setIcon(int dRes) {
		iconRes = dRes;
	}

	protected void setTitle(CharSequence titleStr) {
		this.titleStr = titleStr;
	}

	protected void setMessage(CharSequence msgStr) {
		this.msgStr = msgStr;
	}

	public Context getContext() {
		return context;
	}

	public long getDuration() {
		return duration;
	}

	public CharSequence getTitleStr() {
		return titleStr;
	}

	public CharSequence getMsgStr() {
		return msgStr;
	}

	public int getIcon() {
		return iconRes;
	}

	public void setDuration(long interval) {
		this.duration = interval;
	}

	public Notification getNotification() {
		return notificationDelegate;
	}

	protected void setNotification(Notification notification) {
		this.notificationDelegate = notification;
	}

	public void setAvatarUrl(String imageUrl) {
		this.imageUrl = imageUrl;
	}

	public String getAvatarUrl() {
		return imageUrl;
	}

	public View getCustomView() {
		return customView;
	}

	public void setCustomView(View customView) {
		this.customView = customView;
	}

	public int getCode() {
		return code;
	}

	public void setCode(int code) {
		this.code = code;
	}

	public Notification getDefaultSilentNotification() {
		return getNotificationBuilder().buildDefaultSilentNotification();
	}

	public Builder getNotificationBuilder() {
		return builder;
	}

	private void setNotificationBuilder(Builder builder) {
		this.builder = builder;
	}

	public boolean isSticky() {
		return isSticky;
	}

	public void setSticky(boolean isSticky) {
		this.isSticky = isSticky;
	}

	public boolean isActivateStatusBar() {
		return activateStatusBar;
	}

	public void setActivateStatusBar(boolean activateStatusBar) {
		this.activateStatusBar = activateStatusBar;
	}
}


text:
package com.wrapper.spotify.requests.data.player;

import com.wrapper.spotify.TestUtil;
import com.wrapper.spotify.exceptions.SpotifyWebApiException;
import com.wrapper.spotify.requests.data.AbstractDataTest;
import org.apache.hc.core5.http.ParseException;
import org.junit.Test;
import org.junit.runner.RunWith;
import org.mockito.runners.MockitoJUnitRunner;

import java.io.IOException;
import java.util.concurrent.ExecutionException;

import static com.wrapper.spotify.Assertions.assertHasHeader;
import static org.junit.Assert.assertEquals;
import static org.junit.Assert.assertNull;

@RunWith(MockitoJUnitRunner.class)
public class SkipUsersPlaybackToNextTrackRequestTest extends AbstractDataTest<String> {
  private final SkipUsersPlaybackToNextTrackRequest defaultRequest = SPOTIFY_API
    .skipUsersPlaybackToNextTrack()
    .setHttpManager(
      TestUtil.MockedHttpManager.returningJson(null))
    .device_id(DEVICE_ID)
    .build();

  public SkipUsersPlaybackToNextTrackRequestTest() throws Exception {
  }

  @Test
  public void shouldComplyWithReference() {
    assertHasAuthorizationHeader(defaultRequest);
    assertHasHeader(defaultRequest, "Content-Type", "application/json");
    assertEquals(
      "https://api.spotify.com:443/v1/me/player/next?device_id=5fbb3ba6aa454b5534c4ba43a8c7e8e45a63ad0e",
      defaultRequest.getUri().toString());
  }

  @Test
  public void shouldReturnDefault_sync() throws IOException, SpotifyWebApiException, ParseException {
    shouldReturnDefault(defaultRequest.execute());
  }

  @Test
  public void shouldReturnDefault_async() throws ExecutionException, InterruptedException {
    shouldReturnDefault(defaultRequest.executeAsync().get());
  }

  public void shouldReturnDefault(final String string) {
    assertNull(
      string);
  }
}


text:
package me.echeung.cdflabs.holders;

import android.support.v7.widget.RecyclerView;
import android.view.View;
import android.widget.LinearLayout;
import android.widget.TextView;

import me.echeung.cdflabs.R;

public class ListItemHolder extends RecyclerView.ViewHolder {

    public LinearLayout statusView;
    public TextView statusNumView;
    public TextView statusAdjView;
    public TextView titleView;
    public TextView subtitleView;
    public LinearLayout moreView;

    public ListItemHolder(View itemView) {
        super(itemView);

        statusView = (LinearLayout) itemView.findViewById(R.id.status);
        statusNumView = (TextView) itemView.findViewById(R.id.status_number);
        statusAdjView = (TextView) itemView.findViewById(R.id.status_adj);
        titleView = (TextView) itemView.findViewById(R.id.item_title);
        subtitleView = (TextView) itemView.findViewById(R.id.item_subtitle);
        moreView = (LinearLayout) itemView.findViewById(R.id.item_more);
    }
}


text:
all: justice

justice: justice.c
	gcc justice.c -O2 -o a


text:
#include <boost/detail/lightweight_test.hpp>
#include "test_projection.hpp"

int main()
{
  test_projection();
  return boost::report_errors();
}


text:
package chapter_8;

public class Box {
    public int width = 0, height = 0, depth = 0;

    public Box(int width, int height, int depth) {
        this.width = width;
        this.height = height;
        this.depth = depth;
    }

    public boolean greaterThan(Box box) {
        return (this.width > box.width && this.height > box.height && this.depth > box.depth);
    }
}


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

    <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />

    <title>The nova.network.sg Module — nova 2012.2.1 documentation</title>

    <link rel="stylesheet" href="../_static/nature.css" type="text/css" />
    <link rel="stylesheet" href="../_static/pygments.css" type="text/css" />
    <link rel="stylesheet" href="../_static/tweaks.css" type="text/css" />

    <link rel="top" title="nova 2012.2.1 documentation" href="../index.html" />
    <link rel="up" title="<no title>" href="autoindex.html" />
    <link rel="next" title="The nova.notifications Module" href="nova.notifications.html" />
    <link rel="prev" title="The nova.network.quantumv2.api Module" href="nova.network.quantumv2.api.html" />

OpenStack

Home

Projects

User Stories

Community

Blog

Wiki

Documentation

The <tt class="xref py py-mod docutils literal">nova.network.sg</tt> Module¶

Implement Security Groups abstraction and API.

The nova security_group_handler flag specifies which class is to be used
to implement the security group calls.

The NullSecurityGroupHandler provides a “no-op” plugin that is loaded
by default and has no impact on current system behavior.  In the future,
special purposes classes that inherit from SecurityGroupHandlerBase
will provide enhanced functionality and will be loadable via the
security_group_handler flag.

class <tt class="descname">NullSecurityGroupHandler</tt>¶

Bases: <tt class="xref py py-class docutils literal">nova.network.sg.SecurityGroupHandlerBase</tt>

<tt class="descname">trigger_instance_add_security_group_refresh</tt><big>(</big>context, instance, group_name<big>)</big>¶

Called when a security group gains a new member.

<col class="field-name" />
<col class="field-body" />

Parameters:

context – the security context.

instance – the instance to be associated.

group_name – the name of the security group to be associated.

<tt class="descname">trigger_instance_remove_security_group_refresh</tt><big>(</big>context, instance, group_name<big>)</big>¶

Called when a security group loses a member.

<col class="field-name" />
<col class="field-body" />

Parameters:

context – the security context.

instance – the instance to be associated.

group_name – the name of the security group to be associated.

<tt class="descname">trigger_security_group_create_refresh</tt><big>(</big>context, group<big>)</big>¶

Called when a rule is added to a security_group.

<col class="field-name" />
<col class="field-body" />

Parameters:

context – the security context.

group – the new group added. group is a dictionary that contains
the following: user_id, project_id, name, description).

<tt class="descname">trigger_security_group_destroy_refresh</tt><big>(</big>context, security_group_id<big>)</big>¶

Called when a rule is added to a security_group.

<col class="field-name" />
<col class="field-body" />

Parameters:

context – the security context.

security_group_id – the security group identifier.

<tt class="descname">trigger_security_group_members_refresh</tt><big>(</big>context, group_ids<big>)</big>¶

Called when a security group gains or loses a member.

<col class="field-name" />
<col class="field-body" />

Parameters:

context – the security context.

group_ids – a list of security group identifiers.

<tt class="descname">trigger_security_group_rule_create_refresh</tt><big>(</big>context, rule_ids<big>)</big>¶

Called when a rule is added to a security_group.

<col class="field-name" />
<col class="field-body" />

Parameters:

context – the security context.

rule_ids – a list of rule ids that have been affected.

<tt class="descname">trigger_security_group_rule_destroy_refresh</tt><big>(</big>context, rule_ids<big>)</big>¶

Called when a rule is removed from a security_group.

<col class="field-name" />
<col class="field-body" />

Parameters:

context – the security context.

rule_ids – a list of rule ids that have been affected.

class <tt class="descname">SecurityGroupHandlerBase</tt>¶

Bases: <tt class="xref py py-class docutils literal">object</tt>

<tt class="descname">trigger_instance_add_security_group_refresh</tt><big>(</big>context, instance, group_name<big>)</big>¶

Called when a security group gains a new member.

<col class="field-name" />
<col class="field-body" />

Parameters:

context – the security context.

instance – the instance to be associated.

group_name – the name of the security group to be associated.

<tt class="descname">trigger_instance_remove_security_group_refresh</tt><big>(</big>context, instance, group_name<big>)</big>¶

Called when a security group loses a member.

<col class="field-name" />
<col class="field-body" />

Parameters:

context – the security context.

instance – the instance to be associated.

group_name – the name of the security group to be associated.

<tt class="descname">trigger_security_group_create_refresh</tt><big>(</big>context, group<big>)</big>¶

Called when a security group is created

<col class="field-name" />
<col class="field-body" />

Parameters:

context – the security context.

group – the new group added. group is a dictionary that contains
the following: user_id, project_id, name, description).

<tt class="descname">trigger_security_group_destroy_refresh</tt><big>(</big>context, security_group_id<big>)</big>¶

Called when a security group is deleted

<col class="field-name" />
<col class="field-body" />

Parameters:

context – the security context.

security_group_id – the security group identifier.

<tt class="descname">trigger_security_group_members_refresh</tt><big>(</big>context, group_ids<big>)</big>¶

Called when a security group gains or loses a member.

<col class="field-name" />
<col class="field-body" />

Parameters:

context – the security context.

group_ids – a list of security group identifiers.

<tt class="descname">trigger_security_group_rule_create_refresh</tt><big>(</big>context, rule_ids<big>)</big>¶

Called when a rule is added to a security_group.

<col class="field-name" />
<col class="field-body" />

Parameters:

context – the security context.

rule_ids – a list of rule ids that have been affected.

<tt class="descname">trigger_security_group_rule_destroy_refresh</tt><big>(</big>context, rule_ids<big>)</big>¶

Called when a rule is removed from a security_group.

<col class="field-name" />
<col class="field-body" />

Parameters:

context – the security context.

rule_ids – a list of rule ids that have been affected.

Previous topic

The <tt class="docutils literal docutils literal docutils literal">nova.network.quantumv2.api</tt> Module

Next topic

The <tt class="docutils literal">nova.notifications</tt> Module

This Page

Show Source

Quick search

              <form class="search" action="../search.html" method="get">
                <input type="text" name="q" size="18" />
                <input type="submit" value="Go" />
                <input type="hidden" name="check_keywords" value="yes" />
                <input type="hidden" name="area" value="default" />
              </form>

              Enter search terms or a module, class or function name.

Navigation

          index

          modules |

          next |

          previous |

nova 2012.2.1 documentation »

Developer Guide »

<no title> »

        © Copyright 2010-present, OpenStack, LLC.
      Last updated on Thu Nov 1 16:11:51 2012, commit 4ed8d3e.
      Created using Sphinx 1.1.3.


text:
RSpec.describe Vend::ResourceActions do
  before do
    module Vend
      class DummyClass
        include ResourceActions.new(api_version: '0.9', uri: 'http://foo.bar')
      end
    end
    @klass = Vend::DummyClass
  end

  let(:params) do
    { page: 1 }
  end

  it 'should have options' do
    mod = Vend::ResourceActions.new(
      uri: 'http://foo.bar',
      disable: [:find,:all]
    )
    options = {
      uri: 'http://foo.bar',
      disable: [:find,:all]
    }
    expect(mod._options).to eq options
  end

  describe '.all' do
    it 'should make a get request to the correct route with query params' do
      expect(@klass).to receive(:get).with('http://foo.bar', page: 1)
      @klass.all(params)
    end

    it 'should make a get request to the correct route' do
      expect(@klass).to receive(:get).with('http://foo.bar', {})
      params.delete(:params)
      @klass.all
    end
  end

  describe '.find' do
    it 'should make a get request to the correct route' do
      expect(@klass).to receive(:get).with('http://foo.bar/1', {})
      @klass.find(1)
    end
  end

  describe '.create' do
    it 'should make a post request to the correct route with params' do
      expect(@klass).to receive(:post).with('http://foo.bar', page: 1)
      @klass.create(params)
    end
  end

  describe '.update' do
    it 'should make a put request to the correct route with params' do
      expect(@klass).to receive(:put).with('http://foo.bar/1', page: 1)
      @klass.update(1, params)
    end
  end

  describe '.destroy' do
    it 'should make a delete request to the correct route with params' do
      expect(@klass).to receive(:delete).with('http://foo.bar/1', {})
      @klass.destroy(1)
    end
  end
end


text:
package de.evosec.gradle.gitflow.release;

import com.atlassian.jgitflow.core.JGitFlow;
import com.atlassian.jgitflow.core.exception.JGitFlowException;
import org.eclipse.jgit.api.errors.GitAPIException;
import org.eclipse.jgit.storage.file.FileRepositoryBuilder;
import org.gradle.api.DefaultTask;
import org.gradle.api.GradleException;
import org.gradle.api.tasks.Internal;

import java.io.File;
import java.io.IOException;
import java.io.InputStream;
import java.nio.file.Files;
import java.nio.file.Path;
import java.util.Objects;
import java.util.Properties;
import java.util.regex.Matcher;
import java.util.regex.Pattern;

import static java.nio.charset.StandardCharsets.UTF_8;

public class AbstractTask extends DefaultTask {

    @Internal
    private ReleasePlugin plugin;
    @Internal
    private JGitFlow flow;

    void setPlugin(ReleasePlugin plugin) {
        this.plugin = plugin;
    }

    public ReleasePlugin getPlugin() {
        return plugin;
    }

    protected JGitFlow ensureGitFlow() throws JGitFlowException {
        if (flow == null) {
            flow = JGitFlow.getOrInit(findWorkTree());
        }
        return flow;
    }

    protected void updateVersionAndCommit(JGitFlow flow, String targetVersion, String versionType) throws GitAPIException {
        String filepattern = findWorkTree()
                .toPath()
                .normalize()
                .relativize(findPropertiesFile())
                .toString();

        updateVersionProperty(targetVersion);
        flow.git().add().addFilepattern(filepattern).call();
        flow.git().commit().setMessage("update version to " + targetVersion + " " + versionType).call();
    }

    private File findWorkTree() {
        FileRepositoryBuilder repositoryBuilder = new FileRepositoryBuilder();

        repositoryBuilder.findGitDir();

        if (repositoryBuilder.getGitDir() == null) {
            throw new IllegalStateException("unable to find git working directory");
        }

        try {
            return repositoryBuilder.build().getWorkTree();
        } catch (IOException e) {
            throw new IllegalStateException("unable to find git working directory", e);
        }
    }

    protected void checkPropertiesFile() {
        Properties properties = new Properties();
        Path path = findPropertiesFile();

        try (InputStream is = Files.newInputStream(path)) {
            properties.load(is);
        } catch (IOException e) {
            throw new GradleException("unable to read " + getFilename(path), e);
        }

        // set the project version from the properties file if it was not otherwise specified
        if (!isVersionDefined()) {
            getProject().setVersion(properties.getProperty("version"));
        }
    }

    @Internal
    private boolean isVersionDefined() {
        return getProject().getVersion() != null && !"unspecified".equals(getProject().getVersion());
    }

    private Path findPropertiesFile() {
        String versionPropertyFileName = plugin.getExtension().getVersionPropertyFile();
        File propertiesFile = getProject().file(versionPropertyFileName);
        if (!propertiesFile.isFile()) {
            throw new GradleException("version property file [" + versionPropertyFileName + "] not found, please create it manually and and specify the version property.");
        }
        return propertiesFile.getAbsoluteFile().toPath();
    }

    protected void updateVersionProperty(String newVersion) {
        String oldVersion = "${project.version}";
        if (!Objects.equals(oldVersion, newVersion)) {
            getProject().setVersion(newVersion);
            getProject().subprojects(subProject -> subProject.setVersion(newVersion));
            Path propFile = findPropertiesFile();
            writeVersion(propFile, "version", newVersion);
        }
    }

    private void writeVersion(Path path, String key, String version) {
        try {
            // we use replace here as other ant tasks escape and modify the whole file

            String propertiesFile = new String(Files.readAllBytes(path), UTF_8);

            Pattern pattern = Pattern.compile("^(" + key + "\\s*=\\s*).+$", Pattern.MULTILINE);
            Matcher matcher = pattern.matcher(propertiesFile);
            if (matcher.find()) {
                propertiesFile = matcher.replaceAll("$1" + version);
            } else {
                throw new GradleException("could not write version");
            }

            Files.write(path, propertiesFile.getBytes(UTF_8));

        } catch (IOException e) {
            throw new GradleException("unable to update " + getFilename(path), e);
        }
    }

    private String getFilename(Path path) {
        Path fileName = path.getFileName();
        return fileName == null ? path.toString() : fileName.toString();
    }
}