text:
/**
 * ag-grid - Advanced Data Grid / Data Table supporting Javascript / React / AngularJS / Web Components
 * @version v12.0.1
 * @link http://www.ag-grid.com/
 * @license MIT
 */
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
var Constants = (function () {
    function Constants() {
    }
    Constants.STEP_EVERYTHING = 0;
    Constants.STEP_FILTER = 1;
    Constants.STEP_SORT = 2;
    Constants.STEP_MAP = 3;
    Constants.STEP_AGGREGATE = 4;
    Constants.STEP_PIVOT = 5;
    Constants.ROW_BUFFER_SIZE = 10;
    Constants.LAYOUT_INTERVAL = 500;
    Constants.EXPORT_TYPE_DRAG_COPY = 'dragCopy';
    Constants.EXPORT_TYPE_CLIPBOARD = 'clipboard';
    Constants.EXPORT_TYPE_EXCEL = 'excel';
    Constants.EXPORT_TYPE_CSV = 'csv';
    Constants.KEY_BACKSPACE = 8;
    Constants.KEY_TAB = 9;
    Constants.KEY_ENTER = 13;
    Constants.KEY_SHIFT = 16;
    Constants.KEY_ESCAPE = 27;
    Constants.KEY_SPACE = 32;
    Constants.KEY_LEFT = 37;
    Constants.KEY_UP = 38;
    Constants.KEY_RIGHT = 39;
    Constants.KEY_DOWN = 40;
    Constants.KEY_DELETE = 46;
    Constants.KEY_A = 65;
    Constants.KEY_C = 67;
    Constants.KEY_V = 86;
    Constants.KEY_D = 68;
    Constants.KEY_F2 = 113;
    Constants.KEY_PAGE_UP = 33;
    Constants.KEY_PAGE_DOWN = 34;
    Constants.KEY_PAGE_HOME = 36;
    Constants.KEY_PAGE_END = 35;
    Constants.KEY_PAGE_UP_NAME = 'pageUp';
    Constants.KEY_PAGE_DOWN_NAME = 'pageDown';
    Constants.KEY_PAGE_HOME_NAME = 'home';
    Constants.KEY_PAGE_END_NAME = 'end';
    Constants.KEY_CTRL_UP_NAME = 'ctrlUp';
    Constants.KEY_CTRL_LEFT_NAME = 'ctrlLeft';
    Constants.KEY_CTRL_RIGHT_NAME = 'ctrlRight';
    Constants.KEY_CTRL_DOWN_NAME = 'ctrlDown';
    Constants.ROW_MODEL_TYPE_INFINITE = 'infinite';
    Constants.ROW_MODEL_TYPE_VIEWPORT = 'viewport';
    Constants.ROW_MODEL_TYPE_IN_MEMORY = 'inMemory';
    Constants.ROW_MODEL_TYPE_ENTERPRISE = 'enterprise';
    Constants.DEPRECATED_ROW_MODEL_TYPE_NORMAL = 'normal';
    Constants.ALWAYS = 'always';
    Constants.ONLY_WHEN_GROUPING = 'onlyWhenGrouping';
    Constants.PINNED_TOP = 'top';
    Constants.PINNED_BOTTOM = 'bottom';
    Constants.VERTICAL_SCROLL_KEYS_ID = 'verticalScrollKeys';
    Constants.HORIZONTAL_SCROLL_KEYS_ID = 'horizontalScrollKeys';
    Constants.DIAGONAL_SCROLL_KEYS_ID = 'diagonalScrollKeys';
    Constants.VERTICAL_SCROLL_KEYS = {
        id: Constants.VERTICAL_SCROLL_KEYS_ID,
        bindings: [{
                id: Constants.KEY_PAGE_UP_NAME,
                ctlRequired: false,
                altRequired: false,
                keyCode: Constants.KEY_PAGE_UP
            }, {
                id: Constants.KEY_PAGE_DOWN_NAME,
                ctlRequired: false,
                altRequired: false,
                keyCode: Constants.KEY_PAGE_DOWN
            }, {
                id: Constants.KEY_CTRL_UP_NAME,
                ctlRequired: true,
                altRequired: false,
                keyCode: Constants.KEY_UP
            }, {
                id: Constants.KEY_CTRL_DOWN_NAME,
                ctlRequired: true,
                altRequired: false,
                keyCode: Constants.KEY_DOWN
            }]
    };
    Constants.HORIZONTAL_SCROLL_KEYS = {
        id: Constants.HORIZONTAL_SCROLL_KEYS_ID,
        bindings: [{
                id: Constants.KEY_CTRL_LEFT_NAME,
                ctlRequired: true,
                altRequired: false,
                keyCode: Constants.KEY_LEFT
            }, {
                id: Constants.KEY_CTRL_RIGHT_NAME,
                ctlRequired: true,
                altRequired: false,
                keyCode: Constants.KEY_RIGHT
            }]
    };
    Constants.DIAGONAL_SCROLL_KEYS = {
        id: Constants.DIAGONAL_SCROLL_KEYS_ID,
        bindings: [{
                id: Constants.KEY_PAGE_HOME_NAME,
                ctlRequired: false,
                altRequired: false,
                keyCode: Constants.KEY_PAGE_HOME
            }, {
                id: Constants.KEY_PAGE_END_NAME,
                ctlRequired: false,
                altRequired: false,
                keyCode: Constants.KEY_PAGE_END
            }]
    };
    return Constants;
}());
exports.Constants = Constants;


text:
<?php

class Player {
	public $Id;

	public $Name = "Gast";
	public $Field = null;
	public $Game = null;

	public $Ready = 0;
	public $NextRound = 0;

	public function __construct($id, $name) {
		$this->Id = $id;
		$this->Name = $name;
	}

	public static function load($id, $game = null) {
		global $db,$app;
		$res = $db->query("SELECT name,game,field,ready,nextRound FROM player WHERE id = $id");
		$row = $res->fetch_assoc();
		$ply = new Player($id, $row["name"]);
		$ply->Ready = $row["ready"];
		$ply->NextRound = $row["nextRound"];

		if($game)
			$ply->Game = $game;
		elseif($row["game"] > 0)
			$ply->Game = Game::load($row["game"], $ply);

		if($row["field"] > 0)
			$ply->Field = PlayerField::load($row["field"]);
		$app->saveObj($ply);
		return $ply;
	}

	/* API */
	public function createGame($name) {
		$this->Game = Game::create($name, $this->Id);
		$this->Game->addPlayer($this);
		return array("State" => "Lobby");
	}

	public function joinGame($game) {
		if(!$game->addPlayer($this))
			return "FAILED";

		$this->Game = $game;

		return array("State" => "Lobby");
	}

	public function leaveGame() {
		if($this->Game) {
			$this->Game->removePlayer($this);
			$this->Game = null;
		}
		if($this->Field) {
			$this->Field->destroy();
			$this->Field = null;
		}
		$this->Ready = 0;
		$this->NextRound = 0;
		return array("State" => "List");
	}

	public function startGame() {
		if($this->Game->Host != $this->Id)
			return "Not Host";
		$this->Game->start();
		return "OK";
	}

	public function getState() {
		if($this->Game == null && $this->Field == null)
			return "List";
		elseif($this->Game != null && $this->Field == null)
			return "Lobby";
		elseif($this->Game != null && $this->Field != null)
			return "Ingame";
		return "ERROR";
	}

	public function update() {
		$res = array();

		if($this->Game == null && $this->Field == null) { //Game List
			$res["State"] = "List";
			$res["Games"] = Game::getList();
		}
		elseif($this->Game != null && $this->Field == null) { //Game Lobby
			$res["State"] = "Lobby";
			$res["Player"] = array();
			foreach($this->Game->Player as $ply)
				$res["Player"][$ply->Id] = $ply->Name;
			$res["Host"] = $this->Game->Host;
			$res["GameName"] = $this->Game->Name;
		}
		elseif($this->Game != null && $this->Field != null) { // Ingame
			$res["State"] = "Ingame";
			$round = $this->Game->checkNextRound();
			if($round == "FINISHED") {
				//Show Results
				$res["State"] = "Results";
			}
			if($this->NextRound == true) {
				$this->NextRound = 0;
				$res["StartNextRound"] = true;
			}
			$res["Piece"] = $this->Game->CurrentPiece->get();
			$res["Round"] = $this->Game->Round;
			$res["Player"] = array();
			foreach($this->Game->Player as $ply) {
				if($ply == $this) continue;
				$res["Player"][] = array(
						"Name" => $ply->Name,
						"State" => $ply->Ready,
						"Points" => $ply->Field->getPoints()
						);
			}
			$res["Points"] = $this->Field->getPoints();
			$res["GameName"] = $this->Game->Name;
			$res["Ready"] = $this->Ready;
		}
		return $res;
	}

	public function placePiece($x, $y) {
		if($this->Game == null || $this->Field == null) //Not Ingame
			return "Not Ingame";
		if($this->Ready)
			return "Placed";
		if(($r = $this->Field->placePiece($this->Game->CurrentPiece, $x, $y)) != "OK")
			return $r;
		$this->Ready = 1;
		return "OK";
	}

	/* INTERNAL */
	public function enterGame() {
		$this->Field = PlayerField::create();
	}

	public function nextRound() {
		$this->Ready = 0;
		$this->NextRound = 1;
	}

	public function save() {
		global $db;
		$game = 0;
		if($this->Game){
			//$this->Game->save();
			$game = $this->Game->Id;
		}
		$field = 0;
		if($this->Field){
			//$this->Field->save();
			$field = $this->Field->Id;
		}
		$db->query("UPDATE player SET game=$game, field=$field, ready=$this->Ready, nextRound=$this->NextRound WHERE id=$this->Id") or die($db->error);
	}
};

?>

redpajama_set_name: RedPajamaGithub


text:
package com.alibaba.json.bvt.serializer;

import java.io.StringWriter;
import java.util.Collections;
import java.util.LinkedHashMap;
import java.util.Map;

import org.junit.Assert;
import junit.framework.TestCase;

import com.alibaba.fastjson.serializer.JSONSerializer;
import com.alibaba.fastjson.serializer.SerializeWriter;
import com.alibaba.fastjson.serializer.SerializerFeature;

public class JSONSerializerFeatureTest extends TestCase {

    public void test_0() throws Exception {
        JSONSerializer serializer = new JSONSerializer(new SerializeWriter());

        Assert.assertEquals(true, serializer.isEnabled(SerializerFeature.QuoteFieldNames));
        Assert.assertEquals(false, serializer.isEnabled(SerializerFeature.UseSingleQuotes));
    }

    public void test_0_g() throws Exception {
        JSONSerializer serializer = new JSONSerializer(new SerializeWriter());

        Assert.assertEquals(true, serializer.isEnabled(SerializerFeature.QuoteFieldNames));
        Assert.assertEquals(false, serializer.isEnabled(SerializerFeature.UseSingleQuotes));
    }

    public void test_1() throws Exception {
        JSONSerializer serializer = new JSONSerializer(new SerializeWriter());

        Assert.assertEquals(true, serializer.isEnabled(SerializerFeature.QuoteFieldNames));
        Assert.assertEquals(false, serializer.isEnabled(SerializerFeature.UseSingleQuotes));

        serializer.config(SerializerFeature.UseSingleQuotes, true);
        Assert.assertEquals(true, serializer.isEnabled(SerializerFeature.UseSingleQuotes));

        serializer.write("abc");

        Assert.assertEquals("'abc'", serializer.getWriter().toString());
    }

    public void test_1_s() throws Exception {
        JSONSerializer serializer = new JSONSerializer(new SerializeWriter());

        Assert.assertEquals(true, serializer.isEnabled(SerializerFeature.QuoteFieldNames));
        Assert.assertEquals(false, serializer.isEnabled(SerializerFeature.UseSingleQuotes));

        serializer.config(SerializerFeature.UseSingleQuotes, true);
        Assert.assertEquals(true, serializer.isEnabled(SerializerFeature.UseSingleQuotes));

        serializer.write("abc");

        Assert.assertEquals("'abc'", serializer.getWriter().toString());
    }

    public void test_2() throws Exception {
        JSONSerializer serializer = new JSONSerializer(new SerializeWriter());

        serializer.config(SerializerFeature.UseSingleQuotes, true);
        Assert.assertEquals(true, serializer.isEnabled(SerializerFeature.UseSingleQuotes));

        serializer.write(Collections.singletonMap("age", 33));

        Assert.assertEquals("{'age':33}", serializer.getWriter().toString());
    }

    public void test_2_s() throws Exception {
        JSONSerializer serializer = new JSONSerializer(new SerializeWriter());

        serializer.config(SerializerFeature.UseSingleQuotes, true);
        Assert.assertEquals(true, serializer.isEnabled(SerializerFeature.UseSingleQuotes));

        serializer.write(Collections.singletonMap("age", 33));

        Assert.assertEquals("{'age':33}", serializer.getWriter().toString());
    }

    public void test_3() throws Exception {
        JSONSerializer serializer = new JSONSerializer(new SerializeWriter());

        serializer.config(SerializerFeature.QuoteFieldNames, false);
        Assert.assertEquals(false, serializer.isEnabled(SerializerFeature.QuoteFieldNames));

        serializer.write(Collections.singletonMap("age", 33));

        Assert.assertEquals("{age:33}", serializer.getWriter().toString());
    }

    public void test_3_s() throws Exception {
        JSONSerializer serializer = new JSONSerializer(new SerializeWriter());

        serializer.config(SerializerFeature.QuoteFieldNames, false);
        Assert.assertEquals(false, serializer.isEnabled(SerializerFeature.QuoteFieldNames));

        serializer.write(Collections.singletonMap("age", 33));

        Assert.assertEquals("{age:33}", serializer.getWriter().toString());
    }

    public void test_4() throws Exception {
        JSONSerializer serializer = new JSONSerializer(new SerializeWriter());

        serializer.config(SerializerFeature.QuoteFieldNames, false);
        Assert.assertEquals(false, serializer.isEnabled(SerializerFeature.QuoteFieldNames));

        serializer.write(Collections.singletonMap("a\nge", 33));

        Assert.assertEquals("{\"a\\nge\":33}", serializer.getWriter().toString());
    }

    public void test_4_s() throws Exception {
        JSONSerializer serializer = new JSONSerializer(new SerializeWriter());

        serializer.config(SerializerFeature.QuoteFieldNames, false);
        Assert.assertEquals(false, serializer.isEnabled(SerializerFeature.QuoteFieldNames));

        serializer.write(Collections.singletonMap("a\nge", 33));

        Assert.assertEquals("{\"a\\nge\":33}", serializer.getWriter().toString());
    }

    public void test_5() throws Exception {
        JSONSerializer serializer = new JSONSerializer(new SerializeWriter());

        serializer.config(SerializerFeature.QuoteFieldNames, false);
        Assert.assertEquals(false, serializer.isEnabled(SerializerFeature.QuoteFieldNames));
        serializer.config(SerializerFeature.UseSingleQuotes, true);
        Assert.assertEquals(true, serializer.isEnabled(SerializerFeature.UseSingleQuotes));

        serializer.write(Collections.singletonMap("a\nge", 33));

        Assert.assertEquals("{'a\\nge':33}", serializer.getWriter().toString());
    }

    public void test_5_s() throws Exception {
        JSONSerializer serializer = new JSONSerializer(new SerializeWriter());

        serializer.config(SerializerFeature.QuoteFieldNames, false);
        Assert.assertEquals(false, serializer.isEnabled(SerializerFeature.QuoteFieldNames));
        serializer.config(SerializerFeature.UseSingleQuotes, true);
        Assert.assertEquals(true, serializer.isEnabled(SerializerFeature.UseSingleQuotes));

        serializer.write(Collections.singletonMap("a\nge", 33));

        Assert.assertEquals("{'a\\nge':33}", serializer.getWriter().toString());
    }

    public void test_6() throws Exception {
        JSONSerializer serializer = new JSONSerializer(new SerializeWriter());

        serializer.config(SerializerFeature.QuoteFieldNames, false);
        Assert.assertEquals(false, serializer.isEnabled(SerializerFeature.QuoteFieldNames));
        serializer.config(SerializerFeature.UseSingleQuotes, true);
        Assert.assertEquals(true, serializer.isEnabled(SerializerFeature.UseSingleQuotes));

        serializer.write(Collections.singletonMap("a'ge", 33));

        Assert.assertEquals("{'a\\'ge':33}", serializer.getWriter().toString());
    }

    public void test_6_s() throws Exception {
        JSONSerializer serializer = new JSONSerializer(new SerializeWriter());

        serializer.config(SerializerFeature.QuoteFieldNames, false);
        Assert.assertEquals(false, serializer.isEnabled(SerializerFeature.QuoteFieldNames));
        serializer.config(SerializerFeature.UseSingleQuotes, true);
        Assert.assertEquals(true, serializer.isEnabled(SerializerFeature.UseSingleQuotes));

        serializer.write(Collections.singletonMap("a'ge", 33));

        Assert.assertEquals("{'a\\'ge':33}", serializer.getWriter().toString());
    }

    public void test_7() throws Exception {
        JSONSerializer serializer = new JSONSerializer();

        serializer.config(SerializerFeature.QuoteFieldNames, false);
        Assert.assertEquals(false, serializer.isEnabled(SerializerFeature.QuoteFieldNames));

        serializer.write(new User(33));

        Assert.assertEquals("{age:33}", serializer.getWriter().toString());
    }

    public void test_7_s() throws Exception {
        JSONSerializer serializer = new JSONSerializer();

        serializer.config(SerializerFeature.QuoteFieldNames, false);
        Assert.assertEquals(false, serializer.isEnabled(SerializerFeature.QuoteFieldNames));

        serializer.write(new User(33));

        Assert.assertEquals("{age:33}", serializer.getWriter().toString());
    }

    public void test_8() throws Exception {
        JSONSerializer serializer = new JSONSerializer();

        serializer.config(SerializerFeature.UseSingleQuotes, true);
        Assert.assertEquals(true, serializer.isEnabled(SerializerFeature.UseSingleQuotes));

        serializer.write(new User(33));

        Assert.assertEquals("{'age':33}", serializer.getWriter().toString());
    }

    public void test_8_s() throws Exception {
        JSONSerializer serializer = new JSONSerializer();

        serializer.config(SerializerFeature.UseSingleQuotes, true);
        Assert.assertEquals(true, serializer.isEnabled(SerializerFeature.UseSingleQuotes));

        serializer.write(new User(33));

        Assert.assertEquals("{'age':33}", serializer.getWriter().toString());
    }

    public void test_9() throws Exception {
        JSONSerializer serializer = new JSONSerializer();

        serializer.config(SerializerFeature.QuoteFieldNames, false);
        Assert.assertEquals(false, serializer.isEnabled(SerializerFeature.QuoteFieldNames));
        serializer.config(SerializerFeature.WriteMapNullValue, false);
        Assert.assertEquals(false, serializer.isEnabled(SerializerFeature.WriteMapNullValue));

        StringWriter out = new StringWriter();

        Map map = new LinkedHashMap();
        map.put("a", null);
        map.put("age", 33);
        map.put("c", null);

        serializer.write(map);

        Assert.assertEquals("{age:33}", serializer.getWriter().toString());
    }

    public void test_9_s() throws Exception {
        JSONSerializer serializer = new JSONSerializer();

        serializer.config(SerializerFeature.QuoteFieldNames, false);
        Assert.assertEquals(false, serializer.isEnabled(SerializerFeature.QuoteFieldNames));
        serializer.config(SerializerFeature.WriteMapNullValue, false);
        Assert.assertEquals(false, serializer.isEnabled(SerializerFeature.WriteMapNullValue));

        SerializeWriter out = new SerializeWriter();

        Map map = new LinkedHashMap();
        map.put("a", null);
        map.put("age", 33);
        map.put("c", null);

        serializer.write(map);

        Assert.assertEquals("{age:33}", serializer.getWriter().toString());
    }

    public static class User {

        private int age;

        public User(){
        }

        public User(int age){
            this.age = age;
        }

        public int getAge() {
            return age;
        }

        public void setAge(int age) {
            this.age = age;
        }

    }

}


text:
<?php

namespace Phlexible\Component\MediaManager\Meta;

use Phlexible\Component\MediaManager\Volume\ExtendedFileInterface;
use Phlexible\Component\MetaSet\Model\MetaSet;
use Phlexible\Component\MetaSet\Model\MetaSetManagerInterface;

/**
 * File meta set resolver
 *
 * @author Stephan Wentz <sw@brainbits.net>
 */
class FileMetaSetResolver
{
    /**
     * @var MetaSetManagerInterface
     */
    private $metaSetManager;

    /**
     * @param MetaSetManagerInterface $metaSetManager
     */
    public function __construct(MetaSetManagerInterface $metaSetManager)
    {
        $this->metaSetManager = $metaSetManager;
    }

    /**
     * @param ExtendedFileInterface $file
     *
     * @return MetaSet[]
     */
    public function resolve(ExtendedFileInterface $file)
    {
        $metaSets = [];
        foreach ($file->getMetasets() as $metaSetId) {
            $metaSet = $this->metaSetManager->find($metaSetId);
            if ($metaSet) {
                $metaSets[] = $metaSet;
            }
        }

        return $metaSets;
    }
}


text:
from flask.ext.lastuser.sqlalchemy import UserBase
from . import db

__all__ = ['User']

# --- Models ------------------------------------------------------------------

class User(UserBase, db.Model):
    __tablename__ = 'user'
    description = db.Column(db.Text, default=u'', nullable=False)


text:
yum -y install git
git clone https://github.com/ankurkanoria/do-setup-test.git /opt/setup-scripts
source /opt/setup-scripts/init.sh


text:
<?xml version="1.0" encoding="utf-8"?>
<android.support.constraint.ConstraintLayout xmlns:android="http://schemas.android.com/apk/res/android"
    xmlns:app="http://schemas.android.com/apk/res-auto"
    xmlns:tools="http://schemas.android.com/tools"
    android:layout_width="match_parent"
    android:layout_height="match_parent"
    app:layout_behavior="@string/appbar_scrolling_view_behavior"
    tools:context="com.vivo.yzz.music.MainActivity"
    tools:showIn="@layout/app_bar_main">
    <android.support.v4.view.ViewPager
        android:id="@+id/view_pager"
        android:layout_width="match_parent"
        android:layout_height="wrap_content">
        <android.support.v4.view.PagerTabStrip
            android:id="@+id/pager_tab"
            android:background="@color/colorPrimary"
            android:layout_width="match_parent"
            android:layout_height="wrap_content">

        </android.support.v4.view.PagerTabStrip>
    </android.support.v4.view.ViewPager>

</android.support.constraint.ConstraintLayout>


text:
from pexdoc import contract

@contract(number="int|float", frac_length="int,>=0", rjust=bool)
def peng(number, frac_length, rjust=True):
    return str(number)


text:
.class Landroid/service/carrier/CarrierMessagingService$ICarrierMessagingWrapper$2;
.super Ljava/lang/Object;
.source "CarrierMessagingService.java"

# interfaces
.implements Landroid/service/carrier/CarrierMessagingService$ResultCallback;

# annotations
.annotation system Ldalvik/annotation/EnclosingMethod;
    value = Landroid/service/carrier/CarrierMessagingService$ICarrierMessagingWrapper;->sendTextSms(Ljava/lang/String;ILjava/lang/String;ILandroid/service/carrier/ICarrierMessagingCallback;)V
.end annotation

.annotation system Ldalvik/annotation/InnerClass;
    accessFlags = 0x0
    name = null
.end annotation

.annotation system Ldalvik/annotation/Signature;
    value = {
        "Ljava/lang/Object;",
        "Landroid/service/carrier/CarrierMessagingService$ResultCallback",
        "<",
        "Landroid/service/carrier/CarrierMessagingService$SendSmsResult;",
        ">;"
    }
.end annotation

# instance fields
.field final synthetic this$1:Landroid/service/carrier/CarrierMessagingService$ICarrierMessagingWrapper;

.field final synthetic val$callback:Landroid/service/carrier/ICarrierMessagingCallback;

# direct methods
.method constructor <init>(Landroid/service/carrier/CarrierMessagingService$ICarrierMessagingWrapper;Landroid/service/carrier/ICarrierMessagingCallback;)V
    .locals 0

    iput-object p1, p0, Landroid/service/carrier/CarrierMessagingService$ICarrierMessagingWrapper$2;->this$1:Landroid/service/carrier/CarrierMessagingService$ICarrierMessagingWrapper;

    iput-object p2, p0, Landroid/service/carrier/CarrierMessagingService$ICarrierMessagingWrapper$2;->val$callback:Landroid/service/carrier/ICarrierMessagingCallback;

    invoke-direct {p0}, Ljava/lang/Object;-><init>()V

    return-void
.end method

# virtual methods
.method public onReceiveResult(Landroid/service/carrier/CarrierMessagingService$SendSmsResult;)V
    .locals 3
    .annotation system Ldalvik/annotation/Throws;
        value = {
            Landroid/os/RemoteException;
        }
    .end annotation

    iget-object v0, p0, Landroid/service/carrier/CarrierMessagingService$ICarrierMessagingWrapper$2;->val$callback:Landroid/service/carrier/ICarrierMessagingCallback;

    invoke-virtual {p1}, Landroid/service/carrier/CarrierMessagingService$SendSmsResult;->getSendStatus()I

    move-result v1

    invoke-virtual {p1}, Landroid/service/carrier/CarrierMessagingService$SendSmsResult;->getMessageRef()I

    move-result v2

    invoke-interface {v0, v1, v2}, Landroid/service/carrier/ICarrierMessagingCallback;->onSendSmsComplete(II)V

    return-void
.end method

.method public bridge synthetic onReceiveResult(Ljava/lang/Object;)V
    .locals 0
    .annotation system Ldalvik/annotation/Throws;
        value = {
            Landroid/os/RemoteException;
        }
    .end annotation

    check-cast p1, Landroid/service/carrier/CarrierMessagingService$SendSmsResult;

    invoke-virtual {p0, p1}, Landroid/service/carrier/CarrierMessagingService$ICarrierMessagingWrapper$2;->onReceiveResult(Landroid/service/carrier/CarrierMessagingService$SendSmsResult;)V

    return-void
.end method


text:
package main

import (
	"fmt"
	"time"

	"github.com/kubeflow/arena/pkg/apis/arenaclient"
	"github.com/kubeflow/arena/pkg/apis/logger"
	"github.com/kubeflow/arena/pkg/apis/training"
	"github.com/kubeflow/arena/pkg/apis/types"
)

func main() {
	jobName := "pytorch-test"
	jobType := types.PytorchTrainingJob
	// create arena client
	client, err := arenaclient.NewArenaClient(types.ArenaClientArgs{
		Kubeconfig: "",
		LogLevel:   "info",
		Namespace:  "default",
	})
	if err != nil {
		fmt.Printf("failed to create arena client,reason: %v", err)
		return
	}
	// create tfjob
	/* command:
	   arena \
	   submit \
	   pytorchjob \
	   --name=pytorch-standalone-test \
	   --gpus=1 \
	   --sync-mode=git \
	   --tensorboard \
	   --sync-source=https://code.aliyun.com/370272561/mnist-pytorch.git \
	   --loglevel debug \
	   --image=registry.cn-shanghai.aliyuncs.com/ai-samples/pytorch-with-tensorboard:1.5.1-cuda10.1-cudnn7-runtime \
	   "python /root/code/mnist-pytorch/mnist.py --backend gloo"
	*/
	submitJob, err := training.NewPytorchJobBuilder().
		Name(jobName).
		GPUCount(1).
		SyncMode("git").
		SyncSource("https://code.aliyun.com/370272561/mnist-pytorch.git").
		Image("registry.cn-shanghai.aliyuncs.com/ai-samples/pytorch-with-tensorboard:1.5.1-cuda10.1-cudnn7-runtime").
		Command([]string{"python /root/code/mnist-pytorch/mnist.py --backend gloo"}).Build()
	if err != nil {
		fmt.Printf("failed to build pytorchjob,reason: %v\n", err)
		return
	}
	// submit tfjob
	if err := client.Training().Submit(submitJob); err != nil {
		fmt.Printf("failed to submit job,reason: %v\n", err)
		return
	}
	// list all jobs
	jobInfos, err := client.Training().List(true, types.AllTrainingJob, false)
	if err != nil {
		fmt.Printf("failed to list all jobs in namespace,reason: %v\n", err)
		return
	}
	for _, job := range jobInfos {
		fmt.Printf("found job %s\n", job.Name)
	}
	// get the job information and wait it to be running,timeout: 500s
	for i := 250; i >= 0; i-- {
		time.Sleep(2 * time.Second)
		job, err := client.Training().Get(jobName, jobType, false)
		if err != nil {
			fmt.Printf("failed to get job,reason: %v\n", err)
			return
		}
		if job.Status == "PENDING" {
			fmt.Printf("current status of job %v is: %v,waiting...\n", jobName, job.Status)
			continue
		}
		if job.Status == "RUNNING" || job.Status == "FAILED" {
			fmt.Printf("job info: %v\n", job)
			break
		}
		if i == 0 {
			fmt.Printf("timeout for waiting job to be running,exit\n")
			return
		}
	}
	// get the job log,the status of job must be RUNNING
	logArgs, err := logger.NewLoggerBuilder().Follow().Build()
	if err != nil {
		fmt.Printf("failed to build log args,reason: %v\n", err)
	}
	if err := client.Training().Logs(jobName, jobType, logArgs); err != nil {
		fmt.Printf("failed to get job log,reason: %v\n", err)
		return
	}
	err = client.Training().Delete(jobType, jobName)
	if err != nil {
		fmt.Printf("failed to delete job,reason: %v", err)
		return
	}
}


text:
import pytest

@pytest.fixture
def inject_file():
    return __file__


text:
using System;
using VkNet.Utils;

namespace VkNet.Model
{
	/// <summary>
	/// ССылочная кнопка
	/// </summary>
	[Serializable]
	public class LinkButton
	{
		/// <summary>
		/// Название кнопки.
		/// </summary>
		public string Title { get; set; }

		/// <summary>
		/// Ссылка на которую ведет кнопка.
		/// </summary>
		public LinkButtonAction Uri { get; set; }

		/// <summary>
		/// Разобрать из json.
		/// </summary>
		/// <param name="response"> Ответ сервера. </param>
		/// <returns> </returns>
		public static LinkButton FromJson(VkResponse response)
		{
			return new LinkButton
			{
					Title = response[key: "title"]
					, Uri = response[key: "url"]
			};
		}
	}
}


text:
<html>
    <body>
        Interfaces & classes needed to implement jpregel, some of which are useful to applications.
    </body>
</html>


text:
/**
 * An object defining the Window Rect.
 */
export type WindowRect = {
  /**
   * The screenX and screenLeft attributes must return the x-coordinate, relative to the origin of the
   * Web-exposed screen area, of the left of the client window as number of CSS pixels
   */
  x: number;

  /**
   * The screenY and screenTop attributes must return the y-coordinate, relative to the origin of the
   * screen of the Web-exposed screen area, of the top of the client window as number of CSS pixels
   */
  y: number;

  /**
   * The outerWidth attribute must return the width of the client window.
   * If there is no client window this attribute must return zero
   */
  width: number;

  /**
   * The outerWidth attribute must return the height of the client window.
   * If there is no client window this attribute must return zero
   */
  height: number;
}


text:
function Remove-JiraRemoteLink {
    # .ExternalHelp ..\JiraPS-help.xml
    [CmdletBinding( ConfirmImpact = 'High', SupportsShouldProcess )]
    param(
        [Parameter( Mandatory, ValueFromPipeline, ValueFromPipelineByPropertyName )]
        [ValidateNotNullOrEmpty()]
        [ValidateScript(
            {
                if (("JiraPS.Issue" -notin $_.PSObject.TypeNames) -and (($_ -isnot [String]))) {
                    $exception = ([System.ArgumentException]"Invalid Type for Parameter") #fix code highlighting]
                    $errorId = 'ParameterType.NotJiraIssue'
                    $errorCategory = 'InvalidArgument'
                    $errorTarget = $_
                    $errorItem = New-Object -TypeName System.Management.Automation.ErrorRecord $exception, $errorId, $errorCategory, $errorTarget
                    $errorItem.ErrorDetails = "Wrong object type provided for Issue. Expected [JiraPS.Issue] or [String], but was $($_.GetType().Name)"
                    $PSCmdlet.ThrowTerminatingError($errorItem)
                    <#
                      #ToDo:CustomClass
                      Once we have custom classes, this check can be done with Type declaration
                    #>
                }
                else {
                    return $true
                }
            }
        )]
        [Alias("Key")]
        [Object[]]
        $Issue,

        [Parameter( Mandatory )]
        [Int[]]
        $LinkId,

        [Parameter()]
        [System.Management.Automation.PSCredential]
        [System.Management.Automation.Credential()]
        $Credential = [System.Management.Automation.PSCredential]::Empty,

        [Switch]
        $Force
    )

    begin {
        Write-Verbose "[$($MyInvocation.MyCommand.Name)] Function started"

        $server = Get-JiraConfigServer -ErrorAction Stop

        $resourceURi = "$server/rest/api/2/issue/{0}/remotelink/{1}"

        if ($Force) {
            Write-DebugMessage "[$($MyInvocation.MyCommand.Name)] -Force was passed. Backing up current ConfirmPreference [$ConfirmPreference] and setting to None"
            $oldConfirmPreference = $ConfirmPreference
            $ConfirmPreference = 'None'
        }
    }

    process {
        Write-DebugMessage "[$($MyInvocation.MyCommand.Name)] ParameterSetName: $($PsCmdlet.ParameterSetName)"
        Write-DebugMessage "[$($MyInvocation.MyCommand.Name)] PSBoundParameters: $($PSBoundParameters | Out-String)"

        foreach ($_issue in $Issue) {
            Write-Verbose "[$($MyInvocation.MyCommand.Name)] Processing [$Issue]"
            Write-Debug "[$($MyInvocation.MyCommand.Name)] Processing `$Issue [$Issue]"

            # Find the proper object for the Issue
            $issueObj = Resolve-JiraIssueObject -InputObject $_issue -Credential $Credential

            foreach ($_link in $LinkId) {
                Write-Verbose "[$($MyInvocation.MyCommand.Name)] Processing [$_link]"
                Write-Debug "[$($MyInvocation.MyCommand.Name)] Processing `$_link [$_link]"

                $parameter = @{
                    URI        = $resourceURi -f $issueObj.Key, $_link
                    Method     = "DELETE"
                    Credential = $Credential
                }
                Write-Debug "[$($MyInvocation.MyCommand.Name)] Invoking JiraMethod with `$parameter"
                if ($PSCmdlet.ShouldProcess($issueObj.Key, "Remove RemoteLink '$_link'")) {
                    Invoke-JiraMethod @parameter
                }
            }
        }
    }

    end {
        if ($Force) {
            Write-DebugMessage "[Remove-JiraGroupMember] Restoring ConfirmPreference to [$oldConfirmPreference]"
            $ConfirmPreference = $oldConfirmPreference
        }

        Write-Verbose "[$($MyInvocation.MyCommand.Name)] Complete"
    }
}


text:
package org.gradle.jvm.test.internal;

import com.google.common.collect.Lists;
import org.gradle.api.tasks.testing.Test;
import org.gradle.jvm.JvmBinarySpec;
import org.gradle.jvm.internal.DefaultJvmBinarySpec;
import org.gradle.jvm.internal.DependencyResolvingClasspath;
import org.gradle.jvm.internal.WithDependencies;
import org.gradle.jvm.internal.WithJvmAssembly;
import org.gradle.jvm.test.JUnitTestSuiteSpec;
import org.gradle.jvm.test.JvmTestSuiteBinarySpec;
import org.gradle.platform.base.BinaryTasksCollection;
import org.gradle.platform.base.DependencySpec;
import org.gradle.platform.base.internal.BinaryTasksCollectionWrapper;

import java.util.Collection;

public class DefaultJUnitTestSuiteBinarySpec extends DefaultJvmBinarySpec implements JUnitTestSuiteBinarySpecInternal, WithJvmAssembly, WithDependencies {
    private String junitVersion;
    private Collection<DependencySpec> binaryLevelDependencies = Lists.newLinkedList();
    private JvmBinarySpec testedBinary;
    private final DefaultTasksCollection tasks = new DefaultTasksCollection(super.getTasks());
    private DependencyResolvingClasspath runtimeClasspath;

    @Override
    public JvmTestSuiteBinarySpec.JvmTestSuiteTasks getTasks() {
        return tasks;
    }

    @Override
    public JUnitTestSuiteSpec getTestSuite() {
        return getComponentAs(JUnitTestSuiteSpec.class);
    }

    @Override
    public JvmBinarySpec getTestedBinary() {
        return testedBinary;
    }

    @Override
    protected String getTypeName() {
        return "Test suite";
    }

    @Override
    public String getjUnitVersion() {
        return junitVersion;
    }

    @Override
    public void setjUnitVersion(String version) {
        this.junitVersion = version;
    }

    @Override
    public void setDependencies(Collection<DependencySpec> dependencies) {
        this.binaryLevelDependencies = dependencies;
    }

    @Override
    public Collection<DependencySpec> getDependencies() {
        return binaryLevelDependencies;
    }

    @Override
    public void setTestedBinary(JvmBinarySpec testedBinary) {
        this.testedBinary = testedBinary;
    }

    @Override
    public void setRuntimeClasspath(DependencyResolvingClasspath runtimeClasspath) {
        this.runtimeClasspath = runtimeClasspath;
    }

    @Override
    public DependencyResolvingClasspath getRuntimeClasspath() {
        return runtimeClasspath;
    }

    static class DefaultTasksCollection extends BinaryTasksCollectionWrapper implements JvmTestSuiteBinarySpec.JvmTestSuiteTasks {
        public DefaultTasksCollection(BinaryTasksCollection delegate) {
            super(delegate);
        }

        @Override
        public Test getRun() {
            return findSingleTaskWithType(Test.class);
        }

    }
}


text:
``` bash
sudo apt-get install ImageMagick
```

#### gif 压缩 [参考地址](https://segmentfault.com/a/1190000000436384)
``` bash
convert source.gif -layers Optimize dest.gif
convert test.gif -fuzz 15% -layers Optimize result.gif
```


text:
FOUNDATION_EXPORT double BraintreeCardVersionNumber;

FOUNDATION_EXPORT const unsigned char BraintreeCardVersionString[];

//#if __has_include("BraintreeCore.h")
//#import "BraintreeCore.h"
//#else
//#import <BraintreeCore/BraintreeCore.h>
//#endif
//#import "BTCardClient.h"
//#import "BTCard.h"
//#import "BTCardNonce.h"


text:
/* @test
 * @bug 4486732
 * @summary When a remote stub contains a client socket factory and a
 * remote invocation is made using that stub, the factory should not
 * be held strongly reachable by the RMI implementation forever; in
 * particular, after the stub has become unreachable and all
 * connections to its endpoint have been closed, then the factory
 * should become unreachable too (through the RMI implementation).
 * @author Peter Jones
 *
 * @library ../../testlibrary
 * @build TestLibrary
 * @run main/othervm -Dsun.rmi.transport.connectionTimeout=2000
 *     PinClientSocketFactory
 */

import java.io.IOException;
import java.io.ObjectInputStream;
import java.io.Serializable;
import java.lang.ref.Reference;
import java.lang.ref.WeakReference;
import java.net.ServerSocket;
import java.net.Socket;
import java.rmi.Remote;
import java.rmi.RemoteException;
import java.rmi.registry.LocateRegistry;
import java.rmi.registry.Registry;
import java.rmi.server.RMIClientSocketFactory;
import java.rmi.server.RMIServerSocketFactory;
import java.rmi.server.UnicastRemoteObject;
import java.util.ArrayList;
import java.util.Collections;
import java.util.List;
import java.util.concurrent.atomic.AtomicInteger;

public class PinClientSocketFactory {

    private static final int PORT = TestLibrary.getUnusedRandomPort();
    private static final int SESSIONS = 50;

    public interface Factory extends Remote {
        Session getSession() throws RemoteException;
    }

    public interface Session extends Remote {
        void ping() throws RemoteException;
    }

    private static class FactoryImpl implements Factory {
        FactoryImpl() { }
        public Session getSession() throws RemoteException {
            Session impl = new SessionImpl();
            UnicastRemoteObject.exportObject(impl, 0, new CSF(), new SSF());
            // return impl instead of stub to work around 4114579
            return impl;
        }
    }

    private static class SessionImpl implements Session {
        SessionImpl() { }
        public void ping() { }
    }

    public static void main(String[] args) throws Exception {
        System.err.println("\nRegression test for bug 4486732\n");

        Factory factoryImpl = new FactoryImpl();
        Factory factoryStub =
            (Factory) UnicastRemoteObject.exportObject(factoryImpl, 0);
        for (int i = 0; i < SESSIONS; i++) {
            Session session = factoryStub.getSession();
            session.ping();
        }
        UnicastRemoteObject.unexportObject(factoryImpl, true);

        Registry registryImpl = LocateRegistry.createRegistry(PORT);
        CSF csf = new CSF();
        Reference<CSF> registryRef = new WeakReference<CSF>(csf);
        Registry registryStub = LocateRegistry.getRegistry("", PORT, csf);
        csf = null;
        registryStub.list();
        registryStub = null;
        UnicastRemoteObject.unexportObject(registryImpl, true);

        System.gc();
        // allow connections to time out
        Thread.sleep(3 * Long.getLong("sun.rmi.transport.connectionTimeout",
                                      15000));
        System.gc();

        if (CSF.deserializedInstances.size() != SESSIONS) {
            throw new Error("unexpected number of deserialized instances: " +
                            CSF.deserializedInstances.size());
        }

        int nonNullCount = 0;
        for (Reference<CSF> ref : CSF.deserializedInstances) {
            csf = ref.get();
            if (csf != null) {
                System.err.println("non-null deserialized instance: " + csf);
                nonNullCount++;
            }
        }
        if (nonNullCount > 0) {
            throw new Error("TEST FAILED: " +
                            nonNullCount + " non-null deserialized instances");
        }

        csf = registryRef.get();
        if (csf != null) {
            System.err.println("non-null registry instance: " + csf);
            throw new Error("TEST FAILED: non-null registry instance");
        }

        System.err.println("TEST PASSED");
    }

    private static class CSF implements RMIClientSocketFactory, Serializable {
        static final List<Reference<CSF>> deserializedInstances =
            Collections.synchronizedList(new ArrayList<Reference<CSF>>());
        private static final AtomicInteger count = new AtomicInteger(0);
        private int num = count.incrementAndGet();
        CSF() { }
        public Socket createSocket(String host, int port) throws IOException {
            return new Socket(host, port);
        }
        public int hashCode() {
            return num;
        }
        public boolean equals(Object obj) {
            return obj instanceof CSF && ((CSF) obj).num == num;
        }
        private void readObject(ObjectInputStream in)
            throws IOException, ClassNotFoundException
        {
            in.defaultReadObject();
            deserializedInstances.add(new WeakReference<CSF>(this));
        }
    }

    private static class SSF implements RMIServerSocketFactory {
        SSF() { }
        public ServerSocket createServerSocket(int port) throws IOException {
            return new ServerSocket(port);
        }
    }
}


text:
<?xml version="1.0" encoding="utf-8"?>
<resources>
    <string name="app_name">Facebook SDK Connect</string>
	<string name="connectButtonText">Connect with Facebook!</string>
	<string name="app_id">PUT YOUR OWN FACEBOOK APPLICATION ID HERE</string>
</resources>


text:
<?xml version="1.0" encoding="UTF-8"?>
<!--

    Copyright 2016-2022 Micro Focus or one of its affiliates.

    Licensed under the Apache License, Version 2.0 (the "License");
    you may not use this file except in compliance with the License.
    You may obtain a copy of the License at

         http://www.apache.org/licenses/LICENSE-2.0

    Unless required by applicable law or agreed to in writing, software
    distributed under the License is distributed on an "AS IS" BASIS,
    WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
    See the License for the specific language governing permissions and
    limitations under the License.

-->
<project xmlns="http://maven.apache.org/POM/4.0.0"
         xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
         xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
    <modelVersion>4.0.0</modelVersion>

    <groupId>com.github.cafdataprocessing</groupId>
    <artifactId>worker-document-shared</artifactId>

    <parent>
        <groupId>com.github.cafdataprocessing</groupId>
        <artifactId>worker-document-aggregator</artifactId>
        <version>5.2.0-SNAPSHOT</version>
    </parent>

    <dependencies>
        <dependency>
            <groupId>com.fasterxml.jackson.core</groupId>
            <artifactId>jackson-annotations</artifactId>
        </dependency>

        <!-- Test Dependencies -->
        <dependency>
            <groupId>junit</groupId>
            <artifactId>junit</artifactId>
            <scope>test</scope>
        </dependency>
        <dependency>
            <groupId>com.github.cafapi</groupId>
            <artifactId>caf-api</artifactId>
            <scope>test</scope>
        </dependency>
        <dependency>
            <groupId>com.github.cafapi.codec</groupId>
            <artifactId>codec-json</artifactId>
            <scope>test</scope>
        </dependency>
    </dependencies>

</project>


text:
const BABEL_ENV = process.env.BABEL_ENV
const building = BABEL_ENV != undefined && BABEL_ENV !== 'cjs'
const transformImports = require('babel-plugin-transform-imports');

const plugins = [
  [transformImports, {
  'react-router': {
    transform: building ? "react-router/es/${member}" : "react-router/${member}",
    preventFullImport: true
}}]]

if (BABEL_ENV === 'umd') {
  plugins.push('external-helpers')
}

if (process.env.NODE_ENV === 'production') {
  plugins.push(
    'dev-expression',
    'transform-react-remove-prop-types'
  )
}

module.exports = {
  presets: [
    [ 'es2015', {
      loose: true,
      modules: building ? false : 'commonjs'
    } ],
    'stage-1',
    'react'
  ],
  plugins: plugins
}


text:
package org.hl7.fhir.instance.model;

// Generated on Wed, Nov 11, 2015 10:54-0500 for FHIR v1.0.2

import org.hl7.fhir.instance.model.annotations.DatatypeDef;
import org.hl7.fhir.instance.model.annotations.Block;
import org.hl7.fhir.instance.model.api.*;
/**
 * A measured amount (or an amount that can potentially be measured). Note that measured amounts include amounts that are not precisely quantified, including amounts involving arbitrary units and floating currencies.
 */
@DatatypeDef(name="Money", profileOf=Quantity.class)
public class Money extends Quantity {

    private static final long serialVersionUID = 1069574054L;

      public Money copy() {
        Money dst = new Money();
        copyValues(dst);
        dst.value = value == null ? null : value.copy();
        dst.comparator = comparator == null ? null : comparator.copy();
        dst.unit = unit == null ? null : unit.copy();
        dst.system = system == null ? null : system.copy();
        dst.code = code == null ? null : code.copy();
        return dst;
      }

      protected Money typedCopy() {
        return copy();
      }

      @Override
      public boolean equalsDeep(Base other) {
        if (!super.equalsDeep(other))
          return false;
        if (!(other instanceof Money))
          return false;
        Money o = (Money) other;
        return compareDeep(value, o.value, true) && compareDeep(comparator, o.comparator, true) && compareDeep(unit, o.unit, true)
           && compareDeep(system, o.system, true) && compareDeep(code, o.code, true);
      }

      @Override
      public boolean equalsShallow(Base other) {
        if (!super.equalsShallow(other))
          return false;
        if (!(other instanceof Money))
          return false;
        Money o = (Money) other;
        return compareValues(value, o.value, true) && compareValues(comparator, o.comparator, true) && compareValues(unit, o.unit, true)
           && compareValues(system, o.system, true) && compareValues(code, o.code, true);
      }

      public boolean isEmpty() {
        return super.isEmpty() && (value == null || value.isEmpty()) && (comparator == null || comparator.isEmpty())
           && (unit == null || unit.isEmpty()) && (system == null || system.isEmpty()) && (code == null || code.isEmpty())
          ;
      }

}


text:
/*
 * The Silicon Labs Si7013/20/21 Relative Humidity and Temperature Sensors
 * are i2c devices which have an identical programming interface for
 * measuring relative humidity and temperature. The Si7013 has an additional
 * temperature input which this driver does not support.
 *
 * Data Sheets:
 *   Si7013: http://www.silabs.com/Support%20Documents/TechnicalDocs/Si7013.pdf
 *   Si7020: http://www.silabs.com/Support%20Documents/TechnicalDocs/Si7020.pdf
 *   Si7021: http://www.silabs.com/Support%20Documents/TechnicalDocs/Si7021.pdf
 */

#include <linux/delay.h>
#include <linux/i2c.h>
#include <linux/module.h>
#include <linux/slab.h>
#include <linux/sysfs.h>

#include <linux/iio/iio.h>
#include <linux/iio/sysfs.h>

/* Measure Relative Humidity, Hold Master Mode */
#define SI7020CMD_RH_HOLD	0xE5
/* Measure Temperature, Hold Master Mode */
#define SI7020CMD_TEMP_HOLD	0xE3
/* Software Reset */
#define SI7020CMD_RESET		0xFE

static int si7020_read_raw(struct iio_dev *indio_dev,
			   struct iio_chan_spec const *chan, int *val,
			   int *val2, long mask)
{
	struct i2c_client **client = iio_priv(indio_dev);
	int ret;

	switch (mask) {
	case IIO_CHAN_INFO_RAW:
		ret = i2c_smbus_read_word_swapped(*client,
						  chan->type == IIO_TEMP ?
						  SI7020CMD_TEMP_HOLD :
						  SI7020CMD_RH_HOLD);
		if (ret < 0)
			return ret;
		*val = ret >> 2;
		/*
		 * Humidity values can slightly exceed the 0-100%RH
		 * range and should be corrected by software
		 */
		if (chan->type == IIO_HUMIDITYRELATIVE)
			*val = clamp_val(*val, 786, 13893);
		return IIO_VAL_INT;
	case IIO_CHAN_INFO_SCALE:
		if (chan->type == IIO_TEMP)
			*val = 175720; /* = 175.72 * 1000 */
		else
			*val = 125 * 1000;
		*val2 = 65536 >> 2;
		return IIO_VAL_FRACTIONAL;
	case IIO_CHAN_INFO_OFFSET:
		/*
		 * Since iio_convert_raw_to_processed_unlocked assumes offset
		 * is an integer we have to round these values and lose
		 * accuracy.
		 * Relative humidity will be 0.0032959% too high and
		 * temperature will be 0.00277344 degrees too high.
		 * This is no big deal because it's within the accuracy of the
		 * sensor.
		 */
		if (chan->type == IIO_TEMP)
			*val = -4368; /* = -46.85 * (65536 >> 2) / 175.72 */
		else
			*val = -786; /* = -6 * (65536 >> 2) / 125 */
		return IIO_VAL_INT;
	default:
		break;
	}

	return -EINVAL;
}

static const struct iio_chan_spec si7020_channels[] = {
	{
		.type = IIO_HUMIDITYRELATIVE,
		.info_mask_separate = BIT(IIO_CHAN_INFO_RAW) |
			BIT(IIO_CHAN_INFO_SCALE) | BIT(IIO_CHAN_INFO_OFFSET),
	},
	{
		.type = IIO_TEMP,
		.info_mask_separate = BIT(IIO_CHAN_INFO_RAW) |
			BIT(IIO_CHAN_INFO_SCALE) | BIT(IIO_CHAN_INFO_OFFSET),
	}
};

static const struct iio_info si7020_info = {
	.read_raw = si7020_read_raw,
	.driver_module = THIS_MODULE,
};

static int si7020_probe(struct i2c_client *client,
			const struct i2c_device_id *id)
{
	struct iio_dev *indio_dev;
	struct i2c_client **data;
	int ret;

	if (!i2c_check_functionality(client->adapter,
				     I2C_FUNC_SMBUS_WRITE_BYTE |
				     I2C_FUNC_SMBUS_READ_WORD_DATA))
		return -ENODEV;

	/* Reset device, loads default settings. */
	ret = i2c_smbus_write_byte(client, SI7020CMD_RESET);
	if (ret < 0)
		return ret;
	/* Wait the maximum power-up time after software reset. */
	msleep(15);

	indio_dev = devm_iio_device_alloc(&client->dev, sizeof(*data));
	if (!indio_dev)
		return -ENOMEM;

	data = iio_priv(indio_dev);
	*data = client;

	indio_dev->dev.parent = &client->dev;
	indio_dev->name = dev_name(&client->dev);
	indio_dev->modes = INDIO_DIRECT_MODE;
	indio_dev->info = &si7020_info;
	indio_dev->channels = si7020_channels;
	indio_dev->num_channels = ARRAY_SIZE(si7020_channels);

	return devm_iio_device_register(&client->dev, indio_dev);
}

static const struct i2c_device_id si7020_id[] = {
	{ "si7020", 0 },
	{ }
};
MODULE_DEVICE_TABLE(i2c, si7020_id);

static struct i2c_driver si7020_driver = {
	.driver.name	= "si7020",
	.probe		= si7020_probe,
	.id_table	= si7020_id,
};

module_i2c_driver(si7020_driver);
MODULE_DESCRIPTION("Silicon Labs Si7013/20/21 Relative Humidity and Temperature Sensors");
MODULE_AUTHOR("David Barksdale <dbarksdale@uplogix.com>");
MODULE_LICENSE("GPL");


text:
[Source wiki](https://en.wikipedia.org/wiki/Heapsort?oldformat=true)

[Tutorial](http://bubkoo.com/2014/01/14/sort-algorithm/heap-sort/)


text:
<!DOCTYPE html>

    <title>Video.js | HTML5 Video Player</title>

    <link href="<?php echo base_url('resource/stylesheets/video-js.css'); ?>" rel="stylesheet" type="text/css">

<video id="example_video_1" class="video-js vjs-default-skin" controls preload="none" width="432" height="240"
       poster="http://video-js.zencoder.com/oceans-clip.png"
       data-setup='{"example_option":true}'>

    <source src="<?php echo base_url($full_path); ?>" type='video/mp4' />

To view this video please enable JavaScript, and consider upgrading to a web browser that supports HTML5 video

</video>


text:
<?php
return array (
  'Request space membership' => 'Vraag ruimte lidmaatschap aan',
  'Close' => 'Sluiten',
  'Your request was successfully submitted to the space administrators.' => 'Je aanvraag werd succesvol naar de ruimte administrator verstuurd.',
);


text:
package org.apache.flink.connectors.hive;

import org.apache.flink.api.common.typeutils.TypeSerializer;
import org.apache.flink.connector.file.table.PartitionFetcher;
import org.apache.flink.connector.file.table.PartitionReader;
import org.apache.flink.table.api.EnvironmentSettings;
import org.apache.flink.table.api.SqlDialect;
import org.apache.flink.table.api.TableEnvironment;
import org.apache.flink.table.api.internal.TableEnvironmentInternal;
import org.apache.flink.table.api.internal.TableImpl;
import org.apache.flink.table.catalog.CatalogTable;
import org.apache.flink.table.catalog.ObjectIdentifier;
import org.apache.flink.table.catalog.hive.HiveCatalog;
import org.apache.flink.table.catalog.hive.HiveTestUtils;
import org.apache.flink.table.data.GenericRowData;
import org.apache.flink.table.data.RowData;
import org.apache.flink.table.factories.DynamicTableSourceFactory;
import org.apache.flink.table.factories.FactoryUtil;
import org.apache.flink.table.planner.factories.TestValuesTableFactory;
import org.apache.flink.table.planner.factories.utils.TestCollectionTableFactory;
import org.apache.flink.table.runtime.typeutils.InternalSerializers;
import org.apache.flink.types.Row;
import org.apache.flink.util.CollectionUtil;

import org.junit.AfterClass;
import org.junit.BeforeClass;
import org.junit.Test;

import java.time.Duration;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.Comparator;
import java.util.List;

import static org.apache.flink.connector.file.table.FileSystemConnectorOptions.PARTITION_TIME_EXTRACTOR_KIND;
import static org.apache.flink.connector.file.table.FileSystemConnectorOptions.PARTITION_TIME_EXTRACTOR_TIMESTAMP_PATTERN;
import static org.apache.flink.connectors.hive.HiveOptions.STREAMING_SOURCE_ENABLE;
import static org.apache.flink.connectors.hive.HiveOptions.STREAMING_SOURCE_MONITOR_INTERVAL;
import static org.apache.flink.connectors.hive.HiveOptions.STREAMING_SOURCE_PARTITION_INCLUDE;
import static org.apache.flink.connectors.hive.HiveOptions.STREAMING_SOURCE_PARTITION_ORDER;
import static org.junit.Assert.assertEquals;
import static org.junit.Assert.assertTrue;

/** Test lookup join of hive tables. */
public class HiveLookupJoinITCase {

    private static TableEnvironment tableEnv;
    private static HiveCatalog hiveCatalog;

    @BeforeClass
    public static void setup() {
        tableEnv = TableEnvironment.create(EnvironmentSettings.inStreamingMode());
        hiveCatalog = HiveTestUtils.createHiveCatalog();
        tableEnv.registerCatalog(hiveCatalog.getName(), hiveCatalog);
        tableEnv.useCatalog(hiveCatalog.getName());
        // create probe table
        TestCollectionTableFactory.initData(
                Arrays.asList(
                        Row.of(1, "a"),
                        Row.of(1, "c"),
                        Row.of(2, "b"),
                        Row.of(2, "c"),
                        Row.of(3, "c"),
                        Row.of(4, "d")));
        tableEnv.executeSql(
                "create table default_catalog.default_database.probe (x int,y string, p as proctime()) "
                        + "with ('connector'='COLLECTION','is-bounded' = 'false')");

        tableEnv.getConfig().setSqlDialect(SqlDialect.HIVE);
        // create the hive non-partitioned table
        tableEnv.executeSql(
                String.format(
                        "create table bounded_table (x int, y string, z int) tblproperties ('%s'='5min')",
                        HiveOptions.LOOKUP_JOIN_CACHE_TTL.key()));

        // create the hive partitioned table
        tableEnv.executeSql(
                String.format(
                        "create table bounded_partition_table (x int, y string, z int) partitioned by ("
                                + " pt_year int, pt_mon string, pt_day string)"
                                + " tblproperties ('%s'='5min')",
                        HiveOptions.LOOKUP_JOIN_CACHE_TTL.key()));

        // create the hive partitioned table
        tableEnv.executeSql(
                String.format(
                        "create table partition_table (x int, y string, z int) partitioned by ("
                                + " pt_year int, pt_mon string, pt_day string)"
                                + " tblproperties ('%s' = 'true', '%s' = 'latest', '%s' = 'partition-name', '%s'='2h')",
                        STREAMING_SOURCE_ENABLE.key(),
                        STREAMING_SOURCE_PARTITION_INCLUDE.key(),
                        STREAMING_SOURCE_PARTITION_ORDER.key(),
                        STREAMING_SOURCE_MONITOR_INTERVAL.key()));

        // create the hive partitioned table3 which uses default 'partition-name'.
        tableEnv.executeSql(
                String.format(
                        "create table partition_table_1 (x int, y string, z int) partitioned by ("
                                + " pt_year int, pt_mon string, pt_day string)"
                                + " tblproperties ('%s' = 'true', '%s' = 'latest', '%s'='120min')",
                        HiveOptions.STREAMING_SOURCE_ENABLE.key(),
                        HiveOptions.STREAMING_SOURCE_PARTITION_INCLUDE.key(),
                        HiveOptions.STREAMING_SOURCE_MONITOR_INTERVAL.key()));

        // create the hive partitioned table3 which uses 'partition-time'.
        tableEnv.executeSql(
                String.format(
                        "create table partition_table_2 (x int, y string, z int) partitioned by ("
                                + " pt_year int, pt_mon string, pt_day string)"
                                + " tblproperties ("
                                + "'%s' = 'true',"
                                + " '%s' = 'latest',"
                                + " '%s' = '12h',"
                                + " '%s' = 'partition-time', "
                                + " '%s' = 'default',"
                                + " '%s' = '$pt_year-$pt_mon-$pt_day 00:00:00')",
                        STREAMING_SOURCE_ENABLE.key(),
                        STREAMING_SOURCE_PARTITION_INCLUDE.key(),
                        STREAMING_SOURCE_MONITOR_INTERVAL.key(),
                        STREAMING_SOURCE_PARTITION_ORDER.key(),
                        PARTITION_TIME_EXTRACTOR_KIND.key(),
                        PARTITION_TIME_EXTRACTOR_TIMESTAMP_PATTERN.key()));

        // create the hive partitioned table3 which uses 'create-time'.
        tableEnv.executeSql(
                String.format(
                        "create table partition_table_3 (x int, y string, z int) partitioned by ("
                                + " pt_year int, pt_mon string, pt_day string)"
                                + " tblproperties ("
                                + " '%s' = 'true',"
                                + " '%s' = 'latest',"
                                + " '%s' = 'create-time')",
                        STREAMING_SOURCE_ENABLE.key(),
                        STREAMING_SOURCE_PARTITION_INCLUDE.key(),
                        STREAMING_SOURCE_PARTITION_ORDER.key()));
        // create the hive table with columnar storage.
        tableEnv.executeSql(
                String.format(
                        "create table columnar_table (x string) STORED AS PARQUET "
                                + "tblproperties ('%s'='5min')",
                        HiveOptions.LOOKUP_JOIN_CACHE_TTL.key()));
        tableEnv.getConfig().setSqlDialect(SqlDialect.DEFAULT);
    }

    @Test
    public void testLookupOptions() throws Exception {
        FileSystemLookupFunction<HiveTablePartition> lookupFunction1 =
                getLookupFunction("bounded_table");
        FileSystemLookupFunction<HiveTablePartition> lookupFunction2 =
                getLookupFunction("partition_table");
        lookupFunction1.open(null);
        lookupFunction2.open(null);

        // verify lookup cache TTL option is properly configured
        assertEquals(Duration.ofMinutes(5), lookupFunction1.getReloadInterval());
        assertEquals(Duration.ofMinutes(120), lookupFunction2.getReloadInterval());
    }

    @Test
    public void testPartitionFetcherAndReader() throws Exception {
        // constructs test data using dynamic partition
        TableEnvironment batchEnv = HiveTestUtils.createTableEnvInBatchMode(SqlDialect.HIVE);
        batchEnv.registerCatalog(hiveCatalog.getName(), hiveCatalog);
        batchEnv.useCatalog(hiveCatalog.getName());
        batchEnv.executeSql(
                        "insert overwrite partition_table values "
                                + "(1,'a',08,2019,'08','01'),"
                                + "(1,'a',10,2020,'08','31'),"
                                + "(2,'a',21,2020,'08','31'),"
                                + "(2,'b',22,2020,'08','31'),"
                                + "(3,'c',33,2020,'09','31')")
                .await();
        FileSystemLookupFunction<HiveTablePartition> lookupFunction =
                getLookupFunction("partition_table");
        lookupFunction.open(null);

        PartitionFetcher<HiveTablePartition> fetcher = lookupFunction.getPartitionFetcher();
        PartitionFetcher.Context<HiveTablePartition> context = lookupFunction.getFetcherContext();
        List<HiveTablePartition> partitions = fetcher.fetch(context);
        // fetch latest partition by partition-name
        assertEquals(1, partitions.size());

        PartitionReader<HiveTablePartition, RowData> reader = lookupFunction.getPartitionReader();
        reader.open(partitions);

        List<RowData> res = new ArrayList<>();
        ObjectIdentifier tableIdentifier =
                ObjectIdentifier.of(hiveCatalog.getName(), "default", "partition_table");
        CatalogTable catalogTable =
                (CatalogTable) hiveCatalog.getTable(tableIdentifier.toObjectPath());
        GenericRowData reuse = new GenericRowData(catalogTable.getSchema().getFieldCount());
        TypeSerializer<RowData> serializer =
                InternalSerializers.create(
                        catalogTable.getSchema().toRowDataType().getLogicalType());

        RowData row;
        while ((row = reader.read(reuse)) != null) {
            res.add(serializer.copy(row));
        }
        res.sort(Comparator.comparingInt(o -> o.getInt(0)));
        assertEquals("[+I(3,c,33,2020,09,31)]", res.toString());
    }

    @Test
    public void testLookupJoinBoundedTable() throws Exception {
        tableEnv.getConfig().setSqlDialect(SqlDialect.DEFAULT);
        tableEnv.executeSql(
                        "insert into bounded_table values (1,'a',10),(2,'a',21),(2,'b',22),(3,'c',33)")
                .await();
        TableImpl flinkTable =
                (TableImpl)
                        tableEnv.sqlQuery(
                                "select p.x, p.y, b.z from "
                                        + " default_catalog.default_database.probe as p "
                                        + " join bounded_table for system_time as of p.p as b on p.x=b.x and p.y=b.y");
        List<Row> results = CollectionUtil.iteratorToList(flinkTable.execute().collect());
        assertEquals("[+I[1, a, 10], +I[2, b, 22], +I[3, c, 33]]", results.toString());
    }

    @Test
    public void testLookupJoinBoundedPartitionedTable() throws Exception {
        // constructs test data using dynamic partition
        TableEnvironment batchEnv = HiveTestUtils.createTableEnvInBatchMode(SqlDialect.HIVE);
        batchEnv.registerCatalog(hiveCatalog.getName(), hiveCatalog);
        batchEnv.useCatalog(hiveCatalog.getName());
        batchEnv.executeSql(
                        "insert overwrite bounded_partition_table values "
                                + "(1,'a',08,2019,'08','01'),"
                                + "(1,'a',10,2020,'08','31'),"
                                + "(2,'a',21,2020,'08','31'),"
                                + "(2,'b',22,2020,'08','31')")
                .await();

        TableImpl flinkTable =
                (TableImpl)
                        tableEnv.sqlQuery(
                                "select p.x, p.y, b.z, b.pt_year, b.pt_mon, b.pt_day from "
                                        + " default_catalog.default_database.probe as p"
                                        + " join bounded_partition_table for system_time as of p.p as b on p.x=b.x and p.y=b.y");
        List<Row> results = CollectionUtil.iteratorToList(flinkTable.execute().collect());
        assertEquals(
                "[+I[1, a, 8, 2019, 08, 01], +I[1, a, 10, 2020, 08, 31], +I[2, b, 22, 2020, 08, 31]]",
                results.toString());
    }

    @Test
    public void testLookupJoinPartitionedTable() throws Exception {
        // constructs test data using dynamic partition
        TableEnvironment batchEnv = HiveTestUtils.createTableEnvInBatchMode(SqlDialect.HIVE);
        batchEnv.registerCatalog(hiveCatalog.getName(), hiveCatalog);
        batchEnv.useCatalog(hiveCatalog.getName());
        batchEnv.executeSql(
                        "insert overwrite partition_table_1 values "
                                + "(1,'a',08,2019,'09','01'),"
                                + "(1,'a',10,2020,'09','31'),"
                                + "(2,'a',21,2020,'09','31'),"
                                + "(2,'b',22,2020,'09','31'),"
                                + "(3,'c',33,2020,'09','31'),"
                                + "(1,'a',101,2020,'08','01'),"
                                + "(2,'a',121,2020,'08','01'),"
                                + "(2,'b',122,2020,'08','01')")
                .await();

        TableImpl flinkTable =
                (TableImpl)
                        tableEnv.sqlQuery(
                                "select p.x, p.y, b.z, b.pt_year, b.pt_mon, b.pt_day from "
                                        + " default_catalog.default_database.probe as p"
                                        + " join partition_table_1 for system_time as of p.p as b on p.x=b.x and p.y=b.y");
        List<Row> results = CollectionUtil.iteratorToList(flinkTable.execute().collect());
        assertEquals(
                "[+I[1, a, 10, 2020, 09, 31], +I[2, b, 22, 2020, 09, 31], +I[3, c, 33, 2020, 09, 31]]",
                results.toString());
    }

    @Test
    public void testLookupJoinPartitionedTableWithPartitionTime() throws Exception {
        // constructs test data using dynamic partition
        TableEnvironment batchEnv = HiveTestUtils.createTableEnvInBatchMode(SqlDialect.HIVE);
        batchEnv.registerCatalog(hiveCatalog.getName(), hiveCatalog);
        batchEnv.useCatalog(hiveCatalog.getName());
        batchEnv.executeSql(
                        "insert overwrite partition_table_2 values "
                                + "(1,'a',08,2020,'08','01'),"
                                + "(1,'a',10,2020,'08','31'),"
                                + "(2,'a',21,2019,'08','31'),"
                                + "(2,'b',22,2020,'08','31'),"
                                + "(3,'c',33,2017,'08','31'),"
                                + "(1,'a',101,2017,'09','01'),"
                                + "(2,'a',121,2019,'09','01'),"
                                + "(2,'b',122,2019,'09','01')")
                .await();

        TableImpl flinkTable =
                (TableImpl)
                        tableEnv.sqlQuery(
                                "select p.x, p.y, b.z, b.pt_year, b.pt_mon, b.pt_day from "
                                        + " default_catalog.default_database.probe as p"
                                        + " join partition_table_2 for system_time as of p.p as b on p.x=b.x and p.y=b.y");
        List<Row> results = CollectionUtil.iteratorToList(flinkTable.execute().collect());
        assertEquals(
                "[+I[1, a, 10, 2020, 08, 31], +I[2, b, 22, 2020, 08, 31]]", results.toString());
    }

    @Test
    public void testLookupJoinPartitionedTableWithCreateTime() throws Exception {
        // constructs test data using dynamic partition
        TableEnvironment batchEnv = HiveTestUtils.createTableEnvInBatchMode(SqlDialect.HIVE);
        batchEnv.registerCatalog(hiveCatalog.getName(), hiveCatalog);
        batchEnv.useCatalog(hiveCatalog.getName());
        batchEnv.executeSql(
                        "insert overwrite partition_table_3 values "
                                + "(1,'a',08,2020,'month1','01'),"
                                + "(1,'a',10,2020,'month2','02'),"
                                + "(2,'a',21,2020,'month1','02'),"
                                + "(2,'b',22,2020,'month3','20'),"
                                + "(3,'c',22,2020,'month3','20'),"
                                + "(3,'c',33,2017,'08','31'),"
                                + "(1,'a',101,2017,'09','01'),"
                                + "(2,'a',121,2019,'09','01'),"
                                + "(2,'b',122,2019,'09','01')")
                .await();

        // inert a new partition
        batchEnv.executeSql(
                        "insert overwrite partition_table_3 values "
                                + "(1,'a',101,2020,'08','01'),"
                                + "(2,'a',121,2020,'08','01'),"
                                + "(2,'b',122,2020,'08','01')")
                .await();

        TableImpl flinkTable =
                (TableImpl)
                        tableEnv.sqlQuery(
                                "select p.x, p.y, b.z, b.pt_year, b.pt_mon, b.pt_day from "
                                        + " default_catalog.default_database.probe as p"
                                        + " join partition_table_3 for system_time as of p.p as b on p.x=b.x and p.y=b.y");
        List<Row> results = CollectionUtil.iteratorToList(flinkTable.execute().collect());
        assertEquals(
                "[+I[1, a, 101, 2020, 08, 01], +I[2, b, 122, 2020, 08, 01]]", results.toString());
    }

    @Test
    public void testLookupJoinTableWithColumnarStorage() throws Exception {
        // constructs test data, as the DEFAULT_SIZE of VectorizedColumnBatch is 2048, we should
        // write as least 2048 records to the test table.
        List<Row> testData = new ArrayList<>(4096);
        for (int i = 0; i < 4096; i++) {
            testData.add(Row.of(String.valueOf(i)));
        }

        // constructs test data using values table
        TableEnvironment batchEnv = HiveTestUtils.createTableEnvInBatchMode(SqlDialect.DEFAULT);
        batchEnv.registerCatalog(hiveCatalog.getName(), hiveCatalog);
        batchEnv.useCatalog(hiveCatalog.getName());
        String dataId = TestValuesTableFactory.registerData(testData);
        batchEnv.executeSql(
                String.format(
                        "create table value_source(x string, p as proctime()) with ("
                                + "'connector' = 'values', 'data-id' = '%s', 'bounded'='true')",
                        dataId));
        batchEnv.executeSql("insert overwrite columnar_table select x from value_source").await();
        TableImpl flinkTable =
                (TableImpl)
                        tableEnv.sqlQuery(
                                "select t.x as x1, c.x as x2 from value_source t "
                                        + "left join columnar_table for system_time as of t.p c "
                                        + "on t.x = c.x where c.x is null");
        List<Row> results = CollectionUtil.iteratorToList(flinkTable.execute().collect());
        assertTrue(
                "All records should be able to be joined, and the final results should be empty.",
                results.size() == 0);
    }

    private FileSystemLookupFunction<HiveTablePartition> getLookupFunction(String tableName)
            throws Exception {
        TableEnvironmentInternal tableEnvInternal = (TableEnvironmentInternal) tableEnv;
        ObjectIdentifier tableIdentifier =
                ObjectIdentifier.of(hiveCatalog.getName(), "default", tableName);
        CatalogTable catalogTable =
                (CatalogTable) hiveCatalog.getTable(tableIdentifier.toObjectPath());
        HiveLookupTableSource hiveTableSource =
                (HiveLookupTableSource)
                        FactoryUtil.createDynamicTableSource(
                                (DynamicTableSourceFactory)
                                        hiveCatalog
                                                .getFactory()
                                                .orElseThrow(IllegalStateException::new),
                                tableIdentifier,
                                tableEnvInternal
                                        .getCatalogManager()
                                        .resolveCatalogTable(catalogTable),
                                tableEnv.getConfig().getConfiguration(),
                                Thread.currentThread().getContextClassLoader(),
                                false);
        FileSystemLookupFunction<HiveTablePartition> lookupFunction =
                (FileSystemLookupFunction<HiveTablePartition>)
                        hiveTableSource.getLookupFunction(new int[][] {{0}});
        return lookupFunction;
    }

    @AfterClass
    public static void tearDown() {
        tableEnv.executeSql("drop table bounded_table");
        tableEnv.executeSql("drop table bounded_partition_table");
        tableEnv.executeSql("drop table partition_table");
        tableEnv.executeSql("drop table partition_table_1");
        tableEnv.executeSql("drop table partition_table_2");
        tableEnv.executeSql("drop table partition_table_3");

        if (hiveCatalog != null) {
            hiveCatalog.close();
        }
    }
}


text:
using System;
using System.Drawing;
using System.Windows.Forms;

namespace WiremockUI
{
    public class TabPageCustom : TabPage
    {
        public Func<bool> CanClose { get; set; }
    }
}


text:
<?php

namespace SystemConnector\Validator\Category;

use Assert\Assertion;
use SystemConnector\TransferObject\Category\Category;
use SystemConnector\Validator\ValidatorInterface;
use SystemConnector\ValueObject\Attribute\Attribute;
use SystemConnector\ValueObject\Translation\Translation;

class CategoryValidator implements ValidatorInterface
{
    /**
     * {@inheritdoc}
     */
    public function supports($object): bool
    {
        return $object instanceof Category;
    }

    /**
     * @param Category $object
     */
    public function validate($object)
    {
        Assertion::uuid($object->getIdentifier(), null, 'category.identifier');
        Assertion::notBlank($object->getName(), null, 'category.name');
        Assertion::string($object->getName(), null, 'category.name');

        Assertion::nullOrUuid($object->getParentIdentifier(), null, 'category.parentIdentifier');
        Assertion::isArray($object->getShopIdentifiers(), null, 'category.shopIdentifiers');
        Assertion::nullOrUuid($object->getParentIdentifier(), null, 'category.parentIdentifier');

        Assertion::isArray($object->getImageIdentifiers(), null, 'category.imageIdentifiers');

        Assertion::integer($object->getPosition(), null, 'category.position');

        Assertion::string($object->getDescription(), null, 'category.description');
        Assertion::string($object->getLongDescription(), null, 'category.longDescription');

        Assertion::string($object->getMetaTitle(), null, 'category.metaTitle');
        Assertion::string($object->getMetaDescription(), null, 'category.metaDescription');
        Assertion::string($object->getMetaKeywords(), null, 'category.metaKeywords');
        Assertion::string($object->getMetaRobots(), null, 'category.metaRobots');
        Assertion::inArray($object->getMetaRobots(), [
            'INDEX, FOLLOW',
            'NOINDEX, FOLLOW',
            'INDEX, NOFOLLOW',
            'NOINDEX, NOFOLLOW',
        ], null, 'category.metaRobots');

        Assertion::allIsInstanceOf($object->getTranslations(), Translation::class, null, 'category.translations');
        Assertion::allIsInstanceOf($object->getAttributes(), Attribute::class, null, 'category.attributes');
    }
}


text:
namespace trng {

  // uniform random number generator class
  template<typename float_t=double>
  class powerlaw_dist {
  public:
    typedef float_t result_type;
    class param_type;

    class param_type {
    private:
      result_type gamma_, theta_;
    public:
      TRNG_CUDA_ENABLE
      result_type gamma() const { return gamma_; }
      TRNG_CUDA_ENABLE
      void gamma(result_type gamma_new) { gamma_=gamma_new; }
      TRNG_CUDA_ENABLE
      result_type theta() const { return theta_; }
      TRNG_CUDA_ENABLE
      void theta(result_type theta_new) { theta_=theta_new; }
      TRNG_CUDA_ENABLE
      param_type() : gamma_(1), theta_(1) {
      }
      TRNG_CUDA_ENABLE
      param_type(result_type gamma, result_type theta) : gamma_(gamma), theta_(theta) {
      }

      friend class powerlaw_dist;

      // Streamable concept
      template<typename char_t, typename traits_t>
      friend std::basic_ostream<char_t, traits_t> &
      operator<<(std::basic_ostream<char_t, traits_t> &out,
                 const param_type &p) {
        std::ios_base::fmtflags flags(out.flags());
        out.flags(std::ios_base::dec | std::ios_base::fixed |
                  std::ios_base::left);
        out << '('
            << std::setprecision(math::numeric_limits<float_t>::digits10+1)
            << p.gamma() << ' ' << p.theta()
            << ')';
        out.flags(flags);
        return out;
      }

      template<typename char_t, typename traits_t>
      friend std::basic_istream<char_t, traits_t> &
      operator>>(std::basic_istream<char_t, traits_t> &in,
                 param_type &p) {
        float_t gamma, theta;
        std::ios_base::fmtflags flags(in.flags());
        in.flags(std::ios_base::dec | std::ios_base::fixed |
                 std::ios_base::left);
        in >> utility::delim('(')
	   >> gamma >> utility::delim(' ')
	   >> theta >> utility::delim(')');
        if (in)
          p=param_type(gamma, theta);
        in.flags(flags);
        return in;
      }

    };

  private:
    param_type p;

  public:
    // constructor
    TRNG_CUDA_ENABLE
    powerlaw_dist(result_type gamma, result_type theta) : p(gamma, theta) {
    }
    TRNG_CUDA_ENABLE
    explicit powerlaw_dist(const param_type &p) : p(p) {
    }
    // reset internal state
    TRNG_CUDA_ENABLE
    void reset() { }
    // random numbers
    template<typename R>
    TRNG_CUDA_ENABLE
    result_type operator()(R &r) {
      return p.theta()*math::pow(utility::uniformoc<result_type>(r), -1/p.gamma());
    }
    template<typename R>
    TRNG_CUDA_ENABLE
    result_type operator()(R &r, const param_type &p) {
      powerlaw_dist g(p);
      return g(r);
    }
    // property methods
    TRNG_CUDA_ENABLE
    result_type min() const { return p.theta(); }
    TRNG_CUDA_ENABLE
    result_type max() const { return math::numeric_limits<result_type>::infinity(); }
    TRNG_CUDA_ENABLE
    param_type param() const { return p; }
    TRNG_CUDA_ENABLE
    void param(const param_type &p_new) { p=p_new; }
    TRNG_CUDA_ENABLE
    result_type gamma() const { return p.gamma(); }
    TRNG_CUDA_ENABLE
    void gamma(result_type gamma_new) { p.gamma(gamma_new); }
    TRNG_CUDA_ENABLE
    result_type theta() const { return p.theta(); }
    TRNG_CUDA_ENABLE
    void theta(result_type theta_new) { p.theta(theta_new); }
    // probability density function
    TRNG_CUDA_ENABLE
    result_type pdf(result_type x) const {
      if (x<p.theta())
	return 0;
      else
	return p.gamma()/p.theta()*
	  math::pow(x/p.theta(), -p.gamma()-1);
    }
    // cumulative density function
    TRNG_CUDA_ENABLE
    result_type cdf(result_type x) const {
      if (x<=0)
	return 0;
      else
	return 1-math::pow(x/p.theta(), -p.gamma());
    }
    // inverse cumulative density function
    TRNG_CUDA_ENABLE
    result_type icdf(result_type x) const {
      if (x<=0 or x>=1) {
#if !(defined __CUDA_ARCH__)
	errno=EDOM;
#endif
	return math::numeric_limits<result_type>::quiet_NaN();
      }
      if (x==0)
	return p.theta();
      if (x==1)
	return math::numeric_limits<result_type>::infinity();
      return p.theta()*math::pow(1-x, -1/p.gamma());
    }
  };

  // -------------------------------------------------------------------

  // EqualityComparable concept
  template<typename float_t>
  TRNG_CUDA_ENABLE
  inline bool operator==(const typename powerlaw_dist<float_t>::param_type &p1,
			 const typename powerlaw_dist<float_t>::param_type &p2) {
    return p1.gamma()==p2.gamma() and p1.theta()==p2.theta();
  }

  template<typename float_t>
  TRNG_CUDA_ENABLE
  inline bool operator!=(const typename powerlaw_dist<float_t>::param_type &p1,
			 const typename powerlaw_dist<float_t>::param_type &p2) {
    return not (p1==p2);
  }

  // -------------------------------------------------------------------

  // EqualityComparable concept
  template<typename float_t>
  TRNG_CUDA_ENABLE
  inline bool operator==(const powerlaw_dist<float_t> &g1,
			 const powerlaw_dist<float_t> &g2) {
    return g1.param()==g2.param();
  }

  template<typename float_t>
  TRNG_CUDA_ENABLE
  inline bool operator!=(const powerlaw_dist<float_t> &g1,
			 const powerlaw_dist<float_t> &g2) {
    return g1.param()!=g2.param();
  }

  // Streamable concept
  template<typename char_t, typename traits_t, typename float_t>
  std::basic_ostream<char_t, traits_t> &
  operator<<(std::basic_ostream<char_t, traits_t> &out,
	     const powerlaw_dist<float_t> &g) {
    std::ios_base::fmtflags flags(out.flags());
    out.flags(std::ios_base::dec | std::ios_base::fixed |
	      std::ios_base::left);
    out << "[powerlaw " << g.param() << ']';
    out.flags(flags);
    return out;
  }

  template<typename char_t, typename traits_t, typename float_t>
  std::basic_istream<char_t, traits_t> &
  operator>>(std::basic_istream<char_t, traits_t> &in,
	     powerlaw_dist<float_t> &g) {
    typename powerlaw_dist<float_t>::param_type p;
    std::ios_base::fmtflags flags(in.flags());
    in.flags(std::ios_base::dec | std::ios_base::fixed |
	     std::ios_base::left);
    in >> utility::ignore_spaces()
       >> utility::delim("[powerlaw ") >> p >> utility::delim(']');
    if (in)
      g.param(p);
    in.flags(flags);
    return in;
  }

}

#endif


text:
package wdclient

import (
	"context"
	"fmt"
	"github.com/chrislusf/seaweedfs/weed/stats"
	"math/rand"
	"time"

	"github.com/chrislusf/seaweedfs/weed/util"
	"google.golang.org/grpc"

	"github.com/chrislusf/seaweedfs/weed/glog"
	"github.com/chrislusf/seaweedfs/weed/pb"
	"github.com/chrislusf/seaweedfs/weed/pb/master_pb"
)

type MasterClient struct {
	FilerGroup     string
	clientType     string
	clientHost     pb.ServerAddress
	rack           string
	currentMaster  pb.ServerAddress
	masters        map[string]pb.ServerAddress
	grpcDialOption grpc.DialOption

	vidMap
	vidMapCacheSize int

	OnPeerUpdate func(update *master_pb.ClusterNodeUpdate, startFrom time.Time)
}

func NewMasterClient(grpcDialOption grpc.DialOption, filerGroup string, clientType string, clientHost pb.ServerAddress, clientDataCenter string, rack string, masters map[string]pb.ServerAddress) *MasterClient {
	return &MasterClient{
		FilerGroup:      filerGroup,
		clientType:      clientType,
		clientHost:      clientHost,
		masters:         masters,
		grpcDialOption:  grpcDialOption,
		vidMap:          newVidMap(clientDataCenter),
		vidMapCacheSize: 5,
	}
}

func (mc *MasterClient) GetLookupFileIdFunction() LookupFileIdFunctionType {
	return mc.LookupFileIdWithFallback
}

func (mc *MasterClient) LookupFileIdWithFallback(fileId string) (fullUrls []string, err error) {
	fullUrls, err = mc.vidMap.LookupFileId(fileId)
	if err == nil && len(fullUrls) > 0 {
		return
	}
	err = pb.WithMasterClient(false, mc.currentMaster, mc.grpcDialOption, func(client master_pb.SeaweedClient) error {
		resp, err := client.LookupVolume(context.Background(), &master_pb.LookupVolumeRequest{
			VolumeOrFileIds: []string{fileId},
		})
		if err != nil {
			return fmt.Errorf("LookupVolume failed: %v", err)
		}
		for vid, vidLocation := range resp.VolumeIdLocations {
			for _, vidLoc := range vidLocation.Locations {
				loc := Location{
					Url:       vidLoc.Url,
					PublicUrl: vidLoc.PublicUrl,
					GrpcPort:  int(vidLoc.GrpcPort),
				}
				mc.vidMap.addLocation(uint32(vid), loc)
				fullUrls = append(fullUrls, "http://"+loc.Url+"/"+fileId)
			}
		}
		return nil
	})
	return
}

func (mc *MasterClient) GetMaster() pb.ServerAddress {
	mc.WaitUntilConnected()
	return mc.currentMaster
}

func (mc *MasterClient) GetMasters() map[string]pb.ServerAddress {
	mc.WaitUntilConnected()
	return mc.masters
}

func (mc *MasterClient) WaitUntilConnected() {
	for mc.currentMaster == "" {
		time.Sleep(time.Duration(rand.Int31n(200)) * time.Millisecond)
	}
}

func (mc *MasterClient) KeepConnectedToMaster() {
	glog.V(1).Infof("%s.%s masterClient bootstraps with masters %v", mc.FilerGroup, mc.clientType, mc.masters)
	for {
		mc.tryAllMasters()
		time.Sleep(time.Second)
	}
}

func (mc *MasterClient) FindLeaderFromOtherPeers(myMasterAddress pb.ServerAddress) (leader string) {
	for _, master := range mc.masters {
		if master == myMasterAddress {
			continue
		}
		if grpcErr := pb.WithMasterClient(false, master, mc.grpcDialOption, func(client master_pb.SeaweedClient) error {
			ctx, cancel := context.WithTimeout(context.Background(), 120*time.Millisecond)
			defer cancel()
			resp, err := client.GetMasterConfiguration(ctx, &master_pb.GetMasterConfigurationRequest{})
			if err != nil {
				return err
			}
			leader = resp.Leader
			return nil
		}); grpcErr != nil {
			glog.V(0).Infof("connect to %s: %v", master, grpcErr)
		}
		if leader != "" {
			glog.V(0).Infof("existing leader is %s", leader)
			return
		}
	}
	glog.V(0).Infof("No existing leader found!")
	return
}

func (mc *MasterClient) tryAllMasters() {
	var nextHintedLeader pb.ServerAddress
	for _, master := range mc.masters {

		nextHintedLeader = mc.tryConnectToMaster(master)
		for nextHintedLeader != "" {
			nextHintedLeader = mc.tryConnectToMaster(nextHintedLeader)
		}

		mc.currentMaster = ""
	}
}

func (mc *MasterClient) tryConnectToMaster(master pb.ServerAddress) (nextHintedLeader pb.ServerAddress) {
	glog.V(1).Infof("%s.%s masterClient Connecting to master %v", mc.FilerGroup, mc.clientType, master)
	stats.MasterClientConnectCounter.WithLabelValues("total").Inc()
	gprcErr := pb.WithMasterClient(true, master, mc.grpcDialOption, func(client master_pb.SeaweedClient) error {
		ctx, cancel := context.WithCancel(context.Background())
		defer cancel()

		stream, err := client.KeepConnected(ctx)
		if err != nil {
			glog.V(1).Infof("%s.%s masterClient failed to keep connected to %s: %v", mc.FilerGroup, mc.clientType, master, err)
			stats.MasterClientConnectCounter.WithLabelValues(stats.FailedToKeepConnected).Inc()
			return err
		}

		if err = stream.Send(&master_pb.KeepConnectedRequest{
			FilerGroup:    mc.FilerGroup,
			DataCenter:    mc.DataCenter,
			Rack:          mc.rack,
			ClientType:    mc.clientType,
			ClientAddress: string(mc.clientHost),
			Version:       util.Version(),
		}); err != nil {
			glog.V(0).Infof("%s.%s masterClient failed to send to %s: %v", mc.FilerGroup, mc.clientType, master, err)
			stats.MasterClientConnectCounter.WithLabelValues(stats.FailedToSend).Inc()
			return err
		}
		glog.V(1).Infof("%s.%s masterClient Connected to %v", mc.FilerGroup, mc.clientType, master)

		resp, err := stream.Recv()
		if err != nil {
			glog.V(0).Infof("%s.%s masterClient failed to receive from %s: %v", mc.FilerGroup, mc.clientType, master, err)
			stats.MasterClientConnectCounter.WithLabelValues(stats.FailedToReceive).Inc()
			return err
		}

		// check if it is the leader to determine whether to reset the vidMap
		if resp.VolumeLocation != nil {
			if resp.VolumeLocation.Leader != "" && string(master) != resp.VolumeLocation.Leader {
				glog.V(0).Infof("master %v redirected to leader %v", master, resp.VolumeLocation.Leader)
				nextHintedLeader = pb.ServerAddress(resp.VolumeLocation.Leader)
				stats.MasterClientConnectCounter.WithLabelValues(stats.RedirectedToleader).Inc()
				return nil
			}
			//mc.vidMap = newVidMap("")
			mc.resetVidMap()
			mc.updateVidMap(resp)
		} else {
			mc.resetVidMap()
			//mc.vidMap = newVidMap("")
		}
		mc.currentMaster = master

		for {
			resp, err := stream.Recv()
			if err != nil {
				glog.V(0).Infof("%s.%s masterClient failed to receive from %s: %v", mc.FilerGroup, mc.clientType, master, err)
				stats.MasterClientConnectCounter.WithLabelValues(stats.FailedToReceive).Inc()
				return err
			}

			if resp.VolumeLocation != nil {
				// maybe the leader is changed
				if resp.VolumeLocation.Leader != "" && string(mc.currentMaster) != resp.VolumeLocation.Leader {
					glog.V(0).Infof("currentMaster %v redirected to leader %v", mc.currentMaster, resp.VolumeLocation.Leader)
					nextHintedLeader = pb.ServerAddress(resp.VolumeLocation.Leader)
					stats.MasterClientConnectCounter.WithLabelValues(stats.RedirectedToleader).Inc()
					return nil
				}

				mc.updateVidMap(resp)
			}

			if resp.ClusterNodeUpdate != nil {
				update := resp.ClusterNodeUpdate
				if mc.OnPeerUpdate != nil {
					if update.FilerGroup == mc.FilerGroup {
						if update.IsAdd {
							glog.V(0).Infof("+ %s.%s %s leader:%v\n", update.FilerGroup, update.NodeType, update.Address, update.IsLeader)
						} else {
							glog.V(0).Infof("- %s.%s %s leader:%v\n", update.FilerGroup, update.NodeType, update.Address, update.IsLeader)
						}
						stats.MasterClientConnectCounter.WithLabelValues(stats.OnPeerUpdate).Inc()
						mc.OnPeerUpdate(update, time.Now())
					}
				}
			}

		}

	})
	if gprcErr != nil {
		stats.MasterClientConnectCounter.WithLabelValues(stats.Failed).Inc()
		glog.V(1).Infof("%s.%s masterClient failed to connect with master %v: %v", mc.FilerGroup, mc.clientType, master, gprcErr)
	}
	return
}

func (mc *MasterClient) updateVidMap(resp *master_pb.KeepConnectedResponse) {
	// process new volume location
	loc := Location{
		Url:        resp.VolumeLocation.Url,
		PublicUrl:  resp.VolumeLocation.PublicUrl,
		DataCenter: resp.VolumeLocation.DataCenter,
		GrpcPort:   int(resp.VolumeLocation.GrpcPort),
	}
	for _, newVid := range resp.VolumeLocation.NewVids {
		glog.V(1).Infof("%s.%s: %s masterClient adds volume %d", mc.FilerGroup, mc.clientType, loc.Url, newVid)
		mc.addLocation(newVid, loc)
	}
	for _, deletedVid := range resp.VolumeLocation.DeletedVids {
		glog.V(1).Infof("%s.%s: %s masterClient removes volume %d", mc.FilerGroup, mc.clientType, loc.Url, deletedVid)
		mc.deleteLocation(deletedVid, loc)
	}
	for _, newEcVid := range resp.VolumeLocation.NewEcVids {
		glog.V(1).Infof("%s.%s: %s masterClient adds ec volume %d", mc.FilerGroup, mc.clientType, loc.Url, newEcVid)
		mc.addEcLocation(newEcVid, loc)
	}
	for _, deletedEcVid := range resp.VolumeLocation.DeletedEcVids {
		glog.V(1).Infof("%s.%s: %s masterClient removes ec volume %d", mc.FilerGroup, mc.clientType, loc.Url, deletedEcVid)
		mc.deleteEcLocation(deletedEcVid, loc)
	}
}

func (mc *MasterClient) WithClient(streamingMode bool, fn func(client master_pb.SeaweedClient) error) error {
	return util.Retry("master grpc", func() error {
		for mc.currentMaster == "" {
			time.Sleep(3 * time.Second)
		}
		return pb.WithMasterClient(streamingMode, mc.currentMaster, mc.grpcDialOption, func(client master_pb.SeaweedClient) error {
			return fn(client)
		})
	})
}

func (mc *MasterClient) resetVidMap() {
	tail := &vidMap{vid2Locations: mc.vid2Locations, ecVid2Locations: mc.ecVid2Locations, cache: mc.cache}
	mc.vidMap = newVidMap("")
	mc.vidMap.cache = tail

	for i := 0; i < mc.vidMapCacheSize && tail.cache != nil; i++ {
		if i == mc.vidMapCacheSize-1 {
			tail.cache = nil
		} else {
			tail = tail.cache
		}
	}
}


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

#import <UIKit/UIKit.h>

@interface UITouch (GREYAdditions)

/**
 *  Creates a fake touch at @c point in window coordinates of the given @c window.
 *
 *  @param point  The location of this touch in window coordinates.
 *  @param window The reference window used for coordinates passed as @c point.
 *
 *  @return An initialized UITouch object
 */
- (id)initAtPoint:(CGPoint)point relativeToWindow:(UIWindow *)window;

@end


text:
@interface DetailViewController : UITableViewController

@property (weak, nonatomic) MKMapView *mapView;
@property (weak, nonatomic) MKPlacemark *placemark;

@end


text:
<ServerManagerConfiguration>
  <ProxyGroup name="sources">
    <SourceProxy name="MethaneReader" class="vtkMethaneReader">
      <OutputPort name="MethaneLevel" index="0" />
      <StringVectorProperty
        name="FileName"
        command="SetFileName"
        number_of_elements="1">
        <FileListDomain name="files"/>
      </StringVectorProperty>
    </SourceProxy>
    <!-- End of Methane Reader -->
  </ProxyGroup>
</ServerManagerConfiguration>