text:
require File.dirname(__FILE__) + '/condition_parser'
require 'rubygems'
require 'oniguruma'
# This class is responsible for replacing regular expressions
# It formats regexps according to the given pattern.
# ---
# @package
class RegexpHandler
  # Initializes the handle with the given expression
  #
  # ==== Parameters
  # expr<String>::
  #   The replacement expression with the formant:
  #   <text>/<regexp>/<format>/<opts>
  def initialize(expr)
    @expression = expr
  end

  # Evaluates the given expression and returns the substituted/transformed text
  #
  # ===== Returns
  # String::
  #   The translated text is returned.
  def replace
    re = Oniguruma::ORegexp.new(regexp, options)
    result = re.send(sub_method, text) do |match|
      fold_cases(replace_tags(apply_conditionals(match), match))
    end
    translate_special_chars(result)
  end

  private

  # Translates '\n' to "\n" and '\t' to "\t". Those strings might be escaped
  # through '\\\n' and '\\\t' which will be translated to '\n' and '\t'.
  #
  # ==== Parameters
  # string<String>:: The string which should be translated
  #
  # ==== Returns
  # String:: The translated string is returned.
  def translate_special_chars(string)
    result = ""
    i = 0
    while i < string.size
      chunk, i = parse_chunk(string, i)
      result += chunk
    end
    result
  end

  # This method parses a chunk of the given string.
  #
  # ==== Parameters
  # string<String>:: The string which should be parsed for \t's and \n's.
  # i<Fixnum>:: The position in the string at which the parser currently is.
  #
  # ==== Returns
  # Array[String, i]::
  #   A tuple is returned with the chunk parsed an the new parser-position
  def parse_chunk(string, i)
    case string[i, string.size]
    when /^\\\\(t|n).*/
      [ string[i + 1, 2], i + 4 ]
    when /^\\(t|n).*/
      [(string[i, 2] == '\t') ? "\t" : "\n", i + 2 ]
    else
      [ string[i].chr, i + 1 ]
    end
  end

  # Returns the method for the given element.
  #
  # ==== Parameters
  # elem<String>::
  #   Either u, U, l or L
  #
  # ==== Returns
  # Symbol::
  #   The method on the stirng, which should be called for tranlations is
  #   returned.
  def method_for(elem)
    case elem
    when /(u|U)/
      :upcase
    when /(l|L)/
      :downcase
    end
  end

  # Returns the remaining upcase letters for the given element(s)
  #
  # ==== Parameters
  # elem<String|Array[String]>::
  #   A list of elements, or a single element which might be U, L or E.
  #
  # ==== Returns
  # Array[String]::
  #   A list of elements is returned which includes all available
  #   case-transformers except those in the given elem.
  def remaining_elements(elem)
    [ 'U', 'L', 'E' ] - [* elem ]
  end

  # Folds the cases (\u \U \l \L \E) for the given string.
  #
  # ==== Parameters
  # str<String>::
  #   The string, which should be translated.
  #
  # ==== Returns
  # String::
  #   A translated string is returned.
  def fold_cases(str)
    str = handle_single_chars(str)
    handle_multi_chars(str).gsub(/([^\\])(\\(u|U|l|L|E))/, '\1')
  end

  # Handles the transformers, which apply to a single char.
  #
  # ==== Parameters
  # str<String>::
  #   A string, which should be replaced.
  #
  # ==== Returns
  # String::
  #   The translated string is returned.
  def handle_single_chars(str)
    str = [ 'u', 'l' ].inject(str) do |str, elem|
      while pos = next_element(str, elem)
        next str unless pos
        str = modify_letter(str, pos + 2, method_for(elem))
      end
      str
    end
  end

  # Handles the transformers, which apply to a multiple chars.
  #
  # ==== Parameters
  # str<String>::
  #   A string, which should be replaced.
  #
  # ==== Returns
  # String::
  #   The translated string is returned.
  def handle_multi_chars(str)
    while (pos = next_element_result(str, 'U', 'L'))
      elem, start_pos = pos
      next_pos = next_element(
        str[start_pos, str.size],
        *remaining_elements(elem)
      ) - 2 rescue str.size - start_pos
      next_pos += start_pos
      str = modify_string(str, start_pos, next_pos, method_for(elem))
    end
    str
  end

  # This method is similar to #next_element, except that it returns an array
  # with the element, what matched as first element, and the position in the
  # given str as second parameter.
  #
  # ==== Parameters
  # str<String>:: The string, which should be searched.
  # *elems<String>:: The elements, for which the string should be searched
  #
  # ==== Returns
  # Array[String, Fixnum]::
  #   An tuple with the matched element and the position in the string is
  #   returned.
  def next_element_result(str, *elems)
    pos = next_element(str, *elems)
    return nil unless pos
    [ str[pos + 1].chr, pos ]
  end

  # Modifies the given string at the given start <-> stop range by calling
  # the given method on the substring.
  #
  # ==== Parameters
  # str<String>:: The string, which should be modified
  # start<Fixnum>:: The start position of the string
  # stop<Fixnum>:: The end position of the string
  # method<Symbol>:: The method which should be called on the substring
  #
  # ==== Returns
  # String:: The modified string is returned.
  def modify_string(str, start, stop, method)
    start += 2      # modify the positions because of \L, \U, ..
    stop  += 2
    str[start, stop - start] = str[start, stop - start].send(method)
    str[start - 2, 2] = ''  # Delete the old mark
    str
  end

  # Returns the position of the element in the given string.
  # If multiple elements are given the nearest will be returned.
  #
  # ==== Parameters
  # str<String>:: The string which should be searched
  # elems<Array[String]>::
  # The list of elements which should be found in str
  #
  # ==== Returns
  # Fixnum:: The position of the element, or nil
  def next_element(str, *elems)
    pos = elems.inject(str.size) do |pos, elem|
      new_pos = str =~ /\\#{elem}/
      next pos unless new_pos
      new_pos < pos ? new_pos : pos
    end
    pos == str.size ? nil : pos
  end

  # Modifies a letter in the given str on the given position using the given
  # method.
  #
  # ==== Parameters
  # str<String>:: The string which should be modified
  # pos<Fixnum>:: The position on which the element was found
  # method<Symbol:: The method with which the element should be modified.
  #
  # ==== Returns
  # String:: The translated string is returned.
  def modify_letter(str, pos, method)
    str[pos] = str[pos].chr.send(method)
    str[pos - 2, 2] = ''    # remove mark
    str
  end

  # Replaces the \0, \1, ... tags with the matched value
  #
  # ==== Parameters
  # string<String>::
  #   The string which contains the \0, \1, ... tags
  # tags<MatchData>::
  #   The tags, which contain the corresponding tags
  def replace_tags(string, tags)
    string.gsub(/\\(\d+)/) do |match|
      pos = match[1, match.size].to_i
      tags[pos]
    end
  end

  # Applies the conditionals to the given matched tags
  #
  # ==== Parameters
  # match<MatchData>::
  #   The match-data, which contains the matched subgroups in the regexp
  #
  # ==== Returns
  # String::
  #   The evaluated condition expression will be returned. This expression must
  #   still be fold-translated and tag-replaced.
  def apply_conditionals(match)
    cond = replace_conditionals(match)
    re = Oniguruma::ORegexp.new(regexp, options)
    ConditionParser.new(cond).evaluate
  end

  # Replaces the format with the given match-data
  #
  # ==== Parameters
  # match<MatchData>::
  #   The match-data, which contains the matched subgroups in the regexp
  #
  # ==== Returns
  # String::
  #   The evaluated condition expression will be returned. This expression must
  #   still be fold-translated and tag-replaced.
  def replace_conditionals(match)
    match = match[0] if match.kind_of? Array
    format.gsub(/[^\\]?\?\d/) do |m| # search for ?1, ?2, ?... expressions
      str = match[m[-1].chr.to_i] ? "MATCH" : '' # m[-1] = 1, or 2, ...
      "#{m[0, 2]}#{str}"    # return (?MATCH or (?
    end
  end

  # Returns the text part of the expression
  #
  # ==== Returns
  # String:: The text-part of the expression is returned.
  def text
    @expression[0, @expression.index('/')]
  end

  # Returns the expression part of the expression
  #
  # ==== Returns
  # String:: The expression-part of the expression is returned.
  def expr
    @expression[@expression.index('/'), @expression.size]
  end

  # Returns the regexp part of the expression
  #
  # ==== Returns
  # String:: The regexp-part of the expression is returned.
  def regexp
    @regexp ||= expr.match(regexp_for_expression)[1]
  end

  # Returns the options-part of the translation-expression
  #
  # ==== Returns
  # String::
  #   The options of the given translation-expressions are returned
  #   (a string including one or more of the following characters: imxog)
  #   If no options-part is existing, "" is returned.
  def options
  	@options ||= (expr.match(regexp_for_expression)[3]).gsub('g', '')
  end

  # Returns the sub-method, which should be used for the regular expression.
  #
  # ==== Returns
  # String::
  #   'gsub' is returned if the options include a 'g', otherwise 'sub' is
  #   returned.
  def sub_method
  	expr.match(regexp_for_expression)[3].include?('g') ? 'gsub' : 'sub'
  end

  # Returns the match-method, which should be used for the regular expression.
  #
  # ==== Returns
  # String::
  #   'scan' is returned if the options include a 'g', otherwise 'match' is
  #   returned.
  def match_method
  	expr.match(regexp_for_expression)[3].include?('g') ? 'scan' : 'match'
  end

  # Returns the format part of the expression
  #
  # ==== Returns
  # String:: The format-part of the expression is returned.
  def format
    @format ||= transform_placeholders(expr.match(regexp_for_expression)[2])
  end

  # Transforms the placeholders from $0 $1 to \0 \1
  #
  # ==== Parameters
  # str<String>:: The format-string which should be substituded.
  #
  # ==== Returns
  # String:: The substituted placeholders are returned.
  def transform_placeholders(str)
    str.gsub(/(\$\d|\$\{\d\})/) do |match|
      tmp = match[1, match.size]
      tmp = tmp[1].chr if tmp.size > 1
      "\\#{tmp}"
    end
  end

  # Returns the regular expression used for matching.
  #
  # ==== Returns
  # Regexp:: A regular expression is returned.
  def regexp_for_expression
    @regexp_for_expression ||= %r{
      [^\\]?/         # The beginning consists of the first unescaped '/'
      (.*[^\\])       # Now we want to match the whole text until the next
                      # '/'. We are allowing '\' to escape '/' in the text.
                      # thus there shouldn't be a '\' before the middle '/'.
      /               # The central slash: /some\/text/
      (.*[^\\])       # Just the same as above: /some\/text\/some\/text
      /               # the final slash, we are nearly done!
      ([imxog]*)      # some optional options
    }xm
  end
end


text:
cask 'wwdc' do
  version '5.0.4'
  sha256 '7d724e63fdc84c7eed67ea618ee1cf513aa0154581672353012457fc34c4d50d'

  # github.com/insidegui/WWDC was verified as official when first introduced to the cask
  url "https://github.com/insidegui/WWDC/releases/download/#{version}/WWDC_v#{version}.zip"
  appcast 'https://github.com/insidegui/WWDC/releases.atom',
          checkpoint: '10ae8c5b6bc7fc1bd09cac9ddc70528fad3fac49cc24288a96c6952d3733ddc8'
  name 'WWDC'
  homepage 'https://wwdc.io/'

  auto_updates true

  app 'WWDC.app'

  zap delete: [
                '~/Library/Application Support/br.com.guilhermerambo.WWDC',
                '~/Library/Caches/br.com.guilhermerambo.WWDC',
                '~/Library/Preferences/br.com.guilhermerambo.WWDC.plist',
              ]
end

redpajama_set_name: RedPajamaGithub


text:
#ifndef UAVCAN_NODE_GLOBAL_DATA_TYPE_REGISTRY_HPP_INCLUDED
#define UAVCAN_NODE_GLOBAL_DATA_TYPE_REGISTRY_HPP_INCLUDED

#include <cassert>
#include <uavcan/error.hpp>
#include <uavcan/std.hpp>
#include <uavcan/data_type.hpp>
#include <uavcan/util/templates.hpp>
#include <uavcan/util/linked_list.hpp>
#if UAVCAN_DEBUG
# include <uavcan/debug.hpp>
#endif

namespace uavcan
{
/**
 * This singleton is shared among all existing node instances. It is instantiated automatically
 * when the C++ runtime executes contstructors before main().
 *
 * Its purpose is to keep the list of all UAVCAN data types known and used by this application.
 *
 * Also, the mapping between Data Type name and its Data Type ID is also stored in this singleton.
 * UAVCAN data types with default Data Type ID that are autogenerated by the libuavcan DSDL compiler
 * are registered automatically before main() (refer to the generated headers to see how exactly).
 * Data types that don't have a default Data Type ID must be registered manually using the methods
 * of this class (read the method documentation).
 *
 * Attempt to use a data type that was not registered with this singleton (e.g. publish, subscribe,
 * perform a service call etc.) will fail with an error code @ref ErrUnknownDataType.
 */
class UAVCAN_EXPORT GlobalDataTypeRegistry : Noncopyable
{
    struct Entry : public LinkedListNode<Entry>
    {
        DataTypeDescriptor descriptor;

        Entry() { }

        Entry(DataTypeKind kind, DataTypeID id, const DataTypeSignature& signature, const char* name)
            : descriptor(kind, id, signature, name)
        { }
    };

    struct EntryInsertionComparator
    {
        const DataTypeID id;
        explicit EntryInsertionComparator(const Entry* dtd)
            : id((dtd == UAVCAN_NULLPTR) ? DataTypeID() : dtd->descriptor.getID())
        {
            UAVCAN_ASSERT(dtd != UAVCAN_NULLPTR);
        }
        bool operator()(const Entry* entry) const
        {
            UAVCAN_ASSERT(entry != UAVCAN_NULLPTR);
            return entry->descriptor.getID() > id;
        }
    };

public:
    /**
     * Result of data type registration
     */
    enum RegistrationResult
    {
        RegistrationResultOk,            ///< Success, data type is now registered and can be used.
        RegistrationResultCollision,     ///< Data type name or ID is not unique.
        RegistrationResultInvalidParams, ///< Invalid input parameters.
        RegistrationResultFrozen         ///< Data Type Registery has been frozen and can't be modified anymore.
    };

private:
    typedef LinkedListRoot<Entry> List;
    mutable List msgs_;
    mutable List srvs_;
    bool frozen_;

    GlobalDataTypeRegistry() : frozen_(false) { }

    List* selectList(DataTypeKind kind) const;

    RegistrationResult remove(Entry* dtd);
    RegistrationResult registImpl(Entry* dtd);

public:
    /**
     * Returns the reference to the singleton.
     */
    static GlobalDataTypeRegistry& instance();

    /**
     * Register a data type 'Type' with ID 'id'.
     * If this data type was registered earlier, its old registration will be overridden.
     * This method will fail if the data type registry is frozen.
     *
     * @tparam Type     Autogenerated UAVCAN data type to register. Data types are generated by the
     *                  libuavcan DSDL compiler from DSDL definitions.
     *
     * @param id        Data Type ID for this data type.
     */
    template <typename Type>
    RegistrationResult registerDataType(DataTypeID id);

    /**
     * Data Type registry needs to be frozen before a node instance can use it in
     * order to prevent accidental change in data type configuration on a running
     * node.
     *
     * This method will be called automatically by the node during start up, so
     * the user does not need to call it from the application manually. Subsequent
     * calls will not have any effect.
     *
     * Once frozen, data type registry can't be unfrozen.
     */
    void freeze();
    bool isFrozen() const { return frozen_; }

    /**
     * Finds data type descriptor by full data type name, e.g. "uavcan.protocol.NodeStatus".
     * Messages are searched first, then services.
     * Returns null pointer if the data type with this name is not registered.
     * @param name  Full data type name
     * @return      Descriptor for this data type or null pointer if not found
     */
    const DataTypeDescriptor* find(const char* name) const;

    /**
     * Finds data type descriptor by full data type name, e.g. "uavcan.protocol.NodeStatus", and data type kind.
     * Returns null pointer if the data type with this name is not registered.
     * @param kind  Data Type Kind - message or service
     * @param name  Full data type name
     * @return      Descriptor for this data type or null pointer if not found
     */
    const DataTypeDescriptor* find(DataTypeKind kind, const char* name) const;

    /**
     * Finds data type descriptor by data type ID.
     * Returns null pointer if the data type with this ID is not registered.
     * @param kind  Data Type Kind - message or service
     * @param dtid  Data Type ID
     * @return      Descriptor for this data type or null pointer if not found
     */
    const DataTypeDescriptor* find(DataTypeKind kind, DataTypeID dtid) const;

    /**
     * Returns the number of registered message types.
     */
    unsigned getNumMessageTypes() const { return msgs_.getLength(); }

    /**
     * Returns the number of registered service types.
     */
    unsigned getNumServiceTypes() const { return srvs_.getLength(); }

#if UAVCAN_DEBUG
    /// Required for unit testing
    void reset()
    {
        UAVCAN_TRACE("GlobalDataTypeRegistry", "Reset; was frozen: %i, num msgs: %u, num srvs: %u",
                     int(frozen_), getNumMessageTypes(), getNumServiceTypes());
        frozen_ = false;
        while (msgs_.get())
        {
            msgs_.remove(msgs_.get());
        }
        while (srvs_.get())
        {
            srvs_.remove(srvs_.get());
        }
    }
#endif
};

/**
 * This class is used by autogenerated data types to register with the
 * data type registry automatically before main() is called. Note that
 * if a generated data type header file is not included by any translation
 * unit of the application, the data type will not be registered.
 *
 * Data type needs to have a default ID to be registrable by this class.
 */
template <typename Type>
struct UAVCAN_EXPORT DefaultDataTypeRegistrator
{
    DefaultDataTypeRegistrator()
    {
#if !UAVCAN_NO_GLOBAL_DATA_TYPE_REGISTRY
        const GlobalDataTypeRegistry::RegistrationResult res =
            GlobalDataTypeRegistry::instance().registerDataType<Type>(Type::DefaultDataTypeID);

        if (res != GlobalDataTypeRegistry::RegistrationResultOk)
        {
            handleFatalError("Type reg failed");
        }
#endif
    }
};

// ----------------------------------------------------------------------------

/*
 * GlobalDataTypeRegistry
 */
template <typename Type>
GlobalDataTypeRegistry::RegistrationResult GlobalDataTypeRegistry::registerDataType(DataTypeID id)
{
    if (isFrozen())
    {
        return RegistrationResultFrozen;
    }

    static Entry entry;

    {
        const RegistrationResult remove_res = remove(&entry);
        if (remove_res != RegistrationResultOk)
        {
            return remove_res;
        }
    }

    // We can't just overwrite the entry itself because it's noncopyable
    entry.descriptor = DataTypeDescriptor(DataTypeKind(Type::DataTypeKind), id,
                                          Type::getDataTypeSignature(), Type::getDataTypeFullName());

    {
        const RegistrationResult remove_res = remove(&entry);
        if (remove_res != RegistrationResultOk)
        {
            return remove_res;
        }
    }
    return registImpl(&entry);
}

}

#endif // UAVCAN_NODE_GLOBAL_DATA_TYPE_REGISTRY_HPP_INCLUDED


text:
(function (global, factory) {
    typeof exports === 'object' && typeof module !== 'undefined' ? factory(exports) :
    typeof define === 'function' && define.amd ? define(['exports'], factory) :
    (global = typeof globalThis !== 'undefined' ? globalThis : global || self, factory(global.pictureparkPickers = {}));
})(this, (function (exports) { 'use strict';

    /**
     * Opens a content picker window to select content items and create an embedded share.
     *
     * @param serverUrl The URL of the Picturepark server
     * @param settings Settings on how to open the content picker
     */
    function showContentPicker(serverUrl, settings) {
        return new Promise((resolve, reject) => {
            var _a, _b, _c;
            const w = (_a = settings === null || settings === void 0 ? void 0 : settings.width) !== null && _a !== void 0 ? _a : 1281;
            const h = (_b = settings === null || settings === void 0 ? void 0 : settings.height) !== null && _b !== void 0 ? _b : 800;
            var dualScreenLeft = window.screenLeft != undefined ? window.screenLeft : screen.left;
            var dualScreenTop = window.screenTop != undefined ? window.screenTop : screen.top;
            var width = window.innerWidth ? window.innerWidth : document.documentElement.clientWidth ? document.documentElement.clientWidth : screen.width;
            var height = window.innerHeight ? window.innerHeight : document.documentElement.clientHeight ? document.documentElement.clientHeight : screen.height;
            var left = ((width / 2) - (w / 2)) + dualScreenLeft;
            var top = ((height / 2) - (h / 2)) + dualScreenTop;
            let url = serverUrl + (serverUrl.includes('?') ? '&' : '?') + 'postUrl=' + encodeURIComponent(window.location.origin);
            url += `&returnType=${encodeURIComponent((_c = settings === null || settings === void 0 ? void 0 : settings.returnType) !== null && _c !== void 0 ? _c : 'embed')}`;
            if (settings === null || settings === void 0 ? void 0 : settings.embedName)
                url += `&embedName=${encodeURIComponent(settings.embedName)}`;
            if (settings === null || settings === void 0 ? void 0 : settings.enableMediaEditor)
                url += `&enableMediaEditor=true`;
            if (settings === null || settings === void 0 ? void 0 : settings.mediaEditorUnlockPreset)
                url += `&mediaEditorUnlockPreset=true`;
            var popup = window.open(url, '_blank', 'width=' + w + ', height=' + h + ', top=' + top + ', left=' + left + ',status=no,location=no,toolbar=no');
            var callbackCalled = false;
            const messageReceived = (event) => {
                if ((settings === null || settings === void 0 ? void 0 : settings.debug) && console) {
                    console.log("CP Message received:");
                    console.log(event);
                }
                if (serverUrl.startsWith(event.origin)) {
                    window.removeEventListener("message", messageReceived);
                    var result = event.data && event.data !== 'undefined' ? JSON.parse(event.data) : undefined;
                    if (!callbackCalled) {
                        callbackCalled = true;
                        setTimeout(() => {
                            popup.close();
                            resolve(result);
                        });
                    }
                }
            };
            const checkClosed = () => {
                if (popup.closed) {
                    window.removeEventListener("message", messageReceived);
                    if (!callbackCalled) {
                        callbackCalled = true;
                        resolve(undefined);
                    }
                }
                else {
                    setTimeout(() => checkClosed(), 100);
                }
            };
            window.addEventListener("message", messageReceived);
            checkClosed();
        });
    }

    exports.showContentPicker = showContentPicker;

    Object.defineProperty(exports, '__esModule', { value: true });

}));


text:
LIBTOOL	= glibtool
CC	= gcc

CFLAGS  = -W -Wall -Werror
LDFLAGS = -lobjc

all: cbindings

cBindings.lo: Makefile cBindings.h cBindings.m MyClass.h
	$(LIBTOOL) --mode=compile $(CC) $(CFLAGS) -c cBindings.m

main.lo: Makefile main.c cBindings.h
	$(LIBTOOL) --mode=compile $(CC) $(CFLAGS) -c main.c

MyClass.lo: Makefile MyClass.h MyClass.m
	$(LIBTOOL) --mode=compile $(CC) $(CFLAGS) -c MyClass.m

cbindings: Makefile cBindings.lo main.lo MyClass.lo
	$(LIBTOOL) --mode=link    $(CC) $(LDFLAGS) -o cbindings \
			cBindings.lo MyClass.lo main.lo

clean:
	$(LIBTOOL) --mode=clean rm -f cbindings
	$(LIBTOOL) --mode=clean rm -f cBindings.lo
	$(LIBTOOL) --mode=clean rm -f MyClass.lo
	$(LIBTOOL) --mode=clean rm -f main.lo
	rm -f a.out


text:
import Ember from 'ember';
import layout from '../templates/components/ember-range-slider-handle';

export default Ember.Component.extend({
  layout,
  attributeBindings: ['style'],
  classNameBindings: ['isSliding']
});


text:
package io.katharsis.utils.parser;

import java.io.Serializable;
import java.lang.reflect.Constructor;
import java.lang.reflect.InvocationTargetException;
import java.math.BigDecimal;
import java.math.BigInteger;
import java.util.LinkedList;
import java.util.List;

/**
 * Parses {@link String} into an instance of provided {@link Class}. It support the following classes:
 *

 *
{@link String}

 *
{@link Byte} and {@link byte}

 *
{@link Short} and {@link short}

 *
{@link Integer} and {@link int}

 *
{@link Long} and {@link long}

 *
{@link Float} and {@link float}

 *
{@link Double} and {@link double}

 *
{@link BigInteger}

 *
{@link BigDecimal}

 *
{@link Character} and {@link char}

 *
{@link Boolean} and {@link boolean}

 *
An {@link Enum}

 *
A class with a {@link String} only constructor

 *

 */
public class TypeParser {

    /**
     * Parses an {@link Iterable} of String instances to {@link Iterable} of parsed values.
     * @param inputs list of Strings
     * @param clazz type to be parsed to
     * @param <T> type of class
     * @return {@link Iterable} of parsed values
     */
    public <T extends Serializable> Iterable<T> parse(Iterable<String> inputs, Class<T> clazz) {
        List<T> parsedValues = new LinkedList<>();
        for (String input : inputs) {
            parsedValues.add(parse(input, clazz));
        }

        return parsedValues;
    }

    /**
     * Parses a {@link String} to an instance of passed {@link Class}
     * @param input String value
     * @param clazz type to be parsed to
     * @param <T> type of class
     * @return instance of parsed value
     */
    public <T extends Serializable> T parse(String input, Class<T> clazz) {
        try {
            return parseInput(input, clazz);
        } catch (InvocationTargetException | InstantiationException | IllegalAccessException | NoSuchMethodException |
                NumberFormatException | ParserException
                e) {
            throw new ParserException(e.getMessage());
        }
    }

    @SuppressWarnings("unchecked")
    private <T extends Serializable> T parseInput(String input, Class<T> clazz)
            throws NoSuchMethodException, IllegalAccessException, InvocationTargetException, InstantiationException {
        T parsedValue;
        if (String.class.equals(clazz)) {
            parsedValue = (T) input;
        } else if (StandardTypeParsers.parsers.containsKey(clazz)) {
            StandardTypeParser standardTypeParser = StandardTypeParsers.parsers.get(clazz);

            parsedValue = (T) standardTypeParser.parse(input);
        } else if (isEnum(clazz)) {
            parsedValue = (T) Enum.valueOf((Class<Enum>)clazz.asSubclass(Enum.class), input.trim());
        } else if (containsStringConstructor(clazz)) {
            parsedValue = clazz.getDeclaredConstructor(String.class).newInstance(input);
        } else {
            throw new ParserException(String.format("Cannot parse to %s : %s", clazz.getName(), input));
        }
        return parsedValue;
    }

    private <T extends Serializable> boolean isEnum(Class<T> clazz) {
        return clazz.isEnum();
    }

    private boolean containsStringConstructor(Class<?> clazz) throws NoSuchMethodException {
        boolean result = false;
        for (Constructor constructor : clazz.getDeclaredConstructors()) {
            if (constructor.getParameterCount() == 1 && constructor.getParameterTypes()[0] == String.class) {
                result = true;
            }
        }
        return result;
    }
}


text:
'use strict';

angular.module('webApp')
  .controller('MapCtrl', function ($scope) {
    $scope.myMarkers = [];

    $scope.mapOptions = {
      center: new google.maps.LatLng(49, 24),
      zoom: 5,
      mapTypeId: google.maps.MapTypeId.ROADMAP,
      scrollwheel: true,
      disableDefaultUI: true,
      mapTypeControl: false,
      scaleControl: false,
      draggable: true
    };

    $scope.openMarkerInfo = function(marker) {
      if (marker.order) {
        $scope.currentOrder = marker.order;
        $scope.myInfoWindow.open($scope.myMap, marker);
      }
    };

    $scope.$on('newOrders', function() {
      $scope.stream.forEach(function(order) {
        if (order.marker) { return; }
        var marker = new google.maps.Marker({
          map: $scope.myMap,
          position: new google.maps.LatLng(order.geoLat, order.geoLong),
          animation: google.maps.Animation.DROP
        });
        order.marker = marker;
        marker.order = order;
        $scope.myMarkers.push(marker);
      });
    });

    $scope.$on('showOrder', function(event, order) {
      if (order.marker) {
        $scope.openMarkerInfo(order.marker);
        $scope.myMap.panTo(order.marker.getPosition());
        $scope.myMap.setZoom(7);
      }
    });

    $scope.$on('reset', function() {
      $scope.myMarkers.forEach(function(marker) {
        marker.setMap(null);
      });
      $scope.myMarkers = [];
    });
  });


text:
<?xml version="1.0" encoding="UTF-8" standalone="yes"?>

<!--
  Copyright 2016 Goldman Sachs.
  Licensed under the Apache License, Version 2.0 (the "License");
  you may not use this file except in compliance with the License.
  You may obtain a copy of the License at

    http://www.apache.org/licenses/LICENSE-2.0

  Unless required by applicable law or agreed to in writing,
  software distributed under the License is distributed on an
  "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
  KIND, either express or implied.  See the License for the
  specific language governing permissions and limitations
  under the License.
  -->

<MithraObject objectType="transactional"
              xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
              xsi:noNamespaceSchemaLocation="../../../xml/mithra/mithraobject.xsd">
    <PackageName>com.gs.fw.common.mithra.test.domain</PackageName>
    <ClassName>TestAsOfToTimestampJoinObjectA</ClassName>
    <DefaultTable>TEST_ASOF_TO_TIMESTAMP_A</DefaultTable>

    <AsOfAttribute name="businessDate" fromColumnName="FROM_Z" toColumnName="THRU_Z" toIsInclusive="false"
        infinityDate="[com.gs.fw.common.mithra.test.TestInfinityTimestamp.getDefaultInfinity()]"/>
    <Attribute name="id" javaType="int" columnName="ID" primaryKey="true"/>

    <Relationship name="b" relatedObject="TestAsOfToTimestampJoinObjectB" cardinality="many-to-one">
        TestAsOfToTimestampJoinObjectB.businessDate = this.businessDate and
        TestAsOfToTimestampJoinObjectB.id = 1
    </Relationship>

</MithraObject>


text:
var expect = require('chai').expect;
var tests = require('./lib/tests');

describe('Mixin', function() {
    var generateDOM = tests.generateDOM,
        generateHTML = tests.generateHTML,
        prepare = tests.prepare.bind(tests),
        createDocument = tests.createDocument;

    describe('default', function () {
        var ctx = prepare(['test_mixin'], 'mixin');
        var scope, tree, document;

        it('default', function() {
            scope = { test: false };
            tree = ctx.tpl(scope);
            document = createDocument();

            generateDOM(tree, document, {
                onchange: function (xxx) {
                    xxx(document.body);
                }
            });

            expect(generateHTML(tree)).to.equal('

');
            expect(document.body.innerHTML).to.equal('

');

            scope.test = [1,2,3];
            ctx.trigger('test');
            expect(generateHTML(tree))
                .to.equal('

1

1 Bob\n

1 Bob\n

2

2 Bob\n

2 Bob\n

3

3 Bob\n

3 Bob\n

');
            expect(document.body.innerHTML)
                .to.equal('

1

1 Bob\n

1 Bob\n

2

2 Bob\n

2 Bob\n

3

3 Bob\n

3 Bob\n

');

            scope.test = [4,3,2];
            ctx.trigger('test');
            expect(generateHTML(tree))
                .to.equal('

4

4 Bob\n

4 Bob\n

3

3 Bob\n

3 Bob\n

2

2 Bob\n

2 Bob\n

');
            expect(document.body.innerHTML)
                .to.equal('

4

4 Bob\n

4 Bob\n

3

3 Bob\n

3 Bob\n

2

2 Bob\n

2 Bob\n

');
        });
    });
});


text:
#pragma once

#include "core/queueSemaphore.h"

namespace Pal
{

class MasterQueueSemaphore;

// =====================================================================================================================
// Specialization of QueueSemaphore to handle Semaphores for the "slave" Semaphore for multi-GPU shared Semaphore
// objects.
class OpenedQueueSemaphore final : public QueueSemaphore
{
public:
    explicit OpenedQueueSemaphore(Device* pDevice);
    virtual ~OpenedQueueSemaphore() { }

    virtual Result Open(const QueueSemaphoreOpenInfo& openInfo) override;

    virtual Result Signal(Queue* pQueue, uint64 value) override;
    virtual Result Wait(
        Queue*         pQueue,
        uint64         value,
        volatile bool* pIsStalled) override;
    virtual Result SignalSemaphoreValue(uint64  value) override;

    // NOTE: Part of the public IQueueSemaphore interface.
    virtual bool HasStalledQueues() override;

private:
    MasterQueueSemaphore*  m_pMaster;

    PAL_DISALLOW_DEFAULT_CTOR(OpenedQueueSemaphore);
    PAL_DISALLOW_COPY_AND_ASSIGN(OpenedQueueSemaphore);
};

} // Pal


text:
local MIXTURE = {}

MIXTURE.ID = 20;

MIXTURE.Results = "drug_beer_box_empty";
MIXTURE.Ingredients = {'item_cardboard', 'item_cardboard'};
MIXTURE.Requires = 	{
						{GENE_INTELLIGENCE, 1},
						{GENE_DEXTERITY, 1},
						{SKILL_CRAFTINESS, 2},
					};

MIXTURE.Free = true;

MIXTURE.RequiresHeatSource = false;
MIXTURE.RequiresWaterSource = false;
MIXTURE.RequiresSawHorse = false;

function MIXTURE.CanMix ( player, pos )
	return true;
end

GM:RegisterMixture(MIXTURE);


text:
gTestsuite = 'e4x';

if (typeof version != 'undefined') {
    // At least in Rhino, if version is set to 150 (which is what is used
    // in top level shell.js), the implementation assumes E4X is not available.
    version(160);
}

/*
 * Report a failure in the 'accepted' manner
 */
function reportFailure (section, msg)
{
    msg = inSection(section)+"\n"+msg;
    var lines = msg.split ("\n");
    for (var i=0; i<lines.length; i++)
        print (FAILED + lines[i]);
}

function START(summary)
{
    SUMMARY = summary;
    printStatus(summary);
}

function TEST(section, expected, actual)
{
    var expected_t = typeof expected;
    var actual_t = typeof actual;
    var output = "";

    SECTION = section;
    EXPECTED = expected;
    ACTUAL = actual;

    return reportCompare(expected, actual, inSection(section) + SUMMARY);
}

function TEST_XML(section, expected, actual)
{
    var actual_t = typeof actual;
    var expected_t = typeof expected;

    SECTION = section;
    EXPECTED = expected;
    ACTUAL = actual;

    if (actual_t != "xml") {
        // force error on type mismatch
        return TEST(section, new XML(), actual);
    }

    if (expected_t == "string") {
        return TEST(section, expected, actual.toXMLString());
    }

    if (expected_t == "number") {
        return TEST(section, String(expected), actual.toXMLString());
    }

    throw section + ": Bad TEST_XML usage: type of expected is " +
        expected_t + ", should be number or string";

    // suppress warning
    return false;
}

function SHOULD_THROW(section)
{
    TEST(section, "exception", "no exception");
}

function END()
{
}

if (typeof options == 'function')
{
  options('xml');
}


text:
package goblet

import (
	"github.com/extrame/goblet/config"
)

const (
	DevelopEnv = config.DevelopEnv
	ProductEnv = config.ProductEnv
)


text:
void AddTask_ClusterQA(
  TString   photonCutNumberV0Reader       = "00200009327000008250400000",
  TString   TaskEventCutnumber            = "00010113",
  TString   TaskClusterCutnumberEMC       = "1111100010022700000",
  TString   TaskClusterCutnumberDMC       = "3885500010022700000",
  TString   TaskMesonCutnumber            = "0163300000000000",
  Int_t     minNLM                        = 1,
  Int_t     maxNLM                        = 1,
  Bool_t    isMC                          = kFALSE,
  Int_t     IsHeavyIon                    = 0,
  Bool_t    kHistograms                   = kTRUE,
  Double_t  kTree                         = 1.0,  // 0. / 0 / kFALSE for no, 1. / 1 / kTRUE for yes,  x > 1.0 will use only 1/x of the event statistics for the tree
  TString   V0ReaderCutNumberAODBranch    = "0000000060084001001500000",
  Bool_t    doEtaShiftV0Reader            = kFALSE,
  Bool_t    enableV0findingEffi           = kFALSE,
  TString   periodNameV0Reader            = "",
  TString   corrTaskSetting = "",
  Int_t     enableExtMatchAndQA           = 5,
  Bool_t    doSaveSurroundingTracks       = 1,
  Bool_t    doSaveSurroundingCells        = 1,
  Float_t   minClusterEnergy              = 2.0,
  Float_t   maxConeRadius                 = 0.6,
  Float_t   minTrackMomentum              = 0.3,
  Bool_t    doSaveClusterCells            = 1,
  Bool_t    doSaveEventProp               = 1,
  Bool_t    enableTriggerOverlapRej       = kTRUE,
  TString   settingMaxFacPtHard           = "3.",       // maximum factor between hardest jet and ptHard generated
  Bool_t    makeAdditionalHistos          = kFALSE
  ){

  // ================== GetAnalysisManager ===============================
  AliAnalysisManager *mgr = AliAnalysisManager::GetAnalysisManager();
  if (!mgr) {
    return ;
  }

  // ================== GetInputEventHandler =============================
  AliVEventHandler *inputHandler=mgr->GetInputEventHandler();

  AliAnalysisDataContainer *cinput = mgr->GetCommonInputContainer();

  //=========  Set Cutnumber for V0Reader ================================
  TString cutnumberPhoton     = photonCutNumberV0Reader.Data();
  TString cutnumberEvent      = "00000003";
  if(IsHeavyIon==1)
    cutnumberEvent = "10000003";
  else if(IsHeavyIon==2)
    cutnumberEvent = "80000003";

  //========= Check V0 Reader in  ANALYSIS manager  =====
  TString V0ReaderName        = Form("V0ReaderV1_%s_%s",cutnumberEvent.Data(),cutnumberPhoton.Data());
  AliV0ReaderV1 *fV0ReaderV1  =  NULL;
  if( !(AliV0ReaderV1*)mgr->GetTask(V0ReaderName.Data()) ){
    cout << "V0Reader: " << V0ReaderName.Data() << " not found!!"<< endl;
    return;
  } else {
    cout << "V0Reader: " << V0ReaderName.Data() << " found!!"<< endl;
  }

TObjArray *rmaxFacPtHardSetting = settingMaxFacPtHard.Tokenize("_");
  if(rmaxFacPtHardSetting->GetEntries()<1){cout << "ERROR: AddTask_ClusterQA during parsing of settingMaxFacPtHard String '" << settingMaxFacPtHard.Data() << "'" << endl; return;}
  Bool_t fMinPtHardSet        = kFALSE;
  Double_t minFacPtHard       = -1;
  Bool_t fMaxPtHardSet        = kFALSE;
  Double_t maxFacPtHard       = 100;
  Bool_t fSingleMaxPtHardSet  = kFALSE;
  Double_t maxFacPtHardSingle = 100;
  for(Int_t i = 0; i<rmaxFacPtHardSetting->GetEntries() ; i++){
    TObjString* tempObjStrPtHardSetting     = (TObjString*) rmaxFacPtHardSetting->At(i);
    TString strTempSetting                  = tempObjStrPtHardSetting->GetString();
    if(strTempSetting.BeginsWith("MINPTHFAC:")){
      strTempSetting.Replace(0,10,"");
      minFacPtHard               = strTempSetting.Atof();
      cout << "running with min pT hard jet fraction of: " << minFacPtHard << endl;
      fMinPtHardSet        = kTRUE;
    } else if(strTempSetting.BeginsWith("MAXPTHFAC:")){
      strTempSetting.Replace(0,10,"");
      maxFacPtHard               = strTempSetting.Atof();
      cout << "running with max pT hard jet fraction of: " << maxFacPtHard << endl;
      fMaxPtHardSet        = kTRUE;
    } else if(strTempSetting.BeginsWith("MAXPTHFACSINGLE:")){
      strTempSetting.Replace(0,16,"");
      maxFacPtHardSingle         = strTempSetting.Atof();
      cout << "running with max single particle pT hard fraction of: " << maxFacPtHardSingle << endl;
      fSingleMaxPtHardSet        = kTRUE;
    } else if(rmaxFacPtHardSetting->GetEntries()==1 && strTempSetting.Atof()>0){
      maxFacPtHard               = strTempSetting.Atof();
      cout << "running with max pT hard jet fraction of: " << maxFacPtHard << endl;
      fMaxPtHardSet        = kTRUE;
    }
  }

  AliConvEventCuts *analysisEventCuts = new AliConvEventCuts();
  analysisEventCuts->SetV0ReaderName(V0ReaderName);

  analysisEventCuts->SetTriggerOverlapRejecion(enableTriggerOverlapRej);
  if(fMinPtHardSet)
    analysisEventCuts->SetMinFacPtHard(minFacPtHard);
  if(fMaxPtHardSet)
    analysisEventCuts->SetMaxFacPtHard(maxFacPtHard);
  if(fSingleMaxPtHardSet)
    analysisEventCuts->SetMaxFacPtHardSingleParticle(maxFacPtHardSingle);
  analysisEventCuts->SetCorrectionTaskSetting(corrTaskSetting);
  if (periodNameV0Reader.CompareTo("") != 0) analysisEventCuts->SetPeriodEnum(periodNameV0Reader);
  analysisEventCuts->InitializeCutsFromCutString(TaskEventCutnumber.Data());
  analysisEventCuts->SetFillCutHistograms("",kFALSE);

  TString caloCutPosEMC = TaskClusterCutnumberEMC;
  caloCutPosEMC.Resize(1);
  TString TrackMatcherNameEMC = Form("CaloTrackMatcher_%s",caloCutPosEMC.Data());
  if( !(AliCaloTrackMatcher*)mgr->GetTask(TrackMatcherNameEMC.Data()) ){
    AliCaloTrackMatcher* fTrackMatcherEMC = new AliCaloTrackMatcher(TrackMatcherNameEMC.Data(),caloCutPosEMC.Atoi());
    fTrackMatcherEMC->SetV0ReaderName(V0ReaderName);
    //fTrackMatcherEMC->SetCorrectionTaskSetting(corrTaskSetting);
    mgr->AddTask(fTrackMatcherEMC);
    mgr->ConnectInput(fTrackMatcherEMC,0,cinput);
  }
  TString caloCutPosDMC = TaskClusterCutnumberDMC;
  caloCutPosDMC.Resize(1);
  TString TrackMatcherNameDMC = Form("CaloTrackMatcher_%s",caloCutPosDMC.Data());
  if( !(AliCaloTrackMatcher*)mgr->GetTask(TrackMatcherNameDMC.Data()) ){
    AliCaloTrackMatcher* fTrackMatcherDMC = new AliCaloTrackMatcher(TrackMatcherNameDMC.Data(),caloCutPosDMC.Atoi());
    fTrackMatcherDMC->SetV0ReaderName(V0ReaderName);
    //fTrackMatcherDMC->SetCorrectionTaskSetting(corrTaskSetting);
    mgr->AddTask(fTrackMatcherDMC);
    mgr->ConnectInput(fTrackMatcherDMC,0,cinput);
  }

  AliCaloPhotonCuts *analysisClusterCutsEMC = new AliCaloPhotonCuts();
  analysisClusterCutsEMC->SetV0ReaderName(V0ReaderName);
  //analysisClusterCutsEMC->SetCorrectionTaskSetting(corrTaskSetting);
  analysisClusterCutsEMC->SetCaloTrackMatcherName(TrackMatcherNameEMC);
  analysisClusterCutsEMC->SetExtendedMatchAndQA(enableExtMatchAndQA);
  analysisClusterCutsEMC->InitializeCutsFromCutString(TaskClusterCutnumberEMC.Data());
  analysisClusterCutsEMC->SetFillCutHistograms("");

  AliCaloPhotonCuts *analysisClusterCutsDMC = new AliCaloPhotonCuts();
  analysisClusterCutsDMC->SetV0ReaderName(V0ReaderName);
  //analysisClusterCutsDMC->SetCorrectionTaskSetting(corrTaskSetting);
  analysisClusterCutsDMC->SetCaloTrackMatcherName(TrackMatcherNameEMC);
  analysisClusterCutsDMC->SetExtendedMatchAndQA(enableExtMatchAndQA);
  analysisClusterCutsDMC->InitializeCutsFromCutString(TaskClusterCutnumberDMC.Data());
  analysisClusterCutsDMC->SetFillCutHistograms("");

  AliConversionMesonCuts *analysisMesonCuts    = new AliConversionMesonCuts();
  analysisMesonCuts->SetEnableOpeningAngleCut(kFALSE);
  analysisMesonCuts->SetIsMergedClusterCut(1);
  analysisMesonCuts->InitializeCutsFromCutString(TaskMesonCutnumber.Data());
  analysisMesonCuts->SetFillCutHistograms("");

  AliAnalysisTaskClusterQA *fQA = new AliAnalysisTaskClusterQA(Form("%s_%s_%s_QA",TaskEventCutnumber.Data(),TaskClusterCutnumberEMC.Data(),TaskClusterCutnumberEMC.Data()));
  fQA->SetEventCuts(analysisEventCuts,IsHeavyIon);
  fQA->SetClusterCutsEMC(analysisClusterCutsEMC,IsHeavyIon);
  fQA->SetClusterCutsDMC(analysisClusterCutsDMC,IsHeavyIon);
  fQA->SetMesonCuts(analysisMesonCuts,IsHeavyIon);
  fQA->SetMinMaxNLMCut(minNLM,maxNLM);
  fQA->FillType(kTree,kHistograms);
  fQA->SetIsMC(isMC);
  if(isMC)
    fQA->SetSaveMCInformation(kTRUE);
  fQA->SetSaveSurroundingCells(doSaveSurroundingCells);
  fQA->SetSaveClusterCells(doSaveClusterCells);
  fQA->SetSaveSurroundingTracks(doSaveSurroundingTracks);
  fQA->SetMaxConeRadius(maxConeRadius);
  fQA->SetMinTrackPt(minTrackMomentum);
  fQA->SetMinClusterEnergy(minClusterEnergy);
  fQA->SetSaveEventProperties(doSaveEventProp);
  fQA->SetV0ReaderName(V0ReaderName);
  fQA->SetDoAdditionalHistos(makeAdditionalHistos);
  mgr->AddTask(fQA);

  mgr->ConnectInput  (fQA, 0,  cinput );
  mgr->ConnectOutput (fQA, 1, mgr->CreateContainer(Form("GammaCaloQA_%s_%s_%s", TaskEventCutnumber.Data(), TaskClusterCutnumberEMC.Data(),TaskClusterCutnumberEMC.Data()), TList::Class(), AliAnalysisManager::kOutputContainer, Form("%s:GammaCaloQA_%s_%s_%s", mgr->GetCommonFileName(), TaskEventCutnumber.Data(), TaskClusterCutnumberEMC.Data(),TaskClusterCutnumberEMC.Data())) );
  mgr->ConnectOutput (fQA, 2, mgr->CreateContainer(Form("ClusterTree_%s_%s_%s", TaskEventCutnumber.Data(), TaskClusterCutnumberEMC.Data(),TaskClusterCutnumberEMC.Data()), TTree::Class(), AliAnalysisManager::kOutputContainer, mgr->GetCommonFileName()) );

  return;
}


text:
      {{breadcrumb.label}}
      {{breadcrumb.label}}


text:
/**
 * Created by kamlesh on 1/24/2017.
 */
function tbts(src,dst,date,month) {
    return new Promise(function (resolve,reject) {

        url = "http://api.railwayapi.com/between/source/" + src + "/dest/" + dst + "/date/" + date + "-" + month + "/apikey/" + key[keyno] + "/";
        //console.log("calling url :"+url);

        $.ajax({
            url:url,
            cache: false,
            timeout:7000,
            success:function (body, status) {
                if (status == "success") {
                if (body.response_code == 200) {
                    if (body.total != 0) {
                        resolve(body);
                    } else if (body.total == 0) {

                        reject("Server Error please Re-Try!!!");
                    }
                } else if (body.response_code == 204) {
                    reject("not able to fetch required data from railway :" + body.error);
                } else {
                    reject("check ur response code .it is not 200!!!! :" + body.error);
                }
            } else {
                reject("get request is not success");
            }

            },
            error:function (jqXHR,textStatus,errorThrown) {
                console.log(textStatus);
                if(textStatus=='timeout'){
                    reject("Server is not Responding!!! Pls ReTry");
                }else {
                    reject('Check Ur Internet Connection!!!');
                }
            }
        });

    })

};


text:
package github

import (
	"context"
	"fmt"
	"strings"
)

// StarredRepository is returned by ListStarred.
type StarredRepository struct {
	StarredAt  *Timestamp  `json:"starred_at,omitempty"`
	Repository *Repository `json:"repo,omitempty"`
}

// Stargazer represents a user that has starred a repository.
type Stargazer struct {
	StarredAt *Timestamp `json:"starred_at,omitempty"`
	User      *User      `json:"user,omitempty"`
}

// ListStargazers lists people who have starred the specified repo.
//
// GitHub API docs: https://developer.github.com/v3/activity/starring/#list-stargazers
func (s *ActivityService) ListStargazers(ctx context.Context, owner, repo string, opts *ListOptions) ([]*Stargazer, *Response, error) {
	u := fmt.Sprintf("repos/%s/%s/stargazers", owner, repo)
	u, err := addOptions(u, opts)
	if err != nil {
		return nil, nil, err
	}

	req, err := s.client.NewRequest("GET", u, nil)
	if err != nil {
		return nil, nil, err
	}

	// TODO: remove custom Accept header when this API fully launches
	req.Header.Set("Accept", mediaTypeStarringPreview)

	var stargazers []*Stargazer
	resp, err := s.client.Do(ctx, req, &stargazers)
	if err != nil {
		return nil, resp, err
	}

	return stargazers, resp, nil
}

// ActivityListStarredOptions specifies the optional parameters to the
// ActivityService.ListStarred method.
type ActivityListStarredOptions struct {
	// How to sort the repository list. Possible values are: created, updated,
	// pushed, full_name. Default is "full_name".
	Sort string `url:"sort,omitempty"`

	// Direction in which to sort repositories. Possible values are: asc, desc.
	// Default is "asc" when sort is "full_name", otherwise default is "desc".
	Direction string `url:"direction,omitempty"`

	ListOptions
}

// ListStarred lists all the repos starred by a user. Passing the empty string
// will list the starred repositories for the authenticated user.
//
// GitHub API docs: https://developer.github.com/v3/activity/starring/#list-repositories-being-starred
func (s *ActivityService) ListStarred(ctx context.Context, user string, opts *ActivityListStarredOptions) ([]*StarredRepository, *Response, error) {
	var u string
	if user != "" {
		u = fmt.Sprintf("users/%v/starred", user)
	} else {
		u = "user/starred"
	}
	u, err := addOptions(u, opts)
	if err != nil {
		return nil, nil, err
	}

	req, err := s.client.NewRequest("GET", u, nil)
	if err != nil {
		return nil, nil, err
	}

	// TODO: remove custom Accept header when APIs fully launch
	acceptHeaders := []string{mediaTypeStarringPreview, mediaTypeTopicsPreview}
	req.Header.Set("Accept", strings.Join(acceptHeaders, ", "))

	var repos []*StarredRepository
	resp, err := s.client.Do(ctx, req, &repos)
	if err != nil {
		return nil, resp, err
	}

	return repos, resp, nil
}

// IsStarred checks if a repository is starred by authenticated user.
//
// GitHub API docs: https://developer.github.com/v3/activity/starring/#check-if-you-are-starring-a-repository
func (s *ActivityService) IsStarred(ctx context.Context, owner, repo string) (bool, *Response, error) {
	u := fmt.Sprintf("user/starred/%v/%v", owner, repo)
	req, err := s.client.NewRequest("GET", u, nil)
	if err != nil {
		return false, nil, err
	}
	resp, err := s.client.Do(ctx, req, nil)
	starred, err := parseBoolResponse(err)
	return starred, resp, err
}

// Star a repository as the authenticated user.
//
// GitHub API docs: https://developer.github.com/v3/activity/starring/#star-a-repository
func (s *ActivityService) Star(ctx context.Context, owner, repo string) (*Response, error) {
	u := fmt.Sprintf("user/starred/%v/%v", owner, repo)
	req, err := s.client.NewRequest("PUT", u, nil)
	if err != nil {
		return nil, err
	}
	return s.client.Do(ctx, req, nil)
}

// Unstar a repository as the authenticated user.
//
// GitHub API docs: https://developer.github.com/v3/activity/starring/#unstar-a-repository
func (s *ActivityService) Unstar(ctx context.Context, owner, repo string) (*Response, error) {
	u := fmt.Sprintf("user/starred/%v/%v", owner, repo)
	req, err := s.client.NewRequest("DELETE", u, nil)
	if err != nil {
		return nil, err
	}
	return s.client.Do(ctx, req, nil)
}


text:
package org.apache.synapse.commons.json.staxon;

import de.odysseus.staxon.json.stream.JsonStreamToken;

import java.io.Closeable;
import java.io.IOException;

import javax.xml.stream.Location;

/**
 * JSON stream source.
 */
interface JsonStreamSource extends Closeable, Location {
	/**
	 * Represents a simple value.
	 */
	public static class Value {
		public final String text;
		public final Object data;

		private Value(String text, Object data) {
			this.text = text;
			this.data = data;
		}

		/**
		 * Create number value
		 * @param text
		 * @param number
		 */
		public Value(String text, Number number) {
			this(text, (Object) number);
		}

		/**
		 * Create string value
		 * @param text
		 */
		public Value(String text) {
			this(text, text);
		}

		@Override
		public String toString() {
			return text == null ? "null" : text;
		}
	}

	/**
	 * "true" value
	 */
	public static final Value TRUE = new Value("true", Boolean.TRUE);

	/**
	 * "false" value
	 */
	public static final Value FALSE = new Value("false", Boolean.FALSE);

	/**
	 * "null" value
	 */
	public static final Value NULL = new Value(null, null);

	/**
	 * Consume {@link de.odysseus.staxon.json.stream.JsonStreamToken#NAME} token.
	 * @return name
	 * @throws IOException
	 */
	public String name() throws IOException;

	/**
	 * Consume {@link de.odysseus.staxon.json.stream.JsonStreamToken#VALUE} token.
	 * @return value
	 * @throws IOException
	 */
	public Value value() throws IOException;

	/**
	 * Consume {@link de.odysseus.staxon.json.stream.JsonStreamToken#START_OBJECT} token.
	 * @throws IOException
	 */
	public void startObject() throws IOException;

	/**
	 * Consume {@link de.odysseus.staxon.json.stream.JsonStreamToken#END_OBJECT} token.
	 * @throws IOException
	 */
	public void endObject() throws IOException;

	/**
	 * Consume {@link de.odysseus.staxon.json.stream.JsonStreamToken#START_ARRAY} token.
	 * @throws IOException
	 */
	public void startArray() throws IOException;

	/**
	 * Consume {@link de.odysseus.staxon.json.stream.JsonStreamToken#END_ARRAY} token.
	 * @throws IOException
	 */
	public void endArray() throws IOException;

	/**
	 * Peek next token.
	 * @return token
	 * @throws IOException
	 */
	public JsonStreamToken peek() throws IOException;
}


text:
require File.join(File.dirname(__FILE__), '..', 'test_helper')

class KmlTest < ActiveSupport::TestCase
  def test_station_parsing
    stations = Kml.stations(IO.read("#{RAILS_ROOT}/test/files/2009_06_25_20_35_01_stations.kml"))

    assert_equal Station, stations.first.class

    hotel_de_ville = stations.detect {|s| s.name == "Hôtel de ville"}
    assert_not_nil hotel_de_ville
    assert_equal   "9", hotel_de_ville.available_bikes
    assert_equal   "6", hotel_de_ville.parking_spots
    assert_equal   "-73.55372", hotel_de_ville.longitude
    assert_equal   "45.50853", hotel_de_ville.latitude
  end
end


text:
<form class="form-signin" name="" method="get" action="z_index.php">
    <input type="hidden" name="p" value="zzz">
    <input type="hidden" name="c" value="registro">
    <input type="hidden" name="a" value="registro">

        <?php _t('Email'); ?>
        <input
            type="email"
            class="form-control"
            id="email"
            name="email"
            placeholder="<?php _t('Escriba aca su email'); ?>">

    <?php
    //  captcha_html();
    ?>

    <button type="submit" class="btn btn-danger"><?php _t('Siguiente'); ?> > ></button>
    <?php _t("Regresar"); ?>
</form>


text:
/**
 * \brief	Example with LPC11C24 and Siemens M55 display.
 *
 * The M55 display is connected to the hardware SPI and 3 GPIOs
 *
 *
 */

#include <xpcc/architecture.hpp>
#include <xpcc/driver/connectivity/spi.hpp>

// How to include the defines?
// #include "xpcc_config.hpp" does not work.
#include "../../../../../build/lpcxpresso/lpc11c24/display_m55/libxpcc/xpcc_config.hpp"
#include <xpcc/driver/ui/display/siemens_m55.hpp>

#include <xpcc/workflow/timeout.hpp>

//#define USE_HARDWARE_SPI

namespace lcd
{
	GPIO__OUTPUT(Cs,    2,  2); // Pin 1 at display (to the border)
	GPIO__OUTPUT(Reset, 2,  0); // Pin 2
	GPIO__OUTPUT(Rs,    2,  1);	// Pin 3
}

namespace spi
{
	GPIO__OUTPUT(Sck,  0, 6);	// Pin 4
	GPIO__OUTPUT(Mosi, 0, 9);	// Pin 5
}

#ifdef USE_HARDWARE_SPI
typedef xpcc::lpc::SpiMaster0 SpiDisplay;
#else
typedef xpcc::SoftwareSpi<spi::Sck, spi::Mosi, xpcc::gpio::Unused, 2000000> SpiDisplay;
#endif

typedef xpcc::SiemensM55<SpiDisplay, lcd::Cs, lcd::Rs, lcd::Reset> Display;

#define LED_TOGGLE_TICKS 100		// 100 ticks = 1 Hz flash rate
#define COUNT_MAX		3			// how high to count on the LED display

GPIO__OUTPUT(Led, 0, 7);

Display display;

int
main(void)
{
	SystemInit();

	xpcc::lpc11::SysTickTimer::enable();

	// Initialize 32-bit timer 0. TIME_INTERVAL is defined as 10mS
	// You may also want to use the Cortex SysTick timer to do this
	init_timer32(0, TIME_INTERVAL);

	// Enable timer 0. Our interrupt handler will begin incrementing
	// the TimeTick global each time timer 0 matches and resets.
	enable_timer32(0);

	// Set LED port pin to output
	Led::setOutput();

	while (1)
	{
		static uint16_t ii = 7;
		Led::toggle();
		xpcc::delay_ms(100);
		Led::toggle();
		xpcc::delay_ms(50);

		if (!--ii)
			break;
	}

#ifdef USE_HARDWARE_SPI
	// Initialise the hardware SPI
	SpiDisplay::configurePins(SpiDisplay::MappingSck::PIO0_6);
	SpiDisplay::initialize(SpiDisplay::Mode::MODE_0, SpiDisplay::Presacler::DIV002, 0);
#else
	// Initialise the software SPI
	SpiDisplay::initialize();
#endif

	// Initialise the display
	display.initialize();
	display.setFont(xpcc::font::Assertion);

	xpcc::Timeout<> fpsTimeout(1000);

	bool dir = true;
	uint8_t y = 0;
	while (1)
	{
		display.clear();
		display.setCursor(5, y);
		display << "Hello";
		display.setCursor(46, 16);
		display << "World!";

		display.drawLine(0, y, 40, 31 - y);
		display.drawLine(132 - 40, 31 - y, 132, y);

		if (dir) {
			y++;
			if (y >= 5) {
				dir = false;
			}
		}
		else {
			y--;
			if (y == 0) {
				dir = true;
			}
		}
		// finished, copy to lcd
		display.update();

		xpcc::delay_ms(1000);
	}

	while (1)
	{
		// Each time we wake up...
		// Check TimeTick to see whether to set or clear the LED I/O pin
		if ((timer32_0_counter % (LED_TOGGLE_TICKS / COUNT_MAX)) < ((LED_TOGGLE_TICKS / COUNT_MAX) / 2)) {
			Led::reset();
		}
		else {
			Led::set();
		}

		// Go to sleep to save power between timer interrupts
		__WFI();
	}
}


text:
This document should help get started with modifying code. See also [develop.md](DEVELOP.md) for developer commands and [CONTRIBUTE.md](CONTRIBUTE.md) for community guidelines.

## Client/Server Wrangling Tool

PyGraphistry is Python client library primarily for:
* Loading in PyData, or converting non-PyData into PyData
* Setting declarative bindings for graph shaping and visual encodings
* Turning that into a live, embeddable Graphistry visualization

It is also increasingly used for intermediate compute and deeper access to Graphistry APIs. However, these should not get in the way of the primary use case.

It is currently heavily using Pandas, and slowly porting to Arrow-based and RAPIDS.ai-based internals.

## Functional

Most user interaction is functional, where every `.bind()` will create a new Graphistry object that is a clone of the one being chained. Thus most calls have a cheap `.copy()` over shallow immutable bindings.

Account-related settings are generally global with local functional overrides.

## DetaFrames: Lazy vs. Eager

At the `plot()` call, lazily bound data is materialized into the format needed for upload processing, e.g., API=3 will require pandas dataframes to be transformed into Arrow.

Database connectors should convert to Pandas, or better, Arrow, upon load. This enables immediate analysis using `._nodes` and `._edges`.

## Plugins

New code is increasingly put into separate files:

* Graphistry APIs: Arrow conveniences classes to match Graphistry server APIs. Each entity type generally has different types. These are being written to allow standalone use.

* Per-Connector: These should be separate files and standalone. For convenience, their `connect()` and `query()` methods can be added to the global namespace. Ex: `g.bolt(...).cypher(...).plot()`.

* Methods are intended for Notebook-based inspection. For example, calling `g.cypher` should guide users with the available arguments and examples of use.


text:
//
//  aast_node.hpp
//  koberi-c
//
//  Created by Filip Peterek on 30/10/2017.
//  Copyright © 2017 Filip Peterek. All rights reserved.
//

#ifndef aast_node_hpp
#define aast_node_hpp

#include <iostream>
#include <sstream>
#include <vector>

#include "syntax.hpp"
#include "parameter.hpp"
#include "vtable.hpp"
#include "name_mangler.hpp"

#define INDENT "    " /* Use four spaces to indent */

/* Set of self-translating AnalyzedAST nodes     */
/* Nodes recursively translate themselves into C */

enum class AASTNodeType {

    Construct,
    Function,
    Scope,
    Class,
    Funcall,
    Value,
    Declaration,
    Operator,
    Cast

};

class AASTConstruct;
class AASTFunction;
class AASTScope;
class AASTClass;
class AASTFuncall;
class AASTValue;
class AASTDeclaration;
class AASTOperator;
class AASTCast;

/* Abstract base class */
class AASTNode {

    const AASTNodeType _nodeType;
    const std::string _type;

public:

    AASTNode(AASTNodeType nodeType, const std::string & dataType);
    virtual ~AASTNode();

    AASTNodeType nodeType() const;
    std::string type() const;

    virtual std::string value(int baseIndent = 0) const = 0;

};

/* A scope -> {} */
class AASTScope : public AASTNode {

    const std::vector<AASTNode *> _body;

public:

    AASTScope(const std::vector<AASTNode *> & body);
    ~AASTScope();
    std::string value(int baseIndent = 0) const;

};

/* Language constructs used for control flow -> while, dowhile, if/elif/else */
class AASTConstruct : public AASTNode {

    const std::string _construct;
    const AASTNode * _condition;
    const AASTScope * _body;

public:

    AASTConstruct(const std::string & construct, const AASTNode * condition, const AASTScope * body);
    ~AASTConstruct();

    std::string value(int baseIndent = 0) const;

};

/* Function and member function definitions */
class AASTFunction : public AASTNode {

    const std::vector<AASTDeclaration> _parameters;
    const std::string _mangledName;
    const AASTScope * _body;

public:

    AASTFunction(const std::string & name,
                 const std::string & type,
                 const std::vector<AASTDeclaration> & parameters,
                 const AASTScope * body);

    std::string value(int baseIndent = 0) const;
    std::string declaration() const;

};

/* Class definitions */
class AASTClass : public AASTNode {

    const std::vector<AASTDeclaration> _attributes;
    const std::string _name;
    const VTable _vtable;

public:

    AASTClass(const std::string & name, const std::vector<AASTDeclaration> & attributes, const VTable & vtable);

    std::string value(int baseIndent = 0) const;
    std::string vtable() const;

};

/* Function calls */
class AASTFuncall : public AASTNode {

    const std::vector<AASTNode *> _parameters;
    const std::string _mangledName;

public:

    AASTFuncall(const std::string & name, const std::string & type, const std::vector<AASTNode *> parameters);
    ~AASTFuncall();

    std::string value(int baseIndent = 0) const;

};

/* Literals, variables or type names */
class AASTValue : public AASTNode {

    const std::string _value;
    const bool _isAssignable;

public:

    AASTValue(const std::string & value, const std::string & type, const bool assignable = false);
    std::string value(int baseIndent = 0) const;
    bool isAssignable();

};

/* Variable declarations */
class AASTDeclaration : public AASTNode {

    const std::string _name;
    const AASTNode * _value;

public:

    AASTDeclaration(const std::string & name, const std::string & type, const AASTNode * value);
    ~AASTDeclaration();
    std::string value(int baseIndent = 0) const;

};

/* Operator calls */
class AASTOperator : public AASTNode {

    const std::vector<AASTNode *> _parameters;
    const std::string _operator;

public:

    AASTOperator(const std::string & op, const std::string & type, const std::vector<AASTNode *> parameters);
    ~AASTOperator();

    std::string value(int baseIndent = 0) const;
    const std::string & getOperator() const;

};

/* Type casts */
class AASTCast : public AASTNode {

    const AASTNode * _value;
    const std::string _desiredType;

public:

    AASTCast(const AASTNode * value, const std::string desiredType);
    ~AASTCast();

    std::string value(int baseIndent = 0) const;

};

#endif /* aast_node_hpp */


text:
layout: default
title: Sync hooks
---

Sync hooks
----------

Sync hooks are custom behavior that can be execute before or after a table sync.
Relevant options:

-   `:before_table_sync`
-   `:after_table_sync`

SQL Statements as sync hook
---------------------------------------

In it's simplest form, the hook can simply execute an SQL command (E. g. to disable /enable referential constraints, etc.).
Example:

```ruby
...
config.include_tables 'emp',
  :before_table_sync => "SET foreign_key_checks = 0",
  :after_table_sync => "SET foreign_key_checks = 1"
...
```

Ruby code as sync hook
----------------------

For more freedom, ruby code can be executed during the hook.
Example:

```ruby
...
config.include_tables 'emp',
  :before_table_sync => lambda {|helper|
    $stderr.puts "Hook called for #{helper.left_table}."
  }
...
```

For more information, please refer to the [RDoc](http://www.rubydoc.info/github/rubyrep/rubyrep/RR/Configuration)


text:
#ifdef Q_OS_SYMBIAN
#include <apgtask.h>
#include <eikenv.h>
#include <apparc.h>
#include <apgcli.h>
#include <aknappui.h>
#include <apgwgnam.h>
#include <akndoc.h>
#include <COEMAIN.H>
#endif
#include <QApplication>
Application::Application(QObject *parent) :
    QObject(parent)
{
#ifdef Q_OS_SYMBIAN
    int lang=User::Language();
#else
    int lang=16;
#endif
    loc=new Localizer(lang,this);
    timer=new QTimer();
    timer->setSingleShot(false);
    timer->setInterval(60*1000);
    connect(timer,SIGNAL(timeout()),this,SLOT(Tick()));
    }

void Application::Tick()
{
    counts--;
    emit updateUi(counts/60,counts%60);
    if (counts<=0)
    {
#ifdef Q_OS_SYMBIAN
    TApaTaskList lst(CEikonEnv::Static()->WsSession());
    TApaTask mPlayer=lst.FindApp(TUid::Uid(0x102072c3));
    TApaTask rPlayer=lst.FindApp(TUid::Uid(0x10207a89));
    TApaTask intPlayer=lst.FindApp(TUid::Uid(0x2002ffc8));
    if (mPlayer.Exists()&&iPlayer){mPlayer.EndTask();}
    if (rPlayer.Exists()&&iRadio){rPlayer.EndTask();}
    if (intPlayer.Exists()&&iInternet){intPlayer.EndTask();}
#endif
    QApplication::exit(0);
    }
}

void Application::Stop()
{
timer->stop();
}

void Application::Start(int hours, int mins, bool player, bool radio, bool internet)
{
counts=hours*60+mins;
iInternet=internet;
iRadio=radio;
iPlayer=player;
if (counts!=0) timer->start();
}
void Application::Hide()
{
#ifdef Q_OS_SYMBIAN
// hide from task bar and go background
    CAknAppUi* appUi= ((CAknAppUi*)CEikonEnv::Static()->AppUi());
    appUi->HideApplicationFromFSW(ETrue);
    appUi->HideInBackground();
    CEikonEnv::Static()->SetSystem(ETrue);
    CCoeEnv *env = CCoeEnv::Static();
    TInt wgId = env->RootWin().Identifier();
    RWsSession session = env->WsSession();
    CApaWindowGroupName *wgName = CApaWindowGroupName::NewL(session, wgId);
    wgName->SetHidden(ETrue);
    wgName->SetWindowGroupName(env->RootWin());
    CEikonEnv::Static()->iWgName=wgName;
#else
    QApplication::exit(0);
#endif
}


text:
package com.facebook.buck.core.rules.knowntypes;

import static org.junit.Assert.assertNotNull;
import static org.junit.Assert.assertSame;
import static org.junit.Assert.assertTrue;

import com.facebook.buck.core.cell.Cell;
import com.facebook.buck.core.cell.TestCellBuilder;
import com.facebook.buck.core.config.BuckConfig;
import com.facebook.buck.core.config.FakeBuckConfig;
import com.facebook.buck.core.model.targetgraph.FakeTargetNodeBuilder;
import com.facebook.buck.core.rules.knowntypes.provider.KnownRuleTypesProvider;
import com.google.common.collect.ImmutableList;
import com.google.common.collect.ImmutableMap;
import org.junit.Test;

public class KnownRuleTypesProviderTest {
  private final FakeTargetNodeBuilder.FakeDescription fakeDescription =
      new FakeTargetNodeBuilder.FakeDescription();

  class TestFactory implements KnownNativeRuleTypesFactory {
    @Override
    public KnownNativeRuleTypes create(Cell cell) {
      return KnownNativeRuleTypes.of(ImmutableList.of(fakeDescription), ImmutableList.of());
    }
  }

  Cell createCell(boolean enableUserDefinedRules) {
    BuckConfig config =
        FakeBuckConfig.builder()
            .setSections(
                ImmutableMap.of(
                    "parser",
                    ImmutableMap.of(
                        "enable_user_defined_rules", enableUserDefinedRules ? "true" : "false")))
            .build();
    return new TestCellBuilder().setBuckConfig(config).build();
  }

  @Test
  public void returnsKnownNativeRuleTypesIfUserDefinedRulesDisabled() {
    KnownRuleTypesProvider provider = new KnownRuleTypesProvider(new TestFactory());
    Cell cell = createCell(false);

    KnownRuleTypes knownRuleTypes = provider.get(cell);
    KnownNativeRuleTypes knownNativeRuleTypes = provider.getNativeRuleTypes(cell);

    assertSame(knownRuleTypes, knownNativeRuleTypes);
  }

  @Test
  public void returnsHybridKnownRuleTypesIfUserDefinedRulesEnabled() {
    KnownRuleTypesProvider provider = new KnownRuleTypesProvider(new TestFactory());
    Cell cell = createCell(true);

    KnownRuleTypes knownRuleTypes = provider.get(cell);
    KnownNativeRuleTypes knownNativeRuleTypes = provider.getNativeRuleTypes(cell);

    assertNotNull(knownRuleTypes.getRuleType("fake"));
    assertTrue(knownRuleTypes instanceof HybridKnownRuleTypes);
    assertSame(knownRuleTypes.getRuleType("fake"), knownNativeRuleTypes.getRuleType("fake"));
  }
}


text:
<!DOCTYPE html>

  <meta charset="UTF-8">
  <title>Dashboard for C:\Users\emilien\workspace-zf2\zf2-tree-layout-stack/src/TreeLayoutStack/Template</title>
  <meta name="viewport" content="width=device-width, initial-scale=1.0">
  <link href="css/bootstrap.min.css" rel="stylesheet">
  <link href="css/bootstrap-responsive.min.css" rel="stylesheet">
  <link href="css/style.css" rel="stylesheet">

C:\Users\emilien\workspace-zf2\zf2-tree-layout-stack /

src /

TreeLayoutStack /

Template

(Dashboard)

Class Coverage Distribution

Class Complexity

Top Project Risks

Least Tested Methods

     Generated by PHP_CodeCoverage 1.2.9 using PHP 5.4.13 and PHPUnit 3.7.18 at Tue May 28 15:34:44 CEST 2013.


text:
import React from 'react'
import {Router, Route, Switch} from 'dva/router'

import AuthRoute from './components/AuthRoute'
import NavBar from './components/NavBar'
import IndexPage from './routes/IndexPage'
/* eslint-disable no-unused-vars */
import CocktailPage from './routes/CocktailPage'
import CartPage from './routes/CartPage'
import ProIndexPage from './routes/Product/ProIndexPage'
import ProListPage from './routes/Product/ProListPage'
import ProDetailPage from './routes/Product/ProDetailPage'
import PointProsPage from './routes/Product/PointProsPage'
import PointProDetailPage from './routes/Product/PointProDetail'

import LoginPage from './routes/User/LoginPage'
import Register1Page from './routes/User/Register1Page'
import Register2Page from './routes/User/Register2Page'
import UserIndex from './routes/User/UserIndex'
import ForgetPage from './routes/User/ForgetPage'
import LogoutPage from './routes/User/LogoutPage'
import CollectionPage from './routes/User/CollectionPage'

import ModifyPwdPage from './routes/User/Modify/ModifyPwdPage'
import ModifyNickPage from './routes/User/Modify/ModifyNickPage'
import ModifyAvatarPage from './routes/User/Modify/ModifyAvatarPage'

import AdrListPage from './routes/Adr/AdrListPageV2'
import AdrEditPage from './routes/Adr/AdrEditPage'

import OrderListPage from './routes/Order/OrderListPage'
import OrderPage from './routes/Order/OrderPage'
import ExChangePage from './routes/Order/ExChangePage'

import CouponPage from './routes/User/CouponPage'

const Pro = () => {
  return (
    <Switch>
      <Route path="/pro/" exact component={ProIndexPage}/>
      <Route path="/pro/list" component={ProListPage}/>
      <AuthRoute path="/pro/points" component={PointProsPage}/>
      <AuthRoute path="/pro/point/:id" component={PointProDetailPage}/>
      <Route path="/pro/:id" component={ProDetailPage}/>
    </Switch>
  )
}

const User = () => {
  return (
    <Switch>
      <AuthRoute path="/user/" exact component={UserIndex}/>
      <Route path="/user/login" component={LoginPage}/>
      <Route path="/user/reg1" component={Register1Page}/>
      <Route path="/user/reg2" component={Register2Page}/>
      <Route path="/user/forget" component={ForgetPage}/>
      <AuthRoute path="/user/logout" component={LogoutPage}/>
      <AuthRoute path="/user/modify/pwd" component={ModifyPwdPage}/>
      <AuthRoute path="/user/modify/nick" component={ModifyNickPage}/>
      <AuthRoute path="/user/modify/avatar" component={ModifyAvatarPage}/>
      <AuthRoute path="/user/col" component={CollectionPage}/>
      <AuthRoute path="/user/coupon/:mode?" component={CouponPage}/>
    </Switch>
  )
}

const Adr = () => {
  return (
    <Switch>
      <AuthRoute path="/adr" exact component={AdrListPage}/>
      <AuthRoute path="/adr/:edit" component={AdrEditPage}/>
    </Switch>
  )
}

function isVisible({pathname}) {
  return (['/', '/pro', '/cocktail'].indexOf(pathname) > -1 || pathname.indexOf('/pro/list') === 0)
}

function RouterConfig({history}) {
  return (
    <Router history={history}>
      <Route
        path="/"
        render={({location}) => (
        <div className="wrapper-m028h">
          <Switch>
            <Route path="/" exact component={IndexPage}/>
            <Route path="/cocktail" component={CocktailPage}/>
            <Route path="/pro" component={Pro}/>
            <Route path="/user" component={User}/>
            <Route path="/adr" component={Adr}/>
            <AuthRoute path="/cart" component={CartPage}/>
            <AuthRoute path="/order" exact component={OrderPage}/>
            <AuthRoute path="/exchange" component={ExChangePage}/>
            <AuthRoute path="/order/:status" component={OrderListPage}/>
          </Switch>
          {isVisible(location)
            ? <NavBar/>
            : null}
        </div>
      )}/>
    </Router>
  )
}

export default RouterConfig


text:
from django.contrib.auth.models import User
from django.contrib.auth.backends import ModelBackend
import facebook
from models import *

class FacebookBackend(ModelBackend):
    """ Authenticate a facebook user. """
    def authenticate(self, fb_uid=None, fb_graphtoken=None):
        """ If we receive a facebook uid then the cookie has already been validated. """
        if fb_uid and fb_graphtoken:
            try:
                fb_user = FacebookUser.objects.get(facebook_id=fb_uid)
                user = fb_user.user
                if fb_user.access_token != fb_graphtoken:
                    fb_user.access_token = fb_graphtoken
                    fb_user.save()
                return user
            except FacebookUser.DoesNotExist:
                return None
        return None


text:
from model.contacts import Contacts
from random import randrange
import random

def test_modify_first_contact_more(app, db, check_ui):
    if len(db.get_contact_list()) == 0:
        app.contacts.add_new_user(Contacts(name="Иван", middlename="Иванович", lastname="Иванов", nickname="Ван", company="Галактика", companyaddress="Планетная улица, 1", homenumber="1111111",
                          mobilenumber="+71111111111", worknumber="9999999", faxnumber="8888888", email="ivan@ivan.ru",
                          homeaddress="Галактическая улица, 2", secondhomenumber="5555555", notes="No"))
    old_contacts = db.get_contact_list()
    mod_contact = random.choice(old_contacts)
    contact = Contacts(name="Семен", lastname="Семенов", homeaddress="Прелестная, 1", homenumber="1234567", mobilenumber="+71234567890", worknumber="9876543", faxnumber="8765432", email="fed@fed.ru", id=mod_contact.id)
    old_contacts.remove(mod_contact)
    app.contacts.modify_contact_by_id(contact.id, contact)
    new_contacts = db.get_contact_list()
    old_contacts.append(contact)
    assert sorted(old_contacts, key=Contacts.id_or_max) == sorted(new_contacts, key=Contacts.id_or_max)
    if check_ui:
        assert sorted(new_contacts, key=Contacts.id_or_max) == sorted(app.contacts.get_contact_list(), key=Contacts.id_or_max)

def test_modify_first_contact_less(app, db, check_ui):
    if len(db.get_contact_list()) == 0:
        app.contacts.add_new_user(Contacts(name="Иван", middlename="Иванович", lastname="Иванов", nickname="Ван", company="Галактика", companyaddress="Планетная улица, 1", homenumber="1111111",
                          mobilenumber="+71111111111", worknumber="9999999", faxnumber="8888888", email="ivan@ivan.ru",
                          homeaddress="Галактическая улица, 2", secondhomenumber="5555555", notes="No"))
    old_contacts = db.get_contact_list()
    mod_contact = random.choice(old_contacts)
    contact = Contacts(name="Семен", lastname="Семенов", homeaddress="Прелестная, 1", homenumber="1234567", mobilenumber="+71234567890", worknumber="9876543", faxnumber="8765432", email="fed@fed.ru", id=mod_contact.id)
    old_contacts.remove(mod_contact)
    app.contacts.modify_contact_by_id(contact.id, contact)
    new_contacts = db.get_contact_list()
    old_contacts.append(contact)
    assert sorted(old_contacts, key=Contacts.id_or_max) == sorted(new_contacts, key=Contacts.id_or_max)
    if check_ui:
        assert sorted(new_contacts, key=Contacts.id_or_max) == sorted(app.contacts.get_contact_list, key=Contacts.id_or_max)

    #def test_modify_first_contact_less(app):
    #if app.contacts.count() == 0:
        #app.contacts.add_new_user(Contacts(name="Иван", middlename="Иванович", lastname="Иванов", nickname="Ван", company="Галактика", companyaddress="Планетная улица, 1", homenumber="1111111",
                          #mobilenumber="+71111111111", worknumber="9999999", faxnumber="8888888", email="ivan@ivan.ru",
                          #homeaddress="Галактическая улица, 2", secondhomenumber="5555555", notes="No"))
    #old_contacts = app.contacts.get_contact_list()
    #index = randrange(len(old_contacts))
    #contact = Contacts(name="Василий", lastname="Васильевич", email="fed@fed.ru")
    #contact.id = old_contacts[index].id
    #app.contacts.modify_contact_by_index(index, contact)
    #assert len(old_contacts) == app.contacts.count()
    #new_contacts = app.contacts.get_contact_list()
    #old_contacts[index] = contact
    #assert sorted(old_contacts, key=Contacts.id_or_max) == sorted(new_contacts, key=Contacts.id_or_max)

#def test_modify_first_contact_more(app):
    #if app.contacts.count() == 0:
        #app.contacts.add_new_user(Contacts(name="Иван", middlename="Иванович", lastname="Иванов", nickname="Ван", company="Галактика", companyaddress="Планетная улица, 1", homenumber="1111111",
                          #mobilenumber="+71111111111", worknumber="9999999", faxnumber="8888888", email="ivan@ivan.ru",
                          #homeaddress="Галактическая улица, 2", secondhomenumber="5555555", notes="No"))
    #old_contacts = app.contacts.get_contact_list()
    #index = randrange(len(old_contacts))
    #contact = Contacts(name="Семен", lastname="Семенов", homeaddress="Прелестная, 1", homenumber="1234567", mobilenumber="+71234567890", worknumber="9876543", faxnumber="8765432", email="fed@fed.ru")
    #contact.id = old_contacts[index].id
    #app.contacts.modify_contact_by_index(index, contact)
    #assert len(old_contacts) == app.contacts.count()
    #new_contacts = app.contacts.get_contact_list()
    #old_contacts[index] = contact
    #print(old_contacts)
    #print(new_contacts)
    #assert sorted(old_contacts, key=Contacts.id_or_max) == sorted(new_contacts, key=Contacts.id_or_max)


text:
package org.apache.nifi.controller.service;

import java.io.BufferedInputStream;
import java.io.IOException;
import java.io.InputStream;
import java.nio.charset.StandardCharsets;
import java.util.ArrayList;
import java.util.Collection;
import java.util.HashMap;
import java.util.HashSet;
import java.util.List;
import java.util.Map;
import java.util.Set;
import java.util.UUID;

import javax.xml.parsers.DocumentBuilder;
import javax.xml.parsers.DocumentBuilderFactory;
import javax.xml.parsers.ParserConfigurationException;

import org.apache.nifi.components.PropertyDescriptor;
import org.apache.nifi.controller.FlowController;
import org.apache.nifi.controller.serialization.FlowFromDOMFactory;
import org.apache.nifi.encrypt.StringEncryptor;
import org.apache.nifi.groups.ProcessGroup;
import org.apache.nifi.reporting.BulletinRepository;
import org.apache.nifi.util.DomUtils;
import org.apache.nifi.web.api.dto.ControllerServiceDTO;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.w3c.dom.Document;
import org.w3c.dom.Element;
import org.xml.sax.SAXException;
import org.xml.sax.SAXParseException;

public class ControllerServiceLoader {

    private static final Logger logger = LoggerFactory.getLogger(ControllerServiceLoader.class);

    public static List<ControllerServiceNode> loadControllerServices(final FlowController controller, final InputStream serializedStream, final ProcessGroup parentGroup,
        final StringEncryptor encryptor, final BulletinRepository bulletinRepo, final boolean autoResumeState) throws IOException {

        final DocumentBuilderFactory documentBuilderFactory = DocumentBuilderFactory.newInstance();
        documentBuilderFactory.setNamespaceAware(true);

        try (final InputStream in = new BufferedInputStream(serializedStream)) {
            final DocumentBuilder builder = documentBuilderFactory.newDocumentBuilder();

            builder.setErrorHandler(new org.xml.sax.ErrorHandler() {

                @Override
                public void fatalError(final SAXParseException err) throws SAXException {
                    logger.error("Config file line " + err.getLineNumber() + ", col " + err.getColumnNumber() + ", uri " + err.getSystemId() + " :message: " + err.getMessage());
                    if (logger.isDebugEnabled()) {
                        logger.error("Error Stack Dump", err);
                    }
                    throw err;
                }

                @Override
                public void error(final SAXParseException err) throws SAXParseException {
                    logger.error("Config file line " + err.getLineNumber() + ", col " + err.getColumnNumber() + ", uri " + err.getSystemId() + " :message: " + err.getMessage());
                    if (logger.isDebugEnabled()) {
                        logger.error("Error Stack Dump", err);
                    }
                    throw err;
                }

                @Override
                public void warning(final SAXParseException err) throws SAXParseException {
                    logger.warn(" Config file line " + err.getLineNumber() + ", uri " + err.getSystemId() + " : message : " + err.getMessage());
                    if (logger.isDebugEnabled()) {
                        logger.warn("Warning stack dump", err);
                    }
                    throw err;
                }
            });

            final Document document = builder.parse(in);
            final Element controllerServices = document.getDocumentElement();
            final List<Element> serviceElements = DomUtils.getChildElementsByTagName(controllerServices, "controllerService");

            final Map<ControllerServiceNode, Element> controllerServiceMap = ControllerServiceLoader.loadControllerServices(serviceElements, controller, parentGroup, encryptor);
            enableControllerServices(controllerServiceMap, controller, encryptor, autoResumeState);
            return new ArrayList<>(controllerServiceMap.keySet());
        } catch (SAXException | ParserConfigurationException sxe) {
            throw new IOException(sxe);
        }
    }

    public static Map<ControllerServiceNode, Element> loadControllerServices(final List<Element> serviceElements, final FlowController controller,
                                                                             final ProcessGroup parentGroup, final StringEncryptor encryptor) {

        final Map<ControllerServiceNode, Element> nodeMap = new HashMap<>();
        for (final Element serviceElement : serviceElements) {
            final ControllerServiceNode serviceNode = createControllerService(controller, serviceElement, encryptor);
            if (parentGroup == null) {
                controller.addRootControllerService(serviceNode);
            } else {
                parentGroup.addControllerService(serviceNode);
            }

            // We need to clone the node because it will be used in a separate thread below, and
            // Element is not thread-safe.
            nodeMap.put(serviceNode, (Element) serviceElement.cloneNode(true));
        }
        for (final Map.Entry<ControllerServiceNode, Element> entry : nodeMap.entrySet()) {
            configureControllerService(entry.getKey(), entry.getValue(), encryptor);
        }

        return nodeMap;
    }

    public static void enableControllerServices(final Map<ControllerServiceNode, Element> nodeMap, final FlowController controller,
                                                final StringEncryptor encryptor, final boolean autoResumeState) {
        // Start services
        if (autoResumeState) {
            final Set<ControllerServiceNode> nodesToEnable = new HashSet<>();

            for (final ControllerServiceNode node : nodeMap.keySet()) {
                final Element controllerServiceElement = nodeMap.get(node);

                final ControllerServiceDTO dto;
                synchronized (controllerServiceElement.getOwnerDocument()) {
                    dto = FlowFromDOMFactory.getControllerService(controllerServiceElement, encryptor);
                }

                final ControllerServiceState state = ControllerServiceState.valueOf(dto.getState());
                if (state == ControllerServiceState.ENABLED) {
                    nodesToEnable.add(node);
                }
            }

            enableControllerServices(nodesToEnable, controller, autoResumeState);
        }
    }

    public static void enableControllerServices(final Collection<ControllerServiceNode> nodesToEnable, final FlowController controller, final boolean autoResumeState) {
        // Start services
        if (autoResumeState) {
            controller.enableControllerServices(nodesToEnable);
        }
    }

    public static ControllerServiceNode cloneControllerService(final ControllerServiceProvider provider, final ControllerServiceNode controllerService) {
        // create a new id for the clone seeded from the original id so that it is consistent in a cluster
        final UUID id = UUID.nameUUIDFromBytes(controllerService.getIdentifier().getBytes(StandardCharsets.UTF_8));

        final ControllerServiceNode clone = provider.createControllerService(controllerService.getCanonicalClassName(), id.toString(), false);
        clone.setName(controllerService.getName());
        clone.setComments(controllerService.getComments());

        if (controllerService.getProperties() != null) {
            Map<String,String> properties = new HashMap<>();
            for (Map.Entry<PropertyDescriptor, String> propEntry : controllerService.getProperties().entrySet()) {
                properties.put(propEntry.getKey().getName(), propEntry.getValue());
            }
            clone.setProperties(properties);
        }

        return clone;
    }

    private static ControllerServiceNode createControllerService(final ControllerServiceProvider provider, final Element controllerServiceElement, final StringEncryptor encryptor) {
        final ControllerServiceDTO dto = FlowFromDOMFactory.getControllerService(controllerServiceElement, encryptor);

        final ControllerServiceNode node = provider.createControllerService(dto.getType(), dto.getId(), false);
        node.setName(dto.getName());
        node.setComments(dto.getComments());
        return node;
    }

    private static void configureControllerService(final ControllerServiceNode node, final Element controllerServiceElement, final StringEncryptor encryptor) {
        final ControllerServiceDTO dto = FlowFromDOMFactory.getControllerService(controllerServiceElement, encryptor);
        node.setAnnotationData(dto.getAnnotationData());
        node.setProperties(dto.getProperties());
    }

}


text: void TestGLConvolution();


text:
studycom.directive("studycomSidenav", function ($http) {
    return {
        restrict: 'E',
        replace: true,
        templateUrl: "util/sidenav-directive.html",
        link: function(scope) {

        },
        controller: function ($scope,$location, $mdDialog, Auth) {

            $scope.user = null;
            $scope.url = $location.absUrl();

            Auth.user().then(function(response) {
                $scope.user = response;
                $scope.getTopics();
                $scope.getContacts();
                $scope.getRequests();
                $scope.selectTab();

            });

            $scope.selectTab = function(){
                var splitUrl = $scope.url.split('/');
                var typeTab = splitUrl[6];

                if(typeTab == 'contact'){
                    return 1;
                } else if(typeTab == 'topic'){
                    return 0;
                }

            }
            $scope.selectedTab = $scope.selectTab();

            $scope.getTopics = function () {
                $http.get('http://localhost/Studycom/public/api/user/'+$scope.user.id+'/topic').then(function(response) {
                    $scope.topics = response.data;

                })
            };

            $scope.getContacts = function () {
                $http.get('http://localhost/Studycom/public/api/user/'+$scope.user.id+'/contacts/get').then(function(response) {
                    $scope.contacts = response.data;
                })
            };

            $scope.getRequests = function () {
                $http.get('http://localhost/Studycom/public/api/user/'+$scope.user.id+'/requests').then(function(response) {
                    $scope.requests = response.data;

                })
            };

            $scope.acceptRequest = function (idRequest) {
                $http.get('http://localhost/Studycom/public/api/user/'+$scope.user.id+'/request/'+idRequest+'/accept').then(function(response) {

                    $scope.requests.forEach(function(request) {
                        if(request.id == idRequest){
                            $scope.indexAccept = $scope.requests.indexOf(request);
                        }
                    });

                    $scope.requests.splice($scope.indexAccept,1);

                    $scope.contacts.push(response.data[0]);

                })
            };

            $scope.refuseRequest = function (idRequest) {
                $http.get('http://localhost/Studycom/public/api/user/'+$scope.user.id+'/request/'+idRequest+'/refuse').then(function(response) {

                    $scope.requests.forEach(function(request) {
                        if(request.id == idRequest){
                            $scope.indexRefuse = $scope.requests.indexOf(request);
                        }
                    });

                    $scope.requests.splice($scope.indexRefuse,1);

                })
            };

            $scope.openAddTopicDialog = function (ev) {
                $mdDialog.show({
                    controller: addTopicModalController,
                    controllerAs: 'addTopic',
                    templateUrl: 'util/addTopicModal.html',
                    parent: angular.element(document.body),
                    targetEvent: ev,
                    clickOutsideToClose: true
                }).then(function (answer) {

                });

                function addTopicModalController($scope, $mdDialog, $rootScope, Auth) {

                    Auth.user().then(function(response) {
                        $scope.user = response;
                    });

                    $scope.name = '';

                    $scope.closeDialog = function () {
                        $mdDialog.hide();
                    };

                    $scope.createTopic = function () {
                        var formData = {
                            name: $scope.name,
                        };

                        $http.post('http://localhost/Studycom/public/api/user/'+ $scope.user.id+'/topic', formData)
                            .then(function(response) {
                                var topic = response.data;
                                $mdDialog.hide();
                                window.location = 'http://localhost/StudycomClient/app/#/topic/'+topic.id;
                        })

                    };
                }
            };

            $scope.openAddContactDialog = function (ev) {
                $mdDialog.show({
                    controller: addContactModalController,
                    controllerAs: 'addTopic',
                    templateUrl: 'util/addContactModal.html',
                    parent: angular.element(document.body),
                    targetEvent: ev,
                    clickOutsideToClose: true
                });

                function addContactModalController($scope, $mdDialog, $rootScope, Auth) {

                    Auth.user().then(function(response) {
                        $scope.user = response;
                    });

                    $scope.email = '';
                    $scope.userNotFound = false;
                    $scope.userAlreadyContact = false;
                    $scope.userAlreadyReceiveRequest = false;
                    $scope.userIsHimself = false;

                    $scope.closeDialog = function () {
                        $mdDialog.hide();
                    };

                    $scope.sendContactRequest = function () {

                        var formData = {
                            email: $scope.email
                        };

                        $http.post('http://localhost/Studycom/public/api/user/'+ $scope.user.id+'/contact/request', formData)
                            .then(function(response) {

                                if(response.data == 'invalid'){
                                    $scope.userNotFound = true;
                                } else if(response.data == 'exists'){
                                    $scope.userAlreadyContact = true;
                                }
                                else if(response.data == 'requested'){
                                    $scope.userAlreadyReceiveRequest = true;

                                }
                                else if(response.data == 'yourself'){
                                    $scope.userIsHimself = true;
                                }
                                else{
                                    $mdDialog.hide();
                                }
                            })
                    };
                }
            }
        }
    }
});


text:
package org.apache.qpid.jms.tracing;

/**
 * Default no-op Tracing implementation
 */
public final class JmsNoOpTracer implements JmsTracer {

    public static final JmsNoOpTracer INSTANCE = new JmsNoOpTracer();

    @Override
    public void initSend(TraceableMessage message, String address) {
    }

    @Override
    public void completeSend(TraceableMessage message, String outcome) {
    }

    @Override
    public void syncReceive(TraceableMessage message, String address, DeliveryOutcome outcome) {
    }

    @Override
    public void asyncDeliveryInit(TraceableMessage message, String address) {
    }

    @Override
    public void asyncDeliveryComplete(TraceableMessage message, DeliveryOutcome outcome, Throwable throwable) {
    }

    @Override
    public void close() {
    }
}


text:
package com.thalesgroup.rtti._2012_01_13.ldb.types;

import javax.xml.bind.annotation.XmlRegistry;

/**
 * This object contains factory methods for each
 * Java content interface and Java element interface
 * generated in the com.thalesgroup.rtti._2012_01_13.ldb.types package.
 * <p>An ObjectFactory allows you to programatically
 * construct new instances of the Java representation
 * for XML content. The Java representation of XML
 * content can consist of schema derived interfaces
 * and classes representing the binding of schema
 * type definitions, element declarations and model
 * groups.  Factory methods for each of these are
 * provided in this class.
 *
 */
@XmlRegistry
public class ObjectFactory {

    /**
     * Create a new ObjectFactory that can be used to create new instances of schema derived classes for package: com.thalesgroup.rtti._2012_01_13.ldb.types
     *
     */
    public ObjectFactory() {
    }

    /**
     * Create an instance of {@link ArrayOfArrayOfCallingPoints }
     *
     */
    public ArrayOfArrayOfCallingPoints createArrayOfArrayOfCallingPoints() {
        return new ArrayOfArrayOfCallingPoints();
    }

    /**
     * Create an instance of {@link ArrayOfAdhocAlert }
     *
     */
    public ArrayOfAdhocAlert createArrayOfAdhocAlert() {
        return new ArrayOfAdhocAlert();
    }

    /**
     * Create an instance of {@link ArrayOfServiceLocations }
     *
     */
    public ArrayOfServiceLocations createArrayOfServiceLocations() {
        return new ArrayOfServiceLocations();
    }

    /**
     * Create an instance of {@link CallingPoint }
     *
     */
    public CallingPoint createCallingPoint() {
        return new CallingPoint();
    }

    /**
     * Create an instance of {@link ArrayOfNRCCMessages }
     *
     */
    public ArrayOfNRCCMessages createArrayOfNRCCMessages() {
        return new ArrayOfNRCCMessages();
    }

    /**
     * Create an instance of {@link ArrayOfServiceItems }
     *
     */
    public ArrayOfServiceItems createArrayOfServiceItems() {
        return new ArrayOfServiceItems();
    }

    /**
     * Create an instance of {@link NRCCMessage }
     *
     */
    public NRCCMessage createNRCCMessage() {
        return new NRCCMessage();
    }

    /**
     * Create an instance of {@link ServiceDetails }
     *
     */
    public ServiceDetails createServiceDetails() {
        return new ServiceDetails();
    }

    /**
     * Create an instance of {@link ServiceLocation }
     *
     */
    public ServiceLocation createServiceLocation() {
        return new ServiceLocation();
    }

    /**
     * Create an instance of {@link ServiceItem }
     *
     */
    public ServiceItem createServiceItem() {
        return new ServiceItem();
    }

    /**
     * Create an instance of {@link StationBoard }
     *
     */
    public StationBoard createStationBoard() {
        return new StationBoard();
    }

    /**
     * Create an instance of {@link ArrayOfCallingPoints }
     *
     */
    public ArrayOfCallingPoints createArrayOfCallingPoints() {
        return new ArrayOfCallingPoints();
    }

}