text:
var path = require('path');
var fs = require('fs');
var webpack = require('webpack');
var CommonsChunkPlugin = webpack.optimize.CommonsChunkPlugin;
var nodeModules = {};
fs.readdirSync('node_modules')
  .filter(function(x) {
    return ['.bin'].indexOf(x) === -1;
  })
  .forEach(function(mod) {
    nodeModules[mod] = 'commonjs ' + mod;
  });

module.exports = {
  devtool: 'source-map',
  entry: {
    'angular2': [
      'rxjs',
      'reflect-metadata',
      '@angular/core'
    ],
    'app': './app/main'
  },

  output: {
    path: __dirname + '/build/',
    publicPath: 'build/',
    filename: '[name].js',
    sourceMapFilename: '[name].js.map',
    chunkFilename: '[id].chunk.js'
  },

  resolve: {
    extensions: ['.ts','.js','.json', '.css', '.html']
  },

  module: {
    loaders: [
      {
        test: /\.ts$/,
        loaders: ['awesome-typescript-loader?tsconfig=./tsconfig.json', 'angular2-template-loader'],
        exclude: [ /node_modules/ ]
      },
      {
        test: /\.(html|css)$/,
        loader: 'raw-loader',
        exclude: [ /node_modules/ ]
      },
      {
        test: /\.json$/,
        loader: 'json'
      }
    ]
  },
  externals: [nodeModules],
  plugins: [
    new CommonsChunkPlugin({ name: 'angular2', filename: 'angular2.js', minChunks: Infinity }),
    new CommonsChunkPlugin({ name: 'common',   filename: 'common.js' }),
    new webpack.ExternalsPlugin('commonjs', ['electron']),
    new webpack.ContextReplacementPlugin(
      /angular(\\|\/)core(\\|\/)(esm(\\|\/)src|src)(\\|\/)linker/,
      __dirname
    )

  ],
  target: 'node-webkit'
};


text:
package ggeohash

import "strings"
import "bytes"
import "fmt"

// Static array of 0-9, a-z
var base32_codes [32]byte = [32]byte{}

func init() {
	characters := "0123456789bcdefghjkmnpqrstuvwxyz"

	// Map the bytes to bytes & index positions
	for index, rune := range characters {
		byte_at := byte(rune)
		base32_codes[index] = byte_at
	}
}

//
// Convert the given index to it's byte
// Assumes i is within [0, 32)
//
func ConvertIndexToByte(i int) byte {
	return base32_codes[i]
}

//
// Convert the given byte to an int index
// == -1 --> Failure!
// >= 0  --> Success!
//
func ConvertByteToIndex(b byte) int {
	// NOTE: This should be thread save
	return bytes.IndexByte(base32_codes[:], b)
}

//
// Bounded box for parsing latitude and longitude
//
type DecodedBoundBox struct {
	MinLatitude  float64
	MinLongitude float64

	MaxLatitude  float64
	MaxLongitude float64
}

//
// Decoded Latitude,Longitude + error position
//
type DecodedPosition struct {
	Latitude  float64
	Longitude float64

	LatitudeError  float64
	LongitudeError float64
}

//
// Encode a Latitude and Longitude as a string
//
// Arguments:
//  latitude  float64
//  longitude float64
//  precision uint8  (ie how long should the hash string be?)
//
func Encode(latitude float64, longitude float64, precision uint8) string {
	// Pre-Allocate the hash string
	// var output string = strings.Repeat(" ", int(precision))

	// DecodedBoundBox for the lat/lon + errors
	var bbox DecodedBoundBox = DecodedBoundBox{MaxLatitude: 90, MaxLongitude: 180, MinLatitude: -90, MinLongitude: -180}

	var min_max_avg float64 = 0
	var islon bool = true
	var num_bits uint = 0
	var hash_index int = 0

	var buffer bytes.Buffer
	var output_length uint8 = 0
	for output_length < precision {
		if islon {
			min_max_avg = (bbox.MaxLongitude + bbox.MinLongitude) / 2
			if longitude > min_max_avg {
				hash_index = (hash_index << 1) + 1
				bbox.MinLongitude = min_max_avg
			} else {
				hash_index = (hash_index << 1) + 0
				bbox.MaxLongitude = min_max_avg
			}
		} else {
			min_max_avg = (bbox.MaxLatitude + bbox.MinLatitude) / 2
			if latitude > min_max_avg {
				hash_index = (hash_index << 1) + 1
				bbox.MinLatitude = min_max_avg
			} else {
				hash_index = (hash_index << 1) + 0
				bbox.MaxLatitude = min_max_avg
			}
		}
		islon = !islon

		num_bits++
		if 5 == num_bits {
			buffer.WriteByte(ConvertIndexToByte(hash_index))

			output_length++
			num_bits = 0
			hash_index = 0
		}
	}

	return buffer.String()
}

func DecodeBoundBox(hash_string string) *DecodedBoundBox {
	// Downcase the input string
	hash_string = strings.ToLower(hash_string)

	output := &DecodedBoundBox{MaxLatitude: 90, MaxLongitude: 180, MinLatitude: -90, MinLongitude: -180}

	var islon bool = true

	for i, c := range hash_string {
		byte_at := byte(c)
		index_at := ConvertByteToIndex(byte_at)
		if index_at < 0 {
			msg := fmt.Sprintf("[DecodeBoundBox]  Unknown byte at index=%d, rune='%v' in string='%v'", i, c, hash_string)
			panic(msg)
		}

		index_of := uint8(index_at)
		for bits := 4; bits >= 0; bits-- {
			bit := (index_of >> uint8(bits)) & 1
			if islon {
				mid := (output.MaxLongitude + output.MinLongitude) / 2
				if bit == 1 {
					output.MinLongitude = mid
				} else {
					output.MaxLongitude = mid
				}
			} else {
				mid := (output.MaxLatitude + output.MinLatitude) / 2
				if bit == 1 {
					output.MinLatitude = mid
				} else {
					output.MaxLatitude = mid
				}
			}
			islon = !islon
		}
	}

	return output
}

func Decode(hash_string string) *DecodedPosition {
	bbox := DecodeBoundBox(hash_string)
	output := &DecodedPosition{}
	// Mid point of box
	output.Latitude = (bbox.MinLatitude + bbox.MaxLatitude) / 2
	output.Longitude = (bbox.MinLongitude + bbox.MaxLongitude) / 2
	// Mid Point -  Min/Max ==> Error
	output.LatitudeError = bbox.MaxLatitude - output.Latitude
	output.LongitudeError = bbox.MaxLongitude - output.Longitude

	return output
}

func Neighbor(hash_string string, direction [2]int) string {
	// Adjust the DecodedPosition for the direction of the neighbors
	position := Decode(hash_string)
	precision := uint8(len(hash_string))
	lat := position.Latitude + float64(direction[0])*position.LatitudeError*2
	lon := position.Longitude + float64(direction[1])*position.LongitudeError*2

	return Encode(lat, lon, precision)
}

redpajama_set_name: RedPajamaGithub


text:
import os
import multiprocessing
from distutils.core import setup
from distutils.extension import Extension

import numpy as np

from Cython.Build import cythonize

from distutils.command.sdist import sdist as _sdist

# Read the version number
with open("mtm_stats/_version.py") as f:
    exec(f.read())

extensions = [Extension('mtm_stats.cy_mtm_stats',
                        ['mtm_stats/cy_mtm_stats.pyx',
                         'mtm_stats/mtm_stats_core.c'],
                        include_dirs=['src', np.get_include()],
                        extra_compile_args=['-fPIC','-fopenmp'],
                        extra_link_args=['-fopenmp'])]
nthreads = multiprocessing.cpu_count()

class sdist(_sdist):
    def run(self):
        # Make sure the compiled Cython files in the distribution are up-to-date
        from Cython.Build import cythonize
        cythonize(extensions, nthreads=nthreads)
        _sdist.run(self)

setup(
    name='mtm_stats',
    version=__version__, # use the same version that's in _version.py
    author='David N. Mashburn',
    author_email='david.n.mashburn@gmail.com',
    packages=['mtm_stats'],
    scripts=[],
    license='LICENSE.txt',
    description='Highly efficient set statistics about many-to-many relationships',
    long_description=open('README.md').read(),
    install_requires=['Cpyx>=0.2.2',
                      'numpy>=1.0',
                      'future>=0.16',
                      'cython>=0.2', # this might need to be newer?
                     ],
    extras_require = {
                      'visualize_test':  ["render_d3_fdg>=v0.2.1.6"],
                     },
    ext_modules=cythonize(extensions,
                          nthreads=nthreads),
    cmdclass={'sdist': sdist},
)


text:
class GCMInternalsUI : public content::WebUIController {
 public:
  explicit GCMInternalsUI(content::WebUI* web_ui);
  virtual ~GCMInternalsUI();

 private:
  DISALLOW_COPY_AND_ASSIGN(GCMInternalsUI);
};

#endif  // CHROME_BROWSER_UI_WEBUI_GCM_INTERNALS_UI_H_


text:
<!DOCTYPE html>

    <title>aadm: misc</title>

    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta charset="utf-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">

    <link href="http://aadm.github.io/favicon.png" rel="icon">

    <meta name="author" content="Alessandro Amato del Monte" />
    <meta name="keywords" content="misc" />

        <meta property="og:site_name" content="aadm" />
        <meta property="og:type" content="website"/>
        <meta property="og:title" content="aadm"/>
        <meta property="og:url" content="http://aadm.github.io"/>
        <meta property="og:description" content="aadm"/>

        <link rel="stylesheet" href="http://aadm.github.io/theme/css/bootstrap.journal.min.css" type="text/css"/>
    <link href="http://aadm.github.io/theme/css/font-awesome.min.css" rel="stylesheet">

    <link href="http://aadm.github.io/theme/css/pygments/tango.css" rel="stylesheet">
        <link href="http://aadm.github.io/theme/css/typogrify.css" rel="stylesheet">
    <link rel="stylesheet" href="http://aadm.github.io/theme/css/style.css" type="text/css"/>
        <link href="http://aadm.github.io/static/custom.css" rel="stylesheet">

        <link href="http://aadm.github.io/feeds/all.atom.xml" type="application/atom+xml" rel="alternate"
              title="aadm ATOM Feed"/>

            <button type="button" class="navbar-toggle" data-toggle="collapse" data-target=".navbar-ex1-collapse">
                Toggle navigation

            </button>

aadm

    archives / tags

last iteration

    Date

        <time datetime="2015-11-12T00:00:00+01:00"> 2015-11-12</time>

Tags
	tech

Yes I know, the last post before this one is dated March 2015.

But stuff happened, and I will write another time about our recent move to Norway. This is just a brief post to mark the day that I have finally uploaded to github the latest iteration of my …

                          more ...

black and white

    Date

        <time datetime="2015-03-13T00:00:00+01:00"> 2015-03-13</time>

Tags
	photo
        /
	gear

I have had this Nikon FM2 lying around in my house for some time now. It has not seen much action though.

You see, I started taking photos when I was sixteen or seventeen with a Yashica FX3, and I don't really have any kind of nostalgia for those times when I had to wait days before realizing I missed a certain shot, or that I focused on that insignificant detail behind my subject.

But this Nikon is a lovely piece of metal, so I said to myself, let's put some film in and give it a go. After a few half-assed attempts using expired film, I loaded a roll of Fuji Acros 100 back in September 2014, shot with it on a couple of occasions, and a couple of weeks ago I finally got it developed.

                          more ...

concorso fotografico interno 2013-2014

    Date

        <time datetime="2014-11-28T00:00:00+01:00"> 2014-11-28</time>

Tags
	photo

The only type of competition I have ever enjoyed is two-wheeled racing; I have raced motorbikes and mountain bikes in the past (and I will probably continue to do so once this daddy thing wears off).

In this sort of competition there is no subjectivity; if you go faster than …

                          more ...

bimba che salta

    Date

        <time datetime="2014-11-12T00:00:00+01:00"> 2014-11-12</time>

Tags
	photo

C'era una bimba che saltava sul letto ieri.

                          more ...

ready, set, go!

    Date

        <time datetime="2014-11-05T00:00:00+01:00"> 2014-11-05</time>

Tags
	photo

Parco della Villa Reale di Monza, ottobre 2014.

Queste bimbe di due anni corrono sempre:

                          more ...

genitori secondo cito

    Date

        <time datetime="2014-10-28T00:00:00+01:00"> 2014-10-28</time>

Tags
	photo
        /
	notes

A maggio scorso ho assistito a una presentazione di Francesco Cito, noto fotografo italiano. Tra i vari progetti mostrati c'era anche "Coma", in cui raccontava, attraverso immagini piatte e struggenti, la normalità che circonda dei ragazzi entrati in coma irreversibile.

E la normalità sarebbe quella di parenti e amici …

                          more ...

still finding true gems online

    Date

        <time datetime="2014-10-27T00:00:00+01:00"> 2014-10-27</time>

Tags
	photo
        /
	notes
        /
	quote

Months ago I asked the OTP community about their online reading habits. I mentioned my favourite blogs and briefly discussed my main concern which is: is online reading just a filler, sort of reading your twitter feed when you're bored1?

Anyway, my idea is that yes, books give …

                          more ...

eastern turkey landscapes

    Date

        <time datetime="2014-08-15T00:00:00+02:00"> 2014-08-15</time>

Tags
	photo

This is the second part of my selection of photographs from Eastern Turkey.

The first part features cityscapes and city dwellers and people in general.

This second part is all about landscapes and geology which hopefully would interest even those of you who are not into geology. After all, geology has at its core a certain fascination with the natural beauty you find in nature — but sometimes those who work in the field seem to neglect this simple fact and then geology can become truly boring.

                          more ...

eastern turkey

    Date

        <time datetime="2014-08-13T00:00:00+02:00"> 2014-08-13</time>

Tags
	photo

Last May I went to Eastern Turkey to see some geology. I also had the opportunity to hit the streets of cities that were unknown to me.

I have collected my favourite photographs in two separate posts1. This is part 1, featuring street portraits, cityscapes and other stuff I liked while walking on the streets of Adana, Kahramanmaras and Elazig.

                          more ...

couple of things with my name on

    Date

        <time datetime="2014-06-11T00:00:00+02:00"> 2014-06-11</time>

Tags
	photo
        /
	links

A brief interlude to note down a couple of things.

I follow only one podcast, and that's On Taking Pictures. As the name says, it's about photography, and in one recent Q&A episode they kindly answered a question I have made; what's cool however is their …

                          more ...

«

1

2

3

4

5

6

7

8

9

10

11

12

13

14

15

16

17

18

19

20

21

22

23

24

25

26

27

»

© 2005-2019 Alessandro Amato del Monte

  Creative Commons Attribution 4.0 International License

 TOP


text:
const fs = require('fs');
const path = require('path');

const config = require('./config');
const utils = require('./utils');

const DB_FILE = path.resolve(path.join(__dirname, '..', config.db));
const DB_DIR = path.dirname(DB_FILE);

class DB {
	constructor() {
		this.file = DB_FILE;
		this.settings = {};
		if (fs.existsSync(DB_FILE)) {
			utils.debug(`Loading DB... ${DB_FILE}`);
			try {
				this.settings = require(DB_FILE);
			} catch (err) {
				// Silently ignore :O
			}
		}
	}

	save() {
		if (utils.DRY_RUN) {
			return;
		}
		utils.debug(`Saving DB... ${DB_FILE}`);
		if (!fs.existsSync(DB_DIR)) {
			utils.execSync('mkdir', ['-p', DB_DIR]);
		}
		fs.writeFileSync(DB_FILE, JSON.stringify(this.settings, null, 2), 'utf-8');
	}

	get(key, defaultValue) {
		if (typeof this.settings[key] === 'undefined') {
			this.settings[key] = defaultValue;
		}
		return this.settings[key];
	}

	set(key, value) {
		this.settings[key] = value;
	}
}

module.exports = DB;


text:
const merge = require('webpack-merge');
const Config = require('webpack-chain');
const path = require('path');
const { defaultsDeep } = require('lodash');
const { Command } = require('commander');
const { AsyncSeriesHook } = require('tapable');
const PluginAPI = require('./PluginAPI');

function cloneRuleNames(to, from) {
  if (!to || !from) {
    return;
  }
  from.forEach((r, i) => {
    if (to[i]) {
      Object.defineProperty(to[i], '__ruleNames', {
        // eslint-disable-next-line no-underscore-dangle
        value: r.__ruleNames,
      });
      cloneRuleNames(to[i].oneOf, r.oneOf);
    }
  });
}

module.exports = class Service {
  constructor(context) {
    this.initialized = false;
    this.webpackChainFns = [];
    this.webpackRawConfigFns = [];

    this.hooksBase = Object.freeze({
      pluginsToInitialize: new AsyncSeriesHook(['plugins']),
      pluginsInitialized: new AsyncSeriesHook([]),
      projectOptionsLoaded: new AsyncSeriesHook(['options']),
      configHooksLoaded: new AsyncSeriesHook(['service']),
    });
    this.hooksFromPlugins = {};
    this.hooks = this.hooksBase;

    this.program = new Command('chisel-scripts');
    this.programCommands = {};
    this.context = context || process.env.CHISEL_CONTEXT || process.cwd();
    this.plugins = this.loadPlugins();
  }

  // eslint-disable-next-line class-methods-use-this
  loadPlugins() {
    const idToPlugin = (id) => ({
      id: id.replace(/^.\//, 'built-in:'),
      apply: require(id),
    });

    const builtInPlugins = [
      // './commands/serve',
      './commands/build',
      './commands/inspect',
      // config plugins are order sensitive
      './config/base',
      './config/js',
      './config/css',
      // './config/prod',
    ];

    const plugins = [];

    plugins.push(...builtInPlugins.map(idToPlugin));

    return plugins;
  }

  async initializePlugins() {
    const plugins = [...this.plugins];
    await this.hooks.pluginsToInitialize.promise(plugins);

    for (const { id, apply } of plugins) {
      await apply(new PluginAPI(id, this), this.projectOptions);
    }

    await this.hooks.pluginsInitialized.promise();
  }

  async init() {
    if (this.initialized) return;
    this.initialized = true;

    this.program.version(require('../package.json').version);

    const baseOptions = require('./chisel.config.base.js');
    const userOptions = require(path.resolve(this.context, 'chisel.config.js'));
    let userLocalOptions = {};
    try {
      userLocalOptions = require(path.resolve(
        this.context,
        'chisel.config.local.js',
      ));
    } catch (e) {
      //
    }

    this.projectOptions = defaultsDeep(
      {},
      userLocalOptions,
      userOptions,
      baseOptions,
    );

    await this.hooks.projectOptionsLoaded.promise(this.projectOptions);

    this.initializeProjectOptionsHooks();

    await this.hooks.configHooksLoaded.promise(this);

    if (Array.isArray(userOptions.plugins)) {
      userOptions.plugins.forEach((plugin, index) => {
        if (typeof plugin === 'string') {
          this.plugins.push({ id: plugin, apply: require(plugin) });
        } else if (typeof plugin === 'function') {
          this.plugins.push({
            id: plugin.name || `plugin${index}`,
            apply: plugin,
          });
        }
      });
    }

    await this.initializePlugins();

    // apply webpack configs from project config file
    if (this.projectOptions.chainWebpack) {
      this.webpackChainFns.push(this.projectOptions.chainWebpack);
    }

    if (this.projectOptions.configureWebpack) {
      this.webpackRawConfigFns.push(this.projectOptions.configureWebpack);
    }
  }

  initializeProjectOptionsHooks() {
    const { hooks: optionsHooks } = this.projectOptions;
    if (!optionsHooks) return;

    const subscribe = (hooks, taps) => {
      Object.entries(taps).forEach(([name, tap]) => {
        const hook = hooks[name];

        if (hook instanceof AsyncSeriesHook) {
          hook.tapPromise('ChiselConfig', (...args) =>
            Promise.resolve(tap(...args)),
          );
        } else {
          throw new Error(`Don't know how to tap to ${name} hook`);
        }
      });
    };

    const hooksToSubscribe = Object.fromEntries(
      Object.entries(optionsHooks).filter(
        ([, value]) => typeof value === 'function',
      ),
    );

    const hooksFromPlugins = Object.fromEntries(
      Object.entries(optionsHooks).filter(
        ([, value]) => typeof value === 'object',
      ),
    );

    subscribe(this.hooks, hooksToSubscribe);

    if (Object.keys(hooksFromPlugins).length > 0) {
      this.hooks.pluginsInitialized.tap('Service', () => {
        Object.entries(hooksFromPlugins).forEach(([plugin, taps]) => {
          subscribe(this.hooks[plugin], taps);
        });
      });
    }
  }

  async run(name, args = []) {
    await this.init();

    const commanderArgs = [...(name ? [name] : []), ...args];

    await this.program.parseAsync(commanderArgs, { from: 'user' });
    if (this.program._actionResults) {
      const results = await Promise.all(this.program._actionResults);
      if (results.length === 1) {
        return results[0];
      }

      return results;
    }

    return undefined;
  }

  async resolveChainableWebpackConfig() {
    const chainableConfig = new Config();
    for (const fn of this.webpackChainFns) {
      await fn(chainableConfig);
    }
    return chainableConfig;
  }

  async resolveWebpackConfig(chainableConfig) {
    if (!chainableConfig) {
      chainableConfig = await this.resolveChainableWebpackConfig();
    }

    // get raw config
    let config = chainableConfig.toConfig();
    const original = config;

    if (typeof config.node === 'undefined') {
      config.node = false;
    }

    if (!Array.isArray(config.externals)) {
      config.externals =
        typeof config.externals === 'undefined' ? [] : [config.externals];
    }

    // apply raw config fns
    this.webpackRawConfigFns.forEach((fn) => {
      if (typeof fn === 'function') {
        // function with optional return value
        const res = fn(config);
        if (res) {
          config = merge(config, res);
        }
      } else if (fn) {
        // merge literal values
        config = merge(config, fn);
      }
    });

    // #2206 If config is merged by merge-webpack, it discards the __ruleNames
    // information injected by webpack-chain. Restore the info so that
    // vue inspect works properly.
    if (config !== original) {
      cloneRuleNames(
        config.module && config.module.rules,
        original.module && original.module.rules,
      );
    }
    return config;
  }
};


text:
<?php

    // New layout
    define("con_dbConn", "mysql:host=[host];dbname=[db]");
    define("con_dbUser","[user]");
    define("con_dbPass","[password]");

?>


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/xsd/maven-4.0.0.xsd">
	<modelVersion>4.0.0</modelVersion>

	<groupId>com.sanpower.cloud</groupId>
	<artifactId>socket.http</artifactId>
	<version>0.0.1-SNAPSHOT</version>
	<packaging>jar</packaging>

	<name>socket.http</name>
	<url>http://maven.apache.org</url>

	<properties>
		<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
		<mongoDB-driver.version>2.12.0</mongoDB-driver.version>
		<jackson.databind-version>2.2.3</jackson.databind-version>
		<slf4j.version>1.7.7</slf4j.version>
		<log4j.version>1.2.17</log4j.version>
	</properties>

	<dependencies>
	<dependency>
			<groupId>org.slf4j</groupId>
			<artifactId>slf4j-api</artifactId>
			<version>${slf4j.version}</version>
		</dependency>
		<dependency>
			<groupId>org.slf4j</groupId>
			<artifactId>slf4j-log4j12</artifactId>
			<version>${slf4j.version}</version>
		</dependency>
		<dependency>
			<groupId>log4j</groupId>
			<artifactId>log4j</artifactId>
			<version>${log4j.version}</version>
			<exclusions>
				<exclusion>
					<groupId>javax.mail</groupId>
					<artifactId>mail</artifactId>
				</exclusion>
				<exclusion>
					<groupId>javax.jms</groupId>
					<artifactId>jms</artifactId>
				</exclusion>
				<exclusion>
					<groupId>com.sun.jdmk</groupId>
					<artifactId>jmxtools</artifactId>
				</exclusion>
				<exclusion>
					<groupId>com.sun.jmx</groupId>
					<artifactId>jmxri</artifactId>
				</exclusion>
			</exclusions>
		</dependency>

		<dependency>
			<groupId>org.mongodb</groupId>
			<artifactId>mongo-java-driver</artifactId>
			<version>${mongoDB-driver.version}</version>
		</dependency>
		<!-- Jackson -->
		<dependency>
			<groupId>com.fasterxml.jackson.core</groupId>
			<artifactId>jackson-databind</artifactId>
			<version>${jackson.databind-version}</version>
		</dependency>
	</dependencies>

	<pluginRepositories>
		<pluginRepository>
			<id>onejar-maven-plugin.googlecode.com</id>
			<url>http://onejar-maven-plugin.googlecode.com/svn/mavenrepo</url>
		</pluginRepository>
	</pluginRepositories>
	<build>
		<plugins>
			<plugin>
				<groupId>com.jolira</groupId>
				<artifactId>onejar-maven-plugin</artifactId>
				<version>1.4.4</version>
				<executions>
					<execution>
						<configuration>
							<mainClass>com.sanpower.cloud.socket.Main</mainClass>
							<attachToBuild>true</attachToBuild>
						</configuration>
						<goals>
							<goal>one-jar</goal>
						</goals>
					</execution>
				</executions>
			</plugin>
		</plugins>
	</build>
</project>


text:
<?php

declare(strict_types=1);

namespace Zhiyi\Component\ZhiyiPlus\PlusComponentFeed\Models;

use DB;
use Illuminate\Database\Eloquent\Builder;
use Illuminate\Database\Eloquent\Factories\HasFactory;
use Illuminate\Database\Eloquent\Model;
use Illuminate\Database\Eloquent\Relations\HasOne;
use Zhiyi\Plus\Models\Comment as CommentModel;
use Zhiyi\Plus\Models\User;

class FeedPinned extends Model
{
    use HasFactory;

    public static function boot()
    {
        parent::boot();
        static::addGlobalScope('user', function (Builder $query) {
            $query->with('user');
        });
    }

    /**
     * Has user.
     *
     * @return HasOne
     * @author Seven Du <shiweidu@outlook.com>
     */
    public function user()
    {
        return $this->hasOne(User::class, 'id', 'user_id');
    }

    /**
     *  Has feed.
     *
     * @return HasOne
     * @author Seven Du <shiweidu@outlook.com>
     */
    public function feed()
    {
        return $this->hasOne(Feed::class, 'id', 'target');
    }

    public function commentFeed()
    {
        return $this->hasOne(Feed::class, 'id', 'raw');
    }

    /**
     * Has feed comment.
     *
     * @return HasOne
     * @author Seven Du <shiweidu@outlook.com>
     */
    public function comment()
    {
        return $this->hasOne(CommentModel::class, 'id', 'target');
    }

    public function averages($type = 'feed', $date = '')
    {
        return self::newQuery()
            ->where('channel', 'like', $type)
            ->whereNotNull('expires_at')
            ->where('created_at', '>', $date)
            ->where('amount', '>', 0)
            ->where('day', '>', 0)
            ->first([
                DB::raw('SUM(day) as total_day'),
                DB::raw('SUM(amount) as total_amount'),
            ])
            ->toArray();
    }
}


text:
<?php

namespace Oro\Bundle\ActivityBundle\Form\Type;

use Doctrine\Common\Util\ClassUtils;
use Doctrine\ORM\EntityManager;
use Oro\Bundle\ActivityBundle\Event\PrepareContextTitleEvent;
use Oro\Bundle\ActivityBundle\Form\DataTransformer\ContextsToViewTransformer;
use Oro\Bundle\EntityBundle\Provider\EntityNameResolver;
use Oro\Bundle\EntityConfigBundle\Config\ConfigManager;
use Oro\Bundle\FeatureToggleBundle\Checker\FeatureChecker;
use Oro\Bundle\FormBundle\Form\Type\Select2HiddenType;
use Symfony\Component\EventDispatcher\EventDispatcherInterface;
use Symfony\Component\Form\AbstractType;
use Symfony\Component\Form\FormBuilderInterface;
use Symfony\Component\Form\FormInterface;
use Symfony\Component\Form\FormView;
use Symfony\Component\OptionsResolver\Options;
use Symfony\Component\OptionsResolver\OptionsResolver;
use Symfony\Contracts\Translation\TranslatorInterface;

class ContextsSelectType extends AbstractType
{
    const NAME = 'oro_activity_contexts_select';

    /** @var EntityManager */
    protected $entityManager;

    /** @var ConfigManager */
    protected $configManager;

    /** @var TranslatorInterface */
    protected $translator;

    /** @var EventDispatcherInterface */
    protected $dispatcher;

    /** @var EntityNameResolver */
    protected $entityNameResolver;

    /** @var FeatureChecker */
    protected $featureChecker;

    /**
     * @param EntityManager            $entityManager
     * @param ConfigManager            $configManager
     * @param TranslatorInterface      $translator
     * @param EventDispatcherInterface $dispatcher
     * @param EntityNameResolver       $entityNameResolver
     * @param FeatureChecker           $featureChecker
     */
    public function __construct(
        EntityManager $entityManager,
        ConfigManager $configManager,
        TranslatorInterface $translator,
        EventDispatcherInterface $dispatcher,
        EntityNameResolver $entityNameResolver,
        FeatureChecker $featureChecker
    ) {
        $this->entityManager      = $entityManager;
        $this->configManager      = $configManager;
        $this->translator         = $translator;
        $this->dispatcher         = $dispatcher;
        $this->entityNameResolver = $entityNameResolver;
        $this->featureChecker     = $featureChecker;
    }

    /**
     * {@inheritdoc}
     */
    public function buildForm(FormBuilderInterface $builder, array $options)
    {
        $builder->resetViewTransformers();
        $contextsToViewTransformer = new ContextsToViewTransformer(
            $this->entityManager,
            $options['collectionModel']
        );
        $contextsToViewTransformer->setSeparator($options['configs']['separator']);
        $builder->addViewTransformer($contextsToViewTransformer);
    }

    /**
     * {@inheritdoc}
     */
    public function buildView(FormView $view, FormInterface $form, array $options)
    {
        $view->vars['attr']['data-selected-data'] = $this->getSelectedData($form, $options['configs']['separator']);
    }

    /**
     * @param FormInterface $form
     * @param string $separator
     *
     * @return string
     */
    protected function getSelectedData(FormInterface $form, $separator)
    {
        $targetEntities = $form->getData();
        if (!$targetEntities) {
            return '';
        }

        $result = [];
        foreach ($targetEntities as $target) {
            $targetClass = ClassUtils::getClass($target);

            $title = $this->entityNameResolver->getName($target);
            if ($label = $this->getClassLabel($targetClass)) {
                $title .= ' (' . $label . ')';
            }

            $item['title'] = $title;
            $item['targetId'] = $target->getId();
            $event = new PrepareContextTitleEvent($item, $targetClass);
            $this->dispatcher->dispatch(PrepareContextTitleEvent::EVENT_NAME, $event);
            $item = $event->getItem();

            $result[] = json_encode($this->getResult($item['title'], $target));
        }

        return implode($separator, $result);
    }

    /**
     * @param string $text
     * @param object $object
     *
     * @return array
     */
    protected function getResult($text, $object)
    {
        $entityClass = ClassUtils::getClass($object);

        return [
            'text' => $text,
            'hidden' => !$this->featureChecker->isResourceEnabled($entityClass, 'entities'),
            /**
             * Selected Value Id should additionally encoded because it should be used as string key
             * to compare with value
             */
            'id'   => json_encode(
                [
                    'entityClass' => $entityClass,
                    'entityId'    => $object->getId(),
                ]
            )
        ];
    }

    /**
     * @param string $className - FQCN
     *
     * @return string|null
     */
    protected function getClassLabel($className)
    {
        if (!$this->configManager->hasConfig($className)) {
            return null;
        }

        $label = $this->configManager->getProvider('entity')->getConfig($className)->get('label');

        return $this->translator->trans($label);
    }

    /**
     * {@inheritdoc}
     */
    public function configureOptions(OptionsResolver $resolver)
    {
        $defaultConfigs = [
            'placeholder'        => 'oro.activity.contexts.placeholder',
            'allowClear'         => true,
            'multiple'           => true,
            'separator'          => ContextsToViewTransformer::SEPARATOR,
            'forceSelectedData'  => true,
            'minimumInputLength' => 0,
        ];

        $resolver->setDefaults([
            'tooltip' => false,
            'configs' => $defaultConfigs,
            'collectionModel' => false,
        ]);

        $resolver->setNormalizer(
            'configs',
            function (Options $options, $configs) use ($defaultConfigs) {
                return array_replace_recursive($defaultConfigs, $configs);
            }
        );
    }

    /**
     * {@inheritdoc}
     */
    public function getParent()
    {
        return Select2HiddenType::class;
    }

    /**
     * {@inheritdoc}
     */
    public function getName()
    {
        return $this->getBlockPrefix();
    }

    /**
     * {@inheritdoc}
     */
    public function getBlockPrefix()
    {
        return self::NAME;
    }
}


text:
// Copyright OurReality LLC

#pragma once

#include "AIController.h"
#include "TankAIController.generated.h"

/**
 *
 */

class ATank;

UCLASS()
class BATTLETANK_API ATankAIController : public AAIController
{
	GENERATED_BODY()

public:
	void BeginPlay() override;

	virtual void Tick(float DeltaTime) override;

private:

	ATank* GetAIControlledTank() const;
	ATank* GetPlayerTank() const;

};


text:
using System.Reflection;

[assembly: AssemblyTitle("Waf.NewsReader.UWP")]
[assembly: AssemblyDescription("")]
[assembly: AssemblyConfiguration("")]


text:
function createAndSendDocument() {
  // Create a new Google Doc named 'Hello, world!'
  var doc = DocumentApp.create('Hello, world!');

  // Access the body of the document, then add a paragraph.
  doc.getBody().appendParagraph('This document was created by Google Apps Script.');

  // Get the URL of the document.
  var url = doc.getUrl();

  // Get the email address of the active user - that's you.
  var email = Session.getActiveUser().getEmail();

  // Get the name of the document to use as an email subject line.
  var subject = doc.getName();

  // Append a new string to the "url" variable to use as an email body.
  var body = 'Link to your doc: ' + url;

  // Send yourself an email with a link to the document.
  GmailApp.sendEmail(email, subject, body);
}

// Regression
ScriptApp.getService().getUrl();
CalendarApp.GuestStatus.NO;

// test for URLFetchRequestOptions.payload
import URLFetchRequestOptions = GoogleAppsScript.URL_Fetch.URLFetchRequestOptions;
const postTest = (payload: Object): string => {
  const url = 'http://httpbin.org/post';
  const params: URLFetchRequestOptions = {
    method: 'post',
    payload: payload
  };
  return UrlFetchApp.fetch(url, params).getContentText();
};


text:
package com.pme.exe;

import com.pme.exe.res.ValuesAdd;

import java.io.DataInput;
import java.io.DataOutput;
import java.io.IOException;
import java.io.OutputStreamWriter;

/**
 * @author Sergey Zhulin
 * Date: Mar 30, 2006
 * Time: 4:14:38 PM
 */
public class ExeReader extends Bin.Structure{
  private ArrayOfBins mySectionHeaders;
  private SectionReader[] mySections;
  private PeHeaderReader myPeHeader;
  private ImageOptionalHeader myImageOptionalHeader;
  private Bin.Bytes myBytes;
  private Bin.Bytes myMsDosStub;
  private MsDosHeader myMsDosHeader;

  public ExeReader(String name, ExeFormat exeFormat) {
    super(name);
    myMsDosHeader = new MsDosHeader();
    addMember( myMsDosHeader );
    Bin.Value member = myMsDosHeader.getValueMember("lfanew");
    ValuesAdd size = new ValuesAdd( member, new DWord("").setValue( myMsDosHeader.sizeInBytes() ) );
    myMsDosStub = new Bytes( "MsDos stub program", size );
    addMember( myMsDosStub );
    myPeHeader = new PeHeaderReader(member, exeFormat);
    addMember( myPeHeader );
    if (exeFormat == ExeFormat.UNKNOWN) {
      return;
    }
    myImageOptionalHeader = (ImageOptionalHeader) myPeHeader.getMember("Image Optional Header");
    mySectionHeaders = (ArrayOfBins)myPeHeader.getMember( "ImageSectionHeaders" );
    addSizeHolder( myImageOptionalHeader.getValueMember( "SizeOfImage" ) );  //b164
  }

  public long sizeOfHeaders(){
    return myPeHeader.sizeInBytes() + myMsDosStub.sizeInBytes() + myMsDosHeader.sizeInBytes();
  }

  public long sizeInBytes() {
    long result = 0;
    long va = 0;
    for ( int i = 0; i < mySectionHeaders.size(); ++i){
      ImageSectionHeader header = (ImageSectionHeader)mySectionHeaders.get(i);
      Value virtualAddress = header.getValueMember("VirtualAddress");
      if ( va < virtualAddress.getValue() ){
        result = mySections[i].sizeInBytes() + virtualAddress.getValue();
      }
    }
    long div = result / 0x1000;
    long r = result % 0x1000;
    if ( r != 0 ){
      div++;
    }
    result = div * 0x1000;
    return result;
  }

  public SectionReader[] getSections(){
    return mySections;
  }
  public ArrayOfBins getSectionHeaders(){
    return mySectionHeaders;
  }

  public SectionReader getSectionReader( String sectionName ){
    for (SectionReader section : mySections) {
      if (sectionName.equals(section.getSectionName())) {
        return section;
      }
    }
    return null;
  }

  public void read(DataInput stream) throws IOException {
    super.read(stream);
    if (mySectionHeaders == null) {
      return;
    }

    long filePointer = getOffset() + sizeOfHeaders();

    Bin.Value mainSectionsOffset;
    mySections = new SectionReader[mySectionHeaders.size()];
    for ( int i = 0; i < mySectionHeaders.size(); ++i ){
      ImageSectionHeader sectionHeader = (ImageSectionHeader)mySectionHeaders.get(i);
      Bin.Value startOffset = sectionHeader.getValueMember( "PointerToRawData" );
      Bin.Value rva = sectionHeader.getValueMember( "VirtualAddress" );

      if ( i == 0 ){
        long size = startOffset.getValue() - filePointer;
        if ( myBytes == null ){
          myBytes = new Bytes( "Aligment", size );
          addMemberToMapOnly( myBytes );
        } else {
          myBytes = (Bytes)getMember( "Aligment" );
          myBytes.reset( (int)filePointer, (int)size );
        }
        myBytes.read( stream );
      }

      mainSectionsOffset = new ValuesAdd( rva, startOffset );
      mySections[i] = new SectionReader( sectionHeader, startOffset, mainSectionsOffset, myImageOptionalHeader );
      mySections[i].read( stream );
    }
    resetOffsets( 0 );
  }

  public void resetOffsets(long newOffset) {
    super.resetOffsets(newOffset);
    long mainOffset = myPeHeader.getOffset() + myPeHeader.sizeInBytes() + myBytes.sizeInBytes();
    long offset = 0;
    for (SectionReader section : mySections) {
      section.resetOffsets(mainOffset + offset);
      offset += section.sizeInBytes();
    }
  }

  /**
   * Required for cases when sections change their size due to editing: the overlapping sections should be fixed
   * afterwards.
   */
  public void sectionVirtualAddressFixup() {
    long virtualAddress = ((ImageSectionHeader)mySectionHeaders.get(0)).getValueMember("VirtualAddress").getValue();

    for (Bin sectionHeader : mySectionHeaders.getArray()) {
      Value virtualAddressMember = ((ImageSectionHeader)sectionHeader).getValueMember("VirtualAddress");

      // Section always starts from an address divisible by 0x1000
      if (virtualAddress % 0x1000 != 0)
        virtualAddress += 0x1000 - virtualAddress % 0x1000;

      virtualAddressMember.setValue(virtualAddress);
      virtualAddress += ((ImageSectionHeader)sectionHeader).getValueMember("VirtualSize").getValue();
    }

    // The binary size has been changed as the result, update it in the size holders:
    updateSizeOffsetHolders();
  }

  public void write(DataOutput stream) throws IOException {
    super.write(stream);
    myBytes.write(stream);
    for (SectionReader section : mySections) {
      section.write(stream);
    }
  }

  public void report(OutputStreamWriter writer) throws IOException {
    super.report(writer);
    myBytes.report( writer );
    mySectionHeaders.report(writer);
    for (SectionReader section : mySections) {
      section.report(writer);
    }
  }

  public ExeFormat getExeFormat() {
    long machine = myPeHeader.getImageFileHeader().getMachine();
    if (machine == 0x14c) {
      return ExeFormat.X86;
    }
    if (machine == 0x8664) {
      return ExeFormat.X64;
    }
    throw new UnsupportedOperationException("Unsupported machine code " + machine);
  }
}


text:
'use strict';

var requireFromString = require('require-from-string');
var readFile = require('./readFile');

module.exports = function (filepath) {
  return readFile(filepath).then(function (content) {
    if (!content) return null;

    return {
      config: requireFromString(content, filepath),
      filepath: filepath,
    };
  });
};


text:
module Octobat
  class Subscription < APIResource
    extend Octobat::APIOperations::List
    include Octobat::APIOperations::Create

    def usage_items(params = {}, opts = {})
      UsageItem.list(params.merge({ subscription: id }), { api_key: @api_key }.merge(opts))
    end

  end

end


text:
import { Observable } from 'rxjs';
import { BaseModel } from '../models';

export interface Action<M extends BaseModel> {
  name: string;
  icon?: string;
  hidden?(model: M): boolean;
  canActivate?(model: M): boolean;
  activate?(model: M, ...rest: any[]): Observable<any>;
}


text:
rm -f ../markdown
php create-phar.php
mv ../markdown.phar ../markdown
chmod a+x ../markdown


text:
import BooleanColumn, { cellType, booleanColumnConfiguration } from './BooleanColumn.component';

export { cellType, BooleanColumn };
export default booleanColumnConfiguration;


text: CKEDITOR.plugins.setLang("save","nl",{toolbar:"Opslaan"});


text:
package org.elasticsearch.cluster.routing;

import java.util.Set;

import static org.elasticsearch.cluster.routing.UnassignedInfoTests.randomUnassignedInfo;
import static org.elasticsearch.test.ESTestCase.randomAlphaOfLength;
import static org.elasticsearch.test.ESTestCase.randomFrom;
import static org.elasticsearch.test.ESTestCase.randomInt;

/**
 * Utility class the makes random modifications to ShardRouting
 */
public final class RandomShardRoutingMutator {
    private RandomShardRoutingMutator() {

    }

    public static ShardRouting randomChange(ShardRouting shardRouting, Set<String> nodes) {
        switch (randomInt(2)) {
            case 0:
                if (shardRouting.unassigned() == false && shardRouting.primary() == false) {
                    shardRouting = shardRouting.moveToUnassigned(randomUnassignedInfo(randomAlphaOfLength(10), false));
                } else if (shardRouting.unassignedInfo() != null) {
                    shardRouting = shardRouting.updateUnassigned(
                        randomUnassignedInfo(randomAlphaOfLength(10), false),
                        shardRouting.recoverySource()
                    );
                }
                break;
            case 1:
                if (shardRouting.unassigned() && nodes.isEmpty() == false) {
                    shardRouting = shardRouting.initialize(randomFrom(nodes), null, -1);
                }
                break;
            case 2:
                if (shardRouting.initializing()) {
                    shardRouting = shardRouting.moveToStarted();
                }
                break;
        }
        return shardRouting;
    }
}


text:
#include <aws/cloudformation/model/StackSetOperationAction.h>
#include <aws/core/utils/HashingUtils.h>
#include <aws/core/Globals.h>
#include <aws/core/utils/EnumParseOverflowContainer.h>

using namespace Aws::Utils;

namespace Aws
{
  namespace CloudFormation
  {
    namespace Model
    {
      namespace StackSetOperationActionMapper
      {

        static const int CREATE_HASH = HashingUtils::HashString("CREATE");
        static const int UPDATE_HASH = HashingUtils::HashString("UPDATE");
        static const int DELETE__HASH = HashingUtils::HashString("DELETE");
        static const int DETECT_DRIFT_HASH = HashingUtils::HashString("DETECT_DRIFT");

        StackSetOperationAction GetStackSetOperationActionForName(const Aws::String& name)
        {
          int hashCode = HashingUtils::HashString(name.c_str());
          if (hashCode == CREATE_HASH)
          {
            return StackSetOperationAction::CREATE;
          }
          else if (hashCode == UPDATE_HASH)
          {
            return StackSetOperationAction::UPDATE;
          }
          else if (hashCode == DELETE__HASH)
          {
            return StackSetOperationAction::DELETE_;
          }
          else if (hashCode == DETECT_DRIFT_HASH)
          {
            return StackSetOperationAction::DETECT_DRIFT;
          }
          EnumParseOverflowContainer* overflowContainer = Aws::GetEnumOverflowContainer();
          if(overflowContainer)
          {
            overflowContainer->StoreOverflow(hashCode, name);
            return static_cast<StackSetOperationAction>(hashCode);
          }

          return StackSetOperationAction::NOT_SET;
        }

        Aws::String GetNameForStackSetOperationAction(StackSetOperationAction enumValue)
        {
          switch(enumValue)
          {
          case StackSetOperationAction::CREATE:
            return "CREATE";
          case StackSetOperationAction::UPDATE:
            return "UPDATE";
          case StackSetOperationAction::DELETE_:
            return "DELETE";
          case StackSetOperationAction::DETECT_DRIFT:
            return "DETECT_DRIFT";
          default:
            EnumParseOverflowContainer* overflowContainer = Aws::GetEnumOverflowContainer();
            if(overflowContainer)
            {
              return overflowContainer->RetrieveOverflow(static_cast<int>(enumValue));
            }

            return {};
          }
        }

      } // namespace StackSetOperationActionMapper
    } // namespace Model
  } // namespace CloudFormation
} // namespace Aws


text:
class DecisionTree;

class EnemiesInRange : public Decision {

	//Methods
	//===================================================
	float _aggressionModifier;	//Modifier of the aggression, when comparing accuracies to targets to see if they are acceptable range

	//Methods
	//===================================================
public:
	EnemiesInRange::EnemiesInRange(DecisionTree * tree, float aggressionModifier);
	Action* run();
};

#endif


text:
require 'spec_helper'

RSpec.describe 'Command Matchers' do
  include_context 'uses aruba API'

  def expand_path(*args)
    @aruba.expand_path(*args)
  end

  def announcer(*args)
    @aruba.send(:announcer, *args)
  end

  describe '#to_have_exit_status' do
    let(:cmd) { 'true' }

    before { run_command(cmd) }

    context 'when has exit 0' do
      it { expect(last_command_started).to have_exit_status 0 }
    end

    context 'when does not have exit 0' do
      let(:cmd) { 'false' }

      it { expect(last_command_started).not_to have_exit_status 0 }
    end
  end

  describe '#to_be_successfully_executed_' do
    let(:cmd) { 'true' }

    before { run_command(cmd) }

    context 'when has exit 0' do
      it { expect(last_command_started).to be_successfully_executed }
    end

    context 'when does not have exit 0' do
      let(:cmd) { 'false' }

      it { expect(last_command_started).not_to be_successfully_executed }
    end
  end

  describe '#to_have_output' do
    let(:cmd) { "echo #{output}" }
    let(:output) { 'hello world' }

    context 'when have output hello world on stdout' do
      before { run_command(cmd) }

      it { expect(last_command_started).to have_output output }
    end

    context 'when multiple commands output hello world on stdout' do
      context 'and all comands must have the output' do
        before do
          run_command(cmd)
          run_command(cmd)
        end

        it { expect(all_commands).to all have_output output }
      end

      context 'and any comand can have the output' do
        before do
          run_command(cmd)
          run_command('echo hello universe')
        end

        it { expect(all_commands).to include have_output(output) }
      end
    end

    context 'when have output hello world on stderr' do
      let(:cmd) { "ruby -e 'warn \"#{output}\"'" }

      before { run_command(cmd) }

      it { expect(last_command_started).to have_output output }
    end

    context 'when not has output' do
      before { run_command(cmd) }

      it { expect(last_command_started).not_to have_output 'hello universe' }
    end
  end

  describe '#to_have_output_on_stdout' do
    let(:cmd) { "echo #{output}" }
    let(:output) { 'hello world' }

    context 'when have output hello world on stdout' do
      before { run_command(cmd) }

      it { expect(last_command_started).to have_output_on_stdout output }
    end

    context 'when have output hello world on stderr' do
      let(:cmd) { "ruby -e 'warn \"#{output}\"'" }

      before { run_command(cmd) }

      it { expect(last_command_started).not_to have_output_on_stdout output }
    end

    context 'when not has output' do
      before { run_command(cmd) }

      it { expect(last_command_started).not_to have_output_on_stdout 'hello universe' }
    end
  end

  describe '#to_have_output_on_stderr' do
    let(:cmd) { "echo #{output}" }
    let(:output) { 'hello world' }

    context 'when have output hello world on stdout' do
      before { run_command(cmd) }

      it { expect(last_command_started).not_to have_output_on_stderr output }
    end

    context 'when have output hello world on stderr' do
      let(:cmd) { "ruby -e 'warn \"#{output}\"'" }

      before { run_command(cmd) }

      it { expect(last_command_started).to have_output_on_stderr output }
    end

    context 'when not has output' do
      before { run_command(cmd) }

      it { expect(last_command_started).not_to have_output_on_stderr 'hello universe' }
    end
  end
end


text:
using System;
using Moq;
using Orleans.Core;
using Orleans.Runtime;
using Orleans.Streams;
using Orleans.TestKit.Loggers;
using Orleans.TestKit.Storage;
using Orleans.Timers;

namespace Orleans.TestKit
{
    internal class TestGrainRuntime : IGrainRuntime
    {
        private readonly TestLogManager _logManager = new TestLogManager();

        public readonly Mock<IGrainRuntime> Mock = new Mock<IGrainRuntime>();

        private readonly StorageManager _storageManager;

        public Guid ServiceId { get; } = Guid.NewGuid();

        public string SiloIdentity { get; } = "TestSilo";

        public IGrainFactory GrainFactory { get; }

        public ITimerRegistry TimerRegistry { get; }

        public IReminderRegistry ReminderRegistry { get; }

        public IServiceProvider ServiceProvider { get; }

        public SiloAddress SiloAddress { get { return SiloAddress.Zero; } }

        public TestGrainRuntime(IGrainFactory grainFactory,
            ITimerRegistry timerRegistry,
            IReminderRegistry reminderRegistry,
            IServiceProvider serviceProvider,
            StorageManager storageManager)
        {
            GrainFactory = grainFactory;
            TimerRegistry = timerRegistry;
            ReminderRegistry = reminderRegistry;
            ServiceProvider = serviceProvider;
            _storageManager = storageManager;
        }

        public Orleans.Runtime.Logger GetLogger(string loggerName) => _logManager.GetLogger(loggerName);

        public void DeactivateOnIdle(Grain grain)
        {
            Mock.Object.DeactivateOnIdle(grain);
        }

        public void DelayDeactivation(Grain grain, TimeSpan timeSpan)
        {
            Mock.Object.DelayDeactivation(grain, timeSpan);
        }

        public IStorage<TGrainState> GetStorage<TGrainState>(Grain grain) where TGrainState : new() =>
            _storageManager.GetStorage<TGrainState>();
    }
}


text:
package jsky.app.ot.tpe;

import edu.gemini.shared.skyobject.SkyObject;
import edu.gemini.shared.util.immutable.None;
import edu.gemini.shared.util.immutable.Option;
import jsky.coords.WorldCoords;

import java.awt.event.MouseEvent;

/**
 * A mouse event that occurred in the TpeImageWidget widget.  This structure
 * contains fields that describe the type of mouse event, and the location
 * relative to the image being viewed by the image widget.
 * The x and y fields are stored as doubles since the image may be scaled.
 * The ra and dec where the event occurred and the x and y offset in arcsec
 * from the base position are also stored here.
 */
public class TpeMouseEvent {

    /** The original mouse event  */
    public MouseEvent mouseEvent;

    /** Event id, same as java.awt.Event.  */
    public int id;

    /** Event source.  */
    public TpeImageWidget source;

    /** X pos of event relative to the real image being viewed.  */
    public double xView;

    /** Y pos of event relative to the real image being viewed.  */
    public double yView;

    /** X pos of event relative to the widget.  */
    public int xWidget;

    /** Y pos of event relative to the widget.  */
    public int yWidget;

    /** The world coordinate position */
    public WorldCoords pos;

    /** Optional object name or id */
    public String name;

    // Optional details of the object.
    private Option<SkyObject> skyObject = None.instance();

    /** The X offset of the event from the base position in arcsec. */
    public double xOffset;

    /** The Y offset of the event from the base position in arcsec. */
    public double yOffset;

    /** Default Constructor: initialize all fields to null. */
    public TpeMouseEvent(MouseEvent e) {
        mouseEvent = e;
    }

    public Option<SkyObject> getSkyObject() {
        return skyObject;
    }

    public void setSkyObject(Option<SkyObject> skyObject) {
        if (skyObject == null) throw new IllegalArgumentException();
        this.skyObject = skyObject;
    }

    /**
     * Returns a human-readable string describing the contents of
     * the event.
     */
    public String toString() {
        String event = "<unknown: " + id + ">";
        switch (id) {
            case MouseEvent.MOUSE_PRESSED:
                event = "MOUSE_PRESSED";
                break;
            case MouseEvent.MOUSE_RELEASED:
                event = "MOUSE_RELEASED";
                break;
            case MouseEvent.MOUSE_MOVED:
                event = "MOUSE_MOVED";
                break;
            case MouseEvent.MOUSE_DRAGGED:
                event = "MOUSE_DRAGGED";
                break;
        }
        return "TpeMouseEvent[id=" + event
                + ", xView=" + xView
                + ", yView=" + yView
                + ", xWidget=" + xWidget
                + ", yWidget=" + yWidget
                + ", pos=" + pos
                + ", name=" + (name != null ? name : "<null>")
                + ", xOffset=" + xOffset
                + ", yOffset=" + yOffset + "]";
    }
}


text:
import { combineReducers } from 'redux';
import { routerReducer as reduxRouterReducer } from 'react-router-redux';

import logSlowReducers from 'redux-log-slow-reducers';
import { persistReducerState, retrieveReducerState } from './common/util/ReducerUtilities';

import modulesReducers from './modules/ModulesReducers';
import routesReducers from './routes/RoutesReducers';
import { requestsPersistedRequestReducer } from './routes/requests/RequestsReducers';
import { themesPersistedReducer } from './shell/themes/ThemesReducer';
import { smileyFeedbackReducer } from './shell/feedback/SmileyFeedbackReducer';
import { debugSessionReducer } from './shell/debug/DebugReducer';

const stateKey = 'GlimpseAppState';

export const sessionReducer = combineReducers({
    ...modulesReducers,
    debug: debugSessionReducer,
    routing: reduxRouterReducer
});

export const persistedReducer = combineReducers({
    global: combineReducers({
        ...routesReducers,
        themes: themesPersistedReducer,
        smileyFeedback: smileyFeedbackReducer
    }),
    requests: requestsPersistedRequestReducer
});

export function buildReducers() {
    let rawReducers = {
        session: sessionReducer,
        persisted: persistReducerState(persistedReducer, stateKey)
    };

    if (DEBUG) {
        // log out slow reducers
        rawReducers = logSlowReducers(rawReducers);
    }

    return combineReducers(rawReducers);
}

export function buildInitialState() {
    return {
        session: undefined,
        persisted: retrieveReducerState(stateKey)
    };
}

// WEBPACK FOOTER //
// ./src/client/Reducers.ts


text:
<!DOCTYPE html>

  <meta charset="utf-8">
  <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
  <link href="../images/favicon.png" rel="shortcut icon" type="image/png">
  <title>DJI Mobile SDK Documentation
  </title><link rel="stylesheet" href="../stylesheets/doc-vendor.css"><link rel="stylesheet" href="../stylesheets/doc-app.css">

Developer

Mobile SDK

UX SDK

Onboard SDK

Payload SDK

Windows SDK

Login

Register

User Center

Logout

Mobile SDK

      OverviewDocumentationAPI Reference

IOS SDK

Android SDK

IOS UX SDK

Android UX SDK

DownloadsSupport

                <input id="search" type="text" placeholder="Search" autosave="searchdoc" results="10" autocomplete="off">

Widget

FocusExposureSwitchWidget

MapWidget

OnMapReadyListener

DJIMap

OnCameraChangeListener

OnMapTypeLoadedListener

DJICircle

DJICircleOptions

DJIMarker

DJIMarkerOptions

DJIPolygon

DJIPolygonOptions

DJIPolyline

DJIPolylineOptions

DJICameraPosition

DJICameraUpdateFactory

DJIBitmapDescriptorFactory

DJILatLng

DJILatLngBounds

DJIMapViewInternal

DJIMapView

OnDJIMapReadyCallback

MapProvider

Mapkit

DJIUiSettings

WiFiSignalWidget

RadarWidget

HistogramWidget

AutoExposureLockWidget

PreFlightStatusWidget

ConnectionWidget

FlightModeWidget

BatteryWidget

RemoteControlSignalWidget

GPSSignalWidget

VideoSignalWidget

VisionWidget

DashboardWidget

CompassWidget

DistanceHomeWidget

HorizontalVelocityWidget

DistanceRCWidget

VerticalVelocityWidget

AltitudeWidget

CameraControlsWidget

PictureVideoSwitch

CameraCaptureWidget

ExposureSettingsMenu

RemainingFlightTimeWidget

ColorWaveformWidget

FPVWidget

FPVOverlayWidget

TakeOffWidget

ReturnHomeWidget

FocusModeWidget

ManualFocusWidget

CameraConfigShutterWidget

CameraConfigApertureWidget

CameraConfigISOAndEIWidget

CameraConfigWBWidget

CameraConfigStorageWidget

CameraConfigSSDWidget

CameraConfigEVWidget

CompassCalibratingWorkFlow

Widgets

SpeakerWidget

BeaconWidget

SpotlightWidget

Default Layout

SpeakerPanel

AccessLockerWidget

SpotlightPanel

Panel

PreFlightCheckListPanel

CameraSettingAdvancedPanel

CameraSettingExposurePanel

RTKStatusPanel

class FPVOverlayWidget

class FPVOverlayWidget extends FrameLayoutWidget implements View.OnTouchListener

Package:	dji.ux.widget

Inherits From:	FrameLayoutWidget implements View.OnTouchListener

Display:

Single tap will show the selected target on top of the FPVWidget.
Has two modes with two different icons.

Focus mode will have a green square icon.

Meter mode will have a yellow circle icon.

Press and hold will show the gimbal control.

Small white dot will stay at where user first taps the screen to indicate the anchor point.

Blue circle will follow user's drag. Together with the anchor point, this dictates the gimbal movement.

When grid mode is turned on (using the CameraSettingAdvancedPanel), this also shows the grid lines. When center  point is turned on  (using the CameraSettingAdvancedPanel), this also shows the center point.

Interaction:

Tapping in focus mode will select that point as focus target point. Tapping in meter mode will select that point as exposure meter target point.

Press and hold will activate gimbal control mode. Dragging gimbal control will move the gimbal accordingly.

Usage:

Should be the same size and placed on top of FPVOverlayWidget.

Class Members:

Value

method

setSpotMeteringEnabled

<div class="inline-doc" id="fpvoverlaywidget_setspotmeteringenabled_inline"

method setSpotMeteringEnabled

void setSpotMeteringEnabled(boolean isSpotMeteringEnabled)

Package:	dji.ux.widget

Description:

Enable or disable spot metering by this method.  Enabled by default.

Input Parameters:

boolean isSpotMeteringEnabled	true to enable, false to disable.

method

isSpotMeteringEnabled

<div class="inline-doc" id="fpvoverlaywidget_isspotmeteringenabled_inline"

method isSpotMeteringEnabled

boolean isSpotMeteringEnabled()

Package:	dji.ux.widget

Description:

Method to check if spot metering using touch is enabled.

Return:

boolean	true if enabled, false if disabled.

method

setGimbalControlEnabled

<div class="inline-doc" id="fpvoverlaywidget_setgimbalcontrolenabled_inline"

method setGimbalControlEnabled

void setGimbalControlEnabled(boolean isGimbalControlEnabled)

Package:	dji.ux.widget

Description:

Enable or disable gimbal control by this method. Enabled by default.

Input Parameters:

boolean isGimbalControlEnabled	true to enable, false to disable.

method

isGimbalControlEnabled

<div class="inline-doc" id="fpvoverlaywidget_isgimbalcontrolenabled_inline"

method isGimbalControlEnabled

boolean isGimbalControlEnabled()

Package:	dji.ux.widget

Description:

Method to check if gimbal control using touch is enabled.

Return:

boolean	true if enabled, false if disabled.

method

setTouchFocusEnabled

<div class="inline-doc" id="fpvoverlaywidget_settouchfocusenabled_inline"

method setTouchFocusEnabled

void setTouchFocusEnabled(boolean isTouhFocusEnabled)

Package:	dji.ux.widget

Description:

Enable or disable Touch to Focus by this method.  Enabled by default.

Input Parameters:

boolean isTouhFocusEnabled	true to enable, false to disable.

method

isTouchFocusEnabled

<div class="inline-doc" id="fpvoverlaywidget_istouchfocusenabled_inline"

method isTouchFocusEnabled

boolean isTouchFocusEnabled()

Package:	dji.ux.widget

Description:

Method to check if Touch to Focus is enabled.

Return:

boolean	true if enabled, false if disabled.

method

setGridOverlayEnabled

<div class="inline-doc" id="fpvoverlaywidget_setgridoverlayvisibility_inline"

method setGridOverlayEnabled

void setGridOverlayEnabled(boolean isGridOverlayEnabled)

Package:	dji.ux.widget

Description:

Defaults to true. If true, FPVOverlayWidget will display grid setting if prompted by the user via the CameraGridListWidget. Setting this to false means the grid will never be displayed.

Input Parameters:

boolean isGridOverlayEnabled	true to enable, false to disable.

method

isGridOverlayEnabled

<div class="inline-doc" id="fpvoverlaywidget_isgridoverlayenabled_inline"

method isGridOverlayEnabled

boolean isGridOverlayEnabled()

Package:	dji.ux.widget

Description:

If true, FPVOverlayWidget will display grid setting if prompted by the user via the CameraGridListWidget. If false, the grid will never be displayed.

Return:

boolean	true to enable, false to disable.

method

setCurrentGridOverlayType

<div class="inline-doc" id="fpvoverlaywidget_setcurrentgridoverlaytype_inline"

method setCurrentGridOverlayType

void setCurrentGridOverlayType(GridOverlayType type)

Package:	dji.ux.widget

Description:

Sets the type of the grid overlay.

Input Parameters:

GridOverlayType type	The grid overlay type.

method

getCurrentGridOverlayType

<div class="inline-doc" id="fpvoverlaywidget_getcurrentgridoverlaytype_inline"

method getCurrentGridOverlayType

GridOverlayType getCurrentGridOverlayType()

Package:	dji.ux.widget

Description:

Gets the current type of the grid overlay.

Return:

GridOverlayType	The current grid overlay type.

enum

GridOverlayType

<div class="inline-doc" id="fpvoverlaywidget_gridoverlaytype_inline"

enum GridOverlayType

enum GridOverlayType

Package:	dji.ux.widget

Description:

Represents the types of grid lines that can be set to be on top of the FPV.

Enum Members:

NONE	No grid lines are visible.

PARALLEL	Horizontal and vertical grid lines are visible using a 3x3 grid.

PARALLEL_DIAGONAL	Same as FPVOverlayWidget_GridOverlayType_PARALLEL with the addition of 2 diagonal lines running through the center.

UNKNOWN	The type of grid is unknown.

Class Members:

×

Search Mobile SDK Document

            <input type="text" v-model="searchInput" @keydown.enter="search">

{{searchCount}} Results

{{{(item.highlights && item.highlights.title) || item.title}}}

{{{(item.highlights && item.highlights.content[0]) || item.title}}}

Load More

Loading...

Not Found

        SDKMobile SDKUX SDKOnboard SDKPayload SDKWindows SDK
        InfoProducts
        CommunityStack OverflowYouTubeTwitter
        Contact Us dev@dji.com
        Business Cooperation dev@dji.com
        BILLING billing-dev@dji.com

Copyright © 2019 DJI All Rights ReservedPrivacy PolicyTerms of Use


text:
//
//  UniversalMethod.m
//  DazzleColourFonts
//
//  Created by 王颜龙 on 13-9-17.
//  Copyright (c) 2013年 longyan. All rights reserved.
//

#import "UniversalMethod.h"

@implementation UniversalMethod

#pragma mark - btn的返回按钮

/**
 模态视图的时候返回通用的返回按钮
 @param Target : target
 @param sel    : 事件
 @returns      : 返回按钮
 */
+ (UIButton *)backBtnAddTarget:(id)Target action:(SEL)sel
{

    UIButton *backBtn = [UIButton buttonWithType:UIButtonTypeCustom];
    backBtn.frame = CGRectMake(4, -1, 65, 45);
    [backBtn setBackgroundImage:[UIImage imageNamed:@"backN"] forState:UIControlStateNormal];
    [backBtn setBackgroundImage:[UIImage imageNamed:@"backS"] forState:UIControlStateSelected];
    [backBtn addTarget:Target action:sel forControlEvents:UIControlEventTouchUpInside];
    UILabel *Label = [[UILabel alloc]initWithFrame:backBtn.frame];

    if ([kLanguage isEqualToString:@"en"]) {
        Label.text = @"Back";
    }else{
        Label.text = @"返回";
    }

    Label.textAlignment = NSTextAlignmentCenter;
    Label.textColor = [UIColor whiteColor];
    Label.backgroundColor = [UIColor clearColor];
    Label.font = [UIFont fontWithName:@"Helvetica-Bold" size:16];
    [backBtn addSubview:Label];

    return backBtn;
}

#pragma mark - 开机闪屏动画效果
/**
 开机闪屏动画效果
 @param window : 设备window
 */
+ (void)showDefault:(UIWindow*)window
{
    //渐变效果
    UIImageView *splashScreen = [[UIImageView alloc] initWithFrame:window.bounds] ;
    if (iPhone5) {
        splashScreen.image = [UIImage imageNamed:@"Default-568h"];
    }else{
        splashScreen.image = [UIImage imageNamed:@"Default"];
    }

    [window addSubview:splashScreen];

    [UIView animateWithDuration:2.0 animations:^{
        CATransform3D transform = CATransform3DMakeScale(1.5, 1.5, 1.0);
        splashScreen.layer.transform = transform;
        splashScreen.alpha = 0.0;
    } completion:^(BOOL finished) {
        [splashScreen removeFromSuperview];
    }];

}

#pragma mark - 返回nav上的返回按钮
/**
 返回nav上的返回按钮
 @param Target : target
 @param sel    : 返回事件
 @returns      : 返回按钮
 */
+ (UIBarButtonItem *)backItemAddTarget:(id)Target action:(SEL)sel
{

    UIButton *backBtn = [UIButton buttonWithType:UIButtonTypeCustom];
    backBtn.frame = CGRectMake(4, -1, 65, 45);
    [backBtn setBackgroundImage:[UIImage imageNamed:@"backN"] forState:UIControlStateNormal];
    [backBtn setBackgroundImage:[UIImage imageNamed:@"backS"] forState:UIControlStateSelected];
    [backBtn addTarget:Target action:sel forControlEvents:UIControlEventTouchUpInside];
    UILabel *Label = [[UILabel alloc]initWithFrame:backBtn.frame];

    if ([kLanguage isEqualToString:@"en"]) {
        Label.text = @"Back";
    }else{
        Label.text = @"返回";
    }

    Label.textAlignment = NSTextAlignmentCenter;
    Label.textColor = [UIColor whiteColor];
    Label.backgroundColor = [UIColor clearColor];
    Label.font = [UIFont fontWithName:@"Helvetica-Bold" size:16];
    [backBtn addSubview:Label];

    UIBarButtonItem *backItem = [[UIBarButtonItem alloc]initWithCustomView:backBtn];

    return backItem;
}

#pragma mark - 返回Documents目录路径
/**
 返回Documents目录路径
 @returns Documents目录路径
 */
+ (NSString *)backDocumentDirectoryPath
{
    NSArray *paths = NSSearchPathForDirectoriesInDomains(NSDocumentDirectory, NSUserDomainMask, YES);
    NSString *documentDirectory = [paths objectAtIndex:0];

    return documentDirectory;
}

#pragma mark - 判断设备
/**
	判断设备
	@returns 返回一个字符串
    @param ViewController            : iphone5以下
    @param ViewController-iPhone5    : iphone5
    @param ViewController-iPad       : iPad
 */
+ (NSString *)dev
{
    if(UI_USER_INTERFACE_IDIOM() == UIUserInterfaceIdiomPhone)
    {
        CGSize result = [[UIScreen mainScreen] bounds].size;

        if(result.height == 480.f)
        {
            return @"ViewController";
        }
        else
        {
            return @"ViewController-iPhone5";
        }
    }

    return @"ViewController-iPad";
}
@end


text:
NAME="camptocamp/mapfish_print"

function publish {
    # Setup login
    openssl aes-256-cbc -K $encrypted_fb15e83f0f9f_key -iv $encrypted_fb15e83f0f9f_iv \
        -in .dockercfg.enc -out ~/.dockercfg -d

    local version=$1
    export DOCKER_VERSION=`echo "${version}" | sed -e 's/^release\///' | sed -e 's/\//_/g'`

    echo "Deploying image to docker hub for tag ${DOCKER_VERSION}"
    ./gradlew --console=plain createDocker
    docker push "${NAME}:${DOCKER_VERSION}"
}

if [ "${TRAVIS_PULL_REQUEST}" != "false" ]
then
    echo "Not deploying image for pull requests"
    exit 0
fi

if [ "${TRAVIS_BRANCH}" == "master" ]
then
  publish latest
elif [ ! -z "${TRAVIS_TAG}" ]
then
  publish "${TRAVIS_TAG}"
#elif [ ! -z "${TRAVIS_BRANCH}" ]
#then
#  publish "${TRAVIS_BRANCH}"
else
  echo "Not deploying image"
fi


text:
  Saint-Hilaire-Taurieux est
       un village
       géographiquement positionné dans le département de Corrèze en Limousin. On dénombrait 96 habitants en 2008.

La commune propose quelques  équipements, elle dispose, entre autres, de une boucle de randonnée.

Le parc d'habitations, à Saint-Hilaire-Taurieux, se décomposait en 2011 en un appartements et 68 maisons soit
 un marché plutôt équilibré.

À coté de Saint-Hilaire-Taurieux sont positionnées géographiquement les villes de
Bassignac-le-Bas située à 5 km, 96 habitants,
Lostanges située à 6 km, 130 habitants,
Monceaux-sur-Dordogne localisée à 5 km, 680 habitants,
Neuville située à 5 km, 194 habitants,
Tudeils située à 4 km, 240 habitants,
Brivezac à 4 km, 189 habitants,
 entre autres. De plus, Saint-Hilaire-Taurieux est située à seulement 26 km de Brive-la-Gaillarde.

Si vous pensez demenager à Saint-Hilaire-Taurieux, vous pourrez facilement trouver une maison à vendre.


text:
package org.schemaspy.db.config;

import org.schemaspy.db.exceptions.RuntimeIOException;
import org.schemaspy.model.InvalidConfigurationException;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;

import java.io.IOException;
import java.io.InputStream;
import java.lang.invoke.MethodHandles;
import java.net.URL;
import java.util.Map;
import java.util.Objects;
import java.util.Properties;
import java.util.function.Predicate;
import java.util.stream.Collectors;

/**
 * @author Nils Petzaell
 */
public class PropertiesResolver {

    private static final Logger LOGGER = LoggerFactory.getLogger(MethodHandles.lookup().lookupClass());

    private final ResourceFinder resourceFinder;

    public PropertiesResolver() {
        resourceFinder = new PropertiesFinder();
    }

    public PropertiesResolver(ResourceFinder resourceFinder) {
        this.resourceFinder = resourceFinder;
    }

    public Properties getDbProperties(String dbType) {
        try {
            ResolutionInfo resolutionInfo = new ResolutionInfo(dbType);
            URL url = resourceFinder.find(dbType);
            resolutionInfo.addTrace(url);
            Properties props = fromURL(url);
            processIncludes(props, resolutionInfo);
            processExtends(props, resolutionInfo);
            LOGGER.info(resolutionInfo.getTrace());
            return props;
        } catch (ResourceNotFoundException rnfe) {
            throw new InvalidConfigurationException("Unable to resolve databaseType: " + dbType, rnfe)
                    .setParamName("-t")
                    .setParamValue(dbType);
        }
    }

    private Properties fromURL(URL url) {
        Properties properties = new Properties();
        try {
            try (InputStream inputStream = url.openStream()) {
                properties.load(inputStream);
            }
            } catch (IOException e) {
               throw new RuntimeIOException("Failed to load properties from: " + url.getFile(), e);
        }
        return properties;
    }

    private void processIncludes(Properties props, ResolutionInfo resolutionInfo) {
        Map<String,String> includes = props.entrySet().stream()
                .filter(isInclude)
                .collect(Collectors.toMap(e -> e.getKey().toString(), e -> e.getValue().toString()));
        includes.keySet().forEach(props::remove);
        includes.values().stream()
                .map( s -> s.split("::"))
                .forEach( ref -> {
                    Properties refProps = resolve(ref[0], resolutionInfo);
                    props.putIfAbsent(ref[1], refProps.getProperty(ref[1]));
                });

    }

    private static final Predicate<Map.Entry> isInclude = e -> {
        if (e.getKey().toString().startsWith("include.")) {
            if (e.getValue().toString().split("::").length == 2) {
                return true;
            }
            String msg = "Include directive is incorrect {" +
                    e.getKey().toString() +
                    "=" +
                    e.getValue().toString() + "}";
            throw new InvalidConfigurationException(msg);
        } else {
            return false;
        }
    };

    private void processExtends(Properties props, ResolutionInfo resolutionInfo) {
        String parentDbType = (String)props.remove("extends");
        Properties parentProperties;
        if (Objects.nonNull(parentDbType)) {
            parentProperties = resolve(parentDbType.trim(), resolutionInfo);
            parentProperties.forEach(props::putIfAbsent);
        }
    }

    private Properties resolve(String dbType, ResolutionInfo resolutionInfo) {
        URL url = resourceFinder.find(dbType);
        resolutionInfo.addTrace(url);
        Properties props = fromURL(url);
        processIncludes(props, resolutionInfo);
        processExtends(props, resolutionInfo);
        return props;
    }
}


text:
var path = require('path');
var Q = require('q');
var _ = require('lodash');
var fs = require('fs');

var utils = require('./utils');
var generate = require("../lib/generate");
var parse = require("../lib/parse");
var generators = require("../lib/generate").generators;

var buildCommand = function(command) {
    return command
    .option('-o, --output <directory>', 'Path to output directory, defaults to ./_book')
    .option('-f, --format <name>', 'Change generation format, defaults to site, availables are: '+_.keys(generators).join(", "))
    .option('-t, --title <name>', 'Name of the book to generate, default is extracted from readme')
    .option('-i, --intro <intro>', 'Description of the book to generate, default is extracted from readme')
    .option('--plugins <plugins>', 'List of plugins to use separated by ","')
    .option('--pluginsConfig <json file>', 'JSON File containing plugins configuration')
    .option('-g, --github <repo_path>', 'ID of github repo like : username/repo')
    .option('--githubHost <url>', 'The url of the github host (defaults to https://github.com/');
};

var makeBuildFunc = function(converter) {
    return  function(dir, options) {
        dir = dir || process.cwd();
        outputDir = options.output;

        // Read plugins config
        var pluginsConfig = {};
        if (options.pluginsConfig) {
            pluginsConfig = JSON.parse(fs.readFileSync(options.pluginsConfig))
        }

        console.log('Starting build ...');
        // Get repo's URL
        return utils.gitURL(dir)
        .then(function(url) {
            // Get ID of repo
            return utils.githubID(url);
        }, function(err) {
            return null;
        })
        .then(function(repoID) {
            return converter(
                _.extend({}, options || {}, {
                    input: dir,
                    output: outputDir,
                    title: options.title,
                    description: options.intro,
                    github: options.github || repoID,
                    githubHost: options.githubHost,
                    generator: options.format,
                    plugins: options.plugins,
                    pluginsConfig: pluginsConfig
                })
            );
        })
        .then(function(output) {
            console.log("Successfuly built !");
            return output;
        }, utils.logError);
    };
};

module.exports = {
    folder: makeBuildFunc(generate.folder),
    file: makeBuildFunc(generate.file),
    command: buildCommand
};


text:
<?php

namespace Blog\Bundle;

use Symfony\Component\HttpKernel\Bundle\Bundle;

class BlogBundle extends Bundle
{
}


text:
package com.intellij.openapi.options;

import com.intellij.openapi.extensions.ExtensionPointName;
import org.jetbrains.annotations.Nls;
import org.jetbrains.annotations.NonNls;
import org.jetbrains.annotations.Nullable;

/**
 * Named component which provides a configuration user interface.
 *
 *

 * Use {@code com.intellij.projectConfigurable} and {@code com.intellij.applicationConfigurable} extensions to provide items for
 * "Project Settings" and "IDE Settings" groups correspondingly in the "Settings" dialog. There are two ways to declare such extension:
 *

 *
 an extension element with 'instance' attribute
 *

 * <extensions defaultExtensionNs="com.intellij">

 *   <projectConfigurable instance="class-name"/>

 * </extensions>

 * where 'class-name' implements {@link Configurable} means that a new instance of the specified class will be created each time when
 * the dialog is opened.
 *

 *
 an extension with 'provider' attribute

 * <extensions defaultExtensionNs="com.intellij">

 *   <projectConfigurable provider="class-name"/>

 * </extensions>

 * where 'class-name' implements {@link ConfigurableProvider} means that method {@link ConfigurableProvider#createConfigurable()}
 * will be used to create instance each time when the dialog is opened.
 *

 *
 * @see SearchableConfigurable
 */
public interface Configurable extends UnnamedConfigurable {

  ExtensionPointName<ConfigurableEP<Configurable>> APPLICATION_CONFIGURABLE = ExtensionPointName.create("com.intellij.applicationConfigurable");

  ExtensionPointName<ConfigurableEP<Configurable>> PROJECT_CONFIGURABLE = ExtensionPointName.create("com.intellij.projectConfigurable");

  /**
   * Returns the user-visible name of the settings component.
   *
   * @return the visible name of the component.
   */
  @Nls
  String getDisplayName();

  /**
   * Returns the topic in the help file which is shown when help for the configurable
   * is requested.
   *
   * @return the help topic, or null if no help is available.
   */
  @Nullable
  @NonNls String getHelpTopic();

  /**
   * @deprecated this marker interface was used to hide a Configurable declared as applicationConfigurable or projectConfigurable extension
   * from the Settings dialog. However it makes no sense to register a Configurable as extension if you don't want to see it in the Settings
   * dialog
   */
  interface Assistant extends Configurable {
  }

  interface Composite {
    Configurable[] getConfigurables();
  }

  /**
   * Forbids wrapping the content of the configurable in a scroll pane. Required when
   * the configurable contains its own scrollable components.
   */
  interface NoScroll {
  }

}


text:
package org.gradle.internal.normalization.java.impl;

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

public class ClassMember extends AnnotatableMember {

    private final int version;
    private final String superName;
    private final String[] interfaces;

    private final List<String> permittedSubclasses = new ArrayList<>();

    public ClassMember(int version, int access, String name, String signature, String superName, String[] interfaces) {
        super(access, name, signature);
        this.version = version;
        this.superName = superName;
        this.interfaces = interfaces;
    }

    public String[] getInterfaces() {
        return Arrays.copyOf(interfaces, interfaces.length);
    }

    public String getSuperName() {
        return superName;
    }

    public int getVersion() {
        return version;
    }

    public List<String> getPermittedSubclasses() {
        return permittedSubclasses;
    }
}


text:
import React,{Component} from 'react';
import {Link} from 'react-router';
import {connect} from 'react-redux';
import axios from 'axios';
import {Button, Glyphicon, ProgressBar} from 'react-bootstrap';
import * as action from '../actions/login-action';

class Loginpage extends Component {
	handleClick(){
		this.getUserDetails();
	}
	getUserDetails() {
		window.IN.User.authorize(() => {
            window.IN.API.Profile("me")
                .fields(["id", "firstName", "lastName", "pictureUrl", "publicProfileUrl", "email-address", "location:(name)"])
                .result((result) => {
                    alert("Successfull login from linkedin : "+ result.values[0].firstName + " " + result.values[0].lastName);
                   	const loginResult = {
                   		"id" : result.values[0].id,
                   		"firstName":result.values[0].firstName,
                   		"lastName":result.values[0].lastName,
                   		"pictureUrl":result.values[0].pictureUrl,
                   		"publicProfileUrl":result.values[0].publicProfileUrl,
                   		"emailAddress":result.values[0].emailAddress,
                   		"location" : result.values[0].location.name
                   	}
                   	// Calling action
					this.getAuthorization(loginResult);
                })
                .error(function(err) {
                    console.log('Import error - Error occured while importing data')
                });
        });
	}
	getAuthorization(data) {
		let postUrl = 'http://localhost:8000/aunthenticate';
		axios.post(postUrl, data).then((result) => {
			this.props.userLogin(result);
		}).catch(function(result) {
			console.log(result);
		});
	}
	render() {
		return (

Find your Co-worker

							<Button bsSize="large" block onClick={this.handleClick.bind(this)}>

Get Started with
									Linked

							</Button>

		)
	}
}
const mapStateToProps = (state) =>{
	return {
		loginStatus : state.loginDetails
	}
}
const mapDispatchToProps = (dispatch) => {
	return{
		userLogin : (values) => dispatch(action.loginSuccess(values))
	}
}
export default connect(mapStateToProps, mapDispatchToProps)(Loginpage);


text:
const logger = require('./')
const bole = require('bole')
const koa = require('koa')

bole.output({
  level: 'debug',
  stream: process.stdout
})

const server = koa()
server.use(logger(bole))
server.listen(1337)