text:
<assembly xmlns="http://maven.apache.org/plugins/maven-assembly-plugin/assembly/1.1.0"
          xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
          xsi:schemaLocation="http://maven.apache.org/plugins/maven-assembly-plugin/assembly/1.1.0 http://maven.apache.org/xsd/assembly-1.1.0.xsd">
    <id>bin</id>
    <formats>
        <!--<format>tar.gz</format>-->
        <!--<format>tar.bz2</format>-->
        <format>zip</format>
    </formats>
    <includeBaseDirectory>false</includeBaseDirectory>
    <fileSets>
        <fileSet>
            <directory>${project.basedir}</directory>
            <outputDirectory>/</outputDirectory>
            <includes>
                <include>README*</include>
                <include>LICENSE*</include>
                <include>NOTICE*</include>
            </includes>
        </fileSet>
        <fileSet>
            <directory>${project.build.directory}/site</directory>
            <outputDirectory>docs</outputDirectory>
        </fileSet>
    </fileSets>
    <dependencySets>
        <dependencySet>
            <excludes>
                <!-- JsonPath -->
                <exclude>com.jayway.restassured:json-path</exclude>
                <exclude>com.fasterxml.jackson.core:jackson-databind</exclude>
                <exclude>com.fasterxml.jackson.core:jackson-annotations</exclude>
                <exclude>com.fasterxml.jackson.core:jackson-core</exclude>
                <exclude>org.codehaus.jackson:jackson-core-asl</exclude>
                <exclude>org.codehaus.jackson:jackson-mapper-asl</exclude>
                <exclude>com.google.code.gson:gson</exclude>
                <exclude>com.googlecode.json-simple:json-simple</exclude>
                <!-- XmlPath -->
                <exclude>com.jayway.restassured:xml-path</exclude>
                <!-- Rest Assured -->
                <exclude>com.jayway.restassured:rest-assured</exclude>
                <exclude>com.jayway.restassured:rest-assured-common</exclude>
            </excludes>
            <outputDirectory>/</outputDirectory>
            <useProjectArtifact>true</useProjectArtifact>
            <scope>runtime</scope>
        </dependencySet>
    </dependencySets>
</assembly>


text:
import React, { Component, PropTypes } from 'react';
import Review from './Review.js';

class ReviewList extends Component {
  static propTypes = {
    // todo change to arrayOf with shape
    extractedTweets: PropTypes.array.isRequired,
    onTimeout: PropTypes.func.isRequired,
  }

  componentDidMount() {
    console.log('component diasdfd mount')
    this.props.onTimeout();
    setTimeout(this.props.onTimeout, 2000);
  }

  render() {
    return (
      <ul>
        {this.props.extractedTweets ?
          this.props.extractedTweets.map(review =>
            <Review
              key={Math.random()}
              {...review}
            />
          ) :
          null
        }
      </ul>
    );
  }
}

export default ReviewList;

redpajama_set_name: RedPajamaGithub


text:
<?xml version="1.0" encoding="utf-8"?>
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
    xmlns:tools="http://schemas.android.com/tools"
    xmlns:app="http://schemas.android.com/apk/res-auto"
    android:layout_width="match_parent"
    android:layout_height="match_parent"
    android:paddingLeft="@dimen/activity_horizontal_margin"
    android:paddingRight="@dimen/activity_horizontal_margin"
    android:paddingTop="@dimen/activity_vertical_margin"
    android:paddingBottom="@dimen/activity_vertical_margin"
    app:layout_behavior="@string/appbar_scrolling_view_behavior"
    tools:showIn="@layout/activity_my_courses"
    android:background="@drawable/homepage_background"
    tools:context="com.example.ajeyadav.cstutorialapplication.MyCoursesActivity">

</RelativeLayout>


text:
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">

<TITLE>
ch.ethz.mxquery.extensionsModules.util
</TITLE>

<META NAME="date" CONTENT="2009-05-04">

<LINK REL ="stylesheet" TYPE="text/css" HREF="../../../../../stylesheet.css" TITLE="Style">

ch.ethz.mxquery.extensionsModules.util

Classes

ParseStringToXML

Random

SerializeXMLToString

Tidy

Uuid


text:
package org.openintents.openpgp.util;

import android.app.Activity;
import android.app.PendingIntent;
import android.content.Context;
import android.content.Intent;
import android.content.IntentSender;
import android.content.res.TypedArray;
import android.os.Parcel;
import android.os.Parcelable;
import android.preference.Preference;
import android.text.TextUtils;
import android.util.AttributeSet;
import android.util.Log;

import org.openintents.openpgp.IOpenPgpService2;
import org.openintents.openpgp.OpenPgpError;
import org.openintents.openpgp.R;

public class OpenPgpKeyPreference extends Preference {
    private long mKeyId;
    private String mOpenPgpProvider;
    private OpenPgpServiceConnection mServiceConnection;
    private String mDefaultUserId;

    public static final int REQUEST_CODE_KEY_PREFERENCE = 9999;

    private static final int NO_KEY = 0;

    public OpenPgpKeyPreference(Context context, AttributeSet attrs) {
        super(context, attrs);
    }

    @Override
    public CharSequence getSummary() {
        return (mKeyId == NO_KEY) ? getContext().getString(R.string.openpgp_no_key_selected)
                : getContext().getString(R.string.openpgp_key_selected);
    }

    private void updateEnabled() {
        if (TextUtils.isEmpty(mOpenPgpProvider)) {
            setEnabled(false);
        } else {
            setEnabled(true);
        }
    }

    public void setOpenPgpProvider(String packageName) {
        mOpenPgpProvider = packageName;
        updateEnabled();
    }

    public void setDefaultUserId(String userId) {
        mDefaultUserId = userId;
    }

    @Override
    protected void onClick() {
        // bind to service
        mServiceConnection = new OpenPgpServiceConnection(
                getContext().getApplicationContext(),
                mOpenPgpProvider,
                new OpenPgpServiceConnection.OnBound() {
                    @Override
                    public void onBound(IOpenPgpService2 service) {

                        getSignKeyId(new Intent());
                    }

                    @Override
                    public void onError(Exception e) {
                        Log.e(OpenPgpApi.TAG, "exception on binding!", e);
                    }
                }
        );
        mServiceConnection.bindToService();
    }

    private void getSignKeyId(Intent data) {
        data.setAction(OpenPgpApi.ACTION_GET_SIGN_KEY_ID);
        data.putExtra(OpenPgpApi.EXTRA_USER_ID, mDefaultUserId);

        OpenPgpApi api = new OpenPgpApi(getContext(), mServiceConnection.getService());
        api.executeApiAsync(data, null, null, new MyCallback(REQUEST_CODE_KEY_PREFERENCE));
    }

    private class MyCallback implements OpenPgpApi.IOpenPgpCallback {
        int requestCode;

        private MyCallback(int requestCode) {
            this.requestCode = requestCode;
        }

        @Override
        public void onReturn(Intent result) {
            switch (result.getIntExtra(OpenPgpApi.RESULT_CODE, OpenPgpApi.RESULT_CODE_ERROR)) {
                case OpenPgpApi.RESULT_CODE_SUCCESS: {

                    long keyId = result.getLongExtra(OpenPgpApi.EXTRA_SIGN_KEY_ID, NO_KEY);
                    save(keyId);

                    break;
                }
                case OpenPgpApi.RESULT_CODE_USER_INTERACTION_REQUIRED: {

                    PendingIntent pi = result.getParcelableExtra(OpenPgpApi.RESULT_INTENT);
                    try {
                        Activity act = (Activity) getContext();
                        act.startIntentSenderFromChild(
                                act, pi.getIntentSender(),
                                requestCode, null, 0, 0, 0);
                    } catch (IntentSender.SendIntentException e) {
                        Log.e(OpenPgpApi.TAG, "SendIntentException", e);
                    }
                    break;
                }
                case OpenPgpApi.RESULT_CODE_ERROR: {
                    OpenPgpError error = result.getParcelableExtra(OpenPgpApi.RESULT_ERROR);
                    Log.e(OpenPgpApi.TAG, "RESULT_CODE_ERROR: " + error.getMessage());

                    break;
                }
            }
        }
    }

    private void save(long newValue) {
        // Give the client a chance to ignore this change if they deem it
        // invalid
        if (!callChangeListener(newValue)) {
            // They don't want the value to be set
            return;
        }

        setAndPersist(newValue);
    }

    /**
     * Public API
     */
    public void setValue(long keyId) {
        setAndPersist(keyId);
    }

    /**
     * Public API
     */
    public long getValue() {
        return mKeyId;
    }

    private void setAndPersist(long newValue) {
        mKeyId = newValue;

        // Save to persistent storage (this method will make sure this
        // preference should be persistent, along with other useful checks)
        persistLong(mKeyId);

        // Data has changed, notify so UI can be refreshed!
        notifyChanged();

        // also update summary
        setSummary(getSummary());
    }

    @Override
    protected Object onGetDefaultValue(TypedArray a, int index) {
        // This preference type's value type is Long, so we read the default
        // value from the attributes as an Integer.
        return (long) a.getInteger(index, NO_KEY);
    }

    @Override
    protected void onSetInitialValue(boolean restoreValue, Object defaultValue) {
        if (restoreValue) {
            // Restore state
            mKeyId = getPersistedLong(mKeyId);
        } else {
            // Set state
            long value = (Long) defaultValue;
            setAndPersist(value);
        }
    }

    @Override
    protected Parcelable onSaveInstanceState() {
        /*
         * Suppose a client uses this preference type without persisting. We
         * must save the instance state so it is able to, for example, survive
         * orientation changes.
         */

        final Parcelable superState = super.onSaveInstanceState();
        if (isPersistent()) {
            // No need to save instance state since it's persistent
            return superState;
        }

        // Save the instance state
        final SavedState myState = new SavedState(superState);
        myState.keyId = mKeyId;
        myState.openPgpProvider = mOpenPgpProvider;
        myState.defaultUserId = mDefaultUserId;
        return myState;
    }

    @Override
    protected void onRestoreInstanceState(Parcelable state) {
        if (!state.getClass().equals(SavedState.class)) {
            // Didn't save state for us in onSaveInstanceState
            super.onRestoreInstanceState(state);
            return;
        }

        // Restore the instance state
        SavedState myState = (SavedState) state;
        super.onRestoreInstanceState(myState.getSuperState());
        mKeyId = myState.keyId;
        mOpenPgpProvider = myState.openPgpProvider;
        mDefaultUserId = myState.defaultUserId;
        notifyChanged();
    }

    /**
     * SavedState, a subclass of {@link BaseSavedState}, will store the state
     * of MyPreference, a subclass of Preference.
     * <p/>
     * It is important to always call through to super methods.
     */
    private static class SavedState extends BaseSavedState {
        long keyId;
        String openPgpProvider;
        String defaultUserId;

        public SavedState(Parcel source) {
            super(source);

            keyId = source.readInt();
            openPgpProvider = source.readString();
            defaultUserId = source.readString();
        }

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

            dest.writeLong(keyId);
            dest.writeString(openPgpProvider);
            dest.writeString(defaultUserId);
        }

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

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

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

    public boolean handleOnActivityResult(int requestCode, int resultCode, Intent data) {
        if (requestCode == REQUEST_CODE_KEY_PREFERENCE && resultCode == Activity.RESULT_OK) {
            getSignKeyId(data);
            return true;
        } else {
            return false;
        }
    }

}


text:
<?php
namespace ChatApp;
use Ratchet\MessageComponentInterface;
use Ratchet\ConnectionInterface;

class ConnectionHandler implements MessageComponentInterface {
    protected $clients;

    public function __construct() {
        $this->clients = new \SplObjectStorage;
    }

    public function onOpen(ConnectionInterface $conn) {
        $this->clients->attach($conn);
        echo "New connection! ({$conn->resourceId})\n";
        $message = new Models\Message('Welcome to the test chat app');
        $message->setUsername('bot');
        $conn->send($message->json());
    }

    public function onMessage(ConnectionInterface $from, $msg) {
        $numRecv = count($this->clients) - 1;
        echo sprintf('Connection %d sending message "%s" to %d other connection%s' . "\n"
        , $from->resourceId, $msg, $numRecv, $numRecv == 1 ? '' : 's');

        foreach ($this->clients as $client) {
            if ($from !== $client) {
                // The sender is not the receiver, send to each client connected
                $client->send($msg);
            }
        }
    }

    public function onClose(ConnectionInterface $conn) {
        // The connection is closed, remove it, as we can no longer send it messages
        $this->clients->detach($conn);

        echo "Connection {$conn->resourceId} has disconnected\n";
    }

    public function onError(ConnectionInterface $conn, \Exception $e) {
        echo "An error has occurred: {$e->getMessage()}\n";

        $conn->close();
    }
}


text:
import * as Agenda from "agenda";

var mongoConnectionString = "mongodb://127.0.0.1/agenda";

var agenda = new Agenda({ db: { address: mongoConnectionString } });

agenda.define('delete old users', (job, done) => {

});

agenda.on('ready', () => {
    agenda.every('3 minutes', 'delete old users');

    // Alternatively, you could also do:
    agenda.every('*/3 * * * *', 'delete old users');

    agenda.start();
});

agenda.define('send email report', { priority: 'high', concurrency: 10 }, (job, done) => {
});

agenda.on('ready', () => {
    agenda.schedule('in 20 minutes', 'send email report', { to: 'admin@example.com' });
    agenda.start();
});

agenda.on('ready', () => {
    var weeklyReport = agenda.create('send email report', { to: 'another-guy@example.com' });
    weeklyReport.repeatEvery('1 week').save();
    agenda.start();
});

var agenda = new Agenda({ processEvery: '30 seconds' });

agenda.defaultConcurrency(5);

var agenda = new Agenda({ defaultConcurrency: 5 });

agenda.lockLimit(0);

var agenda = new Agenda({ lockLimit: 0 });

agenda.defaultLockLimit(0);

var agenda = new Agenda({ defaultLockLimit: 0 });

agenda.defaultLockLifetime(10000);

var agenda = new Agenda({ defaultLockLifetime: 10000 });

agenda.define('some long running job', function(job, done) {
    done();
});

agenda.every('15 minutes', ['printAnalyticsReport', 'sendNotifications', 'updateUserRecords']);

agenda.schedule('tomorrow at noon', 'printAnalyticsReport', { userCount: 100 });

agenda.schedule('tomorrow at noon', ['printAnalyticsReport', 'sendNotifications', 'updateUserRecords']);

agenda.now('do the hokey pokey');

var job = agenda.create('printAnalyticsReport', { userCount: 100 });
job.save(function(err) {
    console.log("Job successfully saved");
});

agenda.jobs({ name: 'printAnalyticsReport' }, function(err, jobs) {
    // Work with jobs (see below)
});

agenda.cancel({ name: 'printAnalyticsReport' }, function(err, numRemoved) {
});

agenda.purge(function(err, numRemoved) {
});

agenda.stop(function() {
    process.exit(0);
});

job.repeatEvery('10 minutes');

job.repeatAt('3:30pm');

job.schedule('tomorrow at 6pm');

job.priority('low');
job.priority(10);

job.unique({ 'data.type': 'active', 'data.userId': '123' });
job.fail('insuficient disk space');
job.fail(new Error('insufficient disk space'));
job.run(function(err, job) {
    console.log("I don't know why you would need to do this...");
});
job.remove(function(err) {
    if (!err) console.log("Successfully removed job from collection");
})


text:
package org.apache.oodt.cas.filemgr.structs;

import java.util.Collections;
//JDK imports
import java.util.List;
import java.util.Vector;

//OODT imports
import org.apache.oodt.cas.filemgr.structs.type.TypeHandler;
import org.apache.oodt.cas.metadata.Metadata;

/**
 * @author mattmann
 * @author bfoster
 * @version $Revision$
 *
 * <p>
 * A ProductType is a type of content that will be ingested into the data store
 * element of the CAS File Manager. The {@link MetadataStore} also needs to know
 * about the ProductType, because {@link Element}s are associated with them to
 * define how the metadata is stored for a particular product.
 * </p>
 *
 */
public class ProductType {

    /* the unique ID representing this product type */
    private String productTypeId = null;

    /* the name of this product type */
    private String name = null;

    /* a description of this product type */
    private String description = null;

    /* the path to the repository for this product type */
    private String productRepositoryPath = null;

    /*
     * the name of the class that implements the versioning scheme for this
     * product type
     */
    private String versioner = null;

    /* metadata describing the product type */
    private Metadata typeMetadata = null;

    /* list of {@link ExtractorSpec}s associated with this product type */
    private List<ExtractorSpec> extractors = null;

    private List<TypeHandler> handlers = null;

    public ProductType() {
        typeMetadata = new Metadata();
        extractors = new Vector<ExtractorSpec>();
    }

    public ProductType(String id, String name, String description,
            String repository, String versioner) {
        productTypeId = id;
        this.name = name;
        this.description = description;
        productRepositoryPath = repository;
        this.versioner = versioner;
        typeMetadata = new Metadata();
    }

    /**
     * @return Returns the description.
     */
    public String getDescription() {
        return description;
    }

    /**
     * @param description
     *            The description to set.
     */
    public void setDescription(String description) {
        this.description = description;
    }

    /**
     * @return Returns the name.
     */
    public String getName() {
        return name;
    }

    /**
     * @param name
     *            The name to set.
     */
    public void setName(String name) {
        this.name = name;
    }

    /**
     * @return Returns the productTypeId.
     */
    public String getProductTypeId() {
        return productTypeId;
    }

    /**
     * @param productTypeId
     *            The productTypeId to set.
     */
    public void setProductTypeId(String productTypeId) {
        this.productTypeId = productTypeId;
    }

    /**
     * @return Returns the productRepositoryPath.
     */
    public String getProductRepositoryPath() {
        return productRepositoryPath;
    }

    /**
     * @param productRepositoryPath
     *            The productRepositoryPath to set.
     */
    public void setProductRepositoryPath(String productRepositoryPath) {
        this.productRepositoryPath = productRepositoryPath;
    }

    /**
     * @return Returns the versioner.
     */
    public String getVersioner() {
        return versioner;
    }

    /**
     * @param versioner
     *            The versioner to set.
     */
    public void setVersioner(String versioner) {
        this.versioner = versioner;
    }

    /**
     * @return the typeMetadata
     */
    public Metadata getTypeMetadata() {
        return typeMetadata;
    }

    /**
     * @param typeMetadata
     *            the typeMetadata to set
     */
    public void setTypeMetadata(Metadata typeMetadata) {
        this.typeMetadata = typeMetadata;
    }

    /**
     * @return the extractors
     */
    public List<ExtractorSpec> getExtractors() {
        return extractors;
    }

    /**
     * @param extractors
     *            the extractors to set
     */
    public void setExtractors(List<ExtractorSpec> extractors) {
        this.extractors = extractors;
    }

    public List<TypeHandler> getHandlers() {
        return handlers;
    }

    public void setHandlers(List<TypeHandler> handlers) {
        this.handlers = handlers;
    }

    /* (non-Javadoc)
     * @see java.lang.Object#toString()
     */
    public String toString() {
        return this.name;
    }

    public static ProductType blankProductType(){
      ProductType type = new ProductType();
      type.setDescription("blank");
      type.setExtractors(Collections.EMPTY_LIST);
      type.setHandlers(Collections.EMPTY_LIST);
      type.setName("blank");
      type.setProductRepositoryPath("");
      type.setProductTypeId("");
      type.setTypeMetadata(new Metadata());
      type.setVersioner("");
      return type;
    }

}


text:
package com.google.common.collect;

import static com.google.common.base.Preconditions.checkState;

import com.google.common.annotations.GwtCompatible;
import com.google.errorprone.annotations.CanIgnoreReturnValue;

/**
 * Precondition checks useful in collection implementations.
 */
@GwtCompatible
final class CollectPreconditions {

  static void checkEntryNotNull(Object key, Object value) {
    if (key == null) {
      throw new NullPointerException("null key in entry: null=" + value);
    } else if (value == null) {
      throw new NullPointerException("null value in entry: " + key + "=null");
    }
  }

  @CanIgnoreReturnValue
  static int checkNonnegative(int value, String name) {
    if (value < 0) {
      throw new IllegalArgumentException(name + " cannot be negative but was: " + value);
    }
    return value;
  }

  @CanIgnoreReturnValue
  static long checkNonnegative(long value, String name) {
    if (value < 0) {
      throw new IllegalArgumentException(name + " cannot be negative but was: " + value);
    }
    return value;
  }

  static void checkPositive(int value, String name) {
    if (value <= 0) {
      throw new IllegalArgumentException(name + " must be positive but was: " + value);
    }
  }

  /**
   * Precondition tester for {@code Iterator.remove()} that throws an exception with a consistent
   * error message.
   */
  static void checkRemove(boolean canRemove) {
    checkState(canRemove, "no calls to next() since the last call to remove()");
  }
}


text:
package cmd

import (
	"io"

	"github.com/spf13/cobra"

	"k8s.io/kubernetes/pkg/apis/rbac"
	"k8s.io/kubernetes/pkg/kubectl/cmd/templates"
	cmdutil "k8s.io/kubernetes/pkg/kubectl/cmd/util"
)

var (
	clusterRoleLong = templates.LongDesc(`
		Create a ClusterRole.`)

	clusterRoleExample = templates.Examples(`
		# Create a ClusterRole named "pod-reader" that allows user to perform "get", "watch" and "list" on pods
		kubectl create clusterrole pod-reader --verb=get,list,watch --resource=pods

		# Create a ClusterRole named "pod-reader" with ResourceName specified
		kubectl create clusterrole pod-reader --verb=get,list,watch --resource=pods --resource-name=readablepod`)
)

type CreateClusterRoleOptions struct {
	*CreateRoleOptions
}

// ClusterRole is a command to ease creating ClusterRoles.
func NewCmdCreateClusterRole(f cmdutil.Factory, cmdOut io.Writer) *cobra.Command {
	c := &CreateClusterRoleOptions{
		CreateRoleOptions: &CreateRoleOptions{
			Out: cmdOut,
		},
	}
	cmd := &cobra.Command{
		Use:     "clusterrole NAME --verb=verb --resource=resource.group [--resource-name=resourcename] [--dry-run]",
		Short:   clusterRoleLong,
		Long:    clusterRoleLong,
		Example: clusterRoleExample,
		Run: func(cmd *cobra.Command, args []string) {
			cmdutil.CheckErr(c.Complete(f, cmd, args))
			cmdutil.CheckErr(c.Validate())
			cmdutil.CheckErr(c.RunCreateRole())
		},
	}
	cmdutil.AddApplyAnnotationFlags(cmd)
	cmdutil.AddValidateFlags(cmd)
	cmdutil.AddPrinterFlags(cmd)
	cmdutil.AddDryRunFlag(cmd)
	cmd.Flags().StringSliceVar(&c.Verbs, "verb", []string{}, "verb that applies to the resources contained in the rule")
	cmd.Flags().StringSlice("resource", []string{}, "resource that the rule applies to")
	cmd.Flags().StringSliceVar(&c.ResourceNames, "resource-name", []string{}, "resource in the white list that the rule applies to")

	return cmd
}

func (c *CreateClusterRoleOptions) RunCreateRole() error {
	clusterRole := &rbac.ClusterRole{}
	clusterRole.Name = c.Name
	rules, err := generateResourcePolicyRules(c.Mapper, c.Verbs, c.Resources, c.ResourceNames)
	if err != nil {
		return err
	}
	clusterRole.Rules = rules

	// Create ClusterRole.
	if !c.DryRun {
		_, err = c.Client.ClusterRoles().Create(clusterRole)
		if err != nil {
			return err
		}
	}

	if useShortOutput := c.OutputFormat == "name"; useShortOutput || len(c.OutputFormat) == 0 {
		cmdutil.PrintSuccess(c.Mapper, useShortOutput, c.Out, "clusterroles", c.Name, c.DryRun, "created")
		return nil
	}

	return c.PrintObject(clusterRole)
}


text:
package physique.actions.vivant;

import listeners.ContactListener;
import perso.Vivant;
import physique.actions.AbstractAction;
import ressources.sprites.animation.sequence.Animations;
import ressources.sprites.animation.sequence.Sequence;
import controles.TypeAction;
import exceptions.HorsLimiteException;

public class ActionSaut extends ActionVivant<Vivant> implements ContactListener {
    private boolean finie, aSaute;
    private Sequence tombe;
    private int inertie;

    public ActionSaut(Vivant source) {
	super(source);
    }

    @Override
    public Sequence getSequence() {
	return Animations.getInstance().getSequence("saut", false);
    }

    @Override
    public boolean peutFaire(AbstractAction<?> courante) {
	return true;
    }

    @Override
    public void tourAction() {
	if(getTour() > 10) {
	    Vivant source = getSource();
	    if(!aSaute) {
		aSaute = true;
		int p = source.getPuissanceSaut();
		source.addForce(inertie * 2 + (source.estDroite() ? p/5 : -p/5), p);
	    }
	    if(getTour() < 20) try {
		source.deplacement(source.estDroite() ? 5 : -5, 5);
	    } catch(HorsLimiteException e) {}
	    inertie /= 1.2;
	}
    }

    @Override
    public void commence() {
	finie = false;
	aSaute = false;
	tombe = null;
	inertie = getSource().getDernierDeplacement();
	getSource().setContactSolListener(this);
	setVitesseAnim(150);
    }

    @Override
    public TypeAction getType() {
	return TypeAction.SAUT;
    }

    @Override
    public void contactSol(int tempsVol) {
	finie = aSaute;
	if(finie) {
	    if(tombe != null) {
		getSource().addForceX(inertie);
		getSource().addForceXOrientation(33);
		getSource().getAnimation().setSequence(Animations.getInstance().getSequence("stop tombe renverse", false));
	    } else {
		if(tombe != null)
		    getSource().getAnimation().terminer();
		getSource().getAnimation().terminer();
	    }
	    stopAction();
	}
    }

    @Override
    public void contactHaut(int vitesse) {
	if(vitesse > 50) {
	    finie = aSaute;
	    if(finie) {
		Sequence s = Animations.getInstance().getSequence("stop saut", false);
		s.setSuivante(tombe = Animations.getInstance().getSequence("tombe renverse", !getSource().estPose()));
		getSource().getAnimation().setSequence(s);
	    }
	}
    }

    @Override
    public void seTermine() {
	getSource().removeContactSolListener(this);
    }

    @Override
    public boolean peutArret() {
	return finie;
    }

}


text:
using UnityEngine;
using UnityEngine.UI;
using UnityEngine.Events;
using System.Collections;

public class ModalPanel : MonoBehaviour
  {
	public Text   Title;     //The Modal Window Title
	public Text   Question;  //The Modal Window Question (or statement)
	public Button Button1;   //The first button
	public Button Button2;   //The second button
	public Button Button3;   //The third button
	public Image  IconImage; //The Icon Image, if any

	public GameObject ModalPanelObject;       //Reference to the Panel Object
	private static ModalPanel MainModalPanel; //Reference to the Modal Panel, to make sure it's been included

	public static ModalPanel Instance()
	  {
		if (!MainModalPanel)
		  {
			MainModalPanel = FindObjectOfType(typeof(ModalPanel)) as ModalPanel;
			if (!MainModalPanel)
			  {
				Debug.LogError("There needs to be one active ModalPanel script on a GameObject in your scene.");
			  }
		  }
		return MainModalPanel;
	  }

	public void MessageBox(Sprite IconPic, string Title, string Question, UnityAction YesEvent, UnityAction NoEvent, UnityAction CancelEvent, UnityAction OkEvent, bool IconActive, string MessageType)
	  {
		ModalPanelObject.SetActive(true);  //Activate the Panel; its default is "off" in the Inspector
		if (MessageType == "YesNoCancel")  //If the user has asked for the Message Box type "YesNoCancel"
		  {
			//Button1 is on the far left; Button2 is in the center and Button3 is on the right.  Each can be activated and labeled individually.
			Button1.onClick.RemoveAllListeners (); Button1.onClick.AddListener(YesEvent);    Button1.onClick.AddListener(ClosePanel); Button1.GetComponentInChildren<Text>().text = "Yes";
			Button2.onClick.RemoveAllListeners (); Button2.onClick.AddListener(NoEvent);     Button2.onClick.AddListener(ClosePanel); Button2.GetComponentInChildren<Text>().text = "No";
			Button3.onClick.RemoveAllListeners (); Button3.onClick.AddListener(CancelEvent); Button3.onClick.AddListener(ClosePanel); Button3.GetComponentInChildren<Text>().text = "Cancel";
			Button1.gameObject.SetActive(true); //We always turn on ONLY the buttons we need, and leave the rest off.
			Button2.gameObject.SetActive(true);
			Button3.gameObject.SetActive(true);
		  }
		if (MessageType == "YesNo")        //If the user has asked for the Message Box type "YesNo"
		  {
			Button1.onClick.RemoveAllListeners ();
			Button2.onClick.RemoveAllListeners (); Button2.onClick.AddListener(YesEvent);     Button2.onClick.AddListener(ClosePanel); Button2.GetComponentInChildren<Text>().text = "Yes";
			Button3.onClick.RemoveAllListeners (); Button3.onClick.AddListener(NoEvent);      Button3.onClick.AddListener(ClosePanel); Button3.GetComponentInChildren<Text>().text = "No";
			Button1.gameObject.SetActive(false);
			Button2.gameObject.SetActive(true);
			Button3.gameObject.SetActive(true);
		  }
		if (MessageType == "Ok")           //If the user has asked for the Message Box type "Ok"
		  {
			Button1.onClick.RemoveAllListeners ();
			Button2.onClick.RemoveAllListeners (); Button2.onClick.AddListener(OkEvent);     Button2.onClick.AddListener(ClosePanel); Button2.GetComponentInChildren<Text>().text = "Ok";
			Button3.onClick.RemoveAllListeners ();
			Button1.gameObject.SetActive(false);
			Button2.gameObject.SetActive(true);
			Button3.gameObject.SetActive(false);
		  }
		this.Title.text = Title;           //Fill in the Title part of the Message Box
		this.Question.text = Question;     //Fill in the Question/statement part of the Messsage Box
		if (IconActive)                    //If the Icon is active (true)...
		  {
			this.IconImage.gameObject.SetActive(true);  //Turn on the icon,
			this.IconImage.sprite = IconPic;            //and assign the picture.
		  }
		else
		  {
			this.IconImage.gameObject.SetActive(false); //Turn off the icon.
		  }
  	  }

	void ClosePanel()
	  {
		ModalPanelObject.SetActive(false); //Close the Modal Dialog
	  }
  }


text:
#include "scene/model.h"

#include "engine/material_shader_manager.h"

namespace Scene {

void Model::CreateVertexBuffer(ID3D11Device *device, void *vertices, size_t vertexStride, uint vertexCount, DisposeAfterUse disposeAfterUse) {
	D3D11_BUFFER_DESC vbd;
	vbd.Usage = D3D11_USAGE_IMMUTABLE;
	vbd.ByteWidth = static_cast<uint>(vertexStride) * vertexCount;
	vbd.BindFlags = D3D11_BIND_VERTEX_BUFFER;
	vbd.CPUAccessFlags = 0;
	vbd.MiscFlags = 0;
	vbd.StructureByteStride = 0;

	CreateVertexBuffer(device, vertices, vertexCount, vbd, disposeAfterUse);
}

void Model::CreateVertexBuffer(ID3D11Device *device, void *vertices, uint vertexCount, D3D11_BUFFER_DESC vertexBufferDesc, DisposeAfterUse disposeAfterUse) {
	VertexStride = vertexBufferDesc.ByteWidth / vertexCount;

	D3D11_SUBRESOURCE_DATA vInitData;
	vInitData.pSysMem = vertices;

	HR(device->CreateBuffer(&vertexBufferDesc, &vInitData, &VertexBuffer));

	if (disposeAfterUse == DisposeAfterUse::YES) {
		delete[] vertices;
	}
}

void Model::CreateIndexBuffer(ID3D11Device *device, uint *indices, uint indexCount, DisposeAfterUse disposeAfterUse) {
	D3D11_BUFFER_DESC ibd;
	ibd.Usage = D3D11_USAGE_IMMUTABLE;
	ibd.ByteWidth = sizeof(uint) * indexCount;
	ibd.BindFlags = D3D11_BIND_INDEX_BUFFER;
	ibd.CPUAccessFlags = 0;
	ibd.MiscFlags = 0;
	ibd.StructureByteStride = 0;

	CreateIndexBuffer(device, indices, indexCount, ibd, disposeAfterUse);
}

void Model::CreateIndexBuffer(ID3D11Device *device, uint *indices, uint indexCount, D3D11_BUFFER_DESC indexBufferDesc, DisposeAfterUse disposeAfterUse) {
	D3D11_SUBRESOURCE_DATA iInitData;
	iInitData.pSysMem = indices;

	HR(device->CreateBuffer(&indexBufferDesc, &iInitData, &IndexBuffer));

	if (disposeAfterUse == DisposeAfterUse::YES) {
		delete[] indices;
	}
}

void Model::CreateSubsets(ModelSubset *subsetArray, uint subsetCount, DisposeAfterUse disposeAfterUse) {
	Subsets = subsetArray;
	SubsetCount = subsetCount;
	m_disposeSubsetArray = disposeAfterUse;

	DirectX::XMVECTOR tempAABB_min = DirectX::XMVectorSet(0.0f, 0.0f, 0.0f, 0.0f);
	DirectX::XMVECTOR tempAABB_max = DirectX::XMVectorSet(0.0f, 0.0f, 0.0f, 0.0f);

	for (uint i = 0; i < subsetCount; ++i) {
		tempAABB_min = DirectX::XMVectorMin(tempAABB_min, DirectX::XMLoadFloat3(&subsetArray[i].AABB_min));
		tempAABB_max = DirectX::XMVectorMax(tempAABB_max, DirectX::XMLoadFloat3(&subsetArray[i].AABB_max));
	}

	DirectX::XMStoreFloat3(&AABB_min, tempAABB_min);
	DirectX::XMStoreFloat3(&AABB_max, tempAABB_max);
}

void InstancedModel::CreateInstanceBuffer(ID3D11Device *device, size_t instanceStride, uint maxInstanceCount, void *instanceData, DisposeAfterUse disposeAfterUse) {
	InstanceStride = static_cast<uint>(instanceStride);
	MaxInstanceCount = maxInstanceCount;

	D3D11_BUFFER_DESC instbd;
	instbd.Usage = D3D11_USAGE_DYNAMIC;
	instbd.ByteWidth = InstanceStride * maxInstanceCount;
	instbd.BindFlags = D3D11_BIND_VERTEX_BUFFER;
	instbd.CPUAccessFlags = D3D11_CPU_ACCESS_WRITE; //needed for Map/Unmap
	instbd.MiscFlags = 0;
	instbd.StructureByteStride = 0;

	CreateInstanceBuffer(device, instbd, instanceData, disposeAfterUse);
}

void InstancedModel::CreateInstanceBuffer(ID3D11Device *device, D3D11_BUFFER_DESC instanceBufferDesc, void *instanceData, DisposeAfterUse disposeAfterUse) {
	D3D11_SUBRESOURCE_DATA iInitData;
	iInitData.pSysMem = instanceData;

	HR(device->CreateBuffer(&instanceBufferDesc, instanceData ? &iInitData : nullptr, &InstanceBuffer));

	if (disposeAfterUse == DisposeAfterUse::YES) {
		delete[] instanceData;
	}
}

void *InstancedModel::MapInstanceBuffer(ID3D11DeviceContext *deviceContext, uint *out_maxNumInstances) {
	D3D11_MAPPED_SUBRESOURCE mappedResource;
	deviceContext->Map(InstanceBuffer, 0, D3D11_MAP_WRITE_DISCARD, 0, &mappedResource);

	*out_maxNumInstances = MaxInstanceCount;
	return mappedResource.pData;
}

void InstancedModel::UnMapInstanceBuffer(ID3D11DeviceContext *deviceContext) {
	deviceContext->Unmap(InstanceBuffer, 0);
}

} // End of namespace Scene


text:
"use strict";

//Setup
const gulp = require("gulp");
const merge2 = require('merge2');
const rename = require("gulp-rename");
const fs = require('fs');
var fatalLevel = require('yargs').argv.fatal;
var plumber = require('gulp-plumber');
var coffee = require('gulp-coffee');
var gutil = require('gulp-util');
var gulpPath = require('gulp-path');
const image = require("gulp-image");

/*
    # Design Goals
    + Handle all files located in ./dev/assets
    + Export them to ./www/assets
    + Preform specific optimizations on specific files/types
    + Hashes?
*/

gulp.task('assets',function(){
    //settings
    const assetssettings = {
        assetsin:"../dev/assets/*.*",
        assetsout:"../www/assets/"
    };

    // Copy all assets in ./dev/assets
    return gulp.src(assetssettings.assetsin)
    .pipe(gulp.dest(assetssettings.assetsout));
});


text:
#ifndef HISTORY_LINE_EDIT_HPP
#define HISTORY_LINE_EDIT_HPP

#include <QLineEdit>

class History_Line_Edit : public QLineEdit
{
        Q_OBJECT

        int current_line = 0;
        QStringList lines;
        QString unfinished;

    public:
        explicit History_Line_Edit(QWidget* parent = 0);

    private slots:
        void enter_pressed();

    signals:
        /**
         * @brief Emitted when some text is executed
         */
        void lineExecuted(QString);

    protected:
        void keyPressEvent(QKeyEvent*);
        void wheelEvent(QWheelEvent*);

        void previous_line();
        void next_line();

};

#endif // HISTORY_LINE_EDIT_HPP


text:
file(REMOVE_RECURSE
  "CMakeFiles/LLVMMC.dir/ConstantPools.cpp.o"
  "CMakeFiles/LLVMMC.dir/ELFObjectWriter.cpp.o"
  "CMakeFiles/LLVMMC.dir/MCAsmBackend.cpp.o"
  "CMakeFiles/LLVMMC.dir/MCAsmInfo.cpp.o"
  "CMakeFiles/LLVMMC.dir/MCAsmInfoCOFF.cpp.o"
  "CMakeFiles/LLVMMC.dir/MCAsmInfoDarwin.cpp.o"
  "CMakeFiles/LLVMMC.dir/MCAsmInfoELF.cpp.o"
  "CMakeFiles/LLVMMC.dir/MCAsmStreamer.cpp.o"
  "CMakeFiles/LLVMMC.dir/MCAssembler.cpp.o"
  "CMakeFiles/LLVMMC.dir/MCCodeEmitter.cpp.o"
  "CMakeFiles/LLVMMC.dir/MCCodeGenInfo.cpp.o"
  "CMakeFiles/LLVMMC.dir/MCContext.cpp.o"
  "CMakeFiles/LLVMMC.dir/MCDwarf.cpp.o"
  "CMakeFiles/LLVMMC.dir/MCELF.cpp.o"
  "CMakeFiles/LLVMMC.dir/MCELFObjectTargetWriter.cpp.o"
  "CMakeFiles/LLVMMC.dir/MCELFStreamer.cpp.o"
  "CMakeFiles/LLVMMC.dir/MCExpr.cpp.o"
  "CMakeFiles/LLVMMC.dir/MCInst.cpp.o"
  "CMakeFiles/LLVMMC.dir/MCInstPrinter.cpp.o"
  "CMakeFiles/LLVMMC.dir/MCInstrAnalysis.cpp.o"
  "CMakeFiles/LLVMMC.dir/MCLabel.cpp.o"
  "CMakeFiles/LLVMMC.dir/MCLinkerOptimizationHint.cpp.o"
  "CMakeFiles/LLVMMC.dir/MCMachOStreamer.cpp.o"
  "CMakeFiles/LLVMMC.dir/MCMachObjectTargetWriter.cpp.o"
  "CMakeFiles/LLVMMC.dir/MCNaCl.cpp.o"
  "CMakeFiles/LLVMMC.dir/MCNullStreamer.cpp.o"
  "CMakeFiles/LLVMMC.dir/MCObjectFileInfo.cpp.o"
  "CMakeFiles/LLVMMC.dir/MCObjectStreamer.cpp.o"
  "CMakeFiles/LLVMMC.dir/MCObjectWriter.cpp.o"
  "CMakeFiles/LLVMMC.dir/MCRegisterInfo.cpp.o"
  "CMakeFiles/LLVMMC.dir/MCSection.cpp.o"
  "CMakeFiles/LLVMMC.dir/MCSectionCOFF.cpp.o"
  "CMakeFiles/LLVMMC.dir/MCSectionELF.cpp.o"
  "CMakeFiles/LLVMMC.dir/MCSectionMachO.cpp.o"
  "CMakeFiles/LLVMMC.dir/MCStreamer.cpp.o"
  "CMakeFiles/LLVMMC.dir/MCSubtargetInfo.cpp.o"
  "CMakeFiles/LLVMMC.dir/MCSymbol.cpp.o"
  "CMakeFiles/LLVMMC.dir/MCSymbolizer.cpp.o"
  "CMakeFiles/LLVMMC.dir/MCTargetOptions.cpp.o"
  "CMakeFiles/LLVMMC.dir/MCValue.cpp.o"
  "CMakeFiles/LLVMMC.dir/MCWin64EH.cpp.o"
  "CMakeFiles/LLVMMC.dir/MCWinEH.cpp.o"
  "CMakeFiles/LLVMMC.dir/MachObjectWriter.cpp.o"
  "CMakeFiles/LLVMMC.dir/StringTableBuilder.cpp.o"
  "CMakeFiles/LLVMMC.dir/SubtargetFeature.cpp.o"
  "CMakeFiles/LLVMMC.dir/WinCOFFObjectWriter.cpp.o"
  "CMakeFiles/LLVMMC.dir/WinCOFFStreamer.cpp.o"
  "CMakeFiles/LLVMMC.dir/YAML.cpp.o"
  "../libLLVMMC.pdb"
  "../libLLVMMC.a"
)

# Per-language clean rules from dependency scanning.
foreach(lang CXX)
  include(CMakeFiles/LLVMMC.dir/cmake_clean_${lang}.cmake OPTIONAL)
endforeach()


text:
import bpy
import os
import re

# Delete the cube that starts in the default scene.
bpy.ops.object.delete()
is_obj = re.compile("^.*\.obj$")
is_mtl = re.compile("^.*\.mtl$")

if bpy.ops.import_scene.obj:
    files = os.listdir()
    for f in files:
        if is_obj.match(f):
            bpy.ops.import_scene.obj(filepath=f)

#bpy.ops.anim.change_frame(frame=0)
#bpy.ops.wm.quit_blender()


text:
@interface MOBProjectionEPSG2365 : MOBProjection

@end


text:
*********
Changelog
*********

Versions
========

2.0.0
-----

- Added support to multiple map providers (Google, Mapbox, OpenStreetMap)
- Refactored the Javascript code to use `Leaflet.js <http://leafletjs.com/>`_

Upgrading
=========

From 1.x to 2.x
---------------

Backward incompatible changes
"""""""""""""""""""""""""""""

- Form fields no longer accepts the ``default`` parameter. If you are using
  them directly, without the model field, you have to replace the ``default``
  parameter by the well known standard parameter ``initial``.
- The ``based_fields`` parameter of model fields now only expects field names
  as strings and not field instances.


text:
package com.google.security.zynamics.reil.translators.mips;

import static org.junit.Assert.assertEquals;

import com.google.common.collect.Lists;
import com.google.security.zynamics.reil.OperandSize;
import com.google.security.zynamics.reil.ReilInstruction;
import com.google.security.zynamics.reil.TestHelpers;
import com.google.security.zynamics.reil.interpreter.CpuPolicyMips;
import com.google.security.zynamics.reil.interpreter.EmptyInterpreterPolicy;
import com.google.security.zynamics.reil.interpreter.Endianness;
import com.google.security.zynamics.reil.interpreter.InterpreterException;
import com.google.security.zynamics.reil.interpreter.ReilInterpreter;
import com.google.security.zynamics.reil.interpreter.ReilRegisterStatus;
import com.google.security.zynamics.reil.translators.InternalTranslationException;
import com.google.security.zynamics.reil.translators.StandardEnvironment;
import com.google.security.zynamics.reil.translators.mips.LwlTranslator;
import com.google.security.zynamics.zylib.disassembly.ExpressionType;
import com.google.security.zynamics.zylib.disassembly.IInstruction;
import com.google.security.zynamics.zylib.disassembly.MockInstruction;
import com.google.security.zynamics.zylib.disassembly.MockOperandTree;
import com.google.security.zynamics.zylib.disassembly.MockOperandTreeNode;

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

import java.math.BigInteger;
import java.util.ArrayList;
import java.util.List;

@RunWith(JUnit4.class)
public class LwlTranslatorTest {
  private final ReilInterpreter interpreter = new ReilInterpreter(Endianness.LITTLE_ENDIAN,
      new CpuPolicyMips(), new EmptyInterpreterPolicy());

  private final StandardEnvironment environment = new StandardEnvironment();

  private final LwlTranslator translator = new LwlTranslator();

  private final ArrayList<ReilInstruction> instructions = new ArrayList<ReilInstruction>();

  @Test
  public void test1LwlAddressBitsZeroLittleEndian() throws InternalTranslationException,
      InterpreterException {
    interpreter.setRegister("$v1", BigInteger.valueOf(0x10000000L), OperandSize.DWORD,
        ReilRegisterStatus.DEFINED);
    interpreter.setRegister("$v2", BigInteger.valueOf(0x55667788L), OperandSize.DWORD,
        ReilRegisterStatus.DEFINED);

    final MockOperandTree operandTree1 = new MockOperandTree();
    operandTree1.root = new MockOperandTreeNode(ExpressionType.SIZE_PREFIX, "b4");
    operandTree1.root.m_children.add(new MockOperandTreeNode(ExpressionType.REGISTER, "$v2"));

    final MockOperandTree operandTree2 = new MockOperandTree();
    operandTree2.root = new MockOperandTreeNode(ExpressionType.SIZE_PREFIX, "b4");
    operandTree2.root.m_children.add(new MockOperandTreeNode(ExpressionType.OPERATOR, "+"));
    operandTree2.root.getChildren().get(0).m_children.add(new MockOperandTreeNode(
        ExpressionType.REGISTER, "$v1"));
    operandTree2.root.getChildren().get(0).m_children.add(new MockOperandTreeNode(
        ExpressionType.IMMEDIATE_INTEGER, String.valueOf(0L)));

    interpreter.setMemory(0x10000000, 0x11223344L, 4);

    final List<MockOperandTree> operands = Lists.newArrayList(operandTree1, operandTree2);

    final IInstruction instruction = new MockInstruction("lwl", operands);

    translator.translate(environment, instruction, instructions);

    interpreter.interpret(TestHelpers.createMapping(instructions), BigInteger.valueOf(0x100));

    // check correct outcome

    assertEquals(3, TestHelpers.filterNativeRegisters(interpreter.getDefinedRegisters()).size());
    assertEquals(BigInteger.valueOf(0x44667788L), interpreter.getVariableValue("$v2"));
    assertEquals(BigInteger.valueOf(4L), BigInteger.valueOf(interpreter.getMemorySize()));
  }

  @Test
  public void test2LwlAddressBitsOneLittleEndian() throws InternalTranslationException,
      InterpreterException {
    interpreter.setRegister("$v1", BigInteger.valueOf(0x10000000L), OperandSize.DWORD,
        ReilRegisterStatus.DEFINED);
    interpreter.setRegister("$v2", BigInteger.valueOf(0x55667788L), OperandSize.DWORD,
        ReilRegisterStatus.DEFINED);

    final MockOperandTree operandTree1 = new MockOperandTree();
    operandTree1.root = new MockOperandTreeNode(ExpressionType.SIZE_PREFIX, "b4");
    operandTree1.root.m_children.add(new MockOperandTreeNode(ExpressionType.REGISTER, "$v2"));

    final MockOperandTree operandTree2 = new MockOperandTree();
    operandTree2.root = new MockOperandTreeNode(ExpressionType.SIZE_PREFIX, "b4");
    operandTree2.root.m_children.add(new MockOperandTreeNode(ExpressionType.OPERATOR, "+"));
    operandTree2.root.getChildren().get(0).m_children.add(new MockOperandTreeNode(
        ExpressionType.REGISTER, "$v1"));
    operandTree2.root.getChildren().get(0).m_children.add(new MockOperandTreeNode(
        ExpressionType.IMMEDIATE_INTEGER, String.valueOf(1L)));

    interpreter.setMemory(0x10000000, 0x11223344L, 4);

    final List<MockOperandTree> operands = Lists.newArrayList(operandTree1, operandTree2);

    final IInstruction instruction = new MockInstruction("lwl", operands);

    translator.translate(environment, instruction, instructions);

    interpreter.interpret(TestHelpers.createMapping(instructions), BigInteger.valueOf(0x100));

    // check correct outcome

    assertEquals(3, TestHelpers.filterNativeRegisters(interpreter.getDefinedRegisters()).size());
    assertEquals(BigInteger.valueOf(0x33447788L), interpreter.getVariableValue("$v2"));
    assertEquals(BigInteger.valueOf(4L), BigInteger.valueOf(interpreter.getMemorySize()));
  }

  @Test
  public void test3LwlAddressBitsTwoLittleEndian() throws InternalTranslationException,
      InterpreterException {
    interpreter.setRegister("$v1", BigInteger.valueOf(0x10000000L), OperandSize.DWORD,
        ReilRegisterStatus.DEFINED);
    interpreter.setRegister("$v2", BigInteger.valueOf(0x55667788L), OperandSize.DWORD,
        ReilRegisterStatus.DEFINED);

    final MockOperandTree operandTree1 = new MockOperandTree();
    operandTree1.root = new MockOperandTreeNode(ExpressionType.SIZE_PREFIX, "b4");
    operandTree1.root.m_children.add(new MockOperandTreeNode(ExpressionType.REGISTER, "$v2"));

    final MockOperandTree operandTree2 = new MockOperandTree();
    operandTree2.root = new MockOperandTreeNode(ExpressionType.SIZE_PREFIX, "b4");
    operandTree2.root.m_children.add(new MockOperandTreeNode(ExpressionType.OPERATOR, "+"));
    operandTree2.root.getChildren().get(0).m_children.add(new MockOperandTreeNode(
        ExpressionType.REGISTER, "$v1"));
    operandTree2.root.getChildren().get(0).m_children.add(new MockOperandTreeNode(
        ExpressionType.IMMEDIATE_INTEGER, String.valueOf(2L)));

    interpreter.setMemory(0x10000000, 0x11223344L, 4);

    final List<MockOperandTree> operands = Lists.newArrayList(operandTree1, operandTree2);

    final IInstruction instruction = new MockInstruction("lwl", operands);

    translator.translate(environment, instruction, instructions);

    interpreter.interpret(TestHelpers.createMapping(instructions), BigInteger.valueOf(0x100));

    // check correct outcome

    assertEquals(3, TestHelpers.filterNativeRegisters(interpreter.getDefinedRegisters()).size());
    assertEquals(BigInteger.valueOf(0x22334488L), interpreter.getVariableValue("$v2"));
    assertEquals(BigInteger.valueOf(4L), BigInteger.valueOf(interpreter.getMemorySize()));
  }

  @Test
  public void test4LwlAddressBitsThreeLittleEndian() throws InternalTranslationException,
      InterpreterException {
    interpreter.setRegister("$v1", BigInteger.valueOf(0x10000000L), OperandSize.DWORD,
        ReilRegisterStatus.DEFINED);
    interpreter.setRegister("$v2", BigInteger.valueOf(0x55667788L), OperandSize.DWORD,
        ReilRegisterStatus.DEFINED);

    final MockOperandTree operandTree1 = new MockOperandTree();
    operandTree1.root = new MockOperandTreeNode(ExpressionType.SIZE_PREFIX, "b4");
    operandTree1.root.m_children.add(new MockOperandTreeNode(ExpressionType.REGISTER, "$v2"));

    final MockOperandTree operandTree2 = new MockOperandTree();
    operandTree2.root = new MockOperandTreeNode(ExpressionType.SIZE_PREFIX, "b4");
    operandTree2.root.m_children.add(new MockOperandTreeNode(ExpressionType.OPERATOR, "+"));
    operandTree2.root.getChildren().get(0).m_children.add(new MockOperandTreeNode(
        ExpressionType.REGISTER, "$v1"));
    operandTree2.root.getChildren().get(0).m_children.add(new MockOperandTreeNode(
        ExpressionType.IMMEDIATE_INTEGER, String.valueOf(3L)));

    interpreter.setMemory(0x10000000, 0x11223344L, 4);

    final List<MockOperandTree> operands = Lists.newArrayList(operandTree1, operandTree2);

    final IInstruction instruction = new MockInstruction("lwl", operands);

    translator.translate(environment, instruction, instructions);

    interpreter.interpret(TestHelpers.createMapping(instructions), BigInteger.valueOf(0x100));

    // check correct outcome

    assertEquals(3, TestHelpers.filterNativeRegisters(interpreter.getDefinedRegisters()).size());
    assertEquals(BigInteger.valueOf(0x11223344L), interpreter.getVariableValue("$v2"));
    assertEquals(BigInteger.valueOf(4L), BigInteger.valueOf(interpreter.getMemorySize()));
  }
}


text:
.. _step_by_step:

Step by step quickstart
=======================

Here is a step by step hands on with the user interface.
Mind you, writing a jupyter notebook is a better method to keep track of the spike sorting process.
But the *click and play* approach is prefered for beginners.

Launch
------

In a console (terminal)::

    workon tdc (or activate tdc for windows)
    tdc

You have a minimalist window with some icons on the left.

Step 1 - Initialize dataset
---------------------------

This step consists of initializing the datasets and configure everything: number of channels,
probe geometry, number of channel groups.

To do that, normally, you have to click on "Initialize dataset", but for testing purposes you can simply use menu
**"File > download dataset > striatum_rat"**.
This will locally download datasets from https://github.com/tridesclous/tridesclous_datasets and configure everything for you.

After that step some information are displayed about the:
  * DataIO: details about the dataset (nb channel, nb channel group, n segment, sample rate, durations...)
  * CatalogueConstructor: empty for the moment

Here we have a dataset given by David Robbe and Mostafa Safai recorded with a tetrode in sriatum of a rat.
The signal is sampled at 20kHz.

Step 2 - Initialize Catalogue
-----------------------------

This step contains several sub steps to create the catalogue.
This is automatic but needs some parameters.

Click on "Initialize" on parameters dialog popup.
Parameters are organized in sections:
  * duration
  * preprocessor
  * peak_detector
  * noise_snippets
  * extract_waveforms

For complete details on parameters see :ref:`parameters` and :ref:`important_details`.

Then you have to choose a **feature method**. For tetrode **"global_pca"** with 5 component sounds good.
You will be able to change this in catalogueWindow later on.

Then you have to choose a **cluster method**. Here let's choose **"gmm"** (gaussian mixture model) with 3 clusters.

Depending on the dataset and chosen method this can take a while.
Here, it should take around 5 seconds for 300s of signal.

After that step CatalogueConstructor info is updated:
   * nb of detected peaks
   * waveforms shape
   * features shape
   * cluster labels

Step 3 - CatalogueWindow
------------------------------

Click on CatalogueWindow. A window with multi view will help with the manual correction of the auto-catalogue (step 2)

This window contain docks than can be arranged as you want. Some of them are organized in tabs, but you can change.
with drag and drop. You can event close or move some view on another screen.
Righ click on the left toolbar to make them appear again.

.. image:: img/snapshot_catalogwinodow_striatum.png

On the right toolbar you can manually re-run some sub steps of the previous chain: detect peak, extract waveforms,
extract noise snippets, extract features, cluster.

Main views are:
  * spike list
  * cluster list
  * trace view
  * ndscatter
  * waveform view

For more detail see :ref:`catalogue_window`

All views are linked, this means that when you click somewhere it will update the other views.
For instance, if you select a spike, the trace view will zoom on that spike and the ndscatter
will highlight the spike.

In the trace view you can zoom Y with the mouse wheel and zoom X with right click.

Make visible one by one each cluster [0, 1, 2]. Play with the noise (label -2) and see what happens in each view.

Click on **"random tour"** in ndscatter. It is a dynamic projection that includes many dimensions like in GGobi.
It helps a lot to understand how many clusters we have.

Many views can be customized with a settings dialog. Sometimes, you have to double click on the view, sometimes on a button.
For instance in **waveformhistviewer** you can choose the *colormap* and the *binsize* with a double click in the black area.

In **pairlist**, select each pair and see what happens on  **waveformhistviewer**.
Use the mouse wheel to zoom the colormap and right click to zoom X/Y.

Them click on **Compute metric**, this will enable some views: **spikesimilarity**, **clustersimilarity**,
**silhouette**.

Go to **waveformviewer**, select "geometry" or "flatten".

Go to **waveformhistviewer**, your best friend same as **waveformviewer** in flatten mode but with
historgram density in 2D.

**Cluster list** contains a context menu that proposes a lot of actions: merge, split, trash.
Click on "re label cluster by rms".

Now you can see that cluster  0 and 1 are very well isolated but cluster 2 is very close from our chosen threshold.
To simplify we will send it to "trash". This means that the "peeler" (template matching) will not try to get it.

Now do "make catalogue for peeler". We have 2 clusters in our catalogue.

Close the window.

Step 4 - Run peeler
----------------------

Click "run peeler" and keep parameters.

This should take about 10 seconds (for 500s of signal).
The speedup 50x over real time is due to low number of channels and low number of clusters.

Step 5 - PeelerWindow
-------------------------
Click on "open PeelerWindow"

.. image:: img/snapshot_peelerwindow_striatum.png

This windows is to check whether peeler has corectly done its job, in other words if the catalogue were OK.

You can click on the spike list and the trace auto zooms on the spike.

On the trace view you can click on "residual".

The most important things to understand here is:
  * the green trace is the **preprocessed** signal (filter and normalized)
  * the magenta trace is the **prediction** = zero + waveform interpolated in between samples.
  * the yellow one is the **residual = preprocess - prediction**

If the catalogue is good and the peeler not buggy, the residual must always stay under the threshold (white line) for all channels.

You can see that some spike are not labelled (-10) this means that:
   * we forgot a cluster in the catalogue
   * we deliberatly removed this cluster because it is too close from threshold or noise.
   * the interpolation between samples is wrong and the remaining noise due to sampling jitter is bigger
     than standard noise (too bad).


text:
package uk.co.turingatemyhamster
package owl2
package ast

/**
 *
 *
 * @author Matthew Pocock
 */
trait ObjectPropertyCardinalityRestrictionsModuleImpl extends owl2.ObjectPropertyCardinalityRestrictionsModule {

  importedModules : owl2.EntitiesLiteralsAnonymousIndividualsModule with owl2.IriModule {
    type UnlimitedNatural = BigInt
    type ClassExpression = ast.ClassExpression
  } =>

  override final type ObjectMaxCardinality = ast.ObjectMaxCardinality

  override final type ObjectMinCardinality = ast.ObjectMinCardinality

  override final type ObjectExactCardinality = ast.ObjectExactCardinality

}

case class ObjectMaxCardinality(objectPropertyExpression: ObjectPropertyExpression,
                                classExpression: Option[ClassExpression] = None,
                                cardinality: BigInt) extends ClassExpression

case class ObjectMinCardinality(objectPropertyExpression: ObjectPropertyExpression,
                                classExpression: Option[ClassExpression] = None,
                                cardinality: BigInt) extends ClassExpression

case class ObjectExactCardinality(objectPropertyExpression: ObjectPropertyExpression,
                                  classExpression: Option[ClassExpression] = None,
                                  cardinality: BigInt) extends ClassExpression


text:
package tk.genesishub.gFeatures.gUtilities.FeatureManager;

import org.bukkit.event.player.PlayerJoinEvent;
import org.bukkit.event.player.PlayerQuitEvent;

public class Library {
	public void onPlayerJoin(PlayerJoinEvent event){}
	public void onPlayerLeave(PlayerQuitEvent event){}
}


text:
package eu.neclab.iotplatform.iotbroker.core;

import java.util.ArrayList;
import java.util.Collections;
import java.util.HashMap;
import java.util.Iterator;
import java.util.List;
import java.util.Map;

import eu.neclab.iotplatform.ngsi.api.datamodel.ContextElementResponse;
import eu.neclab.iotplatform.ngsi.api.datamodel.QueryContextRequest;
import eu.neclab.iotplatform.ngsi.api.datamodel.QueryContextResponse;

/**
 * Objects of this class have the purpose to merge multiple
 * {@link QueryContextResponse} objects into a single QueryContextResponse.
 *

 * By the put method, further QueryContextResponse objects are inserted. By
 * calling the get method, a QueryContextResponse merging all objects
 * inserted so far is retrieved.
 */
public class QueryResponseMerger {
	// Primary Key is EntityId and SecondaryKey is AttributeDomain
	// if no AttributeDomain present we assume empyString is used as Secondary
	// Key
	private final Map<String, Map<String, ContextElementResponse>> storeTable = Collections
			.synchronizedMap(new HashMap<String, Map<String, ContextElementResponse>>());

	final QueryContextRequest request;

	/**
	 * Creates a new QueryResponseMerger instance.
	 *
	 * @param request
	 * This field is supposed to contain the original {@link QueryContextRequest} to
	 * which the responses represented by this instance are corresponding.
	 * However, the parameter is not used in the current implementation, so it can
	 * as well be set to null.
	 */
	public QueryResponseMerger(QueryContextRequest request) {
		this.request = request;
	}

	/**
	 * Adds a new {@link QueryContextResponse} to the merger.
	 *
	 * @param response
	 * The QueryContextResponse to add.
	 */
	public void put(QueryContextResponse response) {

		if (response.getListContextElementResponse() == null) {
			return;
		}

		for (int i = 0; i < response.getListContextElementResponse().size(); i++) {

			String id = response.getListContextElementResponse().get(i)
					.getContextElement().getEntityId().getId();

			String attributeDomain = response.getListContextElementResponse()
					.get(i).getContextElement().getAttributeDomainName();

			if (attributeDomain == null) {

				attributeDomain = "";

			}

			Map<String, ContextElementResponse> existingMap = storeTable
					.get(id);

			if (existingMap != null) {

				ContextElementResponse contextElemResp = existingMap
						.get(attributeDomain);

				if (contextElemResp != null) {

					contextElemResp
							.getContextElement()
							.getContextAttributeList()
							.addAll(response.getListContextElementResponse()
									.get(i).getContextElement()
									.getContextAttributeList());

				} else {

					existingMap.put(attributeDomain, response
							.getListContextElementResponse().get(i));

				}

			} else {

				existingMap = new HashMap<String, ContextElementResponse>();
				existingMap.put(attributeDomain, response
						.getListContextElementResponse().get(i));
				storeTable.put(id, existingMap);

			}

		}

	}

	/**
	 * @return The merged QueryContextResponse.
	 */
	public QueryContextResponse get() {
		List<ContextElementResponse> contextElementRespList = new ArrayList<ContextElementResponse>();
		Iterator<Map<String, ContextElementResponse>> iter = storeTable
				.values().iterator();
		Iterator<ContextElementResponse> iterContext;
		while (iter.hasNext()) {

			Map<String, ContextElementResponse> currentMap = iter.next();
			iterContext = currentMap.values().iterator();
			while (iterContext.hasNext()) {

				ContextElementResponse contEle = iterContext.next();
				// Check if the attributeDomain is empty string and substitute
				// it with null
				if (contEle.getContextElement().getAttributeDomainName() != null
						&& "".equals(contEle.getContextElement().getAttributeDomainName()
								)) {
					contEle.getContextElement().setAttributeDomainName(null);
					contextElementRespList.add(contEle);
				}

				contextElementRespList.add(contEle);

			}

		}

		QueryContextResponse response = new QueryContextResponse(
				contextElementRespList, null);

		return response;
	}

}


text:
FactoryGirl.define do
  factory :period, class: "Yr::Period" do
    id 0
    symbol
    precipitation 0
    temperature
    pressure

    skip_create
  end
end


text:
#ifndef BOOST_INTERPROCESS_GET_PROCESS_ID_NAME_HPP
#define BOOST_INTERPROCESS_GET_PROCESS_ID_NAME_HPP

#include <boost/config.hpp>
#include <string>    //std::string
#include <sstream>   //std::stringstream
#include <boost/interprocess/detail/os_thread_functions.hpp>

namespace boost{
namespace interprocess{
namespace test{

inline void get_process_id_name(std::string &str)
{
   std::stringstream sstr;
   sstr << "process_" << boost::interprocess::ipcdetail::get_current_process_id() << std::ends;
   str = sstr.str().c_str();
}

inline void get_process_id_ptr_name(std::string &str, const void *ptr)
{
   std::stringstream sstr;
   sstr << "process_" << boost::interprocess::ipcdetail::get_current_process_id() << "_" << ptr << std::ends;
   str = sstr.str().c_str();
}

inline const char *get_process_id_name()
{
   static std::string str;
   get_process_id_name(str);
   return str.c_str();
}

inline const char *get_process_id_ptr_name(void *ptr)
{
   static std::string str;
   get_process_id_ptr_name(str, ptr);
   return str.c_str();
}

inline const char *add_to_process_id_name(const char *name)
{
   static std::string str;
   get_process_id_name(str);
   str += name;
   return str.c_str();
}

inline const char *add_to_process_id_ptr_name(const char *name, void *ptr)
{
   static std::string str;
   get_process_id_ptr_name(str, ptr);
   str += name;
   return str.c_str();
}

}  //namespace test{
}  //namespace interprocess{
}  //namespace boost{

#endif //#ifndef BOOST_INTERPROCESS_GET_PROCESS_ID_NAME_HPP


text:
<?php
class Rss_model extends CI_Model {

        public function get_rss()
        {
        	$request= 'http://www.smashingmagazine.com/feed/';
            $response= file_get_contents($request);
            $xml= new SimpleXMLElement($response);
            return $xml;
        }

}#end of the rss model


text:
Decomposition
=============

.. toctree::
   :maxdepth: 1

   dsd_decomposition
   decomposition
   bi_decomposition


text:
// This is a generated file. Not intended for manual editing.
package com.intellij.plugins.haxe.lang.psi;

import java.util.List;
import org.jetbrains.annotations.*;
import com.intellij.psi.PsiElement;

public interface HaxeFunctionDeclarationWithAttributes extends HaxeMethod {

  @NotNull
  List<HaxeAutoBuildMacro> getAutoBuildMacroList();

  @Nullable
  HaxeBlockStatement getBlockStatement();

  @NotNull
  List<HaxeBuildMacro> getBuildMacroList();

  @Nullable
  HaxeComponentName getComponentName();

  @NotNull
  List<HaxeCustomMeta> getCustomMetaList();

  @NotNull
  List<HaxeDebugMeta> getDebugMetaList();

  @NotNull
  List<HaxeDeclarationAttribute> getDeclarationAttributeList();

  @Nullable
  HaxeDoWhileStatement getDoWhileStatement();

  @Nullable
  HaxeExpression getExpression();

  @NotNull
  List<HaxeFinalMeta> getFinalMetaList();

  @Nullable
  HaxeForStatement getForStatement();

  @Nullable
  HaxeGenericParam getGenericParam();

  @NotNull
  List<HaxeGetterMeta> getGetterMetaList();

  @Nullable
  HaxeIfStatement getIfStatement();

  @NotNull
  List<HaxeKeepMeta> getKeepMetaList();

  @NotNull
  List<HaxeMetaMeta> getMetaMetaList();

  @NotNull
  List<HaxeNoDebugMeta> getNoDebugMetaList();

  @NotNull
  List<HaxeNsMeta> getNsMetaList();

  @NotNull
  List<HaxeOverloadMeta> getOverloadMetaList();

  @Nullable
  HaxeParameterList getParameterList();

  @NotNull
  List<HaxeProtectedMeta> getProtectedMetaList();

  @NotNull
  List<HaxeRequireMeta> getRequireMetaList();

  @Nullable
  HaxeReturnStatement getReturnStatement();

  @NotNull
  List<HaxeSetterMeta> getSetterMetaList();

  @Nullable
  HaxeThrowStatement getThrowStatement();

  @Nullable
  HaxeTypeTag getTypeTag();

  @Nullable
  HaxeWhileStatement getWhileStatement();

}


text:
package com.macluq.java7.exceptions;

public class ActionException extends Exception {
}


text:
from google.appengine.ext import ndb
from google.appengine.api import taskqueue
from webapp2_extras.appengine.auth import models as webappmodels

class User(webappmodels.User):

  last_fetched = ndb.DateTimeProperty()
  author = ndb.StringProperty()

  def delete(self):
    ndb.delete_multi(ndb.Query(ancestor=self.key).iter(keys_only=True))
    webappmodels.Unique.delete_multi(
      map(lambda s: 'User.auth_id:' + s, self.auth_ids)
    )

  @property
  def pages(self):
    return Page.query(ancestor=self.key)

class Page(ndb.Model):
  name = ndb.StringProperty()
  access_token = ndb.StringProperty()
  last_fetched = ndb.DateTimeProperty()

  @property
  def authors(self):
    return [post.author for post in Post.query(
      ancestor=self.key,
      projection=['author'],
      distinct=True
    ) if post.author != None]

  @property
  def posts(self):
    return Post\
      .query(ancestor=self.key)\
      .order(-Post.created_time)\
      .filter(Post.is_reply == False)

class Post(ndb.Model):
  is_reply = ndb.BooleanProperty(indexed=True, default=False)
  is_private = ndb.BooleanProperty(default=False)
  message = ndb.TextProperty()
  created_time = ndb.DateTimeProperty()
  updated_time = ndb.DateTimeProperty()
  from_id = ndb.StringProperty()
  from_name = ndb.StringProperty()
  from_category = ndb.StringProperty()
  author = ndb.StringProperty(indexed=True)

  @property
  def replies(self):
    return Post\
      .query(ancestor=self.key)\
      .filter(Post.is_reply == True)\
      .order(Post.created_time)


text:
- make sure column names are source and target

# Test


text:
<?php

// autoload.php @generated by Composer

require_once __DIR__ . '/composer' . '/autoload_real.php';

return ComposerAutoloaderInit5375e906c10a7e28d42e56bd9d0af0ea::getLoader();


text:
@interface SPSportsShareFriendsViewController () <UITableViewDelegate,UITableViewDataSource> {
    NSMutableArray *_friendsDataArray;
}

@property (weak, nonatomic) IBOutlet UITableView *tableView;

@end

@implementation SPSportsShareFriendsViewController

- (void)viewDidLoad {
    [super viewDidLoad];
    [self setUp];
}

- (void)didReceiveMemoryWarning {
    [super didReceiveMemoryWarning];
}

- (void)viewDidAppear:(BOOL)animated {
    [super viewDidAppear:animated];
    [self prepareForFriendsData];
}

#pragma mark - SetUp
- (void)prepareForFriendsData {
    AppDelegate *delegate = (AppDelegate *)[UIApplication sharedApplication].delegate;
    _friendsDataArray = delegate.friendsSortedListArray;
    [_tableView reloadData];
}

- (void)setUp {
    _friendsDataArray = [[NSMutableArray alloc] init];

    _tableView.delegate = self;
    _tableView.dataSource = self;
    _tableView.tableFooterView = [[UIView alloc] init];
}

#pragma mark - UITableViewDelegate
- (NSInteger)numberOfSectionsInTableView:(UITableView *)tableView {
    return _friendsDataArray.count;
}

- (NSInteger)tableView:(UITableView *)tableView numberOfRowsInSection:(NSInteger)section {
    return [[[_friendsDataArray[section] allValues] objectAtIndex:0] count];
}

- (CGFloat)tableView:(UITableView *)tableView heightForHeaderInSection:(NSInteger)section {
    return 20;
}

- (CGFloat)tableView:(UITableView *)tableView heightForRowAtIndexPath:(NSIndexPath *)indexPath {
    return 50;
}

- (NSArray *)sectionIndexTitlesForTableView:(UITableView *)tableView{
    tableView.sectionIndexBackgroundColor = [UIColor clearColor];
    tableView.sectionIndexColor = [UIColor colorWithRed:82/255.0 green:82/255.0 blue:82/255.0 alpha:1];
    NSMutableArray *array = [[NSMutableArray alloc] init];
    [array addObject:UITableViewIndexSearch];
    for (NSDictionary *dic in _friendsDataArray) {
        [array addObject:[(NSString *)[dic allKeys][0] uppercaseString]];
    }
    return array;
}

- (UIView *)tableView:(UITableView *)tableView viewForHeaderInSection:(NSInteger)section {
    UILabel *label = [[UILabel alloc]initWithFrame:CGRectMake(0, 0, 30, 20)];
    NSString *titleStr = [_friendsDataArray[section] allKeys][0];
    label.text = [NSString stringWithFormat:@"      %@",[titleStr uppercaseString]];
    label.font = [UIFont boldSystemFontOfSize:12];
    label.textColor = [SPGlobalConfig anyColorWithRed:142 green:142 blue:146 alpha:1];
    label.backgroundColor = [SPGlobalConfig anyColorWithRed:240 green:240 blue:246 alpha:1];
    return label;
}

- (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath {
    SPContactTableViewCell *friendsListCell = [tableView dequeueReusableCellWithIdentifier:@"ContactCell"];
    if (!friendsListCell) {
        [tableView registerNib:[UINib nibWithNibName:@"SPContactTableViewCell" bundle:[NSBundle mainBundle]] forCellReuseIdentifier:@"ContactCell"];
        friendsListCell = [tableView dequeueReusableCellWithIdentifier:@"ContactCell"];
    }
    return friendsListCell;
}

- (void)tableView:(UITableView *)tableView willDisplayCell:(UITableViewCell *)cell forRowAtIndexPath:(NSIndexPath *)indexPath {
    SPUserInfoModel *model = (SPUserInfoModel *)[[[_friendsDataArray[indexPath.section] allValues] objectAtIndex:0] objectAtIndex:indexPath.row];
    [(SPContactTableViewCell *)cell setupWithModel:model];
}

- (void)tableView:(UITableView *)tableView didSelectRowAtIndexPath:(NSIndexPath *)indexPath {
    [tableView deselectRowAtIndexPath:indexPath animated:true];

    if ([_shareBaseViewController.type isEqualToString:@"clubShare"]) {
        SPUserInfoModel *model = (SPUserInfoModel *)[[[_friendsDataArray[indexPath.section] allValues] objectAtIndex:0] objectAtIndex:indexPath.row];
        [[NSNotificationCenter defaultCenter] postNotificationName:NOTIFICATION_CLUB_SHARE
                                                            object:nil
                                                          userInfo:@{@"type":@"person",
                                                                     @"targetId":model.userId,
                                                                     @"title":model.nick}];
        [_shareBaseViewController.navigationController popViewControllerAnimated:true];
    } else if ([_shareBaseViewController.type isEqualToString:@"eventShare"]) {
        SPUserInfoModel *model = (SPUserInfoModel *)[[[_friendsDataArray[indexPath.section] allValues] objectAtIndex:0] objectAtIndex:indexPath.row];
        [[NSNotificationCenter defaultCenter] postNotificationName:NOTIFICATION_SPORTS_SHARE
                                                            object:nil
                                                          userInfo:@{@"type":@"person",
                                                                     @"targetId":model.userId,
                                                                     @"title":model.nick}];
        [_shareBaseViewController.navigationController popViewControllerAnimated:true];
    }
}

@end


text:
<resources>
    <!-- Default screen margins, per the Android Design guidelines. -->
    <dimen name="activity_horizontal_margin">16dp</dimen>
    <dimen name="activity_vertical_margin">16dp</dimen>
    <dimen name="fragment_padding">7dp</dimen>
    <dimen name="label_margin">4dp</dimen>
    <dimen name="border_width">1dp</dimen>
    <dimen name="table_header_padding">3dp</dimen>
    <dimen name="border_adjustment">-1dp</dimen>
</resources>


text:
/*  Widget Basics
------------------------------------------------------------------------------------------------------ */

.module.ui-widget {
    border: none;
    background: #fff;
}
.ui-widget-content {
    border: 1px solid #ccc;
    border-bottom-left-radius: 5px; -moz-border-radius-bottomleft: 5px; -webkit-border-bottom-left-radius: 5px;
    border-bottom-right-radius: 5px; -moz-border-radius-bottomright: 5px; -webkit-border-bottom-right-radius: 5px;
    background: #eee;
}

/*  Accordion
------------------------------------------------------------------------------------------------------ */

/* Overlays */
.ui-accordion .ui-accordion-header { cursor: pointer; position: relative; margin-top: 1px; zoom: 1; }
.ui-accordion .ui-accordion-li-fix { display: inline; }
.ui-accordion .ui-accordion-header-active { border-bottom: 0 !important; }
.ui-accordion .ui-accordion-header a {
    display: block;
    font-size: 1em;
    padding: 0 0 0 12px;
}
.ui-accordion .ui-accordion-header .ui-icon { position: absolute; left: .5em; top: 50%; margin-top: -8px; }
.ui-accordion .ui-accordion-content {
    top: 0;
    margin-top: 0;
    margin-bottom: 0;
    padding: 5px 15px;
    border-top: 1px solid #fff;
}
.ui-accordion .ui-accordion-content-active { display: block; }

/*  Datepicker
----------------------------------*/
.datetime br {
    display: none;
}
.datetimeshortcuts {
    width: 40px;
    position: relative;
    margin-left: 10px;
}
.datetimeshortcuts a {
    margin-left: 0 !important;
}

.ui-accordion-header {
    margin-top: 2px !important;
    cursor: pointer;
    outline: none;
}
.ui-accordion .ui-accordion-header a {
    padding: 0 0 0 12px;
    color: #444;
    outline: none;
}

.ui-accordion-header.ui-state-default {
    border-radius: 5px; -moz-border-radius: 5px; -webkit-border-radius: 5px;
}
.ui-accordion-header.ui-state-active {
    border-bottom-left-radius: 0; -moz-border-radius-bottomleft: 0; -webkit-border-bottom-left-radius: 0;
    border-bottom-right-radius: 0; -moz-border-radius-bottomright: 0; -webkit-border-bottom-right-radius: 0;
}

/*  Accordion Module ......................................... */

.module .ui-accordion-header.ui-state-default {
    border: 1px solid #bdbdbd;
    background-color: #a1d4e5;
}
.module .ui-accordion-header.ui-state-default:hover {
    background-color: #d6d6d6;
}
.module .ui-accordion-header.ui-state-active {
    border: 1px solid #bdbdbd;
    background-color: #d6d6d6;
}

/*  Accordion Module in Group......................................... */

.group .module .ui-accordion-header.ui-state-default {
    border: 1px solid #c7c7c7;
    background-color: #cee9f2;
}
.group .module .ui-accordion-header.ui-state-default:hover {
    background-color: #e0e0e0;
}
.group .module .ui-accordion-header.ui-state-active {
    border: 1px solid #c7c7c7;
    background-color: #e0e0e0;
}
.group .module .ui-accordion-header {
    border-top: 1px solid #4ef;
}

/*  Datepicker
------------------------------------------------------------------------------------------------------ */

.ui-datepicker {
    width: auto !important; padding: 3px 3px 0;
    border-color: #bdbdbd;
    box-shadow: 0 10px 50px #333; -moz-box-shadow: 0 10px 50px #333; -webkit-box-shadow: 0 10px 50px #333;
}
.ui-datepicker .ui-datepicker-header {
    padding: 2px 0;
    height: 25px;
}
.ui-datepicker .ui-datepicker-prev, .ui-datepicker .ui-datepicker-next,
.ui-datepicker .ui-datepicker-prev-hover, .ui-datepicker .ui-datepicker-next-hover {
    position: absolute;
    top: 4px;
    width: 20px;
    height: 30px;
    background-color: transparent;
    background-position: 50% 50%;
    background-repeat: no-repeat;
    cursor: pointer;
}
.ui-datepicker .ui-datepicker-prev {
    left: 3px;
    background-image: url('../img/icons/ui-datepicker-prev.png');
}
.ui-datepicker .ui-datepicker-prev-hover {
    left: 3px;
    border: none;
    background-image: url('../img/icons/ui-datepicker-prev-hover.png');
}
.ui-datepicker .ui-datepicker-next {
    right: 3px;
    background-image: url('../img/icons/ui-datepicker-next.png');
}
.ui-datepicker .ui-datepicker-next-hover {
    right: 3px;
    border: none;
    background-image: url('../img/icons/ui-datepicker-next-hover.png');
}
.ui-datepicker .ui-datepicker-prev span, .ui-datepicker .ui-datepicker-next span {
    display: none !important;
}

.ui-datepicker .ui-datepicker-title {
    margin: 3px 25px 2px;
    line-height: 1.8em;
    text-align: center;
}
.ui-datepicker .ui-datepicker-title select {
    float:left;
    font-size:1em;
    margin: -3px 0 -1px !important;
    min-width: 30px;
}
.ui-datepicker select.ui-datepicker-month-year {width: 100%;}
.ui-datepicker select.ui-datepicker-month,
.ui-datepicker select.ui-datepicker-year { width: 49%;}
.ui-datepicker .ui-datepicker-title select.ui-datepicker-year {
    float: right;
}
.ui-datepicker table {
    width: 100%;
    font-size: 12px;
    margin: 0 0 2px;
}
.ui-datepicker th {
    padding: 5px 0;
    text-align: center;
    font-weight: bold;
    border: 0;
    background: transparent;
}
.ui-datepicker td {
    min-width: 25px;
    border: 0; padding: 1px;
}
.ui-datepicker td span, .ui-datepicker td a {
    padding: 4px 0 3px;
    margin:0!important;
    text-align: center;
    display:block;
    border-radius: 3px; -moz-border-radius: 3px; -webkit-border-radius: 3px;
}
.ui-datepicker td a.ui-state-hover {
    color: #fff !important;
    border-color: transparent !important;
    background: #444 !important;
}
.ui-datepicker td a.ui-state-active {
    background: #fff;
}
.ui-datepicker td a.ui-state-highlight {
    border-color: #bababa;
    background: #D6D6D6;
}
.ui-datepicker .ui-datepicker-buttonpane {
    background-image: none;
    margin: 5px 0 0;
    padding: 0;
    border: 0;
}
.ui-datepicker .ui-datepicker-buttonpane button {
    float: right;
    margin: 3px 0;
    padding: 4px 5px 5px;
    height: 25px;
    color: #aaa; font-size: 11px;
    border: 1px solid #c7c7c7;
    background: transparent;
    cursor: pointer;
}
@media screen and (-webkit-min-device-pixel-ratio:0) {
    .ui-datepicker .ui-datepicker-buttonpane button {
        padding: 5px 8px 4px;
    }
}
.ui-datepicker .ui-datepicker-buttonpane button.ui-datepicker-current {
    opacity: 1 !important;
    color: #444; font-weight: bold;
    background: #cee9f2;
}
.ui-datepicker .ui-datepicker-buttonpane button.ui-state-hover {
    color: #fff !important;
    border-color: #444 !important;
    background: #444 !important;
}

.ui-datepicker-multi .ui-datepicker-group-first .ui-datepicker-title,
.ui-datepicker-multi .ui-datepicker-group-middle .ui-datepicker-title {
    margin-right: 5px !important;
}
.ui-datepicker-multi .ui-datepicker-group-middle .ui-datepicker-title,
.ui-datepicker-multi .ui-datepicker-group-last .ui-datepicker-title {
    margin-left: 5px !important;
}

.ui-datepicker-multi .ui-datepicker-group table {
    width: 95%;
}
.ui-datepicker-multi .ui-datepicker-group-first table,
.ui-datepicker-multi .ui-datepicker-group-middle table {
    margin-right: 5px !important;
}
.ui-datepicker-multi .ui-datepicker-group-middle table,
.ui-datepicker-multi .ui-datepicker-group-last table {
    margin-left: 5px !important;
}
.ui-datepicker-multi .ui-datepicker-group-middle table {
    margin-left: 3px !important;
}
.ui-datepicker-multi .ui-datepicker-buttonpane {
    border: none;
}

.ui-datepicker-append {
    margin-left: 6px; color: #999; font-size: 10px;
}

.ui-datepicker td.ui-state-disabled {
    padding:1px;
    text-align: center;
}
.ui-datepicker td.ui-state-disabled span {
    background: #ccc;
    color: #555 !important;
    font-weight: bold;
    font-size: 11px;
    border-radius: 3px; -moz-border-radius: 3px; -webkit-borderradius: 3px;
}
button.ui-datepicker-close {
    margin-right: 4px !important;
}

/*  Timepicker
------------------------------------------------------------------------------------------------------ */

#ui-timepicker {
    padding: 5px 3px 3px 5px;
    width: 216px;
    border: 1px solid #bdbdbd;
    box-shadow: 0 10px 50px #333; -moz-box-shadow: 0 10px 50px #333; -webkit-box-shadow: 0 10px 50px #333;
}
#ui-timepicker ul {
    position: relative;
    float: left;
    clear: both;
    width: auto;
}
#ui-timepicker ul li.row {
    position: relative;
    float: left;
    display: block;
    margin: 0 2px 2px 0;
    padding: 2px 10px 1px;
    width: 30px;
    font-size: 11px;
    text-align: center;
    border: 0;
    border-radius: 3px; -moz-border-radius: 3px; -webkit-borderradius: 3px;
    cursor: pointer;
}
#ui-timepicker .row.ui-state-default {
    border: 1px solid #c7c7c7 !important;
    background: #e1f0f5;
}
#ui-timepicker .row.ui-state-active {
    border: 1px solid #bababa !important;
    background: #d6d6d6;
}
#ui-timepicker .row.ui-state-default:hover {
    color: #fff;
    border: 1px solid #666 !important;
    background: #444;
}

/*  Tabs
------------------------------------------------------------------------------------------------------ */

.ui-tabs {
    padding: 0; zoom: 1;
}
.ui-tabs .ui-tabs-nav {
    padding: 0;
    color: #444; font-size: 12px;
    border: none;
    border-bottom: 1px solid #bdbdbd;
    border-bottom-left-radius: 0; -moz-border-radius-bottomleft: 0; -webkit-border-bottom-left-radius: 0;
    background: none;
}
.ui-tabs .ui-tabs-nav li {
    position: relative; float: left;
    border-bottom-width: 1px !important;
    margin: 0 .2em -1px 0;
    padding: 0;
}
.ui-tabs .ui-tabs-nav li a { float: left; text-decoration: none; padding: .5em 1em; }
.ui-tabs .ui-tabs-nav li.ui-tabs-selected {
    padding-bottom: 0px; border-bottom-width: 1px;
}
.ui-tabs .ui-tabs-nav li.ui-tabs-selected a, .ui-tabs .ui-tabs-nav li.ui-state-disabled a, .ui-tabs .ui-tabs-nav li.ui-state-processing a { cursor: text; }
.ui-tabs .ui-tabs-nav li a, .ui-tabs.ui-tabs-collapsible .ui-tabs-nav li.ui-tabs-selected a { cursor: pointer; } /* first selector in group seems obsolete, but required to overcome bug in Opera applying cursor: text overall if defined elsewhere... */
.ui-tabs .ui-tabs-panel {
    padding: 0;
    display: block;
    border: 1px solid #bdbdbd;
    border-top: 1px solid #fff;
    border-top-right-radius: 5px; -moz-border-radius-topright: 5px; -webkit-border-top-right-radius: 5px;
    background: #eee;
}
.ui-tabs .ui-tabs-hide { display: none !important; }

/*  gAutocomplete
------------------------------------------------------------------------------------------------------ */

.ui-gAutocomplete-wrapper {
    position: absolute;
    z-index: 400;
}
ul.ui-gAutocomplete-results {
    margin-top: 4px;
    padding: 5px;
    border: 1px solid #ddd;
    border-radius: 5px; -moz-border-radius: 5px; -webkit-border-radius: 5px;
    box-shadow: 0 0 3px #444; -moz-box-shadow: 0 0 3px #444; -webkit-box-shadow: 0 0 3px #444;
    background: #fff;
}
/* inline bug fix */
.group ul.ui-gAutocomplete-results {
    margin-left:171px;
    width:745px;
}
ul.ui-gAutocomplete-results li {
    padding: 2px 5px;
    color: #666;
    cursor: pointer;
}
/* hover and selected must bear a slight style
 * difference since they have a slight behevior
 * difference
 **/
ul.ui-gAutocomplete-results li:hover {
    background: #dfe7e9;
}
ul.ui-gAutocomplete-results li.selected {
    background: #e1f0f5;
    font-weight:bold;
}
ul.ui-gAutocomplete-results li:first-child {
    border-top-left-radius: 4px; -moz-border-radius-topleft: 4px; -webkit-border-top-left-radius: 4px;
    border-top-right-radius: 4px; -moz-border-radius-topright: 4px; -webkit-border-top-right-radius: 4px;
}
ul.ui-gAutocomplete-results li:last-child {
    border-bottom-left-radius: 4px; -moz-border-radius-bottomleft: 4px; -webkit-border-bottom-left-radius: 4px;
    border-bottom-right-radius: 4px; -moz-border-radius-bottomright: 4px; -webkit-border-bottom-right-radius: 4px;
}
ul.ui-gAutocomplete-results li + li {
    border-top: 1px solid #eee;
}

ul.ui-gAutocomplete-results li b {
    margin: 0 1px;
    color: #444;
}

/*  Facelist
------------------------------------------------------------------------------------------------------ */
.ui-gFacelist-wrapper {
    margin-left:160px;
    width:758px;
}

.ui-gFacelist-wrapper.focus {
    border-color: #999 #BBB #BBB #999;
}

.ui-gFacelist-toolbar button {
    border-bottom-right-radius: 0; -moz-border-radius-bottomright: 0; -webkit-border-bottom-right-radius: 0;
}

ul.ui-gFacelist-facelist {
    clear:both;
    padding: 5px 5px 5px 0;
    position: relative; float: left; clear: both;
    width:758px;
    box-sizing: border-box; -moz-box-sizing: border-box; -webkit-box-sizing: border-box;
}

li.ui-gFacelist-item {
    cursor: pointer;
    background:#ddd;
    background-image: -webkit-gradient(linear, 0% 0%, 0% 100%, from(#ebf2f5), to(#e1f0f5));
    background-image: -moz-linear-gradient(top, #ebf2f5, #e1f0f5);
    background-repeat:no-repeat;
    border:1px solid #ccc;
    border-radius: 3px; -moz-border-radius: 3px; -webkit-border-radius: 3px;
    -webkit-box-sizing: border-box;
    float: left;
    font-weight: bold;
    margin-top: 5px;
    margin-right: 5px;
    padding: 4px 7px 3px 4px;
    opacity: 1;
    position: relative;
    width: auto;
}

li.ui-gFacelist-item:hover {
    background-image: -webkit-gradient(linear, 0% 0%, 0% 100%, from(#e1e1e1), to(#eee));
    background-image: -moz-linear-gradient(top, #e1e1e1, #eee);
}

li.ui-gFacelist-item span {
    background:transparent url('../img/icons/icon-bookmark_remove-inactive.png') no-repeat 2px 2px;
    padding:0 0 0 18px;
}

li.ui-gFacelist-item:hover span {
    background:transparent url('../img/icons/icon-bookmark_remove.png') no-repeat 2px 2px;
}

/*  AutoSlugField
------------------------------------------------------------------------------------------------------ */

.ui-gAutoSlugField-preview {
    display:block;
    color:#999;
    padding:2px 6px;
    background:#eee;
    border:1px solid #ddd;
    border-width:0 1px 1px 1px;
    margin-left:160px;
    width:744px;
}


text:
#ifndef PathOpsTestCommon_DEFINED
#define PathOpsTestCommon_DEFINED

#include "include/core/SkScalar.h"
#include "include/private/SkTArray.h"
#include "src/pathops/SkPathOpsPoint.h"

class SkPath;
struct SkDConic;
struct SkDCubic;
struct SkDLine;
struct SkDQuad;
struct SkPathOpsBounds;
struct SkPoint;

struct QuadPts {
    static const int kPointCount = 3;
    SkDPoint fPts[kPointCount];
};

struct ConicPts {
    QuadPts fPts;
    SkScalar fWeight;
};

struct CubicPts {
    static const int kPointCount = 4;
    SkDPoint fPts[kPointCount];
};

void CubicPathToQuads(const SkPath& cubicPath, SkPath* quadPath);
void CubicPathToSimple(const SkPath& cubicPath, SkPath* simplePath);
void CubicToQuads(const SkDCubic& cubic, double precision, SkTArray<SkDQuad, true>& quads);
bool ValidBounds(const SkPathOpsBounds& );
bool ValidConic(const SkDConic& cubic);
bool ValidCubic(const SkDCubic& cubic);
bool ValidLine(const SkDLine& line);
bool ValidPoint(const SkDPoint& pt);
bool ValidPoints(const SkPoint* pts, int count);
bool ValidQuad(const SkDQuad& quad);
bool ValidVector(const SkDVector& v);

#endif


text:
/**
 * Definition for binary tree
 * public class TreeNode {
 *     int val;
 *     TreeNode left;
 *     TreeNode right;
 *     TreeNode(int x) { val = x; }
 * }
 */

public class BSTIterator {
    Stack<TreeNode> st = new Stack<TreeNode>();

    public BSTIterator(TreeNode root) {
        while(root != null){
            st.push(root);
            root = root.left;
        }
    }

    /** @return whether we have a next smallest number */
    public boolean hasNext() {
        return !st.empty();
    }

    /** @return the next smallest number */
    public int next() {
        if(st.empty()){
            return 0;
        }
        TreeNode cur = st.pop();
        int result = cur.val;
        TreeNode tmp = cur.right;
        while(tmp != null){
            st.push(tmp);
            tmp = tmp.left;
        }
        return result;
    }
}

/**
 * Your BSTIterator will be called like this:
 * BSTIterator i = new BSTIterator(root);
 * while (i.hasNext()) v[f()] = i.next();
 */


text:
package com.intellij.xdebugger.impl.frame;

import com.intellij.openapi.project.Project;
import com.intellij.ui.AppUIUtil;
import com.intellij.xdebugger.XDebugSession;
import com.intellij.xdebugger.evaluation.XDebuggerEditorsProvider;
import com.intellij.xdebugger.frame.XStackFrame;
import javax.annotation.Nonnull;

/**
 * @author nik
 */
public class XStandaloneVariablesView extends XVariablesViewBase {
  private final XStackFrame myStackFrame;

  public XStandaloneVariablesView(@Nonnull Project project, @Nonnull XDebuggerEditorsProvider editorsProvider, @Nonnull XStackFrame stackFrame) {
    super(project, editorsProvider, null);
    myStackFrame = stackFrame;
    buildTreeAndRestoreState(stackFrame);
  }

  public void rebuildView() {
    AppUIUtil.invokeLaterIfProjectAlive(getTree().getProject(), () -> {
      saveCurrentTreeState(myStackFrame);
      buildTreeAndRestoreState(myStackFrame);
    });
  }

  @Override
  public void processSessionEvent(@Nonnull SessionEvent event, @Nonnull XDebugSession session) {
  }
}


text:
{% extends "oscar/layout.html" %}

{% load i18n product_tags %}

{% block title %}
    {{ wishlist_title }} | {{ block.super }}
{% endblock %}

{% block breadcrumbs %}

{% trans "Home" %}

{{ wishlist_title }}

{% endblock breadcrumbs %}

{% block headertext %}
    {{ wishlist_title }}
{% endblock %}

{% block content %}

        {% if page_obj %}

                        {% for line in page_obj %}
                            {% if line.product %}

                                    {% render_product line.product %}

                            {% endif %}
                        {% endfor %}

                    {% include "oscar/partials/pagination.html" %}

        {% else %}

{% trans "This wish list is empty." %}

        {% endif %}

{% endblock %}


text:
// This file contains an object which encapsulates k8s clients which are useful for e2e tests.

package test

import (
	"k8s.io/client-go/dynamic"
	"k8s.io/client-go/rest"
	"k8s.io/client-go/tools/clientcmd"

	metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
	"knative.dev/eventing-operator/pkg/client/clientset/versioned"
	eventingv1alpha1 "knative.dev/eventing-operator/pkg/client/clientset/versioned/typed/eventing/v1alpha1"
	"knative.dev/pkg/test"
)

// Clients holds instances of interfaces for making requests to Knative Serving.
type Clients struct {
	KubeClient *test.KubeClient
	Dynamic    dynamic.Interface
	Eventing   eventingv1alpha1.OperatorV1alpha1Interface
	Config     *rest.Config
}

// NewClients instantiates and returns several clientsets required for making request to the
// Knative Serving cluster specified by the combination of clusterName and configPath.
func NewClients(configPath string, clusterName string) (*Clients, error) {
	clients := &Clients{}
	cfg, err := buildClientConfig(configPath, clusterName)
	if err != nil {
		return nil, err
	}

	// We poll, so set our limits high.
	cfg.QPS = 100
	cfg.Burst = 200

	clients.KubeClient, err = test.NewKubeClient(configPath, clusterName)
	if err != nil {
		return nil, err
	}

	clients.Dynamic, err = dynamic.NewForConfig(cfg)
	if err != nil {
		return nil, err
	}

	clients.Eventing, err = newKnativeEventingAlphaClients(cfg)
	if err != nil {
		return nil, err
	}

	clients.Config = cfg
	return clients, nil
}

func buildClientConfig(kubeConfigPath string, clusterName string) (*rest.Config, error) {
	overrides := clientcmd.ConfigOverrides{}
	// Override the cluster name if provided.
	if clusterName != "" {
		overrides.Context.Cluster = clusterName
	}
	return clientcmd.NewNonInteractiveDeferredLoadingClientConfig(
		&clientcmd.ClientConfigLoadingRules{ExplicitPath: kubeConfigPath},
		&overrides).ClientConfig()
}

func newKnativeEventingAlphaClients(cfg *rest.Config) (eventingv1alpha1.OperatorV1alpha1Interface, error) {
	cs, err := versioned.NewForConfig(cfg)
	if err != nil {
		return nil, err
	}
	return cs.OperatorV1alpha1(), nil
}

func (c *Clients) KnativeEventing() eventingv1alpha1.EventingInterface {
	return c.Eventing.Eventings(EventingOperatorNamespace)
}

func (c *Clients) KnativeEventingAll() eventingv1alpha1.EventingInterface {
	return c.Eventing.Eventings(metav1.NamespaceAll)
}


text:
from piliko import *
import math

# ok so uhm

# see spoly1 thru spoly5.py for explanation.

# basically we are taking a generator of pythagorean triples,
# and plugging the output from that into the spread polynomial function
#
# the result is a bunch of perfect squares. seems lovely to me.. maybe
# obvious to others of course.

#
# this version uhm... it flips around the pyth triple generator ...
# using cheomogeometry.
#
# normally the unit circle is x=red/blue, y=green/blue
# the hyperbola is x=green/red y=blue/red
# so... uhm.. if you just flip those around here, you also get
# perfect squares, the problem is that some of them are Negative
# so you are technically getting the perfect square of complex numbers..
# anyways.

def sqr(x): return x*x
def blueq(x,y): return sqr(x)+sqr(y)
def redq(x,y): return sqr(x)-sqr(y)
def greenq(x,y): return 2*x*y
sp=spread_polynomial
maxn1=5
for i in range(0,maxn1):
	s = sp(i,Fraction(144,169))
	num = s.numerator
	dnm = s.denominator
	print ' spoly('+str(i)+',s)->',
	print num,'/',dnm,'sqrts:',math.sqrt(abs(num)),math.sqrt(abs(dnm))
print


text:
<?php
namespace Scalr\Service\Aws\Repository;

use Scalr\Service\Aws\S3\DataType\ObjectData;
use Scalr\Service\Aws\AbstractRepository;

/**
 * S3ObjectRepository
 *
 * @author    Vitaliy Demidov   <vitaliy@scalr.com>
 * @since     20.11.2012
 */
class S3ObjectRepository extends AbstractRepository
{

    /**
     * Reflection class name.
     * @var string
     */
    private static $reflectionClassName = 'Scalr\\Service\\Aws\\S3\\DataType\\ObjectData';

    /**
     * {@inheritdoc}
     * @see Scalr\Service\Aws.AbstractRepository::getReflectionClassName()
     */
    public function getReflectionClassName()
    {
        return self::$reflectionClassName;
    }

    /**
     * {@inheritdoc}
     * @see Scalr\Service\Aws.AbstractRepository::getIdentifier()
     */
    public function getIdentifier()
    {
        return array('bucketName', 'objectName');
    }

    /**
     * Finds one element in entity manager by id
     *
     * @param    array        $id    An object identifier array('bucketName', 'objectName')
     * @return   ObjectData   Returns ObjectData or NULL if nothing found.
     */
    public function find($id)
    {
        return parent::find($id);
    }
}


text:
<#

.SYNOPSIS
This is a Powershell script to bootstrap a Cake build.

.DESCRIPTION
This Powershell script will download NuGet if missing, restore NuGet tools (including Cake)
and execute your Cake build script with the parameters you provide.

.PARAMETER Script
The build script to execute.
.PARAMETER Target
The build script target to run.
.PARAMETER Configuration
The build configuration to use.
.PARAMETER Verbosity
Specifies the amount of information to be displayed.

.LINK
http://cakebuild.net

#>

[CmdletBinding()]
Param(
    [string]$Script = "build.cake",
    [string]$Target = "Default",
    [string]$Configuration = "Release",
    [ValidateSet("Quiet", "Minimal", "Normal", "Verbose", "Diagnostic")]
    [string]$Verbosity = "Verbose"
)

Write-Host "Preparing to run build script..."

$PSScriptRoot = split-path -parent $MyInvocation.MyCommand.Definition;
$TOOLS_DIR = Join-Path $PSScriptRoot "tools"
$NUGET_EXE = Join-Path $TOOLS_DIR "nuget.exe"
$NUGET_URL = "http://dist.nuget.org/win-x86-commandline/latest/nuget.exe"
$CAKE_EXE = Join-Path $TOOLS_DIR "Cake/Cake.exe"
$PACKAGES_CONFIG = Join-Path $TOOLS_DIR "packages.config"

# Make sure tools folder exists
if ((Test-Path $PSScriptRoot) -and !(Test-Path $TOOLS_DIR)) {
    Write-Verbose -Message "Creating tools directory..."
    New-Item -Path $TOOLS_DIR -Type directory | out-null
}

# Make sure that packages.config exist.
if (!(Test-Path $PACKAGES_CONFIG)) {
    Write-Verbose -Message "Downloading packages.config..."
    try { Invoke-WebRequest -Uri http://cakebuild.net/download/bootstrapper/packages -OutFile $PACKAGES_CONFIG } catch {
        Throw "Could not download packages.config."
    }
}

# Try find NuGet.exe in path if not exists
if (!(Test-Path $NUGET_EXE)) {
    Write-Verbose -Message "Trying to find nuget.exe in PATH..."
    $existingPaths = $Env:Path -Split ';' | Where-Object { (![string]::IsNullOrEmpty($_)) -and (Test-Path $_) }
    $NUGET_EXE_IN_PATH = Get-ChildItem -Path $existingPaths -Filter "nuget.exe" | Select -First 1
    if ($NUGET_EXE_IN_PATH -ne $null -and (Test-Path $NUGET_EXE_IN_PATH.FullName)) {
        Write-Verbose -Message "Found in PATH at $($NUGET_EXE_IN_PATH.FullName)."
        $NUGET_EXE = $NUGET_EXE_IN_PATH.FullName
    }
}

# Try download NuGet.exe if not exists
if (!(Test-Path $NUGET_EXE)) {
    Write-Verbose -Message "Downloading NuGet.exe..."
    try {
        (New-Object System.Net.WebClient).DownloadFile($NUGET_URL, $NUGET_EXE)
    } catch {
        Throw "Could not download NuGet.exe."
    }
}

# Save nuget.exe path to environment to be available to child processed
$ENV:NUGET_EXE = $NUGET_EXE

# Restore tools from NuGet?
if(-Not $SkipToolPackageRestore.IsPresent) {
    Push-Location
    Set-Location $TOOLS_DIR
    Write-Verbose -Message "Restoring tools from NuGet..."
    $NuGetOutput = Invoke-Expression "&`"$NUGET_EXE`" install -ExcludeVersion -OutputDirectory `"$TOOLS_DIR`""
    if ($LASTEXITCODE -ne 0) {
        Throw "An error occured while restoring NuGet tools."
    }
    Write-Verbose -Message ($NuGetOutput | out-string)
    Pop-Location
}

# Make sure that Cake has been installed.
if (!(Test-Path $CAKE_EXE)) {
    Throw "Could not find Cake.exe at $CAKE_EXE"
}

# Start Cake
Write-Host "Running build script..."
Invoke-Expression "$CAKE_EXE `"$Script`" -target=`"$Target`" -configuration=`"$Configuration`" -verbosity=`"$Verbosity`""

exit $LASTEXITCODE