text:
package org.jboss.resteasy.spi;

import javax.ws.rs.core.Response;

/**
 * Thrown by RESTEasy when HTTP Unsupported Media Type (415) is encountered
 * JAX-RS now has this exception
 */
@Deprecated
public class UnsupportedMediaTypeException extends LoggableFailure
{

   public UnsupportedMediaTypeException(String s)
   {
      super(s, 415);
   }

   public UnsupportedMediaTypeException(String s, Response response)
   {
      super(s, response);
   }

   public UnsupportedMediaTypeException(String s, Throwable throwable, Response response)
   {
      super(s, throwable, response);
   }

   public UnsupportedMediaTypeException(String s, Throwable throwable)
   {
      super(s, throwable, 415);
   }

   public UnsupportedMediaTypeException(Throwable throwable)
   {
      super(throwable, 415);
   }

   public UnsupportedMediaTypeException(Throwable throwable, Response response)
   {
      super(throwable, response);
   }

}


text:
declare namespace PouchDB {
    namespace FruitDOWNAdapter {
        interface FruitDOWNAdapterConfiguration
                extends Configuration.LocalDatabaseConfiguration {
            adapter: 'fruitdown';
        }
    }

    interface Static {
        new<Content extends Core.Encodable>(name: string | void,
            options: FruitDOWNAdapter.FruitDOWNAdapterConfiguration
            ): Database<Content>;
    }
}

declare module 'pouchdb-adapter-fruitdown' {
    const plugin: PouchDB.Plugin;
    export = plugin;
}

redpajama_set_name: RedPajamaGithub


text:
package de.mirkosertic.bytecoder.backend.wasm.ast;

import java.io.PrintWriter;

public class TextWriter implements AutoCloseable {

    private final PrintWriter pw;
    private int indent;

    public TextWriter(final PrintWriter pw) {
        this.pw = pw;
        this.indent = 0;
    }

    public void opening() {
        pw.print("(");
        indent++;
    }

    public void write(final String value) {
        pw.print(value);
    }

    public void newLine() {
        pw.println();
        for (int i=0;i<indent;i++) {
            pw.print("    ");
        }
    }

    public void closing() {
        pw.print(")");
        indent--;
    }

    public void writeText(final String text) {
        pw.print("\"");
        pw.print(text);
        pw.print("\"");
    }

    public void writeInteger(final int value) {
        pw.print(value);
    }

    public void writeAttribute(final String name, final int value) {
        pw.print(name);
        pw.print("=");
        pw.print(value);
    }

    public void space() {
        pw.print(" ");
    }

    public void writeLabel(final String label) {
        pw.print("$");
        pw.print(label);
    }

    public void writeFloat(final float value) {
        pw.print(value);
    }

    @Override
    public void close() {
        pw.close();
    }
}


text:
package com.example.Fund;

import android.app.Activity;
import android.content.Intent;
import android.os.AsyncTask;
import android.os.Bundle;
import android.support.v4.widget.SwipeRefreshLayout;
import android.view.View;
import android.widget.AdapterView;
import android.widget.Button;
import android.widget.ImageView;
import android.widget.ListView;
import android.widget.ProgressBar;
import android.widget.RadioButton;
import android.widget.RadioGroup;
import android.widget.TextView;
import android.widget.Toast;

import com.example.Fund.activity.FundInfoActivity;
import com.example.Fund.activity.MyAdapter;
import com.example.Fund.bean.Fund;
import com.example.Fund.utils.Constants;
import com.example.Fund.utils.Tools;
import com.google.gson.Gson;
import com.google.gson.reflect.TypeToken;

import org.json.JSONObject;

import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;

public class MainActivity extends Activity {
    private int pageNo = 1;
    private int pageCount = 0;
    private String typeName = "All";
    private ListView lv_fundinfo;
    private TextView tvPage;
    private RadioButton radioButton;
    private Button btPrev;
    private Button btNext;
    private Button btAll;
    private Button btStock;
    private Button btMixed;
    private Button btBond;
    private Button btCurrency;
    private Button btNetValue;
    private ImageView ivNetValue;
    private ImageView ivRange;
    private ArrayList<Fund> fundList = null;
    private ArrayList<Fund> fundList2 = null;
    private int netValueType = 0;//¾»ÖµÀàÐÍ£¬0Ϊ×îо»Öµ£¬1ΪÀۼƾ»Öµ
    private int rangeType = 0;//ÕǵøÀàÐÍ 0Ϊ½µÐò, 1ÉýÐò
    private SwipeRefreshLayout mSwipeLayout;
    private RadioGroup rgFundType;
    private ProgressBar pbList;
    private long exitTime;

    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_main);
        lv_fundinfo = (ListView) findViewById(R.id.lv_fundinfo);
        tvPage = (TextView) findViewById(R.id.tv_page);
        btPrev = (Button) findViewById(R.id.bt_prev_page);
        btNext = (Button) findViewById(R.id.bt_next_page);
        btAll = (Button) findViewById(R.id.rb_all);
        btStock = (Button) findViewById(R.id.rb_stock);
        btMixed = (Button) findViewById(R.id.rb_mixed);
        btBond = (Button) findViewById(R.id.rb_bond);
        btCurrency = (Button) findViewById(R.id.rb_currency);
        btNetValue = (Button) findViewById(R.id.bt_netvalue);
        ivNetValue = (ImageView) findViewById(R.id.iv_netValue);
        ivRange = (ImageView) findViewById(R.id.iv_range);
        pbList = (ProgressBar) findViewById(R.id.pb_list);
        rgFundType = (RadioGroup) findViewById(R.id.rg_type);
        goPage(pageNo);
        rgFundType.setOnCheckedChangeListener(new RadioGroup.OnCheckedChangeListener() {
            @Override
            public void onCheckedChanged(RadioGroup group, int checkedId) {
                switch (checkedId) {
                    case R.id.rb_all:
                        clickTypeName("All");
                        break;
                    case R.id.rb_stock:
                        clickTypeName("Stock");
                        break;
                    case R.id.rb_mixed:
                        clickTypeName("Mixed");
                        break;
                    case R.id.rb_bond:
                        clickTypeName("Bond");
                        break;
                    case R.id.rb_currency:
                        clickTypeName("Currency");
                        break;
                    default:
                        break;
                }
            }
        });
        lv_fundinfo.setOnItemClickListener(new AdapterView.OnItemClickListener() {
            @Override
            public void onItemClick(AdapterView<?> parent, View view, int position, long id) {
                Fund fund = null;
                if ("All".equals(typeName)) {
                    fund = fundList.get(position);
                } else {
                    fund = fundList2.get(position);
                }
                Intent intent = new Intent(MainActivity.this, FundInfoActivity.class);
//                Bundle bundle = new Bundle();
//                bundle.putSerializable("fund", fund);
//                intent.putExtras(bundle);
                intent.putExtra("fund", fund);
                startActivity(intent);
            }
        });
        mSwipeLayout = (SwipeRefreshLayout) findViewById(R.id.id_swipe_ly);
        mSwipeLayout.setColorScheme(android.R.color.holo_blue_bright, android.R.color.holo_green_light, android.R.color.holo_orange_light, android.R.color.holo_red_light);
        mSwipeLayout.setOnRefreshListener(new SwipeRefreshLayout.OnRefreshListener() {
            @Override
            public void onRefresh() {
                btNetValue.setText("×îо»Öµ  ");
                ivNetValue.setImageResource(R.drawable.left2);
                netValueType = 0;
                ivRange.setImageResource(R.drawable.down);
                rangeType = 0;
                mSwipeLayout.setRefreshing(false);
                goPage(pageNo);
            }
        });
    }

    public void goPage(int pageno) {
        pbList.setVisibility(View.VISIBLE);
        //Òì²½ÓÃhttpÇëÇó
        AsyncTask<String, Integer, HashMap<String, Object>> async = new AsyncTask<String, Integer, HashMap<String, Object>>() {
            @Override
            protected HashMap<String, Object> doInBackground(String... params) {
                HashMap<String, Object> map = null;
                String url = Constants.URL + "&pageno=" + params[0] + "&applyrecordno=" + Constants.APPLY_RECORD_NO;
                String html = Tools.getHTML(url);
                if (html.equals("")) {
                    return map;
                }
                map = new HashMap<String, Object>();
                JSONObject jo = null;
                String jsonStr = null;
                int pCount = 0;
                try {
                    jo = new JSONObject(html);
                    int totalrecords = Integer.parseInt(jo.getString("totalrecords"));
                    if ((totalrecords % Integer.parseInt(Constants.APPLY_RECORD_NO)) == 0) {
                        pCount = totalrecords / Integer.parseInt(Constants.APPLY_RECORD_NO);
                    } else {
                        pCount = (totalrecords / Integer.parseInt(Constants.APPLY_RECORD_NO)) + 1;
                    }
                    jsonStr = jo.getString("datatable");
                } catch (Exception e) {
                    e.printStackTrace();
                }
                Gson gson = new Gson();
                List<Fund> fundList = gson.fromJson(jsonStr, new TypeToken<List<Fund>>() {
                }.getType());
                map.put("pageno", params[0]);
                map.put("pageCount", pCount);
                map.put("fundlist", fundList);
                return map;
            }

            //doInBackgroundÖ´ÐнáÊøºó
            @Override
            protected void onPostExecute(HashMap<String, Object> result) {
                pbList.setVisibility(View.GONE);
                if (result != null) {
                    pageNo = Integer.parseInt(result.get("pageno") + "");
                    pageCount = Integer.parseInt(result.get("pageCount") + "");
                    tvPage.setText(result.get("pageno") + "/" + result.get("pageCount"));
                    fundList = (ArrayList<Fund>) result.get("fundlist");
                    MyAdapter myAdapter = new MyAdapter(MainActivity.this, R.layout.my_base_item, fundList, netValueType);
                    lv_fundinfo.setAdapter(myAdapter);
                    btPrev.setEnabled(pageNo != 1);
                    btNext.setEnabled(pageNo != Integer.parseInt(result.get("pageCount") + ""));
                    clickTypeName(selectRadioBtn());
                } else {
                    Toast.makeText(MainActivity.this, "Êý¾ÝΪ¿Õ£¬Çë²é¿´ÍøÂçÊÇ·ñÁ¬½Ó", Toast.LENGTH_LONG).show();
                }
            }
        };
        async.execute(pageno + "");
    }

    //×îо»Öµ/Àۼƾ»Öµ
    public void clickNet(View v) {
        if (netValueType == 1) {
            btNetValue.setText("×îо»Öµ  ");
            ivNetValue.setImageResource(R.drawable.left2);
            netValueType = 0;
        } else {
            btNetValue.setText("Àۼƾ»Öµ  ");
            ivNetValue.setImageResource(R.drawable.right2);
            netValueType = 1;
        }
        MyAdapter myAdapter = null;
        if ("All".equals(typeName)) {
            myAdapter = new MyAdapter(MainActivity.this, R.layout.my_base_item, fundList, netValueType);
        } else {
            fundList2 = Tools.findFundByTypeName(fundList, typeName);
            myAdapter = new MyAdapter(MainActivity.this, R.layout.my_base_item, fundList2, netValueType);
        }
        lv_fundinfo.setAdapter(myAdapter);
    }

    //    ÈÕÕǵø·ù,0Ϊ½µÐò£¬1ΪÉýÐò
    public void clickRange(View v) {
        if (rangeType == 1) {
            ivRange.setImageResource(R.drawable.down);
            rangeType = 0;
        } else {
            ivRange.setImageResource(R.drawable.up);
            rangeType = 1;
        }
        MyAdapter myAdapter = null;
        fundList = Tools.findFundByRangeType(fundList, rangeType);
        if ("All".equals(typeName)) {
            myAdapter = new MyAdapter(MainActivity.this, R.layout.my_base_item, fundList, netValueType);
        } else {
            fundList2 = Tools.findFundByTypeName(fundList, typeName);
            fundList2 = Tools.findFundByRangeType(fundList2, rangeType);
            myAdapter = new MyAdapter(MainActivity.this, R.layout.my_base_item, fundList2, netValueType);
        }
        lv_fundinfo.setAdapter(myAdapter);
    }

    public void clickTypeName(String typeName) {
        this.typeName = typeName;
        fundList2 = fundList;
        if (!typeName.equals("All")) {
            fundList2 = Tools.findFundByTypeName(fundList2, typeName);
        }
        MyAdapter myAdapter = new MyAdapter(MainActivity.this, R.layout.my_base_item, fundList2, netValueType);
        lv_fundinfo.setAdapter(myAdapter);
    }

    //ÉÏÒ»Ò³
    public void prevPage(View v) {
        goPage(pageNo - 1);
        clickTypeName(selectRadioBtn());
        btNetValue.setText("×îо»Öµ  ");
        ivNetValue.setImageResource(R.drawable.left2);
        netValueType = 0;
        ivRange.setImageResource(R.drawable.down);
        rangeType = 0;
    }

    //ÏÂÒ»Ò³
    public void nextPage(View v) {
        goPage(pageNo + 1);
        clickTypeName(selectRadioBtn());
        btNetValue.setText("×îо»Öµ  ");
        ivNetValue.setImageResource(R.drawable.left2);
        netValueType = 0;
        ivRange.setImageResource(R.drawable.down);
        rangeType = 0;
    }

    public String selectRadioBtn() {
        radioButton = (RadioButton) findViewById(rgFundType.getCheckedRadioButtonId());
        String rbText = radioButton.getText().toString();
        String selectName = null;
        switch (rbText) {
            case "È«²¿":
                selectName = "All";
                break;
            case "¹ÉƱ":
                selectName = "Stock";
                break;
            case "»ìºÏ":
                selectName = "Mixed";
                break;
            case "ծȯ":
                selectName = "Bond";
                break;
            case "»õ±Ò":
                selectName = "Currency";
                break;
        }
        return selectName;
    }

    @Override
    public void onBackPressed() {
        if ((System.currentTimeMillis() - exitTime) > 2000) {// System.currentTimeMillis()ÎÞÂÛºÎʱµ÷Ó㬿϶¨´óÓÚ2000
            Toast.makeText(this, "ÔÙ°´Ò»´ÎÍ˳ö³ÌÐò", Toast.LENGTH_SHORT).show();
            exitTime = System.currentTimeMillis();
        } else {
            finish();
        }
    }
}


text:
package edit

import (
	"container/list"
	"fmt"
	"strings"
	"unicode/utf8"

	"github.com/u-root/u-root/cmds/elvish/edit/eddefs"
	"github.com/u-root/u-root/cmds/elvish/edit/ui"
	"github.com/u-root/u-root/cmds/elvish/eval"
	"github.com/u-root/u-root/cmds/elvish/eval/vars"
	"github.com/u-root/u-root/cmds/elvish/util"
)

// listingMode implements a mode that supports listing, selecting and filtering
// entries.
type listingMode struct {
	commonBinding eddefs.BindingMap
	listingState
}

type listingState struct {
	binding     eddefs.BindingMap
	provider    eddefs.ListingProvider
	selected    int
	filter      string
	pagesize    int
	headerWidth int
}

func init() { atEditorInit(initListing) }

func initListing(ed *editor, ns eval.Ns) {
	l := &listingMode{commonBinding: emptyBindingMap}
	ed.listing = l

	subns := eval.Ns{
		"binding": vars.FromPtr(&l.commonBinding),
	}
	subns.AddBuiltinFns("edit:listing:", map[string]interface{}{
		"up":         func() { l.up(false) },
		"up-cycle":   func() { l.up(true) },
		"page-up":    func() { l.pageUp() },
		"down":       func() { l.down(false) },
		"down-cycle": func() { l.down(true) },
		"page-down":  func() { l.pageDown() },
		"backspace":  func() { l.backspace() },
		"accept":     func() { l.accept(ed) },
		"accept-close": func() {
			l.accept(ed)
			ed.SetModeInsert()
		},
		"default": func() { l.defaultBinding(ed) },
	})
	ns.AddNs("listing", subns)
}

type placeholderer interface {
	Placeholder() string
}

func (l *listingMode) Teardown() {
	l.listingState = listingState{}
	if p, ok := l.provider.(teardowner); ok {
		p.Teardown()
	}
}

type teardowner interface {
	Teardown()
}

func (l *listingMode) Binding(k ui.Key) eval.Callable {
	specificBindings := l.binding
	listingBindings := l.commonBinding
	// mode-specific binding -> listing binding ->
	// mode-specific default -> listing default
	switch {
	case specificBindings.HasKey(k):
		return specificBindings.GetKey(k)
	case listingBindings.HasKey(k):
		return listingBindings.GetKey(k)
	case specificBindings.HasKey(ui.Default):
		return specificBindings.GetKey(ui.Default)
	case listingBindings.HasKey(ui.Default):
		return listingBindings.GetKey(ui.Default)
	default:
		return nil
	}
}

func newListing(b eddefs.BindingMap, p eddefs.ListingProvider) *listingState {
	l := &listingState{}
	l.setup(b, p)
	return l
}

func (l *listingState) setup(b eddefs.BindingMap, p eddefs.ListingProvider) {
	*l = listingState{b, p, 0, "", 0, 0}
	l.refresh()
	for i := 0; i < p.Len(); i++ {
		header, _ := p.Show(i)
		width := util.Wcswidth(header)
		if l.headerWidth < width {
			l.headerWidth = width
		}
	}
}

func (l *listingState) ModeLine() ui.Renderer {
	return ui.NewModeLineRenderer(l.provider.ModeTitle(l.selected), l.filter)
}

func (l *listingState) CursorOnModeLine() bool {
	if c, ok := l.provider.(cursorOnModeLiner); ok {
		return c.CursorOnModeLine()
	}
	return false
}

func (l *listingState) List(maxHeight int) ui.Renderer {
	n := l.provider.Len()
	if n == 0 {
		var ph string
		if pher, ok := l.provider.(placeholderer); ok {
			ph = pher.Placeholder()
		} else {
			ph = "(no result)"
		}
		return placeholderRenderer(ph)
	}

	// Collect the entries to show. We start from the selected entry and extend
	// in both directions alternatingly. The entries are split into lines and
	// then collected in a list.
	low := l.selected
	if low == -1 {
		low = 0
	}
	high := low
	height := 0
	var listOfLines list.List
	getEntry := func(i int) []ui.Styled {
		header, content := l.provider.Show(i)
		lines := strings.Split(content.Text, "\n")
		styles := content.Styles
		if i == l.selected {
			styles = append(styles, styleForSelected...)
		}
		styleds := make([]ui.Styled, len(lines))
		for i, line := range lines {
			if l.headerWidth > 0 {
				if i == 0 {
					line = fmt.Sprintf("%*s %s", l.headerWidth, header, line)
				} else {
					line = fmt.Sprintf("%*s %s", l.headerWidth, "", line)
				}
			}
			styleds[i] = ui.Styled{line, styles}
		}
		return styleds
	}
	// We start by extending high, so that the first entry to include is
	// l.selected.
	extendLow := false
	lastShownIncomplete := false
	for height < maxHeight && !(low == 0 && high == n) {
		var i int
		if (extendLow && low > 0) || high == n {
			low--

			entry := getEntry(low)
			// Prepend at most the last (height - maxHeight) lines.
			for i = len(entry) - 1; i >= 0 && height < maxHeight; i-- {
				listOfLines.PushFront(entry[i])
				height++
			}
			if i >= 0 {
				lastShownIncomplete = true
			}
		} else {
			entry := getEntry(high)
			// Append at most the first (height - maxHeight) lines.
			for i = 0; i < len(entry) && height < maxHeight; i++ {
				listOfLines.PushBack(entry[i])
				height++
			}
			if i < len(entry) {
				lastShownIncomplete = true
			}

			high++
		}
		extendLow = !extendLow
	}

	l.pagesize = high - low

	// Convert the List to a slice.
	lines := make([]ui.Styled, 0, listOfLines.Len())
	for p := listOfLines.Front(); p != nil; p = p.Next() {
		lines = append(lines, p.Value.(ui.Styled))
	}

	ls := listingRenderer{lines}
	if low > 0 || high < n || lastShownIncomplete {
		// Need scrollbar
		return listingWithScrollBarRenderer{ls, n, low, high, height}
	}
	return ls
}

func writeHorizontalScrollbar(b *ui.Buffer, n, low, high, width int) {
	slow, shigh := findScrollInterval(n, low, high, width)
	for i := 0; i < width; i++ {
		if slow <= i && i < shigh {
			b.Write(' ', styleForScrollBarThumb.String())
		} else {
			b.Write('━', styleForScrollBarArea.String())
		}
	}
}

func renderScrollbar(n, low, high, height int) *ui.Buffer {
	slow, shigh := findScrollInterval(n, low, high, height)
	// Logger.Printf("low = %d, high = %d, n = %d, slow = %d, shigh = %d", low, high, n, slow, shigh)
	b := ui.NewBuffer(1)
	for i := 0; i < height; i++ {
		if i > 0 {
			b.Newline()
		}
		if slow <= i && i < shigh {
			b.Write(' ', styleForScrollBarThumb.String())
		} else {
			b.Write('│', styleForScrollBarArea.String())
		}
	}
	return b
}

func findScrollInterval(n, low, high, height int) (int, int) {
	f := func(i int) int {
		return int(float64(i)/float64(n)*float64(height) + 0.5)
	}
	scrollLow, scrollHigh := f(low), f(high)
	if scrollLow == scrollHigh {
		if scrollHigh == high {
			scrollLow--
		} else {
			scrollHigh++
		}
	}
	return scrollLow, scrollHigh
}

func (l *listingState) changeFilter(newfilter string) {
	l.filter = newfilter
	l.refresh()
}

func (l *listingState) refresh() {
	l.selected = l.provider.Filter(l.filter)
}

func (l *listingState) backspace() bool {
	_, size := utf8.DecodeLastRuneInString(l.filter)
	if size > 0 {
		l.changeFilter(l.filter[:len(l.filter)-size])
		return true
	}
	return false
}

func (l *listingState) up(cycle bool) {
	n := l.provider.Len()
	if n == 0 {
		return
	}
	l.selected--
	if l.selected == -1 {
		if cycle {
			l.selected += n
		} else {
			l.selected++
		}
	}
}

func (l *listingState) pageUp() {
	n := l.provider.Len()
	if n == 0 {
		return
	}
	l.selected -= l.pagesize
	if l.selected < 0 {
		l.selected = 0
	}
}

func (l *listingState) down(cycle bool) {
	n := l.provider.Len()
	if n == 0 {
		return
	}
	l.selected++
	if l.selected == n {
		if cycle {
			l.selected -= n
		} else {
			l.selected--
		}
	}
}

func (l *listingState) pageDown() {
	n := l.provider.Len()
	if n == 0 {
		return
	}
	l.selected += l.pagesize
	if l.selected >= n {
		l.selected = n - 1
	}
}

func (l *listingState) accept(ed *editor) {
	if l.selected >= 0 {
		l.provider.Accept(l.selected, ed)
	}
}

func (l *listingState) defaultBinding(ed *editor) {
	k := ed.LastKey()
	if likeChar(k) {
		// Append to filter
		l.changeFilter(l.filter + string(k.Rune))
		if aa, ok := l.provider.(autoAccepter); ok {
			if aa.AutoAccept() {
				l.accept(ed)
			}
		}
	} else {
		ed.SetModeInsert()
		ed.SetAction(reprocessKey)
	}
}

type autoAccepter interface {
	AutoAccept() bool
}


text:
// Autogenerated from vk-api-schema. Please don't edit it manually.
package com.vk.api.sdk.queries.video;

import com.vk.api.sdk.client.AbstractQueryBuilder;
import com.vk.api.sdk.client.VkApiClient;
import com.vk.api.sdk.client.actors.UserActor;
import com.vk.api.sdk.objects.base.responses.OkResponse;
import java.util.Arrays;
import java.util.List;

/**
 * Query for Video.removeFromAlbum method
 */
public class VideoRemoveFromAlbumQuery extends AbstractQueryBuilder<VideoRemoveFromAlbumQuery, OkResponse> {
    /**
     * Creates a AbstractQueryBuilder instance that can be used to build api request with various parameters
     *
     * @param client VK API client
     * @param actor actor with access token
     * @param ownerId value of "owner id" parameter.
     * @param videoId value of "video id" parameter. Minimum is 0.
     */
    public VideoRemoveFromAlbumQuery(VkApiClient client, UserActor actor, int ownerId,
            int videoId) {
        super(client, "video.removeFromAlbum", OkResponse.class);
        accessToken(actor.getAccessToken());
        ownerId(ownerId);
        videoId(videoId);
    }

    /**
     * Set target id
     *
     * @param value value of "target id" parameter.
     * @return a reference to this {@code AbstractQueryBuilder} object to fulfill the "Builder" pattern.
     */
    public VideoRemoveFromAlbumQuery targetId(Integer value) {
        return unsafeParam("target_id", value);
    }

    /**
     * Set album id
     *
     * @param value value of "album id" parameter.
     * @return a reference to this {@code AbstractQueryBuilder} object to fulfill the "Builder" pattern.
     */
    public VideoRemoveFromAlbumQuery albumId(Integer value) {
        return unsafeParam("album_id", value);
    }

    /**
     * Set owner id
     *
     * @param value value of "owner id" parameter.
     * @return a reference to this {@code AbstractQueryBuilder} object to fulfill the "Builder" pattern.
     */
    protected VideoRemoveFromAlbumQuery ownerId(int value) {
        return unsafeParam("owner_id", value);
    }

    /**
     * Set video id
     *
     * @param value value of "video id" parameter. Minimum is 0.
     * @return a reference to this {@code AbstractQueryBuilder} object to fulfill the "Builder" pattern.
     */
    protected VideoRemoveFromAlbumQuery videoId(int value) {
        return unsafeParam("video_id", value);
    }

    /**
     * album_ids
     * Set album ids
     *
     * @param value value of "album ids" parameter.
     * @return a reference to this {@code AbstractQueryBuilder} object to fulfill the "Builder" pattern.
     */
    public VideoRemoveFromAlbumQuery albumIds(Integer... value) {
        return unsafeParam("album_ids", value);
    }

    /**
     * Set album ids
     *
     * @param value value of "album ids" parameter.
     * @return a reference to this {@code AbstractQueryBuilder} object to fulfill the "Builder" pattern.
     */
    public VideoRemoveFromAlbumQuery albumIds(List<Integer> value) {
        return unsafeParam("album_ids", value);
    }

    @Override
    protected VideoRemoveFromAlbumQuery getThis() {
        return this;
    }

    @Override
    protected List<String> essentialKeys() {
        return Arrays.asList("video_id", "owner_id", "access_token");
    }
}


text:
var helpers = require('../../helpers');

module.exports = function(context, stepInfo) {
  var img = context.processedImage;
  helpers.dimension.resolveStep(img, stepInfo);

  if (stepInfo.width < 1 || stepInfo.height < 1) {
    // don't permit <= 0 inputs
    throw new Error('resize width or height cannot be <= 0');
  }

  if (isNaN(stepInfo.width) && isNaN(stepInfo.height)) {
    throw new Error('resize width or height required');
  }

  var aspectX = helpers.dimension.getXAspect(img);
  var aspectY = helpers.dimension.getYAspect(img);

  if (isNaN(stepInfo.width)) {
    stepInfo.width = Math.round(stepInfo.height * aspectX);
  }

  if (isNaN(stepInfo.height)) {
    stepInfo.height = Math.round(stepInfo.width * aspectY);
  }

  if (context.options.maxSize) {
    // request should never exceed permitted output size
    if (stepInfo.width > context.options.maxSize.width) {
      stepInfo.width = context.options.maxSize.width;
    }
    if (stepInfo.height > context.options.maxSize.height) {
      stepInfo.height = context.options.maxSize.height;
    }
  }

  var ignoreAspect = stepInfo.ignoreAspect === 'true';

  if (!ignoreAspect) {
    var w = stepInfo.width,
      h = stepInfo.height;

    if (stepInfo.min !== undefined) {
      // use min if specified

      // apply aspect
      h = Math.round(stepInfo.width * aspectY);

      if (h < stepInfo.height) {
        // if height less than minimum, set to min
        h = stepInfo.height;
        w = Math.ceil(stepInfo.height * aspectX);
      }

      if (w < stepInfo.width) {
        // if width less than minimum, set to min
        w = stepInfo.width;
        h = Math.ceil(stepInfo.width * aspectY);
      }
    } else {
      // use max otherwise

      // apply aspect
      h = Math.round(w * aspectY);

      if (h > stepInfo.height) {
        // if height more than maximum, reduce to max
        h = stepInfo.height;
        w = Math.floor(h * aspectX);
      }

      if (w > stepInfo.width) {
        // if width more than maximum, reduce to max
        w = stepInfo.width;
        h = Math.floor(w * aspectY);
      }
    }

    stepInfo.width = w;
    stepInfo.height = h;
  }

  if (stepInfo.canGrow !== 'true') {
    if (stepInfo.width > img.info.width) {
      stepInfo.width = img.info.width;
      if (!ignoreAspect) {
        stepInfo.height = Math.ceil(stepInfo.width * aspectY);
      }
    }

    if (stepInfo.height > img.info.height) {
      stepInfo.height = img.info.height;
      if (!ignoreAspect) {
        stepInfo.width = Math.ceil(stepInfo.height * aspectX);
      }
    }
  }

  // track new dimensions for followup operations
  img.info.width = stepInfo.width;
  img.info.height = stepInfo.height;

  var rgba = helpers.rgba.getRGBA(stepInfo);

  context.sharp
    .resize(stepInfo.width, stepInfo.height, {
      interpolator: stepInfo.interpolator || 'bicubic',
      fit: stepInfo.fit || 'fill', // we'll handle aspect ourselves (by default) to avoid having to recompute dimensions
      position: stepInfo.position || 'centre',
      background: rgba
    });
};


text:
package com.csvanefalk.phatgeo.object.geometry;

import com.csvanefalk.phatgeo.object.GeoJSONObject;
import com.csvanefalk.phatgeo.object.GeoJSONType;

public class MultiPoint extends GeoJSONObject {

	public MultiPoint(String type) {
		super(GeoJSONType.MULTIPOINT);
	}
}


text:
'use strict';
/**
 * @ngdoc function
 * @name sbAdminApp.controller:MainCtrl
 * @description # MainCtrl Controller of the sbAdminApp
 */
angular.module('sbAdminApp').controller(
		'MainCtrl',
		function($scope, $position, $http) {
//			var subscription = events.subscribe('/event/taskStatus', function(obj) {
//				var ta = document.getElementById('responseText');
//				ta.value = ta.value + '\n' + event.data
//			});

			$scope.progressString = "0% Complete (0 out of 0 scheduled completed)";
			$scope.percentInt = 0;

			var subscriptionProgress = events.subscribe('/event/progress', function(item) {
				//console.log(item.obj.updateString);
				$scope.progressString = item.obj.updateString;
				$scope.percentInt = item.obj.percentInt;

				$scope.$apply()
			});

			var subscriptionTaskStatus = events.subscribe('/event/taskStatus', function(item) {
				console.log(item.obj);

			});

			if ($scope.taskHistoryList === undefined) {
				$http.get("http://localhost:8080/queue").success(
						function(response) {
							$scope.taskHistoryList = response.tasksStatus;
							$scope.progressString = response.progress.updateString;
							$scope.percentInt = response.progress.percentInt;

							// console.log(response);
						}).error(function(data, status, headers, config) {
					// log error
							$scope.taskHistoryList = [];
							console.log(headers);

				});
			}

		});

var events = (function(){
  var topics = {};
  var hOP = topics.hasOwnProperty;

  return {
    subscribe: function(topic, listener) {
      // Create the topic's object if not yet created
      if(!hOP.call(topics, topic)) topics[topic] = [];

      // Add the listener to queue
      var index = topics[topic].push(listener) -1;

      // Provide handle back for removal of topic
      return {
        remove: function() {
          delete topics[topic][index];
        }
      };
    },
    publish: function(topic, info) {
      // If the topic doesn't exist, or there's no listeners in queue, just leave
      if(!hOP.call(topics, topic)) return;

      // Cycle through topics queue, fire!
      topics[topic].forEach(function(item) {
      		item(info != undefined ? info : {});
      });
    }
  };
})();

var bariumClient = {
	// ws://127.0.0.1:8080/websocket
	connectionUrl : undefined,
	socket : undefined,
	// Used to connect
	connect : function(url) {
		bariumClient.connectionUrl = url;

		var connected = false;
		if (bariumClient.socket !== undefined) {
			if (bariumClient.socket.readyState == WebSocket.OPEN) {
				connected = true;
			}
		}

		if (!window.WebSocket) {
			window.WebSocket = window.MozWebSocket;
		}

		if (window.WebSocket && connected === false) {
			bariumClient.socket = new WebSocket(bariumClient.connectionUrl);

			bariumClient.socket.onmessage = function(event) {

				var eventJsonObj = JSON.parse(event.data)
				events.publish('/event/all', {'obj':eventJsonObj});

				//console.log(eventJsonObj);

				events.publish('/event/'+eventJsonObj._eventType, {'obj':eventJsonObj});

			};

			bariumClient.socket.onopen = function(event) {
				events.publish('/websocket/onopen', {
					'event': event
				});

				//var ta = document.getElementById('responseText');
				//ta.value = "Web Socket opened!";
			};

			bariumClient.socket.onclose = function(event) {
				events.publish('/websocket/onclose', {
					'event': event
				});
				//var ta = document.getElementById('responseText');
				//ta.value = ta.value + "Web Socket closed";
			};
			return true
		} else {
			return false
			// alert("Your browser does not support Web Socket.");
		}
	},
	send : function(message) {
		if (!window.WebSocket) {
			return;
		}
		if (bariumClient.socket.readyState == WebSocket.OPEN) {
			bariumClient.socket.send(JSON.stringify({
				"_eventType" : "transform",
				"message" : message
			}));
		} else {
			alert("The socket is not open.");
		}
	}

};

bariumClient.connect("ws://127.0.0.1:8080/websocket")


text:
@interface UAAWSRequest (UAMTLModel) <UAMTLModel, NSCopying>

@end


text:
<?php

namespace Piplin\Models;

use Illuminate\Database\Eloquent\Model;
use Illuminate\Database\Eloquent\SoftDeletes;
use Piplin\Models\Traits\BroadcastChanges;
use Piplin\Models\Traits\HasTargetable;

/**
 * Static file for project.
 */
class ConfigFile extends Model
{
    use SoftDeletes, BroadcastChanges, HasTargetable;

    const SUCCESSFUL = 0;
    const UNSYNCED   = 1;
    const FAILED     = 2;
    const SYNCING    = 3;

    /**
     * The attributes that are mass assignable.
     *
     * @var array
     */
    protected $fillable = ['name', 'path', 'content', 'output'];

    /**
     * The attributes excluded from the model's JSON form.
     *
     * @var array
     */
    protected $hidden = ['created_at', 'updated_at', 'deleted_at'];

    /**
     * Additional attributes to include in the JSON representation.
     *
     * @var array
     */
    protected $appends = ['environment_names'];

    /**
     * The attributes that should be casted to native types.
     *
     * @var array
     */
    protected $casts = [
        'id'         => 'integer',
    ];

    /**
     * Belongs to many relationship.
     *
     * @return Server
     */
    public function environments()
    {
        return $this->belongsToMany(Environment::class)
                    ->orderBy('order', 'ASC');
    }

    /**
     * Determines whether the config file is currently being syncing.
     *
     * @return bool
     */
    public function isSyncing()
    {
        return ($this->status === self::SYNCING);
    }

    /**
     * Gets the readable list of environments.
     *
     * @return string
     */
    public function getEnvironmentNamesAttribute()
    {
        $environments = [];
        foreach ($this->environments as $environment) {
            $environments[] = $environment->name;
        }

        if (count($environments)) {
            return implode(', ', $environments);
        }

        return trans('app.none');
    }
}


text:
namespace uLocate
{
    using uLocate.Models;

    /// <summary>
    /// Used in startup to define AutoMapper mappings.
    /// </summary>
    internal static class AutomapperMappings
    {
        /// <summary>
        /// The create mappings.
        /// </summary>
        public static void CreateMappings()
        {
           // AutoMapper.Mapper.CreateMap<IAddress, LocatedAddress>();
        }
    }
}


text:
package com.github.ambry.messageformat;

/**
 * In mem representation of a TTL update record
 */
public class TtlUpdateSubRecord implements SubRecord {
  private final long updatedExpiryTimeMs;

  /**
   * @param updatedExpiryTimeMs the new expiry time in ms
   */
  TtlUpdateSubRecord(long updatedExpiryTimeMs) {
    this.updatedExpiryTimeMs = updatedExpiryTimeMs;
  }

  /**
   * @return the expiry time in ms
   */
  public long getUpdatedExpiryTimeMs() {
    return updatedExpiryTimeMs;
  }

  @Override
  public Type getType() {
    return SubRecord.Type.TTL_UPDATE;
  }
}


text:
import * as Constants from '../../../constants/teams'
import * as Container from '../../../util/container'
import * as Kb from '../../../common-adapters'
import * as React from 'react'
import * as RouteTreeGen from '../../../actions/route-tree-gen'
import * as Styles from '../../../styles'
import * as TeamsGen from '../../../actions/teams-gen'
import * as Types from '../../../constants/types/teams'
import type * as ChatTypes from '../../../constants/types/chat2'
import {pluralize} from '../../../util/string'
import {useAllChannelMetas} from '../../common/channel-hooks'

type Props = Container.RouteProps<'teamDeleteChannel'>

const Header = () => (
  <>
    <Kb.Icon type="icon-teams-channel-64" />
    <Kb.Icon type="icon-team-delete-28" style={{marginRight: -60, marginTop: -20}} />
  </>
)

const getTeamSelectedCount = (state: Container.TypedState, teamID: Types.TeamID) => {
  return state.teams.teamSelectedChannels.get(teamID)
}

const DeleteChannel = (props: Props) => {
  const teamID = props.route.params?.teamID ?? Types.noTeamID
  const routePropChannel = props.route.params?.conversationIDKey ?? undefined
  const storeSelectedChannels = Container.useSelector(state => getTeamSelectedCount(state, teamID))

  // When the channels get deleted, the values in the store are gone but we should keep displaying the same thing.
  const [channelIDs] = React.useState<ChatTypes.ConversationIDKey[]>(
    routePropChannel ? [routePropChannel] : storeSelectedChannels ? [...storeSelectedChannels] : []
  )

  const {channelMetas} = useAllChannelMetas(teamID)
  let channelnames: string[] = []

  channelIDs.forEach(channelID => {
    const conversationMeta = channelMetas?.get(channelID)
    const channelname = conversationMeta ? conversationMeta.channelname : ''
    channelnames.push(channelname)
  })

  let deleteMsg: string
  if (channelnames.length == 1) {
    deleteMsg = `#${channelnames[0]}`
  } else if (channelnames.length == 2) {
    deleteMsg = `#${channelnames[0]} and #${channelnames[1]}`
  } else {
    const numOtherChans = channelnames.length - 2
    deleteMsg = `#${channelnames[0]}, #${channelnames[1]} and ${numOtherChans} other ${pluralize(
      'channel',
      numOtherChans
    )}`
  }

  const dispatch = Container.useDispatch()

  const onDelete = () => {
    dispatch(
      TeamsGen.createDeleteMultiChannelsConfirmed({
        channels: Array.from(channelIDs.values()),
        teamID,
      })
    )
    dispatch(
      TeamsGen.createSetChannelSelected({
        channel: '',
        clearAll: true,
        selected: false,
        teamID: teamID,
      })
    )
  }

  const onCancel = () => {
    dispatch(RouteTreeGen.createNavigateUp())
  }

  return (
    <Kb.ConfirmModal
      confirmText={`Delete ${pluralize('channel', channelnames.length)}`}
      description="This cannot be undone. All messages in the channel will be lost."
      header={<Header />}
      onConfirm={onDelete}
      onCancel={onCancel}
      prompt={
        <Kb.Text type="Header" center={true} style={styles.prompt}>
          Delete {deleteMsg}?
        </Kb.Text>
      }
      waitingKey={Constants.deleteChannelWaitingKey(teamID)}
    />
  )
}

const styles = Styles.styleSheetCreate(() => ({
  prompt: Styles.padding(0, Styles.globalMargins.small),
}))

export default DeleteChannel


text:
using System;

namespace TreesAndTreeTraversals.HeapSort
{
    public static class HeapSortArrayExtension
    {
        public static void HeapSort<T>(this T[] heap, Func<T, T, bool> compareFunc)
        {
            Console.WriteLine(string.Join(", ", heap));

            for (int i = heap.Length - 1; i >= 0; i--)
            {
                heap.HeapifyDown(compareFunc, i, heap.Length);
            }

            for (int i = heap.Length - 1; i >= 0; i--)
            {
                T value = heap[0];
                heap[0] = heap[i];
                heap[i] = value;

                heap.HeapifyDown(compareFunc, 0, i);
            }

            Console.WriteLine(string.Join(", ", heap));
        }

        public static void HeapifyDown<T>(this T[] heap, Func<T, T, bool> compareFunc, int index, int length)
        {
            T value = heap[index];

            while (index * 2 + 2 < length)
            {
                int leftChildIndex = index * 2 + 1;
                int rightChildIndex = index * 2 + 2;

                int smallerChildIndex = compareFunc(heap[leftChildIndex], heap[rightChildIndex]) ?
                    leftChildIndex : rightChildIndex;

                if (compareFunc(heap[smallerChildIndex], value))
                {
                    heap[index] = heap[smallerChildIndex];
                }
                else
                {
                    break;
                }

                index = smallerChildIndex;
            }

            if (index * 2 + 1 < length)
            {
                int smallerChildIndex = index * 2 + 1;

                if (compareFunc(heap[smallerChildIndex], value))
                {
                    heap[index] = heap[smallerChildIndex];
                    index = smallerChildIndex;
                }
            }

            heap[index] = value;
        }
    }
}


text:
FROM kylef/swiftenv:swift3

RUN mkdir -p /code
WORKDIR /code
ADD . /code


text:
// ReSharper disable ConsiderUsingConfigureAwait
namespace TelebotConsole
{
    using System;
    using System.Collections.Generic;
    using System.Linq;
    using System.Threading.Tasks;

    using Microsoft.Extensions.Configuration;

    using Newtonsoft.Json;

    using Taikandi.Telebot;
    using Taikandi.Telebot.Types;

    internal class TelebotConsole
    {
        #region Fields

        private readonly string _telegramApiKey;

        private long _offset;

        private Telebot _telebot;

        #endregion

        #region Constructors and Destructors

        public TelebotConsole()
        {
            var builder = new ConfigurationBuilder();
            builder.AddUserSecrets();
            var configuration = builder.Build();

            // Get Telegram API key from user secrets.
            // https://docs.asp.net/en/latest/security/app-secrets.html
            this._telegramApiKey = configuration["TelegramApiKey"];

            // Identifier of the first update to be returned. Must be greater by one than the highest among
            // the identifiers of previously received updates. By default, updates starting with the earliest
            // unconfirmed update are returned. An update is considered confirmed as soon as getUpdates is
            // called with an offset higher than its update_id.
            this._offset = 21226760;
        }

        #endregion

        #region Public Methods and Operators

        public async Task RunAsync()
        {
            Console.WriteLine("Running Telebot with key: {0}", this._telegramApiKey);
            this._telebot = new Telebot(this._telegramApiKey);

            while( true )
            {
                try
                {
                    var updates = (await this._telebot.GetUpdatesAsync(this._offset)).ToList();
                    if( updates.Any() )
                    {
                        this._offset = updates.Max(u => u.Id) + 1;

                        foreach( var update in updates )
                        {
                            switch( update.Type )
                            {
                                case UpdateType.Message:
                                    await this.CheckMessagesAsync(update);
                                    break;
                                case UpdateType.EditedMessage:
                                    await this.CheckMessagesAsync(update);
                                    break;
                                case UpdateType.ChannelPost:
                                    await this.CheckMessagesAsync(update);
                                    break;
                                case UpdateType.EditedChannelPost:
                                    await this.CheckMessagesAsync(update);
                                    break;
                                case UpdateType.InlineQuery:
                                    await this.CheckInlineQueryAsync(update);
                                    break;
                                case UpdateType.ChosenInlineResult:
                                    this.CheckChosenInlineResult(update);
                                    break;
                                default:
                                    throw new ArgumentOutOfRangeException();
                            }
                        }
                    }

                    await Task.Delay(TimeSpan.FromSeconds(1));
                }
                catch( Exception ex )
                {
                    LogException(ex);

                    Console.WriteLine("Press 'Enter' to continue...");
                    Console.ReadLine();

                    WriteLine(ConsoleColor.DarkGray, "----------------------------------------------");
                }
            }
        }

        private void CheckChosenInlineResult(Update update)
        {
            WriteLine(ConsoleColor.Blue, "Received ChosenInlineResult:");
            Dump(update, ConsoleColor.Blue);
        }

        private Task CheckInlineQueryAsync(Update update)
        {
            WriteLine(ConsoleColor.Green, "Received InlineQuery:");
            Dump(update, ConsoleColor.Green);

    var articleResult = new InlineQueryResultArticle
    {
        Id = Guid.NewGuid().ToString("N"),
        Title = "This is a title",
        Url = "https://core.telegram.org/bots/api#inlinequeryresultarticle"
    };

    var photoResult = new InlineQueryResultPhoto
    {
        Id = Guid.NewGuid().ToString("N"),
        Url = "https://telegram.org/file/811140636/1/hzUbyxse42w/4cd52d0464b44e1e5b",
        ThumbnailUrl = "https://telegram.org/file/811140636/1/hzUbyxse42w/4cd52d0464b44e1e5b"
    };

    var gifResult = new InlineQueryResultGif
    {
        Id = Guid.NewGuid().ToString("N"),
        Url = "https://upload.wikimedia.org/wikipedia/commons/thumb/2/2c/Rotating_earth_%28large%29.gif/200px-Rotating_earth_%28large%29.gif",
        ThumbnailUrl = "https://upload.wikimedia.org/wikipedia/commons/thumb/2/2c/Rotating_earth_%28large%29.gif/200px-Rotating_earth_%28large%29.gif"
    };

    var results = new InlineQueryResult[] { articleResult, photoResult, gifResult };

            var answerId = update.InlineQuery.Id;
            WriteLine(ConsoleColor.DarkGreen, "Sending: ");
            WriteLine(ConsoleColor.DarkGreen, $"Answer Id: {answerId}");
            Dump(results, ConsoleColor.DarkGreen);

            return this._telebot.AnswerInlineQueryAsync(answerId, results);
        }

        #endregion

        #region Methods

        private static void Dump<TResult>(TResult response, ConsoleColor color = ConsoleColor.White)
        {
            var serializedResult = JsonConvert.SerializeObject(response, Formatting.Indented, new JsonSerializerSettings { NullValueHandling = NullValueHandling.Ignore });
            WriteLine(color, serializedResult);
        }

        private static void WriteLine(ConsoleColor color, string message)
        {
            Console.ForegroundColor = color;
            Console.WriteLine(message);

            Console.ResetColor();
        }

        private static void LogException(Exception ex)
        {
            WriteLine(ConsoleColor.Red, ex.ToString());
        }

        private Task CheckMessagesAsync(Update update)
        {
            Dump(update);

            if( string.IsNullOrWhiteSpace(update.Message?.Text) )
                return Task.FromResult(0);

            var message = update.Message.Text.ToLowerInvariant();
            switch( message )
            {
                case "/sendphoto":
                    return this.SendPhotoAsync(update);
                case "/chataction":
                    return this.SendChatActionAsync(update);
                default:
                    return this.EchoAsync(update);
            }
        }

        private async Task EchoAllAsync(IEnumerable<Update> updates)
        {
            foreach( var update in updates )
            {
                await this.EchoAsync(update);
            }
        }

        private async Task EchoAsync(Update update)
        {
            if( update.Message == null )
                return;

            var message = update.Message;
            await this._telebot.SendMessageAsync(message, message.Text);
        }

        private Task SendChatActionAsync(Update update)
        {
            return this._telebot.SendChatActionAsync(update.Message.Chat.Id.ToString(), ChatAction.Typing);
        }

        private Task SendPhotoAsync(Update update)
        {
            var actionTask = this._telebot.SendChatActionAsync(update.Message.Chat.Id.ToString(), ChatAction.UploadPhoto);
            var sendTask = this._telebot.SendPhotoFromFileAsync(update.Message.Chat.Id.ToString(), @"D:\Temp\brekeke-frog-symbol.jpg", "The Frog!");

            return Task.WhenAll(actionTask, sendTask);
        }

        #endregion
    }
}


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

<meta content="text/html; charset=iso-8859-1" http-equiv="content-type">
<title>Quantile</title>
<link rel="stylesheet" type="text/css" href="Help.css">

Quantile

The Quantile tool transforms a raster into quantiles. Quantiles
 are values taken at regular intervals from the inverse of the cumulative
 distribution function (CDF) of a random variable.

See Also:

Reclass (equal interval)

Scripting:

The following is an example of a Python script that uses this tool:

                wd = pluginHost.getWorkingDirectory()

                input = wd + "input.dep"

                output = wd + "output.dep"

                numQuantiles = "5"

                args = [input, output, numQuantiles]

                pluginHost.runPlugin("Quantile", args, False)

This is a Groovy script also using this tool:

                def wd = pluginHost.getWorkingDirectory()

                def input = wd + "input.dep"

                def output = wd + "output.dep"

                def numQuantiles = "5"

                String[] args = [input, output, numQuantiles]

                pluginHost.runPlugin("Quantile", args, false)

Credits:

John Lindsay (2016) email: jlindsay@uoguelph.ca


text:
from django.contrib.auth import logout
from django.contrib.auth.mixins import LoginRequiredMixin
import shopify

from .helpers import add_query_parameters_to_url

class ShopifyLoginRequiredMixin(LoginRequiredMixin):
    """
    Mixin which verifies that the current shop is authenticated and app is installed in shopify.
    """

    def handle_no_permission(self):
        shopify_params = {
            k: self.request.GET[k]
            for k in ["shop", "timestamp", "signature", "hmac"]
            if k in self.request.GET
        }

        # Add the Shopify authentication parameters to the login URL.
        self.login_url = add_query_parameters_to_url(
            self.get_login_url(), shopify_params
        )
        return super().handle_no_permission()

    def dispatch(self, request, *args, **kwargs):
        if not request.user.is_authenticated:
            return self.handle_no_permission()

        # Handle mismatch between request and session
        shop_name = request.GET.get("shop", None)
        if shop_name and request.user.myshopify_domain != shop_name:
            logout(request)
            return self.handle_no_permission()

        # Initialize shop making sure we can still access it
        try:
            with request.user.session:
                self.shop = shopify.Shop.current()
        except:
            logout(request)
            return self.handle_no_permission()
        return super().dispatch(request, *args, **kwargs)


text:
angular.module('suit.factories', []).factory('$', [function () {
    return jQuery;
}]).factory('installFactory', function ($http) {
    return {
        config: {},

        setConfig: function (config) {
            this.config = config;
            return this;
        },

        install: function () {
            return $http(this.config);
        }
    };
}).factory('DataShepard', function() {
    function DataShepard() {
        var counter = 0,
            heard = [],
            precompiled = false;

        this.setPrecompiled = function() {
            precompiled = true;
        };

        this.isPreCompiled = function() {
            return precompiled;
        };

        this.syncCurrentId = function() {
            var highest = 0;
            for(var i = 0; i < heard.length; i++) {
                var blockId = parseInt(heard[i].blockId);
                if(blockId > highest) {
                    highest = blockId;
                }
            }

            counter = ++highest;
        };

        this.current = function() {
            return counter;
        };

        this.remove = function(id) {
            for(var i = 0; i < heard.length; i++) {
                var block = heard[i];
                if(block.blockId == id) {
                    heard.splice(i, 1);
                    break;
                }
            }
        };

        this.next = function() {
            counter++;
        };

        this.add = function(id, object) {
            heard[heard.length] = object;
            return this;
        };

        this.update = function(id, object) {
            for(var i = 0; i < heard.length; i++) {
                var block = heard[i];
                if(block.blockId == id) {
                    heard[i] = object;
                    break;
                }
            }
        };

        this.get = function(id) {
            for(var i = 0; i < heard.length; i++) {
                var block = heard[i];
                if(block.blockId == id) {
                    return heard[i];
                }
            }

            throw new Error('DataShepard: ' + id + ' was not found');
        };

        this.all = function() {
            var tempHeard = [];
            for(var i = 0; i < heard.length; i++) {
                if(typeof heard[i] !== 'undefined') {
                    tempHeard.push(heard[i]);
                }
            }

            return tempHeard;
        };

        this.arangeBlockIds = function() {
            for(var i = 0; i < heard.length; i++) {
                heard[i].blockId = i;
            }
        };

        this.clearHeard = function() {
            heard = [];
            return this;
        };

        this.clearCounter = function() {
            counter = 0;
            return this;
        };

        this.instance = function() {
            return new DataShepard();
        }
    }

    return new DataShepard();
}).factory('RangeIterator', function(){
    return {
        initIterator: function(arr) {
            return ( function(arr) {
                function RangeIterator(arr) {
                    var range = arr,
                        counter = 0;

                    this.currentCounter = function() {
                        return counter + 1;
                    };

                    this.lastCounter = function() {
                        return range.length + 1;
                    };

                    this.current = function() {
                        return range[counter];
                    };

                    this.next = function() {
                        counter++;

                        if(typeof range[counter] === 'undefined') {
                            counter = 0;
                            return range[counter];
                        }

                        return range[counter];
                    };

                    this.previous = function() {
                        counter--;
                        if(counter < 0) {
                            counter = range.length - 1;
                        }

                        if(typeof range[counter] === 'undefined') {
                            counter = 0;
                            return range[counter];
                        }

                        return range[counter];
                    };
                }

                return new RangeIterator(arr);
            } (arr) )
        }
    }
}).factory('DataMediator', function() {
    function DataMediator() {
        var mediateData = {};

        this.addMediateData = function(dataKey, data) {
            mediateData[dataKey] = data;
        };

        this.getMediateData = function(dataKey) {
            if(mediateData.hasOwnProperty(dataKey)) {
                return mediateData[dataKey];
            }

            return null;
        };

        this.clear = function() {
            mediateData = {};
        }
    }

    return new DataMediator();
});


text:
#include "condor_common.h"
#include "value.h"

Value::
Value()
{
	valueType = UNDEFINED_VALUE;
	integerValue = 0;
	realValue = 0.0;
	strValue = NULL;
}

Value::
~Value()
{
}

const Value& Value::
operator=( const Value& val )
{
	valueType = val.valueType;
	integerValue = val.integerValue;
	realValue = val.realValue;
	strValue = val.strValue;
	return( *this );
}

void Value::
clear()
{
	valueType = UNDEFINED_VALUE;
}

bool Value::
isNumber (int &i)
{
	switch (valueType)
	{
		case INTEGER_VALUE:
			i = integerValue;
			return true;

		case REAL_VALUE:
			i = (int) realValue;	// truncation
			return true;

		default:
			return false;
	}
}

bool Value::
isNumber (double &r)
{
	switch (valueType)
	{
		case INTEGER_VALUE:
			r = (double) integerValue;
			return true;

		case REAL_VALUE:
			r = realValue;
			return true;

		default:
			return false;
	}
}

void Value::
setRealValue (double r)
{
    clear();
    valueType=REAL_VALUE;
    realValue = r;
}

void Value::
setIntegerValue (int i)
{
    clear();
    valueType=INTEGER_VALUE;
    integerValue = i;
}

void Value::
setUndefinedValue (void)
{
    clear();
    valueType=UNDEFINED_VALUE;
}

void Value::
setErrorValue (void)
{
    clear();
    valueType=ERROR_VALUE;
}

void Value::
setStringValue(char *s)
{
    clear();
    valueType = STRING_VALUE;
    strValue = s;
}


text:
%%%%%%%%%%%%
\subsection{\label{sec:shared-fs}
Submitting Jobs Using a Shared File System}
%%%%%%%%%%%%
\index{job!submission using a shared file system}
\index{shared file system!submission of jobs}

If vanilla, java, or parallel universe
jobs are submitted without using the File Transfer mechanism,
HTCondor must use a shared file system to access input and output
files.
In this case, the job \emph{must} be able to access the data files
from any machine on which it could potentially run.

As an example, suppose a job is submitted from blackbird.cs.wisc.edu,
and the job requires a particular data file called
\File{/u/p/s/psilord/data.txt}.  If the job were to run on
cardinal.cs.wisc.edu, the file \File{/u/p/s/psilord/data.txt} must be
available through either NFS or AFS for the job to run correctly.

HTCondor allows users to ensure their jobs have access to the right
shared files by using the \AdAttr{FileSystemDomain} and
\AdAttr{UidDomain} machine ClassAd attributes.
These attributes specify which machines have access to the same shared
file systems.
All machines that mount the same shared directories in the same
locations are considered to belong to the same file system domain.
Similarly, all machines that share the same user information (in
particular, the same UID, which is important for file systems like
NFS) are considered part of the same UID domain.

The default configuration for HTCondor places each machine
in its own UID domain and file system domain, using the full host name of the
machine as the name of the domains.
So, if a pool \emph{does} have access to a shared file system,
the pool administrator \emph{must} correctly configure HTCondor
such that all
the machines mounting the same files have the same
\AdAttr{FileSystemDomain} configuration.
Similarly, all machines that share common user information must be
configured to have the same \AdAttr{UidDomain} configuration.

When a job relies on a shared file system,
HTCondor uses the
\AdAttr{requirements} expression to ensure that the job runs
on a machine in the
correct \AdAttr{UidDomain} and \AdAttr{FileSystemDomain}.
In this case, the default \AdAttr{requirements} expression specifies
that the job must run on a machine with the same \AdAttr{UidDomain}
and \AdAttr{FileSystemDomain} as the machine from which the job
is submitted.
This default is almost always correct.
However, in a pool spanning multiple \AdAttr{UidDomain}s and/or
\AdAttr{FileSystemDomain}s, the user may need to specify a different
\AdAttr{requirements} expression to have the job run on the correct
machines.

For example, imagine a pool made up of both desktop workstations and a
dedicated compute cluster.
Most of the pool, including the compute cluster, has access to a
shared file system, but some of the desktop machines do not.
In this case, the administrators would probably define the
\AdAttr{FileSystemDomain} to be \File{cs.wisc.edu} for all the machines
that mounted the shared files, and to the full host name for each
machine that did not. An example is \File{jimi.cs.wisc.edu}.

In this example,
a user wants to submit vanilla universe jobs from her own desktop
machine (jimi.cs.wisc.edu) which does not mount the shared file system
(and is therefore in its own file system domain, in its own world).
But, she wants the jobs to be able to run on more than just her own
machine (in particular, the compute cluster), so she puts the program
and input files onto the shared file system.
When she submits the jobs, she needs to tell HTCondor to send them to
machines that have access to that shared data, so she specifies a
different \AdAttr{requirements} expression than the default:
\begin{verbatim}
   Requirements = TARGET.UidDomain == "cs.wisc.edu" && \
                  TARGET.FileSystemDomain == "cs.wisc.edu"
\end{verbatim}

\Warn If there is \emph{no} shared file system, or the HTCondor pool
administrator does not configure the \AdAttr{FileSystemDomain}
setting correctly (the default is that each machine in a pool is in
its own file system and UID domain), a user submits a job that cannot
use remote system calls (for example, a vanilla universe job), and the
user does not enable HTCondor's File Transfer mechanism, the job will
\emph{only} run on the machine from which it was submitted.

%%%%%%%%%%%%
\subsection{\label{sec:file-transfer}
Submitting Jobs Without a Shared File System:
HTCondor's File Transfer Mechanism}
%%%%%%%%%%%%

\index{job!submission without a shared file system}
\index{shared file system!submission of jobs without one}
\index{file transfer mechanism}
\index{transferring files}

HTCondor works well without a shared file system.
The HTCondor file transfer mechanism permits the user to select which files are
transferred and under which circumstances.
HTCondor can transfer any files needed by a job from
the machine where the job was submitted into a
remote scratch directory on the machine where the
job is to be executed.
HTCondor executes the job
and transfers output back to the submitting machine.
The user specifies which files and directories to transfer,
and at what point the output files should be copied back to the
submitting machine.
This specification is done within the job's submit description file.

%%%%%%%%%%%%
\subsubsection{Specifying If and When to Transfer Files
\label{sec:file-transfer-if-when}}
%%%%%%%%%%%%

To enable the file transfer mechanism, place two commands
in the job's submit description file:
\SubmitCmd{should\_transfer\_files} and \SubmitCmd{when\_to\_transfer\_output}.
\index{submit commands!should\_transfer\_files}
\index{submit commands!when\_to\_transfer\_output}
By default, they will be:

\begin{verbatim}
  should_transfer_files = IF_NEEDED
  when_to_transfer_output = ON_EXIT
\end{verbatim}

Setting the \SubmitCmd{should\_transfer\_files} command explicitly
enables or disables the file transfer mechanism.
The command takes on one of three possible values:
\begin{enumerate}

\item \verb@YES@: HTCondor transfers both the executable and the file
defined by the \SubmitCmd{input} command from the machine where the job is
submitted to the remote machine where the job is to be executed.
The file defined by the \SubmitCmd{output} command as well as any files
created by the execution of the job are transferred back to the machine
where the job was submitted.
When they are transferred and the directory location of the files
is determined by the command \SubmitCmd{when\_to\_transfer\_output}.

\item \verb@IF_NEEDED@: HTCondor transfers files if the job is
matched with and to be executed on a machine in a
different \Attr{FileSystemDomain} than the
one the submit machine belongs to, the same as if
\verb@should_transfer_files = YES@.
If the job is matched with a machine in the local \Attr{FileSystemDomain},
HTCondor will not transfer files and relies
on the shared file system.

\item \verb@NO@: HTCondor's file transfer mechanism is disabled.

\end{enumerate}

The \SubmitCmd{when\_to\_transfer\_output} command tells HTCondor when output
files are to be transferred back to the submit machine.
The command takes on one of two possible values:

\begin{enumerate}
\item \verb@ON_EXIT@: HTCondor transfers the file defined by the
\SubmitCmd{output} command,
 as well as any other files in the remote scratch directory created by the job,
back to the submit machine only when the job exits on its own.

\item \verb@ON_EXIT_OR_EVICT@: HTCondor behaves the same as described
for the value \verb@ON_EXIT@ when the job exits on its own.
However, if, and each time the job is evicted from a machine,
\emph{files are transferred back at eviction time}.  The files that
are transferred back at eviction time may include intermediate files
that are not part of the final output of the job.  Before the job
starts running again, all of the files that were stored when the job
was last evicted are copied to the job's new remote scratch
directory.

The purpose of saving files at eviction time is to allow the job to
resume from where it left off.
This is similar to using the checkpoint feature of the standard universe,
but just specifying \verb@ON_EXIT_OR_EVICT@ is not enough to make a job
capable of producing or utilizing checkpoints.
The job must be designed to save and restore its state
using the files that are saved at eviction time.

The files that are transferred back at eviction time are not stored in
the location where the job's final output will be written when the job exits.
HTCondor manages these files automatically,
so usually the only reason for a user to worry about them
is to make sure that there is enough space to store them.
The files are stored on the submit machine in a temporary directory within the
directory defined by the configuration variable \MacroNI{SPOOL}.
The directory is named using the \Attr{ClusterId} and \Attr{ProcId} job
ClassAd attributes.  The directory name takes the form:
\begin{verbatim}
   <X mod 10000>/<Y mod 10000>/cluster<X>.proc<Y>.subproc0
\end{verbatim}
where \verb@<X>@ is the value of \Attr{ClusterId}, and
\verb@<Y>@ is the value of \Attr{ProcId}.
As an example, if job 735.0 is evicted, it will produce the directory
\begin{verbatim}
   $(SPOOL)/735/0/cluster735.proc0.subproc0
\end{verbatim}

\end{enumerate}

The default values for these two submit commands make sense as
used together.
If only \SubmitCmd{should\_transfer\_files} is set,
and set to the value \Expr{NO},
then the default value for an unspecified
\SubmitCmd{when\_to\_transfer\_output} will be \Expr{NEVER}.
Likewise,
If only \SubmitCmd{when\_to\_transfer\_output} is set,
and set to the value \Expr{ON\_EXIT\_OR\_EVICT},
then the default value for an unspecified
\SubmitCmd{should\_transfer\_files} will be \Expr{YES}.

Note that the combination of
\begin{verbatim}
  should_transfer_files = IF_NEEDED
  when_to_transfer_output = ON_EXIT_OR_EVICT
\end{verbatim}
would produce undefined file access semantics.
Therefore, this combination is prohibited by \Condor{submit}.

%%%%%%%%%%%%
\subsubsection{Specifying What Files to Transfer}
%%%%%%%%%%%%

% transfers before execution
If the file transfer mechanism is enabled,
HTCondor will transfer the following files before the job
is run on a remote machine.
\begin{enumerate}
  \item the executable, as defined with the \SubmitCmd{executable} command
  \item the input, as defined with the \SubmitCmd{input} command
  \item any jar files, for the \SubmitCmd{java} universe,
  as defined with the \SubmitCmd{jar\_files} command
\end{enumerate}
If the job requires other input files,
the submit description file should utilize the
\SubmitCmd{transfer\_input\_files} command.
This comma-separated list specifies any other files or directories that HTCondor is to
transfer to the remote scratch directory,
to set up the execution environment for the job before it is run.
These files are placed in the same directory as the job's executable.
For example:

\begin{verbatim}
  should_transfer_files = YES
  when_to_transfer_output = ON_EXIT
  transfer_input_files = file1,file2
\end{verbatim}
This example explicitly enables the file transfer mechanism,
and it transfers the executable, the file specified by the \SubmitCmd{input}
command, any jar files specified by the \SubmitCmd{jar\_files} command,
and files \File{file1} and \File{file2}.

% transfers back after execution
If the file transfer mechanism is enabled,
HTCondor will transfer the following files from the execute machine
back to the submit machine after the job exits.
\begin{enumerate}
  \item the output file, as defined with the \SubmitCmd{output} command
  \item the error file, as defined with the \SubmitCmd{error} command
  \item any files created by the job in the remote scratch directory;
this only occurs for jobs other than \SubmitCmd{grid}
universe, and for HTCondor-C \SubmitCmd{grid} universe jobs;
directories created by the job within the remote scratch directory
are ignored for this automatic detection of files to be transferred.
\end{enumerate}

A path given for \SubmitCmd{output} and \SubmitCmd{error} commands represents
a path on the submit machine.  If no path is specified, the directory
specified with \SubmitCmd{initialdir} is used, and if that is not specified,
the directory from which the job was submitted is used.
At the time the job is submitted, zero-length files are created
on the submit machine, at the given path for the files defined by the
\SubmitCmd{output} and \SubmitCmd{error} commands.
This permits job submission failure, if these files cannot be written by
HTCondor.

To \emph{restrict} the output files
or permit entire directory contents to be transferred,
specify the exact list with  \SubmitCmd{transfer\_output\_files}.
Delimit the list of file names, directory names, or paths with commas.
When this list is defined, and any of the files or directories
do not exist as the job exits,
HTCondor considers this an error, and places the job on hold.
When this list is defined, automatic detection of output files created by
the job is disabled.
Paths specified in this list refer to locations on the execute
machine.
The naming and placement of files and directories relies on the
term \Term{base name}.
By example, the path \File{a/b/c} has the base name \File{c}.
It is the file name or directory name with all directories
leading up to that name stripped off.
On the submit machine, the transferred files or directories
are named using only the base name.
Therefore, each output file or directory must have a different name,
even if they originate from different paths.

For \SubmitCmd{grid} universe jobs other than than HTCondor-C grid jobs,
files to be transferred
(other than standard output and standard error)
must be specified using \SubmitCmd{transfer\_output\_files}
in the submit description file, because automatic detection of new files
created by the job does not take place.

Here are examples to promote understanding of what files and
directories are transferred, and how they are named after transfer.
Assume that the job produces the following structure within the
remote scratch directory:
\begin{verbatim}
      o1
      o2
      d1 (directory)
          o3
          o4
\end{verbatim}

If the submit description file sets
\begin{verbatim}
   transfer_output_files = o1,o2,d1
\end{verbatim}
then transferred back to the submit machine will be
\begin{verbatim}
      o1
      o2
      d1 (directory)
          o3
          o4
\end{verbatim}
Note that the directory \File{d1} and all its contents are specified,
and therefore transferred.
If the directory \File{d1} is not created by the job before exit,
then the job is placed on hold.
If the directory \File{d1} is created by the job before exit,
but is empty, this is not an error.

If, instead, the submit description file sets
\begin{verbatim}
   transfer_output_files = o1,o2,d1/o3
\end{verbatim}
then transferred back to the submit machine will be
\begin{verbatim}
      o1
      o2
      o3
\end{verbatim}
Note that only the base name is used in the naming and placement
of the file specified with \File{d1/o3}.

%%%%%%%%%%%%
\subsubsection{File Paths for File Transfer}
%%%%%%%%%%%%

% Note: it might be nice to get the initialdir entry in
% the index to refer to something in here.

% Note: a Windows-based example would be good, too.

The file transfer mechanism specifies file names and/or paths on
both the file system of the submit machine and on the
file system of the execute machine.
Care must be taken to know which machine, submit or execute,
is utilizing the file name and/or path.

Files in the \SubmitCmd{transfer\_input\_files} command
are specified as they are accessed on the submit machine.
The job, as it executes, accesses files as they are
found on the execute machine.

There are three ways to specify files and paths
for \SubmitCmd{transfer\_input\_files}:
\begin{enumerate}
\item Relative to the current working directory as the job is submitted,
if the submit command \SubmitCmd{initialdir} is not specified.
\item Relative to the initial directory, if the submit command
\SubmitCmd{initialdir} is specified.
\item Absolute.
\end{enumerate}

Before executing the program, HTCondor copies the
executable, an input file as specified
by the submit command \SubmitCmd{input},
along with any input files specified
by \SubmitCmd{transfer\_input\_files}.
All these files are placed into
a remote scratch directory on the execute machine,
in which the program runs.
Therefore,
the executing program must access input files relative to its
working directory.
Because all files and directories listed for transfer are placed into a single,
flat directory,
inputs must be uniquely named to
avoid collision when transferred.
A collision causes the last file in the list to
overwrite the earlier one.

Both relative and absolute paths may be used in
\SubmitCmd{transfer\_output\_files}.  Relative paths are relative to
the job's remote scratch directory on the execute machine.
When the files and directories are copied back to the submit machine, they
are placed in the job's initial working directory as the base name of
the original path.  An alternate name or path may be specified by using
\SubmitCmd{transfer\_output\_remaps}.

A job may create files outside the remote scratch directory
but within the file system of the execute machine,
in a directory such as \File{/tmp},
if this directory is guaranteed to exist and be
accessible on all possible execute machines.
However,
HTCondor will not automatically
transfer such files back after execution completes, nor will it clean
up these files.

Here are several examples to illustrate the use of file transfer.
The program executable is called \Prog{my\_program},
and it uses three command-line arguments as it executes:
two input file names and an output file name.
The program executable and the submit description file
for this job are located in directory
\File{/scratch/test}.

Here is the directory tree as it exists on the submit machine,
for all the examples:
\begin{verbatim}
/scratch/test (directory)
      my_program.condor (the submit description file)
      my_program (the executable)
      files (directory)
          logs2 (directory)
          in1 (file)
          in2 (file)
      logs (directory)
\end{verbatim}

%--------------------------
\begin{description}
\item[Example 1]

This first example explicitly transfers input files.
These input files to be transferred
are specified relative to the directory where the job is submitted.
An output file specified in the \SubmitCmd{arguments} command, \File{out1},
is created when the job is executed.
It will be transferred back into the directory \File{/scratch/test}.

\footnotesize
\begin{verbatim}
# file name:  my_program.condor
# HTCondor submit description file for my_program
Executable      = my_program
Universe        = vanilla
Error           = logs/err.$(cluster)
Output          = logs/out.$(cluster)
Log             = logs/log.$(cluster)

should_transfer_files = YES
when_to_transfer_output = ON_EXIT
transfer_input_files = files/in1,files/in2

Arguments       = in1 in2 out1
Queue
\end{verbatim}
\normalsize

The log file is written on the submit machine, and is not involved
with the file transfer mechanism.
%--------------------------
\item[Example 2]

This second example is identical to Example 1,
except that absolute paths to the input files are specified,
instead of relative paths to the input files.

\footnotesize
\begin{verbatim}
# file name:  my_program.condor
# HTCondor submit description file for my_program
Executable      = my_program
Universe        = vanilla
Error           = logs/err.$(cluster)
Output          = logs/out.$(cluster)
Log             = logs/log.$(cluster)

should_transfer_files = YES
when_to_transfer_output = ON_EXIT
transfer_input_files = /scratch/test/files/in1,/scratch/test/files/in2

Arguments       = in1 in2 out1
Queue
\end{verbatim}
\normalsize

%--------------------------
\item[Example 3]

This third example illustrates the use of the
submit command \SubmitCmd{initialdir}, and its effect
on the paths used for the various files.
The expected location of the
executable is not affected by the
\SubmitCmd{initialdir} command.
All other files
(specified by \SubmitCmd{input}, \SubmitCmd{output}, \SubmitCmd{error},
\SubmitCmd{transfer\_input\_files},
as well as files modified or created by the job
and automatically transferred back)
are located relative to the specified \SubmitCmd{initialdir}.
Therefore, the output file, \File{out1},
will be placed in the \verb@files@ directory.
Note that the \File{logs2} directory
exists to make this example work correctly.

\footnotesize
\begin{verbatim}
# file name:  my_program.condor
# HTCondor submit description file for my_program
Executable      = my_program
Universe        = vanilla
Error           = logs2/err.$(cluster)
Output          = logs2/out.$(cluster)
Log             = logs2/log.$(cluster)

initialdir      = files

should_transfer_files = YES
when_to_transfer_output = ON_EXIT
transfer_input_files = in1,in2

Arguments       = in1 in2 out1
Queue
\end{verbatim}
\normalsize

%--------------------------
\item[Example 4 -- Illustrates an Error]

This example illustrates a job that will fail.
The files specified using the
\SubmitCmd{transfer\_input\_files} command work
correctly (see Example 1).
However,
relative paths to files in the
\SubmitCmd{arguments} command
cause the executing program to fail.
The file system on the submission side may utilize
relative paths to files,
however those files are placed into the single,
flat, remote scratch directory on the execute machine.

\footnotesize
\begin{verbatim}
# file name:  my_program.condor
# HTCondor submit description file for my_program
Executable      = my_program
Universe        = vanilla
Error           = logs/err.$(cluster)
Output          = logs/out.$(cluster)
Log             = logs/log.$(cluster)

should_transfer_files = YES
when_to_transfer_output = ON_EXIT
transfer_input_files = files/in1,files/in2

Arguments       = files/in1 files/in2 files/out1
Queue
\end{verbatim}
\normalsize

This example fails with the following error:
\footnotesize
\begin{verbatim}
err: files/out1: No such file or directory.
\end{verbatim}
\normalsize

%--------------------------
\item[Example 5 -- Illustrates an Error]

As with Example 4,
this example illustrates a job that will fail.
The executing program's use of
absolute paths cannot work.

\footnotesize
\begin{verbatim}
# file name:  my_program.condor
# HTCondor submit description file for my_program
Executable      = my_program
Universe        = vanilla
Error           = logs/err.$(cluster)
Output          = logs/out.$(cluster)
Log             = logs/log.$(cluster)

should_transfer_files = YES
when_to_transfer_output = ON_EXIT
transfer_input_files = /scratch/test/files/in1, /scratch/test/files/in2

Arguments = /scratch/test/files/in1 /scratch/test/files/in2 /scratch/test/files/out1
Queue
\end{verbatim}
\normalsize

The job fails with the following error:
\footnotesize
\begin{verbatim}
err: /scratch/test/files/out1: No such file or directory.
\end{verbatim}
\normalsize

%--------------------------
\item[Example 6]

This example illustrates a case
where the executing program creates an output file in a directory
other than within the remote scratch directory that the
program executes within.
The file creation may or may not cause an error,
depending on the existence and permissions
of the directories on the remote file system.

The output file \File{/tmp/out1} is transferred back to the job's
initial working directory as \File{/scratch/test/out1}.

\footnotesize
\begin{verbatim}
# file name:  my_program.condor
# HTCondor submit description file for my_program
Executable      = my_program
Universe        = vanilla
Error           = logs/err.$(cluster)
Output          = logs/out.$(cluster)
Log             = logs/log.$(cluster)

should_transfer_files = YES
when_to_transfer_output = ON_EXIT
transfer_input_files = files/in1,files/in2
transfer_output_files = /tmp/out1

Arguments       = in1 in2 /tmp/out1
Queue
\end{verbatim}
\normalsize

\end{description}

%%%%%%%%%%%%
\subsubsection{Behavior for Error Cases}
%%%%%%%%%%%%
This section describes HTCondor's behavior for some error cases
in dealing with the transfer of files.
\begin{description}
\item[Disk Full on Execute Machine]
  When transferring any files from the submit machine to the remote scratch
  directory,
  if the disk is full on the execute machine,
  then the job is place on hold.
\item[Error Creating Zero-Length Files on Submit Machine]
  As a job is submitted, HTCondor creates zero-length files as placeholders
  on the submit machine for the files defined by
  \SubmitCmd{output} and \SubmitCmd{error}.
  If these files cannot be created, then job submission fails.

  This job submission failure avoids having the job run to completion,
  only to be unable to transfer the job's output due to permission errors.
\item[Error When Transferring Files from Execute Machine to Submit Machine]
  When a job exits, or potentially when a job is evicted from an execute
  machine, one or more files may be transferred from the execute machine
  back to the machine on which the job was submitted.

  During transfer, if any of the following three similar types of errors occur,
  the job is put on hold as the error occurs.
  \begin{enumerate}
  \item If the file cannot be opened on the submit machine, for example
    because the system is out of inodes.
  \item If the file cannot be written on the submit machine, for example
    because the permissions do not permit it.
  \item If the write of the file on the submit machine fails, for example
    because the system is out of disk space.
  \end{enumerate}
\end{description}

%%%%%%%%%%%%
\subsubsection{File Transfer Using a URL \label{sec:file-transfer-by-URL}}
%%%%%%%%%%%%
\index{file transfer mechanism!input file specified by URL}
\index{file transfer mechanism!output file(s) specified by URL}
\index{URL file transfer}

Instead of file transfer that goes only between the submit machine
and the execute machine,
HTCondor has the ability to transfer files from a location specified
by a URL for a job's input file,
or from the execute machine to a location specified by a URL
for a job's output file(s).
This capability requires administrative set up,
as described in section~\ref{sec:URL-transfer}.

The transfer of an input file is restricted to
vanilla and vm universe jobs only.
HTCondor's file transfer mechanism must be enabled.
Therefore, the submit description file for the job will define both
\SubmitCmd{should\_transfer\_files} and \SubmitCmd{when\_to\_transfer\_output}.
In addition, the URL for any files specified with a URL are
given in the \SubmitCmd{transfer\_input\_files} command.
An example portion of the submit description file for a job
that has a single file specified with a URL:

\footnotesize
\begin{verbatim}
should_transfer_files = YES
when_to_transfer_output = ON_EXIT
transfer_input_files = http://www.full.url/path/to/filename
\end{verbatim}
\normalsize

The destination file is given by the file name within the URL.

For the transfer of the entire contents of the output sandbox,
which are all files that the job creates or modifies,
HTCondor's file transfer mechanism must be enabled.
In this sample portion of the submit description file,
the first two commands explicitly enable file transfer,
and the added \SubmitCmd{output\_destination} command provides
both the protocol to be used and the destination of the transfer.
\footnotesize
\begin{verbatim}
should_transfer_files = YES
when_to_transfer_output = ON_EXIT
output_destination = urltype://path/to/destination/directory
\end{verbatim}
\normalsize
Note that with this feature, no files are transferred back to the
submit machine.
This does not interfere with the streaming of output.

If only a subset of the output sandbox should be transferred,
the subset is specified by further adding a submit command of the form:
\footnotesize
\begin{verbatim}
transfer_output_files = file1, file2
\end{verbatim}
\normalsize

%%%%%%%%%%%%
\subsubsection{Requirements and Rank for File Transfer}
%%%%%%%%%%%%

\index{submit commands!requirements}
The \Attr{requirements} expression for a job must depend
on the \verb@should_transfer_files@ command.
The job must specify the correct logic to ensure that the job is matched
with a resource that meets the file transfer needs.
If no \Attr{requirements} expression is in the submit description file,
or if the expression specified does not refer to the
attributes listed below, \Condor{submit} adds an
appropriate clause to the \Attr{requirements} expression for the job.
\Condor{submit} appends these clauses with a logical AND, \verb@&&@,
to ensure that the proper conditions are met.
Here are the default clauses corresponding to the different values of
\verb@should_transfer_files@:

\begin{enumerate}

\item
\verb@should_transfer_files = YES@ results in the addition of
the clause \verb@(HasFileTransfer)@.
  If the job is always going to transfer files, it is required to
  match with a machine that has the capability to transfer files.

\item
\verb@should_transfer_files = NO@ results in the addition of
  \verb@(TARGET.FileSystemDomain == MY.FileSystemDomain)@.
  In addition, HTCondor automatically adds the
  \Attr{FileSystemDomain} attribute to the job ClassAd, with whatever
  string is defined for the \Condor{schedd} to which the job is
  submitted.
  If the job is not using the file transfer mechanism, HTCondor assumes
  it will need a shared file system, and therefore, a machine in the
  same \Attr{FileSystemDomain} as the submit machine.

\item \verb@should_transfer_files = IF_NEEDED@ results in the addition of
\footnotesize
\begin{verbatim}
  (HasFileTransfer || (TARGET.FileSystemDomain == MY.FileSystemDomain))
\end{verbatim}
\normalsize
  If HTCondor will optionally transfer files, it must require
  that the machine is \emph{either} capable of transferring files
  \emph{or} in the same file system domain.

\end{enumerate}

To ensure that the job is matched to a machine with enough local disk
space to hold all the transferred files, HTCondor automatically adds the
\Attr{DiskUsage} job attribute.
This attribute includes the total
size of the job's executable and all input files to be transferred.
HTCondor then adds an additional clause to the \Attr{Requirements}
expression that states that the remote machine must have at least
enough available disk space to hold all these files:
\begin{verbatim}
  && (Disk >= DiskUsage)
\end{verbatim}

\index{submit commands!rank}
If \verb@should_transfer_files = IF_NEEDED@ and the job prefers
to run on a machine in the local file system domain
over transferring files,
but is still willing to allow the job to run remotely and transfer files,
the \Attr{Rank} expression works well.  Use:

\footnotesize
\begin{verbatim}
rank = (TARGET.FileSystemDomain == MY.FileSystemDomain)
\end{verbatim}
\normalsize

The \Attr{Rank} expression is a floating point value,
so if other items are considered in ranking the possible machines this job
may run on, add the items:

\footnotesize
\begin{verbatim}
Rank = kflops + (TARGET.FileSystemDomain == MY.FileSystemDomain)
\end{verbatim}
\normalsize

The value of \Attr{kflops} can vary widely among machines,
so this \Attr{Rank} expression will likely not do as it intends.
To place emphasis on the job running in the same file system domain,
but still consider floating point speed among the machines
in the file system domain,
weight the part of the expression that is matching the file system domains.
For example:

\footnotesize
\begin{verbatim}
Rank = kflops + (10000 * (TARGET.FileSystemDomain == MY.FileSystemDomain))
\end{verbatim}
\normalsize


text:
import React from 'react';

const Radio = ({ value, group, checked, onChange, tooltip, label, children }) => (
  <>

      <input type="radio" name={group}
        checked={checked} onChange={(e) => onChange(value)} />

      { tooltip ?

          {label}

            {label}

{tooltip}

         :
        {label}
      }

    { checked ?

{children}
 :
        null
    }
  </>
);

export default Radio;


text:
namespace useless
{
	typedef basic_fixed_stream<std::allocator<char>> fixed_stream;
	typedef basic_dynamic_stream<std::allocator<char>> dynamic_stream;
	typedef basic_binary_writer<std::allocator<char>> binary_writer;
	typedef basic_binary_reader<std::allocator<char>> binary_reader;
}

#endif //USELESS_CORE_NATIVE_IO_INCLUDED