text
stringlengths
2
9.78k
meta
dict
# -*- coding: utf-8 -*- """ Version string and parsed tuple. Keeps it all in one place. """ __version__ = '0.3.1' VERSION = tuple(int(x) for x in __version__.split('.'))
{ "pile_set_name": "Github" }
/* * ALSA driver for Xilinx ML403 AC97 Controller Reference * IP: opb_ac97_controller_ref_v1_00_a (EDK 8.1i) * IP: opb_ac97_controller_ref_v1_00_a (EDK 9.1i) * * Copyright (c) by 2007 Joachim Foerster <JOFT@gmx.de> * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation; either version 2 of the License, or * (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA * */ /* Some notes / status of this driver: * * - Don't wonder about some strange implementations of things - especially the * (heavy) shadowing of codec registers, with which I tried to reduce read * accesses to a minimum, because after a variable amount of accesses, the AC97 * controller doesn't raise the register access finished bit anymore ... * * - Playback support seems to be pretty stable - no issues here. * - Capture support "works" now, too. Overruns don't happen any longer so often. * But there might still be some ... */ #include <linux/init.h> #include <linux/module.h> #include <linux/platform_device.h> #include <linux/ioport.h> #include <linux/slab.h> #include <linux/io.h> #include <linux/interrupt.h> /* HZ */ #include <linux/param.h> /* jiffies, time_*() */ #include <linux/jiffies.h> /* schedule_timeout*() */ #include <linux/sched.h> /* spin_lock*() */ #include <linux/spinlock.h> /* struct mutex, mutex_init(), mutex_*lock() */ #include <linux/mutex.h> /* snd_printk(), snd_printd() */ #include <sound/core.h> #include <sound/pcm.h> #include <sound/pcm_params.h> #include <sound/initval.h> #include <sound/ac97_codec.h> #include "pcm-indirect2.h" #define SND_ML403_AC97CR_DRIVER "ml403-ac97cr" MODULE_AUTHOR("Joachim Foerster <JOFT@gmx.de>"); MODULE_DESCRIPTION("Xilinx ML403 AC97 Controller Reference"); MODULE_LICENSE("GPL"); MODULE_SUPPORTED_DEVICE("{{Xilinx,ML403 AC97 Controller Reference}}"); static int index[SNDRV_CARDS] = SNDRV_DEFAULT_IDX; static char *id[SNDRV_CARDS] = SNDRV_DEFAULT_STR; static bool enable[SNDRV_CARDS] = SNDRV_DEFAULT_ENABLE; module_param_array(index, int, NULL, 0444); MODULE_PARM_DESC(index, "Index value for ML403 AC97 Controller Reference."); module_param_array(id, charp, NULL, 0444); MODULE_PARM_DESC(id, "ID string for ML403 AC97 Controller Reference."); module_param_array(enable, bool, NULL, 0444); MODULE_PARM_DESC(enable, "Enable this ML403 AC97 Controller Reference."); /* Special feature options */ /*#define CODEC_WRITE_CHECK_RAF*/ /* don't return after a write to a codec * register, while RAF bit is not set */ /* Debug options for code which may be removed completely in a final version */ #ifdef CONFIG_SND_DEBUG /*#define CODEC_STAT*/ /* turn on some minimal "statistics" * about codec register usage */ #define SND_PCM_INDIRECT2_STAT /* turn on some "statistics" about the * process of copying bytes from the * intermediate buffer to the hardware * fifo and the other way round */ #endif /* Definition of a "level/facility dependent" printk(); may be removed * completely in a final version */ #undef PDEBUG #ifdef CONFIG_SND_DEBUG /* "facilities" for PDEBUG */ #define UNKNOWN (1<<0) #define CODEC_SUCCESS (1<<1) #define CODEC_FAKE (1<<2) #define INIT_INFO (1<<3) #define INIT_FAILURE (1<<4) #define WORK_INFO (1<<5) #define WORK_FAILURE (1<<6) #define PDEBUG_FACILITIES (UNKNOWN | INIT_FAILURE | WORK_FAILURE) #define PDEBUG(fac, fmt, args...) do { \ if (fac & PDEBUG_FACILITIES) \ snd_printd(KERN_DEBUG SND_ML403_AC97CR_DRIVER ": " \ fmt, ##args); \ } while (0) #else #define PDEBUG(fac, fmt, args...) /* nothing */ #endif /* Defines for "waits"/timeouts (portions of HZ=250 on arch/ppc by default) */ #define CODEC_TIMEOUT_ON_INIT 5 /* timeout for checking for codec * readiness (after insmod) */ #ifndef CODEC_WRITE_CHECK_RAF #define CODEC_WAIT_AFTER_WRITE 100 /* general, static wait after a write * access to a codec register, may be * 0 to completely remove wait */ #else #define CODEC_TIMEOUT_AFTER_WRITE 5 /* timeout after a write access to a * codec register, if RAF bit is used */ #endif #define CODEC_TIMEOUT_AFTER_READ 5 /* timeout after a read access to a * codec register (checking RAF bit) */ /* Infrastructure for codec register shadowing */ #define LM4550_REG_OK (1<<0) /* register exists */ #define LM4550_REG_DONEREAD (1<<1) /* read register once, value should be * the same currently in the register */ #define LM4550_REG_NOSAVE (1<<2) /* values written to this register will * not be saved in the register */ #define LM4550_REG_NOSHADOW (1<<3) /* don't do register shadowing, use plain * hardware access */ #define LM4550_REG_READONLY (1<<4) /* register is read only */ #define LM4550_REG_FAKEPROBE (1<<5) /* fake write _and_ read actions during * probe() correctly */ #define LM4550_REG_FAKEREAD (1<<6) /* fake read access, always return * default value */ #define LM4550_REG_ALLFAKE (LM4550_REG_FAKEREAD | LM4550_REG_FAKEPROBE) struct lm4550_reg { u16 value; u16 flag; u16 wmask; u16 def; }; struct lm4550_reg lm4550_regfile[64] = { [AC97_RESET / 2] = {.flag = LM4550_REG_OK \ | LM4550_REG_NOSAVE \ | LM4550_REG_FAKEREAD, .def = 0x0D50}, [AC97_MASTER / 2] = {.flag = LM4550_REG_OK | LM4550_REG_FAKEPROBE, .wmask = 0x9F1F, .def = 0x8000}, [AC97_HEADPHONE / 2] = {.flag = LM4550_REG_OK \ | LM4550_REG_FAKEPROBE, .wmask = 0x9
{ "pile_set_name": "Github" }
// Copyright (c) 2010 The Chromium Authors. All rights reserved. // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. #include "content/browser/geolocation/wifi_data_provider_common_win.h" #include <assert.h> #include <stdint.h> #include "base/strings/utf_string_conversions.h" #include "content/browser/geolocation/wifi_data_provider_common.h" namespace content { bool ConvertToAccessPointData(const NDIS_WLAN_BSSID& data, AccessPointData *access_point_data) { // Currently we get only MAC address, signal strength and SSID. // TODO(steveblock): Work out how to get age, channel and signal-to-noise. DCHECK(access_point_data); access_point_data->mac_address = MacAddressAsString16(data.MacAddress); access_point_data->radio_signal_strength = data.Rssi; // Note that _NDIS_802_11_SSID::Ssid::Ssid is not null-terminated. base::UTF8ToUTF16(reinterpret_cast<const char*>(data.Ssid.Ssid), data.Ssid.SsidLength, &access_point_data->ssid); return true; } int GetDataFromBssIdList(const NDIS_802_11_BSSID_LIST& bss_id_list, int list_size, WifiData::AccessPointDataSet* data) { // Walk through the BSS IDs. int found = 0; const uint8_t* iterator = reinterpret_cast<const uint8_t*>(&bss_id_list.Bssid[0]); const uint8_t* end_of_buffer = reinterpret_cast<const uint8_t*>(&bss_id_list) + list_size; for (int i = 0; i < static_cast<int>(bss_id_list.NumberOfItems); ++i) { const NDIS_WLAN_BSSID *bss_id = reinterpret_cast<const NDIS_WLAN_BSSID*>(iterator); // Check that the length of this BSS ID is reasonable. if (bss_id->Length < sizeof(NDIS_WLAN_BSSID) || iterator + bss_id->Length > end_of_buffer) { break; } AccessPointData access_point_data; if (ConvertToAccessPointData(*bss_id, &access_point_data)) { data->insert(access_point_data); ++found; } // Move to the next BSS ID. iterator += bss_id->Length; } return found; } } // namespace content
{ "pile_set_name": "Github" }
/*************************************************************************** * Copyright (C) 2002~2005 by Yuking * * yuking_net@sohu.com * * * * This program is free software; you can redistribute it and/or modify * * it under the terms of the GNU General Public License as published by * * the Free Software Foundation; either version 2 of the License, or * * (at your option) any later version. * * * * This program is distributed in the hope that it will be useful, * * but WITHOUT ANY WARRANTY; without even the implied warranty of * * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * * GNU General Public License for more details. * * * * You should have received a copy of the GNU General Public License * * along with this program; if not, write to the * * Free Software Foundation, Inc., * * 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA. * ***************************************************************************/ #ifndef _PY_MAP_TABLE_H #define _PY_MAP_TABLE_H typedef struct _ConsonantMap { char strPY[5]; char cMap; } ConsonantMap; typedef struct _SyllabaryMap { char strPY[4]; char cMap; } SyllabaryMap; #endif // kate: indent-mode cstyle; space-indent on; indent-width 0;
{ "pile_set_name": "Github" }
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd"> <!-- NewPage --> <html lang="en"> <head> <!-- Generated by javadoc --> <meta http-equiv="Content-Type" content="text/html; charset=UTF-8"> <title>Uses of Class net.sf.mpxj.common.MPPResourceField14 (MPXJ 8.2.0 API)</title> <link rel="stylesheet" type="text/css" href="../../../../../stylesheet.css" title="Style"> <script type="text/javascript" src="../../../../../script.js"></script> </head> <body> <script type="text/javascript"><!-- try { if (location.href.indexOf('is-external=true') == -1) { parent.document.title="Uses of Class net.sf.mpxj.common.MPPResourceField14 (MPXJ 8.2.0 API)"; } } catch(err) { } //--> </script> <noscript> <div>JavaScript is disabled on your browser.</div> </noscript> <!-- ========= START OF TOP NAVBAR ======= --> <div class="topNav"><a name="navbar.top"> <!-- --> </a> <div class="skipNav"><a href="#skip.navbar.top" title="Skip navigation links">Skip navigation links</a></div> <a name="navbar.top.firstrow"> <!-- --> </a> <ul class="navList" title="Navigation"> <li><a href="../../../../../overview-summary.html">Overview</a></li> <li><a href="../package-summary.html">Package</a></li> <li><a href="../../../../../net/sf/mpxj/common/MPPResourceField14.html" title="class in net.sf.mpxj.common">Class</a></li> <li class="navBarCell1Rev">Use</li> <li><a href="../package-tree.html">Tree</a></li> <li><a href="../../../../../deprecated-list.html">Deprecated</a></li> <li><a href="../../../../../index-all.html">Index</a></li> <li><a href="../../../../../help-doc.html">Help</a></li> </ul> </div> <div class="subNav"> <ul class="navList"> <li>Prev</li> <li>Next</li> </ul> <ul class="navList"> <li><a href="../../../../../index.html?net/sf/mpxj/common/class-use/MPPResourceField14.html" target="_top">Frames</a></li> <li><a href="MPPResourceField14.html" target="_top">No&nbsp;Frames</a></li> </ul> <ul class="navList" id="allclasses_navbar_top"> <li><a href="../../../../../allclasses-noframe.html">All&nbsp;Classes</a></li> </ul> <div> <script type="text/javascript"><!-- allClassesLink = document.getElementById("allclasses_navbar_top"); if(window==top) { allClassesLink.style.display = "block"; } else { allClassesLink.style.display = "none"; } //--> </script> </div> <a name="skip.navbar.top"> <!-- --> </a></div> <!-- ========= END OF TOP NAVBAR ========= --> <div class="header"> <h2 title="Uses of Class net.sf.mpxj.common.MPPResourceField14" class="title">Uses of Class<br>net.sf.mpxj.common.MPPResourceField14</h2> </div> <div class="classUseContainer">No usage of net.sf.mpxj.common.MPPResourceField14</div> <!-- ======= START OF BOTTOM NAVBAR ====== --> <div class="bottomNav"><a name="navbar.bottom"> <!-- --> </a> <div class="skipNav"><a href="#skip.navbar.bottom" title="Skip navigation links">Skip navigation links</a></div> <a name="navbar.bottom.firstrow"> <!-- --> </a> <ul class="navList" title="Navigation"> <li><a href="../../../../../overview-summary.html">Overview</a></li> <li><a href="../package-summary.html">Package</a></li> <li><a href="../../../../../net/sf/mpxj/common/MPPResourceField14.html" title="class in net.sf.mpxj.common">Class</a></li> <li class="navBarCell1Rev">Use</li> <li><a href="../package-tree.html">Tree</a></li> <li><a href="../../../../../deprecated-list.html">Deprecated</a></li> <li><a href="../../../../../index-all.html">Index</a></li> <li><a href="../../../../../help-doc.html">Help</a></li> </ul> </div> <div class="subNav"> <ul class="navList"> <li>Prev</li> <li>Next</li> </ul> <ul class="navList"> <li><a href="../../../../../index.html?net/sf/mpxj/common/class-use/MPPResourceField14.html" target="_top">Frames</a></li> <li><a href="MPPResourceField14.html" target="_top">No&nbsp;Frames</a></li> </ul> <ul class="navList" id="allclasses_navbar_bottom"> <li><a href="../../../../../allclasses-noframe.html">All&nbsp;Classes</a></li> </ul> <div> <script type="text/javascript"><!-- allClassesLink = document.getElementById("allclasses_navbar_bottom"); if(window==top) { allClassesLink.style.display = "block"; } else { allClassesLink.style.display = "none"; } //--> </script> </div> <a name="skip.navbar.bottom"> <!-- --> </a></div> <!-- ======== END OF BOTTOM NAVBAR ======= --> <p class="legalCopy"><small>Copyright &#169; 2000&#x2013;2020 <a href="http://mpxj.org">Packwood Software</a>. All rights reserved.</small></p> </body> </html>
{ "pile_set_name": "Github" }
--- BUNDLE_PATH: vendor BUNDLE_DISABLE_SHARED_GEMS: '1'
{ "pile_set_name": "Github" }
<?xml version="1.0" encoding="UTF-8"?> <!-- * Scilab ( http://www.scilab.org/ ) - This file is part of Scilab * Copyright (C) 2008 - INRIA * Copyright (C) 2012 - 2016 - Scilab Enterprises * * This file is hereby licensed under the terms of the GNU GPL v2.0, * pursuant to article 5.3.4 of the CeCILL v.2.1. * This file was originally licensed under the terms of the CeCILL v2.1, * and continues to be available under such terms. * For more information, see the COPYING file which you should have received * along with this program. * --> <refentry xmlns="http://docbook.org/ns/docbook" xmlns:xlink="http://www.w3.org/1999/xlink" xmlns:svg="http://www.w3.org/2000/svg" xmlns:mml="http://www.w3.org/1998/Math/MathML" xmlns:db="http://docbook.org/ns/docbook" xmlns:scilab="http://www.scilab.org" xml:lang="ja" xml:id="rcond"> <refnamediv> <refname>rcond</refname> <refpurpose>条件数の逆数</refpurpose> </refnamediv> <refsynopsisdiv> <title>呼び出し手順</title> <synopsis>r = rcond(X)</synopsis> </refsynopsisdiv> <refsection> <title>引数</title> <variablelist> <varlistentry> <term>X</term> <listitem> <para>実数または複素数の正方行列</para> </listitem> </varlistentry> <varlistentry> <term>r</term> <listitem> <para>正の実数</para> </listitem> </varlistentry> </variablelist> </refsection> <refsection> <title>説明</title> <para> <literal>rcond(X)</literal> は,1-ノルムにおける <literal>X</literal>の条件の逆数の推定値です. </para> <para> <literal>X</literal>が健全な場合, <literal>rcond(X)</literal> は 1 に近くなります. そうでない場合, <literal>rcond(X)</literal> は 0に近くなります. </para> <para> <note> <literal>rcond</literal>による1-ノルム逆条件数の推定は, <literal>cond</literal>による2-ノルム条件数の計算よりはるかに高速です. トレードオフとして,<literal>rcond</literal> は若干信頼性が低下する可能性があります. </note> </para> <para> Xの1-ノルムを Lapack/DLANGEで計算, そのLU分解をLapack/DGETRFで計算, 最後に条件をLapack/DGECONで推定します. </para> <para> <literal>rcond([])</literal> yields <literal>%inf</literal>. </para> </refsection> <refsection> <title>例</title> <programlisting role="example"><![CDATA[ A = diag([1:10]); rcond(A) A(1,1) = 0.000001; rcond(A) ]]></programlisting> <para>比較ベンチマーク</para> <programlisting role="example"><![CDATA[ A = ones(1000, 1000); timer(); cond(A); timer() timer(); 1/rcond(A); timer() ]]></programlisting> </refsection> <refsection role="see also"> <title>参照</title> <simplelist type="inline"> <member> <link linkend="svd">svd</link> </member> <member> <link linkend="cond">cond</link> </member> <member> <link linkend="inv">inv</link> </member> </simplelist> </refsection> <refsection role="history"> <title>履歴</title> <revhistory> <revision> <revnumber>6.0.2</revnumber> <revdescription> rcond([]) now yields %inf = 1/cond([]) instead of []. </revdescription> </revision> </revhistory> </refsection> </refentry>
{ "pile_set_name": "Github" }
/** * Copyright 2011 Twitter, Inc. * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ package com.twitter.pycascading; import java.io.ObjectInputStream; import java.io.Serializable; import org.python.core.Py; import cascading.flow.FlowProcess; import cascading.operation.Function; import cascading.operation.FunctionCall; import cascading.operation.OperationCall; import cascading.tuple.Fields; import cascading.tuple.TupleEntryCollector; /** * Wrapper for a Cascading Function that calls a Python function. * * @author Gabor Szabo */ @SuppressWarnings("rawtypes") public class CascadingFunctionWrapper extends CascadingRecordProducerWrapper implements Function, Serializable { private static final long serialVersionUID = -3512295576396796360L; public CascadingFunctionWrapper() { super(); } public CascadingFunctionWrapper(Fields fieldDeclaration) { super(fieldDeclaration); } public CascadingFunctionWrapper(int numArgs) { super(numArgs); } public CascadingFunctionWrapper(int numArgs, Fields fieldDeclaration) { super(numArgs, fieldDeclaration); } /** * We need to call setupArgs() from here, otherwise CascadingFunctionWrapper * is not initialized yet if we call it from CascadingBaseOperationWrapper. */ private void readObject(ObjectInputStream stream) { setupArgs(); } @Override public void prepare(FlowProcess flowProcess, OperationCall operationCall) { super.prepare(flowProcess, operationCall); } @Override public void operate(FlowProcess flowProcess, FunctionCall functionCall) { Object inputTuple = convertInput(functionCall.getArguments()); TupleEntryCollector outputCollector = functionCall.getOutputCollector(); callArgs[0] = Py.java2py(inputTuple); if (outputMethod == OutputMethod.COLLECTS) { // The Python function collects the output tuples itself into the output // collector callArgs[1] = Py.java2py(outputCollector); callFunction(); } else { // The Python function yields or returns records Object ret = callFunction(); collectOutput(outputCollector, ret); } } }
{ "pile_set_name": "Github" }
#ifndef AFTERBASE_H_HEADER_INCLUDED #define AFTERBASE_H_HEADER_INCLUDED #define HAVE_AFTERBASE_FLAG 0 # include "../asim_afterbase.h" #define R_OK 04 #endif /* AFTERBASE_H_HEADER_INCLUDED */
{ "pile_set_name": "Github" }
#region License /* * 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. */ #endregion using System.Text.Json; namespace Gremlin.Net.Structure.IO.GraphSON { internal class VertexDeserializer : IGraphSONDeserializer { public dynamic Objectify(JsonElement graphsonObject, GraphSONReader reader) { var id = reader.ToObject(graphsonObject.GetProperty("id")); var label = graphsonObject.TryGetProperty("label", out var labelProperty) ? labelProperty.GetString() : Vertex.DefaultLabel; return new Vertex(id, label); } } }
{ "pile_set_name": "Github" }
/** * $Id$ * Copyright (C) 2008 - 2014 Nils Asmussen * * This program is free software; you can redistribute it and/or * modify it under the terms of the GNU General Public License * as published by the Free Software Foundation; either version 2 * of the License, or (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ #include <sys/common.h> #include <sys/driver.h> #include <sys/io.h> #include <sys/thread.h> #include <mutex> #include <stdlib.h> #include <vector> #include "listener.h" Listener *Listener::_inst; bool Listener::add(int client,ev_type type) { if(type != ev_type::TYPE_CREATED && type != ev_type::TYPE_DESTROYED && type != ev_type::TYPE_ACTIVE) return false; std::lock_guard<std::mutex> guard(_mutex); _list.push_back(WinListener(client,type)); return true; } void Listener::notify(const esc::WinMngEvents::Event *ev) { std::lock_guard<std::mutex> guard(_mutex); for(auto l = _list.begin(); l != _list.end(); ++l) { if(l->type == ev->type) send(l->client,MSG_WIN_EVENT,ev,sizeof(*ev)); } } void Listener::remove(int client,ev_type type) { std::lock_guard<std::mutex> guard(_mutex); for(auto l = _list.begin(); l != _list.end(); ++l) { if(l->client == client && l->type == type) { _list.erase(l); break; } } } void Listener::removeAll(int client) { std::lock_guard<std::mutex> guard(_mutex); while(!_list.empty()) { win_iter it = std::find_if(_list.begin(),_list.end(),[client] (const WinListener &l) { return l.client == client; }); if(it == _list.end()) break; _list.erase(it); } }
{ "pile_set_name": "Github" }
(* absyn.sml the signature *) (* $Log: absyn.sml,v $ Revision 1.51 1997/05/01 12:25:23 jont [Bug #30088] Get rid of MLWorks.Option * Revision 1.50 1996/10/28 17:28:04 andreww * [Bug #1708] * changing syntax of datatype replication. * * Revision 1.49 1996/10/04 17:56:20 andreww * [Bug #1592] * threading location argument to local declaration expression * syntax. * / * * Revision 1.48 1996/10/04 10:55:22 matthew * [Bug #1622] * Adding some locations * * Revision 1.47 1996/09/30 12:37:53 matthew * Removing require of module_id * * Revision 1.46 1996/09/18 11:53:39 andreww * [Bug #1577] * Adding production for datatype replication. * * Revision 1.45 1996/03/29 12:09:29 matthew * Adding WHEREsigxp properly * * Revision 1.44 1996/03/26 16:23:48 matthew * Adding explicit tyvars field to VALdec * * Revision 1.43 1996/01/16 12:21:29 daveb * Added location information to SIGNATUREtopdec. * Revision 1.42 1995/12/27 10:39:13 jont Removing Option in favour of MLWorks.Option Revision 1.41 1995/12/05 12:21:16 jont Add functions to check strdecs and strexps for the location of free imperative type variable errors Revision 1.40 1995/11/22 09:09:04 daveb Changed REQUIREtopdec to take a string instead of a module_id. Revision 1.39 1995/09/05 14:13:26 daveb Added types for different lengths of words, ints and reals. Revision 1.38 1995/08/31 13:13:07 jont Add location info to wild pats for use in redundancy warnings Revision 1.37 1995/01/17 12:51:10 matthew Rationalizing debugger Revision 1.36 1994/09/14 11:41:26 matthew Abstraction of debug information Revision 1.35 1994/02/28 05:52:22 nosa Type function, debugger structure, and structure recording for Modules Debugger. Revision 1.34 1993/12/03 16:36:08 nickh Added location information to COERCEexp. Revision 1.33 1993/11/25 09:31:30 matthew Added fixity annotations to APPexps and APPpats Revision 1.32 1993/09/03 10:20:01 nosa Runtime-instance in VALpats and LAYEREDpats and Compilation-instance in VALexps for polymorphic debugger. Revision 1.31 1993/08/12 14:55:33 daveb Require declarations now take moduleids instead of strings. Revision 1.30 1993/08/06 13:13:28 matthew Added location information to matches Revision 1.29 1993/07/09 11:52:53 nosa structure Option. Revision 1.28 1993/07/02 16:03:13 daveb Added field to some topdecs to indicate when signature matching is required to match an exception against a value specification. Revision 1.27 1993/05/20 11:59:22 matthew Added code for abstractions. Revision 1.26 1993/04/06 11:52:45 matthew Added MLVALUEexp. Just used internally for now. Revision 1.25 1993/03/09 11:17:15 matthew > Removed Datatypes substructure and replaced with Ident substructure and Type and Structure types. Revision 1.24 1993/02/16 17:44:10 matthew Added syntax for dynamic and coerce expressions Revision 1.23 1993/02/08 15:36:41 matthew Removed nameset structure and ref nameset from FunBind (which wasn't used) Revision 1.22 1993/01/25 18:28:40 matthew Changed Interface ref to Str ref in sigexps Revision 1.21 1992/12/17 17:00:23 matthew > Changed int and real scons to carry a location around Revision 1.20 1992/12/08 15:15:30 jont Removed a number of duplicated signatures and structures Revision 1.19 1992/10/14 12:06:39 richard Added location information to the `require' topdec. Revision 1.18 1992/10/09 13:38:55 clive Tynames now have a slot recording their definition point Revision 1.17 1992/09/08 15:14:44 matthew Added locations to some datatypes. Revision 1.16 1992/09/04 08:26:08 richard Installed central error reporting mechanism. Revision 1.15 1992/08/14 11:00:14 matthew Really added the function this time. Revision 1.14 1992/08/04 11:42:57 matthew Added Source_marks_to_tuple function Revision 1.13 1992/08/04 11:42:57 davidt Changed cut down signatures to full versions. Revision 1.12 1992/06/29 10:54:24 clive Added a slot to appexp for debugging type information for function call type Revision 1.11 1992/06/15 09:30:45 clive Added debug info to handlers Revision 1.10 1992/06/11 08:24:31 clive Added some maarks for typechecker error messages Revision 1.9 1992/05/19 15:15:09 clive Added marks for better error reporting Revision 1.8 1992/04/13 15:50:14 clive First version of the profiler Revision 1.7 1992/02/04 11:53:10 jont Removed a couple of irrelevant requires Revision 1.6 1991/11/22 17:08:42 jont Removed opens Revision 1.5 91/11/21 15:57:54 jont Added copyright message Revision 1.4 91/06/27 13:39:59 colin added Interface annotation for signature expressions Revision 1.3 91/06/27 09:04:02 nickh Added REQUIREtopdec of string. Revision 1.2 91/06/19 18:38:00 colin Added a type ref to HANDLEexp for ten15 code generator Revision 1.1 91/06/07 10:55:59 colin Initial revision Copyright 2013 Ravenbrook Limited <http://www.ravenbrook.com/>. 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. 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 THE COPYRIGHT HOLDER OR 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. *) require
{ "pile_set_name": "Github" }
import Config from '@cli-engine/config' import cli from 'cli-ux' import * as path from 'path' import { ICommandInfo } from './command' import deps from './deps' import { IPluginModule, IPluginPJSON } from './plugins/plugin' const debug = require('debug')('cli:hooks') export abstract class Hook<T extends keyof IHooks> { constructor(protected config: Config, protected options: IHooks[T] = {}) {} public abstract run(): Promise<void> } export interface IHooks { init: {} update: {} 'plugins:parse': { module: IPluginModule pjson: IPluginPJSON } prerun: { Command: ICommandInfo argv: string[] } } interface IConstructor<T, O> { new (config: Config, options: O): T } type LegacyHook<T extends keyof IHooks> = (config: Config, options: IHooks[T]) => Promise<void> type HookConstructor<T extends keyof IHooks> = IConstructor<Hook<T>, IHooks[T]> export class Hooks { constructor(private config: Config) {} async run<T extends keyof IHooks>(event: T, options: IHooks[T] = {}): Promise<void> { let scripts = this.config.hooks[event] if (!scripts || !this.config.root) return for (let script of scripts) { script = path.join(this.config.root, script) debug(`%s %s`, event, script) let Hook: HookConstructor<T> | LegacyHook<T> try { Hook = deps.util.undefault(require(script)) } catch (err) { cli.warn(err, { context: `hook:${event} loading ${script}` }) continue } if (this.isLegacyHook(Hook)) { await Hook(this.config, options) } else { const hook = new Hook(this.config, options) await hook.run() } } } private isLegacyHook<T extends keyof IHooks>(Hook: HookConstructor<T> | LegacyHook<T>): Hook is LegacyHook<T> { return !Hook.prototype } }
{ "pile_set_name": "Github" }
options: parameters: author: '' catch_exceptions: 'True' category: '[GRC Hier Blocks]' cmake_opt: '' comment: '' copyright: '' description: '' gen_cmake: 'On' gen_linking: dynamic generate_options: qt_gui hier_block_src_path: '.:' id: test_udp_sink6 max_nouts: '0' output_language: python placement: (0,0) qt_qss_theme: '' realtime_scheduling: '' run: 'True' run_command: '{python} -u {filename}' run_options: prompt sizing_mode: fixed thread_safe_setters: '' title: '' states: bus_sink: false bus_source: false bus_structure: null coordinate: [8, 8] rotation: 0 state: enabled blocks: - name: center_freq id: variable parameters: comment: '' value: 1691e6 states: bus_sink: false bus_source: false bus_structure: null coordinate: [216, 28] rotation: 0 state: enabled - name: samp_rate id: variable parameters: comment: '' value: 1e6 states: bus_sink: false bus_source: false bus_structure: null coordinate: [8, 160] rotation: 0 state: enabled - name: analog_sig_source_x_0 id: analog_sig_source_x parameters: affinity: '' alias: '' amp: '1' comment: '' freq: '1000' maxoutbuf: '0' minoutbuf: '0' offset: '0' phase: '0' samp_rate: samp_rate type: complex waveform: analog.GR_COS_WAVE states: bus_sink: false bus_source: false bus_structure: null coordinate: [144, 268] rotation: 0 state: enabled - name: blocks_throttle_0 id: blocks_throttle parameters: affinity: '' alias: '' comment: '' ignoretag: 'True' maxoutbuf: '0' minoutbuf: '0' samples_per_second: samp_rate type: complex vlen: '1' states: bus_sink: false bus_source: false bus_structure: null coordinate: [424, 300] rotation: 0 state: enabled - name: network_udp_sink_0 id: network_udp_sink parameters: addr: ::1 affinity: '' alias: '' comment: '' header: '0' payloadsize: '1472' port: '2001' send_eof: 'False' type: complex states: bus_sink: false bus_source: false bus_structure: null coordinate: [662, 268] rotation: 0 state: true - name: qtgui_freq_sink_x_0 id: qtgui_freq_sink_x parameters: affinity: '' alias: '' alpha1: '1.0' alpha10: '1.0' alpha2: '1.0' alpha3: '1.0' alpha4: '1.0' alpha5: '1.0' alpha6: '1.0' alpha7: '1.0' alpha8: '1.0' alpha9: '1.0' autoscale: 'False' average: '1.0' axislabels: 'True' bw: samp_rate color1: '"blue"' color10: '"dark blue"' color2: '"red"' color3: '"green"' color4: '"black"' color5: '"cyan"' color6: '"magenta"' color7: '"yellow"' color8: '"dark red"' color9: '"dark green"' comment: '' ctrlpanel: 'False' fc: '0' fftsize: '1024' freqhalf: 'True' grid: 'False' gui_hint: '' label: Relative Gain label1: '' label10: '' label2: '' label3: '' label4: '' label5: '' label6: '' label7: '' label8: '' label9: '' legend: 'True' maxoutbuf: '0' minoutbuf: '0' name: '""' nconnections: '1' showports: 'True' tr_chan: '0' tr_level: '0.0' tr_mode: qtgui.TRIG_MODE_FREE tr_tag: '""' type: complex units: dB update_time: '0.10' width1: '1' width10: '1' width2: '1' width3: '1' width4: '1' width5: '1' width6: '1' width7: '1' width8: '1' width9: '1' wintype: firdes.WIN_BLACKMAN_hARRIS ymax: '10' ymin: '-140' states: bus_sink: false bus_source: false bus_structure: null coordinate: [552, 36] rotation: 0 state: enabled connections: - [analog_sig_source_x_0, '0', blocks_throttle_0, '0'] - [blocks_throttle_0, '0', network_udp_sink_0, '0'] - [blocks_throttle_0, '0', qtgui_freq_sink_x_0, '0'] metadata: file_format: 1
{ "pile_set_name": "Github" }
/* * Renjin : JVM-based interpreter for the R language for the statistical analysis * Copyright © 2010-2019 BeDataDriven Groep B.V. and contributors * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation; either version 2 of the License, or * (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with this program; if not, a copy is available at * https://www.gnu.org/licenses/gpl-2.0.txt */ package org.renjin.primitives; import org.renjin.eval.Context; import org.renjin.eval.EvalException; import org.renjin.invoke.annotations.*; import org.renjin.invoke.reflection.converters.*; import org.renjin.primitives.vector.ConvertingDoubleVector; import org.renjin.primitives.vector.ConvertingStringVector; import org.renjin.repackaged.guava.base.Charsets; import org.renjin.sexp.*; import java.lang.invoke.MethodHandle; import java.util.Arrays; import java.util.function.Predicate; /** * Functions which operate on Vectors */ public class Vectors { @Builtin("length<-") public static Vector setLength(Vector source, int length) { if(length < 0) { throw new EvalException("%d : invalid value", length); } if(source.length() == length) { return source; } // Strange but true... // if source is null, then length(source) <- x is null for all x >= 0 if(source == Null.INSTANCE) { return Null.INSTANCE; } Vector.Builder copy = source.newBuilderWithInitialSize(length); for(int i=0;i!=Math.min(length, source.length());++i) { copy.setFrom(i, source, i); } AtomicVector sourceNames = source.getNames(); if(sourceNames != Null.INSTANCE) { StringVector.Builder newNames = new StringVector.Builder(); for (int i = 0; i < length; i++) { if(i < source.length()) { newNames.add(sourceNames.getElementAsString(i)); } else { newNames.add(""); } } copy.setAttribute(Symbols.NAMES, newNames.build()); } return copy.build(); } @Generic @Builtin public static int length(SEXP exp) { if(exp instanceof S4Object && exp.getAttribute(Symbols.DOT_XDATA) instanceof Environment) { return exp.getAttribute(Symbols.DOT_XDATA).length(); } return exp.length(); } public static StringVector asCharacter(@Current Context context, Vector source) { if(source instanceof StringVector) { return (StringVector) source.setAttributes(AttributeMap.EMPTY); } else if (source.length() > 100 || source.isDeferred()) { return new ConvertingStringVector(source); } else { return convertToStringVector(context, new StringVector.Builder(), source); } } private static StringVector convertToStringVector(Context context, StringVector.Builder builder, Vector source) { if(source instanceof ListVector) { for (int i = 0; i != source.length(); ++i) { SEXP value = ((ListVector) source).getElementAsSEXP(i); if(value instanceof AtomicVector && value.length() == 1) { builder.addFrom((AtomicVector)value, 0); } else { builder.add(Deparse.deparseExp(context, value)); } } } else { for (int i = 0; i != source.length(); ++i) { builder.addFrom(source, i); } } return builder.build(); } @Generic @Builtin("as.logical") @NoAttributes public static LogicalVector asLogical(ExternalPtr ptr) { Object instance = ptr.getInstance(); Class clazz = instance.getClass(); if (BooleanConverter.accept(clazz)) { return BooleanConverter.INSTANCE .convertToR((Boolean) instance); } else if (BooleanArrayConverter.accept(clazz)) { return BooleanArrayConverter.INSTANCE .convertToR((Boolean[]) instance); } else { return new LogicalArrayVector(Logical.NA); } } @Generic @Builtin("as.logical") @NoAttributes public static LogicalVector asLogical(Vector vector) { checkForListThatCannotBeCoercedToAtomicVector(vector, "logical"); return (LogicalVector) convertToAtomicVector(new LogicalArrayVector.Builder(), vector); } @Generic @Builtin("as.logical") @NoAttributes public static LogicalVector asLogical() { return LogicalArrayVector.EMPTY; } @Generic @Builtin("as.logical") @NoAttributes public static LogicalVector asLogical(PairList.Node pairlist) { return asLogical(pairlist.toVector()); } @Generic @Builtin("as.integer") @NoAttributes public static IntVector asInteger(ExternalPtr ptr) { Object instance = ptr.getInstance(); Class clazz = instance.getClass(); if (IntegerConverter.accept(clazz)) { return (IntVector) IntegerConverter.INSTANCE .convertToR((Number) instance); } else if (IntegerArrayConverter.accept(clazz)) { return (IntVector) IntegerArrayConverter.INSTANCE .convertToR((Number[]) instance); } else { return IntVector.valueOf(IntVector.NA); } } @Generic @NoAttributes @Builtin("as.integer") public static IntVector asInteger(Vector source) { checkForListThatCannotBeCoercedToAtomicVector(source, "integer"); return (IntVector) convertToAtomicVector(new IntArrayVector.Builder(), source); } @Generic @NoAttributes @Builtin("as.integer") public static IntVector asInteger() { return IntArrayVector.EMPTY; } @Generic @NoAttributes @Builtin("as.integer") public static IntVector asInteger(PairList.Node pairlist) { return asInteger(pairlist.toVector()); } @Generic @NoAttributes @Builtin("as.double") public static DoubleVector asDouble(ExternalPtr ptr) { Object instance = ptr.getInstance(); Class clazz = instance.getClass(); if (DoubleConverter.accept(clazz)) { return (DoubleVector) DoubleConverter.INSTANCE.convertToR(instance); } else if (DoubleArrayConverter.DOUBLE_ARRAY.accept(clazz)) { return DoubleArrayConverter.DOUBLE_ARRAY.convertToR(instance); } else { return new DoubleArrayVector(DoubleVector.NA); } } @Generic @NoAttributes @Builtin("as.double") public static DoubleVector asDouble(Vector source) { checkForListThatCannotBeCoercedToAtomicVector(source, "double"); if(source instanceof DoubleVector) { return (DoubleVector) source.setAttributes(AttributeMap.EMPTY); } else if(source.isDeferred() || source.length() > 100) { return new ConvertingDoubleVector(source); } else { return (DoubleVector) convertToAtomicVector(new DoubleArrayVector.Builder(), source); } } @Generic @NoAttributes @Builtin("as.double") public
{ "pile_set_name": "Github" }
fileFormatVersion: 2 guid: 74aae26292cbd47db8e70c928b7709a0 timeCreated: 1503311875 licenseType: Pro NativeFormatImporter: mainObjectFileID: 2100000 userData: assetBundleName: assetBundleVariant:
{ "pile_set_name": "Github" }
object WebModule1: TWebModule1 OldCreateOrder = False Actions = < item Name = 'waTime' PathInfo = '/time' OnAction = TimeAction end item Name = 'waDate' PathInfo = '/date' OnAction = DateAction end item Default = True Name = 'waMenu' PathInfo = '/menu' OnAction = MenuAction end item Name = 'waStatus' PathInfo = '/status' OnAction = StatusAction end item Name = 'waTable' PathInfo = '/table' Producer = dsTableProcedure OnAction = TableAction end item Name = 'waRecord' PathInfo = '/record' Producer = dsPageProducer OnAction = RecordAction end> AfterDispatch = WebModuleAfterDispatch Height = 352 Width = 674 object EmployeeConnection: TFDConnection Params.Strings = ( 'ConnectionDef=EMPLOYEE') LoginPrompt = False Left = 50 Top = 24 end object EmployeeTable: TFDQuery IndexFieldNames = 'EMP_NO' Connection = EmployeeConnection SQL.Strings = ( 'SELECT EMP_NO, FIRST_NAME, LAST_NAME, PHONE_EXT, HIRE_DATE, SALA' + 'RY ' 'FROM EMPLOYEE ORDER BY EMP_NO') Left = 50 Top = 72 object EmployeeTableEMP_NO: TSmallintField AutoGenerateValue = arAutoInc FieldName = 'EMP_NO' Origin = 'EMP_NO' ProviderFlags = [pfInUpdate, pfInWhere, pfInKey] end object EmployeeTableFIRST_NAME: TStringField FieldName = 'FIRST_NAME' Origin = 'FIRST_NAME' Required = True Size = 15 end object EmployeeTableLAST_NAME: TStringField FieldName = 'LAST_NAME' Origin = 'LAST_NAME' Required = True end object EmployeeTablePHONE_EXT: TStringField FieldName = 'PHONE_EXT' Origin = 'PHONE_EXT' Size = 4 end object EmployeeTableHIRE_DATE: TSQLTimeStampField AutoGenerateValue = arDefault FieldName = 'HIRE_DATE' Origin = 'HIRE_DATE' end object EmployeeTableSALARY: TBCDField FieldName = 'SALARY' Origin = 'SALARY' Required = True Precision = 18 Size = 2 end end object FDPhysIBDriverLink1: TFDPhysIBDriverLink Left = 160 Top = 24 end object FDGUIxWaitCursor1: TFDGUIxWaitCursor Provider = 'Console' Left = 264 Top = 24 end object pageHead: TPageProducer HTMLDoc.Strings = ( '<HTML><HEAD>' '<TITLE>WebBroker Demo</TITLE>' '</HEAD>' '<BODY>' '<H1>Web Broker Demo</H1>') Left = 408 Top = 16 end object pageFooter: TPageProducer HTMLDoc.Strings = ( '<hr><I>Delphi Academy 2017</I>' '</BODY>' '</HTML>') Left = 408 Top = 72 end object dsTableProcedure: TDataSetTableProducer Columns = < item FieldName = 'EMP_NO' end item FieldName = 'FIRST_NAME' end item FieldName = 'LAST_NAME' end item FieldName = 'PHONE_EXT' end item FieldName = 'HIRE_DATE' end item FieldName = 'SALARY' end> DataSet = EmployeeTable TableAttributes.BgColor = 'White' TableAttributes.Border = 1 TableAttributes.CellSpacing = 0 TableAttributes.CellPadding = 4 OnFormatCell = dsTableProcedureFormatCell Left = 520 Top = 72 end object dsPageProducer: TDataSetPageProducer HTMLDoc.Strings = ( '<H3>Employee: <#LastName></H3>' '<ul>' '<li> Employee ID: <#Emp_No>' '<li> Name: <#First_Name> <#Last_Name>' '<li> Phone: <#Phone_Ext>' '<li> Hired On: <#Hire_Date>' '<li> Salary: <#Salary>' '</ul>') DataSet = EmployeeTable Left = 520 Top = 16 end end
{ "pile_set_name": "Github" }
// Copyright 2014 The Chromium Authors. All rights reserved. // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. #ifndef BASE_METRICS_USER_METRICS_H_ #define BASE_METRICS_USER_METRICS_H_ #include <string> #include "base/base_export.h" #include "base/callback.h" #include "base/metrics/user_metrics_action.h" #include "base/single_thread_task_runner.h" namespace base { // This module provides some helper functions for logging actions tracked by // the user metrics system. // For best practices on deciding when to emit a user action, see // https://chromium.googlesource.com/chromium/src.git/+/HEAD/tools/metrics/actions/README.md // Record that the user performed an action. // This function must be called after the task runner has been set with // SetRecordActionTaskRunner(). // // "Action" here means a user-generated event: // good: "Reload", "CloseTab", and "IMEInvoked" // not good: "SSLDialogShown", "PageLoaded", "DiskFull" // We use this to gather anonymized information about how users are // interacting with the browser. // WARNING: In calls to this function, UserMetricsAction should be followed by a // string literal parameter and not a variable e.g. // RecordAction(UserMetricsAction("my action name")); // This ensures that our processing scripts can associate this action's hash // with its metric name. Therefore, it will be possible to retrieve the metric // name from the hash later on. // // Once a new recorded action is added, run // tools/metrics/actions/extract_actions.py // to add the metric to actions.xml, then update the <owner>s and <description> // sections. Make sure to include the actions.xml file when you upload your code // for review! // // For more complicated situations (like when there are many different // possible actions), see RecordComputedAction(). BASE_EXPORT void RecordAction(const UserMetricsAction& action); // This function has identical input and behavior to RecordAction(), but is // not automatically found by the action-processing scripts. It can be used // when it's a pain to enumerate all possible actions, but if you use this // you need to also update the rules for extracting known actions in // tools/metrics/actions/extract_actions.py. // This function must be called after the task runner has been set with // SetRecordActionTaskRunner(). BASE_EXPORT void RecordComputedAction(const std::string& action); // Called with the action string. using ActionCallback = RepeatingCallback<void(const std::string&)>; // Add/remove action callbacks (see above). // These functions must be called after the task runner has been set with // SetRecordActionTaskRunner(). BASE_EXPORT void AddActionCallback(const ActionCallback& callback); BASE_EXPORT void RemoveActionCallback(const ActionCallback& callback); // Set the task runner on which to record actions. BASE_EXPORT void SetRecordActionTaskRunner( scoped_refptr<SingleThreadTaskRunner> task_runner); } // namespace base #endif // BASE_METRICS_USER_METRICS_H_
{ "pile_set_name": "Github" }
# Copyright 2020 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. # coding: utf-8 """ Kubeflow Pipelines API This file contains REST API specification for Kubeflow Pipelines. The file is autogenerated from the swagger definition. Contact: kubeflow-pipelines@google.com Generated by: https://openapi-generator.tech """ from __future__ import absolute_import import unittest import datetime import kfp_server_api from kfp_server_api.models.api_job import ApiJob # noqa: E501 from kfp_server_api.rest import ApiException class TestApiJob(unittest.TestCase): """ApiJob unit test stubs""" def setUp(self): pass def tearDown(self): pass def make_instance(self, include_optional): """Test ApiJob include_option is a boolean, when False only required params are included, when True both required and optional params are included """ # model = kfp_server_api.models.api_job.ApiJob() # noqa: E501 if include_optional : return ApiJob( id = '0', name = '0', description = '0', pipeline_spec = kfp_server_api.models.api_pipeline_spec.apiPipelineSpec( pipeline_id = '0', pipeline_name = '0', workflow_manifest = '0', pipeline_manifest = '0', parameters = [ kfp_server_api.models.api_parameter.apiParameter( name = '0', value = '0', ) ], ), resource_references = [ kfp_server_api.models.api_resource_reference.apiResourceReference( key = kfp_server_api.models.api_resource_key.apiResourceKey( type = 'UNKNOWN_RESOURCE_TYPE', id = '0', ), name = '0', relationship = 'UNKNOWN_RELATIONSHIP', ) ], service_account = '0', max_concurrency = '0', trigger = kfp_server_api.models.api_trigger.apiTrigger( cron_schedule = kfp_server_api.models.cron_schedule_allow_scheduling_the_job_with_unix_like_cron.CronSchedule allow scheduling the job with unix-like cron( start_time = datetime.datetime.strptime('2013-10-20 19:20:30.00', '%Y-%m-%d %H:%M:%S.%f'), end_time = datetime.datetime.strptime('2013-10-20 19:20:30.00', '%Y-%m-%d %H:%M:%S.%f'), cron = '0', ), periodic_schedule = kfp_server_api.models.periodic_schedule_allow_scheduling_the_job_periodically_with_certain_interval.PeriodicSchedule allow scheduling the job periodically with certain interval( start_time = datetime.datetime.strptime('2013-10-20 19:20:30.00', '%Y-%m-%d %H:%M:%S.%f'), end_time = datetime.datetime.strptime('2013-10-20 19:20:30.00', '%Y-%m-%d %H:%M:%S.%f'), interval_second = '0', ), ), mode = 'UNKNOWN_MODE', created_at = datetime.datetime.strptime('2013-10-20 19:20:30.00', '%Y-%m-%d %H:%M:%S.%f'), updated_at = datetime.datetime.strptime('2013-10-20 19:20:30.00', '%Y-%m-%d %H:%M:%S.%f'), status = '0', error = '0', enabled = True, no_catchup = True ) else : return ApiJob( ) def testApiJob(self): """Test ApiJob""" inst_req_only = self.make_instance(include_optional=False) inst_req_and_optional = self.make_instance(include_optional=True) if __name__ == '__main__': unittest.main()
{ "pile_set_name": "Github" }
/*********************************************************************** * termcap.cpp - Show the used termcap variables * * * * This file is part of the FINAL CUT widget toolkit * * * * Copyright 2017-2020 Markus Gans * * * * FINAL CUT is free software; you can redistribute it and/or modify * * it under the terms of the GNU Lesser General Public License as * * published by the Free Software Foundation; either version 3 of * * the License, or (at your option) any later version. * * * * FINAL CUT is distributed in the hope that it will be useful, but * * WITHOUT ANY WARRANTY; without even the implied warranty of * * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * * GNU Lesser General Public License for more details. * * * * You should have received a copy of the GNU Lesser General Public * * License along with this program. If not, see * * <http://www.gnu.org/licenses/>. * ***********************************************************************/ #include <iomanip> #include <iostream> #include <string> #include <final/final.h> namespace fc = finalcut::fc; // Function prototype void tcapBoolean (const std::string&, bool); void tcapNumeric (const std::string&, int); void tcapString (const std::string&, const char[]); void debug (const finalcut::FApplication&); void booleans(); void numeric(); void string(); //---------------------------------------------------------------------- // struct data //---------------------------------------------------------------------- struct Data { struct alignas(alignof(std::string)) TermcapString { const std::string name; const fc::termcaps cap; }; static TermcapString strings[]; }; //---------------------------------------------------------------------- // struct data - string data array //---------------------------------------------------------------------- Data::TermcapString Data::strings[] = { { "t_bell", fc::t_bell }, { "t_erase_chars", fc::t_erase_chars }, { "t_clear_screen", fc::t_clear_screen }, { "t_clr_eos", fc::t_clr_eos }, { "t_clr_eol", fc::t_clr_eol }, { "t_clr_bol", fc::t_clr_bol }, { "t_cursor_home", fc::t_cursor_home }, { "t_cursor_to_ll", fc::t_cursor_to_ll }, { "t_carriage_return", fc::t_carriage_return }, { "t_tab", fc::t_tab }, { "t_back_tab", fc::t_back_tab }, { "t_insert_padding", fc::t_insert_padding }, { "t_insert_character", fc::t_insert_character }, { "t_parm_ich", fc::t_parm_ich }, { "t_repeat_char", fc::t_repeat_char }, { "t_initialize_color", fc::t_initialize_color }, { "t_initialize_pair", fc::t_initialize_pair }, { "t_set_a_foreground", fc::t_set_a_foreground }, { "t_set_a_background", fc::t_set_a_background }, { "t_set_foreground", fc::t_set_foreground }, { "t_set_background", fc::t_set_background }, { "t_set_color_pair", fc::t_set_color_pair }, { "t_orig_pair", fc::t_orig_pair }, { "t_orig_colors", fc::t_orig_colors }, { "t_no_color_video", fc::t_no_color_video }, { "t_cursor_address", fc::t_cursor_address }, { "t_column_address", fc::t_column_address }, { "t_row_address", fc::t_row_address }, { "t_cursor_visible", fc::t_cursor_visible }, { "t_cursor_invisible", fc::t_cursor_invisible }, { "t_cursor_normal", fc::t_cursor_normal }, { "t_cursor_up", fc::t_cursor_up }, { "t_cursor_down", fc::t_cursor_down }, { "t_cursor_left", fc::t_cursor_left }, { "t_cursor_right", fc::t_cursor_right }, { "t_parm_up_cursor", fc::t_parm_up_cursor }, { "t_parm_down_cursor", fc::t_parm_down_cursor }, { "t_parm_left_cursor", fc::t_parm_left_cursor }, { "t_parm_right_cursor", fc::t_parm_right_cursor }, { "t_save_cursor", fc::t_save_cursor }, { "t_restore_cursor", fc::t_restore_cursor }, { "t_scroll_forward", fc::t_scroll_forward }, { "t_scroll_reverse", fc::t_scroll_reverse }, { "t_enter_ca_mode", fc::t_enter_ca_mode }, { "t_exit_ca_mode", fc::t_exit_ca_mode }, { "t_enable_acs", fc::t_enable_acs }, { "t_enter_bold_mode", fc::t_enter_bold_mode }, { "t_exit_bold_mode", fc::t_exit_bold_mode }, { "t_enter_dim_mode", fc::t_enter_dim_mode }, { "t_exit_dim_mode", fc::t_exit_dim_mode }, { "t_enter_italics_mode", fc::t_enter_italics_mode }, { "t_exit_italics_mode", fc::t_exit_italics_mode }, { "t_enter_underline_mode", fc::t_enter_underline_mode }, { "t_exit_underline_mode", fc::t_exit_underline_mode }, { "t_enter_blink_mode", fc::t_enter_blink_mode }, { "t_exit_blink_mode", fc::t_exit_blink_mode }, { "t_enter_reverse_mode", fc::t_enter_reverse_mode }, { "t_exit_reverse_mode", fc::t_exit_reverse_mode }, { "t_enter_standout_mode", fc::t_enter_standout_mode }, { "t_exit_standout_mode", fc::t_exit_standout_mode }, { "t_enter_secure_mode", fc::t_enter_secure_mode }, { "t_exit_secure_mode", fc::t_exit_secure_mode }, { "t_enter_protected_mode", fc::t_enter_protected_mode }, { "t_exit_protected_mode", fc::t_exit_protected_mode }, { "t_enter_crossed_out_mode", fc::t_enter_crossed_out_mode }, { "t_exit_crossed_out_mode", fc::t_exit_crossed_out_mode }, { "t_enter_dbl_underline_mode", fc::t_enter_dbl_underline_mode }, { "t_exit_dbl_underline_mode", fc::t_exit_dbl_underline_mode }, { "t_set_attributes", fc::t_set_attributes }, { "t_exit_attribute_mode", fc::t_exit_attribute_mode }, { "t_enter_alt_charset_mode", fc::t_enter_alt_charset_mode }, { "t_exit_alt_charset_mode", fc::t_exit_
{ "pile_set_name": "Github" }
#!/usr/bin/env ruby # ###################################################################### # 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. ###################################################################### # require 'English' original_argv = ARGV.dup argv = [] found_include_option = false while (arg = original_argv.shift) if found_include_option $LOAD_PATH.unshift(arg) found_include_option = false else case arg when "-I", "--include" found_include_option = true when /\A-I/, /\A--include=?/ path = $POSTMATCH $LOAD_PATH.unshift(path) unless path.empty? else argv << arg end end end def extract_email_address(address) if /<(.+?)>/ =~ address $1 else address end end def sendmail(to, from, mail, server=nil, port=nil) server ||= "localhost" from = extract_email_address(from) to = to.collect {|address| extract_email_address(address)} Net::SMTP.start(server, port) do |smtp| smtp.open_message_stream(from, to) do |f| f.print(mail) end end end begin require 'svn/commit-mailer' Svn::Locale.set Svn::CommitMailer.run(argv) rescue Exception => error require 'net/smtp' require 'socket' to = [] subject = "Error" from = "#{ENV['USER']}@#{Socket.gethostname}" server = nil port = nil begin begin Svn::CommitMailer rescue NameError raise OptionParser::ParseError end _, _, _to, options = Svn::CommitMailer.parse(argv) to = [_to] to = options.error_to unless options.error_to.empty? from = options.from || from subject = "#{options.name}: #{subject}" if options.name server = options.server port = options.port rescue OptionParser::MissingArgument argv.delete_if {|arg| $!.args.include?(arg)} retry rescue OptionParser::ParseError if to.empty? _, _, _to, *_ = ARGV.reject {|arg| /^-/.match(arg)} to = [_to] end end detail = <<-EOM #{error.class}: #{error.message} #{error.backtrace.join("\n")} EOM to = to.compact if to.empty? STDERR.puts detail else sendmail(to, from, <<-MAIL, server, port) MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit From: #{from} To: #{to.join(', ')} Subject: #{subject} Date: #{Time.now.rfc2822} #{detail} MAIL end end
{ "pile_set_name": "Github" }
start : right right right right right right right right right right right done
{ "pile_set_name": "Github" }
/* Ion.RangeSlider, Flat UI Skin // css version 1.8.5 // by Denis Ineshin | ionden.com // ===================================================================================================================*/ /* ===================================================================================================================== // Skin details */ .irs-line-mid, .irs-line-left, .irs-line-right, .irs-diapason, .irs-slider { background: url(img/sprite-skin-flat.png) repeat-x; } .irs { height: 40px; } .irs-with-grid { height: 60px; } .irs-line { height: 12px; top: 25px; } .irs-line-left { height: 12px; background-position: 0 -30px; } .irs-line-mid { height: 12px; background-position: 0 0; } .irs-line-right { height: 12px; background-position: 100% -30px; } .irs-diapason { height: 12px; top: 25px; background-position: 0 -60px; } .irs-slider { width: 16px; height: 18px; top: 22px; background-position: 0 -90px; } #irs-active-slider, .irs-slider:hover { background-position: 0 -120px; } .irs-min, .irs-max { color: #999; font-size: 10px; line-height: 1.333; text-shadow: none; top: 0; padding: 1px 3px; background: #e1e4e9; border-radius: 4px; } .irs-from, .irs-to, .irs-single { color: #fff; font-size: 10px; line-height: 1.333; text-shadow: none; padding: 1px 5px; background: #ed5565; border-radius: 4px; } .irs-from:after, .irs-to:after, .irs-single:after { position: absolute; display: block; content: ""; bottom: -6px; left: 50%; width: 0; height: 0; margin-left: -3px; overflow: hidden; border: 3px solid transparent; border-top-color: #ed5565; } .irs-grid-pol { background: #e1e4e9; } .irs-grid-text { color: #999; } .irs-disabled { }
{ "pile_set_name": "Github" }
package types // Seccomp represents the config for a seccomp profile for syscall restriction. type Seccomp struct { DefaultAction Action `json:"defaultAction"` // Architectures is kept to maintain backward compatibility with the old // seccomp profile. Architectures []Arch `json:"architectures,omitempty"` ArchMap []Architecture `json:"archMap,omitempty"` Syscalls []*Syscall `json:"syscalls"` } // Architecture is used to represent a specific architecture // and its sub-architectures type Architecture struct { Arch Arch `json:"architecture"` SubArches []Arch `json:"subArchitectures"` } // Arch used for architectures type Arch string // Additional architectures permitted to be used for system calls // By default only the native architecture of the kernel is permitted const ( ArchX86 Arch = "SCMP_ARCH_X86" ArchX86_64 Arch = "SCMP_ARCH_X86_64" ArchX32 Arch = "SCMP_ARCH_X32" ArchARM Arch = "SCMP_ARCH_ARM" ArchAARCH64 Arch = "SCMP_ARCH_AARCH64" ArchMIPS Arch = "SCMP_ARCH_MIPS" ArchMIPS64 Arch = "SCMP_ARCH_MIPS64" ArchMIPS64N32 Arch = "SCMP_ARCH_MIPS64N32" ArchMIPSEL Arch = "SCMP_ARCH_MIPSEL" ArchMIPSEL64 Arch = "SCMP_ARCH_MIPSEL64" ArchMIPSEL64N32 Arch = "SCMP_ARCH_MIPSEL64N32" ArchPPC Arch = "SCMP_ARCH_PPC" ArchPPC64 Arch = "SCMP_ARCH_PPC64" ArchPPC64LE Arch = "SCMP_ARCH_PPC64LE" ArchS390 Arch = "SCMP_ARCH_S390" ArchS390X Arch = "SCMP_ARCH_S390X" ) // Action taken upon Seccomp rule match type Action string // Define actions for Seccomp rules const ( ActKill Action = "SCMP_ACT_KILL" ActTrap Action = "SCMP_ACT_TRAP" ActErrno Action = "SCMP_ACT_ERRNO" ActTrace Action = "SCMP_ACT_TRACE" ActAllow Action = "SCMP_ACT_ALLOW" ) // Operator used to match syscall arguments in Seccomp type Operator string // Define operators for syscall arguments in Seccomp const ( OpNotEqual Operator = "SCMP_CMP_NE" OpLessThan Operator = "SCMP_CMP_LT" OpLessEqual Operator = "SCMP_CMP_LE" OpEqualTo Operator = "SCMP_CMP_EQ" OpGreaterEqual Operator = "SCMP_CMP_GE" OpGreaterThan Operator = "SCMP_CMP_GT" OpMaskedEqual Operator = "SCMP_CMP_MASKED_EQ" ) // Arg used for matching specific syscall arguments in Seccomp type Arg struct { Index uint `json:"index"` Value uint64 `json:"value"` ValueTwo uint64 `json:"valueTwo"` Op Operator `json:"op"` } // Filter is used to conditionally apply Seccomp rules type Filter struct { Caps []string `json:"caps,omitempty"` Arches []string `json:"arches,omitempty"` } // Syscall is used to match a group of syscalls in Seccomp type Syscall struct { Name string `json:"name,omitempty"` Names []string `json:"names,omitempty"` Action Action `json:"action"` Args []*Arg `json:"args"` Comment string `json:"comment"` Includes Filter `json:"includes"` Excludes Filter `json:"excludes"` }
{ "pile_set_name": "Github" }
/some $pattern \$pattern test [^ g r o # u p $pattern \$pattern ] \Qquoted $pattern \$pattern # comment tab\E \# not comment blah/; / some $pattern test \$pattern [^ g r o # u p $pattern \$pattern ] [some $pattern \$pattern [:alpha:] blah] [some [[:alpha:]] blah] [some [:^alpha:] blah] [some [[:^alpha:]] blah] \Qquoted $pattern \$pattern # comment tab\E # some comment \# not comment blah /x;
{ "pile_set_name": "Github" }
Aaron Aron Ron Ronnie Ronny Abel Abe Abie Abner Ab Abbie Abraham Abe Abie Bram Adam Ad Addie Addy Ade Adrian Ade Alan Allan Allen Al Albert Al Bert Bertie Alexander Al Alex Alec Aleck Lex Sandy Sander Alfred Al Alf Alfie Fred Freddie Freddy Algernon Algie Algy Alger Alonso Alonzo Al Lon Lonnie Lonny Alvin Alwin Alwyn Al Vin Vinny Win Andrew Andy Drew Andre Andres Andreas Andy Anthony Antony Anton Tony Archibald Arch Archie Baldie Arnold Arnie Arthur Art Artie Augustus August Augustine Augie Gus Gussy Gust Gustus Austin Austen Baldwin Baldie Win Barrett Barry Barrie Bartholomew Bart Barty Bartlett Bartley Bat Batty Basil Baz Basie Benedict Ben Bennie Benny Benjamin Ben Bennie Benny Benjy Benjie Bennet Bennett Ben Bennie Benny Bernard Barnard Bernie Berney Barney Barnie Bert Albert Bertram Herbert Hubert Robert Blake Bradford Brad Ford Bradley Brad Brandon Branden Brandy Brenton Brent Bret Brett Brian Bryan Bryant Bruce Bruno Burton Burt Byron Ron Ronnie Ronny Caleb Cal Calvin Cal Vin Vinny Cameron Cam Ron Ronny Carl Karl Carlos Carey Cary Carry Casey Kasey Caspar Casper Cas Cass Cassius Cas Cass Cecil Cis Cedric Ced Rick Ricky Charles Charlie Charley Chuck Chas Chester Chet Christopher Kristopher Kristofer Chris Kris Cris Christy Kit Kester Kristof Toph Topher Christian Chris Christy Kit Clarence Clare Clair Clark Claude Claud Clayton Clay Clement Clem Clifford Cliff Ford Clinton Clint Clyde Craig Curtis Kurtis Curt Kurt Cyrus Cy Dale Daniel Dan Danny Darrell Darrel Darryl Daryl David Dave Davie Davy Dean Deane Dennis Denis Den Denny Derek Derrick Derry Rick Ricky Dexter Dex Dominic Dominick Dom Nick Donald Don Donnie Donny Douglas Doug Duane Dwayne Dustin Dusty Dwight Earl Earle Edgar Ed Eddie Eddy Ned Edward Ed Eddie Eddy Ned Ted Teddy Edwin Ed Eddie Eddy Ned Elbert Bert Bertie Elijah Eli Lige Elliot Elliott El Elmer El Elvin Elwin Elwyn El Vin Win Elwood El Woody Emery Emmery Emory Em Emil Emile Em Emmanuel Emanuel Immanuel Manuel Manny Mannie Eric Erik Erick Rick Ricky Ernest Earnest Ernie Ervin Erwin Irvin Irvine Irving Irwin Erv Vin Win Ethan Eugene Gene Everett Everette Fabian Fabe Fab Felix Ferdinand Ferdie Fred Freddie Fernando Ferdie Fern Floyd Floy Lloyd Francis Frank Frankie Franky Fran Francisco Frank Frankie Franky Fran Franklin Franklyn Frank Frankie Franky Frederick Frederic Fredrick Fredric Fred Freddie Freddy Rick Ricky Fred Freddie Alfred Frederick Winfred Gabriel Gabe Gabby Garrett Garret Gary Garry Geoffrey Jeffrey Jeff George Georgie Geordie Gerald Gerard Gerry Jerry Gilbert Gil Bert Glenn Glen Graham Grant Gregory Gregor Greg Gregg Griffith Griffin Griff Harold Hal Harry Harvey Harve Henry Harry Hank Herbert Herb Bert Bertie Herman Manny Mannie Howard Howie Hubert Hugh Bert Bertie Hugh Hughie Hugo Ian Immanuel Manny Mannie Emmanuel Irvin Irvine Irving Irwin Ervin Isaac Isaak Ike Isidore Isidor Isadore Isador Izzy Jack Jackie Jacky Jacob Jake James Jim Jimmy Jimmie Jamie Jem Jason Jay Jasper Jay Jeffrey Jeffery Geoffrey Jeff Jeremy Jeremiah Jerry Jerome Jerry Jesse Jess Jessie Jessy John Jack Jackie Jacky Johnny Jonathan Jon Jonny Joseph Joe Joey Jo Jos Joshua Josh Julian Julius Jule Jules Justin Karl Carl Keith Kelly Kelley Kelvin Kel Kelly Kenneth Ken Kenny Kevin Kev Kristopher Kris Kit Kester Christopher Lancelot Launcelot Lance Laurence Lawrence Lorence Lorenzo Lauren Loren Larry Lars Laurie Lawrie Lee Leigh Leo Leon Lee Leonard Leo Len Lenny Lennie Leopold Leo Poldie Leroy Lee Roy Leslie Lesley Les Lester Les Lewis Lew Lewie Lincoln Lin Linc Lynn Lloyd Loyd Loyde Floyd Loy Floy Louis Luis Lou Louie Luke Lucas Lynn Malcolm Mal Malc Mac Manuel Manny Mannie Emmanuel Mark Marc Marcus Markus Martin Mart Marty Marvin Mervin Marv Merv Matthew Matt Mat Matty Mattie Maximilian Max Melvin Mel Michael Mike Mickey Milton Milt Mitchell Mitch Morris Maurice Morry Mortimer Mort Morty Moses Mo Mose Moss Nathan Nathaniel Nat Nate Neal Neil Nicholas Nicolas Nick Nicky Norman Norm Oliver Ollie Noll Nollie Nolly Oscar Ossy Oswald Ossy Ozzie Ozzy Patrick Pat Patty Paddy Patsy Paul Pauly Peter Pete Phillip Philip Phil Pip Ralph Rafe Randall Randal Rand Randy Randolph Rand Randy Dolph Raphael Rafael Raff Rafe Raymond Raymund Ray Reginald Reg Reggie Rex Reuben Ruben Rube Ruby Reynold Ray Richard Dick Rick Ricky Rich Richie Rick Ricky Cedric Derek Eric Frederick Richard Roderic Robert Bob Bobbie Bobby Dob Rob Robbie Robby Robin Bert Roderic Roderick Rod Roddy Rick Ricky Rodney Rod Roger Rodger Rodge Roland Rolly Roly Ronald Ron Ronnie Ronny Ron Ronnie Aaron Byron Cameron Ronald Roscoe Ross Rudolph Rudolf Rudy Rolf Dolph Dolf Russell Russel Russ Ryan Samson Sampson Sam Sammy Samuel Sam Sammy Scott Scotty Sean Sebastian Seb Bass Sidney Sydney Sid Syd Silvester Sylvester Syl Vester Simon Solomon Sol Solly Sal Stanley Stan Stephen Steven Steve Stevie Stuart Stewart Stu Stew Terrence Terence Terrance Terry Theodore Ted Teddy Theo Timothy Tim Timmy Thomas Tom Tommy Todd Tracy Tracey Travis Troy Tyler Ty Valentine Val Victor Vic Vick Vincent Vince Vin Vinny Virgil Vergil Virge Vernon Vern Wallace Wally Walter Walt Wally Warren Wayne Wesley Wes William Bill Billy Billie Will Willie Willy Winfred Win Winnie Winny Fred Freddie Freddy Winston Win Winnie Winny Woodrow Wood Woody Zachariah Zacharias Zachary Zack Zacky Zach
{ "pile_set_name": "Github" }
#import "Braintree-Version.h" SpecBegin(BTVersion) it(@"returns the current version", ^{ expect(BRAINTREE_VERSION).to.match(@"\\d+\\.\\d+\\.\\d+"); }); SpecEnd
{ "pile_set_name": "Github" }
package main import ( "bufio" "log" "os" ) func main() { // Create a new string s s := "Hello, World" // Create a new buffered writer to write to os.Stdout w := bufio.NewWriter(os.Stdout) // Use w.WriteByte to write a single byte into w's buffer // // WriteByte writes a single byte. if err := w.WriteByte([]byte(s)[0]); err != nil { log.Fatalln(err) } // Flush w to actually write w's contents to os.Stdout if err := w.Flush(); err != nil { log.Fatalln(err) } }
{ "pile_set_name": "Github" }
{# Ivan Tcholakov <ivantcholakov@gmail.com>, 2014-2016 The MIT License, http://opensource.org/licenses/MIT #} <h4>PHP Implementation Tests</h4> <table class="ui compact celled table" style="table-layout: fixed; word-wrap: break-word;"> <tbody> <tr> <td style="width: 50%;"><pre><code>$my_random_boolean = Random::boolean() ? 1 : 0;</code></pre></td> <td>{{ my_random_boolean }}</td> </tr> <tr> <td><pre><code>$result_true = 0; $result_false = 0; for ($i = 1; $i <= 100; $i++) { if (Random::boolean()) { $result_true++; } else { $result_false++; } } </code></pre></td> <td>{{ 'result_true: ' ~ result_true ~ '; result_false: ' ~ result_false }}</td> </tr> <tr> <td><pre><code>$my_random_bytes = bin2hex(Random::bytes(10));</code></pre></td> <td>{{ my_random_bytes }}</td> </tr> <tr> <td><pre><code>$my_random_float = Random::float();</code></pre></td> <td>{{ my_random_float }}</td> </tr> <tr> <td><pre><code>$my_random_integer = Random::int(0, PHP_INT_MAX);</code></pre></td> <td>{{ my_random_integer }}</td> </tr> <tr> <td><pre><code>$my_random_integer_2 = Random::int(1, 100);</code></pre></td> <td>{{ my_random_integer_2 }}</td> </tr> <tr> <td><pre><code>$my_random_string = Random::string(20);</code></pre></td> <td>{{ my_random_string }}</td> </tr> <tr> <td><pre><code>$my_random_string_2 = Random::string(20, "!\"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\\]^_`abcdefghijklmnopqrstuvwxyz{|}~");</code></pre></td> <td>{{ my_random_string_2 }}</td> </tr> </tbody> </table>
{ "pile_set_name": "Github" }
cmd_Release/obj.target/profiler/src/profiler.o := c++ '-D_DARWIN_USE_64_BIT_INODE=1' '-D_LARGEFILE_SOURCE' '-D_FILE_OFFSET_BITS=64' '-DBUILDING_NODE_EXTENSION' -I/Users/wavded/.node-gyp/0.10.24/src -I/Users/wavded/.node-gyp/0.10.24/deps/uv/include -I/Users/wavded/.node-gyp/0.10.24/deps/v8/include -Os -gdwarf-2 -mmacosx-version-min=10.5 -arch x86_64 -Wall -Wendif-labels -W -Wno-unused-parameter -fno-rtti -fno-exceptions -fno-threadsafe-statics -fno-strict-aliasing -MMD -MF ./Release/.deps/Release/obj.target/profiler/src/profiler.o.d.raw -c -o Release/obj.target/profiler/src/profiler.o ../src/profiler.cc Release/obj.target/profiler/src/profiler.o: ../src/profiler.cc \ ../src/heap_profiler.h \ /Users/wavded/.node-gyp/0.10.24/deps/v8/include/v8-profiler.h \ /Users/wavded/.node-gyp/0.10.24/deps/v8/include/v8.h \ /Users/wavded/.node-gyp/0.10.24/deps/v8/include/v8stdint.h \ /Users/wavded/.node-gyp/0.10.24/src/node.h \ /Users/wavded/.node-gyp/0.10.24/deps/uv/include/uv.h \ /Users/wavded/.node-gyp/0.10.24/deps/uv/include/uv-private/uv-unix.h \ /Users/wavded/.node-gyp/0.10.24/deps/uv/include/uv-private/ngx-queue.h \ /Users/wavded/.node-gyp/0.10.24/deps/uv/include/uv-private/uv-darwin.h \ /Users/wavded/.node-gyp/0.10.24/src/node_object_wrap.h \ ../src/cpu_profiler.h ../src/profiler.cc: ../src/heap_profiler.h: /Users/wavded/.node-gyp/0.10.24/deps/v8/include/v8-profiler.h: /Users/wavded/.node-gyp/0.10.24/deps/v8/include/v8.h: /Users/wavded/.node-gyp/0.10.24/deps/v8/include/v8stdint.h: /Users/wavded/.node-gyp/0.10.24/src/node.h: /Users/wavded/.node-gyp/0.10.24/deps/uv/include/uv.h: /Users/wavded/.node-gyp/0.10.24/deps/uv/include/uv-private/uv-unix.h: /Users/wavded/.node-gyp/0.10.24/deps/uv/include/uv-private/ngx-queue.h: /Users/wavded/.node-gyp/0.10.24/deps/uv/include/uv-private/uv-darwin.h: /Users/wavded/.node-gyp/0.10.24/src/node_object_wrap.h: ../src/cpu_profiler.h:
{ "pile_set_name": "Github" }
/* * Copyright 2020 Precog Data * * 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 quasar.api.resource import slamdata.Predef.String import scalaz.{Order, Show} import scalaz.std.string._ final case class ResourceName(value: String) extends scala.AnyVal object ResourceName extends ResourceNameInstances sealed abstract class ResourceNameInstances { implicit val order: Order[ResourceName] = Order.orderBy(_.value) implicit val show: Show[ResourceName] = Show.shows(_.value) }
{ "pile_set_name": "Github" }
// Copyright (C) 2003-2009 by Object Mentor, Inc. All rights reserved. // Released under the terms of the CPL Common Public License version 1.0. package fitnesse.slim; import static org.junit.Assert.assertEquals; import org.junit.Before; import org.junit.Test; import fitnesse.slim.test.TestSlim; import fitnesse.slim.test.Zork; public class SlimMethodInvocationTest extends SlimMethodInvocationTestBase { @Override protected String getTestClassName() { return "fitnesse.slim.test.TestSlim"; } @Before @Override public void setUp() throws Exception { caller = new StatementExecutor(); caller.create("testSlim", getTestClassName(), new Object[0]); testSlim = (TestSlim) caller.getInstance("testSlim"); } @Test public void passAndReturnOneZorkWithPropertyEditor() throws Exception { Object retval = caller.call("testSlim", "oneZork", "zork_42"); assertEquals(new Zork(42), testSlim.getZork()); assertEquals("zork_42", retval); } }
{ "pile_set_name": "Github" }
/* * Copyright 2010 Google Inc. * * Licensed under the Apache License, Version 2.0 (the "License"); you may not * use this file except in compliance with the License. You may obtain a copy of * the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the * License for the specific language governing permissions and limitations under * the License. */ package java.io; /** * A character encoding is not supported - <a * href="http://java.sun.com/javase/6/docs/api/java/io/UnsupportedEncodingException.html">[Sun's * docs]</a>. */ public class UnsupportedEncodingException extends IOException { public UnsupportedEncodingException() { } public UnsupportedEncodingException(String msg) { super(msg); } }
{ "pile_set_name": "Github" }
// // ControlProperty+Driver.swift // RxCocoa // // Created by Krunoslav Zaher on 9/19/15. // Copyright © 2015 Krunoslav Zaher. All rights reserved. // import RxSwift extension ControlProperty { /// Converts `ControlProperty` to `Driver` trait. /// /// `ControlProperty` already can't fail, so no special case needs to be handled. public func asDriver() -> Driver<E> { return self.asDriver { _ -> Driver<E> in #if DEBUG rxFatalError("Somehow driver received error from a source that shouldn't fail.") #else return Driver.empty() #endif } } }
{ "pile_set_name": "Github" }
package(default_visibility = ["//visibility:public"]) load( "@io_bazel_rules_go//go:def.bzl", "go_library", ) go_library( name = "go_default_library", srcs = [ "well_known_annotations.go", "well_known_annotations_windows.go", "well_known_labels.go", ], importpath = "k8s.io/kubernetes/pkg/kubelet/apis", deps = [ "//staging/src/k8s.io/api/core/v1:go_default_library", "//staging/src/k8s.io/apimachinery/pkg/util/sets:go_default_library", ] + select({ "@io_bazel_rules_go//go/platform:windows": [ "//pkg/features:go_default_library", "//staging/src/k8s.io/apiserver/pkg/util/feature:go_default_library", ], "//conditions:default": [], }), ) filegroup( name = "package-srcs", srcs = glob(["**"]), tags = ["automanaged"], visibility = ["//visibility:private"], ) filegroup( name = "all-srcs", srcs = [ ":package-srcs", "//pkg/kubelet/apis/config:all-srcs", "//pkg/kubelet/apis/podresources:all-srcs", "//pkg/kubelet/apis/resourcemetrics/v1alpha1:all-srcs", "//pkg/kubelet/apis/stats/v1alpha1:all-srcs", ], tags = ["automanaged"], )
{ "pile_set_name": "Github" }
leveldb File format =================== <beginning_of_file> [data block 1] [data block 2] ... [data block N] [meta block 1] ... [meta block K] [metaindex block] [index block] [Footer] (fixed size; starts at file_size - sizeof(Footer)) <end_of_file> The file contains internal pointers. Each such pointer is called a BlockHandle and contains the following information: offset: varint64 size: varint64 See [varints](https://developers.google.com/protocol-buffers/docs/encoding#varints) for an explanation of varint64 format. 1. The sequence of key/value pairs in the file are stored in sorted order and partitioned into a sequence of data blocks. These blocks come one after another at the beginning of the file. Each data block is formatted according to the code in `block_builder.cc`, and then optionally compressed. 2. After the data blocks we store a bunch of meta blocks. The supported meta block types are described below. More meta block types may be added in the future. Each meta block is again formatted using `block_builder.cc` and then optionally compressed. 3. A "metaindex" block. It contains one entry for every other meta block where the key is the name of the meta block and the value is a BlockHandle pointing to that meta block. 4. An "index" block. This block contains one entry per data block, where the key is a string >= last key in that data block and before the first key in the successive data block. The value is the BlockHandle for the data block. 5. At the very end of the file is a fixed length footer that contains the BlockHandle of the metaindex and index blocks as well as a magic number. metaindex_handle: char[p]; // Block handle for metaindex index_handle: char[q]; // Block handle for index padding: char[40-p-q];// zeroed bytes to make fixed length // (40==2*BlockHandle::kMaxEncodedLength) magic: fixed64; // == 0xdb4775248b80fb57 (little-endian) ## "filter" Meta Block If a `FilterPolicy` was specified when the database was opened, a filter block is stored in each table. The "metaindex" block contains an entry that maps from `filter.<N>` to the BlockHandle for the filter block where `<N>` is the string returned by the filter policy's `Name()` method. The filter block stores a sequence of filters, where filter i contains the output of `FilterPolicy::CreateFilter()` on all keys that are stored in a block whose file offset falls within the range [ i*base ... (i+1)*base-1 ] Currently, "base" is 2KB. So for example, if blocks X and Y start in the range `[ 0KB .. 2KB-1 ]`, all of the keys in X and Y will be converted to a filter by calling `FilterPolicy::CreateFilter()`, and the resulting filter will be stored as the first filter in the filter block. The filter block is formatted as follows: [filter 0] [filter 1] [filter 2] ... [filter N-1] [offset of filter 0] : 4 bytes [offset of filter 1] : 4 bytes [offset of filter 2] : 4 bytes ... [offset of filter N-1] : 4 bytes [offset of beginning of offset array] : 4 bytes lg(base) : 1 byte The offset array at the end of the filter block allows efficient mapping from a data block offset to the corresponding filter. ## "stats" Meta Block This meta block contains a bunch of stats. The key is the name of the statistic. The value contains the statistic. TODO(postrelease): record following stats. data size index size key size (uncompressed) value size (uncompressed) number of entries number of data blocks
{ "pile_set_name": "Github" }
'''OpenGL extension EXT.shader_implicit_conversions This module customises the behaviour of the OpenGL.raw.GLES2.EXT.shader_implicit_conversions to provide a more Python-friendly API Overview (from the spec) This extension provides support for implicitly converting signed integer types to unsigned types, as well as more general implicit conversion and function overloading infrastructure to support new data types introduced by other extensions. The official definition of this extension is available here: http://www.opengl.org/registry/specs/EXT/shader_implicit_conversions.txt ''' from OpenGL import platform, constant, arrays from OpenGL import extensions, wrapper import ctypes from OpenGL.raw.GLES2 import _types, _glgets from OpenGL.raw.GLES2.EXT.shader_implicit_conversions import * from OpenGL.raw.GLES2.EXT.shader_implicit_conversions import _EXTENSION_NAME def glInitShaderImplicitConversionsEXT(): '''Return boolean indicating whether this extension is available''' from OpenGL import extensions return extensions.hasGLExtension( _EXTENSION_NAME ) ### END AUTOGENERATED SECTION
{ "pile_set_name": "Github" }
using System; using NetOffice; using NetOffice.Attributes; namespace NetOffice.MSComctlLibApi.Enums { /// <summary> /// SupportByVersion MSComctlLib 6 /// </summary> [SupportByVersion("MSComctlLib", 6)] [EntityType(EntityType.IsEnum)] public enum ScrollingConstants { /// <summary> /// SupportByVersion MSComctlLib 6 /// </summary> /// <remarks>0</remarks> [SupportByVersion("MSComctlLib", 6)] ccScrollingStandard = 0, /// <summary> /// SupportByVersion MSComctlLib 6 /// </summary> /// <remarks>1</remarks> [SupportByVersion("MSComctlLib", 6)] ccScrollingSmooth = 1 } }
{ "pile_set_name": "Github" }
// Copyright 2017 The Closure Rules 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. package io.bazel.rules.closure.worker.testing; import io.bazel.rules.closure.worker.Annotations.Action; import io.bazel.rules.closure.worker.ErrorReporter; import io.bazel.rules.closure.worker.Program; import java.util.concurrent.atomic.AtomicBoolean; import javax.inject.Inject; /** Wrapper around a program that returns {@link ProgramResult} afterwards. */ public final class ProgramRunner<T extends Program> { private final Program delegate; private final AtomicBoolean failed; private final ErrorReporter reporter; @Inject ProgramRunner(T delegate, ErrorReporter reporter, @Action AtomicBoolean failed) { this.delegate = delegate; this.reporter = reporter; this.failed = failed; } /** Runs program and returns result of invocation. */ public ProgramResult run() throws Exception { delegate.run(); return new AutoValue_ProgramResult(reporter.getErrors(), reporter.getWarnings(), failed.get()); } }
{ "pile_set_name": "Github" }
<?xml version="1.0" encoding="UTF-8"?> <!-- ~ 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. ~ --> <archetype-descriptor xsi:schemaLocation="http://maven.apache.org/plugins/maven-archetype-plugin/archetype-descriptor/1.0.0 http://maven.apache.org/xsd/archetype-descriptor-1.0.0.xsd" xmlns="http://maven.apache.org/plugins/maven-archetype-plugin/archetype-descriptor/1.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" name="archetype"> <requiredProperties> <requiredProperty key="groupId"> <defaultValue>org.apache.skywalking.apm.testcase</defaultValue> </requiredProperty> <requiredProperty key="artifactId"> <defaultValue>${scenario_name}</defaultValue> </requiredProperty> <requiredProperty key="version"> <defaultValue>1.0.0</defaultValue> </requiredProperty> <requiredProperty key="package"> <defaultValue>org.apache.skywalking.apm.testcase.${scenario_name}</defaultValue> </requiredProperty> <requiredProperty key="scenario_name"/> <requiredProperty key="scenario_case"> <defaultValue>${scenario_name}</defaultValue> </requiredProperty> </requiredProperties> <fileSets> <fileSet filtered="true" packaged="false" encoding="utf-8"> <directory/> <includes> <include>configuration.yml</include> <include>support-version.list</include> <include>bin/startup.sh</include> </includes> </fileSet> <fileSet filtered="true" packaged="false"> <directory>config</directory> </fileSet> <fileSet filtered="true" packaged="false"> <directory>src/main/assembly</directory> </fileSet> <fileSet filtered="true" packaged="true"> <directory>src/main/java</directory> </fileSet> <fileSet filtered="true" packaged="false"> <directory>src/main/resources</directory> </fileSet> </fileSets> </archetype-descriptor>
{ "pile_set_name": "Github" }
// Copyright 2017 Yahoo Holdings. Licensed under the terms of the Apache 2.0 license. See LICENSE in the project root. /** * \class document::StructDataType * \ingroup datatype * * \brief A data type describing what can be contained in a struct field value. * * Describes what can be stored in a struct. */ #pragma once #include <vespa/document/datatype/structureddatatype.h> #include <vespa/vespalib/stllike/hash_map.h> #include <vespa/vespalib/util/compressionconfig.h> #include <memory> namespace document { class StructDataType final : public StructuredDataType { public: using UP = std::unique_ptr<StructDataType>; using SP = std::shared_ptr<StructDataType>; using CompressionConfig = vespalib::compression::CompressionConfig; StructDataType(); StructDataType(vespalib::stringref name); StructDataType(vespalib::stringref name, int32_t id); ~StructDataType(); /** * @throws vespalib::IllegalArgumentException if field conflicts with * already existing field. */ void addField(const Field& field); /** * Similar to addField(field), but does not throw exceptions on errors. * Fields that can be added are, and the other ones are skipped. Skipped * fields will logs a warning informing about the conflict. * * This is typically called from DocumentType::inherit() to add the fields * that does not conflict with existing fields. */ void addInheritedField(const Field& field); // Implementation of StructuredDataType std::unique_ptr<FieldValue> createFieldValue() const override; void print(std::ostream&, bool verbose, const std::string& indent) const override; uint32_t getFieldCount() const override { return _idFieldMap.size(); } const Field& getField(vespalib::stringref name) const override; /** * Retrieves a field based on its ID. To determine which ID to use, we also * need the document serialization version. */ const Field& getField(int32_t fieldId) const override; bool hasField(vespalib::stringref name) const override; bool hasField(int32_t fieldId) const override; bool hasField(const Field& f) const { return hasField(f.getId()); } Field::Set getFieldSet() const override; StructDataType* clone() const override; void setCompressionConfig(const CompressionConfig& cfg) { _compressionConfig = cfg; }; const CompressionConfig& getCompressionConfig() const { return _compressionConfig; } DECLARE_IDENTIFIABLE(StructDataType); private: using StringFieldMap = vespalib::hash_map<vespalib::string, Field::SP>; using IntFieldMap = vespalib::hash_map<int32_t, Field::SP>; StringFieldMap _nameFieldMap; IntFieldMap _idFieldMap; CompressionConfig _compressionConfig; /** @return "" if not conflicting. Error message otherwise. */ vespalib::string containsConflictingField(const Field& field) const; }; }
{ "pile_set_name": "Github" }
qbs *_FUNC_EVALUATETOTYP_STRING_EVALUATETOTYP=NULL; if (!_FUNC_EVALUATETOTYP_STRING_EVALUATETOTYP)_FUNC_EVALUATETOTYP_STRING_EVALUATETOTYP=qbs_new(0,0); qbs*oldstr2502=NULL; if(_FUNC_EVALUATETOTYP_STRING_A2->tmp||_FUNC_EVALUATETOTYP_STRING_A2->fixed||_FUNC_EVALUATETOTYP_STRING_A2->readonly){ oldstr2502=_FUNC_EVALUATETOTYP_STRING_A2; if (oldstr2502->cmem_descriptor){ _FUNC_EVALUATETOTYP_STRING_A2=qbs_new_cmem(oldstr2502->len,0); }else{ _FUNC_EVALUATETOTYP_STRING_A2=qbs_new(oldstr2502->len,0); } memcpy(_FUNC_EVALUATETOTYP_STRING_A2->chr,oldstr2502->chr,oldstr2502->len); } qbs *_FUNC_EVALUATETOTYP_STRING_A=NULL; if (!_FUNC_EVALUATETOTYP_STRING_A)_FUNC_EVALUATETOTYP_STRING_A=qbs_new(0,0); qbs *_FUNC_EVALUATETOTYP_STRING_E=NULL; if (!_FUNC_EVALUATETOTYP_STRING_E)_FUNC_EVALUATETOTYP_STRING_E=qbs_new(0,0); int32 *_FUNC_EVALUATETOTYP_LONG_SOURCETYP=NULL; if(_FUNC_EVALUATETOTYP_LONG_SOURCETYP==NULL){ _FUNC_EVALUATETOTYP_LONG_SOURCETYP=(int32*)mem_static_malloc(4); *_FUNC_EVALUATETOTYP_LONG_SOURCETYP=0; } int32 *_FUNC_EVALUATETOTYP_LONG_IDNUMBER=NULL; if(_FUNC_EVALUATETOTYP_LONG_IDNUMBER==NULL){ _FUNC_EVALUATETOTYP_LONG_IDNUMBER=(int32*)mem_static_malloc(4); *_FUNC_EVALUATETOTYP_LONG_IDNUMBER=0; } int32 *_FUNC_EVALUATETOTYP_LONG_I=NULL; if(_FUNC_EVALUATETOTYP_LONG_I==NULL){ _FUNC_EVALUATETOTYP_LONG_I=(int32*)mem_static_malloc(4); *_FUNC_EVALUATETOTYP_LONG_I=0; } byte_element_struct *byte_element_2503=NULL; if (!byte_element_2503){ if ((mem_static_pointer+=12)<mem_static_limit) byte_element_2503=(byte_element_struct*)(mem_static_pointer-12); else byte_element_2503=(byte_element_struct*)mem_static_malloc(12); } int32 *_FUNC_EVALUATETOTYP_LONG_U=NULL; if(_FUNC_EVALUATETOTYP_LONG_U==NULL){ _FUNC_EVALUATETOTYP_LONG_U=(int32*)mem_static_malloc(4); *_FUNC_EVALUATETOTYP_LONG_U=0; } byte_element_struct *byte_element_2504=NULL; if (!byte_element_2504){ if ((mem_static_pointer+=12)<mem_static_limit) byte_element_2504=(byte_element_struct*)(mem_static_pointer-12); else byte_element_2504=(byte_element_struct*)mem_static_malloc(12); } byte_element_struct *byte_element_2505=NULL; if (!byte_element_2505){ if ((mem_static_pointer+=12)<mem_static_limit) byte_element_2505=(byte_element_struct*)(mem_static_pointer-12); else byte_element_2505=(byte_element_struct*)mem_static_malloc(12); } qbs *_FUNC_EVALUATETOTYP_STRING_O=NULL; if (!_FUNC_EVALUATETOTYP_STRING_O)_FUNC_EVALUATETOTYP_STRING_O=qbs_new(0,0); qbs *_FUNC_EVALUATETOTYP_STRING_N=NULL; if (!_FUNC_EVALUATETOTYP_STRING_N)_FUNC_EVALUATETOTYP_STRING_N=qbs_new(0,0); qbs *_FUNC_EVALUATETOTYP_STRING_DST=NULL; if (!_FUNC_EVALUATETOTYP_STRING_DST)_FUNC_EVALUATETOTYP_STRING_DST=qbs_new(0,0); qbs *_FUNC_EVALUATETOTYP_STRING_BYTES=NULL; if (!_FUNC_EVALUATETOTYP_STRING_BYTES)_FUNC_EVALUATETOTYP_STRING_BYTES=qbs_new(0,0); int32 pass2506; int32 pass2507; int32 pass2508; int32 pass2509; int32 pass2510; int32 pass2511; int32 pass2512; int32 pass2513; int32 pass2514; int32 *_FUNC_EVALUATETOTYP_LONG_SIZE=NULL; if(_FUNC_EVALUATETOTYP_LONG_SIZE==NULL){ _FUNC_EVALUATETOTYP_LONG_SIZE=(int32*)mem_static_malloc(4); *_FUNC_EVALUATETOTYP_LONG_SIZE=0; } byte_element_struct *byte_element_2515=NULL; if (!byte_element_2515){ if ((mem_static_pointer+=12)<mem_static_limit) byte_element_2515=(byte_element_struct*)(mem_static_pointer-12); else byte_element_2515=(byte_element_struct*)mem_static_malloc(12); } byte_element_struct *byte_element_2516=NULL; if (!byte_element_2516){ if ((mem_static_pointer+=12)<mem_static_limit) byte_element_2516=(byte_element_struct*)(mem_static_pointer-12); else byte_element_2516=(byte_element_struct*)mem_static_malloc(12); } byte_element_struct *byte_element_2517=NULL; if (!byte_element_2517){ if ((mem_static_pointer+=12)<mem_static_limit) byte_element_2517=(byte_element_struct*)(mem_static_pointer-12); else byte_element_2517=(byte_element_struct*)mem_static_malloc(12); } int32 pass2518; int32 *_FUNC_EVALUATETOTYP_LONG_T1=NULL; if(_FUNC_EVALUATETOTYP_LONG_T1==NULL){ _FUNC_EVALUATETOTYP_LONG_T1=(int32*)mem_static_malloc(4); *_FUNC_EVALUATETOTYP_LONG_T1=0; } int32 pass2519; int32 *_FUNC_EVALUATETOTYP_LONG_T=NULL; if(_FUNC_EVALUATETOTYP_LONG_T==NULL){ _FUNC_EVALUATETOTYP_LONG_T=(int32*)mem_static_malloc(4); *_FUNC_EVALUATETOTYP_LONG_T=0; } qbs *_FUNC_EVALUATETOTYP_STRING_LK=NULL; if (!_FUNC_EVALUATETOTYP_STRING_LK)_FUNC_EVALUATETOTYP_
{ "pile_set_name": "Github" }
""" """ import json import logging import ast import difflib import sys import os.path import astor CHECKS = { "array" : ast.Tuple(ctx=ast.Load(), elts=[ast.Name(id='list', ctx=ast.Load()), ast.Name(id='tuple', ctx=ast.Load())]), # "(list, tuple)", "boolean" : ast.Tuple(ctx=ast.Load(), elts=[ast.Name(id='bool', ctx=ast.Load())]), # "(bool, )", "integer" : ast.Tuple(ctx=ast.Load(), elts=[ast.Name(id='int', ctx=ast.Load())]), # "(int, )", "number" : ast.Tuple(ctx=ast.Load(), elts=[ast.Name(id='float', ctx=ast.Load()), ast.Name(id='int', ctx=ast.Load())]), # "(float, int)", "string" : ast.Tuple(ctx=ast.Load(), elts=[ast.Name(id='str', ctx=ast.Load())]), # "(str, )", } class JsonInterfaceGenerator(object): """ """ def __init__(self, protocol_version="1.2", debug_prints=False, *args, **kwargs): """ init """ super().__init__(*args, **kwargs) if protocol_version == None: protocol_version = "1.2" self.log = logging.getLogger("Main.ChromeController.WrapperGenerator") self.line_num = 0 self.do_debug_prints = debug_prints self.types = {} self.protocol = self.__load_protocol(protocol_version) self.__build_interface_class() def __load_json_file(self, fname): folder = os.path.split(__file__)[0] protocol_file_path = os.path.join(folder, "../", 'protocols', fname) protocol_file_path = os.path.abspath(protocol_file_path) assert(os.path.exists(protocol_file_path)), "Protocol file '{}' appears to be missing!".format(protocol_file_path) with open(protocol_file_path) as fp: protocol_str = fp.read() return json.loads(protocol_str) def __load_protocol(self, protocol_version): self.log.info("Loading protocol version %s", protocol_version) main_json_file = "browser_protocol-r{}.json".format(protocol_version) js_json_file = "js_protocol-r{}.json" .format(protocol_version) js_file_1 = self.__load_json_file(main_json_file) js_file_2 = self.__load_json_file(js_json_file) self.__validate_protocol_version(main_json_file, js_file_1, protocol_version) self.__validate_protocol_version(js_json_file, js_file_2, protocol_version) # assemble the two json files into the single command descriptor file. for domain in js_file_2['domains']: js_file_1['domains'].append(domain) return js_file_1 def __get_line(self): self.line_num += 1 return self.line_num def __validate_protocol_version(self, filename, js_file, protocol_version): file_protocol_rev = "{}.{}".format(js_file['version']["major"], js_file['version']["minor"]) errm_1 = "Version mismatch: {} - {} in file {}".format(file_protocol_rev, protocol_version, filename) assert file_protocol_rev == protocol_version, errm_1 def __build_interface_class(self): # body = ast. body = [ ast.Expr(value=ast.Str(s='\n\n\t')), self.__build__init() ] for subdom in self.protocol['domains']: subdom_funcs = self.__build_domain_interface(subdom) body += subdom_funcs # print(body) self.interface_class = ast.ClassDef( name = "ChromeRemoteDebugInterface", bases = [ast.Name(id="ChromeInterface", ctx=ast.Load())], body = body, keywords = [], decorator_list = [], starargs = None, kwargs = None, lineno = self.__get_line(), col_offset = 0, ) # code = astor.dump_tree(self.interface_class) # print(code) def __build__init(self): super_func_call = ast.Call(func=ast.Name(id='super', ctx=ast.Load()), args=[], keywords=[]) if (sys.version_info[0], sys.version_info[1]) == (3, 5) or \ (sys.version_info[0], sys.version_info[1]) == (3, 6) or \ (sys.version_info[0], sys.version_info[1]) == (3, 7) or \ (sys.version_info[0], sys.version_info[1]) == (3, 8): super_func = ast.Call( func=ast.Attribute(value=super_func_call, attr='__init__', ctx=ast.Load()), args=[ast.Starred(value=ast.Name(id='args', ctx=ast.Load()), ctx=ast.Load())], keywords=[ast.keyword(arg=None, value=ast.Name(id='kwargs', ctx=ast.Load()), ctx=ast.Load())], ) elif (sys.version_info[0], sys.version_info[1]) == (3,4): super_func = ast.Call( func=ast.Attribute(value=super_func_call, attr='__init__', ctx=ast.Load()), args=[], keywords=[], starargs=ast.Name(id='args', ctx=ast.Load()), kwargs=ast.Name(id='kwargs', ctx=ast.Load()), ) else: print("Version:", sys.version_info) raise RuntimeError("This script only functions on python 3.4, 3.5, 3.6, or 3.7. Active python version {}.{}".format(*sys.version_info)) super_init = ast.Expr( value=super_func, lineno = self.__get_line(), col_offset = 0, ) body = [super_init] sig = ast.arguments( args=[ast.arg('self', None)], vararg=ast.arg(arg='args', annotation=None), kwarg=ast.arg(arg='kwargs', annotation=None), varargannotation=None, posonlyargs=[], kwonlyargs=[], kwargannotation=None, defaults=[], kw_defaults=[]) func = ast.FunctionDef( name = "__init__", args = sig, body = body, decorator_list = [], lineno = self.__get_line(), col_offset = 0, ) return func def __build_domain_interface(self, subdom): assert "domain" in subdom dom_desc = subdom.get("descripton", "") dom_name = subdom['domain'] full_name = subdom['domain'] for typen in subdom.get('types', []): typestr = "{}_{}".format(dom_name, typen['id']) assert typen['id'] not in self.types, "Duplicate type name: {}".format(typen['id']) self.types[typestr] = typen functions = [] for command in subdom.get('commands', []): func = self.__build_function(dom_name, full_name, command) functions.append(func) return functions def __build_desc_string(self, dom_name, func_name, func_params): desc = [] fname
{ "pile_set_name": "Github" }
#ifndef HEAP_H #define HEAP_H #define MAX_NODES 100 /* An implementation of a MinHeap, a tree based data structure in which which each node's value is lesser than its children.*/ typedef struct { int N; int heap[MAX_NODES]; } MinHeap; void add(MinHeap* h, int value); void rmv(MinHeap* h, int node); void sift(MinHeap* h, int node); void percolate(MinHeap* h, int node); void swap_nodes(MinHeap* h, int node1, int node2); int get_value_at_node(MinHeap* h, int node); #endif // HEAP_H
{ "pile_set_name": "Github" }
# Translation of Odoo Server. # This file contains the translation of the following modules: # * hr_expense_sequence # # Translators: # OCA Transbot <transbot@odoo-community.org>, 2017 msgid "" msgstr "" "Project-Id-Version: Odoo Server 10.0\n" "Report-Msgid-Bugs-To: \n" "POT-Creation-Date: 2017-07-01 01:04+0000\n" "PO-Revision-Date: 2017-07-01 01:04+0000\n" "Last-Translator: OCA Transbot <transbot@odoo-community.org>, 2017\n" "Language-Team: Italian (https://www.transifex.com/oca/teams/23907/it/)\n" "Language: it\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: \n" "Plural-Forms: nplurals=2; plural=(n != 1);\n" #. module: hr_expense_sequence #: model:ir.model,name:hr_expense_sequence.model_hr_expense_sheet msgid "Expense Report" msgstr "" #. module: hr_expense_sequence #: model_terms:ir.ui.view,arch_db:hr_expense_sequence.report_expense_sheet msgid "Expenses Report" msgstr "" #. module: hr_expense_sequence #: model:ir.model.fields,field_description:hr_expense_sequence.field_hr_expense_sheet__number msgid "Number" msgstr "Numero"
{ "pile_set_name": "Github" }
/* Copyright 2018 The TensorFlow 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. ==============================================================================*/ #include "tensorflow/compiler/xla/client/lib/matrix.h" #include <array> #include <numeric> #include <vector> #include "absl/algorithm/container.h" #include "absl/container/flat_hash_set.h" #include "absl/strings/ascii.h" #include "absl/strings/str_split.h" #include "absl/strings/string_view.h" #include "absl/types/span.h" #include "tensorflow/compiler/xla/client/lib/arithmetic.h" #include "tensorflow/compiler/xla/client/lib/constants.h" #include "tensorflow/compiler/xla/client/lib/slicing.h" #include "tensorflow/compiler/xla/client/xla_builder.h" #include "tensorflow/compiler/xla/shape_util.h" #include "tensorflow/compiler/xla/status.h" #include "tensorflow/compiler/xla/status_macros.h" #include "tensorflow/compiler/xla/statusor.h" #include "tensorflow/compiler/xla/util.h" #include "tensorflow/compiler/xla/xla_data.pb.h" namespace xla { XlaOp IdentityMatrix(XlaBuilder* builder, PrimitiveType type, int64 m, int64 n) { auto a = Iota(builder, U32, m); auto b = Iota(builder, U32, n); auto indicator = Eq(a, Broadcast(b, {m}), /*broadcast_dimensions=*/{0}); return ConvertElementType(indicator, type); } XlaOp GetDiagonalMask(XlaOp x, int diagonal) { XlaBuilder* builder = x.builder(); return builder->ReportErrorOrReturn([&]() -> StatusOr<XlaOp> { TF_ASSIGN_OR_RETURN(Shape shape, builder->GetShape(x)); auto n_dims = static_cast<int32>(shape.rank()); TF_RET_CHECK(n_dims >= 2); auto m = shape.dimensions(n_dims - 2); auto n = shape.dimensions(n_dims - 1); absl::Span<const int64> major_dims = AsInt64Slice(shape.dimensions()).subspan(/*pos=*/0, /*len=*/n_dims - 2); auto a = Iota(builder, S32, n); auto b = Iota(builder, S32, m) + ConstantR0WithType(builder, S32, diagonal); auto indicator = Eq(b, Broadcast(a, {m}), /*broadcast_dimensions=*/{0}); auto mask = Broadcast(indicator, major_dims); return mask; }); } XlaOp GetMatrixDiagonal(XlaOp x, int k) { XlaBuilder* builder = x.builder(); return builder->ReportErrorOrReturn([&]() -> StatusOr<XlaOp> { TF_ASSIGN_OR_RETURN(Shape shape, builder->GetShape(x)); auto n_dims = static_cast<int32>(shape.rank()); TF_RET_CHECK(n_dims >= 2); const int64 m = shape.dimensions(n_dims - 2); const int64 n = shape.dimensions(n_dims - 1); auto mask = GetDiagonalMask(x, k); // TPUs don't support S64 add reduction at the moment. But fortunately // OR-reductions work just as well for integers. XlaComputation reducer = CreateScalarIdentityWithZeroComputation(shape.element_type(), builder); // k == 0, we can save one slice op. if (k == 0) { return Reduce(Select(mask, x, Zeros(builder, shape)), ScalarLike(x, 0), reducer, {m >= n ? n_dims - 2 : n_dims - 1}); } else if (k > 0) { auto result = Reduce(Select(mask, x, Zeros(builder, shape)), ScalarLike(x, 0), reducer, {n_dims - 2}); return SliceInMinorDims(result, {std::min<int64>(k, n)}, {std::min(m + k, n)}); } else { auto result = Reduce(Select(mask, x, Zeros(builder, shape)), ScalarLike(x, 0), reducer, {n_dims - 1}); return SliceInMinorDims(result, {std::min<int64>(-k, m)}, {std::min(m, n - k)}); } }); } XlaOp TriangleMask(XlaOp x, int diagonal) { XlaBuilder* builder = x.builder(); return builder->ReportErrorOrReturn([&]() -> StatusOr<XlaOp> { TF_ASSIGN_OR_RETURN(Shape shape, builder->GetShape(x)); const int64 n_dims = shape.rank(); TF_RET_CHECK(n_dims >= 2); const int64 m = shape.dimensions(n_dims - 2); const int64 n = shape.dimensions(n_dims - 1); absl::Span<const int64> major_dims = AsInt64Slice(shape.dimensions()).subspan(/*pos=*/0, /*len=*/n_dims - 2); auto a = Iota(builder, S32, n); auto b = Iota(builder, S32, m) + ConstantR0<int32>(builder, diagonal); XlaOp indicator; indicator = Ge(b, Broadcast(a, {m}), /*broadcast_dimensions=*/{0}); return Broadcast(indicator, major_dims); }); } XlaOp Triangle(XlaOp x, bool lower) { return lower ? Select(TriangleMask(x, 0), x, ZerosLike(x)) : Select(TriangleMask(x, -1), ZerosLike(x), x); } XlaOp UpperTriangle(XlaOp x) { return Triangle(x, false); } XlaOp LowerTriangle(XlaOp x) { return Triangle(x, true); } Status ValidateEinsumNumericDimensions(absl::Span<const int64> x_config, absl::Span<const int64> y_config, absl::Span<const int64> output_config) { for (auto dim : output_config) { if (absl::c_linear_search(x_config, dim) || absl::c_linear_search(y_config, dim)) { if (absl::c_count(output_config, dim) > 1) { return InvalidArgument("Einsum has repeated output dimension."); } continue; } return InvalidArgument( "Einsum has output dimension without corresponding input dimension."); } for (auto dim : x_config) { if (absl::c_linear_search(y_config, dim) || absl::c_linear_search(output_config, dim)) { if (absl::c_count(x_config, dim) > 1) { return InvalidArgument("Einsum has repeated lhs dimension."); } continue; } return InvalidArgument( "Einsum has lhs dimension without corresponding rhs or output " "dimension."); } for (auto dim : y_config) {
{ "pile_set_name": "Github" }
// Copyright 2017, OpenCensus 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 tag contains OpenCensus tags. Tags are key-value pairs. Tags provide additional cardinality to the OpenCensus instrumentation data. Tags can be propagated on the wire and in the same process via context.Context. Encode and Decode should be used to represent tags into their binary propagation form. */ package tag // import "go.opencensus.io/tag"
{ "pile_set_name": "Github" }
<BsNav as |nav|> <nav.item> <nav.linkTo @route="acceptance.link" @model="1"> first </nav.linkTo> </nav.item> <nav.item> <nav.linkTo @route="acceptance.link" @model="2"> second </nav.linkTo> </nav.item> <nav.item> <nav.linkTo @route="acceptance.link" @model={{@model}}> current </nav.linkTo> </nav.item> </BsNav>
{ "pile_set_name": "Github" }
## 课时 24:配置 react 基础配置已经全部配置好了,所以 react 的配置就只有将 jsx 的文件用 babel 编译一下就 ok 了,下面配置将 babel 的配置进行了修改 开启 react box.config.js ```js { "env": { "REACT": "react" // 配置 react } } ``` packages/react/webpack-chain.config.js ```js // [react 配置] module.exports = ({ config }) => { return () => { if (!process.env.REACT) return; const baseRule = config.module.rule("babel"); baseRule .use("babel") .loader(require.resolve("babel-loader")) .tap(options => { options.presets.push([ "@babel/preset-react", { corejs: "3", useBuiltIns: "usage", loose: true, modules: false, targets: { chrome: 59, edge: 13, firefox: 50, safari: 8 } } ]); return options; }); }; }; ```
{ "pile_set_name": "Github" }
// Copyright 2017 The go-ethereum Authors // This file is part of the go-ethereum library. // // The go-ethereum library is free software: you can redistribute it and/or modify // it under the terms of the GNU Lesser General Public License as published by // the Free Software Foundation, either version 3 of the License, or // (at your option) any later version. // // The go-ethereum library is distributed in the hope that it will be useful, // but WITHOUT ANY WARRANTY; without even the implied warranty of // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the // GNU Lesser General Public License for more details. // // You should have received a copy of the GNU Lesser General Public License // along with the go-ethereum library. If not, see <http://www.gnu.org/licenses/>. package adapters import ( "errors" "fmt" "io" "io/ioutil" "os" "os/exec" "path/filepath" "runtime" "strings" "github.com/docker/docker/pkg/reexec" "github.com/wanchain/go-wanchain/node" "github.com/wanchain/go-wanchain/p2p/discover" ) // DockerAdapter is a NodeAdapter which runs simulation nodes inside Docker // containers. // // A Docker image is built which contains the current binary at /bin/p2p-node // which when executed runs the underlying service (see the description // of the execP2PNode function for more details) type DockerAdapter struct { ExecAdapter } // NewDockerAdapter builds the p2p-node Docker image containing the current // binary and returns a DockerAdapter func NewDockerAdapter() (*DockerAdapter, error) { // Since Docker containers run on Linux and this adapter runs the // current binary in the container, it must be compiled for Linux. // // It is reasonable to require this because the caller can just // compile the current binary in a Docker container. if runtime.GOOS != "linux" { return nil, errors.New("DockerAdapter can only be used on Linux as it uses the current binary (which must be a Linux binary)") } if err := buildDockerImage(); err != nil { return nil, err } return &DockerAdapter{ ExecAdapter{ nodes: make(map[discover.NodeID]*ExecNode), }, }, nil } // Name returns the name of the adapter for logging purposes func (d *DockerAdapter) Name() string { return "docker-adapter" } // NewNode returns a new DockerNode using the given config func (d *DockerAdapter) NewNode(config *NodeConfig) (Node, error) { if len(config.Services) == 0 { return nil, errors.New("node must have at least one service") } for _, service := range config.Services { if _, exists := serviceFuncs[service]; !exists { return nil, fmt.Errorf("unknown node service %q", service) } } // generate the config conf := &execNodeConfig{ Stack: node.DefaultConfig, Node: config, } conf.Stack.DataDir = "/data" conf.Stack.WSHost = "0.0.0.0" conf.Stack.WSOrigins = []string{"*"} conf.Stack.WSExposeAll = true conf.Stack.P2P.EnableMsgEvents = false conf.Stack.P2P.NoDiscovery = true conf.Stack.P2P.NAT = nil conf.Stack.NoUSB = true //conf.Stack.Logger = log.New("node.id", config.ID.String()) node := &DockerNode{ ExecNode: ExecNode{ ID: config.ID, Config: conf, adapter: &d.ExecAdapter, }, } node.newCmd = node.dockerCommand d.ExecAdapter.nodes[node.ID] = &node.ExecNode return node, nil } // DockerNode wraps an ExecNode but exec's the current binary in a docker // container rather than locally type DockerNode struct { ExecNode } // dockerCommand returns a command which exec's the binary in a Docker // container. // // It uses a shell so that we can pass the _P2P_NODE_CONFIG environment // variable to the container using the --env flag. func (n *DockerNode) dockerCommand() *exec.Cmd { return exec.Command( "sh", "-c", fmt.Sprintf( `exec docker run --interactive --env _P2P_NODE_CONFIG="${_P2P_NODE_CONFIG}" %s p2p-node %s %s`, dockerImage, strings.Join(n.Config.Node.Services, ","), n.ID.String(), ), ) } // dockerImage is the name of the Docker image which gets built to run the // simulation node const dockerImage = "p2p-node" // buildDockerImage builds the Docker image which is used to run the simulation // node in a Docker container. // // It adds the current binary as "p2p-node" so that it runs execP2PNode // when executed. func buildDockerImage() error { // create a directory to use as the build context dir, err := ioutil.TempDir("", "p2p-docker") if err != nil { return err } defer os.RemoveAll(dir) // copy the current binary into the build context bin, err := os.Open(reexec.Self()) if err != nil { return err } defer bin.Close() dst, err := os.OpenFile(filepath.Join(dir, "self.bin"), os.O_WRONLY|os.O_CREATE, 0755) if err != nil { return err } defer dst.Close() if _, err := io.Copy(dst, bin); err != nil { return err } // create the Dockerfile dockerfile := []byte(` FROM ubuntu:16.04 RUN mkdir /data ADD self.bin /bin/p2p-node `) if err := ioutil.WriteFile(filepath.Join(dir, "Dockerfile"), dockerfile, 0644); err != nil { return err } // run 'docker build' cmd := exec.Command("docker", "build", "-t", dockerImage, dir) cmd.Stdout = os.Stdout cmd.Stderr = os.Stderr if err := cmd.Run(); err != nil { return fmt.Errorf("error building docker image: %s", err) } return nil }
{ "pile_set_name": "Github" }
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd"> <html DIR="LTR"> <head> <meta http-equiv="Content-Type" content="text/html; charset=utf-8"> <meta name="viewport" content="initial-scale=1.0"> <title>Google Chrome and Chrome OS additional Terms of Service</title> <style> :root { color-scheme: light dark } body { font-family:Arial; font-size:13px; } h2 { font-size:1em; margin-top:0 } </style> </head> <body> <h2> Google Chrome and Chrome OS additional Terms of Service </h2> <p> By using Chrome or Chrome OS, you agree to the Google Terms of Service located at https://policies.google.com/terms and these Google Chrome and Chrome OS additional Terms of Service. </p> <p> These Google Chrome and Chrome OS additional Terms of Service apply to the executable code version of Chrome and Chrome OS. Most source code for Chrome is available free of charge under open source software licence agreements at https://code.google.com/chromium/terms.html. </p> <p> Your use of certain components of Chrome and Chrome OS is subject to the following terms: </p> <section> <p> <strong> AVC </strong> </p> <p> THIS PRODUCT IS LICENSED UNDER THE AVC PATENT PORTFOLIO LICENCE FOR THE PERSONAL USE OF A CONSUMER, OR OTHER USES IN WHICH IT DOES NOT RECEIVE REMUNERATION, TO (i) ENCODE VIDEO IN COMPLIANCE WITH THE AVC STANDARD ('AVC VIDEO') AND/OR (ii) DECODE AVC VIDEO THAT WAS ENCODED BY A CONSUMER ENGAGED IN A PERSONAL ACTIVITY AND/OR WAS OBTAINED FROM A VIDEO PROVIDER LICENSED TO PROVIDE AVC VIDEO. NO LICENCE IS GRANTED OR SHALL BE IMPLIED FOR ANY OTHER USE. ADDITIONAL INFORMATION MAY BE OBTAINED FROM MPEG LA, L.L.C. SEE HTTP://WWW.MPEGLA.COM. </p> </section> <section> <p> <strong> Adobe </strong> </p> <p> Google Chrome may include one or more components provided by Adobe Systems Incorporated and Adobe Software Ireland Limited (collectively, “Adobe”). Your use of the Adobe software, as provided by Google (“Adobe Software”), is subject to the following additional terms (the “Adobe Terms”). You, the entity receiving the Adobe Software, will be hereinafter referred to as “Sublicensee”. </p> <p> 1. License Restrictions. </p> <p> (a) Flash Player, Version 10.x is designed only as a browser plug-in. Sublicensee may not modify or distribute this Adobe Software for use as anything but a browser plug-in for playing back content on a web page. For example, Sublicensee will not modify this Adobe Software in order to allow interoperation with applications that run outside the browser (e.g. stand-alone applications, widgets, device UI). </p> <p> (b) Sublicensee will not expose any APIs of the Flash Player, Version 10.x through a browser plug-in interface in such a way that allows such extension to be used to play back content from a web page as a stand-alone application. </p> <p> (c) The Chrome-Reader Software may not be used to render any PDF or EPUB documents that utilise digital-rights management protocols or systems other than Adobe DRM. </p> <p> (d) Adobe DRM must be enabled in the Chrome-Reader Software for all Adobe DRM-protected PDF and EPUB documents. </p> <p> (e) The Chrome-Reader Software may not, other than as explicitly permitted by the technical specifications, disable any capabilities provided by Adobe in the Adobe Software, including, but not limited to, support for PDF and EPUB formats and Adobe DRM. </p> <p> 2. Electronic Transmission. Sublicensee may allow the download of the Adobe Software from a website, the Internet, an intranet or similar technology (“Electronic Transmissions”), provided that Sublicensee agrees that any distributions of the Adobe Software by Sublicensee, including those on CD-ROM, DVD-ROM or other storage media and Electronic Transmissions, if expressly permitted, shall be subject to reasonable security measures to prevent unauthorised use. With relation to Electronic Transmissions approved hereunder, Sublicensee agrees to employ any reasonable usage restrictions set by Adobe, including those related to security and/or the restriction of distribution to end users of the Sublicensee's Product. </p> <p> 3. EULA and Distribution Terms. </p> <p> (a) Sublicensee shall ensure that the Adobe Software is distributed to end users under an enforceable end-user licence agreement, in favour of Sublicensee and its suppliers, containing at least each of the following minimum terms (the “End-User Licence”): (i) a prohibition against distribution and copying, (ii) a prohibition against modifications and derivative works, (iii) a prohibition against decompiling, reverse-engineering, disassembling and otherwise reducing the Adobe Software to a human-perceivable form, (iv) a provision indicating ownership of Sublicensee's Product (as defined in Section 8) by Sublicensee and its licensors, (v) a disclaimer of indirect, special, incidental, punitive and consequential damages and (vi) other industry-standard disclaimers and limitations, including, as applicable: a disclaimer of all applicable statutory warranties, to the full extent allowed by law. </p> <p> (b) Sublicensee shall ensure that the Adobe Software is distributed to Sublicensee’s distributors under an enforceable distribution licence agreement, in favour of Sublicensee and its suppliers, containing terms as protective of Adobe as the Adobe Terms. </p> <p> 4. Open Source. Sublicensee will not directly or indirectly grant, or purport to grant, to any third party any rights or immunities under Adobe’s intellectual property or proprietary rights that will subject such intellectual property to an open-source licence or scheme in which there is, or could be interpreted to be, a requirement that as a condition of use, modification and/or distribution, the Adobe Software be: (i) disclosed or distributed in source code form; (ii) licensed for the purpose of making derivative works; or (iii) redistributable at no charge. For clarification purposes, the foregoing restriction does not preclude Sublicensee from distributing, and Sublicensee will distribute the Adobe Software as bundled with the Google Software, without charge. </p> <p> 5. Additional Terms. With respect to any update, upgrade, new versions of the Adobe Software (collectively “Upgrades”) provided to Sublicenses, Adobe reserves the right to require additional terms and conditions applicable solely to the Upgrade and future versions thereof, and solely to the extent that such restrictions are imposed by Adobe on all licensees of such Upgrade. If Sublicensee does not agree to such additional terms or conditions, Sublicensee will have no licence rights with respect to such Upgrade, and Sublicensee’s licence rights with respect to the Adobe Software will terminate automatically on the 90th day from the date that such additional terms are made available to Sublicensee. </p> <p> 6. Proprietary Rights Notices. The Sublicensee shall not, and shall require its distributors not to, delete or in any manner alter the copyright notices, trademarks, logos or related notices, or other proprietary rights notices of Adobe (and its licensors, if any) appearing on or within the Adobe Software or accompanying materials. </p> <p> 7. Technical Requirements. Sublicensee and its distributors may only distribute Adobe Software and/or Upgrade on devices that (i) meet the technical specifications posted on http://www.adobe.com/mobile/licensees, (or a successor web site thereto), and (ii) has been verified by Adobe as set forth below. </p> <p> 8. Verification and Update. Sublicensee must submit to Adobe each Sublicensee product (and each version thereof) containing the Adobe Software and/or Upgrade (“Sublicensee Product”) that do not meet the Device Verification exemption criteria to be communicated by Google, for Adobe to verify. Sublicensee shall pay for each submission made by Sublicensee by procuring verification packages at Adobe’s then-current terms set forth at http://flashmobile.adobe.com/. Sublicensee Product that has not passed verification may
{ "pile_set_name": "Github" }
Glossary Stack notation: "<stack before> -- <stack after>". Rightmost is top of stack (TOS). For example, in "a b -- c d", b is TOS before, d is TOS after. "R:" means that the Return Stack is modified. "I:" prefix means "IMMEDIATE", that is, that this stack transformation is made at compile time. Word references (wordref): When we say we have a "word reference", it's a pointer to a word's *code link*. For example, the address that "' DUP" puts on the stack is a wordref, that is, a reference to the code link of the word DUP. PF: Parameter field. The area following the code link of a word. For example, "' H@ 1+" points to the PF of the word H@. (cont.)
{ "pile_set_name": "Github" }
# -*- coding: utf-8 -*- """ USID utilities for performing randomized singular value decomposition and reconstructing results Created on Mon Mar 28 09:45:08 2016 @author: Suhas Somnath, Chris Smith """ from __future__ import division, print_function, absolute_import import time from multiprocessing import cpu_count import numpy as np from sklearn.utils import gen_batches from sklearn.utils.extmath import randomized_svd from sidpy.hdf.reg_ref import get_indices_for_region_ref, create_region_reference from sidpy.hdf.hdf_utils import get_attr, write_simple_attrs from sidpy.proc.comp_utils import get_available_memory from sidpy.base.string_utils import format_time from sidpy.hdf.dtype_utils import check_dtype, stack_real_to_target_dtype from pyUSID.processing.process import Process from .proc_utils import get_component_slice from pyUSID.io.hdf_utils import find_results_groups, copy_attributes, \ reshape_to_n_dims, write_main_dataset, create_results_group, \ create_indexed_group, find_dataset from pyUSID.io.write_utils import Dimension, calc_chunks from pyUSID import USIDataset import h5py from matplotlib import pyplot as plt from pyUSID.viz import plot_utils class SVD(Process): """ This class provides a file-wrapper around the :meth:`sklearn.utils.extmath.randomized_svd` function. In other words, it extracts and then reformats the data present in the provided :class:`pyUSID.USIDataset` object, performs the randomized SVD operation and writes the results back to the USID HDF5 file after formatting the results in an USID compliant manner. """ def __init__(self, h5_main, num_components=None, **kwargs): """ Perform the SVD decomposition on the selected dataset and write the results to h5 file. Parameters ---------- h5_main : :class:`pyUSID.USIDataset` object USID Main HDF5 dataset that will be decomposed num_components : int, optional Number of components to decompose h5_main into. Default None. h5_target_group : h5py.Group, optional. Default = None Location where to look for existing results and to place newly computed results. Use this kwarg if the results need to be written to a different HDF5 file. By default, this value is set to the parent group containing `h5_main` kwargs Arguments to be sent to Process """ super(SVD, self).__init__(h5_main, 'SVD', **kwargs) ''' Calculate the size of the main data in memory and compare to max_mem We use the minimum of the actual dtype's itemsize and float32 since we don't want to read it in yet and do the proper type conversions. ''' n_samples, n_features = h5_main.shape self.data_transform_func, is_complex, is_compound, n_features, type_mult = check_dtype(h5_main) if num_components is None: num_components = min(n_samples, n_features) else: num_components = min(n_samples, n_features, num_components) self.num_components = num_components # Check that we can actually compute the SVD with the selected number of components self._check_available_mem() self.parms_dict = {'num_components': num_components} self.duplicate_h5_groups, self.partial_h5_groups = self._check_for_duplicates() # supercharge h5_main! self.h5_main = USIDataset(self.h5_main) self.__u = None self.__v = None self.__s = None def test(self, override=False): """ Applies randomised VD to the dataset. This function does NOT write results to the hdf5 file. Call compute() to write to the file. Handles complex, compound datasets such that the V matrix is of the same data-type as the input matrix. Parameters ---------- override : bool, optional. default = False Set to true to recompute results if prior results are available. Else, returns existing results Returns ------- U : :class:`numpy.ndarray` Abundance matrix S : :class:`numpy.ndarray` variance vector V : :class:`numpy.ndarray` eigenvector matrix """ ''' Check if a number of compnents has been set and ensure that the number is less than the minimum axis length of the data. If both conditions are met, use fsvd. If not use the regular svd. C.Smith -- We might need to put a lower limit on num_comps in the future. I don't know enough about svd to be sure. ''' if not override: if isinstance(self.duplicate_h5_groups, list) and len(self.duplicate_h5_groups) > 0: self.h5_results_grp = self.duplicate_h5_groups[-1] print('Returning previously computed results from: {}'.format(self.h5_results_grp.name)) print('set the "override" flag to True to recompute results') return reshape_to_n_dims(self.h5_results_grp['U'])[0], self.h5_results_grp['S'][()], \ reshape_to_n_dims(self.h5_results_grp['V'])[0] self.h5_results_grp = None t1 = time.time() self.__u, self.__s, self.__v = randomized_svd(self.data_transform_func(self.h5_main), self.num_components, n_iter=3) self.__v = stack_real_to_target_dtype(self.__v, self.h5_main.dtype) print('Took {} to compute randomized SVD'.format(format_time(time.time() - t1))) u_mat, success = reshape_to_n_dims(self.__u, h5_pos=self.h5_main.h5_pos_inds, h5_spec=np.expand_dims(np.arange(self.__u.shape[1]), axis=0)) if not success: raise ValueError('Could not reshape U to N-Dimensional dataset! Error:' + success) v_mat, success = reshape_to_n_dims(self.__v, h5_pos=np.expand_dims(np.arange(self.__u.shape[1]), axis=1), h5_spec=self.h5_main.h5_spec_inds) if not success: raise ValueError('Could not reshape V to N-Dimensional dataset! Error:' + success) return u_mat, self.__s, v_mat def compute(self, override=False): """ Computes SVD (by calling test_on_subset() if it has not already been called) and writes results to file. Consider calling test() to check results before writing to file. Results are deleted from memory upon writing to the HDF5 file Parameters ---------- override : bool, optional. default = False Set to true to recompute results if prior results are available. Else, returns existing results Returns ------- h5_results_grp : :class:`h5py.Group` object HDF5 Group containing all the results """ if self.__u is None and self.__v is None and self.__s is None: self.test(override=override) if self.h5_results_grp is None: self._write_results_chunk() self.delete_results() h5_group = self.h5_results_grp return h5_group def delete_results
{ "pile_set_name": "Github" }
pycodestyle is a tool to check your Python code against some of the style conventions in PEP 8. This package used to be called pep8 but was renamed to pycodestyle to reduce confusion WWW: https://pypi.org/project/pycodestyle/ WWW: https://pycodestyle.readthedocs.io/en/latest/
{ "pile_set_name": "Github" }
# T1202 - Indirect Command Execution ## [Description from ATT&CK](https://attack.mitre.org/wiki/Technique/T1202) <blockquote>Various Windows utilities may be used to execute commands, possibly without invoking [cmd](https://attack.mitre.org/software/S0106). For example, [Forfiles](https://attack.mitre.org/software/S0193), the Program Compatibility Assistant (pcalua.exe), components of the Windows Subsystem for Linux (WSL), as well as other utilities may invoke the execution of programs and commands from a [Command-Line Interface](https://attack.mitre.org/techniques/T1059), Run window, or via scripts. (Citation: VectorSec ForFiles Aug 2017) (Citation: Evi1cg Forfiles Nov 2017) Adversaries may abuse these features for [Defense Evasion](https://attack.mitre.org/tactics/TA0005), specifically to perform arbitrary execution while subverting detections and/or mitigation controls (such as Group Policy) that limit/prevent the usage of [cmd](https://attack.mitre.org/software/S0106) or file extensions more commonly associated with malicious payloads.</blockquote> ## Atomic Tests - [Atomic Test #1 - Indirect Command Execution - pcalua.exe](#atomic-test-1---indirect-command-execution---pcaluaexe) - [Atomic Test #2 - Indirect Command Execution - forfiles.exe](#atomic-test-2---indirect-command-execution---forfilesexe) <br/> ## Atomic Test #1 - Indirect Command Execution - pcalua.exe The Program Compatibility Assistant (pcalua.exe) may invoke the execution of programs and commands from a Command-Line Interface. [Reference](https://twitter.com/KyleHanslovan/status/912659279806640128) **Supported Platforms:** Windows #### Inputs | Name | Description | Type | Default Value | |------|-------------|------|---------------| | process | Process to execute | string | calc.exe| | payload_path | Path to payload | path | c:\temp\payload.dll| | payload_cpl_path | Path to payload | path | C:\Windows\system32\javacpl.cpl -c Java| #### Run it with `command_prompt`! ``` pcalua.exe -a #{process} pcalua.exe -a #{payload_path} pcalua.exe -a #{payload_cpl_path} ``` <br/> <br/> ## Atomic Test #2 - Indirect Command Execution - forfiles.exe forfiles.exe may invoke the execution of programs and commands from a Command-Line Interface. [Reference](https://github.com/api0cradle/LOLBAS/blob/master/OSBinaries/Forfiles.md) "This is basically saying for each occurrence of notepad.exe in c:\windows\system32 run calc.exe" **Supported Platforms:** Windows #### Inputs | Name | Description | Type | Default Value | |------|-------------|------|---------------| | process | Process to execute | string | calc.exe| #### Run it with `command_prompt`! ``` forfiles /p c:\windows\system32 /m notepad.exe /c #{process} forfiles /p c:\windows\system32 /m notepad.exe /c "c:\folder\normal.dll:evil.exe" ``` <br/>
{ "pile_set_name": "Github" }
from django.db import migrations, models class Migration(migrations.Migration): initial = True dependencies = [ ("migrations", "0001_initial"), ] operations = [ migrations.AddField( model_name='task', name='projects', field=models.ManyToManyField(to='Project'), ), ]
{ "pile_set_name": "Github" }
<?xml version="1.0" encoding="UTF-8"?> <dependenciesRoot> <dependency className="jetbrains.mps.lang.smodel.query.test.migrationTest.MigrateScopes"> <classNode dependClassName="java.lang.Override" /> <classNode dependClassName="java.lang.Throwable" /> <classNode dependClassName="java.util.ArrayList" /> <classNode dependClassName="java.util.Collection" /> <classNode dependClassName="jetbrains.mps.MPSLaunch" /> <classNode dependClassName="jetbrains.mps.internal.collections.runtime.ListSequence" /> <classNode dependClassName="jetbrains.mps.lang.migration.runtime.base.MigrationScript" /> <classNode dependClassName="jetbrains.mps.lang.smodel.generator.smodelAdapter.SLinkOperations" /> <classNode dependClassName="jetbrains.mps.lang.smodel.generator.smodelAdapter.SNodeOperations" /> <classNode dependClassName="jetbrains.mps.lang.smodel.query.migration.MigrateScopes" /> <classNode dependClassName="jetbrains.mps.lang.test.runtime.BaseMigrationTestBody" /> <classNode dependClassName="jetbrains.mps.lang.test.runtime.RunWithCommand" /> <classNode dependClassName="jetbrains.mps.lang.test.runtime.TestParametersCache" /> <classNode dependClassName="jetbrains.mps.lang.test.runtime.TransformationTest" /> <classNode dependClassName="jetbrains.mps.smodel.adapter.structure.MetaAdapterFactory" /> <classNode dependClassName="org.jetbrains.mps.openapi.language.SConcept" /> <classNode dependClassName="org.jetbrains.mps.openapi.language.SContainmentLink" /> <classNode dependClassName="org.jetbrains.mps.openapi.model.SNode" /> <classNode dependClassName="org.junit.ClassRule" /> <classNode dependClassName="org.junit.Rule" /> <classNode dependClassName="org.junit.Test" /> <classNode extendsClassName="jetbrains.mps.lang.test.runtime.BaseTransformationTest" /> </dependency> </dependenciesRoot>
{ "pile_set_name": "Github" }
<?xml version="1.0" encoding="UTF-8" ?> <ConfirmClaimResponse> <Signature></Signature> <Claim> <Type>OWNERSHIP</Type> <Key>+5561988887777</Key> <KeyType>PHONE</KeyType> <ClaimerAccount> <Participant>12345678</Participant> <Branch>0001</Branch> <AccountNumber>0007654321</AccountNumber> <AccountType>CACC</AccountType> <OpeningDate>2010-01-10T03:00:00Z</OpeningDate> </ClaimerAccount> <Claimer> <Type>NATURAL_PERSON</Type> <TaxIdNumber>11122233300</TaxIdNumber> <Name>João Silva</Name> </Claimer> <DonorParticipant>87654321</DonorParticipant> <Id>123e4567-e89b-12d3-a456-426655440000</Id> <Status>CONFIRMED</Status> <ResolutionPeriodEnd>2020-01-17T10:00:00Z</ResolutionPeriodEnd> <CompletionPeriodEnd>2020-01-17T10:00:00Z</CompletionPeriodEnd> <LastModified>2020-01-10T10:00:00Z</LastModified> <ConfirmReason>USER_REQUESTED</ConfirmReason> </Claim> </ConfirmClaimResponse>
{ "pile_set_name": "Github" }
pub mod command; mod options; pub use command::Command as Table;
{ "pile_set_name": "Github" }
Sizes of pthreads-win32 structs ------------------------------- pthread_t 8 ptw32_thread_t 96 pthread_attr_t_ 28 sem_t_ 12 pthread_mutex_t_ 28 pthread_mutexattr_t_ 12 pthread_spinlock_t_ 8 pthread_barrier_t_ 36 pthread_barrierattr_t_ 4 pthread_key_t_ 16 pthread_cond_t_ 32 pthread_condattr_t_ 4 pthread_rwlock_t_ 28 pthread_rwlockattr_t_ 4 pthread_once_t_ 16 ptw32_cleanup_t 12 ptw32_mcs_node_t_ 16 sched_param 4 -------------------------------
{ "pile_set_name": "Github" }
/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */ /* 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/. */ var gTestfile = 'regress-352797-02.js'; //----------------------------------------------------------------------------- var BUGNUMBER = 352797; var summary = 'Do not assert: OBJ_GET_CLASS(cx, obj) == &js_BlockClass'; var actual = 'No Crash'; var expect = /No Crash/; //----------------------------------------------------------------------------- test(); //----------------------------------------------------------------------------- function test() { enterFunc ('test'); printBugNumber(BUGNUMBER); printStatus (summary); try { (function() { let (x = eval.call(<x/>.(1), "")) {} })(); } catch(ex) { printStatus('Note eval can no longer be called directly'); expect = /EvalError: (f|F)unction (eval|"eval") must be called directly, and not by way of a function of another name/; actual = ex + ''; } reportMatch(expect, actual, summary); exitFunc ('test'); }
{ "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 file import ( "github.com/zouyx/agollo/v4/env/config" ) //FileHandler 备份文件读写 type FileHandler interface { WriteConfigFile(config *config.ApolloConfig, configPath string) error GetConfigFile(configDir string, appID string, namespace string) string LoadConfigFile(configDir string, appID string, namespace string) (*config.ApolloConfig, error) }
{ "pile_set_name": "Github" }
#!/bin/sh # # 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/. # # runTests.sh # curdir=`pwd` cd ../../common . ./libpkix_init.sh > /dev/null cd ${curdir} numtests=0 passed=0 testunit=STORE ########## # main ########## ParseArgs $* RunTests <<EOF pkixutil test_store genericCertStore rev_data/crlchecker ${HOSTDIR} EOF totalErrors=$? html_msg ${totalErrors} 0 "&nbsp;&nbsp;&nbsp;${testunit}: passed ${passed} of ${numtests} tests" exit ${totalErrors}
{ "pile_set_name": "Github" }
/* * Hibernate Validator, declare and validate application constraints * * License: Apache License, Version 2.0 * See the license.txt file in the root directory or <http://www.apache.org/licenses/LICENSE-2.0>. */ package org.hibernate.validator.internal.constraintvalidators.bv.time.past; import java.time.Clock; import java.time.OffsetDateTime; /** * Check that the {@code java.time.OffsetDateTime} passed is in the past. * * @author Khalid Alqinyah * @author Guillaume Smet */ public class PastValidatorForOffsetDateTime extends AbstractPastJavaTimeValidator<OffsetDateTime> { @Override protected OffsetDateTime getReferenceValue(Clock reference) { return OffsetDateTime.now( reference ); } }
{ "pile_set_name": "Github" }
<?xml version="1.0" encoding="utf-8"?> <Project ToolsVersion="4.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003"> <PropertyGroup> <Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration> <Platform Condition=" '$(Platform)' == '' ">iPhoneSimulator</Platform> <ProductVersion>8.0.30703</ProductVersion> <SchemaVersion>2.0</SchemaVersion> <ProjectGuid>{85D69336-9BF4-4B53-BE5D-4006F4042465}</ProjectGuid> <ProjectTypeGuids>{FEACFBD2-3405-455C-9665-78FE426C6842};{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}</ProjectTypeGuids> <OutputType>Exe</OutputType> <RootNamespace>ButtonLogger.iOS</RootNamespace> <IPhoneResourcePrefix>Resources</IPhoneResourcePrefix> <AssemblyName>ButtonLoggeriOS</AssemblyName> <NuGetPackageImportStamp /> </PropertyGroup> <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|iPhoneSimulator' "> <DebugSymbols>true</DebugSymbols> <DebugType>full</DebugType> <Optimize>false</Optimize> <OutputPath>bin\iPhoneSimulator\Debug</OutputPath> <DefineConstants>DEBUG</DefineConstants> <ErrorReport>prompt</ErrorReport> <WarningLevel>4</WarningLevel> <ConsolePause>false</ConsolePause> <MtouchArch>x86_64</MtouchArch> <MtouchLink>None</MtouchLink> <MtouchDebug>true</MtouchDebug> <CodesignEntitlements /> </PropertyGroup> <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|iPhoneSimulator' "> <DebugType>none</DebugType> <Optimize>true</Optimize> <OutputPath>bin\iPhoneSimulator\Release</OutputPath> <ErrorReport>prompt</ErrorReport> <WarningLevel>4</WarningLevel> <MtouchLink>None</MtouchLink> <MtouchArch>x86_64</MtouchArch> <ConsolePause>false</ConsolePause> <CodesignEntitlements /> </PropertyGroup> <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|iPhone' "> <DebugSymbols>true</DebugSymbols> <DebugType>full</DebugType> <Optimize>false</Optimize> <OutputPath>bin\iPhone\Debug</OutputPath> <DefineConstants>DEBUG</DefineConstants> <ErrorReport>prompt</ErrorReport> <WarningLevel>4</WarningLevel> <ConsolePause>false</ConsolePause> <MtouchArch>ARM64</MtouchArch> <CodesignKey>iPhone Developer</CodesignKey> <MtouchDebug>true</MtouchDebug> <CodesignEntitlements>Entitlements.plist</CodesignEntitlements> </PropertyGroup> <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|iPhone' "> <DebugType>none</DebugType> <Optimize>true</Optimize> <OutputPath>bin\iPhone\Release</OutputPath> <ErrorReport>prompt</ErrorReport> <WarningLevel>4</WarningLevel> <MtouchArch>ARM64</MtouchArch> <ConsolePause>false</ConsolePause> <CodesignKey>iPhone Developer</CodesignKey> <CodesignEntitlements>Entitlements.plist</CodesignEntitlements> </PropertyGroup> <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Ad-Hoc|iPhone' "> <DebugType>none</DebugType> <Optimize>True</Optimize> <OutputPath>bin\iPhone\Ad-Hoc</OutputPath> <ErrorReport>prompt</ErrorReport> <WarningLevel>4</WarningLevel> <ConsolePause>False</ConsolePause> <MtouchArch>ARM64</MtouchArch> <BuildIpa>True</BuildIpa> <CodesignProvision>Automatic:AdHoc</CodesignProvision> <CodesignKey>iPhone Distribution</CodesignKey> <CodesignEntitlements>Entitlements.plist</CodesignEntitlements> </PropertyGroup> <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'AppStore|iPhone' "> <DebugType>none</DebugType> <Optimize>True</Optimize> <OutputPath>bin\iPhone\AppStore</OutputPath> <ErrorReport>prompt</ErrorReport> <WarningLevel>4</WarningLevel> <ConsolePause>False</ConsolePause> <MtouchArch>ARM64</MtouchArch> <CodesignProvision>Automatic:AppStore</CodesignProvision> <CodesignKey>iPhone Distribution</CodesignKey> <CodesignEntitlements>Entitlements.plist</CodesignEntitlements> </PropertyGroup> <ItemGroup> <PackageReference Include="Xamarin.Forms" Version="3.1.0.637273" /> </ItemGroup> <ItemGroup> <Compile Include="Main.cs" /> <Compile Include="AppDelegate.cs" /> <None Include="Entitlements.plist" /> <None Include="Info.plist" /> <Compile Include="Properties\AssemblyInfo.cs" /> <ITunesArtwork Include="iTunesArtwork" /> <ITunesArtwork Include="iTunesArtwork@2x" /> </ItemGroup> <ItemGroup> <ProjectReference Include="..\ButtonLogger\ButtonLogger.csproj"> <Name>ButtonLogger</Name> </ProjectReference> </ItemGroup> <ItemGroup> <BundleResource Include="Resources\Default-568h%402x.png" /> <BundleResource Include="Resources\Default-Portrait.png" /> <BundleResource Include="Resources\Default-Portrait%402x.png" /> <BundleResource Include="Resources\Default.png" /> <BundleResource Include="Resources\Default%402x.png" /> <BundleResource Include="Resources\Icon-60%402x.png" /> <BundleResource Include="Resources\Icon-60%403x.png" /> <BundleResource Include="Resources\Icon-76.png" /> <BundleResource Include="Resources\Icon-76%402x.png" /> <BundleResource Include="Resources\Icon-Small-40.png" /> <BundleResource Include="Resources\Icon-Small-40%402x.png" /> <BundleResource Include="Resources\Icon-Small-40%403x.png" /> <BundleResource Include="Resources\Icon-Small.png" /> <BundleResource Include="Resources\Icon-Small%402x.png" /> <BundleResource Include="Resources\Icon-Small%403x.png" /> <InterfaceDefinition Include="Resources\LaunchScreen.storyboard" /> </ItemGroup> <ItemGroup> <Reference Include="System" /> <Reference Include="System.Xml" /> <Reference Include="System.Core" /> <Reference Include="Xamarin.iOS" /> </ItemGroup> <Import Project="$(MSBuildExtensionsPath)\Xamarin\iOS\Xamarin.iOS.CSharp.targets" /> <Target Name="EnsureNuGetPackageBuildImports" BeforeTargets="PrepareForBuild"> <PropertyGroup /> </Target> </Project>
{ "pile_set_name": "Github" }
import { Observable } from '../../Observable'; import { _switch } from '../../operator/switch'; Observable.prototype.switch = _switch; Observable.prototype._switch = _switch; //# sourceMappingURL=switch.js.map
{ "pile_set_name": "Github" }
/*! * Chai - getActual utility * Copyright(c) 2012-2014 Jake Luer <jake@alogicalparadox.com> * MIT Licensed */ /** * ### .getActual(object, [actual]) * * Returns the `actual` value for an Assertion. * * @param {Object} object (constructed Assertion) * @param {Arguments} chai.Assertion.prototype.assert arguments * @namespace Utils * @name getActual */ module.exports = function getActual(obj, args) { return args.length > 4 ? args[4] : obj._obj; };
{ "pile_set_name": "Github" }
package net.sourceforge.vrapper.eclipse.keymap; import java.util.HashMap; import java.util.Queue; import net.sourceforge.vrapper.eclipse.commands.EclipseCommand; import net.sourceforge.vrapper.keymap.EmptyState; import net.sourceforge.vrapper.keymap.KeyMapInfo; import net.sourceforge.vrapper.keymap.State; import net.sourceforge.vrapper.log.VrapperLog; import net.sourceforge.vrapper.platform.PlatformSpecificStateProvider; import net.sourceforge.vrapper.vim.EditorAdaptor; import net.sourceforge.vrapper.vim.TextObjectProvider; import net.sourceforge.vrapper.vim.commands.Command; import net.sourceforge.vrapper.vim.commands.CommandExecutionException; import net.sourceforge.vrapper.vim.modes.AbstractVisualMode; import net.sourceforge.vrapper.vim.modes.ContentAssistMode; import net.sourceforge.vrapper.vim.modes.InsertMode; import net.sourceforge.vrapper.vim.modes.NormalMode; import net.sourceforge.vrapper.vim.modes.commandline.CommandLineMode; import net.sourceforge.vrapper.vim.modes.commandline.Evaluator; import net.sourceforge.vrapper.vim.modes.commandline.EvaluatorMapping; import org.eclipse.core.runtime.IConfigurationElement; /** * @see PlatformSpecificStateProvider */ public class AbstractEclipseSpecificStateProvider implements PlatformSpecificStateProvider, Comparable<AbstractEclipseSpecificStateProvider> { protected final HashMap<String, State<Command>> states = new HashMap<String, State<Command>>(); protected final HashMap<String, State<KeyMapInfo>> keyMaps = new HashMap<String, State<KeyMapInfo>>(); protected final EvaluatorMapping commands = new EvaluatorMapping(); protected int priority = 1; protected String name; protected TextObjectProvider textObjectProvider; protected AbstractEclipseSpecificStateProvider() { } public void configure(IConfigurationElement config) { try { String stringValue = config.getAttribute("priority"); name = config.getAttribute("name"); if (stringValue != null) priority = Integer.parseInt(stringValue); } catch (NumberFormatException e) { VrapperLog.error("wrong format of priority", e); } } @Override public final void initializeProvider(TextObjectProvider textObjProvider) { textObjectProvider = textObjProvider; states.put(NormalMode.NAME, normalModeBindings()); states.put(AbstractVisualMode.NAME, visualModeBindings()); keyMaps.put(NormalMode.NAME, normalModeKeymap()); keyMaps.put(AbstractVisualMode.NAME, visualModeKeymap()); states.put(InsertMode.NAME, insertModeBindings()); states.put(ContentAssistMode.NAME, contentAssistModeBindings()); } protected State<Command> normalModeBindings() { return EmptyState.getInstance(); } protected State<KeyMapInfo> normalModeKeymap() { return EmptyState.getInstance(); } protected State<Command> visualModeBindings() { return EmptyState.getInstance(); } protected State<KeyMapInfo> visualModeKeymap() { return EmptyState.getInstance(); } protected State<Command> insertModeBindings() { return EmptyState.getInstance(); } protected State<Command> contentAssistModeBindings() { return EmptyState.getInstance(); } protected static Command go(String where) { return new EclipseCommand("org.eclipse.ui.edit.text.goto." + where); } protected static Command cmd(String command) { return new EclipseCommand(command); } protected static EclipseCommand editText(String command) { return new EclipseCommand("org.eclipse.ui.edit.text." + command); } public String getName() { return name; } protected static class EclipseActionEvaluator implements Evaluator { private boolean force; private boolean async; protected EclipseActionEvaluator(boolean force, boolean async) { super(); this.force = force; this.async = async; } public Object evaluate(EditorAdaptor vim, Queue<String> command) throws CommandExecutionException { String name = command.poll(); if("!".equals(name)) { //we made a change where the '!' is separated from the command name //if that's the case (eclipseaction!), this isn't the name yet force = true; name = command.poll(); } String action = command.poll(); if (name != null && action != null) { CommandLineMode mode = (CommandLineMode) vim.getMode(CommandLineMode.NAME); mode.addCommand(name, new EclipseCommand(action, async), force); } return null; } } public String getFileType() { return "text"; } public State<Command> getState(String modeName) { return states.get(modeName); } public State<KeyMapInfo> getKeyMaps(String name) { return keyMaps.get(name); } public final EvaluatorMapping getCommands() { return commands; } protected void addFormatCommands(Command formatAll) { if (formatAll != null) { commands.add("formatall", formatAll); commands.add("format", formatAll); commands.add("fmt", formatAll); commands.add("fm", formatAll); } } public int compareTo(AbstractEclipseSpecificStateProvider o) { return -Integer.valueOf(priority).compareTo(Integer.valueOf(o.priority)); } }
{ "pile_set_name": "Github" }
/**************************************************************************** Copyright (c) 2013-2014 Chukong Technologies Inc. http://www.cocos2d-x.org 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. ****************************************************************************/ #ifndef __CCCOLLIDERDETECTOR_H__ #define __CCCOLLIDERDETECTOR_H__ #include "cocostudio/CCArmatureDefine.h" #include "cocostudio/CCDatas.h" #ifndef PT_RATIO #define PT_RATIO 32 #endif #if ENABLE_PHYSICS_CHIPMUNK_DETECT #include "chipmunk.h" #elif ENABLE_PHYSICS_BOX2D_DETECT #include "Box2D/Box2D.h" #endif namespace cocostudio { class Bone; /** * @js NA * @lua NA */ class ColliderFilter { public: virtual ~ColliderFilter() { } #if ENABLE_PHYSICS_BOX2D_DETECT public: ColliderFilter(uint16 categoryBits = 0x0001, uint16 maskBits = 0xFFFF, int16 groupIndex = 0); void updateShape(b2Fixture *fixture); virtual void setCategoryBits(uint16 categoryBits) { _categoryBits = categoryBits; } virtual uint16 getCategoryBits() const { return _categoryBits; } virtual void setMaskBits(uint16 maskBits) { _maskBits = maskBits; } virtual uint16 getMaskBits() const { return _maskBits; } virtual void setGroupIndex(int16 groupIndex) { _groupIndex = groupIndex; } virtual int16 getGroupIndex() const { return _groupIndex; } protected: uint16 _categoryBits; uint16 _maskBits; int16 _groupIndex; #elif ENABLE_PHYSICS_CHIPMUNK_DETECT public: ColliderFilter(cpCollisionType collisionType = 0, cpGroup group = 0); void updateShape(cpShape *shape); virtual void setCollisionType(cpCollisionType collisionType) { _collisionType = collisionType; } virtual cpCollisionType getCollisionType() const { return _collisionType; } virtual void setGroup(cpGroup group) { _group = group; } virtual cpGroup getGroup() const { return _group; } protected: cpCollisionType _collisionType; cpGroup _group; #endif }; class ColliderBody : public cocos2d::Object { public: ColliderBody(ContourData *contourData); ~ColliderBody(); inline ContourData *getContourData() { return _contourData; } #if ENABLE_PHYSICS_BOX2D_DETECT || ENABLE_PHYSICS_CHIPMUNK_DETECT void setColliderFilter(ColliderFilter *filter); ColliderFilter *getColliderFilter(); #endif #if ENABLE_PHYSICS_BOX2D_DETECT virtual void setB2Fixture(b2Fixture *fixture) { _fixture = fixture; } virtual b2Fixture *getB2Fixture() const { return _fixture; } #elif ENABLE_PHYSICS_CHIPMUNK_DETECT virtual void setShape(cpShape *shape) { _shape = shape; } virtual cpShape *getShape() const { return _shape; } #elif ENABLE_PHYSICS_SAVE_CALCULATED_VERTEX virtual const std::vector<cocos2d::Point> &getCalculatedVertexList() const { return _calculatedVertexList; } #endif private: #if ENABLE_PHYSICS_BOX2D_DETECT b2Fixture *_fixture; ColliderFilter *_filter; #elif ENABLE_PHYSICS_CHIPMUNK_DETECT cpShape *_shape; ColliderFilter *_filter; #elif ENABLE_PHYSICS_SAVE_CALCULATED_VERTEX std::vector<cocos2d::Point> _calculatedVertexList; #endif ContourData *_contourData; friend class ColliderDetector; }; /* * @brief ContourSprite used to draw the contour of the display * @js NA * @lua NA */ class ColliderDetector : public cocos2d::Object { public: static ColliderDetector *create(); static ColliderDetector *create(Bone *bone); public: /** * @js ctor */ ColliderDetector(); /** * @js NA * @lua NA */ ~ColliderDetector(void); virtual bool init(); virtual bool init(Bone *bone); void addContourData(ContourData *contourData); void addContourDataList(cocos2d::Vector<ContourData*> &contourDataList); void removeContourData(ContourData *contourData); void removeAll(); void updateTransform(kmMat4 &t); void setActive(bool active); bool getActive(); const cocos2d::Vector<ColliderBody*>& getColliderBodyList(); #if ENABLE_PHYSICS_BOX2D_DETECT || ENABLE_PHYSICS_CHIPMUNK_DETECT virtual void setColliderFilter(ColliderFilter *filter); virtual ColliderFilter *getColliderFilter(); #endif virtual void setBone(Bone *bone) { _bone = bone; } virtual Bone *getBone() const { return _bone; } #if ENABLE_PHYSICS_BOX2D_DETECT virtual void setBody(b2Body *body); virtual b2Body *getBody() const; #elif ENABLE_PHYSICS_CHIPMUNK_DETECT virtual void setBody(cpBody *body); virtual cpBody *getBody() const; #endif protected: cocos2d::Vector<ColliderBody*> _colliderBodyList; Bone *_bone; #if ENABLE_PHYSICS_BOX2D_DETECT b2Body *_body; ColliderFilter *_filter; #elif ENABLE_PHYSICS_CHIPMUNK_DETECT cpBody *_body; ColliderFilter *_filter; #endif protected: bool _active; }; } #endif /*__CCCOLLIDERDETECTOR_H__*/
{ "pile_set_name": "Github" }
1. Click "Init editors". 2. Expected: * Two inline editor should be created. * Elements used as editables should remain visible. * They should preserve `.custom-class` and `custom-attr="foo"`. * There should be floating toolbars with "Bold", "Italic", "Undo", "Redo", "Link" and "Unlink" buttons. 3. Scroll the webpage. 4. Expected: * Focused editor's toolbar should float around but always stick to editable. * Focused editor's toolbar should stick to the bottom of the editable if there's not enough space above. 5. Press <kbd>Alt+F10</kbd> when focusing the editor. 6. Expected: * Toolbar should gain focus. Editable should keep its styling. 7. Click "Destroy editors". 8. Expected: * Editors should be destroyed. * Element used as editables should remain visible. * They should preserve `.custom-class` and `custom-attr="foo"`. * Elements should contain its data (updated). * `.ck-body` regions should be removed from `<body>`. ## Notes: * You can play with: * `window.editables[ N ].isReadOnly`, * Changes to `window.editors[ name ].focusTracker.isFocused` should be logged to the console. * Features should work.
{ "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/html; charset=UTF-8" /> <title></title> <meta http-equiv="X-UA-Compatible" content="IE=Edge" /> <link rel="stylesheet" type="text/css" href="../css/style.css" /> </head> <body> <div class="megasync-overlay"> <div class="megasync-content"> <div class="megasync-logo"></div> <div class="megasync-info">MEGAsync is being downloaded to your computer. Please install it as soon as the download has completed.<br />Once MEGAsync is running, your file will start downloading automatically.</div> <div class="megasync-dropdown"> <span>Please select your Linux Distro</span> </div> <div class="megasync-dropdown-list hidden"> <div class="megasync-dropdown-pad"> <div class="megasync-dropdown-scroll"> <div class="megasync-scr-pad"> <div class="megasync-dropdown-link centos">CentOS 7.0</div> <div class="megasync-dropdown-link debian">Debian 7.0</div> <div class="megasync-dropdown-link debian">Debian 8.0</div> <div class="megasync-dropdown-link elementary">Elementary OS Freya</div> <div class="megasync-dropdown-link fedora">Fedora 19</div> <div class="megasync-dropdown-link fedora">Fedora 20</div> <div class="megasync-dropdown-link fedora">Fedora 21</div> <div class="megasync-dropdown-link mint">Mint 17</div> <div class="megasync-dropdown-link opensuse">OpenSUSE 12.2</div> <div class="megasync-dropdown-link opensuse">OpenSUSE 12.3</div> <div class="megasync-dropdown-link opensuse">OpenSUSE 13.1</div> <div class="megasync-dropdown-link opensuse">OpenSUSE 13.2</div> <div class="megasync-dropdown-link redhat">Red Hat 7</div> <div class="megasync-dropdown-link ubuntu">Ubuntu 12.04</div> <div class="megasync-dropdown-link ubuntu">Ubuntu 12.10</div> <div class="megasync-dropdown-link ubuntu">Ubuntu 13.10</div> <div class="megasync-dropdown-link ubuntu">Ubuntu 14.04</div> <div class="megasync-dropdown-link ubuntu">Ubuntu 14.10</div> <div class="megasync-dropdown-link ubuntu">Ubuntu 15.04</div> </div> </div> <div class="megasync-list-arrow hidden"></div> </div> </div> <div class="megasync-table"> <table border="0" cellspacing="0" cellpadding="0"> <tr> <th> </th> <th> <span class="globe">Web Browser</span> </th> <th> <span class="sync">MEGAsync</span> </th> </tr> <tr> <td> <span>Transfer Speed:</span> </td> <td> <span class="dots">Fast</span> </td> <td> <span class="tick">FASTER</span> </td> </tr> <tr> <td> <span>Resource Usage:</span> </td> <td> <span class="dots">Gluttonous</span> </td> <td> <span class="tick">LEAN & MEAN</span> </td> </tr> <tr> <td> <span>File Size:</span> </td> <td> <span class="dots">Limited</span> </td> <td> <span class="tick">UNLIMITED</span> </td> </tr> </table> </div> </div> </div> </body> </html>
{ "pile_set_name": "Github" }
@{ ViewData["Title"] = "Multi Column Responsive Dialog"; } @section ContentHeader { <h1>@ViewData["Title"]<small></small></h1> } <div class="alert alert-info alert-dismissable"> <button type="button" class="close" data-dismiss="alert" aria-hidden="true">&times;</button> <p>This sample demonstrates how to design responsive forms with multiple columns.</p> <p>A subclass of order dialog is styled with CSS to make it more compact.</p> <p>Open dialog then try resizing / maximizing dialog and window.</p> <p>This example uses flex box. See Responsive Dialog sample for more info.</p> <p style="text-align: right;"><b>Source Files:</b> @Html.AppSourceFile("Index.cshtml"), @Html.AppSourceFile("MultiColumnResponsiveDialog.ts") @Html.AppSourceFile("MultiColumnResponsiveGrid.ts") </p> </div> <div id="GridDiv"></div> <script type="text/javascript"> jQuery(function () { new Serene.BasicSamples.MultiColumnResponsiveGrid($('#GridDiv'), {}).init(); Q.initFullHeightGridPage($('#GridDiv')); }); </script>
{ "pile_set_name": "Github" }
// // TMQuiltViewController.m // TMQuiltView // // Created by Bruno Virlet on 7/20/12. // // Copyright (c) 2012 1000memories // 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. // #import "TMQuiltViewController.h" #import "TMQuiltView.h" #import "TMQuiltViewCell.h" @interface TMQuiltViewController () <TMQuiltViewDataSource, TMQuiltViewDelegate> @end @implementation TMQuiltViewController @synthesize quiltView = _quiltView; - (void)dealloc { [_quiltView release], _quiltView = nil; [super dealloc]; } - (void)loadView { _quiltView = [[TMQuiltView alloc] initWithFrame:CGRectZero]; _quiltView.delegate = self; _quiltView.dataSource = self; _quiltView.autoresizingMask = UIViewAutoresizingFlexibleHeight | UIViewAutoresizingFlexibleWidth; self.view = _quiltView; } - (void)viewDidLoad { [super viewDidLoad]; [self.quiltView reloadData]; } - (void)viewDidUnload { [super viewDidUnload]; self.quiltView = nil; } - (void)willRotateToInterfaceOrientation:(UIInterfaceOrientation)toInterfaceOrientation duration:(NSTimeInterval)duration { [self.quiltView reloadData]; } #pragma mark - TMQuiltViewDataSource - (NSInteger)quiltViewNumberOfCells:(TMQuiltView *)quiltView { return 0; } - (TMQuiltViewCell *)quiltView:(TMQuiltView *)quiltView cellAtIndexPath:(NSIndexPath *)indexPath { TMQuiltViewCell *cell = [self.quiltView dequeueReusableCellWithReuseIdentifier:nil]; if (!cell) { cell = [[[TMQuiltViewCell alloc] initWithReuseIdentifier:nil] autorelease]; } return cell; } @end
{ "pile_set_name": "Github" }
<?xml version="1.0" encoding="utf-8"?> <Project DefaultTargets="Build" ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003"> <PropertyGroup> <Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration> <Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform> <ProjectGuid>{44C36EB9-F502-41EC-B5B0-24364F7B935F}</ProjectGuid> <ProjectTypeGuids>{EFBA0AD7-5A72-4C68-AF49-83D382785DCF};{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}</ProjectTypeGuids> <OutputType>Library</OutputType> <RootNamespace>SampleBrowser.SfCarousel.Droid</RootNamespace> <AssemblyName>SampleBrowser.SfCarousel.Android</AssemblyName> <TargetFrameworkVersion>v9.0</TargetFrameworkVersion> <AndroidApplication>True</AndroidApplication> <AndroidResgenFile>Resources\Resource.designer.cs</AndroidResgenFile> <AndroidResgenClass>Resource</AndroidResgenClass> <AndroidManifest>Properties\AndroidManifest.xml</AndroidManifest> <MonoAndroidResourcePrefix>Resources</MonoAndroidResourcePrefix> <MonoAndroidAssetsPrefix>Assets</MonoAndroidAssetsPrefix> <NuGetPackageImportStamp> </NuGetPackageImportStamp> </PropertyGroup> <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' "> <DebugSymbols>true</DebugSymbols> <DebugType>full</DebugType> <Optimize>false</Optimize> <OutputPath>bin\Debug</OutputPath> <DefineConstants>DEBUG;</DefineConstants> <ErrorReport>prompt</ErrorReport> <WarningLevel>4</WarningLevel> <AndroidLinkMode>None</AndroidLinkMode> <AndroidEnableMultiDex>true</AndroidEnableMultiDex> <AndroidSupportedAbis>armeabi-v7a;x86</AndroidSupportedAbis> </PropertyGroup> <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' "> <DebugSymbols>true</DebugSymbols> <DebugType>pdbonly</DebugType> <Optimize>true</Optimize> <OutputPath>bin\Release</OutputPath> <ErrorReport>prompt</ErrorReport> <WarningLevel>4</WarningLevel> <AndroidManagedSymbols>true</AndroidManagedSymbols> <AndroidUseSharedRuntime>false</AndroidUseSharedRuntime> <AndroidSupportedAbis>armeabi-v7a;x86</AndroidSupportedAbis> <AotAssemblies>false</AotAssemblies> <EnableLLVM>false</EnableLLVM> <BundleAssemblies>false</BundleAssemblies> <AndroidEnableMultiDex>true</AndroidEnableMultiDex> </PropertyGroup> <PropertyGroup Condition="'$(Configuration)|$(Platform)' == 'Release-xml|AnyCPU'"> <DebugSymbols>true</DebugSymbols> <OutputPath>bin\Release-xml\</OutputPath> <Optimize>true</Optimize> <DebugType>pdbonly</DebugType> <PlatformTarget>AnyCPU</PlatformTarget> <GenerateSerializationAssemblies>Off</GenerateSerializationAssemblies> <ErrorReport>prompt</ErrorReport> <CodeAnalysisRuleSet>MinimumRecommendedRules.ruleset</CodeAnalysisRuleSet> <AotAssemblies>false</AotAssemblies> <EnableLLVM>false</EnableLLVM> <BundleAssemblies>false</BundleAssemblies> <AndroidEnableMultiDex>true</AndroidEnableMultiDex> <AndroidSupportedAbis>armeabi-v7a;x86</AndroidSupportedAbis> </PropertyGroup> <ItemGroup> <Reference Include="Mono.Android" /> <Reference Include="System" /> <Reference Include="System.Core" /> <Reference Include="System.Xml.Linq" /> <Reference Include="System.Xml" /> </ItemGroup> <ItemGroup> <PackageReference Include="SampleBrowser.Core"> <Version>18.2.0.44</Version> </PackageReference> <PackageReference Include="Syncfusion.Xamarin.Core"> <Version>18.2.0.44</Version> </PackageReference> <PackageReference Include="Syncfusion.Xamarin.SfCarousel"> <Version>18.2.0.44</Version> </PackageReference> <PackageReference Include="Syncfusion.Xamarin.DataSource"> <Version>18.2.0.44</Version> </PackageReference> <PackageReference Include="Syncfusion.Xamarin.GridCommon"> <Version>18.2.0.44</Version> </PackageReference> <PackageReference Include="Syncfusion.Xamarin.SfListView"> <Version>18.2.0.44</Version> </PackageReference> <PackageReference Include="Syncfusion.Xamarin.SfNumericUpDown"> <Version>18.2.0.44</Version> </PackageReference> <PackageReference Include="Xamarin.Android.Support.v17.Leanback"> <Version>28.0.0.1</Version> </PackageReference> <PackageReference Include="Xamarin.Android.Support.Design" Version="28.0.0.1" /> <PackageReference Include="Xamarin.Android.Support.v7.AppCompat" Version="28.0.0.1" /> <PackageReference Include="Xamarin.Android.Support.v4" Version="28.0.0.1" /> <PackageReference Include="Xamarin.Android.Support.v7.CardView" Version="28.0.0.1" /> <PackageReference Include="Xamarin.Android.Support.v7.MediaRouter" Version="28.0.0.1" /> <PackageReference Include="Xamarin.Forms"> <Version>3.6.0.344457</Version> </PackageReference> </ItemGroup> <ItemGroup> <Compile Include="MainActivity.cs" /> <Compile Include="Resources\Resource.Designer.cs" /> <Compile Include="Properties\AssemblyInfo.cs" /> <Compile Include="SplashScreenActivity.cs" /> </ItemGroup> <ItemGroup> <AndroidAsset Include="Assets\carousel.ttf" /> <AndroidAsset Include="Assets\CarouselIcon.ttf" /> <None Include="Resources\AboutResources.txt" /> <None Include="Assets\AboutAssets.txt" /> </ItemGroup> <ItemGroup> <None Include="Properties\AndroidManifest.xml" /> </ItemGroup> <ItemGroup> <AndroidResource Include="Resources\layout\Tabbar.axml" /> <AndroidResource Include="Resources\layout\Toolbar.axml" /> <AndroidResource Include="Resources\values\styles.xml"> <SubType>Designer</SubType> </AndroidResource> </ItemGroup> <ItemGroup> <AndroidResource Include="..\..\Resources\Image\People\Person1.jpg"> <Link>Resources\drawable\Person1.jpg</Link> </AndroidResource> </ItemGroup> <ItemGroup> <AndroidResource Include="..\..\Resources\Image\People\Person2.jpg"> <Link>Resources\drawable\Person2.jpg</Link> </AndroidResource> </ItemGroup> <ItemGroup> <AndroidResource Include="..\..\Resources\Image\People\Person3.jpg"> <Link>Resources\drawable\Person3.jpg</Link> </AndroidResource> </ItemGroup> <ItemGroup> <AndroidResource Include="..\..\Resources\Image\People\Person4.jpg"> <Link>Resources\drawable\Person4.jpg</Link> </AndroidResource> </ItemGroup> <ItemGroup> <AndroidResource Include="..\..\Resources\Image\People\Person5.jpg"> <Link>Resources\drawable\Person5.jpg</Link> </AndroidResource
{ "pile_set_name": "Github" }
module MarkdownUI class PaddedSegment def initialize(element, content) @element = element @content = content end def render element = @element.strip content = @content.strip klass = "ui #{element} padded segment" MarkdownUI::SectionTag.new(content, klass).render end end end
{ "pile_set_name": "Github" }
package com.quickblox.sample.conference.utils; import android.Manifest; /** * QuickBlox team */ public interface Consts { String DEFAULT_USER_PASSWORD = "x6Bt0VDy5"; String VERSION_NUMBER = "1.0"; int CALL_ACTIVITY_CLOSE = 1000; int ERR_LOGIN_ALREADY_TAKEN_HTTP_STATUS = 422; int ERR_MSG_DELETING_HTTP_STATUS = 401; //CALL ACTIVITY CLOSE REASONS int CALL_ACTIVITY_CLOSE_WIFI_DISABLED = 1001; String WIFI_DISABLED = "wifi_disabled"; String OPPONENTS = "opponents"; String CONFERENCE_TYPE = "conference_type"; String EXTRA_TAG = "currentRoomName"; int MAX_OPPONENTS_COUNT = 6; String PREF_CURREN_ROOM_NAME = "current_room_name"; String EXTRA_USER_ID = "user_id"; String EXTRA_USER_LOGIN = "user_login"; String EXTRA_USER_PASSWORD = "user_password"; String EXTRA_DIALOG_ID = "dialog_id"; String EXTRA_DIALOG_OCCUPANTS = "dialog_occupants"; String EXTRA_AS_LISTENER = "as_listener"; String EXTRA_DIALOG_IS_VIDEO = "dialog_is_video"; String EXTRA_PENDING_INTENT = "pending_Intent"; String EXTRA_LOGIN_RESULT = "login_result"; String EXTRA_LOGIN_ERROR_MESSAGE = "login_error_message"; int EXTRA_LOGIN_RESULT_CODE = 1002; String[] PERMISSIONS = {Manifest.permission.CAMERA, Manifest.permission.RECORD_AUDIO}; }
{ "pile_set_name": "Github" }
// Copyright Aleksey Gurtovoy 2000-2004 // // Distributed under the Boost Software License, Version 1.0. // (See accompanying file LICENSE_1_0.txt or copy at // http://www.boost.org/LICENSE_1_0.txt) // // Preprocessed version of "boost/mpl/plus.hpp" header // -- DO NOT modify by hand! namespace boost { namespace mpl { template< typename Tag1 , typename Tag2 , BOOST_MPL_AUX_NTTP_DECL(int, tag1_) = BOOST_MPL_AUX_MSVC_VALUE_WKND(Tag1)::value , BOOST_MPL_AUX_NTTP_DECL(int, tag2_) = BOOST_MPL_AUX_MSVC_VALUE_WKND(Tag2)::value > struct plus_impl : if_c< ( tag1_ > tag2_ ) , aux::cast2nd_impl< plus_impl< Tag1,Tag1 >,Tag1, Tag2 > , aux::cast1st_impl< plus_impl< Tag2,Tag2 >,Tag1, Tag2 > >::type { }; /// for Digital Mars C++/compilers with no CTPS/TTP support template<> struct plus_impl< na,na > { template< typename U1, typename U2 > struct apply { typedef apply type; BOOST_STATIC_CONSTANT(int, value = 0); }; }; template<> struct plus_impl< na,integral_c_tag > { template< typename U1, typename U2 > struct apply { typedef apply type; BOOST_STATIC_CONSTANT(int, value = 0); }; }; template<> struct plus_impl< integral_c_tag,na > { template< typename U1, typename U2 > struct apply { typedef apply type; BOOST_STATIC_CONSTANT(int, value = 0); }; }; template< typename T > struct plus_tag { typedef typename T::tag type; }; /// forward declaration template< typename BOOST_MPL_AUX_NA_PARAM(N1) , typename BOOST_MPL_AUX_NA_PARAM(N2) > struct plus2; template< typename BOOST_MPL_AUX_NA_PARAM(N1) , typename BOOST_MPL_AUX_NA_PARAM(N2) , typename N3 = na, typename N4 = na, typename N5 = na > struct plus : if_< is_na<N3> , plus2< N1,N2 > , plus< plus2< N1,N2 > , N3, N4, N5 > >::type { BOOST_MPL_AUX_LAMBDA_SUPPORT( 5 , plus , ( N1, N2, N3, N4, N5 ) ) }; template< typename N1 , typename N2 > struct plus2 : aux::msvc_eti_base< typename apply_wrap2< plus_impl< typename plus_tag<N1>::type , typename plus_tag<N2>::type > , N1 , N2 >::type >::type { BOOST_MPL_AUX_LAMBDA_SUPPORT(2, plus2, (N1, N2)) }; BOOST_MPL_AUX_NA_SPEC2(2, 5, plus) }} namespace boost { namespace mpl { namespace aux { template< typename T, T n1, T n2 > struct plus_wknd { BOOST_STATIC_CONSTANT(T, value = (n1 + n2)); typedef integral_c< T,value > type; }; } template<> struct plus_impl< integral_c_tag,integral_c_tag > { template< typename N1, typename N2 > struct apply : aux::plus_wknd< typename aux::largest_int< typename N1::value_type , typename N2::value_type >::type , N1::value , N2::value >::type { }; }; }}
{ "pile_set_name": "Github" }
#import "EXPMatchers+beNil.h" #import "EXPMatchers+equal.h" #import "EXPMatchers+beInstanceOf.h" #import "EXPMatchers+beKindOf.h" #import "EXPMatchers+beSubclassOf.h" #import "EXPMatchers+conformTo.h" #import "EXPMatchers+beTruthy.h" #import "EXPMatchers+beFalsy.h" #import "EXPMatchers+contain.h" #import "EXPMatchers+beSupersetOf.h" #import "EXPMatchers+haveCountOf.h" #import "EXPMatchers+beIdenticalTo.h" #import "EXPMatchers+beGreaterThan.h" #import "EXPMatchers+beGreaterThanOrEqualTo.h" #import "EXPMatchers+beLessThan.h" #import "EXPMatchers+beLessThanOrEqualTo.h" #import "EXPMatchers+beInTheRangeOf.h" #import "EXPMatchers+beCloseTo.h" #import "EXPMatchers+raise.h" #import "EXPMatchers+raiseWithReason.h" #import "EXPMatchers+respondTo.h" #import "EXPMatchers+notify.h" #import "EXPMatchers+beginWith.h" #import "EXPMatchers+endWith.h"
{ "pile_set_name": "Github" }
foo bar hop
{ "pile_set_name": "Github" }
// Go support for leveled logs, analogous to https://code.google.com/p/google-glog/ // // Copyright 2013 Google Inc. 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. // Package klog implements logging analogous to the Google-internal C++ INFO/ERROR/V setup. // It provides functions Info, Warning, Error, Fatal, plus formatting variants such as // Infof. It also provides V-style logging controlled by the -v and -vmodule=file=2 flags. // // Basic examples: // // klog.Info("Prepare to repel boarders") // // klog.Fatalf("Initialization failed: %s", err) // // See the documentation for the V function for an explanation of these examples: // // if klog.V(2) { // klog.Info("Starting transaction...") // } // // klog.V(2).Infoln("Processed", nItems, "elements") // // Log output is buffered and written periodically using Flush. Programs // should call Flush before exiting to guarantee all log output is written. // // By default, all log statements write to standard error. // This package provides several flags that modify this behavior. // As a result, flag.Parse must be called before any logging is done. // // -logtostderr=true // Logs are written to standard error instead of to files. // -alsologtostderr=false // Logs are written to standard error as well as to files. // -stderrthreshold=ERROR // Log events at or above this severity are logged to standard // error as well as to files. // -log_dir="" // Log files will be written to this directory instead of the // default temporary directory. // // Other flags provide aids to debugging. // // -log_backtrace_at="" // When set to a file and line number holding a logging statement, // such as // -log_backtrace_at=gopherflakes.go:234 // a stack trace will be written to the Info log whenever execution // hits that statement. (Unlike with -vmodule, the ".go" must be // present.) // -v=0 // Enable V-leveled logging at the specified level. // -vmodule="" // The syntax of the argument is a comma-separated list of pattern=N, // where pattern is a literal file name (minus the ".go" suffix) or // "glob" pattern and N is a V level. For instance, // -vmodule=gopher*=3 // sets the V level to 3 in all Go files whose names begin "gopher". // package klog import ( "bufio" "bytes" "errors" "flag" "fmt" "io" stdLog "log" "math" "os" "path/filepath" "runtime" "strconv" "strings" "sync" "sync/atomic" "time" "github.com/go-logr/logr" ) // severity identifies the sort of log: info, warning etc. It also implements // the flag.Value interface. The -stderrthreshold flag is of type severity and // should be modified only through the flag.Value interface. The values match // the corresponding constants in C++. type severity int32 // sync/atomic int32 // These constants identify the log levels in order of increasing severity. // A message written to a high-severity log file is also written to each // lower-severity log file. const ( infoLog severity = iota warningLog errorLog fatalLog numSeverity = 4 ) const severityChar = "IWEF" var severityName = []string{ infoLog: "INFO", warningLog: "WARNING", errorLog: "ERROR", fatalLog: "FATAL", } // get returns the value of the severity. func (s *severity) get() severity { return severity(atomic.LoadInt32((*int32)(s))) } // set sets the value of the severity. func (s *severity) set(val severity) { atomic.StoreInt32((*int32)(s), int32(val)) } // String is part of the flag.Value interface. func (s *severity) String() string { return strconv.FormatInt(int64(*s), 10) } // Get is part of the flag.Getter interface. func (s *severity) Get() interface{} { return *s } // Set is part of the flag.Value interface. func (s *severity) Set(value string) error { var threshold severity // Is it a known name? if v, ok := severityByName(value); ok { threshold = v } else { v, err := strconv.ParseInt(value, 10, 32) if err != nil { return err } threshold = severity(v) } logging.stderrThreshold.set(threshold) return nil } func severityByName(s string) (severity, bool) { s = strings.ToUpper(s) for i, name := range severityName { if name == s { return severity(i), true } } return 0, false } // OutputStats tracks the number of output lines and bytes written. type OutputStats struct { lines int64 bytes int64 } // Lines returns the number of lines written. func (s *OutputStats) Lines() int64 { return atomic.LoadInt64(&s.lines) } // Bytes returns the number of bytes written. func (s *OutputStats) Bytes() int64 { return atomic.LoadInt64(&s.bytes) } // Stats tracks the number of lines of output and number of bytes // per severity level. Values must be read with atomic.LoadInt64. var Stats struct { Info, Warning, Error OutputStats } var severityStats = [numSeverity]*OutputStats{ infoLog: &Stats.Info, warningLog: &Stats.Warning, errorLog: &Stats.Error, } // Level is exported because it appears in the arguments to V and is // the type of the v flag, which can be set programmatically. // It's a distinct type because we want to discriminate it from logType. // Variables of type level are only changed under logging.mu. // The -v flag is read only with atomic ops, so the state of the logging // module is consistent. // Level is treated as a sync/atomic int32. // Level specifies a level of verbosity for V logs. *Level implements // flag.Value; the -v flag is of type Level and should be modified // only through the flag.Value interface. type Level int32 // get returns the value of the Level. func (l *Level) get() Level { return Level(atomic.LoadInt32((*int32)(l))) } // set sets the value of the Level. func (l *Level) set(val Level) { atomic.StoreInt32((*int32)(l), int32(val)) } // String is part of the flag.Value interface. func (l *Level) String() string { return strconv.FormatInt(int64(*l), 10) } // Get is part of the flag.Getter interface. func (l *Level) Get() interface{} { return *l } // Set is part of the flag.Value interface. func (l *Level) Set(value string) error { v, err := strconv.ParseInt(value, 10, 32) if err != nil { return err
{ "pile_set_name": "Github" }
/* * This file is a part of the Cairo-Dock project * * Copyright : (C) see the 'copyright' file. * E-mail : see the 'copyright' file. * * This program is free software; you can redistribute it and/or * modify it under the terms of the GNU General Public License * as published by the Free Software Foundation; either version 3 * of the License, or (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * You should have received a copy of the GNU General Public License * along with this program. If not, see <http://www.gnu.org/licenses/>. */ #ifndef __CAIRO_DOCK_APPLICATION_FACILITY__ #define __CAIRO_DOCK_APPLICATION_FACILITY__ #include <glib.h> #include "cairo-dock-struct.h" G_BEGIN_DECLS /* *@file cairo-dock-application-facility.h A set of utilities for handling appli-icons. */ void gldi_appli_icon_demands_attention (Icon *icon); // applications-manager void gldi_appli_icon_stop_demanding_attention (Icon *icon); // applications-manager void gldi_appli_icon_animate_on_active (Icon *icon, CairoDock *pParentDock); // applications-manager CairoDock *gldi_appli_icon_insert_in_dock (Icon *icon, CairoDock *pMainDock, gboolean bAnimate); CairoDock *gldi_appli_icon_detach (Icon *pIcon); void gldi_appli_icon_set_geometry_for_window_manager (Icon *icon, CairoDock *pDock); void gldi_appli_reserve_geometry_for_window_manager (GldiWindowActor *pAppli, Icon *icon, CairoDock *pMainDock); // applications-manager const CairoDockImageBuffer *gldi_appli_icon_get_image_buffer (Icon *pIcon); void gldi_window_inhibitors_set_name (GldiWindowActor *actor, const gchar *cNewName); // applications-manager void gldi_window_inhibitors_set_active_state (GldiWindowActor *actor, gboolean bActive); // applications-manager void gldi_window_inhibitors_set_hidden_state (GldiWindowActor *actor, gboolean bIsHidden); // applications-manager G_END_DECLS #endif
{ "pile_set_name": "Github" }
'use strict'; process.stdin.resume(); process.stdin.setEncoding('utf-8'); let inputString = ''; let currentLine = 0; process.stdin.on('data', inputStdin => { inputString += inputStdin; }); process.stdin.on('end', _ => { inputString = inputString.trim().split('\n').map(string => { return string.trim(); }); main(); }); function readLine() { return inputString[currentLine++]; } /* * Complete the isPositive function. * If 'a' is positive, return "YES". * If 'a' is 0, throw an Error with the message "Zero Error" * If 'a' is negative, throw an Error with the message "Negative Error" */ function isPositive(a) { if (a > 0) { return 'YES'; } else if (a === 0) { throw new Error('Zero Error'); } else { throw new Error('Negative Error'); } } function main() { const n = +(readLine()); for (let i = 0; i < n; i++) { const a = +(readLine()); try { console.log(isPositive(a)); } catch (e) { console.log(e.message); } } }
{ "pile_set_name": "Github" }
/** * @license * Copyright The Closure Library Authors. * SPDX-License-Identifier: Apache-2.0 */ goog.module('goog.dom.vendorTest'); goog.setTestOnly(); const MockUserAgent = goog.require('goog.testing.MockUserAgent'); const PropertyReplacer = goog.require('goog.testing.PropertyReplacer'); const googArray = goog.require('goog.array'); const testSuite = goog.require('goog.testing.testSuite'); const userAgent = goog.require('goog.userAgent'); const userAgentTestUtil = goog.require('goog.userAgentTestUtil'); const util = goog.require('goog.labs.userAgent.util'); const vendor = goog.require('goog.dom.vendor'); let documentMode; let mockUserAgent; const propertyReplacer = new PropertyReplacer(); let getDocumentMode = () => documentMode; const UserAgents = { GECKO: 'GECKO', IE: 'IE', OPERA: 'OPERA', WEBKIT: 'WEBKIT' }; /** * Return whether a given user agent has been detected. * @param {number} agent Value in UserAgents. * @return {boolean} Whether the user agent has been detected. */ function getUserAgentDetected(agent) { switch (agent) { case UserAgents.GECKO: return userAgent.GECKO; case UserAgents.IE: return userAgent.IE; case UserAgents.OPERA: return userAgent.OPERA; case UserAgents.WEBKIT: return userAgent.WEBKIT; } return null; } /** * Test browser detection for a user agent configuration. * @param {Array<number>} expectedAgents Array of expected userAgents. * @param {string} uaString User agent string. * @param {string=} product Navigator product string. * @param {string=} opt_vendor Navigator vendor string. */ function assertUserAgent( expectedAgents, uaString, product = undefined, opt_vendor) { const mockNavigator = { 'userAgent': uaString, 'product': product, 'vendor': opt_vendor }; mockUserAgent.setNavigator(mockNavigator); mockUserAgent.setUserAgentString(uaString); // Force reread of navigator.userAgent; util.setUserAgent(null); userAgentTestUtil.reinitializeUserAgent(); for (let ua in UserAgents) { const isExpected = googArray.contains(expectedAgents, UserAgents[ua]); assertEquals(isExpected, getUserAgentDetected(UserAgents[ua])); } } function assertIe(uaString, expectedVersion) { assertUserAgent([UserAgents.IE], uaString); assertEquals( `User agent ${uaString} should have had version ${expectedVersion}` + ' but had ' + userAgent.VERSION, expectedVersion, userAgent.VERSION); } function assertGecko(uaString, expectedVersion) { assertUserAgent([UserAgents.GECKO], uaString, 'Gecko'); assertEquals( `User agent ${uaString} should have had version ${expectedVersion}` + ' but had ' + userAgent.VERSION, expectedVersion, userAgent.VERSION); } testSuite({ setUp() { mockUserAgent = new MockUserAgent(); mockUserAgent.install(); }, tearDown() { goog.dispose(mockUserAgent); documentMode = undefined; propertyReplacer.reset(); }, /** Tests for the vendor prefix for Webkit. */ testVendorPrefixWebkit() { assertUserAgent([UserAgents.WEBKIT], 'WebKit'); assertEquals('-webkit', vendor.getVendorPrefix()); }, /** Tests for the vendor prefix for Mozilla/Gecko. */ testVendorPrefixGecko() { assertUserAgent([UserAgents.GECKO], 'Gecko', 'Gecko'); assertEquals('-moz', vendor.getVendorPrefix()); }, /** Tests for the vendor prefix for Opera. */ testVendorPrefixOpera() { assertUserAgent([UserAgents.OPERA], 'Opera'); assertEquals('-o', vendor.getVendorPrefix()); }, /** Tests for the vendor prefix for IE. */ testVendorPrefixIE() { assertUserAgent([UserAgents.IE], 'MSIE'); assertEquals('-ms', vendor.getVendorPrefix()); }, /** Tests for the vendor Js prefix for Webkit. */ testVendorJsPrefixWebkit() { assertUserAgent([UserAgents.WEBKIT], 'WebKit'); assertEquals('Webkit', vendor.getVendorJsPrefix()); }, /** Tests for the vendor Js prefix for Mozilla/Gecko. */ testVendorJsPrefixGecko() { assertUserAgent([UserAgents.GECKO], 'Gecko', 'Gecko'); assertEquals('Moz', vendor.getVendorJsPrefix()); }, /** Tests for the vendor Js prefix for Opera. */ testVendorJsPrefixOpera() { assertUserAgent([UserAgents.OPERA], 'Opera'); assertEquals('O', vendor.getVendorJsPrefix()); }, /** Tests for the vendor Js prefix for IE. */ testVendorJsPrefixIE() { assertUserAgent([UserAgents.IE], 'MSIE'); assertEquals('ms', vendor.getVendorJsPrefix()); }, /** Tests for the vendor Js prefix if no UA detected. */ testVendorJsPrefixNone() { assertUserAgent([], ''); assertNull(vendor.getVendorJsPrefix()); }, /** Tests for the prefixed property name on Webkit. */ testPrefixedPropertyNameWebkit() { assertUserAgent([UserAgents.WEBKIT], 'WebKit'); assertEquals('webkitFoobar', vendor.getPrefixedPropertyName('foobar')); }, /** Tests for the prefixed property name on Webkit in an object. */ testPrefixedPropertyNameWebkitAndObject() { const mockDocument = { // setting a value of 0 on purpose, to ensure we only look for property // names, not their values. 'webkitFoobar': 0, }; assertUserAgent([UserAgents.WEBKIT], 'WebKit'); assertEquals( 'webkitFoobar', vendor.getPrefixedPropertyName('foobar', mockDocument)); }, /** Tests for the prefixed property name. */ testPrefixedPropertyName() { assertUserAgent([], ''); assertNull(vendor.getPrefixedPropertyName('foobar')); }, /** Tests for the prefixed property name in an object. */ testPrefixedPropertyNameAndObject() { const mockDocument = {'foobar': 0}; assertUserAgent([], ''); assertEquals( 'foobar', vendor.getPrefixedPropertyName('foobar', mockDocument)); }, /** Tests for the prefixed property name when it doesn't exist. */ testPrefixedPropertyNameAndObjectIsEmpty() { const mockDocument = {}; assertUserAgent([], ''); assertNull(vendor.getPrefixedPropertyName('foobar', mockDocument)); }, /** Test for prefixed event type. */ testPrefixedEventType() { assertUserAgent([], ''); assertEquals('foobar', vendor.getPrefixedEventType('foobar')); }, /** Test for browser-specific prefixed event type. */ testPrefixedEventTypeForBrowser() { assertUserAgent([UserAgents.WEBKIT], 'WebKit'); assertEquals('webkitfoobar', vendor.getPrefixedEventType('foobar')); }, });
{ "pile_set_name": "Github" }
apiVersion: rbac.authorization.k8s.io/v1 kind: RoleBinding metadata: name: address-space-controller labels: app: enmasse roleRef: apiGroup: rbac.authorization.k8s.io kind: Role name: enmasse.io:address-space-controller subjects: - kind: ServiceAccount name: address-space-controller namespace: ${NAMESPACE}
{ "pile_set_name": "Github" }
version https://git-lfs.github.com/spec/v1 oid sha256:a2181f85524209a29ab8b707bac9758e2fd483b5a98d1fa867fef6554e086289 size 54901
{ "pile_set_name": "Github" }
 Microsoft Visual Studio Solution File, Format Version 12.00 # Visual Studio 15 VisualStudioVersion = 15.0.27703.2000 MinimumVisualStudioVersion = 10.0.40219.1 Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "smbdoor", "smbdoor\smbdoor.vcxproj", "{81FDE815-185D-45CA-9E72-1680A3CA8E57}" EndProject Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Solution Items", "Solution Items", "{BD61FAF0-8A3A-4C26-9D2B-DD96D38DC6C5}" ProjectSection(SolutionItems) = preProject run.bat = run.bat EndProjectSection EndProject Global GlobalSection(SolutionConfigurationPlatforms) = preSolution Debug|ARM = Debug|ARM Debug|ARM64 = Debug|ARM64 Debug|x64 = Debug|x64 Debug|x86 = Debug|x86 Release|ARM = Release|ARM Release|ARM64 = Release|ARM64 Release|x64 = Release|x64 Release|x86 = Release|x86 EndGlobalSection GlobalSection(ProjectConfigurationPlatforms) = postSolution {81FDE815-185D-45CA-9E72-1680A3CA8E57}.Debug|ARM.ActiveCfg = Debug|ARM {81FDE815-185D-45CA-9E72-1680A3CA8E57}.Debug|ARM.Build.0 = Debug|ARM {81FDE815-185D-45CA-9E72-1680A3CA8E57}.Debug|ARM.Deploy.0 = Debug|ARM {81FDE815-185D-45CA-9E72-1680A3CA8E57}.Debug|ARM64.ActiveCfg = Debug|ARM64 {81FDE815-185D-45CA-9E72-1680A3CA8E57}.Debug|ARM64.Build.0 = Debug|ARM64 {81FDE815-185D-45CA-9E72-1680A3CA8E57}.Debug|ARM64.Deploy.0 = Debug|ARM64 {81FDE815-185D-45CA-9E72-1680A3CA8E57}.Debug|x64.ActiveCfg = Debug|x64 {81FDE815-185D-45CA-9E72-1680A3CA8E57}.Debug|x64.Build.0 = Debug|x64 {81FDE815-185D-45CA-9E72-1680A3CA8E57}.Debug|x64.Deploy.0 = Debug|x64 {81FDE815-185D-45CA-9E72-1680A3CA8E57}.Debug|x86.ActiveCfg = Debug|Win32 {81FDE815-185D-45CA-9E72-1680A3CA8E57}.Debug|x86.Build.0 = Debug|Win32 {81FDE815-185D-45CA-9E72-1680A3CA8E57}.Debug|x86.Deploy.0 = Debug|Win32 {81FDE815-185D-45CA-9E72-1680A3CA8E57}.Release|ARM.ActiveCfg = Release|ARM {81FDE815-185D-45CA-9E72-1680A3CA8E57}.Release|ARM.Build.0 = Release|ARM {81FDE815-185D-45CA-9E72-1680A3CA8E57}.Release|ARM.Deploy.0 = Release|ARM {81FDE815-185D-45CA-9E72-1680A3CA8E57}.Release|ARM64.ActiveCfg = Release|ARM64 {81FDE815-185D-45CA-9E72-1680A3CA8E57}.Release|ARM64.Build.0 = Release|ARM64 {81FDE815-185D-45CA-9E72-1680A3CA8E57}.Release|ARM64.Deploy.0 = Release|ARM64 {81FDE815-185D-45CA-9E72-1680A3CA8E57}.Release|x64.ActiveCfg = Release|x64 {81FDE815-185D-45CA-9E72-1680A3CA8E57}.Release|x64.Build.0 = Release|x64 {81FDE815-185D-45CA-9E72-1680A3CA8E57}.Release|x64.Deploy.0 = Release|x64 {81FDE815-185D-45CA-9E72-1680A3CA8E57}.Release|x86.ActiveCfg = Release|Win32 {81FDE815-185D-45CA-9E72-1680A3CA8E57}.Release|x86.Build.0 = Release|Win32 {81FDE815-185D-45CA-9E72-1680A3CA8E57}.Release|x86.Deploy.0 = Release|Win32 EndGlobalSection GlobalSection(SolutionProperties) = preSolution HideSolutionNode = FALSE EndGlobalSection GlobalSection(ExtensibilityGlobals) = postSolution SolutionGuid = {9E5FBD18-A527-4ECF-AACC-C81FB7020EAF} EndGlobalSection EndGlobal
{ "pile_set_name": "Github" }
<html> <head> <title>403 Forbidden</title> </head> <body> <p>Directory access is forbidden.</p> </body> </html>
{ "pile_set_name": "Github" }
module.exports = function(hljs) { var LISP_IDENT_RE = '[a-zA-Z_\\-\\+\\*\\/\\<\\=\\>\\&\\#][a-zA-Z0-9_\\-\\+\\*\\/\\<\\=\\>\\&\\#!]*'; var MEC_RE = '\\|[^]*?\\|'; var LISP_SIMPLE_NUMBER_RE = '(\\-|\\+)?\\d+(\\.\\d+|\\/\\d+)?((d|e|f|l|s|D|E|F|L|S)(\\+|\\-)?\\d+)?'; var SHEBANG = { className: 'meta', begin: '^#!', end: '$' }; var LITERAL = { className: 'literal', begin: '\\b(t{1}|nil)\\b' }; var NUMBER = { className: 'number', variants: [ {begin: LISP_SIMPLE_NUMBER_RE, relevance: 0}, {begin: '#(b|B)[0-1]+(/[0-1]+)?'}, {begin: '#(o|O)[0-7]+(/[0-7]+)?'}, {begin: '#(x|X)[0-9a-fA-F]+(/[0-9a-fA-F]+)?'}, {begin: '#(c|C)\\(' + LISP_SIMPLE_NUMBER_RE + ' +' + LISP_SIMPLE_NUMBER_RE, end: '\\)'} ] }; var STRING = hljs.inherit(hljs.QUOTE_STRING_MODE, {illegal: null}); var COMMENT = hljs.COMMENT( ';', '$', { relevance: 0 } ); var VARIABLE = { begin: '\\*', end: '\\*' }; var KEYWORD = { className: 'symbol', begin: '[:&]' + LISP_IDENT_RE }; var IDENT = { begin: LISP_IDENT_RE, relevance: 0 }; var MEC = { begin: MEC_RE }; var QUOTED_LIST = { begin: '\\(', end: '\\)', contains: ['self', LITERAL, STRING, NUMBER, IDENT] }; var QUOTED = { contains: [NUMBER, STRING, VARIABLE, KEYWORD, QUOTED_LIST, IDENT], variants: [ { begin: '[\'`]\\(', end: '\\)' }, { begin: '\\(quote ', end: '\\)', keywords: {name: 'quote'} }, { begin: '\'' + MEC_RE } ] }; var QUOTED_ATOM = { variants: [ {begin: '\'' + LISP_IDENT_RE}, {begin: '#\'' + LISP_IDENT_RE + '(::' + LISP_IDENT_RE + ')*'} ] }; var LIST = { begin: '\\(\\s*', end: '\\)' }; var BODY = { endsWithParent: true, relevance: 0 }; LIST.contains = [ { className: 'name', variants: [ {begin: LISP_IDENT_RE}, {begin: MEC_RE} ] }, BODY ]; BODY.contains = [QUOTED, QUOTED_ATOM, LIST, LITERAL, NUMBER, STRING, COMMENT, VARIABLE, KEYWORD, MEC, IDENT]; return { illegal: /\S/, contains: [ NUMBER, SHEBANG, LITERAL, STRING, COMMENT, QUOTED, QUOTED_ATOM, LIST, IDENT ] }; };
{ "pile_set_name": "Github" }
package tracing import ( "go.opentelemetry.io/otel/api/core" "go.opentelemetry.io/otel/api/key" ) type Attrs map[string]string // keyValueSlice converts our internal representation of kv pairs to the tracing // SDK's kv representation. // func keyValueSlice(attrs Attrs) []core.KeyValue { var ( res = make([]core.KeyValue, len(attrs)) idx = 0 ) for k, v := range attrs { res[idx] = key.New(k).String(v) idx++ } return res }
{ "pile_set_name": "Github" }
# Copyright 2015 The TensorFlow 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. # ============================================================================== """Simple GraphEditor example. """ from __future__ import absolute_import from __future__ import division from __future__ import print_function import numpy as np import tensorflow as tf from tensorflow.contrib import graph_editor as ge FLAGS = tf.flags.FLAGS def main(_): # create a graph g = tf.Graph() with g.as_default(): a = tf.constant(1.0, shape=[2, 3], name="a") b = tf.constant(2.0, shape=[2, 3], name="b") c = tf.add( tf.placeholder(dtype=np.float32), tf.placeholder(dtype=np.float32), name="c") # modify the graph ge.swap_inputs(c.op, [a, b]) # print the graph def print(g.as_graph_def()) # and print the value of c with tf.Session(graph=g) as sess: res = sess.run(c) print(res) if __name__ == "__main__": tf.app.run()
{ "pile_set_name": "Github" }
import _plotly_utils.basevalidators class FamilyValidator(_plotly_utils.basevalidators.StringValidator): def __init__( self, plotly_name="family", parent_name="layout.coloraxis.colorbar.title.font", **kwargs ): super(FamilyValidator, self).__init__( plotly_name=plotly_name, parent_name=parent_name, edit_type=kwargs.pop("edit_type", "colorbars"), no_blank=kwargs.pop("no_blank", True), role=kwargs.pop("role", "style"), strict=kwargs.pop("strict", True), **kwargs )
{ "pile_set_name": "Github" }
<?xml version="1.0" encoding="utf-8"?> <manifest xmlns:android="http://schemas.android.com/apk/res/android" package="com.tencent.mars.xlogsample" > <application android:allowBackup="true" android:icon="@mipmap/ic_launcher" android:label="@string/app_name" android:supportsRtl="true" android:theme="@style/AppTheme" > <activity android:name=".MainActivity" > <intent-filter> <action android:name="android.intent.action.MAIN" /> <category android:name="android.intent.category.LAUNCHER" /> </intent-filter> </activity> </application> <uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE" /> </manifest>
{ "pile_set_name": "Github" }
<div><svg width="482" height="68"> <polygon points="9 17 1 13 1 21"></polygon> <polygon points="17 17 9 13 9 21"></polygon> <rect x="31" y="3" width="58" height="32" rx="10"></rect> <rect x="29" y="1" width="58" height="32" class="terminal" rx="10"></rect> <text class="terminal" x="39" y="21">DROP</text> <rect x="109" y="3" width="90" height="32" rx="10"></rect> <rect x="107" y="1" width="90" height="32" class="terminal" rx="10"></rect> <text class="terminal" x="117" y="21">DATABASE</text> <rect x="239" y="35" width="34" height="32" rx="10"></rect> <rect x="237" y="33" width="34" height="32" class="terminal" rx="10"></rect> <text class="terminal" x="247" y="53">IF</text> <rect x="293" y="35" width="68" height="32" rx="10"></rect> <rect x="291" y="33" width="68" height="32" class="terminal" rx="10"></rect> <text class="terminal" x="301" y="53">EXISTS</text> <a xlink:href="sql-grammar.html#name" xlink:title="name"> <rect x="401" y="3" width="54" height="32"></rect> <rect x="399" y="1" width="54" height="32" class="nonterminal"></rect> <text class="nonterminal" x="409" y="21">name</text> </a> <path class="line" d="m17 17 h2 m0 0 h10 m58 0 h10 m0 0 h10 m90 0 h10 m20 0 h10 m0 0 h132 m-162 0 h20 m142 0 h20 m-182 0 q10 0 10 10 m162 0 q0 -10 10 -10 m-172 10 v12 m162 0 v-12 m-162 12 q0 10 10 10 m142 0 q10 0 10 -10 m-152 10 h10 m34 0 h10 m0 0 h10 m68 0 h10 m20 -32 h10 m54 0 h10 m3 0 h-3"></path> <polygon points="473 17 481 13 481 21"></polygon> <polygon points="473 17 465 13 465 21"></polygon> </svg></div>
{ "pile_set_name": "Github" }
<!DOCTYPE html> <html lang="en"> <head> <title>Classes Reference</title> <link rel="stylesheet" type="text/css" href="css/jazzy.css" /> <link rel="stylesheet" type="text/css" href="css/highlight.css" /> <meta charset="utf-8"> <script src="js/jquery.min.js" defer></script> <script src="js/jazzy.js" defer></script> <script src="js/lunr.min.js" defer></script> <script src="js/typeahead.jquery.js" defer></script> <script src="js/jazzy.search.js" defer></script> </head> <body> <a name="//apple_ref/swift/Section/Classes" class="dashAnchor"></a> <a title="Classes Reference"></a> <header class="header"> <p class="header-col header-col--primary"> <a class="header-link" href="index.html"> AlamofireImage Docs </a> (77% documented) </p> <p class="header-col--secondary"> <form role="search" action="search.json"> <input type="text" placeholder="Search documentation" data-typeahead> </form> </p> <p class="header-col header-col--secondary"> <a class="header-link" href="https://github.com/Alamofire/AlamofireImage"> <img class="header-icon" src="img/gh.png"/> View on GitHub </a> </p> <p class="header-col header-col--secondary"> <a class="header-link" href="dash-feed://https%3A%2F%2Falamofire%2Egithub%2Eio%2FAlamofireImage%2Fdocsets%2FAlamofireImage%2Exml"> <img class="header-icon" src="img/dash.png"/> Install in Dash </a> </p> </header> <p class="breadcrumbs"> <a class="breadcrumb" href="index.html">AlamofireImage Reference</a> <img class="carat" src="img/carat.png" /> Classes Reference </p> <div class="content-wrapper"> <nav class="navigation"> <ul class="nav-groups"> <li class="nav-group-name"> <a class="nav-group-name-link" href="Classes.html">Classes</a> <ul class="nav-group-tasks"> <li class="nav-group-task"> <a class="nav-group-task-link" href="Classes/AutoPurgingImageCache.html">AutoPurgingImageCache</a> </li> <li class="nav-group-task"> <a class="nav-group-task-link" href="Classes/ImageDownloader.html">ImageDownloader</a> </li> <li class="nav-group-task"> <a class="nav-group-task-link" href="Classes/ImageDownloader/DownloadPrioritization.html">– DownloadPrioritization</a> </li> <li class="nav-group-task"> <a class="nav-group-task-link" href="Classes/ImageResponseSerializer.html">ImageResponseSerializer</a> </li> <li class="nav-group-task"> <a class="nav-group-task-link" href="Classes/RequestReceipt.html">RequestReceipt</a> </li> </ul> </li> <li class="nav-group-name"> <a class="nav-group-name-link" href="Enums.html">Enumerations</a> <ul class="nav-group-tasks"> <li class="nav-group-task"> <a class="nav-group-task-link" href="Enums/AFIError.html">AFIError</a> </li> </ul> </li> <li class="nav-group-name"> <a class="nav-group-name-link" href="Extensions.html">Extensions</a> <ul class="nav-group-tasks"> <li class="nav-group-task"> <a class="nav-group-task-link" href="Extensions/AlamofireExtension.html">AlamofireExtension</a> </li> <li class="nav-group-task"> <a class="nav-group-task-link" href="Extensions/DataRequest.html">DataRequest</a> </li> <li class="nav-group-task"> <a class="nav-group-task-link" href="Extensions/DataRequest.html">DataRequest</a> </li> <li class="nav-group-task"> <a class="nav-group-task-link" href="Extensions/UIButton.html">UIButton</a> </li> <li class="nav-group-task"> <a class="nav-group-task-link" href="Extensions/UIImage.html">UIImage</a> </li> <li class="nav-group-task"> <a class="nav-group-task-link" href="Extensions/UIImageView.html">UIImageView</a> </li> <li class="nav-group-task"> <a class="nav-group-task-link" href="Extensions/UIImageView/ImageTransition.html">– ImageTransition</a> </li> </ul> </li> <li class="nav-group-name"> <a class="nav-group-name-link" href="Protocols.html">Protocols</a> <ul class="nav-group-tasks"> <li class="nav-group-task"> <a class="nav-group-task-link" href="Protocols/CompositeImageFilter.html">CompositeImageFilter</a> </li> <li class="nav-group-task"> <a class="nav-group-task-link" href="Protocols/CoreImageFilter.html">CoreImageFilter</a> </li> <li class="nav-group-task"> <a class="nav-group-task-link" href="Protocols/ImageCache.html">ImageCache</a> </li> <li class="nav-group-task"> <a class="nav-group-task-link" href="Protocols/ImageFilter.html">ImageFilter</a> </li> <li class="nav-group-task"> <a class="nav-group-task-link" href="Protocols/ImageRequestCache.html">ImageRequestCache</a> </li> <li class="nav-group-task"> <a class="nav-group-task-link" href="Protocols/Roundable.html">Roundable</a> </li> <li class="nav-group-task"> <a class="nav-group-task-link" href="Protocols/Sizable.html">Sizable</a> </li> </ul> </li> <li class="nav-group-name"> <a class="nav-group-name-link" href="Structs.html">Structures</a> <ul class="nav-group-tasks"> <li class="nav-group-task"> <a class="nav-group-task-link" href="Structs/AspectScaledToFillSizeCircleFilter.html">AspectScaledToFillSizeCircleFilter</a> </li> <li class="nav-group-task"> <a class="nav-group-task-link" href="Structs/AspectScaledToFillSizeFilter.html">AspectScaledToFillSizeFilter</a> </li> <li class="nav-group-task"> <a class="nav-group-task-link" href="Structs/AspectScaledToFillSizeWithRoundedCornersFilter.html">AspectScal
{ "pile_set_name": "Github" }
This is the code to build the parlai website. - `generate.py`: does the actual rendering - `static`: assets in this folder will be copied verbatim to parl.ai/static/ - `templates`: contains html templates for a variety of pages
{ "pile_set_name": "Github" }
/* * Common power driver for PDAs and phones with one or two external * power supplies (AC/USB) connected to main and backup batteries, * and optional builtin charger. * * Copyright © 2007 Anton Vorontsov <cbou@mail.ru> * * 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. */ #include <linux/module.h> #include <linux/platform_device.h> #include <linux/err.h> #include <linux/interrupt.h> #include <linux/notifier.h> #include <linux/power_supply.h> #include <linux/pda_power.h> #include <linux/regulator/consumer.h> #include <linux/timer.h> #include <linux/jiffies.h> #include <linux/usb/otg.h> static inline unsigned int get_irq_flags(struct resource *res) { return IRQF_SHARED | (res->flags & IRQF_TRIGGER_MASK); } static struct device *dev; static struct pda_power_pdata *pdata; static struct resource *ac_irq, *usb_irq; static struct timer_list charger_timer; static struct timer_list supply_timer; static struct timer_list polling_timer; static int polling; static struct power_supply *pda_psy_ac, *pda_psy_usb; #if IS_ENABLED(CONFIG_USB_PHY) static struct usb_phy *transceiver; static struct notifier_block otg_nb; #endif static struct regulator *ac_draw; enum { PDA_PSY_OFFLINE = 0, PDA_PSY_ONLINE = 1, PDA_PSY_TO_CHANGE, }; static int new_ac_status = -1; static int new_usb_status = -1; static int ac_status = -1; static int usb_status = -1; static int pda_power_get_property(struct power_supply *psy, enum power_supply_property psp, union power_supply_propval *val) { switch (psp) { case POWER_SUPPLY_PROP_ONLINE: if (psy->desc->type == POWER_SUPPLY_TYPE_MAINS) val->intval = pdata->is_ac_online ? pdata->is_ac_online() : 0; else val->intval = pdata->is_usb_online ? pdata->is_usb_online() : 0; break; default: return -EINVAL; } return 0; } static enum power_supply_property pda_power_props[] = { POWER_SUPPLY_PROP_ONLINE, }; static char *pda_power_supplied_to[] = { "main-battery", "backup-battery", }; static const struct power_supply_desc pda_psy_ac_desc = { .name = "ac", .type = POWER_SUPPLY_TYPE_MAINS, .properties = pda_power_props, .num_properties = ARRAY_SIZE(pda_power_props), .get_property = pda_power_get_property, }; static const struct power_supply_desc pda_psy_usb_desc = { .name = "usb", .type = POWER_SUPPLY_TYPE_USB, .properties = pda_power_props, .num_properties = ARRAY_SIZE(pda_power_props), .get_property = pda_power_get_property, }; static void update_status(void) { if (pdata->is_ac_online) new_ac_status = !!pdata->is_ac_online(); if (pdata->is_usb_online) new_usb_status = !!pdata->is_usb_online(); } static void update_charger(void) { static int regulator_enabled; int max_uA = pdata->ac_max_uA; if (pdata->set_charge) { if (new_ac_status > 0) { dev_dbg(dev, "charger on (AC)\n"); pdata->set_charge(PDA_POWER_CHARGE_AC); } else if (new_usb_status > 0) { dev_dbg(dev, "charger on (USB)\n"); pdata->set_charge(PDA_POWER_CHARGE_USB); } else { dev_dbg(dev, "charger off\n"); pdata->set_charge(0); } } else if (ac_draw) { if (new_ac_status > 0) { regulator_set_current_limit(ac_draw, max_uA, max_uA); if (!regulator_enabled) { dev_dbg(dev, "charger on (AC)\n"); WARN_ON(regulator_enable(ac_draw)); regulator_enabled = 1; } } else { if (regulator_enabled) { dev_dbg(dev, "charger off\n"); WARN_ON(regulator_disable(ac_draw)); regulator_enabled = 0; } } } } static void supply_timer_func(unsigned long unused) { if (ac_status == PDA_PSY_TO_CHANGE) { ac_status = new_ac_status; power_supply_changed(pda_psy_ac); } if (usb_status == PDA_PSY_TO_CHANGE) { usb_status = new_usb_status; power_supply_changed(pda_psy_usb); } } static void psy_changed(void) { update_charger(); /* * Okay, charger set. Now wait a bit before notifying supplicants, * charge power should stabilize. */ mod_timer(&supply_timer, jiffies + msecs_to_jiffies(pdata->wait_for_charger)); } static void charger_timer_func(unsigned long unused) { update_status(); psy_changed(); } static irqreturn_t power_changed_isr(int irq, void *power_supply) { if (power_supply == pda_psy_ac) ac_status = PDA_PSY_TO_CHANGE; else if (power_supply == pda_psy_usb) usb_status = PDA_PSY_TO_CHANGE; else return IRQ_NONE; /* * Wait a bit before reading ac/usb line status and setting charger, * because ac/usb status readings may lag from irq. */ mod_timer(&charger_timer, jiffies + msecs_to_jiffies(pdata->wait_for_status)); return IRQ_HANDLED; } static void polling_timer_func(unsigned long unused) { int changed = 0; dev_dbg(dev, "polling...\n"); update_status(); if (!ac_irq && new_ac_status != ac_status) { ac_status = PDA_PSY_TO_CHANGE; changed = 1; } if (!usb_irq && new_usb_status != usb_status) { usb_status = PDA_PSY_TO_CHANGE; changed = 1; } if (changed) psy_changed(); mod_timer(&polling_timer, jiffies + msecs_to_jiffies(pdata->polling_interval)); } #if IS_ENABLED(CONFIG_USB_PHY) static int otg_is_usb_online(void) { return (transceiver->last_event == USB_EVENT_VB
{ "pile_set_name": "Github" }
<?xml version="1.0" encoding="UTF-8"?> <graph xmlns="http://www.xces.org/ns/GrAF/1.0/"> <header> <tagsDecl> <tagUsage gi="s" occurs="13"/> </tagsDecl> <annotationSets> <annotationSet name="xces" type="http://www.xces.org/schema/2003"/> </annotationSets> </header> <region xml:id="s-r0" anchors="18 31"/> <region xml:id="s-r1" anchors="38 42"/> <region xml:id="s-r2" anchors="49 144"/> <region xml:id="s-r3" anchors="145 299"/> <region xml:id="s-r4" anchors="300 474"/> <region xml:id="s-r5" anchors="481 569"/> <region xml:id="s-r6" anchors="570 662"/> <region xml:id="s-r7" anchors="663 922"/> <region xml:id="s-r8" anchors="929 1180"/> <region xml:id="s-r9" anchors="1187 1350"/> <region xml:id="s-r10" anchors="1351 1448"/> <region xml:id="s-r11" anchors="1449 1499"/> <region xml:id="s-r12" anchors="1506 1565"/> <node xml:id="s-n0"> <link targets="s-r0"/> </node> <a label="s" ref="s-n0" as="xces"> <fs> <f name="id" value="p1s1"/> </fs> </a> <node xml:id="s-n1"> <link targets="s-r1"/> </node> <a label="s" ref="s-n1" as="xces"> <fs> <f name="id" value="p2s1"/> </fs> </a> <node xml:id="s-n10"> <link targets="s-r10"/> </node> <a label="s" ref="s-n10" as="xces"> <fs> <f name="id" value="p6s1.1"/> </fs> </a> <node xml:id="s-n11"> <link targets="s-r11"/> </node> <a label="s" ref="s-n11" as="xces"> <fs> <f name="id" value="p6s4"/> </fs> </a> <node xml:id="s-n12"> <link targets="s-r12"/> </node> <a label="s" ref="s-n12" as="xces"> <fs> <f name="id" value="p7s1"/> </fs> </a> <node xml:id="s-n2"> <link targets="s-r2"/> </node> <a label="s" ref="s-n2" as="xces"> <fs> <f name="id" value="p3s1"/> </fs> </a> <node xml:id="s-n3"> <link targets="s-r3"/> </node> <a label="s" ref="s-n3" as="xces"> <fs> <f name="id" value="p3s2"/> </fs> </a> <node xml:id="s-n4"> <link targets="s-r4"/> </node> <a label="s" ref="s-n4" as="xces"> <fs> <f name="id" value="p3s3"/> </fs> </a> <node xml:id="s-n5"> <link targets="s-r5"/> </node> <a label="s" ref="s-n5" as="xces"> <fs> <f name="id" value="p4s1"/> </fs> </a> <node xml:id="s-n6"> <link targets="s-r6"/> </node> <a label="s" ref="s-n6" as="xces"> <fs> <f name="id" value="p4s2"/> </fs> </a> <node xml:id="s-n7"> <link targets="s-r7"/> </node> <a label="s" ref="s-n7" as="xces"> <fs> <f name="id" value="p4s3"/> </fs> </a> <node xml:id="s-n8"> <link targets="s-r8"/> </node> <a label="s" ref="s-n8" as="xces"> <fs> <f name="id" value="p5s1"/> </fs> </a> <node xml:id="s-n9"> <link targets="s-r9"/> </node> <a label="s" ref="s-n9" as="xces"> <fs> <f name="id" value="p6s1"/> </fs> </a> </graph>
{ "pile_set_name": "Github" }
@ECHO OFF :LOOP IF "%1"=="" ( EXIT /B 255 ) IF "%1"=="--version" ( ECHO 0.0-cmake-dummy EXIT /B 0 ) IF "%1"=="--exists" ( SHIFT ECHO Expected: %* ECHO Found: %PKG_CONFIG_PATH% IF NOT "%*"=="%PKG_CONFIG_PATH%" ( EXIT /B 1 ) ELSE ( EXIT /B 0 ) ) SHIFT IF NOT "%~1"=="" GOTO LOOP EXIT /B 255
{ "pile_set_name": "Github" }
#!/usr/bin/env python3 # Copyright (c) 2015-2018 The Bitcoin Unlimited developers # Distributed under the MIT software license, see the accompanying # file COPYING or http://www.opensource.org/licenses/mit-license.php. import test_framework.loginit import os import os.path import time import sys if sys.version_info[0] < 3: raise "Use Python 3" import logging from binascii import unhexlify from test_framework.test_framework import BitcoinTestFramework from test_framework.util import * from test_framework.mininode import NetworkThread from test_framework.nodemessages import * from test_framework.bumessages import * from test_framework.bunode import BasicBUCashNode, VersionlessProtoHandler class XVersionTest(BitcoinTestFramework): def __init__(self): self.nodes = [] BitcoinTestFramework.__init__(self) def setup_chain(self): pass def setup_network(self, split=False): pass def restart_node(self, send_initial_version = True): # remove any potential banlist banlist_fn = os.path.join( node_regtest_dir(self.options.tmpdir, 0), "banlist.dat") logging.info("Banlist file name: " + str(banlist_fn)) try: os.remove(banlist_fn) logging.info("Removed old banlist %s.") except: pass stop_nodes(self.nodes) wait_bitcoinds() logging.info("Initializing test directory " + str(self.options.tmpdir)) initialize_chain_clean(self.options.tmpdir, 1) self.nodes = [ start_node(0, self.options.tmpdir, ["-debug=net", "-use-xversion=0"]) ] self.pynode = pynode = BasicBUCashNode() pynode.connect(0, '127.0.0.1', p2p_port(0), self.nodes[0], protohandler = VersionlessProtoHandler(), send_initial_version = send_initial_version) return pynode.cnxns[0] def network_and_finish(self): nt = NetworkThread() nt.start() nt.join() def run_test(self): logging.info("Testing xversion handling") ex1_xver = { 1 : b"2", 3 : b"4"} def test_too_early(msg): """ Test that the given message if it comes right after start up will lead to rejection / banning as it comes too early. """ logging.info("Testing that an an early %s fails." % msg) conn = self.restart_node(send_initial_version = False) conn.send_message(msg, pushbuf = True) self.network_and_finish() assert conn.disconnected # test failure due to early receipt if 0: for msg in [msg_xversion_old(), msg_xverack_old(), msg_xversion_old({1:b"2",3:b"45"})]: test_too_early(msg) # test regular set up including xversion conn = self.restart_node() nt = NetworkThread() nt.start() conn.wait_for_verack() conn.send_message(msg_verack()) # now it is time for xversion conn.wait_for(lambda : conn.remote_xversion) conn.send_message(msg_xversion_old({1000 : b"test string"})) conn.wait_for_xverack_old() conn.send_message(msg_xverack_old()) # make sure xversion has actually been received properly # test that it contains the BU_LISTEN_PORT (replacement for buversion message) # FIXME: use proper constant assert 1<<17 in conn.remote_xversion.xver.keys() # Likewise, check that the remote end got our message node = self.nodes[0] peer_info = node.getpeerinfo() assert len(peer_info) == 1 assert "xversion_map" in peer_info[0] xv_map = peer_info[0]["xversion_map"] assert len(xv_map) == 1 assert unhexlify(list(xv_map.values())[0]) == b"test string" # send xupdate to test what would happen if someone tries to update non-chaneable key conn.send_message(msg_xupdate({1000 : b"test string changed"})) # some arbitrary sleep time time.sleep(3); # nothing should have changed, 1000 is not listed as a changeable key node = self.nodes[0] peer_info = node.getpeerinfo() assert len(peer_info) == 1 assert "xversion_map" in peer_info[0] xv_map = peer_info[0]["xversion_map"] assert len(xv_map) == 1 assert unhexlify(list(xv_map.values())[0]) == b"test string" # send xupdate to test what would happen if someone tries to update a non-existant key conn.send_message(msg_xupdate({1111 : b"bad string"})) # some arbitrary sleep time time.sleep(3); # nothing should have changed, 1111 is not listed as a known key node = self.nodes[0] peer_info = node.getpeerinfo() assert len(peer_info) == 1 assert "xversion_map" in peer_info[0] xv_map = peer_info[0]["xversion_map"] assert len(xv_map) == 1 # TODO appent to this test to test a changeable key once one has been implemented in the node conn.connection.disconnect_node() nt.join() if __name__ == '__main__': xvt = XVersionTest() xvt.main()
{ "pile_set_name": "Github" }
[ { "name": "Container", "categories": [ "Basics" ], "subcategories": [ "拥有单个子元素的布局widget" ], "description": "一个拥有绘制、定位、调整大小的 widget。", "link": "https://docs.flutter.io/flutter/widgets/Container-class.html", "image": "<svg viewBox='0 0 100 100'><defs><marker id='arrow-container-1' orient='auto-start-reverse' viewBox='0 0 1 1' markerWidth='3' markerHeight='3' refX='0.5' refY='0.5'><path d='M 1 0.5 L 0.5 0 L 0.5 1 z' fill='#f50057'/></marker><marker id='arrow-container-2' orient='auto-start-reverse' viewBox='0 0 1 1' markerWidth='3' markerHeight='3' refX='0.5' refY='0.5'><path d='M 1 0.5 L 0.5 0 L 0.5 1 z' fill='#ffffff'/></marker><filter id='shadow-container' x='-50%' y='-50%' width='200%' height='200%'><feGaussianBlur stdDeviation='4'/></filter><linearGradient id='gradient-container' x1='0' y1='0.2' x2='0.4' y2='0.9'><stop offset='55%' stop-color='#ffffff'/><stop offset='100%' stop-color='#fdccdd'/></linearGradient></defs><rect x='0' y='0' width='100' height='100' fill='#3949ab'/><rect x='15' y='25' width='70' height='47.5' rx='10' ry='10' fill='#000000' filter='url(#shadow-container)'/><rect x='15' y='25' width='70' height='47.5' rx='10' ry='10' fill='url(#gradient-container)' stroke-width='5' stroke='#3b75ad'/><rect x='30' y='40' width='40' height='30' fill='#4dd0e1'/><line x1='20' y1='55' x2='27' y2='55' stroke='#f50057' stroke-width='2' marker-start='url(#arrow-container-1)' marker-end='url(#arrow-container-1)'/><line x1='73' y1='55' x2='80' y2='55' stroke='#f50057' stroke-width='2' marker-start='url(#arrow-container-1)' marker-end='url(#arrow-container-1)'/><line x1='50' y1='30' x2='50' y2='37' stroke='#f50057' stroke-width='2' marker-start='url(#arrow-container-1)' marker-end='url(#arrow-container-1)'/><line x1='50' y1='78' x2='50' y2='82' stroke='#f50057' stroke-width='2' marker-start='url(#arrow-container-1)' marker-end='url(#arrow-container-1)'/><line x1='16' y1='17.5' x2='85' y2='17.5' stroke='#ffffff' stroke-width='2' marker-start='url(#arrow-container-2)' marker-end='url(#arrow-container-2)'/><line x1='7.5' y1='26' x2='7.5' y2='72' stroke='#ffffff' stroke-width='2' marker-start='url(#arrow-container-2)' marker-end='url(#arrow-container-2)'/></svg>" }, { "name": "Row", "description": "在水平方向上排列子widget的列表。", "categories": [ "Basics" ], "subcategories": [ "拥有多个子元素的布局widget" ], "link": "https://docs.flutter.io/flutter/widgets/Row-class.html", "image": "<svg viewBox='0 0 100 100'><rect x='0' y='0' width='100' height='100' fill='#3949ab'/><rect x='10' y='30' width='80' height='40' fill='#ffffff'/><rect x='15' y='40' width='20' height='20' fill='#4dd0e1'/><rect x='40' y='35' width='30' height='30' fill='#4dd0e1'/></svg>" }, { "name": "Column", "description": "在垂直方向上排列子widget的列表。", "categories": [ "Basics" ], "subcategories": [ "拥有多个子元素的布局widget" ], "link": "https://docs.flutter.io/flutter/widgets/Column-class.html", "image": "<svg viewBox='0 0 100 100'><rect x='0' y='0' width='100' height='100' fill='#3949ab'/><rect x='30' y='10' width='40' height='80' fill='#ffffff'/><rect x='40' y='15' width='20' height='20' fill='#4dd0e1'/><rect x='35' y='40' width='30' height='30' fill='#4dd0e1'/></svg>" }, { "name": "Image", "description": "一个显示图片的widget", "categories": [ "Basics", "Assets, Images, and Icons" ], "subcategories": [ "信息展示" ], "link": "https://docs.flutter.io/flutter/widgets/Image-class.html", "image": "<svg viewBox='0 0 100 100'><rect x='0' y='0' width='100' height='100' fill='#3949ab'/><rect x='20' y='20' width='60' height='60' fill='#ffffff'/><image x='22.5' y='22.5' width='55' height='55' xlink:href='/images/owl.jpg'/></svg>" }, { "name": "Text", "description": "单一格式的文本", "categories": [ "Basics", "Text" ], "subcategories": [], "link": "https://docs.flutter.io/flutter/widgets/Text-class.html", "image": "<svg viewBox='0 0 100 100'><rect x='0' y='0' width='100' height='100' fill='#3949ab'/><rect x='20' y='30' width='60' height='40' fill='#ffffff'/><text x='50' y='60' text-anchor='middle' font-family='Roboto' font-size='25' fill='#3b75ad'>Abc</text></svg>" }, { "name": "Icon", "description": "A Material Design icon.", "categories": [ "Basics", "Assets, Images, and Icons" ], "subcategories": [ "信息展示" ], "link": "https://docs.flutter.io/flutter/widgets/Icon-class.html", "image": "<img alt='' src='/images/catalog-widget-placeholder.png'>" }, { "name": "RaisedButton", "description": "Material Design中的button, 一个凸起的材质矩形按钮", "categories": [ "Basics" ], "subcategories": [ "按钮" ], "link": "https://docs.flutter.io/flutter/material/RaisedButton-class.html", "image": "<img alt='' src='https://material-design.storage.googleapis.com/publish/material_v_9/0B7WCemMG6e0VbDh6YmNiYVc3SHM/components_buttons_usage2.png'>"
{ "pile_set_name": "Github" }