text:
BOOL SerialConnect(HWND hWnd,HINSTANCE hInst,char* portname,int portspeed,int informonconnectmsg);
int SerialSendFile(HANDLE fh,char* filename,char* block,DWORD resumeat, BOOL sizeonly);
int SerialReceiveFile(HANDLE fh,char* fileName,char* block,DWORD restartat);
int SerialUploadFile(char* filename,char* remotename,DWORD resumeat);
int SerialDownloadFile(char* remotename,char* localname,BOOL alwaysoverwrite,FILETIME *ft,BOOL Resume,BOOL dirlist);
BOOL SerialDeleteFile(char* remotefile);
BOOL SerialCreateDirectory(char* remotedir);
void SerialCloseConnection(void);
BOOL SerialTryConnection(void);
BOOL SerialRenameMoveFile(char* OldName,char* NewName,BOOL move);
BOOL SerialSetAttr(char* remotefile,int attr);
BOOL SerialSetDateTime(char* remotefile,FILETIME *ft);
BOOL SerialSetRestart(DWORD restartat);
BOOL SerialSetOverwriteFlag();
DWORD SerialGetFileSize(char* RemoteName);
BOOL SerialConnected(void);
void SerialSendFlush(void);
int SerialSendChar(char byte);

#define ser_up_ok 0
#define ser_up_exists 1
#define ser_up_readfailed 2
#define ser_up_writefailed 3
#define ser_up_abort 4


text:
package com.esri.geoevent.test.performance.rabbitmq;

import java.io.IOException;

import com.esri.geoevent.test.performance.ConsumerBase;
import com.esri.geoevent.test.performance.ImplMessages;
import com.esri.geoevent.test.performance.TestException;
import com.esri.geoevent.test.performance.jaxb.Config;
import com.rabbitmq.client.Channel;
import com.rabbitmq.client.Connection;
import com.rabbitmq.client.ConnectionFactory;
import com.rabbitmq.client.QueueingConsumer;

public class RabbitMQEventConsumer extends ConsumerBase {

    private Connection connection = null;
    private Channel channel = null;
    private QueueingConsumer consumer = null;
    private String uri;
    private String exchangeName;
    private String queueName;
    private String routingKey = null;

    @Override
    public void init(Config config) throws TestException {
        super.init(config);

        uri = config.getPropertyValue("uri");
        exchangeName = config.getPropertyValue("exchangeName");
        queueName = config.getPropertyValue("queueName");
        routingKey = config.getPropertyValue("routingKey");

        if (uri == null) {
            throw new TestException("RabbitMQ event consumer ERROR: 'uri' property must be specified");
        }
        if (exchangeName == null) {
            throw new TestException("RabbitMQ event consumer ERROR: 'exchangeName' property must be specified");
        }
        if (queueName == null) {
            throw new TestException("RabbitMQ event consumer ERROR: 'queueName' property must be specified");
        }

        try {
            ConnectionFactory factory = new ConnectionFactory();
            factory.setUri(uri);
            connection = factory.newConnection();
            channel = connection.createChannel();
            channel.queueDeclare(queueName, false, false, true, null);
            channel.queueBind(queueName, exchangeName, routingKey);
            // channel.basicQos(1);
            consumer = new QueueingConsumer(channel);
            channel.basicConsume(queueName, true, consumer);
        } catch (Exception error) {
            throw new TestException(ImplMessages.getMessage("INIT_FAILURE", getClass().getName(), error.getMessage()), error);
        }
    }

    @Override
    public void validate() throws TestException {
        if (consumer == null) {
            throw new TestException("RabbitMQ event consumer could not be created.");
        }
    }

    @Override
    public String pullMessage() {
        String message = null;
        try {
            byte[] bytes = consumer.nextDelivery().getBody();
            message = new String(bytes);
        } catch (Exception ignored) {
        }
        return message;
    }

    @Override
    public void destroy() {
        super.destroy();

        try {
            consumer.getChannel().basicCancel(consumer.getConsumerTag());
        } catch (IOException e) {
            e.printStackTrace();
        }

        try {
            Thread.sleep(1000);
        } catch (InterruptedException ignored) {
        }

        try {
            channel.close();
        } catch (IOException e1) {
            e1.printStackTrace();
        }

        try {
            connection.close(1000);
        } catch (IOException e) {
            e.printStackTrace();
        }

        consumer = null;
        channel = null;
        connection = null;
    }
}

redpajama_set_name: RedPajamaGithub


text:
using System.ComponentModel;

namespace LinqAn.Google.Dimensions
{
	/// <summary>
	/// 	The name of the requested custom dimension, where 171 refers the number/index of the custom dimension.
	/// </summary>
	[Description("The name of the requested custom dimension, where 171 refers the number/index of the custom dimension.")]
	public class Dimension171: Dimension
	{
		/// <summary>
		/// 	Instantiates a <seealso cref="Dimension171" />.
		/// </summary>
		public Dimension171(): base("Custom Dimension 171",true,"ga:dimension171")
		{

		}
	}
}


text:
<?xml version="1.0" encoding="UTF-8"?>
<!--
  ~ Licensed to the Apache Software Foundation (ASF) under one or more
  ~ contributor license agreements.  See the NOTICE file distributed with
  ~ this work for additional information regarding copyright ownership.
  ~ The ASF licenses this file to You under the Apache License, Version 2.0
  ~ (the "License"); you may not use this file except in compliance with
  ~ the License.  You may obtain a copy of the License at
  ~
  ~     http://www.apache.org/licenses/LICENSE-2.0
  ~
  ~ Unless required by applicable law or agreed to in writing, software
  ~ distributed under the License is distributed on an "AS IS" BASIS,
  ~ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  ~ See the License for the specific language governing permissions and
  ~ limitations under the License.
  ~
  -->

<project xmlns="http://maven.apache.org/POM/4.0.0"
         xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
         xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
    <parent>
        <artifactId>apm-application-toolkit</artifactId>
        <groupId>org.apache.skywalking</groupId>
        <version>5.0.0-alpha-SNAPSHOT</version>
    </parent>
    <modelVersion>4.0.0</modelVersion>

    <artifactId>apm-toolkit-log4j-2.x</artifactId>

    <dependencies>
        <dependency>
            <groupId>org.apache.logging.log4j</groupId>
            <artifactId>log4j-core</artifactId>
            <version>2.7</version>
            <scope>provided</scope>
        </dependency>
    </dependencies>

    <build>
        <plugins>
            <plugin>
                <!-- 源码插件 -->
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-source-plugin</artifactId>
                <!-- 发布时自动将源码同时发布的配置 -->
                <executions>
                    <execution>
                        <id>attach-sources</id>
                        <phase>none</phase>
                        <goals>
                            <goal>jar</goal>
                        </goals>
                    </execution>
                </executions>
                <version>2.4</version>
            </plugin>
        </plugins>
    </build>

    <distributionManagement>
        <repository>
            <id>bintray-wu-sheng-sky-walking-repository</id>
            <name>wu-sheng-sky-walking-repository</name>
            <url>https://api.bintray.com/maven/wu-sheng/skywalking/org.apache.skywalking.apm-toolkit-log4j-2.x/;publish=1
            </url>
        </repository>
    </distributionManagement>
</project>


text:
/*
 * To change this license header, choose License Headers in Project Properties.
 * To change this template file, choose Tools | Templates
 * and open the template in the editor.
 */

package com.boc_eu.modaclouds.monitoring.nagios.bridge;

import it.polimi.modaclouds.monitoring.metrics_observer.MonitoringDatum;

import java.util.concurrent.ConcurrentHashMap;
import java.util.concurrent.ConcurrentMap;

import org.slf4j.Logger;
import org.slf4j.LoggerFactory;

public/**
 * @author sseycek
 */
class InMemoryMetricStore implements MetricStore
{

  private static final Logger aLog = LoggerFactory.getLogger (InMemoryMetricStore.class);

  private final ConcurrentMap <MetricKey, ObservedMetricValue> aMap = new ConcurrentHashMap <MetricKey, ObservedMetricValue> ();

  public InMemoryMetricStore ()
  {
    final MonitoringDatum aVar = new MonitoringDatum ();
    aVar.setValue ("42");
    final ObservedMetricValue aTestValue = new ObservedMetricValue ("test", "test", aVar);
    put (aTestValue);
  }

  @Override
  public void put (final ObservedMetricValue aValue)
  {
    if (null != aValue)
    {
      this.aMap.put (aValue.getKey (), aValue);
      aLog.debug ("value {} has been stored in the MetricStore", aValue.toString ());
    }
  }

  @Override
  public ObservedMetricValue get (final String sHost, final String sMetric)
  {
    return get (new MetricKey (sHost, sMetric));
  }

  public ObservedMetricValue get (final MetricKey aMetricKey)
  {
    if (null == aMetricKey)
    {
      return null;
    }
    final ObservedMetricValue aVal = this.aMap.get (aMetricKey);
    aLog.debug ("value {} has been retrieved from the MetricStore",
                null == aVal ? "(null)" : aVal.toString ());
    return aVal;
  }

}


text:
<?php

namespace Platformsh\Cli\Service;

use Platformsh\Cli\Util\NestedArrayUtil;
use Symfony\Component\Filesystem\Filesystem as SymfonyFilesystem;

/**
 * Save application state.
 */
class State
{
    protected $config;

    protected $state = [];

    protected $loaded = false;

    /**
     * @param Config $config
     */
    public function __construct(Config $config)
    {
        $this->config = $config;
    }

    /**
     * @param string $key
     *
     * @return mixed|false
     *   The value, or false if the value does not exist.
     */
    public function get($key)
    {
        $this->load();
        $value = NestedArrayUtil::getNestedArrayValue($this->state, explode('.', $key), $exists);

        return $exists ? $value : false;
    }

    /**
     * Set a state value.
     *
     * @param string $key
     * @param mixed  $value
     * @param bool   $save
     */
    public function set($key, $value, $save = true)
    {
        $this->load();
        $parents = explode('.', $key);
        $current = NestedArrayUtil::getNestedArrayValue($this->state, $parents);
        if ($current !== $value) {
            NestedArrayUtil::setNestedArrayValue($this->state, $parents, $value);
            if ($save) {
                $this->save();
            }
        }
    }

    /**
     * Save state.
     */
    public function save()
    {
        (new SymfonyFilesystem())->dumpFile(
            $this->getFilename(),
            json_encode($this->state)
        );
    }

    /**
     * Load state.
     */
    protected function load()
    {
        if (!$this->loaded) {
            $filename = $this->getFilename();
            if (file_exists($filename)) {
                $content = file_get_contents($filename);
                $this->state = json_decode($content, true) ?: [];
            }
            $this->loaded = true;
        }
    }

    /**
     * @return string
     */
    protected function getFilename()
    {
        return $this->config->getWritableUserDir() . DIRECTORY_SEPARATOR . $this->config->get('application.user_state_file');
    }
}


text:
import React from 'react';
import { shallow } from 'enzyme';

import { Meta, MessageMeta } from '..';

describe('<MessageMeta />', () => {
  let mounted = null;
  const props = {
    author: 'foo',
    id: '1',
    isConsecutive: false,
    isDeliveryFailure: false,
    isPastChat: false,
    onResend: Function.prototype,
    timestamp: '',
    translations: {
      at: 'at',
      said: 'said',
    },
  };

  beforeEach(() => {
    mounted = shallow(<MessageMeta {...props} />);
  });

  it('renders the correct markup', () => {
    expect(mounted.find(Meta).length).toBe(1);
  });

  it('renders delivery failure message', () => {
    const mockFn = jest.fn();
    mounted.setProps({ isDeliveryFailure: true, onResend: mockFn });

    const button = mounted.find('.slds-chat-message__action');
    button.simulate('click');
    expect(mockFn).toBeCalled();
    expect(mounted.find(Meta).length).toBe(1);
  });

  it('returns null if message is followed by a consecutive one', () => {
    mounted.setProps({ isConsecutive: true });
    expect(mounted.type()).toEqual(null);
  });
});


text:
Adds an AWS::EC2::EC2Fleet.FleetLaunchTemplateSpecificationRequest resource property to the template.
Specifies the launch template to use for an EC2 Fleet.
You must specify either the launch template ID or launch template name in the request.

## SYNTAX

```
Add-VSEC2EC2FleetFleetLaunchTemplateSpecificationRequest [[-LaunchTemplateName] <Object>] [[-Version] <Object>]
 [[-LaunchTemplateId] <Object>] [<CommonParameters>]
```

## DESCRIPTION
Adds an AWS::EC2::EC2Fleet.FleetLaunchTemplateSpecificationRequest resource property to the template.
Specifies the launch template to use for an EC2 Fleet.
You must specify either the launch template ID or launch template name in the request.

FleetLaunchTemplateSpecificationRequest is a property of the  FleetLaunchTemplateConfigRequest: https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-ec2-ec2fleet-fleetlaunchtemplateconfigrequest.html property type.

## PARAMETERS

### -LaunchTemplateName
The name of the launch template.
If you specify the template name, you can't specify the template ID.

Documentation: http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-ec2-ec2fleet-fleetlaunchtemplatespecificationrequest.html#cfn-ec2-ec2fleet-fleetlaunchtemplatespecificationrequest-launchtemplatename
PrimitiveType: String
UpdateType: Immutable

```yaml
Type: Object
Parameter Sets: (All)
Aliases:

Required: False
Position: 1
Default value: None
Accept pipeline input: False
Accept wildcard characters: False
```

### -Version
The launch template version number, $Latest, or $Default.
You must specify a value, otherwise the request fails.
If the value is $Latest, Amazon EC2 uses the latest version of the launch template.
If the value is $Default, Amazon EC2 uses the default version of the launch template.

Documentation: http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-ec2-ec2fleet-fleetlaunchtemplatespecificationrequest.html#cfn-ec2-ec2fleet-fleetlaunchtemplatespecificationrequest-version
PrimitiveType: String
UpdateType: Immutable

```yaml
Type: Object
Parameter Sets: (All)
Aliases:

Required: False
Position: 2
Default value: None
Accept pipeline input: False
Accept wildcard characters: False
```

### -LaunchTemplateId
The ID of the launch template.
If you specify the template ID, you can't specify the template name.

Documentation: http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-ec2-ec2fleet-fleetlaunchtemplatespecificationrequest.html#cfn-ec2-ec2fleet-fleetlaunchtemplatespecificationrequest-launchtemplateid
PrimitiveType: String
UpdateType: Immutable

```yaml
Type: Object
Parameter Sets: (All)
Aliases:

Required: False
Position: 3
Default value: None
Accept pipeline input: False
Accept wildcard characters: False
```

### CommonParameters
This cmdlet supports the common parameters: -Debug, -ErrorAction, -ErrorVariable, -InformationAction, -InformationVariable, -OutVariable, -OutBuffer, -PipelineVariable, -Verbose, -WarningAction, and -WarningVariable. For more information, see [about_CommonParameters](http://go.microsoft.com/fwlink/?LinkID=113216).

## INPUTS

## OUTPUTS

### Vaporshell.Resource.EC2.EC2Fleet.FleetLaunchTemplateSpecificationRequest
## NOTES

## RELATED LINKS

[http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-ec2-ec2fleet-fleetlaunchtemplatespecificationrequest.html](http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-ec2-ec2fleet-fleetlaunchtemplatespecificationrequest.html)


text:
/*
 * Copyright (c) 2003, 2004, Oracle and/or its affiliates. All rights reserved.
 * ORACLE PROPRIETARY/CONFIDENTIAL. Use is subject to license terms.
 *
 *
 *
 *
 *
 *
 *
 *
 *
 *
 *
 *
 *
 *
 *
 *
 *
 *
 *
 *
 */

package java.lang.annotation;

/**
 * Annotation retention policy.  The constants of this enumerated type
 * describe the various policies for retaining annotations.  They are used
 * in conjunction with the {@link Retention} meta-annotation type to specify
 * how long annotations are to be retained.
 *
 * @author  Joshua Bloch
 * @since 1.5
 */
public enum RetentionPolicy {
    /**
     * Annotations are to be discarded by the compiler.
     */
    SOURCE,

    /**
     * Annotations are to be recorded in the class file by the compiler
     * but need not be retained by the VM at run time.  This is the default
     * behavior.
     */
    CLASS,

    /**
     * Annotations are to be recorded in the class file by the compiler and
     * retained by the VM at run time, so they may be read reflectively.
     *
     * @see java.lang.reflect.AnnotatedElement
     */
    RUNTIME
}


text:
var ServersController = function() {
};

ServersController.$inject = [];
module.exports = ServersController;


text:
class CreateClinics < ActiveRecord::Migration[5.0]
  def change
    create_table :clinics do |t|
      t.string :name

      t.timestamps
    end
  end
end


text: $().size() returns the number of elements in the collection.  This is the same as $().length;


text:
#region LGPL License

#endregion

#region SVN Version Information

// <file>
//     <license see="http://axiom3d.net/wiki/index.php/license.txt"/>
//     <id value="$Id: Matrix3.cs 2940 2012-01-05 12:25:58Z borrillis $"/>
// </file>

#endregion SVN Version Information

#region Namespace Declarations

using System;
using System.Diagnostics;
using System.Runtime.InteropServices;
using System.Text;

#endregion Namespace Declarations

// NOTE.  The (x,y,z) coordinate system is assumed to be right-handed.
// Coordinate axis rotation matrices are of the form
//   RX =    1       0       0
//           0     cos(t) -sin(t)
//           0     sin(t)  cos(t)
// where t > 0 indicates a counterclockwise rotation in the yz-plane
//   RY =  cos(t)    0     sin(t)
//           0       1       0
//        -sin(t)    0     cos(t)
// where t > 0 indicates a counterclockwise rotation in the zx-plane
//   RZ =  cos(t) -sin(t)    0
//         sin(t)  cos(t)    0
//           0       0       1
// where t > 0 indicates a counterclockwise rotation in the xy-plane.

namespace Axiom.Math
{
	/// <summary>
	/// A 3x3 matrix which can represent rotations around axes.
	/// </summary>
	[StructLayout( LayoutKind.Sequential )]
	public struct Matrix3
	{
		#region Member variables and constants

		/// <summary>
		///
		/// </summary>
		public Real m00, m01, m02;

		public Real m10, m11, m12;
		public Real m20, m21, m22;

		private static readonly Matrix3 identityMatrix = new Matrix3( 1, 0, 0,
		                                                              0, 1, 0,
		                                                              0, 0, 1 );

		private static readonly Matrix3 zeroMatrix = new Matrix3( 0, 0, 0,
		                                                          0, 0, 0,
		                                                          0, 0, 0 );

		#endregion

		#region Constructors

		/// <summary>
		///		Creates a new Matrix3 with all the specified parameters.
		/// </summary>
		public Matrix3( Real m00, Real m01, Real m02,
		                Real m10, Real m11, Real m12,
		                Real m20, Real m21, Real m22 )
		{
			this.m00 = m00;
			this.m01 = m01;
			this.m02 = m02;
			this.m10 = m10;
			this.m11 = m11;
			this.m12 = m12;
			this.m20 = m20;
			this.m21 = m21;
			this.m22 = m22;
		}

		/// <summary>
		/// Create a new Matrix from 3 Vertex3 objects.
		/// </summary>
		/// <param name="xAxis"></param>
		/// <param name="yAxis"></param>
		/// <param name="zAxis"></param>
		public Matrix3( Vector3 xAxis, Vector3 yAxis, Vector3 zAxis )
		{
			m00 = xAxis.x;
			m01 = yAxis.x;
			m02 = zAxis.x;
			m10 = xAxis.y;
			m11 = yAxis.y;
			m12 = zAxis.y;
			m20 = xAxis.z;
			m21 = yAxis.z;
			m22 = zAxis.z;
		}

		#endregion

		#region Static properties

		/// <summary>
		/// Identity Matrix
		/// </summary>
		public static Matrix3 Identity { get { return identityMatrix; } }

		/// <summary>
		/// Zero matrix.
		/// </summary>
		public static Matrix3 Zero { get { return zeroMatrix; } }

		#endregion

		#region Public methods

		/// <summary>
		/// Swap the rows of the matrix with the columns.
		/// </summary>
		/// <returns>A transposed Matrix.</returns>
		public Matrix3 Transpose()
		{
			return new Matrix3( m00, m10, m20,
			                    m01, m11, m21,
			                    m02, m12, m22 );
		}

		/// <summary>
		///		Gets a matrix column by index.
		/// </summary>
		/// <param name="col"></param>
		/// <returns>A Vector3 representing one of the Matrix columns.</returns>
		public Vector3 GetColumn( int col )
		{
			Debug.Assert( col >= 0 && col < 3, "Attempt to retreive a column of a Matrix3 greater than 2." );

			unsafe
			{
				fixed( Real* pM = &m00 )
				{
					return new Vector3( *( pM + col ), //m[0,col],
					                    *( pM + 3 + col ), //m[1,col],
					                    *( pM + 6 + col ) ); //m[2,col]);
				}
			}
		}

		/// <summary>
		///		Sets one of the columns of the Matrix with a Vector3.
		/// </summary>
		/// <param name="col"></param>
		/// <param name="vector"></param>
		/// <returns></returns>
		public void SetColumn( int col, Vector3 vector )
		{
			Debug.Assert( col >= 0 && col < 3, "Attempt to set a column of a Matrix3 greater than 2." );

			this[ 0, col ] = vector.x;
			this[ 1, col ] = vector.y;
			this[ 2, col ] = vector.z;
		}

		/// <summary>
		///		Creates a Matrix3 from 3 axes.
		/// </summary>
		/// <param name="xAxis"></param>
		/// <param name="yAxis"></param>
		/// <param name="zAxis"></param>
		public void FromAxes( Vector3 xAxis, Vector3 yAxis, Vector3 zAxis )
		{
			SetColumn( 0, xAxis );
			SetColumn( 1, yAxis );
			SetColumn( 2, zAxis );
		}

		/// <summary>
		///    Constructs this Matrix from 3 euler angles, in degrees.
		/// </summary>
		/// <param name="yaw"></param>
		/// <param name="pitch"></param>
		/// <param name="roll"></param>
		public void FromEulerAnglesXYZ( Real yaw, Real pitch, Real roll )
		{
			Real cos = Utility.Cos( yaw );
			Real sin = Utility.Sin( yaw );
			Matrix3 xMat = new Matrix3( 1, 0, 0, 0, cos, -sin, 0, sin, cos );

			cos = Utility.Cos( pitch );
			sin = Utility.Sin( pitch );
			Matrix3 yMat = new Matrix3( cos, 0, sin, 0, 1, 0, -sin, 0, cos );

			cos = Utility.Cos( roll );
			sin = Utility.Sin( roll );
			Matrix3 zMat = new Matrix3( cos, -sin, 0, sin, cos, 0, 0, 0, 1 );

			this = xMat * ( yMat * zMat );
		}

		public Vector3 ToEulerAnglesXYZ()
		{
			Real yAngle;
			Real rAngle;
			Real pAngle;

			pAngle = Utility.ASin( m01 );
			if( pAngle < Utility.PI / 2 )
			{
				if( pAngle > -Utility.PI / 2 )
				{
					yAngle = Utility.ATan2( m21, m11 );
					rAngle = Utility.ATan2( m02, m00 );
				}
				else
				{
					// WARNING. Not a unique solution.
					Real fRmY = (Real)Utility.ATan2( -m20, m22 );
					rAngle = 0.0f; // any angle works
					yAngle = rAngle - fRmY;
				}
			}
			else
			{
				// WARNING. Not a unique solution.
				Real fRpY = Utility.ATan2( -m20, m22 );
				rAngle = 0.0f; // any angle works
				yAngle = fRpY - rAngle;
			}

			return new Vector3( yAngle, rAngle, pAngle );
		}

		#endregion

		#region Operator overloads + CLS complient method equivalents

		/// <summary>
		/// Multiply (concatenate) two Matrix3 instances together.
		/// </summary>
		/// <param name="left"></param>
		/// <param name="right"></param>
		/// <returns></returns>
		public static Matrix3 Multiply( Matrix3 left, Matrix3 right )
		{
			return left * right;
		}

		/// <summary>
		/// Multiply (concatenate) two Matrix3 instances together.
		/// </summary>
		/// <param name="left"></param>
		/// <param name="right"></param>
		/// <returns></returns>
		public static Matrix3 operator *( Matrix3 left, Matrix3 right )
		{
			Matrix3 result = new Matrix3();

			result.m00 = left.m00 * right.m00 + left.m01 * right.m10 + left.m02 * right.m20;
			result.m01 = left.m00 * right.m01 + left.m01 * right.m11 + left.m02 * right.m21;
			result.m02 = left.m00 * right.m02 + left.m01 * right.m12 + left.m02 * right.m22;

			result.m10 = left.m10 * right.m00 + left.m11 * right.m10 + left.m12 * right.m20;
			result.m11 = left.m10 * right.m01 + left.m11 * right.m11 + left.m12 * right.m21;
			result.m12 = left.m10 * right.m02 + left.m11 * right.m12 + left.m12 * right.m22;

			result.m20 = left.m20 * right.m00 + left.m21 * right.m10 + left.m22 * right.m20;
			result.m21 = left.m20 * right.m01 + left.m21 * right.m11 + left.m22 * right.m21;
			result.m22 = left.m20 * right.m02 + left.m21 * right.m12 + left.m22 * right.m22;

			return result;
		}

		/// <summary>
		///		vector * matrix [1x3 * 3x3 = 1x3]
		/// </summary>
		/// <param name="vector"></param>
		/// <param name="matrix"></param>
		/// <returns></returns>
		public static Vector3 Multiply( Vector3 vector, Matrix3 matrix )
		{
			return vector * matrix;
		}

		/// <summary>
		///		vector * matrix [1x3 * 3x3 = 1x3]
		/// </summary>
		/// <param name="vector"></param>
		/// <param name="matrix"></param>
		/// <returns></returns>
		public static Vector3 operator *( Vector3 vector, Matrix3 matrix )
		{
			Vector3 product = new Vector3();

			product.x = matrix.m00 * vector.x + matrix.m01 * vector.y + matrix.m02 * vector.z;
			product.y = matrix.m10 * vector.x + matrix.m11 * vector.y + matrix.m12 * vector.z;
			product.z = matrix.m20 * vector.x + matrix.m21 * vector.y + matrix.m22 * vector.z;

			return product;
		}

		/// <summary>
		///		matrix * vector [3x3 * 3x1 = 3x1]
		/// </summary>
		/// <param name="vector"></param>
		/// <param name="matrix"></param>
		/// <returns></returns>
		public static Vector3 Multiply( Matrix3 matrix, Vector3 vector )
		{
			return matrix * vector;
		}

		/// <summary>
		///		matrix * vector [3x3 * 3x1 = 3x1]
		/// </summary>
		/// <param name="vector"></param>
		/// <param name="matrix"></param>
		/// <returns></returns>
		public static Vector3 operator *( Matrix3 matrix, Vector3 vector )
		{
			Vector3 product = new Vector3();

			product.x = matrix.m00 * vector.x + matrix.m01 * vector.y + matrix.m02 * vector.z;
			product.y = matrix.m10 * vector.x + matrix.m11 * vector.y + matrix.m12 * vector.z;
			product.z = matrix.m20 * vector.x + matrix.m21 * vector.y + matrix.m22 * vector.z;

			return product;
		}

		/// <summary>
		/// Multiplies all the items in the Matrix3 by a scalar value.
		/// </summary>
		/// <param name="matrix"></param>
		/// <param name="scalar"></param>
		/// <returns></returns>
		public static Matrix3 Multiply( Matrix3 matrix, Real scalar )
		{
			return matrix * scalar;
		}

		/// <summary>
		/// Multiplies all the items in the Matrix3 by a scalar value.
		/// </summary>
		/// <param name="matrix"></param>
		/// <param name="scalar"></param>
		/// <returns></returns>
		public static Matrix3 operator *( Matrix3 matrix, Real scalar )
		{
			Matrix3 result = new Matrix3();

			result.m00 = matrix.m00 * scalar;
			result.m01 = matrix.m01 * scalar;
			result.m02 = matrix.m02 * scalar;
			result.m10 = matrix.m10 * scalar;
			result.m11 = matrix.m11 * scalar;
			result.m12 = matrix.m12 * scalar;
			result.m20 = matrix.m20 * scalar;
			result.m21 = matrix.m21 * scalar;
			result.m22 = matrix.m22 * scalar;

			return result;
		}

		/// <summary>
		/// Multiplies all the items in the Matrix3 by a scalar value.
		/// </summary>
		/// <param name="matrix"></param>
		/// <param name="scalar"></param>
		/// <returns></returns>
		public static Matrix3 Multiply( Real scalar, Matrix3 matrix )
		{
			return scalar * matrix;
		}

		/// <summary>
		/// Multiplies all the items in the Matrix3 by a scalar value.
		/// </summary>
		/// <param name="matrix"></param>
		/// <param name="scalar"></param>
		/// <returns></returns>
		public static Matrix3 operator *( Real scalar, Matrix3 matrix )
		{
			Matrix3 result = new Matrix3();

			result.m00 = matrix.m00 * scalar;
			result.m01 = matrix.m01 * scalar;
			result.m02 = matrix.m02 * scalar;
			result.m10 = matrix.m10 * scalar;
			result.m11 = matrix.m11 * scalar;
			result.m12 = matrix.m12 * scalar;
			result.m20 = matrix.m20 * scalar;
			result.m21 = matrix.m21 * scalar;
			result.m22 = matrix.m22 * scalar;

			return result;
		}

		/// <summary>
		///		Used to add two matrices together.
		/// </summary>
		/// <param name="left"></param>
		/// <param name="right"></param>
		/// <returns></returns>
		public static Matrix3 Add( Matrix3 left, Matrix3 right )
		{
			return left + right;
		}

		/// <summary>
		///		Used to add two matrices together.
		/// </summary>
		/// <param name="left"></param>
		/// <param name="right"></param>
		/// <returns></returns>
		public static Matrix3 operator +( Matrix3 left, Matrix3 right )
		{
			Matrix3 result = new Matrix3();

			for( int row = 0; row < 3; row++ )
			{
				for( int col = 0; col < 3; col++ )
				{
					result[ row, col ] = left[ row, col ] + right[ row, col ];
				}
			}

			return result;
		}

		/// <summary>
		///		Used to subtract two matrices.
		/// </summary>
		/// <param name="left"></param>
		/// <param name="right"></param>
		/// <returns></returns>
		public static Matrix3 Subtract( Matrix3 left, Matrix3 right )
		{
			return left - right;
		}

		/// <summary>
		///		Used to subtract two matrices.
		/// </summary>
		/// <param name="left"></param>
		/// <param name="right"></param>
		/// <returns></returns>
		public static Matrix3 operator -( Matrix3 left, Matrix3 right )
		{
			Matrix3 result = new Matrix3();

			for( int row = 0; row < 3; row++ )
			{
				for( int col = 0; col < 3; col++ )
				{
					result[ row, col ] = left[ row, col ] - right[ row, col ];
				}
			}

			return result;
		}

		/// <summary>
		/// Negates all the items in the Matrix.
		/// </summary>
		/// <param name="matrix"></param>
		/// <returns></returns>
		public static Matrix3 Negate( Matrix3 matrix )
		{
			return -matrix;
		}

		/// <summary>
		/// Negates all the items in the Matrix.
		/// </summary>
		/// <param name="matrix"></param>
		/// <returns></returns>
		public static Matrix3 operator -( Matrix3 matrix )
		{
			Matrix3 result = new Matrix3();

			result.m00 = -matrix.m00;
			result.m01 = -matrix.m01;
			result.m02 = -matrix.m02;
			result.m10 = -matrix.m10;
			result.m11 = -matrix.m11;
			result.m12 = -matrix.m12;
			result.m20 = -matrix.m20;
			result.m21 = -matrix.m21;
			result.m22 = -matrix.m22;

			return result;
		}

		/// <summary>
		/// 	Test two matrices for (value) equality
		/// </summary>
		/// <param name="left"></param>
		/// <param name="right"></param>
		/// <returns></returns>
		public static bool operator ==( Matrix3 left, Matrix3 right )
		{
			if(
				left.m00 == right.m00 && left.m01 == right.m01 && left.m02 == right.m02 &&
				left.m10 == right.m10 && left.m11 == right.m11 && left.m12 == right.m12 &&
				left.m20 == right.m20 && left.m21 == right.m21 && left.m22 == right.m22 )
			{
				return true;
			}

			return false;
		}

		public static bool operator !=( Matrix3 left, Matrix3 right )
		{
			return !( left == right );
		}

		/// <summary>
		/// Indexer for accessing the matrix like a 2d array (i.e. matrix[2,3]).
		/// </summary>
		public Real this[ int row, int col ]
		{
			get
			{
				//Debug.Assert((row >= 0 && row < 3) && (col >= 0 && col < 3), "Attempt to access Matrix3 indexer out of bounds.");

				unsafe
				{
					fixed( Real* pM = &m00 )
					{
						return *( pM + ( ( 3 * row ) + col ) );
					}
				}
			}
			set
			{
				//Debug.Assert((row >= 0 && row < 3) && (col >= 0 && col < 3), "Attempt to access Matrix3 indexer out of bounds.");

				unsafe
				{
					fixed( Real* pM = &m00 )
					{
						*( pM + ( ( 3 * row ) + col ) ) = value;
					}
				}
			}
		}

		/// <summary>
		///		Allows the Matrix to be accessed linearly (m[0] -> m[8]).
		/// </summary>
		public Real this[ int index ]
		{
			get
			{
				//Debug.Assert(index >= 0 && index <= 8, "Attempt to access Matrix4 linear indexer out of bounds.");

				unsafe
				{
					fixed( Real* pMatrix = &m00 )
					{
						return *( pMatrix + index );
					}
				}
			}
			set
			{
				//Debug.Assert(index >= 0 && index <= 8, "Attempt to access Matrix4 linear indexer out of bounds.");

				unsafe
				{
					fixed( Real* pMatrix = &m00 )
					{
						*( pMatrix + index ) = value;
					}
				}
			}
		}

		#endregion

		#region Properties

		public Real Determinant
		{
			get
			{
				Real cofactor00 = m11 * m22 - m12 * m21;
				Real cofactor10 = m12 * m20 - m10 * m22;
				Real cofactor20 = m10 * m21 - m11 * m20;

				Real result =
					m00 * cofactor00 +
					m01 * cofactor10 +
					m02 * cofactor20;

				return result;
			}
		}

		#endregion Properties

		#region Object overloads

		/// <summary>
		///		Overrides the Object.ToString() method to provide a text representation of
		///		a Matrix4.
		/// </summary>
		/// <returns>A string representation of a vector3.</returns>
		public override string ToString()
		{
			StringBuilder builder = new StringBuilder();

			builder.AppendFormat( " | {0} {1} {2} |\n", m00, m01, m02 );
			builder.AppendFormat( " | {0} {1} {2} |\n", m10, m11, m12 );
			builder.AppendFormat( " | {0} {1} {2} |", m20, m21, m22 );

			return builder.ToString();
		}

		/// <summary>
		///		Provides a unique hash code based on the member variables of this
		///		class.  This should be done because the equality operators (==, !=)
		///		have been overriden by this class.
		///		<p/>
		///		The standard implementation is a simple XOR operation between all local
		///		member variables.
		/// </summary>
		/// <returns></returns>
		public override int GetHashCode()
		{
			int hashCode = 0;

			unsafe
			{
				fixed( Real* pM = &m00 )
				{
					for( int i = 0; i < 9; i++ )
					{
						hashCode ^= (int)( *( pM + i ) );
					}
				}

				return hashCode;
			}
		}

		/// <summary>
		///		Compares this Matrix to another object.  This should be done because the
		///		equality operators (==, !=) have been overriden by this class.
		/// </summary>
		/// <param name="obj"></param>
		/// <returns></returns>
		public override bool Equals( object obj )
		{
			return obj is Matrix3 && this == (Matrix3)obj;
		}

		#endregion
	}
}


text:
namespace Envoy {
namespace Extensions {
namespace HttpFilters {
namespace ExternalProcessing {

class MockClient : public ExternalProcessorClient {
public:
  MockClient();
  ~MockClient() override;
  MOCK_METHOD(ExternalProcessorStreamPtr, start,
              (ExternalProcessorCallbacks&, const StreamInfo::StreamInfo& stream_info));
};

class MockStream : public ExternalProcessorStream {
public:
  MockStream();
  ~MockStream() override;
  MOCK_METHOD(void, send, (envoy::service::ext_proc::v3::ProcessingRequest&&, bool));
  MOCK_METHOD(bool, close, ());
};

} // namespace ExternalProcessing
} // namespace HttpFilters
} // namespace Extensions
} // namespace Envoy


text:
using EntityFrameworkExtras.Tests.Integration.StoredProcedures;
using NUnit.Framework;

namespace EntityFrameworkExtras.Tests.Integration
{
    [TestFixture]
    public class ParameterFloatTests : DatabaseIntegrationTests
    {

        [Test]
        public void Parameter_Execute_NoErrors()
        {
            var procedure = new AllTypesStoredProcedure();

            procedure.ParameterFloat = 653;

            Assert.DoesNotThrow(() => ExecuteStoredProcedure(procedure));
        }

        [Test]
        public void Parameter_ExecuteAsNull_NoErrors()
        {
            var procedure = new AllTypesStoredProcedure();
            procedure.ParameterFloat = null;

            Assert.DoesNotThrow(() => ExecuteStoredProcedure(procedure));
        }

        [Test]
        public void Parameter_Execute_CorrectValueSet()
        {
            var procedure = new AllTypesStoredProcedure();
            procedure.ParameterFloat = 349d;

            var result = ExecuteStoredProcedureSingle<AllTypesStoredProcedureReturn>(procedure);

            Assert.AreEqual(349d, result.ParameterFloat);
        }

    }
}


text:
"""
Broadcaster static transform
"""

import sys
import os
import yaml

def main():
    """Main function.

    Reading transform info from a yaml file and publish to tf2
    """
    if len(sys.argv) == 1:
        print "error: no extrinsics yaml file given"
        print "usage: python extrinsics_broadcaster.py extrinsic_example.yaml"
        return

    file_path = open(sys.argv[1])
    transform_stamped = yaml.safe_load(file_path)
    command = 'rosrun tf2_ros static_transform_publisher '\
        '%f %f %f %f %f %f %f %s %s' % (transform_stamped['transform']['translation']['x'],
                                        transform_stamped['transform']['translation']['y'],
                                        transform_stamped['transform']['translation']['z'],
                                        transform_stamped['transform']['rotation']['x'],
                                        transform_stamped['transform']['rotation']['y'],
                                        transform_stamped['transform']['rotation']['z'],
                                        transform_stamped['transform']['rotation']['w'],
                                        transform_stamped['header']['frame_id'],
                                        transform_stamped['child_frame_id'])

    print command
    ret = os.system(command)
    print ret

if __name__ == "__main__":
    main()


text:
import rospy
import os
import xml.etree.ElementTree as ET
from rospkg import RosPack
from flexbe_core import EventState, Logger

'''
Created on 18.06.2016

@author: Philipp Schillinger
'''

class GetJointsFromSrdfState(EventState):
	'''
	Simple state to look up a pre-defined joint configuration from the given SRDF file.
	This state is recommended if you only need these values without any unnecessary overhead.

	-- config_name 	string 		Name of the joint configuration of interest.
	-- srdf_file	string		Package-relative path to the SRDF file,
								e.g., "my_moveit_config/config/my_robot.srdf"
	-- move_group 	string 		Optional move group name to which the config refers.
								If left empty, the first one found will be used
								(only required if several groups use the same configs).
	-- robot_name 	string 		Optional name of the robot to be used.
								If left empty, the first one found will be used
								(only required if multiple robots are specified in the same file).

	#> joint_values float[] 	List of joint values for the requested config.

	<= retrieved 				Joint values are available.
	<= file_error 				Something went wrong when accessing the SRDF file.

	'''

	def __init__(self, config_name, srdf_file, move_group = "", robot_name = ""):
		'''
		Constructor
		'''
		super(GetJointsFromSrdfState, self).__init__(outcomes=['retrieved', 'file_error'],
												output_keys=['joint_values'])

		self._config_name = config_name
		self._move_group = move_group
		self._robot_name = robot_name

		# Check existence of SRDF file to reduce risk of runtime failure.
		# Anyways, values will only be read during runtime to allow modifications.
		self._srdf_path = None
		try:
			rp = RosPack()
			pkg_name = srdf_file.split('/')[0]
			self._srdf_path = os.path.join(rp.get_path(pkg_name), '/'.join(srdf_file.split('/')[1:]))
			if not os.path.isfile(self._srdf_path):
				raise IOError('File "%s" does not exist!' % self._srdf_path)
		except Exception as e:
			Logger.logwarn('Unable to find given SRDF file: %s\n%s' % (srdf_file, str(e)))

		self._file_error = False
		self._srdf = None

	def execute(self, userdata):
		if self._file_error:
			return 'file_error'
		found_other = False

		robot = None
		for r in self._srdf.iter('robot'):
			if self._robot_name == '' or self._robot_name == r.attrib['name']:
				robot = r
				break
		if robot is None:
			Logger.logwarn('Did not find robot name in SRDF: %s' % self._robot_name)
			return 'file_error'

		config = None
		for c in robot.iter('group_state'):
			if (self._move_group == '' or self._move_group == c.attrib['group']) \
			and c.attrib['name'] == self._config_name:
				config = c
				break
		if config is None:
			Logger.logwarn('Did not find config name in SRDF: %s' % self._config_name)
			return 'file_error'

		try:
			userdata.joint_values = [float(j.attrib['value']) for j in config.iter('joint')]
		except Exception as e:
			Logger.logwarn('Unable to parse joint values from SRDF:\n%s' % str(e))
			return 'file_error'

		return 'retrieved'

	def on_enter(self, userdata):
		self._file_error = False
		if self._srdf_path is None:
			self._file_error = True
			return

		try:
			self._srdf = ET.parse(self._srdf_path).getroot()
		except Exception as e:
			Logger.logwarn('Unable to parse given SRDF file: %s\n%s' % (self._srdf_path, str(e)))
			self._file_error = True


text:
@implementation HYBBaseViewController

- (instancetype)initWithTitle:(NSString *)title {
  if (self = [super init]) {
    self.title = title;
  }

  return self;
}

- (void)viewDidLoad {
  [super viewDidLoad];

  self.view.backgroundColor = [UIColor whiteColor];
  self.edgesForExtendedLayout = UIRectEdgeNone;
}

@end


text:
package com.evolveum.midpoint.repo.sql.query.definition;

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

/**
 * Denotes method that is used to access the container parent ID.
 *
 * @author mederly
 */
@Target({ElementType.METHOD})
@Retention(RetentionPolicy.RUNTIME)
public @interface OwnerIdGetter {

}


text:
import React from 'react';
import PropTypes from 'prop-types';

export class TrackDirCategoryView extends React.Component {
  is_visible() {
    const { cat, visible } = this.props;
    if (!visible || !visible[cat.key]) {
      return 'none';
    }
    return visible[cat.key].visible ? 'block' : 'none';
  }
  section_link() {
    var me = this;
    const { cat, current_section } = me.props;
    const cl = current_section === cat.section ? 'is-current' : '';
    return (

        {cat.name}

    );
  }
  directory() {
    const me = this;
    const { cat, visible, toggle_visible, current_section } = me.props;
    return (

           toggle_visible(cat)}>{cat.name}

            {cat.items.map(subcat => (
              <TrackDirCategoryView
                cat={subcat}
                key={subcat.key || subcat.section}
                visible={visible}
                toggle_visible={toggle_visible}
                current_section={current_section}
              />
            ))}

    );
  }
  render() {
    const me = this;
    const { cat } = me.props;
    if (cat.section) {
      return me.section_link();
    } else {
      return me.directory();
    }
  }
}

TrackDirCategoryView.propTypes = {
  cat: PropTypes.object,
  visible: PropTypes.object,
  current_section: PropTypes.string,
  toggle_visible: PropTypes.func
};

export default TrackDirCategoryView;


text:
#include "hip/hcc_detail/grid_launch_GGL.hpp"

#if __hcc_workweek__ >= 17481
#include "functional_grid_launch.inl"
#else
#include "macro_based_grid_launch.inl"
#endif


text:
'use strict';

const boom = require ('boom'),
	auditModel = require ('../models/audit');

module.exports = [{
	method: 'GET',
	path: '/audit/',
	config: {
		auth: {
			strategy: 'jwt',
			scope: [ 'ROLE_ADMIN' ]
		},
		description: 'Search Audit Log Entries',
		notes: 'Searches for audit log entries by date and optionally, event type or username',
		tags: [ 'api', 'log' ],
		validate: {
			query: auditModel.search
		},
		plugins: {
			'hapi-swaggered': {
				responses: {
					200: {
						description: 'Success',
						schema: auditModel.auditEntry
					},
					403: { description: 'Forbidden' },
					500: { description: 'Internal Server Error' }
				}
			}
		},
		handler (request, reply) {
			const audit = request.server.plugins [ 'hapi-mongodb' ].db.collection ('audit');
			var query = {
				$and: [
					{ timestamp: { $gte: request.query.from.getTime () }},
					{ timestamp: { $lte: request.query.to.getTime () }}
				]
			};

			request.server.methods.search (audit, request.query, [ 'event' ], query).then (logs => {
				request.server.methods.audit ('access', { id: request.auth.credentials._id, username: request.auth.credentials.username }, 'success', 'audit', request.query);
				reply (logs.values).code (200).header ('X-Total-Count', logs.count);
			}).catch (() => {
				request.server.methods.audit ('access', { id: request.auth.credentials._id, username: request.auth.credentials.username }, 'failure', 'audit', request.query);
				reply (boom.badImplementation ());
			});
		}
	}
}];


text:
namespace ROCKSDB_NAMESPACE {

class Arena;

// A wrapper iterator which wraps DB Iterator and the arena, with which the DB
// iterator is supposed to be allocated. This class is used as an entry point of
// a iterator hierarchy whose memory can be allocated inline. In that way,
// accessing the iterator tree can be more cache friendly. It is also faster
// to allocate.
// When using the class's Iterator interface, the behavior is exactly
// the same as the inner DBIter.
class ArenaWrappedDBIter : public Iterator {
 public:
  virtual ~ArenaWrappedDBIter() { db_iter_->~DBIter(); }

  // Get the arena to be used to allocate memory for DBIter to be wrapped,
  // as well as child iterators in it.
  virtual Arena* GetArena() { return &arena_; }
  virtual ReadRangeDelAggregator* GetRangeDelAggregator() {
    return db_iter_->GetRangeDelAggregator();
  }

  // Set the internal iterator wrapped inside the DB Iterator. Usually it is
  // a merging iterator.
  virtual void SetIterUnderDBIter(InternalIterator* iter) {
    db_iter_->SetIter(iter);
  }

  bool Valid() const override { return db_iter_->Valid(); }
  void SeekToFirst() override { db_iter_->SeekToFirst(); }
  void SeekToLast() override { db_iter_->SeekToLast(); }
  // 'target' does not contain timestamp, even if user timestamp feature is
  // enabled.
  void Seek(const Slice& target) override { db_iter_->Seek(target); }
  void SeekForPrev(const Slice& target) override {
    db_iter_->SeekForPrev(target);
  }
  void Next() override { db_iter_->Next(); }
  void Prev() override { db_iter_->Prev(); }
  Slice key() const override { return db_iter_->key(); }
  Slice value() const override { return db_iter_->value(); }
  Status status() const override { return db_iter_->status(); }
  Slice timestamp() const override { return db_iter_->timestamp(); }
  bool IsBlob() const { return db_iter_->IsBlob(); }

  Status GetProperty(std::string prop_name, std::string* prop) override;

  Status Refresh() override;

  void Init(Env* env, const ReadOptions& read_options,
            const ImmutableCFOptions& cf_options,
            const MutableCFOptions& mutable_cf_options,
            const SequenceNumber& sequence,
            uint64_t max_sequential_skip_in_iterations, uint64_t version_number,
            ReadCallback* read_callback, DBImpl* db_impl, ColumnFamilyData* cfd,
            bool allow_blob, bool allow_refresh);

  // Store some parameters so we can refresh the iterator at a later point
  // with these same params
  void StoreRefreshInfo(const ReadOptions& read_options, DBImpl* db_impl,
                        ColumnFamilyData* cfd, ReadCallback* read_callback,
                        bool allow_blob) {
    read_options_ = read_options;
    db_impl_ = db_impl;
    cfd_ = cfd;
    read_callback_ = read_callback;
    allow_blob_ = allow_blob;
  }

 private:
  DBIter* db_iter_;
  Arena arena_;
  uint64_t sv_number_;
  ColumnFamilyData* cfd_ = nullptr;
  DBImpl* db_impl_ = nullptr;
  ReadOptions read_options_;
  ReadCallback* read_callback_;
  bool allow_blob_ = false;
  bool allow_refresh_ = true;
};

// Generate the arena wrapped iterator class.
// `db_impl` and `cfd` are used for reneweal. If left null, renewal will not
// be supported.
extern ArenaWrappedDBIter* NewArenaWrappedDbIterator(
    Env* env, const ReadOptions& read_options,
    const ImmutableCFOptions& cf_options,
    const MutableCFOptions& mutable_cf_options, const SequenceNumber& sequence,
    uint64_t max_sequential_skip_in_iterations, uint64_t version_number,
    ReadCallback* read_callback, DBImpl* db_impl = nullptr,
    ColumnFamilyData* cfd = nullptr, bool allow_blob = false,
    bool allow_refresh = true);
}  // namespace ROCKSDB_NAMESPACE


text:
package org.displaytag.model;

import java.io.UnsupportedEncodingException;
import java.net.URLEncoder;
import java.util.Objects;

import org.apache.commons.lang3.StringUtils;
import org.apache.commons.lang3.builder.ToStringBuilder;
import org.apache.commons.lang3.builder.ToStringStyle;
import org.displaytag.decorator.DisplaytagColumnDecorator;
import org.displaytag.exception.DecoratorException;
import org.displaytag.exception.ObjectLookupException;
import org.displaytag.util.Anchor;
import org.displaytag.util.Href;
import org.displaytag.util.HtmlAttributeMap;
import org.displaytag.util.HtmlTagUtil;
import org.displaytag.util.LookupUtil;
import org.displaytag.util.TagConstants;

/**
 * Represents a column in a table.
 *
 * @author Fabrizio Giustina
 *
 * @version $Revision$ ($Author$)
 */
public class Column {

    /**
     * Row this column belongs to.
     */
    private final Row row;

    /**
     * Header of this column. The header cell contains all the attributes common to all cells in the same column
     */
    private final HeaderCell header;

    /**
     * copy of the attribute map from the header cell. Needed to change attributes (title) in this cell only
     */
    private HtmlAttributeMap htmlAttributes;

    /**
     * contains the evaluated body value. Filled in getOpenTag.
     */
    private String stringValue;

    /**
     * Cell.
     */
    private final Cell cell;

    /**
     * Constructor for Column.
     *
     * @param headerCell
     *            HeaderCell
     * @param currentCell
     *            Cell
     * @param parentRow
     *            Row
     */
    public Column(final HeaderCell headerCell, final Cell currentCell, final Row parentRow) {
        this.header = headerCell;
        this.row = parentRow;
        this.cell = currentCell;

        // also copy html attributes
        this.htmlAttributes = headerCell.getHtmlAttributes();
    }

    /**
     * Get the header cell for this column.
     *
     * @return the cell
     */
    public HeaderCell getHeaderCell() {
        return this.header;
    }

    /**
     * Gets the value, after calling the table / column decorator is requested.
     *
     * @param decorated
     *            boolean
     *
     * @return Object will never be null if ShowNulls has been set to false
     *
     * @throws ObjectLookupException
     *             for errors in bean property lookup
     * @throws DecoratorException
     *             if a column decorator is used and an exception is thrown during value decoration
     */
    public Object getValue(final boolean decorated) throws ObjectLookupException, DecoratorException {

        Object object = null;

        // a static value has been set?
        if (this.cell.getStaticValue() != null) {
            object = this.cell.getStaticValue();
        } else if (this.header.getBeanPropertyName() != null) {

            // if a decorator has been set, and if decorator has a getter for the requested property only, check
            // decorator
            if (decorated && this.row.getParentTable().getTableDecorator() != null
                    && this.row.getParentTable().getTableDecorator().hasGetterFor(this.header.getBeanPropertyName())) {

                object = LookupUtil.getBeanProperty(this.row.getParentTable().getTableDecorator(),
                        this.header.getBeanPropertyName());
            } else {
                // else check underlining object
                object = LookupUtil.getBeanProperty(this.row.getObject(), this.header.getBeanPropertyName());
            }
        }

        final DisplaytagColumnDecorator[] decorators = this.header.getColumnDecorators();
        if (decorated) {
            for (final DisplaytagColumnDecorator decorator : decorators) {
                object = decorator.decorate(object, this.row.getParentTable().getPageContext(),
                        this.row.getParentTable().getMedia());
            }
        }

        if ((object == null || "null".equals(object)) && !this.header.getShowNulls()) {
            object = TagConstants.EMPTY_STRING;
        }

        return object;
    }

    /**
     * Generates the cell open tag.
     *
     * @return String td open tag
     */
    public String getOpenTag() {
        final HtmlAttributeMap rowAttributes = this.cell.getPerRowAttributes();

        HtmlAttributeMap atts = this.htmlAttributes;
        if (rowAttributes != null) {
            atts = (HtmlAttributeMap) atts.clone();
            atts.putAll(rowAttributes);
        }
        return HtmlTagUtil.createOpenTagString(TagConstants.TAGNAME_COLUMN, atts);
    }

    /**
     * Initialize the cell value.
     *
     * @throws DecoratorException
     *             the decorator exception
     * @throws ObjectLookupException
     *             the object lookup exception
     */
    public void initialize() throws DecoratorException, ObjectLookupException {
        if (this.stringValue == null) {
            this.stringValue = this.createChoppedAndLinkedValue();
        }
    }

    /**
     * Generates the cell close tag (</td>).
     *
     * @return String td closing tag
     */
    public String getCloseTag() {
        this.stringValue = null;
        return this.header.getCloseTag();
    }

    /**
     * Calculates the cell content, cropping or linking the value as needed.
     *
     * @return String
     *
     * @throws ObjectLookupException
     *             for errors in bean property lookup
     * @throws DecoratorException
     *             if a column decorator is used and an exception is thrown during value decoration
     */
    public String createChoppedAndLinkedValue() throws ObjectLookupException, DecoratorException {

        final String fullValue = Objects.toString(this.getValue(true));
        String choppedValue;

        // trim the string if a maxLength or maxWords is defined
        if (this.header.getMaxLength() > 0) {
            choppedValue = HtmlTagUtil.abbreviateHtmlString(fullValue, this.header.getMaxLength(), false);
        } else if (this.header.getMaxWords() > 0) {
            choppedValue = HtmlTagUtil.abbreviateHtmlString(fullValue, this.header.getMaxWords(), true);
        } else {
            choppedValue = fullValue;
        }

        // chopped content? add the full content to the column "title" attribute
        // note, simply checking that length is less than before can't be enough due to the "..." added if the string is
        // cropped
        if (!Objects.equals(fullValue, choppedValue)) {
            // clone the attribute map, don't want to add title to all the columns
            this.htmlAttributes = (HtmlAttributeMap) this.htmlAttributes.clone();
            // add title
            this.htmlAttributes.put(TagConstants.ATTRIBUTE_TITLE, HtmlTagUtil.stripHTMLTags(fullValue));
        }

        if (this.header.getHref() != null) {
            // generates the href for the link
            final Href colHref = this.getColumnHref(fullValue);
            final Anchor anchor = new Anchor(colHref, choppedValue);
            choppedValue = anchor.toString();
        }

        return choppedValue;
    }

    /**
     * Generates the href for the column using paramName/property/scope.
     *
     * @param columnContent
     *            column body
     *
     * @return generated Href
     *
     * @throws ObjectLookupException
     *             for errors in lookin up object properties
     */
    private Href getColumnHref(final String columnContent) throws ObjectLookupException {
        // copy href
        final Href colHref = (Href) this.header.getHref().clone();

        // do we need to add a param?
        if (this.header.getParamName() != null) {

            Object paramValue;

            if (this.header.getParamProperty() != null) {
                // different property, go get it
                paramValue = LookupUtil.getBeanProperty(this.row.getObject(), this.header.getParamProperty());

            } else {
                // same property as content
                paramValue = columnContent;
            }

            if (paramValue != null) {
                try {
                    colHref.addParameter(this.header.getParamName(), URLEncoder.encode(paramValue.toString(),
                            StringUtils.defaultString(this.row.getParentTable().getEncoding(), "UTF8"))); //$NON-NLS-1$
                } catch (final UnsupportedEncodingException e) {
                    throw new RuntimeException(e);
                }
            }
        }
        return colHref;
    }

    /**
     * get the final value to be displayed in the table. This method can only be called after initialize(), where the
     * content is evaluated
     *
     * @return String final value to be displayed in the table
     */
    public String getChoppedAndLinkedValue() {
        return this.stringValue;
    }

    /**
     * To string.
     *
     * @return the string
     *
     * @see java.lang.Object#toString()
     */
    @Override
    public String toString() {
        return new ToStringBuilder(this, ToStringStyle.SHORT_PREFIX_STYLE) //
                .append("cell", this.cell) //$NON-NLS-1$
                .append("header", this.header) //$NON-NLS-1$
                .append("htmlAttributes", this.htmlAttributes) //$NON-NLS-1$
                .append("stringValue", this.stringValue) //$NON-NLS-1$
                .toString();
    }
}


text:
package org.mockserver.validator.jsonschema;

import org.mockserver.logging.MockServerLogger;

/**
 * @author jamesdbloom
 */
public class JsonSchemaHttpRequestValidator extends JsonSchemaValidator {

    private JsonSchemaHttpRequestValidator(MockServerLogger mockServerLogger) {
        super(
            mockServerLogger,
            "org/mockserver/model/schema/",
            "httpRequest",
            "body",
            "keyToMultiValue",
            "keyToValue",
            "socketAddress"
        );
    }

    private static JsonSchemaHttpRequestValidator jsonSchemaHttpRequestValidator;

    public static JsonSchemaHttpRequestValidator jsonSchemaHttpRequestValidator(MockServerLogger mockServerLogger) {
        if (jsonSchemaHttpRequestValidator == null) {
            jsonSchemaHttpRequestValidator = new JsonSchemaHttpRequestValidator(mockServerLogger);
        }
        return jsonSchemaHttpRequestValidator;
    }
}


text:
using System;

namespace OpenInvoicePeru.Estructuras.CommonAggregateComponents
{
    [Serializable]
    public class BillingReference : IEquatable<BillingReference>
    {
        public InvoiceDocumentReference InvoiceDocumentReference { get; set; }

        public BillingReference()
        {
            InvoiceDocumentReference = new InvoiceDocumentReference();
        }

        public bool Equals(BillingReference other)
        {
            return InvoiceDocumentReference.Equals(other.InvoiceDocumentReference);
        }

        public override int GetHashCode()
        {
            return InvoiceDocumentReference.GetHashCode();
        }
    }
}


text:
@interface BRMenuOrderItemAttributesProxyTests : XCTestCase

@end

@implementation BRMenuOrderItemAttributesProxyTests

- (void)testProxyTakeAway {
	BRMenuOrderItem *item = [BRMenuOrderItem new];
	[self exerciseTakeAwayFlagTestsWithOrderItem:item atIndex:0];
	[self exerciseTakeAwayFlagTestsWithOrderItem:item atIndex:1];
	[self exerciseTakeAwayFlagTestsWithOrderItem:item atIndex:3]; // skip 2

	// at this point, we should have 4 attribute flags set
	XCTAssertEqual((NSUInteger)4, [item.attributes count], @"attributes count");
}

- (void)exerciseTakeAwayFlagTestsWithOrderItem:(BRMenuOrderItem *)orderItem atIndex:(uint8_t)index {
	BRMenuOrderItemAttributesProxy *proxy = [[BRMenuOrderItemAttributesProxy alloc] initWithOrderItem:orderItem attributeIndex:index];
	BRMenuOrderItemAttributes *attr = [proxy.target attributesAtIndex:index];
	XCTAssertNil(attr, @"initial attributes value");
	XCTAssertEqual(NO, [(id)proxy isTakeAway], @"initial proxy takeAway value");
	[(id)proxy setTakeAway:YES];
	attr = [proxy.target attributesAtIndex:index];
	XCTAssertNotNil(attr, @"attributes via proxy");
	XCTAssertEqual(YES, attr.takeAway, @"takeAway via proxy");
}

@end


text:
package de.mrapp.android.dialog.datastructure;

import android.os.Bundle;
import android.os.Parcel;
import android.os.Parcelable;
import android.text.TextUtils;

import java.io.Serializable;

import androidx.annotation.NonNull;
import androidx.annotation.Nullable;
import androidx.fragment.app.Fragment;
import de.mrapp.util.Condition;

/**
 * Represents one item of a view pager.
 *
 * @author Michael Rapp
 * @since 3.6.0
 */
public class ViewPagerItem implements Serializable, Parcelable {

    /**
     * A creator, which allows to create instances of the class {@link ViewPagerItem} from parcels.
     */
    public static final Creator<ViewPagerItem> CREATOR = new Creator<ViewPagerItem>() {

        @Override
        public ViewPagerItem createFromParcel(final Parcel in) {
            return new ViewPagerItem(in);
        }

        @Override
        public ViewPagerItem[] newArray(final int size) {
            return new ViewPagerItem[size];
        }

    };

    /**
     * The constant serial version UID.
     */
    private static final long serialVersionUID = 1L;

    /**
     * The item's title.
     */
    private final CharSequence title;

    /**
     * The class of the item's fragment.
     */
    private final Class<? extends Fragment> fragmentClass;

    /**
     * Optional arguments, which are passed to the item's fragmentClass.
     */
    private final Bundle arguments;

    /**
     * Creates a new representation of one item of a view pager.
     *
     * @param source
     *         The source, the representation should be created from, as an instance of the class
     *         {@link Parcel}. The source may not be null
     */
    @SuppressWarnings("unchecked")
    private ViewPagerItem(@NonNull final Parcel source) {
        this.title = TextUtils.CHAR_SEQUENCE_CREATOR.createFromParcel(source);
        this.fragmentClass = (Class<? extends Fragment>) source.readSerializable();
        this.arguments = source.readBundle(getClass().getClassLoader());
    }

    /**
     * Creates a new representation of one item of a view pager.
     *
     * @param title
     *         The item's title as an instance of the type {@link CharSequence} or null, if no title
     *         should be shown
     * @param fragmentClass
     *         The class of the item's fragment as an instance of the class {@link Class}. The class
     *         may not be null
     * @param arguments
     *         Optional arguments, which may be passed to the item's fragment, as an instance of the
     *         class {@link Bundle} or null, if no arguments should be passed to the fragmentClass
     */
    public ViewPagerItem(@Nullable final CharSequence title,
                         @NonNull final Class<? extends Fragment> fragmentClass,
                         @Nullable final Bundle arguments) {
        Condition.INSTANCE.ensureNotNull(fragmentClass, "The fragmentClass class may not be null");
        this.title = title;
        this.fragmentClass = fragmentClass;
        this.arguments = arguments;
    }

    /**
     * Returns the item's title.
     *
     * @return The item's title as an instance of the type {@link CharSequence} or null, if no title
     * is shown
     */
    @Nullable
    public final CharSequence getTitle() {
        return title;
    }

    /**
     * Returns the class of the item's fragment.
     *
     * @return The class of the item's fragment as an instance of the class {@link Class}. The class
     * may not be null
     */
    @NonNull
    public final Class<? extends Fragment> getFragmentClass() {
        return fragmentClass;
    }

    /**
     * Returns the optional arguments, which are passed to the item's fragment.
     *
     * @return The optional arguments, which are passed to the item's fragment, as an instance of
     * the class {@link Bundle} or null, if no arguments are passed to the fragment
     */
    @Nullable
    public final Bundle getArguments() {
        return arguments;
    }

    @Override
    public final int describeContents() {
        return 0;
    }

    @Override
    public final void writeToParcel(final Parcel dest, final int flags) {
        TextUtils.writeToParcel(getTitle(), dest, flags);
        dest.writeSerializable(getFragmentClass());
        dest.writeBundle(getArguments());
    }

}


text:
<TITLE>Review for Breakheart Pass (1975)</TITLE>
<LINK REL="STYLESHEET" TYPE="text/css" HREF="/ramr.css">

Breakheart Pass (1975)

reviewed by
Dragan Antulov

BREAKHEART PASS
A Film Review
Copyright Dragan Antulov 1998

In the 1970s Charles Bronson was a synonym for the action
movies about a man who could eat bad guys for breakfast,
regardless of the circumstances. The name of Alistair
MacLean was a synonym for novels whose elaborate and
complicated plot served only as an excuse for numerous and
spectacular action scenes. The combination of two happened
to be BREAKHEART PASS, 1976 Western directed by Tom Gries,
director who obviously liked both of those concepts.

The movie begins on the train destined to Fort Humboldt,
distant U.S. army post in the Rocky Mountains. The fort is
plagued by diphtheria, and territorial governor, doctor,
priest and small detachment of soldiers are going to deliver
the medicine and other supplies. U.S. Marshall Nathan Pearce
(Ben Johnson) boards the train, together with his prisoner,
former doctor and wanted murderer John Deakin (Charles
Bronson). Soon after the train begins its journey through
mountainous wilderness, strange and frightening things start
to happen; some of the passengers are getting killed and it
turns out that almost nobody on the train is what he seems
to be.

In the first half, BREAKHEART PASS looks less a like
action-oriented Western and more like an Agatha Christie's
whodunnit mystery. It is also painful opportunity to watch
capable character actors like Richard Crenna, Charles
Durning and Ben Johnson unsuccessfully trying to breath some
life in their one-dimensional roles. Same is with Bronson's
late wife Jill Ireland, whose character should have been
left out of script. Of course, the viewer knows that, since
this is a Charles Bronson movie, his character won't stay
the bad guy until the end of the film. So, one huge element
of surprise is wasted. Luckily, in the second half Bronson
gets teamed up Ed Lauter, more believable as his sidekick,
and director Tom Gries saves the day with few impressive
action scenes, with the stunts co-ordinated by legendary
Yakima Canutt. All in all, BREAKHEART PASS is an average
Bronson actionfest, with the good Canadian exteriors and
Jerry Goldsmith's music as additional attraction.

RATING: 5/10 (++)

Review written on October 13th 1998

Dragan Antulov a.k.a. Drax
Fido: 2:381/100
E-Mail: dragan.antulov@st.tel.hr
        dragan.antulov@altbbs.fido.hr

The review above was posted to the
rec.arts.movies.reviews newsgroup (de.rec.film.kritiken for German reviews).

The Internet Movie Database accepts no responsibility for the contents of the
review and has no editorial control. Unless stated otherwise, the copyright
belongs to the author.

Please direct comments/criticisms of the review to relevant newsgroups.

Broken URLs inthe reviews are the responsibility of the author.

The formatting of the review is likely to differ from the original due
to ASCII to HTML conversion.

Related links: index of all rec.arts.movies.reviews reviews


text:
var runapp = require('./wikked/app.js');
runapp();


text:
package com.github.jeluard.stone.consolidator;

import com.github.jeluard.stone.api.ConsolidatorTest;

import org.junit.Assert;
import org.junit.Test;

public class Percentile90ConsolidatorTest extends ConsolidatorTest<Percentile90Consolidator> {

  @Override
  protected Class<Percentile90Consolidator> getType() {
    return Percentile90Consolidator.class;
  }

  @Test
  public void shouldResultBeCorrect() {
    final Percentile90Consolidator consolidator = new Percentile90Consolidator(100);
    for (int i = 0; i < 100; i++) {
      consolidator.accumulate(i, i);
    }

    Assert.assertEquals(90, consolidator.consolidateAndReset());
  }

}


text:
class Table(dict):

    def __init__(self, data=None):

        def construct(v):
            if isinstance(v, dict):
                return Table(v)
            elif isinstance(v, (list, tuple, set)):
                return type(v)(map(lambda e: construct(e), v))
            else:
                return v

        if isinstance(data, dict):
            for k, v in data.iteritems():
                self[k] = construct(v)
        elif data is not None:
            raise TypeError(
                'Expect data to be a dict but found %s' % type(data))

    def __getattr__(self, name):
        try:
            return self[name]
        except KeyError:
            raise AttributeError('Attribute "%s" not found' % name)

    def __setattr__(self, name, value):
        self[name] = value

class Buckets(object):
    def __init__(self):
        self.container = {}

    def put(self, key, value):
        try:
            self.container[key].append(value)
        except KeyError:
            self.container[key] = [value]

    def get(self, key):
        try:
            return self.container[key]
        except KeyError:
            # return []
            raise KeyError

    def __iter__(self):
        return iter(self.container)


text:
package org.unipop.process.properties;

import java.util.Set;

public interface PropertyFetcher {
    void addPropertyKey(String key);
    void fetchAllKeys();
    Set<String> getKeys();
}


text:
.class Lcn/com/smartdevices/bracelet/chart/r;
.super Ljava/lang/Object;

# interfaces
.implements Lcn/com/smartdevices/bracelet/chart/data/ChartDataLoader$LoadCallback;

# instance fields
.field final synthetic a:Lcn/com/smartdevices/bracelet/chart/StatisticChartView;

# direct methods
.method constructor <init>(Lcn/com/smartdevices/bracelet/chart/StatisticChartView;)V
    .locals 0

    iput-object p1, p0, Lcn/com/smartdevices/bracelet/chart/r;->a:Lcn/com/smartdevices/bracelet/chart/StatisticChartView;

    invoke-direct {p0}, Ljava/lang/Object;-><init>()V

    return-void
.end method

# virtual methods
.method public hasData(I)Z
    .locals 1

    iget-object v0, p0, Lcn/com/smartdevices/bracelet/chart/r;->a:Lcn/com/smartdevices/bracelet/chart/StatisticChartView;

    invoke-static {v0}, Lcn/com/smartdevices/bracelet/chart/StatisticChartView;->a(Lcn/com/smartdevices/bracelet/chart/StatisticChartView;)Lcn/com/smartdevices/bracelet/chart/data/ChartDataLoader$LoadCallback;

    move-result-object v0

    invoke-interface {v0, p1}, Lcn/com/smartdevices/bracelet/chart/data/ChartDataLoader$LoadCallback;->hasData(I)Z

    move-result v0

    return v0
.end method

.method public loadData(I)Lcn/com/smartdevices/bracelet/chart/data/ChartDataLoader$ItemData;
    .locals 1

    iget-object v0, p0, Lcn/com/smartdevices/bracelet/chart/r;->a:Lcn/com/smartdevices/bracelet/chart/StatisticChartView;

    invoke-static {v0}, Lcn/com/smartdevices/bracelet/chart/StatisticChartView;->b(Lcn/com/smartdevices/bracelet/chart/StatisticChartView;)Lcn/com/smartdevices/bracelet/chart/data/ChartDataLoader;

    move-result-object v0

    invoke-virtual {v0, p1}, Lcn/com/smartdevices/bracelet/chart/data/ChartDataLoader;->getItemData(I)Lcn/com/smartdevices/bracelet/chart/data/ChartDataLoader$ItemData;

    move-result-object v0

    if-nez v0, :cond_0

    iget-object v0, p0, Lcn/com/smartdevices/bracelet/chart/r;->a:Lcn/com/smartdevices/bracelet/chart/StatisticChartView;

    invoke-static {v0}, Lcn/com/smartdevices/bracelet/chart/StatisticChartView;->a(Lcn/com/smartdevices/bracelet/chart/StatisticChartView;)Lcn/com/smartdevices/bracelet/chart/data/ChartDataLoader$LoadCallback;

    move-result-object v0

    invoke-interface {v0, p1}, Lcn/com/smartdevices/bracelet/chart/data/ChartDataLoader$LoadCallback;->loadData(I)Lcn/com/smartdevices/bracelet/chart/data/ChartDataLoader$ItemData;

    move-result-object v0

    :cond_0
    return-object v0
.end method

.method public onDataLoaded(Lcn/com/smartdevices/bracelet/chart/data/ChartDataLoader$ItemData;)V
    .locals 2

    iget-object v0, p0, Lcn/com/smartdevices/bracelet/chart/r;->a:Lcn/com/smartdevices/bracelet/chart/StatisticChartView;

    iget v1, p1, Lcn/com/smartdevices/bracelet/chart/data/ChartDataLoader$ItemData;->index:I

    invoke-static {v0, v1}, Lcn/com/smartdevices/bracelet/chart/StatisticChartView;->a(Lcn/com/smartdevices/bracelet/chart/StatisticChartView;I)Z

    move-result v0

    if-nez v0, :cond_0

    iget-object v1, p0, Lcn/com/smartdevices/bracelet/chart/r;->a:Lcn/com/smartdevices/bracelet/chart/StatisticChartView;

    move-object v0, p1

    check-cast v0, Lcn/com/smartdevices/bracelet/chart/StatisticChartView$StatisticChartData;

    invoke-static {v1, v0}, Lcn/com/smartdevices/bracelet/chart/StatisticChartView;->a(Lcn/com/smartdevices/bracelet/chart/StatisticChartView;Lcn/com/smartdevices/bracelet/chart/StatisticChartView$StatisticChartData;)V

    iget-object v0, p0, Lcn/com/smartdevices/bracelet/chart/r;->a:Lcn/com/smartdevices/bracelet/chart/StatisticChartView;

    invoke-static {v0}, Lcn/com/smartdevices/bracelet/chart/StatisticChartView;->c(Lcn/com/smartdevices/bracelet/chart/StatisticChartView;)V

    :cond_0
    iget-object v0, p0, Lcn/com/smartdevices/bracelet/chart/r;->a:Lcn/com/smartdevices/bracelet/chart/StatisticChartView;

    invoke-static {v0}, Lcn/com/smartdevices/bracelet/chart/StatisticChartView;->d(Lcn/com/smartdevices/bracelet/chart/StatisticChartView;)Ljava/util/ArrayList;

    move-result-object v0

    iget v1, p1, Lcn/com/smartdevices/bracelet/chart/data/ChartDataLoader$ItemData;->index:I

    invoke-static {v1}, Ljava/lang/Integer;->valueOf(I)Ljava/lang/Integer;

    move-result-object v1

    invoke-virtual {v0, v1}, Ljava/util/ArrayList;->remove(Ljava/lang/Object;)Z

    iget-object v0, p0, Lcn/com/smartdevices/bracelet/chart/r;->a:Lcn/com/smartdevices/bracelet/chart/StatisticChartView;

    invoke-static {v0}, Lcn/com/smartdevices/bracelet/chart/StatisticChartView;->d(Lcn/com/smartdevices/bracelet/chart/StatisticChartView;)Ljava/util/ArrayList;

    move-result-object v0

    invoke-virtual {v0}, Ljava/util/ArrayList;->size()I

    move-result v0

    if-nez v0, :cond_2

    iget-object v0, p0, Lcn/com/smartdevices/bracelet/chart/r;->a:Lcn/com/smartdevices/bracelet/chart/StatisticChartView;

    invoke-static {v0}, Lcn/com/smartdevices/bracelet/chart/StatisticChartView;->e(Lcn/com/smartdevices/bracelet/chart/StatisticChartView;)Z

    move-result v0

    if-eqz v0, :cond_1

    iget-object v0, p0, Lcn/com/smartdevices/bracelet/chart/r;->a:Lcn/com/smartdevices/bracelet/chart/StatisticChartView;

    invoke-static {v0}, Lcn/com/smartdevices/bracelet/chart/StatisticChartView;->f(Lcn/com/smartdevices/bracelet/chart/StatisticChartView;)I

    move-result v0

    invoke-virtual {p0, v0}, Lcn/com/smartdevices/bracelet/chart/r;->onToItem(I)V

    :cond_1
    iget-object v0, p0, Lcn/com/smartdevices/bracelet/chart/r;->a:Lcn/com/smartdevices/bracelet/chart/StatisticChartView;

    invoke-static {v0}, Lcn/com/smartdevices/bracelet/chart/StatisticChartView;->a(Lcn/com/smartdevices/bracelet/chart/StatisticChartView;)Lcn/com/smartdevices/bracelet/chart/data/ChartDataLoader$LoadCallback;

    move-result-object v0

    invoke-interface {v0, p1}, Lcn/com/smartdevices/bracelet/chart/data/ChartDataLoader$LoadCallback;->onDataLoaded(Lcn/com/smartdevices/bracelet/chart/data/ChartDataLoader$ItemData;)V

    :cond_2
    return-void
.end method

.method public onToItem(I)V
    .locals 1

    iget-object v0, p0, Lcn/com/smartdevices/bracelet/chart/r;->a:Lcn/com/smartdevices/bracelet/chart/StatisticChartView;

    invoke-static {v0}, Lcn/com/smartdevices/bracelet/chart/StatisticChartView;->a(Lcn/com/smartdevices/bracelet/chart/StatisticChartView;)Lcn/com/smartdevices/bracelet/chart/data/ChartDataLoader$LoadCallback;

    move-result-object v0

    invoke-interface {v0, p1}, Lcn/com/smartdevices/bracelet/chart/data/ChartDataLoader$LoadCallback;->onToItem(I)V

    return-void
.end method


text:
$DomainName = "SomeDomain.com"  # Use Format: YourDomain.com

# Domin Admin User Name and Password
$DomainAdminUserName = "AdminUserName" # Domain Admin User name
$DomainAdminPassword = "AdminPassword" # Domain Admin Password
$SecurePassword = $DomainAdminPassword | ConvertTo-SecureString -AsPlainText -Force

$DomainAdminUserName = ("{0}\{1}" -f $DomainName.Split(".")[0], $DomainAdminUserName)
$DomainAdminCredential = New-Object System.Management.Automation.PSCredential -ArgumentList $DomainAdminUserName, $SecurePassword

# Network Variables

$DnsIP = "10.0.0.100"

# SQL Server Variables
$SqlSvcAcctUserName = ("{0}\{1}" -f $DomainName.Split(".")[0], "SP_SQL")
$SqlServerName = "SP-SQL1" # SQL Server of the SharePoint farm
$SqlSvcAcctCredential = (New-Object System.Management.Automation.PSCredential -ArgumentList $SqlSvcAcctUserName, $SecurePassword)
$SqlInstanceName ="MSSQLSERVER"
$SqlSvcAcctCredential = (New-Object System.Management.Automation.PSCredential -ArgumentList $SqlSvcAcctUserName, $SecurePassword)

## SharePoint

# Service Accounts
$SpFarmSetupAcct = "SP_FarmSetup" # SharePoint Farm Setup Account
$SpFarmServiceAcct = "SP_ServicePool" # Account to run SharePoint services
$SpFarmAcct = "SP_Farm" # SharePoint Farm Account

$Passphrase = $DomainAdminCredential

$FarmSetupCredential = New-Object System.Management.Automation.PSCredential -ArgumentList ("{0}\{1}" -f $DomainName.Split(".")[0], $SpFarmSetupAcct), $SecurePassword
$FarmAccountCredential = New-Object System.Management.Automation.PSCredential -ArgumentList ("{0}\{1}" -f $DomainName.Split(".")[0], $SpFarmAcct), $SecurePassword
$ServicePoolMngAccCredential = New-Object System.Management.Automation.PSCredential -ArgumentList ("{0}\{1}" -f $DomainName.Split(".")[0], $SpFarmServiceAcct), $SecurePassword


text:
package main

import (
	"encoding/json"
	"fmt"
	"github.com/rckclmbr/goportify/Godeps/_workspace/src/github.com/elazarl/go-bindata-assetfs"
	"github.com/rckclmbr/goportify/Godeps/_workspace/src/github.com/googollee/go-socket.io"
	"github.com/rckclmbr/goportify/Godeps/_workspace/src/github.com/skratchdot/open-golang/open"
	"log"
	"net/http"
)

var (
	debug = false
)

//{"status": 200, "message": "ok", "data":
type Response struct {
	Status  int         `json:"status"`
	Message string      `json:"message"`
	Data    interface{} `json:"data"`
}

type SocketIOResponse struct {
	Type string      `json:"type"`
	Data interface{} `json:"data"`
}

type PlaylistType struct {
	Playlist Playlist `json:"playlist"`
	Name     string   `json:"name"`
}

type PlaylistLengthType struct {
	Length int `json:"length"`
}

type TrackType struct {
	SpotifyTrackUri string `json:"spotify_track_uri"`
	Name            string `json:"name"`
	Cover           string `json:"cover"`
}

type AddedType struct {
	SpotifyTrackUri  string `json:"spotify_track_uri"`
	SpotifyTrackName string `json:"spotify_track_name"`
	Found            bool   `json:"found"`
	Karaoke          bool   `json:"karaoke"`
}

type LoginRequest struct {
	Email    string `json:"email"`
	Username string `json:"username"`
	Password string `json:"password"`
}

type Server struct {
	goog *Google
	sp   *Spotify
	sios *socketio.Server
	sio  socketio.Socket
}

func newServer() (*Server, error) {
	goog := NewGoogle()
	sp, err := NewSpotify()
	if err != nil {
		return nil, fmt.Errorf("Error initializting spotify: %s", err)
	}

	ioServer, err := socketio.NewServer(nil)
	if err != nil {
		return nil, fmt.Errorf("Error creating socketio server: %s", err)
	}
	server := &Server{goog: goog, sp: sp, sios: ioServer}

	ioServer.On("connection", func(so socketio.Socket) {
		so.On("test", func(msg string) {
			fmt.Println(msg)
		})
		server.sio = so
	})
	ioServer.On("error", func(so socketio.Socket, err error) {
		fmt.Printf("socketio error: %s", err)
	})

	return server, nil
}

func main() {

	server, err := newServer()
	if err != nil {
		log.Fatal(err)
	}

	http.Handle("/socket.io/", server.sios)
	http.HandleFunc("/google/login", server.googleLogin)
	http.HandleFunc("/spotify/login", server.spotifyLogin)
	http.HandleFunc("/spotify/playlists", server.spotifyPlaylists)
	http.HandleFunc("/portify/transfer/start", server.transferStart)

	fs := http.FileServer(&assetfs.AssetFS{Asset: Asset, AssetDir: AssetDir, Prefix: "static"})
	http.Handle("/", fs)

	open.Run("http://localhost:3132/")
	panic(http.ListenAndServe(":3132", nil))
}

func (s *Server) googleLogin(w http.ResponseWriter, r *http.Request) {
	var response *Response
	var login LoginRequest
	decoder := json.NewDecoder(r.Body)
	err := decoder.Decode(&login)
	if err != nil {
		http.Error(w, "You must supply a login and password", http.StatusBadRequest)
		return
	}

	err = s.goog.Login(login.Email, login.Password)

	if err != nil {
		response = &Response{Status: 400, Message: "login failed."}
	} else {
		response = &Response{Status: 200, Message: "login successful."}
	}

	js, err := json.Marshal(response)
	if err != nil {
		http.Error(w, err.Error(), http.StatusInternalServerError)
		return
	}

	w.Header().Set("Content-Type", "application/json")
	w.Write(js)
}

func (s *Server) spotifyLogin(w http.ResponseWriter, r *http.Request) {
	var response *Response
	var login LoginRequest
	decoder := json.NewDecoder(r.Body)
	err := decoder.Decode(&login)
	if err != nil {
		http.Error(w, "You must supply a login and password", http.StatusBadRequest)
		return
	}

	err = s.sp.Login(login.Username, login.Password)
	if err != nil {
		response = &Response{Status: 400, Message: "login failed."}
	} else {
		response = &Response{Status: 200, Message: "login successful."}
	}

	js, err := json.Marshal(response)
	if err != nil {
		http.Error(w, err.Error(), http.StatusInternalServerError)
		return
	}

	w.Header().Set("Content-Type", "application/json")
	w.Write(js)
}

func (s *Server) spotifyPlaylists(w http.ResponseWriter, r *http.Request) {
	var response *Response
	if !s.sp.LoggedIn() {
		response = &Response{Status: 402, Message: "Spotify: not logged in"}
	} else {
		spPlaylists := s.sp.AllPlaylists()
		response = &Response{Status: 200, Message: "ok", Data: spPlaylists}
	}

	js, err := json.Marshal(response)
	if err != nil {
		http.Error(w, err.Error(), http.StatusInternalServerError)
		return
	}

	w.Header().Set("Content-Type", "application/json")
	w.Write(js)
}

func (s *Server) transferStart(w http.ResponseWriter, r *http.Request) {
	var response *Response

	var playlists []Playlist
	err := json.NewDecoder(r.Body).Decode(&playlists)
	if err != nil {
		http.Error(w, fmt.Sprintf("Invalid playlists specified: %s", err), http.StatusBadRequest)
		return
	}

	if !s.goog.LoggedIn() {
		response = &Response{Status: 401, Message: "Google: not logged in."}
	} else if !s.sp.LoggedIn() {
		response = &Response{Status: 402, Message: "Spotify: not logged in"}
	} else if len(playlists) == 0 {
		response = &Response{Status: 403, Message: "Please select at least one playlist."}
	}

	if response == nil {
		go s.doTransferStart(playlists)
		response = &Response{Status: 200, Message: "transfer will start."}
	}

	js, err := json.Marshal(response)
	if err != nil {
		http.Error(w, err.Error(), http.StatusInternalServerError)
		return
	}

	w.Header().Set("Content-Type", "application/json")
	w.Write(js)
}

func (s *Server) doTransferStart(playlists []Playlist) {
	// Convert to map to check for playlist
	playlistMap := make(map[string]bool)
	for _, playlist := range playlists {
		playlistMap[playlist.Uri] = true
	}

	// Iterate over all spotify playlists (should be cached anyway)
	spPlaylists := s.sp.AllPlaylists()
	for i, spPlaylist := range spPlaylists {
		if _, ok := playlistMap[spPlaylist.Uri]; ok {
			s.startPlaylist(i, spPlaylist)
		}
	}

	s.sio.Emit("portify", &SocketIOResponse{"all_done", nil})
	fmt.Printf("Complete\n")
}

func (s *Server) startPlaylist(i int, spPlaylist Playlist) {
	trackChan, count := s.sp.PlaylistTracks(&spPlaylist)
	s.sio.Emit("portify", &SocketIOResponse{"playlist_length", PlaylistLengthType{count}})
	s.sio.Emit("portify", &SocketIOResponse{"playlist_started", PlaylistType{spPlaylist, spPlaylist.Name}})
	err := s.createFullPlaylist(spPlaylist.Name, trackChan, count, i)
	s.sio.Emit("portify", &SocketIOResponse{"playlist_done", PlaylistType{spPlaylist, spPlaylist.Name}})
	if err != nil {
		fmt.Printf("Error creating playlist %s: %v", spPlaylist.Name, err)
	}
}

func (s *Server) createFullPlaylist(playlistName string, trackChan chan BasicTrack, trackCount int, playlistNum int) error {
	fmt.Printf("Processing playlist '%s'\n", playlistName)
	googSongNids := []string{}

	done := make(chan int)
	for i := 0; i < trackCount; i++ {
		go func(i int) {
			prefix := fmt.Sprintf("(%d:%d/%d)", playlistNum, i+1, trackCount)

			track := <-trackChan
			bestTrack, err := s.goog.FindBestTrack(track.Name)
			if err != nil {
				fmt.Printf("%s: Couldn't find track: %s\n", prefix, err)
				s.sio.Emit("gmusic", &SocketIOResponse{"not_added",
					AddedType{
						Found:            false,
						SpotifyTrackUri:  track.Uri,
						SpotifyTrackName: track.Name,
					},
				},
				)
			} else {
				googSongNids = append(googSongNids, bestTrack.Nid)
				fmt.Printf("%s: '%s' -> '%s - %s'\n", prefix, track.Name, bestTrack.Artist, bestTrack.Title)
				s.sio.Emit("gmusic", &SocketIOResponse{"added",
					AddedType{
						Found:            true,
						SpotifyTrackUri:  track.Uri,
						SpotifyTrackName: track.Name,
					},
				},
				)
			}
			done <- i
		}(i)
	}

	for i := 0; i < trackCount; i++ {
		<-done
	}

	fmt.Printf("Creating '%s' in Google Music\n", playlistName)
	playlistId, err := s.goog.CreatePlaylist(playlistName, false)
	if err != nil {
		return fmt.Errorf("Error creating playlist: %v", err)
	}
	s.goog.AddTracks(playlistId, googSongNids)
	if err != nil {
		return fmt.Errorf("Error adding tracks to playlist: %v", err)
	}
	return nil
}


text:
import styled from 'styled-components'

// import Img from '@/Img'
import css from '@/utils/css'
import EditPenSVG from '@/icons/EditPen'

export const Wrapper = styled.div`
  ${css.flex('justify-between', 'align-center')};
  width: 100%;
`
export const Title = styled.div`
  letter-spacing: 2px;
  font-size: 12px;
  padding-left: 2px;
`
export const EditIcon = styled(EditPenSVG)`
  ${css.size(13)};
  fill: #fff; // to-theme
`


text:
var config = require('config.json');
var express = require('express');
var router = express.Router();
var fileService = require('services/file.service');
var thumbService = require('services/thumbnail.service');
var multer = require('multer');
var mime = require('mime');
var crypto = require('crypto');

var storage = multer.diskStorage({
  destination: function (req, file, cb) {
    cb(null, './uploads/')
  },
  filename: function (req, file, cb) {
  console.log('file', file);
  //cb(null,  file.originalname);
  //cb(null,  file.originalname + Date.now() + '.' + mime.extension(file.mimetype));
    crypto.pseudoRandomBytes(16, function (err, raw) {
      cb(null, raw.toString('hex') + Date.now() + '.' + mime.extension(file.mimetype));
    });
  }
});
var upload = multer({ storage: storage });
//var upload = multer({dest: 'uploads/'});

// routes
router.post('/', upload.single('file'), addFile);
router.get('/', listFile);
router.get('/:_id', getFile);
router.get('/thumbnail/:_id', getThumbnail);
//router.put('/:_id', updateFile);
router.delete('/:_id', _deleteFile);

module.exports = router;

function addFile(req, res) {
    console.log(req);
    fileService.create(req.file)
        .then(function () {
            res.send(req.file);
        })
        .catch(function (err) {
            res.status(400).send(err);
        });
}

function listFile(req, res) {
    fileService.getAll()
        .then(function (users) {
            res.send(users);
        })
        .catch(function (err) {
            res.status(400).send(err);
        });
}

function getFile(req, res) {
    fileService.getById(req.params._id)
        .then(function (file) {
            if (file) {
                res.send(file);
            } else {
                res.sendStatus(404);
            }
        })
        .catch(function (err) {
            res.status(400).send(err);
        });
}

function getThumbnail(req, res){
    fileService.getById(req.params._id)
        .then(function (file) {
            if (file) {
                thumbService.resize(file).then(function(filepath){
                    console.log('thumb', filepath);
                    res.sendFile( global.appRoot + '/' + filepath, {headers:{'Content-Type':'image/png'}}, function(err){
                        console.log('err', err);
                    });
                    //res.sendStatus(200);
                });
            } else {
                res.sendStatus(404);
            }
        })
        .catch(function (err) {
            res.status(400).send(err);
        });
}
//function updateFile(req, res) {
//    fileService.update(req.params._id, req.body)
//        .then(function () {
//            res.sendStatus(200);
//        })
//        .catch(function (err) {
//            res.status(400).send(err);
//        });
//}

function _deleteFile(req, res) {
    fileService.delete(req.params._id)
        .then(function () {
            res.sendStatus(200);
        })
        .catch(function (err) {
            res.status(400).send(err);
        });
}


text:
package org.apache.ivory.repliation;

import org.apache.hadoop.fs.Path;
import org.apache.hadoop.tools.DistCpOptions;
import org.apache.ivory.replication.FeedReplicator;
import org.testng.Assert;
import org.testng.annotations.Test;

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

public class FeedReplicatorTest {

    @Test
    public void testArguments() throws Exception {
        /*
         * <arg>-update</arg>
         * <arg>-blocking</arg><arg>true</arg> <arg>-maxMaps</arg><arg>20</arg>
         * <arg>-sourcePaths</arg><arg>${distcpSourcePaths}</arg>
         * <arg>-targetPath</arg><arg>${distcpTargetPaths}</arg>
         */
        FeedReplicator replicator = new FeedReplicator();
        DistCpOptions options = replicator.getDistCpOptions(new String[] { "-update",
                "-blocking", "true", "-maxMaps", "5", "-sourcePaths",
                "hdfs://localhost:8020/tmp/", "-targetPath",
                "hdfs://localhost1:8020/tmp/" });

        List<Path> srcPaths = new ArrayList<Path>();
        srcPaths.add(new Path("hdfs://localhost:8020/tmp/"));
        Assert.assertEquals(options.getSourcePaths(), srcPaths);
        Assert.assertEquals(options.getTargetPath(), new Path("hdfs://localhost1:8020/tmp/"));
    }
}


text:
package org.commonjava.indy.subsys.git;

import java.util.Collection;
import java.util.Date;

/**
 * Created by ruhan on 5/7/18.
 */
public class ChangelogEntry
{
    private String username;

    private String message;

    private Collection<String> paths; // file(s) affected

    private Date timestamp;

    public ChangelogEntry( String user, String message, Collection<String> paths )
    {
        this.username = user;
        this.message = message;
        this.paths = paths;
        this.timestamp = new Date();
    }

    public String getUsername()
    {
        return username;
    }

    public String getMessage()
    {
        return message;
    }

    public Collection<String> getPaths()
    {
        return paths;
    }

    public Date getTimestamp()
    {
        return timestamp;
    }
}


text:
Videogular plugin to create a "Next Video" feature similar to Youtube.

Demo: http://www.videogular.com/videogular-next-video-tutorial/

Click play and seek to the end of the video. Videos will continuously play until you click cancel.

Tutorial available here: