text
stringlengths
2
100k
meta
dict
.home { min-height: calc(100vh - 37px); padding-top: 29vh; text-align: center; position: relative; z-index: 9; background: white; border: 1px solid #ccc; margin: 0 auto; button { height: 21px; font-size: 12.5px; width: 105px; } small { font-size: 13px; } }
{ "pile_set_name": "Github" }
<!DOCTYPE html> <html lang="en"> <head> <meta charset="utf-8"> <title>Page Not Found :(</title> <style> ::-moz-selection { background: #b3d4fc; text-shadow: none; } ::selection { background: #b3d4fc; text-shadow: none; } html { padding: 30px 10px; font-size: 20px; line-height: 1.4; color: #737373; background: #f0f0f0; -webkit-text-size-adjust: 100%; -ms-text-size-adjust: 100%; } html, input { font-family: "Helvetica Neue", Helvetica, Arial, sans-serif; } body { max-width: 500px; _width: 500px; padding: 30px 20px 50px; border: 1px solid #b3b3b3; border-radius: 4px; margin: 0 auto; box-shadow: 0 1px 10px #a7a7a7, inset 0 1px 0 #fff; background: #fcfcfc; } h1 { margin: 0 10px; font-size: 50px; text-align: center; } h1 span { color: #bbb; } h3 { margin: 1.5em 0 0.5em; } p { margin: 1em 0; } ul { padding: 0 0 0 40px; margin: 1em 0; } .container { max-width: 380px; _width: 380px; margin: 0 auto; } /* google search */ #goog-fixurl ul { list-style: none; padding: 0; margin: 0; } #goog-fixurl form { margin: 0; } #goog-wm-qt, #goog-wm-sb { border: 1px solid #bbb; font-size: 16px; line-height: normal; vertical-align: top; color: #444; border-radius: 2px; } #goog-wm-qt { width: 220px; height: 20px; padding: 5px; margin: 5px 10px 0 0; box-shadow: inset 0 1px 1px #ccc; } #goog-wm-sb { display: inline-block; height: 32px; padding: 0 10px; margin: 5px 0 0; white-space: nowrap; cursor: pointer; background-color: #f5f5f5; background-image: -webkit-linear-gradient(rgba(255,255,255,0), #f1f1f1); background-image: -moz-linear-gradient(rgba(255,255,255,0), #f1f1f1); background-image: -ms-linear-gradient(rgba(255,255,255,0), #f1f1f1); background-image: -o-linear-gradient(rgba(255,255,255,0), #f1f1f1); -webkit-appearance: none; -moz-appearance: none; appearance: none; *overflow: visible; *display: inline; *zoom: 1; } #goog-wm-sb:hover, #goog-wm-sb:focus { border-color: #aaa; box-shadow: 0 1px 1px rgba(0, 0, 0, 0.1); background-color: #f8f8f8; } #goog-wm-qt:hover, #goog-wm-qt:focus { border-color: #105cb6; outline: 0; color: #222; } input::-moz-focus-inner { padding: 0; border: 0; } </style> </head> <body> <div class="container"> <h1>Not found <span>:(</span></h1> <p>Sorry, but the page you were trying to view does not exist.</p> <p>It looks like this was the result of either:</p> <ul> <li>a mistyped address</li> <li>an out-of-date link</li> </ul> <script> var GOOG_FIXURL_LANG = (navigator.language || '').slice(0,2),GOOG_FIXURL_SITE = location.host; </script> <script src="//linkhelp.clients.google.com/tbproxy/lh/wm/fixurl.js"></script> </div> </body> </html>
{ "pile_set_name": "Github" }
package com.lody.virtual.client.hook.proxies.network; import android.annotation.TargetApi; import android.os.Build; import com.lody.virtual.client.hook.base.BinderInvocationProxy; import com.lody.virtual.client.hook.base.ReplaceUidMethodProxy; import mirror.android.os.INetworkManagementService; @TargetApi(Build.VERSION_CODES.M) public class NetworkManagementStub extends BinderInvocationProxy { public NetworkManagementStub() { super(INetworkManagementService.Stub.asInterface, "network_management"); } @Override protected void onBindMethods() { super.onBindMethods(); addMethodProxy(new ReplaceUidMethodProxy("setUidCleartextNetworkPolicy", 0)); } }
{ "pile_set_name": "Github" }
pattern 021000 177000 pattern 020400 176400 pattern 020200 176200 pattern 020100 176100 pattern 020040 176040 pattern 020020 176020 pattern 020010 176010 pattern 020004 176004 pattern 020002 176002 pattern 020000 176001
{ "pile_set_name": "Github" }
<?xml version="1.0" encoding="UTF-8" ?> <dataset> <table name="phpbb_groups"> <column>group_id</column> <column>group_name</column> <column>group_desc</column> <row> <value>10</value> <value>foobar_group</value> <value>test123</value> </row> </table> <table name="phpbb_users"> <column>user_id</column> <column>username</column> <column>username_clean</column> <column>user_permissions</column> <column>user_sig</column> <row> <value>1</value> <value>admin</value> <value>admin</value> <value></value> <value></value> </row> <row> <value>2</value> <value>moderator</value> <value>moderator</value> <value></value> <value></value> </row> </table> </dataset>
{ "pile_set_name": "Github" }
<?xml version="1.0" encoding="UTF-8"?> <!-- Copyright (C) 2006 W3C (R) (MIT ERCIM Keio), All Rights Reserved. W3C liability, trademark and document use rules apply. http://www.w3.org/Consortium/Legal/ipr-notice http://www.w3.org/Consortium/Legal/copyright-documents Generated from: $Id: examples.xml,v 1.57 2008/02/20 16:41:48 pdowney Exp $ --> <env:Envelope xmlns:env="http://schemas.xmlsoap.org/soap/envelope/" xmlns:xs="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:p="http://www.w3.org/2002/ws/databinding/patterns/6/09/" xmlns:ex="http://www.w3.org/2002/ws/databinding/examples/6/09/"> <env:Header/> <env:Body> <ex:echoDecimalElement> <ex:decimalElement xmlns:wsdl11="http://schemas.xmlsoap.org/wsdl/" xmlns:soap11enc="http://schemas.xmlsoap.org/soap/encoding/">210.00</ex:decimalElement> </ex:echoDecimalElement> </env:Body> </env:Envelope>
{ "pile_set_name": "Github" }
/* * QEMU PowerPC PowerNV XSCOM bus * * Copyright (c) 2016, IBM Corporation. * * This library 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 of the License, or (at your option) any later version. * * This library 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 this library; if not, see <http://www.gnu.org/licenses/>. */ #include "qemu/osdep.h" #include "qemu/log.h" #include "qemu/module.h" #include "sysemu/hw_accel.h" #include "target/ppc/cpu.h" #include "hw/sysbus.h" #include "hw/ppc/fdt.h" #include "hw/ppc/pnv.h" #include "hw/ppc/pnv_xscom.h" #include <libfdt.h> /* PRD registers */ #define PRD_P8_IPOLL_REG_MASK 0x01020013 #define PRD_P8_IPOLL_REG_STATUS 0x01020014 #define PRD_P9_IPOLL_REG_MASK 0x000F0033 #define PRD_P9_IPOLL_REG_STATUS 0x000F0034 /* PBA BARs */ #define P8_PBA_BAR0 0x2013f00 #define P8_PBA_BAR2 0x2013f02 #define P8_PBA_BARMASK0 0x2013f04 #define P8_PBA_BARMASK2 0x2013f06 #define P9_PBA_BAR0 0x5012b00 #define P9_PBA_BAR2 0x5012b02 #define P9_PBA_BARMASK0 0x5012b04 #define P9_PBA_BARMASK2 0x5012b06 static void xscom_complete(CPUState *cs, uint64_t hmer_bits) { /* * TODO: When the read/write comes from the monitor, NULL is * passed for the cpu, and no CPU completion is generated. */ if (cs) { PowerPCCPU *cpu = POWERPC_CPU(cs); CPUPPCState *env = &cpu->env; /* * TODO: Need a CPU helper to set HMER, also handle generation * of HMIs */ cpu_synchronize_state(cs); env->spr[SPR_HMER] |= hmer_bits; } } static uint32_t pnv_xscom_pcba(PnvChip *chip, uint64_t addr) { addr &= (PNV_XSCOM_SIZE - 1); if (pnv_chip_is_power9(chip)) { return addr >> 3; } else { return ((addr >> 4) & ~0xfull) | ((addr >> 3) & 0xf); } } static uint64_t xscom_read_default(PnvChip *chip, uint32_t pcba) { switch (pcba) { case 0xf000f: return PNV_CHIP_GET_CLASS(chip)->chip_cfam_id; case 0x18002: /* ECID2 */ return 0; case P9_PBA_BAR0: return PNV9_HOMER_BASE(chip); case P8_PBA_BAR0: return PNV_HOMER_BASE(chip); case P9_PBA_BARMASK0: /* P9 homer region size */ return PNV9_HOMER_SIZE; case P8_PBA_BARMASK0: /* P8 homer region size */ return PNV_HOMER_SIZE; case P9_PBA_BAR2: /* P9 occ common area */ return PNV9_OCC_COMMON_AREA(chip); case P8_PBA_BAR2: /* P8 occ common area */ return PNV_OCC_COMMON_AREA(chip); case P9_PBA_BARMASK2: /* P9 occ common area size */ return PNV9_OCC_COMMON_AREA_SIZE; case P8_PBA_BARMASK2: /* P8 occ common area size */ return PNV_OCC_COMMON_AREA_SIZE; case 0x1010c00: /* PIBAM FIR */ case 0x1010c03: /* PIBAM FIR MASK */ /* PRD registers */ case PRD_P8_IPOLL_REG_MASK: case PRD_P8_IPOLL_REG_STATUS: case PRD_P9_IPOLL_REG_MASK: case PRD_P9_IPOLL_REG_STATUS: /* P9 xscom reset */ case 0x0090018: /* Receive status reg */ case 0x0090012: /* log register */ case 0x0090013: /* error register */ /* P8 xscom reset */ case 0x2020007: /* ADU stuff, log register */ case 0x2020009: /* ADU stuff, error register */ case 0x202000f: /* ADU stuff, receive status register*/ return 0; case 0x2013f01: /* PBA stuff */ case 0x2013f03: /* PBA stuff */ case 0x2013f05: /* PBA stuff */ case 0x2013f07: /* PBA stuff */ return 0; case 0x2013028: /* CAPP stuff */ case 0x201302a: /* CAPP stuff */ case 0x2013801: /* CAPP stuff */ case 0x2013802: /* CAPP stuff */ /* P9 CAPP regs */ case 0x2010841: case 0x2010842: case 0x201082a: case 0x2010828: case 0x4010841: case 0x4010842: case 0x401082a: case 0x4010828: return 0; default: return -1; } } static bool xscom_write_default(PnvChip *chip, uint32_t pcba, uint64_t val) { /* We ignore writes to these */ switch (pcba) { case 0xf000f: /* chip id is RO */ case 0x1010c00: /* PIBAM FIR */ case 0x1010c01: /* PIBAM FIR */ case 0x1010c02: /* PIBAM FIR */ case 0x1010c03: /* PIBAM FIR MASK */ case 0x1010c04: /* PIBAM FIR MASK */ case 0x1010c05: /* PIBAM FIR MASK */ /* P9 xscom reset */ case 0x0090018: /* Receive status reg */ case 0x0090012: /* log register */ case 0x0090013: /* error register */ /* P8 xscom reset */ case 0x2020007: /* ADU stuff, log register */ case 0x2020009: /* ADU stuff, error register */ case 0x202000f: /* ADU stuff, receive status register*/ case 0x2013028: /* CAPP stuff */ case 0x201302a: /* CAPP stuff */ case 0x2013801: /* CAPP stuff */ case 0x2013802: /* CAPP stuff */ /* P9 CAPP regs */ case 0x2010841: case 0x2010842: case 0x201082a: case 0x2010828: case 0x4010841: case 0x4010842: case 0x401082a: case 0x4010828: /* P8 PRD registers */ case PRD_P8_IPOLL_REG_MASK: case PRD_P8_IPOLL_REG_STATUS: case PRD_P9_IPOLL_REG_MASK: case PRD_P9_IPOLL_REG_STATUS: return true; default: return false; } } static uint64_t xscom_read(void *opaque, hwaddr addr, unsigned width) { PnvChip *chip = opaque; uint32_t pcba = pnv_xscom_pcba(chip, addr); uint64_t val = 0; MemTxResult result; /* Handle some SCOMs here before dispatch */ val = xscom_read_default(chip, pcba); if (val != -1) { goto complete; } val = address_space_ldq(&chip->xscom_as, (uint64_t) pcba << 3, MEMTXATTRS_UNSPECIFIED, &result); if (result != MEMTX_OK) { qemu_log_mask(LOG_GUEST_ERROR, "XSCOM read failed at @0x%" HWADDR_PRIx " pcba=0x%08x\n", addr, pcba); xscom_complete(current_cpu, HMER_XSCOM_FAIL | HMER_XSCOM_DONE); return 0; } complete: xscom_complete(current_cpu, HMER_XSCOM_DONE); return val; } static void xscom_write(void *opaque, hwaddr addr, uint64_t val, unsigned width) { PnvChip *chip = opaque; uint32_t pcba = pnv_xscom_pcba(chip, addr); MemTxResult result; /* Handle some SCOMs here before dispatch */ if (xscom_write_default(chip, pcba, val)) { goto complete; } address_space_stq(&chip->xscom_as, (uint64_t) pcba << 3, val, MEMTXATTRS_UNSPECIFIED, &result); if (result != MEMTX_OK) { qemu_log_mask(LOG_GUEST_ERROR, "XSCOM write failed at @0x%" HWADDR_PRIx " pcba=0x%08x data=0x%" PRIx64 "\n", addr, pcba, val); xscom_complete(current_cpu, HMER_XSCOM_FAIL | HMER_XSCOM_DONE); return; } complete: xscom_complete(current_cpu, HMER_XSCOM_DONE); } const MemoryRegionOps pnv_xscom_ops = { .read = xscom_read, .write = xscom_write, .valid.min_access_size = 8, .valid.max_access_size = 8, .impl.min_access_size = 8, .impl.max_access_size = 8, .endianness = DEVICE_BIG_ENDIAN, }; void pnv_xscom_realize(PnvChip *chip, uint64_t size, Error **errp) { SysBusDevice *sbd = SYS_BUS_DEVICE(chip); char *name; name = g_strdup_printf("xscom-%x", chip->chip_id); memory_region_init_io(&chip->xscom_mmio, OBJECT(chip), &pnv_xscom_ops, chip, name, size); sysbus_init_mmio(sbd, &chip->xscom_mmio); memory_region_init(&chip->xscom, OBJECT(chip), name, size); address_space_init(&chip->xscom_as, &chip->xscom, name); g_free(name); } static const TypeInfo pnv_xscom_interface_info = { .name = TYPE_PNV_XSCOM_INTERFACE, .parent = TYPE_INTERFACE, .class_size = sizeof(PnvXScomInterfaceClass), }; static void pnv_xscom_register_types(void) { type_register_static(&pnv_xscom_interface_info); } type_init(pnv_xscom_register_types) typedef struct ForeachPopulateArgs { void *fdt; int xscom_offset; } ForeachPopulateArgs; static int xscom_dt_child(Object *child, void *opaque) { if (object_dynamic_cast(child, TYPE_PNV_XSCOM_INTERFACE)) { ForeachPopulateArgs *args = opaque; PnvXScomInterface *xd = PNV_XSCOM_INTERFACE(child); PnvXScomInterfaceClass *xc = PNV_XSCOM_INTERFACE_GET_CLASS(xd); if (xc->dt_xscom) { _FDT((xc->dt_xscom(xd, args->fdt, args->xscom_offset))); } } return 0; } static const char compat_p8[] = "ibm,power8-xscom\0ibm,xscom"; static const char compat_p9[] = "ibm,power9-xscom\0ibm,xscom"; int pnv_dt_xscom(PnvChip *chip, void *fdt, int root_offset) { uint64_t reg[2]; int xscom_offset; ForeachPopulateArgs args; char *name; if (pnv_chip_is_power9(chip)) { reg[0] = cpu_to_be64(PNV9_XSCOM_BASE(chip)); reg[1] = cpu_to_be64(PNV9_XSCOM_SIZE); } else { reg[0] = cpu_to_be64(PNV_XSCOM_BASE(chip)); reg[1] = cpu_to_be64(PNV_XSCOM_SIZE); } name = g_strdup_printf("xscom@%" PRIx64, be64_to_cpu(reg[0])); xscom_offset = fdt_add_subnode(fdt, root_offset, name); _FDT(xscom_offset); g_free(name); _FDT((fdt_setprop_cell(fdt, xscom_offset, "ibm,chip-id", chip->chip_id))); _FDT((fdt_setprop_cell(fdt, xscom_offset, "#address-cells", 1))); _FDT((fdt_setprop_cell(fdt, xscom_offset, "#size-cells", 1))); _FDT((fdt_setprop(fdt, xscom_offset, "reg", reg, sizeof(reg)))); if (pnv_chip_is_power9(chip)) { _FDT((fdt_setprop(fdt, xscom_offset, "compatible", compat_p9, sizeof(compat_p9)))); } else { _FDT((fdt_setprop(fdt, xscom_offset, "compatible", compat_p8, sizeof(compat_p8)))); } _FDT((fdt_setprop(fdt, xscom_offset, "scom-controller", NULL, 0))); args.fdt = fdt; args.xscom_offset = xscom_offset; object_child_foreach(OBJECT(chip), xscom_dt_child, &args); return 0; } void pnv_xscom_add_subregion(PnvChip *chip, hwaddr offset, MemoryRegion *mr) { memory_region_add_subregion(&chip->xscom, offset << 3, mr); } void pnv_xscom_region_init(MemoryRegion *mr, struct Object *owner, const MemoryRegionOps *ops, void *opaque, const char *name, uint64_t size) { memory_region_init_io(mr, owner, ops, opaque, name, size << 3); }
{ "pile_set_name": "Github" }
""" Copyright (c) 2020 Intel Corporation Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. """ import cv2 import logging as log import numpy as np import os import sys class IEModel: """Class for inference of models in the Inference Engine format""" def __init__(self, ie, model_path, labels_file, conf=.6, device='CPU', ext_path=''): self.confidence = conf self.load_ie_model(ie, model_path, device, ext_path) with open(labels_file, 'r') as f: self.labels = f.readlines() self.labels = {num: name.replace('\n', '') for num, name in enumerate(self.labels)} self.classes_to_hide = self.set_classes_to_hide() self.labels_to_hide = [num for num, name in self.labels.items() if name in self.classes_to_hide] @staticmethod def set_classes_to_hide(): return ('person', ) def _preprocess(self, img): _, _, h, w = self.get_input_shape() img = np.expand_dims(cv2.resize(img, (w, h)).transpose(2, 0, 1), axis=0) return img def forward(self, img): """Performs forward pass of the wrapped IE model""" res = self.net.infer(inputs={self.input_key: self._preprocess(img)}) return res[self.output_key] def get_detections(self, input): raise NotImplementedError def get_input_shape(self): """Returns an input shape of the wrapped IE model""" return self.inputs_info[self.input_key].input_data.shape def get_allowed_inputs_len(self): return (1, ) def get_allowed_outputs_len(self): return (1, ) def load_ie_model(self, ie, model_xml, device, cpu_extension=''): """Loads a model in the Inference Engine format""" model_bin = os.path.splitext(model_xml)[0] + ".bin" # Plugin initialization for specified device and load extensions library if specified log.info("Initializing Inference Engine plugin for %s ", device) if cpu_extension and 'CPU' in device: ie.add_extension(cpu_extension, 'CPU') # Read IR log.info("Loading network files:\n\t%s\n\t%s", model_xml, model_bin) net = ie.read_network(model=model_xml, weights=model_bin) if "CPU" in device: supported_layers = ie.query_network(net, "CPU") not_supported_layers = [l for l in net.layers.keys() if l not in supported_layers] if not_supported_layers: log.error("Following layers are not supported by the plugin for specified device %s:\n %s", device, ', '.join(not_supported_layers)) log.error("Please try to specify cpu extensions library path in sample's command line parameters using -l " "or --cpu_extension command line argument") sys.exit(1) assert len(net.input_info) in self.get_allowed_inputs_len(), \ "Supports topologies with only {} inputs, but got {}" \ .format(self.get_allowed_inputs_len(), len(net.input_info)) assert len(net.outputs) in self.get_allowed_outputs_len(), \ "Supports topologies with only {} outputs, but got {}" \ .format(self.get_allowed_outputs_len(), len(net.outputs)) log.info("Preparing input blobs") input_blob = next(iter(net.input_info)) out_blob = next(iter(net.outputs)) net.batch_size = 1 # Loading model to the plugin log.info("Loading model to the plugin") self.net = ie.load_network(network=net, device_name=device) self.inputs_info = net.input_info self.input_key = input_blob self.output_key = out_blob
{ "pile_set_name": "Github" }
'use strict'; module.exports.definition = { set: function (v) { this._setProperty('fill-opacity', v); }, get: function () { return this.getPropertyValue('fill-opacity'); }, enumerable: true, configurable: true };
{ "pile_set_name": "Github" }
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <html xmlns="http://www.w3.org/1999/xhtml"> <head> <meta http-equiv="X-UA-Compatible" content="IE=Edge" /> <meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> <title>Search &#8212; git-pylint-commit-hook 2.0.0 documentation</title> <link rel="stylesheet" href="_static/classic.css" type="text/css" /> <link rel="stylesheet" href="_static/pygments.css" type="text/css" /> <script type="text/javascript" id="documentation_options" data-url_root="./" src="_static/documentation_options.js"></script> <script type="text/javascript" src="_static/jquery.js"></script> <script type="text/javascript" src="_static/underscore.js"></script> <script type="text/javascript" src="_static/doctools.js"></script> <script async="async" type="text/javascript" src="https://cdnjs.cloudflare.com/ajax/libs/mathjax/2.7.1/MathJax.js?config=TeX-AMS-MML_HTMLorMML"></script> <script type="text/javascript" src="_static/searchtools.js"></script> <link rel="index" title="Index" href="genindex.html" /> <link rel="search" title="Search" href="#" /> <script type="text/javascript"> jQuery(function() { Search.loadIndex("searchindex.js"); }); </script> <script type="text/javascript" id="searchindexloader"></script> </head><body> <div class="related" role="navigation" aria-label="related navigation"> <h3>Navigation</h3> <ul> <li class="right" style="margin-right: 10px"> <a href="genindex.html" title="General Index" accesskey="I">index</a></li> <li class="nav-item nav-item-0"><a href="index.html">git-pylint-commit-hook 2.0.0 documentation</a> &#187;</li> </ul> </div> <div class="document"> <div class="documentwrapper"> <div class="bodywrapper"> <div class="body" role="main"> <h1 id="search-documentation">Search</h1> <div id="fallback" class="admonition warning"> <script type="text/javascript">$('#fallback').hide();</script> <p> Please activate JavaScript to enable the search functionality. </p> </div> <p> From here you can search these documents. Enter your search words into the box below and click "search". Note that the search function will automatically search for all of the words. Pages containing fewer words won't appear in the result list. </p> <form action="" method="get"> <input type="text" name="q" value="" /> <input type="submit" value="search" /> <span id="search-progress" style="padding-left: 10px"></span> </form> <div id="search-results"> </div> </div> </div> </div> <div class="sphinxsidebar" role="navigation" aria-label="main navigation"> <div class="sphinxsidebarwrapper"> </div> </div> <div class="clearer"></div> </div> <div class="related" role="navigation" aria-label="related navigation"> <h3>Navigation</h3> <ul> <li class="right" style="margin-right: 10px"> <a href="genindex.html" title="General Index" >index</a></li> <li class="nav-item nav-item-0"><a href="index.html">git-pylint-commit-hook 2.0.0 documentation</a> &#187;</li> </ul> </div> <div class="footer" role="contentinfo"> &#169; Copyright 2013, Sebastian Dahlgren. Created using <a href="http://sphinx-doc.org/">Sphinx</a> 1.8.1. </div> </body> </html>
{ "pile_set_name": "Github" }
// Copyright (c) 2019, the Dart project authors. Please see the AUTHORS file // for details. All rights reserved. Use of this source code is governed by a // BSD-style license that can be found in the LICENSE file. import 'package:analyzer_plugin/protocol/protocol_common.dart'; import 'package:analyzer_plugin/utilities/change_builder/change_builder_core.dart'; import 'package:test/test.dart'; import '../../../../support/abstract_context.dart'; mixin DartChangeBuilderMixin implements AbstractContextTest { SourceEdit getEdit(ChangeBuilder builder) { var edits = getEdits(builder); expect(edits, hasLength(1)); return edits[0]; } List<SourceEdit> getEdits(ChangeBuilder builder) { var sourceChange = builder.sourceChange; expect(sourceChange, isNotNull); var fileEdits = sourceChange.edits; expect(fileEdits, hasLength(1)); var fileEdit = fileEdits[0]; expect(fileEdit, isNotNull); return fileEdit.edits; } /// Return a newly created Dart change builder. ChangeBuilder newBuilder() => ChangeBuilder(session: session); }
{ "pile_set_name": "Github" }
// The MIT License (MIT) // // Copyright (c) 2015, 2019 Arian Fornaris // // 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. package phasereditor.scene.ui.editor.messages; import java.util.List; import org.json.JSONArray; import org.json.JSONObject; import phasereditor.scene.core.ObjectModel; import phasereditor.scene.ui.editor.undo.SingleObjectSnapshotOperation; import phasereditor.webrun.core.ApiMessage; /** * @author arian * */ public class UpdateObjectsMessage extends ApiMessage { private UpdateObjectsMessage(List<JSONObject> snapshot) { var list = new JSONArray(); _data.put("method", "UpdateObjects"); _data.put("objects", list); for (var objData : snapshot) { list.put(objData); } } public static UpdateObjectsMessage createFromModels(List<ObjectModel> models) { return new UpdateObjectsMessage(SingleObjectSnapshotOperation.takeSnapshot(models)); } public static UpdateObjectsMessage createFromSnapshot(List<JSONObject> snapshot) { return new UpdateObjectsMessage(snapshot); } }
{ "pile_set_name": "Github" }
/* * Copyright 2006-2018 the original author or 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 com.consol.citrus.channel; import com.consol.citrus.endpoint.AbstractEndpointBuilder; import com.consol.citrus.message.MessageCorrelator; import org.springframework.integration.core.MessagingTemplate; import org.springframework.messaging.MessageChannel; import org.springframework.messaging.core.DestinationResolver; /** * @author Christoph Deppisch * @since 2.7.6 */ public class ChannelSyncEndpointBuilder extends AbstractEndpointBuilder<ChannelSyncEndpoint> { /** Endpoint target */ private ChannelSyncEndpoint endpoint = new ChannelSyncEndpoint(); @Override protected ChannelSyncEndpoint getEndpoint() { return endpoint; } /** * Sets the channelName property. * @param channelName * @return */ public ChannelSyncEndpointBuilder channel(String channelName) { endpoint.getEndpointConfiguration().setChannelName(channelName); return this; } /** * Sets the channel property. * @param channel * @return */ public ChannelSyncEndpointBuilder channel(MessageChannel channel) { endpoint.getEndpointConfiguration().setChannel(channel); return this; } /** * Sets the messagingTemplate property. * @param messagingTemplate * @return */ public ChannelSyncEndpointBuilder messagingTemplate(MessagingTemplate messagingTemplate) { endpoint.getEndpointConfiguration().setMessagingTemplate(messagingTemplate); return this; } /** * Sets the messageConverter property. * @param messageConverter * @return */ public ChannelSyncEndpointBuilder messageConverter(ChannelMessageConverter messageConverter) { endpoint.getEndpointConfiguration().setMessageConverter(messageConverter); return this; } /** * Sets the channel resolver. * @param resolver * @return */ public ChannelSyncEndpointBuilder channelResolver(DestinationResolver resolver) { endpoint.getEndpointConfiguration().setChannelResolver(resolver); return this; } /** * Sets the useObjectMessages property. * @param useObjectMessages * @return */ public ChannelSyncEndpointBuilder useObjectMessages(boolean useObjectMessages) { endpoint.getEndpointConfiguration().setUseObjectMessages(useObjectMessages); return this; } /** * Sets the polling interval. * @param pollingInterval * @return */ public ChannelSyncEndpointBuilder pollingInterval(int pollingInterval) { endpoint.getEndpointConfiguration().setPollingInterval(pollingInterval); return this; } /** * Sets the message correlator. * @param correlator * @return */ public ChannelSyncEndpointBuilder correlator(MessageCorrelator correlator) { endpoint.getEndpointConfiguration().setCorrelator(correlator); return this; } /** * Sets the default timeout. * @param timeout * @return */ public ChannelSyncEndpointBuilder timeout(long timeout) { endpoint.getEndpointConfiguration().setTimeout(timeout); return this; } }
{ "pile_set_name": "Github" }
/* Copyright 2016 Robert Elder Software Inc. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. */ #include <stdio.h> int foo2(int); int output(int,int,int,int,int,int); int foo2(int i){ return i; } struct mystruct; struct coolstruct; struct coolstruct { int t; int d; int e; int f; int g; int arr[4]; int h; }; struct awesome{ struct coolstruct k; int a; int b; int c; int d; }; struct mystruct { int arr[3]; int j; struct awesome b; struct awesome a; int nn; struct awesome arr2[2][3]; struct awesome c; struct mouse{ int ch; }mou; }; static struct mystruct g; struct mystruct; int output(int k, int j, int a,int b,int c,int d){ putchar(k); putchar(j); putchar(a); putchar(b); putchar(c); putchar(d); return 0; } void output_mystruct(struct mystruct *); void output_mystruct(struct mystruct * p){ putchar(p->arr2[0][0].a); putchar(p->arr2[0][1].b); putchar(p->arr2[0][2].a); putchar(p->arr2[1][0].b); putchar(p->arr2[1][1].a); putchar(p->arr2[1][2].b); putchar((*p).arr2[0][0].a); putchar((*p).arr2[0][1].b); putchar((*p).arr2[0][2].a); putchar((*p).arr2[1][0].b); putchar((*p).arr2[1][1].a); putchar((*p).arr2[1][2].b); } int main(void){ struct mystruct s; struct coolstruct cc; struct coolstruct * pnt; struct mystruct * ppp; struct coolstruct * ttt; struct coolstruct cools[4]; struct mystruct new_s; (void)g; cc.h = '5'; ppp = &s; pnt = &cc; ttt = &s.a.k; ttt->t = 'X'; cools[0].t = 'a'; cools[1].t = 'b'; cools[2].t = 'c'; cools[3].t = 'd'; s.arr2[0][0].a = 'z'; s.arr2[0][1].b = 'x'; s.arr2[0][2].a = 'c'; s.arr2[1][0].b = 'v'; s.arr2[1][1].a = 'b'; s.arr2[1][2].b = 'n'; putchar(s.arr2[0][0].a); putchar(s.arr2[0][1].b); putchar(s.arr2[0][2].a); putchar(s.arr2[1][0].b); putchar(s.arr2[1][1].a); putchar(s.arr2[1][2].b); output_mystruct(&s); { struct mystruct {signed int nee; }; struct mystruct d; s.mou.ch = 'Y'; s.arr[0] = 'x'; s.arr[1] = 'y'; s.a.k.arr[0] = '0'; s.a.k.arr[1] = '1'; s.a.k.arr[2] = '2'; s.a.k.arr[3] = '3'; s.a.k.d = 'd'; s.a.k.e = 'e'; s.a.k.f = 'f'; s.a.k.g = 'g'; s.a.k.h = 'h'; s.a.a = 'D'; s.a.b = '<'; s.a.c = '_'; s.a.d = '3'; s.nn = '5'; s.j = 'L'; d.nee = '3'; putchar(d.nee); } { struct money {int eee;}m; struct mystruct {signed int j; }; struct mystruct d; d.j = '2'; m.eee = '1'; putchar(d.j); putchar(m.eee); } new_s = s; putchar(new_s.mou.ch); putchar(new_s.arr[0]); putchar(new_s.arr[1]); putchar(new_s.j); putchar(new_s.a.a); putchar(new_s.a.b); putchar(new_s.a.c); putchar(new_s.a.d); putchar(new_s.a.k.arr[0]); putchar(new_s.a.k.arr[1]); putchar(new_s.a.k.arr[2]); putchar(new_s.a.k.arr[3]); putchar(s.mou.ch); putchar(s.arr[0]); putchar(s.arr[1]); putchar(s.j); putchar(s.a.a); putchar(s.a.b); putchar(s.a.c); putchar(s.a.d); putchar(s.a.k.arr[0]); putchar(s.a.k.arr[1]); putchar(s.a.k.arr[2]); putchar(s.a.k.arr[3]); putchar(ppp->a.k.arr[3]); putchar(ppp->a.k.d); putchar(ttt->d); putchar(ttt->arr[3]); putchar(s.a.k.d); putchar(s.a.k.e); putchar(s.a.k.f); putchar(s.a.k.g); putchar(s.a.k.h); putchar(pnt->h); putchar(s.a.k.t); putchar(cools[0].t); putchar(cools[1].t); putchar(cools[2].t); putchar(cools[3].t); output('a', foo2('b'), foo2(foo2('a')),foo2(foo2(foo2('b'))),foo2(foo2(foo2('c'))),foo2(foo2(foo2(foo2('d'))))); return 0; }
{ "pile_set_name": "Github" }
<html> <head> <title>max.hpp</title> <link rel="stylesheet" type="text/css" href="../styles.css"> </head> <body> <div style="margin-left: 0px;"> The <b>max.hpp</b> is a jumper header for backwards compatibility.&nbsp; This header is deprecated. </div> <h4>Usage</h4> <div class="code"> #include <b>&lt;boost/preprocessor/max.hpp&gt;</b> </div> <h4>Includes</h4> <ul> <li><a href="selection/max.html">&lt;boost/preprocessor/selection/max.hpp&gt;</a></li> </ul> <hr size="1"> <div style="margin-left: 0px;"> <i>© Copyright <a href="http://www.housemarque.com" target="_top">Housemarque Oy</a> 2002</i> </br><i>© Copyright Paul Mensonides 2002</i> </div> <div style="margin-left: 0px;"> <p><small>Distributed under the Boost Software License, Version 1.0. (See accompanying file <a href="../../../../LICENSE_1_0.txt">LICENSE_1_0.txt</a> or copy at <a href= "http://www.boost.org/LICENSE_1_0.txt">www.boost.org/LICENSE_1_0.txt</a>)</small></p> </div> </body> </html>
{ "pile_set_name": "Github" }
/* * Copyright (c) 2012, Mayocat <[email protected]> * * This Source Code Form is subject to the terms of the Mozilla Public * License, v. 2.0. If a copy of the MPL was not distributed with this * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ package org.mayocat.shop.catalog; import org.mayocat.entity.LoadingOption; /** * @version $Id: 9c4957b1e54d26dcd41ee0920b6c7baa96027120 $ */ public enum ProductLoadingOptions implements LoadingOption { WITH_FEATURE_AND_VARIANTS }
{ "pile_set_name": "Github" }
// SPDX-License-Identifier: GPL-2.0-only /* * Hitachi SCA HD64570 driver for Linux * * Copyright (C) 1998-2003 Krzysztof Halasa <[email protected]> * * Source of information: Hitachi HD64570 SCA User's Manual * * We use the following SCA memory map: * * Packet buffer descriptor rings - starting from winbase or win0base: * rx_ring_buffers * sizeof(pkt_desc) = logical channel #0 RX ring * tx_ring_buffers * sizeof(pkt_desc) = logical channel #0 TX ring * rx_ring_buffers * sizeof(pkt_desc) = logical channel #1 RX ring (if used) * tx_ring_buffers * sizeof(pkt_desc) = logical channel #1 TX ring (if used) * * Packet data buffers - starting from winbase + buff_offset: * rx_ring_buffers * HDLC_MAX_MRU = logical channel #0 RX buffers * tx_ring_buffers * HDLC_MAX_MRU = logical channel #0 TX buffers * rx_ring_buffers * HDLC_MAX_MRU = logical channel #0 RX buffers (if used) * tx_ring_buffers * HDLC_MAX_MRU = logical channel #0 TX buffers (if used) */ #include <linux/bitops.h> #include <linux/errno.h> #include <linux/fcntl.h> #include <linux/hdlc.h> #include <linux/in.h> #include <linux/interrupt.h> #include <linux/ioport.h> #include <linux/jiffies.h> #include <linux/kernel.h> #include <linux/module.h> #include <linux/netdevice.h> #include <linux/skbuff.h> #include <linux/string.h> #include <linux/types.h> #include <asm/io.h> #include <linux/uaccess.h> #include "hd64570.h" #define get_msci(port) (phy_node(port) ? MSCI1_OFFSET : MSCI0_OFFSET) #define get_dmac_rx(port) (phy_node(port) ? DMAC1RX_OFFSET : DMAC0RX_OFFSET) #define get_dmac_tx(port) (phy_node(port) ? DMAC1TX_OFFSET : DMAC0TX_OFFSET) #define SCA_INTR_MSCI(node) (node ? 0x10 : 0x01) #define SCA_INTR_DMAC_RX(node) (node ? 0x20 : 0x02) #define SCA_INTR_DMAC_TX(node) (node ? 0x40 : 0x04) static inline struct net_device *port_to_dev(port_t *port) { return port->dev; } static inline int sca_intr_status(card_t *card) { u8 result = 0; u8 isr0 = sca_in(ISR0, card); u8 isr1 = sca_in(ISR1, card); if (isr1 & 0x03) result |= SCA_INTR_DMAC_RX(0); if (isr1 & 0x0C) result |= SCA_INTR_DMAC_TX(0); if (isr1 & 0x30) result |= SCA_INTR_DMAC_RX(1); if (isr1 & 0xC0) result |= SCA_INTR_DMAC_TX(1); if (isr0 & 0x0F) result |= SCA_INTR_MSCI(0); if (isr0 & 0xF0) result |= SCA_INTR_MSCI(1); if (!(result & SCA_INTR_DMAC_TX(0))) if (sca_in(DSR_TX(0), card) & DSR_EOM) result |= SCA_INTR_DMAC_TX(0); if (!(result & SCA_INTR_DMAC_TX(1))) if (sca_in(DSR_TX(1), card) & DSR_EOM) result |= SCA_INTR_DMAC_TX(1); return result; } static inline port_t* dev_to_port(struct net_device *dev) { return dev_to_hdlc(dev)->priv; } static inline u16 next_desc(port_t *port, u16 desc, int transmit) { return (desc + 1) % (transmit ? port_to_card(port)->tx_ring_buffers : port_to_card(port)->rx_ring_buffers); } static inline u16 desc_abs_number(port_t *port, u16 desc, int transmit) { u16 rx_buffs = port_to_card(port)->rx_ring_buffers; u16 tx_buffs = port_to_card(port)->tx_ring_buffers; desc %= (transmit ? tx_buffs : rx_buffs); // called with "X + 1" etc. return log_node(port) * (rx_buffs + tx_buffs) + transmit * rx_buffs + desc; } static inline u16 desc_offset(port_t *port, u16 desc, int transmit) { /* Descriptor offset always fits in 16 bits */ return desc_abs_number(port, desc, transmit) * sizeof(pkt_desc); } static inline pkt_desc __iomem *desc_address(port_t *port, u16 desc, int transmit) { #ifdef PAGE0_ALWAYS_MAPPED return (pkt_desc __iomem *)(win0base(port_to_card(port)) + desc_offset(port, desc, transmit)); #else return (pkt_desc __iomem *)(winbase(port_to_card(port)) + desc_offset(port, desc, transmit)); #endif } static inline u32 buffer_offset(port_t *port, u16 desc, int transmit) { return port_to_card(port)->buff_offset + desc_abs_number(port, desc, transmit) * (u32)HDLC_MAX_MRU; } static inline void sca_set_carrier(port_t *port) { if (!(sca_in(get_msci(port) + ST3, port_to_card(port)) & ST3_DCD)) { #ifdef DEBUG_LINK printk(KERN_DEBUG "%s: sca_set_carrier on\n", port_to_dev(port)->name); #endif netif_carrier_on(port_to_dev(port)); } else { #ifdef DEBUG_LINK printk(KERN_DEBUG "%s: sca_set_carrier off\n", port_to_dev(port)->name); #endif netif_carrier_off(port_to_dev(port)); } } static void sca_init_port(port_t *port) { card_t *card = port_to_card(port); int transmit, i; port->rxin = 0; port->txin = 0; port->txlast = 0; #ifndef PAGE0_ALWAYS_MAPPED openwin(card, 0); #endif for (transmit = 0; transmit < 2; transmit++) { u16 dmac = transmit ? get_dmac_tx(port) : get_dmac_rx(port); u16 buffs = transmit ? card->tx_ring_buffers : card->rx_ring_buffers; for (i = 0; i < buffs; i++) { pkt_desc __iomem *desc = desc_address(port, i, transmit); u16 chain_off = desc_offset(port, i + 1, transmit); u32 buff_off = buffer_offset(port, i, transmit); writew(chain_off, &desc->cp); writel(buff_off, &desc->bp); writew(0, &desc->len); writeb(0, &desc->stat); } /* DMA disable - to halt state */ sca_out(0, transmit ? DSR_TX(phy_node(port)) : DSR_RX(phy_node(port)), card); /* software ABORT - to initial state */ sca_out(DCR_ABORT, transmit ? DCR_TX(phy_node(port)) : DCR_RX(phy_node(port)), card); /* current desc addr */ sca_out(0, dmac + CPB, card); /* pointer base */ sca_outw(desc_offset(port, 0, transmit), dmac + CDAL, card); if (!transmit) sca_outw(desc_offset(port, buffs - 1, transmit), dmac + EDAL, card); else sca_outw(desc_offset(port, 0, transmit), dmac + EDAL, card); /* clear frame end interrupt counter */ sca_out(DCR_CLEAR_EOF, transmit ? DCR_TX(phy_node(port)) : DCR_RX(phy_node(port)), card); if (!transmit) { /* Receive */ /* set buffer length */ sca_outw(HDLC_MAX_MRU, dmac + BFLL, card); /* Chain mode, Multi-frame */ sca_out(0x14, DMR_RX(phy_node(port)), card); sca_out(DIR_EOME | DIR_BOFE, DIR_RX(phy_node(port)), card); /* DMA enable */ sca_out(DSR_DE, DSR_RX(phy_node(port)), card); } else { /* Transmit */ /* Chain mode, Multi-frame */ sca_out(0x14, DMR_TX(phy_node(port)), card); /* enable underflow interrupts */ sca_out(DIR_BOFE, DIR_TX(phy_node(port)), card); } } sca_set_carrier(port); } #ifdef NEED_SCA_MSCI_INTR /* MSCI interrupt service */ static inline void sca_msci_intr(port_t *port) { u16 msci = get_msci(port); card_t* card = port_to_card(port); u8 stat = sca_in(msci + ST1, card); /* read MSCI ST1 status */ /* Reset MSCI TX underrun and CDCD status bit */ sca_out(stat & (ST1_UDRN | ST1_CDCD), msci + ST1, card); if (stat & ST1_UDRN) { /* TX Underrun error detected */ port_to_dev(port)->stats.tx_errors++; port_to_dev(port)->stats.tx_fifo_errors++; } if (stat & ST1_CDCD) sca_set_carrier(port); } #endif static inline void sca_rx(card_t *card, port_t *port, pkt_desc __iomem *desc, u16 rxin) { struct net_device *dev = port_to_dev(port); struct sk_buff *skb; u16 len; u32 buff; u32 maxlen; u8 page; len = readw(&desc->len); skb = dev_alloc_skb(len); if (!skb) { dev->stats.rx_dropped++; return; } buff = buffer_offset(port, rxin, 0); page = buff / winsize(card); buff = buff % winsize(card); maxlen = winsize(card) - buff; openwin(card, page); if (len > maxlen) { memcpy_fromio(skb->data, winbase(card) + buff, maxlen); openwin(card, page + 1); memcpy_fromio(skb->data + maxlen, winbase(card), len - maxlen); } else memcpy_fromio(skb->data, winbase(card) + buff, len); #ifndef PAGE0_ALWAYS_MAPPED openwin(card, 0); /* select pkt_desc table page back */ #endif skb_put(skb, len); #ifdef DEBUG_PKT printk(KERN_DEBUG "%s RX(%i):", dev->name, skb->len); debug_frame(skb); #endif dev->stats.rx_packets++; dev->stats.rx_bytes += skb->len; skb->protocol = hdlc_type_trans(skb, dev); netif_rx(skb); } /* Receive DMA interrupt service */ static inline void sca_rx_intr(port_t *port) { struct net_device *dev = port_to_dev(port); u16 dmac = get_dmac_rx(port); card_t *card = port_to_card(port); u8 stat = sca_in(DSR_RX(phy_node(port)), card); /* read DMA Status */ /* Reset DSR status bits */ sca_out((stat & (DSR_EOT | DSR_EOM | DSR_BOF | DSR_COF)) | DSR_DWE, DSR_RX(phy_node(port)), card); if (stat & DSR_BOF) /* Dropped one or more frames */ dev->stats.rx_over_errors++; while (1) { u32 desc_off = desc_offset(port, port->rxin, 0); pkt_desc __iomem *desc; u32 cda = sca_inw(dmac + CDAL, card); if ((cda >= desc_off) && (cda < desc_off + sizeof(pkt_desc))) break; /* No frame received */ desc = desc_address(port, port->rxin, 0); stat = readb(&desc->stat); if (!(stat & ST_RX_EOM)) port->rxpart = 1; /* partial frame received */ else if ((stat & ST_ERROR_MASK) || port->rxpart) { dev->stats.rx_errors++; if (stat & ST_RX_OVERRUN) dev->stats.rx_fifo_errors++; else if ((stat & (ST_RX_SHORT | ST_RX_ABORT | ST_RX_RESBIT)) || port->rxpart) dev->stats.rx_frame_errors++; else if (stat & ST_RX_CRC) dev->stats.rx_crc_errors++; if (stat & ST_RX_EOM) port->rxpart = 0; /* received last fragment */ } else sca_rx(card, port, desc, port->rxin); /* Set new error descriptor address */ sca_outw(desc_off, dmac + EDAL, card); port->rxin = next_desc(port, port->rxin, 0); } /* make sure RX DMA is enabled */ sca_out(DSR_DE, DSR_RX(phy_node(port)), card); } /* Transmit DMA interrupt service */ static inline void sca_tx_intr(port_t *port) { struct net_device *dev = port_to_dev(port); u16 dmac = get_dmac_tx(port); card_t* card = port_to_card(port); u8 stat; spin_lock(&port->lock); stat = sca_in(DSR_TX(phy_node(port)), card); /* read DMA Status */ /* Reset DSR status bits */ sca_out((stat & (DSR_EOT | DSR_EOM | DSR_BOF | DSR_COF)) | DSR_DWE, DSR_TX(phy_node(port)), card); while (1) { pkt_desc __iomem *desc; u32 desc_off = desc_offset(port, port->txlast, 1); u32 cda = sca_inw(dmac + CDAL, card); if ((cda >= desc_off) && (cda < desc_off + sizeof(pkt_desc))) break; /* Transmitter is/will_be sending this frame */ desc = desc_address(port, port->txlast, 1); dev->stats.tx_packets++; dev->stats.tx_bytes += readw(&desc->len); writeb(0, &desc->stat); /* Free descriptor */ port->txlast = next_desc(port, port->txlast, 1); } netif_wake_queue(dev); spin_unlock(&port->lock); } static irqreturn_t sca_intr(int irq, void* dev_id) { card_t *card = dev_id; int i; u8 stat; int handled = 0; u8 page = sca_get_page(card); while((stat = sca_intr_status(card)) != 0) { handled = 1; for (i = 0; i < 2; i++) { port_t *port = get_port(card, i); if (port) { if (stat & SCA_INTR_MSCI(i)) sca_msci_intr(port); if (stat & SCA_INTR_DMAC_RX(i)) sca_rx_intr(port); if (stat & SCA_INTR_DMAC_TX(i)) sca_tx_intr(port); } } } openwin(card, page); /* Restore original page */ return IRQ_RETVAL(handled); } static void sca_set_port(port_t *port) { card_t* card = port_to_card(port); u16 msci = get_msci(port); u8 md2 = sca_in(msci + MD2, card); unsigned int tmc, br = 10, brv = 1024; if (port->settings.clock_rate > 0) { /* Try lower br for better accuracy*/ do { br--; brv >>= 1; /* brv = 2^9 = 512 max in specs */ /* Baud Rate = CLOCK_BASE / TMC / 2^BR */ tmc = CLOCK_BASE / brv / port->settings.clock_rate; }while (br > 1 && tmc <= 128); if (tmc < 1) { tmc = 1; br = 0; /* For baud=CLOCK_BASE we use tmc=1 br=0 */ brv = 1; } else if (tmc > 255) tmc = 256; /* tmc=0 means 256 - low baud rates */ port->settings.clock_rate = CLOCK_BASE / brv / tmc; } else { br = 9; /* Minimum clock rate */ tmc = 256; /* 8bit = 0 */ port->settings.clock_rate = CLOCK_BASE / (256 * 512); } port->rxs = (port->rxs & ~CLK_BRG_MASK) | br; port->txs = (port->txs & ~CLK_BRG_MASK) | br; port->tmc = tmc; /* baud divisor - time constant*/ sca_out(port->tmc, msci + TMC, card); /* Set BRG bits */ sca_out(port->rxs, msci + RXS, card); sca_out(port->txs, msci + TXS, card); if (port->settings.loopback) md2 |= MD2_LOOPBACK; else md2 &= ~MD2_LOOPBACK; sca_out(md2, msci + MD2, card); } static void sca_open(struct net_device *dev) { port_t *port = dev_to_port(dev); card_t* card = port_to_card(port); u16 msci = get_msci(port); u8 md0, md2; switch(port->encoding) { case ENCODING_NRZ: md2 = MD2_NRZ; break; case ENCODING_NRZI: md2 = MD2_NRZI; break; case ENCODING_FM_MARK: md2 = MD2_FM_MARK; break; case ENCODING_FM_SPACE: md2 = MD2_FM_SPACE; break; default: md2 = MD2_MANCHESTER; } if (port->settings.loopback) md2 |= MD2_LOOPBACK; switch(port->parity) { case PARITY_CRC16_PR0: md0 = MD0_HDLC | MD0_CRC_16_0; break; case PARITY_CRC16_PR1: md0 = MD0_HDLC | MD0_CRC_16; break; case PARITY_CRC16_PR0_CCITT: md0 = MD0_HDLC | MD0_CRC_ITU_0; break; case PARITY_CRC16_PR1_CCITT: md0 = MD0_HDLC | MD0_CRC_ITU; break; default: md0 = MD0_HDLC | MD0_CRC_NONE; } sca_out(CMD_RESET, msci + CMD, card); sca_out(md0, msci + MD0, card); sca_out(0x00, msci + MD1, card); /* no address field check */ sca_out(md2, msci + MD2, card); sca_out(0x7E, msci + IDL, card); /* flag character 0x7E */ sca_out(CTL_IDLE, msci + CTL, card); /* Allow at least 8 bytes before requesting RX DMA operation */ /* TX with higher priority and possibly with shorter transfers */ sca_out(0x07, msci + RRC, card); /* +1=RXRDY/DMA activation condition*/ sca_out(0x10, msci + TRC0, card); /* = TXRDY/DMA activation condition*/ sca_out(0x14, msci + TRC1, card); /* +1=TXRDY/DMA deactiv condition */ /* We're using the following interrupts: - TXINT (DMAC completed all transmisions, underrun or DCD change) - all DMA interrupts */ sca_set_carrier(port); /* MSCI TX INT and RX INT A IRQ enable */ sca_out(IE0_TXINT | IE0_RXINTA, msci + IE0, card); sca_out(IE1_UDRN | IE1_CDCD, msci + IE1, card); sca_out(sca_in(IER0, card) | (phy_node(port) ? 0xC0 : 0x0C), IER0, card); /* TXINT and RXINT */ /* enable DMA IRQ */ sca_out(sca_in(IER1, card) | (phy_node(port) ? 0xF0 : 0x0F), IER1, card); sca_out(port->tmc, msci + TMC, card); /* Restore registers */ sca_out(port->rxs, msci + RXS, card); sca_out(port->txs, msci + TXS, card); sca_out(CMD_TX_ENABLE, msci + CMD, card); sca_out(CMD_RX_ENABLE, msci + CMD, card); netif_start_queue(dev); } static void sca_close(struct net_device *dev) { port_t *port = dev_to_port(dev); card_t* card = port_to_card(port); /* reset channel */ sca_out(CMD_RESET, get_msci(port) + CMD, port_to_card(port)); /* disable MSCI interrupts */ sca_out(sca_in(IER0, card) & (phy_node(port) ? 0x0F : 0xF0), IER0, card); /* disable DMA interrupts */ sca_out(sca_in(IER1, card) & (phy_node(port) ? 0x0F : 0xF0), IER1, card); netif_stop_queue(dev); } static int sca_attach(struct net_device *dev, unsigned short encoding, unsigned short parity) { if (encoding != ENCODING_NRZ && encoding != ENCODING_NRZI && encoding != ENCODING_FM_MARK && encoding != ENCODING_FM_SPACE && encoding != ENCODING_MANCHESTER) return -EINVAL; if (parity != PARITY_NONE && parity != PARITY_CRC16_PR0 && parity != PARITY_CRC16_PR1 && parity != PARITY_CRC16_PR0_CCITT && parity != PARITY_CRC16_PR1_CCITT) return -EINVAL; dev_to_port(dev)->encoding = encoding; dev_to_port(dev)->parity = parity; return 0; } #ifdef DEBUG_RINGS static void sca_dump_rings(struct net_device *dev) { port_t *port = dev_to_port(dev); card_t *card = port_to_card(port); u16 cnt; #ifndef PAGE0_ALWAYS_MAPPED u8 page = sca_get_page(card); openwin(card, 0); #endif printk(KERN_DEBUG "RX ring: CDA=%u EDA=%u DSR=%02X in=%u %sactive", sca_inw(get_dmac_rx(port) + CDAL, card), sca_inw(get_dmac_rx(port) + EDAL, card), sca_in(DSR_RX(phy_node(port)), card), port->rxin, sca_in(DSR_RX(phy_node(port)), card) & DSR_DE ? "" : "in"); for (cnt = 0; cnt < port_to_card(port)->rx_ring_buffers; cnt++) pr_cont(" %02X", readb(&(desc_address(port, cnt, 0)->stat))); pr_cont("\n"); printk(KERN_DEBUG "TX ring: CDA=%u EDA=%u DSR=%02X in=%u " "last=%u %sactive", sca_inw(get_dmac_tx(port) + CDAL, card), sca_inw(get_dmac_tx(port) + EDAL, card), sca_in(DSR_TX(phy_node(port)), card), port->txin, port->txlast, sca_in(DSR_TX(phy_node(port)), card) & DSR_DE ? "" : "in"); for (cnt = 0; cnt < port_to_card(port)->tx_ring_buffers; cnt++) pr_cont(" %02X", readb(&(desc_address(port, cnt, 1)->stat))); pr_cont("\n"); printk(KERN_DEBUG "MSCI: MD: %02x %02x %02x, ST: %02x %02x %02x %02x," " FST: %02x CST: %02x %02x\n", sca_in(get_msci(port) + MD0, card), sca_in(get_msci(port) + MD1, card), sca_in(get_msci(port) + MD2, card), sca_in(get_msci(port) + ST0, card), sca_in(get_msci(port) + ST1, card), sca_in(get_msci(port) + ST2, card), sca_in(get_msci(port) + ST3, card), sca_in(get_msci(port) + FST, card), sca_in(get_msci(port) + CST0, card), sca_in(get_msci(port) + CST1, card)); printk(KERN_DEBUG "ISR: %02x %02x %02x\n", sca_in(ISR0, card), sca_in(ISR1, card), sca_in(ISR2, card)); #ifndef PAGE0_ALWAYS_MAPPED openwin(card, page); /* Restore original page */ #endif } #endif /* DEBUG_RINGS */ static netdev_tx_t sca_xmit(struct sk_buff *skb, struct net_device *dev) { port_t *port = dev_to_port(dev); card_t *card = port_to_card(port); pkt_desc __iomem *desc; u32 buff, len; u8 page; u32 maxlen; spin_lock_irq(&port->lock); desc = desc_address(port, port->txin + 1, 1); BUG_ON(readb(&desc->stat)); /* previous xmit should stop queue */ #ifdef DEBUG_PKT printk(KERN_DEBUG "%s TX(%i):", dev->name, skb->len); debug_frame(skb); #endif desc = desc_address(port, port->txin, 1); buff = buffer_offset(port, port->txin, 1); len = skb->len; page = buff / winsize(card); buff = buff % winsize(card); maxlen = winsize(card) - buff; openwin(card, page); if (len > maxlen) { memcpy_toio(winbase(card) + buff, skb->data, maxlen); openwin(card, page + 1); memcpy_toio(winbase(card), skb->data + maxlen, len - maxlen); } else memcpy_toio(winbase(card) + buff, skb->data, len); #ifndef PAGE0_ALWAYS_MAPPED openwin(card, 0); /* select pkt_desc table page back */ #endif writew(len, &desc->len); writeb(ST_TX_EOM, &desc->stat); port->txin = next_desc(port, port->txin, 1); sca_outw(desc_offset(port, port->txin, 1), get_dmac_tx(port) + EDAL, card); sca_out(DSR_DE, DSR_TX(phy_node(port)), card); /* Enable TX DMA */ desc = desc_address(port, port->txin + 1, 1); if (readb(&desc->stat)) /* allow 1 packet gap */ netif_stop_queue(dev); spin_unlock_irq(&port->lock); dev_kfree_skb(skb); return NETDEV_TX_OK; } #ifdef NEED_DETECT_RAM static u32 sca_detect_ram(card_t *card, u8 __iomem *rambase, u32 ramsize) { /* Round RAM size to 32 bits, fill from end to start */ u32 i = ramsize &= ~3; u32 size = winsize(card); openwin(card, (i - 4) / size); /* select last window */ do { i -= 4; if ((i + 4) % size == 0) openwin(card, i / size); writel(i ^ 0x12345678, rambase + i % size); } while (i > 0); for (i = 0; i < ramsize ; i += 4) { if (i % size == 0) openwin(card, i / size); if (readl(rambase + i % size) != (i ^ 0x12345678)) break; } return i; } #endif /* NEED_DETECT_RAM */ static void sca_init(card_t *card, int wait_states) { sca_out(wait_states, WCRL, card); /* Wait Control */ sca_out(wait_states, WCRM, card); sca_out(wait_states, WCRH, card); sca_out(0, DMER, card); /* DMA Master disable */ sca_out(0x03, PCR, card); /* DMA priority */ sca_out(0, DSR_RX(0), card); /* DMA disable - to halt state */ sca_out(0, DSR_TX(0), card); sca_out(0, DSR_RX(1), card); sca_out(0, DSR_TX(1), card); sca_out(DMER_DME, DMER, card); /* DMA Master enable */ }
{ "pile_set_name": "Github" }
import HttpError from '@wasp/core/HttpError.js' import Prisma from '@prisma/client' const prisma = new Prisma.PrismaClient() export const createTask = async (task, context) => { /* if (Math.random() < 0.5) { throw new HttpError(400, 'Failed to create task, random error!') } */ const newTask = await prisma.task.create({ data: { description: task.description } }) } export const updateTaskIsDone = async ({taskId, newIsDoneVal}, context) => { await prisma.task.update({ where: { id: taskId }, data: { isDone: newIsDoneVal } }) }
{ "pile_set_name": "Github" }
<configuration> <configSections> <sectionGroup name="dotNetOpenAuth" type="DotNetOpenAuth.Configuration.DotNetOpenAuthSection, DotNetOpenAuth.Core"> <section name="oauth" type="DotNetOpenAuth.Configuration.OAuthElement, DotNetOpenAuth.OAuth" requirePermission="false" allowLocation="true" /> </sectionGroup> </configSections> </configuration>
{ "pile_set_name": "Github" }
XRE: 'RINET فوندى' CHW: 'WIR فرانكى' CHE: 'WIR ياۋرو' ARA: 'ئارگېنتىنا ئاۋسترالى' ARL: 'ئارگېنتىنا پېسو لېيى (1970–1983)' ARS: 'ئارگېنتىنا پېسوسى' ARM: 'ئارگېنتىنا پېسوسى (1881–1970)' ARP: 'ئارگېنتىنا پېسوسى (1983–1985)' AWG: 'ئارۇبان فىلورۇنى' XAF: 'ئافرىقا قىتئەسى پۇل-مۇئامىلە ئىتتىپاقى فرانكى' XOF: 'ئافرىقا قىتئەسى پۇل-مۇئامىلە ئىتتىپاقى فرانكى (BCEAO)' AFN: 'ئافغان ئافغانى' AFA: 'ئافغان ئافغانى (1927–2002)' ALL: 'ئالبانىيە لېكى' ALK: 'ئالبانىيە لېكى (1946–1965)' DZD: 'ئالجىرىيە دىنارى' USD: 'ئامېرىكا دوللىرى' USS: 'ئامېرىكا دوللىرى (ئوخشاش كۈن)' USN: 'ئامېرىكا دوللىرى (كېيىنكى كۈن)' ADP: 'ئاندورران پېسېتاسى' AOR: 'ئانگولا قايتا تەڭشەلگەن كۇۋانزاسى (1995–1999)' AOA: 'ئانگولا كۇۋانزاسى' AOK: 'ئانگولا كۇۋانزاسى (1977–1991)' AON: 'ئانگولا يېڭى كۇۋانزاسى (1990–2000)' AUD: 'ئاۋسترالىيە دوللىرى' ATS: 'ئاۋسترىيە شىللىڭى' MOP: 'ئاۋمېن پاتاكاسى' OMR: 'ئومان رىيالى' ITL: 'ئىتالىيە لىراسى' IQD: 'ئىراق دىنارى' IRR: 'ئىران رىيالى' IEP: 'ئىرېلاندىيە فوندستېرلىڭى' ILR: 'ئىسرائىل شېكېلى (1980–1985)' ILS: 'ئىسرائىل يېڭى شېكېلى' ILP: 'ئىسرائىلىيە فوندستېرلىڭى' ISK: 'ئىسلاندىيە كروناسى' ISJ: 'ئىسلاندىيە كروناسى (1918–1981)' ESP: 'ئىسپانىيە پېسېتاسى' ESA: 'ئىسپانىيە پېسېتاسى (A ھېسابات)' ESB: 'ئىسپانىيە پېسېتاسى (ئالماشتۇرۇش ھېساباتى)' JOD: 'ئىيوردانىيە دىنارى' UZS: 'ئۆزبېكىستان سومى' UYU: 'ئۇرۇگۋاي پېسوسى' UYP: 'ئۇرۇگۋاي پېسوسى (1975–1993)' UYI: 'ئۇرۇگۋاي پېسوسى (ئىندېكىسلاش بىرلىكى)' UAH: 'ئۇكرائىنا خرىۋناسى' UAK: 'ئۇكرائىنا كاربوۋانېتسى' UGX: 'ئۇگاندا شىللىڭى' UGS: 'ئۇگاندا شىللىڭى (1966–1987)' ERN: 'ئېرىترېيە ناكفاسى' EEK: 'ئېستونىيە كرۇنى' ETB: 'ئېفىيوپىيە بىررى' GQE: 'ئېكۋاتور گىۋىنېيە ئېكۋېلېسى' ECV: 'ئېكۋادور تۇراقلىق قىممەت بىرلىكى' ECS: 'ئېكۋادور سۇكرېسى' AMD: 'ئەرمېنىيە دىرامى' AED: 'ئەرەب بىرلەشمە خەلىپىلىكى دەرھەمى' AZN: 'ئەزەربەيجان ماناتى' AZM: 'ئەزەربەيجان ماناتى (1993–2006)' GBP: 'ئەنگلىيە فوند سىتېرلىڭى' BBD: 'باربادوس دوللىرى' BDT: 'باڭلادىش تاكاسى' BSD: 'باھاما دوللىرى' BWP: 'بوتسۋانا پۇلاسى' BAM: 'بوسنىيە-خېرتسېگوۋىنا ئالماشتۇرۇشچان ماركى' BAD: 'بوسنىيە-خېرتسېگوۋىنا دىنارى (1992–1994)' BAN: 'بوسنىيە-خېرتسېگوۋىنا يېڭى دىنارى (1994–1997)' BOB: 'بولىۋىيە بولىۋىيانوسى' BOL: 'بولىۋىيە بولىۋىيانوسى (1863–1963)' BOV: 'بولىۋىيە مۇدولى' BOP: 'بولىۋىيە پىسوسى' BRL: 'بىرازىلىيە رىيالى' BRC: 'بىرازىلىيە كرۇزادوسى (1986–1989)' BRZ: 'بىرازىلىيە كرۇزېروسى (1942–1967)' BRR: 'بىرازىلىيە كرۇزېروسى (1993–1994)' BRN: 'بىرازىلىيە يېڭى كرۇزادوسى (1989–1990)' BRB: 'بىرازىلىيە يېڭى كرۇزېروسى (1967–1986)' BRE: 'بىرازىلىيە يېڭى كرۇزېروسى (1990–1993)' BUK: 'بىرما كىياتى' BND: 'بىرۇنېي دوللىرى' BTN: 'بۇتان نگۇلترۇمى' BIF: 'بۇرۇندى فرانكى' BGM: 'بۇلغارىيە ئىجتىمائىي لېۋاسى' BGL: 'بۇلغارىيە قاتتىق لېۋاسى' BGN: 'بۇلغارىيە لېۋاسى' BGO: 'بۇلغارىيە لېۋاسى (1879–1952)' BMD: 'بېرمۇدا دوللىرى' BYN: 'بېلارۇسىيە رۇبلىسى' BYR: 'بېلارۇسىيە رۇبلىسى (۲۰۰۰–۲۰۱۶)' BYB: 'بېلارۇسىيە يېڭى رۇبلىسى (1994–1999)' BZD: 'بېلىز دوللىرى' BEF: 'بېلگىيە فرانكى' BEC: 'بېلگىيە فرانكى (ئالماشتۇرۇشچان)' BEL: 'بېلگىيە فرانكى (پۇل–مۇئامىلە)' BHD: 'بەھرەين دىنارى' TJR: 'تاجىكىستان رۇبلىسى' TJS: 'تاجىكىستان سومونىسى' TZS: 'تانزانىيە شىللىڭى' THB: 'تايلاند باختى' TOP: 'تونگا پائانگاسى' TTD: 'تىرىنىداد ۋە توباگو دوللىرى' TPE: 'تىمور ئېسكۇدوسى' XPF: 'تىنچ ئوكيان پۇل-مۇئامىلە ئورتاق گەۋدىسى فرانكى' TND: 'تۇنىس دىنارى' TMT: 'تۈركمەنىستان ماناتى' TMM: 'تۈركمەنىستان ماناتى (1993–2009)' TRY: 'تۈركىيە لىراسى' TRL: 'تۈركىيە لىراسى (1922–2005)' DJF: 'جىبۇتى فرانكى' CNX: 'جۇڭگو خەلق بانكىسى دوللىرى' CNY: 'جۇڭگو يۈەنى' GIP: 'جەبىلتارىق فوند سىتېرلىڭى' ZAR: 'جەنۇبىي ئافرىقا راندى' ZAL: 'جەنۇبىي ئافرىقا راندى (پۇل–مۇئامىلە)' SSP: 'جەنۇبىي سۇدان فوندستېرلىڭى' KRH: 'جەنۇبىي كورېيە خۋانى (1953–1962)' KRW: 'جەنۇبىي كورېيە ۋونى' KRO: 'جەنۇبىي كورېيە ۋونى (1945–1953)' DKK: 'دانىيە كرونى' DOP: 'دومىنىكا پېسوسى' RHD: 'رودېزىيە دوللىرى' RUB: 'رۇسىيە رۇبلىسى' RUR: 'رۇسىيە رۇبلىسى (1991–1998)' RON: 'رۇمىنىيە لېيى' ROL: 'رۇمىنىيە لېيى (1952–2006)' RWF: 'رۋاندا فرانكى' ZMW: 'زامبىيە كۋاچاسى' ZMK: 'زامبىيە كۋاچاسى (1968–2012)' ZRZ: 'زايىر زايىرى (1971–1993)' ZRN: 'زايىر يېڭى زايىرى (1993–1998)' ZWD: 'زىمبابۋې دوللىرى (1980–2008)' ZWR: 'زىمبابۋې دوللىرى (2008)' ZWL: 'زىمبابۋې دوللىرى (2009)' SVC: 'سالۋادور كولونى' WST: 'ساموئا تالاسى' STD: 'سان-تومې ۋە پىرىنسىپى دوبراسى' SHP: 'ساينىت-ھېلېنا فوندستېرلىڭى' SBD: 'سولومون ئاراللىرى دوللىرى' SOS: 'سومالى شىللىڭى' SUR: 'سوۋىت رۇبلىسى' LKR: 'سىرىلانكا رۇپىسى' SKK: 'سىلوۋاكىيە كورۇناسى' SIT: 'سىلوۋېنىيە تولارى' SGD: 'سىنگاپور دوللىرى' CYP: 'سىپرۇس فوند ستېرلىڭى' SZL: 'سىۋېزىلاند لىلانگېنى' SDD: 'سۇدان دىنارى (1992–2007)' SDG: 'سۇدان فوندستېرلىڭى' SDP: 'سۇدان فوندستېرلىڭى (1957–1998)' SRD: 'سۇرىنام دوللىرى' SRG: 'سۇرىنام گۈلدىنى' SYP: 'سۈرىيە فوندستېرلىڭى' RSD: 'سېربىيە دىنارى' CSD: 'سېربىيە دىنارى (2002–2006)' SLL: 'سېررالېئون لېئونېسى' SCR: 'سېيشېل رۇپىسى' SAR: 'سەئۇدى رىيالى' KPW: 'شىمالىي كورېيە ۋونى' CHF: 'شىۋېتسىيە فرانكى' SEK: 'شىۋېتسىيە كروناسى' HKD: 'شياڭگاڭ دوللىرى' XCD: 'شەرقىي كارىب دوللىرى' DDM: 'شەرقىي گېرمانىيە ماركى' FKP: 'فالكلاند ئاراللىرى فوند سىتېرلىڭى' FJD: 'فىجى دوللىرى' XFU: 'فىرانسىيە UIC فرانكى' XFO: 'فىرانسىيە ئالتۇن فرانكى' FRF: 'فىرانسىيە فرانكى' PHP: 'فىلىپپىن پېسوسى' FIM: 'فىنلاندىيە مارككاسى' QAR: 'قاتار رىيالى' KZT: 'قازاقىستان تەڭگىسى' KGS: 'قىرغىزىستان سومى' KHR: 'كامبودژا رىئېلى' CAD: 'كانادا دوللىرى' KYD: 'كايمان ئاراللىرى دوللىرى' CRC: 'كوستارىكا كولونى' COP: 'كولومبىيە پېسوسى' COU: 'كولومبىيە ھەقىقىي قىممەت بىرلىكى' KMF: 'كومورو فرانكى' CDF: 'كونگو فرانكى' HRD: 'كىرودىيە دىنارى' HRK: 'كىرودىيە كۇناسى' CUC: 'كۇبا ئالماشتۇرۇشچان پېسوسى' CUP: 'كۇبا پېسوسى' KWD: 'كۇۋەيت دىنارى' KES: 'كېنىيە شىللىڭى' LAK: 'لائوس كىپى' LVR: 'لاتۋىيە رۇبلىسى' LVL: 'لاتۋىيە لاتى' LRD: 'لىبېرىيە دوللىرى' LTT: 'لىتۋا تالوناسى' LTL: 'لىتۋا لىتاسى' LUL: 'لىيۇكسېمبۇرگ پۇل-مۇئامىلە فرانكى' LBP: 'لىۋان فوند سىتېرلىڭى' LYD: 'لىۋىيە دىنارى' LUC: 'ليۇكسېمبۇرگ ئالماشتۇرۇشچان پېسوسى' LUF: 'ليۇكسېمبۇرگ فرانكى' LSL: 'لېسوتو لوتىسى' MGA: 'ماداغاسقار ئارىئارىسى' MGF: 'ماداغاسقار فرانكى' MAD: 'ماراكەش دىرھەمى' MAF: 'ماراكەش فرانكى' MKD: 'ماكېدونىيە دىنارى' MKN: 'ماكېدونىيە دىنارى (1992–1993)' MYR: 'مالايشىيا رىڭگىتى' MWK: 'مالاۋى كۋاچاسى' MTP: 'مالتا فوندستېرلىڭى' MTL: 'مالتا لىراسى' MVR: 'مالدىۋى رۇفىياسى' MVP: 'مالدىۋى رۇپىسى' MLF: 'مالى فرانكى' MRO: 'ماۋرىتانىيە ئۇگىيەسى' MUR: 'ماۋرىتىئۇس رۇپىسى' MZE: 'موزامبىك ئېسكۇدوسى' MZN: 'موزامبىك مېتىكالى' MZM: 'موزامبىك مېتىكالى (1980–2006)' MDC: 'مولدوۋا كۇپونى' MDL: 'مولدوۋا لېۋى' MCF: 'موناكو فرانكى' MNT: 'موڭغۇلىيە تۈگرىكى' EGP: 'مىسىر فوند سىتېرلىڭى' MMK: 'مىيانمار كىياتى' MXP: 'مېكسىكا كۈمۈش پېسوسى (1861–1992)' MXV: 'مېكسىكا مەبلەغ بىرلىكى' MXN: 'مېكسىكا پېسوسى' NAD: 'نامىبىيە دوللىرى' NOK: 'نورۋېگىيە كرونى' NIO: 'نىگېرىيە كوردوباسى' NIC: 'نىگېرىيە كوردوباسى (1988–1991)' NGN: 'نىگېرىيە نايراسى' NPR: 'نېپال رۇپىسى' JMD: 'يامايكا دوللىرى' JPY: 'ياپونىيە يېنى' EUR: ياۋرو XEU: 'ياۋروپا پۇل بىرلىكى' YUN: 'يۇگوسلاۋىيە ئالماشتۇرۇشچان دىنارى (1990–1992)' YUR: 'يۇگوسلاۋىيە ئىسلاھات دىنارى (1992–1993)' YUD: 'يۇگوسلاۋىيە قاتتىق دىنارى (1966–1990)' YUM: 'يۇگوسلاۋىيە يېڭى دىنارى (1994–2002)' CVE: 'يېشىل تۇمشۇق ئېسكۇدوسى' TWD: 'يېڭى تەيۋەن دوللىرى' NZD: 'يېڭى زېلاندىيە دوللىرى' YDD: 'يەمەن دىنارى' YER: 'يەمەن رىيالى' PYG: 'پاراگۋاي گۇئارانىسى' PKR: 'پاكىستان رۇپىسى' PAB: 'پاناما بالبوئاسى' PGK: 'پاپۇئا يېڭى گىۋىنېيە كىناسى' PTE: 'پورتۇگالىيە ئېسكۇدوسى' GWE: 'پورتۇگالىيە گىۋىنېيە ئېسكۇدوسى' PLN: 'پولشا زىلوتى' PLZ: 'پولشا زىلوتى (1950–1995)' PEI: 'پېرۇ ئىنتىسى' PEN: 'پېرۇ سولى' PES: 'پېرۇ سولى (1863–1965)' CLE: 'چىلى ئېسكۇدوسى' CLP: 'چىلى پېسوسى' CLF: 'چىلى ھېسابات بىرلىكى (UF)' CZK: 'چېخ جۇمھۇرىيىتى كورۇناسى' CSK: 'چېخسىلوۋاكىيە قاتتىق كورۇناسى' GMD: 'گامبىيە دالاسى' GHS: 'گانا سېدىسى' GHC: 'گانا سېدىسى (1979–2007)' NLG: 'گوللاندىيە گۈلدىنى' ANG: 'گوللاندىيەگە قاراشلىق ئانتىللېن گۇلدېنى' GEK: 'گىرۇزىيە كۇپون لارىتى' GEL: 'گىرۇزىيە لارىسى' GRD: 'گىرېتسىيە دراخماسى' GTQ: 'گىۋاتېمالا كۇۋېتزالى' GYD: 'گىۋىئانا دوللىرى' GNS: 'گىۋىنېيە سىلىسى' GNF: 'گىۋىنېيە فرانكى' GWP: 'گىۋىنېيە-بىسسائۇ پېسوسى' DEM: 'گېرمانىيە ماركى' HTG: 'ھايتى گۇردېسى' HNL: 'ھوندۇراس لېمپىراسى' IDR: 'ھىندونېزىيە رۇپىيەسى' INR: 'ھىندىستان رۇپىسى' VUV: 'ۋانۇئاتۇ ۋاتۇسى' VND: 'ۋىيېتنام دوڭى' VNN: 'ۋىيېتنام دوڭى (1978–1985)' HUF: 'ۋېنگىرىيە فورېنتى' VEF: 'ۋېنېزۇئېلا بولىۋارى' VEB: 'ۋېنېزۇئېلا بولىۋارى (1871–2008)'
{ "pile_set_name": "Github" }
fileFormatVersion: 2 guid: 8d0df38d86d7c874a89399f2e9e2156a timeCreated: 1464946247 licenseType: Store NativeFormatImporter: userData: assetBundleName: assetBundleVariant:
{ "pile_set_name": "Github" }
// Copyright (C) 2011 Davis E. King ([email protected]) // License: Boost Software License See LICENSE.txt for the full license. #ifndef DLIB_DISJOINT_SUBsETS_Hh_ #define DLIB_DISJOINT_SUBsETS_Hh_ #include "disjoint_subsets_abstract.h" #include <vector> #include "../algs.h" namespace dlib { // ---------------------------------------------------------------------------------------- class disjoint_subsets { public: void clear ( ) { items.clear(); } void set_size ( unsigned long new_size ) { items.resize(new_size); for (unsigned long i = 0; i < items.size(); ++i) { items[i].parent = i; items[i].rank = 0; } } unsigned long size ( ) const { return items.size(); } unsigned long find_set ( unsigned long item ) const { // make sure requires clause is not broken DLIB_ASSERT(item < size(), "\t unsigned long disjoint_subsets::find_set()" << "\n\t item must be less than size()" << "\n\t item: " << item << "\n\t size(): " << size() << "\n\t this: " << this ); if (items[item].parent == item) { return item; } else { // find root of item unsigned long x = item; do { x = items[x].parent; } while (items[x].parent != x); // do path compression const unsigned long root = x; x = item; while (items[x].parent != x) { const unsigned long prev = x; x = items[x].parent; items[prev].parent = root; } return root; } } unsigned long merge_sets ( unsigned long a, unsigned long b ) { // make sure requires clause is not broken DLIB_ASSERT(a != b && a < size() && b < size() && find_set(a) == a && find_set(b) == b, "\t unsigned long disjoint_subsets::merge_sets(a,b)" << "\n\t invalid arguments were given to this function" << "\n\t a: " << a << "\n\t b: " << b << "\n\t size(): " << size() << "\n\t find_set(a): " << find_set(a) << "\n\t find_set(b): " << find_set(b) << "\n\t this: " << this ); if (items[a].rank > items[b].rank) { items[b].parent = a; return a; } else { items[a].parent = b; if (items[a].rank == items[b].rank) { items[b].rank = items[b].rank + 1; } return b; } } private: /* See the book Introduction to Algorithms by Cormen, Leiserson, Rivest and Stein for a discussion of how this algorithm works. */ struct data { unsigned long rank; unsigned long parent; }; mutable std::vector<data> items; }; // ---------------------------------------------------------------------------------------- } #endif // DLIB_DISJOINT_SUBsETS_Hh_
{ "pile_set_name": "Github" }
package be.digitalia.fosdem.fragments import android.view.View import android.widget.TextView import androidx.core.view.isVisible import androidx.recyclerview.widget.RecyclerView import be.digitalia.fosdem.widgets.ContentLoadingViewMediator class RecyclerViewViewHolder(view: View) { val recyclerView: RecyclerView = view.findViewById(android.R.id.list) private val emptyView: View = view.findViewById(android.R.id.empty) private val progress = ContentLoadingViewMediator(view.findViewById(android.R.id.progress)) private val emptyObserver: RecyclerView.AdapterDataObserver = object : RecyclerView.AdapterDataObserver() { override fun onChanged() { updateEmptyViewVisibility() } override fun onItemRangeInserted(positionStart: Int, itemCount: Int) { updateEmptyViewVisibility() } override fun onItemRangeRemoved(positionStart: Int, itemCount: Int) { updateEmptyViewVisibility() } } init { recyclerView.setHasFixedSize(true) progress.isVisible = false } /** * Call this method to set the RecyclerView's adapter while ensuring the empty view * will show or hide automatically according to the adapter's empty state. */ fun setAdapter(adapter: RecyclerView.Adapter<*>?) { val oldAdapter = recyclerView.adapter if (oldAdapter === adapter) { return } oldAdapter?.unregisterAdapterDataObserver(emptyObserver) recyclerView.adapter = adapter adapter?.registerAdapterDataObserver(emptyObserver) updateEmptyViewVisibility() } /** * The default content for a RecyclerViewFragment has a TextView that can be shown when the list is empty. * Call this method to supply the text it should use. */ var emptyText: CharSequence? get() = (emptyView as? TextView)?.text set(value) { (emptyView as? TextView)?.text = value } private fun updateEmptyViewVisibility() { emptyView.isVisible = !isProgressBarVisible && recyclerView.adapter?.itemCount == 0 } /** * Set this field to show or hide the indeterminate progress bar. * When shown, the RecyclerView will be hidden.The initial value is false. */ var isProgressBarVisible: Boolean = false set(visible) { if (field != visible) { field = visible recyclerView.isVisible = !visible progress.isVisible = visible updateEmptyViewVisibility() } } }
{ "pile_set_name": "Github" }
#include <i2c-modules> i2c-mv64xxx i2c-rk3x
{ "pile_set_name": "Github" }
package ONVIF::Device::Types::OSDTextConfigurationExtension; use strict; use warnings; __PACKAGE__->_set_element_form_qualified(1); sub get_xmlns { 'http://www.onvif.org/ver10/schema' }; our $XML_ATTRIBUTE_CLASS; undef $XML_ATTRIBUTE_CLASS; sub __get_attr_class { return $XML_ATTRIBUTE_CLASS; } use Class::Std::Fast::Storable constructor => 'none'; use base qw(SOAP::WSDL::XSD::Typelib::ComplexType); Class::Std::initialize(); { # BLOCK to scope variables __PACKAGE__->_factory( [ qw( ) ], { }, { }, { } ); } # end BLOCK 1; =pod =head1 NAME ONVIF::Device::Types::OSDTextConfigurationExtension =head1 DESCRIPTION Perl data type class for the XML Schema defined complexType OSDTextConfigurationExtension from the namespace http://www.onvif.org/ver10/schema. =head2 PROPERTIES The following properties may be accessed using get_PROPERTY / set_PROPERTY methods: =over =back =head1 METHODS =head2 new Constructor. The following data structure may be passed to new(): { # ONVIF::Device::Types::OSDTextConfigurationExtension }, =head1 AUTHOR Generated by SOAP::WSDL =cut
{ "pile_set_name": "Github" }
/****************************************************************************************** * Copyright 2015, 2016 Ideetron B.V. * * This program 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 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 Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public License * along with this program. If not, see <http://www.gnu.org/licenses/>. ******************************************************************************************/ /****************************************************************************************** * * File: AES-128_V10.h * Author: Gerben den Hartog * Compagny: Ideetron B.V. * Website: http://www.ideetron.nl/LoRa * E-mail: [email protected] ******************************************************************************************/ /**************************************************************************************** * * Created on: 20-10-2015 * Supported Hardware: ID150119-02 Nexus board with RFM95 * * Firmware Version 1.0 * First version ****************************************************************************************/ #ifndef AES128_V10_H #define AES128_V10_H /* ******************************************************************************************** * FUNCTION PORTOTYPES ******************************************************************************************** */ void AES_Encrypt(unsigned char *Data, unsigned char *Key); void AES_Add_Round_Key(unsigned char *Round_Key); unsigned char AES_Sub_Byte(unsigned char Byte); void AES_Shift_Rows(); void AES_Mix_Collums(); void AES_Calculate_Round_Key(unsigned char Round, unsigned char *Round_Key); void Send_State(); #endif
{ "pile_set_name": "Github" }
/** * jQuery Yii GridView plugin file. * * @author Qiang Xue <[email protected]> * @link http://www.yiiframework.com/ * @copyright Copyright &copy; 2008-2010 Yii Software LLC * @license http://www.yiiframework.com/license/ * @version $Id: jquery.yiigridview.js 3286 2011-06-16 17:34:34Z qiang.xue $ */ ;(function($) { /** * yiiGridView set function. * @param options map settings for the grid view. Availablel options are as follows: * - ajaxUpdate: array, IDs of the containers whose content may be updated by ajax response * - ajaxVar: string, the name of the GET variable indicating the ID of the element triggering the AJAX request * - pagerClass: string, the CSS class for the pager container * - tableClass: string, the CSS class for the table * - selectableRows: integer, the number of rows that can be selected * - updateSelector: string, the selector for choosing which elements can trigger ajax requests * - beforeAjaxUpdate: function, the function to be called before ajax request is sent * - afterAjaxUpdate: function, the function to be called after ajax response is received * - ajaxUpdateError: function, the function to be called if an ajax error occurs * - selectionChanged: function, the function to be called after the row selection is changed */ $.fn.yiiGridView = function(options) { return this.each(function(){ var settings = $.extend({}, $.fn.yiiGridView.defaults, options || {}); var $this = $(this); var id = $this.attr('id'); if(settings.updateSelector === undefined) settings.updateSelector = '#'+id+' .'+settings.pagerClass.replace(/\s+/g,'.')+' a, #'+id+' .'+settings.tableClass.replace(/\s+/g,'.')+' thead th a'; $.fn.yiiGridView.settings[id] = settings; if(settings.ajaxUpdate.length > 0) { $(settings.updateSelector).die('click').live('click',function(){ $.fn.yiiGridView.update(id, {url: $(this).attr('href')}); return false; }); } var inputSelector='#'+id+' .'+settings.filterClass+' input, '+'#'+id+' .'+settings.filterClass+' select'; $('body').undelegate(inputSelector, 'change').delegate(inputSelector, 'change', function(){ var data = $(inputSelector).serialize(); if(settings.pageVar!==undefined) data += '&'+settings.pageVar+'=1'; $.fn.yiiGridView.update(id, {data: data}); }); $.fn.yiiGridView.selectCheckedRows(id); if(settings.selectableRows > 0) { $('#'+id+' .'+settings.tableClass+' > tbody > tr').die('click').live('click',function(e){ if('checkbox'!=e.target.type){ if(settings.selectableRows == 1) $(this).siblings().removeClass('selected'); var isRowSelected=$(this).toggleClass('selected').hasClass('selected'); $('input.select-on-check',this).each(function(){ if(settings.selectableRows == 1) $("input[name='"+this.name+"']").attr('checked',false); this.checked=isRowSelected; var sboxallname=this.name.substring(0,this.name.length-2)+'_all'; //.. remove '[]' and add '_all' $("input[name='"+sboxallname+"']").attr('checked', $("input[name='"+this.name+"']").length==$("input[name='"+this.name+"']:checked").length); }); if(settings.selectionChanged !== undefined) settings.selectionChanged(id); } }); } $('#'+id+' .'+settings.tableClass+' > tbody > tr > td > input.select-on-check').die('click').live('click',function(){ if(settings.selectableRows === 0) return false; var $row=$(this).parent().parent(); if(settings.selectableRows == 1){ $row.siblings().removeClass('selected'); $("input:not(#"+this.id+")[name='"+this.name+"']").attr('checked',false); } else $('#'+id+' .'+settings.tableClass+' > thead > tr > th >input.select-on-check-all').attr('checked', $("input.select-on-check").length==$("input.select-on-check:checked").length); $row.toggleClass('selected',this.checked); if(settings.selectionChanged !== undefined) settings.selectionChanged(id); return true; }); if(settings.selectableRows > 1) { $('#'+id+' .'+settings.tableClass+' > thead > tr > th > input.select-on-check-all').die('click').live('click',function(){ var checkedall=this.checked; var name=this.name.substring(0,this.name.length-4)+'[]'; //.. remove '_all' and add '[]' $("input[name='"+name+"']").each(function() { this.checked=checkedall; $(this).parent().parent().toggleClass('selected',checkedall); }); if(settings.selectionChanged !== undefined) settings.selectionChanged(id); }); } }); }; $.fn.yiiGridView.defaults = { ajaxUpdate: [], ajaxVar: 'ajax', pagerClass: 'pager', loadingClass: 'loading', filterClass: 'filters', tableClass: 'items', selectableRows: 1 // updateSelector: '#id .pager a, '#id .grid thead th a', // beforeAjaxUpdate: function(id) {}, // afterAjaxUpdate: function(id, data) {}, // selectionChanged: function(id) {}, // url: 'ajax request URL' }; $.fn.yiiGridView.settings = {}; /** * Returns the key value for the specified row * @param id string the ID of the grid view container * @param row integer the row number (zero-based index) * @return string the key value */ $.fn.yiiGridView.getKey = function(id, row) { return $('#'+id+' > div.keys > span:eq('+row+')').text(); }; /** * Returns the URL that generates the grid view content. * @param id string the ID of the grid view container * @return string the URL that generates the grid view content. */ $.fn.yiiGridView.getUrl = function(id) { var settings = $.fn.yiiGridView.settings[id]; return settings.url || $('#'+id+' > div.keys').attr('title'); }; /** * Returns the jQuery collection of the cells in the specified row. * @param id string the ID of the grid view container * @param row integer the row number (zero-based index) * @return jQuery the jQuery collection of the cells in the specified row. */ $.fn.yiiGridView.getRow = function(id, row) { var settings = $.fn.yiiGridView.settings[id]; return $('#'+id+' .'+settings.tableClass+' > tbody > tr:eq('+row+') > td'); }; /** * Returns the jQuery collection of the cells in the specified column. * @param id string the ID of the grid view container * @param column integer the column number (zero-based index) * @return jQuery the jQuery collection of the cells in the specified column. */ $.fn.yiiGridView.getColumn = function(id, column) { var settings = $.fn.yiiGridView.settings[id]; return $('#'+id+' .'+settings.tableClass+' > tbody > tr > td:nth-child('+(column+1)+')'); }; /** * Performs an AJAX-based update of the grid view contents. * @param id string the ID of the grid view container * @param options map the AJAX request options (see jQuery.ajax API manual). By default, * the URL to be requested is the one that generates the current content of the grid view. */ $.fn.yiiGridView.update = function(id, options) { var settings = $.fn.yiiGridView.settings[id]; $('#'+id).addClass(settings.loadingClass); if(options && options.error !== undefined) { var customError=options.error; delete options.error; } options = $.extend({ type: 'GET', url: $.fn.yiiGridView.getUrl(id), success: function(data,status) { $.each(settings.ajaxUpdate, function(i,v) { var id='#'+v; $(id).replaceWith($(id,'<div>'+data+'</div>')); }); if(settings.afterAjaxUpdate !== undefined) settings.afterAjaxUpdate(id, data); $('#'+id).removeClass(settings.loadingClass); $.fn.yiiGridView.selectCheckedRows(id); }, error: function(XHR, textStatus, errorThrown) { $('#'+id).removeClass(settings.loadingClass); if(XHR.readyState == 0 || XHR.status == 0) return; if(customError!==undefined) { var ret = customError(XHR); if( ret!==undefined && !ret) return; } var err=''; switch(textStatus) { case 'timeout': err='The request timed out!'; break; case 'parsererror': err='Parser error!'; break; case 'error': if(XHR.status && !/^\s*$/.test(XHR.status)) err='Error ' + XHR.status; else err='Error'; if(XHR.responseText && !/^\s*$/.test(XHR.responseText)) err=err + ': ' + XHR.responseText; break; } if(settings.ajaxUpdateError !== undefined) settings.ajaxUpdateError(XHR, textStatus, errorThrown,err); else if(err) alert(err); } }, options || {}); if(options.data!==undefined && options.type=='GET') { options.url = $.param.querystring(options.url, options.data); options.data = {}; } if(settings.ajaxUpdate!==false) { options.url = $.param.querystring(options.url, settings.ajaxVar+'='+id); if(settings.beforeAjaxUpdate !== undefined) settings.beforeAjaxUpdate(id, options); $.ajax(options); } else { // non-ajax mode if(options.type=='GET') { window.location.href=options.url; } else { // POST mode var $form=$('<form action="'+options.url+'" method="post"></form>').appendTo('body'); if(options.data===undefined) options.data={}; if(options.data.returnUrl===undefined) options.data.returnUrl=window.location.href; $.each(options.data, function(name,value) { $form.append($('<input type="hidden" name="t" value="" />').attr('name',name).val(value)); }); $form.submit(); } } }; /** * 1. Selects rows that have checkbox checked (only checkbox that is connected with selecting a row) * 2. Check if "check all" need to be checked/unchecked (all checkboxes) * @param id string the ID of the grid view container */ $.fn.yiiGridView.selectCheckedRows = function(id) { var settings = $.fn.yiiGridView.settings[id]; $('#'+id+' .'+settings.tableClass+' > tbody > tr > td >input.select-on-check:checked').each(function(){ $(this).parent().parent().addClass('selected'); }); $('#'+id+' .'+settings.tableClass+' > thead > tr > th >input[type="checkbox"]').each(function(){ var name=this.name.substring(0,this.name.length-4)+'[]'; //.. remove '_all' and add '[]'' this.checked=$("input[name='"+name+"']").length==$("input[name='"+name+"']:checked").length; }); }; /** * Returns the key values of the currently selected rows. * @param id string the ID of the grid view container * @return array the key values of the currently selected rows. */ $.fn.yiiGridView.getSelection = function(id) { var settings = $.fn.yiiGridView.settings[id]; var keys = $('#'+id+' > div.keys > span'); var selection = []; $('#'+id+' .'+settings.tableClass+' > tbody > tr').each(function(i){ if($(this).hasClass('selected')) selection.push(keys.eq(i).text()); }); return selection; }; /** * Returns the key values of the currently checked rows. * @param id string the ID of the grid view container * @param column_id string the ID of the column * @return array the key values of the currently checked rows. */ $.fn.yiiGridView.getChecked = function(id,column_id) { var settings = $.fn.yiiGridView.settings[id]; var keys = $('#'+id+' > div.keys > span'); if(column_id.substring(column_id.length-2)!='[]') column_id=column_id+'[]'; var checked = []; $('#'+id+' .'+settings.tableClass+' > tbody > tr > td > input[name="'+column_id+'"]').each(function(i){ if(this.checked) checked.push(keys.eq(i).text()); }); return checked; }; })(jQuery);
{ "pile_set_name": "Github" }
<?xml version="1.0" encoding="utf-8"?> <resources> <color name="colorPrimary">#3F51B5</color> <color name="colorPrimaryDark">#303F9F</color> <color name="colorAccent">#FF4081</color> </resources>
{ "pile_set_name": "Github" }
/* * Host Side support for RNDIS Networking Links * Copyright (C) 2005 by David Brownell * * 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, see <http://www.gnu.org/licenses/>. */ #include <linux/module.h> #include <linux/netdevice.h> #include <linux/etherdevice.h> #include <linux/ethtool.h> #include <linux/workqueue.h> #include <linux/slab.h> #include <linux/mii.h> #include <linux/usb.h> #include <linux/usb/cdc.h> #include <linux/usb/usbnet.h> #include <linux/usb/rndis_host.h> /* * RNDIS is NDIS remoted over USB. It's a MSFT variant of CDC ACM ... of * course ACM was intended for modems, not Ethernet links! USB's standard * for Ethernet links is "CDC Ethernet", which is significantly simpler. * * NOTE that Microsoft's "RNDIS 1.0" specification is incomplete. Issues * include: * - Power management in particular relies on information that's scattered * through other documentation, and which is incomplete or incorrect even * there. * - There are various undocumented protocol requirements, such as the * need to send unused garbage in control-OUT messages. * - In some cases, MS-Windows will emit undocumented requests; this * matters more to peripheral implementations than host ones. * * Moreover there's a no-open-specs variant of RNDIS called "ActiveSync". * * For these reasons and others, ** USE OF RNDIS IS STRONGLY DISCOURAGED ** in * favor of such non-proprietary alternatives as CDC Ethernet or the newer (and * currently rare) "Ethernet Emulation Model" (EEM). */ /* * RNDIS notifications from device: command completion; "reverse" * keepalives; etc */ void rndis_status(struct usbnet *dev, struct urb *urb) { netdev_dbg(dev->net, "rndis status urb, len %d stat %d\n", urb->actual_length, urb->status); // FIXME for keepalives, respond immediately (asynchronously) // if not an RNDIS status, do like cdc_status(dev,urb) does } EXPORT_SYMBOL_GPL(rndis_status); /* * RNDIS indicate messages. */ static void rndis_msg_indicate(struct usbnet *dev, struct rndis_indicate *msg, int buflen) { struct cdc_state *info = (void *)&dev->data; struct device *udev = &info->control->dev; if (dev->driver_info->indication) { dev->driver_info->indication(dev, msg, buflen); } else { u32 status = le32_to_cpu(msg->status); switch (status) { case RNDIS_STATUS_MEDIA_CONNECT: dev_info(udev, "rndis media connect\n"); break; case RNDIS_STATUS_MEDIA_DISCONNECT: dev_info(udev, "rndis media disconnect\n"); break; default: dev_info(udev, "rndis indication: 0x%08x\n", status); } } } /* * RPC done RNDIS-style. Caller guarantees: * - message is properly byteswapped * - there's no other request pending * - buf can hold up to 1KB response (required by RNDIS spec) * On return, the first few entries are already byteswapped. * * Call context is likely probe(), before interface name is known, * which is why we won't try to use it in the diagnostics. */ int rndis_command(struct usbnet *dev, struct rndis_msg_hdr *buf, int buflen) { struct cdc_state *info = (void *) &dev->data; struct usb_cdc_notification notification; int master_ifnum; int retval; int partial; unsigned count; u32 xid = 0, msg_len, request_id, msg_type, rsp, status; /* REVISIT when this gets called from contexts other than probe() or * disconnect(): either serialize, or dispatch responses on xid */ msg_type = le32_to_cpu(buf->msg_type); /* Issue the request; xid is unique, don't bother byteswapping it */ if (likely(msg_type != RNDIS_MSG_HALT && msg_type != RNDIS_MSG_RESET)) { xid = dev->xid++; if (!xid) xid = dev->xid++; buf->request_id = (__force __le32) xid; } master_ifnum = info->control->cur_altsetting->desc.bInterfaceNumber; retval = usb_control_msg(dev->udev, usb_sndctrlpipe(dev->udev, 0), USB_CDC_SEND_ENCAPSULATED_COMMAND, USB_TYPE_CLASS | USB_RECIP_INTERFACE, 0, master_ifnum, buf, le32_to_cpu(buf->msg_len), RNDIS_CONTROL_TIMEOUT_MS); if (unlikely(retval < 0 || xid == 0)) return retval; /* Some devices don't respond on the control channel until * polled on the status channel, so do that first. */ if (dev->driver_info->data & RNDIS_DRIVER_DATA_POLL_STATUS) { retval = usb_interrupt_msg( dev->udev, usb_rcvintpipe(dev->udev, dev->status->desc.bEndpointAddress), &notification, sizeof(notification), &partial, RNDIS_CONTROL_TIMEOUT_MS); if (unlikely(retval < 0)) return retval; } /* Poll the control channel; the request probably completed immediately */ rsp = le32_to_cpu(buf->msg_type) | RNDIS_MSG_COMPLETION; for (count = 0; count < 10; count++) { memset(buf, 0, CONTROL_BUFFER_SIZE); retval = usb_control_msg(dev->udev, usb_rcvctrlpipe(dev->udev, 0), USB_CDC_GET_ENCAPSULATED_RESPONSE, USB_DIR_IN | USB_TYPE_CLASS | USB_RECIP_INTERFACE, 0, master_ifnum, buf, buflen, RNDIS_CONTROL_TIMEOUT_MS); if (likely(retval >= 8)) { msg_type = le32_to_cpu(buf->msg_type); msg_len = le32_to_cpu(buf->msg_len); status = le32_to_cpu(buf->status); request_id = (__force u32) buf->request_id; if (likely(msg_type == rsp)) { if (likely(request_id == xid)) { if (unlikely(rsp == RNDIS_MSG_RESET_C)) return 0; if (likely(RNDIS_STATUS_SUCCESS == status)) return 0; dev_dbg(&info->control->dev, "rndis reply status %08x\n", status); return -EL3RST; } dev_dbg(&info->control->dev, "rndis reply id %d expected %d\n", request_id, xid); /* then likely retry */ } else switch (msg_type) { case RNDIS_MSG_INDICATE: /* fault/event */ rndis_msg_indicate(dev, (void *)buf, buflen); break; case RNDIS_MSG_KEEPALIVE: { /* ping */ struct rndis_keepalive_c *msg = (void *)buf; msg->msg_type = cpu_to_le32(RNDIS_MSG_KEEPALIVE_C); msg->msg_len = cpu_to_le32(sizeof *msg); msg->status = cpu_to_le32(RNDIS_STATUS_SUCCESS); retval = usb_control_msg(dev->udev, usb_sndctrlpipe(dev->udev, 0), USB_CDC_SEND_ENCAPSULATED_COMMAND, USB_TYPE_CLASS | USB_RECIP_INTERFACE, 0, master_ifnum, msg, sizeof *msg, RNDIS_CONTROL_TIMEOUT_MS); if (unlikely(retval < 0)) dev_dbg(&info->control->dev, "rndis keepalive err %d\n", retval); } break; default: dev_dbg(&info->control->dev, "unexpected rndis msg %08x len %d\n", le32_to_cpu(buf->msg_type), msg_len); } } else { /* device probably issued a protocol stall; ignore */ dev_dbg(&info->control->dev, "rndis response error, code %d\n", retval); } msleep(20); } dev_dbg(&info->control->dev, "rndis response timeout\n"); return -ETIMEDOUT; } EXPORT_SYMBOL_GPL(rndis_command); /* * rndis_query: * * Performs a query for @oid along with 0 or more bytes of payload as * specified by @in_len. If @reply_len is not set to -1 then the reply * length is checked against this value, resulting in an error if it * doesn't match. * * NOTE: Adding a payload exactly or greater than the size of the expected * response payload is an evident requirement MSFT added for ActiveSync. * * The only exception is for OIDs that return a variably sized response, * in which case no payload should be added. This undocumented (and * nonsensical!) issue was found by sniffing protocol requests from the * ActiveSync 4.1 Windows driver. */ static int rndis_query(struct usbnet *dev, struct usb_interface *intf, void *buf, u32 oid, u32 in_len, void **reply, int *reply_len) { int retval; union { void *buf; struct rndis_msg_hdr *header; struct rndis_query *get; struct rndis_query_c *get_c; } u; u32 off, len; u.buf = buf; memset(u.get, 0, sizeof *u.get + in_len); u.get->msg_type = cpu_to_le32(RNDIS_MSG_QUERY); u.get->msg_len = cpu_to_le32(sizeof *u.get + in_len); u.get->oid = cpu_to_le32(oid); u.get->len = cpu_to_le32(in_len); u.get->offset = cpu_to_le32(20); retval = rndis_command(dev, u.header, CONTROL_BUFFER_SIZE); if (unlikely(retval < 0)) { dev_err(&intf->dev, "RNDIS_MSG_QUERY(0x%08x) failed, %d\n", oid, retval); return retval; } off = le32_to_cpu(u.get_c->offset); len = le32_to_cpu(u.get_c->len); if (unlikely((8 + off + len) > CONTROL_BUFFER_SIZE)) goto response_error; if (*reply_len != -1 && len != *reply_len) goto response_error; *reply = (unsigned char *) &u.get_c->request_id + off; *reply_len = len; return retval; response_error: dev_err(&intf->dev, "RNDIS_MSG_QUERY(0x%08x) " "invalid response - off %d len %d\n", oid, off, len); return -EDOM; } /* same as usbnet_netdev_ops but MTU change not allowed */ static const struct net_device_ops rndis_netdev_ops = { .ndo_open = usbnet_open, .ndo_stop = usbnet_stop, .ndo_start_xmit = usbnet_start_xmit, .ndo_tx_timeout = usbnet_tx_timeout, .ndo_get_stats64 = usbnet_get_stats64, .ndo_set_mac_address = eth_mac_addr, .ndo_validate_addr = eth_validate_addr, }; int generic_rndis_bind(struct usbnet *dev, struct usb_interface *intf, int flags) { int retval; struct net_device *net = dev->net; struct cdc_state *info = (void *) &dev->data; union { void *buf; struct rndis_msg_hdr *header; struct rndis_init *init; struct rndis_init_c *init_c; struct rndis_query *get; struct rndis_query_c *get_c; struct rndis_set *set; struct rndis_set_c *set_c; struct rndis_halt *halt; } u; u32 tmp; __le32 phym_unspec, *phym; int reply_len; unsigned char *bp; /* we can't rely on i/o from stack working, or stack allocation */ u.buf = kmalloc(CONTROL_BUFFER_SIZE, GFP_KERNEL); if (!u.buf) return -ENOMEM; retval = usbnet_generic_cdc_bind(dev, intf); if (retval < 0) goto fail; u.init->msg_type = cpu_to_le32(RNDIS_MSG_INIT); u.init->msg_len = cpu_to_le32(sizeof *u.init); u.init->major_version = cpu_to_le32(1); u.init->minor_version = cpu_to_le32(0); /* max transfer (in spec) is 0x4000 at full speed, but for * TX we'll stick to one Ethernet packet plus RNDIS framing. * For RX we handle drivers that zero-pad to end-of-packet. * Don't let userspace change these settings. * * NOTE: there still seems to be wierdness here, as if we need * to do some more things to make sure WinCE targets accept this. * They default to jumbograms of 8KB or 16KB, which is absurd * for such low data rates and which is also more than Linux * can usually expect to allocate for SKB data... */ net->hard_header_len += sizeof (struct rndis_data_hdr); dev->hard_mtu = net->mtu + net->hard_header_len; dev->maxpacket = usb_maxpacket(dev->udev, dev->out, 1); if (dev->maxpacket == 0) { netif_dbg(dev, probe, dev->net, "dev->maxpacket can't be 0\n"); retval = -EINVAL; goto fail_and_release; } dev->rx_urb_size = dev->hard_mtu + (dev->maxpacket + 1); dev->rx_urb_size &= ~(dev->maxpacket - 1); u.init->max_transfer_size = cpu_to_le32(dev->rx_urb_size); net->netdev_ops = &rndis_netdev_ops; retval = rndis_command(dev, u.header, CONTROL_BUFFER_SIZE); if (unlikely(retval < 0)) { /* it might not even be an RNDIS device!! */ dev_err(&intf->dev, "RNDIS init failed, %d\n", retval); goto fail_and_release; } tmp = le32_to_cpu(u.init_c->max_transfer_size); if (tmp < dev->hard_mtu) { if (tmp <= net->hard_header_len) { dev_err(&intf->dev, "dev can't take %u byte packets (max %u)\n", dev->hard_mtu, tmp); retval = -EINVAL; goto halt_fail_and_release; } dev_warn(&intf->dev, "dev can't take %u byte packets (max %u), " "adjusting MTU to %u\n", dev->hard_mtu, tmp, tmp - net->hard_header_len); dev->hard_mtu = tmp; net->mtu = dev->hard_mtu - net->hard_header_len; } /* REVISIT: peripheral "alignment" request is ignored ... */ dev_dbg(&intf->dev, "hard mtu %u (%u from dev), rx buflen %zu, align %d\n", dev->hard_mtu, tmp, dev->rx_urb_size, 1 << le32_to_cpu(u.init_c->packet_alignment)); /* module has some device initialization code needs to be done right * after RNDIS_INIT */ if (dev->driver_info->early_init && dev->driver_info->early_init(dev) != 0) goto halt_fail_and_release; /* Check physical medium */ phym = NULL; reply_len = sizeof *phym; retval = rndis_query(dev, intf, u.buf, RNDIS_OID_GEN_PHYSICAL_MEDIUM, 0, (void **) &phym, &reply_len); if (retval != 0 || !phym) { /* OID is optional so don't fail here. */ phym_unspec = cpu_to_le32(RNDIS_PHYSICAL_MEDIUM_UNSPECIFIED); phym = &phym_unspec; } if ((flags & FLAG_RNDIS_PHYM_WIRELESS) && le32_to_cpup(phym) != RNDIS_PHYSICAL_MEDIUM_WIRELESS_LAN) { netif_dbg(dev, probe, dev->net, "driver requires wireless physical medium, but device is not\n"); retval = -ENODEV; goto halt_fail_and_release; } if ((flags & FLAG_RNDIS_PHYM_NOT_WIRELESS) && le32_to_cpup(phym) == RNDIS_PHYSICAL_MEDIUM_WIRELESS_LAN) { netif_dbg(dev, probe, dev->net, "driver requires non-wireless physical medium, but device is wireless.\n"); retval = -ENODEV; goto halt_fail_and_release; } /* Get designated host ethernet address */ reply_len = ETH_ALEN; retval = rndis_query(dev, intf, u.buf, RNDIS_OID_802_3_PERMANENT_ADDRESS, 48, (void **) &bp, &reply_len); if (unlikely(retval< 0)) { dev_err(&intf->dev, "rndis get ethaddr, %d\n", retval); goto halt_fail_and_release; } if (bp[0] & 0x02) eth_hw_addr_random(net); else ether_addr_copy(net->dev_addr, bp); /* set a nonzero filter to enable data transfers */ memset(u.set, 0, sizeof *u.set); u.set->msg_type = cpu_to_le32(RNDIS_MSG_SET); u.set->msg_len = cpu_to_le32(4 + sizeof *u.set); u.set->oid = cpu_to_le32(RNDIS_OID_GEN_CURRENT_PACKET_FILTER); u.set->len = cpu_to_le32(4); u.set->offset = cpu_to_le32((sizeof *u.set) - 8); *(__le32 *)(u.buf + sizeof *u.set) = cpu_to_le32(RNDIS_DEFAULT_FILTER); retval = rndis_command(dev, u.header, CONTROL_BUFFER_SIZE); if (unlikely(retval < 0)) { dev_err(&intf->dev, "rndis set packet filter, %d\n", retval); goto halt_fail_and_release; } retval = 0; kfree(u.buf); return retval; halt_fail_and_release: memset(u.halt, 0, sizeof *u.halt); u.halt->msg_type = cpu_to_le32(RNDIS_MSG_HALT); u.halt->msg_len = cpu_to_le32(sizeof *u.halt); (void) rndis_command(dev, (void *)u.halt, CONTROL_BUFFER_SIZE); fail_and_release: usb_set_intfdata(info->data, NULL); usb_driver_release_interface(driver_of(intf), info->data); info->data = NULL; fail: kfree(u.buf); return retval; } EXPORT_SYMBOL_GPL(generic_rndis_bind); static int rndis_bind(struct usbnet *dev, struct usb_interface *intf) { return generic_rndis_bind(dev, intf, FLAG_RNDIS_PHYM_NOT_WIRELESS); } void rndis_unbind(struct usbnet *dev, struct usb_interface *intf) { struct rndis_halt *halt; /* try to clear any rndis state/activity (no i/o from stack!) */ halt = kzalloc(CONTROL_BUFFER_SIZE, GFP_KERNEL); if (halt) { halt->msg_type = cpu_to_le32(RNDIS_MSG_HALT); halt->msg_len = cpu_to_le32(sizeof *halt); (void) rndis_command(dev, (void *)halt, CONTROL_BUFFER_SIZE); kfree(halt); } usbnet_cdc_unbind(dev, intf); } EXPORT_SYMBOL_GPL(rndis_unbind); /* * DATA -- host must not write zlps */ int rndis_rx_fixup(struct usbnet *dev, struct sk_buff *skb) { /* This check is no longer done by usbnet */ if (skb->len < dev->net->hard_header_len) return 0; /* peripheral may have batched packets to us... */ while (likely(skb->len)) { struct rndis_data_hdr *hdr = (void *)skb->data; struct sk_buff *skb2; u32 msg_type, msg_len, data_offset, data_len; msg_type = le32_to_cpu(hdr->msg_type); msg_len = le32_to_cpu(hdr->msg_len); data_offset = le32_to_cpu(hdr->data_offset); data_len = le32_to_cpu(hdr->data_len); /* don't choke if we see oob, per-packet data, etc */ if (unlikely(msg_type != RNDIS_MSG_PACKET || skb->len < msg_len || (data_offset + data_len + 8) > msg_len)) { dev->net->stats.rx_frame_errors++; netdev_dbg(dev->net, "bad rndis message %d/%d/%d/%d, len %d\n", le32_to_cpu(hdr->msg_type), msg_len, data_offset, data_len, skb->len); return 0; } skb_pull(skb, 8 + data_offset); /* at most one packet left? */ if (likely((data_len - skb->len) <= sizeof *hdr)) { skb_trim(skb, data_len); break; } /* try to return all the packets in the batch */ skb2 = skb_clone(skb, GFP_ATOMIC); if (unlikely(!skb2)) break; skb_pull(skb, msg_len - sizeof *hdr); skb_trim(skb2, data_len); usbnet_skb_return(dev, skb2); } /* caller will usbnet_skb_return the remaining packet */ return 1; } EXPORT_SYMBOL_GPL(rndis_rx_fixup); struct sk_buff * rndis_tx_fixup(struct usbnet *dev, struct sk_buff *skb, gfp_t flags) { struct rndis_data_hdr *hdr; struct sk_buff *skb2; unsigned len = skb->len; if (likely(!skb_cloned(skb))) { int room = skb_headroom(skb); /* enough head room as-is? */ if (unlikely((sizeof *hdr) <= room)) goto fill; /* enough room, but needs to be readjusted? */ room += skb_tailroom(skb); if (likely((sizeof *hdr) <= room)) { skb->data = memmove(skb->head + sizeof *hdr, skb->data, len); skb_set_tail_pointer(skb, len); goto fill; } } /* create a new skb, with the correct size (and tailpad) */ skb2 = skb_copy_expand(skb, sizeof *hdr, 1, flags); dev_kfree_skb_any(skb); if (unlikely(!skb2)) return skb2; skb = skb2; /* fill out the RNDIS header. we won't bother trying to batch * packets; Linux minimizes wasted bandwidth through tx queues. */ fill: hdr = __skb_push(skb, sizeof *hdr); memset(hdr, 0, sizeof *hdr); hdr->msg_type = cpu_to_le32(RNDIS_MSG_PACKET); hdr->msg_len = cpu_to_le32(skb->len); hdr->data_offset = cpu_to_le32(sizeof(*hdr) - 8); hdr->data_len = cpu_to_le32(len); /* FIXME make the last packet always be short ... */ return skb; } EXPORT_SYMBOL_GPL(rndis_tx_fixup); static const struct driver_info rndis_info = { .description = "RNDIS device", .flags = FLAG_ETHER | FLAG_POINTTOPOINT | FLAG_FRAMING_RN | FLAG_NO_SETINT, .bind = rndis_bind, .unbind = rndis_unbind, .status = rndis_status, .rx_fixup = rndis_rx_fixup, .tx_fixup = rndis_tx_fixup, }; static const struct driver_info rndis_poll_status_info = { .description = "RNDIS device (poll status before control)", .flags = FLAG_ETHER | FLAG_POINTTOPOINT | FLAG_FRAMING_RN | FLAG_NO_SETINT, .data = RNDIS_DRIVER_DATA_POLL_STATUS, .bind = rndis_bind, .unbind = rndis_unbind, .status = rndis_status, .rx_fixup = rndis_rx_fixup, .tx_fixup = rndis_tx_fixup, }; /*-------------------------------------------------------------------------*/ static const struct usb_device_id products [] = { { /* 2Wire HomePortal 1000SW */ USB_DEVICE_AND_INTERFACE_INFO(0x1630, 0x0042, USB_CLASS_COMM, 2 /* ACM */, 0x0ff), .driver_info = (unsigned long) &rndis_poll_status_info, }, { /* RNDIS is MSFT's un-official variant of CDC ACM */ USB_INTERFACE_INFO(USB_CLASS_COMM, 2 /* ACM */, 0x0ff), .driver_info = (unsigned long) &rndis_info, }, { /* "ActiveSync" is an undocumented variant of RNDIS, used in WM5 */ USB_INTERFACE_INFO(USB_CLASS_MISC, 1, 1), .driver_info = (unsigned long) &rndis_poll_status_info, }, { /* RNDIS for tethering */ USB_INTERFACE_INFO(USB_CLASS_WIRELESS_CONTROLLER, 1, 3), .driver_info = (unsigned long) &rndis_info, }, { /* Novatel Verizon USB730L */ USB_INTERFACE_INFO(USB_CLASS_MISC, 4, 1), .driver_info = (unsigned long) &rndis_info, }, { }, // END }; MODULE_DEVICE_TABLE(usb, products); static struct usb_driver rndis_driver = { .name = "rndis_host", .id_table = products, .probe = usbnet_probe, .disconnect = usbnet_disconnect, .suspend = usbnet_suspend, .resume = usbnet_resume, .disable_hub_initiated_lpm = 1, }; module_usb_driver(rndis_driver); MODULE_AUTHOR("David Brownell"); MODULE_DESCRIPTION("USB Host side RNDIS driver"); MODULE_LICENSE("GPL");
{ "pile_set_name": "Github" }
# For the API ActionController::Metal.class_eval do def spree_current_user @spree_current_user ||= env['warden'].user end end
{ "pile_set_name": "Github" }
name: annfail04 version: 1.0 build-type: Simple cabal-version: >= 1.2 executable AnnRun01 main-is: AnnRun01.hs build-depends: base exposed-modules: AnnRun01 AnnRun01_Help
{ "pile_set_name": "Github" }
{ "name": "crisu83/yii-app", "description": "A great way to start building your web application with Yii PHP framework.", "keywords": ["yii", "application-template"], "homepage": "https://github.com/Crisu83/yii-app", "type": "project", "license": "BSD-3-Clause", "authors": [ { "name": "Christoffer Niska", "email": "[email protected]", "homepage": "http://www.cniska.net" } ], "minimum-stability": "dev", "require": { "php": ">=5.3.0", "crisu83/yii-composer": "dev-master", "crisu83/yii-consoletools": "1.0.*", "crisu83/yiistrap": "1.2.*", "phpnode/yiipassword": "dev-master", "yiisoft/yii": ">=1.1.14" }, "require-dev": { "codeception/codeception": "@stable", "malyshev/yii-debug-toolbar": "dev-master" }, "suggest": { "crisu83/yii-auth": "1.6.*", "crisu83/yii-arbehaviors": "1.1.*", "crisu83/yii-filemanager": "1.8.*", "crisu83/yii-imagemanager": "1.11.*", "crisu83/yii-sentry": "1.3.*", "crisu83/yii-seo": "dev-master", "nordsoftware/yii-audit": "1.1.*", "nordsoftware/yii-emailer": "1.2.*" }, "scripts": { "post-install-cmd": [ "Crisu83\\YiiComposer\\InstallHandler::setPermissions" ] }, "extra": { "yii-install-writable": [ "app/runtime", "app/tests/_log", "web/assets" ], "yii-install-executable": [ "app/yiic" ] } }
{ "pile_set_name": "Github" }
Andrew L Janke <[email protected]>
{ "pile_set_name": "Github" }
/* * Copyright 1995-2016 The OpenSSL Project Authors. All Rights Reserved. * * Licensed under the OpenSSL license (the "License"). You may not use * this file except in compliance with the License. You can obtain a copy * in the file LICENSE in the source distribution or at * https://www.openssl.org/source/license.html */ #ifndef HEADER_SHA_H # define HEADER_SHA_H # include <openssl/e_os2.h> # include <stddef.h> #ifdef __cplusplus extern "C" { #endif /*- * !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! * ! SHA_LONG has to be at least 32 bits wide. ! * !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! */ # define SHA_LONG unsigned int # define SHA_LBLOCK 16 # define SHA_CBLOCK (SHA_LBLOCK*4)/* SHA treats input data as a * contiguous array of 32 bit wide * big-endian values. */ # define SHA_LAST_BLOCK (SHA_CBLOCK-8) # define SHA_DIGEST_LENGTH 20 typedef struct SHAstate_st { SHA_LONG h0, h1, h2, h3, h4; SHA_LONG Nl, Nh; SHA_LONG data[SHA_LBLOCK]; unsigned int num; } SHA_CTX; int SHA1_Init(SHA_CTX *c); int SHA1_Update(SHA_CTX *c, const void *data, size_t len); int SHA1_Final(unsigned char *md, SHA_CTX *c); unsigned char *SHA1(const unsigned char *d, size_t n, unsigned char *md); void SHA1_Transform(SHA_CTX *c, const unsigned char *data); # define SHA256_CBLOCK (SHA_LBLOCK*4)/* SHA-256 treats input data as a * contiguous array of 32 bit wide * big-endian values. */ typedef struct SHA256state_st { SHA_LONG h[8]; SHA_LONG Nl, Nh; SHA_LONG data[SHA_LBLOCK]; unsigned int num, md_len; } SHA256_CTX; int SHA224_Init(SHA256_CTX *c); int SHA224_Update(SHA256_CTX *c, const void *data, size_t len); int SHA224_Final(unsigned char *md, SHA256_CTX *c); unsigned char *SHA224(const unsigned char *d, size_t n, unsigned char *md); int SHA256_Init(SHA256_CTX *c); int SHA256_Update(SHA256_CTX *c, const void *data, size_t len); int SHA256_Final(unsigned char *md, SHA256_CTX *c); unsigned char *SHA256(const unsigned char *d, size_t n, unsigned char *md); void SHA256_Transform(SHA256_CTX *c, const unsigned char *data); # define SHA224_DIGEST_LENGTH 28 # define SHA256_DIGEST_LENGTH 32 # define SHA384_DIGEST_LENGTH 48 # define SHA512_DIGEST_LENGTH 64 /* * Unlike 32-bit digest algorithms, SHA-512 *relies* on SHA_LONG64 * being exactly 64-bit wide. See Implementation Notes in sha512.c * for further details. */ /* * SHA-512 treats input data as a * contiguous array of 64 bit * wide big-endian values. */ # define SHA512_CBLOCK (SHA_LBLOCK*8) # if (defined(_WIN32) || defined(_WIN64)) && !defined(__MINGW32__) # define SHA_LONG64 unsigned __int64 # define U64(C) C##UI64 # elif defined(__arch64__) # define SHA_LONG64 unsigned long # define U64(C) C##UL # else # define SHA_LONG64 unsigned long long # define U64(C) C##ULL # endif typedef struct SHA512state_st { SHA_LONG64 h[8]; SHA_LONG64 Nl, Nh; union { SHA_LONG64 d[SHA_LBLOCK]; unsigned char p[SHA512_CBLOCK]; } u; unsigned int num, md_len; } SHA512_CTX; int SHA384_Init(SHA512_CTX *c); int SHA384_Update(SHA512_CTX *c, const void *data, size_t len); int SHA384_Final(unsigned char *md, SHA512_CTX *c); unsigned char *SHA384(const unsigned char *d, size_t n, unsigned char *md); int SHA512_Init(SHA512_CTX *c); int SHA512_Update(SHA512_CTX *c, const void *data, size_t len); int SHA512_Final(unsigned char *md, SHA512_CTX *c); unsigned char *SHA512(const unsigned char *d, size_t n, unsigned char *md); void SHA512_Transform(SHA512_CTX *c, const unsigned char *data); #ifdef __cplusplus } #endif #endif
{ "pile_set_name": "Github" }
syntax = "proto3"; package envoy.data.tap.v2alpha; import "udpa/annotations/status.proto"; option java_package = "io.envoyproxy.envoy.data.tap.v2alpha"; option java_outer_classname = "CommonProto"; option java_multiple_files = true; option (udpa.annotations.file_status).package_version_status = FROZEN; // [#protodoc-title: Tap common data] // Wrapper for tapped body data. This includes HTTP request/response body, transport socket received // and transmitted data, etc. message Body { oneof body_type { // Body data as bytes. By default, tap body data will be present in this field, as the proto // `bytes` type can contain any valid byte. bytes as_bytes = 1; // Body data as string. This field is only used when the :ref:`JSON_BODY_AS_STRING // <envoy_api_enum_value_service.tap.v2alpha.OutputSink.Format.JSON_BODY_AS_STRING>` sink // format type is selected. See the documentation for that option for why this is useful. string as_string = 2; } // Specifies whether body data has been truncated to fit within the specified // :ref:`max_buffered_rx_bytes // <envoy_api_field_service.tap.v2alpha.OutputConfig.max_buffered_rx_bytes>` and // :ref:`max_buffered_tx_bytes // <envoy_api_field_service.tap.v2alpha.OutputConfig.max_buffered_tx_bytes>` settings. bool truncated = 3; }
{ "pile_set_name": "Github" }
# Maintainer: Antergos Devs <[email protected]> pkgname=antergos-cinnamon-meta pkgver=1.1 pkgrel=1 pkgdesc='Meta package for Antergos Cinnamon' url='http://www.antergos.com' arch=('any') license=('GPL3') depends=('antergos-gnome-defaults-list' 'baobab' 'brasero' 'cinnamon' 'cinnamon-control-center' 'cinnamon-desktop' 'cinnamon-menus' 'cinnamon-session' 'cinnamon-settings-daemon' 'cinnamon-screensaver' 'cinnamon-translations' 'cjs' 'eog' 'evince' 'file-roller' 'gedit' 'gnome-calculator' 'gnome-common' 'gnome-disk-utility' 'gnome-font-viewer' 'gnome-keyring' 'gnome-music' 'gnome-photos' 'gnome-screenshot' 'gnome-system-monitor' 'gnome-terminal' 'gnome-themes-standard' 'gvfs-google' 'gvfs-mtp' 'gvfs-smb' 'hicolor-icon-theme' 'libgnome-keyring' 'muffin' 'nemo' 'nemo-fileroller' 'nemo-preview' 'nemo-share' 'network-manager-applet' 'networkmanager-openvpn' 'networkmanager-pptp' 'pamac' 'python-pysmbc' 'qt5ct' 'totem' 'transmission-gtk' 'xdg-user-dirs-gtk' 'zuki-themes')
{ "pile_set_name": "Github" }
import { IndexModule } from './index.module'; describe('IndexModule', () => { let indexModule: IndexModule; beforeEach(() => { indexModule = new IndexModule(); }); it('should create an instance', () => { expect(indexModule).toBeTruthy(); }); });
{ "pile_set_name": "Github" }
#include <string.h> #include "randombytes.h" #include "crypto_sign.h" #include "crypto_hash_sha512.h" #include "ge.h" int crypto_sign_keypair(unsigned char *pk,unsigned char *sk) { unsigned char az[64]; ge_p3 A; randombytes(sk,32); crypto_hash_sha512(az,sk,32); az[0] &= 248; az[31] &= 63; az[31] |= 64; ge_scalarmult_base(&A,az); ge_p3_tobytes(pk,&A); memmove(sk + 32,pk,32); return 0; }
{ "pile_set_name": "Github" }
# Connecting to a Windows Server instance in Amazon EC2 created from an Amazon Lightsail snapshot<a name="amazon-lightsail-connecting-to-windows-server-amazon-ec2-instances"></a> *Last updated: November 28, 2018* After your new Windows Server instance is created in Amazon Elastic Compute Cloud \(Amazon EC2\), you can connect to it using Remote Desktop Protocol \(RDP\)\. This is similar to how you connected to the source Amazon Lightsail instance\. Connect to your EC2 instance using the default Lightsail key pair for the source instance’s AWS Region\. This guide shows you how to connect to your Windows Server instance using Microsoft Remote Desktop Connection\. **Note** For more information about connecting to a Linux or Unix instance, see [Connecting to a Linux or Unix instance in Amazon EC2 created from an Amazon Lightsail snapshot](amazon-lightsail-connecting-to-linux-unix-amazon-ec2-instances.md)\. **Contents** + [Get the key for your instance](#get-the-key-windows-instance) + [Get the public DNS address for your instance](#get-the-public-dns-address-for-your-windows-instance) + [Get the password for your Windows Server instance](#get-the-password-for-your-windows-instance) + [Configure Remote Desktop Connection to connect to your Windows Server instance](#configure-remote-desktop-connection) + [Next steps](#connecting-to-windows-server-amazon-ec2-instances-next-steps) ## Get the key for your instance<a name="get-the-key-windows-instance"></a> Your Windows Server instance in Amazon EC2 uses the default Lightsail key pair for the source instance’s Region to retrieve the default administrator password\. Download the default private key from the **SSH keys** tab on the [Lightsail account page](https://lightsail.aws.amazon.com/ls/webapp/account/keys)\. For more information about the default Lightsail SSH keys, see [SSH and connecting to your Lightsail instance](understanding-ssh-in-amazon-lightsail.md)\. **Note** After you connect to your EC2 instance, we recommend changing the administrator password for your Windows Server instance in Amazon EC2\. It removes the association between the default Lightsail key pair and your Windows Server instance in Amazon EC2\. For more information, see [Securing a Windows Server instance in Amazon EC2 created from an Amazon Lightsail snapshot](amazon-lightsail-securing-windows-server-amazon-ec2-instances.md)\. ## Get the public DNS address for your instance<a name="get-the-public-dns-address-for-your-windows-instance"></a> Get the public DNS address for your Amazon EC2 instance, so that you can use it when configuring an RDP client, such as Microsoft Remote Desktop Connection, to connect to your instance\. **To get the public DNS address for your instance** 1. Sign in to the [Amazon EC2 console](https://console.aws.amazon.com/ec2/)\. 1. Choose **Instances** from the left navigation pane\. 1. Choose the running Windows Server instance that you want to connect to\. 1. In the lower pane, locate the **Public DNS** address for your instance\. This is the address that you use when configuring an RDP client to connect to your instance\. Continue to the [Get the password for your Windows Server instance](#get-the-password-for-your-windows-instance) section of this guide to learn how to get the default administrator password for your Windows Server instance in Amazon EC2\. ![\[An instance's public DNS in the Amazon EC2 console.\]](https://d9yljz1nd5001.cloudfront.net/en_us/2f596334045058acdba2fdcc5e035cef/images/amazon-lightsail-ec2-public-dns.png) ## Get the password for your Windows Server instance<a name="get-the-password-for-your-windows-instance"></a> Get the password for your Windows Server instance from the Amazon EC2 console\. You need this password to sign in to your Windows Server instance when connecting to it through RDP\. **To get the password for your Windows Server instance** 1. Sign in to the [Amazon EC2 console](https://console.aws.amazon.com/ec2/)\. 1. From the left navigation pane, choose **Instances**\. 1. Choose the Windows Server instance that you want to connect to\. 1. Choose **Actions**, then choose **Get Windows Password**\. ![\[Getting the Windows Server default administrator password in the Amazon EC2 console.\]](https://d9yljz1nd5001.cloudfront.net/en_us/2f596334045058acdba2fdcc5e035cef/images/amazon-lightsail-ec2-get-windows-password.png) 1. At the prompt, choose **Browse** and open the default private key file that you downloaded from Lightsail earlier in this guide\. 1. Choose **Decrypt Password**\. ![\[Decrypting the Windows default administrator password in the Amazon EC2 console.\]](https://d9yljz1nd5001.cloudfront.net/en_us/2f596334045058acdba2fdcc5e035cef/images/amazon-lightsail-ec2-decrypt-password.png) The password is displayed on the screen, as well as the public DNS and user name\. Copy the password to your clipboard so that you can use it in the following [Configure Remote Desktop Connection to connect to your Windows Server instance](#configure-remote-desktop-connection) section of this guide\. Highlight the password, and press **Ctrl\+C** if you’re using Windows, or **Cmd\+C** if you’re using macOS\. ![\[Decrypted Windows default administrator password in the Amazon EC2 console.\]](https://d9yljz1nd5001.cloudfront.net/en_us/2f596334045058acdba2fdcc5e035cef/images/amazon-lightsail-ec2-decrypted-password.png) Continue to the [Configure Remote Desktop Connection to connect to your Windows Server instance](#configure-remote-desktop-connection) section of this guide to learn how to configure Remote Desktop Connection to connect to your Windows Server instance in Amazon EC2\. ## Configure Remote Desktop Connection to connect to your Windows Server instance<a name="configure-remote-desktop-connection"></a> Remote Desktop Connection is an RDP client that comes pre\-installed on most Windows operating systems\. Use it to graphically connect to your Windows Server instance in Amazon EC2\. **To configure Remote Desktop Connection to connect to your Windows Server instance** 1. Open Remote Desktop Connection\. For example, choose the **Windows Start** menu, then search for **Remote Desktop Connection**\. 1. In the **Computer** text box, enter the public DNS address for your Windows Server instance in Amazon EC2 obtained earlier in this guide\. 1. Choose **Show Options** to view additional options\. 1. Enter `Administrator` into the **User name** text box\. ![\[Microsoft Remote Desktop Connection.\]](https://d9yljz1nd5001.cloudfront.net/en_us/2f596334045058acdba2fdcc5e035cef/images/amazon-lightsail-rdc-configuration.png) 1. Choose **Connect** to connect to your Windows Server instance\. 1. At the Windows Security prompt, enter the password for your Windows Server instance into the **Password** text box, then choose **OK**\. ![\[Microsoft Remote Desktop Connection password prompt.\]](https://d9yljz1nd5001.cloudfront.net/en_us/2f596334045058acdba2fdcc5e035cef/images/amazon-lightsail-rdc-password.png) 1. At the Remote Desktop Connection prompt, chose **Yes** to connect\. ![\[Microsoft Remote Desktop Connection security prompt.\]](https://d9yljz1nd5001.cloudfront.net/en_us/2f596334045058acdba2fdcc5e035cef/images/amazon-lightsail-rdc-certificate-errors.png) You should see a screen similar to the following if you've successfully connected to your instance: ![\[Microsoft Remote Desktop Connection connected to instance.\]](https://d9yljz1nd5001.cloudfront.net/en_us/2f596334045058acdba2fdcc5e035cef/images/amazon-lightsail-rdc-connected.png) ## Next steps<a name="connecting-to-windows-server-amazon-ec2-instances-next-steps"></a> We recommend changing the administrator password for your Windows Server instance in Amazon EC2\. It removes the association between the default Lightsail key pair and your Windows Server instance in Amazon EC2\. For more information, see [Securing a Windows Server instance in Amazon EC2 created from an Amazon Lightsail snapshot](amazon-lightsail-securing-windows-server-amazon-ec2-instances.md)\.
{ "pile_set_name": "Github" }
<?php /* * This file is part of the symfony package. * (c) 2004-2006 Fabien Potencier <[email protected]> * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ /** * sfSymfonyCommandApplication manages the symfony CLI. * * @package symfony * @subpackage command * @author Fabien Potencier <[email protected]> * @version SVN: $Id: sfSymfonyCommandApplication.class.php 20053 2009-07-09 12:49:20Z nicolas $ */ class sfSymfonyCommandApplication extends sfCommandApplication { protected $taskFiles = array(); /** * Configures the current symfony command application. */ public function configure() { if (!isset($this->options['symfony_lib_dir'])) { throw new sfInitializationException('You must pass a "symfony_lib_dir" option.'); } $configurationFile = getcwd().'/config/ProjectConfiguration.class.php'; if (is_readable($configurationFile)) { require_once $configurationFile; $configuration = new ProjectConfiguration(getcwd(), $this->dispatcher); } else { $configuration = new sfProjectConfiguration(getcwd(), $this->dispatcher); } // application $this->setName('symfony'); $this->setVersion(SYMFONY_VERSION); $this->loadTasks($configuration); } /** * Runs the current application. * * @param mixed $options The command line options * * @return integer 0 if everything went fine, or an error code */ public function run($options = null) { $this->handleOptions($options); $arguments = $this->commandManager->getArgumentValues(); if (!isset($arguments['task'])) { $arguments['task'] = 'list'; $this->commandOptions .= $arguments['task']; } $this->currentTask = $this->getTaskToExecute($arguments['task']); if ($this->currentTask instanceof sfCommandApplicationTask) { $this->currentTask->setCommandApplication($this); } $ret = $this->currentTask->runFromCLI($this->commandManager, $this->commandOptions); $this->currentTask = null; return $ret; } /** * Loads all available tasks. * * Looks for tasks in the symfony core, the current project and all project plugins. * * @param sfProjectConfiguration $configuration The project configuration */ public function loadTasks(sfProjectConfiguration $configuration) { // Symfony core tasks $dirs = array(sfConfig::get('sf_symfony_lib_dir').'/task'); // Plugin tasks foreach ($configuration->getPluginPaths() as $path) { if (is_dir($taskPath = $path.'/lib/task')) { $dirs[] = $taskPath; } } // project tasks $dirs[] = sfConfig::get('sf_lib_dir').'/task'; $finder = sfFinder::type('file')->name('*Task.class.php'); foreach ($finder->in($dirs) as $file) { $this->taskFiles[basename($file, '.class.php')] = $file; } // register local autoloader for tasks spl_autoload_register(array($this, 'autoloadTask')); // require tasks foreach ($this->taskFiles as $task => $file) { // forces autoloading of each task class class_exists($task, true); } // unregister local autoloader spl_autoload_unregister(array($this, 'autoloadTask')); } /** * Autoloads a task class * * @param string $class The task class name * * @return Boolean */ public function autoloadTask($class) { if (isset($this->taskFiles[$class])) { require_once $this->taskFiles[$class]; return true; } return false; } /** * @see sfCommandApplication */ public function getLongVersion() { return sprintf('%s version %s (%s)', $this->getName(), $this->formatter->format($this->getVersion(), 'INFO'), sfConfig::get('sf_symfony_lib_dir'))."\n"; } }
{ "pile_set_name": "Github" }
FROM golang:1.13 AS bosun_builder WORKDIR /bosun COPY . /bosun RUN make bosun scollector tsdbrelay FROM alpine:latest ARG PACKAGES="ca-certificates rsyslog bash libc6-compat curl libgd libpng libjpeg libwebp libjpeg-turbo cairo pango lua supervisor asciidoctor" ARG DOCKER_ROOT="docker" ENV DATA_DIR=/data ENV TERM xterm ENV TSDBRELAY_OPTS -b localhost:8070 -t opentsdb:4242 -l 0.0.0.0:5252 -redis localhost:9565 # Install dependencies RUN apk --update add apk-tools \ && apk add ${PACKAGES} # Copy Bosun from the build image WORKDIR /bosun RUN mkdir /scollector /tsdbrelay COPY --from=bosun_builder /bosun/bosun /bosun COPY --from=bosun_builder /bosun/scollector /scollector COPY --from=bosun_builder /bosun/tsdbrelay /tsdbrelay # Copy Bosun config COPY ${DOCKER_ROOT}/data/bosunrules.conf ${DATA_DIR}/ COPY ${DOCKER_ROOT}/data/bosun.toml ${DATA_DIR}/ COPY ${DOCKER_ROOT}/data/scollector.toml ${DATA_DIR}/ # Copy supervisor config COPY ${DOCKER_ROOT}/data/supervisord.conf ${DATA_DIR}/ EXPOSE 8070 5252 9565 VOLUME ["${DATA_DIR}"] CMD ["sh", "-c", "/usr/bin/supervisord -c ${DATA_DIR}/supervisord.conf"]
{ "pile_set_name": "Github" }
#!/bin/bash set -euo pipefail source $(dirname $0)/../../utils.sh TEST_ID=$(generate_test_id) echo "TEST_ID = $TEST_ID" ROOT=$(dirname $0)/../../.. pushd $ROOT/test/tests/test_huge_response cleanup() { clean_resource_by_id $TEST_ID rm -rf response.json popd } retryPost() { local fn=$1 log "Send huge JSON request body" set +e while true; do curl -X POST http://$FISSION_ROUTER/$fn \ -H "Content-Type: application/json" \ --data-binary "@generated.json" > response.json difftext=$(diff generated.json response.json) if [ -z "$difftext" ]; then break else echo "Receive truncated body" sleep 1 fi done set -e } export -f retryPost if [ -z "${TEST_NOCLEANUP:-}" ]; then trap cleanup EXIT else log "TEST_NOCLEANUP is set; not cleaning up test artifacts afterwards." fi env=go-$TEST_ID fn_poolmgr=hello-go-poolmgr-$TEST_ID log "Creating environment for Golang" fission env create --name $env --image $GO_RUNTIME_IMAGE --builder $GO_BUILDER_IMAGE --period 5 timeout 90 bash -c "wait_for_builder $env" pkgName=$(generate_test_id) fission package create --name $pkgName --src hello.go --env $env # wait for build to finish at most 90s timeout 90 bash -c "waitBuild $pkgName" log "Creating function for Golang" fission fn create --name $fn_poolmgr --env $env --pkg $pkgName --entrypoint Handler log "Creating route for function" fission route create --name $fn_poolmgr --function $fn_poolmgr --url /$fn_poolmgr --method POST log "Waiting for router & pools to catch up" sleep 5 log "Testing function" timeout 20 bash -c "retryPost $fn_poolmgr" log "Test PASSED"
{ "pile_set_name": "Github" }
/* * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS HEADER. * * Copyright (c) 2013-2017 Oracle and/or its affiliates. All rights reserved. * * The contents of this file are subject to the terms of either the GNU * General Public License Version 2 only ("GPL") or the Common Development * and Distribution License("CDDL") (collectively, the "License"). You * may not use this file except in compliance with the License. You can * obtain a copy of the License at * https://oss.oracle.com/licenses/CDDL+GPL-1.1 * or LICENSE.txt. See the License for the specific * language governing permissions and limitations under the License. * * When distributing the software, include this License Header Notice in each * file and include the License file at LICENSE.txt. * * GPL Classpath Exception: * Oracle designates this particular file as subject to the "Classpath" * exception as provided by Oracle in the GPL Version 2 section of the License * file that accompanied this code. * * Modifications: * If applicable, add the following below the License Header, with the fields * enclosed by brackets [] replaced by your own identifying information: * "Portions Copyright [year] [name of copyright owner]" * * Contributor(s): * If you wish your version of this file to be governed by only the CDDL or * only the GPL Version 2, indicate your decision by adding "[Contributor] * elects to include this software in this distribution under the [CDDL or GPL * Version 2] license." If you don't indicate a single choice of license, a * recipient has the option to distribute your version of this file under * either the CDDL, the GPL Version 2 or to extend the choice of license to * its licensees as provided above. However, if you add GPL Version 2 code * and therefore, elected the GPL Version 2 license, then the option applies * only if the new code is made subject to such option by the copyright * holder. */ /** * Jersey internal package supporting Jersey CDI integration. */ package org.glassfish.jersey.ext.cdi1x.internal;
{ "pile_set_name": "Github" }
/* Copyright 2014 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 runtime import ( "io" "net/url" "k8s.io/apimachinery/pkg/runtime/schema" ) const ( // APIVersionInternal may be used if you are registering a type that should not // be considered stable or serialized - it is a convention only and has no // special behavior in this package. APIVersionInternal = "__internal" ) // GroupVersioner refines a set of possible conversion targets into a single option. type GroupVersioner interface { // KindForGroupVersionKinds returns a desired target group version kind for the given input, or returns ok false if no // target is known. In general, if the return target is not in the input list, the caller is expected to invoke // Scheme.New(target) and then perform a conversion between the current Go type and the destination Go type. // Sophisticated implementations may use additional information about the input kinds to pick a destination kind. KindForGroupVersionKinds(kinds []schema.GroupVersionKind) (target schema.GroupVersionKind, ok bool) } // Encoder writes objects to a serialized form type Encoder interface { // Encode writes an object to a stream. Implementations may return errors if the versions are // incompatible, or if no conversion is defined. Encode(obj Object, w io.Writer) error } // Decoder attempts to load an object from data. type Decoder interface { // Decode attempts to deserialize the provided data using either the innate typing of the scheme or the // default kind, group, and version provided. It returns a decoded object as well as the kind, group, and // version from the serialized data, or an error. If into is non-nil, it will be used as the target type // and implementations may choose to use it rather than reallocating an object. However, the object is not // guaranteed to be populated. The returned object is not guaranteed to match into. If defaults are // provided, they are applied to the data by default. If no defaults or partial defaults are provided, the // type of the into may be used to guide conversion decisions. Decode(data []byte, defaults *schema.GroupVersionKind, into Object) (Object, *schema.GroupVersionKind, error) } // Serializer is the core interface for transforming objects into a serialized format and back. // Implementations may choose to perform conversion of the object, but no assumptions should be made. type Serializer interface { Encoder Decoder } // Codec is a Serializer that deals with the details of versioning objects. It offers the same // interface as Serializer, so this is a marker to consumers that care about the version of the objects // they receive. type Codec Serializer // ParameterCodec defines methods for serializing and deserializing API objects to url.Values and // performing any necessary conversion. Unlike the normal Codec, query parameters are not self describing // and the desired version must be specified. type ParameterCodec interface { // DecodeParameters takes the given url.Values in the specified group version and decodes them // into the provided object, or returns an error. DecodeParameters(parameters url.Values, from schema.GroupVersion, into Object) error // EncodeParameters encodes the provided object as query parameters or returns an error. EncodeParameters(obj Object, to schema.GroupVersion) (url.Values, error) } // Framer is a factory for creating readers and writers that obey a particular framing pattern. type Framer interface { NewFrameReader(r io.ReadCloser) io.ReadCloser NewFrameWriter(w io.Writer) io.Writer } // SerializerInfo contains information about a specific serialization format type SerializerInfo struct { // MediaType is the value that represents this serializer over the wire. MediaType string // EncodesAsText indicates this serializer can be encoded to UTF-8 safely. EncodesAsText bool // Serializer is the individual object serializer for this media type. Serializer Serializer // PrettySerializer, if set, can serialize this object in a form biased towards // readability. PrettySerializer Serializer // StreamSerializer, if set, describes the streaming serialization format // for this media type. StreamSerializer *StreamSerializerInfo } // StreamSerializerInfo contains information about a specific stream serialization format type StreamSerializerInfo struct { // EncodesAsText indicates this serializer can be encoded to UTF-8 safely. EncodesAsText bool // Serializer is the top level object serializer for this type when streaming Serializer // Framer is the factory for retrieving streams that separate objects on the wire Framer } // NegotiatedSerializer is an interface used for obtaining encoders, decoders, and serializers // for multiple supported media types. This would commonly be accepted by a server component // that performs HTTP content negotiation to accept multiple formats. type NegotiatedSerializer interface { // SupportedMediaTypes is the media types supported for reading and writing single objects. SupportedMediaTypes() []SerializerInfo // EncoderForVersion returns an encoder that ensures objects being written to the provided // serializer are in the provided group version. EncoderForVersion(serializer Encoder, gv GroupVersioner) Encoder // DecoderForVersion returns a decoder that ensures objects being read by the provided // serializer are in the provided group version by default. DecoderToVersion(serializer Decoder, gv GroupVersioner) Decoder } // StorageSerializer is an interface used for obtaining encoders, decoders, and serializers // that can read and write data at rest. This would commonly be used by client tools that must // read files, or server side storage interfaces that persist restful objects. type StorageSerializer interface { // SupportedMediaTypes are the media types supported for reading and writing objects. SupportedMediaTypes() []SerializerInfo // UniversalDeserializer returns a Serializer that can read objects in multiple supported formats // by introspecting the data at rest. UniversalDeserializer() Decoder // EncoderForVersion returns an encoder that ensures objects being written to the provided // serializer are in the provided group version. EncoderForVersion(serializer Encoder, gv GroupVersioner) Encoder // DecoderForVersion returns a decoder that ensures objects being read by the provided // serializer are in the provided group version by default. DecoderToVersion(serializer Decoder, gv GroupVersioner) Decoder } // NestedObjectEncoder is an optional interface that objects may implement to be given // an opportunity to encode any nested Objects / RawExtensions during serialization. type NestedObjectEncoder interface { EncodeNestedObjects(e Encoder) error } // NestedObjectDecoder is an optional interface that objects may implement to be given // an opportunity to decode any nested Objects / RawExtensions during serialization. type NestedObjectDecoder interface { DecodeNestedObjects(d Decoder) error } /////////////////////////////////////////////////////////////////////////////// // Non-codec interfaces type ObjectDefaulter interface { // Default takes an object (must be a pointer) and applies any default values. // Defaulters may not error. Default(in Object) } type ObjectVersioner interface { ConvertToVersion(in Object, gv GroupVersioner) (out Object, err error) } // ObjectConvertor converts an object to a different version. type ObjectConvertor interface { // Convert attempts to convert one object into another, or returns an error. This // method does not mutate the in object, but the in and out object might share data structures, // i.e. the out object cannot be mutated without mutating the in object as well. // The context argument will be passed to all nested conversions. Convert(in, out, context interface{}) error // ConvertToVersion takes the provided object and converts it the provided version. This // method does not mutate the in object, but the in and out object might share data structures, // i.e. the out object cannot be mutated without mutating the in object as well. // This method is similar to Convert() but handles specific details of choosing the correct // output version. ConvertToVersion(in Object, gv GroupVersioner) (out Object, err error) ConvertFieldLabel(gvk schema.GroupVersionKind, label, value string) (string, string, error) } // ObjectTyper contains methods for extracting the APIVersion and Kind // of objects. type ObjectTyper interface { // ObjectKinds returns the all possible group,version,kind of the provided object, true if // the object is unversioned, or an error if the object is not recognized // (IsNotRegisteredError will return true). ObjectKinds(Object) ([]schema.GroupVersionKind, bool, error) // Recognizes returns true if the scheme is able to handle the provided version and kind, // or more precisely that the provided version is a possible conversion or decoding // target. Recognizes(gvk schema.GroupVersionKind) bool } // ObjectCreater contains methods for instantiating an object by kind and version. type ObjectCreater interface { New(kind schema.GroupVersionKind) (out Object, err error) } // ResourceVersioner provides methods for setting and retrieving // the resource version from an API object. type ResourceVersioner interface { SetResourceVersion(obj Object, version string) error ResourceVersion(obj Object) (string, error) } // SelfLinker provides methods for setting and retrieving the SelfLink field of an API object. type SelfLinker interface { SetSelfLink(obj Object, selfLink string) error SelfLink(obj Object) (string, error) // Knowing Name is sometimes necessary to use a SelfLinker. Name(obj Object) (string, error) // Knowing Namespace is sometimes necessary to use a SelfLinker Namespace(obj Object) (string, error) } // Object interface must be supported by all API types registered with Scheme. Since objects in a scheme are // expected to be serialized to the wire, the interface an Object must provide to the Scheme allows // serializers to set the kind, version, and group the object is represented as. An Object may choose // to return a no-op ObjectKindAccessor in cases where it is not expected to be serialized. type Object interface { GetObjectKind() schema.ObjectKind DeepCopyObject() Object } // Unstructured objects store values as map[string]interface{}, with only values that can be serialized // to JSON allowed. type Unstructured interface { Object // UnstructuredContent returns a non-nil map with this object's contents. Values may be // []interface{}, map[string]interface{}, or any primitive type. Contents are typically serialized to // and from JSON. SetUnstructuredContent should be used to mutate the contents. UnstructuredContent() map[string]interface{} // SetUnstructuredContent updates the object content to match the provided map. SetUnstructuredContent(map[string]interface{}) // IsList returns true if this type is a list or matches the list convention - has an array called "items". IsList() bool // EachListItem should pass a single item out of the list as an Object to the provided function. Any // error should terminate the iteration. If IsList() returns false, this method should return an error // instead of calling the provided function. EachListItem(func(Object) error) error }
{ "pile_set_name": "Github" }
/* am7990 (lance) definitions * * This is an extension to the Linux operating system, and is covered by * same GNU General Public License that covers that work. * * Michael Hipp * email: [email protected] * * sources: (mail me or ask archie if you need them) * crynwr-packet-driver */ /* * Control and Status Register 0 (CSR0) bit definitions * (R=Readable) (W=Writeable) (S=Set on write) (C-Clear on write) * */ #define CSR0_ERR 0x8000 /* Error summary (R) */ #define CSR0_BABL 0x4000 /* Babble transmitter timeout error (RC) */ #define CSR0_CERR 0x2000 /* Collision Error (RC) */ #define CSR0_MISS 0x1000 /* Missed packet (RC) */ #define CSR0_MERR 0x0800 /* Memory Error (RC) */ #define CSR0_RINT 0x0400 /* Receiver Interrupt (RC) */ #define CSR0_TINT 0x0200 /* Transmit Interrupt (RC) */ #define CSR0_IDON 0x0100 /* Initialization Done (RC) */ #define CSR0_INTR 0x0080 /* Interrupt Flag (R) */ #define CSR0_INEA 0x0040 /* Interrupt Enable (RW) */ #define CSR0_RXON 0x0020 /* Receiver on (R) */ #define CSR0_TXON 0x0010 /* Transmitter on (R) */ #define CSR0_TDMD 0x0008 /* Transmit Demand (RS) */ #define CSR0_STOP 0x0004 /* Stop (RS) */ #define CSR0_STRT 0x0002 /* Start (RS) */ #define CSR0_INIT 0x0001 /* Initialize (RS) */ #define CSR0_CLRALL 0x7f00 /* mask for all clearable bits */ /* * Initialization Block Mode operation Bit Definitions. */ #define M_PROM 0x8000 /* Promiscuous Mode */ #define M_INTL 0x0040 /* Internal Loopback */ #define M_DRTY 0x0020 /* Disable Retry */ #define M_COLL 0x0010 /* Force Collision */ #define M_DTCR 0x0008 /* Disable Transmit CRC) */ #define M_LOOP 0x0004 /* Loopback */ #define M_DTX 0x0002 /* Disable the Transmitter */ #define M_DRX 0x0001 /* Disable the Receiver */ /* * Receive message descriptor bit definitions. */ #define RCV_OWN 0x80 /* owner bit 0 = host, 1 = lance */ #define RCV_ERR 0x40 /* Error Summary */ #define RCV_FRAM 0x20 /* Framing Error */ #define RCV_OFLO 0x10 /* Overflow Error */ #define RCV_CRC 0x08 /* CRC Error */ #define RCV_BUF_ERR 0x04 /* Buffer Error */ #define RCV_START 0x02 /* Start of Packet */ #define RCV_END 0x01 /* End of Packet */ /* * Transmit message descriptor bit definitions. */ #define XMIT_OWN 0x80 /* owner bit 0 = host, 1 = lance */ #define XMIT_ERR 0x40 /* Error Summary */ #define XMIT_RETRY 0x10 /* more the 1 retry needed to Xmit */ #define XMIT_1_RETRY 0x08 /* one retry needed to Xmit */ #define XMIT_DEF 0x04 /* Deferred */ #define XMIT_START 0x02 /* Start of Packet */ #define XMIT_END 0x01 /* End of Packet */ /* * transmit status (2) (valid if XMIT_ERR == 1) */ #define XMIT_TDRMASK 0x03ff /* time-domain-reflectometer-value */ #define XMIT_RTRY 0x0400 /* Failed after 16 retransmissions */ #define XMIT_LCAR 0x0800 /* Loss of Carrier */ #define XMIT_LCOL 0x1000 /* Late collision */ #define XMIT_RESERV 0x2000 /* Reserved */ #define XMIT_UFLO 0x4000 /* Underflow (late memory) */ #define XMIT_BUFF 0x8000 /* Buffering error (no ENP) */ struct init_block { unsigned short mode; unsigned char eaddr[6]; unsigned char filter[8]; /* bit 29-31: number of rmd's (power of 2) */ u32 rrp; /* receive ring pointer (align 8) */ /* bit 29-31: number of tmd's (power of 2) */ u32 trp; /* transmit ring pointer (align 8) */ }; struct rmd { /* Receive Message Descriptor */ union { volatile u32 buffer; struct { volatile unsigned char dummy[3]; volatile unsigned char status; } s; } u; volatile short blen; volatile unsigned short mlen; }; struct tmd { union { volatile u32 buffer; struct { volatile unsigned char dummy[3]; volatile unsigned char status; } s; } u; volatile unsigned short blen; volatile unsigned short status2; };
{ "pile_set_name": "Github" }
package kubernetes import ( "context" "strings" v1 "github.com/solo-io/gloo/projects/gloo/pkg/api/v1" "github.com/solo-io/solo-kit/pkg/api/v1/resources/core" metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" "github.com/solo-io/gloo/projects/gloo/pkg/plugins/kubernetes/serviceconverter" kubev1 "k8s.io/api/core/v1" . "github.com/onsi/ginkgo" . "github.com/onsi/ginkgo/extensions/table" . "github.com/onsi/gomega" ) var _ = Describe("UdsConvert", func() { createUpstream := DefaultUpstreamConverter().CreateUpstream It("should truncate long names", func() { name := UpstreamName(strings.Repeat("y", 120), "gloo-system", 12) Expect(name).To(HaveLen(63)) }) It("should handle collisions", func() { name := UpstreamName(strings.Repeat("y", 120), "gloo-system", 12) name2 := UpstreamName(strings.Repeat("y", 120)+"2", "gloo-system", 12) Expect(name).ToNot(Equal(name2)) }) Context("h2 upstream", func() { It("should not normally create upstream with grpc service spec", func() { svc := &kubev1.Service{ Spec: kubev1.ServiceSpec{}, } svc.Name = "test" svc.Namespace = "test" port := kubev1.ServicePort{ Port: 123, } up := createUpstream(context.TODO(), svc, port) spec := up.GetKube().GetServiceSpec() Expect(spec.GetGrpc()).To(BeNil()) }) It("should create upstream with use_http2=true when annotation exists", func() { svc := &kubev1.Service{ Spec: kubev1.ServiceSpec{}, } svc.Annotations = make(map[string]string) svc.Annotations[serviceconverter.GlooH2Annotation] = "true" svc.Name = "test" svc.Namespace = "test" port := kubev1.ServicePort{ Port: 123, } up := createUpstream(context.TODO(), svc, port) Expect(up.GetUseHttp2().GetValue()).To(BeTrue()) }) It("should save discovery metadata to upstream", func() { testLabels := make(map[string]string) testLabels["foo"] = "bar" svc := &kubev1.Service{ Spec: kubev1.ServiceSpec{}, } svc.Labels = testLabels svc.Name = "test" svc.Namespace = "test" port := kubev1.ServicePort{ Port: 123, } up := createUpstream(context.TODO(), svc, port) Expect(up.GetDiscoveryMetadata().Labels).To(Equal(testLabels)) }) DescribeTable("should create upstream with use_http2=true when port name starts with known prefix", func(portname string) { svc := &kubev1.Service{ Spec: kubev1.ServiceSpec{}, } svc.Name = "test" svc.Namespace = "test" port := kubev1.ServicePort{ Port: 123, Name: portname, } up := createUpstream(context.TODO(), svc, port) Expect(up.GetUseHttp2().GetValue()).To(BeTrue()) }, Entry("exactly grpc", "grpc"), Entry("prefix grpc", "grpc-test"), Entry("exactly h2", "h2"), Entry("prefix h2", "h2-test"), Entry("exactly http2", "http2"), ) DescribeTable("should create upstream with upstreamSslConfig when SSL annotations are present", func(annotations map[string]string, expectedCfg *v1.UpstreamSslConfig) { svc := &kubev1.Service{ Spec: kubev1.ServiceSpec{}, ObjectMeta: metav1.ObjectMeta{ Annotations: annotations, }, } svc.Name = "test" svc.Namespace = "test" port := kubev1.ServicePort{ Port: 123, } up := createUpstream(context.TODO(), svc, port) Expect(up.GetSslConfig()).To(Equal(expectedCfg)) }, Entry("using ssl secret", map[string]string{ serviceconverter.GlooSslSecretAnnotation: "mysecret", }, &v1.UpstreamSslConfig{ SslSecrets: &v1.UpstreamSslConfig_SecretRef{ SecretRef: &core.ResourceRef{Name: "mysecret", Namespace: "test"}, }, }), Entry("using ssl secret on the target port", map[string]string{ serviceconverter.GlooSslSecretAnnotation: "123:mysecret", }, &v1.UpstreamSslConfig{ SslSecrets: &v1.UpstreamSslConfig_SecretRef{ SecretRef: &core.ResourceRef{Name: "mysecret", Namespace: "test"}, }, }), Entry("using ssl secret on a different target port", map[string]string{ serviceconverter.GlooSslSecretAnnotation: "456:mysecret", }, nil), Entry("using ssl files", map[string]string{ serviceconverter.GlooSslTlsCertAnnotation: "cert", serviceconverter.GlooSslTlsKeyAnnotation: "key", serviceconverter.GlooSslRootCaAnnotation: "ca", }, &v1.UpstreamSslConfig{ SslSecrets: &v1.UpstreamSslConfig_SslFiles{ SslFiles: &v1.SSLFiles{ TlsCert: "cert", TlsKey: "key", RootCa: "ca", }, }, }), Entry("using ssl files on the target port", map[string]string{ serviceconverter.GlooSslTlsCertAnnotation: "123:cert", serviceconverter.GlooSslTlsKeyAnnotation: "123:key", serviceconverter.GlooSslRootCaAnnotation: "123:ca", }, &v1.UpstreamSslConfig{ SslSecrets: &v1.UpstreamSslConfig_SslFiles{ SslFiles: &v1.SSLFiles{ TlsCert: "cert", TlsKey: "key", RootCa: "ca", }, }, }), Entry("using ssl files on a different target port", map[string]string{ serviceconverter.GlooSslTlsCertAnnotation: "456:cert", serviceconverter.GlooSslTlsKeyAnnotation: "456:key", serviceconverter.GlooSslRootCaAnnotation: "456:ca", }, nil), ) }) })
{ "pile_set_name": "Github" }
package client import ( "time" "github.com/aws/aws-sdk-go/aws/request" ) // NoOpRetryer provides a retryer that performs no retries. // It should be used when we do not want retries to be performed. type NoOpRetryer struct{} // MaxRetries returns the number of maximum returns the service will use to make // an individual API; For NoOpRetryer the MaxRetries will always be zero. func (d NoOpRetryer) MaxRetries() int { return 0 } // ShouldRetry will always return false for NoOpRetryer, as it should never retry. func (d NoOpRetryer) ShouldRetry(_ *request.Request) bool { return false } // RetryRules returns the delay duration before retrying this request again; // since NoOpRetryer does not retry, RetryRules always returns 0. func (d NoOpRetryer) RetryRules(_ *request.Request) time.Duration { return 0 }
{ "pile_set_name": "Github" }
;rockyone pour MI-3 MI-9 22/01/2017 ; ;add load image uncompressed 08.04.2018 27.03.2018 ; ; OPEN/SAVE PABLO v1.1 .PPP ; --------------------------- ; This format does not contain a color cycle ; and does not bytes of resolution ; ; ;+ 0 33 byte "PABLO... Header in ascii ;+ 34 2 byte $0d,$0a End string ;+ 36 ? byte Size image data+38 in ascii ;+ ? 2 byte $0d,$0a End string ;+ ? 1 word $00,$1d Flag PPP and PA3 ;+ ? 1 word Size image data +38 ;+ ? 16 word Color palette ;+ ? ? word Words data ;+ ? ? byte Bytes of control ; eof-2 1 word Number of bytes of control ;-------------------------------------------------------------------------- ; Res% 0 = PPP ; 2 = PA3 ; ;OPEN The data is reorganiezd in But+33001 for Tny_Open ; Ppp_Os( L Source, L But+33000, 0 ) yes +33000 ; Tny_Open( L But+33000, L But, L dummy ) yes +33000 ; The two routine return -2 In low d0 if bad file ; ; -------------------------------------------------------- ; ;SAVE Tny_Save( L Source, L But, L dummy ) ; Ppp_Os( L But, L But+33000, 1 ) return file size in high d0 ; ;dummy est un buffer pour les cycle de couleur pour les image TNY. ; Inutile ici mais doit exister. 32 octets nul ; ;-------------------------------------------------------------------------- movem.l d1-d7/a0-a6,-(sp) movem.l 60(sp),a0-a1 lea.l header(pc),a3 moveq.l #35,d1 ; lenght of header -1 tst.w 68(sp) ; open or save ? bne.s save ;.......................................................................... ; ; CONVERT PPP TO TNY ;.......................................................................... moveq.l #-2,d0 ; R. bad file test_h: cmpm.b (a3)+,(a0)+ ; test header bne.s end_prg dbra.w d1,test_h jump: cmpi.b #$0a,(a0)+ ; skip file size in ascii bne.s jump addq.l #1,a1 move.b (a0)+,(a1)+ ; image resolution tst.b (a0)+ ; image compressed ? bne.s convert ; yes ;......................................................................... addq.l #2,a0 ; jump file size in hexa bsr palette ; a0 to a1 cpt d3 movea.l a0,a6 move.l #32000,d6 bsr copy_byte ; a6 to a1 d6 to cpt d3 moveq.l #2,d0 ; flag for basic, image uncompressed bra.s end_prg ;......................................................................... convert: movea.l a0,a4 move.b (a0)+,d7 ; read size data of the image lsl.w #8,d7 move.b (a0)+,d7 lea.l -4(a4,d7.w),a4 ; point to eof file -2 move.b (a4)+,d6 ; read number of bytes of control lsl.w #8,d6 ; move.b (a4),d6 ; sub.w d6,d7 ; Calculating the size of data of image subi.w #38,d7 ; Word-38 bsr.s palette ; a0 to a1 cpt d3 move.w d6,(a1)+ ; write the number of byte of control move.w d7,d5 ; write the number word of image data lsr.w #1,d5 ; move.w d5,(a1)+ ; ; ; Source a0 point to words image data ; ; Source a6 point to bytes of control ; ; But a1 " " " " " lea.l 0(a0,d7.w),a6 bsr.s copy_byte ; a6 to a1 d6 to cpt d3 bsr.s copy_word ; a0 to a 1 cpt d7 moveq.l #0,d0 ;R. not error ;.......................................................................... end_prg: movem.l (sp)+,d1-d7/a0-a6 rts ;.......................................................................... ; ; CONVERT TNY TO PPP ;......................................................................... save: addq.l #1,a0 ; tny read to buf+1 movea.l a1,a4 ; to calculate file size move.b (a0)+,d0 cmp.b #3,d0 ; Cycle color in Source ? bmi.s not_cycle ; No ! subi.b #3,d0 addq.l #4,a0 ; Jump color cycle not_cycle: lea.l 32(a0),a6 ; Source point to number of byte of control write_header: move.b (a3)+,(a1)+ dbra.w d1,write_header move.w (a6)+,d6 ; read the number of byte of control move.w (a6)+,d7 ; read the number of word of data ; ; Source a6 point to first bytes of control lsl.w #1,d7 ; move.w d6,d5 ; total data +38 add.w d7,d5 ; addi.w #38,d5 ; bsr.s hex_ascii ; write total data in ascii move.b #$0d,(a1)+ move.b #$0a,(a1)+ move.b d0,(a1)+ ; write image resolution move.b #$1d,(a1)+ ; write byte compressed move.b d5,1(a1) ; write total data lsr.w #8,d5 move.b d5,(a1) addq.l #2,a1 bsr.s palette ; a6 to a1 lea.l 0(a6,d6.w),a0 ; Source a0 point to address word data bsr.s copy_word ; a0 to a1 bsr.s copy_byte ; a6 to a1 move.b d6,1(a1) ; write number bytes of control lsr.w #8,d6 move.b d6,(a1) addq.l #2,a1 suba.l a4,a1 ; calculat file size move.l a1,d0 ; return file size bra.s end_prg ;-------------------------------------------------------------------------- palette: moveq.l #31,d3 ; 16 color color: move.b (a0)+,(a1)+ dbra.w d3,color rts ;....................................... copy_word: subq.b #1,d7 copy_w: move.b (a0)+,(a1)+ dbra.w d7,copy_w rts ;....................................... copy_byte: move.w d6,d3 subq.b #1,d3 copy_b: move.b (a6)+,(a1)+ dbra.w d3,copy_b rts ;...................................... hex_ascii: moveq.l #0,d2 move.w d5,d1 decimal: ext.l d1 beq.s ascii divu.w #10,d1 swap d1 lsl.l #4,d2 add.b d1,d2 addi.b #1,d2 swap d1 bra.s decimal ascii: move.b d2,(a1) andi.b #$f,(a1) addi.b #$2f,(a1)+ lsr.l #4,d2 bne.s ascii rts ;...................................... header: dc.b 'PABLO PACKED PICTURE: Groupe CDND ',$0d,$0a end ;**************************************************************************
{ "pile_set_name": "Github" }
## Design great widgets https://developer.apple.com/wwdc20/10103 Presenters: _Example Guy, Another Person_ ##### TO-DO! You can contribute to this session, please see [CONTRIBUTING.md](CONTRIBUTING.md)
{ "pile_set_name": "Github" }
/* Copyright 2017 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 v2alpha1 import ( serializer "k8s.io/apimachinery/pkg/runtime/serializer" "k8s.io/client-go/kubernetes/scheme" v2alpha1 "k8s.io/client-go/pkg/apis/autoscaling/v2alpha1" rest "k8s.io/client-go/rest" ) type AutoscalingV2alpha1Interface interface { RESTClient() rest.Interface HorizontalPodAutoscalersGetter } // AutoscalingV2alpha1Client is used to interact with features provided by the autoscaling group. type AutoscalingV2alpha1Client struct { restClient rest.Interface } func (c *AutoscalingV2alpha1Client) HorizontalPodAutoscalers(namespace string) HorizontalPodAutoscalerInterface { return newHorizontalPodAutoscalers(c, namespace) } // NewForConfig creates a new AutoscalingV2alpha1Client for the given config. func NewForConfig(c *rest.Config) (*AutoscalingV2alpha1Client, error) { config := *c if err := setConfigDefaults(&config); err != nil { return nil, err } client, err := rest.RESTClientFor(&config) if err != nil { return nil, err } return &AutoscalingV2alpha1Client{client}, nil } // NewForConfigOrDie creates a new AutoscalingV2alpha1Client for the given config and // panics if there is an error in the config. func NewForConfigOrDie(c *rest.Config) *AutoscalingV2alpha1Client { client, err := NewForConfig(c) if err != nil { panic(err) } return client } // New creates a new AutoscalingV2alpha1Client for the given RESTClient. func New(c rest.Interface) *AutoscalingV2alpha1Client { return &AutoscalingV2alpha1Client{c} } func setConfigDefaults(config *rest.Config) error { gv := v2alpha1.SchemeGroupVersion config.GroupVersion = &gv config.APIPath = "/apis" config.NegotiatedSerializer = serializer.DirectCodecFactory{CodecFactory: scheme.Codecs} if config.UserAgent == "" { config.UserAgent = rest.DefaultKubernetesUserAgent() } return nil } // RESTClient returns a RESTClient that is used to communicate // with API server by this client implementation. func (c *AutoscalingV2alpha1Client) RESTClient() rest.Interface { if c == nil { return nil } return c.restClient }
{ "pile_set_name": "Github" }
class HelloState(object): def __init__(self): self.calls = [] def sayHello(self, int_value=None, string_value=None): print(int_value, string_value) self.calls.append((int_value, string_value)) return "Said hello to {0}".format(string_value) class Java: implements = ["py4j.examples.IHello"] class SimpleHello(object): def sayHello(self, int_value=None, string_value=None): print(int_value, string_value) return "Said hello to {0}".format(string_value) class Java: implements = ["py4j.examples.IHello"] class RecursiveHello(object): def __init__(self, example_obj): self.example_obj = example_obj def sayHello(self, int_value=None, string_value=None): print(int_value, string_value) if int_value is None: print("Hello with no param") return self.example_obj.callHello2(self) else: print("Hello with 2 params") return "Said hello to {0}".format(string_value) class Java: implements = ["py4j.examples.IHello"] class JavaHello(object): def __init__(self): self.clientserver = None def sayHello(self, int_value=None, string_value=None): ar = self.clientserver.jvm.java.util.ArrayList() ar.append("1") print(ar) other_value = self.clientserver.jvm.java.lang.\ System.currentTimeMillis() print(int_value, string_value, other_value) return "Said hello to {0}".format(string_value) class Java: implements = ["py4j.examples.IHello"] class PythonPing(object): def __init__(self, fail=False): self.fail = fail def ping1(self, obj): return obj.pong1(self) def ping2(self, obj): return obj.pong2(self) def ping3(self, obj): if self.fail: raise ValueError("Some Exception") else: return obj.pong3(self) class Java: implements = ["py4j.examples.IPing"]
{ "pile_set_name": "Github" }
/* Copyright (c) 2008-2015, Avian Contributors Permission to use, copy, modify, and/or distribute this software for any purpose with or without fee is hereby granted, provided that the above copyright notice and this permission notice appear in all copies. There is NO WARRANTY for this software. See license.txt for details. */ package avian; import java.io.ByteArrayOutputStream; public class Utf8 { public static boolean test(Object data) { if (!(data instanceof byte[])) return false; byte[] b = (byte[])data; for (int i = 0; i < b.length; ++i) { if (((int)b[i] & 0x080) != 0) return true; } return false; } public static byte[] encode(char[] s16, int offset, int length) { ByteArrayOutputStream buf = new ByteArrayOutputStream(); for (int i = offset; i < offset+length; ++i) { char c = s16[i]; if (c == '\u0000') { // null char buf.write(0); buf.write(0); } else if (c < 0x080) { // 1 byte char buf.write(c); } else if (c < 0x0800) { // 2 byte char buf.write(0x0c0 | (c >>> 6)); buf.write(0x080 | (c & 0x03f)); } else { // 3 byte char buf.write(0x0e0 | ((c >>> 12) & 0x0f)); buf.write(0x080 | ((c >>> 6) & 0x03f)); buf.write(0x080 | (c & 0x03f)); } } return buf.toByteArray(); } public static Object decode(byte[] s8, int offset, int length) { Object buf = new byte[length]; boolean isMultiByte = false; int i=offset, j=0; while (i < offset+length) { int x = s8[i++]; if ((x & 0x080) == 0x0) { // 1 byte char if (x == 0) { // 2 byte null char if (i == offset + length) { return null; } ++ i; } cram(buf, j++, x); } else if ((x & 0x0e0) == 0x0c0) { // 2 byte char if (i == offset + length) { return null; } if (!isMultiByte) { buf = widen(buf, j, length-1); isMultiByte = true; } int y = s8[i++]; cram(buf, j++, ((x & 0x1f) << 6) | (y & 0x3f)); } else if ((x & 0x0f0) == 0x0e0) { // 3 byte char if (i + 1 >= offset + length) { return null; } if (!isMultiByte) { buf = widen(buf, j, length-2); isMultiByte = true; } int y = s8[i++]; int z = s8[i++]; cram(buf, j++, ((x & 0xf) << 12) | ((y & 0x3f) << 6) | (z & 0x3f)); } } return trim(buf, j); } public static char[] decode16(byte[] s8, int offset, int length) { Object decoded = decode(s8, offset, length); if (decoded == null) { return null; } else if (decoded instanceof char[]) { return (char[])decoded; } else { return (char[])widen(decoded, length, length); } } private static void cram(Object data, int index, int val) { if (data instanceof byte[]) ((byte[])data)[index] = (byte)val; else ((char[])data)[index] = (char)val; } private static Object widen(Object data, int length, int capacity) { byte[] src = (byte[])data; char[] result = new char[capacity]; for (int i = 0; i < length; ++i) result[i] = (char)((int)src[i] & 0x0ff); return result; } private static Object trim(Object data, int length) { if (data instanceof byte[]) return data; if (((char[])data).length == length) return data; char[] result = new char[length]; System.arraycopy(data, 0, result, 0, length); return result; } }
{ "pile_set_name": "Github" }
<template> <div ref='dom' class='charts chart-pie'></div> </template> <script> import echarts from 'echarts' import tdTheme from './theme.json' echarts.registerTheme('tdTheme', tdTheme) export default { name: 'ChartPie', props: { value: Array, text: String, subtext: String }, mounted () { this.$nextTick(() => { let legend = this.value.map(_ => _.name) let option = { title: { text: this.text, subtext: this.subtext, x: 'center' }, tooltip: { trigger: 'item', formatter: '{a} <br/>{b} : {c} ({d}%)' }, legend: { orient: 'vertical', left: 'left', data: legend }, series: [ { type: 'pie', radius: '55%', center: ['50%', '60%'], data: this.value, itemStyle: { emphasis: { shadowBlur: 10, shadowOffsetX: 0, shadowColor: 'rgba(0, 0, 0, 0.5)' } } } ] } let dom = echarts.init(this.$refs.dom, 'tdTheme') dom.setOption(option) }) }, watch: { value (value) { let legend = value.map(_ => _.name) let option = { title: { text: this.text, subtext: this.subtext, x: 'center' }, tooltip: { trigger: 'item', formatter: '{a} <br/>{b} : {c} ({d}%)' }, legend: { orient: 'vertical', left: 'left', data: legend }, series: [ { type: 'pie', radius: '55%', center: ['50%', '60%'], data: this.value, itemStyle: { emphasis: { shadowBlur: 10, shadowOffsetX: 0, shadowColor: 'rgba(0, 0, 0, 0.5)' } } } ] } let dom = echarts.init(this.$refs.dom, 'tdTheme') dom.setOption(option) } } } </script> <style lang='less'> .charts { // } </style>
{ "pile_set_name": "Github" }
{ "url": "https:\/\/api-v2launch.trakt.tv\/shows\/doctor-who-2005\/seasons\/4\/episodes?extended=full,images", "headers": { "Server": " cloudflare-nginx", "Date": " Sun, 11 Jan 2015 21", "Content-Type": " application\/json; charset=utf-8", "Transfer-Encoding": " chunked", "Connection": " keep-alive", "Set-Cookie": " __cfduid=d16ca3ec0caf4e42f389106e3e49101ac1421012047; expires=Mon, 11-Jan-16 21", "Cache-Control": " public, max-age=86400", "ETag": " W\/\"423d8837c5e0f1b9658af32773a58c56\"", "Expires": " Mon, 12 Jan 2015 21", "Status": " 200 OK", "Vary": " Accept-Encoding", "X-Content-Type-Options": " nosniff", "X-Frame-Options": " SAMEORIGIN", "X-Powered-By": " Phusion Passenger 4.0.57", "X-Request-Id": " bcd1334f-3939-4758-bea0-df26923c265d", "X-Runtime": " 0.153230", "X-XSS-Protection": " 1; mode=block", "CF-Cache-Status": " HIT", "CF-RAY": " 1a743c8ef21a00e0-AMS" }, "content": "[{\"season\":4,\"number\":1,\"title\":\"Partners in Crime\",\"ids\":{\"trakt\":951471,\"tvdb\":357056,\"imdb\":\"\",\"tmdb\":941505,\"tvrage\":null},\"number_abs\":null,\"overview\":\"Location: London\\nDate: 2009\\nEnemies: Adipose, Miss Foster\\n\\nDuring an alien emergency in London, a woman called Donna Noble must search for an old friend who can save the day - a man named the Doctor. But can even the Doctor halt the plans of the mysterious Miss Foster?\",\"first_aired\":\"2008-04-05T12:30:00.000-07:00\",\"updated_at\":\"2015-01-10T12:50:11.000-08:00\",\"rating\":8.49897,\"votes\":485,\"available_translations\":[],\"images\":{\"screenshot\":{\"full\":\"https:\\\/\\\/walter.trakt.us\\\/images\\\/episodes\\\/000\\\/951\\\/471\\\/screenshots\\\/original\\\/0628131af6.jpg?1420722800\",\"medium\":\"https:\\\/\\\/walter.trakt.us\\\/images\\\/episodes\\\/000\\\/951\\\/471\\\/screenshots\\\/medium\\\/0628131af6.jpg?1420722800\",\"thumb\":\"https:\\\/\\\/walter.trakt.us\\\/images\\\/episodes\\\/000\\\/951\\\/471\\\/screenshots\\\/thumb\\\/0628131af6.jpg?1420722800\"}}}]" }
{ "pile_set_name": "Github" }
(ns cmr.common.rebalancing-collections "Functions used in multiple applications for working with collections that are in the process of moving their granules from the small collections index to a separate index or vice versa." (:require [cmr.common.services.errors :as errors])) (def allowed-targets "The potential targets for a rebalancing collections operation." ["separate-index" "small-collections"]) (def allowed-status "The potential status for a rebalancing collection." ["IN_PROGRESS" "COMPLETE"]) (defn validate-target "Validates the target is set to one of the allowed values." [target concept-id] (if (nil? target) (errors/throw-service-errors :bad-request [(format "The index set does not contain the rebalancing collection [%s]" concept-id)]) (when-not (some #{target} allowed-targets) (errors/throw-service-errors :bad-request [(format "Invalid target index [%s]. Only separate-index or small-collections are allowed." target)])))) (defn validate-status "Validates the target is set to one of the allowed values." [status] (when-not (some #{status} allowed-status) (errors/throw-service-errors :bad-request [(format "Invalid status [%s]. Only %s are allowed." status (pr-str allowed-status))])))
{ "pile_set_name": "Github" }
# Dolibarr language file - Source file is en_US - install MiscellaneousChecks=Vereisten controle PHPSupportPOSTGETOk=Deze PHP installatie ondersteund POST en GET. ErrorFailedToConnectToDatabase=Er kon niet verbonden worden met de database '%s'. ErrorDatabaseVersionTooLow=Databankversie (%s) te oud. Versie %s of hoger is vereist. CreateOtherKeysForTable=Creëer foreign keys en indexes voor de tabel %s SystemIsInstalled=De installatie is voltooid GoToDolibarr=Ga naar Dolibarr GoToSetupArea=Ga naar Dolibarr (instellingsomgeving) GoToUpgradePage=Ga opnieuw naar de upgrade pagina WithNoSlashAtTheEnd=Zonder toevoeging van de slash "/" ShowEditTechnicalParameters=Klik hier om verder gevorderde parameters te zien of aan te passen. (expert instellingen) MigrationUpdateFailed=Upgrade mislukt MigrationDeliveryAddress=Werk de afleveringsadressen voor verzending bij MigrationCategorieAssociation=Overzetten van categoriën MigrationReloadModule=Herladen van de module %s
{ "pile_set_name": "Github" }
/* Copyright 2017 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 handlers import ( "fmt" "net/http" "time" "k8s.io/apimachinery/pkg/api/errors" "k8s.io/apimachinery/pkg/api/meta" metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" "k8s.io/apimachinery/pkg/runtime" "k8s.io/apimachinery/pkg/runtime/schema" "k8s.io/apiserver/pkg/admission" "k8s.io/apiserver/pkg/audit" "k8s.io/apiserver/pkg/endpoints/handlers/negotiation" "k8s.io/apiserver/pkg/endpoints/request" "k8s.io/apiserver/pkg/registry/rest" utiltrace "k8s.io/apiserver/pkg/util/trace" ) func createHandler(r rest.NamedCreater, scope RequestScope, typer runtime.ObjectTyper, admit admission.Interface, includeName bool) http.HandlerFunc { return func(w http.ResponseWriter, req *http.Request) { // For performance tracking purposes. trace := utiltrace.New("Create " + req.URL.Path) defer trace.LogIfLong(500 * time.Millisecond) // TODO: we either want to remove timeout or document it (if we document, move timeout out of this function and declare it in api_installer) timeout := parseTimeout(req.URL.Query().Get("timeout")) var ( namespace, name string err error ) if includeName { namespace, name, err = scope.Namer.Name(req) } else { namespace, err = scope.Namer.Namespace(req) } if err != nil { scope.err(err, w, req) return } ctx := scope.ContextFunc(req) ctx = request.WithNamespace(ctx, namespace) gv := scope.Kind.GroupVersion() s, err := negotiation.NegotiateInputSerializer(req, false, scope.Serializer) if err != nil { scope.err(err, w, req) return } decoder := scope.Serializer.DecoderToVersion(s.Serializer, schema.GroupVersion{Group: gv.Group, Version: runtime.APIVersionInternal}) body, err := readBody(req) if err != nil { scope.err(err, w, req) return } defaultGVK := scope.Kind original := r.New() trace.Step("About to convert to expected version") obj, gvk, err := decoder.Decode(body, &defaultGVK, original) if err != nil { err = transformDecodeError(typer, err, original, gvk, body) scope.err(err, w, req) return } if gvk.GroupVersion() != gv { err = errors.NewBadRequest(fmt.Sprintf("the API version in the data (%s) does not match the expected API version (%v)", gvk.GroupVersion().String(), gv.String())) scope.err(err, w, req) return } trace.Step("Conversion done") ae := request.AuditEventFrom(ctx) audit.LogRequestObject(ae, obj, scope.Resource, scope.Subresource, scope.Serializer) userInfo, _ := request.UserFrom(ctx) admissionAttributes := admission.NewAttributesRecord(obj, nil, scope.Kind, namespace, name, scope.Resource, scope.Subresource, admission.Create, userInfo) if mutatingAdmission, ok := admit.(admission.MutationInterface); ok && mutatingAdmission.Handles(admission.Create) { err = mutatingAdmission.Admit(admissionAttributes) if err != nil { scope.err(err, w, req) return } } // TODO: replace with content type negotiation? includeUninitialized := req.URL.Query().Get("includeUninitialized") == "1" trace.Step("About to store object in database") result, err := finishRequest(timeout, func() (runtime.Object, error) { return r.Create( ctx, name, obj, rest.AdmissionToValidateObjectFunc(admit, admissionAttributes), includeUninitialized, ) }) if err != nil { scope.err(err, w, req) return } trace.Step("Object stored in database") requestInfo, ok := request.RequestInfoFrom(ctx) if !ok { scope.err(fmt.Errorf("missing requestInfo"), w, req) return } if err := setSelfLink(result, requestInfo, scope.Namer); err != nil { scope.err(err, w, req) return } trace.Step("Self-link added") // If the object is partially initialized, always indicate it via StatusAccepted code := http.StatusCreated if accessor, err := meta.Accessor(result); err == nil { if accessor.GetInitializers() != nil { code = http.StatusAccepted } } status, ok := result.(*metav1.Status) if ok && err == nil && status.Code == 0 { status.Code = int32(code) } transformResponseObject(ctx, scope, req, w, code, result) } } // CreateNamedResource returns a function that will handle a resource creation with name. func CreateNamedResource(r rest.NamedCreater, scope RequestScope, typer runtime.ObjectTyper, admission admission.Interface) http.HandlerFunc { return createHandler(r, scope, typer, admission, true) } // CreateResource returns a function that will handle a resource creation. func CreateResource(r rest.Creater, scope RequestScope, typer runtime.ObjectTyper, admission admission.Interface) http.HandlerFunc { return createHandler(&namedCreaterAdapter{r}, scope, typer, admission, false) } type namedCreaterAdapter struct { rest.Creater } func (c *namedCreaterAdapter) Create(ctx request.Context, name string, obj runtime.Object, createValidatingAdmission rest.ValidateObjectFunc, includeUninitialized bool) (runtime.Object, error) { return c.Creater.Create(ctx, obj, createValidatingAdmission, includeUninitialized) }
{ "pile_set_name": "Github" }
GRIMOIRELAB_REL='18.07-06' SORTINGHAT='f088d00214a9fb97d9c1fc034ada4a253172dda1' GRIMOIREELK='88ad0092c0ffbd4a1daddf3f45b0e4e6a881a0c8' PERCEVAL='e3035f56f8ca24cf1e1b03bed84f67df5d592d50' KIBITER='f7bf173cb1d79418b9909d877adfb998ce7b52da' KINGARTHUR='89d9a4b9602675626607bd50309da1f636800024' CERESLIB='7156a4a77f42c60894e24b6bec734b9468ecf261' SIGILS='d04fcc846f0cee3199d702e73e36f73a045f6ff2' SIRMORDRED='29c498f5b44a43ce51389d523c7c63c1069a65f1' TUTORIAL='c8b2f2132d1d44250ca4834bffcd109020798198' PERCEVAL_MOZILLA='92a2c95845ca5634d7be6d37d4dc02332e0baabb' PERCEVAL_PUPPET='392f659a0efe2f1b674fc555ee98b8d0d961c8e0' MANUSCRIPTS='fbd54099b8b3147a5b3496b48bb60876051183db' BESTIARY='e33976089fcb099d8054b686f61d1f39e9038aa1' GRIMOIRELAB_TOOLKIT='bb304b914bde59f4a1008763a99eb0e653fe2572' PERCEVAL_OPNFV='234d16a81bba9c86ba882eb7c6fff3d3d5646923' GRIMOIRELAB='a1bdc6e5b01655e5ff320b5b6dcebee67a4147a5' HATSTALL='029c5baab265f34aae5f1d673b2cb4daf6b391d7' KIDASH='0c35eb5e09db923a272cf4d3c202c8aff75368af'
{ "pile_set_name": "Github" }
<?php namespace Oro\Bundle\PromotionBundle\Tests\Behat\Element; use Oro\Bundle\FormBundle\Tests\Behat\Element\OroForm; class PromotionOrderForm extends OroForm { public function saveWithoutDiscountsRecalculation() { $this->pressActionButton('Save Without Discounts Recalculation'); } }
{ "pile_set_name": "Github" }
/* * (C) Copyright 2013 Siemens Schweiz AG * (C) Heiko Schocher, DENX Software Engineering, [email protected]. * * Based on: * U-Boot file:/include/configs/am335x_evm.h * * Copyright (C) 2011 Texas Instruments Incorporated - http://www.ti.com/ * * SPDX-License-Identifier: GPL-2.0+ */ #ifndef __CONFIG_DRACO_H #define __CONFIG_DRACO_H #define CONFIG_SIEMENS_DRACO #define CONFIG_SIEMENS_MACH_TYPE MACH_TYPE_DRACO #include "siemens-am33x-common.h" #define DDR_PLL_FREQ 303 #undef CONFIG_SPL_AM33XX_ENABLE_RTC32K_OSC #define BOARD_DFU_BUTTON_GPIO 27 /* Use as default */ #define GPIO_LAN9303_NRST 88 /* GPIO2_24 = gpio88 */ #define CONFIG_ENV_SETTINGS_BUTTONS_AND_LEDS \ "button_dfu0=27\0" \ "led0=103,1,0\0" \ "led1=64,0,1\0" /* Physical Memory Map */ #define CONFIG_MAX_RAM_BANK_SIZE (1024 << 20) /* 1GB */ /* I2C Configuration */ #define CONFIG_SYS_I2C_SPEED 100000 #define CONFIG_SYS_I2C_EEPROM_ADDR 0x50 #define EEPROM_ADDR_DDR3 0x90 #define EEPROM_ADDR_CHIP 0x120 #undef CONFIG_MII #undef CONFIG_PHY_GIGE #define CONFIG_PHY_SMSC #define CONFIG_FACTORYSET /* Define own nand partitions */ #define CONFIG_ENV_OFFSET_REDUND 0x2E0000 #define CONFIG_ENV_SIZE_REDUND 0x2000 #define CONFIG_ENV_RANGE (4 * CONFIG_SYS_ENV_SECT_SIZE) #define MTDPARTS_DEFAULT MTDPARTS_DEFAULT_V2 #ifndef CONFIG_SPL_BUILD /* Default env settings */ #define CONFIG_EXTRA_ENV_SETTINGS \ "hostname=draco\0" \ "ubi_off=2048\0"\ "nand_img_size=0x400000\0" \ "optargs=\0" \ "preboot=draco_led 0\0" \ CONFIG_ENV_SETTINGS_BUTTONS_AND_LEDS \ CONFIG_ENV_SETTINGS_V2 \ CONFIG_ENV_SETTINGS_NAND_V2 #ifndef CONFIG_RESTORE_FLASH /* set to negative value for no autoboot */ #define CONFIG_BOOTCOMMAND \ "if dfubutton; then " \ "run dfu_start; " \ "reset; " \ "fi;" \ "run nand_boot;" \ "run nand_boot_backup;" \ "reset;" #else #define CONFIG_BOOTCOMMAND \ "setenv autoload no; " \ "dhcp; " \ "if tftp 80000000 debrick.scr; then " \ "source 80000000; " \ "fi" #endif #endif /* CONFIG_SPL_BUILD */ #endif /* ! __CONFIG_DRACO_H */
{ "pile_set_name": "Github" }
// Copyright Aleksey Gurtovoy 2000-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/vector/vector30.hpp" header // -- DO NOT modify by hand! namespace boost { namespace mpl { template< typename T0, typename T1, typename T2, typename T3, typename T4 , typename T5, typename T6, typename T7, typename T8, typename T9 , typename T10, typename T11, typename T12, typename T13, typename T14 , typename T15, typename T16, typename T17, typename T18, typename T19 , typename T20 > struct vector21 { typedef aux::vector_tag<21> tag; typedef vector21 type; typedef T0 item0; typedef T1 item1; typedef T2 item2; typedef T3 item3; typedef T4 item4; typedef T5 item5; typedef T6 item6; typedef T7 item7; typedef T8 item8; typedef T9 item9; typedef T10 item10; typedef T11 item11; typedef T12 item12; typedef T13 item13; typedef T14 item14; typedef T15 item15; typedef T16 item16; typedef T17 item17; typedef T18 item18; typedef T19 item19; typedef T20 item20; typedef void_ item21; typedef T20 back; typedef v_iter< type,0 > begin; typedef v_iter< type,21 > end; }; template<> struct push_front_impl< aux::vector_tag<20> > { template< typename Vector, typename T > struct apply { typedef vector21< T , typename Vector::item0, typename Vector::item1 , typename Vector::item2, typename Vector::item3 , typename Vector::item4, typename Vector::item5 , typename Vector::item6, typename Vector::item7 , typename Vector::item8, typename Vector::item9 , typename Vector::item10, typename Vector::item11 , typename Vector::item12, typename Vector::item13 , typename Vector::item14, typename Vector::item15 , typename Vector::item16, typename Vector::item17 , typename Vector::item18, typename Vector::item19 > type; }; }; template<> struct pop_front_impl< aux::vector_tag<21> > { template< typename Vector > struct apply { typedef vector20< typename Vector::item1, typename Vector::item2 , typename Vector::item3, typename Vector::item4 , typename Vector::item5, typename Vector::item6 , typename Vector::item7, typename Vector::item8 , typename Vector::item9, typename Vector::item10 , typename Vector::item11, typename Vector::item12 , typename Vector::item13, typename Vector::item14 , typename Vector::item15, typename Vector::item16 , typename Vector::item17, typename Vector::item18 , typename Vector::item19, typename Vector::item20 > type; }; }; template<> struct push_back_impl< aux::vector_tag<20> > { template< typename Vector, typename T > struct apply { typedef vector21< typename Vector::item0, typename Vector::item1 , typename Vector::item2, typename Vector::item3 , typename Vector::item4, typename Vector::item5 , typename Vector::item6, typename Vector::item7 , typename Vector::item8, typename Vector::item9 , typename Vector::item10, typename Vector::item11 , typename Vector::item12, typename Vector::item13 , typename Vector::item14, typename Vector::item15 , typename Vector::item16, typename Vector::item17 , typename Vector::item18, typename Vector::item19 , T > type; }; }; template<> struct pop_back_impl< aux::vector_tag<21> > { template< typename Vector > struct apply { typedef vector20< typename Vector::item0, typename Vector::item1 , typename Vector::item2, typename Vector::item3 , typename Vector::item4, typename Vector::item5 , typename Vector::item6, typename Vector::item7 , typename Vector::item8, typename Vector::item9 , typename Vector::item10, typename Vector::item11 , typename Vector::item12, typename Vector::item13 , typename Vector::item14, typename Vector::item15 , typename Vector::item16, typename Vector::item17 , typename Vector::item18, typename Vector::item19 > type; }; }; template< typename V > struct v_at< V,21 > { typedef typename V::item21 type; }; template< typename T0, typename T1, typename T2, typename T3, typename T4 , typename T5, typename T6, typename T7, typename T8, typename T9 , typename T10, typename T11, typename T12, typename T13, typename T14 , typename T15, typename T16, typename T17, typename T18, typename T19 , typename T20, typename T21 > struct vector22 { typedef aux::vector_tag<22> tag; typedef vector22 type; typedef T0 item0; typedef T1 item1; typedef T2 item2; typedef T3 item3; typedef T4 item4; typedef T5 item5; typedef T6 item6; typedef T7 item7; typedef T8 item8; typedef T9 item9; typedef T10 item10; typedef T11 item11; typedef T12 item12; typedef T13 item13; typedef T14 item14; typedef T15 item15; typedef T16 item16; typedef T17 item17; typedef T18 item18; typedef T19 item19; typedef T20 item20; typedef T21 item21; typedef void_ item22; typedef T21 back; typedef v_iter< type,0 > begin; typedef v_iter< type,22 > end; }; template<> struct push_front_impl< aux::vector_tag<21> > { template< typename Vector, typename T > struct apply { typedef vector22< T , typename Vector::item0, typename Vector::item1 , typename Vector::item2, typename Vector::item3 , typename Vector::item4, typename Vector::item5 , typename Vector::item6, typename Vector::item7 , typename Vector::item8, typename Vector::item9 , typename Vector::item10, typename Vector::item11 , typename Vector::item12, typename Vector::item13 , typename Vector::item14, typename Vector::item15 , typename Vector::item16, typename Vector::item17 , typename Vector::item18, typename Vector::item19 , typename Vector::item20 > type; }; }; template<> struct pop_front_impl< aux::vector_tag<22> > { template< typename Vector > struct apply { typedef vector21< typename Vector::item1, typename Vector::item2 , typename Vector::item3, typename Vector::item4 , typename Vector::item5, typename Vector::item6 , typename Vector::item7, typename Vector::item8 , typename Vector::item9, typename Vector::item10 , typename Vector::item11, typename Vector::item12 , typename Vector::item13, typename Vector::item14 , typename Vector::item15, typename Vector::item16 , typename Vector::item17, typename Vector::item18 , typename Vector::item19, typename Vector::item20 , typename Vector::item21 > type; }; }; template<> struct push_back_impl< aux::vector_tag<21> > { template< typename Vector, typename T > struct apply { typedef vector22< typename Vector::item0, typename Vector::item1 , typename Vector::item2, typename Vector::item3 , typename Vector::item4, typename Vector::item5 , typename Vector::item6, typename Vector::item7 , typename Vector::item8, typename Vector::item9 , typename Vector::item10, typename Vector::item11 , typename Vector::item12, typename Vector::item13 , typename Vector::item14, typename Vector::item15 , typename Vector::item16, typename Vector::item17 , typename Vector::item18, typename Vector::item19 , typename Vector::item20 , T > type; }; }; template<> struct pop_back_impl< aux::vector_tag<22> > { template< typename Vector > struct apply { typedef vector21< typename Vector::item0, typename Vector::item1 , typename Vector::item2, typename Vector::item3 , typename Vector::item4, typename Vector::item5 , typename Vector::item6, typename Vector::item7 , typename Vector::item8, typename Vector::item9 , typename Vector::item10, typename Vector::item11 , typename Vector::item12, typename Vector::item13 , typename Vector::item14, typename Vector::item15 , typename Vector::item16, typename Vector::item17 , typename Vector::item18, typename Vector::item19 , typename Vector::item20 > type; }; }; template< typename V > struct v_at< V,22 > { typedef typename V::item22 type; }; template< typename T0, typename T1, typename T2, typename T3, typename T4 , typename T5, typename T6, typename T7, typename T8, typename T9 , typename T10, typename T11, typename T12, typename T13, typename T14 , typename T15, typename T16, typename T17, typename T18, typename T19 , typename T20, typename T21, typename T22 > struct vector23 { typedef aux::vector_tag<23> tag; typedef vector23 type; typedef T0 item0; typedef T1 item1; typedef T2 item2; typedef T3 item3; typedef T4 item4; typedef T5 item5; typedef T6 item6; typedef T7 item7; typedef T8 item8; typedef T9 item9; typedef T10 item10; typedef T11 item11; typedef T12 item12; typedef T13 item13; typedef T14 item14; typedef T15 item15; typedef T16 item16; typedef T17 item17; typedef T18 item18; typedef T19 item19; typedef T20 item20; typedef T21 item21; typedef T22 item22; typedef void_ item23; typedef T22 back; typedef v_iter< type,0 > begin; typedef v_iter< type,23 > end; }; template<> struct push_front_impl< aux::vector_tag<22> > { template< typename Vector, typename T > struct apply { typedef vector23< T , typename Vector::item0, typename Vector::item1 , typename Vector::item2, typename Vector::item3 , typename Vector::item4, typename Vector::item5 , typename Vector::item6, typename Vector::item7 , typename Vector::item8, typename Vector::item9 , typename Vector::item10, typename Vector::item11 , typename Vector::item12, typename Vector::item13 , typename Vector::item14, typename Vector::item15 , typename Vector::item16, typename Vector::item17 , typename Vector::item18, typename Vector::item19 , typename Vector::item20, typename Vector::item21 > type; }; }; template<> struct pop_front_impl< aux::vector_tag<23> > { template< typename Vector > struct apply { typedef vector22< typename Vector::item1, typename Vector::item2 , typename Vector::item3, typename Vector::item4 , typename Vector::item5, typename Vector::item6 , typename Vector::item7, typename Vector::item8 , typename Vector::item9, typename Vector::item10 , typename Vector::item11, typename Vector::item12 , typename Vector::item13, typename Vector::item14 , typename Vector::item15, typename Vector::item16 , typename Vector::item17, typename Vector::item18 , typename Vector::item19, typename Vector::item20 , typename Vector::item21, typename Vector::item22 > type; }; }; template<> struct push_back_impl< aux::vector_tag<22> > { template< typename Vector, typename T > struct apply { typedef vector23< typename Vector::item0, typename Vector::item1 , typename Vector::item2, typename Vector::item3 , typename Vector::item4, typename Vector::item5 , typename Vector::item6, typename Vector::item7 , typename Vector::item8, typename Vector::item9 , typename Vector::item10, typename Vector::item11 , typename Vector::item12, typename Vector::item13 , typename Vector::item14, typename Vector::item15 , typename Vector::item16, typename Vector::item17 , typename Vector::item18, typename Vector::item19 , typename Vector::item20, typename Vector::item21 , T > type; }; }; template<> struct pop_back_impl< aux::vector_tag<23> > { template< typename Vector > struct apply { typedef vector22< typename Vector::item0, typename Vector::item1 , typename Vector::item2, typename Vector::item3 , typename Vector::item4, typename Vector::item5 , typename Vector::item6, typename Vector::item7 , typename Vector::item8, typename Vector::item9 , typename Vector::item10, typename Vector::item11 , typename Vector::item12, typename Vector::item13 , typename Vector::item14, typename Vector::item15 , typename Vector::item16, typename Vector::item17 , typename Vector::item18, typename Vector::item19 , typename Vector::item20, typename Vector::item21 > type; }; }; template< typename V > struct v_at< V,23 > { typedef typename V::item23 type; }; template< typename T0, typename T1, typename T2, typename T3, typename T4 , typename T5, typename T6, typename T7, typename T8, typename T9 , typename T10, typename T11, typename T12, typename T13, typename T14 , typename T15, typename T16, typename T17, typename T18, typename T19 , typename T20, typename T21, typename T22, typename T23 > struct vector24 { typedef aux::vector_tag<24> tag; typedef vector24 type; typedef T0 item0; typedef T1 item1; typedef T2 item2; typedef T3 item3; typedef T4 item4; typedef T5 item5; typedef T6 item6; typedef T7 item7; typedef T8 item8; typedef T9 item9; typedef T10 item10; typedef T11 item11; typedef T12 item12; typedef T13 item13; typedef T14 item14; typedef T15 item15; typedef T16 item16; typedef T17 item17; typedef T18 item18; typedef T19 item19; typedef T20 item20; typedef T21 item21; typedef T22 item22; typedef T23 item23; typedef void_ item24; typedef T23 back; typedef v_iter< type,0 > begin; typedef v_iter< type,24 > end; }; template<> struct push_front_impl< aux::vector_tag<23> > { template< typename Vector, typename T > struct apply { typedef vector24< T , typename Vector::item0, typename Vector::item1 , typename Vector::item2, typename Vector::item3 , typename Vector::item4, typename Vector::item5 , typename Vector::item6, typename Vector::item7 , typename Vector::item8, typename Vector::item9 , typename Vector::item10, typename Vector::item11 , typename Vector::item12, typename Vector::item13 , typename Vector::item14, typename Vector::item15 , typename Vector::item16, typename Vector::item17 , typename Vector::item18, typename Vector::item19 , typename Vector::item20, typename Vector::item21 , typename Vector::item22 > type; }; }; template<> struct pop_front_impl< aux::vector_tag<24> > { template< typename Vector > struct apply { typedef vector23< typename Vector::item1, typename Vector::item2 , typename Vector::item3, typename Vector::item4 , typename Vector::item5, typename Vector::item6 , typename Vector::item7, typename Vector::item8 , typename Vector::item9, typename Vector::item10 , typename Vector::item11, typename Vector::item12 , typename Vector::item13, typename Vector::item14 , typename Vector::item15, typename Vector::item16 , typename Vector::item17, typename Vector::item18 , typename Vector::item19, typename Vector::item20 , typename Vector::item21, typename Vector::item22 , typename Vector::item23 > type; }; }; template<> struct push_back_impl< aux::vector_tag<23> > { template< typename Vector, typename T > struct apply { typedef vector24< typename Vector::item0, typename Vector::item1 , typename Vector::item2, typename Vector::item3 , typename Vector::item4, typename Vector::item5 , typename Vector::item6, typename Vector::item7 , typename Vector::item8, typename Vector::item9 , typename Vector::item10, typename Vector::item11 , typename Vector::item12, typename Vector::item13 , typename Vector::item14, typename Vector::item15 , typename Vector::item16, typename Vector::item17 , typename Vector::item18, typename Vector::item19 , typename Vector::item20, typename Vector::item21 , typename Vector::item22 , T > type; }; }; template<> struct pop_back_impl< aux::vector_tag<24> > { template< typename Vector > struct apply { typedef vector23< typename Vector::item0, typename Vector::item1 , typename Vector::item2, typename Vector::item3 , typename Vector::item4, typename Vector::item5 , typename Vector::item6, typename Vector::item7 , typename Vector::item8, typename Vector::item9 , typename Vector::item10, typename Vector::item11 , typename Vector::item12, typename Vector::item13 , typename Vector::item14, typename Vector::item15 , typename Vector::item16, typename Vector::item17 , typename Vector::item18, typename Vector::item19 , typename Vector::item20, typename Vector::item21 , typename Vector::item22 > type; }; }; template< typename V > struct v_at< V,24 > { typedef typename V::item24 type; }; template< typename T0, typename T1, typename T2, typename T3, typename T4 , typename T5, typename T6, typename T7, typename T8, typename T9 , typename T10, typename T11, typename T12, typename T13, typename T14 , typename T15, typename T16, typename T17, typename T18, typename T19 , typename T20, typename T21, typename T22, typename T23, typename T24 > struct vector25 { typedef aux::vector_tag<25> tag; typedef vector25 type; typedef T0 item0; typedef T1 item1; typedef T2 item2; typedef T3 item3; typedef T4 item4; typedef T5 item5; typedef T6 item6; typedef T7 item7; typedef T8 item8; typedef T9 item9; typedef T10 item10; typedef T11 item11; typedef T12 item12; typedef T13 item13; typedef T14 item14; typedef T15 item15; typedef T16 item16; typedef T17 item17; typedef T18 item18; typedef T19 item19; typedef T20 item20; typedef T21 item21; typedef T22 item22; typedef T23 item23; typedef T24 item24; typedef void_ item25; typedef T24 back; typedef v_iter< type,0 > begin; typedef v_iter< type,25 > end; }; template<> struct push_front_impl< aux::vector_tag<24> > { template< typename Vector, typename T > struct apply { typedef vector25< T , typename Vector::item0, typename Vector::item1 , typename Vector::item2, typename Vector::item3 , typename Vector::item4, typename Vector::item5 , typename Vector::item6, typename Vector::item7 , typename Vector::item8, typename Vector::item9 , typename Vector::item10, typename Vector::item11 , typename Vector::item12, typename Vector::item13 , typename Vector::item14, typename Vector::item15 , typename Vector::item16, typename Vector::item17 , typename Vector::item18, typename Vector::item19 , typename Vector::item20, typename Vector::item21 , typename Vector::item22, typename Vector::item23 > type; }; }; template<> struct pop_front_impl< aux::vector_tag<25> > { template< typename Vector > struct apply { typedef vector24< typename Vector::item1, typename Vector::item2 , typename Vector::item3, typename Vector::item4 , typename Vector::item5, typename Vector::item6 , typename Vector::item7, typename Vector::item8 , typename Vector::item9, typename Vector::item10 , typename Vector::item11, typename Vector::item12 , typename Vector::item13, typename Vector::item14 , typename Vector::item15, typename Vector::item16 , typename Vector::item17, typename Vector::item18 , typename Vector::item19, typename Vector::item20 , typename Vector::item21, typename Vector::item22 , typename Vector::item23, typename Vector::item24 > type; }; }; template<> struct push_back_impl< aux::vector_tag<24> > { template< typename Vector, typename T > struct apply { typedef vector25< typename Vector::item0, typename Vector::item1 , typename Vector::item2, typename Vector::item3 , typename Vector::item4, typename Vector::item5 , typename Vector::item6, typename Vector::item7 , typename Vector::item8, typename Vector::item9 , typename Vector::item10, typename Vector::item11 , typename Vector::item12, typename Vector::item13 , typename Vector::item14, typename Vector::item15 , typename Vector::item16, typename Vector::item17 , typename Vector::item18, typename Vector::item19 , typename Vector::item20, typename Vector::item21 , typename Vector::item22, typename Vector::item23 , T > type; }; }; template<> struct pop_back_impl< aux::vector_tag<25> > { template< typename Vector > struct apply { typedef vector24< typename Vector::item0, typename Vector::item1 , typename Vector::item2, typename Vector::item3 , typename Vector::item4, typename Vector::item5 , typename Vector::item6, typename Vector::item7 , typename Vector::item8, typename Vector::item9 , typename Vector::item10, typename Vector::item11 , typename Vector::item12, typename Vector::item13 , typename Vector::item14, typename Vector::item15 , typename Vector::item16, typename Vector::item17 , typename Vector::item18, typename Vector::item19 , typename Vector::item20, typename Vector::item21 , typename Vector::item22, typename Vector::item23 > type; }; }; template< typename V > struct v_at< V,25 > { typedef typename V::item25 type; }; template< typename T0, typename T1, typename T2, typename T3, typename T4 , typename T5, typename T6, typename T7, typename T8, typename T9 , typename T10, typename T11, typename T12, typename T13, typename T14 , typename T15, typename T16, typename T17, typename T18, typename T19 , typename T20, typename T21, typename T22, typename T23, typename T24 , typename T25 > struct vector26 { typedef aux::vector_tag<26> tag; typedef vector26 type; typedef T0 item0; typedef T1 item1; typedef T2 item2; typedef T3 item3; typedef T4 item4; typedef T5 item5; typedef T6 item6; typedef T7 item7; typedef T8 item8; typedef T9 item9; typedef T10 item10; typedef T11 item11; typedef T12 item12; typedef T13 item13; typedef T14 item14; typedef T15 item15; typedef T16 item16; typedef T17 item17; typedef T18 item18; typedef T19 item19; typedef T20 item20; typedef T21 item21; typedef T22 item22; typedef T23 item23; typedef T24 item24; typedef T25 item25; typedef void_ item26; typedef T25 back; typedef v_iter< type,0 > begin; typedef v_iter< type,26 > end; }; template<> struct push_front_impl< aux::vector_tag<25> > { template< typename Vector, typename T > struct apply { typedef vector26< T , typename Vector::item0, typename Vector::item1 , typename Vector::item2, typename Vector::item3 , typename Vector::item4, typename Vector::item5 , typename Vector::item6, typename Vector::item7 , typename Vector::item8, typename Vector::item9 , typename Vector::item10, typename Vector::item11 , typename Vector::item12, typename Vector::item13 , typename Vector::item14, typename Vector::item15 , typename Vector::item16, typename Vector::item17 , typename Vector::item18, typename Vector::item19 , typename Vector::item20, typename Vector::item21 , typename Vector::item22, typename Vector::item23 , typename Vector::item24 > type; }; }; template<> struct pop_front_impl< aux::vector_tag<26> > { template< typename Vector > struct apply { typedef vector25< typename Vector::item1, typename Vector::item2 , typename Vector::item3, typename Vector::item4 , typename Vector::item5, typename Vector::item6 , typename Vector::item7, typename Vector::item8 , typename Vector::item9, typename Vector::item10 , typename Vector::item11, typename Vector::item12 , typename Vector::item13, typename Vector::item14 , typename Vector::item15, typename Vector::item16 , typename Vector::item17, typename Vector::item18 , typename Vector::item19, typename Vector::item20 , typename Vector::item21, typename Vector::item22 , typename Vector::item23, typename Vector::item24 , typename Vector::item25 > type; }; }; template<> struct push_back_impl< aux::vector_tag<25> > { template< typename Vector, typename T > struct apply { typedef vector26< typename Vector::item0, typename Vector::item1 , typename Vector::item2, typename Vector::item3 , typename Vector::item4, typename Vector::item5 , typename Vector::item6, typename Vector::item7 , typename Vector::item8, typename Vector::item9 , typename Vector::item10, typename Vector::item11 , typename Vector::item12, typename Vector::item13 , typename Vector::item14, typename Vector::item15 , typename Vector::item16, typename Vector::item17 , typename Vector::item18, typename Vector::item19 , typename Vector::item20, typename Vector::item21 , typename Vector::item22, typename Vector::item23 , typename Vector::item24 , T > type; }; }; template<> struct pop_back_impl< aux::vector_tag<26> > { template< typename Vector > struct apply { typedef vector25< typename Vector::item0, typename Vector::item1 , typename Vector::item2, typename Vector::item3 , typename Vector::item4, typename Vector::item5 , typename Vector::item6, typename Vector::item7 , typename Vector::item8, typename Vector::item9 , typename Vector::item10, typename Vector::item11 , typename Vector::item12, typename Vector::item13 , typename Vector::item14, typename Vector::item15 , typename Vector::item16, typename Vector::item17 , typename Vector::item18, typename Vector::item19 , typename Vector::item20, typename Vector::item21 , typename Vector::item22, typename Vector::item23 , typename Vector::item24 > type; }; }; template< typename V > struct v_at< V,26 > { typedef typename V::item26 type; }; template< typename T0, typename T1, typename T2, typename T3, typename T4 , typename T5, typename T6, typename T7, typename T8, typename T9 , typename T10, typename T11, typename T12, typename T13, typename T14 , typename T15, typename T16, typename T17, typename T18, typename T19 , typename T20, typename T21, typename T22, typename T23, typename T24 , typename T25, typename T26 > struct vector27 { typedef aux::vector_tag<27> tag; typedef vector27 type; typedef T0 item0; typedef T1 item1; typedef T2 item2; typedef T3 item3; typedef T4 item4; typedef T5 item5; typedef T6 item6; typedef T7 item7; typedef T8 item8; typedef T9 item9; typedef T10 item10; typedef T11 item11; typedef T12 item12; typedef T13 item13; typedef T14 item14; typedef T15 item15; typedef T16 item16; typedef T17 item17; typedef T18 item18; typedef T19 item19; typedef T20 item20; typedef T21 item21; typedef T22 item22; typedef T23 item23; typedef T24 item24; typedef T25 item25; typedef T26 item26; typedef void_ item27; typedef T26 back; typedef v_iter< type,0 > begin; typedef v_iter< type,27 > end; }; template<> struct push_front_impl< aux::vector_tag<26> > { template< typename Vector, typename T > struct apply { typedef vector27< T , typename Vector::item0, typename Vector::item1 , typename Vector::item2, typename Vector::item3 , typename Vector::item4, typename Vector::item5 , typename Vector::item6, typename Vector::item7 , typename Vector::item8, typename Vector::item9 , typename Vector::item10, typename Vector::item11 , typename Vector::item12, typename Vector::item13 , typename Vector::item14, typename Vector::item15 , typename Vector::item16, typename Vector::item17 , typename Vector::item18, typename Vector::item19 , typename Vector::item20, typename Vector::item21 , typename Vector::item22, typename Vector::item23 , typename Vector::item24, typename Vector::item25 > type; }; }; template<> struct pop_front_impl< aux::vector_tag<27> > { template< typename Vector > struct apply { typedef vector26< typename Vector::item1, typename Vector::item2 , typename Vector::item3, typename Vector::item4 , typename Vector::item5, typename Vector::item6 , typename Vector::item7, typename Vector::item8 , typename Vector::item9, typename Vector::item10 , typename Vector::item11, typename Vector::item12 , typename Vector::item13, typename Vector::item14 , typename Vector::item15, typename Vector::item16 , typename Vector::item17, typename Vector::item18 , typename Vector::item19, typename Vector::item20 , typename Vector::item21, typename Vector::item22 , typename Vector::item23, typename Vector::item24 , typename Vector::item25, typename Vector::item26 > type; }; }; template<> struct push_back_impl< aux::vector_tag<26> > { template< typename Vector, typename T > struct apply { typedef vector27< typename Vector::item0, typename Vector::item1 , typename Vector::item2, typename Vector::item3 , typename Vector::item4, typename Vector::item5 , typename Vector::item6, typename Vector::item7 , typename Vector::item8, typename Vector::item9 , typename Vector::item10, typename Vector::item11 , typename Vector::item12, typename Vector::item13 , typename Vector::item14, typename Vector::item15 , typename Vector::item16, typename Vector::item17 , typename Vector::item18, typename Vector::item19 , typename Vector::item20, typename Vector::item21 , typename Vector::item22, typename Vector::item23 , typename Vector::item24, typename Vector::item25 , T > type; }; }; template<> struct pop_back_impl< aux::vector_tag<27> > { template< typename Vector > struct apply { typedef vector26< typename Vector::item0, typename Vector::item1 , typename Vector::item2, typename Vector::item3 , typename Vector::item4, typename Vector::item5 , typename Vector::item6, typename Vector::item7 , typename Vector::item8, typename Vector::item9 , typename Vector::item10, typename Vector::item11 , typename Vector::item12, typename Vector::item13 , typename Vector::item14, typename Vector::item15 , typename Vector::item16, typename Vector::item17 , typename Vector::item18, typename Vector::item19 , typename Vector::item20, typename Vector::item21 , typename Vector::item22, typename Vector::item23 , typename Vector::item24, typename Vector::item25 > type; }; }; template< typename V > struct v_at< V,27 > { typedef typename V::item27 type; }; template< typename T0, typename T1, typename T2, typename T3, typename T4 , typename T5, typename T6, typename T7, typename T8, typename T9 , typename T10, typename T11, typename T12, typename T13, typename T14 , typename T15, typename T16, typename T17, typename T18, typename T19 , typename T20, typename T21, typename T22, typename T23, typename T24 , typename T25, typename T26, typename T27 > struct vector28 { typedef aux::vector_tag<28> tag; typedef vector28 type; typedef T0 item0; typedef T1 item1; typedef T2 item2; typedef T3 item3; typedef T4 item4; typedef T5 item5; typedef T6 item6; typedef T7 item7; typedef T8 item8; typedef T9 item9; typedef T10 item10; typedef T11 item11; typedef T12 item12; typedef T13 item13; typedef T14 item14; typedef T15 item15; typedef T16 item16; typedef T17 item17; typedef T18 item18; typedef T19 item19; typedef T20 item20; typedef T21 item21; typedef T22 item22; typedef T23 item23; typedef T24 item24; typedef T25 item25; typedef T26 item26; typedef T27 item27; typedef void_ item28; typedef T27 back; typedef v_iter< type,0 > begin; typedef v_iter< type,28 > end; }; template<> struct push_front_impl< aux::vector_tag<27> > { template< typename Vector, typename T > struct apply { typedef vector28< T , typename Vector::item0, typename Vector::item1 , typename Vector::item2, typename Vector::item3 , typename Vector::item4, typename Vector::item5 , typename Vector::item6, typename Vector::item7 , typename Vector::item8, typename Vector::item9 , typename Vector::item10, typename Vector::item11 , typename Vector::item12, typename Vector::item13 , typename Vector::item14, typename Vector::item15 , typename Vector::item16, typename Vector::item17 , typename Vector::item18, typename Vector::item19 , typename Vector::item20, typename Vector::item21 , typename Vector::item22, typename Vector::item23 , typename Vector::item24, typename Vector::item25 , typename Vector::item26 > type; }; }; template<> struct pop_front_impl< aux::vector_tag<28> > { template< typename Vector > struct apply { typedef vector27< typename Vector::item1, typename Vector::item2 , typename Vector::item3, typename Vector::item4 , typename Vector::item5, typename Vector::item6 , typename Vector::item7, typename Vector::item8 , typename Vector::item9, typename Vector::item10 , typename Vector::item11, typename Vector::item12 , typename Vector::item13, typename Vector::item14 , typename Vector::item15, typename Vector::item16 , typename Vector::item17, typename Vector::item18 , typename Vector::item19, typename Vector::item20 , typename Vector::item21, typename Vector::item22 , typename Vector::item23, typename Vector::item24 , typename Vector::item25, typename Vector::item26 , typename Vector::item27 > type; }; }; template<> struct push_back_impl< aux::vector_tag<27> > { template< typename Vector, typename T > struct apply { typedef vector28< typename Vector::item0, typename Vector::item1 , typename Vector::item2, typename Vector::item3 , typename Vector::item4, typename Vector::item5 , typename Vector::item6, typename Vector::item7 , typename Vector::item8, typename Vector::item9 , typename Vector::item10, typename Vector::item11 , typename Vector::item12, typename Vector::item13 , typename Vector::item14, typename Vector::item15 , typename Vector::item16, typename Vector::item17 , typename Vector::item18, typename Vector::item19 , typename Vector::item20, typename Vector::item21 , typename Vector::item22, typename Vector::item23 , typename Vector::item24, typename Vector::item25 , typename Vector::item26 , T > type; }; }; template<> struct pop_back_impl< aux::vector_tag<28> > { template< typename Vector > struct apply { typedef vector27< typename Vector::item0, typename Vector::item1 , typename Vector::item2, typename Vector::item3 , typename Vector::item4, typename Vector::item5 , typename Vector::item6, typename Vector::item7 , typename Vector::item8, typename Vector::item9 , typename Vector::item10, typename Vector::item11 , typename Vector::item12, typename Vector::item13 , typename Vector::item14, typename Vector::item15 , typename Vector::item16, typename Vector::item17 , typename Vector::item18, typename Vector::item19 , typename Vector::item20, typename Vector::item21 , typename Vector::item22, typename Vector::item23 , typename Vector::item24, typename Vector::item25 , typename Vector::item26 > type; }; }; template< typename V > struct v_at< V,28 > { typedef typename V::item28 type; }; template< typename T0, typename T1, typename T2, typename T3, typename T4 , typename T5, typename T6, typename T7, typename T8, typename T9 , typename T10, typename T11, typename T12, typename T13, typename T14 , typename T15, typename T16, typename T17, typename T18, typename T19 , typename T20, typename T21, typename T22, typename T23, typename T24 , typename T25, typename T26, typename T27, typename T28 > struct vector29 { typedef aux::vector_tag<29> tag; typedef vector29 type; typedef T0 item0; typedef T1 item1; typedef T2 item2; typedef T3 item3; typedef T4 item4; typedef T5 item5; typedef T6 item6; typedef T7 item7; typedef T8 item8; typedef T9 item9; typedef T10 item10; typedef T11 item11; typedef T12 item12; typedef T13 item13; typedef T14 item14; typedef T15 item15; typedef T16 item16; typedef T17 item17; typedef T18 item18; typedef T19 item19; typedef T20 item20; typedef T21 item21; typedef T22 item22; typedef T23 item23; typedef T24 item24; typedef T25 item25; typedef T26 item26; typedef T27 item27; typedef T28 item28; typedef void_ item29; typedef T28 back; typedef v_iter< type,0 > begin; typedef v_iter< type,29 > end; }; template<> struct push_front_impl< aux::vector_tag<28> > { template< typename Vector, typename T > struct apply { typedef vector29< T , typename Vector::item0, typename Vector::item1 , typename Vector::item2, typename Vector::item3 , typename Vector::item4, typename Vector::item5 , typename Vector::item6, typename Vector::item7 , typename Vector::item8, typename Vector::item9 , typename Vector::item10, typename Vector::item11 , typename Vector::item12, typename Vector::item13 , typename Vector::item14, typename Vector::item15 , typename Vector::item16, typename Vector::item17 , typename Vector::item18, typename Vector::item19 , typename Vector::item20, typename Vector::item21 , typename Vector::item22, typename Vector::item23 , typename Vector::item24, typename Vector::item25 , typename Vector::item26, typename Vector::item27 > type; }; }; template<> struct pop_front_impl< aux::vector_tag<29> > { template< typename Vector > struct apply { typedef vector28< typename Vector::item1, typename Vector::item2 , typename Vector::item3, typename Vector::item4 , typename Vector::item5, typename Vector::item6 , typename Vector::item7, typename Vector::item8 , typename Vector::item9, typename Vector::item10 , typename Vector::item11, typename Vector::item12 , typename Vector::item13, typename Vector::item14 , typename Vector::item15, typename Vector::item16 , typename Vector::item17, typename Vector::item18 , typename Vector::item19, typename Vector::item20 , typename Vector::item21, typename Vector::item22 , typename Vector::item23, typename Vector::item24 , typename Vector::item25, typename Vector::item26 , typename Vector::item27, typename Vector::item28 > type; }; }; template<> struct push_back_impl< aux::vector_tag<28> > { template< typename Vector, typename T > struct apply { typedef vector29< typename Vector::item0, typename Vector::item1 , typename Vector::item2, typename Vector::item3 , typename Vector::item4, typename Vector::item5 , typename Vector::item6, typename Vector::item7 , typename Vector::item8, typename Vector::item9 , typename Vector::item10, typename Vector::item11 , typename Vector::item12, typename Vector::item13 , typename Vector::item14, typename Vector::item15 , typename Vector::item16, typename Vector::item17 , typename Vector::item18, typename Vector::item19 , typename Vector::item20, typename Vector::item21 , typename Vector::item22, typename Vector::item23 , typename Vector::item24, typename Vector::item25 , typename Vector::item26, typename Vector::item27 , T > type; }; }; template<> struct pop_back_impl< aux::vector_tag<29> > { template< typename Vector > struct apply { typedef vector28< typename Vector::item0, typename Vector::item1 , typename Vector::item2, typename Vector::item3 , typename Vector::item4, typename Vector::item5 , typename Vector::item6, typename Vector::item7 , typename Vector::item8, typename Vector::item9 , typename Vector::item10, typename Vector::item11 , typename Vector::item12, typename Vector::item13 , typename Vector::item14, typename Vector::item15 , typename Vector::item16, typename Vector::item17 , typename Vector::item18, typename Vector::item19 , typename Vector::item20, typename Vector::item21 , typename Vector::item22, typename Vector::item23 , typename Vector::item24, typename Vector::item25 , typename Vector::item26, typename Vector::item27 > type; }; }; template< typename V > struct v_at< V,29 > { typedef typename V::item29 type; }; template< typename T0, typename T1, typename T2, typename T3, typename T4 , typename T5, typename T6, typename T7, typename T8, typename T9 , typename T10, typename T11, typename T12, typename T13, typename T14 , typename T15, typename T16, typename T17, typename T18, typename T19 , typename T20, typename T21, typename T22, typename T23, typename T24 , typename T25, typename T26, typename T27, typename T28, typename T29 > struct vector30 { typedef aux::vector_tag<30> tag; typedef vector30 type; typedef T0 item0; typedef T1 item1; typedef T2 item2; typedef T3 item3; typedef T4 item4; typedef T5 item5; typedef T6 item6; typedef T7 item7; typedef T8 item8; typedef T9 item9; typedef T10 item10; typedef T11 item11; typedef T12 item12; typedef T13 item13; typedef T14 item14; typedef T15 item15; typedef T16 item16; typedef T17 item17; typedef T18 item18; typedef T19 item19; typedef T20 item20; typedef T21 item21; typedef T22 item22; typedef T23 item23; typedef T24 item24; typedef T25 item25; typedef T26 item26; typedef T27 item27; typedef T28 item28; typedef T29 item29; typedef void_ item30; typedef T29 back; typedef v_iter< type,0 > begin; typedef v_iter< type,30 > end; }; template<> struct push_front_impl< aux::vector_tag<29> > { template< typename Vector, typename T > struct apply { typedef vector30< T , typename Vector::item0, typename Vector::item1 , typename Vector::item2, typename Vector::item3 , typename Vector::item4, typename Vector::item5 , typename Vector::item6, typename Vector::item7 , typename Vector::item8, typename Vector::item9 , typename Vector::item10, typename Vector::item11 , typename Vector::item12, typename Vector::item13 , typename Vector::item14, typename Vector::item15 , typename Vector::item16, typename Vector::item17 , typename Vector::item18, typename Vector::item19 , typename Vector::item20, typename Vector::item21 , typename Vector::item22, typename Vector::item23 , typename Vector::item24, typename Vector::item25 , typename Vector::item26, typename Vector::item27 , typename Vector::item28 > type; }; }; template<> struct pop_front_impl< aux::vector_tag<30> > { template< typename Vector > struct apply { typedef vector29< typename Vector::item1, typename Vector::item2 , typename Vector::item3, typename Vector::item4 , typename Vector::item5, typename Vector::item6 , typename Vector::item7, typename Vector::item8 , typename Vector::item9, typename Vector::item10 , typename Vector::item11, typename Vector::item12 , typename Vector::item13, typename Vector::item14 , typename Vector::item15, typename Vector::item16 , typename Vector::item17, typename Vector::item18 , typename Vector::item19, typename Vector::item20 , typename Vector::item21, typename Vector::item22 , typename Vector::item23, typename Vector::item24 , typename Vector::item25, typename Vector::item26 , typename Vector::item27, typename Vector::item28 , typename Vector::item29 > type; }; }; template<> struct push_back_impl< aux::vector_tag<29> > { template< typename Vector, typename T > struct apply { typedef vector30< typename Vector::item0, typename Vector::item1 , typename Vector::item2, typename Vector::item3 , typename Vector::item4, typename Vector::item5 , typename Vector::item6, typename Vector::item7 , typename Vector::item8, typename Vector::item9 , typename Vector::item10, typename Vector::item11 , typename Vector::item12, typename Vector::item13 , typename Vector::item14, typename Vector::item15 , typename Vector::item16, typename Vector::item17 , typename Vector::item18, typename Vector::item19 , typename Vector::item20, typename Vector::item21 , typename Vector::item22, typename Vector::item23 , typename Vector::item24, typename Vector::item25 , typename Vector::item26, typename Vector::item27 , typename Vector::item28 , T > type; }; }; template<> struct pop_back_impl< aux::vector_tag<30> > { template< typename Vector > struct apply { typedef vector29< typename Vector::item0, typename Vector::item1 , typename Vector::item2, typename Vector::item3 , typename Vector::item4, typename Vector::item5 , typename Vector::item6, typename Vector::item7 , typename Vector::item8, typename Vector::item9 , typename Vector::item10, typename Vector::item11 , typename Vector::item12, typename Vector::item13 , typename Vector::item14, typename Vector::item15 , typename Vector::item16, typename Vector::item17 , typename Vector::item18, typename Vector::item19 , typename Vector::item20, typename Vector::item21 , typename Vector::item22, typename Vector::item23 , typename Vector::item24, typename Vector::item25 , typename Vector::item26, typename Vector::item27 , typename Vector::item28 > type; }; }; template< typename V > struct v_at< V,30 > { typedef typename V::item30 type; }; }}
{ "pile_set_name": "Github" }
/*********************************************************************/ /* */ /* Optimized BLAS libraries */ /* By Kazushige Goto <[email protected]> */ /* */ /* Copyright (c) The University of Texas, 2009. All rights reserved. */ /* UNIVERSITY EXPRESSLY DISCLAIMS ANY AND ALL WARRANTIES CONCERNING */ /* THIS SOFTWARE AND DOCUMENTATION, INCLUDING ANY WARRANTIES OF */ /* MERCHANTABILITY, FITNESS FOR ANY PARTICULAR PURPOSE, */ /* NON-INFRINGEMENT AND WARRANTIES OF PERFORMANCE, AND ANY WARRANTY */ /* THAT MIGHT OTHERWISE ARISE FROM COURSE OF DEALING OR USAGE OF */ /* TRADE. NO WARRANTY IS EITHER EXPRESS OR IMPLIED WITH RESPECT TO */ /* THE USE OF THE SOFTWARE OR DOCUMENTATION. */ /* Under no circumstances shall University be liable for incidental, */ /* special, indirect, direct or consequential damages or loss of */ /* profits, interruption of business, or related expenses which may */ /* arise from use of Software or Documentation, including but not */ /* limited to those resulting from defects in Software and/or */ /* Documentation, or loss or inaccuracy of data of any kind. */ /*********************************************************************/ #define ASSEMBLER #include "common.h" #ifndef WINDOWS_ABI #define M ARG1 #define X ARG4 #define INCX ARG5 #define Y ARG6 #define INCY ARG2 #else #define M ARG1 #define X ARG2 #define INCX ARG3 #define Y ARG4 #define INCY %r10 #endif #define YY %r11 #define ALPHA %xmm15 #include "l1param.h" PROLOGUE PROFCODE #ifndef WINDOWS_ABI #ifndef XDOUBLE movq 8(%rsp), INCY #else movq 24(%rsp), INCY #endif movaps %xmm0, ALPHA #else movaps %xmm3, ALPHA movq 40(%rsp), X movq 48(%rsp), INCX movq 56(%rsp), Y movq 64(%rsp), INCY #endif SAVEREGISTERS leaq (, INCX, SIZE), INCX leaq (, INCY, SIZE), INCY testq M, M jle .L29 cmpq $SIZE, INCX jne .L20 cmpq $SIZE, INCY jne .L20 movq M, %rax sarq $3, %rax jle .L13 movsd 0 * SIZE(X), %xmm0 movsd 1 * SIZE(X), %xmm1 movsd 2 * SIZE(X), %xmm2 movsd 3 * SIZE(X), %xmm3 movsd 0 * SIZE(Y), %xmm4 movsd 1 * SIZE(Y), %xmm5 movsd 2 * SIZE(Y), %xmm6 movsd 3 * SIZE(Y), %xmm7 movsd 4 * SIZE(X), %xmm8 mulsd ALPHA, %xmm0 movsd 5 * SIZE(X), %xmm9 mulsd ALPHA, %xmm1 movsd 6 * SIZE(X), %xmm10 mulsd ALPHA, %xmm2 movsd 7 * SIZE(X), %xmm11 mulsd ALPHA, %xmm3 decq %rax jle .L12 ALIGN_3 .L11: #ifdef PREFETCH PREFETCH (PREFETCHSIZE + 0) - PREOFFSET(X) #endif addsd %xmm4, %xmm0 movsd 4 * SIZE(Y), %xmm4 addsd %xmm5, %xmm1 movsd 5 * SIZE(Y), %xmm5 addsd %xmm6, %xmm2 movsd 6 * SIZE(Y), %xmm6 addsd %xmm7, %xmm3 movsd 7 * SIZE(Y), %xmm7 movsd %xmm0, 0 * SIZE(Y) mulsd ALPHA, %xmm8 movsd 8 * SIZE(X), %xmm0 movsd %xmm1, 1 * SIZE(Y) mulsd ALPHA, %xmm9 movsd 9 * SIZE(X), %xmm1 movsd %xmm2, 2 * SIZE(Y) mulsd ALPHA, %xmm10 movsd 10 * SIZE(X), %xmm2 movsd %xmm3, 3 * SIZE(Y) mulsd ALPHA, %xmm11 movsd 11 * SIZE(X), %xmm3 #ifdef PREFETCHW PREFETCHW (PREFETCHSIZE + 0) - PREOFFSET(Y) #endif addsd %xmm4, %xmm8 movsd 8 * SIZE(Y), %xmm4 addsd %xmm5, %xmm9 movsd 9 * SIZE(Y), %xmm5 addsd %xmm6, %xmm10 movsd 10 * SIZE(Y), %xmm6 addsd %xmm7, %xmm11 movsd 11 * SIZE(Y), %xmm7 movsd %xmm8, 4 * SIZE(Y) mulsd ALPHA, %xmm0 movsd 12 * SIZE(X), %xmm8 movsd %xmm9, 5 * SIZE(Y) mulsd ALPHA, %xmm1 movsd 13 * SIZE(X), %xmm9 movsd %xmm10, 6 * SIZE(Y) mulsd ALPHA, %xmm2 movsd 14 * SIZE(X), %xmm10 movsd %xmm11, 7 * SIZE(Y) mulsd ALPHA, %xmm3 movsd 15 * SIZE(X), %xmm11 addq $8 * SIZE, Y addq $8 * SIZE, X decq %rax jg .L11 ALIGN_3 .L12: addsd %xmm4, %xmm0 movsd 4 * SIZE(Y), %xmm4 addsd %xmm5, %xmm1 movsd 5 * SIZE(Y), %xmm5 addsd %xmm6, %xmm2 movsd 6 * SIZE(Y), %xmm6 addsd %xmm7, %xmm3 movsd 7 * SIZE(Y), %xmm7 movsd %xmm0, 0 * SIZE(Y) mulsd ALPHA, %xmm8 movsd %xmm1, 1 * SIZE(Y) mulsd ALPHA, %xmm9 movsd %xmm2, 2 * SIZE(Y) mulsd ALPHA, %xmm10 movsd %xmm3, 3 * SIZE(Y) mulsd ALPHA, %xmm11 addsd %xmm4, %xmm8 addsd %xmm5, %xmm9 addsd %xmm6, %xmm10 addsd %xmm7, %xmm11 movsd %xmm8, 4 * SIZE(Y) movsd %xmm9, 5 * SIZE(Y) movsd %xmm10, 6 * SIZE(Y) movsd %xmm11, 7 * SIZE(Y) addq $8 * SIZE, X addq $8 * SIZE, Y ALIGN_3 .L13: movq M, %rax andq $4, %rax jle .L15 ALIGN_3 movsd 0 * SIZE(X), %xmm0 movsd 1 * SIZE(X), %xmm1 movsd 2 * SIZE(X), %xmm2 movsd 3 * SIZE(X), %xmm3 movsd 0 * SIZE(Y), %xmm4 mulsd ALPHA, %xmm0 movsd 1 * SIZE(Y), %xmm5 mulsd ALPHA, %xmm1 movsd 2 * SIZE(Y), %xmm6 mulsd ALPHA, %xmm2 movsd 3 * SIZE(Y), %xmm7 mulsd ALPHA, %xmm3 addsd %xmm4, %xmm0 addsd %xmm5, %xmm1 addsd %xmm6, %xmm2 addsd %xmm7, %xmm3 movsd %xmm0, 0 * SIZE(Y) movsd %xmm1, 1 * SIZE(Y) movsd %xmm2, 2 * SIZE(Y) movsd %xmm3, 3 * SIZE(Y) addq $4 * SIZE, X addq $4 * SIZE, Y ALIGN_3 .L15: movq M, %rax andq $2, %rax jle .L16 ALIGN_3 movsd 0 * SIZE(X), %xmm0 movsd 0 * SIZE(Y), %xmm4 movsd 1 * SIZE(X), %xmm1 movsd 1 * SIZE(Y), %xmm5 mulsd ALPHA, %xmm0 mulsd ALPHA, %xmm1 addsd %xmm4, %xmm0 addsd %xmm5, %xmm1 movsd %xmm0, 0 * SIZE(Y) movsd %xmm1, 1 * SIZE(Y) addq $2 * SIZE, X addq $2 * SIZE, Y ALIGN_3 .L16: movq M, %rax andq $1, %rax jle .L19 ALIGN_3 movsd 0 * SIZE(X), %xmm0 mulsd ALPHA, %xmm0 addsd 0 * SIZE(Y), %xmm0 movsd %xmm0, 0 * SIZE(Y) addq $SIZE, Y ALIGN_3 .L19: xorq %rax,%rax RESTOREREGISTERS ret ALIGN_3 .L20: movq Y, YY movq M, %rax sarq $3, %rax jle .L23 movsd (X), %xmm0 addq INCX, X movsd (X), %xmm1 addq INCX, X movsd (X), %xmm2 addq INCX, X movsd (X), %xmm3 addq INCX, X movsd (Y), %xmm4 addq INCY, Y movsd (Y), %xmm5 addq INCY, Y movsd (Y), %xmm6 addq INCY, Y movsd (Y), %xmm7 addq INCY, Y movsd (X), %xmm8 addq INCX, X mulsd ALPHA, %xmm0 movsd (X), %xmm9 addq INCX, X mulsd ALPHA, %xmm1 movsd (X), %xmm10 addq INCX, X mulsd ALPHA, %xmm2 movsd (X), %xmm11 addq INCX, X mulsd ALPHA, %xmm3 decq %rax jle .L22 ALIGN_3 .L21: addsd %xmm4, %xmm0 movsd (Y), %xmm4 addq INCY, Y addsd %xmm5, %xmm1 movsd (Y), %xmm5 addq INCY, Y addsd %xmm6, %xmm2 movsd (Y), %xmm6 addq INCY, Y addsd %xmm7, %xmm3 movsd (Y), %xmm7 addq INCY, Y movsd %xmm0, (YY) addq INCY, YY movsd (X), %xmm0 addq INCX, X mulsd ALPHA, %xmm8 movsd %xmm1, (YY) addq INCY, YY movsd (X), %xmm1 addq INCX, X mulsd ALPHA, %xmm9 movsd %xmm2, (YY) addq INCY, YY movsd (X), %xmm2 addq INCX, X mulsd ALPHA, %xmm10 movsd %xmm3, (YY) addq INCY, YY movsd (X), %xmm3 addq INCX, X mulsd ALPHA, %xmm11 addsd %xmm4, %xmm8 movsd (Y), %xmm4 addq INCY, Y addsd %xmm5, %xmm9 movsd (Y), %xmm5 addq INCY, Y addsd %xmm6, %xmm10 movsd (Y), %xmm6 addq INCY, Y addsd %xmm7, %xmm11 movsd (Y), %xmm7 addq INCY, Y movsd %xmm8, (YY) addq INCY, YY movsd (X), %xmm8 addq INCX, X mulsd ALPHA, %xmm0 movsd %xmm9, (YY) addq INCY, YY movsd (X), %xmm9 addq INCX, X mulsd ALPHA, %xmm1 movsd %xmm10, (YY) addq INCY, YY movsd (X), %xmm10 addq INCX, X mulsd ALPHA, %xmm2 movsd %xmm11, (YY) addq INCY, YY movsd (X), %xmm11 addq INCX, X mulsd ALPHA, %xmm3 decq %rax jg .L21 ALIGN_3 .L22: addsd %xmm4, %xmm0 movsd (Y), %xmm4 addq INCY, Y addsd %xmm5, %xmm1 movsd (Y), %xmm5 addq INCY, Y addsd %xmm6, %xmm2 movsd (Y), %xmm6 addq INCY, Y addsd %xmm7, %xmm3 movsd (Y), %xmm7 addq INCY, Y movsd %xmm0, (YY) addq INCY, YY mulsd ALPHA, %xmm8 movsd %xmm1, (YY) addq INCY, YY mulsd ALPHA, %xmm9 movsd %xmm2, (YY) addq INCY, YY mulsd ALPHA, %xmm10 movsd %xmm3, (YY) addq INCY, YY mulsd ALPHA, %xmm11 addsd %xmm4, %xmm8 addsd %xmm5, %xmm9 addsd %xmm6, %xmm10 addsd %xmm7, %xmm11 movsd %xmm8, (YY) addq INCY, YY movsd %xmm9, (YY) addq INCY, YY movsd %xmm10, (YY) addq INCY, YY movsd %xmm11, (YY) addq INCY, YY ALIGN_3 .L23: movq M, %rax andq $4, %rax jle .L25 ALIGN_3 movsd (X), %xmm0 addq INCX, X movsd (Y), %xmm4 addq INCY, Y movsd (X), %xmm1 addq INCX, X movsd (Y), %xmm5 addq INCY, Y movsd (X), %xmm2 addq INCX, X mulsd ALPHA, %xmm0 movsd (Y), %xmm6 addq INCY, Y mulsd ALPHA, %xmm1 movsd (X), %xmm3 addq INCX, X mulsd ALPHA, %xmm2 movsd (Y), %xmm7 addq INCY, Y mulsd ALPHA, %xmm3 addsd %xmm4, %xmm0 addsd %xmm5, %xmm1 addsd %xmm6, %xmm2 addsd %xmm7, %xmm3 movsd %xmm0, (YY) addq INCY, YY movsd %xmm1, (YY) addq INCY, YY movsd %xmm2, (YY) addq INCY, YY movsd %xmm3, (YY) addq INCY, YY ALIGN_3 .L25: movq M, %rax andq $2, %rax jle .L26 ALIGN_3 movsd (X), %xmm0 addq INCX, X movsd (Y), %xmm4 addq INCY, Y movsd (X), %xmm1 addq INCX, X movsd (Y), %xmm5 addq INCY, Y mulsd ALPHA, %xmm0 mulsd ALPHA, %xmm1 addsd %xmm4, %xmm0 addsd %xmm5, %xmm1 movsd %xmm0, (YY) addq INCY, YY movsd %xmm1, (YY) addq INCY, YY ALIGN_3 .L26: movq M, %rax andq $1, %rax jle .L29 ALIGN_3 movsd (X), %xmm0 mulsd ALPHA, %xmm0 addsd (Y), %xmm0 movsd %xmm0, (YY) addq $SIZE, Y ALIGN_3 .L29: xorq %rax, %rax RESTOREREGISTERS ret EPILOGUE
{ "pile_set_name": "Github" }
- content_for :extrajs do :javascript var MAP_PARAMS = #{@params.to_json.html_safe}; window._.any = _.some; // Patch so torque won't miss underscore = javascript_include_tag "https://cdnjs.cloudflare.com/ajax/libs/leaflet/1.2.0/leaflet.js" = javascript_include_tag "torque.full.uncompressed" = javascript_include_tag "observations-torque-webpack" - content_for :extracss do = stylesheet_link_tag "observations/torquemap" = stylesheet_link_tag "https://cdnjs.cloudflare.com/ajax/libs/leaflet/1.2.0/leaflet.css" #app #initial-loading.text-center .loading_spinner
{ "pile_set_name": "Github" }
--- /home/xilinx/tm_aarch64_diff/orig/etc/issue.net 2018-08-21 16:29:46.954460309 +0000 +++ /home/xilinx/tm_aarch64_diff/final/etc/issue.net 2018-08-21 16:08:09.696396200 +0000 @@ -1 +1 @@ -Ubuntu 18.04 LTS +PYNQ Linux, based on Ubuntu 18.04
{ "pile_set_name": "Github" }
{ "python.pythonPath": "/usr/bin/python" }
{ "pile_set_name": "Github" }
// Copyright (c) 2012-2020 Wojciech Figat. All rights reserved. using System; namespace FlaxEngine { partial class DebugDraw { #if !FLAX_EDITOR /// <summary> /// Draws the collected debug shapes to the output. /// </summary> /// <param name="renderContext">The rendering context.</param> /// <param name="target">The rendering output surface handle.</param> /// <param name="depthBuffer">The custom depth texture used for depth test. Can be MSAA. Must match target surface size.</param> /// <param name="enableDepthTest">True if perform manual depth test with scene depth buffer when rendering the primitives. Uses custom shader and the scene depth buffer.</param> public static void Draw(ref RenderContext renderContext, GPUTextureView target = null, GPUTextureView depthBuffer = null, bool enableDepthTest = false) { } /// <summary> /// Draws the debug shapes for the given collection of selected actors and other scene actors debug shapes. /// </summary> /// <param name="selectedActors">The list of actors to draw.</param> /// <param name="selectedActorsCount">The size of the list of actors.</param> public static void DrawActors(IntPtr selectedActors, int selectedActorsCount) { } /// <summary> /// Draws the line. /// </summary> /// <param name="start">The start point.</param> /// <param name="end">The end point.</param> /// <param name="color">The color.</param> /// <param name="duration">The duration (in seconds). Use 0 to draw it only once.</param> /// <param name="depthTest">If set to <c>true</c> depth test will be performed, otherwise depth will be ignored.</param> public static void DrawLine(Vector3 start, Vector3 end, Color color, float duration = 0.0f, bool depthTest = true) { } /// <summary> /// Draws the lines. Line positions are located one after another (e.g. l0.start, l0.end, l1.start, l1.end,...). /// </summary> /// <param name="lines">The list of vertices for lines (must have multiple of 2 elements).</param> /// <param name="transform">The custom matrix used to transform all line vertices.</param> /// <param name="color">The color.</param> /// <param name="duration">The duration (in seconds). Use 0 to draw it only once.</param> /// <param name="depthTest">If set to <c>true</c> depth test will be performed, otherwise depth will be ignored.</param> public static void DrawLines(Vector3[] lines, Matrix transform, Color color, float duration = 0.0f, bool depthTest = true) { } /// <summary> /// Draws the circle. /// </summary> /// <param name="position">The center position.</param> /// <param name="normal">The normal vector direction.</param> /// <param name="radius">The radius.</param> /// <param name="color">The color.</param> /// <param name="duration">The duration (in seconds). Use 0 to draw it only once.</param> /// <param name="depthTest">If set to <c>true</c> depth test will be performed, otherwise depth will be ignored.</param> public static void DrawCircle(Vector3 position, Vector3 normal, float radius, Color color, float duration = 0.0f, bool depthTest = true) { } /// <summary> /// Draws the wireframe triangle. /// </summary> /// <param name="v0">The first triangle vertex.</param> /// <param name="v1">The second triangle vertex.</param> /// <param name="v2">The third triangle vertex.</param> /// <param name="color">The color.</param> /// <param name="duration">The duration (in seconds). Use 0 to draw it only once.</param> /// <param name="depthTest">If set to <c>true</c> depth test will be performed, otherwise depth will be ignored.</param> public static void DrawWireTriangle(Vector3 v0, Vector3 v1, Vector3 v2, Color color, float duration = 0.0f, bool depthTest = true) { } /// <summary> /// Draws the triangle. /// </summary> /// <param name="v0">The first triangle vertex.</param> /// <param name="v1">The second triangle vertex.</param> /// <param name="v2">The third triangle vertex.</param> /// <param name="color">The color.</param> /// <param name="duration">The duration (in seconds). Use 0 to draw it only once.</param> /// <param name="depthTest">If set to <c>true</c> depth test will be performed, otherwise depth will be ignored.</param> public static void DrawTriangle(Vector3 v0, Vector3 v1, Vector3 v2, Color color, float duration = 0.0f, bool depthTest = true) { } /// <summary> /// Draws the triangles. /// </summary> /// <param name="vertices">The triangle vertices list (must have multiple of 3 elements).</param> /// <param name="color">The color.</param> /// <param name="duration">The duration (in seconds). Use 0 to draw it only once.</param> /// <param name="depthTest">If set to <c>true</c> depth test will be performed, otherwise depth will be ignored.</param> public static void DrawTriangles(Vector3[] vertices, Color color, float duration = 0.0f, bool depthTest = true) { } /// <summary> /// Draws the triangles using the given index buffer. /// </summary> /// <param name="vertices">The triangle vertices list.</param> /// <param name="indices">The triangle indices list (must have multiple of 3 elements).</param> /// <param name="color">The color.</param> /// <param name="duration">The duration (in seconds). Use 0 to draw it only once.</param> /// <param name="depthTest">If set to <c>true</c> depth test will be performed, otherwise depth will be ignored.</param> public static void DrawTriangles(Vector3[] vertices, int[] indices, Color color, float duration = 0.0f, bool depthTest = true) { } /// <summary> /// Draws the wireframe box. /// </summary> /// <param name="box">The box.</param> /// <param name="color">The color.</param> /// <param name="duration">The duration (in seconds). Use 0 to draw it only once.</param> /// <param name="depthTest">If set to <c>true</c> depth test will be performed, otherwise depth will be ignored.</param> public static void DrawWireBox(BoundingBox box, Color color, float duration = 0.0f, bool depthTest = true) { } /// <summary> /// Draws the wireframe frustum. /// </summary> /// <param name="frustum">The frustum.</param> /// <param name="color">The color.</param> /// <param name="duration">The duration (in seconds). Use 0 to draw it only once.</param> /// <param name="depthTest">If set to <c>true</c> depth test will be performed, otherwise depth will be ignored.</param> public static void DrawWireFrustum(BoundingFrustum frustum, Color color, float duration = 0.0f, bool depthTest = true) { } /// <summary> /// Draws the wireframe box. /// </summary> /// <param name="box">The box.</param> /// <param name="color">The color.</param> /// <param name="duration">The duration (in seconds). Use 0 to draw it only once.</param> /// <param name="depthTest">If set to <c>true</c> depth test will be performed, otherwise depth will be ignored.</param> public static void DrawWireBox(OrientedBoundingBox box, Color color, float duration = 0.0f, bool depthTest = true) { } /// <summary> /// Draws the wireframe sphere. /// </summary> /// <param name="sphere">The sphere.</param> /// <param name="color">The color.</param> /// <param name="duration">The duration (in seconds). Use 0 to draw it only once.</param> /// <param name="depthTest">If set to <c>true</c> depth test will be performed, otherwise depth will be ignored.</param> public static void DrawWireSphere(BoundingSphere sphere, Color color, float duration = 0.0f, bool depthTest = true) { } /// <summary> /// Draws the sphere. /// </summary> /// <param name="sphere">The sphere.</param> /// <param name="color">The color.</param> /// <param name="duration">The duration (in seconds). Use 0 to draw it only once.</param> /// <param name="depthTest">If set to <c>true</c> depth test will be performed, otherwise depth will be ignored.</param> public static void DrawSphere(BoundingSphere sphere, Color color, float duration = 0.0f, bool depthTest = true) { } /// <summary> /// Draws the wireframe tube. /// </summary> /// <param name="position">The center position.</param> /// <param name="orientation">The orientation.</param> /// <param name="radius">The radius.</param> /// <param name="length">The length.</param> /// <param name="color">The color.</param> /// <param name="duration">The duration (in seconds). Use 0 to draw it only once.</param> /// <param name="depthTest">If set to <c>true</c> depth test will be performed, otherwise depth will be ignored.</param> public static void DrawWireTube(Vector3 position, Quaternion orientation, float radius, float length, Color color, float duration = 0.0f, bool depthTest = true) { } /// <summary> /// Draws the wireframe cylinder. /// </summary> /// <param name="position">The center position.</param> /// <param name="orientation">The orientation.</param> /// <param name="radius">The radius.</param> /// <param name="height">The height.</param> /// <param name="color">The color.</param> /// <param name="duration">The duration (in seconds). Use 0 to draw it only once.</param> /// <param name="depthTest">If set to <c>true</c> depth test will be performed, otherwise depth will be ignored.</param> public static void DrawWireCylinder(Vector3 position, Quaternion orientation, float radius, float height, Color color, float duration = 0.0f, bool depthTest = true) { } /// <summary> /// Draws the wireframe arrow. /// </summary> /// <param name="position">The arrow origin position.</param> /// <param name="orientation">The orientation (defines the arrow direction).</param> /// <param name="scale">The arrow scale (used to adjust the arrow size).</param> /// <param name="color">The color.</param> /// <param name="duration">The duration (in seconds). Use 0 to draw it only once.</param> /// <param name="depthTest">If set to <c>true</c> depth test will be performed, otherwise depth will be ignored.</param> public static void DrawWireArrow(Vector3 position, Quaternion orientation, float scale, Color color, float duration = 0.0f, bool depthTest = true) { } /// <summary> /// Draws the box. /// </summary> /// <param name="box">The box.</param> /// <param name="color">The color.</param> /// <param name="duration">The duration (in seconds). Use 0 to draw it only once.</param> /// <param name="depthTest">If set to <c>true</c> depth test will be performed, otherwise depth will be ignored.</param> public static void DrawBox(BoundingBox box, Color color, float duration = 0.0f, bool depthTest = true) { } /// <summary> /// Draws the box. /// </summary> /// <param name="box">The box.</param> /// <param name="color">The color.</param> /// <param name="duration">The duration (in seconds). Use 0 to draw it only once.</param> /// <param name="depthTest">If set to <c>true</c> depth test will be performed, otherwise depth will be ignored.</param> public static void DrawBox(OrientedBoundingBox box, Color color, float duration = 0.0f, bool depthTest = true) { } #endif } }
{ "pile_set_name": "Github" }
/* This header contains compatibility defines for the original tinf API and uzlib 2.x and below API. These defines are deprecated and going to be removed in the future, so applications should migrate to new uzlib API. */ #define TINF_DATA struct uzlib_uncomp #define destSize dest_size #define destStart dest_start #define readSource source_read_cb
{ "pile_set_name": "Github" }
using System.Runtime.CompilerServices; [assembly: InternalsVisibleTo("ShaderTools.CodeAnalysis.EditorFeatures")] [assembly: InternalsVisibleTo("ShaderTools.CodeAnalysis.EditorFeatures.15")] [assembly: InternalsVisibleTo("ShaderTools.CodeAnalysis.EditorFeatures.16")] [assembly: InternalsVisibleTo("ShaderTools.CodeAnalysis.Hlsl.EditorFeatures")]
{ "pile_set_name": "Github" }
This document provides background reading for memory models and related tools. These documents are aimed at kernel hackers who are interested in memory models. Hardware manuals and models =========================== o SPARC International Inc. (Ed.). 1994. "The SPARC Architecture Reference Manual Version 9". SPARC International Inc. o Compaq Computer Corporation (Ed.). 2002. "Alpha Architecture Reference Manual". Compaq Computer Corporation. o Intel Corporation (Ed.). 2002. "A Formal Specification of Intel Itanium Processor Family Memory Ordering". Intel Corporation. o Intel Corporation (Ed.). 2002. "Intel 64 and IA-32 Architectures Software Developer’s Manual". Intel Corporation. o Peter Sewell, Susmit Sarkar, Scott Owens, Francesco Zappa Nardelli, and Magnus O. Myreen. 2010. "x86-TSO: A Rigorous and Usable Programmer's Model for x86 Multiprocessors". Commun. ACM 53, 7 (July, 2010), 89-97. http://doi.acm.org/10.1145/1785414.1785443 o IBM Corporation (Ed.). 2009. "Power ISA Version 2.06". IBM Corporation. o ARM Ltd. (Ed.). 2009. "ARM Barrier Litmus Tests and Cookbook". ARM Ltd. o Susmit Sarkar, Peter Sewell, Jade Alglave, Luc Maranget, and Derek Williams. 2011. "Understanding POWER Multiprocessors". In Proceedings of the 32Nd ACM SIGPLAN Conference on Programming Language Design and Implementation (PLDI ’11). ACM, New York, NY, USA, 175–186. o Susmit Sarkar, Kayvan Memarian, Scott Owens, Mark Batty, Peter Sewell, Luc Maranget, Jade Alglave, and Derek Williams. 2012. "Synchronising C/C++ and POWER". In Proceedings of the 33rd ACM SIGPLAN Conference on Programming Language Design and Implementation (PLDI '12). ACM, New York, NY, USA, 311-322. o ARM Ltd. (Ed.). 2014. "ARM Architecture Reference Manual (ARMv8, for ARMv8-A architecture profile)". ARM Ltd. o Imagination Technologies, LTD. 2015. "MIPS(R) Architecture For Programmers, Volume II-A: The MIPS64(R) Instruction, Set Reference Manual". Imagination Technologies, LTD. https://imgtec.com/?do-download=4302. o Shaked Flur, Kathryn E. Gray, Christopher Pulte, Susmit Sarkar, Ali Sezgin, Luc Maranget, Will Deacon, and Peter Sewell. 2016. "Modelling the ARMv8 Architecture, Operationally: Concurrency and ISA". In Proceedings of the 43rd Annual ACM SIGPLAN-SIGACT Symposium on Principles of Programming Languages (POPL ’16). ACM, New York, NY, USA, 608–621. o Shaked Flur, Susmit Sarkar, Christopher Pulte, Kyndylan Nienhuis, Luc Maranget, Kathryn E. Gray, Ali Sezgin, Mark Batty, and Peter Sewell. 2017. "Mixed-size Concurrency: ARM, POWER, C/C++11, and SC". In Proceedings of the 44th ACM SIGPLAN Symposium on Principles of Programming Languages (POPL 2017). ACM, New York, NY, USA, 429–442. o Christopher Pulte, Shaked Flur, Will Deacon, Jon French, Susmit Sarkar, and Peter Sewell. 2018. "Simplifying ARM concurrency: multicopy-atomic axiomatic and operational models for ARMv8". In Proceedings of the ACM on Programming Languages, Volume 2, Issue POPL, Article No. 19. ACM, New York, NY, USA. Linux-kernel memory model ========================= o Jade Alglave, Luc Maranget, Paul E. McKenney, Andrea Parri, and Alan Stern. 2018. "Frightening small children and disconcerting grown-ups: Concurrency in the Linux kernel". In Proceedings of the 23rd International Conference on Architectural Support for Programming Languages and Operating Systems (ASPLOS 2018). ACM, New York, NY, USA, 405-418. Webpage: http://diy.inria.fr/linux/. o Jade Alglave, Luc Maranget, Paul E. McKenney, Andrea Parri, and Alan Stern. 2017. "A formal kernel memory-ordering model (part 1)" Linux Weekly News. https://lwn.net/Articles/718628/ o Jade Alglave, Luc Maranget, Paul E. McKenney, Andrea Parri, and Alan Stern. 2017. "A formal kernel memory-ordering model (part 2)" Linux Weekly News. https://lwn.net/Articles/720550/ Memory-model tooling ==================== o Daniel Jackson. 2002. "Alloy: A Lightweight Object Modelling Notation". ACM Trans. Softw. Eng. Methodol. 11, 2 (April 2002), 256–290. http://doi.acm.org/10.1145/505145.505149 o Jade Alglave, Luc Maranget, and Michael Tautschnig. 2014. "Herding Cats: Modelling, Simulation, Testing, and Data Mining for Weak Memory". ACM Trans. Program. Lang. Syst. 36, 2, Article 7 (July 2014), 7:1–7:74 pages. o Jade Alglave, Patrick Cousot, and Luc Maranget. 2016. "Syntax and semantics of the weak consistency model specification language cat". CoRR abs/1608.07531 (2016). http://arxiv.org/abs/1608.07531 Memory-model comparisons ======================== o Paul E. McKenney, Ulrich Weigand, Andrea Parri, and Boqun Feng. 2016. "Linux-Kernel Memory Model". (6 June 2016). http://open-std.org/JTC1/SC22/WG21/docs/papers/2016/p0124r2.html.
{ "pile_set_name": "Github" }
<?xml version="1.0" encoding="UTF-8"?> <project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd"> <modelVersion>4.0.0</modelVersion> <parent> <groupId>livelessons</groupId> <artifactId>livelessons-security</artifactId> <version>1.0.0-SNAPSHOT</version> </parent> <artifactId>livelessons-security-basic</artifactId> <properties> <main.basedir>../..</main.basedir> </properties> <dependencies> <dependency> <groupId>org.apache.httpcomponents</groupId> <artifactId>httpclient</artifactId> </dependency> <dependency> <groupId>org.springframework.boot</groupId> <artifactId>spring-boot-starter-web</artifactId> </dependency> <dependency> <groupId>org.springframework.boot</groupId> <artifactId>spring-boot-starter-security</artifactId> </dependency> <dependency> <groupId>org.springframework.boot</groupId> <artifactId>spring-boot-starter-actuator</artifactId> </dependency> <dependency> <groupId>org.springframework.boot</groupId> <artifactId>spring-boot-starter-jdbc</artifactId> </dependency> <dependency> <groupId>com.h2database</groupId> <artifactId>h2</artifactId> </dependency> <dependency> <groupId>org.springframework.boot</groupId> <artifactId>spring-boot-starter-test</artifactId> <scope>test</scope> </dependency> </dependencies> </project>
{ "pile_set_name": "Github" }
{ "images": [ { "filename": "ic_pie_chart_18pt.png", "idiom": "universal", "scale": "1x" }, { "filename": "ic_pie_chart_18pt_2x.png", "idiom": "universal", "scale": "2x" }, { "filename": "ic_pie_chart_18pt_3x.png", "idiom": "universal", "scale": "3x" } ], "info": { "author": "xcode", "version": 1 } }
{ "pile_set_name": "Github" }
define(function () { /** * Gets full query as string with all special chars decoded. */ function getQuery(url) { url = url.replace(/#.*/, ''); //removes hash (to avoid getting hash query) var queryString = /\?[a-zA-Z0-9\=\&\%\$\-\_\.\+\!\*\'\(\)\,]+/.exec(url); //valid chars according to: http://www.ietf.org/rfc/rfc1738.txt return (queryString)? decodeURIComponent(queryString[0].replace(/\+/g,' ')) : ''; } return getQuery; });
{ "pile_set_name": "Github" }
<template> <component :is="tag" :class="classList"> <slot></slot> </component> </template> <script> export default { name: 'CFooter', props: { tag: { type: String, default: 'footer' }, fixed: { type: Boolean, default: true } }, computed: { classList () { return [ 'c-footer', { 'c-footer-fixed': this.fixed } ] } } } </script>
{ "pile_set_name": "Github" }
package com.alenbeyond.runoob.greendao.bean; import org.greenrobot.greendao.annotation.Entity; import org.greenrobot.greendao.annotation.Id; import org.greenrobot.greendao.annotation.Generated; /** * Created by Alen on 2016/9/2. */ @Entity public class RNApiGroup { @Id private Long id; private int reactId; private String name; public RNApiGroup() { } public RNApiGroup(int reactId, String name) { this.reactId = reactId; this.name = name; } @Generated(hash = 1186492384) public RNApiGroup(Long id, int reactId, String name) { this.id = id; this.reactId = reactId; this.name = name; } public int getReactId() { return reactId; } public void setReactId(int reactId) { this.reactId = reactId; } public String getName() { return name; } public void setName(String name) { this.name = name; } public Long getId() { return this.id; } public void setId(Long id) { this.id = id; } }
{ "pile_set_name": "Github" }
/* Rectangle Out */ @mixin rectangle-out { @include hacks(); position: relative; background: $primaryColor; @include prefixed(transition-property, color); @include prefixed(transition-duration, $mediumDuration); &:before { content: ""; position: absolute; z-index: -1; top: 0; left: 0; right: 0; bottom: 0; background: $activeColor; @include prefixed(transform, scale(0)); @include prefixed(transition-property, transform); @include prefixed(transition-duration, $mediumDuration); @include prefixed(transition-timing-function, ease-out); } &:hover, &:focus, &:active { color: white; &:before { @include prefixed(transform, scale(1)); } } }
{ "pile_set_name": "Github" }
class Html2HamlTest def test_doctype empty_body = "\n%html\n %head\n %body" assert_equal '!!!' + empty_body, render("<!DOCTYPE html>") assert_equal '!!! 1.1' + empty_body, render('<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN" "http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">') assert_equal '!!! Strict' + empty_body, render('<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">') assert_equal '!!! Frameset' + empty_body, render('<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Frameset//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-frameset.dtd">') assert_equal '!!! Mobile 1.2' + empty_body, render('<!DOCTYPE html PUBLIC "-//WAPFORUM//DTD XHTML Mobile 1.2//EN" "http://www.openmobilealliance.org/tech/DTD/xhtml-mobile12.dtd">') assert_equal '!!! Basic 1.1' + empty_body, render('<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML Basic 1.1//EN" "http://www.w3.org/TR/xhtml-basic/xhtml-basic11.dtd">') assert_equal '!!!' + empty_body, render('<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">') assert_equal '!!! Strict' + empty_body, render('<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd">') assert_equal '!!! Frameset' + empty_body, render('<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Frameset//EN" "http://www.w3.org/TR/html4/frameset.dtd">') assert_equal '!!!' + empty_body, render('<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">') end def test_xhtml_strict_doctype assert_equal(<<HAML.rstrip, render(<<HTML)) !!! Strict %html %head %body HAML <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"> HTML end def test_html_document_without_doctype assert_equal(<<HAML.rstrip, render(<<HTML)) %html %head %title Hello %body %p Hello HAML <html> <head> <title>Hello</title> </head> <body> <p>Hello</p> </body> </html> HTML end def test_should_have_attributes_without_values assert_equal('%input{:disabled => ""}/', render('<input disabled>')) end def test_style_to_css_filter_with_following_content assert_equal(<<HAML.rstrip, render(<<HTML)) %head :css foo { bar: baz; } %body Hello HAML <head> <style type="text/css"> foo { bar: baz; } </style> </head> <body>Hello</body> HTML end end
{ "pile_set_name": "Github" }
package com.bookstore.entity; import java.time.LocalDateTime; import javax.persistence.EntityListeners; import javax.persistence.GeneratedValue; import javax.persistence.GenerationType; import javax.persistence.Id; import javax.persistence.MappedSuperclass; import org.springframework.data.annotation.CreatedBy; import org.springframework.data.annotation.CreatedDate; import org.springframework.data.annotation.LastModifiedBy; import org.springframework.data.annotation.LastModifiedDate; import org.springframework.data.jpa.domain.support.AuditingEntityListener; @MappedSuperclass @EntityListeners({AuditingEntityListener.class}) public abstract class BaseEntity<U> { @Id @GeneratedValue(strategy = GenerationType.IDENTITY) protected Long id; @CreatedDate protected LocalDateTime created; @CreatedBy protected U createdBy; @LastModifiedDate protected LocalDateTime lastModified; @LastModifiedBy protected U lastModifiedBy; }
{ "pile_set_name": "Github" }
#! /bin/sh # # install - install a program, script, or datafile # This comes from X11R5 (mit/util/scripts/install.sh). # # Copyright 1991 by the Massachusetts Institute of Technology # # Permission to use, copy, modify, distribute, and sell this software and its # documentation for any purpose is hereby granted without fee, provided that # the above copyright notice appear in all copies and that both that # copyright notice and this permission notice appear in supporting # documentation, and that the name of M.I.T. not be used in advertising or # publicity pertaining to distribution of the software without specific, # written prior permission. M.I.T. makes no representations about the # suitability of this software for any purpose. It is provided "as is" # without express or implied warranty. # # Calling this script install-sh is preferred over install.sh, to prevent # `make' implicit rules from creating a file called install from it # when there is no Makefile. # # This script is compatible with the BSD install script, but was written # from scratch. It can only install one file at a time, a restriction # shared with many OS's install programs. # set DOITPROG to echo to test this script # Don't use :- since 4.3BSD and earlier shells don't like it. doit="${DOITPROG-}" # put in absolute paths if you don't have them in your path; or use env. vars. mvprog="${MVPROG-mv}" cpprog="${CPPROG-cp}" chmodprog="${CHMODPROG-chmod}" chownprog="${CHOWNPROG-chown}" chgrpprog="${CHGRPPROG-chgrp}" stripprog="${STRIPPROG-strip}" rmprog="${RMPROG-rm}" mkdirprog="${MKDIRPROG-mkdir}" transformbasename="" transform_arg="" instcmd="$mvprog" chmodcmd="$chmodprog 0755" chowncmd="" chgrpcmd="" stripcmd="" rmcmd="$rmprog -f" mvcmd="$mvprog" src="" dst="" dir_arg="" while [ x"$1" != x ]; do case $1 in -c) instcmd="$cpprog" shift continue;; -d) dir_arg=true shift continue;; -m) chmodcmd="$chmodprog $2" shift shift continue;; -o) chowncmd="$chownprog $2" shift shift continue;; -g) chgrpcmd="$chgrpprog $2" shift shift continue;; -s) stripcmd="$stripprog" shift continue;; -t=*) transformarg=`echo $1 | sed 's/-t=//'` shift continue;; -b=*) transformbasename=`echo $1 | sed 's/-b=//'` shift continue;; *) if [ x"$src" = x ] then src=$1 else # this colon is to work around a 386BSD /bin/sh bug : dst=$1 fi shift continue;; esac done if [ x"$src" = x ] then echo "install: no input file specified" exit 1 else true fi if [ x"$dir_arg" != x ]; then dst=$src src="" if [ -d $dst ]; then instcmd=: else instcmd=mkdir fi else # Waiting for this to be detected by the "$instcmd $src $dsttmp" command # might cause directories to be created, which would be especially bad # if $src (and thus $dsttmp) contains '*'. if [ -f $src -o -d $src ] then true else echo "install: $src does not exist" exit 1 fi if [ x"$dst" = x ] then echo "install: no destination specified" exit 1 else true fi # If destination is a directory, append the input filename; if your system # does not like double slashes in filenames, you may need to add some logic if [ -d $dst ] then dst="$dst"/`basename $src` else true fi fi ## this sed command emulates the dirname command dstdir=`echo $dst | sed -e 's,[^/]*$,,;s,/$,,;s,^$,.,'` # Make sure that the destination directory exists. # this part is taken from Noah Friedman's mkinstalldirs script # Skip lots of stat calls in the usual case. if [ ! -d "$dstdir" ]; then defaultIFS=' ' IFS="${IFS-${defaultIFS}}" oIFS="${IFS}" # Some sh's can't handle IFS=/ for some reason. IFS='%' set - `echo ${dstdir} | sed -e 's@/@%@g' -e 's@^%@/@'` IFS="${oIFS}" pathcomp='' while [ $# -ne 0 ] ; do pathcomp="${pathcomp}${1}" shift if [ ! -d "${pathcomp}" ] ; then $mkdirprog "${pathcomp}" else true fi pathcomp="${pathcomp}/" done fi if [ x"$dir_arg" != x ] then $doit $instcmd $dst && if [ x"$chowncmd" != x ]; then $doit $chowncmd $dst; else true ; fi && if [ x"$chgrpcmd" != x ]; then $doit $chgrpcmd $dst; else true ; fi && if [ x"$stripcmd" != x ]; then $doit $stripcmd $dst; else true ; fi && if [ x"$chmodcmd" != x ]; then $doit $chmodcmd $dst; else true ; fi else # If we're going to rename the final executable, determine the name now. if [ x"$transformarg" = x ] then dstfile=`basename $dst` else dstfile=`basename $dst $transformbasename | sed $transformarg`$transformbasename fi # don't allow the sed command to completely eliminate the filename if [ x"$dstfile" = x ] then dstfile=`basename $dst` else true fi # Make a temp file name in the proper directory. dsttmp=$dstdir/#inst.$$# # Move or copy the file name to the temp name $doit $instcmd $src $dsttmp && trap "rm -f ${dsttmp}" 0 && # and set any options; do chmod last to preserve setuid bits # If any of these fail, we abort the whole thing. If we want to # ignore errors from any of these, just make sure not to ignore # errors from the above "$doit $instcmd $src $dsttmp" command. if [ x"$chowncmd" != x ]; then $doit $chowncmd $dsttmp; else true;fi && if [ x"$chgrpcmd" != x ]; then $doit $chgrpcmd $dsttmp; else true;fi && if [ x"$stripcmd" != x ]; then $doit $stripcmd $dsttmp; else true;fi && if [ x"$chmodcmd" != x ]; then $doit $chmodcmd $dsttmp; else true;fi && # Now rename the file to the real destination. $doit $rmcmd -f $dstdir/$dstfile && $doit $mvcmd $dsttmp $dstdir/$dstfile fi && exit 0
{ "pile_set_name": "Github" }
/* * Copyright 2007 ZXing 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. */ using System; namespace ZXing.Client.Result { /// <summary> /// A simple result type encapsulating a URI that has no further interpretation. /// </summary> /// <author>Sean Owen</author> public sealed class URIParsedResult : ParsedResult { public String URI { get; private set; } public String Title { get; private set; } /// <returns> true if the URI contains suspicious patterns that may suggest it intends to /// mislead the user about its true nature. At the moment this looks for the presence /// of user/password syntax in the host/authority portion of a URI which may be used /// in attempts to make the URI's host appear to be other than it is. Example: /// http://[email protected] This URI connects to phisher.com but may appear /// to connect to yourbank.com at first glance. /// </returns> [Obsolete("deprecated, see {@link URIResultParser#isPossiblyMaliciousURI(String)")] public bool PossiblyMaliciousURI { get; private set; } public URIParsedResult(String uri, String title) : base(ParsedResultType.URI) { URI = massageURI(uri); Title = title; //PossiblyMaliciousURI = URIResultParser.isPossiblyMaliciousURI(uri); var result = new System.Text.StringBuilder(30); maybeAppend(Title, result); maybeAppend(URI, result); displayResultValue = result.ToString(); } /// <summary> Transforms a string that represents a URI into something more proper, by adding or canonicalizing /// the protocol. /// </summary> private static String massageURI(String uri) { int protocolEnd = uri.IndexOf(':'); if (protocolEnd < 0 || isColonFollowedByPortNumber(uri, protocolEnd)) { // No protocol, or found a colon, but it looks like it is after the host, so the protocol is still missing, // so assume http uri = "http://" + uri; } return uri; } private static bool isColonFollowedByPortNumber(String uri, int protocolEnd) { int start = protocolEnd + 1; int nextSlash = uri.IndexOf('/', start); if (nextSlash < 0) { nextSlash = uri.Length; } return ResultParser.isSubstringOfDigits(uri, start, nextSlash - start); } } }
{ "pile_set_name": "Github" }
var spdy = require('spdy'), http = require('http'), path = require('path'), util = require('util'), net = require('net'), url = require('url'), fs = require('fs'); http.globalAgent.maxSockets = 128; var SPDYProxy = function(options) { var self = this; this.setAuthHandler = function(handler) { self._authHandler = handler; console.log('AuthHandler'.green, handler.friendly_name.yellow, 'will be used.'.green); } this.setLogHandler = function(handler) { self._logHandler = handler; console.log('Requests will be logged into file'.green, handler._filename.yellow); } function logHeaders(headers) { for (var i in headers) console.log(' > '.grey + i.cyan + ': '.grey + headers[i]); console.log(); } function logRequest(req) { console.log(req.method.green + ' ' + req.url.yellow); logHeaders(req.headers); } function synReply(socket, code, reason, headers, cb) { try { if (socket._handle instanceof spdy.handle) { var handle = socket._handle; handle._stream.respond(code, headers, function (err) { cb.call(); }); /* // SPDY socket if(socket._lock){ socket._lock(function() { var socket = this; stream.respond(code, headers, function (err) {}); this._spdyState.framer.replyFrame( this._spdyState.id, code, reason, headers, function (err, frame) { socket.connection.write(frame); socket._unlock(); cb.call(); } ); }); */ // Chrome used raw SSL instead of SPDY when issuing CONNECT for // WebSockets. Hence, to support WS we must fallback to regular // HTTPS tunelling: https://github.com/igrigorik/node-spdyproxy/issues/26 } else { console.log("Fallback for WebSockets"); var statusLine = 'HTTP/1.1 ' + code + ' ' + reason + '\r\n'; var headerLines = ''; for(key in headers){ headerLines += key + ': ' + headers[key] + '\r\n'; } socket.write(statusLine + headerLines + '\r\n', 'UTF-8', cb); } } catch(error) { console.error("Error: ".red, error); console.error(error.stack); cb.call(); } } function handlePlain(req, res) { var path = req.headers.path || url.parse(req.url).path; var requestOptions = { hostname: req.headers.host.split(':')[0], port: req.headers.host.split(':')[1] || 80, path: path, method: req.method, headers: req.headers }; if (options.localAddress) { requestOptions.localAddress = options.localAddress; } var rreq = http.request(requestOptions, function(rres) { rres.headers['proxy-agent'] = 'SPDY Proxy ' + options.version; if (options.verbose) { console.log("HTTP/" + rres.httpVersion + " " + rres.statusCode); logHeaders(rres.headers); } // remove invalid headers delete rres.headers["connection"]; delete rres.headers["keep-alive"]; delete rres.headers["proxy-connection"]; delete rres.headers["transfer-encoding"]; // write out headers to handle redirects res.writeHead(rres.statusCode, rres.statusMessage || '', rres.headers); rres.pipe(res); // Res could not write, but it could close connection res.pipe(rres); }); rreq.on('error', function(e) { console.log("Client error: " + e.message); res.writeHead(502, 'Proxy fetch failed'); res.end("502 Proxy " + req.method + " failed: " + e.message); }); req.pipe(rreq); // Just in case if socket will be shutdown before http.request will connect // to the server. res.on('close', function() { rreq.abort(); }); } function handleSecure(req, socket) { var requestOptions = { host: req.url.split(':')[0], port: req.url.split(':')[1] || 443, }; if (options.localAddress) { requestOptions.localAddress = options.localAddress; } var tunnel = net.createConnection(requestOptions, function() { synReply(socket, 200, 'Connection established', { 'Connection': 'keep-alive', 'Proxy-Agent': 'SPDY Proxy ' + options.version }, function() { tunnel.pipe(socket); socket.pipe(tunnel); } ); }); tunnel.setNoDelay(true); tunnel.setKeepAlive(true, 2000); tunnel.maxConnections = 1000; tunnel.on('error', function(e) { console.log("Tunnel error: ".red + e); synReply(socket, 502, "Tunnel Error", {}, function() { socket.end(); }); }); } function handleRequest(req, res) { var socket = (req.method == 'CONNECT') ? res : res.socket; console.log("%s:%s".yellow + " - %s - " + "stream ID: " + "%s".yellow + " - priority: " + "%s".yellow, socket.connection ? socket.connection.socket.remoteAddress : socket.remoteAddress, socket.connection ? socket.connection.socket.remotePort : socket.remotePort, req.method, res.id || (socket._spdyState && socket._spdyState.id) || "none", res.priority || (socket._spdyState && socket._spdyState.priority) || "none" ); // node-spdy forces chunked-encoding processing on inbound // requests without a content-length. However, we don't want // want to pass this injected header through to the destination. delete req.headers['transfer-encoding']; var dispatcher = function(req, res) { req.method == 'CONNECT' ? handleSecure(req, res) : handlePlain(req, res); } if (options.verbose) logRequest(req); if(typeof self._logHandler == 'object') { self._logHandler.log(socket, req); } if(typeof self._authHandler == 'object') { // an AuthHandler is defined // perform basic proxy auth (over established SSL tunnel) // - http://www.chromium.org/spdy/spdy-authentication var header = req.headers['proxy-authorization'] || '', token = header.split(/\s+/).pop() || '', auth = new Buffer(token, 'base64').toString(), parts = auth.split(/:/), username = parts[0], password = parts[1]; // don't pass proxy-auth headers upstream delete req.headers['proxy-authorization']; self._authHandler.authUser(username, password, function(authPassed) { if (authPassed) return dispatcher(req, res); synReply(socket, 407, 'Proxy Authentication Required', {'proxy-authenticate': 'Basic realm="SPDY Proxy"'}, function() { socket.end(); } ); }); } else { // auth is not necessary, simply go ahead and dispatch to funcs dispatcher(req, res); } } spdy.server.Server.call(this, options); this.on("connect", handleRequest); this.on("request", handleRequest); }; util.inherits(SPDYProxy, spdy.server.Server); var createServer = function(options) { return new SPDYProxy(options); }; exports.SPDYProxy = SPDYProxy; exports.createServer = createServer;
{ "pile_set_name": "Github" }
############################################################# # Required variables for each makefile # Discard this section from all parent makefiles # Expected variables (with automatic defaults): # CSRCS (all "C" files in the dir) # SUBDIRS (all subdirs with a Makefile) # GEN_LIBS - list of libs to be generated () # GEN_IMAGES - list of images to be generated () # COMPONENTS_xxx - a list of libs/objs in the form # subdir/lib to be extracted and rolled up into # a generated lib/image xxx.a () # ifndef PDIR GEN_LIBS = libplatform.a endif ############################################################# # Configuration i.e. compile options etc. # Target specific stuff (defines etc.) goes in here! # Generally values applying to a tree are captured in the # makefile at its root level - these are then overridden # for a subtree within the makefile rooted therein # #DEFINES += ############################################################# # Recursion Magic - Don't touch this!! # # Each subtree potentially has an include directory # corresponding to the common APIs applicable to modules # rooted at that subtree. Accordingly, the INCLUDE PATH # of a module can only contain the include directories up # its parent path, and not its siblings # # Required for each makefile to inherit from the parent # INCLUDES := $(INCLUDES) -I $(PDIR)include INCLUDES += -I ./ PDIR := ../$(PDIR) sinclude $(PDIR)Makefile
{ "pile_set_name": "Github" }
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd"> <!--NewPage--> <HTML> <HEAD> <!-- Generated by javadoc (build 1.5.0_09) on Thu Nov 02 11:46:43 EST 2006 --> <TITLE> net.sf.antcontrib.inifile Class Hierarchy (Ant Contrib) </TITLE> <LINK REL ="stylesheet" TYPE="text/css" HREF="../../../../stylesheet.css" TITLE="Style"> <SCRIPT type="text/javascript"> function windowTitle() { parent.document.title="net.sf.antcontrib.inifile Class Hierarchy (Ant Contrib)"; } </SCRIPT> <NOSCRIPT> </NOSCRIPT> </HEAD> <BODY BGCOLOR="white" onload="windowTitle();"> <!-- ========= START OF TOP NAVBAR ======= --> <A NAME="navbar_top"><!-- --></A> <A HREF="#skip-navbar_top" title="Skip navigation links"></A> <TABLE BORDER="0" WIDTH="100%" CELLPADDING="1" CELLSPACING="0" SUMMARY=""> <TR> <TD COLSPAN=2 BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A NAME="navbar_top_firstrow"><!-- --></A> <TABLE BORDER="0" CELLPADDING="0" CELLSPACING="3" SUMMARY=""> <TR ALIGN="center" VALIGN="top"> <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../../../overview-summary.html"><FONT CLASS="NavBarFont1"><B>Overview</B></FONT></A>&nbsp;</TD> <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="package-summary.html"><FONT CLASS="NavBarFont1"><B>Package</B></FONT></A>&nbsp;</TD> <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <FONT CLASS="NavBarFont1">Class</FONT>&nbsp;</TD> <TD BGCOLOR="#FFFFFF" CLASS="NavBarCell1Rev"> &nbsp;<FONT CLASS="NavBarFont1Rev"><B>Tree</B></FONT>&nbsp;</TD> <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../../../deprecated-list.html"><FONT CLASS="NavBarFont1"><B>Deprecated</B></FONT></A>&nbsp;</TD> <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../../../index-all.html"><FONT CLASS="NavBarFont1"><B>Index</B></FONT></A>&nbsp;</TD> <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../../../help-doc.html"><FONT CLASS="NavBarFont1"><B>Help</B></FONT></A>&nbsp;</TD> </TR> </TABLE> </TD> <TD ALIGN="right" VALIGN="top" ROWSPAN=3><EM> </EM> </TD> </TR> <TR> <TD BGCOLOR="white" CLASS="NavBarCell2"><FONT SIZE="-2"> &nbsp;<A HREF="../../../../net/sf/antcontrib/design/package-tree.html"><B>PREV</B></A>&nbsp; &nbsp;<A HREF="../../../../net/sf/antcontrib/input/package-tree.html"><B>NEXT</B></A></FONT></TD> <TD BGCOLOR="white" CLASS="NavBarCell2"><FONT SIZE="-2"> <A HREF="../../../../index.html?net/sf/antcontrib/inifile/package-tree.html" target="_top"><B>FRAMES</B></A> &nbsp; &nbsp;<A HREF="package-tree.html" target="_top"><B>NO FRAMES</B></A> &nbsp; &nbsp;<SCRIPT type="text/javascript"> <!-- if(window==top) { document.writeln('<A HREF="../../../../allclasses-noframe.html"><B>All Classes</B></A>'); } //--> </SCRIPT> <NOSCRIPT> <A HREF="../../../../allclasses-noframe.html"><B>All Classes</B></A> </NOSCRIPT> </FONT></TD> </TR> </TABLE> <A NAME="skip-navbar_top"></A> <!-- ========= END OF TOP NAVBAR ========= --> <HR> <CENTER> <H2> Hierarchy For Package net.sf.antcontrib.inifile </H2> </CENTER> <DL> <DT><B>Package Hierarchies:</B><DD><A HREF="../../../../overview-tree.html">All Packages</A></DL> <HR> <H2> Class Hierarchy </H2> <UL> <LI TYPE="circle">java.lang.Object<UL> <LI TYPE="circle">net.sf.antcontrib.inifile.<A HREF="../../../../net/sf/antcontrib/inifile/IniFile.html" title="class in net.sf.antcontrib.inifile"><B>IniFile</B></A><LI TYPE="circle">net.sf.antcontrib.inifile.<A HREF="../../../../net/sf/antcontrib/inifile/IniFileTask.IniOperation.html" title="class in net.sf.antcontrib.inifile"><B>IniFileTask.IniOperation</B></A><UL> <LI TYPE="circle">net.sf.antcontrib.inifile.<A HREF="../../../../net/sf/antcontrib/inifile/IniFileTask.IniOperationConditional.html" title="class in net.sf.antcontrib.inifile"><B>IniFileTask.IniOperationConditional</B></A><UL> <LI TYPE="circle">net.sf.antcontrib.inifile.<A HREF="../../../../net/sf/antcontrib/inifile/IniFileTask.Remove.html" title="class in net.sf.antcontrib.inifile"><B>IniFileTask.Remove</B></A><LI TYPE="circle">net.sf.antcontrib.inifile.<A HREF="../../../../net/sf/antcontrib/inifile/IniFileTask.Set.html" title="class in net.sf.antcontrib.inifile"><B>IniFileTask.Set</B></A></UL> <LI TYPE="circle">net.sf.antcontrib.inifile.<A HREF="../../../../net/sf/antcontrib/inifile/IniFileTask.IniOperationPropertySetter.html" title="class in net.sf.antcontrib.inifile"><B>IniFileTask.IniOperationPropertySetter</B></A><UL> <LI TYPE="circle">net.sf.antcontrib.inifile.<A HREF="../../../../net/sf/antcontrib/inifile/IniFileTask.Exists.html" title="class in net.sf.antcontrib.inifile"><B>IniFileTask.Exists</B></A><LI TYPE="circle">net.sf.antcontrib.inifile.<A HREF="../../../../net/sf/antcontrib/inifile/IniFileTask.Get.html" title="class in net.sf.antcontrib.inifile"><B>IniFileTask.Get</B></A></UL> </UL> <LI TYPE="circle">net.sf.antcontrib.inifile.<A HREF="../../../../net/sf/antcontrib/inifile/IniProperty.html" title="class in net.sf.antcontrib.inifile"><B>IniProperty</B></A> (implements net.sf.antcontrib.inifile.<A HREF="../../../../net/sf/antcontrib/inifile/IniPart.html" title="interface in net.sf.antcontrib.inifile">IniPart</A>) <LI TYPE="circle">net.sf.antcontrib.inifile.<A HREF="../../../../net/sf/antcontrib/inifile/IniSection.html" title="class in net.sf.antcontrib.inifile"><B>IniSection</B></A> (implements net.sf.antcontrib.inifile.<A HREF="../../../../net/sf/antcontrib/inifile/IniPart.html" title="interface in net.sf.antcontrib.inifile">IniPart</A>) <LI TYPE="circle">org.apache.tools.ant.ProjectComponent<UL> <LI TYPE="circle">org.apache.tools.ant.Task<UL> <LI TYPE="circle">net.sf.antcontrib.inifile.<A HREF="../../../../net/sf/antcontrib/inifile/IniFileTask.html" title="class in net.sf.antcontrib.inifile"><B>IniFileTask</B></A></UL> </UL> </UL> </UL> <H2> Interface Hierarchy </H2> <UL> <LI TYPE="circle">net.sf.antcontrib.inifile.<A HREF="../../../../net/sf/antcontrib/inifile/IniPart.html" title="interface in net.sf.antcontrib.inifile"><B>IniPart</B></A></UL> <HR> <!-- ======= START OF BOTTOM NAVBAR ====== --> <A NAME="navbar_bottom"><!-- --></A> <A HREF="#skip-navbar_bottom" title="Skip navigation links"></A> <TABLE BORDER="0" WIDTH="100%" CELLPADDING="1" CELLSPACING="0" SUMMARY=""> <TR> <TD COLSPAN=2 BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A NAME="navbar_bottom_firstrow"><!-- --></A> <TABLE BORDER="0" CELLPADDING="0" CELLSPACING="3" SUMMARY=""> <TR ALIGN="center" VALIGN="top"> <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../../../overview-summary.html"><FONT CLASS="NavBarFont1"><B>Overview</B></FONT></A>&nbsp;</TD> <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="package-summary.html"><FONT CLASS="NavBarFont1"><B>Package</B></FONT></A>&nbsp;</TD> <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <FONT CLASS="NavBarFont1">Class</FONT>&nbsp;</TD> <TD BGCOLOR="#FFFFFF" CLASS="NavBarCell1Rev"> &nbsp;<FONT CLASS="NavBarFont1Rev"><B>Tree</B></FONT>&nbsp;</TD> <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../../../deprecated-list.html"><FONT CLASS="NavBarFont1"><B>Deprecated</B></FONT></A>&nbsp;</TD> <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../../../index-all.html"><FONT CLASS="NavBarFont1"><B>Index</B></FONT></A>&nbsp;</TD> <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../../../help-doc.html"><FONT CLASS="NavBarFont1"><B>Help</B></FONT></A>&nbsp;</TD> </TR> </TABLE> </TD> <TD ALIGN="right" VALIGN="top" ROWSPAN=3><EM> </EM> </TD> </TR> <TR> <TD BGCOLOR="white" CLASS="NavBarCell2"><FONT SIZE="-2"> &nbsp;<A HREF="../../../../net/sf/antcontrib/design/package-tree.html"><B>PREV</B></A>&nbsp; &nbsp;<A HREF="../../../../net/sf/antcontrib/input/package-tree.html"><B>NEXT</B></A></FONT></TD> <TD BGCOLOR="white" CLASS="NavBarCell2"><FONT SIZE="-2"> <A HREF="../../../../index.html?net/sf/antcontrib/inifile/package-tree.html" target="_top"><B>FRAMES</B></A> &nbsp; &nbsp;<A HREF="package-tree.html" target="_top"><B>NO FRAMES</B></A> &nbsp; &nbsp;<SCRIPT type="text/javascript"> <!-- if(window==top) { document.writeln('<A HREF="../../../../allclasses-noframe.html"><B>All Classes</B></A>'); } //--> </SCRIPT> <NOSCRIPT> <A HREF="../../../../allclasses-noframe.html"><B>All Classes</B></A> </NOSCRIPT> </FONT></TD> </TR> </TABLE> <A NAME="skip-navbar_bottom"></A> <!-- ======== END OF BOTTOM NAVBAR ======= --> <HR> </BODY> </HTML>
{ "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.commons.lang3.mutable; import java.io.Serializable; import org.apache.commons.lang3.BooleanUtils; /** * A mutable {@code boolean} wrapper. * <p> * Note that as MutableBoolean does not extend Boolean, it is not treated by String.format as a Boolean parameter. * * @see Boolean * @since 2.2 */ public class MutableBoolean implements Mutable<Boolean>, Serializable, Comparable<MutableBoolean> { /** * Required for serialization support. * * @see java.io.Serializable */ private static final long serialVersionUID = -4830728138360036487L; /** The mutable value. */ private boolean value; /** * Constructs a new MutableBoolean with the default value of false. */ public MutableBoolean() { super(); } /** * Constructs a new MutableBoolean with the specified value. * * @param value the initial value to store */ public MutableBoolean(final boolean value) { super(); this.value = value; } /** * Constructs a new MutableBoolean with the specified value. * * @param value the initial value to store, not null * @throws NullPointerException if the object is null */ public MutableBoolean(final Boolean value) { super(); this.value = value.booleanValue(); } //----------------------------------------------------------------------- /** * Gets the value as a Boolean instance. * * @return the value as a Boolean, never null */ @Override public Boolean getValue() { return Boolean.valueOf(this.value); } /** * Sets the value. * * @param value the value to set */ public void setValue(final boolean value) { this.value = value; } /** * Sets the value to false. * * @since 3.3 */ public void setFalse() { this.value = false; } /** * Sets the value to true. * * @since 3.3 */ public void setTrue() { this.value = true; } /** * Sets the value from any Boolean instance. * * @param value the value to set, not null * @throws NullPointerException if the object is null */ @Override public void setValue(final Boolean value) { this.value = value.booleanValue(); } //----------------------------------------------------------------------- /** * Checks if the current value is {@code true}. * * @return {@code true} if the current value is {@code true} * @since 2.5 */ public boolean isTrue() { return value; } /** * Checks if the current value is {@code false}. * * @return {@code true} if the current value is {@code false} * @since 2.5 */ public boolean isFalse() { return !value; } //----------------------------------------------------------------------- /** * Returns the value of this MutableBoolean as a boolean. * * @return the boolean value represented by this object. */ public boolean booleanValue() { return value; } //----------------------------------------------------------------------- /** * Gets this mutable as an instance of Boolean. * * @return a Boolean instance containing the value from this mutable, never null * @since 2.5 */ public Boolean toBoolean() { return Boolean.valueOf(booleanValue()); } //----------------------------------------------------------------------- /** * Compares this object to the specified object. The result is {@code true} if and only if the argument is * not {@code null} and is an {@code MutableBoolean} object that contains the same * {@code boolean} value as this object. * * @param obj the object to compare with, null returns false * @return {@code true} if the objects are the same; {@code false} otherwise. */ @Override public boolean equals(final Object obj) { if (obj instanceof MutableBoolean) { return value == ((MutableBoolean) obj).booleanValue(); } return false; } /** * Returns a suitable hash code for this mutable. * * @return the hash code returned by {@code Boolean.TRUE} or {@code Boolean.FALSE} */ @Override public int hashCode() { return value ? Boolean.TRUE.hashCode() : Boolean.FALSE.hashCode(); } //----------------------------------------------------------------------- /** * Compares this mutable to another in ascending order. * * @param other the other mutable to compare to, not null * @return negative if this is less, zero if equal, positive if greater * where false is less than true */ @Override public int compareTo(final MutableBoolean other) { return BooleanUtils.compare(this.value, other.value); } //----------------------------------------------------------------------- /** * Returns the String value of this mutable. * * @return the mutable value as a string */ @Override public String toString() { return String.valueOf(value); } }
{ "pile_set_name": "Github" }
<?php declare(strict_types=1); namespace RZ\Roadiz\Console; use RZ\Roadiz\Core\Entities\Role; use RZ\Roadiz\Core\Entities\User; use Symfony\Component\Console\Command\Command; use Symfony\Component\Console\Input\InputArgument; use Symfony\Component\Console\Input\InputInterface; use Symfony\Component\Console\Output\OutputInterface; use Symfony\Component\Console\Style\SymfonyStyle; /** * Command line utils for managing users from terminal. */ class UsersCommand extends Command { protected $entityManager; protected function configure() { $this->setName('users:list') ->setDescription('List all users or just one') ->addArgument( 'username', InputArgument::OPTIONAL, 'User name' ); } protected function execute(InputInterface $input, OutputInterface $output) { $io = new SymfonyStyle($input, $output); $this->entityManager = $this->getHelper('entityManager')->getEntityManager(); $name = $input->getArgument('username'); if ($name) { /** @var User|null $user */ $user = $this->entityManager ->getRepository(User::class) ->findOneBy(['username' => $name]); if ($user === null) { $io->error('User “' . $name . '” does not exist… use users:create to add a new user.'); } else { $tableContent = [[ $user->getId(), $user->getUsername(), $user->getEmail(), (!$user->isEnabled() ? 'X' : ''), ($user->getExpired() ? 'X' : ''), (!$user->isAccountNonLocked() ? 'X' : ''), implode(' ', $user->getGroupNames()), implode(' ', $user->getRoles()), ]]; $io->table( ['Id', 'Username', 'Email', 'Disabled', 'Expired', 'Locked', 'Groups', 'Roles'], $tableContent ); } } else { $users = $this->entityManager ->getRepository(User::class) ->findAll(); if (count($users) > 0) { $tableContent = []; foreach ($users as $user) { $tableContent[] = [ $user->getId(), $user->getUsername(), $user->getEmail(), (!$user->isEnabled() ? 'X' : ''), ($user->getExpired() ? 'X' : ''), (!$user->isAccountNonLocked() ? 'X' : ''), implode(' ', $user->getGroupNames()), implode(' ', $user->getRoles()), ]; } $io->table( ['Id', 'Username', 'Email', 'Disabled', 'Expired', 'Locked', 'Groups', 'Roles'], $tableContent ); } else { $io->warning('No available users.'); } } return 0; } /** * Get role by name, and create it if does not exist. * * @param string $roleName * * @return Role */ public function getRole($roleName = Role::ROLE_SUPERADMIN) { $role = $this->entityManager ->getRepository(Role::class) ->findOneBy(['name' => $roleName]); if ($role === null) { $role = new Role($roleName); $this->entityManager->persist($role); $this->entityManager->flush(); } return $role; } }
{ "pile_set_name": "Github" }
<!DOCTYPE html> <html xmlns="http://www.w3.org/1999/xhtml" xmlns:th="http://www.thymeleaf.org"> <body style="font-family: Arial; font-size: 14px;"> <p>Olá!</p> <p>Existem receitas ou despesas vencidas ou vencendo hoje. Veja:</p> <p> <table style="width: 100%; border-collapse: collapse; margin: 20px 0"> <thead> <tr> <th>Tipo</th> <th>Pessoa</th> <th>Descrição</th> <th>Vencimento</th> <th>Valor</th> </tr> </thead> <tbody> <tr style="border-bottom: 1px solid #ccc; border-top: 1px solid #ccc;" th:each="lancamento: ${lancamentos}" th:styleappend="${lancamento.receita} ? 'color: blue;' : 'color: red;'"> <td th:text="${lancamento.tipo.descricao}">Receita</td> <td th:text="${lancamento.pessoa.nome}">João Silva</td> <td th:text="${lancamento.descricao}">Salário mensal</td> <td th:text="${#temporals.format(lancamento.dataVencimento, 'dd/MM/yyyy')}" style="text-align: center">10/06/2017</td> <td th:text="${#numbers.formatDecimal(lancamento.valor, 0, 'POINT', 2, 'COMMA')}" style="text-align: right">R$ 10.000,00</td> </tr> </tbody> </table> </p> <p>Obrigado.</p> <p>Equipe Algamoney!</p> </body> </html>
{ "pile_set_name": "Github" }
/* * This file is subject to the terms and conditions of the GNU General Public * License. See the file "COPYING" in the main directory of this archive * for more details. * * Copyright (C) 2007 MIPS Technologies, Inc. * Copyright (C) 2007 Ralf Baechle <[email protected]> */ #include <linux/clockchips.h> #include <linux/interrupt.h> #include <linux/percpu.h> #include <linux/smp.h> #include <asm/smtc_ipi.h> #include <asm/time.h> #include <asm/cevt-r4k.h> #include <asm/gic.h> /* * The SMTC Kernel for the 34K, 1004K, et. al. replaces several * of these routines with SMTC-specific variants. */ #ifndef CONFIG_MIPS_MT_SMTC static int mips_next_event(unsigned long delta, struct clock_event_device *evt) { unsigned int cnt; int res; cnt = read_c0_count(); cnt += delta; write_c0_compare(cnt); res = ((int)(read_c0_count() - cnt) >= 0) ? -ETIME : 0; return res; } #endif /* CONFIG_MIPS_MT_SMTC */ void mips_set_clock_mode(enum clock_event_mode mode, struct clock_event_device *evt) { /* Nothing to do ... */ } DEFINE_PER_CPU(struct clock_event_device, mips_clockevent_device); int cp0_timer_irq_installed; #ifndef CONFIG_MIPS_MT_SMTC irqreturn_t c0_compare_interrupt(int irq, void *dev_id) { const int r2 = cpu_has_mips_r2; struct clock_event_device *cd; int cpu = smp_processor_id(); /* * Suckage alert: * Before R2 of the architecture there was no way to see if a * performance counter interrupt was pending, so we have to run * the performance counter interrupt handler anyway. */ if (handle_perf_irq(r2)) goto out; /* * The same applies to performance counter interrupts. But with the * above we now know that the reason we got here must be a timer * interrupt. Being the paranoiacs we are we check anyway. */ if (!r2 || (read_c0_cause() & (1 << 30))) { /* Clear Count/Compare Interrupt */ write_c0_compare(read_c0_compare()); cd = &per_cpu(mips_clockevent_device, cpu); cd->event_handler(cd); } out: return IRQ_HANDLED; } #endif /* Not CONFIG_MIPS_MT_SMTC */ struct irqaction c0_compare_irqaction = { .handler = c0_compare_interrupt, .flags = IRQF_DISABLED | IRQF_PERCPU | IRQF_TIMER, .name = "timer", }; void mips_event_handler(struct clock_event_device *dev) { } static int c0_compare_int_pending(void) { #ifdef CONFIG_MIPS_SEAD3 if (cpu_has_veic) return gic_get_timer_pending(); #endif return (read_c0_cause() >> cp0_compare_irq_shift) & (1ul << CAUSEB_IP); } /* * Compare interrupt can be routed and latched outside the core, * so a single execution hazard barrier may not be enough to give * it time to clear as seen in the Cause register. The number of * hazard barriers is dependent on the CPU/bus ratio. */ #define CHANGEHAZARD 20 static inline void compare_change_hazard(void) { int n = CHANGEHAZARD; while (n--) irq_disable_hazard(); } int c0_compare_int_usable(void) { unsigned int delta; unsigned int cnt; /* * IP7 already pending? Try to clear it by acking the timer. */ if (c0_compare_int_pending()) { write_c0_compare(read_c0_count()); compare_change_hazard(); if (c0_compare_int_pending()) return 0; } for (delta = 0x10; delta <= 0x400000; delta <<= 1) { cnt = read_c0_count(); cnt += delta; write_c0_compare(cnt); compare_change_hazard(); if ((int)(read_c0_count() - cnt) < 0) break; /* increase delta if the timer was already expired */ } while ((int)(read_c0_count() - cnt) <= 0) ; /* Wait for expiry */ compare_change_hazard(); if (!c0_compare_int_pending()) return 0; write_c0_compare(read_c0_count()); compare_change_hazard(); if (c0_compare_int_pending()) return 0; /* * Feels like a real count / compare timer. */ return 1; } #ifndef CONFIG_MIPS_MT_SMTC int __cpuinit r4k_clockevent_init(void) { unsigned int cpu = smp_processor_id(); struct clock_event_device *cd; unsigned int irq; if (!cpu_has_counter || !mips_hpt_frequency) return -ENXIO; if (!c0_compare_int_usable()) return -ENXIO; /* * With vectored interrupts things are getting platform specific. * get_c0_compare_int is a hook to allow a platform to return the * interrupt number of it's liking. */ irq = MIPS_CPU_IRQ_BASE + cp0_compare_irq; if (get_c0_compare_int) irq = get_c0_compare_int(); cd = &per_cpu(mips_clockevent_device, cpu); cd->name = "MIPS"; cd->features = CLOCK_EVT_FEAT_ONESHOT; clockevent_set_clock(cd, mips_hpt_frequency); /* Calculate the min / max delta */ cd->max_delta_ns = clockevent_delta2ns(0x7fffffff, cd); cd->min_delta_ns = clockevent_delta2ns(0x300, cd); cd->rating = 300; cd->irq = irq; cd->cpumask = cpumask_of(cpu); cd->set_next_event = mips_next_event; cd->set_mode = mips_set_clock_mode; cd->event_handler = mips_event_handler; clockevents_register_device(cd); if (cp0_timer_irq_installed) return 0; cp0_timer_irq_installed = 1; setup_irq(irq, &c0_compare_irqaction); return 0; } #endif /* Not CONFIG_MIPS_MT_SMTC */
{ "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.netbeans.modules.autoupdate.services; import java.io.File; import java.io.FileNotFoundException; import java.io.FileOutputStream; import java.io.IOException; import java.io.OutputStream; import java.util.HashMap; import java.util.Map; import java.util.jar.JarOutputStream; import java.util.jar.Manifest; import java.util.logging.Level; import org.netbeans.api.autoupdate.DefaultTestCase; import org.netbeans.api.autoupdate.InstallSupport; import org.netbeans.api.autoupdate.InstallSupport.Installer; import org.netbeans.api.autoupdate.InstallSupport.Validator; import org.netbeans.api.autoupdate.OperationContainer; import org.netbeans.api.autoupdate.OperationSupport.Restarter; import org.netbeans.api.autoupdate.UpdateUnit; import org.netbeans.api.autoupdate.UpdateUnitProvider.CATEGORY; import org.netbeans.junit.MockServices; import org.netbeans.junit.NbTestCase; import org.netbeans.spi.autoupdate.UpdateItem; import org.netbeans.spi.autoupdate.UpdateLicense; import org.netbeans.spi.autoupdate.UpdateProvider; import org.netbeans.updater.UpdaterInternal; import org.openide.filesystems.FileUtil; import org.openide.modules.ModuleInfo; import org.openide.util.Lookup; /** * * @author Jaroslav Tulach */ public class UpdateDisabledModuleTest extends NbTestCase { static Manifest man; private File ud; public UpdateDisabledModuleTest(String testName) { super(testName); } @Override protected Level logLevel() { return Level.FINE; } @Override protected void setUp() throws Exception { clearWorkDir(); man = new Manifest (); man.getMainAttributes ().putValue ("Manifest-Version", "1.0"); man.getMainAttributes ().putValue ("OpenIDE-Module", "com.example.testmodule.cluster"); man.getMainAttributes ().putValue ("OpenIDE-Module-Public-Packages", "-"); ud = new File(getWorkDir(), "ud"); System.setProperty("netbeans.user", ud.getPath()); new File(ud, "config").mkdirs(); final File install = new File(getWorkDir(), "install"); File platform = new File(install, "platform"); System.setProperty("netbeans.home", platform.getPath()); new File(platform, "config").mkdirs(); File middle = new File(install, "middle"); File last = new File(install, "last"); System.setProperty("netbeans.dirs", middle.getPath() + File.pathSeparator + last.getPath()); final String fn = moduleCodeNameBaseForTest().replace('.', '-') + ".xml"; File conf = new File(new File(new File(middle, "config"), "Modules"), fn); conf.getParentFile().mkdirs(); writeConfXML(conf, false); final File jar = new File(new File(last, "modules"), "com-example-testmodule-cluster.jar"); jar.getParentFile().mkdirs(); JarOutputStream os = new JarOutputStream(new FileOutputStream(jar), man); os.close(); File real = new File(new File(new File(last, "config"), "Modules"), fn); real.getParentFile().mkdirs(); writeConfXML(real, true); FileUtil.getConfigRoot().getFileSystem().refresh(true); File ut = new File(new File(last, "update_tracking"), fn); ut.getParentFile().mkdirs(); OutputStream utos = new FileOutputStream(ut); String utcfg = "<?xml version='1.0' encoding='UTF-8'?>\n" + "<module codename=\"com.example.testmodule.cluster\">\n" + " <module_version install_time=\"1280356738644\" last=\"true\" origin=\"installer\" specification_version=\"0.99\">\n" + " <file crc=\"3486416273\" name=\"config/Modules/com-example-testmodule-cluster.xml\"/>\n" + " <file crc=\"3486416273\" name=\"modules/com-example-testmodule-cluster.jar\"/>\n" + " </module_version>\n" + "</module>\n"; utos.write(utcfg.getBytes("UTF-8")); utos.close(); StringBuilder msg = new StringBuilder(); for (ModuleInfo mi : Lookup.getDefault().lookupAll(ModuleInfo.class)) { msg.append(mi.getCodeNameBase()).append("\n"); if (mi.getCodeNameBase().equals("com.example.testmodule.cluster")) { assertFalse("Disabled", mi.isEnabled()); return; } } fail("No com.example.testmodule.cluster module found:\n" + msg); } private void writeConfXML(File conf, boolean enabled) throws FileNotFoundException, IOException { OutputStream os = new FileOutputStream(conf); String cfg = "<?xml version='1.0' encoding='UTF-8'?>\n" + "<!DOCTYPE module PUBLIC '-//NetBeans//DTD Module Status 1.0//EN' 'http://www.netbeans.org/dtds/module-status-1_0.dtd'>\n" + "<module name='com.example.testmodule.cluster'>\n" + " <param name='autoload'>false</param>\n" + " <param name='eager'>false</param>\n" + " <param name='enabled'>" + enabled + "</param>\n" + " <param name='jar'>modules/com-example-testmodule-cluster.jar</param>\n" + " <param name='reloadable'>false</param>\n" + " <param name='specversion'>1.0</param>\n" + "</module>\n" + "\n"; os.write(cfg.getBytes("UTF-8")); os.close(); } String moduleCodeNameBaseForTest() { return "com.example.testmodule.cluster"; //NOI18N } public void testSelf() throws Exception { File f = new File(new File(new File(ud, "config"), "Modules"), "com-example-testmodule-cluster.xml"); f.delete(); assertFalse("No Config file before: " + f, f.exists()); MockServices.setServices(UP.class); UpdateUnit update = UpdateManagerImpl.getInstance().getUpdateUnit(moduleCodeNameBaseForTest()); assertNotNull("There is an NBM to update", update); OperationContainer<InstallSupport> oc = OperationContainer.createForUpdate(); oc.add(update, update.getAvailableUpdates().get(0)); final InstallSupport support = oc.getSupport(); Validator down = support.doDownload(null, true); Installer inst = support.doValidate(down, null); Restarter res = support.doInstall(inst, null); System.setProperty("netbeans.close.no.exit", "true"); support.doRestart(res, null); UpdaterInternal.update(null, null, null); assertFalse("No Config file created in for upgrade: " + f, f.exists()); } public static final class UP implements UpdateProvider { @Override public String getName() { return "test"; } @Override public String getDisplayName() { return "test view"; } @Override public String getDescription() { return "none"; } @Override public CATEGORY getCategory() { return CATEGORY.STANDARD; } @Override public Map<String, UpdateItem> getUpdateItems() throws IOException { Map<String, UpdateItem> m = new HashMap<String, UpdateItem>(); m.put("com.example.testmodule.cluster", UpdateItem.createModule( "com.example.testmodule.cluster", "1.0", DefaultTestCase.class.getResource("data/com-example-testmodule-cluster.nbm"), "jarda", "4000", "http://netbeans.de", "2010/10/27", "OK", man, Boolean.TRUE, Boolean.FALSE, Boolean.TRUE, Boolean.TRUE, "platform", UpdateLicense.createUpdateLicense("CDDL", "Free to use") )); return m; } @Override public boolean refresh(boolean force) throws IOException { return true; } } }
{ "pile_set_name": "Github" }
<?php return [ 'send_password_link' => 'ارسال لینک بازنشانی کلمه عبور', 'email_reset_password' => 'پست الکترونیکی کلمه عبور بازنشانی', 'reset_password' => 'بازنشانی گذرواژه', 'login' => 'ورود', 'login_prompt' => 'لطفا وارد شوید', 'forgot_password' => 'گذرواژه خود را فراموش کرده ام', 'remember_me' => 'مرا به خاطر بسپار', ];
{ "pile_set_name": "Github" }
SUBROUTINE ccsdt_lr_beta_4_2_3_1_2(d_a,k_a_offset,d_b,k_b_offset,d &_c,k_c_offset) C $Id$ C This is a Fortran77 program generated by Tensor Contraction Engine v.1.0 C Copyright (c) Battelle & Pacific Northwest National Laboratory (2002) C i3 ( h2 h4 h10 p3 )_ytrb + = -1 * Sum ( h7 p5 p6 ) * trb ( p5 p6 h7 h10 )_trb * y ( h2 h4 h7 p3 p5 p6 )_y IMPLICIT NONE #include "global.fh" #include "mafdecls.fh" #include "sym.fh" #include "errquit.fh" #include "tce.fh" INTEGER d_a INTEGER k_a_offset INTEGER d_b INTEGER k_b_offset INTEGER d_c INTEGER k_c_offset INTEGER nxtask INTEGER next INTEGER nprocs INTEGER count INTEGER h2b INTEGER h4b INTEGER h10b INTEGER p3b INTEGER dimc INTEGER l_c_sort INTEGER k_c_sort INTEGER p5b INTEGER p6b INTEGER h7b INTEGER p5b_1 INTEGER p6b_1 INTEGER h10b_1 INTEGER h7b_1 INTEGER h2b_2 INTEGER h4b_2 INTEGER h7b_2 INTEGER p3b_2 INTEGER p5b_2 INTEGER p6b_2 INTEGER dim_common INTEGER dima_sort INTEGER dima INTEGER dimb_sort INTEGER dimb INTEGER l_a_sort INTEGER k_a_sort INTEGER l_a INTEGER k_a INTEGER l_b_sort INTEGER k_b_sort INTEGER l_b INTEGER k_b INTEGER nsuperp(2) INTEGER isuperp INTEGER l_c INTEGER k_c DOUBLE PRECISION FACTORIAL EXTERNAL nxtask EXTERNAL FACTORIAL nprocs = GA_NNODES() count = 0 next = nxtask(nprocs,1) DO h2b = 1,noab DO h4b = h2b,noab DO h10b = 1,noab DO p3b = noab+1,noab+nvab IF (next.eq.count) THEN IF ((.not.restricted).or.(int_mb(k_spin+h2b-1)+int_mb(k_spin+h4b-1 &)+int_mb(k_spin+h10b-1)+int_mb(k_spin+p3b-1).ne.8)) THEN IF (int_mb(k_spin+h2b-1)+int_mb(k_spin+h4b-1) .eq. int_mb(k_spin+h &10b-1)+int_mb(k_spin+p3b-1)) THEN IF (ieor(int_mb(k_sym+h2b-1),ieor(int_mb(k_sym+h4b-1),ieor(int_mb( &k_sym+h10b-1),int_mb(k_sym+p3b-1)))) .eq. ieor(irrep_y,irrep_trb)) & THEN dimc = int_mb(k_range+h2b-1) * int_mb(k_range+h4b-1) * int_mb(k_ra &nge+h10b-1) * int_mb(k_range+p3b-1) IF (.not.MA_PUSH_GET(mt_dbl,dimc,'noname',l_c_sort,k_c_sort)) CALL & ERRQUIT('ccsdt_lr_beta_4_2_3_1_2',0,MA_ERR) CALL DFILL(dimc,0.0d0,dbl_mb(k_c_sort),1) DO p5b = noab+1,noab+nvab DO p6b = p5b,noab+nvab DO h7b = 1,noab IF (int_mb(k_spin+p5b-1)+int_mb(k_spin+p6b-1) .eq. int_mb(k_spin+h &10b-1)+int_mb(k_spin+h7b-1)) THEN IF (ieor(int_mb(k_sym+p5b-1),ieor(int_mb(k_sym+p6b-1),ieor(int_mb( &k_sym+h10b-1),int_mb(k_sym+h7b-1)))) .eq. irrep_trb) THEN CALL TCE_RESTRICTED_4(p5b,p6b,h10b,h7b,p5b_1,p6b_1,h10b_1,h7b_1) CALL TCE_RESTRICTED_6(h2b,h4b,h7b,p3b,p5b,p6b,h2b_2,h4b_2,h7b_2,p3 &b_2,p5b_2,p6b_2) dim_common = int_mb(k_range+p5b-1) * int_mb(k_range+p6b-1) * int_m &b(k_range+h7b-1) dima_sort = int_mb(k_range+h10b-1) dima = dim_common * dima_sort dimb_sort = int_mb(k_range+h2b-1) * int_mb(k_range+h4b-1) * int_mb &(k_range+p3b-1) dimb = dim_common * dimb_sort IF ((dima .gt. 0) .and. (dimb .gt. 0)) THEN IF (.not.MA_PUSH_GET(mt_dbl,dima,'noname',l_a_sort,k_a_sort)) CALL & ERRQUIT('ccsdt_lr_beta_4_2_3_1_2',1,MA_ERR) IF (.not.MA_PUSH_GET(mt_dbl,dima,'noname',l_a,k_a)) CALL ERRQUIT(' &ccsdt_lr_beta_4_2_3_1_2',2,MA_ERR) IF ((h7b .le. h10b)) THEN CALL GET_HASH_BLOCK(d_a,dbl_mb(k_a),dima,int_mb(k_a_offset),(h10b_ &1 - 1 + noab * (h7b_1 - 1 + noab * (p6b_1 - noab - 1 + nvab * (p5b &_1 - noab - 1))))) CALL TCE_SORT_4(dbl_mb(k_a),dbl_mb(k_a_sort),int_mb(k_range+p5b-1) &,int_mb(k_range+p6b-1),int_mb(k_range+h7b-1),int_mb(k_range+h10b-1 &),4,3,2,1,1.0d0) END IF IF ((h10b .lt. h7b)) THEN CALL GET_HASH_BLOCK(d_a,dbl_mb(k_a),dima,int_mb(k_a_offset),(h7b_1 & - 1 + noab * (h10b_1 - 1 + noab * (p6b_1 - noab - 1 + nvab * (p5b &_1 - noab - 1))))) CALL TCE_SORT_4(dbl_mb(k_a),dbl_mb(k_a_sort),int_mb(k_range+p5b-1) &,int_mb(k_range+p6b-1),int_mb(k_range+h10b-1),int_mb(k_range+h7b-1 &),3,4,2,1,-1.0d0) END IF IF (.not.MA_POP_STACK(l_a)) CALL ERRQUIT('ccsdt_lr_beta_4_2_3_1_2' &,3,MA_ERR) IF (.not.MA_PUSH_GET(mt_dbl,dimb,'noname',l_b_sort,k_b_sort)) CALL & ERRQUIT('ccsdt_lr_beta_4_2_3_1_2',4,MA_ERR) IF (.not.MA_PUSH_GET(mt_dbl,dimb,'noname',l_b,k_b)) CALL ERRQUIT(' &ccsdt_lr_beta_4_2_3_1_2',5,MA_ERR) IF ((h7b .lt. h2b) .and. (p6b .lt. p3b)) THEN CALL GET_HASH_BLOCK(d_b,dbl_mb(k_b),dimb,int_mb(k_b_offset),(p3b_2 & - noab - 1 + nvab * (p6b_2 - noab - 1 + nvab * (p5b_2 - noab - 1 &+ nvab * (h4b_2 - 1 + noab * (h2b_2 - 1 + noab * (h7b_2 - 1))))))) CALL TCE_SORT_6(dbl_mb(k_b),dbl_mb(k_b_sort),int_mb(k_range+h7b-1) &,int_mb(k_range+h2b-1),int_mb(k_range+h4b-1),int_mb(k_range+p5b-1) &,int_mb(k_range+p6b-1),int_mb(k_range+p3b-1),6,3,2,1,5,4,1.0d0) END IF IF ((h7b .lt. h2b) .and. (p5b .lt. p3b) .and. (p3b .le. p6b)) THEN CALL GET_HASH_BLOCK(d_b,dbl_mb(k_b),dimb,int_mb(k_b_offset),(p6b_2 & - noab - 1 + nvab * (p3b_2 - noab - 1 + nvab * (p5b_2 - noab - 1 &+ nvab * (h4b_2 - 1 + noab * (h2b_2 - 1 + noab * (h7b_2 - 1))))))) CALL TCE_SORT_6(dbl_mb(k_b),dbl_mb(k_b_sort),int_mb(k_range+h7b-1) &,int_mb(k_range+h2b-1),int_mb(k_range+h4b-1),int_mb(k_range+p5b-1) &,int_mb(k_range+p3b-1),int_mb(k_range+p6b-1),5,3,2,1,6,4,-1.0d0) END IF IF ((h7b .lt. h2b) .and. (p3b .le. p5b)) THEN CALL GET_HASH_BLOCK(d_b,dbl_mb(k_b),dimb,int_mb(k_b_offset),(p6b_2 & - noab - 1 + nvab * (p5b_2 - noab - 1 + nvab * (p3b_2 - noab - 1 &+ nvab * (h4b_2 - 1 + noab * (h2b_2 - 1 + noab * (h7b_2 - 1))))))) CALL TCE_SORT_6(dbl_mb(k_b),dbl_mb(k_b_sort),int_mb(k_range+h7b-1) &,int_mb(k_range+h2b-1),int_mb(k_range+h4b-1),int_mb(k_range+p3b-1) &,int_mb(k_range+p5b-1),int_mb(k_range+p6b-1),4,3,2,1,6,5,1.0d0) END IF IF ((h2b .le. h7b) .and. (h7b .lt. h4b) .and. (p6b .lt. p3b)) THEN CALL GET_HASH_BLOCK(d_b,dbl_mb(k_b),dimb,int_mb(k_b_offset),(p3b_2 & - noab - 1 + nvab * (p6b_2 - noab - 1 + nvab * (p5b_2 - noab - 1 &+ nvab * (h4b_2 - 1 + noab * (h7b_2 - 1 + noab * (h2b_2 - 1))))))) CALL TCE_SORT_6(dbl_mb(k_b),dbl_mb(k_b_sort),int_mb(k_range+h2b-1) &,int_mb(k_range+h7b-1),int_mb(k_range+h4b-1),int_mb(k_range+p5b-1) &,int_mb(k_range+p6b-1),int_mb(k_range+p3b-1),6,3,1,2,5,4,-1.0d0) END IF IF ((h2b .le. h7b) .and. (h7b .lt. h4b) .and. (p5b .lt. p3b) .and. & (p3b .le. p6b)) THEN CALL GET_HASH_BLOCK(d_b,dbl_mb(k_b),dimb,int_mb(k_b_offset),(p6b_2 & - noab - 1 + nvab * (p3b_2 - noab - 1 + nvab * (p5b_2 - noab - 1 &+ nvab * (h4b_2 - 1 + noab * (h7b_2 - 1 + noab * (h2b_2 - 1))))))) CALL TCE_SORT_6(dbl_mb(k_b),dbl_mb(k_b_sort),int_mb(k_range+h2b-1) &,int_mb(k_range+h7b-1),int_mb(k_range+h4b-1),int_mb(k_range+p5b-1) &,int_mb(k_range+p3b-1),int_mb(k_range+p6b-1),5,3,1,2,6,4,1.0d0) END IF IF ((h2b .le. h7b) .and. (h7b .lt. h4b) .and. (p3b .le. p5b)) THEN CALL GET_HASH_BLOCK(d_b,dbl_mb(k_b),dimb,int_mb(k_b_offset),(p6b_2 & - noab - 1 + nvab * (p5b_2 - noab - 1 + nvab * (p3b_2 - noab - 1 &+ nvab * (h4b_2 - 1 + noab * (h7b_2 - 1 + noab * (h2b_2 - 1))))))) CALL TCE_SORT_6(dbl_mb(k_b),dbl_mb(k_b_sort),int_mb(k_range+h2b-1) &,int_mb(k_range+h7b-1),int_mb(k_range+h4b-1),int_mb(k_range+p3b-1) &,int_mb(k_range+p5b-1),int_mb(k_range+p6b-1),4,3,1,2,6,5,-1.0d0) END IF IF ((h4b .le. h7b) .and. (p6b .lt. p3b)) THEN CALL GET_HASH_BLOCK(d_b,dbl_mb(k_b),dimb,int_mb(k_b_offset),(p3b_2 & - noab - 1 + nvab * (p6b_2 - noab - 1 + nvab * (p5b_2 - noab - 1 &+ nvab * (h7b_2 - 1 + noab * (h4b_2 - 1 + noab * (h2b_2 - 1))))))) CALL TCE_SORT_6(dbl_mb(k_b),dbl_mb(k_b_sort),int_mb(k_range+h2b-1) &,int_mb(k_range+h4b-1),int_mb(k_range+h7b-1),int_mb(k_range+p5b-1) &,int_mb(k_range+p6b-1),int_mb(k_range+p3b-1),6,2,1,3,5,4,1.0d0) END IF IF ((h4b .le. h7b) .and. (p5b .lt. p3b) .and. (p3b .le. p6b)) THEN CALL GET_HASH_BLOCK(d_b,dbl_mb(k_b),dimb,int_mb(k_b_offset),(p6b_2 & - noab - 1 + nvab * (p3b_2 - noab - 1 + nvab * (p5b_2 - noab - 1 &+ nvab * (h7b_2 - 1 + noab * (h4b_2 - 1 + noab * (h2b_2 - 1))))))) CALL TCE_SORT_6(dbl_mb(k_b),dbl_mb(k_b_sort),int_mb(k_range+h2b-1) &,int_mb(k_range+h4b-1),int_mb(k_range+h7b-1),int_mb(k_range+p5b-1) &,int_mb(k_range+p3b-1),int_mb(k_range+p6b-1),5,2,1,3,6,4,-1.0d0) END IF IF ((h4b .le. h7b) .and. (p3b .le. p5b)) THEN CALL GET_HASH_BLOCK(d_b,dbl_mb(k_b),dimb,int_mb(k_b_offset),(p6b_2 & - noab - 1 + nvab * (p5b_2 - noab - 1 + nvab * (p3b_2 - noab - 1 &+ nvab * (h7b_2 - 1 + noab * (h4b_2 - 1 + noab * (h2b_2 - 1))))))) CALL TCE_SORT_6(dbl_mb(k_b),dbl_mb(k_b_sort),int_mb(k_range+h2b-1) &,int_mb(k_range+h4b-1),int_mb(k_range+h7b-1),int_mb(k_range+p3b-1) &,int_mb(k_range+p5b-1),int_mb(k_range+p6b-1),4,2,1,3,6,5,1.0d0) END IF IF (.not.MA_POP_STACK(l_b)) CALL ERRQUIT('ccsdt_lr_beta_4_2_3_1_2' &,6,MA_ERR) nsuperp(1) = 1 nsuperp(2) = 1 isuperp = 1 IF (p5b .eq. p6b) THEN nsuperp(isuperp) = nsuperp(isuperp) + 1 ELSE isuperp = isuperp + 1 END IF CALL DGEMM('T','N',dima_sort,dimb_sort,dim_common,2.0d0/FACTORIAL( &nsuperp(1))/FACTORIAL(nsuperp(2)),dbl_mb(k_a_sort),dim_common,dbl_ &mb(k_b_sort),dim_common,1.0d0,dbl_mb(k_c_sort),dima_sort) IF (.not.MA_POP_STACK(l_b_sort)) CALL ERRQUIT('ccsdt_lr_beta_4_2_3 &_1_2',7,MA_ERR) IF (.not.MA_POP_STACK(l_a_sort)) CALL ERRQUIT('ccsdt_lr_beta_4_2_3 &_1_2',8,MA_ERR) END IF END IF END IF END DO END DO END DO IF (.not.MA_PUSH_GET(mt_dbl,dimc,'noname',l_c,k_c)) CALL ERRQUIT(' &ccsdt_lr_beta_4_2_3_1_2',9,MA_ERR) CALL TCE_SORT_4(dbl_mb(k_c_sort),dbl_mb(k_c),int_mb(k_range+p3b-1) &,int_mb(k_range+h4b-1),int_mb(k_range+h2b-1),int_mb(k_range+h10b-1 &),3,2,4,1,-1.0d0) CALL ADD_HASH_BLOCK(d_c,dbl_mb(k_c),dimc,int_mb(k_c_offset),(p3b - & noab - 1 + nvab * (h10b - 1 + noab * (h4b - 1 + noab * (h2b - 1)) &))) IF (.not.MA_POP_STACK(l_c)) CALL ERRQUIT('ccsdt_lr_beta_4_2_3_1_2' &,10,MA_ERR) IF (.not.MA_POP_STACK(l_c_sort)) CALL ERRQUIT('ccsdt_lr_beta_4_2_3 &_1_2',11,MA_ERR) END IF END IF END IF next = nxtask(nprocs,1) END IF count = count + 1 END DO END DO END DO END DO next = nxtask(-nprocs,1) call GA_SYNC() RETURN END
{ "pile_set_name": "Github" }
/* This Source Code Form is subject to the terms of the Mozilla Public * License, v. 2.0. If a copy of the MPL was not distributed with this * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ import React from 'react'; import { MqProps } from '../mq'; type MqMockProps = { onMatchChange: MqProps['onMatchChange']; } let isMatched = true; class Mq extends React.Component<MqMockProps> { componentDidMount() { this.props.onMatchChange(isMatched); } render() { return isMatched ? this.props.children : false; } } export function setIsMatched(newIsMatched: boolean) { isMatched = newIsMatched; } export default Mq;
{ "pile_set_name": "Github" }
<!doctype html> <html class="default no-js"> <head> <meta charset="utf-8"> <meta http-equiv="X-UA-Compatible" content="IE=edge"> <title>BouncingScrollPhysicsProps | Hydro-SDK</title> <meta name="description" content=""> <meta name="viewport" content="width=device-width, initial-scale=1"> <link rel="stylesheet" href="../assets/css/main.css"> </head> <body> <header> <div class="tsd-page-toolbar"> <div class="container"> <div class="table-wrap"> <div class="table-cell" id="tsd-search" data-index="../assets/js/search.js" data-base=".."> <div class="field"> <label for="tsd-search-field" class="tsd-widget search no-caption">Search</label> <input id="tsd-search-field" type="text" /> </div> <ul class="results"> <li class="state loading">Preparing search index...</li> <li class="state failure">The search index is not available</li> </ul> <a href="../index.html" class="title">Hydro-SDK</a> </div> <div class="table-cell" id="tsd-widgets"> <div id="tsd-filter"> <a href="#" class="tsd-widget options no-caption" data-toggle="options">Options</a> <div class="tsd-filter-group"> <div class="tsd-select" id="tsd-filter-visibility"> <span class="tsd-select-label">All</span> <ul class="tsd-select-list"> <li data-value="public">Public</li> <li data-value="protected">Public/Protected</li> <li data-value="private" class="selected">All</li> </ul> </div> <input type="checkbox" id="tsd-filter-inherited" checked /> <label class="tsd-widget" for="tsd-filter-inherited">Inherited</label> <input type="checkbox" id="tsd-filter-externals" checked /> <label class="tsd-widget" for="tsd-filter-externals">Externals</label> <input type="checkbox" id="tsd-filter-only-exported" /> <label class="tsd-widget" for="tsd-filter-only-exported">Only exported</label> </div> </div> <a href="#" class="tsd-widget menu no-caption" data-toggle="menu">Menu</a> </div> </div> </div> </div> <div class="tsd-page-title"> <div class="container"> <ul class="tsd-breadcrumb"> <li> <a href="../index.html">Globals</a> </li> <li> <a href="../modules/_flutter_widgets_index_.html">&quot;flutter/widgets/index&quot;</a> </li> <li> <a href="_flutter_widgets_index_.bouncingscrollphysicsprops.html">BouncingScrollPhysicsProps</a> </li> </ul> <h1>Interface BouncingScrollPhysicsProps</h1> </div> </div> </header> <div class="container container-main"> <div class="row"> <div class="col-8 col-content"> <section class="tsd-panel tsd-hierarchy"> <h3>Hierarchy</h3> <ul class="tsd-hierarchy"> <li> <span class="target">BouncingScrollPhysicsProps</span> </li> </ul> </section> <section class="tsd-panel-group tsd-index-group"> <h2>Index</h2> <section class="tsd-panel tsd-index-panel"> <div class="tsd-index-content"> <section class="tsd-index-section "> <h3>Properties</h3> <ul class="tsd-index-list"> <li class="tsd-kind-property tsd-parent-kind-interface"><a href="_flutter_widgets_index_.bouncingscrollphysicsprops.html#parent" class="tsd-kind-icon">parent</a></li> </ul> </section> </div> </section> </section> <section class="tsd-panel-group tsd-member-group "> <h2>Properties</h2> <section class="tsd-panel tsd-member tsd-kind-property tsd-parent-kind-interface"> <a name="parent" class="tsd-anchor"></a> <h3><span class="tsd-flag ts-flagOptional">Optional</span> parent</h3> <div class="tsd-signature tsd-kind-icon">parent<span class="tsd-signature-symbol">:</span> <a href="../classes/_flutter_widgets_index_.scrollphysics.html" class="tsd-signature-type">ScrollPhysics</a><span class="tsd-signature-symbol"> | </span><span class="tsd-signature-type">undefined</span></div> <aside class="tsd-sources"> <ul> <li>Defined in <a href="https://github.com/chgibb/flua/blob/70950f6/runtime/flutter/widgets/bouncingScrollPhysics.ts#L4">flutter/widgets/bouncingScrollPhysics.ts:4</a></li> </ul> </aside> </section> </section> </div> <div class="col-4 col-menu menu-sticky-wrap menu-highlight"> <nav class="tsd-navigation primary"> <ul> <li class="globals "> <a href="../index.html"><em>Globals</em></a> </li> <li class=" tsd-kind-module"> <a href="../modules/_dart_async_index_.html">&quot;dart/async/index&quot;</a> </li> <li class=" tsd-kind-module"> <a href="../modules/_dart_collection_index_.html">&quot;dart/collection/index&quot;</a> </li> <li class=" tsd-kind-module"> <a href="../modules/_dart_convert_index_.html">&quot;dart/convert/index&quot;</a> </li> <li class=" tsd-kind-module"> <a href="../modules/_dart_core_index_.html">&quot;dart/core/index&quot;</a> </li> <li class=" tsd-kind-module"> <a href="../modules/_dart_ui_index_.html">&quot;dart/ui/index&quot;</a> </li> <li class=" tsd-kind-module"> <a href="../modules/_flutter_animation_index_.html">&quot;flutter/animation/index&quot;</a> </li> <li class=" tsd-kind-module"> <a href="../modules/_flutter_cupertino_index_.html">&quot;flutter/cupertino/index&quot;</a> </li> <li class=" tsd-kind-module"> <a href="../modules/_flutter_gestures_index_.html">&quot;flutter/gestures/index&quot;</a> </li> <li class=" tsd-kind-module"> <a href="../modules/_flutter_material_index_.html">&quot;flutter/material/index&quot;</a> </li> <li class=" tsd-kind-module"> <a href="../modules/_flutter_painting_index_.html">&quot;flutter/painting/index&quot;</a> </li> <li class=" tsd-kind-module"> <a href="../modules/_flutter_rendering_index_.html">&quot;flutter/rendering/index&quot;</a> </li> <li class=" tsd-kind-module"> <a href="../modules/_flutter_services_index_.html">&quot;flutter/services/index&quot;</a> </li> <li class="current tsd-kind-module"> <a href="../modules/_flutter_widgets_index_.html">&quot;flutter/widgets/index&quot;</a> </li> <li class=" tsd-kind-module"> <a href="../modules/_http_index_.html">&quot;http/index&quot;</a> </li> <li class=" tsd-kind-module"> <a href="../modules/_scopedmodel_index_.html">&quot;scoped<wbr>Model/index&quot;</a> </li> </ul> </nav> <nav class="tsd-navigation secondary menu-sticky"> <ul class="before-current"> </ul> <ul class="current"> <li class="current tsd-kind-interface tsd-parent-kind-module"> <a href="_flutter_widgets_index_.bouncingscrollphysicsprops.html" class="tsd-kind-icon">Bouncing<wbr>Scroll<wbr>Physics<wbr>Props</a> <ul> <li class=" tsd-kind-property tsd-parent-kind-interface"> <a href="_flutter_widgets_index_.bouncingscrollphysicsprops.html#parent" class="tsd-kind-icon">parent</a> </li> </ul> </li> </ul> <ul class="after-current"> </ul> </nav> </div> </div> </div> <footer class="with-border-bottom"> <div class="container"> <h2>Legend</h2> <div class="tsd-legend-group"> <ul class="tsd-legend"> <li class="tsd-kind-module"><span class="tsd-kind-icon">Module</span></li> <li class="tsd-kind-object-literal"><span class="tsd-kind-icon">Object literal</span></li> <li class="tsd-kind-variable"><span class="tsd-kind-icon">Variable</span></li> <li class="tsd-kind-function"><span class="tsd-kind-icon">Function</span></li> <li class="tsd-kind-function tsd-has-type-parameter"><span class="tsd-kind-icon">Function with type parameter</span></li> <li class="tsd-kind-index-signature"><span class="tsd-kind-icon">Index signature</span></li> <li class="tsd-kind-type-alias"><span class="tsd-kind-icon">Type alias</span></li> <li class="tsd-kind-type-alias tsd-has-type-parameter"><span class="tsd-kind-icon">Type alias with type parameter</span></li> </ul> <ul class="tsd-legend"> <li class="tsd-kind-enum"><span class="tsd-kind-icon">Enumeration</span></li> <li class="tsd-kind-enum-member"><span class="tsd-kind-icon">Enumeration member</span></li> <li class="tsd-kind-property tsd-parent-kind-enum"><span class="tsd-kind-icon">Property</span></li> <li class="tsd-kind-method tsd-parent-kind-enum"><span class="tsd-kind-icon">Method</span></li> </ul> <ul class="tsd-legend"> <li class="tsd-kind-interface"><span class="tsd-kind-icon">Interface</span></li> <li class="tsd-kind-interface tsd-has-type-parameter"><span class="tsd-kind-icon">Interface with type parameter</span></li> <li class="tsd-kind-constructor tsd-parent-kind-interface"><span class="tsd-kind-icon">Constructor</span></li> <li class="tsd-kind-property tsd-parent-kind-interface"><span class="tsd-kind-icon">Property</span></li> <li class="tsd-kind-method tsd-parent-kind-interface"><span class="tsd-kind-icon">Method</span></li> <li class="tsd-kind-index-signature tsd-parent-kind-interface"><span class="tsd-kind-icon">Index signature</span></li> </ul> <ul class="tsd-legend"> <li class="tsd-kind-class"><span class="tsd-kind-icon">Class</span></li> <li class="tsd-kind-class tsd-has-type-parameter"><span class="tsd-kind-icon">Class with type parameter</span></li> <li class="tsd-kind-constructor tsd-parent-kind-class"><span class="tsd-kind-icon">Constructor</span></li> <li class="tsd-kind-property tsd-parent-kind-class"><span class="tsd-kind-icon">Property</span></li> <li class="tsd-kind-method tsd-parent-kind-class"><span class="tsd-kind-icon">Method</span></li> <li class="tsd-kind-accessor tsd-parent-kind-class"><span class="tsd-kind-icon">Accessor</span></li> <li class="tsd-kind-index-signature tsd-parent-kind-class"><span class="tsd-kind-icon">Index signature</span></li> </ul> <ul class="tsd-legend"> <li class="tsd-kind-constructor tsd-parent-kind-class tsd-is-inherited"><span class="tsd-kind-icon">Inherited constructor</span></li> <li class="tsd-kind-property tsd-parent-kind-class tsd-is-inherited"><span class="tsd-kind-icon">Inherited property</span></li> <li class="tsd-kind-method tsd-parent-kind-class tsd-is-inherited"><span class="tsd-kind-icon">Inherited method</span></li> <li class="tsd-kind-accessor tsd-parent-kind-class tsd-is-inherited"><span class="tsd-kind-icon">Inherited accessor</span></li> </ul> <ul class="tsd-legend"> <li class="tsd-kind-property tsd-parent-kind-class tsd-is-protected"><span class="tsd-kind-icon">Protected property</span></li> <li class="tsd-kind-method tsd-parent-kind-class tsd-is-protected"><span class="tsd-kind-icon">Protected method</span></li> <li class="tsd-kind-accessor tsd-parent-kind-class tsd-is-protected"><span class="tsd-kind-icon">Protected accessor</span></li> </ul> <ul class="tsd-legend"> <li class="tsd-kind-property tsd-parent-kind-class tsd-is-private"><span class="tsd-kind-icon">Private property</span></li> <li class="tsd-kind-method tsd-parent-kind-class tsd-is-private"><span class="tsd-kind-icon">Private method</span></li> <li class="tsd-kind-accessor tsd-parent-kind-class tsd-is-private"><span class="tsd-kind-icon">Private accessor</span></li> </ul> <ul class="tsd-legend"> <li class="tsd-kind-property tsd-parent-kind-class tsd-is-static"><span class="tsd-kind-icon">Static property</span></li> <li class="tsd-kind-call-signature tsd-parent-kind-class tsd-is-static"><span class="tsd-kind-icon">Static method</span></li> </ul> </div> </div> </footer> <div class="container tsd-generator"> <p>Generated using <a href="https://typedoc.org/" target="_blank">TypeDoc</a></p> </div> <div class="overlay"></div> <script src="../assets/js/main.js"></script> <script>if (location.protocol == 'file:') document.write('<script src="../assets/js/search.js"><' + '/script>');</script> </body> </html>
{ "pile_set_name": "Github" }
#region License // // The Open Toolkit Library License // // Copyright (c) 2006 - 2009 the Open Toolkit library. // // 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. // #endregion using System; using System.Collections.Generic; using System.ComponentModel; using System.Diagnostics; using System.Drawing; using System.Threading; using OpenTK.Graphics; using OpenTK.Input; using OpenTK.Platform; namespace OpenTK { /// <summary> /// The GameWindow class contains cross-platform methods to create and render on an OpenGL /// window, handle input and load resources. /// </summary> /// <remarks> /// GameWindow contains several events you can hook or override to add your custom logic: /// <list> /// <item> /// OnLoad: Occurs after creating the OpenGL context, but before entering the main loop. /// Override to load resources. /// </item> /// <item> /// OnUnload: Occurs after exiting the main loop, but before deleting the OpenGL context. /// Override to unload resources. /// </item> /// <item> /// OnResize: Occurs whenever GameWindow is resized. You should update the OpenGL Viewport /// and Projection Matrix here. /// </item> /// <item> /// OnUpdateFrame: Occurs at the specified logic update rate. Override to add your game /// logic. /// </item> /// <item> /// OnRenderFrame: Occurs at the specified frame render rate. Override to add your /// rendering code. /// </item> /// </list> /// Call the Run() method to start the application's main loop. Run(double, double) takes two /// parameters that /// specify the logic update rate, and the render update rate. /// </remarks> public class GameWindow : NativeWindow, IGameWindow, IDisposable { #region --- Fields --- //DisplayMode mode; // TODO: Removable? object exit_lock = new object(); IGraphicsContext glContext; bool isExiting = false; double update_period, render_period; double target_update_period, target_render_period; // TODO: Implement these: double update_time, render_time;//, event_time; //bool allow_sleep = true; // If true, GameWindow will call Timer.Sleep() if there is enough time. VSyncMode vsync; //InputDriver input_driver; #endregion #region --- Contructors --- #region public GameWindow() /// <summary>Constructs a new GameWindow with sensible default attributes.</summary> public GameWindow() : this(640, 480, GraphicsMode.Default, "OpenTK Game Window", 0, DisplayDevice.Default) { } #endregion #region public GameWindow(int width, int height) /// <summary>Constructs a new GameWindow with the specified attributes.</summary> /// <param name="width">The width of the GameWindow in pixels.</param> /// <param name="height">The height of the GameWindow in pixels.</param> public GameWindow(int width, int height) : this(width, height, GraphicsMode.Default, "OpenTK Game Window", 0, DisplayDevice.Default) { } #endregion #region public GameWindow(int width, int height, GraphicsMode mode) /// <summary>Constructs a new GameWindow with the specified attributes.</summary> /// <param name="width">The width of the GameWindow in pixels.</param> /// <param name="height">The height of the GameWindow in pixels.</param> /// <param name="mode">The OpenTK.Graphics.GraphicsMode of the GameWindow.</param> public GameWindow(int width, int height, GraphicsMode mode) : this(width, height, mode, "OpenTK Game Window", 0, DisplayDevice.Default) { } #endregion #region public GameWindow(int width, int height, GraphicsMode mode, string title) /// <summary>Constructs a new GameWindow with the specified attributes.</summary> /// <param name="width">The width of the GameWindow in pixels.</param> /// <param name="height">The height of the GameWindow in pixels.</param> /// <param name="mode">The OpenTK.Graphics.GraphicsMode of the GameWindow.</param> /// <param name="title">The title of the GameWindow.</param> public GameWindow(int width, int height, GraphicsMode mode, string title) : this(width, height, mode, title, 0, DisplayDevice.Default) { } #endregion #region public GameWindow(int width, int height, GraphicsMode mode, string title, GameWindowFlags options) /// <summary>Constructs a new GameWindow with the specified attributes.</summary> /// <param name="width">The width of the GameWindow in pixels.</param> /// <param name="height">The height of the GameWindow in pixels.</param> /// <param name="mode">The OpenTK.Graphics.GraphicsMode of the GameWindow.</param> /// <param name="title">The title of the GameWindow.</param> /// <param name="options">GameWindow options regarding window appearance and behavior.</param> public GameWindow(int width, int height, GraphicsMode mode, string title, GameWindowFlags options) : this(width, height, mode, title, options, DisplayDevice.Default) { } #endregion #region public GameWindow(int width, int height, GraphicsMode mode, string title, GameWindowFlags options, DisplayDevice device) /// <summary>Constructs a new GameWindow with the specified attributes.</summary> /// <param name="width">The width of the GameWindow in pixels.</param> /// <param name="height">The height of the GameWindow in pixels.</param> /// <param name="mode">The OpenTK.Graphics.GraphicsMode of the GameWindow.</param> /// <param name="title">The title of the GameWindow.</param> /// <param name="options">GameWindow options regarding window appearance and behavior.</param> /// <param name="device">The OpenTK.Graphics.DisplayDevice to construct the GameWindow in.</param> public GameWindow(int width, int height, GraphicsMode mode, string title, GameWindowFlags options, DisplayDevice device) : this(width, height, mode, title, options, device, 1, 0, GraphicsContextFlags.Default) { } #endregion #region public GameWindow(int width, int height, GraphicsMode mode, string title, GameWindowFlags options, DisplayDevice device, int major, int minor, GraphicsContextFlags flags) /// <summary>Constructs a new GameWindow with the specified attributes.</summary> /// <param name="width">The width of the GameWindow in pixels.</param> /// <param name="height">The height of the GameWindow in pixels.</param> /// <param name="mode">The OpenTK.Graphics.GraphicsMode of the GameWindow.</param> /// <param name="title">The title of the GameWindow.</param> /// <param name="options">GameWindow options regarding window appearance and behavior.</param> /// <param name="device">The OpenTK.Graphics.DisplayDevice to construct the GameWindow in.</param> /// <param name="major">The major version for the OpenGL GraphicsContext.</param> /// <param name="minor">The minor version for the OpenGL GraphicsContext.</param> /// <param name="flags">The GraphicsContextFlags version for the OpenGL GraphicsContext.</param> public GameWindow(int width, int height, GraphicsMode mode, string title, GameWindowFlags options, DisplayDevice device, int major, int minor, GraphicsContextFlags flags) : this(width, height, mode, title, options, device, major, minor, flags, null) { } #endregion #region public GameWindow(int width, int height, GraphicsMode mode, string title, GameWindowFlags options, DisplayDevice device, int major, int minor, GraphicsContextFlags flags, IGraphicsContext sharedContext) /// <summary>Constructs a new GameWindow with the specified attributes.</summary> /// <param name="width">The width of the GameWindow in pixels.</param> /// <param name="height">The height of the GameWindow in pixels.</param> /// <param name="mode">The OpenTK.Graphics.GraphicsMode of the GameWindow.</param> /// <param name="title">The title of the GameWindow.</param> /// <param name="options">GameWindow options regarding window appearance and behavior.</param> /// <param name="device">The OpenTK.Graphics.DisplayDevice to construct the GameWindow in.</param> /// <param name="major">The major version for the OpenGL GraphicsContext.</param> /// <param name="minor">The minor version for the OpenGL GraphicsContext.</param> /// <param name="flags">The GraphicsContextFlags version for the OpenGL GraphicsContext.</param> /// <param name="sharedContext">An IGraphicsContext to share resources with.</param> public GameWindow(int width, int height, GraphicsMode mode, string title, GameWindowFlags options, DisplayDevice device, int major, int minor, GraphicsContextFlags flags, IGraphicsContext sharedContext) : base(width, height, title, options, mode == null ? GraphicsMode.Default : mode, device == null ? DisplayDevice.Default : device) { try { glContext = new GraphicsContext(mode == null ? GraphicsMode.Default : mode, WindowInfo, major, minor, flags); glContext.MakeCurrent(WindowInfo); (glContext as IGraphicsContextInternal).LoadAll(); VSync = VSyncMode.On; //glWindow.WindowInfoChanged += delegate(object sender, EventArgs e) { OnWindowInfoChangedInternal(e); }; } catch (Exception e) { Debug.Print(e.ToString()); base.Dispose(); throw; } } #endregion #endregion #region --- Public Members --- #region Methods #region Dispose /// <summary> /// Disposes of the GameWindow, releasing all resources consumed by it. /// </summary> public override void Dispose() { try { Dispose(true); } finally { try { if (glContext != null) { glContext.Dispose(); glContext = null; } } finally { base.Dispose(); } } GC.SuppressFinalize(this); } #endregion #region Exit /// <summary> /// Closes the GameWindow. Equivalent to <see cref="Close"/> method. /// </summary> /// <remarks> /// <para>Override if you are not using <see cref="GameWindow.Run()"/>.</para> /// <para>If you override this method, place a call to base.Exit(), to ensure proper OpenTK shutdown.</para> /// </remarks> public virtual void Exit() { Close(); } #endregion #region MakeCurrent /// <summary> /// Makes the GraphicsContext current on the calling thread. /// </summary> public void MakeCurrent() { EnsureUndisposed(); Context.MakeCurrent(WindowInfo); } #endregion #region OnLoad /// <summary> /// Called after an OpenGL context has been established, but before entering the main loop. /// </summary> /// <param name="e">Not used.</param> protected virtual void OnLoad(EventArgs e) { if (Load != null) Load(this, e); } #endregion #region OnUnload /// <summary> /// Called after GameWindow.Exit was called, but before destroying the OpenGL context. /// </summary> /// <param name="e">Not used.</param> protected virtual void OnUnload(EventArgs e) { if (Unload != null) Unload(this, e); } #endregion #region public void Run() /// <summary> /// Enters the game loop of the GameWindow using the maximum update rate. /// </summary> /// <seealso cref="Run(double)"/> public void Run() { Run(0.0, 0.0); } #endregion #region public void Run(double updateFrequency) /// <summary> /// Enters the game loop of the GameWindow using the specified update rate. /// maximum possible render frequency. /// </summary> public void Run(double updateRate) { Run(updateRate, 0.0); } #endregion #region public void Run(double updates_per_second, double frames_per_second) /// <summary> /// Enters the game loop of the GameWindow updating and rendering at the specified frequency. /// </summary> /// <remarks> /// When overriding the default game loop you should call ProcessEvents() /// to ensure that your GameWindow responds to operating system events. /// <para> /// Once ProcessEvents() returns, it is time to call update and render the next frame. /// </para> /// </remarks> /// <param name="updates_per_second">The frequency of UpdateFrame events.</param> /// <param name="frames_per_second">The frequency of RenderFrame events.</param> public void Run(double updates_per_second, double frames_per_second) { EnsureUndisposed(); try { if (updates_per_second < 0.0 || updates_per_second > 200.0) throw new ArgumentOutOfRangeException("updates_per_second", updates_per_second, "Parameter should be inside the range [0.0, 200.0]"); if (frames_per_second < 0.0 || frames_per_second > 200.0) throw new ArgumentOutOfRangeException("frames_per_second", frames_per_second, "Parameter should be inside the range [0.0, 200.0]"); TargetUpdateFrequency = updates_per_second; TargetRenderFrequency = frames_per_second; Stopwatch update_watch = new Stopwatch(), render_watch = new Stopwatch(); double next_render = 0.0, next_update = 0.0; FrameEventArgs update_args = new FrameEventArgs(); FrameEventArgs render_args = new FrameEventArgs(); update_watch.Reset(); render_watch.Reset(); Visible = true; // Make sure the GameWindow is visible. OnLoadInternal(EventArgs.Empty); // On some platforms, ProcessEvents() does not return while the user is resizing or moving // the window. We can avoid this issue by raising UpdateFrame and RenderFrame events // whenever we encounter a size or move event. EventHandler<EventArgs> DispatchUpdateAndRenderFrame = delegate(object sender, EventArgs e) { RaiseUpdateFrame(update_watch, ref next_update, update_args); RaiseRenderFrame(render_watch, ref next_render, render_args); }; Move += DispatchUpdateAndRenderFrame; Resize += DispatchUpdateAndRenderFrame; Debug.Print("Entering main loop."); while (!IsExiting && Exists) { ProcessEvents(); DispatchUpdateAndRenderFrame(this, EventArgs.Empty); } } finally { Debug.Print("Restoring priority."); Thread.CurrentThread.Priority = ThreadPriority.Normal; OnUnloadInternal(EventArgs.Empty); if (Exists) { Dispose(); //while (this.Exists) ProcessEvents(); // TODO: Should similar behaviour be retained, possibly on native window level? } } } private void RaiseUpdateFrame(Stopwatch update_watch, ref double next_update, FrameEventArgs update_args) { int num_updates = 0; // Cap the maximum time drift to 1 second (e.g. when the process is suspended). double time = update_watch.Elapsed.TotalSeconds; if (time > 1.0) time = 1.0; // Raise UpdateFrame events until we catch up with our target update rate. while (next_update - time <= 0.0) { // Don't schedule a new update more than 1 second in the future. // Sometimes the hardware cannot keep up with updates // (e.g. when the update rate is too high, or the UpdateFrame processing // is too costly). This cap ensures we can catch up in a reasonable time // once the load becomes lighter. next_update = next_update - time + TargetUpdatePeriod; if (next_update < -1.0) next_update = -1.0; // Allow up to 10 consecutive UpdateFrame events. // This prevents the application from "hanging" when the hardware cannot // keep up with the requested update rate. if (++num_updates >= 10) break; if (time > 0) { update_args.Time = time; OnUpdateFrameInternal(update_args); update_time = update_watch.Elapsed.TotalSeconds; } if (TargetUpdateFrequency == 0.0) break; time = update_watch.Elapsed.TotalSeconds; next_update -= time; // Stopwatches are not accurate over long time periods. // We accumlate the total elapsed time into the time variable // while reseting the Stopwatch frequently. update_watch.Reset(); update_watch.Start(); } // Calculate statistics if (num_updates > 0) { update_period = time / (double)num_updates; } } private void RaiseRenderFrame(Stopwatch render_watch, ref double next_render, FrameEventArgs render_args) { // Cap the maximum time drift to 1 second (e.g. when the process is suspended). double time = render_watch.Elapsed.TotalSeconds; if (time > 1.0) time = 1.0; double time_left = next_render - time; // Todo: remove this? if (VSync == VSyncMode.Adaptive) { // Check if we have enough time for a vsync if (TargetRenderPeriod != 0 && RenderTime > 2.0 * TargetRenderPeriod) Context.VSync = false; else Context.VSync = true; } if (time_left <= 0.0) { // Schedule next render event. The 1 second cap ensures // the process does not appear to hang. next_render = time_left + TargetRenderPeriod; if (next_render < -1.0) next_render = -1.0; render_watch.Reset(); render_watch.Start(); if (time > 0) { render_period = render_args.Time = time; OnRenderFrameInternal(render_args); render_time = render_watch.Elapsed.TotalSeconds; } } } #endregion #region SwapBuffers /// <summary> /// Swaps the front and back buffer, presenting the rendered scene to the user. /// </summary> public void SwapBuffers() { EnsureUndisposed(); this.Context.SwapBuffers(); } #endregion #endregion #region Properties #region Context /// <summary> /// Returns the opengl IGraphicsContext associated with the current GameWindow. /// </summary> public IGraphicsContext Context { get { EnsureUndisposed(); return glContext; } } #endregion #region IsExiting /// <summary> /// Gets a value indicating whether the shutdown sequence has been initiated /// for this window, by calling GameWindow.Exit() or hitting the 'close' button. /// If this property is true, it is no longer safe to use any OpenTK.Input or /// OpenTK.Graphics.OpenGL functions or properties. /// </summary> public bool IsExiting { get { EnsureUndisposed(); return isExiting; } } #endregion #region Joysticks /// <summary> /// Gets a readonly IList containing all available OpenTK.Input.JoystickDevices. /// </summary> public IList<JoystickDevice> Joysticks { get { return InputDriver.Joysticks; } } #endregion #region Keyboard /// <summary> /// Gets the primary Keyboard device, or null if no Keyboard exists. /// </summary> public KeyboardDevice Keyboard { get { return InputDriver.Keyboard.Count > 0 ? InputDriver.Keyboard[0] : null; } } #endregion #region Mouse /// <summary> /// Gets the primary Mouse device, or null if no Mouse exists. /// </summary> public MouseDevice Mouse { get { return InputDriver.Mouse.Count > 0 ? InputDriver.Mouse[0] : null; } } #endregion #region --- GameWindow Timing --- // TODO: Disabled because it is not reliable enough. Use vsync as a workaround. //#region public bool AllowSleep //public bool AllowSleep //{ // get { return allow_sleep; } // set { allow_sleep = value; } //} //#endregion #region RenderFrequency /// <summary> /// Gets a double representing the actual frequency of RenderFrame events, in Herz (i.e. FPS or Frames Per Second). /// </summary> public double RenderFrequency { get { EnsureUndisposed(); if (render_period == 0.0) return 1.0; return 1.0 / render_period; } } #endregion #region RenderPeriod /// <summary> /// Gets a double representing the period of RenderFrame events, in seconds. /// </summary> public double RenderPeriod { get { EnsureUndisposed(); return render_period; } } #endregion #region RenderTime /// <summary> /// Gets a double representing the time spent in the RenderFrame function, in seconds. /// </summary> public double RenderTime { get { EnsureUndisposed(); return render_time; } protected set { EnsureUndisposed(); render_time = value; } } #endregion #region TargetRenderFrequency /// <summary> /// Gets or sets a double representing the target render frequency, in Herz. /// </summary> /// <remarks> /// <para>A value of 0.0 indicates that RenderFrame events are generated at the maximum possible frequency (i.e. only limited by the hardware's capabilities).</para> /// <para>Values lower than 1.0Hz are clamped to 1.0Hz. Values higher than 200.0Hz are clamped to 200.0Hz.</para> /// </remarks> public double TargetRenderFrequency { get { EnsureUndisposed(); if (TargetRenderPeriod == 0.0) return 0.0; return 1.0 / TargetRenderPeriod; } set { EnsureUndisposed(); if (value < 1.0) { TargetRenderPeriod = 0.0; } else if (value <= 200.0) { TargetRenderPeriod = 1.0 / value; } else Debug.Print("Target render frequency clamped to 200.0Hz."); // TODO: Where is it actually performed? } } #endregion #region TargetRenderPeriod /// <summary> /// Gets or sets a double representing the target render period, in seconds. /// </summary> /// <remarks> /// <para>A value of 0.0 indicates that RenderFrame events are generated at the maximum possible frequency (i.e. only limited by the hardware's capabilities).</para> /// <para>Values lower than 0.005 seconds (200Hz) are clamped to 0.0. Values higher than 1.0 seconds (1Hz) are clamped to 1.0.</para> /// </remarks> public double TargetRenderPeriod { get { EnsureUndisposed(); return target_render_period; } set { EnsureUndisposed(); if (value <= 0.005) { target_render_period = 0.0; } else if (value <= 1.0) { target_render_period = value; } else Debug.Print("Target render period clamped to 1.0 seconds."); } } #endregion #region TargetUpdateFrequency /// <summary> /// Gets or sets a double representing the target update frequency, in Herz. /// </summary> /// <remarks> /// <para>A value of 0.0 indicates that UpdateFrame events are generated at the maximum possible frequency (i.e. only limited by the hardware's capabilities).</para> /// <para>Values lower than 1.0Hz are clamped to 1.0Hz. Values higher than 200.0Hz are clamped to 200.0Hz.</para> /// </remarks> public double TargetUpdateFrequency { get { EnsureUndisposed(); if (TargetUpdatePeriod == 0.0) return 0.0; return 1.0 / TargetUpdatePeriod; } set { EnsureUndisposed(); if (value < 1.0) { TargetUpdatePeriod = 0.0; } else if (value <= 200.0) { TargetUpdatePeriod = 1.0 / value; } else Debug.Print("Target update frequency clamped to 200.0Hz."); // TODO: Where is it actually performed? } } #endregion #region TargetUpdatePeriod /// <summary> /// Gets or sets a double representing the target update period, in seconds. /// </summary> /// <remarks> /// <para>A value of 0.0 indicates that UpdateFrame events are generated at the maximum possible frequency (i.e. only limited by the hardware's capabilities).</para> /// <para>Values lower than 0.005 seconds (200Hz) are clamped to 0.0. Values higher than 1.0 seconds (1Hz) are clamped to 1.0.</para> /// </remarks> public double TargetUpdatePeriod { get { EnsureUndisposed(); return target_update_period; } set { EnsureUndisposed(); if (value <= 0.005) { target_update_period = 0.0; } else if (value <= 1.0) { target_update_period = value; } else Debug.Print("Target update period clamped to 1.0 seconds."); // TODO: Where is it actually performed? } } #endregion #region UpdateFrequency /// <summary> /// Gets a double representing the frequency of UpdateFrame events, in Herz. /// </summary> public double UpdateFrequency { get { EnsureUndisposed(); if (update_period == 0.0) return 1.0; return 1.0 / update_period; } } #endregion #region UpdatePeriod /// <summary> /// Gets a double representing the period of UpdateFrame events, in seconds. /// </summary> public double UpdatePeriod { get { EnsureUndisposed(); return update_period; } } #endregion #region UpdateTime /// <summary> /// Gets a double representing the time spent in the UpdateFrame function, in seconds. /// </summary> public double UpdateTime { get { EnsureUndisposed(); return update_time; } } #endregion #endregion #region VSync /// <summary> /// Gets or sets the VSyncMode. /// </summary> public VSyncMode VSync { get { EnsureUndisposed(); GraphicsContext.Assert(); return vsync; } set { EnsureUndisposed(); GraphicsContext.Assert(); Context.VSync = (vsync = value) != VSyncMode.Off; } } #endregion #endregion #region Events /// <summary> /// Occurs before the window is displayed for the first time. /// </summary> public event EventHandler<EventArgs> Load; /// <summary> /// Occurs when it is time to render a frame. /// </summary> public event EventHandler<FrameEventArgs> RenderFrame; /// <summary> /// Occurs before the window is destroyed. /// </summary> public event EventHandler<EventArgs> Unload; /// <summary> /// Occurs when it is time to update a frame. /// </summary> public event EventHandler<FrameEventArgs> UpdateFrame; #endregion #endregion #region --- Protected Members --- #region Dispose /// <summary> /// Override to add custom cleanup logic. /// </summary> /// <param name="manual">True, if this method was called by the application; false if this was called by the finalizer thread.</param> protected virtual void Dispose(bool manual) { } #endregion #region OnRenderFrame /// <summary> /// Called when the frame is rendered. /// </summary> /// <param name="e">Contains information necessary for frame rendering.</param> /// <remarks> /// Subscribe to the <see cref="RenderFrame"/> event instead of overriding this method. /// </remarks> protected virtual void OnRenderFrame(FrameEventArgs e) { if (RenderFrame != null) RenderFrame(this, e); } #endregion #region OnUpdateFrame /// <summary> /// Called when the frame is updated. /// </summary> /// <param name="e">Contains information necessary for frame updating.</param> /// <remarks> /// Subscribe to the <see cref="UpdateFrame"/> event instead of overriding this method. /// </remarks> protected virtual void OnUpdateFrame(FrameEventArgs e) { if (UpdateFrame != null) UpdateFrame(this, e); } #endregion #region OnWindowInfoChanged /// <summary> /// Called when the WindowInfo for this GameWindow has changed. /// </summary> /// <param name="e">Not used.</param> protected virtual void OnWindowInfoChanged(EventArgs e) { } #endregion #endregion #region --- Private Members --- #region OnLoadInternal private void OnLoadInternal(EventArgs e) { OnResize(EventArgs.Empty); OnLoad(e); } #endregion #region OnRenderFrameInternal private void OnRenderFrameInternal(FrameEventArgs e) { if (Exists && !isExiting) OnRenderFrame(e); } #endregion #region OnUnloadInternal private void OnUnloadInternal(EventArgs e) { OnUnload(e); } #endregion #region OnUpdateFrameInternal private void OnUpdateFrameInternal(FrameEventArgs e) { if (Exists && !isExiting) OnUpdateFrame(e); } #endregion #region OnWindowInfoChangedInternal private void OnWindowInfoChangedInternal(EventArgs e) { glContext.MakeCurrent(WindowInfo); OnWindowInfoChanged(e); } #endregion #endregion } #region public enum VSyncMode /// <summary> /// Enumerates available VSync modes. /// </summary> public enum VSyncMode { /// <summary> /// Vsync disabled. /// </summary> Off = 0, /// <summary> /// VSync enabled. /// </summary> On, /// <summary> /// VSync enabled, but automatically disabled if framerate falls below a specified limit. /// </summary> Adaptive, } #endregion }
{ "pile_set_name": "Github" }
mult = 247905749270528 mod = 2**62-1 trace = [[28629151, 0, 1, 0, 0, 0, 0, 0], [4588277794174371330, 0, 1, 0, 0, 0, 0, 0], [4557362566608270193, 0, 1, 0, 0, 0, 0, 0], [4597225827500493308, 0, 1, 0, 0, 0, 0, 0], [4399455111035409631, 0, 1, 0, 0, 0, 0, 0], [3664679811648746944, 0, 1, 0, 0, 0, 0, 0], [1822527803964528750, 0, 1, 0, 0, 0, 0, 0], [2107290073593614393, 0, 1, 0, 0, 0, 0, 0], [103104307719214561, 0, 1, 0, 0, 0, 0, 0], [3773217954610171964, 0, 1, 0, 0, 0, 0, 0], [1852072839260827083, 0, 1, 0, 0, 0, 0, 0], [3465871536121230779, 0, 1, 0, 0, 0, 0, 0], [223194874355517702, 0, 1, 0, 0, 0, 0, 0], [1454204952931951837, 0, 1, 0, 0, 0, 0, 0], [3030456872916287478, 0, 1, 0, 0, 0, 0, 0], [426011771323652532, 0, 1, 0, 0, 0, 0, 0], [1276028785627724173, 0, 1, 0, 0, 0, 0, 0], [1962653697352394735, 0, 1, 0, 0, 0, 0, 0], [1600956848133034570, 0, 1, 0, 0, 0, 0, 0], [2045579747554458289, 0, 1, 0, 0, 0, 0, 0], [4248193240456187641, 0, 1, 0, 0, 0, 0, 0], [4478689482975263576, 0, 1, 0, 0, 0, 0, 0], [1235692576284114044, 0, 1, 0, 0, 0, 0, 0], [2579703272274331094, 0, 1, 0, 0, 0, 0, 0], [1394874119223018380, 0, 1, 0, 0, 0, 0, 0], [4275420194958799226, 0, 1, 0, 0, 0, 0, 0], [2401030954359721279, 0, 1, 0, 0, 0, 0, 0], [1313700932660640339, 0, 1, 0, 0, 0, 0, 0], [2401701271938149070, 0, 1, 0, 0, 0, 0, 0], [4217153612451355368, 0, 1, 0, 0, 0, 0, 0], [2389747163516760623, 0, 1, 0, 0, 0, 0, 0], [3483955087661197897, 0, 1, 0, 0, 0, 0, 0], [4522489230881850831, 0, 1, 0, 0, 0, 0, 0]] def guess(inp, out): for i in range(256): if (inp + i) * mult % mod == out: return chr(i) before = 0 res = '' for x in trace: if before != 0: res += guess(before, x[0]) before = x[0] print(res)
{ "pile_set_name": "Github" }
#' Fade colors #' #' Fade colors so they are transparent. #' #' #' @param col An integer, color name, or RGB hexadecimal. #' @param fade The amount to fade \code{col}. This value should be a character #' in hexadecimal from '00' to 'FF'. The smaller the value, the greater the #' fading. #' @author David Diez #' @export #' @examples #' #' data(mariokart) #' new <- mariokart$cond == 'new' #' used <- mariokart$cond == 'used' #' #' par(mfrow=1:2) #' #' #===> color numbers <===# #' dotPlot(mariokart$total_pr[new], ylim=c(0,3), xlim=c(25, 80), pch=20, #' col=2, cex=2, main='using regular colors') #' dotPlot(mariokart$total_pr[used], at=2, add=TRUE, col=4, pch=20, cex=2) #' dotPlot(mariokart$total_pr[new], ylim=c(0,3), xlim=c(25, 80), #' col=fadeColor(2, '22'), pch=20, cex=2, #' main='fading the colors first') #' dotPlot(mariokart$total_pr[used], at=2, add=TRUE, #' col=fadeColor(4, '22'), pch=20, cex=2) #' #' #===> color names <===# #' dotPlot(mariokart$total_pr[new], ylim=c(0,3), xlim=c(25, 80), pch=20, #' col='red', cex=2, main='using regular colors') #' dotPlot(mariokart$total_pr[used], at=2, add=TRUE, col='blue', pch=20, cex=2) #' dotPlot(mariokart$total_pr[new], ylim=c(0,3), xlim=c(25, 80), #' col=fadeColor('red', '22'), pch=20, cex=2, #' main='fading the colors first') #' dotPlot(mariokart$total_pr[used], at=2, add=TRUE, #' col=fadeColor('blue', '22'), pch=20, cex=2) #' #' #===> hexadecimal <===# #' dotPlot(mariokart$total_pr[new], ylim=c(0,3), xlim=c(25, 80), pch=20, #' col='#FF0000', cex=2, main='using regular colors') #' dotPlot(mariokart$total_pr[used], at=2, add=TRUE, col='#0000FF', pch=20, #' cex=2) #' dotPlot(mariokart$total_pr[new], ylim=c(0,3), xlim=c(25, 80), #' col=fadeColor('#FF0000', '22'), pch=20, cex=2, #' main='fading the colors first') #' dotPlot(mariokart$total_pr[used], at=2, add=TRUE, #' col=fadeColor('#0000FF', '22'), pch=20, cex=2) #' #' #===> alternative: rgb function <===# #' dotPlot(mariokart$total_pr[new], ylim=c(0,3), xlim=c(25, 80), pch=20, #' col=rgb(1,0,0), cex=2, main='using regular colors') #' dotPlot(mariokart$total_pr[used], at=2, add=TRUE, col=rgb(0,0,1), #' pch=20, cex=2) #' dotPlot(mariokart$total_pr[new], ylim=c(0,3), xlim=c(25, 80), #' col=rgb(1,0,0,1/8), pch=20, cex=2, #' main='fading the colors first') #' dotPlot(mariokart$total_pr[used], at=2, add=TRUE, #' col=rgb(0,0,1,1/8), pch=20, cex=2) #' fadeColor <- function(col, fade = 'FF') { if (is.numeric(col)[1]) { col <- round(col) COL <- col COL[col %% 8 == 0] <- '#BBBBBB' COL[col %% 8 == 1] <- '#000000' COL[col %% 8 == 2] <- '#BB0000' COL[col %% 8 == 3] <- '#00FF00' COL[col %% 8 == 4] <- '#0000FF' COL[col %% 8 == 5] <- '#00FFFF' COL[col %% 8 == 6] <- '#FF00FF' COL[col %% 8 == 7] <- '#FFFF00' col <- COL } else if (substr(col[1], 1, 1) != '#') { temp <- grDevices::col2rgb(col[1]) col <- grDevices::rgb(temp[1], temp[2], temp[3], maxColorValue = 255) } # check fading if (any(nchar(col[1]) != 7)) { stop('col must be either an integer or in #RRGGBB format\n') } if (any(nchar(fade[1]) != 2)) { stop('fade must be a hexadecimal string of 2 characters\n') } col <- paste(col, fade, sep = '') return(col) }
{ "pile_set_name": "Github" }
/* * Adaptec AIC7xxx device driver for Linux. * * Copyright (c) 2000-2001 Adaptec Inc. * 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, * without modification. * 2. Redistributions in binary form must reproduce at minimum a disclaimer * substantially similar to the "NO WARRANTY" disclaimer below * ("Disclaimer") and any redistribution must be conditioned upon * including a substantially similar Disclaimer requirement for further * binary redistribution. * 3. Neither the names of the above-listed copyright holders nor the names * of any contributors may be used to endorse or promote products derived * from this software without specific prior written permission. * * Alternatively, this software may be distributed under the terms of the * GNU General Public License ("GPL") version 2 as published by the Free * Software Foundation. * * NO WARRANTY * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTIBILITY AND FITNESS FOR * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT * HOLDERS OR CONTRIBUTORS BE LIABLE FOR 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 DAMAGES. * * $Id$ * */ #ifndef _AIC7XXX_PCI_H_ #define _AIC7XXX_PCI_H_ #define ID_ALL_MASK 0xFFFFFFFFFFFFFFFFull #define ID_DEV_VENDOR_MASK 0xFFFFFFFF00000000ull #define ID_9005_GENERIC_MASK 0xFFF0FFFF00000000ull #define ID_9005_SISL_MASK 0x000FFFFF00000000ull #define ID_9005_SISL_ID 0x0005900500000000ull #define ID_AIC7850 0x5078900400000000ull #define ID_AHA_2902_04_10_15_20C_30C 0x5078900478509004ull #define ID_AIC7855 0x5578900400000000ull #define ID_AIC7859 0x3860900400000000ull #define ID_AHA_2930CU 0x3860900438699004ull #define ID_AIC7860 0x6078900400000000ull #define ID_AIC7860C 0x6078900478609004ull #define ID_AHA_1480A 0x6075900400000000ull #define ID_AHA_2940AU_0 0x6178900400000000ull #define ID_AHA_2940AU_1 0x6178900478619004ull #define ID_AHA_2940AU_CN 0x2178900478219004ull #define ID_AHA_2930C_VAR 0x6038900438689004ull #define ID_AIC7870 0x7078900400000000ull #define ID_AHA_2940 0x7178900400000000ull #define ID_AHA_3940 0x7278900400000000ull #define ID_AHA_398X 0x7378900400000000ull #define ID_AHA_2944 0x7478900400000000ull #define ID_AHA_3944 0x7578900400000000ull #define ID_AHA_4944 0x7678900400000000ull #define ID_AIC7880 0x8078900400000000ull #define ID_AIC7880_B 0x8078900478809004ull #define ID_AHA_2940U 0x8178900400000000ull #define ID_AHA_3940U 0x8278900400000000ull #define ID_AHA_2944U 0x8478900400000000ull #define ID_AHA_3944U 0x8578900400000000ull #define ID_AHA_398XU 0x8378900400000000ull #define ID_AHA_4944U 0x8678900400000000ull #define ID_AHA_2940UB 0x8178900478819004ull #define ID_AHA_2930U 0x8878900478889004ull #define ID_AHA_2940U_PRO 0x8778900478879004ull #define ID_AHA_2940U_CN 0x0078900478009004ull #define ID_AIC7895 0x7895900478959004ull #define ID_AIC7895_ARO 0x7890900478939004ull #define ID_AIC7895_ARO_MASK 0xFFF0FFFFFFFFFFFFull #define ID_AHA_2940U_DUAL 0x7895900478919004ull #define ID_AHA_3940AU 0x7895900478929004ull #define ID_AHA_3944AU 0x7895900478949004ull #define ID_AIC7890 0x001F9005000F9005ull #define ID_AIC7890_ARO 0x00139005000F9005ull #define ID_AAA_131U2 0x0013900500039005ull #define ID_AHA_2930U2 0x0011900501819005ull #define ID_AHA_2940U2B 0x00109005A1009005ull #define ID_AHA_2940U2_OEM 0x0010900521809005ull #define ID_AHA_2940U2 0x00109005A1809005ull #define ID_AHA_2950U2B 0x00109005E1009005ull #define ID_AIC7892 0x008F9005FFFF9005ull #define ID_AIC7892_ARO 0x00839005FFFF9005ull #define ID_AHA_29160 0x00809005E2A09005ull #define ID_AHA_29160_CPQ 0x00809005E2A00E11ull #define ID_AHA_29160N 0x0080900562A09005ull #define ID_AHA_29160C 0x0080900562209005ull #define ID_AHA_29160B 0x00809005E2209005ull #define ID_AHA_19160B 0x0081900562A19005ull #define ID_AHA_2915_30LP 0x0082900502109005ull #define ID_AIC7896 0x005F9005FFFF9005ull #define ID_AIC7896_ARO 0x00539005FFFF9005ull #define ID_AHA_3950U2B_0 0x00509005FFFF9005ull #define ID_AHA_3950U2B_1 0x00509005F5009005ull #define ID_AHA_3950U2D_0 0x00519005FFFF9005ull #define ID_AHA_3950U2D_1 0x00519005B5009005ull #define ID_AIC7899 0x00CF9005FFFF9005ull #define ID_AIC7899_ARO 0x00C39005FFFF9005ull #define ID_AHA_3960D 0x00C09005F6209005ull #define ID_AHA_3960D_CPQ 0x00C09005F6200E11ull #define ID_AIC7810 0x1078900400000000ull #define ID_AIC7815 0x7815900400000000ull #endif /* _AIC7XXX_PCI_H_ */
{ "pile_set_name": "Github" }
Feature: In order to write automated acceptance tests As a tester I want Frank to be able to automate UISwitches Background: Given I launch the app And I touch "UISwitch" Scenario: Swiping the switch off and on Given switch "the switch" should be on When I swipe "the switch" leftwards Then I should see "Switch is off" When I swipe "the switch" rightwards Then I should see "Switch is on"
{ "pile_set_name": "Github" }
## toggleswitch-behavior-g.pkg # # Implement behavior of buttons which toggle # between ON and OFF states. # # The visual appearance of these toggles is # specified separately, by the Button_Look # argument to the generic. # Compiled by: # src/lib/x-kit/widget/xkit-widget.sublib # TODO: Allow disabling of highlighting # "GOTO statement considered harmful" # # - C.A.R. Hoare supplied # title to the famous # E. W. Dijkstra letter in # CACM 11, 3 (March, 1968) stipulate include package threadkit; # threadkit is from src/lib/src/lib/thread-kit/src/core-thread-kit/threadkit.pkg # package bb = button_base; # button_base is from src/lib/x-kit/widget/old/leaf/button-base.pkg package tt = toggle_type; # toggle_type is from src/lib/x-kit/widget/old/leaf/toggle-type.pkg package wg = widget; # widget is from src/lib/x-kit/widget/old/basic/widget.pkg package wa = widget_attribute_old; # widget_attribute_old is from src/lib/x-kit/widget/old/lib/widget-attribute-old.pkg package g2d= geometry2d; # geometry2d is from src/lib/std/2d/geometry2d.pkg # package xc = xclient; # xclient is from src/lib/x-kit/xclient/xclient.pkg herein # This generic is referenced (only) four times, in # # src/lib/x-kit/widget/old/leaf/toggleswitches.pkg # generic package toggleswitch_behavior_g ( # ======================= # button_look: Button_Look # Button_Look is from src/lib/x-kit/widget/old/leaf/button-look.api ) : (weak) Toggleswitch_Factory # Toggleswitch_Factory is from src/lib/x-kit/widget/old/leaf/toggleswitch-factory.api { attributes = [ (wa::is_active, wa::BOOL, wa::BOOL_VAL TRUE), (wa::is_set, wa::BOOL, wa::BOOL_VAL FALSE) ]; fun realize { kidplug, window, window_size } (state, (plea_slot, event_slot, bv)) = { (xc::ignore_keyboard kidplug) -> xc::KIDPLUG { from_mouse', from_other', ... }; mouse_slot = make_mailslot (); receive_mouse' = take_from_mailslot' mouse_slot; drawf = button_look::make_button_drawfn (bv, window, window_size); fun do_plea (bb::GET_BUTTON_ACTIVE_FLAG reply_1shot, state) => { put_in_oneshot (reply_1shot, bb::get_button_active_flag state); # state; }; do_plea (bb::SET_BUTTON_ACTIVE_FLAG arg, state) => bb::set_button_active_flag (arg, state); do_plea (bb::GET_SIZE_CONSTRAINT reply_1shot, state) => { put_in_oneshot (reply_1shot, button_look::bounds bv); # state; }; do_plea (bb::GET_ARGS reply_1shot, state) => { put_in_oneshot (reply_1shot, button_look::window_args bv); # state; }; do_plea (bb::GET_STATE reply_1shot, state) => { put_in_oneshot (reply_1shot, bb::get_state state); # state; }; do_plea (bb::SET_STATE arg, state) => bb::set_state (arg, state); do_plea (_, state) => state; end; fun do_mom (xc::ETC_REDRAW _, me as (state, drawf)) => { drawf state; me; }; do_mom (xc::ETC_RESIZE ({ wide, high, ... }: g2d::Box), (state, _)) => (state, button_look::make_button_drawfn (bv, window, { wide, high } )); do_mom (_, me) => me; end; fun do_mouse (bb::mouse::FOCUS v, me as ({ button_state, has_mouse_focus, mousebutton_is_down => FALSE }, drawf)) => if (v == has_mouse_focus) # me; else state' = { button_state, has_mouse_focus => v, mousebutton_is_down => FALSE }; drawf state'; put_in_mailslot ( event_slot, # v ?? tt::TOGGLE_READY :: tt::TOGGLE_NORMAL ); (state', drawf); fi; do_mouse (bb::mouse::FOCUS v, ({ button_state, has_mouse_focus, mousebutton_is_down => TRUE }, drawf)) => { state' = { button_state, has_mouse_focus => v, mousebutton_is_down => TRUE }; # drawf state'; (state', drawf); }; do_mouse (bb::mouse::DOWN bttn, ({ button_state, ... }, drawf)) => { state' = { button_state, has_mouse_focus => TRUE, mousebutton_is_down => TRUE }; # drawf state'; (state', drawf); }; do_mouse (bb::mouse::UP bttn, (state, drawf)) => if state.has_mouse_focus # state' = { button_state => bb::flip state.button_state, has_mouse_focus => TRUE, mousebutton_is_down => FALSE }; drawf state'; put_in_mailslot (event_slot, tt::TOGGLE_SET (bb::get_state state')); (state', drawf); else state' = { button_state => state.button_state, has_mouse_focus => FALSE, mousebutton_is_down => FALSE }; drawf state'; put_in_mailslot (event_slot, tt::TOGGLE_NORMAL); (state', drawf); fi; end; fun active_cmd_p (me as (state, drawf)) = do_one_mailop [ take_from_mailslot' plea_slot ==> (\\ mailop = { state' = do_plea (mailop, state); # if (state' == state) # active_cmd_p me; else drawf state'; # if (bb::get_button_active_flag state') # put_in_mailslot (event_slot, tt::TOGGLE_SET (bb::get_state state')); # active_cmd_p (state', drawf); else if (state.has_mouse_focus or state.mousebutton_is_down) # put_in_mailslot (event_slot, tt::TOGGLE_NORMAL); fi; inactive_cmd_p (state', drawf); fi; fi; }), receive_mouse' ==> (\\ m = active_cmd_p (do_mouse (m, me))), from_other' ==> (\\ mailop = active_cmd_p (do_mom (xc::get_contents_of_envelope mailop, me))) ] also fun inactive_cmd_p (me as (state, drawf)) = do_one_mailop [ take_from_mailslot' plea_slot ==> (\\ mailop = { state' = do_plea (mailop, state); # if (state == state') # inactive_cmd_p me; else drawf state'; # if (bb::get_button_active_flag state') # active_cmd_p (state', drawf); else put_in_mailslot (event_slot, tt::TOGGLE_SET (bb::get_state state')); # inactive_cmd_p (state', drawf); fi; fi; }), receive_mouse' ==> \\ bb::mouse::FOCUS has_mouse_focus => inactive_cmd_p ({ button_state => state.button_state, has_mouse_focus, mousebutton_is_down => state.mousebutton_is_down }, drawf); _ => inactive_cmd_p me; end, from_other' ==> (\\ mailop = inactive_cmd_p (do_mom (xc::get_contents_of_envelope mailop, me))) ]; make_thread "toggle_control from_mouse" {. # bb::mse_p (from_mouse', mouse_slot); }; if (bb::get_button_active_flag state) active_cmd_p (state, drawf); else inactive_cmd_p (state, drawf); fi; }; fun init (dictionary as (plea_slot, event_slot, bv)) state = loop state where fun loop state = case (take_from_mailslot plea_slot) # bb::GET_BUTTON_ACTIVE_FLAG reply_1shot => { put_in_oneshot (reply_1shot, bb::get_button_active_flag state); loop state; }; bb::GET_STATE reply_1shot => { put_in_oneshot (reply_1shot, bb::get_state state); loop state; }; bb::GET_SIZE_CONSTRAINT reply_1shot => { put_in_oneshot (reply_1shot, button_look::bounds bv); loop state; }; bb::GET_ARGS reply_1shot => { put_in_oneshot (reply_1shot, button_look::window_args bv); loop state; }; bb::SET_BUTTON_ACTIVE_FLAG arg => loop (bb::set_button_active_flag (arg, state)); bb::SET_STATE arg => loop (bb::set_state (arg, state)); bb::DO_REALIZE arg => realize arg (state, dictionary); esac; end; fun make_toggleswitchxxx (root_window, view, args) = { attributes = wg::find_attribute (wg::attributes (view, attributes, args)); plea_slot = make_mailslot (); event_slot = make_mailslot (); button_state = bb::make_button_state ( wa::get_bool (attributes wa::is_active), wa::get_bool (attributes wa::is_set ) ); bv = button_look::make_button_look (root_window, view, args); fun getval msg () = { reply_1shot = make_oneshot_maildrop (); # put_in_mailslot (plea_slot, msg reply_1shot); get_from_oneshot reply_1shot; }; make_thread "toggle_control" {. # init (plea_slot, event_slot, bv) { button_state, has_mouse_focus => FALSE, mousebutton_is_down => FALSE }; }; tt::TOGGLE { plea_slot, # mailop => take_from_mailslot' event_slot, widget => wg::make_widget { root_window, args => getval bb::GET_ARGS, size_preference_thunk_of => getval bb::GET_SIZE_CONSTRAINT, realize_widget => \\ arg = put_in_mailslot (plea_slot, bb::DO_REALIZE arg) } }; }; fun make_toggleswitch_with_click_callback (root_window, view, args) click_callback = { (make_toggleswitchxxx (root_window, view, args)) -> tt::TOGGLE { widget, plea_slot, mailop }; fun listener () = listener case (block_until_mailop_fires mailop) # tt::TOGGLE_SET b => click_callback b; _ => (); esac; make_thread "toggle_control command" listener; tt::TOGGLE { widget, # plea_slot, # mailop => get_from_oneshot' (make_oneshot_maildrop ()) }; }; }; # generic package toggle_control_g end; ## COPYRIGHT (c) 1991, 1994 by AT&T Bell Laboratories. See SMLNJ-COPYRIGHT file for details. ## Subsequent changes by Jeff Prothero Copyright (c) 2010-2015, ## released per terms of SMLNJ-COPYRIGHT.
{ "pile_set_name": "Github" }
<?xml version="1.0" encoding="UTF-8"?> <resources xmlns:android="http://schemas.android.com/apk/res/android" xmlns:xliff="urn:oasis:names:tc:xliff:document:1.2"> <string name="recovery_installing" msgid="2013591905463558223">"સિસ્ટમ અપડેટ ઇન્સ્ટૉલ કરી રહ્યાં છે"</string> <string name="recovery_erasing" msgid="7334826894904037088">"કાઢી નાખી રહ્યું છે"</string> <string name="recovery_no_command" msgid="4465476568623024327">"કોઈ આદેશ નથી"</string> <string name="recovery_error" msgid="5748178989622716736">"ભૂલ!"</string> <string name="recovery_installing_security" msgid="9184031299717114342">"સુરક્ષા અપડેટ ઇન્સ્ટૉલ કરી રહ્યાં છે"</string> </resources>
{ "pile_set_name": "Github" }
#ifndef _SYS_MSG_H #define _SYS_MSG_H #ifdef __cplusplus extern "C" { #endif #include <sys/ipc.h> #define __NEED_pid_t #define __NEED_key_t #define __NEED_time_t #define __NEED_size_t #define __NEED_ssize_t #include <bits/alltypes.h> typedef unsigned long msgqnum_t; typedef unsigned long msglen_t; #include <bits/msg.h> #define __msg_cbytes msg_cbytes #define MSG_NOERROR 010000 #define MSG_EXCEPT 020000 #define MSG_STAT 11 #define MSG_INFO 12 struct msginfo { int msgpool, msgmap, msgmax, msgmnb, msgmni, msgssz, msgtql; unsigned short msgseg; }; int msgctl (int, int, struct msqid_ds *); int msgget (key_t, int); ssize_t msgrcv (int, void *, size_t, long, int); int msgsnd (int, const void *, size_t, int); #if defined(_GNU_SOURCE) || defined(_BSD_SOURCE) struct msgbuf { long mtype; char mtext[1]; }; #endif #ifdef __cplusplus } #endif #endif
{ "pile_set_name": "Github" }
<?xml version="1.0" encoding="UTF-8"?> <!-- Copyright 2014 The Android Open Source Project 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. --> <manifest xmlns:android="http://schemas.android.com/apk/res/android" package="com.example.android.documentcentricapps" android:versionCode="1" android:versionName="1.0"> <application android:allowBackup="true" android:label="@string/app_name" android:icon="@drawable/ic_launcher" android:theme="@style/AppTheme"> <activity android:name="com.example.android.documentcentricapps.DocumentCentricActivity" android:label="@string/app_name" android:persistableMode="persistAcrossReboots"> <intent-filter> <action android:name="android.intent.action.MAIN" /> <category android:name="android.intent.category.LAUNCHER" /> </intent-filter> </activity> <activity android:name="com.example.android.documentcentricapps.NewDocumentActivity" android:label="@string/activity_new_document_title" > </activity> </application> </manifest>
{ "pile_set_name": "Github" }