text:
[instagram-private-api](../../README.md) / [responses](../../modules/responses.md) / HighlightsRepositoryEditReelResponseItemsItem

# Interface: HighlightsRepositoryEditReelResponseItemsItem

[responses](../../modules/responses.md).HighlightsRepositoryEditReelResponseItemsItem

## Table of contents

### Properties

- [boost\_unavailable\_reason](HighlightsRepositoryEditReelResponseItemsItem.md#boost_unavailable_reason)
- [boosted\_status](HighlightsRepositoryEditReelResponseItemsItem.md#boosted_status)
- [can\_reply](HighlightsRepositoryEditReelResponseItemsItem.md#can_reply)
- [can\_reshare](HighlightsRepositoryEditReelResponseItemsItem.md#can_reshare)
- [can\_viewer\_save](HighlightsRepositoryEditReelResponseItemsItem.md#can_viewer_save)
- [caption](HighlightsRepositoryEditReelResponseItemsItem.md#caption)
- [caption\_is\_edited](HighlightsRepositoryEditReelResponseItemsItem.md#caption_is_edited)
- [caption\_position](HighlightsRepositoryEditReelResponseItemsItem.md#caption_position)
- [client\_cache\_key](HighlightsRepositoryEditReelResponseItemsItem.md#client_cache_key)
- [code](HighlightsRepositoryEditReelResponseItemsItem.md#code)
- [creative\_config](HighlightsRepositoryEditReelResponseItemsItem.md#creative_config)
- [device\_timestamp](HighlightsRepositoryEditReelResponseItemsItem.md#device_timestamp)
- [fb\_user\_tags](HighlightsRepositoryEditReelResponseItemsItem.md#fb_user_tags)
- [filter\_type](HighlightsRepositoryEditReelResponseItemsItem.md#filter_type)
- [has\_audio](HighlightsRepositoryEditReelResponseItemsItem.md#has_audio)
- [has\_shared\_to\_fb](HighlightsRepositoryEditReelResponseItemsItem.md#has_shared_to_fb)
- [highlight\_reel\_ids](HighlightsRepositoryEditReelResponseItemsItem.md#highlight_reel_ids)
- [id](HighlightsRepositoryEditReelResponseItemsItem.md#id)
- [image\_versions2](HighlightsRepositoryEditReelResponseItemsItem.md#image_versions2)
- [imported\_taken\_at](HighlightsRepositoryEditReelResponseItemsItem.md#imported_taken_at)
- [is\_dash\_eligible](HighlightsRepositoryEditReelResponseItemsItem.md#is_dash_eligible)
- [is\_pride\_media](HighlightsRepositoryEditReelResponseItemsItem.md#is_pride_media)
- [is\_reel\_media](HighlightsRepositoryEditReelResponseItemsItem.md#is_reel_media)
- [media\_type](HighlightsRepositoryEditReelResponseItemsItem.md#media_type)
- [multi\_author\_reel\_names](HighlightsRepositoryEditReelResponseItemsItem.md#multi_author_reel_names)
- [number\_of\_qualities](HighlightsRepositoryEditReelResponseItemsItem.md#number_of_qualities)
- [organic\_tracking\_token](HighlightsRepositoryEditReelResponseItemsItem.md#organic_tracking_token)
- [original\_height](HighlightsRepositoryEditReelResponseItemsItem.md#original_height)
- [original\_width](HighlightsRepositoryEditReelResponseItemsItem.md#original_width)
- [photo\_of\_you](HighlightsRepositoryEditReelResponseItemsItem.md#photo_of_you)
- [pk](HighlightsRepositoryEditReelResponseItemsItem.md#pk)
- [show\_one\_tap\_fb\_share\_tooltip](HighlightsRepositoryEditReelResponseItemsItem.md#show_one_tap_fb_share_tooltip)
- [story\_is\_saved\_to\_archive](HighlightsRepositoryEditReelResponseItemsItem.md#story_is_saved_to_archive)
- [story\_quiz\_participant\_infos](HighlightsRepositoryEditReelResponseItemsItem.md#story_quiz_participant_infos)
- [story\_quizs](HighlightsRepositoryEditReelResponseItemsItem.md#story_quizs)
- [supports\_reel\_reactions](HighlightsRepositoryEditReelResponseItemsItem.md#supports_reel_reactions)
- [taken\_at](HighlightsRepositoryEditReelResponseItemsItem.md#taken_at)
- [timezone\_offset](HighlightsRepositoryEditReelResponseItemsItem.md#timezone_offset)
- [total\_viewer\_count](HighlightsRepositoryEditReelResponseItemsItem.md#total_viewer_count)
- [user](HighlightsRepositoryEditReelResponseItemsItem.md#user)
- [video\_codec](HighlightsRepositoryEditReelResponseItemsItem.md#video_codec)
- [video\_dash\_manifest](HighlightsRepositoryEditReelResponseItemsItem.md#video_dash_manifest)
- [video\_duration](HighlightsRepositoryEditReelResponseItemsItem.md#video_duration)
- [video\_versions](HighlightsRepositoryEditReelResponseItemsItem.md#video_versions)
- [viewer\_count](HighlightsRepositoryEditReelResponseItemsItem.md#viewer_count)
- [viewer\_cursor](HighlightsRepositoryEditReelResponseItemsItem.md#viewer_cursor)
- [viewers](HighlightsRepositoryEditReelResponseItemsItem.md#viewers)

## Properties

### boost\_unavailable\_reason

• **boost\_unavailable\_reason**: `string`

#### Defined in

[src/responses/highlights.repository.edit-reel.response.ts:76](https://github.com/Nerixyz/instagram-private-api/blob/b3351b9/src/responses/highlights.repository.edit-reel.response.ts#L76)

___

### boosted\_status

• **boosted\_status**: `string`

#### Defined in

[src/responses/highlights.repository.edit-reel.response.ts:75](https://github.com/Nerixyz/instagram-private-api/blob/b3351b9/src/responses/highlights.repository.edit-reel.response.ts#L75)

___

### can\_reply

• **can\_reply**: `boolean`

#### Defined in

[src/responses/highlights.repository.edit-reel.response.ts:83](https://github.com/Nerixyz/instagram-private-api/blob/b3351b9/src/responses/highlights.repository.edit-reel.response.ts#L83)

___

### can\_reshare

• **can\_reshare**: `boolean`

#### Defined in

[src/responses/highlights.repository.edit-reel.response.ts:82](https://github.com/Nerixyz/instagram-private-api/blob/b3351b9/src/responses/highlights.repository.edit-reel.response.ts#L82)

___

### can\_viewer\_save

• **can\_viewer\_save**: `boolean`

#### Defined in

[src/responses/highlights.repository.edit-reel.response.ts:80](https://github.com/Nerixyz/instagram-private-api/blob/b3351b9/src/responses/highlights.repository.edit-reel.response.ts#L80)

___

### caption

• **caption**: ``null``

#### Defined in

[src/responses/highlights.repository.edit-reel.response.ts:78](https://github.com/Nerixyz/instagram-private-api/blob/b3351b9/src/responses/highlights.repository.edit-reel.response.ts#L78)

___

### caption\_is\_edited

• **caption\_is\_edited**: `boolean`

#### Defined in

[src/responses/highlights.repository.edit-reel.response.ts:71](https://github.com/Nerixyz/instagram-private-api/blob/b3351b9/src/responses/highlights.repository.edit-reel.response.ts#L71)

___

### caption\_position

• **caption\_position**: `number`

#### Defined in

[src/responses/highlights.repository.edit-reel.response.ts:72](https://github.com/Nerixyz/instagram-private-api/blob/b3351b9/src/responses/highlights.repository.edit-reel.response.ts#L72)

___

### client\_cache\_key

• **client\_cache\_key**: `string`

#### Defined in

[src/responses/highlights.repository.edit-reel.response.ts:65](https://github.com/Nerixyz/instagram-private-api/blob/b3351b9/src/responses/highlights.repository.edit-reel.response.ts#L65)

___

### code

• **code**: `string`

#### Defined in

[src/responses/highlights.repository.edit-reel.response.ts:64](https://github.com/Nerixyz/instagram-private-api/blob/b3351b9/src/responses/highlights.repository.edit-reel.response.ts#L64)

___

### creative\_config

• `Optional` **creative\_config**: [`HighlightsRepositoryEditReelResponseCreative_config`](HighlightsRepositoryEditReelResponseCreative_config.md)

#### Defined in

[src/responses/highlights.repository.edit-reel.response.ts:85](https://github.com/Nerixyz/instagram-private-api/blob/b3351b9/src/responses/highlights.repository.edit-reel.response.ts#L85)

___

### device\_timestamp

• **device\_timestamp**: `number`

#### Defined in

[src/responses/highlights.repository.edit-reel.response.ts:62](https://github.com/Nerixyz/instagram-private-api/blob/b3351b9/src/responses/highlights.repository.edit-reel.response.ts#L62)

___

### fb\_user\_tags

• `Optional` **fb\_user\_tags**: [`HighlightsRepositoryEditReelResponseFb_user_tags`](HighlightsRepositoryEditReelResponseFb_user_tags.md)

#### Defined in

[src/responses/highlights.repository.edit-reel.response.ts:79](https://github.com/Nerixyz/instagram-private-api/blob/b3351b9/src/responses/highlights.repository.edit-reel.response.ts#L79)

___

### filter\_type

• **filter\_type**: `number`

#### Defined in

[src/responses/highlights.repository.edit-reel.response.ts:66](https://github.com/Nerixyz/instagram-private-api/blob/b3351b9/src/responses/highlights.repository.edit-reel.response.ts#L66)

___

### has\_audio

• `Optional` **has\_audio**: `boolean`

#### Defined in

[src/responses/highlights.repository.edit-reel.response.ts:103](https://github.com/Nerixyz/instagram-private-api/blob/b3351b9/src/responses/highlights.repository.edit-reel.response.ts#L103)

___

### has\_shared\_to\_fb

• **has\_shared\_to\_fb**: `number`

#### Defined in

[src/responses/highlights.repository.edit-reel.response.ts:97](https://github.com/Nerixyz/instagram-private-api/blob/b3351b9/src/responses/highlights.repository.edit-reel.response.ts#L97)

___

### highlight\_reel\_ids

• **highlight\_reel\_ids**: `string`[]

#### Defined in

[src/responses/highlights.repository.edit-reel.response.ts:89](https://github.com/Nerixyz/instagram-private-api/blob/b3351b9/src/responses/highlights.repository.edit-reel.response.ts#L89)

___

### id

• **id**: `string`

#### Defined in

[src/responses/highlights.repository.edit-reel.response.ts:61](https://github.com/Nerixyz/instagram-private-api/blob/b3351b9/src/responses/highlights.repository.edit-reel.response.ts#L61)

___

### image\_versions2

• **image\_versions2**: [`HighlightsRepositoryEditReelResponseImage_versions2`](HighlightsRepositoryEditReelResponseImage_versions2.md)

#### Defined in

[src/responses/highlights.repository.edit-reel.response.ts:67](https://github.com/Nerixyz/instagram-private-api/blob/b3351b9/src/responses/highlights.repository.edit-reel.response.ts#L67)

___

### imported\_taken\_at

• `Optional` **imported\_taken\_at**: `number`

#### Defined in

[src/responses/highlights.repository.edit-reel.response.ts:105](https://github.com/Nerixyz/instagram-private-api/blob/b3351b9/src/responses/highlights.repository.edit-reel.response.ts#L105)

___

### is\_dash\_eligible

• `Optional` **is\_dash\_eligible**: `number`

#### Defined in

[src/responses/highlights.repository.edit-reel.response.ts:98](https://github.com/Nerixyz/instagram-private-api/blob/b3351b9/src/responses/highlights.repository.edit-reel.response.ts#L98)

___

### is\_pride\_media

• **is\_pride\_media**: `boolean`

#### Defined in

[src/responses/highlights.repository.edit-reel.response.ts:84](https://github.com/Nerixyz/instagram-private-api/blob/b3351b9/src/responses/highlights.repository.edit-reel.response.ts#L84)

___

### is\_reel\_media

• **is\_reel\_media**: `boolean`

#### Defined in

[src/responses/highlights.repository.edit-reel.response.ts:73](https://github.com/Nerixyz/instagram-private-api/blob/b3351b9/src/responses/highlights.repository.edit-reel.response.ts#L73)

___

### media\_type

• **media\_type**: `number`

#### Defined in

[src/responses/highlights.repository.edit-reel.response.ts:63](https://github.com/Nerixyz/instagram-private-api/blob/b3351b9/src/responses/highlights.repository.edit-reel.response.ts#L63)

___

### multi\_author\_reel\_names

• **multi\_author\_reel\_names**: `any`[]

#### Defined in

[src/responses/highlights.repository.edit-reel.response.ts:94](https://github.com/Nerixyz/instagram-private-api/blob/b3351b9/src/responses/highlights.repository.edit-reel.response.ts#L94)

___

### number\_of\_qualities

• `Optional` **number\_of\_qualities**: `number`

#### Defined in

[src/responses/highlights.repository.edit-reel.response.ts:101](https://github.com/Nerixyz/instagram-private-api/blob/b3351b9/src/responses/highlights.repository.edit-reel.response.ts#L101)

___

### organic\_tracking\_token

• **organic\_tracking\_token**: `string`

#### Defined in

[src/responses/highlights.repository.edit-reel.response.ts:81](https://github.com/Nerixyz/instagram-private-api/blob/b3351b9/src/responses/highlights.repository.edit-reel.response.ts#L81)

___

### original\_height

• **original\_height**: `number`

#### Defined in

[src/responses/highlights.repository.edit-reel.response.ts:69](https://github.com/Nerixyz/instagram-private-api/blob/b3351b9/src/responses/highlights.repository.edit-reel.response.ts#L69)

___

### original\_width

• **original\_width**: `number`

#### Defined in

[src/responses/highlights.repository.edit-reel.response.ts:68](https://github.com/Nerixyz/instagram-private-api/blob/b3351b9/src/responses/highlights.repository.edit-reel.response.ts#L68)

___

### photo\_of\_you

• **photo\_of\_you**: `boolean`

#### Defined in

[src/responses/highlights.repository.edit-reel.response.ts:77](https://github.com/Nerixyz/instagram-private-api/blob/b3351b9/src/responses/highlights.repository.edit-reel.response.ts#L77)

___

### pk

• **pk**: `string`

#### Defined in

[src/responses/highlights.repository.edit-reel.response.ts:60](https://github.com/Nerixyz/instagram-private-api/blob/b3351b9/src/responses/highlights.repository.edit-reel.response.ts#L60)

___

### show\_one\_tap\_fb\_share\_tooltip

• **show\_one\_tap\_fb\_share\_tooltip**: `boolean`

#### Defined in

[src/responses/highlights.repository.edit-reel.response.ts:96](https://github.com/Nerixyz/instagram-private-api/blob/b3351b9/src/responses/highlights.repository.edit-reel.response.ts#L96)

___

### story\_is\_saved\_to\_archive

• **story\_is\_saved\_to\_archive**: `boolean`

#### Defined in

[src/responses/highlights.repository.edit-reel.response.ts:86](https://github.com/Nerixyz/instagram-private-api/blob/b3351b9/src/responses/highlights.repository.edit-reel.response.ts#L86)

___

### story\_quiz\_participant\_infos

• `Optional` **story\_quiz\_participant\_infos**: [`HighlightsRepositoryEditReelResponseStoryQuizParticipantInfosItem`](HighlightsRepositoryEditReelResponseStoryQuizParticipantInfosItem.md)[]

#### Defined in

[src/responses/highlights.repository.edit-reel.response.ts:88](https://github.com/Nerixyz/instagram-private-api/blob/b3351b9/src/responses/highlights.repository.edit-reel.response.ts#L88)

___

### story\_quizs

• `Optional` **story\_quizs**: [`HighlightsRepositoryEditReelResponseStoryQuizsItem`](HighlightsRepositoryEditReelResponseStoryQuizsItem.md)[]

#### Defined in

[src/responses/highlights.repository.edit-reel.response.ts:87](https://github.com/Nerixyz/instagram-private-api/blob/b3351b9/src/responses/highlights.repository.edit-reel.response.ts#L87)

___

### supports\_reel\_reactions

• **supports\_reel\_reactions**: `boolean`

#### Defined in

[src/responses/highlights.repository.edit-reel.response.ts:95](https://github.com/Nerixyz/instagram-private-api/blob/b3351b9/src/responses/highlights.repository.edit-reel.response.ts#L95)

___

### taken\_at

• **taken\_at**: `number`

#### Defined in

[src/responses/highlights.repository.edit-reel.response.ts:59](https://github.com/Nerixyz/instagram-private-api/blob/b3351b9/src/responses/highlights.repository.edit-reel.response.ts#L59)

___

### timezone\_offset

• **timezone\_offset**: `number`

#### Defined in

[src/responses/highlights.repository.edit-reel.response.ts:74](https://github.com/Nerixyz/instagram-private-api/blob/b3351b9/src/responses/highlights.repository.edit-reel.response.ts#L74)

___

### total\_viewer\_count

• **total\_viewer\_count**: `number`

#### Defined in

[src/responses/highlights.repository.edit-reel.response.ts:93](https://github.com/Nerixyz/instagram-private-api/blob/b3351b9/src/responses/highlights.repository.edit-reel.response.ts#L93)

___

### user

• **user**: [`HighlightsRepositoryEditReelResponseUser`](HighlightsRepositoryEditReelResponseUser.md)

#### Defined in

[src/responses/highlights.repository.edit-reel.response.ts:70](https://github.com/Nerixyz/instagram-private-api/blob/b3351b9/src/responses/highlights.repository.edit-reel.response.ts#L70)

___

### video\_codec

• `Optional` **video\_codec**: `string`

#### Defined in

[src/responses/highlights.repository.edit-reel.response.ts:100](https://github.com/Nerixyz/instagram-private-api/blob/b3351b9/src/responses/highlights.repository.edit-reel.response.ts#L100)

___

### video\_dash\_manifest

• `Optional` **video\_dash\_manifest**: `string`

#### Defined in

[src/responses/highlights.repository.edit-reel.response.ts:99](https://github.com/Nerixyz/instagram-private-api/blob/b3351b9/src/responses/highlights.repository.edit-reel.response.ts#L99)

___

### video\_duration

• `Optional` **video\_duration**: `number`

#### Defined in

[src/responses/highlights.repository.edit-reel.response.ts:104](https://github.com/Nerixyz/instagram-private-api/blob/b3351b9/src/responses/highlights.repository.edit-reel.response.ts#L104)

___

### video\_versions

• `Optional` **video\_versions**: [`HighlightsRepositoryEditReelResponseVideoVersionsItem`](HighlightsRepositoryEditReelResponseVideoVersionsItem.md)[]

#### Defined in

[src/responses/highlights.repository.edit-reel.response.ts:102](https://github.com/Nerixyz/instagram-private-api/blob/b3351b9/src/responses/highlights.repository.edit-reel.response.ts#L102)

___

### viewer\_count

• **viewer\_count**: `number`

#### Defined in

[src/responses/highlights.repository.edit-reel.response.ts:91](https://github.com/Nerixyz/instagram-private-api/blob/b3351b9/src/responses/highlights.repository.edit-reel.response.ts#L91)

___

### viewer\_cursor

• **viewer\_cursor**: ``null``

#### Defined in

[src/responses/highlights.repository.edit-reel.response.ts:92](https://github.com/Nerixyz/instagram-private-api/blob/b3351b9/src/responses/highlights.repository.edit-reel.response.ts#L92)

___

### viewers

• **viewers**: `any`[]

#### Defined in

[src/responses/highlights.repository.edit-reel.response.ts:90](https://github.com/Nerixyz/instagram-private-api/blob/b3351b9/src/responses/highlights.repository.edit-reel.response.ts#L90)


text:
/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */

package civsim.game;

/**
 *
 * @author Peter Molnar <molnar.peter@sztaki.mta.hu>
 */
public class Unit implements Comparable<Unit> {

    public final UnitType type;
    public final int strength;
    public final int wounds;
    public final boolean withMetalworking;

    public Unit(UnitType type, int strength, int wounds, boolean withMetalworking) {
        this.type = type;
        this.strength = strength;
        this.wounds = wounds;
        this.withMetalworking = withMetalworking;
    }

    public Unit(UnitType type, int strength, int wounds) {
        this(type, strength, wounds, false);
    }

    public Unit(UnitType type, int strength) {
        this(type, strength, 0, false);
    }

    public Unit(Unit unit, boolean withMetalworking) {
        this(unit.type, unit.strength, unit.wounds, withMetalworking);
    }

    public boolean isAlive() {
        return (wounds < strength);
    }

    public Unit hitBy(int strength) {
        return hitBy(strength, false);
    }

    public Unit hitBy(int strength, boolean withMetalworking) {
        return new Unit(type, this.strength, wounds + strength + (withMetalworking ? 3 : 0));
    }

    @Override
    public String toString() {
        return type.name() + "(" + strength + "/" + wounds + (withMetalworking ? "/MW" : "") + ")";
    }

    @Override
    public int hashCode() {
        int hash = 5;
        hash = 59 * hash + (this.type != null ? this.type.hashCode() : 0);
        hash = 59 * hash + this.strength;
        hash = 59 * hash + this.wounds;
        return hash;
    }

    @Override
    public boolean equals(Object obj) {
        if (obj == null) {
            return false;
        }
        if (getClass() != obj.getClass()) {
            return false;
        }
        final Unit other = (Unit) obj;
        if (this.type != other.type) {
            return false;
        }
        if (this.strength != other.strength) {
            return false;
        }
        if (this.wounds != other.wounds) {
            return false;
        }
        return true;
    }

    @Override
    public int compareTo(Unit o) {
        if (! type.equals(o.type)) {
            return type.compareTo(o.type);
        }
        else if (strength != o.strength) {
            return strength - o.strength;
        }

        return wounds - o.wounds;
    }
}

redpajama_set_name: RedPajamaGithub


text:
package com.ibcio;

import java.io.IOException;
import java.nio.CharBuffer;
import java.util.HashMap;
import java.util.Map;
import java.util.Set;

public class WebSocketMessageInboundPool {

	//保存连接的MAP容器
	private static final Map<String,WebSocketMessageInbound > connections = new HashMap<String,WebSocketMessageInbound>();

	//向连接池中添加连接
	public static void addMessageInbound(WebSocketMessageInbound inbound){
		//添加连接
		System.out.println("user : " + inbound.getUser() + " join..");
		connections.put(inbound.getUser(), inbound);
	}

	//获取所有的在线用户
	public static Set<String> getOnlineUser(){
		return connections.keySet();
	}

	public static void removeMessageInbound(WebSocketMessageInbound inbound){
		//移除连接
		System.out.println("user : " + inbound.getUser() + " exit..");
		connections.remove(inbound.getUser());
	}

	public static void sendMessageToUser(String user,String message){
		try {
			//向特定的用户发送数据
			System.out.println("send message to user : " + user + " ,message content : " + message);
			WebSocketMessageInbound inbound = connections.get(user);
			if(inbound != null){
				inbound.getWsOutbound().writeTextMessage(CharBuffer.wrap(message));
			}
		} catch (IOException e) {
			e.printStackTrace();
		}
	}

	//向所有的用户发送消息
	public static void sendMessage(String message){
		try {
			Set<String> keySet = connections.keySet();
			for (String key : keySet) {
				WebSocketMessageInbound inbound = connections.get(key);
				if(inbound != null){
					System.out.println("send message to user : " + key + " ,message content : " + message);
					inbound.getWsOutbound().writeTextMessage(CharBuffer.wrap(message));
				}
			}
		} catch (IOException e) {
			e.printStackTrace();
		}
	}
}


text:
<?php

use yii\helpers\Html;

/* @var $this yii\web\View */
/* @var $model app\models\PenerimaanBarang */

$this->title = 'Distribusi Barang';
$this->params['breadcrumbs'][] = $this->title;
?>

<?= Html::encode($this->title) ?>

    <?php if (Yii::$app->session->hasFlash('success')): ?>

			<?= Yii::$app->session->getFlash('success') ?>

	<?php endif; ?>

    <?= $this->render('_form', [
        'model' => $model,
        'modelDetails' => $modelDetails,
    ]) ?>


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

  <modelVersion>4.0.0</modelVersion>
  <groupId>${ivy.pom.groupId}</groupId>
  <artifactId>${ivy.pom.artifactId}</artifactId>
  <packaging>${ivy.pom.packaging}</packaging>
  <version>${ivy.pom.version}</version>
  <name>${ivy.pom.name}</name>
  <description>${ivy.pom.description}</description>
  <url>${ivy.pom.url}</url>
    <licenses>
        <license>
            <name>Apache 2</name>
            <url>http://www.apache.org/licenses/LICENSE-2.0.txt</url>
            <distribution>repo</distribution>
        </license>
    </licenses>
    <issueManagement>
        <system>Google Code</system>
        <url>http://code.google.com/p/${ivy.pom.artifactId}/issues</url>
    </issueManagement>

    <scm>
        <connection>scm:svn:http://${ivy.pom.artifactId}.googlecode.com/svn/trunk</connection>
        <developerConnection>scm:svn:https://${ivy.pom.artifactId}.googlecode.com/svn/trunk</developerConnection>
        <url>http://${ivy.pom.artifactId}.googlecode.com/svn/trunk</url>
    </scm>
</project>


text:
package org.nd4j.linalg.learning;

import lombok.Data;
import lombok.NoArgsConstructor;
import org.apache.commons.math3.util.FastMath;
import org.nd4j.linalg.api.ndarray.INDArray;
import org.nd4j.linalg.api.ops.impl.transforms.comparison.Max;
import org.nd4j.linalg.api.shape.Shape;
import org.nd4j.linalg.factory.Nd4j;
import org.nd4j.linalg.indexing.BooleanIndexing;
import org.nd4j.linalg.indexing.NDArrayIndex;
import org.nd4j.linalg.indexing.conditions.Conditions;
import org.nd4j.linalg.learning.config.AdaMax;
import org.nd4j.linalg.ops.transforms.Transforms;

import java.io.Serializable;

/**
 * The AdaMax updater, a variant of Adam.
 * http://arxiv.org/abs/1412.6980
 *
 * @author Justin Long
 */
@Data
public class AdaMaxUpdater implements GradientUpdater<AdaMax> {

    private final AdaMax config;

    private INDArray m, u; // moving avg & exponentially weighted infinity norm
    private char gradientReshapeOrder;

    public AdaMaxUpdater(AdaMax config) {
        this.config = config;
    }

    @Override
    public void setStateViewArray(INDArray viewArray, int[] gradientShape, char gradientOrder, boolean initialize) {
        if (!viewArray.isRowVector())
            throw new IllegalArgumentException("Invalid input: expect row vector input");
        if (initialize)
            viewArray.assign(0);
        int length = viewArray.length();
        this.m = viewArray.get(NDArrayIndex.point(0), NDArrayIndex.interval(0, length / 2));
        this.u = viewArray.get(NDArrayIndex.point(0), NDArrayIndex.interval(length / 2, length));

        //Reshape to match the expected shape of the input gradient arrays
        this.m = Shape.newShapeNoCopy(this.m, gradientShape, gradientOrder == 'f');
        this.u = Shape.newShapeNoCopy(this.u, gradientShape, gradientOrder == 'f');
        if (m == null || u == null)
            throw new IllegalStateException("Could not correctly reshape gradient view arrays");

        this.gradientReshapeOrder = gradientOrder;
    }

    /**
     * Calculate the update based on the given gradient
     *
     * @param gradient  the gradient to get the update for
     * @param iteration
     * @return the gradient
     */
    @Override
    public void applyUpdater(INDArray gradient, int iteration) {
        if (m == null || u == null)
            throw new IllegalStateException("Updater has not been initialized with view state");

        //m = B_1 * m + (1-B_1)*grad
        m.muli(config.getBeta1()).addi(gradient.mul(1-config.getBeta1()));

        //u = max(B_2 * u, |grad|)
        u.muli(config.getBeta2());
        Transforms.abs(gradient,false);   //In-place should be OK here, original gradient values aren't used again later
        Nd4j.getExecutioner().exec(new Max(u,gradient,u,u.length()));

        double beta1t = FastMath.pow(config.getBeta1(), iteration + 1);

        double alphat = config.getLearningRate() / (1.0 - beta1t);
        if (Double.isNaN(alphat) || Double.isInfinite(alphat) || alphat == 0.0) {
            alphat = config.getEpsilon();
        }

        u.addi(1e-32); // prevent NaNs in params
        gradient.assign(m).muli(alphat).divi(u);
    }
}


text:
require_relative '../../lib/hashy_db'
require 'mince/shared_examples/interface_example'

describe 'Mince Interface with HashyDb' do
  before do
    Mince::Config.interface = Mince::HashyDb::Interface
  end

  it_behaves_like 'a mince interface'
end


text:
define(function() {
	'use strict';

	var routeConfig = function($routeProvider) {
		$routeProvider
			.otherwise({
				redirectTo: '/demo'
			});
	};

	routeConfig.$inject = ['$routeProvider'];

	return routeConfig;
});


text:
<TITLE>Review for Whole Wide World, The (1996)</TITLE>
<LINK REL="STYLESHEET" TYPE="text/css" HREF="/ramr.css">

Whole Wide World, The (1996)

reviewed by
Scott Renshaw

                           THE WHOLE WIDE WORLD
                       A film review by Scott Renshaw
                        Copyright 1997 Scott Renshaw

(Sony Classics)
Starring:  Vincent D'Onofrio, Renee Zellweger, Ann Wedgeworth, Harve
Presnell.
Screenplay:  Michael Scott Myers, based on the memoir by Novalyne Price
Ellis.
Producers:  Kevin Reidy, Carl-Jan Colpeurt, Vincent D'Onofrio, Dan
Ireland.
Director:  Dan Ireland.
MPAA Rating:  PG (plentiful mild profanity, adult themes)
Running Time:  105 minutes.
Reviewed by Scott Renshaw.

     Bio-pics have been a Hollywood staple about as long as there has been
a Hollywood, but recently an entire sub-genre seems to have popped up
based on the tragic romances of real-life figures.  Beethoven in IMMORTAL
BELOVED, Dora Carrington in CARRINGTON, C. S. Lewis in SHADOWLANDS,
Picasso in SURVIVING PICASSO and Richard Feynman in INFINITY all have been
given solemn film treatments which play the "tortured/emotionally
repressed artist" card for all they are worth.  Some of these films worked
and some did not, but many of them inspired the question of whether we
would care all that much about the people involved if one or both of them
were not famous.  THE WHOLE WIDE WORLD is a polite, well-acted drama which
covers the same ground several times over in an hour and forty-five
minutes.

     THE WHOLE WIDE WORLD opens in west Texas in 1933, where a young
student and part-time school teacher named Novalyne Price (Renee
Zellweger) meets Robert E. "Bob" Howard (Vincent D'Onofrio), a friend of
her then-boyfriend.  Bob is a successful writer of adventure tales for
pulp magazines -- many featuring a creation named Conan the Barbarian --
and Novalyne's own aspirations toward being a writer lead her to turn to
Bob for advice.  The two become friends and frequent companions, but Bob
has difficulty returning Novalyne's affections as he focuses on his
writing and caring for his sickly mother (Ann Wedgeworth).  Over the
course of two years, Novalyne and Bob share an evolving relationship in
which Novalyne is one of the only people allowed inside Bob's tangled
emotions.

     THE WHOLE WIDE WORLD manages to stay fairly involving for much of its
running time largely thanks to the strong performances of the two leads.
Vincent D'Onofrio makes Bob Howard a complicated mix of Texas bluster and
buried pain, a fellow who lacks the emotional vocabulary to respond to
Novalyne's feelings.  Director Dan Ireland captures him vividly as he
describes Conan's world to Novalyne, and in his verbal accompaniment to
his own composition; Howard's fantasy world becomes his great escape from
his own life.  Renee Zellweger does nice work with a tough part, a woman
who is attracted to the teller of tall tales then finds herself unable to
"civilize" him.  She walks a fine line between anachronistic liberation
and discomfiting masochism, yet generally finds the right note of earnest
frustration.  Together Zellweger and D'Onofrio make an intriguing pair, a
couple of kindred spirits who nevertheless are quite obviously wrong for
each other.

     Therein lies THE WHOLE WIDE WORLD's fundamental flaw as a romantic
drama:  it is never really possible to root for the protagonists to end up
together.  Michael Scott Myers' script is based on an autobiographical
memoir by Novalyne Price Ellis, who clearly was deeply affected by her
friendship with Bob Howard.  As honestly felt as it might be, however, her
story lacks a narrative push.  Novalyne and Bob spend a lot of time
together, argue over philosophical differences, then make up; this process
occurs once then repeats three or four times.  The interaction between the
two is pleasantly interesting, but it isn't enough to sustain a story in
which neither character ends up changing very much.  The sad fact is that
the story might have been simply Novalyne's attempt to work through some
guilt issues (Howard committed suicide in 1935), and THE WHOLE WIDE WORLD
is affectionate without being compelling.  When Novalyne pronounces late
in the film that she was happy to have known Bob Howard, you don't doubt
her sincerity.  You just wonder why that sentiment warranted a feature
film.

     The only time THE WHOLE WIDE WORLD flirts with truly intriguing
material is when it focuses on Bob's relationship with his mother, played
with pallid possessiveness by Ann Wedgeworth.  There is an intense Oedipal
sub-text to Bob's obsessive need to care for his mother, and a scene in
which he changes her sweat-soaked nightgown after a feverish night is both
subtle and daring.  There is so much more going on in that relationship
than in the one between Bob and Novalyne that you wish Ireland or Myers
had recognized it.  But this is Novalyne's story, so she is always front
and center, static though she might be.  Don't expect a love story in THE
WHOLE WIDE WORLD.  At most it is a "like" story, and might have been
ignored politely if one of the two likers had not created Conan the
Barbarian.

     On the Renshaw scale of 0 to 10 pulp afflictions:  5.

                     Visit Scott Renshaw's MoviePage
                http://www-leland.stanford.edu/~srenshaw
             Subscribe to receive reviews directly via email
                       See details on the MoviePage

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:
Display Text

Selected Value

                    <input type="checkbox" disabled />
                    <input type="text" data-bind="value: optionLabel, hasFocus: isSelected" class="form-control" onfocus="this.value = this.value;" onclick="this.select(); return false;" />

                    <input type="text" data-bind="value: optionValue" class="form-control" onfocus="this.value = this.value;" onclick="this.select(); return false;" />

                <input type="checkbox" data-bind="command: addNewOptionCommand" style="cursor: pointer" tabindex="-1" disabled="disabled" />
                <input type="text" data-bind="value: optionToAdd, valueUpdate: 'input', command: addNewOptionCommand" class="form-control" style="cursor: pointer" placeholder="Click to add option" />


text:
;(function(){

  var dataURLToBlob = function(data_url) {
    try {
      var type = data_url.split(';')[0].split(':')[1];
      var base64 = data_url.split(',')[1];
      var raw = window.atob(base64);
      var uarr = new Uint8Array(raw.length);

      for(var i=0; i<raw.length; ++i) {
        uarr[i] = raw.charCodeAt(i);
      }

      return new Blob([uarr], {type: type});
    } catch (error) {
      return new Blob();
    }
  };

  var isFunction = function(func) {
    return func && new Object().toString.call(func)==="[object Function]"
  }

  var NativeFileReader = window.FileReader;

  if( isFunction(NativeFileReader) &&
      isFunction(new NativeFileReader().readAsDataURL) ) {

    NativeFileReader.prototype.readAsBlob = function(file) {
      var self = this;
      var file_reader = new NativeFileReader();
      var events = ["onabort", "onerror", "onload", "onloadend", "onloadstart", "onprogress"];

      self.__defineGetter__("result", function(){ return dataURLToBlob(file_reader.result)});
      self.__defineGetter__("readyState", function() { return file_reader.readyState});

      events.forEach(function(event_name){
        file_reader[event_name] = function(e) {
          if(isFunction(self[event_name])) {
            e.__defineGetter__("currentTarget", function(){ return self; });
            self[event_name].call(self, e);
          }
        }
      });

      file_reader.readAsDataURL(file);

    }

    //window.FileReader = NativeFileReader;
  }

})(window);


text:
<?php

namespace Payum\Sofort\Tests\Action\Api;

use Payum\Core\Action\ActionInterface;
use Payum\Core\ApiAwareInterface;
use Payum\Sofort\Request\Api\CreateTransaction;
use Payum\Sofort\Action\Api\CreateTransactionAction;
use Payum\Sofort\Api;

class CreateTransactionActionTest extends \PHPUnit\Framework\TestCase
{
    /**
     * @test
     */
    public function shouldImplementActionInterface()
    {
        $rc = new \ReflectionClass(CreateTransactionAction::class);

        $this->assertTrue($rc->isSubclassOf(ActionInterface::class));
    }

    /**
     * @test
     */
    public function shouldImplementApiAwareInterface()
    {
        $rc = new \ReflectionClass(CreateTransactionAction::class);

        $this->assertTrue($rc->isSubclassOf(ApiAwareInterface::class));
    }

    /**
     * @test
     */
    public function shouldSupportCreateTransactionRequestWithArrayAccessAsModel()
    {
        $action = new CreateTransactionAction();

        $this->assertTrue($action->supports(new CreateTransaction($this->createMock('ArrayAccess'))));
    }

    /**
     * @test
     */
    public function shouldNotSupportAnythingCreateTransactionRequest()
    {
        $action = new CreateTransactionAction($this->createApiMock());

        $this->assertFalse($action->supports(new \stdClass()));
    }

    /**
     * @test
     */
    public function throwIfNotSupportedRequestGivenAsArgumentForExecute()
    {
        $this->expectException(\Payum\Core\Exception\RequestNotSupportedException::class);
        $action = new CreateTransactionAction($this->createApiMock());

        $action->execute(new \stdClass());
    }

    /**
     * @test
     */
    public function throwIfAmountParameterIsNotSet()
    {
        $this->expectException(\Payum\Core\Exception\LogicException::class);
        $this->expectExceptionMessage('The amount, currency_code, reason, success_url, notification_url fields are required.');
        $action = new CreateTransactionAction();

        $request = new CreateTransaction(array());
        $action->execute($request);
    }

    /**
     * @test
     */
    public function throwIfCurrencyCodeParameterIsNotSet()
    {
        $this->expectException(\Payum\Core\Exception\LogicException::class);
        $this->expectExceptionMessage('The currency_code, reason, success_url, notification_url fields are required.');
        $action = new CreateTransactionAction();

        $request = new CreateTransaction(array('amount' => 55));
        $action->execute($request);
    }

    /**
     * @test
     */
    public function throwIfReasonParameterIsNotSet()
    {
        $this->expectException(\Payum\Core\Exception\LogicException::class);
        $this->expectExceptionMessage('The reason, success_url, notification_url fields are required.');
        $action = new CreateTransactionAction();

        $request = new CreateTransaction(array('amount' => 55, 'currency_code' => 'CHF'));
        $action->execute($request);
    }

    /**
     * @return \PHPUnit_Framework_MockObject_MockObject|\Payum\Sofort\Api
     */
    protected function createApiMock()
    {
        return $this->createMock(Api::class, array(), array(), '', false);
    }
}


text:
from django.contrib import admin
from geelweb.django.editos.models import Edito

admin.site.register(Edito)


text:
package todolist.bindingModel;

public class TaskBindingModel {

    private String title;

    private String comments;

    public TaskBindingModel() {

    }

    public String getTitle() {
        return title;
    }

    public void setTitle(String title) {
        this.title = title;
    }

    public String getComments() {
        return comments;
    }

    public void setComments(String comments) {
        this.comments = comments;
    }
}


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

	<meta http-equiv="Content-type" content="text/html; charset=utf-8">
	<title>For demo purpose only :: &1</title>

	<link rel='stylesheet' type='text/css' href='../../codebase/dhtmlxscheduler.css'>


text:
<?php

class Conn extends PDO {
    private static $instance;
    protected $dbName;

    function __construct() {
        $conf = json_decode(file_get_contents(__DIR__ . '/config.json'), true);
        $dsn = self::template($conf['DSN'], $conf);
        parent::__construct($dsn, $conf['user'], $conf['password']);
        $this->dbName = $conf["db"];
        $this->exec("set character set utf8");
    }

    public static function getInstance() {
        if (!isset(self::$instance)) {
            self::$instance = new self();
        }

        return self::$instance;
    }

    protected static function template($str, $arr) {
        foreach ($arr as $key => $value) {
            $str = str_replace('{{' . $key . '}}', $value, $str);
        }

        return $str;
    }

    public function fetchTableData($table, $field = null, $values = null, $operator = "=", $orderby = array(), $invert = false, $limit = false, $fields = "*") {
        $where = array();

        if (!is_array($values)) {
            $values = array($values);
        }

        foreach ($values as $i => $value) {
            if ($value !== null && $field !== '') {
                $filter = array();

                if ($invert) {
                    $filter['query'] = "? $operator $field";
                } else {
                    $filter['query'] = "$field $operator ?";
                }
                $filter['param'] = $value;

                array_push($where, $filter);
            }
        }

        return $this->fetchTableDataF($table, $where, $orderby, $limit, $fields);
    }

    public function fetchTableDataF($table, $filter = array(), $orderby = array(), $limit = false, $andOr = "AND", $fields = "*") {
        $param = array();
        $where = array();

        foreach ($filter as $key => $value) {
            array_push($param, $value['param']);
            array_push($where, $value['query']);
        }

        $where = implode(" $andOr ", $where);
        if (strlen(trim($where)) > 0) $where = "where $where";

        if ($limit !== false) {
            $limit = (int) $limit;
            $limit = "LIMIT $limit";
        }

        if (is_array($orderby)) {
            $orderby = implode(', ', array_filter($orderby));
            if (strlen(trim($orderby)) > 0) {
                $orderby = "ORDER BY $orderby";
            }
        } else {
            $orderby = '';
        }

        $sql = "select $fields from `$table` $where $orderby $limit";

        return $this->getSQLArray($sql, $param);
    }

    public function fetchSimpleData($table, $options = array()) {
        $list = array();
        $list["filter"] = array();
        $list["orderby"] = array();
        $list["limit"] = false;
        $list["andOr"] = "and";
        $list["fields"] = '*';

        foreach ($options as $key => $value) {
            if (isset($list[$key])) {
                $list[$key] = $value;
            }
        }

        $result = $this->fetchTableDataF($table, $list["filter"], $list["orderby"], $list["limit"], $list["andOr"], $list["fields"]);

        return $result;
    }

    public function assembleFilter($values, $operator = "=") {
        $result = array();

        $isContaining = ($operator == "containing");

        foreach ($values as $key => $value) {
            if ($isContaining) {
                $op = "like";
                $value = "%$value%";
            } else {
                $op = $operator;
            }

            array_push($result, array(
                "query" => "$key $op ?",
                "param" => $value
            ));
        }

        return $result;
    }

    public function fetchTableMeta($table) {
        $sql =
        "select
            column_name,
            data_type
        from information_schema.columns
        where
            table_name = ?
        and table_schema = ?
        ";

        $array = $this->getSQLArray($sql, array($table, $this->dbName));

        $result = array();

        foreach ($array as $value) {
            $result[$value['column_name']] = $value['data_type'];
        }

        return $result;
    }

    public function fetchTablePK($table) {
        $sql =
        "select distinct
            column_name
        from information_schema.columns
        where
            table_name = ?
        and table_schema = ?
        and column_key = 'PRI'
        ";

        $array = $this->getSQLArray($sql, array($table, $this->dbName));

        return $array[0]["column_name"];
    }

    public function getSQLArray($sql, $param = array()) {
        $result = array();

        $stmt = $this->prepare($sql);

        if (!$stmt->execute($param)) return $result;

        while ($row = $stmt->fetch(parent::FETCH_ASSOC)) {
            array_push($result, $row);
        }

        return $result;
    }

    public function executeSQL($sql, $param = array()) {
        $stmt = $this->prepare($sql);

        if (!$stmt->execute($param)) {
            $err = $stmt->errorInfo();
            throw new Exception($err[2], (int) $err[0]);
            return false;
        }

        return true;
    }

    public function runInsert($sql, $param = array()) {
        $result = false;

        $this->beginTransaction();
        $stmt = $this->prepare($sql);

        if ($stmt->execute($param)) {
            $result = $this->lastInsertId();
            $this->commit();
        } else {
            $err = $stmt->errorInfo();
            $this->rollBack();
            throw new Exception($err[2], $err[0]);
        }

        return $result;
    }
}


text:
// -*- mode: C++; tab-width: 4 -*-
// vi: ts=4

#ifndef _DPX_WRITERINTERNAL_H
#define _DPX_WRITERINTERNAL_H 1

#include "BaseTypeConverter.h"

namespace dpx
{

	void EndianBufferSwap(int bitdepth, dpx::Packing packing, void *buf, const size_t size)
	{
		switch (bitdepth)
		{
		case 8:
			break;
		case 12:
			if (packing == dpx::kPacked)
				dpx::EndianSwapImageBuffer<dpx::kInt>(buf, size / sizeof(U32));
			else
				dpx::EndianSwapImageBuffer<dpx::kWord>(buf, size / sizeof(U16));
			break;
		case 16:
			dpx::EndianSwapImageBuffer<dpx::kWord>(buf, size / sizeof(U16));
			break;
		default:		// 10-bit, 32-bit, 64-bit
			dpx::EndianSwapImageBuffer<dpx::kInt>(buf, size / sizeof(U32));
		}
	}

	template <typename T1, typename T2>
	void MultiTypeBufferCopy(T1 *dst, T2 *src, const int len)
	{
		for (int i = 0; i < len; i++)
			BaseTypeConverter(src[i], dst[i]);
	}

	template <typename IB>
	void CopyWriteBuffer(DataSize src_size, unsigned char *src, IB * dst, const int len)
	{
		if (src_size == kByte)
			MultiTypeBufferCopy<IB, U8>(dst, reinterpret_cast<U8 *>(src), len);
		else if (src_size == kWord)
			MultiTypeBufferCopy<IB, U16>(dst, reinterpret_cast<U16 *>(src), len);
		else if (src_size == kFloat)
			MultiTypeBufferCopy<IB, R32>(dst, reinterpret_cast<R32 *>(src), len);
		else if (src_size == kDouble)
			MultiTypeBufferCopy<IB, R64>(dst, reinterpret_cast<R64 *>(src), len);

	}

	// access modifications to the buffer based on compression and packing
	struct BufferAccess
	{
		int offset;
		int length;
		BufferAccess() : offset(0), length(0) { }
	};

	// \todo NOT DONE
	template <typename IB, int BITDEPTH>
	void RleCompress(IB *src, IB *dst, const int bufsize, const int len, BufferAccess &access)
	{
		/*IB ch;
		int count;
		int i;
		int index = bufsize - 1;
		bool start = true;
		//bool match = true;

		// for each data type, have maximum length of rle datum
		// subtract one so it the LSBit can be used to state
		int maxCount;
		if (BITDEPTH == 8)
			maxCount = 0xff - 1;
		else if (BITDEPTH == 10)
			maxCount = 0x3ff - 1;
		else if (BITDEPTH == 12)
			maxCount = 0xfff - 1;
		else if (BITDEPTH == 16)
			maxCount = 0xffff - 1;
		else
			maxCount = 1000000;		// high number for floats, doubles

		for (i = len - 1; i >= 0; i--)
		{
			if (start)
			{
				count = 1;
				start = false;
				ch = src[i];
				dst[index--] = ch;
			}
		}

		access.offset = index;
		access.length = bufsize - index;*/
	}

	template <typename IB, int BITDEPTH>
	void WritePackedMethod(IB *src, IB *dst, const int len, const bool reverse, BufferAccess &access)
	{
		// pack into the same memory space
		U32 *dst_u32 = reinterpret_cast<U32*>(dst);

		// bit shift count for U16 source
		const int shift = 16 - BITDEPTH;

		// bit mask
		U32 mask = 0;
		if (BITDEPTH == 10)
			mask = 0x03ff;
		else if (BITDEPTH == 12)
			mask = 0x0fff;
		else if (BITDEPTH == 8)
			return;

		int i, entry;
		for (i = 0; i < len; i++)
		{
			// read value and determine write location
			U32 value = static_cast<U32>(src[i+access.offset]) >> shift;

			// if reverse the order
/*** XXX TODO REVERSE
			if (reverse)
				// reverse the triplets so entry would be 2,1,0,5,4,3,8,7,6,...
				entry = ((i / 3) * 3) + (2 - (i % 3));
			else
***/
				entry = i;

			int div = (entry * BITDEPTH) / 32;			// 32 bits in a U32
			int rem = (entry * BITDEPTH) % 32;

			// write the bits that belong in the first U32
			// calculate the masked bits for the added value
			U32 shift_mask = mask << rem;

			// mask sure to mask the bits to save as part of the src_buf
			// so if writing bits 8-18, save the bits of the source material
			dst_u32[div] = (dst_u32[div] & ~shift_mask) | ((value << rem) & shift_mask);

			// write across multiple U16? count the carry bits
			int carry = BITDEPTH - (32 - rem);
			if (carry > 0)
			{
				U32 save = BITDEPTH - carry;
				dst_u32[div+1] = (dst_u32[div+1] & ~(mask >> save)) | ((value >> save) & (mask >> save));
			}
		}

		// adjust offset/length
		access.offset = 0;
		access.length = (((len * BITDEPTH) / 32) + ((len * BITDEPTH) % 32 ? 1 : 0)) * 2;
	}

	// this routine expects a type of U16
	template <typename IB, Packing METHOD>
	void WritePackedMethodAB_10bit(IB *src, IB *dst, const int len, const bool reverse, BufferAccess &access)
	{
		// pack into the same memory space
		U32 *dst_u32 = reinterpret_cast<U32*>(dst);

		// bit shift count
		const U32 shift = 6;  // (16 - BITDEPTH)
		const U32 bitdepth = 10;
		const U32 bitmask = 0x03ff;

		// shift bits over 2 if Method A
		const int method_shift = (METHOD == kFilledMethodA ? 2 : 0);

		// loop through the buffer
		int i;
		U32 value = 0;
		for (i = 0; i < len; i++)
		{
			int div = i / 3;			// 3 10-bit values in a U32
			int rem = i % 3;

			// write previously calculated value
			if (i && rem == 0)
			{
				dst_u32[div-1] = value;
				value = 0;
			}

			// if reverse the order
			if (reverse)
				rem = 2 - rem;

			// place the 10 bits in the proper place with mask
			U32 comp = ((static_cast<U32>(src[i+access.offset]) >> shift) << (bitdepth * rem)) << method_shift;
			U32 mask = (bitmask << (bitdepth * rem)) << method_shift ;

			// overwrite only the proper 10 bits
			value = (value & ~mask) | (comp & mask);
		}

		// write last
		dst_u32[(len+2)/3-1] = value;

		// adjust offset/length
		// multiply * 2 because it takes two U16 = U32 and this func packs into a U32
		access.offset = 0;
		access.length = ((len / 3) + (len % 3 ? 1 : 0)) * 2;
	}

	template <typename IB, int BITDEPTH, bool SAMEBUFTYPE>
	int WriteBuffer(OutStream *fd, DataSize src_size, void *src_buf, const U32 width, const U32 height, const int noc, const Packing packing,
					const bool rle, bool reverse, const int eolnPad, char *blank, bool &status, bool swapEndian)
	{
		int fileOffset = 0;

		// determine any impact on the max line size due to RLE
		// impact may be that rle is true but the data can not be compressed at all
		// the worst possible compression with RLE is increasing the image size by 1/3
		// so we will just double the destination size if RLE
		int rleBufAdd = (rle ? ((width * noc / 3) + 1) : 0);

		// buffer access parameters
		BufferAccess bufaccess;
		bufaccess.offset = 0;
		bufaccess.length = width * noc;

		// allocate one line
		IB *src;
		IB *dst = new IB[(width * noc) + 1 + rleBufAdd];

		// not exactly sure why, but the datum order is wrong when writing 4-channel images, so reverse it
		if (noc == 4 && BITDEPTH == 10)
			reverse = !reverse;

		// each line in the buffer
		for (U32 h = 0; h < height; h++)
		{
			// image buffer
			unsigned char *imageBuf = reinterpret_cast<unsigned char*>(src_buf);
			const int bytes = Header::DataSizeByteCount(src_size);

			// copy buffer if need to promote data types from src to destination
			if (SAMEBUFTYPE)
			{
				src = dst;
				CopyWriteBuffer<IB>(src_size, (imageBuf+(h*width*noc*bytes)+(h*eolnPad)), dst, (width*noc));
			}
			else
				// not a copy, access source
				src = reinterpret_cast<IB*>(imageBuf + (h * width * noc * bytes) + (h*eolnPad));

			// if rle, compress
			if (rle)
			{
				RleCompress<IB, BITDEPTH>(src, dst, ((width * noc) + rleBufAdd), width * noc, bufaccess);
				src = dst;
			}

			// if 10 or 12 bit, pack
			if (BITDEPTH == 10)
			{
				if (packing == dpx::kPacked)
				{
					WritePackedMethod<IB, BITDEPTH>(src, dst, (width*noc), reverse, bufaccess);
				}
				else if (packing == kFilledMethodA)
				{
					WritePackedMethodAB_10bit<IB, dpx::kFilledMethodA>(src, dst, (width*noc), reverse, bufaccess);
				}
				else // if (packing == dpx::kFilledMethodB)
				{
					WritePackedMethodAB_10bit<IB, dpx::kFilledMethodB>(src, dst, (width*noc), reverse, bufaccess);
				}
			}
			else if (BITDEPTH == 12)
			{
				if (packing == dpx::kPacked)
				{
					WritePackedMethod<IB, BITDEPTH>(src, dst, (width*noc), reverse, bufaccess);
				}
				else if (packing == dpx::kFilledMethodB)
				{
					// shift 4 MSB down, so 0x0f00 would become 0x00f0
					for (int w = 0; w < bufaccess.length; w++)
						dst[w] = src[bufaccess.offset+w] >> 4;
					bufaccess.offset = 0;
				}
				// a bitdepth of 12 by default is packed with dpx::kFilledMethodA
				// assumes that either a copy or rle was required
				// otherwise this routine should not be called with:
				//     12-bit Method A with the source buffer data type is kWord
			}

			// write line
			fileOffset += (bufaccess.length * sizeof(IB));
			if (swapEndian)
			    EndianBufferSwap(BITDEPTH, packing, dst + bufaccess.offset, bufaccess.length * sizeof(IB));
			if (fd->Write(dst+bufaccess.offset, (bufaccess.length * sizeof(IB))) == false)
			{
				status = false;
				break;
			}

			// end of line padding
			if (eolnPad)
			{
				fileOffset += eolnPad;
				if (fd->Write(blank, eolnPad) == false)
				{
					status = false;
					break;
				}
			}

		}

		// done with buffer
		delete [] dst;

		return fileOffset;
	}

	template <typename IB, int BITDEPTH, bool SAMEBUFTYPE>
	int WriteFloatBuffer(OutStream *fd, DataSize src_size, void *src_buf, const U32 width, const U32 height, const int noc, const Packing packing,
					const bool rle, const int eolnPad, char *blank, bool &status, bool swapEndian)
	{
		int fileOffset = 0;

		// determine any impact on the max line size due to RLE
		// impact may be that rle is true but the data can not be compressed at all
		// the worst possible compression with RLE is increasing the image size by 1/3
		// so we will just double the destination size if RLE
		int rleBufAdd = (rle ? ((width * noc / 3) + 1) : 0);

		// buffer access parameters
		BufferAccess bufaccess;
		bufaccess.offset = 0;
		bufaccess.length = width * noc;

		// allocate one line
		IB *src;
		IB *dst = new IB[(width * noc) + rleBufAdd];

		// each line in the buffer
		for (U32 h = 0; h < height; h++)
		{
			// image buffer
			unsigned char *imageBuf = reinterpret_cast<unsigned char*>(src_buf);
			const int bytes = Header::DataSizeByteCount(src_size);

			// copy buffer if need to promote data types from src to destination
			if (!SAMEBUFTYPE)
			{
				src = dst;
				CopyWriteBuffer<IB>(src_size, (imageBuf+(h*width*noc*bytes)+(h*eolnPad)), dst, (width*noc));
			}
			else
				// not a copy, access source
				src = reinterpret_cast<IB*>(imageBuf + (h * width * noc * bytes) + (h*eolnPad));

			// if rle, compress
			if (rle)
			{
				RleCompress<IB, BITDEPTH>(src, dst, ((width * noc) + rleBufAdd), width * noc, bufaccess);
				src = dst;
			}

			// write line
			fileOffset += (bufaccess.length * sizeof(IB));
			if (swapEndian)
			    EndianBufferSwap(BITDEPTH, packing, dst + bufaccess.offset, bufaccess.length * sizeof(IB));
			if (fd->Write(dst+bufaccess.offset, (bufaccess.length * sizeof(IB))) == false)
			{
				status = false;
				break;
			}

			// end of line padding
			if (eolnPad)
			{
				fileOffset += eolnPad;
				if (fd->Write(blank, eolnPad) == false)
				{
					status = false;
					break;
				}
			}

		}

		// done with buffer
		delete [] dst;

		return fileOffset;
	}
}

#endif


text:
"""
Support for Vera lights.

For more details about this platform, please refer to the documentation at
https://home-assistant.io/components/light.vera/
"""
import logging

from homeassistant.components.light import (
    ATTR_BRIGHTNESS, ATTR_RGB_COLOR, ENTITY_ID_FORMAT,
    SUPPORT_BRIGHTNESS, SUPPORT_RGB_COLOR, Light)
from homeassistant.components.vera import (
    VERA_CONTROLLER, VERA_DEVICES, VeraDevice)

_LOGGER = logging.getLogger(__name__)

DEPENDENCIES = ['vera']

# pylint: disable=unused-argument
def setup_platform(hass, config, add_devices, discovery_info=None):
    """Set up the Vera lights."""
    add_devices(
        VeraLight(device, VERA_CONTROLLER) for device in VERA_DEVICES['light'])

class VeraLight(VeraDevice, Light):
    """Representation of a Vera Light, including dimmable."""

    def __init__(self, vera_device, controller):
        """Initialize the light."""
        self._state = False
        self._color = None
        self._brightness = None
        VeraDevice.__init__(self, vera_device, controller)
        self.entity_id = ENTITY_ID_FORMAT.format(self.vera_id)

    @property
    def brightness(self):
        """Return the brightness of the light."""
        return self._brightness

    @property
    def rgb_color(self):
        """Return the color of the light."""
        return self._color

    @property
    def supported_features(self):
        """Flag supported features."""
        if self._color:
            return SUPPORT_BRIGHTNESS | SUPPORT_RGB_COLOR
        else:
            return SUPPORT_BRIGHTNESS

    def turn_on(self, **kwargs):
        """Turn the light on."""
        if ATTR_RGB_COLOR in kwargs and self._color:
            self.vera_device.set_color(kwargs[ATTR_RGB_COLOR])
        elif ATTR_BRIGHTNESS in kwargs and self.vera_device.is_dimmable:
            self.vera_device.set_brightness(kwargs[ATTR_BRIGHTNESS])
        else:
            self.vera_device.switch_on()

        self._state = True
        self.schedule_update_ha_state(True)

    def turn_off(self, **kwargs):
        """Turn the light off."""
        self.vera_device.switch_off()
        self._state = False
        self.schedule_update_ha_state()

    @property
    def is_on(self):
        """Return true if device is on."""
        return self._state

    def update(self):
        """Call to update state."""
        self._state = self.vera_device.is_switched_on()
        if self.vera_device.is_dimmable:
            # If it is dimmable, both functions exist. In case color
            # is not supported, it will return None
            self._brightness = self.vera_device.get_brightness()
            self._color = self.vera_device.get_color()


text:
package de.lessvoid.nifty.examples.table;

import de.lessvoid.nifty.controls.ListBox;
import de.lessvoid.nifty.elements.Element;
import de.lessvoid.nifty.elements.render.PanelRenderer;
import de.lessvoid.nifty.elements.render.TextRenderer;
import de.lessvoid.nifty.tools.Color;

/**
 * The ViewConverter class that connects the model class (TableRow) to the nifty world.
 */
class TableRowViewConverter implements ListBox.ListBoxViewConverter<TableRow> {
  @Override
  public void display(final Element listBoxItem, final TableRow item) {
    for (int i=0; i<5; i++) {
      Color color = new Color("#ff05");
      if (item.index % 2 == 0) {
        color = new Color("#00f5");
      }
      // get the text element for the row
      Element textElement = listBoxItem.findElementByName("#col-" + String.valueOf(i));
      textElement.getRenderer(TextRenderer.class).setText(item.data[i]);
      listBoxItem.getRenderer(PanelRenderer.class).setBackgroundColor(color);
    }
  }

  @Override
  public int getWidth(final Element listBoxItem, final TableRow item) {
    int width = 0;
    for (int i=0; i<5; i++) {
      TextRenderer renderer = listBoxItem.findElementByName("#col-" + String.valueOf(i)).getRenderer(TextRenderer.class);
      width += renderer.getFont().getWidth(item.data[i]);
    }
    return width;
  }
}


text:
import xlsxwriter

workbook = xlsxwriter.Workbook('chart_pie.xlsx')

worksheet = workbook.add_worksheet()
bold = workbook.add_format({'bold': 1})

# Add the worksheet data that the charts will refer to.
headings = ['Category', 'Values']
data = [
    ['Apple', 'Cherry', 'Pecan'],
    [60, 30, 10],
]

worksheet.write_row('A1', headings, bold)
worksheet.write_column('A2', data[0])
worksheet.write_column('B2', data[1])

#######################################################################
#
# Create a new chart object.
#
chart1 = workbook.add_chart({'type': 'pie'})

# Configure the series. Note the use of the list syntax to define ranges:
chart1.add_series({
    'name':       'Pie sales data',
    'categories': ['Sheet1', 1, 0, 3, 0],
    'values':     ['Sheet1', 1, 1, 3, 1],
})

# Add a title.
chart1.set_title({'name': 'Popular Pie Types'})

# Set an Excel chart style. Colors with white outline and shadow.
chart1.set_style(10)

# Insert the chart into the worksheet (with an offset).
worksheet.insert_chart('C2', chart1, {'x_offset': 25, 'y_offset': 10})

#######################################################################
#
# Create a Pie chart with user defined segment colors.
#

# Create an example Pie chart like above.
chart2 = workbook.add_chart({'type': 'pie'})

# Configure the series and add user defined segment colors.
chart2.add_series({
    'name': 'Pie sales data',
    'categories': '=Sheet1!$A$2:$A$4',
    'values':     '=Sheet1!$B$2:$B$4',
    'points': [
        {'fill': {'color': '#5ABA10'}},
        {'fill': {'color': '#FE110E'}},
        {'fill': {'color': '#CA5C05'}},
    ],
})

# Add a title.
chart2.set_title({'name': 'Pie Chart with user defined colors'})

# Insert the chart into the worksheet (with an offset).
worksheet.insert_chart('C18', chart2, {'x_offset': 25, 'y_offset': 10})

#######################################################################
#
# Create a Pie chart with rotation of the segments.
#

# Create an example Pie chart like above.
chart3 = workbook.add_chart({'type': 'pie'})

# Configure the series.
chart3.add_series({
    'name': 'Pie sales data',
    'categories': '=Sheet1!$A$2:$A$4',
    'values':     '=Sheet1!$B$2:$B$4',
})

# Add a title.
chart3.set_title({'name': 'Pie Chart with segment rotation'})

# Change the angle/rotation of the first segment.
chart3.set_rotation(90)

# Insert the chart into the worksheet (with an offset).
worksheet.insert_chart('C34', chart3, {'x_offset': 25, 'y_offset': 10})

workbook.close()


text:
<?php
/**
 * @author mkelly
 * @date 6/14/17
 */

namespace Hydra\Gordian\Contracts;

abstract class AbstractRenderer
{
    abstract public function render(AbstractRenderable $renderable): string;
}


text:
<!doctype html>

{% load pages_tags mezzanine_tags i18n future staticfiles %}

<meta http-equiv="Content-type" content="text/html; charset=utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<meta name="keywords" content="{% block meta_keywords %}{% endblock %}">
<meta name="description" content="{% block meta_description %}{% endblock %}">
<title>{% block meta_title %}{% endblock %}{% if settings.SITE_TITLE %} | {{ settings.SITE_TITLE }}{% endif %}</title>
<link rel="shortcut icon" href="{% static "img/favicon.ico" %}">

{% ifinstalled mezzanine.blog %}
<link rel="alternate" type="application/rss+xml" title="RSS" href="{% url "blog_post_feed" "rss" %}">
<link rel="alternate" type="application/atom+xml" title="Atom" href="{% url "blog_post_feed" "atom" %}">
{% endifinstalled %}

{% compress css %}
	<link rel="stylesheet" href="{% static "css/bootstrap.min.css" %}">

	<link rel="stylesheet" href="{% static "css/mezzanine.css" %}">
    <link rel="stylesheet" href="{% static "css/bootstrap-responsive.min.css" %}">
    <link rel="stylesheet" href="{% static "css/font-awesome.min.css" %}">
    <link rel="stylesheet" href="{% static "css/main.css" %}">
    <link rel="stylesheet" href="{% static "css/sl-slide.css" %}">

    <link rel="shortcut icon" href="{% static "images/ico/favicon.ico" %}">
    <link rel="apple-touch-icon-precomposed" sizes="144x144" href="{% static "images/ico/apple-touch-icon-144-precomposed.png" %}">
    <link rel="apple-touch-icon-precomposed" sizes="114x114" href="{% static "images/ico/apple-touch-icon-114-precomposed.png " %}">
    <link rel="apple-touch-icon-precomposed" sizes="72x72" href="{% static "images/ico/apple-touch-icon-72-precomposed.png" %}">
    <link rel="apple-touch-icon-precomposed" href="{% static "images/ico/apple-touch-icon-57-precomposed.png" %}">

{% if LANGUAGE_BIDI %}
<link rel="stylesheet" href="{% static "css/rtl.css" %}">
{% endif %}
{% ifinstalled cartridge.shop %}
<link rel="stylesheet" href="{% static "css/cartridge.css" %}">
{% if LANGUAGE_BIDI %}
<link rel="stylesheet" href="{% static "css/cartridge.rtl.css" %}">
{% endif %}
{% endifinstalled %}
{% block extra_css %}{% endblock %}
{% endcompress %}

{% compress js %}

{% block extra_js %}{% endblock %}
{% include "includes/footer_scripts.html" %}
{% endcompress %}

{% block extra_head %}{% endblock %}

			   {% page_menu "pages/menus/dropdown.html" %}

{% block all_content %}

{% block title_wrapper %}

{% block title %}{% endblock %}

                       {% spaceless %}
						{% block breadcrumb_menu %}{% page_menu "pages/menus/breadcrumb.html" %}{% endblock %}
					   {% endspaceless %}

{% endblock %}

		{% block left_wrapper %}

				{% block left_panel %}

{% page_menu "pages/menus/tree.html" %}

				{% endblock %}

		{% endblock %}
	{% block main_wrapper %}

			{% block main %}{% endblock %}

{% endblock %}

{% block right_wrapper %}

    {% nevercache %}
    {% include "includes/user_panel.html" %}
    {% endnevercache %}

    {% block right_panel %}
    {% ifinstalled mezzanine.twitter %}
    {% include "twitter/tweets.html" %}
    {% endifinstalled %}
    {% endblock %}

{% endblock %}

{% endblock %}

ADDRESS

                        Address: 1032 Wayback Lane, Wantagh
NY 11793

                        Email:  support@email.com

                        Website: www.domain.com

                        Toll Free: 631-409-3105

			{% page_menu "pages/menus/footer.html" %}

FLICKR GALLERY

                © 2013  Template by ShapeBootstrap. Mezzanine theme by CodingHouse

{% compress js %}

{% endcompress %}


text:
Aria.classDefinition({
    $classpath : "test.aria.templates.issue1413.RefreshDisposedTemplateTestCase",
    $extends : "aria.jsunit.TemplateTestCase",
    $dependencies : ["aria.templates.TemplateCtxt"],
    $constructor : function () {
        this.$TemplateTestCase.constructor.call(this);
        this.setTestEnv({
            template : "test.aria.templates.issue1413.RefreshTpl"
        });
    },
    $prototype : {
        runTemplateTest : function () {
            aria.templates.RefreshManager.stop();
            this.templateCtxt._tpl.$refresh();
            Aria.disposeTemplate(this.testDiv);
            aria.templates.RefreshManager.resume();
            this.end();
        }
    }
});


text:
package org.apache.camel.generator.swagger;

import java.io.IOException;
import java.time.Instant;
import java.util.function.Function;
import java.util.stream.Collector;

import javax.annotation.Generated;
import javax.lang.model.element.Modifier;

import com.squareup.javapoet.AnnotationSpec;
import com.squareup.javapoet.ClassName;
import com.squareup.javapoet.JavaFile;
import com.squareup.javapoet.MethodSpec;
import com.squareup.javapoet.TypeSpec;
import io.swagger.models.Info;
import io.swagger.models.Swagger;
import org.apache.camel.builder.RouteBuilder;
import org.apache.camel.util.ObjectHelper;

import static org.apache.camel.util.StringHelper.notEmpty;

/**
 * Generates Java source code
 */
public abstract class RestDslSourceCodeGenerator<T> extends RestDslGenerator<RestDslSourceCodeGenerator<T>> {
    static final String DEFAULT_CLASS_NAME = "RestDslRoute";

    static final String DEFAULT_PACKAGE_NAME = "rest.dsl.generated";

    private static final String DEFAULT_INDENT = "    ";

    private Function<Swagger, String> classNameGenerator = RestDslSourceCodeGenerator::generateClassName;

    private Instant generated = Instant.now();

    private String indent = DEFAULT_INDENT;

    private Function<Swagger, String> packageNameGenerator = RestDslSourceCodeGenerator::generatePackageName;

    private boolean sourceCodeTimestamps;

    RestDslSourceCodeGenerator(final Swagger swagger) {
        super(swagger);
    }

    public abstract void generate(T destination) throws IOException;

    public RestDslSourceCodeGenerator<T> withClassName(final String className) {
        notEmpty(className, "className");
        this.classNameGenerator = s -> className;

        return this;
    }

    public RestDslSourceCodeGenerator<T> withIndent(final String indent) {
        this.indent = ObjectHelper.notNull(indent, "indent");

        return this;
    }

    public RestDslSourceCodeGenerator<T> withoutSourceCodeTimestamps() {
        sourceCodeTimestamps = false;

        return this;
    }

    public RestDslSourceCodeGenerator<T> withPackageName(final String packageName) {
        notEmpty(packageName, "packageName");
        this.packageNameGenerator = s -> packageName;

        return this;
    }

    public RestDslSourceCodeGenerator<T> withSourceCodeTimestamps() {
        sourceCodeTimestamps = true;

        return this;
    }

    MethodSpec generateConfigureMethod(final Swagger swagger) {
        final MethodSpec.Builder configure = MethodSpec.methodBuilder("configure").addModifiers(Modifier.PUBLIC)
                .returns(void.class).addJavadoc("Defines Apache Camel routes using REST DSL fluent API.\n");

        final MethodBodySourceCodeEmitter emitter = new MethodBodySourceCodeEmitter(configure);

        if (restComponent != null) {
            configure.addCode("\n");
            configure.addCode("restConfiguration().component(\"" + restComponent + "\")");
            if (restContextPath != null) {
                configure.addCode(".contextPath(\"" + restContextPath + "\")");
            }
            if (ObjectHelper.isNotEmpty(apiContextPath)) {
                configure.addCode(".apiContextPath(\"" + apiContextPath + "\")");
            }
            configure.addCode(";\n\n");
        }

        final PathVisitor<MethodSpec> restDslStatement
                = new PathVisitor<>(swagger.getBasePath(), emitter, filter, destinationGenerator());
        swagger.getPaths().forEach(restDslStatement::visit);

        return emitter.result();
    }

    Instant generated() {
        return generated;
    }

    JavaFile generateSourceCode() {
        final MethodSpec methodSpec = generateConfigureMethod(swagger);

        final String classNameToUse = classNameGenerator.apply(swagger);

        final AnnotationSpec.Builder generatedAnnotation = AnnotationSpec.builder(Generated.class).addMember("value",
                "$S", getClass().getName());
        if (sourceCodeTimestamps) {
            generatedAnnotation.addMember("date", "$S", generated());
        }

        TypeSpec.Builder builder = TypeSpec.classBuilder(classNameToUse).superclass(RouteBuilder.class)
                .addModifiers(Modifier.PUBLIC, Modifier.FINAL).addMethod(methodSpec)
                .addAnnotation(generatedAnnotation.build())
                .addJavadoc("Generated from Swagger specification by Camel REST DSL generator.\n");
        if (springComponent) {
            final AnnotationSpec.Builder springAnnotation
                    = AnnotationSpec.builder(ClassName.bestGuess("org.springframework.stereotype.Component"));
            builder.addAnnotation(springAnnotation.build());
        }
        TypeSpec generatedRouteBuilder = builder.build();

        final String packageNameToUse = packageNameGenerator.apply(swagger);

        return JavaFile.builder(packageNameToUse, generatedRouteBuilder).indent(indent).build();
    }

    RestDslSourceCodeGenerator<T> withGeneratedTime(final Instant generated) {
        this.generated = generated;

        return this;
    }

    static String generateClassName(final Swagger swagger) {
        final Info info = swagger.getInfo();
        if (info == null) {
            return DEFAULT_CLASS_NAME;
        }

        final String title = info.getTitle();
        if (title == null) {
            return DEFAULT_CLASS_NAME;
        }

        final String className = title.chars().filter(Character::isJavaIdentifierPart).filter(c -> c < 'z').boxed()
                .collect(Collector.of(StringBuilder::new, StringBuilder::appendCodePoint, StringBuilder::append,
                        StringBuilder::toString));

        if (className.isEmpty() || !Character.isJavaIdentifierStart(className.charAt(0))) {
            return DEFAULT_CLASS_NAME;
        }

        return className;
    }

    static String generatePackageName(final Swagger swagger) {
        final String host = swagger.getHost();

        if (ObjectHelper.isNotEmpty(host)) {
            final StringBuilder packageName = new StringBuilder();

            final String hostWithoutPort = host.replaceFirst(":.*", "");

            if ("localhost".equalsIgnoreCase(hostWithoutPort)) {
                return DEFAULT_PACKAGE_NAME;
            }

            final String[] parts = hostWithoutPort.split("\\.");

            for (int i = parts.length - 1; i >= 0; i--) {
                packageName.append(parts[i]);
                if (i != 0) {
                    packageName.append('.');
                }
            }

            return packageName.toString();
        }

        return DEFAULT_PACKAGE_NAME;
    }
}


text:
package org.openehealth.ipf.commons.ihe.ws.cxf;

import org.apache.cxf.attachment.AttachmentSerializer;
import org.apache.cxf.binding.soap.SoapMessage;
import org.apache.cxf.binding.soap.interceptor.AbstractSoapInterceptor;
import org.apache.cxf.interceptor.AttachmentOutInterceptor;
import org.apache.cxf.interceptor.Fault;
import org.apache.cxf.message.Message;
import org.apache.cxf.phase.Phase;

/**
 * Workaround for a compatibility issue with Axis 2 0.9x.
 * <p>
 * Older versions of Axis 2 only accept our message if the content-type
 * contains a type of "text/xml". The CXF {@link AttachmentSerializer}
 * does not set this field. Therefore, we add it with this interceptor.
 * @author Jens Riemschneider
 */
public class FixContentTypeOutInterceptor extends AbstractSoapInterceptor {
    /**
     * Constructs the interceptor.
     */
    public FixContentTypeOutInterceptor() {
        super(Phase.PRE_STREAM);
        addAfter(AttachmentOutInterceptor.class.getName());
    }

    @Override
    public void handleMessage(SoapMessage message) throws Fault {
        // Cool stuff for Axis 0.9
        String ct  = (String) message.get(Message.CONTENT_TYPE);
        if (!ct.contains("type=")) {
            message.put(Message.CONTENT_TYPE, ct + "; type=\"text/xml\"");
        }
    }
}


text:
"""Extensions module.

Each extension is initialized in the app factory located
in app.py.
"""
from flask_cors import CORS  # type: ignore
from flask_jwt_extended import JWTManager
from flask_smorest import Api

cors = CORS()
jwt = JWTManager()
smorest_api = Api()


text:
def init
  super
  sections.place(:tag_list).after_any(:files)
end

def menu_lists
  super + [{:type => 'tag', :title => 'Tags', :search_title => 'Tag List'}]
end


text:
# This file is dual licensed under the terms of the Apache License, Version
# 2.0, and the BSD License. See the LICENSE file in the root of this repository
# for complete details.

from __future__ import absolute_import, division, print_function

INCLUDES = """
#include <openssl/rand.h>
"""

TYPES = """
static const long Cryptography_HAS_EGD;
"""

FUNCTIONS = """
void RAND_seed(const void *, int);
void RAND_add(const void *, int, double);
int RAND_status(void);
const char *RAND_file_name(char *, size_t);
int RAND_load_file(const char *, long);
int RAND_write_file(const char *);
int RAND_bytes(unsigned char *, int);
"""

MACROS = """
/* ERR_load_RAND_strings started returning an int in 1.1.0. Unfortunately we
   can't declare a conditional signature like that. Since it always returns
   1 we'll just lie about the signature to preserve compatibility for
   pyOpenSSL (which calls this in its rand.py as of mid-2016) */
void ERR_load_RAND_strings(void);

/* RAND_cleanup became a macro in 1.1.0 */
void RAND_cleanup(void);

int RAND_egd(const char *);
int RAND_egd_bytes(const char *, int);
int RAND_query_egd_bytes(const char *, unsigned char *, int);
"""

CUSTOMIZATIONS = """
#if defined(LIBRESSL_VERSION_NUMBER) || CRYPTOGRAPHY_OPENSSL_110_OR_GREATER
static const long Cryptography_HAS_EGD = 0;
int (*RAND_egd)(const char *) = NULL;
int (*RAND_egd_bytes)(const char *, int) = NULL;
int (*RAND_query_egd_bytes)(const char *, unsigned char *, int) = NULL;
#else
static const long Cryptography_HAS_EGD = 1;
#endif
"""


text:
package com.klarna.hiverunner;

import com.klarna.hiverunner.annotations.HiveProperties;
import com.klarna.hiverunner.annotations.HiveResource;
import com.klarna.hiverunner.annotations.HiveSQL;
import org.apache.commons.collections.MapUtils;
import org.apache.thrift.TException;
import org.junit.Assert;
import org.junit.Before;
import org.junit.Test;
import org.junit.runner.RunWith;

import java.io.IOException;
import java.util.Arrays;
import java.util.HashMap;
import java.util.Map;

@RunWith(StandaloneHiveRunner.class)
public class PartitionSupportTest {

    private final String tableName = "foo_bar";

    @HiveResource(targetFile = "${hiveconf:hive.vs}/foo/year=2013/month=11/data.csv")
    public String data1 = "a,b,c\nf,g,h\nt,j,k";

    @HiveResource(targetFile = "${hiveconf:hive.vs}/foo/year=2012/month=02/data.csv")
    public String data2 = "q,w,e\nr,t,y\nu,i,o";

    @HiveProperties
    public Map<String, String> hiveProperties = MapUtils.putAll(new HashMap(), new String[]{
            "table.name", tableName
    });

    @HiveSQL(files = "partitionSupportTest/hql_example.sql")
    public HiveShell hiveShell;

    @Before
    public void repairPartitions() {
        // TODO: Incorporate support for REPAIR TABLE in HiveRunner fwk.
        // if new partitions are directly added to HDFS the metastore is not aware of these partitions.
        // 'MSCK REPAIR TABLE table' adds metadata about partitions to the Hive metastore for partitions
        // for which such metadata doesn't already exist.
        hiveShell.execute("MSCK REPAIR TABLE ${hiveconf:table.name}");
    }

    @Test
    public void testSelectMax() throws TException, IOException {
        Assert.assertEquals(
                Arrays.asList("11"),
                hiveShell.executeQuery(String.format("select max(month) from %s", tableName)));

        Assert.assertEquals(
                Arrays.asList("2"),
                hiveShell.executeQuery(String.format("select min(month) from %s", tableName)));
    }

    @Test
    public void testShowTables() {
        Assert.assertEquals(Arrays.asList(tableName), hiveShell.executeQuery("SHOW TABLES"));
    }

}


text:
A library for combining base paths with relative paths while checking that the relative path never escapes the base path.

When concatenating a relative path to a base path, it is often a security requirement that the relative path never escapes outside of the base path, otherwise they can explore parts of the filesystem that should not be able to access.

Even with filesystem level access controls and checking that the result is inside the base path, a carefully constructed relative path can be used to test for the existence of a particular directory. For example, if `../some/sensitive/dir/../../../base/some/innocent/location` does not give a "path does not exist" error, an attacker knows that the `some/sensitive/dir` structure exists.

## Usage

```java
File base = configuration.getBasePath();
System.out.print("File path: ");
String relative = System.console.readline();

try {
  File path = Basepath.concat(base, relative);
  ...
} catch (SandboxException e) {
  System.err.println(e.getMessage());
}
```


text:
<!DOCTYPE html>

        <link href="https://fonts.googleapis.com/css?family=Merriweather" rel="stylesheet">

        <title>Chicago Crimes Search App</title>

Chicago 2016 Crime Search

            Enter a block address to view the crimes that have happened in that area.

            Use 048XX W HURON ST- for testing.

            Address format: Put a zero followed by the first two digits of your address and two X's. Then put the direction (N, S, E, or W) and then your street name and street suffix.

            Ex.) 0--XX (Direction-N,E,S,W) (Street Name) (Street Suffix)

                2501 W Addison St = 025XX W ADDISON ST

Choose a Primary Crime Type to Search By:

        <select id="crimeType">
            <option value="all">All</option>
  <option value="theft">Theft</option>
  <option value="narcotics">Narcotics</option>
  <option value="battery">Battery</option>
  <option value="robbery">Robbery</option>
  <option value="criminal_trespass">Criminal Trespass</option>
  <option value="deceptive_practice">Deceptive Practice</option>
  <option value="criminal_damage">Criminal Damage</option>
</select>

         <form>

      <input type="text" id= "txtAddress" size="20" maxlength="20" style="text-transform:uppercase" placeholder= "Enter a Block Address">

      Enter Block Address
      <button type="button" class= "button" id="btnSearch" >Search</button>
        </form>

        By: Sebastian Caid and Stevan Kamatovic

           This app gets data from the City of Chicago Crimes Data Portal and loops through it based on the search term that is entered
        into the input box and the value of the value that is chosen in the select box. The information is then appended to the body.


text:
package org.frameworkset.web.token;

/**
 *
Title: Ticket.java

 *
Description:

 *
bboss workgroup

 *
Copyright (c) 2008

 * @Date 2014年4月26日
 * @author biaoping.yin
 * @version 3.8.0
 */
public class Ticket {
	private String token;
	private String ticket;
	private long createtime;
	private long lastVistTime;
	private long livetime;
	private String appid;
	public String getToken() {
		return token;
	}
	public void setToken(String token) {
		this.token = token;
	}
	public String getTicket() {
		return ticket;
	}
	public void setTicket(String ticket) {
		this.ticket = ticket;
	}
	public long getCreatetime() {
		return createtime;
	}
	public void setCreatetime(long createtime) {
		this.createtime = createtime;
	}
	public long getLivetime() {
		return livetime;
	}
	public void setLivetime(long livetime) {
		this.livetime = livetime;
	}
	public String getAppid() {
		return appid;
	}
	public void setAppid(String appid) {
		this.appid = appid;
	}
	public long getLastVistTime() {
		return lastVistTime;
	}
	public void setLastVistTime(long lastVistTime) {
		this.lastVistTime = lastVistTime;
	}

}


text:
package com.whenling.shop.support.mvc;

import java.io.Serializable;

import javax.validation.Valid;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.ui.Model;
import org.springframework.validation.BindingResult;
import org.springframework.web.bind.annotation.ModelAttribute;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.ResponseBody;

import com.whenling.castle.repo.domain.Result;
import com.whenling.castle.repo.jpa.BaseJpaRepository;

public abstract class CrudController<T, I extends Serializable> extends BaseController {

	@Autowired
	private BaseJpaRepository<T, I> baseJpaRepository;

	private String baseTemplatePath;

	public CrudController() {
		RequestMapping mapping = getClass().getAnnotation(RequestMapping.class);
		this.baseTemplatePath = mapping.value()[0];
	}

	public CrudController(String baseTemplatePath) {
		this.baseTemplatePath = baseTemplatePath;
	}

	@RequestMapping(value = { "", "/", "/index" }, method = RequestMethod.GET)
	public String show(Model model) {
		onShowIndexPage(model);
		return baseTemplatePath + "/index";
	}

	@RequestMapping(value = { "/add", "/edit" }, method = RequestMethod.GET)
	public String add(Model model) {
		return edit(baseJpaRepository.newEntity(), model);
	}

	@RequestMapping(value = "/edit/{id}", method = RequestMethod.GET)
	public String edit(@PathVariable("id") T entity, Model model) {
		model.addAttribute("entity", entity);
		onShowEditPage(entity, model);
		return baseTemplatePath + "/edit";
	}

	@RequestMapping(value = "/save", method = RequestMethod.POST)
	@ResponseBody
	public Result doSave(@ModelAttribute @Valid T entity, BindingResult bindingResult) {
		onValidate(entity, bindingResult);
		if (bindingResult.hasErrors()) {
			return Result.validateError().error(bindingResult.getAllErrors());
		}

		onBeforeSave(entity);
		baseJpaRepository.save(entity);
		onAfterSave(entity);

		return Result.success();
	}

	@RequestMapping(value = "/delete", method = RequestMethod.POST)
	@ResponseBody
	public Result batchDelete(@RequestParam(value = "ids[]") T[] entities) {
		if (entities != null) {
			for (T entity : entities) {
				if (onBeforeDelete(entity)) {
					baseJpaRepository.delete(entity);
				}
			}
		}

		return Result.success();
	}

	protected void onShowIndexPage(Model model) {
	}

	protected void onShowEditPage(T entity, Model model) {
	}

	protected void onValidate(T entity, BindingResult bindingResult) {
	}

	protected void onBeforeSave(T entity) {
	}

	protected void onAfterSave(T entity) {
	}

	protected boolean onBeforeDelete(T entity) {
		return true;
	}

	protected void onAfterDelete(T entity) {
	}

	public BaseJpaRepository<T, I> getBaseJpaRepository() {
		return baseJpaRepository;
	}

	public String getBaseTemplatePath() {
		return baseTemplatePath;
	}

}


text:
class ApplicationController < ActionController::Base
  protect_from_forgery

  helper TestHelper
end


text:
import re

from taiga.hooks.event_hooks import BaseNewIssueEventHook, BaseIssueCommentEventHook, BasePushEventHook

class BaseBitBucketEventHook():
    platform = "BitBucket"
    platform_slug = "bitbucket"

    def replace_bitbucket_references(self, project_url, wiki_text):
        if wiki_text is None:
            wiki_text = ""

        template = "\g<1>[BitBucket#\g<2>]({}/issues/\g<2>)\g<3>".format(project_url)
        return re.sub(r"(\s|^)#(\d+)(\s|$)", template, wiki_text, 0, re.M)

class IssuesEventHook(BaseBitBucketEventHook, BaseNewIssueEventHook):
    def get_data(self):
        description = self.payload.get('issue', {}).get('content', {}).get('raw', '')
        project_url = self.payload.get('repository', {}).get('links', {}).get('html', {}).get('href', None)
        return {
            "number": self.payload.get('issue', {}).get('id', None),
            "subject": self.payload.get('issue', {}).get('title', None),
            "url": self.payload.get('issue', {}).get('links', {}).get('html', {}).get('href', None),
            "user_id": self.payload.get('actor', {}).get('uuid', None),
            "user_name": self.payload.get('actor', {}).get('username', None),
            "user_url": self.payload.get('actor', {}).get('links', {}).get('html', {}).get('href'),
            "description": self.replace_bitbucket_references(project_url, description),
        }

class IssueCommentEventHook(BaseBitBucketEventHook, BaseIssueCommentEventHook):
    def get_data(self):
        comment_message = self.payload.get('comment', {}).get('content', {}).get('raw', '')
        project_url = self.payload.get('repository', {}).get('links', {}).get('html', {}).get('href', None)
        issue_url = self.payload.get('issue', {}).get('links', {}).get('html', {}).get('href', None)
        comment_id = self.payload.get('comment', {}).get('id', None)
        comment_url = "{}#comment-{}".format(issue_url, comment_id)
        return {
            "number": self.payload.get('issue', {}).get('id', None),
            'url': issue_url,
            'user_id': self.payload.get('actor', {}).get('uuid', None),
            'user_name': self.payload.get('actor', {}).get('username', None),
            'user_url': self.payload.get('actor', {}).get('links', {}).get('html', {}).get('href'),
            'comment_url': comment_url,
            'comment_message': self.replace_bitbucket_references(project_url, comment_message)
        }

class PushEventHook(BaseBitBucketEventHook, BasePushEventHook):
    def get_data(self):
        result = []
        changes = self.payload.get("push", {}).get('changes', [])
        for change in filter(None, changes):
            for commit in change.get("commits", []):
                message = commit.get("message")
                result.append({
                    'user_id': commit.get('author', {}).get('user', {}).get('uuid', None),
                    "user_name": commit.get('author', {}).get('user', {}).get('username', None),
                    "user_url": commit.get('author', {}).get('user', {}).get('links', {}).get('html', {}).get('href'),
                    "commit_id": commit.get("hash", None),
                    "commit_url": commit.get("links", {}).get('html', {}).get('href'),
                    "commit_message": message.strip(),
                })
        return result


text:
Barrier Pattern
===============

The barrier pattern is a design patter in which a group of threads must stop at certain point (the barrier) and cannot proceed until all other threads reach it.


text:
<?php

namespace PhpOffice\PhpWord\Exception;

/**
 * @since 0.12.0
 */
final class CreateTemporaryFileException extends Exception
{
    /**
     * @param integer $code The user defined exception code.
     * @param \Exception $previous The previous exception used for the exception chaining.
     */
    final public function __construct($code = 0, \Exception $previous = null)
    {
        parent::__construct(
            'Could not create a temporary file with unique name in the specified directory.',
            $code,
            $previous
        );
    }
}


text:
Specs:
- [x] Use Sinatra to build the app
  - In Gemfile, Sinatra app is listed (gem 'sinatra')

- [x] Use ActiveRecord for storing information in a database
- ActiveRecord is utilized in the app/models (class User < ActiveRecord::Base)

- [x] Include more than one model class (list of model class names e.g. User, Post, Category)
- Models included in the project are: User, Vineyard, Wine

- [x] Include at least one has_many relationship (x has_many y e.g. User has_many Posts)
  - Relationships with model models are as follows:
  1) User: has_many :vineyards, has_many :wines
  2) Vineyard: belongs_to :user, has_many :wines
  2) Wine: belongs_to :user, belongs_to :vineyard

- [x] Include user accounts
  - A User has a :username and :password_digest to ensure a secure account
  - A User has the option to create a new account and/or login at index page
  - A User cannot progress further into other views pages without being logged_in

- [x] Ensure that users can't modify content created by other users
  - User is unable to edit/delete content and a rack flash message alerts with a message "You cannot delete another User's Wine"

- [x] Include user input validations
  - A User will receive successful validations on the views pages utilizing the rack flash gem after input

- [x] Display validation failures to user with error message (example form URL e.g. /posts/new)
  - A User will be shown various messages on the views pages utilizing the rack flash gem

- [x] Your README.md includes a short description, install instructions, a contributors guide and a link to the license for your code
  - README provides a thorough explanation of descriptions, usage and contributions

Confirm
- [x] You have a large number of small Git commits
- [x] Your commit messages are meaningful
- [x] You made the changes in a commit that relate to the commit message
- [x] You don't include changes in a commit that aren't related to the commit message


text:
<!DOCTYPE html>

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

    <meta charset="utf-8">

AWS::Route53::RecordSetGroup

The AWS::Route53::RecordSetGroup resource creates record sets for a hosted zone. For more
                        information about constraints and values for each property, see POST
                           CreateHostedZone for hosted zones and POST
                           ChangeResourceRecordSet for resource record sets.

Topics

Syntax

Properties

Return Value

Examples

Syntax

To declare this entity in your AWS CloudFormation template, use the following syntax:

JSON

{
   "Type" : "AWS::Route53::RecordSetGroup",
   "Properties" : {
      "Comment" : String,
      "HostedZoneId" : String,
      "HostedZoneName" : String,
      "RecordSets" : [ RecordSet1, ... ]
   }
}

YAML

Type: AWS::Route53::RecordSetGroup
Properties:
  Comment: String
  HostedZoneId: String
  HostedZoneName: String
  RecordSets:
    - RecordSet1

Properties

Comment

Any comments you want to include about the change batch.

Required: No

Type: String

Update requires: No interruption

HostedZoneId

The ID of the hosted zone.

Required: Conditional: You must specify either the
                                 HostedZoneName or HostedZoneId, but you cannot
                                 specify both.

Type: String

Update requires: Replacement

HostedZoneName

The name of the domain for the hosted zone where you want to add the record set.

When you create a stack using an AWS::Route53::RecordSet that specifies
                                 HostedZoneName, AWS CloudFormation attempts to find a hosted zone whose name matches the
                                 HostedZoneName. If AWS CloudFormation cannot find a hosted zone with a matching domain
                                 name, or if there is more than one hosted zone with the specified domain name, AWS
                                 CloudFormation will not create
                                 the stack.

If you have multiple hosted zones with the same domain name, you must explicitly specify
                                 the
                                 hosted zone using HostedZoneId.

Required: Conditional. You must specify either the
                                 HostedZoneName or HostedZoneId, but you cannot
                                 specify both.

Type: String

Update requires: Replacement

RecordSets

List of resource record sets to add. The maximum number of records is 1,000.

Required: Yes

Type:: List of AWS::Route53::RecordSet objects, as shown in the
                                 following example:

"RecordSets" : [
  {
    "Name" : "mysite.example.com.",
    "Type" : "CNAME",
    "TTL" : "900",
    "SetIdentifier" : "Frontend One",
    "Weight" : "4",
    "ResourceRecords" : ["example-ec2.amazonaws.com"]
  },
  {
    "Name" : "mysite.example.com.",
    "Type" : "CNAME",
    "TTL" : "900",
    "SetIdentifier" : "Frontend Two",
    "Weight" : "6",
    "ResourceRecords" : ["example-ec2-larger.amazonaws.com"]
  }
]

Update requires: No interruption

Return Value

When the logical ID of this resource is provided to the Ref intrinsic
                        function, Ref returns the resource name. For example:

{ "Ref": "MyRecordSetGroup" }

For the resource with the logical ID "MyRecordSetGroup", Ref will return the AWS resource
                        name.

For more information about using the Ref function, see Ref.

Examples

For AWS::Route53::RecordSetGroup snippets, see Route 53 Template Snippets.


text:
import sbt._
import Keys._

object CommonSettings {
  private val ScrimageVersion = "2.1.7"
  private val AkkaVersion = "2.4.14"

  val commonDependencies: Seq[ModuleID] = Seq(
    "com.sksamuel.scrimage" %% "scrimage-core" % ScrimageVersion,
    "com.sksamuel.scrimage" %% "scrimage-io-extra" % ScrimageVersion,
    "com.sksamuel.scrimage" %% "scrimage-filters" % ScrimageVersion,
    "com.typesafe.akka" %% "akka-actor" % AkkaVersion,
    "com.typesafe.akka" %% "akka-remote" % AkkaVersion,

    "com.typesafe.akka" %% "akka-testkit" % AkkaVersion % "test",
    "org.specs2" %% "specs2-core" % "3.0" % "test"
  )

  val commonResolvers: Seq[MavenRepository] = Seq(
    "scalaz-bintray" at "http://dl.bintray.com/scalaz/releases"
  )

  val commonTestScalacSettings: Seq[String] = Seq("-Yrangepos")

  val commonSettings: Seq[Def.Setting[_]] = Seq(
    resolvers ++= commonResolvers,
    scalacOptions in Test ++= commonTestScalacSettings,
    libraryDependencies ++= commonDependencies
  )
}