text
stringlengths 2
100k
| meta
dict |
---|---|
if (argument_count == 2)
{
return argument[0].path_scale;
}
argument[1].path_scale = argument[0]; | {
"pile_set_name": "Github"
} |
#!/bin/bash
cd ../kernel && make sfsimg arch=riscv32 && cd ../tests
for f in *.cmd
do
echo testing $f begin
(
cd ../kernel
make build arch=riscv32 init=$(cat ../tests/$f)
exec timeout 10s make justruntest arch=riscv32 init=$(cat ../tests/$f)
) &
pid=$!
wait $pid
awk 'NR > 25 { print }' < stdout > stdout.new
diff -u ${f%.cmd}.out stdout.new || { echo 'testing failed for' $f; exit 1; }
echo testing $f pass
done
| {
"pile_set_name": "Github"
} |
{
"cells": [
{
"cell_type": "code",
"execution_count": 1,
"metadata": {},
"outputs": [],
"source": [
"import sys\n",
"import os\n",
"import time\n",
"searchPath=os.path.abspath('..')\n",
"sys.path.append(searchPath)"
]
},
{
"cell_type": "code",
"execution_count": 2,
"metadata": {},
"outputs": [],
"source": [
"from sklearn.model_selection import train_test_split\n",
"from sklearn.datasets import load_iris\n",
"import numpy as np\n",
"import matplotlib.pyplot as plt\n",
"from knn.knn_base import KNN\n",
"from knn.knn_kdtree import KNNKdTree\n",
"from utils.data_generater import random_points\n",
"from utils.plot import plot_knn_predict"
]
},
{
"cell_type": "code",
"execution_count": 3,
"metadata": {},
"outputs": [],
"source": [
"def getData(number):\n",
" data = random_points(2, number)\n",
" label = [0] * (number // 2) + [1] * (number // 2)\n",
" return np.array(data), np.array(label)"
]
},
{
"cell_type": "code",
"execution_count": 4,
"metadata": {},
"outputs": [],
"source": [
"dataList = []\n",
"labelList = []\n",
"for num in [30, 500, 1000, 2000, 5000, 10000, 50000, 400000]:\n",
" data, label = getData(num)\n",
" dataList.append(data)\n",
" labelList.append(label)"
]
},
{
"cell_type": "code",
"execution_count": 5,
"metadata": {},
"outputs": [],
"source": [
"models = {\"knn\":KNN(), \"kdtree\":KNNKdTree()}"
]
},
{
"cell_type": "code",
"execution_count": 6,
"metadata": {},
"outputs": [
{
"name": "stdout",
"output_type": "stream",
"text": [
"model = knn, dataNum = 30, takeTime = 0.00391\n",
"model = kdtree, dataNum = 30, takeTime = 0.00417\n",
"model = knn, dataNum = 500, takeTime = 0.03806\n",
"model = kdtree, dataNum = 500, takeTime = 0.00856\n",
"model = knn, dataNum = 1000, takeTime = 0.05203\n",
"model = kdtree, dataNum = 1000, takeTime = 0.01386\n",
"model = knn, dataNum = 2000, takeTime = 0.1387\n",
"model = kdtree, dataNum = 2000, takeTime = 0.02863\n",
"model = knn, dataNum = 5000, takeTime = 0.28177\n",
"model = kdtree, dataNum = 5000, takeTime = 0.07277\n",
"model = knn, dataNum = 10000, takeTime = 0.47404\n",
"model = kdtree, dataNum = 10000, takeTime = 0.16433\n",
"model = knn, dataNum = 50000, takeTime = 2.0887\n",
"model = kdtree, dataNum = 50000, takeTime = 0.93545\n",
"model = knn, dataNum = 400000, takeTime = 16.82156\n",
"model = kdtree, dataNum = 400000, takeTime = 11.85994\n"
]
}
],
"source": [
"for data, label in zip(dataList, labelList):\n",
" for name, model in models.items():\n",
" startTime = time.time()\n",
" model.fit(data, label)\n",
" for i in range(5):\n",
" model.predict([0.3, 0.2])\n",
" print(\"model = %s, dataNum = %s, takeTime = %s\"%(name, len(data), round(time.time() - startTime, 5)))"
]
},
{
"cell_type": "code",
"execution_count": 7,
"metadata": {},
"outputs": [
{
"name": "stdout",
"output_type": "stream",
"text": [
"<knn.knn_kdtree.Node object at 0x1091d00b8>\n",
"<knn.knn_kdtree.Node object at 0x1091d0240>\n",
"<knn.knn_kdtree.Node object at 0x1091d0080>\n"
]
},
{
"data": {
"image/png": "iVBORw0KGgoAAAANSUhEUgAAAXcAAAD8CAYAAACMwORRAAAABHNCSVQICAgIfAhkiAAAAAlwSFlzAAALEgAACxIB0t1+/AAAADl0RVh0U29mdHdhcmUAbWF0cGxvdGxpYiB2ZXJzaW9uIDIuMS4yLCBodHRwOi8vbWF0cGxvdGxpYi5vcmcvNQv5yAAAIABJREFUeJzt3XmUXFW5/vHvW9Vd1VMSMiFkItGEMTJoMyuESYJCAhIkQbgy5ncZxAtcEJlEcEAQvVwFIYKCCkRARpn0AoIgEYIMAgkaAmSCJCQhQ3fX/P7+qCb2UJ2uJFV1qqqfz1q90lX79Dlvzup++vQ+++xt7o6IiFSXUNAFiIhI4SncRUSqkMJdRKQKKdxFRKqQwl1EpAop3EVEqpDCXUSkCincRUSqkMJdRKQK1QR14CFDhvjo0aODOryISEV66aWXPnT3ob1tF1i4jx49mtmzZwd1eBGRimRm7+WznbplRESqkMJdRKQKKdxFRKqQwl1EpAoFdkNVSmfpe8t58IbHmffyfIZ9aismnXEoYz69TdBliUgRKdyr3AuPvswVx1xLOpUmlUjxylNv8KdfP80pV32Vo77+xYIcY9G/3mfmVffx9z+9RqS+loknHcjksyZS31RfkP2LyMazoFZiam5udg2FLK62lhhf2epUYi3xbm2R+ggzXv0Rw8duvVnHeGv225x/4OXE2xJk0pn1+/7ENkP52d9+QEM/BbxIIZnZS+7e3Nt26nOvYs8/8CJmlrMtk0rz2C1PbvYxfnTS9bSti60PdoBEW4Kl7y7j3v/5w2bvX0Q2jcK9Arhn8Mxq3JMb9XWrlq4mlUjlbEsl0yxbtGKz6lr63nKWzF+asy0RS/LYL5/arP2LyKZTn3sZc8/gLb+AlpvBW4EQXn8E1u8iLNTU69eP2XkbaiI1JHMEfF1DlB32HLdZ9cVaYoTDPV8fxFq7dweJSGnoyr2M+Zpvw7obwFcDSSAObQ/iK6fmdRW/6wE7MWjrgYRyBHC4NswhJ+y3WfUNG7tVzn0DWMjYZcJOm7V/Edl0Cvcy5ekl0HY/0NalJQHpRRB/otd9hEIhrnni24zaYQR1jVHqm+qo71fP4GED+dFTl9M4oHGzaqyN1HL8pVOoa4h2a4vURTj+0imbtX8R2XTqlilX8efo8Xevt+Jtj2J1E3vdzdARg5nx6o9468V5LJy7hMHDB7HrATsRChXm9/rR5xxOOp3hju/+HgzSqQyDthrA+b86izHjRxXkGCKy8RTuZSsMZtDTSFUL570nM2P7Pcax/R6b18fe076PPX8yR539RRa8uYhoQ4QR2w7rcZSOiJSGwr1cRfeDNblHukADVndEScvpTSRay9jdxgRdhgSsZXULT975HIv/9T4jtxvGhKn70ti/Ieiy+iSFe5my8BC88WRouY3O/e5RqN0hG/4iZeSVp17n0klXgWdHStU1Rrnp/F/z3Ye+xc777Rh0eX2ObqiWMWs6B/pfDuFRQAhsIDSeig26DduIbhmRYmtZ3cKlk39IrCW+fghsrCVO29oYlxzxA9rWdR0YIMWmK/cyZmZYw1HQcFTQpYhs0FMz/wqZ3DeIPOM8fdfzTDz5wBJX1bcp3CvIgrmLWbbgQ4aP24qtx3wi6HJE1ls87/0eH1qLtcR5v4cnmaV4FO4VYOl7y/nO0dewYM7i7BOn8SQ77LUtl951LgOG9A+6PBFGbjuMusZozknq6prqGDZ2qwCq6tvU517mEvEk3/jcJbz96nvE2xK0rG4lEUvyxnNzOf+g7xDUrJ4iHU2Yui8Wyj38NRwOsd8xe5e4IlG4l7lnfz+L1tWtnWZdhOzEXx+8s4zXnn4zoMpE/q2hXz3ff/gi6vvVU9dUB2Sv2BsHNPD9Ry6ivrEu4Ar7HnXLlLnXnnmTtnWxnG2JWII5s/6pOVykLIz/3A78bvFNPH33LN6fv5ThY7div2P2zjk9hRSfwr2IVry/ivuue5jnH5pNpC7CoScdwMSTD9yob/YBQ/oTrgmTTqW7tdVEamka2PvskCKlUt9Uz8STDgi6DEHhXjQL5i7mG/tcTLwtTjKefdJ04VuLeXjGn/jfv34v7yXoDj5hP+75yR9yhrtnMnz+6D0LWreIVAf1uRfJtafeQMvq1vXBDhBvTbBk3gfcfe1Dee9n5HbDOfaCyUQ7XO1byIg2RDjjupM0WkZEctIaqkXw0fLVHDfyP3MukgEwZPgg7lx400bt89U/v8E9P36IJfOXMmb8SI45bxLb7T62EOWKSAXJdw3VvLplzGwicB0QBm5296u6tI8CbgO2aN/mQnd/ZKOrrhKta9oI14Z7DPeebpBuyC4TdtKNUxHJW6/dMpadxOR64DBgR2CamXWdBegS4C533w2YCtxQ6EIryZajhhCu6Xnul81d3k5EpDf59LnvAcxz9/nungBmApO7bOPAx52/A4AlhSux8tTU1nDcxUfnHBUTbYhwwuVfCaAqEelL8umWGQ4s7PB6EdB1iMblwB/N7OtAI3BwQaqrYMecdwTx1ji/u/oBamrDZDIZInURzrv5dHbca9ugyxORKpdPuOd6prjrXdhpwK3ufq2Z7Q38xszGu3unxyrNbDowHWDUqOpegs3MOOGyY5hy3hH8c/bbROoibNv8ScJhTdUrIsWXT7gvAkZ2eD2C7t0upwATAdz9eTOrA4YAyzpu5O4zgBmQHS2ziTVXlPrGOnbZXzdCRaS08ulzfxEYZ2ZjzCxC9obpg122WQAcBGBmOwB1wPJCFioiIvnrNdzdPQWcBTwOzCE7KuYNM7vCzCa1b3YecJqZvQrcCZzomq5QRCQweY1zbx+z/kiX9y7r8PmbwL6FLU1ERDaVph8QEalCCncRkSqkcBcRqUIKdxGRKqRwFxGpQgp3EZEqpHAXEalCCncRkSqkcBcRqUIKdxGRKqRwFxGpQgp3EZEqpHAXEalCec0KKSKyqdydZ+6ZxV1X388H7y5nqzFbMvWbR/K5L++JWa6F3qQQFO4iUlQ3/fdtPDzj/4i1xAFYs2ItV5/4M+b87V9Mv/qEgKurXuqWEZGiWfjWYh668U/rg/1jsZY4D/zsUZa8/UFAlVU/hbuIFM3Tdz9POpnO2ZZJZ3jmnlklrqjvULiLSNHEW+OkU7nDPZVME2uJlbiivkPhLiJFs+sB46lvqsvZVtdUxy4TdipxRX2Hwr0Pi7fFefnJf/Dyk/8g3hbv/QtENtJuB32a4eO2pjbSeexGbbSGkdsNY9cDxgdUWfXTaJk+6v6fPcotF91BKJQdipbJOKd8bxpHfv2LAVcm1SQUCvGjJ7/NtafdyKyHXqI2UkMykWKfyc2cM+M/NRSyiBTufdCff/ccN194O/HWzlfrN3/rDrbYcgATjt03oMqkGjUOaOSyu85j7ap1fLh4JUOGD6LfwKagy6p66pbpg3516cxuwQ7Zm1+/umRmj1/n7iyYu5h5r7xDMpEsZolShfoNbGLM+FEK9hLRlXsfk0qmeP/tpT22vz9/Kalkiprazt8aLz/5D6499eesXr6GUCiEhYz/uPwYjjr7S/rTWqQMKdz7mHBNmJpIDcl47ivvmkiYcE2403vzXn6HSyddRbw10en9X148k5raGiadMbFo9YrIplG3TB9jZhwwdV/CteFubeHaMBOO3bfblfhtl99Foi3Rbft4a5zbvv27Hscxi0hwFO590GlXH8/grQcSqY+sfy9SH2Hw1gOZfk33uT5e/8sc3HPvKxFLsvS95cUqVQLg6cV48l+4d/+FLpVD3TJ90BZDBzDjtWt59OYnePLOZwE4cNrnOOzUg2js39Bt+0h9BD5qybmvdCpDXWO0qPVKaXjyDXz1NyH1Hlg2GrzxdKzxNN1XqUAK9z6qsX8DU849ginnHtHrtoeeOIF7fvwQyXiqW9vonUYwaKuBxShRSshTC/CVXwVvbX+jfTTVuutxUljTGcEVJ5tE3TLSq2MvmMzQkUOI1NWufy9cE6K+Xx3n3nx6gJVJoXjLzZCzG6YNWmbgrjlgKo3CXXrVOKCRG2b/kK9ecjTDPrUVQ4YP4gsnHsBNL/+IsbuOCbo8KYT4s0D3v8yyQpB8q5TVSAGoW0by0ti/geMuOprjLjo66FKkGGxD903SYPUlK0UKQ1fuIgL1U4DcszdiA6FmXEnLkc2ncBcRrPE4qBkFdLyCDwF12IAfarRMBVK4iwhm9digu6DpDAiPhNBgiH4BG3w3Ft0z6PJkE+TV525mE4HrgDBws7tflWObrwCXAw686u7HFbBOESkyCzVgTadDk0ZAVYNew93MwsD1wCHAIuBFM3vQ3d/ssM044FvAvu6+ysy2LFbBIiLSu3y6ZfYA5rn7fM8+jzwTmNxlm9OA6919FYC7LytsmSIisjHyCffhwMIOrxe1v9fRtsC2Zvacmc1q78YREZGA5NPnnus2eddppGqAccAEYATwFzMb7+4fddqR2XRgOsCoUaM2uliRvqxtXRvLF61k4CcGaMEL6VU+4b4IGNnh9QhgSY5tZrl7EnjHzN4iG/YvdtzI3WcAMwCam5t7mGdQRDpKxBLccM6v+NNtzxCuDZFKpGk+dBfOu/l0BgzpH3R5Uqby6ZZ5ERhnZmPMLAJMBR7sss39wAEAZjaEbDfN/EIWKuXL0x/gqXdx17zuxfCdKdfyp18/QyKWoG1tjGQ8yQuPvsw39r2EVLKnKQOkr+s13N09BZwFPA7MAe5y9zfM7Aozm9S+2ePACjN7E3gKON/dVxSraCkPnnyNzIeH48sPwVcciS/bh0xLz2uwVgv3JJmW35BZ/gUyS/cks/IkPDG7KMd65x/v8epTr3dbLCWdTLPy/VU8d98LRTmuVL68xrm7+yPAI13eu6zD5w6c2/4hfYCn3sZX/keHKWIBWmHtD8jghBqnBVle0bin8VWnQuJloH2mxMRz+MqX8P5XEmroOpBs87zy1BtkMrl7MNvWxZj1yN/Z/yv7FPSYUh30hKpsEl93A+ScBrYN1v2Y7B98VSj+f5B8lfXBvl4M1n674FPjRupqCYVz/5iaGfVaKEV6oHCXTRN/Dsj00JiE9HulrKZkvPX3//5rpZsQxJ8v6PH2mbw7nsl9nqMNEQ4+fr+CHk+qh8JdNo1Fem7zNFgPMwxWuh6DHbJ9U/GCHm7gJ7bg+MuOIdrQ+Qq9rjHK3pOa2WGvbQt6PKkems9dNk39UdByC5Bj9Z7wcCzc9Tm3KhE9AJKv0b1bBvAk1O5W8ENOu/AoxowfxR3f+z0L/7mEwVsPZMq5R/CFEydotkbpkcJdNok1nozHHoL0Mv4d8CEgig34foCVFZc1HIO3/KJ9SbqO3SV1UH84Fv5EUY671+GfZa/DP1uUfUt1UreMbBILDcAG3weNJ0NoS7AtIHooNvgeLPKZoMsrGgv1xwbfDbWfASJgjUA9NByH9b8i6PJE1tOVu2wyCw3A+p0L/frWCFirGYkNvgNPL4fMR1AzAtMydFJmFO5ScO4ZSM1t74PeHtvg+pyVy8JDITw06DJEclK4S0F57El8zcXgbWR7/Rxv+jqhxpODLk2kT1G4S8F44iX8o/+i20iStdeRob5qn1oVKUe6oSoF4+v+h5xDBGmDdddlu2tEpCQU7lI4ydd6bvNWyGiBLpFSUbhLAW1oxEgarKFklWyMTCZD69o20mlNWSzVQ+EuhVN/FFCbo8GgdlcsVF4LS6TTaX773d9z9NCT+fLgkzhyi6/x83NuJd5W2CkERIKgcJeCsabTIbw10HHoYy1YEzbgu0GV1aOrv/YzZl51L+tWtZBOpYm1xPnDTX/km4dcSaaHybpEKoXCXQom+/Tm/dB0NoTHQngbaDgBG/IwVjMm6PI6eW/OIp6992/EWzvPjZOIJXn7tfd4+Yl/BFSZSGFoKKQUlIWasKbToOm0oEvZoNmPvUJ2jZnuYutiPHvfC3z2kF1KXJVI4ejKXfokCxmQe0ZFMwiHNduiVDaFu/RJex3+WXqaLTfaWMfnp+xd2oJECkzhLn3SsE9txcEn7NdtEYxIfYQd996WnffbMaDKRApD4S591jd+Pp1TfnAcQ4YPAoP+g/tx7DeP5LsPXahFMKTiWU83lYqtubnZZ8+eHcixRbpydwV6hfL4c3jLLZBeAOHRWOOpWHSvoMsqGjN7yd2be9tOo2VEQMFeoTLrrod1M4C27BvpBXjiRbzpTEJN0wOtLWjqlhGRiuSphbDuRtYH+3ptsO6nePr9IMoqGwp3EalIHnuYzuvYdmqF2COlLKfsKNxFpDJl1gDJHhoTeGZtKaspOxUb7ulUmg8Xr6B1bdc/yUSkL7BIc88zjVpDVS/Uno+Ku6Hq7tx1zQPM/OH9JGNJMukMnzlkZ/7rxukMGT446PJEpFSi+0NoS0gvAlIdGmogtDVEPhdUZWWh4q7cb77wt/zmintYt6qFeFuCZCLFi4+9wpl7fIuW1S1BlyciJWIWxgbdAbWfAaJg/bL/RpqxwbdjVnHxVlAVdeW+ZuVa7v/poyRinfvZMukMLatbeOyXT3L0OUcEVJ2IlJqFh2CDf4unF0N6CYRHYOGtgy6rLFTUr7bXn51LTST376N4a4Jnfv+3ElckIuXAwsOxyO4K9g4qKtxrajf8h0ZttKL+EBERKZqKCvddJuxIJpN7uoS6xiiHnnhAiSsSESlPFRXu0fooZ/zkRKINkU7vR+pqGbn9cCYcu09AlYmIlJeK68c47JSDGDJiML++/C7eee09GgY0cPj/O4SvnD+Z2kiuxZlFRPqeigt3gN0P3ZXdD9016DJERMpWXt0yZjbRzN4ys3lmduEGtptiZm5mvU5HKSIixdNruJtZGLgeOAzYEZhmZt2WqTGzfsDZgMYjiogELJ8r9z2Aee4+390TwExgco7trgSuBmIFrE9ERDZBPuE+HFjY4fWi9vfWM7PdgJHu/ocN7cjMppvZbDObvXz58o0uVkRE8pNPuOdaomb9YHPLTuDwE+C83nbk7jPcvdndm4cOHZp/lSIislHyCfdFwMgOr0cASzq87geMB/5sZu8CewEP6qaqiEhw8gn3F4FxZjbGzCLAVODBjxvdfbW7D3H30e4+GpgFTHJ3rX4tIhKQXsPd3VPAWcDjwBzgLnd/w8yuMLNJxS5QREQ2Xl4PMbn7I8AjXd67rIdtJ2x+WSIisjkqam4ZERHJj8JdRKQKKdxFRKqQwl1EpAop3EVEqpDCXUSkCincRaqMp98n89F/k/ng02Q+2IHMiml44qWgy5ISU7iLVBFPL8U/PBJifwDiQBqSL+ErT8LjzwVdnpSQwl2kB+4JMi13kvnwKDLLDyWz5ko8vaT3LwyQr7sRfC2Q6dISw9dchnvuBeal+lTkMntSHdwTkHgRPAGR3bDQFkGXtJ57HF8xDVLzWL9EQetCvO1eGHQ7VtttvZryEH8MSOVuSy+DzBIID8/dLlVF4S6ByLQ+AGsvZ/2M0p7EG76K9buA7CzSwfKW2zsHOwAp8BS++gJsyAaXLgiOd71i78jA0yUrRYIV/E+R9DkenwVrLgVvwY6aix01F4hD6514y42bts9MC578J55eUZgi22bS46JiqQV4amHutqDVHQiEc7eFBkB4ZO42qToKdyk5X/e/5A7ONmi5Bfdk/vvyBJnV38GX7Y2vPBZfvj+ZlSfg6Q82s8iWntssDL5u8/ZfJNZ4Blg93dfYqYN+l2CWa+0dqUYKdym91Bzsy4uyH8+3ZT/aX0MKNiKY/aMLoO33QKw9kBOQmI2vmIJnWje9xtrP0vOPRwZqxmz6vovIakZig++GyN5kr+DDEB6DbXEdofpDgy5PSkh97lJ61q/nNk9BaAPtnTZdAPEnyA756ygNmXV42wNY47RNK7HpDDz+NNDWpaUeGk7GrG6T9lsKVvMpbNCtuMfBk1ioKeiSJAAKdym9hqn4vauAOHx5EQB+7wggBJHm/EfNJGe3d5HkamyF+FOwqeFeuz0MvAFffUH7XwQh8CQ0nIA1fX2T9llqZlGwaNBlSEAU7lJy1ngyHnuifTTKx+rAGrD+39uIPdWRe/32dqHGTawwy6L7wtC/QOpN8Dao2UFXwVIxFO5ScmZ1MPhOiD2CP3QPeAzqDsEajt24se7R/Xoe2mcNWP3RBag1BLXjN3s/IqWmcJdAmEWg/kis/shN30eoCe93Eaz9Pp1H39RDZC+I7LPZdVYiT87NPqmafAmsCRqOy/7itEjQpUkJKdylooUap+I1o/GWGyD5FoQGQ8PXsIYpZfEwVKl5/Dl81elAguwUBEth7TV47GEY9GsFfB+icJeKZ9G9sOheQZcROPcMvvp8uj9DEIPkHGh7EBqmBFGaBKDvXdqIVKvkP7I3fnNqw9t+V9JyJFgKd5Fq4a1scPRQZgNP3UrVUbiLVIvanbJj8XM3QvTzJS1HgqVwF6kSFuoPDdOA+hyNEazxxFKXJAFSuItUEev3TWg4HqjPDoOkDsJjsUG3Y+Gtgy5PSkijZUSqiFkY638+3nQmpOeD9cdqRgVdlgRA4S5ShSzUACE9WduXqVtGRKQKKdxFRKqQumWkbHns//CWmyC1EMLDsKbpED1UqwmJ5EHhLmUps/Yn0HIr0Na+QtNr+H1vQ/3fsf4XBVydSPlTt4yUHU8thJZf0m0VJG+D1pl46u1A6hKpJLpyl/ITfxzItF+xgz3fHvJfXgQY/vjDWL+zAytPpBLoyl3Kj7cBqZ4aNzA5loh8LK9wN7OJZvaWmc0zswtztJ9rZm+a2Wtm9oSZbVP4UqUU3NN4ZhXuiY37wtbWwhUR2ROsHr93RPZj7/rsx70j8Pu2xaJ7F+5YIlWq13A3szBwPXAYsCMwzcx27LLZy0Czu+8M3ANcXehCpbjc02TWXY8v2wNf9nl86WfJrP4Wnlnb+xd/8AFsuSUsXVqYYmp3h/BYoOvCErUQHgGRzxXmOCJVLJ8r9z2Aee4+37OXczOByR03cPen3P3jS7dZwIjClinF5msuhXUzwNdiX56PffltaHsIXzkN73GmwXb33w8tLdl/C8DMsEG3QvQgIILftz1+7ychOiE7R0ofXGFJZGPlc0N1OLCww+tFwJ4b2P4U4NHNKUpKy1OLoO0hIN6lJQHpRRB/EuoO7f6F48fD3Lngnn19xhlw5pmw/fbw+uubVZOFmrCB1+GZjyD9AYQ/gYUGbtY+RfqSfMI91xMjnnNDs+OBZmD/HtqnA9MBRo3SZEZlI/EcEOphdAr4I49hucL9jjvgiCNg+XJoa4NoNNs9c+edBSvNQltAaIuC7U+kr8jn79tFwMgOr0cAS7puZGYHAxcDk9y96yUgAO4+w92b3b156NChm1KvFEV4gwv49HgNsPPOcNllkEpBfX3238sug09/uhhFishGyCfcXwTGmdkYyy6dPhV4sOMGZrYbcBPZYF9W+DI7S6fTZDKZYh+m74juD57ueXRK/eE9f+1vfws1NXDeedl/f/Ob0tUtIj3qNdzdPQWcBTwOzAHucvc3zOwKM5vUvtk1QBNwt5m9YmYP9rC7zfL6c3M5e5+LOCwyjcOi07joi9/nvTmLinGoPsXCQ6HxZLqv4FMHNeMhsoHl2U4/PdvvfuWV2X9PP72YpYpInsw9Z/d50TU3N/vs2bPz3v7Vp9/g4i99n3jrv8dfm0FdUz03vHgVI7YdVowy+wx3x9vuh5YbsjdRbQA0Ho81Tif7B5uIlAMze8ndm3vbrmLGlF1/9i87BTtkB2nEWmL86tKZAVVVPcyMUMNRhIb+idBWcwh9YhahprMU7CIVqiLCfc3KtSx8q9s9XAA847zw8N9LXJGISHmriHDvTTAdSyIi5asiwr3/oH6M3C53n7qFjD2/9JkSVyQiUt4qItwBzvzfk4k2dO7/NYO6xjpOunJqQFWJFIe7k4glCGrAg1S+ign3Xfbfiasev5Qd9hqXvfkXDtF86G78dNb3NVJGqoa7c+91D3PssNM4oul4JvU/gZ+fcyux1pzPBYr0qGKGQnaUTqWxkBEKVczvJpG8/PSsm/njrX/uFOa10Vo+ufMorvvr9wiHwwFWJ+Wg6oZCdhSuCSvYpeosW7CcR295sttVejKeZMGcxfxNo8JkIyghRcrE7MdfJRTOPclP27oYz9z9fIkrkkqmcBepEGYbnN1NpBOFu0iZ2P2w3cikc98Dq2uqY/+v7FPiiqSSKdxFysTQEYP50vSDqWuIdnq/tq6W0TuNZPfDdg2oMqlECneRMnLG/5zEqT/8KoOHDcQMGvrXc+RZh/GjJ7+tkTKyUSpyKKRIX5BOpQnXKNCls6oeCinSFyjYZXMo3EVEqlA+C2SLFFwmk+Efz8xh+aIVbLPjCMZ95pNBlyRSVRTuUnLzXnmHSw6/ita1reDZ+VSGj92a7z1yEYO3Hhh0eSJVQd0yUlItq1s4/8DvsGLJStrWxmhbFyPWEufdNxZwwcHf0SyIIgWicJeS+uOvnyaVSHV7P53KsHzhCl575s0AqhKpPgp3Kak5z/+zx+lrU8kUb7/ybmkLEqlS6nOXkhoyYhDhmjDpVLpbW02khi22HBBAVRIU9wwknsXjfwNrxOq/iNWMDrqsqqArdympw045iHBtD+O3HfaZvHtpC5LAeOYjfMUk/KOzofUX0PIz/MMjyKy5WvdeCkDhLiU1crvhnHTlVKL1EULh7LdfTaSGaEOUi2ee021eFalevvpCSL0D3tr+TgqIQ+vtEH8iyNKqgrplpOSmnHsEux44ngeuf4wP5i9j7GfGMPnMiWw1esugS5MS8cxKiD8LJHO0tuEtv8DqDi51WVVF4S6BGLvrGM77xelBlyFBSb8PFgFP9NC+qLT1VCF1y4hI6YW37jnYAcIjS1dLlVK4i0jJWWgQRPcDanM01mON00teU7VRuItIIGzAVVAzDqyh/Z1aIAoNJ2J1BwZZWlVQn7uIBMJC/WHwfZB4Hk+8gFkj1E3EatQlUwgKdxEJjJlBdB8sqvVhC62iwt0zqyD2CJ5ejtVuB9GDMIsEXZaISNmpmHDPtD0Gqy9ofxXDrRGsHgbdjtWMCbQ2EZF8rP5wDe/PX8rgYYMYOmJwUY9VEeHuqYXtwR7r8GYLeCu+8mQY+mT2zzsRkTLUtq6NH592I3994EU6OWFIAAAFoUlEQVRqo7Uk40m222MsF93+DYYML07IV8RoGW+9g+yjyd1awFdB4oVSlyQikrdLJ/2Q5x54kUQsScvqVhKxJG/+9S3O3udiErENjPffDHmFu5lNNLO3zGyemV2Yoz1qZr9rb/+bmY0uaJWpf5E73AF3SC8o6OFERArlX3+fz9wX5pGMdZ5qIZ3KsG5VC8/cM6sox+013M0sDFwPHAbsCEwzsx27bHYKsMrdxwI/AX5Y0CprxpLzYQcAC0F4REEPJyJSKK8/O5dMOpOzrW1djNmPv1KU4+Zz5b4HMM/d57t7ApgJTO6yzWTgtvbP7wEOsgJ2glvDtB5KNbB+ENmzUIcSESmo+qY6wjW5ozYUMpoGNhbluPmE+3BgYYfXi9rfy7mNu6eA1UDB7hJYzTbQ/3tAtP2D7FNttgU26JeYVcStAxHpg/aZvHuPV+61dREOOWH/ohw3n1TMdQXedSb9fLbBzKab2Wwzm718+fJ86lsv1DAJG/oUNJ0LDSdj/b+DbfkMVjN2o/YjIlJK/Qf3Y/o1JxBt6PxMTl1jlIO++jm22704GZbPUMhFQMfngUcAS3rYZpGZ1QADgJVdd+TuM4AZAM3NzRu91IqFh2BNJ23sl4mIBGrymYcxevwoZl51H+++sYghwwcx5dwj2G/KXkU7Zj7h/iIwzszGAIuBqcBxXbZ5EPga8DwwBXjStU6WiMh6u+y/E7vsv1PJjtdruLt7yszOAh4HwsAv3f0NM7sCmO3uDwK3AL8xs3lkr9inFrNoERHZsLyeUHX3R4BHurx3WYfPY8AxhS1NREQ2lYaZiIhUIYW7iEgVUriLiFQhC2pQi5ktB97biC8ZAnxYpHIqlc5Jdzon3emcdFbp52Mbdx/a20aBhfvGMrPZ7t4cdB3lROekO52T7nROOusr50PdMiIiVUjhLiJShSop3GcEXUAZ0jnpTuekO52TzvrE+aiYPncREclfJV25i4hInsou3ANf0q8M5XFOzjWzN83sNTN7wsy2CaLOUurtnHTYboqZuZlV9eiIfM6HmX2l/fvkDTO7o9Q1lloePzejzOwpM3u5/Wfni0HUWTTuXjYfZCcmexv4JBABXgV27LLNGcCN7Z9PBX4XdN1lcE4OABraPz9d52T9dv2AZ4BZQHPQdQf8PTIOeBkY2P56y6DrLoNzMgM4vf3zHYF3g667kB/lduUe+JJ+ZajXc+LuT7l7a/vLWWTn3K9m+XyfAFwJXA3ESllcAPI5H6cB17v7KgB3X1biGkstn3PiQP/2zwfQfZ2KilZu4R74kn5lKJ9z0tEpwKNFrSh4vZ4TM9sNGOnufyhlYQHJ53tkW2BbM3vOzGaZ2cSSVReMfM7J5cDxZraI7Ky3Xy9NaaWR15S/JVSwJf2qSN7/XzM7HmgGirMoY/nY4Dmx7KK6PwFOLFVBAcvne6SGbNfMBLJ/2f3FzMa7+0dFri0o+ZyTacCt7n6tme1Ndk2K8e6ee8HTClNuV+4bs6QfG1rSr4rkc04ws4OBi4FJ7h4vUW1B6e2c9APGA382s3eBvYAHq/imar4/Nw+4e9Ld3wHeIhv21Sqfc3IKcBeAuz8P1JGdd6YqlFu4r1/Sz8wiZG+YPthlm4+X9IO+saRfr+ekvQviJrLBXu19qdDLOXH31e4+xN1Hu/tosvchJrn77GDKLbp8fm7uJ3vjHTMbQrabZn5JqyytfM7JAuAgADPbgWy4Ly9plUVUVuHe3of+8ZJ+c4C7vH1JPzOb1L7ZLcDg9iX9zgV6HAZXDfI8J9cATcDdZvaKmXX9Jq4qeZ6TPiPP8/E4sMLM3gSeAs539xXBVFx8eZ6T84DTzOxV4E7gxGq6UNQTqiIiVaisrtxFRKQwFO4iIlVI4S4iUoUU7iIiVUjhLiJShRTuIiJVSOEuIlKFFO4iIlXo/wN7Vchil0gbWwAAAABJRU5ErkJggg==\n",
"text/plain": [
"<matplotlib.figure.Figure at 0x1091d0fd0>"
]
},
"metadata": {},
"output_type": "display_data"
}
],
"source": [
"point = (0.3, 0.2)\n",
"model = KNNKdTree()\n",
"model.fit(dataList[0], labelList[0])\n",
"plot_knn_predict(model, dataList[0], labelList[0], point)"
]
},
{
"cell_type": "code",
"execution_count": null,
"metadata": {},
"outputs": [],
"source": []
}
],
"metadata": {
"kernelspec": {
"display_name": "Python 3",
"language": "python",
"name": "python3"
},
"language_info": {
"codemirror_mode": {
"name": "ipython",
"version": 3
},
"file_extension": ".py",
"mimetype": "text/x-python",
"name": "python",
"nbconvert_exporter": "python",
"pygments_lexer": "ipython3",
"version": "3.6.4"
}
},
"nbformat": 4,
"nbformat_minor": 2
}
| {
"pile_set_name": "Github"
} |
regenerate:
go install github.com/gogo/protobuf/protoc-min-version
go install github.com/gogo/protobuf/protoc-gen-gogoslick
protoc-min-version --version="3.0.0" --proto_path=.:$(GOPATH)/src/:$(GOPATH)/src/github.com/gogo/protobuf/protobuf/ \
--gogoslick_out=Mgoogle/protobuf/timestamp.proto=github.com/gogo/protobuf/types:. timefail.proto
| {
"pile_set_name": "Github"
} |
/*
* Licensed to the Apache Software Foundation (ASF) under one or more
* contributor license agreements. See the NOTICE file distributed with
* this work for additional information regarding copyright ownership.
* The ASF licenses this file to you 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.
*/
package org.apache.jmeter.save.converters;
import java.util.ArrayList;
import java.util.Collection;
import org.apache.jmeter.reporters.ResultCollectorHelper;
import org.apache.jmeter.samplers.SampleResult;
import org.apache.jmeter.save.SaveService;
import org.apache.jmeter.save.TestResultWrapper;
import com.thoughtworks.xstream.converters.MarshallingContext;
import com.thoughtworks.xstream.converters.UnmarshallingContext;
import com.thoughtworks.xstream.converters.collections.AbstractCollectionConverter;
import com.thoughtworks.xstream.io.HierarchicalStreamReader;
import com.thoughtworks.xstream.io.HierarchicalStreamWriter;
import com.thoughtworks.xstream.mapper.Mapper;
/**
* XStream Class to convert TestResultWrapper
*
*/
public class TestResultWrapperConverter extends AbstractCollectionConverter {
/**
* Returns the converter version; used to check for possible
* incompatibilities
*
* @return the version of this converter
*/
public static String getVersion() {
return "$Revision$"; //$NON-NLS-1$
}
/**
* @param arg0 the {@link Mapper} to be used
*/
public TestResultWrapperConverter(Mapper arg0) {
super(arg0);
}
/** {@inheritDoc} */
@Override
public boolean canConvert(@SuppressWarnings("rawtypes") Class arg0) { // superclass does not use types
return TestResultWrapper.class.equals(arg0);
}
/** {@inheritDoc} */
@Override
public void marshal(Object arg0, HierarchicalStreamWriter arg1, MarshallingContext arg2) {
// Not used, as the <testResult> element is generated by the
// ResultCollector class
}
/**
* Read test results from JTL files and pass them to the visualiser directly.
* If the ResultCollector helper object is defined, then pass the samples to that
* rather than adding them to the test result wrapper.
*
* @return the test result wrapper (may be empty)
*
* @see com.thoughtworks.xstream.converters.Converter#unmarshal(com.thoughtworks.xstream.io.HierarchicalStreamReader,
* com.thoughtworks.xstream.converters.UnmarshallingContext)
*/
@Override
public Object unmarshal(HierarchicalStreamReader reader, UnmarshallingContext context) {
TestResultWrapper results = new TestResultWrapper();
Collection<SampleResult> samples = new ArrayList<>();
String ver = reader.getAttribute("version"); //$NON-NLS-1$
if (ver == null || ver.length() == 0) {
ver = "1.0"; //$NON-NLS-1$
}
results.setVersion(ver);
ConversionHelp.setInVersion(ver);// Make sure decoding follows input file
final ResultCollectorHelper resultCollectorHelper = (ResultCollectorHelper) context.get(SaveService.RESULTCOLLECTOR_HELPER_OBJECT);
while (reader.hasMoreChildren()) {
reader.moveDown();
SampleResult sample = (SampleResult) readItem(reader, context, results);
if (resultCollectorHelper != null) {
resultCollectorHelper.add(sample);
} else {
samples.add(sample);
}
reader.moveUp();
}
results.setSampleResults(samples);
return results;
}
}
| {
"pile_set_name": "Github"
} |
/*
Copyright 2016 The Kubernetes Authors.
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.
*/
package config
import (
"fmt"
"sort"
"strconv"
"strings"
"github.com/golang/glog"
"github.com/spf13/pflag"
)
const (
flagName = "feature-gates"
// All known feature keys
// To add a new feature, define a key for it below and add
// a featureSpec entry to knownFeatures.
// allAlphaGate is a global toggle for alpha features. Per-feature key
// values override the default set by allAlphaGate. Examples:
// AllAlpha=false,NewFeature=true will result in newFeature=true
// AllAlpha=true,NewFeature=false will result in newFeature=false
allAlphaGate = "AllAlpha"
externalTrafficLocalOnly = "AllowExtTrafficLocalEndpoints"
appArmor = "AppArmor"
dynamicKubeletConfig = "DynamicKubeletConfig"
dynamicVolumeProvisioning = "DynamicVolumeProvisioning"
)
var (
// Default values for recorded features. Every new feature gate should be
// represented here.
knownFeatures = map[string]featureSpec{
allAlphaGate: {false, alpha},
externalTrafficLocalOnly: {false, alpha},
appArmor: {true, beta},
dynamicKubeletConfig: {false, alpha},
dynamicVolumeProvisioning: {true, alpha},
}
// Special handling for a few gates.
specialFeatures = map[string]func(f *featureGate, val bool){
allAlphaGate: setUnsetAlphaGates,
}
// DefaultFeatureGate is a shared global FeatureGate.
DefaultFeatureGate = &featureGate{
known: knownFeatures,
special: specialFeatures,
}
)
type featureSpec struct {
enabled bool
prerelease prerelease
}
type prerelease string
const (
// Values for prerelease.
alpha = prerelease("ALPHA")
beta = prerelease("BETA")
ga = prerelease("")
)
// FeatureGate parses and stores flag gates for known features from
// a string like feature1=true,feature2=false,...
type FeatureGate interface {
AddFlag(fs *pflag.FlagSet)
// Every feature gate should add method here following this template:
//
// // owner: @username
// // alpha: v1.4
// MyFeature() bool
// owner: @timstclair
// beta: v1.4
AppArmor() bool
// owner: @girishkalele
// alpha: v1.4
ExternalTrafficLocalOnly() bool
// owner: @saad-ali
// alpha: v1.3
DynamicVolumeProvisioning() bool
// owner: mtaufen
// alpha: v1.4
DynamicKubeletConfig() bool
}
// featureGate implements FeatureGate as well as pflag.Value for flag parsing.
type featureGate struct {
known map[string]featureSpec
special map[string]func(*featureGate, bool)
enabled map[string]bool
}
func setUnsetAlphaGates(f *featureGate, val bool) {
for k, v := range f.known {
if v.prerelease == alpha {
if _, found := f.enabled[k]; !found {
f.enabled[k] = val
}
}
}
}
// Set, String, and Type implement pflag.Value
// Set Parses a string of the form // "key1=value1,key2=value2,..." into a
// map[string]bool of known keys or returns an error.
func (f *featureGate) Set(value string) error {
f.enabled = make(map[string]bool)
for _, s := range strings.Split(value, ",") {
if len(s) == 0 {
continue
}
arr := strings.SplitN(s, "=", 2)
k := strings.TrimSpace(arr[0])
_, ok := f.known[k]
if !ok {
return fmt.Errorf("unrecognized key: %s", k)
}
if len(arr) != 2 {
return fmt.Errorf("missing bool value for %s", k)
}
v := strings.TrimSpace(arr[1])
boolValue, err := strconv.ParseBool(v)
if err != nil {
return fmt.Errorf("invalid value of %s: %s, err: %v", k, v, err)
}
f.enabled[k] = boolValue
// Handle "special" features like "all alpha gates"
if fn, found := f.special[k]; found {
fn(f, boolValue)
}
}
glog.Infof("feature gates: %v", f.enabled)
return nil
}
func (f *featureGate) String() string {
pairs := []string{}
for k, v := range f.enabled {
pairs = append(pairs, fmt.Sprintf("%s=%t", k, v))
}
sort.Strings(pairs)
return strings.Join(pairs, ",")
}
func (f *featureGate) Type() string {
return "mapStringBool"
}
// ExternalTrafficLocalOnly returns value for AllowExtTrafficLocalEndpoints
func (f *featureGate) ExternalTrafficLocalOnly() bool {
return f.lookup(externalTrafficLocalOnly)
}
// AppArmor returns the value for the AppArmor feature gate.
func (f *featureGate) AppArmor() bool {
return f.lookup(appArmor)
}
// DynamicKubeletConfig returns value for dynamicKubeletConfig
func (f *featureGate) DynamicKubeletConfig() bool {
return f.lookup(dynamicKubeletConfig)
}
// DynamicVolumeProvisioning returns value for dynamicVolumeProvisioning
func (f *featureGate) DynamicVolumeProvisioning() bool {
return f.lookup(dynamicVolumeProvisioning)
}
func (f *featureGate) lookup(key string) bool {
defaultValue := f.known[key].enabled
if f.enabled != nil {
if v, ok := f.enabled[key]; ok {
return v
}
}
return defaultValue
}
// AddFlag adds a flag for setting global feature gates to the specified FlagSet.
func (f *featureGate) AddFlag(fs *pflag.FlagSet) {
var known []string
for k, v := range f.known {
pre := ""
if v.prerelease != ga {
pre = fmt.Sprintf("%s - ", v.prerelease)
}
known = append(known, fmt.Sprintf("%s=true|false (%sdefault=%t)", k, pre, v.enabled))
}
sort.Strings(known)
fs.Var(f, flagName, ""+
"A set of key=value pairs that describe feature gates for alpha/experimental features. "+
"Options are:\n"+strings.Join(known, "\n"))
}
| {
"pile_set_name": "Github"
} |
//===----------------------------------------------------------------------===//
//
// The LLVM Compiler Infrastructure
//
// This file is dual licensed under the MIT and the University of Illinois Open
// Source Licenses. See LICENSE.TXT for details.
//
//===----------------------------------------------------------------------===//
// <list>
// void resize(size_type sz);
#include <list>
#include <cassert>
#include "DefaultOnly.h"
#include "min_allocator.h"
int main()
{
{
std::list<int> l(5, 2);
l.resize(2);
assert(l.size() == 2);
assert(std::distance(l.begin(), l.end()) == 2);
assert(l == std::list<int>(2, 2));
}
{
std::list<int> l(5, 2);
l.resize(10);
assert(l.size() == 10);
assert(std::distance(l.begin(), l.end()) == 10);
assert(l.front() == 2);
assert(l.back() == 0);
}
#ifdef __LIBCPP_MOVE
{
std::list<DefaultOnly> l(10);
l.resize(5);
assert(l.size() == 5);
assert(std::distance(l.begin(), l.end()) == 5);
}
{
std::list<DefaultOnly> l(10);
l.resize(20);
assert(l.size() == 20);
assert(std::distance(l.begin(), l.end()) == 20);
}
#endif // __LIBCPP_MOVE
#if TEST_STD_VER >= 11
{
std::list<int, min_allocator<int>> l(5, 2);
l.resize(2);
assert(l.size() == 2);
assert(std::distance(l.begin(), l.end()) == 2);
assert((l == std::list<int, min_allocator<int>>(2, 2)));
}
{
std::list<int, min_allocator<int>> l(5, 2);
l.resize(10);
assert(l.size() == 10);
assert(std::distance(l.begin(), l.end()) == 10);
assert(l.front() == 2);
assert(l.back() == 0);
}
#ifdef __LIBCPP_MOVE
{
std::list<DefaultOnly, min_allocator<DefaultOnly>> l(10);
l.resize(5);
assert(l.size() == 5);
assert(std::distance(l.begin(), l.end()) == 5);
}
{
std::list<DefaultOnly, min_allocator<DefaultOnly>> l(10);
l.resize(20);
assert(l.size() == 20);
assert(std::distance(l.begin(), l.end()) == 20);
}
#endif // __LIBCPP_MOVE
#endif
}
| {
"pile_set_name": "Github"
} |
/*
* RHQ Management Platform
* Copyright (C) 2005-2010 Red Hat, Inc.
* All rights reserved.
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation version 2 of the License.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
*/
package org.rhq.enterprise.server.resource;
import java.util.List;
import java.util.Map;
import javax.ejb.Remote;
import org.rhq.core.domain.auth.Subject;
import org.rhq.core.domain.authz.Permission;
import org.rhq.core.domain.criteria.ResourceCriteria;
import org.rhq.core.domain.measurement.AvailabilityType;
import org.rhq.core.domain.measurement.ResourceAvailability;
import org.rhq.core.domain.resource.Agent;
import org.rhq.core.domain.resource.Resource;
import org.rhq.core.domain.resource.ResourceAncestryFormat;
import org.rhq.core.domain.resource.composite.ResourceAvailabilitySummary;
import org.rhq.core.domain.util.PageControl;
import org.rhq.core.domain.util.PageList;
import org.rhq.enterprise.server.authz.PermissionException;
/**
* @author Jay Shaughnessy
* @author Simeon Pinder
* @author Asaf Shakarchi
*/
@Remote
public interface ResourceManagerRemote {
/**
* Returns a summary object that provides information about a resource's
* past availability history.
*
* @param subject
* @param resourceId
*
* @return summary POJO
*/
ResourceAvailabilitySummary getAvailabilitySummary(Subject subject, int resourceId);
/**
* Returns the availability of the resource with the specified id.
* This performs a live check - a resource will be considered UNKNOWN if the agent
* cannot be contacted for any reason.
*
* @param subject The logged in user's subject.
* @param resourceId the id of a {@link Resource} in inventory.
*
* @return the resource availability - note that if the encapsulated availability type is <code>null</code>,
* the resource availability is UNKNOWN. As of RHQ 4.4 this does not return null but rather
* {@link AvailabilityType#UNKNOWN}.
*/
ResourceAvailability getLiveResourceAvailability(Subject subject, int resourceId);
/**
* Returns the Resource with the specified id.
*
* @param subject The logged in user's subject.
* @param resourceId the id of a {@link Resource} in inventory.
*
* @return the resource
* @throws ResourceNotFoundException if the resource represented by the resourceId parameter does not exist.
* @throws PermissionException if the user does not have view permission for the resource
*/
Resource getResource(Subject subject, int resourceId) throws ResourceNotFoundException, PermissionException;
/**
* Returns the lineage of the Resource with the specified id. The lineage is represented as a List of Resources,
* with the first item being the root of the Resource's ancestry (or the Resource itself if it is a root Resource
* (i.e. a platform)) and the last item being the Resource itself. Since the lineage includes the Resource itself,
* the returned List will always contain at least one item.
*
* @param subject The logged in user's subject.
* @param resourceId the id of a {@link Resource} in inventory
*
* @return the lineage of the Resource with the specified id
* @throws ResourceNotFoundException if the resource represented by the resourceId parameter does not exist.
* @throws PermissionException if the user does not have view permission for a resource in the lineage
*/
List<Resource> findResourceLineage(Subject subject, int resourceId);
/**
* Update resource's editable properties (name, description, location).
*
* @param subject the logged in user
* @param resource the resource to update
* @return the updated resource
*/
Resource updateResource(Subject subject, Resource resource);
/**
* This will uninventory all resources managed by the given agent. Since this
* also removes the platform resource, this will also remove the given agent as well.
*
* @param user the logged in user
* @param doomedAgent the agent to be deleted and whose resources are to be uninventoried
*
* @since 4.7
*/
void uninventoryAllResourcesByAgent(Subject user, Agent doomedAgent);
/**
* Given a specific resource type, this will uninventory all resources of that type.
*
* @param subject the logged in user
* @param resourceTypeId identifies the type whose resources are to be uninventoried
*
* @since 4.7
*/
void uninventoryResourcesOfResourceType(Subject subject, int resourceTypeId);
/**
* Removes these resources from inventory. The resources may subsequently be rediscovered. Note that for
* each specified resource all children will also be removed, it it not necessary or recommended to
* specify more than one resource in the same ancestry line.
*
* @param subject The logged in user's subject.
* @param resourceIds The resources to uninventory.
* @return the resource ids of the uninventoried resources
*/
List<Integer> uninventoryResources(Subject subject, int[] resourceIds);
/**
* @param subject
* @param criteria
* @return not null
*/
PageList<Resource> findResourcesByCriteria(Subject subject, ResourceCriteria criteria);
/**
* @param subject
* @param resourceId
* @param pageControl
* @return not null
*/
PageList<Resource> findChildResources(Subject subject, int resourceId, PageControl pageControl);
/**
* @param subject
* @param resourceId
* @return the parent resource or null if the resource has no parent
* @throws ResourceNotFoundException if the resource does not exist
* @throws PermissionException if the user does not have view permission for a resource in the lineage
*/
Resource getParentResource(Subject subject, int resourceId) throws ResourceNotFoundException, PermissionException;
/**
* Resource.ancestry is an encoded value that holds the resource's parental ancestry. It is not suitable for display.
* This method can be used to get decoded and formatted ancestry values for a set of resources. A typical usage
* would a criteria resource fetch, and then a subsequent call to this method for ancestry display, potentially
* for resource disambiguation purposes.
*
* @param subject
* @param resourceIds
* @param format
* @return A Map of ResourceIds to FormattedAncestryStrings, one entry for each unique, valid, resourceId passed in.
*/
Map<Integer, String> getResourcesAncestry(Subject subject, Integer[] resourceIds, ResourceAncestryFormat format);
/**
* Set these resources to {@link AvailabilityType#DISABLED}. While disabled resource availability reported
* from the agent is ignored. This is typically used for resources undergoing scheduled maintenance or
* whose avail state should be disregarded for some period.
* <br/><br/>
* The calling user must possess {@link Permission#DELETE_RESOURCE} permission on all of the provided resources.
* <br/><br/>
* Resources already disabled are ignored.
*
* @param subject The logged in user's subject.
* @param resourceIds The resources to disable.
* @return the disabled resource ids, not null
*
* @see #enableResources(Subject, int[])
*/
List<Integer> disableResources(Subject subject, int[] resourceIds);
/**
* Set these resources enabled. Resources already enabled are ignored. The availability will be set to UNKNOWN
* until the agent reports a new, live, availability. The agent will be requested to check availability
* for the enabled resources at its earliest convenience.
* <br/><br/>
* The calling user must possess {@link Permission#DELETE_RESOURCE} permission on all of the provided resources.
*
* @param subject The logged in user's subject.
* @param resourceIds The resources to enable.
* @return the enable resource ids, not null
*
* @see #disableResources(Subject, int[])
*/
List<Integer> enableResources(Subject subject, int[] resourceIds);
} | {
"pile_set_name": "Github"
} |
/*
* Dirac encoder support via Schroedinger libraries
* Copyright (c) 2008 BBC, Anuradha Suraparaju <asuraparaju at gmail dot com >
*
* This file is part of FFmpeg.
*
* FFmpeg is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public
* License as published by the Free Software Foundation; either
* version 2.1 of the License, or (at your option) any later version.
*
* FFmpeg is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public
* License along with FFmpeg; if not, write to the Free Software
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
*/
/**
* @file
* Dirac encoder support via libschroedinger-1.0 libraries. More details about
* the Schroedinger project can be found at http://www.diracvideo.org/.
* The library implements Dirac Specification Version 2.2
* (http://dirac.sourceforge.net/specification.html).
*/
#undef NDEBUG
#include <assert.h>
#include <schroedinger/schro.h>
#include <schroedinger/schrodebug.h>
#include <schroedinger/schrovideoformat.h>
#include "avcodec.h"
#include "libdirac_libschro.h"
#include "libschroedinger.h"
#include "bytestream.h"
/** libschroedinger encoder private data */
typedef struct FfmpegSchroEncoderParams {
/** Schroedinger video format */
SchroVideoFormat *format;
/** Schroedinger frame format */
SchroFrameFormat frame_format;
/** frame being encoded */
AVFrame picture;
/** frame size */
int frame_size;
/** Schroedinger encoder handle*/
SchroEncoder* encoder;
/** buffer to store encoder output before writing it to the frame queue*/
unsigned char *enc_buf;
/** Size of encoder buffer*/
int enc_buf_size;
/** queue storing encoded frames */
FfmpegDiracSchroQueue enc_frame_queue;
/** end of sequence signalled */
int eos_signalled;
/** end of sequence pulled */
int eos_pulled;
} FfmpegSchroEncoderParams;
/**
* Works out Schro-compatible chroma format.
*/
static int SetSchroChromaFormat(AVCodecContext *avccontext)
{
int num_formats = sizeof(ffmpeg_schro_pixel_format_map) /
sizeof(ffmpeg_schro_pixel_format_map[0]);
int idx;
FfmpegSchroEncoderParams* p_schro_params = avccontext->priv_data;
for (idx = 0; idx < num_formats; ++idx) {
if (ffmpeg_schro_pixel_format_map[idx].ff_pix_fmt ==
avccontext->pix_fmt) {
p_schro_params->format->chroma_format =
ffmpeg_schro_pixel_format_map[idx].schro_pix_fmt;
return 0;
}
}
av_log(avccontext, AV_LOG_ERROR,
"This codec currently only supports planar YUV 4:2:0, 4:2:2"
" and 4:4:4 formats.\n");
return -1;
}
static int libschroedinger_encode_init(AVCodecContext *avccontext)
{
FfmpegSchroEncoderParams* p_schro_params = avccontext->priv_data;
SchroVideoFormatEnum preset;
/* Initialize the libraries that libschroedinger depends on. */
schro_init();
/* Create an encoder object. */
p_schro_params->encoder = schro_encoder_new();
if (!p_schro_params->encoder) {
av_log(avccontext, AV_LOG_ERROR,
"Unrecoverable Error: schro_encoder_new failed. ");
return -1;
}
/* Initialize the format. */
preset = ff_get_schro_video_format_preset(avccontext);
p_schro_params->format =
schro_encoder_get_video_format(p_schro_params->encoder);
schro_video_format_set_std_video_format(p_schro_params->format, preset);
p_schro_params->format->width = avccontext->width;
p_schro_params->format->height = avccontext->height;
if (SetSchroChromaFormat(avccontext) == -1)
return -1;
if (avccontext->color_primaries == AVCOL_PRI_BT709) {
p_schro_params->format->colour_primaries = SCHRO_COLOUR_PRIMARY_HDTV;
} else if (avccontext->color_primaries == AVCOL_PRI_BT470BG) {
p_schro_params->format->colour_primaries = SCHRO_COLOUR_PRIMARY_SDTV_625;
} else if (avccontext->color_primaries == AVCOL_PRI_SMPTE170M) {
p_schro_params->format->colour_primaries = SCHRO_COLOUR_PRIMARY_SDTV_525;
}
if (avccontext->colorspace == AVCOL_SPC_BT709) {
p_schro_params->format->colour_matrix = SCHRO_COLOUR_MATRIX_HDTV;
} else if (avccontext->colorspace == AVCOL_SPC_BT470BG) {
p_schro_params->format->colour_matrix = SCHRO_COLOUR_MATRIX_SDTV;
}
if (avccontext->color_trc == AVCOL_TRC_BT709) {
p_schro_params->format->transfer_function = SCHRO_TRANSFER_CHAR_TV_GAMMA;
}
if (ff_get_schro_frame_format(p_schro_params->format->chroma_format,
&p_schro_params->frame_format) == -1) {
av_log(avccontext, AV_LOG_ERROR,
"This codec currently supports only planar YUV 4:2:0, 4:2:2"
" and 4:4:4 formats.\n");
return -1;
}
p_schro_params->format->frame_rate_numerator = avccontext->time_base.den;
p_schro_params->format->frame_rate_denominator = avccontext->time_base.num;
p_schro_params->frame_size = avpicture_get_size(avccontext->pix_fmt,
avccontext->width,
avccontext->height);
avccontext->coded_frame = &p_schro_params->picture;
if (!avccontext->gop_size) {
schro_encoder_setting_set_double(p_schro_params->encoder,
"gop_structure",
SCHRO_ENCODER_GOP_INTRA_ONLY);
if (avccontext->coder_type == FF_CODER_TYPE_VLC)
schro_encoder_setting_set_double(p_schro_params->encoder,
"enable_noarith", 1);
} else {
schro_encoder_setting_set_double(p_schro_params->encoder,
"au_distance", avccontext->gop_size);
avccontext->has_b_frames = 1;
}
/* FIXME - Need to handle SCHRO_ENCODER_RATE_CONTROL_LOW_DELAY. */
if (avccontext->flags & CODEC_FLAG_QSCALE) {
if (!avccontext->global_quality) {
/* lossless coding */
schro_encoder_setting_set_double(p_schro_params->encoder,
"rate_control",
SCHRO_ENCODER_RATE_CONTROL_LOSSLESS);
} else {
int quality;
schro_encoder_setting_set_double(p_schro_params->encoder,
"rate_control",
SCHRO_ENCODER_RATE_CONTROL_CONSTANT_QUALITY);
quality = avccontext->global_quality / FF_QP2LAMBDA;
if (quality > 10)
quality = 10;
schro_encoder_setting_set_double(p_schro_params->encoder,
"quality", quality);
}
} else {
schro_encoder_setting_set_double(p_schro_params->encoder,
"rate_control",
SCHRO_ENCODER_RATE_CONTROL_CONSTANT_BITRATE);
schro_encoder_setting_set_double(p_schro_params->encoder,
"bitrate",
avccontext->bit_rate);
}
if (avccontext->flags & CODEC_FLAG_INTERLACED_ME)
/* All material can be coded as interlaced or progressive
irrespective of the type of source material. */
schro_encoder_setting_set_double(p_schro_params->encoder,
"interlaced_coding", 1);
schro_encoder_setting_set_double(p_schro_params->encoder, "open_gop",
!(avccontext->flags & CODEC_FLAG_CLOSED_GOP));
/* FIXME: Signal range hardcoded to 8-bit data until both libschroedinger
* and libdirac support other bit-depth data. */
schro_video_format_set_std_signal_range(p_schro_params->format,
SCHRO_SIGNAL_RANGE_8BIT_VIDEO);
/* Set the encoder format. */
schro_encoder_set_video_format(p_schro_params->encoder,
p_schro_params->format);
/* Set the debug level. */
schro_debug_set_level(avccontext->debug);
schro_encoder_start(p_schro_params->encoder);
/* Initialize the encoded frame queue. */
ff_dirac_schro_queue_init(&p_schro_params->enc_frame_queue);
return 0;
}
static SchroFrame *libschroedinger_frame_from_data(AVCodecContext *avccontext,
void *in_data)
{
FfmpegSchroEncoderParams* p_schro_params = avccontext->priv_data;
SchroFrame *in_frame;
/* Input line size may differ from what the codec supports. Especially
* when transcoding from one format to another. So use avpicture_layout
* to copy the frame. */
in_frame = ff_create_schro_frame(avccontext, p_schro_params->frame_format);
if (in_frame)
avpicture_layout((AVPicture *)in_data, avccontext->pix_fmt,
avccontext->width, avccontext->height,
in_frame->components[0].data,
p_schro_params->frame_size);
return in_frame;
}
static void SchroedingerFreeFrame(void *data)
{
FfmpegDiracSchroEncodedFrame *enc_frame = data;
av_freep(&(enc_frame->p_encbuf));
av_free(enc_frame);
}
static int libschroedinger_encode_frame(AVCodecContext *avccontext,
unsigned char *frame,
int buf_size, void *data)
{
int enc_size = 0;
FfmpegSchroEncoderParams* p_schro_params = avccontext->priv_data;
SchroEncoder *encoder = p_schro_params->encoder;
struct FfmpegDiracSchroEncodedFrame* p_frame_output = NULL;
int go = 1;
SchroBuffer *enc_buf;
int presentation_frame;
int parse_code;
int last_frame_in_sequence = 0;
if (!data) {
/* Push end of sequence if not already signalled. */
if (!p_schro_params->eos_signalled) {
schro_encoder_end_of_stream(encoder);
p_schro_params->eos_signalled = 1;
}
} else {
/* Allocate frame data to schro input buffer. */
SchroFrame *in_frame = libschroedinger_frame_from_data(avccontext,
data);
/* Load next frame. */
schro_encoder_push_frame(encoder, in_frame);
}
if (p_schro_params->eos_pulled)
go = 0;
/* Now check to see if we have any output from the encoder. */
while (go) {
SchroStateEnum state;
state = schro_encoder_wait(encoder);
switch (state) {
case SCHRO_STATE_HAVE_BUFFER:
case SCHRO_STATE_END_OF_STREAM:
enc_buf = schro_encoder_pull(encoder, &presentation_frame);
assert(enc_buf->length > 0);
assert(enc_buf->length <= buf_size);
parse_code = enc_buf->data[4];
/* All non-frame data is prepended to actual frame data to
* be able to set the pts correctly. So we don't write data
* to the frame output queue until we actually have a frame
*/
p_schro_params->enc_buf = av_realloc(p_schro_params->enc_buf,
p_schro_params->enc_buf_size + enc_buf->length);
memcpy(p_schro_params->enc_buf + p_schro_params->enc_buf_size,
enc_buf->data, enc_buf->length);
p_schro_params->enc_buf_size += enc_buf->length;
if (state == SCHRO_STATE_END_OF_STREAM) {
p_schro_params->eos_pulled = 1;
go = 0;
}
if (!SCHRO_PARSE_CODE_IS_PICTURE(parse_code)) {
schro_buffer_unref(enc_buf);
break;
}
/* Create output frame. */
p_frame_output = av_mallocz(sizeof(FfmpegDiracSchroEncodedFrame));
/* Set output data. */
p_frame_output->size = p_schro_params->enc_buf_size;
p_frame_output->p_encbuf = p_schro_params->enc_buf;
if (SCHRO_PARSE_CODE_IS_INTRA(parse_code) &&
SCHRO_PARSE_CODE_IS_REFERENCE(parse_code))
p_frame_output->key_frame = 1;
/* Parse the coded frame number from the bitstream. Bytes 14
* through 17 represesent the frame number. */
p_frame_output->frame_num = AV_RB32(enc_buf->data + 13);
ff_dirac_schro_queue_push_back(&p_schro_params->enc_frame_queue,
p_frame_output);
p_schro_params->enc_buf_size = 0;
p_schro_params->enc_buf = NULL;
schro_buffer_unref(enc_buf);
break;
case SCHRO_STATE_NEED_FRAME:
go = 0;
break;
case SCHRO_STATE_AGAIN:
break;
default:
av_log(avccontext, AV_LOG_ERROR, "Unknown Schro Encoder state\n");
return -1;
}
}
/* Copy 'next' frame in queue. */
if (p_schro_params->enc_frame_queue.size == 1 &&
p_schro_params->eos_pulled)
last_frame_in_sequence = 1;
p_frame_output = ff_dirac_schro_queue_pop(&p_schro_params->enc_frame_queue);
if (!p_frame_output)
return 0;
memcpy(frame, p_frame_output->p_encbuf, p_frame_output->size);
avccontext->coded_frame->key_frame = p_frame_output->key_frame;
/* Use the frame number of the encoded frame as the pts. It is OK to
* do so since Dirac is a constant frame rate codec. It expects input
* to be of constant frame rate. */
avccontext->coded_frame->pts = p_frame_output->frame_num;
enc_size = p_frame_output->size;
/* Append the end of sequence information to the last frame in the
* sequence. */
if (last_frame_in_sequence && p_schro_params->enc_buf_size > 0) {
memcpy(frame + enc_size, p_schro_params->enc_buf,
p_schro_params->enc_buf_size);
enc_size += p_schro_params->enc_buf_size;
av_freep(&p_schro_params->enc_buf);
p_schro_params->enc_buf_size = 0;
}
/* free frame */
SchroedingerFreeFrame(p_frame_output);
return enc_size;
}
static int libschroedinger_encode_close(AVCodecContext *avccontext)
{
FfmpegSchroEncoderParams* p_schro_params = avccontext->priv_data;
/* Close the encoder. */
schro_encoder_free(p_schro_params->encoder);
/* Free data in the output frame queue. */
ff_dirac_schro_queue_free(&p_schro_params->enc_frame_queue,
SchroedingerFreeFrame);
/* Free the encoder buffer. */
if (p_schro_params->enc_buf_size)
av_freep(&p_schro_params->enc_buf);
/* Free the video format structure. */
av_freep(&p_schro_params->format);
return 0;
}
AVCodec libschroedinger_encoder = {
"libschroedinger",
AVMEDIA_TYPE_VIDEO,
CODEC_ID_DIRAC,
sizeof(FfmpegSchroEncoderParams),
libschroedinger_encode_init,
libschroedinger_encode_frame,
libschroedinger_encode_close,
.capabilities = CODEC_CAP_DELAY,
.pix_fmts = (const enum PixelFormat[]){PIX_FMT_YUV420P, PIX_FMT_YUV422P, PIX_FMT_YUV444P, PIX_FMT_NONE},
.long_name = NULL_IF_CONFIG_SMALL("libschroedinger Dirac 2.2"),
};
| {
"pile_set_name": "Github"
} |
/*
* Copyright © 2017 camunda services GmbH ([email protected])
*
* 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.
*/
package io.zeebe.model.bpmn;
/**
* The BPMN tItemKind simple type
*
* @author Sebastian Menski
*/
public enum ItemKind {
Information,
Physical
}
| {
"pile_set_name": "Github"
} |
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1">
<title>Example</title>
<script src="../../dist/modular/js/core.js" type="text/javascript"></script>
<link href="../../dist/modular/css/core.css" rel="stylesheet" type="text/css">
<link href="../../dist/modular/css/datepicker.css" rel="stylesheet" type="text/css">
<script src="../../dist/modular/js/datepicker.js"></script>
</head>
<body style="padding: 8px;">
<input id="datepicker" width="312" />
<script>
new GijgoDatePicker(document.getElementById('datepicker'), ({
modal: true,
close: function (e) {
alert('Close is fired.');
}
});
</script>
</body>
</html> | {
"pile_set_name": "Github"
} |
/**
* @name Mostly duplicate method
* @description There is another method that shares a lot of the code with this method. Extract the code to a common superclass or delegate to improve sharing.
* @kind problem
* @problem.severity recommendation
* @precision high
* @id cs/similar-method
* @tags testability
* maintainability
* useless-code
* statistical
* non-attributable
*/
import csharp
import CodeDuplication
from Method m, int covered, int total, Method other, int percent
where
duplicateStatements(m, other, covered, total) and
covered != total and
m.getNumberOfLinesOfCode() > 5 and
covered * 100 / total = percent and
percent > 80 and
not duplicateMethod(m, other) and
not classLevelDuplication(m.getDeclaringType(), other.getDeclaringType()) and
not fileLevelDuplication(m.getFile(), other.getFile())
select m, percent + "% of the statements in " + m.getName() + " are duplicated in $@.", other,
other.getDeclaringType().getName() + "." + other.getName()
| {
"pile_set_name": "Github"
} |
/*****************************************************************************
* *
* File: cxgb2.c *
* $Revision: 1.25 $ *
* $Date: 2005/06/22 00:43:25 $ *
* Description: *
* Chelsio 10Gb Ethernet Driver. *
* *
* This program is free software; you can redistribute it and/or modify *
* it under the terms of the GNU General Public License, version 2, as *
* published by the Free Software Foundation. *
* *
* You should have received a copy of the GNU General Public License along *
* with this program; if not, see <http://www.gnu.org/licenses/>. *
* *
* THIS SOFTWARE IS PROVIDED ``AS IS'' AND WITHOUT ANY EXPRESS OR IMPLIED *
* WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED WARRANTIES OF *
* MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. *
* *
* http://www.chelsio.com *
* *
* Copyright (c) 2003 - 2005 Chelsio Communications, Inc. *
* All rights reserved. *
* *
* Maintainers: [email protected] *
* *
* Authors: Dimitrios Michailidis <[email protected]> *
* Tina Yang <[email protected]> *
* Felix Marti <[email protected]> *
* Scott Bardone <[email protected]> *
* Kurt Ottaway <[email protected]> *
* Frank DiMambro <[email protected]> *
* *
* History: *
* *
****************************************************************************/
#include "common.h"
#include <linux/module.h>
#include <linux/pci.h>
#include <linux/netdevice.h>
#include <linux/etherdevice.h>
#include <linux/if_vlan.h>
#include <linux/mii.h>
#include <linux/sockios.h>
#include <linux/dma-mapping.h>
#include <linux/uaccess.h>
#include "cpl5_cmd.h"
#include "regs.h"
#include "gmac.h"
#include "cphy.h"
#include "sge.h"
#include "tp.h"
#include "espi.h"
#include "elmer0.h"
#include <linux/workqueue.h>
static inline void schedule_mac_stats_update(struct adapter *ap, int secs)
{
schedule_delayed_work(&ap->stats_update_task, secs * HZ);
}
static inline void cancel_mac_stats_update(struct adapter *ap)
{
cancel_delayed_work(&ap->stats_update_task);
}
#define MAX_CMDQ_ENTRIES 16384
#define MAX_CMDQ1_ENTRIES 1024
#define MAX_RX_BUFFERS 16384
#define MAX_RX_JUMBO_BUFFERS 16384
#define MAX_TX_BUFFERS_HIGH 16384U
#define MAX_TX_BUFFERS_LOW 1536U
#define MAX_TX_BUFFERS 1460U
#define MIN_FL_ENTRIES 32
#define DFLT_MSG_ENABLE (NETIF_MSG_DRV | NETIF_MSG_PROBE | NETIF_MSG_LINK | \
NETIF_MSG_TIMER | NETIF_MSG_IFDOWN | NETIF_MSG_IFUP |\
NETIF_MSG_RX_ERR | NETIF_MSG_TX_ERR)
/*
* The EEPROM is actually bigger but only the first few bytes are used so we
* only report those.
*/
#define EEPROM_SIZE 32
MODULE_DESCRIPTION(DRV_DESCRIPTION);
MODULE_AUTHOR("Chelsio Communications");
MODULE_LICENSE("GPL");
static int dflt_msg_enable = DFLT_MSG_ENABLE;
module_param(dflt_msg_enable, int, 0);
MODULE_PARM_DESC(dflt_msg_enable, "Chelsio T1 default message enable bitmap");
#define HCLOCK 0x0
#define LCLOCK 0x1
/* T1 cards powersave mode */
static int t1_clock(struct adapter *adapter, int mode);
static int t1powersave = 1; /* HW default is powersave mode. */
module_param(t1powersave, int, 0);
MODULE_PARM_DESC(t1powersave, "Enable/Disable T1 powersaving mode");
static int disable_msi = 0;
module_param(disable_msi, int, 0);
MODULE_PARM_DESC(disable_msi, "Disable Message Signaled Interrupt (MSI)");
static const char pci_speed[][4] = {
"33", "66", "100", "133"
};
/*
* Setup MAC to receive the types of packets we want.
*/
static void t1_set_rxmode(struct net_device *dev)
{
struct adapter *adapter = dev->ml_priv;
struct cmac *mac = adapter->port[dev->if_port].mac;
struct t1_rx_mode rm;
rm.dev = dev;
mac->ops->set_rx_mode(mac, &rm);
}
static void link_report(struct port_info *p)
{
if (!netif_carrier_ok(p->dev))
netdev_info(p->dev, "link down\n");
else {
const char *s = "10Mbps";
switch (p->link_config.speed) {
case SPEED_10000: s = "10Gbps"; break;
case SPEED_1000: s = "1000Mbps"; break;
case SPEED_100: s = "100Mbps"; break;
}
netdev_info(p->dev, "link up, %s, %s-duplex\n",
s, p->link_config.duplex == DUPLEX_FULL
? "full" : "half");
}
}
void t1_link_negotiated(struct adapter *adapter, int port_id, int link_stat,
int speed, int duplex, int pause)
{
struct port_info *p = &adapter->port[port_id];
if (link_stat != netif_carrier_ok(p->dev)) {
if (link_stat)
netif_carrier_on(p->dev);
else
netif_carrier_off(p->dev);
link_report(p);
/* multi-ports: inform toe */
if ((speed > 0) && (adapter->params.nports > 1)) {
unsigned int sched_speed = 10;
switch (speed) {
case SPEED_1000:
sched_speed = 1000;
break;
case SPEED_100:
sched_speed = 100;
break;
case SPEED_10:
sched_speed = 10;
break;
}
t1_sched_update_parms(adapter->sge, port_id, 0, sched_speed);
}
}
}
static void link_start(struct port_info *p)
{
struct cmac *mac = p->mac;
mac->ops->reset(mac);
if (mac->ops->macaddress_set)
mac->ops->macaddress_set(mac, p->dev->dev_addr);
t1_set_rxmode(p->dev);
t1_link_start(p->phy, mac, &p->link_config);
mac->ops->enable(mac, MAC_DIRECTION_RX | MAC_DIRECTION_TX);
}
static void enable_hw_csum(struct adapter *adapter)
{
if (adapter->port[0].dev->hw_features & NETIF_F_TSO)
t1_tp_set_ip_checksum_offload(adapter->tp, 1); /* for TSO only */
t1_tp_set_tcp_checksum_offload(adapter->tp, 1);
}
/*
* Things to do upon first use of a card.
* This must run with the rtnl lock held.
*/
static int cxgb_up(struct adapter *adapter)
{
int err = 0;
if (!(adapter->flags & FULL_INIT_DONE)) {
err = t1_init_hw_modules(adapter);
if (err)
goto out_err;
enable_hw_csum(adapter);
adapter->flags |= FULL_INIT_DONE;
}
t1_interrupts_clear(adapter);
adapter->params.has_msi = !disable_msi && !pci_enable_msi(adapter->pdev);
err = request_irq(adapter->pdev->irq, t1_interrupt,
adapter->params.has_msi ? 0 : IRQF_SHARED,
adapter->name, adapter);
if (err) {
if (adapter->params.has_msi)
pci_disable_msi(adapter->pdev);
goto out_err;
}
t1_sge_start(adapter->sge);
t1_interrupts_enable(adapter);
out_err:
return err;
}
/*
* Release resources when all the ports have been stopped.
*/
static void cxgb_down(struct adapter *adapter)
{
t1_sge_stop(adapter->sge);
t1_interrupts_disable(adapter);
free_irq(adapter->pdev->irq, adapter);
if (adapter->params.has_msi)
pci_disable_msi(adapter->pdev);
}
static int cxgb_open(struct net_device *dev)
{
int err;
struct adapter *adapter = dev->ml_priv;
int other_ports = adapter->open_device_map & PORT_MASK;
napi_enable(&adapter->napi);
if (!adapter->open_device_map && (err = cxgb_up(adapter)) < 0) {
napi_disable(&adapter->napi);
return err;
}
__set_bit(dev->if_port, &adapter->open_device_map);
link_start(&adapter->port[dev->if_port]);
netif_start_queue(dev);
if (!other_ports && adapter->params.stats_update_period)
schedule_mac_stats_update(adapter,
adapter->params.stats_update_period);
t1_vlan_mode(adapter, dev->features);
return 0;
}
static int cxgb_close(struct net_device *dev)
{
struct adapter *adapter = dev->ml_priv;
struct port_info *p = &adapter->port[dev->if_port];
struct cmac *mac = p->mac;
netif_stop_queue(dev);
napi_disable(&adapter->napi);
mac->ops->disable(mac, MAC_DIRECTION_TX | MAC_DIRECTION_RX);
netif_carrier_off(dev);
clear_bit(dev->if_port, &adapter->open_device_map);
if (adapter->params.stats_update_period &&
!(adapter->open_device_map & PORT_MASK)) {
/* Stop statistics accumulation. */
smp_mb__after_atomic();
spin_lock(&adapter->work_lock); /* sync with update task */
spin_unlock(&adapter->work_lock);
cancel_mac_stats_update(adapter);
}
if (!adapter->open_device_map)
cxgb_down(adapter);
return 0;
}
static struct net_device_stats *t1_get_stats(struct net_device *dev)
{
struct adapter *adapter = dev->ml_priv;
struct port_info *p = &adapter->port[dev->if_port];
struct net_device_stats *ns = &dev->stats;
const struct cmac_statistics *pstats;
/* Do a full update of the MAC stats */
pstats = p->mac->ops->statistics_update(p->mac,
MAC_STATS_UPDATE_FULL);
ns->tx_packets = pstats->TxUnicastFramesOK +
pstats->TxMulticastFramesOK + pstats->TxBroadcastFramesOK;
ns->rx_packets = pstats->RxUnicastFramesOK +
pstats->RxMulticastFramesOK + pstats->RxBroadcastFramesOK;
ns->tx_bytes = pstats->TxOctetsOK;
ns->rx_bytes = pstats->RxOctetsOK;
ns->tx_errors = pstats->TxLateCollisions + pstats->TxLengthErrors +
pstats->TxUnderrun + pstats->TxFramesAbortedDueToXSCollisions;
ns->rx_errors = pstats->RxDataErrors + pstats->RxJabberErrors +
pstats->RxFCSErrors + pstats->RxAlignErrors +
pstats->RxSequenceErrors + pstats->RxFrameTooLongErrors +
pstats->RxSymbolErrors + pstats->RxRuntErrors;
ns->multicast = pstats->RxMulticastFramesOK;
ns->collisions = pstats->TxTotalCollisions;
/* detailed rx_errors */
ns->rx_length_errors = pstats->RxFrameTooLongErrors +
pstats->RxJabberErrors;
ns->rx_over_errors = 0;
ns->rx_crc_errors = pstats->RxFCSErrors;
ns->rx_frame_errors = pstats->RxAlignErrors;
ns->rx_fifo_errors = 0;
ns->rx_missed_errors = 0;
/* detailed tx_errors */
ns->tx_aborted_errors = pstats->TxFramesAbortedDueToXSCollisions;
ns->tx_carrier_errors = 0;
ns->tx_fifo_errors = pstats->TxUnderrun;
ns->tx_heartbeat_errors = 0;
ns->tx_window_errors = pstats->TxLateCollisions;
return ns;
}
static u32 get_msglevel(struct net_device *dev)
{
struct adapter *adapter = dev->ml_priv;
return adapter->msg_enable;
}
static void set_msglevel(struct net_device *dev, u32 val)
{
struct adapter *adapter = dev->ml_priv;
adapter->msg_enable = val;
}
static const char stats_strings[][ETH_GSTRING_LEN] = {
"TxOctetsOK",
"TxOctetsBad",
"TxUnicastFramesOK",
"TxMulticastFramesOK",
"TxBroadcastFramesOK",
"TxPauseFrames",
"TxFramesWithDeferredXmissions",
"TxLateCollisions",
"TxTotalCollisions",
"TxFramesAbortedDueToXSCollisions",
"TxUnderrun",
"TxLengthErrors",
"TxInternalMACXmitError",
"TxFramesWithExcessiveDeferral",
"TxFCSErrors",
"TxJumboFramesOk",
"TxJumboOctetsOk",
"RxOctetsOK",
"RxOctetsBad",
"RxUnicastFramesOK",
"RxMulticastFramesOK",
"RxBroadcastFramesOK",
"RxPauseFrames",
"RxFCSErrors",
"RxAlignErrors",
"RxSymbolErrors",
"RxDataErrors",
"RxSequenceErrors",
"RxRuntErrors",
"RxJabberErrors",
"RxInternalMACRcvError",
"RxInRangeLengthErrors",
"RxOutOfRangeLengthField",
"RxFrameTooLongErrors",
"RxJumboFramesOk",
"RxJumboOctetsOk",
/* Port stats */
"RxCsumGood",
"TxCsumOffload",
"TxTso",
"RxVlan",
"TxVlan",
"TxNeedHeadroom",
/* Interrupt stats */
"rx drops",
"pure_rsps",
"unhandled irqs",
"respQ_empty",
"respQ_overflow",
"freelistQ_empty",
"pkt_too_big",
"pkt_mismatch",
"cmdQ_full0",
"cmdQ_full1",
"espi_DIP2ParityErr",
"espi_DIP4Err",
"espi_RxDrops",
"espi_TxDrops",
"espi_RxOvfl",
"espi_ParityErr"
};
#define T2_REGMAP_SIZE (3 * 1024)
static int get_regs_len(struct net_device *dev)
{
return T2_REGMAP_SIZE;
}
static void get_drvinfo(struct net_device *dev, struct ethtool_drvinfo *info)
{
struct adapter *adapter = dev->ml_priv;
strlcpy(info->driver, DRV_NAME, sizeof(info->driver));
strlcpy(info->version, DRV_VERSION, sizeof(info->version));
strlcpy(info->bus_info, pci_name(adapter->pdev),
sizeof(info->bus_info));
}
static int get_sset_count(struct net_device *dev, int sset)
{
switch (sset) {
case ETH_SS_STATS:
return ARRAY_SIZE(stats_strings);
default:
return -EOPNOTSUPP;
}
}
static void get_strings(struct net_device *dev, u32 stringset, u8 *data)
{
if (stringset == ETH_SS_STATS)
memcpy(data, stats_strings, sizeof(stats_strings));
}
static void get_stats(struct net_device *dev, struct ethtool_stats *stats,
u64 *data)
{
struct adapter *adapter = dev->ml_priv;
struct cmac *mac = adapter->port[dev->if_port].mac;
const struct cmac_statistics *s;
const struct sge_intr_counts *t;
struct sge_port_stats ss;
s = mac->ops->statistics_update(mac, MAC_STATS_UPDATE_FULL);
t = t1_sge_get_intr_counts(adapter->sge);
t1_sge_get_port_stats(adapter->sge, dev->if_port, &ss);
*data++ = s->TxOctetsOK;
*data++ = s->TxOctetsBad;
*data++ = s->TxUnicastFramesOK;
*data++ = s->TxMulticastFramesOK;
*data++ = s->TxBroadcastFramesOK;
*data++ = s->TxPauseFrames;
*data++ = s->TxFramesWithDeferredXmissions;
*data++ = s->TxLateCollisions;
*data++ = s->TxTotalCollisions;
*data++ = s->TxFramesAbortedDueToXSCollisions;
*data++ = s->TxUnderrun;
*data++ = s->TxLengthErrors;
*data++ = s->TxInternalMACXmitError;
*data++ = s->TxFramesWithExcessiveDeferral;
*data++ = s->TxFCSErrors;
*data++ = s->TxJumboFramesOK;
*data++ = s->TxJumboOctetsOK;
*data++ = s->RxOctetsOK;
*data++ = s->RxOctetsBad;
*data++ = s->RxUnicastFramesOK;
*data++ = s->RxMulticastFramesOK;
*data++ = s->RxBroadcastFramesOK;
*data++ = s->RxPauseFrames;
*data++ = s->RxFCSErrors;
*data++ = s->RxAlignErrors;
*data++ = s->RxSymbolErrors;
*data++ = s->RxDataErrors;
*data++ = s->RxSequenceErrors;
*data++ = s->RxRuntErrors;
*data++ = s->RxJabberErrors;
*data++ = s->RxInternalMACRcvError;
*data++ = s->RxInRangeLengthErrors;
*data++ = s->RxOutOfRangeLengthField;
*data++ = s->RxFrameTooLongErrors;
*data++ = s->RxJumboFramesOK;
*data++ = s->RxJumboOctetsOK;
*data++ = ss.rx_cso_good;
*data++ = ss.tx_cso;
*data++ = ss.tx_tso;
*data++ = ss.vlan_xtract;
*data++ = ss.vlan_insert;
*data++ = ss.tx_need_hdrroom;
*data++ = t->rx_drops;
*data++ = t->pure_rsps;
*data++ = t->unhandled_irqs;
*data++ = t->respQ_empty;
*data++ = t->respQ_overflow;
*data++ = t->freelistQ_empty;
*data++ = t->pkt_too_big;
*data++ = t->pkt_mismatch;
*data++ = t->cmdQ_full[0];
*data++ = t->cmdQ_full[1];
if (adapter->espi) {
const struct espi_intr_counts *e;
e = t1_espi_get_intr_counts(adapter->espi);
*data++ = e->DIP2_parity_err;
*data++ = e->DIP4_err;
*data++ = e->rx_drops;
*data++ = e->tx_drops;
*data++ = e->rx_ovflw;
*data++ = e->parity_err;
}
}
static inline void reg_block_dump(struct adapter *ap, void *buf,
unsigned int start, unsigned int end)
{
u32 *p = buf + start;
for ( ; start <= end; start += sizeof(u32))
*p++ = readl(ap->regs + start);
}
static void get_regs(struct net_device *dev, struct ethtool_regs *regs,
void *buf)
{
struct adapter *ap = dev->ml_priv;
/*
* Version scheme: bits 0..9: chip version, bits 10..15: chip revision
*/
regs->version = 2;
memset(buf, 0, T2_REGMAP_SIZE);
reg_block_dump(ap, buf, 0, A_SG_RESPACCUTIMER);
reg_block_dump(ap, buf, A_MC3_CFG, A_MC4_INT_CAUSE);
reg_block_dump(ap, buf, A_TPI_ADDR, A_TPI_PAR);
reg_block_dump(ap, buf, A_TP_IN_CONFIG, A_TP_TX_DROP_COUNT);
reg_block_dump(ap, buf, A_RAT_ROUTE_CONTROL, A_RAT_INTR_CAUSE);
reg_block_dump(ap, buf, A_CSPI_RX_AE_WM, A_CSPI_INTR_ENABLE);
reg_block_dump(ap, buf, A_ESPI_SCH_TOKEN0, A_ESPI_GOSTAT);
reg_block_dump(ap, buf, A_ULP_ULIMIT, A_ULP_PIO_CTRL);
reg_block_dump(ap, buf, A_PL_ENABLE, A_PL_CAUSE);
reg_block_dump(ap, buf, A_MC5_CONFIG, A_MC5_MASK_WRITE_CMD);
}
static int get_link_ksettings(struct net_device *dev,
struct ethtool_link_ksettings *cmd)
{
struct adapter *adapter = dev->ml_priv;
struct port_info *p = &adapter->port[dev->if_port];
u32 supported, advertising;
supported = p->link_config.supported;
advertising = p->link_config.advertising;
if (netif_carrier_ok(dev)) {
cmd->base.speed = p->link_config.speed;
cmd->base.duplex = p->link_config.duplex;
} else {
cmd->base.speed = SPEED_UNKNOWN;
cmd->base.duplex = DUPLEX_UNKNOWN;
}
cmd->base.port = (supported & SUPPORTED_TP) ? PORT_TP : PORT_FIBRE;
cmd->base.phy_address = p->phy->mdio.prtad;
cmd->base.autoneg = p->link_config.autoneg;
ethtool_convert_legacy_u32_to_link_mode(cmd->link_modes.supported,
supported);
ethtool_convert_legacy_u32_to_link_mode(cmd->link_modes.advertising,
advertising);
return 0;
}
static int speed_duplex_to_caps(int speed, int duplex)
{
int cap = 0;
switch (speed) {
case SPEED_10:
if (duplex == DUPLEX_FULL)
cap = SUPPORTED_10baseT_Full;
else
cap = SUPPORTED_10baseT_Half;
break;
case SPEED_100:
if (duplex == DUPLEX_FULL)
cap = SUPPORTED_100baseT_Full;
else
cap = SUPPORTED_100baseT_Half;
break;
case SPEED_1000:
if (duplex == DUPLEX_FULL)
cap = SUPPORTED_1000baseT_Full;
else
cap = SUPPORTED_1000baseT_Half;
break;
case SPEED_10000:
if (duplex == DUPLEX_FULL)
cap = SUPPORTED_10000baseT_Full;
}
return cap;
}
#define ADVERTISED_MASK (ADVERTISED_10baseT_Half | ADVERTISED_10baseT_Full | \
ADVERTISED_100baseT_Half | ADVERTISED_100baseT_Full | \
ADVERTISED_1000baseT_Half | ADVERTISED_1000baseT_Full | \
ADVERTISED_10000baseT_Full)
static int set_link_ksettings(struct net_device *dev,
const struct ethtool_link_ksettings *cmd)
{
struct adapter *adapter = dev->ml_priv;
struct port_info *p = &adapter->port[dev->if_port];
struct link_config *lc = &p->link_config;
u32 advertising;
ethtool_convert_link_mode_to_legacy_u32(&advertising,
cmd->link_modes.advertising);
if (!(lc->supported & SUPPORTED_Autoneg))
return -EOPNOTSUPP; /* can't change speed/duplex */
if (cmd->base.autoneg == AUTONEG_DISABLE) {
u32 speed = cmd->base.speed;
int cap = speed_duplex_to_caps(speed, cmd->base.duplex);
if (!(lc->supported & cap) || (speed == SPEED_1000))
return -EINVAL;
lc->requested_speed = speed;
lc->requested_duplex = cmd->base.duplex;
lc->advertising = 0;
} else {
advertising &= ADVERTISED_MASK;
if (advertising & (advertising - 1))
advertising = lc->supported;
advertising &= lc->supported;
if (!advertising)
return -EINVAL;
lc->requested_speed = SPEED_INVALID;
lc->requested_duplex = DUPLEX_INVALID;
lc->advertising = advertising | ADVERTISED_Autoneg;
}
lc->autoneg = cmd->base.autoneg;
if (netif_running(dev))
t1_link_start(p->phy, p->mac, lc);
return 0;
}
static void get_pauseparam(struct net_device *dev,
struct ethtool_pauseparam *epause)
{
struct adapter *adapter = dev->ml_priv;
struct port_info *p = &adapter->port[dev->if_port];
epause->autoneg = (p->link_config.requested_fc & PAUSE_AUTONEG) != 0;
epause->rx_pause = (p->link_config.fc & PAUSE_RX) != 0;
epause->tx_pause = (p->link_config.fc & PAUSE_TX) != 0;
}
static int set_pauseparam(struct net_device *dev,
struct ethtool_pauseparam *epause)
{
struct adapter *adapter = dev->ml_priv;
struct port_info *p = &adapter->port[dev->if_port];
struct link_config *lc = &p->link_config;
if (epause->autoneg == AUTONEG_DISABLE)
lc->requested_fc = 0;
else if (lc->supported & SUPPORTED_Autoneg)
lc->requested_fc = PAUSE_AUTONEG;
else
return -EINVAL;
if (epause->rx_pause)
lc->requested_fc |= PAUSE_RX;
if (epause->tx_pause)
lc->requested_fc |= PAUSE_TX;
if (lc->autoneg == AUTONEG_ENABLE) {
if (netif_running(dev))
t1_link_start(p->phy, p->mac, lc);
} else {
lc->fc = lc->requested_fc & (PAUSE_RX | PAUSE_TX);
if (netif_running(dev))
p->mac->ops->set_speed_duplex_fc(p->mac, -1, -1,
lc->fc);
}
return 0;
}
static void get_sge_param(struct net_device *dev, struct ethtool_ringparam *e)
{
struct adapter *adapter = dev->ml_priv;
int jumbo_fl = t1_is_T1B(adapter) ? 1 : 0;
e->rx_max_pending = MAX_RX_BUFFERS;
e->rx_jumbo_max_pending = MAX_RX_JUMBO_BUFFERS;
e->tx_max_pending = MAX_CMDQ_ENTRIES;
e->rx_pending = adapter->params.sge.freelQ_size[!jumbo_fl];
e->rx_jumbo_pending = adapter->params.sge.freelQ_size[jumbo_fl];
e->tx_pending = adapter->params.sge.cmdQ_size[0];
}
static int set_sge_param(struct net_device *dev, struct ethtool_ringparam *e)
{
struct adapter *adapter = dev->ml_priv;
int jumbo_fl = t1_is_T1B(adapter) ? 1 : 0;
if (e->rx_pending > MAX_RX_BUFFERS || e->rx_mini_pending ||
e->rx_jumbo_pending > MAX_RX_JUMBO_BUFFERS ||
e->tx_pending > MAX_CMDQ_ENTRIES ||
e->rx_pending < MIN_FL_ENTRIES ||
e->rx_jumbo_pending < MIN_FL_ENTRIES ||
e->tx_pending < (adapter->params.nports + 1) * (MAX_SKB_FRAGS + 1))
return -EINVAL;
if (adapter->flags & FULL_INIT_DONE)
return -EBUSY;
adapter->params.sge.freelQ_size[!jumbo_fl] = e->rx_pending;
adapter->params.sge.freelQ_size[jumbo_fl] = e->rx_jumbo_pending;
adapter->params.sge.cmdQ_size[0] = e->tx_pending;
adapter->params.sge.cmdQ_size[1] = e->tx_pending > MAX_CMDQ1_ENTRIES ?
MAX_CMDQ1_ENTRIES : e->tx_pending;
return 0;
}
static int set_coalesce(struct net_device *dev, struct ethtool_coalesce *c)
{
struct adapter *adapter = dev->ml_priv;
adapter->params.sge.rx_coalesce_usecs = c->rx_coalesce_usecs;
adapter->params.sge.coalesce_enable = c->use_adaptive_rx_coalesce;
adapter->params.sge.sample_interval_usecs = c->rate_sample_interval;
t1_sge_set_coalesce_params(adapter->sge, &adapter->params.sge);
return 0;
}
static int get_coalesce(struct net_device *dev, struct ethtool_coalesce *c)
{
struct adapter *adapter = dev->ml_priv;
c->rx_coalesce_usecs = adapter->params.sge.rx_coalesce_usecs;
c->rate_sample_interval = adapter->params.sge.sample_interval_usecs;
c->use_adaptive_rx_coalesce = adapter->params.sge.coalesce_enable;
return 0;
}
static int get_eeprom_len(struct net_device *dev)
{
struct adapter *adapter = dev->ml_priv;
return t1_is_asic(adapter) ? EEPROM_SIZE : 0;
}
#define EEPROM_MAGIC(ap) \
(PCI_VENDOR_ID_CHELSIO | ((ap)->params.chip_version << 16))
static int get_eeprom(struct net_device *dev, struct ethtool_eeprom *e,
u8 *data)
{
int i;
u8 buf[EEPROM_SIZE] __attribute__((aligned(4)));
struct adapter *adapter = dev->ml_priv;
e->magic = EEPROM_MAGIC(adapter);
for (i = e->offset & ~3; i < e->offset + e->len; i += sizeof(u32))
t1_seeprom_read(adapter, i, (__le32 *)&buf[i]);
memcpy(data, buf + e->offset, e->len);
return 0;
}
static const struct ethtool_ops t1_ethtool_ops = {
.get_drvinfo = get_drvinfo,
.get_msglevel = get_msglevel,
.set_msglevel = set_msglevel,
.get_ringparam = get_sge_param,
.set_ringparam = set_sge_param,
.get_coalesce = get_coalesce,
.set_coalesce = set_coalesce,
.get_eeprom_len = get_eeprom_len,
.get_eeprom = get_eeprom,
.get_pauseparam = get_pauseparam,
.set_pauseparam = set_pauseparam,
.get_link = ethtool_op_get_link,
.get_strings = get_strings,
.get_sset_count = get_sset_count,
.get_ethtool_stats = get_stats,
.get_regs_len = get_regs_len,
.get_regs = get_regs,
.get_link_ksettings = get_link_ksettings,
.set_link_ksettings = set_link_ksettings,
};
static int t1_ioctl(struct net_device *dev, struct ifreq *req, int cmd)
{
struct adapter *adapter = dev->ml_priv;
struct mdio_if_info *mdio = &adapter->port[dev->if_port].phy->mdio;
return mdio_mii_ioctl(mdio, if_mii(req), cmd);
}
static int t1_change_mtu(struct net_device *dev, int new_mtu)
{
int ret;
struct adapter *adapter = dev->ml_priv;
struct cmac *mac = adapter->port[dev->if_port].mac;
if (!mac->ops->set_mtu)
return -EOPNOTSUPP;
if ((ret = mac->ops->set_mtu(mac, new_mtu)))
return ret;
dev->mtu = new_mtu;
return 0;
}
static int t1_set_mac_addr(struct net_device *dev, void *p)
{
struct adapter *adapter = dev->ml_priv;
struct cmac *mac = adapter->port[dev->if_port].mac;
struct sockaddr *addr = p;
if (!mac->ops->macaddress_set)
return -EOPNOTSUPP;
memcpy(dev->dev_addr, addr->sa_data, dev->addr_len);
mac->ops->macaddress_set(mac, dev->dev_addr);
return 0;
}
static netdev_features_t t1_fix_features(struct net_device *dev,
netdev_features_t features)
{
/*
* Since there is no support for separate rx/tx vlan accel
* enable/disable make sure tx flag is always in same state as rx.
*/
if (features & NETIF_F_HW_VLAN_CTAG_RX)
features |= NETIF_F_HW_VLAN_CTAG_TX;
else
features &= ~NETIF_F_HW_VLAN_CTAG_TX;
return features;
}
static int t1_set_features(struct net_device *dev, netdev_features_t features)
{
netdev_features_t changed = dev->features ^ features;
struct adapter *adapter = dev->ml_priv;
if (changed & NETIF_F_HW_VLAN_CTAG_RX)
t1_vlan_mode(adapter, features);
return 0;
}
#ifdef CONFIG_NET_POLL_CONTROLLER
static void t1_netpoll(struct net_device *dev)
{
unsigned long flags;
struct adapter *adapter = dev->ml_priv;
local_irq_save(flags);
t1_interrupt(adapter->pdev->irq, adapter);
local_irq_restore(flags);
}
#endif
/*
* Periodic accumulation of MAC statistics. This is used only if the MAC
* does not have any other way to prevent stats counter overflow.
*/
static void mac_stats_task(struct work_struct *work)
{
int i;
struct adapter *adapter =
container_of(work, struct adapter, stats_update_task.work);
for_each_port(adapter, i) {
struct port_info *p = &adapter->port[i];
if (netif_running(p->dev))
p->mac->ops->statistics_update(p->mac,
MAC_STATS_UPDATE_FAST);
}
/* Schedule the next statistics update if any port is active. */
spin_lock(&adapter->work_lock);
if (adapter->open_device_map & PORT_MASK)
schedule_mac_stats_update(adapter,
adapter->params.stats_update_period);
spin_unlock(&adapter->work_lock);
}
/*
* Processes elmer0 external interrupts in process context.
*/
static void ext_intr_task(struct work_struct *work)
{
struct adapter *adapter =
container_of(work, struct adapter, ext_intr_handler_task);
t1_elmer0_ext_intr_handler(adapter);
/* Now reenable external interrupts */
spin_lock_irq(&adapter->async_lock);
adapter->slow_intr_mask |= F_PL_INTR_EXT;
writel(F_PL_INTR_EXT, adapter->regs + A_PL_CAUSE);
writel(adapter->slow_intr_mask | F_PL_INTR_SGE_DATA,
adapter->regs + A_PL_ENABLE);
spin_unlock_irq(&adapter->async_lock);
}
/*
* Interrupt-context handler for elmer0 external interrupts.
*/
void t1_elmer0_ext_intr(struct adapter *adapter)
{
/*
* Schedule a task to handle external interrupts as we require
* a process context. We disable EXT interrupts in the interim
* and let the task reenable them when it's done.
*/
adapter->slow_intr_mask &= ~F_PL_INTR_EXT;
writel(adapter->slow_intr_mask | F_PL_INTR_SGE_DATA,
adapter->regs + A_PL_ENABLE);
schedule_work(&adapter->ext_intr_handler_task);
}
void t1_fatal_err(struct adapter *adapter)
{
if (adapter->flags & FULL_INIT_DONE) {
t1_sge_stop(adapter->sge);
t1_interrupts_disable(adapter);
}
pr_alert("%s: encountered fatal error, operation suspended\n",
adapter->name);
}
static const struct net_device_ops cxgb_netdev_ops = {
.ndo_open = cxgb_open,
.ndo_stop = cxgb_close,
.ndo_start_xmit = t1_start_xmit,
.ndo_get_stats = t1_get_stats,
.ndo_validate_addr = eth_validate_addr,
.ndo_set_rx_mode = t1_set_rxmode,
.ndo_do_ioctl = t1_ioctl,
.ndo_change_mtu = t1_change_mtu,
.ndo_set_mac_address = t1_set_mac_addr,
.ndo_fix_features = t1_fix_features,
.ndo_set_features = t1_set_features,
#ifdef CONFIG_NET_POLL_CONTROLLER
.ndo_poll_controller = t1_netpoll,
#endif
};
static int init_one(struct pci_dev *pdev, const struct pci_device_id *ent)
{
int i, err, pci_using_dac = 0;
unsigned long mmio_start, mmio_len;
const struct board_info *bi;
struct adapter *adapter = NULL;
struct port_info *pi;
pr_info_once("%s - version %s\n", DRV_DESCRIPTION, DRV_VERSION);
err = pci_enable_device(pdev);
if (err)
return err;
if (!(pci_resource_flags(pdev, 0) & IORESOURCE_MEM)) {
pr_err("%s: cannot find PCI device memory base address\n",
pci_name(pdev));
err = -ENODEV;
goto out_disable_pdev;
}
if (!pci_set_dma_mask(pdev, DMA_BIT_MASK(64))) {
pci_using_dac = 1;
if (pci_set_consistent_dma_mask(pdev, DMA_BIT_MASK(64))) {
pr_err("%s: unable to obtain 64-bit DMA for "
"consistent allocations\n", pci_name(pdev));
err = -ENODEV;
goto out_disable_pdev;
}
} else if ((err = pci_set_dma_mask(pdev, DMA_BIT_MASK(32))) != 0) {
pr_err("%s: no usable DMA configuration\n", pci_name(pdev));
goto out_disable_pdev;
}
err = pci_request_regions(pdev, DRV_NAME);
if (err) {
pr_err("%s: cannot obtain PCI resources\n", pci_name(pdev));
goto out_disable_pdev;
}
pci_set_master(pdev);
mmio_start = pci_resource_start(pdev, 0);
mmio_len = pci_resource_len(pdev, 0);
bi = t1_get_board_info(ent->driver_data);
for (i = 0; i < bi->port_number; ++i) {
struct net_device *netdev;
netdev = alloc_etherdev(adapter ? 0 : sizeof(*adapter));
if (!netdev) {
err = -ENOMEM;
goto out_free_dev;
}
SET_NETDEV_DEV(netdev, &pdev->dev);
if (!adapter) {
adapter = netdev_priv(netdev);
adapter->pdev = pdev;
adapter->port[0].dev = netdev; /* so we don't leak it */
adapter->regs = ioremap(mmio_start, mmio_len);
if (!adapter->regs) {
pr_err("%s: cannot map device registers\n",
pci_name(pdev));
err = -ENOMEM;
goto out_free_dev;
}
if (t1_get_board_rev(adapter, bi, &adapter->params)) {
err = -ENODEV; /* Can't handle this chip rev */
goto out_free_dev;
}
adapter->name = pci_name(pdev);
adapter->msg_enable = dflt_msg_enable;
adapter->mmio_len = mmio_len;
spin_lock_init(&adapter->tpi_lock);
spin_lock_init(&adapter->work_lock);
spin_lock_init(&adapter->async_lock);
spin_lock_init(&adapter->mac_lock);
INIT_WORK(&adapter->ext_intr_handler_task,
ext_intr_task);
INIT_DELAYED_WORK(&adapter->stats_update_task,
mac_stats_task);
pci_set_drvdata(pdev, netdev);
}
pi = &adapter->port[i];
pi->dev = netdev;
netif_carrier_off(netdev);
netdev->irq = pdev->irq;
netdev->if_port = i;
netdev->mem_start = mmio_start;
netdev->mem_end = mmio_start + mmio_len - 1;
netdev->ml_priv = adapter;
netdev->hw_features |= NETIF_F_SG | NETIF_F_IP_CSUM |
NETIF_F_RXCSUM;
netdev->features |= NETIF_F_SG | NETIF_F_IP_CSUM |
NETIF_F_RXCSUM | NETIF_F_LLTX;
if (pci_using_dac)
netdev->features |= NETIF_F_HIGHDMA;
if (vlan_tso_capable(adapter)) {
netdev->features |=
NETIF_F_HW_VLAN_CTAG_TX |
NETIF_F_HW_VLAN_CTAG_RX;
netdev->hw_features |= NETIF_F_HW_VLAN_CTAG_RX;
/* T204: disable TSO */
if (!(is_T2(adapter)) || bi->port_number != 4) {
netdev->hw_features |= NETIF_F_TSO;
netdev->features |= NETIF_F_TSO;
}
}
netdev->netdev_ops = &cxgb_netdev_ops;
netdev->hard_header_len += (netdev->hw_features & NETIF_F_TSO) ?
sizeof(struct cpl_tx_pkt_lso) : sizeof(struct cpl_tx_pkt);
netif_napi_add(netdev, &adapter->napi, t1_poll, 64);
netdev->ethtool_ops = &t1_ethtool_ops;
switch (bi->board) {
case CHBT_BOARD_CHT110:
case CHBT_BOARD_N110:
case CHBT_BOARD_N210:
case CHBT_BOARD_CHT210:
netdev->max_mtu = PM3393_MAX_FRAME_SIZE -
(ETH_HLEN + ETH_FCS_LEN);
break;
case CHBT_BOARD_CHN204:
netdev->max_mtu = VSC7326_MAX_MTU;
break;
default:
netdev->max_mtu = ETH_DATA_LEN;
break;
}
}
if (t1_init_sw_modules(adapter, bi) < 0) {
err = -ENODEV;
goto out_free_dev;
}
/*
* The card is now ready to go. If any errors occur during device
* registration we do not fail the whole card but rather proceed only
* with the ports we manage to register successfully. However we must
* register at least one net device.
*/
for (i = 0; i < bi->port_number; ++i) {
err = register_netdev(adapter->port[i].dev);
if (err)
pr_warn("%s: cannot register net device %s, skipping\n",
pci_name(pdev), adapter->port[i].dev->name);
else {
/*
* Change the name we use for messages to the name of
* the first successfully registered interface.
*/
if (!adapter->registered_device_map)
adapter->name = adapter->port[i].dev->name;
__set_bit(i, &adapter->registered_device_map);
}
}
if (!adapter->registered_device_map) {
pr_err("%s: could not register any net devices\n",
pci_name(pdev));
goto out_release_adapter_res;
}
pr_info("%s: %s (rev %d), %s %dMHz/%d-bit\n",
adapter->name, bi->desc, adapter->params.chip_revision,
adapter->params.pci.is_pcix ? "PCIX" : "PCI",
adapter->params.pci.speed, adapter->params.pci.width);
/*
* Set the T1B ASIC and memory clocks.
*/
if (t1powersave)
adapter->t1powersave = LCLOCK; /* HW default is powersave mode. */
else
adapter->t1powersave = HCLOCK;
if (t1_is_T1B(adapter))
t1_clock(adapter, t1powersave);
return 0;
out_release_adapter_res:
t1_free_sw_modules(adapter);
out_free_dev:
if (adapter) {
if (adapter->regs)
iounmap(adapter->regs);
for (i = bi->port_number - 1; i >= 0; --i)
if (adapter->port[i].dev)
free_netdev(adapter->port[i].dev);
}
pci_release_regions(pdev);
out_disable_pdev:
pci_disable_device(pdev);
return err;
}
static void bit_bang(struct adapter *adapter, int bitdata, int nbits)
{
int data;
int i;
u32 val;
enum {
S_CLOCK = 1 << 3,
S_DATA = 1 << 4
};
for (i = (nbits - 1); i > -1; i--) {
udelay(50);
data = ((bitdata >> i) & 0x1);
__t1_tpi_read(adapter, A_ELMER0_GPO, &val);
if (data)
val |= S_DATA;
else
val &= ~S_DATA;
udelay(50);
/* Set SCLOCK low */
val &= ~S_CLOCK;
__t1_tpi_write(adapter, A_ELMER0_GPO, val);
udelay(50);
/* Write SCLOCK high */
val |= S_CLOCK;
__t1_tpi_write(adapter, A_ELMER0_GPO, val);
}
}
static int t1_clock(struct adapter *adapter, int mode)
{
u32 val;
int M_CORE_VAL;
int M_MEM_VAL;
enum {
M_CORE_BITS = 9,
T_CORE_VAL = 0,
T_CORE_BITS = 2,
N_CORE_VAL = 0,
N_CORE_BITS = 2,
M_MEM_BITS = 9,
T_MEM_VAL = 0,
T_MEM_BITS = 2,
N_MEM_VAL = 0,
N_MEM_BITS = 2,
NP_LOAD = 1 << 17,
S_LOAD_MEM = 1 << 5,
S_LOAD_CORE = 1 << 6,
S_CLOCK = 1 << 3
};
if (!t1_is_T1B(adapter))
return -ENODEV; /* Can't re-clock this chip. */
if (mode & 2)
return 0; /* show current mode. */
if ((adapter->t1powersave & 1) == (mode & 1))
return -EALREADY; /* ASIC already running in mode. */
if ((mode & 1) == HCLOCK) {
M_CORE_VAL = 0x14;
M_MEM_VAL = 0x18;
adapter->t1powersave = HCLOCK; /* overclock */
} else {
M_CORE_VAL = 0xe;
M_MEM_VAL = 0x10;
adapter->t1powersave = LCLOCK; /* underclock */
}
/* Don't interrupt this serial stream! */
spin_lock(&adapter->tpi_lock);
/* Initialize for ASIC core */
__t1_tpi_read(adapter, A_ELMER0_GPO, &val);
val |= NP_LOAD;
udelay(50);
__t1_tpi_write(adapter, A_ELMER0_GPO, val);
udelay(50);
__t1_tpi_read(adapter, A_ELMER0_GPO, &val);
val &= ~S_LOAD_CORE;
val &= ~S_CLOCK;
__t1_tpi_write(adapter, A_ELMER0_GPO, val);
udelay(50);
/* Serial program the ASIC clock synthesizer */
bit_bang(adapter, T_CORE_VAL, T_CORE_BITS);
bit_bang(adapter, N_CORE_VAL, N_CORE_BITS);
bit_bang(adapter, M_CORE_VAL, M_CORE_BITS);
udelay(50);
/* Finish ASIC core */
__t1_tpi_read(adapter, A_ELMER0_GPO, &val);
val |= S_LOAD_CORE;
udelay(50);
__t1_tpi_write(adapter, A_ELMER0_GPO, val);
udelay(50);
__t1_tpi_read(adapter, A_ELMER0_GPO, &val);
val &= ~S_LOAD_CORE;
udelay(50);
__t1_tpi_write(adapter, A_ELMER0_GPO, val);
udelay(50);
/* Initialize for memory */
__t1_tpi_read(adapter, A_ELMER0_GPO, &val);
val |= NP_LOAD;
udelay(50);
__t1_tpi_write(adapter, A_ELMER0_GPO, val);
udelay(50);
__t1_tpi_read(adapter, A_ELMER0_GPO, &val);
val &= ~S_LOAD_MEM;
val &= ~S_CLOCK;
udelay(50);
__t1_tpi_write(adapter, A_ELMER0_GPO, val);
udelay(50);
/* Serial program the memory clock synthesizer */
bit_bang(adapter, T_MEM_VAL, T_MEM_BITS);
bit_bang(adapter, N_MEM_VAL, N_MEM_BITS);
bit_bang(adapter, M_MEM_VAL, M_MEM_BITS);
udelay(50);
/* Finish memory */
__t1_tpi_read(adapter, A_ELMER0_GPO, &val);
val |= S_LOAD_MEM;
udelay(50);
__t1_tpi_write(adapter, A_ELMER0_GPO, val);
udelay(50);
__t1_tpi_read(adapter, A_ELMER0_GPO, &val);
val &= ~S_LOAD_MEM;
udelay(50);
__t1_tpi_write(adapter, A_ELMER0_GPO, val);
spin_unlock(&adapter->tpi_lock);
return 0;
}
static inline void t1_sw_reset(struct pci_dev *pdev)
{
pci_write_config_dword(pdev, A_PCICFG_PM_CSR, 3);
pci_write_config_dword(pdev, A_PCICFG_PM_CSR, 0);
}
static void remove_one(struct pci_dev *pdev)
{
struct net_device *dev = pci_get_drvdata(pdev);
struct adapter *adapter = dev->ml_priv;
int i;
for_each_port(adapter, i) {
if (test_bit(i, &adapter->registered_device_map))
unregister_netdev(adapter->port[i].dev);
}
t1_free_sw_modules(adapter);
iounmap(adapter->regs);
while (--i >= 0) {
if (adapter->port[i].dev)
free_netdev(adapter->port[i].dev);
}
pci_release_regions(pdev);
pci_disable_device(pdev);
t1_sw_reset(pdev);
}
static struct pci_driver cxgb_pci_driver = {
.name = DRV_NAME,
.id_table = t1_pci_tbl,
.probe = init_one,
.remove = remove_one,
};
module_pci_driver(cxgb_pci_driver);
| {
"pile_set_name": "Github"
} |
#include "zfstream.h"
int main() {
// Construct a stream object with this filebuffer. Anything sent
// to this stream will go to standard out.
gzofstream os( 1, ios::out );
// This text is getting compressed and sent to stdout.
// To prove this, run 'test | zcat'.
os << "Hello, Mommy" << endl;
os << setcompressionlevel( Z_NO_COMPRESSION );
os << "hello, hello, hi, ho!" << endl;
setcompressionlevel( os, Z_DEFAULT_COMPRESSION )
<< "I'm compressing again" << endl;
os.close();
return 0;
}
| {
"pile_set_name": "Github"
} |
---
external help file: System.Management.Automation.dll-Help.xml
keywords: powershell,cmdlet
Locale: en-US
Module Name: Microsoft.PowerShell.Core
ms.date: 04/08/2020
online version: https://docs.microsoft.com/powershell/module/microsoft.powershell.core/new-module?view=powershell-7.1&WT.mc_id=ps-gethelp
schema: 2.0.0
title: New-Module
---
# New-Module
## SYNOPSIS
Creates a new dynamic module that exists only in memory.
## SYNTAX
### ScriptBlock (Default)
```
New-Module [-ScriptBlock] <ScriptBlock> [-Function <String[]>] [-Cmdlet <String[]>] [-ReturnResult]
[-AsCustomObject] [-ArgumentList <Object[]>] [<CommonParameters>]
```
### Name
```
New-Module [-Name] <String> [-ScriptBlock] <ScriptBlock> [-Function <String[]>] [-Cmdlet <String[]>]
[-ReturnResult] [-AsCustomObject] [-ArgumentList <Object[]>] [<CommonParameters>]
```
## DESCRIPTION
The `New-Module` cmdlet creates a dynamic module from a script block. The members of the dynamic
module, such as functions and variables, are immediately available in the session and remain
available until you close the session.
Like static modules, by default, the cmdlets and functions in a dynamic module are exported and the
variables and aliases are not. However, you can use the Export-ModuleMember cmdlet and the
parameters of `New-Module` to override the defaults.
You can also use the **AsCustomObject** parameter of `New-Module` to return the dynamic module as a
custom object. The members of the modules, such as functions, are implemented as script methods of
the custom object instead of being imported into the session.
Dynamic modules exist only in memory, not on disk. Like all modules, the members of dynamic modules
run in a private module scope that is a child of the global scope. Get-Module cannot get a dynamic
module, but Get-Command can get the exported members.
To make a dynamic module available to `Get-Module`, pipe a `New-Module` command to Import-Module, or
pipe the module object that `New-Module` returns to `Import-Module`. This action adds the dynamic
module to the `Get-Module` list, but it does not save the module to disk or make it persistent.
## EXAMPLES
### Example 1: Create a dynamic module
This example creates a new dynamic module with a function called `Hello`. The command returns a
module object that represents the new dynamic module.
```powershell
New-Module -ScriptBlock {function Hello {"Hello!"}}
```
```Output
Name : __DynamicModule_2ceb1d0a-990f-45e4-9fe4-89f0f6ead0e5
Path : 2ceb1d0a-990f-45e4-9fe4-89f0f6ead0e5
Description :
Guid : 00000000-0000-0000-0000-000000000000
Version : 0.0
ModuleBase :
ModuleType : Script
PrivateData :
AccessMode : ReadWrite
ExportedAliases : {}
ExportedCmdlets : {}
ExportedFunctions : {[Hello, Hello]}
ExportedVariables : {}
NestedModules : {}
```
### Example 2: Working with dynamic modules and Get-Module and Get-Command
This example demonstrates that dynamic modules are not returned by the `Get-Module` cmdlet. The
members that they export are returned by the `Get-Command` cmdlet.
```powershell
new-module -scriptblock {function Hello {"Hello!"}}
```
```Output
Name : __DynamicModule_2ceb1d0a-990f-45e4-9fe4-89f0f6ead0e5
Path : 2ceb1d0a-990f-45e4-9fe4-89f0f6ead0e5
Description :
Guid : 00000000-0000-0000-0000-000000000000
Version : 0.0
ModuleBase :
ModuleType : Script
PrivateData :
AccessMode : ReadWrite
ExportedAliases : {}
ExportedCmdlets : {}
ExportedFunctions : {[Hello, Hello]}
ExportedVariables : {}
NestedModules : {}
```
```powershell
Get-Module
Get-Command Hello
```
```Output
CommandType Name Definition
----------- ---- ----------
Function Hello "Hello!"
```
### Example 3: Export a variable into the current session
This example uses the `Export-ModuleMember` cmdlet to export a variable into the current session.
Without the `Export-ModuleMember` command, only the function is exported.
```powershell
New-Module -ScriptBlock {$SayHelloHelp="Type 'SayHello', a space, and a name."; function SayHello ($name) { "Hello, $name" }; Export-ModuleMember -function SayHello -Variable SayHelloHelp}
$SayHelloHelp
```
```Output
Type 'SayHello', a space, and a name.
```
```powershell
SayHello Jeffrey
```
```Output
Hello, Jeffrey
```
The output shows that both the variable and the function were exported into the session.
### Example 4: Make a dynamic module available to Get-Module
This example demonstrates that you can make a dynamic module available to `Get-Module` by piping the
dynamic module to `Import-Module`.
`New-Module` creates a module object that is piped to the `Import-Module` cmdlet. The **Name**
parameter of `New-Module` assigns a friendly name to the module. Because `Import-Module` does not
return any objects by default, there is no output from this command. `Get-Module` that the
**GreetingModule** has been imported into the current session.
```powershell
New-Module -ScriptBlock {function Hello {"Hello!"}} -name GreetingModule | Import-Module
Get-Module
```
```Output
Name : GreetingModule
Path : d54dfdac-4531-4db2-9dec-0b4b9c57a1e5
Description :
Guid : 00000000-0000-0000-0000-000000000000
Version : 0.0
ModuleBase :
ModuleType : Script
PrivateData :
AccessMode : ReadWrite
ExportedAliases : {}
ExportedCmdlets : {}
ExportedFunctions : {[Hello, Hello]}
ExportedVariables : {}
NestedModules : {}
```
```powershell
Get-Command hello
```
```Output
CommandType Name Definition
----------- ---- ----------
Function Hello "Hello!"
```
The `Get-Command` cmdlet shows the `Hello` function that the dynamic module exports.
### Example 5: Generate a custom object that has exported functions
This example shows how to use the **AsCustomObject** parameter of `New-Module` to generate a custom
object that has script methods that represent the exported functions.
The `New-Module` cmdlet creates a dynamic module with two functions, `Hello` and `Goodbye`. The
**AsCustomObject** parameter creates a custom object instead of the **PSModuleInfo** object that
`New-Module` generates by default. This custom object is saved in the `$m` variable.
The `$m` variable appears to have no assigned value.
```powershell
$m = New-Module -ScriptBlock {
function Hello ($name) {"Hello, $name"}
function Goodbye ($name) {"Goodbye, $name"}
} -AsCustomObject
$m
$m | Get-Member
```
```Output
TypeName: System.Management.Automation.PSCustomObject
Name MemberType Definition
---- ---------- ----------
Equals Method bool Equals(System.Object obj)
GetHashCode Method int GetHashCode()
GetType Method type GetType()
ToString Method string ToString()
Goodbye ScriptMethod System.Object Goodbye();
Hello ScriptMethod System.Object Hello();
```
```powershell
$m.goodbye("Jane")
```
```Output
Goodbye, Jane
```
```powershell
$m.hello("Manoj")
```
```Output
Hello, Manoj
```
Piping `$m` to the `Get-Member` cmdlet displays the properties and methods of the custom object. The
output shows that the object has script methods that represent the `Hello` and `Goodbye` functions.
Finally, we call these script methods and display the results.
### Example 6: Get the results of the script block
This example uses the **ReturnResult** parameter to request the results of running the script block
instead of requesting a module object. The script block in the new module defines the `SayHello`
function and then calls the function.
```powershell
New-Module -ScriptBlock {function SayHello {"Hello, World!"}; SayHello} -ReturnResult
```
```Output
Hello, World!
```
## PARAMETERS
### -ArgumentList
Specifies an array of arguments which are parameter values that are passed to the script block. For
more information about the behavior of **ArgumentList**, see [about_Splatting](about/about_Splatting.md#splatting-with-arrays).
```yaml
Type: System.Object[]
Parameter Sets: (All)
Aliases: Args
Required: False
Position: Named
Default value: None
Accept pipeline input: False
Accept wildcard characters: False
```
### -AsCustomObject
Indicates that this cmdlet returns a custom object that represents the dynamic module. The module
members are implemented as script methods of the custom object, but they are not imported into the
session. You can save the custom object in a variable and use dot notation to invoke the members.
If the module has multiple members with the same name, such as a function and a variable that are
both named A, only one member with each name can be accessed from the custom object.
```yaml
Type: System.Management.Automation.SwitchParameter
Parameter Sets: (All)
Aliases:
Required: False
Position: Named
Default value: None
Accept pipeline input: False
Accept wildcard characters: False
```
### -Cmdlet
Specifies an array of cmdlets that this cmdlet exports from the module into the current session.
Enter a comma-separated list of cmdlets. Wildcard characters are permitted. By default, all cmdlets
in the module are exported.
You cannot define cmdlets in a script block, but a dynamic module can include cmdlets if it imports
the cmdlets from a binary module.
```yaml
Type: System.String[]
Parameter Sets: (All)
Aliases:
Required: False
Position: Named
Default value: None
Accept pipeline input: False
Accept wildcard characters: False
```
### -Function
Specifies an array of functions that this cmdlet exports from the module into the current session.
Enter a comma-separated list of functions. Wildcard characters are permitted. By default, all
functions defined in a module are exported.
```yaml
Type: System.String[]
Parameter Sets: (All)
Aliases:
Required: False
Position: Named
Default value: None
Accept pipeline input: False
Accept wildcard characters: True
```
### -Name
Specifies a name for the new module. You can also pipe a module name to New-Module.
The default value is an autogenerated name that starts with `__DynamicModule_` and is followed by a
GUID that specifies the path of the dynamic module.
```yaml
Type: System.String
Parameter Sets: Name
Aliases:
Required: True
Position: 0
Default value: None
Accept pipeline input: True (ByValue)
Accept wildcard characters: False
```
### -ReturnResult
Indicates that this cmdlet runs the script block and returns the script block results instead of
returning a module object.
```yaml
Type: System.Management.Automation.SwitchParameter
Parameter Sets: (All)
Aliases:
Required: False
Position: Named
Default value: None
Accept pipeline input: False
Accept wildcard characters: False
```
### -ScriptBlock
Specifies the contents of the dynamic module. Enclose the contents in braces (`{}`) to create a
script block. This parameter is required.
```yaml
Type: System.Management.Automation.ScriptBlock
Parameter Sets: (All)
Aliases:
Required: True
Position: 1
Default value: None
Accept pipeline input: False
Accept wildcard characters: False
```
### CommonParameters
This cmdlet supports the common parameters: -Debug, -ErrorAction, -ErrorVariable,
-InformationAction, -InformationVariable, -OutVariable, -OutBuffer, -PipelineVariable, -Verbose,
-WarningAction, and -WarningVariable. For more information, see
[about_CommonParameters](https://go.microsoft.com/fwlink/?LinkID=113216).
## INPUTS
### System.String
You can pipe a module name to this cmdlet.
## OUTPUTS
### System.Management.Automation.PSModuleInfo, System.Management.Automation.PSCustomObject, or None
This cmdlet generates a **PSModuleInfo** object, by default. If you use the **AsCustomObject**
parameter, it generates a **PSCustomObject** object. If you use the **ReturnResult** parameter, it
returns the result of evaluating the script block in the dynamic module.
## NOTES
You can also refer to `New-Module` by its alias, `nmo`. For more information, see
[about_Aliases](About/about_Aliases.md).
## RELATED LINKS
[Export-ModuleMember](Export-ModuleMember.md)
[Get-Module](Get-Module.md)
[Import-Module](Import-Module.md)
[Remove-Module](Remove-Module.md)
| {
"pile_set_name": "Github"
} |
<?php
/**
* Magento
*
* NOTICE OF LICENSE
*
* This source file is subject to the Open Software License (OSL 3.0)
* that is bundled with this package in the file LICENSE.txt.
* It is also available through the world-wide-web at this URL:
* http://opensource.org/licenses/osl-3.0.php
* If you did not receive a copy of the license and are unable to
* obtain it through the world-wide-web, please send an email
* to [email protected] so we can send you a copy immediately.
*
* DISCLAIMER
*
* Do not edit or add to this file if you wish to upgrade Magento to newer
* versions in the future. If you wish to customize Magento for your
* needs please refer to http://www.magentocommerce.com for more information.
*
* @category Mage
* @package Mage_Widget
* @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com)
* @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
*/
/* @var $installer Mage_Core_Model_Resource_Setup */
$installer = $this;
$installer->startSetup();
/**
* Drop foreign keys
*/
$installer->getConnection()->dropForeignKey(
$installer->getTable('widget/widget_instance_page'),
'FK_WIDGET_WIDGET_INSTANCE_ID'
);
$installer->getConnection()->dropForeignKey(
$installer->getTable('widget/widget_instance_page_layout'),
'FK_WIDGET_WIDGET_INSTANCE_LAYOUT_UPDATE_ID'
);
$installer->getConnection()->dropForeignKey(
$installer->getTable('widget/widget_instance_page_layout'),
'FK_WIDGET_WIDGET_INSTANCE_PAGE_ID'
);
/**
* Drop indexes
*/
$installer->getConnection()->dropIndex(
$installer->getTable('widget/widget'),
'IDX_CODE'
);
$installer->getConnection()->dropIndex(
$installer->getTable('widget/widget_instance_page'),
'IDX_WIDGET_WIDGET_INSTANCE_ID'
);
$installer->getConnection()->dropIndex(
$installer->getTable('widget/widget_instance_page_layout'),
'PAGE_ID'
);
$installer->getConnection()->dropIndex(
$installer->getTable('widget/widget_instance_page_layout'),
'IDX_WIDGET_WIDGET_INSTANCE_PAGE_ID'
);
$installer->getConnection()->dropIndex(
$installer->getTable('widget/widget_instance_page_layout'),
'IDX_WIDGET_WIDGET_INSTANCE_LAYOUT_UPDATE_ID'
);
/**
* Change columns
*/
$tables = array(
$installer->getTable('widget/widget') => array(
'columns' => array(
'widget_id' => array(
'type' => Varien_Db_Ddl_Table::TYPE_INTEGER,
'identity' => true,
'unsigned' => true,
'nullable' => false,
'primary' => true,
'comment' => 'Widget Id'
),
'parameters' => array(
'type' => Varien_Db_Ddl_Table::TYPE_TEXT,
'length' => '64K',
'comment' => 'Parameters'
)
),
'comment' => 'Preconfigured Widgets'
),
$installer->getTable('widget/widget_instance') => array(
'columns' => array(
'instance_id' => array(
'type' => Varien_Db_Ddl_Table::TYPE_INTEGER,
'identity' => true,
'unsigned' => true,
'nullable' => false,
'primary' => true,
'comment' => 'Instance Id'
),
'package_theme' => array(
'type' => Varien_Db_Ddl_Table::TYPE_TEXT,
'length' => 255,
'comment' => 'Package Theme'
),
'title' => array(
'type' => Varien_Db_Ddl_Table::TYPE_TEXT,
'length' => 255,
'comment' => 'Widget Title'
),
'store_ids' => array(
'type' => Varien_Db_Ddl_Table::TYPE_TEXT,
'length' => 255,
'nullable' => false,
'default' => '0',
'comment' => 'Store ids'
),
'widget_parameters' => array(
'type' => Varien_Db_Ddl_Table::TYPE_TEXT,
'length' => '64K',
'comment' => 'Widget parameters'
),
'sort_order' => array(
'type' => Varien_Db_Ddl_Table::TYPE_SMALLINT,
'unsigned' => true,
'nullable' => false,
'default' => '0',
'comment' => 'Sort order'
)
),
'comment' => 'Instances of Widget for Package Theme'
),
$installer->getTable('widget/widget_instance_page') => array(
'columns' => array(
'page_id' => array(
'type' => Varien_Db_Ddl_Table::TYPE_INTEGER,
'identity' => true,
'unsigned' => true,
'nullable' => false,
'primary' => true,
'comment' => 'Page Id'
),
'instance_id' => array(
'type' => Varien_Db_Ddl_Table::TYPE_INTEGER,
'unsigned' => true,
'nullable' => false,
'default' => '0',
'comment' => 'Instance Id'
),
'layout_handle' => array(
'type' => Varien_Db_Ddl_Table::TYPE_TEXT,
'length' => 255,
'comment' => 'Layout Handle'
),
'block_reference' => array(
'type' => Varien_Db_Ddl_Table::TYPE_TEXT,
'length' => 255,
'comment' => 'Block Reference'
),
'entities' => array(
'type' => Varien_Db_Ddl_Table::TYPE_TEXT,
'length' => '64K',
'comment' => 'Catalog entities (comma separated)'
)
),
'comment' => 'Instance of Widget on Page'
),
$installer->getTable('widget/widget_instance_page_layout') => array(
'columns' => array(
'page_id' => array(
'type' => Varien_Db_Ddl_Table::TYPE_INTEGER,
'unsigned' => true,
'nullable' => false,
'primary' => true,
'default' => '0',
'comment' => 'Page Id'
),
'layout_update_id' => array(
'type' => Varien_Db_Ddl_Table::TYPE_INTEGER,
'unsigned' => true,
'nullable' => false,
'primary' => true,
'default' => '0',
'comment' => 'Layout Update Id'
)
),
'comment' => 'Layout updates'
)
);
$installer->getConnection()->modifyTables($tables);
$installer->getConnection()->changeColumn(
$installer->getTable('widget/widget'),
'code',
'widget_code',
array(
'type' => Varien_Db_Ddl_Table::TYPE_TEXT,
'length' => 255,
'comment' => 'Widget code for template directive'
)
);
$installer->getConnection()->changeColumn(
$installer->getTable('widget/widget'),
'type',
'widget_type',
array(
'type' => Varien_Db_Ddl_Table::TYPE_TEXT,
'length' => 255,
'comment' => 'Widget Type'
)
);
$installer->getConnection()->changeColumn(
$installer->getTable('widget/widget_instance'),
'type',
'instance_type',
array(
'type' => Varien_Db_Ddl_Table::TYPE_TEXT,
'length' => 255,
'comment' => 'Instance Type'
)
);
$installer->getConnection()->changeColumn(
$installer->getTable('widget/widget_instance_page'),
'group',
'page_group',
array(
'type' => Varien_Db_Ddl_Table::TYPE_TEXT,
'length' => 25,
'comment' => 'Block Group Type'
)
);
$installer->getConnection()->changeColumn(
$installer->getTable('widget/widget_instance_page'),
'for',
'page_for',
array(
'type' => Varien_Db_Ddl_Table::TYPE_TEXT,
'length' => 25,
'comment' => 'For instance entities'
)
);
$installer->getConnection()->changeColumn(
$installer->getTable('widget/widget_instance_page'),
'template',
'page_template',
array(
'type' => Varien_Db_Ddl_Table::TYPE_TEXT,
'length' => 255,
'comment' => 'Path to widget template'
)
);
/**
* Add indexes
*/
$installer->getConnection()->addIndex(
$installer->getTable('widget/widget'),
$installer->getIdxName('widget/widget', array('widget_code')),
array('widget_code')
);
$installer->getConnection()->addIndex(
$installer->getTable('widget/widget_instance_page'),
$installer->getIdxName('widget/widget_instance_page', array('instance_id')),
array('instance_id')
);
$installer->getConnection()->addIndex(
$installer->getTable('widget/widget_instance_page_layout'),
$installer->getIdxName(
'widget/widget_instance_page_layout',
array('layout_update_id', 'page_id'),
Varien_Db_Adapter_Interface::INDEX_TYPE_UNIQUE
),
array('layout_update_id', 'page_id'),
Varien_Db_Adapter_Interface::INDEX_TYPE_UNIQUE
);
$installer->getConnection()->addIndex(
$installer->getTable('widget/widget_instance_page_layout'),
$installer->getIdxName('widget/widget_instance_page_layout', array('page_id')),
array('page_id')
);
$installer->getConnection()->addIndex(
$installer->getTable('widget/widget_instance_page_layout'),
$installer->getIdxName('widget/widget_instance_page_layout', array('layout_update_id')),
array('layout_update_id')
);
/**
* Add foreign keys
*/
$installer->getConnection()->addForeignKey(
$installer->getFkName(
'widget/widget_instance_page',
'instance_id',
'widget/widget_instance',
'instance_id'
),
$installer->getTable('widget/widget_instance_page'),
'instance_id',
$installer->getTable('widget/widget_instance'),
'instance_id'
);
$installer->getConnection()->addForeignKey(
$installer->getFkName(
'widget/widget_instance_page_layout',
'page_id',
'widget/widget_instance_page',
'page_id'
),
$installer->getTable('widget/widget_instance_page_layout'),
'page_id',
$installer->getTable('widget/widget_instance_page'),
'page_id'
);
$installer->getConnection()->addForeignKey(
$installer->getFkName(
'widget/widget_instance_page_layout',
'layout_update_id',
'core/layout_update',
'layout_update_id'
),
$installer->getTable('widget/widget_instance_page_layout'),
'layout_update_id',
$installer->getTable('core/layout_update'),
'layout_update_id'
);
$installer->endSetup();
| {
"pile_set_name": "Github"
} |
/*
* acpi_bus.c - ACPI Bus Driver ($Revision: 80 $)
*
* Copyright (C) 2001, 2002 Paul Diefenbaugh <[email protected]>
*
* ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or (at
* your option) any later version.
*
* This program is distributed in the hope that it will be useful, but
* WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* General Public License for more details.
*
* You should have received a copy of the GNU General Public License along
* with this program; if not, write to the Free Software Foundation, Inc.,
* 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA.
*
* ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
*/
#include <linux/module.h>
#include <linux/init.h>
#include <linux/ioport.h>
#include <linux/kernel.h>
#include <linux/list.h>
#include <linux/sched.h>
#include <linux/pm.h>
#include <linux/device.h>
#include <linux/proc_fs.h>
#include <linux/acpi.h>
#include <linux/slab.h>
#include <linux/regulator/machine.h>
#ifdef CONFIG_X86
#include <asm/mpspec.h>
#endif
#include <linux/pci.h>
#include <acpi/apei.h>
#include <linux/dmi.h>
#include <linux/suspend.h>
#include "internal.h"
#define _COMPONENT ACPI_BUS_COMPONENT
ACPI_MODULE_NAME("bus");
struct acpi_device *acpi_root;
struct proc_dir_entry *acpi_root_dir;
EXPORT_SYMBOL(acpi_root_dir);
#ifdef CONFIG_X86
#ifdef CONFIG_ACPI_CUSTOM_DSDT
static inline int set_copy_dsdt(const struct dmi_system_id *id)
{
return 0;
}
#else
static int set_copy_dsdt(const struct dmi_system_id *id)
{
printk(KERN_NOTICE "%s detected - "
"force copy of DSDT to local memory\n", id->ident);
acpi_gbl_copy_dsdt_locally = 1;
return 0;
}
#endif
static struct dmi_system_id dsdt_dmi_table[] __initdata = {
/*
* Invoke DSDT corruption work-around on all Toshiba Satellite.
* https://bugzilla.kernel.org/show_bug.cgi?id=14679
*/
{
.callback = set_copy_dsdt,
.ident = "TOSHIBA Satellite",
.matches = {
DMI_MATCH(DMI_SYS_VENDOR, "TOSHIBA"),
DMI_MATCH(DMI_PRODUCT_NAME, "Satellite"),
},
},
{}
};
#else
static struct dmi_system_id dsdt_dmi_table[] __initdata = {
{}
};
#endif
/* --------------------------------------------------------------------------
Device Management
-------------------------------------------------------------------------- */
acpi_status acpi_bus_get_status_handle(acpi_handle handle,
unsigned long long *sta)
{
acpi_status status;
status = acpi_evaluate_integer(handle, "_STA", NULL, sta);
if (ACPI_SUCCESS(status))
return AE_OK;
if (status == AE_NOT_FOUND) {
*sta = ACPI_STA_DEVICE_PRESENT | ACPI_STA_DEVICE_ENABLED |
ACPI_STA_DEVICE_UI | ACPI_STA_DEVICE_FUNCTIONING;
return AE_OK;
}
return status;
}
int acpi_bus_get_status(struct acpi_device *device)
{
acpi_status status;
unsigned long long sta;
status = acpi_bus_get_status_handle(device->handle, &sta);
if (ACPI_FAILURE(status))
return -ENODEV;
acpi_set_device_status(device, sta);
if (device->status.functional && !device->status.present) {
ACPI_DEBUG_PRINT((ACPI_DB_INFO, "Device [%s] status [%08x]: "
"functional but not present;\n",
device->pnp.bus_id, (u32)sta));
}
ACPI_DEBUG_PRINT((ACPI_DB_INFO, "Device [%s] status [%08x]\n",
device->pnp.bus_id, (u32)sta));
return 0;
}
EXPORT_SYMBOL(acpi_bus_get_status);
void acpi_bus_private_data_handler(acpi_handle handle,
void *context)
{
return;
}
EXPORT_SYMBOL(acpi_bus_private_data_handler);
int acpi_bus_attach_private_data(acpi_handle handle, void *data)
{
acpi_status status;
status = acpi_attach_data(handle,
acpi_bus_private_data_handler, data);
if (ACPI_FAILURE(status)) {
acpi_handle_debug(handle, "Error attaching device data\n");
return -ENODEV;
}
return 0;
}
EXPORT_SYMBOL_GPL(acpi_bus_attach_private_data);
int acpi_bus_get_private_data(acpi_handle handle, void **data)
{
acpi_status status;
if (!*data)
return -EINVAL;
status = acpi_get_data(handle, acpi_bus_private_data_handler, data);
if (ACPI_FAILURE(status)) {
acpi_handle_debug(handle, "No context for object\n");
return -ENODEV;
}
return 0;
}
EXPORT_SYMBOL_GPL(acpi_bus_get_private_data);
void acpi_bus_detach_private_data(acpi_handle handle)
{
acpi_detach_data(handle, acpi_bus_private_data_handler);
}
EXPORT_SYMBOL_GPL(acpi_bus_detach_private_data);
static void acpi_print_osc_error(acpi_handle handle,
struct acpi_osc_context *context, char *error)
{
struct acpi_buffer buffer = {ACPI_ALLOCATE_BUFFER};
int i;
if (ACPI_FAILURE(acpi_get_name(handle, ACPI_FULL_PATHNAME, &buffer)))
printk(KERN_DEBUG "%s\n", error);
else {
printk(KERN_DEBUG "%s:%s\n", (char *)buffer.pointer, error);
kfree(buffer.pointer);
}
printk(KERN_DEBUG"_OSC request data:");
for (i = 0; i < context->cap.length; i += sizeof(u32))
printk("%x ", *((u32 *)(context->cap.pointer + i)));
printk("\n");
}
acpi_status acpi_str_to_uuid(char *str, u8 *uuid)
{
int i;
static int opc_map_to_uuid[16] = {6, 4, 2, 0, 11, 9, 16, 14, 19, 21,
24, 26, 28, 30, 32, 34};
if (strlen(str) != 36)
return AE_BAD_PARAMETER;
for (i = 0; i < 36; i++) {
if (i == 8 || i == 13 || i == 18 || i == 23) {
if (str[i] != '-')
return AE_BAD_PARAMETER;
} else if (!isxdigit(str[i]))
return AE_BAD_PARAMETER;
}
for (i = 0; i < 16; i++) {
uuid[i] = hex_to_bin(str[opc_map_to_uuid[i]]) << 4;
uuid[i] |= hex_to_bin(str[opc_map_to_uuid[i] + 1]);
}
return AE_OK;
}
EXPORT_SYMBOL_GPL(acpi_str_to_uuid);
acpi_status acpi_run_osc(acpi_handle handle, struct acpi_osc_context *context)
{
acpi_status status;
struct acpi_object_list input;
union acpi_object in_params[4];
union acpi_object *out_obj;
u8 uuid[16];
u32 errors;
struct acpi_buffer output = {ACPI_ALLOCATE_BUFFER, NULL};
if (!context)
return AE_ERROR;
if (ACPI_FAILURE(acpi_str_to_uuid(context->uuid_str, uuid)))
return AE_ERROR;
context->ret.length = ACPI_ALLOCATE_BUFFER;
context->ret.pointer = NULL;
/* Setting up input parameters */
input.count = 4;
input.pointer = in_params;
in_params[0].type = ACPI_TYPE_BUFFER;
in_params[0].buffer.length = 16;
in_params[0].buffer.pointer = uuid;
in_params[1].type = ACPI_TYPE_INTEGER;
in_params[1].integer.value = context->rev;
in_params[2].type = ACPI_TYPE_INTEGER;
in_params[2].integer.value = context->cap.length/sizeof(u32);
in_params[3].type = ACPI_TYPE_BUFFER;
in_params[3].buffer.length = context->cap.length;
in_params[3].buffer.pointer = context->cap.pointer;
status = acpi_evaluate_object(handle, "_OSC", &input, &output);
if (ACPI_FAILURE(status))
return status;
if (!output.length)
return AE_NULL_OBJECT;
out_obj = output.pointer;
if (out_obj->type != ACPI_TYPE_BUFFER
|| out_obj->buffer.length != context->cap.length) {
acpi_print_osc_error(handle, context,
"_OSC evaluation returned wrong type");
status = AE_TYPE;
goto out_kfree;
}
/* Need to ignore the bit0 in result code */
errors = *((u32 *)out_obj->buffer.pointer) & ~(1 << 0);
if (errors) {
if (errors & OSC_REQUEST_ERROR)
acpi_print_osc_error(handle, context,
"_OSC request failed");
if (errors & OSC_INVALID_UUID_ERROR)
acpi_print_osc_error(handle, context,
"_OSC invalid UUID");
if (errors & OSC_INVALID_REVISION_ERROR)
acpi_print_osc_error(handle, context,
"_OSC invalid revision");
if (errors & OSC_CAPABILITIES_MASK_ERROR) {
if (((u32 *)context->cap.pointer)[OSC_QUERY_DWORD]
& OSC_QUERY_ENABLE)
goto out_success;
status = AE_SUPPORT;
goto out_kfree;
}
status = AE_ERROR;
goto out_kfree;
}
out_success:
context->ret.length = out_obj->buffer.length;
context->ret.pointer = kmemdup(out_obj->buffer.pointer,
context->ret.length, GFP_KERNEL);
if (!context->ret.pointer) {
status = AE_NO_MEMORY;
goto out_kfree;
}
status = AE_OK;
out_kfree:
kfree(output.pointer);
if (status != AE_OK)
context->ret.pointer = NULL;
return status;
}
EXPORT_SYMBOL(acpi_run_osc);
bool osc_sb_apei_support_acked;
static u8 sb_uuid_str[] = "0811B06E-4A27-44F9-8D60-3CBBC22E7B48";
static void acpi_bus_osc_support(void)
{
u32 capbuf[2];
struct acpi_osc_context context = {
.uuid_str = sb_uuid_str,
.rev = 1,
.cap.length = 8,
.cap.pointer = capbuf,
};
acpi_handle handle;
capbuf[OSC_QUERY_DWORD] = OSC_QUERY_ENABLE;
capbuf[OSC_SUPPORT_DWORD] = OSC_SB_PR3_SUPPORT; /* _PR3 is in use */
#if defined(CONFIG_ACPI_PROCESSOR_AGGREGATOR) ||\
defined(CONFIG_ACPI_PROCESSOR_AGGREGATOR_MODULE)
capbuf[OSC_SUPPORT_DWORD] |= OSC_SB_PAD_SUPPORT;
#endif
#if defined(CONFIG_ACPI_PROCESSOR) || defined(CONFIG_ACPI_PROCESSOR_MODULE)
capbuf[OSC_SUPPORT_DWORD] |= OSC_SB_PPC_OST_SUPPORT;
#endif
capbuf[OSC_SUPPORT_DWORD] |= OSC_SB_HOTPLUG_OST_SUPPORT;
if (!ghes_disable)
capbuf[OSC_SUPPORT_DWORD] |= OSC_SB_APEI_SUPPORT;
if (ACPI_FAILURE(acpi_get_handle(NULL, "\\_SB", &handle)))
return;
if (ACPI_SUCCESS(acpi_run_osc(handle, &context))) {
u32 *capbuf_ret = context.ret.pointer;
if (context.ret.length > OSC_SUPPORT_DWORD)
osc_sb_apei_support_acked =
capbuf_ret[OSC_SUPPORT_DWORD] & OSC_SB_APEI_SUPPORT;
kfree(context.ret.pointer);
}
/* do we need to check other returned cap? Sounds no */
}
/* --------------------------------------------------------------------------
Notification Handling
-------------------------------------------------------------------------- */
/**
* acpi_bus_notify
* ---------------
* Callback for all 'system-level' device notifications (values 0x00-0x7F).
*/
static void acpi_bus_notify(acpi_handle handle, u32 type, void *data)
{
struct acpi_device *adev;
struct acpi_driver *driver;
u32 ost_code = ACPI_OST_SC_NON_SPECIFIC_FAILURE;
bool hotplug_event = false;
switch (type) {
case ACPI_NOTIFY_BUS_CHECK:
acpi_handle_debug(handle, "ACPI_NOTIFY_BUS_CHECK event\n");
hotplug_event = true;
break;
case ACPI_NOTIFY_DEVICE_CHECK:
acpi_handle_debug(handle, "ACPI_NOTIFY_DEVICE_CHECK event\n");
hotplug_event = true;
break;
case ACPI_NOTIFY_DEVICE_WAKE:
acpi_handle_debug(handle, "ACPI_NOTIFY_DEVICE_WAKE event\n");
break;
case ACPI_NOTIFY_EJECT_REQUEST:
acpi_handle_debug(handle, "ACPI_NOTIFY_EJECT_REQUEST event\n");
hotplug_event = true;
break;
case ACPI_NOTIFY_DEVICE_CHECK_LIGHT:
acpi_handle_debug(handle, "ACPI_NOTIFY_DEVICE_CHECK_LIGHT event\n");
/* TBD: Exactly what does 'light' mean? */
break;
case ACPI_NOTIFY_FREQUENCY_MISMATCH:
acpi_handle_err(handle, "Device cannot be configured due "
"to a frequency mismatch\n");
break;
case ACPI_NOTIFY_BUS_MODE_MISMATCH:
acpi_handle_err(handle, "Device cannot be configured due "
"to a bus mode mismatch\n");
break;
case ACPI_NOTIFY_POWER_FAULT:
acpi_handle_err(handle, "Device has suffered a power fault\n");
break;
default:
acpi_handle_debug(handle, "Unknown event type 0x%x\n", type);
break;
}
adev = acpi_bus_get_acpi_device(handle);
if (!adev)
goto err;
driver = adev->driver;
if (driver && driver->ops.notify &&
(driver->flags & ACPI_DRIVER_ALL_NOTIFY_EVENTS))
driver->ops.notify(adev, type);
if (hotplug_event && ACPI_SUCCESS(acpi_hotplug_schedule(adev, type)))
return;
acpi_bus_put_acpi_device(adev);
return;
err:
acpi_evaluate_ost(handle, type, ost_code, NULL);
}
/* --------------------------------------------------------------------------
Initialization/Cleanup
-------------------------------------------------------------------------- */
static int __init acpi_bus_init_irq(void)
{
acpi_status status;
char *message = NULL;
/*
* Let the system know what interrupt model we are using by
* evaluating the \_PIC object, if exists.
*/
switch (acpi_irq_model) {
case ACPI_IRQ_MODEL_PIC:
message = "PIC";
break;
case ACPI_IRQ_MODEL_IOAPIC:
message = "IOAPIC";
break;
case ACPI_IRQ_MODEL_IOSAPIC:
message = "IOSAPIC";
break;
case ACPI_IRQ_MODEL_PLATFORM:
message = "platform specific model";
break;
default:
printk(KERN_WARNING PREFIX "Unknown interrupt routing model\n");
return -ENODEV;
}
printk(KERN_INFO PREFIX "Using %s for interrupt routing\n", message);
status = acpi_execute_simple_method(NULL, "\\_PIC", acpi_irq_model);
if (ACPI_FAILURE(status) && (status != AE_NOT_FOUND)) {
ACPI_EXCEPTION((AE_INFO, status, "Evaluating _PIC"));
return -ENODEV;
}
return 0;
}
void __init acpi_early_init(void)
{
acpi_status status;
if (acpi_disabled)
return;
printk(KERN_INFO PREFIX "Core revision %08x\n", ACPI_CA_VERSION);
/* It's safe to verify table checksums during late stage */
acpi_gbl_verify_table_checksum = TRUE;
/* enable workarounds, unless strict ACPI spec. compliance */
if (!acpi_strict)
acpi_gbl_enable_interpreter_slack = TRUE;
acpi_gbl_permanent_mmap = 1;
/*
* If the machine falls into the DMI check table,
* DSDT will be copied to memory
*/
dmi_check_system(dsdt_dmi_table);
status = acpi_reallocate_root_table();
if (ACPI_FAILURE(status)) {
printk(KERN_ERR PREFIX
"Unable to reallocate ACPI tables\n");
goto error0;
}
status = acpi_initialize_subsystem();
if (ACPI_FAILURE(status)) {
printk(KERN_ERR PREFIX
"Unable to initialize the ACPI Interpreter\n");
goto error0;
}
status = acpi_load_tables();
if (ACPI_FAILURE(status)) {
printk(KERN_ERR PREFIX
"Unable to load the System Description Tables\n");
goto error0;
}
#ifdef CONFIG_X86
if (!acpi_ioapic) {
/* compatible (0) means level (3) */
if (!(acpi_sci_flags & ACPI_MADT_TRIGGER_MASK)) {
acpi_sci_flags &= ~ACPI_MADT_TRIGGER_MASK;
acpi_sci_flags |= ACPI_MADT_TRIGGER_LEVEL;
}
/* Set PIC-mode SCI trigger type */
acpi_pic_sci_set_trigger(acpi_gbl_FADT.sci_interrupt,
(acpi_sci_flags & ACPI_MADT_TRIGGER_MASK) >> 2);
} else {
/*
* now that acpi_gbl_FADT is initialized,
* update it with result from INT_SRC_OVR parsing
*/
acpi_gbl_FADT.sci_interrupt = acpi_sci_override_gsi;
}
#endif
status = acpi_enable_subsystem(~ACPI_NO_ACPI_ENABLE);
if (ACPI_FAILURE(status)) {
printk(KERN_ERR PREFIX "Unable to enable ACPI\n");
goto error0;
}
/*
* If the system is using ACPI then we can be reasonably
* confident that any regulators are managed by the firmware
* so tell the regulator core it has everything it needs to
* know.
*/
regulator_has_full_constraints();
return;
error0:
disable_acpi();
return;
}
static int __init acpi_bus_init(void)
{
int result;
acpi_status status;
acpi_os_initialize1();
status = acpi_enable_subsystem(ACPI_NO_ACPI_ENABLE);
if (ACPI_FAILURE(status)) {
printk(KERN_ERR PREFIX
"Unable to start the ACPI Interpreter\n");
goto error1;
}
/*
* ACPI 2.0 requires the EC driver to be loaded and work before
* the EC device is found in the namespace (i.e. before acpi_initialize_objects()
* is called).
*
* This is accomplished by looking for the ECDT table, and getting
* the EC parameters out of that.
*/
status = acpi_ec_ecdt_probe();
/* Ignore result. Not having an ECDT is not fatal. */
status = acpi_initialize_objects(ACPI_FULL_INITIALIZATION);
if (ACPI_FAILURE(status)) {
printk(KERN_ERR PREFIX "Unable to initialize ACPI objects\n");
goto error1;
}
/*
* _OSC method may exist in module level code,
* so it must be run after ACPI_FULL_INITIALIZATION
*/
acpi_bus_osc_support();
/*
* _PDC control method may load dynamic SSDT tables,
* and we need to install the table handler before that.
*/
acpi_sysfs_init();
acpi_early_processor_set_pdc();
/*
* Maybe EC region is required at bus_scan/acpi_get_devices. So it
* is necessary to enable it as early as possible.
*/
acpi_boot_ec_enable();
printk(KERN_INFO PREFIX "Interpreter enabled\n");
/* Initialize sleep structures */
acpi_sleep_init();
/*
* Get the system interrupt model and evaluate \_PIC.
*/
result = acpi_bus_init_irq();
if (result)
goto error1;
/*
* Register the for all standard device notifications.
*/
status =
acpi_install_notify_handler(ACPI_ROOT_OBJECT, ACPI_SYSTEM_NOTIFY,
&acpi_bus_notify, NULL);
if (ACPI_FAILURE(status)) {
printk(KERN_ERR PREFIX
"Unable to register for device notifications\n");
goto error1;
}
/*
* Create the top ACPI proc directory
*/
acpi_root_dir = proc_mkdir(ACPI_BUS_FILE_ROOT, NULL);
return 0;
/* Mimic structured exception handling */
error1:
acpi_terminate();
return -ENODEV;
}
struct kobject *acpi_kobj;
EXPORT_SYMBOL_GPL(acpi_kobj);
static int __init acpi_init(void)
{
int result;
if (acpi_disabled) {
printk(KERN_INFO PREFIX "Interpreter disabled.\n");
return -ENODEV;
}
acpi_kobj = kobject_create_and_add("acpi", firmware_kobj);
if (!acpi_kobj) {
printk(KERN_WARNING "%s: kset create error\n", __func__);
acpi_kobj = NULL;
}
init_acpi_device_notify();
result = acpi_bus_init();
if (result) {
disable_acpi();
return result;
}
pci_mmcfg_late_init();
acpi_scan_init();
acpi_ec_init();
acpi_debugfs_init();
acpi_sleep_proc_init();
acpi_wakeup_device_init();
return 0;
}
subsys_initcall(acpi_init);
| {
"pile_set_name": "Github"
} |
class {
onMount() {
window.listItemsComponent = this;
}
}
<ul key="root">
<for|option| of=input.options>
<li>
<a>${option}</a>
</li>
</for>
</ul> | {
"pile_set_name": "Github"
} |
{
"_args": [
[
{
"raw": "string-width@^1.0.1",
"scope": null,
"escapedName": "string-width",
"name": "string-width",
"rawSpec": "^1.0.1",
"spec": ">=1.0.1 <2.0.0",
"type": "range"
},
"/Users/zkat/Documents/code/npm/node_modules/npmlog/node_modules/gauge"
],
[
{
"raw": "string-width@^1.0.1",
"scope": null,
"escapedName": "string-width",
"name": "string-width",
"rawSpec": "^1.0.1",
"spec": ">=1.0.1 <2.0.0",
"type": "range"
},
"/Users/zkat/Documents/code/npm/node_modules/node-gyp/node_modules/npmlog/node_modules/gauge"
]
],
"_from": "string-width@^1.0.1",
"_id": "[email protected]",
"_inCache": true,
"_location": "/node-gyp/npmlog/gauge/string-width",
"_nodeVersion": "4.4.5",
"_npmOperationalInternal": {
"host": "packages-12-west.internal.npmjs.com",
"tmp": "tmp/string-width-1.0.2.tgz_1471188233009_0.6573935742489994"
},
"_npmUser": {
"name": "sindresorhus",
"email": "[email protected]"
},
"_npmVersion": "2.15.5",
"_phantomChildren": {},
"_requested": {
"raw": "string-width@^1.0.1",
"scope": null,
"escapedName": "string-width",
"name": "string-width",
"rawSpec": "^1.0.1",
"spec": ">=1.0.1 <2.0.0",
"type": "range"
},
"_requiredBy": [
"/node-gyp/npmlog/gauge",
"/node-gyp/npmlog/gauge/wide-align"
],
"_resolved": "https://registry.npmjs.org/string-width/-/string-width-1.0.2.tgz",
"_shasum": "118bdf5b8cdc51a2a7e70d211e07e2b0b9b107d3",
"_shrinkwrap": null,
"_spec": "string-width@^1.0.1",
"_where": "/Users/zkat/Documents/code/npm/node_modules/node-gyp/node_modules/npmlog/node_modules/gauge",
"author": {
"name": "Sindre Sorhus",
"email": "[email protected]",
"url": "sindresorhus.com"
},
"bugs": {
"url": "https://github.com/sindresorhus/string-width/issues"
},
"dependencies": {
"code-point-at": "^1.0.0",
"is-fullwidth-code-point": "^1.0.0",
"strip-ansi": "^3.0.0"
},
"description": "Get the visual width of a string - the number of columns required to display it",
"devDependencies": {
"ava": "*",
"xo": "*"
},
"directories": {},
"dist": {
"shasum": "118bdf5b8cdc51a2a7e70d211e07e2b0b9b107d3",
"tarball": "https://registry.npmjs.org/string-width/-/string-width-1.0.2.tgz"
},
"engines": {
"node": ">=0.10.0"
},
"files": [
"index.js"
],
"gitHead": "282cf3d53918a92cc3ee0778dcf938039bcbc47b",
"homepage": "https://github.com/sindresorhus/string-width#readme",
"keywords": [
"string",
"str",
"character",
"char",
"unicode",
"width",
"visual",
"column",
"columns",
"fullwidth",
"full-width",
"full",
"ansi",
"escape",
"codes",
"cli",
"command-line",
"terminal",
"console",
"cjk",
"chinese",
"japanese",
"korean",
"fixed-width"
],
"license": "MIT",
"maintainers": [
{
"name": "sindresorhus",
"email": "[email protected]"
}
],
"name": "string-width",
"optionalDependencies": {},
"readme": "ERROR: No README data found!",
"repository": {
"type": "git",
"url": "git+https://github.com/sindresorhus/string-width.git"
},
"scripts": {
"test": "xo && ava"
},
"version": "1.0.2"
}
| {
"pile_set_name": "Github"
} |
#!/usr/bin/python3
import sys
import re
elf = re.compile(r"\s*?\d+:\s*([0-9a-f]+)\s+\d+\s+(FUNC|OBJECT)\s+(GLOBAL|WEAK)\s+DEFAULT\s+\d+\s+(\w+)\s*")
f = open(sys.argv[1])
out = open(sys.argv[2], "w")
version_str = sys.argv[3]
asm_type = {"FUNC": "function", "OBJECT": "object"}
version = """
.pushsection .note.osv, "a", @note;
.long 2f-1f;
.long 4f-3f;
.long 1;
.balign 4;
1:
.asciz "OSv";
2:
.balign 4;
3:
.asciz "%s";
4:
.balign 4;
"""%(version_str)
for line in f.readlines():
try:
value, tp, bnd, sym = elf.match(line).groups()
out.write("%s = 0x%s;\n"%(sym, value))
print(".global %s\n.type %s,@%s"%(sym, sym, asm_type[tp]))
except AttributeError:
pass
print(version)
| {
"pile_set_name": "Github"
} |
// (C) Copyright 2009-2011 Frederic Bron.
//
// Use, modification and distribution are subject to the Boost Software License,
// Version 1.0. (See accompanying file LICENSE_1_0.txt or copy at
// http://www.boost.org/LICENSE_1_0.txt).
//
// See http://www.boost.org/libs/type_traits for most recent version including documentation.
#ifndef BOOST_TT_HAS_DIVIDES_HPP_INCLUDED
#define BOOST_TT_HAS_DIVIDES_HPP_INCLUDED
#define BOOST_TT_TRAIT_NAME has_divides
#define BOOST_TT_TRAIT_OP /
#define BOOST_TT_FORBIDDEN_IF\
/* pointer with pointer or fundamental */\
(\
(\
::boost::is_pointer< Lhs_noref >::value && \
( \
::boost::is_fundamental< Rhs_nocv >::value || \
::boost::is_pointer< Rhs_noref >::value\
)\
)||\
(\
::boost::is_pointer< Rhs_noref >::value && \
( \
::boost::is_fundamental< Lhs_nocv >::value || \
::boost::is_pointer< Lhs_noref >::value\
)\
)\
)
#include <boost/type_traits/detail/has_binary_operator.hpp>
#undef BOOST_TT_TRAIT_NAME
#undef BOOST_TT_TRAIT_OP
#undef BOOST_TT_FORBIDDEN_IF
#endif
| {
"pile_set_name": "Github"
} |
<div class="large-table">
<div class="header <%= "top" if @_smartphonesGroups.length > 0 %>">
<div class="uppercase-section-column stretchable"><%= t 'wallet.settings.hardware.paired_smartphones' %></div>
<a class="uppercase-action" href="#pairSmartphone"><i class="fa fa-plus"></i><%= t 'wallet.settings.hardware.pair_a_smartphone' %></a>
</div>
<% for smartphonesGroup, i in @_smartphonesGroups: %>
<div class="row <% if i == @_smartphonesGroups.length - 1: %><%= "bottom" %><% else: %><%= "middle" %><% end %>">
<div class="light-grey-icon-large"><i class="fa fa-mobile"></i></div>
<div class="regular-text-small stretchable"><%= smartphonesGroup[0].name %></div>
<div class="regular-grey-text-small">
<% if smartphonesGroup.length > 1: %>
<%= _.str.sprintf(t('wallet.settings.hardware.multiple_paired_devices'), smartphonesGroup.length) %>
<% else: %>
<%= _.str.sprintf(t('wallet.settings.hardware.single_paired_device'), smartphonesGroup.length) %>
<% end %>
</div>
<a class="light-grey-icon-medium" href="#removeSmartphoneGroup(index=<%= i %>)"><i class="fa fa-trash"></i></a>
</div>
<% end %>
</div> | {
"pile_set_name": "Github"
} |
const trails: TrailType[] = [
{
url:
'https://www.theguardian.com/business/2019/dec/02/directors-climate-disclosures-tci-hedge-fund',
headline:
"Punish directors who don't make climate disclosures, says hedge fund",
showByline: false,
byline: 'Julia Kollewe',
image:
'https://i.guim.co.uk/img/media/d4124d7bb89be381cbe9d72c849fad136f843086/0_84_4974_2985/master/4974.jpg?width=900&quality=85&s=4bdf16831b01b6fcc649992c52e6011b',
isLiveBlog: false,
webPublicationDate: '2019-12-02T09:45:30.000Z',
pillar: 'opinion',
designType: 'Comment',
},
{
url:
'https://www.theguardian.com/environment/2019/dec/02/migration-v-climate-europes-new-political-divide',
headline: "Migration v climate: Europe's new political divide",
showByline: false,
byline: 'Shaun Walker in Budapest',
image:
'https://i.guim.co.uk/img/media/e060e9b7c92433b3dfeccc98b9206778cda8b8e8/0_180_6680_4009/master/6680.jpg?width=900&quality=85&s=f27d36b8e7563f226cb5c22049559569',
isLiveBlog: false,
webPublicationDate: '2019-12-02T09:45:30.000Z',
pillar: 'news',
designType: 'Media',
mediaType: 'Video',
mediaDuration: 378,
},
{
url:
'https://www.theguardian.com/world/2019/nov/28/eu-parliament-declares-climate-emergency',
headline: 'An active live blog',
showByline: false,
byline: 'Jennifer Rankin in Brussels',
image:
'https://i.guim.co.uk/img/media/e8de0c5e27a2d92ced64f690daf48fd9b3b5c079/0_0_5101_3061/master/5101.jpg?width=900&quality=85&s=6c1cec769f59569c150794ae5f3d6c44',
isLiveBlog: true,
webPublicationDate: '2019-12-02T09:45:30.000Z',
pillar: 'news',
designType: 'Live',
kickerText: 'Live',
},
{
url:
'https://www.theguardian.com/environment/2019/nov/27/climate-emergency-world-may-have-crossed-tipping-points',
headline: 'An inactive live sport blog - as it happened',
showByline: false,
byline: 'Damian Carrington Environment editor',
image:
'https://i.guim.co.uk/img/media/1774967ff6b9127a43b06c0685d1fd499c965141/98_0_3413_2048/master/3413.jpg?width=900&quality=85&s=7332d70e260400883bfdcb5b1453ef10',
isLiveBlog: true,
webPublicationDate: '2019-12-02T09:45:30.000Z',
pillar: 'sport',
designType: 'Article',
},
{
url:
'https://www.theguardian.com/world/2019/nov/26/european-parliament-split-on-declaring-climate-emergency',
headline: 'European parliament split on declaring climate emergency',
showByline: false,
byline: 'Jennifer Rankin in Brussels',
image:
'https://i.guim.co.uk/img/media/6db4a6d23e6e8d78ca6893f14b03e79869b2fef1/0_220_3500_2101/master/3500.jpg?width=900&quality=85&s=c212dd884c83237b2a1f24349bd9973b',
isLiveBlog: false,
webPublicationDate: '2019-12-02T09:45:30.000Z',
pillar: 'news',
designType: 'Article',
},
{
url:
'https://www.theguardian.com/world/2019/nov/23/north-pole-explorers-on-thin-ice-as-climate-change-hits-expedition',
headline:
'North Pole explorers on thin ice as climate change hits expedition',
showByline: false,
byline: 'Simon Murphy',
image:
'https://i.guim.co.uk/img/media/deb1f0b7f61ebbed2086a55dc34fecb2433a04bc/0_0_6000_3600/master/6000.jpg?width=900&quality=85&s=52aefcb20c15c279b6a6d360f5af9828',
isLiveBlog: false,
webPublicationDate: '2019-12-02T09:45:30.000Z',
pillar: 'news',
designType: 'Article',
},
{
url:
'https://www.theguardian.com/environment/2019/oct/25/scientists-glacial-rivers-absorb-carbon-faster-rainforests',
headline:
'Glacial rivers absorb carbon faster than rainforests, scientists find',
showByline: false,
byline: 'Leyland Cecco',
image:
'https://i.guim.co.uk/img/media/5e8ea90ae9f503aa1c98fd35dbf13235b1207fea/0_490_3264_1958/master/3264.jpg?width=900&quality=85&s=80890967a26cab02bd524331818e6e23',
isLiveBlog: false,
webPublicationDate: '2019-12-02T09:45:30.000Z',
pillar: 'news',
designType: 'Article',
},
{
url:
'https://www.theguardian.com/business/2019/oct/20/uk-urges-world-bank-to-channel-more-money-into-tackling-climate-crisis',
headline:
'UK urges World Bank to channel more money into tackling climate crisis',
showByline: false,
byline: 'Larry Elliott in Washington',
image:
'https://i.guim.co.uk/img/media/2905d1c09d1a27de1c183dfa5cdcc10c869932d9/0_124_5472_3284/master/5472.jpg?width=900&quality=85&s=88c182d909be33c918fc17f26778d0c1',
isLiveBlog: false,
webPublicationDate: '2019-12-02T09:45:30.000Z',
pillar: 'news',
designType: 'Article',
},
];
export const storyPackageTrails: OnwardsType = {
heading: 'More on this story',
trails,
ophanComponentName: 'more-on-this-story',
};
export const oneTrail: OnwardsType = {
heading: 'More on this story',
trails: trails.slice(0, 1),
ophanComponentName: 'more-on-this-story',
};
export const twoTrails: OnwardsType = {
heading: 'More on this story',
trails: trails.slice(0, 2),
ophanComponentName: 'more-on-this-story',
};
export const threeTrails: OnwardsType = {
heading: 'More on this story',
trails: trails.slice(0, 3),
ophanComponentName: 'more-on-this-story',
};
export const fourTrails: OnwardsType = {
heading: 'More on this story',
trails: trails.slice(0, 4),
ophanComponentName: 'more-on-this-story',
};
export const fiveTrails: OnwardsType = {
heading: 'More on this story',
trails: trails.slice(0, 5),
ophanComponentName: 'more-on-this-story',
};
export const sixTrails: OnwardsType = {
heading: 'More on this story',
trails: trails.slice(0, 6),
ophanComponentName: 'more-on-this-story',
};
export const sevenTrails: OnwardsType = {
heading: 'More on this story',
trails: trails.slice(0, 7),
ophanComponentName: 'more-on-this-story',
};
export const eightTrails: OnwardsType = {
heading: 'More on this story',
trails: trails.slice(0, 8),
ophanComponentName: 'more-on-this-story',
};
export const linkAndDescription: OnwardsType = {
url: 'https://www.theguardian.com/news/shortcuts',
description:
'Our writers reflect on the people, issues and curiosities in the news',
heading: 'More on this story',
trails: trails.slice(0, 8),
ophanComponentName: 'more-on-this-story',
};
export const withLongDescription: OnwardsType = {
description:
"<p>A blog by the Guardian's internal Digital team. We build the Guardian website, mobile apps, Editorial tools, revenue products, support our infrastructure and manage all things tech around the Guardian.</p><p>Our team contains Developers, UX, Quality, Product and Enterprise IT. This blog is where we share our experiences and approaches, including software development tips, code examples, open source software and product development stories </p>",
heading: 'More on this story',
trails: trails.slice(0, 8),
ophanComponentName: 'more-on-this-story',
};
| {
"pile_set_name": "Github"
} |
Door Prison Cell (key)
| {
"pile_set_name": "Github"
} |
Id: VMware.WorkstationPro
Name: VMware Workstation Pro
AppMoniker: vmware-workstationpro
Version: 15.5.6
Publisher: VMware
Author: VMware
License: © 2020 VMware, Inc
LicenseUrl: https://www.vmware.com/help/legal.html
Description: VMware Workstation Pro allows you to run multiple operating systems at once on the same Windows PC.
Homepage: https://www.vmware.com/products/workstation-pro.html
Tags: "vm, vmware, virtualmachine, workstation, pro"
MinOSVersion: 6.1.7600.0
InstallerType: exe
Installers:
- Arch: x64
Url: https://download3.vmware.com/software/wkst/file/VMware-workstation-full-15.5.6-16341506.exe
Sha256: 78ee4c479be65f7348032aaeb95f4aa92c8c372bc8cafb252c1a4eb6a031f73d
Switches:
Custom: /v/qn REBOOT=ReallySuppress EULAS_AGREED=1
Silent: /s
SilentWithProgress: /s
| {
"pile_set_name": "Github"
} |
Kuyruk Sphinx Style
===================
This theme is a derivation of Flask Sphinx Theme at:
https://github.com/mitsuhiko/flask-sphinx-themes
| {
"pile_set_name": "Github"
} |
<?php
generate_mock_once('HTMLPurifier_DefinitionCache');
class HTMLPurifier_DefinitionCache_DecoratorHarness extends HTMLPurifier_DefinitionCacheHarness
{
public function setup()
{
$this->mock = new HTMLPurifier_DefinitionCacheMock();
$this->mock->type = 'Test';
$this->cache = $this->cache->decorate($this->mock);
$this->def = $this->generateDefinition();
$this->config = $this->generateConfigMock();
}
public function teardown()
{
unset($this->mock);
unset($this->cache);
}
}
// vim: et sw=4 sts=4
| {
"pile_set_name": "Github"
} |
fileFormatVersion: 2
guid: e3a3c8e7f1cdae14fa835ee3580e292f
MonoImporter:
externalObjects: {}
serializedVersion: 2
defaultReferences: []
executionOrder: 0
icon: {instanceID: 0}
userData:
assetBundleName:
assetBundleVariant:
| {
"pile_set_name": "Github"
} |
# Copyright (C) 2012-2014,2017-2019,2020 Free Software Foundation, Inc.
#
# This file is part of GNU Radio
#
# SPDX-License-Identifier: GPL-3.0-or-later
#
########################################################################
# Setup library
########################################################################
add_library(gnuradio-filter
fir_filter.cc
fir_filter_blk_impl.cc
fir_filter_with_buffer.cc
fft_filter.cc
firdes.cc
freq_xlating_fir_filter_impl.cc
ival_decimator_impl.cc
iir_filter.cc
interp_fir_filter_impl.cc
mmse_fir_interpolator_cc.cc
mmse_fir_interpolator_ff.cc
mmse_interp_differentiator_cc.cc
mmse_interp_differentiator_ff.cc
pm_remez.cc
polyphase_filterbank.cc
dc_blocker_cc_impl.cc
dc_blocker_ff_impl.cc
filter_delay_fc_impl.cc
filterbank.cc
filterbank_vcvcf_impl.cc
fft_filter_ccc_impl.cc
fft_filter_ccf_impl.cc
fft_filter_fff_impl.cc
mmse_interpolator_cc_impl.cc
mmse_interpolator_ff_impl.cc
mmse_resampler_cc_impl.cc
mmse_resampler_ff_impl.cc
hilbert_fc_impl.cc
iir_filter_ffd_impl.cc
iir_filter_ccc_impl.cc
iir_filter_ccf_impl.cc
iir_filter_ccd_impl.cc
iir_filter_ccz_impl.cc
pfb_arb_resampler.cc
pfb_arb_resampler_ccf_impl.cc
pfb_arb_resampler_ccc_impl.cc
pfb_arb_resampler_fff_impl.cc
pfb_channelizer_ccf_impl.cc
pfb_decimator_ccf_impl.cc
pfb_interpolator_ccf_impl.cc
pfb_synthesizer_ccf_impl.cc
rational_resampler_base_impl.cc
single_pole_iir_filter_cc_impl.cc
single_pole_iir_filter_ff_impl.cc
)
target_link_libraries(gnuradio-filter PUBLIC
gnuradio-runtime
gnuradio-fft
gnuradio-blocks
Volk::volk
)
target_include_directories(gnuradio-filter
PUBLIC
$<INSTALL_INTERFACE:include>
$<BUILD_INTERFACE:${CMAKE_CURRENT_SOURCE_DIR}/../include>
)
#Add Windows DLL resource file if using MSVC
if(MSVC)
include(${CMAKE_SOURCE_DIR}/cmake/Modules/GrVersion.cmake)
configure_file(
${CMAKE_CURRENT_SOURCE_DIR}/gnuradio-filter.rc.in
${CMAKE_CURRENT_BINARY_DIR}/gnuradio-filter.rc
@ONLY)
target_sources(gnuradio-filter PRIVATE
${CMAKE_CURRENT_BINARY_DIR}/gnuradio-filter.rc
)
endif(MSVC)
GR_LIBRARY_FOO(gnuradio-filter)
########################################################################
# QA C++ Code for gr-filter
########################################################################
if(ENABLE_TESTING)
include(GrTest)
list(APPEND test_gr_filter_sources
qa_firdes.cc
qa_fir_filter_with_buffer.cc
qa_mmse_fir_interpolator_cc.cc
qa_mmse_fir_interpolator_ff.cc
qa_mmse_interp_differentiator_cc.cc
qa_mmse_interp_differentiator_ff.cc
)
list(APPEND GR_TEST_TARGET_DEPS gnuradio-filter gnuradio-fft)
foreach(qa_file ${test_gr_filter_sources})
GR_ADD_CPP_TEST("filter_${qa_file}"
${CMAKE_CURRENT_SOURCE_DIR}/${qa_file}
)
endforeach(qa_file)
endif(ENABLE_TESTING)
| {
"pile_set_name": "Github"
} |
#ifndef ASLAM_GRID_CALIBRATION_TARGET_CHECKERBOARD_HPP
#define ASLAM_GRID_CALIBRATION_TARGET_CHECKERBOARD_HPP
#include <vector>
#include <Eigen/Core>
#include <opencv2/core/core.hpp>
#include <boost/shared_ptr.hpp>
#include <boost/serialization/export.hpp>
#include <sm/assert_macros.hpp>
#include <sm/boost/serialization.hpp>
#include <aslam/cameras/GridCalibrationTargetBase.hpp>
namespace aslam {
namespace cameras {
class GridCalibrationTargetCheckerboard : public GridCalibrationTargetBase {
public:
SM_DEFINE_EXCEPTION(Exception, std::runtime_error);
typedef boost::shared_ptr<GridCalibrationTargetCheckerboard> Ptr;
typedef boost::shared_ptr<const GridCalibrationTargetCheckerboard> ConstPtr;
//target extraction options
struct CheckerboardOptions {
CheckerboardOptions() :
useAdaptiveThreshold(true),
normalizeImage(true),
performFastCheck(true),
filterQuads(false),
doSubpixelRefinement(true),
showExtractionVideo(false),
windowWidth(11) {};
/// \brief opencv options
bool useAdaptiveThreshold;
bool normalizeImage;
bool performFastCheck;
bool filterQuads;
bool doSubpixelRefinement;
unsigned int windowWidth;
/// \brief show extracted corners
bool showExtractionVideo;
/// \brief Serialization support
enum {CLASS_SERIALIZATION_VERSION = 1};
BOOST_SERIALIZATION_SPLIT_MEMBER()
template<class Archive>
void save(Archive & ar, const unsigned int /*version*/) const
{
ar << BOOST_SERIALIZATION_NVP(useAdaptiveThreshold);
ar << BOOST_SERIALIZATION_NVP(normalizeImage);
ar << BOOST_SERIALIZATION_NVP(performFastCheck);
ar << BOOST_SERIALIZATION_NVP(filterQuads);
ar << BOOST_SERIALIZATION_NVP(doSubpixelRefinement);
ar << BOOST_SERIALIZATION_NVP(showExtractionVideo);
ar << BOOST_SERIALIZATION_NVP(windowWidth);
}
template<class Archive>
void load(Archive & ar, const unsigned int /*version*/)
{
ar >> BOOST_SERIALIZATION_NVP(useAdaptiveThreshold);
ar >> BOOST_SERIALIZATION_NVP(normalizeImage);
ar >> BOOST_SERIALIZATION_NVP(performFastCheck);
ar >> BOOST_SERIALIZATION_NVP(filterQuads);
ar >> BOOST_SERIALIZATION_NVP(doSubpixelRefinement);
ar >> BOOST_SERIALIZATION_NVP(showExtractionVideo);
ar >> BOOST_SERIALIZATION_NVP(windowWidth);
}
};
/// \brief initialize based on checkerboard geometry
GridCalibrationTargetCheckerboard(size_t rows, size_t cols, double rowSpacingMeters,
double colSpacingMeters,
const GridCalibrationTargetCheckerboard::CheckerboardOptions &options = CheckerboardOptions());
virtual ~GridCalibrationTargetCheckerboard() {};
/// \brief extract the calibration target points from an image and write to an observation
bool computeObservation(const cv::Mat &image, Eigen::MatrixXd &outImagePoints,
std::vector<bool> &outCornerObserved) const;
private:
/// \brief initialize the object
void initialize();
/// \brief initialize the grid with the points
void createGridPoints();
/// \brief size of a checkerboard square in rows direction [m]
double _rowSpacingMeters;
/// \brief size of a checkerboard square in cols direction [m]
double _colSpacingMeters;
/// \brief checkerboard extraction options
CheckerboardOptions _options;
///////////////////////////////////////////////////
// Serialization support
///////////////////////////////////////////////////
public:
enum {CLASS_SERIALIZATION_VERSION = 1};
BOOST_SERIALIZATION_SPLIT_MEMBER()
//serialization ctor
GridCalibrationTargetCheckerboard() {};
protected:
friend class boost::serialization::access;
template<class Archive>
void save(Archive & ar, const unsigned int /* version */) const {
boost::serialization::void_cast_register<GridCalibrationTargetCheckerboard, GridCalibrationTargetBase>(
static_cast<GridCalibrationTargetCheckerboard *>(NULL),
static_cast<GridCalibrationTargetBase *>(NULL));
ar << BOOST_SERIALIZATION_BASE_OBJECT_NVP(GridCalibrationTargetBase);
ar << BOOST_SERIALIZATION_NVP(_rowSpacingMeters);
ar << BOOST_SERIALIZATION_NVP(_colSpacingMeters);
ar << BOOST_SERIALIZATION_NVP(_options);
}
template<class Archive>
void load(Archive & ar, const unsigned int /* version */) {
boost::serialization::void_cast_register<GridCalibrationTargetCheckerboard, GridCalibrationTargetBase>(
static_cast<GridCalibrationTargetCheckerboard *>(NULL),
static_cast<GridCalibrationTargetBase *>(NULL));
ar >> BOOST_SERIALIZATION_BASE_OBJECT_NVP(GridCalibrationTargetBase);
ar >> BOOST_SERIALIZATION_NVP(_rowSpacingMeters);
ar >> BOOST_SERIALIZATION_NVP(_colSpacingMeters);
ar >> BOOST_SERIALIZATION_NVP(_options);
initialize();
}
};
} // namespace cameras
} // namespace aslam
SM_BOOST_CLASS_VERSION(aslam::cameras::GridCalibrationTargetCheckerboard);
SM_BOOST_CLASS_VERSION(aslam::cameras::GridCalibrationTargetCheckerboard::CheckerboardOptions);
BOOST_CLASS_EXPORT_KEY(aslam::cameras::GridCalibrationTargetCheckerboard);
#endif /* ASLAM_GRID_CALIBRATION_TARGET_CHECKERBOARD_HPP */
| {
"pile_set_name": "Github"
} |
fs_scheme : "local",
verbose : false,
data {
train {
data_path : "demo/data/ytklearn/machine.train.ytklearn",
max_error_tol : 0
},
test {
data_path : "demo/data/ytklearn/machine.test.ytklearn",
max_error_tol : 0
},
delim {
x_delim : "###",
y_delim : ",",
features_delim : ",",
feature_name_val_delim : ":"
},
// ["[email protected]","[email protected]",...]
y_sampling : [],
assigned : false,
unassigned_mode : "lines_avg" // "files_avg"
},
feature {
feature_hash {
need_feature_hash : false,
bucket_size : 1000000,
seed : 39916801,
feature_prefix : "hash_"
},
transform {
switch_on : false,
// "standardization", "scale_range"
mode : "standardization",
scale_range {
min : -1,
max : 1
},
include_features : [],
exclude_features : []
},
filter_threshold : 0
},
model {
data_path : "demo/win/gbhmlr/regression/gbhmlr.model",
delim : ",",
need_dict : false,
dict_path : "",
dump_freq : 50,
need_bias : true,
bias_feature_name : "_bias_",
continue_train : false
},
loss {
loss_function : "l2",
evaluate_metric : ["rmse"],
just_evaluate : false,
regularization : {
l1 : [5.28e-9],
l2 : [5.28e-7]
}
},
optimization {
optimizer : "line_search",
line_search {
mode : "wolfe",
backtracking : {
step_decr : 0.5,
step_incr : 2.1,
max_iter : 55,
min_step : 1e-16,
max_step : 1e18,
c1 : 1e-4,
c2 : 0.9
}
lbfgs {
m : 12,
convergence : {
max_iter : 100,
eps : 1e-3
}
}
}
},
hyper {
switch_on : false,
restart : true,
mode : "hoag",
hoag {
init_step : 1.0,
step_decr_factor : 0.7,
test_loss_reduce_limit : 1e-5,
outer_iter : 10,
l1 : [0.0],
l2 : [5.28e-7]
},
grid {
l1 : [1e-9, 1e-6, 5],
l2 : [1e-8, 1e-5, 5]
}
},
random {
mode : "normal",
seed : 111111,
normal {
mean : 0.0,
std : 0.01
},
uniform {
range_start : -0.01,
range_end : 0.01
},
},
k : 16,
instance_sample_rate : 1.0,
feature_sample_rate : 1.0,
uniform_base_prediction : 0.5,
sample_dependent_base_prediction : false,
tree_num : 1,
learning_rate : 1.0,
type : "gradient_boosting" // random_forest
| {
"pile_set_name": "Github"
} |
/*******************************************************************************
* Copyright (c) 2000, 2007 IBM Corporation and others.
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at
* http://www.eclipse.org/legal/epl-v10.html
*
* Contributors:
* IBM Corporation - initial API and implementation
*******************************************************************************/
package org.eclipse.wst.jsdt.internal.ui.refactoring.nls.search;
import org.eclipse.core.resources.IFile;
import org.eclipse.search.ui.NewSearchUI;
import org.eclipse.wst.jsdt.core.IType;
import org.eclipse.wst.jsdt.core.search.SearchEngine;
public class SearchBrokenNLSKeysUtil {
public static void search(String scopeName, IType[] accessorClasses, IFile[] propertieFiles) {
NLSSearchQuery query= new NLSSearchQuery(accessorClasses, propertieFiles, SearchEngine.createWorkspaceScope(), scopeName);
NewSearchUI.runQueryInBackground(query);
}
}
| {
"pile_set_name": "Github"
} |
// go run mksysnum.go https://svn.freebsd.org/base/stable/11/sys/kern/syscalls.master
// Code generated by the command above; see README.md. DO NOT EDIT.
// +build arm,freebsd
package unix
const (
// SYS_NOSYS = 0; // { int nosys(void); } syscall nosys_args int
SYS_EXIT = 1 // { void sys_exit(int rval); } exit sys_exit_args void
SYS_FORK = 2 // { int fork(void); }
SYS_READ = 3 // { ssize_t read(int fd, void *buf, size_t nbyte); }
SYS_WRITE = 4 // { ssize_t write(int fd, const void *buf, size_t nbyte); }
SYS_OPEN = 5 // { int open(char *path, int flags, int mode); }
SYS_CLOSE = 6 // { int close(int fd); }
SYS_WAIT4 = 7 // { int wait4(int pid, int *status, int options, struct rusage *rusage); }
SYS_LINK = 9 // { int link(char *path, char *link); }
SYS_UNLINK = 10 // { int unlink(char *path); }
SYS_CHDIR = 12 // { int chdir(char *path); }
SYS_FCHDIR = 13 // { int fchdir(int fd); }
SYS_MKNOD = 14 // { int mknod(char *path, int mode, int dev); }
SYS_CHMOD = 15 // { int chmod(char *path, int mode); }
SYS_CHOWN = 16 // { int chown(char *path, int uid, int gid); }
SYS_OBREAK = 17 // { int obreak(char *nsize); } break obreak_args int
SYS_GETPID = 20 // { pid_t getpid(void); }
SYS_MOUNT = 21 // { int mount(char *type, char *path, int flags, caddr_t data); }
SYS_UNMOUNT = 22 // { int unmount(char *path, int flags); }
SYS_SETUID = 23 // { int setuid(uid_t uid); }
SYS_GETUID = 24 // { uid_t getuid(void); }
SYS_GETEUID = 25 // { uid_t geteuid(void); }
SYS_PTRACE = 26 // { int ptrace(int req, pid_t pid, caddr_t addr, int data); }
SYS_RECVMSG = 27 // { int recvmsg(int s, struct msghdr *msg, int flags); }
SYS_SENDMSG = 28 // { int sendmsg(int s, struct msghdr *msg, int flags); }
SYS_RECVFROM = 29 // { int recvfrom(int s, caddr_t buf, size_t len, int flags, struct sockaddr * __restrict from, __socklen_t * __restrict fromlenaddr); }
SYS_ACCEPT = 30 // { int accept(int s, struct sockaddr * __restrict name, __socklen_t * __restrict anamelen); }
SYS_GETPEERNAME = 31 // { int getpeername(int fdes, struct sockaddr * __restrict asa, __socklen_t * __restrict alen); }
SYS_GETSOCKNAME = 32 // { int getsockname(int fdes, struct sockaddr * __restrict asa, __socklen_t * __restrict alen); }
SYS_ACCESS = 33 // { int access(char *path, int amode); }
SYS_CHFLAGS = 34 // { int chflags(const char *path, u_long flags); }
SYS_FCHFLAGS = 35 // { int fchflags(int fd, u_long flags); }
SYS_SYNC = 36 // { int sync(void); }
SYS_KILL = 37 // { int kill(int pid, int signum); }
SYS_GETPPID = 39 // { pid_t getppid(void); }
SYS_DUP = 41 // { int dup(u_int fd); }
SYS_PIPE = 42 // { int pipe(void); }
SYS_GETEGID = 43 // { gid_t getegid(void); }
SYS_PROFIL = 44 // { int profil(caddr_t samples, size_t size, size_t offset, u_int scale); }
SYS_KTRACE = 45 // { int ktrace(const char *fname, int ops, int facs, int pid); }
SYS_GETGID = 47 // { gid_t getgid(void); }
SYS_GETLOGIN = 49 // { int getlogin(char *namebuf, u_int namelen); }
SYS_SETLOGIN = 50 // { int setlogin(char *namebuf); }
SYS_ACCT = 51 // { int acct(char *path); }
SYS_SIGALTSTACK = 53 // { int sigaltstack(stack_t *ss, stack_t *oss); }
SYS_IOCTL = 54 // { int ioctl(int fd, u_long com, caddr_t data); }
SYS_REBOOT = 55 // { int reboot(int opt); }
SYS_REVOKE = 56 // { int revoke(char *path); }
SYS_SYMLINK = 57 // { int symlink(char *path, char *link); }
SYS_READLINK = 58 // { ssize_t readlink(char *path, char *buf, size_t count); }
SYS_EXECVE = 59 // { int execve(char *fname, char **argv, char **envv); }
SYS_UMASK = 60 // { int umask(int newmask); } umask umask_args int
SYS_CHROOT = 61 // { int chroot(char *path); }
SYS_MSYNC = 65 // { int msync(void *addr, size_t len, int flags); }
SYS_VFORK = 66 // { int vfork(void); }
SYS_SBRK = 69 // { int sbrk(int incr); }
SYS_SSTK = 70 // { int sstk(int incr); }
SYS_OVADVISE = 72 // { int ovadvise(int anom); } vadvise ovadvise_args int
SYS_MUNMAP = 73 // { int munmap(void *addr, size_t len); }
SYS_MPROTECT = 74 // { int mprotect(const void *addr, size_t len, int prot); }
SYS_MADVISE = 75 // { int madvise(void *addr, size_t len, int behav); }
SYS_MINCORE = 78 // { int mincore(const void *addr, size_t len, char *vec); }
SYS_GETGROUPS = 79 // { int getgroups(u_int gidsetsize, gid_t *gidset); }
SYS_SETGROUPS = 80 // { int setgroups(u_int gidsetsize, gid_t *gidset); }
SYS_GETPGRP = 81 // { int getpgrp(void); }
SYS_SETPGID = 82 // { int setpgid(int pid, int pgid); }
SYS_SETITIMER = 83 // { int setitimer(u_int which, struct itimerval *itv, struct itimerval *oitv); }
SYS_SWAPON = 85 // { int swapon(char *name); }
SYS_GETITIMER = 86 // { int getitimer(u_int which, struct itimerval *itv); }
SYS_GETDTABLESIZE = 89 // { int getdtablesize(void); }
SYS_DUP2 = 90 // { int dup2(u_int from, u_int to); }
SYS_FCNTL = 92 // { int fcntl(int fd, int cmd, long arg); }
SYS_SELECT = 93 // { int select(int nd, fd_set *in, fd_set *ou, fd_set *ex, struct timeval *tv); }
SYS_FSYNC = 95 // { int fsync(int fd); }
SYS_SETPRIORITY = 96 // { int setpriority(int which, int who, int prio); }
SYS_SOCKET = 97 // { int socket(int domain, int type, int protocol); }
SYS_CONNECT = 98 // { int connect(int s, caddr_t name, int namelen); }
SYS_GETPRIORITY = 100 // { int getpriority(int which, int who); }
SYS_BIND = 104 // { int bind(int s, caddr_t name, int namelen); }
SYS_SETSOCKOPT = 105 // { int setsockopt(int s, int level, int name, caddr_t val, int valsize); }
SYS_LISTEN = 106 // { int listen(int s, int backlog); }
SYS_GETTIMEOFDAY = 116 // { int gettimeofday(struct timeval *tp, struct timezone *tzp); }
SYS_GETRUSAGE = 117 // { int getrusage(int who, struct rusage *rusage); }
SYS_GETSOCKOPT = 118 // { int getsockopt(int s, int level, int name, caddr_t val, int *avalsize); }
SYS_READV = 120 // { int readv(int fd, struct iovec *iovp, u_int iovcnt); }
SYS_WRITEV = 121 // { int writev(int fd, struct iovec *iovp, u_int iovcnt); }
SYS_SETTIMEOFDAY = 122 // { int settimeofday(struct timeval *tv, struct timezone *tzp); }
SYS_FCHOWN = 123 // { int fchown(int fd, int uid, int gid); }
SYS_FCHMOD = 124 // { int fchmod(int fd, int mode); }
SYS_SETREUID = 126 // { int setreuid(int ruid, int euid); }
SYS_SETREGID = 127 // { int setregid(int rgid, int egid); }
SYS_RENAME = 128 // { int rename(char *from, char *to); }
SYS_FLOCK = 131 // { int flock(int fd, int how); }
SYS_MKFIFO = 132 // { int mkfifo(char *path, int mode); }
SYS_SENDTO = 133 // { int sendto(int s, caddr_t buf, size_t len, int flags, caddr_t to, int tolen); }
SYS_SHUTDOWN = 134 // { int shutdown(int s, int how); }
SYS_SOCKETPAIR = 135 // { int socketpair(int domain, int type, int protocol, int *rsv); }
SYS_MKDIR = 136 // { int mkdir(char *path, int mode); }
SYS_RMDIR = 137 // { int rmdir(char *path); }
SYS_UTIMES = 138 // { int utimes(char *path, struct timeval *tptr); }
SYS_ADJTIME = 140 // { int adjtime(struct timeval *delta, struct timeval *olddelta); }
SYS_SETSID = 147 // { int setsid(void); }
SYS_QUOTACTL = 148 // { int quotactl(char *path, int cmd, int uid, caddr_t arg); }
SYS_NLM_SYSCALL = 154 // { int nlm_syscall(int debug_level, int grace_period, int addr_count, char **addrs); }
SYS_NFSSVC = 155 // { int nfssvc(int flag, caddr_t argp); }
SYS_LGETFH = 160 // { int lgetfh(char *fname, struct fhandle *fhp); }
SYS_GETFH = 161 // { int getfh(char *fname, struct fhandle *fhp); }
SYS_SYSARCH = 165 // { int sysarch(int op, char *parms); }
SYS_RTPRIO = 166 // { int rtprio(int function, pid_t pid, struct rtprio *rtp); }
SYS_SEMSYS = 169 // { int semsys(int which, int a2, int a3, int a4, int a5); }
SYS_MSGSYS = 170 // { int msgsys(int which, int a2, int a3, int a4, int a5, int a6); }
SYS_SHMSYS = 171 // { int shmsys(int which, int a2, int a3, int a4); }
SYS_SETFIB = 175 // { int setfib(int fibnum); }
SYS_NTP_ADJTIME = 176 // { int ntp_adjtime(struct timex *tp); }
SYS_SETGID = 181 // { int setgid(gid_t gid); }
SYS_SETEGID = 182 // { int setegid(gid_t egid); }
SYS_SETEUID = 183 // { int seteuid(uid_t euid); }
SYS_STAT = 188 // { int stat(char *path, struct stat *ub); }
SYS_FSTAT = 189 // { int fstat(int fd, struct stat *sb); }
SYS_LSTAT = 190 // { int lstat(char *path, struct stat *ub); }
SYS_PATHCONF = 191 // { int pathconf(char *path, int name); }
SYS_FPATHCONF = 192 // { int fpathconf(int fd, int name); }
SYS_GETRLIMIT = 194 // { int getrlimit(u_int which, struct rlimit *rlp); } getrlimit __getrlimit_args int
SYS_SETRLIMIT = 195 // { int setrlimit(u_int which, struct rlimit *rlp); } setrlimit __setrlimit_args int
SYS_GETDIRENTRIES = 196 // { int getdirentries(int fd, char *buf, u_int count, long *basep); }
SYS___SYSCTL = 202 // { int __sysctl(int *name, u_int namelen, void *old, size_t *oldlenp, void *new, size_t newlen); } __sysctl sysctl_args int
SYS_MLOCK = 203 // { int mlock(const void *addr, size_t len); }
SYS_MUNLOCK = 204 // { int munlock(const void *addr, size_t len); }
SYS_UNDELETE = 205 // { int undelete(char *path); }
SYS_FUTIMES = 206 // { int futimes(int fd, struct timeval *tptr); }
SYS_GETPGID = 207 // { int getpgid(pid_t pid); }
SYS_POLL = 209 // { int poll(struct pollfd *fds, u_int nfds, int timeout); }
SYS_SEMGET = 221 // { int semget(key_t key, int nsems, int semflg); }
SYS_SEMOP = 222 // { int semop(int semid, struct sembuf *sops, size_t nsops); }
SYS_MSGGET = 225 // { int msgget(key_t key, int msgflg); }
SYS_MSGSND = 226 // { int msgsnd(int msqid, const void *msgp, size_t msgsz, int msgflg); }
SYS_MSGRCV = 227 // { int msgrcv(int msqid, void *msgp, size_t msgsz, long msgtyp, int msgflg); }
SYS_SHMAT = 228 // { int shmat(int shmid, const void *shmaddr, int shmflg); }
SYS_SHMDT = 230 // { int shmdt(const void *shmaddr); }
SYS_SHMGET = 231 // { int shmget(key_t key, size_t size, int shmflg); }
SYS_CLOCK_GETTIME = 232 // { int clock_gettime(clockid_t clock_id, struct timespec *tp); }
SYS_CLOCK_SETTIME = 233 // { int clock_settime( clockid_t clock_id, const struct timespec *tp); }
SYS_CLOCK_GETRES = 234 // { int clock_getres(clockid_t clock_id, struct timespec *tp); }
SYS_KTIMER_CREATE = 235 // { int ktimer_create(clockid_t clock_id, struct sigevent *evp, int *timerid); }
SYS_KTIMER_DELETE = 236 // { int ktimer_delete(int timerid); }
SYS_KTIMER_SETTIME = 237 // { int ktimer_settime(int timerid, int flags, const struct itimerspec *value, struct itimerspec *ovalue); }
SYS_KTIMER_GETTIME = 238 // { int ktimer_gettime(int timerid, struct itimerspec *value); }
SYS_KTIMER_GETOVERRUN = 239 // { int ktimer_getoverrun(int timerid); }
SYS_NANOSLEEP = 240 // { int nanosleep(const struct timespec *rqtp, struct timespec *rmtp); }
SYS_FFCLOCK_GETCOUNTER = 241 // { int ffclock_getcounter(ffcounter *ffcount); }
SYS_FFCLOCK_SETESTIMATE = 242 // { int ffclock_setestimate( struct ffclock_estimate *cest); }
SYS_FFCLOCK_GETESTIMATE = 243 // { int ffclock_getestimate( struct ffclock_estimate *cest); }
SYS_CLOCK_NANOSLEEP = 244 // { int clock_nanosleep(clockid_t clock_id, int flags, const struct timespec *rqtp, struct timespec *rmtp); }
SYS_CLOCK_GETCPUCLOCKID2 = 247 // { int clock_getcpuclockid2(id_t id,int which, clockid_t *clock_id); }
SYS_NTP_GETTIME = 248 // { int ntp_gettime(struct ntptimeval *ntvp); }
SYS_MINHERIT = 250 // { int minherit(void *addr, size_t len, int inherit); }
SYS_RFORK = 251 // { int rfork(int flags); }
SYS_OPENBSD_POLL = 252 // { int openbsd_poll(struct pollfd *fds, u_int nfds, int timeout); }
SYS_ISSETUGID = 253 // { int issetugid(void); }
SYS_LCHOWN = 254 // { int lchown(char *path, int uid, int gid); }
SYS_AIO_READ = 255 // { int aio_read(struct aiocb *aiocbp); }
SYS_AIO_WRITE = 256 // { int aio_write(struct aiocb *aiocbp); }
SYS_LIO_LISTIO = 257 // { int lio_listio(int mode, struct aiocb * const *acb_list, int nent, struct sigevent *sig); }
SYS_GETDENTS = 272 // { int getdents(int fd, char *buf, size_t count); }
SYS_LCHMOD = 274 // { int lchmod(char *path, mode_t mode); }
SYS_LUTIMES = 276 // { int lutimes(char *path, struct timeval *tptr); }
SYS_NSTAT = 278 // { int nstat(char *path, struct nstat *ub); }
SYS_NFSTAT = 279 // { int nfstat(int fd, struct nstat *sb); }
SYS_NLSTAT = 280 // { int nlstat(char *path, struct nstat *ub); }
SYS_PREADV = 289 // { ssize_t preadv(int fd, struct iovec *iovp, u_int iovcnt, off_t offset); }
SYS_PWRITEV = 290 // { ssize_t pwritev(int fd, struct iovec *iovp, u_int iovcnt, off_t offset); }
SYS_FHOPEN = 298 // { int fhopen(const struct fhandle *u_fhp, int flags); }
SYS_FHSTAT = 299 // { int fhstat(const struct fhandle *u_fhp, struct stat *sb); }
SYS_MODNEXT = 300 // { int modnext(int modid); }
SYS_MODSTAT = 301 // { int modstat(int modid, struct module_stat *stat); }
SYS_MODFNEXT = 302 // { int modfnext(int modid); }
SYS_MODFIND = 303 // { int modfind(const char *name); }
SYS_KLDLOAD = 304 // { int kldload(const char *file); }
SYS_KLDUNLOAD = 305 // { int kldunload(int fileid); }
SYS_KLDFIND = 306 // { int kldfind(const char *file); }
SYS_KLDNEXT = 307 // { int kldnext(int fileid); }
SYS_KLDSTAT = 308 // { int kldstat(int fileid, struct kld_file_stat* stat); }
SYS_KLDFIRSTMOD = 309 // { int kldfirstmod(int fileid); }
SYS_GETSID = 310 // { int getsid(pid_t pid); }
SYS_SETRESUID = 311 // { int setresuid(uid_t ruid, uid_t euid, uid_t suid); }
SYS_SETRESGID = 312 // { int setresgid(gid_t rgid, gid_t egid, gid_t sgid); }
SYS_AIO_RETURN = 314 // { ssize_t aio_return(struct aiocb *aiocbp); }
SYS_AIO_SUSPEND = 315 // { int aio_suspend( struct aiocb * const * aiocbp, int nent, const struct timespec *timeout); }
SYS_AIO_CANCEL = 316 // { int aio_cancel(int fd, struct aiocb *aiocbp); }
SYS_AIO_ERROR = 317 // { int aio_error(struct aiocb *aiocbp); }
SYS_YIELD = 321 // { int yield(void); }
SYS_MLOCKALL = 324 // { int mlockall(int how); }
SYS_MUNLOCKALL = 325 // { int munlockall(void); }
SYS___GETCWD = 326 // { int __getcwd(char *buf, u_int buflen); }
SYS_SCHED_SETPARAM = 327 // { int sched_setparam (pid_t pid, const struct sched_param *param); }
SYS_SCHED_GETPARAM = 328 // { int sched_getparam (pid_t pid, struct sched_param *param); }
SYS_SCHED_SETSCHEDULER = 329 // { int sched_setscheduler (pid_t pid, int policy, const struct sched_param *param); }
SYS_SCHED_GETSCHEDULER = 330 // { int sched_getscheduler (pid_t pid); }
SYS_SCHED_YIELD = 331 // { int sched_yield (void); }
SYS_SCHED_GET_PRIORITY_MAX = 332 // { int sched_get_priority_max (int policy); }
SYS_SCHED_GET_PRIORITY_MIN = 333 // { int sched_get_priority_min (int policy); }
SYS_SCHED_RR_GET_INTERVAL = 334 // { int sched_rr_get_interval (pid_t pid, struct timespec *interval); }
SYS_UTRACE = 335 // { int utrace(const void *addr, size_t len); }
SYS_KLDSYM = 337 // { int kldsym(int fileid, int cmd, void *data); }
SYS_JAIL = 338 // { int jail(struct jail *jail); }
SYS_SIGPROCMASK = 340 // { int sigprocmask(int how, const sigset_t *set, sigset_t *oset); }
SYS_SIGSUSPEND = 341 // { int sigsuspend(const sigset_t *sigmask); }
SYS_SIGPENDING = 343 // { int sigpending(sigset_t *set); }
SYS_SIGTIMEDWAIT = 345 // { int sigtimedwait(const sigset_t *set, siginfo_t *info, const struct timespec *timeout); }
SYS_SIGWAITINFO = 346 // { int sigwaitinfo(const sigset_t *set, siginfo_t *info); }
SYS___ACL_GET_FILE = 347 // { int __acl_get_file(const char *path, acl_type_t type, struct acl *aclp); }
SYS___ACL_SET_FILE = 348 // { int __acl_set_file(const char *path, acl_type_t type, struct acl *aclp); }
SYS___ACL_GET_FD = 349 // { int __acl_get_fd(int filedes, acl_type_t type, struct acl *aclp); }
SYS___ACL_SET_FD = 350 // { int __acl_set_fd(int filedes, acl_type_t type, struct acl *aclp); }
SYS___ACL_DELETE_FILE = 351 // { int __acl_delete_file(const char *path, acl_type_t type); }
SYS___ACL_DELETE_FD = 352 // { int __acl_delete_fd(int filedes, acl_type_t type); }
SYS___ACL_ACLCHECK_FILE = 353 // { int __acl_aclcheck_file(const char *path, acl_type_t type, struct acl *aclp); }
SYS___ACL_ACLCHECK_FD = 354 // { int __acl_aclcheck_fd(int filedes, acl_type_t type, struct acl *aclp); }
SYS_EXTATTRCTL = 355 // { int extattrctl(const char *path, int cmd, const char *filename, int attrnamespace, const char *attrname); }
SYS_EXTATTR_SET_FILE = 356 // { ssize_t extattr_set_file( const char *path, int attrnamespace, const char *attrname, void *data, size_t nbytes); }
SYS_EXTATTR_GET_FILE = 357 // { ssize_t extattr_get_file( const char *path, int attrnamespace, const char *attrname, void *data, size_t nbytes); }
SYS_EXTATTR_DELETE_FILE = 358 // { int extattr_delete_file(const char *path, int attrnamespace, const char *attrname); }
SYS_AIO_WAITCOMPLETE = 359 // { ssize_t aio_waitcomplete( struct aiocb **aiocbp, struct timespec *timeout); }
SYS_GETRESUID = 360 // { int getresuid(uid_t *ruid, uid_t *euid, uid_t *suid); }
SYS_GETRESGID = 361 // { int getresgid(gid_t *rgid, gid_t *egid, gid_t *sgid); }
SYS_KQUEUE = 362 // { int kqueue(void); }
SYS_KEVENT = 363 // { int kevent(int fd, struct kevent *changelist, int nchanges, struct kevent *eventlist, int nevents, const struct timespec *timeout); }
SYS_EXTATTR_SET_FD = 371 // { ssize_t extattr_set_fd(int fd, int attrnamespace, const char *attrname, void *data, size_t nbytes); }
SYS_EXTATTR_GET_FD = 372 // { ssize_t extattr_get_fd(int fd, int attrnamespace, const char *attrname, void *data, size_t nbytes); }
SYS_EXTATTR_DELETE_FD = 373 // { int extattr_delete_fd(int fd, int attrnamespace, const char *attrname); }
SYS___SETUGID = 374 // { int __setugid(int flag); }
SYS_EACCESS = 376 // { int eaccess(char *path, int amode); }
SYS_NMOUNT = 378 // { int nmount(struct iovec *iovp, unsigned int iovcnt, int flags); }
SYS___MAC_GET_PROC = 384 // { int __mac_get_proc(struct mac *mac_p); }
SYS___MAC_SET_PROC = 385 // { int __mac_set_proc(struct mac *mac_p); }
SYS___MAC_GET_FD = 386 // { int __mac_get_fd(int fd, struct mac *mac_p); }
SYS___MAC_GET_FILE = 387 // { int __mac_get_file(const char *path_p, struct mac *mac_p); }
SYS___MAC_SET_FD = 388 // { int __mac_set_fd(int fd, struct mac *mac_p); }
SYS___MAC_SET_FILE = 389 // { int __mac_set_file(const char *path_p, struct mac *mac_p); }
SYS_KENV = 390 // { int kenv(int what, const char *name, char *value, int len); }
SYS_LCHFLAGS = 391 // { int lchflags(const char *path, u_long flags); }
SYS_UUIDGEN = 392 // { int uuidgen(struct uuid *store, int count); }
SYS_SENDFILE = 393 // { int sendfile(int fd, int s, off_t offset, size_t nbytes, struct sf_hdtr *hdtr, off_t *sbytes, int flags); }
SYS_MAC_SYSCALL = 394 // { int mac_syscall(const char *policy, int call, void *arg); }
SYS_GETFSSTAT = 395 // { int getfsstat(struct statfs *buf, long bufsize, int mode); }
SYS_STATFS = 396 // { int statfs(char *path, struct statfs *buf); }
SYS_FSTATFS = 397 // { int fstatfs(int fd, struct statfs *buf); }
SYS_FHSTATFS = 398 // { int fhstatfs(const struct fhandle *u_fhp, struct statfs *buf); }
SYS_KSEM_CLOSE = 400 // { int ksem_close(semid_t id); }
SYS_KSEM_POST = 401 // { int ksem_post(semid_t id); }
SYS_KSEM_WAIT = 402 // { int ksem_wait(semid_t id); }
SYS_KSEM_TRYWAIT = 403 // { int ksem_trywait(semid_t id); }
SYS_KSEM_INIT = 404 // { int ksem_init(semid_t *idp, unsigned int value); }
SYS_KSEM_OPEN = 405 // { int ksem_open(semid_t *idp, const char *name, int oflag, mode_t mode, unsigned int value); }
SYS_KSEM_UNLINK = 406 // { int ksem_unlink(const char *name); }
SYS_KSEM_GETVALUE = 407 // { int ksem_getvalue(semid_t id, int *val); }
SYS_KSEM_DESTROY = 408 // { int ksem_destroy(semid_t id); }
SYS___MAC_GET_PID = 409 // { int __mac_get_pid(pid_t pid, struct mac *mac_p); }
SYS___MAC_GET_LINK = 410 // { int __mac_get_link(const char *path_p, struct mac *mac_p); }
SYS___MAC_SET_LINK = 411 // { int __mac_set_link(const char *path_p, struct mac *mac_p); }
SYS_EXTATTR_SET_LINK = 412 // { ssize_t extattr_set_link( const char *path, int attrnamespace, const char *attrname, void *data, size_t nbytes); }
SYS_EXTATTR_GET_LINK = 413 // { ssize_t extattr_get_link( const char *path, int attrnamespace, const char *attrname, void *data, size_t nbytes); }
SYS_EXTATTR_DELETE_LINK = 414 // { int extattr_delete_link( const char *path, int attrnamespace, const char *attrname); }
SYS___MAC_EXECVE = 415 // { int __mac_execve(char *fname, char **argv, char **envv, struct mac *mac_p); }
SYS_SIGACTION = 416 // { int sigaction(int sig, const struct sigaction *act, struct sigaction *oact); }
SYS_SIGRETURN = 417 // { int sigreturn( const struct __ucontext *sigcntxp); }
SYS_GETCONTEXT = 421 // { int getcontext(struct __ucontext *ucp); }
SYS_SETCONTEXT = 422 // { int setcontext( const struct __ucontext *ucp); }
SYS_SWAPCONTEXT = 423 // { int swapcontext(struct __ucontext *oucp, const struct __ucontext *ucp); }
SYS_SWAPOFF = 424 // { int swapoff(const char *name); }
SYS___ACL_GET_LINK = 425 // { int __acl_get_link(const char *path, acl_type_t type, struct acl *aclp); }
SYS___ACL_SET_LINK = 426 // { int __acl_set_link(const char *path, acl_type_t type, struct acl *aclp); }
SYS___ACL_DELETE_LINK = 427 // { int __acl_delete_link(const char *path, acl_type_t type); }
SYS___ACL_ACLCHECK_LINK = 428 // { int __acl_aclcheck_link(const char *path, acl_type_t type, struct acl *aclp); }
SYS_SIGWAIT = 429 // { int sigwait(const sigset_t *set, int *sig); }
SYS_THR_CREATE = 430 // { int thr_create(ucontext_t *ctx, long *id, int flags); }
SYS_THR_EXIT = 431 // { void thr_exit(long *state); }
SYS_THR_SELF = 432 // { int thr_self(long *id); }
SYS_THR_KILL = 433 // { int thr_kill(long id, int sig); }
SYS_JAIL_ATTACH = 436 // { int jail_attach(int jid); }
SYS_EXTATTR_LIST_FD = 437 // { ssize_t extattr_list_fd(int fd, int attrnamespace, void *data, size_t nbytes); }
SYS_EXTATTR_LIST_FILE = 438 // { ssize_t extattr_list_file( const char *path, int attrnamespace, void *data, size_t nbytes); }
SYS_EXTATTR_LIST_LINK = 439 // { ssize_t extattr_list_link( const char *path, int attrnamespace, void *data, size_t nbytes); }
SYS_KSEM_TIMEDWAIT = 441 // { int ksem_timedwait(semid_t id, const struct timespec *abstime); }
SYS_THR_SUSPEND = 442 // { int thr_suspend( const struct timespec *timeout); }
SYS_THR_WAKE = 443 // { int thr_wake(long id); }
SYS_KLDUNLOADF = 444 // { int kldunloadf(int fileid, int flags); }
SYS_AUDIT = 445 // { int audit(const void *record, u_int length); }
SYS_AUDITON = 446 // { int auditon(int cmd, void *data, u_int length); }
SYS_GETAUID = 447 // { int getauid(uid_t *auid); }
SYS_SETAUID = 448 // { int setauid(uid_t *auid); }
SYS_GETAUDIT = 449 // { int getaudit(struct auditinfo *auditinfo); }
SYS_SETAUDIT = 450 // { int setaudit(struct auditinfo *auditinfo); }
SYS_GETAUDIT_ADDR = 451 // { int getaudit_addr( struct auditinfo_addr *auditinfo_addr, u_int length); }
SYS_SETAUDIT_ADDR = 452 // { int setaudit_addr( struct auditinfo_addr *auditinfo_addr, u_int length); }
SYS_AUDITCTL = 453 // { int auditctl(char *path); }
SYS__UMTX_OP = 454 // { int _umtx_op(void *obj, int op, u_long val, void *uaddr1, void *uaddr2); }
SYS_THR_NEW = 455 // { int thr_new(struct thr_param *param, int param_size); }
SYS_SIGQUEUE = 456 // { int sigqueue(pid_t pid, int signum, void *value); }
SYS_KMQ_OPEN = 457 // { int kmq_open(const char *path, int flags, mode_t mode, const struct mq_attr *attr); }
SYS_KMQ_SETATTR = 458 // { int kmq_setattr(int mqd, const struct mq_attr *attr, struct mq_attr *oattr); }
SYS_KMQ_TIMEDRECEIVE = 459 // { int kmq_timedreceive(int mqd, char *msg_ptr, size_t msg_len, unsigned *msg_prio, const struct timespec *abs_timeout); }
SYS_KMQ_TIMEDSEND = 460 // { int kmq_timedsend(int mqd, const char *msg_ptr, size_t msg_len,unsigned msg_prio, const struct timespec *abs_timeout);}
SYS_KMQ_NOTIFY = 461 // { int kmq_notify(int mqd, const struct sigevent *sigev); }
SYS_KMQ_UNLINK = 462 // { int kmq_unlink(const char *path); }
SYS_ABORT2 = 463 // { int abort2(const char *why, int nargs, void **args); }
SYS_THR_SET_NAME = 464 // { int thr_set_name(long id, const char *name); }
SYS_AIO_FSYNC = 465 // { int aio_fsync(int op, struct aiocb *aiocbp); }
SYS_RTPRIO_THREAD = 466 // { int rtprio_thread(int function, lwpid_t lwpid, struct rtprio *rtp); }
SYS_SCTP_PEELOFF = 471 // { int sctp_peeloff(int sd, uint32_t name); }
SYS_SCTP_GENERIC_SENDMSG = 472 // { int sctp_generic_sendmsg(int sd, caddr_t msg, int mlen, caddr_t to, __socklen_t tolen, struct sctp_sndrcvinfo *sinfo, int flags); }
SYS_SCTP_GENERIC_SENDMSG_IOV = 473 // { int sctp_generic_sendmsg_iov(int sd, struct iovec *iov, int iovlen, caddr_t to, __socklen_t tolen, struct sctp_sndrcvinfo *sinfo, int flags); }
SYS_SCTP_GENERIC_RECVMSG = 474 // { int sctp_generic_recvmsg(int sd, struct iovec *iov, int iovlen, struct sockaddr * from, __socklen_t *fromlenaddr, struct sctp_sndrcvinfo *sinfo, int *msg_flags); }
SYS_PREAD = 475 // { ssize_t pread(int fd, void *buf, size_t nbyte, off_t offset); }
SYS_PWRITE = 476 // { ssize_t pwrite(int fd, const void *buf, size_t nbyte, off_t offset); }
SYS_MMAP = 477 // { caddr_t mmap(caddr_t addr, size_t len, int prot, int flags, int fd, off_t pos); }
SYS_LSEEK = 478 // { off_t lseek(int fd, off_t offset, int whence); }
SYS_TRUNCATE = 479 // { int truncate(char *path, off_t length); }
SYS_FTRUNCATE = 480 // { int ftruncate(int fd, off_t length); }
SYS_THR_KILL2 = 481 // { int thr_kill2(pid_t pid, long id, int sig); }
SYS_SHM_OPEN = 482 // { int shm_open(const char *path, int flags, mode_t mode); }
SYS_SHM_UNLINK = 483 // { int shm_unlink(const char *path); }
SYS_CPUSET = 484 // { int cpuset(cpusetid_t *setid); }
SYS_CPUSET_SETID = 485 // { int cpuset_setid(cpuwhich_t which, id_t id, cpusetid_t setid); }
SYS_CPUSET_GETID = 486 // { int cpuset_getid(cpulevel_t level, cpuwhich_t which, id_t id, cpusetid_t *setid); }
SYS_CPUSET_GETAFFINITY = 487 // { int cpuset_getaffinity(cpulevel_t level, cpuwhich_t which, id_t id, size_t cpusetsize, cpuset_t *mask); }
SYS_CPUSET_SETAFFINITY = 488 // { int cpuset_setaffinity(cpulevel_t level, cpuwhich_t which, id_t id, size_t cpusetsize, const cpuset_t *mask); }
SYS_FACCESSAT = 489 // { int faccessat(int fd, char *path, int amode, int flag); }
SYS_FCHMODAT = 490 // { int fchmodat(int fd, char *path, mode_t mode, int flag); }
SYS_FCHOWNAT = 491 // { int fchownat(int fd, char *path, uid_t uid, gid_t gid, int flag); }
SYS_FEXECVE = 492 // { int fexecve(int fd, char **argv, char **envv); }
SYS_FSTATAT = 493 // { int fstatat(int fd, char *path, struct stat *buf, int flag); }
SYS_FUTIMESAT = 494 // { int futimesat(int fd, char *path, struct timeval *times); }
SYS_LINKAT = 495 // { int linkat(int fd1, char *path1, int fd2, char *path2, int flag); }
SYS_MKDIRAT = 496 // { int mkdirat(int fd, char *path, mode_t mode); }
SYS_MKFIFOAT = 497 // { int mkfifoat(int fd, char *path, mode_t mode); }
SYS_MKNODAT = 498 // { int mknodat(int fd, char *path, mode_t mode, dev_t dev); }
SYS_OPENAT = 499 // { int openat(int fd, char *path, int flag, mode_t mode); }
SYS_READLINKAT = 500 // { int readlinkat(int fd, char *path, char *buf, size_t bufsize); }
SYS_RENAMEAT = 501 // { int renameat(int oldfd, char *old, int newfd, char *new); }
SYS_SYMLINKAT = 502 // { int symlinkat(char *path1, int fd, char *path2); }
SYS_UNLINKAT = 503 // { int unlinkat(int fd, char *path, int flag); }
SYS_POSIX_OPENPT = 504 // { int posix_openpt(int flags); }
SYS_GSSD_SYSCALL = 505 // { int gssd_syscall(char *path); }
SYS_JAIL_GET = 506 // { int jail_get(struct iovec *iovp, unsigned int iovcnt, int flags); }
SYS_JAIL_SET = 507 // { int jail_set(struct iovec *iovp, unsigned int iovcnt, int flags); }
SYS_JAIL_REMOVE = 508 // { int jail_remove(int jid); }
SYS_CLOSEFROM = 509 // { int closefrom(int lowfd); }
SYS___SEMCTL = 510 // { int __semctl(int semid, int semnum, int cmd, union semun *arg); }
SYS_MSGCTL = 511 // { int msgctl(int msqid, int cmd, struct msqid_ds *buf); }
SYS_SHMCTL = 512 // { int shmctl(int shmid, int cmd, struct shmid_ds *buf); }
SYS_LPATHCONF = 513 // { int lpathconf(char *path, int name); }
SYS___CAP_RIGHTS_GET = 515 // { int __cap_rights_get(int version, int fd, cap_rights_t *rightsp); }
SYS_CAP_ENTER = 516 // { int cap_enter(void); }
SYS_CAP_GETMODE = 517 // { int cap_getmode(u_int *modep); }
SYS_PDFORK = 518 // { int pdfork(int *fdp, int flags); }
SYS_PDKILL = 519 // { int pdkill(int fd, int signum); }
SYS_PDGETPID = 520 // { int pdgetpid(int fd, pid_t *pidp); }
SYS_PSELECT = 522 // { int pselect(int nd, fd_set *in, fd_set *ou, fd_set *ex, const struct timespec *ts, const sigset_t *sm); }
SYS_GETLOGINCLASS = 523 // { int getloginclass(char *namebuf, size_t namelen); }
SYS_SETLOGINCLASS = 524 // { int setloginclass(const char *namebuf); }
SYS_RCTL_GET_RACCT = 525 // { int rctl_get_racct(const void *inbufp, size_t inbuflen, void *outbufp, size_t outbuflen); }
SYS_RCTL_GET_RULES = 526 // { int rctl_get_rules(const void *inbufp, size_t inbuflen, void *outbufp, size_t outbuflen); }
SYS_RCTL_GET_LIMITS = 527 // { int rctl_get_limits(const void *inbufp, size_t inbuflen, void *outbufp, size_t outbuflen); }
SYS_RCTL_ADD_RULE = 528 // { int rctl_add_rule(const void *inbufp, size_t inbuflen, void *outbufp, size_t outbuflen); }
SYS_RCTL_REMOVE_RULE = 529 // { int rctl_remove_rule(const void *inbufp, size_t inbuflen, void *outbufp, size_t outbuflen); }
SYS_POSIX_FALLOCATE = 530 // { int posix_fallocate(int fd, off_t offset, off_t len); }
SYS_POSIX_FADVISE = 531 // { int posix_fadvise(int fd, off_t offset, off_t len, int advice); }
SYS_WAIT6 = 532 // { int wait6(idtype_t idtype, id_t id, int *status, int options, struct __wrusage *wrusage, siginfo_t *info); }
SYS_CAP_RIGHTS_LIMIT = 533 // { int cap_rights_limit(int fd, cap_rights_t *rightsp); }
SYS_CAP_IOCTLS_LIMIT = 534 // { int cap_ioctls_limit(int fd, const u_long *cmds, size_t ncmds); }
SYS_CAP_IOCTLS_GET = 535 // { ssize_t cap_ioctls_get(int fd, u_long *cmds, size_t maxcmds); }
SYS_CAP_FCNTLS_LIMIT = 536 // { int cap_fcntls_limit(int fd, uint32_t fcntlrights); }
SYS_CAP_FCNTLS_GET = 537 // { int cap_fcntls_get(int fd, uint32_t *fcntlrightsp); }
SYS_BINDAT = 538 // { int bindat(int fd, int s, caddr_t name, int namelen); }
SYS_CONNECTAT = 539 // { int connectat(int fd, int s, caddr_t name, int namelen); }
SYS_CHFLAGSAT = 540 // { int chflagsat(int fd, const char *path, u_long flags, int atflag); }
SYS_ACCEPT4 = 541 // { int accept4(int s, struct sockaddr * __restrict name, __socklen_t * __restrict anamelen, int flags); }
SYS_PIPE2 = 542 // { int pipe2(int *fildes, int flags); }
SYS_AIO_MLOCK = 543 // { int aio_mlock(struct aiocb *aiocbp); }
SYS_PROCCTL = 544 // { int procctl(idtype_t idtype, id_t id, int com, void *data); }
SYS_PPOLL = 545 // { int ppoll(struct pollfd *fds, u_int nfds, const struct timespec *ts, const sigset_t *set); }
SYS_FUTIMENS = 546 // { int futimens(int fd, struct timespec *times); }
SYS_UTIMENSAT = 547 // { int utimensat(int fd, char *path, struct timespec *times, int flag); }
SYS_NUMA_GETAFFINITY = 548 // { int numa_getaffinity(cpuwhich_t which, id_t id, struct vm_domain_policy_entry *policy); }
SYS_NUMA_SETAFFINITY = 549 // { int numa_setaffinity(cpuwhich_t which, id_t id, const struct vm_domain_policy_entry *policy); }
SYS_FDATASYNC = 550 // { int fdatasync(int fd); }
)
| {
"pile_set_name": "Github"
} |
<component name="libraryTable">
<library name="Maven: io.grpc:grpc-okhttp:1.0.1">
<CLASSES>
<root url="jar://$MAVEN_REPOSITORY$/io/grpc/grpc-okhttp/1.0.1/grpc-okhttp-1.0.1.jar!/" />
</CLASSES>
<JAVADOC>
<root url="jar://$MAVEN_REPOSITORY$/io/grpc/grpc-okhttp/1.0.1/grpc-okhttp-1.0.1-javadoc.jar!/" />
</JAVADOC>
<SOURCES>
<root url="jar://$MAVEN_REPOSITORY$/io/grpc/grpc-okhttp/1.0.1/grpc-okhttp-1.0.1-sources.jar!/" />
</SOURCES>
</library>
</component> | {
"pile_set_name": "Github"
} |
package com.common.myutil.base;
import android.content.Context;
import android.content.SharedPreferences;
/**
* sharePreferences封装类
* Created by wangzekeng on 2017/3/7.
*/
public abstract class BaseSharePreferences {
protected static String fileName = "default";
protected static int mode = Context.MODE_PRIVATE;
private static SharedPreferences getSharedPreferences(Context context) {
return context.getSharedPreferences(fileName, mode);
}
private static SharedPreferences.Editor getEditor(Context context) {
return getSharedPreferences(context).edit();
}
public static boolean getBoolean(Context context, String key, boolean defValue) {
SharedPreferences sp = getSharedPreferences(context);
return sp.getBoolean(key, defValue);
}
public static int getInt(Context context, String key, int defValue) {
SharedPreferences sp = getSharedPreferences(context);
return sp.getInt(key, defValue);
}
public static float getFloat(Context context, String key, float defValue) {
SharedPreferences sp = getSharedPreferences(context);
return sp.getFloat(key, defValue);
}
public static long getLong(Context context, String key, long defValue) {
SharedPreferences sp = getSharedPreferences(context);
return sp.getLong(key, defValue);
}
public static String getString(Context context, String key, String defValue) {
SharedPreferences sp = getSharedPreferences(context);
return sp.getString(key, defValue);
}
public static void putBoolean(Context context, String key, boolean value) {
SharedPreferences.Editor editor = getEditor(context);
editor.putBoolean(key, value);
editor.commit();
}
public static void putInt(Context context, String key, int value) {
SharedPreferences.Editor editor = getEditor(context);
editor.putInt(key, value);
editor.commit();
}
public static void putFloat(Context context, String key, float value) {
SharedPreferences.Editor editor = getEditor(context);
editor.putFloat(key, value);
editor.commit();
}
public static void putLong(Context context, String key, long value) {
SharedPreferences.Editor editor = getEditor(context);
editor.putLong(key, value);
editor.commit();
}
public static void putString(Context context, String key, String value) {
SharedPreferences.Editor editor = getEditor(context);
editor.putString(key, value);
editor.commit();
}
public static void remove(Context context, String key) {
SharedPreferences.Editor editor = getEditor(context);
editor.remove(key);
editor.commit();
}
public static void clear(Context context) {
SharedPreferences.Editor editor = getEditor(context);
editor.clear();
editor.commit();
}
}
| {
"pile_set_name": "Github"
} |
// Copyright Aleksey Gurtovoy 2002-2004
//
// Distributed under the Boost Software License, Version 1.0.
// (See accompanying file LICENSE_1_0.txt or copy at
// http://www.boost.org/LICENSE_1_0.txt)
//
// Preprocessed version of "boost/mpl/unpack_args.hpp" header
// -- DO NOT modify by hand!
namespace boost { namespace mpl {
namespace aux {
template< int size, typename F, typename Args >
struct unpack_args_impl;
template< typename F, typename Args >
struct unpack_args_impl< 0,F,Args >
: apply0<
F
>
{
};
template< typename F, typename Args >
struct unpack_args_impl< 1,F,Args >
: apply1<
F
, typename at_c< Args,0 >::type
>
{
};
template< typename F, typename Args >
struct unpack_args_impl< 2,F,Args >
: apply2<
F
, typename at_c< Args,0 >::type, typename at_c< Args,1 >::type
>
{
};
template< typename F, typename Args >
struct unpack_args_impl< 3,F,Args >
: apply3<
F
, typename at_c< Args,0 >::type, typename at_c< Args,1 >::type
, typename at_c< Args,2 >::type
>
{
};
template< typename F, typename Args >
struct unpack_args_impl< 4,F,Args >
: apply4<
F
, typename at_c< Args,0 >::type, typename at_c< Args,1 >::type
, typename at_c< Args,2 >::type, typename at_c< Args,3 >::type
>
{
};
template< typename F, typename Args >
struct unpack_args_impl< 5,F,Args >
: apply5<
F
, typename at_c< Args,0 >::type, typename at_c< Args,1 >::type
, typename at_c< Args,2 >::type, typename at_c< Args,3 >::type
, typename at_c< Args,4 >::type
>
{
};
}
template<
typename F
>
struct unpack_args
{
template< typename Args > struct apply
: aux::unpack_args_impl< size<Args>::value,F, Args >
{
};
};
BOOST_MPL_AUX_PASS_THROUGH_LAMBDA_SPEC(1, unpack_args)
}}
| {
"pile_set_name": "Github"
} |
<?xml version="1.0" encoding="UTF-8"?>
<configuration>
<appender name="CONSOLE_APPENDER" class="ch.qos.logback.core.ConsoleAppender">
<encoder>
<pattern>%highlight(%d{MMM-dd HH:mm:ss.SSS} [%thread] %-5level %logger{30}: %msg %xEx%n)</pattern>
</encoder>
</appender>
<root level="TRACE">
<appender-ref ref="CONSOLE_APPENDER"/>
</root>
<logger name="com.neemre.btcdcli4j" level="WARN"/>
<!-- <logger name="bisq.core.provider" level="WARN"/>
<logger name="bisq.network" level="WARN"/>-->
</configuration>
| {
"pile_set_name": "Github"
} |
// iteration_node.hpp
// Copyright (c) 2007-2009 Ben Hanson (http://www.benhanson.net/)
//
// Distributed under the Boost Software License, Version 1.0. (See accompanying
// file licence_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
#ifndef BOOST_LEXER_ITERATION_NODE_HPP
#define BOOST_LEXER_ITERATION_NODE_HPP
#include "node.hpp"
namespace boost
{
namespace lexer
{
namespace detail
{
class iteration_node : public node
{
public:
iteration_node (node *next_, const bool greedy_) :
node (true),
_next (next_),
_greedy (greedy_)
{
node_vector::iterator iter_;
node_vector::iterator end_;
_next->append_firstpos (_firstpos);
_next->append_lastpos (_lastpos);
for (iter_ = _lastpos.begin (), end_ = _lastpos.end ();
iter_ != end_; ++iter_)
{
(*iter_)->append_followpos (_firstpos);
}
for (iter_ = _firstpos.begin (), end_ = _firstpos.end ();
iter_ != end_; ++iter_)
{
(*iter_)->greedy (greedy_);
}
}
virtual ~iteration_node ()
{
}
virtual type what_type () const
{
return ITERATION;
}
virtual bool traverse (const_node_stack &node_stack_,
bool_stack &perform_op_stack_) const
{
perform_op_stack_.push (true);
node_stack_.push (_next);
return true;
}
private:
// Not owner of this pointer...
node *_next;
bool _greedy;
virtual void copy_node (node_ptr_vector &node_ptr_vector_,
node_stack &new_node_stack_, bool_stack &perform_op_stack_,
bool &down_) const
{
if (perform_op_stack_.top ())
{
node *ptr_ = new_node_stack_.top ();
node_ptr_vector_->push_back (static_cast<iteration_node *>(0));
node_ptr_vector_->back () = new iteration_node (ptr_, _greedy);
new_node_stack_.top () = node_ptr_vector_->back ();
}
else
{
down_ = true;
}
perform_op_stack_.pop ();
}
};
}
}
}
#endif
| {
"pile_set_name": "Github"
} |
<testcase>
<info>
<keywords>
SFTP
post-quote
</keywords>
</info>
#
# Server-side
<reply>
<data>
Test file for rename test
</data>
</reply>
#
# Client-side
<client>
<server>
sftp
</server>
<name>
SFTP post-quote rename
</name>
<command>
--key curl_client_key --pubkey curl_client_key.pub -u %USER: -Q "-rename %PWD/log/file608.txt %PWD/log/file608-renamed.txt" sftp://%HOSTIP:%SSHPORT%POSIX_PWD/log/file608.txt --insecure
</command>
# Verify that the file was renamed properly, then rename the file back to what
# it was so the verify section works and the file can be cleaned up.
<postcheck>
perl %SRCDIR/libtest/test610.pl gone %PWD/log/file608.txt move %PWD/log/file608-renamed.txt %PWD/log/file608.txt
</postcheck>
<file name="log/file608.txt">
Test file for rename test
</file>
</client>
#
# Verify data after the test has been "shot"
<verify>
<file name="log/file608.txt">
Test file for rename test
</file>
<valgrind>
disable
</valgrind>
</verify>
</testcase>
| {
"pile_set_name": "Github"
} |
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>beforeRunningCommand</key>
<string>nop</string>
<key>command</key>
<string>#!/usr/bin/env php
<?php
require $_SERVER['TM_BUNDLE_SUPPORT'] . '/bootstrap.php';
include textmate_find_command('theme_dashboard_disabled_block');
</string>
<key>input</key>
<string>none</string>
<key>name</key>
<string>theme_dashboard_disabled_block</string>
<key>output</key>
<string>insertAsSnippet</string>
<key>scope</key>
<string>source.php</string>
<key>tabTrigger</key>
<string>theme_dashboard_disabled_block</string>
<key>uuid</key>
<string>607B26CC-096C-491B-B99F-163C007F2750</string>
</dict>
</plist>
| {
"pile_set_name": "Github"
} |
package me.majiajie.pagerbottomtabstrip;
import android.graphics.drawable.Drawable;
import me.majiajie.pagerbottomtabstrip.item.BaseTabItem;
import me.majiajie.pagerbottomtabstrip.listener.OnTabItemSelectedListener;
import me.majiajie.pagerbottomtabstrip.listener.SimpleTabItemSelectedListener;
public interface ItemController {
/**
* 设置选中项
*
* @param index 顺序索引
*/
void setSelect(int index);
/**
* 设置选中项,并可以控制是否回调监听事件
*
* @param index 顺序索引
* @param listener true:假如存在监听事件{@link OnTabItemSelectedListener},就会调用相关的回调方法。false:不会触发监听事件
*/
void setSelect(int index, boolean listener);
/**
* 设置导航按钮上显示的圆形消息数字,通过顺序索引。
*
* @param index 顺序索引
* @param number 消息数字
*/
void setMessageNumber(int index, int number);
/**
* 设置显示无数字的消息小原点
*
* @param index 顺序索引
* @param hasMessage true显示
*/
void setHasMessage(int index, boolean hasMessage);
/**
* 导航栏按钮点击监听
*
* @param listener {@link OnTabItemSelectedListener}
*/
void addTabItemSelectedListener(OnTabItemSelectedListener listener);
/**
* 导航栏按钮点击监听(只有选中事件)
*
* @param listener {@link SimpleTabItemSelectedListener}
*/
void addSimpleTabItemSelectedListener(SimpleTabItemSelectedListener listener);
/**
* 设置标题
*
* @param index 顺序索引
* @param title 标题文字
*/
void setTitle(int index, String title);
/**
* 设置未选中状态下的图标
*
* @param index 顺序索引
* @param drawable 图标资源
*/
void setDefaultDrawable(int index, Drawable drawable);
/**
* 设置选中状态下的图标
*
* @param index 顺序索引
* @param drawable 图标资源
*/
void setSelectedDrawable(int index, Drawable drawable);
/**
* 获取当前选中项索引
*
* @return 索引
*/
int getSelected();
/**
* 获取导航按钮总数
*
* @return 总数
*/
int getItemCount();
/**
* 获取导航按钮文字
*
* @param index 顺序索引
* @return 文字
*/
String getItemTitle(int index);
/**
* 移除指定的导航项.需要注意,不能移除当前选中的导航项
*
* @return 移除是否成功
*/
boolean removeItem(int index);
/**
* 添加一个材料设计样式的TabItem.注意,只对<code>material()</code>构建的导航栏有效
*
* @param index 顺序索引
* @param defaultDrawable 未选中状态的图标资源
* @param selectedDrawable 选中状态的图标资源
* @param title 标题
* @param selectedColor 选中状态的颜色
*/
void addMaterialItem(int index, Drawable defaultDrawable, Drawable selectedDrawable, String title, int selectedColor);
/**
* 添加一个自定义样式的TabItem.注意,只对<code>custom()</code>构建的导航栏有效
*
* @param index 顺序索引
* @param item 自定义的Item
*/
void addCustomItem(int index, BaseTabItem item);
}
| {
"pile_set_name": "Github"
} |
//>>built
define("dojox/editor/plugins/nls/ca/ShowBlockNodes",({"showBlockNodes":"Mostra elements de bloc HTML"}));
| {
"pile_set_name": "Github"
} |
PROG= acpidump
SRCS= acpidump.c
KERNEL_INCLUDE := ../../../include
CFLAGS += -Wall -Wstrict-prototypes -Wdeclaration-after-statement -Os -s -D_LINUX -DDEFINE_ALTERNATE_TYPES -I$(KERNEL_INCLUDE)
all: acpidump
$(PROG) : $(SRCS)
$(CC) $(CFLAGS) $(SRCS) -o $(PROG)
CLEANFILES= $(PROG)
clean :
rm -f $(CLEANFILES) $(patsubst %.c,%.o, $(SRCS)) *~
install :
install acpidump /usr/sbin/acpidump
install acpidump.8 /usr/share/man/man8
| {
"pile_set_name": "Github"
} |
import hashlib
import time
from django.core.cache import caches, DEFAULT_CACHE_ALIAS
from corehq.project_limits.rate_counter.interfaces import AbstractRateCounter
REDIS = caches[DEFAULT_CACHE_ALIAS]
LOCMEM = caches['locmem']
class SlidingWindowRateCounter(AbstractRateCounter):
"""
A "Sliding Window Over Fixed Grains" approach that approximates perfect sliding window
A perfect sliding window approach would require keeping the timestamp of every event
and count the number that fall between now and now - window_duration;
for lower memory and performance overhead we instead approximate that
by dividing time up into fixed "grains", i.e. sub-windows,
over which we slide the larger window.
For the earliest grain which is sliding out of the window,
we assume linear distribution of events over time, and thus compute its contribution
to the total as (% overlap of grain with our window) * (events in grain).
See a description of this approach (with grains_per_window=1) here:
https://konghq.com/blog/how-to-design-a-scalable-rate-limiting-algorithm/
"""
def __init__(self, key, window_duration, window_offset=0, grains_per_window=1,
memoize_timeout=15.0, _FixedWindowRateCounter=None):
"""
:param key: short description of the window e.g. "week"
:param window_duration: length of the window in seconds
:param window_offset: offset from epoch of window boundary
:param grains_per_window: How many grains the window should be divided into
(higher number = more accuracy)
:param memoize_timeout: how long to memoize the information in memory in seconds
This is the upper limit on how long a `get` could return a stale value.
"""
_FixedWindowRateCounter = _FixedWindowRateCounter or FixedWindowRateCounter
self.key = key
self.window_duration = window_duration
self.window_offset = window_offset
self.grains_per_window = grains_per_window
self.memoize_timeout = memoize_timeout
self.grain_duration = window_duration / grains_per_window
self.grain_counter = _FixedWindowRateCounter(
key=key,
window_duration=self.grain_duration,
window_offset=window_offset,
keep_windows=grains_per_window + 1,
memoize_timeout=memoize_timeout
)
def get(self, scope, timestamp=None):
if timestamp is None:
timestamp = time.time()
counts = [
self.grain_counter.get(scope, timestamp - i * self.grain_duration,
key_is_active=(i == 0))
for i in range(self.grains_per_window + 1)
]
earliest_grain_count = counts.pop()
# This is the percentage of the way through the current grain we are
progress_in_current_grain = (timestamp % self.grain_duration) / self.grain_duration
# This is the count from the percentage of the earliest grain that should count
contribution_from_earliest = earliest_grain_count * (1 - progress_in_current_grain)
return sum(counts) + contribution_from_earliest
def increment(self, scope, delta=1, timestamp=None):
# this intentionally doesn't return because this is the active grain count,
# not the total that would be returned by get
self.grain_counter.increment(scope, delta, timestamp=timestamp)
def increment_and_get(self, scope, delta=1, timestamp=None):
self.increment(scope, delta, timestamp=timestamp)
return self.get(scope, timestamp=timestamp)
class FixedWindowRateCounter(AbstractRateCounter):
def __init__(self, key, window_duration, window_offset=0, keep_windows=1,
memoize_timeout=15.0, _CounterCache=None):
"""
:param key: short description of the window e.g. "week"
:param window_duration: length of the window in seconds
:param window_offset: offset of window boundary in seconds from the epoch
:param keep_windows: number of windows to retain (including current one)
:param memoize_timeout: how long to memoize the information in memory in seconds
This is the upper limit on how long a `get` could return a stale value.
"""
_CounterCache = _CounterCache or CounterCache
assert keep_windows >= 1
self.key = key
self.window_duration = window_duration
self.window_offset = window_offset
self.counter = _CounterCache(memoize_timeout, timeout=keep_windows * window_duration)
@staticmethod
def _digest(string):
return hashlib.sha1(string.encode('utf-8')).hexdigest()
def _cache_key(self, scope, timestamp=None):
if timestamp is None:
timestamp = time.time()
if isinstance(scope, str):
scope = (scope,)
return self._digest('fwrc-{}-{}-{}'.format(
self.key,
':'.join(map(self._digest, scope)),
int((timestamp - self.window_offset) / self.window_duration)
))
def get(self, scope, timestamp=None, key_is_active=True):
return self.counter.get(self._cache_key(scope, timestamp=timestamp), key_is_active=key_is_active)
def increment_and_get(self, scope, delta=1, timestamp=None):
return self.counter.incr(self._cache_key(scope, timestamp=timestamp), delta)
def increment(self, scope, delta=1, timestamp=None):
self.increment_and_get(scope, delta, timestamp=timestamp)
class CounterCache(object):
def __init__(self, memoized_timeout, timeout, local_cache=LOCMEM, shared_cache=REDIS):
self.memoized_timeout = memoized_timeout
self.timeout = int(timeout)
self.local_cache = local_cache
self.shared_cache = shared_cache
def incr(self, key, delta=1):
value = self.shared_cache.incr(key, delta, ignore_key_check=True)
if value == 1:
self.shared_cache.expire(key, timeout=self.timeout)
self.local_cache.set(key, value, timeout=self.memoized_timeout)
return value
def get(self, key, key_is_active=True):
"""
:param key: Cache key
:param key_is_active: Whether you believe the key is being actively updated
If not, then use the longer timeout for local memory cache as well.
"""
local_timeout = self.memoized_timeout if key_is_active else self.timeout
value = self.local_cache.get(key, default=None)
if value is None:
value = self.shared_cache.get(key, default=0)
self.local_cache.set(key, value, timeout=local_timeout)
assert value is not None
return value
| {
"pile_set_name": "Github"
} |
cmdprofile Package
==================
:mod:`cmdprofile` Module
------------------------
.. automodule:: autotest.client.profilers.cmdprofile.cmdprofile
:members:
:undoc-members:
:show-inheritance:
| {
"pile_set_name": "Github"
} |
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>IDEDidComputeMac32BitWarning</key>
<true/>
</dict>
</plist>
| {
"pile_set_name": "Github"
} |
---
name : test2
description : another st2 pack to test package management pipeline
keywords:
- some
- special
- terms
version : "0.5.0"
author : stanley
email : [email protected]
| {
"pile_set_name": "Github"
} |
# Chrome Serial support for Avrgirl Arduino
## methods and properties needed for direct mappings / translation interface
### constructor / static
+ `new SerialPort()` -> `navigator.serial.requestPort`
+ `SerialPort.list` -> `navigator.serial.getPorts`
### instance
+ `serialPort.open` -> `serialPort.open`
+ `serialPort.path` -> manually set after user gesture and user permission granted? I don't see it in the port info object
+ `serialPort.close` -> `serialPort.close`
+ `serialPort.set` -> `serialPort.setControlSignals`
+ `serialPort.write` -> `serialPort.writeable.getWriter().write`
+ `serialPort.read` -> `serialPort.readable.getReader().read`
+ `serialPort.flush` -> `serialPort.flush`
### events
+ error
+ close
+ open
**Note:** this list is not exhaustive of node serialport but these are the minimum requirements in order to bootstrap Avrgirl Arduino
## questions
+ what should the default buffer size be for writing? Although in Avrgirl we can set this to the pageSize + amount of control bytes needed for opcodes
+ should the browser serialport library shim be written in typescript? (probably)
+ how are the pid and vid properties extracted? Assumption is that they're included in the properties of `getPorts` results though I don't see it in the fake mock that Reilly wrote
+ how can a static method be declared in an ES6 class declaration? I forget right now and I don't have internet for a week to look it up
+ should a more modern interface of promises be an option for the library shim while remaining compatible with existing callback implementation?
+ should the bundler be changed from browserify to webpack? graceful-fs would need to be swapped out for regular fs if so
+ do the events all match up to equivalencies?
+ perhaps the serialPort.path needs to be the id of the serial device instance? How do we reconnect after a reset of the device?
| {
"pile_set_name": "Github"
} |
planner_configs:
SBLkConfigDefault:
type: geometric::SBL
range: 0.0 # Max motion added to tree. ==> maxDistance_ default: 0.0, if 0.0, set on setup()
ESTkConfigDefault:
type: geometric::EST
range: 0.0 # Max motion added to tree. ==> maxDistance_ default: 0.0, if 0.0 setup()
goal_bias: 0.05 # When close to goal select goal, with this probability. default: 0.05
LBKPIECEkConfigDefault:
type: geometric::LBKPIECE
range: 0.0 # Max motion added to tree. ==> maxDistance_ default: 0.0, if 0.0, set on setup()
border_fraction: 0.9 # Fraction of time focused on boarder default: 0.9
min_valid_path_fraction: 0.5 # Accept partially valid moves above fraction. default: 0.5
BKPIECEkConfigDefault:
type: geometric::BKPIECE
range: 0.0 # Max motion added to tree. ==> maxDistance_ default: 0.0, if 0.0, set on setup()
border_fraction: 0.9 # Fraction of time focused on boarder default: 0.9
failed_expansion_score_factor: 0.5 # When extending motion fails, scale score by factor. default: 0.5
min_valid_path_fraction: 0.5 # Accept partially valid moves above fraction. default: 0.5
KPIECEkConfigDefault:
type: geometric::KPIECE
range: 0.0 # Max motion added to tree. ==> maxDistance_ default: 0.0, if 0.0, set on setup()
goal_bias: 0.05 # When close to goal select goal, with this probability. default: 0.05
border_fraction: 0.9 # Fraction of time focused on boarder default: 0.9 (0.0,1.]
failed_expansion_score_factor: 0.5 # When extending motion fails, scale score by factor. default: 0.5
min_valid_path_fraction: 0.5 # Accept partially valid moves above fraction. default: 0.5
RRTkConfigDefault:
type: geometric::RRT
range: 0.0 # Max motion added to tree. ==> maxDistance_ default: 0.0, if 0.0, set on setup()
goal_bias: 0.05 # When close to goal select goal, with this probability? default: 0.05
RRTConnectkConfigDefault:
type: geometric::RRTConnect
range: 0.0 # Max motion added to tree. ==> maxDistance_ default: 0.0, if 0.0, set on setup()
RRTstarkConfigDefault:
type: geometric::RRTstar
range: 0.0 # Max motion added to tree. ==> maxDistance_ default: 0.0, if 0.0, set on setup()
goal_bias: 0.05 # When close to goal select goal, with this probability? default: 0.05
delay_collision_checking: 1 # Stop collision checking as soon as C-free parent found. default 1
TRRTkConfigDefault:
type: geometric::TRRT
range: 0.0 # Max motion added to tree. ==> maxDistance_ default: 0.0, if 0.0, set on setup()
goal_bias: 0.05 # When close to goal select goal, with this probability? default: 0.05
max_states_failed: 10 # when to start increasing temp. default: 10
temp_change_factor: 2.0 # how much to increase or decrease temp. default: 2.0
min_temperature: 10e-10 # lower limit of temp change. default: 10e-10
init_temperature: 10e-6 # initial temperature. default: 10e-6
frountier_threshold: 0.0 # dist new state to nearest neighbor to disqualify as frontier. default: 0.0 set in setup()
frountierNodeRatio: 0.1 # 1/10, or 1 nonfrontier for every 10 frontier. default: 0.1
k_constant: 0.0 # value used to normalize expresssion. default: 0.0 set in setup()
PRMkConfigDefault:
type: geometric::PRM
max_nearest_neighbors: 10 # use k nearest neighbors. default: 10
PRMstarkConfigDefault:
type: geometric::PRMstar
arm:
planner_configs:
- SBLkConfigDefault
- ESTkConfigDefault
- LBKPIECEkConfigDefault
- BKPIECEkConfigDefault
- KPIECEkConfigDefault
- RRTkConfigDefault
- RRTConnectkConfigDefault
- RRTstarkConfigDefault
- TRRTkConfigDefault
- PRMkConfigDefault
- PRMstarkConfigDefault | {
"pile_set_name": "Github"
} |
<?php
interface I {}
class C implements I {}
$rc = new ReflectionClass('C');
var_dump($rc->getDefaultProperties(null));
var_dump($rc->getDefaultProperties('X'));
var_dump($rc->getDefaultProperties(true));
var_dump($rc->getDefaultProperties(array(1,2,3)));
var_dump($rc->getStaticProperties(null));
var_dump($rc->getStaticProperties('X'));
var_dump($rc->getStaticProperties(true));
var_dump($rc->getStaticProperties(array(1,2,3)));
?>
| {
"pile_set_name": "Github"
} |
<?php
/*
* This file is part of the Symfony package.
*
* (c) Fabien Potencier <[email protected]>
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
*/
namespace Symfony\Component\HttpKernel\Tests\Fixtures\DataCollector;
use Symfony\Component\HttpFoundation\Request;
use Symfony\Component\HttpFoundation\Response;
use Symfony\Component\HttpKernel\DataCollector\DataCollector;
class CloneVarDataCollector extends DataCollector
{
private $varToClone;
public function __construct($varToClone)
{
$this->varToClone = $varToClone;
}
public function collect(Request $request, Response $response, \Exception $exception = null)
{
$this->data = $this->cloneVar($this->varToClone);
}
public function getData()
{
return $this->data;
}
public function getName()
{
return 'clone_var';
}
}
| {
"pile_set_name": "Github"
} |
import dropdown from 'v-dropdown'
import selector from '../mixins/selector'
export default {
name: 'SelectElement',
components: { dropdown },
mixins: [selector],
props: {
list: {
type: Array,
required: true
},
blankText: String,
value: Object
},
data () {
return {
selected: this.value
}
},
inject: ['disabled', 'blank'],
watch: {
value: {
handler (val) {
this.selected = val
},
deep: true
}
},
computed: {
content () {
return (this.selected && this.selected.value)
? this.selected.value
: this.blank ? this.blankText : ' '
}
},
render (h) {
const child = []
// trigger
child.push(h('template', { slot: 'caller' }, [
h('div', {
class: {
'rg-select__el': true,
'rg-select__el--active': this.show,
'rg-select_el--disabled': this.disabled
}
}, [
h('div', { class: 'rg-select__content' }, this.content),
h('span', { class: 'rg-select__caret' })
])
]))
const items = []
// "Please select" option
if (this.blank) {
items.push(h('li', {
on: {
click: () => {
this.pick(null)
}
}
}, this.blankText))
}
// list item
items.push(...this.list.map(val => {
return h('li', {
key: val.key,
class: {
selected: this.selected && this.selected.key === val.key
},
on: {
click: () => {
this.pick(val)
}
}
}, val.value)
}))
child.push(h('ul', { class: 'rg-select__list' }, items))
return h('dropdown', {
ref: 'drop',
class: 'rg-select',
props: {
border: false,
disabled: this.disabled
},
on: {
show: this.showChange
}
}, child)
},
methods: {
pick (val) {
this.selected = val
this.$emit('input', val)
this.close()
}
}
}
| {
"pile_set_name": "Github"
} |
'use strict';
Object.defineProperty(exports, "__esModule", {
value: true
});
exports.validate = validate;
exports.afterRequest = afterRequest;
exports.beforeRequest = beforeRequest;
exports.browser = browser;
exports.cache = cache;
exports.content = content;
exports.cookie = cookie;
exports.creator = creator;
exports.entry = entry;
exports.har = har;
exports.header = header;
exports.log = log;
exports.page = page;
exports.pageTimings = pageTimings;
exports.postData = postData;
exports.query = query;
exports.request = request;
exports.response = response;
exports.timings = timings;
var _harSchema = require('har-schema');
var schemas = _interopRequireWildcard(_harSchema);
var _ajv = require('ajv');
var _ajv2 = _interopRequireDefault(_ajv);
var _error = require('./error');
var _error2 = _interopRequireDefault(_error);
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
function _interopRequireWildcard(obj) { if (obj && obj.__esModule) { return obj; } else { var newObj = {}; if (obj != null) { for (var key in obj) { if (Object.prototype.hasOwnProperty.call(obj, key)) newObj[key] = obj[key]; } } newObj.default = obj; return newObj; } }
let ajv;
function validate(name, data = {}, next) {
// validator config
ajv = ajv || new _ajv2.default({
allErrors: true,
schemas: schemas
});
let validate = ajv.getSchema(name + '.json');
let valid = validate(data);
// callback?
if (typeof next === 'function') {
return next(!valid ? new _error2.default(validate.errors) : null, valid);
}
return valid;
}
function afterRequest(data, next) {
return validate('afterRequest', data, next);
}
function beforeRequest(data, next) {
return validate('beforeRequest', data, next);
}
function browser(data, next) {
return validate('browser', data, next);
}
function cache(data, next) {
return validate('cache', data, next);
}
function content(data, next) {
return validate('content', data, next);
}
function cookie(data, next) {
return validate('cookie', data, next);
}
function creator(data, next) {
return validate('creator', data, next);
}
function entry(data, next) {
return validate('entry', data, next);
}
function har(data, next) {
return validate('har', data, next);
}
function header(data, next) {
return validate('header', data, next);
}
function log(data, next) {
return validate('log', data, next);
}
function page(data, next) {
return validate('page', data, next);
}
function pageTimings(data, next) {
return validate('pageTimings', data, next);
}
function postData(data, next) {
return validate('postData', data, next);
}
function query(data, next) {
return validate('query', data, next);
}
function request(data, next) {
return validate('request', data, next);
}
function response(data, next) {
return validate('response', data, next);
}
function timings(data, next) {
return validate('timings', data, next);
} | {
"pile_set_name": "Github"
} |
<?php
/**
* @package plugins.contentDistribution
* @subpackage api.objects
*/
class KalturaDistributionValidationErrorInvalidMetadata extends KalturaDistributionValidationErrorInvalidData
{
/**
* @var int
*/
public $metadataProfileId;
/*
* mapping between the field on this object (on the left) and the setter/getter on the object (on the right)
*/
private static $map_between_objects = array
(
'metadataProfileId',
);
public function getMapBetweenObjects()
{
return array_merge(parent::getMapBetweenObjects(), self::$map_between_objects);
}
} | {
"pile_set_name": "Github"
} |
/*
* ******************************************************************************
* sdrtrunk
* Copyright (C) 2014-2019 Dennis Sheirer
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>
* *****************************************************************************
*/
package io.github.dsheirer.module.decode.p25.phase1.message.vselp;
import io.github.dsheirer.bits.CorrectedBinaryMessage;
import io.github.dsheirer.identifier.Identifier;
import io.github.dsheirer.module.decode.p25.phase1.P25P1DataUnitID;
import io.github.dsheirer.module.decode.p25.phase1.message.P25Message;
import java.util.Collections;
import java.util.List;
public class VSELP1Message extends P25Message
{
/**
* Motorola VSELP audio message 1 - not implemented.
*/
public VSELP1Message(CorrectedBinaryMessage message, int nac, long timestamp)
{
super(message, nac, timestamp);
}
@Override
public String toString()
{
StringBuilder sb = new StringBuilder();
sb.append(getMessageStub());
sb.append(" MSG:").append(getMessage().toHexString());
return sb.toString();
}
@Override
public P25P1DataUnitID getDUID()
{
return P25P1DataUnitID.VSELP1;
}
@Override
public List<Identifier> getIdentifiers()
{
return Collections.EMPTY_LIST;
}
}
| {
"pile_set_name": "Github"
} |
/*-------------------------------------------------------------------------
*
* freepage.h
* Management of page-organized free memory.
*
* Portions Copyright (c) 1996-2017, PostgreSQL Global Development Group
* Portions Copyright (c) 1994, Regents of the University of California
*
* src/include/utils/freepage.h
*
*-------------------------------------------------------------------------
*/
#ifndef FREEPAGE_H
#define FREEPAGE_H
#include "storage/lwlock.h"
#include "utils/relptr.h"
/* Forward declarations. */
typedef struct FreePageSpanLeader FreePageSpanLeader;
typedef struct FreePageBtree FreePageBtree;
typedef struct FreePageManager FreePageManager;
/*
* PostgreSQL normally uses 8kB pages for most things, but many common
* architecture/operating system pairings use a 4kB page size for memory
* allocation, so we do that here also.
*/
#define FPM_PAGE_SIZE 4096
/*
* Each freelist except for the last contains only spans of one particular
* size. Everything larger goes on the last one. In some sense this seems
* like a waste since most allocations are in a few common sizes, but it
* means that small allocations can simply pop the head of the relevant list
* without needing to worry about whether the object we find there is of
* precisely the correct size (because we know it must be).
*/
#define FPM_NUM_FREELISTS 129
/* Define relative pointer types. */
relptr_declare(FreePageBtree, RelptrFreePageBtree);
relptr_declare(FreePageManager, RelptrFreePageManager);
relptr_declare(FreePageSpanLeader, RelptrFreePageSpanLeader);
/* Everything we need in order to manage free pages (see freepage.c) */
struct FreePageManager
{
RelptrFreePageManager self;
RelptrFreePageBtree btree_root;
RelptrFreePageSpanLeader btree_recycle;
unsigned btree_depth;
unsigned btree_recycle_count;
Size singleton_first_page;
Size singleton_npages;
Size contiguous_pages;
bool contiguous_pages_dirty;
RelptrFreePageSpanLeader freelist[FPM_NUM_FREELISTS];
#ifdef FPM_EXTRA_ASSERTS
/* For debugging only, pages put minus pages gotten. */
Size free_pages;
#endif
};
/* Macros to convert between page numbers (expressed as Size) and pointers. */
#define fpm_page_to_pointer(base, page) \
(AssertVariableIsOfTypeMacro(page, Size), \
(base) + FPM_PAGE_SIZE * (page))
#define fpm_pointer_to_page(base, ptr) \
(((Size) (((char *) (ptr)) - (base))) / FPM_PAGE_SIZE)
/* Macro to convert an allocation size to a number of pages. */
#define fpm_size_to_pages(sz) \
(((sz) + FPM_PAGE_SIZE - 1) / FPM_PAGE_SIZE)
/* Macros to check alignment of absolute and relative pointers. */
#define fpm_pointer_is_page_aligned(base, ptr) \
(((Size) (((char *) (ptr)) - (base))) % FPM_PAGE_SIZE == 0)
#define fpm_relptr_is_page_aligned(base, relptr) \
((relptr).relptr_off % FPM_PAGE_SIZE == 0)
/* Macro to find base address of the segment containing a FreePageManager. */
#define fpm_segment_base(fpm) \
(((char *) fpm) - fpm->self.relptr_off)
/* Macro to access a FreePageManager's largest consecutive run of pages. */
#define fpm_largest(fpm) \
(fpm->contiguous_pages)
/* Functions to manipulate the free page map. */
extern void FreePageManagerInitialize(FreePageManager *fpm, char *base);
extern bool FreePageManagerGet(FreePageManager *fpm, Size npages,
Size *first_page);
extern void FreePageManagerPut(FreePageManager *fpm, Size first_page,
Size npages);
extern char *FreePageManagerDump(FreePageManager *fpm);
#endif /* FREEPAGE_H */
| {
"pile_set_name": "Github"
} |
/*
*Copyright (c) 2005-2010, WSO2 Inc. (http://www.wso2.org) All Rights Reserved.
*
*WSO2 Inc. licenses this file to you 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.
*/
package org.wso2.carbon.esb.mediator.test.script;
import org.apache.axis2.AxisFault;
import org.testng.Assert;
import org.testng.annotations.AfterClass;
import org.testng.annotations.BeforeClass;
import org.testng.annotations.Test;
import org.wso2.carbon.registry.resource.stub.ResourceAdminServiceExceptionException;
import org.wso2.esb.integration.common.clients.registry.ResourceAdminServiceClient;
import org.wso2.esb.integration.common.utils.ESBIntegrationTest;
import org.wso2.esb.integration.common.utils.ESBTestConstant;
import javax.activation.DataHandler;
import javax.xml.xpath.XPathExpressionException;
import java.net.URL;
import java.rmi.RemoteException;
import static org.testng.Assert.assertTrue;
public class InvalidScriptLanguageTestCase extends ESBIntegrationTest {
@BeforeClass(alwaysRun = true)
public void setEnvironment() throws Exception {
super.init();
uploadResourcesToConfigRegistry();
}
@Test(groups = "wso2.esb", description = "Give an invalid scripting language name (jh instead of js) . it throws an Exception")
public void testSequenceJSMediatorWithInvalidScriptLanguage() throws Exception {
try {
loadESBConfigurationFromClasspath("/artifacts/ESB/synapseconfig/config66/synapse.xml");
Assert.fail("This Configuration can not be saved successfully due to invalid Script language");
} catch (AxisFault expected) {
assertTrue((expected.getMessage().contains(ESBTestConstant.ERROR_ADDING_SEQUENCE) || expected.getMessage().contains(ESBTestConstant.UNABLE_TO_SAVE_SEQUENCE))
, "Error Message Mismatched. actual:" + expected.getMessage() + " but expected: Error adding sequence or Unable to save the Sequence");
}
}
@AfterClass(alwaysRun = true)
public void destroy() throws Exception {
super.cleanup();
clearUploadedResource();
}
private void uploadResourcesToConfigRegistry() throws Exception {
ResourceAdminServiceClient resourceAdminServiceStub =
new ResourceAdminServiceClient(contextUrls.getBackEndUrl(), context.getContextTenant().getContextUser().getUserName()
, context.getContextTenant().getContextUser().getPassword());
resourceAdminServiceStub.deleteResource("/_system/config/script_js");
resourceAdminServiceStub.addCollection("/_system/config/", "script_js", "",
"Contains test js files");
resourceAdminServiceStub.addResource(
"/_system/config/script_js/stockquoteTransform.js", "application/x-javascript", "js files",
new DataHandler(new URL("file:///" + getESBResourceLocation() +
"/mediatorconfig/script_js/stockquoteTransform.js")));
}
private void clearUploadedResource()
throws InterruptedException, ResourceAdminServiceExceptionException, RemoteException, XPathExpressionException {
ResourceAdminServiceClient resourceAdminServiceStub =
new ResourceAdminServiceClient(contextUrls.getBackEndUrl(), context.getContextTenant().getContextUser().getUserName()
, context.getContextTenant().getContextUser().getPassword());
resourceAdminServiceStub.deleteResource("/_system/config/script_js");
Thread.sleep(1000);
}
}
| {
"pile_set_name": "Github"
} |
# -*- coding: utf-8 -*-
from __future__ import absolute_import
from __future__ import print_function
from __future__ import division
from utils.external.faster_rcnn_tensorflow.configs import cfgs
import tensorflow as tf
import numpy as np
def max_length_limitation(length, length_limitation):
return tf.cond(tf.less(length, length_limitation),
true_fn=lambda: length,
false_fn=lambda: length_limitation)
def short_side_resize(img_tensor, labels, bboxes, target_shortside_len, length_limitation=1200):
'''
:param img_tensor:[h, w, c], gtboxes_and_label:[-1, 5]. gtboxes: [xmin, ymin, xmax, ymax]
:param target_shortside_len:
:param length_limitation: set max length to avoid OUT OF MEMORY
:return:
'''
img_h, img_w = tf.shape(img_tensor)[0], tf.shape(img_tensor)[1]
new_h, new_w = tf.cond(tf.less(img_h, img_w),
true_fn=lambda: (target_shortside_len,
max_length_limitation(target_shortside_len * img_w // img_h, length_limitation)),
false_fn=lambda: (max_length_limitation(target_shortside_len * img_h // img_w, length_limitation),
target_shortside_len))
img_tensor = tf.expand_dims(img_tensor, axis=0)
img_tensor = tf.image.resize_bilinear(img_tensor, [new_h, new_w])
ymin, xmin, ymax, xmax = tf.unstack(bboxes, axis=1)
img_h = tf.cast(img_h, tf.float32)
img_w = tf.cast(img_w,tf.float32)
new_h = tf.cast(new_h,tf.float32)
new_w = tf.cast(new_w,tf.float32)
ymin = ymin * img_h
ymax = ymax * img_h
xmin = xmin * img_w
xmax = xmax * img_w
new_xmin, new_ymin = xmin * new_w // img_w, ymin * new_h // img_h
new_xmax, new_ymax = xmax * new_w // img_w, ymax * new_h // img_h
img_tensor = tf.squeeze(img_tensor, axis=0) # ensure image tensor rank is 3
return img_tensor, labels, tf.cast(tf.transpose(tf.stack([new_xmin, new_ymin, new_xmax, new_ymax], axis=0)),dtype=tf.int32)
def short_side_resize_for_inference_data(img_tensor, target_shortside_len, length_limitation=1200):
img_h, img_w = tf.shape(img_tensor)[0], tf.shape(img_tensor)[1]
new_h, new_w = tf.cond(tf.less(img_h, img_w),
true_fn=lambda: (target_shortside_len,
max_length_limitation(target_shortside_len * img_w // img_h, length_limitation)),
false_fn=lambda: (max_length_limitation(target_shortside_len * img_h // img_w, length_limitation),
target_shortside_len))
img_tensor = tf.expand_dims(img_tensor, axis=0)
img_tensor = tf.image.resize_bilinear(img_tensor, [new_h, new_w])
img_tensor = tf.squeeze(img_tensor, axis=0) # ensure image tensor rank is 3
return img_tensor
def flip_left_to_right(img_tensor, labels, bboxes):
h, w = tf.shape(img_tensor)[0], tf.shape(img_tensor)[1]
img_tensor = tf.image.flip_left_right(img_tensor)
xmin, ymin, xmax, ymax= tf.unstack(bboxes, axis=1)
new_xmax = w - xmin
new_xmin = w - xmax
return img_tensor, labels, tf.transpose(tf.stack([new_xmin, ymin, new_xmax, ymax], axis=0))
def random_flip_left_right(img_tensor, labels, bboxes):
img_tensor, labels, bboxes= tf.cond(tf.less(tf.random_uniform(shape=[], minval=0, maxval=1), 0.5),
lambda: flip_left_to_right(img_tensor, labels, bboxes),
lambda: (img_tensor, labels, bboxes))
return img_tensor, labels, bboxes
def preprocess_for_train(image, labels, bboxes, out_shape, data_format='channels_first', scope='ssd_preprocessing_train', output_rgb=True):
img = tf.cast(image, tf.float32)
img, labels, bboxes = short_side_resize(img_tensor = img, labels = labels, bboxes = bboxes,
target_shortside_len =cfgs.IMG_SHORT_SIDE_LEN, length_limitation=cfgs.IMG_MAX_LENGTH)
img, labels, bboxes = random_flip_left_right(img_tensor=img,labels = labels, bboxes = bboxes)
img = img - tf.constant([[cfgs.PIXEL_MEAN]]) # sub pixel mean at last
return img, labels, bboxes
def preprocess_for_eval(image, out_shape, data_format='channels_first', scope='ssd_preprocessing_eval', output_rgb=True):
img = tf.cast(image, tf.float32)
img = short_side_resize_for_inference_data(img_tensor=img,
target_shortside_len=cfgs.IMG_SHORT_SIDE_LEN,
length_limitation=cfgs.IMG_MAX_LENGTH)
img = img - tf.constant(cfgs.PIXEL_MEAN)
return img
def preprocess_image(image, labels, bboxes, out_shape, is_training=False, data_format='channels_first', output_rgb=True):
"""Preprocesses the given image.
Args:
image: A `Tensor` representing an image of arbitrary size.
labels: A `Tensor` containing all labels for all bboxes of this image.
bboxes: A `Tensor` containing all bboxes of this image, in range [0., 1.] with shape [num_bboxes, 4].
out_shape: The height and width of the image after preprocessing.
is_training: Wether we are in training phase.
data_format: The data_format of the desired output image.
Returns:
A preprocessed image.
"""
if is_training:
return preprocess_for_train(image, labels, bboxes, out_shape, data_format=data_format, output_rgb=output_rgb)
else:
return preprocess_for_eval(image, out_shape, data_format=data_format, output_rgb=output_rgb) | {
"pile_set_name": "Github"
} |
{
"word": "Postseason",
"definitions": [
"The period following the regular season.",
"A game or competition held during the postseason."
],
"parts-of-speech": "Noun"
} | {
"pile_set_name": "Github"
} |
// SPDX-License-Identifier: GPL-2.0-only
/*
* Copyright (C) 2010 Google, Inc.
*
* Author:
* Colin Cross <[email protected]>
* Based on arch/arm/plat-omap/cpu-omap.c, (C) 2005 Nokia Corporation
*/
#include <linux/clk.h>
#include <linux/cpufreq.h>
#include <linux/err.h>
#include <linux/init.h>
#include <linux/module.h>
#include <linux/platform_device.h>
#include <linux/types.h>
static struct cpufreq_frequency_table freq_table[] = {
{ .frequency = 216000 },
{ .frequency = 312000 },
{ .frequency = 456000 },
{ .frequency = 608000 },
{ .frequency = 760000 },
{ .frequency = 816000 },
{ .frequency = 912000 },
{ .frequency = 1000000 },
{ .frequency = CPUFREQ_TABLE_END },
};
struct tegra20_cpufreq {
struct device *dev;
struct cpufreq_driver driver;
struct clk *cpu_clk;
struct clk *pll_x_clk;
struct clk *pll_p_clk;
bool pll_x_prepared;
};
static unsigned int tegra_get_intermediate(struct cpufreq_policy *policy,
unsigned int index)
{
struct tegra20_cpufreq *cpufreq = cpufreq_get_driver_data();
unsigned int ifreq = clk_get_rate(cpufreq->pll_p_clk) / 1000;
/*
* Don't switch to intermediate freq if:
* - we are already at it, i.e. policy->cur == ifreq
* - index corresponds to ifreq
*/
if (freq_table[index].frequency == ifreq || policy->cur == ifreq)
return 0;
return ifreq;
}
static int tegra_target_intermediate(struct cpufreq_policy *policy,
unsigned int index)
{
struct tegra20_cpufreq *cpufreq = cpufreq_get_driver_data();
int ret;
/*
* Take an extra reference to the main pll so it doesn't turn
* off when we move the cpu off of it as enabling it again while we
* switch to it from tegra_target() would take additional time.
*
* When target-freq is equal to intermediate freq we don't need to
* switch to an intermediate freq and so this routine isn't called.
* Also, we wouldn't be using pll_x anymore and must not take extra
* reference to it, as it can be disabled now to save some power.
*/
clk_prepare_enable(cpufreq->pll_x_clk);
ret = clk_set_parent(cpufreq->cpu_clk, cpufreq->pll_p_clk);
if (ret)
clk_disable_unprepare(cpufreq->pll_x_clk);
else
cpufreq->pll_x_prepared = true;
return ret;
}
static int tegra_target(struct cpufreq_policy *policy, unsigned int index)
{
struct tegra20_cpufreq *cpufreq = cpufreq_get_driver_data();
unsigned long rate = freq_table[index].frequency;
unsigned int ifreq = clk_get_rate(cpufreq->pll_p_clk) / 1000;
int ret;
/*
* target freq == pll_p, don't need to take extra reference to pll_x_clk
* as it isn't used anymore.
*/
if (rate == ifreq)
return clk_set_parent(cpufreq->cpu_clk, cpufreq->pll_p_clk);
ret = clk_set_rate(cpufreq->pll_x_clk, rate * 1000);
/* Restore to earlier frequency on error, i.e. pll_x */
if (ret)
dev_err(cpufreq->dev, "Failed to change pll_x to %lu\n", rate);
ret = clk_set_parent(cpufreq->cpu_clk, cpufreq->pll_x_clk);
/* This shouldn't fail while changing or restoring */
WARN_ON(ret);
/*
* Drop count to pll_x clock only if we switched to intermediate freq
* earlier while transitioning to a target frequency.
*/
if (cpufreq->pll_x_prepared) {
clk_disable_unprepare(cpufreq->pll_x_clk);
cpufreq->pll_x_prepared = false;
}
return ret;
}
static int tegra_cpu_init(struct cpufreq_policy *policy)
{
struct tegra20_cpufreq *cpufreq = cpufreq_get_driver_data();
clk_prepare_enable(cpufreq->cpu_clk);
/* FIXME: what's the actual transition time? */
cpufreq_generic_init(policy, freq_table, 300 * 1000);
policy->clk = cpufreq->cpu_clk;
policy->suspend_freq = freq_table[0].frequency;
return 0;
}
static int tegra_cpu_exit(struct cpufreq_policy *policy)
{
struct tegra20_cpufreq *cpufreq = cpufreq_get_driver_data();
clk_disable_unprepare(cpufreq->cpu_clk);
return 0;
}
static int tegra20_cpufreq_probe(struct platform_device *pdev)
{
struct tegra20_cpufreq *cpufreq;
int err;
cpufreq = devm_kzalloc(&pdev->dev, sizeof(*cpufreq), GFP_KERNEL);
if (!cpufreq)
return -ENOMEM;
cpufreq->cpu_clk = clk_get_sys(NULL, "cclk");
if (IS_ERR(cpufreq->cpu_clk))
return PTR_ERR(cpufreq->cpu_clk);
cpufreq->pll_x_clk = clk_get_sys(NULL, "pll_x");
if (IS_ERR(cpufreq->pll_x_clk)) {
err = PTR_ERR(cpufreq->pll_x_clk);
goto put_cpu;
}
cpufreq->pll_p_clk = clk_get_sys(NULL, "pll_p");
if (IS_ERR(cpufreq->pll_p_clk)) {
err = PTR_ERR(cpufreq->pll_p_clk);
goto put_pll_x;
}
cpufreq->dev = &pdev->dev;
cpufreq->driver.get = cpufreq_generic_get;
cpufreq->driver.attr = cpufreq_generic_attr;
cpufreq->driver.init = tegra_cpu_init;
cpufreq->driver.exit = tegra_cpu_exit;
cpufreq->driver.flags = CPUFREQ_NEED_INITIAL_FREQ_CHECK;
cpufreq->driver.verify = cpufreq_generic_frequency_table_verify;
cpufreq->driver.suspend = cpufreq_generic_suspend;
cpufreq->driver.driver_data = cpufreq;
cpufreq->driver.target_index = tegra_target;
cpufreq->driver.get_intermediate = tegra_get_intermediate;
cpufreq->driver.target_intermediate = tegra_target_intermediate;
snprintf(cpufreq->driver.name, CPUFREQ_NAME_LEN, "tegra");
err = cpufreq_register_driver(&cpufreq->driver);
if (err)
goto put_pll_p;
platform_set_drvdata(pdev, cpufreq);
return 0;
put_pll_p:
clk_put(cpufreq->pll_p_clk);
put_pll_x:
clk_put(cpufreq->pll_x_clk);
put_cpu:
clk_put(cpufreq->cpu_clk);
return err;
}
static int tegra20_cpufreq_remove(struct platform_device *pdev)
{
struct tegra20_cpufreq *cpufreq = platform_get_drvdata(pdev);
cpufreq_unregister_driver(&cpufreq->driver);
clk_put(cpufreq->pll_p_clk);
clk_put(cpufreq->pll_x_clk);
clk_put(cpufreq->cpu_clk);
return 0;
}
static struct platform_driver tegra20_cpufreq_driver = {
.probe = tegra20_cpufreq_probe,
.remove = tegra20_cpufreq_remove,
.driver = {
.name = "tegra20-cpufreq",
},
};
module_platform_driver(tegra20_cpufreq_driver);
MODULE_ALIAS("platform:tegra20-cpufreq");
MODULE_AUTHOR("Colin Cross <[email protected]>");
MODULE_DESCRIPTION("NVIDIA Tegra20 cpufreq driver");
MODULE_LICENSE("GPL");
| {
"pile_set_name": "Github"
} |
/* $OpenBSD: auth1.c,v 1.73 2008/07/04 23:30:16 djm Exp $ */
/*
* Copyright (c) 1995 Tatu Ylonen <[email protected]>, Espoo, Finland
* All rights reserved
*
* As far as I am concerned, the code I have written for this software
* can be used freely for any purpose. Any derived versions of this
* software must be clearly marked as such, and if the derived work is
* incompatible with the protocol description in the RFC file, it must be
* called by a name other than "ssh" or "Secure Shell".
*/
#include "includes.h"
#include <sys/types.h>
#include <stdarg.h>
#include <stdio.h>
#include <string.h>
#include <unistd.h>
#include <pwd.h>
#include "openbsd-compat/sys-queue.h"
#include "xmalloc.h"
#include "rsa.h"
#include "ssh1.h"
#include "packet.h"
#include "buffer.h"
#include "log.h"
#include "servconf.h"
#include "compat.h"
#include "key.h"
#include "hostfile.h"
#include "auth.h"
#include "channels.h"
#include "session.h"
#include "uidswap.h"
#ifdef GSSAPI
#include "ssh-gss.h"
#endif
#include "monitor_wrap.h"
#include "buffer.h"
/* import */
extern ServerOptions options;
extern Buffer loginmsg;
static int auth1_process_password(Authctxt *, char *, size_t);
static int auth1_process_rsa(Authctxt *, char *, size_t);
static int auth1_process_rhosts_rsa(Authctxt *, char *, size_t);
static int auth1_process_tis_challenge(Authctxt *, char *, size_t);
static int auth1_process_tis_response(Authctxt *, char *, size_t);
static char *client_user = NULL; /* Used to fill in remote user for PAM */
struct AuthMethod1 {
int type;
char *name;
int *enabled;
int (*method)(Authctxt *, char *, size_t);
};
const struct AuthMethod1 auth1_methods[] = {
{
SSH_CMSG_AUTH_PASSWORD, "password",
&options.password_authentication, auth1_process_password
},
{
SSH_CMSG_AUTH_RSA, "rsa",
&options.rsa_authentication, auth1_process_rsa
},
{
SSH_CMSG_AUTH_RHOSTS_RSA, "rhosts-rsa",
&options.rhosts_rsa_authentication, auth1_process_rhosts_rsa
},
{
SSH_CMSG_AUTH_TIS, "challenge-response",
&options.challenge_response_authentication,
auth1_process_tis_challenge
},
{
SSH_CMSG_AUTH_TIS_RESPONSE, "challenge-response",
&options.challenge_response_authentication,
auth1_process_tis_response
},
{ -1, NULL, NULL, NULL}
};
static const struct AuthMethod1
*lookup_authmethod1(int type)
{
int i;
for (i = 0; auth1_methods[i].name != NULL; i++)
if (auth1_methods[i].type == type)
return (&(auth1_methods[i]));
return (NULL);
}
static char *
get_authname(int type)
{
const struct AuthMethod1 *a;
static char buf[64];
if ((a = lookup_authmethod1(type)) != NULL)
return (a->name);
snprintf(buf, sizeof(buf), "bad-auth-msg-%d", type);
return (buf);
}
/*ARGSUSED*/
static int
auth1_process_password(Authctxt *authctxt, char *info, size_t infolen)
{
int authenticated = 0;
char *password;
u_int dlen;
/*
* Read user password. It is in plain text, but was
* transmitted over the encrypted channel so it is
* not visible to an outside observer.
*/
password = packet_get_string(&dlen);
packet_check_eom();
/* Try authentication with the password. */
authenticated = PRIVSEP(auth_password(authctxt, password));
memset(password, 0, dlen);
xfree(password);
return (authenticated);
}
/*ARGSUSED*/
static int
auth1_process_rsa(Authctxt *authctxt, char *info, size_t infolen)
{
int authenticated = 0;
BIGNUM *n;
/* RSA authentication requested. */
if ((n = BN_new()) == NULL)
fatal("do_authloop: BN_new failed");
packet_get_bignum(n);
packet_check_eom();
authenticated = auth_rsa(authctxt, n);
BN_clear_free(n);
return (authenticated);
}
/*ARGSUSED*/
static int
auth1_process_rhosts_rsa(Authctxt *authctxt, char *info, size_t infolen)
{
int keybits, authenticated = 0;
u_int bits;
Key *client_host_key;
u_int ulen;
/*
* Get client user name. Note that we just have to
* trust the client; root on the client machine can
* claim to be any user.
*/
client_user = packet_get_string(&ulen);
/* Get the client host key. */
client_host_key = key_new(KEY_RSA1);
bits = packet_get_int();
packet_get_bignum(client_host_key->rsa->e);
packet_get_bignum(client_host_key->rsa->n);
keybits = BN_num_bits(client_host_key->rsa->n);
if (keybits < 0 || bits != (u_int)keybits) {
verbose("Warning: keysize mismatch for client_host_key: "
"actual %d, announced %d",
BN_num_bits(client_host_key->rsa->n), bits);
}
packet_check_eom();
authenticated = auth_rhosts_rsa(authctxt, client_user,
client_host_key);
key_free(client_host_key);
snprintf(info, infolen, " ruser %.100s", client_user);
return (authenticated);
}
/*ARGSUSED*/
static int
auth1_process_tis_challenge(Authctxt *authctxt, char *info, size_t infolen)
{
char *challenge;
if ((challenge = get_challenge(authctxt)) == NULL)
return (0);
debug("sending challenge '%s'", challenge);
packet_start(SSH_SMSG_AUTH_TIS_CHALLENGE);
packet_put_cstring(challenge);
xfree(challenge);
packet_send();
packet_write_wait();
return (-1);
}
/*ARGSUSED*/
static int
auth1_process_tis_response(Authctxt *authctxt, char *info, size_t infolen)
{
int authenticated = 0;
char *response;
u_int dlen;
response = packet_get_string(&dlen);
packet_check_eom();
authenticated = verify_response(authctxt, response);
memset(response, 'r', dlen);
xfree(response);
return (authenticated);
}
/*
* read packets, try to authenticate the user and
* return only if authentication is successful
*/
static void
do_authloop(Authctxt *authctxt)
{
int authenticated = 0;
char info[1024];
int prev = 0, type = 0;
const struct AuthMethod1 *meth;
debug("Attempting authentication for %s%.100s.",
authctxt->valid ? "" : "invalid user ", authctxt->user);
/* If the user has no password, accept authentication immediately. */
if (options.password_authentication &&
#ifdef KRB5
(!options.kerberos_authentication || options.kerberos_or_local_passwd) &&
#endif
PRIVSEP(auth_password(authctxt, ""))) {
#ifdef USE_PAM
if (options.use_pam && (PRIVSEP(do_pam_account())))
#endif
{
auth_log(authctxt, 1, "without authentication", "");
return;
}
}
/* Indicate that authentication is needed. */
packet_start(SSH_SMSG_FAILURE);
packet_send();
packet_write_wait();
for (;;) {
/* default to fail */
authenticated = 0;
info[0] = '\0';
/* Get a packet from the client. */
prev = type;
type = packet_read();
/*
* If we started challenge-response authentication but the
* next packet is not a response to our challenge, release
* the resources allocated by get_challenge() (which would
* normally have been released by verify_response() had we
* received such a response)
*/
if (prev == SSH_CMSG_AUTH_TIS &&
type != SSH_CMSG_AUTH_TIS_RESPONSE)
abandon_challenge_response(authctxt);
if (authctxt->failures >= options.max_authtries)
goto skip;
if ((meth = lookup_authmethod1(type)) == NULL) {
logit("Unknown message during authentication: "
"type %d", type);
goto skip;
}
if (!*(meth->enabled)) {
verbose("%s authentication disabled.", meth->name);
goto skip;
}
authenticated = meth->method(authctxt, info, sizeof(info));
if (authenticated == -1)
continue; /* "postponed" */
#ifdef BSD_AUTH
if (authctxt->as) {
auth_close(authctxt->as);
authctxt->as = NULL;
}
#endif
if (!authctxt->valid && authenticated)
fatal("INTERNAL ERROR: authenticated invalid user %s",
authctxt->user);
#ifdef _UNICOS
if (authenticated && cray_access_denied(authctxt->user)) {
authenticated = 0;
fatal("Access denied for user %s.",authctxt->user);
}
#endif /* _UNICOS */
#ifdef HAVE_CYGWIN
if (authenticated &&
!check_nt_auth(type == SSH_CMSG_AUTH_PASSWORD,
authctxt->pw)) {
packet_disconnect("Authentication rejected for uid %d.",
authctxt->pw == NULL ? -1 : authctxt->pw->pw_uid);
authenticated = 0;
}
#else
/* Special handling for root */
if (authenticated && authctxt->pw->pw_uid == 0 &&
!auth_root_allowed(meth->name)) {
authenticated = 0;
# ifdef SSH_AUDIT_EVENTS
PRIVSEP(audit_event(SSH_LOGIN_ROOT_DENIED));
# endif
}
#endif
#ifdef USE_PAM
if (options.use_pam && authenticated &&
!PRIVSEP(do_pam_account())) {
char *msg;
size_t len;
error("Access denied for user %s by PAM account "
"configuration", authctxt->user);
len = buffer_len(&loginmsg);
buffer_append(&loginmsg, "\0", 1);
msg = buffer_ptr(&loginmsg);
/* strip trailing newlines */
if (len > 0)
while (len > 0 && msg[--len] == '\n')
msg[len] = '\0';
else
msg = "Access denied.";
packet_disconnect("%s", msg);
}
#endif
skip:
/* Log before sending the reply */
auth_log(authctxt, authenticated, get_authname(type), info);
if (client_user != NULL) {
xfree(client_user);
client_user = NULL;
}
if (authenticated)
return;
if (++authctxt->failures >= options.max_authtries) {
#ifdef SSH_AUDIT_EVENTS
PRIVSEP(audit_event(SSH_LOGIN_EXCEED_MAXTRIES));
#endif
packet_disconnect(AUTH_FAIL_MSG, authctxt->user);
}
packet_start(SSH_SMSG_FAILURE);
packet_send();
packet_write_wait();
}
}
/*
* Performs authentication of an incoming connection. Session key has already
* been exchanged and encryption is enabled.
*/
void
do_authentication(Authctxt *authctxt)
{
u_int ulen;
char *user, *style = NULL;
/* Get the name of the user that we wish to log in as. */
packet_read_expect(SSH_CMSG_USER);
/* Get the user name. */
user = packet_get_string(&ulen);
packet_check_eom();
if ((style = strchr(user, ':')) != NULL)
*style++ = '\0';
authctxt->user = user;
authctxt->style = style;
/* Verify that the user is a valid user. */
if ((authctxt->pw = PRIVSEP(getpwnamallow(user))) != NULL)
authctxt->valid = 1;
else {
debug("do_authentication: invalid user %s", user);
authctxt->pw = fakepw();
}
setproctitle("%s%s", authctxt->valid ? user : "unknown",
use_privsep ? " [net]" : "");
#ifdef USE_PAM
if (options.use_pam)
PRIVSEP(start_pam(authctxt));
#endif
/*
* If we are not running as root, the user must have the same uid as
* the server.
*/
#ifndef HAVE_CYGWIN
if (!use_privsep && getuid() != 0 && authctxt->pw &&
authctxt->pw->pw_uid != getuid())
packet_disconnect("Cannot change user when server not running as root.");
#endif
/*
* Loop until the user has been authenticated or the connection is
* closed, do_authloop() returns only if authentication is successful
*/
do_authloop(authctxt);
/* The user has been authenticated and accepted. */
packet_start(SSH_SMSG_SUCCESS);
packet_send();
packet_write_wait();
}
| {
"pile_set_name": "Github"
} |
<?php
/*
|--------------------------------------------------------------------------
| Create The Application
|--------------------------------------------------------------------------
|
| The first thing we will do is create a new Laravel application instance
| which serves as the "glue" for all the components of Laravel, and is
| the IoC container for the system binding all of the various parts.
|
*/
$app = new Illuminate\Foundation\Application(
realpath(__DIR__.'/../')
);
/*
|--------------------------------------------------------------------------
| Bind Important Interfaces
|--------------------------------------------------------------------------
|
| Next, we need to bind some important interfaces into the container so
| we will be able to resolve them when needed. The kernels serve the
| incoming requests to this application from both the web and CLI.
|
*/
$app->singleton(
Illuminate\Contracts\Http\Kernel::class,
App\Http\Kernel::class
);
$app->singleton(
Illuminate\Contracts\Console\Kernel::class,
App\Console\Kernel::class
);
$app->singleton(
Illuminate\Contracts\Debug\ExceptionHandler::class,
App\Exceptions\Handler::class
);
/*
|--------------------------------------------------------------------------
| Return The Application
|--------------------------------------------------------------------------
|
| This script returns the application instance. The instance is given to
| the calling script so we can separate the building of the instances
| from the actual running of the application and sending responses.
|
*/
return $app;
| {
"pile_set_name": "Github"
} |
// Package timeoutconn provides overridden net.Conn that supports deadline (timeout).
package timeoutconn
import (
"net"
"time"
)
// New creates a net.Conn with a timeout for every Read operation.
func New(netConn net.Conn, timeout time.Duration) net.Conn {
return &conn{netConn, timeout}
}
// A net.Conn that sets a deadline for every Read operation.
// FIXME was documented the deadline was on Write operation too but not implement
type conn struct {
net.Conn
timeout time.Duration
}
func (c *conn) Read(b []byte) (int, error) {
if c.timeout > 0 {
if err := c.Conn.SetReadDeadline(time.Now().Add(c.timeout)); err != nil {
return 0, err
}
}
return c.Conn.Read(b)
}
| {
"pile_set_name": "Github"
} |
TYPE=Ethernet
DEVICE=aliasem2
HWADDR=00:11:22:33:44:55
BOOTPROTO=none
ONBOOT=yes
DNS1=4.2.2.1
DNS2=4.2.2.2
IPADDR=192.168.1.5
PREFIX=24
NETMASK=255.255.255.0
GATEWAY=192.168.1.1
IPV6INIT=no
| {
"pile_set_name": "Github"
} |
# Copyright 2017 Yahoo Holdings. Licensed under the terms of the Apache 2.0 license. See LICENSE in the project root.
vespa_add_executable(vespalib_arrayqueue_test_app TEST
SOURCES
arrayqueue.cpp
DEPENDS
vespalib
)
vespa_add_test(NAME vespalib_arrayqueue_test_app COMMAND vespalib_arrayqueue_test_app)
| {
"pile_set_name": "Github"
} |
#include "config.h"
#include <stdio.h>
#include <string.h>
/**
* alignof - ALIGNOF() macro to determine alignment of a type.
*
* Many platforms have requirements that certain types must be aligned
* to certain address boundaries, such as ints needing to be on 4-byte
* boundaries. Attempting to access variables with incorrect
* alignment may cause performance loss or even program failure (eg. a
* bus signal).
*
* There are times which it's useful to be able to programatically
* access these requirements, such as for dynamic allocators.
*
* Example:
* #include <stdio.h>
* #include <stdlib.h>
* #include <ccan/alignof/alignof.h>
*
* // Output contains "ALIGNOF(char) == 1"
* // Will also print out whether an onstack char array can hold a long.
* int main(void)
* {
* char arr[sizeof(int)];
*
* printf("ALIGNOF(char) == %zu\n", ALIGNOF(char));
* if ((unsigned long)arr % ALIGNOF(int)) {
* printf("arr %p CANNOT hold an int\n", arr);
* exit(1);
* } else {
* printf("arr %p CAN hold an int\n", arr);
* exit(0);
* }
* }
*
* License: CC0 (Public domain)
* Author: Rusty Russell <[email protected]>
*/
int main(int argc, char *argv[])
{
if (argc != 2)
return 1;
if (strcmp(argv[1], "depends") == 0) {
return 0;
}
return 1;
}
| {
"pile_set_name": "Github"
} |
/*
* Copyright (C)2005-2019 Haxe Foundation
*
* Permission is hereby granted, free of charge, to any person obtaining a
* copy of this software and associated documentation files (the "Software"),
* to deal in the Software without restriction, including without limitation
* the rights to use, copy, modify, merge, publish, distribute, sublicense,
* and/or sell copies of the Software, and to permit persons to whom the
* Software is furnished to do so, subject to the following conditions:
*
* The above copyright notice and this permission notice shall be included in
* all copies or substantial portions of the Software.
*
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
* FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
* DEALINGS IN THE SOFTWARE.
*/
// This file is generated from mozilla\SVGGraphicsElement.webidl. Do not edit!
package js.html.svg;
typedef BoundingBoxOptions = {
var ?clipped : Bool;
var ?fill : Bool;
var ?markers : Bool;
var ?stroke : Bool;
} | {
"pile_set_name": "Github"
} |
/*
* Licensed to the Apache Software Foundation (ASF) under one or more
* contributor license agreements. See the NOTICE file distributed with
* this work for additional information regarding copyright ownership.
* The ASF licenses this file to You 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.
*
*/
package org.apache.skywalking.oap.server.core.metric.promethues.rule;
public enum CounterFunction {
INCREASE, RATE, IRATE
}
| {
"pile_set_name": "Github"
} |
<%@ page language="java" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8"%>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html lang="en">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>Chapter 07 - XSS Filter</title>
<link rel="stylesheet" type="text/css" href="resources/css/styles.css" />
</head>
<body>
<h1>Chapter 07 - XSS Filter</h1>
<p>This output is filtered by a blacklist filter and removes dangerous input before displaying the data. Depending
on your input, the next line might be empty. [] are used to indicate the position of the given input.</p>
<p>[<%= request.getParameter("blacklist") %>]</p>
<a href="<c:url value="/" />">Back</a>
</body>
</html> | {
"pile_set_name": "Github"
} |
#!/usr/bin/env node
var tern = require("../lib/tern"), condense = require("../lib/condense");
var path = require("path"), fs = require("fs");
require("../plugin/doc_comment");
var localDir = process.cwd(), ourDir = path.resolve(__dirname, "..");
var spans = true;
function usage(exit) {
console.error("usage: " + process.argv[1] + " [--name name] [--plugin name]* [--def name]* [+extrafile.js]* [file.js]+");
if (exit != null) process.exit(exit);
}
function findFile(file, where, ext) {
if (file.slice(file.length - ext.length) != ext) file += ext;
var local = path.resolve(localDir, file);
if (fs.existsSync(local)) return local;
var our = path.resolve(path.resolve(ourDir, where), file);
if (fs.existsSync(our)) return our;
}
var defs = [], plugins = {doc_comment: {}}, files = [], name;
function loadDef(name) {
var found = findFile(name, "defs", ".json");
if (!found) {
console.error("Could not find def file " + name);
process.exit(1);
}
defs.push(JSON.parse(fs.readFileSync(found, "utf8")));
}
loadDef("ecma5");
function loadPlugin(name, val) {
var found = findFile(name, "plugin", ".js");
if (!found) {
try {
found = require.resolve("tern-" + name);
} catch (e) {
console.error("Could not find plugin " + name);
process.exit(1);
}
}
var mod = require(found);
if (mod.hasOwnProperty("initialize")) mod.initialize(ourDir);
plugins[path.basename(name, ".js")] = val;
}
for (var i = 2, len = process.argv.length; i < len; ++i) {
var cur = process.argv[i];
if (cur == "--plugin" && i < len - 1) {
var plugin = process.argv[++i], eq = plugin.indexOf("=");
if (eq > -1)
loadPlugin(plugin.slice(0, eq), JSON.parse(plugin.slice(eq + 1)));
else
loadPlugin(plugin, {});
} else if (cur == "--def" && i < len - 1) {
loadDef(process.argv[++i]);
} else if (cur == "--name" && i < len - 1) {
name = process.argv[++i];
} else if (cur == "--no-spans") {
spans = false;
} else if (cur.charAt(0) == "-") {
usage(1);
} else {
files.push(cur);
}
}
var server = new tern.Server({
getFile: function(file) { return fs.readFileSync(path.resolve(localDir, file), "utf8"); },
defs: defs,
plugins: plugins,
debug: true,
projectDir: localDir
});
var origins = [];
for (var i = 0; i < files.length; ++i) {
var file = files[i];
if (file.charAt(0) == "+") {
file = file.slice(1);
} else {
origins.push(file);
if (!name) name = file;
}
if (!fs.existsSync(file)) {
console.error("File " + file + " does not exist");
process.exit(1);
}
server.addFile(file, fs.readFileSync(file, "utf8"));
}
if (!origins.length) usage(1);
server.flush(function(err) {
if (err) throw err;
console.log(JSON.stringify(condense.condense(origins, name, {spans: spans}), null, 2));
});
| {
"pile_set_name": "Github"
} |
package io.prometheus.client;
import java.util.List;
import java.util.regex.Pattern;
/**
* A collector for a set of metrics.
* <p>
* Normal users should use {@link Gauge}, {@link Counter}, {@link Summary} and {@link Histogram}.
* <p>
* Subclasssing Collector is for advanced uses, such as proxying metrics from another monitoring system.
* It is it the responsibility of subclasses to ensure they produce valid metrics.
* @see <a href="http://prometheus.io/docs/instrumenting/exposition_formats/">Exposition formats</a>.
*/
public abstract class Collector {
/**
* Return all of the metrics of this Collector.
*/
public abstract List<MetricFamilySamples> collect();
public enum Type {
COUNTER,
GAUGE,
SUMMARY,
HISTOGRAM,
UNTYPED,
}
/**
* A metric, and all of its samples.
*/
static public class MetricFamilySamples {
public final String name;
public final Type type;
public final String help;
public final List<Sample> samples;
public MetricFamilySamples(String name, Type type, String help, List<Sample> samples) {
this.name = name;
this.type = type;
this.help = help;
this.samples = samples;
}
@Override
public boolean equals(Object obj) {
if (!(obj instanceof MetricFamilySamples)) {
return false;
}
MetricFamilySamples other = (MetricFamilySamples) obj;
return other.name.equals(name) && other.type.equals(type)
&& other.help.equals(help) && other.samples.equals(samples) ;
}
@Override
public int hashCode() {
int hash = 1;
hash = 37 * hash + name.hashCode();
hash = 37 * hash + type.hashCode();
hash = 37 * hash + help.hashCode();
hash = 37 * hash + samples.hashCode();
return hash;
}
@Override
public String toString() {
return "Name: " + name + " Type: " + type + " Help: " + help +
" Samples: " + samples;
}
/**
* A single Sample, with a unique name and set of labels.
*/
public static class Sample {
public final String name;
public final List<String> labelNames;
public final List<String> labelValues; // Must have same length as labelNames.
public final double value;
public final Long timestampMs; // It's an epoch format with milliseconds value included (this field is subject to change).
public Sample(String name, List<String> labelNames, List<String> labelValues, double value, Long timestampMs) {
this.name = name;
this.labelNames = labelNames;
this.labelValues = labelValues;
this.value = value;
this.timestampMs = timestampMs;
}
public Sample(String name, List<String> labelNames, List<String> labelValues, double value) {
this(name, labelNames, labelValues, value, null);
}
@Override
public boolean equals(Object obj) {
if (!(obj instanceof Sample)) {
return false;
}
Sample other = (Sample) obj;
return other.name.equals(name) && other.labelNames.equals(labelNames)
&& other.labelValues.equals(labelValues) && other.value == value
&& ((timestampMs == null && other.timestampMs == null) || (other.timestampMs != null) && (other.timestampMs.equals(timestampMs)));
}
@Override
public int hashCode() {
int hash = 1;
hash = 37 * hash + name.hashCode();
hash = 37 * hash + labelNames.hashCode();
hash = 37 * hash + labelValues.hashCode();
long d = Double.doubleToLongBits(value);
hash = 37 * hash + (int)(d ^ (d >>> 32));
if (timestampMs != null) {
hash = 37 * hash + timestampMs.hashCode();
}
return hash;
}
@Override
public String toString() {
return "Name: " + name + " LabelNames: " + labelNames + " labelValues: " + labelValues +
" Value: " + value + " TimestampMs: " + timestampMs;
}
}
}
/**
* Register the Collector with the default registry.
*/
public <T extends Collector> T register() {
return register(CollectorRegistry.defaultRegistry);
}
/**
* Register the Collector with the given registry.
*/
public <T extends Collector> T register(CollectorRegistry registry) {
registry.register(this);
return (T)this;
}
public interface Describable {
/**
* Provide a list of metric families this Collector is expected to return.
*
* These should exclude the samples. This is used by the registry to
* detect collisions and duplicate registrations.
*
* Usually custom collectors do not have to implement Describable. If
* Describable is not implemented and the CollectorRegistry was created
* with auto describe enabled (which is the case for the default registry)
* then {@link collect} will be called at registration time instead of
* describe. If this could cause problems, either implement a proper
* describe, or if that's not practical have describe return an empty
* list.
*/
List<MetricFamilySamples> describe();
}
/* Various utility functions for implementing Collectors. */
/**
* Number of nanoseconds in a second.
*/
public static final double NANOSECONDS_PER_SECOND = 1E9;
/**
* Number of milliseconds in a second.
*/
public static final double MILLISECONDS_PER_SECOND = 1E3;
private static final Pattern METRIC_NAME_RE = Pattern.compile("[a-zA-Z_:][a-zA-Z0-9_:]*");
private static final Pattern METRIC_LABEL_NAME_RE = Pattern.compile("[a-zA-Z_][a-zA-Z0-9_]*");
private static final Pattern RESERVED_METRIC_LABEL_NAME_RE = Pattern.compile("__.*");
/**
* Throw an exception if the metric name is invalid.
*/
protected static void checkMetricName(String name) {
if (!METRIC_NAME_RE.matcher(name).matches()) {
throw new IllegalArgumentException("Invalid metric name: " + name);
}
}
private static final Pattern SANITIZE_PREFIX_PATTERN = Pattern.compile("^[^a-zA-Z_:]");
private static final Pattern SANITIZE_BODY_PATTERN = Pattern.compile("[^a-zA-Z0-9_:]");
/**
* Sanitize metric name
*/
public static String sanitizeMetricName(String metricName) {
return SANITIZE_BODY_PATTERN.matcher(
SANITIZE_PREFIX_PATTERN.matcher(metricName).replaceFirst("_")
).replaceAll("_");
}
/**
* Throw an exception if the metric label name is invalid.
*/
protected static void checkMetricLabelName(String name) {
if (!METRIC_LABEL_NAME_RE.matcher(name).matches()) {
throw new IllegalArgumentException("Invalid metric label name: " + name);
}
if (RESERVED_METRIC_LABEL_NAME_RE.matcher(name).matches()) {
throw new IllegalArgumentException("Invalid metric label name, reserved for internal use: " + name);
}
}
/**
* Convert a double to its string representation in Go.
*/
public static String doubleToGoString(double d) {
if (d == Double.POSITIVE_INFINITY) {
return "+Inf";
}
if (d == Double.NEGATIVE_INFINITY) {
return "-Inf";
}
if (Double.isNaN(d)) {
return "NaN";
}
return Double.toString(d);
}
}
| {
"pile_set_name": "Github"
} |
#
# Makefile.PL for Net::Pcap
#
# $Id: Makefile.PL 209 2005-03-21 02:37:37Z mbr $
#
use ExtUtils::MakeMaker;
WriteMakefile(
'NAME' => 'Net::Pcap',
'DISTNAME' => 'Net-Pcap',
'VERSION_FROM' => 'Pcap.pm',
'LIBS' => ['-lpcap'],
dist => {
'COMPRESS' => "gzip -9f",
'SUFFIX' => "gz"
}
);
| {
"pile_set_name": "Github"
} |
// Copyright 2013 The Go Authors. All rights reserved.
// Use of this source code is governed by a BSD-style
// license that can be found in the LICENSE file.
// Check for syntactically unreachable code.
package main
import (
"go/ast"
"go/token"
)
func init() {
register("unreachable",
"check for unreachable code",
checkUnreachable,
funcDecl, funcLit)
}
type deadState struct {
f *File
hasBreak map[ast.Stmt]bool
hasGoto map[string]bool
labels map[string]ast.Stmt
breakTarget ast.Stmt
reachable bool
}
// checkUnreachable checks a function body for dead code.
func checkUnreachable(f *File, node ast.Node) {
var body *ast.BlockStmt
switch n := node.(type) {
case *ast.FuncDecl:
body = n.Body
case *ast.FuncLit:
body = n.Body
}
if body == nil {
return
}
d := &deadState{
f: f,
hasBreak: make(map[ast.Stmt]bool),
hasGoto: make(map[string]bool),
labels: make(map[string]ast.Stmt),
}
d.findLabels(body)
d.reachable = true
d.findDead(body)
}
// findLabels gathers information about the labels defined and used by stmt
// and about which statements break, whether a label is involved or not.
func (d *deadState) findLabels(stmt ast.Stmt) {
switch x := stmt.(type) {
default:
d.f.Warnf(x.Pos(), "internal error in findLabels: unexpected statement %T", x)
case *ast.AssignStmt,
*ast.BadStmt,
*ast.DeclStmt,
*ast.DeferStmt,
*ast.EmptyStmt,
*ast.ExprStmt,
*ast.GoStmt,
*ast.IncDecStmt,
*ast.ReturnStmt,
*ast.SendStmt:
// no statements inside
case *ast.BlockStmt:
for _, stmt := range x.List {
d.findLabels(stmt)
}
case *ast.BranchStmt:
switch x.Tok {
case token.GOTO:
if x.Label != nil {
d.hasGoto[x.Label.Name] = true
}
case token.BREAK:
stmt := d.breakTarget
if x.Label != nil {
stmt = d.labels[x.Label.Name]
}
if stmt != nil {
d.hasBreak[stmt] = true
}
}
case *ast.IfStmt:
d.findLabels(x.Body)
if x.Else != nil {
d.findLabels(x.Else)
}
case *ast.LabeledStmt:
d.labels[x.Label.Name] = x.Stmt
d.findLabels(x.Stmt)
// These cases are all the same, but the x.Body only works
// when the specific type of x is known, so the cases cannot
// be merged.
case *ast.ForStmt:
outer := d.breakTarget
d.breakTarget = x
d.findLabels(x.Body)
d.breakTarget = outer
case *ast.RangeStmt:
outer := d.breakTarget
d.breakTarget = x
d.findLabels(x.Body)
d.breakTarget = outer
case *ast.SelectStmt:
outer := d.breakTarget
d.breakTarget = x
d.findLabels(x.Body)
d.breakTarget = outer
case *ast.SwitchStmt:
outer := d.breakTarget
d.breakTarget = x
d.findLabels(x.Body)
d.breakTarget = outer
case *ast.TypeSwitchStmt:
outer := d.breakTarget
d.breakTarget = x
d.findLabels(x.Body)
d.breakTarget = outer
case *ast.CommClause:
for _, stmt := range x.Body {
d.findLabels(stmt)
}
case *ast.CaseClause:
for _, stmt := range x.Body {
d.findLabels(stmt)
}
}
}
// findDead walks the statement looking for dead code.
// If d.reachable is false on entry, stmt itself is dead.
// When findDead returns, d.reachable tells whether the
// statement following stmt is reachable.
func (d *deadState) findDead(stmt ast.Stmt) {
// Is this a labeled goto target?
// If so, assume it is reachable due to the goto.
// This is slightly conservative, in that we don't
// check that the goto is reachable, so
// L: goto L
// will not provoke a warning.
// But it's good enough.
if x, isLabel := stmt.(*ast.LabeledStmt); isLabel && d.hasGoto[x.Label.Name] {
d.reachable = true
}
if !d.reachable {
switch stmt.(type) {
case *ast.EmptyStmt:
// do not warn about unreachable empty statements
default:
d.f.Bad(stmt.Pos(), "unreachable code")
d.reachable = true // silence error about next statement
}
}
switch x := stmt.(type) {
default:
d.f.Warnf(x.Pos(), "internal error in findDead: unexpected statement %T", x)
case *ast.AssignStmt,
*ast.BadStmt,
*ast.DeclStmt,
*ast.DeferStmt,
*ast.EmptyStmt,
*ast.GoStmt,
*ast.IncDecStmt,
*ast.SendStmt:
// no control flow
case *ast.BlockStmt:
for _, stmt := range x.List {
d.findDead(stmt)
}
case *ast.BranchStmt:
switch x.Tok {
case token.BREAK, token.GOTO, token.FALLTHROUGH:
d.reachable = false
case token.CONTINUE:
// NOTE: We accept "continue" statements as terminating.
// They are not necessary in the spec definition of terminating,
// because a continue statement cannot be the final statement
// before a return. But for the more general problem of syntactically
// identifying dead code, continue redirects control flow just
// like the other terminating statements.
d.reachable = false
}
case *ast.ExprStmt:
// Call to panic?
call, ok := x.X.(*ast.CallExpr)
if ok {
name, ok := call.Fun.(*ast.Ident)
if ok && name.Name == "panic" && name.Obj == nil {
d.reachable = false
}
}
case *ast.ForStmt:
d.findDead(x.Body)
d.reachable = x.Cond != nil || d.hasBreak[x]
case *ast.IfStmt:
d.findDead(x.Body)
if x.Else != nil {
r := d.reachable
d.reachable = true
d.findDead(x.Else)
d.reachable = d.reachable || r
} else {
// might not have executed if statement
d.reachable = true
}
case *ast.LabeledStmt:
d.findDead(x.Stmt)
case *ast.RangeStmt:
d.findDead(x.Body)
d.reachable = true
case *ast.ReturnStmt:
d.reachable = false
case *ast.SelectStmt:
// NOTE: Unlike switch and type switch below, we don't care
// whether a select has a default, because a select without a
// default blocks until one of the cases can run. That's different
// from a switch without a default, which behaves like it has
// a default with an empty body.
anyReachable := false
for _, comm := range x.Body.List {
d.reachable = true
for _, stmt := range comm.(*ast.CommClause).Body {
d.findDead(stmt)
}
anyReachable = anyReachable || d.reachable
}
d.reachable = anyReachable || d.hasBreak[x]
case *ast.SwitchStmt:
anyReachable := false
hasDefault := false
for _, cas := range x.Body.List {
cc := cas.(*ast.CaseClause)
if cc.List == nil {
hasDefault = true
}
d.reachable = true
for _, stmt := range cc.Body {
d.findDead(stmt)
}
anyReachable = anyReachable || d.reachable
}
d.reachable = anyReachable || d.hasBreak[x] || !hasDefault
case *ast.TypeSwitchStmt:
anyReachable := false
hasDefault := false
for _, cas := range x.Body.List {
cc := cas.(*ast.CaseClause)
if cc.List == nil {
hasDefault = true
}
d.reachable = true
for _, stmt := range cc.Body {
d.findDead(stmt)
}
anyReachable = anyReachable || d.reachable
}
d.reachable = anyReachable || d.hasBreak[x] || !hasDefault
}
}
| {
"pile_set_name": "Github"
} |
/*
* pata_efar.c - EFAR PIIX clone controller driver
*
* (C) 2005 Red Hat
* (C) 2009-2010 Bartlomiej Zolnierkiewicz
*
* Some parts based on ata_piix.c by Jeff Garzik and others.
*
* The EFAR is a PIIX4 clone with UDMA66 support. Unlike the later
* Intel ICH controllers the EFAR widened the UDMA mode register bits
* and doesn't require the funky clock selection.
*/
#include <linux/kernel.h>
#include <linux/module.h>
#include <linux/pci.h>
#include <linux/init.h>
#include <linux/blkdev.h>
#include <linux/delay.h>
#include <linux/device.h>
#include <scsi/scsi_host.h>
#include <linux/libata.h>
#include <linux/ata.h>
#define DRV_NAME "pata_efar"
#define DRV_VERSION "0.4.5"
/**
* efar_pre_reset - Enable bits
* @link: ATA link
* @deadline: deadline jiffies for the operation
*
* Perform cable detection for the EFAR ATA interface. This is
* different to the PIIX arrangement
*/
static int efar_pre_reset(struct ata_link *link, unsigned long deadline)
{
static const struct pci_bits efar_enable_bits[] = {
{ 0x41U, 1U, 0x80UL, 0x80UL }, /* port 0 */
{ 0x43U, 1U, 0x80UL, 0x80UL }, /* port 1 */
};
struct ata_port *ap = link->ap;
struct pci_dev *pdev = to_pci_dev(ap->host->dev);
if (!pci_test_config_bits(pdev, &efar_enable_bits[ap->port_no]))
return -ENOENT;
return ata_sff_prereset(link, deadline);
}
/**
* efar_cable_detect - check for 40/80 pin
* @ap: Port
*
* Perform cable detection for the EFAR ATA interface. This is
* different to the PIIX arrangement
*/
static int efar_cable_detect(struct ata_port *ap)
{
struct pci_dev *pdev = to_pci_dev(ap->host->dev);
u8 tmp;
pci_read_config_byte(pdev, 0x47, &tmp);
if (tmp & (2 >> ap->port_no))
return ATA_CBL_PATA40;
return ATA_CBL_PATA80;
}
static DEFINE_SPINLOCK(efar_lock);
/**
* efar_set_piomode - Initialize host controller PATA PIO timings
* @ap: Port whose timings we are configuring
* @adev: Device to program
*
* Set PIO mode for device, in host controller PCI config space.
*
* LOCKING:
* None (inherited from caller).
*/
static void efar_set_piomode (struct ata_port *ap, struct ata_device *adev)
{
unsigned int pio = adev->pio_mode - XFER_PIO_0;
struct pci_dev *dev = to_pci_dev(ap->host->dev);
unsigned int master_port = ap->port_no ? 0x42 : 0x40;
unsigned long flags;
u16 master_data;
u8 udma_enable;
int control = 0;
/*
* See Intel Document 298600-004 for the timing programing rules
* for PIIX/ICH. The EFAR is a clone so very similar
*/
static const /* ISP RTC */
u8 timings[][2] = { { 0, 0 },
{ 0, 0 },
{ 1, 0 },
{ 2, 1 },
{ 2, 3 }, };
if (pio > 1)
control |= 1; /* TIME */
if (ata_pio_need_iordy(adev)) /* PIO 3/4 require IORDY */
control |= 2; /* IE */
/* Intel specifies that the prefetch/posting is for disk only */
if (adev->class == ATA_DEV_ATA)
control |= 4; /* PPE */
spin_lock_irqsave(&efar_lock, flags);
pci_read_config_word(dev, master_port, &master_data);
/* Set PPE, IE, and TIME as appropriate */
if (adev->devno == 0) {
master_data &= 0xCCF0;
master_data |= control;
master_data |= (timings[pio][0] << 12) |
(timings[pio][1] << 8);
} else {
int shift = 4 * ap->port_no;
u8 slave_data;
master_data &= 0xFF0F;
master_data |= (control << 4);
/* Slave timing in separate register */
pci_read_config_byte(dev, 0x44, &slave_data);
slave_data &= ap->port_no ? 0x0F : 0xF0;
slave_data |= ((timings[pio][0] << 2) | timings[pio][1]) << shift;
pci_write_config_byte(dev, 0x44, slave_data);
}
master_data |= 0x4000; /* Ensure SITRE is set */
pci_write_config_word(dev, master_port, master_data);
pci_read_config_byte(dev, 0x48, &udma_enable);
udma_enable &= ~(1 << (2 * ap->port_no + adev->devno));
pci_write_config_byte(dev, 0x48, udma_enable);
spin_unlock_irqrestore(&efar_lock, flags);
}
/**
* efar_set_dmamode - Initialize host controller PATA DMA timings
* @ap: Port whose timings we are configuring
* @adev: Device to program
*
* Set UDMA/MWDMA mode for device, in host controller PCI config space.
*
* LOCKING:
* None (inherited from caller).
*/
static void efar_set_dmamode (struct ata_port *ap, struct ata_device *adev)
{
struct pci_dev *dev = to_pci_dev(ap->host->dev);
u8 master_port = ap->port_no ? 0x42 : 0x40;
u16 master_data;
u8 speed = adev->dma_mode;
int devid = adev->devno + 2 * ap->port_no;
unsigned long flags;
u8 udma_enable;
static const /* ISP RTC */
u8 timings[][2] = { { 0, 0 },
{ 0, 0 },
{ 1, 0 },
{ 2, 1 },
{ 2, 3 }, };
spin_lock_irqsave(&efar_lock, flags);
pci_read_config_word(dev, master_port, &master_data);
pci_read_config_byte(dev, 0x48, &udma_enable);
if (speed >= XFER_UDMA_0) {
unsigned int udma = adev->dma_mode - XFER_UDMA_0;
u16 udma_timing;
udma_enable |= (1 << devid);
/* Load the UDMA mode number */
pci_read_config_word(dev, 0x4A, &udma_timing);
udma_timing &= ~(7 << (4 * devid));
udma_timing |= udma << (4 * devid);
pci_write_config_word(dev, 0x4A, udma_timing);
} else {
/*
* MWDMA is driven by the PIO timings. We must also enable
* IORDY unconditionally along with TIME1. PPE has already
* been set when the PIO timing was set.
*/
unsigned int mwdma = adev->dma_mode - XFER_MW_DMA_0;
unsigned int control;
u8 slave_data;
const unsigned int needed_pio[3] = {
XFER_PIO_0, XFER_PIO_3, XFER_PIO_4
};
int pio = needed_pio[mwdma] - XFER_PIO_0;
control = 3; /* IORDY|TIME1 */
/* If the drive MWDMA is faster than it can do PIO then
we must force PIO into PIO0 */
if (adev->pio_mode < needed_pio[mwdma])
/* Enable DMA timing only */
control |= 8; /* PIO cycles in PIO0 */
if (adev->devno) { /* Slave */
master_data &= 0xFF4F; /* Mask out IORDY|TIME1|DMAONLY */
master_data |= control << 4;
pci_read_config_byte(dev, 0x44, &slave_data);
slave_data &= ap->port_no ? 0x0F : 0xF0;
/* Load the matching timing */
slave_data |= ((timings[pio][0] << 2) | timings[pio][1]) << (ap->port_no ? 4 : 0);
pci_write_config_byte(dev, 0x44, slave_data);
} else { /* Master */
master_data &= 0xCCF4; /* Mask out IORDY|TIME1|DMAONLY
and master timing bits */
master_data |= control;
master_data |=
(timings[pio][0] << 12) |
(timings[pio][1] << 8);
}
udma_enable &= ~(1 << devid);
pci_write_config_word(dev, master_port, master_data);
}
pci_write_config_byte(dev, 0x48, udma_enable);
spin_unlock_irqrestore(&efar_lock, flags);
}
static struct scsi_host_template efar_sht = {
ATA_BMDMA_SHT(DRV_NAME),
};
static struct ata_port_operations efar_ops = {
.inherits = &ata_bmdma_port_ops,
.cable_detect = efar_cable_detect,
.set_piomode = efar_set_piomode,
.set_dmamode = efar_set_dmamode,
.prereset = efar_pre_reset,
};
/**
* efar_init_one - Register EFAR ATA PCI device with kernel services
* @pdev: PCI device to register
* @ent: Entry in efar_pci_tbl matching with @pdev
*
* Called from kernel PCI layer.
*
* LOCKING:
* Inherited from PCI layer (may sleep).
*
* RETURNS:
* Zero on success, or -ERRNO value.
*/
static int efar_init_one (struct pci_dev *pdev, const struct pci_device_id *ent)
{
static const struct ata_port_info info = {
.flags = ATA_FLAG_SLAVE_POSS,
.pio_mask = ATA_PIO4,
.mwdma_mask = ATA_MWDMA12_ONLY,
.udma_mask = ATA_UDMA4,
.port_ops = &efar_ops,
};
const struct ata_port_info *ppi[] = { &info, &info };
ata_print_version_once(&pdev->dev, DRV_VERSION);
return ata_pci_bmdma_init_one(pdev, ppi, &efar_sht, NULL,
ATA_HOST_PARALLEL_SCAN);
}
static const struct pci_device_id efar_pci_tbl[] = {
{ PCI_VDEVICE(EFAR, 0x9130), },
{ } /* terminate list */
};
static struct pci_driver efar_pci_driver = {
.name = DRV_NAME,
.id_table = efar_pci_tbl,
.probe = efar_init_one,
.remove = ata_pci_remove_one,
#ifdef CONFIG_PM
.suspend = ata_pci_device_suspend,
.resume = ata_pci_device_resume,
#endif
};
module_pci_driver(efar_pci_driver);
MODULE_AUTHOR("Alan Cox");
MODULE_DESCRIPTION("SCSI low-level driver for EFAR PIIX clones");
MODULE_LICENSE("GPL");
MODULE_DEVICE_TABLE(pci, efar_pci_tbl);
MODULE_VERSION(DRV_VERSION);
| {
"pile_set_name": "Github"
} |
const models = require('../../models');
const {i18n} = require('../../lib/common');
const errors = require('@tryghost/errors');
const megaService = require('../../services/mega');
module.exports = {
docName: 'emails',
read: {
options: [
'fields'
],
validation: {
options: {
fields: ['html', 'plaintext', 'subject']
}
},
data: [
'id'
],
permissions: true,
query(frame) {
return models.Email.findOne(frame.data, frame.options)
.then((model) => {
if (!model) {
throw new errors.NotFoundError({
message: i18n.t('errors.models.email.emailNotFound')
});
}
return model;
});
}
},
retry: {
data: [
'id'
],
permissions: true,
query(frame) {
return models.Email.findOne(frame.data, frame.options)
.then(async (model) => {
if (!model) {
throw new errors.NotFoundError({
message: i18n.t('errors.models.email.emailNotFound')
});
}
if (model.get('status') !== 'failed') {
throw new errors.IncorrectUsageError({
message: i18n.t('errors.models.email.retryNotAllowed')
});
}
return await megaService.mega.retryFailedEmail(model);
});
}
}
};
| {
"pile_set_name": "Github"
} |
html {
background: #fff;
margin: 0 0 0 -1px;
padding: 0;
overflow-Y: scroll;
}
canvas {
border: #000000 solid 1px;
} | {
"pile_set_name": "Github"
} |
{
"channel_group": {
"groups": {
"Application": {
"groups": {
"Org1MSP": {
"groups": {},
"mod_policy": "Admins",
"policies": {
"Admins": {
"mod_policy": "Admins",
"policy": {
"type": 1,
"value": {
"identities": [
{
"principal": {
"msp_identifier": "Org1MSP",
"role": "ADMIN"
},
"principal_classification": "ROLE"
}
],
"rule": {
"n_out_of": {
"n": 1,
"rules": [
{
"signed_by": 0
}
]
}
},
"version": 0
}
},
"version": "0"
},
"Readers": {
"mod_policy": "Admins",
"policy": {
"type": 1,
"value": {
"identities": [
{
"principal": {
"msp_identifier": "Org1MSP",
"role": "ADMIN"
},
"principal_classification": "ROLE"
},
{
"principal": {
"msp_identifier": "Org1MSP",
"role": "PEER"
},
"principal_classification": "ROLE"
},
{
"principal": {
"msp_identifier": "Org1MSP",
"role": "CLIENT"
},
"principal_classification": "ROLE"
}
],
"rule": {
"n_out_of": {
"n": 1,
"rules": [
{
"signed_by": 0
},
{
"signed_by": 1
},
{
"signed_by": 2
}
]
}
},
"version": 0
}
},
"version": "0"
},
"Writers": {
"mod_policy": "Admins",
"policy": {
"type": 1,
"value": {
"identities": [
{
"principal": {
"msp_identifier": "Org1MSP",
"role": "ADMIN"
},
"principal_classification": "ROLE"
},
{
"principal": {
"msp_identifier": "Org1MSP",
"role": "CLIENT"
},
"principal_classification": "ROLE"
}
],
"rule": {
"n_out_of": {
"n": 1,
"rules": [
{
"signed_by": 0
},
{
"signed_by": 1
}
]
}
},
"version": 0
}
},
"version": "0"
}
},
"values": {
"AnchorPeers": {
"mod_policy": "Admins",
"value": {
"anchor_peers": [
{
"host": "peer0.org1.example.com",
"port": 7051
}
]
},
"version": "0"
},
"MSP": {
"mod_policy": "Admins",
"value": {
"config": {
"admins": [
"LS0tLS1CRUdJTiBDRVJUSUZJQ0FURS0tLS0tCk1JSUNLakNDQWRDZ0F3SUJBZ0lRVGZzcTJnejhOb1dBMVptWmFaOW9vakFLQmdncWhrak9QUVFEQWpCek1Rc3cKQ1FZRFZRUUdFd0pWVXpFVE1CRUdBMVVFQ0JNS1EyRnNhV1p2Y201cFlURVdNQlFHQTFVRUJ4TU5VMkZ1SUVaeQpZVzVqYVhOamJ6RVpNQmNHQTFVRUNoTVFiM0puTVM1bGVHRnRjR3hsTG1OdmJURWNNQm9HQTFVRUF4TVRZMkV1CmIzSm5NUzVsZUdGdGNHeGxMbU52YlRBZUZ3MHhPREV5TVRrd09ERTJNREJhRncweU9ERXlNVFl3T0RFMk1EQmEKTUd3eEN6QUpCZ05WQkFZVEFsVlRNUk13RVFZRFZRUUlFd3BEWVd4cFptOXlibWxoTVJZd0ZBWURWUVFIRXcxVApZVzRnUm5KaGJtTnBjMk52TVE4d0RRWURWUVFMRXdaamJHbGxiblF4SHpBZEJnTlZCQU1NRmtGa2JXbHVRRzl5Clp6RXVaWGhoYlhCc1pTNWpiMjB3V1RBVEJnY3Foa2pPUFFJQkJnZ3Foa2pPUFFNQkJ3TkNBQVRVK1U5UEdPeEgKY2tYV3JyNkl3MXRCM1Blb0ZqWjRXM1JXdyt2VUY4MVA2NnhxZ3pnb2dhZDE4TzFKWTBuRk8xc0c3VkgwdUYyNgpyejZaeEdKdTVDVkhvMDB3U3pBT0JnTlZIUThCQWY4RUJBTUNCNEF3REFZRFZSMFRBUUgvQkFJd0FEQXJCZ05WCkhTTUVKREFpZ0NBSllUL0ExejBNZTFydUpGOWJqUWp3VGVaeUNBa05sNU9RckJOR1RPNFZkREFLQmdncWhrak8KUFFRREFnTklBREJGQWlFQTlSUWZGNDJhM09QVGQ3TWg1T3hwclFoWTVlcWQ2T0w4MU1sV3pwbXRpd1lDSUdQNQpYS245aVp0UDllanpPOEo4Vm1JbE1QTjNlMXNhTXV3K2Y5aklkci9QCi0tLS0tRU5EIENFUlRJRklDQVRFLS0tLS0K"
],
"crypto_config": {
"identity_identifier_hash_function": "SHA256",
"signature_hash_family": "SHA2"
},
"fabric_node_ous": {
"client_ou_identifier": {
"certificate": "LS0tLS1CRUdJTiBDRVJUSUZJQ0FURS0tLS0tCk1JSUNSRENDQWVxZ0F3SUJBZ0lSQUloL3hNdFdmc0MvSUdkNVdYbTNJdFF3Q2dZSUtvWkl6ajBFQXdJd2N6RUwKTUFrR0ExVUVCaE1DVlZNeEV6QVJCZ05WQkFnVENrTmhiR2xtYjNKdWFXRXhGakFVQmdOVkJBY1REVk5oYmlCRwpjbUZ1WTJselkyOHhHVEFYQmdOVkJBb1RFRzl5WnpFdVpYaGhiWEJzWlM1amIyMHhIREFhQmdOVkJBTVRFMk5oCkxtOXlaekV1WlhoaGJYQnNaUzVqYjIwd0hoY05NVGd4TWpFNU1EZ3hOakF3V2hjTk1qZ3hNakUyTURneE5qQXcKV2pCek1Rc3dDUVlEVlFRR0V3SlZVekVUTUJFR0ExVUVDQk1LUTJGc2FXWnZjbTVwWVRFV01CUUdBMVVFQnhNTgpVMkZ1SUVaeVlXNWphWE5qYnpFWk1CY0dBMVVFQ2hNUWIzSm5NUzVsZUdGdGNHeGxMbU52YlRFY01Cb0dBMVVFCkF4TVRZMkV1YjNKbk1TNWxlR0Z0Y0d4bExtTnZiVEJaTUJNR0J5cUdTTTQ5QWdFR0NDcUdTTTQ5QXdFSEEwSUEKQkltVDZ3WjlFekNVQS8wK1lmSDM1dVhFRm5HOUo1MjIyZmlKaG94NVBpU0xocjZUSnFqZ0JQaFJMU0tkbVRybgpnTFNnOTVYN2FTTzZHREEvWEdXR0liR2pYekJkTUE0R0ExVWREd0VCL3dRRUF3SUJwakFQQmdOVkhTVUVDREFHCkJnUlZIU1VBTUE4R0ExVWRFd0VCL3dRRk1BTUJBZjh3S1FZRFZSME9CQ0lFSUFsaFA4RFhQUXg3V3U0a1gxdU4KQ1BCTjVuSUlDUTJYazVDc0UwWk03aFYwTUFvR0NDcUdTTTQ5QkFNQ0EwZ0FNRVVDSVFERTB2V1A3U0RNOHBkNQpZOG5sbUVuVHQ5WEErcmp4ZlQ3b3Y3Titzc3I1YkFJZ0d5WjJldXVzOGwzN0xkcFhXRndZQ3B6R2JEREFGdllPCkZQR1RIWmVPdm9RPQotLS0tLUVORCBDRVJUSUZJQ0FURS0tLS0tCg==",
"organizational_unit_identifier": "client"
},
"enable": true,
"peer_ou_identifier": {
"certificate": "LS0tLS1CRUdJTiBDRVJUSUZJQ0FURS0tLS0tCk1JSUNSRENDQWVxZ0F3SUJBZ0lSQUloL3hNdFdmc0MvSUdkNVdYbTNJdFF3Q2dZSUtvWkl6ajBFQXdJd2N6RUwKTUFrR0ExVUVCaE1DVlZNeEV6QVJCZ05WQkFnVENrTmhiR2xtYjNKdWFXRXhGakFVQmdOVkJBY1REVk5oYmlCRwpjbUZ1WTJselkyOHhHVEFYQmdOVkJBb1RFRzl5WnpFdVpYaGhiWEJzWlM1amIyMHhIREFhQmdOVkJBTVRFMk5oCkxtOXlaekV1WlhoaGJYQnNaUzVqYjIwd0hoY05NVGd4TWpFNU1EZ3hOakF3V2hjTk1qZ3hNakUyTURneE5qQXcKV2pCek1Rc3dDUVlEVlFRR0V3SlZVekVUTUJFR0ExVUVDQk1LUTJGc2FXWnZjbTVwWVRFV01CUUdBMVVFQnhNTgpVMkZ1SUVaeVlXNWphWE5qYnpFWk1CY0dBMVVFQ2hNUWIzSm5NUzVsZUdGdGNHeGxMbU52YlRFY01Cb0dBMVVFCkF4TVRZMkV1YjNKbk1TNWxlR0Z0Y0d4bExtTnZiVEJaTUJNR0J5cUdTTTQ5QWdFR0NDcUdTTTQ5QXdFSEEwSUEKQkltVDZ3WjlFekNVQS8wK1lmSDM1dVhFRm5HOUo1MjIyZmlKaG94NVBpU0xocjZUSnFqZ0JQaFJMU0tkbVRybgpnTFNnOTVYN2FTTzZHREEvWEdXR0liR2pYekJkTUE0R0ExVWREd0VCL3dRRUF3SUJwakFQQmdOVkhTVUVDREFHCkJnUlZIU1VBTUE4R0ExVWRFd0VCL3dRRk1BTUJBZjh3S1FZRFZSME9CQ0lFSUFsaFA4RFhQUXg3V3U0a1gxdU4KQ1BCTjVuSUlDUTJYazVDc0UwWk03aFYwTUFvR0NDcUdTTTQ5QkFNQ0EwZ0FNRVVDSVFERTB2V1A3U0RNOHBkNQpZOG5sbUVuVHQ5WEErcmp4ZlQ3b3Y3Titzc3I1YkFJZ0d5WjJldXVzOGwzN0xkcFhXRndZQ3B6R2JEREFGdllPCkZQR1RIWmVPdm9RPQotLS0tLUVORCBDRVJUSUZJQ0FURS0tLS0tCg==",
"organizational_unit_identifier": "peer"
}
},
"intermediate_certs": [],
"name": "Org1MSP",
"organizational_unit_identifiers": [],
"revocation_list": [],
"root_certs": [
"LS0tLS1CRUdJTiBDRVJUSUZJQ0FURS0tLS0tCk1JSUNSRENDQWVxZ0F3SUJBZ0lSQUloL3hNdFdmc0MvSUdkNVdYbTNJdFF3Q2dZSUtvWkl6ajBFQXdJd2N6RUwKTUFrR0ExVUVCaE1DVlZNeEV6QVJCZ05WQkFnVENrTmhiR2xtYjNKdWFXRXhGakFVQmdOVkJBY1REVk5oYmlCRwpjbUZ1WTJselkyOHhHVEFYQmdOVkJBb1RFRzl5WnpFdVpYaGhiWEJzWlM1amIyMHhIREFhQmdOVkJBTVRFMk5oCkxtOXlaekV1WlhoaGJYQnNaUzVqYjIwd0hoY05NVGd4TWpFNU1EZ3hOakF3V2hjTk1qZ3hNakUyTURneE5qQXcKV2pCek1Rc3dDUVlEVlFRR0V3SlZVekVUTUJFR0ExVUVDQk1LUTJGc2FXWnZjbTVwWVRFV01CUUdBMVVFQnhNTgpVMkZ1SUVaeVlXNWphWE5qYnpFWk1CY0dBMVVFQ2hNUWIzSm5NUzVsZUdGdGNHeGxMbU52YlRFY01Cb0dBMVVFCkF4TVRZMkV1YjNKbk1TNWxlR0Z0Y0d4bExtTnZiVEJaTUJNR0J5cUdTTTQ5QWdFR0NDcUdTTTQ5QXdFSEEwSUEKQkltVDZ3WjlFekNVQS8wK1lmSDM1dVhFRm5HOUo1MjIyZmlKaG94NVBpU0xocjZUSnFqZ0JQaFJMU0tkbVRybgpnTFNnOTVYN2FTTzZHREEvWEdXR0liR2pYekJkTUE0R0ExVWREd0VCL3dRRUF3SUJwakFQQmdOVkhTVUVDREFHCkJnUlZIU1VBTUE4R0ExVWRFd0VCL3dRRk1BTUJBZjh3S1FZRFZSME9CQ0lFSUFsaFA4RFhQUXg3V3U0a1gxdU4KQ1BCTjVuSUlDUTJYazVDc0UwWk03aFYwTUFvR0NDcUdTTTQ5QkFNQ0EwZ0FNRVVDSVFERTB2V1A3U0RNOHBkNQpZOG5sbUVuVHQ5WEErcmp4ZlQ3b3Y3Titzc3I1YkFJZ0d5WjJldXVzOGwzN0xkcFhXRndZQ3B6R2JEREFGdllPCkZQR1RIWmVPdm9RPQotLS0tLUVORCBDRVJUSUZJQ0FURS0tLS0tCg=="
],
"signing_identity": null,
"tls_intermediate_certs": [],
"tls_root_certs": [
"LS0tLS1CRUdJTiBDRVJUSUZJQ0FURS0tLS0tCk1JSUNTakNDQWZDZ0F3SUJBZ0lSQU9XZU1tQ1NKS0lPQ3pzNGlrVWEyT1l3Q2dZSUtvWkl6ajBFQXdJd2RqRUwKTUFrR0ExVUVCaE1DVlZNeEV6QVJCZ05WQkFnVENrTmhiR2xtYjNKdWFXRXhGakFVQmdOVkJBY1REVk5oYmlCRwpjbUZ1WTJselkyOHhHVEFYQmdOVkJBb1RFRzl5WnpFdVpYaGhiWEJzWlM1amIyMHhIekFkQmdOVkJBTVRGblJzCmMyTmhMbTl5WnpFdVpYaGhiWEJzWlM1amIyMHdIaGNOTVRneE1qRTVNRGd4TmpBd1doY05Namd4TWpFMk1EZ3gKTmpBd1dqQjJNUXN3Q1FZRFZRUUdFd0pWVXpFVE1CRUdBMVVFQ0JNS1EyRnNhV1p2Y201cFlURVdNQlFHQTFVRQpCeE1OVTJGdUlFWnlZVzVqYVhOamJ6RVpNQmNHQTFVRUNoTVFiM0puTVM1bGVHRnRjR3hsTG1OdmJURWZNQjBHCkExVUVBeE1XZEd4elkyRXViM0puTVM1bGVHRnRjR3hsTG1OdmJUQlpNQk1HQnlxR1NNNDlBZ0VHQ0NxR1NNNDkKQXdFSEEwSUFCRDVmSUFvM1hhTkJCRThLQUdMbWF6NWFXTGdzT3ltckIydHZFcnRKczNrSFRtZkRZMUFxL0ZvWgpFd2ZtRDRxOUV3dEo1ei9WL09ZMVZyZEU4MWNCZkhPalh6QmRNQTRHQTFVZER3RUIvd1FFQXdJQnBqQVBCZ05WCkhTVUVDREFHQmdSVkhTVUFNQThHQTFVZEV3RUIvd1FGTUFNQkFmOHdLUVlEVlIwT0JDSUVJTGJTcE5lNEJ2VzAKR1YwRWtCaDl2WWJYRmd1OVlJM0VqV3JCQUdCTi9vcGtNQW9HQ0NxR1NNNDlCQU1DQTBnQU1FVUNJUUM0ZTUwKwplc2htZWFFZXFtRlUwQzgzdGd1V2dsZUFvd3BnbitGTThoYzZtUUlnSllLNjd6cXNURkNldUJRVGZJQTNwcXRyCnNEYzVnbCtwY0w2STlLalcxV1E9Ci0tLS0tRU5EIENFUlRJRklDQVRFLS0tLS0K"
]
},
"type": 0
},
"version": "0"
}
},
"version": "1"
},
"Org2MSP": {
"groups": {},
"mod_policy": "Admins",
"policies": {
"Admins": {
"mod_policy": "Admins",
"policy": {
"type": 1,
"value": {
"identities": [
{
"principal": {
"msp_identifier": "Org2MSP",
"role": "ADMIN"
},
"principal_classification": "ROLE"
}
],
"rule": {
"n_out_of": {
"n": 1,
"rules": [
{
"signed_by": 0
}
]
}
},
"version": 0
}
},
"version": "0"
},
"Readers": {
"mod_policy": "Admins",
"policy": {
"type": 1,
"value": {
"identities": [
{
"principal": {
"msp_identifier": "Org2MSP",
"role": "ADMIN"
},
"principal_classification": "ROLE"
},
{
"principal": {
"msp_identifier": "Org2MSP",
"role": "PEER"
},
"principal_classification": "ROLE"
},
{
"principal": {
"msp_identifier": "Org2MSP",
"role": "CLIENT"
},
"principal_classification": "ROLE"
}
],
"rule": {
"n_out_of": {
"n": 1,
"rules": [
{
"signed_by": 0
},
{
"signed_by": 1
},
{
"signed_by": 2
}
]
}
},
"version": 0
}
},
"version": "0"
},
"Writers": {
"mod_policy": "Admins",
"policy": {
"type": 1,
"value": {
"identities": [
{
"principal": {
"msp_identifier": "Org2MSP",
"role": "ADMIN"
},
"principal_classification": "ROLE"
},
{
"principal": {
"msp_identifier": "Org2MSP",
"role": "CLIENT"
},
"principal_classification": "ROLE"
}
],
"rule": {
"n_out_of": {
"n": 1,
"rules": [
{
"signed_by": 0
},
{
"signed_by": 1
}
]
}
},
"version": 0
}
},
"version": "0"
}
},
"values": {
"AnchorPeers": {
"mod_policy": "Admins",
"value": {
"anchor_peers": [
{
"host": "peer0.org2.example.com",
"port": 7051
}
]
},
"version": "0"
},
"MSP": {
"mod_policy": "Admins",
"value": {
"config": {
"admins": [
"LS0tLS1CRUdJTiBDRVJUSUZJQ0FURS0tLS0tCk1JSUNLakNDQWRHZ0F3SUJBZ0lSQUpWSXltRmtKSlVwd0Q3MmZCRVM1Rm93Q2dZSUtvWkl6ajBFQXdJd2N6RUwKTUFrR0ExVUVCaE1DVlZNeEV6QVJCZ05WQkFnVENrTmhiR2xtYjNKdWFXRXhGakFVQmdOVkJBY1REVk5oYmlCRwpjbUZ1WTJselkyOHhHVEFYQmdOVkJBb1RFRzl5WnpJdVpYaGhiWEJzWlM1amIyMHhIREFhQmdOVkJBTVRFMk5oCkxtOXlaekl1WlhoaGJYQnNaUzVqYjIwd0hoY05NVGd4TWpFNU1EZ3hOakF3V2hjTk1qZ3hNakUyTURneE5qQXcKV2pCc01Rc3dDUVlEVlFRR0V3SlZVekVUTUJFR0ExVUVDQk1LUTJGc2FXWnZjbTVwWVRFV01CUUdBMVVFQnhNTgpVMkZ1SUVaeVlXNWphWE5qYnpFUE1BMEdBMVVFQ3hNR1kyeHBaVzUwTVI4d0hRWURWUVFEREJaQlpHMXBia0J2CmNtY3lMbVY0WVcxd2JHVXVZMjl0TUZrd0V3WUhLb1pJemowQ0FRWUlLb1pJemowREFRY0RRZ0FFOEVMMm9XR1oKQjg2VUpXZDhUUUFpS2d0TnNhUGYyN1ZiaHR6bUl3OTZ4L2dYUjlLRWZTSVV5MlJmSmNLOVJLNldYZUJtUEd0TQpQMmpJbzJVVkN3QjRKcU5OTUVzd0RnWURWUjBQQVFIL0JBUURBZ2VBTUF3R0ExVWRFd0VCL3dRQ01BQXdLd1lEClZSMGpCQ1F3SW9BZ3RtdGFJaXhKSnZmUnBmS0pLUGtzUFZBaVZhN0I2TTcwc1hSMm1DeHM0VUl3Q2dZSUtvWkkKemowRUF3SURSd0F3UkFJZ0VOcnpKQ3A3ZldGbC9SWEhranRMQUlsTWIrcVFFV2dBbTF2T0szT1Q5UlVDSUFyVgpmZFpMQ1hQczZrUFlucW0xNFJkNGZrQkR6SS9FQTRJdHI1SUo2ODdGCi0tLS0tRU5EIENFUlRJRklDQVRFLS0tLS0K"
],
"crypto_config": {
"identity_identifier_hash_function": "SHA256",
"signature_hash_family": "SHA2"
},
"fabric_node_ous": {
"client_ou_identifier": {
"certificate": "LS0tLS1CRUdJTiBDRVJUSUZJQ0FURS0tLS0tCk1JSUNRekNDQWVxZ0F3SUJBZ0lSQVB0UjhiaHdkTkxyY3N1UHVLRjJmNEF3Q2dZSUtvWkl6ajBFQXdJd2N6RUwKTUFrR0ExVUVCaE1DVlZNeEV6QVJCZ05WQkFnVENrTmhiR2xtYjNKdWFXRXhGakFVQmdOVkJBY1REVk5oYmlCRwpjbUZ1WTJselkyOHhHVEFYQmdOVkJBb1RFRzl5WnpJdVpYaGhiWEJzWlM1amIyMHhIREFhQmdOVkJBTVRFMk5oCkxtOXlaekl1WlhoaGJYQnNaUzVqYjIwd0hoY05NVGd4TWpFNU1EZ3hOakF3V2hjTk1qZ3hNakUyTURneE5qQXcKV2pCek1Rc3dDUVlEVlFRR0V3SlZVekVUTUJFR0ExVUVDQk1LUTJGc2FXWnZjbTVwWVRFV01CUUdBMVVFQnhNTgpVMkZ1SUVaeVlXNWphWE5qYnpFWk1CY0dBMVVFQ2hNUWIzSm5NaTVsZUdGdGNHeGxMbU52YlRFY01Cb0dBMVVFCkF4TVRZMkV1YjNKbk1pNWxlR0Z0Y0d4bExtTnZiVEJaTUJNR0J5cUdTTTQ5QWdFR0NDcUdTTTQ5QXdFSEEwSUEKQkxLTk5ndEwrTmNLRmY5ZDFDcDNnQTFORldsajU1L1IwUkQzclI4WmRLZEhTVmJIQXpQamY2N05ZMU1DcFJiOAphdXBjK1B0ekpsQWY3N3ZaWW1PSkIxNmpYekJkTUE0R0ExVWREd0VCL3dRRUF3SUJwakFQQmdOVkhTVUVDREFHCkJnUlZIU1VBTUE4R0ExVWRFd0VCL3dRRk1BTUJBZjh3S1FZRFZSME9CQ0lFSUxacldpSXNTU2IzMGFYeWlTajUKTEQxUUlsV3V3ZWpPOUxGMGRwZ3NiT0ZDTUFvR0NDcUdTTTQ5QkFNQ0EwY0FNRVFDSUh6Sm9FUnFWcUFqRzhiRwp6Ky9qMERvTi9ZOW5MWHV3MmUwYVVKWHdmUVJkQWlCeWpROC9wTzRVeEQxMDBSY0RsTWVDc3czVUgvVTIzSS9YCjIyUDBzL1k0bXc9PQotLS0tLUVORCBDRVJUSUZJQ0FURS0tLS0tCg==",
"organizational_unit_identifier": "client"
},
"enable": true,
"peer_ou_identifier": {
"certificate": "LS0tLS1CRUdJTiBDRVJUSUZJQ0FURS0tLS0tCk1JSUNRekNDQWVxZ0F3SUJBZ0lSQVB0UjhiaHdkTkxyY3N1UHVLRjJmNEF3Q2dZSUtvWkl6ajBFQXdJd2N6RUwKTUFrR0ExVUVCaE1DVlZNeEV6QVJCZ05WQkFnVENrTmhiR2xtYjNKdWFXRXhGakFVQmdOVkJBY1REVk5oYmlCRwpjbUZ1WTJselkyOHhHVEFYQmdOVkJBb1RFRzl5WnpJdVpYaGhiWEJzWlM1amIyMHhIREFhQmdOVkJBTVRFMk5oCkxtOXlaekl1WlhoaGJYQnNaUzVqYjIwd0hoY05NVGd4TWpFNU1EZ3hOakF3V2hjTk1qZ3hNakUyTURneE5qQXcKV2pCek1Rc3dDUVlEVlFRR0V3SlZVekVUTUJFR0ExVUVDQk1LUTJGc2FXWnZjbTVwWVRFV01CUUdBMVVFQnhNTgpVMkZ1SUVaeVlXNWphWE5qYnpFWk1CY0dBMVVFQ2hNUWIzSm5NaTVsZUdGdGNHeGxMbU52YlRFY01Cb0dBMVVFCkF4TVRZMkV1YjNKbk1pNWxlR0Z0Y0d4bExtTnZiVEJaTUJNR0J5cUdTTTQ5QWdFR0NDcUdTTTQ5QXdFSEEwSUEKQkxLTk5ndEwrTmNLRmY5ZDFDcDNnQTFORldsajU1L1IwUkQzclI4WmRLZEhTVmJIQXpQamY2N05ZMU1DcFJiOAphdXBjK1B0ekpsQWY3N3ZaWW1PSkIxNmpYekJkTUE0R0ExVWREd0VCL3dRRUF3SUJwakFQQmdOVkhTVUVDREFHCkJnUlZIU1VBTUE4R0ExVWRFd0VCL3dRRk1BTUJBZjh3S1FZRFZSME9CQ0lFSUxacldpSXNTU2IzMGFYeWlTajUKTEQxUUlsV3V3ZWpPOUxGMGRwZ3NiT0ZDTUFvR0NDcUdTTTQ5QkFNQ0EwY0FNRVFDSUh6Sm9FUnFWcUFqRzhiRwp6Ky9qMERvTi9ZOW5MWHV3MmUwYVVKWHdmUVJkQWlCeWpROC9wTzRVeEQxMDBSY0RsTWVDc3czVUgvVTIzSS9YCjIyUDBzL1k0bXc9PQotLS0tLUVORCBDRVJUSUZJQ0FURS0tLS0tCg==",
"organizational_unit_identifier": "peer"
}
},
"intermediate_certs": [],
"name": "Org2MSP",
"organizational_unit_identifiers": [],
"revocation_list": [],
"root_certs": [
"LS0tLS1CRUdJTiBDRVJUSUZJQ0FURS0tLS0tCk1JSUNRekNDQWVxZ0F3SUJBZ0lSQVB0UjhiaHdkTkxyY3N1UHVLRjJmNEF3Q2dZSUtvWkl6ajBFQXdJd2N6RUwKTUFrR0ExVUVCaE1DVlZNeEV6QVJCZ05WQkFnVENrTmhiR2xtYjNKdWFXRXhGakFVQmdOVkJBY1REVk5oYmlCRwpjbUZ1WTJselkyOHhHVEFYQmdOVkJBb1RFRzl5WnpJdVpYaGhiWEJzWlM1amIyMHhIREFhQmdOVkJBTVRFMk5oCkxtOXlaekl1WlhoaGJYQnNaUzVqYjIwd0hoY05NVGd4TWpFNU1EZ3hOakF3V2hjTk1qZ3hNakUyTURneE5qQXcKV2pCek1Rc3dDUVlEVlFRR0V3SlZVekVUTUJFR0ExVUVDQk1LUTJGc2FXWnZjbTVwWVRFV01CUUdBMVVFQnhNTgpVMkZ1SUVaeVlXNWphWE5qYnpFWk1CY0dBMVVFQ2hNUWIzSm5NaTVsZUdGdGNHeGxMbU52YlRFY01Cb0dBMVVFCkF4TVRZMkV1YjNKbk1pNWxlR0Z0Y0d4bExtTnZiVEJaTUJNR0J5cUdTTTQ5QWdFR0NDcUdTTTQ5QXdFSEEwSUEKQkxLTk5ndEwrTmNLRmY5ZDFDcDNnQTFORldsajU1L1IwUkQzclI4WmRLZEhTVmJIQXpQamY2N05ZMU1DcFJiOAphdXBjK1B0ekpsQWY3N3ZaWW1PSkIxNmpYekJkTUE0R0ExVWREd0VCL3dRRUF3SUJwakFQQmdOVkhTVUVDREFHCkJnUlZIU1VBTUE4R0ExVWRFd0VCL3dRRk1BTUJBZjh3S1FZRFZSME9CQ0lFSUxacldpSXNTU2IzMGFYeWlTajUKTEQxUUlsV3V3ZWpPOUxGMGRwZ3NiT0ZDTUFvR0NDcUdTTTQ5QkFNQ0EwY0FNRVFDSUh6Sm9FUnFWcUFqRzhiRwp6Ky9qMERvTi9ZOW5MWHV3MmUwYVVKWHdmUVJkQWlCeWpROC9wTzRVeEQxMDBSY0RsTWVDc3czVUgvVTIzSS9YCjIyUDBzL1k0bXc9PQotLS0tLUVORCBDRVJUSUZJQ0FURS0tLS0tCg=="
],
"signing_identity": null,
"tls_intermediate_certs": [],
"tls_root_certs": [
"LS0tLS1CRUdJTiBDRVJUSUZJQ0FURS0tLS0tCk1JSUNTakNDQWZDZ0F3SUJBZ0lSQUpMMmtzM3N1bU5Ld1BMdkwyZ011eUV3Q2dZSUtvWkl6ajBFQXdJd2RqRUwKTUFrR0ExVUVCaE1DVlZNeEV6QVJCZ05WQkFnVENrTmhiR2xtYjNKdWFXRXhGakFVQmdOVkJBY1REVk5oYmlCRwpjbUZ1WTJselkyOHhHVEFYQmdOVkJBb1RFRzl5WnpJdVpYaGhiWEJzWlM1amIyMHhIekFkQmdOVkJBTVRGblJzCmMyTmhMbTl5WnpJdVpYaGhiWEJzWlM1amIyMHdIaGNOTVRneE1qRTVNRGd4TmpBd1doY05Namd4TWpFMk1EZ3gKTmpBd1dqQjJNUXN3Q1FZRFZRUUdFd0pWVXpFVE1CRUdBMVVFQ0JNS1EyRnNhV1p2Y201cFlURVdNQlFHQTFVRQpCeE1OVTJGdUlFWnlZVzVqYVhOamJ6RVpNQmNHQTFVRUNoTVFiM0puTWk1bGVHRnRjR3hsTG1OdmJURWZNQjBHCkExVUVBeE1XZEd4elkyRXViM0puTWk1bGVHRnRjR3hsTG1OdmJUQlpNQk1HQnlxR1NNNDlBZ0VHQ0NxR1NNNDkKQXdFSEEwSUFCRzhzSEswbkpjMThWc1pQUXFDU2FGYjI1dlBGbUR0djVmeEcraWF6MkZ3QXVEeEdLRVBHMy9YWQorSS8yR1UyU1hUaTF6UmVHdGI1RDNBWVRrcFA1cndTalh6QmRNQTRHQTFVZER3RUIvd1FFQXdJQnBqQVBCZ05WCkhTVUVDREFHQmdSVkhTVUFNQThHQTFVZEV3RUIvd1FGTUFNQkFmOHdLUVlEVlIwT0JDSUVJQjdCK1lJQ0xTK1UKbHhyRTRNQ2FIZDdaaG5lYmZRYWUvbmdUZUJVMDBhZVNNQW9HQ0NxR1NNNDlCQU1DQTBnQU1FVUNJUUNSY2lOcgpxa0h3cy9HTCt4MGlGNXJuRm5VcEJ2akdxMkRTazFjRTRuMXdUZ0lnS2wrbk9Fb3JQM0VyQXVmWW1VSlVZWTQyCnlsaUlvb3hLMWJsWXRqOXdZQmM9Ci0tLS0tRU5EIENFUlRJRklDQVRFLS0tLS0K"
]
},
"type": 0
},
"version": "0"
}
},
"version": "1"
}
},
"mod_policy": "Admins",
"policies": {
"Admins": {
"mod_policy": "Admins",
"policy": {
"type": 3,
"value": {
"rule": "MAJORITY",
"sub_policy": "Admins"
}
},
"version": "0"
},
"Readers": {
"mod_policy": "Admins",
"policy": {
"type": 3,
"value": {
"rule": "ANY",
"sub_policy": "Readers"
}
},
"version": "0"
},
"Writers": {
"mod_policy": "Admins",
"policy": {
"type": 3,
"value": {
"rule": "ANY",
"sub_policy": "Writers"
}
},
"version": "0"
}
},
"values": {
"Capabilities": {
"mod_policy": "Admins",
"value": {
"capabilities": {
"V1_3": {}
}
},
"version": "0"
}
},
"version": "1"
},
"Orderer": {
"groups": {
"OrdererOrg": {
"groups": {},
"mod_policy": "Admins",
"policies": {
"Admins": {
"mod_policy": "Admins",
"policy": {
"type": 1,
"value": {
"identities": [
{
"principal": {
"msp_identifier": "OrdererMSP",
"role": "ADMIN"
},
"principal_classification": "ROLE"
}
],
"rule": {
"n_out_of": {
"n": 1,
"rules": [
{
"signed_by": 0
}
]
}
},
"version": 0
}
},
"version": "0"
},
"Readers": {
"mod_policy": "Admins",
"policy": {
"type": 1,
"value": {
"identities": [
{
"principal": {
"msp_identifier": "OrdererMSP",
"role": "MEMBER"
},
"principal_classification": "ROLE"
}
],
"rule": {
"n_out_of": {
"n": 1,
"rules": [
{
"signed_by": 0
}
]
}
},
"version": 0
}
},
"version": "0"
},
"Writers": {
"mod_policy": "Admins",
"policy": {
"type": 1,
"value": {
"identities": [
{
"principal": {
"msp_identifier": "OrdererMSP",
"role": "MEMBER"
},
"principal_classification": "ROLE"
}
],
"rule": {
"n_out_of": {
"n": 1,
"rules": [
{
"signed_by": 0
}
]
}
},
"version": 0
}
},
"version": "0"
}
},
"values": {
"MSP": {
"mod_policy": "Admins",
"value": {
"config": {
"admins": [
"LS0tLS1CRUdJTiBDRVJUSUZJQ0FURS0tLS0tCk1JSUNDakNDQWJHZ0F3SUJBZ0lSQU42UDlPSUN3a2o1dHhZbDZFZ0orajh3Q2dZSUtvWkl6ajBFQXdJd2FURUwKTUFrR0ExVUVCaE1DVlZNeEV6QVJCZ05WQkFnVENrTmhiR2xtYjNKdWFXRXhGakFVQmdOVkJBY1REVk5oYmlCRwpjbUZ1WTJselkyOHhGREFTQmdOVkJBb1RDMlY0WVcxd2JHVXVZMjl0TVJjd0ZRWURWUVFERXc1allTNWxlR0Z0CmNHeGxMbU52YlRBZUZ3MHhPREV5TVRrd09ERTJNREJhRncweU9ERXlNVFl3T0RFMk1EQmFNRll4Q3pBSkJnTlYKQkFZVEFsVlRNUk13RVFZRFZRUUlFd3BEWVd4cFptOXlibWxoTVJZd0ZBWURWUVFIRXcxVFlXNGdSbkpoYm1OcApjMk52TVJvd0dBWURWUVFEREJGQlpHMXBia0JsZUdGdGNHeGxMbU52YlRCWk1CTUdCeXFHU000OUFnRUdDQ3FHClNNNDlBd0VIQTBJQUJMVjdVS0FncG5vZnQ4WlY3VzNQMVBOZVVHamttUDB2SjNsUXZ2MU5KK0lKQWRYSDBTWU8KZ3pWa2pCZ09EWVlpZHgwOHJQTlFCeGpjOUhJTUc2K3J4c3lqVFRCTE1BNEdBMVVkRHdFQi93UUVBd0lIZ0RBTQpCZ05WSFJNQkFmOEVBakFBTUNzR0ExVWRJd1FrTUNLQUlCUnI2M21LYmEvMnF2bndsb0RjZWZMUEVvYkhRR1dUCnk0VGFyd0RlQnFwQU1Bb0dDQ3FHU000OUJBTUNBMGNBTUVRQ0lIbmp0SHhVRk5XVXN6OFRzZG1JWWFRT0prcVIKMGRtbUl2K0dMcHk5UUY5VUFpQXlGbXp3eFRnM1VoVGNVT3FhZ2NnejBPcjhOT3ZERXVuY1dlMzhWaHo3bmc9PQotLS0tLUVORCBDRVJUSUZJQ0FURS0tLS0tCg=="
],
"crypto_config": {
"identity_identifier_hash_function": "SHA256",
"signature_hash_family": "SHA2"
},
"fabric_node_ous": null,
"intermediate_certs": [],
"name": "OrdererMSP",
"organizational_unit_identifiers": [],
"revocation_list": [],
"root_certs": [
"LS0tLS1CRUdJTiBDRVJUSUZJQ0FURS0tLS0tCk1JSUNNRENDQWRhZ0F3SUJBZ0lSQVA5S0hkLzdOSlQyeGo3REFvb210d2t3Q2dZSUtvWkl6ajBFQXdJd2FURUwKTUFrR0ExVUVCaE1DVlZNeEV6QVJCZ05WQkFnVENrTmhiR2xtYjNKdWFXRXhGakFVQmdOVkJBY1REVk5oYmlCRwpjbUZ1WTJselkyOHhGREFTQmdOVkJBb1RDMlY0WVcxd2JHVXVZMjl0TVJjd0ZRWURWUVFERXc1allTNWxlR0Z0CmNHeGxMbU52YlRBZUZ3MHhPREV5TVRrd09ERTJNREJhRncweU9ERXlNVFl3T0RFMk1EQmFNR2t4Q3pBSkJnTlYKQkFZVEFsVlRNUk13RVFZRFZRUUlFd3BEWVd4cFptOXlibWxoTVJZd0ZBWURWUVFIRXcxVFlXNGdSbkpoYm1OcApjMk52TVJRd0VnWURWUVFLRXd0bGVHRnRjR3hsTG1OdmJURVhNQlVHQTFVRUF4TU9ZMkV1WlhoaGJYQnNaUzVqCmIyMHdXVEFUQmdjcWhrak9QUUlCQmdncWhrak9QUU1CQndOQ0FBVFl4NkNoSXBzZ2FFM2c5YWR4OWZDMXM2OFQKdUFDa2JjZ21TWWFSTEVGWGw0M0dBSGk0blVOZk5BZzR2d1NwczZLNTR1SmFHanNyREpUQnJFTU0rajZZbzE4dwpYVEFPQmdOVkhROEJBZjhFQkFNQ0FhWXdEd1lEVlIwbEJBZ3dCZ1lFVlIwbEFEQVBCZ05WSFJNQkFmOEVCVEFECkFRSC9NQ2tHQTFVZERnUWlCQ0FVYSt0NWltMnY5cXI1OEphQTNIbnl6eEtHeDBCbGs4dUUycThBM2dhcVFEQUsKQmdncWhrak9QUVFEQWdOSUFEQkZBaUVBbWtyRWdBNWVReUNGeHNGOXRxNTMyNDFrT2dqQXBYdE51T3ExNVRVcgpuWVVDSUZJMzViMlQ5NWZoL1UyMnVnMFQvajdvMHRRaFJvMVpCaWZ2T0Y5aFFwSnkKLS0tLS1FTkQgQ0VSVElGSUNBVEUtLS0tLQo="
],
"signing_identity": null,
"tls_intermediate_certs": [],
"tls_root_certs": [
"LS0tLS1CRUdJTiBDRVJUSUZJQ0FURS0tLS0tCk1JSUNORENDQWR1Z0F3SUJBZ0lRT2lzN25hNk1zRDQ1dWNvUkh0ZmFNekFLQmdncWhrak9QUVFEQWpCc01Rc3cKQ1FZRFZRUUdFd0pWVXpFVE1CRUdBMVVFQ0JNS1EyRnNhV1p2Y201cFlURVdNQlFHQTFVRUJ4TU5VMkZ1SUVaeQpZVzVqYVhOamJ6RVVNQklHQTFVRUNoTUxaWGhoYlhCc1pTNWpiMjB4R2pBWUJnTlZCQU1URVhSc2MyTmhMbVY0CllXMXdiR1V1WTI5dE1CNFhEVEU0TVRJeE9UQTRNVFl3TUZvWERUSTRNVEl4TmpBNE1UWXdNRm93YkRFTE1Ba0cKQTFVRUJoTUNWVk14RXpBUkJnTlZCQWdUQ2tOaGJHbG1iM0p1YVdFeEZqQVVCZ05WQkFjVERWTmhiaUJHY21GdQpZMmx6WTI4eEZEQVNCZ05WQkFvVEMyVjRZVzF3YkdVdVkyOXRNUm93R0FZRFZRUURFeEYwYkhOallTNWxlR0Z0CmNHeGxMbU52YlRCWk1CTUdCeXFHU000OUFnRUdDQ3FHU000OUF3RUhBMElBQkl6OFQvRU5wTjBNV0RKQzlBVloKajNJTXlsc0REdEYrZTAwb0NWMlcvSkp2aWdDb3hNVU5PM2x1dTNBaWZKL3J0UkU5QnJMcmV1YlNrTFlnZWpLbAo2b21qWHpCZE1BNEdBMVVkRHdFQi93UUVBd0lCcGpBUEJnTlZIU1VFQ0RBR0JnUlZIU1VBTUE4R0ExVWRFd0VCCi93UUZNQU1CQWY4d0tRWURWUjBPQkNJRUlBM3ptaFFZdXNzbVVxdHpvTHVCcGFqNHJ3d0lXK1EvZk5oVWZGVjQKMm9jb01Bb0dDQ3FHU000OUJBTUNBMGNBTUVRQ0lEeC9kRU9mMzNaYWY5Qk1Hamh6UlhvYTJEKzNvakJsTTVCRAprV29hU29FbEFpQkJDTW9VNUIxMndjZFZoak4wcjlrWGNTeGpXQWZjV2FPZUFqZTB6d0Jhcmc9PQotLS0tLUVORCBDRVJUSUZJQ0FURS0tLS0tCg=="
]
},
"type": 0
},
"version": "0"
}
},
"version": "0"
}
},
"mod_policy": "Admins",
"policies": {
"Admins": {
"mod_policy": "Admins",
"policy": {
"type": 3,
"value": {
"rule": "MAJORITY",
"sub_policy": "Admins"
}
},
"version": "0"
},
"BlockValidation": {
"mod_policy": "Admins",
"policy": {
"type": 3,
"value": {
"rule": "ANY",
"sub_policy": "Writers"
}
},
"version": "0"
},
"Readers": {
"mod_policy": "Admins",
"policy": {
"type": 3,
"value": {
"rule": "ANY",
"sub_policy": "Readers"
}
},
"version": "0"
},
"Writers": {
"mod_policy": "Admins",
"policy": {
"type": 3,
"value": {
"rule": "ANY",
"sub_policy": "Writers"
}
},
"version": "0"
}
},
"values": {
"BatchSize": {
"mod_policy": "Admins",
"value": {
"absolute_max_bytes": 102760448,
"max_message_count": 10,
"preferred_max_bytes": 524288
},
"version": "0"
},
"BatchTimeout": {
"mod_policy": "Admins",
"value": {
"timeout": "2s"
},
"version": "0"
},
"Capabilities": {
"mod_policy": "Admins",
"value": {
"capabilities": {
"V1_1": {}
}
},
"version": "0"
},
"ChannelRestrictions": {
"mod_policy": "Admins",
"value": null,
"version": "0"
},
"ConsensusType": {
"mod_policy": "Admins",
"value": {
"metadata": null,
"type": "solo"
},
"version": "0"
}
},
"version": "0"
}
},
"mod_policy": "Admins",
"policies": {
"Admins": {
"mod_policy": "Admins",
"policy": {
"type": 3,
"value": {
"rule": "MAJORITY",
"sub_policy": "Admins"
}
},
"version": "0"
},
"Readers": {
"mod_policy": "Admins",
"policy": {
"type": 3,
"value": {
"rule": "ANY",
"sub_policy": "Readers"
}
},
"version": "0"
},
"Writers": {
"mod_policy": "Admins",
"policy": {
"type": 3,
"value": {
"rule": "ANY",
"sub_policy": "Writers"
}
},
"version": "0"
}
},
"values": {
"BlockDataHashingStructure": {
"mod_policy": "Admins",
"value": {
"width": 4294967295
},
"version": "0"
},
"Capabilities": {
"mod_policy": "Admins",
"value": {
"capabilities": {
"V1_3": {}
}
},
"version": "0"
},
"Consortium": {
"mod_policy": "Admins",
"value": {
"name": "SampleConsortium"
},
"version": "0"
},
"HashingAlgorithm": {
"mod_policy": "Admins",
"value": {
"name": "SHA256"
},
"version": "0"
},
"OrdererAddresses": {
"mod_policy": "/Channel/Orderer/Admins",
"value": {
"addresses": [
"orderer0.example.com:7050"
]
},
"version": "0"
}
},
"version": "0"
},
"sequence": "3"
}
| {
"pile_set_name": "Github"
} |
/*
* Copyright (c) 1991, 1992 Paul Kranenburg <[email protected]>
* Copyright (c) 1993 Branko Lankester <[email protected]>
* Copyright (c) 1993, 1994, 1995, 1996 Rick Sladkey <[email protected]>
* Copyright (c) 1996-1999 Wichert Akkerman <[email protected]>
* Copyright (c) 2005, 2006 Dmitry V. Levin <[email protected]>
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
* are met:
* 1. Redistributions of source code must retain the above copyright
* notice, this list of conditions and the following disclaimer.
* 2. Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in the
* documentation and/or other materials provided with the distribution.
* 3. The name of the author may not be used to endorse or promote products
* derived from this software without specific prior written permission.
*
* THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR
* IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
* OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
* IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
* INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
* NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
* DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
* THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
* THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
#include "defs.h"
#define SUBCMDMASK 0x00ff
#define SUBCMDSHIFT 8
#define QCMD_CMD(cmd) ((u_int32_t)(cmd) >> SUBCMDSHIFT)
#define QCMD_TYPE(cmd) ((u_int32_t)(cmd) & SUBCMDMASK)
#define OLD_CMD(cmd) ((u_int32_t)(cmd) << 8)
#define NEW_CMD(cmd) ((u_int32_t)(cmd) | 0x800000)
#define XQM_CMD(cmd) ((u_int32_t)(cmd) | ('X'<<8))
#define Q_V1_QUOTAON OLD_CMD(0x1)
#define Q_V1_QUOTAOFF OLD_CMD(0x2)
#define Q_V1_GETQUOTA OLD_CMD(0x3)
#define Q_V1_SETQUOTA OLD_CMD(0x4)
#define Q_V1_SETUSE OLD_CMD(0x5)
#define Q_V1_SYNC OLD_CMD(0x6)
#define Q_SETQLIM OLD_CMD(0x7)
#define Q_V1_GETSTATS OLD_CMD(0x8)
#define Q_V1_RSQUASH OLD_CMD(0x10)
#define Q_V2_GETQUOTA OLD_CMD(0xD)
#define Q_V2_SETQUOTA OLD_CMD(0xE)
#define Q_V2_SETUSE OLD_CMD(0xF)
#define Q_V2_GETINFO OLD_CMD(0x9)
#define Q_V2_SETINFO OLD_CMD(0xA)
#define Q_V2_SETGRACE OLD_CMD(0xB)
#define Q_V2_SETFLAGS OLD_CMD(0xC)
#define Q_V2_GETSTATS OLD_CMD(0x11)
#define Q_SYNC NEW_CMD(0x1)
#define Q_QUOTAON NEW_CMD(0x2)
#define Q_QUOTAOFF NEW_CMD(0x3)
#define Q_GETFMT NEW_CMD(0x4)
#define Q_GETINFO NEW_CMD(0x5)
#define Q_SETINFO NEW_CMD(0x6)
#define Q_GETQUOTA NEW_CMD(0x7)
#define Q_SETQUOTA NEW_CMD(0x8)
#define Q_XQUOTAON XQM_CMD(0x1)
#define Q_XQUOTAOFF XQM_CMD(0x2)
#define Q_XGETQUOTA XQM_CMD(0x3)
#define Q_XSETQLIM XQM_CMD(0x4)
#define Q_XGETQSTAT XQM_CMD(0x5)
#define Q_XQUOTARM XQM_CMD(0x6)
#define Q_XQUOTASYNC XQM_CMD(0x7)
static const struct xlat quotacmds[] = {
{Q_V1_QUOTAON, "Q_V1_QUOTAON"},
{Q_V1_QUOTAOFF, "Q_V1_QUOTAOFF"},
{Q_V1_GETQUOTA, "Q_V1_GETQUOTA"},
{Q_V1_SETQUOTA, "Q_V1_SETQUOTA"},
{Q_V1_SETUSE, "Q_V1_SETUSE"},
{Q_V1_SYNC, "Q_V1_SYNC"},
{Q_SETQLIM, "Q_SETQLIM"},
{Q_V1_GETSTATS, "Q_V1_GETSTATS"},
{Q_V1_RSQUASH, "Q_V1_RSQUASH"},
{Q_V2_GETQUOTA, "Q_V2_GETQUOTA"},
{Q_V2_SETQUOTA, "Q_V2_SETQUOTA"},
{Q_V2_SETUSE, "Q_V2_SETUSE"},
{Q_V2_GETINFO, "Q_V2_GETINFO"},
{Q_V2_SETINFO, "Q_V2_SETINFO"},
{Q_V2_SETGRACE, "Q_V2_SETGRACE"},
{Q_V2_SETFLAGS, "Q_V2_SETFLAGS"},
{Q_V2_GETSTATS, "Q_V2_GETSTATS"},
{Q_SYNC, "Q_SYNC"},
{Q_QUOTAON, "Q_QUOTAON"},
{Q_QUOTAOFF, "Q_QUOTAOFF"},
{Q_GETFMT, "Q_GETFMT"},
{Q_GETINFO, "Q_GETINFO"},
{Q_SETINFO, "Q_SETINFO"},
{Q_GETQUOTA, "Q_GETQUOTA"},
{Q_SETQUOTA, "Q_SETQUOTA"},
{Q_XQUOTAON, "Q_XQUOTAON"},
{Q_XQUOTAOFF, "Q_XQUOTAOFF"},
{Q_XGETQUOTA, "Q_XGETQUOTA"},
{Q_XSETQLIM, "Q_XSETQLIM"},
{Q_XGETQSTAT, "Q_XGETQSTAT"},
{Q_XQUOTARM, "Q_XQUOTARM"},
{Q_XQUOTASYNC, "Q_XQUOTASYNC"},
{0, NULL},
};
#define USRQUOTA 0
#define GRPQUOTA 1
static const struct xlat quotatypes[] = {
{USRQUOTA, "USRQUOTA"},
{GRPQUOTA, "GRPQUOTA"},
{0, NULL},
};
/* Quota format identifiers */
#define QFMT_VFS_OLD 1
#define QFMT_VFS_V0 2
static const struct xlat quota_formats[] = {
{QFMT_VFS_OLD, "QFMT_VFS_OLD"},
{QFMT_VFS_V0, "QFMT_VFS_V0"},
{0, NULL},
};
#define XFS_QUOTA_UDQ_ACCT (1<<0) /* user quota accounting */
#define XFS_QUOTA_UDQ_ENFD (1<<1) /* user quota limits enforcement */
#define XFS_QUOTA_GDQ_ACCT (1<<2) /* group quota accounting */
#define XFS_QUOTA_GDQ_ENFD (1<<3) /* group quota limits enforcement */
#define XFS_USER_QUOTA (1<<0) /* user quota type */
#define XFS_PROJ_QUOTA (1<<1) /* (IRIX) project quota type */
#define XFS_GROUP_QUOTA (1<<2) /* group quota type */
static const struct xlat xfs_quota_flags[] = {
{XFS_QUOTA_UDQ_ACCT, "XFS_QUOTA_UDQ_ACCT"},
{XFS_QUOTA_UDQ_ENFD, "XFS_QUOTA_UDQ_ENFD"},
{XFS_QUOTA_GDQ_ACCT, "XFS_QUOTA_GDQ_ACCT"},
{XFS_QUOTA_GDQ_ENFD, "XFS_QUOTA_GDQ_ENFD"},
{0, NULL}
};
static const struct xlat xfs_dqblk_flags[] = {
{XFS_USER_QUOTA, "XFS_USER_QUOTA"},
{XFS_PROJ_QUOTA, "XFS_PROJ_QUOTA"},
{XFS_GROUP_QUOTA, "XFS_GROUP_QUOTA"},
{0, NULL}
};
/*
* Following flags are used to specify which fields are valid
*/
#define QIF_BLIMITS 1
#define QIF_SPACE 2
#define QIF_ILIMITS 4
#define QIF_INODES 8
#define QIF_BTIME 16
#define QIF_ITIME 32
static const struct xlat if_dqblk_valid[] = {
{QIF_BLIMITS, "QIF_BLIMITS"},
{QIF_SPACE, "QIF_SPACE"},
{QIF_ILIMITS, "QIF_ILIMITS"},
{QIF_INODES, "QIF_INODES"},
{QIF_BTIME, "QIF_BTIME"},
{QIF_ITIME, "QIF_ITIME"},
{0, NULL}
};
struct if_dqblk
{
u_int64_t dqb_bhardlimit;
u_int64_t dqb_bsoftlimit;
u_int64_t dqb_curspace;
u_int64_t dqb_ihardlimit;
u_int64_t dqb_isoftlimit;
u_int64_t dqb_curinodes;
u_int64_t dqb_btime;
u_int64_t dqb_itime;
u_int32_t dqb_valid;
};
struct v1_dqblk
{
u_int32_t dqb_bhardlimit; /* absolute limit on disk blks alloc */
u_int32_t dqb_bsoftlimit; /* preferred limit on disk blks */
u_int32_t dqb_curblocks; /* current block count */
u_int32_t dqb_ihardlimit; /* maximum # allocated inodes */
u_int32_t dqb_isoftlimit; /* preferred inode limit */
u_int32_t dqb_curinodes; /* current # allocated inodes */
time_t dqb_btime; /* time limit for excessive disk use */
time_t dqb_itime; /* time limit for excessive files */
};
struct v2_dqblk
{
unsigned int dqb_ihardlimit;
unsigned int dqb_isoftlimit;
unsigned int dqb_curinodes;
unsigned int dqb_bhardlimit;
unsigned int dqb_bsoftlimit;
u_int64_t dqb_curspace;
time_t dqb_btime;
time_t dqb_itime;
};
struct xfs_dqblk
{
int8_t d_version; /* version of this structure */
int8_t d_flags; /* XFS_{USER,PROJ,GROUP}_QUOTA */
u_int16_t d_fieldmask; /* field specifier */
u_int32_t d_id; /* user, project, or group ID */
u_int64_t d_blk_hardlimit; /* absolute limit on disk blks */
u_int64_t d_blk_softlimit; /* preferred limit on disk blks */
u_int64_t d_ino_hardlimit; /* maximum # allocated inodes */
u_int64_t d_ino_softlimit; /* preferred inode limit */
u_int64_t d_bcount; /* # disk blocks owned by the user */
u_int64_t d_icount; /* # inodes owned by the user */
int32_t d_itimer; /* zero if within inode limits */
int32_t d_btimer; /* similar to above; for disk blocks */
u_int16_t d_iwarns; /* # warnings issued wrt num inodes */
u_int16_t d_bwarns; /* # warnings issued wrt disk blocks */
int32_t d_padding2; /* padding2 - for future use */
u_int64_t d_rtb_hardlimit; /* absolute limit on realtime blks */
u_int64_t d_rtb_softlimit; /* preferred limit on RT disk blks */
u_int64_t d_rtbcount; /* # realtime blocks owned */
int32_t d_rtbtimer; /* similar to above; for RT disk blks */
u_int16_t d_rtbwarns; /* # warnings issued wrt RT disk blks */
int16_t d_padding3; /* padding3 - for future use */
char d_padding4[8]; /* yet more padding */
};
/*
* Following flags are used to specify which fields are valid
*/
#define IIF_BGRACE 1
#define IIF_IGRACE 2
#define IIF_FLAGS 4
static const struct xlat if_dqinfo_valid[] = {
{IIF_BGRACE, "IIF_BGRACE"},
{IIF_IGRACE, "IIF_IGRACE"},
{IIF_FLAGS, "IIF_FLAGS"},
{0, NULL}
};
struct if_dqinfo
{
u_int64_t dqi_bgrace;
u_int64_t dqi_igrace;
u_int32_t dqi_flags;
u_int32_t dqi_valid;
};
struct v2_dqinfo
{
unsigned int dqi_bgrace;
unsigned int dqi_igrace;
unsigned int dqi_flags;
unsigned int dqi_blocks;
unsigned int dqi_free_blk;
unsigned int dqi_free_entry;
};
struct v1_dqstats
{
u_int32_t lookups;
u_int32_t drops;
u_int32_t reads;
u_int32_t writes;
u_int32_t cache_hits;
u_int32_t allocated_dquots;
u_int32_t free_dquots;
u_int32_t syncs;
};
struct v2_dqstats
{
u_int32_t lookups;
u_int32_t drops;
u_int32_t reads;
u_int32_t writes;
u_int32_t cache_hits;
u_int32_t allocated_dquots;
u_int32_t free_dquots;
u_int32_t syncs;
u_int32_t version;
};
typedef struct fs_qfilestat
{
u_int64_t qfs_ino; /* inode number */
u_int64_t qfs_nblks; /* number of BBs 512-byte-blks */
u_int32_t qfs_nextents; /* number of extents */
} fs_qfilestat_t;
struct xfs_dqstats
{
int8_t qs_version; /* version number for future changes */
u_int16_t qs_flags; /* XFS_QUOTA_{U,P,G}DQ_{ACCT,ENFD} */
int8_t qs_pad; /* unused */
fs_qfilestat_t qs_uquota; /* user quota storage information */
fs_qfilestat_t qs_gquota; /* group quota storage information */
u_int32_t qs_incoredqs; /* number of dquots incore */
int32_t qs_btimelimit; /* limit for blks timer */
int32_t qs_itimelimit; /* limit for inodes timer */
int32_t qs_rtbtimelimit; /* limit for rt blks timer */
u_int16_t qs_bwarnlimit; /* limit for num warnings */
u_int16_t qs_iwarnlimit; /* limit for num warnings */
};
static void
decode_cmd_data(struct tcb *tcp, u_int32_t cmd, unsigned long data)
{
switch (cmd) {
case Q_GETQUOTA:
case Q_SETQUOTA:
{
struct if_dqblk dq;
if (cmd == Q_GETQUOTA && syserror(tcp)) {
tprintf("%#lx", data);
break;
}
if (umove(tcp, data, &dq) < 0) {
tprintf("{???} %#lx", data);
break;
}
tprintf("{bhardlimit=%" PRIu64 ", ", dq.dqb_bhardlimit);
tprintf("bsoftlimit=%" PRIu64 ", ", dq.dqb_bsoftlimit);
tprintf("curspace=%" PRIu64 ", ", dq.dqb_curspace);
tprintf("ihardlimit=%" PRIu64 ", ", dq.dqb_ihardlimit);
tprintf("isoftlimit=%" PRIu64 ", ", dq.dqb_isoftlimit);
tprintf("curinodes=%" PRIu64 ", ", dq.dqb_curinodes);
if (!abbrev(tcp)) {
tprintf("btime=%" PRIu64 ", ", dq.dqb_btime);
tprintf("itime=%" PRIu64 ", ", dq.dqb_itime);
tprints("valid=");
printflags(if_dqblk_valid,
dq.dqb_valid, "QIF_???");
tprints("}");
} else
tprints("...}");
break;
}
case Q_V1_GETQUOTA:
case Q_V1_SETQUOTA:
{
struct v1_dqblk dq;
if (cmd == Q_V1_GETQUOTA && syserror(tcp)) {
tprintf("%#lx", data);
break;
}
if (umove(tcp, data, &dq) < 0) {
tprintf("{???} %#lx", data);
break;
}
tprintf("{bhardlimit=%u, ", dq.dqb_bhardlimit);
tprintf("bsoftlimit=%u, ", dq.dqb_bsoftlimit);
tprintf("curblocks=%u, ", dq.dqb_curblocks);
tprintf("ihardlimit=%u, ", dq.dqb_ihardlimit);
tprintf("isoftlimit=%u, ", dq.dqb_isoftlimit);
tprintf("curinodes=%u, ", dq.dqb_curinodes);
tprintf("btime=%lu, ", (long) dq.dqb_btime);
tprintf("itime=%lu}", (long) dq.dqb_itime);
break;
}
case Q_V2_GETQUOTA:
case Q_V2_SETQUOTA:
{
struct v2_dqblk dq;
if (cmd == Q_V2_GETQUOTA && syserror(tcp)) {
tprintf("%#lx", data);
break;
}
if (umove(tcp, data, &dq) < 0) {
tprintf("{???} %#lx", data);
break;
}
tprintf("{ihardlimit=%u, ", dq.dqb_ihardlimit);
tprintf("isoftlimit=%u, ", dq.dqb_isoftlimit);
tprintf("curinodes=%u, ", dq.dqb_curinodes);
tprintf("bhardlimit=%u, ", dq.dqb_bhardlimit);
tprintf("bsoftlimit=%u, ", dq.dqb_bsoftlimit);
tprintf("curspace=%" PRIu64 ", ", dq.dqb_curspace);
tprintf("btime=%lu, ", (long) dq.dqb_btime);
tprintf("itime=%lu}", (long) dq.dqb_itime);
break;
}
case Q_XGETQUOTA:
case Q_XSETQLIM:
{
struct xfs_dqblk dq;
if (cmd == Q_XGETQUOTA && syserror(tcp)) {
tprintf("%#lx", data);
break;
}
if (umove(tcp, data, &dq) < 0) {
tprintf("{???} %#lx", data);
break;
}
tprintf("{version=%d, ", dq.d_version);
tprints("flags=");
printflags(xfs_dqblk_flags,
dq.d_flags, "XFS_???_QUOTA");
tprintf(", fieldmask=%#x, ", dq.d_fieldmask);
tprintf("id=%u, ", dq.d_id);
tprintf("blk_hardlimit=%" PRIu64 ", ", dq.d_blk_hardlimit);
tprintf("blk_softlimit=%" PRIu64 ", ", dq.d_blk_softlimit);
tprintf("ino_hardlimit=%" PRIu64 ", ", dq.d_ino_hardlimit);
tprintf("ino_softlimit=%" PRIu64 ", ", dq.d_ino_softlimit);
tprintf("bcount=%" PRIu64 ", ", dq.d_bcount);
tprintf("icount=%" PRIu64 ", ", dq.d_icount);
if (!abbrev(tcp)) {
tprintf("itimer=%d, ", dq.d_itimer);
tprintf("btimer=%d, ", dq.d_btimer);
tprintf("iwarns=%u, ", dq.d_iwarns);
tprintf("bwarns=%u, ", dq.d_bwarns);
tprintf("rtbcount=%" PRIu64 ", ", dq.d_rtbcount);
tprintf("rtbtimer=%d, ", dq.d_rtbtimer);
tprintf("rtbwarns=%u}", dq.d_rtbwarns);
} else
tprints("...}");
break;
}
case Q_GETFMT:
{
u_int32_t fmt;
if (syserror(tcp)) {
tprintf("%#lx", data);
break;
}
if (umove(tcp, data, &fmt) < 0) {
tprintf("{???} %#lx", data);
break;
}
tprints("{");
printxval(quota_formats, fmt, "QFMT_VFS_???");
tprints("}");
break;
}
case Q_GETINFO:
case Q_SETINFO:
{
struct if_dqinfo dq;
if (cmd == Q_GETINFO && syserror(tcp)) {
tprintf("%#lx", data);
break;
}
if (umove(tcp, data, &dq) < 0) {
tprintf("{???} %#lx", data);
break;
}
tprintf("{bgrace=%" PRIu64 ", ", dq.dqi_bgrace);
tprintf("igrace=%" PRIu64 ", ", dq.dqi_igrace);
tprintf("flags=%#x, ", dq.dqi_flags);
tprints("valid=");
printflags(if_dqinfo_valid, dq.dqi_valid, "IIF_???");
tprints("}");
break;
}
case Q_V2_GETINFO:
case Q_V2_SETINFO:
{
struct v2_dqinfo dq;
if (cmd == Q_V2_GETINFO && syserror(tcp)) {
tprintf("%#lx", data);
break;
}
if (umove(tcp, data, &dq) < 0) {
tprintf("{???} %#lx", data);
break;
}
tprintf("{bgrace=%u, ", dq.dqi_bgrace);
tprintf("igrace=%u, ", dq.dqi_igrace);
tprintf("flags=%#x, ", dq.dqi_flags);
tprintf("blocks=%u, ", dq.dqi_blocks);
tprintf("free_blk=%u, ", dq.dqi_free_blk);
tprintf("free_entry=%u}", dq.dqi_free_entry);
break;
}
case Q_V1_GETSTATS:
{
struct v1_dqstats dq;
if (syserror(tcp)) {
tprintf("%#lx", data);
break;
}
if (umove(tcp, data, &dq) < 0) {
tprintf("{???} %#lx", data);
break;
}
tprintf("{lookups=%u, ", dq.lookups);
tprintf("drops=%u, ", dq.drops);
tprintf("reads=%u, ", dq.reads);
tprintf("writes=%u, ", dq.writes);
tprintf("cache_hits=%u, ", dq.cache_hits);
tprintf("allocated_dquots=%u, ", dq.allocated_dquots);
tprintf("free_dquots=%u, ", dq.free_dquots);
tprintf("syncs=%u}", dq.syncs);
break;
}
case Q_V2_GETSTATS:
{
struct v2_dqstats dq;
if (syserror(tcp)) {
tprintf("%#lx", data);
break;
}
if (umove(tcp, data, &dq) < 0) {
tprintf("{???} %#lx", data);
break;
}
tprintf("{lookups=%u, ", dq.lookups);
tprintf("drops=%u, ", dq.drops);
tprintf("reads=%u, ", dq.reads);
tprintf("writes=%u, ", dq.writes);
tprintf("cache_hits=%u, ", dq.cache_hits);
tprintf("allocated_dquots=%u, ", dq.allocated_dquots);
tprintf("free_dquots=%u, ", dq.free_dquots);
tprintf("syncs=%u, ", dq.syncs);
tprintf("version=%u}", dq.version);
break;
}
case Q_XGETQSTAT:
{
struct xfs_dqstats dq;
if (syserror(tcp)) {
tprintf("%#lx", data);
break;
}
if (umove(tcp, data, &dq) < 0) {
tprintf("{???} %#lx", data);
break;
}
tprintf("{version=%d, ", dq.qs_version);
if (abbrev(tcp)) {
tprints("...}");
break;
}
tprints("flags=");
printflags(xfs_quota_flags,
dq.qs_flags, "XFS_QUOTA_???");
tprintf(", incoredqs=%u, ", dq.qs_incoredqs);
tprintf("u_ino=%" PRIu64 ", ", dq.qs_uquota.qfs_ino);
tprintf("u_nblks=%" PRIu64 ", ", dq.qs_uquota.qfs_nblks);
tprintf("u_nextents=%u, ", dq.qs_uquota.qfs_nextents);
tprintf("g_ino=%" PRIu64 ", ", dq.qs_gquota.qfs_ino);
tprintf("g_nblks=%" PRIu64 ", ", dq.qs_gquota.qfs_nblks);
tprintf("g_nextents=%u, ", dq.qs_gquota.qfs_nextents);
tprintf("btimelimit=%d, ", dq.qs_btimelimit);
tprintf("itimelimit=%d, ", dq.qs_itimelimit);
tprintf("rtbtimelimit=%d, ", dq.qs_rtbtimelimit);
tprintf("bwarnlimit=%u, ", dq.qs_bwarnlimit);
tprintf("iwarnlimit=%u}", dq.qs_iwarnlimit);
break;
}
case Q_XQUOTAON:
{
u_int32_t flag;
if (umove(tcp, data, &flag) < 0) {
tprintf("{???} %#lx", data);
break;
}
tprints("{");
printflags(xfs_quota_flags, flag, "XFS_QUOTA_???");
tprints("}");
break;
}
default:
tprintf("%#lx", data);
break;
}
}
int
sys_quotactl(struct tcb *tcp)
{
/*
* The Linux kernel only looks at the low 32 bits of command and id
* arguments, but on some 64-bit architectures (s390x) this word
* will have been sign-extended when we see it. The high 1 bits
* don't mean anything, so don't confuse the output with them.
*/
u_int32_t qcmd = tcp->u_arg[0];
u_int32_t cmd = QCMD_CMD(qcmd);
u_int32_t type = QCMD_TYPE(qcmd);
u_int32_t id = tcp->u_arg[2];
if (!verbose(tcp))
return printargs(tcp);
if (entering(tcp)) {
printxval(quotacmds, cmd, "Q_???");
tprints("|");
printxval(quotatypes, type, "???QUOTA");
tprints(", ");
printstr(tcp, tcp->u_arg[1], -1);
tprints(", ");
switch (cmd) {
case Q_V1_QUOTAON:
case Q_QUOTAON:
printxval(quota_formats, id, "QFMT_VFS_???");
break;
case Q_V1_GETQUOTA:
case Q_V2_GETQUOTA:
case Q_GETQUOTA:
case Q_V1_SETQUOTA:
case Q_V2_SETQUOTA:
case Q_V1_SETUSE:
case Q_V2_SETUSE:
case Q_SETQLIM:
case Q_SETQUOTA:
case Q_XGETQUOTA:
case Q_XSETQLIM:
tprintf("%u", id);
break;
default:
tprintf("%#lx", tcp->u_arg[2]);
break;
}
tprints(", ");
} else {
if (!tcp->u_arg[3])
tprints("NULL");
else
decode_cmd_data(tcp, cmd, tcp->u_arg[3]);
}
return 0;
}
| {
"pile_set_name": "Github"
} |
export interface StartOfSourceMap {
file?: string;
sourceRoot?: string;
}
export interface RawSourceMap extends StartOfSourceMap {
version: string;
sources: string[];
names: string[];
sourcesContent?: string[];
mappings: string;
}
export interface Position {
line: number;
column: number;
}
export interface LineRange extends Position {
lastColumn: number;
}
export interface FindPosition extends Position {
// SourceMapConsumer.GREATEST_LOWER_BOUND or SourceMapConsumer.LEAST_UPPER_BOUND
bias?: number;
}
export interface SourceFindPosition extends FindPosition {
source: string;
}
export interface MappedPosition extends Position {
source: string;
name?: string;
}
export interface MappingItem {
source: string;
generatedLine: number;
generatedColumn: number;
originalLine: number;
originalColumn: number;
name: string;
}
export class SourceMapConsumer {
static GENERATED_ORDER: number;
static ORIGINAL_ORDER: number;
static GREATEST_LOWER_BOUND: number;
static LEAST_UPPER_BOUND: number;
constructor(rawSourceMap: RawSourceMap);
computeColumnSpans(): void;
originalPositionFor(generatedPosition: FindPosition): MappedPosition;
generatedPositionFor(originalPosition: SourceFindPosition): LineRange;
allGeneratedPositionsFor(originalPosition: MappedPosition): Position[];
hasContentsOfAllSources(): boolean;
sourceContentFor(source: string, returnNullOnMissing?: boolean): string;
eachMapping(callback: (mapping: MappingItem) => void, context?: any, order?: number): void;
}
export interface Mapping {
generated: Position;
original: Position;
source: string;
name?: string;
}
export class SourceMapGenerator {
constructor(startOfSourceMap?: StartOfSourceMap);
static fromSourceMap(sourceMapConsumer: SourceMapConsumer): SourceMapGenerator;
addMapping(mapping: Mapping): void;
setSourceContent(sourceFile: string, sourceContent: string): void;
applySourceMap(sourceMapConsumer: SourceMapConsumer, sourceFile?: string, sourceMapPath?: string): void;
toString(): string;
}
export interface CodeWithSourceMap {
code: string;
map: SourceMapGenerator;
}
export class SourceNode {
constructor();
constructor(line: number, column: number, source: string);
constructor(line: number, column: number, source: string, chunk?: string, name?: string);
static fromStringWithSourceMap(code: string, sourceMapConsumer: SourceMapConsumer, relativePath?: string): SourceNode;
add(chunk: string): void;
prepend(chunk: string): void;
setSourceContent(sourceFile: string, sourceContent: string): void;
walk(fn: (chunk: string, mapping: MappedPosition) => void): void;
walkSourceContents(fn: (file: string, content: string) => void): void;
join(sep: string): SourceNode;
replaceRight(pattern: string, replacement: string): SourceNode;
toString(): string;
toStringWithSourceMap(startOfSourceMap?: StartOfSourceMap): CodeWithSourceMap;
}
| {
"pile_set_name": "Github"
} |
// File: DataMixingMuonWorker.cc
// Description: see DataMixingMuonWorker.h
// Author: Mike Hildreth, University of Notre Dame
//
//--------------------------------------------
#include "DataFormats/Common/interface/Handle.h"
#include "FWCore/MessageLogger/interface/MessageLogger.h"
#include <map>
#include <memory>
//
//
#include "DataMixingMuonWorker.h"
using namespace std;
namespace edm {
// Virtual constructor
DataMixingMuonWorker::DataMixingMuonWorker() {}
// Constructor
DataMixingMuonWorker::DataMixingMuonWorker(const edm::ParameterSet &ps, edm::ConsumesCollector &&iC)
: label_(ps.getParameter<std::string>("Label"))
{
// get the subdetector names
// this->getSubdetectorNames(); //something like this may be useful to
// check what we are supposed to do...
// Declare the products to produce
DTDigiTagSig_ = ps.getParameter<edm::InputTag>("DTDigiTagSig");
RPCDigiTagSig_ = ps.getParameter<edm::InputTag>("RPCDigiTagSig");
CSCstripdigi_collectionSig_ = ps.getParameter<edm::InputTag>("CSCstripdigiCollectionSig");
CSCwiredigi_collectionSig_ = ps.getParameter<edm::InputTag>("CSCwiredigiCollectionSig");
CSCCompdigi_collectionSig_ = ps.getParameter<edm::InputTag>("CSCCompdigiCollectionSig");
DTDigiToken_ = iC.consumes<DTDigiCollection>(DTDigiTagSig_);
CSCStripDigiToken_ = iC.consumes<CSCStripDigiCollection>(CSCstripdigi_collectionSig_);
CSCWireDigiToken_ = iC.consumes<CSCWireDigiCollection>(CSCwiredigi_collectionSig_);
CSCCompDigiToken_ = iC.consumes<CSCComparatorDigiCollection>(CSCCompdigi_collectionSig_);
RPCDigiToken_ = iC.consumes<RPCDigiCollection>(RPCDigiTagSig_);
DTPileInputTag_ = ps.getParameter<edm::InputTag>("DTPileInputTag");
RPCPileInputTag_ = ps.getParameter<edm::InputTag>("RPCPileInputTag");
CSCWirePileInputTag_ = ps.getParameter<edm::InputTag>("CSCWirePileInputTag");
CSCStripPileInputTag_ = ps.getParameter<edm::InputTag>("CSCStripPileInputTag");
CSCCompPileInputTag_ = ps.getParameter<edm::InputTag>("CSCCompPileInputTag");
DTDigiPToken_ = iC.consumes<DTDigiCollection>(DTPileInputTag_);
CSCStripDigiPToken_ = iC.consumes<CSCStripDigiCollection>(CSCStripPileInputTag_);
CSCWireDigiPToken_ = iC.consumes<CSCWireDigiCollection>(CSCWirePileInputTag_);
CSCCompDigiPToken_ = iC.consumes<CSCComparatorDigiCollection>(CSCCompPileInputTag_);
RPCDigiPToken_ = iC.consumes<RPCDigiCollection>(RPCPileInputTag_);
// outputs:
DTDigiCollectionDM_ = ps.getParameter<std::string>("DTDigiCollectionDM");
RPCDigiCollectionDM_ = ps.getParameter<std::string>("RPCDigiCollectionDM");
CSCStripDigiCollectionDM_ = ps.getParameter<std::string>("CSCStripDigiCollectionDM");
CSCWireDigiCollectionDM_ = ps.getParameter<std::string>("CSCWireDigiCollectionDM");
CSCComparatorDigiCollectionDM_ = ps.getParameter<std::string>("CSCComparatorDigiCollectionDM");
}
// Virtual destructor needed.
DataMixingMuonWorker::~DataMixingMuonWorker() {}
void DataMixingMuonWorker::addMuonSignals(const edm::Event &e) {
// fill in maps of hits
LogDebug("DataMixingMuonWorker") << "===============> adding MC signals for " << e.id();
// DT
//
OurDTDigis_ = new DTDigiCollection();
Handle<DTDigiCollection> pDTdigis;
// Get the digis from the event
if (e.getByToken(DTDigiToken_, pDTdigis)) {
// LogInfo("DataMixingMuonWorker") << "total # DT Digis: " <<
// DTdigis->size();
// Loop over digis, copying them to our own local storage
const DTDigiCollection *DTdigis = pDTdigis.product();
DTDigiCollection::DigiRangeIterator DLayerIt;
for (DLayerIt = DTdigis->begin(); DLayerIt != DTdigis->end(); ++DLayerIt) {
// The layerId
const DTLayerId &layerId = (*DLayerIt).first;
// Get the iterators over the digis associated with this LayerId
const DTDigiCollection::Range &range = (*DLayerIt).second;
OurDTDigis_->put(range, layerId);
}
}
// RPC
//
OurRPCDigis_ = new RPCDigiCollection();
// Get the digis from the event
Handle<RPCDigiCollection> pRPCdigis;
if (e.getByToken(RPCDigiToken_, pRPCdigis)) {
// Loop over digis, copying them to our own local storage
const RPCDigiCollection *RPCdigis = pRPCdigis.product();
RPCDigiCollection::DigiRangeIterator RLayerIt;
for (RLayerIt = RPCdigis->begin(); RLayerIt != RPCdigis->end(); ++RLayerIt) {
// The layerId
const RPCDetId &layerId = (*RLayerIt).first;
// Get the iterators over the digis associated with this LayerId
const RPCDigiCollection::Range &range = (*RLayerIt).second;
OurRPCDigis_->put(range, layerId);
}
}
// CSCStrip
//
OurCSCStripDigis_ = new CSCStripDigiCollection();
// Get the digis from the event
Handle<CSCStripDigiCollection> pCSCStripdigis;
if (e.getByToken(CSCStripDigiToken_, pCSCStripdigis)) {
// if(pCSCStripdigis.isValid() ) { std::cout << "Signal: have CSCStripDigis"
// << std::endl;} else { std::cout << "Signal: NO CSCStripDigis" <<
// std::endl;}
// Loop over digis, copying them to our own local storage
const CSCStripDigiCollection *CSCStripdigis = pCSCStripdigis.product();
CSCStripDigiCollection::DigiRangeIterator CSLayerIt;
for (CSLayerIt = CSCStripdigis->begin(); CSLayerIt != CSCStripdigis->end(); ++CSLayerIt) {
// The layerId
const CSCDetId &layerId = (*CSLayerIt).first;
// Get the iterators over the digis associated with this LayerId
const CSCStripDigiCollection::Range &range = (*CSLayerIt).second;
// std::cout << " Signal CSC layer " << (*CSLayerIt).first << std::endl;
// for(CSCStripDigiCollection::const_iterator dtdigi=range.first;
// dtdigi!=range.second; dtdigi++){
// std::cout << "Digi " << (*dtdigi) << std::endl;
//}
OurCSCStripDigis_->put(range, layerId);
}
}
// CSCWire
//
OurCSCWireDigis_ = new CSCWireDigiCollection();
// Get the digis from the event
Handle<CSCWireDigiCollection> pCSCWiredigis;
if (e.getByToken(CSCWireDigiToken_, pCSCWiredigis)) {
// if(pCSCWiredigis.isValid() ) { std::cout << "Signal: have CSCWireDigis"
// << std::endl;} else { std::cout << "Signal: NO CSCWireDigis" <<
// std::endl;}
// Loop over digis, copying them to our own local storage
const CSCWireDigiCollection *CSCWiredigis = pCSCWiredigis.product();
CSCWireDigiCollection::DigiRangeIterator CWLayerIt;
for (CWLayerIt = CSCWiredigis->begin(); CWLayerIt != CSCWiredigis->end(); ++CWLayerIt) {
// The layerId
const CSCDetId &layerId = (*CWLayerIt).first;
// Get the iterators over the digis associated with this LayerId
const CSCWireDigiCollection::Range &range = (*CWLayerIt).second;
OurCSCWireDigis_->put(range, layerId);
}
}
// CSCComparators
//
OurCSCComparatorDigis_ = new CSCComparatorDigiCollection();
// Get the digis from the event
Handle<CSCComparatorDigiCollection> pCSCComparatordigis;
// std::cout << "CSCComp label: " << CSCDigiTagSig_.label() << " " <<
// CSCCompdigi_collectionSig_.label() << std::endl;
if (e.getByToken(CSCCompDigiToken_, pCSCComparatordigis)) {
// if(pCSCComparatordigis.isValid() ) { std::cout << "Signal: have
// CSCComparatorDigis" << std::endl;} else { std::cout << "Signal: NO
// CSCComparatorDigis" << std::endl;}
// Loop over digis, copying them to our own local storage
const CSCComparatorDigiCollection *CSCComparatordigis = pCSCComparatordigis.product();
CSCComparatorDigiCollection::DigiRangeIterator CWLayerIt;
for (CWLayerIt = CSCComparatordigis->begin(); CWLayerIt != CSCComparatordigis->end(); ++CWLayerIt) {
// The layerId
const CSCDetId &layerId = (*CWLayerIt).first;
// Get the iterators over the digis associated with this LayerId
const CSCComparatorDigiCollection::Range &range = (*CWLayerIt).second;
OurCSCComparatorDigis_->put(range, layerId);
}
}
} // end of addMuonSignals
void DataMixingMuonWorker::addMuonPileups(const int bcr,
const EventPrincipal *ep,
unsigned int eventNr,
ModuleCallingContext const *mcc) {
LogDebug("DataMixingMuonWorker") << "\n===============> adding pileups from event " << ep->id()
<< " for bunchcrossing " << bcr;
// fill in maps of hits; same code as addSignals, except now applied to the
// pileup events
// DT
//
// Get the digis from the event
std::shared_ptr<Wrapper<DTDigiCollection> const> DTDigisPTR =
getProductByTag<DTDigiCollection>(*ep, DTPileInputTag_, mcc);
if (DTDigisPTR) {
const DTDigiCollection *DTDigis = const_cast<DTDigiCollection *>(DTDigisPTR->product());
DTDigiCollection::DigiRangeIterator DTLayerIt;
for (DTLayerIt = DTDigis->begin(); DTLayerIt != DTDigis->end(); ++DTLayerIt) {
// The layerId
const DTLayerId &layerId = (*DTLayerIt).first;
// Get the iterators over the Digis associated with this LayerId
const DTDigiCollection::Range &range = (*DTLayerIt).second;
OurDTDigis_->put(range, layerId);
}
}
// RPC
//
// Get the digis from the event
std::shared_ptr<Wrapper<RPCDigiCollection> const> RPCDigisPTR =
getProductByTag<RPCDigiCollection>(*ep, RPCPileInputTag_, mcc);
if (RPCDigisPTR) {
const RPCDigiCollection *RPCDigis = const_cast<RPCDigiCollection *>(RPCDigisPTR->product());
RPCDigiCollection::DigiRangeIterator RPCLayerIt;
for (RPCLayerIt = RPCDigis->begin(); RPCLayerIt != RPCDigis->end(); ++RPCLayerIt) {
// The layerId
const RPCDetId &layerId = (*RPCLayerIt).first;
// Get the iterators over the digis associated with this LayerId
const RPCDigiCollection::Range &range = (*RPCLayerIt).second;
OurRPCDigis_->put(range, layerId);
}
}
// CSCStrip
//
// Get the digis from the event
std::shared_ptr<Wrapper<CSCStripDigiCollection> const> CSCStripDigisPTR =
getProductByTag<CSCStripDigiCollection>(*ep, CSCStripPileInputTag_, mcc);
if (CSCStripDigisPTR) {
const CSCStripDigiCollection *CSCStripDigis = const_cast<CSCStripDigiCollection *>(CSCStripDigisPTR->product());
CSCStripDigiCollection::DigiRangeIterator CSCStripLayerIt;
for (CSCStripLayerIt = CSCStripDigis->begin(); CSCStripLayerIt != CSCStripDigis->end(); ++CSCStripLayerIt) {
// The layerId
const CSCDetId &layerId = (*CSCStripLayerIt).first;
// Get the iterators over the digis associated with this LayerId
const CSCStripDigiCollection::Range &range = (*CSCStripLayerIt).second;
// std::cout << " Pileup CSC layer " << (*CSCStripLayerIt).first <<
// std::endl;
// for(CSCStripDigiCollection::const_iterator dtdigi=range.first;
// dtdigi!=range.second; dtdigi++){
// std::cout << "Digi " << (*dtdigi) << std::endl;
// }
OurCSCStripDigis_->put(range, layerId);
}
}
// CSCWire
//
// Get the digis from the event
std::shared_ptr<Wrapper<CSCWireDigiCollection> const> CSCWireDigisPTR =
getProductByTag<CSCWireDigiCollection>(*ep, CSCWirePileInputTag_, mcc);
if (CSCWireDigisPTR) {
const CSCWireDigiCollection *CSCWireDigis = const_cast<CSCWireDigiCollection *>(CSCWireDigisPTR->product());
CSCWireDigiCollection::DigiRangeIterator CSCWireLayerIt;
for (CSCWireLayerIt = CSCWireDigis->begin(); CSCWireLayerIt != CSCWireDigis->end(); ++CSCWireLayerIt) {
// The layerId
const CSCDetId &layerId = (*CSCWireLayerIt).first;
// Get the iterators over the digis associated with this LayerId
const CSCWireDigiCollection::Range &range = (*CSCWireLayerIt).second;
OurCSCWireDigis_->put(range, layerId);
}
}
// CSCComparators
//
// Get the digis from the event
std::shared_ptr<Wrapper<CSCComparatorDigiCollection> const> CSCComparatorDigisPTR =
getProductByTag<CSCComparatorDigiCollection>(*ep, CSCCompPileInputTag_, mcc);
if (CSCComparatorDigisPTR) {
const CSCComparatorDigiCollection *CSCComparatorDigis =
const_cast<CSCComparatorDigiCollection *>(CSCComparatorDigisPTR->product());
CSCComparatorDigiCollection::DigiRangeIterator CSCComparatorLayerIt;
for (CSCComparatorLayerIt = CSCComparatorDigis->begin(); CSCComparatorLayerIt != CSCComparatorDigis->end();
++CSCComparatorLayerIt) {
// The layerId
const CSCDetId &layerId = (*CSCComparatorLayerIt).first;
// Get the iterators over the digis associated with this LayerId
const CSCComparatorDigiCollection::Range &range = (*CSCComparatorLayerIt).second;
OurCSCComparatorDigis_->put(range, layerId);
}
}
}
void DataMixingMuonWorker::putMuon(edm::Event &e) {
// collections of digis to put in the event
std::unique_ptr<DTDigiCollection> DTDigiMerge(new DTDigiCollection);
std::unique_ptr<RPCDigiCollection> RPCDigiMerge(new RPCDigiCollection);
std::unique_ptr<CSCStripDigiCollection> CSCStripDigiMerge(new CSCStripDigiCollection);
std::unique_ptr<CSCWireDigiCollection> CSCWireDigiMerge(new CSCWireDigiCollection);
std::unique_ptr<CSCComparatorDigiCollection> CSCComparatorDigiMerge(new CSCComparatorDigiCollection);
// Loop over DT digis, copying them from our own local storage
DTDigiCollection::DigiRangeIterator DLayerIt;
for (DLayerIt = OurDTDigis_->begin(); DLayerIt != OurDTDigis_->end(); ++DLayerIt) {
// The layerId
const DTLayerId &layerId = (*DLayerIt).first;
// Get the iterators over the digis associated with this LayerId
const DTDigiCollection::Range &range = (*DLayerIt).second;
DTDigiMerge->put(range, layerId);
}
// Loop over RPC digis, copying them from our own local storage
RPCDigiCollection::DigiRangeIterator RLayerIt;
for (RLayerIt = OurRPCDigis_->begin(); RLayerIt != OurRPCDigis_->end(); ++RLayerIt) {
// The layerId
const RPCDetId &layerId = (*RLayerIt).first;
// Get the iterators over the digis associated with this LayerId
const RPCDigiCollection::Range &range = (*RLayerIt).second;
RPCDigiMerge->put(range, layerId);
}
// Loop over CSCStrip digis, copying them from our own local storage
CSCStripDigiCollection::DigiRangeIterator CSLayerIt;
for (CSLayerIt = OurCSCStripDigis_->begin(); CSLayerIt != OurCSCStripDigis_->end(); ++CSLayerIt) {
// The layerId
const CSCDetId &layerId = (*CSLayerIt).first;
// Get the iterators over the digis associated with this LayerId
const CSCStripDigiCollection::Range &range = (*CSLayerIt).second;
std::vector<CSCStripDigi> NewDigiList;
std::vector<int> StripList;
std::vector<CSCStripDigiCollection::const_iterator> StripPointer;
for (CSCStripDigiCollection::const_iterator dtdigi = range.first; dtdigi != range.second; ++dtdigi) {
// std::cout << "Digi " << (*dtdigi).getStrip() << std::endl;
StripList.push_back((*dtdigi).getStrip());
StripPointer.push_back(dtdigi);
}
int PrevStrip = -1;
std::vector<int> DuplicateList;
std::vector<CSCStripDigiCollection::const_iterator>::const_iterator StripPtr = StripPointer.begin();
for (std::vector<int>::const_iterator istrip = StripList.begin(); istrip != StripList.end(); ++istrip) {
const int CurrentStrip = *(istrip);
if (CurrentStrip > PrevStrip) {
PrevStrip = CurrentStrip;
int dupl_count;
dupl_count = std::count(StripList.begin(), StripList.end(), CurrentStrip);
if (dupl_count > 1) {
std::vector<int>::const_iterator duplicate = istrip;
++duplicate;
std::vector<CSCStripDigiCollection::const_iterator>::const_iterator DuplPointer = StripPtr;
++DuplPointer;
for (; duplicate != StripList.end(); ++duplicate) {
if ((*duplicate) == CurrentStrip) {
// std::cout << " Duplicate of current " <<
// CurrentStrip << " found at " << (duplicate - StripList.begin())
//<< std::endl;
DuplicateList.push_back(CurrentStrip);
std::vector<int> pileup_adc = (**DuplPointer).getADCCounts();
std::vector<int> signal_adc = (**StripPtr).getADCCounts();
std::vector<int>::const_iterator minplace;
minplace = std::min_element(pileup_adc.begin(), pileup_adc.end());
int minvalue = (*minplace);
std::vector<int> new_adc;
std::vector<int>::const_iterator newsig = signal_adc.begin();
for (std::vector<int>::const_iterator ibin = pileup_adc.begin(); ibin != pileup_adc.end(); ++ibin) {
new_adc.push_back((*newsig) + (*ibin) - minvalue);
++newsig;
}
CSCStripDigi newDigi(CurrentStrip, new_adc);
NewDigiList.push_back(newDigi);
}
++DuplPointer;
}
} else {
NewDigiList.push_back(**StripPtr);
}
} // if strips monotonically increasing... Haven't hit duplicates yet
else { // reached end of signal digis, or there was no overlap
PrevStrip = 1000; // now into pileup signals, stop looking forward for
// duplicates
// check if this digi was in the duplicate list
int check;
check = std::count(DuplicateList.begin(), DuplicateList.end(), CurrentStrip);
if (check == 0)
NewDigiList.push_back(**StripPtr);
}
++StripPtr;
}
CSCStripDigiCollection::Range stripRange(NewDigiList.begin(), NewDigiList.end());
CSCStripDigiMerge->put(stripRange, layerId);
}
// Loop over CSCStrip digis, copying them from our own local storage
CSCWireDigiCollection::DigiRangeIterator CWLayerIt;
for (CWLayerIt = OurCSCWireDigis_->begin(); CWLayerIt != OurCSCWireDigis_->end(); ++CWLayerIt) {
// The layerId
const CSCDetId &layerId = (*CWLayerIt).first;
// Get the iterators over the digis associated with this LayerId
const CSCWireDigiCollection::Range &range = (*CWLayerIt).second;
CSCWireDigiMerge->put(range, layerId);
}
// Loop over CSCComparator digis, copying them from our own local storage
CSCComparatorDigiCollection::DigiRangeIterator CCLayerIt;
for (CCLayerIt = OurCSCComparatorDigis_->begin(); CCLayerIt != OurCSCComparatorDigis_->end(); ++CCLayerIt) {
// The layerId
const CSCDetId &layerId = (*CCLayerIt).first;
// Get the iterators over the digis associated with this LayerId
const CSCComparatorDigiCollection::Range &range = (*CCLayerIt).second;
CSCComparatorDigiMerge->put(range, layerId);
}
// put the collection of recunstructed hits in the event
// LogDebug("DataMixingMuonWorker") << "total # DT Merged Digis: " <<
// DTDigiMerge->size() ; LogDebug("DataMixingMuonWorker") << "total # RPC
// Merged Digis: " << RPCDigiMerge->size() ;
// LogDebug("DataMixingMuonWorker") << "total # CSCStrip Merged Digis: " <<
// CSCStripDigiMerge->size() ; LogDebug("DataMixingMuonWorker") << "total #
// CSCWire Merged Digis: " << CSCWireDigiMerge->size() ;
e.put(std::move(DTDigiMerge));
e.put(std::move(RPCDigiMerge));
e.put(std::move(CSCStripDigiMerge), CSCStripDigiCollectionDM_);
e.put(std::move(CSCWireDigiMerge), CSCWireDigiCollectionDM_);
e.put(std::move(CSCComparatorDigiMerge), CSCComparatorDigiCollectionDM_);
// clear local storage for this event
delete OurDTDigis_;
delete OurRPCDigis_;
delete OurCSCStripDigis_;
delete OurCSCWireDigis_;
delete OurCSCComparatorDigis_;
}
} // namespace edm
| {
"pile_set_name": "Github"
} |
package org.jdownloader.gui.views.downloads.columns.candidatetooltip;
import java.awt.Color;
import java.util.Date;
import java.util.List;
import javax.swing.Icon;
import javax.swing.JLabel;
import jd.controlling.downloadcontroller.HistoryEntry;
import jd.gui.swing.jdgui.GUIUtils;
import jd.plugins.Account;
import org.appwork.swing.MigPanel;
import org.appwork.swing.exttable.ExtColumn;
import org.appwork.swing.exttable.ExtTableModel;
import org.appwork.swing.exttable.columns.ExtDateColumn;
import org.appwork.swing.exttable.columns.ExtTextColumn;
import org.appwork.utils.StringUtils;
import org.appwork.utils.images.IconIO;
import org.appwork.utils.swing.renderer.RendererMigPanel;
import org.jdownloader.DomainInfo;
import org.jdownloader.gui.translate._GUI;
import org.jdownloader.gui.views.downloads.columns.CandidateAccountColumn;
import org.jdownloader.images.BadgeIcon;
import org.jdownloader.updatev2.gui.LAFOptions;
public class CandidateTooltipTableModel extends ExtTableModel<HistoryEntry> {
public static interface MaxWidthProvider {
public int getMaxPreferredWitdh();
}
public static final class GatewayColumn extends ExtTextColumn<HistoryEntry> implements MaxWidthProvider {
private int maxWidth;
@Override
public boolean isSortable(HistoryEntry obj) {
return false;
}
public GatewayColumn(String name) {
super(name);
}
@Override
public int getMinWidth() {
return 100;
}
@Override
public int getMaxPreferredWitdh() {
return maxWidth;
}
protected MigPanel createRendererPanel() {
// getprefered Size will notwork on renderlables
rendererField = new JLabel();
rendererIcon = new JLabel();
return new RendererMigPanel("ins 0", "[]0[grow,fill]", "[grow,fill]");
}
@Override
public void configureRendererComponent(HistoryEntry value, boolean isSelected, boolean hasFocus, int row, int column) {
this.prepareColumn(value);
this.rendererIcon.setIcon(value.getGatewayIcon(18));
String str = value.getGatewayStatus();
if (str == null) {
// under substance, setting setText(null) somehow sets the label
// opaque.
str = "";
}
this.rendererField.setText(str);
maxWidth = Math.max(renderer.getPreferredSize().width, maxWidth);
}
@Override
protected Color getDefaultForeground() {
return LAFOptions.getInstance().getColorForTooltipForeground();
}
@Override
public String getStringValue(HistoryEntry value) {
return null;
}
}
public static final class ResultColumn extends ExtTextColumn<HistoryEntry> implements MaxWidthProvider {
private int maxWidth;
@Override
public boolean isSortable(HistoryEntry obj) {
return false;
}
public ResultColumn(String name) {
super(name);
}
@Override
public int getMinWidth() {
return 100;
}
@Override
public int getMaxPreferredWitdh() {
return maxWidth;
}
protected MigPanel createRendererPanel() {
// getprefered Size will notwork on renderlables
rendererField = new JLabel();
rendererIcon = new JLabel();
return new RendererMigPanel("ins 0", "[]0[grow,fill]", "[grow,fill]");
}
@Override
public void configureRendererComponent(HistoryEntry value, boolean isSelected, boolean hasFocus, int row, int column) {
this.prepareColumn(value);
this.rendererIcon.setIcon(value.getResultIcon(18));
String str = value.getResultStatus();
if (str == null) {
// under substance, setting setText(null) somehow sets the label
// opaque.
str = "";
}
this.rendererField.setText(str);
maxWidth = Math.max(renderer.getPreferredSize().width, maxWidth);
}
@Override
protected Color getDefaultForeground() {
return LAFOptions.getInstance().getColorForTooltipForeground();
}
@Override
public String getStringValue(HistoryEntry value) {
return null;
}
}
public static final class AccountColumn extends ExtTextColumn<HistoryEntry> implements MaxWidthProvider {
private CandidateAccountColumn delegate;
private int maxWidth;
{
delegate = new CandidateAccountColumn();
}
@Override
public boolean isSortable(HistoryEntry obj) {
return false;
}
@Override
public int getMinWidth() {
return 100;
}
@Override
public int getMaxPreferredWitdh() {
return maxWidth;
}
public AccountColumn(String name) {
super(name);
}
protected MigPanel createRendererPanel() {
// getprefered Size will notwork on renderlables
rendererField = new JLabel();
rendererIcon = new JLabel();
return new RendererMigPanel("ins 0", "[]0[grow,fill]", "[grow,fill]");
}
@Override
public void configureRendererComponent(HistoryEntry history, boolean isSelected, boolean hasFocus, int row, int column) {
this.prepareColumn(history);
Icon icon = history.getAccountIcon(18);
String str = history.getAccountStatus();
Account account = history.getAccount();
if (account != null) {
if (icon == null) {
icon = DomainInfo.getInstance(account.getHosterByPlugin()).getFavIcon();
} else {
icon = new BadgeIcon(DomainInfo.getInstance(account.getHosterByPlugin()).getFavIcon(), IconIO.getScaledInstance(icon, 12, 12), 4, 2);
}
String accountType = null;
switch (history.getAccountType()) {
case MULTI:
accountType = _GUI.T.CandidateAccountColumn_account_multi(account.getType().getLabel());
break;
case NONE:
break;
case ORIGINAL:
accountType = _GUI.T.CandidateAccountColumn_account_original(account.getType().getLabel());
break;
}
if (!StringUtils.isEmpty(accountType)) {
str = _GUI.T.CandidateAccountColumn_getStringValue_account_type(GUIUtils.getAccountName(account.getUser()), account.getHosterByPlugin(), accountType);
} else {
str = _GUI.T.CandidateAccountColumn_getStringValue_account(GUIUtils.getAccountName(account.getUser()), account.getHosterByPlugin());
}
} else {
if (icon == null) {
icon = history.getLink().getDomainInfo().getFavIcon();
} else {
icon = new BadgeIcon(history.getLink().getDomainInfo().getFavIcon(), IconIO.getScaledInstance(icon, 12, 12), 4, 2);
}
}
if (str == null) {
// under substance, setting setText(null) somehow sets the label
// opaque.
str = "";
}
this.rendererField.setText(str);
rendererIcon.setIcon(icon);
maxWidth = Math.max(renderer.getPreferredSize().width, maxWidth);
}
@Override
protected Color getDefaultForeground() {
return LAFOptions.getInstance().getColorForTooltipForeground();
}
@Override
public String getStringValue(HistoryEntry value) {
return null;
}
}
public static final class DateColumn extends ExtDateColumn<HistoryEntry> implements MaxWidthProvider {
@Override
protected String getDateFormatString() {
return _GUI.T.CandidateTooltipTableModel_getDateFormatString_timeformat();
}
private int maxWidth;
@Override
public String getSortOrderIdentifier() {
return ExtColumn.SORT_ASC;
}
public DateColumn(String string) {
super(string);
}
@Override
public int getMaxPreferredWitdh() {
return maxWidth;
}
@Override
public int getMinWidth() {
return 100;
}
@Override
public boolean isSortable(HistoryEntry obj) {
return false;
}
@Override
protected Color getDefaultForeground() {
return LAFOptions.getInstance().getColorForTooltipForeground();
}
protected MigPanel createRendererPanel() {
// getprefered Size will notwork on renderlables
rendererField = new JLabel();
rendererIcon = new JLabel();
return new RendererMigPanel("ins 0", "[]0[grow,fill]", "[grow,fill]");
}
@Override
public void configureRendererComponent(HistoryEntry value, boolean isSelected, boolean hasFocus, int row, int column) {
this.prepareColumn(value);
this.rendererIcon.setIcon(this.getIcon(value));
String str = this.getStringValue(value);
if (str == null) {
// under substance, setting setText(null) somehow sets the label
// opaque.
str = "";
}
this.rendererField.setText(str);
maxWidth = Math.max(renderer.getPreferredSize().width, maxWidth);
}
@Override
protected Date getDate(HistoryEntry o2, Date date) {
return new Date(o2.getCreateTime());
}
}
private static final long serialVersionUID = 3120481189794897020L;
public CandidateTooltipTableModel(List<HistoryEntry> history) {
super("CandidateTooltipTableModel");
_fireTableStructureChanged(history, true);
}
@Override
protected void initColumns() {
ExtDateColumn<HistoryEntry> sorton;
addColumn(sorton = new DateColumn(_GUI.T.CandidateTooltipTableModel_time()));
this.addColumn(new AccountColumn(_GUI.T.CandidateTooltipTableModel_account())
);
this.addColumn(new GatewayColumn(_GUI.T.CandidateTooltipTableModel_gateway())
);
this.addColumn(new ResultColumn(_GUI.T.CandidateTooltipTableModel_result())
);
this.sortColumn = sorton;
}
}
| {
"pile_set_name": "Github"
} |
/*
* Copyright (c) 2019, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
* under the terms of the GNU General Public License version 2 only, as
* published by the Free Software Foundation.
*
* This code is distributed in the hope that it will be useful, but WITHOUT
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
* version 2 for more details (a copy is included in the LICENSE file that
* accompanied this code).
*
* You should have received a copy of the GNU General Public License version
* 2 along with this work; if not, write to the Free Software Foundation,
* Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
*
* Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
* or visit www.oracle.com if you need additional information or have any
* questions.
*/
package org.openjdk.skara.bots.submit;
import org.openjdk.skara.bot.WorkItem;
import org.openjdk.skara.forge.*;
import org.openjdk.skara.vcs.Repository;
import java.io.*;
import java.nio.file.Path;
import java.time.ZonedDateTime;
import java.util.*;
import java.util.logging.Logger;
public class SubmitBotWorkItem implements WorkItem {
private final SubmitBot bot;
private final SubmitExecutor executor;
private final PullRequest pr;
private final Logger log = Logger.getLogger("org.openjdk.skara.bots.submit");
SubmitBotWorkItem(SubmitBot bot, SubmitExecutor executor, PullRequest pr) {
this.bot = bot;
this.executor = executor;
this.pr = pr;
}
@Override
public String toString() {
return "SubmitWorkItem@" + bot.repository().name() + "#" + pr.id() + ":" + executor.checkName();
}
@Override
public boolean concurrentWith(WorkItem other) {
if (!(other instanceof SubmitBotWorkItem)) {
return true;
}
SubmitBotWorkItem otherItem = (SubmitBotWorkItem)other;
if (!executor.checkName().equals(otherItem.executor.checkName())) {
return true;
}
if (!pr.id().equals(otherItem.pr.id())) {
return true;
}
if (!bot.repository().name().equals(otherItem.bot.repository().name())) {
return true;
}
return false;
}
@Override
public Collection<WorkItem> run(Path scratchPath) {
// Is the check already up to date?
var checks = pr.checks(pr.headHash());
if (checks.containsKey(executor.checkName())) {
var check = checks.get(executor.checkName());
if (check.startedAt().isBefore(ZonedDateTime.now().minus(executor.timeout())) && check.status() == CheckStatus.IN_PROGRESS) {
log.info("Check for hash " + pr.headHash() + " is too old - running again");
} else {
log.fine("Hash " + pr.headHash() + " already has a check - skipping");
return List.of();
}
}
var prFolder = scratchPath.resolve("submit").resolve(pr.repository().name());
// Materialize the PR's target ref
try {
var localRepo = Repository.materialize(prFolder, pr.repository().url(),
"+" + pr.targetRef() + ":submit_" + pr.repository().name());
var headHash = localRepo.fetch(pr.repository().url(), pr.headHash().hex(), false);
var checkBuilder = CheckBuilder.create(executor.checkName(), headHash);
pr.createCheck(checkBuilder.build());
var checkUpdater = new CheckUpdater(pr, checkBuilder);
executor.run(prFolder, checkBuilder, checkUpdater);
pr.updateCheck(checkBuilder.build());
} catch (IOException e) {
throw new UncheckedIOException(e);
}
return List.of();
}
}
| {
"pile_set_name": "Github"
} |
// Copyright © 2020 The nef Authors.
import Foundation
import Bow
import BowEffects
public struct RenderingPersistence<A> {
public let writePage: (_ page: RenderingOutput<A>, _ file: URL) -> EnvIO<FileSystem, RenderingPersistenceError, Void>
public init(writePage: @escaping (_ page: RenderingOutput<A>, _ file: URL) -> EnvIO<FileSystem, RenderingPersistenceError, Void>) {
self.writePage = writePage
}
}
| {
"pile_set_name": "Github"
} |
fileFormatVersion: 2
guid: f6d08eb9a8e35d84fa30a7e3ae64181a
PrefabImporter:
externalObjects: {}
userData:
assetBundleName:
assetBundleVariant:
| {
"pile_set_name": "Github"
} |
trait A
trait B
trait C
trait D
object Test {
type AB = A with B
val list: List[AB with C] = Nil
list.collect { case d: D => d }
}
| {
"pile_set_name": "Github"
} |
<?php
//copy this file to lib/smarty_tiki
//create a new module and put the following
//{wikistructure id=1 detail=1}
//id for structure id, or page_ref_id
//detail if you only wanna display subbranches of the open node within the structure
// assign your module
//this script may only be included - so its better to die if called directly.
if (strpos($_SERVER["SCRIPT_NAME"],basename(__FILE__)) !== false) {
header("location: index.php");
exit;
}
function smarty_function_wikistructure($params, &$smarty)
{
global $tikilib, $user, $dbTiki, $structlib;
extract($params);
require_once ('lib/structures/structlib.php');
if (!isset($structlib)) {
$structlib = new StructLib($dbTiki);
}
if (!isset($_REQUEST["page"]) || $_REQUEST["page"] == '') {
if (isset($_REQUEST["page_ref_id"])) {
// If a structure page has been requested
$page_ref_id = $_REQUEST["page_ref_id"];
}
}
else {
//Get the structures this page is a member of
$structs = $structlib->get_page_structures($_REQUEST["page"],$structure);
//If page is only member of one structure, display if requested
$single_struct = count($structs) == 1;
if ($single_struct) {
$page_ref_id=$structs[0]['req_page_ref_id'];
$_REQUEST["page_ref_id"]=$page_ref_id;
}
}
if (isset($page_ref_id) && isset($detail)) {
$channels.= $structlib->get_toc($page_ref_id,'asc',false,false);
}
else {
$channels.= $structlib->get_toc($id,'asc',false,false);
}
return $channels;
}
/* vim: set expandtab: */
?>
| {
"pile_set_name": "Github"
} |
<%- groups ||= [] -%>
<%- common ||= false -%>
[<%= namespace %>.buffer]
type = "table"
category = "Buffer"
common = <%= common.to_toml %>
groups = <%= groups.to_toml %>
description = "Configures the sink-specific buffer behavior."
[<%= namespace %>.buffer.children.max_events]
type = "uint"
common = true
default = 500
groups = <%= groups.to_toml %>
relevant_when = {type = "memory"}
unit = "events"
description = """\
The maximum number of [events][docs.data-model] allowed in the buffer.\
"""
[<%= namespace %>.buffer.children.max_size]
type = "uint"
common = false
examples = [104900000]
groups = <%= groups.to_toml %>
relevant_when = {type = "disk"}
required = true
unit = "bytes"
description = "The maximum size of the buffer on disk."
[<%= namespace %>.buffer.children.type]
type = "string"
common = true
default = "memory"
groups = <%= groups.to_toml %>
sort = 1
description = "The buffer's type and storage mechanism."
[<%= namespace %>.buffer.children.type.enum]
memory = "Stores the sink's buffer in memory. This is more performant, but less durable. Data will be lost if Vector is restarted forcefully."
disk = "Stores the sink's buffer on disk. This is less performant, but durable. Data will not be lost between restarts."
[<%= namespace %>.buffer.children.when_full]
type = "string"
common = false
default = "block"
groups = <%= groups.to_toml %>
description = "The behavior when the buffer becomes full."
[<%= namespace %>.buffer.children.when_full.enum]
block = "Applies back pressure when the buffer is full. This prevents data loss, but will cause data to pile up on the edge."
drop_newest = "Drops new data as it is received. This data is lost. This should be used when performance is the highest priority."
| {
"pile_set_name": "Github"
} |
---
external help file:
Module Name: Microsoft.Graph.CrossDeviceExperiences
online version: https://docs.microsoft.com/en-us/powershell/module/microsoft.graph.crossdeviceexperiences/set-mguseractivityhistoryitemactivitybyref
schema: 2.0.0
---
# Set-MgUserActivityHistoryItemActivityByRef
## SYNOPSIS
Update the ref of navigation property activity in users
## SYNTAX
### UpdateExpanded (Default)
```
Set-MgUserActivityHistoryItemActivityByRef -ActivityHistoryItemId <String> -UserActivityId <String>
-UserId <String> [-AdditionalProperties <Hashtable>] [-PassThru] [-Confirm] [-WhatIf] [<CommonParameters>]
```
### Update
```
Set-MgUserActivityHistoryItemActivityByRef -ActivityHistoryItemId <String> -UserActivityId <String>
-UserId <String> -BodyParameter <Hashtable> [-PassThru] [-Confirm] [-WhatIf] [<CommonParameters>]
```
### UpdateViaIdentity
```
Set-MgUserActivityHistoryItemActivityByRef -InputObject <ICrossDeviceExperiencesIdentity>
-BodyParameter <Hashtable> [-PassThru] [-Confirm] [-WhatIf] [<CommonParameters>]
```
### UpdateViaIdentityExpanded
```
Set-MgUserActivityHistoryItemActivityByRef -InputObject <ICrossDeviceExperiencesIdentity>
[-AdditionalProperties <Hashtable>] [-PassThru] [-Confirm] [-WhatIf] [<CommonParameters>]
```
## DESCRIPTION
Update the ref of navigation property activity in users
## EXAMPLES
### Example 1: {{ Add title here }}
```powershell
PS C:\> {{ Add code here }}
{{ Add output here }}
```
{{ Add description here }}
### Example 2: {{ Add title here }}
```powershell
PS C:\> {{ Add code here }}
{{ Add output here }}
```
{{ Add description here }}
## PARAMETERS
### -ActivityHistoryItemId
key: id of activityHistoryItem
```yaml
Type: System.String
Parameter Sets: Update, UpdateExpanded
Aliases:
Required: True
Position: Named
Default value: None
Accept pipeline input: False
Accept wildcard characters: False
```
### -AdditionalProperties
Additional Parameters
```yaml
Type: System.Collections.Hashtable
Parameter Sets: UpdateExpanded, UpdateViaIdentityExpanded
Aliases:
Required: False
Position: Named
Default value: None
Accept pipeline input: False
Accept wildcard characters: False
```
### -BodyParameter
.
```yaml
Type: System.Collections.Hashtable
Parameter Sets: Update, UpdateViaIdentity
Aliases:
Required: True
Position: Named
Default value: None
Accept pipeline input: True (ByValue)
Accept wildcard characters: False
```
### -InputObject
Identity Parameter
To construct, see NOTES section for INPUTOBJECT properties and create a hash table.
```yaml
Type: Microsoft.Graph.PowerShell.Models.ICrossDeviceExperiencesIdentity
Parameter Sets: UpdateViaIdentity, UpdateViaIdentityExpanded
Aliases:
Required: True
Position: Named
Default value: None
Accept pipeline input: True (ByValue)
Accept wildcard characters: False
```
### -PassThru
Returns true when the command succeeds
```yaml
Type: System.Management.Automation.SwitchParameter
Parameter Sets: (All)
Aliases:
Required: False
Position: Named
Default value: None
Accept pipeline input: False
Accept wildcard characters: False
```
### -UserActivityId
key: id of userActivity
```yaml
Type: System.String
Parameter Sets: Update, UpdateExpanded
Aliases:
Required: True
Position: Named
Default value: None
Accept pipeline input: False
Accept wildcard characters: False
```
### -UserId
key: id of user
```yaml
Type: System.String
Parameter Sets: Update, UpdateExpanded
Aliases:
Required: True
Position: Named
Default value: None
Accept pipeline input: False
Accept wildcard characters: False
```
### -Confirm
Prompts you for confirmation before running the cmdlet.
```yaml
Type: System.Management.Automation.SwitchParameter
Parameter Sets: (All)
Aliases: cf
Required: False
Position: Named
Default value: None
Accept pipeline input: False
Accept wildcard characters: False
```
### -WhatIf
Shows what would happen if the cmdlet runs.
The cmdlet is not run.
```yaml
Type: System.Management.Automation.SwitchParameter
Parameter Sets: (All)
Aliases: wi
Required: False
Position: Named
Default value: None
Accept pipeline input: False
Accept wildcard characters: False
```
### CommonParameters
This cmdlet supports the common parameters: -Debug, -ErrorAction, -ErrorVariable, -InformationAction, -InformationVariable, -OutVariable, -OutBuffer, -PipelineVariable, -Verbose, -WarningAction, and -WarningVariable. For more information, see [about_CommonParameters](http://go.microsoft.com/fwlink/?LinkID=113216).
## INPUTS
### Microsoft.Graph.PowerShell.Models.ICrossDeviceExperiencesIdentity
### System.Collections.Hashtable
## OUTPUTS
### System.Boolean
## NOTES
ALIASES
COMPLEX PARAMETER PROPERTIES
To create the parameters described below, construct a hash table containing the appropriate properties. For information on hash tables, run Get-Help about_Hash_Tables.
INPUTOBJECT <ICrossDeviceExperiencesIdentity>: Identity Parameter
- `[ActivityHistoryItemId <String>]`: key: id of activityHistoryItem
- `[DeviceId <String>]`: key: id of device
- `[UserActivityId <String>]`: key: id of userActivity
- `[UserId <String>]`: key: id of user
## RELATED LINKS
| {
"pile_set_name": "Github"
} |
"""
cargo-raze crate build file.
DO NOT EDIT! Replaced on runs of cargo-raze
"""
package(default_visibility = [
# Public for visibility by "@raze__crate__version//" targets.
#
# Prefer access through "//wasm_bindgen/raze", which limits external
# visibility to explicit Cargo.toml dependencies.
"//visibility:public",
])
licenses([
"notice", # "MIT,Apache-2.0"
])
load(
"@io_bazel_rules_rust//rust:rust.bzl",
"rust_binary",
"rust_library",
"rust_test",
)
rust_library(
name = "lazy_static",
srcs = glob(["**/*.rs"]),
crate_features = [
],
crate_root = "src/lib.rs",
crate_type = "lib",
edition = "2015",
rustc_flags = [
"--cap-lints=allow",
],
version = "1.3.0",
deps = [
],
)
# Unsupported target "no_std" with type "test" omitted
# Unsupported target "test" with type "test" omitted
| {
"pile_set_name": "Github"
} |
<?xml version="1.0" encoding="UTF-8"?>
<ui version="4.0">
<class>Perforce::Internal::PendingChangesDialog</class>
<widget class="QDialog" name="Perforce::Internal::PendingChangesDialog">
<property name="windowTitle">
<string>P4 Pending Changes</string>
</property>
<layout class="QVBoxLayout">
<property name="spacing">
<number>6</number>
</property>
<property name="margin">
<number>9</number>
</property>
<item>
<widget class="QListWidget" name="listWidget"/>
</item>
<item>
<layout class="QHBoxLayout">
<property name="spacing">
<number>6</number>
</property>
<property name="margin">
<number>0</number>
</property>
<item>
<spacer>
<property name="orientation">
<enum>Qt::Horizontal</enum>
</property>
<property name="sizeHint" stdset="0">
<size>
<width>131</width>
<height>31</height>
</size>
</property>
</spacer>
</item>
<item>
<widget class="QPushButton" name="submitButton">
<property name="text">
<string>Submit</string>
</property>
</widget>
</item>
<item>
<widget class="QPushButton" name="cancelButton">
<property name="text">
<string>Cancel</string>
</property>
</widget>
</item>
</layout>
</item>
</layout>
</widget>
<resources/>
<connections>
<connection>
<sender>submitButton</sender>
<signal>clicked()</signal>
<receiver>Perforce::Internal::PendingChangesDialog</receiver>
<slot>accept()</slot>
<hints>
<hint type="sourcelabel">
<x>278</x>
<y>253</y>
</hint>
<hint type="destinationlabel">
<x>96</x>
<y>254</y>
</hint>
</hints>
</connection>
<connection>
<sender>cancelButton</sender>
<signal>clicked()</signal>
<receiver>Perforce::Internal::PendingChangesDialog</receiver>
<slot>reject()</slot>
<hints>
<hint type="sourcelabel">
<x>369</x>
<y>253</y>
</hint>
<hint type="destinationlabel">
<x>179</x>
<y>282</y>
</hint>
</hints>
</connection>
</connections>
</ui>
| {
"pile_set_name": "Github"
} |
; Copyright (c) 2001, Stanford University
; All rights reserved.
;
; See the file LICENSE.txt for information on redistributing this software.
EXPORTS
crUnpack
crUnpackPush
crUnpackPop
crUnpackSetReturnPointer
crUnpackSetWritebackPointer
cr_unpackData | {
"pile_set_name": "Github"
} |
# $Id: __init__.py 8068 2017-05-08 22:10:39Z milde $
# Author: David Goodger <[email protected]>
# Copyright: This module has been placed in the public domain.
"""
This is ``docutils.parsers.rst`` package. It exports a single class, `Parser`,
the reStructuredText parser.
Usage
=====
1. Create a parser::
parser = docutils.parsers.rst.Parser()
Several optional arguments may be passed to modify the parser's behavior.
Please see `Customizing the Parser`_ below for details.
2. Gather input (a multi-line string), by reading a file or the standard
input::
input = sys.stdin.read()
3. Create a new empty `docutils.nodes.document` tree::
document = docutils.utils.new_document(source, settings)
See `docutils.utils.new_document()` for parameter details.
4. Run the parser, populating the document tree::
parser.parse(input, document)
Parser Overview
===============
The reStructuredText parser is implemented as a state machine, examining its
input one line at a time. To understand how the parser works, please first
become familiar with the `docutils.statemachine` module, then see the
`states` module.
Customizing the Parser
----------------------
Anything that isn't already customizable is that way simply because that type
of customizability hasn't been implemented yet. Patches welcome!
When instantiating an object of the `Parser` class, two parameters may be
passed: ``rfc2822`` and ``inliner``. Pass ``rfc2822=True`` to enable an
initial RFC-2822 style header block, parsed as a "field_list" element (with
"class" attribute set to "rfc2822"). Currently this is the only body-level
element which is customizable without subclassing. (Tip: subclass `Parser`
and change its "state_classes" and "initial_state" attributes to refer to new
classes. Contact the author if you need more details.)
The ``inliner`` parameter takes an instance of `states.Inliner` or a subclass.
It handles inline markup recognition. A common extension is the addition of
further implicit hyperlinks, like "RFC 2822". This can be done by subclassing
`states.Inliner`, adding a new method for the implicit markup, and adding a
``(pattern, method)`` pair to the "implicit_dispatch" attribute of the
subclass. See `states.Inliner.implicit_inline()` for details. Explicit
inline markup can be customized in a `states.Inliner` subclass via the
``patterns.initial`` and ``dispatch`` attributes (and new methods as
appropriate).
"""
__docformat__ = 'reStructuredText'
import docutils.parsers
import docutils.statemachine
from docutils.parsers.rst import states
from docutils import frontend, nodes, Component
from docutils.transforms import universal
class Parser(docutils.parsers.Parser):
"""The reStructuredText parser."""
supported = ('restructuredtext', 'rst', 'rest', 'restx', 'rtxt', 'rstx')
"""Aliases this parser supports."""
settings_spec = (
'reStructuredText Parser Options',
None,
(('Recognize and link to standalone PEP references (like "PEP 258").',
['--pep-references'],
{'action': 'store_true', 'validator': frontend.validate_boolean}),
('Base URL for PEP references '
'(default "http://www.python.org/dev/peps/").',
['--pep-base-url'],
{'metavar': '<URL>', 'default': 'http://www.python.org/dev/peps/',
'validator': frontend.validate_url_trailing_slash}),
('Template for PEP file part of URL. (default "pep-%04d")',
['--pep-file-url-template'],
{'metavar': '<URL>', 'default': 'pep-%04d'}),
('Recognize and link to standalone RFC references (like "RFC 822").',
['--rfc-references'],
{'action': 'store_true', 'validator': frontend.validate_boolean}),
('Base URL for RFC references (default "http://tools.ietf.org/html/").',
['--rfc-base-url'],
{'metavar': '<URL>', 'default': 'http://tools.ietf.org/html/',
'validator': frontend.validate_url_trailing_slash}),
('Set number of spaces for tab expansion (default 8).',
['--tab-width'],
{'metavar': '<width>', 'type': 'int', 'default': 8,
'validator': frontend.validate_nonnegative_int}),
('Remove spaces before footnote references.',
['--trim-footnote-reference-space'],
{'action': 'store_true', 'validator': frontend.validate_boolean}),
('Leave spaces before footnote references.',
['--leave-footnote-reference-space'],
{'action': 'store_false', 'dest': 'trim_footnote_reference_space'}),
('Disable directives that insert the contents of external file '
'("include" & "raw"); replaced with a "warning" system message.',
['--no-file-insertion'],
{'action': 'store_false', 'default': 1,
'dest': 'file_insertion_enabled',
'validator': frontend.validate_boolean}),
('Enable directives that insert the contents of external file '
'("include" & "raw"). Enabled by default.',
['--file-insertion-enabled'],
{'action': 'store_true'}),
('Disable the "raw" directives; replaced with a "warning" '
'system message.',
['--no-raw'],
{'action': 'store_false', 'default': 1, 'dest': 'raw_enabled',
'validator': frontend.validate_boolean}),
('Enable the "raw" directive. Enabled by default.',
['--raw-enabled'],
{'action': 'store_true'}),
('Token name set for parsing code with Pygments: one of '
'"long", "short", or "none (no parsing)". Default is "long".',
['--syntax-highlight'],
{'choices': ['long', 'short', 'none'],
'default': 'long', 'metavar': '<format>'}),
('Change straight quotation marks to typographic form: '
'one of "yes", "no", "alt[ernative]" (default "no").',
['--smart-quotes'],
{'default': False, 'metavar': '<yes/no/alt>',
'validator': frontend.validate_ternary}),
('Characters to use as "smart quotes" for <language>. ',
['--smartquotes-locales'],
{'metavar': '<language:quotes[,language:quotes,...]>',
'action': 'append',
'validator': frontend.validate_smartquotes_locales}),
('Inline markup recognized at word boundaries only '
'(adjacent to punctuation or whitespace). '
'Force character-level inline markup recognition with '
'"\\ " (backslash + space). Default.',
['--word-level-inline-markup'],
{'action': 'store_false', 'dest': 'character_level_inline_markup'}),
('Inline markup recognized anywhere, regardless of surrounding '
'characters. Backslash-escapes must be used to avoid unwanted '
'markup recognition. Useful for East Asian languages. '
'Experimental.',
['--character-level-inline-markup'],
{'action': 'store_true', 'default': False,
'dest': 'character_level_inline_markup'}),
))
config_section = 'restructuredtext parser'
config_section_dependencies = ('parsers',)
def __init__(self, rfc2822=False, inliner=None):
if rfc2822:
self.initial_state = 'RFC2822Body'
else:
self.initial_state = 'Body'
self.state_classes = states.state_classes
self.inliner = inliner
def get_transforms(self):
return Component.get_transforms(self) + [
universal.SmartQuotes]
def parse(self, inputstring, document):
"""Parse `inputstring` and populate `document`, a document tree."""
self.setup_parse(inputstring, document)
self.statemachine = states.RSTStateMachine(
state_classes=self.state_classes,
initial_state=self.initial_state,
debug=document.reporter.debug_flag)
inputlines = docutils.statemachine.string2lines(
inputstring, tab_width=document.settings.tab_width,
convert_whitespace=True)
self.statemachine.run(inputlines, document, inliner=self.inliner)
self.finish_parse()
class DirectiveError(Exception):
"""
Store a message and a system message level.
To be thrown from inside directive code.
Do not instantiate directly -- use `Directive.directive_error()`
instead!
"""
def __init__(self, level, message):
"""Set error `message` and `level`"""
Exception.__init__(self)
self.level = level
self.msg = message
class Directive(object):
"""
Base class for reStructuredText directives.
The following attributes may be set by subclasses. They are
interpreted by the directive parser (which runs the directive
class):
- `required_arguments`: The number of required arguments (default:
0).
- `optional_arguments`: The number of optional arguments (default:
0).
- `final_argument_whitespace`: A boolean, indicating if the final
argument may contain whitespace (default: False).
- `option_spec`: A dictionary, mapping known option names to
conversion functions such as `int` or `float` (default: {}, no
options). Several conversion functions are defined in the
directives/__init__.py module.
Option conversion functions take a single parameter, the option
argument (a string or ``None``), validate it and/or convert it
to the appropriate form. Conversion functions may raise
`ValueError` and `TypeError` exceptions.
- `has_content`: A boolean; True if content is allowed. Client
code must handle the case where content is required but not
supplied (an empty content list will be supplied).
Arguments are normally single whitespace-separated words. The
final argument may contain whitespace and/or newlines if
`final_argument_whitespace` is True.
If the form of the arguments is more complex, specify only one
argument (either required or optional) and set
`final_argument_whitespace` to True; the client code must do any
context-sensitive parsing.
When a directive implementation is being run, the directive class
is instantiated, and the `run()` method is executed. During
instantiation, the following instance variables are set:
- ``name`` is the directive type or name (string).
- ``arguments`` is the list of positional arguments (strings).
- ``options`` is a dictionary mapping option names (strings) to
values (type depends on option conversion functions; see
`option_spec` above).
- ``content`` is a list of strings, the directive content line by line.
- ``lineno`` is the absolute line number of the first line
of the directive.
- ``content_offset`` is the line offset of the first line of the content from
the beginning of the current input. Used when initiating a nested parse.
- ``block_text`` is a string containing the entire directive.
- ``state`` is the state which called the directive function.
- ``state_machine`` is the state machine which controls the state which called
the directive function.
Directive functions return a list of nodes which will be inserted
into the document tree at the point where the directive was
encountered. This can be an empty list if there is nothing to
insert.
For ordinary directives, the list must contain body elements or
structural elements. Some directives are intended specifically
for substitution definitions, and must return a list of `Text`
nodes and/or inline elements (suitable for inline insertion, in
place of the substitution reference). Such directives must verify
substitution definition context, typically using code like this::
if not isinstance(state, states.SubstitutionDef):
error = state_machine.reporter.error(
'Invalid context: the "%s" directive can only be used '
'within a substitution definition.' % (name),
nodes.literal_block(block_text, block_text), line=lineno)
return [error]
"""
# There is a "Creating reStructuredText Directives" how-to at
# <http://docutils.sf.net/docs/howto/rst-directives.html>. If you
# update this docstring, please update the how-to as well.
required_arguments = 0
"""Number of required directive arguments."""
optional_arguments = 0
"""Number of optional arguments after the required arguments."""
final_argument_whitespace = False
"""May the final argument contain whitespace?"""
option_spec = None
"""Mapping of option names to validator functions."""
has_content = False
"""May the directive have content?"""
def __init__(self, name, arguments, options, content, lineno,
content_offset, block_text, state, state_machine):
self.name = name
self.arguments = arguments
self.options = options
self.content = content
self.lineno = lineno
self.content_offset = content_offset
self.block_text = block_text
self.state = state
self.state_machine = state_machine
def run(self):
raise NotImplementedError('Must override run() is subclass.')
# Directive errors:
def directive_error(self, level, message):
"""
Return a DirectiveError suitable for being thrown as an exception.
Call "raise self.directive_error(level, message)" from within
a directive implementation to return one single system message
at level `level`, which automatically gets the directive block
and the line number added.
Preferably use the `debug`, `info`, `warning`, `error`, or `severe`
wrapper methods, e.g. ``self.error(message)`` to generate an
ERROR-level directive error.
"""
return DirectiveError(level, message)
def debug(self, message):
return self.directive_error(0, message)
def info(self, message):
return self.directive_error(1, message)
def warning(self, message):
return self.directive_error(2, message)
def error(self, message):
return self.directive_error(3, message)
def severe(self, message):
return self.directive_error(4, message)
# Convenience methods:
def assert_has_content(self):
"""
Throw an ERROR-level DirectiveError if the directive doesn't
have contents.
"""
if not self.content:
raise self.error('Content block expected for the "%s" directive; '
'none found.' % self.name)
def add_name(self, node):
"""Append self.options['name'] to node['names'] if it exists.
Also normalize the name string and register it as explicit target.
"""
if 'name' in self.options:
name = nodes.fully_normalize_name(self.options.pop('name'))
if 'name' in node:
del(node['name'])
node['names'].append(name)
self.state.document.note_explicit_target(node, node)
def convert_directive_function(directive_fn):
"""
Define & return a directive class generated from `directive_fn`.
`directive_fn` uses the old-style, functional interface.
"""
class FunctionalDirective(Directive):
option_spec = getattr(directive_fn, 'options', None)
has_content = getattr(directive_fn, 'content', False)
_argument_spec = getattr(directive_fn, 'arguments', (0, 0, False))
required_arguments, optional_arguments, final_argument_whitespace \
= _argument_spec
def run(self):
return directive_fn(
self.name, self.arguments, self.options, self.content,
self.lineno, self.content_offset, self.block_text,
self.state, self.state_machine)
# Return new-style directive.
return FunctionalDirective
| {
"pile_set_name": "Github"
} |
what starts off as a potentially incredibly twisting mystery becomes simply a monster chase film .
| {
"pile_set_name": "Github"
} |
# SPDX-License-Identifier: GPL-2.0
# Makefile for Hyper-V tools
include ../scripts/Makefile.include
sbindir ?= /usr/sbin
libexecdir ?= /usr/libexec
sharedstatedir ?= /var/lib
ifeq ($(srctree),)
srctree := $(patsubst %/,%,$(dir $(CURDIR)))
srctree := $(patsubst %/,%,$(dir $(srctree)))
endif
# Do not use make's built-in rules
# (this improves performance and avoids hard-to-debug behaviour);
MAKEFLAGS += -r
override CFLAGS += -O2 -Wall -g -D_GNU_SOURCE -I$(OUTPUT)include
ALL_TARGETS := hv_kvp_daemon hv_vss_daemon hv_fcopy_daemon
ALL_PROGRAMS := $(patsubst %,$(OUTPUT)%,$(ALL_TARGETS))
ALL_SCRIPTS := hv_get_dhcp_info.sh hv_get_dns_info.sh hv_set_ifconfig.sh
all: $(ALL_PROGRAMS)
export srctree OUTPUT CC LD CFLAGS
include $(srctree)/tools/build/Makefile.include
HV_KVP_DAEMON_IN := $(OUTPUT)hv_kvp_daemon-in.o
$(HV_KVP_DAEMON_IN): FORCE
$(Q)$(MAKE) $(build)=hv_kvp_daemon
$(OUTPUT)hv_kvp_daemon: $(HV_KVP_DAEMON_IN)
$(QUIET_LINK)$(CC) $(CFLAGS) $(LDFLAGS) $< -o $@
HV_VSS_DAEMON_IN := $(OUTPUT)hv_vss_daemon-in.o
$(HV_VSS_DAEMON_IN): FORCE
$(Q)$(MAKE) $(build)=hv_vss_daemon
$(OUTPUT)hv_vss_daemon: $(HV_VSS_DAEMON_IN)
$(QUIET_LINK)$(CC) $(CFLAGS) $(LDFLAGS) $< -o $@
HV_FCOPY_DAEMON_IN := $(OUTPUT)hv_fcopy_daemon-in.o
$(HV_FCOPY_DAEMON_IN): FORCE
$(Q)$(MAKE) $(build)=hv_fcopy_daemon
$(OUTPUT)hv_fcopy_daemon: $(HV_FCOPY_DAEMON_IN)
$(QUIET_LINK)$(CC) $(CFLAGS) $(LDFLAGS) $< -o $@
clean:
rm -f $(ALL_PROGRAMS)
find $(if $(OUTPUT),$(OUTPUT),.) -name '*.o' -delete -o -name '\.*.d' -delete
install: $(ALL_PROGRAMS)
install -d -m 755 $(DESTDIR)$(sbindir); \
install -d -m 755 $(DESTDIR)$(libexecdir)/hypervkvpd; \
install -d -m 755 $(DESTDIR)$(sharedstatedir); \
for program in $(ALL_PROGRAMS); do \
install $$program -m 755 $(DESTDIR)$(sbindir); \
done; \
install -m 755 lsvmbus $(DESTDIR)$(sbindir); \
for script in $(ALL_SCRIPTS); do \
install $$script -m 755 $(DESTDIR)$(libexecdir)/hypervkvpd/$${script%.sh}; \
done
FORCE:
.PHONY: all install clean FORCE prepare
| {
"pile_set_name": "Github"
} |
package db
import (
"time"
"github.com/syndtr/goleveldb/leveldb/errors"
"github.com/status-im/status-go/eth-node/types"
)
// NewHistoryStore returns HistoryStore instance.
func NewHistoryStore(storage Storage) HistoryStore {
return HistoryStore{
topicDB: NewDBNamespace(storage, TopicHistoryBucket),
requestDB: NewDBNamespace(storage, HistoryRequestBucket),
}
}
// HistoryStore provides utility methods for quering history and requests store.
type HistoryStore struct {
topicDB DB
requestDB DB
}
// GetHistory creates history instance and loads history from database.
// Returns instance populated with topic and duration if history is not found in database.
func (h HistoryStore) GetHistory(topic types.TopicType, duration time.Duration) (TopicHistory, error) {
thist := h.NewHistory(topic, duration)
err := thist.Load()
if err != nil && err != errors.ErrNotFound {
return TopicHistory{}, err
}
return thist, nil
}
// NewRequest returns instance of the HistoryRequest.
func (h HistoryStore) NewRequest() HistoryRequest {
return HistoryRequest{requestDB: h.requestDB, topicDB: h.topicDB}
}
// NewHistory creates TopicHistory object with required values.
func (h HistoryStore) NewHistory(topic types.TopicType, duration time.Duration) TopicHistory {
return TopicHistory{db: h.topicDB, Duration: duration, Topic: topic}
}
// GetRequest loads HistoryRequest from database.
func (h HistoryStore) GetRequest(id types.Hash) (HistoryRequest, error) {
req := HistoryRequest{requestDB: h.requestDB, topicDB: h.topicDB, ID: id}
err := req.Load()
if err != nil {
return HistoryRequest{}, err
}
return req, nil
}
// GetAllRequests loads all not-finished history requests from database.
func (h HistoryStore) GetAllRequests() ([]HistoryRequest, error) {
rst := []HistoryRequest{}
iter := h.requestDB.NewIterator(h.requestDB.Range(nil, nil))
for iter.Next() {
req := HistoryRequest{
requestDB: h.requestDB,
topicDB: h.topicDB,
}
err := req.RawUnmarshall(iter.Value())
if err != nil {
return nil, err
}
rst = append(rst, req)
}
return rst, nil
}
// GetHistoriesByTopic returns all histories with a given topic.
// This is needed when we will have multiple range per single topic.
// TODO explain
func (h HistoryStore) GetHistoriesByTopic(topic types.TopicType) ([]TopicHistory, error) {
rst := []TopicHistory{}
iter := h.topicDB.NewIterator(h.topicDB.Range(topic[:], nil))
for iter.Next() {
key := TopicHistoryKey{}
copy(key[:], iter.Key())
th, err := LoadTopicHistoryFromKey(h.topicDB, key)
if err != nil {
return nil, err
}
rst = append(rst, th)
}
return rst, nil
}
| {
"pile_set_name": "Github"
} |
// http://nodejs.cn/api/path.html#path_path_resolve_paths
const {
resolve
} = require('path');
console.log(resolve('./'));
| {
"pile_set_name": "Github"
} |
//
// CustomScrollView.m
// SendMessageController
//
// Created by Remi Robert on 17/11/14.
// Copyright (c) 2014 remirobert. All rights reserved.
//
#import "RRCustomScrollView.h"
@implementation RRCustomScrollView
- (BOOL)touchesShouldCancelInContentView:(UIView *)view {
if ([view isKindOfClass:[UIButton class]])
return YES;
return NO;
}
@end
| {
"pile_set_name": "Github"
} |
/**
* Copyright (c) 2016-present, Facebook, Inc.
* All rights reserved.
*
* This source code is licensed under the BSD-style license found in the
* LICENSE file in the root directory of this source tree. An additional grant
* of patent rights can be found in the PATENTS file in the same directory.
*/
#import <Foundation/Foundation.h>
@class IGListBindingSectionController;
@protocol IGListBindable;
@protocol IGListDiffable;
NS_ASSUME_NONNULL_BEGIN
/**
A protocol that returns data to power cells in an `IGListBindingSectionController`.
*/
NS_SWIFT_NAME(ListBindingSectionControllerDataSource)
@protocol IGListBindingSectionControllerDataSource <NSObject>
/**
Create an array of view models given a top-level object.
@param sectionController The section controller requesting view models.
@param object The top-level object that powers the section controller.
@return A new array of view models.
*/
- (NSArray<id<IGListDiffable>> *)sectionController:(IGListBindingSectionController *)sectionController
viewModelsForObject:(id)object;
/**
Return a dequeued cell for a given view model.
@param sectionController The section controller requesting a cell.
@param viewModel The view model for the cell.
@param index The index of the view model.
@return A dequeued cell.
@note The section controller will call `-bindViewModel:` with the provided view model after the cell is dequeued. You
should handle cell configuration using this method. However, you can do additional configuration at this stage as well.
*/
- (UICollectionViewCell<IGListBindable> *)sectionController:(IGListBindingSectionController *)sectionController
cellForViewModel:(id)viewModel
atIndex:(NSInteger)index;
/**
Return a cell size for a given view model.
@param sectionController The section controller requesting a size.
@param viewModel The view model for the cell.
@param index The index of the view model.
@return A size for the view model.
*/
- (CGSize)sectionController:(IGListBindingSectionController *)sectionController
sizeForViewModel:(id)viewModel
atIndex:(NSInteger)index;
@end
NS_ASSUME_NONNULL_END
| {
"pile_set_name": "Github"
} |
Experiment all_results for
datafile = ../data/tsdlr_5050/beveridge-wheat-price-index-1500.mat
Running experiment:
description = Trying latest code on interpolation task,
data_dir = ../data/tsdlr_5050/,
max_depth = 10,
random_order = False,
k = 1,
debug = False,
local_computation = False,
n_rand = 9,
sd = 2,
jitter_sd = 0.1,
max_jobs = 600,
verbose = False,
make_predictions = True,
skip_complete = True,
results_dir = ../results/2013-12-10-interp-GPSS/,
iters = 250,
base_kernels = SE,Per,Lin,Const,Noise,
additive_form = True,
mean = ff.MeanZero(),
kernel = ff.NoiseKernel(),
lik = ff.LikGauss(sf=-np.Inf),
verbose_results = False,
random_seed = 1,
period_heuristic = 3,
subset = True,
subset_size = 250,
full_iters = 10,
bundle_size = 5,
search_operators = [('A', ('+', 'A', 'B'), {'A': 'kernel', 'B': 'base'}), ('A', ('*', 'A', 'B'), {'A': 'kernel', 'B': 'base-not-const'}), ('A', ('*-const', 'A', 'B'), {'A': 'kernel', 'B': 'base-not-const'}), ('A', 'B', {'A': 'kernel', 'B': 'base'}), ('A', ('CP', 'd', 'A'), {'A': 'kernel', 'd': 'dimension'}), ('A', ('CW', 'd', 'A'), {'A': 'kernel', 'd': 'dimension'}), ('A', ('B', 'd', 'A'), {'A': 'kernel', 'd': 'dimension'}), ('A', ('BL', 'd', 'A'), {'A': 'kernel', 'd': 'dimension'}), ('A', ('None',), {'A': 'kernel'})],
score = bic,
period_heuristic_type = min,
%%%%% Level 0 %%%%%
GPModel(mean=MeanZero(), kernel=SumKernel(operands=[NoiseKernel(sf=3.38945708407), SqExpKernel(dimension=0, lengthscale=4.56018541957, sf=4.65447485806)]), likelihood=LikGauss(sf=-inf), nll=903.757771862, ndata=185)
%%%%% Level 1 %%%%%
GPModel(mean=MeanZero(), kernel=SumKernel(operands=[NoiseKernel(sf=-22.3559701971), SqExpKernel(dimension=0, lengthscale=4.5555546817, sf=4.66844951566), ProductKernel(operands=[NoiseKernel(sf=-4.70158444416), LinearKernel(dimension=0, location=2120.5780432, sf=-6.93037289753)]), ProductKernel(operands=[SqExpKernel(dimension=0, lengthscale=0.019360738899, sf=1.05146480268), LinearKernel(dimension=0, location=1477.08632191, sf=-3.12723116732)])]), likelihood=LikGauss(sf=-inf), nll=822.094682769, ndata=185)
%%%%% Level 2 %%%%%
GPModel(mean=MeanZero(), kernel=SumKernel(operands=[SqExpKernel(dimension=0, lengthscale=4.5555040749, sf=4.668318377), ProductKernel(operands=[SqExpKernel(dimension=0, lengthscale=0.019361679865, sf=1.07516217977), LinearKernel(dimension=0, location=1477.08500571, sf=-3.15093778571)])]), likelihood=LikGauss(sf=-inf), nll=822.094684613, ndata=185)
%%%%% Level 3 %%%%%
GPModel(mean=MeanZero(), kernel=SumKernel(operands=[SqExpKernel(dimension=0, lengthscale=4.56243956272, sf=4.6754623611), ChangeWindowKernel(dimension=0, location=1760.35567092, steepness=1.3011421529, width=4.21095314117, operands=[ ProductKernel(operands=[SqExpKernel(dimension=0, lengthscale=0.062024029733, sf=1.08021965942), LinearKernel(dimension=0, location=1479.03506907, sf=-3.03478964796)]), ProductKernel(operands=[SqExpKernel(dimension=0, lengthscale=0.0163263471047, sf=0.746614970581), LinearKernel(dimension=0, location=1477.02871928, sf=-3.63434188643)]) ])]), likelihood=LikGauss(sf=-inf), nll=804.922588591, ndata=185)
%%%%% Level 4 %%%%%
GPModel(mean=MeanZero(), kernel=SumKernel(operands=[SqExpKernel(dimension=0, lengthscale=4.56498897824, sf=4.67965110146), ChangeWindowKernel(dimension=0, location=1760.38217762, steepness=1.28271175358, width=4.21020949374, operands=[ ProductKernel(operands=[SqExpKernel(dimension=0, lengthscale=0.0628302985506, sf=1.13169207293), LinearKernel(dimension=0, location=1479.18105267, sf=-3.08415409725)]), SqExpKernel(dimension=0, lengthscale=0.0135731433532, sf=2.778897907) ])]), likelihood=LikGauss(sf=-inf), nll=805.401413872, ndata=185)
%%%%% Level 5 %%%%%
GPModel(mean=MeanZero(), kernel=SumKernel(operands=[SqExpKernel(dimension=0, lengthscale=4.56857521009, sf=4.68013704963), ChangeWindowKernel(dimension=0, location=1760.41139812, steepness=1.4271151977, width=4.20909895695, operands=[ ProductKernel(operands=[SqExpKernel(dimension=0, lengthscale=0.0631928632731, sf=1.16311002843), LinearKernel(dimension=0, location=1479.25101675, sf=-3.11497994938)]), SqExpKernel(dimension=0, lengthscale=0.0150727630594, sf=2.78214929789) ])]), likelihood=LikGauss(sf=-inf), nll=805.392903426, ndata=185)
%%%%% Level 6 %%%%%
GPModel(mean=MeanZero(), kernel=SumKernel(operands=[SqExpKernel(dimension=0, lengthscale=4.56812249601, sf=4.67946057198), ChangeWindowKernel(dimension=0, location=1760.39612002, steepness=1.34035165747, width=4.20969815995, operands=[ ProductKernel(operands=[SqExpKernel(dimension=0, lengthscale=0.0625682860656, sf=4.02400536346), LinearKernel(dimension=0, location=1479.40206009, sf=-5.9752873081)]), SqExpKernel(dimension=0, lengthscale=0.0136223403461, sf=2.77802544839) ])]), likelihood=LikGauss(sf=-inf), nll=805.382821414, ndata=185)
%%%%% Level 7 %%%%%
GPModel(mean=MeanZero(), kernel=SumKernel(operands=[SqExpKernel(dimension=0, lengthscale=4.52897218429, sf=4.61962749948), ChangeWindowKernel(dimension=0, location=1755.51588989, steepness=1.58974166851, width=4.34548590904, operands=[ ProductKernel(operands=[SqExpKernel(dimension=0, lengthscale=0.0633714363064, sf=4.20115882), LinearKernel(dimension=0, location=1483.90441213, sf=-6.10580276971)]), NoiseKernel(sf=2.72658922575) ])]), likelihood=LikGauss(sf=-inf), nll=807.482910329, ndata=185)
%%%%% Level 8 %%%%%
GPModel(mean=MeanZero(), kernel=SumKernel(operands=[SqExpKernel(dimension=0, lengthscale=4.57546721654, sf=4.67786162143), ChangeWindowKernel(dimension=0, location=1755.44687787, steepness=1.6442242051, width=4.34666694701, operands=[ ProductKernel(operands=[SqExpKernel(dimension=0, lengthscale=0.0601866927242, sf=5.13624758086), LinearKernel(dimension=0, location=1484.02147146, sf=-7.03011133639)]), NoiseKernel(sf=2.71203542796) ])]), likelihood=LikGauss(sf=-inf), nll=807.237968207, ndata=185)
%%%%% Level 9 %%%%%
GPModel(mean=MeanZero(), kernel=SumKernel(operands=[SqExpKernel(dimension=0, lengthscale=4.57391319586, sf=4.67323311643), ChangeWindowKernel(dimension=0, location=1755.45042596, steepness=1.71075085631, width=4.34648117341, operands=[ ProductKernel(operands=[SqExpKernel(dimension=0, lengthscale=0.0603205183407, sf=5.12653854271), LinearKernel(dimension=0, location=1484.02031357, sf=-7.02055523945)]), NoiseKernel(sf=2.71200250398) ])]), likelihood=LikGauss(sf=-inf), nll=807.237804537, ndata=185)
| {
"pile_set_name": "Github"
} |
cloud.google.com/go v0.26.0/go.mod h1:aQUYkXzVsufM+DwF1aE+0xfcU+56JwCaLick0ClmMTw=
cloud.google.com/go v0.34.0 h1:eOI3/cP2VTU6uZLDYAoic+eyzzB9YyGmJ7eIjl8rOPg=
cloud.google.com/go v0.34.0/go.mod h1:aQUYkXzVsufM+DwF1aE+0xfcU+56JwCaLick0ClmMTw=
github.com/BurntSushi/toml v0.3.1/go.mod h1:xHWCNGjB5oqiDr8zfno3MHue2Ht5sIBksp03qcyfWMU=
github.com/Shopify/sarama v1.19.0/go.mod h1:FVkBWblsNy7DGZRfXLU0O9RCGt5g3g3yEuWXgklEdEo=
github.com/Shopify/toxiproxy v2.1.4+incompatible/go.mod h1:OXgGpZ6Cli1/URJOF1DMxUHB2q5Ap20/P/eIdh4G0pI=
github.com/alecthomas/template v0.0.0-20160405071501-a0175ee3bccc/go.mod h1:LOuyumcjzFXgccqObfd/Ljyb9UuFJ6TxHnclSeseNhc=
github.com/alecthomas/units v0.0.0-20151022065526-2efee857e7cf/go.mod h1:ybxpYRFXyAe+OPACYpWeL0wqObRcbAqCMya13uyzqw0=
github.com/apache/thrift v0.12.0/go.mod h1:cp2SuWMxlEZw2r+iP2GNCdIi4C1qmUzdZFSVb+bacwQ=
github.com/beorn7/perks v0.0.0-20180321164747-3a771d992973/go.mod h1:Dwedo/Wpr24TaqPxmxbtue+5NUziq4I4S80YR8gNf3Q=
github.com/client9/misspell v0.3.4/go.mod h1:qj6jICC3Q7zFZvVWo7KLAzC3yx5G7kyvSDkc90ppPyw=
github.com/davecgh/go-spew v1.1.1/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38=
github.com/eapache/go-resiliency v1.1.0/go.mod h1:kFI+JgMyC7bLPUVY133qvEBtVayf5mFgVsvEsIPBvNs=
github.com/eapache/go-xerial-snappy v0.0.0-20180814174437-776d5712da21/go.mod h1:+020luEh2TKB4/GOp8oxxtq0Daoen/Cii55CzbTV6DU=
github.com/eapache/queue v1.1.0/go.mod h1:6eCeP0CKFpHLu8blIFXhExK/dRa7WDZfr6jVFPTqq+I=
github.com/fsnotify/fsnotify v1.4.7/go.mod h1:jwhsz4b93w/PPRr/qN1Yymfu8t87LnFCMoQvtojpjFo=
github.com/go-kit/kit v0.8.0/go.mod h1:xBxKIO96dXMWWy0MnWVtmwkA9/13aqxPnvrjFYMA2as=
github.com/go-logfmt/logfmt v0.3.0/go.mod h1:Qt1PoO58o5twSAckw1HlFXLmHsOX5/0LbT9GBnD5lWE=
github.com/go-stack/stack v1.8.0/go.mod h1:v0f6uXyyMGvRgIKkXu+yp6POWl0qKG85gN/melR3HDY=
github.com/gogo/protobuf v1.1.1/go.mod h1:r8qH/GZQm5c6nD/R0oafs1akxWv10x8SbQlK7atdtwQ=
github.com/gogo/protobuf v1.2.0/go.mod h1:r8qH/GZQm5c6nD/R0oafs1akxWv10x8SbQlK7atdtwQ=
github.com/golang/glog v0.0.0-20160126235308-23def4e6c14b/go.mod h1:SBH7ygxi8pfUlaOkMMuAQtPIUF8ecWP5IEl/CR7VP2Q=
github.com/golang/mock v1.1.1/go.mod h1:oTYuIxOrZwtPieC+H1uAHpcLFnEyAGVDL/k47Jfbm0A=
github.com/golang/protobuf v1.2.0 h1:P3YflyNX/ehuJFLhxviNdFxQPkGK5cDcApsge1SqnvM=
github.com/golang/protobuf v1.2.0/go.mod h1:6lQm79b+lXiMfvg/cZm0SGofjICqVBUtrP5yJMmIC1U=
github.com/golang/snappy v0.0.0-20180518054509-2e65f85255db/go.mod h1:/XxbfmMg8lxefKM7IXC3fBNl/7bRcc72aCRzEWrmP2Q=
github.com/google/go-cmp v0.2.0/go.mod h1:oXzfMopK8JAjlY9xF4vHSVASa0yLyX7SntLO5aqRK0M=
github.com/gorilla/context v1.1.1/go.mod h1:kBGZzfjB9CEq2AlWe17Uuf7NDRt0dE0s8S51q0aT7Yg=
github.com/gorilla/mux v1.6.2/go.mod h1:1lud6UwP+6orDFRuTfBEV8e9/aOM/c4fVVCaMa2zaAs=
github.com/hashicorp/golang-lru v0.5.0 h1:CL2msUPvZTLb5O648aiLNJw3hnBxN2+1Jq8rCOH9wdo=
github.com/hashicorp/golang-lru v0.5.0/go.mod h1:/m3WP610KZHVQ1SGc6re/UDhFvYD7pJ4Ao+sR/qLZy8=
github.com/hpcloud/tail v1.0.0/go.mod h1:ab1qPbhIpdTxEkNHXyeSf5vhxWSCs/tWer42PpOxQnU=
github.com/julienschmidt/httprouter v1.2.0/go.mod h1:SYymIcj16QtmaHHD7aYtjjsJG7VTCxuUUipMqKk8s4w=
github.com/kisielk/gotool v1.0.0/go.mod h1:XhKaO+MFFWcvkIS/tQcRk01m1F5IRFswLeQ+oQHNcck=
github.com/konsorten/go-windows-terminal-sequences v1.0.1/go.mod h1:T0+1ngSBFLxvqU3pZ+m/2kptfBszLMUkC4ZK/EgS/cQ=
github.com/kr/logfmt v0.0.0-20140226030751-b84e30acd515/go.mod h1:+0opPa2QZZtGFBFZlji/RkVcI2GknAs/DXo4wKdlNEc=
github.com/matttproud/golang_protobuf_extensions v1.0.1/go.mod h1:D8He9yQNgCq6Z5Ld7szi9bcBfOoFv/3dc6xSMkL2PC0=
github.com/mwitkow/go-conntrack v0.0.0-20161129095857-cc309e4a2223/go.mod h1:qRWi+5nqEBWmkhHvq77mSJWrCKwh8bxhgT7d/eI7P4U=
github.com/onsi/ginkgo v1.6.0/go.mod h1:lLunBs/Ym6LB5Z9jYTR76FiuTmxDTDusOGeTQH+WWjE=
github.com/onsi/ginkgo v1.7.0/go.mod h1:lLunBs/Ym6LB5Z9jYTR76FiuTmxDTDusOGeTQH+WWjE=
github.com/onsi/gomega v1.4.3/go.mod h1:ex+gbHU/CVuBBDIJjb2X0qEXbFg53c61hWP/1CpauHY=
github.com/openzipkin/zipkin-go v0.1.6/go.mod h1:QgAqvLzwWbR/WpD4A3cGpPtJrZXNIiJc5AZX7/PBEpw=
github.com/pierrec/lz4 v2.0.5+incompatible/go.mod h1:pdkljMzZIN41W+lC3N2tnIh5sFi+IEE17M5jbnwPHcY=
github.com/pkg/errors v0.8.0/go.mod h1:bwawxfHBFNV+L2hUp1rHADufV3IMtnDRdf1r5NINEl0=
github.com/pmezard/go-difflib v1.0.0/go.mod h1:iKH77koFhYxTK1pcRnkKkqfTogsbg7gZNVY4sRDYZ/4=
github.com/prometheus/client_golang v0.9.1/go.mod h1:7SWBe2y4D6OKWSNQJUaRYU/AaXPKyh/dDVn+NZz0KFw=
github.com/prometheus/client_golang v0.9.3-0.20190127221311-3c4408c8b829/go.mod h1:p2iRAGwDERtqlqzRXnrOVns+ignqQo//hLXqYxZYVNs=
github.com/prometheus/client_model v0.0.0-20180712105110-5c3871d89910/go.mod h1:MbSGuTsp3dbXC40dX6PRTWyKYBIrTGTE9sqQNg2J8bo=
github.com/prometheus/client_model v0.0.0-20190115171406-56726106282f/go.mod h1:MbSGuTsp3dbXC40dX6PRTWyKYBIrTGTE9sqQNg2J8bo=
github.com/prometheus/common v0.2.0/go.mod h1:TNfzLD0ON7rHzMJeJkieUDPYmFC7Snx/y86RQel1bk4=
github.com/prometheus/procfs v0.0.0-20181005140218-185b4288413d/go.mod h1:c3At6R/oaqEKCNdg8wHV1ftS6bRYblBhIjjI8uT2IGk=
github.com/prometheus/procfs v0.0.0-20190117184657-bf6a532e95b1/go.mod h1:c3At6R/oaqEKCNdg8wHV1ftS6bRYblBhIjjI8uT2IGk=
github.com/rcrowley/go-metrics v0.0.0-20181016184325-3113b8401b8a/go.mod h1:bCqnVzQkZxMG4s8nGwiZ5l3QUCyqpo9Y+/ZMZ9VjZe4=
github.com/sirupsen/logrus v1.2.0/go.mod h1:LxeOpSwHxABJmUn/MG1IvRgCAasNZTLOkJPxbbu5VWo=
github.com/stretchr/objx v0.1.1/go.mod h1:HFkY916IF+rwdDfMAkV7OtwuqBVzrE8GR6GFx+wExME=
github.com/stretchr/testify v1.2.2/go.mod h1:a8OnRcib4nhh0OaRAV+Yts87kKdq0PP7pXfy6kDkUVs=
go.opencensus.io v0.20.1 h1:pMEjRZ1M4ebWGikflH7nQpV6+Zr88KBMA2XJD3sbijw=
go.opencensus.io v0.20.1/go.mod h1:6WKK9ahsWS3RSO+PY9ZHZUfv2irvY6gN279GOPZjmmk=
golang.org/x/crypto v0.0.0-20180904163835-0709b304e793/go.mod h1:6SG95UA2DQfeDnfUPMdvaQW0Q7yPrPDi9nlGo2tz2b4=
golang.org/x/crypto v0.0.0-20190308221718-c2843e01d9a2/go.mod h1:djNgcEr1/C05ACkg1iLfiJU5Ep61QUkGW8qpdssI0+w=
golang.org/x/exp v0.0.0-20190121172915-509febef88a4/go.mod h1:CJ0aWSM057203Lf6IL+f9T1iT9GByDxfZKAQTCR3kQA=
golang.org/x/lint v0.0.0-20181026193005-c67002cb31c3/go.mod h1:UVdnD1Gm6xHRNCYTkRU2/jEulfH38KcIWyp/GAMgvoE=
golang.org/x/lint v0.0.0-20190227174305-5b3e6a55c961/go.mod h1:wehouNa3lNwaWXcvxsM5YxQ5yQlVC4a0KAMCusXpPoU=
golang.org/x/lint v0.0.0-20190301231843-5614ed5bae6f/go.mod h1:UVdnD1Gm6xHRNCYTkRU2/jEulfH38KcIWyp/GAMgvoE=
golang.org/x/net v0.0.0-20180724234803-3673e40ba225/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4=
golang.org/x/net v0.0.0-20180826012351-8a410e7b638d/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4=
golang.org/x/net v0.0.0-20180906233101-161cd47e91fd/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4=
golang.org/x/net v0.0.0-20181114220301-adae6a3d119a/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4=
golang.org/x/net v0.0.0-20190108225652-1e06a53dbb7e/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4=
golang.org/x/net v0.0.0-20190125091013-d26f9f9a57f3/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4=
golang.org/x/net v0.0.0-20190213061140-3a22650c66bd/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4=
golang.org/x/net v0.0.0-20190311183353-d8887717615a h1:oWX7TPOiFAMXLq8o0ikBYfCJVlRHBcsciT5bXOrH628=
golang.org/x/net v0.0.0-20190311183353-d8887717615a/go.mod h1:t9HGtf8HONx5eT2rtn7q6eTqICYqUVnKs3thJo3Qplg=
golang.org/x/oauth2 v0.0.0-20180821212333-d2e6202438be/go.mod h1:N/0e6XlmueqKjAGxoOufVs8QHGRruUQn6yWY3a++T0U=
golang.org/x/oauth2 v0.0.0-20190226205417-e64efc72b421/go.mod h1:gOpvHmFTYa4IltrdGE7lF6nIHvwfUNPOp7c8zoXwtLw=
golang.org/x/oauth2 v0.0.0-20190402181905-9f3314589c9a h1:tImsplftrFpALCYumobsd0K86vlAs/eXGFms2txfJfA=
golang.org/x/oauth2 v0.0.0-20190402181905-9f3314589c9a/go.mod h1:gOpvHmFTYa4IltrdGE7lF6nIHvwfUNPOp7c8zoXwtLw=
golang.org/x/sync v0.0.0-20180314180146-1d60e4601c6f/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM=
golang.org/x/sync v0.0.0-20181108010431-42b317875d0f/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM=
golang.org/x/sync v0.0.0-20181221193216-37e7f081c4d4/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM=
golang.org/x/sync v0.0.0-20190227155943-e225da77a7e6/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM=
golang.org/x/sys v0.0.0-20180830151530-49385e6e1522/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY=
golang.org/x/sys v0.0.0-20180905080454-ebe1bf3edb33/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY=
golang.org/x/sys v0.0.0-20180909124046-d0be0721c37e/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY=
golang.org/x/sys v0.0.0-20181116152217-5ac8a444bdc5/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY=
golang.org/x/sys v0.0.0-20181122145206-62eef0e2fa9b/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY=
golang.org/x/sys v0.0.0-20190215142949-d0b11bdaac8a h1:1BGLXjeY4akVXGgbC9HugT3Jv3hCI0z56oJR5vAMgBU=
golang.org/x/sys v0.0.0-20190215142949-d0b11bdaac8a/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY=
golang.org/x/text v0.3.0 h1:g61tztE5qeGQ89tm6NTjjM9VPIm088od1l6aSorWRWg=
golang.org/x/text v0.3.0/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ=
golang.org/x/tools v0.0.0-20180828015842-6cd1fcedba52/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ=
golang.org/x/tools v0.0.0-20190114222345-bf090417da8b/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ=
golang.org/x/tools v0.0.0-20190226205152-f727befe758c/go.mod h1:9Yl7xja0Znq3iFh3HoIrodX9oNMXvdceNzlUR8zjMvY=
golang.org/x/tools v0.0.0-20190312170243-e65039ee4138/go.mod h1:LCzVGOaR6xXOjkQ3onu1FJEFr0SW1gC7cKk1uF8kGRs=
google.golang.org/api v0.3.1/go.mod h1:6wY9I6uQWHQ8EM57III9mq/AjF+i8G65rmVagqKMtkk=
google.golang.org/api v0.3.2 h1:iTp+3yyl/KOtxa/d1/JUE0GGSoR6FuW5udver22iwpw=
google.golang.org/api v0.3.2/go.mod h1:6wY9I6uQWHQ8EM57III9mq/AjF+i8G65rmVagqKMtkk=
google.golang.org/appengine v1.1.0/go.mod h1:EbEs0AVv82hx2wNQdGPgUI5lhzA/G0D9YwlJXL52JkM=
google.golang.org/appengine v1.4.0/go.mod h1:xpcJRLb0r/rnEns0DIKYYv+WjYCduHsrkT7/EB5XEv4=
google.golang.org/genproto v0.0.0-20180817151627-c66870c02cf8/go.mod h1:JiN7NxoALGmiZfu7CAH4rXhgtRTLTxftemlI0sWmxmc=
google.golang.org/genproto v0.0.0-20190307195333-5fe7a883aa19 h1:Lj2SnHtxkRGJDqnGaSjo+CCdIieEnwVazbOXILwQemk=
google.golang.org/genproto v0.0.0-20190307195333-5fe7a883aa19/go.mod h1:VzzqZJRnGkLBvHegQrXjBqPurQTc5/KpmUdxsrq26oE=
google.golang.org/grpc v1.17.0/go.mod h1:6QZJwpn2B+Zp71q/5VxRsJ6NXXVCE5NRUHRo+f3cWCs=
google.golang.org/grpc v1.19.0 h1:cfg4PD8YEdSFnm7qLV4++93WcmhH2nIUhMjhdCvl3j8=
google.golang.org/grpc v1.19.0/go.mod h1:mqu4LbDTu4XGKhr4mRzUsmM4RtVoemTSY81AxZiDr8c=
gopkg.in/alecthomas/kingpin.v2 v2.2.6/go.mod h1:FMv+mEhP44yOT+4EoQTLFTRgOQ1FBLkstjWtayDeSgw=
gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0=
gopkg.in/fsnotify.v1 v1.4.7/go.mod h1:Tz8NjZHkW78fSQdbUxIjBTcgA1z1m8ZHf0WmKUhAMys=
gopkg.in/tomb.v1 v1.0.0-20141024135613-dd632973f1e7/go.mod h1:dt/ZhP58zS4L8KSrWDmTeBkI65Dw0HsyUHuEVlX15mw=
gopkg.in/yaml.v2 v2.2.1/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI=
honnef.co/go/tools v0.0.0-20180728063816-88497007e858/go.mod h1:rf3lG4BRIbNafJWhAfAdb/ePZxsR/4RtNHQocxwk9r4=
honnef.co/go/tools v0.0.0-20190102054323-c2f93a96b099/go.mod h1:rf3lG4BRIbNafJWhAfAdb/ePZxsR/4RtNHQocxwk9r4=
| {
"pile_set_name": "Github"
} |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.