text:
package com.scarabsoft.md5viewer.md5;

import com.scarabsoft.md5viewer.Maths;
import org.lwjgl.BufferUtils;
import org.lwjgl.util.vector.Quaternion;
import org.lwjgl.util.vector.Vector3f;

import java.io.BufferedReader;
import java.io.File;
import java.io.FileReader;
import java.io.IOException;
import java.util.ArrayList;
import java.util.List;

public class MD5Animation {

    private int md5Version;
    private int numJoints;
    private int numFrames;
    private int frameRate;
    private int numAnimatedComponents;

    private float frameDuration;
    private float animDuration;
    private float animTime;

    private List<JointInfo> jointInfos = new ArrayList<>();
    private List<Bound> bounds = new ArrayList<>();
    private List<BaseFrame> baseFrames = new ArrayList<>();
    private List<FrameData> frames = new ArrayList<>();
    private List<FrameSkeleton> skeletons = new ArrayList<>();

    public FrameSkeleton animatedSkeleton = new FrameSkeleton();

    public boolean loadAnim(String filename) throws IOException {

        File file = new File(filename);
        BufferedReader reader = new BufferedReader(new FileReader(file));

        jointInfos.clear();
        bounds.clear();
        frames.clear();
        skeletons.clear();
        animatedSkeleton.joints.clear();
        numFrames = 0;

        MD5Extractor extractor = new MD5Extractor();

        String line;
        while((line = reader.readLine()) != null){
            if (line.startsWith("MD5Version")) {
                md5Version = extractor.getIntegerExtractor().extract(line);
            } else if (line.startsWith("commandline")) {
                continue;
            }else if(line.startsWith("numFrames")){
                numFrames = extractor.getIntegerExtractor().extract(line);
            } else if (line.startsWith("numJoints")) {
                numJoints = extractor.getIntegerExtractor().extract(line);
            } else if (line.startsWith("frameRate")) {
                frameRate = extractor.getIntegerExtractor().extract(line);
            }else if(line.startsWith("numAnimatedComponents")){
                numAnimatedComponents = extractor.getIntegerExtractor().extract(line);
            }else if(line.startsWith("hierarchy")){
                for(int i = 0; i < numJoints; i++){
                    jointInfos.add(extractor.getJointInfoExtractor().extract(reader.readLine()));
                }
            }else if(line.startsWith("bounds")){
                for(int i = 0; i < numFrames; i++){
                    bounds.add(extractor.getBoundExtractor().extract(reader.readLine()));
                }
            }else if(line.startsWith("baseframe")){
                for(int i = 0; i < numJoints; i++){
                    baseFrames.add(extractor.getBaseFrameExtractor().extract(reader.readLine()));
                }
            }else if(line.startsWith("frame")){
                int frameNumber = extractor.getFrameNumExtractor().extract(line);
                FrameData frameData = new FrameData(frameNumber);
                for(int i = 0; i < numAnimatedComponents / 6; i++ ) {
                    line = reader.readLine();
                    FrameData tmp = extractor.getFrameDataExtractor(frameNumber).extract(line);
                    frameData.frameData.addAll(tmp.frameData);
                }
                frames.add(frameData);
                buildFrameSkeleton(skeletons, jointInfos, baseFrames,frameData);
            }
        }

        for(int i = 0; i < numJoints; i++){
            animatedSkeleton.joints.add(new SkeletonJoint())                                                                                ;
        }

        frameDuration = 1f / (float) frameRate;
        animDuration = (frameDuration * (float) numFrames);
        animTime = 0.0f;

        update(animTime);

        return true;
    }

    private void buildFrameSkeleton(List<FrameSkeleton> skeletons, List<JointInfo> jointInfos, List<BaseFrame> baseFrames, FrameData frameData){
        FrameSkeleton skeleton = new FrameSkeleton();

        for ( int i = 0; i < jointInfos.size(); i++ )
        {
            int j = 0;
            JointInfo jointInfo = jointInfos.get(i);
            // Start with the base frame position and orientation.
            SkeletonJoint animatedJoint = new SkeletonJoint(baseFrames.get(i));

            animatedJoint.parent = jointInfo.parentId;

            if ( (jointInfo.flags & 1) ==1 ) // Pos.x
            {
                animatedJoint.pos.x = frameData.frameData.get(jointInfo.startIndex + j++ );
            }
            if ( (jointInfo.flags & 2) == 2 ) // Pos.y
            {
                animatedJoint.pos.y = frameData.frameData.get(jointInfo.startIndex + j++ );
            }
            if ( (jointInfo.flags & 4) == 4 ) // Pos.x
            {
                animatedJoint.pos.z = frameData.frameData.get(jointInfo.startIndex + j++ );
            }
            if ( (jointInfo.flags & 8) == 8 ) // Orient.x
            {
                animatedJoint.orientation.x = frameData.frameData.get(jointInfo.startIndex + j++ );
            }
            if ( (jointInfo.flags & 16) == 16 ) // Orient.y
            {
                animatedJoint.orientation.y = frameData.frameData.get(jointInfo.startIndex + j++ );
            }
            if ( (jointInfo.flags & 32) == 32 ) // Orient.z
            {
                animatedJoint.orientation.z = frameData.frameData.get(jointInfo.startIndex + j++ );
            }

            animatedJoint.orientation = Maths.computeQuaternion(animatedJoint.orientation.x, animatedJoint.orientation.y, animatedJoint.orientation.z);

            if(animatedJoint.parent >= 0){

                SkeletonJoint parentJoint = skeleton.joints.get(animatedJoint.parent);
                Vector3f rotPos = Maths.rotate(parentJoint.orientation, animatedJoint.pos);
                animatedJoint.pos = new Vector3f(parentJoint.pos).translate(rotPos.x,rotPos.y,rotPos.z);

                animatedJoint.orientation = Maths.mult(parentJoint.orientation, animatedJoint.orientation);
                animatedJoint.orientation = Maths.normalize(animatedJoint.orientation);
            }
            skeleton.joints.add(animatedJoint);
        }
        skeletons.add(skeleton);
    }

    public void update(float deltaTime){
        if ( numFrames < 1 ) return;

        animTime += deltaTime;

        while ( animTime > animDuration ) animTime -= animDuration;
        while ( animTime < 0.0f ) animTime += animDuration;

        float fFramNum = animTime * (float) frameRate;
        int iFrame0 = (int) Math.floor(fFramNum);
        int iFrame1 = (int) Math.ceil( fFramNum );
        iFrame0 = iFrame0 % numFrames;
        iFrame1 = iFrame1 % numFrames;

        float fInterpolate = (animTime % animDuration );

        interpolateSkeletons( animatedSkeleton, skeletons.get(iFrame0), skeletons.get(iFrame1), fInterpolate );
    }

    public boolean prepareMesh(MD5Mesh mesh )
    {
        if(mesh.positions == null) {
            mesh.positions = BufferUtils.createFloatBuffer(3 * mesh.verts.size());
        }else{
            mesh.positions.mark();
            mesh.positions.reset();
            mesh.positions.rewind();
        }

        if(mesh.normals == null) {
            mesh.normals = BufferUtils.createFloatBuffer(3 * mesh.verts.size());
        }else{
            mesh.normals.mark();
            mesh.normals.reset();
            mesh.normals.rewind();
        }

        for ( int i = 0; i < mesh.verts.size(); i++ )
        {
            Vertex vert = mesh.verts.get(i);

            Vector3f pos = new Vector3f(0,0,0);
            Vector3f normal = new Vector3f(0,0,0);

            for ( int j = 0; j < vert.weightCount; j++ )
            {
                Weight weight = mesh.weights.get(vert.startWeight + j);
                SkeletonJoint joint = animatedSkeleton.joints.get(weight.jointId);

                Vector3f rotPos = Maths.rotate(joint.orientation, weight.pos);
                Vector3f tmp = new Vector3f(joint.pos)
                        .translate(rotPos.x,rotPos.y,rotPos.z);
                tmp.scale(weight.bias);
                pos.translate(tmp.x,tmp.y,tmp.z);

                Vector3f tmpRot = Maths.rotate(joint.orientation, vert.normal);
                tmpRot.scale(weight.bias);
                normal.translate(tmpRot.x,tmpRot.y,tmpRot.z);
            }

            mesh.positions.put(pos.x);
            mesh.positions.put(pos.y);
            mesh.positions.put(pos.z);

            mesh.normals.put(normal.x);
            mesh.normals.put(normal.y);
            mesh.normals.put(normal.z);
        }
        mesh.positions.rewind();
        mesh.normals.rewind();
        return true;
    }

    private void interpolateSkeletons(FrameSkeleton finalSkeleton, FrameSkeleton skeleton0, FrameSkeleton skeleton1, float interpolate ){
            for ( int i = 0; i < numJoints; ++i )
            {
                SkeletonJoint finalJoint = finalSkeleton.joints.get(i);
                SkeletonJoint joint0 = skeleton0.joints.get(i);
                SkeletonJoint joint1 = skeleton1.joints.get(i);

                finalJoint.parent = joint0.parent;
                finalJoint.pos = interpolate(joint0.pos, joint1.pos, interpolate);
                finalJoint.orientation = slerp(joint0.orientation, joint1.orientation, interpolate);
            }
    }

    //Thx to jmonkey engine
    private Vector3f interpolate(Vector3f beginVec,Vector3f finalVec, float changeAmnt) {
        Vector3f res = new Vector3f();
        res.x=(1-changeAmnt)*beginVec.x + changeAmnt*finalVec.x;
        res.y=(1-changeAmnt)*beginVec.y + changeAmnt*finalVec.y;
        res.z=(1-changeAmnt)*beginVec.z + changeAmnt*finalVec.z;
        return res;
    }

    //Thx to jmonkey engine
    private Quaternion slerp(Quaternion q1, Quaternion q2, float t) {
        Quaternion res = new Quaternion();
        // Create a local quaternion to store the interpolated quaternion
        if (q1.x == q2.x && q1.y == q2.y && q1.z == q2.z && q1.w == q2.w) {
            res = q1;
            return res;
        }
        float result = (q1.x * q2.x) + (q1.y * q2.y) + (q1.z * q2.z)
                + (q1.w * q2.w);
        if (result < 0.0f) {
            // Negate the second quaternion and the result of the dot product
            q2.x = -q2.x;
            q2.y = -q2.y;
            q2.z = -q2.z;
            q2.w = -q2.w;
            result = -result;
        }
        // Set the first and second scale for the interpolation
        float scale0 = 1 - t;
        float scale1 = t;
        // Check if the angle between the 2 quaternions was big enough to
        // warrant such calculations
        if ((1 - result) > 0.1f) {// Get the angle between the 2 quaternions,
            // and then store the sin() of that angle
            float theta = (float) Math.acos(result);
            float invSinTheta = 1f / (float) Math.sin(theta);
            // Calculate the scale for q1 and q2, according to the angle and
            // it's sine value
            scale0 = (float) Math.sin((1 - t) * theta) * invSinTheta;
            scale1 = (float) Math.sin((t * theta)) * invSinTheta;
        }
        // Calculate the x, y, z and w values for the quaternion by using a
        // special
        // form of linear interpolation for quaternions.
        res.x = (scale0 * q1.x) + (scale1 * q2.x);
        res.y = (scale0 * q1.y) + (scale1 * q2.y);
        res.z = (scale0 * q1.z) + (scale1 * q2.z);
        res.w = (scale0 * q1.w) + (scale1 * q2.w);
        // Return the interpolated quaternion
        return res;
    }

}


text:
<!DOCTYPE html>
<html>
    <head>
        <meta charset="utf-8">
        <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
        <title>Mr.Dingku</title>
        <meta name="viewport" content="width=device-width">

        <!-- BootstrapCDN CSS -->
        <link rel="stylesheet" href="https://stackpath.bootstrapcdn.com/bootstrap/4.1.2/css/bootstrap.min.css" integrity="sha384-Smlep5jCw/wG7hdkwQ/Z5nLIefveQRIY9nfy6xoR1uRYBtpZgI6339F5dgvm/e9B" crossorigin="anonymous">

        <!-- Custom styles for this template -->
        <link href="https://fonts.googleapis.com/css?family=Playfair+Display:700,900" rel="stylesheet">
    </head>
    <body>

        Mr. Dingku

        <!-- Bootstrap core JavaScript
        ================================================== -->
        <!-- Placed at the end of the document so the pages load faster -->
        <script src="https://code.jquery.com/jquery-3.3.1.slim.min.js" integrity="sha384-q8i/X+965DzO0rT7abK41JStQIAqVgRVzpbzo5smXKp4YfRvH+8abtTE1Pi6jizo" crossorigin="anonymous"></script>
        <script src="https://cdnjs.cloudflare.com/ajax/libs/popper.js/1.14.3/umd/popper.min.js" integrity="sha384-ZMP7rVo3mIykV+2+9J3UJ46jBk0WLaUAdn689aCwoqbBJiSnjAK/l8WvCWPIPm49" crossorigin="anonymous"></script>
        <script src="https://stackpath.bootstrapcdn.com/bootstrap/4.1.2/js/bootstrap.min.js" integrity="sha384-o+RDsa0aLu++PJvFqy8fFScvbHFLtbvScb8AjopnFD+iEQ7wo/CG0xlczd+2O/em" crossorigin="anonymous"></script>
    </body>
</html>

redpajama_set_name: RedPajamaGithub


text:
package io.reactivex.schedulers;

import java.util.Queue;
import java.util.concurrent.*;

import io.reactivex.Scheduler;
import io.reactivex.annotations.NonNull;
import io.reactivex.disposables.*;
import io.reactivex.internal.disposables.EmptyDisposable;
import io.reactivex.internal.functions.ObjectHelper;

/**
 * A special, non thread-safe scheduler for testing operators that require
 * a scheduler without introducing real concurrency and allows manually advancing
 * a virtual time.
 */
public final class TestScheduler extends Scheduler {
    /** The ordered queue for the runnable tasks. */
    final Queue<TimedRunnable> queue = new PriorityBlockingQueue<TimedRunnable>(11);
    /** The per-scheduler global order counter. */
    long counter;
    // Storing time in nanoseconds internally.
    volatile long time;

    static final class TimedRunnable implements Comparable<TimedRunnable> {

        final long time;
        final Runnable run;
        final TestWorker scheduler;
        final long count; // for differentiating tasks at same time

        TimedRunnable(TestWorker scheduler, long time, Runnable run, long count) {
            this.time = time;
            this.run = run;
            this.scheduler = scheduler;
            this.count = count;
        }

        @Override
        public String toString() {
            return String.format("TimedRunnable(time = %d, run = %s)", time, run.toString());
        }

        @Override
        public int compareTo(TimedRunnable o) {
            if (time == o.time) {
                return ObjectHelper.compare(count, o.count);
            }
            return ObjectHelper.compare(time, o.time);
        }
    }

    @Override
    public long now(@NonNull TimeUnit unit) {
        return unit.convert(time, TimeUnit.NANOSECONDS);
    }

    /**
     * Moves the Scheduler's clock forward by a specified amount of time.
     *
     * @param delayTime
     *          the amount of time to move the Scheduler's clock forward
     * @param unit
     *          the units of time that {@code delayTime} is expressed in
     */
    public void advanceTimeBy(long delayTime, TimeUnit unit) {
        advanceTimeTo(time + unit.toNanos(delayTime), TimeUnit.NANOSECONDS);
    }

    /**
     * Moves the Scheduler's clock to a particular moment in time.
     *
     * @param delayTime
     *          the point in time to move the Scheduler's clock to
     * @param unit
     *          the units of time that {@code delayTime} is expressed in
     */
    public void advanceTimeTo(long delayTime, TimeUnit unit) {
        long targetTime = unit.toNanos(delayTime);
        triggerActions(targetTime);
    }

    /**
     * Triggers any actions that have not yet been triggered and that are scheduled to be triggered at or
     * before this Scheduler's present time.
     */
    public void triggerActions() {
        triggerActions(time);
    }

    private void triggerActions(long targetTimeInNanoseconds) {
        while (!queue.isEmpty()) {
            TimedRunnable current = queue.peek();
            if (current.time > targetTimeInNanoseconds) {
                break;
            }
            // if scheduled time is 0 (immediate) use current virtual time
            time = current.time == 0 ? time : current.time;
            queue.remove();

            // Only execute if not unsubscribed
            if (!current.scheduler.disposed) {
                current.run.run();
            }
        }
        time = targetTimeInNanoseconds;
    }

    @NonNull
    @Override
    public Worker createWorker() {
        return new TestWorker();
    }

    final class TestWorker extends Worker {

        volatile boolean disposed;

        @Override
        public void dispose() {
            disposed = true;
        }

        @Override
        public boolean isDisposed() {
            return disposed;
        }

        @NonNull
        @Override
        public Disposable schedule(@NonNull Runnable run, long delayTime, @NonNull TimeUnit unit) {
            if (disposed) {
                return EmptyDisposable.INSTANCE;
            }
            final TimedRunnable timedAction = new TimedRunnable(this, time + unit.toNanos(delayTime), run, counter++);
            queue.add(timedAction);

            return Disposables.fromRunnable(new QueueRemove(timedAction));
        }

        @NonNull
        @Override
        public Disposable schedule(@NonNull Runnable run) {
            if (disposed) {
                return EmptyDisposable.INSTANCE;
            }
            final TimedRunnable timedAction = new TimedRunnable(this, 0, run, counter++);
            queue.add(timedAction);
            return Disposables.fromRunnable(new QueueRemove(timedAction));
        }

        @Override
        public long now(@NonNull TimeUnit unit) {
            return TestScheduler.this.now(unit);
        }

        final class QueueRemove implements Runnable {
            final TimedRunnable timedAction;

            QueueRemove(TimedRunnable timedAction) {
                this.timedAction = timedAction;
            }

            @Override
            public void run() {
                queue.remove(timedAction);
            }
        }
    }
}


text:
app.controller('MainController', ['$scope', 'forecast', function($scope, forecast) {
  forecast.success(function(data) {
    $scope.fiveDay = data;
  });
}]);


text:
@implementation MyBookListCell

- (void)awakeFromNib {
    // Initialization code
}

- (void)setSelected:(BOOL)selected animated:(BOOL)animated {
    [super setSelected:selected animated:animated];
    if (selected) {
        NSLog(@"MyBookList");

        [self setSelected:NO animated:YES];
    }

    // Configure the view for the selected state
}

@end


text:
package im.actor.core.api.rpc;
/*
 *  Generated by the Actor API Scheme generator.  DO NOT EDIT!
 */

import im.actor.runtime.bser.*;
import im.actor.runtime.collections.*;
import static im.actor.runtime.bser.Utils.*;
import im.actor.core.network.parser.*;
import org.jetbrains.annotations.Nullable;
import org.jetbrains.annotations.NotNull;
import com.google.j2objc.annotations.ObjectiveCName;
import java.io.IOException;
import java.util.List;
import java.util.ArrayList;
import im.actor.core.api.*;

public class ResponseIntegrationToken extends Response {

    public static final int HEADER = 0xb7;
    public static ResponseIntegrationToken fromBytes(byte[] data) throws IOException {
        return Bser.parse(new ResponseIntegrationToken(), data);
    }

    private String token;
    private String url;

    public ResponseIntegrationToken(@NotNull String token, @NotNull String url) {
        this.token = token;
        this.url = url;
    }

    public ResponseIntegrationToken() {

    }

    @NotNull
    public String getToken() {
        return this.token;
    }

    @NotNull
    public String getUrl() {
        return this.url;
    }

    @Override
    public void parse(BserValues values) throws IOException {
        this.token = values.getString(1);
        this.url = values.getString(2);
    }

    @Override
    public void serialize(BserWriter writer) throws IOException {
        if (this.token == null) {
            throw new IOException();
        }
        writer.writeString(1, this.token);
        if (this.url == null) {
            throw new IOException();
        }
        writer.writeString(2, this.url);
    }

    @Override
    public String toString() {
        String res = "response IntegrationToken{";
        res += "}";
        return res;
    }

    @Override
    public int getHeaderKey() {
        return HEADER;
    }
}


text:
package at.domkog.ocreplayer.ui.main;

import javafx.scene.control.ProgressBar;
import javafx.scene.control.Slider;
import javafx.scene.layout.StackPane;

public class ProgressSlider extends StackPane {

	public ProgressBar progressBar;
	public Slider slider;

	public ProgressSlider(int minWidth, int minHeight, int maxWidth, int maxHeight) {
		progressBar = new ProgressBar();
		progressBar.setProgress(0D);
		slider = new Slider();
		slider.setValue(1);
		slider.setValue(0);

		if(minWidth != -1) this.setMinWidth(minWidth);
		if(maxWidth != -1) this.setMaxWidth(maxWidth);
		if(minHeight != -1) this.setMinHeight(minHeight);
		if(maxHeight != -1) this.setMaxHeight(maxHeight);

		progressBar.prefWidthProperty().bind(this.widthProperty());
		slider.prefWidthProperty().bind(this.widthProperty());
		slider.prefHeightProperty().bind(this.heightProperty());

		this.heightProperty().addListener((observeable, oldValue, newValue) -> {
			progressBar.prefHeightProperty().set(newValue.doubleValue() / 6);
		});

		slider.valueProperty().addListener((observeable, oldValue, newValue) -> {
			double progress = newValue.doubleValue() / slider.getMax();
			progressBar.setProgress(progress);
		});

		this.getChildren().add(progressBar);
		this.getChildren().add(slider);

		progressBar.getStyleClass().add("slider_Progress");
		slider.getStyleClass().add("slider_Slider");
	}

	public void setMinMax(double min, double max) {
		this.slider.setMin(min);
		this.slider.setMax(max);
	}

}


text:
#ifndef WPA_CTRL_H
#define WPA_CTRL_H

#ifdef  __cplusplus
extern "C" {
#endif

/* wpa_supplicant control interface - fixed message prefixes */

/** Interactive request for identity/password/pin */
#define WPA_CTRL_REQ "CTRL-REQ-"

/** Response to identity/password/pin request */
#define WPA_CTRL_RSP "CTRL-RSP-"

/* Event messages with fixed prefix */
/** Authentication completed successfully and data connection enabled */
#define WPA_EVENT_CONNECTED "CTRL-EVENT-CONNECTED "
/** Disconnected, data connection is not available */
#define WPA_EVENT_DISCONNECTED "CTRL-EVENT-DISCONNECTED "
/** Association rejected during connection attempt */
#define WPA_EVENT_ASSOC_REJECT "CTRL-EVENT-ASSOC-REJECT "
/** wpa_supplicant is exiting */
#define WPA_EVENT_TERMINATING "CTRL-EVENT-TERMINATING "
/** Password change was completed successfully */
#define WPA_EVENT_PASSWORD_CHANGED "CTRL-EVENT-PASSWORD-CHANGED "
/** EAP-Request/Notification received */
#define WPA_EVENT_EAP_NOTIFICATION "CTRL-EVENT-EAP-NOTIFICATION "
/** EAP authentication started (EAP-Request/Identity received) */
#define WPA_EVENT_EAP_STARTED "CTRL-EVENT-EAP-STARTED "
/** EAP method proposed by the server */
#define WPA_EVENT_EAP_PROPOSED_METHOD "CTRL-EVENT-EAP-PROPOSED-METHOD "
/** EAP method selected */
#define WPA_EVENT_EAP_METHOD "CTRL-EVENT-EAP-METHOD "
/** EAP peer certificate from TLS */
#define WPA_EVENT_EAP_PEER_CERT "CTRL-EVENT-EAP-PEER-CERT "
/** EAP TLS certificate chain validation error */
#define WPA_EVENT_EAP_TLS_CERT_ERROR "CTRL-EVENT-EAP-TLS-CERT-ERROR "
/** EAP authentication completed successfully */
#define WPA_EVENT_EAP_SUCCESS "CTRL-EVENT-EAP-SUCCESS "
/** EAP authentication failed (EAP-Failure received) */
#define WPA_EVENT_EAP_FAILURE "CTRL-EVENT-EAP-FAILURE "
/** New scan results available */
#define WPA_EVENT_SCAN_RESULTS "CTRL-EVENT-SCAN-RESULTS "
/** wpa_supplicant state change */
#define WPA_EVENT_STATE_CHANGE "CTRL-EVENT-STATE-CHANGE "
/** A new BSS entry was added (followed by BSS entry id and BSSID) */
#define WPA_EVENT_BSS_ADDED "CTRL-EVENT-BSS-ADDED "
/** A BSS entry was removed (followed by BSS entry id and BSSID) */
#define WPA_EVENT_BSS_REMOVED "CTRL-EVENT-BSS-REMOVED "

/** WPS overlap detected in PBC mode */
#define WPS_EVENT_OVERLAP "WPS-OVERLAP-DETECTED "
/** Available WPS AP with active PBC found in scan results */
#define WPS_EVENT_AP_AVAILABLE_PBC "WPS-AP-AVAILABLE-PBC "
/** Available WPS AP with our address as authorized in scan results */
#define WPS_EVENT_AP_AVAILABLE_AUTH "WPS-AP-AVAILABLE-AUTH "
/** Available WPS AP with recently selected PIN registrar found in scan results
 */
#define WPS_EVENT_AP_AVAILABLE_PIN "WPS-AP-AVAILABLE-PIN "
/** Available WPS AP found in scan results */
#define WPS_EVENT_AP_AVAILABLE "WPS-AP-AVAILABLE "
/** A new credential received */
#define WPS_EVENT_CRED_RECEIVED "WPS-CRED-RECEIVED "
/** M2D received */
#define WPS_EVENT_M2D "WPS-M2D "
/** WPS registration failed after M2/M2D */
#define WPS_EVENT_FAIL "WPS-FAIL "
/** WPS registration completed successfully */
#define WPS_EVENT_SUCCESS "WPS-SUCCESS "
/** WPS enrollment attempt timed out and was terminated */
#define WPS_EVENT_TIMEOUT "WPS-TIMEOUT "

#define WPS_EVENT_ENROLLEE_SEEN "WPS-ENROLLEE-SEEN "

#define WPS_EVENT_OPEN_NETWORK "WPS-OPEN-NETWORK "

/* WPS ER events */
#define WPS_EVENT_ER_AP_ADD "WPS-ER-AP-ADD "
#define WPS_EVENT_ER_AP_REMOVE "WPS-ER-AP-REMOVE "
#define WPS_EVENT_ER_ENROLLEE_ADD "WPS-ER-ENROLLEE-ADD "
#define WPS_EVENT_ER_ENROLLEE_REMOVE "WPS-ER-ENROLLEE-REMOVE "
#define WPS_EVENT_ER_AP_SETTINGS "WPS-ER-AP-SETTINGS "
#define WPS_EVENT_ER_SET_SEL_REG "WPS-ER-AP-SET-SEL-REG "

/** P2P device found */
#define P2P_EVENT_DEVICE_FOUND "P2P-DEVICE-FOUND "

#ifdef ANDROID_BRCM_P2P_PATCH
/** P2P device lost */
#define P2P_EVENT_DEVICE_LOST "P2P-DEVICE-LOST "
#endif

/** A P2P device requested GO negotiation, but we were not ready to start the
 * negotiation */
#define P2P_EVENT_GO_NEG_REQUEST "P2P-GO-NEG-REQUEST "
#define P2P_EVENT_GO_NEG_SUCCESS "P2P-GO-NEG-SUCCESS "
#define P2P_EVENT_GO_NEG_FAILURE "P2P-GO-NEG-FAILURE "
#define P2P_EVENT_GROUP_FORMATION_SUCCESS "P2P-GROUP-FORMATION-SUCCESS "
#define P2P_EVENT_GROUP_FORMATION_FAILURE "P2P-GROUP-FORMATION-FAILURE "
#define P2P_EVENT_GROUP_STARTED "P2P-GROUP-STARTED "
#define P2P_EVENT_GROUP_REMOVED "P2P-GROUP-REMOVED "
#define P2P_EVENT_CROSS_CONNECT_ENABLE "P2P-CROSS-CONNECT-ENABLE "
#define P2P_EVENT_CROSS_CONNECT_DISABLE "P2P-CROSS-CONNECT-DISABLE "
/* parameters: <peer address> <PIN> */
#define P2P_EVENT_PROV_DISC_SHOW_PIN "P2P-PROV-DISC-SHOW-PIN "
/* parameters: <peer address> */
#define P2P_EVENT_PROV_DISC_ENTER_PIN "P2P-PROV-DISC-ENTER-PIN "
/* parameters: <peer address> */
#define P2P_EVENT_PROV_DISC_PBC_REQ "P2P-PROV-DISC-PBC-REQ "
/* parameters: <peer address> */
#define P2P_EVENT_PROV_DISC_PBC_RESP "P2P-PROV-DISC-PBC-RESP "
/* parameters: <freq> <src addr> <dialog token> <update indicator> <TLVs> */
#define P2P_EVENT_SERV_DISC_REQ "P2P-SERV-DISC-REQ "
/* parameters: <src addr> <update indicator> <TLVs> */
#define P2P_EVENT_SERV_DISC_RESP "P2P-SERV-DISC-RESP "
#define P2P_EVENT_INVITATION_RECEIVED "P2P-INVITATION-RECEIVED "
#define P2P_EVENT_INVITATION_RESULT "P2P-INVITATION-RESULT "

/* hostapd control interface - fixed message prefixes */
#define WPS_EVENT_PIN_NEEDED "WPS-PIN-NEEDED "
#define WPS_EVENT_NEW_AP_SETTINGS "WPS-NEW-AP-SETTINGS "
#define WPS_EVENT_REG_SUCCESS "WPS-REG-SUCCESS "
#define WPS_EVENT_AP_SETUP_LOCKED "WPS-AP-SETUP-LOCKED "
#define WPS_EVENT_AP_SETUP_UNLOCKED "WPS-AP-SETUP-UNLOCKED "
#define WPS_EVENT_AP_PIN_ENABLED "WPS-AP-PIN-ENABLED "
#define WPS_EVENT_AP_PIN_DISABLED "WPS-AP-PIN-DISABLED "
#define AP_STA_CONNECTED "AP-STA-CONNECTED "
#define AP_STA_DISCONNECTED "AP-STA-DISCONNECTED "

/* wpa_supplicant/hostapd control interface access */

/**
 * wpa_ctrl_open - Open a control interface to wpa_supplicant/hostapd
 * @ctrl_path: Path for UNIX domain sockets; ignored if UDP sockets are used.
 * Returns: Pointer to abstract control interface data or %NULL on failure
 *
 * This function is used to open a control interface to wpa_supplicant/hostapd.
 * ctrl_path is usually /var/run/wpa_supplicant or /var/run/hostapd. This path
 * is configured in wpa_supplicant/hostapd and other programs using the control
 * interface need to use matching path configuration.
 */
struct wpa_ctrl * wpa_ctrl_open(const char *ctrl_path);

/**
 * wpa_ctrl_close - Close a control interface to wpa_supplicant/hostapd
 * @ctrl: Control interface data from wpa_ctrl_open()
 *
 * This function is used to close a control interface.
 */
void wpa_ctrl_close(struct wpa_ctrl *ctrl);

/**
 * wpa_ctrl_request - Send a command to wpa_supplicant/hostapd
 * @ctrl: Control interface data from wpa_ctrl_open()
 * @cmd: Command; usually, ASCII text, e.g., "PING"
 * @cmd_len: Length of the cmd in bytes
 * @reply: Buffer for the response
 * @reply_len: Reply buffer length
 * @msg_cb: Callback function for unsolicited messages or %NULL if not used
 * Returns: 0 on success, -1 on error (send or receive failed), -2 on timeout
 *
 * This function is used to send commands to wpa_supplicant/hostapd. Received
 * response will be written to reply and reply_len is set to the actual length
 * of the reply. This function will block for up to two seconds while waiting
 * for the reply. If unsolicited messages are received, the blocking time may
 * be longer.
 *
 * msg_cb can be used to register a callback function that will be called for
 * unsolicited messages received while waiting for the command response. These
 * messages may be received if wpa_ctrl_request() is called at the same time as
 * wpa_supplicant/hostapd is sending such a message. This can happen only if
 * the program has used wpa_ctrl_attach() to register itself as a monitor for
 * event messages. Alternatively to msg_cb, programs can register two control
 * interface connections and use one of them for commands and the other one for
 * receiving event messages, in other words, call wpa_ctrl_attach() only for
 * the control interface connection that will be used for event messages.
 */
int wpa_ctrl_request(struct wpa_ctrl *ctrl, const char *cmd, size_t cmd_len,
		     char *reply, size_t *reply_len,
		     void (*msg_cb)(char *msg, size_t len));

/**
 * wpa_ctrl_attach - Register as an event monitor for the control interface
 * @ctrl: Control interface data from wpa_ctrl_open()
 * Returns: 0 on success, -1 on failure, -2 on timeout
 *
 * This function registers the control interface connection as a monitor for
 * wpa_supplicant/hostapd events. After a success wpa_ctrl_attach() call, the
 * control interface connection starts receiving event messages that can be
 * read with wpa_ctrl_recv().
 */
int wpa_ctrl_attach(struct wpa_ctrl *ctrl);

/**
 * wpa_ctrl_detach - Unregister event monitor from the control interface
 * @ctrl: Control interface data from wpa_ctrl_open()
 * Returns: 0 on success, -1 on failure, -2 on timeout
 *
 * This function unregisters the control interface connection as a monitor for
 * wpa_supplicant/hostapd events, i.e., cancels the registration done with
 * wpa_ctrl_attach().
 */
int wpa_ctrl_detach(struct wpa_ctrl *ctrl);

/**
 * wpa_ctrl_recv - Receive a pending control interface message
 * @ctrl: Control interface data from wpa_ctrl_open()
 * @reply: Buffer for the message data
 * @reply_len: Length of the reply buffer
 * Returns: 0 on success, -1 on failure
 *
 * This function will receive a pending control interface message. This
 * function will block if no messages are available. The received response will
 * be written to reply and reply_len is set to the actual length of the reply.
 * wpa_ctrl_recv() is only used for event messages, i.e., wpa_ctrl_attach()
 * must have been used to register the control interface as an event monitor.
 */
int wpa_ctrl_recv(struct wpa_ctrl *ctrl, char *reply, size_t *reply_len);

/**
 * wpa_ctrl_pending - Check whether there are pending event messages
 * @ctrl: Control interface data from wpa_ctrl_open()
 * Returns: 1 if there are pending messages, 0 if no, or -1 on error
 *
 * This function will check whether there are any pending control interface
 * message available to be received with wpa_ctrl_recv(). wpa_ctrl_pending() is
 * only used for event messages, i.e., wpa_ctrl_attach() must have been used to
 * register the control interface as an event monitor.
 */
int wpa_ctrl_pending(struct wpa_ctrl *ctrl);

/**
 * wpa_ctrl_get_fd - Get file descriptor used by the control interface
 * @ctrl: Control interface data from wpa_ctrl_open()
 * Returns: File descriptor used for the connection
 *
 * This function can be used to get the file descriptor that is used for the
 * control interface connection. The returned value can be used, e.g., with
 * select() while waiting for multiple events.
 *
 * The returned file descriptor must not be used directly for sending or
 * receiving packets; instead, the library functions wpa_ctrl_request() and
 * wpa_ctrl_recv() must be used for this.
 */
int wpa_ctrl_get_fd(struct wpa_ctrl *ctrl);

#ifdef CONFIG_CTRL_IFACE_UDP
#define WPA_CTRL_IFACE_PORT 9877
#define WPA_GLOBAL_CTRL_IFACE_PORT 9878
#endif /* CONFIG_CTRL_IFACE_UDP */

#ifdef  __cplusplus
}
#endif

#endif /* WPA_CTRL_H */


text:
import { EventEmitter, ElementRef, SimpleChanges, OnChanges, ChangeDetectorRef, NgZone, OnDestroy } from '@angular/core';
export declare class CardComponent implements OnChanges, OnDestroy {
    private cd;
    private zone;
    color: any;
    bandColor: any;
    textColor: any;
    x: any;
    y: any;
    width: any;
    height: any;
    label: any;
    data: any;
    medianSize: number;
    valueFormatting: any;
    labelFormatting: any;
    select: EventEmitter<{}>;
    textEl: ElementRef;
    element: HTMLElement;
    value: string;
    transform: string;
    formattedLabel: string;
    cardWidth: number;
    cardHeight: number;
    textWidth: number;
    textFontSize: number;
    textTransform: string;
    initialized: boolean;
    animationReq: any;
    bandHeight: number;
    transformBand: string;
    textPadding: number[];
    labelFontSize: number;
    bandPath: string;
    constructor(element: ElementRef, cd: ChangeDetectorRef, zone: NgZone);
    ngOnChanges(changes: SimpleChanges): void;
    ngOnDestroy(): void;
    update(): void;
    paddedValue(value: string): string;
    startCount(): void;
    scaleText(): void;
    setPadding(): void;
    onClick(): void;
}


text:
/**
  @module ember-flexberry-designer
*/

import Component from '@ember/component';

/**
  This component mimics the `flexberry-file` component in the edit form constructor.

  @class FdFileComponent
  @extends Ember.Component
*/
export default Component.extend({
  /**
    See [EmberJS API](https://emberjs.com/api/).

    @property classNames
  */
  classNames: ['flexberry-file'],
});


text:
package aecor.distributedprocessing.serialization

/**
  * Marker trait for all protobuf-serializable messages in `aecor.distributedprocessing`.
  */
trait Message


text:
const data = require('./data').data;
const treeData = require('../public/util/TreeData');

var tree = treeData.init(data);
var price = treeData.calculate(tree._root.children[0].children[0],'contractPrice');
console.log(price)


text:
require 'zlib'
require 'stringio'

module Net
  class HTTPSuccess

    def body
      if self['content-encoding'] == 'gzip'
        body = StringIO.new(super)
        uncompressed_body = Zlib::GzipReader.new(body)
        uncompressed_body.read
      else
        super
      end
    end

  end
end


text:
import * as Koa from 'koa'
import * as bodyParser from 'koa-bodyparser'
import * as bunyan from 'bunyan'
import * as kcors from 'kcors'
import * as route from 'koa-route'
import * as serve from 'koa-static'

import { deleteAppointment, getAppointment, getAppointments, setAppointment } from './db'

import { INewAppointment } from './Appointment.d'

declare module 'koa' {
  interface Context {
    logger: bunyan
  }
}

const port = process.env.PORT || 3001
const app = new Koa()
const mainLogger = bunyan.createLogger({
  name: 'calendar'
})

app.use(kcors())
app.use(bodyParser())

app.use(async (ctx, next) => {
  ctx.logger = mainLogger
  await next()
})
app.use(async (ctx, next) => {
  const start = Date.now()
  await next()
  const ms = Date.now() - start
  ctx.logger.info({
    method: ctx.method,
    url: ctx.url,
    duration: ms
  }, `${ctx.method} ${ctx.url} - ${ms}ms`)
})

app.use(async (ctx, next) => {
  await next()
  if (ctx.request.get('accept') === 'application/json') {
    ctx.response.type = 'json'
  }
  ctx.set('Access-Control-Allow-Origin', '*')
})

app.use(route.get('/api/appointments', async (ctx) => {
  const appointments = await getAppointments()
  ctx.body = JSON.stringify(appointments)
}))
app.use(route.get('/api/appointments/:key', async (ctx, key: string) => {
  const appointment = await getAppointment(key)
  ctx.body = JSON.stringify(appointment)
}))
app.use(route.del('/api/appointments/:key', async (ctx, key: string) => {
  const affectedRows = await deleteAppointment(key)
  ctx.body = JSON.stringify({ affectedRows })
}))

app.use(route.post('/api/appointments', async (ctx) => {
  const { title, description, from, to, participants }: INewAppointment = ctx.request.body
  const appointment = await setAppointment(title, description, from, to, participants)
  ctx.body = JSON.stringify(appointment)
}))

app.use(route.post('/api/appointments/:key/participant', async (ctx, key: string) => {
  const { participant }: {participant: string} = ctx.request.body
  const appointment = await getAppointment(key)
  const newParticipants: ReadonlyArray<string> = appointment.participants.concat(participant)
  const { title, description, from, to, id } = appointment
  const newAppointment = await setAppointment(title, description, from, to, newParticipants, id)
  ctx.body = JSON.stringify(newAppointment)
}))

app.use(route.del('/api/appointments/:key/participant/:part', async (ctx, key: string, participant: string) => {
  const appointment = await getAppointment(key)
  const newParticipants: ReadonlyArray<string> = appointment.participants.filter(entry => entry !== participant)
  const { title, description, from, to, id } = appointment
  const newAppointment = await setAppointment(title, description, from, to, newParticipants, id)
  ctx.body = JSON.stringify(newAppointment)
}))

app.use(serve('./client/build/', {
  index: 'index.html'
}))

app.on('error', (error: Error) => {
  mainLogger.error(error)
})

app.listen(port, () => {
  mainLogger.info(`koa ist listening on http://localhost:${port}`)
})


text:
package recursion1;

/*
 * Given a string and a non-empty substring sub, compute recursively the
 * number of times that sub appears in the string, without the sub strings
 * overlapping.
 *
 * strCount("catcowcat", "cat") --> 2
 * strCount("catcowcat", "cow") --> 1
 * strCount("catcowcat", "dog") --> 0
 */

public class StrCountTest {
    public static void main(String[] args) {
		StrCountTest test = new StrCountTest();
		System.out.println(test.strCount("catcowcat", "cat"));
		System.out.println(test.strCount("catcowcat", "cow"));
		System.out.println(test.strCount("catcowcat", "dog"));
	}

    public int strCount(String str, String sub) {
        if (str.length() < sub.length()) {
            return 0;
        } else if (str.substring(0, sub.length()).equals(sub)) {
            return 1 + strCount(str.substring(sub.length()), sub);
        } else {
            return strCount(str.substring(1), sub);
        }
    }
}


text:
SkillToClassMap* CLASS_SKILLS;

const string& SkillToClassMap::getClass(const string& skill){
	if (skillToClass.count(skill) != 0) return skillToClass[skill];
	else return NO_CLASS;
}


text:
{{#template name="addingCSS"}}

### Adding CSS

Before we go any further, let's make our app look nice by adding some CSS.

Since this tutorial is focused on working with HTML and JavaScript, just copy all the CSS code below into `{{cssFileName}}`. This is all the CSS code you will need until the end of the tutorial. The app will still work without the CSS, but it will look much nicer if you add it.

{{#codeBox cssHeading cssFileName}}
```css
/* CSS declarations go here */
body {
  font-family: sans-serif;
  background-color: #315481;
  background-image: linear-gradient(to bottom, #315481, #918e82 100%);
  background-attachment: fixed;

  position: absolute;
  top: 0;
  bottom: 0;
  left: 0;
  right: 0;

  padding: 0;
  margin: 0;

  font-size: 14px;
}

.container {
  max-width: 600px;
  margin: 0 auto;
  min-height: 100%;
  background: white;
}

header {
  background: #d2edf4;
  background-image: linear-gradient(to bottom, #d0edf5, #e1e5f0 100%);
  padding: 20px 15px 15px 15px;
  position: relative;
}

#login-buttons {
  display: block;
}

h1 {
  font-size: 1.5em;
  margin: 0;
  margin-bottom: 10px;
  display: inline-block;
  margin-right: 1em;
}

form {
  margin-top: 10px;
  margin-bottom: -10px;
  position: relative;
}

.new-task input {
  box-sizing: border-box;
  padding: 10px 0;
  background: transparent;
  border: none;
  width: 100%;
  padding-right: 80px;
  font-size: 1em;
}

.new-task input:focus{
  outline: 0;
}

ul {
  margin: 0;
  padding: 0;
  background: white;
}

.delete {
  float: right;
  font-weight: bold;
  background: none;
  font-size: 1em;
  border: none;
  position: relative;
}

li {
  position: relative;
  list-style: none;
  padding: 15px;
  border-bottom: #eee solid 1px;
}

li .text {
  margin-left: 10px;
}

li.checked {
  color: #888;
}

li.checked .text {
  text-decoration: line-through;
}

li.private {
  background: #eee;
  border-color: #ddd;
}

header .hide-completed {
  float: right;
}

.toggle-private {
  margin-left: 5px;
}

@media (max-width: 600px) {
  li {
    padding: 12px 15px;
  }

  .search {
    width: 150px;
    clear: both;
  }

  .new-task input {
    padding-bottom: 5px;
  }
}
```
{{/codeBox}}

{{/template}}


text:
<?xml version="1.0" encoding="utf-8"?>
<selector xmlns:android="http://schemas.android.com/apk/res/android">
    <item android:state_pressed="true"
        android:drawable="@drawable/white_with_grey_gradient" />
    <item  android:state_focused="false"
        android:drawable="@drawable/white_with_grey_gradient_click" />
</selector>


text:
package org.flywaydb.maven;

import org.apache.maven.plugins.annotations.LifecyclePhase;
import org.apache.maven.plugins.annotations.Mojo;
import org.apache.maven.plugins.annotations.ResolutionScope;
import org.flywaydb.core.Flyway;
import org.flywaydb.core.api.MigrationInfo;
import org.flywaydb.core.api.MigrationInfoService;
import org.flywaydb.core.api.MigrationVersion;
import org.flywaydb.core.internal.info.MigrationInfoDumper;

/**
 * Maven goal to retrieve the complete information about the migrations including applied, pending and current migrations with
 * details and status.
 */
@SuppressWarnings({"UnusedDeclaration", "JavaDoc"})
@Mojo(name = "info",
        requiresDependencyResolution = ResolutionScope.TEST,
        defaultPhase = LifecyclePhase.PRE_INTEGRATION_TEST,
        threadSafe = true)
public class InfoMojo extends AbstractFlywayMojo {
    @Override
    protected void doExecute(Flyway flyway) {
        MigrationInfoService info = flyway.info();
        MigrationInfo current = info.current();
        MigrationVersion currentSchemaVersion = current == null ? MigrationVersion.EMPTY : current.getVersion();
        log.info("Schema version: " + currentSchemaVersion);
        log.info("");
        log.info(MigrationInfoDumper.dumpToAsciiTable(info.all()));
    }
}


text:
using System;
using System.Linq;

class GetLargestNumber
{
    static void Main()
    {
        int[] sequence = Console.ReadLine()
            .Split(' ')
            .Select(int.Parse)
            .ToArray();

            Console.WriteLine(GetMax(sequence[0], GetMax(sequence[1], sequence[2])));
    }

    static int GetMax(int firstNumber, int secondNumber)
    {
        if (firstNumber > secondNumber)
        {
            return firstNumber;
        }
        else
        {
            return secondNumber;
        }
    }
}


text:
using System;
using System.Collections.Generic;
using QuantConnect.Interfaces;

namespace QuantConnect.Algorithm.CSharp
{
    /// <summary>
    /// Test algorithm verifying OnEndOfDay callbacks are called as expected. See GH issue 2865.
    /// </summary>
    public class OnEndOfDayRegressionAlgorithm : QCAlgorithm, IRegressionAlgorithmDefinition
    {
        private Symbol _spySymbol;
        private Symbol _bacSymbol;
        private Symbol _ibmSymbol;
        private int _onEndOfDaySpyCallCount;
        private int _onEndOfDayBacCallCount;
        private int _onEndOfDayIbmCallCount;

        /// <summary>
        /// Initialise the data and resolution required, as well as the cash and start-end dates for your algorithm. All algorithms must initialized.
        /// </summary>
        public override void Initialize()
        {
            SetStartDate(2013, 10, 07);
            SetEndDate(2013, 10, 11);
            SetCash(100000);

            _spySymbol = QuantConnect.Symbol.Create("SPY", SecurityType.Equity, Market.USA);
            _bacSymbol = QuantConnect.Symbol.Create("BAC", SecurityType.Equity, Market.USA);
            _ibmSymbol = QuantConnect.Symbol.Create("IBM", SecurityType.Equity, Market.USA);

            AddUniverse("my-universe-name", time =>
            {
                if (time.Day == 8)
                {
                    return new List<string> { _spySymbol.Value, _ibmSymbol.Value };
                }
                return new List<string> { _spySymbol.Value };
            });
        }

        /// <summary>
        /// We expect it to be called for the universe selected <see cref="Symbol"/>
        /// and the post initialize manually added equity <see cref="Symbol"/>
        /// </summary>
        public override void OnEndOfDay(Symbol symbol)
        {
            if (symbol == _spySymbol)
            {
                if (_onEndOfDaySpyCallCount == 0)
                {
                    // just the first time
                    SetHoldings(_spySymbol, 0.5);
                    AddEquity("BAC");
                }
                _onEndOfDaySpyCallCount++;
            }
            else if (symbol == _bacSymbol)
            {
                if (_onEndOfDayBacCallCount == 0)
                {
                    // just the first time
                    SetHoldings(_bacSymbol, 0.5);
                }
                _onEndOfDayBacCallCount++;
            }
            else if (symbol == _ibmSymbol)
            {
                _onEndOfDayIbmCallCount++;
            }
            Log($"OnEndOfDay({symbol}) called: {UtcTime}." +
                $" SPY count: {_onEndOfDaySpyCallCount}." +
                $" IBM count: {_onEndOfDayIbmCallCount}." +
                $" BAC count: {_onEndOfDayBacCallCount}");
        }

        /// <summary>
        /// Assert expected behavior
        /// </summary>
        public override void OnEndOfAlgorithm()
        {
            if (_onEndOfDaySpyCallCount != 5)
            {
                throw new Exception($"OnEndOfDay(SPY) unexpected count call {_onEndOfDaySpyCallCount}");
            }
            if (_onEndOfDayBacCallCount != 4)
            {
                throw new Exception($"OnEndOfDay(BAC) unexpected count call {_onEndOfDayBacCallCount}");
            }
            if (_onEndOfDayIbmCallCount != 1)
            {
                throw new Exception($"OnEndOfDay(IBM) unexpected count call {_onEndOfDayIbmCallCount}");
            }
        }

        /// <summary>
        /// This is used by the regression test system to indicate if the open source Lean repository has the required data to run this algorithm.
        /// </summary>
        public bool CanRunLocally { get; } = true;

        /// <summary>
        /// This is used by the regression test system to indicate which languages this algorithm is written in.
        /// </summary>
        public Language[] Languages { get; } = { Language.CSharp, Language.Python };

        /// <summary>
        /// This is used by the regression test system to indicate what the expected statistics are from running the algorithm
        /// </summary>
        public Dictionary<string, string> ExpectedStatistics => new Dictionary<string, string>
        {
            {"Total Trades", "2"},
            {"Average Win", "0%"},
            {"Average Loss", "0%"},
            {"Compounding Annual Return", "489.968%"},
            {"Drawdown", "1.200%"},
            {"Expectancy", "0"},
            {"Net Profit", "2.295%"},
            {"Sharpe Ratio", "15.695"},
            {"Probabilistic Sharpe Ratio", "78.483%"},
            {"Loss Rate", "0%"},
            {"Win Rate", "0%"},
            {"Profit-Loss Ratio", "0"},
            {"Alpha", "1.604"},
            {"Beta", "0.954"},
            {"Annual Standard Deviation", "0.223"},
            {"Annual Variance", "0.05"},
            {"Information Ratio", "22.254"},
            {"Tracking Error", "0.068"},
            {"Treynor Ratio", "3.664"},
            {"Total Fees", "$22.11"},
            {"Estimated Strategy Capacity", "$5600000.00"},
            {"Lowest Capacity Asset", "NB R735QTJ8XC9X"},
            {"Fitness Score", "0.249"},
            {"Kelly Criterion Estimate", "0"},
            {"Kelly Criterion Probability Value", "0"},
            {"Sortino Ratio", "68.045"},
            {"Return Over Maximum Drawdown", "621.197"},
            {"Portfolio Turnover", "0.249"},
            {"Total Insights Generated", "0"},
            {"Total Insights Closed", "0"},
            {"Total Insights Analysis Completed", "0"},
            {"Long Insight Count", "0"},
            {"Short Insight Count", "0"},
            {"Long/Short Ratio", "100%"},
            {"Estimated Monthly Alpha Value", "$0"},
            {"Total Accumulated Estimated Alpha Value", "$0"},
            {"Mean Population Estimated Insight Value", "$0"},
            {"Mean Population Direction", "0%"},
            {"Mean Population Magnitude", "0%"},
            {"Rolling Averaged Population Direction", "0%"},
            {"Rolling Averaged Population Magnitude", "0%"},
            {"OrderListHash", "2d211e1d63bfc84450b69c51204aec76"}
        };
    }
}


text:
export declare enum StartValueType {
    max = "max",
    min = "min"
}


text:
package paket1;

import javapack.Einlesen;

public class Test4 {
	public static void main(String[] args) {
		// TODO Auto-generated method stub

		System.out.println("Geben Sie eine Zahl zwischen 0 und 9 ein: ");
		int zahl = Einlesen.LiesInt();
		check(zahl);

	}

	static void check(int wert) {
		String[] array = { "Null", "Eins", "Zwei", "Drei", "Vier", "Fünf",
				"Sechs", "Sieben", "Acht", "Neun" };
		if (wert < 10 && wert > -1) {
			System.out.println("Deine Zahl: " + array[wert]);

		} else {
			System.out.println("Geben Sie bitte eine einstellige Zahl ein: ");
			wert = Einlesen.LiesInt();
			check(wert);
		}
	}
}


text:
<query id="getModuleExtraVars" action="select">
    <tables>
        <table name="module_extra_vars" />
    </tables>
    <columns>
        <column name="*" />
    </columns>
    <conditions>
        <condition operation="in" column="module_srl" var="module_srl" notnull="notnull" />
    </conditions>
</query>


text:
import { Component, OnInit } from '@angular/core';
import { Location } from '@angular/common';
import { MatDialog, MatDialogRef, MatSnackBar } from '@angular/material';
import { Router, ActivatedRoute, Params } from '@angular/router';
import { MitigateComponent } from '../mitigates/mitigate.component';
import { StixService } from '../../../stix.service';
import { Relationship, CourseOfAction } from '../../../../models';
import { Constance } from '../../../../utils/constance';

@Component({
  selector: 'mitigates-list',
  templateUrl: './mitigate-list.component.html'
})
export class MitigateListComponent extends MitigateComponent implements OnInit {
    public pageTitle = Constance.RELATIONSHIPS_TYPE;
    public pageIcon = Constance.RELATIONSHIPS_ICON;
    public targets: any[] = [];
    public count = -1;

     constructor(
        public stixService: StixService,
        public route: ActivatedRoute,
        public router: Router,
        public dialog: MatDialog,
        public location: Location,
        public snackBar: MatSnackBar) {

        super(stixService, route, router, dialog, location, snackBar);
    }

    public ngOnInit() {
       let sub = this.route.params.subscribe((params) => {
                if (params['type'] === Constance.COURSE_OF_ACTION_TYPE) {
                        this.stixService.url = Constance.COURSE_OF_ACTION_URL;
                        let subscription =  super.load().subscribe(
                            (data) => {
                                this.targets = data as CourseOfAction[];
                                super.loadAttachPatteren();
                            }, (error) => {
                                // handle errors here
                                console.log('error ' + error);
                            }, () => {
                                // prevent memory links
                                if (subscription) {
                                    subscription.unsubscribe();
                                }
                            }
                        );
                }
            },
            (error) => { console.log(error); },
            () => { sub.unsubscribe(); }
        );
    }

    public onTabShow(event: any): void {console.log('');  }

    public trackByFn(index: number, item: any): number {
        item.index = index;
        console.log( item.index);
        return  item.index;
    }
}


text:
var Singleton;

(function() {
  var instance;
  Singleton = function(name) {
    if (instance) {
      return instance;
    }
    this.name = name;
    instance = this;
  };
  Singleton.prototype.getName = function() {
    return name;
  };
})();

var thor = new Singleton("Thor");
var evilThor = new Singleton("Thor");

console.log(thor === evilThor);


text:
INTERVAL=$1
shift
START=$(date +%T)

BOLD=$(tput bold)
RESET=$(tput sgr0)

while true; do
  clear
  echo "${BOLD}MY_REPEAT${RESET} - Running ${BOLD}$@${RESET} in every $INTERVAL seconds.."
  echo "$START  - $(date +%T)"
  echo ""
  eval "$@"
  sleep $INTERVAL
done


text:
<?php
if(isset($_POST["name"]) AND isset($_POST["description"]) AND isset($_POST["deadline"])){
  $id_project = htmlspecialchars($_POST["id_project"]);
  $name = htmlspecialchars($_POST["name"]);
  $description = htmlspecialchars($_POST["description"]);
  $deadline = htmlspecialchars($_POST["deadline"]);
  $deadline = date("Y-m-d", strtotime($deadline));
  createUnderStep($id_project, $name, $description, $deadline);
  ?>
    <form id="form_new_redirection" action="under_step.php" method="post">
      <input type="hidden" name="id_project" value="<?php echo $id_project; ?>">
    </form>
    <script>
    document.getElementById('form_new_redirection').submit();
    </script>
  <?php
}
else{
  include_once("../view/under_step/new.php");
}


text:
<vector xmlns:android="http://schemas.android.com/apk/res/android"
        android:width="@dimen/half_standard_height"
        android:height="@dimen/half_standard_height"
        android:viewportWidth="24.0"
        android:viewportHeight="24.0">
    <path
        android:fillColor="#FFFFFFFF"
        android:pathData="M19,13h-6v6h-2v-6H5v-2h6V5h2v6h6v2z"/>
</vector>


text:
"""
gallerize.logging
~~~~~~~~~~~~~~~~~

:Copyright: 2007-2021 Jochen Kupperschmidt
:License: MIT, see LICENSE for details.
"""

from typing import Any

def debug(message: str, *args: Any) -> None:
    print(message.format(*args))


text:
from __future__ import absolute_import

from django.core.urlresolvers import reverse

from sentry.models import (Organization, OrganizationAccessRequest, OrganizationMemberTeam)
from sentry.testutils import APITestCase

class CreateOrganizationMemberTeamTest(APITestCase):
    def test_can_join_as_owner_without_open_membership(self):
        organization = self.create_organization(
            name='foo',
            owner=self.user,
            flags=0,
        )
        team = self.create_team(name='foo', organization=organization)
        user = self.create_user('dummy@example.com')
        member_om = self.create_member(
            organization=organization,
            user=user,
            role='owner',
            teams=[],
        )

        path = reverse(
            'sentry-api-0-organization-member-team-details',
            args=[
                organization.slug,
                member_om.id,
                team.slug,
            ]
        )

        self.login_as(user)

        resp = self.client.post(path)

        assert resp.status_code == 201

    def test_cannot_join_as_member_without_open_membership(self):
        organization = self.create_organization(
            name='foo',
            owner=self.user,
            flags=0,
        )
        team = self.create_team(name='foo', organization=organization)
        user = self.create_user('dummy@example.com')
        member_om = self.create_member(
            organization=organization,
            user=user,
            role='member',
            teams=[],
        )

        path = reverse(
            'sentry-api-0-organization-member-team-details',
            args=[
                organization.slug,
                member_om.id,
                team.slug,
            ]
        )

        self.login_as(user)

        resp = self.client.post(path)

        assert resp.status_code == 202

        assert not OrganizationMemberTeam.objects.filter(
            team=team,
            organizationmember=member_om,
        ).exists()
        assert OrganizationAccessRequest.objects.filter(
            team=team,
            member=member_om,
        ).exists()

    def test_can_join_as_member_with_open_membership(self):
        organization = self.create_organization(
            name='foo',
            owner=self.user,
            flags=Organization.flags.allow_joinleave,
        )
        team = self.create_team(name='foo', organization=organization)
        user = self.create_user('dummy@example.com')
        member_om = self.create_member(
            organization=organization,
            user=user,
            role='member',
            teams=[],
        )

        path = reverse(
            'sentry-api-0-organization-member-team-details',
            args=[
                organization.slug,
                member_om.id,
                team.slug,
            ]
        )

        self.login_as(user)

        resp = self.client.post(path)

        assert resp.status_code == 201

        assert OrganizationMemberTeam.objects.filter(
            team=team,
            organizationmember=member_om,
        ).exists()

    def test_owner_can_add_member(self):
        owner = self.create_user()
        organization = self.create_organization(name='foo', owner=owner)
        organization.flags.allow_joinleave = False
        organization.save()
        team = self.create_team(name='foo', organization=organization)
        user = self.create_user('dummy@example.com')
        member_om = self.create_member(
            organization=organization,
            user=user,
            role='member',
            teams=[],
        )

        path = reverse(
            'sentry-api-0-organization-member-team-details',
            args=[
                organization.slug,
                member_om.id,
                team.slug,
            ]
        )

        self.login_as(owner)

        resp = self.client.post(path)

        assert resp.status_code == 201

        assert OrganizationMemberTeam.objects.filter(
            team=team,
            organizationmember=member_om,
        ).exists()

    def test_owner_can_add_manager(self):
        owner = self.create_user()
        organization = self.create_organization(name='foo', owner=owner)
        organization.flags.allow_joinleave = False
        organization.save()
        team = self.create_team(name='foo', organization=organization)
        user = self.create_user('dummy@example.com')
        member_om = self.create_member(
            organization=organization,
            user=user,
            role='manager',
            teams=[],
        )

        path = reverse(
            'sentry-api-0-organization-member-team-details',
            args=[
                organization.slug,
                member_om.id,
                team.slug,
            ]
        )

        self.login_as(owner)

        resp = self.client.post(path)

        assert resp.status_code == 201

        assert OrganizationMemberTeam.objects.filter(
            team=team,
            organizationmember=member_om,
        ).exists()

    def test_owner_can_add_other_owner(self):
        owner = self.create_user()
        organization = self.create_organization(name='foo', owner=owner)
        organization.flags.allow_joinleave = False
        organization.save()
        team = self.create_team(name='foo', organization=organization)
        user = self.create_user('dummy@example.com')
        member_om = self.create_member(
            organization=organization,
            user=user,
            role='owner',
            teams=[],
        )

        path = reverse(
            'sentry-api-0-organization-member-team-details',
            args=[
                organization.slug,
                member_om.id,
                team.slug,
            ]
        )

        self.login_as(owner)

        resp = self.client.post(path)

        assert resp.status_code == 201

        assert OrganizationMemberTeam.objects.filter(
            team=team,
            organizationmember=member_om,
        ).exists()

    def test_manager_can_add_member(self):
        manager = self.create_user()
        organization = self.create_organization(name='foo')
        team = self.create_team(name='foo', organization=organization)
        self.create_member(
            organization=organization,
            user=manager,
            role='manager',
            teams=[team],
        )
        organization.flags.allow_joinleave = False
        organization.save()
        user = self.create_user('dummy@example.com')
        member_om = self.create_member(
            organization=organization,
            user=user,
            role='member',
            teams=[],
        )

        path = reverse(
            'sentry-api-0-organization-member-team-details',
            args=[
                organization.slug,
                member_om.id,
                team.slug,
            ]
        )

        self.login_as(manager)

        resp = self.client.post(path)

        assert resp.status_code == 201

        assert OrganizationMemberTeam.objects.filter(
            team=team,
            organizationmember=member_om,
        ).exists()

    def test_manager_cannot_add_owner(self):
        manager = self.create_user()
        organization = self.create_organization(name='foo')
        organization.flags.allow_joinleave = False
        organization.save()
        team = self.create_team(name='foo', organization=organization)
        self.create_member(
            organization=organization,
            user=manager,
            role='manager',
            teams=[team],
        )
        owner = self.create_user()
        user = self.create_user('dummy@example.com')
        owner_om = self.create_member(
            organization=organization,
            user=user,
            role='owner',
            teams=[],
        )

        path = reverse(
            'sentry-api-0-organization-member-team-details',
            args=[
                organization.slug,
                owner_om.id,
                team.slug,
            ]
        )

        self.login_as(manager)

        resp = self.client.delete(path)

        assert resp.status_code == 400

        assert not OrganizationMemberTeam.objects.filter(
            team=team,
            organizationmember=owner,
        ).exists()

class DeleteOrganizationMemberTeamTest(APITestCase):
    def test_can_leave_as_member(self):
        organization = self.create_organization(name='foo', owner=self.user)
        team = self.create_team(name='foo', organization=organization)
        user = self.create_user('dummy@example.com')
        member_om = self.create_member(
            organization=organization,
            user=user,
            role='member',
            teams=[team],
        )

        path = reverse(
            'sentry-api-0-organization-member-team-details',
            args=[
                organization.slug,
                member_om.id,
                team.slug,
            ]
        )

        self.login_as(user)

        resp = self.client.delete(path)

        assert resp.status_code == 200

        assert not OrganizationMemberTeam.objects.filter(
            team=team,
            organizationmember=member_om,
        ).exists()

    def test_can_leave_as_non_member(self):
        organization = self.create_organization(name='foo', owner=self.user)
        team = self.create_team(name='foo', organization=organization)
        user = self.create_user('dummy@example.com', is_superuser=False)
        member_om = self.create_member(
            organization=organization,
            user=user,
            role='member',
            teams=[],
        )

        path = reverse(
            'sentry-api-0-organization-member-team-details',
            args=[
                organization.slug,
                member_om.id,
                team.slug,
            ]
        )

        self.login_as(user)

        resp = self.client.delete(path)

        assert resp.status_code == 200

        assert not OrganizationMemberTeam.objects.filter(
            team=team,
            organizationmember=member_om,
        ).exists()

    def test_can_leave_as_superuser_without_membership(self):
        organization = self.create_organization(name='foo', owner=self.user)
        team = self.create_team(name='foo', organization=organization)
        user = self.create_user('dummy@example.com', is_superuser=True)
        member_om = self.create_member(
            organization=organization,
            user=user,
            role='member',
            teams=[],
        )

        path = reverse(
            'sentry-api-0-organization-member-team-details',
            args=[
                organization.slug,
                member_om.id,
                team.slug,
            ]
        )

        self.login_as(user)

        resp = self.client.delete(path)

        assert resp.status_code == 200

        assert not OrganizationMemberTeam.objects.filter(
            team=team,
            organizationmember=member_om,
        ).exists()

    def test_owner_can_remove_member(self):
        owner = self.create_user()
        organization = self.create_organization(name='foo', owner=owner)
        organization.flags.allow_joinleave = False
        organization.save()
        team = self.create_team(name='foo', organization=organization)
        user = self.create_user('dummy@example.com')
        member_om = self.create_member(
            organization=organization,
            user=user,
            role='member',
            teams=[team],
        )

        path = reverse(
            'sentry-api-0-organization-member-team-details',
            args=[
                organization.slug,
                member_om.id,
                team.slug,
            ]
        )

        self.login_as(owner)

        resp = self.client.delete(path)

        assert resp.status_code == 200

        assert not OrganizationMemberTeam.objects.filter(
            team=team,
            organizationmember=member_om,
        ).exists()

    def test_owner_can_remove_manager(self):
        owner = self.create_user()
        organization = self.create_organization(name='foo', owner=owner)
        organization.flags.allow_joinleave = False
        organization.save()
        team = self.create_team(name='foo', organization=organization)
        user = self.create_user('dummy@example.com')
        member_om = self.create_member(
            organization=organization,
            user=user,
            role='manager',
            teams=[team],
        )

        path = reverse(
            'sentry-api-0-organization-member-team-details',
            args=[
                organization.slug,
                member_om.id,
                team.slug,
            ]
        )

        self.login_as(owner)

        resp = self.client.delete(path)

        assert resp.status_code == 200

        assert not OrganizationMemberTeam.objects.filter(
            team=team,
            organizationmember=member_om,
        ).exists()

    def test_owner_can_remove_other_owner(self):
        owner = self.create_user()
        organization = self.create_organization(name='foo', owner=owner)
        organization.flags.allow_joinleave = False
        organization.save()
        team = self.create_team(name='foo', organization=organization)
        user = self.create_user('dummy@example.com')
        member_om = self.create_member(
            organization=organization,
            user=user,
            role='owner',
            teams=[team],
        )

        path = reverse(
            'sentry-api-0-organization-member-team-details',
            args=[
                organization.slug,
                member_om.id,
                team.slug,
            ]
        )

        self.login_as(owner)

        resp = self.client.delete(path)

        assert resp.status_code == 200

        assert not OrganizationMemberTeam.objects.filter(
            team=team,
            organizationmember=member_om,
        ).exists()

    def test_manager_can_remove_member(self):
        manager = self.create_user()
        organization = self.create_organization(name='foo')
        team = self.create_team(name='foo', organization=organization)
        self.create_member(
            organization=organization,
            user=manager,
            role='manager',
            teams=[team],
        )
        organization.flags.allow_joinleave = False
        organization.save()
        user = self.create_user('dummy@example.com')
        member_om = self.create_member(
            organization=organization,
            user=user,
            role='member',
            teams=[team],
        )

        path = reverse(
            'sentry-api-0-organization-member-team-details',
            args=[
                organization.slug,
                member_om.id,
                team.slug,
            ]
        )

        self.login_as(manager)

        resp = self.client.delete(path)

        assert resp.status_code == 200

        assert not OrganizationMemberTeam.objects.filter(
            team=team,
            organizationmember=member_om,
        ).exists()

    def test_manager_cannot_remove_owner(self):
        manager = self.create_user()
        organization = self.create_organization(name='foo')
        organization.flags.allow_joinleave = False
        organization.save()
        team = self.create_team(name='foo', organization=organization)
        self.create_member(
            organization=organization,
            user=manager,
            role='manager',
            teams=[team],
        )
        owner = self.create_user()
        owner_om = self.create_member(
            organization=organization,
            user=owner,
            role='owner',
            teams=[team],
        )

        path = reverse(
            'sentry-api-0-organization-member-team-details',
            args=[
                organization.slug,
                owner_om.id,
                team.slug,
            ]
        )

        self.login_as(manager)

        resp = self.client.delete(path)

        assert resp.status_code == 400

        assert OrganizationMemberTeam.objects.filter(
            team=team,
            organizationmember=owner_om,
        ).exists()


text:
All notable changes to Unitwise will be documented in this file, starting at
version 1.0.0.

Unitwise uses semantic versioning.

## 1.0.4 - 2015-01-10

- Added Ruby 2.2 support.
- Empty strings are no longer valid units.

## 1.0.3 - 2014-10-05

### Added
- Unitwise.valid? for checking validity of expressions

## 1.0.2 - 2014-09-14

### Fixed
- Decomposer caching is now a little smarter. This resulted in a mild
  performance increase.

## 1.0.1 - 2014-08-30

### Fixed
- Move conditional dependencies to Gemfile in order to allow proper
  installation issues on rbx and jruby.

## 1.0.0 - 2014-08-25

### Added
- Uniwise() now accepts a Unitwise::Measurement as the first argument.
- Unitwise::Measurement now supports #round.

### Fixed
- Respect Rationals when inspecting/printing a Unitwise::Measurement.
- Dynamically created methods from unitwise/ext now work with #respond_to?
  and #methods appropriately.

### Deprecated
- Unitwise() and Unitwise::Measurement.new() now requires two non-optional
  arguments (value and unit).
- Unitwise::Measurement no longer has an implicit Integer conversion.


text:
package com.coverity.security.pie.policy.securitymanager;

import com.coverity.security.pie.core.PieConfig;
import com.coverity.security.pie.core.PolicyConfig;
import org.json.JSONObject;
import org.testng.annotations.Test;

import java.io.IOException;
import java.io.StringReader;
import java.io.StringWriter;
import java.net.SocketPermission;

import static org.testng.Assert.assertEquals;
import static org.testng.Assert.assertFalse;
import static org.testng.Assert.assertTrue;

public class SocketPermissionsTest {

    @Test
    public void testSocketPermissions() throws IOException {
        /* Test that all 'accept,resolve' permissions get collapsed to a wildcard "*:0" permission, other permissions
           don't have any collapsing behavior, and that the wildcard is respected when new host names are passed to the
           policy.
         */

        SecurityManagerPolicy policy = new SecurityManagerPolicy();
        policy.setPolicyConfig(new PolicyConfig(policy.getName(), new PieConfig()));
        policy.logViolation(null, new SocketPermission("localhost", "accept,resolve"));
        policy.logViolation(null, new SocketPermission("example.com", "accept,resolve"));
        policy.logViolation(null, new SocketPermission("evil.com", "listen,resolve"));
        policy.addViolationsToPolicy();
        policy.collapsePolicy();

        StringWriter sw = new StringWriter();
        policy.writePolicy(sw);
        JSONObject policyOut = new JSONObject(sw.toString());
        assertEquals(policyOut.getJSONObject("<null>").getJSONObject("java.net.SocketPermission").keySet().size(), 2);
        assertTrue(policyOut.getJSONObject("<null>").getJSONObject("java.net.SocketPermission").keySet().contains("accept,resolve"));
        assertTrue(policyOut.getJSONObject("<null>").getJSONObject("java.net.SocketPermission").keySet().contains("listen,resolve"));
        assertEquals(policyOut.getJSONObject("<null>").getJSONObject("java.net.SocketPermission").getJSONObject("accept,resolve").keySet().size(), 1);
        assertTrue(policyOut.getJSONObject("<null>").getJSONObject("java.net.SocketPermission").getJSONObject("accept,resolve").keySet().contains("*:0"));
        assertEquals(policyOut.getJSONObject("<null>").getJSONObject("java.net.SocketPermission").getJSONObject("listen,resolve").keySet().size(), 1);
        assertTrue(policyOut.getJSONObject("<null>").getJSONObject("java.net.SocketPermission").getJSONObject("listen,resolve").keySet().contains("evil.com"));

        policy.parsePolicy(new StringReader(policyOut.toString()));
        assertTrue(policy.implies(null, new SocketPermission("newhostname.com", "accept,resolve")));
        assertFalse(policy.implies(null, new SocketPermission("newhostname.com", "listen,resolve")));
    }
}


text:
/**
 * Type used for modifications to metadata
 *
 * @experimental
 */
export declare type MetadataOverride<T> = {
    add?: Partial<T>;
    remove?: Partial<T>;
    set?: Partial<T>;
};


text:
@(variant: chess.variant.Variant, name: String, hintAsTitle: Boolean = false, cssClass: String = "hint--bottom", initialFen: Option[String] = None)
@url = {
@variant match {
case chess.variant.Standard => {https://en.wikipedia.org/wiki/Chess}
case chess.variant.Chess960 => {https://en.wikipedia.org/wiki/Chess960}
case chess.variant.KingOfTheHill => {@routes.Page.kingOfTheHill}
case chess.variant.ThreeCheck => {http://en.wikipedia.org/wiki/Three-check_chess}
case chess.variant.Antichess => {http://en.wikipedia.org/wiki/Losing_chess}
case chess.variant.FromPosition => {@routes.Editor.index?fen=@initialFen.map(_.replace(" ", "_"))}
case chess.variant.Atomic => {http://www.freechess.org/Help/HelpFiles/atomic.html}
case chess.variant.Horde => {http://en.wikipedia.org/wiki/Dunsany%27s_chess#Horde_variant}
case _ => {}
}
}
@name


text:
namespace Google.Cloud.BigQuery.DataExchange.V1Beta1.Snippets
{
    // [START analyticshub_v1beta1_generated_AnalyticsHubService_DeleteDataExchange_async]
    using Google.Cloud.BigQuery.DataExchange.V1Beta1;
    using System.Threading.Tasks;

    public sealed partial class GeneratedAnalyticsHubServiceClientSnippets
    {
        /// <summary>Snippet for DeleteDataExchangeAsync</summary>
        /// <remarks>
        /// This snippet has been automatically generated for illustrative purposes only.
        /// It may require modifications to work in your environment.
        /// </remarks>
        public async Task DeleteDataExchangeRequestObjectAsync()
        {
            // Create client
            AnalyticsHubServiceClient analyticsHubServiceClient = await AnalyticsHubServiceClient.CreateAsync();
            // Initialize request argument(s)
            DeleteDataExchangeRequest request = new DeleteDataExchangeRequest
            {
                DataExchangeName = DataExchangeName.FromProjectLocationDataExchange("[PROJECT]", "[LOCATION]", "[DATA_EXCHANGE]"),
            };
            // Make the request
            await analyticsHubServiceClient.DeleteDataExchangeAsync(request);
        }
    }
    // [END analyticshub_v1beta1_generated_AnalyticsHubService_DeleteDataExchange_async]
}


text:
package org.kodejava.example.swing;

import javax.swing.*;
import java.awt.*;
import java.awt.event.ActionListener;
import java.awt.event.ActionEvent;

public class DisableCloseButtonDemo extends JFrame {
    public DisableCloseButtonDemo() throws HeadlessException {
        initialize();
    }

    private void initialize() {
        // WindowConstants.DO_NOTHING_ON_CLOSE tell JFrame instance to do
        // nothing when a window closing event occurs.
        this.setDefaultCloseOperation(WindowConstants.DO_NOTHING_ON_CLOSE);

        JButton button = new JButton("Close");
        button.addActionListener(new ActionListener() {
            public void actionPerformed(ActionEvent e) {
                System.exit(0);
            }
        });

        this.setLayout(new FlowLayout(FlowLayout.CENTER));
        this.setSize(new Dimension(100, 100));
        this.getContentPane().add(button);
    }

    public static void main(String[] args) {
        SwingUtilities.invokeLater(new Runnable() {
            public void run() {
                new DisableCloseButtonDemo().setVisible(true);
            }
        });
    }
}


text:
Tool to take files from a font family project upstream git repository to the [google/fonts GitHub](https://github.com/google/fonts) repository structure, taking care of all the details.

    usage: gftools packager [-h] [-f] [-y] [-q] [-g] [-b BRANCH] [-a] [-p] [--pr-upstream PR_UPSTREAM] [--push-upstream PUSH_UPSTREAM] [--no-allowlist] [name [name ...]] target

Show the command line help:

    $ gftools packager -h

## Environment Variables

* `GH_TOKEN` **mandatory** used to access the GitHub GraphQL API to get info about the font family in the google/fonts repo and to download the current versions of the package.
* `VISUAL` and `EDITOR` **optional** The command to open a text editor in order to create or edit an `upstream.yaml` file. If `VISUAL` is set it will be used, otherwise `EDITOR`, if set, will be used. The default/fallback editor command is `vi`, (which in many cases will open vim). This is similar to the way the `git` command decides which editor to use.

This is how to set environment variables:

    $ export GH_TOKEN=mypersonalgithubapitoken
    $ export VISUAL=gedit

You can also put these commands into a file:

    # file: set_local_env
    export GH_TOKEN=mypersonalgithubapitoken
    export VISUAL=gedit

Then run:

    $ source set_local_env

Or put the commands into your `~/.bashrc` and the variables will be set for each newly started bash terminal.

## `upstream.yaml` Upstream Configuration

The tool introduces and relies on "upstream configuration" in the form of an `upstream.yaml` file, located in the family directory on google/fonts. Initially for each update to a family or newly added family an `upstream.yaml` file will have to be created. The packager supports this by providing a template, with documenting comments, that it opens in an interactive text editor.

You should have a look at the [`upstream.yaml` template](../../Lib/gftools/template.upstream.yaml) now to make yourself familiar.

An `upstream.yaml` file path can also be used as a `name` argument from the command line. Eventually, when the `upstream.yaml` already exists in the family directory of google/fonts, and no modification to it is required, an update and Pull Request (PR) of the family can be done in one call to the packager.

## `name` Family Name or `upstream.yaml` File Name

The tool takes zero or more family names or file names and creates a package (and commit) for each.

If a `name` ends with `.yaml` or `.yml` it is treated as a file path to an `upstream.yaml` configuration file. Otherwise it's treated as a family name that will be searched in google/fonts for existing `upstream.yaml` configuration. The family entry will be updated if found or created otherwise. The family name in this case can be:

* the full family name like `"Family Sans"` (use quotes or escapes on the command line if it contains spaces),
* the camel cased name `FamilySans` or
* the all lowercase directory name `familysans`.

To search the family on google fonts, the name will be made all lower case and spaces will be removed.
In the full name case, if the family is not on google fonts, the suggestion in the `upstream.yaml` editor template will already be set correctly.

## `target` Directory or Git Repository

The target argument can be either treated as a directory or as a git repository (use `-g/--gf-git`) that is a clone of google/fonts.

### Directory (*default*)

If `target` is treated as a directory, the tool will simply add the files package into its `{license_dir}/{family_dir}` directory within `target`. Note that in this case `target` can also be the current working tree of a git repository, but it can also be an empty or any other directory. If the sub-directory `{license_dir}/{family_dir}` already exists, it can't be overridden without giving explicit permission (`-f/--force` or answering in interactive mode).

This is useful for a local quality assurance (QA) development-feedback loop when finalizing a family for google/fonts. See `gftools qa` for this. Especially Font Bakery with the `googlefonts` profile (i.e. `fontbakery check-googlefonts`) is set up to check all the contents of the family package, not just the font files, and has ideally also access to the google/fonts directory structure and possible sibling families. Thus, putting the package into a checked out working directory of google/fonts main branch is the optimal case for local QA.

### Git Repository `-g/--gh-git`

To use `target` as a google/fonts git repository it must have a git remote that can fetch from google/fonts, e.g. with the url `git@github.com:google/fonts.git` or `https://github.com/google/fonts.git`.

**NOTE:** command line flags and arguments that **imply** that target is a git repository *will also **implicitly set** the `-g/--gh-git` flag*. Such are `-b/--branch`, `-a/--ad-commit`, `-p/--pr` and—by implying `-p/--pr`—`--pr-upstream` and `--push-upstream`.

In this mode the tool will create a new git branch or add to an existing one (with `-a/--add-commit`). Use `-b/--branch` to explicitly specify a branch or the tool will create a branch name based on the given actual family names and the prefix `gftools_packager_`. An existing branch, when creating a new branch, can't be overridden without giving explicit permission (`-f/--force` or answering in interactive mode).

*A limitation here is:* If the branch is checked out, in the current working directory of the repository, it won't be possible to override it or add commits to it!

To push the branch to the remote and make a PR to `https://github.com/google/fonts` with the package(s) use the `-p/--pr` flag. Note that the remote branch will always be prefixed with `gftools_packager_` even if the local branch (when using `-b/--branch`) is not prefixed by that. This is because the push to the remote branch **will always be a `git push --force`** no matter if (`-f/--force`) was used or not. That way we ensure that only remote branches that were (likely) created by the tool are overridden by the tool, not accidentally other branches. An existing PR for the same branch name will simply be updated and a status comment will be added to the PR discussion.

Interesting arguments, together with `-p/--pr`, to push and/or PR to other GitHub repositories are `--pr-upstream` and `--push-upstream`. These are so far mainly used for development/debugging/testing in order to reduce noise on the google/fonts repository. However, in some cases `--push-upstream` can be used to push to a fork of google/fonts and then let the tool make a PR to google/fonts, e.g. when the user has no `WRITE` permission for google/fonts. But, currently, the continuous integration QA tools that check the PR can't handle branches on repositories other than google/fonts, so the utility of this is lower.

## Interactive Mode

Interactive mode is the default mode of the tool. To turn it off use the `-y/--no-confirm` flag and the tool will never ask for user interaction. This is especially useful for automation purposes, then together with the `-f/--force` flag, or when everything is expected to be set up correctly and the tool should just do its thing.

## Use Cases and Workflows

There are multiple use cases for this tool.

### Create or Update a Font Family on google/fonts:

If the family already has an `upstream.yaml` file in its google/fonts directory, this will do (`-p/--pr`: make a PR, implying `-g/--gf-git`):

    $ gftools packager "Family Serif" path/to/google/fonts/clone -p
    # or
    $ gftools packager "Family Serif" path/to/google/fonts/clone --pr

It will however ask if want to to edit the `upstream.yaml` file or not. If answered positively, an editor will be opened with the contents of the file.

In the case of a family that is not on google/fonts or not yet has an `upstream.yaml` file on google/fonts, the tool will help tyou interactively to create such a file.

In case the `upstream.yaml` is up to date, the `-y/--no-confirm` flag will prevent any user interaction and result in an uninterrupted program flow, but that can also lead to an early exit of the program:

    $ gftools packager "Family Serif" path/to/google/fonts/clone -p -y
    # or
    $ gftools packager "Family Serif" path/to/google/fonts/clone --pr --no-confirm

The git branch created in this example will be called `gftools_packager_familyserif` and if it already exists, e.g. from a previous attempt, the tool can't override the branch without explicit permission. In interactive mode, the tool can ask for permission, but, with the `-y/--no-confirm` flag, permission can be given when calling the command with `-f/--force`:

    $ gftools packager "Family Serif" path/to/google/fonts/clone -p -y -f
    # or
    $ gftools packager "Family Serif" path/to/google/fonts/clone --pr --no-confirm --force

### Use a Local `upstream.yaml` File:

To add a new family or experiment with upstream configuration settings, it can be a good thing to use an `upstream.yaml` file directly from disk. Also, in case of a crash often caused by a problem in the upstream configuration, packager will ask to save a backup copy of the upstream configuration to disk. This file can be used to pick up work from the point of the crash, even if the `upstream.yaml` was created only in interactive mode.

    $ gftools packager path/to/family-serif.upstream.yaml path/to/google/fonts/clone [... flags]

Below is also a guide how to create an `upstream.yaml` file directly from the tool, using the `-u/--upstream-yaml` flag

### Workflow: Local Finalizing Loop with QA

Suppose we want to add a super family with two siblings families on google/fonts. In this case we want to run the QA tooling locally before making the PR, to make sure the PR will run smoothly. We also want to iterate quickly between fixing upstream and running QA.

#### Create a Local `upstream.yaml`

Get started by creating a local `upstream.yaml` for quick access.

     $ gftools packager "Family Sans" familysans.upstream.yaml -u
     # or
     $ gftools packager "Family Sans" familysans.upstream.yaml --upstream-yaml

If "Family Sans" is already on google/fonts, `familysans.upstream.yaml` will get filled with as much info as available. Use -y/--no-confirm to skip interactive mode, you can always edit the file later:

    $ gftools packager "Family Sans" familysans.upstream.yaml -u -y
    # or
    $ gftools packager "Family Sans" familysans.upstream.yaml --upstream-yaml --no-confirm

To directly output the unchanged, original `upstream.yaml` template don't use a `name`:

    $ gftools packager familysans.upstream.yaml -u
    # or
    $ gftools packager familysans.upstream.yaml --upstream-yaml

You can also have a look at the [`upstream.yaml` template](../../Lib/gftools/template.upstream.yaml) now.

Now edit the the file according to your projects needs.

#### The `repository_url: local://` Hack

**NOTE:** To achieve a real quick local finalizing loop, there's a hack built into the `upstream.yaml` `repository_url` property. You can use the `local://` prefix to reference a git repository path on your disk. This has two advantages for local development:

* no git clone of a repository from GitHub each time you run `gftool packager`
* no pushing necessary to your remote working branch.

You will however still have to commit changes to your local branch.

**CAUTION:** Google Fonts won't accept families where the METADATA.pb `source.repository_url` and `source.commit` hash are not publicly available. Consider the `local://` hack a temporary measure to get you up and running smoothly.

In your `familysans.upstream.yaml` you  can put a relative path, that will always be local to your current working directory (run `$ pwd` if unsure):

    # in file familysans.upstream.yaml
    repository_url: local://../font-projects/family-sans-font

Absolute paths are no problem either:

    # in file familysans.upstream.yaml
    repository_url: local:///home/username/font-projects/family-sans-font

Or use a `~` tilde shortcut to your home directory, perhaps the best option:

    # in file familysans.upstream.yaml
    repository_url: local://~/font-projects/family-sans-font

And the name of your feature brach, e.g:

    # in file familysans.upstream.yaml
    branch: finalizing_v2.000_to_google_fonts
#### The QA – Finalizing Loop

Now that you have prepared everything, start creating a package in the working directory of your local clone or fork of google/fonts. As mentioned before, especially for Font Bakery, this is optimal. Be careful with the `-f/--force` flag, if you are not sure what it does, don't use it, or read above and learn about it. You can also use the `-y/--no-confirm` flag.

    $ gftools packager familysans.upstream.yaml path/to/google/fonts/clone -fy

  If everything goes well, you will see a line like this in the output, that points you to where the package has been created:

    […]
    Package Directory: path/to/google/fonts/clone/ofl/familysans
    […]
    Done!

Now run `gftools qa` tools. It's initially OK to only run Font Bakery and to work on fixing all the FAIL stauses in the sources, but **this is the wrong place to teach details about the QA and finalizing process.** *FIXME: Where is the right place?*:

    $ gftools qa -f path/to/google/fonts/clone/ofl/familysans/*.ttf --fontbakery -o ./font_out_qa
    # or use Font Bakery directly if you want to use its command line options directly
    $ fontbakery check-googlefonts path/to/google/fonts/clone/ofl/familysans/*.ttf

The results of the quality assurance tools should point you to enough issues that need work on your font project. After fixing these, repeat the local packaging and QA-ing. Once you are satisfied you can start preparing the PR.

#### Make a Pull Request

If you worked locally, as described in the previous sections, you should by now have an almost ready to go local file `familysans.upstream.yaml` with `local://` hack applied and a local repository of your font project, with a feature branch that contains all the latest finalizing changes that you made. It's now time to get the changes of your feature branch merged into the projects repository `main` branch. You can now change the `repository_url` and `branch` in your `familysans.upstream.yaml` file to the official project repository.

**NOTE:** as `branch` it is also possible to **reference a git tag**, such as a release tag if the project does tag releases, e.g. `tags/v1.000` for the tag `v1.000` or `tags/latest` for the tag `latest` do work as well. Use the `tags/` prefix to make it very clear that you are referencing a tag here.

The changed parts of your file should look similar to this:

    # in file familysans.upstream.yaml
    repository_url: https://github.com/foundry/family-sans-font.git
    branch: main

Now dispatch the PR and join the discussion on [google/fonts/pulls](https://github.com/google/fonts/pulls):

    $ gftools packager familysans.upstream.yaml path/to/google/fonts/clone -p -y

Congratulations, you set up the `upstream.yaml` for a font project from scratch. Future updates will be much simpler than this!

### Multi Family/Super Family/Bunch Updates

If e.g. a super family changes values that are shared between its sibling families, the right thing to do is to **make one PR with all changed sibling families in one go**. There are two ways the packager supports this. Lets assume that the `upstream.yaml` files for all siblings are already on google fonts and that they are still up to date, so there's no need to change them.

The direct way is use all siblings in one call, creating **one commit per sibling**, then send the commit directly:

    $ gftools packager "Family Sans" "Family Serif" "Family Mono" path/to/google/fonts/clone -p -y

Equivalently, this can be done incrementally, to make room for whatever needs to be done between the steps. In this case we pick a git branch name `-b/--branch` for the PR that describes our intend. To add to the branch we must use the `-a/--add-commit` flag.

This is supposed to create a new branch. Use `-f/--force` if the branch exists and you want to override it:

    $ gftools packager "Family Sans" path/to/google/fonts/clone -b update_family_sans-serif-mono -y

Start adding commits:

    $ gftools packager "Family Serif" path/to/google/fonts/clone -b update_family_sans-serif-mono -a -y
    # In between these operations you can add other commits to the branch, rebase etc.
    $ gftools packager "Family Mono" path/to/google/fonts/clone -b update_family_sans-serif-mono -a -y

You could have used `-p/--pr` to dispatch the commit directly with the last call. However, this way I can demonstrate that you don't need to add a package in order to make a PR for an existing branch:

    $ gftools packager path/to/google/fonts/clone -b update_family_sans-serif-mono -p

The `name` items can be zero or more in a call to the packager, however, without making a PR there's really no point in running the command at all. It's also possible to mix family names and `upstream.yaml` file names in one call to the packager, each  `name` is treated individually.

    $ gftools packager path/to/google/fonts/clone
    > No families to package.
    > Done!


text:
<?php

namespace BehatResources\ResourceLoader;

use BehatResources\ResourceLoader;

abstract class FileResourceLoader implements ResourceLoader
{
    /**
     * @var string
     */
    protected $resourcePath;
    /**
     * @var string
     */
    protected $basePath;

    /**
     * FileResourceLoader constructor.
     * @param string $basePath
     * @param string $resourcePath
     */
    public function __construct($basePath, $resourcePath)
    {
        $this->basePath = $basePath;
        $this->resourcePath = $resourcePath;
    }

    /**
     * @param string $type
     * @param string $identifier
     * @return array
     */
    public abstract function load($type, $identifier);

    /**
     * @return string
     */
    public function getResourcePath()
    {
        return $this->resourcePath;
    }

    /**
     * @param string $resourcePath
     */
    public function setResourcePath($resourcePath)
    {
        $this->resourcePath = $resourcePath;
    }

    /**
     * @return string
     */
    public function getBasePath()
    {
        return $this->basePath;
    }

    /**
     * @param string $basePath
     */
    public function setBasePath($basePath)
    {
        $this->basePath = $basePath;
    }
}


text:
int main(){
  char a;
  short b;
  int c;
  float d;
  double e;
  long f;
  printf("char is %lu bytes\n", sizeof(a));
  printf("short is %lu bytes\n", sizeof(b));
  printf("int is %lu bytes\n", sizeof(c));
  printf("float is %lu bytes\n", sizeof(d));
  printf("double is %lu bytes\n", sizeof(e));
  printf("long is %lu bytes\n", sizeof(f));
}


text:
<!DOCTYPE html>

  <meta charset="utf-8">
  <meta name="viewport" content="width=device-width, initial-scale=1">
  <title>{{ site.data.theme.name }} - {{ page.title }}</title>
  <meta name="author" content="{{ site.data.theme.name }}" />
  <meta name="description" content="The blog of {{ site.data.theme.name }}" />
  <link rel="canonical" href="{{ site.url }}{{ page.url | replace:'index.html','' }}" />

  <link rel="shortcut icon" href="/favicon.png">
  <link rel="alternate" type="application/atom+xml" title="{{ site.data.theme.name }}" href="{{site.url}}/atom.xml" />

  <link rel="stylesheet" href="/assets/css/all.css">
  <link rel="stylesheet" href="/assets/css/font-awesome.min.css">
  <meta name="flattr:id" content="y72jj9">

      {% include sidebar.html %}

      {{ content }}

        {% include footer.html %}

{% include analytics.html %}