text:
package tests

import (
	"errors"
	"fmt"
	"net/http"
	"testing"
	"time"

	"github.com/avast/retry-go"

	"github.com/skydive-project/skydive/config"
	etcd "github.com/skydive-project/skydive/graffiti/etcd/client"
	"github.com/skydive-project/skydive/graffiti/filters"
	es "github.com/skydive-project/skydive/graffiti/storage/elasticsearch"
)

type fakeMasterElection struct {
}

func (f *fakeMasterElection) NewElection(name string) etcd.MasterElection {
	return nil
}

func delTestIndex(name string) error {
	req, err := http.NewRequest("DELETE", fmt.Sprintf("http://localhost:9200/skydive_%s*", name), nil)
	if err != nil {
		return err
	}
	_, err = http.DefaultClient.Do(req)
	if err != nil {
		return err
	}
	return nil
}

func getClient(t *testing.T, indices []es.Index, cfg es.Config) (*es.Client, error) {
	es.SetRollingRate(5 * time.Second)

	client, err := es.NewClient(indices, cfg, &fakeMasterElection{})
	if err != nil {
		return nil, err
	}
	client.Start()

	err = retry.Do(func() error {
		if client.Started() {
			return nil
		}
		return errors.New("Elasticsearch connection not ready")
	})

	if err != nil {
		return nil, err
	}

	return client, nil
}

func TestRollingSimple(t *testing.T) {
	if topologyBackend != "elasticsearch" && flowBackend != "elasticsearch" {
		t.Skip("Elasticsearch is used neither for topology nor flows")
	}

	// del first in order to cleanup previews run
	delTestIndex("rolling")
	delTestIndex("not_rolling")

	indices := []es.Index{
		{
			Name:      "rolling",
			RollIndex: true,
		},
		{
			Name: "not_rolling",
		},
	}

	cfg := es.Config{
		ElasticHosts:     []string{"http://" + config.GetString("storage.elasticsearch.host")},
		EntriesLimit:     10,
		IndexPrefix:      "skydive_",
		TotalFieldsLimit: 1000,
	}

	client, err := getClient(t, indices, cfg)
	if err != nil {
		t.Fatal(err)
	}
	defer client.Stop()

	for i := 0; i != 9; i++ {
		id := fmt.Sprintf("before-entry_%d", i)
		client.Index(indices[0], id, map[string]string{"ID": id})
		client.Index(indices[1], id, map[string]string{"ID": id})
	}

	err = retry.Do(func() error {
		for _, index := range indices {
			result, err := client.Search(nil, filters.SearchQuery{}, index.Alias(client.Config.IndexPrefix))
			if err != nil {
				return err
			}
			if len(result.Hits.Hits) != 9 {
				return fmt.Errorf("Expected entries not found: %+v", result.Hits.Hits)
			}
		}
		return nil
	})

	if err != nil {
		t.Fatal(err)
	}

	// add more entries to trigger the rolling index
	for i := 0; i != 2; i++ {
		id := fmt.Sprintf("after-entry-%d", i)
		client.Index(indices[0], id, map[string]string{"ID": id})
		client.Index(indices[1], id, map[string]string{"ID": id})
	}

	time.Sleep(es.RollingRate)

	err = retry.Do(func() error {
		// test that the index has been rotated
		result, err := client.Search(nil, filters.SearchQuery{}, indices[0].Alias(client.Config.IndexPrefix))
		if err != nil {
			return err
		}
		if len(result.Hits.Hits) != 0 {
			return fmt.Errorf("Expected 1 entry, found: %+v", result.Hits.Hits)
		}

		// test that using the wilcard we can get all the records
		result, err = client.Search(nil, filters.SearchQuery{}, indices[0].IndexWildcard(client.Config.IndexPrefix))
		if err != nil {
			return err
		}
		if len(result.Hits.Hits) != 11 {
			return fmt.Errorf("Expected 1 entry, found: %+v", result.Hits.Hits)
		}

		// test that the no rolling index has not been rotated
		result, err = client.Search(nil, filters.SearchQuery{}, indices[1].Alias(client.Config.IndexPrefix))
		if err != nil {
			return err
		}
		if len(result.Hits.Hits) != 11 {
			return fmt.Errorf("Expected 11 entries, found: %+v", result.Hits.Hits)
		}
		return nil
	})

	if err != nil {
		t.Fatal(err)
	}
}


text:
<?php

/**
 *
 *
 * NOTE: This class is auto generated by the swagger code generator program. Do not edit the class manually.
 *
 */
class GetStatesResult {

  static $swaggerTypes = array(
      'states' => 'array[State]'

    );

  public $states; // array[State]
  }

redpajama_set_name: RedPajamaGithub


text:
package com.apps.my.liener;

import android.content.Context;
import android.content.Intent;
import android.graphics.Color;
import android.graphics.PixelFormat;
import android.graphics.Point;
import android.util.Log;
import android.view.Display;
import android.view.Gravity;
import android.view.View;
import android.view.WindowManager;
import android.widget.LinearLayout;

import static android.content.Context.WINDOW_SERVICE;
import static com.apps.my.liener.Constant.BubbleSizeDelete;

/**
 * Created by rahul on 5/6/17.
 */
public class Browser {
    private static final String TAG = Browser.class.getSimpleName();

    WindowManager bubbleWindow;
    WindowManager.LayoutParams paramBrowser, action_overflow_params;

    boolean is_open = false, is_running;
    int count = 0, current = 0, heightNew, widthMid;

    BrowserPage browserPageArray[] = new BrowserPage[20];
    int arrIndex[] = new int[20];

    BubbleHead bh, deleteHead;

    HomeWatcher mHomeWatcher;

    LinearLayout browserLayout;

    Context context;

    public Browser(Context context) {

        this.context = context;

        initVariables();
        initDeleteHead();
        initBubbleHead();
        initParamBrowser();
        initHomeListener();
        initActionOverflowParams();
    }

    public void initVariables() {
        current = 0;
        count = 0;

        for (int i = 0; i < 20; i++) {
            arrIndex[i] = i;
        }

        bubbleWindow = (WindowManager) context.getSystemService(WINDOW_SERVICE);
        loadDimensions();

    }

    private void initBubbleHead() {
        bh = new BubbleHead(context, heightNew, widthMid, BubbleHead.HEAD_TYPE_MAIN);
        bh.initParams(0, heightNew);
        bh.setBubbleListener(new BubbleListener() {
            @Override
            public void onClick() {
                expandBrowser();
            }

            @Override
            public void onDelete() {
                is_running = false;
                stopSelf();
            }

            @Override
            public void updateView() {
                bubbleWindow.updateViewLayout(bh.getView(), bh.getLayoutParams());
            }

            @Override
            public void onMove(boolean isMoving) {
                if (isMoving) {
                    deleteHead.setViewVisibility(View.VISIBLE);
                } else {
                    deleteHead.getView().setVisibility(View.INVISIBLE);
                }
            }

            @Override
            public void overDeleteArea(boolean isOver) {
                if (isOver) {
                    deleteHead.setLayoutParamsSize(Constant.BubbleSizeDeleteLarge);
                    bubbleWindow.updateViewLayout(deleteHead.getView(), deleteHead.getLayoutParams());
                    deleteHead.setLayoutParamsSize(Constant.BubbleSizeLarge);
                    bubbleWindow.updateViewLayout(bh.getView(), deleteHead.getLayoutParams());
                } else {
                    deleteHead.getLayoutParams().setSize(BubbleSizeDelete);
                    bubbleWindow.updateViewLayout(deleteHead.getView(), deleteHead.getLayoutParams());
                }
            }
        });
    }

    public void initParamBrowser() {
        paramBrowser = new WindowManager.LayoutParams(WindowManager.LayoutParams.FILL_PARENT,
                heightNew,
                WindowManager.LayoutParams.TYPE_PHONE,
                WindowManager.LayoutParams.FLAG_NOT_TOUCH_MODAL | WindowManager.LayoutParams.FLAG_WATCH_OUTSIDE_TOUCH,
                PixelFormat.TRANSLUCENT
        );
        paramBrowser.gravity = Gravity.BOTTOM | Gravity.RIGHT;

        browserLayout = new LinearLayout(context);
        browserLayout.setBackgroundColor(Color.WHITE);
    }

    public void initDeleteHead() {
        deleteHead = new BubbleHead(context, heightNew, widthMid, BubbleHead.HEAD_TYPE_DELETE);
        deleteHead.initParams(0, (int) (heightNew / 4 - BubbleSizeDelete / 2), Gravity.BOTTOM | Gravity.CENTER);
        bubbleWindow.addView(deleteHead.getView(), deleteHead.getLayoutParams());
    }

    public void initActionOverflowParams() {
        action_overflow_params = new WindowManager.LayoutParams(
                WindowManager.LayoutParams.WRAP_CONTENT,
                WindowManager.LayoutParams.WRAP_CONTENT,
                WindowManager.LayoutParams.TYPE_PHONE,
                WindowManager.LayoutParams.FLAG_NOT_FOCUSABLE,
                PixelFormat.TRANSLUCENT
        );
        action_overflow_params.gravity = Gravity.TOP | Gravity.RIGHT;
        action_overflow_params.y = (int) (heightNew * 28 / 100);
        Log.d(TAG, "initActionOverflowParams() called" + action_overflow_params.y);
    }

    public void initHomeListener() {
        mHomeWatcher = new HomeWatcher(context);
        mHomeWatcher.setOnHomePressedListener(new OnHomePressedListener() {
            @Override
            public void onHomePressed() {
                minimizeBrowser(current);
                // do something here...
            }

            @Override
            public void onHomeLongPressed() {
            }
        });
    }

    public void loadDimensions() {
        Display display = bubbleWindow.getDefaultDisplay();
        Point size = new Point();
        display.getSize(size);
        heightNew = (int) ((size.y * 100) / 128);
        widthMid = (int) (size.x / 2);
    }

    public void finish() {
        if (is_open) {
            if (current >= 0 && count > 0) {
                getBrowserTab(current).performClick();  // Minimizes before destroying
            }
        } else {
            bubbleWindow.removeView(bh.getView());
        }
    }

    private boolean isMenuOpen = false;

    public void showActionOverflow() {
        if (isMenuOpen) {
            //[ACTION_OVERFLOW]bubbleWindow.removeView(getBrowserTab(current).action_overflow_view);
            isMenuOpen = false;
        } else {
            //[ACTION_OVERFLOW]bubbleWindow.addView(getBrowserTab(current).action_overflow_view, action_overflow_params);
            isMenuOpen = true;
        }
    }

//    @Override
//    public void onTouchEvent(@BubbleListener.TOUCH_EVENT_TYPE int event_type, @BubbleHead.HEAD_TYPE int head_type, int BId) {
//        Log.d(TAG, "Listener onEvent() called with: type = [" + event_type + "]");
//        if (isMenuOpen) {
//            //[ACTION_FLOW]bubbleWindow.removeView(getBrowserTab(current).action_overflow_view);
//            isMenuOpen = false;
//        }
//        switch (event_type) {
//            case TOUCH_EVENT_TYPE_ADD_DELETE:
//                deleteHead.setViewVisibility(View.VISIBLE);
//                break;
//            case TOUCH_EVENT_TYPE_DELETE:
//                switch (head_type) {
//                    case BubbleHead.HEAD_TYPE_MAIN:
//                        is_running = false;
//                        stopSelf();
//                        break;
//                    case BubbleHead.HEAD_TYPE_TAB:
//                        deletePage(getIndex(BId));
//                        break;
//                }
//                break;
//            case TOUCH_EVENT_TYPE_ON_DELETE:
//                switch (head_type) {
//                    case BubbleHead.HEAD_TYPE_MAIN:
//                        deleteHead.setLayoutParamsSize(Constant.BubbleSizeDeleteLarge);
//                        bubbleWindow.updateViewLayout(deleteHead.getView(), deleteHead.getLayoutParams());
//                        deleteHead.setLayoutParamsSize(Constant.BubbleSizeLarge);
//                        bubbleWindow.updateViewLayout(bh.getView(), deleteHead.getLayoutParams());
//                        break;
//                    case BubbleHead.HEAD_TYPE_TAB:
//                        deleteHead.setLayoutParamsSize(Constant.BubbleSizeDeleteLarge);
//                        bubbleWindow.updateViewLayout(deleteHead.getView(), deleteHead.getLayoutParams());
//                        deleteHead.setLayoutParamsSize(Constant.BubbleSizeLarge);
//                        bubbleWindow.updateViewLayout(browserPageArray[BId].getBubbleView(), deleteHead.getLayoutParams());
//                        break;
//                }
//                deleteHead.getLayoutParams().setSize(BubbleSizeDelete);
//                break;
//
//            case TOUCH_EVENT_TYPE_OFF_DELETE:
//                deleteHead.getLayoutParams().setSize(BubbleSizeDelete);
//                bubbleWindow.updateViewLayout(deleteHead.getView(), deleteHead.getLayoutParams());
//                break;
//            case TOUCH_EVENT_TYPE_REMOVE_DELETE:
//                deleteHead.getView().setVisibility(View.INVISIBLE);
//                break;
//            case TOUCH_EVENT_TYPE_UPDATE:
//                switch (head_type) {
//                    case BubbleHead.HEAD_TYPE_MAIN:
//                        bubbleWindow.updateViewLayout(bh.getView(), bh.getLayoutParams());
//                        break;
//                    case BubbleHead.HEAD_TYPE_TAB:
//                        bubbleWindow.updateViewLayout(browserPageArray[BId].getBubbleView(), browserPageArray[BId].getBubbleLayout());
//                        break;
//                }
//                break;
//            case TOUCH_EVENT_TYPE_REMOVE_BROWSER:
//                bubbleWindow.removeView(browserLayout);
//                browserLayout.removeView(getBrowserTab(current).getBrowserView());
//                Log.d(TAG, "removeview8");
//                break;
//            case TOUCH_EVENT_TYPE_ADD_BROWSER:
//                //Add view layout
//                //Add view to layout
//
//                browserLayout.addView(getBrowserTab(current).getBrowserView(), paramBrowser);
//                bubbleWindow.addView(browserLayout, paramBrowser);
//
//                //bubbleWindow.addView(getBrowserTab(current).browser, paramBrowser);
//                break;
//        }
//    }

//    @Override
//    public void onClickEvent(@BubbleListener.CLICK_EVENT_TYPE int event_type, @BubbleHead.HEAD_TYPE int head_type, int BId) {
//        Log.d(TAG, "onClickEvent() called with: event_type = [" + event_type + "], head_type = [" + head_type + "], BId = [" + BId + "]");
//        if (isMenuOpen) {
//            //[ACTION_FLOW]bubbleWindow.removeView(getBrowserTab(current).action_overflow_view);
//            isMenuOpen = false;
//        }
//        switch (event_type) {
//            case CLICK_EVENT_TYPE_EXPAND:
//                expandBrowser();
//                break;
//            case CLICK_EVENT_TYPE_MINIMIZE:
//                Log.d(TAG, "onClickEvent() called with: event_type = [" + event_type + "], head_type = [" + head_type + "], BId = [" + BId + "], GetIndex = [" + getIndex(BId) + "]");
//                minimizeBrowser(getIndex(BId));
//                break;
//        }
//    }

    public int getIndex(int BId) {
        for (int i = 0; i < count; i++) {
            if (arrIndex[i] == BId) {
                return i;
            }
        }
        Log.d(TAG, "getIndex() Error called with: BId = [" + BId + "]");
        return -1;
    }

    public void shiftBubble(int index) {
        getBrowserTab(index).setBubbleLayoutX(getBrowserTab(index).getBubbleLayoutX() - Constant.BubbleSizeLarge);
    }

    private BrowserPage getBrowserTab(int index) {
        return browserPageArray[arrIndex[index]];
    }

    private void addBrowserTab(int index, BrowserPage browserPage) {
        browserPageArray[arrIndex[index]] = browserPage;
    }

    public void addTab(BubbleService bubbleService, String url) {
        is_running = true;

        BrowserPage browserPage = new BrowserPage(context, count * Constant.BubbleSizeLarge, heightNew, widthMid);
        final int BId = arrIndex[count];
        browserPage.setPageListener(new PageListener() {
            @Override
            public void onMinimize() {
                minimizeBrowser(getIndex(arrIndex[BId]));
            }
        });
        addBrowserTab(count, browserPage);
        getBrowserTab(count).setBubbleListener(new BubbleListener() {
            @Override
            public void onClick() {
                minimizeBrowser(getIndex(arrIndex[BId]));
            }

            @Override
            public void onDelete() {
                deleteHead.getView().setVisibility(View.INVISIBLE);
                deletePage(getIndex(BId));
            }

            @Override
            public void updateView() {
                bubbleWindow.updateViewLayout(browserPageArray[BId].getBubbleView(), browserPageArray[BId].getBubbleLayout());
            }

            @Override
            public void onMove(boolean isMoving) {
                if (isMoving) {
                    deleteHead.setViewVisibility(View.VISIBLE);
                    bubbleWindow.removeView(browserLayout);
                    browserLayout.removeView(getBrowserTab(current).getBrowserView());
                } else {
                    deleteHead.getView().setVisibility(View.INVISIBLE);
                    bubbleWindow.updateViewLayout(browserPageArray[BId].getBubbleView(), browserPageArray[BId].getBubbleLayout());
                    browserLayout.addView(getBrowserTab(current).getBrowserView(), paramBrowser);
                    bubbleWindow.addView(browserLayout, paramBrowser);
                }
            }

            @Override
            public void overDeleteArea(boolean isOver) {
                if (isOver) {
                    deleteHead.setLayoutParamsSize(Constant.BubbleSizeDeleteLarge);
                    bubbleWindow.updateViewLayout(deleteHead.getView(), deleteHead.getLayoutParams());
                    deleteHead.setLayoutParamsSize(Constant.BubbleSizeLarge);
                    bubbleWindow.updateViewLayout(browserPageArray[BId].getBubbleView(), deleteHead.getLayoutParams());
                } else {
                    deleteHead.getLayoutParams().setSize(BubbleSizeDelete);
                    bubbleWindow.updateViewLayout(deleteHead.getView(), deleteHead.getLayoutParams());
                }
            }
        });

//        getBrowserTab(count).setListener(this);

        getBrowserTab(count).loadUrl(url);
        if (count == 0) {
            bubbleWindow.addView(bh.getView(), bh.getLayoutParams());    // Adds main bubble head to the display
        } else {
            if (is_open) {
                browserPageArray[current].performClick();
            }
        }
        count++;
    }

    public void expandBrowser() {
        if (is_running) {
            if (!is_open) {
                mHomeWatcher.startWatch();
                if (current == 0) {
                    getBrowserTab(0).switchToLarge();
                }
                bubbleWindow.removeView(bh.getView());

                for (int i = 0; i < count; i++) {
                    bubbleWindow.addView(getBrowserTab(i).getBubbleView(), getBrowserTab(i).getBubbleLayout());
                }
                addBrowser(current);
                is_open = true;
            } else {
                minimizeBrowser(0);
            }
        }
    }

    public void addBrowser(final int index) {

        //Add view to layout
        browserLayout.addView(getBrowserTab(index).getBrowserView(), paramBrowser);

        if (index == current) {
            bubbleWindow.addView(browserLayout, paramBrowser);
        }

        getBrowserTab(index).setWebViewKeyListener();
    }

    public void minimizeBrowser(int index) {
        if (current == index) {
            for (int i = 0; i < count; i++) {
                bubbleWindow.removeView(getBrowserTab(i).getBubbleView());
            }

            bubbleWindow.removeView(browserLayout);
            browserLayout.removeView(getBrowserTab(current).getBrowserView());

            bubbleWindow.addView(bh.getView(), bh.getLayoutParams());
            is_open = false;
            mHomeWatcher.stopWatch();
        } else {
            addBrowser(index);

            //Remove view from layout
            browserLayout.removeView(getBrowserTab(current).getBrowserView());

            getBrowserTab(index).switchToLarge();
            bubbleWindow.updateViewLayout(getBrowserTab(index).getBubbleView(), getBrowserTab(index).getBubbleLayout());

            getBrowserTab(current).switchToSmall();
            bubbleWindow.updateViewLayout(getBrowserTab(current).getBubbleView(), getBrowserTab(current).getBubbleLayout());
            current = index;
        }
    }

    public void deletePage(int index) {
        int current_BId = arrIndex[current];
        bubbleWindow.removeView(getBrowserTab(index).getBubbleView());

        int temp = arrIndex[index];
        for (int i = index; i < count - 1; i++) {
            arrIndex[i] = arrIndex[i + 1];
        }
        arrIndex[count - 1] = temp;
        count--;

        for (int i = index; i < count; i++) {
            shiftBubble(i);
        }
        if (current >= count) {
            current = 0;
            getBrowserTab(0).switchToLarge();
            bubbleWindow.updateViewLayout(getBrowserTab(0).getBubbleView(), getBrowserTab(0).getBubbleLayout());
        } else if (arrIndex[count] == current_BId) {
            getBrowserTab(current).switchToLarge();
        } else {
            current = getIndex(current_BId);
        }
        for (int i = index; i < count; i++) {
            bubbleWindow.updateViewLayout(getBrowserTab(i).getBubbleView(), getBrowserTab(i).getBubbleLayout());
        }

        if (current >= 0 && count > 0) {
            browserLayout.addView(getBrowserTab(current).getBrowserView(), paramBrowser);
            bubbleWindow.addView(browserLayout, paramBrowser);

        } else {
            mHomeWatcher.stopWatch();
            stopSelf();
        }
    }

//    @Override
//    public void onEvent(@BubbleListener.EVENT_TYPE int event_type) {
//        switch (event_type) {
//            case EVENT_TYPE_ACTION_OVERFLOW:
//                minimizeBrowser(current);
//                break;
//        }
//    }
//
//    @Override
//    public void onError(Throwable error) {
//
//    }

    private void stopSelf() {
        Intent bubbleService = new Intent(context, BubbleService.class);
        context.stopService(bubbleService);
    }

}


text:
package org.jsmiparser.util.location;

import static org.junit.Assert.assertEquals;
import static org.junit.Assert.assertNotNull;

import org.junit.Test;

public class LocationTest {
    @Test
    public void createLocation() {
        Location location = new Location("text.txt", 9, 10);
        assertEquals(10, location.getColumn());
        assertEquals(9, location.getLine());
        assertEquals("text.txt", location.getSource());
        assertEquals("text.txt:9:10", location.toString());

        location = new Location("text.txt", 8);
        location.setColumn(20);
        location.setLine(10);
        location.setSource("text.mib");

        assertEquals("text.mib:10:20", location.toString());

        location = new Location("text.txt");
        assertNotNull(location);
    }
}


text:
package org.openfact.pe.representations.idm;

import java.math.BigDecimal;

public class GenericTypeRepresentation {

    private String id;
    private String codigo;
    private String abreviatura;
    private String denominacion;
    private String grupo;
    private Integer length;
    private Integer minlength;
    private Integer maxlength;
    private Boolean afectaIgv;
    private Boolean estado;
    private BigDecimal valor;

    public String getId() {
        return id;
    }

    public void setId(String id) {
        this.id = id;
    }

    public String getCodigo() {
        return codigo;
    }

    public void setCodigo(String codigo) {
        this.codigo = codigo;
    }

    public String getAbreviatura() {
        return abreviatura;
    }

    public void setAbreviatura(String abreviatura) {
        this.abreviatura = abreviatura;
    }

    public String getDenominacion() {
        return denominacion;
    }

    public void setDenominacion(String denominacion) {
        this.denominacion = denominacion;
    }

    public String getGrupo() {
        return grupo;
    }

    public void setGrupo(String grupo) {
        this.grupo = grupo;
    }

    public Integer getLength() {
     return length;
    }

    public void setLength(Integer length) {
        this.length = length;
    }

public Boolean getAfectaIgv() {
        return afectaIgv;
    }

    public void setAfectaIgv(Boolean afectaIgv) {
        this.afectaIgv = afectaIgv;
    }

    public BigDecimal getValor() {
        return valor;
    }

    public void setValor(BigDecimal valor) {
        this.valor = valor;
    }

    public Integer getMinlength() {
        return minlength;
    }

    public void setMinlength(Integer minlength) {
        this.minlength = minlength;
    }

    public Integer getMaxlength() {
        return maxlength;
    }

    public void setMaxlength(Integer maxlength) {
        this.maxlength = maxlength;
    }

    public Boolean getEstado() {
        return estado;
    }

    public void setEstado(Boolean estado) {
        this.estado = estado;
    }
}


text:
# Chromedriver HTML5 drag and drop fix
![<text>](http://pixel-cookers.github.io/built-with-badges/node/node-short.png)

## Problem statement
If you're using the HTML5 drag and drop implementation in you web app and want to test its behaviour
with Selenium and Chromedriver, you're out of luck due to
[**this bug**](https://crbug.com/chromedriver/2695):

Chromedriver can handle `clickAndHold`, `move` and `release`, but has a bug in this. There is a `event.button`
attribute in every Javascript `MouseEvent` object. This is set to `-1` if nothing is clicked
and something between `0` (main mouse button) and `4` if a button is clicked.
Now chromedriver sets this on `clickAndHold` but does not take it over into the move
so when moving the `event.button` is `-1` again.

## Solution
Using [Selenium's JS API](https://github.com/SeleniumHQ/selenium/tree/master/javascript/webdriver),
possibly wrapped by something like [Nemo](https://github.com/paypal/nemo),
simply include `dragdrop-chromedriver.js` in your test runner or -suite, like this:

```js
    require('chromedriver-html5-dragdrop')(yourInstantiatedWebdriver/* , waitMillisBetweenSteps */);
```

When using Nemo, `yourInstantiatedWebdriver` is usually `nemo.driver`.

You can set `waitMillisBetweenSteps` for debugging or watching what's happening.

Now, use `dragAndDrop` just like in Selenium's [example](https://github.com/SeleniumHQ/selenium/blob/master/javascript/webdriver/actionsequence.js#L32).
[Refer here](http://selenium.googlecode.com/git/docs/api/javascript/class_webdriver_ActionSequence.html#dragAndDrop)
for the `dragAndDrop` method's API.

## Caveats
Because for security reasons synthetic drag events do not have a usable `dataTransfer` property,
all `dataTransfer` accesses in the tested code must be made conditional, for example like this:

```js
    if (event.dataTransfer) { event.dataTransfer.dropEffect = 'move'; }
```

Because of this, but also due to limits of the original `dragAndDrop` API, **you won't be able to test dragging files into the browser window**.

## How it works
Basically it monkey patches `webdriver.ActionSequence`, overriding its `dragAndDrop` function
with one that remains fully API compatible to [the original one](https://github.com/SeleniumHQ/selenium/blob/master/javascript/webdriver/actionsequence.js#L218),
but internally triggers the `dragstart`, `drag`, `dragover`, `drop` and `dragend` events in the browser context.
There are some checks to prevent this approach from performing drag and drop operations a real user wouldn't be able to perform.


text:
'use strict';

var assert = require('assert');
//var proverbium = require('../');

// test 1
assert(true);


text:
@implementation SingleCollectionViewCell

-(instancetype)initWithFrame:(CGRect)frame{

    if(self = [super initWithFrame:frame]){

        [self configImageView];

        self.layer.borderColor = [BOARDCOLOR CGColor];
        self.layer.borderWidth = 0.5*S6;
    }
    return self;
}

-(void)configImageView{

    self.showImageView = [[UIImageView alloc]initWithFrame:CGRectMake(0*S6,0, 179*S6, 154*S6)];
//    self.showImageView.layer.borderWidth = 0.5*S6;
//    self.showImageView.layer.borderColor = [RGB_COLOR(29, 227, 227, 1) CGColor];
    [self.contentView addSubview:self.showImageView];

    //添加半透明的View
    self.titleLabel = [[UILabel alloc]initWithFrame:CGRectMake(10*S6,145*S6,173*S6,16*S6)];
    self.titleLabel.textAlignment = NSTextAlignmentCenter;
    self.titleLabel.font = [UIFont systemFontOfSize:13*S6];
    self.titleLabel.textColor = [UIColor blackColor];
    self.titleLabel.alpha = 0.9;
    self.titleLabel.centerX = self.showImageView.centerX;
    [self addSubview:self.titleLabel];
    self.backgroundColor = [UIColor whiteColor];

    self.numberLabel = [Tools createLabelWithFrame:CGRectMake(0, CGRectGetMaxY(self.titleLabel.frame)+2*S6, Wscreen, 9*S6) textContent:nil withFont:[UIFont systemFontOfSize:9*S6] textColor:RGB_COLOR(102, 102, 102, 1) textAlignment:NSTextAlignmentCenter];
    self.numberLabel.centerX = self.showImageView.centerX;
    [self.contentView addSubview:self.numberLabel];

    self.showImageView.userInteractionEnabled = YES;
    UITapGestureRecognizer * tap = [[UITapGestureRecognizer alloc]initWithTarget:self action:@selector(clickSingleImage)];
    [self.showImageView addGestureRecognizer:tap];
}

-(void)clickImageView:(ClickImageBlock)block{

    self.block = block;
}

#pragma mark -点击图片
-(void)clickSingleImage{

    if(self.block){

        self.block(self.number);
    }
}

-(void)configCell:(id)model{

    NSInteger width = 179*THUMBNAILRATE;
    NSInteger height = 154*THUMBNAILRATE;

    if([model isKindOfClass:[RecommandImageModel class]]){

        RecommandImageModel * re_Model = (RecommandImageModel *)model;
        self.number = re_Model.number;
        //拼接ip和port
        NetManager * manager = [NetManager shareManager];
        NSString * URLstring = [NSString stringWithFormat:BANNERCONNET,[manager getIPAddress]];
        UIImage * gifImage = [UIImage imageNamed:PLACEHOLDER];
        [self.showImageView sd_setImageWithURL:[NSURL URLWithString:[Tools connectOriginImgStr:[NSString stringWithFormat:@"%@%@",URLstring,re_Model.img] width:GETSTRING(width) height:GETSTRING(height)]] placeholderImage:gifImage];
        self.showImageView.contentMode = UIViewContentModeScaleAspectFit;
        if(re_Model.name){
            self.titleLabel.text = re_Model.name;
        }else{
            self.titleLabel.text = @"Product Name";
        }
        self.numberLabel.text = re_Model.number;
    }
}

#pragma mark -拼接图片网址
-(NSString *)connectImage:(NSString *)urlStr withFollow:(NSString *)followStr{

    return [NSString stringWithFormat:@"%@%@",urlStr,followStr];
}

//获取本地图片路径
-(NSString *)captureLocalImage:(NSString *)imageName withType:(NSString *)imageType{

    return [[NSBundle mainBundle]pathForResource:imageName ofType:imageType];
}

@end


text:
<?php

namespace Faithlead\RestBundle\Form\Type;

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

class EmailTemplateType extends AbstractType
{
    /**
     * {@inheritdoc}
     */
    public function buildForm(FormBuilderInterface $builder, array $options)
    {
        $builder->add('body', 'text');
        $builder->add('name', 'text');
    }

    /**
     * {@inheritdoc}
     */
    public function setDefaultOptions(OptionsResolverInterface $resolver)
    {
        $resolver->setDefaults(array(
            'data_class'        => 'Faithlead\RestBundle\Document\EmailTemplate',
            'csrf_protection'   => false,
        ));
    }

    /**
     * {@inheritdoc}
     */
    public function getName()
    {
        return 'emailtemaplate';
    }
}


text:
namespace _04.WorkForce.EventArgs
{
    public class JobEventArgs : System.EventArgs
    {
        public JobEventArgs(string jobName)
        {
            this.Name = jobName;
        }

        public string Name { get; private set; }
    }
}


text:
![Chronik Logo](chroniklogo.png "Chronik")

(Logo design by Alita Yin [ecash:qr6lws9uwmjkkaau4w956lugs9nlg9hudqs26lyxkv](https://explorer.e.cash/address/ecash:qr6lws9uwmjkkaau4w956lugs9nlg9hudqs26lyxkv))

# Chronik

Chronik is an indexer built directly into the Bitcoin ABC node.

You can read about the reasoning behind this indexer in [this article by Mengerian](https://mengerian.medium.com/why-i-am-excited-about-the-ecash-chronik-project-1401b945eb21).

The code in this repository is for the integration into the node, which is currently unfinished. However, you can use these experimental versions:

1. Chronik via NNG interface (recommended, for now): https://github.com/raipay/chronik/
2. Experimental Chronik built into Bitcoin ABC (not recommended, but easier to set-up): https://github.com/raipay/bitcoin-abc/tree/chronik

You can also join the Chronik Work Group on Telegram if you have issues, contact Tobias Ruck to add you.


text:
$def with (form)

<title>Ambient Color Control</title>

Ambient Color Control

<form name="main" method="post">
$if not form.valid:
Try again:

$:form.render()
<input type="submit" />    </form>

Full on @ 255

Full off @ 0


text:
namespace content {

class LevelDBComparator;
class LevelDBDatabase;

class LevelDBFactory {
 public:
  virtual ~LevelDBFactory() {}
  virtual leveldb::Status OpenLevelDB(
      const base::FilePath& file_name,
      const LevelDBComparator* comparator,
      scoped_ptr<LevelDBDatabase>* db,
      bool* is_disk_full) = 0;
  virtual bool DestroyLevelDB(const base::FilePath& file_name) = 0;
};

class CONTENT_EXPORT IndexedDBBackingStore
    : public base::RefCounted<IndexedDBBackingStore> {
 public:
  class CONTENT_EXPORT Transaction;

  static scoped_refptr<IndexedDBBackingStore> Open(
      const std::string& origin_identifier,
      const base::FilePath& path_base,
      const std::string& file_identifier,
      WebKit::WebIDBCallbacks::DataLoss* data_loss);

  static scoped_refptr<IndexedDBBackingStore> Open(
      const std::string& origin_identifier,
      const base::FilePath& path_base,
      const std::string& file_identifier,
      WebKit::WebIDBCallbacks::DataLoss* data_loss,
      LevelDBFactory* factory);
  static scoped_refptr<IndexedDBBackingStore> OpenInMemory(
      const std::string& file_identifier);
  static scoped_refptr<IndexedDBBackingStore> OpenInMemory(
      const std::string& file_identifier,
      LevelDBFactory* factory);
  base::WeakPtr<IndexedDBBackingStore> GetWeakPtr() {
    return weak_factory_.GetWeakPtr();
  }

  virtual std::vector<string16> GetDatabaseNames();
  virtual bool GetIDBDatabaseMetaData(const string16& name,
                                      IndexedDBDatabaseMetadata* metadata,
                                      bool* success) WARN_UNUSED_RESULT;
  virtual bool CreateIDBDatabaseMetaData(const string16& name,
                                         const string16& version,
                                         int64 int_version,
                                         int64* row_id);
  virtual bool UpdateIDBDatabaseMetaData(
      IndexedDBBackingStore::Transaction* transaction,
      int64 row_id,
      const string16& version);
  virtual bool UpdateIDBDatabaseIntVersion(
      IndexedDBBackingStore::Transaction* transaction,
      int64 row_id,
      int64 int_version);
  virtual bool DeleteDatabase(const string16& name);

  bool GetObjectStores(int64 database_id,
                       IndexedDBDatabaseMetadata::ObjectStoreMap* map)
      WARN_UNUSED_RESULT;
  virtual bool CreateObjectStore(
      IndexedDBBackingStore::Transaction* transaction,
      int64 database_id,
      int64 object_store_id,
      const string16& name,
      const IndexedDBKeyPath& key_path,
      bool auto_increment);
  virtual bool DeleteObjectStore(
      IndexedDBBackingStore::Transaction* transaction,
      int64 database_id,
      int64 object_store_id) WARN_UNUSED_RESULT;

  class CONTENT_EXPORT RecordIdentifier {
   public:
    RecordIdentifier(const std::string& primary_key, int64 version);
    RecordIdentifier();
    ~RecordIdentifier();

    const std::string& primary_key() const { return primary_key_; }
    int64 version() const { return version_; }
    void Reset(const std::string& primary_key, int64 version) {
      primary_key_ = primary_key;
      version_ = version;
    }

   private:
    // TODO(jsbell): Make it more clear that this is the *encoded* version of
    // the key.
    std::string primary_key_;
    int64 version_;
    DISALLOW_COPY_AND_ASSIGN(RecordIdentifier);
  };

  virtual bool GetRecord(IndexedDBBackingStore::Transaction* transaction,
                         int64 database_id,
                         int64 object_store_id,
                         const IndexedDBKey& key,
                         std::string* record) WARN_UNUSED_RESULT;
  virtual bool PutRecord(IndexedDBBackingStore::Transaction* transaction,
                         int64 database_id,
                         int64 object_store_id,
                         const IndexedDBKey& key,
                         const std::string& value,
                         RecordIdentifier* record) WARN_UNUSED_RESULT;
  virtual bool ClearObjectStore(IndexedDBBackingStore::Transaction* transaction,
                                int64 database_id,
                                int64 object_store_id) WARN_UNUSED_RESULT;
  virtual bool DeleteRecord(IndexedDBBackingStore::Transaction* transaction,
                            int64 database_id,
                            int64 object_store_id,
                            const RecordIdentifier& record) WARN_UNUSED_RESULT;
  virtual bool GetKeyGeneratorCurrentNumber(
      IndexedDBBackingStore::Transaction* transaction,
      int64 database_id,
      int64 object_store_id,
      int64* current_number) WARN_UNUSED_RESULT;
  virtual bool MaybeUpdateKeyGeneratorCurrentNumber(
      IndexedDBBackingStore::Transaction* transaction,
      int64 database_id,
      int64 object_store_id,
      int64 new_state,
      bool check_current) WARN_UNUSED_RESULT;
  virtual bool KeyExistsInObjectStore(
      IndexedDBBackingStore::Transaction* transaction,
      int64 database_id,
      int64 object_store_id,
      const IndexedDBKey& key,
      RecordIdentifier* found_record_identifier,
      bool* found) WARN_UNUSED_RESULT;

  virtual bool CreateIndex(IndexedDBBackingStore::Transaction* transaction,
                           int64 database_id,
                           int64 object_store_id,
                           int64 index_id,
                           const string16& name,
                           const IndexedDBKeyPath& key_path,
                           bool is_unique,
                           bool is_multi_entry) WARN_UNUSED_RESULT;
  virtual bool DeleteIndex(IndexedDBBackingStore::Transaction* transaction,
                           int64 database_id,
                           int64 object_store_id,
                           int64 index_id) WARN_UNUSED_RESULT;
  virtual bool PutIndexDataForRecord(
      IndexedDBBackingStore::Transaction* transaction,
      int64 database_id,
      int64 object_store_id,
      int64 index_id,
      const IndexedDBKey& key,
      const RecordIdentifier& record) WARN_UNUSED_RESULT;
  virtual bool GetPrimaryKeyViaIndex(
      IndexedDBBackingStore::Transaction* transaction,
      int64 database_id,
      int64 object_store_id,
      int64 index_id,
      const IndexedDBKey& key,
      scoped_ptr<IndexedDBKey>* primary_key) WARN_UNUSED_RESULT;
  virtual bool KeyExistsInIndex(IndexedDBBackingStore::Transaction* transaction,
                                int64 database_id,
                                int64 object_store_id,
                                int64 index_id,
                                const IndexedDBKey& key,
                                scoped_ptr<IndexedDBKey>* found_primary_key,
                                bool* exists) WARN_UNUSED_RESULT;

  class Cursor {
   public:
    virtual ~Cursor();

    enum IteratorState {
      READY = 0,
      SEEK
    };

    struct CursorOptions {
      CursorOptions();
      ~CursorOptions();
      int64 database_id;
      int64 object_store_id;
      int64 index_id;
      std::string low_key;
      bool low_open;
      std::string high_key;
      bool high_open;
      bool forward;
      bool unique;
    };

    const IndexedDBKey& key() const { return *current_key_; }
    bool Continue() { return Continue(NULL, SEEK); }
    bool Continue(const IndexedDBKey* key, IteratorState state);
    bool Advance(uint32 count);
    bool FirstSeek();

    virtual Cursor* Clone() = 0;
    virtual const IndexedDBKey& primary_key() const;
    virtual std::string* Value() = 0;
    virtual const RecordIdentifier& record_identifier() const;
    virtual bool LoadCurrentRow() = 0;

   protected:
    Cursor(LevelDBTransaction* transaction,
           const CursorOptions& cursor_options);
    explicit Cursor(const IndexedDBBackingStore::Cursor* other);

    virtual std::string EncodeKey(const IndexedDBKey& key) = 0;

    bool IsPastBounds() const;
    bool HaveEnteredRange() const;

    LevelDBTransaction* transaction_;
    const CursorOptions cursor_options_;
    scoped_ptr<LevelDBIterator> iterator_;
    scoped_ptr<IndexedDBKey> current_key_;
    IndexedDBBackingStore::RecordIdentifier record_identifier_;
  };

  virtual scoped_ptr<Cursor> OpenObjectStoreKeyCursor(
      IndexedDBBackingStore::Transaction* transaction,
      int64 database_id,
      int64 object_store_id,
      const IndexedDBKeyRange& key_range,
      indexed_db::CursorDirection);
  virtual scoped_ptr<Cursor> OpenObjectStoreCursor(
      IndexedDBBackingStore::Transaction* transaction,
      int64 database_id,
      int64 object_store_id,
      const IndexedDBKeyRange& key_range,
      indexed_db::CursorDirection);
  virtual scoped_ptr<Cursor> OpenIndexKeyCursor(
      IndexedDBBackingStore::Transaction* transaction,
      int64 database_id,
      int64 object_store_id,
      int64 index_id,
      const IndexedDBKeyRange& key_range,
      indexed_db::CursorDirection);
  virtual scoped_ptr<Cursor> OpenIndexCursor(
      IndexedDBBackingStore::Transaction* transaction,
      int64 database_id,
      int64 object_store_id,
      int64 index_id,
      const IndexedDBKeyRange& key_range,
      indexed_db::CursorDirection);

  class Transaction {
   public:
    explicit Transaction(IndexedDBBackingStore* backing_store);
    ~Transaction();
    void Begin();
    bool Commit();
    void Rollback();
    void Reset() {
      backing_store_ = NULL;
      transaction_ = NULL;
    }

    static LevelDBTransaction* LevelDBTransactionFrom(
        Transaction* transaction) {
      return transaction->transaction_;
    }

   private:
    IndexedDBBackingStore* backing_store_;
    scoped_refptr<LevelDBTransaction> transaction_;
  };

 protected:
  IndexedDBBackingStore(const std::string& identifier,
                        scoped_ptr<LevelDBDatabase> db,
                        scoped_ptr<LevelDBComparator> comparator);
  virtual ~IndexedDBBackingStore();
  friend class base::RefCounted<IndexedDBBackingStore>;

 private:
  static scoped_refptr<IndexedDBBackingStore> Create(
      const std::string& identifier,
      scoped_ptr<LevelDBDatabase> db,
      scoped_ptr<LevelDBComparator> comparator);

  bool FindKeyInIndex(IndexedDBBackingStore::Transaction* transaction,
                      int64 database_id,
                      int64 object_store_id,
                      int64 index_id,
                      const IndexedDBKey& key,
                      std::string* found_encoded_primary_key,
                      bool* found);
  bool GetIndexes(int64 database_id,
                  int64 object_store_id,
                  IndexedDBObjectStoreMetadata::IndexMap* map)
      WARN_UNUSED_RESULT;

  std::string identifier_;

  scoped_ptr<LevelDBDatabase> db_;
  scoped_ptr<LevelDBComparator> comparator_;
  base::WeakPtrFactory<IndexedDBBackingStore> weak_factory_;
};

}  // namespace content

#endif  // CONTENT_BROWSER_INDEXED_DB_INDEXED_DB_BACKING_STORE_H_


text:
import asposepdfcloud
from asposepdfcloud.PdfApi import PdfApi
from asposepdfcloud.PdfApi import ApiException

import asposestoragecloud
from asposestoragecloud.StorageApi import StorageApi
from asposestoragecloud.StorageApi import ResponseMessage

apiKey = "XXXXX" #sepcify App Key
appSid = "XXXXX" #sepcify App SID
apiServer = "http://api.aspose.com/v1.1"
data_folder = "../../data/"

#Instantiate Aspose Storage API SDK
storage_apiClient = asposestoragecloud.ApiClient.ApiClient(apiKey, appSid, True)
storageApi = StorageApi(storage_apiClient)
#Instantiate Aspose Pdf API SDK
api_client = asposepdfcloud.ApiClient.ApiClient(apiKey, appSid, True)
pdfApi = PdfApi(api_client);

#set input file name
fileName = "SampleImage"
name = fileName + ".pdf"
pageNumber = 1
imageNumber = 1
format = "jpeg"

try:
    #upload file to aspose cloud storage
    response = storageApi.PutCreate(name, data_folder + name)

    #invoke Aspose.Pdf Cloud SDK API to extract a particular image from a PDF page
    response = pdfApi.GetImageWithFormat(name, pageNumber, imageNumber, format)

    if response.Status == "OK":
        #download image from response
        outfilename = "c:/temp/" + fileName + str(imageNumber) + "." + format
        with open(outfilename, 'wb') as f:
                    for chunk in response.InputStream:
                        f.write(chunk)

except ApiException as ex:
            print "ApiException:"
            print "Code:" + str(ex.code)
            print "Message:" + ex.message


text:
<?xml version="1.0" encoding="UTF-8"?>
<beans xmlns="http://www.springframework.org/schema/beans"
       xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
       xsi:schemaLocation="http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans.xsd">

    <bean id="msgListener" class="com.aliyun.listener.DemoMessageListener"></bean> <!--Listener配置-->

    <bean id="consumer" class="com.aliyun.openservices.ons.api.bean.ConsumerBean" init-method="start" destroy-method="shutdown">
        <property name="properties" > <!--消费者配置信息-->
            <props>
                <prop key="ConsumerId">CID_MESSAGE</prop> <!--请替换XXX-->
                <prop key="AccessKey">wwwJeU6QFhw8Dbd4</prop>
                <prop key="SecretKey">KHwJ7ooNTEPLziyPuy9K4vBib2k4Mn</prop>
                <!--将消费者线程数固定为50个.
                <prop key="ConsumeThreadNums">50</prop>
                -->
            </props>
        </property>
        <property name="subscriptionTable">
            <map>
                <entry value-ref="msgListener">
                    <key>
                        <bean class="com.aliyun.openservices.ons.api.bean.Subscription">
                            <property name="topic" value="topic_20160513001"/>
                            <property name="expression" value="*"/>
                        </bean>
                    </key>
                </entry>
                <!--更多的订阅添加entry节点即可-->
            </map>
        </property>
    </bean>

</beans>


text:
set -e
echo "${OS_DISTRO}: Managing keystone users"
################################################################################
. /etc/os-container.env
. /opt/harbor/service-hosts.sh
. /opt/harbor/harbor-common.sh
. /opt/harbor/magnum/vars.sh
. /opt/harbor/magnum/manage/env-keystone-admin-auth.sh

################################################################################
check_required_vars OS_DOMAIN \
                    AUTH_MAGNUM_KEYSTONE_TRUSTEE_REGION \
                    AUTH_MAGNUM_KEYSTONE_TRUSTEE_DOMAIN \
                    AUTH_MAGNUM_KEYSTONE_TRUSTEE_PROJECT_DOMAIN \
                    AUTH_MAGNUM_KEYSTONE_TRUSTEE_PROJECT \
                    AUTH_MAGNUM_KEYSTONE_TRUSTEE_PROJECT_USER_ROLE \
                    AUTH_MAGNUM_KEYSTONE_TRUSTEE_USER \
                    AUTH_MAGNUM_KEYSTONE_TRUSTEE_PASSWORD

################################################################################
AUTH_MAGNUM_KEYSTONE_TRUSTEE_DOMAIN_ID=$(openstack domain create --or-show --enable -f value -c id \
    --description="Service Domain for ${OS_DOMAIN}/${AUTH_MAGNUM_KEYSTONE_TRUSTEE_REGION}" \
    "${AUTH_MAGNUM_KEYSTONE_TRUSTEE_PROJECT_DOMAIN}")
openstack domain show "${AUTH_MAGNUM_KEYSTONE_TRUSTEE_DOMAIN_ID}"

################################################################################
AUTH_MAGNUM_KEYSTONE_TRUSTEE_PROJECT_ID=$(openstack project create --or-show --enable -f value -c id \
    --domain="${AUTH_MAGNUM_KEYSTONE_TRUSTEE_DOMAIN_ID}" \
    --description="Service Project for ${OS_DOMAIN}/${AUTH_MAGNUM_KEYSTONE_TRUSTEE_REGION}" \
    "${AUTH_MAGNUM_KEYSTONE_TRUSTEE_PROJECT}")
openstack project show "${AUTH_MAGNUM_KEYSTONE_TRUSTEE_PROJECT_ID}"

################################################################################
AUTH_MAGNUM_KEYSTONE_TRUSTEE_USER_ID=$(openstack user create --or-show --enable -f value -c id \
    --domain="${AUTH_MAGNUM_KEYSTONE_TRUSTEE_DOMAIN_ID}" \
    --project-domain "${AUTH_MAGNUM_KEYSTONE_TRUSTEE_PROJECT_DOMAIN}" \
    --project="${AUTH_MAGNUM_KEYSTONE_TRUSTEE_PROJECT_ID}" \
    --description "Service User for ${OS_DOMAIN}/${AUTH_MAGNUM_KEYSTONE_TRUSTEE_REGION}/magnum" \
    --email="support@${OS_DOMAIN}" \
    --password="${AUTH_MAGNUM_KEYSTONE_TRUSTEE_PASSWORD}" \
    "${AUTH_MAGNUM_KEYSTONE_TRUSTEE_USER}")
openstack user show "${AUTH_MAGNUM_KEYSTONE_TRUSTEE_USER_ID}"

################################################################################
openstack role add \
          --user="${AUTH_MAGNUM_KEYSTONE_TRUSTEE_USER_ID}" \
          --user-domain="${AUTH_MAGNUM_KEYSTONE_TRUSTEE_DOMAIN_ID}" \
          --domain="${AUTH_MAGNUM_KEYSTONE_TRUSTEE_DOMAIN_ID}" \
          "${AUTH_MAGNUM_KEYSTONE_TRUSTEE_PROJECT_USER_ROLE}"

openstack role assignment list \
          --domain="${AUTH_MAGNUM_KEYSTONE_TRUSTEE_DOMAIN_ID}" \
          --role="${AUTH_MAGNUM_KEYSTONE_TRUSTEE_PROJECT_USER_ROLE}" \
          --user-domain="${AUTH_MAGNUM_KEYSTONE_TRUSTEE_DOMAIN_ID}" \
          --user="${AUTH_MAGNUM_KEYSTONE_TRUSTEE_USER_ID}"

################################################################################
openstack role add \
          --user="${AUTH_MAGNUM_KEYSTONE_TRUSTEE_USER_ID}" \
          --user-domain="${AUTH_MAGNUM_KEYSTONE_TRUSTEE_DOMAIN}" \
          --project-domain="${AUTH_MAGNUM_KEYSTONE_TRUSTEE_PROJECT_DOMAIN}" \
          --project="${AUTH_MAGNUM_KEYSTONE_TRUSTEE_PROJECT_ID}" \
          "${AUTH_MAGNUM_KEYSTONE_TRUSTEE_PROJECT_USER_ROLE}"

openstack role assignment list \
          --project-domain="${AUTH_MAGNUM_KEYSTONE_TRUSTEE_PROJECT_DOMAIN}" \
          --project="${AUTH_MAGNUM_KEYSTONE_TRUSTEE_PROJECT_ID}" \
          --role="${AUTH_MAGNUM_KEYSTONE_TRUSTEE_PROJECT_USER_ROLE}" \
          --user-domain="${AUTH_MAGNUM_KEYSTONE_TRUSTEE_DOMAIN}" \
          --user="${AUTH_MAGNUM_KEYSTONE_TRUSTEE_USER_ID}"


text:
type Action = () => void;

/**
  * Convert a string to an integer.
  * @param s A string to convert into an integral number. eg: 123
  */
//% help=text/parse-int
//% blockId="string_parseint" block="parse to integer %text" blockNamespace="text"
//% text.defl="123"
//% blockHidden=1
function parseInt(text: string): number {
    return parseFloat(text) >> 0;
}

namespace helpers {
    export function arraySplice<T>(arr: T[], start: number, len: number) {
        if (start < 0) {
            return;
        }
        for (let i = 0; i < len; ++i) {
            arr.removeAt(start)
        }
    }

    export function arrayReverse<T>(arr: T[]): void {
        let len = arr.length;
        for (let i = 0; i < len / 2; i++) {
            swap(arr, i, len - i - 1);
        }
    }

    export function arrayShift<T>(arr: T[]): T {
        return arr.removeAt(0);
    }

    export function arrayJoin<T>(arr: T[], sep: string): string {
        let r = "";
        let len = arr.length // caching this seems to match V8
        for (let i = 0; i < len; ++i) {
            if (i > 0 && sep)
                r += sep;
            r += arr[i] || "";
        }
        return r;
    }

    /*TODO: Enable this multiple value unshift, after rest is enabled in our compiler.
        export function arrayUnshift<T>(arr: T[], ...values: T[]) : number {
            for(let i = values.length; i > 0; --i) {
                arr.insertAt(0, values[i - 1]);
            }
            return arr.length;
        }
    */
    export function arrayUnshift<T>(arr: T[], value: T): number {
        arr.insertAt(0, value);
        return arr.length;
    }

    function swap<T>(arr: T[], i: number, j: number): void {
        let temp: T = arr[i];
        arr[i] = arr[j];
        arr[j] = temp;
    }

    function sortHelper<T>(arr: T[], callbackfn?: (value1: T, value2: T) => number): T[] {
        if (arr.length <= 0 || !callbackfn) {
            return arr;
        }
        let len = arr.length;
        // simple selection sort.
        for (let i = 0; i < len - 1; ++i) {
            for (let j = i + 1; j < len; ++j) {
                if (callbackfn(arr[i], arr[j]) > 0) {
                    swap(arr, i, j);
                }
            }
        }
        return arr;
    }

    export function arraySort<T>(arr: T[], callbackfn?: (value1: T, value2: T) => number): T[] {
        if (!callbackfn) {
            //TODO: support native strings and number sorting
            /* callbackfn = function (value1: string, value2: string) : number {
                return value1.compare(value2);
                }*/
        }
        return sortHelper(arr, callbackfn);
    }

    export function arrayMap<T, U>(arr: T[], callbackfn: (value: T, index: number) => U): U[] {
        let res: U[] = []
        let len = arr.length // caching this seems to match V8
        for (let i = 0; i < len; ++i) {
            res.push(callbackfn(arr[i], i))
        }
        return res
    }

    export function arraySome<T>(arr: T[], callbackfn: (value: T, index: number) => boolean): boolean {
        let len = arr.length // caching this seems to match V8
        for (let i = 0; i < len; ++i)
            if (callbackfn(arr[i], i))
                return true;
        return false;
    }

    export function arrayEvery<T>(arr: T[], callbackfn: (value: T, index: number) => boolean): boolean {
        let len = arr.length // caching this seems to match V8
        for (let i = 0; i < len; ++i)
            if (!callbackfn(arr[i], i))
                return false;
        return true;
    }

    export function arrayForEach<T>(arr: T[], callbackfn: (value: T, index: number) => void): void {
        let len = arr.length // caching this seems to match V8
        for (let i = 0; i < len; ++i) {
            callbackfn(arr[i], i);
        }
    }

    export function arrayFilter<T>(arr: T[], callbackfn: (value: T, index: number) => boolean): T[] {
        let res: T[] = []
        let len = arr.length
        for (let i = 0; i < len; ++i) {
            let v = arr[i] // need to cache
            if (callbackfn(v, i)) res.push(v)
        }
        return res
    }

    export function arrayReduce<T, U>(arr: T[], callbackfn: (previousValue: U, currentValue: T, currentIndex: number) => U, initialValue: U): U {
        let len = arr.length
        for (let i = 0; i < len; ++i) {
            initialValue = callbackfn(initialValue, arr[i], i)
        }
        return initialValue
    }

    export function arraySlice<T>(arr: T[], start: number, end: number): T[] {
        const res: T[] = [];
        const len = arr.length;

        if (start < 0) {
            start = Math.max(len + start, 0);
        }

        if (end < 0) {
            end = len + end;
        }

        const sliceLength = end - start;

        for (let i = 0; i < sliceLength; ++i) {
            const index = i + start;
            if (index >= len) {
                break;
            }
            res.push(arr[index]);
        }
        return res;
    }

    export function stringSlice(s: string, start: number, end?: number): string {
        const len = s.length;

        if (start < 0) {
            start = Math.max(len + start, 0);
        }

        if (end == null) {
            end = len;
        }

        if (end < 0) {
            end = len + end;
        }

        return s.substr(start, end - start);
    }
}

namespace Math {
    export function clamp(min: number, max: number, value: number): number {
        return Math.min(max, Math.max(min, value));
    }

    /**
      * Returns the absolute value of a number (the value without regard to whether it is positive or negative).
      * For example, the absolute value of -5 is the same as the absolute value of 5.
      * @param x A numeric expression for which the absolute value is needed.
      */
    export function abs(x: number): number {
        return x < 0 ? -x : x;
    }

    /**
      * Returns the sign of the x, indicating whether x is positive, negative or zero.
      * @param x The numeric expression to test
      */
    export function sign(x: number): number {
        if (x == 0) return 0;
        if (x > 0) return 1;
        return -1;
    }

    /**
      * Returns the larger of two supplied numeric expressions.
      */
    export function max(a: number, b: number): number {
        if (a >= b) return a;
        return b;
    }

    /**
      * Returns the smaller of two supplied numeric expressions.
      */
    export function min(a: number, b: number): number {
        if (a <= b) return a;
        return b;
    }

    /**
     * Rounds ``x`` to a number with the given number of ``digits``
     * @param x the number to round
     * @param digits the number of resulting digits
     */
    //%
    export function roundWithPrecision(x: number, digits: number): number {
        digits = digits | 0;
        // invalid digits input
        if (digits <= 0) return Math.round(x);
        if (x == 0) return 0;
        let r = 0;
        do {
            const d = Math.pow(10, digits);
            r = Math.round(x * d) / d;
            digits++;
        } while (r == 0 && digits < 21);
        return r;
    }
}

//% blockHidden=1
namespace __internal {
    /**
     * A shim to render a boolean as a down/up toggle
     */
    //% shim=TD_ID blockHidden=1
    //% blockId=toggleDownUp block="%down"
    //% down.fieldEditor=toggledownup
    //% down.fieldOptions.decompileLiterals=true
    export function __downUp(down: boolean): boolean {
        return down;
    }

    /**
     * A shim to render a boolean as a up/down toggle
     */
    //% shim=TD_ID blockHidden=1
    //% blockId=toggleUpDown block="%up"
    //% up.fieldEditor=toggleupdown
    //% up.fieldOptions.decompileLiterals=true
    export function __upDown(up: boolean): boolean {
        return up;
    }

    /**
     * A shim to render a boolean as a high/low toggle
     */
    //% shim=TD_ID blockHidden=1
    //% blockId=toggleHighLow block="%high"
    //% high.fieldEditor=togglehighlow
    //% high.fieldOptions.decompileLiterals=true
    export function __highLow(high: boolean): boolean {
        return high;
    }

    /**
     * A shim to render a boolean as a on/off toggle
     */
    //% shim=TD_ID blockHidden=1
    //% blockId=toggleOnOff block="%on"
    //% on.fieldEditor=toggleonoff
    //% on.fieldOptions.decompileLiterals=true
    export function __onOff(on: boolean): boolean {
        return on;
    }

    /**
     * A shim to render a boolean as a yes/no toggle
     */
    //% shim=TD_ID blockHidden=1
    //% blockId=toggleYesNo block="%yes"
    //% yes.fieldEditor=toggleyesno
    //% yes.fieldOptions.decompileLiterals=true
    export function __yesNo(yes: boolean): boolean {
        return yes;
    }

    /**
     * Get the color wheel field editor
     * @param color color, eg: #ff0000
     */
    //% blockId=colorNumberPicker block="%value"
    //% blockHidden=true
    //% shim=TD_ID colorSecondary="#FFFFFF"
    //% value.fieldEditor="colornumber" value.fieldOptions.decompileLiterals=true
    //% value.defl='#ff0000'
    //% value.fieldOptions.colours='["#ff0000","#ff8000","#ffff00","#ff9da5","#00ff00","#b09eff","#00ffff","#007fff","#65471f","#0000ff","#7f00ff","#ff0080","#ff00ff","#ffffff","#999999","#000000"]'
    //% value.fieldOptions.columns=4 value.fieldOptions.className='rgbColorPicker'
    export function __colorNumberPicker(value: number) {
        return value;
    }

    /**
     * Get the color wheel field editor
     * @param value value between 0 to 255 to get a color value, eg: 10
     */
    //% blockId=colorWheelPicker block="%value"
    //% blockHidden=true
    //% shim=TD_ID colorSecondary="#FFFFFF"
    //% value.fieldEditor="colorwheel" value.fieldOptions.decompileLiterals=true
    //% value.fieldOptions.sliderWidth='200'
    //% value.fieldOptions.min=0 value.fieldOptions.max=255
    export function __colorWheelPicker(value: number) {
        return value;
    }

    /**
    * Get the color wheel field editor using HSV values
    * @param value value between 0 to 255 to get a color value, eg: 10
    */
    //% blockId=colorWheelHsvPicker block="%value"
    //% blockHidden=true
    //% shim=TD_ID colorSecondary="#FFFFFF"
    //% value.fieldEditor="colorwheel" value.fieldOptions.decompileLiterals=true
    //% value.fieldOptions.sliderWidth='200'
    //% value.fieldOptions.min=0 value.fieldOptions.max=255
    //% value.fieldOptions.channel=hsvfast
    export function __colorWheelHsvPicker(value: number) {
        return value;
    }

    /**
     * A speed picker
     * @param speed the speed, eg: 50
     */
    //% blockId=speedPicker block="%speed" shim=TD_ID
    //% speed.fieldEditor="speed" colorSecondary="#FFFFFF"
    //% weight=0 blockHidden=1 speed.fieldOptions.decompileLiterals=1
    export function __speedPicker(speed: number): number {
        return speed;
    }

    /**
     * A turn ratio picker
     * @param turnratio the turn ratio, eg: 0
     */
    //% blockId=turnRatioPicker block="%turnratio" shim=TD_ID
    //% turnratio.fieldEditor="turnratio" colorSecondary="#FFFFFF"
    //% weight=0 blockHidden=1 turnRatio.fieldOptions.decompileLiterals=1
    export function __turnRatioPicker(turnratio: number): number {
        return turnratio;
    }

    /**
     * A field editor that displays a protractor
     */
    //% blockId=protractorPicker block="%angle"
    //% shim=TD_ID
    //% angle.fieldEditor=protractor
    //% angle.fieldOptions.decompileLiterals=1
    //% colorSecondary="#FFFFFF"
    //% blockHidden=1
    export function __protractor(angle: number) {
        return angle;
    }

    /**
      * Get the time field editor
      * @param ms time duration in milliseconds, eg: 500, 1000
      */
    //% blockId=timePicker block="%ms"
    //% blockHidden=true shim=TD_ID
    //% colorSecondary="#FFFFFF"
    //% ms.fieldEditor="numberdropdown" ms.fieldOptions.decompileLiterals=true
    //% ms.fieldOptions.data='[["100 ms", 100], ["200 ms", 200], ["500 ms", 500], ["1 second", 1000], ["2 seconds", 2000]]'
    export function __timePicker(ms: number): number {
        return ms;
    }
}


text:
'use strict';

// Declare app level module which depends on filters, and services
angular.module('myApp', [
  'ngRoute',
  'myApp.filters',
  'myApp.services',
  'myApp.directives',
  'myApp.controllers'
])
.run(function(editableOptions){
  editableOptions.theme = "bs3";
});


text:
package newrelic_test

import (
	"fmt"
	"github.com/inteleon/snap-plugin-collector-newrelic/newrelic"
	"github.com/intelsdi-x/snap-plugin-lib-go/v1/plugin"
	nr "github.com/yfronto/newrelic"
	"strings"
	"testing"
)

type apmClientTestImpl struct {
	appIDs           []int
	metricDataAppIDs []int
	metricDataNames  map[int][]string
}

func (a *apmClientTestImpl) GetApplication(appID int) (*nr.Application, error) {
	a.appIDs = append(a.appIDs, appID)

	return &nr.Application{
		ApplicationSummary: nr.ApplicationSummary{
			ResponseTime: 13.37,
		},
		HealthStatus: "awesome",
		Reporting:    true,
	}, nil
}

func TestGetAppMetricTypesSuccess(t *testing.T) {
	a := &newrelic.APM{}

	metrics, err := a.GetMetricTypes(plugin.Config{})

	if err != nil {
		t.Fatal(err)
	}

	expectedLen := len(newrelic.APMMetrics)
	if len(metrics) != expectedLen {
		t.Fatal("expected", expectedLen, "got", len(metrics))
	}

	for i, m := range metrics {
		expectedNS := fmt.Sprintf("inteleon/newrelic/apm/%s", strings.Join(newrelic.APMMetrics[i].Namespace.Strings(), "/"))
		ns := strings.Join(m.Namespace.Strings(), "/")
		t.Log(ns)

		if ns != expectedNS {
			t.Fatal("expected", expectedNS, "got", ns)
		}
	}
}

func TestCollectAppMetricsAppIDSuccess(t *testing.T) {
	apmClient := &apmClientTestImpl{}

	a := &newrelic.APM{
		APMClient: apmClient,
	}

	metrics := []plugin.Metric{
		{
			Namespace: plugin.NewNamespace("inteleon", "newrelic", "apm", "application", "1337", "show", "health", "status"),
			Tags: map[string]string{
				"Type": "application",
				"Path": "HealthStatus",
				"Unit": "string",
			},
		},
		{
			Namespace: plugin.NewNamespace("inteleon", "newrelic", "apm", "application", "1234", "show", "health", "status"),
			Tags: map[string]string{
				"Type": "application",
				"Path": "HealthStatus",
				"Unit": "string",
			},
		},
		{
			Namespace: plugin.NewNamespace("inteleon", "newrelic", "apm", "application", "1337", "show", "summary", "application", "response_time"),
			Tags: map[string]string{
				"Type": "application",
				"Path": "ApplicationSummary/ResponseTime",
				"Unit": "float",
			},
		},
		{
			Namespace: plugin.NewNamespace("inteleon", "newrelic", "apm", "application", "1337", "show", "reporting"),
			Tags: map[string]string{
				"Type": "application",
				"Path": "Reporting",
				"Unit": "bool",
			},
		},
	}

	ret, err := a.CollectMetrics(metrics)
	if err != nil {
		t.Fatal(err)
	}

	if len(ret) != 4 {
		t.Fatal("expected", 4, "got", len(ret))
	}

	for _, m := range ret[:2] {
		if m.Data.(string) != "awesome" {
			t.Fatal("expected", "awesome", "got", m.Data.(string))
		}
	}

	appResponseTimeData := ret[2].Data.(float64)
	if appResponseTimeData != 13.37 {
		t.Fatal("expected", 13.37, "got", appResponseTimeData)
	}

	if !ret[3].Data.(bool) {
		t.Fatal("expected", true, "got", false)
	}

	if len(apmClient.appIDs) != 2 {
		t.Fatal("expected", 2, "got", len(apmClient.appIDs))
	}

	expectedIDs := []int{1337, 1234}
	for i, id := range apmClient.appIDs {
		if id != expectedIDs[i] {
			t.Fatal("expected", expectedIDs[i], "got", id)
		}
	}
}


text:
ACCEPTED

#### According to
Index Fungorum

#### Published in
Boln Soc. Micol. Madrid 31: 78 (2007)

#### Original name
Rhodocybe formosa Vila, Contu, F. Caballero & A. Ortega

### Remarks
null


text:
from __future__ import absolute_import, division, print_function, unicode_literals

import logging
import subprocess
import sys
import os
import re

try:
    import benchexec.util as util
    import benchexec.result as result
    from benchexec.tools.template import BaseTool
except ImportError:
    # fall-back solution (at least for now)
    import symbiotic.benchexec.util as util
    import symbiotic.benchexec.result as result
    from symbiotic.benchexec.tools.template import BaseTool

from . tool import SymbioticBaseTool

SOFTTIMELIMIT = 'timelimit'

class SymbioticTool(BaseTool, SymbioticBaseTool):
    """
    Tool info for CPAchecker.
    It has additional features such as building CPAchecker before running it
    if executed within a source checkout.
    It also supports extracting data from the statistics output of CPAchecker
    for adding it to the result tables.
    """
    def __init__(self, opts):
        SymbioticBaseTool.__init__(self, opts)

    def executable(self):
        return util.find_executable('ikos')

    def version(self, executable):
        stdout = self._version_from_tool(executable, '--version')
        line = next(l for l in stdout.splitlines() if l.startswith('ikos'))
        line = line.replace('ikos' , '')
        return line.strip()

    def name(self):
        return 'ikos'

    def cmdline(self, executable, options, tasks, propertyfile=None, rlimits={}):
        opts = ['-d=dbm']

        if self._options.property.assertions():
            opts.append('-a=prover')
        elif self._options.property.memsafety():
            opts.append('-a=boa')
            opts.append('-a=nullity')
            opts.append('-a=dfa')
        elif self._options.property.signedoverflow():
            opts.append('-a=sio')

        return [executable] + options + opts + tasks

    def determine_result(self, returncode, returnsignal, output, isTimeout):
        # TODO: fixme for memsafety
        for line in output:
            if 'error: double free' in line:
                return result.RESULT_FALSE_FREE
            elif 'error: buffer overflow' in line:
                return result.RESULT_FALSE_DEREF
            elif 'error: assertion never holds' in line:
                return result.RESULT_FALSE_REACH
            elif 'The program is SAFE' in line:
                return result.RESULT_TRUE_PROP
            elif 'The program is potentially UNSAFE' in line:
                return result.RESULT_UNKNOWN

        return result.RESULT_ERROR

    def llvm_version(self):
        """
        Return required version of LLVM
        """
        return '7.0.1'


text:
using System.Runtime.InteropServices;

namespace NetworkTables.Native
{
    internal class NtRpcDefinition
    {
        public readonly uint Version;
        public readonly string Name;
        public readonly NtRpcParamDef[] ParamsArray;
        public readonly NtRpcResultDef[] ResultsArray;

        public NtRpcDefinition(uint version, string name, NtRpcParamDef[] p, NtRpcResultDef[] r)
        {
            Version = version;
            Name = name;
            ParamsArray = p;
            ResultsArray = r;
        }
    }

    internal class NtRpcResultDef
    {
        public readonly string Name;
        public readonly NtType Type;

        public NtRpcResultDef(string name, NtType type)
        {
            Name = name;
            Type = type;
        }
    }

    internal class NtRpcParamDef
    {
        public readonly string Name;
        public readonly RpcValue Value;

        public NtRpcParamDef(string name, RpcValue value)
        {
            Value = value;
            Name = name;
        }
    }

    [StructLayout(LayoutKind.Sequential)]
    internal struct NtRpcCallInfo
    {
#pragma warning disable 649
        public readonly uint RpcId;
        public readonly uint CallUid;
        public readonly NtStringRead Name;
        public readonly NtStringRead Param;
#pragma warning restore 649
    }
}


text:
package demos.j2d;

import gleem.linalg.Vec2f;

import java.awt.Font;
import java.awt.Frame;
import java.awt.event.WindowAdapter;
import java.awt.event.WindowEvent;
import java.awt.geom.Rectangle2D;

import javax.media.opengl.GL;
import javax.media.opengl.GLAutoDrawable;
import javax.media.opengl.GLCapabilities;
import javax.media.opengl.GLEventListener;
import javax.media.opengl.GLProfile;
import javax.media.opengl.awt.GLCanvas;

import com.jogamp.opengl.util.Animator;
import com.jogamp.opengl.util.awt.TextRenderer;

import demos.gears.Gears;
import demos.util.FPSCounter;
import demos.util.SystemTime;
import demos.util.Time;

/** A simple test of the TextRenderer class. Draws gears underneath
    with moving Java 2D-rendered text on top. */

public class TestTextRenderer implements GLEventListener {
  public static void main(String[] args) {
    // set argument 'NotFirstUIActionOnProcess' in the JNLP's application-desc tag for example
    // <application-desc main-class="demos.j2d.TextCube"/>
    //   <argument>NotFirstUIActionOnProcess</argument>
    // </application-desc>
    boolean firstUIActionOnProcess = 0==args.length || !args[0].equals("NotFirstUIActionOnProcess") ;
    GLProfile.initSingleton();

    Frame frame = new Frame("Text Renderer Test");
    GLCapabilities caps = new GLCapabilities(null);
    caps.setAlphaBits(8);
    GLCanvas canvas = new GLCanvas(caps);
    canvas.addGLEventListener(new Gears());
    canvas.addGLEventListener(new TestTextRenderer());
    frame.add(canvas);
    frame.setSize(512, 512);
    final Animator animator = new Animator(canvas);
    frame.addWindowListener(new WindowAdapter() {
        public void windowClosing(WindowEvent e) {
          // Run this on another thread than the AWT event queue to
          // make sure the call to Animator.stop() completes before
          // exiting
          new Thread(new Runnable() {
              public void run() {
                animator.stop();
                System.exit(0);
              }
            }).start();
        }
      });

    frame.setVisible(true);
    animator.start();
  }

  private TextRenderer renderer;
  private Time time;
  private Font font;
  private Vec2f velocity = new Vec2f(100.0f, 150.0f);
  private Vec2f position;
  private String TEST_STRING = "Java 2D Text";
  private int textWidth;
  private int textHeight;
  private FPSCounter fps;

  public void init(GLAutoDrawable drawable) {
    GL gl = drawable.getGL();

    // Don't artificially slow us down, at least on platforms where we
    // have control over this (note: on X11 platforms this may not
    // have the effect of overriding the setSwapInterval(1) in the
    // Gears demo)
    gl.setSwapInterval(0);

    renderer = new TextRenderer(new Font("SansSerif", Font.BOLD, 36));
    time = new SystemTime();
    ((SystemTime) time).rebase();

    // Start the text half way up the left side
    position = new Vec2f(0.0f, drawable.getHeight() / 2);
    Rectangle2D textBounds = renderer.getBounds(TEST_STRING);
    textWidth = (int) textBounds.getWidth();
    textHeight = (int) textBounds.getHeight();

    fps = new FPSCounter(drawable, 36);
  }

  public void dispose(GLAutoDrawable drawable) {
    renderer = null;
    position = null;
    time = null;
  }

  public void display(GLAutoDrawable drawable) {
    time.update();

    // Compute the next position of the text
    position = position.plus(velocity.times((float) time.deltaT()));
    // Figure out whether we have to switch directions
    if (position.x() < 0) {
      velocity.setX(Math.abs(velocity.x()));
    } else if (position.x() + textWidth > drawable.getWidth()) {
      velocity.setX(-1.0f * Math.abs(velocity.x()));
    }
    if (position.y() < 0) {
      velocity.setY(Math.abs(velocity.y()));
    } else if (position.y() + textHeight > drawable.getHeight()) {
      velocity.setY(-1.0f * Math.abs(velocity.y()));
    }

    GL gl = drawable.getGL();

    // Prepare to draw text
    renderer.beginRendering(drawable.getWidth(), drawable.getHeight());

    // Draw text
    renderer.draw(TEST_STRING, (int) position.x(), (int) position.y());

    // Draw FPS
    fps.draw();

    // Clean up rendering
    renderer.endRendering();
  }

  // Unused methods
  public void reshape(GLAutoDrawable drawable, int x, int y, int width, int height) {}
  public void displayChanged(GLAutoDrawable drawable, boolean modeChanged, boolean deviceChanged) {}
}


text:
namespace NExpect.Interfaces;

/// <summary>
/// Provides the .Ending for the count-match continuation
/// grammar
/// </summary>
public interface ICountMatchContinuationOfStringCollectionEnding
{
}


text:
{{:: 'clients' | translate}}

{{client.clientId}}

{{:: 'authz-authorization' | translate}}

{{:: 'authz-resources' | translate}}

{{:: 'authz-add-resource' | translate}}

{{originalResource.name}}

{{:: 'authz-add-resource' | translate}}

{{originalResource.name|capitalize}}

    <form class="form-horizontal" name="clientForm" novalidate>
        <fieldset class="border-top">

                {{:: 'name' | translate}} *

                    <input class="form-control" type="text" id="name" name="name" data-ng-model="resource.name" autofocus required data-ng-blur="checkNewNameAvailability()">

                <kc-tooltip>{{:: 'authz-resource-name.tooltip' | translate}}</kc-tooltip>

                {{:: 'authz-owner' | translate}}

                    <input class="form-control" type="text" id="resource.owner.name" name="name" data-ng-model="resource.owner.name" autofocus disabled>

                <kc-tooltip>{{:: 'authz-resource-owner.tooltip' | translate}}</kc-tooltip>

                {{:: 'type' | translate}}

                    <input class="form-control" type="text" id="type" name="name" data-ng-model="resource.type" autofocus>

                <kc-tooltip>{{:: 'authz-resource-type.tooltip' | translate}}</kc-tooltip>

                {{:: 'authz-uri' | translate}}

                    <input class="form-control" type="text" id="uri" name="name" data-ng-model="resource.uri" autofocus>

                <kc-tooltip>{{:: 'authz-resource-uri.tooltip' | translate}}</kc-tooltip>

                {{:: 'authz-scopes' | translate}}

                    <input type="hidden" ui-select2="scopesUiSelect" id="scopes" data-ng-model="resource.scopes" data-placeholder="{{:: 'authz-select-scope' | translate}}..." multiple/>

                <kc-tooltip>{{:: 'authz-resource-scopes.tooltip' | translate}}</kc-tooltip>

                {{:: 'authz-icon-uri' | translate}}

                    <input class="form-control" type="text" id="iconUri" name="name" data-ng-model="resource.icon_uri" autofocus>

                <kc-tooltip>{{:: 'authz-icon-uri.tooltip' | translate}}</kc-tooltip>

        </fieldset>

                <button kc-save data-ng-disabled="!changed">{{:: 'save' | translate}}</button>
                <button kc-reset data-ng-disabled="!changed">{{:: 'cancel' | translate}}</button>

    </form>

<kc-menu></kc-menu>


text:
function r = rank(A, tol)
%RANK   Rank of an array-valued CHEBFUN.
%   RANK(A) produces an estimate of the number of linearly independent columns
%   (or rows) of A.
%
%   RANK(A, TOL) is the number of singular values of A greater than TOL.
%
% See also SVD, QR.

% Copyright 2014 by The University of Oxford and The Chebfun Developers.
% See http://www.chebfun.org/ for Chebfun information.

% Compute the singular values:
s = svd(A);

% Choose a tolerance if none is given:
if ( nargin == 1 )
	tol = max(length(A)*eps(max(s)), vscale(A)*epslevel(A));
end

% Compute the rank:
r = sum(s > tol);

end


text:
$packageName = 'TeraTerm'
$installerType = 'EXE' #only one of these: exe, msi, msu
$url = 'http://en.sourceforge.jp/frs/redir.php?m=iij&f=%2Fttssh2%2F61906%2Fteraterm-4.84.exe'
$silentArgs = '/VERYSILENT /SUPPRESSMSGBOXES /NORESTART /SP-'
$validExitCodes = @(0)

Install-ChocolateyPackage "$packageName" "$installerType" "$silentArgs" "$url" -validExitCodes $validExitCodes


text:
using ObjectMapper.Interfaces;
using System;

namespace ObjectMapper.Mapper
{
    /// <summary>
    ///   Represents a two way map between two properties on two objects.
    /// </summary>
    /// <typeparam name="TypeOne">First object.</typeparam>
    /// <typeparam name="TypeTwo">Second object.</typeparam>
    /// <typeparam name="PropertyType">Type of the property on both TypeOne and TypeTwo.</typeparam>
    public struct PropertyMap<TypeOne, TypeTwo, PropertyType> : IPropertyMap<TypeOne, TypeTwo, PropertyType>
    {
        /// <summary>
        /// Get and Set properties for a property on TypeOne
        /// </summary>
        public IProperty<TypeOne, PropertyType> TypeOneAccessor { get; private set; }

        /// <summary>
        /// Get and Set properties for a property on TypeTwo.
        /// </summary>
        public IProperty<TypeTwo, PropertyType> TypeTwoAccessor { get; private set; }

        /// <summary>
        ///   Instantiates this class with both accessors to both TypeOne and TypeTwo.
        /// </summary>
        /// <param name="typeOneAccessor">Both get and set methods for a property on TypeOne.</param>
        /// <param name="typeTwoAccessor">Both get and set methods for a property on TypeTwo.</param>
        public PropertyMap(IProperty<TypeOne, PropertyType> typeOneAccessor, IProperty<TypeTwo, PropertyType> typeTwoAccessor) : this()
        {
            this.TypeOneAccessor = typeOneAccessor;
            this.TypeTwoAccessor = typeTwoAccessor;
        }

        /// <summary>
        ///   Instantiates this class with getters and setters for a property on TypeOne and TypeTwo.
        ///   Points to the other PropertyMap constructor.
        /// </summary>
        /// <param name="t1Getter">Getter for a property on TypeOne.</param>
        /// <param name="t1Setter">Setter for a property on TypeOne.</param>
        /// <param name="t2Getter">Getter for a property on TypeTwo.</param>
        /// <param name="t2Setter">Setter for a property on TypeTwo.</param>
        public PropertyMap(Func<TypeOne, PropertyType> t1Getter, Action<PropertyType, TypeOne> t1Setter, Func<TypeTwo, PropertyType> t2Getter, Action<PropertyType, TypeTwo> t2Setter)
            : this(new Property<TypeOne, PropertyType>(t1Getter, t1Setter), new Property<TypeTwo, PropertyType>(t2Getter, t2Setter))
        { }

        /// <summary>
        ///   Instantiates this class with a getter for T1 and a setter for T2.
        ///   Acts as a one way map from T1 to T2
        /// </summary>
        /// <param name="t1Getter"></param>
        /// <param name="t2Setter"></param>
        public PropertyMap(Func<TypeOne, PropertyType> t1Getter, Action<PropertyType, TypeTwo> t2Setter) : this()
        {
            this.TypeOneAccessor = new Property<TypeOne, PropertyType>(t1Getter);
            this.TypeTwoAccessor = new Property<TypeTwo, PropertyType>(t2Setter);
        }
    }
}


text:
var loadList = [];
var descList =["
Figure :
1m by 0.8m
max displacement = 17.7205 mm

","
Figure :
1.2m by 0.9m
max displacement = 32.4562 mm

","
Figure :
1.3m by 1m
max displacement = 96.8244 mm

","
Figure:
1.2m by 1m
	max displacement = 50.0976 mm

"];
var globalX,globalY;
var convFactor = 40;
var scaleFactor = 100;
var hasSimulated=false;
//canvas setup
//
function setup(){
	var canvas = document.getElementById('myCanvas');;
	ctx = canvas.getContext('2d');
	var w = canvas.width = 800;
	h = canvas.height = 800;
	canvas.addEventListener('mousemove', function(e) {
		var x = e.pageX - canvas.offsetLeft;
		var y = e.pageY - canvas.offsetTop;
		globalX = x;
		globalY = canvas.height-y;

		$("#x").val(x/convFactor);
		$("#y").val(globalY/convFactor);
		$("#footingX").val(x/convFactor);
		$("#footingY").val(globalY/convFactor);

	}, 0);
	canvas.style.border = "black 1px solid";

}

//event listeners
//

$("#myCanvas").click(function(){
	$("#height").val("");
	$("#width").val("");
	$("#load").val("");
	if(hasSimulated)
	{
		$('#SimModal').modal('show');
	}
	else {
		$('#loadModal').modal('show');
	}

	var myCanvas = $('#myCanvas');
	var canvas = document.getElementById('myCanvas');;
	ctx = canvas.getContext('2d');
	myCanvas.drawLayers();
});

$("#submitLoad").click(function(){
	var myCanvas = $('#myCanvas');
	$('#loadModal').modal('hide');
	var width = ($("#width")).val()*convFactor/100;
	var height = ($("#height").val()*convFactor)/100;
	var xInput = $("#x").val()*convFactor;
	var yInput = $("#y").val()*convFactor;
	var loadWeight = $("#load").val()*1;
	var radius = width > height ? height : width;

	var footingWidth = ($("#footingWidth")).val()*convFactor;
	var footingHeight = ($("#footingHeight").val()*convFactor);
	var xfooting = $("#x").val()*convFactor;
	var yfooting = $("#y").val()*convFactor;
	var thickness = $("#thickness").val()*1;

	var canvas = document.getElementById('myCanvas');;
	ctx = canvas.getContext('2d');

	var normY = canvas.height-yInput; //normalize Y coordinates
	var loadIDtemp = loadList.length;
	console.log($("#index").val()+"index");
	if($("#index").val()=="")
	{
		$("#index").val(loadIDtemp);
	}
	loadList.push(new Load( $("#height").val(),$("#width").val(),xInput/convFactor,yInput/convFactor,loadWeight,footingWidth/convFactor,footingHeight/convFactor, thickness));
	console.log(loadList.length);

	myCanvas.drawRect({
		fillStyle: '#c2c2c2',
		strokeStyle: 'black',
		draggable: false,
		strokeWidth: 4,
		layer: true,
		x: xfooting, y: canvas.height-yfooting,
		fromCenter: true,
		width: footingWidth,
		height: footingHeight
	});
	myCanvas.drawRect({
		fillStyle: 'steelblue',
		strokeStyle: 'black',
		draggable: false,
		strokeWidth: 4,
		x: xInput, y: normY,
		fromCenter: true,
		width: width,
		height: height,
		layer: true,
		data: {loadID:loadIDtemp},
		click: function(layer)
		{
			$("#resultImg").attr("src","http://192.168.175.135/swiftsim/results/temp/"+((layer.data.loadID%4)+1)+".PNG");
			$("#resultDesc").html(descList[layer.data.loadID]);
			console.log(layer.data.loadID);
			$("#x").val(loadList[layer.data.loadID].x);
			$("#y").val(loadList[layer.data.loadID].y);
			$("#load").val(loadList[layer.data.loadID].loadWeight);
			$("#height").val(loadList[layer.data.loadID].height);
			$("#width").val(loadList[layer.data.loadID].width);
			$("#footingWidth").val(loadList[layer.data.loadID].footingWidth);
			$("#footingHeight").val(loadList[layer.data.loadID].footingHeight);
			$("#thickness").val(loadList[layer.data.loadID].footingThickness);
			myCanvas.drawLayers();

		}
	});

	//clear variables
	var width = $("#width").val("");
	var height = $("#height").val("");
	$("#index").val("");
	$("#load").val("");
});

$("#submitFooting").click(function(){
	var myCanvas = $('#myCanvas');
	$('#loadModal').modal('hide');
	var width = ($("#footingWidth")).val()*convFactor/100;
	var height = ($("#footingHeight").val()*convFactor)/100;
	var xInput = $("#footingX").val()*convFactor;
	var yInput = $("#footingY").val()*convFactor;

	var radius = width > height ? height : width;

	var canvas = document.getElementById('myCanvas');;
	ctx = canvas.getContext('2d');

	var normY = canvas.height-yInput; //normalize Y coordinates
	myCanvas.drawRect({
		fillStyle: '#c2c2c2',
		strokeStyle: 'black',
		draggable: true,
		strokeWidth: 4,
		x: xInput, y: normY,
		fromCenter: true,
		width: width,
		height: height
	});
});

$("#addLoad").click(function(){
		$("#x").val("");
		$("#y").val("");
});

$("#soiltype li").on('click', function(){
    $('#ddMenu').html($(this).text());
});

function getLoads()
{
	for(i=0;i<loadList.length;i++)
	{
			console.log(loadList[i]);
	}
}
$("#simulate").click(function(){
	if(!hasSimulated)
	{
		hasSimulated=true;
		$("#simulate").html("Simulation Successful");
	}
	else {
		hasSimulated=false;
		$("#simulate").html("Start Simulation");
	}

});


text:
``Isomap``
============================================================================

.. autoclass:: ibex.sklearn.manifold.Isomap
    :members:
    :special-members:
    :show-inheritance:


text:
function msBatchGenerateBehav(dirName)
%MSBATCHGENERATEBEHAV Summary of this function goes here
%   Detailed explanation goes here
    dataFolders = msBatchFindBehavFolders(dirName,[]);
    figureNum = 0;
    for folderNum = 1:length(dataFolders)
        currentFolder = dataFolders{folderNum};
        dirData = dir(currentFolder);
        dirIndex = [dirData.isdir];
        fileList = {dirData(~dirIndex).name};
        figureNum = figureNum+1;

        if (sum(ismember(fileList,'behav.mat')) == 0)
           %Generate ms data structure
           display(['Generating ms.mat and calculating good frames and correcting DAC for ' currentFolder]);
           behav = msGenerateVideoObj(currentFolder,'behavCam');

           save([currentFolder '\behav.mat'],'behav','-v7.3')
        end
    end
end


text:
package CPANPLUS::Module::Author::Fake;

use CPANPLUS::Module::Author;
use CPANPLUS::Internals;
use CPANPLUS::Error;

use strict;
use vars            qw[@ISA];
use Params::Check   qw[check];

@ISA = qw[CPANPLUS::Module::Author];

$Params::Check::VERBOSE = 1;

=pod

=head1 NAME

CPANPLUS::Module::Author::Fake

=head1 SYNOPSIS

    my $auth = CPANPLUS::Module::Author::Fake->new(
                    author  => 'Foo Bar',
                    email   => 'luser@foo.com',
                    cpanid  => 'FOO',
                    _id     => $cpan->id,
                );

=head1 DESCRIPTION

A class for creating fake author objects, for shortcut use internally
by CPANPLUS.

Inherits from C<CPANPLUS::Module::Author>.

=head1 METHODS

=head2 new( _id => DIGIT )

Creates a dummy author object. It can take the same options as
C<< CPANPLUS::Module::Author->new >>, but will fill in default ones
if none are provided. Only the _id key is required.

=cut

sub new {
    my $class = shift;
    my %hash  = @_;

    my $tmpl = {
        author  => { default => 'CPANPLUS Internals' },
        email   => { default => 'cpanplus-info@lists.sf.net' },
        cpanid  => { default => 'CPANPLUS' },
        _id     => { default => CPANPLUS::Internals->_last_id },
    };

    my $args = check( $tmpl, \%hash ) or return;

    my $obj = CPANPLUS::Module::Author->new( %$args ) or return;

    unless( $obj->_id ) {
        error(loc("No '%1' specified -- No CPANPLUS object associated!",'_id'));
        return;
    }

    ### rebless object ###
    return bless $obj, $class;
}

1;

# Local variables:
# c-indentation-style: bsd
# c-basic-offset: 4
# indent-tabs-mode: nil
# End:
# vim: expandtab shiftwidth=4:


text:
package github

import (
	"context"
	"fmt"
	"net/http"
	"reflect"
	"testing"
)

func TestRepositoriesService_GetPagesInfo(t *testing.T) {
	client, mux, _, teardown := setup()
	defer teardown()

	mux.HandleFunc("/repos/o/r/pages", func(w http.ResponseWriter, r *http.Request) {
		testMethod(t, r, "GET")
		testHeader(t, r, "Accept", mediaTypePagesPreview)
		fmt.Fprint(w, `{"url":"u","status":"s","cname":"c","custom_404":false,"html_url":"h"}`)
	})

	page, _, err := client.Repositories.GetPagesInfo(context.Background(), "o", "r")
	if err != nil {
		t.Errorf("Repositories.GetPagesInfo returned error: %v", err)
	}

	want := &Pages{URL: String("u"), Status: String("s"), CNAME: String("c"), Custom404: Bool(false), HTMLURL: String("h")}
	if !reflect.DeepEqual(page, want) {
		t.Errorf("Repositories.GetPagesInfo returned %+v, want %+v", page, want)
	}
}

func TestRepositoriesService_ListPagesBuilds(t *testing.T) {
	client, mux, _, teardown := setup()
	defer teardown()

	mux.HandleFunc("/repos/o/r/pages/builds", func(w http.ResponseWriter, r *http.Request) {
		testMethod(t, r, "GET")
		fmt.Fprint(w, `[{"url":"u","status":"s","commit":"c"}]`)
	})

	pages, _, err := client.Repositories.ListPagesBuilds(context.Background(), "o", "r", nil)
	if err != nil {
		t.Errorf("Repositories.ListPagesBuilds returned error: %v", err)
	}

	want := []*PagesBuild{{URL: String("u"), Status: String("s"), Commit: String("c")}}
	if !reflect.DeepEqual(pages, want) {
		t.Errorf("Repositories.ListPagesBuilds returned %+v, want %+v", pages, want)
	}
}

func TestRepositoriesService_ListPagesBuilds_withOptions(t *testing.T) {
	client, mux, _, teardown := setup()
	defer teardown()

	mux.HandleFunc("/repos/o/r/pages/builds", func(w http.ResponseWriter, r *http.Request) {
		testMethod(t, r, "GET")
		testFormValues(t, r, values{
			"page": "2",
		})
		fmt.Fprint(w, `[]`)
	})

	_, _, err := client.Repositories.ListPagesBuilds(context.Background(), "o", "r", &ListOptions{Page: 2})
	if err != nil {
		t.Errorf("Repositories.ListPagesBuilds returned error: %v", err)
	}
}

func TestRepositoriesService_GetLatestPagesBuild(t *testing.T) {
	client, mux, _, teardown := setup()
	defer teardown()

	mux.HandleFunc("/repos/o/r/pages/builds/latest", func(w http.ResponseWriter, r *http.Request) {
		testMethod(t, r, "GET")
		fmt.Fprint(w, `{"url":"u","status":"s","commit":"c"}`)
	})

	build, _, err := client.Repositories.GetLatestPagesBuild(context.Background(), "o", "r")
	if err != nil {
		t.Errorf("Repositories.GetLatestPagesBuild returned error: %v", err)
	}

	want := &PagesBuild{URL: String("u"), Status: String("s"), Commit: String("c")}
	if !reflect.DeepEqual(build, want) {
		t.Errorf("Repositories.GetLatestPagesBuild returned %+v, want %+v", build, want)
	}
}

func TestRepositoriesService_GetPageBuild(t *testing.T) {
	client, mux, _, teardown := setup()
	defer teardown()

	mux.HandleFunc("/repos/o/r/pages/builds/1", func(w http.ResponseWriter, r *http.Request) {
		testMethod(t, r, "GET")
		fmt.Fprint(w, `{"url":"u","status":"s","commit":"c"}`)
	})

	build, _, err := client.Repositories.GetPageBuild(context.Background(), "o", "r", 1)
	if err != nil {
		t.Errorf("Repositories.GetPageBuild returned error: %v", err)
	}

	want := &PagesBuild{URL: String("u"), Status: String("s"), Commit: String("c")}
	if !reflect.DeepEqual(build, want) {
		t.Errorf("Repositories.GetPageBuild returned %+v, want %+v", build, want)
	}
}

func TestRepositoriesService_RequestPageBuild(t *testing.T) {
	client, mux, _, teardown := setup()
	defer teardown()

	mux.HandleFunc("/repos/o/r/pages/builds", func(w http.ResponseWriter, r *http.Request) {
		testMethod(t, r, "POST")
		testHeader(t, r, "Accept", mediaTypePagesPreview)
		fmt.Fprint(w, `{"url":"u","status":"s"}`)
	})

	build, _, err := client.Repositories.RequestPageBuild(context.Background(), "o", "r")
	if err != nil {
		t.Errorf("Repositories.RequestPageBuild returned error: %v", err)
	}

	want := &PagesBuild{URL: String("u"), Status: String("s")}
	if !reflect.DeepEqual(build, want) {
		t.Errorf("Repositories.RequestPageBuild returned %+v, want %+v", build, want)
	}
}