text:
/// <reference types="node"/>
import {ChildProcess} from 'child_process';
import {Stream, Readable as ReadableStream} from 'stream';

declare namespace execa {
	type StdioOption =
		| 'pipe'
		| 'ipc'
		| 'ignore'
		| 'inherit'
		| Stream
		| number
		| undefined;

	interface CommonOptions<EncodingType> {
		/**
		Kill the spawned process when the parent process exits unless either:
			- the spawned process is [`detached`](https://nodejs.org/api/child_process.html#child_process_options_detached)
			- the parent process is terminated abruptly, for example, with `SIGKILL` as opposed to `SIGTERM` or a normal exit

		@default true
		*/
		readonly cleanup?: boolean;

		/**
		Prefer locally installed binaries when looking for a binary to execute.

		If you `$ npm install foo`, you can then `execa('foo')`.

		@default false
		*/
		readonly preferLocal?: boolean;

		/**
		Preferred path to find locally installed binaries in (use with `preferLocal`).

		@default process.cwd()
		*/
		readonly localDir?: string;

		/**
		Path to the Node.js executable to use in child processes.

		This can be either an absolute path or a path relative to the `cwd` option.

		Requires `preferLocal` to be `true`.

		For example, this can be used together with [`get-node`](https://github.com/ehmicky/get-node) to run a specific Node.js version in a child process.

		@default process.execPath
		*/
		readonly execPath?: string;

		/**
		Buffer the output from the spawned process. When set to `false`, you must read the output of `stdout` and `stderr` (or `all` if the `all` option is `true`). Otherwise the returned promise will not be resolved/rejected.

		If the spawned process fails, `error.stdout`, `error.stderr`, and `error.all` will contain the buffered data.

		@default true
		*/
		readonly buffer?: boolean;

		/**
		Same options as [`stdio`](https://nodejs.org/dist/latest-v6.x/docs/api/child_process.html#child_process_options_stdio).

		@default 'pipe'
		*/
		readonly stdin?: StdioOption;

		/**
		Same options as [`stdio`](https://nodejs.org/dist/latest-v6.x/docs/api/child_process.html#child_process_options_stdio).

		@default 'pipe'
		*/
		readonly stdout?: StdioOption;

		/**
		Same options as [`stdio`](https://nodejs.org/dist/latest-v6.x/docs/api/child_process.html#child_process_options_stdio).

		@default 'pipe'
		*/
		readonly stderr?: StdioOption;

		/**
		Setting this to `false` resolves the promise with the error instead of rejecting it.

		@default true
		*/
		readonly reject?: boolean;

		/**
		Add an `.all` property on the promise and the resolved value. The property contains the output of the process with `stdout` and `stderr` interleaved.

		@default false
		*/
		readonly all?: boolean;

		/**
		Strip the final [newline character](https://en.wikipedia.org/wiki/Newline) from the output.

		@default true
		*/
		readonly stripFinalNewline?: boolean;

		/**
		Set to `false` if you don't want to extend the environment variables when providing the `env` property.

		@default true
		*/
		readonly extendEnv?: boolean;

		/**
		Current working directory of the child process.

		@default process.cwd()
		*/
		readonly cwd?: string;

		/**
		Environment key-value pairs. Extends automatically from `process.env`. Set `extendEnv` to `false` if you don't want this.

		@default process.env
		*/
		readonly env?: NodeJS.ProcessEnv;

		/**
		Explicitly set the value of `argv[0]` sent to the child process. This will be set to `command` or `file` if not specified.
		*/
		readonly argv0?: string;

		/**
		Child's [stdio](https://nodejs.org/api/child_process.html#child_process_options_stdio) configuration.

		@default 'pipe'
		*/
		readonly stdio?: 'pipe' | 'ignore' | 'inherit' | readonly StdioOption[];

		/**
		Specify the kind of serialization used for sending messages between processes when using the `stdio: 'ipc'` option or `execa.node()`:
			- `json`: Uses `JSON.stringify()` and `JSON.parse()`.
			- `advanced`: Uses [`v8.serialize()`](https://nodejs.org/api/v8.html#v8_v8_serialize_value)

		Requires Node.js `13.2.0` or later.

		[More info.](https://nodejs.org/api/child_process.html#child_process_advanced_serialization)

		@default 'json'
		*/
		readonly serialization?: 'json' | 'advanced';

		/**
		Prepare child to run independently of its parent process. Specific behavior [depends on the platform](https://nodejs.org/api/child_process.html#child_process_options_detached).

		@default false
		*/
		readonly detached?: boolean;

		/**
		Sets the user identity of the process.
		*/
		readonly uid?: number;

		/**
		Sets the group identity of the process.
		*/
		readonly gid?: number;

		/**
		If `true`, runs `command` inside of a shell. Uses `/bin/sh` on UNIX and `cmd.exe` on Windows. A different shell can be specified as a string. The shell should understand the `-c` switch on UNIX or `/d /s /c` on Windows.

		We recommend against using this option since it is:
		- not cross-platform, encouraging shell-specific syntax.
		- slower, because of the additional shell interpretation.
		- unsafe, potentially allowing command injection.

		@default false
		*/
		readonly shell?: boolean | string;

		/**
		Specify the character encoding used to decode the `stdout` and `stderr` output. If set to `null`, then `stdout` and `stderr` will be a `Buffer` instead of a string.

		@default 'utf8'
		*/
		readonly encoding?: EncodingType;

		/**
		If `timeout` is greater than `0`, the parent will send the signal identified by the `killSignal` property (the default is `SIGTERM`) if the child runs longer than `timeout` milliseconds.

		@default 0
		*/
		readonly timeout?: number;

		/**
		Largest amount of data in bytes allowed on `stdout` or `stderr`. Default: 100 MB.

		@default 100_000_000
		*/
		readonly maxBuffer?: number;

		/**
		Signal value to be used when the spawned process will be killed.

		@default 'SIGTERM'
		*/
		readonly killSignal?: string | number;

		/**
		If `true`, no quoting or escaping of arguments is done on Windows. Ignored on other platforms. This is set to `true` automatically when the `shell` option is `true`.

		@default false
		*/
		readonly windowsVerbatimArguments?: boolean;

		/**
		On Windows, do not create a new console window. Please note this also prevents `CTRL-C` [from working](https://github.com/nodejs/node/issues/29837) on Windows.

		@default true
		*/
		readonly windowsHide?: boolean;
	}

	interface Options<EncodingType = string> extends CommonOptions<EncodingType> {
		/**
		Write some input to the `stdin` of your binary.
		*/
		readonly input?: string | Buffer | ReadableStream;
	}

	interface SyncOptions<EncodingType = string> extends CommonOptions<EncodingType> {
		/**
		Write some input to the `stdin` of your binary.
		*/
		readonly input?: string | Buffer;
	}

	interface NodeOptions<EncodingType = string> extends Options<EncodingType> {
		/**
		The Node.js executable to use.

		@default process.execPath
		*/
		readonly nodePath?: string;

		/**
		List of [CLI options](https://nodejs.org/api/cli.html#cli_options) passed to the Node.js executable.

		@default process.execArgv
		*/
		readonly nodeOptions?: string[];
	}

	interface ExecaReturnBase<StdoutStderrType> {
		/**
		The file and arguments that were run, for logging purposes.

		This is not escaped and should not be executed directly as a process, including using `execa()` or `execa.command()`.
		*/
		command: string;

		/**
		Same as `command` but escaped.

		This is meant to be copy and pasted into a shell, for debugging purposes.
		Since the escaping is fairly basic, this should not be executed directly as a process, including using `execa()` or `execa.command()`.
		*/
		escapedCommand: string;

		/**
		The numeric exit code of the process that was run.
		*/
		exitCode: number;

		/**
		The output of the process on stdout.
		*/
		stdout: StdoutStderrType;

		/**
		The output of the process on stderr.
		*/
		stderr: StdoutStderrType;

		/**
		Whether the process failed to run.
		*/
		failed: boolean;

		/**
		Whether the process timed out.
		*/
		timedOut: boolean;

		/**
		Whether the process was killed.
		*/
		killed: boolean;

		/**
		The name of the signal that was used to terminate the process. For example, `SIGFPE`.

		If a signal terminated the process, this property is defined and included in the error message. Otherwise it is `undefined`.
		*/
		signal?: string;

		/**
		A human-friendly description of the signal that was used to terminate the process. For example, `Floating point arithmetic error`.

		If a signal terminated the process, this property is defined and included in the error message. Otherwise it is `undefined`. It is also `undefined` when the signal is very uncommon which should seldomly happen.
		*/
		signalDescription?: string;
	}

	interface ExecaSyncReturnValue<StdoutErrorType = string>
		extends ExecaReturnBase<StdoutErrorType> {
	}

	/**
	Result of a child process execution. On success this is a plain object. On failure this is also an `Error` instance.

	The child process fails when:
	- its exit code is not `0`
	- it was killed with a signal
	- timing out
	- being canceled
	- there's not enough memory or there are already too many child processes
	*/
	interface ExecaReturnValue<StdoutErrorType = string>
		extends ExecaSyncReturnValue<StdoutErrorType> {
		/**
		The output of the process with `stdout` and `stderr` interleaved.

		This is `undefined` if either:
		- the `all` option is `false` (default value)
		- `execa.sync()` was used
		*/
		all?: StdoutErrorType;

		/**
		Whether the process was canceled.
		*/
		isCanceled: boolean;
	}

	interface ExecaSyncError<StdoutErrorType = string>
		extends Error,
		ExecaReturnBase<StdoutErrorType> {
		/**
		Error message when the child process failed to run. In addition to the underlying error message, it also contains some information related to why the child process errored.

		The child process stderr then stdout are appended to the end, separated with newlines and not interleaved.
		*/
		message: string;

		/**
		This is the same as the `message` property except it does not include the child process stdout/stderr.
		*/
		shortMessage: string;

		/**
		Original error message. This is the same as the `message` property except it includes neither the child process stdout/stderr nor some additional information added by Execa.

		This is `undefined` unless the child process exited due to an `error` event or a timeout.
		*/
		originalMessage?: string;
	}

	interface ExecaError<StdoutErrorType = string>
		extends ExecaSyncError<StdoutErrorType> {
		/**
		The output of the process with `stdout` and `stderr` interleaved.

		This is `undefined` if either:
		- the `all` option is `false` (default value)
		- `execa.sync()` was used
		*/
		all?: StdoutErrorType;

		/**
		Whether the process was canceled.
		*/
		isCanceled: boolean;
	}

	interface KillOptions {
		/**
		Milliseconds to wait for the child process to terminate before sending `SIGKILL`.

		Can be disabled with `false`.

		@default 5000
		*/
		forceKillAfterTimeout?: number | false;
	}

	interface ExecaChildPromise<StdoutErrorType> {
		/**
		Stream combining/interleaving [`stdout`](https://nodejs.org/api/child_process.html#child_process_subprocess_stdout) and [`stderr`](https://nodejs.org/api/child_process.html#child_process_subprocess_stderr).

		This is `undefined` if either:
			- the `all` option is `false` (the default value)
			- both `stdout` and `stderr` options are set to [`'inherit'`, `'ipc'`, `Stream` or `integer`](https://nodejs.org/dist/latest-v6.x/docs/api/child_process.html#child_process_options_stdio)
		*/
		all?: ReadableStream;

		catch<ResultType = never>(
			onRejected?: (reason: ExecaError<StdoutErrorType>) => ResultType | PromiseLike<ResultType>
		): Promise<ExecaReturnValue<StdoutErrorType> | ResultType>;

		/**
		Same as the original [`child_process#kill()`](https://nodejs.org/api/child_process.html#child_process_subprocess_kill_signal), except if `signal` is `SIGTERM` (the default value) and the child process is not terminated after 5 seconds, force it by sending `SIGKILL`.
		*/
		kill(signal?: string, options?: KillOptions): void;

		/**
		Similar to [`childProcess.kill()`](https://nodejs.org/api/child_process.html#child_process_subprocess_kill_signal). This is preferred when cancelling the child process execution as the error is more descriptive and [`childProcessResult.isCanceled`](#iscanceled) is set to `true`.
		*/
		cancel(): void;
	}

	type ExecaChildProcess<StdoutErrorType = string> = ChildProcess &
	ExecaChildPromise<StdoutErrorType> &
	Promise<ExecaReturnValue<StdoutErrorType>>;
}

declare const execa: {
	/**
	Execute a file.

	Think of this as a mix of `child_process.execFile` and `child_process.spawn`.

	@param file - The program/script to execute.
	@param arguments - Arguments to pass to `file` on execution.
	@returns A [`child_process` instance](https://nodejs.org/api/child_process.html#child_process_class_childprocess), which is enhanced to also be a `Promise` for a result `Object` with `stdout` and `stderr` properties.

	@example
	```
	import execa = require('execa');

	(async () => {
		const {stdout} = await execa('echo', ['unicorns']);
		console.log(stdout);
		//=> 'unicorns'

		// Cancelling a spawned process

		const subprocess = execa('node');

		setTimeout(() => {
			subprocess.cancel()
		}, 1000);

		try {
			await subprocess;
		} catch (error) {
			console.log(subprocess.killed); // true
			console.log(error.isCanceled); // true
		}
	})();

	// Pipe the child process stdout to the current stdout
	execa('echo', ['unicorns']).stdout.pipe(process.stdout);
	```
	*/
	(
		file: string,
		arguments?: readonly string[],
		options?: execa.Options
	): execa.ExecaChildProcess;
	(
		file: string,
		arguments?: readonly string[],
		options?: execa.Options<null>
	): execa.ExecaChildProcess<Buffer>;
	(file: string, options?: execa.Options): execa.ExecaChildProcess;
	(file: string, options?: execa.Options<null>): execa.ExecaChildProcess<
	Buffer
	>;

	/**
	Execute a file synchronously.

	This method throws an `Error` if the command fails.

	@param file - The program/script to execute.
	@param arguments - Arguments to pass to `file` on execution.
	@returns A result `Object` with `stdout` and `stderr` properties.
	*/
	sync(
		file: string,
		arguments?: readonly string[],
		options?: execa.SyncOptions
	): execa.ExecaSyncReturnValue;
	sync(
		file: string,
		arguments?: readonly string[],
		options?: execa.SyncOptions<null>
	): execa.ExecaSyncReturnValue<Buffer>;
	sync(file: string, options?: execa.SyncOptions): execa.ExecaSyncReturnValue;
	sync(
		file: string,
		options?: execa.SyncOptions<null>
	): execa.ExecaSyncReturnValue<Buffer>;

	/**
	Same as `execa()` except both file and arguments are specified in a single `command` string. For example, `execa('echo', ['unicorns'])` is the same as `execa.command('echo unicorns')`.

	If the file or an argument contains spaces, they must be escaped with backslashes. This matters especially if `command` is not a constant but a variable, for example with `__dirname` or `process.cwd()`. Except for spaces, no escaping/quoting is needed.

	The `shell` option must be used if the `command` uses shell-specific features (for example, `&&` or `||`), as opposed to being a simple `file` followed by its `arguments`.

	@param command - The program/script to execute and its arguments.
	@returns A [`child_process` instance](https://nodejs.org/api/child_process.html#child_process_class_childprocess), which is enhanced to also be a `Promise` for a result `Object` with `stdout` and `stderr` properties.

	@example
	```
	import execa = require('execa');

	(async () => {
		const {stdout} = await execa.command('echo unicorns');
		console.log(stdout);
		//=> 'unicorns'
	})();
	```
	*/
	command(command: string, options?: execa.Options): execa.ExecaChildProcess;
	command(command: string, options?: execa.Options<null>): execa.ExecaChildProcess<Buffer>;

	/**
	Same as `execa.command()` but synchronous.

	@param command - The program/script to execute and its arguments.
	@returns A result `Object` with `stdout` and `stderr` properties.
	*/
	commandSync(command: string, options?: execa.SyncOptions): execa.ExecaSyncReturnValue;
	commandSync(command: string, options?: execa.SyncOptions<null>): execa.ExecaSyncReturnValue<Buffer>;

	/**
	Execute a Node.js script as a child process.

	Same as `execa('node', [scriptPath, ...arguments], options)` except (like [`child_process#fork()`](https://nodejs.org/api/child_process.html#child_process_child_process_fork_modulepath_args_options)):
		- the current Node version and options are used. This can be overridden using the `nodePath` and `nodeArguments` options.
		- the `shell` option cannot be used
		- an extra channel [`ipc`](https://nodejs.org/api/child_process.html#child_process_options_stdio) is passed to [`stdio`](#stdio)

	@param scriptPath - Node.js script to execute.
	@param arguments - Arguments to pass to `scriptPath` on execution.
	@returns A [`child_process` instance](https://nodejs.org/api/child_process.html#child_process_class_childprocess), which is enhanced to also be a `Promise` for a result `Object` with `stdout` and `stderr` properties.
	*/
	node(
		scriptPath: string,
		arguments?: readonly string[],
		options?: execa.NodeOptions
	): execa.ExecaChildProcess;
	node(
		scriptPath: string,
		arguments?: readonly string[],
		options?: execa.Options<null>
	): execa.ExecaChildProcess<Buffer>;
	node(scriptPath: string, options?: execa.Options): execa.ExecaChildProcess;
	node(scriptPath: string, options?: execa.Options<null>): execa.ExecaChildProcess<Buffer>;
};

export = execa;


text:
package com.markzhai.library.utils;

import java.io.FileInputStream;
import java.io.FileNotFoundException;
import java.io.FileOutputStream;
import java.io.IOException;
import java.io.ObjectInputStream;
import java.io.ObjectOutputStream;

/**
 * 序列化与反序列化工具类
 */
public class SerializeUtils {

	/**
	 * 反序列化
	 *
	 * @param filePath
	 * @return
	 */
	public static Object deserialization(String filePath) {
		ObjectInputStream in = null;
		try {
			in = new ObjectInputStream(new FileInputStream(filePath));
			Object o = in.readObject();
			in.close();
			return o;
		} catch (FileNotFoundException e) {
			throw new RuntimeException("FileNotFoundException occurred. ", e);
		} catch (ClassNotFoundException e) {
			throw new RuntimeException("ClassNotFoundException occurred. ", e);
		} catch (IOException e) {
			throw new RuntimeException("IOException occurred. ", e);
		} finally {
			if (in != null) {
				try {
					in.close();
				} catch (IOException e) {
					throw new RuntimeException("IOException occurred. ", e);
				}
			}
		}
	}

	/**
	 * 序列化
	 *
	 * @param filePath
	 * @param obj
	 */
	public static void serialization(String filePath, Object obj) {
		ObjectOutputStream out = null;
		try {
			out = new ObjectOutputStream(new FileOutputStream(filePath));
			out.writeObject(obj);
			out.close();
		} catch (FileNotFoundException e) {
			throw new RuntimeException("FileNotFoundException occurred. ", e);
		} catch (IOException e) {
			throw new RuntimeException("IOException occurred. ", e);
		} finally {
			if (out != null) {
				try {
					out.close();
				} catch (IOException e) {
					throw new RuntimeException("IOException occurred. ", e);
				}
			}
		}
	}
}

redpajama_set_name: RedPajamaGithub


text:
using System.Data;
using System.Threading.Tasks;

namespace FluidDbClient
{
    public interface IManagedDbCommand
    {
        void Execute(IsolationLevel isolationLevel = IsolationLevel.ReadCommitted);

        void ExecuteWithoutTransaction();

        Task ExecuteAsync(IsolationLevel isolationLevel = IsolationLevel.ReadCommitted);

        Task ExecuteWithoutTransactionAsync();
    }
}


text:
require 'switch_user/data_source'

module SwitchUser
  RSpec.describe DataSources do
    describe '#all' do
      it 'aggregates multiple data_sources' do
        user = double(:user)
        s1 = double(:s1, :all => [user])
        source = DataSources.new([s1, s1])

        expect(source.all).to eq [user, user]
      end
    end

    describe '#find_scope_id' do
      it 'can find a corresponding record across data sources' do
        user = double(:user)
        s1 = double(:s1, :find_scope_id => nil)
        s2 = double(:s2, :find_scope_id => user)
        source = DataSources.new([s1, s2])

        expect(source.find_scope_id("user_10")).to eq user
      end
    end
  end

  RSpec.describe DataSource do
    pending # it's tested in integration test, need to find a good way to test it here.
  end

  RSpec.describe GuestDataSource do
    let(:source) { GuestDataSource.new }

    describe '#all' do
      it 'gets a GuestRecord' do
        expect(source.all.size).to eq 1
        expect(source.all.first).to be_instance_of GuestRecord
      end
    end

    describe '#find_scope_id' do
      it 'gets nil' do
        expect(source.find_scope_id('')).to be_nil
      end
    end
  end

  RSpec.describe Record do
    let(:source) { DataSource.new({}, :user, :id, :email) }
    let(:user) { double(:user, id: '1', email: 'flyerhzm@gmail.com') }
    let(:record) { Record.new(user, source) }

    describe '#label' do
      it 'gets user email' do
        expect(record.label).to eq 'flyerhzm@gmail.com'
      end
    end

    describe '#scope' do
      it 'gets user' do
        expect(record.scope).to eq :user
      end
    end

    describe '#scope_id' do
      it 'gets scope and id' do
        expect(record.scope_id).to eq 'user_1'
      end
    end
  end

  RSpec.describe GuestRecord do
    let(:record) { GuestRecord.new }

    describe '#label' do
      it 'gets Guest' do
        expect(record.label).to eq 'Guest'
      end
    end

    describe '#scope_id' do
      it 'gets nil' do
        expect(record.scope_id).to be_nil
      end
    end
  end
end


text:
package com.milaboratory.util;

import java.util.concurrent.ConcurrentLinkedQueue;
import java.util.concurrent.atomic.AtomicLong;

public final class LambdaSemaphore {
    final ConcurrentLinkedQueue<Runnable> queue = new ConcurrentLinkedQueue<>();

    /** (number of queued objects) : 32 bits | (number of permits) : 32 bits */
    final AtomicLong state;
    /** Number of permits this object was initialized with */
    final int initialPermits;

    public LambdaSemaphore(int initialPermits) {
        this.initialPermits = initialPermits;
        this.state = new AtomicLong(encode(0, initialPermits));
    }

    private static long encode(int queued, int permits) {
        return ((long) queued) << 32 | (0xFFFFFFFFL & permits);
    }

    /** Extracts number of permits from 64-bit state encoded value */
    private static int permits(long state) {
        return (int) (0xFFFFFFFFL & state);
    }

    /** Extracts number of queued lambdas from 64-bit state encoded value */
    private static int queued(long state) {
        return (int) (state >>> 32);
    }

    private static boolean hasPermitsAndPendingRequests(long state) {
        return permits(state) > 0 && queued(state) > 0;
    }

    private void executePending() {
        long stateValue;
        while (hasPermitsAndPendingRequests(stateValue = state.get())) {
            if (state.compareAndSet(stateValue, stateValue - encode(1, 1))) {
                Runnable next = queue.poll();
                if (next == null)
                    throw new InternalError("Impossible state.");
                next.run();
            }
        }
    }

    /**
     * Consumes a permit from this semaphore (if available) and executes the Runnable right away,
     * if no permits available, the Runnable action is added to the execution queue.
     */
    public void acquire(Runnable callback) {
        queue.offer(callback);
        state.addAndGet(encode(1, 0));
        executePending();
    }

    /** Adds a permit to this semaphore, and executes first pending action from the queue if there are any. */
    public void release() {
        state.addAndGet(encode(0, 1));
        executePending();
    }

    /** Returns the number of permits this objects was initially created with. */
    public int getInitialPermits() {
        return initialPermits;
    }
}


text:
import unittest
from payserv.Payee import Payee

class TestPayee(unittest.TestCase):

    def test_valid_address(self):
        addr = '1CmFuDcdvhShHB9QgcrXckJF4UEmMFbu7V'
        in_addr1 = "4CmFuDcdvhShHB9QgcrXckJF4UEmMFbu7V"
        in_addr2 = "notavalidaddress"

        self.assertTrue(Payee(addr).is_valid_address())
        self.assertFalse(Payee(in_addr1).is_valid_address())
        self.assertFalse(Payee(in_addr2).is_valid_address())

    def test_addr_data(self):
        addr1 = '14BV7KNzmpumQqpmfk3DJj6F9ZM9zRmu9A'
        addr2 = '1CmFuDcdvhShHB9QgcrXckJF4UEmMFbu7V'
        addr3 = "notavalidaddress"

        payee1 = Payee(addr1)
        payee2 = Payee(addr2)
        payee3 = Payee(addr3)

        json_response = payee1.get_addr_data()
        self.assertEqual(json_response["data"][0]["asset"], 'SJCX')
        self.assertEqual(json_response["data"][0]["amount"], '10.00000000')

        invalid = {"success": 0, "error": "Invalid address"}
        self.assertEqual(payee2.get_addr_data(), invalid)
        self.assertEqual(payee3.get_addr_data(), invalid)

    def test_addr_bal(self):
        addr1 = '14BV7KNzmpumQqpmfk3DJj6F9ZM9zRmu9A'
        addr2 = '1CmFuDcdvhShHB9QgcrXckJF4UEmMFbu7V'

        payee1 = Payee(addr1)
        payee2 = Payee(addr2)

        self.assertEqual(payee1.get_balance(), 10)
        self.assertEqual(payee2.get_balance(), 0)


text:
/**
 */
package fr.unice.spinefm.MSPLModel;

import org.eclipse.emf.ecore.EFactory;

/**
 *
 * The Factory for the model.
 * It provides a create method for each non-abstract class of the model.
 *
 * @see fr.unice.spinefm.MSPLModel.MSPLModelPackage
 * @generated
 */
public interface MSPLModelFactory extends EFactory
{
	/**
	 * The singleton instance of the factory.
	 *
	 *
	 * @generated
	 */
	MSPLModelFactory eINSTANCE = fr.unice.spinefm.MSPLModel.impl.MSPLModelFactoryImpl.init();

	/**
	 * Returns a new object of class 'Multiple Software Product Line'.
	 *
	 *
	 * @return a new object of class 'Multiple Software Product Line'.
	 * @generated
	 */
	MultipleSoftwareProductLine createMultipleSoftwareProductLine();

	/**
	 * Returns a new object of class 'DE Association'.
	 *
	 *
	 * @return a new object of class 'DE Association'.
	 * @generated
	 */
	DEAssociation createDEAssociation();

	/**
	 * Returns a new object of class 'Multiplicity Element'.
	 *
	 *
	 * @return a new object of class 'Multiplicity Element'.
	 * @generated
	 */
	MultiplicityElement createMultiplicityElement();

	/**
	 * Returns a new object of class 'DE Association End'.
	 *
	 *
	 * @return a new object of class 'DE Association End'.
	 * @generated
	 */
	DEAssociationEnd createDEAssociationEnd();

	/**
	 * Returns a new object of class 'Domain Element'.
	 *
	 *
	 * @return a new object of class 'Domain Element'.
	 * @generated
	 */
	DomainElement createDomainElement();

	/**
	 * Returns the package supported by this factory.
	 *
	 *
	 * @return the package supported by this factory.
	 * @generated
	 */
	MSPLModelPackage getMSPLModelPackage();

} //MSPLModelFactory


text:
import { WidgetProps } from 'jsoninput/typings/types';
import * as React from 'react';

type HiddenProps = WidgetProps & { schema: { const?: {} } };

class HiddenView extends React.Component<HiddenProps> {
    componentDidMount() {
        this.checkConst();
    }
    componentDidUpdate() {
        this.checkConst();
    }
    checkConst() {
        if ('const' in this.props.schema && this.props.schema.const !== this.props.value) {
            this.props.onChange(this.props.schema.const);
        }
    }
    render() {
        return null;
    }
}

export default HiddenView;


text:
EXTERN_BEGIN

#define AUDIO_OUT_PRIMARY 0
#define AUDIO_OUT_SECONDARY 1

typedef struct {
  uint8_t type;
  uint8_t channel;
  uint8_t fs;
  uint8_t reserved;
  uint32_t layout;
} AudioOutSoundMode;

typedef struct {
  uint8_t port_type;
  uint8_t num_modes;
  uint8_t state;
  uint8_t reserved[3];
  uint16_t latency;
  AudioOutSoundMode modes[16];
} AudioOutDeviceInfo;

typedef struct {
  uint8_t channel;
  uint8_t encoder;
  uint8_t reserved[10];
  uint32_t down_mixer;
} AudioOutConfiguration;

typedef struct {
  uint8_t state;
  uint8_t encoder;
  uint8_t reserved[6];
  uint32_t down_mixer;
  AudioOutSoundMode soundMode;
} AudioOutState;

#define AUDIO_OUT_CODING_TYPE_LPCM        0
#define AUDIO_OUT_CODING_TYPE_AC3         1
#define AUDIO_OUT_CODING_TYPE_MPEG1       2
#define AUDIO_OUT_CODING_TYPE_MP3         3
#define AUDIO_OUT_CODING_TYPE_MPEG2       4
#define AUDIO_OUT_CODING_TYPE_AAC         5
#define AUDIO_OUT_CODING_TYPE_DTS         6
#define AUDIO_OUT_CODING_TYPE_ATRAC       7
#define AUDIO_OUT_CODING_TYPE_BITSTREAM   255

#define AUDIO_OUT_FS_32KHZ                     0x01
#define AUDIO_OUT_FS_44KHZ                     0x02
#define AUDIO_OUT_FS_48KHZ                     0x04
#define AUDIO_OUT_FS_88KHZ                     0x08
#define AUDIO_OUT_FS_96KHZ                     0x10
#define AUDIO_OUT_FS_176KHZ                    0x20
#define AUDIO_OUT_FS_192KHZ                    0x40

#define AUDIO_OUT_DOWNMIXER_NONE   0
#define AUDIO_OUT_DOWNMIXER_TYPE_A 1   // >2 channels
#define AUDIO_OUT_DOWNMIXER_TYPE_B 2   // >6 channels

int audioOutGetNumberOfDevice(uint32_t out);
int audioOutGetDeviceInfo(uint32_t out, uint32_t index,
			  AudioOutDeviceInfo *info);
int audioOutGetSoundAvailability(uint32_t audioOut, uint32_t type,
				 uint32_t fs, uint32_t option);

int audioOutConfigure(uint32_t out, AudioOutConfiguration *conf,
		      uint32_t *option, uint32_t wait_for_event);

int audioOutGetState(uint32_t out, uint32_t deviceindex, AudioOutState *state);

#define AUDIO_OUT_COPY_CONTROL_FREE  0
#define AUDIO_OUT_COPY_CONTROL_ONCE  1
#define AUDIO_OUT_COPY_CONTROL_NEVER 2

int audioOutSetCopyControl(uint32_t out, uint32_t val);


text:
package com.gemstone.gemfire.internal.tools.gfsh.app.command.task.data;

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

import com.gemstone.gemfire.DataSerializable;
import com.gemstone.gemfire.internal.tools.gfsh.app.misc.util.DataSerializerEx;

/**
 * A data class that contains member information
 * @author dpark
 *
 */
public class MemberInfo implements DataSerializable
{
	private static final long serialVersionUID = 1L;

	private String memberId;
	private String memberName;
	private String host;
	private int pid;

	public String getMemberId()
	{
		return memberId;
	}

	public void setMemberId(String memberId)
	{
		this.memberId = memberId;
	}

	public String getMemberName()
	{
		return memberName;
	}

	public void setMemberName(String memberName)
	{
		this.memberName = memberName;
	}

	public String getHost()
	{
		return host;
	}

	public void setHost(String host)
	{
		this.host = host;
	}

	public int getPid()
	{
		return pid;
	}

	public void setPid(int pid)
	{
		this.pid = pid;
	}

	public void fromData(DataInput in) throws IOException, ClassNotFoundException
	{
		pid = in.readInt();
		memberId = DataSerializerEx.readUTF(in);
		memberName = DataSerializerEx.readUTF(in);
		host = DataSerializerEx.readUTF(in);
	}

	public void toData(DataOutput out) throws IOException
	{
		out.writeInt(pid);
		DataSerializerEx.writeUTF(memberId, out);
		DataSerializerEx.writeUTF(memberName, out);
		DataSerializerEx.writeUTF(host, out);
	}
}


text:
class API
  # API for HerbariumRecord
  class HerbariumRecordAPI < ModelAPI
    self.model = HerbariumRecord

    self.high_detail_page_length = 100
    self.low_detail_page_length  = 1000
    self.put_page_length         = 1000
    self.delete_page_length      = 1000

    self.high_detail_includes = [
      { observations: [:location, :name, :user] },
      :herbarium,
      :user
    ]

    def query_params
      {
        where: sql_id_condition,
        created_at: parse_range(:time, :created_at),
        updated_at: parse_range(:time, :updated_at),
        users: parse_array(:user, :user, help: :creator),
        herbaria: parse_array(:herbarium, :herbarium, as: :id),
        observations: parse_array(:observation, :observation, as: :id),
        has_notes: parse(:boolean, :has_notes),
        initial_det: parse(:string, :initial_det, help: 1),
        accession_number: parse(:string, :accession_number, help: 1),
        notes_has: parse(:string, :notes_has, help: 1),
        initial_det_has: parse(:string, :initial_det_has, help: 1),
        accession_number_has: parse(:string, :accession_number_has, help: 1)
      }
    end

    def create_params
      @observation = parse(:observation, :observation)
      {
        herbarium: parse(:herbarium, :herbarium),
        initial_det: parse(:string, :initial_det, help: 1),
        accession_number: parse(:string, :accession_number, help: 1),
        notes: parse(:string, :notes),
        user: @user
      }
    end

    def update_params
      @adds    = parse_array(:observation, :add_observation, help: 1)
      @removes = parse_array(:observation, :remove_observation, help: 1)
      {
        herbarium: parse(:herbarium, :set_herbarium, not_blank: true),
        initial_det: parse(:string, :set_initial_det, not_blank: true, help: 1),
        accession_number: parse(:string, :set_accession_number,
                                not_blank: true, help: 1),
        notes: parse(:string, :set_notes)
      }
    end

    def validate_create_params!(params)
      raise(MissingParameter.new(:observation)) unless @observation
      raise(MissingParameter.new(:herbarium))   unless params[:herbarium]

      make_sure_can_add_herbarium_record!(params)
      provide_default_label!(params)
    end

    def validate_update_params!(params)
      return if params.any? || @adds || @removes

      raise(MissingSetParameters.new)
    end

    def make_sure_can_add_herbarium_record!(params)
      return if @observation.can_edit?(@user)
      return if params[:herbarium].curator?(@user)

      raise(CantAddHerbariumRecord.new)
    end

    def provide_default_label!(params)
      provide_default_initial_determination!(params)
      provide_default_accession_number!(params)
    end

    def provide_default_initial_determination!(params)
      return if params[:initial_det].present?

      params[:initial_det] = @observation.name.text_name
    end

    def provide_default_accession_number!(params)
      return if params[:accession_number].present?

      params[:accession_number] =
        if @observation.collection_numbers.one?
          @observation.collection_numbers.first.format_name
        else
          "MO #{@observation.id}"
        end
    end

    def before_create(params)
      obj = HerbariumRecord.where(
        herbarium: params[:herbarium],
        accession_number: params[:accession_number]
      ).first
      return nil unless obj
      raise(HerbariumRecordAlreadyExists.new(obj)) unless obj.can_edit?(@user)

      obj.add_observation(@observation)
      obj
    end

    def after_create(obj)
      obj.add_observation(@observation)
    end

    def build_setter(params)
      lambda do |obj|
        must_have_edit_permission!(obj)
        add_observations(obj)
        remove_observations(obj)
        obj.attributes = params
        other_obj = lookup_matching_herbarium_record(obj)
        if other_obj && other_obj != obj
          merge_herbarium_records(obj, other_obj)
        else
          change_herbarium_record(obj)
        end
      end
    end

    def must_have_edit_permission!(obj)
      return true if obj.can_edit?(@user) ||
                     obj.herbarium.curator?(@user)

      raise(MustHaveEditPermission.new(obj))
    end

    def lookup_matching_herbarium_record(obj)
      HerbariumRecord.where(herbarium: obj.herbarium,
                            accession_number: obj.accession_number).first
    end

    def change_herbarium_record(obj)
      old_herbarium_id = obj.herbarium_id_was
      obj.save
      obj.notify_curators if obj.herbarium_id != old_herbarium_id
      obj
    end

    def merge_herbarium_records(this_obj, _other_obj)
      raise(HerbariumRecordAlreadyExists.new(this_obj))
    end

    def add_observations(obj)
      return unless @adds

      @adds.each do |obs|
        raise(MustHaveEditPermission.new(obj)) \
          unless obs.can_edit?(@user) || obj.herbarium.curator?(@user)

        obj.add_observation(obs)
      end
    end

    def remove_observations(obj)
      return unless @removes

      @removes.each do |obs|
        obj.remove_observation(obs)
      end
    end
  end
end


text:
#if !defined(__CINT__) || defined(__MAKECINT_)
#include "AliFemtoManager.h"
#include "AliFemtoEventReaderESDChain.h"
#include "AliFemtoEventReaderESDChainKine.h"
#include "AliFemtoEventReaderAODChain.h"
#include "AliFemtoSimpleAnalysis.h"
#include "AliFemtoBasicEventCut.h"
#include "AliFemtoESDTrackCut.h"
#include "AliFemtoCorrFctn.h"
#include "AliFemtoCutMonitorParticleYPtWithWeights.h"
#include "AliFemtoCutMonitorParticleVertPos.h"
#include "AliFemtoCutMonitorParticleMomRes.h"
#include "AliFemtoCutMonitorParticlePID.h"
#include "AliFemtoCutMonitorEventMult.h"
#include "AliFemtoCutMonitorEventVertex.h"
#include "AliFemtoShareQualityTPCEntranceSepPairCut.h"
#include "AliFemtoPairCutAntiGamma.h"
#include "AliFemtoPairCutRadialDistance.h"
#include "AliFemtoModelCorrFctnQinv.h"
#include "AliFemtoQinvCorrFctn.h"
#include "AliFemtoCorrFctnDEtaDPhi.h"
#include "AliFemtoModelCorrFctnWithWeights.h"
#include "AliFemtoCorrFctnNonIdDR.h"
#include "AliFemtoShareQualityCorrFctn.h"
#include "AliFemtoTPCInnerCorrFctn.h"
#include "AliFemtoVertexMultAnalysis.h"
#include "AliFemtoCorrFctn3DSpherical.h"
#include "AliFemtoChi2CorrFctn.h"
#include "AliFemtoCorrFctnTPCNcls.h"
#include "AliFemtoBPLCMS3DCorrFctn.h"
#include "AliFemtoCorrFctn3DLCMSSym.h"
#include "AliFemtoModelBPLCMSCorrFctn.h"
#include "AliFemtoModelCorrFctn3DSpherical.h"
#include "AliFemtoModelGausLCMSFreezeOutGenerator.h"
#include "AliFemtoModelGausRinvFreezeOutGenerator.h"
#include "AliFemtoModelManager.h"
#include "AliFemtoModelWeightGenerator.h"
#include "AliFemtoModelWeightGeneratorBasic.h"
#include "AliFemtoModelWeightGeneratorLednicky.h"
#include "AliFemtoCorrFctnDirectYlm.h"
#include "AliFemtoModelCorrFctnDirectYlm.h"
#include "AliFemtoModelCorrFctnSource.h"
#include "AliFemtoCutMonitorParticlePtPDG.h"
#include "AliFemtoKTPairCut.h"
#include "AliFemtoPairCutPt.h"
#include "AliFemtoModelCorrFctnDEtaDPhiWithWeights.h"
#include "AliFemtoAvgSepCorrFctn.h"
#include "AliFemtoModelGausRinvFreezeOutGenerator.h"
#include "AliFemtoQinvCorrFctnWithWeights.h"
#include "AliFemtoModelCorrFctnDEtaDPhiWithWeights.h"
#include "AliFemtoModelCorrFctn.h"
#include "AliFemtoModelCorrFctnDEtaDPhiRM.h"
#include "AliFemtoCutMonitorPairKT.h"
#include "AliFemtoPairCutMInv.h"

#endif

//________________________________________________________________________
AliFemtoManager* ConfigFemtoAnalysis(const char* params)
{
//masy czastek w GeV
   double PionMass = 0.13956995;
   double KaonMass = 0.493677;
   double ProtonMass = 0.938272013;
   double LambdaMass = 1.115683;
   double RhoMass = 0.77549;
   double PhiMass = 1.019445;

   //double *part_mases[4] = {ProtonMass, KaonMass, PionMass, LambdaMass};

/************** MULTIPLICITY *************/
   const int numOfMultBins = 5;
   int runmults[numOfMultBins] = {1, 0, 0, 0, 0};    // 1 wlaczony przedzial krotnosci, 0 wylaczony
   int multbins[numOfMultBins+1] = {2, 20000, 0, 5000, 10001, 15000}; //definiujemy przedzialy krotnosci
/************** OTHER SETTINGS *************/
   int gammacut = 1;   // cut for e+e- coming from gamma
   int runktdep = 1;
   int resonancecut = 0;
/************** PARTICLE TYPES FOR ANALYSIS *************/
	//ilosc par dla ktorych liczymy korelacje
   const int numOfPairTypes = 16;
	//typy analizowanych par czastek, all - bierzemy (dowolna, dowolna), plus - (dodatnia, dodatnia), mixed (plus, minus) Ostateczna ilosc wykresow = liczba par * liczba binow multiplicity * [liczba binow pedow + 1] (+1 bo chcemy zazwyczaj wykres bez binowania)
  const char* filterTypes[8] = {"p+", "p-","K+", "K-", "pi+", "pi-", "lambda", "lambdab"};
   const char *pair_types[numOfPairTypes] = { "PP" /*0*/, "aPaP", "PaP", "KpKp", "KmKm", "KpKm", "PIpPIp", "PImPIm", "PIpPIm", \
   "LamLam" /*9*/, "aLam_aLam", "Lam_aLam", "all" /*12*/, "plus", "minus", "mixed"};
	// 1 wlaczaja nam pary do analizy, 0 wylaczaja
  int runch[numOfPairTypes]= {0/*PP*/, 0/*aPaP*/, 0/*PaP*/, 0/*KpKp*/, 0/*KmKm*/, 0/*KpKm*/, 1,/*PIpPIp*/, 1/*PImPIm*/, 1/*PIpPIm*/,\
    0 /*"LamLam"*/, 0 /*"aLam_aLam"*/, 0 /*"Lam_aLam"*/, 0/*all*/, 0/*plus*/, 0/*minus*/, 0/*mixed*/};

  int weightSetting = 3;
  if(strlen(params)!=0)
    {
      weightSetting = atoi(strtok(params, ","));
      runktdep = atoi(strtok(NULL, ","));
      resonancecut =  atoi(strtok(NULL, ","));
      for(int ll=0; ll<numOfPairTypes; ll++)
        {
          if(ll==0) cout<<"\nSELECTED PAIRS: ";
          runch[ll]= atoi(strtok(NULL, ","));
          cout<<runch[ll];
          if(ll==numOfPairTypes-1) cout<<endl;
        }
    }
    else
    {
      runch[12]=1;
    }

  ///////////////////////////////////////////

	// TGrid::Connect("alien://");
	//  TFile *filterFile = TFile::Open(filterPath);

  ///////////////////////////////////////////
  // TH2D *filter1 = new TH2D();
  // TH2D *filter2 = new TH2D();

/************** K_T SETTINGS *************/
   const int numOfkTbins = 11;
   double kt_bins[numOfkTbins+1] = {0.0, 0.1, 0.2, 0.3, 0.4, 0.5, 0.6, 0.7, 0.8, 0.9, 1.0, 100.0};

   //  ***Reader Kinematics (Monte Carlo data)***
   AliFemtoEventReaderKinematicsChain* Reader=new AliFemtoEventReaderKinematicsChain();

/************** MANAGER *************/

   //ten maanger zbiera analizy typowe dla alifemto, tylko
   AliFemtoManager* Manager = new AliFemtoManager();
   Manager->SetEventReader(Reader);

	   AliFemtoModelWeightGeneratorLednicky *tWeight = new AliFemtoModelWeightGeneratorLednicky();
     if(weightSetting==0)
        {
          tWeight->SetDefaultCalcPar(); // Default is CoulOn, QuantumOn, StrongOn, 3BodyOff, Square, T0ApproxOff
        }
      else if(weightSetting==1)
      {
          tWeight->SetQuantumOn();
          tWeight->SetCoulOff();
          tWeight-> SetStrongOff();
          tWeight->Set3BodyOff();
          tWeight->SetSquare();
          tWeight->SetT0ApproxOff();
      }
      else if(weightSetting==2)
      {
          tWeight->SetQuantumOff();
          tWeight->SetCoulOff();
          tWeight-> SetStrongOn();
          tWeight->Set3BodyOff();
          tWeight->SetSquare();
          tWeight->SetT0ApproxOff();
      }
      else if(weightSetting==3)
      {
          tWeight->SetQuantumOff();
          tWeight->SetCoulOn();
          tWeight-> SetStrongOff();
          tWeight->Set3BodyOff();
          tWeight->SetSquare();
          tWeight->SetT0ApproxOff();
      }
      else if(weightSetting==4)
      {
          tWeight->SetQuantumOff();
          tWeight->SetCoulOff();
          tWeight-> SetStrongOff();
          tWeight->Set3BodyOn();
          tWeight->SetSquare();
          tWeight->SetT0ApproxOff();
      }
       else if(weightSetting==5)
      {
          tWeight->SetQuantumOn();
          tWeight->SetCoulOn();
          tWeight-> SetStrongOff();
          tWeight->Set3BodyOff();
          tWeight->SetSquare();
          tWeight->SetT0ApproxOff();
      }
       else if(weightSetting==6)
      {
          tWeight->SetQuantumOn();
          tWeight->SetCoulOn();
          tWeight-> SetStrongOn();
          tWeight->Set3BodyOff();
          tWeight->SetSquare();
          tWeight->SetT0ApproxOff();
      }
	    else
      {
          tWeight->SetQuantumOff();
          tWeight->SetCoulOff();
          tWeight-> SetStrongOff();
          tWeight->Set3BodyOff();
          // tWeight->SetSquare();
          tWeight->SetT0ApproxOff();
      }

	   AliFemtoModelManager *tModelManager = new AliFemtoModelManager();
	   AliFemtoModelGausRinvFreezeOutGenerator *tFreezepim = new AliFemtoModelGausRinvFreezeOutGenerator();
	   tFreezepim->SetSizeInv(2.0);
		 tModelManager->AcceptFreezeOutGenerator(tFreezepim);
		tModelManager->CreateCopyHiddenInfo(kFALSE);

/************** CREATING MONITORS AND CUTS *************/

// tzw monitory, histogramy lub wykresy ktore sa uzupelniane podczas analizy
//liczby w nawiasach to wielkosc tablicy wskaznikow
//to sa tak na prawde klasy, monitory generuja rozklady jedno-dwu-czastkowe

   AliFemtoVertexMultAnalysis      *analysis[640]; //glowna analiza, korelujemy tylko czastki ktore sa podobne w z-vertex(polozenie primary\
   vertex na osi z) i multiplicity - porownujemy tylko zderzenia ktory zaszly w podobnym miejscu i mialy podobne multiplicity
   AliFemtoBasicEventCut             *basic_event_cut[640]; //podstawowy cut na zderzenia (moga tez byc cuty na tracki i na pary czastek)
   AliFemtoCutMonitorEventMult    *cutPassEvM[640]; //standardowe do multiplicity, zwykle histogramy z liczba eventow
   AliFemtoCutMonitorEventMult    *cutFailEvM[640];
   AliFemtoCutMonitorEventVertex *cutPassEvV[640];
   AliFemtoCutMonitorEventVertex *cutFailEvV[640];
	//cut to ograniczenie na analizowane czastki, pojedyncze tracki
   AliFemtoMCTrackCut          *part1_mc_track_cut[640];
   AliFemtoMCTrackCut          *part2_mc_track_cut[640]; //nazwy niekoniecznie odpowiadaja faktycznie uzywanym detektorom
   AliFemtoMCTrackCut          *part3_mc_track_cut[640];
   //AliFemtoCutMonitorParticleYPtWithWeights *cutPass1YPtetaphitpc[640]; //monitory na pojedyncze czastki
   //AliFemtoCutMonitorParticleYPtWithWeights *cutFail1YPtetaphitpc[640];
   AliFemtoCutMonitorParticlePID *cutPass1PID[640]; //generuja wykresy PID
   AliFemtoCutMonitorParticlePID *cutFail1PID[640];
   //AliFemtoCutMonitorParticleYPtWithWeights *cutPass2YPtetaphitpc[640];
   //AliFemtoCutMonitorParticleYPtWithWeights *cutFail2YPtetaphitpc[640];
   AliFemtoCutMonitorParticlePID *cutPass2PID[640]; //generuja wykresy PID na pary
   AliFemtoCutMonitorParticlePID *cutFail2PID[640];

   AliFemtoCutMonitorParticleYPt *cutPass3YPt_normal[640]; //generuje wykresy rapidity od pedu
   AliFemtoCutMonitorParticleYPt *cutFail3YPt_normal[640];

   // AliFemtoCutMonitorParticleYPtWithWeights *cutPass3YPt[640]; //generuje wykresy rapidity od pedu
   // AliFemtoCutMonitorParticleYPtWithWeights *cutFail3YPt[640];
   // AliFemtoCutMonitorParticleYPtWithWeights *cutPass3YPtFilter[640]; //generuje wykresy rapidity od pedu
   // AliFemtoCutMonitorParticleYPtWithWeights *cutFail3YPtFilter[640];

   AliFemtoCutMonitorParticlePID *cutPass3PID[640]; //Pass - przeszly cuty, Fail - nie przeszly TRACKcutow (przeszly event cuty)
   AliFemtoCutMonitorParticlePID *cutFail3PID[640];

   //    AliFemtoShareQualityTPCEntranceSepPairCut         *antigamma_cutsame[640]; //ShareQualityPairCut - stnadardowy cut na pary czastek, \
   sprawdza jak duzo klastrow jest sharowanych przez dana pare trackow, jezeli jest ich duzo to dwie czastki sa najpewniej jedna \
   TPCEntranceSep - do sprawdzamy na wejsciu czy odleglosc miedzy trackami nie jest za mala
   //cut na pary czastek, uzywa share-quality, sprawdza czy nie mamy do czynienia z e+ i e- z kreacji par
   AliFemtoPairCutAntiGamma         *antigamma_cut[640];
   //AliFemtoPairCutRadialDistance         *antigamma_cut[640];  //tu liczy sie odlegosc katowa a nie zwykla
   //   AliFemtoChi2CorrFctn               *cchiqinvetaphitpc[640]; //?
   // AliFemtoPairCutPt                   *kt_sum_cuts[640]; //cut na sume pedow poprzecznych
   // AliFemtoQinvCorrFctn               *cQinv_kt[640]; //Qinv najbardziej podst femtoskopowa funkcja

   AliFemtoQinvCorrFctn               *cQinv[640];
   AliFemtoCorrFctnDEtaDPhi         *cDetaDphi[640];
   // AliFemtoQinvCorrFctnWithWeights               *cQinvWB[640];
   // AliFemtoCorrFctnDEtaDPhiWithWeights         *cDetaDphiWB[640];
   AliFemtoModelCorrFctn            *cQinvModel[640];
   AliFemtoModelCorrFctn            *cQinv_kt[1280];
    AliFemtoModelCorrFctnDEtaDPhiRM    *cDetaDphiModel[640];
   // AliFemtoModelCorrFctnWithWeights              *cQinvModelWithWeights[640];
   // AliFemtoModelCorrFctnDEtaDPhiWithWeights         *cDetaDphiModelWithWeights[640];
    AliFemtoPairCutPt                   *kt_sum_cuts[1280]; //cut na sume pedow poprzecznych
   AliFemtoKTPairCut              *kt_cut_bins[1280];
   AliFemtoKTPairCut              *kt_cut[1280];
      AliFemtoCutMonitorPairKT     *ktDist[640];
    AliFemtoPairCutMInv   *invmasscuts[640];

/************** MAIN PART OF ANALYSIS *************/

   	//***Delta Eta Delta Phi analysis for identified systems (chg: 0-8)***
	// wielka petla po wszystkich czastkach
	//imainloop - zmienna iteracyjna
  	int imainloop = 0;

	//petla po krotnosciach
   for (int imult = 0; imult < numOfMultBins; imult++)
   {
      if (runmults[imult])
      {
		// po typach czastek
         for (int itype = 0; itype < numOfPairTypes; itype++)
         {
            if (runch[itype]) //sprawdzamy czy dany typ czastek jest brany pod uwage do analizy
            {

                 	if(itype==0 || itype==1)
                  tWeight->SetPairType(AliFemtoModelWeightGenerator::ProtonProton());
                else if(itype==2)
                  tWeight->SetPairType(AliFemtoModelWeightGenerator::ProtonAntiproton());
                else if(itype==3 || itype ==4)
                  tWeight->SetPairType(AliFemtoModelWeightGenerator::KaonPlusKaonPlus());
                else if(itype==5)
                  tWeight->SetPairType(AliFemtoModelWeightGenerator::KaonPlusKaonMinus());
                else if(itype==6 || itype ==7)
                  tWeight->SetPairType(AliFemtoModelWeightGenerator::PionPlusPionPlus());
                else if(itype==8)
                  tWeight->SetPairType(AliFemtoModelWeightGenerator::PionPlusPionMinus());
                else if(itype==9)
                  tWeight->SetPairType(AliFemtoModelWeightGenerator::LambdaLambda());
                else if(itype==10)
                  tWeight->SetPairType(AliFemtoModelWeightGenerator::AntilambdaAntilambda());
                else if(itype==11)
                  tWeight->SetPairType(AliFemtoModelWeightGenerator::LambdaAntilambda());
                else
                   tWeight->SetPairType(AliFemtoModelWeightGenerator::PairTypeNone());

                   tModelManager->AcceptWeightGenerator(tWeight);

               imainloop = itype * numOfMultBins + imult; //struktura danych(histogramow w tablicy): PPM0, PPM1, PPM2 ... aPaPM0, aPaPM1...
               int multmix = 5; //miksujemy tylko eventy o podobnych krotnosciach
               // if(imult == 4) multmix = 30; //whole multiplicity
               analysis[imainloop] = new AliFemtoVertexMultAnalysis(10, -10.0, 10.0, multmix, multbins[imult], multbins[imult+1]); //tworzenie analizy
               analysis[imainloop]->SetNumEventsToMix(10); //zwiekszamy statystyke mianownika f korelacyjnej, okreslamy tu z ilu eventow (miksujemy)
               analysis[imainloop]->SetMinSizePartCollection(1); //przynajmniej jedna czastka musi przejsc nasze cuty
               analysis[imainloop]->SetVerboseMode(kFALSE);
				//ograniczenie na event = jedna kolizje
               //*** Event cut ***
               basic_event_cut[imainloop] = new AliFemtoBasicEventCut(); //tworzymy cut na multiplicity
               basic_event_cut[imainloop]->SetEventMult(1,100000); //cut na multiplicity dolny i gorny
            	//odcinamy zderzenie ktore dzieja sie w odleglosci wiekszej niz 10 cm od srodka detektora na osi z
               basic_event_cut[imainloop]->SetVertZPos(-10,10);//cm

               //****** event monitors **********   //najpierw tworzymy cuta, zaraz potem monitory
               cutPassEvM[imainloop] = new AliFemtoCutMonitorEventMult(Form("cutPass_%s_M%i", pair_types[itype], imult), 2000, 20000.5);
               cutFailEvM[imainloop] = new AliFemtoCutMonitorEventMult(Form("cutFail_%s_M%i", pair_types[itype], imult), 2000, 20000.5);
               basic_event_cut[imainloop]->AddCutMonitor(cutPassEvM[imainloop], cutFailEvM[imainloop]);
               //do wykresow Z-vertex
               cutPassEvV[imainloop] = new AliFemtoCutMonitorEventVertex(Form("cutPass_%s_M%i", pair_types[itype], imult));
               cutFailEvV[imainloop] = new AliFemtoCutMonitorEventVertex(Form("cutFail_%s_M%i", pair_types[itype], imult));
               basic_event_cut[imainloop]->AddCutMonitor(cutPassEvV[imainloop], cutFailEvV[imainloop]);

				//_________Cuty na poj czastki_______________________
               // ***** single particle track cuts *********
               part1_mc_track_cut[imainloop] = new AliFemtoMCTrackCut();
               part2_mc_track_cut[imainloop] = new AliFemtoMCTrackCut();
               part3_mc_track_cut[imainloop] = new AliFemtoMCTrackCut();
           		//ograniczenie na ladunek
               part1_mc_track_cut[imainloop]->SetCharge(1.0); //zostawia tylko dodatnie
               part2_mc_track_cut[imainloop]->SetCharge(-1.0);
            	//ograniczamy pseudopospiesznosc, tym wieksza im bardziej czastka leci w kierunku wiazki, 0 jesli leci prostopadle
            	//wartosci ponizej sa podyktowane geometria detektora
               part1_mc_track_cut[imainloop]->SetEta(-0.8, 0.8); //zostawia tylko w takim zakresie ety
               part2_mc_track_cut[imainloop]->SetEta(-0.8, 0.8);
               part3_mc_track_cut[imainloop]->SetEta(-0.8, 0.8);

               	//_______Cuty dla konkretnych typow czastek_________
            	//uzupelniane inne ograniczenia w zaleznosci od typu czastki
               if (itype == 0 ||itype == 1 ||itype == 2)//protons 0-2
               {
                  part1_mc_track_cut[imainloop]->SetPt(0.5,4); //Pt - ped poprzeczny
                  part2_mc_track_cut[imainloop]->SetPt(0.5,4);

                  part1_mc_track_cut[imainloop]->SetPDG(2212); //PDG - numer czastki z bookletu, tutaj okreslamy ze to sa wlasnie protony
                  part2_mc_track_cut[imainloop]->SetPDG(2212);
               }
               if (itype == 3 ||itype == 4 ||itype == 5)//kaons 3-5
               {
                  part1_mc_track_cut[imainloop]->SetPt(0.3, 4);
                  part2_mc_track_cut[imainloop]->SetPt(0.3, 4);

                  part1_mc_track_cut[imainloop]->SetPDG(321);
                  part2_mc_track_cut[imainloop]->SetPDG(321);

               }
               if (itype == 6 ||itype == 7 ||itype == 8)//pions 6-8
               {
                  part1_mc_track_cut[imainloop]->SetPt(0.2,4);
                  part2_mc_track_cut[imainloop]->SetPt(0.2,4);

                  part1_mc_track_cut[imainloop]->SetPDG(211);
                  part2_mc_track_cut[imainloop]->SetPDG(211);
                }
                if(itype == 9)  //lambdas 9-11
                {
                  part1_mc_track_cut[imainloop]->SetPt(0.7,4);
                  part1_mc_track_cut[imainloop]->SetPDG(3122);
                  part1_mc_track_cut[imainloop]->SetCharge(0.0);

                }
            	if(itype == 10)
            	{
                  part2_mc_track_cut[imainloop]->SetCharge(0.0);
                  part2_mc_track_cut[imainloop]->SetPt(0.7,4);
                  part2_mc_track_cut[imainloop]->SetPDG(-3122);

            	}
               if(itype == 11)
                {
                  part1_mc_track_cut[imainloop]->SetPt(0.7,4.0);
                  part2_mc_track_cut[imainloop]->SetPt(0.7,4.0);

                  part1_mc_track_cut[imainloop]->SetCharge(0.0);
                  part2_mc_track_cut[imainloop]->SetCharge(0.0);
                  part1_mc_track_cut[imainloop]->SetPDG(3122);
                  part2_mc_track_cut[imainloop]->SetPDG(-3122);
                }
                if (itype == 12)//all
                {
                  part3_mc_track_cut[imainloop]->SetPt(0.12,4.0);
                }
                if (itype == 13 ||itype == 14 ||itype == 15)//plus,minus,mixed
                {
                  part1_mc_track_cut[imainloop]->SetPt(0.12,4.0);
                  part2_mc_track_cut[imainloop]->SetPt(0.12,4.0);

                }

               //**************** track Monitors ***************
               //tutaj jest jak wlaczalibysmy monitory na pojedyncze czastki
               //mozna odkomentowac, powinno dzialac
               if(itype<12)
                 {
                  double mass = 0.0;
                  if(itype<3)
                     mass = ProtonMass;
                  else if(itype>=3 & itype<6)
                     mass = KaonMass;
                  else if(itype>=6 & itype<9)
                     mass = PionMass;
                  else if(itype>=9 & itype<12)
                     mass = LambdaMass;

		                cutPass3YPt_normal[imainloop] = new AliFemtoCutMonitorParticleYPt(Form("cutPass_%s_M%i", pair_types[itype], imult), mass);
	                  cutFail3YPt_normal[imainloop] = new AliFemtoCutMonitorParticleYPt(Form("cutFail_%s_M%i", pair_types[itype], imult), mass);
	                  if(itype%3 ==0 ) part1_mc_track_cut[imainloop]->AddCutMonitor(cutPass3YPt_normal[imainloop], cutFail3YPt_normal[imainloop]);
	                  else if(itype%3 == 1) part2_mc_track_cut[imainloop]->AddCutMonitor(cutPass3YPt_normal[imainloop], cutFail3YPt_normal[imainloop]);

                 }

				//_____________Cuty na pary________________________
               //******** Two - track cuts ************

               //cut below is onlyc reated to store monitor
                 kt_cut[imainloop] = new AliFemtoKTPairCut(-1.0, 100.0); //loose cut
                 ktDist[imainloop] = new AliFemtoCutMonitorPairKT(Form("ktDist_%s", pair_types[itype]), 0.0, 10.0);

                 if(resonancecut && itype == 8)
                 {
                 	// cout<<"pion resonancecut~"<<endl;
                 	invmasscuts[imainloop] = new AliFemtoPairCutMInv(PionMass, PionMass, 0.95*RhoMass, 1.05*RhoMass);
	                invmasscuts[imainloop] -> AddCutMonitor(ktDist[imainloop]);
	                analysis[imainloop] -> SetPairCut(invmasscuts[imainloop]);
             	 }
             	 else if(resonancecut && itype == 5)
                 {
                 	// cout<<"kaon resonancecut~"<<endl;
					invmasscuts[imainloop] = new AliFemtoPairCutMInv(KaonMass, KaonMass, 0.95*PhiMass, 1.05*PhiMass);
	                invmasscuts[imainloop] -> AddCutMonitor(ktDist[imainloop]);
	                analysis[imainloop] -> SetPairCut(invmasscuts[imainloop]);
             	 }
             	 else  analysis[imainloop] -> SetPairCut(kt_cut[imainloop]);

               if(itype >= 12)
               	{
               		//wyciecie par elektron pozyton
	              	antigamma_cut[imainloop] = new AliFemtoPairCutAntiGamma();
	                antigamma_cut[imainloop]->SetDataType(AliFemtoPairCut::kKine); //kinematics
               		analysis[imainloop]->SetPairCut(antigamma_cut[imainloop]);
               	}

               analysis[imainloop]->SetEnablePairMonitors(kTRUE);

               //_____________Cuty na eventy______________________
               //***** Setting cuts ***********
               // setting event cut
               analysis[imainloop]->SetEventCut(basic_event_cut[imainloop]);

               //setting single track cuts
               if(itype==0 || itype==3 || itype==6) //positive like-sign
               {
                  analysis[imainloop]->SetFirstParticleCut(part1_mc_track_cut[imainloop]);
                  analysis[imainloop]->SetSecondParticleCut(part1_mc_track_cut[imainloop]);
               }
               if(itype==1 || itype==4 || itype==7)//negative like-sign
               {
                  analysis[imainloop]->SetFirstParticleCut(part2_mc_track_cut[imainloop]);
                  analysis[imainloop]->SetSecondParticleCut(part2_mc_track_cut[imainloop]);
               }
               if(itype==2 || itype==5 || itype==8)//unlike-sign
               {
                  analysis[imainloop]->SetFirstParticleCut(part1_mc_track_cut[imainloop]);
                  analysis[imainloop]->SetSecondParticleCut(part2_mc_track_cut[imainloop]);
               }
  	           if(itype == 9)
  	            {
  	            	analysis[imainloop]->SetFirstParticleCut(part1_mc_track_cut[imainloop]);
                    analysis[imainloop]->SetSecondParticleCut(part1_mc_track_cut[imainloop]);
  	            }
  	            if(itype == 10)
                 {
                    analysis[imainloop]->SetFirstParticleCut(part2_mc_track_cut[imainloop]);
                    analysis[imainloop]->SetSecondParticleCut(part2_mc_track_cut[imainloop]);
                 }
                 if(itype == 11)
  	            {
  	            	analysis[imainloop]->SetFirstParticleCut(part1_mc_track_cut[imainloop]);
                    analysis[imainloop]->SetSecondParticleCut(part2_mc_track_cut[imainloop]);
  	            }
      				  if(itype==12) //all
      	           	{
      					  analysis[imainloop]->SetFirstParticleCut(part3_mc_track_cut[imainloop]);
      					  analysis[imainloop]->SetSecondParticleCut(part3_mc_track_cut[imainloop]);
      	           	}
      	           if(itype==13) //positive like-sign
         				{
         					analysis[imainloop]->SetFirstParticleCut(part1_mc_track_cut[imainloop]);
         					analysis[imainloop]->SetSecondParticleCut(part1_mc_track_cut[imainloop]);
         				}
      				  if(itype==14)//negative like-sign
         				{
         					analysis[imainloop]->SetFirstParticleCut(part2_mc_track_cut[imainloop]);
         					analysis[imainloop]->SetSecondParticleCut(part2_mc_track_cut[imainloop]);
         				}
         				if(itype==15)//unlike-sign
         				{
         					analysis[imainloop]->SetFirstParticleCut(part1_mc_track_cut[imainloop]);
         					analysis[imainloop]->SetSecondParticleCut(part2_mc_track_cut[imainloop]);
         				}

               cQinvModel[imainloop] = new AliFemtoModelCorrFctn(Form("cQinv_Model_%s_M%i", pair_types[itype], imult), 20, 0, 2); //sprawdzic, czy wart arg sa ok
               if(resonancecut && (itype==8 || itype==5)) cQinvModel[imainloop]->SetPairSelectionCut(invmasscuts[imainloop]);
               cQinvModel[imainloop] -> ConnectToManager(tModelManager);
               analysis[imainloop]->AddCorrFctn(cQinvModel[imainloop]);
               // cQinvModel[imainloop]->Report();

               cDetaDphiModel[imainloop] = new AliFemtoModelCorrFctnDEtaDPhiRM(Form("cdedp_Model_%s_M%i", pair_types[itype], imult), 35, 35, PionMass, PionMass);
               if(resonancecut && (itype==8 || itype==5)) cDetaDphiModel[imainloop]->SetPairSelectionCut(invmasscuts[imainloop]);
               cDetaDphiModel[imainloop] -> ConnectToManager(tModelManager);
               analysis[imainloop]->AddCorrFctn(cDetaDphiModel[imainloop]);

                if (runktdep)
               {
                  int ktm;
                  for (int ikt=0; ikt<numOfkTbins; ikt++)
                  {
                     ktm = imainloop * numOfkTbins + ikt;
                      kt_cut_bins[ktm] = new AliFemtoKTPairCut(kt_bins[ikt], kt_bins[ikt+1]);
                      ktDist[ktm] = new AliFemtoCutMonitorPairKT(Form("ktDist_%s", pair_types[itype]), kt_bins[ikt], kt_bins[ikt+1]);
                      kt_cut_bins[ktm] -> AddCutMonitor(ktDist[ktm]);

                     cQinv_kt[ktm] = new AliFemtoModelCorrFctn(Form("cQinv_Model_%s_M%i_kT%i", pair_types[itype], imult, ikt), 20, 0, 2);
                     cQinv_kt[ktm]->SetPairSelectionCut(kt_cut_bins[ktm]);
                     cQinv_kt[ktm]->ConnectToManager(tModelManager);
                     analysis[imainloop]->AddCorrFctn(cQinv_kt[ktm]);
                  }
               }

               Manager->AddAnalysis(analysis[imainloop]);
            }
         }
      }
   }
   return Manager;
}


text:
import {Validators} from '@sanity/types'
import genericValidator from './genericValidator'

const DUMMY_ORIGIN = 'http://sanity'
const emailRegex = /^(([^<>()[\]\\.,;:\s@"]+(\.[^<>()[\]\\.,;:\s@"]+)*)|(".+"))@((\[[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}])|(([a-zA-Z\-0-9]+\.)+[a-zA-Z]{2,}))$/
const isRelativeUrl = (url: string) => /^\.*\//.test(url)

const stringValidators: Validators = {
  ...genericValidator,

  min: (minLength, value, message) => {
    if (!value || value.length >= minLength) {
      return true
    }

    return message || `Must be at least ${minLength} characters long`
  },

  max: (maxLength, value, message) => {
    if (!value || value.length <= maxLength) {
      return true
    }

    return message || `Must be at most ${maxLength} characters long`
  },

  length: (wantedLength, value, message) => {
    const strValue = value || ''
    if (strValue.length === wantedLength) {
      return true
    }

    return message || `Must be exactly ${wantedLength} characters long`
  },

  uri: (constraints, value, message) => {
    const strValue = value || ''
    const {options} = constraints
    const {allowCredentials, relativeOnly} = options
    const allowRelative = options.allowRelative || relativeOnly

    let url
    try {
      // WARNING: Safari checks for a given `base` param by looking at the length of arguments passed
      // to new URL(str, base), and will fail if invoked with new URL(strValue, undefined)
      url = allowRelative ? new URL(strValue, DUMMY_ORIGIN) : new URL(strValue)
    } catch (err) {
      return message || 'Not a valid URL'
    }

    if (relativeOnly && url.origin !== DUMMY_ORIGIN) {
      return message || 'Only relative URLs are allowed'
    }

    if (!allowRelative && url.origin === DUMMY_ORIGIN && isRelativeUrl(strValue)) {
      return message || 'Relative URLs are not allowed'
    }

    if (!allowCredentials && (url.username || url.password)) {
      return message || `Username/password not allowed`
    }

    const urlScheme = url.protocol.replace(/:$/, '')
    const matchesAllowedScheme = options.scheme.some((scheme) => scheme.test(urlScheme))
    if (!matchesAllowedScheme) {
      return message || 'Does not match allowed protocols/schemes'
    }

    return true
  },

  stringCasing: (casing, value, message) => {
    const strValue = value || ''
    if (casing === 'uppercase' && strValue !== strValue.toLocaleUpperCase()) {
      return message || `Must be all uppercase letters`
    }

    if (casing === 'lowercase' && strValue !== strValue.toLocaleLowerCase()) {
      return message || `Must be all lowercase letters`
    }

    return true
  },

  presence: (flag, value, message) => {
    if (flag === 'required' && !value) {
      return message || 'Required'
    }

    return true
  },

  regex: (options, value, message) => {
    const {pattern, name, invert} = options
    const regName = name || `"${pattern.toString()}"`
    const strValue = value || ''
    const matches = pattern.test(strValue)
    if ((!invert && !matches) || (invert && matches)) {
      const defaultMessage = invert
        ? `Should not match ${regName}-pattern`
        : `Does not match ${regName}-pattern`

      return message || defaultMessage
    }

    return true
  },

  email: (_unused, value, message) => {
    const strValue = `${value || ''}`.trim()
    if (!strValue || emailRegex.test(strValue)) {
      return true
    }

    return message || 'Must be a valid email address'
  },
}

export default stringValidators


text:
'use strict';

var allLightsOn = require('./lib/allLightsOn');

allLightsOn();

    //strip.color('rgb(5, 3, 0)'); // sets strip to green using rgb values
    //strip.show();


text:
namespace NPOI.HSSF.Record
{
    using System;
    using System.Text;
    using NPOI.Util;

    /**
     * Title:        Unknown Record (for debugging)
     * Description:  Unknown record just tells you the sid so you can figure out
     *               what records you are missing.  Also helps us Read/modify sheets we
     *               don't know all the records to.  (HSSF leaves these alone!)
     * Company:      SuperLink Software, Inc.
     * @author Andrew C. Oliver (acoliver at apache dot org)
     * @author Jason Height (jheight at chariot dot net dot au)
     * @author Glen Stampoultzis (glens at apache.org)
     */

    internal class UnknownRecord : StandardRecord
    {
        public const int PRINTSIZE_0033       = 0x0033;
        /*
     * Some Record IDs used by POI as 'milestones' in the record stream
     */
        public const int PLS_004D = 0x004D;
        public const int SHEETPR_0081 = 0x0081;
        public const int SORT_0090            = 0x0090;
        public const int STANDARDWIDTH_0099 = 0x0099;
        public const int SCL_00A0 = 0x00A0;
        public const int BITMAP_00E9 = 0x00E9;
        public const int PHONETICPR_00EF = 0x00EF;
        public const int LABELRANGES_015F = 0x015F;
      	//public const int USERSVIEWBEGIN_01AA  = 0x01AA;
    	//public const int USERSVIEWEND_01AB    = 0x01AB;
        public const int QUICKTIP_0800 = 0x0800;
        //public const int SHEETEXT_0862 = 0x0862; // OOO calls this SHEETLAYOUT
        public const int SHEETPROTECTION_0867 = 0x0867;
        //public const int RANGEPROTECTION_0868 = 0x0868;
        public const int HEADER_FOOTER_089C   = 0x089C;
        public const int CODENAME_1BA = 0x01BA;
        private int _sid = 0;
        private byte[] _rawData = null;

        //public UnknownRecord()
        //{
        //}

        /**
         * @param id    id of the record -not Validated, just stored for serialization
         * @param data  the data
         */
        public UnknownRecord(int id, byte[] data)
        {
            _sid = id & 0xFFFF;
            _rawData = data;
        }

        /**
         * construct an Unknown record.  No fields are interperated and the record will
         * be Serialized in its original form more or less
         * @param in the RecordInputstream to Read the record from
         */

        public UnknownRecord(RecordInputStream in1)
        {
            _sid = in1.Sid;
            _rawData = in1.ReadRemainder();

            //if (false && GetBiffName(_sid) == null)
            //{
            //    // unknown sids in the range 0x0004-0x0013 are probably 'sub-records' of ObjectRecord
            //    // those sids are in a different number space.
            //    // TODO - put unknown OBJ sub-records in a different class
            //    System.Console.WriteLine("Unknown record 0x" + _sid.ToString("X"));
            //}
        }

	/**
	 * spit the record out AS IS. no interpretation or identification
	 */
        public override void Serialize(ILittleEndianOutput out1)
        {
            out1.Write(_rawData);
        }
        protected override int DataSize
        {
            get
            {
                return _rawData.Length;
            }
        }

        /**
         * print a sort of string representation ([UNKNOWN RECORD] id = x [/UNKNOWN RECORD])
         */

        public override String ToString()
        {
            String biffName = GetBiffName(_sid);
            if (biffName == null)
            {
                biffName = "UNKNOWNRECORD";
            }
            StringBuilder sb = new StringBuilder();

            sb.Append("[").Append(biffName).Append("] (0x");
            sb.Append(StringUtil.ToHexString(_sid).ToUpper() + ")\n");
            if (_rawData.Length > 0)
            {
                sb.Append("  rawData=").Append(HexDump.ToHex(_rawData)).Append("\n");
            }
            sb.Append("[/").Append(biffName).Append("]\n");
            return sb.ToString();

        }

        /**
 * These BIFF record types are known but still uninterpreted by POI
 *
 * @return the documented name of this BIFF record type, null if unknown to POI
 */
        public static String GetBiffName(int sid)
        {
            // Note to POI developers:
            // Make sure you delete the corresponding entry from
            // this method any time a new Record subclass is created.
            switch (sid)
            {
                case PRINTSIZE_0033: return "PRINTSIZE";
                case PLS_004D: return "PLS";
                case 0x0050: return "DCON"; // Data Consolidation Information
                case 0x007F: return "IMDATA";
                case SHEETPR_0081: return "SHEETPR";
                case SORT_0090: return "SORT"; // Sorting Options
                case 0x0094: return "LHRECORD"; // .WK? File Conversion Information
                case STANDARDWIDTH_0099: return "STANDARDWIDTH"; //Standard Column Width
                case 0x009D: return "AUTOFILTERINFO"; // Drop-Down Arrow Count
                case SCL_00A0: return "SCL"; // Window Zoom Magnification
                case 0x00AE: return "SCENMAN"; // Scenario Output Data

                case 0x00B2: return "SXVI";        // (pivot table) View Item
                case 0x00B4: return "SXIVD";       // (pivot table) Row/Column Field IDs
                case 0x00B5: return "SXLI";        // (pivot table) Line Item Array

                case 0x00D3: return "OBPROJ";
                case 0x00DC: return "PARAMQRY";
                case 0x00DE: return "OLESIZE";
                case BITMAP_00E9: return "BITMAP";
                case PHONETICPR_00EF: return "PHONETICPR";
                case 0x00F1: return "SXEX";        // PivotTable View Extended Information

                case LABELRANGES_015F: return "LABELRANGES";
                case 0x01BA: return "CODENAME";
                case 0x01A9: return "USERBVIEW";
                case 0x01AD: return "QSI";

                case 0x01C0: return "EXCEL9FILE";

                case 0x0802: return "QSISXTAG";   // Pivot Table and Query Table Extensions
                case 0x0803: return "DBQUERYEXT";
                case 0x0805: return "TXTQUERY";
                case 0x0810: return "SXVIEWEX9";  // Pivot Table Extensions

                case 0x0812: return "CONTINUEFRT";
                case QUICKTIP_0800: return "QUICKTIP";
                //case SHEETEXT_0862: return "SHEETEXT";
                case 0x0863: return "BOOKEXT";
                case 0x0864: return "SXADDL";    // Pivot Table Additional Info
                case SHEETPROTECTION_0867: return "SHEETPROTECTION";
                //case RANGEPROTECTION_0868: return "RANGEPROTECTION";
                case 0x086B: return "DATALABEXTCONTENTS";
                case 0x086C: return "CELLWATCH";
                case 0x0874: return "DROPDOWNOBJIDS";
                case 0x0876: return "DCONN";
                case 0x087B: return "CFEX";
                case 0x087C: return "XFCRC";
                case 0x087D: return "XFEXT";
                case 0x087F: return "CONTINUEFRT12";
                case 0x088B: return "PLV";
                case 0x088C: return "COMPAT12";
                case 0x088D: return "DXF";
                case 0x0892: return "STYLEEXT";
                case 0x0896: return "THEME";
                case 0x0897: return "GUIDTYPELIB";
                case 0x089A: return "MTRSETTINGS";
                case 0x089B: return "COMPRESSPICTURES";
                case HEADER_FOOTER_089C: return "HEADERFOOTER";
                case 0x08A1: return "SHAPEPROPSSTREAM";
                case 0x08A3: return "FORCEFULLCALCULATION";
                case 0x08A4: return "SHAPEPROPSSTREAM";
                case 0x08A5: return "TEXTPROPSSTREAM";
                case 0x08A6: return "RICHTEXTSTREAM";

                case 0x08C8: return "PLV{Mac Excel}";

            }
            if (IsObservedButUnknown(sid))
            {
                return "UNKNOWN-" + StringUtil.ToHexString(sid).ToUpper();
            }

            return null;
        }
        /**
 * @return <c>true</c> if the unknown record id has been observed in POI unit tests
 */
        private static bool IsObservedButUnknown(int sid)
        {
            switch (sid)
            {
                case 0x0033:
                // contains 2 bytes of data: 0x0001 or 0x0003
                case 0x0034:
                // Seems to be written by MSAccess
                // contains text "[Microsoft JET Created Table]0021010"
                // appears after last cell value record and before WINDOW2
                case 0x01BD:
                case 0x01C2:
                // Written by Excel 2007
                // rawData is multiple of 12 bytes long
                // appears after last cell value record and before WINDOW2 or drawing records
                case 0x089D:
                case 0x089E:
                case 0x08A7:

                case 0x1001:
                case 0x1006:
                case 0x1007:
                case 0x1009:
                case 0x100A:
                case 0x100B:
                case 0x100C:
                case 0x1014:
                case 0x1017:
                case 0x1018:
                case 0x1019:
                case 0x101A:
                case 0x101B:
                case 0x101D:
                case 0x101E:
                case 0x101F:
                case 0x1020:
                case 0x1021:
                case 0x1022:
                case 0x1024:
                case 0x1025:
                case 0x1026:
                case 0x1027:
                case 0x1032:
                case 0x1033:
                case 0x1034:
                case 0x1035:
                case 0x103A:
                case 0x1041:
                case 0x1043:
                case 0x1044:
                case 0x1045:
                case 0x1046:
                case 0x104A:
                case 0x104B:
                case 0x104E:
                case 0x104F:
                case 0x1051:
                case 0x105C:
                case 0x105D:
                case 0x105F:
                case 0x1060:
                case 0x1062:
                case 0x1063:
                case 0x1064:
                case 0x1065:
                case 0x1066:
                    return true;
            }
            return false;
        }

        public override short Sid
        {
            get { return (short)_sid; }
        }

        /** Unlike the other Record.Clone methods this Is a shallow Clone*/
        public override Object Clone()
        {
            //UnknownRecord rec = new UnknownRecord();
            //rec._sid= _sid;
            //rec._rawData = _rawData;
            //return rec;

            // immutable - ok to return this
            return this;
        }
    }
}


text:
<!DOCTYPE html>

    <meta charset="utf-8">
    <meta http-equiv="Cache-control" content="no-store">
    <meta http-equiv="Cache-control" content="max-age=1209600">
    <meta name="viewport" content="width=device-width, initial-scale=1">
    <meta name="description" content="GitHub portfolio site - web development">
    <meta name="author" content="Cliff Sanchez">
    <title>Cliff Sanchez: Portfolio</title>

    <link href="css/print.css" rel="stylesheet" media="print">

Cliff Sanchez
Front-End Web Developer

        Front-end web development is my passion!! This is a template for a simple portfolio. I decided to use it to showcase a few Udacity courses I've taken and some teaching work, but you can use it to showcase any kind of project that you want the world to see :)
 Contact me: kenshinmax@gmail.com

            Build Your Own 2048!

I made my own version of 2048. How cool is that!?

            Website Performance Optimization

Hey... this class looks familiar.

            Mobile Web Development

Making mobile apps isn't so hard after all.

            Cam's Pizzeria

Who wants a performant pizza?

© Web Performance 2014


text:
package controllers;

import play.*;
import play.mvc.*;
import com.atsid.play.controllers.CrudController;
import models.Task;

import views.html.*;

public class Application extends CrudController<Task> {

    Application () {
        super(Task.class);
    }

    public static Result index() {
        return ok(index.render("Your new applicaton is ready."));
    }

}


text:
package org.wallet.viewsystem.swing.action;

import java.awt.event.ActionEvent;

import javax.swing.AbstractAction;
import javax.swing.Action;

import org.wallet.controller.Controller;
import org.wallet.controller.worldcoin.WorldcoinController;
import org.wallet.model.worldcoin.WalletBusyListener;
import org.wallet.utils.ImageLoader;
import org.wallet.viewsystem.View;
import org.wallet.viewsystem.swing.view.panels.HelpContentsPanel;

/**
 * This {@link Action} represents a localised WorldcoinWallet action that just displays a view
 * and is a WalletChangeListener
 */
public class WorldcoinWalletBusyAction extends AbstractAction implements WalletBusyListener {

    private static final long serialVersionUID = 191948235465057705L;

    private final Controller controller;
    private final WorldcoinController worldcoinController;

    private View viewToDisplay;
    private String tooltipKey;

    /**
     * Creates a new {@link WorldcoinWalletAction}.
     * @param controller The Controller
     * @param imagePath The relative path to the image to load for the item. Usually an imageLoader constant
     * @param textKey The localisation key for the text of the action
     * @param tooltipKey The localisation key for the tooltip of the action
     * @param mnemonicKey The localisation key for the mnemonic of the action
     * @param viewToDisplay The view to display on action activation.  One of the View constants
     */
    public WorldcoinWalletBusyAction(WorldcoinController worldcoinController, String imagePath, String textKey, String tooltipKey, String mnemonicKey, View viewToDisplay) {
        super(textKey == null ? "" : worldcoinController.getLocaliser().getString(textKey), ImageLoader.createImageIcon(imagePath));

        this.worldcoinController = worldcoinController;
        this.controller = this.worldcoinController;

        this.viewToDisplay = viewToDisplay;
        this.tooltipKey = tooltipKey;

        MnemonicUtil mnemonicUtil = new MnemonicUtil(controller.getLocaliser());
        putValue(SHORT_DESCRIPTION, HelpContentsPanel.createTooltipTextForMenuItem(controller.getLocaliser().getString(tooltipKey)));
        putValue(MNEMONIC_KEY, mnemonicUtil.getMnemonic(mnemonicKey));

        this.worldcoinController.registerWalletBusyListener(this);
    }

    /**
     * Display the view specified.
     */
    @Override
    public void actionPerformed(ActionEvent e) {
        controller.displayView(viewToDisplay);
    }

    @Override
    public void walletBusyChange(boolean newWalletIsBusy) {
        // Update the tooltip to match the wallet busy status.
        // Enable/ disable is done by WorldcoinWalletFrame.
        if (newWalletIsBusy) {
            // WorldcoinWallet is busy with another operation that may change the private keys - Action is disabled.
            putValue(SHORT_DESCRIPTION, controller.getLocaliser().getString("worldcoinWalletSubmitAction.walletIsBusy",
                    new Object[]{controller.getLocaliser().getString(this.worldcoinController.getModel().getActivePerWalletModelData().getBusyTaskKey())}));
        } else {
            // Enable unless wallet has been modified by another process.
            if (!this.worldcoinController.getModel().getActivePerWalletModelData().isFilesHaveBeenChangedByAnotherProcess()) {
                putValue(SHORT_DESCRIPTION, controller.getLocaliser().getString(tooltipKey));
            }
        }
    }
}


text:
var RequestBodyRawEditor = Backbone.View.extend({
    initialize: function() {
        var model = this.model;
        var view = this;
        var body = this.model.get("body");

        body.on("change:data", this.onChangeBodyData, this);
        model.on("change:headers", this.onChangeHeaders, this);
    },

    onChangeHeaders: function() {
        var body = this.model.get("body");

        //Set raw body editor value if Content-Type is present
        var contentType = this.model.getHeaderValue("Content-Type");
        var editorMode = "text";
        var language = "text";

        if (contentType) {
            if (contentType.search(/json/i) !== -1 || contentType.search(/javascript/i) !== -1) {
                editorMode = 'javascript';
                language = contentType;
            }
            else if (contentType.search(/xml/i) !== -1) {
                editorMode = 'xml';
                language = contentType;
            }
            else if (contentType.search(/html/i) !== -1) {
                editorMode = 'xml';
                language = contentType;
            }
            else {
                editorMode = 'text';
                language = 'text';
            }
        }

        body.set("editorMode", editorMode);
        body.set("language", language);

        this.setEditorMode(editorMode, language, false);
    },

    onChangeBodyData: function() {
        var body = this.model.get("body");
        var mode = body.get("dataMode");
        var asObjects = body.get("asObjects");
        var data = body.get("data");
        var language = body.get("language");
        var editorMode = body.get("editorMode");

        if (mode === "raw") {
            if (data) {
                this.loadRawData(data);
            }
            else {
                this.loadRawData("");
            }
        }
        else {
            this.loadRawData("");
        }
    },

    initCodeMirrorEditor:function () {
        var model = this.model;
        var view = this;
        var body = this.model.get("body");
        var editorMode = body.get("editorMode");

        body.set("isEditorInitialized", true);

        var bodyTextarea = document.getElementById("body");
        var codeMirror = CodeMirror.fromTextArea(bodyTextarea,
        {
            mode:"htmlmixed",
            lineWrapping: true,
            lineNumbers:true,
            theme:'eclipse'
        });

        body.set("codeMirror", codeMirror);

        $("#request .CodeMirror").resizable({
            stop: function() { codeMirror.refresh(); },
            resize: function(event, ui) {
                ui.size.width = ui.originalSize.width;
                $(".CodeMirror-scroll").height($(this).height());
                codeMirror.refresh();
            }
        });

        if (editorMode) {
            if (editorMode === "javascript") {
                codeMirror.setOption("mode", {"name":"javascript", "json":true});
            }
            else {
                codeMirror.setOption("mode", editorMode);
            }

            if (editorMode === "text") {
                $('#body-editor-mode-selector-format').addClass('disabled');
            } else {
                $('#body-editor-mode-selector-format').removeClass('disabled');
            }
        }

        $("#request .CodeMirror-scroll").css("height", "200px");
        codeMirror.refresh();
    },

    setEditorMode:function (mode, language, toSetHeader) {
        var model = this.model;
        var body = model.get("body");
        var codeMirror = body.get("codeMirror");
        var isEditorInitialized = body.get("isEditorInitialized");

        var displayMode = $("#body-editor-mode-selector a[data-language='" + language + "']").html();

        $('#body-editor-mode-item-selected').html(displayMode);

        if (isEditorInitialized) {
            if (mode === "javascript") {
                codeMirror.setOption("mode", {"name":"javascript", "json":true});
            }
            else {
                codeMirror.setOption("mode", mode);
            }

            if (mode === "text") {
                $('#body-editor-mode-selector-format').addClass('disabled');
            } else {
                $('#body-editor-mode-selector-format').removeClass('disabled');
            }

            if (toSetHeader) {
                model.setHeader("Content-Type", language);
            }

            codeMirror.refresh();
        }
    },

    autoFormatEditor:function (mode) {
        var model = this.model;
        var view = this;
        var body = model.get("body");
        var isEditorInitialized = body.get("isEditorInitialized");
        var codeMirror = body.get("codeMirror");

        var content = codeMirror.getValue(),
        validated = null, result = null;

        $('#body-editor-mode-selector-format-result').empty().hide();

        if (isEditorInitialized) {
            // In case its a JSON then just properly stringify it.
            // CodeMirror does not work well with pure JSON format.
            if (mode === 'javascript') {

                // Validate code first.
                try {
                    validated = pm.jsonlint.instance.parse(content);
                    if (validated) {
                        content = JSON.parse(codeMirror.getValue());
                        codeMirror.setValue(JSON.stringify(content, null, 4));
                    }
                } catch(e) {
                    result = e.message;
                    // Show jslint result.
                    // We could also highlight the line with error here.
                    $('#body-editor-mode-selector-format-result').html(result).show();
                }
            } else { // Otherwise use internal CodeMirror.autoFormatRage method for a specific mode.
                var totalLines = codeMirror.lineCount(),
                totalChars = codeMirror.getValue().length;

                codeMirror.autoFormatRange(
                    {line: 0, ch: 0},
                    {line: totalLines - 1, ch: codeMirror.getLine(totalLines - 1).length}
                );
            }
        }
    },

    loadRawData:function (data) {
        var body = this.model.get("body");
        var isEditorInitialized = body.get("isEditorInitialized");
        var codeMirror = body.get("codeMirror");

        if (isEditorInitialized === true) {
            if (data) {
                codeMirror.setValue(data);
            }
            else {
                codeMirror.setValue("");
            }

            codeMirror.refresh();
        }
    },

    getRawData:function () {
        var model = this.model;
        var body = model.get("body");
        var isEditorInitialized = body.get("isEditorInitialized");
        var codeMirror = body.get("codeMirror");

        if (isEditorInitialized) {
            var data = codeMirror.getValue();

            if (pm.settings.getSetting("forceWindowsLineEndings") === true) {
                data = data.replace(/\r/g, '');
                data = data.replace(/\n/g, "\r\n");
            }

            return data;
        }
        else {
            return "";
        }
    }
});


text:
package client.gui;

import java.awt.GraphicsEnvironment;

import javax.swing.SwingUtilities;
import javax.swing.UIManager;

import common.Config;
import common.Logger;

import client.ClientExecutor;
import client.CriticalFailureHandler;
import client.gui.SingleInstanceDetector.InstanceNotifiable;
import client.indexnode.downloadcontroller.DownloadController;
import client.platform.Platform;
import client.platform.ClientConfigDefaults.CK;
import client.shareserver.ShareServer;

/**
 * The root of the gui, provides access to gui elements (such as dialogs for errors and autoupdate)
 * Non-main elements of the gui can be triggered even if the main element is disabled or broken.
 * (non-main elements are in the Notifications class)
 *
 * @author gary
 */
public class Gui {

	private class NewInstanceDetector implements InstanceNotifiable {
		@Override
		public void newInstanceStarted() {
			Logger.log("A new instance of FS2 attempted to start, unhiding the main window.");
			mainFrame.setVisible(true);
		}
	}

	SingleInstanceDetector sid = new SingleInstanceDetector();
	MainFrame mainFrame;
	Config conf;
	Notifications notify;
	ShareServer ssvr;
	Utilities util = new Utilities();
	DownloadController dc;

	public Utilities getUtil() {
		return util;
	}

	public Config getConf() {
		return conf;
	}

	/**
	 * Returns the shareserver this gui is attached to.
	 */
	public ShareServer getShareServer(){
		return ssvr;
	}

	/**
	 * Returns the download controller this gui is attached to.
	 * @return
	 */
	public DownloadController getDc() {
		return dc;
	}

	//Hide the constructor.
	private Gui(Config conf, Notifications notify, ShareServer ssvr, DownloadController dc) {
		this.conf = conf;
		this.notify = notify;
		this.ssvr = ssvr;

		this.dc = dc;

		sid.addNotifiable(new NewInstanceDetector());
		mainFrame = new MainFrame(this);

		Platform.performGuiVisibleOSHacks(this);

		notify.launchComplete();
	}

	/**
	 * Starts the Gui if it can, and returns the new gui object.
	 */
	public static void startGUI(final Config conf, final Notifications notify, final ShareServer ssvr) {
		//Must start GIU in AWT thread!
		if (System.getProperty("headless")==null) {
			notify.incrementLaunchProgress("Loading download queue...");
			final DownloadController dc = new DownloadController(ssvr);
			notify.incrementLaunchProgress("Starting user interface...");
			SwingUtilities.invokeLater(new Runnable() {
				@Override
				public void run() {
					try {
						ClientExecutor.setGui(new Gui(conf, notify, ssvr, dc));
					} catch (Exception e) {
						CriticalFailureHandler.criticalException(e);
					}
				}
			});
		}
	}

	/**
	 * Triggers a shutdown of the FS2 application.
	 *
	 * Returns false, for compatibility with OS X 'Quit' menu hook.
	 *
	 * @return
	 */
	public boolean triggerShutdown() {
		Thread notInSwing = new Thread(new Runnable() {
			@Override
			public void run() {
				ClientExecutor.shutdown();
			}
		}, "Shutdowner");
		notInSwing.setDaemon(false);
		notInSwing.start();
		return false;
	}

	/**
	 * Terminates the gui gracefully...
	 * @param endGame specifies if the JVM is fully going down.
	 * This is so that we can avoid killing swing-bits during a real shutdown as AWT is busy doing that already. (and will cause a deadlock if we both do)
	 */
	public void shutdown(boolean endGame) {
		sid.shutdown();

		mainFrame.setVisible(false);
		//very important!:

		notify.shutdownProgress("Saving the download queue...");
		dc.shutdown();

		notify.shutdownProgress("Saving GUI state...");
		mainFrame.shutdown(endGame);
	}

	public static void setStartupLaF(Config conf) {
		if (GraphicsEnvironment.isHeadless()) return;
		if (!conf.getString(CK.LOOK_AND_FEEL).equals("")) {
			try {
				UIManager.setLookAndFeel(conf.getString(CK.LOOK_AND_FEEL));
			} catch (Exception e) {
				Logger.warn("Your configuration file contains an invalid look and feel specification: "+e);
			}
		}
	}

	void setLaF(String newLaF) {
		try {
			UIManager.setLookAndFeel(newLaF);
			SwingUtilities.updateComponentTreeUI(mainFrame);
			conf.putString(CK.LOOK_AND_FEEL, newLaF);
			mainFrame.setStatusHint("Look and Feel applied!");
			mainFrame.pack();
			mainFrame.setConfiguredBounds();
		} catch (Exception e) {
			mainFrame.setStatusHint("Can't set that Look and Feel!");
			Logger.warn("Couldn't set system look and feel.");
			Logger.log(e);
		}
	}

	/**
	 * Displays the main window, even if hidden.
	 */
	public void showFS2() {
		if (!ClientExecutor.shuttingDown) mainFrame.setVisible(true);
	}

	public void disableTrayIcon() {
		mainFrame.trayicon.shutdown();
	}
}