text:
package utils;

import java.io.UnsupportedEncodingException;
import java.nio.charset.Charset;
import java.util.Collection;
import java.util.LinkedList;
import java.util.List;

public class Strings {
	public static boolean isChineseCharacter(char c) {
		Character.UnicodeBlock ub = Character.UnicodeBlock.of(c);

		return ((ub == Character.UnicodeBlock.CJK_UNIFIED_IDEOGRAPHS) || (ub == Character.UnicodeBlock.CJK_COMPATIBILITY_IDEOGRAPHS)
				|| (ub == Character.UnicodeBlock.CJK_UNIFIED_IDEOGRAPHS_EXTENSION_A) || (ub == Character.UnicodeBlock.CJK_UNIFIED_IDEOGRAPHS_EXTENSION_B)
				|| (ub == Character.UnicodeBlock.CJK_SYMBOLS_AND_PUNCTUATION) || (ub == Character.UnicodeBlock.HALFWIDTH_AND_FULLWIDTH_FORMS)
				|| (ub == Character.UnicodeBlock.GENERAL_PUNCTUATION));
	}

	public static boolean isFullWidthCharacter(char c) {
		if ((c == 12288) || ((c > 65280) && (c < 65375))) {
			return true;
		}

		if (isChineseCharacter(c)) {
			return true;
		}

		return ((c >= 12352) && (c <= 12543));
	}

	public static char toHalfWidthCharacter(char c) {
		if (c == 12288)
			return ' ';
		if ((c > 65280) && (c < 65375)) {
			return (char) (c - 65248);
		}
		return c;
	}

	public static String toHalfWidthString(CharSequence str) {
		StringBuilder sb = new StringBuilder();
		for (int i = 0; i < str.length(); ++i) {
			sb.append(toHalfWidthCharacter(str.charAt(i)));
		}
		return sb.toString();
	}

	public static boolean isFullWidthString(CharSequence str) {
		return (charLength(str) == str.length() * 2);
	}

	public static boolean isHalfWidthString(CharSequence str) {
		return (charLength(str) == str.length());
	}

	public static int charLength(CharSequence str) {
		int clength = 0;
		for (int i = 0; i < str.length(); ++i) {
			clength += ((isFullWidthCharacter(str.charAt(i))) ? 2 : 1);
		}
		return clength;
	}

	public static String dup(CharSequence cs, int num) {
		if ((isEmpty(cs)) || (num <= 0))
			return "";
		StringBuilder sb = new StringBuilder(cs.length() * num);
		for (int i = 0; i < num; ++i)
			sb.append(cs);
		return sb.toString();
	}

	public static String dup(char c, int num) {
		if ((c == 0) || (num < 1))
			return "";
		StringBuilder sb = new StringBuilder(num);
		for (int i = 0; i < num; ++i)
			sb.append(c);
		return sb.toString();
	}

	public static String capitalize(CharSequence s) {
		return upperFirst(s);
	}

	public static String lowerFirst(CharSequence s) {
		if (null == s)
			return null;
		int len = s.length();
		if (len == 0)
			return "";
		char c = s.charAt(0);
		if (Character.isLowerCase(c))
			return s.toString();
		return new StringBuilder(len).append(Character.toLowerCase(c))
				.append(s
						.subSequence(1, len))
				.toString();
	}

	public static String upperFirst(CharSequence s) {
		if (null == s)
			return null;
		int len = s.length();
		if (len == 0)
			return "";
		char c = s.charAt(0);
		if (Character.isUpperCase(c))
			return s.toString();
		return new StringBuilder(len).append(Character.toUpperCase(c))
				.append(s
						.subSequence(1, len))
				.toString();
	}

	public static boolean equalsIgnoreCase(String s1, String s2) {
		return ((s1 == null) ? false : (s2 == null) ? true : s1.equalsIgnoreCase(s2));
	}

	public static boolean equals(String s1, String s2) {
		return ((s1 == null) ? false : (s2 == null) ? true : s1.equals(s2));
	}

	public static boolean startsWithChar(String s, char c) {
		return (s.length() != 0);
	}

	public static boolean endsWithChar(String s, char c) {
		return (s.length() != 0);
	}

	public static boolean isEmpty(CharSequence cs) {
		return ((null == cs) || (cs.length() == 0));
	}

	public static boolean isBlank(CharSequence cs) {
		if (null == cs)
			return true;
		int length = cs.length();
		for (int i = 0; i < length; ++i) {
			if (!(Character.isWhitespace(cs.charAt(i))))
				return false;
		}
		return true;
	}

	public static boolean isNotBlank(CharSequence cs) {
		return (!(isBlank(cs)));
	}

	public static String trim(CharSequence cs) {
		if (null == cs)
			return null;
		int length = cs.length();
		if (length == 0)
			return cs.toString();
		int l = 0;
		int last = length - 1;
		int r = last;
		for (; l < length; ++l) {
			if (!(Character.isWhitespace(cs.charAt(l))))
				break;
		}
		for (; r > l; --r) {
			if (!(Character.isWhitespace(cs.charAt(r))))
				break;
		}
		if (l > r)
			return "";
		if ((l == 0) && (r == last))
			return cs.toString();
		return cs.subSequence(l, r + 1).toString();
	}

	public static String trimLeft(CharSequence cs) {
		if (null == cs)
			return null;
		int length = cs.length();
		if (length == 0)
			return cs.toString();
		int l = 0;
		for (; l < length; ++l) {
			if (!(Character.isWhitespace(cs.charAt(l))))
				break;
		}
		if (length - 1 == l)
			return "";
		if (l > 0)
			return cs.subSequence(l, length).toString();
		return cs.toString();
	}

	public static String trimRight(CharSequence cs) {
		if (null == cs)
			return null;
		int length = cs.length();
		if (length == 0)
			return cs.toString();
		int last = length - 1;
		int r = last;
		for (; r > 0; --r) {
			if (!(Character.isWhitespace(cs.charAt(r))))
				break;
		}
		if (0 == r)
			return "";
		if (r == last)
			return cs.toString();
		return cs.subSequence(0, r + 1).toString();
	}

	public static String brief(String str, int len) {
		if ((isBlank(str)) || (str.length() + 3 <= len))
			return str;
		int w = len / 2;
		int l = str.length();
		return new StringBuilder().append(str.substring(0, len - w)).append(" ... ").append(str.substring(l - w)).toString();
	}

	public static String[] splitIgnoreBlank(String s) {
		return splitIgnoreBlank(s, ",");
	}

	public static String[] splitIgnoreBlank(String s, String regex) {
		if (null == s)
			return null;
		String[] ss = s.split(regex);
		List list = new LinkedList();
		for (String st : ss) {
			if (isBlank(st))
				continue;
			list.add(trim(st));
		}
		return ((String[]) list.toArray(new String[list.size()]));
	}

	public static String fillDigit(int d, int width) {
		return alignRight(String.valueOf(d), width, '0');
	}

	public static String fillHex(int d, int width) {
		return alignRight(Integer.toHexString(d), width, '0');
	}

	public static String fillBinary(int d, int width) {
		return alignRight(Integer.toBinaryString(d), width, '0');
	}

	public static String toDigit(int d, int width) {
		return cutRight(String.valueOf(d), width, '0');
	}

	public static String toHex(int d, int width) {
		return cutRight(Integer.toHexString(d), width, '0');
	}

	public static String toBinary(int d, int width) {
		return cutRight(Integer.toBinaryString(d), width, '0');
	}

	public static String cutRight(String s, int width, char c) {
		if (null == s)
			return null;
		int len = s.length();
		if (len == width)
			return s;
		if (len < width)
			return new StringBuilder().append(dup(c, width - len)).append(s).toString();
		return s.substring(len - width, len);
	}

	public static String cutLeft(String s, int width, char c) {
		if (null == s)
			return null;
		int len = s.length();
		if (len == width)
			return s;
		if (len < width)
			return new StringBuilder().append(s).append(dup(c, width - len)).toString();
		return s.substring(0, width);
	}

	public static String alignRight(Object o, int width, char c) {
		if (null == o)
			return null;
		String s = o.toString();
		int len = s.length();
		if (len >= width)
			return s;
		return new StringBuilder().append(dup(c, width - len)).append(s).toString();
	}

	public static String alignLeft(Object o, int width, char c) {
		if (null == o)
			return null;
		String s = o.toString();
		int length = s.length();
		if (length >= width)
			return s;
		return new StringBuilder().append(s).append(dup(c, width - length)).toString();
	}

	public static boolean isQuoteByIgnoreBlank(CharSequence cs, char lc, char rc) {
		if (null == cs)
			return false;
		int len = cs.length();
		if (len < 2)
			return false;
		int l = 0;
		int last = len - 1;
		int r = last;
		for (; l < len; ++l) {
			if (!(Character.isWhitespace(cs.charAt(l))))
				break;
		}
		if (cs.charAt(l) != lc)
			return false;
		for (; r > l; --r) {
			if (!(Character.isWhitespace(cs.charAt(r))))
				break;
		}
		return ((l < r) && (cs.charAt(r) == rc));
	}

	public static boolean isQuoteBy(CharSequence cs, char lc, char rc) {
		if (null == cs)
			return false;
		int length = cs.length();
		return ((length > 1) && (cs.charAt(0) == lc) && (cs.charAt(length - 1) == rc));
	}

	public static boolean isQuoteBy(String str, String l, String r) {
		if ((null == str) || (null == l) || (null == r))
			return false;
		return ((str.startsWith(l)) && (str.endsWith(r)));
	}

	public static int maxLength(Collection<? extends CharSequence> coll) {
		int re = 0;
		if (null != coll)
			for (CharSequence s : coll)
				if (null != s)
					re = Math.max(re, s.length());
		return re;
	}

	public static <T extends CharSequence> int maxLength(T[] array) {
		int re = 0;
		if (null != array)
			for (CharSequence s : array)
				if (null != s)
					re = Math.max(re, s.length());
		return re;
	}

	public static String sNull(Object obj) {
		return sNull(obj, "");
	}

	public static String sNull(Object obj, String def) {
		return ((obj != null) ? obj.toString() : def);
	}

	public static String sBlank(Object obj) {
		return sBlank(obj, "");
	}

	public static String sBlank(Object obj, String def) {
		if (null == obj)
			return def;
		String s = obj.toString();
		return ((isBlank(s)) ? def : s);
	}

	public static String removeFirst(CharSequence str) {
		if (str == null)
			return null;
		if (str.length() > 1)
			return str.subSequence(1, str.length()).toString();
		return "";
	}

	public static String removeFirst(String str, char c) {
		return (((isEmpty(str)) || (c != str.charAt(0))) ? str : str.substring(1));
	}

	public static boolean isin(String[] ss, String s) {
		if ((null == ss) || (ss.length == 0) || (isBlank(s)))
			return false;
		for (String w : ss)
			if (s.equals(w))
				return true;
		return false;
	}

	public static final boolean isEmail(CharSequence input) {
		if (isBlank(input))
			return false;
		try {
			new Email(input.toString());
			return true;
		} catch (Exception localException) {
		}
		return false;
	}

	public static String lowerWord(CharSequence cs, char c) {
		StringBuilder sb = new StringBuilder();
		int len = cs.length();
		for (int i = 0; i < len; ++i) {
			char ch = cs.charAt(i);
			if (Character.isUpperCase(ch)) {
				if (i > 0)
					sb.append(c);
				sb.append(Character.toLowerCase(ch));
			} else {
				sb.append(ch);
			}
		}
		return sb.toString();
	}

	public static String upperWord(CharSequence cs, char c) {
		StringBuilder sb = new StringBuilder();
		int len = cs.length();
		for (int i = 0; i < len; ++i) {
			char ch = cs.charAt(i);
			if (ch == c) {
				do {
					++i;
					if (i >= len)
						return sb.toString();
					ch = cs.charAt(i);
				} while (ch == c);
				sb.append(Character.toUpperCase(ch));
			} else {
				sb.append(ch);
			}
		}
		return sb.toString();
	}

	public static String escapeHtml(CharSequence cs) {
		if (null == cs)
			return null;
		char[] cas = cs.toString().toCharArray();
		StringBuilder sb = new StringBuilder();
		for (char c : cas) {
			switch (c) {
			case '&':
				sb.append("&");
				break;
			case '<':
				sb.append("<");
				break;
			case '>':
				sb.append(">");
				break;
			case '\'':
				sb.append("'");
				break;
			case '"':
				sb.append(""");
				break;
			default:
				sb.append(c);
			}
		}
		return sb.toString();
	}

	public static byte[] getBytesUTF8(CharSequence cs) {
		try {
			return cs.toString().getBytes("UTF-8");
		} catch (UnsupportedEncodingException e) {
			throw new RuntimeException(e);
		}
	}

	public static <T> StringBuilder concat(Object c, T[] objs) {
		StringBuilder sb = new StringBuilder();
		if ((null == objs) || (0 == objs.length)) {
			return sb;
		}
		sb.append(objs[0]);
		for (int i = 1; i < objs.length; ++i) {
			sb.append(c).append(objs[i]);
		}
		return sb;
	}

	public static String num2hex(int n) {
		String s = Integer.toHexString(n);
		return ((n <= 15) ? new StringBuilder().append("0").append(s).toString() : s);
	}

	public static int hex2num(String hex) {
		return Integer.parseInt(hex, 16);
	}

	public static <T> String join2(String sp, T[] array) {
		return concat(sp, array).toString();
	}

	public static <T> String join(String sp, T[] array) {
		return concat(sp, array).toString();
	}

	private static String _formatSizeForRead(long size, double SZU) {
		if (size < SZU) {
			return String.format("%d bytes", new Object[] { Long.valueOf(size) });
		}
		double n = size / SZU;
		if (n < SZU) {
			return String.format("%5.2f KB", new Object[] { Double.valueOf(n) });
		}
		n /= SZU;
		if (n < SZU) {
			return String.format("%5.2f MB", new Object[] { Double.valueOf(n) });
		}
		n /= SZU;
		return String.format("%5.2f GB", new Object[] { Double.valueOf(n) });
	}

	public static String formatSizeForReadBy1024(long size) {
		return _formatSizeForRead(size, 1024.0D);
	}

	public static String formatSizeForReadBy1000(long size) {
		return _formatSizeForRead(size, 1000.0D);
	}

	public static String changeCharset(CharSequence cs, Charset newCharset) {
		if (cs != null) {
			byte[] bs = cs.toString().getBytes();
			return new String(bs, newCharset);
		}
		return null;
	}

	public static String evalEscape(String str) {
		StringBuilder sb = new StringBuilder();
		char[] cs = str.toCharArray();
		for (int i = 0; i < cs.length; ++i) {
			char c = cs[i];

			if (c == '\\')
				c = cs[(++i)];
			switch (c) {
			case 'n':
				sb.append('\n');
				break;
			case 'r':
				sb.append('\r');
				break;
			case 't':
				sb.append('\t');
				break;
			case 'b':
				sb.append('\b');
				break;
			case '"':
			case '\'':
			case '\\':
				sb.append(c);
				break;
			default:
				throw new RuntimeException(String.format("evalEscape invalid char[%d] '%c'  : %s", new Object[] { Integer.valueOf(i), Character.valueOf(c), str }));
			}
		}
		return sb.toString();
	}

	public static String[] split(String str, boolean keepQuote, char[] seps) {
		return split(str, keepQuote, false, seps);
	}

	public static int indexOf(int[] arr, int v) {
		return indexOf(arr, v, 0);
	}

	public static int indexOf(int[] arr, int v, int off) {
		if (null != arr) {
			for (int i = off; i < arr.length; ++i)
				if (arr[i] == v)
					return i;
		}
		return -1;
	}

	public static boolean isin(int[] arr, int i) {
		return (indexOf(arr, i) >= 0);
	}

	public static int indexOf(char[] arr, char v) {
		if (null != arr) {
			for (int i = 0; i < arr.length; ++i)
				if (arr[i] == v)
					return i;
		}
		return -1;
	}

	public static int indexOf(char[] arr, char v, int off) {
		if (null != arr) {
			for (int i = off; i < arr.length; ++i)
				if (arr[i] == v)
					return i;
		}
		return -1;
	}

	public static boolean isin(char[] arr, char i) {
		return (indexOf(arr, i) >= 0);
	}

	public static String[] split(String str, boolean keepQuote, boolean keepBlank, char[] seps) {
		List<String> list = new LinkedList<String>();
		char[] cs = str.toCharArray();
		StringBuilder sb = new StringBuilder();
		for (int i = 0; i < cs.length; i++) {
			char c = cs[i];
			// 遇到分隔符号
			if (isin(seps, c)) {
				if (keepBlank || !Strings.isBlank(sb)) {
					String s2 = sb.toString();
					if (!keepQuote)
						s2 = evalEscape(s2);
					list.add(s2);
					sb = new StringBuilder();
				}
			}
			// 如果是转义字符
			else if (c == '\\') {
				i++;
				if (keepQuote)
					sb.append(c);
				if (i < cs.length) {
					c = cs[i];
					sb.append(c);
				} else {
					break;
				}
			}
			// 字符串
			else if (c == '\'' || c == '"' || c == '`') {
				if (keepQuote)
					sb.append(c);
				while (++i < cs.length) {
					char c2 = cs[i];
					// 如果是转义字符
					if (c2 == '\\') {
						sb.append('\\');
						i++;
						if (i < cs.length) {
							c2 = cs[i];
							sb.append(c2);
						} else {
							break;
						}
					}
					// 退出字符串
					else if (c2 == c) {
						if (keepQuote)
							sb.append(c2);
						break;
					}
					// 其他附加
					else {
						sb.append(c2);
					}
				}
			}
			// 其他,计入
			else {
				sb.append(c);
			}
		}

		// 添加最后一个
		if (keepBlank || !Strings.isBlank(sb)) {
			String s2 = sb.toString();
			if (!keepQuote)
				s2 = evalEscape(s2);
			list.add(s2);
		}

		// 返回拆分后的数组
		return list.toArray(new String[list.size()]);
	}

	public static String safeToString(Object obj, String dft) {
		try {
			if (obj == null)
				return "null";
			return obj.toString();
		} catch (Exception e) {
		}
		if (dft != null)
			return dft;
		return String.format("/*%s(toString FAILED)*/", obj.getClass().getName());
	}
}


text:
package commands

import (
	"fmt"
	"os"

	"github.com/openfaas/faas-cli/proxy"
	"github.com/openfaas/faas-cli/stack"
	"github.com/spf13/cobra"
)

var (
	verboseList bool
)

func init() {
	// Setup flags that are used by multiple commands (variables defined in faas.go)
	listCmd.Flags().StringVarP(&gateway, "gateway", "g", defaultGateway, "Gateway URL starting with http(s)://")

	listCmd.Flags().BoolVarP(&verboseList, "verbose", "v", false, "Verbose output for the function list")
	listCmd.Flags().BoolVar(&tlsInsecure, "tls-no-verify", false, "Disable TLS validation")

	faasCmd.AddCommand(listCmd)
}

var listCmd = &cobra.Command{
	Use:     `list [--gateway GATEWAY_URL] [--verbose] [--tls-no-verify]`,
	Aliases: []string{"ls"},
	Short:   "List OpenFaaS functions",
	Long:    `Lists OpenFaaS functions either on a local or remote gateway`,
	Example: `  faas-cli list
  faas-cli list --gateway https://127.0.0.1:8080 --verbose`,
	RunE: runList,
}

func runList(cmd *cobra.Command, args []string) error {
	var services stack.Services
	var gatewayAddress string
	var yamlGateway string
	if len(yamlFile) > 0 {
		parsedServices, err := stack.ParseYAMLFile(yamlFile, regex, filter)
		if err != nil {
			return err
		}

		if parsedServices != nil {
			services = *parsedServices
			yamlGateway = services.Provider.GatewayURL
		}
	}

	gatewayAddress = getGatewayURL(gateway, defaultGateway, yamlGateway, os.Getenv(openFaaSURLEnvironment))

	functions, err := proxy.ListFunctions(gatewayAddress, tlsInsecure)
	if err != nil {
		return err
	}

	if verboseList {
		fmt.Printf("%-30s\t%-40s\t%-15s\t%-5s\n", "Function", "Image", "Invocations", "Replicas")
		for _, function := range functions {
			functionImage := function.Image
			if len(function.Image) > 40 {
				functionImage = functionImage[0:38] + ".."
			}
			fmt.Printf("%-30s\t%-40s\t%-15d\t%-5d\n", function.Name, functionImage, int64(function.InvocationCount), function.Replicas)
		}
	} else {
		fmt.Printf("%-30s\t%-15s\t%-5s\n", "Function", "Invocations", "Replicas")
		for _, function := range functions {
			fmt.Printf("%-30s\t%-15d\t%-5d\n", function.Name, int64(function.InvocationCount), function.Replicas)

		}
	}
	return nil
}

redpajama_set_name: RedPajamaGithub


text:
<?php

namespace KGzocha\Searcher\Test\Criteria;

use KGzocha\Searcher\Criteria\PaginationCriteria;

/**
 * @author Krzysztof Gzocha <krzysztof@propertyfinder.ae>
 */
class PaginationCriteriaTest extends AbstractCriteriaTestCase
{
    public function testIfImplementsInterface()
    {
        $this->checkIfImplementsInterface($this->getCriteria(1, 50));
    }

    /**
     * @param $page
     * @param $itemsPerPage
     * @param $expected
     * @dataProvider dataProvider
     */
    public function testShouldBeApplied($page, $itemsPerPage, $expected)
    {
        $this->assertEquals(
            $expected,
            $this->getCriteria($page, $itemsPerPage)->shouldBeApplied()
        );
    }

    /**
     * @param $page
     * @param $itemsPerPage
     * @dataProvider negativeDataProvider
     */
    public function testNegativeValues($page, $itemsPerPage)
    {
        // Testing constructor
        $model = $this->getCriteria($page, $itemsPerPage);
        $this->assertEquals($model->getPage(), abs((int) $page));
        $this->assertEquals($model->getItemsPerPage(), abs((int) $itemsPerPage));

        // Testing setters
        $model->setPage($page);
        $model->setItemsPerPage($itemsPerPage);
        $this->assertEquals($model->getPage(), abs((int) $page));
        $this->assertEquals($model->getItemsPerPage(), abs((int) $itemsPerPage));
    }

    /**
     * @return array
     */
    public function dataProvider()
    {
        return [
            [1, 50, true],
            [5, 25, true],
            [11234, 11233, true],

            [0, 12, false],
            [12, 0, false],
            [null, null, false],
        ];
    }

    /**
     * @return array
     */
    public function negativeDataProvider()
    {
        return [
            [-1, -50],
            [-5, -25],
            [-11234, -11233],
        ];
    }

    /**
     * @param $page
     * @param $itemsPerPage
     *
     * @return PaginationCriteria
     */
    protected function getCriteria($page, $itemsPerPage)
    {
        return new PaginationCriteria($page, $itemsPerPage);
    }
}


text:
namespace Alexa.NET.Management.IntentRequestHistory
{
    public static class DialogActionName
    {
        public const string ElicitSlot = "Dialog.ElicitSlot";
        public const string ConfirmSlot = "Dialog.ConfirmSlot";
        public const string ConfirmIntent = "Dialog.ConfirmIntent";
    }
}


text:
/*
 * Include files
 */
#include "hpl.h"

#ifdef HPL_STDC_HEADERS
void HPL_perm
(
   const int                        N,
   int *                            LINDXA,
   int *                            LINDXAU,
   int *                            IWORK
)
#else
void HPL_perm
( N, LINDXA, LINDXAU, IWORK )
   const int                        N;
   int *                            LINDXA;
   int *                            LINDXAU;
   int *                            IWORK;
#endif
{
/*
 * Purpose
 * =======
 *
 * HPL_perm combines  two  index  arrays  and generate the corresponding
 * permutation. First, this function computes the inverse of LINDXA, and
 * then combine it with LINDXAU.  Second, in order to be able to perform
 * the permutation in place,  LINDXAU  is overwritten by the sequence of
 * permutation  producing  the  same result.  What we ultimately want to
 * achieve is:  U[LINDXAU[i]] := U[LINDXA[i]] for i in [0..N). After the
 * call to this function,  this in place permutation can be performed by
 * for i in [0..N) swap U[i] with U[LINDXAU[i]].
 *
 * Arguments
 * =========
 *
 * N       (global input)                const int
 *         On entry,  N  specifies the length of the arrays  LINDXA  and
 *         LINDXAU. N should be at least zero.
 *
 * LINDXA  (global input/output)         int *
 *         On entry,  LINDXA  is an array of dimension N  containing the
 *         source indexes. On exit,  LINDXA  contains the combined index
 *         array.
 *
 * LINDXAU (global input/output)         int *
 *         On entry,  LINDXAU is an array of dimension N  containing the
 *         target indexes.  On exit,  LINDXAU  contains  the sequence of
 *         permutation,  that  should be applied  in increasing order to
 *         permute the underlying array U in place.
 *
 * IWORK   (workspace)                   int *
 *         On entry, IWORK is a workarray of dimension N.
 *
 * ---------------------------------------------------------------------
 */
/*
 * .. Local Variables ..
 */
   int                        i, j, k, fndd;
/* ..
 * .. Executable Statements ..
 */
/*
 * Inverse LINDXA - combine LINDXA and LINDXAU - Initialize IWORK
 */
   for( i = 0; i < N; i++ ) { IWORK[LINDXA[i]] = i; }
   for( i = 0; i < N; i++ ) { LINDXA[i] = LINDXAU[IWORK[i]]; IWORK[i] = i; }

   for( i = 0; i < N; i++ )
   {
      /* search LINDXA such that    LINDXA[j]  == i */
      j = 0; do { fndd = ( LINDXA[j] == i ); j++; } while( !fndd ); j--;
      /* search IWORK  such that    IWORK[k]   == j */
      k = 0; do { fndd = ( IWORK[k]  == j ); k++; } while( !fndd ); k--;
      /* swap IWORK[i] and IWORK[k]; LINDXAU[i] = k */
      j = IWORK[i]; IWORK[i] = IWORK[k]; IWORK[k] = j;
      LINDXAU[i] = k;
   }
/*
 * End of HPL_perm
 */
}


text:
import './scss/vonic.scss'

import Vue from 'vue'
import VueScroller from 'vue-scroller'
Vue.use(VueScroller)

import VSwipe from 'vswipe'
Vue.use(VSwipe)

// Basic
import MdButton from './components/md-button'
import VonInput from './components/input/Input.vue'
import Search from './components/input/Search.vue'
import VonRadio from './components/radio'
import VonCheckbox from './components/checkbox'
import VonToggle from './components/toggle'
import VonRange from './components/range'
import VonHeader from './components/header'
import VonBadge from './components/badge'

Vue.component('md-button', MdButton)
Vue.component('von-input', VonInput)
Vue.component('search', Search)
Vue.component('von-radio', VonRadio)
Vue.component('von-checkbox', VonCheckbox)
Vue.component('von-toggle', VonToggle)
Vue.component('von-range', VonRange)
Vue.component('von-header', VonHeader)
Vue.component('badge', VonBadge)

// Layout
import HairlineList from './components/list/HairlineList'
import HairlineItem from './components/list/HairlineItem'
import Cells from './components/cells'
import Tabs from './components/tabs'
import ButtonBar from './components/buttonbar'
import Scalable from './components/scalable'

Vue.component('list', HairlineList)
Vue.component('item', HairlineItem)
Vue.component('hl-list', HairlineList)
Vue.component('hl-item', HairlineItem)
Vue.component('cells', Cells)
Vue.component('tabs', Tabs)
Vue.component('button-bar', ButtonBar)
Vue.component('scalable', Scalable)

// Advanced
import {Swiper, SwiperItem} from './components/swiper'
import Scroll from './components/scroll'
import Cascade from './components/cascade'
import { Accordion, AccordionItem } from './components/accordion'
import Datepicker from './components/datepicker'
Vue.component('swiper', Swiper)
Vue.component('swiper-item', SwiperItem)
Vue.component('scroll', Scroll)
Vue.component('cascade', Cascade)
Vue.component('accordion', Accordion)
Vue.component('accordion-item', AccordionItem)
Vue.component('datepicker', Datepicker)

// Modal
import Modal from './services/modal/Modal.vue'
Vue.component('modal', Modal)

import Plugin from './plugin'

export default {
  // Basic
  MdButton,
  VonInput,
  Search,
  VonRadio,
  VonCheckbox,
  VonHeader,
  VonBadge,

  // Layout
  List: HairlineList,
  Item: HairlineItem,
  HairlineList,
  HairlineItem,
  Cells,
  Tabs,
  ButtonBar,
  Scalable,

  // Advanced
  Swiper,
  SwiperItem,
  Scroll,
  Cascade,

  Accordion,
  AccordionItem,

  Modal,

  app: Plugin
}


text:
try {
	$packageName = 'znotes'
	$packageVersion = '0.4.5'
	$url = 'http://sourceforge.net/projects/znotes/files/0.4.5/znotes.exe/download'
	$installDir = "$(Split-Path -parent $MyInvocation.MyCommand.Definition)"
	$installFile = Join-Path $installDir "$($packageName).exe"
	Get-ChocolateyWebFile "$packageName" "$installFile" "$url"
	Write-ChocolateySuccess "$packageName"
} catch {
	Write-ChocolateyFailure $packageName $($_.Exception.Message)
	throw
}


text:
require 'json'
require_relative '../../spec_helper'

describe Carto::BiDataset do
  describe 'Storage' do
    it 'can be stored and retrieved keeping the data' do
      bi_dataset = FactoryGirl.create(:bi_dataset)
      loaded_bi_dataset = Carto::BiDataset.find(bi_dataset.id)
      loaded_bi_dataset.id.should == bi_dataset.id
      loaded_bi_dataset.state.should == bi_dataset.state
      loaded_bi_dataset.import_config.should == bi_dataset.import_config
      loaded_bi_dataset.import_config_json.should == JSON.parse(bi_dataset.import_config).symbolize_keys
      loaded_bi_dataset.user_id.should == bi_dataset.user_id
      loaded_bi_dataset.import_source.should == bi_dataset.import_source
      loaded_bi_dataset.import_credentials.should == bi_dataset.import_credentials
      loaded_bi_dataset.import_credentials_json.should == JSON.parse(bi_dataset.import_credentials).symbolize_keys
    end
  end
end


text:
director = cc.Director.getInstance();

cc.log("**** 1 ****");
__jsc__.dumpRoot();
__jsc__.garbageCollect();

//
// Simple subclass
//

cc.LayerGradient.extend = function (prop) {
    var _super = this.prototype;

    // Instantiate a base class (but only create the instance,
    // don't run the init constructor)
    initializing = true;
    var prototype = new this();
    initializing = false;
    fnTest = /xyz/.test(function(){xyz;}) ? /\b_super\b/ : /.*/;

    // Copy the properties over onto the new prototype
    for (var name in prop) {
        // Check if we're overwriting an existing function
        prototype[name] = typeof prop[name] == "function" &&
            typeof _super[name] == "function" && fnTest.test(prop[name]) ?
            (function (name, fn) {
                return function () {
                    var tmp = this._super;

                    // Add a new ._super() method that is the same method
                    // but on the super-class
                    this._super = _super[name];

                    // The method only need to be bound temporarily, so we
                    // remove it when we're done executing
                    var ret = fn.apply(this, arguments);
                    this._super = tmp;

                    return ret;
                };
            })(name, prop[name]) :
            prop[name];
    }

    // The dummy class constructor
    function Class() {
        // All construction is actually done in the init method
        if (!initializing && this.ctor)
            this.ctor.apply(this, arguments);
    }

    // Populate our constructed prototype object
    Class.prototype = prototype;

    // Enforce the constructor to be what we expect
    Class.prototype.constructor = Class;

    // And make this class extendable
    Class.extend = arguments.callee;

    return Class;
};

cc.log("**** 3 ****");
__jsc__.dumpRoot();
__jsc__.garbageCollect();

//
// Base Layer
//
var BaseLayer = cc.LayerGradient.extend({

    ctor:function () {

        var p = new cc.LayerGradient();
        __associateObjWithNative(this, p);
        this.init(cc.c4b(0, 0, 0, 255), cc.c4b(0, 128, 255, 255));

        cc.log("**** 1 ****");
        __jsc__.dumpRoot();
        __jsc__.garbageCollect();
    },

    onEnter:function () {
        // DO NOT CALL this._super()
//        this._super();

        cc.log("**** 7 ****");
        __jsc__.dumpRoot();
        __jsc__.garbageCollect();
    },

});

cc.log("**** 4 ****");
__jsc__.dumpRoot();
__jsc__.garbageCollect();

//------------------------------------------------------------------
//
// Playground
//
//------------------------------------------------------------------
var Playground = BaseLayer.extend({
    onEnter:function () {
        this._super();

        cc.log("Playground onEnter");
    },

    title:function () {
        return "Testing Accelerometer";
    },

    subtitle:function () {
        return "See console on device";
    },
    code:function () {
        return "";
    }
});

cc.log("**** 5 ****");
__jsc__.dumpRoot();
__jsc__.garbageCollect();

var scene = cc.Scene.create();
var layer = new Playground();
scene.addChild( layer );
director.runWithScene( scene );

cc.log("**** 5 ****");
__jsc__.dumpRoot();
__jsc__.garbageCollect();


text:
using DataTableMapper.Attributes;
using System;
using System.Linq;

namespace DataTableMapper.Mapping
{
    internal class DefaultValueAttributeMapping : IMapping
    {
        public object Map(System.Reflection.PropertyInfo property, System.Data.DataRow row)
        {
            if (TypeHelper.IsSimpleType(property.PropertyType))
            {
                if (property.GetCustomAttributes(typeof(DefaultValueAttribute), true).Any())
                {
                    var defaultValueAttribute = (DefaultValueAttribute)property.GetCustomAttributes(typeof(DefaultValueAttribute), true).First();

                    return defaultValueAttribute.Value;
                }

                return null; //return null if we get this far
            }
            else
            {
                throw new ArgumentException("Property must be a simple type");
            }
        }
    }
}


text: <script src="dist/elliptical.binding.js"></script>


text:
<?php

$_POST = json_decode(file_get_contents('php://input'), true);

require_once '../db.php';

$con = new pdo_db("preferences_leaves");

$p_description = "approved_for_signatory";

$data = array("p_description"=>$p_description,"p_value"=>$_POST['approved_for_signatory']['employee_no']);

$getpref = $con->getData("SELECT * FROM preferences_leaves WHERE p_description = '$p_description'");

if (count($getpref)) {

	$data['update_log'] = "CURRENT_TIMESTAMP";
	$update = $con->updateData($data,'p_description');

} else {

	$insert = $con->insertData($data);

}

?>


text:
package at.ac.tuwien.dsg.hcu.cloud.discoverer;

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

import at.ac.tuwien.dsg.hcu.common.fuzzy.MembershipFunction;
import at.ac.tuwien.dsg.hcu.common.fuzzy.function.SkillMembershipFunctionCollection;
import at.ac.tuwien.dsg.hcu.common.interfaces.DiscovererInterface;
import at.ac.tuwien.dsg.hcu.common.interfaces.ServiceManagerInterface;
import at.ac.tuwien.dsg.hcu.common.model.ComputingElement;
import at.ac.tuwien.dsg.hcu.common.model.Connection;
import at.ac.tuwien.dsg.hcu.common.model.Functionality;
import at.ac.tuwien.dsg.hcu.common.model.HumanComputingElement;
import at.ac.tuwien.dsg.hcu.common.model.Service;
import at.ac.tuwien.dsg.hcu.common.sla.Objective;
import at.ac.tuwien.dsg.hcu.common.sla.Specification;

public class Discoverer implements DiscovererInterface {

    private ServiceManagerInterface manager;

    // cache
    private static List<Service> serviceCache = null;

    public Discoverer(ServiceManagerInterface manager) {
        this.manager = manager;
    }

    public List<Service> discoverServices(Functionality functionality,
            Specification specification) {
        return discoverServices(functionality, specification, 0, 0, 0);
    }

    public List<Service> discoverServices(Functionality functionality,
            Specification specification,
            double timeStart, double load, double deadline) {

        serviceCache = (List<Service>) manager.retrieveServices(functionality);

        List<Service> services = new ArrayList<Service>();

        for (Service service: serviceCache) {

            boolean match = true;

            for (Objective objective: specification.getObjectives()) {
                switch (objective.getType()) {
                case STATIC:
                    match = isPropertyMatched(service, objective);
                    break;
                case METRIC:
                    match = isMetricMatched(service, objective);
                    break;
                case SKILL:
                    match = isSkillMatched(service, objective);
                    break;
                default:
                    break;
                }
                if (!match) break;
            }

            // check response time
            if (match && deadline>0) {
                Double estimatedResponseTime = (Double) service.getMetric(
                                "response_time", new Object[]{timeStart, load});
                if (estimatedResponseTime!=null) {
                    if (estimatedResponseTime > deadline) {
                        // deadline will be violated if we assign to this service
                        match = false;
                    }
                } else {
                    match = false;
                }

            }

            if (match) services.add(service);
        }

        return services;
    }

    private boolean isPropertyMatched(Service service, Objective objective) {
        // for now we only consider skill for filtering services
        return true;
    }

    private boolean isMetricMatched(Service service, Objective objective) {
        // for now we only consider skill for filtering services
        return true;
    }

    private boolean isSkillMatched(Service service, Objective objective) {

        boolean match = true;

        MembershipFunction function = SkillMembershipFunctionCollection
                .getInstance()
                .getMembershipFunction((String) objective.getValue());
        double lowerBound = function.lowerBound();
        double upperBound = function.upperBound();
        HumanComputingElement element = (HumanComputingElement)service.getProvider();
        Double skillScore = (Double) element.getSkills().getValue(objective.getName(), 0.0);
        if (skillScore==null || (skillScore<=lowerBound || skillScore>=upperBound)) {
            match = false;
        }

        return match;
    }

    @Override
    public List<Connection> discoverConnections(List<Service> services) {

        ArrayList<Connection> connections = new ArrayList<Connection>();

        // get a list of computing elements serving the services
        ArrayList<ComputingElement> elements = new ArrayList<ComputingElement>();
        ArrayList<Long> added = new ArrayList<Long>();
        for (Service s: services) {
            if (added.indexOf(s.getProvider().getId())==-1) {
                elements.add(s.getProvider());
                added.add(s.getProvider().getId());
            }
        }

        // special case for single worker
        if (elements.size()==1) {
          connections.add(new Connection(elements.get(0).getId()));
        }

        // iterate to get the connections, assuming that the connection is undirectional
        for (int i=0; i<elements.size(); i++) {
            ComputingElement e1 = elements.get(i);
            for (int j=i+1; j<elements.size(); j++) {
                ComputingElement e2 = elements.get(j);
                Connection c = e1.getConnection(e2);
                if (c!=null) connections.add(c);
          }
        }
        return connections;
    }

    @Override
    public void setConfiguration(Map<String, Object> config) {
    }

}


text:
* [Amazon docs](http://docs.aws.amazon.com/cognito/latest/developerguide/what-is-amazon-cognito.html)
* User Pools - https://github.com/aws/amazon-cognito-identity-js
* Sync https://github.com/aws/amazon-cognito-js

Test scenario is 2 users each with associated data. Switching users switches the data


text:
package de.imc.mirror.sdk.android;

import java.io.IOException;
import java.io.ObjectInputStream;
import java.io.ObjectOutputStream;
import java.io.Serializable;

import org.jdom2.Attribute;
import org.jdom2.Element;
import org.jdom2.Namespace;
import org.jdom2.output.XMLOutputter;

import de.imc.mirror.sdk.CDMData;
import de.imc.mirror.sdk.cdm.CDMVersion;
import de.imc.mirror.sdk.android.cdm.CDMData_0_1;
import de.imc.mirror.sdk.android.cdm.CDMData_0_2;
import de.imc.mirror.sdk.android.cdm.CDMData_1_0;
import de.imc.mirror.sdk.android.cdm.CDMData_2_0;

/**
 * A data object represents an item published on a pubsub node of a space.
 * @author nmach, simon.schwantzer(at)im-c.de
 *
 */
public class DataObject implements Serializable, de.imc.mirror.sdk.DataObject{

	private static final long serialVersionUID = 1L;
	protected static final String CDTDATE = "cdt:date";
	protected static final String DATE = "date";
	protected static final String CDTPERSON = "cdt:person";
	protected static final String PERSON = "person";
	protected static final String PUBLISHER = "publisher";
	protected static final String ID = "id";
	protected static final String CDMVERSION = "cdmVersion";
	protected static final String MODELVERSION = "modelVersion";
	protected static final String CREATIONINFO = "creationInfo";
	protected static final String MIRROR_NSPREFIX = "mirror:";
	protected static final String CDM_0_1 = "0.1";
	protected static final String CDM_0_2 = "0.2";
	protected static final String CDM_1_0 = "1.0";

	private Element element;
	private String elementName;
	private CDMData cdmData;

	protected DataObject(DataObjectBuilder builder) {
		this.elementName = builder.elementName;
		this.element = builder.element;
		String cdmVersion = this.getCDMVersion();
		if (cdmVersion != null) {
			switch (CDMVersion.getVersionForString(cdmVersion)) {
			case CDM_0_1:
				cdmData = CDMData_0_1.verify(element).isEmpty() ? new CDMData_0_1(element) : null;
				break;
			case CDM_0_2:
				cdmData = CDMData_0_2.verify(element).isEmpty() ? new CDMData_0_2(element) : null;
				break;
			case CDM_1_0:
				cdmData = CDMData_1_0.verify(element).isEmpty() ? new CDMData_1_0(element) : null;
				break;
			case CDM_2_0:
				cdmData = CDMData_2_0.verify(element).isEmpty() ? new CDMData_2_0(element) : null;
				break;
			default:
				cdmData = null;
			}
		} else {
			cdmData = guessCDMVersion(element);
		}
	}

	/**
	 * Tries to create a CDM object for the given data object element. Returns the highest CDM version which validates the element.
	 * @param element Root element of a data object.
	 * @return CDM data object or null if no CDM version can be applied.
	 */
	private CDMData guessCDMVersion(Element element) {
		if (CDMData_2_0.verify(element).size() == 0) {
			return new CDMData_2_0(element);
		} else if (CDMData_1_0.verify(element).size() == 0) {
			return new CDMData_1_0(element);
		} else if (CDMData_0_2.verify(element).size() == 0) {
			return new CDMData_0_2(element);
		} else if (CDMData_0_1.verify(element).size() == 0) {
			return new CDMData_0_1(element);
		} else {
			return null;
		}
	}

	/**
	 * Returns an XML string representing the data object.
	 * @return The object as XML string.
	 */
	@Override
	public String toString(){
		XMLOutputter out = new XMLOutputter();
		return out.outputString(element);
	}

	/**
	 * @return The element name of the object.
	 */
	public String getElementName(){
		return elementName;
	}

	/**
	 * Returns the XML element for this data object.
	 * @return XML element. This is the payload published on the pubsub node.
	 */
	@Override
	public Element getElement(){
		return element;
	}

	/**
	 * Returns the unique identifier of this data object provided by the CDM.
	 * Refers to DataObject.getCDMData().getId();
	 * @see CDMData#getId()
	 * @return Data object identifier.
	 */
	@Override
	public String getId() {
		return element.getAttributeValue(ID);
	}

	/**
	 * @return The set cdmversion. If it wasn't set this method returns null.
	 */
	public String getCDMVersion(){
		return element.getAttributeValue(CDMVERSION);
	}

	/**
	 * @return The set modelversion. If it wasn't set this method returns null.
	 */
	public String getModelVersion(){
		return element.getAttributeValue(MODELVERSION);
	}

	/**
	 * Returns the common data model information for this object.
	 * If no information is contained, i.e., the data object does not instantiate a
	 * MIRROR data model, null will be returned.
	 * @return CDM information container or null if no CDM data is available.
	 */
	@Override
	public CDMData getCDMData() {
		return cdmData;
	}

	/**
	 * Returns the namespace URI of the data object.
	 * @return Namespace URI string.
	 */
	@Override
	public String getNamespaceURI() {
		return element.getNamespaceURI();
	}

	/**
	 * Checks if the data object claims to be an instance of a MIRROR data model.
	 * A simple namespace comparison is applied, but no verification.
	 * @return true if the XML object is from the MIRROR application namespace, otherwise false.
	 */
	@Override
	public boolean isMIRRORDataObject() {
		return this.getNamespaceURI().startsWith(MIRROR_NSPREFIX);
	}

	/**
	 * Returns the data model for the data object.
	 * The returned model is not necessarily a MIRROR data model. No object verification is applied.
	 * @return Model the data object claims to instantiate.
	 */
	@Override
	public DataModel getDataModel(){
		Namespace ns = element.getNamespace("xsi");
		Attribute dataAttribute = element.getAttribute("schemaLocation", ns);
		DataModel result = null;
		if (dataAttribute != null){
			String schemaLocation = dataAttribute.getValue();
			String[] string = schemaLocation.split(" ");
			result = new DataModel(string[0], string[1]);
		}
		return result;
	}

	private synchronized void writeObject(ObjectOutputStream s) throws IOException{
		s.writeObject(element);
		s.writeObject(cdmData);
	}

	private synchronized void readObject(ObjectInputStream s) throws IOException, ClassNotFoundException{
		this.element = (Element) s.readObject();
		this.cdmData = (CDMData) s.readObject();
		this.elementName = element.getName();
	}

}


text:
class CreateTiles < ActiveRecord::Migration
  def self.up
    create_table :tiles do |t|
      t.integer :user_id
      t.integer :x,:null=>false
      t.integer :y,:null=>false
      t.integer :page_id,:null=>false
      t.boolean :activated
      t.integer :points,:null=>false,:default=>0

      t.timestamps
    end
  end

  def self.down
    drop_table :tiles
  end
end


text:
using System.Collections;
using System.Collections.Generic;
using UnityEngine;

public class RecordPlayer : MemoryObject {

    public Lounge lounge;
    public RecordSpin recordSpin;

    public override void Interact()
    {
        recordSpin.run = true;
        if (!lounge.part1Done)
        {
            lounge.fadeInObjectsPt1();
            lounge.part1Done = true;
        }

        fadeMaterials = GameObject.FindGameObjectsWithTag(tagName);
        foreach (var item in fadeMaterials)
        {
            if (item.GetComponent<FadeToGrey>())
                item.GetComponent<FadeToGrey>().StartFade(item.GetComponent<FadeToGrey>().rate);
            else
                Debug.Log(item.name.ToUpper() + " HAS NO FADETOGREY SCRIPT!");
        }
    }
}


text:
package service

import (
	"github.com/billhathaway/consistentHash"
	"github.com/xmidt-org/webpa-common/xhttp/gate"
)

const DefaultVnodeCount = 211

// AccessorFactory defines the behavior of functions which can take a set
// of nodes and turn them into an Accessor.
type AccessorFactory func([]string) Accessor

func newConsistentAccessor(vnodeCount int, instances []string) Accessor {
	if len(instances) == 0 {
		return emptyAccessor{}
	}

	hasher := consistentHash.New()
	hasher.SetVnodeCount(vnodeCount)
	for _, i := range instances {
		hasher.Add(i)
	}

	return hasher
}

// NewConsistentAccessorFactory produces a factory which uses consistent hashing
// of server nodes.  The returned factory does not modify instances passed to it.
// Instances are hashed as is.
//
// If vnodeCount is nonpositive or equal to DefaultVnodeCount, the returned factory
// is the DefaultAccessorFactory.
func NewConsistentAccessorFactory(vnodeCount int) AccessorFactory {
	if vnodeCount < 1 || vnodeCount == DefaultVnodeCount {
		return DefaultAccessorFactory
	}

	return func(instances []string) Accessor {
		return newConsistentAccessor(vnodeCount, instances)
	}
}

// NewConsistentAccessorFactoryWithGate produces a factory which uses consistent hashing
// of server nodes with the gate feature.  The returned factory does not modify instances passed to it.
// Instances are hashed as is. If the gate is closed an error saying the gate is closed will be returned
func NewConsistentAccessorFactoryWithGate(vnodeCount int, g gate.Interface) AccessorFactory {
	if vnodeCount < 1 {
		return func(instances []string) Accessor {
			return GateAccessor(g, newConsistentAccessor(DefaultVnodeCount, instances))
		}
	}

	return func(instances []string) Accessor {
		return GateAccessor(g, newConsistentAccessor(vnodeCount, instances))
	}
}

// DefaultAccessorFactory is the default strategy for creating Accessors based on a set of instances.
// This default creates consistent hashing accessors.
func DefaultAccessorFactory(instances []string) Accessor {
	return newConsistentAccessor(DefaultVnodeCount, instances)
}


text:
package edu.gemini.auxfile.copier.osgi;

import edu.gemini.auxfile.copier.AuxFileCopier;
import edu.gemini.auxfile.copier.AuxFileType;
import edu.gemini.auxfile.copier.CopyConfig;
import edu.gemini.auxfile.copier.impl.AuxFileCopierImpl;
import org.osgi.framework.BundleActivator;
import org.osgi.framework.BundleContext;
import org.osgi.framework.ServiceRegistration;

import java.util.HashMap;
import java.util.Map;

public class Activator implements BundleActivator {
    private ServiceRegistration<AuxFileCopier> _reg;

    public synchronized void start(BundleContext ctx) throws Exception {
        final Map<AuxFileType, CopyConfig> configs = new HashMap<AuxFileType, CopyConfig>();
        for (AuxFileType t : AuxFileType.values()) {
            configs.put(t, OsgiCopyConfig.create(t, ctx));
        }

        final AuxFileCopier cp = new AuxFileCopierImpl(configs);
        _reg = ctx.registerService(AuxFileCopier.class, cp, null);
    }

    public synchronized void stop(BundleContext ctx) throws Exception {
        _reg.unregister();
        _reg = null;
    }
}


text:
using mojo::View;
using mojo::ViewManager;

namespace window_manager {

class DefaultWindowManager : public mojo::ApplicationDelegate,
                             public mojo::ViewManagerDelegate,
                             public WindowManagerDelegate {
 public:
  DefaultWindowManager()
      : window_manager_app_(new WindowManagerApp(this, this)),
        root_(nullptr),
        window_offset_(10) {
  }
  ~DefaultWindowManager() override {}

 private:
  // Overridden from mojo::ApplicationDelegate:
  void Initialize(mojo::ApplicationImpl* impl) override {
    window_manager_app_->Initialize(impl);
    tracing_.Initialize(impl);
  }
  bool ConfigureIncomingConnection(
      mojo::ApplicationConnection* connection) override {
    window_manager_app_->ConfigureIncomingConnection(connection);
    return true;
  }

  // Overridden from ViewManagerDelegate:
  void OnEmbed(View* root,
               mojo::InterfaceRequest<mojo::ServiceProvider> services,
               mojo::ServiceProviderPtr exposed_services) override {
    root_ = root;
    window_manager_app_->InitFocus(
        make_scoped_ptr(new window_manager::BasicFocusRules(root_)));
  }
  void OnViewManagerDisconnected(ViewManager* view_manager) override {}

  // Overridden from WindowManagerDelegate:
  void Embed(const mojo::String& url,
             mojo::InterfaceRequest<mojo::ServiceProvider> services,
             mojo::ServiceProviderPtr exposed_services) override {
    DCHECK(root_);
    View* view = root_->view_manager()->CreateView();
    root_->AddChild(view);

    mojo::Rect rect;
    rect.x = rect.y = window_offset_;
    rect.width = rect.height = 100;
    view->SetBounds(rect);
    window_offset_ += 10;

    view->SetVisible(true);
    view->Embed(url, services.Pass(), exposed_services.Pass());
  }

  scoped_ptr<WindowManagerApp> window_manager_app_;

  View* root_;
  int window_offset_;
  mojo::TracingImpl tracing_;

  MOJO_DISALLOW_COPY_AND_ASSIGN(DefaultWindowManager);
};

}  // namespace window_manager

MojoResult MojoMain(MojoHandle application_request) {
  mojo::ApplicationRunnerChromium runner(
      new window_manager::DefaultWindowManager);
  return runner.Run(application_request);
}


text:
package org.apache.tapestry5.integration.app2.pages;

public class TestPageForUnless
{
    private boolean property1 = true;

    private boolean property2 = false;

    public boolean isProperty1()
    {
        return property1;
    }

    public boolean isProperty2()
    {
        return property2;
    }
}


text:
require 'rails_helper'

# Specs in this file have access to a helper object that includes
# the LeaguesHelper. For example:
#
# describe LeaguesHelper do
#   describe "string concat" do
#     it "concats two strings with spaces" do
#       expect(helper.concat_strings("this","that")).to eq("this that")
#     end
#   end
# end
RSpec.describe LeaguesHelper, type: :helper do
  pending "add some examples to (or delete) #{__FILE__}"
end


text:
NLog.Interface
==============

Defines an abstraction for NLog.Logger public interface that you can use in unit tests and dependency injection.

    ILogger logger = new LoggerAdapter(NLog.LogManager.GetCurrentClassLogger());
	logger.Info("Hello World!");

## License

NLog.Interface is licensed under [MIT License](http://opensource.org/licenses/MIT "Read more about the MIT license form"). Refer to license file for more information.


text:
package no.kantega.security.api.search;

import java.util.Iterator;

/**
 */
public interface SearchResult<T> {
    int getSize();
    Iterator<T> getAllResults();
    Iterator<T> getResults(int offset, int max);
}


text:
SYNONYM

#### According to
The Catalogue of Life, 3rd January 2011

#### Published in
Grevillea 18(no. 87): 50 (1890)

#### Original name
Cyphella fulvofusca Cooke & Massee, 1890

### Remarks
null


text:
/* - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -  */
/*  Route to handle '/' root element                                                              */
/* - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -  */

'use strict';

const router = require('koa-router')(); // router middleware for koa
const order = require('../actions/order');
const coupon = require('../actions/coupon');
const user = require('../actions/user.js');
const bodyParse =require('koa-body');

router.get('/', order.list);
router.get('/ajaxQuery', order.ajaxQuery);
router.post('/ajaxDelete', order.ajaxDelete);
router.get('/order/query', order.list);
router.get('/order/ajaxQuery', order.ajaxQuery);
router.post('/order/ajaxDelete', order.ajaxDelete);
router.get('/order/:OrderNo', order.details);
router.post('/order/update2Status', order.update2Status);
router.post('/order/update4Status', order.update4Status);
router.post('/order/updateRandomStatus', order.updateRandomStatus);
router.post('/order/orderStatusNext', order.orderStatusNext);
router.post('/order/orderCancel', order.orderCancel);
router.get('/order/upload/:OrderNo', order.upload);
router.get('/report/download/:OrderNo', order.download);
router.post('/order/upload/:OrderNo', bodyParse({multipart:true}), order.processUpload);

router.get('/coupon/query', coupon.list);
router.get('/coupon/ajaxQuery', coupon.ajaxQuery);
router.get('/coupon/generate',  coupon.generate);
router.post('/coupon/generate',  coupon.processGenerate);

router.get('/user/modify',                user.edit);
router.post('/user/modify',               user.processEdit);

module.exports = router.middleware();

/* - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -  */


text:
package org.wso2.andes.nclient.util;

import org.wso2.andes.nclient.MessagePartListener;
import org.wso2.andes.transport.DeliveryProperties;
import org.wso2.andes.transport.MessageProperties;
import org.wso2.andes.transport.MessageTransfer;
import org.wso2.andes.transport.Struct;

import java.io.IOException;
import java.nio.ByteBuffer;

/**
 * This is a simple message assembler.
 * Will call onMessage method of the adaptee
 * when all message data is read.
 *
 * This is a good convinience utility for handling
 * small messages
 */
public class MessagePartListenerAdapter implements MessagePartListener
{
	MessageListener _adaptee;
    ByteBufferMessage _currentMsg;

	public MessagePartListenerAdapter(MessageListener listener)
	{
		_adaptee = listener;
    }

    public void messageTransfer(MessageTransfer xfr)
    {
        _currentMsg = new ByteBufferMessage(xfr.getId());

        for (Struct st : xfr.getHeader().getStructs())
        {
            if(st instanceof DeliveryProperties)
            {
                _currentMsg.setDeliveryProperties((DeliveryProperties)st);

            }
            else if(st instanceof MessageProperties)
            {
                _currentMsg.setMessageProperties((MessageProperties)st);
            }

        }

        ByteBuffer body = xfr.getBody();
        if (body == null)
        {
            body = ByteBuffer.allocate(0);
        }

        try
        {
            _currentMsg.appendData(body);
        }
        catch(IOException e)
        {
            // A chance for IO exception
            // doesn't occur as we are using
            // a ByteBuffer
        }

        _adaptee.onMessage(_currentMsg);
    }

}


text:
class Account
  include Mongoid::Document
  referenced_in :creator, :class_name => "User", :foreign_key => :creator_id
  field :number
end


text:
var bcrypt = require('bcrypt');

module.exports = {
    attributes: {
        email: {
            type: 'email',
            required: true,
            unique: true
        },
        password: {
            type: 'string',
            minLength: 6,
            required: true
        },
        toJSON: function() {
            var obj = this.toObject();
            delete obj.password;
            return obj;
        }
    },
    beforeCreate: function(user, cb) {
        bcrypt.genSalt(10, function(err, salt) {
            bcrypt.hash(user.password, salt, function(err, hash) {
                if (err) {
                    console.log(err);
                    cb(err);
                } else {
                    user.password = hash;
                    cb();
                }
            });
        });
    }
};


text:
<?xml version="1.0" ?>

<container xmlns="http://symfony.com/schema/dic/services"
    xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
    xsi:schemaLocation="http://symfony.com/schema/dic/services http://symfony.com/schema/dic/services/services-1.0.xsd">

    <services>
        <service id="black_article.config.form" factory-method="createNamed" factory-service="form.factory" class="Symfony\Component\Form\Form">
            <argument>%black_article.config.form.article_config_name%</argument>
            <argument type="service" id="black_article.config.form.type" />
            <argument>null</argument>
        </service>

        <service id="black_article.config.form.type" class="%black_article.config.form.article_config_type%">
            <argument>%black_config.config.model.class%</argument>
            <tag name="form.type" alias="black_article_config" />
        </service>

        <service id="black_article.config.form.handler" class="%black_article.config.form.article_config_handler%" scope="request" public="true">
            <argument type="service" id="black_article.config.form" />
            <argument type="service" id="request" />
            <argument type="service" id="session" />
            <argument type="service" id="doctrine_mongodb" />
        </service>
    </services>
</container>


text:
import '../../src/dev/server';

import app from '../../src/dev/app';

jest.mock('../../src/dev/app', () => ({
  set: jest.fn(),
  get: jest.fn(() => 9999),
  listen: jest.fn((port, fn) => fn()),
}));

jest.mock('../../src/lib/defaultLogger', () => ({
  info: jest.fn(),
}));

describe('dev/server', () => {
  it('sets the port appropriately', () => {
    expect(app.set).toHaveBeenCalledWith('port', 8080);
  });

  it('calls the listen method with the correct arguments', () => {
    expect(app.listen.mock.calls[0][0]).toBe(9999);
  });

  it('correctly sets the mode based on the env', () => {
    jest.resetModules();

    process.env.NODE_ENV = 'production';

    // eslint-disable-next-line global-require
    const logger = require('../../src/lib/defaultLogger');
    const spy = jest.spyOn(logger, 'info');

    // eslint-disable-next-line global-require
    require('../../src/dev/server');

    expect(spy).toHaveBeenCalledWith(
      expect.stringMatching(/running in live mode/),
    );
  });
});


text:
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
var kjsx_1 = require("kjsx");
var IdentityButtonViewModel = /** @class */ (function () {
    function IdentityButtonViewModel() {
    }
    IdentityButtonViewModel.prototype.render = function () {
        var _this = this;
        var logged = this.props.identity.logged;
        var account = this.props.identity.account;
        var menu = this.props.identity.menu;
        if (!menu)
            return kjsx_1.React.createElement("div", null);
        var login = function () { return _this.props.identity.goToLogin(function () { return _this.props.identity.app.hidePopin(); }); };
        var toggle = function () { return menu.collapsed(!menu.collapsed()); };
        return kjsx_1.React.createElement("div", null,
            kjsx_1.ko_if(logged, function () {
                return kjsx_1.React.createElement("div", null,
                    kjsx_1.React.createElement("button", { click: toggle }, account().userName),
                    kjsx_1.ko_ifnot(menu.collapsed, function () {
                        return kjsx_1.React.createElement("ul", null,
                            " ",
                            kjsx_1.ko_foreach(menu.menu, function (m) {
                                return kjsx_1.React.createElement("li", { visible: m.visible });
                            }));
                    }));
            }),
            kjsx_1.ko_ifnot(logged, function () {
                return kjsx_1.React.createElement("button", { click: login }, "Login");
            }),
            " ");
    };
    return IdentityButtonViewModel;
}());
exports.default = IdentityButtonViewModel;


text:
⚠ This package is **deprecated** and should not be referenced. It will be removed in a future version of MSBuild.

Contains `Microsoft.Build.Engine.dll`, which is provided with MSBuild for compatibility purposes.


text:
            reason = "futures in libcore are unstable",
            issue = "50547")]

//! Types and Traits for working with asynchronous tasks.

mod poll;
pub use self::poll::Poll;

mod wake;
pub use self::wake::{Waker, LocalWaker, UnsafeWake};


text:
> Utility to manage local disks and volumes.

- List all currently available disks, partitions and mounted volumes:

`diskutil list`

- Repair the file system data structures of a volume:

`diskutil repairVolume {{/dev/diskX}}`

- Unmount a volume:

`diskutil unmountDisk {{/dev/diskX}}`

- Eject a CD/DVD (unmount first):

`diskutil eject {{/dev/disk1}}`