text:
<?xml version="1.0" encoding="utf-8"?>
<resources>
    <string name="app_name">AMBI Lactation Consultant</string>
    <string name="button_register">Registration</string>
    <string name="button_submit">Submit</string>
    <string name="firstName">First Name</string>
    <string name="lastName">Last Name</string>
    <string name="username">Username</string>
    <string name="password">Password</string>
    <string name="Email">Email</string>
    <string name="submit">Submit</string>
    <string name="acct_reg">Account Registration</string>

    <string name="title_activity_fullscreen">FullscreenActivity</string>
    <string name="change_layout_manager">Change Layout</string>
    <string-array name="organization">
        <item>Choose one</item>
        <item>Organization</item>
        <item>Hospital Administrator</item>
        <item>Patient</item>
        <item>Test User</item>
    </string-array>

    <string-array name="action">
        <item>Choose one</item>
        <item>Request consent form agreement</item>
        <item>Request Graceland University consent form agreement</item>
        <item>Request system feedback</item>
        <item>Send breastfeeding followup</item>
        <item>Send self-efficiency survey</item>
        <item>Send breastfeeding evaluation</item>
        <item>Send postnatal depression survey</item>
        <item>Issue Mother Information</item>
        <item>Reset Password</item>
        <item>Disable User</item>
        <item>Enable User</item>
        <item>Delete User</item>
    </string-array>

    <string-array name="addUser">
        <item>Choose one</item>
        <item>Mother</item>
        <item>Other</item>
    </string-array>

    <string-array name="motherInfo">
        <item>Choose one</item>
        <item>Mother1</item>
        <item>Mother2</item>
    </string-array>

    <string-array name="age">
        <item>Choose one</item>
        <item> less than 20</item>
        <item> 20-29</item>
        <item> 30-39</item>
        <item> 40 or more</item>
    </string-array>

    <string-array name="ethnicity">
        <item>Choose one</item>
        <item>Hispanic or Latino</item>
        <item>NON Hispanic or Latino</item>
    </string-array>

    <string-array name="race">
        <item>Choose one</item>
        <item>Native Hawaiian or Pacific Islander</item>
        <item>Asian</item>
        <item>Black or African American</item>
        <item>American Indian/Alaskan Native</item>
        <item>White</item>
        <item>More than one Race</item>
    </string-array>

    <string-array name="educationalLevel">
        <item>Choose one</item>
        <item>Less than Highschool</item>
        <item>High School/GED</item>
        <item>Some College</item>
        <item>Associate College</item>
        <item>BA or BS degree</item>
        <item>Masters Degree</item>
        <item>Doctoral Degree</item>
        <item>Professional Degree</item>
    </string-array>

    <string-array name="householdIncome">
        <item>Choose one</item>
        <item>Less than $10,000</item>
        <item>$10,000 to less than $24,999</item>
        <item>$25,000 to $49,999</item>
        <item>$50,000 or more</item>

    </string-array>

    <string-array name="occupation">
        <item>Choose one</item>
        <item>Homemaker</item>
        <item>Professional</item>
        <item>Cashier, Secretary, Laborer, Technician</item>
        <item>Other</item>
    </string-array>

    <string-array name="residence">
        <item>Choose one</item>
        <item>Rural</item>
        <item>Urban</item>
        <item>Apartment/Rental</item>
        <item>Owned</item>
    </string-array>

    <string-array name="ThisBabyIsYour">
        <item>Choose one</item>
        <item>First</item>
        <item>Second</item>
        <item>Third</item>
        <item>Fourth/more</item>

    </string-array>

    <string-array name="MethodOfDelivery">
        <item>Choose one</item>
        <item>Vagina</item>
        <item>Vaginal with Assistance</item>
        <item>Breech</item>
        <item>Section</item>
    </string-array>

    <string-array name="PastBreastfeedingExperience">
        <item>Choose one</item>
        <item> less than 3 months</item>
        <item> 3-6 months</item>
        <item> 7-12 months</item>
        <item> less than a year</item>
        <item> No past breastfeeding experience</item>
    </string-array>

    <string-array name="GestationalAge">
        <item>Choose one</item>
        <item>less than 34 weeks</item>
        <item>34 to 35 weeks</item>
        <item>35 to 36 weeks</item>
        <item>36 to 37 weeks</item>
        <item>Greater than 37 weeks</item>
    </string-array>

    <string-array name="AppropriatenessForAge">
        <item>Choose one</item>
        <item>AGA</item>
        <item>SGA</item>
        <item>LGA</item>
    </string-array>

    <string-array name="InfantWeight1">
        <item>Choose one</item>
        <item>< 2 pounds</item>
        <item>2 pounds</item>
        <item>3 pounds</item>
        <item>4 pounds</item>
        <item>5 pounds</item>
        <item>6 pounds</item>
        <item>7 pounds</item>
        <item>8 pounds</item>
        <item>9 pounds</item>
        <item>10 pounds</item>
        <item>> 10 pounds</item>
    </string-array>

    <string-array name="InfantWeight2">
        <item>Choose one</item>
        <item>1 ounces</item>
        <item>2 ounces</item>
        <item>3 ounces</item>
        <item>4 ounces</item>
        <item>5 ounces</item>
        <item>6 ounces</item>
        <item>7 ounces</item>
        <item>8 ounces</item>
        <item>9 ounces</item>
        <item>10 ounces</item>
        <item>11 ounces</item>
        <item>12 ounces</item>
        <item>13 ounces</item>
        <item>14 ounces</item>
        <item>15 ounces</item>
        <item>16 ounces</item>
    </string-array>

    <string-array name="firstfeeding">
        <item>Choose one</item>
        <item>Mother's own milk</item>
        <item>Breast milk (banked)</item>
        <item>Formula</item>
    </string-array>

    <string-array name="agefeeding">
        <item>Choose one</item>
        <item>Immediately after birth</item>
        <item>2-4 hours after birth</item>
        <item>6 hours after birth</item>
        <item>Greater than 6 hours after birth</item>
    </string-array>

    <string-array name="timeOffeeding">
        <item>Choose one</item>
        <item>Within 1 hour after delivery</item>
        <item>Within first 6 hours after delivery</item>
        <item>6-12 hours after delivery</item>
        <item>After the first day</item>

    </string-array>

    <string-array name="frequencybreast">
        <item>Choose one</item>
        <item>Every 2-3 hours</item>
        <item>Every 4-5 hours</item>
        <item>Greater than 5 hours</item>
    </string-array>

    <string-array name="firstcareprovider">
        <item>Choose one</item>
        <item>Within 48-72 hours</item>
        <item>By the first week of discharge</item>
        <item>After the first week of discharge</item>
    </string-array>

    <string-array name="needforprovider">
        <item>Choose one</item>
        <item>Yes</item>
        <item>No</item>
    </string-array>

    <string-array name="timeOfExtraCare">
        <item>Choose one</item>
        <item>1-2 times</item>
        <item>3-4 items</item>
        <item>5-6 times</item>
    </string-array>

    <string-array name="questionnaire">
        <item>Choose one</item>
        <item>System Feedback</item>
        <item>Breastfeeding Followup</item>
        <item>Self Efficacy Survey</item>
        <item>Breastfeeding Evaluation</item>
        <item>Postnatal Depression</item>
    </string-array>

    <string-array name="notificationsquery">
        <item>All</item>
        <item>Latching</item>
        <item>Jaundice</item>
        <item>Engorgement</item>
        <item>Sore Nipple</item>
        <item>Insufficient Breastfeeding Entries</item>
        <item>Nipple Shield</item>
        <item>Sufficient Breastfeeding Entries</item>
        <item>Sufficient Output Entries</item>
        <item>Sufficient Notification Reading</item>
    </string-array>

    <string name="action_prompt">Action</string>
    <string name="close">Close</string>
    <string name="open">Open</string>
    <string name="name">Name</string>
    <string name="action_settings">Settings</string>
    <string name="action_search">Search</string>
    <string name="action_delete">Delete</string>

    <string name="hello_blank_fragment">Hello blank fragment</string>
    <string name="drawer_open">Drawer Open</string>
    <string name="drawer_close">Drawer Close</string>
    <string name="welcome_to_the_lactation_consultant_portal">Welcome to the Lactation Consultant Portal</string>
    <string name="created_at_purdue_university">Created at Purdue University.</string>
    <string name="app_design_by_icon8">App Design by Icon8</string>
    <string name="age">Age:</string>
    <string name="ethnicity">Ethnicity:</string>
    <string name="race">Race:</string>
    <string name="education_level">Education Level:</string>
    <string name="residence">Residence:</string>
    <string name="occupation">Occupation:</string>
    <string name="household_income">Household Income:</string>
    <string name="this_baby_is_your">This Baby Is Your:</string>
    <string name="method_of_delivery">Method of Delivery:</string>
    <string name="past_breastfeeding_experience">Past Breastfeeding Experience:</string>

    <string name="longtext">LACTOR is an innovative, interactive web-based breastfeeding monitoring system. LACTOR was created to help breastfeeding mothers monitor their breastfeeding patterns and detect early breastfeeding problems. The lactation consultant can also monitor mothers data and intervene immediately in case of a breastfeeding problem. Mothers also receive notifications if they have any breastfeeding problem with suggestions to help solve the problem</string>
    <string name="mother">Mother</string>
    <string name="questionnaire">Questionnaire</string>
    <string name="name_tag">Name:</string>
    <string name="address_tag">Address:</string>
    <string name="age_tag">Age:</string>
    <string name="ethnicity_tag">Ethnicity:</string>
    <string name="race_tag">Race:</string>
    <string name="education_tag">Education:</string>
    <string name="income_tag">House Income:</string>
    <string name="occupation_tag">Occupation:</string>
    <string name="residence_tag">Residence:</string>
    <string name="mhdp">Maternal History During Pregnancy:</string>
    <string name="delivery_tag">Method of delivery:</string>
    <string name="pbe_tag">Past Breastfeeding Experience:</string>
    <string name="phone_tag">Phone:</string>
</resources>


text:
package rajawali.materials.textures;

import java.io.IOException;

import android.graphics.SurfaceTexture;
import android.hardware.Camera;
import android.media.MediaPlayer;
import android.opengl.GLES11Ext;
import android.opengl.GLES20;
import android.view.Surface;

public class VideoTexture extends ATexture {

	private final int GL_TEXTURE_EXTERNAL_OES = 0x8D65;
	private MediaPlayer mMediaPlayer;
	private Camera mCamera;
	private SurfaceTexture mSurfaceTexture;
	SurfaceTexture.OnFrameAvailableListener mOnFrameAvailableListener;

	public VideoTexture(String textureName, MediaPlayer mediaPlayer)
	{
		super(TextureType.VIDEO_TEXTURE, textureName);
		mMediaPlayer = mediaPlayer;
		setGLTextureType(GLES11Ext.GL_TEXTURE_EXTERNAL_OES);
	}

	public VideoTexture(String textureName, Camera camera, SurfaceTexture.OnFrameAvailableListener onFrameAvailableListener)
	{
		super(TextureType.VIDEO_TEXTURE, textureName);
		mCamera = camera;
		mOnFrameAvailableListener = onFrameAvailableListener;
		setGLTextureType(GLES11Ext.GL_TEXTURE_EXTERNAL_OES);
	}

	public VideoTexture(VideoTexture other)
	{
		super(other);
	}

	public VideoTexture clone() {
		return new VideoTexture(this);
	}

	void add() throws TextureException {
		int[] textures = new int[1];
		GLES20.glGenTextures(1, textures, 0);
		int textureId = textures[0];
		GLES20.glBindTexture(GL_TEXTURE_EXTERNAL_OES, textureId);
		GLES20.glTexParameterf(GL_TEXTURE_EXTERNAL_OES,
				GLES20.GL_TEXTURE_MIN_FILTER, GLES20.GL_NEAREST);
		GLES20.glTexParameterf(GL_TEXTURE_EXTERNAL_OES,
				GLES20.GL_TEXTURE_MAG_FILTER, GLES20.GL_LINEAR);
		GLES20.glTexParameterf(GL_TEXTURE_EXTERNAL_OES,
				GLES20.GL_TEXTURE_WRAP_S, GLES20.GL_CLAMP_TO_EDGE);
		GLES20.glTexParameterf(GL_TEXTURE_EXTERNAL_OES,
				GLES20.GL_TEXTURE_WRAP_T, GLES20.GL_CLAMP_TO_EDGE);
		setTextureId(textureId);
		mSurfaceTexture = new SurfaceTexture(textureId);
		if(mMediaPlayer != null)
			mMediaPlayer.setSurface(new Surface(mSurfaceTexture));
		else if(mCamera != null)
			try {
				mSurfaceTexture.setOnFrameAvailableListener(mOnFrameAvailableListener);
				mCamera.setPreviewTexture(mSurfaceTexture);
			} catch (IOException e) {
				throw new TextureException(e);
			}
	}

	void remove() throws TextureException {
		GLES20.glDeleteTextures(1, new int[] { mTextureId }, 0);
		mSurfaceTexture.release();
	}

	void replace() throws TextureException {
		return;
	}

	void reset() throws TextureException {
		mSurfaceTexture.release();
	}

	public SurfaceTexture getSurfaceTexture() {
		return mSurfaceTexture;
	}

	public void update()
	{
		if(mSurfaceTexture != null)
			mSurfaceTexture.updateTexImage();
	}
}

redpajama_set_name: RedPajamaGithub


text:
package com.example.android.fillheart;

import android.app.Activity;
import android.graphics.drawable.AnimatedVectorDrawable;
import android.os.Bundle;
import android.view.View;
import android.widget.ImageView;

public class MainActivity extends Activity {

    private ImageView imageView;
    private AnimatedVectorDrawable emptyHeart;
    private AnimatedVectorDrawable fillHeart;
    private boolean full = false;

    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_main);
        imageView = (ImageView) findViewById(R.id.image_view);
        emptyHeart = (AnimatedVectorDrawable) getDrawable(R.drawable.avd_heart_empty);
        fillHeart = (AnimatedVectorDrawable) getDrawable(R.drawable.avd_heart_fill);
    }

    public void animate(View view) {
        AnimatedVectorDrawable drawable = full ? emptyHeart : fillHeart;
        imageView.setImageDrawable(drawable);
        drawable.start();
        full = !full;
    }
}


text:
Domyślna metoda ekspedycji wiadomości

<tt>default_transport</tt>

Ten parametr określa domyślną metodę ekspedycji wiadomości wykorzystywaną,
gdy nie podano jawnie metody ekspedycji w fakultatywnej tabeli
ekspedycji. Powszechnie używane wartości to
<tt>uucp</tt> i <tt>smtp</tt>.


text:
<?php

/* WebServiceWebServiceBundle:Model:new.html.twig */
class __TwigTemplate_6b541dc265dee64e17f0c727722d4070d785d7fe5a8b7fdc37076698e99dbfca extends Twig_Template
{
    public function __construct(Twig_Environment $env)
    {
        parent::__construct($env);

        // line 1
        $this->parent = $this->loadTemplate("::base.html.twig", "WebServiceWebServiceBundle:Model:new.html.twig", 1);
        $this->blocks = array(
            'body' => array($this, 'block_body'),
        );
    }

    protected function doGetParent(array $context)
    {
        return "::base.html.twig";
    }

    protected function doDisplay(array $context, array $blocks = array())
    {
        $this->parent->display($context, array_merge($this->blocks, $blocks));
    }

    // line 3
    public function block_body($context, array $blocks = array())
    {
        // line 4
        echo "
Model creation

    ";
        // line 6
        echo         $this->env->getExtension('form')->renderer->renderBlock((isset($context["form"]) ? $context["form"] : $this->getContext($context, "form")), 'form');
        echo "

        env->getExtension('routing')->getPath("model");
        echo "\">
            Back to the list

";
    }

    public function getTemplateName()
    {
        return "WebServiceWebServiceBundle:Model:new.html.twig";
    }

    public function isTraitable()
    {
        return false;
    }

    public function getDebugInfo()
    {
        return array (  42 => 10,  35 => 6,  31 => 4,  28 => 3,  11 => 1,);
    }
}


text:
matcher = ARGV.reject { |f| f =~ /^--?/ }.first
matcher = '/./' unless matcher
matcher = matcher[0] == ?/ ? Regexp.new(matcher[1..-2]) : /#{matcher}/

formula = Dir[Coresys.formula + '*.rb'].map do |formula|
  File.basename(formula).sub(/\.rb$/, '')
end.select do |formula|
  formula =~ matcher
end.sort

columned('Available formula', formula)


text:
namespace Acme.Common
{
    /// <summary>
    /// Provides a success flag and message
    /// useful as a method return type.
    /// </summary>
    public class OperationResult<T>
    {
        public OperationResult()
        {
        }

        public OperationResult(T result, string message) : this()
        {
            this.Result = result;
            this.Message = message;
        }

        public T Result { get; set; }
        public string Message { get; set; }
    }
}


text:
package net.gcdc.geonetworking;

import java.nio.ByteBuffer;
import java.util.Arrays;

public class BtpPacket {

    private final Optional<Short>              sourcePort;
    private final short                        destinationPort;
    private final Optional<Short>              destinationPortInfo;
    private final byte[]                       payload;  // Final reference, but mutable content!
    private final Destination                  destination;
    private final Optional<TrafficClass>       trafficClass;
    private final Optional<LongPositionVector> senderPosition;

    private byte[] gnPayload = null;

    public static final int HEADER_LENGTH = 4;

    private BtpPacket(
            Optional<Short>              sourcePort,
            short                        destinationPort,
            Optional<Short>              destinationPortInfo,
            byte[]                       payload,
            Destination                  destination,
            Optional<TrafficClass>       trafficClass,
            Optional<LongPositionVector> senderPosition
        ) {
        this.sourcePort          = sourcePort;
        this.destinationPort     = destinationPort;
        this.destinationPortInfo = destinationPortInfo;
        this.payload             = payload.clone();  // Defensive. Just in case.
        this.destination         = destination;
        this.trafficClass        = trafficClass;
        this.senderPosition      = senderPosition;
    }

    public static BtpPacket singleHop(byte[] payload, short destinationPort) {
        Optional<Short>              emptySourcePort          = Optional.empty();
        Optional<Short>              emptyDestinationPortInfo = Optional.empty();
        Optional<TrafficClass>       emptyTrafficClass        = Optional.empty();
        Optional<LongPositionVector> emptySenderPosition      = Optional.empty();

        return new BtpPacket(
                emptySourcePort,
                destinationPort,
                emptyDestinationPortInfo,
                payload,
                Destination.singleHop(),
                emptyTrafficClass,
                emptySenderPosition
                );
    }

    public static BtpPacket singleHop(byte[] payload, short destinationPort, double maxLifetimeSec) {
        Optional<Short>              emptySourcePort          = Optional.empty();
        Optional<Short>              emptyDestinationPortInfo = Optional.empty();
        Optional<TrafficClass>       emptyTrafficClass        = Optional.empty();
        Optional<LongPositionVector> emptySenderPosition      = Optional.empty();

        return new BtpPacket(
                emptySourcePort,
                destinationPort,
                emptyDestinationPortInfo,
                payload,
                Destination.singleHop().withMaxLifetimeSeconds(maxLifetimeSec),
                emptyTrafficClass,
                emptySenderPosition
                );
    }
    /** Dummy BTP-A packet for Plugtest. */
    public static BtpPacket singleHopEmptyA(short destinationPort, short sourcePort) {
        Optional<Short>              emptyDestinationPortInfo = Optional.empty();
        Optional<TrafficClass>       emptyTrafficClass        = Optional.empty();
        Optional<LongPositionVector> emptySenderPosition      = Optional.empty();

        return new BtpPacket(
                Optional.of(sourcePort),
                destinationPort,
                emptyDestinationPortInfo,
                new byte[] {},
                Destination.singleHop(),
                emptyTrafficClass,
                emptySenderPosition
                );
    }

    /** Dummy BTP-B packet for Plugtest. */
    public static BtpPacket singleHopEmptyB(short destinationPort, short DestinationPortInfo) {
        Optional<Short>              emptySourcePort          = Optional.empty();
        Optional<TrafficClass>       emptyTrafficClass        = Optional.empty();
        Optional<LongPositionVector> emptySenderPosition      = Optional.empty();

        return new BtpPacket(
                emptySourcePort,
                destinationPort,
                Optional.of(DestinationPortInfo),
                new byte[] {},
                Destination.singleHop(),
                emptyTrafficClass,
                emptySenderPosition
                );
    }

    public static BtpPacket customDestination(byte[] payload, short destinationPort,
            Destination destination) {
        Optional<Short>              emptySourcePort          = Optional.empty();
        Optional<Short>              emptyDestinationPortInfo = Optional.empty();
        Optional<TrafficClass>       emptyTrafficClass        = Optional.empty();
        Optional<LongPositionVector> emptySenderPosition      = Optional.empty();

        return new BtpPacket(
                emptySourcePort,
                destinationPort,
                emptyDestinationPortInfo,
                payload,
                destination,
                emptyTrafficClass,
                emptySenderPosition
                );
    }

    public Optional<Short>              sourcePort()           { return sourcePort;          }
    public short                        destinationPort()      { return destinationPort;     }
    public Optional<Short>              destinationPortInfo () { return destinationPortInfo; }
    public byte[]                       payload ()             { return payload.clone();     }  // Extra defensive here. Just in case.
    public Destination                  destination ()         { return destination;         }
    public Optional<TrafficClass>       trafficClass ()        { return trafficClass;        }
    public Optional<LongPositionVector> senderPosition ()      { return senderPosition;      }

    public byte[] asBytes() {
        if (gnPayload == null) {
            ByteBuffer buffer = ByteBuffer.allocate(HEADER_LENGTH + payload.length);
            gnPayload = putHeaderTo(buffer).put(payload).array();
        }
        return gnPayload;
    }

    private ByteBuffer putHeaderTo(ByteBuffer buffer) {
        return buffer.putShort(destinationPort)
                     .putShort(sourcePort.orElse(destinationPortInfo.orElse((short)0x00)));
    }

    public static BtpPacket fromGeonetData(GeonetData data) {
        ByteBuffer buffer = ByteBuffer.wrap(data.payload);
        Optional<Short>         sourcePort;
        short                   destinationPort;
        Optional<Short>         destinationPortInfo;
        switch (data.protocol) {
            case BTP_A:
            case BTP_B: {  // Carries the source and the destination port.
                boolean isA = data.protocol == UpperProtocolType.BTP_A;
                Optional<Short> emptyPort = Optional.empty();
                destinationPort = buffer.getShort();
                short port2 = buffer.getShort();
                sourcePort          = isA ? Optional.of(port2)  :         emptyPort;
                destinationPortInfo = isA ?           emptyPort : Optional.of(port2);
                byte[] btpPayload = Arrays.copyOfRange(data.payload, HEADER_LENGTH,
                        data.payload.length);
                return new BtpPacket(
                        sourcePort,
                        destinationPort,
                        destinationPortInfo,
                        btpPayload,
                        data.destination,
                        data.trafficClass,
                        data.sender
                        );
            }
            case ANY:
            case IPv6:
            default:
                throw new IllegalArgumentException("Unsupported BTP protocol: " + data.protocol);
        }
    }
}


text:
package io.gravitee.gateway.standalone.http;

import io.gravitee.gateway.standalone.AbstractWiremockGatewayTest;
import io.gravitee.gateway.standalone.junit.annotation.ApiDescriptor;
import org.apache.http.HttpResponse;
import org.apache.http.HttpStatus;
import org.apache.http.client.fluent.Request;
import org.junit.Test;

import static org.junit.Assert.assertTrue;

/**
 * @author David BRASSELY (david.brassely at graviteesource.com)
 * @author GraviteeSource Team
 */
@ApiDescriptor("/io/gravitee/gateway/standalone/http/connect-timeout.json")
public class ConnectionTimeoutTest extends AbstractWiremockGatewayTest {

    @Test
    public void call_unreachable_api() throws Exception {
        HttpResponse response = Request.Post("http://localhost:8082/unreachable").execute().returnResponse();

        assertTrue(response.getStatusLine().getStatusCode() == HttpStatus.SC_GATEWAY_TIMEOUT
                    || response.getStatusLine().getStatusCode() == HttpStatus.SC_BAD_GATEWAY);
    }
}


text:
import type { FC } from 'react'
import React, { useEffect, useState } from 'react'
import {
  DataTable,
  DataTableItem,
  DataTableAction,
  DataTableCell,
  Pagination,
} from '@looker/components'
import { TextSnippet } from '@styled-icons/material-outlined/TextSnippet'
import { Create } from '@styled-icons/material-outlined/Create'
import { useSelector, useDispatch } from 'react-redux'
import { useHistory } from 'react-router-dom'
import type { IJudgingProps } from '../../../models'
import { sheetCell } from '../../../models'
import {
  getHackerState,
  getJudgingsHeadings,
} from '../../../data/hack_session/selectors'
import {
  getJudgingsRequest,
  updateJudgingsPageNum,
} from '../../../data/judgings/actions'
import {
  getJudgingsState,
  getJudgingsPageNumState,
} from '../../../data/judgings/selectors'
import { canDoJudgingAction } from '../../../utils'
import { PAGE_SIZE } from '../../../constants'
import { JudgingViewDialog } from '../../JudgingEditorScene'

interface JudgingListProps {}

export const JudgingList: FC<JudgingListProps> = () => {
  const dispatch = useDispatch()
  const history = useHistory()
  const columns = useSelector(getJudgingsHeadings)
  const hacker = useSelector(getHackerState)
  const judgings = useSelector(getJudgingsState)
  const currentPage = useSelector(getJudgingsPageNumState)
  const [currentJudging, setCurrentJudging] = useState<
    IJudgingProps | undefined
  >(undefined)

  useEffect(() => {
    dispatch(getJudgingsRequest())
  }, [dispatch])

  const updatePage = (pageNum: number) => {
    dispatch(updateJudgingsPageNum(pageNum))
  }

  const viewJudging = (judging: IJudgingProps) => {
    setCurrentJudging(judging)
  }

  const closeView = () => {
    setCurrentJudging(undefined)
  }

  const showJudging = (judgingId: string) => {
    setTimeout(() => {
      history.push(`/judging/${judgingId}`)
    })
  }

  const actions = (judging: IJudgingProps) => {
    return (
      <>
        <DataTableAction
          onClick={viewJudging.bind(null, judging)}
          icon={<TextSnippet />}
        >
          View Judging
        </DataTableAction>
        {canDoJudgingAction(hacker, judging) && (
          <DataTableAction
            onClick={showJudging.bind(null, judging._id)}
            icon={<Create />}
            itemRole="link"
          >
            Update Judging
          </DataTableAction>
        )}
      </>
    )
  }

  const totalPages = Math.ceil(judgings.length / PAGE_SIZE)

  const startIdx = (currentPage - 1) * PAGE_SIZE
  const rows = judgings
    .slice(startIdx, startIdx + PAGE_SIZE)
    .map((judging, idx) => (
      <DataTableItem key={idx} id={idx.toString()} actions={actions(judging)}>
        {columns.map((column) => (
          <DataTableCell key={`${idx}.${column.id}`}>
            {sheetCell(judging[column.id])}
          </DataTableCell>
        ))}
      </DataTableItem>
    ))

  return (
    <>
      <DataTable columns={columns} caption="List of hackathon judges">
        {rows}
      </DataTable>
      <Pagination
        current={currentPage}
        pages={totalPages}
        onChange={updatePage}
      />
      <JudgingViewDialog judging={currentJudging} onClose={closeView} />
    </>
  )
}


text:
{% extends "header.html" %}
{% import "bootstrap/wtf.html" as wtf %}

{% block title %}Search{% endblock title %}

{% block content %}
{{ super() }}
{{ wtf.quick_form(form, form_type="horizontal", horizontal_columns=('sm', 2, 5)) }}

{% endblock content %}


text:
<?xml version="1.0" encoding="UTF-8"?>
<project xmlns="http://www.netbeans.org/ns/project/1">
    <type>org.netbeans.modules.web.clientproject</type>
    <configuration>
        <data xmlns="http://www.netbeans.org/ns/clientside-project/1">
            <name>OkikoShop</name>
        </data>
    </configuration>
</project>


text:
title:  Jeesus, Uuden Liiton Välittäjä
date:  12/02/2022
---

>

> "Mutta meidän ylipappimme on saanut paljon tärkeämmän tehtävän, yhtä paljon tärkeämmän kuin on se liitto, jonka välittäjä hän on. Se liitto on suurempi, koska se perustuu suurempiin lupauksiin." (Hepr. 8:6.)

### Avaintekstit
Hepr. 7:11–19;  Hepr. 8:10–12;  Jer. 31:31–34;  Hepr. 8:1–6;  2. Moos. 24:1–8;  Hes. 36:26, 27.

Elämällä täydellisen elämän ja sitten kuolemalla meidän sijastamme Jeesus välitti uuden, paremman liiton meidän ja Jumalan välille. Kuolemansa kautta Jeesus perui kuolemanrangaistuksen, jota meidän rikkomuksemme vaati, ja mahdollisti uuden liiton.

Tämä totuus selitetään meille Hepr. 10:5–10, jossa Jeesus tunnistetaan henkilöksi, joka osoitti liiton vaatimaa täydellistä kuuliaisuutta. Siinä viitataan Psalmiin 40, jossa kuvataan Messiaan halua olla Jumalalle täysin kuuliainen: "Siksi minä sanoin: 'Nyt olen tullut, Herra. Kirjaan on kirjoitettu, mitä minun pitää tehdä. Jumalani, minä täytän mielelläni tahtosi, sinun lakisi on minun sydämessäni.'" (Ps. 40:8, 9.) "Alkuperäisessä asiayhteydessään tämä ilmaus ["täytän sinun tahtosi"] kuvasi moraalista kuuliaisuutta Jumalan tahdolle. Heprealaiskirjeen kirjoittaja käyttää ilmausta osoittaakseen, että Kristuksen uhri täytti Jumalan tahdon, koska se tarjosi hyväksyttävän sovituksen, jota eläinuhrit eivät olleet tarjonneet." (7BC 460.)

Paavalille tämä psalmi sai erityisen merkityksen Jeesuksen ihmiseksi tulon myötä. Jeesus oli uuden liiton kuuliaisuuden ruumiillistuma. Hän on meidän esimerkkimme. Meitä ei ole pelastettu ainoastaan hänen kuolemansa tähden vaan myös hänen täydellisen kuuliaisuutensa tähden.

19.2. Kristillisen kodin ja avioliiton päivä

_Tämä tutkistelu on sapatiksi 19.2.2022_


text:
*  快速创建类似各大新闻频道页效果

![IntroGif](https://github.com/peanutgao/YSChannelViewController/blob/master/introduce.gif?raw=true)


text:
package org.lnu.is.resource.publicactivity.award;

import java.text.MessageFormat;
import java.util.Date;

import javax.validation.constraints.Min;
import javax.validation.constraints.NotNull;

import org.lnu.is.annotation.ReferenceResource;
import org.lnu.is.resource.ApiResource;

/**
 * Public Activity Award resource.
 * @author ivanursul
 *
 */
@ReferenceResource
public class PublicActivityAwardResource extends ApiResource {

	@NotNull
	@Min(value = 1, message = "Minimal value is 1")
	private Long publicActivityId;

	@NotNull
	@Min(value = 1, message = "Minimal value is 1")
	private Long enrolmentSubjectId;

	@NotNull
	private String awardName;

	@NotNull
	private Double bonus;

	@NotNull
	private Date begDate;

	@NotNull
	private Date endDate;

	@Override
	public String getUri() {
		return MessageFormat.format("/publicactivities/{0}/awards/{1}", publicActivityId, getId());
	}

	@Override
	public String getRootUri() {
		return MessageFormat.format("/publicactivities/{0}/awards", publicActivityId);
	}

	public Long getPublicActivityId() {
		return publicActivityId;
	}

	public void setPublicActivityId(final Long publicActivityId) {
		this.publicActivityId = publicActivityId;
	}

	public Long getEnrolmentSubjectId() {
		return enrolmentSubjectId;
	}

	public void setEnrolmentSubjectId(final Long enrolmentSubjectId) {
		this.enrolmentSubjectId = enrolmentSubjectId;
	}

	public String getAwardName() {
		return awardName;
	}

	public void setAwardName(final String awardName) {
		this.awardName = awardName;
	}

	public Double getBonus() {
		return bonus;
	}

	public void setBonus(final Double bonus) {
		this.bonus = bonus;
	}

	public Date getBegDate() {
		return begDate;
	}

	public void setBegDate(final Date begDate) {
		this.begDate = begDate;
	}

	public Date getEndDate() {
		return endDate;
	}

	public void setEndDate(final Date endDate) {
		this.endDate = endDate;
	}

	@Override
	public int hashCode() {
		final int prime = 31;
		int result = super.hashCode();
		result = prime * result
				+ ((awardName == null) ? 0 : awardName.hashCode());
		result = prime * result + ((begDate == null) ? 0 : begDate.hashCode());
		result = prime * result + ((bonus == null) ? 0 : bonus.hashCode());
		result = prime * result + ((endDate == null) ? 0 : endDate.hashCode());
		result = prime
				* result
				+ ((enrolmentSubjectId == null) ? 0 : enrolmentSubjectId
						.hashCode());
		result = prime
				* result
				+ ((publicActivityId == null) ? 0 : publicActivityId.hashCode());
		return result;
	}

	@Override
	public boolean equals(final Object obj) {
		if (this == obj) {
			return true;
		}
		if (!super.equals(obj)) {
			return false;
		}
		if (getClass() != obj.getClass()) {
			return false;
		}
		PublicActivityAwardResource other = (PublicActivityAwardResource) obj;
		if (awardName == null) {
			if (other.awardName != null) {
				return false;
			}
		} else if (!awardName.equals(other.awardName)) {
			return false;
		}
		if (begDate == null) {
			if (other.begDate != null) {
				return false;
			}
		} else if (!begDate.equals(other.begDate)) {
			return false;
		}
		if (bonus == null) {
			if (other.bonus != null) {
				return false;
			}
		} else if (!bonus.equals(other.bonus)) {
			return false;
		}
		if (endDate == null) {
			if (other.endDate != null) {
				return false;
			}
		} else if (!endDate.equals(other.endDate)) {
			return false;
		}
		if (enrolmentSubjectId == null) {
			if (other.enrolmentSubjectId != null) {
				return false;
			}
		} else if (!enrolmentSubjectId.equals(other.enrolmentSubjectId)) {
			return false;
		}
		if (publicActivityId == null) {
			if (other.publicActivityId != null) {
				return false;
			}
		} else if (!publicActivityId.equals(other.publicActivityId)) {
			return false;
		}
		return true;
	}

	@Override
	public String toString() {
		return "PublicActivityAwardResource [publicActivityId="
				+ publicActivityId + ", enrolmentSubjectId="
				+ enrolmentSubjectId + ", awardName=" + awardName + ", bonus="
				+ bonus + ", begDate=" + begDate + ", endDate=" + endDate + "]";
	}

}


text:
<?php if(!defined('BASEPATH')) exit("No direct script ");

?>


text:
In Orchard, a widget is a fragment of UI (such as HTML) and code (such as a content part) that can be easily mapped to any location or zone in the active theme, such as a sidebar or footer zone.  Examples of widgets include navigation menus, image galleries, ads, videos, and tag clouds.

This article explains the basics of widgets and shows you how to manage them.

# Layers, Zones, and Widgets
In Orchard, you manage widgets by clicking **Widgets** in the dashboard. The **Widgets** screen lists the available widgets and lets you assign the widget to a _layer_ and a _zone_.

You can think of a _layer_ as a set of rules for displaying a widget (or group of widgets). For example, a layer might display a widget on a specific page only if the user is logged in. A _zone_ helps to position a widget on a page.

The following image shows the **Widgets** screen.

![](../Upload/screenshots_675/widgets_manage_1_675.png)

## Available Widgets
Whenever a widget becomes available (usually by enabling another feature in the **Features** tab on the **Modules** screen of the dashboard), Orchard adds it to the list of available widgets that can be added to zones in the current theme. To see the list of widgets available in a zone, in the **Widgets** screen, click the **Add** button on one of the listed zones.

For example, in the **Widgets** screen click **Add** for the **Header** zone. A screen is displayed that allows you to choose one of the available widgets.

![](../Upload/screenshots_675/widgets_choosewidget_675.png)

The following table describes the widgets that are available by default in Orchard:

Widget                | Description
--------------------- | ------------------------------------------------------------------
**Blog Archives**     | Displays a list of archived entries for the specified blog.
**Container Widget**  | Displays a "contained" content item, such as a list.
**Html Widget**       | Displays HTML content, which is entered using the widget's editor.
**Recent Blog Posts** | Displays a list of recent posts for the specified blog.

## List of Layers
Orchard comes with a number of layers already defined. You can define additional layers as needed, as discussed later in [Adding a Layer](Managing-widgets#AddingaLayer). In the **Widgets** screen, you can edit the existing layers by selecting a layer in the **Current Layer** drop-down list, or you can add new layers by clicking **Add a new layer**.

The following table lists the default layers, shows the rule that defines the layer, and describes the effect of the layer.

Layer          | Rule              | Description
-------------- | ----------------- | ---------------------------------------
Default        | true              | Always displayed on every page.
Authenticated  | authenticated     | Displayed if the user is authenticated.
Anonymous      | not authenticated | Displayed if the user is anonymous.
Disabled       | false             | Not displayed. This layer is provided as way to save the configuration of widgets that are not currently displayed.
TheHomepage    | url("~/")         | Displayed on the home page.

## List of Zones
In Orchard, a web page is divided into zones (regions). The available zones are defined by the website's theme. In the **Widgets** screen, you can see the list of all zones available for the currently selected layer. The list also shows the widgets assigned to each zone for the selected layer.

For information about the zones that are available in the default theme (TheThemeMachine), see [Customizing the Default Theme](Customizing-the-default-theme).

# Adding a Layer
To add a layer, in the dashboard, click **Widgets**. On the **Widgets** screen, click **Add a new layer**. The **Add Layer** screen is displayed:

![](../Upload/screenshots_675/widgets_AddLayer_1_675.png)

To define the new layer, enter the name of the layer, a description, and the rule that defines the layer. When you're finished, click **Save**.

The **Layer Rule** value is an expression that resolves to either **true** or **false**. If it resolves to **true**, the widget is displayed; otherwise the widget is not displayed. For all the available rules, and their syntax see [Using Rules to conditionally display content](Using-Rules-to-conditionally-display-content)

# Assigning a Widget to a Zone
To assign a widget to a zone, click the **Add** button on a zone that you want to add the widget to, and then select the widget to add.

For example, click **Add** on the Header zone, and then in the **Choose A Widget** screen click the **Html Widget**.

The **Add A Widget** screen is displayed.

![](../Upload/screenshots_675/widgets_AddZone_1_675.png)

The fields you need to fill in depend on the widget you're configuring. However, all widgets have **Zone**, **Layer**, **Title**, and **Position** fields. The **Position** field determines the relative position of all widgets within the zone (in effect, z-order). Keep in mind that the widgets within the zone can come from multiple layers. For example, two different layers might have widgets assigned to the same zone.

The value of the **Position** field can be an integer or a sequence of integers separated by dots. For example, the following values are all valid: 5, 10.1, 7.5.3.1. Widgets with lower position values will be rendered before those with higher values.

After setting the values of all fields, click **Save**.

# Editing or Deleting a Widget
To edit or delete a widget, in the **Widgets** screen, use the **Current Layer** drop-down list to select the layer that the widget is assigned to. In the list of zones displayed for the layer, click the widget you want to edit. The **Edit Widget** screen is displayed:

![](../Upload/screenshots_675/widgets_Delete_1_675.png)

Edit the field you want to change, then click **Save**. To remove the widget from the zone, click **Delete**.

### Change History
* Updates for Orchard 1.1
    * 3-16-11: Updated screen shots for 1.1 version.
* Updates for Orchard 1.7
    * 4-4-14: Added Content Type rule


text:
package com.google.zxing.pdf417.decoder;

import com.google.zxing.NotFoundException;
import com.google.zxing.ResultPoint;
import com.google.zxing.common.BitMatrix;

/**
 * @author Guenther Grau
 */
final class BoundingBox {

  private BitMatrix image;
  private ResultPoint topLeft;
  private ResultPoint bottomLeft;
  private ResultPoint topRight;
  private ResultPoint bottomRight;
  private int minX;
  private int maxX;
  private int minY;
  private int maxY;

  BoundingBox(BitMatrix image,
              ResultPoint topLeft,
              ResultPoint bottomLeft,
              ResultPoint topRight,
              ResultPoint bottomRight) throws NotFoundException {
    if ((topLeft == null && topRight == null) ||
        (bottomLeft == null && bottomRight == null) ||
        (topLeft != null && bottomLeft == null) ||
        (topRight != null && bottomRight == null)) {
      throw NotFoundException.getNotFoundInstance();
    }
    init(image, topLeft, bottomLeft, topRight, bottomRight);
  }

  BoundingBox(BoundingBox boundingBox) {
    init(boundingBox.image, boundingBox.topLeft, boundingBox.bottomLeft, boundingBox.topRight, boundingBox.bottomRight);
  }

  private void init(BitMatrix image,
                    ResultPoint topLeft,
                    ResultPoint bottomLeft,
                    ResultPoint topRight,
                    ResultPoint bottomRight) {
    this.image = image;
    this.topLeft = topLeft;
    this.bottomLeft = bottomLeft;
    this.topRight = topRight;
    this.bottomRight = bottomRight;
    calculateMinMaxValues();
  }

  static BoundingBox merge(BoundingBox leftBox, BoundingBox rightBox) throws NotFoundException {
    if (leftBox == null) {
      return rightBox;
    }
    if (rightBox == null) {
      return leftBox;
    }
    return new BoundingBox(leftBox.image, leftBox.topLeft, leftBox.bottomLeft, rightBox.topRight, rightBox.bottomRight);
  }

  BoundingBox addMissingRows(int missingStartRows, int missingEndRows, boolean isLeft) throws NotFoundException {
    ResultPoint newTopLeft = topLeft;
    ResultPoint newBottomLeft = bottomLeft;
    ResultPoint newTopRight = topRight;
    ResultPoint newBottomRight = bottomRight;

    if (missingStartRows > 0) {
      ResultPoint top = isLeft ? topLeft : topRight;
      int newMinY = (int) top.getY() - missingStartRows;
      if (newMinY < 0) {
        newMinY = 0;
      }
      // TODO use existing points to better interpolate the new x positions
      ResultPoint newTop = new ResultPoint(top.getX(), newMinY);
      if (isLeft) {
        newTopLeft = newTop;
      } else {
        newTopRight = newTop;
      }
    }

    if (missingEndRows > 0) {
      ResultPoint bottom = isLeft ? bottomLeft : bottomRight;
      int newMaxY = (int) bottom.getY() + missingEndRows;
      if (newMaxY >= image.getHeight()) {
        newMaxY = image.getHeight() - 1;
      }
      // TODO use existing points to better interpolate the new x positions
      ResultPoint newBottom = new ResultPoint(bottom.getX(), newMaxY);
      if (isLeft) {
        newBottomLeft = newBottom;
      } else {
        newBottomRight = newBottom;
      }
    }

    calculateMinMaxValues();
    return new BoundingBox(image, newTopLeft, newBottomLeft, newTopRight, newBottomRight);
  }

  private void calculateMinMaxValues() {
    if (topLeft == null) {
      topLeft = new ResultPoint(0, topRight.getY());
      bottomLeft = new ResultPoint(0, bottomRight.getY());
    } else if (topRight == null) {
      topRight = new ResultPoint(image.getWidth() - 1, topLeft.getY());
      bottomRight = new ResultPoint(image.getWidth() - 1, bottomLeft.getY());
    }

    minX = (int) Math.min(topLeft.getX(), bottomLeft.getX());
    maxX = (int) Math.max(topRight.getX(), bottomRight.getX());
    minY = (int) Math.min(topLeft.getY(), topRight.getY());
    maxY = (int) Math.max(bottomLeft.getY(), bottomRight.getY());
  }

  void setTopRight(ResultPoint topRight) {
    this.topRight = topRight;
    calculateMinMaxValues();
  }

  void setBottomRight(ResultPoint bottomRight) {
    this.bottomRight = bottomRight;
    calculateMinMaxValues();
  }

  int getMinX() {
    return minX;
  }

  int getMaxX() {
    return maxX;
  }

  int getMinY() {
    return minY;
  }

  int getMaxY() {
    return maxY;
  }

  ResultPoint getTopLeft() {
    return topLeft;
  }

  ResultPoint getTopRight() {
    return topRight;
  }

  ResultPoint getBottomLeft() {
    return bottomLeft;
  }

  ResultPoint getBottomRight() {
    return bottomRight;
  }

}


text:
module LiveScript
  module Source
    VERSION = '1.4.0.rc.1'
  end
end


text:
export default class JWTAuthService{

  constructor(){
    this.http = null;
  }

  setHttp(http){
    this.http = http;
  }

  createUser(user){
    return this.http({
      method: 'POST',
      url: '/auth/user',
      data: user
    })
    .then(function(res){
      localStorage.setItem('clusterpost_token', res.data.token);
    });
  }

  getUsers(){
    return this.http({
        method: 'GET',
        url: '/auth/users'
      });
  }

  getUser(){
    return this.http.get('/auth/user')
    .then(function(res){
      var user = res.data;
      return user;
    });
  }

  deleteSelf(){
    return this.http({
      method: 'DELETE',
      url: '/auth/user'
    });
  }

  login(user){
    return this.http({
      method: 'POST',
      url: '/auth/login',
      data: user
    })
    .then(function(res){
      localStorage.setItem('clusterpost_token', res.data.token)
      return true;
    });
  }

  updatePassword(password, token){
    return this.http({
      method: 'PUT',
      url: '/auth/login',
      data: password,
      headers: {
        authorization: "Bearer " + token
      }
    })
    .then(function(res){
      localStorage.setItem('clusterpost_token', res.data.token);
    });
  }

  sendRecoverPassword(email){
     return this.http({
      method: 'POST',
      url: '/auth/reset',
      data: email
    });
  }

  logout(){
    localStorage.removeItem('clusterpost_token');
    return Promise.resolve();
  }

  updateUser(user){
    return this.http({
      method: 'PUT',
      url: '/auth/users',
      data: user
    });
  }

  updateSelf(user){
    return this.http({
      method: 'PUT',
      url: '/auth/user',
      data: user
    });
  }

  deleteUser(user){
    return this.http({
      method: 'DELETE',
      url: '/auth/users',
      data: user
    });
  }

  getScopes(){
    return this.http({
      method: 'GET',
      url: '/auth/scopes'
    });
  }

  updateScopes(scopes){
    return this.http({
      method: 'PUT',
      url: '/auth/scopes',
      data: scopes
    });
  }
}


text:
namespace CivGen
{
    using System;
    using System.Collections.Generic;

    public partial class ModifierArgument
    {
        public string ModifierId { get; set; }
        public string Name { get; set; }
        public string Type { get; set; }
        public string Value { get; set; }
        public string Extra { get; set; }

        public virtual Modifier Modifier { get; set; }
    }
}


text:
Slides down a dialog that does not lock entire page.

    message(where, [options])

        where
        object, where to display

        options
        object, optional, additional parametes

Return a promise that is resolved when message is displayed.

This method is used internally to show message in w2grid and w2form. It will lock the content of specified div and will slide down a message. First argument where is a object of the following structure

<textarea class="javascript">
{
    box   : null,  // html element where it will display message
    path  : null,  // path to a w2ui object that is locked
    title : null,  // css selector for a title (if any)
    body  : null   // css selector for a body
 }
</textarea>

For example, in w2grid it is called in the following way

<textarea class="javascript">
w2utils.message.call(this, {
    box   : this.box,
    path  : 'w2ui.' + this.name,
    title : '.w2ui-grid-header:visible',
    body  : '.w2ui-grid-box'
}, options);
</textarea>

The second argument options is the same as for w2popup.message() method and can have following options

<textarea class="javascript">
options: {
    html        : '',    // html of the message
    body        : '',    // similar to body in w2popup, can be used instead of options.html
    buttons     : '',    // similar to buttons in w2popup, can be used instead of options.html
    width       : 10,    // width in px (if negative, then it is 100% of popup in message.width)
    height      : 10,    // height in px (if negative, then it is 100% of popup in message.height)
    hideOnClick : false, // if true, hide message if user clicks on it
    onOpen      : null,  // function to execute when message opens
    onClose     : null   // function to execute when message closes
}
</textarea>


text:
var baseAt = require('./_baseAt'),
    flatRest = require('./_flatRest');

/**
 * Creates an array of values corresponding to `paths` of `object`.
 *
 * @static
 * @memberOf _
 * @since 1.0.0
 * @category Object
 * @param {Object} object The object to iterate over.
 * @param {...(string|string[])} [paths] The property paths to pick.
 * @returns {Array} Returns the picked values.
 * @example
 *
 * var object = { 'a': [{ 'b': { 'c': 3 } }, 4] };
 *
 * _.at(object, ['a[0].b.c', 'a[1]']);
 * // => [3, 4]
 */
var at = flatRest(baseAt);

module.exports = at;


text:
package me.teklad.plugin;

import org.bukkit.command.Command;
import org.bukkit.command.CommandExecutor;
import org.bukkit.command.CommandSender;
import org.bukkit.entity.Player;

import net.md_5.bungee.api.ChatColor;

public class CommandSAListener implements CommandExecutor {

	public void cmdSellAll(CommandSender s) {
		Player p = (Player) s;
		SellAll.sellAllItems(p);
	}

	@Override
	public boolean onCommand(CommandSender s, Command cmd, String label, String[] args) {
		if (args.length > 0) {
			s.sendMessage(Util.encodeColors("&6Usage:&f /sellall"));
			return true;
		}
		if (!(s instanceof Player)) {
			s.sendMessage(ChatColor.YELLOW + String.format("[%s] This command is meant for players only.",
					SellAll.getInstance().getDescription().getName()));
			return true;
		}
		cmdSellAll(s);
		return true;
	}

}


text:
layout: default
description: ArangoDB Server Options
---
ArangoDB Server Options
=======================

Usage: `arangod [<options>]`

The database directory can be specified as positional (unnamed) first parameter:

    arangod /path/to/datadir

Or explicitly as named parameter:

    arangod --database.directory /path/to/datadir

All other parameters need to be passed as named parameters.
That is two hyphens followed by the option name, an equals sign or a space and
finally the parameter value. The value needs to be wrapped in double quote marks
if the value contains whitespace. Extra whitespace around `=` is allowed:

    arangod --database.directory = "/path with spaces/to/datadir"

See [Configuration](administration-configuration.html)
if you want to translate startup parameters to configuration files
or learn more about startup options in general.

See
[Fetch Current Configuration Options](administration-configuration.html#fetch-current-configuration-options)
if you want to query the `arangod` server for the current settings at runtime.

{% assign optionsFile = page.version.version | remove: "." | append: "-program-options-arangod" -%}
{% assign options = site.data[optionsFile] -%}
{% include program-option.html options=options name="arangod" %}


text:
package org.fluentjava.iwant.embedded;

import java.io.File;

import org.fluentjava.iwant.api.core.HelloTarget;
import org.fluentjava.iwant.testarea.TestArea;

import junit.framework.TestCase;

public class AsEmbeddedIwantUserTest extends TestCase {

	private TestArea testArea;
	private File cacheDir;
	private File wsRoot;

	@Override
	public void setUp() {
		testArea = TestArea.forTest(this);
		wsRoot = testArea.newDir("wsRoot");
		cacheDir = testArea.newDir("cached");
	}

	private static void assertFile(File expected, File actual) {
		assertEquals(expected.getAbsolutePath(), actual.getAbsolutePath());
	}

	public void testHelloAsPath() {
		File cached = AsEmbeddedIwantUser.with().workspaceAt(wsRoot)
				.cacheAt(cacheDir).iwant()
				.target(new HelloTarget("hello", "hello message")).asPath();

		assertFile(new File(cacheDir, "target/hello"), cached);
		assertEquals("hello message", testArea.contentOf(cached));
	}

}


text:
using System.Collections.Generic;
using System.Collections.Specialized;
using NUnit.Framework;
using StructureMap.Configuration.Xml;
using StructureMap.Pipeline;
using StructureMap.Testing;
using StructureMap.Testing.Pipeline;
using StructureMap.Xml.Testing.TestData;

namespace StructureMap.Xml.Testing
{
    [TestFixture]
    public class DictionaryReaderTester
    {
        [Test]
        public void Can_process_a_dictionary()
        {
            var reader = new DictionaryReader();
            reader.CanProcess(typeof (IDictionary<string, string>)).ShouldBeTrue();
            reader.CanProcess(typeof (IDictionary<int, string>)).ShouldBeTrue();
            reader.CanProcess(typeof (IDictionary<string, int>)).ShouldBeTrue();
            reader.CanProcess(typeof (Dictionary<string, string>)).ShouldBeTrue();
            reader.CanProcess(typeof (Dictionary<int, string>)).ShouldBeTrue();
            reader.CanProcess(typeof (Dictionary<string, int>)).ShouldBeTrue();
        }

        [Test]
        public void Can_process_NameValueCollection()
        {
            new DictionaryReader().CanProcess(typeof (NameValueCollection)).ShouldBeTrue();
        }

        [Test]
        public void Read_a_string_int_dictionary2()
        {
            string xml =
                @"
<node>
    <Pair Key='color' Value='1'/>
    <Pair Key='state' Value='2'/>
    <Pair Key='direction' Value='3'/>
</node>
";

            Instance instance = new DictionaryReader().Read(DataMother.BuildDocument(xml).DocumentElement,
                                                            typeof (Dictionary<string, int>));
            instance.ShouldBeOfType(typeof (SerializedInstance));

            var collection =
                (Dictionary<string, int>) instance.Build(typeof (Dictionary<string, int>), new StubBuildSession());

            collection["color"].ShouldEqual(1);
            collection["state"].ShouldEqual(2);
            collection["direction"].ShouldEqual(3);
        }

        [Test]
        public void Read_a_string_string_dictionary()
        {
            string xml =
                @"
<node>
    <Pair Key='color' Value='red'/>
    <Pair Key='state' Value='texas'/>
    <Pair Key='direction' Value='north'/>
</node>
";

            Instance instance = new DictionaryReader().Read(DataMother.BuildDocument(xml).DocumentElement,
                                                            typeof (IDictionary<string, string>));
            instance.ShouldBeOfType(typeof (SerializedInstance));

            var collection =
                (IDictionary<string, string>)
                instance.Build(typeof (IDictionary<string, string>), new StubBuildSession());

            collection["color"].ShouldEqual("red");
            collection["state"].ShouldEqual("texas");
            collection["direction"].ShouldEqual("north");
        }

        [Test]
        public void Read_a_string_string_dictionary2()
        {
            string xml =
                @"
<node>
    <Pair Key='color' Value='red'/>
    <Pair Key='state' Value='texas'/>
    <Pair Key='direction' Value='north'/>
</node>
";

            Instance instance = new DictionaryReader().Read(DataMother.BuildDocument(xml).DocumentElement,
                                                            typeof (Dictionary<string, string>));
            instance.ShouldBeOfType(typeof (SerializedInstance));

            var collection =
                (Dictionary<string, string>) instance.Build(typeof (Dictionary<string, string>), new StubBuildSession());

            collection["color"].ShouldEqual("red");
            collection["state"].ShouldEqual("texas");
            collection["direction"].ShouldEqual("north");
        }

        [Test]
        public void Read_an_instance_for_NameValueCollection()
        {
            string xml =
                @"
<node>
    <Pair Key='color' Value='red'/>
    <Pair Key='state' Value='texas'/>
    <Pair Key='direction' Value='north'/>
</node>
";

            Instance instance = new DictionaryReader().Read(DataMother.BuildDocument(xml).DocumentElement,
                                                            typeof (NameValueCollection));
            instance.ShouldBeOfType(typeof (SerializedInstance));

            var collection = (NameValueCollection) instance.Build(typeof (NameValueCollection), new StubBuildSession());

            collection["color"].ShouldEqual("red");
            collection["state"].ShouldEqual("texas");
            collection["direction"].ShouldEqual("north");
        }

        [Test]
        public void Read_an_int_string_dictionary()
        {
            string xml =
                @"
<node>
    <Pair Key='1' Value='red'/>
    <Pair Key='2' Value='texas'/>
    <Pair Key='3' Value='north'/>
</node>
";

            Instance instance = new DictionaryReader().Read(DataMother.BuildDocument(xml).DocumentElement,
                                                            typeof (IDictionary<int, string>));
            instance.ShouldBeOfType(typeof (SerializedInstance));

            var collection =
                (IDictionary<int, string>) instance.Build(typeof (IDictionary<int, string>), new StubBuildSession());

            collection[1].ShouldEqual("red");
            collection[2].ShouldEqual("texas");
            collection[3].ShouldEqual("north");
        }
    }
}


text:
package com.toncent.security.repository;

import com.toncent.security.domain.Role;
import org.springframework.data.repository.CrudRepository;
import org.springframework.stereotype.Repository;

/**
 * AUTHOR: 819521
 * DATE  : 2016/2/4
 * TIME  : 11:27
 */
@Repository
public interface RoleRepository extends CrudRepository<Role, Long> {
}


text:
<?php
namespace Ixudra\Validation;

class CoordinateValidationTraitTest extends \PHPUnit_Framework_TestCase {

    protected $validator;

    public function setUp()
    {
        $this->validator = $this->getObjectForTrait('\Ixudra\Validation\CoordinateValidationTrait');
    }

    /**
     * @covers CoordinateValidationTrait::validateWorldCoordinate()
     */
    public function testValidateWorldCoordinate()
    {
        $this->assertTrue( $this->validator->validateWorldCoordinate(null, '50.135209', null) );
    }

    /**
     * @covers CoordinateValidationTrait::validateWorldCoordinate()
     */
    public function testValidateWorldCoordinate_returnsFalseIfCoordinateIsTooPrecise()
    {
        $this->assertFalse( $this->validator->validateWorldCoordinate(null, '50.1352393', null) );
    }

    /**
     * @covers CoordinateValidationTrait::validateWorldCoordinate()
     */
    public function testValidateWorldCoordinate_returnsFalseIfCoordinateIsNotPreciseEnough()
    {
        $this->assertFalse( $this->validator->validateWorldCoordinate(null, '50.1', null) );
    }

}


text:
module.exports = (function (){
    var CollisionDetector = function(clients) {
        this.clients = clients;
        for(var i = 0; i < clients.length; i++) {
            if(i !== 0) clients[i].prev = clients[i - 1];
            if(i !== clients.length) clients[i].next = clients[i + 1];
        }
        this.front = null;
        if(clients.length !== 0) this.front = clients[0].player;
    };

    CollisionDetector.prototype.detectAttackRadius = function(center, radius) {
        this.sort(); /* this should be nearly sorted */
        var minx = center.x - radius;
        var maxx = center.x + radius;

        var collided = [];
        var search = this.front;
        while(search !== null) {
            if(search.hitbox.x > maxx) break;
            else if((search.hitbox.x + search.hitbox.width > minx) || (search.hitbox.x > minx && search.hitbox.x < maxx)) {
                collided.push(search.client.id);
            }
            search = search.next;
        }

        return collided;
    };

    CollisionDetector.prototype.sort = function() {
        if(this.front === null) return;

        var node = this.front;
        node = node.next;
        this.front.next = null;

        while(node !== null) {
            var current = node;
            node = node.next;

            if(current.hitbox.x < this.front.hitbox.x) {
                current.next = this.front;
                this.front = current;
            } else {
                var search = this.front;
                while(search.next !== null && search.next.hitbox.x < current.hitbox.x) {
                    search = search.next;
                }
                current.next = search.next;
                search.next = current;
            }
        }
    };

    CollisionDetector.prototype.removeClient = function(client) {
        this.clients.splice(this.clients.indexOf(client), 1); //TODO defensive code
        if(client.player.prev !== null) {
            client.player.prev.next = client.player.next;
            client.player.prev = null;
        }
        if(client.player.next !== null) {
            client.player.next.prev = client.player.prev;
            client.player.next = null;
        }
    };

    CollisionDetector.prototype.addClient = function(client) {
        if(this.clients.length > 0) {
            this.clients[this.clients.length - 1].player.next = client.player;
            client.player.prev = this.clients[this.clients.length - 1].player;
        } else {
            this.front = client.player;
        }
        this.clients.push(client);
    };

    return CollisionDetector;
})();


text:
describe MeteorMotion::Client do

	before do
		@client = MeteorMotion::Client.new
		@client.connect
		wait 1.5 do
		end
	end

	describe 'Collections' do
		it 'adds and removes collections' do
			@client.add_collection('books')
			@client.collections['books'].should.not.be.equal nil

			@client.remove_collection('books')
			@client.collections['books'].should.be.equal nil
		end
	end

	describe 'Subscriptions' do
		it 'adds and removes subscriptions' do
			id = @client.subscribe('books')
			@client.subscriptions[id].should.not.be.equal nil

			wait 1.0 do
				@client.unsubscribe(id)
				@client.subscriptions[id].should.be.equal nil
			end
		end
	end

	describe 'Method calls' do

		def handler action, result
			@called << action
		end

		before do
			@called = []
		end

		it 'calls the specified callback when called' do
			@client.call('ping', self.method(:handler) )

			wait 1.0 do
				@called.include?(:result).should.be.equal true
			end
		end

		it 'calls the provided handler with an error when a call fails' do
			@client.call('some_method', self.method(:handler) )

			wait 1.0 do
				@called.include?(:error).should.be.equal true
			end
		end

		it 'removes a callback after both replies have been received' do
			@client.call('ping', self.method(:handler) )

			@client.method_callbacks.size.should.be.equal 1

			wait 1.0 do
				@client.method_callbacks.size.should.be.equal 0
			end
		end
	end

	describe 'Authentication with username' do

		def login_handler action, result
			@action = action
			@result = result
		end

		it 'logins successfully with a correct u/p combo' do
			@client.login_with_username('user', 'pass', self.method(:login_handler))

			wait 3.0 do
				@action.should == :success
			end
		end

		it 'fails to login with an invalid username' do
			@client.login_with_username('no_such_user', 'pass', self.method(:login_handler))

			wait 2.0 do
				@action.should == :error
				@result[:reason].should == 'User not found'
			end
		end

		it 'fails to login with an incorrect password' do
			@client.login_with_username('user', 'wrong_pass', self.method(:login_handler))

			wait 3.0 do
				@action.should == :error
				@result[:reason].should == 'Incorrect password'
			end
		end

	end

end


text:
package lcf.weather;

import lcf.clock.R;
import android.content.Context;

abstract public class WeatherUnits {
	public enum TemperatureUnits {
		Celsius, Fahrenheit
	}

	public enum HumidityUnits {
		Percent
	}

	public enum PressureUnits {
		hPa, mmHg, inHg
	}

	public enum SpeedUnits {
		MetersPS, MilesPH
	}

	public enum PrecipitationUnits {
		MM
	}

	private static TemperatureUnits gTemperatureUnits = TemperatureUnits.Celsius;
	private static HumidityUnits gHumidityUnits = HumidityUnits.Percent;
	private static PressureUnits gPressureUnits = PressureUnits.hPa;
	private static SpeedUnits gSpeedUnits = SpeedUnits.MetersPS;
	private static PrecipitationUnits gPrecipitationUnits = PrecipitationUnits.MM;

	private static Context mContext = null;

	public static void setResourceContext(Context context) {
		mContext = context;
	}

	private static String getString(int resId) {
		if (mContext == null) {
			throw new RuntimeException(
					"set context by setResourceContext before using WeatherUnits");
		}
		return mContext.getResources().getString(resId);
	}

	static float getTemperatureInUnits(float temperatureCelsius) {
		switch (gTemperatureUnits) {
		case Celsius:
			return temperatureCelsius;
			/*case KelvinS:
				return temperatureCelsius + 273.15f;*/
		case Fahrenheit:
			return temperatureCelsius * 9.0f / 5.0f + 32;
		}
		return Float.NaN;
	}

	static float getHumidityInUnits(float humidityPercent) {
		switch (gHumidityUnits) {
		case Percent:
			return humidityPercent;
		}
		return Float.NaN;
	}

	static float getPressureInUnits(float pressureHPa) {
		switch (gPressureUnits) {
		case hPa:
			return pressureHPa;
		case inHg:
			return pressureHPa * 0.0295333727f;
		case mmHg:
			return pressureHPa * 0.750061683f;
		}
		return Float.NaN;
	}

	static float getSpeedInUnits(float speedMeterPS) {
		switch (gSpeedUnits) {
		case MetersPS:
			return speedMeterPS;
		case MilesPH:
			return speedMeterPS * 2.23693629f;
		}
		return Float.NaN;
	}

	public static String getTemperatureUnitsString(TemperatureUnits unit) {
		switch (unit) {
		case Celsius:
			return getString(R.string.Celsius);
			/*case KelvinS:
				return getString(R.string.KelvinS);*/
		case Fahrenheit:
			return getString(R.string.Fahrenheit);
		}
		return getString(R.string.Unknown);
	}

	public static String getTemperatureUnitsString() {
		return getTemperatureUnitsString(gTemperatureUnits);
	}

	public static float getPrecipitationInUnits(float precipitationMM) {
		switch (gPrecipitationUnits) {
		case MM:
			return precipitationMM;
		}
		return Float.NaN;
	}

	public static String getHumidityUnitsString(HumidityUnits unit) {
		switch (unit) {
		case Percent:
			return getString(R.string.percent);
		}
		return getString(R.string.Unknown);
	}

	public static String getHumidityUnitsString() {
		return getHumidityUnitsString(gHumidityUnits);
	}

	public static String getPressureUnitsString(PressureUnits unit) {
		switch (unit) {
		case hPa:
			return getString(R.string.hPa);
		case inHg:
			return getString(R.string.inHg);
		case mmHg:
			return getString(R.string.mmHg);
		}
		return getString(R.string.Unknown);
	}

	public static String getPressureUnitsString() {
		return getPressureUnitsString(gPressureUnits);
	}

	public static String getSpeedUnitsString() {
		return getSpeedUnitsString(gSpeedUnits);
	}

	public static String getSpeedUnitsString(SpeedUnits unit) {
		switch (unit) {
		case MetersPS:
			return getString(R.string.MetersPS);
		case MilesPH:
			return getString(R.string.MilesPH);
		}
		return getString(R.string.Unknown);
	}

	public static String getPrecipitationUnitsString(int periodHours) {
		return getPrecipitationUnitsString(gPrecipitationUnits, periodHours);
	}

	public static String getPrecipitationUnitsString(PrecipitationUnits unit,
			int periodHours) {
		switch (unit) {
		case MM:
			return getString(R.string.mm) + "/" + periodHours
					+ getString(R.string.h);
		}
		return getString(R.string.Unknown);
	}

	public static String getCloudValueUnitsString() {
		return getString(R.string.percent);
	}

	public static TemperatureUnits getTemperatureUnits() {
		return gTemperatureUnits;
	}

	public static void setTemperatureUnits(TemperatureUnits TemperatureUnits) {
		WeatherUnits.gTemperatureUnits = TemperatureUnits;
	}

	public static HumidityUnits getlHumidityUnits() {
		return gHumidityUnits;
	}

	public static void setHumidityUnits(HumidityUnits lHumidityUnits) {
		WeatherUnits.gHumidityUnits = lHumidityUnits;
	}

	public static PressureUnits getPressureUnits() {
		return gPressureUnits;
	}

	public static void setPressureUnits(PressureUnits lPressureUnits) {
		WeatherUnits.gPressureUnits = lPressureUnits;
	}

	public static SpeedUnits getSpeedUnits() {
		return gSpeedUnits;
	}

	public static void setSpeedUnits(SpeedUnits lSpeedUnits) {
		WeatherUnits.gSpeedUnits = lSpeedUnits;
	}

	public static PrecipitationUnits getPrecipitationUnits() {
		return gPrecipitationUnits;
	}

	public static void setPrecipitationUnits(
			PrecipitationUnits lPrecipitationUnits) {
		WeatherUnits.gPrecipitationUnits = lPrecipitationUnits;
	}

}


text:
@interface MadLibsViewController ()<MSPTouchableLabelDataSource, MSPTouchableLabelDelegate>

@property (weak, nonatomic) IBOutlet MSPTouchableLabel *touchableLabel;
@property (weak, nonatomic) IBOutlet UITextField *textField;

@property (nonatomic, strong) NSMutableArray* madLibTexts;
@property (nonatomic, strong) NSNumber* selectedIndex;

@end

@implementation MadLibsViewController

#pragma mark - UIViewController

- (void)viewDidLoad {
    [super viewDidLoad];

    self.touchableLabel.dataSource = self;
    self.touchableLabel.delegate = self;
    self.touchableLabel.font = [UIFont fontWithName:@"Helvetica" size:32.0f];

    self.textField.alpha = kMSPAlphaInvisible;

    self.madLibTexts = [NSMutableArray arrayWithArray:@[
                                                        kMSPMadLibBlankSpaceString,
                                                        @" and ",
                                                        kMSPMadLibBlankSpaceString,
                                                        @" love to ",
                                                        kMSPMadLibBlankSpaceString,
                                                        @" by the ",
                                                        kMSPMadLibBlankSpaceString,
                                                        @"."
                                                        ]];

    UITapGestureRecognizer* dismissKeyboardTap = [[UITapGestureRecognizer alloc] initWithTarget:self action:@selector(dismissKeyboard)];
    dismissKeyboardTap.cancelsTouchesInView = NO;
    [self.view addGestureRecognizer:dismissKeyboardTap];
}

- (void)viewWillAppear:(BOOL)animated {
    [super viewWillAppear:animated];

    [[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(textFieldDidChange:) name:@"UITextFieldTextDidChangeNotification" object:nil];
}

- (void)viewWillDisappear:(BOOL)animated {
    [super viewWillDisappear:animated];

    [[NSNotificationCenter defaultCenter] removeObserver:self];
}

#pragma mark - MSPTouchableLabelDataSource

- (NSArray*)textForTouchableLabel:(MSPTouchableLabel*)touchableLabel {
    return self.madLibTexts;
}

- (NSDictionary*)attributesForTouchableLabel:(MSPTouchableLabel*)touchableLabel atIndex:(NSInteger)index {
    if ([self madLibSpaceAtIndexIsEditable:index]) {
        return @{ NSForegroundColorAttributeName: [UIColor grayColor] };
    }

    return nil;
}

#pragma mark - MSPTouchableLabelDelegate

- (void)touchableLabel:(MSPTouchableLabel*)touchableLabel touchesDidEndAtIndex:(NSInteger)index {
    if ([self madLibSpaceAtIndexIsEditable:index]) {
        self.selectedIndex = @(index);

        NSString* startingText = self.madLibTexts[index];
        if ([startingText isEqualToString:kMSPMadLibBlankSpaceString]) {
            startingText = @"";
        }
        self.textField.text = startingText;

        [self showTextField];
    }
}

#pragma mark - Actions

- (void)textFieldDidChange:(NSNotification*)notification {
    NSString* newText = [self.textField.text stringByTrimmingCharactersInSet:[NSCharacterSet whitespaceAndNewlineCharacterSet]];

    if (newText.length == 0) {
        newText = kMSPMadLibBlankSpaceString;
    }

    self.madLibTexts[self.selectedIndex.integerValue] = newText;
    [self.touchableLabel setNeedsDisplay];
}

- (void)dismissKeyboard {
    [self hideTextField];
}

#pragma mark - ()

- (void)showTextField {
    [self.textField becomeFirstResponder];
    [UIView animateWithDuration:kMSPAnimationDuration animations:^{
        self.textField.alpha = kMSPAlphaVisible;
    }];
}

- (void)hideTextField {
    [self.textField resignFirstResponder];
    [UIView animateWithDuration:kMSPAnimationDuration animations:^{
        self.textField.alpha = kMSPAlphaInvisible;
    }];
}

- (BOOL)madLibSpaceAtIndexIsEditable:(NSInteger)index {
    return index % 2 == 0;
}

@end


text:
<?php
namespace AdminEspindola\Http\Controllers;

use Illuminate\Http\Request;

use AdminEspindola\Http\Requests;
use AdminEspindola\Perfil;
use AdminEspindola\Http\Controllers\Auth;
use AdminEspindola\User;
use DB;

class ProfileController extends Controller
{
    //CRIADO EM 05/07/2016 AS 18:42
    public function cadastre(Request $request){
    	if($request->ajax()){

    		$perfil = Perfil::create($request->all());

    		return response()->json(['mensagem' => "Sucesso: ".$request['profile_name']]);

    	}
    }

    public function edit_profile($id, Request $request)
    {
        //CRIADO EM 05/07/2016 AS 22:04

       // $id_profile = Profile::find($id);
    $id_user = Auth::user()->id;

    $edit_profile = User::where('user_id' ,  $id_user)->update(['id_profile' => $id]);

        if($edit_profile){
            return response()->json(['mensagem'=> 'success']);
        }

    }

    public function all_profile(Request $request)
    {
        //CRIADO EM 08/07/2016 as 17:37 by Junior Oliveira
        $profile = Perfil::all();

        $profile_present = DB::table('profile')
                        ->join('settings' , 'profile.profile_id' , '=', 'settings.settings_id_profile' )
                        ->get();

        return view('profile.edit_profile_proposal', compact('profile','profile_present' ));

    }

    public function edit_profile_proposal(Request $request)
    {
        # CRIADO EM 08/07/2016 AS 19:25
        if($request->ajax()){

            DB::table('settings')->where('settings_description','edit_profile_proposal')->update(['settings_id_profile' => $request['settings_id_profile']]);

            return response()->json(['mensagem' => 'success']);

        }
    }

}


text:
package admission

import (
	"io"
	"os"
	"sync"

	"github.com/GoogleCloudPlatform/kubernetes/pkg/client"
	"github.com/golang/glog"
)

// Factory is a function that returns a Interface for admission decisions.
// The config parameter provides an io.Reader handler to the factory in
// order to load specific configurations. If no configuration is provided
// the parameter is nil.
type Factory func(client client.Interface, config io.Reader) (Interface, error)

// All registered admission options.
var pluginsMutex sync.Mutex
var plugins = make(map[string]Factory)

// GetPlugins enumerates the
func GetPlugins() []string {
	pluginsMutex.Lock()
	defer pluginsMutex.Unlock()
	keys := []string{}
	for k := range plugins {
		keys = append(keys, k)
	}
	return keys
}

// RegisterPlugin registers a plugin Factory by name.  This
// is expected to happen during app startup.
func RegisterPlugin(name string, plugin Factory) {
	pluginsMutex.Lock()
	defer pluginsMutex.Unlock()
	_, found := plugins[name]
	if found {
		glog.Fatalf("Admission plugin %q was registered twice", name)
	}
	glog.V(1).Infof("Registered admission plugin %q", name)
	plugins[name] = plugin
}

// GetInterface creates an instance of the named plugin, or nil if
// the name is not known.  The error return is only used if the named provider
// was known but failed to initialize. The config parameter specifies the
// io.Reader handler of the configuration file for the cloud provider, or nil
// for no configuration.
func GetPlugin(name string, client client.Interface, config io.Reader) (Interface, error) {
	pluginsMutex.Lock()
	defer pluginsMutex.Unlock()
	f, found := plugins[name]
	if !found {
		return nil, nil
	}
	return f(client, config)
}

// InitPlugin creates an instance of the named interface
func InitPlugin(name string, client client.Interface, configFilePath string) Interface {
	var config *os.File

	if name == "" {
		glog.Info("No admission plugin specified.")
		return nil
	}

	if configFilePath != "" {
		var err error

		config, err = os.Open(configFilePath)
		if err != nil {
			glog.Fatalf("Couldn't open admission plugin configuration %s: %#v",
				configFilePath, err)
		}

		defer config.Close()
	}

	plugin, err := GetPlugin(name, client, config)
	if err != nil {
		glog.Fatalf("Couldn't init admission plugin %q: %v", name, err)
	}
	if plugin == nil {
		glog.Fatalf("Unknown admission plugin: %s", name)
	}

	return plugin
}


text:
<!doctype html>

Hello world!

    Box 1

    Box 2


text:
<?xml version="1.0" encoding="ISO-8859-1"?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">

<title>LUSE</title>
<meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1"/>
<link rel="stylesheet" href="luse.css" type="text/css"/>

A FUSE binding for Lua

home ·
download ·
installation ·
manual ·
examples

5 - Examples

Here are some filesystem examples.hellofs is just a minimal example. luafs is a basic filesystem that exposes a Lua table as a directory. It can be used as a model to expose some data from a Lua state in your own applications. fwfs is a forwarding filesystem, that can be used as a base to make on the fly operations on file I/O.

5.1 - hellofs

hellofs is the Hello World! of FUSE filesystems. It creates a directory with a single file called hello that contain the string "Hello World!".

Example:

$ mkdir tmpdir
$ ./hellofs.lua tmpdir
$ ls tmpdir
hello
$ cat tmpdir/hello
Hello World!
$ fusermount -u tmpdir

Source code: hellofs.lua

5.2 - luafs

luafs expose a table as a directory. The subtables are exposed as subdirectories, while the string and userdata fields are exposed as regular files. You can create new files, and write to them: that will create new strings in the table hierarchy.

Example:

$ mkdir tmpdir
$ ./luafs.lua tmpdir
$ ls tmpdir
$ echo Hello World! > tmpdir/hello
$ ls tmpdir
hello
$ cat tmpdir/hello
Hello World!
$ mkdir tmpdir/subdir
$ ls tmpdir
hello subdir/
$ echo foo > tmpdir/subdir/bar
$ ls tmpdir/subdir
bar
$ cat tmpdir/subdir/bar
foo
$ fusermount -u tmpdir

Source code: luafs.lua

5.3 - fwfs

fwfs creates a directory that will forward all I/O to another directory. It's meant to be used as a base for any filesystem that is backed on disk, and that is doing something to the files on the fly. For example it can do filesystem encryption, it can make several directories on different disks appear as a single one, etc.

Example:

$ mkdir srcdir
$ echo Hello World! > srcdir/hello
$ mkdir dstdir
$ ./fwfs.lua srcdir dstdir
$ ls dstdir
hello
$ cat dstdir/hello
Hello World!
$ mkdir dstdir/subdir
$ ls srcdir
hello subdir/
$ echo foo > dstdir/subdir/bar
$ ls srcdir/subdir
bar
$ cat srcdir/subdir/bar
foo
$ fusermount -u dstdir

Source code: fwfs.lua

Last update: 2007-09-22 19:02:31-0400


text:
layout: tag_index
tag: pig
---


text:
<!doctype html>

    <title>event handlers</title>
    <link rel="import" href="packages/polymer/polymer.html">

  <x-test>

...light...

  </x-test>

  <polymer-element name="x-test" on-tap="{{hostTapAction}}">
    <template>

Tap me!
        <content></content>

      <input id="input" on-focus="{{focusAction}}"
                        on-blur="{{blurAction}}">focusy

          <template repeat="{{list1}}">

{{index}}

          </template>
          <template repeat="{{item in list2}}">

{{item.index}}

          </template>

    </template>

  </polymer-element>


text:
import django.db.models.deletion
from django.db import migrations, models

class Migration(migrations.Migration):

    initial = True

    dependencies = [
        ("challenges", "0001_initial"),
    ]

    operations = [
        migrations.CreateModel(
            name="Page",
            fields=[
                (
                    "id",
                    models.AutoField(
                        auto_created=True,
                        primary_key=True,
                        serialize=False,
                        verbose_name="ID",
                    ),
                ),
                ("title", models.SlugField(max_length=64)),
                (
                    "permission_level",
                    models.CharField(
                        choices=[
                            ("ALL", "All"),
                            ("REG", "Participants only"),
                            ("ADM", "Administrators only"),
                        ],
                        default="ALL",
                        max_length=3,
                    ),
                ),
                (
                    "order",
                    models.IntegerField(
                        default=1,
                        editable=False,
                        help_text="Determines order in which page appear in site menu",
                    ),
                ),
                (
                    "display_title",
                    models.CharField(
                        blank=True,
                        default="",
                        help_text="On pages and in menu items, use this text. Spaces and special chars allowed here. Optional field. If emtpy, title is used",
                        max_length=255,
                    ),
                ),
                (
                    "hidden",
                    models.BooleanField(
                        default=False,
                        help_text="Do not display this page in site menu",
                    ),
                ),
                ("html", models.TextField(blank=True, default="")),
                (
                    "challenge",
                    models.ForeignKey(
                        help_text="Which challenge does this page belong to?",
                        on_delete=django.db.models.deletion.CASCADE,
                        to="challenges.challenge",
                    ),
                ),
            ],
            options={
                "ordering": ["challenge", "order"],
                "unique_together": {("challenge", "title")},
            },
        ),
    ]


text:
import time

from selenium.webdriver.support.ui import WebDriverWait
from selenium.webdriver.support.expected_conditions import visibility_of_element_located

def find_element(driver, element_locator):
    """
    Поиск элемента
    :type driver: selenium.webdriver.Firefox
    :type element_locator: tuple
    :rtype: selenium.webdriver.remote.webelement.WebElement
    """
    time.sleep(.2)
    WebDriverWait(driver, 3).until(visibility_of_element_located(element_locator))
    element = driver.find_element(*element_locator)
    return element


text:
package cv

import (
	"fmt"
	"strconv"
)

// NewConversion returns a conversion set.  A Conversion set will log all errors captured
// during one or more conversions.  All possible conversions are specifed below in init().
func NewConversion() Conversion {
	var c Conversion
	c.Validation = make(map[string]*ValidationDetail)
	return c
}

// ==============================================================================================================================
//                                      INIT
// ==============================================================================================================================

func init() {
	vparms = make(map[string]vparm)

	vparms["Latitude"] = vparm{"float", true, "0.0"}
	vparms["Longitude"] = vparm{"float", true, "0.0"}
	vparms["IsAnonymous"] = vparm{"bool", false, "false"}
	vparms["Radius"] = vparm{"int", false, "100"}
	vparms["MaxResults"] = vparm{"int", false, "10"}

	vparms["IncludeDetails"] = vparm{"bool", false, "false"}
	vparms["IncludeComments"] = vparm{"bool", false, "false"}
	vparms["IncludeVotes"] = vparm{"bool", false, "false"}
}

// ==============================================================================================================================
//                                      Conversion
// ==============================================================================================================================

// vparm represents a
type vparm struct {
	vtype    string
	required bool
	dflt     string
}

// vparms is initialized in init below.
var vparms map[string]vparm

// Conversion represents a Conversion.  It is composed of a Validation.
type Conversion struct {
	Validation
}

// Float validates a float target as per the vparms for the specified name.
func (r *Conversion) Float(name, val string) float64 {
	return *r.Convert(name, val).(*float64)
}

// Int validates a integer target as per the vparms for the specified name.
func (r *Conversion) Int(name, val string) int {
	return *r.Convert(name, val).(*int)
}

// Bool validates a boolean target as per the vparms for the specified name.
func (r *Conversion) Bool(name, val string) bool {
	return *r.Convert(name, val).(*bool)
}

func (r Conversion) String() string {
	return r.Validation.String()
}

func (r *Conversion) Convert(name, val string) interface{} {
	// log.Debug("Converting %q val: %q", name, val)
	vp, vpOK := vparms[name]
	fail := func(item, msg string) interface{} {
		r.Validation[item] = &ValidationDetail{ok: false, result: msg}
		if !vpOK {
			return nil
		}
		switch vp.vtype {
		case "float":
			retval := 0.0
			return &retval
		case "int":
			retval := 0
			return &retval
		case "bool":
			retval := false
			return &retval
		default:
			return nil
		}
	}
	if !vpOK {
		return fail(name, "unknown field")
	}

	if val == "" {
		if vp.required {
			return fail(name, "empty")
		}
		val = vp.dflt
	}
	switch vp.vtype {
	case "float":
		out, err := strconv.ParseFloat(val, 64)
		if err != nil {
			return fail(name, err.Error())
		}
		r.Validation[name] = &ValidationDetail{ok: true}
		return &out
	case "int":
		out, err := strconv.Atoi(val)
		if err != nil {
			return fail(name, err.Error())
		}
		r.Validation[name] = &ValidationDetail{ok: true}
		return &out
	case "bool":
		out, err := strconv.ParseBool(val)
		if err != nil {
			return fail(name, err.Error())
			// return fail(name, fmt.Sprintf("%s trying to convert: [%s] to float\n", err, val))
		}
		r.Validation[name] = &ValidationDetail{ok: true}
		return &out
	default:
		return fail(name, fmt.Sprintf("unknown Conversion type: %q", vp.vtype))
	}
}


text:
![Screenshot](https://raw.githubusercontent.com/sergiokopplin/indigo/gh-pages/screen-shot.png)

This is a simple and minimalist template for Jekyll for those who likes to eat noodles.

---

What has inside?

- [Gulp](http://gulpjs.com/)
- [BrowserSync](https://www.browsersync.io/)
- [Stylus](http://stylus-lang.com/) with [BEM](http://getbem.com/) Methodology
- [SVG](https://www.w3.org/Graphics/SVG/)
- [Travis](https://travis-ci.org/)
- No JS
- [98/100](https://developers.google.com/speed/pagespeed/insights/?url=http%3A%2F%2Fsergiokopplin.github.io%2Findigo%2F)

## Setup

1. [Install Jekyll](http://jekyllrb.com)
2. [Install NodeJS](https://nodejs.org/)
3. [Install Bundler](http://bundler.io/)
4. Fork the project [Indigo](https://github.com/sergiokopplin/indigo/fork)
5. Edit `_config.yml` with your data.
6. `bundle install`
7. `npm install`
8. `gulp`
9. open in your browser: `http://localhost:3000`

## Settings

You have to fill some informations on `_config.yml` to customize your site.

```
name: John Doe
bio: 'A Man who travels the world eating noodles'
picture: 'assets/images/profile.jpg'

url: http://YOURUSER.github.io
# like: http://sergiokopplin.github.io
permalink: /:title/

analytics: 'UA-MYANALYTICS'
disqus: mydisqus
facebook: myfacebook
twitter: mytwitter
instagram: myinstagram
linkedin: mylinkedin
youtube: myyoutube
spotify: myspotify
github: mygithub
email: myemail@gmail.com
```

If you want pagination:
```
paginate: 5
paginate_path: "blog/:num/"
```

If you have some projects:
```
projects: true
```

---

## Contributions

- [siddhantjain](https://github.com/siddhantjain)

## Problems?

Tell me on github or open a issue [GitHub Issue](https://github.com/sergiokopplin/indigo/issues/new).

## License

[MIT](http://kopplin.mit-license.org/) Licença © Sérgio Kopplin


text:
from __future__ import print_function
import sys, traceback
import os
import threading
import logging
import ginga.util.six as six
if six.PY2:
    import thread
    import Queue
else:
    import _thread as thread
    import queue as Queue

from ginga.misc import Task, Future, Callback

class GwMain(Callback.Callbacks):

    def __init__(self, queue=None, logger=None, ev_quit=None, app=None,
                 thread_pool=None):
        Callback.Callbacks.__init__(self)

        self.enable_callback('shutdown')

        # You can pass in a queue if you prefer to do so
        if not queue:
            queue = Queue.Queue()
        self.gui_queue = queue
        # You can pass in a logger if you prefer to do so
        if logger is None:
            logger = logging.getLogger('GwMain')
        self.logger = logger
        if not ev_quit:
            ev_quit = threading.Event()
        self.ev_quit = ev_quit
        self.app = app
        self.gui_thread_id = None

        self.threadPool = thread_pool
        # For asynchronous tasks on the thread pool
        self.tag = 'master'
        self.shares = ['threadPool', 'logger']

        self.min_events = 100

    def get_widget(self):
        return self.app

    def get_threadPool(self):
        return self.threadPool

    def update_pending(self, timeout=0.0):

        # "1. PROCESSING OUT-BAND"
        try:
            self.app.process_events()
        except Exception as e:
            self.logger.error(str(e))
            # TODO: traceback!

        done = False
        while not done:
            #print "2. PROCESSING IN-BAND len=%d" % self.gui_queue.qsize()
            # Process "in-band" Qt events
            try:
                future = self.gui_queue.get(block=True,
                                            timeout=timeout)

                # Execute the GUI method
                try:
                    try:
                        res = future.thaw(suppress_exception=False)

                    except Exception as e:
                        future.resolve(e)

                        self.logger.error("gui error: %s" % str(e))
                        try:
                            (type, value, tb) = sys.exc_info()
                            tb_str = "".join(traceback.format_tb(tb))
                            self.logger.error("Traceback:\n%s" % (tb_str))

                        except Exception as e:
                            self.logger.error("Traceback information unavailable.")

                finally:
                    pass

            except Queue.Empty:
                done = True

            except Exception as e:
                self.logger.error("Main GUI loop error: %s" % str(e))
                #pass

        # Process "out-of-band" events, again
        try:
            self.app.process_events()
            pass
        except Exception as e:
            self.logger.error(str(e))

    def gui_do(self, method, *args, **kwdargs):
        """General method for asynchronously calling into the GUI.
        It makes a future to call the given (method) with the given (args)
        and (kwdargs) inside the gui thread.  If the calling thread is a
        non-gui thread the future is returned.
        """
        future = Future.Future()
        future.freeze(method, *args, **kwdargs)
        self.gui_queue.put(future)

        my_id = thread.get_ident()
        if my_id != self.gui_thread_id:
            return future

    def gui_call(self, method, *args, **kwdargs):
        """General method for synchronously calling into the GUI.
        This waits until the method has completed before returning.
        """
        my_id = thread.get_ident()
        if my_id == self.gui_thread_id:
            return method(*args, **kwdargs)
        else:
            future = self.gui_do(method, *args, **kwdargs)
            return future.wait()

    def gui_do_future(self, future):
        self.gui_queue.put(future)
        return future

    def nongui_do(self, method, *args, **kwdargs):
        task = Task.FuncTask(method, args, kwdargs, logger=self.logger)
        return self.nongui_do_task(task)

    def nongui_do_cb(self, tup, method, *args, **kwdargs):
        task = Task.FuncTask(method, args, kwdargs, logger=self.logger)
        task.register_callback(tup[0], args=tup[1:])
        return self.nongui_do_task(task)

    def nongui_do_future(self, future):
        task = Task.FuncTask(future.thaw, (), {}, logger=self.logger)
        return self.nongui_do_task(task)

    def nongui_do_task(self, task):
        try:
            task.init_and_start(self)
            return task
        except Exception as e:
            self.logger.error("Error starting task: %s" % (str(e)))
            raise(e)

    def is_gui_thread(self):
        my_id = thread.get_ident()
        return my_id == self.gui_thread_id

    def assert_gui_thread(self):
        my_id = thread.get_ident()
        assert my_id == self.gui_thread_id, \
               Exception("Non-GUI thread (%d) is executing GUI code!" % (
            my_id))

    def assert_nongui_thread(self):
        my_id = thread.get_ident()
        assert my_id != self.gui_thread_id, \
               Exception("GUI thread (%d) is executing non-GUI code!" % (
            my_id))

    def mainloop(self, timeout=0.001):
        # Mark our thread id
        self.gui_thread_id = thread.get_ident()

        while not self.ev_quit.isSet():
            self.update_pending(timeout=timeout)

    def gui_quit(self):
        "Call this to cause the GUI thread to quit the mainloop."""
        self.ev_quit.set()

        self.make_callback('shutdown')

        self.app.process_end()

    def _quit(self):
        self.gui_quit()

# END


text:
define(
"dojox/editor/plugins/nls/sl/Preview", //begin v1.x content
({
	"preview": "Predogled "
})

//end v1.x content
);