text:
// Karma configuration
// http://karma-runner.github.io/0.12/config/configuration-file.html
// Generated on 2014-07-21 using
// generator-karma 0.8.3

module.exports = function(config) {
  'use strict';

  config.set({
    // enable / disable watching file and executing tests whenever any file changes
    autoWatch: true,

    // base path, that will be used to resolve files and exclude
    basePath: '../',

    // testing framework to use (jasmine/mocha/qunit/...)
    frameworks: ['jasmine'],

    // list of files / patterns to load in the browser
    files: [
      'bower_components/angular/angular.js',
      'bower_components/angular-mocks/angular-mocks.js',
      'bower_components/angular-animate/angular-animate.js',
      'bower_components/angular-cookies/angular-cookies.js',
      'bower_components/angular-resource/angular-resource.js',
      'bower_components/angular-route/angular-route.js',
      'bower_components/angular-sanitize/angular-sanitize.js',
      'bower_components/angular-touch/angular-touch.js',
      'app/scripts/**/*.js',
      'test/mock/**/*.js',
      'test/spec/**/*.js',
      'app/views/**/*.html'
    ],

    // list of files / patterns to exclude
    exclude: [],

    // web server port
    port: 8080,

    // Start these browsers, currently available:
    // - Chrome
    // - ChromeCanary
    // - Firefox
    // - Opera
    // - Safari (only Mac)
    // - PhantomJS
    // - IE (only Windows)
    browsers: [ 'PhantomJS' ],

    reporters: [ 'progress', 'coverage' ],

    preprocessors: {
      'app/scripts/**/*.js': [ 'coverage' ],
      '**/*.html': [ 'ng-html2js' ]
    },

    coverageReporter: {
      type: 'html',
      dir: 'coverage'
    },

    // Which plugins to enable
    plugins: [
      'karma-phantomjs-launcher',
      'karma-jasmine',
      'karma-coverage',
      'karma-ng-html2js-preprocessor'
    ],

    // Continuous Integration mode
    // if true, it capture browsers, run tests and exit
    singleRun: false,

    colors: true,

    // level of logging
    // possible values: LOG_DISABLE || LOG_ERROR || LOG_WARN || LOG_INFO || LOG_DEBUG
    logLevel: config.LOG_INFO,

    // Uncomment the following lines if you are using grunt's server to run the tests
    // proxies: {
    //   '/': 'http://localhost:9000/'
    // },
    // URL root prevent conflicts with the site root
    // urlRoot: '_karma_'
  });
};


text:
package com.vmware.vim25;

/**
* @author Steve Jin (http://www.doublecloud.org)
* @version 5.1
*/

@SuppressWarnings("all")
public class CustomizationAdapterMapping extends DynamicData {
  public String macAddress;
  public CustomizationIPSettings adapter;

  public String getMacAddress() {
    return this.macAddress;
  }

  public CustomizationIPSettings getAdapter() {
    return this.adapter;
  }

  public void setMacAddress(String macAddress) {
    this.macAddress=macAddress;
  }

  public void setAdapter(CustomizationIPSettings adapter) {
    this.adapter=adapter;
  }
}

redpajama_set_name: RedPajamaGithub


text:
<!doctype html>

	<meta charset="UTF-8"/>

Indices Challenge Sécurité 4

Besoin d'un petit coup de pouce pour démarrer ? En panne d'inspiration pour trouver la prochaine étape ? Voici quelques indices pour vous aider à avancer !

 (Cliquez sur un indice ou sur sa réponse pour l'afficher)

Indice 1

Vous êtes un peu perdu ? Vous ne savez pas trop où chercher ? Essayez de regarder dans les clés USB.

Réponse :

Essayez de récupérer des dossiers effacés d'une des clés USB grâce à l'outil foremost.

Indice 2

Les images effacées sont sûrement les plus intéressantes à récupérer sur les clés...

Réponse :

Utilisez la commande sudo foremost -t jpg -i /dev/sdb1

Indice 3

Une des images récupérées possède peut-être des métadonnées intéressantes ?

Réponse :

Utilisez l'outil exiftool que vous avez rencontré au challenge 2 pour trouver des informations.

Indice 4

Quelles sont les techniques pour cacher un fichier dans un système linux ?

Réponse :

Un petit ls -all ne fait jamais de mal quand on ouvre un nouveau dossier.

Indice 5

A quoi peut correspondre ce chiffre ?

Réponse :

Une des images récupérées de la clé USB vide concerne les signes astrologiques chinois, il est peut-être intéressant d'aller la regarder de plus près.

Indice 6

Mais où trouver de tels animaux ?

Réponse :

Il existe un dossier animaux sur la deuxième clé USB, vous trouverez sûrement celui qui vous intéresse.

Indice 7

N'y a-t-il pas un diction chinois qui dit qu'une image peut en cacher une autre ?

Réponse :

Utilisez le script python stegano.py sur l'image qui vous intéresse pour voir s'il n'y a pas un message caché derrière.


text:
venn-cljs
=========

A quick demonstration of ClojureScript and D3 working together to produce an interactive SVG Venn diagram with fully independent sections. The code is a simplified version of that used on http://www.sparrho.com to help users pick the scientific fields they're interested in.

Just run `lein cljsbuild once` from the root folder to compile the project, and open `index.html` in your browser to take a look at the results.


text:
Instructions for building Teleport AWS AMIs.

## Development instructions

**Prerequisites**

AWS CLI and Packer are required to build Teleport AMIs.

Minimum versions:
awscli == 1.14
packer == v1.4.0

On macOS:

```
brew install awscli
brew install packer
```

On Linux:

```
apt install awscli
Follow instructions at: https://www.packer.io/docs/install/index.html
```

**To build the OSS AMI**

1. Determine which AWS account you wish to build the AMI within.
2. Ensure your local awscli profile is configured for this account, and you have adequate IAM roles to build AMIs (ec2, s3, vpc).
3. Decide which region you'd like to build and distribute AMIs in. We'll use these in the next step.
4. Set the following Makefile values:

| Param               | Description                                                                                |
|---------------------|-------------------------------------------------------------------------------------------------------------|
| BUILD_VPC_ID        | With the region you selected in step 3, create or use an existing VPC. ex. `vpc-xxxxxxxx`.                  |
| BUILD_SUBNET_ID     | Within the VPC above, select a subnet. ex. `subnet-xxxxxxxx`                                                |
| AWS_REGION          | Region you selected in step 3. ex. `us-east-1`                                                              |
| TELEPORT_VERSION    | Teleport version. See [Teleport releases](https://github.com/gravitational/teleport/releases). ex. `4.2.10` |
| INSTANCE_TYPE       | The instance type used for the build. ex. `t2.micro`                                                        |
| DESTINATION_REGIONS | The regions the AMI will be replicated to. ex. `us-east-1,us-east-2`                                        |

5. Run
```
make oss
```

6. Once complete, your AMI should be available, in the regions you specified, with the name  `teleport-debug-ami-<type>-<version>`. (e.g. teleport-debug-ami-oss-4.2.10)

## Usage instructions

To use the AMI, see the [AMI guide](https://gravitational.com/teleport/docs/aws_oss_guide/#single-oss-teleport-amis-manual-gui-setup) in the docs.


text:
"""Tests for checkpointing the CacheDataset."""
from __future__ import absolute_import
from __future__ import division
from __future__ import print_function

import os

from absl.testing import parameterized

from tensorflow.python.data.kernel_tests import checkpoint_test_base
from tensorflow.python.data.kernel_tests import test_base
from tensorflow.python.data.ops import dataset_ops
from tensorflow.python.framework import combinations
from tensorflow.python.framework import errors
from tensorflow.python.platform import test

class CacheDatasetCheckpointTest(checkpoint_test_base.CheckpointTestBase,
                                 parameterized.TestCase):

  def setUp(self):
    self.range_size = 10
    self.num_repeats = 3
    self.num_outputs = self.range_size * self.num_repeats
    self.cache_file_prefix = 'test'

  def make_dataset_fn(self, is_memory):
    if is_memory:
      filename = ''
    else:
      filename = os.path.join(self.get_temp_dir(), self.cache_file_prefix)

    def ds_fn():
      return dataset_ops.Dataset.range(self.range_size).cache(filename).repeat(
          self.num_repeats)

    return ds_fn

  def expected_outputs(self):
    return list(range(self.range_size)) * self.num_repeats

  @combinations.generate(
      combinations.times(test_base.default_test_combinations(),
                         combinations.combine(is_memory=[True, False])))
  def testCheckpointBeforeOneEpoch(self, is_memory):
    ds_fn = self.make_dataset_fn(is_memory)

    # Generate 5 entries from iterator and save checkpoint.
    outputs = self.gen_outputs(ds_fn, [], 5, verify_exhausted=False)
    self.assertSequenceEqual(outputs, range(5))

    # Restore from checkpoint and produce the rest of the elements from the
    # iterator.
    outputs.extend(
        self.gen_outputs(
            ds_fn, [],
            self.num_outputs - 5,
            ckpt_saved=True,
            verify_exhausted=False))
    self.assertSequenceEqual(outputs, self.expected_outputs())

  @combinations.generate(
      combinations.times(test_base.default_test_combinations(),
                         combinations.combine(is_memory=[True, False])))
  def testCheckpointBeforeOneEpochThenRunFewSteps(self, is_memory):
    ds_fn = self.make_dataset_fn(is_memory)

    # Generate 8 entries from iterator but save checkpoint after producing 5.
    outputs = self.gen_outputs(
        ds_fn, [5], 8, verify_exhausted=False, save_checkpoint_at_end=False)
    self.assertSequenceEqual(outputs, range(8))

    outputs = outputs[:5]
    outputs.extend(
        self.gen_outputs(
            ds_fn, [],
            self.num_outputs - 5,
            ckpt_saved=True,
            verify_exhausted=False))
    self.assertSequenceEqual(outputs, self.expected_outputs())

  @combinations.generate(
      combinations.times(test_base.default_test_combinations(),
                         combinations.combine(is_memory=[True, False])))
  def testCheckpointAfterOneEpoch(self, is_memory):
    ds_fn = self.make_dataset_fn(is_memory)

    # Generate 15 entries from iterator and save checkpoint.
    outputs = self.gen_outputs(ds_fn, [], 15, verify_exhausted=False)
    self.assertSequenceEqual(outputs, list(range(10)) + list(range(5)))

    # Restore from checkpoint and produce the rest of the elements from the
    # iterator.
    outputs.extend(
        self.gen_outputs(
            ds_fn, [],
            self.num_outputs - 15,
            ckpt_saved=True,
            verify_exhausted=False))
    self.assertSequenceEqual(outputs, self.expected_outputs())

  @combinations.generate(
      combinations.times(test_base.default_test_combinations(),
                         combinations.combine(is_memory=[True, False])))
  def testCheckpointAfterOneEpochThenRunFewSteps(self, is_memory):
    ds_fn = self.make_dataset_fn(is_memory)

    # Generate 18 entries from iterator but save checkpoint after producing 15.
    outputs = self.gen_outputs(
        ds_fn, [15], 18, verify_exhausted=False, save_checkpoint_at_end=False)
    self.assertSequenceEqual(outputs, list(range(10)) + list(range(8)))

    outputs = list(range(10)) + list(range(5)) + self.gen_outputs(
        ds_fn, [],
        self.num_outputs - 15,
        ckpt_saved=True,
        verify_exhausted=False)
    self.assertSequenceEqual(outputs, list(range(10)) * 3)

  @combinations.generate(
      combinations.times(test_base.default_test_combinations(),
                         combinations.combine(is_memory=[True, False])))
  def testCheckpointBeforeOneEpochButRunCompleteEpoch(self, is_memory):
    ds_fn = self.make_dataset_fn(is_memory)

    # Generate 13 entries from iterator but save checkpoint after producing 5.
    outputs = self.gen_outputs(
        ds_fn, [5], 13, verify_exhausted=False, save_checkpoint_at_end=False)
    self.assertSequenceEqual(outputs, list(range(10)) + list(range(3)))

    # Since we ran for more than one epoch, the cache was completely written.
    # The ckpt was saved when the iterator was in cache-write mode. Test that
    # the iterator falls back to read mode after restoring if the cache has
    # been completely written.

    outputs = list(range(5)) + self.gen_outputs(
        ds_fn, [],
        self.num_outputs - 5,
        ckpt_saved=True,
        verify_exhausted=False)
    self.assertSequenceEqual(outputs, list(range(10)) * 3)

  @combinations.generate(
      combinations.times(test_base.default_test_combinations(),
                         combinations.combine(is_memory=[True, False])))
  def testCheckpointUnusedWriterIterator(self, is_memory):
    ds_fn = self.make_dataset_fn(is_memory)

    # Checkpoint before get_next is called even once.
    outputs = self.gen_outputs(ds_fn, [], 0, verify_exhausted=False)
    self.assertSequenceEqual(outputs, [])

    outputs = self.gen_outputs(
        ds_fn, [], self.num_outputs, ckpt_saved=True, verify_exhausted=False)
    self.assertSequenceEqual(outputs, list(range(10)) * 3)

  @combinations.generate(
      combinations.times(test_base.default_test_combinations(),
                         combinations.combine(is_memory=[True, False])))
  def testCheckpointUnusedMidwayWriterIterator(self, is_memory):
    ds_fn = self.make_dataset_fn(is_memory)

    # Produce 5 elements and checkpoint.
    outputs = self.gen_outputs(ds_fn, [], 5, verify_exhausted=False)
    self.assertSequenceEqual(outputs, range(5))

    # Restore from checkpoint, then produce no elements and checkpoint.
    outputs.extend(
        self.gen_outputs(ds_fn, [], 0, ckpt_saved=True, verify_exhausted=False))
    self.assertSequenceEqual(outputs, range(5))

    # Restore from checkpoint and produce rest of the elements.
    outputs.extend(
        self.gen_outputs(
            ds_fn, [],
            self.num_outputs - 5,
            ckpt_saved=True,
            verify_exhausted=False))
    self.assertSequenceEqual(outputs, list(range(10)) * 3)

  @combinations.generate(
      combinations.times(test_base.default_test_combinations(),
                         combinations.combine(is_memory=[True, False])))
  def testUnusedCheckpointError(self, is_memory):
    ds_fn = self.make_dataset_fn(is_memory)

    # Produce 5 elements and save ckpt.
    outputs = self.gen_outputs(ds_fn, [], 5, verify_exhausted=False)
    self.assertSequenceEqual(outputs, range(5))

    if is_memory:
      outputs = self.gen_outputs(
          ds_fn, [], self.num_outputs, verify_exhausted=False)
      self.assertSequenceEqual(outputs, self.expected_outputs())
    else:
      # Since the complete cache has not been written, a new iterator which does
      # not restore the checkpoint will throw an error since there is a partial
      # cache shard.
      with self.assertRaises(errors.AlreadyExistsError):
        outputs = self.gen_outputs(
            ds_fn, [], self.num_outputs, verify_exhausted=False)

  @combinations.generate(
      combinations.times(test_base.default_test_combinations(),
                         combinations.combine(is_memory=[True, False])))
  def testIgnoreCheckpointIfCacheWritten(self, is_memory):
    ds_fn = self.make_dataset_fn(is_memory)

    # Produce 15 elements and save ckpt. This will write the complete cache.
    outputs = self.gen_outputs(ds_fn, [], 15, verify_exhausted=False)
    self.assertSequenceEqual(outputs, list(range(10)) + list(range(5)))

    # Build the iterator again but do not restore from ckpt. Since the cache
    # has already been written we should be able to use it.
    outputs = self.gen_outputs(
        ds_fn, [], self.num_outputs, verify_exhausted=False)
    self.assertSequenceEqual(outputs, list(range(10)) * 3)

if __name__ == '__main__':
  test.main()


text:
@interface AppDelegate ()

@end

@implementation AppDelegate

- (BOOL)application:(UIApplication *)application
    didFinishLaunchingWithOptions:(NSDictionary *)launchOptions {

  [LSLaunchAD showWithWindow:self.window
                   countTime:5
       showCountTimeOfButton:YES
              showSkipButton:YES
              isFullScreenAD:NO
              localAdImgName:nil
                    imageURL:@"http://pic.yesky.com/uploadImages/2016/064/55/UWVJ44A8HXTX.jpg"
                  canClickAD:YES
                     aDBlock:^(BOOL clickAD) {

                       if (clickAD) {
                         NSLog(@"点击了广告");
                         UINavigationController *nav =
                             (UINavigationController *)
                                 self.window.rootViewController;
                         UIViewController *vc = [[UIViewController alloc] init];
                         vc.view.backgroundColor = [UIColor whiteColor];
                         vc.title = @"广告";
                         [nav pushViewController:vc animated:YES];
                       } else {
                         NSLog(@"完成倒计时或点击了跳转按钮");
                       }
                     }];
  return YES;
}

- (void)applicationWillResignActive:(UIApplication *)application {
  // Sent when the application is about to move from active to inactive state.
  // This can occur for certain types of temporary interruptions (such as an
  // incoming phone call or SMS message) or when the user quits the application
  // and it begins the transition to the background state.
  // Use this method to pause ongoing tasks, disable timers, and throttle down
  // OpenGL ES frame rates. Games should use this method to pause the game.
}

- (void)applicationDidEnterBackground:(UIApplication *)application {
  // Use this method to release shared resources, save user data, invalidate
  // timers, and store enough application state information to restore your
  // application to its current state in case it is terminated later.
  // If your application supports background execution, this method is called
  // instead of applicationWillTerminate: when the user quits.
}

- (void)applicationWillEnterForeground:(UIApplication *)application {
  // Called as part of the transition from the background to the inactive state;
  // here you can undo many of the changes made on entering the background.
}

- (void)applicationDidBecomeActive:(UIApplication *)application {
  // Restart any tasks that were paused (or not yet started) while the
  // application was inactive. If the application was previously in the
  // background, optionally refresh the user interface.
}

- (void)applicationWillTerminate:(UIApplication *)application {
  // Called when the application is about to terminate. Save data if
  // appropriate. See also applicationDidEnterBackground:.
}

@end


text:
description: The TF-Ranking task config.

<meta itemprop="name" content="tfr.extension.task.RankingTaskConfig" />
<meta itemprop="path" content="Stable" />
<meta itemprop="property" content="__contains__"/>
<meta itemprop="property" content="__eq__"/>
<meta itemprop="property" content="__init__"/>
<meta itemprop="property" content="as_dict"/>
<meta itemprop="property" content="from_args"/>
<meta itemprop="property" content="from_json"/>
<meta itemprop="property" content="from_yaml"/>
<meta itemprop="property" content="get"/>
<meta itemprop="property" content="lock"/>
<meta itemprop="property" content="override"/>
<meta itemprop="property" content="replace"/>
<meta itemprop="property" content="validate"/>
<meta itemprop="property" content="IMMUTABLE_TYPES"/>
<meta itemprop="property" content="RESERVED_ATTR"/>
<meta itemprop="property" content="SEQUENCE_TYPES"/>
<meta itemprop="property" content="aggregated_metrics"/>
<meta itemprop="property" content="default_params"/>
<meta itemprop="property" content="differential_privacy_config"/>
<meta itemprop="property" content="init_checkpoint"/>
<meta itemprop="property" content="loss"/>
<meta itemprop="property" content="loss_reduction"/>
<meta itemprop="property" content="model"/>
<meta itemprop="property" content="name"/>
<meta itemprop="property" content="output_preds"/>
<meta itemprop="property" content="restrictions"/>
<meta itemprop="property" content="train_data"/>
<meta itemprop="property" content="validation_data"/>

# tfr.extension.task.RankingTaskConfig

    View source on GitHub

The TF-Ranking task config.

tfr.extension.task.RankingTaskConfig(
    default_params: dataclasses.InitVar[Optional[Mapping[str, Any]]] = None,
    restrictions: dataclasses.InitVar[Optional[List[str]]] = None,
    init_checkpoint: str = '',
    model: Optional[base_config.Config] = None,
    train_data: tfr.extension.task.RankingDataConfig = None,
    validation_data: tfr.extension.task.RankingDataConfig = None,
    name: Optional[str] = None,
    differential_privacy_config: Optional[dp_configs.DifferentialPrivacyConfig] = None,
    loss: str = 'softmax_loss',
    loss_reduction: str = tf.keras.losses.Reduction.NONE,
    aggregated_metrics: bool = False,
    output_preds: bool = False
)

<colgroup><col width="214px"><col></colgroup>

Attributes

  `BUILDER`

`default_params`

Dataclass field

`restrictions`

Dataclass field

`init_checkpoint`

Dataclass field

`model`

Dataclass field

`train_data`

Dataclass field

`validation_data`

Dataclass field

`name`

Dataclass field

`differential_privacy_config`

Dataclass field

`loss`

Dataclass field

`loss_reduction`

Dataclass field

`aggregated_metrics`

Dataclass field

`output_preds`

Dataclass field

## Methods

as_dict

as_dict()

Returns a dict representation of params_dict.ParamsDict.

For the nested params_dict.ParamsDict, a nested dict will be returned.

from_args

@classmethod
from_args(
    *args, **kwargs
)

Builds a config from the given list of arguments.

from_json

@classmethod
from_json(
    file_path: str
)

Wrapper for `from_yaml`.

from_yaml

@classmethod
from_yaml(
    file_path: str
)

get

get(
    key, value=None
)

Accesses through built-in dictionary get method.

lock

lock()

Makes the ParamsDict immutable.

override

override(
    override_params, is_strict=True
)

Override the ParamsDict with a set of given params.

<colgroup><col width="214px"><col></colgroup>

Args

`override_params`

a dict or a ParamsDict specifying the parameters to be
overridden.

`is_strict`

a boolean specifying whether override is strict or not. If
True, keys in `override_params` must be present in the ParamsDict. If
False, keys in `override_params` can be different from what is currently
defined in the ParamsDict. In this case, the ParamsDict will be extended
to include the new keys.

replace

replace(
    **kwargs
)

Overrides/returns a unlocked copy with the current config unchanged.

validate

validate()

Validate the parameters consistency based on the restrictions.

This method validates the internal consistency using the pre-defined list of
restrictions. A restriction is defined as a string which specfiies a binary
operation. The supported binary operations are {'==', '!=', '<', '<=', '>',
'>='}. Note that the meaning of these operators are consistent with the
underlying Python immplementation. Users should make sure the define
restrictions on their type make sense.

For example, for a ParamsDict like the following `a: a1: 1 a2: 2 b: bb: bb1: 10
bb2: 20 ccc: a1: 1 a3: 3` one can define two restrictions like this ['a.a1 ==
b.ccc.a1', 'a.a2 <= b.bb.bb2']

<colgroup><col width="214px"><col></colgroup>

What it enforces are

- a.a1 = 1 == b.ccc.a1 = 1
- a.a2 = 2 <= b.bb.bb2 = 20

<colgroup><col width="214px"><col></colgroup>

Raises

`KeyError`

if any of the following happens
(1) any of parameters in any of restrictions is not defined in
    ParamsDict,
(2) any inconsistency violating the restriction is found.

`ValueError`

if the restriction defined in the string is not supported.

__contains__

__contains__(
    key
)

Implements the membership test operator.

__eq__

__eq__(
    other
)

<colgroup><col width="214px"><col></colgroup>

Class Variables

IMMUTABLE_TYPES

`(<class 'str'>,
 <class 'int'>,
 <class 'float'>,
 <class 'bool'>,
 <class 'NoneType'>)`

RESERVED_ATTR

`['_locked', '_restrictions']`

SEQUENCE_TYPES

`(<class 'list'>, <class 'tuple'>)`

aggregated_metrics

`False`

default_params

`None`

differential_privacy_config

`None`

init_checkpoint

`''`

loss

`'softmax_loss'`

loss_reduction

`'none'`

model

`None`

name

`None`

output_preds

`False`

restrictions

`None`

train_data

`None`

validation_data

`None`


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>
	<parent>
		<groupId>org.jhaws.common</groupId>
		<artifactId>jhaws-modules</artifactId>
		<version>5.0.3-SNAPSHOT</version>
		<relativePath>../pom.xml</relativePath>
	</parent>
	<artifactId>jhaws-io</artifactId>
	<name>io</name>
	<description>io</description>
	<dependencyManagement>
		<dependencies>
			<dependency>
				<groupId>org.jhaws.common</groupId>
				<artifactId>jhaws-spring-bom</artifactId>
				<version>${project.version}</version>
				<type>pom</type>
				<scope>import</scope>				<!--http://maven.apache.org/guides/introduction/introduction-to-dependency-mechanism.html -->
			</dependency>
		</dependencies>
	</dependencyManagement>
	<dependencies>
		<dependency>
			<groupId>commons-io</groupId>
			<artifactId>commons-io</artifactId>
		</dependency>
		<dependency>
			<groupId>org.apache.commons</groupId>
			<artifactId>commons-lang3</artifactId>
		</dependency>
		<dependency>
			<groupId>org.bouncycastle</groupId>
			<artifactId>bcprov-jdk15to18</artifactId>
			<scope>compile</scope>
		</dependency>
		<dependency>
			<groupId>com.github.jai-imageio</groupId>
			<artifactId>jai-imageio-core</artifactId>
			<optional>true</optional>
		</dependency>
		<dependency>
			<groupId>com.github.jai-imageio</groupId>
			<artifactId>jai-imageio-jpeg2000</artifactId>
			<optional>true</optional>
		</dependency>
		<dependency>
			<groupId>org.springframework</groupId>
			<artifactId>spring-context</artifactId>
		</dependency>
		<dependency>
			<groupId>${project.groupId}</groupId>
			<artifactId>jhaws-logging</artifactId>
			<version>${project.version}</version>
		</dependency>
		<dependency>
			<groupId>${project.groupId}</groupId>
			<artifactId>jhaws-lang</artifactId>
			<version>${project.version}</version>
		</dependency>
		<dependency>
			<groupId>${project.groupId}</groupId>
			<artifactId>jhaws-g11n</artifactId>
			<version>${project.version}</version>
		</dependency>
	</dependencies>
</project>


text:
<?php

namespace NTLAB\JS\Script;

use NTLAB\JS\Script as Base;
use NTLAB\JS\Util\Asset;

/**
 * Bootstrap javascript code repository for PHP.
 *
 * @author Toha
 */
class Bootstrap extends Base
{
    /**
     * @var string
     */
    protected $repository = 'bootstrap';

    protected function configure()
    {
        $this->setAsset(new Asset($this->repository, [Asset::ASSET_JAVASCRIPT => 'js', Asset::ASSET_STYLESHEET => 'css']));
        $this->addDependencies(['Popper']);
        $this->addAsset(Asset::ASSET_JAVASCRIPT, 'bootstrap.min');
        $this->addAsset(Asset::ASSET_STYLESHEET, 'bootstrap.min');
    }
}


text:
'use strict';

import React from 'react';
import { Link } from 'react-router';

import { PropTypes } from 'react';

export default class IndexPage extends React.Component {

  render() {

    return (

This privacy policy has been compiled to better serve those who are concerned with how their 'Personally identifiable information' (PII) is being used online. PII, as used in US privacy law and information security, is information that can be used on its own or with other information to identify, contact, or locate a single person, or to identify an individual in context. Please read our privacy policy carefully to get a clear understanding of how we collect, use, protect or otherwise handle your Personally Identifiable Information in accordance with our website.

					What personal information do we collect from the people that visit our blog, website or app?

When ordering or registering on our site, as appropriate, you may be asked to enter your email address, Instagram account or other details to help you with your experience.

					When do we collect information?

We collect information from you when you fill out a form  or enter information on our site.

					How do we use your information?

We may use the information we collect from you when you register, make a purchase, sign up for our newsletter, respond to a survey or marketing communication, surf the website, or use certain other site features in the following ways:

To personalize user's experience and to allow us to deliver the type of content and product offerings in which you are most interested.

To administer a contest, promotion, survey or other site feature.

					 Third Party Disclosure

We do not sell, trade, or otherwise transfer to outside parties your personally identifiable information unless we provide you with advance notice. This does not include website hosting partners and other parties who assist us in operating our website, conducting our business, or servicing you, so long as those parties agree to keep this information confidential. We may also release your information when we believe release is appropriate to comply with the law, enforce our site policies, or protect ours or others' rights, property, or safety. However, non-personally identifiable visitor information may be provided to other parties for marketing, advertising, or other uses.

Third party links
Occasionally, at our discretion, we may include or offer third party products or services on our website. These third party sites have separate and independent privacy policies. We therefore have no responsibility or liability for the content and activities of these linked sites. Nonetheless, we seek to protect the integrity of our site and welcome any feedback about these sites.

California Online Privacy Protection Act
CalOPPA is the first state law in the nation to require commercial websites and online services to post a privacy policy.  The law's reach stretches well beyond California to require a person or company in the United States (and conceivably the world) that operates websites collecting personally identifiable information from California consumers to post a conspicuous privacy policy on its website stating exactly the information being collected and those individuals with whom it is being shared, and to comply with this policy. -  See more at: https://consumercal.org/california-online-privacy-protection-act-caloppa/#sthash.0FdRbT51.dpuf

According to CalOPPA we agree to the following:
Users can visit our site anonymously
Once this privacy policy is created, we will add a link to it on our home page, or as a minimum on the first significant page after entering our website.Our Privacy Policy link includes the word 'Privacy', and can be easily be found on the page specified above. Users will be notified of any privacy policy changes:

On our Privacy Policy Page Users are able to change their personal information:
By emailing us

How does our site handle do not track signals?
>We honor do not track signals and do not track, plant cookies, or use advertising when a Do Not Track (DNT) browser mechanism is in place.

Does our site allow third party behavioral tracking?
No.

COPPA (Children Online Privacy Protection Act)
When it comes to the collection of personal information from children under 13, the Children's Online Privacy Protection Act (COPPA) puts parents in control.  The Federal Trade Commission, the nation's consumer protection agency, enforces the COPPA Rule, which spells out what operators of websites and online services must do to protect children's privacy and safety online.
We do not specifically market to children under 13.

Fair Information Practices
The Fair Information Practices Principles form the backbone of privacy law in the United States and the concepts they include have played a significant role in the development of data protection laws around the globe. Understanding the Fair Information Practice Principles and how they should be implemented is critical to comply with the various privacy laws that protect personal information.
In order to be in line with Fair Information Practices we will take the following responsive action, should a data breach occur:
We will notify the users via email
Within 7 business days
We also agree to the individual redress principle, which requires that individuals have a right to pursue legally enforceable rights against data collectors and processors who fail to adhere to the law. This principle requires not only that individuals have enforceable rights against data users, but also that individuals have recourse to courts or a government agency to investigate and/or prosecute non-compliance by data processors.

CAN SPAM Act
The CAN-SPAM Act is a law that sets the rules for commercial email, establishes requirements for commercial messages, gives recipients the right to have emails stopped from being sent to them, and spells out tough penalties for violations.
We collect your email address in order to:
To be in accordance with CANSPAM we agree to the following:\If at any time you would like to unsubscribe from receiving future emails, you can email us and we will promptly remove you from ALL correspondence.

    );
  }
}


text:
package lab.meteor.visualize.diagram.widgets;

import lab.meteor.visualize.resource.Resources;
import co.gongzh.snail.Animation;
import co.gongzh.snail.View;
import co.gongzh.snail.ViewGraphics;

public class CloseButton extends View {

	Animation fadeInAnimation;
	Animation fadeOutAnimation;

	public CloseButton() {
		fadeInAnimation = new FadeInAnimation();
		fadeOutAnimation = new FadeOutAnimation();
		setAlpha(0);
		setBackgroundColor(null);
		setSize(26,26);
	}

	@Override
	protected void mouseEntered() {
		fadeOutAnimation.cancel();
		fadeInAnimation.commit();
	}

	@Override
	protected void mouseExited() {
		fadeInAnimation.cancel();
		fadeOutAnimation.commit();
	}

	@Override
	protected void repaintView(ViewGraphics g) {
		g.drawImage(Resources.IMG_CLOSE, 0, 0, getWidth(), getHeight());
	}

	private class FadeInAnimation extends Animation {

		public FadeInAnimation() {
			super(0.2f);
		}

		@Override
		protected void animate(float progress) {
			setAlpha(progress);
		}

	}

	private class FadeOutAnimation extends Animation {

		public FadeOutAnimation() {
			super(0.2f);
		}

		@Override
		protected void animate(float progress) {
			setAlpha(1.0f - progress);
		}
	}

}


text:
<?xml version="1.0"?>
<layout version="0.1.0">
    <default>
        <reference name="footer">
            <block type="core/template" name="easy.email.capture.head" as="easy.email.capture.head" template="connector/email_capture.phtml"/>
            <block type="core/template" name="easy.email.capture" as="easy.email.capture" template="connector/email_capture_init.phtml"/>
            <block type="core/template" name="checkout.tag" as="connector.tag" template="connector/tracking_code.phtml"/>
        </reference>
    </default>
    <ddg_automation_email_basket>
        <remove name="product.tooltip"/>
    </ddg_automation_email_basket>
    <ddg_automation_feefo_score>
        <reference name="content">
            <block type="ddg_automation/feefo" name="connector_feefo_service_score" template="connector/feefo/score.phtml"/>
        </reference>
    </ddg_automation_feefo_score>
    <ddg_automation_feefo_reviews>
        <reference name="content">
            <block type="ddg_automation/feefo" name="connector_feefo_product_reviews" template="connector/feefo/reviews.phtml"/>
        </reference>
    </ddg_automation_feefo_reviews>
    <ddg_automation_products_related>
        <reference name="content">
            <block type="ddg_automation/recommended_products" name="connector_recommended_related" template="connector/product/list.phtml"/>
        </reference>
    </ddg_automation_products_related>
    <ddg_automation_products_crosssell>
        <reference name="content">
            <block type="ddg_automation/recommended_products" name="connector_recommended_crosssell" template="connector/product/list.phtml"/>
        </reference>
    </ddg_automation_products_crosssell>
    <ddg_automation_products_upsell>
        <reference name="content">
            <block type="ddg_automation/recommended_products" name="connector_recommended_upsell"
                   template="connector/product/list.phtml"/>
        </reference>
    </ddg_automation_products_upsell>
    <ddg_automation_quoteproducts_related>
        <reference name="content">
            <block type="ddg_automation/edc" name="connector_recommended_quote_related"
                   template="connector/product/list.phtml"/>
        </reference>
    </ddg_automation_quoteproducts_related>
    <ddg_automation_report_bestsellers>
        <reference name="content">
            <block type="ddg_automation/edc" name="connector_customer" template="connector/product/list.phtml"/>
        </reference>
    </ddg_automation_report_bestsellers>
    <ddg_automation_report_mostviewed>
        <reference name="content">
            <block type="ddg_automation/edc" name="connector_customer" template="connector/product/list.phtml"/>
        </reference>
    </ddg_automation_report_mostviewed>
    <ddg_automation_quoteproducts_crosssell>
        <reference name="content">
            <block type="ddg_automation/edc" name="connector_recommended_quote_crosssell"
                   template="connector/product/list.phtml"/>
        </reference>
    </ddg_automation_quoteproducts_crosssell>
    <ddg_automation_report_recentlyviewed>
        <reference name="content">
            <block type="ddg_automation/edc" name="connector_customer_recentlyviewed"
                   template="connector/product/list.phtml"/>
        </reference>
    </ddg_automation_report_recentlyviewed>
    <ddg_automation_wishlist_related>
        <reference name="content">
            <block type="ddg_automation/recommended_wishlistproducts" name="connector_recommended_wishlist_related"
                   template="connector/product/list.phtml"/>
        </reference>
    </ddg_automation_wishlist_related>
    <ddg_automation_wishlist_crosssell>
        <reference name="content">
            <block type="ddg_automation/recommended_wishlistproducts" name="connector_recommended_wishlist_crosssell"
                   template="connector/product/list.phtml"/>
        </reference>
    </ddg_automation_wishlist_crosssell>
    <ddg_automation_wishlist_upsell>
        <reference name="content">
            <block type="ddg_automation/recommended_wishlistproducts" name="connector_recommended_wishlist_upsell" template="connector/product/list.phtml"/>
        </reference>
    </ddg_automation_wishlist_upsell>
    <ddg_automation_quoteproducts_upsell>
        <reference name="content">
            <block type="ddg_automation/edc" name="connector_recommended_quote_upsell"
                   template="connector/product/list.phtml"/>
        </reference>
    </ddg_automation_quoteproducts_upsell>
    <ddg_automation_products_push>
        <reference name="content">
            <block type="ddg_automation/edc" name="connector_product_push" template="connector/product/list.phtml"/>
        </reference>
    </ddg_automation_products_push>
    <checkout_onepage_success>
        <reference name="content">
            <block type="checkout/onepage_success" name="checkout.roi" as="connector.roi"
                   template="connector/roi_code.phtml"/>
        </reference>
    </checkout_onepage_success>
    <!--Customer's Manage Subscription-->
    <newsletter_manage_index>
        <!--Datepicker-->
        <reference name="head">
            <action method="addItem">
                <type>js_css</type>
                <name>calendar/calendar-win2k-1.css</name>
                <params/>
            </action>
            <action method="addItem">
                <type>js</type>
                <name>calendar/calendar.js</name>
            </action>
            <action method="addItem">
                <type>js</type>
                <name>calendar/calendar-setup.js</name>
            </action>
        </reference>
        <!--Additional Books And Data Fields -->
        <reference name="my.account.wrapper">
            <block type="ddg_automation/customer_account_books" name="connector_additional_books"
                   template="connector/additional-newsletter-pref.phtml">
                <block type="core/html_calendar" name="html_calendar" as="html_calendar"
                       template="page/js/calendar.phtml"/>
            </block>
            <!--Back button -->
            <block type="customer/account_dashboard" name="customer.account.link.back"
                   template="customer/account/link/back.phtml"/>
        </reference>
    </newsletter_manage_index>
</layout>


text:
package com.infospace.sdk.util;

import com.infospace.sdk.models.*;

import java.util.*;

public class ShoppingHelper {
	public void configureThumbnailUrls(ShoppingProductResult result) {
		List<ImageResult> thumbnails = extractImageResults(result);
		result.setThumbnailUrls(thumbnails);
	}

	public List<ImageResult> extractImageResults(StandardResult result) {
		List<ResultGroup> groups = extractSupplementalImagesGroups(result.getChildren());
		List<ImageResult> thumbnails = new ArrayList<ImageResult>();

		for (ResultGroup group : groups) {
			thumbnails.addAll(filterThumbnailUrls(group.getChildren()));
		}

		return thumbnails;
	}

	private List<ResultGroup> extractSupplementalImagesGroups(List<ResultNode> results) {
		List<ResultGroup> groups = new ArrayList<ResultGroup>();

		if (results != null) {
			for (int i = results.size() - 1; i >= 0; i--) {
				ResultNode node = results.get(i);

				if (node instanceof ResultGroup) {
					ResultGroup group = (ResultGroup) node;
					if (group.getType() == ResultGroupType.IMAGEGROUP) {
						results.remove(i);
						groups.add(group);
					}
				}
			}
		}
		return groups;
	}

	private static List<ImageResult> filterThumbnailUrls(List<ResultNode> items) {
		List<ImageResult> thumbnails = new ArrayList<ImageResult>();

		if (items != null) {
			for (int i = items.size() - 1; i >= 0; i--) {
				ResultNode item = items.get(i);
				if (item instanceof ImageResult) {
					items.remove(i);
					thumbnails.add((ImageResult) item);
				}
			}
		}
		return thumbnails;
	}

	public void configureThumbnailUrls(ShoppingOfferResult result) {
		List<ImageResult> thumbnails = extractImageResults(result);
		result.setThumbnailUrls(thumbnails);
	}
}


text:
'use strict';

//Transactions service used to communicate Transactions REST endpoints
angular.module('transactions').factory('Transactions', ['$resource',
	function($resource) {
		return $resource('transactions/:transactionId', {
            transactionId: '@_id'
		}, {
			update: {
				method: 'PUT'
			}
		});
	}
]);


text:
function videoOn(index) {
	document.getElementById('vidImgDiv' + index).style.display = 'none';
	document.getElementById('vidTagDiv' + index).style.display = 'block';
	var video = document.getElementById('video' + index);
	video.controls = true;
	var source = document.createElement('source');
	source.setAttribute('src', obj.baseURL + obj.pictures[index].name + "?ac=" + obj.assetCookie);
	source.setAttribute('type', 'video/mp4');
	video.appendChild(source);
	video.play();
}

function videoOff(index) {
	var video = document.getElementById("video" + index);
	video.pause();
	while (video.firstChild) {
		video.firstChild.src ="";
		video.removeChild(video.firstChild);
		video.load();
	}
	document.getElementById('vidImgDiv' + index).style.display = 'block';
	document.getElementById('vidTagDiv' + index).style.display = 'none';
}

function getPreviewHeight(){
	return (document.documentElement.clientHeight / 4 * 3) + 'px';
}

function getPreviewWidth(){
	return (document.documentElement.clientWidth / 4 * 3) + 'px';
}

function showgallery() {

	for (var i = 0; i < obj.pictures.length; i++) {
		var elemFigure = document.createElement("FIGURE");
		elemFigure.id = "figure" + i;
		elemFigure.onclick = function(z) {
			var id = z.target.id
			console.log(z.target);
			var index = id.split("-")[1];
			start(index);
		}
		var elemA = document.createElement("A");
		elemA.id = "imgA-" + i;
		var elemImg = document.createElement("IMG");
		elemImg.id = "img-" + i;
		var srcString;
		if(obj.pictures[i].name.endsWith(".mp4")){
			var caption = obj.pictures[i].name.substring(0, obj.pictures[i].name.length-4);
			srcString = obj.baseURL + "tn_" + caption + ".jpg" + "?ac=" + obj.assetCookie;
		}else{
			srcString = obj.baseURL + "tn_" + obj.pictures[i].name + "?ac=" + obj.assetCookie;
		}

		elemImg.src = 'data:image/gif;base64,R0lGODlhAQABAAAAACH5BAEKAAEALAAAAAABAAEAAAICTAEAOw==';
		elemImg.setAttribute("data-src", srcString);

		elemImg.height = obj.pictures[i].tnh;
		elemImg.width = obj.pictures[i].tnw;

		if(obj.pictures[i].tnh > obj.pictures[i].tnw){
			elemImg.className = "portrait b-lazy";
		}else{
			elemImg.className = "b-lazy";
		}

		var elemDiv = document.createElement("DIV");
		elemDiv.id = "elemDiv-" + i;
		elemDiv.className = "thumbnailDiv";
		elemDiv.appendChild(elemImg);
		var l = Math.min(obj.pictures[i].tnh, obj.pictures[i].tnw);
		elemDiv.style.width = l + "px";
		elemDiv.style.height = l + "px";

		elemA.appendChild(elemDiv);
		elemFigure.appendChild(elemA);
		document.getElementById("pictures").appendChild(elemFigure);
	}

}

function start(indexToStart) {

	var pswpElement = document.querySelectorAll('.pswp')[0];
	var options = {
		history : false,
		index : parseInt(indexToStart),
		isClickableElement: function(el) {
			var x = (el.tagName === 'A' || el.tagName === 'IMG' || el.tagName === 'VIDEO') && el.className === 'psVideoElement';
		    return x;
		}
	};
	actObjectIndex = indexToStart;

	var gallery = new PhotoSwipe(pswpElement, PhotoSwipeUI_Default,
			obj.pictures, options);
	gallery.init();

	gallery.listen('afterChange', function() {
		prevObjectIndex = actObjectIndex;
		actObjectIndex = gallery.getCurrentIndex();
		if(prevObjectIndex>-1){
			if(obj.pictures[prevObjectIndex].name.endsWith(".mp4")){
				videoOff(prevObjectIndex);
			}
		}
	});

	gallery.listen('close', function() {
		if(gallery.getCurrentIndex()>-1){
			if(obj.pictures[gallery.getCurrentIndex()].name.endsWith(".mp4")){
				videoOff(gallery.getCurrentIndex());
			}
		}
		actObjectIndex = -1;
		prevObjectIndex = -1;
		document.ontouchmove = function (e) { return true; }
	});

	document.ontouchmove = function (e) { e.preventDefault() }

	 window.onresize = function(event) {
		if(gallery.getCurrentIndex()>-1){
			if(obj.pictures[gallery.getCurrentIndex()].name.endsWith(".mp4")){
				var w = getPreviewWidth();
				var h = getPreviewHeight();
				document.getElementById('vidImg' + gallery.getCurrentIndex()).style.maxHeight = h;
				document.getElementById('vidImg' + gallery.getCurrentIndex()).style.maxWidth = w;
				document.getElementById('video' + gallery.getCurrentIndex()).style.maxHeight = h;
				document.getElementById('video' + gallery.getCurrentIndex()).style.maxWidth = w;
			}
		}
	 };

};


text:
import React, { PropTypes } from 'react';
import ShallowDiffComponent from './ShallowDiffComponent';
import TodoItem from './TodoItem';
import Footer from './Footer';
import { COMPLETION_CHANGED } from '../constants/EventTypes';

export default class MainSection extends ShallowDiffComponent {
  constructor(props, context) {
    super(props, context);
    this.handleToggleAll = this.handleToggleAll.bind(this);
  }

  handleToggleAll(e) {
    const { dispatch, activeCount } = this.props;
    dispatch({
      type: COMPLETION_CHANGED,
      isCompleted: activeCount > 0
    });
  }

  renderToggleAll() {
    const { todos, completedCount } = this.props;

    if (todos.length) {
      return (
        <input className="toggle-all"
               type="checkbox"
               checked={completedCount === todos.length}
               onChange={this.handleToggleAll} />
      );
    }
  }

  renderFooter() {
    const { todos, activeCount, filter, completedCount, dispatch} = this.props;

    if (todos.length) {
      return (

      );
    }
  }

  render() {
    const { filteredTodos, dispatch } = this.props;

    return (

        {this.renderToggleAll()}

          {filteredTodos.map(todo =>
            <TodoItem key={todo.id} todo={todo} dispatch={dispatch} />
          )}

        {this.renderFooter()}

    );
  }
}

MainSection.propTypes = {
  todos: PropTypes.array.isRequired,
  filteredTodos: PropTypes.array.isRequired,
  filter: PropTypes.string.isRequired,
  activeCount: PropTypes.number.isRequired,
  completedCount: PropTypes.number.isRequired,
  dispatch: PropTypes.func.isRequired
};


text:
class AddCodeToCommoditySource < ActiveRecord::Migration[5.0]
  def change
    add_column :commodity_sources, :code, :string
  end
end


text:
'use strict';

var worker = self;

worker.onmessage = function (e)
{
	// This worker parses & decodes the tinTerrain.***
	var dataArrayBuffer = e.data.dataArrayBuffer;
	var bytes_readed = 0;
	var data = e.data;

	// 1. header.
	var centerX = new Float64Array(dataArrayBuffer.slice(bytes_readed, bytes_readed+8)); bytes_readed+=8;
	var centerY = new Float64Array(dataArrayBuffer.slice(bytes_readed, bytes_readed+8)); bytes_readed+=8;
	var centerZ = new Float64Array(dataArrayBuffer.slice(bytes_readed, bytes_readed+8)); bytes_readed+=8;

	var minHeight = new Float32Array(dataArrayBuffer.slice(bytes_readed, bytes_readed+4)); bytes_readed+=4;
	var maxHeight = new Float32Array(dataArrayBuffer.slice(bytes_readed, bytes_readed+4)); bytes_readed+=4;

	var boundingSphereCenterX = new Float64Array(dataArrayBuffer.slice(bytes_readed, bytes_readed+8)); bytes_readed+=8;
	var boundingSphereCenterY = new Float64Array(dataArrayBuffer.slice(bytes_readed, bytes_readed+8)); bytes_readed+=8;
	var boundingSphereCenterZ = new Float64Array(dataArrayBuffer.slice(bytes_readed, bytes_readed+8)); bytes_readed+=8;
	var boundingSphereRadius = new Float64Array(dataArrayBuffer.slice(bytes_readed, bytes_readed+8)); bytes_readed+=8;

	var horizonOcclusionPointX = new Float64Array(dataArrayBuffer.slice(bytes_readed, bytes_readed+8)); bytes_readed+=8;
	var horizonOcclusionPointY = new Float64Array(dataArrayBuffer.slice(bytes_readed, bytes_readed+8)); bytes_readed+=8;
	var horizonOcclusionPointZ = new Float64Array(dataArrayBuffer.slice(bytes_readed, bytes_readed+8)); bytes_readed+=8;

	// 2. vertex data.
	var readVertexCount = new Uint32Array(dataArrayBuffer.slice(bytes_readed, bytes_readed+4)); bytes_readed+=4;
	var vertexCount = readVertexCount[0];
	var uValues = new Uint16Array(dataArrayBuffer.slice(bytes_readed, bytes_readed + 2 * vertexCount)); bytes_readed += 2 * vertexCount;
	var vValues = new Uint16Array(dataArrayBuffer.slice(bytes_readed, bytes_readed + 2 * vertexCount)); bytes_readed += 2 * vertexCount;
	var hValues = new Uint16Array(dataArrayBuffer.slice(bytes_readed, bytes_readed + 2 * vertexCount)); bytes_readed += 2 * vertexCount;

	// decode data.
	var u = 0;
	var v = 0;
	var height = 0;
	for (var i=0; i<vertexCount; i++)
	{
		u += zigZagDecode(uValues[i]);
		v += zigZagDecode(vValues[i]);
		height += zigZagDecode(hValues[i]);

		uValues[i] = u;
		vValues[i] = v;
		hValues[i] = height;
	}

	// 3. indices.
	var readTrianglesCount = new Uint32Array(dataArrayBuffer.slice(bytes_readed, bytes_readed + 4)); bytes_readed += 4;
	var trianglesCount = readTrianglesCount[0];
	var indices;
	if (vertexCount > 65536 )
	{
		indices = new Uint32Array(dataArrayBuffer.slice(bytes_readed, bytes_readed + 4 * trianglesCount * 3)); bytes_readed += 4 * trianglesCount * 3;
	}
	else
	{
		indices = new Uint16Array(dataArrayBuffer.slice(bytes_readed, bytes_readed + 2 * trianglesCount * 3)); bytes_readed += 2 * trianglesCount * 3;
	}

	// decode indices.
	var code;
	var highest = 0;
	var indicesCount = indices.length;
	for (var i=0; i<indicesCount; i++)
	{
		code = indices[i];
		indices[i] = highest - code;
		if (code === 0)
		{
			++highest;
		}
	}

	// 4. edges indices.
	var westVertexCount;
	var westIndices;
	var southVertexCount;
	var southIndices;
	var eastVertexCount;
	var eastIndices;
	var northVertexCount;
	var northIndices;

	if (vertexCount > 65536 )
	{
		westVertexCount = (new Uint32Array(dataArrayBuffer.slice(bytes_readed, bytes_readed + 4)))[0]; bytes_readed += 4;
		westIndices = new Uint32Array(dataArrayBuffer.slice(bytes_readed, bytes_readed + 4 * westVertexCount)); bytes_readed += 4 * westVertexCount;

		southVertexCount = (new Uint32Array(dataArrayBuffer.slice(bytes_readed, bytes_readed + 4)))[0]; bytes_readed += 4;
		southIndices = new Uint32Array(dataArrayBuffer.slice(bytes_readed, bytes_readed + 4 * southVertexCount)); bytes_readed += 4 * southVertexCount;

		eastVertexCount = (new Uint32Array(dataArrayBuffer.slice(bytes_readed, bytes_readed + 4)))[0]; bytes_readed += 4;
		eastIndices = new Uint32Array(dataArrayBuffer.slice(bytes_readed, bytes_readed + 4 * eastVertexCount)); bytes_readed += 4 * eastVertexCount;

		northVertexCount = (new Uint32Array(dataArrayBuffer.slice(bytes_readed, bytes_readed + 4)))[0]; bytes_readed += 4;
		northIndices = new Uint32Array(dataArrayBuffer.slice(bytes_readed, bytes_readed + 4 * northVertexCount)); bytes_readed += 4 * northVertexCount;
	}
	else
	{
		westVertexCount = (new Uint32Array(dataArrayBuffer.slice(bytes_readed, bytes_readed + 4)))[0]; bytes_readed += 4;
		westIndices = new Uint16Array(dataArrayBuffer.slice(bytes_readed, bytes_readed + 2 * westVertexCount)); bytes_readed += 2 * westVertexCount;

		southVertexCount = (new Uint32Array(dataArrayBuffer.slice(bytes_readed, bytes_readed + 4)))[0]; bytes_readed += 4;
		southIndices = new Uint16Array(dataArrayBuffer.slice(bytes_readed, bytes_readed + 2 * southVertexCount)); bytes_readed += 2 * southVertexCount;

		eastVertexCount = (new Uint32Array(dataArrayBuffer.slice(bytes_readed, bytes_readed + 4)))[0]; bytes_readed += 4;
		eastIndices = new Uint16Array(dataArrayBuffer.slice(bytes_readed, bytes_readed + 2 * eastVertexCount)); bytes_readed += 2 * eastVertexCount;

		northVertexCount = (new Uint32Array(dataArrayBuffer.slice(bytes_readed, bytes_readed + 4)))[0]; bytes_readed += 4;
		northIndices = new Uint16Array(dataArrayBuffer.slice(bytes_readed, bytes_readed + 2 * northVertexCount)); bytes_readed += 2 * northVertexCount;
	}

	// 5. extension header.
	var extensionId = new Uint8Array(dataArrayBuffer.slice(bytes_readed, bytes_readed + 1)); bytes_readed += 1;
	var extensionLength = (new Uint32Array(dataArrayBuffer.slice(bytes_readed, bytes_readed + 4)))[0]; bytes_readed += 4;

	// Decoding in this worker.*****************************************************************************************************************************
	// Decoding in this worker.*****************************************************************************************************************************
	// Decoding in this worker.*****************************************************************************************************************************
	var PI = Math.PI;
	var degToRadFactor = PI/180.0;

	var minLon = data.info.minGeographicLongitude * degToRadFactor;
	var minLat = data.info.minGeographicLatitude * degToRadFactor;
	var maxLon = data.info.maxGeographicLongitude * degToRadFactor;
	var maxLat = data.info.maxGeographicLatitude * degToRadFactor;
	var lonRange = maxLon - minLon;
	var latRange = maxLat - minLat;

	var heightRange = maxHeight[0] - minHeight[0];

	//넘길거
	var texCoordsArray = new Float32Array(vertexCount*2);
	var lonArray = new Float32Array(vertexCount);
	var latArray = new Float32Array(vertexCount);
	var altArray = new Float32Array(vertexCount);
	var shortMax = 32767; // 65536
	var lonRangeDivShortMax = lonRange/shortMax;
	var latRangeDivShortMax = latRange/shortMax;
	var heightRangeDivShortMax = heightRange/shortMax;

	var depth = data.info.z;
	var bMakeNormals = data.info.bMakeNormals;

	var exageration = 2.0;
	var imageryType = data.info.imageryType;

	//WEB_MERCATOR
	var realmaxS, realmaxT, realminS, realminT;
	if (imageryType === 2)
	{
		// web_mercator.
		// https://en.wikipedia.org/wiki/Web_Mercator_projection
		var aConst = (1.0/(2.0*PI))*Math.pow(2.0, depth);
		var PI_DIV_4 = PI/4;
		var minT = Math.round(aConst*(PI-Math.log(Math.tan(PI_DIV_4+minLat/2))));
		var maxT = Math.round(aConst*(PI-Math.log(Math.tan(PI_DIV_4+maxLat/2))));
		var minS = Math.round(aConst*(minLon+PI));
		var maxS = Math.round(aConst*(maxLon+PI));
		var floorMinS = Math.floor(minS);
		var t, s;

		// Flip texCoordY for minT & maxT.***
		minT = 1.0 - minT;
		maxT = 1.0 - maxT;

		//var texCorrectionFactor = 0.0005;
		var texCorrectionFactor = 0.003 + (depth * 0.0000001);
		//var texCorrectionFactor = 0.002 + (1/(depth+1) * 0.008);

		for (var i=0; i<vertexCount; i++)
		{
			lonArray[i] = minLon + uValues[i]*lonRangeDivShortMax;
			latArray[i] = minLat + vValues[i]*latRangeDivShortMax;
			altArray[i] = minHeight[0] + hValues[i]*heightRangeDivShortMax;

			var currLon = lonArray[i];
			var currLat = latArray[i];

			// make texcoords.
			t = aConst*(PI-Math.log(Math.tan(PI_DIV_4+currLat/2)));

			//var t1 = t;
			t = 1.0 - t;

			//var t2 = t;

			// Substract minT to "t" to make range [0 to 1].***
			t -= minT;
			//var t3 = t;

			s = aConst*(currLon+PI);
			s -= floorMinS;

			if ( s < 0.0 )
			{ s = 0.0; }
			else if ( s > 1.0 )
			{ s = 1.0; }

			if ( t < 0.0 )
			{ t = 0.0; }
			else if ( t > 1.0 )
			{ t = 1.0; }

			texCoordsArray[i*2] = s;
			texCoordsArray[i*2+1] = t;
		}
	}
	else
	{
		// crs84.
		for (var i=0; i<vertexCount; i++)
		{
			lonArray[i] = minLon + uValues[i]*lonRangeDivShortMax;
			latArray[i] = minLat + vValues[i]*latRangeDivShortMax;
			altArray[i] = minHeight[0] + hValues[i]*heightRangeDivShortMax;

			// make texcoords.
			texCoordsArray[i*2] = uValues[i]/shortMax;
			texCoordsArray[i*2+1] = vValues[i]/shortMax;
		}
	}

	//넘길거
	var cartesiansArray = geographicRadianArrayToFloat32ArrayWgs84(lonArray, latArray, altArray, undefined, centerX[0], centerY[0], centerZ[0]);
	var normalsArray;
	if (bMakeNormals)
	{
		normalsArray = getNormalCartesiansArray(cartesiansArray, indices, undefined, undefined);
	}

	var texCorrectionFactor = getTexCorrection(depth);

	// Do overlap for tiles.***
	/*
	var southIndices = param.southIndices;
	var indicesCount = southIndices.length;
	for (var i=0; i<indicesCount; i++)
	{
		var idx = southIndices[i];
		latArray[idx] -= latRange*0.05;
		altArray[idx] -= 3.0;
	}

	var northIndices = param.northIndices;
	var indicesCount = northIndices.length;
	for (var i=0; i<indicesCount; i++)
	{
		var idx = northIndices[i];
		latArray[idx] += latRange*0.05;
		altArray[idx] -= 3.0;
	}

	var westIndices = param.westIndices;
	var indicesCount = westIndices.length;
	for (var i=0; i<indicesCount; i++)
	{
		var idx = westIndices[i];
		lonArray[idx] -= latRange*0.05;
		altArray[idx] -= 3.0;
	}

	var eastIndices = param.eastIndices;
	var indicesCount = westIndices.length;
	for (var i=0; i<indicesCount; i++)
	{
		var idx = eastIndices[i];
		lonArray[idx] += latRange*0.05;
		altArray[idx] -= 3.0;
	}
	*/

	var options = {
		skirtDepth          : 500,
		texCorrectionFactor : texCorrectionFactor
	};
	var skirtResultObject = getSkirtTrianglesStrip(lonArray, latArray, altArray, texCoordsArray, southIndices, eastIndices, northIndices, westIndices, options, centerX[0], centerY[0], centerZ[0]);
	//넘길거
	var skirtCartesiansArray = skirtResultObject.skirtCartesiansArray;
	//넘길거
	var skirtTexCoordsArray = skirtResultObject.skirtTexCoordsArray;
	//넘길거
	var skirtAltitudesArray = skirtResultObject.skirtAltitudesArray;

	//넘길거
	var altArray = altArray;

	worker.postMessage({parsedTerrain: {
		texCoordsArray       : texCoordsArray,
		cartesiansArray      : cartesiansArray,
		skirtCartesiansArray : skirtCartesiansArray,
		skirtTexCoordsArray  : skirtTexCoordsArray,
		skirtAltitudesArray  : skirtAltitudesArray,
		altArray             : altArray,
		normalsArray         : normalsArray,
		longitudesArray      : lonArray,
		latitudesArray       : latArray,
		centerX                : centerX,
		centerY                : centerY,
		centerZ                : centerZ,
		minHeight              : minHeight,
		maxHeight              : maxHeight,
		boundingSphereCenterX  : boundingSphereCenterX,
		boundingSphereCenterY  : boundingSphereCenterY,
		boundingSphereCenterZ  : boundingSphereCenterZ,
		boundingSphereRadius   : boundingSphereRadius,
		horizonOcclusionPointX : horizonOcclusionPointX,
		horizonOcclusionPointY : horizonOcclusionPointY,
		horizonOcclusionPointZ : horizonOcclusionPointZ,
		indices                : indices,
		westIndices            : westIndices,
		southIndices           : southIndices,
		eastIndices            : eastIndices,
		northIndices           : northIndices,
		extensionId            : extensionId,
		extensionLength        : extensionLength
	}, info: e.data.info});
};

function zigZagDecode(value)
{
	return (value >> 1) ^ (-(value & 1));
};

function getNormalCartesiansArray(cartesiansArray, indicesArray, resultNormalCartesiansArray, options)
{
	var idx_1, idx_2, idx_3;
	var point_1, point_2, point_3;
	var normal;
	var normalsArray = [];
	var trianglesCount = indicesArray.length/3;
	for (var i=0; i<trianglesCount; i++)
	{
		idx_1 = indicesArray[i*3];
		idx_2 = indicesArray[i*3+1];
		idx_3 = indicesArray[i*3+2];

		point_1 = new Point3D_(cartesiansArray[idx_1*3], cartesiansArray[idx_1*3+1], cartesiansArray[idx_1*3+2]);
		point_2 = new Point3D_(cartesiansArray[idx_2*3], cartesiansArray[idx_2*3+1], cartesiansArray[idx_2*3+2]);
		point_3 = new Point3D_(cartesiansArray[idx_3*3], cartesiansArray[idx_3*3+1], cartesiansArray[idx_3*3+2]);

		// Calculate the normal for this triangle.
		var resultObject = {
			area: 0
		};
		normal = calculateNormal(point_1, point_2, point_3, undefined, resultObject);
		var area = resultObject.area/1000.0;
		normal.x *= area;
		normal.y *= area;
		normal.z *= area;

		// test calculate triangle perimeter to ponderate the normal.
		//var perimeter = point_1.squareDistTo(point_2.x, point_2.y, point_2.z) + point_2.squareDistTo(point_3.x, point_3.y, point_3.z) + point_3.squareDistTo(point_1.x, point_1.y, point_1.z);
		//perimeter /= 1000.0;
		//normal.x *= perimeter;
		//normal.y *= perimeter;
		//normal.z *= perimeter;

		// Accum normals for each points.
		// Point 1.***
		if (normalsArray[idx_1] !== undefined)
		{
			normalsArray[idx_1].addPoint(normal);
		}
		else
		{
			normalsArray[idx_1] = new Point3D_(normal.x, normal.y, normal.z);
		}

		// Point 2.***
		if (normalsArray[idx_2] !== undefined)
		{
			normalsArray[idx_2].addPoint(normal);
		}
		else
		{
			normalsArray[idx_2] = new Point3D_(normal.x, normal.y, normal.z);
		}

		// Point 3.***
		if (normalsArray[idx_3] !== undefined)
		{
			normalsArray[idx_3].addPoint(normal);
		}
		else
		{
			normalsArray[idx_3] = new Point3D_(normal.x, normal.y, normal.z);
		}
	}

	// finally, normalize all normals.
	var normalsCount = normalsArray.length;
	if (resultNormalCartesiansArray === undefined)
	{ resultNormalCartesiansArray = new Int8Array(normalsCount*3); }

	for (var i=0; i<normalsCount; i++)
	{
		var normal = normalsArray[i];
		normal.unitary();

		resultNormalCartesiansArray[i*3] = Math.floor(normal.x*127);
		resultNormalCartesiansArray[i*3+1] = Math.floor(normal.y*127);
		resultNormalCartesiansArray[i*3+2] = Math.floor(normal.z*127);
	}

	return resultNormalCartesiansArray;

};

function calculateNormal(point1, point2, point3, resultNormal, resultObject)
{
	// Given 3 points, this function calculates the normal.
	var currentPoint = point1;
	var prevPoint = point3;
	var nextPoint = point2;

	var v1 = new Point3D_(currentPoint.x - prevPoint.x,     currentPoint.y - prevPoint.y,     currentPoint.z - prevPoint.z);
	var v2 = new Point3D_(nextPoint.x - currentPoint.x,     nextPoint.y - currentPoint.y,     nextPoint.z - currentPoint.z);

	//v1.unitary();
	//v2.unitary();
	if (resultNormal === undefined)
	{ resultNormal = new Point3D_(); }

	resultNormal = v1.crossProduct(v2, resultNormal);

	resultObject.area = resultNormal.getModul() / 2;
	resultNormal.unitary();

	return resultNormal;
};

function geographicRadianArrayToFloat32ArrayWgs84(lonArray, latArray, altArray, resultCartesianArray, centerX, centerY, centerZ)
{
	// defined in the LINZ standard LINZS25000 (Standard for New Zealand Geodetic Datum 2000)
	// https://www.linz.govt.nz/data/geodetic-system/coordinate-conversion/geodetic-datum-conversions/equations-used-datum
	// a = semi-major axis.
	// e2 = firstEccentricitySquared.
	// v = a / sqrt(1 - e2 * sin2(lat)).
	// x = (v+h)*cos(lat)*cos(lon).
	// y = (v+h)*cos(lat)*sin(lon).
	// z = [v*(1-e2)+h]*sin(lat).
	var equatorialRadius = 6378137.0; // meters.
	var firstEccentricitySquared = 6.69437999014E-3;

	var lonRad;
	var latRad;
	var cosLon;
	var cosLat;
	var sinLon;
	var sinLat;
	var a = equatorialRadius;
	var e2 = firstEccentricitySquared;
	var e2a = 1.0 - e2;
	var v;
	var h;

	var coordsCount = lonArray.length;
	if (resultCartesianArray === undefined)
	{
		resultCartesianArray = new Float32Array(coordsCount*3);
	}
	for (var i=0; i<coordsCount; i++)
	{
		lonRad = lonArray[i];
		latRad = latArray[i];
		cosLon = Math.cos(lonRad);
		cosLat = Math.cos(latRad);
		sinLon = Math.sin(lonRad);
		sinLat = Math.sin(latRad);
		v = a/Math.sqrt(1.0 - e2 * sinLat * sinLat);
		h = altArray[i];

		resultCartesianArray[i*3] = (v+h)*cosLat*cosLon - centerX;
		resultCartesianArray[i*3+1] = (v+h)*cosLat*sinLon - centerY;
		resultCartesianArray[i*3+2] = (v*e2a+h)*sinLat - centerZ;
	}

	return resultCartesianArray;
};

var texCorrection = [];

texCorrection[0] = 0.006;
texCorrection[1] = 0.006;
texCorrection[2] = 0.006;
texCorrection[3] = 0.006;
texCorrection[4] = 0.006;
texCorrection[5] = 0.006;
texCorrection[6] = 0.006;
texCorrection[7] = 0.006;
texCorrection[8] = 0.006;
texCorrection[9] = 0.006;
texCorrection[10] = 0.008;
texCorrection[11] = 0.008;
texCorrection[12] = 0.016;
texCorrection[13] = 0.016;
texCorrection[14] = 0.016;
texCorrection[15] = 0.016;
texCorrection[16] = 0.016;
texCorrection[17] = 0.016;
texCorrection[18] = 0.016;
texCorrection[19] = 0.016;
texCorrection[20] = 0.016;
texCorrection[21] = 0.016;
texCorrection[22] = 0.016;

//for (var i=0; i<23; i++)
//{ texCorrection[i] *= 2; }

function getTexCorrection(depth)
{
	return texCorrection[depth];
};

function getSkirtTrianglesStrip(lonArray, latArray, altArray, texCoordsArray, southIndices, eastIndices, northIndices, westIndices, options, centerX, centerY, centerZ)
{
	// Given "lonArray", "latArray" & "altArray", this function makes skirtCartesiansArray & skirtTexCoordsArray.***
	// Note: skirtMesh is trianglesStrip, so, there are no indices.***
	var skirtDepth = 500.0;
	var texCorrectionFactor = 1.0;
	if (options)
	{
		if (options.skirtDepth !== undefined)
		{ skirtDepth = options.skirtDepth; }

		if (options.texCorrectionFactor !== undefined)
		{ texCorrectionFactor = options.texCorrectionFactor; }
	}

	// Texture correction in borders & make skirt data.***
	var westVertexCount = westIndices.length;
	var southVertexCount = southIndices.length;
	var eastVertexCount = eastIndices.length;
	var northVertexCount = northIndices.length;

	var totalVertexCount = westVertexCount + southVertexCount + eastVertexCount + northVertexCount;

	var skirtLonArray = new Float32Array(totalVertexCount * 2);
	var skirtLatArray = new Float32Array(totalVertexCount * 2);
	var skirtAltArray = new Float32Array(totalVertexCount * 2);
	var skirtTexCoordsArray = new Float32Array(totalVertexCount * 4);
	//var skinAltitudes = new Float32Array(totalVertexCount * 4);

	//texCorrectionFactor *= 0.1;

	var counter = 0;
	var s, t;

	for (var j=0; j<westVertexCount; j++)
	{
		var idx = westIndices[j];

		//texCoordsArray[idx*2] += texCorrectionFactor;
		s = texCoordsArray[idx*2];
		t = texCoordsArray[idx*2+1];

		skirtLonArray[counter] = lonArray[idx];
		skirtLatArray[counter] = latArray[idx];
		skirtAltArray[counter] = altArray[idx];

		skirtTexCoordsArray[counter*2] = s;   // s.
		skirtTexCoordsArray[counter*2+1] = t; // t.

		counter += 1;

		skirtLonArray[counter] = lonArray[idx];
		skirtLatArray[counter] = latArray[idx];
		skirtAltArray[counter] = altArray[idx]-skirtDepth;

		skirtTexCoordsArray[counter*2] = s;   // s.
		skirtTexCoordsArray[counter*2+1] = t; // t.

		counter += 1;
	}

	for (var j=0; j<southVertexCount; j++)
	{
		var idx = southIndices[j];

		//texCoordsArray[idx*2+1] += (texCorrectionFactor);
		s = texCoordsArray[idx*2];
		t = texCoordsArray[idx*2+1];

		skirtLonArray[counter] = lonArray[idx];
		skirtLatArray[counter] = latArray[idx];
		skirtAltArray[counter] = altArray[idx];

		skirtTexCoordsArray[counter*2] = s;   // s.
		skirtTexCoordsArray[counter*2+1] = t; // t.

		counter += 1;

		skirtLonArray[counter] = lonArray[idx];
		skirtLatArray[counter] = latArray[idx];
		skirtAltArray[counter] = altArray[idx]-skirtDepth;

		skirtTexCoordsArray[counter*2] = s;   // s.
		skirtTexCoordsArray[counter*2+1] = t; // t.

		counter += 1;
	}

	for (var j=0; j<eastVertexCount; j++)
	{
		var idx = eastIndices[j];

		//texCoordsArray[idx*2] -= texCorrectionFactor;
		s = texCoordsArray[idx*2];
		t = texCoordsArray[idx*2+1];

		var texCoord_x = texCoordsArray[idx*2];
		var texCoord_y = texCoordsArray[idx*2+1];

		skirtLonArray[counter] = lonArray[idx];
		skirtLatArray[counter] = latArray[idx];
		skirtAltArray[counter] = altArray[idx];

		skirtTexCoordsArray[counter*2] = s;   // s.
		skirtTexCoordsArray[counter*2+1] = t; // t.

		counter += 1;

		skirtLonArray[counter] = lonArray[idx];
		skirtLatArray[counter] = latArray[idx];
		skirtAltArray[counter] = altArray[idx]-skirtDepth;

		skirtTexCoordsArray[counter*2] = s;   // s.
		skirtTexCoordsArray[counter*2+1] = t; // t.

		counter += 1;
	}

	for (var j=0; j<northVertexCount; j++)
	{
		var idx = northIndices[j];
		//texCoordsArray[idx*2+1] -= (texCorrectionFactor);
		s = texCoordsArray[idx*2];
		t = texCoordsArray[idx*2+1];

		skirtLonArray[counter] = lonArray[idx];
		skirtLatArray[counter] = latArray[idx];
		skirtAltArray[counter] = altArray[idx];

		skirtTexCoordsArray[counter*2] = s;   // s.
		skirtTexCoordsArray[counter*2+1] = t; // t.
		counter += 1;

		skirtLonArray[counter] = lonArray[idx];
		skirtLatArray[counter] = latArray[idx];
		skirtAltArray[counter] = altArray[idx]-skirtDepth;

		skirtTexCoordsArray[counter*2] = s;   // s.
		skirtTexCoordsArray[counter*2+1] = t; // t.
		counter += 1;
	}

	var skirtCartesiansArray = geographicRadianArrayToFloat32ArrayWgs84(skirtLonArray, skirtLatArray, skirtAltArray, undefined, centerX, centerY, centerZ);

	var resultObject = {
		skirtCartesiansArray : skirtCartesiansArray,
		skirtTexCoordsArray  : skirtTexCoordsArray,
		skirtAltitudesArray  : skirtAltArray
	};

	return resultObject;
};

var Point3D_ = function(x, y, z)
{
	this.x = 0;
	this.y = 0;
	this.z = 0;

	if (x !== undefined)
	{ this.x = x; }
	else
	{ this.x = 0.0; }

	if (y !== undefined)
	{ this.y = y; }
	else
	{ this.y = 0.0; }

	if (z !== undefined)
	{ this.z = z; }
	else
	{ this.z = 0.0; }

	this.pointType; // 1 = important point.
};
Point3D_.prototype.getSquaredModul = function()
{
	return this.x*this.x + this.y*this.y + this.z*this.z;
};
Point3D_.prototype.getModul = function()
{
	return Math.sqrt(this.getSquaredModul());
};

Point3D_.prototype.squareDistTo = function(x, y, z)
{
	var dx = this.x - x;
	var dy = this.y - y;
	var dz = this.z - z;

	return dx*dx + dy*dy + dz*dz;
};

Point3D_.prototype.unitary = function()
{
	var modul = this.getModul();
	this.x /= modul;
	this.y /= modul;
	this.z /= modul;
};

Point3D_.prototype.crossProduct = function(point, resultPoint)
{
	if (resultPoint === undefined) { resultPoint = new Point3D_(); }

	resultPoint.x = this.y * point.z - point.y * this.z;
	resultPoint.y = point.x * this.z - this.x * point.z;
	resultPoint.z = this.x * point.y - point.x * this.y;

	return resultPoint;
};

Point3D_.prototype.addPoint = function(point)
{
	this.x += point.x; this.y += point.y; this.z += point.z;
};


text:
namespace ark {

class GLEquirectangularCubemapUploader : public Texture::Uploader {
public:
    GLEquirectangularCubemapUploader(const sp<RenderController>& renderController, const Shader& shader, const sp<Texture>& texture, const sp<Size>& size);

    virtual void initialize(GraphicsContext& graphicsContext, Texture::Delegate& delegate) override;

//  [[plugin::resource-loader("equirectangular")]]
    class BUILDER : public Builder<Texture::Uploader> {
    public:
        BUILDER(BeanFactory& factory, const document& manifest, const sp<ResourceLoaderContext>& resourceLoaderContext);

        virtual sp<Texture::Uploader> build(const Scope& args) override;

    private:
        sp<RenderController> _render_controller;
        sp<Builder<Size>> _size;
        sp<Builder<Shader>> _shader;
        sp<Builder<Texture>> _texture;
    };

private:
    sp<RenderController> _render_controller;
    sp<ShaderBindings> _shader_bindings;
    sp<Texture> _texture;
    sp<Size> _size;

};

}

#endif


text:
<!DOCTYPE html >

          <meta http-equiv="X-UA-Compatible" content="IE=edge" />
          <meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=no" />
          <title>ScalaTest 3.0.7  - org.scalatest.matchers.MatcherFactory2.OrBeWord</title>
          <meta name="description" content="ScalaTest 3.0.7 - org.scalatest.matchers.MatcherFactory2.OrBeWord" />
          <meta name="keywords" content="ScalaTest 3.0.7 org.scalatest.matchers.MatcherFactory2.OrBeWord" />
          <meta http-equiv="content-type" content="text/html; charset=UTF-8" />

      <link href="../../../lib/index.css" media="screen" type="text/css" rel="stylesheet" />
      <link href="../../../lib/template.css" media="screen" type="text/css" rel="stylesheet" />
      <link href="../../../lib/diagrams.css" media="screen" type="text/css" rel="stylesheet" id="diagrams-css" />

        ScalaTest 3.0.7
        < Back

            <input autocapitalize="none" placeholder="Search" id="index-input" type="text" accesskey="/" />
            
            

Packages

        

        package

        root

Definition Classes

root

        

        package

        org

Definition Classes

root

        

        package

        scalatest

ScalaTest's main traits, classes, and other members, including members supporting ScalaTest's DSL for the Scala interpreter.

ScalaTest's main traits, classes, and other members, including members supporting ScalaTest's DSL for the Scala interpreter.

Definition Classes

org

        

        package

        matchers

Definition Classes

scalatest

        

        abstract
        class

        MatcherFactory2[-SC, TC1[_], TC2[_]] extends AnyRef

A matcher factory that can produce a matcher given two typeclass instances.

A matcher factory that can produce a matcher given two typeclass instances.

In the type parameters for this class, "SC" means superclass; "TC"
(in TC1, TC2, etc.) means typeclass.
This class's matcher factory method will produce a Matcher[T], where T is a subtype of (or the same type
as) SC, given a typeclass instance for each TCn
implicit parameter (for example, a TC1[T], TC2[T], etc.).

Definition Classes

matchers

                        AndBeWord

                        AndContainWord

                        AndEndWithWord

                        AndFullyMatchWord

                        AndHaveWord

                        AndIncludeWord

                        AndNotWord

                        AndStartWithWord

                        OrBeWord

                        OrContainWord

                        OrEndWithWord

                        OrFullyMatchWord

                        OrHaveWord

                        OrIncludeWord

                        OrNotWord

                        OrStartWithWord

c

org.scalatest.matchers.MatcherFactory2

OrBeWord

        

        final
        class

        OrBeWord extends AnyRef

This class is part of the ScalaTest matchers DSL. Please see the documentation for Matchers for an overview of
the matchers DSL.

Source

MatcherFactory2.scala

            Linear Supertypes

AnyRef, Any

          

            <input id="mbrsel-input" placeholder="Filter all members" type="text" accesskey="/" />

          

            Ordering

Alphabetic

By Inheritance

                  Inherited

OrBeWord

AnyRef

Any

Hide All

Show All

              Visibility

Public

All

Instance Constructors

        

        new

        OrBeWord()

Value Members

        

        final
        def

        !=(arg0: Any): Boolean

Definition Classes

AnyRef → Any

        

        final
        def

        ##(): Int

Definition Classes

AnyRef → Any

        

        final
        def

        ==(arg0: Any): Boolean

Definition Classes

AnyRef → Any

        

        def

        a[U](aMatcher: AMatcher[U]): MatcherFactory2[SC with U, TC1, TC2]

This method enables the following syntax given a MatcherFactory2:

This method enables the following syntax given a MatcherFactory2:

aMatcherFactory or be a (validNumber)
                      ^

        

        def

        a[U](bePropertyMatcher: BePropertyMatcher[U]): MatcherFactory2[SC with U, TC1, TC2]

This method enables the following syntax given a MatcherFactory2:

This method enables the following syntax given a MatcherFactory2:

aMatcherFactory or be a (directory)
                      ^

        

        def

        an[U](anMatcher: AnMatcher[U]): MatcherFactory2[SC with U, TC1, TC2]

This method enables the following syntax given a MatcherFactory2, where integerNumber is a AnMatcher:

This method enables the following syntax given a MatcherFactory2, where integerNumber is a AnMatcher:

aMatcherFactory or be an (integerNumber)
                      ^

        

        def

        an[U](bePropertyMatcher: BePropertyMatcher[U]): MatcherFactory2[SC with U, TC1, TC2]

This method enables the following syntax given a MatcherFactory2, where apple is a BePropertyMatcher:

This method enables the following syntax given a MatcherFactory2, where apple is a BePropertyMatcher:

aMatcherFactory or be an (apple)
                      ^

        

        final
        def

        asInstanceOf[T0]: T0

Definition Classes

Any

        

        def

        clone(): AnyRef

Attributes

protected[java.lang]

Definition Classes

AnyRef

Annotations

                @native()

                @throws(

      ...
    )

        

        def

        definedAt[A, U <: PartialFunction[A, _]](right: A): MatcherFactory2[SC with U, TC1, TC2]

This method enables the following syntax, where fraction refers to a PartialFunction:

This method enables the following syntax, where fraction refers to a PartialFunction:

aMatcherFactory or be definedAt (8)
                      ^

        

        final
        def

        eq(arg0: AnyRef): Boolean

Definition Classes

AnyRef

        

        def

        equals(arg0: Any): Boolean

Definition Classes

AnyRef → Any

        

        def

        finalize(): Unit

Attributes

protected[java.lang]

Definition Classes

AnyRef

Annotations

                @throws(

      classOf[java.lang.Throwable]
    )

        

        final
        def

        getClass(): Class[_]

Definition Classes

AnyRef → Any

Annotations

                @native()

        

        def

        hashCode(): Int

Definition Classes

AnyRef → Any

Annotations

                @native()

        

        final
        def

        isInstanceOf[T0]: Boolean

Definition Classes

Any

        

        final
        def

        ne(arg0: AnyRef): Boolean

Definition Classes

AnyRef

        

        final
        def

        notify(): Unit

Definition Classes

AnyRef

Annotations

                @native()

        

        final
        def

        notifyAll(): Unit

Definition Classes

AnyRef

Annotations

                @native()

        

        final
        def

        synchronized[T0](arg0: ⇒ T0): T0

Definition Classes

AnyRef

        

        def

        theSameInstanceAs(anyRef: AnyRef): MatcherFactory2[SC, TC1, TC2]

This method enables the following syntax given a MatcherFactory2:

This method enables the following syntax given a MatcherFactory2:

aMatcherFactory or be theSameInstanceAs (otherString)
                      ^

        

        def

        toString(): String

Definition Classes

AnyRef → Any

        

        final
        def

        wait(): Unit

Definition Classes

AnyRef

Annotations

                @throws(

      ...
    )

        

        final
        def

        wait(arg0: Long, arg1: Int): Unit

Definition Classes

AnyRef

Annotations

                @throws(

      ...
    )

        

        final
        def

        wait(arg0: Long): Unit

Definition Classes

AnyRef

Annotations

                @native()

                @throws(

      ...
    )

Inherited from AnyRef

Inherited from Any

Ungrouped


text:
package org.teavm.platform.metadata;

/**
 *
 * @author Alexey Andreev
 * @param <T>
 */
public interface ResourceArray<T extends Resource> extends Resource {
    int size();

    T get(int i);

    void add(T elem);
}


text:
_tidy-tools_ is a small project to transform C++ code.

This project is split on 2 parts:
* the effective C++ tools based on Clang under _tools_ folder
* the driver in C# driver to apply tools on files listed in a `compile_commands.json` file.

## How to compile
Under tidy-tools folder:
```
$ mkdir build-dir
$ cd build-dir
$ ../configure.sh # adapt it according with your platform
$ make -j 4
```

`run-tidy` could be build with Visual Studio (10 and above) or Mono tools.

## Tools provided
* clang-tidy: Apply a clang tidy transformation.
* early-return: Apply the 'early return' pattern on the function of the file
where possible.

## Usage

`run-tidy` will run thought files described in a `compile_commands.json` and
apply transformation on them.

It is possible to specify a file, a list of file or some filter where to apply
the transformations.
For example:
```
$ run-tidy --foo xxx.cpp
```
Will apply `foo` tranformation to `xxx.cpp`.

```
$ run-tidy --foo bar/zzz
```
Will apply `foo` tranformation to every file under `bar/zzz`.

Full command list is:
```
$ run-tidy --help
Usage: run-tidy [options] [files [files...]]

Runs transformation (clang-tidy, small-tidy, internal ones) over all files in a
compilation database.
Requires clang-tidy, clang-apply-replacements and small-tidy in $PATH.

Version: 1d

Positional arguments:
  files               files to be process (anything that will match within
                      compilation database contents)

Optionnal arguments:
  -h, --help                 show this help message
  -j, --jobs=VALUE           number of concurent jobs
      --outputdir=VALUE      patches output directory
      --apply, --fix         apply patches
      --apply-until-done     apply until transformations do nothing
      --p4-edit              call p4 edit before applying patches
      --debug-me             call debugger on run-tidy
      --verbose              be more verbose.
      --quiet                be quiet.
      --clang-tidy=VALUE     Run clang-tidy transformation(s).
                               Call 'clang-tidy -list-checks -checks="*"' for
                               the full list.
      --early-return         Tranform function' ifs to early return where
                               possible.
                               Only small if statement (less than 4 inner
                               statements) and without any return could be
                               transform.
      --sample               Sample transform
```

## Note

This project is licensed under the terms of the MIT license.


text:
import collections
from xml.sax.xmlreader import AttributesImpl

from ecoxipy import _python2, _unicode
from ecoxipy import _helpers

from ._common import XMLNode, ContainerNode, _string_repr
from ._attributes import NamespaceNameMixin, Attributes
from ._content_nodes import Text

class Element(ContainerNode, NamespaceNameMixin):
    '''\
    Represents a XML element. It inherits from :class:`ContainerNode` and
    :class:`NamespaceNameMixin`.

    :param name: The name of the element to create.
    :type name: Unicode string
    :param children: The children :class:`XMLNode` instances of the element.
    :type children: iterable of items
    :param attributes: Defines the attributes of the element. Must be usable
        as the parameter of :class:`dict` and should contain only Unicode
        strings as key and value definitions.
    :param check_well_formedness: If :const:`True` the element name and
        attribute names will be checked to be a valid XML name.
    :type check_well_formedness: :func:`bool`
    :raises ecoxipy.XMLWellFormednessException: If
        ``check_well_formedness`` is :const:`True` and the
        ``name`` is not a valid XML name.
    '''
    __slots__ = {'_name', '_attributes',  '_namespace_prefix_to_uri',
        '_namespace_targets', '_namespace_prefix_to_target',
        '_check_well_formedness'}
    __slots__.update(NamespaceNameMixin._slots)

    def __init__(self, name, children, attributes,
            check_well_formedness=False):
        if check_well_formedness:
            _helpers.enforce_valid_xml_name(name)
        ContainerNode.__init__(self, children)
        self._name = name
        self._namespace_prefix_to_uri = {}
        self._namespace_targets = {}
        self._namespace_prefix_to_target = {}
        self._attributes = Attributes(self, attributes, check_well_formedness)
        self._check_well_formedness = check_well_formedness

    @staticmethod
    def create(name, *children, **kargs):
        '''\
        Creates an element and converts parameters to appropriate types.

        :param children: The element child nodes. All items that are not
            :class:`XMLNode` instances create :class:`Text` nodes after they
            have been converted to Unicode strings.
        :param kargs: The item ``attributes`` defines the attributes and must
            have a method :meth:`items()` (like :class:`dict`) which returns
            an iterable of 2-:func:`tuple` instances containing the attribute
            name as the first and the attribute value as the second item.
            Attribute names and values are converted to Unicode strings.
        :returns: The created element.
        :rtype: :class:`Element`
        :raises ecoxipy.XMLWellFormednessException: If the ``name`` is not a
             valid XML name.
        '''
        attributes = kargs.get('attributes', {})
        return Element(_unicode(name),
            [
                child if isinstance(child, XMLNode) else Text.create(child)
                for child in children
            ],
            {} if attributes is None else {
                _unicode(attr_name): _unicode(attr_value)
                for attr_name, attr_value in attributes.items()
            }, True)

    def _set_namespace(self, prefix, value):
        self._namespace_prefix_to_uri[prefix] = value

    def _remove_namespace(self, prefix):
        del self._namespace_prefix_to_uri[prefix]
        prefix_targets = self._namespace_prefix_to_target[prefix]
        for target_id in prefix_targets:
            target = self._namespace_targets[target_id]
            target._clear_namespace_uri()

    def _register_namespace_target(self, target):
        prefix = target.namespace_prefix
        target_id = id(target)
        self._namespace_targets[target_id] = target
        try:
            prefix_targets = self._namespace_prefix_to_target[prefix]
        except KeyError:
            prefix_targets = set()
            self._namespace_prefix_to_target[prefix] = prefix_targets
        prefix_targets.add(target_id)

    def _remove_namespace_target(self, target):
        prefix = target.namespace_prefix
        target_id = id(target)
        del self._namespace_targets[target_id]
        prefix_targets = self._namespace_prefix_to_target[prefix]
        prefix_targets.remove(target_id)
        if len(prefix_targets) == 0:
            del self._namespace_prefix_to_target[prefix]

    @property
    def namespace_prefixes(self):
        '''\
        An iterator over all namespace prefixes defined in the element and
        its parents. Duplicate values may be retrieved.
        '''
        def iterator():
            current = self
            while isinstance(current, Element):
                for prefix in current._namespace_prefix_to_uri:
                    yield prefix
                current = current.parent
        return iterator()

    def _get_namespace(self, prefix):
        current = self
        while isinstance(current, Element):
            try:
                return current, current._namespace_prefix_to_uri[prefix]
            except KeyError:
                current = current.parent
        return None, False

    def get_namespace_prefix_element(self, prefix):
        '''\
        Calculates the element the namespace ``prefix`` is defined in, this
        is :const:`None` if the prefix is not defined.
        '''
        return self._get_namespace(prefix)[0]

    def get_namespace_uri(self, prefix):
        '''\
        Calculates the namespace URI for the ``prefix``, this is
        :const:`False` if the prefix is not defined..
        '''
        return self._get_namespace(prefix)[1]

    @property
    def name(self):
        '''\
        The name of the element. On setting the value is converted to an
        Unicode string; a :class:`ecoxipy.XMLWellFormednessException` is
        thrown if it is not a valid XML name and ``check_well_formedness``
        is :const:`True`.
        '''
        return self._name

    @name.setter
    def name(self, name):
        name = _unicode(name)
        if name == self._name:
            return
        if self._check_well_formedness:
            _helpers.enforce_valid_xml_name(name)
        self._name = name
        self._clear_namespace_properties()

    @property
    def attributes(self):
        '''\
        An :class:`Attributes` instance containing the element's attributes.
        '''
        return self._attributes

    def _create_str(self, out):
        return out.element(self.name, self._children_strings(out),
            self._attributes._attribute_value_mapping())

    def _create_sax_events(self, content_handler, indent):
        if indent:
            indent_incr, indent_count = indent
            child_indent = (indent_incr, indent_count + 1)
        else:
            child_indent = indent
        def do_indent(at_start=False):
            if indent:
                if indent_count > 0 or not at_start:
                    content_handler.characters(u'\n')
                for i in range(indent_count):
                    content_handler.characters(indent_incr)
        do_indent(True)
        attributes = AttributesImpl(
            self._attributes.to_dict())
        content_handler.startElement(self.name, attributes)
        last_event_characters = False
        for child in self:
            if isinstance(child, Text):
                if indent and not last_event_characters:
                    do_indent()
                    content_handler.characters(indent_incr)
                child._create_sax_events(content_handler, child_indent)
                last_event_characters = True
            else:
                child._create_sax_events(content_handler, child_indent)
                last_event_characters = False
        if len(self) > 0:
            do_indent()
        content_handler.endElement(self.name)
        if indent and indent_count == 0:
            content_handler.characters(u'\n')

    def __repr__(self):
        return 'ecoxipy.pyxom.Element[{}, {{...}}]'.format(
            _string_repr(self._name))

    def __eq__(self, other):
        if not(isinstance(other, Element)
                and self._name == other._name
                and self._attributes == other._attributes
                and len(self) == len(other)):
            return False
        for i in range(len(self)):
            if self[i] != other[i]:
                return False
        return True

    def __ne__(self, other):
        if (not(isinstance(other, Element))
                or self._name != other._name
                or self._attributes != other._attributes
                or len(self) != len(other)):
            return True
        for i in range(len(self)):
            if self[i] != other[i]:
                return True
        return False

    def __hash__(self):
        return object.__hash__(self)

    @_helpers.inherit_docstring(ContainerNode)
    def duplicate(self):
        return Element(self._name,
            [child.duplicate() for child in self],
            self._attributes.to_dict())

del collections


text:
// ============================================================================
// Copyright (C) 2006-2018 Talend Inc. - www.talend.com
//
// This source code is available under agreement available at
// https://github.com/Talend/data-prep/blob/master/LICENSE
//
// You should have received a copy of the agreement
// along with this program; if not, write to Talend SA
// 9 rue Pages 92150 Suresnes, France
//
// ============================================================================

package org.talend.dataprep.encrypt;

import static org.apache.commons.validator.routines.UrlValidator.*;

import java.nio.file.Files;
import java.nio.file.Path;
import java.nio.file.Paths;
import java.util.Set;
import java.util.function.Function;

import org.apache.commons.configuration2.PropertiesConfiguration;
import org.apache.commons.configuration2.builder.FileBasedConfigurationBuilder;
import org.apache.commons.configuration2.builder.fluent.Parameters;
import org.apache.commons.configuration2.ex.ConfigurationException;
import org.apache.commons.validator.routines.UrlValidator;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;

/**
 *

 * See also the properties file
 *
 * specification.
 *

 *

 * Based on the apache {@link PropertiesConfiguration} for properties parsing and saving. This method tends to modify
 * the properties file layout.
 *

 */
public class PropertiesEncryption {

    private static final Logger LOGGER = LoggerFactory.getLogger(PropertiesEncryption.class);

    /**
     * Reads the specified property file and then encrypts, if not already encrypted, the specified set of properties
     * and overwrites the specified property file.
     *
     * @param input the property file
     * @param mustBeEncrypted the set of properties that must be encrypted
     */
    public void encryptAndSave(String input, Set<String> mustBeEncrypted) {
        modifyAndSave(input, mustBeEncrypted, this::encryptIfNot);
    }

    /**
     * Reads the specified property file and then decrypts, if not already decrypted, the specified set of properties
     * and overwrites the specified property file.
     *
     * @param input the property file path
     * @param mustBeDecrypted the set of properties that must be encrypted
     */
    public void decryptAndSave(String input, Set<String> mustBeDecrypted) {
        modifyAndSave(input, mustBeDecrypted, this::decryptIfNot);
    }

    /**
     * Applies the specified function to the specified set of parameters contained in the input file.
     *
     * @param input The specified name of file to encrypt
     * @param mustBeModified the specified set of parameters
     * @param function the specified function to apply to the set of specified parameters
     */
    private void modifyAndSave(String input, Set<String> mustBeModified, Function<String, String> function) {
        Path inputFilePath = Paths.get(input);
        if (Files.exists(inputFilePath) && Files.isRegularFile(inputFilePath) && Files.isReadable(inputFilePath)) {
            try {
                Parameters params = new Parameters();
                FileBasedConfigurationBuilder<PropertiesConfiguration> builder = //
                        new FileBasedConfigurationBuilder<>(PropertiesConfiguration.class) //
                                .configure(params
                                        .fileBased() //
                                        .setFile(inputFilePath.toFile())); //
                PropertiesConfiguration config = builder.getConfiguration();
                mustBeModified.stream().filter(config::containsKey).forEach(
                        key -> config.setProperty(key, function.apply(config.getString(key))));

                builder.save();
            } catch (ConfigurationException e) {
                LOGGER.error("unable to read {} {}", input, e);
            }
        } else {
            LOGGER.debug("No readable file at {}", input);
        }
    }

    /**
     * Encrypts the specified string if it is not already encrypted and returns the encrypted string.
     *
     * @param input the specified input to be encrypted
     * @return the encrypted string
     */
    private String encryptIfNot(String input) {
        if (isUrl(input)) {
            try {
                return AESEncryption.encryptUriPassword(input);
            } catch (Exception e) {
                LOGGER.debug("Error encrypting value.", e);
                return input;
            }
        } else {
            try {
                AESEncryption.decrypt(input);
                // If no exception is thrown it must be that it was already encrypted.
                return input;
            } catch (Exception e) {
                try {
                    return AESEncryption.encrypt(input);
                } catch (Exception e1) {
                    LOGGER.debug("Error encrypting value.", e1);
                }
            }
        }
        return "";
    }

    /**
     * Decrypts the specified string if it is not already decrypted and returns the decrypted string.
     *
     * @param input the specified input to be decrypted
     * @return the decrypted string
     */
    private String decryptIfNot(String input) {
        if (isUrl(input)) {
            try {
                return AESEncryption.decryptUriPassword(input);
            } catch (Exception e) {
                LOGGER.debug("Error encrypting value.", e);
                return input;
            }
        } else {
            try {
                return AESEncryption.decrypt(input);
            } catch (Exception e) {
                // Property was already decrypted
                LOGGER.debug("Trying to decrypt a non encrypted property.", e);
                return input;
            }
        }
    }

    private static boolean isUrl(String field) {
        UrlValidator urlValidator = new UrlValidator(ALLOW_LOCAL_URLS + ALLOW_ALL_SCHEMES + ALLOW_2_SLASHES);
        return urlValidator.isValid(field);
    }

}