text
stringlengths
2
99.9k
meta
dict
/* * 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.lucene.collation; import org.apache.lucene.document.Field; import org.apache.lucene.document.SortedDocValuesField; import org.apache.lucene.util.BytesRef; import com.ibm.icu.text.Collator; import com.ibm.icu.text.RawCollationKey; /** * Indexes collation keys as a single-valued {@link SortedDocValuesField}. * <p> * This is more efficient that {@link ICUCollationKeyAnalyzer} if the field * only has one value: no uninversion is necessary to sort on the field, * locale-sensitive range queries can still work via {@code DocValuesRangeQuery}, * and the underlying data structures built at index-time are likely more efficient * and use less memory than FieldCache. */ public final class ICUCollationDocValuesField extends Field { private final String name; private final Collator collator; private final BytesRef bytes = new BytesRef(); private final RawCollationKey key = new RawCollationKey(); /** * Create a new ICUCollationDocValuesField. * <p> * NOTE: you should not create a new one for each document, instead * just make one and reuse it during your indexing process, setting * the value via {@link #setStringValue(String)}. * @param name field name * @param collator Collator for generating collation keys. */ // TODO: can we make this trap-free? maybe just synchronize on the collator // instead? public ICUCollationDocValuesField(String name, Collator collator) { super(name, SortedDocValuesField.TYPE); this.name = name; try { this.collator = (Collator) collator.clone(); } catch (CloneNotSupportedException e) { throw new RuntimeException(e); } fieldsData = bytes; // so wrong setters cannot be called } @Override public String name() { return name; } @Override public void setStringValue(String value) { collator.getRawCollationKey(value, key); bytes.bytes = key.bytes; bytes.offset = 0; bytes.length = key.size; } }
{ "pile_set_name": "Github" }
/* Any copyright is dedicated to the Public Domain. http://creativecommons.org/publicdomain/zero/1.0/ */ Cu.import("resource://services-sync/constants.js"); Cu.import("resource://services-sync/engines/passwords.js"); Cu.import("resource://services-sync/engines.js"); Cu.import("resource://services-sync/service.js"); Cu.import("resource://services-sync/util.js"); Service.engineManager.register(PasswordEngine); let engine = Service.engineManager.get("passwords"); let store = engine._store; let tracker = engine._tracker; // Don't do asynchronous writes. tracker.persistChangedIDs = false; function run_test() { initTestLogging("Trace"); run_next_test(); } add_test(function test_tracking() { let recordNum = 0; _("Verify we've got an empty tracker to work with."); do_check_empty(tracker.changedIDs); function createPassword() { _("RECORD NUM: " + recordNum); let record = {id: "GUID" + recordNum, hostname: "http://foo.bar.com", formSubmitURL: "http://foo.bar.com/baz", username: "john" + recordNum, password: "smith", usernameField: "username", passwordField: "password"}; recordNum++; let login = store._nsLoginInfoFromRecord(record); Services.logins.addLogin(login); } try { _("Create a password record. Won't show because we haven't started tracking yet"); createPassword(); do_check_empty(tracker.changedIDs); do_check_eq(tracker.score, 0); _("Tell the tracker to start tracking changes."); Svc.Obs.notify("weave:engine:start-tracking"); createPassword(); do_check_attribute_count(tracker.changedIDs, 1); do_check_eq(tracker.score, SCORE_INCREMENT_XLARGE); _("Notifying twice won't do any harm."); Svc.Obs.notify("weave:engine:start-tracking"); createPassword(); do_check_attribute_count(tracker.changedIDs, 2); do_check_eq(tracker.score, SCORE_INCREMENT_XLARGE * 2); _("Let's stop tracking again."); tracker.clearChangedIDs(); tracker.resetScore(); Svc.Obs.notify("weave:engine:stop-tracking"); createPassword(); do_check_empty(tracker.changedIDs); do_check_eq(tracker.score, 0); _("Notifying twice won't do any harm."); Svc.Obs.notify("weave:engine:stop-tracking"); createPassword(); do_check_empty(tracker.changedIDs); do_check_eq(tracker.score, 0); } finally { _("Clean up."); store.wipe(); tracker.clearChangedIDs(); tracker.resetScore(); Svc.Obs.notify("weave:engine:stop-tracking"); run_next_test(); } }); add_test(function test_onWipe() { _("Verify we've got an empty tracker to work with."); do_check_empty(tracker.changedIDs); do_check_eq(tracker.score, 0); try { _("A store wipe should increment the score"); Svc.Obs.notify("weave:engine:start-tracking"); store.wipe(); do_check_eq(tracker.score, SCORE_INCREMENT_XLARGE); } finally { tracker.resetScore(); Svc.Obs.notify("weave:engine:stop-tracking"); run_next_test(); } });
{ "pile_set_name": "Github" }
/* * UHCI HCD (Host Controller Driver) for GRLIB GRUSBHC * * Copyright (c) 2011 Jan Andersson <[email protected]> * * This file is based on UHCI PCI HCD: * (C) Copyright 1999 Linus Torvalds * (C) Copyright 1999-2002 Johannes Erdfelt, [email protected] * (C) Copyright 1999 Randy Dunlap * (C) Copyright 1999 Georg Acher, [email protected] * (C) Copyright 1999 Deti Fliegl, [email protected] * (C) Copyright 1999 Thomas Sailer, [email protected] * (C) Copyright 1999 Roman Weissgaerber, [email protected] * (C) Copyright 2000 Yggdrasil Computing, Inc. (port of new PCI interface * support from usb-ohci.c by Adam Richter, [email protected]). * (C) Copyright 1999 Gregory P. Smith (from usb-ohci.c) * (C) Copyright 2004-2007 Alan Stern, [email protected] */ #include <linux/of_irq.h> #include <linux/of_address.h> #include <linux/of_platform.h> static int uhci_grlib_init(struct usb_hcd *hcd) { struct uhci_hcd *uhci = hcd_to_uhci(hcd); /* * Probe to determine the endianness of the controller. * We know that bit 7 of the PORTSC1 register is always set * and bit 15 is always clear. If uhci_readw() yields a value * with bit 7 (0x80) turned on then the current little-endian * setting is correct. Otherwise we assume the value was * byte-swapped; hence the register interface and presumably * also the descriptors are big-endian. */ if (!(uhci_readw(uhci, USBPORTSC1) & 0x80)) { uhci->big_endian_mmio = 1; uhci->big_endian_desc = 1; } uhci->rh_numports = uhci_count_ports(hcd); /* Set up pointers to to generic functions */ uhci->reset_hc = uhci_generic_reset_hc; uhci->check_and_reset_hc = uhci_generic_check_and_reset_hc; /* No special actions need to be taken for the functions below */ uhci->configure_hc = NULL; uhci->resume_detect_interrupts_are_broken = NULL; uhci->global_suspend_mode_is_broken = NULL; /* Reset if the controller isn't already safely quiescent. */ check_and_reset_hc(uhci); return 0; } static const struct hc_driver uhci_grlib_hc_driver = { .description = hcd_name, .product_desc = "GRLIB GRUSBHC UHCI Host Controller", .hcd_priv_size = sizeof(struct uhci_hcd), /* Generic hardware linkage */ .irq = uhci_irq, .flags = HCD_MEMORY | HCD_USB11, /* Basic lifecycle operations */ .reset = uhci_grlib_init, .start = uhci_start, #ifdef CONFIG_PM .pci_suspend = NULL, .pci_resume = NULL, .bus_suspend = uhci_rh_suspend, .bus_resume = uhci_rh_resume, #endif .stop = uhci_stop, .urb_enqueue = uhci_urb_enqueue, .urb_dequeue = uhci_urb_dequeue, .endpoint_disable = uhci_hcd_endpoint_disable, .get_frame_number = uhci_hcd_get_frame_number, .hub_status_data = uhci_hub_status_data, .hub_control = uhci_hub_control, }; static int __devinit uhci_hcd_grlib_probe(struct platform_device *op) { struct device_node *dn = op->dev.of_node; struct usb_hcd *hcd; struct uhci_hcd *uhci = NULL; struct resource res; int irq; int rv; if (usb_disabled()) return -ENODEV; dev_dbg(&op->dev, "initializing GRUSBHC UHCI USB Controller\n"); rv = of_address_to_resource(dn, 0, &res); if (rv) return rv; /* usb_create_hcd requires dma_mask != NULL */ op->dev.dma_mask = &op->dev.coherent_dma_mask; hcd = usb_create_hcd(&uhci_grlib_hc_driver, &op->dev, "GRUSBHC UHCI USB"); if (!hcd) return -ENOMEM; hcd->rsrc_start = res.start; hcd->rsrc_len = resource_size(&res); if (!request_mem_region(hcd->rsrc_start, hcd->rsrc_len, hcd_name)) { printk(KERN_ERR "%s: request_mem_region failed\n", __FILE__); rv = -EBUSY; goto err_rmr; } irq = irq_of_parse_and_map(dn, 0); if (irq == NO_IRQ) { printk(KERN_ERR "%s: irq_of_parse_and_map failed\n", __FILE__); rv = -EBUSY; goto err_irq; } hcd->regs = ioremap(hcd->rsrc_start, hcd->rsrc_len); if (!hcd->regs) { printk(KERN_ERR "%s: ioremap failed\n", __FILE__); rv = -ENOMEM; goto err_ioremap; } uhci = hcd_to_uhci(hcd); uhci->regs = hcd->regs; rv = usb_add_hcd(hcd, irq, 0); if (rv) goto err_uhci; return 0; err_uhci: iounmap(hcd->regs); err_ioremap: irq_dispose_mapping(irq); err_irq: release_mem_region(hcd->rsrc_start, hcd->rsrc_len); err_rmr: usb_put_hcd(hcd); return rv; } static int uhci_hcd_grlib_remove(struct platform_device *op) { struct usb_hcd *hcd = dev_get_drvdata(&op->dev); dev_set_drvdata(&op->dev, NULL); dev_dbg(&op->dev, "stopping GRLIB GRUSBHC UHCI USB Controller\n"); usb_remove_hcd(hcd); iounmap(hcd->regs); irq_dispose_mapping(hcd->irq); release_mem_region(hcd->rsrc_start, hcd->rsrc_len); usb_put_hcd(hcd); return 0; } /* Make sure the controller is quiescent and that we're not using it * any more. This is mainly for the benefit of programs which, like kexec, * expect the hardware to be idle: not doing DMA or generating IRQs. * * This routine may be called in a damaged or failing kernel. Hence we * do not acquire the spinlock before shutting down the controller. */ static void uhci_hcd_grlib_shutdown(struct platform_device *op) { struct usb_hcd *hcd = dev_get_drvdata(&op->dev); uhci_hc_died(hcd_to_uhci(hcd)); } static const struct of_device_id uhci_hcd_grlib_of_match[] = { { .name = "GAISLER_UHCI", }, { .name = "01_027", }, {}, }; MODULE_DEVICE_TABLE(of, uhci_hcd_grlib_of_match); static struct platform_driver uhci_grlib_driver = { .probe = uhci_hcd_grlib_probe, .remove = uhci_hcd_grlib_remove, .shutdown = uhci_hcd_grlib_shutdown, .driver = { .name = "grlib-uhci", .owner = THIS_MODULE, .of_match_table = uhci_hcd_grlib_of_match, }, };
{ "pile_set_name": "Github" }
<?php /** * @copyright Copyright (C) 2015 AIZAWA Hina * @license https://github.com/fetus-hina/stat.ink/blob/master/LICENSE MIT * @author AIZAWA Hina <[email protected]> */ namespace app\actions\site; use DirectoryIterator; use Yii; use cebe\markdown\GithubMarkdown as Markdown; use yii\helpers\Html; class LicenseAction extends SimpleAction { public $view = 'license'; private $mdParser; public function init() { $this->mdParser = new Markdown(); $this->mdParser->html5 = true; return parent::init(); } public function run() { $this->params['myself'] = (object)[ 'name' => Yii::$app->name, 'html' => $this->loadPlain(Yii::getAlias('@app/LICENSE')), ]; $this->params['depends'] = $this->loadDepends(); return parent::run(); } private function loadDepends() { $ret = []; $it = new DirectoryIterator(Yii::getAlias('@app/data/licenses')); foreach ($it as $entry) { if ($entry->isDot() || !$entry->isFile()) { continue; } $basename = $entry->getBasename(); if (strtolower(substr($basename, -3)) === '.md') { $ret[] = (object)[ 'name' => substr($basename, 0, strlen($basename) - 3), 'html' => $this->loadMarkdown($entry->getPathname()), ]; } else { $ret[] = (object)[ 'name' => $basename, 'html' => $this->loadPlain($entry->getPathname()), ]; } } usort( $ret, function ($a, $b) { $aName = trim(preg_replace('/[^0-9A-Za-z]+/', ' ', $a->name)); $bName = trim(preg_replace('/[^0-9A-Za-z]+/', ' ', $b->name)); return strnatcasecmp($aName, $bName); } ); return $ret; } private function loadPlain($path) { return '<pre>' . Html::encode(file_get_contents($path, false)) . '</pre>'; } private function loadMarkdown($path) { return $this->mdParser->parse(file_get_contents($path, false)); } }
{ "pile_set_name": "Github" }
<!DOCTYPE HTML> <!-- NewPage --> <html lang="en"> <head> <!-- Generated by javadoc --> <title>HTMLDocument (Java SE 12 &amp; JDK 12 )</title> <meta http-equiv="Content-Type" content="text/html; charset=UTF-8"> <meta name="keywords" content="org.w3c.dom.html.HTMLDocument interface"> <meta name="keywords" content="getTitle()"> <meta name="keywords" content="setTitle()"> <meta name="keywords" content="getReferrer()"> <meta name="keywords" content="getDomain()"> <meta name="keywords" content="getURL()"> <meta name="keywords" content="getBody()"> <meta name="keywords" content="setBody()"> <meta name="keywords" content="getImages()"> <meta name="keywords" content="getApplets()"> <meta name="keywords" content="getLinks()"> <meta name="keywords" content="getForms()"> <meta name="keywords" content="getAnchors()"> <meta name="keywords" content="getCookie()"> <meta name="keywords" content="setCookie()"> <meta name="keywords" content="open()"> <meta name="keywords" content="close()"> <meta name="keywords" content="write()"> <meta name="keywords" content="writeln()"> <meta name="keywords" content="getElementsByName()"> <link rel="stylesheet" type="text/css" href="../../../../../stylesheet.css" title="Style"> <link rel="stylesheet" type="text/css" href="../../../../../jquery/jquery-ui.css" title="Style"> <script type="text/javascript" src="../../../../../script.js"></script> <script type="text/javascript" src="../../../../../jquery/jszip/dist/jszip.min.js"></script> <script type="text/javascript" src="../../../../../jquery/jszip-utils/dist/jszip-utils.min.js"></script> <!--[if IE]> <script type="text/javascript" src="../../../../../jquery/jszip-utils/dist/jszip-utils-ie.min.js"></script> <![endif]--> <script type="text/javascript" src="../../../../../jquery/jquery-3.3.1.js"></script> <script type="text/javascript" src="../../../../../jquery/jquery-migrate-3.0.1.js"></script> <script type="text/javascript" src="../../../../../jquery/jquery-ui.js"></script> </head> <body> <script type="text/javascript"><!-- try { if (location.href.indexOf('is-external=true') == -1) { parent.document.title="HTMLDocument (Java SE 12 & JDK 12 )"; } } catch(err) { } //--> var data = {"i0":6,"i1":6,"i2":6,"i3":6,"i4":6,"i5":6,"i6":6,"i7":6,"i8":6,"i9":6,"i10":6,"i11":6,"i12":6,"i13":6,"i14":6,"i15":6,"i16":6,"i17":6,"i18":6}; var tabs = {65535:["t0","All Methods"],2:["t2","Instance Methods"],4:["t3","Abstract Methods"]}; var altColor = "altColor"; var rowColor = "rowColor"; var tableTab = "tableTab"; var activeTableTab = "activeTableTab"; var pathtoroot = "../../../../../"; var useModuleDirectories = true; loadScripts(document, 'script');</script> <noscript> <div>JavaScript is disabled on your browser.</div> </noscript> <header role="banner"> <nav role="navigation"> <div class="fixedNav"> <!-- ========= START OF TOP NAVBAR ======= --> <div class="topNav"><a id="navbar.top"> <!-- --> </a> <div class="skipNav"><a href="#skip.navbar.top" title="Skip navigation links">Skip navigation links</a></div> <a id="navbar.top.firstrow"> <!-- --> </a> <ul class="navList" title="Navigation"> <li><a href="../../../../../index.html">Overview</a></li> <li><a href="../../../../module-summary.html">Module</a></li> <li><a href="package-summary.html">Package</a></li> <li class="navBarCell1Rev">Class</li> <li><a href="class-use/HTMLDocument.html">Use</a></li> <li><a href="package-tree.html">Tree</a></li> <li><a href="../../../../../deprecated-list.html">Deprecated</a></li> <li><a href="../../../../../index-files/index-1.html">Index</a></li> <li><a href="../../../../../help-doc.html">Help</a></li> </ul> <div class="aboutLanguage"><div style="margin-top: 14px;"><strong>Java SE 12 &amp; JDK 12</strong> </div></div> </div> <div class="subNav"> <div> <ul class="subNavList"> <li>Summary:&nbsp;</li> <li>Nested&nbsp;|&nbsp;</li> <li><a href="#field.summary">Field</a>&nbsp;|&nbsp;</li> <li>Constr&nbsp;|&nbsp;</li> <li><a href="#method.summary">Method</a></li> </ul> <ul class="subNavList"> <li>Detail:&nbsp;</li> <li>Field&nbsp;|&nbsp;</li> <li>Constr&nbsp;|&nbsp;</li> <li><a href="#method.detail">Method</a></li> </ul> </div> <ul class="navListSearch"> <li><label for="search">SEARCH:</label> <input type="text" id="search" value="search" disabled="disabled"> <input type="reset" id="reset" value="reset" disabled="disabled"> </li> </ul> </div> <a id="skip.navbar.top"> <!-- --> </a> <!-- ========= END OF TOP NAVBAR ========= --> </div> <div class="navPadding">&nbsp;</div> <script type="text/javascript"><!-- $('.navPadding').css('padding-top', $('.fixedNav').css("height")); //--> </script> </nav> </header> <!-- ======== START OF CLASS DATA ======== --> <main role="main"> <div class="header"> <div class="subTitle"><span class="moduleLabelInType">Module</span>&nbsp;<a href="../../../../module-summary.html">jdk.xml.dom</a></div> <div class="subTitle"><span class="packageLabelInType">Package</span>&nbsp;<a href="package-summary.html">org.w3c.dom.html</a></div> <h2 title="Interface HTMLDocument" class="title">Interface HTMLDocument</h2> </div> <div class="contentContainer"> <div class="description"> <ul class="blockList"> <li class="blockList"> <dl> <dt>All Superinterfaces:</dt> <dd><code><a href="../../../../../java.xml/org/w3c/dom/Document.html" title="interface in org.w3c.dom">Document</a></code>, <code><a href="../../../../../java.xml/org/w3c/dom/Node.html" title="interface in org.w3c.dom">Node</a></code></dd> </dl> <hr> <pre>public interface <span class="typeNameLabel">HTMLDocument</span> extends <a href="../../../../../java.xml/org/w3c/dom/Document.html" title="interface in org.w3c.dom">Document</a></pre> <div class="block">An <code>HTMLDocument</code> is the root of the HTML hierarchy and holds the entire content. Besides providing access to the hierarchy, it also provides some convenience methods for accessing certain sets of information from the document. <p> The following properties have been deprecated in favor of the corresponding ones for the <code>BODY</code> element: alinkColor background bgColor fgColor linkColor vlinkColor In DOM Level 2, the method <code>getElementById</code> is inherited from the <code>Document</code> interface where it was moved. <p>See also the <a href='http://www.w3.org/TR/2000/CR-DOM-Level-2-20000510'>Document Object Model (DOM) Level 2 Specification</a>.</div> <dl> <dt><span class="simpleTagLabel">Since:</span></dt> <dd>1.4, DOM Level 2</dd> </dl> </li> </ul> </div> <div class="summary"> <ul class="blockList"> <li class="blockList"> <!-- =========== FIELD SUMMARY =========== --> <section role="region"> <ul class="blockList"> <li class="blockList"><a id="field.summary"> <!-- --> </a> <h3>Field Summary</h3> <ul class="blockList"> <li class="blockList"><a id="fields.inherited.from.class.org.w3c.dom.Node"> <!-- --> </a> <h3>Fields declared in interface&nbsp;org.w3c.dom.<a href="../../../../../java.xml/org/w3c/dom/Node.html" title="interface in org.w3c.dom">Node</a></h3> <code><a href="../../../../../java.xml/org/w3c/dom/Node.html#ATTRIBUTE_NODE">ATTRIBUTE_NODE</a>, <a href="../../../../../java.xml/org/w3c/dom/Node.html#CDATA_SECTION_NODE">CDATA_SECTION_NODE</a>, <a href="../../../../../java.xml/org/w3c/dom/Node.html#COMMENT_NODE">COMMENT_NODE</a>, <a href="../../../../../java.xml/org/w3c/dom/Node.html#DOCUMENT_FRAGMENT_NODE">DOCUMENT_FRAGMENT_NODE</a>, <a href="../../../../../java.xml/org/w3c/dom/Node.html#DOCUMENT_NODE">DOCUMENT_NODE</a>, <a href="../../../../../java.xml/org/w3c/dom/Node.html#DOCUMENT_POSITION_CONTAINED_BY">DOCUMENT_POSITION_CONTAINED_BY</a>, <a href="../../../../../java.xml/org/w3c/dom/Node.html#DOCUMENT_POSITION_CONTAINS">DOCUMENT_POSITION_CONTAINS</a>, <a href="../../../../../java.xml/org/w3c/dom/Node.html#DOCUMENT_POSITION_DISCONNECTED">DOCUMENT_POSITION_DISCONNECTED</a>, <a href="../../../../../java.xml/org/w3c/dom/Node.html#DOCUMENT_POSITION_FOLLOWING">DOCUMENT_POSITION_FOLLOWING</a>, <a href="../../../../../java.xml/org/w3c/dom/Node.html#DOCUMENT_POSITION_IMPLEMENTATION_SPECIFIC">DOCUMENT_POSITION_IMPLEMENTATION_SPECIFIC</a>, <a href="../../../../../java.xml/org/w3c/dom/Node.html#DOCUMENT_POSITION_PRECEDING">DOCUMENT_POSITION_PRECEDING</a>, <a href="../../../../../java.xml/org/w3c/dom/Node.html#DOCUMENT_TYPE_NODE">DOCUMENT_TYPE_NODE</a>, <a href="../../../../../java.xml/org/w3c/dom/Node.html#ELEMENT_NODE">ELEMENT_NODE</a>, <a href="../../../../../java.xml/org/w3c/dom/Node.html#ENTITY_NODE">ENTITY_NODE</a>, <a href="../../../../../java.xml/org/w3c/dom/Node.html#ENTITY_REFERENCE_NODE">ENTITY_REFERENCE_NODE</a>, <a href="../../../../../java.xml/org/w3c/dom/Node.html#NOTATION_NODE">NOTATION_NODE</a>, <a href="../../../../../java.xml/org/w3c/dom/Node.html#PROCESSING_INSTRUCTION_NODE">PROCESSING_INSTRUCTION_NODE</a>, <a href="../../../../../java.xml/org/w3c/dom/Node.html#TEXT_NODE">TEXT_NODE</a></code></li> </ul> </li> </ul> </section> <!-- ========== METHOD SUMMARY =========== --> <section role="region"> <ul class="blockList"> <li class="blockList"><a id="method.summary"> <!-- --> </a> <h3>Method Summary</h3> <div class="memberSummary"> <div role="tablist" aria-orientation="horizontal"><button role="tab" aria-selected="true" aria-controls="memberSummary_tabpanel" tabindex="0" onkeydown="switchTab(event)" id="t0" class="activeTableTab">All Methods</button><button role="tab" aria-selected="false" aria-controls="memberSummary_tabpanel" tabindex="-1" onkeydown="switchTab(event)" id="t2" class="tableTab" onclick="show(2);">Instance Methods</button><button role="tab" aria-selected="false" aria-controls="memberSummary_tabpanel" tabindex="-1" onkeydown="switchTab(event)" id="t3" class="tableTab" onclick="show(4);">Abstract Methods</button></div> <div id="memberSummary_tabpanel" role="tabpanel"> <table aria-labelledby="t0"> <tr> <th class="colFirst" scope="col">Modifier and Type</th> <th class="colSecond" scope="col">Method</th> <th class="colLast" scope="col">Description</th> </tr> <tbody> <tr class="altColor" id="i0"> <td class="colFirst"><code>void</code></td> <th class="colSecond" scope="row"><code><span class="memberNameLink"><a href="#close()">close</a></span>()</code></th> <td class="colLast"> <div class="block">Closes a document stream opened by <code>open()</code> and forces rendering.</div> </td> </tr> <tr class="rowColor" id="i1"> <td class="colFirst"><code><a href="HTMLCollection.html" title="interface in org.w3c.dom.html">HTMLCollection</a></code></td> <th class="colSecond" scope="row"><code><span class="memberNameLink"><a href="#getAnchors()">getAnchors</a></span>()</code></th> <td class="colLast"> <div class="block">A collection of all the anchor (<code>A</code> ) elements in a document with a value for the <code>name</code> attribute.</div> </td> </tr> <tr class="altColor" id="i2"> <td class="colFirst"><code><a href="HTMLCollection.html" title="interface in org.w3c.dom.html">HTMLCollection</a></code></td> <th class="colSecond" scope="row"><code><span class="memberNameLink"><a href="#getApplets()">getApplets</a></span>()</code></th> <td class="colLast"> <div class="block">A collection of all the <code>OBJECT</code> elements that include applets and <code>APPLET</code> ( deprecated ) elements in a document.</div> </td> </tr> <tr class="rowColor" id="i3"> <td class="colFirst"><code><a href="HTMLElement.html" title="interface in org.w3c.dom.html">HTMLElement</a></code></td> <th class="colSecond" scope="row"><code><span class="memberNameLink"><a href="#getBody()">getBody</a></span>()</code></th> <td class="colLast"> <div class="block">The element that contains the content for the document.</div> </td> </tr> <tr class="altColor" id="i4"> <td class="colFirst"><code><a href="../../../../../java.base/java/lang/String.html" title="class in java.lang">String</a></code></td> <th class="colSecond" scope="row"><code><span class="memberNameLink"><a href="#getCookie()">getCookie</a></span>()</code></th> <td class="colLast"> <div class="block">The cookies associated with this document.</div> </td> </tr> <tr class="rowColor" id="i5"> <td class="colFirst"><code><a href="../../../../../java.base/java/lang/String.html" title="class in java.lang">String</a></code></td> <th class="colSecond" scope="row"><code><span class="memberNameLink"><a href="#getDomain()">getDomain</a></span>()</code></th> <td class="colLast"> <div class="block">The domain name of the server that served the document, or <code>null</code> if the server cannot be identified by a domain name.</div> </td> </tr> <tr class="altColor" id="i6"> <td class="colFirst"><code><a href="../../../../../java.xml/org/w3c/dom/NodeList.html" title="interface in org.w3c.dom">NodeList</a></code></td> <th class="colSecond" scope="row"><code><span class="memberNameLink"><a href="#getElementsByName(java.lang.String)">getElementsByName</a></span>&#8203;(<a href="../../../../../java.base/java/lang/String.html" title="class in java.lang">String</a>&nbsp;elementName)</code></th> <td class="colLast"> <div class="block">Returns the (possibly empty) collection of elements whose <code>name</code> value is given by <code>elementName</code> .</div> </td> </tr> <tr class="rowColor" id="i7"> <td class="colFirst"><code><a href="HTMLCollection.html" title="interface in org.w3c.dom.html">HTMLCollection</a></code></td> <th class="colSecond" scope="row"><code><span class="memberNameLink"><a href="#getForms()">getForms</a></span>()</code></th> <td class="colLast"> <div class="block">A collection of all the forms of a document.</div> </td> </tr> <tr class="altColor" id="i8"> <td class="colFirst"><code><a href="HTMLCollection.html" title="interface in org.w3c.dom.html">HTMLCollection</a></code></td> <th class="colSecond" scope="row"><code><span class="memberNameLink"><a href="#getImages()">getImages</a></span>()</code></th> <td class="colLast"> <div class="block">A collection of all the <code>IMG</code> elements in a document.</div> </td> </tr> <tr class="rowColor" id="i9"> <td class="colFirst"><code><a href="HTMLCollection.html" title="interface in org.w3c.dom.html">HTMLCollection</a></code></td> <th class="colSecond" scope="row"><code><span class="memberNameLink"><a href="#getLinks()">getLinks</a></span>()</code></th> <td class="colLast"> <div class="block">A collection of all <code>AREA</code> elements and anchor ( <code>A</code> ) elements in a document with a value for the <code>href</code> attribute.</div> </td> </tr> <tr class="altColor" id="i10"> <td class="colFirst"><code><a href="../../../../../java.base/java/lang/String.html" title="class in java.lang">String</a></code></td> <th class="colSecond" scope="row"><code><span class="memberNameLink"><a href="#getReferrer()">getReferrer</a></span>()</code></th> <td class="colLast"> <div class="block">Returns the URI of the page that linked to this page.</div> </td> </tr> <tr class="rowColor" id="i11"> <td class="colFirst"><code><a href="../../../../../java.base/java/lang/String.html" title="class in java.lang">String</a></code></td> <th class="colSecond" scope="row"><code><span class="memberNameLink"><a href="#getTitle()">getTitle</a></span>()</code></th> <td class="colLast"> <div class="block">The title of a document as specified by the <code>TITLE</code> element in the head of the document.</div> </td> </tr> <tr class="altColor" id="i12"> <td class="colFirst"><code><a href="../../../../../java.base/java/lang/String.html" title="class in java.lang">String</a></code></td> <th class="colSecond" scope="row"><code><span class="memberNameLink"><a href="#getURL()">getURL</a></span>()</code></th> <td class="colLast"> <div class="block">The complete URI of the document.</div> </td> </tr> <tr class="rowColor" id="i13"> <td class="colFirst"><code>void</code></td> <th class="colSecond" scope="row"><code><span class="memberNameLink"><a href="#open()">open</a></span>()</code></th> <td class="colLast"> <div class="block">Note.</div> </td> </tr> <tr class="altColor" id="i14"> <td class="colFirst"><code>void</code></td> <th class="colSecond" scope="row"><code><span class="memberNameLink"><a href="#setBody(org.w3c.dom.html.HTMLElement)">setBody</a></span>&#8203;(<a href="HTMLElement.html" title="interface in org.w3c.dom.html">HTMLElement</a>&nbsp;body)</code></th> <td class="colLast">&nbsp;</td> </tr> <tr class="rowColor" id="i15"> <td class="colFirst"><code>void</code></td> <th class="colSecond" scope="row"><code><span class="memberNameLink"><a href="#setCookie(java.lang.String)">setCookie</a></span>&#8203;(<a href="../../../../../java.base/java/lang/String.html" title="class in java.lang">String</a>&nbsp;cookie)</code></th> <td class="colLast">&nbsp;</td> </tr> <tr class="altColor" id="i16"> <td class="colFirst"><code>void</code></td> <th class="colSecond" scope="row"><code><span class="memberNameLink"><a href="#setTitle(java.lang.String)">setTitle</a></span>&#8203;(<a href="../../../../../java.base/java/lang/String.html" title="class in java.lang">String</a>&nbsp;title)</code></th> <td class="colLast">&nbsp;</td> </tr> <tr class="rowColor" id="i17"> <td class="colFirst"><code>void</code></td> <th class="colSecond" scope="row"><code><span class="memberNameLink"><a href="#write(java.lang.String)">write</a></span>&#8203;(<a href="../../../../../java.base/java/lang/String.html" title="class in java.lang">String</a>&nbsp;text)</code></th> <td class="colLast"> <div class="block">Write a string of text to a document stream opened by <code>open()</code> .</div> </td> </tr> <tr class="altColor" id="i18"> <td class="colFirst"><code>void</code></td> <th class="colSecond" scope="row"><code><span class="memberNameLink"><a href="#writeln(java.lang.String)">writeln</a></span>&#8203;(<a href="../../../../../java.base/java/lang/String.html" title="class in java.lang">String</a>&nbsp;text)</code></th> <td class="colLast"> <div class="block">Write a string of text followed by a newline character to a document stream opened by <code>open()</code> .</div> </td> </tr> </tbody> </table> </div> </div> <ul class="blockList"> <li class="blockList"><a id="methods.inherited.from.class.org.w3c.dom.Document"> <!-- --> </a> <h3>Methods declared in interface&nbsp;org.w3c.dom.<a href="../../../../../java.xml/org/w3c/dom/Document.html" title="interface in org.w3c.dom">Document</a></h3> <code><a href="../../../../../java.xml/org/w3c/dom/Document.html#adoptNode(org.w3c.dom.Node)">adoptNode</a>, <a href="../../../../../java.xml/org/w3c/dom/Document.html#createAttribute(java.lang.String)">createAttribute</a>, <a href="../../../../../java.xml/org/w3c/dom/Document.html#createAttributeNS(java.lang.String,java.lang.String)">createAttributeNS</a>, <a href="../../../../../java.xml/org/w3c/dom/Document.html#createCDATASection(java.lang.String)">createCDATASection</a>, <a href="../../../../../java.xml/org/w3c/dom/Document.html#createComment(java.lang.String)">createComment</a>, <a href="../../../../../java.xml/org/w3c/dom/Document.html#createDocumentFragment()">createDocumentFragment</a>, <a href="../../../../../java.xml/org/w3c/dom/Document.html#createElement(java.lang.String)">createElement</a>, <a href="../../../../../java.xml/org/w3c/dom/Document.html#createElementNS(java.lang.String,java.lang.String)">createElementNS</a>, <a href="../../../../../java.xml/org/w3c/dom/Document.html#createEntityReference(java.lang.String)">createEntityReference</a>, <a href="../../../../../java.xml/org/w3c/dom/Document.html#createProcessingInstruction(java.lang.String,java.lang.String)">createProcessingInstruction</a>, <a href="../../../../../java.xml/org/w3c/dom/Document.html#createTextNode(java.lang.String)">createTextNode</a>, <a href="../../../../../java.xml/org/w3c/dom/Document.html#getDoctype()">getDoctype</a>, <a href="../../../../../java.xml/org/w3c/dom/Document.html#getDocumentElement()">getDocumentElement</a>, <a href="../../../../../java.xml/org/w3c/dom/Document.html#getDocumentURI()">getDocumentURI</a>, <a href="../../../../../java.xml/org/w3c/dom/Document.html#getDomConfig()">getDomConfig</a>, <a href="../../../../../java.xml/org/w3c/dom/Document.html#getElementById(java.lang.String)">getElementById</a>, <a href="../../../../../java.xml/org/w3c/dom/Document.html#getElementsByTagName(java.lang.String)">getElementsByTagName</a>, <a href="../../../../../java.xml/org/w3c/dom/Document.html#getElementsByTagNameNS(java.lang.String,java.lang.String)">getElementsByTagNameNS</a>, <a href="../../../../../java.xml/org/w3c/dom/Document.html#getImplementation()">getImplementation</a>, <a href="../../../../../java.xml/org/w3c/dom/Document.html#getInputEncoding()">getInputEncoding</a>, <a href="../../../../../java.xml/org/w3c/dom/Document.html#getStrictErrorChecking()">getStrictErrorChecking</a>, <a href="../../../../../java.xml/org/w3c/dom/Document.html#getXmlEncoding()">getXmlEncoding</a>, <a href="../../../../../java.xml/org/w3c/dom/Document.html#getXmlStandalone()">getXmlStandalone</a>, <a href="../../../../../java.xml/org/w3c/dom/Document.html#getXmlVersion()">getXmlVersion</a>, <a href="../../../../../java.xml/org/w3c/dom/Document.html#importNode(org.w3c.dom.Node,boolean)">importNode</a>, <a href="../../../../../java.xml/org/w3c/dom/Document.html#normalizeDocument()">normalizeDocument</a>, <a href="../../../../../java.xml/org/w3c/dom/Document.html#renameNode(org.w3c.dom.Node,java.lang.String,java.lang.String)">renameNode</a>, <a href="../../../../../java.xml/org/w3c/dom/Document.html#setDocumentURI(java.lang.String)">setDocumentURI</a>, <a href="../../../../../java.xml/org/w3c/dom/Document.html#setStrictErrorChecking(boolean)">setStrictErrorChecking</a>, <a href="../../../../../java.xml/org/w3c/dom/Document.html#setXmlStandalone(boolean)">setXmlStandalone</a>, <a href="../../../../../java.xml/org/w3c/dom/Document.html#setXmlVersion(java.lang.String)">setXmlVersion</a></code></li> </ul> <ul class="blockList"> <li class="blockList"><a id="methods.inherited.from.class.org.w3c.dom.Node"> <!-- --> </a> <h3>Methods declared in interface&nbsp;org.w3c.dom.<a href="../../../../../java.xml/org/w3c/dom/Node.html" title="interface in org.w3c.dom">Node</a></h3> <code><a href="../../../../../java.xml/org/w3c/dom/Node.html#appendChild(org.w3c.dom.Node)">appendChild</a>, <a href="../../../../../java.xml/org/w3c/dom/Node.html#cloneNode(boolean)">cloneNode</a>, <a href="../../../../../java.xml/org/w3c/dom/Node.html#compareDocumentPosition(org.w3c.dom.Node)">compareDocumentPosition</a>, <a href="../../../../../java.xml/org/w3c/dom/Node.html#getAttributes()">getAttributes</a>, <a href="../../../../../java.xml/org/w3c/dom/Node.html#getBaseURI()">getBaseURI</a>, <a href="../../../../../java.xml/org/w3c/dom/Node.html#getChildNodes()">getChildNodes</a>, <a href="../../../../../java.xml/org/w3c/dom/Node.html#getFeature(java.lang.String,java.lang.String)">getFeature</a>, <a href="../../../../../java.xml/org/w3c/dom/Node.html#getFirstChild()">getFirstChild</a>, <a href="../../../../../java.xml/org/w3c/dom/Node.html#getLastChild()">getLastChild</a>, <a href="../../../../../java.xml/org/w3c/dom/Node.html#getLocalName()">getLocalName</a>, <a href="../../../../../java.xml/org/w3c/dom/Node.html#getNamespaceURI()">getNamespaceURI</a>, <a href="../../../../../java.xml/org/w3c/dom/Node.html#getNextSibling()">getNextSibling</a>, <a href="../../../../../java.xml/org/w3c/dom/Node.html#getNodeName()">getNodeName</a>, <a href="../../../../../java.xml/org/w3c/dom/Node.html#getNodeType()">getNodeType</a>, <a href="../../../../../java.xml/org/w3c/dom/Node.html#getNodeValue()">getNodeValue</a>, <a href="../../../../../java.xml/org/w3c/dom/Node.html#getOwnerDocument()">getOwnerDocument</a>, <a href="../../../../../java.xml/org/w3c/dom/Node.html#getParentNode()">getParentNode</a>, <a href="../../../../../java.xml/org/w3c/dom/Node.html#getPrefix()">getPrefix</a>, <a href="../../../../../java.xml/org/w3c/dom/Node.html#getPreviousSibling()">getPreviousSibling</a>, <a href="../../../../../java.xml/org/w3c/dom/Node.html#getTextContent()">getTextContent</a>, <a href="../../../../../java.xml/org/w3c/dom/Node.html#getUserData(java.lang.String)">getUserData</a>, <a href="../../../../../java.xml/org/w3c/dom/Node.html#hasAttributes()">hasAttributes</a>, <a href="../../../../../java.xml/org/w3c/dom/Node.html#hasChildNodes()">hasChildNodes</a>, <a href="../../../../../java.xml/org/w3c/dom/Node.html#insertBefore(org.w3c.dom.Node,org.w3c.dom.Node)">insertBefore</a>, <a href="../../../../../java.xml/org/w3c/dom/Node.html#isDefaultNamespace(java.lang.String)">isDefaultNamespace</a>, <a href="../../../../../java.xml/org/w3c/dom/Node.html#isEqualNode(org.w3c.dom.Node)">isEqualNode</a>, <a href="../../../../../java.xml/org/w3c/dom/Node.html#isSameNode(org.w3c.dom.Node)">isSameNode</a>, <a href="../../../../../java.xml/org/w3c/dom/Node.html#isSupported(java.lang.String,java.lang.String)">isSupported</a>, <a href="../../../../../java.xml/org/w3c/dom/Node.html#lookupNamespaceURI(java.lang.String)">lookupNamespaceURI</a>, <a href="../../../../../java.xml/org/w3c/dom/Node.html#lookupPrefix(java.lang.String)">lookupPrefix</a>, <a href="../../../../../java.xml/org/w3c/dom/Node.html#normalize()">normalize</a>, <a href="../../../../../java.xml/org/w3c/dom/Node.html#removeChild(org.w3c.dom.Node)">removeChild</a>, <a href="../../../../../java.xml/org/w3c/dom/Node.html#replaceChild(org.w3c.dom.Node,org.w3c.dom.Node)">replaceChild</a>, <a href="../../../../../java.xml/org/w3c/dom/Node.html#setNodeValue(java.lang.String)">setNodeValue</a>, <a href="../../../../../java.xml/org/w3c/dom/Node.html#setPrefix(java.lang.String)">setPrefix</a>, <a href="../../../../../java.xml/org/w3c/dom/Node.html#setTextContent(java.lang.String)">setTextContent</a>, <a href="../../../../../java.xml/org/w3c/dom/Node.html#setUserData(java.lang.String,java.lang.Object,org.w3c.dom.UserDataHandler)">setUserData</a></code></li> </ul> </li> </ul> </section> </li> </ul> </div> <div class="details"> <ul class="blockList"> <li class="blockList"> <!-- ============ METHOD DETAIL ========== --> <section role="region"> <ul class="blockList"> <li class="blockList"><a id="method.detail"> <!-- --> </a> <h3>Method Detail</h3> <a id="getTitle()"> <!-- --> </a> <ul class="blockList"> <li class="blockList"> <h4>getTitle</h4> <pre class="methodSignature"><a href="../../../../../java.base/java/lang/String.html" title="class in java.lang">String</a>&nbsp;getTitle()</pre> <div class="block">The title of a document as specified by the <code>TITLE</code> element in the head of the document.</div> </li> </ul> <a id="setTitle(java.lang.String)"> <!-- --> </a> <ul class="blockList"> <li class="blockList"> <h4>setTitle</h4> <pre class="methodSignature">void&nbsp;setTitle&#8203;(<a href="../../../../../java.base/java/lang/String.html" title="class in java.lang">String</a>&nbsp;title)</pre> </li> </ul> <a id="getReferrer()"> <!-- --> </a> <ul class="blockList"> <li class="blockList"> <h4>getReferrer</h4> <pre class="methodSignature"><a href="../../../../../java.base/java/lang/String.html" title="class in java.lang">String</a>&nbsp;getReferrer()</pre> <div class="block">Returns the URI of the page that linked to this page. The value is an empty string if the user navigated to the page directly (not through a link, but, for example, via a bookmark).</div> </li> </ul> <a id="getDomain()"> <!-- --> </a> <ul class="blockList"> <li class="blockList"> <h4>getDomain</h4> <pre class="methodSignature"><a href="../../../../../java.base/java/lang/String.html" title="class in java.lang">String</a>&nbsp;getDomain()</pre> <div class="block">The domain name of the server that served the document, or <code>null</code> if the server cannot be identified by a domain name.</div> </li> </ul> <a id="getURL()"> <!-- --> </a> <ul class="blockList"> <li class="blockList"> <h4>getURL</h4> <pre class="methodSignature"><a href="../../../../../java.base/java/lang/String.html" title="class in java.lang">String</a>&nbsp;getURL()</pre> <div class="block">The complete URI of the document.</div> </li> </ul> <a id="getBody()"> <!-- --> </a> <ul class="blockList"> <li class="blockList"> <h4>getBody</h4> <pre class="methodSignature"><a href="HTMLElement.html" title="interface in org.w3c.dom.html">HTMLElement</a>&nbsp;getBody()</pre> <div class="block">The element that contains the content for the document. In documents with <code>BODY</code> contents, returns the <code>BODY</code> element. In frameset documents, this returns the outermost <code>FRAMESET</code> element.</div> </li> </ul> <a id="setBody(org.w3c.dom.html.HTMLElement)"> <!-- --> </a> <ul class="blockList"> <li class="blockList"> <h4>setBody</h4> <pre class="methodSignature">void&nbsp;setBody&#8203;(<a href="HTMLElement.html" title="interface in org.w3c.dom.html">HTMLElement</a>&nbsp;body)</pre> </li> </ul> <a id="getImages()"> <!-- --> </a> <ul class="blockList"> <li class="blockList"> <h4>getImages</h4> <pre class="methodSignature"><a href="HTMLCollection.html" title="interface in org.w3c.dom.html">HTMLCollection</a>&nbsp;getImages()</pre> <div class="block">A collection of all the <code>IMG</code> elements in a document. The behavior is limited to <code>IMG</code> elements for backwards compatibility.</div> </li> </ul> <a id="getApplets()"> <!-- --> </a> <ul class="blockList"> <li class="blockList"> <h4>getApplets</h4> <pre class="methodSignature"><a href="HTMLCollection.html" title="interface in org.w3c.dom.html">HTMLCollection</a>&nbsp;getApplets()</pre> <div class="block">A collection of all the <code>OBJECT</code> elements that include applets and <code>APPLET</code> ( deprecated ) elements in a document.</div> </li> </ul> <a id="getLinks()"> <!-- --> </a> <ul class="blockList"> <li class="blockList"> <h4>getLinks</h4> <pre class="methodSignature"><a href="HTMLCollection.html" title="interface in org.w3c.dom.html">HTMLCollection</a>&nbsp;getLinks()</pre> <div class="block">A collection of all <code>AREA</code> elements and anchor ( <code>A</code> ) elements in a document with a value for the <code>href</code> attribute.</div> </li> </ul> <a id="getForms()"> <!-- --> </a> <ul class="blockList"> <li class="blockList"> <h4>getForms</h4> <pre class="methodSignature"><a href="HTMLCollection.html" title="interface in org.w3c.dom.html">HTMLCollection</a>&nbsp;getForms()</pre> <div class="block">A collection of all the forms of a document.</div> </li> </ul> <a id="getAnchors()"> <!-- --> </a> <ul class="blockList"> <li class="blockList"> <h4>getAnchors</h4> <pre class="methodSignature"><a href="HTMLCollection.html" title="interface in org.w3c.dom.html">HTMLCollection</a>&nbsp;getAnchors()</pre> <div class="block">A collection of all the anchor (<code>A</code> ) elements in a document with a value for the <code>name</code> attribute. Note. For reasons of backwards compatibility, the returned set of anchors only contains those anchors created with the <code>name</code> attribute, not those created with the <code>id</code> attribute.</div> </li> </ul> <a id="getCookie()"> <!-- --> </a> <ul class="blockList"> <li class="blockList"> <h4>getCookie</h4> <pre class="methodSignature"><a href="../../../../../java.base/java/lang/String.html" title="class in java.lang">String</a>&nbsp;getCookie()</pre> <div class="block">The cookies associated with this document. If there are none, the value is an empty string. Otherwise, the value is a string: a semicolon-delimited list of "name, value" pairs for all the cookies associated with the page. For example, <code>name=value;expires=date</code> .</div> </li> </ul> <a id="setCookie(java.lang.String)"> <!-- --> </a> <ul class="blockList"> <li class="blockList"> <h4>setCookie</h4> <pre class="methodSignature">void&nbsp;setCookie&#8203;(<a href="../../../../../java.base/java/lang/String.html" title="class in java.lang">String</a>&nbsp;cookie)</pre> </li> </ul> <a id="open()"> <!-- --> </a> <ul class="blockList"> <li class="blockList"> <h4>open</h4> <pre class="methodSignature">void&nbsp;open()</pre> <div class="block">Note. This method and the ones following allow a user to add to or replace the structure model of a document using strings of unparsed HTML. At the time of writing alternate methods for providing similar functionality for both HTML and XML documents were being considered. The following methods may be deprecated at some point in the future in favor of a more general-purpose mechanism. <br> Open a document stream for writing. If a document exists in the target, this method clears it.</div> </li> </ul> <a id="close()"> <!-- --> </a> <ul class="blockList"> <li class="blockList"> <h4>close</h4> <pre class="methodSignature">void&nbsp;close()</pre> <div class="block">Closes a document stream opened by <code>open()</code> and forces rendering.</div> </li> </ul> <a id="write(java.lang.String)"> <!-- --> </a> <ul class="blockList"> <li class="blockList"> <h4>write</h4> <pre class="methodSignature">void&nbsp;write&#8203;(<a href="../../../../../java.base/java/lang/String.html" title="class in java.lang">String</a>&nbsp;text)</pre> <div class="block">Write a string of text to a document stream opened by <code>open()</code> . The text is parsed into the document's structure model.</div> <dl> <dt><span class="paramLabel">Parameters:</span></dt> <dd><code>text</code> - The string to be parsed into some structure in the document structure model.</dd> </dl> </li> </ul> <a id="writeln(java.lang.String)"> <!-- --> </a> <ul class="blockList"> <li class="blockList"> <h4>writeln</h4> <pre class="methodSignature">void&nbsp;writeln&#8203;(<a href="../../../../../java.base/java/lang/String.html" title="class in java.lang">String</a>&nbsp;text)</pre> <div class="block">Write a string of text followed by a newline character to a document stream opened by <code>open()</code> . The text is parsed into the document's structure model.</div> <dl> <dt><span class="paramLabel">Parameters:</span></dt> <dd><code>text</code> - The string to be parsed into some structure in the document structure model.</dd> </dl> </li> </ul> <a id="getElementsByName(java.lang.String)"> <!-- --> </a> <ul class="blockListLast"> <li class="blockList"> <h4>getElementsByName</h4> <pre class="methodSignature"><a href="../../../../../java.xml/org/w3c/dom/NodeList.html" title="interface in org.w3c.dom">NodeList</a>&nbsp;getElementsByName&#8203;(<a href="../../../../../java.base/java/lang/String.html" title="class in java.lang">String</a>&nbsp;elementName)</pre> <div class="block">Returns the (possibly empty) collection of elements whose <code>name</code> value is given by <code>elementName</code> .</div> <dl> <dt><span class="paramLabel">Parameters:</span></dt> <dd><code>elementName</code> - The <code>name</code> attribute value for an element.</dd> <dt><span class="returnLabel">Returns:</span></dt> <dd>The matching elements.</dd> </dl> </li> </ul> </li> </ul> </section> </li> </ul> </div> </div> </main> <!-- ========= END OF CLASS DATA ========= --> <footer role="contentinfo"> <nav role="navigation"> <!-- ======= START OF BOTTOM NAVBAR ====== --> <div class="bottomNav"><a id="navbar.bottom"> <!-- --> </a> <div class="skipNav"><a href="#skip.navbar.bottom" title="Skip navigation links">Skip navigation links</a></div> <a id="navbar.bottom.firstrow"> <!-- --> </a> <ul class="navList" title="Navigation"> <li><a href="../../../../../index.html">Overview</a></li> <li><a href="../../../../module-summary.html">Module</a></li> <li><a href="package-summary.html">Package</a></li> <li class="navBarCell1Rev">Class</li> <li><a href="class-use/HTMLDocument.html">Use</a></li> <li><a href="package-tree.html">Tree</a></li> <li><a href="../../../../../deprecated-list.html">Deprecated</a></li> <li><a href="../../../../../index-files/index-1.html">Index</a></li> <li><a href="../../../../../help-doc.html">Help</a></li> </ul> <div class="aboutLanguage"><div style="margin-top: 14px;"><strong>Java SE 12 &amp; JDK 12</strong> </div></div> </div> <div class="subNav"> <div> <ul class="subNavList"> <li>Summary:&nbsp;</li> <li>Nested&nbsp;|&nbsp;</li> <li><a href="#field.summary">Field</a>&nbsp;|&nbsp;</li> <li>Constr&nbsp;|&nbsp;</li> <li><a href="#method.summary">Method</a></li> </ul> <ul class="subNavList"> <li>Detail:&nbsp;</li> <li>Field&nbsp;|&nbsp;</li> <li>Constr&nbsp;|&nbsp;</li> <li><a href="#method.detail">Method</a></li> </ul> </div> </div> <a id="skip.navbar.bottom"> <!-- --> </a> <!-- ======== END OF BOTTOM NAVBAR ======= --> </nav> <p class="legalCopy"><small><a href="https://bugreport.java.com/bugreport/">Report a bug or suggest an enhancement</a><br> For further API reference and developer documentation see the <a href="https://docs.oracle.com/pls/topic/lookup?ctx=javase12.0.2&amp;id=homepage" target="_blank">Java SE Documentation</a>, which contains more detailed, developer-targeted descriptions with conceptual overviews, definitions of terms, workarounds, and working code examples.<br> Java is a trademark or registered trademark of Oracle and/or its affiliates in the US and other countries.<br> <a href="../../../../../../legal/copyright.html">Copyright</a> &copy; 1993, 2019, Oracle and/or its affiliates, 500 Oracle Parkway, Redwood Shores, CA 94065 USA.<br>All rights reserved. Use is subject to <a href="https://www.oracle.com/technetwork/java/javase/terms/license/java12.0.2speclicense.html">license terms</a> and the <a href="https://www.oracle.com/technetwork/java/redist-137594.html">documentation redistribution policy</a>. <!-- Version 12.0.2+10 --></small></p> </footer> </body> </html>
{ "pile_set_name": "Github" }
class X { def f(a: Boolean, b: Boolean) { <spot>if</spot> (false) { System.out.print("if") } else { System.out.print("else") } } }
{ "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.hadoop.yarn.server.resourcemanager.scheduler.fair; import org.apache.hadoop.yarn.api.records.Resource; import org.apache.hadoop.yarn.util.resource.Resources; import org.junit.Test; import static org.assertj.core.api.Assertions.assertThat; import static org.junit.Assert.assertEquals; import static org.junit.Assert.assertNull; /** * To test class {@link ConfigurableResource}. */ public class TestConfigurableResource { private final Resource clusterResource = Resources.createResource(2048, 2); @Test public void testGetResourceWithPercentage() { ConfigurableResource configurableResource = new ConfigurableResource(new double[] {0.5, 0.5}); assertEquals( configurableResource.getResource(clusterResource).getMemorySize(), 1024); assertEquals( configurableResource.getResource(clusterResource).getVirtualCores(), 1); assertNull("The absolute resource should be null since object" + " configurableResource is initialized with percentages", configurableResource.getResource()); assertNull("The absolute resource should be null since cluster resource" + " is null", configurableResource.getResource(null)); } @Test public void testGetResourceWithAbsolute() { ConfigurableResource configurableResource = new ConfigurableResource(Resources.createResource(3072, 3)); assertThat(configurableResource.getResource().getMemorySize()). isEqualTo(3072); assertThat(configurableResource.getResource().getVirtualCores()). isEqualTo(3); assertEquals( configurableResource.getResource(clusterResource).getMemorySize(), 3072); assertEquals( configurableResource.getResource(clusterResource).getVirtualCores(), 3); assertThat(configurableResource.getResource(null).getMemorySize()). isEqualTo(3072); assertThat(configurableResource.getResource(null).getVirtualCores()). isEqualTo(3); } }
{ "pile_set_name": "Github" }
CREATE TABLE EJB30_PERSISTENCE_EEMPROPAGATION_PERSON ( NAME VARCHAR(256) NOT NULL PRIMARY KEY, DATA VARCHAR(256) );
{ "pile_set_name": "Github" }
define(function (require) { var zrUtil = require('zrender/core/util'); var defaultOption = { show: true, zlevel: 0, // 一级层叠 z: 0, // 二级层叠 // 反向坐标轴 inverse: false, // 坐标轴名字,默认为空 name: '', // 坐标轴名字位置,支持'start' | 'middle' | 'end' nameLocation: 'end', // 坐标轴文字样式,默认取全局样式 nameTextStyle: {}, // 文字与轴线距离 nameGap: 15, // 是否能触发鼠标事件 silent: true, // 坐标轴线 axisLine: { // 默认显示,属性show控制显示与否 show: true, onZero: true, // 属性lineStyle控制线条样式 lineStyle: { color: '#333', width: 1, type: 'solid' } }, // 坐标轴小标记 axisTick: { // 属性show控制显示与否,默认显示 show: true, // 控制小标记是否在grid里 inside: false, // 属性length控制线长 length: 5, // 属性lineStyle控制线条样式 lineStyle: { color: '#333', width: 1 } }, // 坐标轴文本标签,详见axis.axisLabel axisLabel: { show: true, // 控制文本标签是否在grid里 inside: false, rotate: 0, margin: 8, // formatter: null, // 其余属性默认使用全局文本样式,详见TEXTSTYLE textStyle: { color: '#333', fontSize: 12 } }, // 分隔线 splitLine: { // 默认显示,属性show控制显示与否 show: true, // 属性lineStyle(详见lineStyle)控制线条样式 lineStyle: { color: ['#ccc'], width: 1, type: 'solid' } }, // 分隔区域 splitArea: { // 默认不显示,属性show控制显示与否 show: false, // 属性areaStyle(详见areaStyle)控制区域样式 areaStyle: { color: ['rgba(250,250,250,0.3)','rgba(200,200,200,0.3)'] } } }; var categoryAxis = zrUtil.merge({ // 类目起始和结束两端空白策略 boundaryGap: true, // 坐标轴小标记 axisTick: { interval: 'auto' }, // 坐标轴文本标签,详见axis.axisLabel axisLabel: { interval: 'auto' } }, defaultOption); var valueAxis = zrUtil.defaults({ // 数值起始和结束两端空白策略 boundaryGap: [0, 0], // 最小值, 设置成 'dataMin' 则从数据中计算最小值 // min: null, // 最大值,设置成 'dataMax' 则从数据中计算最大值 // max: null, // Readonly prop, specifies start value of the range when using data zoom. // rangeStart: null // Readonly prop, specifies end value of the range when using data zoom. // rangeEnd: null // 脱离0值比例,放大聚焦到最终_min,_max区间 // scale: false, // 分割段数,默认为5 splitNumber: 5 }, defaultOption); // FIXME var timeAxis = zrUtil.defaults({ scale: true, min: 'dataMin', max: 'dataMax' }, valueAxis); var logAxis = zrUtil.defaults({}, valueAxis); logAxis.scale = true; return { categoryAxis: categoryAxis, valueAxis: valueAxis, timeAxis: timeAxis, logAxis: logAxis }; });
{ "pile_set_name": "Github" }
apiVersion: apps/v1beta2 kind: Deployment metadata: name: {{ include "flowing-retail.fullname" . }} labels: app: {{ include "flowing-retail.name" . }} chart: {{ include "flowing-retail.chart" . }} release: {{ .Release.Name }} heritage: {{ .Release.Service }} spec: replicas: {{ .Values.replicaCount }} selector: matchLabels: app: {{ include "flowing-retail.name" . }} release: {{ .Release.Name }} template: metadata: labels: app: {{ include "flowing-retail.name" . }} release: {{ .Release.Name }} spec: containers: - name: {{ .Chart.Name }} image: "{{ .Values.image.repository }}:{{ .Values.image.tag }}" imagePullPolicy: {{ .Values.image.pullPolicy }} env: - name: spring.cloud.stream.kafka.binder.zkNodes value: "confluent-cp-zookeeper:2181" - name: spring.cloud.stream.kafka.binder.brokers value: "confluent-cp-kafka:9092"
{ "pile_set_name": "Github" }
/* Silver */ .o2k7SkinSilver .mceToolbar .mceToolbarStart span, .o2k7SkinSilver .mceButton, .o2k7SkinSilver .mceSplitButton, .o2k7SkinSilver .mceSeparator, .o2k7SkinSilver .mceSplitButton a.mceOpen, .o2k7SkinSilver .mceListBox a.mceOpen {background-image:url(img/button_bg_silver.png)} .o2k7SkinSilver table, .o2k7SkinSilver .mceMenuItemTitle a {background:#eee} .o2k7SkinSilver .mceListBox .mceText {background:#FFF} .o2k7SkinSilver .mceExternalToolbar, .o2k7SkinSilver .mceListBox .mceText, .o2k7SkinSilver div.mceMenu, .o2k7SkinSilver table.mceLayout, .o2k7SkinSilver .mceMenuItemTitle a, .o2k7SkinSilver table.mceLayout tr.mceFirst td, .o2k7SkinSilver table.mceLayout, .o2k7SkinSilver .mceMenuItemTitle a, .o2k7SkinSilver table.mceLayout tr.mceLast td, .o2k7SkinSilver .mceIframeContainer {border-color: #bbb}
{ "pile_set_name": "Github" }
/* * QEMU Random Number Generator Backend * * Copyright IBM, Corp. 2012 * * Authors: * Anthony Liguori <[email protected]> * * This work is licensed under the terms of the GNU GPL, version 2 or later. * See the COPYING file in the top-level directory. */ #include "qemu/osdep.h" #include "sysemu/rng.h" #include "qapi/error.h" #include "qapi/qmp/qerror.h" #include "qom/object_interfaces.h" void rng_backend_request_entropy(RngBackend *s, size_t size, EntropyReceiveFunc *receive_entropy, void *opaque) { RngBackendClass *k = RNG_BACKEND_GET_CLASS(s); RngRequest *req; if (k->request_entropy) { req = g_malloc(sizeof(*req)); req->offset = 0; req->size = size; req->receive_entropy = receive_entropy; req->opaque = opaque; req->data = g_malloc(req->size); k->request_entropy(s, req); QSIMPLEQ_INSERT_TAIL(&s->requests, req, next); } } static bool rng_backend_prop_get_opened(Object *obj, Error **errp) { RngBackend *s = RNG_BACKEND(obj); return s->opened; } static void rng_backend_complete(UserCreatable *uc, Error **errp) { object_property_set_bool(OBJECT(uc), true, "opened", errp); } static void rng_backend_prop_set_opened(Object *obj, bool value, Error **errp) { RngBackend *s = RNG_BACKEND(obj); RngBackendClass *k = RNG_BACKEND_GET_CLASS(s); Error *local_err = NULL; if (value == s->opened) { return; } if (!value && s->opened) { error_setg(errp, QERR_PERMISSION_DENIED); return; } if (k->opened) { k->opened(s, &local_err); if (local_err) { error_propagate(errp, local_err); return; } } s->opened = true; } static void rng_backend_free_request(RngRequest *req) { g_free(req->data); g_free(req); } static void rng_backend_free_requests(RngBackend *s) { RngRequest *req, *next; QSIMPLEQ_FOREACH_SAFE(req, &s->requests, next, next) { rng_backend_free_request(req); } QSIMPLEQ_INIT(&s->requests); } void rng_backend_finalize_request(RngBackend *s, RngRequest *req) { QSIMPLEQ_REMOVE(&s->requests, req, RngRequest, next); rng_backend_free_request(req); } static void rng_backend_init(Object *obj) { RngBackend *s = RNG_BACKEND(obj); QSIMPLEQ_INIT(&s->requests); object_property_add_bool(obj, "opened", rng_backend_prop_get_opened, rng_backend_prop_set_opened, NULL); } static void rng_backend_finalize(Object *obj) { RngBackend *s = RNG_BACKEND(obj); rng_backend_free_requests(s); } static void rng_backend_class_init(ObjectClass *oc, void *data) { UserCreatableClass *ucc = USER_CREATABLE_CLASS(oc); ucc->complete = rng_backend_complete; } static const TypeInfo rng_backend_info = { .name = TYPE_RNG_BACKEND, .parent = TYPE_OBJECT, .instance_size = sizeof(RngBackend), .instance_init = rng_backend_init, .instance_finalize = rng_backend_finalize, .class_size = sizeof(RngBackendClass), .class_init = rng_backend_class_init, .abstract = true, .interfaces = (InterfaceInfo[]) { { TYPE_USER_CREATABLE }, { } } }; static void register_types(void) { type_register_static(&rng_backend_info); } type_init(register_types);
{ "pile_set_name": "Github" }
# 제너레이터와 비동기 이터레이션
{ "pile_set_name": "Github" }
// Copyright (c) 2001-2011 Hartmut Kaiser // Copyright (c) 2001-2011 Joel de Guzman // // Distributed under the Boost Software License, Version 1.0. (See accompanying // file LICENSE_1_0.txt or copy at http://www.lslboost.org/LICENSE_1_0.txt) #if !defined(SPIRIT_KARMA_SEQUENCE_FEB_28_2007_0247PM) #define SPIRIT_KARMA_SEQUENCE_FEB_28_2007_0247PM #if defined(_MSC_VER) #pragma once #endif #include <lslboost/spirit/home/karma/domain.hpp> #include <lslboost/spirit/home/karma/generator.hpp> #include <lslboost/spirit/home/karma/meta_compiler.hpp> #include <lslboost/spirit/home/karma/detail/fail_function.hpp> #include <lslboost/spirit/home/karma/detail/pass_container.hpp> #include <lslboost/spirit/home/karma/detail/get_stricttag.hpp> #include <lslboost/spirit/home/support/info.hpp> #include <lslboost/spirit/home/support/detail/what_function.hpp> #include <lslboost/spirit/home/karma/detail/attributes.hpp> #include <lslboost/spirit/home/karma/detail/indirect_iterator.hpp> #include <lslboost/spirit/home/support/algorithm/any_if.hpp> #include <lslboost/spirit/home/support/unused.hpp> #include <lslboost/spirit/home/support/sequence_base_id.hpp> #include <lslboost/spirit/home/support/has_semantic_action.hpp> #include <lslboost/spirit/home/support/handles_container.hpp> #include <lslboost/spirit/home/support/attributes.hpp> #include <lslboost/fusion/include/vector.hpp> #include <lslboost/fusion/include/as_vector.hpp> #include <lslboost/fusion/include/for_each.hpp> #include <lslboost/type_traits/is_same.hpp> #include <lslboost/mpl/bitor.hpp> #include <lslboost/mpl/int.hpp> #include <lslboost/mpl/and.hpp> #include <lslboost/mpl/not.hpp> #include <lslboost/fusion/include/transform.hpp> #include <lslboost/mpl/accumulate.hpp> #include <lslboost/config.hpp> /////////////////////////////////////////////////////////////////////////////// namespace lslboost { namespace spirit { /////////////////////////////////////////////////////////////////////////// // Enablers /////////////////////////////////////////////////////////////////////////// template <> struct use_operator<karma::domain, proto::tag::shift_left> // enables << : mpl::true_ {}; template <> struct flatten_tree<karma::domain, proto::tag::shift_left> // flattens << : mpl::true_ {}; }} /////////////////////////////////////////////////////////////////////////////// namespace lslboost { namespace spirit { namespace traits { // specialization for sequences template <typename Elements> struct sequence_properties { struct element_properties { template <typename T> struct result; template <typename F, typename Element> struct result<F(Element)> { typedef properties_of<Element> type; }; // never called, but needed for decltype-based result_of (C++0x) #ifndef BOOST_NO_CXX11_RVALUE_REFERENCES template <typename Element> typename result<element_properties(Element)>::type operator()(Element&&) const; #endif }; typedef typename mpl::accumulate< typename fusion::result_of::transform< Elements, element_properties>::type , mpl::int_<karma::generator_properties::no_properties> , mpl::bitor_<mpl::_2, mpl::_1> >::type type; }; }}} /////////////////////////////////////////////////////////////////////////////// namespace lslboost { namespace spirit { namespace karma { template <typename Elements, typename Strict, typename Derived> struct base_sequence : nary_generator<Derived> { typedef typename traits::sequence_properties<Elements>::type properties; base_sequence(Elements const& elements) : elements(elements) {} typedef Elements elements_type; struct sequence_base_id; template <typename Context, typename Iterator = unused_type> struct attribute { // Put all the element attributes in a tuple typedef typename traits::build_attribute_sequence< Elements, Context, traits::sequence_attribute_transform , Iterator, karma::domain >::type all_attributes; // Now, build a fusion vector over the attributes. Note // that build_fusion_vector 1) removes all unused attributes // and 2) may return unused_type if all elements have // unused_type(s). typedef typename traits::build_fusion_vector<all_attributes>::type type_; // Finally, strip single element vectors into its // naked form: vector1<T> --> T typedef typename traits::strip_single_element_vector<type_>::type type; }; // standard case. Attribute is a fusion tuple template < typename OutputIterator, typename Context, typename Delimiter , typename Attribute, typename Pred1, typename Pred2> bool generate_impl(OutputIterator& sink, Context& ctx , Delimiter const& d, Attribute& attr_, Pred1, Pred2) const { typedef detail::fail_function< OutputIterator, Context, Delimiter> fail_function; typedef traits::attribute_not_unused<Context> predicate; // wrap the attribute in a tuple if it is not a tuple or if the // attribute of this sequence is a single element tuple typedef typename attribute<Context>::type_ attr_type_; typename traits::wrap_if_not_tuple<Attribute , typename mpl::and_< traits::one_element_sequence<attr_type_> , mpl::not_<traits::one_element_sequence<Attribute> > >::type >::type attr(attr_); // return false if *any* of the generators fail bool r = spirit::any_if(elements, attr , fail_function(sink, ctx, d), predicate()); typedef typename traits::attribute_size<Attribute>::type size_type; // fail generating if sequences have not the same (logical) length return !r && (!Strict::value || // This ignores container element count (which is not good), // but allows valid attributes to succeed. This will lead to // false positives (failing generators, even if they shouldn't) // if the embedded component is restricting the number of // container elements it consumes (i.e. repeat). This solution // is not optimal but much better than letting _all_ repetitive // components fail. Pred1::value || size_type(traits::sequence_size<attr_type_>::value) == traits::size(attr_)); } // Special case when Attribute is an stl container and the sequence's // attribute is not a one element sequence template < typename OutputIterator, typename Context, typename Delimiter , typename Attribute> bool generate_impl(OutputIterator& sink, Context& ctx , Delimiter const& d, Attribute const& attr_ , mpl::true_, mpl::false_) const { // return false if *any* of the generators fail typedef detail::fail_function< OutputIterator, Context, Delimiter> fail_function; typedef typename traits::container_iterator< typename add_const<Attribute>::type >::type iterator_type; typedef typename traits::make_indirect_iterator<iterator_type>::type indirect_iterator_type; typedef detail::pass_container< fail_function, Attribute, indirect_iterator_type, mpl::true_> pass_container; iterator_type begin = traits::begin(attr_); iterator_type end = traits::end(attr_); pass_container pass(fail_function(sink, ctx, d), indirect_iterator_type(begin), indirect_iterator_type(end)); bool r = fusion::any(elements, pass); // fail generating if sequences have not the same (logical) length return !r && (!Strict::value || begin == end); } // main generate function. Dispatches to generate_impl depending // on the Attribute type. template < typename OutputIterator, typename Context, typename Delimiter , typename Attribute> bool generate(OutputIterator& sink, Context& ctx, Delimiter const& d , Attribute const& attr) const { typedef typename traits::is_container<Attribute>::type is_container; typedef typename attribute<Context>::type_ attr_type_; typedef typename traits::one_element_sequence<attr_type_>::type is_one_element_sequence; return generate_impl(sink, ctx, d, attr, is_container() , is_one_element_sequence()); } template <typename Context> info what(Context& context) const { info result("sequence"); fusion::for_each(elements, spirit::detail::what_function<Context>(result, context)); return result; } Elements elements; }; template <typename Elements> struct sequence : base_sequence<Elements, mpl::false_, sequence<Elements> > { typedef base_sequence<Elements, mpl::false_, sequence> base_sequence_; sequence(Elements const& subject) : base_sequence_(subject) {} }; template <typename Elements> struct strict_sequence : base_sequence<Elements, mpl::true_, strict_sequence<Elements> > { typedef base_sequence<Elements, mpl::true_, strict_sequence> base_sequence_; strict_sequence(Elements const& subject) : base_sequence_(subject) {} }; /////////////////////////////////////////////////////////////////////////// // Generator generators: make_xxx function (objects) /////////////////////////////////////////////////////////////////////////// namespace detail { template <typename Elements, bool strict_mode = false> struct make_sequence : make_nary_composite<Elements, sequence> {}; template <typename Elements> struct make_sequence<Elements, true> : make_nary_composite<Elements, strict_sequence> {}; } template <typename Elements, typename Modifiers> struct make_composite<proto::tag::shift_left, Elements, Modifiers> : detail::make_sequence<Elements, detail::get_stricttag<Modifiers>::value> {}; /////////////////////////////////////////////////////////////////////////// // Helper template allowing to get the required container type for a rule // attribute, which is part of a sequence. template <typename Iterator> struct make_sequence_iterator_range { typedef iterator_range<detail::indirect_iterator<Iterator> > type; }; }}} namespace lslboost { namespace spirit { namespace traits { /////////////////////////////////////////////////////////////////////////// template <typename Elements> struct has_semantic_action<karma::sequence<Elements> > : nary_has_semantic_action<Elements> {}; template <typename Elements> struct has_semantic_action<karma::strict_sequence<Elements> > : nary_has_semantic_action<Elements> {}; /////////////////////////////////////////////////////////////////////////// template <typename Elements, typename Attribute, typename Context , typename Iterator> struct handles_container<karma::sequence<Elements>, Attribute, Context , Iterator> : mpl::true_ {}; template <typename Elements, typename Attribute, typename Context , typename Iterator> struct handles_container<karma::strict_sequence<Elements>, Attribute , Context, Iterator> : mpl::true_ {}; }}} #endif
{ "pile_set_name": "Github" }
/* ssl/kssl.h */ /* * Written by Vern Staats <[email protected]> for the OpenSSL project * 2000. project 2000. */ /* ==================================================================== * Copyright (c) 2000 The OpenSSL Project. All rights reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions * are met: * * 1. Redistributions of source code must retain the above copyright * notice, this list of conditions and the following disclaimer. * * 2. Redistributions in binary form must reproduce the above copyright * notice, this list of conditions and the following disclaimer in * the documentation and/or other materials provided with the * distribution. * * 3. All advertising materials mentioning features or use of this * software must display the following acknowledgment: * "This product includes software developed by the OpenSSL Project * for use in the OpenSSL Toolkit. (http://www.OpenSSL.org/)" * * 4. The names "OpenSSL Toolkit" and "OpenSSL Project" must not be used to * endorse or promote products derived from this software without * prior written permission. For written permission, please contact * [email protected]. * * 5. Products derived from this software may not be called "OpenSSL" * nor may "OpenSSL" appear in their names without prior written * permission of the OpenSSL Project. * * 6. Redistributions of any form whatsoever must retain the following * acknowledgment: * "This product includes software developed by the OpenSSL Project * for use in the OpenSSL Toolkit (http://www.OpenSSL.org/)" * * THIS SOFTWARE IS PROVIDED BY THE OpenSSL PROJECT ``AS IS'' AND ANY * EXPRESSED OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE OpenSSL PROJECT OR * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED * OF THE POSSIBILITY OF SUCH DAMAGE. * ==================================================================== * * This product includes cryptographic software written by Eric Young * ([email protected]). This product includes software written by Tim * Hudson ([email protected]). * */ /* ** 19990701 VRS Started. */ #ifndef KSSL_H # define KSSL_H # include <openssl/opensslconf.h> # ifndef OPENSSL_NO_KRB5 # include <stdio.h> # include <ctype.h> # include <krb5.h> # ifdef OPENSSL_SYS_WIN32 /* * These can sometimes get redefined indirectly by krb5 header files after * they get undefed in ossl_typ.h */ # undef X509_NAME # undef X509_EXTENSIONS # undef OCSP_REQUEST # undef OCSP_RESPONSE # endif #ifdef __cplusplus extern "C" { #endif /* * Depending on which KRB5 implementation used, some types from * the other may be missing. Resolve that here and now */ # ifdef KRB5_HEIMDAL typedef unsigned char krb5_octet; # define FAR # else # ifndef FAR # define FAR # endif # endif /*- * Uncomment this to debug kssl problems or * to trace usage of the Kerberos session key * * #define KSSL_DEBUG */ # ifndef KRB5SVC # define KRB5SVC "host" # endif # ifndef KRB5KEYTAB # define KRB5KEYTAB "/etc/krb5.keytab" # endif # ifndef KRB5SENDAUTH # define KRB5SENDAUTH 1 # endif # ifndef KRB5CHECKAUTH # define KRB5CHECKAUTH 1 # endif # ifndef KSSL_CLOCKSKEW # define KSSL_CLOCKSKEW 300; # endif # define KSSL_ERR_MAX 255 typedef struct kssl_err_st { int reason; char text[KSSL_ERR_MAX + 1]; } KSSL_ERR; /*- Context for passing * (1) Kerberos session key to SSL, and * (2) Config data between application and SSL lib */ typedef struct kssl_ctx_st { /* used by: disposition: */ char *service_name; /* C,S default ok (kssl) */ char *service_host; /* C input, REQUIRED */ char *client_princ; /* S output from krb5 ticket */ char *keytab_file; /* S NULL (/etc/krb5.keytab) */ char *cred_cache; /* C NULL (default) */ krb5_enctype enctype; int length; krb5_octet FAR *key; } KSSL_CTX; # define KSSL_CLIENT 1 # define KSSL_SERVER 2 # define KSSL_SERVICE 3 # define KSSL_KEYTAB 4 # define KSSL_CTX_OK 0 # define KSSL_CTX_ERR 1 # define KSSL_NOMEM 2 /* Public (for use by applications that use OpenSSL with Kerberos 5 support */ krb5_error_code kssl_ctx_setstring(KSSL_CTX *kssl_ctx, int which, char *text); KSSL_CTX *kssl_ctx_new(void); KSSL_CTX *kssl_ctx_free(KSSL_CTX *kssl_ctx); void kssl_ctx_show(KSSL_CTX *kssl_ctx); krb5_error_code kssl_ctx_setprinc(KSSL_CTX *kssl_ctx, int which, krb5_data *realm, krb5_data *entity, int nentities); krb5_error_code kssl_cget_tkt(KSSL_CTX *kssl_ctx, krb5_data **enc_tktp, krb5_data *authenp, KSSL_ERR *kssl_err); krb5_error_code kssl_sget_tkt(KSSL_CTX *kssl_ctx, krb5_data *indata, krb5_ticket_times *ttimes, KSSL_ERR *kssl_err); krb5_error_code kssl_ctx_setkey(KSSL_CTX *kssl_ctx, krb5_keyblock *session); void kssl_err_set(KSSL_ERR *kssl_err, int reason, char *text); void kssl_krb5_free_data_contents(krb5_context context, krb5_data *data); krb5_error_code kssl_build_principal_2(krb5_context context, krb5_principal *princ, int rlen, const char *realm, int slen, const char *svc, int hlen, const char *host); krb5_error_code kssl_validate_times(krb5_timestamp atime, krb5_ticket_times *ttimes); krb5_error_code kssl_check_authent(KSSL_CTX *kssl_ctx, krb5_data *authentp, krb5_timestamp *atimep, KSSL_ERR *kssl_err); unsigned char *kssl_skip_confound(krb5_enctype enctype, unsigned char *authn); void SSL_set0_kssl_ctx(SSL *s, KSSL_CTX *kctx); KSSL_CTX *SSL_get0_kssl_ctx(SSL *s); char *kssl_ctx_get0_client_princ(KSSL_CTX *kctx); #ifdef __cplusplus } #endif # endif /* OPENSSL_NO_KRB5 */ #endif /* KSSL_H */
{ "pile_set_name": "Github" }
package dbus import ( "context" "errors" "strings" ) // BusObject is the interface of a remote object on which methods can be // invoked. type BusObject interface { Call(method string, flags Flags, args ...interface{}) *Call CallWithContext(ctx context.Context, method string, flags Flags, args ...interface{}) *Call Go(method string, flags Flags, ch chan *Call, args ...interface{}) *Call GoWithContext(ctx context.Context, method string, flags Flags, ch chan *Call, args ...interface{}) *Call AddMatchSignal(iface, member string, options ...MatchOption) *Call RemoveMatchSignal(iface, member string, options ...MatchOption) *Call GetProperty(p string) (Variant, error) SetProperty(p string, v interface{}) error Destination() string Path() ObjectPath } // Object represents a remote object on which methods can be invoked. type Object struct { conn *Conn dest string path ObjectPath } // Call calls a method with (*Object).Go and waits for its reply. func (o *Object) Call(method string, flags Flags, args ...interface{}) *Call { return <-o.createCall(context.Background(), method, flags, make(chan *Call, 1), args...).Done } // CallWithContext acts like Call but takes a context func (o *Object) CallWithContext(ctx context.Context, method string, flags Flags, args ...interface{}) *Call { return <-o.createCall(ctx, method, flags, make(chan *Call, 1), args...).Done } // AddMatchSignal subscribes BusObject to signals from specified interface, // method (member). Additional filter rules can be added via WithMatch* option constructors. // Note: To filter events by object path you have to specify this path via an option. // // Deprecated: use (*Conn) AddMatchSignal instead. func (o *Object) AddMatchSignal(iface, member string, options ...MatchOption) *Call { base := []MatchOption{ withMatchType("signal"), WithMatchInterface(iface), WithMatchMember(member), } options = append(base, options...) return o.conn.BusObject().Call( "org.freedesktop.DBus.AddMatch", 0, formatMatchOptions(options), ) } // RemoveMatchSignal unsubscribes BusObject from signals from specified interface, // method (member). Additional filter rules can be added via WithMatch* option constructors // // Deprecated: use (*Conn) RemoveMatchSignal instead. func (o *Object) RemoveMatchSignal(iface, member string, options ...MatchOption) *Call { base := []MatchOption{ withMatchType("signal"), WithMatchInterface(iface), WithMatchMember(member), } options = append(base, options...) return o.conn.BusObject().Call( "org.freedesktop.DBus.RemoveMatch", 0, formatMatchOptions(options), ) } // Go calls a method with the given arguments asynchronously. It returns a // Call structure representing this method call. The passed channel will // return the same value once the call is done. If ch is nil, a new channel // will be allocated. Otherwise, ch has to be buffered or Go will panic. // // If the flags include FlagNoReplyExpected, ch is ignored and a Call structure // is returned with any error in Err and a closed channel in Done containing // the returned Call as it's one entry. // // If the method parameter contains a dot ('.'), the part before the last dot // specifies the interface on which the method is called. func (o *Object) Go(method string, flags Flags, ch chan *Call, args ...interface{}) *Call { return o.createCall(context.Background(), method, flags, ch, args...) } // GoWithContext acts like Go but takes a context func (o *Object) GoWithContext(ctx context.Context, method string, flags Flags, ch chan *Call, args ...interface{}) *Call { return o.createCall(ctx, method, flags, ch, args...) } func (o *Object) createCall(ctx context.Context, method string, flags Flags, ch chan *Call, args ...interface{}) *Call { if ctx == nil { panic("nil context") } iface := "" i := strings.LastIndex(method, ".") if i != -1 { iface = method[:i] } method = method[i+1:] msg := new(Message) msg.Type = TypeMethodCall msg.serial = o.conn.getSerial() msg.Flags = flags & (FlagNoAutoStart | FlagNoReplyExpected) msg.Headers = make(map[HeaderField]Variant) msg.Headers[FieldPath] = MakeVariant(o.path) msg.Headers[FieldDestination] = MakeVariant(o.dest) msg.Headers[FieldMember] = MakeVariant(method) if iface != "" { msg.Headers[FieldInterface] = MakeVariant(iface) } msg.Body = args if len(args) > 0 { msg.Headers[FieldSignature] = MakeVariant(SignatureOf(args...)) } if msg.Flags&FlagNoReplyExpected == 0 { if ch == nil { ch = make(chan *Call, 1) } else if cap(ch) == 0 { panic("dbus: unbuffered channel passed to (*Object).Go") } ctx, cancel := context.WithCancel(ctx) call := &Call{ Destination: o.dest, Path: o.path, Method: method, Args: args, Done: ch, ctxCanceler: cancel, ctx: ctx, } o.conn.calls.track(msg.serial, call) o.conn.sendMessageAndIfClosed(msg, func() { o.conn.calls.handleSendError(msg, ErrClosed) cancel() }) go func() { <-ctx.Done() o.conn.calls.handleSendError(msg, ctx.Err()) }() return call } done := make(chan *Call, 1) call := &Call{ Err: nil, Done: done, } defer func() { call.Done <- call close(done) }() o.conn.sendMessageAndIfClosed(msg, func() { call.Err = ErrClosed }) return call } // GetProperty calls org.freedesktop.DBus.Properties.Get on the given // object. The property name must be given in interface.member notation. func (o *Object) GetProperty(p string) (Variant, error) { idx := strings.LastIndex(p, ".") if idx == -1 || idx+1 == len(p) { return Variant{}, errors.New("dbus: invalid property " + p) } iface := p[:idx] prop := p[idx+1:] result := Variant{} err := o.Call("org.freedesktop.DBus.Properties.Get", 0, iface, prop).Store(&result) if err != nil { return Variant{}, err } return result, nil } // SetProperty calls org.freedesktop.DBus.Properties.Set on the given // object. The property name must be given in interface.member notation. func (o *Object) SetProperty(p string, v interface{}) error { idx := strings.LastIndex(p, ".") if idx == -1 || idx+1 == len(p) { return errors.New("dbus: invalid property " + p) } iface := p[:idx] prop := p[idx+1:] return o.Call("org.freedesktop.DBus.Properties.Set", 0, iface, prop, v).Err } // Destination returns the destination that calls on (o *Object) are sent to. func (o *Object) Destination() string { return o.dest } // Path returns the path that calls on (o *Object") are sent to. func (o *Object) Path() ObjectPath { return o.path }
{ "pile_set_name": "Github" }
// // HibpOperation.m // Strongbox // // Created by Strongbox on 02/05/2020. // Copyright © 2020 Mark McGuill. All rights reserved. // #import "UrlRequestOperation.h" @interface UrlRequestOperation () @property (nonatomic, getter = isFinished, readwrite) BOOL finished; @property (nonatomic, getter = isExecuting, readwrite) BOOL executing; @property (nonatomic, strong) NSURLRequest *request; @property (nonatomic, weak) NSURLSessionTask *task; @property (nonatomic, copy) void (^dataTaskCompletionHandler)(NSData * _Nullable data, NSURLResponse * _Nullable response, NSError * _Nullable error); @end @implementation UrlRequestOperation @synthesize finished = _finished; @synthesize executing = _executing; - (instancetype)initWithRequest:(NSURLRequest *)request dataTaskCompletionHandler:(void (^)(NSData * _Nullable data, NSURLResponse * _Nullable response, NSError * _Nullable error))dataTaskCompletionHandler { self = [super init]; if (self) { _finished = NO; _executing = NO; self.request = request; self.dataTaskCompletionHandler = dataTaskCompletionHandler; } return self; } - (instancetype)initWithURL:(NSURL *)url dataTaskCompletionHandler:(void (^)(NSData * _Nullable data, NSURLResponse * _Nullable response, NSError * _Nullable error))dataTaskCompletionHandler { NSURLRequest *request = [NSURLRequest requestWithURL:url]; return [self initWithRequest:request dataTaskCompletionHandler:dataTaskCompletionHandler]; } - (void)start { if ([self isCancelled]) { self.finished = YES; return; } self.executing = YES; [self main]; } - (void)main { NSURLSessionTask *task = [[NSURLSession sharedSession] dataTaskWithRequest:self.request completionHandler:^(NSData *data, NSURLResponse *response, NSError *error) { self.dataTaskCompletionHandler(data, response, error); [self completeOperation]; }]; [task resume]; self.task = task; } - (void)completeOperation { self.dataTaskCompletionHandler = nil; self.executing = NO; self.finished = YES; } - (void)cancel { [self.task cancel]; [super cancel]; } #pragma mark - NSOperation methods - (BOOL)isAsynchronous { return YES; } - (BOOL)isExecuting { @synchronized(self) { return _executing; } } - (BOOL)isFinished { @synchronized(self) { return _finished; } } - (void)setExecuting:(BOOL)executing { @synchronized(self) { if (_executing != executing) { [self willChangeValueForKey:@"isExecuting"]; _executing = executing; [self didChangeValueForKey:@"isExecuting"]; } } } - (void)setFinished:(BOOL)finished { @synchronized(self) { if (_finished != finished) { [self willChangeValueForKey:@"isFinished"]; _finished = finished; [self didChangeValueForKey:@"isFinished"]; } } } @end
{ "pile_set_name": "Github" }
{ "title": "Exiting multiple loops", "postscript": "", "reviewType": "multipleSelection", "question": "Which of these statements about multiple loops are true?", "hint": "Exiting multiple loops is done by using <code>break<\/code> with a loop label.", "syntaxHighlighting": false, "correct": [ { "answer": "A loop inside a loop is called a nested loop.", "reason": "This statement is correct." }, { "answer": "Using <code>break<\/code> by itself exits the current loop only.", "reason": "This statement is correct." }, { "answer": "Loop labels look like this: <code>myLoop:<\/code>", "reason": "This statement is correct." }, { "answer": "You can exit more than one loop at a time.", "reason": "This statement is correct." }, { "answer": "You can break out of a labeled loop whenever you need.", "reason": "This statement is correct." }, { "answer": "You can embed one loop inside another.", "reason": "This statement is correct." } ], "wrong": [ { "answer": "You may have only one labeled loop.", "reason": "You may have as many labeled loops as you need." }, { "answer": "Nesting can only be used with <code>for<\/code> loops.", "reason": "You can nest <code>while<\/code> loops too, if you want." }, { "answer": "Loop labels look like this: <code>myLoop {<\/code>", "reason": "They are written as <code>loopName:<\/code> followed by your regular loop code." }, { "answer": "You can exit up to two loops at a time.", "reason": "You can exit more loops than that if you need to, although it's possible your code is a little dubious at that point." }, { "answer": "You can only break out of loops inside a condition.", "reason": "You can break out of loops outside of conditions just fine." }, { "answer": "You can write <code>break 3<\/code> to break out of two loops.", "reason": "We use names rather than numbers for breaking out of a specific loops." } ] }
{ "pile_set_name": "Github" }
package # Date::Manip::Offset::off060; # Copyright (c) 2008-2014 Sullivan Beck. All rights reserved. # This program is free software; you can redistribute it and/or modify it # under the same terms as Perl itself. # This file was automatically generated. Any changes to this file will # be lost the next time 'tzdata' is run. # Generated on: Thu Aug 21 13:23:29 EDT 2014 # Data version: tzdata2014f # Code version: tzcode2014f # This module contains data from the zoneinfo time zone database. The original # data was obtained from the URL: # ftp://ftp.iana.orgtz use strict; use warnings; require 5.010000; our ($VERSION); $VERSION='6.47'; END { undef $VERSION; } our ($Offset,%Offset); END { undef $Offset; undef %Offset; } $Offset = '+01:55:20'; %Offset = ( 0 => [ 'europe/chisinau', ], ); 1;
{ "pile_set_name": "Github" }
namespace AutoTest.UI.CodeReflection { public enum SignatureTypes { Class, Method, Field } }
{ "pile_set_name": "Github" }
## Mobilenet-SSD License Plate Detection & Recognition This is a project for license plate detection using mobilenet-ssd. ### Last Update !! : 2019.07.22 Add mssd512_voc.caffemodel with high accuracy and low complexity - Accuracy : 94.6%. - Speed : 30ms(multi-cores) on 720P images.(OpenCV 4.0) ## Install - Caffe-SSD or Opencv 4.0 ##### Note: 使用OpneCV 4.0 中的DNN模块 无需安装Caffe. ## Results ![](images/2.png) ![](images/4.png) ![](images/demo1.jpg) ### Recognition Demo 简单的结合HyperLPR中的端到端模型,可以简单的实现车牌识别: ![r2](images/r2.png) ![r1](images/r1.png)
{ "pile_set_name": "Github" }
module NStack.CLI.Commands ( CCmd, initCommand, buildArtefacts, InitStack(..), Command(..), loginSettings, showStartMessage, showStopMessage, printInfo, printMethods, printProcesses, printScheduledProcesses, showModuleBuild, registerCommand, sendCommand, callWithCookieJar ) where import qualified Control.Exception as E import qualified Control.Foldl as L import Control.Lens ((&), (?~), (^.), to, (.~), (^?), _Just) import Control.Monad.Except -- mtl import Control.Monad.Trans () -- mtl import Control.Monad.Extra (whenM) -- mtl import Data.Aeson import Data.Bifunctor (first) -- bifunctors import Data.ByteString.Lazy (ByteString) import Data.Char (toLower) import Data.Foldable (traverse_) import Data.Functor (($>)) import qualified Data.Map as Map import Data.Maybe (isNothing) import Data.Monoid ((<>)) import Data.Proxy (Proxy(..)) import Data.Text (Text, unpack) import Data.Tree (Forest, unfoldForest) import Data.Tree.View (showTree) import qualified Data.Text as T import qualified Data.Text.IO as TIO import Data.Text.Encoding (decodeUtf8, encodeUtf8) import qualified Data.Yaml as Y import qualified Filesystem.Path.CurrentOS as FP -- system-filepath import Network.HTTP.Client hiding (responseStatus, Proxy) import Network.HTTP.Client.TLS (mkManagerSettings) import Network.Wreq hiding (responseCookieJar, Proxy) import Util ((<||>)) -- ghc import System.Directory (getXdgDirectory, XdgDirectory(..), createDirectoryIfMissing) import System.IO.Error (isDoesNotExistError) import qualified Text.Mustache as M -- mustache import Text.Mustache ((~>)) -- mustache import qualified Text.PrettyPrint.Mainland as M import Text.PrettyPrint.Mainland ((</>)) import qualified Turtle as R -- turtle import NStack.Auth import NStack.CLI.Auth (allowSelfSigned) import NStack.CLI.Types import NStack.CLI.Templates (createFromTemplate) import NStack.Comms.Types import NStack.Module.Name (ModuleName, ModuleRef, ModuleURI(..), showShortModuleUri) import NStack.Module.Parser (parseModuleName) import NStack.Module.QMap (QMap(..)) import NStack.Module.Types import NStack.Module.Version (ExactRelease(..), SemVer(..)) import qualified NStack.Utils.Archive as Archive import NStack.Module.ConfigFile (configFile, workflowFile, ConfigStack(..), mkStackParent) import NStack.Prelude.Applicative ((<&>)) import NStack.Prelude.FilePath (fpToText, fromFP, directory) import NStack.Prelude.Shell (runCmd_) import NStack.Prelude.Monad (eitherToExcept, maybeToExcept) import NStack.Prelude.Text (pprT, capitaliseT, prettyT, prettyT') import NStack.Settings type ServerAddr = String type Path = String type Snippet = String -- | Available sub commands data Command = InitCommand InitStack GitRepo | NotebookCommand DebugOpt (Maybe DSLSource) | StartCommand DebugOpt ModuleName FnName | StopCommand ProcessId | LogsCommand ProcessId | ConnectCommand ProcessId | ServerLogsCommand | InfoCommand Bool | ListFnCommand MethodType Bool | ListTypesCommand Bool | ListAllCommand Bool | ListModulesCommand Bool | DeleteModuleCommand ModuleRef | ListProcessesCommand | ListStoppedCommand (Maybe StoppedFrom) (Maybe StoppedAmount) | GarbageCollectCommand | BuildCommand | RegisterCommand UserName Email ServerAddr | SendCommand Path Snippet | TestCommand ModuleRef FnName Snippet | LoginCommand HostName Int UserId SecretKey | ListScheduled -- Parser for Init command options data InitStack = InitWorkflow | InitStack Language | InitFramework BaseImage data TemplateOut = TemplateOut ModuleName (Maybe Y.Value) instance M.ToMustache TemplateOut where toMustache (TemplateOut name stackOrParent) = M.object [ "name" ~> localModName name , "stackOrParent" ~> maybe "" (decodeUtf8 . Y.encode) stackOrParent ] -- TODO - these should be moved to the server snapshot :: (FedoraVersion, FedoraSnapshot) snapshot = (25, 0) -- The default api version for a language on `nstack init` langStacks :: Language -> APIVersion langStacks _ = 2 initCommand :: CCmdEff m => InitStack -> GitRepo -> m () initCommand initStack (GitRepo wantGitRepo) = do curDir <- R.pwd tModuleName <- moduleNameFromDir curDir _ <- whenNotExistingProject (templateDirs, initProj) <- case initStack of InitWorkflow -> return (["workflow"], Nothing) InitFramework baseImage -> do iParentName <- parseModuleName . _baseImage $ baseImage return (["framework"], Just . mkStackParent . Right $ iParentName) InitStack lang -> do let cfgStack = ConfigStack lang (langStacks lang) snapshot return (["common", map toLower . show $ lang], Just . mkStackParent . Left $ cfgStack) -- copy the init files into the module dir liftIO $ mapM_ (createFromTemplate (fromFP curDir)) templateDirs -- run the template over them runTemplates curDir tModuleName initProj when wantGitRepo initGitRepo liftIO . TIO.putStrLn $ "Module '" <> localModName tModuleName <> "' successfully initialised at " <> T.pack (fromFP curDir) -- | Extract the module name from the current directory moduleNameFromDir :: CCmdEff m => R.FilePath -> m ModuleName moduleNameFromDir curDir = ((fmap capitaliseT . fpToText . FP.filename $ curDir) <&> (<> ":0.0.1-SNAPSHOT") >>= parseModuleName) `catchError` (\err -> throwError ( "Your directory name, " <> FP.encodeString curDir <> ", is not a valid module name.\n" <> err)) -- | Run project git/dir check whenNotExistingProject :: CCmdEff m => m () whenNotExistingProject = whenM (liftIO $ R.testdir ".git" <||> R.testfile configFile) (throwError "Found existing project, cancelling") -- | process the initial module files using templates runTemplates :: CCmdEff m => R.FilePath -> ModuleName -> Maybe Y.Value -> m () runTemplates curDir modName stackOrParent = do files <- R.fold (R.ls curDir) L.list traverse_ (runTemplate . fromFP) files where runTemplate :: CCmdEff m => FilePath -> m () runTemplate inFile = do template <- eitherToExcept =<< liftIO (first show <$> M.localAutomaticCompile inFile) let newText = M.substitute template (TemplateOut modName stackOrParent) liftIO $ TIO.writeFile inFile newText -- HACK - to remove once we have username on CLI / remove modulename parsing -- Currently used to display the ModuleName on the CLI without the default `nstack` author localModName :: ModuleName -> Text localModName = last . T.splitOn "nstack/" . T.pack . showShortModuleUri -- | init the module using Git initGitRepo :: CCmdEff m => m () initGitRepo = liftIO $ do runCmd_ "git" ["init"] runCmd_ "git" ["add", "."] runCmd_ "git" ["commit", "-m", "Initial Commit"] -- Sh.run "git" ["branch", "nstack"] -- | Returns the artefacts needed to build a module -- | TODO: Needs to be updated to take the language from the nstack.yaml to determine the required files buildArtefacts :: CCmdEff m => FilePath -- ^ directory -> [FilePath] -- ^ globs from the files section of nstack.yaml -> m ByteString buildArtefacts dir globs = do let std_files = [configFile, workflowFile, "setup.py", "service.py", "requirements.txt", "service.r"] liftIO $ Archive.expandCheckPack dir std_files globs printInfo :: ServerInfo -> Text printInfo (ServerInfo ps stopped meths ms) = prettyT' $ block "Running processes:" (map M.ppr ps) </> block "Stopped processes:" (map M.ppr stopped) </> block "Available functions:" (prettyPrintMethods $ fmap typeSignature meths) </> M.text "Container modules:" </> showModules ms where typeSignature (MethodInfo t _) = t showModules :: Map.Map ModuleRef ModuleInfo -> M.Doc showModules = M.stack . fmap M.text . renderTree . mkTree . Map.toList renderTree :: Forest (ModuleRef, ModuleInfo) -> [String] renderTree = fmap (showTree . fmap renderMod) where renderMod (modName, ModuleInfo{..}) = unpack . prettyT 120 $ M.ppr modName M.<+> M.parens (M.commasep [maybe "Base" M.ppr _miStack, if _miIsFramework then "Framework" else "User Code", M.ppr _miImage]) mkTree :: [(ModuleRef, ModuleInfo)] -> Forest (ModuleRef, ModuleInfo) mkTree mods = unfoldForest f baseMods where baseMods = filter (isNothing . _miParent . snd) mods f mod'@(modName, _) = (mod', filter ((== Just modName) . _miParent . snd) mods) printMethods :: M.Pretty a => QMap a TypeSignature -> Text printMethods = prettyT' . M.stack . prettyPrintMethods prettyPrintMethods :: M.Pretty a => QMap a TypeSignature -> [M.Doc] prettyPrintMethods = moduleMethodBlocks . methodDocs where printMethod (uri, (TypeSignature ts)) = M.ppr uri <> " : " <> M.ppr ts printMethod (uri, TypeDefinition td) = "type " <> M.ppr uri <> " = " <> M.ppr td methodDocs (QMap inner) = fmap (Map.foldMapWithKey (\k a -> [curry printMethod k a])) inner moduleMethodBlocks = fmap (uncurry (block . unpack . pprT)) . Map.toList printProcesses :: forall a. ProcPrintable a => [ProcessInfo a] -> Text printProcesses = \case [] -> emptyMessage p xs -> prettyT' $ M.text "pid" <> M.spaces 4 <> M.text "time" <> M.spaces 21 <> columnHeader p <> M.text "command" </> M.text (replicate (40 + columnWidth p) '=') </> M.stack (map M.ppr xs) where p = Proxy @a class (M.Pretty (ProcessInfo a)) => ProcPrintable a where emptyMessage :: Proxy a -> Text columnHeader :: Proxy a -> M.Doc columnWidth :: Proxy a -> Int instance ProcPrintable () where emptyMessage _ = "No running processes" columnHeader _ = mempty columnWidth _ = 0 instance ProcPrintable StopTime where emptyMessage _ = "No stopped processes in range" columnHeader _ = M.text "stop time" <> M.spaces 16 columnWidth _ = 25 printScheduledProcesses :: [(ProcessInfo (), [ScheduledTime])] -> Text printScheduledProcesses [] = "No scheduled processes" printScheduledProcesses xs = prettyT' $ M.stack items where items = fmap (\(pInfo, datetimes) -> M.text "Process " <> M.ppr pInfo </> M.text "Next scheduled times: " <> M.stack (M.ppr <$> datetimes) </> M.text (replicate 10 '-')) xs block :: String -> [M.Doc] -> M.Doc block label stack = M.text label </> M.indent 4 (M.stack stack) </> M.empty showStartMessage :: ProcessInfo () -> Text showStartMessage (ProcessInfo (ProcessId pId) _ _ _) = "Successfully started as process " <> pId showStopMessage :: (ProcessInfo a) -> Text showStopMessage (ProcessInfo (ProcessId pId) _ _ _) = "Successfully stopped process " <> pId showModuleBuild :: ModuleRef -> Text showModuleBuild mName = "Module " <> T.pack (showShortModuleUri mName) <> " built successfully" <> maybeFullSnap <> ". Use `nstack list functions` to see all available functions." where maybeFullSnap = case release (version mName) of (Snap _) -> " (as " <> pprT mName <> ")" _ -> "" loginSettings :: HostName -> Int -> UserId -> SecretKey -> CCmd () loginSettings hostname port username pw = do modifySettings $ \s -> s & serverConn ?~ (ServerDetails (Just hostname) (Just port)) & authSettings ?~ (NStackHMAC username pw) liftIO $ putStrLn "Successfully updated configuration" -- | Attempt to register with the auth server directly from the CLI registerCommand :: UserName -> Email -> ServerAddr -> CCmd () registerCommand (UserName userName) (Email email) serverAddr = do eitherToExcept =<< liftIO (callServer `E.catch` wreqErrorHandler) liftIO . TIO.putStrLn $ "Thanks for registering " <> userName <> ", an email will be sent to " <> email <> " shortly" where serverAddr' = "https://" <> serverAddr <> "/register" body = object ["username" .= userName, "email" .= email] callServer = post serverAddr' body $> Right () sendCommand :: Path -> Snippet -> CCmd () sendCommand path snippet = do event <- mkEvent (HostName serverHost) <- maybeToExcept "server not set in config file" =<< (^? serverConn . _Just . serverHostname . _Just) <$> settings eitherToExcept =<< liftIO (callServer serverHost event `E.catch` wreqErrorHandler) liftIO . TIO.putStrLn $ "Event sent successfully" where mkServerAddr serverHost = "https://" <> T.unpack serverHost <> ":8083" <> path -- convert snippet to json event we can send mkEvent = do p <- eitherToExcept (eitherDecodeStrict' (encodeUtf8 . T.pack $ snippet) :: Either String Value) return $ object ["params" .= p] callServer serverHost event = callWithCookieJar (doCall' serverHost event) $> Right () doCall' serverHost event cookieJar' = do manager' <- newManager $ mkManagerSettings allowSelfSigned Nothing let opts = defaults & cookies .~ (Just cookieJar') & manager .~ (Right manager') postWith opts (mkServerAddr serverHost) event wreqErrorHandler :: HttpException -> IO (Either String ()) wreqErrorHandler (HttpExceptionRequest _ (StatusCodeException s msg)) | s ^. responseStatus . statusCode == 400 = genError msg | otherwise = s ^. responseStatus . statusMessage . to genError where genError = return . Left . ("Error: " <>) . T.unpack . decodeUtf8 wreqErrorHandler e = return . Left . show $ e -- | Wrap up a HTTP Client call to use a file-based cookie jar -- should work for HTTP.Client and Wreq (TODO - move nstack-cli fully to wreq) -- `CookieJar` has well-behaving Show and Read instances so text-based serialisation should work callWithCookieJar :: (CookieJar -> IO (Response body)) -> IO (Response body) callWithCookieJar mkRequest = do cookieFilePath <- getXdgDirectory XdgCache "nstack-session.txt" reqCookieJar <- E.catchJust (guard . isDoesNotExistError) (readFile cookieFilePath >>= (return . read :: String -> IO CookieJar)) (const . return . createCookieJar $ []) res <- mkRequest reqCookieJar -- TODO - we should take in the current cookieJar and update here, wreq should do this automatically -- let (cookieJar', res') = updateCookieJar res createDirectoryIfMissing True (directory cookieFilePath) -- just in case ~/.cache does not exist writeFile cookieFilePath . show . responseCookieJar $ res return res
{ "pile_set_name": "Github" }
/* * * (C) Copyright IBM Corp. 2002-2008 - All Rights Reserved * */ #ifndef __MPREFIXUPS_H #define __MPREFIXUPS_H /** * \file * \internal */ #include "LETypes.h" U_NAMESPACE_BEGIN class LEGlyphStorage; // Might want to make this a private member... struct FixupData; class MPreFixups : public UMemory { public: MPreFixups(le_int32 charCount); ~MPreFixups(); void add(le_int32 baseIndex, le_int32 mpreIndex); void apply(LEGlyphStorage &glyphStorage, LEErrorCode& success); private: FixupData *fFixupData; le_int32 fFixupCount; }; U_NAMESPACE_END #endif
{ "pile_set_name": "Github" }
{ "type":"FeatureCollection", "features":[ { "type":"Feature", "properties":{ }, "geometry":{ "type":"LineString", "coordinates":[ [ -58.4003789, -34.8024187 ], [ -58.4012571, -34.8013012 ] ] } }, { "type":"Feature", "properties":{ }, "geometry":{ "type":"LineString", "coordinates":[ [ -58.4012571, -34.8013012 ], [ -58.4020709, -34.8002564 ] ] } }, { "type":"Feature", "properties":{ }, "geometry":{ "type":"LineString", "coordinates":[ [ -58.4020709, -34.8002564 ], [ -58.4026441, -34.7995347 ] ] } }, { "type":"Feature", "properties":{ }, "geometry":{ "type":"LineString", "coordinates":[ [ -58.4026441, -34.7995347 ], [ -58.4032748, -34.7987421 ] ] } }, { "type":"Feature", "properties":{ }, "geometry":{ "type":"LineString", "coordinates":[ [ -58.4032748, -34.7987421 ], [ -58.40353, -34.7986715 ] ] } }, { "type":"Feature", "properties":{ }, "geometry":{ "type":"LineString", "coordinates":[ [ -58.40353, -34.7986715 ], [ -58.4045643, -34.7970077 ] ] } }, { "type":"Feature", "properties":{ }, "geometry":{ "type":"LineString", "coordinates":[ [ -58.4045643, -34.7970077 ], [ -58.4051217, -34.7960535 ] ] } }, { "type":"Feature", "properties":{ }, "geometry":{ "type":"LineString", "coordinates":[ [ -58.4069531, -34.7970396 ], [ -58.4061007, -34.797642 ] ] } }, { "type":"Feature", "properties":{ }, "geometry":{ "type":"LineString", "coordinates":[ [ -58.4061007, -34.797642 ], [ -58.4054827, -34.7986499 ] ] } }, { "type":"Feature", "properties":{ }, "geometry":{ "type":"LineString", "coordinates":[ [ -58.4054827, -34.7986499 ], [ -58.4043951, -34.7993638 ] ] } }, { "type":"Feature", "properties":{ }, "geometry":{ "type":"LineString", "coordinates":[ [ -58.4043951, -34.7993638 ], [ -58.4037967, -34.8001502 ] ] } }, { "type":"Feature", "properties":{ }, "geometry":{ "type":"LineString", "coordinates":[ [ -58.4037967, -34.8001502 ], [ -58.4032304, -34.80088 ] ] } }, { "type":"Feature", "properties":{ }, "geometry":{ "type":"LineString", "coordinates":[ [ -58.4032304, -34.80088 ], [ -58.4024017, -34.8019585 ] ] } }, { "type":"Feature", "properties":{ }, "geometry":{ "type":"LineString", "coordinates":[ [ -58.4024017, -34.8019585 ], [ -58.4015377, -34.8030708 ] ] } }, { "type":"Feature", "properties":{ }, "geometry":{ "type":"LineString", "coordinates":[ [ -58.3959417, -34.8036499 ], [ -58.395087, -34.8031464 ] ] } }, { "type":"Feature", "properties":{ }, "geometry":{ "type":"LineString", "coordinates":[ [ -58.395087, -34.8031464 ], [ -58.3942128, -34.8026319 ] ] } }, { "type":"Feature", "properties":{ }, "geometry":{ "type":"LineString", "coordinates":[ [ -58.3942128, -34.8026319 ], [ -58.3937803, -34.8023836 ] ] } }, { "type":"Feature", "properties":{ }, "geometry":{ "type":"LineString", "coordinates":[ [ -58.3937803, -34.8023836 ], [ -58.3937374, -34.8023571 ] ] } }, { "type":"Feature", "properties":{ }, "geometry":{ "type":"LineString", "coordinates":[ [ -58.3937374, -34.8023571 ], [ -58.3935525, -34.8022475 ] ] } }, { "type":"Feature", "properties":{ }, "geometry":{ "type":"LineString", "coordinates":[ [ -58.3935525, -34.8022475 ], [ -58.3924396, -34.8015867 ] ] } }, { "type":"Feature", "properties":{ }, "geometry":{ "type":"LineString", "coordinates":[ [ -58.3924396, -34.8015867 ], [ -58.3913232, -34.8009287 ] ] } }, { "type":"Feature", "properties":{ }, "geometry":{ "type":"LineString", "coordinates":[ [ -58.3913232, -34.8009287 ], [ -58.390647, -34.8005306 ] ] } }, { "type":"Feature", "properties":{ }, "geometry":{ "type":"LineString", "coordinates":[ [ -58.3929547, -34.8030144 ], [ -58.3918268, -34.8023406 ] ] } }, { "type":"Feature", "properties":{ }, "geometry":{ "type":"LineString", "coordinates":[ [ -58.3918268, -34.8023406 ], [ -58.39097, -34.8018398 ] ] } }, { "type":"Feature", "properties":{ }, "geometry":{ "type":"LineString", "coordinates":[ [ -58.39097, -34.8018398 ], [ -58.3908824, -34.80173 ] ] } }, { "type":"Feature", "properties":{ }, "geometry":{ "type":"LineString", "coordinates":[ [ -58.3908824, -34.80173 ], [ -58.3907391, -34.8016607 ] ] } }, { "type":"Feature", "properties":{ }, "geometry":{ "type":"LineString", "coordinates":[ [ -58.3935525, -34.8022475 ], [ -58.3929547, -34.8030144 ] ] } }, { "type":"Feature", "properties":{ }, "geometry":{ "type":"LineString", "coordinates":[ [ -58.3929547, -34.8030144 ], [ -58.3919262, -34.8043515 ] ] } }, { "type":"Feature", "properties":{ }, "geometry":{ "type":"LineString", "coordinates":[ [ -58.3919262, -34.8043515 ], [ -58.3912106, -34.805308 ] ] } }, { "type":"Feature", "properties":{ }, "geometry":{ "type":"LineString", "coordinates":[ [ -58.3912106, -34.805308 ], [ -58.3903757, -34.8063186 ] ] } }, { "type":"Feature", "properties":{ }, "geometry":{ "type":"LineString", "coordinates":[ [ -58.3907792, -34.8036757 ], [ -58.3919262, -34.8043515 ] ] } }, { "type":"Feature", "properties":{ }, "geometry":{ "type":"LineString", "coordinates":[ [ -58.3919262, -34.8043515 ], [ -58.3929448, -34.8049413 ] ] } }, { "type":"Feature", "properties":{ }, "geometry":{ "type":"LineString", "coordinates":[ [ -58.3929448, -34.8049413 ], [ -58.3932414, -34.8051253 ] ] } }, { "type":"Feature", "properties":{ }, "geometry":{ "type":"LineString", "coordinates":[ [ -58.3929547, -34.8030144 ], [ -58.3930577, -34.8030849 ] ] } }, { "type":"Feature", "properties":{ }, "geometry":{ "type":"LineString", "coordinates":[ [ -58.3930577, -34.8030849 ], [ -58.3929448, -34.8049413 ] ] } }, { "type":"Feature", "properties":{ }, "geometry":{ "type":"LineString", "coordinates":[ [ -58.3929448, -34.8049413 ], [ -58.3929333, -34.8056958 ] ] } }, { "type":"Feature", "properties":{ }, "geometry":{ "type":"LineString", "coordinates":[ [ -58.3929333, -34.8056958 ], [ -58.3925604, -34.8061236 ] ] } }, { "type":"Feature", "properties":{ }, "geometry":{ "type":"LineString", "coordinates":[ [ -58.3925604, -34.8061236 ], [ -58.3917149, -34.8070982 ] ] } }, { "type":"Feature", "properties":{ }, "geometry":{ "type":"LineString", "coordinates":[ [ -58.3917149, -34.8070982 ], [ -58.3906765, -34.8083226 ] ] } }, { "type":"Feature", "properties":{ }, "geometry":{ "type":"LineString", "coordinates":[ [ -58.3906765, -34.8083226 ], [ -58.3906293, -34.8083765 ] ] } }, { "type":"Feature", "properties":{ }, "geometry":{ "type":"LineString", "coordinates":[ [ -58.3906293, -34.8083765 ], [ -58.3905693, -34.8089708 ] ] } }, { "type":"Feature", "properties":{ }, "geometry":{ "type":"LineString", "coordinates":[ [ -58.3931006, -34.8064748 ], [ -58.3925604, -34.8061236 ] ] } }, { "type":"Feature", "properties":{ }, "geometry":{ "type":"LineString", "coordinates":[ [ -58.3925604, -34.8061236 ], [ -58.3912106, -34.805308 ] ] } }, { "type":"Feature", "properties":{ }, "geometry":{ "type":"LineString", "coordinates":[ [ -58.3912106, -34.805308 ], [ -58.3900486, -34.8046158 ] ] } }, { "type":"Feature", "properties":{ }, "geometry":{ "type":"LineString", "coordinates":[ [ -58.3900486, -34.8046158 ], [ -58.3887181, -34.8038776 ] ] } }, { "type":"Feature", "properties":{ }, "geometry":{ "type":"LineString", "coordinates":[ [ -58.3954262, -34.7994934 ], [ -58.3962631, -34.7999826 ] ] } }, { "type":"Feature", "properties":{ }, "geometry":{ "type":"LineString", "coordinates":[ [ -58.3962631, -34.7999826 ], [ -58.3963617, -34.8000402 ] ] } }, { "type":"Feature", "properties":{ }, "geometry":{ "type":"LineString", "coordinates":[ [ -58.3963617, -34.8000402 ], [ -58.3977629, -34.8008817 ] ] } }, { "type":"Feature", "properties":{ }, "geometry":{ "type":"LineString", "coordinates":[ [ -58.3977629, -34.8008817 ], [ -58.3980104, -34.8010326 ] ] } }, { "type":"Feature", "properties":{ }, "geometry":{ "type":"LineString", "coordinates":[ [ -58.4056871, -34.803814 ], [ -58.40459, -34.8031917 ] ] } }, { "type":"Feature", "properties":{ }, "geometry":{ "type":"LineString", "coordinates":[ [ -58.40459, -34.8031917 ], [ -58.4035424, -34.8026119 ] ] } }, { "type":"Feature", "properties":{ }, "geometry":{ "type":"LineString", "coordinates":[ [ -58.4035424, -34.8026119 ], [ -58.4024017, -34.8019585 ] ] } }, { "type":"Feature", "properties":{ }, "geometry":{ "type":"LineString", "coordinates":[ [ -58.4024017, -34.8019585 ], [ -58.4012571, -34.8013012 ] ] } }, { "type":"Feature", "properties":{ }, "geometry":{ "type":"LineString", "coordinates":[ [ -58.4012571, -34.8013012 ], [ -58.4003196, -34.8007694 ] ] } }, { "type":"Feature", "properties":{ }, "geometry":{ "type":"LineString", "coordinates":[ [ -58.4003196, -34.8007694 ], [ -58.4000651, -34.800625 ] ] } }, { "type":"Feature", "properties":{ }, "geometry":{ "type":"LineString", "coordinates":[ [ -58.4000651, -34.800625 ], [ -58.3994936, -34.8003009 ] ] } }, { "type":"Feature", "properties":{ }, "geometry":{ "type":"LineString", "coordinates":[ [ -58.4005863, -34.7973807 ], [ -58.3999811, -34.7981126 ] ] } }, { "type":"Feature", "properties":{ }, "geometry":{ "type":"LineString", "coordinates":[ [ -58.3999811, -34.7981126 ], [ -58.3994224, -34.7987983 ] ] } }, { "type":"Feature", "properties":{ }, "geometry":{ "type":"LineString", "coordinates":[ [ -58.3994224, -34.7987983 ], [ -58.3991078, -34.7991665 ] ] } }, { "type":"Feature", "properties":{ }, "geometry":{ "type":"LineString", "coordinates":[ [ -58.3991078, -34.7991665 ], [ -58.3986112, -34.7998147 ] ] } }, { "type":"Feature", "properties":{ }, "geometry":{ "type":"LineString", "coordinates":[ [ -58.3986112, -34.7998147 ], [ -58.3980853, -34.8004779 ] ] } }, { "type":"Feature", "properties":{ }, "geometry":{ "type":"LineString", "coordinates":[ [ -58.3980853, -34.8004779 ], [ -58.3977629, -34.8008817 ] ] } }, { "type":"Feature", "properties":{ }, "geometry":{ "type":"LineString", "coordinates":[ [ -58.4000651, -34.800625 ], [ -58.4008757, -34.7995904 ] ] } }, { "type":"Feature", "properties":{ }, "geometry":{ "type":"LineString", "coordinates":[ [ -58.4008757, -34.7995904 ], [ -58.4014189, -34.7988802 ] ] } }, { "type":"Feature", "properties":{ }, "geometry":{ "type":"LineString", "coordinates":[ [ -58.4014189, -34.7988802 ], [ -58.4020013, -34.7981301 ] ] } }, { "type":"Feature", "properties":{ }, "geometry":{ "type":"LineString", "coordinates":[ [ -58.4003196, -34.8007694 ], [ -58.399452, -34.8018971 ] ] } }, { "type":"Feature", "properties":{ }, "geometry":{ "type":"LineString", "coordinates":[ [ -58.3940899, -34.8003361 ], [ -58.3945242, -34.8006035 ] ] } }, { "type":"Feature", "properties":{ }, "geometry":{ "type":"LineString", "coordinates":[ [ -58.4001253, -34.8060931 ], [ -58.400154, -34.8060524 ] ] } }, { "type":"Feature", "properties":{ }, "geometry":{ "type":"LineString", "coordinates":[ [ -58.400154, -34.8060524 ], [ -58.400195, -34.8060195 ] ] } }, { "type":"Feature", "properties":{ }, "geometry":{ "type":"LineString", "coordinates":[ [ -58.400195, -34.8060195 ], [ -58.4002453, -34.805997 ] ] } }, { "type":"Feature", "properties":{ }, "geometry":{ "type":"LineString", "coordinates":[ [ -58.4002453, -34.805997 ], [ -58.4003011, -34.8059864 ] ] } }, { "type":"Feature", "properties":{ }, "geometry":{ "type":"LineString", "coordinates":[ [ -58.4003011, -34.8059864 ], [ -58.4003583, -34.8059886 ] ] } }, { "type":"Feature", "properties":{ }, "geometry":{ "type":"LineString", "coordinates":[ [ -58.4003583, -34.8059886 ], [ -58.4004127, -34.8060034 ] ] } }, { "type":"Feature", "properties":{ }, "geometry":{ "type":"LineString", "coordinates":[ [ -58.4004127, -34.8060034 ], [ -58.4004602, -34.8060297 ] ] } }, { "type":"Feature", "properties":{ }, "geometry":{ "type":"LineString", "coordinates":[ [ -58.4004602, -34.8060297 ], [ -58.4005021, -34.8060719 ] ] } }, { "type":"Feature", "properties":{ }, "geometry":{ "type":"LineString", "coordinates":[ [ -58.4005021, -34.8060719 ], [ -58.4005258, -34.8061227 ] ] } }, { "type":"Feature", "properties":{ }, "geometry":{ "type":"LineString", "coordinates":[ [ -58.4005258, -34.8061227 ], [ -58.4005291, -34.806177 ] ] } }, { "type":"Feature", "properties":{ }, "geometry":{ "type":"LineString", "coordinates":[ [ -58.4005291, -34.806177 ], [ -58.4005117, -34.8062295 ] ] } }, { "type":"Feature", "properties":{ }, "geometry":{ "type":"LineString", "coordinates":[ [ -58.4005117, -34.8062295 ], [ -58.4004752, -34.806275 ] ] } }, { "type":"Feature", "properties":{ }, "geometry":{ "type":"LineString", "coordinates":[ [ -58.4004602, -34.8060297 ], [ -58.4013091, -34.8049401 ] ] } }, { "type":"Feature", "properties":{ }, "geometry":{ "type":"LineString", "coordinates":[ [ -58.4013091, -34.8049401 ], [ -58.4015784, -34.8046036 ] ] } }, { "type":"Feature", "properties":{ }, "geometry":{ "type":"LineString", "coordinates":[ [ -58.4015784, -34.8046036 ], [ -58.4024151, -34.8035586 ] ] } }, { "type":"Feature", "properties":{ }, "geometry":{ "type":"LineString", "coordinates":[ [ -58.3941494, -34.8144285 ], [ -58.3947151, -34.8135927 ] ] } }, { "type":"Feature", "properties":{ }, "geometry":{ "type":"LineString", "coordinates":[ [ -58.3947151, -34.8135927 ], [ -58.39521, -34.8128913 ] ] } }, { "type":"Feature", "properties":{ }, "geometry":{ "type":"LineString", "coordinates":[ [ -58.39521, -34.8128913 ], [ -58.3961515, -34.8116469 ] ] } }, { "type":"Feature", "properties":{ }, "geometry":{ "type":"LineString", "coordinates":[ [ -58.3961515, -34.8116469 ], [ -58.3966281, -34.8110239 ] ] } }, { "type":"Feature", "properties":{ }, "geometry":{ "type":"LineString", "coordinates":[ [ -58.3966281, -34.8110239 ], [ -58.3970574, -34.8104706 ] ] } }, { "type":"Feature", "properties":{ }, "geometry":{ "type":"LineString", "coordinates":[ [ -58.3970574, -34.8104706 ], [ -58.3970575, -34.8103726 ] ] } }, { "type":"Feature", "properties":{ }, "geometry":{ "type":"LineString", "coordinates":[ [ -58.3970575, -34.8103726 ], [ -58.3978259, -34.8093579 ] ] } }, { "type":"Feature", "properties":{ }, "geometry":{ "type":"LineString", "coordinates":[ [ -58.3978259, -34.8093579 ], [ -58.3985907, -34.8083664 ] ] } }, { "type":"Feature", "properties":{ }, "geometry":{ "type":"LineString", "coordinates":[ [ -58.3985907, -34.8083664 ], [ -58.3993749, -34.8073699 ] ] } }, { "type":"Feature", "properties":{ }, "geometry":{ "type":"LineString", "coordinates":[ [ -58.3993749, -34.8073699 ], [ -58.400226, -34.8063129 ] ] } }, { "type":"Feature", "properties":{ }, "geometry":{ "type":"LineString", "coordinates":[ [ -58.4028696, -34.8075087 ], [ -58.4015378, -34.8068225 ] ] } }, { "type":"Feature", "properties":{ }, "geometry":{ "type":"LineString", "coordinates":[ [ -58.4015378, -34.8068225 ], [ -58.4004752, -34.806275 ] ] } }, { "type":"Feature", "properties":{ }, "geometry":{ "type":"LineString", "coordinates":[ [ -58.4013631, -34.8029699 ], [ -58.4005424, -34.8040087 ] ] } }, { "type":"Feature", "properties":{ }, "geometry":{ "type":"LineString", "coordinates":[ [ -58.4005424, -34.8040087 ], [ -58.399244, -34.8055954 ] ] } }, { "type":"Feature", "properties":{ }, "geometry":{ "type":"LineString", "coordinates":[ [ -58.399244, -34.8055954 ], [ -58.3983081, -34.806706 ] ] } }, { "type":"Feature", "properties":{ }, "geometry":{ "type":"LineString", "coordinates":[ [ -58.3983081, -34.806706 ], [ -58.3974713, -34.8077069 ] ] } }, { "type":"Feature", "properties":{ }, "geometry":{ "type":"LineString", "coordinates":[ [ -58.3974713, -34.8077069 ], [ -58.3966454, -34.8086947 ] ] } }, { "type":"Feature", "properties":{ }, "geometry":{ "type":"LineString", "coordinates":[ [ -58.4011968, -34.8097556 ], [ -58.4000438, -34.809165 ] ] } }, { "type":"Feature", "properties":{ }, "geometry":{ "type":"LineString", "coordinates":[ [ -58.4000438, -34.809165 ], [ -58.3999022, -34.8090924 ] ] } }, { "type":"Feature", "properties":{ }, "geometry":{ "type":"LineString", "coordinates":[ [ -58.3999022, -34.8090924 ], [ -58.3998633, -34.8090725 ] ] } }, { "type":"Feature", "properties":{ }, "geometry":{ "type":"LineString", "coordinates":[ [ -58.3998633, -34.8090725 ], [ -58.3985907, -34.8083664 ] ] } }, { "type":"Feature", "properties":{ }, "geometry":{ "type":"LineString", "coordinates":[ [ -58.3985907, -34.8083664 ], [ -58.3974713, -34.8077069 ] ] } }, { "type":"Feature", "properties":{ }, "geometry":{ "type":"LineString", "coordinates":[ [ -58.3974713, -34.8077069 ], [ -58.3964129, -34.8070746 ] ] } }, { "type":"Feature", "properties":{ }, "geometry":{ "type":"LineString", "coordinates":[ [ -58.3964129, -34.8070746 ], [ -58.3949373, -34.8061929 ] ] } }, { "type":"Feature", "properties":{ }, "geometry":{ "type":"LineString", "coordinates":[ [ -58.3949373, -34.8061929 ], [ -58.3941477, -34.8057278 ] ] } }, { "type":"Feature", "properties":{ }, "geometry":{ "type":"LineString", "coordinates":[ [ -58.4015784, -34.8046036 ], [ -58.4005424, -34.8040087 ] ] } }, { "type":"Feature", "properties":{ }, "geometry":{ "type":"LineString", "coordinates":[ [ -58.4005424, -34.8040087 ], [ -58.3994805, -34.8033989 ] ] } }, { "type":"Feature", "properties":{ }, "geometry":{ "type":"LineString", "coordinates":[ [ -58.3994805, -34.8033989 ], [ -58.398366, -34.8027589 ] ] } }, { "type":"Feature", "properties":{ }, "geometry":{ "type":"LineString", "coordinates":[ [ -58.398366, -34.8027589 ], [ -58.3971802, -34.8020789 ] ] } }, { "type":"Feature", "properties":{ }, "geometry":{ "type":"LineString", "coordinates":[ [ -58.3980104, -34.8010326 ], [ -58.3971802, -34.8020789 ] ] } }, { "type":"Feature", "properties":{ }, "geometry":{ "type":"LineString", "coordinates":[ [ -58.3971802, -34.8020789 ], [ -58.3969642, -34.8023356 ] ] } }, { "type":"Feature", "properties":{ }, "geometry":{ "type":"LineString", "coordinates":[ [ -58.3969642, -34.8023356 ], [ -58.3964727, -34.8029764 ] ] } }, { "type":"Feature", "properties":{ }, "geometry":{ "type":"LineString", "coordinates":[ [ -58.3964727, -34.8029764 ], [ -58.3959417, -34.8036499 ] ] } }, { "type":"Feature", "properties":{ }, "geometry":{ "type":"LineString", "coordinates":[ [ -58.3952781, -34.8013356 ], [ -58.3969642, -34.8023356 ] ] } }, { "type":"Feature", "properties":{ }, "geometry":{ "type":"LineString", "coordinates":[ [ -58.395087, -34.8031464 ], [ -58.3942164, -34.8042266 ] ] } }, { "type":"Feature", "properties":{ }, "geometry":{ "type":"LineString", "coordinates":[ [ -58.3942164, -34.8042266 ], [ -58.3935984, -34.8050019 ] ] } }, { "type":"Feature", "properties":{ }, "geometry":{ "type":"LineString", "coordinates":[ [ -58.3942164, -34.8042266 ], [ -58.3949969, -34.8047067 ] ] } }, { "type":"Feature", "properties":{ }, "geometry":{ "type":"LineString", "coordinates":[ [ -58.3949969, -34.8047067 ], [ -58.3957427, -34.8051655 ] ] } }, { "type":"Feature", "properties":{ }, "geometry":{ "type":"LineString", "coordinates":[ [ -58.3957427, -34.8051655 ], [ -58.3972354, -34.8060837 ] ] } }, { "type":"Feature", "properties":{ }, "geometry":{ "type":"LineString", "coordinates":[ [ -58.3972354, -34.8060837 ], [ -58.3983081, -34.806706 ] ] } }, { "type":"Feature", "properties":{ }, "geometry":{ "type":"LineString", "coordinates":[ [ -58.3983081, -34.806706 ], [ -58.3993749, -34.8073699 ] ] } }, { "type":"Feature", "properties":{ }, "geometry":{ "type":"LineString", "coordinates":[ [ -58.396618, -34.8040484 ], [ -58.3957427, -34.8051655 ] ] } }, { "type":"Feature", "properties":{ }, "geometry":{ "type":"LineString", "coordinates":[ [ -58.3957427, -34.8051655 ], [ -58.3949373, -34.8061929 ] ] } }, { "type":"Feature", "properties":{ }, "geometry":{ "type":"LineString", "coordinates":[ [ -58.3949373, -34.8061929 ], [ -58.3941987, -34.8071883 ] ] } }, { "type":"Feature", "properties":{ }, "geometry":{ "type":"LineString", "coordinates":[ [ -58.3941987, -34.8071883 ], [ -58.3934596, -34.8080828 ] ] } }, { "type":"Feature", "properties":{ }, "geometry":{ "type":"LineString", "coordinates":[ [ -58.3934596, -34.8080828 ], [ -58.393423, -34.8082664 ] ] } }, { "type":"Feature", "properties":{ }, "geometry":{ "type":"LineString", "coordinates":[ [ -58.398366, -34.8027589 ], [ -58.3976747, -34.8036356 ] ] } }, { "type":"Feature", "properties":{ }, "geometry":{ "type":"LineString", "coordinates":[ [ -58.3976747, -34.8036356 ], [ -58.3971168, -34.8043422 ] ] } }, { "type":"Feature", "properties":{ }, "geometry":{ "type":"LineString", "coordinates":[ [ -58.3987746, -34.8042389 ], [ -58.3976747, -34.8036356 ] ] } }, { "type":"Feature", "properties":{ }, "geometry":{ "type":"LineString", "coordinates":[ [ -58.3976747, -34.8036356 ], [ -58.3964727, -34.8029764 ] ] } }, { "type":"Feature", "properties":{ }, "geometry":{ "type":"LineString", "coordinates":[ [ -58.4013091, -34.8049401 ], [ -58.4025396, -34.8055669 ] ] } }, { "type":"Feature", "properties":{ }, "geometry":{ "type":"LineString", "coordinates":[ [ -58.4025396, -34.8055669 ], [ -58.4038371, -34.8062277 ] ] } }, { "type":"Feature", "properties":{ }, "geometry":{ "type":"LineString", "coordinates":[ [ -58.3891946, -34.8056311 ], [ -58.3900486, -34.8046158 ] ] } }, { "type":"Feature", "properties":{ }, "geometry":{ "type":"LineString", "coordinates":[ [ -58.3900486, -34.8046158 ], [ -58.3904782, -34.804065 ] ] } }, { "type":"Feature", "properties":{ }, "geometry":{ "type":"LineString", "coordinates":[ [ -58.3904782, -34.804065 ], [ -58.3907792, -34.8036757 ] ] } }, { "type":"Feature", "properties":{ }, "geometry":{ "type":"LineString", "coordinates":[ [ -58.3907792, -34.8036757 ], [ -58.3918268, -34.8023406 ] ] } }, { "type":"Feature", "properties":{ }, "geometry":{ "type":"LineString", "coordinates":[ [ -58.3918268, -34.8023406 ], [ -58.3924396, -34.8015867 ] ] } }, { "type":"Feature", "properties":{ }, "geometry":{ "type":"LineString", "coordinates":[ [ -58.3924396, -34.8015867 ], [ -58.3931521, -34.8007371 ] ] } }, { "type":"Feature", "properties":{ }, "geometry":{ "type":"LineString", "coordinates":[ [ -58.3931521, -34.8007371 ], [ -58.3935142, -34.8002063 ] ] } }, { "type":"Feature", "properties":{ }, "geometry":{ "type":"LineString", "coordinates":[ [ -58.3935142, -34.8002063 ], [ -58.3935793, -34.800023 ] ] } }, { "type":"Feature", "properties":{ }, "geometry":{ "type":"LineString", "coordinates":[ [ -58.3938917, -34.8002224 ], [ -58.3935793, -34.800023 ] ] } }, { "type":"Feature", "properties":{ }, "geometry":{ "type":"LineString", "coordinates":[ [ -58.3930397, -34.7987714 ], [ -58.393525, -34.7990038 ] ] } }, { "type":"Feature", "properties":{ }, "geometry":{ "type":"LineString", "coordinates":[ [ -58.393525, -34.7990038 ], [ -58.3935706, -34.7990412 ] ] } }, { "type":"Feature", "properties":{ }, "geometry":{ "type":"LineString", "coordinates":[ [ -58.3935706, -34.7990412 ], [ -58.3936001, -34.7990765 ] ] } }, { "type":"Feature", "properties":{ }, "geometry":{ "type":"LineString", "coordinates":[ [ -58.3936001, -34.7990765 ], [ -58.3936215, -34.7991227 ] ] } }, { "type":"Feature", "properties":{ }, "geometry":{ "type":"LineString", "coordinates":[ [ -58.3936215, -34.7991227 ], [ -58.3936376, -34.7991734 ] ] } }, { "type":"Feature", "properties":{ }, "geometry":{ "type":"LineString", "coordinates":[ [ -58.3936376, -34.7991734 ], [ -58.3936457, -34.7992395 ] ] } }, { "type":"Feature", "properties":{ }, "geometry":{ "type":"LineString", "coordinates":[ [ -58.3936457, -34.7992395 ], [ -58.393643, -34.7993122 ] ] } }, { "type":"Feature", "properties":{ }, "geometry":{ "type":"LineString", "coordinates":[ [ -58.393643, -34.7993122 ], [ -58.3936376, -34.7994289 ] ] } }, { "type":"Feature", "properties":{ }, "geometry":{ "type":"LineString", "coordinates":[ [ -58.3936376, -34.7994289 ], [ -58.3935793, -34.800023 ] ] } }, { "type":"Feature", "properties":{ }, "geometry":{ "type":"LineString", "coordinates":[ [ -58.3986617, -34.8014125 ], [ -58.3990591, -34.8008188 ] ] } }, { "type":"Feature", "properties":{ }, "geometry":{ "type":"LineString", "coordinates":[ [ -58.3990591, -34.8008188 ], [ -58.3994936, -34.8003009 ] ] } }, { "type":"Feature", "properties":{ }, "geometry":{ "type":"LineString", "coordinates":[ [ -58.3935636, -34.8067511 ], [ -58.3935559, -34.8065149 ] ] } }, { "type":"Feature", "properties":{ }, "geometry":{ "type":"LineString", "coordinates":[ [ -58.3935559, -34.8065149 ], [ -58.3941477, -34.8057278 ] ] } }, { "type":"Feature", "properties":{ }, "geometry":{ "type":"LineString", "coordinates":[ [ -58.3941477, -34.8057278 ], [ -58.3949969, -34.8047067 ] ] } }, { "type":"Feature", "properties":{ }, "geometry":{ "type":"LineString", "coordinates":[ [ -58.3949969, -34.8047067 ], [ -58.3955515, -34.8040306 ] ] } }, { "type":"Feature", "properties":{ }, "geometry":{ "type":"LineString", "coordinates":[ [ -58.3930098, -34.8116828 ], [ -58.3930233, -34.8114078 ] ] } }, { "type":"Feature", "properties":{ }, "geometry":{ "type":"LineString", "coordinates":[ [ -58.3930233, -34.8114078 ], [ -58.3938559, -34.8103296 ] ] } }, { "type":"Feature", "properties":{ }, "geometry":{ "type":"LineString", "coordinates":[ [ -58.3938559, -34.8103296 ], [ -58.3948057, -34.8091206 ] ] } }, { "type":"Feature", "properties":{ }, "geometry":{ "type":"LineString", "coordinates":[ [ -58.3948057, -34.8091206 ], [ -58.3956137, -34.8080702 ] ] } }, { "type":"Feature", "properties":{ }, "geometry":{ "type":"LineString", "coordinates":[ [ -58.3956137, -34.8080702 ], [ -58.3964129, -34.8070746 ] ] } }, { "type":"Feature", "properties":{ }, "geometry":{ "type":"LineString", "coordinates":[ [ -58.3964129, -34.8070746 ], [ -58.3966681, -34.8067671 ] ] } }, { "type":"Feature", "properties":{ }, "geometry":{ "type":"LineString", "coordinates":[ [ -58.3966681, -34.8067671 ], [ -58.3972354, -34.8060837 ] ] } }, { "type":"Feature", "properties":{ }, "geometry":{ "type":"LineString", "coordinates":[ [ -58.3972354, -34.8060837 ], [ -58.3981728, -34.8049644 ] ] } }, { "type":"Feature", "properties":{ }, "geometry":{ "type":"LineString", "coordinates":[ [ -58.3981728, -34.8049644 ], [ -58.3987746, -34.8042389 ] ] } }, { "type":"Feature", "properties":{ }, "geometry":{ "type":"LineString", "coordinates":[ [ -58.3987746, -34.8042389 ], [ -58.3994805, -34.8033989 ] ] } }, { "type":"Feature", "properties":{ }, "geometry":{ "type":"LineString", "coordinates":[ [ -58.3945242, -34.8006035 ], [ -58.3939846, -34.8012736 ] ] } }, { "type":"Feature", "properties":{ }, "geometry":{ "type":"LineString", "coordinates":[ [ -58.3966681, -34.8067671 ], [ -58.3972482, -34.8070924 ] ] } }, { "type":"Feature", "properties":{ }, "geometry":{ "type":"LineString", "coordinates":[ [ -58.3986617, -34.8014125 ], [ -58.399452, -34.8018971 ] ] } }, { "type":"Feature", "properties":{ }, "geometry":{ "type":"LineString", "coordinates":[ [ -58.399452, -34.8018971 ], [ -58.4003357, -34.8023944 ] ] } }, { "type":"Feature", "properties":{ }, "geometry":{ "type":"LineString", "coordinates":[ [ -58.4003357, -34.8023944 ], [ -58.4003789, -34.8024187 ] ] } }, { "type":"Feature", "properties":{ }, "geometry":{ "type":"LineString", "coordinates":[ [ -58.4003789, -34.8024187 ], [ -58.4013631, -34.8029699 ] ] } }, { "type":"Feature", "properties":{ }, "geometry":{ "type":"LineString", "coordinates":[ [ -58.4013631, -34.8029699 ], [ -58.4015377, -34.8030708 ] ] } }, { "type":"Feature", "properties":{ }, "geometry":{ "type":"LineString", "coordinates":[ [ -58.4015377, -34.8030708 ], [ -58.4024151, -34.8035586 ] ] } }, { "type":"Feature", "properties":{ }, "geometry":{ "type":"LineString", "coordinates":[ [ -58.4024151, -34.8035586 ], [ -58.4026791, -34.8037053 ] ] } }, { "type":"Feature", "properties":{ }, "geometry":{ "type":"LineString", "coordinates":[ [ -58.4026791, -34.8037053 ], [ -58.4036115, -34.8042237 ] ] } }, { "type":"Feature", "properties":{ }, "geometry":{ "type":"LineString", "coordinates":[ [ -58.4036115, -34.8042237 ], [ -58.4037436, -34.8042971 ] ] } }, { "type":"Feature", "properties":{ }, "geometry":{ "type":"LineString", "coordinates":[ [ -58.4037436, -34.8042971 ], [ -58.4048825, -34.804862 ] ] } }, { "type":"Feature", "properties":{ }, "geometry":{ "type":"LineString", "coordinates":[ [ -58.3994936, -34.8003009 ], [ -58.3986112, -34.7998147 ] ] } }, { "type":"Feature", "properties":{ }, "geometry":{ "type":"LineString", "coordinates":[ [ -58.3986112, -34.7998147 ], [ -58.3972001, -34.799019 ] ] } }, { "type":"Feature", "properties":{ }, "geometry":{ "type":"LineString", "coordinates":[ [ -58.3972001, -34.799019 ], [ -58.3962705, -34.798502 ] ] } }, { "type":"Feature", "properties":{ }, "geometry":{ "type":"LineString", "coordinates":[ [ -58.3935793, -34.800023 ], [ -58.392493, -34.7994585 ] ] } }, { "type":"Feature", "properties":{ }, "geometry":{ "type":"LineString", "coordinates":[ [ -58.392493, -34.7994585 ], [ -58.3917332, -34.7990214 ] ] } }, { "type":"Feature", "properties":{ }, "geometry":{ "type":"LineString", "coordinates":[ [ -58.3917332, -34.7990214 ], [ -58.3913394, -34.7988011 ] ] } }, { "type":"Feature", "properties":{ }, "geometry":{ "type":"LineString", "coordinates":[ [ -58.3913394, -34.7988011 ], [ -58.3912913, -34.7986684 ] ] } }, { "type":"Feature", "properties":{ }, "geometry":{ "type":"LineString", "coordinates":[ [ -58.3942128, -34.8026319 ], [ -58.3952781, -34.8013356 ] ] } }, { "type":"Feature", "properties":{ }, "geometry":{ "type":"LineString", "coordinates":[ [ -58.3952781, -34.8013356 ], [ -58.3954312, -34.8011493 ] ] } }, { "type":"Feature", "properties":{ }, "geometry":{ "type":"LineString", "coordinates":[ [ -58.3954312, -34.8011493 ], [ -58.3963617, -34.8000402 ] ] } }, { "type":"Feature", "properties":{ }, "geometry":{ "type":"LineString", "coordinates":[ [ -58.3963617, -34.8000402 ], [ -58.3972001, -34.799019 ] ] } }, { "type":"Feature", "properties":{ }, "geometry":{ "type":"LineString", "coordinates":[ [ -58.3966454, -34.8086947 ], [ -58.3956137, -34.8080702 ] ] } }, { "type":"Feature", "properties":{ }, "geometry":{ "type":"LineString", "coordinates":[ [ -58.3956137, -34.8080702 ], [ -58.3941987, -34.8071883 ] ] } }, { "type":"Feature", "properties":{ }, "geometry":{ "type":"LineString", "coordinates":[ [ -58.3941987, -34.8071883 ], [ -58.3935636, -34.8067511 ] ] } }, { "type":"Feature", "properties":{ }, "geometry":{ "type":"LineString", "coordinates":[ [ -58.3945242, -34.8006035 ], [ -58.3954312, -34.8011493 ] ] } }, { "type":"Feature", "properties":{ }, "geometry":{ "type":"LineString", "coordinates":[ [ -58.3980104, -34.8010326 ], [ -58.3983132, -34.8012066 ] ] } }, { "type":"Feature", "properties":{ }, "geometry":{ "type":"LineString", "coordinates":[ [ -58.3983132, -34.8012066 ], [ -58.3986617, -34.8014125 ] ] } }, { "type":"Feature", "properties":{ }, "geometry":{ "type":"LineString", "coordinates":[ [ -58.3941728, -34.7987608 ], [ -58.3942795, -34.7988258 ] ] } }, { "type":"Feature", "properties":{ }, "geometry":{ "type":"LineString", "coordinates":[ [ -58.3942795, -34.7988258 ], [ -58.3945157, -34.7989646 ] ] } }, { "type":"Feature", "properties":{ }, "geometry":{ "type":"LineString", "coordinates":[ [ -58.3945157, -34.7989646 ], [ -58.3954262, -34.7994934 ] ] } }, { "type":"Feature", "properties":{ }, "geometry":{ "type":"LineString", "coordinates":[ [ -58.4001253, -34.8060931 ], [ -58.399244, -34.8055954 ] ] } }, { "type":"Feature", "properties":{ }, "geometry":{ "type":"LineString", "coordinates":[ [ -58.399244, -34.8055954 ], [ -58.3981728, -34.8049644 ] ] } }, { "type":"Feature", "properties":{ }, "geometry":{ "type":"LineString", "coordinates":[ [ -58.3981728, -34.8049644 ], [ -58.3971168, -34.8043422 ] ] } }, { "type":"Feature", "properties":{ }, "geometry":{ "type":"LineString", "coordinates":[ [ -58.3971168, -34.8043422 ], [ -58.396618, -34.8040484 ] ] } }, { "type":"Feature", "properties":{ }, "geometry":{ "type":"LineString", "coordinates":[ [ -58.396618, -34.8040484 ], [ -58.3959417, -34.8036499 ] ] } }, { "type":"Feature", "properties":{ }, "geometry":{ "type":"LineString", "coordinates":[ [ -58.3962705, -34.798502 ], [ -58.3954262, -34.7994934 ] ] } }, { "type":"Feature", "properties":{ }, "geometry":{ "type":"LineString", "coordinates":[ [ -58.3954262, -34.7994934 ], [ -58.3945242, -34.8006035 ] ] } }, { "type":"Feature", "properties":{ }, "geometry":{ "type":"LineString", "coordinates":[ [ -58.4004752, -34.806275 ], [ -58.4004221, -34.8063094 ] ] } }, { "type":"Feature", "properties":{ }, "geometry":{ "type":"LineString", "coordinates":[ [ -58.4004221, -34.8063094 ], [ -58.4003584, -34.8063282 ] ] } }, { "type":"Feature", "properties":{ }, "geometry":{ "type":"LineString", "coordinates":[ [ -58.4003584, -34.8063282 ], [ -58.4002907, -34.8063294 ] ] } }, { "type":"Feature", "properties":{ }, "geometry":{ "type":"LineString", "coordinates":[ [ -58.4002907, -34.8063294 ], [ -58.400226, -34.8063129 ] ] } }, { "type":"Feature", "properties":{ }, "geometry":{ "type":"LineString", "coordinates":[ [ -58.400226, -34.8063129 ], [ -58.4001748, -34.8062833 ] ] } }, { "type":"Feature", "properties":{ }, "geometry":{ "type":"LineString", "coordinates":[ [ -58.4001748, -34.8062833 ], [ -58.4001364, -34.8062426 ] ] } }, { "type":"Feature", "properties":{ }, "geometry":{ "type":"LineString", "coordinates":[ [ -58.4001364, -34.8062426 ], [ -58.4001143, -34.8061945 ] ] } }, { "type":"Feature", "properties":{ }, "geometry":{ "type":"LineString", "coordinates":[ [ -58.4001143, -34.8061945 ], [ -58.4001105, -34.8061431 ] ] } }, { "type":"Feature", "properties":{ }, "geometry":{ "type":"LineString", "coordinates":[ [ -58.4001105, -34.8061431 ], [ -58.4001253, -34.8060931 ] ] } } ] }
{ "pile_set_name": "Github" }
package sharedcheck import ( "go/ast" "go/types" "golang.org/x/tools/go/analysis" "honnef.co/go/tools/internal/passes/buildssa" . "honnef.co/go/tools/lint/lintdsl" "honnef.co/go/tools/ssa" ) func CheckRangeStringRunes(pass *analysis.Pass) (interface{}, error) { for _, ssafn := range pass.ResultOf[buildssa.Analyzer].(*buildssa.SSA).SrcFuncs { fn := func(node ast.Node) bool { rng, ok := node.(*ast.RangeStmt) if !ok || !IsBlank(rng.Key) { return true } v, _ := ssafn.ValueForExpr(rng.X) // Check that we're converting from string to []rune val, _ := v.(*ssa.Convert) if val == nil { return true } Tsrc, ok := val.X.Type().(*types.Basic) if !ok || Tsrc.Kind() != types.String { return true } Tdst, ok := val.Type().(*types.Slice) if !ok { return true } TdstElem, ok := Tdst.Elem().(*types.Basic) if !ok || TdstElem.Kind() != types.Int32 { return true } // Check that the result of the conversion is only used to // range over refs := val.Referrers() if refs == nil { return true } // Expect two refs: one for obtaining the length of the slice, // one for accessing the elements if len(FilterDebug(*refs)) != 2 { // TODO(dh): right now, we check that only one place // refers to our slice. This will miss cases such as // ranging over the slice twice. Ideally, we'd ensure that // the slice is only used for ranging over (without // accessing the key), but that is harder to do because in // SSA form, ranging over a slice looks like an ordinary // loop with index increments and slice accesses. We'd // have to look at the associated AST node to check that // it's a range statement. return true } pass.Reportf(rng.Pos(), "should range over string, not []rune(string)") return true } Inspect(ssafn.Syntax(), fn) } return nil, nil }
{ "pile_set_name": "Github" }
/// Copyright (c) 2012 Ecma International. All rights reserved. /// Ecma International makes this code available under the terms and conditions set /// forth on http://hg.ecmascript.org/tests/test262/raw-file/tip/LICENSE (the /// "Use Terms"). Any redistribution of this code must retain the above /// copyright and this notice and otherwise comply with the Use Terms. /** * @path ch15/15.2/15.2.3/15.2.3.7/15.2.3.7-5-b-102.js * @description Object.defineProperties - value of 'configurable' property of 'descObj' is the Math object (8.10.5 step 4.b) */ function testcase() { var obj = {}; Object.defineProperties(obj, { property: { configurable: Math } }); var preCheck = obj.hasOwnProperty("property"); delete obj.property; return preCheck && !obj.hasOwnProperty("property"); } runTestCase(testcase);
{ "pile_set_name": "Github" }
if ($.fn.pagination){ $.fn.pagination.defaults.beforePageText = 'Seite'; $.fn.pagination.defaults.afterPageText = 'von {pages}'; $.fn.pagination.defaults.displayMsg = '{from} bis {to} von {total} Datensätzen'; } if ($.fn.datagrid){ $.fn.datagrid.defaults.loadMsg = 'Verarbeitung läuft, bitte warten ...'; } if ($.fn.treegrid && $.fn.datagrid){ $.fn.treegrid.defaults.loadMsg = $.fn.datagrid.defaults.loadMsg; } if ($.messager){ $.messager.defaults.ok = 'OK'; $.messager.defaults.cancel = 'Abbruch'; } if ($.fn.validatebox){ $.fn.validatebox.defaults.missingMessage = 'Dieses Feld wird benötigt.'; $.fn.validatebox.defaults.rules.email.message = 'Bitte geben Sie eine gültige E-Mail-Adresse ein.'; $.fn.validatebox.defaults.rules.url.message = 'Bitte geben Sie eine gültige URL ein.'; $.fn.validatebox.defaults.rules.length.message = 'Bitte geben Sie einen Wert zwischen {0} und {1} ein.'; } if ($.fn.numberbox){ $.fn.numberbox.defaults.missingMessage = 'Dieses Feld wird benötigt.'; } if ($.fn.combobox){ $.fn.combobox.defaults.missingMessage = 'Dieses Feld wird benötigt.'; } if ($.fn.combotree){ $.fn.combotree.defaults.missingMessage = 'Dieses Feld wird benötigt.'; } if ($.fn.combogrid){ $.fn.combogrid.defaults.missingMessage = 'Dieses Feld wird benötigt.'; } if ($.fn.calendar){ $.fn.calendar.defaults.firstDay = 1; $.fn.calendar.defaults.weeks = ['S','M','D','M','D','F','S']; $.fn.calendar.defaults.months = ['Jan', 'Feb', 'Mär', 'Apr', 'Mai', 'Jun', 'Jul', 'Aug', 'Sep', 'Okt', 'Nov', 'Dez']; } if ($.fn.datebox){ $.fn.datebox.defaults.currentText = 'Heute'; $.fn.datebox.defaults.closeText = 'Schließen'; $.fn.datebox.defaults.okText = 'OK'; $.fn.datebox.defaults.missingMessage = 'Dieses Feld wird benötigt.'; $.fn.datebox.defaults.formatter = function(date){ var y = date.getFullYear(); var m = date.getMonth()+1; var d = date.getDate(); return (d<10?('0'+d):d)+'.'+(m<10?('0'+m):m)+'.'+y; }; $.fn.datebox.defaults.parser = function(s){ if (!s) return new Date(); var ss = s.split('.'); var m = parseInt(ss[1],10); var d = parseInt(ss[0],10); var y = parseInt(ss[2],10); if (!isNaN(y) && !isNaN(m) && !isNaN(d)){ return new Date(y,m-1,d); } else { return new Date(); } }; } if ($.fn.datetimebox && $.fn.datebox){ $.extend($.fn.datetimebox.defaults,{ currentText: $.fn.datebox.defaults.currentText, closeText: $.fn.datebox.defaults.closeText, okText: $.fn.datebox.defaults.okText, missingMessage: $.fn.datebox.defaults.missingMessage }); }
{ "pile_set_name": "Github" }
import { addFormatToken } from '../format/format'; import { addUnitAlias } from './aliases'; import { addUnitPriority } from './priorities'; import { addRegexToken, match1to2, match1to4, match1to6, match2, match4, match6, matchSigned } from '../parse/regex'; import { addWeekParseToken } from '../parse/token'; import { weekOfYear, weeksInYear, dayOfYearFromWeeks } from './week-calendar-utils'; import toInt from '../utils/to-int'; import { hooks } from '../utils/hooks'; import { createLocal } from '../create/local'; import { createUTCDate } from '../create/date-from-array'; // FORMATTING addFormatToken(0, ['gg', 2], 0, function () { return this.weekYear() % 100; }); addFormatToken(0, ['GG', 2], 0, function () { return this.isoWeekYear() % 100; }); function addWeekYearFormatToken (token, getter) { addFormatToken(0, [token, token.length], 0, getter); } addWeekYearFormatToken('gggg', 'weekYear'); addWeekYearFormatToken('ggggg', 'weekYear'); addWeekYearFormatToken('GGGG', 'isoWeekYear'); addWeekYearFormatToken('GGGGG', 'isoWeekYear'); // ALIASES addUnitAlias('weekYear', 'gg'); addUnitAlias('isoWeekYear', 'GG'); // PRIORITY addUnitPriority('weekYear', 1); addUnitPriority('isoWeekYear', 1); // PARSING addRegexToken('G', matchSigned); addRegexToken('g', matchSigned); addRegexToken('GG', match1to2, match2); addRegexToken('gg', match1to2, match2); addRegexToken('GGGG', match1to4, match4); addRegexToken('gggg', match1to4, match4); addRegexToken('GGGGG', match1to6, match6); addRegexToken('ggggg', match1to6, match6); addWeekParseToken(['gggg', 'ggggg', 'GGGG', 'GGGGG'], function (input, week, config, token) { week[token.substr(0, 2)] = toInt(input); }); addWeekParseToken(['gg', 'GG'], function (input, week, config, token) { week[token] = hooks.parseTwoDigitYear(input); }); // MOMENTS export function getSetWeekYear (input) { return getSetWeekYearHelper.call(this, input, this.week(), this.weekday(), this.localeData()._week.dow, this.localeData()._week.doy); } export function getSetISOWeekYear (input) { return getSetWeekYearHelper.call(this, input, this.isoWeek(), this.isoWeekday(), 1, 4); } export function getISOWeeksInYear () { return weeksInYear(this.year(), 1, 4); } export function getWeeksInYear () { var weekInfo = this.localeData()._week; return weeksInYear(this.year(), weekInfo.dow, weekInfo.doy); } function getSetWeekYearHelper(input, week, weekday, dow, doy) { var weeksTarget; if (input == null) { return weekOfYear(this, dow, doy).year; } else { weeksTarget = weeksInYear(input, dow, doy); if (week > weeksTarget) { week = weeksTarget; } return setWeekAll.call(this, input, week, weekday, dow, doy); } } function setWeekAll(weekYear, week, weekday, dow, doy) { var dayOfYearData = dayOfYearFromWeeks(weekYear, week, weekday, dow, doy), date = createUTCDate(dayOfYearData.year, 0, dayOfYearData.dayOfYear); this.year(date.getUTCFullYear()); this.month(date.getUTCMonth()); this.date(date.getUTCDate()); return this; }
{ "pile_set_name": "Github" }
import { Button, HtmlElement, TextField, Checkbox, Grid, DataProxy, Rescope } from 'cx/widgets'; import { Content, Controller, LabelsLeftLayout, KeySelection, computable } from 'cx/ui'; import {Md} from '../../../components/Md'; import {CodeSplit} from '../../../components/CodeSplit'; import {CodeSnippet} from '../../../components/CodeSnippet'; import {casual} from '../data/casual'; function uid(len) { len = len || 7; return Math.random().toString(35).substr(2, len); } class PageController extends Controller { onInit() { this.store.init('$page.records', Array.from({length: 5}).map((v, i)=>({ id: uid(), fullName: casual.full_name, phone: casual.phone, city: casual.city, notified: casual.coin_flip }))); this.addTrigger('$page.form', ['$page.id', '$page.records'], (id, records) => { this.store.set('$page.form', records.find(r => r.id == id)); this.store.set('$page.add', false); }); } newRecord() { let newRecord = { id: uid(), fullName: 'New Entry' } this.store.update('$page.records', records => [...records, newRecord]) this.store.set('$page.id', newRecord.id); } saveRecord() { let record = this.store.get('$page.form'); this.store.update( '$page.records', records => records.map(r => r.id == record.id ? record : r) ); } removeRecord(id) { this.store.delete('$page.id'); this.store.update( '$page.records', records => records.filter(r => r.id != id) ); } } export const FormEdit = <cx> <Md controller={PageController}> <CodeSplit> # Grid with Form Editing The following example shows how to connect a form with a grid control. <Grid records-bind='$page.records' style={{width: "100%"}} selection={{type: KeySelection, bind: '$page.id', keyField: 'id'}} columns={[ {header: 'Name', field: 'fullName', sortable: true}, {header: 'Phone', field: 'phone'}, {header: 'City', field: 'city', sortable: true}, { header: 'Notified', field: 'notified', sortable: true, value: {expr: '{$record.notified} ? "Yes" : "No"'} }, { header: 'Actions', items: <cx> <Button data-id-bind='$record.id' onClick={(e, {controller, data}) => { controller.removeRecord(data.data.id); }}>Remove </Button> </cx> } ]} /> <Button type="button" onClick={(e, {controller}) => { controller.newRecord() }}>Add </Button> <hr style={{margin: '30px'}}/> <div class='flex-row'> <div visible-expr='{$page.form}' style="flex: 1;"> <h2 text="Normal form"/> <h4 text-bind="$page.form.fullName"/> <div layout={LabelsLeftLayout}> <TextField label="Name" value-bind="$page.form.fullName"/> <TextField label="Phone" value-bind="$page.form.phone"/> <TextField label="City" value-bind="$page.form.city"/> <Checkbox label="Notified" value-bind="$page.form.notified"/> <Button onClick={(e, {controller}) => { controller.saveRecord() }}>Save </Button> </div> </div> <div style="flex: 1;"> <Rescope bind="$page"> <DataProxy value={{ expr: computable("id", "records", (id, records) => { if (!id) return; return records.find(rec => rec.id == id); }), set: (record, {store}) => { store.update( "records", records => records.map(rec => rec.id === record.id ? { ...record } : rec) ); } }} alias="$liveForm" > <div visible-expr='{$liveForm}'> <h2 text="Live form"/> <h4 text-bind="$liveForm.fullName"/> <div layout={LabelsLeftLayout}> <TextField label="Name" value-bind="$liveForm.fullName"/> <TextField label="Phone" value-bind="$liveForm.phone"/> <TextField label="City" value-bind="$liveForm.city"/> <Checkbox label="Notified" value-bind="$liveForm.notified"/> </div> </div> </DataProxy> </Rescope> </div> </div> <Content name="code"> <CodeSnippet fiddle="xPjUX9Ad">{` class PageController extends Controller { onInit() { this.store.init('$page.records', Array.from({length: 5}).map((v, i)=>({ id: uid(), fullName: casual.full_name, phone: casual.phone, city: casual.city, notified: casual.coin_flip }))); this.addTrigger('$page.form', ['$page.id', '$page.records'], (id, records) => { this.store.set('$page.form', records.find(r => r.id == id)); this.store.set('$page.add', false); }); } newRecord() { let newRecord = { id: uid(), fullName: 'New Entry' } this.store.update('$page.records', records => [...records, newRecord]) this.store.set('$page.id', newRecord.id); } saveRecord() { let record = this.store.get('$page.form'); this.store.update( '$page.records', records => records.map(r => r.id == record.id ? record : r) ); } removeRecord(id) { this.store.update( '$page.records', records => records.filter(r => r.id != id) ); } } ... <Grid records-bind='$page.records' style={{width: "100%"}} selection={{type: KeySelection, bind: '$page.id', keyField: 'id'}} columns={[ {header: 'Name', field: 'fullName', sortable: true}, {header: 'Phone', field: 'phone'}, {header: 'City', field: 'city', sortable: true}, { header: 'Notified', field: 'notified', sortable: true, value: {expr: '{$record.notified} ? "Yes" : "No"'} }, { header: 'Actions', items: <cx> <Button data-id-bind='$record.id' onClick={(e, {controller, data}) => { controller.removeRecord(data.data.id); }}>Remove </Button> </cx> } ]} /> <Button type="button" onClick={(e, {controller}) => { controller.newRecord() }}>Add </Button> <hr style={{margin: '30px'}}/> <div class='flex-row'> <div visible-expr='{$page.form}' style="flex: 1;"> <h2 text="Normal form"/> <h4 text-bind="$page.form.fullName"/> <div layout={LabelsLeftLayout}> <TextField label="Name" value-bind="$page.form.fullName"/> <TextField label="Phone" value-bind="$page.form.phone"/> <TextField label="City" value-bind="$page.form.city"/> <Checkbox label="Notified" value-bind="$page.form.notified"/> <Button onClick={(e, {controller}) => { controller.saveRecord() }}>Save </Button> </div> </div> <div style="flex: 1;"> <Rescope bind="$page"> <DataProxy value={{ expr: computable("id", "records", (id, records) => { if (!id) return; return records.find(rec => rec.id == id); }), set: (record, {store}) => { store.update( "records", records => records.map(rec => rec.id === record.id ? { ...record } : rec) ); } }} alias="$liveForm" > <div visible-expr='{$liveForm}'> <h2 text="Live form"/> <h4 text-bind="$liveForm.fullName"/> <div layout={LabelsLeftLayout}> <TextField label="Name" value-bind="$liveForm.fullName"/> <TextField label="Phone" value-bind="$liveForm.phone"/> <TextField label="City" value-bind="$liveForm.city"/> <Checkbox label="Notified" value-bind="$liveForm.notified"/> </div> </div> </DataProxy> </Rescope> </div> </div> `} </CodeSnippet> </Content> </CodeSplit> </Md> </cx>
{ "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.ignite.internal.processors.cache.persistence.pagemem; import org.apache.ignite.internal.pagemem.FullPageId; import org.apache.ignite.internal.util.GridUnsafe; /** * */ class PageHeader { /** */ public static final long PAGE_MARKER = 0x0000000000000001L; /** Dirty flag. */ private static final long DIRTY_FLAG = 0x0100000000000000L; /** Page relative pointer. Does not change once a page is allocated. */ private static final int RELATIVE_PTR_OFFSET = 8; /** Page ID offset */ private static final int PAGE_ID_OFFSET = 16; /** Page cache group ID offset. */ private static final int PAGE_CACHE_ID_OFFSET = 24; /** Page pin counter offset. */ private static final int PAGE_PIN_CNT_OFFSET = 28; /** Page temp copy buffer relative pointer offset. */ private static final int PAGE_TMP_BUF_OFFSET = 40; /** * @param absPtr Absolute pointer to initialize. * @param relative Relative pointer to write. */ public static void initNew(long absPtr, long relative) { relative(absPtr, relative); tempBufferPointer(absPtr, PageMemoryImpl.INVALID_REL_PTR); GridUnsafe.putLong(absPtr, PAGE_MARKER); GridUnsafe.putInt(absPtr + PAGE_PIN_CNT_OFFSET, 0); } /** * @param absPtr Absolute pointer. * @return Dirty flag. */ public static boolean dirty(long absPtr) { return flag(absPtr, DIRTY_FLAG); } /** * @param absPtr Page absolute pointer. * @param dirty Dirty flag. * @return Previous value of dirty flag. */ public static boolean dirty(long absPtr, boolean dirty) { return flag(absPtr, DIRTY_FLAG, dirty); } /** * @param absPtr Absolute pointer. * @param flag Flag mask. * @return Flag value. */ private static boolean flag(long absPtr, long flag) { assert (flag & 0xFFFFFFFFFFFFFFL) == 0; assert Long.bitCount(flag) == 1; long relPtrWithFlags = GridUnsafe.getLong(absPtr + RELATIVE_PTR_OFFSET); return (relPtrWithFlags & flag) != 0; } /** * Sets flag. * * @param absPtr Absolute pointer. * @param flag Flag mask. * @param set New flag value. * @return Previous flag value. */ private static boolean flag(long absPtr, long flag, boolean set) { assert (flag & 0xFFFFFFFFFFFFFFL) == 0; assert Long.bitCount(flag) == 1; long relPtrWithFlags = GridUnsafe.getLong(absPtr + RELATIVE_PTR_OFFSET); boolean was = (relPtrWithFlags & flag) != 0; if (set) relPtrWithFlags |= flag; else relPtrWithFlags &= ~flag; GridUnsafe.putLong(absPtr + RELATIVE_PTR_OFFSET, relPtrWithFlags); return was; } /** * @param absPtr Page pointer. * @return If page is pinned. */ public static boolean isAcquired(long absPtr) { return GridUnsafe.getInt(absPtr + PAGE_PIN_CNT_OFFSET) > 0; } /** * @param absPtr Absolute pointer. */ public static void acquirePage(long absPtr) { GridUnsafe.incrementAndGetInt(absPtr + PAGE_PIN_CNT_OFFSET); } /** * @param absPtr Absolute pointer. */ public static int releasePage(long absPtr) { return GridUnsafe.decrementAndGetInt(absPtr + PAGE_PIN_CNT_OFFSET); } /** * @param absPtr Absolute pointer. * @return Number of acquires for the page. */ public static int pinCount(long absPtr) { return GridUnsafe.getIntVolatile(null, absPtr); } /** * Reads relative pointer from the page at the given absolute position. * * @param absPtr Absolute memory pointer to the page header. * @return Relative pointer written to the page. */ public static long readRelative(long absPtr) { return GridUnsafe.getLong(absPtr + RELATIVE_PTR_OFFSET) & PageMemoryImpl.RELATIVE_PTR_MASK; } /** * Writes relative pointer to the page at the given absolute position. * * @param absPtr Absolute memory pointer to the page header. * @param relPtr Relative pointer to write. */ public static void relative(long absPtr, long relPtr) { GridUnsafe.putLong(absPtr + RELATIVE_PTR_OFFSET, relPtr & PageMemoryImpl.RELATIVE_PTR_MASK); } /** * Volatile write for current timestamp to page in {@code absAddr} address. * * @param absPtr Absolute page address. */ public static void writeTimestamp(final long absPtr, long tstamp) { tstamp &= 0xFFFFFFFFFFFFFF00L; GridUnsafe.putLongVolatile(null, absPtr, tstamp | 0x01); } /** * Read for timestamp from page in {@code absAddr} address. * * @param absPtr Absolute page address. * @return Timestamp. */ public static long readTimestamp(final long absPtr) { long markerAndTs = GridUnsafe.getLong(absPtr); // Clear last byte as it is occupied by page marker. return markerAndTs & ~0xFF; } /** * Sets pointer to checkpoint buffer. * * @param absPtr Page absolute pointer. * @param tmpRelPtr Temp buffer relative pointer or {@link PageMemoryImpl#INVALID_REL_PTR} if page is not copied to checkpoint * buffer. */ public static void tempBufferPointer(long absPtr, long tmpRelPtr) { GridUnsafe.putLong(absPtr + PAGE_TMP_BUF_OFFSET, tmpRelPtr); } /** * Gets pointer to checkpoint buffer or {@link PageMemoryImpl#INVALID_REL_PTR} if page is not copied to checkpoint buffer. * * @param absPtr Page absolute pointer. * @return Temp buffer relative pointer. */ public static long tempBufferPointer(long absPtr) { return GridUnsafe.getLong(absPtr + PAGE_TMP_BUF_OFFSET); } /** * Reads page ID from the page at the given absolute position. * * @param absPtr Absolute memory pointer to the page header. * @return Page ID written to the page. */ public static long readPageId(long absPtr) { return GridUnsafe.getLong(absPtr + PAGE_ID_OFFSET); } /** * Writes page ID to the page at the given absolute position. * * @param absPtr Absolute memory pointer to the page header. * @param pageId Page ID to write. */ private static void pageId(long absPtr, long pageId) { GridUnsafe.putLong(absPtr + PAGE_ID_OFFSET, pageId); } /** * Reads cache group ID from the page at the given absolute pointer. * * @param absPtr Absolute memory pointer to the page header. * @return Cache group ID written to the page. */ private static int readPageGroupId(final long absPtr) { return GridUnsafe.getInt(absPtr + PAGE_CACHE_ID_OFFSET); } /** * Writes cache group ID from the page at the given absolute pointer. * * @param absPtr Absolute memory pointer to the page header. * @param grpId Cache group ID to write. */ private static void pageGroupId(final long absPtr, final int grpId) { GridUnsafe.putInt(absPtr + PAGE_CACHE_ID_OFFSET, grpId); } /** * Reads page ID and cache group ID from the page at the given absolute pointer. * * @param absPtr Absolute memory pointer to the page header. * @return Full page ID written to the page. */ public static FullPageId fullPageId(final long absPtr) { return new FullPageId(readPageId(absPtr), readPageGroupId(absPtr)); } /** * Writes page ID and cache group ID from the page at the given absolute pointer. * * @param absPtr Absolute memory pointer to the page header. * @param fullPageId Full page ID to write. */ public static void fullPageId(final long absPtr, final FullPageId fullPageId) { pageId(absPtr, fullPageId.pageId()); pageGroupId(absPtr, fullPageId.groupId()); } }
{ "pile_set_name": "Github" }
%YAML 1.1 %TAG !u! tag:unity3d.com,2011: --- !u!47 &1 QualitySettings: m_ObjectHideFlags: 0 serializedVersion: 5 m_CurrentQuality: 0 m_QualitySettings: - serializedVersion: 2 name: Good pixelLightCount: 2 shadows: 2 shadowResolution: 3 shadowProjection: 1 shadowCascades: 1 shadowDistance: 6 shadowNearPlaneOffset: 3 shadowCascade2Split: 0.33333334 shadowCascade4Split: {x: 0.06666667, y: 0.2, z: 0.46666667} blendWeights: 2 textureQuality: 0 anisotropicTextures: 1 antiAliasing: 0 softParticles: 0 softVegetation: 1 realtimeReflectionProbes: 1 billboardsFaceCameraPosition: 1 vSyncCount: 1 lodBias: 1 maximumLODLevel: 0 particleRaycastBudget: 256 asyncUploadTimeSlice: 2 asyncUploadBufferSize: 4 excludedTargetPlatforms: [] m_PerPlatformDefaultQuality: Android: 0 Nintendo 3DS: 0 PS4: 0 PSM: 0 PSP2: 0 Samsung TV: 0 Standalone: 0 Tizen: 0 Web: 0 WebGL: 0 WiiU: 0 Windows Store Apps: 0 XboxOne: 0 iPhone: 0 tvOS: 0
{ "pile_set_name": "Github" }
/* Copyright (c) 2010, Yahoo! Inc. All rights reserved. Code licensed under the BSD License: http://developer.yahoo.com/yui/license.html version: 3.2.0 build: 2676 */ /* Vertical menus and submenus */ .yui3-skin-sam .yui3-menu-content, .yui3-skin-sam .yui3-menu .yui3-menu .yui3-menu-content { font-size: 93%; /* 12px */ line-height: 1.5; /* 18px */ *line-height: 1.45; /* For IE */ border: solid 1px #808080; background: #fff; padding: 3px 0; } .yui3-skin-sam .yui3-menu .yui3-menu .yui3-menu-content { font-size: 100%; } /* Horizontal menus */ .yui3-skin-sam .yui3-menu-horizontal .yui3-menu-content { line-height: 2; /* ~24px */ *line-height: 1.9; /* For IE */ background: url(../../../../assets/skins/sam/sprite.png) repeat-x 0 0; padding: 0; } .yui3-skin-sam .yui3-menu ul, .yui3-skin-sam .yui3-menu ul ul { margin-top: 3px; padding-top: 3px; border-top: solid 1px #ccc; } .yui3-skin-sam .yui3-menu ul.first-of-type { border: 0; margin: 0; padding: 0; } .yui3-skin-sam .yui3-menu-horizontal ul { padding: 0; margin: 0; border: 0; } .yui3-skin-sam .yui3-menu li, .yui3-skin-sam .yui3-menu .yui3-menu li { /* For and IE 6 (Strict Mode and Quirks Mode) and IE 7 (Quirks Mode only): Used to collapse superfluous white space between <li> elements that is triggered by the "display" property of the <a> elements being set to "block" by node-menunav-core.css file. */ _border-bottom: solid 1px #fff; } .yui3-skin-sam .yui3-menu-horizontal li { _border-bottom: 0; } .yui3-skin-sam .yui3-menubuttonnav li { border-right: solid 1px #ccc; } .yui3-skin-sam .yui3-splitbuttonnav li { border-right: solid 1px #808080; } .yui3-skin-sam .yui3-menubuttonnav li li, .yui3-skin-sam .yui3-splitbuttonnav li li { border-right: 0; } /* Menuitems and menu labels */ .yui3-skin-sam .yui3-menu-label, .yui3-skin-sam .yui3-menu .yui3-menu .yui3-menu-label, .yui3-skin-sam .yui3-menuitem-content, .yui3-skin-sam .yui3-menu .yui3-menu .yui3-menuitem-content { padding: 0 20px; color: #000; text-decoration: none; cursor: default; /* Necessary specify values for border, position and margin to override values specified in the selectors that follow. */ float: none; border: 0; margin: 0; } .yui3-skin-sam .yui3-menu-horizontal .yui3-menu-label, .yui3-skin-sam .yui3-menu-horizontal .yui3-menuitem-content { padding: 0 10px; border-style: solid; border-color: #808080; border-width: 1px 0; margin: -1px 0; float: left; /* Ensures that menu labels clear floated descendents. Also gets negative margins working in IE 7 (Strict Mode). */ width: auto; } .yui3-skin-sam .yui3-menu-label, .yui3-skin-sam .yui3-menu .yui3-menu .yui3-menu-label { background: url(vertical-menu-submenu-indicator.png) right center no-repeat; } .yui3-skin-sam .yui3-menu-horizontal .yui3-menu-label { background: url(../../../../assets/skins/sam/sprite.png) repeat-x 0 0; } .yui3-skin-sam .yui3-menubuttonnav .yui3-menu-label, .yui3-skin-sam .yui3-splitbuttonnav .yui3-menu-label { background-image: none; } .yui3-skin-sam .yui3-menubuttonnav .yui3-menu-label { padding-right: 0; } .yui3-skin-sam .yui3-menubuttonnav .yui3-menu-label em { font-style: normal; padding-right: 20px; display: block; background: url(horizontal-menu-submenu-indicator.png) right center no-repeat; } .yui3-skin-sam .yui3-splitbuttonnav .yui3-menu-label { padding: 0; } .yui3-skin-sam .yui3-splitbuttonnav .yui3-menu-label a { float: left; width: auto; color: #000; text-decoration: none; cursor: default; padding: 0 5px 0 10px; } .yui3-skin-sam .yui3-splitbuttonnav .yui3-menu-label .yui3-menu-toggle { padding: 0; /* Overide padding applied by the preceeding rule. */ border-left: solid 1px #ccc; width: 15px; overflow: hidden; text-indent: -1000px; background: url(horizontal-menu-submenu-indicator.png) 3px center no-repeat; } /* Selected menuitem */ .yui3-skin-sam .yui3-menu-label-active, .yui3-skin-sam .yui3-menu-label-menuvisible, .yui3-skin-sam .yui3-menu .yui3-menu .yui3-menu-label-active, .yui3-skin-sam .yui3-menu .yui3-menu .yui3-menu-label-menuvisible { background-color: #B3D4FF; } .yui3-skin-sam .yui3-menuitem-active .yui3-menuitem-content, .yui3-skin-sam .yui3-menu .yui3-menu .yui3-menuitem-active .yui3-menuitem-content { background-image: none; background-color: #B3D4FF; /* Undo values set for "border-left-width" and "margin-left" when the root menu has a class of "yui-menubuttonnav" or "yui-splitbuttonnav" applied. */ border-left-width: 0; margin-left: 0; } .yui3-skin-sam .yui3-menu-horizontal .yui3-menu-label-active, .yui3-skin-sam .yui3-menu-horizontal .yui3-menuitem-active .yui3-menuitem-content, .yui3-skin-sam .yui3-menu-horizontal .yui3-menu-label-menuvisible { border-color: #7D98B8; background: url(../../../../assets/skins/sam/sprite.png) repeat-x 0 -1700px; } .yui3-skin-sam .yui3-menubuttonnav .yui3-menu-label-active, .yui3-skin-sam .yui3-menubuttonnav .yui3-menuitem-active .yui3-menuitem-content, .yui3-skin-sam .yui3-menubuttonnav .yui3-menu-label-menuvisible, .yui3-skin-sam .yui3-splitbuttonnav .yui3-menu-label-active, .yui3-skin-sam .yui3-splitbuttonnav .yui3-menuitem-active .yui3-menuitem-content, .yui3-skin-sam .yui3-splitbuttonnav .yui3-menu-label-menuvisible { border-left-width: 1px; margin-left: -1px; } .yui3-skin-sam .yui3-splitbuttonnav .yui3-menu-label-menuvisible { border-color: #808080; background: transparent; } .yui3-skin-sam .yui3-splitbuttonnav .yui3-menu-label-menuvisible .yui3-menu-toggle { border-color: #7D98B8; background: url(horizontal-menu-submenu-toggle.png) left center no-repeat; }
{ "pile_set_name": "Github" }
export default { CREATE: 'item.create', DELETE: 'item.delete', DESTROY: 'item.destroy', EXPLODE: 'item.explode', EXPORT: 'item.export', INSERT: 'item.insert', IMPORT: 'item.import', IMPLODE: 'item.implode', LOAD: 'item.load', MERGE: 'item.merge', OPEN: 'item.open', REMOVE: 'item.remove', RESTORE: 'item.restore', SELECT: 'item.select', SPLIT: 'item.split', UPDATE: 'item.update', PREVIEW: 'item.preview', PRINT: 'item.print', BULK: { UPDATE: 'item.bulk.update' }, TAG: { CREATE: 'item.tag.create', DELETE: 'item.tag.delete', INSERT: 'item.tag.insert', REMOVE: 'item.tag.remove', CLEAR: 'item.tag.clear', TOGGLE: 'item.tag.toggle' }, PHOTO: { ADD: 'item.photo.add', REMOVE: 'item.photo.remove' }, LAYOUT: { STACKED: 'stacked', SIDE_BY_SIDE: 'side-by-side' }, TEMPLATE: { CHANGE: 'item.template.change', DEFAULT: 'https://tropy.org/v1/templates/generic' } }
{ "pile_set_name": "Github" }
[![Gitter chat](https://badges.gitter.im/gitterHQ/gitter.png)](https://gitter.im/big-data-europe/Lobby) # Changes Version 2.0.0 introduces uses wait_for_it script for the cluster startup # Hadoop Docker ## Supported Hadoop Versions See repository branches for supported hadoop versions ## Quick Start To deploy an example HDFS cluster, run: ``` docker-compose up ``` Run example wordcount job: ``` make wordcount ``` Or deploy in swarm: ``` docker stack deploy -c docker-compose-v3.yml hadoop ``` `docker-compose` creates a docker network that can be found by running `docker network list`, e.g. `dockerhadoop_default`. Run `docker network inspect` on the network (e.g. `dockerhadoop_default`) to find the IP the hadoop interfaces are published on. Access these interfaces with the following URLs: * Namenode: http://<dockerhadoop_IP_address>:9870/dfshealth.html#tab-overview * History server: http://<dockerhadoop_IP_address>:8188/applicationhistory * Datanode: http://<dockerhadoop_IP_address>:9864/ * Nodemanager: http://<dockerhadoop_IP_address>:8042/node * Resource manager: http://<dockerhadoop_IP_address>:8088/ ## Configure Environment Variables The configuration parameters can be specified in the hadoop.env file or as environmental variables for specific services (e.g. namenode, datanode etc.): ``` CORE_CONF_fs_defaultFS=hdfs://namenode:8020 ``` CORE_CONF corresponds to core-site.xml. fs_defaultFS=hdfs://namenode:8020 will be transformed into: ``` <property><name>fs.defaultFS</name><value>hdfs://namenode:8020</value></property> ``` To define dash inside a configuration parameter, use triple underscore, such as YARN_CONF_yarn_log___aggregation___enable=true (yarn-site.xml): ``` <property><name>yarn.log-aggregation-enable</name><value>true</value></property> ``` The available configurations are: * /etc/hadoop/core-site.xml CORE_CONF * /etc/hadoop/hdfs-site.xml HDFS_CONF * /etc/hadoop/yarn-site.xml YARN_CONF * /etc/hadoop/httpfs-site.xml HTTPFS_CONF * /etc/hadoop/kms-site.xml KMS_CONF * /etc/hadoop/mapred-site.xml MAPRED_CONF If you need to extend some other configuration file, refer to base/entrypoint.sh bash script.
{ "pile_set_name": "Github" }
# 33c3 CTF : mario-350 **Category:** Reversing **Points:** 350 **Solves:** 8 **Description:** How do you feel about figuring out a really scary beast of a retro console music file? You are invited to use [the VM we prepared for you](https://archive.aachen.ccc.de/33c3ctf.ccc.ac/uploads/mario-51cd5ebb32ac51b4cd97882e826c113dacfa0aec.ova), which contains a player and the song file. We cloned game-music-emu from [email protected]:mpyne/game-music-emu.git, commit 2cbb70f3c27412db7e54ca65fa1a3fac3f6a7d64 to build libgme and gme_player. If you have an x86_64 Arch Linux, Ubuntu 16.10 or Debian 8.6 desktop, maybe it's enough for you to use [these bundled libraries](mario_standalone.tar.xz), without downloading the full VM. USE THIS AT YOUR OWN RISK. If it crashes while playing play_me.spc, something is wrong and you should use our VM. ## Write-up (TODO) ## Other write-ups and resources * none yet
{ "pile_set_name": "Github" }
<?php /** * Magento * * NOTICE OF LICENSE * * This source file is subject to the Open Software License (OSL 3.0) * that is bundled with this package in the file LICENSE.txt. * It is also available through the world-wide-web at this URL: * http://opensource.org/licenses/osl-3.0.php * If you did not receive a copy of the license and are unable to * obtain it through the world-wide-web, please send an email * to [email protected] so we can send you a copy immediately. * * DISCLAIMER * * Do not edit or add to this file if you wish to upgrade Magento to newer * versions in the future. If you wish to customize Magento for your * needs please refer to http://www.magento.com for more information. * * @category Mage * @package Mage_Core * @copyright Copyright (c) 2006-2020 Magento, Inc. (http://www.magento.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ /** * Directory storage database resource model class * * @category Mage * @package Mage_Core * @author Magento Core Team <[email protected]> */ class Mage_Core_Model_Mysql4_File_Storage_Directory_Database extends Mage_Core_Model_Resource_File_Storage_Directory_Database { }
{ "pile_set_name": "Github" }
[package] authors = ["Parity Technologies <[email protected]>"] description = "TCP/IP server for JSON-RPC" documentation = "https://docs.rs/jsonrpc-tcp-server/" edition = "2018" homepage = "https://github.com/paritytech/jsonrpc" license = "MIT" name = "jsonrpc-tcp-server" repository = "https://github.com/paritytech/jsonrpc" version = "16.0.0" [dependencies] futures01 = { version = "0.1", package = "futures" } # TODO remove when we no longer need compat (use jsonrpc-core re-export instead) futures03 = { version = "0.3", features = ["compat"], package = "futures" } jsonrpc-core = { version = "16.0", path = "../core" } jsonrpc-server-utils = { version = "16.0", path = "../server-utils" } log = "0.4" parking_lot = "0.10.0" tokio-service = "0.1" [dev-dependencies] lazy_static = "1.0" env_logger = "0.7" [badges] travis-ci = { repository = "paritytech/jsonrpc", branch = "master"}
{ "pile_set_name": "Github" }
<?php // ini_set('display_errors',1); //错误信息 // ini_set('display_startup_errors',1); //php启动错误信息 // error_reporting(-1); header("Content-type:text/html;charset=utf-8"); include_once 'mysql.php'; include_once 'functions.php'; include_once 'sqlutils.php'; $postdata=file_get_contents("php://input"); $jsondata=json_decode($postdata); $headimg=$jsondata->avatarUrl; $city=$jsondata->city; $country=$jsondata->country; $gender=$jsondata->gender; $language=$jsondata->language; $nickname=$jsondata->nickName; $openid=$jsondata->openid; $province=$jsondata->province; $db = getDb(); if($headimg!="" && $openid!="" && $nickname!=""){ $sql = "select * from ".getTablePrefix()."_members where openid = '$openid' LIMIT 1"; $res=mysql_query($sql,$db) or die(mysql_error()); $now = time(); if(mysql_num_rows($res)<=0){ $sql = "insert into `".getTablePrefix()."_members` (openid, nickname, headimg, gender, city,province,country,joindate,lastlogin) values('$openid', '$nickname', '$headimg' ,'$gender' ,'$city' ,'$province', '$country','$now','$now')"; mysql_query($sql, $db) or die(mysql_error()); }else{ $row = mysql_fetch_assoc($res); if($row['baned']){ exitJson(1, '您已被关小黑屋'); } $sql = "update `".getTablePrefix()."_members` set nickname='$nickname', headimg='$headimg',lastlogin='$now' where openid='$openid' "; mysql_query($sql, $db) or die(mysql_error()); } $token = getToken(); session_start(); $_SESSION['token'] = $token; $_SESSION['openid'] = $openid; exitJson(0, '',array('token'=>$_SESSION['token'],'sessionid'=>session_id())+getUserInfo($openid)); }else{ exitJson(2, '登录失败,请授权获得昵称和头像'); } ?>
{ "pile_set_name": "Github" }
<?php /** * CodeIgniter * * An open source application development framework for PHP * * This content is released under the MIT License (MIT) * * Copyright (c) 2014 - 2015, British Columbia Institute of Technology * * 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 CodeIgniter * @author EllisLab Dev Team * @copyright Copyright (c) 2008 - 2014, EllisLab, Inc. (http://ellislab.com/) * @copyright Copyright (c) 2014 - 2015, British Columbia Institute of Technology (http://bcit.ca/) * @license http://opensource.org/licenses/MIT MIT License * @link http://codeigniter.com * @since Version 3.0.0 * @filesource */ defined('BASEPATH') OR exit('No direct script access allowed'); /** * Firebird/Interbase Database Adapter Class * * Note: _DB is an extender class that the app controller * creates dynamically based on whether the query builder * class is being used or not. * * @package CodeIgniter * @subpackage Drivers * @category Database * @author EllisLab Dev Team * @link http://codeigniter.com/user_guide/database/ */ class CI_DB_ibase_driver extends CI_DB { /** * Database driver * * @var string */ public $dbdriver = 'ibase'; // -------------------------------------------------------------------- /** * ORDER BY random keyword * * @var array */ protected $_random_keyword = array('RAND()', 'RAND()'); /** * IBase Transaction status flag * * @var resource */ protected $_ibase_trans; // -------------------------------------------------------------------- /** * Non-persistent database connection * * @param bool $persistent * @return resource */ public function db_connect($persistent = FALSE) { return ($persistent === TRUE) ? ibase_pconnect($this->hostname.':'.$this->database, $this->username, $this->password, $this->char_set) : ibase_connect($this->hostname.':'.$this->database, $this->username, $this->password, $this->char_set); } // -------------------------------------------------------------------- /** * Database version number * * @return string */ public function version() { if (isset($this->data_cache['version'])) { return $this->data_cache['version']; } if (($service = ibase_service_attach($this->hostname, $this->username, $this->password))) { $this->data_cache['version'] = ibase_server_info($service, IBASE_SVC_SERVER_VERSION); // Don't keep the service open ibase_service_detach($service); return $this->data_cache['version']; } return FALSE; } // -------------------------------------------------------------------- /** * Execute the query * * @param string $sql an SQL query * @return resource */ protected function _execute($sql) { return ibase_query($this->conn_id, $sql); } // -------------------------------------------------------------------- /** * Begin Transaction * * @param bool $test_mode * @return bool */ public function trans_begin($test_mode = FALSE) { // When transactions are nested we only begin/commit/rollback the outermost ones if ( ! $this->trans_enabled OR $this->_trans_depth > 0) { return TRUE; } // Reset the transaction failure flag. // If the $test_mode flag is set to TRUE transactions will be rolled back // even if the queries produce a successful result. $this->_trans_failure = ($test_mode === TRUE); $this->_ibase_trans = ibase_trans($this->conn_id); return TRUE; } // -------------------------------------------------------------------- /** * Commit Transaction * * @return bool */ public function trans_commit() { // When transactions are nested we only begin/commit/rollback the outermost ones if ( ! $this->trans_enabled OR $this->_trans->depth > 0) { return TRUE; } return ibase_commit($this->_ibase_trans); } // -------------------------------------------------------------------- /** * Rollback Transaction * * @return bool */ public function trans_rollback() { // When transactions are nested we only begin/commit/rollback the outermost ones if ( ! $this->trans_enabled OR $this->_trans_depth > 0) { return TRUE; } return ibase_rollback($this->_ibase_trans); } // -------------------------------------------------------------------- /** * Affected Rows * * @return int */ public function affected_rows() { return ibase_affected_rows($this->conn_id); } // -------------------------------------------------------------------- /** * Insert ID * * @param string $generator_name * @param int $inc_by * @return int */ public function insert_id($generator_name, $inc_by = 0) { //If a generator hasn't been used before it will return 0 return ibase_gen_id('"'.$generator_name.'"', $inc_by); } // -------------------------------------------------------------------- /** * List table query * * Generates a platform-specific query string so that the table names can be fetched * * @param bool $prefix_limit * @return string */ protected function _list_tables($prefix_limit = FALSE) { $sql = 'SELECT TRIM("RDB$RELATION_NAME") AS TABLE_NAME FROM "RDB$RELATIONS" WHERE "RDB$RELATION_NAME" NOT LIKE \'RDB$%\' AND "RDB$RELATION_NAME" NOT LIKE \'MON$%\''; if ($prefix_limit !== FALSE && $this->dbprefix !== '') { return $sql.' AND TRIM("RDB$RELATION_NAME") AS TABLE_NAME LIKE \''.$this->escape_like_str($this->dbprefix)."%' " .sprintf($this->_like_escape_str, $this->_like_escape_chr); } return $sql; } // -------------------------------------------------------------------- /** * Show column query * * Generates a platform-specific query string so that the column names can be fetched * * @param string $table * @return string */ protected function _list_columns($table = '') { return 'SELECT TRIM("RDB$FIELD_NAME") AS COLUMN_NAME FROM "RDB$RELATION_FIELDS" WHERE "RDB$RELATION_NAME" = '.$this->escape($table); } // -------------------------------------------------------------------- /** * Returns an object with field data * * @param string $table * @return array */ public function field_data($table) { $sql = 'SELECT "rfields"."RDB$FIELD_NAME" AS "name", CASE "fields"."RDB$FIELD_TYPE" WHEN 7 THEN \'SMALLINT\' WHEN 8 THEN \'INTEGER\' WHEN 9 THEN \'QUAD\' WHEN 10 THEN \'FLOAT\' WHEN 11 THEN \'DFLOAT\' WHEN 12 THEN \'DATE\' WHEN 13 THEN \'TIME\' WHEN 14 THEN \'CHAR\' WHEN 16 THEN \'INT64\' WHEN 27 THEN \'DOUBLE\' WHEN 35 THEN \'TIMESTAMP\' WHEN 37 THEN \'VARCHAR\' WHEN 40 THEN \'CSTRING\' WHEN 261 THEN \'BLOB\' ELSE NULL END AS "type", "fields"."RDB$FIELD_LENGTH" AS "max_length", "rfields"."RDB$DEFAULT_VALUE" AS "default" FROM "RDB$RELATION_FIELDS" "rfields" JOIN "RDB$FIELDS" "fields" ON "rfields"."RDB$FIELD_SOURCE" = "fields"."RDB$FIELD_NAME" WHERE "rfields"."RDB$RELATION_NAME" = '.$this->escape($table).' ORDER BY "rfields"."RDB$FIELD_POSITION"'; return (($query = $this->query($sql)) !== FALSE) ? $query->result_object() : FALSE; } // -------------------------------------------------------------------- /** * Error * * Returns an array containing code and message of the last * database error that has occured. * * @return array */ public function error() { return array('code' => ibase_errcode(), 'message' => ibase_errmsg()); } // -------------------------------------------------------------------- /** * Update statement * * Generates a platform-specific update string from the supplied data * * @param string $table * @param array $values * @return string */ protected function _update($table, $values) { $this->qb_limit = FALSE; return parent::_update($table, $values); } // -------------------------------------------------------------------- /** * Truncate statement * * Generates a platform-specific truncate string from the supplied data * * If the database does not support the TRUNCATE statement, * then this method maps to 'DELETE FROM table' * * @param string $table * @return string */ protected function _truncate($table) { return 'DELETE FROM '.$table; } // -------------------------------------------------------------------- /** * Delete statement * * Generates a platform-specific delete string from the supplied data * * @param string $table * @return string */ protected function _delete($table) { $this->qb_limit = FALSE; return parent::_delete($table); } // -------------------------------------------------------------------- /** * LIMIT * * Generates a platform-specific LIMIT clause * * @param string $sql SQL Query * @return string */ protected function _limit($sql) { // Limit clause depends on if Interbase or Firebird if (stripos($this->version(), 'firebird') !== FALSE) { $select = 'FIRST '.$this->qb_limit .($this->qb_offset ? ' SKIP '.$this->qb_offset : ''); } else { $select = 'ROWS ' .($this->qb_offset ? $this->qb_offset.' TO '.($this->qb_limit + $this->qb_offset) : $this->qb_limit); } return preg_replace('`SELECT`i', 'SELECT '.$select, $sql, 1); } // -------------------------------------------------------------------- /** * Close DB Connection * * @return void */ protected function _close() { ibase_close($this->conn_id); } }
{ "pile_set_name": "Github" }
#! /bin/bash set -u set -e # Some utility functions. fail() { echo >&2 "$@"; exit 1; } warn() { echo >&2 "$@"; } cmd() { hash "$1" >&/dev/null; } # portable 'which' function checkError () { if [ $? -ne 0 ]; then if cmd curl; then curl -sL "<%= log_url("broker script execution failed", :error) %>" || ( warn "curl failed to log broker completion to <%= log_url("broker script execution failed", :error) %>" ) elif cmd wget; then wget -qO- "<%= log_url("broker script execution failed", :error) %>" || ( warn "wget failed to log broker completion to <%= log_url("broker script execution failed", :error) %>" ) else warn "neither curl nor wget installed; cannot log completion of broker" fi fail fi } trap "checkError" exit # If this fails I don't even know what to do, but theoretically the #! above # could have been ignored or something. cmd bash || fail "we need bash available to be able to run the installer" # Synchronize time with ntpdate server before registering with the server. ntpdate_server=<%= broker[:ntpdate_server] || '' %> if [ -z $ntpdate_server ]; then : # skipping ntpdate since `ntpdate_server` is not set elif cmd ntpdate; then ntpdate $ntpdate_server elif cmd apt-get; then apt-get install ntpdate && ntpdate $ntpdate_server elif cmd yum; then yum -y install ntpdate && ntpdate $ntpdate_server else warn "unable to synchronize time with ntpdate" fi # ...our nice, generic, delegatable script. url="https://<%= (broker[:server] || 'puppet') %>:8140/packages/<%= broker[:version] || 'current' %>/install.bash" # Now, figure out how to download and run the script we need... if cmd curl; then curl -fSkLo /root/install.bash "${url}" || ( curl -sL "<%= log_url("curl could not download puppet agent installer", :error) %>" fail "curl failed to get ${url}" ) elif cmd wget; then wget --no-check-certificate -O /root/install.bash "${url}" || ( wget -qO- "<%= log_url("wget could not download puppet agent installer", :error) %>" fail "wget failed to get ${url}" ) else fail "unable to figure out how to download stuff, curl and wget are missing" fi bash /root/install.bash || ( # error logging URL needs to be 'burned into' the script. if cmd curl; then curl -sL "<%= log_url("failed to run puppet agent installer", :error) %>" && fail "error running /root/install.bash" elif cmd wget; then wget -qO- "<%= log_url("failed to run puppet agent installer", :error) %>" && fail "error running /root/install.bash" else fail "unable to figure out how to download stuff, curl and wget are missing" fi ) # Log that the broker is finished. if cmd curl; then curl -sL "<%= stage_done_url %>" || ( warn "curl failed to log broker completion to <%= stage_done_url %>" ) elif cmd wget; then wget -qO- "<%= stage_done_url %>" || ( warn "wget failed to log broker completion to <%= stage_done_url %>" ) else warn "neither curl nor wget installed; cannot log completion of broker" fi # ...and we should be good. exit 0
{ "pile_set_name": "Github" }
<!DOCTYPE html> <html> <head> <meta charset="utf-8"> <title>CSS Custom Properties IE11 Test</title> <script>window.MSInputMethodContext && document.documentMode && document.write('<script src="../ie11CustomProperties.js"><\x2fscript>');</script> <body> <a href="https://github.com/nuxodin/ie11CustomProperties" style="flex-basis:100%; max-width:none; padding:.5em">back to project</a> <style> html { --root-green:green; --root-red:red; } body { --body-green:green; --body-red:red; } #tests > * { border:1px solid black; padding:10px; } </style> <div id=tests> </div> <script> 'use strict'; setTimeout(function(){ var html = '<div id=noVars>'; html += '<h2>no vars</h2>'; html += '<style>.noVars {color:green}</style>'; for (var i=0; i<1000;i++) { html += '<span class="noVars">x </span>'; } html += '<span class="noVars last">x </span>'; html += '</div>'; var zeit0 = performance.now(); tests.insertAdjacentHTML('beforeend', html); requestAnimationFrame(function check(){ var last = document.getElementById('noVars').querySelector('.last'); var computed = getComputedStyle(last).getPropertyValue('color') !== 'rgb(0, 0, 0)'; if (computed) { var zeit1 = performance.now(); last.innerHTML = "Duration " + (zeit1 - zeit0) + " ms."; } else { requestAnimationFrame(check); } }) }, 1000) setTimeout(function(){ var html = '<div id=gettingRootVars>'; html += '<h2>getting root vars</h2>'; html += '<style>.rootGetter {color:var(--root-green)}</style>'; for (var i=0; i<1000;i++) { html += '<span class="rootGetter">x </span>'; } html += '<span class="rootGetter last">x </span>'; html += '</div>'; var zeit0 = performance.now(); tests.insertAdjacentHTML('beforeend', html); requestAnimationFrame(function check(){ var last = document.getElementById('gettingRootVars').querySelector('.last'); var computed = getComputedStyle(last).getPropertyValue('color') !== 'rgb(0, 0, 0)'; if (computed) { var zeit1 = performance.now(); last.innerHTML = "Duration " + (zeit1 - zeit0) + " ms."; } else { requestAnimationFrame(check); } }) }, 2000) setTimeout(function(){ var html = '<div id=nonRoot>'; html += '<h2>getting non-root vars</h2>'; html += '<style>.non-root {color:var(--body-green)}</style>'; for (var i=0; i<1000;i++) { html += '<span class="non-root">x </span>'; } html += '<span class="non-root last">x </span>'; html += '</div>'; var zeit0 = performance.now(); tests.insertAdjacentHTML('beforeend', html); requestAnimationFrame(function check(){ var last = document.getElementById('nonRoot').querySelector('.last'); var computed = getComputedStyle(last).getPropertyValue('color') !== 'rgb(0, 0, 0)'; if (computed) { var zeit1 = performance.now(); last.innerHTML = "Duration " + (zeit1 - zeit0) + " ms."; } else { requestAnimationFrame(check); } }) }, 3000) setTimeout(function(){ var html = '<div id=nonRootDeep>'; html += '<h2>getting non-root vars deeply nested (100 parents)</h2>'; html += '<style>.non-root {color:var(--body-green)}</style>'; for (var i=0; i<1000;i++) { html += '<span class="non-root">x </span>'; } html += '<span class="non-root last">x </span>'; html += '</div>'; var zeit0 = performance.now(); var el = document.createElement('div'); tests.appendChild(el); for (var i=0; i<99;i++) { var newEl = document.createElement('div'); el.appendChild(newEl) el = newEl; } el.insertAdjacentHTML('beforeend', html); requestAnimationFrame(function check(){ var last = document.getElementById('nonRootDeep').querySelector('.last'); var computed = getComputedStyle(last).getPropertyValue('color') !== 'rgb(0, 0, 0)'; if (computed) { var zeit1 = performance.now(); last.innerHTML = "Duration " + (zeit1 - zeit0) + " ms."; } else { requestAnimationFrame(check); } }) }, 4000) </script>
{ "pile_set_name": "Github" }
/* * Copyright (C) 2011 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. */ package com.android.settings.bluetooth; import android.bluetooth.BluetoothDevice; import android.content.BroadcastReceiver; import android.content.Context; import android.content.DialogInterface; import android.content.Intent; import android.content.IntentFilter; import android.os.Bundle; import android.util.Log; import android.view.View; import android.widget.Button; import android.widget.TextView; import androidx.preference.Preference; import com.android.internal.app.AlertActivity; import com.android.internal.app.AlertController; import com.android.settings.R; /** * BluetoothPermissionActivity shows a dialog for accepting incoming * profile connection request from untrusted devices. * It is also used to show a dialogue for accepting incoming phonebook * read request. The request could be initiated by PBAP PCE or by HF AT+CPBR. */ public class BluetoothPermissionActivity extends AlertActivity implements DialogInterface.OnClickListener, Preference.OnPreferenceChangeListener { private static final String TAG = "BluetoothPermissionActivity"; private static final boolean DEBUG = Utils.D; private View mView; private TextView messageView; private Button mOkButton; private BluetoothDevice mDevice; private String mReturnPackage = null; private String mReturnClass = null; private int mRequestType = 0; private BroadcastReceiver mReceiver = new BroadcastReceiver() { @Override public void onReceive(Context context, Intent intent) { String action = intent.getAction(); if (action.equals(BluetoothDevice.ACTION_CONNECTION_ACCESS_CANCEL)) { int requestType = intent.getIntExtra(BluetoothDevice.EXTRA_ACCESS_REQUEST_TYPE, BluetoothDevice.REQUEST_TYPE_PHONEBOOK_ACCESS); if (requestType != mRequestType) return; BluetoothDevice device = intent.getParcelableExtra(BluetoothDevice.EXTRA_DEVICE); if (mDevice.equals(device)) dismissDialog(); } } }; private boolean mReceiverRegistered = false; private void dismissDialog() { this.dismiss(); } @Override protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); Intent i = getIntent(); String action = i.getAction(); if (!action.equals(BluetoothDevice.ACTION_CONNECTION_ACCESS_REQUEST)) { Log.e(TAG, "Error: this activity may be started only with intent " + "ACTION_CONNECTION_ACCESS_REQUEST"); finish(); return; } mDevice = i.getParcelableExtra(BluetoothDevice.EXTRA_DEVICE); mReturnPackage = i.getStringExtra(BluetoothDevice.EXTRA_PACKAGE_NAME); mReturnClass = i.getStringExtra(BluetoothDevice.EXTRA_CLASS_NAME); mRequestType = i.getIntExtra(BluetoothDevice.EXTRA_ACCESS_REQUEST_TYPE, BluetoothDevice.REQUEST_TYPE_PHONEBOOK_ACCESS); if(DEBUG) Log.i(TAG, "onCreate() Request type: " + mRequestType); if (mRequestType == BluetoothDevice.REQUEST_TYPE_PROFILE_CONNECTION) { showDialog(getString(R.string.bluetooth_connection_permission_request), mRequestType); } else if (mRequestType == BluetoothDevice.REQUEST_TYPE_PHONEBOOK_ACCESS) { showDialog(getString(R.string.bluetooth_phonebook_request), mRequestType); } else if (mRequestType == BluetoothDevice.REQUEST_TYPE_MESSAGE_ACCESS) { showDialog(getString(R.string.bluetooth_map_request), mRequestType); } else if (mRequestType == BluetoothDevice.REQUEST_TYPE_SIM_ACCESS) { showDialog(getString(R.string.bluetooth_sap_request), mRequestType); } else { Log.e(TAG, "Error: bad request type: " + mRequestType); finish(); return; } registerReceiver(mReceiver, new IntentFilter(BluetoothDevice.ACTION_CONNECTION_ACCESS_CANCEL)); mReceiverRegistered = true; } private void showDialog(String title, int requestType) { final AlertController.AlertParams p = mAlertParams; p.mTitle = title; if(DEBUG) Log.i(TAG, "showDialog() Request type: " + mRequestType + " this: " + this); switch(requestType) { case BluetoothDevice.REQUEST_TYPE_PROFILE_CONNECTION: p.mView = createConnectionDialogView(); break; case BluetoothDevice.REQUEST_TYPE_PHONEBOOK_ACCESS: p.mView = createPhonebookDialogView(); break; case BluetoothDevice.REQUEST_TYPE_MESSAGE_ACCESS: p.mView = createMapDialogView(); break; case BluetoothDevice.REQUEST_TYPE_SIM_ACCESS: p.mView = createSapDialogView(); break; } p.mPositiveButtonText = getString(R.string.yes); p.mPositiveButtonListener = this; p.mNegativeButtonText = getString(R.string.no); p.mNegativeButtonListener = this; mOkButton = mAlert.getButton(DialogInterface.BUTTON_POSITIVE); setupAlert(); } @Override public void onBackPressed() { /*we need an answer so ignore back button presses during auth */ if(DEBUG) Log.i(TAG, "Back button pressed! ignoring"); return; } // TODO(edjee): createConnectionDialogView, createPhonebookDialogView and createMapDialogView // are similar. Refactor them into one method. // Also, the string resources bluetooth_remember_choice and bluetooth_pb_remember_choice should // be removed. private View createConnectionDialogView() { String mRemoteName = Utils.createRemoteName(this, mDevice); mView = getLayoutInflater().inflate(R.layout.bluetooth_access, null); messageView = (TextView)mView.findViewById(R.id.message); messageView.setText(getString(R.string.bluetooth_connection_dialog_text, mRemoteName)); return mView; } private View createPhonebookDialogView() { String mRemoteName = Utils.createRemoteName(this, mDevice); mView = getLayoutInflater().inflate(R.layout.bluetooth_access, null); messageView = (TextView)mView.findViewById(R.id.message); messageView.setText(getString(R.string.bluetooth_pb_acceptance_dialog_text, mRemoteName, mRemoteName)); return mView; } private View createMapDialogView() { String mRemoteName = Utils.createRemoteName(this, mDevice); mView = getLayoutInflater().inflate(R.layout.bluetooth_access, null); messageView = (TextView)mView.findViewById(R.id.message); messageView.setText(getString(R.string.bluetooth_map_acceptance_dialog_text, mRemoteName, mRemoteName)); return mView; } private View createSapDialogView() { String mRemoteName = Utils.createRemoteName(this, mDevice); mView = getLayoutInflater().inflate(R.layout.bluetooth_access, null); messageView = (TextView)mView.findViewById(R.id.message); messageView.setText(getString(R.string.bluetooth_sap_acceptance_dialog_text, mRemoteName, mRemoteName)); return mView; } private void onPositive() { if (DEBUG) Log.d(TAG, "onPositive"); sendReplyIntentToReceiver(true, true); finish(); } private void onNegative() { if (DEBUG) Log.d(TAG, "onNegative"); sendReplyIntentToReceiver(false, true); } private void sendReplyIntentToReceiver(final boolean allowed, final boolean always) { Intent intent = new Intent(BluetoothDevice.ACTION_CONNECTION_ACCESS_REPLY); if (mReturnPackage != null && mReturnClass != null) { intent.setClassName(mReturnPackage, mReturnClass); } if (DEBUG) Log.i(TAG, "sendReplyIntentToReceiver() Request type: " + mRequestType + " mReturnPackage" + mReturnPackage + " mReturnClass" + mReturnClass); intent.putExtra(BluetoothDevice.EXTRA_CONNECTION_ACCESS_RESULT, allowed ? BluetoothDevice.CONNECTION_ACCESS_YES : BluetoothDevice.CONNECTION_ACCESS_NO); intent.putExtra(BluetoothDevice.EXTRA_ALWAYS_ALLOWED, always); intent.putExtra(BluetoothDevice.EXTRA_DEVICE, mDevice); intent.putExtra(BluetoothDevice.EXTRA_ACCESS_REQUEST_TYPE, mRequestType); sendBroadcast(intent, android.Manifest.permission.BLUETOOTH_ADMIN); } public void onClick(DialogInterface dialog, int which) { switch (which) { case DialogInterface.BUTTON_POSITIVE: onPositive(); break; case DialogInterface.BUTTON_NEGATIVE: onNegative(); break; default: break; } } @Override protected void onDestroy() { super.onDestroy(); if (mReceiverRegistered) { unregisterReceiver(mReceiver); mReceiverRegistered = false; } } public boolean onPreferenceChange(Preference preference, Object newValue) { return true; } }
{ "pile_set_name": "Github" }
'hello\ world'
{ "pile_set_name": "Github" }
package org.springframework.roo.classpath.itd; import org.springframework.roo.classpath.details.ItdTypeDetails; import org.springframework.roo.metadata.MetadataItem; /** * Indicates a {@link MetadataItem} implementation that can provide * {@link ItdTypeDetails}. * * @author Ben Alex * @since 1.0 */ public interface ItdTypeDetailsProvidingMetadataItem extends MemberHoldingTypeDetailsMetadataItem<ItdTypeDetails> { }
{ "pile_set_name": "Github" }
/* * Copyright (C) the libgit2 contributors. All rights reserved. * * This file is part of libgit2, distributed under the GNU GPL v2 with * a Linking Exception. For full terms see the included COPYING file. */ #ifndef INCLUDE_git_worktree_h__ #define INCLUDE_git_worktree_h__ #include "common.h" #include "buffer.h" #include "types.h" #include "strarray.h" /** * @file git2/worktrees.h * @brief Git worktree related functions * @defgroup git_commit Git worktree related functions * @ingroup Git * @{ */ GIT_BEGIN_DECL /** * List names of linked working trees * * The returned list should be released with `git_strarray_free` * when no longer needed. * * @param out pointer to the array of working tree names * @param repo the repo to use when listing working trees * @return 0 or an error code */ GIT_EXTERN(int) git_worktree_list(git_strarray *out, git_repository *repo); /** * Lookup a working tree by its name for a given repository * * @param out Output pointer to looked up worktree or `NULL` * @param repo The repository containing worktrees * @param name Name of the working tree to look up * @return 0 or an error code */ GIT_EXTERN(int) git_worktree_lookup(git_worktree **out, git_repository *repo, const char *name); /** * Open a worktree of a given repository * * If a repository is not the main tree but a worktree, this * function will look up the worktree inside the parent * repository and create a new `git_worktree` structure. * * @param out Out-pointer for the newly allocated worktree * @param repo Repository to look up worktree for */ GIT_EXTERN(int) git_worktree_open_from_repository(git_worktree **out, git_repository *repo); /** * Free a previously allocated worktree * * @param wt worktree handle to close. If NULL nothing occurs. */ GIT_EXTERN(void) git_worktree_free(git_worktree *wt); /** * Check if worktree is valid * * A valid worktree requires both the git data structures inside * the linked parent repository and the linked working copy to be * present. * * @param wt Worktree to check * @return 0 when worktree is valid, error-code otherwise */ GIT_EXTERN(int) git_worktree_validate(const git_worktree *wt); /** * Worktree add options structure * * Initialize with `GIT_WORKTREE_ADD_OPTIONS_INIT`. Alternatively, you can * use `git_worktree_add_init_options`. * */ typedef struct git_worktree_add_options { unsigned int version; int lock; /**< lock newly created worktree */ git_reference *ref; /**< reference to use for the new worktree HEAD */ } git_worktree_add_options; #define GIT_WORKTREE_ADD_OPTIONS_VERSION 1 #define GIT_WORKTREE_ADD_OPTIONS_INIT {GIT_WORKTREE_ADD_OPTIONS_VERSION,0,NULL} /** * Initialize git_worktree_add_options structure * * Initializes a `git_worktree_add_options` with default values. Equivalent to * creating an instance with `GIT_WORKTREE_ADD_OPTIONS_INIT`. * * @param opts The `git_worktree_add_options` struct to initialize. * @param version The struct version; pass `GIT_WORKTREE_ADD_OPTIONS_VERSION`. * @return Zero on success; -1 on failure. */ GIT_EXTERN(int) git_worktree_add_init_options(git_worktree_add_options *opts, unsigned int version); /** * Add a new working tree * * Add a new working tree for the repository, that is create the * required data structures inside the repository and check out * the current HEAD at `path` * * @param out Output pointer containing new working tree * @param repo Repository to create working tree for * @param name Name of the working tree * @param path Path to create working tree at * @param opts Options to modify default behavior. May be NULL * @return 0 or an error code */ GIT_EXTERN(int) git_worktree_add(git_worktree **out, git_repository *repo, const char *name, const char *path, const git_worktree_add_options *opts); /** * Lock worktree if not already locked * * Lock a worktree, optionally specifying a reason why the linked * working tree is being locked. * * @param wt Worktree to lock * @param reason Reason why the working tree is being locked * @return 0 on success, non-zero otherwise */ GIT_EXTERN(int) git_worktree_lock(git_worktree *wt, const char *reason); /** * Unlock a locked worktree * * @param wt Worktree to unlock * @return 0 on success, 1 if worktree was not locked, error-code * otherwise */ GIT_EXTERN(int) git_worktree_unlock(git_worktree *wt); /** * Check if worktree is locked * * A worktree may be locked if the linked working tree is stored * on a portable device which is not available. * * @param reason Buffer to store reason in. If NULL no reason is stored. * @param wt Worktree to check * @return 0 when the working tree not locked, a value greater * than zero if it is locked, less than zero if there was an * error */ GIT_EXTERN(int) git_worktree_is_locked(git_buf *reason, const git_worktree *wt); /** * Retrieve the name of the worktree * * @param wt Worktree to get the name for * @return The worktree's name. The pointer returned is valid for the * lifetime of the git_worktree */ GIT_EXTERN(const char *) git_worktree_name(const git_worktree *wt); /** * Retrieve the filesystem path for the worktree * * @param wt Worktree to get the path for * @return The worktree's filesystem path. The pointer returned * is valid for the lifetime of the git_worktree. */ GIT_EXTERN(const char *) git_worktree_path(const git_worktree *wt); /** * Flags which can be passed to git_worktree_prune to alter its * behavior. */ typedef enum { /* Prune working tree even if working tree is valid */ GIT_WORKTREE_PRUNE_VALID = 1u << 0, /* Prune working tree even if it is locked */ GIT_WORKTREE_PRUNE_LOCKED = 1u << 1, /* Prune checked out working tree */ GIT_WORKTREE_PRUNE_WORKING_TREE = 1u << 2, } git_worktree_prune_t; /** * Worktree prune options structure * * Initialize with `GIT_WORKTREE_PRUNE_OPTIONS_INIT`. Alternatively, you can * use `git_worktree_prune_init_options`. * */ typedef struct git_worktree_prune_options { unsigned int version; uint32_t flags; } git_worktree_prune_options; #define GIT_WORKTREE_PRUNE_OPTIONS_VERSION 1 #define GIT_WORKTREE_PRUNE_OPTIONS_INIT {GIT_WORKTREE_PRUNE_OPTIONS_VERSION,0} /** * Initialize git_worktree_prune_options structure * * Initializes a `git_worktree_prune_options` with default values. Equivalent to * creating an instance with `GIT_WORKTREE_PRUNE_OPTIONS_INIT`. * * @param opts The `git_worktree_prune_options` struct to initialize. * @param version The struct version; pass `GIT_WORKTREE_PRUNE_OPTIONS_VERSION`. * @return Zero on success; -1 on failure. */ GIT_EXTERN(int) git_worktree_prune_init_options( git_worktree_prune_options *opts, unsigned int version); /** * Is the worktree prunable with the given options? * * A worktree is not prunable in the following scenarios: * * - the worktree is linking to a valid on-disk worktree. The * `valid` member will cause this check to be ignored. * - the worktree is locked. The `locked` flag will cause this * check to be ignored. * * If the worktree is not valid and not locked or if the above * flags have been passed in, this function will return a * positive value. */ GIT_EXTERN(int) git_worktree_is_prunable(git_worktree *wt, git_worktree_prune_options *opts); /** * Prune working tree * * Prune the working tree, that is remove the git data * structures on disk. The repository will only be pruned of * `git_worktree_is_prunable` succeeds. * * @param wt Worktree to prune * @param opts Specifies which checks to override. See * `git_worktree_is_prunable`. May be NULL * @return 0 or an error code */ GIT_EXTERN(int) git_worktree_prune(git_worktree *wt, git_worktree_prune_options *opts); /** @} */ GIT_END_DECL #endif
{ "pile_set_name": "Github" }
package volume // ---------------------------------------------------------------------------- // DO NOT EDIT THIS FILE // This file was generated by `swagger generate operation` // // See hack/swagger-gen.sh // ---------------------------------------------------------------------------- // VolumesCreateBody volumes create body // swagger:model VolumesCreateBody type VolumesCreateBody struct { // Name of the volume driver to use. // Required: true Driver string `json:"Driver"` // A mapping of driver options and values. These options are passed directly to the driver and are driver specific. // Required: true DriverOpts map[string]string `json:"DriverOpts"` // A mapping of arbitrary key/value data to set on the volume. // Required: true Labels map[string]string `json:"Labels"` // The new volume's name. If not specified, Docker generates a name. // Required: true Name string `json:"Name"` }
{ "pile_set_name": "Github" }
Copyright (c) 2011 Dominic Tarr 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.
{ "pile_set_name": "Github" }
-- -- Examples from: https://docs.oracle.com/en/database/oracle/oracle-database/18/sqlrf/XMLELEMENT.html#GUID-DEA75423-00EA-4034-A246-4A774ADC988E -- BEGIN SELECT XMLELEMENT("Emp", XMLELEMENT("Name", e.job_id||' '||e.last_name), XMLELEMENT("Hiredate", e.hire_date)) as "Result" FROM employees e WHERE employee_id > 200; SELECT XMLELEMENT("Emp", XMLATTRIBUTES(e.employee_id AS "ID", e.last_name), XMLELEMENT("Dept", e.department_id), XMLELEMENT("Salary", e.salary)) AS "Emp Element" FROM employees e WHERE e.employee_id = 206; SELECT XMLELEMENT("Emp", XMLATTRIBUTES(e.employee_id, e.last_name), XMLELEMENT("Dept", XMLATTRIBUTES(e.department_id, (SELECT d.department_name FROM departments d WHERE d.department_id = e.department_id) as "Dept_name")), XMLELEMENT("salary", e.salary), XMLELEMENT("Hiredate", e.hire_date)) AS "Emp Element" FROM employees e WHERE employee_id = 205; END;
{ "pile_set_name": "Github" }
{ "error": "Błąd", "error_unknown": "Wystąpił błąd. Proszę odświeżyć stronę.", "reloadPage": "Odśwież stronę", "loginInformation": "Zaloguj się kontem użytkownika Opencast", "login": "Zaloguj", "enterUsernamePassword": "Proszę wprowadzić nazwę użytkownika i hasło:", "username": "Użytkownik", "password": "Hasło", "rememberMe": "Zapamiętaj mnie", "cancel": "Anuluj", "loginSuccessful": "Logowanie pomyślne. Proszę odświeżyć stronę, jeśli strona nie zostanie automatycznie odświeżona.", "logoutSuccessful": "Zostałeś wylogowany. Proszę odświeżyć stronę, jeśli strona nie zostanie automatycznie odświeżona.", "loginFailed": "Nie udało się zalogować.", "description": "Opis", "slideText": "Tekst slajdu", "shortcuts": "Skróty" }
{ "pile_set_name": "Github" }
#include "printer.h" #include "parser.h" #include "value.h" #include <sstream> namespace mjs { class print_visitor { public: explicit print_visitor(std::wostream& os) : os_(os) {} // // Expressions // void operator()(const identifier_expression& e) { os_ << e.id(); } void operator()(const this_expression&) { os_ << "this"; } void operator()(const literal_expression& e) { switch (e.t().type()) { case token_type::null_: os_ << "null"; return; case token_type::true_: os_ << "true"; return; case token_type::false_: os_ << "false"; return; case token_type::numeric_literal: os_ << e.t().dvalue(); return; case token_type::string_literal: os_ << '"' << cpp_quote(e.t().text()) << '"'; return; default: NOT_IMPLEMENTED(e); } } void operator()(const array_literal_expression& e) { os_ << '['; const auto& es = e.elements(); for (size_t i = 0; i < es.size(); ++i) { os_ << (i ? ", " : ""); if (es[i]) { accept(*es[i], *this); } } os_ << ']'; } void operator()(const object_literal_expression& e) { os_ << '{'; const auto& es = e.elements(); for (size_t i = 0; i < es.size(); ++i) { if (es[i].type() == property_assignment_type::normal) { os_ << (i ? ", " : ""); accept(es[i].name(), *this); os_ << ": "; accept(es[i].value(), *this); } else { os_ << (i ? "," : ""); const auto& f = es[i].value(); assert(f.type() == expression_type::function); handle_function(static_cast<const function_expression&>(f)); } } os_ << '}'; } void operator()(const regexp_literal_expression& e) { os_ << '/' << e.re().pattern() << '/' << e.re().flags(); } void operator()(const call_expression& e) { accept(e.member(), *this); os_ << '('; const auto& args = e.arguments(); for (size_t i = 0; i < args.size(); ++i) { os_ << (i ? ", " : ""); accept(*args[i], *this); } os_ << ')'; } void operator()(const prefix_expression& e) { switch (e.op()) { case token_type::delete_: os_ << "delete "; break; case token_type::typeof_: os_ << "typeof "; break; case token_type::void_: os_ << "void "; break; case token_type::new_: os_ << "new "; break; default: os_ << op_text(e.op()); } accept(e.e(), *this); } void operator()(const postfix_expression& e) { accept(e.e(), *this); os_ << op_text(e.op()); } void operator()(const binary_expression& e) { const int precedence = operator_precedence(e.op()); print_with_parentheses(e.lhs(), precedence); if (e.op() == token_type::lbracket) { os_ << '['; accept(e.rhs(), *this); os_ << ']'; } else if (e.op() == token_type::dot) { os_ << '.'; if (e.rhs().type() == expression_type::literal) { if (const auto& t = static_cast<const literal_expression&>(e.rhs()).t(); t.type() == token_type::string_literal) { os_ << t.text(); return; } } accept(e.rhs(), *this); } else { os_ << op_text(e.op()); print_with_parentheses(e.rhs(), precedence); } } void operator()(const conditional_expression& e) { accept(e.cond(), *this); os_ << " ? "; accept(e.lhs(), *this); os_ << " : "; accept(e.rhs(), *this); } void operator()(const function_expression& e) { os_ << "function"; handle_function(e); } void operator()(const expression& e) { NOT_IMPLEMENTED(e); } // // Statements // void operator()(const block_statement& s) { os_ << '{'; for (const auto& bs: s.l()) { accept(*bs, *this); } os_ << '}'; } void operator()(const variable_statement& s) { os_ << "var"; for (size_t i = 0; i < s.l().size(); ++i) { const auto& d = s.l()[i]; os_ << (i ? ", ": " ") << d.id(); if (d.init()) { os_ << " = "; accept(*d.init(), *this); } } os_ << ';'; } void operator()(const debugger_statement&) { os_ << "debugger;"; } void operator()(const empty_statement&) { os_ << ';'; } void operator()(const if_statement& s) { os_ << "if ("; accept(s.cond(), *this); os_ << ") "; accept(s.if_s(), *this); if (auto e = s.else_s()) { os_ << " else "; accept(*e, *this); } } void operator()(const do_statement& s) { os_ << "do "; accept(s.s(), *this); os_ << " while ("; accept(s.cond(), *this); os_ << ") "; } void operator()(const while_statement& s) { os_ << "while ("; accept(s.cond(), *this); os_ << ") "; accept(s.s(), *this); } void operator()(const for_statement& s) { os_ << "for ("; if (auto is = s.init()) { accept(*is, *this); } else { os_ << ";"; } os_ << " "; if (auto cs = s.cond()) { accept(*cs, *this); } os_ << "; "; if (auto is = s.iter()) { accept(*is, *this); } os_ << ") "; accept(s.s(), *this); } void operator()(const for_in_statement& s){ os_ << "for ("; accept(s.init(), *this); os_ << " in "; accept(s.e(), *this); os_ << ") "; accept(s.s(), *this); } void operator()(const expression_statement& s) { accept(s.e(), *this); os_ << ';'; } void operator()(const continue_statement&) { os_ << "continue;"; } void operator()(const break_statement&) { os_ << "break;"; } void operator()(const return_statement& s) { os_ << "return"; if (s.e()) { os_ << " "; accept(*s.e(), *this); } os_ << ';'; } void operator()(const with_statement& s) { os_ << "with ("; accept(s.e(), *this); os_ << ") "; accept(s.s(), *this); } void operator()(const labelled_statement& s) { NOT_IMPLEMENTED(s); } void operator()(const switch_statement& s) { os_ << "switch ("; accept(s.e(), *this); os_ << ") {"; for (const auto& c: s.cl()) { os_ << " "; if (const auto& e = c.e()) { os_ << "case "; accept(*e, *this); } else { os_ << "default"; } os_ << ": "; for (const auto& cs: c.sl()) { accept(*cs, *this); } } os_ << "}"; } void operator()(const throw_statement& s) { os_ << "throw "; accept(s.e(), *this); os_ << ";"; } void operator()(const try_statement& s) { os_ << "try "; accept(s.block(), *this); if (auto c = s.catch_block()) { os_ << " catch(" << s.catch_id() << ") "; accept(*c, *this); } if (auto f = s.finally_block()) { os_ << " finally "; accept(*f, *this); } } void operator()(const function_definition& s) { os_ << "function"; handle_function(s); } void operator()(const statement& s) { NOT_IMPLEMENTED(s); } private: std::wostream& os_; void handle_function(const function_base& s) { os_ << (s.id().empty() ? L"" : L" " + s.id()) << "("; for (size_t i = 0; i < s.params().size(); ++i) { os_ << (i?", ":"") << s.params()[i]; } os_ << ")"; (*this)(s.block()); } void print_with_parentheses(const expression& e, int outer_precedence) { const int inner_precedence = e.type() == expression_type::binary ? operator_precedence(static_cast<const binary_expression&>(e).op()) : 0; if (inner_precedence > outer_precedence) os_ << '('; accept(e, *this); if (inner_precedence > outer_precedence) os_ << ')'; } }; void print(std::wostream& os, const expression& e) { print_visitor pv{os}; accept(e, pv); } void print(std::wostream& os, const statement& s) { print_visitor pv{os}; accept(s, pv); } } // namespace mjs
{ "pile_set_name": "Github" }
//! Module for creating a `Texture` from an image use { crate::{ core::{cast_cow, cast_slice}, factory::{Factory, ImageState, UploadError}, memory::Data, pixel::AsPixel, resource::{ Escape, Handle, Image, ImageCreationError, ImageInfo, ImageView, ImageViewCreationError, ImageViewInfo, Sampler, }, }, rendy_core::hal::{ format::{Component, Format, Swizzle}, image, Backend, }, std::num::NonZeroU8, thread_profiler::profile_scope, }; /// Static image. /// Can be loaded from various of formats. #[derive(Debug)] pub struct Texture<B: Backend> { image: Handle<Image<B>>, view: Escape<ImageView<B>>, sampler: Handle<Sampler<B>>, premultiplied: bool, } impl<B> Texture<B> where B: Backend, { /// Get image handle. pub fn image(&self) -> &Handle<Image<B>> { &self.image } /// Get sampler handle. pub fn sampler(&self) -> &Handle<Sampler<B>> { &self.sampler } /// Get reference to image view. pub fn view(&self) -> &ImageView<B> { &self.view } /// Get mutable reference to image view. pub fn view_mut(&mut self) -> &mut ImageView<B> { &mut self.view } /// Get whether texture has premultiplied alpha pub fn premultiplied_alpha(&self) -> bool { self.premultiplied } } /// Number of mip levels #[derive(Clone, Copy, Debug)] #[cfg_attr(feature = "serde", derive(serde::Serialize, serde::Deserialize))] pub enum MipLevels { /// Generate mip levels automaticaly from image size, each mip level /// decreasing in resolution by half until 1x1 GenerateAuto, /// Generate mip levels up to a certain level, each mip level /// decreasing in resolution by half GenerateLevels(NonZeroU8), /// Create the image with raw mip levels but without blitting the main /// texture data into them Levels(NonZeroU8), } /// Calculate the number of mip levels for a 2D image with given dimensions pub fn mip_levels_from_dims(width: u32, height: u32) -> u8 { ((32 - width.max(height).leading_zeros()).max(1) as u8).min(rendy_core::hal::image::MAX_LEVEL) } #[derive(Debug)] pub enum BuildError { Format(Format), Image(ImageCreationError), Upload(UploadError), ImageView(ImageViewCreationError), Mipmap(rendy_core::hal::device::OutOfMemory), Sampler(rendy_core::hal::device::AllocationError), } impl std::fmt::Display for BuildError { fn fmt(&self, fmt: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { match self { BuildError::Format(format) => write!(fmt, "Format unsupported: {:?}", format), BuildError::Image(err) => write!(fmt, "Texture build failed: {:?}", err), BuildError::Upload(err) => write!(fmt, "Texture build failed: {:?}", err), BuildError::ImageView(err) => write!(fmt, "Texture build failed: {:?}", err), BuildError::Mipmap(err) => write!(fmt, "Texture build failed: {:?}", err), BuildError::Sampler(err) => write!(fmt, "Texture build failed: {:?}", err), } } } impl std::error::Error for BuildError { fn source(&self) -> Option<&(dyn std::error::Error + 'static)> { match self { BuildError::Format(_) => None, BuildError::Image(err) => Some(err), BuildError::Upload(err) => Some(err), BuildError::ImageView(err) => Some(err), BuildError::Mipmap(err) => Some(err), BuildError::Sampler(err) => Some(err), } } } /// Generics-free texture builder. #[derive(Clone)] #[cfg_attr(feature = "serde", derive(serde::Serialize, serde::Deserialize))] /// Struct for staging data in preparation of building a `Texture` pub struct TextureBuilder<'a> { kind: image::Kind, view_kind: image::ViewKind, format: Format, data: std::borrow::Cow<'a, [u8]>, data_width: u32, data_height: u32, sampler_info: rendy_core::hal::image::SamplerDesc, swizzle: Swizzle, mip_levels: MipLevels, premultiplied: bool, } impl<'a> std::fmt::Debug for TextureBuilder<'a> { fn fmt(&self, fmt: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { fmt.debug_struct("TextureBuilder") .field("kind", &self.kind) .field("view_kind", &self.view_kind) .field("format", &self.format) .field("data", &"<raw-data>") .field("data_width", &self.data_width) .field("data_height", &self.data_height) .field("sampler_info", &self.sampler_info) .field("swizzle", &self.swizzle) .field("mip_levels", &self.mip_levels) .field("premultiplied", &self.premultiplied) .finish() } } impl<'a> TextureBuilder<'a> { /// New empty `TextureBuilder` pub fn new() -> Self { TextureBuilder { kind: image::Kind::D1(0, 0), view_kind: image::ViewKind::D1, format: Format::Rgba8Unorm, data: std::borrow::Cow::Borrowed(&[]), data_width: 0, data_height: 0, sampler_info: rendy_core::hal::image::SamplerDesc::new( rendy_core::hal::image::Filter::Linear, rendy_core::hal::image::WrapMode::Clamp, ), swizzle: Swizzle::NO, mip_levels: MipLevels::Levels(NonZeroU8::new(1).unwrap()), premultiplied: false, } } /// Set whether the image has premultiplied alpha pub fn set_premultiplied_alpha(&mut self, premultiplied: bool) -> &mut Self { self.premultiplied = premultiplied; self } /// Set whether the image has premultiplied alpha pub fn with_premultiplied_alpha(mut self, premultiplied: bool) -> Self { self.set_premultiplied_alpha(premultiplied); self } /// Set pixel data. pub fn with_data<P: AsPixel>(mut self, data: impl Into<std::borrow::Cow<'a, [P]>>) -> Self { self.set_data(data); self } /// Set pixel data. pub fn set_data<P: AsPixel>( &mut self, data: impl Into<std::borrow::Cow<'a, [P]>>, ) -> &mut Self { self.data = cast_cow(data.into()); self.format = P::FORMAT; self } /// Set pixel data with manual format definition. pub fn with_raw_data( mut self, data: impl Into<std::borrow::Cow<'a, [u8]>>, format: Format, ) -> Self { self.set_raw_data(data, format); self } /// Set pixel data with manual format definition. pub fn set_raw_data( &mut self, data: impl Into<std::borrow::Cow<'a, [u8]>>, format: Format, ) -> &mut Self { self.data = data.into(); self.format = format; self } /// Set pixel data width. pub fn with_data_width(mut self, data_width: u32) -> Self { self.set_data_width(data_width); self } /// Set pixel data width. pub fn set_data_width(&mut self, data_width: u32) -> &mut Self { self.data_width = data_width; self } /// Set pixel data height. pub fn with_data_height(mut self, data_height: u32) -> Self { self.set_data_height(data_height); self } /// Set pixel data height. pub fn set_data_height(&mut self, data_height: u32) -> &mut Self { self.data_height = data_height; self } /// Set number of generated or raw mip levels pub fn with_mip_levels(mut self, mip_levels: MipLevels) -> Self { self.set_mip_levels(mip_levels); self } /// Set number of generated or raw mip levels pub fn set_mip_levels(&mut self, mip_levels: MipLevels) -> &mut Self { self.mip_levels = mip_levels; self } /// Set image extent. pub fn with_kind(mut self, kind: image::Kind) -> Self { self.set_kind(kind); self } /// Set image kind. pub fn set_kind(&mut self, kind: image::Kind) -> &mut Self { self.kind = kind; self } /// With image view kind. pub fn with_view_kind(mut self, view_kind: image::ViewKind) -> Self { self.set_view_kind(view_kind); self } /// Set image view kind. pub fn set_view_kind(&mut self, view_kind: image::ViewKind) -> &mut Self { self.view_kind = view_kind; self } /// With image sampler info. pub fn with_sampler_info(mut self, sampler_info: rendy_core::hal::image::SamplerDesc) -> Self { self.set_sampler_info(sampler_info); self } /// Set image sampler info. pub fn set_sampler_info( &mut self, sampler_info: rendy_core::hal::image::SamplerDesc, ) -> &mut Self { self.sampler_info = sampler_info; self } /// With swizzle. pub fn with_swizzle(mut self, swizzle: Swizzle) -> Self { self.set_swizzle(swizzle); self } /// Set swizzle. pub fn set_swizzle(&mut self, swizzle: Swizzle) -> &mut Self { self.swizzle = swizzle; self } /// Build texture. /// /// ## Parameters /// * `next_state`: The next state that this texture will be used in. /// It will get transitioned to this state after uploading. /// * `factory`: Factory to use to build the texture pub fn build<B>( &self, next_state: ImageState, factory: &'a mut Factory<B>, ) -> Result<Texture<B>, BuildError> where B: Backend, { profile_scope!("build"); let view_caps = match self.view_kind { rendy_core::hal::image::ViewKind::D2Array => { rendy_core::hal::image::ViewCapabilities::KIND_2D_ARRAY } rendy_core::hal::image::ViewKind::Cube | rendy_core::hal::image::ViewKind::CubeArray => { rendy_core::hal::image::ViewCapabilities::KIND_CUBE } _ => rendy_core::hal::image::ViewCapabilities::empty(), }; let (mip_levels, generate_mips) = match self.mip_levels { MipLevels::GenerateLevels(val) => (val.get(), true), MipLevels::Levels(val) => (val.get(), false), MipLevels::GenerateAuto => match self.kind { rendy_core::hal::image::Kind::D1(_, _) => (1, false), rendy_core::hal::image::Kind::D2(w, h, _, _) => (mip_levels_from_dims(w, h), true), rendy_core::hal::image::Kind::D3(_, _, _) => (1, false), }, }; let (info, transform, transform_swizzle) = find_compatible_format( factory, ImageInfo { kind: self.kind, levels: mip_levels, format: self.format, tiling: rendy_core::hal::image::Tiling::Optimal, view_caps, usage: rendy_core::hal::image::Usage::SAMPLED | rendy_core::hal::image::Usage::TRANSFER_DST | rendy_core::hal::image::Usage::TRANSFER_SRC, }, ) .ok_or(BuildError::Format(self.format))?; let image: Handle<Image<B>> = factory .create_image(info, Data) .map_err(BuildError::Image)? .into(); let mut transformed_vec: Vec<u8>; let buffer: &[u8] = match transform { BufferTransform::Intact => &self.data, BufferTransform::AddPadding { stride, padding } => { profile_scope!("add_padding"); let new_stride = stride + padding.len(); let data_len = self.data.len() / stride * new_stride; transformed_vec = vec![0; data_len]; let dst_slice: &mut [u8] = &mut transformed_vec; // optimize most common cases match (stride, padding) { (2, &[0u8, std::u8::MAX]) => { buf_add_padding(&self.data, dst_slice, stride, padding) } (3, &[std::u8::MAX]) => buf_add_padding(&self.data, dst_slice, stride, padding), _ => buf_add_padding(&self.data, dst_slice, stride, padding), } &transformed_vec } }; let mip_state = ImageState { queue: next_state.queue, stage: rendy_core::hal::pso::PipelineStage::TRANSFER, access: image::Access::TRANSFER_READ, layout: image::Layout::TransferSrcOptimal, }; let undef_state = ImageState { queue: next_state.queue, stage: rendy_core::hal::pso::PipelineStage::TOP_OF_PIPE, access: image::Access::empty(), layout: image::Layout::Undefined, }; // The reason that factory.upload_image is unsafe is that the image being uploaded // must have been created by the same factory and that it is not in use; we guarantee // that here because we just created the image on the same factory right before. unsafe { profile_scope!("upload_image"); factory .upload_image( image.clone(), self.data_width, self.data_height, image::SubresourceLayers { aspects: info.format.surface_desc().aspects, level: 0, layers: 0..info.kind.num_layers(), }, image::Offset::ZERO, info.kind.extent(), buffer, image::Layout::Undefined, if !generate_mips || mip_levels == 1 { next_state } else { mip_state }, ) .map_err(BuildError::Upload)?; } if mip_levels > 1 && generate_mips { profile_scope!("fill_mips"); unsafe { factory .blitter() .fill_mips( factory.device(), image.clone(), image::Filter::Linear, std::iter::once(mip_state).chain(std::iter::repeat(undef_state)), std::iter::repeat(next_state), ) .map_err(BuildError::Mipmap)?; } } else if mip_levels > 1 && !generate_mips { unsafe { factory.transition_image( image.clone(), image::SubresourceRange { aspects: info.format.surface_desc().aspects, levels: 1..mip_levels, layers: 0..info.kind.num_layers(), }, image::Layout::Undefined, next_state, ); } } let view = { profile_scope!("create_image_view"); factory .create_image_view( image.clone(), ImageViewInfo { view_kind: self.view_kind, format: info.format, swizzle: double_swizzle(self.swizzle, transform_swizzle), range: image::SubresourceRange { aspects: info.format.surface_desc().aspects, levels: 0..info.levels, layers: 0..info.kind.num_layers(), }, }, ) .map_err(BuildError::ImageView)? }; let sampler = factory .get_sampler(self.sampler_info.clone()) .map_err(BuildError::Sampler)?; Ok(Texture { image, view, sampler, premultiplied: self.premultiplied, }) } } enum BufferTransform { Intact, AddPadding { stride: usize, padding: &'static [u8], }, } fn double_swizzle(src: Swizzle, overlay: Swizzle) -> Swizzle { fn pick_component(src: Swizzle, component: Component) -> Component { let Swizzle(r, g, b, a) = src; match component { Component::R => r, Component::G => g, Component::B => b, Component::A => a, Component::Zero => Component::Zero, Component::One => Component::One, } } Swizzle( pick_component(src, overlay.0), pick_component(src, overlay.1), pick_component(src, overlay.2), pick_component(src, overlay.3), ) } fn find_compatible_format<B: Backend>( factory: &Factory<B>, info: ImageInfo, ) -> Option<(ImageInfo, BufferTransform, Swizzle)> { profile_scope!("find_compatible_format"); if let Some(info) = image_format_supported(factory, info) { return Some((info, BufferTransform::Intact, Swizzle::NO)); } if let Some((format, transform, swizzle)) = expand_format_channels(info.format) { let mut new_info = info.clone(); new_info.format = format; if let Some(new_info) = image_format_supported(factory, new_info) { log::trace!("Converting image from {:?} to {:?}", info, new_info); return Some((new_info, transform, swizzle)); } } None } fn expand_format_channels(format: Format) -> Option<(Format, BufferTransform, Swizzle)> { const ONE_F16: u16 = 15360u16; let t2_u8 = BufferTransform::AddPadding { stride: 2, padding: &[0u8, std::u8::MAX], }; let t2_u16 = BufferTransform::AddPadding { stride: 4, padding: cast_slice(&[0u16, std::u16::MAX]), }; let t2_f16 = BufferTransform::AddPadding { stride: 4, padding: cast_slice(&[0u16, ONE_F16]), }; let t2_u32 = BufferTransform::AddPadding { stride: 8, padding: cast_slice(&[0u32, std::u32::MAX]), }; let t2_f32 = BufferTransform::AddPadding { stride: 8, padding: cast_slice(&[0.0f32, 1.0f32]), }; let t3_u8 = BufferTransform::AddPadding { stride: 3, padding: &[std::u8::MAX], }; let t3_u16 = BufferTransform::AddPadding { stride: 6, padding: cast_slice(&[std::u16::MAX]), }; let t3_f16 = BufferTransform::AddPadding { stride: 6, padding: cast_slice(&[ONE_F16]), }; let t3_u32 = BufferTransform::AddPadding { stride: 12, padding: cast_slice(&[std::u32::MAX]), }; let t3_f32 = BufferTransform::AddPadding { stride: 12, padding: cast_slice(&[1.0f32]), }; let intact = BufferTransform::Intact; let rgba = Swizzle(Component::R, Component::G, Component::B, Component::A); let bgra = Swizzle(Component::B, Component::G, Component::R, Component::A); Some(match format { // Destination formats chosen according to this table // https://vulkan.gpuinfo.org/listformats.php Format::Rg8Unorm => (Format::Rgba8Unorm, t2_u8, rgba), Format::Rg8Snorm => (Format::Rgba8Snorm, t2_u8, rgba), Format::Rg8Uscaled => (Format::Rgba8Uscaled, t2_u8, rgba), Format::Rg8Sscaled => (Format::Rgba8Sscaled, t2_u8, rgba), Format::Rg8Uint => (Format::Rgba8Uint, t2_u8, rgba), Format::Rg8Sint => (Format::Rgba8Sint, t2_u8, rgba), Format::Rg8Srgb => (Format::Rgba8Srgb, t2_u8, rgba), Format::Rgb8Unorm => (Format::Rgba8Unorm, t3_u8, rgba), Format::Rgb8Snorm => (Format::Rgba8Snorm, t3_u8, rgba), Format::Rgb8Uscaled => (Format::Rgba8Uscaled, t3_u8, rgba), Format::Rgb8Sscaled => (Format::Rgba8Sscaled, t3_u8, rgba), Format::Rgb8Uint => (Format::Rgba8Uint, t3_u8, rgba), Format::Rgb8Sint => (Format::Rgba8Sint, t3_u8, rgba), Format::Rgb8Srgb => (Format::Rgba8Srgb, t3_u8, rgba), Format::Bgr8Unorm => (Format::Rgba8Unorm, t3_u8, bgra), Format::Bgr8Snorm => (Format::Rgba8Snorm, t3_u8, bgra), Format::Bgr8Uscaled => (Format::Rgba8Uscaled, t3_u8, bgra), Format::Bgr8Sscaled => (Format::Rgba8Sscaled, t3_u8, bgra), Format::Bgr8Uint => (Format::Rgba8Uint, t3_u8, bgra), Format::Bgr8Sint => (Format::Rgba8Sint, t3_u8, bgra), Format::Bgr8Srgb => (Format::Rgba8Srgb, t3_u8, bgra), Format::Bgra8Unorm => (Format::Rgba8Unorm, intact, bgra), Format::Bgra8Snorm => (Format::Rgba8Snorm, intact, bgra), Format::Bgra8Uscaled => (Format::Rgba8Uscaled, intact, bgra), Format::Bgra8Sscaled => (Format::Rgba8Sscaled, intact, bgra), Format::Bgra8Uint => (Format::Rgba8Uint, intact, bgra), Format::Bgra8Sint => (Format::Rgba8Sint, intact, bgra), Format::Bgra8Srgb => (Format::Rgba8Srgb, intact, bgra), Format::Rg16Unorm => (Format::Rgba16Unorm, t2_u16, rgba), Format::Rg16Snorm => (Format::Rgba16Snorm, t2_u16, rgba), Format::Rg16Uscaled => (Format::Rgba16Uscaled, t2_u16, rgba), Format::Rg16Sscaled => (Format::Rgba16Sscaled, t2_u16, rgba), Format::Rg16Uint => (Format::Rgba16Uint, t2_u16, rgba), Format::Rg16Sint => (Format::Rgba16Sint, t2_u16, rgba), Format::Rg16Sfloat => (Format::Rgba16Sfloat, t2_f16, rgba), Format::Rgb16Unorm => (Format::Rgba16Unorm, t3_u16, rgba), Format::Rgb16Snorm => (Format::Rgba16Snorm, t3_u16, rgba), Format::Rgb16Uscaled => (Format::Rgba16Uscaled, t3_u16, rgba), Format::Rgb16Sscaled => (Format::Rgba16Sscaled, t3_u16, rgba), Format::Rgb16Uint => (Format::Rgba16Uint, t3_u16, rgba), Format::Rgb16Sint => (Format::Rgba16Sint, t3_u16, rgba), Format::Rgb16Sfloat => (Format::Rgba16Sfloat, t3_f16, rgba), Format::Rg32Uint => (Format::Rgba32Uint, t2_u32, rgba), Format::Rg32Sint => (Format::Rgba32Sint, t2_u32, rgba), Format::Rg32Sfloat => (Format::Rgba32Sfloat, t2_f32, rgba), Format::Rgb32Uint => (Format::Rgba32Uint, t3_u32, rgba), Format::Rgb32Sint => (Format::Rgba32Sint, t3_u32, rgba), Format::Rgb32Sfloat => (Format::Rgba32Sfloat, t3_f32, rgba), // TODO: add more conversions _ => return None, }) } fn image_format_supported<B: Backend>( factory: &Factory<B>, mut info: ImageInfo, ) -> Option<ImageInfo> { factory .image_format_properties(info) .filter(|props| { props.max_layers >= info.kind.num_layers() && props.max_extent.width >= info.kind.extent().width && props.max_extent.height >= info.kind.extent().height && props.max_extent.depth >= info.kind.extent().depth }) .map(|props| { match &mut info.kind { image::Kind::D2(_, _, _, s) if *s & props.sample_count_mask != *s => { let mut new_samples = *s >> 1; while new_samples > 1 && new_samples & props.sample_count_mask != new_samples { new_samples = new_samples >> 1; } *s = new_samples; } _ => {} }; info }) } #[inline(always)] fn buf_add_padding(buffer: &[u8], dst_slice: &mut [u8], stride: usize, padding: &'static [u8]) { let lad_len = padding.len(); for (chunk, dst_chunk) in buffer .chunks_exact(stride) .zip(dst_slice.chunks_exact_mut(stride + lad_len)) { // those loops gets unrolled in special-cased scenarios for i in 0..stride { dst_chunk[i] = chunk[i]; } for i in 0..lad_len { dst_chunk[stride + i] = padding[i]; } } }
{ "pile_set_name": "Github" }
-- Revert delivery:add_telemetry_enabled_to_users from pg BEGIN; ALTER TABLE users DROP COLUMN telemetry_enabled; COMMIT;
{ "pile_set_name": "Github" }
describe("less.js error tests", function() { testLessErrorsInDocument(); });
{ "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/. $font-path: '/media/fonts'; $image-path: '/media/protocol/img'; @import '../../../protocol/css/includes/lib'; @import '../../../protocol/css/components/billboard'; @import '../../../protocol/css/components/call-out'; @import '../../../protocol/css/components/modal'; @import '../../../protocol/css/components/newsletter-form'; @import '../../../protocol/css/templates/card-layout'; .main-page-heading { @include visually-hidden; } .mozilla-content { margin-top: $spacing-lg; } //* -------------------------------------------------------------------------- */ // Primary CTA (page top) .c-primary-cta { background-color: $color-white; min-height: 359px; position: relative; text-align: center; z-index: 2; // so it hides the sticky CTA } .c-primary-cta-wrapper { position: relative; padding-top: $layout-sm; p { margin-bottom: 0; } } .c-primary-cta-logo { margin: 0 auto $spacing-lg auto; } .c-primary-cta-title { @include text-title-lg; margin-bottom: 0; } h3, h4 { &.c-primary-cta-title-sub { @include font-base; @include text-title-sm; max-width: 430px; margin: 0 auto; } } .c-primary-cta-desc { @include text-body-lg; } .c-primary-cta-button { margin-top: $layout-sm; } .mzp-c-button-download-container { margin-bottom: 0; } @media #{$mq-md} { .c-primary-cta-wrapper { padding-bottom: $layout-sm; } .c-primary-cta-logo { margin-bottom: $spacing-xl; } } @media #{$mq-lg} { .c-primary-cta { @include bidi(((text-align, left, right),)); position: relative; .c-primary-cta-wrapper { @include border-box; max-width: 50%; } .c-primary-cta-title-sub { margin: 0; } } .download-firefox-primary-cta { background-image: url('/media/img/home/2018/browser.png'), url('/media/img/home/2018/bg-primary.svg'); background-size: 400px 278px, auto; background-position: calc(50vw + 34px) 60px, calc(50vw - 41px) -78px; background-repeat: no-repeat; @media #{$mq-high-res} { background-image: url('/media/img/home/2018/browser-high-res.png'), url('/media/img/home/2018/bg-primary.svg'); } } .fxaccount-primary-cta { @include at2x('/media/img/home/2018/home.jpg', 815px, 362px); background-position: 50vw 0; background-repeat: no-repeat; } } //* -------------------------------------------------------------------------- */ // Conditional content // Hide Firefox Account CTAs by default; show download unless we know otherwise. .fxaccount-primary-cta, .fxaccount-secondary-cta { display: none; } // Hide download CTAs for people already using Firefox; promote Firefox Accounts instead. .is-firefox { .download-firefox-primary-cta, .download-firefox-secondary-cta { display: none; } .fxaccount-primary-cta, .fxaccount-secondary-cta { display: block; } } /* -------------------------------------------------------------------------- */ // Custom card styles for lazy-loaded images. .mzp-c-card { .lazy-image-container .mzp-c-card-image { opacity: 1; transition: opacity 0.3s; } .lazy-image-container .mzp-c-card-image[data-src] { opacity: 0; } } /* -------------------------------------------------------------------------- */ // Pocket highlights section. .pocket { background: #f5f5f5; margin: 20px 0; .section-heading { @include text-title-xs; margin-bottom: $spacing-sm; } .tagline { color: #676767; a:link, a:visited { color: inherit; } a:hover, a:active, a:focus { color: #000; } } @media #{$mq-md} { margin: $spacing-xl 0 0; padding-top: $spacing-lg; } } //* -------------------------------------------------------------------------- */ // Secondary Download CTA (page bottom) .c-secondary-cta { background-color: $color-ink-80; color: #fff; overflow: hidden; position: relative; text-align: center; z-index: 2; p { margin-bottom: 0; } } .c-secondary-cta-title { @include at2x('#{$image-path}/logos/firefox/browser/logo-sm.png', 40px, 40px); @include text-title-md; background-position: center 35px; background-repeat: no-repeat; margin-bottom: $spacing-sm; padding-top: 90px; } .c-secondary-cta-button { margin-bottom: $spacing-lg; margin-top: $spacing-xl; } @media #{$mq-lg} { .c-secondary-cta { @include bidi(((text-align, left, right),)); background-image: url('/media/img/home/2018/shield.svg'), url('/media/img/home/2018/bg-secondary.svg'); background-position: calc(50vw + 100px) 120px, 50vw 0; background-repeat: no-repeat; padding: $layout-xs 0 $layout-sm 0; } .c-secondary-cta-content { max-width: 48%; } .c-secondary-cta-title { background-position: left 35px; } } @media #{$mq-xl} { .c-secondary-cta { background-position: calc(50vw + 30px) 120px, 45vw 0; } } //* -------------------------------------------------------------------------- */ // Secondary FxA CTA (page bottom) .fxaccount-secondary-cta.mzp-t-dark { background-color: $color-ink-80; } .fxaccount-secondary-cta.mzp-t-product-firefox { .mzp-c-call-out-content { @include at2x('#{$image-path}/logos/firefox/logo-md.png', 64px, 64px); } .mzp-c-call-out-title { margin-bottom: $spacing-md; } } //* -------------------------------------------------------------------------- */ // YouTube iframe responsive in modal. .ytcontainer-video { max-width: 100%; .video-container { height: 0; margin-bottom: $spacing-lg; overflow: hidden; padding-bottom: 56.25%; position: relative; width: 100%; } iframe { height: 100%; left: 0; position: absolute; top:0; width: 100%; } }
{ "pile_set_name": "Github" }
/* * Request reply cache. This was heavily inspired by the * implementation in 4.3BSD/4.4BSD. * * Copyright (C) 1995, 1996 Olaf Kirch <[email protected]> */ #ifndef NFSCACHE_H #define NFSCACHE_H #include <linux/sunrpc/svc.h> /* * Representation of a reply cache entry. * * Note that we use a sockaddr_in6 to hold the address instead of the more * typical sockaddr_storage. This is for space reasons, since sockaddr_storage * is much larger than a sockaddr_in6. */ struct svc_cacherep { struct list_head c_lru; unsigned char c_state, /* unused, inprog, done */ c_type, /* status, buffer */ c_secure : 1; /* req came from port < 1024 */ struct sockaddr_in6 c_addr; __be32 c_xid; u32 c_prot; u32 c_proc; u32 c_vers; unsigned int c_len; __wsum c_csum; unsigned long c_timestamp; union { struct kvec u_vec; __be32 u_status; } c_u; }; #define c_replvec c_u.u_vec #define c_replstat c_u.u_status /* cache entry states */ enum { RC_UNUSED, RC_INPROG, RC_DONE }; /* return values */ enum { RC_DROPIT, RC_REPLY, RC_DOIT }; /* * Cache types. * We may want to add more types one day, e.g. for diropres and * attrstat replies. Using cache entries with fixed length instead * of buffer pointers may be more efficient. */ enum { RC_NOCACHE, RC_REPLSTAT, RC_REPLBUFF, }; /* * If requests are retransmitted within this interval, they're dropped. */ #define RC_DELAY (HZ/5) /* Cache entries expire after this time period */ #define RC_EXPIRE (120 * HZ) /* Checksum this amount of the request */ #define RC_CSUMLEN (256U) int nfsd_reply_cache_init(void); void nfsd_reply_cache_shutdown(void); int nfsd_cache_lookup(struct svc_rqst *); void nfsd_cache_update(struct svc_rqst *, int, __be32 *); int nfsd_reply_cache_stats_open(struct inode *, struct file *); #endif /* NFSCACHE_H */
{ "pile_set_name": "Github" }
; RUN: opt < %s -gvn | llvm-dis %struct.ggBRDF = type { i32 (...)** } %struct.ggBox3 = type { %struct.ggPoint3, %struct.ggPoint3 } %struct.ggMaterialRecord = type { %struct.ggPoint2, %struct.ggBox3, %struct.ggBox3, %struct.ggSpectrum, %struct.ggSpectrum, %struct.ggSpectrum, %struct.ggBRDF*, i32, i32, i32, i32 } %struct.ggONB3 = type { %struct.ggPoint3, %struct.ggPoint3, %struct.ggPoint3 } %struct.ggPoint2 = type { [2 x double] } %struct.ggPoint3 = type { [3 x double] } %struct.ggSpectrum = type { [8 x float] } %struct.mrViewingHitRecord = type { double, %struct.ggPoint3, %struct.ggONB3, %struct.ggPoint2, double, %struct.ggSpectrum, %struct.ggSpectrum, i32, i32, i32, i32 } %struct.mrXEllipticalCylinder = type { %struct.ggBRDF, float, float, float, float, float, float } define i32 @_ZNK21mrZEllipticalCylinder10viewingHitERK6ggRay3dddR18mrViewingHitRecordR16ggMaterialRecord(%struct.mrXEllipticalCylinder* %this, %struct.ggBox3* %ray, double %unnamed_arg, double %tmin, double %tmax, %struct.mrViewingHitRecord* %VHR, %struct.ggMaterialRecord* %unnamed_arg2) { entry: %tmp80.i = getelementptr %struct.mrViewingHitRecord* %VHR, i32 0, i32 1, i32 0, i32 0 ; <double*> [#uses=1] store double 0.000000e+00, double* %tmp80.i br i1 false, label %return, label %cond_next.i cond_next.i: ; preds = %entry br i1 false, label %return, label %cond_true cond_true: ; preds = %cond_next.i %tmp3.i8 = getelementptr %struct.mrViewingHitRecord* %VHR, i32 0, i32 1, i32 0, i32 0 ; <double*> [#uses=1] %tmp46 = load double* %tmp3.i8 ; <double> [#uses=0] ret i32 1 return: ; preds = %cond_next.i, %entry ret i32 0 }
{ "pile_set_name": "Github" }
import { Capacitor } from '@capacitor/core' import h from 'mithril/hyperscript' import settings from '../settings' import Gesture from '../utils/Gesture' import { viewportDim } from './helper' import * as menu from './menu' import MenuView from './menu/menuView' import gamesMenu from './gamesMenu' import newGameForm from './newGameForm' import playMachineForm from './playMachineForm' import challengeForm from './challengeForm' import loginModal from './loginModal' import signupModal from './signupModal' import friendsPopup from './friendsPopup' import lobby from './lobby' import EdgeOpenHandler, { Handlers } from './shared/sideMenu/EdgeOpenHandler' import MainBoard from './shared/layout/MainBoard' let background: string export default { onBackgroundChange(bg: string) { background = bg }, board( header: Mithril.Children, content: Mithril.Children, key?: string, overlay?: Mithril.Children, handlers?: Handlers, color?: string, klass?: string, ) { background = background || settings.general.theme.background() const opts = key ? { key, ...containerOpts(background) } : containerOpts(background) return h('div.view-container', opts, [ h(MainBoard, { header, color, handlers, klass }, content), h(MenuView), gamesMenu.view(), loginModal.view(), signupModal.view(), newGameForm.view(), playMachineForm.view(), challengeForm.view(), friendsPopup.view(), lobby.view(), overlay ]) }, free( header: Mithril.Children, content: Mithril.Children, footer?: Mithril.Children, overlay?: Mithril.Children, scrollListener?: (e: Event) => void ) { background = background || settings.general.theme.background() return h('div.view-container', containerOpts(background), [ h('main#page', { oncreate: handleMenuOpen }, [ h('header.main_header', header), h('div#free_content.content.native_scroller', { className: footer ? 'withFooter' : '', oncreate: ({ dom }) => { if (scrollListener) { dom.addEventListener('scroll', scrollListener) } } }, content), footer ? h('footer.main_footer', footer) : null, h('div#menu-close-overlay.menu-backdrop', { oncreate: menu.backdropCloseHandler }) ]), h(MenuView), gamesMenu.view(), loginModal.view(), signupModal.view(), newGameForm.view(), playMachineForm.view(), challengeForm.view(), friendsPopup.view(), lobby.view(), overlay ]) }, clock(content: () => Mithril.Children, overlay?: () => Mithril.Children) { background = background || settings.general.theme.background() return h('div.view-container', containerOpts(background), [ h('main#page', [ h('div.content.fullScreen', content()) ]), overlay ? overlay() : null ]) } } function handleMenuOpen({ dom }: Mithril.VnodeDOM<any, any>) { const mainEl = dom as HTMLElement const gesture = new Gesture(mainEl, viewportDim(), { passiveMove: Capacitor.platform !== 'ios' }) const defaultHandlers: Handlers = EdgeOpenHandler(menu.mainMenuCtrl) for (const eventName in defaultHandlers) { gesture.on(eventName, defaultHandlers[eventName](gesture)) } } function bgClass(bgTheme: string) { return bgTheme === 'dark' || bgTheme === 'light' ? bgTheme : 'transp ' + bgTheme } function containerOpts(bgTheme: string) { return { className: bgClass(bgTheme) } }
{ "pile_set_name": "Github" }
--- name: test on: [push, pull_request] jobs: build: runs-on: ubuntu-latest continue-on-error: ${{ matrix.continue-on-error }} strategy: matrix: python-version: [3.6, 3.7, 3.8] django-version: [ 'Django~=1.11.0', 'Django~=2.2.0', 'Django~=3.0.0', 'Django~=3.1.0', ] continue-on-error: [false] include: - python-version: 3.8 django-version: 'https://github.com/django/django/archive/master.zip' continue-on-error: true steps: - uses: actions/checkout@v2 - name: Set up Python ${{ matrix.python-version }} uses: actions/setup-python@v1 with: python-version: ${{ matrix.python-version }} - name: Install poetry run: | curl -sSL \ "https://raw.githubusercontent.com/python-poetry/poetry/master/get-poetry.py" | python - name: Set up cache uses: actions/cache@v1 with: path: .venv key: venv-${{ matrix.python-version }}-${{ matrix.django-version }}-${{ hashFiles('poetry.lock') }} - name: Install dependencies run: | source "$HOME/.poetry/env" poetry config virtualenvs.in-project true poetry install pip install -U "${{ matrix.django-version }}" - name: "Run checks for python ${{ matrix.python-version }} and django ${{ matrix.django-version }}" run: | source "$HOME/.poetry/env" make test - name: Upload coverage to Codecov uses: codecov/codecov-action@v1 with: file: ./coverage.xml
{ "pile_set_name": "Github" }
-----BEGIN CERTIFICATE----- MIIDzTCCArWgAwIBAgIHBHOzO9RD2jANBgkqhkiG9w0BAQsFADCBmTELMAkGA1UE BhMCVVMxEzARBgNVBAgMCkNhbGlmb3JuaWExEjAQBgNVBAcMCUxvcyBHYXRvczEU MBIGA1UECgwLTmV0ZmxpeCBJbmMxLTArBgNVBAsMJFBsYXRmb3JtIFNlY3VyaXR5 ICgxMjUzMTEzMzU0MTg1MDM1KTEcMBoGA1UEAwwTTG9jYWwgUm9vdCBmb3IgMzE1 MTAeFw0yMDA3MTQwMzM0MTNaFw0yMTA3MTQwMzA5NDRaMIGeMQswCQYDVQQGEwJV UzETMBEGA1UECAwKQ2FsaWZvcm5pYTESMBAGA1UEBwwJTG9zIEdhdG9zMRQwEgYD VQQKDAtOZXRmbGl4IEluYzEtMCsGA1UECwwkUGxhdGZvcm0gU2VjdXJpdHkgKDEy NTMxMTM1NDY5MzMxNDEpMSEwHwYDVQQDDBhJbnRlcm1lZGlhdGUgQ0EgZm9yIDMx NTEwggEiMA0GCSqGSIb3DQEBAQUAA4IBDwAwggEKAoIBAQCxNEvqN7qlKQ0jkcNx GSiPMHDkppZDTuiDxgn6Muc1Ulhk/jCxpGzCfnJbni1QWR/k6pRQlB3LXTTyjOuT R6BSX8Rj+x9QTuULVLHsQlcc7hk7wa6OHw6MNjmqu6sqIGr6+TCXTiaa9GW4AXoP QPpw1j2qfatRCbV4ED/wN5f5LDGSvJ1uRKK1w+d3S7DZNx6VQ1JI774mFqhgGiUV pOrG+rxXHef+b3k/rEjtHjcoMdqG/scRvaTIu4H/1v4+fbKqrpjxI7CO5HyuxKEz fpepTzgyZ2UvuzV3ZKqg4XQ0IM24L3iFU9G42arEpAsjExRBZz2jglwUJjCN9fJT ZbVhAgMBAAGjEzARMA8GA1UdEwEB/wQFMAMBAf8wDQYJKoZIhvcNAQELBQADggEB AFnJ9t5dDPQLv7+d3YcExozRxO4b+02CHWIuiPtnCkeBfr6rcMu8wIuDxRfn7QOB ip0526Nt/WP7CkxkVn3wjipV1IfNR3rdLRQozlQZqllrWQuHpO/6WRkJ304gxWFf L8kDPRKlmn+DhOjWxjA3XUXwJyfrZvsWls2r/nBKTXm2bj8Y/6QtNjGG64JGXIgs SCKAqLktbS2ooc/arOXLP31F0jgJfZ+dA0lv2Z/pK7gZQpnJBhOrM9bvxhFguDwL eSKQSuk07T+Ru0Jt4N3QzgrHN1pKJmuFuALwnLAhAocNabuR91nyxDaXqaVrQuIb gMif2yMZaHby0t8LCKOYt1s= -----END CERTIFICATE----- -----BEGIN CERTIFICATE----- MIID/TCCAuWgAwIBAgIHBHOzMFcwcTANBgkqhkiG9w0BAQsFADCBozELMAkGA1UE BhMCVVMxEzARBgNVBAgMCkNhbGlmb3JuaWExEjAQBgNVBAcMCUxvcyBHYXRvczEU MBIGA1UECgwLTmV0ZmxpeCBJbmMxLTArBgNVBAsMJFBsYXRmb3JtIFNlY3VyaXR5 ICgxMjUxNjQ1MDA4NDUxNjU2KTEmMCQGA1UEAwwdTmFtZSBDb25zdHJhaW50cyBU ZXN0IFJvb3QgQ0EwHhcNMjAwNzE0MDMzNDEyWhcNMjEwNzE0MDMwOTQ0WjCBmTEL MAkGA1UEBhMCVVMxEzARBgNVBAgMCkNhbGlmb3JuaWExEjAQBgNVBAcMCUxvcyBH YXRvczEUMBIGA1UECgwLTmV0ZmxpeCBJbmMxLTArBgNVBAsMJFBsYXRmb3JtIFNl Y3VyaXR5ICgxMjUzMTEzMzU0MTg1MDM1KTEcMBoGA1UEAwwTTG9jYWwgUm9vdCBm b3IgMzE1MTCCASIwDQYJKoZIhvcNAQEBBQADggEPADCCAQoCggEBALMVy1JSH2bY aexrNwK9TLFW4ckROyrOgoHPdKvvin25vuCQ0NWDMReZoWnxDY9VVRSEv3EY8Bda 9D58r76j5jG3vRdNUJ7z+u3JEvWpJCx4cUeGeJhoKr9Ez7eQtoFNOa0DSEYdLu5w WcaLEqU1JxNs/owUVCj8FNKwDi+BVAO3gqy46+5cVDnOT7xmHGSkmLR6BYFI/WlG Dpz8yODpbq+xW6ffTdnHW0Cr/zp5BoFWcLYxWRUr4HjK7POUfnwOjqWYGoas6qae vG3szmv7dkeSB4ILr0X+mfXs81VAFnehiIIE0m1O2aPUZXiJiiBjVEg1EMBAFA88 OhZvpl1sP3kCAwEAAaM+MDwwDwYDVR0TAQH/BAUwAwEB/zApBgNVHR4BAf8EHzAd oBswCocIwKgAAP//AAAwDYILZXhhbXBsZS5uZXQwDQYJKoZIhvcNAQELBQADggEB AAjwmyza/ZMKlGQ7UvlM6E08f9gDqJua5YuazJ5anRIuCL+2h5STvB3x3wBED/PM 74XITHZxkgCrbT181wG9/TkOvXSTmsSW/C/EtZNzBeDFqfbX6S3A/E8pO+tJfgv7 I3AQSrdrYuf/9R4CzNSk4yQkICQ7Tgz0wxMzrfMBrsWvKFiDRavQgJh37Vxx6DrS THQleaoKgLYFjAwPzkMV/Sg4XzA0nuFSHgoqVJvBIrkkvt3JXHZGru5nvsZx9yLX Uy2aYzXjtZ9VNSl7SFpYWbfAjLHKw/UdM1FM0LCNJI9UIiWG4AtC8Vg0AKbIZ2N5 CECnO+uwvR/D/YNV06iUAvU= -----END CERTIFICATE----- -----BEGIN CERTIFICATE----- MIID3DCCAsSgAwIBAgIHBHJdU5tTvDANBgkqhkiG9w0BAQsFADCBozELMAkGA1UE BhMCVVMxEzARBgNVBAgMCkNhbGlmb3JuaWExEjAQBgNVBAcMCUxvcyBHYXRvczEU MBIGA1UECgwLTmV0ZmxpeCBJbmMxLTArBgNVBAsMJFBsYXRmb3JtIFNlY3VyaXR5 ICgxMjUxNjQ1MDA4NDUxNjU2KTEmMCQGA1UEAwwdTmFtZSBDb25zdHJhaW50cyBU ZXN0IFJvb3QgQ0EwHhcNMjAwNzE0MDMwOTQ0WhcNMjEwNzE0MDMwOTQ0WjCBozEL MAkGA1UEBhMCVVMxEzARBgNVBAgMCkNhbGlmb3JuaWExEjAQBgNVBAcMCUxvcyBH YXRvczEUMBIGA1UECgwLTmV0ZmxpeCBJbmMxLTArBgNVBAsMJFBsYXRmb3JtIFNl Y3VyaXR5ICgxMjUxNjQ1MDA4NDUxNjU2KTEmMCQGA1UEAwwdTmFtZSBDb25zdHJh aW50cyBUZXN0IFJvb3QgQ0EwggEiMA0GCSqGSIb3DQEBAQUAA4IBDwAwggEKAoIB AQCiIhD8HJBlLveXSen5+3nyOOA4HM8H/SDGR7ufNeSHmkdSh7s4fm4pmzNEpDz7 UVv403NnSqE4PsunMx5H7OK8C0E6vUmOIGRmHvSxHbP7bleko4SR9jJ7T3RU1HpJ BYESszrbAvoYEwpyUI6a20bmokAHOgU/BN1SIyMzacVVwhDmmQOcDc37SUSCFKen Clavf1vgtt15SE3oZF7GN8M4SSF/8aKcypt3xaGE0HvRVu9JRBDjIU7GMLcYnWV3 /6UC1GuwgvA9sEGS857kOcwt5V5vF8FHrfXv63/1QcOyWXuGL2oHUqwuKP9lTgkc LZUdXczvLrtW1dxtg05tU6VDAgMBAAGjEzARMA8GA1UdEwEB/wQFMAMBAf8wDQYJ KoZIhvcNAQELBQADggEBAErEOumWJjc7bgQQmnviDl075fnYHidlY5SkjdwFcSCK ZSolT8z7xvtpW10mbM8msvzNreLmNBASEiP7NlI4bxZpQJ1RJ1tR0ybe2cD0171A 23/1kza49x+3IorUwQZrRSAksBpNqggMbmgqy3lMlNy8V2EtmO2I/4C5nsN8/uys j6JmeEcJFa7rr4YgYsDZwosIOX7XQDy3Xb7rJEmLpRs+VmjbgsT/0ncqkfLqDJ5+ UtBofdpGTqCk+0rJf1sVDEtZp/wYo1236W5AAAeWrFlM7ht3CZdQCBsoV4pZ5m6h 2+oC85m5hDidnH5/0Er88jR9kHxdM5dJNOU+vdY/XpA= -----END CERTIFICATE-----
{ "pile_set_name": "Github" }
/* Copyright 2008-2010 Gephi Authors : Eduardo Ramos <[email protected]> Website : http://www.gephi.org This file is part of Gephi. DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS HEADER. Copyright 2011 Gephi Consortium. All rights reserved. The contents of this file are subject to the terms of either the GNU General Public License Version 3 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 http://gephi.org/about/legal/license-notice/ or /cddl-1.0.txt and /gpl-3.0.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 files at /cddl-1.0.txt and /gpl-3.0.txt. If applicable, add the following below the License Header, with the fields enclosed by brackets [] replaced by your own identifying information: "Portions Copyrighted [year] [name of copyright owner]" If you wish your version of this file to be governed by only the CDDL or only the GPL Version 3, indicate your decision by adding "[Contributor] elects to include this software in this distribution under the [CDDL or GPL Version 3] license." If you do not 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 3 or to extend the choice of license to its licensees as provided above. However, if you add GPL Version 3 code and therefore, elected the GPL Version 3 license, then the option applies only if the new code is made subject to such option by the copyright holder. Contributor(s): Portions Copyrighted 2011 Gephi Consortium. */ package org.gephi.tools.api; import org.gephi.graph.api.Edge; import org.gephi.graph.api.Node; /** * Controller API for requesting the opening and usage of edit window. * @author Eduardo Ramos */ public interface EditWindowController { void openEditWindow(); void closeEditWindow(); boolean isOpen(); void editNode(Node node); void editNodes(final Node[] nodes); void editEdge(final Edge edge); void editEdges(final Edge[] edges); void disableEdit(); }
{ "pile_set_name": "Github" }
/* * * Copyright 2018 gRPC 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 binarylog implementation binary logging as defined in // https://github.com/grpc/proposal/blob/master/A16-binary-logging.md. package binarylog import ( "fmt" "os" "google.golang.org/grpc/grpclog" ) // Logger is the global binary logger. It can be used to get binary logger for // each method. type Logger interface { getMethodLogger(methodName string) *MethodLogger } // binLogger is the global binary logger for the binary. One of this should be // built at init time from the configuration (environment variable or flags). // // It is used to get a methodLogger for each individual method. var binLogger Logger // SetLogger sets the binarg logger. // // Only call this at init time. func SetLogger(l Logger) { binLogger = l } // GetMethodLogger returns the methodLogger for the given methodName. // // methodName should be in the format of "/service/method". // // Each methodLogger returned by this method is a new instance. This is to // generate sequence id within the call. func GetMethodLogger(methodName string) *MethodLogger { if binLogger == nil { return nil } return binLogger.getMethodLogger(methodName) } func init() { const envStr = "GRPC_BINARY_LOG_FILTER" configStr := os.Getenv(envStr) binLogger = NewLoggerFromConfigString(configStr) } type methodLoggerConfig struct { // Max length of header and message. hdr, msg uint64 } type logger struct { all *methodLoggerConfig services map[string]*methodLoggerConfig methods map[string]*methodLoggerConfig blacklist map[string]struct{} } // newEmptyLogger creates an empty logger. The map fields need to be filled in // using the set* functions. func newEmptyLogger() *logger { return &logger{} } // Set method logger for "*". func (l *logger) setDefaultMethodLogger(ml *methodLoggerConfig) error { if l.all != nil { return fmt.Errorf("conflicting global rules found") } l.all = ml return nil } // Set method logger for "service/*". // // New methodLogger with same service overrides the old one. func (l *logger) setServiceMethodLogger(service string, ml *methodLoggerConfig) error { if _, ok := l.services[service]; ok { return fmt.Errorf("conflicting service rules for service %v found", service) } if l.services == nil { l.services = make(map[string]*methodLoggerConfig) } l.services[service] = ml return nil } // Set method logger for "service/method". // // New methodLogger with same method overrides the old one. func (l *logger) setMethodMethodLogger(method string, ml *methodLoggerConfig) error { if _, ok := l.blacklist[method]; ok { return fmt.Errorf("conflicting blacklist rules for method %v found", method) } if _, ok := l.methods[method]; ok { return fmt.Errorf("conflicting method rules for method %v found", method) } if l.methods == nil { l.methods = make(map[string]*methodLoggerConfig) } l.methods[method] = ml return nil } // Set blacklist method for "-service/method". func (l *logger) setBlacklist(method string) error { if _, ok := l.blacklist[method]; ok { return fmt.Errorf("conflicting blacklist rules for method %v found", method) } if _, ok := l.methods[method]; ok { return fmt.Errorf("conflicting method rules for method %v found", method) } if l.blacklist == nil { l.blacklist = make(map[string]struct{}) } l.blacklist[method] = struct{}{} return nil } // getMethodLogger returns the methodLogger for the given methodName. // // methodName should be in the format of "/service/method". // // Each methodLogger returned by this method is a new instance. This is to // generate sequence id within the call. func (l *logger) getMethodLogger(methodName string) *MethodLogger { s, m, err := parseMethodName(methodName) if err != nil { grpclog.Infof("binarylogging: failed to parse %q: %v", methodName, err) return nil } if ml, ok := l.methods[s+"/"+m]; ok { return newMethodLogger(ml.hdr, ml.msg) } if _, ok := l.blacklist[s+"/"+m]; ok { return nil } if ml, ok := l.services[s]; ok { return newMethodLogger(ml.hdr, ml.msg) } if l.all == nil { return nil } return newMethodLogger(l.all.hdr, l.all.msg) }
{ "pile_set_name": "Github" }
fileFormatVersion: 2 guid: 2d9942e581e72d445b76449a9b3efc10 timeCreated: 1521514016 licenseType: Pro TextScriptImporter: externalObjects: {} userData: assetBundleName: assetBundleVariant:
{ "pile_set_name": "Github" }
var path = require("path"); var blanket = require("../../src/index")({ "pattern":"/src/blanket" }); /* since we're using blanket to test blanket, we need to remove the module entry from the require cache so that it can be instrumented. */ delete require.cache[path.normalize(__dirname+"/../../src/blanket.js")]; /* now start the tests */ require("./tests/blanket_core"); require("./tests/nested_test"); require("./tests/instrumentation_test");
{ "pile_set_name": "Github" }
package biz.dealnote.messenger.api.services; import java.util.List; import biz.dealnote.messenger.api.model.GroupSettingsDto; import biz.dealnote.messenger.api.model.Items; import biz.dealnote.messenger.api.model.VKApiCommunity; import biz.dealnote.messenger.api.model.VKApiUser; import biz.dealnote.messenger.api.model.VkApiBanned; import biz.dealnote.messenger.api.model.response.BaseResponse; import biz.dealnote.messenger.api.model.response.GroupLongpollServer; import biz.dealnote.messenger.api.model.response.GroupWallInfoResponse; import io.reactivex.Single; import retrofit2.http.Field; import retrofit2.http.FormUrlEncoded; import retrofit2.http.POST; /** * Created by admin on 04.01.2017. * phoenix */ public interface IGroupsService { @FormUrlEncoded @POST("groups.editManager") Single<BaseResponse<Integer>> editManager(@Field("group_id") int groupId, @Field("user_id") int userId, @Field("role") String role, @Field("is_contact") Integer isContact, @Field("contact_position") String contactPosition, @Field("contact_phone") String contactPhone, @Field("contact_email") String contactEmail); @FormUrlEncoded @POST("groups.unban") Single<BaseResponse<Integer>> unban(@Field("group_id") int groupId, @Field("owner_id") int ownerId); @POST("groups.ban") @FormUrlEncoded Single<BaseResponse<Integer>> ban(@Field("group_id") int groupId, @Field("owner_id") int ownerId, @Field("end_date") Long endDate, @Field("reason") Integer reason, @Field("comment") String comment, @Field("comment_visible") Integer commentVisible); @FormUrlEncoded @POST("groups.getSettings") Single<BaseResponse<GroupSettingsDto>> getSettings(@Field("group_id") int groupId); //https://vk.com/dev/groups.getBanned @FormUrlEncoded @POST("groups.getBanned") Single<BaseResponse<Items<VkApiBanned>>> getBanned(@Field("group_id") int groupId, @Field("offset") Integer offset, @Field("count") Integer count, @Field("fields") String fields, @Field("user_id") Integer userId); @FormUrlEncoded @POST("execute.getCommunityWallInfo") Single<BaseResponse<GroupWallInfoResponse>> getGroupWallInfo(@Field("group_id") String groupId, @Field("fields") String fields); @FormUrlEncoded @POST("groups.getMembers") Single<BaseResponse<Items<VKApiUser>>> getMembers(@Field("group_id") String groupId, @Field("sort") Integer sort, @Field("offset") Integer offset, @Field("count") Integer count, @Field("fields") String fields, @Field("filter") String filter); //https://vk.com/dev/groups.search @FormUrlEncoded @POST("groups.search") Single<BaseResponse<Items<VKApiCommunity>>> search(@Field("q") String query, @Field("type") String type, @Field("country_id") Integer countryId, @Field("city_id") Integer cityId, @Field("future") Integer future, @Field("market") Integer market, @Field("sort") Integer sort, @Field("offset") Integer offset, @Field("count") Integer count); @FormUrlEncoded @POST("groups.getLongPollServer") Single<BaseResponse<GroupLongpollServer>> getLongPollServer(@Field("group_id") int groupId); //https://vk.com/dev/groups.leave @FormUrlEncoded @POST("groups.leave") Single<BaseResponse<Integer>> leave(@Field("group_id") int groupId); //https://vk.com/dev/groups.join @FormUrlEncoded @POST("groups.join") Single<BaseResponse<Integer>> join(@Field("group_id") int groupId, @Field("not_sure") Integer notSure); //https://vk.com/dev/groups.get @FormUrlEncoded @POST("groups.get") Single<BaseResponse<Items<VKApiCommunity>>> get(@Field("user_id") Integer userId, @Field("extended") Integer extended, @Field("filter") String filter, @Field("fields") String fields, @Field("offset") Integer offset, @Field("count") Integer count); /** * Returns information about communities by their IDs. * * @param groupIds IDs or screen names of communities. * List of comma-separated words * @param groupId ID or screen name of the community * @param fields Group fields to return. List of comma-separated words * @return an array of objects describing communities */ @FormUrlEncoded @POST("groups.getById") Single<BaseResponse<List<VKApiCommunity>>> getById(@Field("group_ids") String groupIds, @Field("group_id") String groupId, @Field("fields") String fields); }
{ "pile_set_name": "Github" }
/* * Copyright (C) 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. */ package com.android.printspooler.model; /** * Callbacks interface for opening a file. */ public interface OpenDocumentCallback { public static final int ERROR_MALFORMED_PDF_FILE = -1; public static final int ERROR_SECURE_PDF_FILE = -2; /** * Called after the file is opened. */ public void onSuccess(); /** * Called after opening the file failed. * * @param error The error. */ public void onFailure(int error); }
{ "pile_set_name": "Github" }
/* * Copyright (C) 2007 The Guava 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.google.common.collect; import static com.google.common.base.Preconditions.checkNotNull; import com.google.common.annotations.GwtCompatible; import java.io.Serializable; import java.util.Comparator; import javax.annotation.Nullable; /** An ordering for a pre-existing comparator. */ @GwtCompatible(serializable = true) final class ComparatorOrdering<T> extends Ordering<T> implements Serializable { final Comparator<T> comparator; ComparatorOrdering(Comparator<T> comparator) { this.comparator = checkNotNull(comparator); } @Override public int compare(T a, T b) { return comparator.compare(a, b); } @Override public boolean equals(@Nullable Object object) { if (object == this) { return true; } if (object instanceof ComparatorOrdering) { ComparatorOrdering<?> that = (ComparatorOrdering<?>) object; return this.comparator.equals(that.comparator); } return false; } @Override public int hashCode() { return comparator.hashCode(); } @Override public String toString() { return comparator.toString(); } private static final long serialVersionUID = 0; }
{ "pile_set_name": "Github" }
# Copyright 2019 Google LLC # # 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. """Examples for the Cloud Spanner C++ client library.""" package(default_visibility = ["//visibility:public"]) licenses(["notice"]) # Apache 2.0 load(":spanner_client_integration_samples.bzl", "spanner_client_integration_samples") load(":spanner_client_unit_samples.bzl", "spanner_client_unit_samples") [cc_test( name = test.replace("/", "_").replace(".cc", ""), timeout = "long", srcs = [test], tags = [ "integration-test", ], deps = [ "//google/cloud:google_cloud_cpp_common", "//google/cloud/spanner:spanner_client", "//google/cloud/spanner:spanner_client_testing", "//google/cloud/testing_util:google_cloud_cpp_testing", "@com_google_googletest//:gtest_main", ], ) for test in spanner_client_integration_samples] [cc_test( name = test.replace("/", "_").replace(".cc", ""), srcs = [test], deps = [ "//google/cloud:google_cloud_cpp_common", "//google/cloud/spanner:spanner_client", "//google/cloud/spanner:spanner_client_testing", "//google/cloud/testing_util:google_cloud_cpp_testing", "@com_google_googletest//:gtest_main", ], ) for test in spanner_client_unit_samples]
{ "pile_set_name": "Github" }
/*$ Copyright (C) 2013-2020 Azel. This file is part of AzPainter. AzPainter is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version. AzPainter 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/>. $*/ /***************************************** * HLS パレット *****************************************/ #include "mDef.h" #include "mWidgetDef.h" #include "mWidget.h" #include "mSysCol.h" #include "mPixbuf.h" #include "mEvent.h" #include "mColorConv.h" #include "defDraw.h" //--------------------- typedef struct { mWidget wg; mPixbuf *img; int fdrag; }HLSPal; //--------------------- #define _TOP_H 10 #define _TOP_W 6 #define _BETWEEN 8 #define _PAL_W 12 #define _PAL_H 8 #define _PAL_XNUM 15 #define _PAL_YNUM 10 #define _PAL_TOPY (_TOP_H + _BETWEEN) #define _HUE_STEP 30 #define _HUE_STEP_VAL (360 / _HUE_STEP) #define _GET_L(x) (0.08 + (x) * 0.06) #define _GET_S(y) (1 - (y) * 0.1) enum { _DRAGF_TOP = 1, _DRAGF_PALETTE }; //--------------------- //======================== // 描画 //======================== /** H カーソル描画 */ static void _draw_cursor_top(HLSPal *p,mBool erase) { mPixbufDrawArrowUp(p->img, 1 + APP_DRAW->col.hlspal_sel * _TOP_W + _TOP_W / 2 - 1, _TOP_H + 1, (erase)? MSYSCOL(FACE): MSYSCOL(TEXT)); } /** パレットカーソル描画 */ static void _draw_cursor_pal(HLSPal *p,mBool erase) { mPixbufBox(p->img, APP_DRAW->col.hlspal_palx * _PAL_W, _PAL_TOPY + APP_DRAW->col.hlspal_paly * _PAL_H, _PAL_W + 1, _PAL_H + 1, (erase)? 0: MSYSCOL(WHITE)); } /** パレット色の描画 */ static void _draw_palette(HLSPal *p) { mPixbuf *img = p->img; int ix,iy,x,y,c[3],hue; double ds; hue = APP_DRAW->col.hlspal_sel * _HUE_STEP_VAL; for(iy = 0, y = _PAL_TOPY + 1; iy < _PAL_YNUM; iy++, y += _PAL_H) { ds = _GET_S(iy); for(ix = 0, x = 1; ix < _PAL_XNUM; ix++, x += _PAL_W) { mHLStoRGB(hue, _GET_L(ix), ds, c); mPixbufFillBox(img, x, y, _PAL_W - 1, _PAL_H - 1, mRGBtoPix2(c[0], c[1], c[2])); } } } /** 最初の描画 */ static void _draw_first(HLSPal *p) { mPixbuf *img = p->img; int w = p->wg.hintW,i,n,h,c[3]; //H 部分の枠 mPixbufBox(img, 0, 0, w, _TOP_H, 0); for(i = _HUE_STEP - 1, n = _TOP_W; i; i--, n += _TOP_W) mPixbufLineV(img, n, 1, _TOP_H - 2, 0); //H 色 for(i = 0, n = 1, h = 0; i < _HUE_STEP; i++, n += _TOP_W, h += _HUE_STEP_VAL) { mHLStoRGB(h, 0.5, 1.0, c); mPixbufFillBox(img, n, 1, _TOP_W - 1, _TOP_H - 2, mRGBtoPix2(c[0], c[1], c[2])); } //H とパレットの間 mPixbufFillBox(img, 0, _TOP_H, w, _BETWEEN, MSYSCOL(FACE)); //パレットの枠 for(i = _PAL_XNUM + 1, n = 0; i; i--, n += _PAL_W) mPixbufLineV(img, n, _PAL_TOPY, _PAL_H * _PAL_YNUM + 1, 0); for(i = _PAL_YNUM + 1, n = _PAL_TOPY; i; i--, n += _PAL_H) mPixbufLineH(img, 0, n, _PAL_W * _PAL_XNUM + 1, 0); //パレット色、カーソル _draw_palette(p); _draw_cursor_top(p, FALSE); _draw_cursor_pal(p, FALSE); } //======================== // sub //======================== /** 選択色を通知 */ static void _notify(HLSPal *p) { uint32_t col; col = mHLStoRGB_pac(APP_DRAW->col.hlspal_sel * _HUE_STEP_VAL, _GET_L(APP_DRAW->col.hlspal_palx), _GET_S(APP_DRAW->col.hlspal_paly)); /* DockColorPalette のタブ内容のメインコンテナに直接通知。 * 通知元は HLS パレットのタブ内容コンテナ。 */ mWidgetAppendEvent_notify(MWIDGET_NOTIFYWIDGET_RAW, p->wg.parent, 0, col, 0); } /** HUE 選択 */ static void _on_motion_top(HLSPal *p,int x) { x = (x - 1) / _TOP_W; if(x < 0) x = 0; else if(x >= _HUE_STEP) x = _HUE_STEP - 1; if(x != APP_DRAW->col.hlspal_sel) { _draw_cursor_top(p, TRUE); APP_DRAW->col.hlspal_sel = x; _draw_cursor_top(p, FALSE); _draw_palette(p); mWidgetUpdate(M_WIDGET(p)); _notify(p); } } /** パレット選択 */ static void _on_motion_palette(HLSPal *p,int x,int y) { //パレット位置 x = (x - 1) / _PAL_W; y = (y - _PAL_TOPY - 1) / _PAL_H; if(x < 0) x = 0; else if(x >= _PAL_XNUM) x = _PAL_XNUM - 1; if(y < 0) y = 0; else if(y >= _PAL_YNUM) y = _PAL_YNUM - 1; //前回位置と比較 if(x != APP_DRAW->col.hlspal_palx || y != APP_DRAW->col.hlspal_paly) { //カーソル _draw_cursor_pal(p, TRUE); APP_DRAW->col.hlspal_palx = x; APP_DRAW->col.hlspal_paly = y; _draw_cursor_pal(p, FALSE); mWidgetUpdate(M_WIDGET(p)); //色を通知 _notify(p); } } //======================== // ハンドラ //======================== /** 押し時 */ static void _event_press(HLSPal *p,int x,int y) { if(y < _PAL_TOPY) { //HUE p->fdrag = _DRAGF_TOP; _on_motion_top(p, x); } else { //パレット p->fdrag = _DRAGF_PALETTE; _on_motion_palette(p, x, y); } mWidgetGrabPointer(M_WIDGET(p)); } /** グラブ解除 */ static void _grab_release(HLSPal *p) { if(p->fdrag) { p->fdrag = 0; mWidgetUngrabPointer(M_WIDGET(p)); } } /** イベント */ static int _event_handle(mWidget *wg,mEvent *ev) { HLSPal *p = (HLSPal *)wg; switch(ev->type) { case MEVENT_POINTER: if(ev->pt.type == MEVENT_POINTER_TYPE_MOTION) { //移動 if(p->fdrag == _DRAGF_PALETTE) _on_motion_palette(p, ev->pt.x, ev->pt.y); else if(p->fdrag == _DRAGF_TOP) _on_motion_top(p, ev->pt.x); } else if(ev->pt.type == MEVENT_POINTER_TYPE_PRESS) { //押し if(ev->pt.btt == M_BTT_LEFT && !p->fdrag) _event_press(p, ev->pt.x, ev->pt.y); } else if(ev->pt.type == MEVENT_POINTER_TYPE_RELEASE) { //離し if(ev->pt.btt == M_BTT_LEFT) _grab_release(p); } break; case MEVENT_FOCUS: if(ev->focus.bOut) _grab_release(p); break; } return 1; } /** 描画 */ static void _draw_handle(mWidget *wg,mPixbuf *pixbuf) { mPixbufBlt(pixbuf, 0, 0, ((HLSPal *)wg)->img, 0, 0, -1, -1); } /** 破棄 */ static void _destroy_handle(mWidget *wg) { mPixbufFree(((HLSPal *)wg)->img); } /** 作成 */ mWidget *DockColorPalette_HLSPalette_new(mWidget *parent) { HLSPal *p; p = (HLSPal *)mWidgetNew(sizeof(HLSPal), parent); p->wg.fEventFilter |= MWIDGET_EVENTFILTER_POINTER; p->wg.hintW = _TOP_W * _HUE_STEP + 1; p->wg.hintH = _TOP_H + _BETWEEN + _PAL_H * _PAL_YNUM + 1; p->wg.destroy = _destroy_handle; p->wg.draw = _draw_handle; p->wg.event = _event_handle; //イメージ作成 p->img = mPixbufCreate(p->wg.hintW, p->wg.hintH); _draw_first(p); return (mWidget *)p; } /** テーマ変更時 */ void DockColorPalette_HLSPalette_changeTheme(mWidget *wg) { _draw_first((HLSPal *)wg); }
{ "pile_set_name": "Github" }
##Script for creating Modelnet40 Datasets # A Brock, 2016 # This code, in its current form, saves an NPZ file by reading in a .mat file # (previously prepared using the make_mats.m code) containing arrays of # the voxellated modelnet40 models, with 24 different rotations for each model. # Each 5D-array is organized in the format (instance-rotations-spatialdim1-spatialdim2-spatialdim3). # This code currently separates the rotations out such that each rotation is a separate instance, but if # you have GPU memory to spare and are feeling masochistic, you're welcome to treat the rotations as channels # (a la RGB in 2D imagery). I found that this didn't really change performance and just made my models take # up more memory. # # This file also has commented out code which is pretty close to being able to store this data in an # HDF5 dataset accessible by fuel, but no guarantees as I always had enough RAM available to load the # whole dataset and didn't really need to worry about the hard-disk format. import numpy as np import scipy.io from collections import OrderedDict # from fuel.datasets import IndexableDataset # from fuel.datasets.hdf5 import H5PYDataset # import h5py # Load data train = scipy.io.loadmat('train24_32.mat') # Delete extra .matfile stuff del train['__globals__'] del train['__header__'] del train['__version__'] # Prepare data arrays targets = np.asarray([],dtype=np.uint8); features = np.zeros((1,1,32,32,32),dtype=np.uint8); # Select which classes to read in class_keys = sorted(train.keys()) # class_keys = ["bathtub","bed", "chair", "desk", "dresser", "monitor", "night_stand","sofa", "table","toilet"] # Keys for modelnet10 for i,key in enumerate(class_keys): targets = np.append(targets,i*np.ones(24*len(train[key]),dtype=np.uint8)) features = np.append(features,np.reshape(train[key],(24*np.shape(train[key])[0],1,32,32,32)),axis=0) if i==0: features=np.delete(features,0,axis=0) del train[key] del train np.savez_compressed('modelnet40_rot24_train.npz',**{'features':features,'targets':targets}) # np.reshape(features,(12*np.shape(features)[0],1,32,32,32) # writer = npytar.NpyTarWriter(fname) # writer.add(targets,features) # features = np.delete(features,0,axis=0) # Delete first entry # f = h5py.File('dataset.hdf5', mode='w') # featureset = f.create_dataset('features',np.shape(features),dtype='uint8') # targetset = f.create_dataset('targets',np.shape(targets),dtype='uint8') # featureset[...] = features # targetset[...] = targets # featureset.dims[0].label = 'batch' # featureset.dims[0].label = 'rotation' # featureset.dims[0].label = 'i' # featureset.dims[0].label = 'j' # featureset.dims[0].label = 'k' # targetset.dims[0].label = 'batch' # split_dict = {'train': {'features': (0, len(targets)),'targets': (0, len(targets))}} # f.attrs['split'] = H5PYDataset.create_split_array(split_dict) # f.flush() # f.close() # dataset = IndexableDataset(indexables=OrderedDict([('features', features), ('targets', targets)]), # axis_labels=OrderedDict([('features', ('batch', 'rotation', 'i','j','k')), # ('targets', ('batch', 'index'))])) # Failed targets attempts # targets = np.zeros(sum([len(train[a_key]) for a_key in class_keys]),dtype=np.int) # targets = np.append(targets,i*np.ones(len(train[a_key])) for i,a_key in enumerate(class_keys)) # targets[i] = i*np.ones(len(train[class_keys[i]]));
{ "pile_set_name": "Github" }
proc factors {n} { set factors {} for {set i 1} {$i <= sqrt($n)} {incr i} { if {$n % $i == 0} { lappend factors $i [expr {$n / $i}] } } return [lsort -unique -integer $factors] } puts [factors 64] puts [factors 45] puts [factors 53]
{ "pile_set_name": "Github" }
ALTER TABLE packages RENAME TO crates; ALTER TABLE versions RENAME COLUMN package_id TO crate_id;
{ "pile_set_name": "Github" }
// -*- MPC -*- project(*latency_idl): taoidldefaults, strategies, avoids_minimum_corba, avoids_corba_e_compact, avoids_corba_e_micro { IDL_Files { Test.idl } custom_only = 1 } project(*latency server): taoserver, strategies, dynamicinterface, avoids_minimum_corba, avoids_corba_e_compact, avoids_corba_e_micro { after += *latency_idl Source_Files { Roundtrip.cpp server.cpp } IDL_Files { } } project(*latency client): taoclient, strategies, avoids_minimum_corba, avoids_corba_e_compact, avoids_corba_e_micro { after += *latency_idl avoids += ace_for_tao Source_Files { TestC.cpp client.cpp } IDL_Files { } }
{ "pile_set_name": "Github" }
{-# LANGUAGE CPP , GADTs , KindSignatures , DataKinds , ScopedTypeVariables , PatternGuards , Rank2Types , TypeOperators , FlexibleContexts , UndecidableInstances #-} module Language.Hakaru.Pretty.SExpression where #if __GLASGOW_HASKELL__ < 710 import Data.Foldable (foldMap) import Control.Applicative ((<$>)) #endif import Data.Ratio import Data.Text (Text) import Data.Sequence (Seq) import qualified Data.Text as Text import Data.Number.Nat (fromNat) import Data.Number.Natural (fromNonNegativeRational) import qualified Data.List.NonEmpty as L import Data.Text.IO as IO import Language.Hakaru.Command (parseAndInfer) import Language.Hakaru.Syntax.IClasses (jmEq1, TypeEq(..)) import Language.Hakaru.Types.Coercion import Language.Hakaru.Types.DataKind import Language.Hakaru.Types.HClasses import Language.Hakaru.Types.Sing import Language.Hakaru.Summary import Language.Hakaru.Syntax.ABT import Language.Hakaru.Syntax.AST import Language.Hakaru.Syntax.AST.Transforms import Language.Hakaru.Syntax.Datum import Language.Hakaru.Syntax.Reducer import Language.Hakaru.Syntax.TypeCheck import Language.Hakaru.Syntax.TypeOf import Prelude hiding ((<>)) import Text.PrettyPrint (Doc, (<>), (<+>)) import Text.PrettyPrint as PP pretty :: (ABT Term abt) => abt '[] a -> Doc pretty a = PP.brackets (caseVarSyn a prettyVariable prettyTerm <+> PP.colon <+> prettyType (typeOf a)) prettyTerm :: (ABT Term abt) => Term abt a -> Doc prettyTerm (o :$ es) = PP.parens $ prettySCons o es prettyTerm (NaryOp_ op es) = PP.parens $ prettyNary op es prettyTerm (Literal_ v) = prettyLiteral v prettyTerm (Array_ e1 e2) = PP.parens $ (PP.text "array") <+> (caseBind e2 $ \x e2' -> PP.parens (prettyVariable x <+> pretty e1) <+> pretty e2') prettyTerm (Case_ e1 bs) = PP.parens $ PP.text "match" <+> pretty e1 <+> Prelude.foldl (<+>) PP.empty (prettyBranch <$> bs) prettyTerm (Bucket b e r) = PP.parens $ ( PP.text "bucket" <+> pretty b <+> pretty e <+> prettyReducer r) prettyTerm (Reject_ _) = PP.parens $ PP.text "reject" prettyTerm (Empty_ _) = PP.parens $ PP.text "empty" prettyTerm (ArrayLiteral_ es) = PP.parens $ (PP.text "array-literal" <+> foldMap pretty es) prettyTerm (Superpose_ pes) = case pes of (e1,e2) L.:| [] -> PP.parens $ (PP.text "pose" <+> pretty e1 <+> pretty e2) _ -> PP.parens $ (PP.text "superpose" <+> foldMap (\(e1,e2) -> PP.parens (pretty e1 <+> pretty e2)) (L.toList pes)) -- prettyTerm (Datum_ (Datum "true" _typ (Inl Done))) = PP.text "#t" -- prettyTerm (Datum_ (Datum "false" _typ (Inr (Inl Done)))) = PP.text "#f" prettyTerm (Datum_ d) = prettyDatum d prettyDatum :: (ABT Term abt) => Datum (abt '[]) t -> Doc prettyDatum (Datum hint _ d) = PP.parens $ PP.text "datum" <+> (PP.text (Text.unpack hint)) <+> (prettyDatumCode d) prettyDatumCode :: (ABT Term abt) => DatumCode xss (abt '[]) a -> Doc prettyDatumCode (Inr d) = PP.parens $ PP.text "inr" <+> (prettyDatumCode d) prettyDatumCode (Inl d) = PP.parens $ PP.text "inl" <+> (prettyDatumStruct d) prettyDatumStruct :: (ABT Term abt) => DatumStruct xs (abt '[]) a -> Doc prettyDatumStruct Done = PP.text "done" prettyDatumStruct (Et d1 d2) = PP.parens $ PP.text "et" <+> (prettyDatumFun d1) <+> (prettyDatumStruct d2) prettyDatumFun :: (ABT Term abt) => DatumFun x (abt '[]) a -> Doc prettyDatumFun (Konst a) = PP.parens $ PP.text "konst" <+> pretty a prettyDatumFun (Ident a) = PP.parens $ PP.text "ident" <+> pretty a prettyReducer :: (ABT Term abt) => Reducer abt xs a -> Doc prettyReducer (Red_Fanout red_a red_b) = PP.parens (PP.text "r_fanout" <+> prettyReducer red_a <+> prettyReducer red_b) prettyReducer (Red_Index i red_i red_a) = PP.parens (PP.text "r_index" <+> prettyViewABT i <+> prettyViewABT red_i <+> prettyReducer red_a) prettyReducer (Red_Split i red_a red_b) = PP.parens (PP.text "r_split" <+> prettyViewABT i <+> prettyReducer red_a <+> prettyReducer red_b) prettyReducer (Red_Nop) = PP.text "r_nop" prettyReducer (Red_Add _ a) = PP.parens (PP.text "r_add" <+> prettyViewABT a) prettyBranch :: (ABT Term abt) => Branch a abt b -> Doc prettyBranch (Branch pat e) = PP.parens $ prettyPattern pat <+> prettyViewABT e prettyPattern :: Pattern xs a -> Doc prettyPattern PWild = PP.text "*" prettyPattern PVar = PP.text "var" prettyPattern (PDatum hint c) = PP.parens $ PP.text "pdatum" <+> PP.text (Text.unpack hint) <+> goCode c goCode :: PDatumCode xss vars a -> Doc goCode c = PP.parens $ case c of (PInr d) -> PP.text "pc_inr" <+> goCode d (PInl s) -> PP.text "pc_inl" <+> goStruct s goStruct :: PDatumStruct xs vars a -> Doc goStruct s = PP.parens $ case s of (PDone) -> PP.text "ps_done" (PEt f s') -> PP.text "ps_et" <+> goFun f <+> goStruct s' goFun :: PDatumFun x vars a -> Doc goFun f = PP.parens $ case f of (PKonst p) -> PP.text "pf_konst" <+> prettyPattern p (PIdent p) -> PP.text "pf_ident" <+> prettyPattern p prettyViewABT :: (ABT Term abt) => abt xs a -> Doc prettyViewABT = prettyView . viewABT prettyView :: (ABT Term abt) => View (Term abt) xs a -> Doc prettyView (Bind x v) = PP.parens $ PP.text "bind" <+> prettyVariable x <+> prettyView v prettyView (Var x) = prettyVariable x prettyView (Syn t) = pretty (syn t) prettyShow :: (Show a) => a -> Doc prettyShow = PP.text . show prettyLiteral :: Literal a -> Doc prettyLiteral (LNat v) = PP.parens $ PP.text "nat_" <+> prettyShow v prettyLiteral (LInt i) = PP.parens $ PP.text "int_" <+> prettyShow i prettyLiteral (LProb p) = PP.parens $ PP.text "prob_" <+> PP.rational (fromNonNegativeRational p) prettyLiteral (LReal p) = PP.parens $ PP.text "real_" <+> PP.rational p prettyRatio :: (Show a, Integral a) => Ratio a -> Doc prettyRatio r | d == 1 = prettyShow n | otherwise = PP.parens $ PP.text "/" <+> prettyShow n <+> prettyShow d where d = denominator r n = numerator r prettyVariable :: Variable (a :: Hakaru) -> Doc prettyVariable x | Text.null (varHint x) = PP.text "_" <> (PP.int . fromNat .varID) x | otherwise = (PP.text . Text.unpack . varHint) x prettySCons :: (ABT Term abt) => SCon args a -> SArgs abt args -> Doc prettySCons Lam_ (e1 :* End) = caseBind e1 $ \x e1' -> PP.text "fn" <+> prettyVariable x <+> (prettyType $ typeOf e1') <+> pretty e1' prettySCons (PrimOp_ o) es = prettyPrimOp o es prettySCons (ArrayOp_ o) es = prettyArrayOp o es prettySCons (CoerceTo_ o) (e1 :* End) = PP.text (pCoerce o) <+> pretty e1 prettySCons (Summate _ _) (e1 :* e2 :* e3 :* End) = caseBind e3 $ \x e3' -> PP.text "summate" <+> PP.parens (prettyVariable x <+> pretty e1 <+> pretty e2) <+> pretty e3' prettySCons (Product _ _) (e1 :* e2 :* e3 :* End) = caseBind e3 $ \x e3' -> PP.text "product" <+> PP.parens (prettyVariable x <+> pretty e1 <+> pretty e2) <+> pretty e3' prettySCons App_ (e1 :* e2 :* End) = PP.text "app" <+> pretty e1 <+> pretty e2 prettySCons Let_ (e1 :* e2 :* End) = caseBind e2 $ \x e2' -> PP.text "let" <+> PP.parens (prettyVariable x <+> (prettyType $ typeOf e1) <+> pretty e1) <+> pretty e2' prettySCons (UnsafeFrom_ o) (e :* End) = PP.text (pUnsafeCoerce o) <+> pretty e prettySCons (MeasureOp_ o) es = prettyMeasureOp o es prettySCons Dirac (e1 :* End) = PP.text "dirac" <+> pretty e1 prettySCons MBind (e1 :* e2 :* End) = PP.text "mbind" <+> pretty e1 <+> prettyViewABT e2 prettySCons Plate (e1 :* e2 :* End) = PP.text "plate" <+> pretty e1 <+> prettyViewABT e2 prettySCons Chain (e1 :* e2 :* e3 :* End) = PP.text "chain" <+> pretty e1 <+> pretty e2 <+> prettyViewABT e3 prettySCons Integrate (e1 :* e2 :* e3 :* End) = PP.text "integrate" <+> pretty e1 <+> pretty e2 <+> prettyViewABT e3 prettySCons (Transform_ t) _ = PP.text $ Prelude.concat [ "SCons{", show t, "}: TODO" ] prettyMeasureOp :: (ABT Term abt, typs ~ UnLCs args, args ~ LCs typs) => MeasureOp typs a -> SArgs abt args -> Doc prettyMeasureOp Lebesgue = \(e1 :* e2 :* End) -> PP.text "lebesgue" <+> pretty e1 <+> pretty e2 prettyMeasureOp Counting = \End -> PP.text "counting" prettyMeasureOp Categorical = \(e1 :* End) -> PP.text "categorical" <+> pretty e1 prettyMeasureOp Uniform = \(e1 :* e2 :* End) -> PP.text "uniform" <+> pretty e1 <+> pretty e2 prettyMeasureOp Normal = \(e1 :* e2 :* End) -> PP.text "normal" <+> pretty e1 <+> pretty e2 prettyMeasureOp Poisson = \(e1 :* End) -> PP.text "poisson" <+> pretty e1 prettyMeasureOp Gamma = \(e1 :* e2 :* End) -> PP.text "gamma" <+> pretty e1 <+> pretty e2 prettyMeasureOp Beta = \(e1 :* e2 :* End) -> PP.text "beta" <+> pretty e1 <+> pretty e2 pUnsafeCoerce :: Coercion a b -> String pUnsafeCoerce (CCons (Signed HRing_Real) CNil) = "real2prob" pUnsafeCoerce (CCons (Signed HRing_Int) CNil) = "int2nat" pUnsafeCoerce c = "unsafeFrom_" ++ show c pCoerce :: Coercion a b -> String pCoerce (CCons (Signed HRing_Real) CNil) = "prob2real" pCoerce (CCons (Signed HRing_Int) CNil) = "nat2int" pCoerce (CCons (Continuous HContinuous_Real) CNil) = "int2real" pCoerce (CCons (Continuous HContinuous_Prob) CNil) = "nat2prob" pCoerce (CCons (Continuous HContinuous_Prob) (CCons (Signed HRing_Real) CNil)) = "nat2real" pCoerce (CCons (Signed HRing_Int) (CCons (Continuous HContinuous_Real) CNil)) = "nat2real" pCoerce c = "coerceTo_"++show c prettyNary :: (ABT Term abt) => NaryOp a -> Seq (abt '[] a) -> Doc prettyNary And es = PP.text "and" <+> foldMap pretty es prettyNary Or es = PP.text "or" <+> foldMap pretty es prettyNary Xor es = PP.text "xor" <+> foldMap pretty es prettyNary (Sum _) es = PP.text "+" <+> foldMap pretty es prettyNary (Prod _) es = PP.text "*" <+> foldMap pretty es prettyNary (Min _) es = PP.text "min" <+> foldMap pretty es prettyNary (Max _) es = PP.text "max" <+> foldMap pretty es prettyNary _ _ = error "Pretty.SExpression - prettyNary missing cases" prettyType :: Sing (a :: Hakaru) -> Doc prettyType SNat = PP.text "nat" prettyType SInt = PP.text "int" prettyType SProb = PP.text "prob" prettyType SReal = PP.text "real" prettyType (SArray a) = PP.parens $ PP.text "array" <+> prettyType a prettyType (SMeasure a) = PP.parens $ PP.text "measure" <+> prettyType a prettyType (SFun a b) = PP.parens $ prettyType a <+> PP.text "->" <+> prettyType b prettyType typ = case typ of SData (STyCon sym `STyApp` a `STyApp` b) _ | Just Refl <- jmEq1 sym sSymbol_Pair -> PP.parens $ PP.text "pair" <+> prettyType a <+> prettyType b | Just Refl <- jmEq1 sym sSymbol_Either -> PP.parens $ PP.text "either" <+> prettyType a <+> prettyType b SData (STyCon sym `STyApp` a) _ | Just Refl <- jmEq1 sym sSymbol_Maybe -> PP.parens $ PP.text "maybe" <+> prettyType a SData (STyCon sym) _ | Just Refl <- jmEq1 sym sSymbol_Bool -> PP.text "bool" | Just Refl <- jmEq1 sym sSymbol_Unit -> PP.text "unit" _ -> PP.text (showsPrec 11 typ "") prettyPrimOp :: (ABT Term abt, typs ~ UnLCs args, args ~ LCs typs) => PrimOp typs a -> SArgs abt args -> Doc prettyPrimOp Not (e1 :* End) = PP.text "not" <+> pretty e1 prettyPrimOp Pi End = PP.text "pi" prettyPrimOp Sin (e1 :* End) = PP.text "sin" <+> pretty e1 prettyPrimOp Cos (e1 :* End) = PP.text "cos" <+> pretty e1 prettyPrimOp Tan (e1 :* End) = PP.text "tan" <+> pretty e1 prettyPrimOp RealPow (e1 :* e2 :* End) = PP.text "realpow" <+> pretty e1 <+> pretty e2 prettyPrimOp Choose (e1 :* e2 :* End) = PP.text "choose" <+> pretty e1 <+> pretty e2 prettyPrimOp Exp (e1 :* End) = PP.text "exp" <+> pretty e1 prettyPrimOp Log (e1 :* End) = PP.text "log" <+> pretty e1 prettyPrimOp (Infinity _) End = PP.text "infinity" prettyPrimOp GammaFunc (e1 :* End) = PP.text "gammafunc" <+> pretty e1 prettyPrimOp BetaFunc (e1 :* e2 :* End) = PP.text "betafunc" <+> pretty e1 <+> pretty e2 prettyPrimOp (Equal _) (e1 :* e2 :* End) = PP.text "==" <+> pretty e1 <+> pretty e2 prettyPrimOp (Less _) (e1 :* e2 :* End) = PP.text "<" <+> pretty e1 <+> pretty e2 prettyPrimOp (NatPow _) (e1 :* e2 :* End) = PP.text "natpow" <+> pretty e1 <+> pretty e2 prettyPrimOp (Negate _) (e1 :* End) = PP.text "negate" <+> pretty e1 prettyPrimOp (Abs _) (e1 :* End) = PP.text "abs" <+> pretty e1 prettyPrimOp (Recip _) (e1 :* End) = PP.text "recip" <+> pretty e1 prettyPrimOp (NatRoot _) (e1 :* e2 :* End) = PP.text "root" <+> pretty e1 <+> pretty e2 prettyPrimOp Floor (e1 :* End) = PP.text "floor" <+> pretty e1 prettyPrimOp _ _ = error "prettyPrimop: a bunch of cases still need done!" prettyArrayOp :: (ABT Term abt, typs ~ UnLCs args, args ~ LCs typs) => ArrayOp typs a -> SArgs abt args -> Doc prettyArrayOp (Index _) (e1 :* e2 :* End) = PP.text "index" <+> pretty e1 <+> pretty e2 prettyArrayOp (Size _) (e1 :* End) = PP.text "size" <+> pretty e1 prettyArrayOp (Reduce _) _ = error "prettyArrayOp doesn't know how to print Reduce" prettyFile' :: [Char] -> [Char] -> IO () prettyFile' fname outFname = do fileText <- IO.readFile fname prettyText <- runPretty' fileText IO.writeFile outFname (Text.pack prettyText) print prettyText runPretty' :: Text -> IO String runPretty' prog = case parseAndInfer prog of Left _ -> return "err" Right (TypedAST _ ast) -> do summarised <- summary . expandTransformations $ ast return . render . pretty $ summarised fromAst :: Either Text (TypedAST (TrivialABT Term)) -> String fromAst prog = case prog of Left err -> Text.unpack err Right (TypedAST _ ast) -> render . pretty . expandTransformations $ ast
{ "pile_set_name": "Github" }
package org.ripple.bouncycastle.crypto.params; import java.math.BigInteger; public class ECPrivateKeyParameters extends ECKeyParameters { BigInteger d; public ECPrivateKeyParameters( BigInteger d, ECDomainParameters params) { super(true, params); this.d = d; } public BigInteger getD() { return d; } }
{ "pile_set_name": "Github" }
/*************************************************************************** ampere_dc.h - description ------------------- begin : Sat Aug 23 2003 copyright : (C) 2003 by Michael Margraf email : [email protected] ***************************************************************************/ /*************************************************************************** * * * This program is free software; you can redistribute it and/or modify * * it under the terms of the GNU General Public License as published by * * the Free Software Foundation; either version 2 of the License, or * * (at your option) any later version. * * * ***************************************************************************/ #ifndef AMPERE_DC_H #define AMPERE_DC_H #include "component.h" class Ampere_dc : public Component { public: Ampere_dc(); ~Ampere_dc(); Component* newOne(); static Element* info(QString&, char* &, bool getNewOne=false); }; #endif
{ "pile_set_name": "Github" }
$em-base: 16px !default;
{ "pile_set_name": "Github" }
import { IconDefinition, IconPrefix, IconName } from "@fortawesome/fontawesome-common-types"; export const definition: IconDefinition; export const faSyringe: IconDefinition; export const prefix: IconPrefix; export const iconName: IconName; export const width: number; export const height: number; export const ligatures: string[]; export const unicode: string; export const svgPathData: string;
{ "pile_set_name": "Github" }
import styled from 'styled-components'; const StyledFieldset = styled.fieldset` margin: 0; padding: 0; border: 0; position: relative; box-sizing: border-box; `; export default StyledFieldset;
{ "pile_set_name": "Github" }
{ "translatorID": "01322929-5782-4612-81f7-d861fb46d9f2", "label": "Atlanta Journal Constitution", "creator": "Sebastian Karcher", "target": "^https?://(www\\.|blogs\\.)?ajc\\.com", "minVersion": "2.1.9", "maxVersion": "", "priority": 100, "inRepository": true, "translatorType": 4, "browserSupport": "gcsibv", "lastUpdated": "2013-09-16 00:28:46" } /* FW LINE 59:b820c6d */ function flatten(t){var e=new Array;for(var i in t){var r=t[i];r instanceof Array?e=e.concat(flatten(r)):e.push(r)}return e}var FW={_scrapers:new Array};FW._Base=function(){this.callHook=function(t,e,i,r){if("object"==typeof this.hooks){var n=this.hooks[t];"function"==typeof n&&n(e,i,r)}},this.evaluateThing=function(t,e,i){var r=typeof t;if("object"===r){if(t instanceof Array){var n=this.evaluateThing,a=t.map(function(t){return n(t,e,i)});return flatten(a)}return t.evaluate(e,i)}return"function"===r?t(e,i):t},this.makeItems=function(t,e,i,r,n){n()}},FW.Scraper=function(t){FW._scrapers.push(new FW._Scraper(t))},FW._Scraper=function(t){for(x in t)this[x]=t[x];this._singleFieldNames=["abstractNote","applicationNumber","archive","archiveLocation","artworkMedium","artworkSize","assignee","audioFileType","audioRecordingType","billNumber","blogTitle","bookTitle","callNumber","caseName","code","codeNumber","codePages","codeVolume","committee","company","conferenceName","country","court","date","dateDecided","dateEnacted","dictionaryTitle","distributor","docketNumber","documentNumber","DOI","edition","encyclopediaTitle","episodeNumber","extra","filingDate","firstPage","forumTitle","genre","history","institution","interviewMedium","ISBN","ISSN","issue","issueDate","issuingAuthority","journalAbbreviation","label","language","legalStatus","legislativeBody","letterType","libraryCatalog","manuscriptType","mapType","medium","meetingName","nameOfAct","network","number","numberOfVolumes","numPages","pages","patentNumber","place","postType","presentationType","priorityNumbers","proceedingsTitle","programTitle","programmingLanguage","publicLawNumber","publicationTitle","publisher","references","reportNumber","reportType","reporter","reporterVolume","rights","runningTime","scale","section","series","seriesNumber","seriesText","seriesTitle","session","shortTitle","studio","subject","system","thesisType","title","type","university","url","version","videoRecordingType","volume","websiteTitle","websiteType"],this._makeAttachments=function(t,e,i,r){if(i instanceof Array)i.forEach(function(i){this._makeAttachments(t,e,i,r)},this);else if("object"==typeof i){var n=i.urls||i.url,a=i.types||i.type,s=i.titles||i.title,o=i.snapshots||i.snapshot,u=this.evaluateThing(n,t,e),l=this.evaluateThing(s,t,e),c=this.evaluateThing(a,t,e),h=this.evaluateThing(o,t,e);u instanceof Array||(u=[u]);for(var f in u){var p,m,v,d=u[f];p=c instanceof Array?c[f]:c,m=l instanceof Array?l[f]:l,v=h instanceof Array?h[f]:h,r.attachments.push({url:d,title:m,mimeType:p,snapshot:v})}}},this.makeItems=function(t,e,i,r,n){var a=new Zotero.Item(this.itemType);a.url=e;for(var s in this._singleFieldNames){var o=this._singleFieldNames[s];if(this[o]){var u=this.evaluateThing(this[o],t,e);u instanceof Array?a[o]=u[0]:a[o]=u}}var l=["creators","tags"];for(var c in l){var h=l[c],f=this.evaluateThing(this[h],t,e);if(f)for(var p in f)a[h].push(f[p])}this._makeAttachments(t,e,this.attachments,a),r(a,this,t,e),n()}},FW._Scraper.prototype=new FW._Base,FW.MultiScraper=function(t){FW._scrapers.push(new FW._MultiScraper(t))},FW._MultiScraper=function(t){for(x in t)this[x]=t[x];this._mkSelectItems=function(t,e){var i=new Object;for(var r in t)i[e[r]]=t[r];return i},this._selectItems=function(t,e,i){var r=new Array;Zotero.selectItems(this._mkSelectItems(t,e),function(t){for(var e in t)r.push(e);i(r)})},this._mkAttachments=function(t,e,i){var r=this.evaluateThing(this.attachments,t,e),n=new Object;if(r)for(var a in i)n[i[a]]=r[a];return n},this._makeChoices=function(t,e,i,r,n){if(t instanceof Array)t.forEach(function(t){this._makeTitlesUrls(t,e,i,r,n)},this);else if("object"==typeof t){var a=t.urls||t.url,s=t.titles||t.title,o=this.evaluateThing(a,e,i),u=this.evaluateThing(s,e,i),l=u instanceof Array;o instanceof Array||(o=[o]);for(var c in o){var h,f=o[c];h=l?u[c]:u,n.push(f),r.push(h)}}},this.makeItems=function(t,e,i,r,n){if(this.beforeFilter){var a=this.beforeFilter(t,e);if(a!=e)return void this.makeItems(t,a,i,r,n)}var s=[],o=[];this._makeChoices(this.choices,t,e,s,o);var u=this._mkAttachments(t,e,o),l=this.itemTrans;this._selectItems(s,o,function(t){if(t){var e=function(t){var e=t.documentURI,i=l;void 0===i&&(i=FW.getScraper(t,e)),void 0===i||i.makeItems(t,e,u[e],r,function(){})};Zotero.Utilities.processDocuments(t,e,n)}else n()})}},FW._MultiScraper.prototype=new FW._Base,FW.WebDelegateTranslator=function(t){return new FW._WebDelegateTranslator(t)},FW._WebDelegateTranslator=function(t){for(x in t)this[x]=t[x];this.makeItems=function(t,e,i,r,n){var a=this,s=Zotero.loadTranslator("web");s.setHandler("itemDone",function(i,n){r(n,a,t,e)}),s.setDocument(t),this.translatorId?(s.setTranslator(this.translatorId),s.translate()):(s.setHandler("translators",function(t,e){e.length&&(s.setTranslator(e[0]),s.translate())}),s.getTranslators()),n()}},FW._WebDelegateTranslator.prototype=new FW._Base,FW._StringMagic=function(){this._filters=new Array,this.addFilter=function(t){return this._filters.push(t),this},this.split=function(t){return this.addFilter(function(e){return e.split(t).filter(function(t){return""!=t})})},this.replace=function(t,e,i){return this.addFilter(function(r){return r.match(t)?r.replace(t,e,i):r})},this.prepend=function(t){return this.replace(/^/,t)},this.append=function(t){return this.replace(/$/,t)},this.remove=function(t,e){return this.replace(t,"",e)},this.trim=function(){return this.addFilter(function(t){return Zotero.Utilities.trim(t)})},this.trimInternal=function(){return this.addFilter(function(t){return Zotero.Utilities.trimInternal(t)})},this.match=function(t,e){return e||(e=0),this.addFilter(function(i){var r=i.match(t);return void 0===r||null===r?void 0:r[e]})},this.cleanAuthor=function(t,e){return this.addFilter(function(i){return Zotero.Utilities.cleanAuthor(i,t,e)})},this.key=function(t){return this.addFilter(function(e){return e[t]})},this.capitalizeTitle=function(){return this.addFilter(function(t){return Zotero.Utilities.capitalizeTitle(t)})},this.unescapeHTML=function(){return this.addFilter(function(t){return Zotero.Utilities.unescapeHTML(t)})},this.unescape=function(){return this.addFilter(function(t){return unescape(t)})},this._applyFilters=function(t,e){for(i in this._filters){t=flatten(t),t=t.filter(function(t){return void 0!==t&&null!==t});for(var r=0;r<t.length;r++)try{if(void 0===t[r]||null===t[r])continue;t[r]=this._filters[i](t[r],e)}catch(n){t[r]=void 0,Zotero.debug("Caught exception "+n+"on filter: "+this._filters[i])}t=t.filter(function(t){return void 0!==t&&null!==t})}return flatten(t)}},FW.PageText=function(){return new FW._PageText},FW._PageText=function(){this._filters=new Array,this.evaluate=function(t){var e=[t.documentElement.innerHTML];return e=this._applyFilters(e,t),0==e.length?!1:e}},FW._PageText.prototype=new FW._StringMagic,FW.Url=function(){return new FW._Url},FW._Url=function(){this._filters=new Array,this.evaluate=function(t,e){var i=[e];return i=this._applyFilters(i,t),0==i.length?!1:i}},FW._Url.prototype=new FW._StringMagic,FW.Xpath=function(t){return new FW._Xpath(t)},FW._Xpath=function(t){this._xpath=t,this._filters=new Array,this.text=function(){var t=function(t){return"object"==typeof t&&t.textContent?t.textContent:t};return this.addFilter(t),this},this.sub=function(t){var e=function(e,i){var r=i.evaluate(t,e,null,XPathResult.ANY_TYPE,null);return r?r.iterateNext():void 0};return this.addFilter(e),this},this.evaluate=function(t){var e=t.evaluate(this._xpath,t,null,XPathResult.ANY_TYPE,null),i=e.resultType,r=new Array;if(i==XPathResult.STRING_TYPE)r.push(e.stringValue);else if(i==XPathResult.BOOLEAN_TYPE)r.push(e.booleanValue);else if(i==XPathResult.NUMBER_TYPE)r.push(e.numberValue);else if(i==XPathResult.ORDERED_NODE_ITERATOR_TYPE||i==XPathResult.UNORDERED_NODE_ITERATOR_TYPE)for(var n;n=e.iterateNext();)r.push(n);return r=this._applyFilters(r,t),0==r.length?!1:r}},FW._Xpath.prototype=new FW._StringMagic,FW.detectWeb=function(t,e){for(var i in FW._scrapers){var r=FW._scrapers[i],n=r.evaluateThing(r.itemType,t,e),a=r.evaluateThing(r.detect,t,e);if(a.length>0&&a[0])return n}},FW.getScraper=function(t,e){var i=FW.detectWeb(t,e);return FW._scrapers.filter(function(r){return r.evaluateThing(r.itemType,t,e)==i&&r.evaluateThing(r.detect,t,e)})[0]},FW.doWeb=function(t,e){var i=FW.getScraper(t,e);i.makeItems(t,e,[],function(t,e,i,r){e.callHook("scraperDone",t,i,r),t.title||(t.title=""),t.complete()},function(){Zotero.done()}),Zotero.wait()}; /* ***** BEGIN LICENSE BLOCK ***** AJC.com Translator, Copyright © 2012 Sebastian Karcher Developed with the collaboration of the participants of the 2012 Zotero Trainer Workshop in Atlanta, GA. This file is part of Zotero. Zotero is free software: you can redistribute it and/or modify it under the terms of the GNU Affero General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version. Zotero 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 Affero General Public License for more details. You should have received a copy of the GNU Affero General Public License along with Zotero. If not, see <http://www.gnu.org/licenses/>. ***** END LICENSE BLOCK ***** */ function detectWeb(doc, url) { return FW.detectWeb(doc, url); } function doWeb(doc, url) { return FW.doWeb(doc, url); } /** Articles */ FW.Scraper({ itemType : 'newspaperArticle', detect : FW.Xpath('//h1[@class="cmLargerH1"]'), title : FW.Xpath('//h1[@class="cmLargerH1"]').text().trim(), attachments : [{ url: FW.Url(), title: "AJC Snapshot", type: "text/html" }], creators : FW.Xpath('//p[@class="cmCredit"]').text().remove(/By\s/).capitalizeTitle(true).split(/\s*,\s*/).cleanAuthor("author"), date : FW.Xpath('//div[@class="cmTimeStamp"]/p').text().remove(/.+\|/).remove(/Posted:\s\d+:\d+\s[amp\.]+/).trim(), section : FW.Xpath('//div[@class="cmBreadcrumb"]/ul/li[last()]/a').text(), abstractNote : FW.Xpath('//meta[@name="description"]/@content').text(), ISSN : "1539-7459", publicationTitle : "Atlanta Journal Constitution" }); /**Blog Posts */ FW.Scraper({ itemType : 'blogPost', detect : FW.Url().match(/blogs\.ajc\.com.+\/\d{4}/), title : FW.Xpath('//h1').text().trim(), attachments : [{ url: FW.Url(), title: "AJC Blog Snapshot", type: "text/html" }], creators : FW.Xpath('//p[@class="byline"]/span[@class="author"]').text().replace(/By\s/," ").capitalizeTitle(true).cleanAuthor("author"), date : FW.Xpath('//p[@class="byline"]/span[@class="date"]').text().remove(/.+\|/).remove(/Posted:\s\d+:\d+\s[amp\.]+/).trim(), abstractNote : FW.Xpath('//meta[@name="description"]/@content').text(), ISSN : "1539-7459", publicationTitle : FW.Xpath('//div[contains(@class, "blog-header")]/a').text().prepend("Atlanta Journal Constitution: ").append(" Blog"), }); FW.MultiScraper({ itemType : 'multiple', detect : FW.Url().match(/\/search\/\?q=/), choices : { titles : FW.Xpath('//h4/a[contains(@href, "ajc.com")]').text().trim(), urls : FW.Xpath('//h4/a[contains(@href, "ajc.com")]').key("href") } }); /** BEGIN TEST CASES **/ var testCases = [ { "type": "web", "url": "http://blogs.ajc.com/business-beat/2012/10/13/ted-turner-%e2%80%98taking-risks-depends-on-how-good-your-judgment-is%e2%80%99/?cxntfid=blogs_business_beat", "items": [ { "itemType": "blogPost", "creators": [ { "firstName": "Henry", "lastName": "Unger", "creatorType": "author" } ], "notes": [], "tags": [], "seeAlso": [], "attachments": [ { "title": "AJC Blog Snapshot", "type": "text/html" } ], "url": "http://blogs.ajc.com/business-beat/2012/10/13/ted-turner-%e2%80%98taking-risks-depends-on-how-good-your-judgment-is%e2%80%99/?cxntfid=blogs_business_beat", "abstractNote": "Before there was a 24 / 7, all-news cable network and before giving away money became more common among top business execs, there was Ted Turner with a vision", "date": "October 13, 2012,", "ISSN": "1539-7459", "publicationTitle": "Atlanta Journal Constitution: The Biz Beat Blog", "title": "Ted Turner: ‘Taking risks depends on how good your judgment is’", "libraryCatalog": "Atlanta Journal Constitution", "accessDate": "CURRENT_TIMESTAMP", "shortTitle": "Ted Turner" } ] }, { "type": "web", "url": "http://www.ajc.com/news/news/romney-tops-obama-in-georgia-as-economy-dominates-/nScjq/", "items": [ { "itemType": "newspaperArticle", "creators": [ { "firstName": "Aaron Gould", "lastName": "Sheinin", "creatorType": "author" } ], "notes": [], "tags": [], "seeAlso": [], "attachments": [ { "title": "AJC Snapshot", "type": "text/html" } ], "url": "http://www.ajc.com/news/news/romney-tops-obama-in-georgia-as-economy-dominates-/nScjq/", "abstractNote": "Mitt Romney has a strong lead over Barack Obama in Georgia among likely voters just three weeks until the presidential election, but a new poll for The Atlanta Journal-Constitution finds Georgians, by a larger margin, expect Obama to be re-elected in November.", "date": "Sunday, Oct. 14, 2012", "ISSN": "1539-7459", "publicationTitle": "Atlanta Journal Constitution", "section": "News", "title": "Romney tops Obama in Georgia as economy dominates campaign", "libraryCatalog": "Atlanta Journal Constitution", "accessDate": "CURRENT_TIMESTAMP" } ] }, { "type": "web", "url": "http://www.ajc.com/search/?q=labor&type=", "items": "multiple" } ] /** END TEST CASES **/
{ "pile_set_name": "Github" }
context("refactor bigger factors") test_that("longer factors", { n <- 1e4 nl <- 1e3 set.seed(1441) expect_error(regexp = NA, v1 <- icd:::generate_random_short_icd9(n)) v2 <- v1 v2[1] <- "INVALID" l1 <- sample(v1, size = nl) l2 <- c(NA_character_, l1) l3 <- c(l1, NA_character_) l4 <- c(l1, "XXX") expect_error(l5 <- unique(icd:::generate_random_short_icd9(n * 2)), regexp = NA ) expect_error( regexp = NA, test_cases <- expand.grid( list(v1, v2), list(l1, l2, l3, l4, l5), list(l1, l2, l3, l4, l5) ) ) for (tc in seq_along(test_cases[[1]])) { m <- test_cases[tc, 1][[1]] nl <- unique(test_cases[tc, 2][[1]]) pl <- unique(test_cases[tc, 3][[1]]) inf <- paste( "tc = ", tc, "\n", "m = c('", paste(unlist(head(m)), collapse = "', '"), "')\n", "nl = c('", paste(unlist(head(nl)), collapse = "', '"), "')\n", "np = c('", paste(unlist(head(pl)), collapse = "', '"), "')", sep = "" ) expect_identical( refactor(factor(m, levels = pl), nl), factor(factor(m, levels = pl), levels = nl), info = inf ) expect_identical( refactor(factor(m, levels = pl), nl, na.rm = FALSE, exclude_na = FALSE), factor(factor(m, levels = pl), levels = nl, exclude = NULL), info = inf ) } })
{ "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="Content-Type" content="text/xhtml;charset=UTF-8"/> <meta http-equiv="X-UA-Compatible" content="IE=9"/> <meta name="generator" content="Doxygen 1.8.13"/> <meta name="viewport" content="width=device-width, initial-scale=1"/> <title>Alexa Auto SDK: Member List</title> <link href="tabs.css" rel="stylesheet" type="text/css"/> <script type="text/javascript" src="jquery.js"></script> <script type="text/javascript" src="dynsections.js"></script> <link href="search/search.css" rel="stylesheet" type="text/css"/> <script type="text/javascript" src="search/searchdata.js"></script> <script type="text/javascript" src="search/search.js"></script> <link href="doxygen.css" rel="stylesheet" type="text/css" /> </head> <body> <div id="top"><!-- do not remove this div, it is closed by doxygen! --> <div id="titlearea"> <table cellspacing="0" cellpadding="0"> <tbody> <tr style="height: 56px;"> <td id="projectlogo"><img alt="Logo" src="aace-logo.png"/></td> <td id="projectalign" style="padding-left: 0.5em;"> <div id="projectname">Alexa Auto SDK &#160;<span id="projectnumber">2.3.0</span> </div> </td> </tr> </tbody> </table> </div> <!-- end header part --> <!-- Generated by Doxygen 1.8.13 --> <script type="text/javascript"> var searchBox = new SearchBox("searchBox", "search",false,'Search'); </script> <script type="text/javascript" src="menudata.js"></script> <script type="text/javascript" src="menu.js"></script> <script type="text/javascript"> $(function() { initMenu('',true,false,'search.php','Search'); $(document).ready(function() { init_search(); }); }); </script> <div id="main-nav"></div> <!-- window showing the filter options --> <div id="MSearchSelectWindow" onmouseover="return searchBox.OnSearchSelectShow()" onmouseout="return searchBox.OnSearchSelectHide()" onkeydown="return searchBox.OnSearchSelectKey(event)"> </div> <!-- iframe showing the search results (closed by default) --> <div id="MSearchResultsWindow"> <iframe src="javascript:void(0)" frameborder="0" name="MSearchResults" id="MSearchResults"> </iframe> </div> <div id="nav-path" class="navpath"> <ul> <li class="navelem"><b>com</b></li><li class="navelem"><b>amazon</b></li><li class="navelem"><b>aace</b></li><li class="navelem"><b>audio</b></li><li class="navelem"><b>AudioFormat</b></li><li class="navelem"><a class="el" href="enumcom_1_1amazon_1_1aace_1_1audio_1_1_audio_format_1_1_encoding.html">Encoding</a></li> </ul> </div> </div><!-- top --> <div class="header"> <div class="headertitle"> <div class="title">com.amazon.aace.audio.AudioFormat.Encoding Member List</div> </div> </div><!--header--> <div class="contents"> <p>This is the complete list of members for <a class="el" href="enumcom_1_1amazon_1_1aace_1_1audio_1_1_audio_format_1_1_encoding.html">com.amazon.aace.audio.AudioFormat.Encoding</a>, including all inherited members.</p> <table class="directory"> </table></div><!-- contents --> <html> <body> <hr style="height:1px;border-width:0;color:gray;background-color:gray"> <p style="text-align:left;"> Alexa Auto SDK 2.3.0 - Copyright 2017-2020 Amazon.com, Inc. or its affiliates. All Rights Reserved. <span style="float:right;"> Licensed under the <a HREF=http://aws.amazon.com/apache2.0/>Apache License, Version 2.0</a> </span> </p> </body> </html>
{ "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 fake import ( "k8s.io/api/core/v1" policy "k8s.io/api/policy/v1beta1" restclient "k8s.io/client-go/rest" core "k8s.io/client-go/testing" ) func (c *FakePods) Bind(binding *v1.Binding) error { action := core.CreateActionImpl{} action.Verb = "create" action.Resource = podsResource action.Subresource = "bindings" action.Object = binding _, err := c.Fake.Invokes(action, binding) return err } func (c *FakePods) GetLogs(name string, opts *v1.PodLogOptions) *restclient.Request { action := core.GenericActionImpl{} action.Verb = "get" action.Namespace = c.ns action.Resource = podsResource action.Subresource = "logs" action.Value = opts _, _ = c.Fake.Invokes(action, &v1.Pod{}) return &restclient.Request{} } func (c *FakePods) Evict(eviction *policy.Eviction) error { action := core.CreateActionImpl{} action.Verb = "create" action.Resource = podsResource action.Subresource = "eviction" action.Object = eviction _, err := c.Fake.Invokes(action, eviction) return err }
{ "pile_set_name": "Github" }
/* * Copyright 2008-2009 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 net.hasor.test.core.basic.inject.property; import net.hasor.test.core.enums.SelectEnum; import java.sql.Time; import java.sql.Timestamp; import java.util.Date; // // 8 种基本类型和其包装类型,以及4种时间类型和常用的枚举、字符串 // public class PropertyBean { // private byte byteValue; private Byte byteValue2; // private short shortValue; private Short shortValue2; // private int intValue; private Integer intValue2; // private long longValue; private Long longValue2; // private float floatValue; private Float floatValue2; // private double doubleValue; private Double doubleValue2; // private boolean booleanValue; private Boolean booleanValue2; // private char charValue; private Character charValue2; // private Date dateValue1; private java.sql.Date dateValue2; private Time dateValue3; private Timestamp dateValue4; // private String stringValue; private SelectEnum enumValue; // // // public byte getByteValue() { return byteValue; } public void setByteValue(byte byteValue) { this.byteValue = byteValue; } public Byte getByteValue2() { return byteValue2; } public void setByteValue2(Byte byteValue2) { this.byteValue2 = byteValue2; } public short getShortValue() { return shortValue; } public void setShortValue(short shortValue) { this.shortValue = shortValue; } public Short getShortValue2() { return shortValue2; } public void setShortValue2(Short shortValue2) { this.shortValue2 = shortValue2; } public int getIntValue() { return intValue; } public void setIntValue(int intValue) { this.intValue = intValue; } public Integer getIntValue2() { return intValue2; } public void setIntValue2(Integer intValue2) { this.intValue2 = intValue2; } public long getLongValue() { return longValue; } public void setLongValue(long longValue) { this.longValue = longValue; } public Long getLongValue2() { return longValue2; } public void setLongValue2(Long longValue2) { this.longValue2 = longValue2; } public float getFloatValue() { return floatValue; } public void setFloatValue(float floatValue) { this.floatValue = floatValue; } public Float getFloatValue2() { return floatValue2; } public void setFloatValue2(Float floatValue2) { this.floatValue2 = floatValue2; } public double getDoubleValue() { return doubleValue; } public void setDoubleValue(double doubleValue) { this.doubleValue = doubleValue; } public Double getDoubleValue2() { return doubleValue2; } public void setDoubleValue2(Double doubleValue2) { this.doubleValue2 = doubleValue2; } public boolean isBooleanValue() { return booleanValue; } public void setBooleanValue(boolean booleanValue) { this.booleanValue = booleanValue; } public Boolean getBooleanValue2() { return booleanValue2; } public void setBooleanValue2(Boolean booleanValue2) { this.booleanValue2 = booleanValue2; } public char getCharValue() { return charValue; } public void setCharValue(char charValue) { this.charValue = charValue; } public Character getCharValue2() { return charValue2; } public void setCharValue2(Character charValue2) { this.charValue2 = charValue2; } public Date getDateValue1() { return dateValue1; } public void setDateValue1(Date dateValue1) { this.dateValue1 = dateValue1; } public java.sql.Date getDateValue2() { return dateValue2; } public void setDateValue2(java.sql.Date dateValue2) { this.dateValue2 = dateValue2; } public Time getDateValue3() { return dateValue3; } public void setDateValue3(Time dateValue3) { this.dateValue3 = dateValue3; } public Timestamp getDateValue4() { return dateValue4; } public void setDateValue4(Timestamp dateValue4) { this.dateValue4 = dateValue4; } public String getStringValue() { return stringValue; } public void setStringValue(String stringValue) { this.stringValue = stringValue; } public SelectEnum getEnumValue() { return enumValue; } public void setEnumValue(SelectEnum enumValue) { this.enumValue = enumValue; } }
{ "pile_set_name": "Github" }
# expected: fail import sys from test import test_support, list_tests class ListTest(list_tests.CommonTest): type2test = list def test_basic(self): self.assertEqual(list([]), []) l0_3 = [0, 1, 2, 3] l0_3_bis = list(l0_3) self.assertEqual(l0_3, l0_3_bis) self.assertTrue(l0_3 is not l0_3_bis) self.assertEqual(list(()), []) self.assertEqual(list((0, 1, 2, 3)), [0, 1, 2, 3]) self.assertEqual(list(''), []) self.assertEqual(list('spam'), ['s', 'p', 'a', 'm']) if sys.maxsize == 0x7fffffff: # This test can currently only work on 32-bit machines. # XXX If/when PySequence_Length() returns a ssize_t, it should be # XXX re-enabled. # Verify clearing of bug #556025. # This assumes that the max data size (sys.maxint) == max # address size this also assumes that the address size is at # least 4 bytes with 8 byte addresses, the bug is not well # tested # # Note: This test is expected to SEGV under Cygwin 1.3.12 or # earlier due to a newlib bug. See the following mailing list # thread for the details: # http://sources.redhat.com/ml/newlib/2002/msg00369.html self.assertRaises(MemoryError, list, xrange(sys.maxint // 2)) # This code used to segfault in Py2.4a3 x = [] x.extend(-y for y in x) self.assertEqual(x, []) def test_truth(self): super(ListTest, self).test_truth() self.assertTrue(not []) self.assertTrue([42]) def test_identity(self): self.assertTrue([] is not []) def test_len(self): super(ListTest, self).test_len() self.assertEqual(len([]), 0) self.assertEqual(len([0]), 1) self.assertEqual(len([0, 1, 2]), 3) def test_overflow(self): lst = [4, 5, 6, 7] n = int((sys.maxsize*2+2) // len(lst)) def mul(a, b): return a * b def imul(a, b): a *= b self.assertRaises((MemoryError, OverflowError), mul, lst, n) self.assertRaises((MemoryError, OverflowError), imul, lst, n) def test_main(verbose=None): test_support.run_unittest(ListTest) # verify reference counting import sys if verbose and hasattr(sys, "gettotalrefcount"): import gc counts = [None] * 5 for i in xrange(len(counts)): test_support.run_unittest(ListTest) gc.collect() counts[i] = sys.gettotalrefcount() print counts if __name__ == "__main__": test_main(verbose=True)
{ "pile_set_name": "Github" }
/* -*- mode: java; c-basic-offset: 2; indent-tabs-mode: nil -*- */ /* Part of the Processing project - http://processing.org Copyright (c) 2012-15 The Processing Foundation This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License version 2 as published by the Free Software Foundation. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, Inc. 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ package processing.mode.java.tweak; import java.awt.Graphics2D; import java.awt.Polygon; import java.awt.geom.AffineTransform; public class HProgressBar { int x, y, size, width; int pos; int lPolyX, rPolyX; Polygon rightPoly, leftPoly; public HProgressBar(int size, int width) { this.size = size; this.width = width; x = 0; y = 0; setPos(0); int xl[] = {0, 0, -(int)(size/1.5)}; int yl[] = {-(int)((float)size/3), (int)((float)size/3), 0}; leftPoly = new Polygon(xl, yl, 3); int xr[] = {0, (int)(size/1.5), 0}; int yr[] = {-(int)((float)size/3), 0, (int)((float)size/3)}; rightPoly = new Polygon(xr, yr, 3); } public void setPos(int pos) { this.pos = pos; lPolyX = 0; rPolyX = 0; if (pos > 0) { rPolyX = pos; } else if (pos < 0) { lPolyX = pos; } } public void setWidth(int width) { this.width = width; } public void draw(Graphics2D g2d) { AffineTransform trans = g2d.getTransform(); g2d.translate(x, y); // draw white cover on text line g2d.setColor(ColorScheme.getInstance().whitePaneColor); g2d.fillRect(-200+lPolyX, -size, 200-lPolyX-width/2, size+1); g2d.fillRect(width/2, -size, 200+rPolyX, size+1); // draw left and right triangles and leading line g2d.setColor(ColorScheme.getInstance().progressFillColor); AffineTransform tmp = g2d.getTransform(); g2d.translate(-width/2 - 5 + lPolyX, -size/2); g2d.fillRect(0, -1, -lPolyX, 2); g2d.fillPolygon(leftPoly); g2d.setTransform(tmp); g2d.translate(width/2 + 5 + rPolyX, -size/2); g2d.fillRect(-rPolyX, -1, rPolyX+1, 2); g2d.fillPolygon(rightPoly); g2d.setTransform(tmp); g2d.setTransform(trans); } }
{ "pile_set_name": "Github" }
/* * Copyright (C) 2006-2018 Christopho, Solarus - http://www.solarus-games.org * * Solarus is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation, either version 3 of the License, or * (at your option) any later version. * * Solarus 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/>. */ #ifndef SOLARUS_HERO_FREE_STATE_H #define SOLARUS_HERO_FREE_STATE_H #include "solarus/core/Common.h" #include "solarus/hero/PlayerMovementState.h" #include <cstdint> namespace Solarus { /** * \brief State of the hero where he can walk normally and interact with entities. */ class Hero::FreeState: public Hero::PlayerMovementState { public: explicit FreeState(Hero& hero); virtual void start(const State* previous_state) override; virtual void stop(const State* next_state) override; virtual void update() override; virtual void set_suspended(bool suspended) override; virtual void notify_action_command_pressed() override; virtual void notify_obstacle_reached() override; virtual bool is_free() const override; virtual bool can_start_sword() const override; virtual bool can_start_item(EquipmentItem& item) const override; virtual bool can_take_stairs() const override; virtual CarriedObject::Behavior get_previous_carried_object_behavior() const override; virtual void set_animation_stopped() override; virtual void set_animation_walking() override; private: int pushing_direction4; /**< direction where the hero is trying to * push an obstacle (0 to 3) or -1 */ uint32_t start_pushing_date; /**< date when the state pushing starts */ }; } #endif
{ "pile_set_name": "Github" }
# LibVLCSharp.Uno [![NuGet Stats](https://img.shields.io/nuget/v/LibVLCSharp.Uno.svg)](https://www.nuget.org/packages/LibVLCSharp.Uno) [![NuGet Stats](https://img.shields.io/nuget/dt/LibVLCSharp.Uno.svg)](https://www.nuget.org/packages/LibVLCSharp.Uno) The official [Uno](https://github.com/unoplatform/uno) views for [LibVLCSharp](../LibVLCSharp/README.md). This package contains the views that allows to display a video played with [LibVLCSharp](../LibVLCSharp/README.md) on the [Uno Platform](https://platform.uno/) This package depends on [LibVLCSharp](../LibVLCSharp/README.md). It also makes use of the [Uno.UI](https://www.nuget.org/packages/Uno.UI) package. Supported frameworks: - UAP - monoandroid - xamarin.ios Supported platforms: - UWP - Android - iOS NOTE: This package does not currently support WebAssembly on Uno! It will when libvlc can run on WebAssembly. ## Getting started The best way to get started is to clone this repository and start one of the [Uno samples](../../samples/Uno). ## Why should I reference this package in my project? If you want to create a video application using the Uno Platform and the power of VLC, this package is made for you. For other platforms, see the [main documentation](../../README.md).
{ "pile_set_name": "Github" }
// // Copyright (C) 2011-16 DyND Developers // BSD 2-Clause License, see LICENSE.txt // #pragma once #include <dynd/types/base_memory_type.hpp> namespace dynd { namespace ndt { class DYNDT_API cuda_device_type : public base_memory_type { public: cuda_device_type(type_id_t id, const ndt::type &element_tp); void print_data(std::ostream &o, const char *arrmeta, const char *data) const; void print_type(std::ostream &o) const; bool operator==(const base_type &rhs) const; ndt::type with_replaced_storage_type(const ndt::type &element_tp) const; void data_alloc(char **data, size_t size) const; void data_zeroinit(char *data, size_t size) const; void data_free(char *data) const; static ndt::type parse_type_args(type_id_t id, const char *&begin, const char *end, std::map<std::string, ndt::type> &symtable); }; DYNDT_API size_t get_cuda_device_data_alignment(const ndt::type &tp); template <> struct id_of<cuda_device_type> : std::integral_constant<type_id_t, cuda_device_id> {}; } // namespace ndt } // namespace dynd
{ "pile_set_name": "Github" }
{ "sources": { "package.json.tpl.merge": { "9c7e7135be031f8d06045d338200cbf4a4222f88": "eJx1kD9PwzAQxfd+CitiREmYkJgZgaUIBuhwjS+pW9tn/AcRRfnuxMYxylBP997vfH7naceWU2lQWD2wajKX4WWp5+r2D/jRFPC61AV0FsGTjQw06VFRcCtzQSmwY2T7E1nPViNzjh6ERP6IrrPCeEE69j6RHhj/9xj1zEB3gQHXm99oXe6+q9u6LWlIGfBvV2hPVoFPdokoRYcx/ZR08s5u0R9FxzNtVOpa3jnFUTefoW3vjzlgzYWdGwfONfgDykhsuuA8qfq8fstminDvgg/on0GLHl0M523ATeNc1CFVc85OwZvgr2U4BiH5uqakDmSenS2LX0FYTLsedvMvLXaLQg\u003d\u003d" }, "config.rb.tpl.merge": { "33f446bd02c3fd24eb27891582eff6a2e789796b": "eJxLLi2KT8ksUrBVcMvMSdUDMvMSc1M14uPdPH1c4+M1ufJLSwpKS+KLSypzUoGqrPJSi0tSU7gALskTcA\u003d\u003d" }, "all.scss.merge": { "da39a3ee5e6b4b0d3255bfef95601890afd80709": "eJwDAAAAAAE\u003d" }, "custom.js.merge": { "199e99bbd15c3c0415569425cb21e77c95e9042a": "eJxlj0FOxDAMRfdziq9ZwUjTHIAlYslquIAncdtA4lSxC8PtSdoREmIV6f/4+dmdDjjhbY6KMSZGeycWrmQcQAqCGlWLMmEpUQzXb1xY/Ex4zgFnRMNXTAlSWseovCTybbbUDl6XsJHa1FH3sYX8B03cqqlS4OPQ//2V8CQ7K5fPriEBNjPU17gYjCZE6UnmYbacfj/GsaUNslUIhbVzu5lwq/2qVjIohGixCCVkkjiyWrOFzqWaXw0sViPr0IRYGVQ7yq+55X2HdObg7meo45udt4XnKyk7Je0Z5SWxqyyB6/Cu/Uh3ODj3crNhN28ar/f1D49P/7rLXUd7+QPuPI9g" }, "theme.html.tpl.merge": { "2c775eb1b3eb10df6efa0743d8aa426af3f9a562": "eJx1U8GO0zAQvfcrZnOCqm7ahQPqJr2URYCQQNpy4Og608a7jm3saZIK8e/YTqHpAj4k8rx5855n7OLm7efN9tuXe6ipUetJccPYBAA2xp6cPNQEL8RLuF0sb1n4vJrDA2pRc/igxXzCWCCceTXyah2ZUJAkhev7nuDjA2xrbBDec6fR+yIfsCGvQeJBlizD70fZltnGaEJNbHuymIEYdmVG2FMeZe4gSDuPVH7dvmNvsnEdzRsss1ZiZ42jEbuTFdVlha0UyNJmBlJLklwxL7jCcjmDhveyOTaXwNGjSzu+CwFtgtYgdu4PfDK8Aq4UuGjeYQVK6icPXFfghZOWfMqLPUrECIdkVWaeTgp9jRhsUjjq+YTC+wxqh/syw543VuE8hfJzgaHqmPHIWz5EM/BOlNnOGPLkuJ0/+mxd5AP423rSHYrFNQ/NOCCx2CkuNTr48QeLq+HuIPUKlgvb310hqYsreL34C7HGh86awAon5SRbvMZNi26vTLeCVnoZWnuBf04uznrmVRiXYxQ8IM3+i8D0mWljuZB0Cq7/WTmfAmp/dAg7U52gMuhBG0q+FLdANYIzR12FeQoT7qzzYPawd+F2VWC5RpV3Ulemg65GDdGM1AeY5mOLKY9FhSvnAzHFn7necfF0SLorCOPT3nIXLu/4CGmC+XmERT56brFemHX6RSS9x1+JIiOn" }, "build.properties.merge": { "8b81315dbe73ce9c08478f4c1d2df84f456efcf5": "eJytkEtOxEAMRPdzipKyhbkBCzQrFnzE5AKetJNYdOzI3UnE7XGA3GC8K5f9/GnwdM84NWhHKeglM2a3VRIXkMJWdg+B2UQrenMk7mnJFSu50C1HXWREOUEUAfr3yzk4M3sVLudTE8bL68f7Z/v81uIRV9ZuJFymhE1yxsQ+ML5tcUReh6BuUkdILbBNkRYXHbDMg1P6BaI10GqSYrXKWoUOSmfaZ+mi88+f6GvvzRTmA8rGPO/6mFMtYPW4fiff97U/al6C1w\u003d\u003d" }, "sencha.cfg.tpl.merge": { "057f5f361104adf05c1c49b01b08cd389b3822b2": "eJytkDFyw0AIRfs9BWOlteLOlRvnAHGRMg1eIYnRatGwSBpnxnc3TqIbmPJ/PvCo4KsnaCU1pGA9GkTJhpwLlPm6nzAO2FEBad3lAv9CDZ853WDBxI2nFXat4kir6LAL1dYFdpuoDlXYUj5yGrpSN6ynt+/5cDieN8ul+/u2LoTq9NLymz7mYjLCRWUiNXamPVwSRoL46/APGotzXynJ+kebODuEAC7inCNpRz7JP9QmjlZgZesh0+q/W0jLMx4e5yNt/w\u003d\u003d" }, "testing.properties.merge": { "e65f969c42eb4f355c850fc58fea852582f20db8": "eJyVkUFywyAQBO9+xVb5oIutH/gX+QCCkbUOAooFOf59FsmqpHKKOFEwOzM0Z7r9f53O9DGx0Mge5DBygFDKMSEX1m0VOBpepLqhsndXnpPvv2Z/oefEdiKdLRNoMAJqdyqMI5lAJiXP1hSOQbbZ5msh0mskmuOvnDHHWY32JjbmDEkxOCqxBai6K5DC4d693RAWzjHMCOVCkmB5ZLhW9EWdINjJtBJv9T7cU0vXsk/2rWwxn9AisHA6AooLcgNhqi8riYXdimAn0P+07vXsCOuD8rNimLWaiDKkmBrK7UOUyR0B2RRQdzXedyp+CMVaUi0rQn3ninMxvurPspjBQ/54jjHvYLbHycGKG5Fm2SIf0u/ut9M3l43NIg\u003d\u003d" }, "sass-page.html.tpl.merge": { "e27edf75982e4b8e1e05a4112718424540b46b10": "eJytU8FuEzEQvecrpnuCCMdp4VClm1xCESAkkJoeODreSdat1zaeySYRot+OvRsgCXBB+LArz/Ob9+xnlxevP84Xnz/dQs2NnQ3KCyEGADD3YR/NumZ4pp/D1fjySqTPyxHcodO1gndOjwZCJMKBV6OqZpkJJRu2OLvdMby/g0WNDcJbFR0SlbLH+nUNskqyHAR+2Zh2Wsy9Y3QsFvuABeh+Ni0YdyyzzA0k6UjI0/vFG3FdzAZ9o4Nn+OBVBcpaiLlhxAqscY8EylVAOprA1K3LvjtiXwROegeZB9WqvloART0t5JNuKpkgdGS8I0ndAYiVojrN5dl/9EDFrJR9i/+nQopIaN8EYzH+o8bSeyaOKpzxDw14/yOYPEZbU62RRQ5BGYcRvv7E8mhUXBs3gctx2N2cIInI9QRejX9DgifDaTeTlI9VbFo8xX2LcWX9dgKtIbO0R/C3wS9nO0HWaIyCkwfkF39FYHhm2gelDe+T6z92lkNIx7+JCEtf7aHySOA8d76sCsA1QvQbV6WLpX260JHAr2AVVZMqQTm0cmtc5bewrdFBNmPcGoby2GK3TmSFE+c9saufuV4q/bjudCeQ4nMUVEzv4ngLXYLyEGEpj95i7pey7n4Z6R7rd2BDMTo\u003d" }, "fashion.html.tpl.merge": { "5117b27d384b8c5ae0bd4aafdb1fad14eaddcc62": "eJytVE2P0zAQvfdXzOYEq7ppFw6om/RSFgFCAmnLgePUmTbedWxjT9NWiP3tOE6hH8AF4UOsmeeZ9+xnp7h6/XG++PLpDmpu9GxQXAkxAIC5dXuv1jXDM/kcbsaTGxE/L0ZwT0bWCO+MHA2EiAWHupqwmnWVULBiTbO7HcP7e1jU1BC8RW8ohCLvsX5dQ4yRlp2grxvVltncGibDYrF3lIHsozJj2nHe0dxCpPaBuPy8eCNeZad9DDZUZq2irbOeT6q3quK6rKhVkkQKhqCMYoVaBImayskQGtypZtMcE5tAPkW4jAljI1dPdjgf+GCxAtQafCfeUwVamccAaCoI0ivHIa3rzigV9knguLfDlh6wxT6bQfCyzPIn2VR5hMgEZU3IQzpsscJQxzi/mEcPIZsVed/i/7EEDEFI2zilyf8jx9JaDuzRXdQfGvD+5yXoxii6siYWnWWoDHn49gvrRoN+rcwUJmO3uz1Dkp1TeDn+DXE2RIttrPKkkVVL57htya+03U6hVUFFj4/w98FR2U4EHe+NFxw1EA//isD1hWjrUCreR9V/7JxfQzz+jSdY2moPlaUAxnLSpdEB1wTebkwVL5a08fH4AHYFKx+veQUODel8q0xlt7CtyUAnRpk1XOenEtM60TGcKe8LU/5C9RLl4zrxTiHaZ4JDH1/R6RaSg/nBwiI/efddv+h1mjok/Rh+ACC6Vqw\u003d" } }, "targets": { "package.json": { "source": "package.json.tpl.merge", "version": "9c7e7135be031f8d06045d338200cbf4a4222f88", "parameters": { "extRelPath": "../..", "pkgName": "theme-crisp", "pkgType": "theme", "senchadir": ".sencha", "touchRelPath": "../../../touch" } }, "sass/config.rb": { "source": "config.rb.tpl.merge", "version": "33f446bd02c3fd24eb27891582eff6a2e789796b", "parameters": { "extRelPath": "../..", "pkgName": "theme-crisp", "pkgType": "theme", "senchadir": ".sencha", "touchRelPath": "../../../${touch.dir}" } }, "sass/etc/all.scss": { "source": "all.scss.merge", "version": "da39a3ee5e6b4b0d3255bfef95601890afd80709", "parameters": { "extRelPath": "../..", "pkgName": "theme-crisp", "pkgType": "theme", "senchadir": ".sencha", "touchRelPath": "../../../${touch.dir}" } }, "sass/example/custom.js": { "source": "custom.js.merge", "version": "199e99bbd15c3c0415569425cb21e77c95e9042a", "parameters": { "extRelPath": "../..", "pkgName": "theme-crisp", "pkgType": "theme", "senchadir": ".sencha", "touchRelPath": "../../../${touch.dir}" } }, "sass/example/theme.html": { "source": "theme.html.tpl.merge", "version": "2c775eb1b3eb10df6efa0743d8aa426af3f9a562", "parameters": { "extRelPath": "../..", "pkgName": "theme-crisp", "pkgType": "theme", "senchadir": ".sencha", "touchRelPath": "../../../${touch.dir}" } }, ".sencha/package/build.properties": { "source": "build.properties.merge", "version": "8b81315dbe73ce9c08478f4c1d2df84f456efcf5", "parameters": { "extRelPath": "../..", "pkgName": "theme-crisp", "pkgType": "theme", "senchadir": ".sencha", "touchRelPath": "../../../${touch.dir}" } }, ".sencha/package/sencha.cfg": { "source": "sencha.cfg.tpl.merge", "version": "057f5f361104adf05c1c49b01b08cd389b3822b2", "parameters": { "extRelPath": "../..", "pkgName": "theme-crisp", "pkgType": "theme", "senchadir": ".sencha", "touchRelPath": "../../../${touch.dir}" } }, ".sencha/package/testing.properties": { "source": "testing.properties.merge", "version": "e65f969c42eb4f355c850fc58fea852582f20db8", "parameters": { "extRelPath": "../..", "pkgName": "theme-crisp", "pkgType": "theme", "senchadir": ".sencha", "touchRelPath": "../../../${touch.dir}" } }, "sass/example/sass-page.html": { "source": "sass-page.html.tpl.merge", "version": "e27edf75982e4b8e1e05a4112718424540b46b10", "parameters": { "extRelPath": "../..", "pkgName": "theme-crisp", "pkgType": "theme", "senchadir": ".sencha", "touchRelPath": "../../../touch" } }, "sass/example/fashion.html": { "source": "fashion.html.tpl.merge", "version": "5117b27d384b8c5ae0bd4aafdb1fad14eaddcc62", "parameters": { "extRelPath": "../..", "pkgName": "theme-crisp", "pkgType": "theme", "senchadir": ".sencha", "touchRelPath": "../../../${touch.dir}" } } } }
{ "pile_set_name": "Github" }
// // BandwidthManageHeaderView.h // pocketEOS // // Created by 师巍巍 on 21/06/2018. // Copyright © 2018 oraclechain. All rights reserved. // #import "BaseTopView.h" @interface BandwidthManageHeaderView : BaseTopView @property (weak, nonatomic) IBOutlet BaseLabel *eosAmountLabel; @end
{ "pile_set_name": "Github" }
#!/usr/bin/env bash # INSTRUCTIONS # # First you need to change the part after TIDDLYWIKI_PLUGIN_PATH= to match the # location of the folder with your plugins # If you have any themes or editions that you want to make available you can # uncomment the lines below and add the path to them too. # # Then in the last line change ~/path/to/wiki/ to the path to your wiki folder. # # You can rename this file to whatever you want, and you can run this file from # wherever you want. # You will probably have to make this file executable on your system by typing: # # sudo chmod +x ./example-start-script.sh # # in the same folder as the script. On many systems you can also do this from # the file manager but how to do it is different in different file managers. # So if you know how to make a file executable form the file manager that # should work too. # You need to use the full path here, ~/TiddlyWiki/Plugins doesn't work export TIDDLYWIKI_PLUGIN_PATH="/path/to/TiddlyWiki/Plugins" #export TIDDLYWIKI_THEME_PATH="/path/to/TiddlyWiki/Themes" #export TIDDLYWIKI_EDITION_PATH="/path/to/TiddlyWiki/Editions" # The first argument is the path to the folder that contains the # tiddlywiki.info file. The second is the server command for the Bob # wiki. tiddlywiki ~/path/to/wiki/ --wsserver
{ "pile_set_name": "Github" }
/* * Licensed to Cloudkick, Inc ('Cloudkick') under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. * Cloudkick 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. */ var jimmy = require('norris/jimmy'); var get = jimmy.commandFacts({ 'hostname': 'hostname' }); exports.get = get;
{ "pile_set_name": "Github" }
// Copyright (c) 2019 PaddlePaddle Authors. All Rights Reserved. // // 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. #pragma once #include <list> #include <map> #include <memory> #include <set> #include <stack> #include <string> #include <vector> #include "lite/core/kernel.h" #include "lite/core/mir/node.h" #include "lite/core/op_lite.h" #include "lite/core/program.h" namespace paddle { namespace lite { namespace mir { // An Graph for MIR. It is built from a list of Op and a scope. class GraphBase {}; class SSAGraph : GraphBase { public: // @param program: the target program with vars and ops // @param valid_places: the valid places user set for the system. // @param block_idx: the block index in the target program, default is 0(main // block) void Build(const Program &program, const std::vector<Place> &valid_places, int block_idx = kRootBlockIdx); void RemoveNode(const mir::Node *node); // Clone from another SSAGraph, all mir::Node(s) are duplicated. void CloneFrom(const SSAGraph &from); std::vector<mir::Node *> StmtTopologicalOrder(); std::vector<mir::Node *> NodeTopologicalOrder(); // The inputs of the graph. std::vector<mir::Node *> inputs(); // The outputs of the graph. std::vector<mir::Node *> outputs(); const std::list<mir::Node> &nodes() const { return node_storage_; } std::list<mir::Node> &mutable_nodes() { return node_storage_; } mir::Node *RetrieveArgument(const std::string &arg); Node *NewArgumentNode(const std::string &name); Node *NewInstructNode(); void CheckValid() { CHECK(CheckBidirectionalConnection()); CHECK(CheckNodesRoleSet()); CHECK(CheckLinksRoleSet()); } Node *GraphCreateInstructNode(const std::shared_ptr<OpLite> &op, const std::vector<Place> &valid_places); // Device related attributes const std::vector<Place> &valid_places() const { return valid_places_; } void SetValidPlaces(const std::vector<Place> &x) { valid_places_ = x; } private: mir::Node *Argument(const std::string &name); // Check the bidirectional connection. bool CheckBidirectionalConnection(); bool CheckNodesRoleSet(); // Check all the items's role in inlinks and outlinks is set. bool CheckLinksRoleSet(); void MarkArgumentWeights(const Program &program) { for (const auto &name : program.weights()) { arguments_[name]->AsArg().is_weight = true; } } // Build operator inlink edge table. std::map<mir::Node *, std::set<mir::Node *>> BuildOperationAdjList(); // Build node inlink edge table. std::map<mir::Node *, std::set<mir::Node *>> BuildNodeAdjList(); void SortHelper(const std::map<mir::Node *, std::set<mir::Node *>> &adj_list, mir::Node *node, std::set<mir::Node *> *visited, std::vector<mir::Node *> *ret); private: std::list<mir::Node> node_storage_; std::map<std::string, mir::Node *> arguments_; std::vector<Place> valid_places_; }; // Remove the link between a -> b. static void RemoveDirectedLink(Node *a, Node *b) { auto it = std::find(b->inlinks.begin(), b->inlinks.end(), a); if (it != b->inlinks.end()) { b->inlinks.erase(it); } auto it1 = std::find(a->outlinks.begin(), a->outlinks.end(), b); if (it1 != a->outlinks.end()) { a->outlinks.erase((it1)); } } // Link a -> b. static void DirectedLink(Node *a, Node *b) { // Eagerly remove first, to avoid duplicate link. RemoveDirectedLink(a, b); a->outlinks.push_back(b); b->inlinks.push_back(a); } static void LocalInferenceType(Node *a, Node *b, const std::string &arg_name) { // instr -> output argument if (a->IsStmt() && b->IsArg()) { auto &inst = a->AsStmt(); auto &output = b->AsArg(); if (!output.type) { output.type = inst.picked_kernel().GetOutputDeclType(arg_name); } } // input argument -> instr if (a->IsArg() && b->IsStmt()) { auto &input = a->AsArg(); auto &inst = b->AsStmt(); if (!input.type) { input.type = inst.picked_kernel().GetInputDeclType(arg_name); } } } } // namespace mir } // namespace lite } // namespace paddle
{ "pile_set_name": "Github" }
from funcy.compat import range from funcy.types import * def test_iterable(): assert iterable([]) assert iterable({}) assert iterable('abc') assert iterable(iter([])) assert iterable(x for x in range(10)) assert iterable(range(10)) assert not iterable(1) def test_is_iter(): assert is_iter(iter([])) assert is_iter(x for x in range(10)) assert not is_iter([]) assert not is_iter(range(10))
{ "pile_set_name": "Github" }
/** * @author sunag / http://www.sunag.com.br/ */ import { Node } from './Node.js'; function VarNode( type, value ) { Node.call( this, type ); this.value = value; } VarNode.prototype = Object.create( Node.prototype ); VarNode.prototype.constructor = VarNode; VarNode.prototype.nodeType = "Var"; VarNode.prototype.getType = function ( builder ) { return builder.getTypeByFormat( this.type ); }; VarNode.prototype.generate = function ( builder, output ) { var varying = builder.getVar( this.uuid, this.type ); if ( this.value && builder.isShader( 'vertex' ) ) { builder.addNodeCode( varying.name + ' = ' + this.value.build( builder, this.getType( builder ) ) + ';' ); } return builder.format( varying.name, this.getType( builder ), output ); }; VarNode.prototype.copy = function ( source ) { Node.prototype.copy.call( this, source ); this.type = source.type; this.value = source.value; return this; }; VarNode.prototype.toJSON = function ( meta ) { var data = this.getJSONNode( meta ); if ( ! data ) { data = this.createJSONNode( meta ); data.type = this.type; if ( this.value ) data.value = this.value.toJSON( meta ).uuid; } return data; }; export { VarNode };
{ "pile_set_name": "Github" }
- name: Kubesphere | Getting minio installation files copy: src: "{{ item }}" dest: "{{ kubesphere_dir }}/" loop: - "minio-ha" - name: Kubesphere | Creating manifests template: src: "{{ item.file }}.j2" dest: "{{ kubesphere_dir }}/{{ item.file }}" with_items: - { name: custom-values-minio, file: custom-values-minio.yaml } - name: Kubesphere | Check minio shell: > {{ bin_dir }}/helm list -n kubesphere-system | grep "ks-minio" register: minio_check failed_when: false - block: - name: Kubesphere | Deploy minio shell: > {{ bin_dir }}/helm upgrade --install ks-minio {{ kubesphere_dir }}/minio-ha -f {{ kubesphere_dir }}/custom-values-minio.yaml --set fullnameOverride=minio --namespace kubesphere-system --wait --timeout 1800s register: minio_status failed_when: false - debug: msg: - 1. check the storage configuration and storage server - 2. make sure the DNS address in /etc/resolv.conf is available - 3. execute 'kubectl logs -n kubesphere-system -l job-name=minio-make-bucket-job' to watch logs - 4. execute 'helm -n kubesphere-system uninstall ks-minio && kubectl -n kubesphere-system delete job minio-make-bucket-job' - 5. Restart the installer pod in kubesphere-system namespace when: minio_status.rc != 0 - fail: msg: "It is suggested to refer to the above methods for troubleshooting problems ." when: minio_status.rc != 0 when: - (minio_check.stdout.find("deployed") == -1) or (minio_check.stdout.find("RELEASE.2019-08-07T01-59-21Z") == -1) - name: Kubesphere | import minio status shell: > {{ bin_dir }}/kubectl patch cc ks-installer --type merge -p '{"status": {"minio": {"status": "enabled", "enabledTime": "{{ lookup('pipe','date +%Y-%m-%dT%H:%M:%S%Z') }}"}}}' -n kubesphere-system register: import failed_when: "import.stderr and 'Warning' not in import.stderr" until: import is succeeded retries: 5 delay: 3
{ "pile_set_name": "Github" }
/****************************************************************************** * Author: Laurent Kneip * * Contact: [email protected] * * License: Copyright (c) 2013 Laurent Kneip, ANU. All rights reserved. * * * * Redistribution and use in source and binary forms, with or without * * modification, are permitted provided that the following conditions * * are met: * * * Redistributions of source code must retain the above copyright * * notice, this list of conditions and the following disclaimer. * * * Redistributions in binary form must reproduce the above copyright * * notice, this list of conditions and the following disclaimer in the * * documentation and/or other materials provided with the distribution. * * * Neither the name of ANU nor the names of its contributors may be * * used to endorse or promote products derived from this software without * * specific prior written permission. * * * * 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 MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE * * ARE DISCLAIMED. IN NO EVENT SHALL ANU OR THE CONTRIBUTORS BE LIABLE * * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL * * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR * * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER * * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT * * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY * * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF * * SUCH DAMAGE. * ******************************************************************************/ #include <stdlib.h> #include <stdio.h> #include <iostream> #include <iomanip> #include <limits.h> #include <Eigen/Eigen> #include <opengv/relative_pose/methods.hpp> #include <opengv/relative_pose/NoncentralRelativeMultiAdapter.hpp> #include <opengv/sac/MultiRansac.hpp> #include <opengv/sac_problems/relative_pose/MultiNoncentralRelativePoseSacProblem.hpp> #include <sstream> #include <fstream> #include "random_generators.hpp" #include "experiment_helpers.hpp" #include "time_measurement.hpp" using namespace std; using namespace Eigen; using namespace opengv; int main( int argc, char** argv ) { // initialize random seed initializeRandomSeed(); //set experiment parameters double noise = 0.3; double outlierFraction = 0.1; size_t pointsPerCam = 25; int numberCameras = 4; //generate a random pose for viewpoint 1 translation_t position1 = Eigen::Vector3d::Zero(); rotation_t rotation1 = Eigen::Matrix3d::Identity(); //generate a random pose for viewpoint 2 translation_t position2 = generateRandomTranslation(2.0); rotation_t rotation2 = generateRandomRotation(0.5); //create a fake central camera translations_t camOffsets; rotations_t camRotations; generateRandomCameraSystem( numberCameras, camOffsets, camRotations ); //derive correspondences based on random point-cloud std::vector<std::shared_ptr<bearingVectors_t> > multiBearingVectors1; std::vector<std::shared_ptr<bearingVectors_t> > multiBearingVectors2; std::vector<std::shared_ptr<Eigen::MatrixXd> > gt; generateMulti2D2DCorrespondences( position1, rotation1, position2, rotation2, camOffsets, camRotations, pointsPerCam, noise, outlierFraction, multiBearingVectors1, multiBearingVectors2, gt ); //Extract the relative pose translation_t position; rotation_t rotation; extractRelativePose( position1, position2, rotation1, rotation2, position, rotation, false ); //print experiment characteristics printExperimentCharacteristics( position, rotation, noise, outlierFraction ); //create a non-central relative multi-adapter relative_pose::NoncentralRelativeMultiAdapter adapter( multiBearingVectors1, multiBearingVectors2, camOffsets, camRotations); //Create a MultiNoncentralRelativePoseSacProblem and Ransac opengv::sac::MultiRansac< sac_problems::relative_pose::MultiNoncentralRelativePoseSacProblem> ransac; std::shared_ptr< sac_problems::relative_pose::MultiNoncentralRelativePoseSacProblem> relposeproblem_ptr( new sac_problems::relative_pose::MultiNoncentralRelativePoseSacProblem( adapter, sac_problems::relative_pose::MultiNoncentralRelativePoseSacProblem::SIXPT)); ransac.sac_model_ = relposeproblem_ptr; ransac.threshold_ = 2.0*(1.0 - cos(atan(sqrt(2.0)*0.5/800.0))); ransac.max_iterations_ = 100; //Run the experiment struct timeval tic; struct timeval toc; gettimeofday( &tic, 0 ); ransac.computeModel(); gettimeofday( &toc, 0 ); double ransac_time = TIMETODOUBLE(timeval_minus(toc,tic)); //print the results std::cout << "the ransac threshold is: " << ransac.threshold_ << std::endl; std::cout << "the ransac results is: " << std::endl; std::cout << ransac.model_coefficients_ << std::endl << std::endl; std::cout << "Ransac needed " << ransac.iterations_ << " iterations and "; std::cout << ransac_time << " seconds" << std::endl << std::endl; size_t numberInliers = 0; for(size_t i = 0; i < ransac.inliers_.size(); i++) numberInliers += ransac.inliers_[i].size(); std::cout << "the number of inliers is: " << numberInliers; std::cout << std::endl << std::endl; std::cout << "the found inliers are: " << std::endl; for(size_t i = 0; i < ransac.inliers_.size(); i++) { for(size_t j = 0; j < ransac.inliers_[i].size(); j++) std::cout << ransac.inliers_[i][j] << " "; } std::cout << std::endl << std::endl; }
{ "pile_set_name": "Github" }
/** * * WARNING! This file was autogenerated by: * _ _ _ _ __ __ * | | | | | | |\ \ / / * | | | | |_| | \ V / * | | | | _ | / \ * | |_| | | | |/ /^\ \ * \___/\_| |_/\/ \/ * * This file was autogenerated by UnrealHxGenerator using UHT definitions. * It only includes UPROPERTYs and UFUNCTIONs. Do not modify it! * In order to add more definitions, create or edit a type with the same name/package, but with an `_Extra` suffix **/ package unreal.sequencer; /** WARNING: This type was not defined as DLL export on its declaration. Because of that, some of its methods are inaccessible **/ @:umodule("Sequencer") @:glueCppIncludes("Private/SequencerMeshTrail.h") @:noClass @:uextern @:uclass extern class ASequencerMeshTrail extends unreal.AActor { }
{ "pile_set_name": "Github" }
// // YYTextTransaction.m // YYText <https://github.com/ibireme/YYText> // // Created by ibireme on 15/4/18. // Copyright (c) 2015 ibireme. // // This source code is licensed under the MIT-style license found in the // LICENSE file in the root directory of this source tree. // #import "YYTextTransaction.h" @interface YYTextTransaction() @property (nonatomic, strong) id target; @property (nonatomic, assign) SEL selector; @end static NSMutableSet *transactionSet = nil; static void YYRunLoopObserverCallBack(CFRunLoopObserverRef observer, CFRunLoopActivity activity, void *info) { if (transactionSet.count == 0) return; NSSet *currentSet = transactionSet; transactionSet = [NSMutableSet new]; [currentSet enumerateObjectsUsingBlock:^(YYTextTransaction *transaction, BOOL *stop) { #pragma clang diagnostic push #pragma clang diagnostic ignored "-Warc-performSelector-leaks" [transaction.target performSelector:transaction.selector]; #pragma clang diagnostic pop }]; } static void YYTextTransactionSetup() { static dispatch_once_t onceToken; dispatch_once(&onceToken, ^{ transactionSet = [NSMutableSet new]; CFRunLoopRef runloop = CFRunLoopGetMain(); CFRunLoopObserverRef observer; observer = CFRunLoopObserverCreate(CFAllocatorGetDefault(), kCFRunLoopBeforeWaiting | kCFRunLoopExit, true, // repeat 0xFFFFFF, // after CATransaction(2000000) YYRunLoopObserverCallBack, NULL); CFRunLoopAddObserver(runloop, observer, kCFRunLoopCommonModes); CFRelease(observer); }); } @implementation YYTextTransaction + (YYTextTransaction *)transactionWithTarget:(id)target selector:(SEL)selector{ if (!target || !selector) return nil; YYTextTransaction *t = [YYTextTransaction new]; t.target = target; t.selector = selector; return t; } - (void)commit { if (!_target || !_selector) return; YYTextTransactionSetup(); [transactionSet addObject:self]; } - (NSUInteger)hash { long v1 = (long)((void *)_selector); long v2 = (long)_target; return v1 ^ v2; } - (BOOL)isEqual:(id)object { if (self == object) return YES; if (![object isMemberOfClass:self.class]) return NO; YYTextTransaction *other = object; return other.selector == _selector && other.target == _target; } @end
{ "pile_set_name": "Github" }
LAMMPS data file via write_data, version 24 Oct 2015-ICMS, timestep = 16 117 atoms 8 atom types 116 bonds 10 bond types 219 angles 19 angle types 311 dihedrals 25 dihedral types 11 impropers 3 improper types -2.5859999660000001e+00 1.2220000267000000e+01 xlo xhi 2.5989999770000001e+00 2.2969999312999999e+01 ylo yhi -2.3459999560000000e+00 3.6015998840000002e+01 zlo zhi Masses 1 12.0112 2 14.0067 3 12.0112 4 15.9994 5 1.00797 6 1.00797 7 15.9994 8 14.0067 Pair Coeffs # lj/cut/coul/cut 1 0.039 3.87541 2 0.167 3.50123 3 0.148 3.61705 4 0.228 2.85978 5 0.038 2.44997 6 0 0 7 0.228 2.85978 8 0.167 3.50123 Bond Coeffs # harmonic 1 322.716 1.526 2 340.618 1.105 3 356.599 1.47 4 377.575 1.46 5 388 1.32 6 483.451 1.026 7 615.322 1.23 8 283.092 1.52 9 540 1.25 10 457.459 1.026 Angle Coeffs # harmonic 1 44.4 110 2 50 109.5 3 39.5 106.4 4 57.3 109.5 5 46.6 110.5 6 50 109.5 7 51.5 109.5 8 111 118 9 35 122 10 37.5 115 11 68 120 12 53.5 114.1 13 68 120 14 46.6 110.5 15 45 109.5 16 68 120 17 145 123 18 41.6 110 19 36 105.5 Dihedral Coeffs # harmonic 1 0.1581 1 3 2 0.1581 1 3 3 0.1581 1 3 4 0.1581 1 3 5 0.0889 1 3 6 0.0889 1 3 7 0.1581 1 3 8 0.1581 1 3 9 0.1581 1 3 10 0 1 0 11 0 1 0 12 0 1 0 13 0 1 0 14 3.8 -1 2 15 3.2 -1 2 16 1.8 -1 2 17 1.2 -1 2 18 0 1 0 19 0 1 0 20 0 1 0 21 0 1 0 22 0.1581 1 3 23 0.1581 1 3 24 0 1 0 25 0 1 0 Improper Coeffs # cvff 1 0.05 -1 2 2 10 -1 2 3 11.6 -1 2 Atoms # full 1 1 1 2.2000000000000000e-01 1.4910285057634631e+00 2.0560228642521494e+01 -4.2849750163132361e-01 0 0 0 2 1 1 -2.0000000000000001e-01 2.3345187989361205e+00 1.9881902367134977e+01 6.6767907815849603e-01 0 0 0 3 1 1 -2.0000000000000001e-01 2.9054556886850413e+00 2.0891628831167594e+01 1.6609148610214672e+00 0 0 0 4 1 1 -2.0000000000000001e-01 3.5715356284848956e+00 2.0182697393370688e+01 2.8587357484047109e+00 0 0 0 5 1 1 -2.0000000000000001e-01 4.1295381348170972e+00 2.1164763329915797e+01 3.8868650437975876e+00 0 0 0 6 1 1 2.0000000000000000e-02 4.8038324305482671e+00 2.0458443544804037e+01 5.0739506111424912e+00 0 0 0 7 1 2 -5.0000000000000000e-01 5.4421162600540338e+00 2.1460432143754517e+01 5.9299361569161659e+00 0 0 0 8 1 3 3.8000000000000000e-01 6.4171882865646772e+00 2.1150602178766018e+01 6.7960733243974003e+00 0 0 0 16 1 5 1.0000000000000001e-01 2.0881638318975924e+00 2.0692669447261210e+01 -1.3495859402564667e+00 0 0 0 17 1 5 1.0000000000000001e-01 1.1836464403717395e+00 2.1575821488412966e+01 -1.2015663168879144e-01 0 0 0 18 1 5 1.0000000000000001e-01 3.1604088988005850e+00 1.9314396294219382e+01 2.0034258142943326e-01 0 0 0 19 1 5 1.0000000000000001e-01 1.7325695100736336e+00 1.9146416712389193e+01 1.2268946560212557e+00 0 0 0 20 1 5 1.0000000000000001e-01 3.6322763859870366e+00 2.1549853127538682e+01 1.1508241363718743e+00 0 0 0 21 1 5 1.0000000000000001e-01 2.0995994364743931e+00 2.1550105702261121e+01 2.0306650916396549e+00 0 0 0 22 1 5 1.0000000000000001e-01 4.3839369856423138e+00 1.9527519635935580e+01 2.4976580036782456e+00 0 0 0 23 1 5 1.0000000000000001e-01 2.8385113949084002e+00 1.9524276164539163e+01 3.3562390094306576e+00 0 0 0 24 1 5 1.0000000000000001e-01 4.8626850805478750e+00 2.1819759209747112e+01 3.3897672128232785e+00 0 0 0 25 1 5 1.0000000000000001e-01 3.3221682775475707e+00 2.1823437359322515e+01 4.2474751462448763e+00 0 0 0 26 1 5 1.0000000000000001e-01 5.5628470058537811e+00 1.9754983066492606e+01 4.6964240978435194e+00 0 0 0 27 1 5 1.0000000000000001e-01 4.0829056362734333e+00 1.9858960919852759e+01 5.6533800347661192e+00 0 0 0 28 1 6 2.8000000000000003e-01 5.1186128365205041e+00 2.2438139298186400e+01 5.9866755466779011e+00 0 0 0 29 1 5 1.0000000000000001e-01 7.0523302071093372e+00 1.9074884346259072e+01 6.3942762266910336e+00 0 0 0 114 1 8 -5.0000000000000000e-01 2.6506142725965681e-01 1.9801916392980470e+01 -7.6129334639845658e-01 0 0 0 115 1 6 3.5999999999999999e-01 1.0040007736997127e-01 1.9767248902794744e+01 -1.7782326096738481e+00 0 0 0 116 1 6 3.5999999999999999e-01 -5.7343940264159243e-01 2.0240602682308364e+01 -3.5389955418812696e-01 0 0 0 117 1 6 3.5999999999999999e-01 2.8328327348395488e-01 1.8828039682407979e+01 -4.3321935271616574e-01 0 0 0 41 1 1 -2.0000000000000001e-01 1.0056924023293659e+01 1.2620459680128116e+01 1.4809130550782312e+01 0 0 0 42 1 1 -2.0000000000000001e-01 9.3337254589672742e+00 1.1434831800167958e+01 1.5470517727131956e+01 0 0 0 43 1 1 2.0000000000000000e-02 1.0242592270247346e+01 1.0199655370412954e+01 1.5636662276238530e+01 0 0 0 44 1 2 -5.0000000000000000e-01 9.5639326287734363e+00 9.0717043962364734e+00 1.6291338990563940e+01 0 0 0 63 1 5 1.0000000000000001e-01 1.0431084159631421e+01 1.2304804378630241e+01 1.3820809498862047e+01 0 0 0 64 1 5 1.0000000000000001e-01 8.9591572196228064e+00 1.1748410369929427e+01 1.6461509481467022e+01 0 0 0 65 1 5 1.0000000000000001e-01 8.4494246558652844e+00 1.1164707241142871e+01 1.4865527080432482e+01 0 0 0 66 1 5 1.0000000000000001e-01 1.1126515787109579e+01 1.0482658976251598e+01 1.6237400737847704e+01 0 0 0 67 1 5 1.0000000000000001e-01 1.0621906165734291e+01 9.8526225255327695e+00 1.4654688118400630e+01 0 0 0 68 1 6 2.8000000000000003e-01 8.5810248315904438e+00 8.8144433614687951e+00 1.6111292312819625e+01 0 0 0 69 1 5 1.0000000000000001e-01 9.3760738592898996e+00 6.2400532631650725e+00 1.6673090424506832e+01 0 0 0 9 1 4 -3.8000000000000000e-01 7.0732759958623612e+00 2.2058108495125772e+01 7.2899522494900273e+00 0 0 0 10 1 1 -2.0000000000000001e-01 6.6779537757120861e+00 1.9691100206613317e+01 7.2264636711748871e+00 0 0 0 11 1 1 -2.0000000000000001e-01 7.6802380679797544e+00 1.9640770117312808e+01 8.3944527173938823e+00 0 0 0 12 1 1 -2.0000000000000001e-01 7.4922284297073984e+00 1.8442170784315969e+01 9.3615010427281238e+00 0 0 0 13 1 1 -2.0000000000000001e-01 8.4534063685385039e+00 1.8436403081483789e+01 1.0564451929856872e+01 0 0 0 14 1 3 3.8000000000000000e-01 8.1307804877039782e+00 1.7341156660242444e+01 1.1582641354861494e+01 0 0 0 15 1 4 -3.8000000000000000e-01 6.9609581735487058e+00 1.7009274684946160e+01 1.1777794337429572e+01 0 0 0 30 1 5 1.0000000000000001e-01 5.7306654573675093e+00 1.9225769597342101e+01 7.5386545003851460e+00 0 0 0 31 1 5 1.0000000000000001e-01 8.7018322999006461e+00 1.9658925109125448e+01 7.9738014248823070e+00 0 0 0 32 1 5 1.0000000000000001e-01 7.5869232389044265e+00 2.0569239411308136e+01 8.9778286977221331e+00 0 0 0 33 1 5 1.0000000000000001e-01 7.5811609323687188e+00 1.7484360572746819e+01 8.8208149425014479e+00 0 0 0 34 1 5 1.0000000000000001e-01 6.4679567221342138e+00 1.8467795506880975e+01 9.7735883424421370e+00 0 0 0 35 1 5 1.0000000000000001e-01 9.5039807317059264e+00 1.8369099378461456e+01 1.0234713229374590e+01 0 0 0 36 1 5 1.0000000000000001e-01 8.3606337879470125e+00 1.9398559908393665e+01 1.1101849889297506e+01 0 0 0 37 1 2 -5.0000000000000000e-01 9.1518168710327252e+00 1.6833760132679334e+01 1.2281235699502378e+01 0 0 0 38 1 1 2.0000000000000000e-02 8.8608300904620556e+00 1.6164832483765775e+01 1.3564229878798786e+01 0 0 0 39 1 1 -2.0000000000000001e-01 9.8425430985209612e+00 1.5031434526502494e+01 1.3916751433419543e+01 0 0 0 40 1 1 -2.0000000000000001e-01 9.1507475989920994e+00 1.3860034952831366e+01 1.4635415668882903e+01 0 0 0 55 1 6 2.8000000000000003e-01 1.0099728622827501e+01 1.7105724153109293e+01 1.1976592189553001e+01 0 0 0 56 1 5 1.0000000000000001e-01 8.8655188904810771e+00 1.6926627492772841e+01 1.4372382122542346e+01 0 0 0 57 1 5 1.0000000000000001e-01 7.8317410449734304e+00 1.5767317677187135e+01 1.3546602322011916e+01 0 0 0 58 1 5 1.0000000000000001e-01 1.0641112606238895e+01 1.5445733238286220e+01 1.4558362350579651e+01 0 0 0 59 1 5 1.0000000000000001e-01 1.0328758257303006e+01 1.4658787199455681e+01 1.2999449881586958e+01 0 0 0 60 1 5 1.0000000000000001e-01 8.7841416266344297e+00 1.4198587224878745e+01 1.5619080295798236e+01 0 0 0 61 1 5 1.0000000000000001e-01 8.2526619884539443e+00 1.3563252259239187e+01 1.4066708018640815e+01 0 0 0 62 1 5 1.0000000000000001e-01 1.0951381905092992e+01 1.2891603429837280e+01 1.5396010560265770e+01 0 0 0 45 1 3 3.8000000000000000e-01 1.0295672876366893e+01 8.1731530028968198e+00 1.6945139734100042e+01 0 0 0 46 1 4 -3.8000000000000000e-01 1.1513790650421583e+01 8.2926329460316826e+00 1.7101244782365772e+01 0 0 0 47 1 1 -2.0000000000000001e-01 9.5534828030357364e+00 6.9582740928165299e+00 1.7494407729488316e+01 0 0 0 48 1 1 -2.0000000000000001e-01 1.0329564604824704e+01 6.2578495841446431e+00 1.8621317313751486e+01 0 0 0 49 1 1 -2.0000000000000001e-01 9.4042504977824475e+00 5.5216154466271750e+00 1.9617681114983082e+01 0 0 0 50 1 1 -2.0000000000000001e-01 1.0138046499196712e+01 4.9288830062447238e+00 2.0838451803990246e+01 0 0 0 51 1 5 1.0000000000000001e-01 1.0713835162671360e+01 5.7165032873559758e+00 2.1358640913371840e+01 0 0 0 52 1 5 1.0000000000000001e-01 1.0875883102341405e+01 4.1699358666356048e+00 2.0521587825556182e+01 0 0 0 53 1 3 3.8000000000000000e-01 9.2187273831475061e+00 4.2688971651148737e+00 2.1862219285515927e+01 0 0 0 54 1 4 -3.8000000000000000e-01 9.6137510363398313e+00 3.3234588207576445e+00 2.2546964753758260e+01 0 0 0 70 1 5 1.0000000000000001e-01 8.5578931978443169e+00 7.2742459091370737e+00 1.7856573555962328e+01 0 0 0 71 1 5 1.0000000000000001e-01 1.1059345829990733e+01 5.5627610825488141e+00 1.8166150052241591e+01 0 0 0 72 1 5 1.0000000000000001e-01 1.0927485882854326e+01 7.0118959436813881e+00 1.9160522580598602e+01 0 0 0 73 1 5 1.0000000000000001e-01 8.8536248590312869e+00 4.7120035959460660e+00 1.9109430739061832e+01 0 0 0 74 1 5 1.0000000000000001e-01 8.6452985198022354e+00 6.2458534853645542e+00 1.9957287229900256e+01 0 0 0 75 1 2 -5.0000000000000000e-01 8.0037896830298649e+00 4.7662771527583088e+00 2.2014420916086429e+01 0 0 0 76 1 1 2.0000000000000000e-02 7.1397003451095689e+00 4.1971042087102726e+00 2.3050625337965840e+01 0 0 0 77 1 1 -2.0000000000000001e-01 6.1029288800521782e+00 5.2251691556340418e+00 2.3531440214255785e+01 0 0 0 78 1 1 -2.0000000000000001e-01 5.9056879335155497e+00 5.2011198885696688e+00 2.5054855963590022e+01 0 0 0 79 1 1 -2.0000000000000001e-01 5.0397890346344054e+00 6.3698969425338250e+00 2.5580282351042019e+01 0 0 0 91 1 6 2.8000000000000003e-01 7.7083344027743026e+00 5.4579917016145636e+00 2.1312440744760728e+01 0 0 0 92 1 5 1.0000000000000001e-01 6.6609425246037421e+00 3.2813036864125977e+00 2.2649186037227320e+01 0 0 0 93 1 5 1.0000000000000001e-01 7.7693800857881534e+00 3.8786681433327090e+00 2.3900949190055769e+01 0 0 0 94 1 5 1.0000000000000001e-01 5.1457477099097177e+00 5.0349546273562584e+00 2.3016788043533204e+01 0 0 0 95 1 5 1.0000000000000001e-01 6.4366234800835498e+00 6.2342108702616947e+00 2.3234340239562854e+01 0 0 0 96 1 5 1.0000000000000001e-01 5.4582644104029336e+00 4.2379833820980295e+00 2.5354491996877957e+01 0 0 0 97 1 5 1.0000000000000001e-01 6.8906066959423367e+00 5.2412290683978702e+00 2.5553917149930616e+01 0 0 0 98 1 5 1.0000000000000001e-01 4.0461431700953208e+00 6.3397757941639670e+00 2.5098952144630040e+01 0 0 0 99 1 5 1.0000000000000001e-01 5.4926998009976629e+00 7.3278462163850140e+00 2.5270885619359980e+01 0 0 0 80 1 1 -2.0000000000000001e-01 4.8812746300556906e+00 6.3616020862417741e+00 2.7111199370613672e+01 0 0 0 81 1 1 2.0000000000000000e-02 4.0127807939494158e+00 7.5210914879308977e+00 2.7634960251528902e+01 0 0 0 82 1 2 -5.0000000000000000e-01 3.8257169960726722e+00 7.4686968436576846e+00 2.9089222280082993e+01 0 0 0 83 1 3 3.8000000000000000e-01 2.7564983246511465e+00 8.0578192388944760e+00 2.9615739052996258e+01 0 0 0 84 1 4 -3.8000000000000000e-01 1.9043016511783979e+00 8.6246208780846967e+00 2.8925388243568289e+01 0 0 0 85 1 1 -2.0000000000000001e-01 2.6289848861772631e+00 8.0063050989573874e+00 3.1139507621782958e+01 0 0 0 86 1 1 -2.0000000000000001e-01 1.1825743519826699e+00 8.2488652680075383e+00 3.1600474671582852e+01 0 0 0 87 1 1 -2.0000000000000001e-01 8.2988725198481228e-01 7.5708652245726897e+00 3.2940232873783287e+01 0 0 0 88 1 1 -2.0000000000000001e-01 -6.4777828393936554e-01 7.7162898112769556e+00 3.3311115472938141e+01 0 0 0 89 1 3 4.5000000000000001e-01 -9.2461430959164304e-01 6.9785937162189455e+00 3.4601070548275516e+01 0 0 0 90 1 7 -5.0000000000000000e-01 -1.8406501962066379e+00 7.3829361517942047e+00 3.5341381171163086e+01 0 0 0 100 1 5 1.0000000000000001e-01 4.4261964477266806e+00 5.4018245922994135e+00 2.7415643449219509e+01 0 0 0 101 1 5 1.0000000000000001e-01 5.8806172843467817e+00 6.4044618707111107e+00 2.7580784036310657e+01 0 0 0 102 1 5 1.0000000000000001e-01 3.0206167818992973e+00 7.4728846238364000e+00 2.7149830982317955e+01 0 0 0 103 1 5 1.0000000000000001e-01 4.4514942398980200e+00 8.5037615363090104e+00 2.7377301383645136e+01 0 0 0 104 1 6 2.8000000000000003e-01 4.5463304867207279e+00 7.1654728692421736e+00 2.9762219102733734e+01 0 0 0 105 1 5 1.0000000000000001e-01 3.2932259231321819e+00 8.7674825212827727e+00 3.1593410036426601e+01 0 0 0 106 1 5 1.0000000000000001e-01 2.9784344848122748e+00 7.0198708575934461e+00 3.1502888147122405e+01 0 0 0 107 1 5 1.0000000000000001e-01 1.0153503565794237e+00 9.3401286250387248e+00 3.1658662077471003e+01 0 0 0 108 1 5 1.0000000000000001e-01 5.0092623798131142e-01 7.8744164841734170e+00 3.0819513542596912e+01 0 0 0 109 1 5 1.0000000000000001e-01 1.4339943820629586e+00 7.9628108653394580e+00 3.3771691050539644e+01 0 0 0 110 1 5 1.0000000000000001e-01 1.0573163995205890e+00 6.4961301774332929e+00 3.2884606139332135e+01 0 0 0 111 1 5 1.0000000000000001e-01 -9.2300190095621804e-01 8.7808381933236355e+00 3.3425102731709302e+01 0 0 0 112 1 5 1.0000000000000001e-01 -1.2922397157072609e+00 7.3179834618897983e+00 3.2502086582617601e+01 0 0 0 113 1 7 -5.0000000000000000e-01 -2.2131928777512250e-01 5.9892914891028113e+00 3.4883220522038648e+01 0 0 0 Velocities 1 0.0000000000000000e+00 0.0000000000000000e+00 0.0000000000000000e+00 2 0.0000000000000000e+00 0.0000000000000000e+00 0.0000000000000000e+00 3 0.0000000000000000e+00 0.0000000000000000e+00 0.0000000000000000e+00 4 0.0000000000000000e+00 0.0000000000000000e+00 0.0000000000000000e+00 5 0.0000000000000000e+00 0.0000000000000000e+00 0.0000000000000000e+00 6 0.0000000000000000e+00 0.0000000000000000e+00 0.0000000000000000e+00 7 0.0000000000000000e+00 0.0000000000000000e+00 0.0000000000000000e+00 8 0.0000000000000000e+00 0.0000000000000000e+00 0.0000000000000000e+00 16 0.0000000000000000e+00 0.0000000000000000e+00 0.0000000000000000e+00 17 0.0000000000000000e+00 0.0000000000000000e+00 0.0000000000000000e+00 18 0.0000000000000000e+00 0.0000000000000000e+00 0.0000000000000000e+00 19 0.0000000000000000e+00 0.0000000000000000e+00 0.0000000000000000e+00 20 0.0000000000000000e+00 0.0000000000000000e+00 0.0000000000000000e+00 21 0.0000000000000000e+00 0.0000000000000000e+00 0.0000000000000000e+00 22 0.0000000000000000e+00 0.0000000000000000e+00 0.0000000000000000e+00 23 0.0000000000000000e+00 0.0000000000000000e+00 0.0000000000000000e+00 24 0.0000000000000000e+00 0.0000000000000000e+00 0.0000000000000000e+00 25 0.0000000000000000e+00 0.0000000000000000e+00 0.0000000000000000e+00 26 0.0000000000000000e+00 0.0000000000000000e+00 0.0000000000000000e+00 27 0.0000000000000000e+00 0.0000000000000000e+00 0.0000000000000000e+00 28 0.0000000000000000e+00 0.0000000000000000e+00 0.0000000000000000e+00 29 0.0000000000000000e+00 0.0000000000000000e+00 0.0000000000000000e+00 114 0.0000000000000000e+00 0.0000000000000000e+00 0.0000000000000000e+00 115 0.0000000000000000e+00 0.0000000000000000e+00 0.0000000000000000e+00 116 0.0000000000000000e+00 0.0000000000000000e+00 0.0000000000000000e+00 117 0.0000000000000000e+00 0.0000000000000000e+00 0.0000000000000000e+00 41 0.0000000000000000e+00 0.0000000000000000e+00 0.0000000000000000e+00 42 0.0000000000000000e+00 0.0000000000000000e+00 0.0000000000000000e+00 43 0.0000000000000000e+00 0.0000000000000000e+00 0.0000000000000000e+00 44 0.0000000000000000e+00 0.0000000000000000e+00 0.0000000000000000e+00 63 0.0000000000000000e+00 0.0000000000000000e+00 0.0000000000000000e+00 64 0.0000000000000000e+00 0.0000000000000000e+00 0.0000000000000000e+00 65 0.0000000000000000e+00 0.0000000000000000e+00 0.0000000000000000e+00 66 0.0000000000000000e+00 0.0000000000000000e+00 0.0000000000000000e+00 67 0.0000000000000000e+00 0.0000000000000000e+00 0.0000000000000000e+00 68 0.0000000000000000e+00 0.0000000000000000e+00 0.0000000000000000e+00 69 0.0000000000000000e+00 0.0000000000000000e+00 0.0000000000000000e+00 9 0.0000000000000000e+00 0.0000000000000000e+00 0.0000000000000000e+00 10 0.0000000000000000e+00 0.0000000000000000e+00 0.0000000000000000e+00 11 0.0000000000000000e+00 0.0000000000000000e+00 0.0000000000000000e+00 12 0.0000000000000000e+00 0.0000000000000000e+00 0.0000000000000000e+00 13 0.0000000000000000e+00 0.0000000000000000e+00 0.0000000000000000e+00 14 0.0000000000000000e+00 0.0000000000000000e+00 0.0000000000000000e+00 15 0.0000000000000000e+00 0.0000000000000000e+00 0.0000000000000000e+00 30 0.0000000000000000e+00 0.0000000000000000e+00 0.0000000000000000e+00 31 0.0000000000000000e+00 0.0000000000000000e+00 0.0000000000000000e+00 32 0.0000000000000000e+00 0.0000000000000000e+00 0.0000000000000000e+00 33 0.0000000000000000e+00 0.0000000000000000e+00 0.0000000000000000e+00 34 0.0000000000000000e+00 0.0000000000000000e+00 0.0000000000000000e+00 35 0.0000000000000000e+00 0.0000000000000000e+00 0.0000000000000000e+00 36 0.0000000000000000e+00 0.0000000000000000e+00 0.0000000000000000e+00 37 0.0000000000000000e+00 0.0000000000000000e+00 0.0000000000000000e+00 38 0.0000000000000000e+00 0.0000000000000000e+00 0.0000000000000000e+00 39 0.0000000000000000e+00 0.0000000000000000e+00 0.0000000000000000e+00 40 0.0000000000000000e+00 0.0000000000000000e+00 0.0000000000000000e+00 55 0.0000000000000000e+00 0.0000000000000000e+00 0.0000000000000000e+00 56 0.0000000000000000e+00 0.0000000000000000e+00 0.0000000000000000e+00 57 0.0000000000000000e+00 0.0000000000000000e+00 0.0000000000000000e+00 58 0.0000000000000000e+00 0.0000000000000000e+00 0.0000000000000000e+00 59 0.0000000000000000e+00 0.0000000000000000e+00 0.0000000000000000e+00 60 0.0000000000000000e+00 0.0000000000000000e+00 0.0000000000000000e+00 61 0.0000000000000000e+00 0.0000000000000000e+00 0.0000000000000000e+00 62 0.0000000000000000e+00 0.0000000000000000e+00 0.0000000000000000e+00 45 0.0000000000000000e+00 0.0000000000000000e+00 0.0000000000000000e+00 46 0.0000000000000000e+00 0.0000000000000000e+00 0.0000000000000000e+00 47 0.0000000000000000e+00 0.0000000000000000e+00 0.0000000000000000e+00 48 0.0000000000000000e+00 0.0000000000000000e+00 0.0000000000000000e+00 49 0.0000000000000000e+00 0.0000000000000000e+00 0.0000000000000000e+00 50 0.0000000000000000e+00 0.0000000000000000e+00 0.0000000000000000e+00 51 0.0000000000000000e+00 0.0000000000000000e+00 0.0000000000000000e+00 52 0.0000000000000000e+00 0.0000000000000000e+00 0.0000000000000000e+00 53 0.0000000000000000e+00 0.0000000000000000e+00 0.0000000000000000e+00 54 0.0000000000000000e+00 0.0000000000000000e+00 0.0000000000000000e+00 70 0.0000000000000000e+00 0.0000000000000000e+00 0.0000000000000000e+00 71 0.0000000000000000e+00 0.0000000000000000e+00 0.0000000000000000e+00 72 0.0000000000000000e+00 0.0000000000000000e+00 0.0000000000000000e+00 73 0.0000000000000000e+00 0.0000000000000000e+00 0.0000000000000000e+00 74 0.0000000000000000e+00 0.0000000000000000e+00 0.0000000000000000e+00 75 0.0000000000000000e+00 0.0000000000000000e+00 0.0000000000000000e+00 76 0.0000000000000000e+00 0.0000000000000000e+00 0.0000000000000000e+00 77 0.0000000000000000e+00 0.0000000000000000e+00 0.0000000000000000e+00 78 0.0000000000000000e+00 0.0000000000000000e+00 0.0000000000000000e+00 79 0.0000000000000000e+00 0.0000000000000000e+00 0.0000000000000000e+00 91 0.0000000000000000e+00 0.0000000000000000e+00 0.0000000000000000e+00 92 0.0000000000000000e+00 0.0000000000000000e+00 0.0000000000000000e+00 93 0.0000000000000000e+00 0.0000000000000000e+00 0.0000000000000000e+00 94 0.0000000000000000e+00 0.0000000000000000e+00 0.0000000000000000e+00 95 0.0000000000000000e+00 0.0000000000000000e+00 0.0000000000000000e+00 96 0.0000000000000000e+00 0.0000000000000000e+00 0.0000000000000000e+00 97 0.0000000000000000e+00 0.0000000000000000e+00 0.0000000000000000e+00 98 0.0000000000000000e+00 0.0000000000000000e+00 0.0000000000000000e+00 99 0.0000000000000000e+00 0.0000000000000000e+00 0.0000000000000000e+00 80 0.0000000000000000e+00 0.0000000000000000e+00 0.0000000000000000e+00 81 0.0000000000000000e+00 0.0000000000000000e+00 0.0000000000000000e+00 82 0.0000000000000000e+00 0.0000000000000000e+00 0.0000000000000000e+00 83 0.0000000000000000e+00 0.0000000000000000e+00 0.0000000000000000e+00 84 0.0000000000000000e+00 0.0000000000000000e+00 0.0000000000000000e+00 85 0.0000000000000000e+00 0.0000000000000000e+00 0.0000000000000000e+00 86 0.0000000000000000e+00 0.0000000000000000e+00 0.0000000000000000e+00 87 0.0000000000000000e+00 0.0000000000000000e+00 0.0000000000000000e+00 88 0.0000000000000000e+00 0.0000000000000000e+00 0.0000000000000000e+00 89 0.0000000000000000e+00 0.0000000000000000e+00 0.0000000000000000e+00 90 0.0000000000000000e+00 0.0000000000000000e+00 0.0000000000000000e+00 100 0.0000000000000000e+00 0.0000000000000000e+00 0.0000000000000000e+00 101 0.0000000000000000e+00 0.0000000000000000e+00 0.0000000000000000e+00 102 0.0000000000000000e+00 0.0000000000000000e+00 0.0000000000000000e+00 103 0.0000000000000000e+00 0.0000000000000000e+00 0.0000000000000000e+00 104 0.0000000000000000e+00 0.0000000000000000e+00 0.0000000000000000e+00 105 0.0000000000000000e+00 0.0000000000000000e+00 0.0000000000000000e+00 106 0.0000000000000000e+00 0.0000000000000000e+00 0.0000000000000000e+00 107 0.0000000000000000e+00 0.0000000000000000e+00 0.0000000000000000e+00 108 0.0000000000000000e+00 0.0000000000000000e+00 0.0000000000000000e+00 109 0.0000000000000000e+00 0.0000000000000000e+00 0.0000000000000000e+00 110 0.0000000000000000e+00 0.0000000000000000e+00 0.0000000000000000e+00 111 0.0000000000000000e+00 0.0000000000000000e+00 0.0000000000000000e+00 112 0.0000000000000000e+00 0.0000000000000000e+00 0.0000000000000000e+00 113 0.0000000000000000e+00 0.0000000000000000e+00 0.0000000000000000e+00 Bonds 1 1 1 2 2 2 1 16 3 2 1 17 4 3 1 114 5 1 2 3 6 2 2 18 7 2 2 19 8 1 3 4 9 2 3 20 10 2 3 21 11 1 4 5 12 2 4 22 13 2 4 23 14 1 5 6 15 2 5 24 16 2 5 25 17 4 6 7 18 2 6 26 19 2 6 27 20 5 7 8 21 6 7 28 22 7 8 9 23 10 115 114 24 10 116 114 25 10 117 114 26 1 41 42 27 2 41 62 28 2 41 63 29 1 42 43 30 2 42 64 31 2 42 65 32 4 43 44 33 2 43 66 34 2 43 67 35 5 44 45 36 6 44 68 37 8 10 8 38 1 10 11 39 2 10 29 40 2 10 30 41 1 11 12 42 2 11 31 43 2 11 32 44 1 12 13 45 2 12 33 46 2 12 34 47 8 13 14 48 2 13 35 49 2 13 36 50 7 14 15 51 5 37 14 52 6 37 55 53 4 38 37 54 1 38 39 55 2 38 56 56 2 38 57 57 1 39 40 58 2 39 58 59 2 39 59 60 1 40 41 61 2 40 60 62 2 40 61 63 7 45 46 64 8 47 45 65 1 47 48 66 2 47 69 67 2 47 70 68 1 48 49 69 2 48 71 70 2 48 72 71 1 49 50 72 2 49 73 73 2 49 74 74 8 50 53 75 2 50 51 76 2 50 52 77 7 53 54 78 5 75 53 79 6 75 91 80 4 76 75 81 1 76 77 82 2 76 92 83 2 76 93 84 1 77 78 85 2 77 94 86 2 77 95 87 1 78 79 88 2 78 96 89 2 78 97 90 1 79 80 91 2 79 98 92 2 79 99 93 1 80 81 94 2 80 100 95 2 80 101 96 4 81 82 97 2 81 102 98 2 81 103 99 5 82 83 100 6 82 104 101 7 83 84 102 8 85 83 103 1 85 86 104 2 85 105 105 2 85 106 106 1 86 87 107 2 86 107 108 2 86 108 109 1 87 88 110 2 87 109 111 2 87 110 112 8 88 89 113 2 88 111 114 2 88 112 115 9 89 90 116 9 89 113 Angles 1 1 2 1 16 2 1 2 1 17 3 2 2 1 114 4 3 16 1 17 5 4 16 1 114 6 4 17 1 114 7 5 1 2 3 8 1 1 2 18 9 1 1 2 19 10 1 3 2 18 11 1 3 2 19 12 3 18 2 19 13 5 2 3 4 14 1 2 3 20 15 1 2 3 21 16 1 4 3 20 17 1 4 3 21 18 3 20 3 21 19 5 3 4 5 20 1 3 4 22 21 1 3 4 23 22 1 5 4 22 23 1 5 4 23 24 3 22 4 23 25 5 4 5 6 26 1 4 5 24 27 1 4 5 25 28 1 6 5 24 29 1 6 5 25 30 3 24 5 25 31 6 5 6 7 32 1 5 6 26 33 1 5 6 27 34 7 7 6 26 35 7 7 6 27 36 3 26 6 27 37 8 6 7 8 38 9 6 7 28 39 10 8 7 28 40 11 7 8 9 41 12 10 8 7 42 13 10 8 9 43 18 1 114 115 44 18 1 114 116 45 18 1 114 117 46 19 115 114 116 47 19 115 114 117 48 19 116 114 117 49 5 40 41 42 50 1 40 41 62 51 1 40 41 63 52 1 42 41 62 53 1 42 41 63 54 3 62 41 63 55 5 41 42 43 56 1 41 42 64 57 1 41 42 65 58 1 43 42 64 59 1 43 42 65 60 3 64 42 65 61 6 42 43 44 62 1 42 43 66 63 1 42 43 67 64 7 44 43 66 65 7 44 43 67 66 3 66 43 67 67 8 43 44 45 68 9 43 44 68 69 10 45 44 68 70 14 11 10 8 71 15 8 10 29 72 15 8 10 30 73 1 11 10 29 74 1 11 10 30 75 3 29 10 30 76 5 10 11 12 77 1 10 11 31 78 1 10 11 32 79 1 12 11 31 80 1 12 11 32 81 3 31 11 32 82 5 11 12 13 83 1 11 12 33 84 1 11 12 34 85 1 13 12 33 86 1 13 12 34 87 3 33 12 34 88 14 12 13 14 89 1 12 13 35 90 1 12 13 36 91 15 14 13 35 92 15 14 13 36 93 3 35 13 36 94 13 13 14 15 95 12 13 14 37 96 11 37 14 15 97 8 38 37 14 98 10 14 37 55 99 9 38 37 55 100 6 39 38 37 101 7 37 38 56 102 7 37 38 57 103 1 39 38 56 104 1 39 38 57 105 3 56 38 57 106 5 38 39 40 107 1 38 39 58 108 1 38 39 59 109 1 40 39 58 110 1 40 39 59 111 3 58 39 59 112 5 39 40 41 113 1 39 40 60 114 1 39 40 61 115 1 41 40 60 116 1 41 40 61 117 3 60 40 61 118 11 44 45 46 119 12 47 45 44 120 13 47 45 46 121 14 48 47 45 122 15 45 47 69 123 15 45 47 70 124 1 48 47 69 125 1 48 47 70 126 3 69 47 70 127 5 47 48 49 128 1 47 48 71 129 1 47 48 72 130 1 49 48 71 131 1 49 48 72 132 3 71 48 72 133 5 48 49 50 134 1 48 49 73 135 1 48 49 74 136 1 50 49 73 137 1 50 49 74 138 3 73 49 74 139 14 49 50 53 140 1 49 50 51 141 1 49 50 52 142 15 53 50 51 143 15 53 50 52 144 3 51 50 52 145 13 50 53 54 146 12 50 53 75 147 11 75 53 54 148 8 76 75 53 149 10 53 75 91 150 9 76 75 91 151 6 77 76 75 152 7 75 76 92 153 7 75 76 93 154 1 77 76 92 155 1 77 76 93 156 3 92 76 93 157 5 76 77 78 158 1 76 77 94 159 1 76 77 95 160 1 78 77 94 161 1 78 77 95 162 3 94 77 95 163 5 77 78 79 164 1 77 78 96 165 1 77 78 97 166 1 79 78 96 167 1 79 78 97 168 3 96 78 97 169 5 78 79 80 170 1 78 79 98 171 1 78 79 99 172 1 80 79 98 173 1 80 79 99 174 3 98 79 99 175 5 79 80 81 176 1 79 80 100 177 1 79 80 101 178 1 81 80 100 179 1 81 80 101 180 3 100 80 101 181 6 80 81 82 182 1 80 81 102 183 1 80 81 103 184 7 82 81 102 185 7 82 81 103 186 3 102 81 103 187 8 81 82 83 188 9 81 82 104 189 10 83 82 104 190 11 82 83 84 191 12 85 83 82 192 13 85 83 84 193 14 86 85 83 194 15 83 85 105 195 15 83 85 106 196 1 86 85 105 197 1 86 85 106 198 3 105 85 106 199 5 85 86 87 200 1 85 86 107 201 1 85 86 108 202 1 87 86 107 203 1 87 86 108 204 3 107 86 108 205 5 86 87 88 206 1 86 87 109 207 1 86 87 110 208 1 88 87 109 209 1 88 87 110 210 3 109 87 110 211 14 87 88 89 212 1 87 88 111 213 1 87 88 112 214 15 89 88 111 215 15 89 88 112 216 3 111 88 112 217 16 88 89 90 218 16 88 89 113 219 17 90 89 113 Dihedrals 1 2 16 1 2 18 2 2 16 1 2 19 3 2 17 1 2 18 4 2 17 1 2 19 5 5 2 1 114 115 6 5 2 1 114 116 7 5 2 1 114 117 8 6 16 1 114 115 9 6 16 1 114 116 10 6 16 1 114 117 11 6 17 1 114 115 12 6 17 1 114 116 13 6 17 1 114 117 14 1 3 2 1 16 15 1 3 2 1 17 16 3 3 2 1 114 17 4 18 2 1 114 18 4 19 2 1 114 19 7 1 2 3 4 20 1 1 2 3 20 21 1 1 2 3 21 22 2 18 2 3 20 23 2 18 2 3 21 24 2 19 2 3 20 25 2 19 2 3 21 26 1 4 3 2 18 27 1 4 3 2 19 28 7 2 3 4 5 29 1 2 3 4 22 30 1 2 3 4 23 31 2 20 3 4 22 32 2 20 3 4 23 33 2 21 3 4 22 34 2 21 3 4 23 35 1 5 4 3 20 36 1 5 4 3 21 37 7 3 4 5 6 38 1 3 4 5 24 39 1 3 4 5 25 40 2 22 4 5 24 41 2 22 4 5 25 42 2 23 4 5 24 43 2 23 4 5 25 44 1 6 5 4 22 45 1 6 5 4 23 46 8 4 5 6 7 47 1 4 5 6 26 48 1 4 5 6 27 49 2 24 5 6 26 50 2 24 5 6 27 51 2 25 5 6 26 52 2 25 5 6 27 53 9 7 6 5 24 54 9 7 6 5 25 55 10 5 6 7 8 56 11 5 6 7 28 57 12 26 6 7 8 58 13 26 6 7 28 59 12 27 6 7 8 60 13 27 6 7 28 61 14 6 7 8 9 62 15 6 7 8 10 63 16 28 7 8 9 64 17 28 7 8 10 65 1 42 41 40 60 66 1 42 41 40 61 67 7 40 41 42 43 68 1 40 41 42 64 69 1 40 41 42 65 70 2 62 41 42 64 71 2 62 41 42 65 72 2 63 41 42 64 73 2 63 41 42 65 74 1 43 42 41 62 75 1 43 42 41 63 76 8 41 42 43 44 77 1 41 42 43 66 78 1 41 42 43 67 79 2 64 42 43 66 80 2 64 42 43 67 81 2 65 42 43 66 82 2 65 42 43 67 83 9 44 43 42 64 84 9 44 43 42 65 85 10 42 43 44 45 86 11 42 43 44 68 87 12 66 43 44 45 88 13 66 43 44 68 89 12 67 43 44 45 90 13 67 43 44 68 91 14 43 44 45 46 92 15 43 44 45 47 93 16 68 44 45 46 94 17 68 44 45 47 95 18 11 10 8 7 96 19 29 10 8 7 97 19 30 10 8 7 98 20 11 10 8 9 99 21 29 10 8 9 100 21 30 10 8 9 101 23 8 10 11 31 102 23 8 10 11 32 103 2 29 10 11 31 104 2 29 10 11 32 105 2 30 10 11 31 106 2 30 10 11 32 107 22 12 11 10 8 108 1 12 11 10 29 109 1 12 11 10 30 110 7 10 11 12 13 111 1 10 11 12 33 112 1 10 11 12 34 113 2 31 11 12 33 114 2 31 11 12 34 115 2 32 11 12 33 116 2 32 11 12 34 117 1 13 12 11 31 118 1 13 12 11 32 119 22 11 12 13 14 120 1 11 12 13 35 121 1 11 12 13 36 122 2 33 12 13 35 123 2 33 12 13 36 124 2 34 12 13 35 125 2 34 12 13 36 126 23 14 13 12 33 127 23 14 13 12 34 128 20 12 13 14 15 129 18 12 13 14 37 130 21 35 13 14 15 131 19 35 13 14 37 132 21 36 13 14 15 133 19 36 13 14 37 134 15 38 37 14 13 135 17 55 37 14 13 136 14 38 37 14 15 137 16 55 37 14 15 138 10 39 38 37 14 139 12 56 38 37 14 140 12 57 38 37 14 141 11 39 38 37 55 142 13 56 38 37 55 143 13 57 38 37 55 144 9 37 38 39 58 145 9 37 38 39 59 146 2 56 38 39 58 147 2 56 38 39 59 148 2 57 38 39 58 149 2 57 38 39 59 150 8 40 39 38 37 151 1 40 39 38 56 152 1 40 39 38 57 153 7 38 39 40 41 154 1 38 39 40 60 155 1 38 39 40 61 156 2 58 39 40 60 157 2 58 39 40 61 158 2 59 39 40 60 159 2 59 39 40 61 160 1 41 40 39 58 161 1 41 40 39 59 162 7 39 40 41 42 163 1 39 40 41 62 164 1 39 40 41 63 165 2 60 40 41 62 166 2 60 40 41 63 167 2 61 40 41 62 168 2 61 40 41 63 169 18 48 47 45 44 170 19 69 47 45 44 171 19 70 47 45 44 172 20 48 47 45 46 173 21 69 47 45 46 174 21 70 47 45 46 175 23 45 47 48 71 176 23 45 47 48 72 177 2 69 47 48 71 178 2 69 47 48 72 179 2 70 47 48 71 180 2 70 47 48 72 181 22 49 48 47 45 182 1 49 48 47 69 183 1 49 48 47 70 184 7 47 48 49 50 185 1 47 48 49 73 186 1 47 48 49 74 187 2 71 48 49 73 188 2 71 48 49 74 189 2 72 48 49 73 190 2 72 48 49 74 191 1 50 49 48 71 192 1 50 49 48 72 193 22 48 49 50 53 194 1 48 49 50 51 195 1 48 49 50 52 196 2 73 49 50 51 197 2 73 49 50 52 198 2 74 49 50 51 199 2 74 49 50 52 200 23 53 50 49 73 201 23 53 50 49 74 202 20 49 50 53 54 203 18 49 50 53 75 204 21 51 50 53 54 205 19 51 50 53 75 206 21 52 50 53 54 207 19 52 50 53 75 208 15 76 75 53 50 209 17 91 75 53 50 210 14 76 75 53 54 211 16 91 75 53 54 212 10 77 76 75 53 213 12 92 76 75 53 214 12 93 76 75 53 215 11 77 76 75 91 216 13 92 76 75 91 217 13 93 76 75 91 218 9 75 76 77 94 219 9 75 76 77 95 220 2 92 76 77 94 221 2 92 76 77 95 222 2 93 76 77 94 223 2 93 76 77 95 224 8 78 77 76 75 225 1 78 77 76 92 226 1 78 77 76 93 227 7 76 77 78 79 228 1 76 77 78 96 229 1 76 77 78 97 230 2 94 77 78 96 231 2 94 77 78 97 232 2 95 77 78 96 233 2 95 77 78 97 234 1 79 78 77 94 235 1 79 78 77 95 236 7 77 78 79 80 237 1 77 78 79 98 238 1 77 78 79 99 239 2 96 78 79 98 240 2 96 78 79 99 241 2 97 78 79 98 242 2 97 78 79 99 243 1 80 79 78 96 244 1 80 79 78 97 245 7 78 79 80 81 246 1 78 79 80 100 247 1 78 79 80 101 248 2 98 79 80 100 249 2 98 79 80 101 250 2 99 79 80 100 251 2 99 79 80 101 252 1 81 80 79 98 253 1 81 80 79 99 254 8 79 80 81 82 255 1 79 80 81 102 256 1 79 80 81 103 257 2 100 80 81 102 258 2 100 80 81 103 259 2 101 80 81 102 260 2 101 80 81 103 261 9 82 81 80 100 262 9 82 81 80 101 263 10 80 81 82 83 264 11 80 81 82 104 265 12 102 81 82 83 266 13 102 81 82 104 267 12 103 81 82 83 268 13 103 81 82 104 269 14 81 82 83 84 270 15 81 82 83 85 271 16 104 82 83 84 272 17 104 82 83 85 273 18 86 85 83 82 274 19 105 85 83 82 275 19 106 85 83 82 276 20 86 85 83 84 277 21 105 85 83 84 278 21 106 85 83 84 279 23 83 85 86 107 280 23 83 85 86 108 281 2 105 85 86 107 282 2 105 85 86 108 283 2 106 85 86 107 284 2 106 85 86 108 285 22 87 86 85 83 286 1 87 86 85 105 287 1 87 86 85 106 288 7 85 86 87 88 289 1 85 86 87 109 290 1 85 86 87 110 291 2 107 86 87 109 292 2 107 86 87 110 293 2 108 86 87 109 294 2 108 86 87 110 295 1 88 87 86 107 296 1 88 87 86 108 297 22 86 87 88 89 298 1 86 87 88 111 299 1 86 87 88 112 300 2 109 87 88 111 301 2 109 87 88 112 302 2 110 87 88 111 303 2 110 87 88 112 304 23 89 88 87 109 305 23 89 88 87 110 306 24 87 88 89 90 307 24 87 88 89 113 308 25 111 88 89 90 309 25 111 88 89 113 310 25 112 88 89 90 311 25 112 88 89 113 Impropers 1 1 8 7 6 28 2 2 10 8 7 9 3 1 45 44 43 68 4 2 13 14 37 15 5 1 14 37 38 55 6 2 47 45 44 46 7 2 50 53 75 54 8 1 53 75 76 91 9 1 83 82 81 104 10 2 85 83 82 84 11 3 88 89 90 113
{ "pile_set_name": "Github" }