text:
using namespace System;
using namespace pwiz::CLI::util;
using namespace pwiz::CLI::cv;
using namespace pwiz::CLI::data;
using namespace pwiz::CLI::tradata;

public ref class Log
{
    public: static System::IO::TextWriter^ writer = nullptr;
};

string filenameBase_ = "temp.TraDataFileTest";

void hackInMemoryTraData(TraData& td)
{
     SoftwareList^ sws = td.softwarePtrs;
    if (sws->Count > 0) sws->RemoveAt(sws->Count-1);
}

void test()
{
     TraDataFile::WriteConfig writeConfig;

	//if (os_) *os_ << "test()\n  " << writeConfig << endl;

    string filename1 = filenameBase_ + ".1";
    string filename2 = filenameBase_ + ".2";

    {
        // create TraData object in memory
        TraData tiny;
        examples::initializeTiny(%tiny);

        // write to file #1 (static)
        TraDataFile::write(%tiny, filename1, %writeConfig);

        // read back into an TraDataFile object
        TraDataFile td1(filename1);
        hackInMemoryTraData(%tiny);

        // compare
        Diff diff(tiny, td1);
        if ((bool)diff && Log::writer != nullptr) Log::writer->WriteLine((string)diff);
        unit_assert(!(bool)diff);

        // write to file #2 (member)
        td1.write(filename2, %writeConfig);

        // read back into another TraDataFile object
        TraDataFile td2(filename2);
        hackInMemoryTraData(%td2);

        // compare
        diff.apply(tiny, td2);
        if ((bool)diff && Log::writer != nullptr) Log::writer->WriteLine((string)diff);
        unit_assert(!(bool)diff);

	}

    // remove temp files
    boost::filesystem::remove(filename1);
    boost::filesystem::remove(filename2);
}

int main(int argc, char* argv[])
{
    TEST_PROLOG_EX(argc, argv, "_CLI")

    try
    {
		if (argc>1 && !strcmp(argv[1],"-v")) Log::writer = Console::Out;
        test();
    }
    catch (exception& e)
    {
        TEST_FAILED("std::exception: " + string(e.what()))
    }
    catch (System::Exception^ e)
    {
        TEST_FAILED("System.Exception: " + ToStdString(e->Message))
    }
    catch (...)
    {
        TEST_FAILED("Caught unknown exception.")
    }

    TEST_EPILOG
}


text:
package eu.ehealth.db.storagecomponent;

import javax.xml.bind.annotation.XmlAccessType;
import javax.xml.bind.annotation.XmlAccessorType;
import javax.xml.bind.annotation.XmlRootElement;
import javax.xml.bind.annotation.XmlType;

/**
 *
Clase Java para anonymous complex type.
 *
 *
El siguiente fragmento de esquema especifica el contenido que se espera que haya en esta clase.
 *
 *

 * <complexType>
 *   <complexContent>
 *     <restriction base="{http://www.w3.org/2001/XMLSchema}anyType">
 *       <sequence>
 *         <element name="userType" type="{http://www.w3.org/2001/XMLSchema}int"/>
 *       </sequence>
 *     </restriction>
 *   </complexContent>
 * </complexType>
 *

 *
 *
 */
@XmlAccessorType(XmlAccessType.FIELD)
@XmlType(name = "", propOrder = {
    "userType"
})
@XmlRootElement(name = "ListOfPossibleTasks")
public class ListOfPossibleTasks {

    protected int userType;

    /**
     * Obtiene el valor de la propiedad userType.
     *
     */
    public int getUserType() {
        return userType;
    }

    /**
     * Define el valor de la propiedad userType.
     *
     */
    public void setUserType(int value) {
        this.userType = value;
    }

}

redpajama_set_name: RedPajamaGithub


text:
set -v
set -e

dir="$(dirname "$0")"

set -e
cd ${GOPATH}/src/github.com/skydive-project/skydive

# Compile all contribs
make contribs

# Compile with default options
make
make test.functionals.compile TAGS=${TAGS}

export CGO_CFLAGS="-I/usr/local/include/dpdk -O3 -g -std=gnu11 -m64 -pthread -march=native -DRTE_MACHINE_CPUFLAG_SSE -DRTE_MACHINE_CPUFLAG_SSE2 -DRTE_MACHINE_CPUFLAG_SSE3 -DRTE_MACHINE_CPUFLAG_SSSE3 -DRTE_MACHINE_CPUFLAG_SSE4_1 -DRTE_MACHINE_CPUFLAG_SSE4_2 -DRTE_MACHINE_CPUFLAG_PCLMULQDQ -DRTE_MACHINE_CPUFLAG_RDRAND -DRTE_MACHINE_CPUFLAG_FSGSBASE -DRTE_MACHINE_CPUFLAG_F16C -include rte_config.h -Wno-deprecated-declarations"
export CGO_LDFLAGS="-L/usr/local/lib"

# Compile with all build options supported enabled
make WITH_DPDK=true WITH_EBPF=true WITH_VPP=true WITH_EBPF_DOCKER_BUILDER=true WITH_K8S=true WITH_ISTIO=true \
    WITH_HELM=true VERBOSE=true

# Compile Skydive for Windows
GOOS=windows GOARCH=amd64 go build github.com/skydive-project/skydive

# Compile Skydive for MacOS
GOOS=darwin GOARCH=amd64 go build github.com/skydive-project/skydive

# Compile profiling
make WITH_PROF=true VERBOSE=true

make clean

# Compile all tests
make test.functionals.compile TAGS=${TAGS} WITH_NEUTRON=true WITH_SELENIUM=true WITH_CDD=true \
    WITH_SCALE=true WITH_EBPF=true WITH_EBPF_DOCKER_BUILDER=true WITH_VPP=true WITH_K8S=true \
    WITH_ISTIO=true WITH_HELM=true

# Compile static
make static

# Check repository is clean
make check


text:
<?php

// src/Lestroistoques/RecettesBundle/Form/CategorieType.php

namespace Lestroistoques\RecettesBundle\Form;

use Symfony\Component\Form\AbstractType;
use Symfony\Component\Form\FormBuilderInterface;
use Symfony\Component\OptionsResolver\OptionsResolverInterface;

class CategorieType extends AbstractType
{
    /**
     * @param FormBuilderInterface $builder
     * @param array $options
     */
    public function buildForm(FormBuilderInterface $builder, array $options)
    {
        $builder
            ->add('nom',      'text', array('label' => 'Nom'))

            ->add('iconeUrl', 'text', array('label' => 'Icône',
                                            'required' => false))
        ;
    }

    /**
     * @param OptionsResolverInterface $resolver
     */
    public function setDefaultOptions(OptionsResolverInterface $resolver)
    {
        $resolver->setDefaults(array(
            'data_class' => 'Lestroistoques\RecettesBundle\Entity\Categorie'
        ));
    }

    /**
     * @return string
     */
    public function getName()
    {
        return 'lestroistoques_recettesbundle_categorie';
    }
}


text:
import { Entity, Point2 } from '@shared';

import { suite, test } from 'mocha-typescript';
import { expect } from 'chai';

// a stub class because Entity is abstract
class StubEntity extends Entity { }

@suite("shared/entity/Entity")
class TestEntity {

    @test "default entity position should allways be (0,0)"() {

        let entity = new StubEntity();
        let initPos = entity.getPosition();
        expect(initPos.x).to.eq(0, "entity x position shold be 0");
        expect(initPos.y).to.eq(0, "entity y position shold be 0");
    }

    @test "entity should have a getter and setter for positioning"() {

        let entity = new StubEntity();
        let pos = Point2.from(10);

        entity.setPosition(pos);
        expect(entity.getPosition()).to.eq(pos);
    }

    @test "entity has a width and a height"() {

        // default case
        let entity = new StubEntity(10, 15);
        expect(entity.getWidth()).to.eq(10);
        expect(entity.getHeight()).to.eq(15);

        // branch test without params
        entity = new StubEntity();
        expect(entity.getWidth()).to.eq(0);
        expect(entity.getHeight()).to.eq(0);
    }
}


text:
package sh.isaac.komet.batch.action;

import javafx.beans.property.SimpleObjectProperty;
import sh.isaac.MetaData;
import sh.isaac.api.ConceptProxy;
import sh.isaac.api.Get;
import sh.isaac.api.Status;
import sh.isaac.api.chronicle.Chronology;
import sh.isaac.api.component.concept.ConceptSpecification;
import sh.isaac.api.coordinate.ManifoldCoordinateImmutable;
import sh.isaac.api.externalizable.ByteArrayDataBuffer;
import sh.isaac.api.marshal.Marshaler;
import sh.isaac.api.marshal.Unmarshaler;
import sh.isaac.api.observable.coordinate.ObservableManifoldCoordinate;
import sh.isaac.api.transaction.Transaction;
import sh.isaac.komet.batch.VersionChangeListener;
import sh.komet.gui.control.concept.PropertySheetItemConceptWrapper;

import java.util.Optional;
import java.util.UUID;
import java.util.concurrent.ConcurrentHashMap;

public class InactivateComponent extends ActionItem {

    public static final int marshalVersion = 1;
    public static final String INACTIVATE_COMPONENT = "Inactivate component";
    // concept to find
    SimpleObjectProperty<ConceptSpecification> conceptToInactivateProperty = new SimpleObjectProperty<>(this,
            MetaData.CONCEPT_TO_FIND____SOLOR.toExternalString() , MetaData.UNINITIALIZED_COMPONENT____SOLOR);

    public InactivateComponent(ByteArrayDataBuffer in) {
        this.conceptToInactivateProperty.set(in.getConceptSpecification());
    }

    public InactivateComponent() {
    }

    @Override
    protected void setupItemForGui(ObservableManifoldCoordinate manifoldForDisplay) {
        getPropertySheet().getItems().add(new PropertySheetItemConceptWrapper(manifoldForDisplay, "Inactivate",
                conceptToInactivateProperty,
                new ConceptProxy("Disease (disorder)", UUID.fromString("ab4e618b-b954-3d56-a44b-f0f29d6f59d3")),
                MetaData.FINDING____SOLOR));

    }

    @Override
    protected void setupForApply(ConcurrentHashMap<Enum, Object> cache, Transaction transaction, ManifoldCoordinateImmutable manifoldCoordinate) {
        Optional<? extends Chronology> optionalChronology = Get.identifiedObjectService().getChronology(conceptToInactivateProperty.get().getNid());
        if (optionalChronology.isPresent()) {
            Chronology chronology = optionalChronology.get();
            chronology.createMutableVersion(manifoldCoordinate.getWriteCoordinate(transaction, null, Status.INACTIVE));
            Get.identifiedObjectService().putChronologyData(chronology);
        }
    }

    @Override
    protected void apply(Chronology chronology, ConcurrentHashMap<Enum, Object> cache, VersionChangeListener versionChangeListener) {
        // nothing to do..
    }

    @Override
    public String getTitle() {
        return INACTIVATE_COMPONENT;
    }

    @Override
    @Marshaler
    public void marshal(ByteArrayDataBuffer out) {
        out.putInt(marshalVersion);
        out.putConceptSpecification(conceptToInactivateProperty.get());
    }

    @Unmarshaler
    public static Object make(ByteArrayDataBuffer in) {
        int objectMarshalVersion = in.getInt();
        switch (objectMarshalVersion) {
            case marshalVersion:
                return new InactivateComponent(in);
            default:
                throw new UnsupportedOperationException("Unsupported version: " + objectMarshalVersion);
        }
    }

    @Override
    protected void conclude(ConcurrentHashMap<Enum, Object> cache) {
        // nothing to do...
    }

}


text:
layout: default
id: 01-01-2013-Pelliccia-Luca
name: Luca
surname: Pelliccia
university: University of Trento
advisor: Margesin Benno
year: 2013
title: Tunable and Miniaturized Waveguide Filters for Advanced Communication Systems
---


text:
title: 场景
layout: usermanual-page.hbs
position: 9
---

## 场景

可以通过打开 Scenes 对话框来管理场景。

可以在菜单中点击 'Scenes' 按钮来打开场景对话框:

![Scenes Menu][1]

或者点击 3D 视口左上角的快捷按钮:

![Scenes Viewport][2]

这样也能打开场景对话框:

![Scenes][3]

You can create a new scene by clicking on "ADD NEW SCENE", you can click on a scene to open it up and you can click on the buttons on the right of each scene to duplicate a scene or delete it. You can also click on the banner icon on the left to make it the first scene loaded when you publish an app or when you export your project. Think of it as the first 'level' in your application.

[1]: /images/user-manual/editor/scenes-menu.jpg
[2]: /images/user-manual/editor/scenes-viewport.jpg
[3]: /images/user-manual/editor/scenes.jpg


text:
[![Build status](https://travis-ci.org/victorzki/makiato.svg?branch=master)](https://travis-ci.org/victorzki/makiato)

Makiato application.

### Installation
```
$ npm install
$ bower install
```

###### Notes
In order to install mongoose on linux, Kerberos Development Package needs to be installed.
```
$ sudo apt-get install libkrb5-dev
```

### Run the app
Start the express app with supervisor (to restart server on file changes)
```
$ supervisor --debug ./app/bin/www
```

Run gulp
```
$ gulp
```

### License
MIT


text:
package com.longestSubstring.soln1;

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

public class LongestSubstringSoln1 {
	public static void main(String[] args) {
//		 String testString= "abcabcbb";
//		 String testString= "bbbbb";
//		 String testString= "pwwkew";
//		 String testString= "c";
//		 String testString = "au";
//		 String testString = "aab";
		String testString = "yydsykihddxginnnbtkuvaewqshceqscryxrkhankxuumjkqcukaxqwniermwlrpjqgtxhjkgfetqqj";
//		 String testString = "";

		System.out.println("Length of longest substr of \"" + testString + "\" \n~without repeats = "
				+ lengthOfLongestSubstring(testString));
	}

	public static int lengthOfLongestSubstring(String s) {
		if(s.length() == 0) return 0;
		char charArr[] = s.toCharArray();

		int maxLen = 0;

		// char, position - hashmap
		Map<Character, Integer> hmap = new HashMap<>();

		// j is begin point of the substring. Follows the last matched char
		for(int i = 0, j = 0; i < charArr.length; i++) {
			char currChar = charArr[i];
			if(hmap.containsKey(currChar)) {
				j = Math.max(j, hmap.get(currChar) + 1);
			}
			hmap.put(currChar, i);
			maxLen = Math.max(maxLen, i-j+1);
		}

		return maxLen;
	}
}


text:
<?php

namespace WP\Route\Http\Exception;

use Exception;
use WP\Route\Http\Exception as HttpException;

class MethodNotAllowedException extends HttpException
{
    /**
     * Constructor
     *
     * @param array      $allowed
     * @param string     $message
     * @param \Exception $previous
     * @param integer    $code
     */
    public function __construct(array $allowed = [], $message = 'Method Not Allowed', Exception $previous = null, $code = 0)
    {
        $headers = [
            'Allow' => implode(', ', $allowed)
        ];

        parent::__construct(405, $message, $previous, $headers, $code);
    }
}


text:
<?xml-stylesheet type='text/xsl' href='./CodelistDictionary-v32.xsl'?><gml:Dictionary xmlns:gml="http://www.opengis.net/gml" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" gml:id="FunctionValue" xsi:schemaLocation="http://www.opengis.net/gml null">
  <gml:identifier codeSpace="http://www.citygml.org/ade/utility/0.9.9">FunctionValue</gml:identifier>
  <gml:dictionaryEntry>
    <gml:Definition gml:id="_8848_11472">
      <gml:identifier codeSpace="http://www.citygml.org/ade/utility/0.9.9/FunctionValue">producing</gml:identifier>
    </gml:Definition>
  </gml:dictionaryEntry>
  <gml:dictionaryEntry>
    <gml:Definition gml:id="_8848_11473">
      <gml:identifier codeSpace="http://www.citygml.org/ade/utility/0.9.9/FunctionValue">consuming</gml:identifier>
    </gml:Definition>
  </gml:dictionaryEntry>
  <gml:dictionaryEntry>
    <gml:Definition gml:id="_8848_11474">
      <gml:identifier codeSpace="http://www.citygml.org/ade/utility/0.9.9/FunctionValue">distribution</gml:identifier>
    </gml:Definition>
  </gml:dictionaryEntry>
  <gml:dictionaryEntry>
    <gml:Definition gml:id="_8848_11475">
      <gml:identifier codeSpace="http://www.citygml.org/ade/utility/0.9.9/FunctionValue">storage</gml:identifier>
    </gml:Definition>
  </gml:dictionaryEntry>
  <gml:dictionaryEntry>
    <gml:Definition gml:id="_8848_11476">
      <gml:identifier codeSpace="http://www.citygml.org/ade/utility/0.9.9/FunctionValue">venting</gml:identifier>
    </gml:Definition>
  </gml:dictionaryEntry>
  <gml:dictionaryEntry>
    <gml:Definition gml:id="_8848_11477">
      <gml:identifier codeSpace="http://www.citygml.org/ade/utility/0.9.9/FunctionValue">abstraction</gml:identifier>
    </gml:Definition>
  </gml:dictionaryEntry>
  <gml:dictionaryEntry>
    <gml:Definition gml:id="_8848_11478">
      <gml:identifier codeSpace="http://www.citygml.org/ade/utility/0.9.9/FunctionValue">measurement</gml:identifier>
    </gml:Definition>
  </gml:dictionaryEntry>
  <gml:dictionaryEntry>
    <gml:Definition gml:id="_8848_11479">
      <gml:identifier codeSpace="http://www.citygml.org/ade/utility/0.9.9/FunctionValue">shortCircuit</gml:identifier>
    </gml:Definition>
  </gml:dictionaryEntry>
  <gml:dictionaryEntry>
    <gml:Definition gml:id="_8848_11480">
      <gml:identifier codeSpace="http://www.citygml.org/ade/utility/0.9.9/FunctionValue">branch</gml:identifier>
    </gml:Definition>
  </gml:dictionaryEntry>
  <gml:dictionaryEntry>
    <gml:Definition gml:id="_8848_11481">
      <gml:identifier codeSpace="http://www.citygml.org/ade/utility/0.9.9/FunctionValue">observer</gml:identifier>
    </gml:Definition>
  </gml:dictionaryEntry>
  <gml:dictionaryEntry>
    <gml:Definition gml:id="_8848_11482">
      <gml:identifier codeSpace="http://www.citygml.org/ade/utility/0.9.9/FunctionValue">protection</gml:identifier>
    </gml:Definition>
  </gml:dictionaryEntry>
  <gml:dictionaryEntry>
    <gml:Definition gml:id="_8848_11483">
      <gml:identifier codeSpace="http://www.citygml.org/ade/utility/0.9.9/FunctionValue">control</gml:identifier>
    </gml:Definition>
  </gml:dictionaryEntry>
  <gml:dictionaryEntry>
    <gml:Definition gml:id="_8848_11484">
      <gml:identifier codeSpace="http://www.citygml.org/ade/utility/0.9.9/FunctionValue">shutOff</gml:identifier>
    </gml:Definition>
  </gml:dictionaryEntry>
  <gml:dictionaryEntry>
    <gml:Definition gml:id="_8848_11678">
      <gml:identifier codeSpace="http://www.citygml.org/ade/utility/0.9.9/FunctionValue">presuming</gml:identifier>
    </gml:Definition>
  </gml:dictionaryEntry>
  <gml:dictionaryEntry>
    <gml:Definition gml:id="_8848_11879">
      <gml:identifier codeSpace="http://www.citygml.org/ade/utility/0.9.9/FunctionValue">unknown</gml:identifier>
    </gml:Definition>
  </gml:dictionaryEntry>
</gml:Dictionary>


text:
// NAME: flappy_menu.js
var menu_state = {

	create: function() {
		// STEP 1: Set background; Make it scroll continuously as a sprite (Note: Diff speed than game bkgd)
		background = game.add.tileSprite(0, 0, 512, 512, "background");
		var timerBkgd = game.time.events.loop(50, function(){background.tilePosition.y += 1;}, this);

		// STEP 2: Define inputs
        var space_key = this.game.input.keyboard.addKey(Phaser.Keyboard.SPACEBAR);
        space_key.onDown.add(this.start, this);
		game.input.onDown.add(this.start, this);

        // STEP 3: Fidn center screen coords
        var x = game.world.width/2, y = game.world.height/2;

		// STEP 4: Title
        var titleText = game.add.text(x, y/2, "Flappy TARDIS", { font: "40px Helvetica,Verdana", fill: "#ffffff" });
        titleText.anchor.setTo(0.5, 0.5);

        // STEP 5: Show instructions
        menuText = game.add.text(x, y+10, "Touch/Press Space", { font: "24px Arial", fill: "#ccc" });
        menuText.anchor.setTo(0.5, 0.5);

        // STEP 6: Show High Score (if any)
        if (highScore > 0) {
            // Display its score
            var score_label = this.game.add.text(x, game.world.height-50, "High Score: " + highScore, { font: "20px Helvetica,Arial", fill: "#00ff00" });
            score_label.anchor.setTo(0.5, 0.5);
		}
	},

// TODO: Get menuText to blink
/*
	// Update function
	update: function()
	{
	    timer += game.time.elapsed; //this is in ms, not seconds.
	    if ( timer >= 1000 ) {
	        timer -= 1000;
//	        menuText.visible = !menuText.visible;

			// Check current alpha state
			if (menuText.alp // HOW??
		        s = this.game.add.tween(menuText)
		        s.to({ alpha: 1 }, 600, null)
		        s.start();
		    }
	},
*/

    // Start the actual game
    start: function() {
		// STEP 1: Define [space]
        var space_key = this.game.input.keyboard.addKey(Phaser.Keyboard.SPACEBAR);

        // STEP 2: Remove key events of they carry over into GAME STATE and ruin game controls
        space_key.onDown.remove(this.start, this);
		game.input.onDown.remove(this.start, this);

		// STEP 3: Let's PLAY!
        this.game.state.start('play');
    }

};


text:
//=====================================================================
//
//File:      $RCSfile: CopyPasteSourceDestinationGlobalsTestsTestSuite.java,v $
//Version:   $Revision: 1.3 $
//Modified:  $Date: 2013/01/10 22:49:20 $
//
// WARNING:      Do not edit this generated file
// Generated by: UnitTestGenerator.pl
// Version:      1.12
// Matrix:       CopyPasteSourceDestinationTestMatrix.txt
//
//(c) Copyright 2007-2014 by Mentor Graphics Corp. All rights reserved.
//
//=====================================================================
// Licensed under the Apache License, Version 2.0 (the "License"); you may not
// use this file except in compliance with the License.  You may obtain a copy
// of the License at
//
//       http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
// WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.   See the
// License for the specific language governing permissions and limitations under
// the License.
//=====================================================================

package com.mentor.nucleus.bp.core.test.globals;

import junit.framework.Test;
import junit.framework.TestSuite;

import com.mentor.nucleus.bp.core.test.cpts.CopyPasteSourceDestinationTests_0;
import com.mentor.nucleus.bp.core.test.cpts.CopyPasteSourceDestinationTests_1;
import com.mentor.nucleus.bp.core.test.cpts.CopyPasteSourceDestinationTests_2;

public class CopyPasteSourceDestinationGlobalsTestsTestSuite extends TestSuite {

    /**
     * Returns the suite.  This is required to
     * use the JUnit Launcher.
     */
    public static Test suite() {
        return new CopyPasteSourceDestinationGlobalsTestsTestSuite();
    }

    /**
     * Construct the test suite.
     */
    public CopyPasteSourceDestinationGlobalsTestsTestSuite()
    {
        addTest(new TestSuite(CopyPasteSourceDestinationGlobalsTest.class));
        addTest(new TestSuite(CopyPasteSourceDestinationTests_0.class));
        addTest(new TestSuite(CopyPasteSourceDestinationTests_1.class));
        addTest(new TestSuite(CopyPasteSourceDestinationTests_2.class));
    }
}


text:
ACCEPTED

#### According to
Index Fungorum

#### Published in
Nova Hedwigia 19: 442 (1970)

#### Original name
Chiodecton macquariense C.W. Dodge

### Remarks
null


text:
using MySql.Data.MySqlClient;
using Project_Data.Database;
using System;
using System.Drawing;
using System.Windows.Forms;

namespace Project_Data.Markers
{
    class Weather
    {
        /*
            T         = Temperatuur (in 0.1 graden Celsius) op 1.50 m hoogte tijdens de waarneming
            SQ        = Duur van de zonneschijn (in 0.1 uren) per uurvak, berekend uit globale straling
            DR        = Duur van de neerslag (in 0.1 uur) per uurvak
            RH        = Uursom van de neerslag (in 0.1 mm) (-1 voor <0.05 mm)
            N         = Bewolking (bedekkingsgraad van de bovenlucht in achtsten), tijdens de waarneming (9=bovenlucht onzichtbaar)
            U         = Relatieve vochtigheid (in procenten) op 1.50 m hoogte tijdens de waarneming
         */

        public double Temperature{ get; private set; }
        public double Sunshine { get; private set; }
        public double Rainfall { get; private set; }
        public double Amount { get; private set; }
        public double Cloudage { get; private set; }
        public double Humidity { get; private set; }

        public Weather(double t, double sq, double dr, double rh, double n, double u)
        {
            Temperature = t*0.1;
            Sunshine = sq*0.1;
            Rainfall = dr*0.1;
            Amount = rh;
            Cloudage = n;
            Humidity = u;
        }

        public static Weather getWeather(string date)
        {
            Weather weather = null;

            DatabaseConnection dbconn = new DatabaseConnection(new MySqlConnection(Form1.connection));

            dbconn.Open();
            dbconn.Command = new MySqlCommand(string.Format("SELECT * FROM project3.klimaat WHERE timestamp = '{0}'", Convert.ToDateTime(date).ToString("yyyy-MM-dd HH:mm:ss")), dbconn.Connection);

            MySqlDataReader msdr = dbconn.executeQuery();
            while (msdr.Read())
            {
                weather = new Weather(Convert.ToDouble(msdr[1]), Convert.ToDouble(msdr[2]),
                Convert.ToDouble(msdr[3]), Convert.ToDouble(msdr[4]), Convert.ToDouble(msdr[5]),
                Convert.ToDouble(msdr[6]));
            }

            dbconn.Close();
            return weather;
        }
    }

    class WeatherDisplayBox : GroupBox
    {
        private Label indcRainfallAmount;
        private Label IndcCloudage;
        private Label indcRainfall;
        private Label indcSunshine;
        private Label humidity;
        private Label lblhumidity;
        private Label cloudage;
        private Label lblcloudage;
        private Label rainfallamount;
        private Label lblrainfallamount;
        private Label rainfall;
        private Label lblrainfall;
        private Label sunshine;
        private Label lblsunshine;
        private Label temperature;
        private Label lbltemperature;

        public WeatherDisplayBox()
        {
            lbltemperature = new Label();
            temperature = new Label();
            sunshine = new Label();
            lblsunshine = new Label();
            rainfall = new Label();
            lblrainfall = new Label();
            humidity = new Label();
            lblhumidity = new Label();
            cloudage = new Label();
            lblcloudage = new Label();
            rainfallamount = new Label();
            lblrainfallamount = new Label();
            indcSunshine = new Label();
            indcRainfall = new Label();
            IndcCloudage = new Label();
            indcRainfallAmount = new Label();

            //
            // lbltemperature
            //
            this.lbltemperature.AutoSize = true;
            this.lbltemperature.Location = new Point(6, 16);
            this.lbltemperature.Name = "lbltemperature";
            this.lbltemperature.Size = new Size(70, 13);
            this.lbltemperature.TabIndex = 0;
            this.lbltemperature.Text = "Temperatuur:";
            //
            // temperature
            //
            this.temperature.AutoSize = true;
            this.temperature.Location = new Point(155, 16);
            this.temperature.Name = "temperature";
            this.temperature.Size = new Size(35, 13);
            this.temperature.TabIndex = 1;
            this.temperature.Text = "label4";
            //
            // sunshine
            //
            this.sunshine.AutoSize = true;
            this.sunshine.Location = new Point(155, 38);
            this.sunshine.Name = "sunshine";
            this.sunshine.Size = new Size(35, 13);
            this.sunshine.TabIndex = 3;
            this.sunshine.Text = "label5";
            //
            // lblsunshine
            //
            this.lblsunshine.AutoSize = true;
            this.lblsunshine.Location = new Point(6, 38);
            this.lblsunshine.Name = "lblsunshine";
            this.lblsunshine.Size = new Size(139, 13);
            this.lblsunshine.TabIndex = 2;
            this.lblsunshine.Text = "Aantal minuten zonneschijn:";
            //
            // rainfall
            //
            this.rainfall.AutoSize = true;
            this.rainfall.Location = new Point(155, 62);
            this.rainfall.Name = "rainfall";
            this.rainfall.Size = new Size(35, 13);
            this.rainfall.TabIndex = 5;
            this.rainfall.Text = "label7";
            //
            // lblrainfall
            //
            this.lblrainfall.AutoSize = true;
            this.lblrainfall.Location = new Point(6, 62);
            this.lblrainfall.Name = "lblrainfall";
            this.lblrainfall.Size = new Size(123, 13);
            this.lblrainfall.TabIndex = 4;
            this.lblrainfall.Text = "Aantal minuten neerslag:";
            //
            // humidity
            //
            this.humidity.AutoSize = true;
            this.humidity.Location = new Point(155, 130);
            this.humidity.Name = "humidity";
            this.humidity.Size = new Size(35, 13);
            this.humidity.TabIndex = 11;
            this.humidity.Text = "label9";
            //
            // lblhumidity
            //
            this.lblhumidity.AutoSize = true;
            this.lblhumidity.Location = new Point(6, 130);
            this.lblhumidity.Name = "lblhumidity";
            this.lblhumidity.Size = new Size(136, 13);
            this.lblhumidity.TabIndex = 10;
            this.lblhumidity.Text = "Relatieve luchtvochtigheid:";
            //
            // cloudage
            //
            this.cloudage.AutoSize = true;
            this.cloudage.Location = new Point(155, 106);
            this.cloudage.Name = "cloudage";
            this.cloudage.Size = new Size(41, 13);
            this.cloudage.TabIndex = 9;
            this.cloudage.Text = "label11";
            //
            // lblcloudage
            //
            this.lblcloudage.AutoSize = true;
            this.lblcloudage.Location = new Point(6, 106);
            this.lblcloudage.Name = "lblcloudage";
            this.lblcloudage.Size = new Size(59, 13);
            this.lblcloudage.TabIndex = 8;
            this.lblcloudage.Text = "Bewolking's niveau:";
            //
            // rainfallamount
            //
            this.rainfallamount.AutoSize = true;
            this.rainfallamount.Location = new Point(155, 84);
            this.rainfallamount.Name = "rainfallamount";
            this.rainfallamount.Size = new Size(41, 13);
            this.rainfallamount.TabIndex = 7;
            this.rainfallamount.Text = "label13";
            //
            // lblrainfallamount
            //
            this.lblrainfallamount.AutoSize = true;
            this.lblrainfallamount.Location = new Point(6, 84);
            this.lblrainfallamount.Name = "lblrainfallamount";
            this.lblrainfallamount.Size = new Size(143, 13);
            this.lblrainfallamount.TabIndex = 6;
            this.lblrainfallamount.Text = "Hoeveelheid neerslag in mm:";
            //
            // indcSunshine
            //
            this.indcSunshine.Location = new Point(11, 170);
            this.indcSunshine.Name = "indcSunshine";
            this.indcSunshine.Size = new Size(32, 32);
            this.indcSunshine.TabIndex = 12;
            //
            // indcRainfall
            //
            this.indcRainfall.Location = new Point(49, 170);
            this.indcRainfall.Name = "indcRainfall";
            this.indcRainfall.Size = new Size(32, 32);
            this.indcRainfall.TabIndex = 13;
            //
            // IndcCloudage
            //
            this.IndcCloudage.Location = new Point(89, 170);
            this.IndcCloudage.Name = "IndcCloudage";
            this.IndcCloudage.Size = new Size(32, 32);
            this.IndcCloudage.TabIndex = 14;
            //
            // indcRainfallAmount
            //

            this.indcRainfallAmount.Location = new Point(127, 170);
            this.indcRainfallAmount.Name = "indcRainfallAmount";
            this.indcRainfallAmount.Size = new Size(32, 32);
            this.indcRainfallAmount.TabIndex = 15;

            //
            // groupBox3
            //
            this.Controls.Add(this.indcRainfallAmount);
            this.Controls.Add(this.IndcCloudage);
            this.Controls.Add(this.indcRainfall);
            this.Controls.Add(this.indcSunshine);
            this.Controls.Add(this.humidity);
            this.Controls.Add(this.lblhumidity);
            this.Controls.Add(this.cloudage);
            this.Controls.Add(this.lblcloudage);
            this.Controls.Add(this.rainfallamount);
            this.Controls.Add(this.lblrainfallamount);
            this.Controls.Add(this.rainfall);
            this.Controls.Add(this.lblrainfall);
            this.Controls.Add(this.sunshine);
            this.Controls.Add(this.lblsunshine);
            this.Controls.Add(this.temperature);
            this.Controls.Add(this.lbltemperature);
            this.Location = new Point(13, 64);
            this.Size = new Size(284, 217);
            this.TabIndex = 14;
            this.TabStop = false;

        }

        public void setTemperature(object value)
        {
            temperature.Text = (value.ToString() + "°C");
        }

        public void setSunshine(object value)
        {
            int amount = Convert.ToInt32(value);

            if (amount <= 10)
            {
                indcSunshine.Image = Properties.Resources.sun_0;
            }

            else if (amount > 10 && amount <= 20)
            {
                indcSunshine.Image = Properties.Resources.sun_20;
            }

            else if (amount > 20 && amount <= 30)
            {
                indcSunshine.Image = Properties.Resources.sun_40;
            }

            else if (amount > 30 && amount <= 40)
            {
                indcSunshine.Image = Properties.Resources.sun_60;
            }

            else if (amount > 40 && amount <= 50)
            {
                indcSunshine.Image = Properties.Resources.sun_80;
            }

            else if (amount > 50 && amount <= 60)
            {
                indcSunshine.Image = Properties.Resources.sun_100;
            }

            sunshine.Text = value.ToString();
        }
        public void setRainfall(object value)
        {
            int amount = Convert.ToInt32(value)*10;

            if (amount <= 10)
            {
                indcRainfall.Image = Properties.Resources.rain_0;
            }

            else if (amount > 10 && amount <= 20)
            {
                indcRainfall.Image = Properties.Resources.rain_20;
            }

            else if (amount > 20 && amount <= 30)
            {
                indcRainfall.Image = Properties.Resources.rain_40;
            }

            else if (amount > 30 && amount <= 40)
            {
                indcRainfall.Image = Properties.Resources.rain_60;
            }

            else if (amount > 40 && amount <= 50)
            {
                indcRainfall.Image = Properties.Resources.rain_80;
            }

            else if (amount > 50 && amount <= 60)
            {
                indcRainfall.Image = Properties.Resources.rain_100;
            }

            rainfall.Text = value.ToString();
        }
        public void setRainfallAmount(object value)
        {
            int amount = Convert.ToInt32(value)*10;

            if (amount <= 20)
            {
                indcRainfallAmount.Image = Properties.Resources.waterline_0;
            }

            else if (amount < 20 && amount <= 40)
            {
                indcRainfallAmount.Image = Properties.Resources.waterline_20;
            }

            else if (amount > 40 && amount <= 60)
            {
                indcRainfallAmount.Image = Properties.Resources.waterline_40;
            }

            else if (amount > 60 && amount <= 80)
            {
                indcRainfallAmount.Image = Properties.Resources.waterline_60;
            }

            else if (amount > 80 && amount <= 100)
            {
                indcRainfallAmount.Image = Properties.Resources.waterline_80;
            }

            else if (amount > 100)
            {
                indcRainfallAmount.Image = Properties.Resources.waterline_100;
            }

            rainfallamount.Text = value.ToString()+"mm";
        }

        public void setCloudage(object value)
        {
            int amount = Convert.ToInt32(value);

            if (amount <= 1)
            {
                IndcCloudage.Image = Properties.Resources.cloudage_0;
            }

            else if (amount < 1 && amount <= 2)
            {
                IndcCloudage.Image = Properties.Resources.cloudage_20;
            }

            else if (amount > 2 && amount <= 4)
            {
                IndcCloudage.Image = Properties.Resources.cloudage_40;
            }

            else if (amount > 4 && amount <= 6)
            {
                IndcCloudage.Image = Properties.Resources.cloudage_60;
            }

            else if (amount > 6 && amount <= 8)
            {
                IndcCloudage.Image = Properties.Resources.cloudage_80;
            }

            else if (amount >= 9)
            {
                IndcCloudage.Image = Properties.Resources.cloudage_100;
            }
            cloudage.Text = value.ToString();
        }

        public void setHumidity(object value)
        {
            humidity.Text = (value.ToString()+'%');
        }

    }
}


text:
package com.guitar.db.repository;

import java.util.Date;
import java.util.List;

import javax.persistence.EntityManager;
import javax.persistence.PersistenceContext;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Repository;

import com.guitar.db.model.Manufacturer;

@Repository
public class ManufacturerRepository {
	@PersistenceContext
	private EntityManager entityManager;

	@Autowired
	private ManufacturerJpaRepository manufacturerJpaRepository;

	/**
	 * Create
	 */
	public Manufacturer create(Manufacturer man) {
//		entityManager.persist(man);
//		entityManager.flush();
//		return man;
		return manufacturerJpaRepository.saveAndFlush(man);
	}

	/**
	 * Update
	 */
	public Manufacturer update(Manufacturer man) {
//		man = entityManager.merge(man);
//		entityManager.flush();
//		return man;
		return manufacturerJpaRepository.saveAndFlush(man);
	}

	/**
	 * Delete
	 */
	public void delete(Manufacturer man) {
//		entityManager.remove(man);
//		entityManager.flush();
		manufacturerJpaRepository.delete(man);
	}

	/**
	 * Find
	 */
	public Manufacturer find(Long id) {

//		return entityManager.find(Manufacturer.class, id);
		return manufacturerJpaRepository.findOne(id);

	}

	/**
	 * Custom finder
	 */
	public List<Manufacturer> getManufacturersFoundedBeforeDate(Date date) {
//		@SuppressWarnings("unchecked")
//		List<Manufacturer> mans = entityManager
//				.createQuery("select m from Manufacturer m where m.foundedDate < :date")
//				.setParameter("date", date).getResultList();
		List<Manufacturer> mans = manufacturerJpaRepository.findByFoundedDateBefore(date);
		return mans;
	}

	/**
	 * Custom finder
	 */
	public Manufacturer getManufacturerByName(String name) {
		Manufacturer man = (Manufacturer)entityManager
				.createQuery("select m from Manufacturer m where m.name like :name")
				.setParameter("name", name + "%").getSingleResult();
		return man;
	}

	/**
	 * Native Query finder
	 */
	public List<Manufacturer> getManufacturersThatSellModelsOfType(String modelType) {
//		@SuppressWarnings("unchecked")
//		List<Manufacturer> mans = entityManager
//				.createNamedQuery("Manufacturer.getAllThatSellAcoustics")
//				.setParameter(1, modelType).getResultList();
//		return mans;
		return manufacturerJpaRepository.getAllThatSellAcoustics(modelType);
	}
}


text:
package restaurant.intermediate;

import restaurant.intermediate.interfaces.RestaurantBaseInterface;
import restaurant.restaurant_cwagoner.CwagonerRestaurant;
import restaurant.restaurant_cwagoner.roles.CwagonerHostRole;
import restaurant.restaurant_davidmca.DavidRestaurant;
import restaurant.restaurant_davidmca.roles.DavidHostRole;
import restaurant.restaurant_duvoisin.AndreRestaurant;
import restaurant.restaurant_duvoisin.roles.AndreHostRole;
import restaurant.restaurant_jerryweb.JerrywebHostRole;
import restaurant.restaurant_jerryweb.JerrywebRestaurant;
import restaurant.restaurant_maggiyan.MaggiyanRestaurant;
import restaurant.restaurant_maggiyan.roles.MaggiyanHostRole;
import restaurant.restaurant_smileham.SmilehamRestaurant;
import restaurant.restaurant_smileham.roles.SmilehamHostRole;
import restaurant.restaurant_tranac.TranacRestaurant;
import restaurant.restaurant_tranac.roles.TranacHostRole;
import restaurant.restaurant_xurex.RexHostRole;
import restaurant.restaurant_xurex.gui.RexAnimationPanel;
import base.BaseRole;
import base.ContactList;
import base.Location;
import base.interfaces.Person;
import base.interfaces.Role;

public class RestaurantHostRole extends BaseRole implements
		RestaurantBaseInterface {

	static int totalHosts = 0;
	public Role subRole = null;
	int mRestaurantID;

	public RestaurantHostRole(Person person, int restaurantID){
		super(person);
		this.mRestaurantID = restaurantID;
	}

	public void setPerson(Person person) {

		super.mPerson = person;
		switch (mRestaurantID) {
		case 0: // andre
			subRole = new AndreHostRole(super.mPerson);
			if(AndreRestaurant.host == null) {
				AndreRestaurant.host = (AndreHostRole) subRole;
			} else {
				subRole = AndreRestaurant.host;
			}
			break;
		case 1: // chase
			subRole = new CwagonerHostRole(super.mPerson);
			if (CwagonerRestaurant.host == null) {
				CwagonerRestaurant.addPerson((CwagonerHostRole)subRole);
			}
			else {
				subRole = CwagonerRestaurant.host;
			}
			break;
		case 2: // jerry
			subRole = new JerrywebHostRole(super.mPerson);
			if(JerrywebRestaurant.host == null){
				JerrywebRestaurant.host = (JerrywebHostRole) subRole;
			} else {
				subRole = JerrywebRestaurant.host;
			}
			break;
		case 3: // maggi
			subRole = new MaggiyanHostRole(super.mPerson);
			if (MaggiyanRestaurant.mHost == null) {
				MaggiyanRestaurant.mHost = (MaggiyanHostRole) subRole;
			} else {
				subRole = MaggiyanRestaurant.mHost;
			}
			break;
		case 4: // david
			subRole = new DavidHostRole(super.mPerson);
			if (DavidRestaurant.host == null) {
				DavidRestaurant.host = (DavidHostRole) subRole;
			} else {
				subRole = DavidRestaurant.host;
			}
			break;
		case 5: // shane
			subRole = new SmilehamHostRole(super.mPerson);
			if (SmilehamRestaurant.mHost == null) {
				SmilehamRestaurant.addPerson((SmilehamHostRole) subRole);
			} else {
				subRole = SmilehamRestaurant.mHost;
			}
			break;
		case 6: // angelica
			subRole = new TranacHostRole(mPerson);
			TranacRestaurant.addPerson((TranacHostRole)subRole);
			break;
		case 7: // rex
			subRole = new RexHostRole(super.mPerson);
			RexAnimationPanel.addPerson((RexHostRole)subRole);
			break;
		}
	}

	public boolean pickAndExecuteAnAction() {
		return subRole.pickAndExecuteAnAction();
	}

	@Override
	public Location getLocation() {
		return ContactList.cRESTAURANT_LOCATIONS.get(mRestaurantID);
	}

}


text:
    <meta http-equiv="Content-Type" content="text/html; charset=utf-8">
    <link rel="stylesheet" href="http://www.petercorke.com/RVC/common/toolboxhelp.css">
    <title>M-File Help: VREP_arm</title>

      M-File Help: VREP_arm
      View code for VREP_arm

VREP_arm

Mirror of V-REP robot arm object

Mirror objects are MATLAB objects that reflect the state of objects in
the V-REP environment.  Methods allow the V-REP state to be examined or
changed.

This is a concrete class, derived from VREP_mirror, for all V-REP robot
arm objects and allows access to joint variables.

Methods throw exception if an error occurs.

Example

vrep = VREP();
arm = vrep.arm('IRB140');
q = arm.getq();
arm.setq(zeros(1,6));
arm.setpose(T);  % set pose of base

Methods

 getq	 get joint coordinates

 setq	 set joint coordinates

 setjointmode	 set joint control parameters

 animate	 animate a joint coordinate trajectory

 teach	 graphical teach pendant

Superclass methods (VREP_obj)

 getpos	 get position of object

 setpos	 set position of object

 getorient	 get orientation of object

 setorient	 set orientation of object

 getpose	 get pose of object given

 setpose	 set pose of object

can be used to set/get the pose of the robot base.

Superclass methods (VREP_mirror)

 getname	 get object name

 setparam_bool	 set object boolean parameter

 setparam_int	 set object integer parameter

 setparam_float	 set object float parameter

 getparam_bool	 get object boolean parameter

 getparam_int	 get object integer parameter

 getparam_float	 get object float parameter

Properties

 n 	 Number of joints

See also

VREP_mirror, VREP_obj, VREP_arm, VREP_camera, VREP_hokuyo

VREP_arm.VREP_arm

Create a robot arm mirror object

arm = VREP_arm(name, options) is a mirror object that corresponds to the
robot arm named name in the V-REP environment.

Options

'fmt', F	 Specify format for joint object names (default '%s_joint%d')

Notes

The number of joints is found by searching for objects
with names systematically derived from the root object name, by
default named NAME_N where N is the joint number starting at 0.

See also

VREP.arm

VREP_arm.animate

Animate V-REP robot

R.animate(qt, options) animates the corresponding V-REP robot with
configurations taken from consecutive rows of qt (MxN) which represents
an M-point trajectory and N is the number of robot joints.

Options

'delay', D	 Delay (s) betwen frames for animation (default 0.1)

'fps', fps	 Number of frames per second for display, inverse of 'delay' option

 '[no]loop'	 Loop over the trajectory forever

See also

SerialLink.plot

VREP_arm.getq

Get joint angles of V-REP robot

ARM.getq() is the vector of joint angles (1xN) from the corresponding
robot arm in the V-REP simulation.

See also

VREP_arm.setq

VREP_arm.setjointmode

Set joint mode

ARM.setjointmode(m, C) sets the motor enable m (0 or 1) and motor control
C (0 or 1) parameters for all joints of this robot arm.

VREP_arm.setq

Set joint angles of V-REP robot

ARM.setq(q) sets the joint angles of the corresponding
robot arm in the V-REP simulation to q (1xN).

See also

VREP_arm.getq

VREP_arm.setqt

Set joint angles of V-REP robot

ARM.setq(q) sets the joint angles of the corresponding
robot arm in the V-REP simulation to q (1xN).

VREP_arm.teach

Graphical teach pendant

R.teach(options) drive a V-REP robot by means of a graphical slider panel.

Options

 'degrees'	 Display angles in degrees (default radians)

'q0', q	 Set initial joint coordinates

Notes

The slider limits are all assumed to be [-pi, +pi]

See also

SerialLink.plot

© 1990-2014 Peter Corke.


text:
BarsPartialSyntax
```handlebars
{{><partial-name> [<context>] [context-map]}}

{{?><partial-name> [<context>] [context-map]}}

// no context, no context-map
{{>name}}

// context, no context-map
{{>name data}}

// no context, context-map
{{>name something=something}}

// context, context-map
{{>name data something=something}}
```

PartialContextEvaluation
```javascript
// no context, no context-map
context.newContext(
  // this
  parentContext
)

// context, no context-map
context.newContext(
  // this
  parentContext.data
)

// no context, context-map
context.newContext(
  // this
  parentContext
).map({
  something: parentContext.something
})

// context, context-map
context.newContext(
  // this
  parentContext.data
).map({
  something: parentContext.something
})
```

StateObject
```javascript
{
  data: {[data]},
  something: 'something'
}
```

BarsPartialRenderScope
```javascript
// no context, no context-map
this      -> parentContext

// context, no context-map
this      -> parentContext.data

// no context, context-map
this      -> parentContext
something -> parentContext.something

// context, context-map
this      -> parentContext.data
something -> parentContext.something
```

RenderTree examples
```javascript
BarsPartial:children_dynamic() ? DYNAMIC : STATIC
    name:literal(context(<name-expression>)) ? STATIC : DYNAMIC
    context:literal(context(<context>)) ? STATIC : DYNAMIC
    maps:children_dynamic() ? DYNAMIC : STATIC
        context(<key>):literal(context(<key>)) ? STATIC : DYNAMIC
    fragment:children_dynamic() ? DYNAMIC : STATIC
```
partial.bars
```handlebars
This is a static partial
```


text:
// Copyright (C) 2006 Google Inc.
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
//      http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.

package com.google.ical.iter;

import com.google.ical.values.DateValue;

/**
 * an iterable over date values in order.
 *
 * @author mikesamuel+svn@gmail.com (Mike Samuel)
 */
public interface RecurrenceIterable extends Iterable<DateValue> {

  RecurrenceIterator iterator();

}


text:
package coupling.app;

import com.nit.coupling.R;

import coupling.app.ui.AppSectionsPagerAdapter;

import android.os.Bundle;
import android.app.ActionBar;
import android.app.FragmentTransaction;
import android.app.ActionBar.Tab;
import android.support.v4.app.FragmentActivity;
import android.support.v4.view.ViewPager;
import android.view.WindowManager;

/**
 * This is the Main activity of the application
 * it holds pager view with 2 fragments (at the moment)
 *
 * @author Noam Tzumie
 *
 */
public class Main extends FragmentActivity implements ActionBar.TabListener{

	AppSectionsPagerAdapter mAppSectionsPagerAdapter;
	ViewPager mViewPager;

	@Override
	protected void onCreate(Bundle savedInstanceState) {
		super.onCreate(savedInstanceState);

		setContentView(R.layout.activity_main);

		mAppSectionsPagerAdapter = new AppSectionsPagerAdapter(getSupportFragmentManager());
		ActionBar actionBar = getActionBar();

		actionBar.setNavigationMode(ActionBar.NAVIGATION_MODE_TABS);

		mViewPager = (ViewPager) findViewById(R.id.pager);
		mViewPager.setAdapter(mAppSectionsPagerAdapter);

		mViewPager.setOnPageChangeListener(onPageSelected(actionBar));

		for (int i = 0; i < mAppSectionsPagerAdapter.getCount(); i++) {

			actionBar.addTab(
					actionBar.newTab()
					.setText(mAppSectionsPagerAdapter.getPageTitle(i))
					.setTabListener(this));
		}

		getWindow().setSoftInputMode(WindowManager.LayoutParams.SOFT_INPUT_STATE_HIDDEN);
	}

	/**
	 * Handle the navigation between the fragment
	 * @param actionBar
	 * @return
	 */
	private ViewPager.SimpleOnPageChangeListener onPageSelected(final ActionBar actionBar){
		return new ViewPager.SimpleOnPageChangeListener() {
			@Override
			public void onPageSelected(int position) {
				actionBar.setSelectedNavigationItem(position);
			}
		};
	}

	@Override
	public void onTabReselected(Tab tab, FragmentTransaction ft) {
	}

	@Override
	public void onTabSelected(Tab tab, FragmentTransaction ft) {
		mViewPager.setCurrentItem(tab.getPosition());
	}

	@Override
	public void onTabUnselected(Tab tab, FragmentTransaction ft) {
	}

}


text:
package com.oic.vdd.common.utils;

import android.content.Context;
import android.support.design.widget.Snackbar;
import android.view.View;
import android.widget.Toast;

/**
 * Created by khacpham on 1/7/16.
 */
public class ToastUtils {

    static Toast toast;
    static Snackbar snackbar;

    public static void showToast(Context context,String text){
        if(toast == null){
            toast = Toast.makeText(context,text,Toast.LENGTH_SHORT);
        }
        toast.cancel();
        toast.setText(text);
        toast.show();
    }

    public static void setSnackbar(Snackbar snackbar){
        snackbar = snackbar;
    }

    public static void showSnack(String text){
        if(snackbar == null){
            return;
        }
        snackbar.setText(text);
        snackbar.setAction("Close", new View.OnClickListener() {
            @Override
            public void onClick(View v) {
                snackbar.dismiss();
            }
        });
        snackbar.show();
    }
}


text:
from twisted.application.service import ServiceMaker

scribe = ServiceMaker(
        "A scribe server",
        "scrivener.tap",
        "The thrift scribe service.",
        "scrivener")


text:
    Bouton 1
    Bouton 2
    Bouton 3
    Bouton 4


text:
package de.hopmann.repositories.subversion.entity;

import javax.persistence.Entity;

import de.hopmann.msc.commons.model.Version;
import de.hopmann.repositories.commons.entity.PackageEntity;

@Entity
public class SVNPackageEntity extends PackageEntity {
	private static final long serialVersionUID = 1L;

	public SVNPackageEntity() {

	}

	public SVNPackageEntity(String sourceLocation, Version sourceVersion) {
		setSourceLocation(sourceLocation);
		setSourceVersion(sourceVersion);
	}

}


text:
package com.o3dr.android.dp.wear.widgets.indicators;

import android.content.Context;
import android.content.res.Resources;
import android.content.res.TypedArray;
import android.graphics.Canvas;
import android.graphics.Paint;
import android.graphics.drawable.Drawable;
import android.os.Parcel;
import android.os.Parcelable;
import android.util.AttributeSet;
import android.util.FloatMath;
import android.view.View;

import com.o3dr.android.dp.wear.R;

/**
 * Draws a line for each page. The current page line is colored differently
 * than the unselected page lines.
 */
public class LinePageIndicator extends View implements PageIndicator {
    private static final int INVALID_POINTER = -1;

    private final Paint mPaintUnselected = new Paint(Paint.ANTI_ALIAS_FLAG);
    private final Paint mPaintSelected = new Paint(Paint.ANTI_ALIAS_FLAG);

    private int mPageCount;
    private int mCurrentPage;
    private boolean mCentered;
    private float mLineWidth;
    private float mGapWidth;

    public LinePageIndicator(Context context) {
        this(context, null);
    }

    public LinePageIndicator(Context context, AttributeSet attrs) {
        this(context, attrs, R.attr.vpiLinePageIndicatorStyle);
    }

    public LinePageIndicator(Context context, AttributeSet attrs, int defStyle) {
        super(context, attrs, defStyle);
        if (isInEditMode()) return;

        final Resources res = getResources();

        //Load defaults from resources
        final int defaultPageCount = res.getInteger(R.integer.default_indicator_page_count);
        final int defaultSelectedColor = res.getColor(R.color.default_line_indicator_selected_color);
        final int defaultUnselectedColor = res.getColor(R.color.default_line_indicator_unselected_color);
        final float defaultLineWidth = res.getDimension(R.dimen.default_line_indicator_line_width);
        final float defaultGapWidth = res.getDimension(R.dimen.default_line_indicator_gap_width);
        final float defaultStrokeWidth = res.getDimension(R.dimen.default_line_indicator_stroke_width);
        final boolean defaultCentered = res.getBoolean(R.bool.default_line_indicator_centered);

        //Retrieve styles attributes
        TypedArray a = context.obtainStyledAttributes(attrs, R.styleable.LinePageIndicator, defStyle, 0);

        mPageCount = a.getInt(R.styleable.LinePageIndicator_pageCount, defaultPageCount);
        mCentered = a.getBoolean(R.styleable.LinePageIndicator_centered, defaultCentered);
        mLineWidth = a.getDimension(R.styleable.LinePageIndicator_lineWidth, defaultLineWidth);
        mGapWidth = a.getDimension(R.styleable.LinePageIndicator_gapWidth, defaultGapWidth);
        setStrokeWidth(a.getDimension(R.styleable.LinePageIndicator_strokeWidth, defaultStrokeWidth));
        mPaintUnselected.setColor(a.getColor(R.styleable.LinePageIndicator_unselectedColor, defaultUnselectedColor));
        mPaintSelected.setColor(a.getColor(R.styleable.LinePageIndicator_selectedColor, defaultSelectedColor));

        Drawable background = a.getDrawable(R.styleable.LinePageIndicator_android_background);
        if (background != null) {
            setBackgroundDrawable(background);
        }

        a.recycle();
    }

    public void setCentered(boolean centered) {
        mCentered = centered;
        invalidate();
    }

    public boolean isCentered() {
        return mCentered;
    }

    public void setUnselectedColor(int unselectedColor) {
        mPaintUnselected.setColor(unselectedColor);
        invalidate();
    }

    public int getUnselectedColor() {
        return mPaintUnselected.getColor();
    }

    public void setSelectedColor(int selectedColor) {
        mPaintSelected.setColor(selectedColor);
        invalidate();
    }

    public int getSelectedColor() {
        return mPaintSelected.getColor();
    }

    public void setLineWidth(float lineWidth) {
        mLineWidth = lineWidth;
        invalidate();
    }

    public float getLineWidth() {
        return mLineWidth;
    }

    public void setStrokeWidth(float lineHeight) {
        mPaintSelected.setStrokeWidth(lineHeight);
        mPaintUnselected.setStrokeWidth(lineHeight);
        invalidate();
    }

    public float getStrokeWidth() {
        return mPaintSelected.getStrokeWidth();
    }

    public void setGapWidth(float gapWidth) {
        mGapWidth = gapWidth;
        invalidate();
    }

    public float getGapWidth() {
        return mGapWidth;
    }

    @Override
    protected void onDraw(Canvas canvas) {
        super.onDraw(canvas);

        final int count = mPageCount;
        if (count == 0) {
            return;
        }

        if (mCurrentPage >= count) {
            setCurrentItem(count - 1);
            return;
        }

        final float lineWidthAndGap = mLineWidth + mGapWidth;
        final float indicatorWidth = (count * lineWidthAndGap) - mGapWidth;
        final float paddingTop = getPaddingTop();
        final float paddingLeft = getPaddingLeft();
        final float paddingRight = getPaddingRight();

        float verticalOffset = paddingTop + ((getHeight() - paddingTop - getPaddingBottom()) / 2.0f);
        float horizontalOffset = paddingLeft;
        if (mCentered) {
            horizontalOffset += ((getWidth() - paddingLeft - paddingRight) / 2.0f) - (indicatorWidth / 2.0f);
        }

        //Draw stroked circles
        for (int i = 0; i < count; i++) {
            float dx1 = horizontalOffset + (i * lineWidthAndGap);
            float dx2 = dx1 + mLineWidth;
            canvas.drawLine(dx1, verticalOffset, dx2, verticalOffset, (i == mCurrentPage) ? mPaintSelected : mPaintUnselected);
        }
    }

    @Override
    public void setCurrentItem(int item) {
        mCurrentPage = item;
        invalidate();
    }

    @Override
    public void setPageCount(int count) {
        mPageCount = count;
        invalidate();
    }

    @Override
    public void onPageScrollStateChanged(int state) {
    }

    @Override
    public void onPageScrolled(int position, float positionOffset, int positionOffsetPixels) {
    }

    @Override
    public void onPageSelected(int position) {
        mCurrentPage = position;
        invalidate();
    }

    @Override
    protected void onMeasure(int widthMeasureSpec, int heightMeasureSpec) {
        setMeasuredDimension(measureWidth(widthMeasureSpec), measureHeight(heightMeasureSpec));
    }

    /**
     * Determines the width of this view
     *
     * @param measureSpec A measureSpec packed into an int
     * @return The width of the view, honoring constraints from measureSpec
     */
    private int measureWidth(int measureSpec) {
        float result;
        int specMode = MeasureSpec.getMode(measureSpec);
        int specSize = MeasureSpec.getSize(measureSpec);

        if ((specMode == MeasureSpec.EXACTLY)) {
            //We were told how big to be
            result = specSize;
        } else {
            //Calculate the width according the views count
            final int count = mPageCount;
            result = getPaddingLeft() + getPaddingRight() + (count * mLineWidth) + ((count - 1) * mGapWidth);
            //Respect AT_MOST value if that was what is called for by measureSpec
            if (specMode == MeasureSpec.AT_MOST) {
                result = Math.min(result, specSize);
            }
        }
        return (int) FloatMath.ceil(result);
    }

    /**
     * Determines the height of this view
     *
     * @param measureSpec A measureSpec packed into an int
     * @return The height of the view, honoring constraints from measureSpec
     */
    private int measureHeight(int measureSpec) {
        float result;
        int specMode = MeasureSpec.getMode(measureSpec);
        int specSize = MeasureSpec.getSize(measureSpec);

        if (specMode == MeasureSpec.EXACTLY) {
            //We were told how big to be
            result = specSize;
        } else {
            //Measure the height
            result = mPaintSelected.getStrokeWidth() + getPaddingTop() + getPaddingBottom();
            //Respect AT_MOST value if that was what is called for by measureSpec
            if (specMode == MeasureSpec.AT_MOST) {
                result = Math.min(result, specSize);
            }
        }
        return (int) FloatMath.ceil(result);
    }

    @Override
    public void onRestoreInstanceState(Parcelable state) {
        SavedState savedState = (SavedState) state;
        super.onRestoreInstanceState(savedState.getSuperState());
        mCurrentPage = savedState.currentPage;
        requestLayout();
    }

    @Override
    public Parcelable onSaveInstanceState() {
        Parcelable superState = super.onSaveInstanceState();
        SavedState savedState = new SavedState(superState);
        savedState.currentPage = mCurrentPage;
        return savedState;
    }

    static class SavedState extends BaseSavedState {
        int currentPage;

        public SavedState(Parcelable superState) {
            super(superState);
        }

        private SavedState(Parcel in) {
            super(in);
            currentPage = in.readInt();
        }

        @Override
        public void writeToParcel(Parcel dest, int flags) {
            super.writeToParcel(dest, flags);
            dest.writeInt(currentPage);
        }

        @SuppressWarnings("UnusedDeclaration")
        public static final Parcelable.Creator<SavedState> CREATOR = new Parcelable.Creator<SavedState>() {
            @Override
            public SavedState createFromParcel(Parcel in) {
                return new SavedState(in);
            }

            @Override
            public SavedState[] newArray(int size) {
                return new SavedState[size];
            }
        };
    }
}


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

	<meta content="text/html; charset=UTF-8" http-equiv="Content-Type" />
	<meta content="2013-12-25 10:18:47 -0700" http-equiv="change-date" />
	<title>2SM 1</title>

	<link rel="stylesheet" href='../css/bpi.css' >

2º Samuel 1

1Depois da morte de Saul, tendo Davi voltado da derrota dos amalequitas e estando há dois dias em Ziclague,

2ao terceiro dia veio um homem do arraial de Saul, com as vestes rasgadas e a cabeça coberta de terra; e, chegando ele a Davi, prostrou-se em terra e lhe fez reverência.

3Perguntou-lhe Davi: Donde vens? Ele lhe respondeu: Escapei do arraial de Israel.

4Davi ainda lhe indagou: Como foi lá isso? Dize-mo. Ao que ele lhe respondeu: O povo fugiu da batalha, e muitos do povo caíram, e morreram; também Saul e Jônatas, seu filho, foram mortos.

5Perguntou Davi ao mancebo que lhe trazia as novas: Como sabes que Saul e Jônatas, seu filho, são mortos?

6Então disse o mancebo que lhe dava a notícia: Achava-me por acaso no monte Gilboa, e eis que Saul se encostava sobre a sua lança; os carros e os cavaleiros apertavam com ele.

7Nisso, olhando ele para trás, viu-me e me chamou; e eu disse: Eis-me aqui.

8Ao que ele me perguntou: Quem és tu? E eu lhe respondi: Sou amalequita.

9Então ele me disse: Chega-te a mim, e mata-me, porque uma vertigem se apoderou de mim, e toda a minha vida está ainda em mim.

10Cheguei-me, pois, a ele, e o matei, porque bem sabia eu que ele não viveria depois de ter caído; e tomei a coroa que ele tinha na cabeça, e o bracelete que trazia no braço, e os trouxe aqui a meu senhor.

11Então pegou Davi nas suas vestes e as rasgou; e assim fizeram também todos os homens que estavam com ele;

12e prantearam, e choraram, e jejuaram até a tarde por Saul, e por Jônatas, seu filho, e pelo povo do Senhor, e pela casa de Israel, porque tinham caída à espada.

13Perguntou então Davi ao mancebo que lhe trouxera a nova: Donde és tu? Respondeu ele: Sou filho de um peregrino amalequita.

14Davi ainda lhe perguntou: Como não temeste estender a mão para matares o ungido do Senhor?

15Então Davi, chamando um dos mancebos, disse-lhe: chega-te, e lança-te sobre ele. E o mancebo o feriu, de sorte que morreu.

16Pois Davi lhe dissera: O teu sangue seja sobre a tua cabeça, porque a tua própria boca testificou contra ti, dizendo: Eu matei o ungido do Senhor.

17Lamentou Davi a Saul e a Jônatas, seu filho, com esta lamentação,

18mandando que fosse ensinada aos filhos de Judá; eis que está escrita no livro de Jasar:

19Tua glória, ó Israel, foi morta sobre os teus altos! Como caíram os valorosos!

20Não o noticieis em Gate, nem o publiqueis nas ruas de Asquelom; para que não se alegrem as filhas dos filisteus, para que não exultem as filhas dos incircuncisos.

21Vós, montes de Gilboa, nem orvalho, nem chuva caia sobre, vós, ó campos de morte; pois ali desprezivelmente foi arrojado o escudo dos valorosos, o escudo de Saul, ungido com óleo.

22Do sangue dos feridos, da gordura dos valorosos, nunca recuou o arco de Jônatas, nem voltou vazia a espada de Saul.

23Saul e Jônatas, tão queridos e amáveis na sua vida, também na sua morte não se separaram; eram mais ligeiros do que as águias, mais fortes do que os leões.

24Vós, filhas de Israel, chorai por Saul, que vos vestia deliciosamente de escarlata, que vos punha sobre os vestidos adornos de ouro.

25Como caíram os valorosos no meio da peleja!

26Angustiado estou por ti, meu irmão Jônatas; muito querido me eras! Maravilhoso me era o teu amor, ultrapassando o amor de mulheres.

27Como caíram os valorosos, e pereceram as armas de guerra!

Almeida Revista e Atualizada© Copyright © 1993 Sociedade Bíblica do Brasil. Todos os direitos reservados. Texto bíblico utilizado com autorização. Saiba mais sobre a Sociedade Bíblica do Brasil. A Sociedade Bíblica do Brasil trabalha para que a Bíblia esteja, efetivamente, ao alcance de todos e seja lida por todos. A SBB é uma entidade sem fins lucrativos, dedicada a promover o desenvolvimento integral do ser humano.


text:
#pragma once
#include "kernel/type_checker.h"
namespace lean {
enum class congr_arg_kind { Fixed, Singleton, Eq };
optional<expr> mk_congr_subsingleton_thm(type_checker & tc, io_state const & ios,
                                         expr const & fn, optional<unsigned> const & expected_num_args,
                                         buffer<congr_arg_kind> & arg_kinds, constraint_seq & cs);
void initialize_congruence_tactic();
void finalize_congruence_tactic();
}


text:
<!doctype html>
<html ng-app='myApp'>
<head>
  <meta charset="UTF-8">
  <title>自定义指令,实现输入框基本功能</title>
  <!-- <link rel="stylesheet" href="http://cdnjs.cloudflare.com/ajax/libs/twitter-bootstrap/2.3.2/css/bootstrap.min.css"> -->
  <script src="js/libs/angular.js"></script>
</head>
<body ng-controller="DemoCtrl">
  <p>
    <input type="text" focus-on value="{{holder}}">
  </p>

  <script type="text/javascript">
    var myApp = angular.module("myApp",[]);
    myApp.controller("DemoCtrl", function($scope){
      $scope.holder = "Please type in some words";
    });
    myApp.directive( 'focusOn', function() {
      return {
        restrict: 'A',
        scope: false,
        link: function( scope, element, attrs ) {
          element.bind('focus', function() {
            if( element[0].value === "Please type in some words" )
            element[0].value = "";
          } );
          element.bind('blur', function() {
            if( element[0].value.length=== 0 ) {
              element[0].value = "Please type in some words";
            }
          });
        }
      }
    } );
  </script>
</body>
</html>


text:
using System;
using System.Collections.Generic;
using System.Linq;
using Microsoft.Owin;
using Owin;

[assembly: OwinStartup(typeof(feal.PantryGuide.Api.Startup))]

namespace feal.PantryGuide.Api
{
    public partial class Startup
    {
        public void Configuration(IAppBuilder app)
        {
            ConfigureAuth(app);
        }
    }
}


text:
namespace autofill {

CardUnmaskPromptControllerImpl::CardUnmaskPromptControllerImpl(
    const RiskDataCallback& risk_data_callback,
    PrefService* pref_service,
    bool is_off_the_record)
    : risk_data_callback_(risk_data_callback),
      pref_service_(pref_service),
      new_card_link_clicked_(false),
      is_off_the_record_(is_off_the_record),
      card_unmask_view_(nullptr),
      unmasking_result_(AutofillClient::NONE),
      unmasking_initial_should_store_pan_(false),
      unmasking_number_of_attempts_(0),
      weak_pointer_factory_(this) {
}

CardUnmaskPromptControllerImpl::~CardUnmaskPromptControllerImpl() {
  if (card_unmask_view_)
    card_unmask_view_->ControllerGone();
}

void CardUnmaskPromptControllerImpl::ShowPrompt(
    CardUnmaskPromptView* card_unmask_view,
    const CreditCard& card,
    base::WeakPtr<CardUnmaskDelegate> delegate) {
  if (card_unmask_view_)
    card_unmask_view_->ControllerGone();

  new_card_link_clicked_ = false;
  shown_timestamp_ = base::Time::Now();
  pending_response_ = CardUnmaskDelegate::UnmaskResponse();
  LoadRiskFingerprint();
  card_unmask_view_ = card_unmask_view;
  card_ = card;
  delegate_ = delegate;
  card_unmask_view_->Show();
  unmasking_result_ = AutofillClient::NONE;
  unmasking_number_of_attempts_ = 0;
  unmasking_initial_should_store_pan_ = GetStoreLocallyStartState();
  AutofillMetrics::LogUnmaskPromptEvent(AutofillMetrics::UNMASK_PROMPT_SHOWN);
}

bool CardUnmaskPromptControllerImpl::AllowsRetry(
    AutofillClient::GetRealPanResult result) {
  if (result == AutofillClient::NETWORK_ERROR ||
      result == AutofillClient::PERMANENT_FAILURE) {
    return false;
  }
  return true;
}

void CardUnmaskPromptControllerImpl::OnVerificationResult(
    AutofillClient::GetRealPanResult result) {
  if (!card_unmask_view_)
    return;

  base::string16 error_message;
  switch (result) {
    case AutofillClient::SUCCESS:
      break;

    case AutofillClient::TRY_AGAIN_FAILURE: {
      error_message = l10n_util::GetStringUTF16(
          IDS_AUTOFILL_CARD_UNMASK_PROMPT_ERROR_TRY_AGAIN);
      break;
    }

    case AutofillClient::PERMANENT_FAILURE: {
      error_message = l10n_util::GetStringUTF16(
          IDS_AUTOFILL_CARD_UNMASK_PROMPT_ERROR_PERMANENT);
      break;
    }

    case AutofillClient::NETWORK_ERROR: {
      error_message = l10n_util::GetStringUTF16(
          IDS_AUTOFILL_CARD_UNMASK_PROMPT_ERROR_NETWORK);
      break;
    }

    case AutofillClient::NONE:
      NOTREACHED();
      return;
  }

  unmasking_result_ = result;
  AutofillMetrics::LogRealPanResult(result);
  AutofillMetrics::LogUnmaskingDuration(base::Time::Now() - verify_timestamp_,
                                        result);
  card_unmask_view_->GotVerificationResult(error_message,
                                           AllowsRetry(result));
}

void CardUnmaskPromptControllerImpl::OnUnmaskDialogClosed() {
  card_unmask_view_ = nullptr;
  LogOnCloseEvents();
  if (delegate_.get())
    delegate_->OnUnmaskPromptClosed();
}

void CardUnmaskPromptControllerImpl::LogOnCloseEvents() {
  AutofillMetrics::UnmaskPromptEvent close_reason_event = GetCloseReasonEvent();
  AutofillMetrics::LogUnmaskPromptEvent(close_reason_event);
  AutofillMetrics::LogUnmaskPromptEventDuration(
      base::Time::Now() - shown_timestamp_, close_reason_event);

  if (close_reason_event == AutofillMetrics::UNMASK_PROMPT_CLOSED_NO_ATTEMPTS)
    return;

  if (close_reason_event ==
      AutofillMetrics::UNMASK_PROMPT_CLOSED_ABANDON_UNMASKING) {
    AutofillMetrics::LogTimeBeforeAbandonUnmasking(base::Time::Now() -
                                                   verify_timestamp_);
  }

  bool final_should_store_pan = pending_response_.should_store_pan;
  if (unmasking_result_ == AutofillClient::SUCCESS && final_should_store_pan) {
    AutofillMetrics::LogUnmaskPromptEvent(
        AutofillMetrics::UNMASK_PROMPT_SAVED_CARD_LOCALLY);
  }

  if (CanStoreLocally()) {
    // Tracking changes in local save preference.
    AutofillMetrics::UnmaskPromptEvent event;
    if (unmasking_initial_should_store_pan_ && final_should_store_pan) {
      event = AutofillMetrics::UNMASK_PROMPT_LOCAL_SAVE_DID_NOT_OPT_OUT;
    } else if (!unmasking_initial_should_store_pan_ &&
               !final_should_store_pan) {
      event = AutofillMetrics::UNMASK_PROMPT_LOCAL_SAVE_DID_NOT_OPT_IN;
    } else if (unmasking_initial_should_store_pan_ && !final_should_store_pan) {
      event = AutofillMetrics::UNMASK_PROMPT_LOCAL_SAVE_DID_OPT_OUT;
    } else {
      event = AutofillMetrics::UNMASK_PROMPT_LOCAL_SAVE_DID_OPT_IN;
    }
    AutofillMetrics::LogUnmaskPromptEvent(event);
  }
}

AutofillMetrics::UnmaskPromptEvent
CardUnmaskPromptControllerImpl::GetCloseReasonEvent() {
  if (unmasking_number_of_attempts_ == 0)
    return AutofillMetrics::UNMASK_PROMPT_CLOSED_NO_ATTEMPTS;

  // If NONE and we have a pending request, we have a pending GetRealPan
  // request.
  if (unmasking_result_ == AutofillClient::NONE)
    return AutofillMetrics::UNMASK_PROMPT_CLOSED_ABANDON_UNMASKING;

  if (unmasking_result_ == AutofillClient::SUCCESS) {
    return unmasking_number_of_attempts_ == 1
        ? AutofillMetrics::UNMASK_PROMPT_UNMASKED_CARD_FIRST_ATTEMPT
        : AutofillMetrics::UNMASK_PROMPT_UNMASKED_CARD_AFTER_FAILED_ATTEMPTS;
  } else {
    return AllowsRetry(unmasking_result_)
        ? AutofillMetrics::
            UNMASK_PROMPT_CLOSED_FAILED_TO_UNMASK_RETRIABLE_FAILURE
        : AutofillMetrics::
            UNMASK_PROMPT_CLOSED_FAILED_TO_UNMASK_NON_RETRIABLE_FAILURE;
  }
}

void CardUnmaskPromptControllerImpl::OnUnmaskResponse(
    const base::string16& cvc,
    const base::string16& exp_month,
    const base::string16& exp_year,
    bool should_store_pan) {
  verify_timestamp_ = base::Time::Now();
  unmasking_number_of_attempts_++;
  unmasking_result_ = AutofillClient::NONE;
  card_unmask_view_->DisableAndWaitForVerification();

  DCHECK(InputCvcIsValid(cvc));
  base::TrimWhitespace(cvc, base::TRIM_ALL, &pending_response_.cvc);
  if (ShouldRequestExpirationDate()) {
    DCHECK(InputExpirationIsValid(exp_month, exp_year));
    pending_response_.exp_month = exp_month;
    pending_response_.exp_year = exp_year;
  }
  if (CanStoreLocally()) {
    pending_response_.should_store_pan = should_store_pan;
    // Remember the last choice the user made (on this device).
    pref_service_->SetBoolean(
        prefs::kAutofillWalletImportStorageCheckboxState, should_store_pan);
  } else {
    DCHECK(!should_store_pan);
    pending_response_.should_store_pan = false;
  }

  if (!pending_response_.risk_data.empty())
    delegate_->OnUnmaskResponse(pending_response_);
}

void CardUnmaskPromptControllerImpl::NewCardLinkClicked() {
  new_card_link_clicked_ = true;
}

base::string16 CardUnmaskPromptControllerImpl::GetWindowTitle() const {
#if defined(OS_IOS)
  // The iOS UI has less room for the title and places a "Verify" button right
  // next to it so the full title ("Verify your" + type and last four) is
  // unnecessary.
  return card_.TypeAndLastFourDigits();
#else
  int ids = ShouldRequestExpirationDate()
      ? IDS_AUTOFILL_CARD_UNMASK_PROMPT_UPDATE_TITLE
      : IDS_AUTOFILL_CARD_UNMASK_PROMPT_TITLE;
  return l10n_util::GetStringFUTF16(ids, card_.TypeAndLastFourDigits());
#endif
}

base::string16 CardUnmaskPromptControllerImpl::GetInstructionsMessage() const {
  if (ShouldRequestExpirationDate()) {
    return l10n_util::GetStringUTF16(
        card_.type() == kAmericanExpressCard
            ? IDS_AUTOFILL_CARD_UNMASK_PROMPT_INSTRUCTIONS_EXPIRED_AMEX
            : IDS_AUTOFILL_CARD_UNMASK_PROMPT_INSTRUCTIONS_EXPIRED);
  }

  return l10n_util::GetStringUTF16(
      card_.type() == kAmericanExpressCard
          ? IDS_AUTOFILL_CARD_UNMASK_PROMPT_INSTRUCTIONS_AMEX
          : IDS_AUTOFILL_CARD_UNMASK_PROMPT_INSTRUCTIONS);
}

int CardUnmaskPromptControllerImpl::GetCvcImageRid() const {
  return card_.type() == kAmericanExpressCard ? IDR_CREDIT_CARD_CVC_HINT_AMEX
                                              : IDR_CREDIT_CARD_CVC_HINT;
}

bool CardUnmaskPromptControllerImpl::ShouldRequestExpirationDate() const {
  return card_.GetServerStatus() == CreditCard::EXPIRED ||
         new_card_link_clicked_;
}

bool CardUnmaskPromptControllerImpl::CanStoreLocally() const {
  // Never offer to save for incognito.
  if (is_off_the_record_)
    return false;
  return autofill::OfferStoreUnmaskedCards();
}

bool CardUnmaskPromptControllerImpl::GetStoreLocallyStartState() const {
  return pref_service_->GetBoolean(
      prefs::kAutofillWalletImportStorageCheckboxState);
}

bool CardUnmaskPromptControllerImpl::InputCvcIsValid(
    const base::string16& input_text) const {
  base::string16 trimmed_text;
  base::TrimWhitespace(input_text, base::TRIM_ALL, &trimmed_text);
  size_t input_size = card_.type() == kAmericanExpressCard ? 4 : 3;
  return trimmed_text.size() == input_size &&
         base::ContainsOnlyChars(trimmed_text,
                                 base::ASCIIToUTF16("0123456789"));
}

bool CardUnmaskPromptControllerImpl::InputExpirationIsValid(
    const base::string16& month,
    const base::string16& year) const {
  if ((month.size() != 2U && month.size() != 1U) ||
      (year.size() != 4U && year.size() != 2U)) {
    return false;
  }

  int month_value = 0, year_value = 0;
  if (!base::StringToInt(month, &month_value) ||
      !base::StringToInt(year, &year_value)) {
    return false;
  }

  if (month_value < 1 || month_value > 12)
    return false;

  base::Time::Exploded now;
  base::Time::Now().LocalExplode(&now);

  // Convert 2 digit year to 4 digit year.
  if (year_value < 100)
    year_value += (now.year / 100) * 100;

  if (year_value < now.year)
    return false;

  if (year_value > now.year)
    return true;

  return month_value >= now.month;
}

base::TimeDelta CardUnmaskPromptControllerImpl::GetSuccessMessageDuration()
    const {
  return base::TimeDelta::FromMilliseconds(500);
}

void CardUnmaskPromptControllerImpl::LoadRiskFingerprint() {
  risk_data_callback_.Run(
      base::Bind(&CardUnmaskPromptControllerImpl::OnDidLoadRiskFingerprint,
                 weak_pointer_factory_.GetWeakPtr()));
}

void CardUnmaskPromptControllerImpl::OnDidLoadRiskFingerprint(
    const std::string& risk_data) {
  pending_response_.risk_data = risk_data;
  if (!pending_response_.cvc.empty())
    delegate_->OnUnmaskResponse(pending_response_);
}

}  // namespace autofill


text:
<?php

namespace LD2\Helper;

class ViewHelper
{
    public static function random($min, $max){
        return random_int($min, $max);
    }
}


text:
path = File.expand_path("..", __FILE__)
require "#{path}/aws/operational"
require "#{path}/aws/configurable"
require "#{path}/aws/security_groups"
require "#{path}/aws/security_group"
require "#{path}/aws/instances"
require "#{path}/aws/instance"
require "#{path}/parser/security_groups"
require "#{path}/parser/instances"
require "#{path}/loader/security_groups"
require "#{path}/loader/instances"
require "#{path}/options"


text:
$LOAD_PATH.unshift File.expand_path('../../lib', __FILE__)
require "s3_thumbnail"
require "s3direct"
require "active_model"
require "aws-sdk"

@fakes3 = Thread.new do
  require "fakes3/cli"
  FakeS3::CLI.start(['--root', File.expand_path('../../tmp/fakes3', __FILE__), '--port', '5678'])
end
sleep(1)

S3Direct.configure do |config|
  config.bucket_url = 'http://localhost:5678/'
  config.bucket = 'specs'
end

AWS.config(
  s3_endpoint: 'localhost',
  s3_port: 5678,
  use_ssl: false,
  s3_force_path_style: true,
  access_key_id: 'YOUR_ACCESS_KEY_ID',
  secret_access_key: 'YOUR_SECRET_ACCESS_KEY'
)


text:
package com.after_sunrise.oss.otdb.lib.tick;

import static com.after_sunrise.commons.base.object.Conversions.map;

import java.math.BigDecimal;
import java.util.Map;

import com.after_sunrise.commons.base.object.Conversions.Identifiable;

/**
 * @author takanori.takase
 */
public enum LibTickTradeType implements Identifiable<BigDecimal> {

	OFF_EXCHANGE(0),

	SESSION_DAY(1),

	SESSION_EVENING(2),

	SESSION_MORNING(3),

	SESSION_AFTERNOON(4);

	private final BigDecimal id;

	private LibTickTradeType(int id) {
		this.id = BigDecimal.valueOf(id);
	}

	public BigDecimal getId() {
		return id;
	}

	private static final Map<BigDecimal, LibTickTradeType> VALUES = map(values());

	public static LibTickTradeType find(BigDecimal value) {
		return VALUES.get(value);
	}

}


text:
<?xml version="1.0" encoding="UTF-8"?>
<project xmlns="http://maven.apache.org/POM/4.0.0"
         xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
         xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">

    <modelVersion>4.0.0</modelVersion>
    <parent>
        <groupId>com.xiaomi.linden</groupId>
        <artifactId>linden-parent</artifactId>
        <version>0.2.0-SNAPSHOT</version>
        <relativePath>../../linden-parent/pom.xml</relativePath>
    </parent>

    <artifactId>cars-http-api-demo</artifactId>
    <packaging>jar</packaging>

    <dependencies>
        <dependency>
            <groupId>com.alibaba</groupId>
            <artifactId>fastjson</artifactId>
            <version>1.2.47</version>
        </dependency>
        <dependency>
            <groupId>junit</groupId>
            <artifactId>junit</artifactId>
            <version>4.13.1</version>
        </dependency>
    </dependencies>
    <properties>
        <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
    </properties>
</project>


text:
/**
 * Created by vcernomschi on 6/17/16.
 */

'use strict';

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

var _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }();

var _github = require('github');

var _github2 = _interopRequireDefault(_github);

function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }

function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }

let GitHubMsgPublisher = function () {
  _createClass(GitHubMsgPublisher, null, [{
    key: 'isPullRequest',

    /**
     * @returns {string}
     * @constructor
     */
    get: function get() {
      let pullRequest = process.env['TRAVIS_PULL_REQUEST'];

      return pullRequest !== 'false' || !isNaN(pullRequest);
    }

    /**
     * @returns {string}
     * @constructor
     */

  }, {
    key: 'gitPRNumber',
    get: function get() {
      return process.env['TRAVIS_PULL_REQUEST'];
    }

    /**
     * @returns {string}
     * @constructor
     */

  }, {
    key: 'gitPrUrl',
    get: function get() {
      return `https://api.github.com/repos/${ GitHubMsgPublisher.gitUser }/${ GitHubMsgPublisher.gitRepoName }/pulls/${ GitHubMsgPublisher.gitPRNumber }`;
    }

    /**
     * @returns {string}
     * @constructor
     */

  }, {
    key: 'gitUser',
    get: function get() {
      return process.env['TRAVIS_REPO_SLUG'].replace(/(.*)\/.*/i, '$1');
    }

    /**
     * @returns {string}
     * @constructor
     */

  }, {
    key: 'gitRepoName',
    get: function get() {
      return process.env['TRAVIS_REPO_SLUG'].replace(/.*\/(.*)/i, '$1');
    }
  }]);

  function GitHubMsgPublisher() {
    _classCallCheck(this, GitHubMsgPublisher);

    this.github = new _github2.default({
      debug: false,
      protocol: 'https',
      host: 'api.github.com',
      timeout: 5000,
      headers: {
        'user-agent': 'Code-Coverage-GitHub-App'
      },
      followRedirects: false, // default: true; there's currently an issue with non-get redirects, so allow ability to disable follow-redirects
      includePreview: true // default: false; includes accept headers to allow use of stuff under preview period
    });

    this.github.authenticate({
      type: 'oauth',
      token: process.env['GITHUB_OAUTH_TOKEN']
    });
  }

  /**
   * Add comments for PR or fails if coverage
   * @param {Number} s3SumPercent - s3 summary coverage percent
   * @param {Number} localSumPercent - local summary coverage percent
   * @param {Function} callback
   */

  _createClass(GitHubMsgPublisher, [{
    key: 'addComment',
    value: function addComment(s3SumPercent, localSumPercent, callback) {
      let commentMsg;

      //failed if coverage decreased more that 1 %
      let isFailed = localSumPercent + 1 < s3SumPercent;
      let failMsg = 'Failed due to decreasing coverage';

      //no need to add comments for !PR
      if (!GitHubMsgPublisher.isPullRequest) {
        callback(null, null);
        return;
      }

      if (isFailed) {
        commentMsg = `:x: coverage decreased from ${ s3SumPercent }% to ${ localSumPercent }%`;
      } else if (localSumPercent === s3SumPercent) {
        commentMsg = `:white_check_mark: coverage remained the same at ${ localSumPercent }%`;
      } else if (-1 < localSumPercent - s3SumPercent && localSumPercent - s3SumPercent < 0) {
        commentMsg = `:warning: coverage decreased less than 1% from ${ s3SumPercent }% to ${ localSumPercent }%`;
      } else {
        commentMsg = `:white_check_mark: coverage increased from ${ s3SumPercent }% to ${ localSumPercent }%`;
      }

      this.github.issues.getComments({
        user: GitHubMsgPublisher.gitUser,
        repo: GitHubMsgPublisher.gitRepoName,
        number: GitHubMsgPublisher.gitPRNumber
      }, (err, issues) => {
        let isCommentAdded = false;

        if (err) {
          console.log(err);
          callback(err, null);
          return;
        }

        for (let issue of issues) {
          if (issue.hasOwnProperty('body') && issue.body === commentMsg) {
            isCommentAdded = true;
            console.log('Comment has already been added: ', commentMsg);

            if (isFailed) {
              console.log(failMsg);
              process.exit(1);
            }
          }
        }

        if (!isCommentAdded) {
          this.github.issues.createComment({
            user: GitHubMsgPublisher.gitUser,
            repo: GitHubMsgPublisher.gitRepoName,
            number: GitHubMsgPublisher.gitPRNumber,
            body: commentMsg
          }, (err, res) => {
            if (err) {
              console.log(err);
              callback(err, null);
              return;
            }

            callback(null, res);

            if (isFailed) {
              console.log(failMsg);
              process.exit(1);
            }
          });
        }
      });
    }
  }]);

  return GitHubMsgPublisher;
}();

exports.default = GitHubMsgPublisher;
module.exports = exports['default'];