text:
package com.asakusafw.utils.java.internal.model.util;

import java.lang.reflect.GenericArrayType;
import java.lang.reflect.ParameterizedType;
import java.lang.reflect.TypeVariable;
import java.lang.reflect.WildcardType;
import java.util.ArrayList;
import java.util.Collections;
import java.util.HashMap;
import java.util.List;
import java.util.Map;

import com.asakusafw.utils.java.model.syntax.BasicTypeKind;
import com.asakusafw.utils.java.model.syntax.ModelFactory;
import com.asakusafw.utils.java.model.syntax.Type;
import com.asakusafw.utils.java.model.syntax.WildcardBoundKind;
import com.asakusafw.utils.java.model.util.Models;
import com.asakusafw.utils.java.model.util.NoThrow;

/**
 * Maps {@link java.lang.reflect.Type} into Java DOM types.
 */
public class ReflectionTypeMapper extends ReflectionTypeVisitor<Type, ModelFactory, NoThrow> {

    private static final Map<Class<?>, BasicTypeKind> BASIC_TYPES;
    static {
        Map<Class<?>, BasicTypeKind> map = new HashMap<>();
        for (BasicTypeKind kind : BasicTypeKind.values()) {
            map.put(kind.getJavaRepresentation(), kind);
        }
        BASIC_TYPES = Collections.unmodifiableMap(map);
    }

    @Override
    protected Type visitClass(Class<?> type, ModelFactory context) {
        if (BASIC_TYPES.containsKey(type)) {
            return context.newBasicType(BASIC_TYPES.get(type));
        }
        if (type.isArray()) {
            return context.newArrayType(visitClass(type.getComponentType(), context));
        }
        String name = type.getName().replace('$', '.');
        return context.newNamedType(Models.toName(context, name));
    }

    @Override
    protected Type visitGenericArrayType(GenericArrayType type, ModelFactory context) {
        Type component = dispatch(type.getGenericComponentType(), context);
        return context.newArrayType(component);
    }

    @Override
    protected Type visitParameterizedType(ParameterizedType type, ModelFactory context) {
        java.lang.reflect.Type owner = type.getOwnerType();
        java.lang.reflect.Type rawType = type.getRawType();
        Type candidate;
        if (owner == null || owner instanceof Class<?>) {
            candidate = dispatch(rawType, context);
        } else {
            Type enclosing = dispatch(owner, context);
            assert rawType instanceof Class<?> : rawType;
            candidate = context.newQualifiedType(
                enclosing,
                context.newSimpleName(((Class<?>) rawType).getSimpleName()));
        }
        List<Type> typeArguments = new ArrayList<>();
        for (java.lang.reflect.Type t : type.getActualTypeArguments()) {
            typeArguments.add(dispatch(t, context));
        }
        return context.newParameterizedType(candidate, typeArguments);
    }

    @Override
    protected Type visitTypeVariable(TypeVariable<?> type, ModelFactory context) {
        return context.newNamedType(context.newSimpleName(type.getName()));
    }

    @Override
    protected Type visitWildcardType(WildcardType type, ModelFactory context) {
        java.lang.reflect.Type[] lower = type.getLowerBounds();
        if (lower.length == 1) {
            return context.newWildcard(WildcardBoundKind.LOWER_BOUNDED, dispatch(lower[0], context));
        }
        java.lang.reflect.Type[] upper = type.getUpperBounds();
        if (upper.length == 1 && upper[0] != Object.class) {
            return context.newWildcard(WildcardBoundKind.UPPER_BOUNDED, dispatch(upper[0], context));
        }
        return context.newWildcard(WildcardBoundKind.UNBOUNDED, null);
    }
}


text:
package pl.plgrid.unicore.portal.core.ui.model;

/**
 * Created by Rafal on 2014-04-17.
 */
public interface InputFilesComponent {
}

redpajama_set_name: RedPajamaGithub


text:
__author__ = 'ryan'

from google.appengine.api import xmpp

chat_url = "/_ah/xmpp/message/chat/"

class message_handler:

    def send_message(self, receiver):
        chat_message_sent = False
        msg = "Someone has sent you a gift on Example.com. To view: http://example.com/gifts/"
        status_code = xmpp.send_message(receiver, msg)
        chat_message_sent = (status_code == xmpp.NO_ERROR)

        #if not chat_message_sent:

    #def handling_message(self):


text:
package uk.submergedcode.SubmergedCore.commands.utils;

import com.google.common.collect.ImmutableList;
import com.google.common.collect.Sets;

import java.util.List;
import java.util.Set;

public class Completions {

    private Set<String> completions;

    public Completions() {
        completions = Sets.newHashSet();
    }

    public Completions(Iterable<String> completions) {
        completions = Sets.newHashSet(completions);
    }

    public void add(String completion) {
        completions.add(completion);
    }

    public List<String> getCompletions() {
        return ImmutableList.copyOf(completions);
    }
}


text:
import React, {Component} from 'react';
import PropTypes, {connect, withViewport, withContext, withStyles} from '../PropTypes.js';

import Header from '../skeleton/Header';
import Footer from '../skeleton/Footer';
import Grid from 'react-bootstrap/lib/Grid';
import Snackbar from '@material-ui/core/Snackbar';
import * as configActions from '../../actions/configActions.js';

import {MuiThemeProvider, createMuiTheme} from '@material-ui/core/styles';

@connect(state => {
  return {
    config: state.config,
    user: state.user,
  };
}, configActions)
@withContext
@withViewport
@withStyles(require('./App.css'))
export default class App extends Component {
  static propTypes = {
    config: PropTypes.map.isRequired,
    user: PropTypes.UserModel,
    children: PropTypes.element,
    clearSnackbar: PropTypes.func.isRequired,
    viewport: PropTypes.viewport,
  };

  render() {
    var containerStyle = {};

    const isBigTodayMatches = this.props.config.get('container100PerWidth');
    if (isBigTodayMatches) {
      containerStyle.width = '100%';
    }

    return (

        <MuiThemeProvider theme={createMuiTheme()}>

              <Grid style={containerStyle}>
                {this.props.children}
              </Grid>

            {!isBigTodayMatches ?  : null}
            <Snackbar
              open={!!this.props.config.get('snackbar')}
              message={this.props.config.get('snackbar') || ''}
              autoHideDuration={4000}
              onClose={::this._onCloseSnackbar} />

        </MuiThemeProvider>

    );
  }
  _onCloseSnackbar() {
    this.props.clearSnackbar();
  }
}


text:
;(function() {
  "use strict";

  var BaseController = require("BaseController");

  new BaseController({
    siteName: "Rdio",
    playPause: ".play_pause",
    playNext: ".next",
    playPrev: ".prev",
    mute: ".Volume",

    playState: ".play_pause.playing",
    song: ".text_metadata .song_title",
    artist: ".text_metadata .artist_title"
  });
})();


text:
namespace glm
{
	template <typename T, precision P = defaultp>
	struct tvec2
	{
		// -- Implementation detail --

		typedef T value_type;
		typedef tvec2<T, P> type;
		typedef tvec2<bool, P> bool_type;

		// -- Data --

#		if GLM_HAS_ALIGNED_TYPE
#			if GLM_COMPILER & GLM_COMPILER_GCC
#				pragma GCC diagnostic push
#				pragma GCC diagnostic ignored "-Wpedantic"
#			endif
#			if GLM_COMPILER & GLM_COMPILER_CLANG
#				pragma clang diagnostic push
#				pragma clang diagnostic ignored "-Wgnu-anonymous-struct"
#				pragma clang diagnostic ignored "-Wnested-anon-types"
#			endif

			union
			{
				struct{ T x, y; };
				struct{ T r, g; };
				struct{ T s, t; };

#				ifdef GLM_SWIZZLE
					_GLM_SWIZZLE2_2_MEMBERS(T, P, glm::tvec2, x, y)
					_GLM_SWIZZLE2_2_MEMBERS(T, P, glm::tvec2, r, g)
					_GLM_SWIZZLE2_2_MEMBERS(T, P, glm::tvec2, s, t)
					_GLM_SWIZZLE2_3_MEMBERS(T, P, glm::tvec3, x, y)
					_GLM_SWIZZLE2_3_MEMBERS(T, P, glm::tvec3, r, g)
					_GLM_SWIZZLE2_3_MEMBERS(T, P, glm::tvec3, s, t)
					_GLM_SWIZZLE2_4_MEMBERS(T, P, glm::tvec4, x, y)
					_GLM_SWIZZLE2_4_MEMBERS(T, P, glm::tvec4, r, g)
					_GLM_SWIZZLE2_4_MEMBERS(T, P, glm::tvec4, s, t)
#				endif//GLM_SWIZZLE

			};

#			if GLM_COMPILER & GLM_COMPILER_CLANG
#				pragma clang diagnostic pop
#			endif
#			if GLM_COMPILER & GLM_COMPILER_GCC
#				pragma GCC diagnostic pop
#			endif
#		else
			union {T x, r, s;};
			union {T y, g, t;};

#			ifdef GLM_SWIZZLE
				GLM_SWIZZLE_GEN_VEC_FROM_VEC2(T, P, tvec2, tvec2, tvec3, tvec4)
#			endif//GLM_SWIZZLE
#		endif

		// -- Component accesses --

		/// Return the count of components of the vector
		typedef length_t length_type;
		GLM_FUNC_DECL GLM_CONSTEXPR length_type length() const;

		GLM_FUNC_DECL T & operator[](length_type i);
		GLM_FUNC_DECL T const & operator[](length_type i) const;

		// -- Implicit basic constructors --

		GLM_FUNC_DECL GLM_CONSTEXPR tvec2() GLM_DEFAULT_CTOR;
		GLM_FUNC_DECL GLM_CONSTEXPR tvec2(tvec2<T, P> const& v) GLM_DEFAULT;
		template <precision Q>
		GLM_FUNC_DECL GLM_CONSTEXPR tvec2(tvec2<T, Q> const& v);

		// -- Explicit basic constructors --

		GLM_FUNC_DECL GLM_CONSTEXPR_CTOR explicit tvec2(ctor);
		GLM_FUNC_DECL GLM_CONSTEXPR explicit tvec2(T scalar);
		GLM_FUNC_DECL GLM_CONSTEXPR tvec2(T s1, T s2);

		// -- Conversion constructors --

		/// Explicit converions (From section 5.4.1 Conversion and scalar constructors of GLSL 1.30.08 specification)
		template <typename A, typename B>
		GLM_FUNC_DECL GLM_CONSTEXPR tvec2(A x, B y);
		template <typename A, typename B>
		GLM_FUNC_DECL GLM_CONSTEXPR tvec2(tvec1<A, P> const & v1, tvec1<B, P> const & v2);

		// -- Conversion vector constructors --

		/// Explicit conversions (From section 5.4.1 Conversion and scalar constructors of GLSL 1.30.08 specification)
		template <typename U, precision Q>
		GLM_FUNC_DECL GLM_CONSTEXPR GLM_EXPLICIT tvec2(tvec3<U, Q> const & v);
		/// Explicit conversions (From section 5.4.1 Conversion and scalar constructors of GLSL 1.30.08 specification)
		template <typename U, precision Q>
		GLM_FUNC_DECL GLM_CONSTEXPR GLM_EXPLICIT tvec2(tvec4<U, Q> const & v);

		/// Explicit conversions (From section 5.4.1 Conversion and scalar constructors of GLSL 1.30.08 specification)
		template <typename U, precision Q>
		GLM_FUNC_DECL GLM_CONSTEXPR GLM_EXPLICIT tvec2(tvec2<U, Q> const & v);

		// -- Swizzle constructors --
#		if GLM_HAS_UNRESTRICTED_UNIONS && defined(GLM_SWIZZLE)
			template <int E0, int E1>
			GLM_FUNC_DECL tvec2(detail::_swizzle<2, T, P, glm::tvec2, E0, E1,-1,-2> const& that)
			{
				*this = that();
			}
#		endif// GLM_HAS_UNRESTRICTED_UNIONS && defined(GLM_SWIZZLE)

		// -- Unary arithmetic operators --

		GLM_FUNC_DECL tvec2<T, P>& operator=(tvec2<T, P> const & v) GLM_DEFAULT;

		template <typename U>
		GLM_FUNC_DECL tvec2<T, P>& operator=(tvec2<U, P> const & v);
		template <typename U>
		GLM_FUNC_DECL tvec2<T, P>& operator+=(U scalar);
		template <typename U>
		GLM_FUNC_DECL tvec2<T, P>& operator+=(tvec1<U, P> const & v);
		template <typename U>
		GLM_FUNC_DECL tvec2<T, P>& operator+=(tvec2<U, P> const & v);
		template <typename U>
		GLM_FUNC_DECL tvec2<T, P>& operator-=(U scalar);
		template <typename U>
		GLM_FUNC_DECL tvec2<T, P>& operator-=(tvec1<U, P> const & v);
		template <typename U>
		GLM_FUNC_DECL tvec2<T, P>& operator-=(tvec2<U, P> const & v);
		template <typename U>
		GLM_FUNC_DECL tvec2<T, P>& operator*=(U scalar);
		template <typename U>
		GLM_FUNC_DECL tvec2<T, P>& operator*=(tvec1<U, P> const & v);
		template <typename U>
		GLM_FUNC_DECL tvec2<T, P>& operator*=(tvec2<U, P> const & v);
		template <typename U>
		GLM_FUNC_DECL tvec2<T, P>& operator/=(U scalar);
		template <typename U>
		GLM_FUNC_DECL tvec2<T, P>& operator/=(tvec1<U, P> const & v);
		template <typename U>
		GLM_FUNC_DECL tvec2<T, P>& operator/=(tvec2<U, P> const & v);

		// -- Increment and decrement operators --

		GLM_FUNC_DECL tvec2<T, P> & operator++();
		GLM_FUNC_DECL tvec2<T, P> & operator--();
		GLM_FUNC_DECL tvec2<T, P> operator++(int);
		GLM_FUNC_DECL tvec2<T, P> operator--(int);

		// -- Unary bit operators --

		template <typename U>
		GLM_FUNC_DECL tvec2<T, P> & operator%=(U scalar);
		template <typename U>
		GLM_FUNC_DECL tvec2<T, P> & operator%=(tvec1<U, P> const & v);
		template <typename U>
		GLM_FUNC_DECL tvec2<T, P> & operator%=(tvec2<U, P> const & v);
		template <typename U>
		GLM_FUNC_DECL tvec2<T, P> & operator&=(U scalar);
		template <typename U>
		GLM_FUNC_DECL tvec2<T, P> & operator&=(tvec1<U, P> const & v);
		template <typename U>
		GLM_FUNC_DECL tvec2<T, P> & operator&=(tvec2<U, P> const & v);
		template <typename U>
		GLM_FUNC_DECL tvec2<T, P> & operator|=(U scalar);
		template <typename U>
		GLM_FUNC_DECL tvec2<T, P> & operator|=(tvec1<U, P> const & v);
		template <typename U>
		GLM_FUNC_DECL tvec2<T, P> & operator|=(tvec2<U, P> const & v);
		template <typename U>
		GLM_FUNC_DECL tvec2<T, P> & operator^=(U scalar);
		template <typename U>
		GLM_FUNC_DECL tvec2<T, P> & operator^=(tvec1<U, P> const & v);
		template <typename U>
		GLM_FUNC_DECL tvec2<T, P> & operator^=(tvec2<U, P> const & v);
		template <typename U>
		GLM_FUNC_DECL tvec2<T, P> & operator<<=(U scalar);
		template <typename U>
		GLM_FUNC_DECL tvec2<T, P> & operator<<=(tvec1<U, P> const & v);
		template <typename U>
		GLM_FUNC_DECL tvec2<T, P> & operator<<=(tvec2<U, P> const & v);
		template <typename U>
		GLM_FUNC_DECL tvec2<T, P> & operator>>=(U scalar);
		template <typename U>
		GLM_FUNC_DECL tvec2<T, P> & operator>>=(tvec1<U, P> const & v);
		template <typename U>
		GLM_FUNC_DECL tvec2<T, P> & operator>>=(tvec2<U, P> const & v);
	};

	// -- Unary operators --

	template <typename T, precision P>
	GLM_FUNC_DECL tvec2<T, P> operator+(tvec2<T, P> const & v);

	template <typename T, precision P>
	GLM_FUNC_DECL tvec2<T, P> operator-(tvec2<T, P> const & v);

	// -- Binary operators --

	template <typename T, precision P>
	GLM_FUNC_DECL tvec2<T, P> operator+(tvec2<T, P> const & v, T scalar);

	template <typename T, precision P>
	GLM_FUNC_DECL tvec2<T, P> operator+(tvec2<T, P> const & v1, tvec1<T, P> const & v2);

	template <typename T, precision P>
	GLM_FUNC_DECL tvec2<T, P> operator+(T scalar, tvec2<T, P> const & v);

	template <typename T, precision P>
	GLM_FUNC_DECL tvec2<T, P> operator+(tvec1<T, P> const & v1, tvec2<T, P> const & v2);

	template <typename T, precision P>
	GLM_FUNC_DECL tvec2<T, P> operator+(tvec2<T, P> const & v1, tvec2<T, P> const & v2);

	template <typename T, precision P>
	GLM_FUNC_DECL tvec2<T, P> operator-(tvec2<T, P> const & v, T scalar);

	template <typename T, precision P>
	GLM_FUNC_DECL tvec2<T, P> operator-(tvec2<T, P> const & v1, tvec1<T, P> const & v2);

	template <typename T, precision P>
	GLM_FUNC_DECL tvec2<T, P> operator-(T scalar, tvec2<T, P> const & v);

	template <typename T, precision P>
	GLM_FUNC_DECL tvec2<T, P> operator-(tvec1<T, P> const & v1, tvec2<T, P> const & v2);

	template <typename T, precision P>
	GLM_FUNC_DECL tvec2<T, P> operator-(tvec2<T, P> const & v1, tvec2<T, P> const & v2);

	template <typename T, precision P>
	GLM_FUNC_DECL tvec2<T, P> operator*(tvec2<T, P> const & v, T scalar);

	template <typename T, precision P>
	GLM_FUNC_DECL tvec2<T, P> operator*(tvec2<T, P> const & v1, tvec1<T, P> const & v2);

	template <typename T, precision P>
	GLM_FUNC_DECL tvec2<T, P> operator*(T scalar, tvec2<T, P> const & v);

	template <typename T, precision P>
	GLM_FUNC_DECL tvec2<T, P> operator*(tvec1<T, P> const & v1, tvec2<T, P> const & v2);

	template <typename T, precision P>
	GLM_FUNC_DECL tvec2<T, P> operator*(tvec2<T, P> const & v1, tvec2<T, P> const & v2);

	template <typename T, precision P>
	GLM_FUNC_DECL tvec2<T, P> operator/(tvec2<T, P> const & v, T scalar);

	template <typename T, precision P>
	GLM_FUNC_DECL tvec2<T, P> operator/(tvec2<T, P> const & v1, tvec1<T, P> const & v2);

	template <typename T, precision P>
	GLM_FUNC_DECL tvec2<T, P> operator/(T scalar, tvec2<T, P> const & v);

	template <typename T, precision P>
	GLM_FUNC_DECL tvec2<T, P> operator/(tvec1<T, P> const & v1, tvec2<T, P> const & v2);

	template <typename T, precision P>
	GLM_FUNC_DECL tvec2<T, P> operator/(tvec2<T, P> const & v1, tvec2<T, P> const & v2);

	template <typename T, precision P>
	GLM_FUNC_DECL tvec2<T, P> operator%(tvec2<T, P> const & v, T scalar);

	template <typename T, precision P>
	GLM_FUNC_DECL tvec2<T, P> operator%(tvec2<T, P> const & v1, tvec1<T, P> const & v2);

	template <typename T, precision P>
	GLM_FUNC_DECL tvec2<T, P> operator%(T scalar, tvec2<T, P> const & v);

	template <typename T, precision P>
	GLM_FUNC_DECL tvec2<T, P> operator%(tvec1<T, P> const & v1, tvec2<T, P> const & v2);

	template <typename T, precision P>
	GLM_FUNC_DECL tvec2<T, P> operator%(tvec2<T, P> const & v1, tvec2<T, P> const & v2);

	template <typename T, precision P>
	GLM_FUNC_DECL tvec2<T, P> operator&(tvec2<T, P> const & v, T scalar);

	template <typename T, precision P>
	GLM_FUNC_DECL tvec2<T, P> operator&(tvec2<T, P> const & v1, tvec1<T, P> const & v2);

	template <typename T, precision P>
	GLM_FUNC_DECL tvec2<T, P> operator&(T scalar, tvec2<T, P> const & v);

	template <typename T, precision P>
	GLM_FUNC_DECL tvec2<T, P> operator&(tvec1<T, P> const & v1, tvec2<T, P> const & v2);

	template <typename T, precision P>
	GLM_FUNC_DECL tvec2<T, P> operator&(tvec2<T, P> const & v1, tvec2<T, P> const & v2);

	template <typename T, precision P>
	GLM_FUNC_DECL tvec2<T, P> operator|(tvec2<T, P> const & v, T scalar);

	template <typename T, precision P>
	GLM_FUNC_DECL tvec2<T, P> operator|(tvec2<T, P> const & v1, tvec1<T, P> const & v2);

	template <typename T, precision P>
	GLM_FUNC_DECL tvec2<T, P> operator|(T scalar, tvec2<T, P> const & v);

	template <typename T, precision P>
	GLM_FUNC_DECL tvec2<T, P> operator|(tvec1<T, P> const & v1, tvec2<T, P> const & v2);

	template <typename T, precision P>
	GLM_FUNC_DECL tvec2<T, P> operator|(tvec2<T, P> const & v1, tvec2<T, P> const & v2);

	template <typename T, precision P>
	GLM_FUNC_DECL tvec2<T, P> operator^(tvec2<T, P> const & v, T scalar);

	template <typename T, precision P>
	GLM_FUNC_DECL tvec2<T, P> operator^(tvec2<T, P> const & v1, tvec1<T, P> const & v2);

	template <typename T, precision P>
	GLM_FUNC_DECL tvec2<T, P> operator^(T scalar, tvec2<T, P> const & v);

	template <typename T, precision P>
	GLM_FUNC_DECL tvec2<T, P> operator^(tvec1<T, P> const & v1, tvec2<T, P> const & v2);

	template <typename T, precision P>
	GLM_FUNC_DECL tvec2<T, P> operator^(tvec2<T, P> const & v1, tvec2<T, P> const & v2);

	template <typename T, precision P>
	GLM_FUNC_DECL tvec2<T, P> operator<<(tvec2<T, P> const & v, T scalar);

	template <typename T, precision P>
	GLM_FUNC_DECL tvec2<T, P> operator<<(tvec2<T, P> const & v1, tvec1<T, P> const & v2);

	template <typename T, precision P>
	GLM_FUNC_DECL tvec2<T, P> operator<<(T scalar, tvec2<T, P> const & v);

	template <typename T, precision P>
	GLM_FUNC_DECL tvec2<T, P> operator<<(tvec1<T, P> const & v1, tvec2<T, P> const & v2);

	template <typename T, precision P>
	GLM_FUNC_DECL tvec2<T, P> operator<<(tvec2<T, P> const & v1, tvec2<T, P> const & v2);

	template <typename T, precision P>
	GLM_FUNC_DECL tvec2<T, P> operator>>(tvec2<T, P> const & v, T scalar);

	template <typename T, precision P>
	GLM_FUNC_DECL tvec2<T, P> operator>>(tvec2<T, P> const & v1, tvec1<T, P> const & v2);

	template <typename T, precision P>
	GLM_FUNC_DECL tvec2<T, P> operator>>(T scalar, tvec2<T, P> const & v);

	template <typename T, precision P>
	GLM_FUNC_DECL tvec2<T, P> operator>>(tvec1<T, P> const & v1, tvec2<T, P> const & v2);

	template <typename T, precision P>
	GLM_FUNC_DECL tvec2<T, P> operator>>(tvec2<T, P> const & v1, tvec2<T, P> const & v2);

	template <typename T, precision P>
	GLM_FUNC_DECL tvec2<T, P> operator~(tvec2<T, P> const & v);

	// -- Boolean operators --

	template <typename T, precision P>
	GLM_FUNC_DECL bool operator==(tvec2<T, P> const & v1, tvec2<T, P> const & v2);

	template <typename T, precision P>
	GLM_FUNC_DECL bool operator!=(tvec2<T, P> const & v1, tvec2<T, P> const & v2);

	template <precision P>
	GLM_FUNC_DECL tvec2<bool, P> operator&&(tvec2<bool, P> const & v1, tvec2<bool, P> const & v2);

	template <precision P>
	GLM_FUNC_DECL tvec2<bool, P> operator||(tvec2<bool, P> const & v1, tvec2<bool, P> const & v2);
}//namespace glm

#ifndef GLM_EXTERNAL_TEMPLATE
#include "type_vec2.inl"
#endif//GLM_EXTERNAL_TEMPLATE


text:
title: Gemini Bridges
---

{% include authoring/image.html
    image_path = "assets/collections/drone-work/preview/gemini-bridges.jpg"
    link = "assets/collections/drone-work/full-res/gemini-bridges.jpg"
    caption = "A train passes a parking area for the Gemini Bridges 4x4 trail north of Moab, Utah."
    is_decorative = false
    credit = "Photo by Carter Pape"
    license = "CC BY-SA 4.0"
%}


text:
/*
 *   This file is part of SGEA - Sistema de Gestão de Eventos Acadêmicos - TADS IFNMG Campus Januária.
 *
 *   SGEA is free software: you can redistribute it and/or modify
 *   it under the terms of the GNU General Public License as published by
 *   the Free Software Foundation, either version 3 of the License, or
 *   (at your option) any later version.
 *
 *   SGEA is distributed in the hope that it will be useful,
 *   but WITHOUT ANY WARRANTY; without even the implied warranty of
 *   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 *   GNU General Public License for more details.
 *
 *   You should have received a copy of the GNU General Public License
 *   along with SGEA.  If not, see <http://www.gnu.org/licenses/>.
 */
package br.edu.ifnmg.GerenciamentoEventos.DomainModel.Servicos;

import br.edu.ifnmg.DomainModel.Services.Repositorio;
import br.edu.ifnmg.GerenciamentoEventos.DomainModel.Inscricao;
import br.edu.ifnmg.DomainModel.Pessoa;
import br.edu.ifnmg.GerenciamentoEventos.DomainModel.Questionario;
import br.edu.ifnmg.GerenciamentoEventos.DomainModel.QuestionarioResposta;
import javax.ejb.Local;

/**
 *
 * @author petronio
 */
@Local
public interface QuestionarioRespostaRepositorio extends Repositorio<QuestionarioResposta> {
     public QuestionarioResposta Abrir(Pessoa p, Questionario q);
     public QuestionarioResposta Abrir(Inscricao i);
}


text:
var JobTableView = Backbone.View.extend({
    width: null,
    software: null,
    project: null,
    jobs: null,
    parent: null,
    table: null,
    datatable: null,
    paramsFromSoftwares: null,
    paramsFromSoftwaresFull: null,
    paramsFromSoftwaresVisibility: null,
    paramsFromSoftwaresDomainFill: null,
    FIRSTCOLUMNWITHJOBDATA: 7,
    initialize: function (options) {
        var self = this;
        this.software = options.software;
        this.project = options.project;
        this.parent = options.parent;
        this.jobs = options.jobs;
        this.paramsFromSoftwares = [];
        this.paramsFromSoftwaresFull = [];
        _.each(self.software.get('parameters'), function (param) {
            self.paramsFromSoftwares.push(param.name);
            self.paramsFromSoftwaresFull.push(param);
        });
        this.paramsFromSoftwaresVisibility = [];
        this.paramsFromSoftwaresDomainFill = [];
        _.each(self.software.get('parameters'), function (param) {
            self.paramsFromSoftwaresVisibility.push(false);
            self.paramsFromSoftwaresDomainFill.push(false);
        });
    },
    render: function () {
        var self = this;
        require([
            "text!application/templates/processing/JobListing.tpl.html"
        ],
            function (jobListingViewTpl) {
                self.loadResult(jobListingViewTpl);
            });
        return this;
    },
    loadResult: function (jobListingViewTpl) {
        console.log("JobTableView.loadResult");
        var self = this;
        var content = _.template(jobListingViewTpl, {});
        $(self.el).empty();
        $(self.el).append(content);

        self.printDatatables();
    },
    refresh: function (jobs) {
        var self = this;
        console.log("JobTableView.refresh");
        self.jobs = jobs;
        self.printDatatables();
    },
    printDatatables: function () {
        var self = this;
        console.log("JobTableView.printDatatables");
        $(self.el).find('#searchJobTable').find('#searchJobHeader').empty();
        $(self.el).find('#searchJobTable').find("tbody").empty();

        //add column
        if (self.jobs != undefined && self.jobs.length > 0) {
            self.addColumns(self.jobs.models[0]);
        }

        //clear row
        $(self.el).find('#searchJobTable').find("tbody").empty();
        var datatable = $(self.el).find('#searchJobTable').dataTable();
        datatable.fnClearTable();
        $(self.el).find('#searchJobTable').find("tbody").empty();

        //show hidden column (if not done, datatable is not filled)
        self.buildShowHideAllColumn(datatable, true);
        datatable.fnClearTable();

        //add row
        if (self.jobs != undefined) {
            self.jobs.each(function (job) {
                self.addRow(job);
            });
        }

        $(self.el).find('#searchJobTable').find("tbody").find("button").click(function () {
            var id = $(this).attr("id");
            window.location = '#tabs-algos-' + self.project.id + "-" + self.software.id + "-" + id + '';
        });

        self.table = $(self.el).find('#searchJobTable').dataTable({
            "bFilter": true,
            "sDom": '<"toolbar">rtip',
            "sPaginationType": "bootstrap",
            "oLanguage": {
                "sLengthMenu": "_MENU_ records per page"
            },
            "iDisplayLength": 15,
            "bLengthChange": false,
            bDestroy: true
        });

        //print sub grid datatables
        self.initSubGridDatatables();

        //hide id column
        //self.buildSHowHideColumnParamPanel(self.table);

    },
    addColumns: function (job) {
        var self = this;

        $(self.el).find('#searchJobTable').find('#searchJobHeader').append('	');
        $(self.el).find('#searchJobTable').find('#searchJobHeader').append('Id	');
        $(self.el).find('#searchJobTable').find('#searchJobHeader').append('#	');
        $(self.el).find('#searchJobTable').find('#searchJobHeader').append('Date	');
        $(self.el).find('#searchJobTable').find('#searchJobHeader').append('State	');
        $(self.el).find('#searchJobTable').find('#searchJobHeader').append('Rate	');
        $(self.el).find('#searchJobTable').find('#searchJobHeader').append('See	');

        _.each(self.software.get('parameters'), function (param) {
            $(self.el).find('#searchJobTable').find('#searchJobHeader').append("" + param.name + "	");
        });
    },
    addRow: function (job) {
        var self = this;
        var tbody = $(self.el).find('#searchJobTable').find("tbody");
        var cellIcon = '';
        var cellId = job.id;
        var cellNumber = job.get('number');
        var cellDate = window.app.convertLongToDate(job.get('created'));
        var cellState = self.getStateElement(job);
        var cellSee = '<button id="' + job.id + '">See details</button>';
        var cellRate = "";
        if (job.get('rate') != -1) {
            cellRate = (job.get('rate') * 100).toFixed(2) + "%";
        }

        //fill array with first column info
        var colArray = ['
', '' + cellIcon + '	', '' + cellId + '	', '' + cellNumber + '	', '' + cellDate + '	', '' + cellState + '	', '' + cellRate + '	', '' + cellSee + '	']

        //get all params form job to print in table column
        var jobParamArray = job.get('jobParameters');
        if (jobParamArray.length == 0) {
            _.each(self.paramsFromSoftwares, function (softParam) {
                colArray.push('	')
            });
        } else {
            for (var i = 0, j = 0; i < self.paramsFromSoftwares.length && j < jobParamArray.length; i++) {
                if (self.paramsFromSoftwares[i] == jobParamArray[j].name) {
                    colArray.push(self.getValueElement(jobParamArray[j]));
                    j++;
                } else {
                    //this job has no info for this param => add empty cell
                    colArray.push('	')
                }
            }
        }
        colArray.push('
');
        var rowString = colArray.join("");
        tbody.append(rowString);

    },
    getValueElement: function (param) {
        var self = this;
        if (param.type == "String" || param.type == "Number") {
            return '' + param.value + '	';
        } else if (param.type == "Boolean") {
            if (param.value) {
                return '<input type="checkbox" name="checkbox" value="checkbox" checked="checked">	'
            }
            else {
                return '<input type="checkbox" name="checkbox" value="checkbox" checked="checked">	'
            }
        } else if (param.type == "List") {
            return '' + param.value + '	';
        } else if (param.type == "Date") {

            if (param.value != null) {
                return '' + window.app.convertLongToDate(param.value) + '	';
            }
            else {
                return "	";
            }
        } else if (param.type == 'ListDomain' || param.type == 'Domain') {
            return 'Loading...	';
        } else {
            return '' + param.value + '	';
        }

    },

    getStateElement: function (job) {
        if (job.isNotLaunch()) {
            return 'Not Launch ';
        }
        else if (job.isInQueue()) {
            return 'In queue ';
        }
        else if (job.isRunning()) {
            return 'Running ';
        }
        else if (job.isSuccess()) {
            return 'Success ';
        }
        else if (job.isFailed()) {
            return 'Failed ';
        }
        else if (job.isIndeterminate()) {
            return 'Indetereminate ';
        }
        else if (job.isWait()) {
            return 'Wait ';
        }
        else if (job.isPreviewed()) {
            return 'Previewed ';
        }
        else {
            return "no supported";
        }
    },
    initSubGridDatatables: function () {
        console.log("JobTableView.initSubGridDatatables");
        var self = this;

        $(self.el).find('#searchJobTable tbody td i').unbind('click');
        $(self.el).find('#searchJobTable tbody td i').click(function () {

            var nTr = $(this).parents('tr')[0];

            if (self.table.fnIsOpen(nTr)) {
                /* This row is already open - close it */
                console.log("close");
                $(this).removeClass("class", "icon-minus");
                $(this).addClass("class", "icon-plus");
                self.table.fnClose(nTr);
            }
            else {
                /* Open this row */
                console.log("open");
                $(this).removeClass("class", "icon-plus");
                $(this).addClass("class", "icon-minus");
                self.table.fnOpen(nTr, self.seeDetails(nTr), 'details');
                var aData = self.table.fnGetData(nTr);
                console.log("aData[1]=" + aData[1]);
                new JobModel({ id: aData[1]}).fetch({
                    success: function (model, response) {
                        var tableParam = $(self.el).find('#searchJobTable').find('table[id=' + aData[1] + ']');
                        _.each(model.get('jobParameters'), function (param) {
                            tableParam.append('
' + param.name + '	' + param.value + '	' + param.type + '
');
                        });
                    }
                });
            }
        });
    },
    /* Formating function for row details */
    seeDetails: function (nTr) {
        var self = this;
        var aData = self.table.fnGetData(nTr);

        var sOut = '
';
        sOut += '
';

        return sOut;
    },
    buildShowHideAllColumn: function (datatable, show) {
        var self = this;
        for (var i = 0; i < datatable.fnSettings().aoColumns.length; i++) {
            datatable.fnSetColumnVis(i, show);
        }
    },
    buildSHowHideColumnParamPanel: function (datatable) {
        var self = this;
        console.log("buildHideColumnParamPanel=" + datatable.fnSettings().aoColumns.length);
        for (var i = self.FIRSTCOLUMNWITHJOBDATA; i < datatable.fnSettings().aoColumns.length; i++) {
            var visibility = self.paramsFromSoftwaresVisibility[i - self.FIRSTCOLUMNWITHJOBDATA];
            datatable.fnSetColumnVis(i, visibility);
        }

        $("#showParamColumnSearchJobTable").empty();
        var strSelectBox = '<select id="selectShowParamColumnSearchJobTable">';
        for (var i = self.FIRSTCOLUMNWITHJOBDATA; i < datatable.fnSettings().aoColumns.length; i++) {
            strSelectBox = strSelectBox + '<option value="' + (i - self.FIRSTCOLUMNWITHJOBDATA) + '">' + datatable.fnSettings().aoColumns[i].sTitle + '</option>';
        }
        strSelectBox = strSelectBox + "</select>";
        $("#showParamColumnSearchJobTable").append(strSelectBox);

        $("#selectShowParamColumnSearchJobTable").multiselect({
            selectedText: "Show/Hide  Parameters columns: # of # selected",
            noneSelectedText: "Show/Hide Parameters columns",
            minWidth: ($("#showParamColumnSearchJobTable").width() - 50),
            height: 'auto'
        });

        var selectElem = $("#showParamColumnSearchJobTable");
        selectElem.find("button").width(($("#showParamColumnSearchJobTable").width() - 50));
        //put header menu option on the same line
        selectElem.find(".ui-multiselect-menu").find("span").css("display", "inline");
        selectElem.find(".ui-multiselect-menu").find("input").css("display", "inline");
        selectElem.find(".ui-multiselect-menu").find(".ui-multiselect-header").find("li").css("display", "inline");
        //put check all on left and deselect all on right
        selectElem.find(".ui-multiselect-menu").find(".ui-multiselect-header").find("li").eq(0).css("float", "left");
        selectElem.find(".ui-multiselect-menu").find(".ui-multiselect-header").find("li").eq(1).css("float", "right");
        selectElem.find(".ui-multiselect-menu").find("li").css("display", "inline");
        selectElem.find(".ui-multiselect-menu").find("li").css("padding-left", "5px");
        selectElem.find(".ui-multiselect-menu").find("label").css("display", "inline");
        //print scroll only vertical
        selectElem.find("ul.ui-multiselect-checkboxes").css('overflow-y', 'scroll');
        selectElem.find("ul.ui-multiselect-checkboxes").css('overflow-x', 'hidden');
        selectElem.find("#selectShowParamColumnSearchJobTable").multiselect("close");
        selectElem.find("#selectShowParamColumnSearchJobTable").multiselect("uncheckAll");

        $("#selectShowParamColumnSearchJobTable").bind("multiselectclick", function (event, ui) {
            console.log("Show/Hide:" + ui.value);
            self.showOrHideColumnVisibility((parseInt(ui.value) + self.FIRSTCOLUMNWITHJOBDATA), datatable, ui.checked);
        });
        $("#selectShowParamColumnSearchJobTable").bind("multiselectcheckall", function (event, ui) {
            self.showOrHideAllColumnVisibility(datatable, true);
        });

        $("#selectShowParamColumnSearchJobTable").bind("multiselectuncheckall", function (event, ui) {
            self.showOrHideAllColumnVisibility(datatable, false);
        });
    },
    showOrHideAllColumnVisibility: function (datatable, show) {
        var self = this;
        self.paramsFromSoftwaresVisibility = [];
        _.each(self.software.get('parameters'), function (param) {
            self.paramsFromSoftwaresVisibility.push(show)
        });

        var i = 0;
        _.each(self.software.get('parameters'), function (param) {
            self.showOrHideColumnVisibility((parseInt(i) + self.FIRSTCOLUMNWITHJOBDATA), datatable, show);
            i++;
        });
    },
    showOrHideColumnVisibility: function (colIndex, datatable, show) {
        console.log("Click show/hide column:" + colIndex);
        var self = this;
        var columnIndex = colIndex - self.FIRSTCOLUMNWITHJOBDATA;
        var columnParamIndex = parseInt(colIndex);
        console.log("columnIndex=" + columnIndex + " columnParamIndex=" + columnParamIndex);
        self.paramsFromSoftwaresVisibility[columnIndex] = show
        console.log("Change visibility to " + self.paramsFromSoftwaresVisibility[columnIndex]);
        datatable.fnSetColumnVis(columnParamIndex, self.paramsFromSoftwaresVisibility[columnIndex]);

        var param = self.paramsFromSoftwaresFull[columnIndex];
        self.fillDomainElement(param, columnIndex);
    },
    fillDomainElement: function (param, index) {

        if (param.type == "Domain" || param.type == "ListDomain") {
            if (!this.paramsFromSoftwaresDomainFill[index]) {
                this.retrieveAndReplaceCell(param, index);
            }
        }

    },
    retrieveAndReplaceCell: function (param, index) {
        var self = this;
        new SoftwareParameterModelCollection({uri: window.app.replaceVariable(param.uri), sortAttribut: param.uriSortAttribut}).fetch({
            success: function (collection, response) {
                _.each($(self.el).find("label." + param.id), function (cell) {
                    var domainList = $(cell).attr("data");
                    var domainName = [];
                    _.each(domainList.split(","), function (id) {
                        var domain = collection.get(id);
                        if (domain != undefined) {
                            domainName.push(domain.get(param.uriPrintAttribut));
                        }
                    });
                    $(cell).empty();
                    $(cell).text(domainName.join(","));

                });

                self.paramsFromSoftwaresDomainFill[index] = true;
            }
        });
    }
});


text:
module.exports = db => {
    const collecton = db.collection("experiences");

    return Promise.all([
        // 職稱與公司名稱會被搜尋
        collecton.createIndex({ company: 1 }),
        collecton.createIndex({ job_title: 1 }),
        // popularity 排序依據
        collecton.createIndex({ like_count: 1 }),
        collecton.createIndex({ reply_count: 1 }),
        // 最新
        collecton.createIndex({ created_at: -1 }),
    ]);
};


text:
package com.noveogroup.clap.dao;

import com.noveogroup.clap.entity.revision.RevisionVariantEntity;

/**
 * @author Andrey Sokolov
 */
public interface RevisionVariantDAO extends GenericDAO<RevisionVariantEntity, Long> {
    RevisionVariantEntity getRevisionByHash(String revisionHash);
    RevisionVariantEntity getRevisionByMessageId(long id);
}


text:
package io.kaif.web.v1;

import java.util.Collections;
import java.util.List;

import com.fasterxml.jackson.annotation.JsonPropertyOrder;

import io.kaif.web.support.ErrorResponse;

/**
 * a oauth error response with body like:
 *

 *

 * {
 *    "errors":[
 *      {
 *        "status": 400,
 *        "title": "bad request"
 *      }
 *    ]
 * }
 *

 *

 */
public class V1ErrorResponse implements ErrorResponse {

  @JsonPropertyOrder(value = { "status", "title" })
  public static class Error {
    private final int status;
    private final String title;
    //optional
    private final String type;
    //optional
    private final Boolean translated;

    public Error(int status, String title, String type, Boolean translated) {
      this.status = status;
      this.title = title;
      this.type = type;
      this.translated = translated;
    }

    public Error(int status, String title) {
      this(status, title, null, null);
    }

    public int getStatus() {
      return status;
    }

    public String getTitle() {
      return title;
    }

    public String getType() {
      return type;
    }

    public Boolean isTranslated() {
      return translated;
    }

    /**
     * although toString() currently return a valid JSON form of information, you should not rely
     * on
     * this format to do any parse or serialization. use Jackson to de/serialize object instead.
     */
    @Override
    public String toString() {
      return "{\"status\":" + status + ",\"title\":\"" + title + "\"}";
    }
  }

  private static final long serialVersionUID = 4886331307L;
  private final List<Error> errors;

  public V1ErrorResponse(final int status, final String title) {
    this(status, title, null, null);
  }

  public V1ErrorResponse(final int status,
      final String title,
      final String type,
      final Boolean translated) {
    this.errors = Collections.singletonList(new Error(status, title, type, translated));
  }

  public List<Error> getErrors() {
    return errors;
  }
}


text:
package com.cloud.network.dao;

import java.util.List;

import com.cloud.utils.db.GenericDao;

public interface Site2SiteCustomerGatewayDao extends GenericDao<Site2SiteCustomerGatewayVO, Long> {
    Site2SiteCustomerGatewayVO findByNameAndAccountId(String name, long accountId);

    List<Site2SiteCustomerGatewayVO> listByAccountId(long accountId);
}


text:
package com.marshalchen.common.uimodule.shapeimageview.path.parser;

import android.util.Log;

import java.io.ByteArrayInputStream;
import java.io.ByteArrayOutputStream;
import java.io.IOException;
import java.io.InputStream;

class CopyInputStream {
    private static final String TAG = SvgToPath.TAG;

    private final InputStream _is;
    private ByteArrayOutputStream _copy;

    public CopyInputStream(InputStream is) {
        _is = is;

        try {
            copy();
        }
        catch(IOException ex) {
            Log.w(TAG, "IOException in CopyInputStream " + ex.toString());
        }
    }

    private void copy() throws IOException {
        _copy = new ByteArrayOutputStream();
        int chunk;
        byte[] data = new byte[256];

        while(-1 != (chunk = _is.read(data))) {
            _copy.write(data, 0, chunk);
        }
        _copy.flush();
    }

    public ByteArrayInputStream getCopy() {
        return new ByteArrayInputStream(_copy.toByteArray());
    }
}


text:
@implementation R2RTransitItinerary

@synthesize legs;

@end


text:
namespace {

// Time in seconds for connection timeout.
const int kConnectionTimeoutSec = 15;

}  // namespace

namespace chromeos {

///////////////////////////////////////////////////////////////////////////////
// NetworkScreen, public:

NetworkScreen::NetworkScreen(ScreenObserver* screen_observer,
                             NetworkScreenActor* actor)
    : WizardScreen(screen_observer),
      is_network_subscribed_(false),
      continue_pressed_(false),
      actor_(actor) {
  actor_->SetDelegate(this);
}

NetworkScreen::~NetworkScreen() {
  connection_timer_.Stop();
  UnsubscribeNetworkNotification();
}

////////////////////////////////////////////////////////////////////////////////
// NetworkScreen, WizardScreen implementation:

void NetworkScreen::PrepareToShow() {
  actor_->PrepareToShow();
}

void NetworkScreen::Show() {
  actor_->Show();
  Refresh();
}

void NetworkScreen::Hide() {
  actor_->Hide();
}

std::string NetworkScreen::GetName() const {
  return WizardController::kNetworkScreenName;
}

////////////////////////////////////////////////////////////////////////////////
// NetworkScreen, NetworkLibrary::NetworkManagerObserver implementation:

void NetworkScreen::OnNetworkManagerChanged(NetworkLibrary* network_lib) {
  UpdateStatus(network_lib);
}

////////////////////////////////////////////////////////////////////////////////
// NetworkScreen, public:

void NetworkScreen::Refresh() {
  SubscribeNetworkNotification();
  OnNetworkManagerChanged(chromeos::CrosLibrary::Get()->GetNetworkLibrary());
}

///////////////////////////////////////////////////////////////////////////////
// NetworkScreen, NetworkScreenActor::Delegate implementation:

void NetworkScreen::OnContinuePressed() {
  NetworkLibrary* network = CrosLibrary::Get()->GetNetworkLibrary();
  if (network && network->Connected()) {
    NotifyOnConnection();
  } else {
    continue_pressed_ = true;
    WaitForConnection(network_id_);
  }
}

////////////////////////////////////////////////////////////////////////////////
// NetworkScreen, private:

void NetworkScreen::SubscribeNetworkNotification() {
  if (!is_network_subscribed_) {
    is_network_subscribed_ = true;
    chromeos::CrosLibrary::Get()->GetNetworkLibrary()
        ->AddNetworkManagerObserver(this);
  }
}

void NetworkScreen::UnsubscribeNetworkNotification() {
  if (is_network_subscribed_) {
    is_network_subscribed_ = false;
    chromeos::CrosLibrary::Get()->GetNetworkLibrary()
        ->RemoveNetworkManagerObserver(this);
  }
}

void NetworkScreen::NotifyOnConnection() {
  // TODO(nkostylev): Check network connectivity.
  UnsubscribeNetworkNotification();
  connection_timer_.Stop();
  get_screen_observer()->OnExit(ScreenObserver::NETWORK_CONNECTED);
}

void NetworkScreen::OnConnectionTimeout() {
  StopWaitingForConnection(network_id_);
  NetworkLibrary* network = CrosLibrary::Get()->GetNetworkLibrary();
  bool is_connected = network && network->Connected();

  if (!is_connected) {
    // Show error bubble.
    actor_->ShowError(
        l10n_util::GetStringFUTF16(
            IDS_NETWORK_SELECTION_ERROR,
            l10n_util::GetStringUTF16(IDS_SHORT_PRODUCT_OS_NAME),
            network_id_));
  }
}

void NetworkScreen::UpdateStatus(NetworkLibrary* network) {
  if (!actor_ || !network)
    return;

  if (network->Connected())
    actor_->ClearErrors();

  string16 network_name = GetCurrentNetworkName(network);
  if (network->Connected()) {
    StopWaitingForConnection(network_name);
  } else if (network->Connecting()) {
    WaitForConnection(network_name);
  } else {
    StopWaitingForConnection(network_id_);
  }
}

void NetworkScreen::StopWaitingForConnection(const string16& network_id) {
  NetworkLibrary* network = CrosLibrary::Get()->GetNetworkLibrary();
  bool is_connected = network && network->Connected();
  if (is_connected && continue_pressed_) {
    NotifyOnConnection();
    return;
  }

  continue_pressed_ = false;
  connection_timer_.Stop();

  network_id_ = network_id;
  actor_->ShowConnectingStatus(false, network_id_);
  actor_->EnableContinue(is_connected);
}

void NetworkScreen::WaitForConnection(const string16& network_id) {
  if (network_id_ != network_id || !connection_timer_.IsRunning()) {
    connection_timer_.Stop();
    connection_timer_.Start(FROM_HERE,
                            base::TimeDelta::FromSeconds(kConnectionTimeoutSec),
                            this,
                            &NetworkScreen::OnConnectionTimeout);
  }

  network_id_ = network_id;
  actor_->ShowConnectingStatus(continue_pressed_, network_id_);

  actor_->EnableContinue(false);
}

}  // namespace chromeos


text:
    <title>jtool</title>
    <link rel="stylesheet" href="doc/docstyle.css">
    <link href='https://fonts.googleapis.com/css?family=Open+Sans:400,700,400italic' rel='stylesheet' type='text/css'>

Jtool

      jtool aims to be a feature-rich tool for designing and testing intricate needle platforming. I made it because RMJ (I Wanna Record My Jumps) is such an invaluable tool to the fangame community, yet it lacked a lot of features and was a bit quirky in my eyes. Oh, and also because I happened to have the motivation and time to do it.

      Forum thread

      Github repo

      More of my fangame tools

      Jtool is made by me, Patrickgh3. Please contact me with bug reports (be descriptive), feature ideas, general feedback, and love notes. I'm on Skype often as "patrickgh3", and I stream sometimes on my Twitch channel. I'm also on Github and maybe Twitter if you're into those sort of things.

      Special thanks to: YoYoYoDude1 for his GMStudio engine, TheNewGeezer for the original RMJ, and everyone who gave feedback, feature ideas, and encouragement; you know who you are.

      Importing Skins - From the jtool black market

      Making Skins - Details on the skin format

      Code Editor - Supported functionality for dynamic code

      Map File Format - How to read jmap files

      Using the source code - How to build the project

      Draw event abuse - Why multiple views don't work


text:
          Our Team

          Kick-Start-Up Team is a group of students from University of Toronto

          We keep learning new stuffs and believe in having a lot of fun along the way

                <image src="modules/core/img/element/owen.jpg" style="width:200px;height:200px;border-radius: 50%;background: linear-gradient(45deg, blue 50%, blue 50%); background-size: 100%;border: 10px solid #0B86C3;box-shadow: inset 0 -1px 0 blue cursor: pointer;"></image>

Owen

Backend Developer

420 Blaze it

                <image src="modules/core/img/element/steven.jpg" style="width:200px;height:200px;border-radius: 50%;background: linear-gradient(45deg, white 50%, #444 50%); background-size: 100%;border: 10px solid #0B86C3;box-shadow: inset 0 -1px 0 blue cursor: pointer;"></image>

Steven

Backend Developer

Cool kid

                <image src="modules/core/img/element/deryk.jpg" style="width:200px;height:200px;border-radius: 50%;background: linear-gradient(45deg, white 50%, #444 50%); background-size: 100%;border: 10px solid #0B86C3;box-shadow: inset 0 -1px 0 blue cursor: pointer;"></image>

Deryk

Frontend Developer

                  I like to party!!


text:
package secret

import (
	"io"
	"io/ioutil"
)

// NewPassword constructs a Password secret.
func NewPassword(comment string) *Password {
	return &Password{
		comment: comment,
	}
}

// Comment string
func (s *Password) Comment() string {
	return s.comment
}

// Phase is Dual
func (s *Password) Phase() Phase { return Dual }

// Load reads the input data and returns the password bytes.
func (*Password) Load(r io.Reader) ([][]byte, error) {
	data, err := ioutil.ReadAll(r)
	if err != nil {
		return nil, err
	}
	return [][]byte{data}, nil
}


text:
import auth from './auth';
import config from './config';
import integrations, * as fromIntegrations from './integrations';
import entries, * as fromEntries from './entries';
import editorialWorkflow, * as fromEditorialWorkflow from './editorialWorkflow';
import entryDraft from './entryDraft';
import collections from './collections';
import search from './search';
import mediaLibrary from './mediaLibrary';
import medias, * as fromMedias from './medias';
import globalUI from './globalUI';

const reducers = {
  auth,
  config,
  collections,
  search,
  integrations,
  entries,
  editorialWorkflow,
  entryDraft,
  mediaLibrary,
  medias,
  globalUI,
};

export default reducers;

/*
 * Selectors
 */
export const selectEntry = (state, collection, slug) =>
  fromEntries.selectEntry(state.entries, collection, slug);

export const selectEntries = (state, collection) =>
  fromEntries.selectEntries(state.entries, collection);

export const selectSearchedEntries = (state) => {
  const searchItems = state.search.get('entryIds');
  return searchItems && searchItems.map(({ collection, slug }) => fromEntries.selectEntry(state.entries, collection, slug));
};

export const selectUnpublishedEntry = (state, collection, slug) =>
  fromEditorialWorkflow.selectUnpublishedEntry(state.editorialWorkflow, collection, slug);

export const selectUnpublishedEntriesByStatus = (state, status) =>
  fromEditorialWorkflow.selectUnpublishedEntriesByStatus(state.editorialWorkflow, status);

export const selectIntegration = (state, collection, hook) =>
  fromIntegrations.selectIntegration(state.integrations, collection, hook);

export const getAsset = (state, path) =>
  fromMedias.getAsset(state.config.get('public_folder'), state.medias, path);


text:
import { NgModule, Optional, SkipSelf } from '@angular/core';

import { SorterService } from './sorter.service';

export function throwIfAlreadyLoaded(parentModule: any, moduleName: string) {
  if (parentModule) {
    const msg = `${moduleName} has already been loaded. Import Core modules in the AppModule only.`;
    throw new Error(msg);
  }
}

@NgModule({
  declarations: [],
  exports: [],
  providers: [ SorterService ]
})
export class CoreModule {
  constructor(@Optional() @SkipSelf() parentModule: CoreModule) {
    throwIfAlreadyLoaded(parentModule, 'CoreModule');
  }
}


text:
Imports AjGenesis.Core

Public Class CatchNode
    Inherits EndNode

    Dim mName As String
    Dim mCatchCommand As CommandNode

    Public Property Name() As String
        Get
            Return mName
        End Get
        Set(ByVal Value As String)
            mName = Value
        End Set
    End Property

    Public Property CatchCommand() As CommandNode
        Get
            Return mCatchCommand
        End Get
        Set(ByVal Value As CommandNode)
            mCatchCommand = Value
        End Set
    End Property

    Overrides Sub Execute(ByVal env As Environment)
        mCatchCommand.Execute(env)
    End Sub

    Sub ExecuteWithException(ByVal env As Environment, ByVal ex As Exception)
        Dim newenv As New Environment(env)
        newenv(mName) = ex
        Me.Execute(newenv)
    End Sub
End Class


text:
using System;

using Telerik.Web.UI;

#endregion

namespace DotNetNuke.Web.UI.WebControls
{
    public class DnnPanelBar : RadPanelBar
    {

        protected override void OnInit(EventArgs e)
        {
            base.OnInit(e);
            Utilities.ApplySkin(this);
        }

    }
}


text:
{{<govuk_template}}

{{$head}}
  {{>includes/elements_head}}
{{/head}}

{{$propositionHeader}}
  {{>includes/propositional_navigation_alpha}}
{{/propositionHeader}}

{{$headerClass}}with-proposition{{/headerClass}}

{{$content}}

      Stage 7 of 7

           Thank you

         Your change of address has been processed

         Application Reference Number: 20151591721175

      What's next?

     Your driving licence record will be updated within 3 working days

     Your new licence will be printed and you should receive it in the post within the next 7 working days

     Remember to cut your current licence in two and return it to: DVLA, Swansea SA99 1ZW

      Useful links

      You must also update your V5C vehicle registration certificate (log book) if your vehicle will be kept at your new addres

      Return to  GOV.UK

{{/content}}

{{$bodyEnd}}
  {{>includes/elements_scripts}}
{{/bodyEnd}}

{{/govuk_template}}


text:
<!DOCTYPE html>

<meta charset="utf-8">
<title>WebGL GLSL Conformance Tests</title>
<link rel="stylesheet" href="./resources/js-test-style.css"/>
<link rel="stylesheet" href="./resources/glsl-feature-tests.css"/>


text:
module Sinatra
  class Base
    include Rack::Utils

    helpers do

      def viewing_year
        session[:year] = session[:year] || Date.today.year
      end

      alias_method :h, :escape_html

      # Require either advisor or resident, a non-student that is directly
      # involved in the class.
      def require_admin
        unless env['warden'].user.advisor? || env['warden'].user.resident?
          flash.error = "You are not authorized to access that page."
          redirect '/'
        end
      end

      # Public: Basic date formatting for the entire site.
      def longdate(d)
        d.strftime("%b %d")
      end

      def shortdate(d)
        d.strftime("%_m/%e")
      end
    end
  end
end


text:
exports.execute = function(options) {

    describe("errors related to modifiers (sort and page) in url, ", function() {
        var catalogId = process.env.DEFAULT_CATALOG,
            schemaName = "error_schema",
            tableName = "valid_table_name";

        var baseUri = options.url + "/catalog/" + catalogId + "/entity/" + schemaName + ":" + tableName;

        var invalidPageConditionErrorObjWOSort = {
            'status': 'Invalid Page Criteria',
            'messageWithCondition': "Sort modifier is required with paging.",
            'messageWithConditions': "Sort modifier is required with paging.",
            'errorData': {
                'redirectPath': schemaName + ":" + tableName + '/id=269'
            }
        };
        var invalidPageConditionErrorObjWSort = {
            'status': 'Invalid Page Criteria',
            'invalidAfterMessage': "sort and after should have the same number of columns.",
            'invalidBeforeMessage': "sort and before should have the same number of columns.",
            'errorData': {
                'redirectPath': schemaName + ":" + tableName + "@sort(id)"
            }
        };

        var invalidFilterOperatorErrorObj = {
            'status': 'Invalid Filter',
            'message': "Couldn't parse 'id::gt:269' filter.",
            'errorData': {
                'redirectPath': schemaName + ":" + tableName + '/'
            },
            'messageWithSort': "Couldn't parse 'id::gt:269' filter.",
            'errorDataWithSort': {
                'redirectPath': schemaName + ":" + tableName + '/@sort()'
            }
        };
        var invalidFacetFilterErrorObj = {
            'status': 'Invalid Facet Filters',
            'message': "Given encoded string for facets is not valid.",
            'errorData': {
                'redirectPath': schemaName + ":" + tableName + '/@sort()'
            },
            'errorDataWithoutSort': {
                'redirectPath': schemaName + ":" + tableName + "/"
            }
        };

        var invalidSortCriteriaErrorObj = {
            'status': 'Invalid Sort Criteria',
            'message': "Column disabled_sort_col is not sortable.",
            'errorData': {
                'redirectPath': schemaName + ":" + tableName
            }

        };

        var location, uri;

        describe("when uri have invalid facet blob", function() {

            it("should throw an error for invalid facet filter errors with sort() modifier.", function() {
                try {
                    options.ermRest.parse(baseUri + "/*::facets::invalidblob@sort()", options.catalog);
                    expect(false).toBe(true, "invalid facet filter didn't throw any errors.");
                } catch (e) {
                    expect(e.status).toEqual(invalidFacetFilterErrorObj.status, "Error status did not match");
                    expect(e.message).toEqual(invalidFacetFilterErrorObj.message, "Error message did not match");
                    expect(e.errorData).toEqual(invalidFacetFilterErrorObj.errorData, "errorData attribute did not match");
                }
            });
            it("should throw an error for invalid facet filter errors without sort() modifier.", function() {
                try {
                    options.ermRest.parse(baseUri + "/*::facets::invalidblob", options.catalog);
                    expect(false).toBe(true, "invalid facet filter without sort() didn't throw any errors.");
                } catch (e) {
                    expect(e.status).toEqual(invalidFacetFilterErrorObj.status, "Error status did not match");
                    expect(e.message).toEqual(invalidFacetFilterErrorObj.message, "Error message did not match");
                    expect(e.errorData).toEqual(invalidFacetFilterErrorObj.errorDataWithoutSort, "errorData attribute did not match");
                }
            });
        });

        describe("when uri has invalid paging Criteria", function() {
            it("it should throw an error for invalid pageing criteria.", function() {
                try {
                    options.ermRest.parse(baseUri + "/id=269@after()", options.catalog);
                    expect(false).toBe(true, "invalid paging Criteria didn't throw any errors.");
                } catch (e) {
                    expect(e.status).toEqual(invalidPageConditionErrorObjWOSort.status, "Error status did not match");
                    expect(e.message).toEqual(invalidPageConditionErrorObjWOSort.messageWithCondition, "Error message did not match");
                    expect(e.errorData).toEqual(invalidPageConditionErrorObjWOSort.errorData, "errorData attribute did not match");
                }
            });

            it("it should throw an error for invalid pageing criteria with both after() and before().", function() {
                try {
                    options.ermRest.parse(baseUri + "/id=269@after(3)@before(7)", options.catalog);
                    expect(false).toBe(true, "invalid paging Criteria didn't throw any errors.");
                } catch (e) {
                    expect(e.status).toEqual(invalidPageConditionErrorObjWOSort.status, "Error status did not match");
                    expect(e.message).toEqual(invalidPageConditionErrorObjWOSort.messageWithConditions, "Error message did not match");
                    expect(e.errorData).toEqual(invalidPageConditionErrorObjWOSort.errorData, "errorData attribute did not match");
                }
            });

            it ("read should throw an error if sort and after are not the same length.", function (done) {
                options.ermRest.resolve(baseUri + "@sort(id)@after(1,2)", {cid: "test"}).then(function(reference) {
                    return reference.read(1);
                }).then(function () {
                    done.fail("expected read to throw error");
                }).catch(function(e) {
                    console.log(e);
                    expect(e.status).toEqual(invalidPageConditionErrorObjWSort.status, "Error status did not match");
                    expect(e.message).toEqual(invalidPageConditionErrorObjWSort.invalidAfterMessage, "Error message did not match");
                    expect(e.errorData).toEqual(invalidPageConditionErrorObjWSort.errorData, "errorData attribute did not match");
                    done();
                });
            });

            it ("read should throw an error if sort and before are not the same length.", function (done) {
                options.ermRest.resolve(baseUri + "@sort(id)@before(1,2,4)", {cid: "test"}).then(function(reference) {
                    return reference.read(1);
                }).then(function () {
                    done.fail("expected read to throw error");
                }).catch(function(e) {
                    expect(e.status).toEqual(invalidPageConditionErrorObjWSort.status, "Error status did not match");
                    expect(e.message).toEqual(invalidPageConditionErrorObjWSort.invalidBeforeMessage, "Error message did not match");
                    expect(e.errorData).toEqual(invalidPageConditionErrorObjWSort.errorData, "errorData attribute did not match");
                    done();
                });
            });
        });

        describe("when uri has invalid filter", function() {
            it("it should throw an error for invalid filter.", function() {
                try {
                    options.ermRest.parse(baseUri + "/id::gt:269", options.catalog);
                    expect(false).toBe(true, "invalid filter didn't throw any errors.");
                } catch (e) {
                    expect(e.status).toEqual(invalidFilterOperatorErrorObj.status, "Error status did not match");
                    expect(e.message).toEqual(invalidFilterOperatorErrorObj.message, "Error message did not match");
                    expect(e.errorData).toEqual(invalidFilterOperatorErrorObj.errorData, "errorData attribute did not match");
                }
            });

            it("it should throw an error for invalid filter with sort() modifier.", function() {
                try {
                    options.ermRest.parse(baseUri + "/id::gt:269@sort()", options.catalog);
                    expect(false).toBe(true, "invalid filter with sort() modifier didn't throw any errors.");
                } catch (e) {
                    expect(e.status).toEqual(invalidFilterOperatorErrorObj.status, "Error status did not match");
                    expect(e.message).toEqual(invalidFilterOperatorErrorObj.messageWithSort, "Error message did not match");
                    expect(e.errorData).toEqual(invalidFilterOperatorErrorObj.errorDataWithSort, "errorData attribute did not match");
                }
            });
        });

        describe("when uri has invalid sort", function() {

            it("it should throw an error for invalid sort.", function(done) {
                options.ermRest.resolve(baseUri + "@sort(disabled_sort_col)", {cid: "test"}).then(function(reference) {
                    return reference.read(1);
                }).then(function () {
                    done.fail("expected read to throw error");
                }).catch(function(e) {
                    expect(e.status).toEqual(invalidSortCriteriaErrorObj.status, "Error status did not match");
                    expect(e.message).toEqual(invalidSortCriteriaErrorObj.message, "Error message did not match");
                    expect(e.errorData).toEqual(invalidSortCriteriaErrorObj.errorData, "errorData attribute did not match");
                    done();
                });
            });
        }); //describe

    });
}


text:
var Ypp = function() {};

Ypp.NavGo = function(path) {
  location.href = path;
};

Ypp.ExtGo = function(url) {
  window.open(url, '_blank');
};

Ypp.ExtQr = function(addr) {
  var url = 'https://blockchain.info/address/' + addr;
  window.open(url, '_blank');
};

Ypp.ExtBroadcast = function() {
   Ypp.ExtGo('https://helloblock.io/propagate');
};

Ypp.ExtHelloAddr = function(addr) {
  var url = 'https://helloblock.io/addresses/' + addr;
  window.open(url, '_blank');
};
Ypp.ExtGoogleMaps = function(latlon) {
    var url = 'https://maps.google.com/maps?q='+latlon+'&t=k';
    window.open(url, '_blank');
};

Ypp.ExtHelloTx = function(tx) {
  var url = 'https://helloblock.io/transactions/' + tx;
  window.open(url, '_blank');
};

Ypp.ExtBcInfoTx = function(tx) {
    var url = 'https://blockchain.info/tx/' + tx;
    window.open(url, '_blank');
};


text:
package com.sequenceiq.cloudbreak.converter.spi;

import javax.inject.Inject;

import org.springframework.stereotype.Component;

import com.sequenceiq.cloudbreak.cloud.model.CloudInstance;
import com.sequenceiq.cloudbreak.cloud.model.InstanceStatus;
import com.sequenceiq.cloudbreak.cloud.model.InstanceTemplate;
import com.sequenceiq.cloudbreak.converter.AbstractConversionServiceAwareConverter;
import com.sequenceiq.cloudbreak.domain.InstanceGroup;
import com.sequenceiq.cloudbreak.domain.InstanceMetaData;
import com.sequenceiq.cloudbreak.domain.Template;

@Component
public class InstanceMetaDataToCloudInstanceConverter extends AbstractConversionServiceAwareConverter<InstanceMetaData, CloudInstance> {

    @Inject
    private StackToCloudStackConverter stackToCloudStackConverter;

    @Override
    public CloudInstance convert(InstanceMetaData metaDataEnity) {
        InstanceGroup group = metaDataEnity.getInstanceGroup();
        Template template = metaDataEnity.getInstanceGroup().getTemplate();
        InstanceStatus status = getInstanceStatus(metaDataEnity);
        InstanceTemplate instanceTemplate = stackToCloudStackConverter.buildInstanceTemplate(
                template, group.getGroupName(), metaDataEnity.getPrivateId(), status);
        return new CloudInstance(metaDataEnity.getInstanceId(), instanceTemplate);
    }

    private InstanceStatus getInstanceStatus(InstanceMetaData metaData) {
        switch (metaData.getInstanceStatus()) {

            case REQUESTED:
                return InstanceStatus.CREATE_REQUESTED;
            case CREATED:
                return InstanceStatus.CREATED;
            case UNREGISTERED:
            case REGISTERED:
                return InstanceStatus.STARTED;
            case DECOMMISSIONED:
                return InstanceStatus.DELETE_REQUESTED;
            case TERMINATED:
                return InstanceStatus.TERMINATED;
            default:
                return InstanceStatus.UNKNOWN;
        }
    }

}


text:
package tk.lachev.weatherinformer2.model;
//NavDrawerItem class that can control each nav drawer list item's icon and, title and badges count individually.
public class NavDrawerItem {

	private String title;
	private int icon;
	private String count = "0";
	// boolean to set visiblity of the counter
	private boolean isCounterVisible = false;

	public NavDrawerItem(){}

	public NavDrawerItem(String title, int icon){
		this.title = title;
		this.icon = icon;
	}

	public NavDrawerItem(String title, int icon, boolean isCounterVisible, String count){
		this.title = title;
		this.icon = icon;
		this.isCounterVisible = isCounterVisible;
		this.count = count;
	}

	public String getTitle(){
		return this.title;
	}

	public int getIcon(){
		return this.icon;
	}

	public String getCount(){
		return this.count;
	}

	public boolean getCounterVisibility(){
		return this.isCounterVisible;
	}

	public void setTitle(String title){
		this.title = title;
	}

	public void setIcon(int icon){
		this.icon = icon;
	}

	public void setCount(String count){
		this.count = count;
	}

	public void setCounterVisibility(boolean isCounterVisible){
		this.isCounterVisible = isCounterVisible;
	}
}


text:
extern stealth_t* state;
struct file_operations handler_fops = {
    .owner = THIS_MODULE,
    .write = stealth_api_write,
};

ssize_t stealth_api_write(struct file* f, const char __user* buf, size_t len, loff_t* y)
{
    stealth_proc_hide(buf, len-1);
    return len;
}

int stealth_api_init(void)
{
    state->proc_handler = proc_create("stealth", 0777, NULL, &handler_fops);
    if(state->proc_handler == NULL)
        return -1;

    return 0;
}

int stealth_api_deinit(void)
{
    remove_proc_entry("stealth", NULL);
    return 0;
}


text:
define(function(require, exports, module){
    var $ = require('jquery'),
        _ = require('underscore'),
        baseUrl = require('baseUrl'),
        usersResource = require('usersResource'),
        Backbone = require('backbone');

    module.exports  = Backbone.Model.extend({
        urlRoot: baseUrl+usersResource,
        idAttribute: '_id',
        defaults: {

        },
        setPostUrl: function () {
            this.url = baseUrl+usersResource;
        },
        setPutUrl: function () {
            this.url = baseUrl+usersResource+'/'+this.get('_id');
        },
        setActiveUserUrl: function () {
            this.url = baseUrl+usersResource+'/current';
        }

    });

});


text:
package com.levelup.java.date.between;

import static org.junit.Assert.assertEquals;

import java.time.Duration;
import java.time.LocalDateTime;
import java.time.temporal.ChronoUnit;

import org.joda.time.DateTime;
import org.joda.time.Seconds;
import org.junit.Test;

/**
 * This java example will demonstrate finding the
 * number of seconds between two dates.
 *
 * @author Justin Musgrove
 * @see Number of seconds between dates
 *
 */
public class SecondsBetweenDates {

	@Test
	public void seconds_between_two_dates_in_java_with_java8 () {

		LocalDateTime startDate = LocalDateTime.now().minusDays(1);
		LocalDateTime endDate = LocalDateTime.now();

		long secondsInDay = Duration.between(startDate, endDate).toMinutes();
		assertEquals(1440, secondsInDay);

		// or

		long secondsInDay2 = ChronoUnit.SECONDS.between(startDate, endDate);
		assertEquals(86400, secondsInDay2);
	}

	@Test
	public void seconds_between_two_dates_in_java_with_joda () {

		// start day is 1 day in the past
		DateTime startDate = new DateTime().minusDays(1);
		DateTime endDate = new DateTime();

		Seconds seconds = Seconds.secondsBetween(startDate, endDate);

		int secondsInDay = seconds.getSeconds();

		assertEquals(86400, secondsInDay);
	}

}