text:
using namespace BufferedStream;

class TextTrigGenerator
{
    public:

        TextTrigGenerator(bool useAddressesForMemory, u32 deathTableOffset);
        virtual ~TextTrigGenerator();

        // Places text trigs representative of the given TRIG section in trigString if successful
        bool generateTextTrigs(ScenarioPtr map, std::string & trigString);

        // Places text trigs representative of the given trigger in trigString if successful
        bool generateTextTrigs(ScenarioPtr map, size_t trigIndex, std::string & trigString);

        bool loadScenario(ScenarioPtr map); // Loads data about the given scenario for use outside text trigs

        void clearScenario(); // Clears loaded scenario data

        std::string getConditionName(Chk::Condition::Type conditionType) const;
        std::string getConditionArgument(Chk::Condition & condition, size_t textArgumentIndex) const;
        std::string getConditionArgument(Chk::Condition & condition, Chk::Condition::Argument argument) const;
        std::string getActionName(Chk::Action::Type actionType) const;
        std::string getActionArgument(Chk::Action & action, size_t textArgumentIndex) const;
        std::string getActionArgument(Chk::Action & action, Chk::Action::Argument argument) const;

        ChkdString getTrigLocation(size_t locationId) const;
        ChkdString getTrigString(size_t stringId) const;
        ChkdString getTrigWav(size_t stringId) const;
        ChkdString getTrigPlayer(size_t playerIndex) const;
        ChkdString getTrigUnit(Sc::Unit::Type unitType) const;
        ChkdString getTrigSwitch(size_t switchIndex) const;
        std::string getTrigScoreType(Chk::Trigger::ScoreType scoreType) const;
        std::string getTrigResourceType(Chk::Trigger::ResourceType resourceType) const;
        std::string getTrigOrder(Chk::Action::Order order) const;
        std::string getTrigStateModifier(Chk::Trigger::ValueModifier stateModifier) const;
        std::string getTrigSwitchState(Chk::Trigger::ValueModifier switchState) const;
        std::string getTrigSwitchModifier(Chk::Trigger::ValueModifier switchModifier) const;
        std::string getTrigAllyState(Chk::Action::AllianceStatus allyState) const;
        std::string getTrigNumericComparison(Chk::Condition::Comparison numericComparison) const;
        std::string getTrigNumericModifier(Chk::Trigger::ValueModifier numericModifier) const;
        std::string getTrigScript(Sc::Ai::ScriptId scriptId) const;
        std::string getTrigNumUnits(Chk::Action::NumUnits numUnits) const;
        std::string getTrigNumber(u32 number) const;
        std::string getTrigTextFlags(Chk::Action::Flags textFlags) const;

    protected:

        bool loadScenario(ScenarioPtr map, bool quoteArgs, bool useCustomNames);
        bool correctLineEndings(StringBuffer & buf) const; // Corrects any improperly formatted line endings

        bool buildTextTrigs(ScenarioPtr scenario, std::string & trigString);
        bool buildTextTrig(Chk::Trigger & trigger, std::string & trigString);
        inline void appendTriggers(StringBuffer & output, ScenarioPtr scenario) const;
        inline void appendTrigger(StringBuffer & output, Chk::Trigger & trigger) const;
        inline void appendConditionArgument(StringBuffer & output, Chk::Condition & condition, Chk::Condition::Argument argument) const;
        inline void appendActionArgument(StringBuffer & output, Chk::Action & action, Chk::Action::Argument argument) const;

        inline void appendLocation(StringBuffer & output, const size_t & locationId) const;
        inline void appendString(StringBuffer & output, const size_t & stringId) const;
        inline void appendSound(StringBuffer & output, const size_t & stringId) const;
        inline void appendPlayer(StringBuffer & output, const size_t & playerIndex) const;
        inline void appendAmount(StringBuffer & output, const u32 & amount) const;
        inline void appendUnit(StringBuffer & output, const Sc::Unit::Type & unitType) const;
        inline void appendSwitch(StringBuffer & output, const size_t & switchIndex) const;
        inline void appendScoreType(StringBuffer & output, const Chk::Trigger::ScoreType & scoreType) const;
        inline void appendResourceType(StringBuffer & output, const Chk::Trigger::ResourceType & resourceType) const;
        inline void appendOrder(StringBuffer & output, const Chk::Action::Order & order) const;
        inline void appendStateModifier(StringBuffer & output, const Chk::Trigger::ValueModifier & stateModifier) const;
        inline void appendSwitchState(StringBuffer & output, const Chk::Trigger::ValueModifier & switchState) const;
        inline void appendSwitchModifier(StringBuffer & output, const Chk::Trigger::ValueModifier & switchModifier) const;
        inline void appendAllyState(StringBuffer & output, const Chk::Action::AllianceStatus & allyState) const;
        inline void appendNumericComparison(StringBuffer & output, const Chk::Condition::Comparison & numericComparison) const;
        inline void appendNumericModifier(StringBuffer & output, const Chk::Trigger::ValueModifier & numericModifier) const;
        inline void appendScript(StringBuffer & output, const Sc::Ai::ScriptId & scriptId) const;
        inline void appendNumUnits(StringBuffer & output, const Chk::Action::NumUnits & numUnits) const;
        template<typename T> inline void appendNumber(StringBuffer & output, const T & number) const
        {
            if constexpr ( std::is_enum<T>::value )
                output.appendNumber((typename promote_char<typename std::underlying_type<T>::type>::type)number);
            else
                output.appendNumber((typename promote_char<T>::type)number);
        }
        inline void appendConditionMaskFlag(StringBuffer & output, const Chk::Condition::MaskFlag & maskFlag) const;
        inline void appendActionMaskFlag(StringBuffer & output, const Chk::Action::MaskFlag & maskFlag) const;
        inline void appendMemory(StringBuffer & output, const u32 & memory) const;
        inline void appendTextFlags(StringBuffer & output, const Chk::Action::Flags & textFlags) const;

    private:

        bool useAddressesForMemory; // If true, uses 1.16.1 addresses for memory conditions and actions
        u32 deathTableOffset;
        std::vector<ChkdString> stringTable; // Array list of map strings
        std::vector<ChkdString> extendedStringTable; // Array list of extended map strings
        std::vector<ChkdString> locationTable; // Array of map locations
        std::vector<ChkdString> unitTable; // Array of map units
        std::vector<ChkdString> switchTable; // Array of map switches
        std::vector<ChkdString> groupTable; // Array of map groups
        std::map<Sc::Ai::ScriptId, std::string> scriptTable; // Array of map scripts
        std::map<Sc::Ai::ScriptId, std::string> scriptDescTable; // Array of script descriptions
        std::vector<std::string> conditionTable; // Array of condition names
        std::vector<std::string> actionTable; // Array of action names
        bool goodConditionTable;
        bool goodActionTable;

        bool prepConditionTable(); // Fills conditionTable
        bool prepActionTable(); // Fills actionTable
        bool prepLocationTable(ScenarioPtr map, bool quoteArgs); // Fills locationTable
        bool prepUnitTable(ScenarioPtr map, bool quoteArgs, bool useCustomNames); // Fills unitTable
        bool prepSwitchTable(ScenarioPtr map, bool quoteArgs); // Fills switchTable
        bool prepGroupTable(ScenarioPtr map, bool quoteArgs); // Fills groupTable
        bool prepScriptTable(ScenarioPtr map, bool quoteArgs); // Fills scriptTable
        bool prepStringTable(ScenarioPtr map, bool quoteArgs); // Fills stringTable
};

#endif


text:
package app.model;

import org.springframework.data.mongodb.core.mapping.Document;

@Document
public class CardInfo {

	private String pan;
	private int securityCode;
	private String holderName;
	private String expirationDate;

	public CardInfo(){
		super();
	}

	public CardInfo(String pan, int securityCode, String holderName, String expirationDate) {
		super();
		this.pan = pan;
		this.securityCode = securityCode;
		this.holderName = holderName;
		this.expirationDate = expirationDate;
	}

	public String getPan() {
		return pan;
	}

	public void setPan(String pan) {
		this.pan = pan;
	}

	public int getSecurityCode() {
		return securityCode;
	}

	public void setSecurityCode(int securityCode) {
		this.securityCode = securityCode;
	}

	public String getHolderName() {
		return holderName;
	}

	public void setHolderName(String holderName) {
		this.holderName = holderName;
	}

	public String getExpirationDate() {
		return expirationDate;
	}

	public void setExpirationDate(String expirationDate) {
		this.expirationDate = expirationDate;
	}
}

redpajama_set_name: RedPajamaGithub


text:
// Copyright (c) Microsoft Open Technologies, Inc.  All Rights Reserved.  Licensed under the Apache License, Version 2.0.  See License.txt in the project root for license information.

namespace Microsoft.Runtime.Hosting.Interop
{
    using System;
    using System.Diagnostics.CodeAnalysis;

    [Flags]
    [System.Security.SecurityCritical]
    internal enum StartupFlags
    {
        None = 0,
        AlwaysFlowImpersonation = 0x40000,
        AppdomainResourceMonitoring = 0x400000, // Appdomain Resource Monitoring feature
        ConcurrentGC = 1,
        DisableCommitThreadStack = 0x20000,
        // Abbreviation fine here; it's not hungarian notation!
        [SuppressMessage("Microsoft.Naming", "CA1704:IdentifiersShouldBeSpelledCorrectly")]
        Etw = 0x100000,
        // Wants "GC" and "VM" rather than "Gc" and "Vm" but then complains that "GCVM" should be "Gcvm".
        [SuppressMessage("Microsoft.Naming", "CA1709:IdentifiersShouldBeCasedCorrectly")]
        HoardGCVM = 0x2000,
        LegacyImpersonation = 0x10000,
        LoaderOptimizationMask = 6,
        LoaderOptimizationMultipleDomain = 4,
        LoaderOptimizationMultipleDomainHost = 6,
        LoaderOptimizationSingleDomain = 2,
        LoaderSafeMode = 0x10,
        LoaderSetPreference = 0x100,
        ServerBuild = 0x200000,
        ServerGC = 0x1000,
        SingleVersionHostingInterface = 0x4000,
        TrimGCCommit = 0x80000
    }
}


text:
<?php
/**
 * Automatically generated
 *
 * @author: Viskov Sergey
 * @date: 07.05.15
 */

namespace LTDBeget\apacheConfigurator\directives\available;

use LTDBeget\apacheConfigurator\ConfigurationFile;
use LTDBeget\apacheConfigurator\directives\Directive;

class MultiviewsMatch extends Directive
{
    /**
     * Return link to full description of apache directive
     * @return String
     */
    public static function getApacheDocLink()
    {
        return Directive::$apacheSite."/docs/2.4/mod/mod_mime.html#multiviewsmatch";
    }

    /**
     * the source module which defines the directive
     * @return String
     */
    public static function getModule()
    {
        return "mod_mime";
    }

    /**
     * Return text description of apache directive
     * @return String
     */
    public static function getDescription()
    {
        return "The types of files that will be included when searching for a matching file with MultiViews";
    }

    /**
     * Return Apache directive Syntax
     * @return String
     */
    public static function getSyntax()
    {
        return 'MultiviewsMatch Any|NegotiatedOnly|Filters|Handlers [Handlers|Filters]';
    }

    /**
     * is this directive can include inner directives
     * @return boolean
     */
    public function isSection()
    {
        return false;
    }

    /**
     * Set allowed context of concrete directive
     */
    protected function setAllowedContext()
    {
        $this->allowedContext = [
            ConfigurationFile::SERVER_CONFIG,
            VirtualHost::getFullName(),
            Directory::getFullName(),
            ConfigurationFile::HTACCESS,
        ];
    }

}


text:
echo "error: something bad happened" >&2
echo /path/to/sdk
false


text:
import React from 'react'
import { connect } from 'react-redux'
import { Row, Column } from './Flex'

let containerStyle = {
  height: `80px`,
  border: `2px solid #f4679f`,
  borderRadius: `7px`,
  transform: `scale(0.8)`,
}

let FilterTypeButtons = props => {
  return (
    <Column style={containerStyle}>
      <Row>
        <span
          className={`waveshape ${props.active === `lowpass` ? `active` : ``}`}
          style={{ backgroundColor: props.active === `lowpass` ? `#ffe3ee` : `transparent` }}
          onClick={() => props.dispatch({ type: `CHANGE_FILTER`, filter: `lowpass`, id: props.id })}
        >
          <img style={{ width: `50px`, padding: `5px` }} src="/static/img/lopass.svg" />

        <span
          className={`waveshape ${props.active === `highpass` ? `active` : ``}`}
          style={{ backgroundColor: props.active === `highpass` ? `#ffe3ee` : `transparent` }}
          onClick={() => props.dispatch({ type: `CHANGE_FILTER`, filter: `highpass`, id: props.id })}
        >
          <img style={{ width: `50px`, padding: `5px`, transform: `rotateY(180deg)` }} src="/static/img/lopass.svg" />

      </Row>
      <Row>
        <span
          className={`waveshape ${props.active === `bandpass` ? `active` : ``}`}
          style={{ backgroundColor: props.active === `bandpass` ? `#ffe3ee` : `transparent` }}
          onClick={() => props.dispatch({ type: `CHANGE_FILTER`, filter: `bandpass`, id: props.id })}
        >
          <img style={{ width: `50px`, padding: `5px` }} src="/static/img/bandpass.svg" />

        <span
          className={`waveshape ${props.active === `notch` ? `active` : ``}`}
          style={{ backgroundColor: props.active === `notch` ? `#ffe3ee` : `transparent` }}
          onClick={() => props.dispatch({ type: `CHANGE_FILTER`, filter: `notch`, id: props.id })}
        >
          <img style={{ width: `50px`, padding: `5px` }} src="/static/img/notch.svg" />

      </Row>
    </Column>
  )
}

export default connect()(FilterTypeButtons)


text:
		<title>API CIUM </title>
		<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
		<meta name="charset" content="UTF-8">
		<meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1">
		<meta name="apple-mobile-web-app-capable" content="yes">

			<link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.1/css/bootstrap.min.css">
			<link rel="stylesheet" href="./css/styles.css" />
			<link href="//maxcdn.bootstrapcdn.com/font-awesome/4.2.0/css/font-awesome.min.css" rel="stylesheet">

		<link rel="shortcut icon" href="./images/favicon-cium.ico" />

		API CIUM

		  Sobre esta edición

← Anterior

Siguiente →

           Dashboard

						 Sobre esta edición

					.  Lista de figuras

					1.  Introducción

					2.  Catálogos

					3.  Sistema

				   Accesos

 AccesosA

 Hola A

					.  Lista de figuras

					1.  Introducción

					2.  Catálogos

					3.  Sistema

 Sobre esta edición

API CIUM

Publication date: 08/10/2015

This book was published with easybook v4.9.0,
a free and open-source book publishing application developed by Javier Eguiluz
using several Symfony components.

                Secretaría de Salud, Gobierno del Estado de Chiapas | CIUM


text:
// PathVisio,
// a tool for data visualization and analysis using Biological Pathways
// Copyright 2006-2011 BiGCaT Bioinformatics
//
// 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.
//
package org.pathvisio.core.view;

import java.awt.Color;
import java.awt.Font;
import java.awt.Graphics2D;
import java.awt.Shape;
import java.awt.geom.Point2D;
import java.awt.geom.Rectangle2D;
import java.util.List;

import org.pathvisio.core.biopax.BiopaxReferenceManager;
import org.pathvisio.core.biopax.PublicationXref;
import org.pathvisio.core.model.ObjectType;
import org.pathvisio.core.model.PathwayElement;
import org.pathvisio.core.preferences.GlobalPreference;
import org.pathvisio.core.preferences.PreferenceManager;

/**
 * Draws a citation number on top of a pathway object.
 * @author thomas
 */
public class Citation extends VPathwayElement implements VElementMouseListener {
	static final int MFONT_SIZE = 8;
	static final String FONT_NAME = "Arial";
	static final Color FONT_COLOR = new Color(0, 0, 128);
	static final int M_PADDING = 3;
	private Graphics parent;
	private Point2D rPosition;

	/**
	 * @param canvas The parent VPathway
	 * @param parent The Graphics for which the references need to be displayed
	 * @param rPosition The position to place the references, relative to the parent Graphics
	 */
	public Citation(VPathway canvas, Graphics parent, Point2D rPosition) {
		super(canvas);
		this.parent = parent;
		this.rPosition = rPosition;
//		getRefMgr().addBiopaxListener(this);
		markDirty();
		canvas.addVElementMouseListener(this);
	}

	public Graphics getParent() {
		return parent;
	}

	public void vElementMouseEvent(VElementMouseEvent e) {
		if(e.getElement() == parent) {
			if(e.getType() == VElementMouseEvent.TYPE_MOUSEENTER) {
				highlight();
			} else if(e.getType() == VElementMouseEvent.TYPE_MOUSEEXIT) {
				unhighlight();
			}
		}
	}
	public void setRPosition(Point2D rPosition) {
		this.rPosition = rPosition;
		markDirty();
	}

	public BiopaxReferenceManager getRefMgr() {
		return parent.getPathwayElement().getBiopaxReferenceManager();
	}

	protected Rectangle2D getTextBounds(Graphics2D g) {
		Rectangle2D tb = null;
		Point2D vp = getVPosition();
		double vx = Double.isNaN(vp.getX()) ? 0 : vp.getX();
		double vy = Double.isNaN(vp.getY()) ? 0 : vp.getY();
		vp.setLocation(vx, vy);

		double pd = vFromM(M_PADDING);
		String xrefStr = getXRefText();

		if(xrefStr == null || "".equals(xrefStr)) {
			tb = new Rectangle2D.Double(vp.getX(), vp.getY(), 0, 0);
		} else if(g != null) {
			tb = g.getFontMetrics(getVFont()).getStringBounds(getXRefText(), g);
			tb.setRect(
					vp.getX() + tb.getX() - tb.getWidth() / 2 - pd,
					vp.getY() + tb.getY() - tb.getHeight() / 2 - pd,
					tb.getWidth() + 2*pd,
					tb.getHeight() + 2*pd
			);
		} else { //No graphics context, we can only guess...
			int w = xrefStr.length() * 5;
			tb = new Rectangle2D.Double(vp.getX() - w/2 - pd, vp.getY() - pd, w + 2*pd, 15 + 2*pd);
		}
		return tb;
	}

	protected Shape calculateVOutline() {
		return getTextBounds(g2d);
	}

	protected int getVFontSize() {
		return (int)vFromM(MFONT_SIZE);
	}

	protected Font getVFont() {
		return new Font(FONT_NAME, Font.PLAIN, getVFontSize());
	}

	protected String getXRefText() {
		if(getParent().getPathwayElement().getParent() == null) {
			return ""; //In case a redraw is called after deletion of the model element
		}
		int maxNr = PreferenceManager.getCurrent().getInt(GlobalPreference.MAX_NR_CITATIONS);
		if(maxNr == 0) return ""; //Show nothing if limit is set to 0

		String xrefStr = "";
		int lastOrdinal = -2;
		int sequence = 0;
		int nrShowed = 0; //Counter to check maximum citation numbers

		List<PublicationXref> xrefs = getRefMgr().getPublicationXRefs();
		for(int i = 0; i < xrefs.size(); i++) {
			if(nrShowed > 0 && nrShowed >= maxNr) {
				xrefStr = xrefStr.substring(0, xrefStr.length() - 2) + "...  ";
				break; //Stop after maximum number of citations showed
			}
			int n = getRefMgr().getBiopaxElementManager().getOrdinal(xrefs.get(i));
			if(n != lastOrdinal + 1) { //End sequence
				if(sequence > 2) {
					xrefStr = xrefStr.substring(0, xrefStr.length() - 2);
					xrefStr += "-" + lastOrdinal + ", ";
					nrShowed += 2;
				} else if(sequence == 2){
					xrefStr += lastOrdinal + ", ";
					nrShowed++;
				}
				xrefStr += n + ", ";
				nrShowed++;
				sequence = 0;
			}
			lastOrdinal = n;
			sequence++;
		}
		if(xrefStr.length() > 2) {
			xrefStr = xrefStr.substring(0, xrefStr.length() - 2);
		}
		if(sequence > 2) {
			xrefStr += "-" + lastOrdinal;
		} else if(sequence == 2) {
			xrefStr += ", " + lastOrdinal;
		}
		return xrefStr;
	}

	protected Point2D getVPosition() {
		PathwayElement mParent = parent.getPathwayElement();

		Point2D vp = null;
		//Check for mappinfo object, needs a special treatment,
		//since it has no bounds in the model
		if(mParent.getObjectType() == ObjectType.MAPPINFO) {
			Rectangle2D vb = parent.getVBounds();
			double x = rPosition.getX();
			double y = rPosition.getY();
			if(vb.getWidth() != 0) x *= vb.getWidth() / 2;
			if(vb.getHeight() != 0) y *= vb.getHeight() / 2;
			x += vb.getCenterX();
			y += vb.getCenterY();
			vp = new Point2D.Double(x, y);
		} else { //For other objects, use the model bounds
			Point2D mp = mParent.toAbsoluteCoordinate(rPosition);
			vp = new Point2D.Double(vFromM(mp.getX()), vFromM(mp.getY()));
		}
		return vp;
	}

	Graphics2D g2d;

	protected void doDraw(Graphics2D g2d) {
		Graphics2D g = (Graphics2D)g2d.create();

		if(this.g2d == null) resetShapeCache();
		this.g2d = g;

		String xrefStr = getXRefText();
		if("".equals(xrefStr)) return;

		g.setFont(getVFont());

		Rectangle2D bounds = getTextBounds(g);
		g.setClip(bounds);

		if(isHighlighted()) {
			Color hc = getHighlightColor();
			g.setColor(new Color(hc.getRed(), hc.getGreen(), hc.getBlue(), (int)(255 * 0.3)));
			g.fill(bounds);
		}

		g.setColor(FONT_COLOR);
		int pd = (int)vFromM(M_PADDING);
		g.drawString(xrefStr, (int)bounds.getX() + pd, (int)bounds.getMaxY() - pd);

	}

	protected int getZOrder() {
		return parent.getZOrder() + 1;
	}

//	public void biopaxEvent(BiopaxEvent e) {
//		refresh();
//		canvas.redrawDirtyRect();
//	}

	@Override protected void destroy()
	{
		super.destroy();
//		getRefMgr().removeBiopaxListener(this);
		canvas.removeVElementMouseListener(this);
	}
}


text:
package com.amaya.game;

import com.badlogic.gdx.graphics.OrthographicCamera;
import com.badlogic.gdx.graphics.g2d.SpriteBatch;
import com.badlogic.gdx.graphics.glutils.ShapeRenderer;

/** Class designed for giving ability to easy mock all low level LibGdx objects. */
public class LibGdxFactory {

  /** Singleton instance. */
  private static LibGdxFactory INSTANCE = new LibGdxFactory();

  /** Hidden constructor. */
  private LibGdxFactory() {
    // do nothing
  }

  /** private constructor, allows Mockito to replace instance by Mock object. */
  private LibGdxFactory(final LibGdxFactory mock) {
    INSTANCE = mock;
  }

  /** Get instance. */
  public static LibGdxFactory getInstance() {
    return INSTANCE;
  }

  /* [ UNIT TESTING/MOCKS ] ================================================================================================================================ */

  public SpriteBatch newSpriteBatch() {
    return new SpriteBatch();
  }

  public ShapeRenderer newShapeRenderer() {
    return new ShapeRenderer();
  }

  public OrthographicCamera newOrthographicCamera() {
    final OrthographicCamera mUiCamera = new OrthographicCamera(
            Spacefish.Dimensions.VIRTUAL_SCREEN_WIDTH,
            Spacefish.Dimensions.VIRTUAL_SCREEN_HEIGHT);

    mUiCamera.position.set(
            Spacefish.Dimensions.VIRTUAL_SCREEN_WIDTH / 2,
            Spacefish.Dimensions.VIRTUAL_SCREEN_HEIGHT / 2, 0);

    return mUiCamera;
  }
}


text:
/* UI Carousel @eatdeisnglove 2016 */

(function(global){
  'use strict';

  // 공통 변수
  var carousel;
  var carousel_contents_wrapper;
  var carousel_width;
  var carousel_content_total;

  // 1.캐로셀 초기화
  function init(selector) {
    // 스타일 식별자 속성 설정
    carousel = query(selector);

    // 기존 캐로셀 객체의 클래스값 메모리
    carousel.origin_class = carousel.getAttribute('class') || '';
    carousel.setAttribute('class', (carousel.origin_class+' ui-carousel').trim());

    // WAI-AIRA 설정
    carousel.setAttribute('role', 'application');
    carousel.setAttribute('aria-label', 'UI Carousel Component');

  // 2. 컨트롤러 버튼 템플릿코드
  var carousel_controller_code = [
    '
',
      '<button class="btn__prev">Swipe to Previous Content</button>',
      '<button class="btn__next">Next to Previous Content</button>',
    '
'
    ].join('');
  var carousel_indicator_code  = [
    '
',
      '
<button class="text-hidden active" data-idx="1">1</button>
',
      '
<button class="text-hidden" data-idx="2">2</button>
',
      '
<button class="text-hidden" data-idx="3">3</button>
',
      '
<button class="text-hidden" data-idx="4">4</button>
',
    '
'
  ].join('');

  carousel.insertAdjacentHTML('afterbegin', carousel_controller_code);
  carousel.insertAdjacentHTML('beforeend', carousel_indicator_code);

  // 3. 캐로셀 래핑 요소 설정
  carousel_contents_wrapper = query('.carousel-contents');
  carousel_contents_wrapper.setAttribute('role', 'group');

  // 4.버튼에 이벤트 바인딩
  bindEvent();

  // 5.인디케이터 초기설정
  activateIndicator(1);
  }

  // 이벤트 바인딩
  function bindEvent() {
    var buttons = queryAll('.carousel-controller button', carousel);
    var buttons_len = buttons.length;
    var indicators = queryAll('.carousel-indicator button', carousel);
    var indicators_len = indicators.length;
    var items = queryAll('.feature-experiences .feature-list li a');
    var items_len = items.length;

    while ( buttons[--buttons_len] ) {
      buttons[buttons_len].onclick = movingCarouselByButton;
    }
    while ( indicators[--indicators_len] ) {
      indicators[indicators_len].onclick = movingCarouselByIndicator;
    }
    while ( items[--items_len]) {
      // console.log(items)
      items[items_len].onclick = chageItem;
    }
  }

  // 버튼에 연결된 함수
  function movingCarouselByButton() {
    // 컨트롤러 버튼 구분
    var check_class = this.getAttribute('class');
    var carousel_contents_wrapper = query('.carousel-contents');
    var wrapper_width = parseInt(css(query('html'), 'width'));
    var carousel_contents = queryAll('.carousel-contents li');
    var len = queryAll('.carousel-contents li').length;
    var left = parseInt(css(carousel_contents_wrapper, 'left'));
    var right = parseInt(css(carousel_contents_wrapper, 'right')) + wrapper_width;
    var firstEl = carousel_contents[0];
    var lastEl = carousel_contents[len-1];
    var buttons = queryAll('.carousel-controller button', carousel);
    var buttons_len = buttons.length;
    // 래퍼 너비 설정
    // css(carousel_contents_wrapper, 'width', wrapper_width * len);

    //컨트롤러 버튼 제어
    while ( buttons[--buttons_len] ) {
      // console.log(buttons[buttons_len]);
      buttons[buttons_len].setAttribute('disabled', 'true');

      setTimeout(function(){
        buttons_len = buttons.length;
        while ( buttons[--buttons_len] ) {
          buttons[buttons_len].disabled = false;
        }
      }, 500)
    }

    // 래퍼 이동
    if ( /prev/.test(check_class)) {
      if ( left === 0) {
        css(lastEl, 'left', '-100%')
        // console.log(-1 * (wrapper_width * len));
        setTimeout(function(){
          left = wrapper_width * -(len-1);
          // console.log(left);
          css(carousel_contents_wrapper, 'transition', 'none');
          css(lastEl, 'left', '300%')
          css(carousel_contents_wrapper, 'left', left +'px');

         }, 500)
      }
      left += wrapper_width;
      activateIndicator(right/wrapper_width - 1);
      // console.log(left, right)
    } else {
      // console.log('wrapper left:', left, wrapper_width *  -3);
      if ( left === wrapper_width  * -(len-1) ) {
        css(firstEl, 'left', '400%');
        setTimeout(function(){
          left = 0;
          // console.log(left);
          css(carousel_contents_wrapper, 'transition', 'none');
          css(firstEl, 'left', '0px')
          css(carousel_contents_wrapper, 'left', left +'px');

         }, 500)
      }
      left += (-wrapper_width);
      // console.log(left, right)
      activateIndicator(right/wrapper_width + 1);

      // console.log('next', left);
    }
    // console.log(left/wrapper_width, right/wrapper_width);
    css(carousel_contents_wrapper, 'transition', 'all 0.5s');
    css(carousel_contents_wrapper, 'left', left +'px');
  }

  function movingCarouselByIndicator() {
    var idx = parseInt(this.getAttribute('data-idx'));
    var wrapper_width = parseInt(css(query('html'), 'width'));

    console.log(this, idx);
    var left = (idx-1) * wrapper_width * -1;
    css(carousel_contents_wrapper, 'left', left +'px');

    activateIndicator(idx);
  }

  function activateIndicator(idx) {
    var indicators = queryAll('.carousel-indicator button', carousel);
    var indicators_len = indicators.length;
    // console.log(idx, indicators_len)

    while (indicators[--indicators_len]) {
      var index = parseInt(indicators[indicators_len].getAttribute('data-idx'));
      // console.log(idx, index, indicators_len);
      if ( index == idx ){
        addClass(indicators[indicators_len], 'active');
        // console.log('active ', indicators[indicators_len])
      } else {
        removeClass(indicators[indicators_len], 'active')
      }
      if ( idx == 0 ) {
        addClass(indicators[3], 'active');
      }
      if ( idx == 5 ) {
        addClass(indicators[0], 'active');
      }
    }
  }

  function chageItem() {
    // 변수 정의
    var list_idx = this.getAttribute('data-list-num');
    var desc_idx, item_idx;
    var carousel_contents = queryAll('.carousel-contents li');
    var carousel_contents_len = carousel_contents.length;
    var carousel_contents_idx = (carousel_contents_len + 1);

    var carousel_contents_desc = queryAll('.carousel-content-desc-wrapper');
    var carousel_contents_desc_len = carousel_contents_desc.length;

    var carousel_item_list = queryAll('.feature-experiences .feature-list li');
    var carousel_item_list_len = carousel_item_list.length;

    // 캐로셀 아이템 active처리
    while (carousel_item_list[--carousel_item_list_len]) {
      item_idx = carousel_item_list_len + 1;
      item_idx = '0' + item_idx;
      // console.log(item_idx);
      if ( list_idx === item_idx ) {
        addClass(carousel_item_list[carousel_item_list_len], 'active');
      } else {
        removeClass(carousel_item_list[carousel_item_list_len], 'active');
      }
    }

    // 캐로셀 데이터 변경
    while (carousel_contents[--carousel_contents_len]) {
      carousel_contents_idx += -1;
      css(carousel_contents[carousel_contents_len], 'background-image', 'url("dist/assets/img/gear-vr_territory_list' + list_idx + '_slide0' + carousel_contents_idx + '.jpg")')
    }

    // 캐로셀 desc에 active처리
    while (carousel_contents_desc[--carousel_contents_desc_len]) {
      // 아이템 리스트와 아이템 설명리스트의 인댁스 비교
      desc_idx = carousel_contents_desc[carousel_contents_desc_len].getAttribute('data-list-desc-idx');
      // console.log(desc_idx, list_idx);

      if ( list_idx === desc_idx ) {
        addClass(carousel_contents_desc[carousel_contents_desc_len], 'active');
      } else {
        removeClass(carousel_contents_desc[carousel_contents_desc_len], 'active');
      }
    }

    return false;
  }

  // 초기화 실행
  init('.experience-carousel');

}(this));


text:
FROM python:3

EXPOSE 3003
ENV PYTHONPATH /usr/src/app/src:/usr/src/app/src/backend_service
ENV FLASK_APP=app.py

WORKDIR /usr/src/app

RUN mkdir -p /usr/src/app/src/backend_service

COPY ./src/backend_service/requirements.txt ./src/backend_service/
COPY ./src/backend_service/requirements_test.txt ./src/backend_service/
RUN pip install -r ./src/backend_service/requirements_test.txt

COPY . .

WORKDIR /usr/src/app/src/backend_service

CMD [ "python", "-m", "flask", "run", "--host", "0.0.0.0", "-p", "3003" ]


text:
Días máximo

Estos son el máximo número de días que se autoriza a un usuario a hacer
login antes de que tenga que cambiar su clave de acceso. Una vez transcurrido
este tiempo, se pide al usuario que digite una nueva clave de acceso.


text:
<?xml version = '1.0' encoding = 'UTF-8'?>
<Relation class="oracle.dbtools.crest.model.design.logical.Relation" name="Planeta_ent" directorySegmentName="seg_0" id="D826C2E5-6888-4CE7-21DB-0F648D48A517">
<createdBy>1GED07</createdBy>
<createdTime>2015-10-23 06:56:18 UTC</createdTime>
<generatorID>Generado por el Usuario</generatorID>
<ownerDesignName>Ejercicioo_Star_Trek_MER</ownerDesignName>
<engineerTo>
<item key="EBDF09FA-B1EC-35A9-088E-EFD4E4C438CB" value="true"/>
</engineerTo>
<sourcePk>C61242DF-4D05-D51E-D991-792E2DC21660</sourcePk>
<identifying>false</identifying>
<optionalSource>true</optionalSource>
<optionalTarget>false</optionalTarget>
<sourceCardinality>1</sourceCardinality>
<sourceEntity>2BB00344-F967-AE20-1C57-57DC03D592B8</sourceEntity>
<targetCardinalityString>*</targetCardinalityString>
<targetEntity>CF2A68A0-BD31-7540-51AC-2DDD3F45188C</targetEntity>
<transferable>true</transferable>
<deleteRule>NO ACTION</deleteRule>
</Relation>


text:
<!DOCTYPE html >

<title>Mozilla - Webgl Getting Started</title>
<meta http-equiv="content-type" content="text/html; charset=utf-8">

	Universidade Federal da Bahia

		MATA65 - Computação Gráfica

		Nilton Vasques

		Exercício 1 - Esfera de Pontos

    <canvas id="glcanvas" style="border: none;" width="800" height="800">
	Your browser doesn't appear to support the HTML5 <canvas> element.
    </canvas>


text:
package colossus.extensions.util.bson

import akka.util.{ByteString, ByteStringBuilder}

trait Writable {

  def encode(): ByteString

  def putCString(builder: ByteStringBuilder, value: String): ByteStringBuilder = {
    builder.putBytes(value.getBytes("utf-8")).putByte(0)
  }
}


text:
/* variome.c was originally generated by the autoSql program, which also
 * generated variome.h and variome.sql.  This module links the database and
 * the RAM representation of objects. */

/* Copyright (C) 2014 The Regents of the University of California
 * See README in this or parent directory for licensing information. */

#include "common.h"
#include "linefile.h"
#include "dystring.h"
#include "jksql.h"
#include "variome.h"
#include "hdb.h"
#include "binRange.h"

void variomeStaticLoad(char **row, struct variome *ret)
/* Load a row from variome table into ret.  The contents of ret will
 * be replaced at the next call to this function. */
{

ret->bin = sqlUnsigned(row[0]);
ret->chrom = row[1];
ret->chromStart = sqlUnsigned(row[2]);
ret->chromEnd = sqlUnsigned(row[3]);
ret->name = row[4];
ret->score = sqlUnsigned(row[5]);
safecpy(ret->strand, sizeof(ret->strand), row[6]);
ret->db = row[7];
ret->owner = row[8];
ret->color = row[9];
ret->class = row[10];
ret->creationDate = row[11];
ret->lastModifiedDate = row[12];
ret->descriptionKey = row[13];
ret->id = sqlUnsigned(row[14]);
ret->geneSymbol = row[15];
}

struct variome *variomeLoad(char **row)
/* Load a variome from row fetched with select * from variome
 * from database.  Dispose of this with variomeFree(). */
{
struct variome *ret;

AllocVar(ret);
ret->bin = sqlUnsigned(row[0]);
ret->chrom = cloneString(row[1]);
ret->chromStart = sqlUnsigned(row[2]);
ret->chromEnd = sqlUnsigned(row[3]);
ret->name = cloneString(row[4]);
ret->score = sqlUnsigned(row[5]);
safecpy(ret->strand, sizeof(ret->strand), row[6]);
ret->db = cloneString(row[7]);
ret->owner = cloneString(row[8]);
ret->color = cloneString(row[9]);
ret->class = cloneString(row[10]);
ret->creationDate = cloneString(row[11]);
ret->lastModifiedDate = cloneString(row[12]);
ret->descriptionKey = cloneString(row[13]);
ret->id = sqlUnsigned(row[14]);
ret->geneSymbol = cloneString(row[15]);
return ret;
}

struct variome *variomeLoadAll(char *fileName)
/* Load all variome from a whitespace-separated file.
 * Dispose of this with variomeFreeList(). */
{
struct variome *list = NULL, *el;
struct lineFile *lf = lineFileOpen(fileName, TRUE);
char *row[16];

while (lineFileRow(lf, row))
    {
    el = variomeLoad(row);
    slAddHead(&list, el);
    }
lineFileClose(&lf);
slReverse(&list);
return list;
}

struct variome *variomeLoadAllByChar(char *fileName, char chopper)
/* Load all variome from a chopper separated file.
 * Dispose of this with variomeFreeList(). */
{
struct variome *list = NULL, *el;
struct lineFile *lf = lineFileOpen(fileName, TRUE);
char *row[16];

while (lineFileNextCharRow(lf, chopper, row, ArraySize(row)))
    {
    el = variomeLoad(row);
    slAddHead(&list, el);
    }
lineFileClose(&lf);
slReverse(&list);
return list;
}

struct variome *variomeLoadByQuery(struct sqlConnection *conn, char *query)
/* Load all variome from table that satisfy the query given.
 * Where query is of the form 'select * from example where something=something'
 * or 'select example.* from example, anotherTable where example.something =
 * anotherTable.something'.
 * Dispose of this with variomeFreeList(). */
{
struct variome *list = NULL, *el;
struct sqlResult *sr;
char **row;

sr = sqlGetResult(conn, query);
while ((row = sqlNextRow(sr)) != NULL)
    {
    el = variomeLoad(row);
    slAddHead(&list, el);
    }
slReverse(&list);
sqlFreeResult(&sr);
return list;
}

void variomeSaveToDb(struct sqlConnection *conn, struct variome *el, char *tableName, int updateSize)
/* Save variome as a row to the table specified by tableName.
 * As blob fields may be arbitrary size updateSize specifies the approx size
 * of a string that would contain the entire query. Arrays of native types are
 * converted to comma separated strings and loaded as such, User defined types are
 * inserted as NULL. Strings are automatically escaped to allow insertion into the database. */
{
struct dyString *update = newDyString(updateSize);
sqlDyStringPrintf(update, "insert into %s values ( %u,'%s',%u,%u,'%s',%u,'%s','%s','%s','%s','%s','%s','%s','%s',%u,'%s')",
	tableName,  el->bin,  el->chrom,  el->chromStart,  el->chromEnd,  el->name,  el->score,  el->strand,  el->db,  el->owner,  el->color,  el->class,  el->creationDate,  el->lastModifiedDate,  el->descriptionKey,  el->id,  el->geneSymbol);
sqlUpdate(conn, update->string);
freeDyString(&update);
}

struct variome *variomeCommaIn(char **pS, struct variome *ret)
/* Create a variome out of a comma separated string.
 * This will fill in ret if non-null, otherwise will
 * return a new variome */
{
char *s = *pS;

if (ret == NULL)
    AllocVar(ret);
ret->bin = sqlUnsignedComma(&s);
ret->chrom = sqlStringComma(&s);
ret->chromStart = sqlUnsignedComma(&s);
ret->chromEnd = sqlUnsignedComma(&s);
ret->name = sqlStringComma(&s);
ret->score = sqlUnsignedComma(&s);
sqlFixedStringComma(&s, ret->strand, sizeof(ret->strand));
ret->db = sqlStringComma(&s);
ret->owner = sqlStringComma(&s);
ret->color = sqlStringComma(&s);
ret->class = sqlStringComma(&s);
ret->creationDate = sqlStringComma(&s);
ret->lastModifiedDate = sqlStringComma(&s);
ret->descriptionKey = sqlStringComma(&s);
ret->id = sqlUnsignedComma(&s);
ret->geneSymbol = sqlStringComma(&s);
*pS = s;
return ret;
}

void variomeFree(struct variome **pEl)
/* Free a single dynamically allocated variome such as created
 * with variomeLoad(). */
{
struct variome *el;

if ((el = *pEl) == NULL) return;
freeMem(el->chrom);
freeMem(el->name);
freeMem(el->db);
freeMem(el->owner);
freeMem(el->color);
freeMem(el->class);
freeMem(el->creationDate);
freeMem(el->lastModifiedDate);
freeMem(el->descriptionKey);
freeMem(el->geneSymbol);
freez(pEl);
}

void variomeFreeList(struct variome **pList)
/* Free a list of dynamically allocated variome's */
{
struct variome *el, *next;

for (el = *pList; el != NULL; el = next)
    {
    next = el->next;
    variomeFree(&el);
    }
*pList = NULL;
}

void variomeOutput(struct variome *el, FILE *f, char sep, char lastSep)
/* Print out variome.  Separate fields with sep. Follow last field with lastSep. */
{
fprintf(f, "%u", el->bin);
fputc(sep,f);
if (sep == ',') fputc('"',f);
fprintf(f, "%s", el->chrom);
if (sep == ',') fputc('"',f);
fputc(sep,f);
fprintf(f, "%u", el->chromStart);
fputc(sep,f);
fprintf(f, "%u", el->chromEnd);
fputc(sep,f);
if (sep == ',') fputc('"',f);
fprintf(f, "%s", el->name);
if (sep == ',') fputc('"',f);
fputc(sep,f);
fprintf(f, "%u", el->score);
fputc(sep,f);
if (sep == ',') fputc('"',f);
fprintf(f, "%s", el->strand);
if (sep == ',') fputc('"',f);
fputc(sep,f);
if (sep == ',') fputc('"',f);
fprintf(f, "%s", el->db);
if (sep == ',') fputc('"',f);
fputc(sep,f);
if (sep == ',') fputc('"',f);
fprintf(f, "%s", el->owner);
if (sep == ',') fputc('"',f);
fputc(sep,f);
if (sep == ',') fputc('"',f);
fprintf(f, "%s", el->color);
if (sep == ',') fputc('"',f);
fputc(sep,f);
if (sep == ',') fputc('"',f);
fprintf(f, "%s", el->class);
if (sep == ',') fputc('"',f);
fputc(sep,f);
if (sep == ',') fputc('"',f);
fprintf(f, "%s", el->creationDate);
if (sep == ',') fputc('"',f);
fputc(sep,f);
if (sep == ',') fputc('"',f);
fprintf(f, "%s", el->lastModifiedDate);
if (sep == ',') fputc('"',f);
fputc(sep,f);
if (sep == ',') fputc('"',f);
fprintf(f, "%s", el->descriptionKey);
if (sep == ',') fputc('"',f);
fputc(sep,f);
fprintf(f, "%u", el->id);
fputc(sep,f);
if (sep == ',') fputc('"',f);
fprintf(f, "%s", el->geneSymbol);
if (sep == ',') fputc('"',f);
fputc(lastSep,f);
}

/* -------------------------------- End autoSql Generated Code -------------------------------- */
#include "wikiTrack.h"
#include "wikiLink.h"
#include "web.h"
#include "cheapcgi.h"
#include "hPrint.h"
#include "hgConfig.h"
#include "hCommon.h"

char *variomeClassList[] = {
    "substitution",
    "insertion",
    "duplication",
    "deletion",
    "inversion",
    "complex",
    ITEM_NOT_CLASSIFIED,
};

char *variomeCoorList[] = {
    "exact coordinates",
    "estimated coordinates",
};

int variomeClassCnt = ArraySize(variomeClassList);

struct variome *findVariomeItemId(char *db, char *wikiItemId)
/* given a wikiItemId return the row from the table */
{
struct variome *item;
char query[256];
struct sqlConnection *conn = wikiConnect();

sqlSafef(query, ArraySize(query), "SELECT * FROM variome WHERE id='%s' limit 1",
        wikiItemId);

item = variomeLoadByQuery(conn, query);
if (NULL == item)
    errAbort("display wiki item: failed to load item '%s'", wikiItemId);

wikiDisconnect(&conn);
return item;
}

/* use functions from lib/wikiTrack.c, lib/wikiLink.c for accessing wiki pages */

int addVariomeItem(char *db, char *chrom, int start, int end,
    char *name, int score, char *strand, char *owner, char *class,
        char *color, char *category, char *geneSymbol, char *wikiKey)
/* create new Variome row with given parameters */
{
struct sqlConnection *conn = wikiConnect();
struct variome *newItem;
AllocVar(newItem);
newItem->bin = binFromRange(start, end);
newItem->chrom = cloneString(chrom);
newItem->chromStart = start;
newItem->chromEnd = end;
newItem->name = cloneString(name);
newItem->score = score;
if (sameString(strand, "plus"))
    safef(newItem->strand, sizeof(newItem->strand), "%s", "+");
else if (sameString(strand, "minus"))
    safef(newItem->strand, sizeof(newItem->strand), "%s", "-");
else
    safef(newItem->strand, sizeof(newItem->strand), "%s", " ");
newItem->db = cloneString(db);
newItem->owner = cloneString(owner);
newItem->class = cloneString(class);
newItem->color = cloneString(color);
newItem->creationDate = cloneString("0");
newItem->lastModifiedDate = cloneString("0");
newItem->descriptionKey = cloneString("0");
newItem->id = 0;
newItem->geneSymbol = cloneString(geneSymbol);

variomeSaveToDb(conn, newItem, "variome", 1024);

int id = sqlLastAutoId(conn);
char descriptionKey[256];
/* when wikiKey is NULL, assign the default key of category:db-id,
 *      else, it is the proper key
 */
if (wikiKey)
    safef(descriptionKey,ArraySize(descriptionKey), "%s", wikiKey);
else
    safef(descriptionKey,ArraySize(descriptionKey),
        "%s:%s-%d", category, db, id);

variomeFree(&newItem);

char query[1024];
sqlSafef(query, ArraySize(query), "UPDATE %s set creationDate=now(),lastModifiedDate=now(),descriptionKey='%s' WHERE id='%d'",
    "variome", descriptionKey, id);

sqlUpdate(conn,query);
wikiDisconnect(&conn);
return (id);
}

void updateVariomeLastModifiedDate(char *db, int id)
/* set lastModifiedDate to now() */
{
char query[512];
struct sqlConnection *conn = wikiConnect();

sqlSafef(query, ArraySize(query),
    "UPDATE %s set lastModifiedDate=now() WHERE id='%d'",
        "variome", id);
sqlUpdate(conn,query);
wikiDisconnect(&conn);
}

void deleteVariomeItem(char *db, int id)
/* delete the item with specified id */
{
char query[512];
struct sqlConnection *conn = wikiConnect();
sqlSafef(query, ArraySize(query), "DELETE FROM %s WHERE id='%d'",
        "variome", id);
sqlUpdate(conn,query);
wikiDisconnect(&conn);
}

/* prefixComments and addDescription used from wikiTrack.c */


text:
package org.jbpm.persistence.api.integration;

import java.io.Serializable;
import java.util.Collection;

/**
 * EventCollection is responsible for efficient mechanism to keep events provided to it.
 * It's usually a short lived object and thus should not use any persistent storage.
 *
 * It's up to concrete implementation how to react to different type of events:
 *

 *
add

 *
update

 *
remove

 *

 * For instance one implementation will simply collect all type of events (reducing by duplicates) while
 * another will filter out to keep track of only active items
 */
public interface EventCollection extends Serializable {

    /**
     * Invoked when new instance is created
     * @param event view of the instance in compact way
     */
    void add(InstanceView<?> event);

    /**
     * Invoked when instance is updated
     * @param event view of the instance in compact way
     */
    void update(InstanceView<?> item);

    /**
     * Invoked when instance is removed
     * @param event view of the instance in compact way
     */
    void remove(InstanceView<?> item);

    /**
     * Returns all collected events.
     * @return events
     */
    Collection<InstanceView<?>> getEvents();

}


text:
package com.chrisjanusa.findmefood;

import android.content.Intent;
import android.os.Bundle;
import android.support.annotation.NonNull;
import android.support.v4.widget.DrawerLayout;
import android.support.v7.app.ActionBarDrawerToggle;
import android.support.v7.app.AppCompatActivity;
import android.view.View;
import android.widget.AdapterView;
import android.widget.ArrayAdapter;
import android.widget.ListView;

import com.arlib.floatingsearchview.FloatingSearchView;
import com.chrisjanusa.findmefood.fragments.MainActivityFragment;
import com.chrisjanusa.findmefood.utils.Item;

import java.util.ArrayList;

public class MainActivity extends AppCompatActivity {

    private ListView mDrawerList;
    private DrawerLayout mDrawerLayout;
    private FloatingSearchView searchLocationBox;
    private ArrayList<Item> itemList =new ArrayList<>();

    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(com.chrisjanusa.findmefood.R.layout.activity_main);
        searchLocationBox = (FloatingSearchView) findViewById(R.id.searchBox);
        mDrawerList = (ListView)findViewById(com.chrisjanusa.findmefood.R.id.navList);
        addDrawerItems();
        mDrawerList.setOnItemClickListener(new DrawerItemClickListener());
        View header = getLayoutInflater().inflate(com.chrisjanusa.findmefood.R.layout.header, null);
        mDrawerList.addHeaderView(header);
        mDrawerLayout = (DrawerLayout) findViewById(com.chrisjanusa.findmefood.R.id.drawer_layout);
        searchLocationBox.attachNavigationDrawerToMenuButton(mDrawerLayout);

    }

    private void addDrawerItems(){

        //String[] thing = {"Favorites","Blocked","History"};
        //mAdapter = new ArrayAdapter<String>(this, R.layout.menu_text, thing);
        itemList.add(new Item("Favorites",R.drawable.star_filled));
        itemList.add(new Item("Blocked",R.drawable.block_red));
        itemList.add(new Item("History",R.drawable.ic_history_black_24dp));
        com.chrisjanusa.findmefood.MyAdapter mAdapter= new com.chrisjanusa.findmefood.MyAdapter(this,R.layout.menu_text_image, itemList);
        mDrawerList.setAdapter(mAdapter);

        mDrawerList.setOnItemClickListener(new AdapterView.OnItemClickListener(){
            @Override
            public void onItemClick(AdapterView<?> parent, View view, int position, long id){
                selectItem(position);
            }
        });

    }

    private  class DrawerItemClickListener implements ListView.OnItemClickListener {

        @Override
        public void onItemClick(AdapterView<?> arg0, View arg1, int arg2,
                                long arg3) {
            // TODO Auto-generated method stub
            selectItem(arg2);

        }

    }

    private void selectItem(int position) {
        Intent intent;
        switch(position) {
            case 1:
                intent = new Intent(this, SavedListActivity.class);
                startActivity(intent);
                break;
            case 2:
                intent = new Intent(this, DislikeListActivity.class);
                startActivity(intent);
                break;
            case 3:
                intent = new Intent(this, HistoryListActivity.class);
                startActivity(intent);
                break;
            default:
        }
    }

    // Function to be called from MainActivityFragment to return the menu button view for the savedList.
    public View getMenuItemView(int id) {
        return findViewById(id);
    }

    @Override
    public void onRequestPermissionsResult(int requestCode, @NonNull String[] permissions, @NonNull int[] grantResults) {
        super.onRequestPermissionsResult(requestCode, permissions, grantResults);

        // Call MainActivityFragment's onRequestPermissionsResult method.
        MainActivityFragment fragment = (MainActivityFragment) this.getSupportFragmentManager().findFragmentById(com.chrisjanusa.findmefood.R.id.mainFragment);
        fragment.onRequestPermissionsResult(requestCode, permissions, grantResults);
    }

    @Override
    protected void onActivityResult(int requestCode, int resultCode, Intent data) {
        super.onActivityResult(requestCode, resultCode, data);

        // Call MainActivityFragment's onActivityResult method.
        MainActivityFragment fragment = (MainActivityFragment) this.getSupportFragmentManager().findFragmentById(com.chrisjanusa.findmefood.R.id.mainFragment);
        fragment.onActivityResult(requestCode, resultCode, data);
    }
}


text:
"use strict";

/**
 * Module dependencies.
 */

var debug = require('debug')('hbase:connection');
var Long = require('long');
var Readable = require('readable-stream').Readable;
var EventEmitter = require('events').EventEmitter;
var util = require('util');
var utility = require('utility');
var net = require('net');
var Text = require('./text');
var Bytes = require('./util/bytes');
var ResponseFlag = require('./ipc/response_flag');
var DataInputBuffer = require('./data_input_buffer');
var DataOutputBuffer = require('./data_output_buffer');
var DataInputStream = require('./data_input_stream');
var DataOutputStream = require('./data_output_stream');
var HbaseObjectWritable = require('./io/hbase_object_writable');
var Invocation = require('./ipc/invocation');
var HConstants = require('./hconstants');
var errors = require('./errors');
var RemoteException = errors.RemoteException;

var HEADER = new Buffer("hrpc", "utf8");
var CURRENT_VERSION = 3;
var PING_CALL_ID = new Buffer(4);
PING_CALL_ID.writeInt32BE(-1, 0);

/**
 * The IPC connection header sent by the client to the server
 * on connection establishment.
 *
 * Create a new {@link ConnectionHeader} with the given protocol
 * and {@link User}.
 * @param protocol protocol used for communication between the IPC client
 *                 and the server
 * @param user {@link User} of the client communicating with
 *            the server
 */
function ConnectionHeader(protocol, user) {
  this.protocol = protocol;
  this.user = user;
}

ConnectionHeader.prototype.write = function (out) {
  Text.writeString(out, this.protocol || '');
},

ConnectionHeader.prototype.getProtocol = function () {
  return this.protocol;
};

ConnectionHeader.prototype.getUser = function () {
  return null;
};

ConnectionHeader.prototype.toString = function () {
  return this.protocol;
};

var _Connection_id = 0;

/** Thread that reads responses and notifies callers.  Each connection owns a
 * socket connected to a remote address.  Calls are multiplexed through this
 * socket: responses may be delivered out of order. */
function Connection(options) {
  EventEmitter.call(this);
  this.id = _Connection_id++;
  this.header = null; // connection header
  this.socket = null; // connected socket
  this.in;
  this.out;

  this.tcpNoDelay = false; // nodelay not or
  this.tcpKeepAlive = true;

  // currently active calls
  this.calls = {};

  this.address = {host: options.host, port: options.port};
  this.hostnamePort = options.host + ':' + options.port;
  this.name = 'Connection(' + this.hostnamePort + ')#' + this.id;
  var protocol = options.protocol || HConstants.PROTOCOL;
  this.rpcTimeout = options.rpcTimeout || HConstants.DEFAULT_HBASE_RPC_TIMEOUT;
  this.pingInterval = options.pingInterval || HConstants.DEFAULT_PING_INTERVAL;

  this.logger = options.logger || console;
  this.header = new ConnectionHeader(protocol, options.ticket);
  this._connected = false;
  this._socketError = null;
  this.setupIOstreams();
  this._callNums = 0;
}

util.inherits(Connection, EventEmitter);

Connection.prototype.setupConnection = function () {
  var ioFailures = 0;
  var timeoutFailures = 0;
  this.socket = net.connect(this.address);
  this.socketReadable = this.socket;
  if (typeof this.socketReadable.read !== 'function') {
    this.socketReadable = new Readable();
    this.socketReadable.wrap(this.socket);
    // ignore error event
    this.socketReadable.on('error', utility.noop);
  }
  this.socket.setNoDelay(this.tcpNoDelay);
  this.socket.setKeepAlive(this.tcpKeepAlive);
  // if (this.remoteId.rpcTimeout > 0) {
  //   this.pingInterval = this.remoteId.rpcTimeout;
  // }
  // this.socket.setTimeout(this.pingInterval);
  this.socket.on('timeout', this._handleTimeout.bind(this));
  this.socket.on('close', this._handleClose.bind(this));

  // when error, response all calls error
  this.socket.on('error', this._handleError.bind(this));

  // send ping
  this._pingTimer = setInterval(this.sendPing.bind(this), this.pingInterval);
};

Connection.prototype._cleanupCalls = function (err) {
  var count = 0;
  var calls = this.calls;
  // should reset calls before traverse it.
  this.calls = {};
  for (var id in calls) {
    var call = calls[id];
    call.setException(err);
    count++;
  }
  this.logger.warn('%s: cleanup %d calls, send "%s:%s" response.', this.name, count, err.name, err.message);
  // clean timer
  if (this._pingTimer) {
    clearInterval(this._pingTimer);
    this._pingTimer = null;
  }
};

Connection.prototype._handleTimeout = function () {
  this._close(new errors.ConnectionClosedException(this.name + ' socket close by "timeout" event.'));
};

Connection.prototype._handleClose = function () {
  debug('%s `close` event emit', this.name);
  this.closed = true;
  // tell user not use this connection first
  this.emit('close'); // let client close first.

  var err = this._closeError || this._socketError;
  if (!err) {
    err = new errors.ConnectionClosedException(this.name + ' closed with no error.');
    this.logger.warn(err.message);
  }
  this._cleanupCalls(err);
};

Connection.prototype._handleError = function (err) {
  debug('%s `error` event emit: %s', this.name, err);
  if (err.message.indexOf('ECONNREFUSED') >= 0) {
    err.name = 'ConnectionRefusedException';
  }
  if (err.message.indexOf('ECONNRESET') >= 0 || err.message.indexOf('This socket is closed') >= 0) {
    err.name = 'ConnectionClosedException';
  }
  this._socketError = err;
  if (!this._connected) {
    this.emit('connectError', err);
  }
  this._cleanupCalls(err);
};

/** Connect to the server and set up the I/O streams. It then sends
 * a header to the server and starts
 * the connection thread that waits for responses.
 * @throws java.io.IOException e
 */
Connection.prototype.setupIOstreams = function () {
  var self = this;
  debug('Connecting to %s', self.name);
  self.setupConnection();
  self.in = new DataInputStream(self.socketReadable);
  self.out = new DataOutputStream(self.socket);

  self.socket.on('connect', function () {
    this._connected = true;
    self.writeHeader();
    self._nextResponse();
    self.emit('connect');
    debug('Connected to %s', self.name);
  });
};

/* Write the header for each connection
 * Out is not synchronized because only the first thread does this.
 */
Connection.prototype.writeHeader = function () {
  this.out.write(HEADER);
  this.out.writeByte(CURRENT_VERSION);
  //When there are more fields we can have ConnectionHeader Writable.
  var buf = new DataOutputBuffer();
  this.header.write(buf);

  var bufLen = buf.getLength();
  this.out.writeInt(bufLen);
  this.out.write(buf.getData());
};

var _pingCount = 0;
Connection.prototype.sendPing = function () {
  debug('%s sendPing #%d', this.name, _pingCount++);
  this.out.write(PING_CALL_ID);
};

/* Initiates a call by sending the parameter to the remote server.
 * Note: this is not called from the Connection thread, but by other
 * threads.
 */
Connection.prototype.sendParam = function (call) {
  // For serializing the data to be written.

  //this.logger.info('%s sending #%s', this.name, call.id);

  var d = new DataOutputBuffer();
  d.writeInt(0); // placeholder for data length
  d.writeInt(call.id);
  call.param.write(d);
  var data = d.getData();
  var dataLength = d.getLength();

  // fill in the placeholder
  Bytes.putInt(data, 0, dataLength - 4);
  this.out.write(data, 0, dataLength);
};

Connection.prototype._close = function (err) {
  this.closed = true;
  this._closeError = err;
  // TODO: end or close?
  // this.socket.end();
  this.logger.warn('%s socket destroy().', this.name);
  this.socket.destroy();
};

Connection.prototype.close = Connection.prototype._close;

// ignore errors, no need to close the current connection
var IGNORE_EXCEPTIONS = {
  'org.apache.hadoop.hbase.regionserver.NoSuchColumnFamilyException': true,
  'org.apache.hadoop.hbase.regionserver.WrongRegionException': true,
  'org.apache.hadoop.hbase.NotServingRegionException': true,
};

Connection.prototype._nextResponse = function () {
  var self = this;
  // See HBaseServer.Call.setResponse for where we write out the response.
  // It writes the call.id (int), a flag byte, then optionally the length
  // of the response (int) followed by data.
  self.in.readFields([
    {name: 'id', method: 'readInt'},
    {name: 'flag', method: 'readByte'},
    {name: 'size', method: 'readInt'},
  ], function (err, data) {

    if (!data.hasOwnProperty('id') || !data.hasOwnProperty('flag') || !data.hasOwnProperty('size')) {
      self.logger.warn('[ERROR] [%s] data format wrong: %j, keys: %j', Date(), data, Object.keys(data));
      var msg = 'data packet wrong, data: ' + JSON.stringify(data);
      debug('%s: %s', self.name, msg);
      err = new RemoteException('RemoteException', msg);
      self._close(err);
      return;
    }

    // Read the call id.
    var id = data && data.id;
    var size = data.size - 9; // remove header size, Int, Byte, Int, 9 bytes
    var flag = data.flag;
    var isError = ResponseFlag.isError(flag);
    debug('receiveResponse: got %s:call#%s response, flag: %s, isError: %s, size: %s',
      self.name, id, flag, isError, size);

    var call = self.calls[id];

    if (!call) {
      // call timeout event will cause connection remove the call
      debug('[WARNNING] [%s] %s:call#%s not exists, data: %j', Date(), id, data);
    } else {
      delete self.calls[id];
    }

    if (err) {
      call && call.setException(err);
      self._close();
      return;
    }

    if (typeof flag !== 'number' || !ResponseFlag.isLength(flag)) {
      debug('%s:call#%s missing data length packet, flag: %s', self.name, id, flag);
      err = new RemoteException('RemoteException', 'missing data length packet, flag: ' + flag);
      call && call.setException(err);
      self._close();
      return;
    }

    self.in.readBytes(size, function (err, buf) {
      var io = new DataInputBuffer(buf);

      var state = io.readInt(); // Read the state.  Currently unused.
      if (isError) {
        err = new RemoteException(io.readString(), io.readString());
        call && call.setException(err);
        if (!IGNORE_EXCEPTIONS[err.name]) {
          self._close(err);
        }
      } else {
        var obj = HbaseObjectWritable.readFields(io);
        debug('call#%s got %s instance', id, obj.declaredClass);
        call && call.setValue(obj.instance);
      }

      // RangeError: Maximum call stack size exceeded
      // self._nextResponse();
      process.nextTick(self._nextResponse.bind(self));
    });
  });

};

// impl HRegionInterface
Connection.prototype.call = function (method, parameters, rpcTimeout, callback) {
  if (typeof rpcTimeout === 'function') {
    callback = rpcTimeout;
    rpcTimeout = null;
  }
  rpcTimeout = rpcTimeout || this.rpcTimeout;
  var param = new Invocation(method, parameters);
  var call = new Call(param, rpcTimeout);
  var self = this;
  var connectionCallId = self._callNums++;
  self.calls[call.id] = call;
  call.on('done', function (err, value) {
    if (err) {
      err.connection = self.name;
      if (err.message.indexOf(err.connection) < 0) {
        err.message += ' (' + err.connection + ', ' + connectionCallId + ':' + self._callNums + ')';
      }
    }
    callback(err, value);
  }); // TODO: handle MAX Number error response, should close the connection.

  if (self.closed) {
    return this._handleClose();
  }

  call.on('timeout', function () {
    // remove the call
    delete self.calls[call.id];
  });
  debug('%s: sent call#%s request data', self.name, call.id);
  this.sendParam(call);
};

/**
 * Return all the data for the row that matches row exactly,
 * or the one that immediately preceeds it.
 *
 * @param regionName region name
 * @param row row key
 * @param family Column family to look for row in.
 * @return map of values
 * @throws IOException e
 */
Connection.prototype.getClosestRowBefore = function (regionName, row, family, rpcTimeout, callback) {
  this.call('getClosestRowBefore', [regionName, row, family], rpcTimeout, callback);
};

/**
 * Return protocol version corresponding to protocol interface.
 *
 * @param protocol The classname of the protocol interface
 * @param clientVersion The version of the protocol that the client speaks
 * @return the version that the server will speak
 * @throws IOException if any IO error occurs
 */
Connection.prototype.getProtocolVersion = function (protocol, clientVersion, rpcTimeout, callback) {
  protocol = protocol || HConstants.PROTOCOL;
  clientVersion = clientVersion || HConstants.CLIENT_VERSION;
  if (!(clientVersion instanceof Long)) {
    clientVersion = Long.fromNumber(clientVersion);
  }
  this.call('getProtocolVersion', [protocol, clientVersion], rpcTimeout, callback);
};

/**
 * Perform Get operation.
 * @param regionName name of region to get from
 * @param get Get operation
 * @return Result
 * @throws IOException e
 */
Connection.prototype.get = function (regionName, get, callback) {
  this.call('get', [regionName, get], callback);
};

/**
 * Put data into the specified region if check passes
 * @param regionName region name
 * @param wrapped args
 * @throws IOException e
 */
Connection.prototype.checkAndPut = function (regionName, o, callback) {
  var a = [regionName, o.getRow(), o.getFamily(), o.getQualifier(), o.getValue(), o.getPut()];
  this.call('checkAndPut', a, callback);
};

/**
 * Put data into the specified region
 * @param regionName region name
 * @param put the data to be put
 * @throws IOException e
 */
Connection.prototype.put = function (regionName, put, callback) {
  this.call('put', [regionName, put], callback);
};

/**
 * Delete data from the specified region
 * @param regionName region name
 * @param put the data to be put
 * @throws IOException e
 */
Connection.prototype.delete = function (regionName, del, callback) {
  this.call('delete', [regionName, del], callback);
};

/**
 * Method used for doing multiple actions(Deletes, Gets and Puts) in one call
 * @param {MultiAction} multi
 * @return MultiResult
 * @throws IOException
 */
Connection.prototype.multi = function (multi, callback) {
  this.call('multi', [multi], callback);
};

/**
 * Opens a remote scanner with a RowFilter.
 *
 * @param regionName name of region to scan
 * @param scan configured scan object
 * @return scannerId scanner identifier used in other calls
 * @throws IOException e
 */
Connection.prototype.openScanner = function (regionName, scan, callback) {
  this.call('openScanner', [regionName, scan], callback);
};

/**
 * Get the next set of values
 *
 * @param scannerId clientId passed to openScanner
 * @return map of values; returns null if no results.
 * @throws IOException e
 */
// Connection.prototype.next = function (scannerId, callback) {
//   this.call('next', [scannerId], callback);
// };

/**
 * Get the next set of values
 *
 * @param scannerId clientId passed to openScanner
 * @param [numberOfRows] the number of rows to fetch
 * @return Array of Results (map of values); array is empty if done with this
 * region and null if we are NOT to go to the next region (happens when a
 * filter rules that the scan is done).
 * @throws IOException e
 */
Connection.prototype.nextResult = function (scannerId, numberOfRows, callback) {
  if (typeof numberOfRows === 'function') {
    callback = numberOfRows;
    numberOfRows = null;
  }
  var params = [scannerId];
  if (numberOfRows) {
    params.push(numberOfRows);
  }
  this.call('next', params, callback);
};

/**
 * Close a scanner
 *
 * @param scannerId the scanner id returned by openScanner
 * @throws IOException e
 */
Connection.prototype.closeScanner = function (scannerId, callback) {
  this.call('close', [scannerId], callback);
};

Connection.Call_Counter = 0;

/** A call waiting for a value. */
function Call(param, timeout) {
  EventEmitter.call(this);
  this.id = Connection.Call_Counter++; // call id
  this.param = param; // parameter
  this.value = null; // value, null if error
  this.error = null; // exception, null if value
  this.done = false; // true when call is done
  this.startTime = Date.now();

  this.timeout = timeout;
  if (timeout && timeout > 0) {
    this.timer = setTimeout(this._handleTimeout.bind(this), timeout);
  }
}

util.inherits(Call, EventEmitter);

Call.prototype._handleTimeout = function () {
  var err = new errors.RemoteCallTimeoutException(this.timeout + ' ms timeout (call#' + this.id + ')');
  this.setException(err);
  this.emit('timeout');
};

/** Indicate when the call is complete and the
 * value or error are available.  Notifies by default.  */
Call.prototype.callComplete = function () {
  if (this.timer) {
    clearTimeout(this.timer);
    this.timer = null;
  }
  if (this.done) {
    // if done before, do not emit done again
    return;
  }
  this.done = true;
  if (debug.enabled) {
    debug('call#%d use %d ms', this.id, Date.now() - this.startTime);
  }
  this.emit('done', this.error, this.value);
};

/** Set the exception when there is an error.
 * Notify the caller the call is done.
 *
 * @param error exception thrown by the call; either local or remote
 */
Call.prototype.setException = function (err) {
  debug('call#%s error: %s', this.id, err.message);
  this.error = err;
  this.callComplete();
};

/** Set the return value when there is no error.
 * Notify the caller the call is done.
 *
 * @param value return value of the call.
 */
Call.prototype.setValue = function (value) {
  this.value = value;
  this.callComplete();
};

Call.prototype.getStartTime = function () {
  return this.startTime;
};

module.exports = Connection;


text:
package org.springframework.boot.diagnostics.analyzer;

import org.junit.Test;
import org.junit.runner.RunWith;

import org.springframework.boot.context.properties.ConfigurationProperties;
import org.springframework.boot.context.properties.EnableConfigurationProperties;
import org.springframework.boot.diagnostics.FailureAnalysis;
import org.springframework.boot.testsupport.runner.classpath.ClassPathExclusions;
import org.springframework.boot.testsupport.runner.classpath.ModifiedClassPathRunner;
import org.springframework.context.annotation.AnnotationConfigApplicationContext;

import static org.assertj.core.api.Assertions.assertThat;
import static org.junit.Assert.fail;

/**
 * Tests for {@link ValidationExceptionFailureAnalyzer}
 *
 * @author Andy Wilkinson
 */
@RunWith(ModifiedClassPathRunner.class)
@ClassPathExclusions("hibernate-validator-*.jar")
public class ValidationExceptionFailureAnalyzerTests {

	@Test
	public void test() throws Exception {
		try {
			new AnnotationConfigApplicationContext(TestConfiguration.class).close();
			fail("Expected failure did not occur");
		}
		catch (Exception ex) {
			FailureAnalysis analysis = new ValidationExceptionFailureAnalyzer()
					.analyze(ex);
			assertThat(analysis).isNotNull();
		}
	}

	@EnableConfigurationProperties(TestProperties.class)
	static class TestConfiguration {

		TestConfiguration(TestProperties testProperties) {

		}

	}

	@ConfigurationProperties("test")
	private static class TestProperties {

	}

}


text:
/* tslint:disable max-line-length */
import { ComponentFixture, TestBed, async } from '@angular/core/testing';
import { Observable } from 'rxjs/Rx';

import { QualiToastTestModule } from '../../../test.module';
import { TesteurDetailComponent } from '../../../../../../main/webapp/app/entities/testeur/testeur-detail.component';
import { TesteurService } from '../../../../../../main/webapp/app/entities/testeur/testeur.service';
import { Testeur } from '../../../../../../main/webapp/app/entities/testeur/testeur.model';

describe('Component Tests', () => {

    describe('Testeur Management Detail Component', () => {
        let comp: TesteurDetailComponent;
        let fixture: ComponentFixture<TesteurDetailComponent>;
        let service: TesteurService;

        beforeEach(async(() => {
            TestBed.configureTestingModule({
                imports: [QualiToastTestModule],
                declarations: [TesteurDetailComponent],
                providers: [
                    TesteurService
                ]
            })
            .overrideTemplate(TesteurDetailComponent, '')
            .compileComponents();
        }));

        beforeEach(() => {
            fixture = TestBed.createComponent(TesteurDetailComponent);
            comp = fixture.componentInstance;
            service = fixture.debugElement.injector.get(TesteurService);
        });

        describe('OnInit', () => {
            it('Should call load all on init', () => {
                // GIVEN

                spyOn(service, 'find').and.returnValue(Observable.of(new Testeur(123)));

                // WHEN
                comp.ngOnInit();

                // THEN
                expect(service.find).toHaveBeenCalledWith(123);
                expect(comp.testeur).toEqual(jasmine.objectContaining({id: 123}));
            });
        });
    });

});


text:
require "bundler/cli"
require "bundler/cli/common"
require "appsignal/cli/diagnose/paths"

describe Appsignal::CLI::Diagnose::Paths do
  describe "#paths" do
    before { Appsignal.config = project_fixture_config }

    it "returns gem installation path as package_install_path" do
      expect(described_class.new.paths[:package_install_path]).to eq(
        :label => "AppSignal gem path",
        :path => Bundler::CLI::Common.select_spec("appsignal").full_gem_path.strip
      )
    end
  end
end


text:
package beancondition;

import org.junit.Test;
import org.junit.runner.RunWith;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.test.context.ContextConfiguration;
import org.springframework.test.context.junit4.SpringJUnit4ClassRunner;
import org.treblereel.spring.beancondition.BeanConditionConfiguration;
import org.treblereel.spring.beancondition.UserDao;

@RunWith(SpringJUnit4ClassRunner.class)
@ContextConfiguration(classes = BeanConditionConfiguration.class)
public class Spring4JUnit4Test {
  @Autowired
  private UserDao userDao;

  @Test
  public void testUserDao(){
    userDao.addUser();
  }

}


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

<!--
  ~ Copyright 2012-2013 Raffael Herzog
  ~
  ~ 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.
  -->
<project xmlns="http://maven.apache.org/POM/4.0.0"
         xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
         xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">

  <modelVersion>4.0.0</modelVersion>

  <groupId>ch.raffael.contracts</groupId>
  <artifactId>contracts-devtools</artifactId>
  <packaging>jar</packaging>

  <name>${project.groupId}:${project.artifactId}</name>
  <description></description>

  <parent>
    <groupId>ch.raffael.contracts</groupId>
    <artifactId>contracts</artifactId>
    <version>1.0-SNAPSHOT</version>
    <relativePath>../pom.xml</relativePath>
  </parent>

  <properties>
    <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
  </properties>

  <dependencies>
    <dependency>
      <groupId>ch.raffael.contracts</groupId>
      <artifactId>contracts-processor</artifactId>
      <version>${project.version}</version>
    </dependency>
    <dependency>
      <groupId>com.jidesoft</groupId>
      <artifactId>jide-oss</artifactId>
      <version>3.5.0</version>
    </dependency>
    <dependency>
      <groupId>com.fifesoft</groupId>
      <artifactId>rsyntaxtextarea</artifactId>
      <version>2.0.2</version>
    </dependency>

    <dependency>
      <groupId>com.intellij</groupId>
      <artifactId>forms_rt</artifactId>
      <version>12.0.2</version>
    </dependency>

    <dependency>
      <groupId>ch.raffael.util</groupId>
      <artifactId>cru-i18n</artifactId>
      <version>1.0</version>
    </dependency>
    <dependency>
      <groupId>ch.raffael.util</groupId>
      <artifactId>cru-swing</artifactId>
      <version>1.0-SNAPSHOT</version>
    </dependency>

    <dependency>
      <groupId>org.slf4j</groupId>
      <artifactId>slf4j-jdk14</artifactId>
      <version>${slf4j.version}</version>
    </dependency>
  </dependencies>

</project>


text:
template <typename T>
inline
unsigned int SparseMatrix<T>::Size() const
{
    if (!col_offsets_.empty())
        return col_offsets_[width_];
    else
        return 0;
}

//-----------------------------------------------------------------------------
template <typename T>
void SparseMatrix<T>::Clear()
{
    if (data_.size() > 0)
        data_.clear();

    if (row_indices_.size() > 0)
        row_indices_.clear();

    if (col_offsets_.size() > 0)
        col_offsets_.clear();

    size_ = 0;
    is_loading_ = false;
    width_ = 0;
    height_ = 0;
}

//-----------------------------------------------------------------------------
template <typename T>
inline
SparseMatrix<T>::SparseMatrix()
    : height_(0), width_(0), is_loading_(false), size_(0)
{
}

//-----------------------------------------------------------------------------
template <typename T>
inline
SparseMatrix<T>::SparseMatrix(const unsigned int height,
                              const unsigned int width,
                              const unsigned int nzmax)
    : height_(height), width_(width),
      is_loading_(false), size_(nzmax)
{
    Reserve(height_, width_, size_);
}

//-----------------------------------------------------------------------------
template <typename T>
inline
SparseMatrix<T>::SparseMatrix(const unsigned int height,
                 const unsigned int width,
                 const unsigned int nzmax,
                 const unsigned int* col_offsets,
                 const unsigned int* row_indices,
                 const T* data)
    : height_(height), width_(width),
      is_loading_(false), size_(nzmax),
      col_offsets_(col_offsets, col_offsets + width+1),
      row_indices_(row_indices, row_indices + nzmax),
      data_(data, data + nzmax)
{
}

//-----------------------------------------------------------------------------
template <typename T>
inline
SparseMatrix<T>::SparseMatrix(const SparseMatrix<T>& m)
    : height_(m.height_), width_(m.width_),
      is_loading_(m.is_loading_), size_(m.size_),
      col_offsets_(m.col_offsets_), row_indices_(m.row_indices_),
      data_(m.data_)
{
}

//-----------------------------------------------------------------------------
template <typename T>
inline
void SparseMatrix<T>::BeginLoad()
{
    size_ = 0;
    is_loading_ = true;
}

//-----------------------------------------------------------------------------
template <typename T>
inline
void SparseMatrix<T>::EndLoad()
{
    Compress();
    is_loading_ = false;
}

//-----------------------------------------------------------------------------
template <typename T>
void SparseMatrix<T>::Reserve(const unsigned int height,
                              const unsigned int width,
                              const unsigned int nzmax)
{
    // (width+1) must fit in an unsigned int
    if (width == std::numeric_limits<unsigned int>::max())
        throw std::runtime_error("SparseMatrix::Reserve: width too large");

    // The col_offsets array requires (width+1) entries when compressed, and
    // nzmax entries when loading.  Allocate the max of these.

    unsigned int s = std::max(nzmax, width+1);
    if (col_offsets_.size() < s)
        col_offsets_.resize(s);

    // the row_indices array requires nzmax entries
    if (row_indices_.size() < nzmax)
        row_indices_.resize(nzmax);

    // the data array requires nzmax entries
    if (data_.size() < nzmax)
        data_.resize(nzmax);

    height_    = height;
    width_     = width;
    size_      = 0;
}

//-----------------------------------------------------------------------------
template <typename T>
inline
void SparseMatrix<T>::Load(const unsigned int row,
                           const unsigned int col,
                           const T& value)
{
    if (!is_loading_)
        throw std::runtime_error("SparseMatrix::Load: matrix not in load mode");
    if (col >= width_)
        throw std::runtime_error("SparseMatrix::Load: col index out of bounds");
    if (row >= height_)
        throw std::runtime_error("SparseMatrix::Load: row index out of bounds");

    assert(size_ < col_offsets_.size());
    col_offsets_[size_] = col;

    assert(size_ < row_indices_.size());
    row_indices_[size_] = row;

    assert(size_ < data_.size());
    data_[size_] = value;
    ++size_;
}

//-----------------------------------------------------------------------------
template <typename T>
inline
void SparseMatrix<T>::Compress()
{
    if (0 == size_)
        throw std::runtime_error("SparseMatrix::Compress: matrix has no data");

    // Check the columns to see if they are already sorted in nondecreasing
    // order.  If not, sort the column indices and reorder the rows and
    // data arrays to match.

    bool sorted = true;
    if (size_ >= 2)
    {
        for (unsigned int i=0; i != (size_ - 1); ++i)
        {
            if (col_offsets_[i] > col_offsets_[i+1])
            {
                sorted = false;
                break;
            }
        }
    }

    // Whether the column data is sorted or not, bin the column indices,
    // and compute a prefix sum of the binned data to generate the compressed
    // column representation of the column indices.

    // copy the column indices
    std::vector<unsigned int> col_temp(col_offsets_);
    std::vector<unsigned int> counts(width_);

    // size_ elements have been loaded
    Histogram(col_offsets_.begin(), col_offsets_.begin() + size_,
              counts.begin(), counts.end());
    PrefixSum(counts.begin(), counts.end());
    std::copy(counts.begin(), counts.end(), col_offsets_.begin()+1);
    col_offsets_[0] = 0;

    if (!sorted)
    {
        unsigned int offset_a, offset_b, row_index, c;

        // need temp copies of the row and data arrays
        std::vector<unsigned int> row_temp (row_indices_);
        std::vector<T>            data_temp(data_);

        for (unsigned int k=1; k <= size_; ++k)
        {
            // offset into the unsorted arrays
            offset_a = size_ - k;

            // the row index of the nonzero element at this offset
            row_index = row_temp[offset_a];

            // the column index of this element
            c = col_temp[offset_a];
            assert(c <= (width_));

            // destination offset + 1
            offset_b = counts[c];
            if (0 == offset_b)
                continue;

            row_indices_[offset_b-1] = row_index;
            data_[offset_b-1]        = data_temp[offset_a];

            // one fewer element in the source array <= row_index
            counts[c] -= 1;
        }
    }

    // set the size
    col_offsets_[width_] = size_;

    // May still have duplicates - need to find duplicates and sum. TBD
}

//-----------------------------------------------------------------------------
template <typename T>
T SparseMatrix<T>::Get(const unsigned int r, const unsigned int c)
{
    if (r >= height_)
        throw std::logic_error("Get: row index out of bounds.");
    if (c >= width_)
        throw std::logic_error("Get: col index out of bounds.");

    T val = T(0);

    // scan all nonzero elements for column c; if row r is present,
    // return the associated value, otherwise return 0
    unsigned int start = col_offsets_[c];
    unsigned int end   = col_offsets_[c+1];
    for (unsigned int offset = start; offset != end; ++offset)
    {
        unsigned int row = row_indices_[offset];
        if (r == row)
        {
            val = data_[offset];
            break;
        }
    }

    return val;
}

//-----------------------------------------------------------------------------
template <typename T>
void SparseMatrix<T>::SubMatrix(SparseMatrix<T>& result,
                                const unsigned int r0,
                                const unsigned int c0,
                                const unsigned int new_height,
                                const unsigned int new_width) const
{
    // one past the end of each range
    unsigned int r1 = r0 + new_height;
    unsigned int c1 = c0 + new_width;

    if ( (r0 >= height_) || (r1 > height_))
        throw std::logic_error("SubMatrix: invalid row limits");
    if ( (c0 >= width_) || (c1 > width_))
        throw std::logic_error("SubMatrix: invalid column limits");

    // count the number of nonzeros in the submatrix

    unsigned int new_size = 0;
    for (unsigned int c=c0; c != c1; ++c)
    {
        // number of nonzeros in source column c
        new_size += (col_offsets_[c+1] - col_offsets_[c]);
    }

    if (0u == new_size)
        throw std::logic_error("SparseMatrix::SubMatrix: submatrix is the zero matrix");

    // allocate memory in the result; won't allocate if sufficient memory available
    result.Reserve(new_height, new_width, new_size);

    // Load the elements within the row and column bounds into the new matrix.
    // No need to call result.Clear(), since that will result in a new allocation.

    unsigned int* cols_b = result.ColBuffer();
    unsigned int* rows_b = result.RowBuffer();
    T* data_b            = result.DataBuffer();

    unsigned int count = 0;
    for (unsigned int c=c0; c != c1; ++c)
    {
        cols_b[c-c0] = count;

        unsigned int start = col_offsets_[c];
        unsigned int end   = col_offsets_[c+1];
        for (unsigned int offset = start; offset != end; ++offset)
        {
            unsigned int row = row_indices_[offset];
            if ( (row >= r0) && (row < r1))
            {
                rows_b[count] = row - r0;
                data_b[count] = data_[offset];
                ++count;
            }
        }
    }

    cols_b[c1] = count;
    //assert(new_size == count);

    // set the size of the new matrix explicitly, since Load() has been bypassed
    result.SetSize(count);
}

//-----------------------------------------------------------------------------
template <typename T>
void SparseMatrix<T>::RemoveZeros(const T& epsilon)
{
    // This function removes zeros from a matrix.  Removal of zeros may
    // result in some unused row indices, if the removed zeros are the
    // only entries in those rows.  Regardless, this function does not
    // change the height of the matrix.

    unsigned int nz_count = 0;

    for (unsigned int c=0; c != width_; ++c)
    {
        // column c in the uncompacted matrix begins at this offset
        unsigned int start = col_offsets_[c];

        // column c in the compacted matrix begins at the next location
        // after the compacted nonzero elements
        col_offsets_[c] = nz_count;

        // column c in the uncompacted matrix ends at this offset
        unsigned int end = col_offsets_[c+1];

        for (unsigned int offset=start; offset != end; ++offset)
        {
            T val = data_[offset];
            if (std::abs(val) > epsilon)
            {
                // keep this value
                row_indices_[nz_count] = row_indices_[offset];
                data_[nz_count] = val;
                ++nz_count;
            }
        }
    }

    col_offsets_[width_] = nz_count;
    size_ = nz_count;
}

//-----------------------------------------------------------------------------
template <typename T>
void SparseMatrix<T>::NonZeroRowIndices(std::set<unsigned int>& row_index_set,
                                        const T& epsilon)
{
    row_index_set.clear();

    // save indices of rows with values > epsilon
    for (unsigned int s=0; s<size_; ++s)
    {
        T val = data_[s];
        if (std::abs(val) > epsilon)
        {
            unsigned int row = row_indices_[s];
            row_index_set.insert(row);
        }
    }
}

//-----------------------------------------------------------------------------
template <typename T>
void SparseMatrix<T>::SubMatrixCols(SparseMatrix<T>& result,
                                    const std::vector<unsigned int>& col_indices) const
{
    // extract entire columns from the source matrix to form the dest matrix

    unsigned int new_width = col_indices.size();
    if (0u == new_width)
        throw std::logic_error("SparseMatrix: empty column set");

    // check the column indices for validty and count nonzeros

    unsigned int new_size = 0;
    for (auto it=col_indices.begin(); it != col_indices.end(); ++it)
    {
        // index of next source column
        unsigned int c = *it;
        if (c >= width_)
            throw std::logic_error("SparseMatrix::SubMatrix: column index out of range");

        // number of nonzeros in source column c
        new_size += (col_offsets_[c+1] - col_offsets_[c]);
    }

    if (0u == new_size)
        throw std::logic_error("SparseMatrix::SubMatrix: submatrix is the zero matrix");

    // allocate memory in the result; won't allocate if sufficient memory available
    result.Reserve(height_, new_width, new_size);

    unsigned int* cols_b = result.ColBuffer();
    unsigned int* rows_b = result.RowBuffer();
    T* data_b            = result.DataBuffer();

    unsigned int c_dest = 0;
    unsigned int elt_count = 0;
    for (auto it=col_indices.begin(); it != col_indices.end(); ++it)
    {
        // index of the next source column
        unsigned int c = *it;

        // set element offset for the next dest column
        cols_b[c_dest] = elt_count;

        unsigned int start = col_offsets_[c];
        unsigned int end   = col_offsets_[c+1];
        for (unsigned int offset = start; offset != end; ++offset)
        {
            rows_b[elt_count] = row_indices_[offset];
            data_b[elt_count] = data_[offset];
            ++elt_count;
        }

        // have now completed another column
        ++c_dest;
    }

    cols_b[new_width] = elt_count;
    assert(new_width == c_dest);

    // set the size of the new matrix explicitly, since Load() has been bypassed
    result.SetSize(elt_count);
}

//-----------------------------------------------------------------------------
template <typename T>
void SparseMatrix<T>::SubMatrixColsCompact(SparseMatrix<T>& result,
                                           const std::vector<unsigned int>& col_indices,
                                           std::vector<unsigned int>& old_to_new_rows,
                                           std::vector<unsigned int>& new_to_old_rows) const
{
    const unsigned int UNUSED_ROW = 0xFFFFFFFF;

    // extract entire columns from the source matrix to form the dest matrix

    unsigned int new_width = col_indices.size();
    if (0u == new_width)
        throw std::logic_error("SparseMatrix::SubMatrixColsCompact: empty column set");

    // need one entry per original row in the row_map
    if (old_to_new_rows.size() < height_)
        old_to_new_rows.resize(height_);

    std::fill(old_to_new_rows.begin(), old_to_new_rows.begin() + height_, UNUSED_ROW);
    // no need to fill 'new_to_old_rows'

    // check the column indices for validty and count nonzeros

    unsigned int new_size = 0;
    for (auto it=col_indices.begin(); it != col_indices.end(); ++it)
    {
        // index of next source column
        unsigned int c = *it;
        if (c >= width_)
            throw std::logic_error("SparseMatrix::SubMatrixColsCompact: column index out of range");

        // number of nonzeros in source column c
        new_size += (col_offsets_[c+1] - col_offsets_[c]);
    }

    if (0u == new_size)
        throw std::logic_error("SparseMatrix::SubMatrixColsCompact: submatrix is the zero matrix");

    // allocate memory in the result; won't allocate if sufficient memory available
    result.Reserve(height_, new_width, new_size);

    unsigned int* cols_b = result.ColBuffer();
    unsigned int* rows_b = result.RowBuffer();
    T* data_b            = result.DataBuffer();

    unsigned int c_dest = 0;
    unsigned int elt_count = 0;
    for (auto it=col_indices.begin(); it != col_indices.end(); ++it)
    {
        // index of the next source column
        unsigned int c = *it;

        // set element offset for the next dest column
        cols_b[c_dest] = elt_count;

        unsigned int start = col_offsets_[c];
        unsigned int end   = col_offsets_[c+1];
        for (unsigned int offset = start; offset != end; ++offset)
        {
            unsigned int row = row_indices_[offset];
            old_to_new_rows[row] = row;
            rows_b[elt_count] = row;
            data_b[elt_count] = data_[offset];
            ++elt_count;
        }

        // have now completed another column
        ++c_dest;
    }

    cols_b[new_width] = elt_count;
    assert(new_width == c_dest);

    // set the size of the new matrix explicitly, since Load() has been bypassed
    result.SetSize(elt_count);

    // determine the new height of the submatrix
    unsigned int new_height = 0;
    for (unsigned int r=0; r != height_; ++r)
    {
        if (UNUSED_ROW != old_to_new_rows[r])
            ++new_height;
    }

    new_to_old_rows.resize(new_height);

    // renumber the rows in the submatrix

    unsigned int new_r = 0;
    for (unsigned int r=0; r<height_; ++r)
    {
        if (UNUSED_ROW != old_to_new_rows[r])
        {
            old_to_new_rows[r] = new_r;
            new_to_old_rows[new_r] = r;
            ++new_r;
        }
    }

    // set the height of the new matrix explicitly
    assert(new_r == new_height);
    result.SetHeight(new_height);

    // re-index the rows in the submatrix
    for (unsigned int s=0; s != elt_count; ++s)
    {
        unsigned int old_row_index = rows_b[s];
        rows_b[s] = old_to_new_rows[old_row_index];
    }

    assert(result.Height() == new_height);
    assert(new_to_old_rows.size() == new_height);
    assert(old_to_new_rows.size() == height_);
}

//-----------------------------------------------------------------------------
template <typename T>
void SparseMatrix<T>::SubMatrixRowsCompact(const std::vector<unsigned int>& col_indices,
                                           std::vector<unsigned int>& old_to_new_rows,
                                           std::vector<unsigned int>& new_to_old_rows) const
{
    const unsigned int UNUSED_ROW = 0xFFFFFFFF;

    unsigned int new_width = col_indices.size();
    if (0u == new_width)
        throw std::logic_error("SparseMatrix::SubMatrixRowsCompact empty column set");

    // need one entry per original row in the row_map
    if (old_to_new_rows.size() < height_)
        old_to_new_rows.resize(height_);

    std::fill(old_to_new_rows.begin(), old_to_new_rows.begin() + height_, UNUSED_ROW);
    // no need to fill 'new_to_old_rows'

    // check the column indices for validty and determine new matrix size
    unsigned int new_size = 0;
    for (auto it=col_indices.begin(); it != col_indices.end(); ++it)
    {
        // index of next source column
        unsigned int c = *it;
        if (c >= width_)
            throw std::logic_error("SparseMatrix::SubMatrixRowsCompact: column index out of range");

        // number of nonzeros in source column c
        new_size += (col_offsets_[c+1] - col_offsets_[c]);
    }

    if (0u == new_size)
        throw std::logic_error("SparseMatrix::SubMatrixRowsCompact: submatrix is the zero matrix");

    unsigned int c_dest = 0;
    unsigned int elt_count = 0;
    for (auto it=col_indices.begin(); it != col_indices.end(); ++it)
    {
        // index of the next source column
        unsigned int c = *it;

        unsigned int start = col_offsets_[c];
        unsigned int end   = col_offsets_[c+1];
        for (unsigned int offset = start; offset != end; ++offset)
        {
            unsigned int row = row_indices_[offset];
            old_to_new_rows[row] = row;
            ++elt_count;
        }

        // have now completed another column
        ++c_dest;
    }

    assert(new_width == c_dest);

    // determine the new height of the submatrix
    unsigned int new_height = 0;
    for (unsigned int r=0; r != height_; ++r)
    {
        if (UNUSED_ROW != old_to_new_rows[r])
            ++new_height;
    }

    new_to_old_rows.resize(new_height);

    // re-index the rows for the (virtual) new matrix
    unsigned int new_r = 0;
    for (unsigned int r=0; r<height_; ++r)
    {
        if (old_to_new_rows[r] != UNUSED_ROW)
        {
            old_to_new_rows[r] = new_r;
            new_to_old_rows[new_r] = r;
            ++new_r;
        }
    }

    assert(new_to_old_rows.size() == new_height);
    assert(old_to_new_rows.size() == height_);
}


text:
import * as angular from 'angular';
import HomeController from './HomeController';
import DataService from './DataService';

import 'ng-office-ui-fabric';

const todoapp: ng.IModule = angular.module('crudapp', [
  'officeuifabric.core',
  'officeuifabric.components'
]);

todoapp
  .controller('HomeController', HomeController)
  .service('DataService', DataService);


text:
<?php
/*
 * This file is part of GImage.
 *
 * (c) Jose Quintana <https://git.io/joseluisq>
 *
 * This source file is subject to the MIT license that is bundled
 * with this source code in the file LICENSE.
 */

/**
 * Creating an Elipse.
 *
 * @author Jose Quintana <https://git.io/joseluisq>
 */

namespace GImage\Examples;

use GImage\Figure;

require __DIR__ . '/_config.php';
require __DIR__ . '/../tests/bootstrap.php';

$figure = new Figure(300, 200);
$figure
    ->isEllipse()
    ->setBackgroundColor(255, 0, 0)
    ->setOpacity(0.5)
    ->create()
    ->save(__DIR__ . '/ellipse.png');