text
stringlengths
2
100k
meta
dict
<?xml version="1.0" encoding="utf-8"?> <Project ToolsVersion="15.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003"> <ItemGroup> <ClCompile Include="..\libstuff\hello.cpp" /> </ItemGroup> <ItemGroup> <ClInclude Include="..\libstuff\hello.h" /> </ItemGroup> </Project>
{ "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 --> <title>Uses of Interface com.google.gwt.core.client.GWT.UncaughtExceptionHandler (GWT Javadoc)</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 Interface com.google.gwt.core.client.GWT.UncaughtExceptionHandler (GWT Javadoc)"; } } 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="../../../../../../com/google/gwt/core/client/GWT.UncaughtExceptionHandler.html" title="interface in com.google.gwt.core.client">Class</a></li> <li class="navBarCell1Rev">Use</li> <li><a href="../../../../../../deprecated-list.html">Deprecated</a></li> <li><a href="../../../../../../help-doc.html">Help</a></li> </ul> <div class="aboutLanguage">GWT 2.9.0</div> </div> <div class="subNav"> <ul class="navList"> <li>Prev</li> <li>Next</li> </ul> <ul class="navList"> <li><a href="../../../../../../index.html?com/google/gwt/core/client/class-use/GWT.UncaughtExceptionHandler.html" target="_top">Frames</a></li> <li><a href="GWT.UncaughtExceptionHandler.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 Interface com.google.gwt.core.client.GWT.UncaughtExceptionHandler" class="title">Uses of Interface<br>com.google.gwt.core.client.GWT.UncaughtExceptionHandler</h2> </div> <div class="classUseContainer"> <ul class="blockList"> <li class="blockList"> <table class="useSummary" border="0" cellpadding="3" cellspacing="0" summary="Use table, listing packages, and an explanation"> <caption><span>Packages that use <a href="../../../../../../com/google/gwt/core/client/GWT.UncaughtExceptionHandler.html" title="interface in com.google.gwt.core.client">GWT.UncaughtExceptionHandler</a></span><span class="tabEnd">&nbsp;</span></caption> <tr> <th class="colFirst" scope="col">Package</th> <th class="colLast" scope="col">Description</th> </tr> <tbody> <tr class="altColor"> <td class="colFirst"><a href="#com.google.gwt.core.client">com.google.gwt.core.client</a></td> <td class="colLast"> <div class="block">Fundamental classes used in client-side GWT code.</div> </td> </tr> </tbody> </table> </li> <li class="blockList"> <ul class="blockList"> <li class="blockList"><a name="com.google.gwt.core.client"> <!-- --> </a> <h3>Uses of <a href="../../../../../../com/google/gwt/core/client/GWT.UncaughtExceptionHandler.html" title="interface in com.google.gwt.core.client">GWT.UncaughtExceptionHandler</a> in <a href="../../../../../../com/google/gwt/core/client/package-summary.html">com.google.gwt.core.client</a></h3> <table class="useSummary" border="0" cellpadding="3" cellspacing="0" summary="Use table, listing methods, and an explanation"> <caption><span>Methods in <a href="../../../../../../com/google/gwt/core/client/package-summary.html">com.google.gwt.core.client</a> that return <a href="../../../../../../com/google/gwt/core/client/GWT.UncaughtExceptionHandler.html" title="interface in com.google.gwt.core.client">GWT.UncaughtExceptionHandler</a></span><span class="tabEnd">&nbsp;</span></caption> <tr> <th class="colFirst" scope="col">Modifier and Type</th> <th class="colLast" scope="col">Method and Description</th> </tr> <tbody> <tr class="altColor"> <td class="colFirst"><code>static <a href="../../../../../../com/google/gwt/core/client/GWT.UncaughtExceptionHandler.html" title="interface in com.google.gwt.core.client">GWT.UncaughtExceptionHandler</a></code></td> <td class="colLast"><span class="typeNameLabel">GWT.</span><code><span class="memberNameLink"><a href="../../../../../../com/google/gwt/core/client/GWT.html#getUncaughtExceptionHandler--">getUncaughtExceptionHandler</a></span>()</code> <div class="block">Returns the currently active uncaughtExceptionHandler.</div> </td> </tr> </tbody> </table> <table class="useSummary" border="0" cellpadding="3" cellspacing="0" summary="Use table, listing methods, and an explanation"> <caption><span>Methods in <a href="../../../../../../com/google/gwt/core/client/package-summary.html">com.google.gwt.core.client</a> with parameters of type <a href="../../../../../../com/google/gwt/core/client/GWT.UncaughtExceptionHandler.html" title="interface in com.google.gwt.core.client">GWT.UncaughtExceptionHandler</a></span><span class="tabEnd">&nbsp;</span></caption> <tr> <th class="colFirst" scope="col">Modifier and Type</th> <th class="colLast" scope="col">Method and Description</th> </tr> <tbody> <tr class="altColor"> <td class="colFirst"><code>static void</code></td> <td class="colLast"><span class="typeNameLabel">GWT.</span><code><span class="memberNameLink"><a href="../../../../../../com/google/gwt/core/client/GWT.html#setUncaughtExceptionHandler-com.google.gwt.core.client.GWT.UncaughtExceptionHandler-">setUncaughtExceptionHandler</a></span>(<a href="../../../../../../com/google/gwt/core/client/GWT.UncaughtExceptionHandler.html" title="interface in com.google.gwt.core.client">GWT.UncaughtExceptionHandler</a>&nbsp;handler)</code> <div class="block">Sets a custom uncaught exception handler.</div> </td> </tr> </tbody> </table> </li> </ul> </li> </ul> </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="../../../../../../com/google/gwt/core/client/GWT.UncaughtExceptionHandler.html" title="interface in com.google.gwt.core.client">Class</a></li> <li class="navBarCell1Rev">Use</li> <li><a href="../../../../../../deprecated-list.html">Deprecated</a></li> <li><a href="../../../../../../help-doc.html">Help</a></li> </ul> <div class="aboutLanguage">GWT 2.9.0</div> </div> <div class="subNav"> <ul class="navList"> <li>Prev</li> <li>Next</li> </ul> <ul class="navList"> <li><a href="../../../../../../index.html?com/google/gwt/core/client/class-use/GWT.UncaughtExceptionHandler.html" target="_top">Frames</a></li> <li><a href="GWT.UncaughtExceptionHandler.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 ======= --> </body> </html>
{ "pile_set_name": "Github" }
package org.domeos.framework.engine.model; import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.databind.ObjectMapper; import com.fasterxml.jackson.dataformat.yaml.YAMLFactory; import org.springframework.stereotype.Component; /** * Created by KaiRen on 2016/11/24. */ @Component("yamlObjectMapper") public class CustomYamlObjectMapper extends ObjectMapper { public CustomYamlObjectMapper() { super(new YAMLFactory()); this.setSerializationInclusion(JsonInclude.Include.NON_EMPTY); } }
{ "pile_set_name": "Github" }
<?php declare(strict_types=1); /* * This file is part of PHPUnit. * * (c) Sebastian Bergmann <[email protected]> * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ namespace PHPUnit\Framework\Constraint; use function mb_stripos; use function mb_strtolower; use function sprintf; use function strpos; /** * @no-named-arguments Parameter names are not covered by the backward compatibility promise for PHPUnit */ final class StringContains extends Constraint { /** * @var string */ private $string; /** * @var bool */ private $ignoreCase; public function __construct(string $string, bool $ignoreCase = false) { $this->string = $string; $this->ignoreCase = $ignoreCase; } /** * Returns a string representation of the constraint. */ public function toString(): string { if ($this->ignoreCase) { $string = mb_strtolower($this->string, 'UTF-8'); } else { $string = $this->string; } return sprintf( 'contains "%s"', $string ); } /** * Evaluates the constraint for parameter $other. Returns true if the * constraint is met, false otherwise. * * @param mixed $other value or object to evaluate */ protected function matches($other): bool { if ('' === $this->string) { return true; } if ($this->ignoreCase) { /* * We must use the multi byte safe version so we can accurately compare non latin upper characters with * their lowercase equivalents. */ return mb_stripos($other, $this->string, 0, 'UTF-8') !== false; } /* * Use the non multi byte safe functions to see if the string is contained in $other. * * This function is very fast and we don't care about the character position in the string. * * Additionally, we want this method to be binary safe so we can check if some binary data is in other binary * data. */ return strpos($other, $this->string) !== false; } }
{ "pile_set_name": "Github" }
<!-- The organizational settings file is used to define the local organizations preferred setting within an allowed range of the STIG. Each setting in this file is linked by STIG ID and the valid range is in an associated comment. --> <OrganizationalSettings fullversion="1.7"> <!-- Ensure ''V-17521'' -match '51'--> <OrganizationalSetting id="V-17521" ValueData="51" /> </OrganizationalSettings>
{ "pile_set_name": "Github" }
.codebook{ // ============================================================================ // Single // ============================================================================ margin: 2em auto; text-align: left; background-color: $color-parse-blue; border-radius: 4px; color: white; // ============================================================================ // Child Elements // ============================================================================ a{ text-decoration: none; } &__container{ &--inline{ &-popout{ @include break-min( 880px ) { margin-left: -15%; width: 130%; } @include break-min( 1024px ){ margin-left: -25%; width: 150%; } } } &--tooltip{ text-align: left; position:relative; .codebook{ display:none; text-align: left; margin: 1em 0; } &.is-open{ .codebook { display:block; } } } }// end __container &__platform-content{ display: none; &.is-active-platform{ display:block; } } &__platforms{ padding: 0 5px; } &__platform{ display: inline-block; padding: 11px 10px 9px; opacity: 0.5; width: 46px; svg{ width: auto; height: auto; max-width: 21px; max-height: 21px; fill: white; } transition: opacity 180ms ease; &.is-active-platform, &:hover{ opacity:1; } } &__languages{ padding: 0 5px; background-color: rgba(#000, 0.1); } &__language{ display: inline-block; font-family: $font-stack-code; font-size: 1.1rem; font-weight: $bold-weight; padding: 7px 8px; opacity: 0.5; color: white !important; transition: opacity 180ms ease; // & + &{ // margin-left // } &.is-active-language, &:hover{ opacity:1; } } &__prisms{ .codebook &{ pre{ display: none; font-size: 1.2rem; border-radius: 0 0 4px 4px; margin: 0 !important; &.is-active-language{ display: block; } } } } // ========================================================================= // Media Queries // ========================================================================= @include break-min($break-tablet){ &__container{ &--tooltip{ width: 28px; height: 28px; .codebook{ position: absolute; width: 500px; top:100%; transform: translateY(10px); z-index: 1892; margin:0; &.codebook--left{ left:0; } &.codebook--right{ right:0; } &__prisms{ max-height: 200px; overflow: auto; } } } // end --tooltip } } // ============================================================================ // States // ============================================================================ // &:hover{} // ============================================================================ // Modifiers // ============================================================================ &--green{ background-color: $color-carib-green; } &--red{ background-color: $color-rad-red; } &--martinique{ background-color: $color-martinique; } } .code-btn{ display: inline-block; position: relative; background: none; padding:0 0 0 38px; font-family: $font-din; text-transform: uppercase; font-size: 1.2rem; color: $color-parse-blue; letter-spacing: 0.2rem; .code-btn__icon{ display:block; width: 28px; height: 28px; position: absolute; left:0; top:50%; border: 1px solid $color-parse-blue; border-radius: 50%; transform: translateY( -50% ); transition: all 150ms ease; &:before, &:after{ opacity: 0; content: ''; position: absolute; left: 50%; top:50%; width:12px; height: 2px; background-color: $color-parse-blue; } svg{ display:block; position:absolute; left: 50%; top:50%; transform: translate( -50%, -50% ); width: 18px; height: 12px; fill: $color-parse-blue; transition: fill 150ms ease; } } &.show-close{ .code-btn__icon{ background-color: $color-parse-blue; &:before, &:after{ opacity:1; background-color:white; } &:before{ transform: translate(-50%, -50%) rotate(-45deg); } &:after{ transform: translate(-50%, -50%) rotate(45deg); } svg{ opacity:0; fill:white; } } } html.no-touch &:hover{ text-decoration: none; .code-btn__icon{ background-color: $color-parse-blue; &:before, &:after{ background-color: white; } svg{ fill: white; } } } } .code-btn--green{ color: $color-carib-green; .code-btn__icon { border-color: $color-carib-green; svg{ fill: $color-carib-green; } } html.no-touch &:hover, &.show-close{ .code-btn__icon { background-color: $color-carib-green; } } } .code-btn--red{ color: $color-rad-red; .code-btn__icon { border-color: $color-rad-red; svg{ fill: $color-rad-red; } } html.no-touch &:hover, &.show-close{ .code-btn__icon { background-color: $color-rad-red; } } } .code-btn--martinique{ color: $color-martinique; .code-btn__icon { border-color: $color-martinique; svg{ fill: $color-martinique; } } html.no-touch &:hover, &.show-close{ .code-btn__icon { background-color: $color-martinique; } } }
{ "pile_set_name": "Github" }
/** * Copyright 2016 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 com.google.firebase.linelogindemo.util; import android.content.Context; import android.graphics.Bitmap; import android.support.v4.util.LruCache; import com.android.volley.Request; import com.android.volley.RequestQueue; import com.android.volley.toolbox.ImageLoader; import com.android.volley.toolbox.Volley; public class NetworkSingleton { private static NetworkSingleton mInstance; private RequestQueue mRequestQueue; private ImageLoader mImageLoader; private static Context mCtx; private NetworkSingleton(Context context) { mCtx = context; mRequestQueue = getRequestQueue(); mImageLoader = new ImageLoader(mRequestQueue, new ImageLoader.ImageCache() { private final LruCache<String, Bitmap> cache = new LruCache<String, Bitmap>(20); @Override public Bitmap getBitmap(String url) { return cache.get(url); } @Override public void putBitmap(String url, Bitmap bitmap) { cache.put(url, bitmap); } }); } public static synchronized NetworkSingleton getInstance(Context context) { if (mInstance == null) { mInstance = new NetworkSingleton(context); } return mInstance; } public RequestQueue getRequestQueue() { if (mRequestQueue == null) { // getApplicationContext() is key, it keeps you from leaking the // Activity or BroadcastReceiver if someone passes one in. mRequestQueue = Volley.newRequestQueue(mCtx.getApplicationContext()); } return mRequestQueue; } public <T> void addToRequestQueue(Request<T> req) { getRequestQueue().add(req); } public ImageLoader getImageLoader() { return mImageLoader; } }
{ "pile_set_name": "Github" }
/* * rtc-twl.c -- TWL Real Time Clock interface * * Copyright (C) 2007 MontaVista Software, Inc * Author: Alexandre Rusev <[email protected]> * * Based on original TI driver twl4030-rtc.c * Copyright (C) 2006 Texas Instruments, Inc. * * Based on rtc-omap.c * Copyright (C) 2003 MontaVista Software, Inc. * Author: George G. Davis <[email protected]> or <[email protected]> * Copyright (C) 2006 David Brownell * * This program is free software; you can redistribute it and/or * modify it under the terms of the GNU General Public License * as published by the Free Software Foundation; either version * 2 of the License, or (at your option) any later version. */ #define pr_fmt(fmt) KBUILD_MODNAME ": " fmt #include <linux/kernel.h> #include <linux/errno.h> #include <linux/init.h> #include <linux/module.h> #include <linux/types.h> #include <linux/rtc.h> #include <linux/bcd.h> #include <linux/platform_device.h> #include <linux/interrupt.h> #include <linux/of.h> #include <linux/mfd/twl.h> enum twl_class { TWL_4030 = 0, TWL_6030, }; /* * RTC block register offsets (use TWL_MODULE_RTC) */ enum { REG_SECONDS_REG = 0, REG_MINUTES_REG, REG_HOURS_REG, REG_DAYS_REG, REG_MONTHS_REG, REG_YEARS_REG, REG_WEEKS_REG, REG_ALARM_SECONDS_REG, REG_ALARM_MINUTES_REG, REG_ALARM_HOURS_REG, REG_ALARM_DAYS_REG, REG_ALARM_MONTHS_REG, REG_ALARM_YEARS_REG, REG_RTC_CTRL_REG, REG_RTC_STATUS_REG, REG_RTC_INTERRUPTS_REG, REG_RTC_COMP_LSB_REG, REG_RTC_COMP_MSB_REG, }; static const u8 twl4030_rtc_reg_map[] = { [REG_SECONDS_REG] = 0x00, [REG_MINUTES_REG] = 0x01, [REG_HOURS_REG] = 0x02, [REG_DAYS_REG] = 0x03, [REG_MONTHS_REG] = 0x04, [REG_YEARS_REG] = 0x05, [REG_WEEKS_REG] = 0x06, [REG_ALARM_SECONDS_REG] = 0x07, [REG_ALARM_MINUTES_REG] = 0x08, [REG_ALARM_HOURS_REG] = 0x09, [REG_ALARM_DAYS_REG] = 0x0A, [REG_ALARM_MONTHS_REG] = 0x0B, [REG_ALARM_YEARS_REG] = 0x0C, [REG_RTC_CTRL_REG] = 0x0D, [REG_RTC_STATUS_REG] = 0x0E, [REG_RTC_INTERRUPTS_REG] = 0x0F, [REG_RTC_COMP_LSB_REG] = 0x10, [REG_RTC_COMP_MSB_REG] = 0x11, }; static const u8 twl6030_rtc_reg_map[] = { [REG_SECONDS_REG] = 0x00, [REG_MINUTES_REG] = 0x01, [REG_HOURS_REG] = 0x02, [REG_DAYS_REG] = 0x03, [REG_MONTHS_REG] = 0x04, [REG_YEARS_REG] = 0x05, [REG_WEEKS_REG] = 0x06, [REG_ALARM_SECONDS_REG] = 0x08, [REG_ALARM_MINUTES_REG] = 0x09, [REG_ALARM_HOURS_REG] = 0x0A, [REG_ALARM_DAYS_REG] = 0x0B, [REG_ALARM_MONTHS_REG] = 0x0C, [REG_ALARM_YEARS_REG] = 0x0D, [REG_RTC_CTRL_REG] = 0x10, [REG_RTC_STATUS_REG] = 0x11, [REG_RTC_INTERRUPTS_REG] = 0x12, [REG_RTC_COMP_LSB_REG] = 0x13, [REG_RTC_COMP_MSB_REG] = 0x14, }; /* RTC_CTRL_REG bitfields */ #define BIT_RTC_CTRL_REG_STOP_RTC_M 0x01 #define BIT_RTC_CTRL_REG_ROUND_30S_M 0x02 #define BIT_RTC_CTRL_REG_AUTO_COMP_M 0x04 #define BIT_RTC_CTRL_REG_MODE_12_24_M 0x08 #define BIT_RTC_CTRL_REG_TEST_MODE_M 0x10 #define BIT_RTC_CTRL_REG_SET_32_COUNTER_M 0x20 #define BIT_RTC_CTRL_REG_GET_TIME_M 0x40 #define BIT_RTC_CTRL_REG_RTC_V_OPT 0x80 /* RTC_STATUS_REG bitfields */ #define BIT_RTC_STATUS_REG_RUN_M 0x02 #define BIT_RTC_STATUS_REG_1S_EVENT_M 0x04 #define BIT_RTC_STATUS_REG_1M_EVENT_M 0x08 #define BIT_RTC_STATUS_REG_1H_EVENT_M 0x10 #define BIT_RTC_STATUS_REG_1D_EVENT_M 0x20 #define BIT_RTC_STATUS_REG_ALARM_M 0x40 #define BIT_RTC_STATUS_REG_POWER_UP_M 0x80 /* RTC_INTERRUPTS_REG bitfields */ #define BIT_RTC_INTERRUPTS_REG_EVERY_M 0x03 #define BIT_RTC_INTERRUPTS_REG_IT_TIMER_M 0x04 #define BIT_RTC_INTERRUPTS_REG_IT_ALARM_M 0x08 /* REG_SECONDS_REG through REG_YEARS_REG is how many registers? */ #define ALL_TIME_REGS 6 /*----------------------------------------------------------------------*/ struct twl_rtc { struct device *dev; struct rtc_device *rtc; u8 *reg_map; /* * Cache the value for timer/alarm interrupts register; this is * only changed by callers holding rtc ops lock (or resume). */ unsigned char rtc_irq_bits; bool wake_enabled; #ifdef CONFIG_PM_SLEEP unsigned char irqstat; #endif enum twl_class class; }; /* * Supports 1 byte read from TWL RTC register. */ static int twl_rtc_read_u8(struct twl_rtc *twl_rtc, u8 *data, u8 reg) { int ret; ret = twl_i2c_read_u8(TWL_MODULE_RTC, data, (twl_rtc->reg_map[reg])); if (ret < 0) pr_err("Could not read TWL register %X - error %d\n", reg, ret); return ret; } /* * Supports 1 byte write to TWL RTC registers. */ static int twl_rtc_write_u8(struct twl_rtc *twl_rtc, u8 data, u8 reg) { int ret; ret = twl_i2c_write_u8(TWL_MODULE_RTC, data, (twl_rtc->reg_map[reg])); if (ret < 0) pr_err("Could not write TWL register %X - error %d\n", reg, ret); return ret; } /* * Enable 1/second update and/or alarm interrupts. */ static int set_rtc_irq_bit(struct twl_rtc *twl_rtc, unsigned char bit) { unsigned char val; int ret; /* if the bit is set, return from here */ if (twl_rtc->rtc_irq_bits & bit) return 0; val = twl_rtc->rtc_irq_bits | bit; val &= ~BIT_RTC_INTERRUPTS_REG_EVERY_M; ret = twl_rtc_write_u8(twl_rtc, val, REG_RTC_INTERRUPTS_REG); if (ret == 0) twl_rtc->rtc_irq_bits = val; return ret; } /* * Disable update and/or alarm interrupts. */ static int mask_rtc_irq_bit(struct twl_rtc *twl_rtc, unsigned char bit) { unsigned char val; int ret; /* if the bit is clear, return from here */ if (!(twl_rtc->rtc_irq_bits & bit)) return 0; val = twl_rtc->rtc_irq_bits & ~bit; ret = twl_rtc_write_u8(twl_rtc, val, REG_RTC_INTERRUPTS_REG); if (ret == 0) twl_rtc->rtc_irq_bits = val; return ret; } static int twl_rtc_alarm_irq_enable(struct device *dev, unsigned enabled) { struct platform_device *pdev = to_platform_device(dev); struct twl_rtc *twl_rtc = dev_get_drvdata(dev); int irq = platform_get_irq(pdev, 0); int ret; if (enabled) { ret = set_rtc_irq_bit(twl_rtc, BIT_RTC_INTERRUPTS_REG_IT_ALARM_M); if (device_can_wakeup(dev) && !twl_rtc->wake_enabled) { enable_irq_wake(irq); twl_rtc->wake_enabled = true; } } else { ret = mask_rtc_irq_bit(twl_rtc, BIT_RTC_INTERRUPTS_REG_IT_ALARM_M); if (twl_rtc->wake_enabled) { disable_irq_wake(irq); twl_rtc->wake_enabled = false; } } return ret; } /* * Gets current TWL RTC time and date parameters. * * The RTC's time/alarm representation is not what gmtime(3) requires * Linux to use: * * - Months are 1..12 vs Linux 0-11 * - Years are 0..99 vs Linux 1900..N (we assume 21st century) */ static int twl_rtc_read_time(struct device *dev, struct rtc_time *tm) { struct twl_rtc *twl_rtc = dev_get_drvdata(dev); unsigned char rtc_data[ALL_TIME_REGS]; int ret; u8 save_control; u8 rtc_control; ret = twl_rtc_read_u8(twl_rtc, &save_control, REG_RTC_CTRL_REG); if (ret < 0) { dev_err(dev, "%s: reading CTRL_REG, error %d\n", __func__, ret); return ret; } /* for twl6030/32 make sure BIT_RTC_CTRL_REG_GET_TIME_M is clear */ if (twl_rtc->class == TWL_6030) { if (save_control & BIT_RTC_CTRL_REG_GET_TIME_M) { save_control &= ~BIT_RTC_CTRL_REG_GET_TIME_M; ret = twl_rtc_write_u8(twl_rtc, save_control, REG_RTC_CTRL_REG); if (ret < 0) { dev_err(dev, "%s clr GET_TIME, error %d\n", __func__, ret); return ret; } } } /* Copy RTC counting registers to static registers or latches */ rtc_control = save_control | BIT_RTC_CTRL_REG_GET_TIME_M; /* for twl6030/32 enable read access to static shadowed registers */ if (twl_rtc->class == TWL_6030) rtc_control |= BIT_RTC_CTRL_REG_RTC_V_OPT; ret = twl_rtc_write_u8(twl_rtc, rtc_control, REG_RTC_CTRL_REG); if (ret < 0) { dev_err(dev, "%s: writing CTRL_REG, error %d\n", __func__, ret); return ret; } ret = twl_i2c_read(TWL_MODULE_RTC, rtc_data, (twl_rtc->reg_map[REG_SECONDS_REG]), ALL_TIME_REGS); if (ret < 0) { dev_err(dev, "%s: reading data, error %d\n", __func__, ret); return ret; } /* for twl6030 restore original state of rtc control register */ if (twl_rtc->class == TWL_6030) { ret = twl_rtc_write_u8(twl_rtc, save_control, REG_RTC_CTRL_REG); if (ret < 0) { dev_err(dev, "%s: restore CTRL_REG, error %d\n", __func__, ret); return ret; } } tm->tm_sec = bcd2bin(rtc_data[0]); tm->tm_min = bcd2bin(rtc_data[1]); tm->tm_hour = bcd2bin(rtc_data[2]); tm->tm_mday = bcd2bin(rtc_data[3]); tm->tm_mon = bcd2bin(rtc_data[4]) - 1; tm->tm_year = bcd2bin(rtc_data[5]) + 100; return ret; } static int twl_rtc_set_time(struct device *dev, struct rtc_time *tm) { struct twl_rtc *twl_rtc = dev_get_drvdata(dev); unsigned char save_control; unsigned char rtc_data[ALL_TIME_REGS]; int ret; rtc_data[0] = bin2bcd(tm->tm_sec); rtc_data[1] = bin2bcd(tm->tm_min); rtc_data[2] = bin2bcd(tm->tm_hour); rtc_data[3] = bin2bcd(tm->tm_mday); rtc_data[4] = bin2bcd(tm->tm_mon + 1); rtc_data[5] = bin2bcd(tm->tm_year - 100); /* Stop RTC while updating the TC registers */ ret = twl_rtc_read_u8(twl_rtc, &save_control, REG_RTC_CTRL_REG); if (ret < 0) goto out; save_control &= ~BIT_RTC_CTRL_REG_STOP_RTC_M; ret = twl_rtc_write_u8(twl_rtc, save_control, REG_RTC_CTRL_REG); if (ret < 0) goto out; /* update all the time registers in one shot */ ret = twl_i2c_write(TWL_MODULE_RTC, rtc_data, (twl_rtc->reg_map[REG_SECONDS_REG]), ALL_TIME_REGS); if (ret < 0) { dev_err(dev, "rtc_set_time error %d\n", ret); goto out; } /* Start back RTC */ save_control |= BIT_RTC_CTRL_REG_STOP_RTC_M; ret = twl_rtc_write_u8(twl_rtc, save_control, REG_RTC_CTRL_REG); out: return ret; } /* * Gets current TWL RTC alarm time. */ static int twl_rtc_read_alarm(struct device *dev, struct rtc_wkalrm *alm) { struct twl_rtc *twl_rtc = dev_get_drvdata(dev); unsigned char rtc_data[ALL_TIME_REGS]; int ret; ret = twl_i2c_read(TWL_MODULE_RTC, rtc_data, twl_rtc->reg_map[REG_ALARM_SECONDS_REG], ALL_TIME_REGS); if (ret < 0) { dev_err(dev, "rtc_read_alarm error %d\n", ret); return ret; } /* some of these fields may be wildcard/"match all" */ alm->time.tm_sec = bcd2bin(rtc_data[0]); alm->time.tm_min = bcd2bin(rtc_data[1]); alm->time.tm_hour = bcd2bin(rtc_data[2]); alm->time.tm_mday = bcd2bin(rtc_data[3]); alm->time.tm_mon = bcd2bin(rtc_data[4]) - 1; alm->time.tm_year = bcd2bin(rtc_data[5]) + 100; /* report cached alarm enable state */ if (twl_rtc->rtc_irq_bits & BIT_RTC_INTERRUPTS_REG_IT_ALARM_M) alm->enabled = 1; return ret; } static int twl_rtc_set_alarm(struct device *dev, struct rtc_wkalrm *alm) { struct twl_rtc *twl_rtc = dev_get_drvdata(dev); unsigned char alarm_data[ALL_TIME_REGS]; int ret; ret = twl_rtc_alarm_irq_enable(dev, 0); if (ret) goto out; alarm_data[0] = bin2bcd(alm->time.tm_sec); alarm_data[1] = bin2bcd(alm->time.tm_min); alarm_data[2] = bin2bcd(alm->time.tm_hour); alarm_data[3] = bin2bcd(alm->time.tm_mday); alarm_data[4] = bin2bcd(alm->time.tm_mon + 1); alarm_data[5] = bin2bcd(alm->time.tm_year - 100); /* update all the alarm registers in one shot */ ret = twl_i2c_write(TWL_MODULE_RTC, alarm_data, twl_rtc->reg_map[REG_ALARM_SECONDS_REG], ALL_TIME_REGS); if (ret) { dev_err(dev, "rtc_set_alarm error %d\n", ret); goto out; } if (alm->enabled) ret = twl_rtc_alarm_irq_enable(dev, 1); out: return ret; } static irqreturn_t twl_rtc_interrupt(int irq, void *data) { struct twl_rtc *twl_rtc = data; unsigned long events; int ret = IRQ_NONE; int res; u8 rd_reg; res = twl_rtc_read_u8(twl_rtc, &rd_reg, REG_RTC_STATUS_REG); if (res) goto out; /* * Figure out source of interrupt: ALARM or TIMER in RTC_STATUS_REG. * only one (ALARM or RTC) interrupt source may be enabled * at time, we also could check our results * by reading RTS_INTERRUPTS_REGISTER[IT_TIMER,IT_ALARM] */ if (rd_reg & BIT_RTC_STATUS_REG_ALARM_M) events = RTC_IRQF | RTC_AF; else events = RTC_IRQF | RTC_PF; res = twl_rtc_write_u8(twl_rtc, BIT_RTC_STATUS_REG_ALARM_M, REG_RTC_STATUS_REG); if (res) goto out; if (twl_rtc->class == TWL_4030) { /* Clear on Read enabled. RTC_IT bit of TWL4030_INT_PWR_ISR1 * needs 2 reads to clear the interrupt. One read is done in * do_twl_pwrirq(). Doing the second read, to clear * the bit. * * FIXME the reason PWR_ISR1 needs an extra read is that * RTC_IF retriggered until we cleared REG_ALARM_M above. * But re-reading like this is a bad hack; by doing so we * risk wrongly clearing status for some other IRQ (losing * the interrupt). Be smarter about handling RTC_UF ... */ res = twl_i2c_read_u8(TWL4030_MODULE_INT, &rd_reg, TWL4030_INT_PWR_ISR1); if (res) goto out; } /* Notify RTC core on event */ rtc_update_irq(twl_rtc->rtc, 1, events); ret = IRQ_HANDLED; out: return ret; } static const struct rtc_class_ops twl_rtc_ops = { .read_time = twl_rtc_read_time, .set_time = twl_rtc_set_time, .read_alarm = twl_rtc_read_alarm, .set_alarm = twl_rtc_set_alarm, .alarm_irq_enable = twl_rtc_alarm_irq_enable, }; /*----------------------------------------------------------------------*/ static int twl_rtc_probe(struct platform_device *pdev) { struct twl_rtc *twl_rtc; struct device_node *np = pdev->dev.of_node; int ret = -EINVAL; int irq = platform_get_irq(pdev, 0); u8 rd_reg; if (!np) { dev_err(&pdev->dev, "no DT info\n"); return -EINVAL; } if (irq <= 0) return ret; twl_rtc = devm_kzalloc(&pdev->dev, sizeof(*twl_rtc), GFP_KERNEL); if (!twl_rtc) return -ENOMEM; if (twl_class_is_4030()) { twl_rtc->class = TWL_4030; twl_rtc->reg_map = (u8 *)twl4030_rtc_reg_map; } else if (twl_class_is_6030()) { twl_rtc->class = TWL_6030; twl_rtc->reg_map = (u8 *)twl6030_rtc_reg_map; } else { dev_err(&pdev->dev, "TWL Class not supported.\n"); return -EINVAL; } ret = twl_rtc_read_u8(twl_rtc, &rd_reg, REG_RTC_STATUS_REG); if (ret < 0) return ret; if (rd_reg & BIT_RTC_STATUS_REG_POWER_UP_M) dev_warn(&pdev->dev, "Power up reset detected.\n"); if (rd_reg & BIT_RTC_STATUS_REG_ALARM_M) dev_warn(&pdev->dev, "Pending Alarm interrupt detected.\n"); /* Clear RTC Power up reset and pending alarm interrupts */ ret = twl_rtc_write_u8(twl_rtc, rd_reg, REG_RTC_STATUS_REG); if (ret < 0) return ret; if (twl_rtc->class == TWL_6030) { twl6030_interrupt_unmask(TWL6030_RTC_INT_MASK, REG_INT_MSK_LINE_A); twl6030_interrupt_unmask(TWL6030_RTC_INT_MASK, REG_INT_MSK_STS_A); } dev_info(&pdev->dev, "Enabling TWL-RTC\n"); ret = twl_rtc_write_u8(twl_rtc, BIT_RTC_CTRL_REG_STOP_RTC_M, REG_RTC_CTRL_REG); if (ret < 0) return ret; /* ensure interrupts are disabled, bootloaders can be strange */ ret = twl_rtc_write_u8(twl_rtc, 0, REG_RTC_INTERRUPTS_REG); if (ret < 0) dev_warn(&pdev->dev, "unable to disable interrupt\n"); /* init cached IRQ enable bits */ ret = twl_rtc_read_u8(twl_rtc, &twl_rtc->rtc_irq_bits, REG_RTC_INTERRUPTS_REG); if (ret < 0) return ret; platform_set_drvdata(pdev, twl_rtc); device_init_wakeup(&pdev->dev, 1); twl_rtc->rtc = devm_rtc_device_register(&pdev->dev, pdev->name, &twl_rtc_ops, THIS_MODULE); if (IS_ERR(twl_rtc->rtc)) { dev_err(&pdev->dev, "can't register RTC device, err %ld\n", PTR_ERR(twl_rtc->rtc)); return PTR_ERR(twl_rtc->rtc); } ret = devm_request_threaded_irq(&pdev->dev, irq, NULL, twl_rtc_interrupt, IRQF_TRIGGER_RISING | IRQF_ONESHOT, dev_name(&twl_rtc->rtc->dev), twl_rtc); if (ret < 0) { dev_err(&pdev->dev, "IRQ is not free.\n"); return ret; } return 0; } /* * Disable all TWL RTC module interrupts. * Sets status flag to free. */ static int twl_rtc_remove(struct platform_device *pdev) { struct twl_rtc *twl_rtc = platform_get_drvdata(pdev); /* leave rtc running, but disable irqs */ mask_rtc_irq_bit(twl_rtc, BIT_RTC_INTERRUPTS_REG_IT_ALARM_M); mask_rtc_irq_bit(twl_rtc, BIT_RTC_INTERRUPTS_REG_IT_TIMER_M); if (twl_rtc->class == TWL_6030) { twl6030_interrupt_mask(TWL6030_RTC_INT_MASK, REG_INT_MSK_LINE_A); twl6030_interrupt_mask(TWL6030_RTC_INT_MASK, REG_INT_MSK_STS_A); } return 0; } static void twl_rtc_shutdown(struct platform_device *pdev) { struct twl_rtc *twl_rtc = platform_get_drvdata(pdev); /* mask timer interrupts, but leave alarm interrupts on to enable power-on when alarm is triggered */ mask_rtc_irq_bit(twl_rtc, BIT_RTC_INTERRUPTS_REG_IT_TIMER_M); } #ifdef CONFIG_PM_SLEEP static int twl_rtc_suspend(struct device *dev) { struct twl_rtc *twl_rtc = dev_get_drvdata(dev); twl_rtc->irqstat = twl_rtc->rtc_irq_bits; mask_rtc_irq_bit(twl_rtc, BIT_RTC_INTERRUPTS_REG_IT_TIMER_M); return 0; } static int twl_rtc_resume(struct device *dev) { struct twl_rtc *twl_rtc = dev_get_drvdata(dev); set_rtc_irq_bit(twl_rtc, twl_rtc->irqstat); return 0; } #endif static SIMPLE_DEV_PM_OPS(twl_rtc_pm_ops, twl_rtc_suspend, twl_rtc_resume); static const struct of_device_id twl_rtc_of_match[] = { {.compatible = "ti,twl4030-rtc", }, { }, }; MODULE_DEVICE_TABLE(of, twl_rtc_of_match); static struct platform_driver twl4030rtc_driver = { .probe = twl_rtc_probe, .remove = twl_rtc_remove, .shutdown = twl_rtc_shutdown, .driver = { .name = "twl_rtc", .pm = &twl_rtc_pm_ops, .of_match_table = twl_rtc_of_match, }, }; module_platform_driver(twl4030rtc_driver); MODULE_AUTHOR("Texas Instruments, MontaVista Software"); MODULE_LICENSE("GPL");
{ "pile_set_name": "Github" }
from .wordcloud import (WordCloud, STOPWORDS, random_color_func, get_single_color_func) from .color_from_image import ImageColorGenerator __all__ = ['WordCloud', 'STOPWORDS', 'random_color_func', 'get_single_color_func', 'ImageColorGenerator', '__version__'] from ._version import get_versions __version__ = get_versions()['version'] del get_versions
{ "pile_set_name": "Github" }
cadj SUBROUTINE STREAMICE_CG_SOLVE FTLNAME = STREAMICE_CG_SOLVE cadj SUBROUTINE STREAMICE_CG_SOLVE ADNAME = adSTREAMICE_CG_SOLVE cadj SUBROUTINE STREAMICE_CG_SOLVE INPUT = 1,2,3,4,5,6,7,8,9, 11,12 cadj SUBROUTINE STREAMICE_CG_SOLVE OUTPUT = 1,2 ,10 cadj SUBROUTINE STREAMICE_CG_SOLVE ACTIVE = 1,2,3,4,5,6,7,8 cadj SUBROUTINE STREAMICE_CG_SOLVE DEPEND = 1,2,3,4,5,6,7,8,9 ,11,12 cadj SUBROUTINE STREAMICE_INVERT_SURF_FORTHICK INPUT = 5 cadj SUBROUTINE STREAMICE_INVERT_SURF_FORTHICK OUTPUT = cadj SUBROUTINE STREAMICE_INVERT_SURF_FORTHICK ACTIVE = cadj SUBROUTINE STREAMICE_INVERT_SURF_FORTHICK DEPEND = 5 cadj SUBROUTINE STREAMICE_INVERT_SURF_FORTHICK REQUIRED cadj SUBROUTINE STREAMICE_INVERT_SURF_FORTHICK INFLUENCED cadj SUBROUTINE STREAMICE_INVERT_SURF_FORTHICK FTLNAME = STRMICE_H_INV cadj SUBROUTINE STREAMICE_INVERT_SURF_FORTHICK ADNAME = ADSTRMICE_H_INV cadj SUBROUTINE STREAMICE_DUMP INPUT = 1, 2, 3 cadj SUBROUTINE STREAMICE_DUMP OUTPUT = cadj SUBROUTINE STREAMICE_DUMP ACTIVE = cadj SUBROUTINE STREAMICE_DUMP DEPEND = 1, 2, 3 cadj SUBROUTINE STREAMICE_DUMP REQUIRED cadj SUBROUTINE STREAMICE_DUMP INFLUENCED cadj SUBROUTINE STREAMICE_DUMP ADNAME = adSTREAMICE_DUMP cadj SUBROUTINE STREAMICE_DUMP FTLNAME = STREAMICE_DUMP
{ "pile_set_name": "Github" }
#include "precomp.h" #include "common_metapi.h" DWORD remote_load_library(HANDLE process, LPCSTR image, HMODULE *base); DWORD remote_get_proc_address(HANDLE process, HMODULE module, LPCSTR symbol, LPVOID *address); DWORD remote_unload_library(HANDLE process, HMODULE base); /* * Loads an image file into the context of the supplied process. * * req: TLV_TYPE_HANDLE - The process handle to load the image into. * req: TLV_TYPE_IMAGE_FILE_PATH - The path to the image file that is to be * loaded. */ DWORD request_sys_process_image_load(Remote *remote, Packet *packet) { Packet *response = met_api->packet.create_response(packet); DWORD result = ERROR_SUCCESS; HANDLE handle; LPCSTR image; HMODULE base; handle = (HANDLE)met_api->packet.get_tlv_value_qword(packet, TLV_TYPE_HANDLE); image = met_api->packet.get_tlv_value_string(packet, TLV_TYPE_IMAGE_FILE_PATH); do { // Validate parameters if ((!handle) || (!image)) { result = ERROR_INVALID_PARAMETER; break; } // If the handle is not the current process, load the library // into the context of the remote process if (handle != GetCurrentProcess()) result = remote_load_library(handle, image, &base); else { // Load the image file if (!(base = LoadLibrary(image))) { result = GetLastError(); break; } } // Add the base address to the result met_api->packet.add_tlv_qword(response, TLV_TYPE_IMAGE_BASE, (QWORD)base); } while (0); // Transmit the response met_api->packet.transmit_response(result, remote, response); return ERROR_SUCCESS; } /* * Returns the address of a procedure that is associated with the supplied * module to the requestor. * * req: TLV_TYPE_IMAGE_NAME - The name of the image to query. * req: TLV_TYPE_PROCEDURE_NAME - The name of the procedure to query. */ DWORD request_sys_process_image_get_proc_address(Remote *remote, Packet *packet) { Packet *response = met_api->packet.create_response(packet); DWORD result = ERROR_SUCCESS; HMODULE mod = NULL; BOOLEAN unload = FALSE; HANDLE process; LPCSTR image; LPCSTR procedure; LPVOID address = NULL; process = (HANDLE)met_api->packet.get_tlv_value_qword(packet, TLV_TYPE_HANDLE); image = met_api->packet.get_tlv_value_string(packet, TLV_TYPE_IMAGE_FILE); procedure = met_api->packet.get_tlv_value_string(packet, TLV_TYPE_PROCEDURE_NAME); do { // Validate parameters if ((!image) || (!procedure)) { result = ERROR_INVALID_PARAMETER; break; } // If the process handle is not this process... if (process != GetCurrentProcess()) { if ((result = remote_load_library(process, image, &mod)) != ERROR_SUCCESS) break; if ((result = remote_get_proc_address(process, mod, procedure, &address)) != ERROR_SUCCESS) break; } // Otherwise, load the library locally else { unload = TRUE; if (!(mod = LoadLibrary(image))) { result = GetLastError(); break; } // Try to resolve the procedure name if (!(address = (LPVOID)GetProcAddress(mod, procedure))) { result = GetLastError(); break; } } // Set the procedure address on the response met_api->packet.add_tlv_qword(response, TLV_TYPE_PROCEDURE_ADDRESS, (QWORD)address); } while (0); // Lose the reference to the module if ((mod) && (unload)) FreeLibrary(mod); else if (mod) remote_unload_library(process, mod); // Transmit the response met_api->packet.transmit_response(result, remote, response); return ERROR_SUCCESS; } /* * Unloads an image file using the base address supplied by the requestor * * req: TLV_TYPE_HANDLE - The process to unload the image in * req: TLV_TYPE_IMAGE_BASE - The base address of the image to unload */ DWORD request_sys_process_image_unload(Remote *remote, Packet *packet) { Packet *response = met_api->packet.create_response(packet); HANDLE handle; LPVOID base; DWORD result = ERROR_SUCCESS; handle = (HANDLE)met_api->packet.get_tlv_value_qword(packet, TLV_TYPE_HANDLE); base = (LPVOID)met_api->packet.get_tlv_value_qword(packet, TLV_TYPE_IMAGE_BASE); do { // Validate parameters if ((!handle) || (!base)) { result = ERROR_INVALID_PARAMETER; break; } if (handle != GetCurrentProcess()) result = remote_unload_library(handle, base); else { // Unload the library if (!FreeLibrary(base)) result = GetLastError(); } } while (0); // Transmit the response met_api->packet.transmit_response(result, remote, response); return ERROR_SUCCESS; } typedef BOOL (WINAPI *PEnumProcessModules)(HANDLE p, HMODULE *mod, DWORD cb, LPDWORD needed); typedef DWORD (WINAPI *PGetModuleBaseName)(HANDLE p, HMODULE mod, LPTSTR base, DWORD baseSize); typedef DWORD (WINAPI *PGetModuleFileNameEx)(HANDLE p, HMODULE mod, LPTSTR path, DWORD pathSize); /* * Returns a list of all of the loaded image files and their base addresses to * the requestor. * * req: TLV_TYPE_HANDLE - The process handle to enumerate the images of */ DWORD request_sys_process_image_get_images(Remote *remote, Packet *packet) { Packet *response = met_api->packet.create_response(packet); HMODULE *modules = NULL; BOOLEAN valid = FALSE; HMODULE psapi = NULL; HANDLE handle; DWORD result = ERROR_SUCCESS; DWORD needed = 0, actual, tries = 0; DWORD index; PEnumProcessModules enumProcessModules = NULL; PGetModuleBaseName getModuleBaseName = NULL; PGetModuleFileNameEx getModuleFileNameEx = NULL; handle = (HANDLE)met_api->packet.get_tlv_value_qword(packet, TLV_TYPE_HANDLE); do { // No response? No sense. if (!response) break; // Open the process API if (!(psapi = LoadLibrary("psapi"))) { result = GetLastError(); break; } if (!(enumProcessModules = (PEnumProcessModules)GetProcAddress(psapi, "EnumProcessModules"))) { result = GetLastError(); break; } if (!(getModuleBaseName = (PGetModuleBaseName)GetProcAddress(psapi, "GetModuleBaseNameA"))) { result = GetLastError(); break; } if (!(getModuleFileNameEx = (PGetModuleFileNameEx)GetProcAddress(psapi, "GetModuleFileNameExA"))) { result = GetLastError(); break; } // Validate parameters if (!handle) { result = ERROR_INVALID_PARAMETER; break; } // The current actual size of the array in bytes actual = sizeof(HMODULE) * 512; do { // Free previous storage if (modules) free(modules); // Allocate storage for the array modules = (HMODULE *)malloc(actual); // Try to enumerate the image's modules if (enumProcessModules(handle, modules, actual, &needed)) { valid = TRUE; break; } } while ((actual < needed) && (tries++ < 3)); // If we failed to succeed... if (!valid) { result = GetLastError(); break; } // Enumerate through all of the modules... for (index = 0; index < needed / sizeof(HMODULE); index++) { char path[1024], name[512]; DWORD base = 0; Tlv tlvs[3]; memset(name, 0, sizeof(name)); memset(path, 0, sizeof(path)); // Query for base name and file name if ((!getModuleBaseName(handle, modules[index], name, sizeof(name) - 1)) || (!getModuleFileNameEx(handle, modules[index], path, sizeof(path) - 1))) { result = GetLastError(); break; } base = htonl((DWORD)modules[index]); tlvs[0].header.length = sizeof(HMODULE); tlvs[0].header.type = TLV_TYPE_IMAGE_BASE; tlvs[0].buffer = (PUCHAR)&base; tlvs[1].header.length = (DWORD)strlen(path) + 1; tlvs[1].header.type = TLV_TYPE_IMAGE_FILE_PATH; tlvs[1].buffer = (PUCHAR)path; tlvs[2].header.length = (DWORD)strlen(name) + 1; tlvs[2].header.type = TLV_TYPE_IMAGE_NAME; tlvs[2].buffer = (PUCHAR)name; met_api->packet.add_tlv_group(response, TLV_TYPE_IMAGE_GROUP, tlvs, 3); } } while (0); // Transmit the response met_api->packet.transmit_response(result, remote, response); // Cleanup if (modules) free(modules); // Close the psapi library and clean up if (psapi) FreeLibrary(psapi); return ERROR_SUCCESS; } /******************* * Helper routines * *******************/ typedef struct _LoadLibraryContext { LPVOID loadLibraryAddress; CHAR imagePath[1]; } LoadLibraryContext; typedef struct _GetProcAddressContext { LPVOID getProcAddress; HMODULE module; CHAR symbol[1]; } GetProcAddressContext; typedef struct _UnloadLibraryContext { LPVOID freeLibraryAddress; HMODULE module; } UnloadLibraryContext; /* * Loads a library into the context of a remote process */ DWORD remote_load_library(HANDLE process, LPCSTR image, HMODULE *base) { LoadLibraryContext *context = NULL; DWORD result = ERROR_SUCCESS; DWORD contextSize = 0; DWORD imagePathSize = 0; BYTE loadLibraryStub[] = "\x8b\x54\x24\x04" // see load_library_stub "\x8d\x5a\x04" "\x53" "\xff\x12" "\xc2\x04\x00"; do { // Calculate the size of the context we'll be passing imagePathSize = (DWORD)strlen(image) + 1; contextSize = imagePathSize + sizeof(LoadLibraryContext); if (!(context = (LoadLibraryContext *)malloc(contextSize))) { result = ERROR_NOT_ENOUGH_MEMORY; break; } // Initialize the context context->loadLibraryAddress = (PVOID)GetProcAddress( GetModuleHandle("kernel32"), "LoadLibraryA"); strcpy_s(context->imagePath, imagePathSize, image); // Execute the LoadLibraryA stub result = execute_code_stub_in_process(process, (PVOID)loadLibraryStub, sizeof(loadLibraryStub) - 1, context, contextSize, (LPDWORD)base); } while (0); if (context) free(context); return result; } /* * Gets the address of a procedure that exists in a remote * process */ DWORD remote_get_proc_address(HANDLE process, HMODULE module, LPCSTR symbol, LPVOID *address) { GetProcAddressContext *context = NULL; DWORD result = ERROR_SUCCESS; DWORD contextSize = 0; DWORD symbolSize = 0; BYTE getProcAddressStub[] = "\x8b\x54\x24\x04" // see unload_library_stub "\x8b\x5a\x04" "\x8d\x4a\x08" "\x51" "\x53" "\xff\x12" "\xc2\x04\x00"; do { // Calculate the size of the context we'll be passing symbolSize = (DWORD)strlen(symbol) + 1; contextSize = symbolSize + sizeof(GetProcAddressContext); if (!(context = (GetProcAddressContext *)malloc(contextSize))) { result = ERROR_NOT_ENOUGH_MEMORY; break; } // Initialize the context context->getProcAddress = (PVOID)GetProcAddress( GetModuleHandle("kernel32"), "GetProcAddress"); context->module = module; strcpy_s(context->symbol, symbolSize, symbol); // Execute the LoadLibraryA stub result = execute_code_stub_in_process(process, (PVOID)getProcAddressStub, sizeof(getProcAddressStub) - 1, context, contextSize, (LPDWORD)address); } while (0); if (context) free(context); return result; } /* * Unloads a library in the context of a remote process */ DWORD remote_unload_library(HANDLE process, HMODULE base) { UnloadLibraryContext context; DWORD result = ERROR_SUCCESS; BYTE unloadLibraryStub[] = "\x8b\x54\x24\x04" // see unload_library_stub "\xff\x72\x04" "\xff\x12" "\xc2\x04\x00"; do { // Initialize the context context.freeLibraryAddress = (PVOID)GetProcAddress( GetModuleHandle("kernel32"), "FreeLibrary"); context.module = base; // Execute the FreeLibrary stub result = execute_code_stub_in_process(process, (PVOID)unloadLibraryStub, sizeof(unloadLibraryStub) - 1, &context, sizeof(context), NULL); } while (0); return result; } /*********************** * Internal code stubs * ***********************/ #if 0 VOID __declspec(naked) load_library_stub() { __asm { mov edx, [esp + 0x4] // edx = ctx lea ebx, [edx + 0x4] // ebx = &ctx->path push ebx // library path call [edx] // call ctx->LoadLibraryA retn 0x4 // return } } VOID __declspec(naked) get_proc_address_stub() { __asm { mov edx, [esp + 0x4] // edx = ctx mov ebx, [edx + 0x4] // ebx = ctx->module lea ecx, [edx + 0x8] // ecx = &ctx->symbol push ecx // push symbol push ebx // push module call [edx] // call ctx->GetProcAddress retn 0x4 // return } } VOID __declspec(naked) unload_library_stub() { __asm { mov edx, [esp + 0x4] // edx = ctx push [edx + 0x4] // push module call [edx] // call ctx->FreeLibrary retn 0x4 // return } } #endif
{ "pile_set_name": "Github" }
base class A{a: Int, b: String} class B{x: String, t: Int} extends A fun myMatch(x: A): String { x match { | A{a => 1, b => "a"} -> "P" | A{a => 2, b => _} -> "a" | B{x => "Hi", t => 1, b => "b"} -> "s" | B _ -> "\n" | A{a => 42, b => "c"} -> "s" } }
{ "pile_set_name": "Github" }
#!/bin/sh set -e if ! test -e "$SETUP_INSTALLPATH"/ioquake3.desktop.in; then exit 0 fi xdg_desktop_menu=`which xdg-desktop-menu 2>/dev/null` if test "x$xdg_desktop_menu" = x; then xdg_desktop_menu=./xdg-desktop-menu fi sed -e "s#^Exec=.*#Exec=$SETUP_INSTALLPATH/ioquake3#" \ -e "s#^Icon=.*#Icon=$SETUP_INSTALLPATH/quake3.png#" \ < $SETUP_INSTALLPATH/ioquake3.desktop.in \ > $SETUP_INSTALLPATH/ioquake3.desktop $xdg_desktop_menu install --novendor $SETUP_INSTALLPATH/ioquake3.desktop
{ "pile_set_name": "Github" }
 Microsoft Visual Studio Solution File, Format Version 11.00 # Visual Studio 2010 Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "74_创建包围轮廓的圆形边界", "74_创建包围轮廓的圆形边界\74_创建包围轮廓的圆形边界.vcxproj", "{09B9AA2A-21AE-49F1-AD0B-48427868898A}" EndProject Global GlobalSection(SolutionConfigurationPlatforms) = preSolution Debug|Win32 = Debug|Win32 Release|Win32 = Release|Win32 EndGlobalSection GlobalSection(ProjectConfigurationPlatforms) = postSolution {09B9AA2A-21AE-49F1-AD0B-48427868898A}.Debug|Win32.ActiveCfg = Debug|Win32 {09B9AA2A-21AE-49F1-AD0B-48427868898A}.Debug|Win32.Build.0 = Debug|Win32 {09B9AA2A-21AE-49F1-AD0B-48427868898A}.Release|Win32.ActiveCfg = Release|Win32 {09B9AA2A-21AE-49F1-AD0B-48427868898A}.Release|Win32.Build.0 = Release|Win32 EndGlobalSection GlobalSection(SolutionProperties) = preSolution HideSolutionNode = FALSE EndGlobalSection EndGlobal
{ "pile_set_name": "Github" }
# Chapter 6 ## Example: Classifying Surname Nationality Using a Character RNN ### Notebooks - (for dataset preprocessing) [Chapter-6-Munging-Surname-Dataset](classifying-surnames/Chapter-6-Munging-Surname-Dataset.ipynb) - [Chapter-6-Surname-Classification-with-RNNs](classifying-surnames/Chapter-6-Surname-Classification-with-RNNs.ipynb) ### Corresponding examples in the book - Example 6-1. An implementation of the Elman RNN using PyTorch’s RNNCell - Example 6-2. Implementing the SurnameDataset class - Example 6-3. A vectorizer for surnames - Example 6-4. Implementing the SurnameClassifier model using an Elman RNN - Example 6-5. Retrieving the final output vector in each sequence using `column_gather()` - Example 6-6. Arguments to the RNN-based SurnameClassifier
{ "pile_set_name": "Github" }
//! moment.js locale configuration //! locale : Arabic [ar] //! author : Abdel Said: https://github.com/abdelsaid //! author : Ahmed Elkhatib //! author : forabi https://github.com/forabi ;(function (global, factory) { typeof exports === 'object' && typeof module !== 'undefined' && typeof require === 'function' ? factory(require('../moment')) : typeof define === 'function' && define.amd ? define(['../moment'], factory) : factory(global.moment) }(this, (function (moment) { 'use strict'; var symbolMap = { '1': '١', '2': '٢', '3': '٣', '4': '٤', '5': '٥', '6': '٦', '7': '٧', '8': '٨', '9': '٩', '0': '٠' }; var numberMap = { '١': '1', '٢': '2', '٣': '3', '٤': '4', '٥': '5', '٦': '6', '٧': '7', '٨': '8', '٩': '9', '٠': '0' }; var pluralForm = function (n) { return n === 0 ? 0 : n === 1 ? 1 : n === 2 ? 2 : n % 100 >= 3 && n % 100 <= 10 ? 3 : n % 100 >= 11 ? 4 : 5; }; var plurals = { s : ['أقل من ثانية', 'ثانية واحدة', ['ثانيتان', 'ثانيتين'], '%d ثوان', '%d ثانية', '%d ثانية'], m : ['أقل من دقيقة', 'دقيقة واحدة', ['دقيقتان', 'دقيقتين'], '%d دقائق', '%d دقيقة', '%d دقيقة'], h : ['أقل من ساعة', 'ساعة واحدة', ['ساعتان', 'ساعتين'], '%d ساعات', '%d ساعة', '%d ساعة'], d : ['أقل من يوم', 'يوم واحد', ['يومان', 'يومين'], '%d أيام', '%d يومًا', '%d يوم'], M : ['أقل من شهر', 'شهر واحد', ['شهران', 'شهرين'], '%d أشهر', '%d شهرا', '%d شهر'], y : ['أقل من عام', 'عام واحد', ['عامان', 'عامين'], '%d أعوام', '%d عامًا', '%d عام'] }; var pluralize = function (u) { return function (number, withoutSuffix, string, isFuture) { var f = pluralForm(number), str = plurals[u][pluralForm(number)]; if (f === 2) { str = str[withoutSuffix ? 0 : 1]; } return str.replace(/%d/i, number); }; }; var months = [ 'كانون الثاني يناير', 'شباط فبراير', 'آذار مارس', 'نيسان أبريل', 'أيار مايو', 'حزيران يونيو', 'تموز يوليو', 'آب أغسطس', 'أيلول سبتمبر', 'تشرين الأول أكتوبر', 'تشرين الثاني نوفمبر', 'كانون الأول ديسمبر' ]; var ar = moment.defineLocale('ar', { months : months, monthsShort : months, weekdays : 'الأحد_الإثنين_الثلاثاء_الأربعاء_الخميس_الجمعة_السبت'.split('_'), weekdaysShort : 'أحد_إثنين_ثلاثاء_أربعاء_خميس_جمعة_سبت'.split('_'), weekdaysMin : 'ح_ن_ث_ر_خ_ج_س'.split('_'), weekdaysParseExact : true, longDateFormat : { LT : 'HH:mm', LTS : 'HH:mm:ss', L : 'D/\u200FM/\u200FYYYY', LL : 'D MMMM YYYY', LLL : 'D MMMM YYYY HH:mm', LLLL : 'dddd D MMMM YYYY HH:mm' }, meridiemParse: /ص|م/, isPM : function (input) { return 'م' === input; }, meridiem : function (hour, minute, isLower) { if (hour < 12) { return 'ص'; } else { return 'م'; } }, calendar : { sameDay: '[اليوم عند الساعة] LT', nextDay: '[غدًا عند الساعة] LT', nextWeek: 'dddd [عند الساعة] LT', lastDay: '[أمس عند الساعة] LT', lastWeek: 'dddd [عند الساعة] LT', sameElse: 'L' }, relativeTime : { future : 'بعد %s', past : 'منذ %s', s : pluralize('s'), m : pluralize('m'), mm : pluralize('m'), h : pluralize('h'), hh : pluralize('h'), d : pluralize('d'), dd : pluralize('d'), M : pluralize('M'), MM : pluralize('M'), y : pluralize('y'), yy : pluralize('y') }, preparse: function (string) { return string.replace(/[١٢٣٤٥٦٧٨٩٠]/g, function (match) { return numberMap[match]; }).replace(/،/g, ','); }, postformat: function (string) { return string.replace(/\d/g, function (match) { return symbolMap[match]; }).replace(/,/g, '،'); }, week : { dow : 6, // Saturday is the first day of the week. doy : 12 // The week that contains Jan 1st is the first week of the year. } }); return ar; })));
{ "pile_set_name": "Github" }
Begin VB.Form Form Begin TabDlg.SSTab Tab1 TabCaption(0) = "Tab 1" Tab(0).ControlEnabled = 0 'False Tab(0).Control(1).Enabled= 0 'False End End
{ "pile_set_name": "Github" }
# [Snow Report for Whiteface Mountain](http://alexa.amazon.com/#skills/amzn1.ask.skill.bd298a52-10e9-46ca-b2c6-c6d631ea843c) ![0 stars](../../images/ic_star_border_black_18dp_1x.png)![0 stars](../../images/ic_star_border_black_18dp_1x.png)![0 stars](../../images/ic_star_border_black_18dp_1x.png)![0 stars](../../images/ic_star_border_black_18dp_1x.png)![0 stars](../../images/ic_star_border_black_18dp_1x.png) 0 To use the Snow Report for Whiteface Mountain skill, try saying... * *Alexa, open Whiteface Mountain* * *Alexa, ask Whiteface Mountain for the snow report* * *Alexa, ask Whiteface Mountain for latest conditions* The Whiteface Mountain Snow Report brought to you by SnoCountry brings you the latest snow fall, snow surface conditions, base depth, trail, and lift operations information. *** ### Skill Details * **Invocation Name:** whiteface mountain * **Category:** null * **ID:** amzn1.ask.skill.bd298a52-10e9-46ca-b2c6-c6d631ea843c * **ASIN:** B01M70Y6LT * **Author:** SnoCountry * **Release Date:** October 26, 2016 @ 03:45:38 * **In-App Purchasing:** No
{ "pile_set_name": "Github" }
# ============================================================================== # Copyright (c) 2016-2020 Proton Technologies AG (Switzerland) # Email: [email protected] # # The MIT License (MIT) # # 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. # ============================================================================== client dev tun proto udp remote 172.98.93.228 80 remote 172.98.93.228 443 remote 172.98.93.228 4569 remote 172.98.93.228 1194 remote 172.98.93.228 5060 remote-random resolv-retry infinite nobind cipher AES-256-CBC auth SHA512 compress verb 3 tun-mtu 1500 tun-mtu-extra 32 mssfix 1450 persist-key persist-tun reneg-sec 0 remote-cert-tls server auth-user-pass /config/openvpn-credentials.txt pull fast-io <ca> -----BEGIN CERTIFICATE----- MIIFozCCA4ugAwIBAgIBATANBgkqhkiG9w0BAQ0FADBAMQswCQYDVQQGEwJDSDEV MBMGA1UEChMMUHJvdG9uVlBOIEFHMRowGAYDVQQDExFQcm90b25WUE4gUm9vdCBD QTAeFw0xNzAyMTUxNDM4MDBaFw0yNzAyMTUxNDM4MDBaMEAxCzAJBgNVBAYTAkNI MRUwEwYDVQQKEwxQcm90b25WUE4gQUcxGjAYBgNVBAMTEVByb3RvblZQTiBSb290 IENBMIICIjANBgkqhkiG9w0BAQEFAAOCAg8AMIICCgKCAgEAt+BsSsZg7+AuqTq7 vDbPzfygtl9f8fLJqO4amsyOXlI7pquL5IsEZhpWyJIIvYybqS4s1/T7BbvHPLVE wlrq8A5DBIXcfuXrBbKoYkmpICGc2u1KYVGOZ9A+PH9z4Tr6OXFfXRnsbZToie8t 2Xjv/dZDdUDAqeW89I/mXg3k5x08m2nfGCQDm4gCanN1r5MT7ge56z0MkY3FFGCO qRwspIEUzu1ZqGSTkG1eQiOYIrdOF5cc7n2APyvBIcfvp/W3cpTOEmEBJ7/14RnX nHo0fcx61Inx/6ZxzKkW8BMdGGQF3tF6u2M0FjVN0lLH9S0ul1TgoOS56yEJ34hr JSRTqHuar3t/xdCbKFZjyXFZFNsXVvgJu34CNLrHHTGJj9jiUfFnxW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joWs= -----END CERTIFICATE----- </ca> key-direction 1 <tls-auth> # 2048 bit OpenVPN static key -----BEGIN OpenVPN Static key V1----- 6acef03f62675b4b1bbd03e53b187727 423cea742242106cb2916a8a4c829756 3d22c7e5cef430b1103c6f66eb1fc5b3 75a672f158e2e2e936c3faa48b035a6d e17beaac23b5f03b10b868d53d03521d 8ba115059da777a60cbfd7b2c9c57472 78a15b8f6e68a3ef7fd583ec9f398c8b d4735dab40cbd1e3c62a822e97489186 c30a0b48c7c38ea32ceb056d3fa5a710 e10ccc7a0ddb363b08c3d2777a3395e1 0c0b6080f56309192ab5aacd4b45f55d a61fc77af39bd81a19218a79762c3386 2df55785075f37d8c71dc8a42097ee43 344739a0dd48d03025b0450cf1fb5e8c aeb893d9a96d1f15519bb3c4dcb40ee3 16672ea16c012664f8a9f11255518deb -----END OpenVPN Static key V1----- </tls-auth>
{ "pile_set_name": "Github" }
--- title: DCISetClipList description: DCISetClipList ms.assetid: 1efc3768-fe98-4bb3-8b3c-68e361a2573b keywords: ["DCISetClipList Display Devices"] topic_type: - apiref api_name: - DCISetClipList api_type: - NA ms.date: 01/05/2018 ms.localizationpriority: medium --- # DCISetClipList ## <span id="ddk_dcisetcliplist_gg"></span><span id="DDK_DCISETCLIPLIST_GG"></span> Do not use this function; use the latest DirectX Graphics interfaces to communicate with your DirectDraw-supported driver instead. The **DCISetClipList** function sets a clip list.
{ "pile_set_name": "Github" }
import QtQuick 2.0 import QtQuick.Controls 1.1 import QtQuick.Controls.Styles 1.0 import QtQuick.Dialogs 1.1 import econ.camera.uvcsettings 1.0 import econ.camera.see3camcu130 1.0 import QtQuick.Layouts 1.1 import cameraenum 1.0 Item { width:268 height:720 property int expoCompMin: 8000 property int expoCompMax: 1000000 property int denoiseMin: 0 property int denoiseMax: 15 property int qFactorMin: 10 property int qFactorMax: 96 property int frameRateMin: 1 property int frameRateMax: 120 property bool setButtonClicked: false // Added by Sankari: 05 Apr 2017 - To skip setting denoise value when getting the denoise value. property bool skipUpdateUIDenoise : false // Added by Sankari: 12 Apr 2017 - To skip setting burst length when getting the burst length value. property bool skipUpdateUIOnBurstLength: false // Added by Sankari: 12 Apr 2017 - To skip setting qfactor when getting the qfactor value. property bool skipUpdateUIQFactor : false // Added by Sankari: 12 Apr 2017 - To skip setting exposure window size when getting the qfactor value. property bool skipUpdateUIOnExpWindowSize: false // Added by Sankari: 12 Apr 2017 - To skip setting frame rate when getting the framerate value. property bool skipUpdateUIFrameRate: false property bool skipUpdateUIFlickerCtrl:false property int flickerCtrl Connections { target: root onTakeScreenShot: { if(seecamcu130.enableDisableFaceRectangle(false)){ root.imageCapture(CommonEnums.BURST_SHOT); } } onGetVideoPinStatus: { root.enableVideoPin(true); } onGetStillImageFormats: { var stillImageFormat = [] stillImageFormat.push("jpg") stillImageFormat.push("bmp") stillImageFormat.push("raw") stillImageFormat.push("png") root.insertStillImageFormat(stillImageFormat); } onMouseRightClicked:{ if(autoexpManual.enabled && autoexpManual.checked){ seecamcu130.setROIAutoExposure(See3CamCu130.AutoExpManual, width, height, x, y, autoExpoWinSizeCombo.currentText) } } onAutoExposureSelected:{ enableDisableAutoExposureControls(autoExposureSelect) } onVideoResolutionChanged:{ getexposureCompFrameRateCtrlTimer.start() } onPreviewFPSChanged:{ getexposureCompFrameRateCtrlTimer.start() } onVideoColorSpaceChanged:{ getexposureCompFrameRateCtrlTimer.start() } onEnableFaceRectafterBurst:{ seecamcu130.enableDisableFaceRectangle(true) } onBeforeRecordVideo:{ seecamcu130.enableDisableFaceRectangle(false) } onAfterRecordVideo:{ seecamcu130.enableDisableFaceRectangle(true) } } Timer { id: burstShotTimer interval: 1000 onTriggered: { root.imageCapture(CommonEnums.BURST_SHOT); stop() } } // Used when selecting auto exposure in image Quality settings menu Timer { id: getAutoExpsoureControlValues interval: 500 onTriggered: { seecamcu130.getAutoExpROIModeAndWindowSize() stop() } } Timer { id: getexposureCompFrameRateCtrlTimer interval: 500 onTriggered: { seecamcu130.getExposureCompensation() seecamcu130.getFrameRateCtrlValue() stop() } } Action { id: firmwareVersion onTriggered: { getFirmwareVersion() } } Action { id: serialNumber onTriggered: { getSerialNumber() } } Action { id: setDefault onTriggered: { setToDefaultValues() } } ScrollView{ id: scrollview x: 10 y: 189.5 width: 257 height: 500 style: uvc130_scrollViewStyle Item{ height:1300 ColumnLayout{ x:2 y:5 spacing:20 Row{ Text { id: scene_mode text: "--- Scene Mode ---" font.pixelSize: 14 font.family: "Ubuntu" color: "#ffffff" smooth: true opacity: 0.50196078431373 } Layout.alignment: Qt.AlignCenter } Row{ Grid { columns: 2 columnSpacing: 40 rowSpacing: 15 ExclusiveGroup { id: sceneInputGroup } RadioButton { id: sceneNormal style: econRadioButtonStyle text: qsTr("Normal") exclusiveGroup: sceneInputGroup activeFocusOnPress: true onClicked: { seecamcu130.setSceneMode(See3CamCu130.SCENE_NORMAL) } Keys.onReturnPressed: { seecamcu130.setSceneMode(See3CamCu130.SCENE_NORMAL) } } RadioButton { id: sceneDoc style: econRadioButtonStyle text: qsTr("Document") exclusiveGroup: sceneInputGroup activeFocusOnPress: true onClicked: { seecamcu130.setSceneMode(See3CamCu130.SCENE_DOCUMENT) } Keys.onReturnPressed: { seecamcu130.setSceneMode(See3CamCu130.SCENE_DOCUMENT) } } } } Row{ Text { id: effect_mode text: "--- Effect Mode ---" font.pixelSize: 14 font.family: "Ubuntu" color: "#ffffff" smooth: true opacity: 0.50196078431373 } Layout.alignment: Qt.AlignCenter } Row{ Grid { columns: 2 columnSpacing: 40 rowSpacing: 15 ExclusiveGroup { id: effectInputGroup } RadioButton { id: effectNormal style: econRadioButtonStyle text: qsTr("Normal") exclusiveGroup: effectInputGroup activeFocusOnPress: true onClicked: { seecamcu130.setEffectMode(See3CamCu130.EFFECT_NORMAL) } Keys.onReturnPressed: { seecamcu130.setEffectMode(See3CamCu130.EFFECT_NORMAL) } } RadioButton { id: effectBW style: econRadioButtonStyle text: qsTr("Black & White") exclusiveGroup: effectInputGroup activeFocusOnPress: true onClicked: { seecamcu130.setEffectMode(See3CamCu130.EFFECT_BLACK_WHITE) } Keys.onReturnPressed: { seecamcu130.setEffectMode(See3CamCu130.EFFECT_BLACK_WHITE) } } RadioButton { id: effectGrey style: econRadioButtonStyle text: qsTr("Grey") exclusiveGroup: effectInputGroup activeFocusOnPress: true onClicked: { seecamcu130.setEffectMode(See3CamCu130.EFFECT_GRAY) } Keys.onReturnPressed: { seecamcu130.setEffectMode(See3CamCu130.EFFECT_GRAY) } } RadioButton { id: effectNeg style: econRadioButtonStyle text: qsTr("Negative") exclusiveGroup: effectInputGroup activeFocusOnPress: true onClicked: { seecamcu130.setEffectMode(See3CamCu130.EFFECT_NEGATIVE) } Keys.onReturnPressed: { seecamcu130.setEffectMode(See3CamCu130.EFFECT_NEGATIVE) } } RadioButton { id: effectSketch style: econRadioButtonStyle text: qsTr("Sketch") exclusiveGroup: effectInputGroup activeFocusOnPress: true onClicked: { seecamcu130.setEffectMode(See3CamCu130.EFFECT_SKETCH) } Keys.onReturnPressed: { seecamcu130.setEffectMode(See3CamCu130.EFFECT_SKETCH) } } } } Text { id: flipText text: "--- Flip Control ---" font.pixelSize: 14 font.family: "Ubuntu" color: "#ffffff" smooth: true Layout.alignment: Qt.AlignCenter opacity: 0.50196078431373 } Row{ spacing: 55 CheckBox { id: flipCtrlHorizotal activeFocusOnPress : true text: "Horizontal" style: econCheckBoxStyle onClicked:{ seecamcu130.setOrientation(flipCtrlHorizotal.checked, flipCtrlVertical.checked) } Keys.onReturnPressed: { seecamcu130.setOrientation(flipCtrlHorizotal.checked, flipCtrlVertical.checked) } } CheckBox { id: flipCtrlVertical activeFocusOnPress : true text: "Vertical" style: econCheckBoxStyle onClicked:{ seecamcu130.setOrientation(flipCtrlHorizotal.checked, flipCtrlVertical.checked) } Keys.onReturnPressed: { seecamcu130.setOrientation(flipCtrlHorizotal.checked, flipCtrlVertical.checked) } } } Text { id: roiAutoExpMode text: "--- ROI - Auto Exposure ---" font.pixelSize: 14 font.family: "Ubuntu" color: "#ffffff" smooth: true Layout.alignment: Qt.AlignCenter opacity: 0.50196078431373 } Row{ spacing:38 ExclusiveGroup { id: roiExpogroup } RadioButton { exclusiveGroup: roiExpogroup id: autoexpFull text: "Full" activeFocusOnPress: true style: econRadioButtonStyle opacity: enabled ? 1 : 0.1 // setROIAutoExposure() args: mode, videoresolnWidth, videoresolnHeight, mouseXCord, mouseYCord, WinSize] // videoresolnWidth, videoresolnHeight, mouseXCord, mouseYCord - these parameters are required only when click in preview] // winSize is required only for manual mode onClicked: { seecamcu130.setROIAutoExposure(See3CamCu130.AutoExpFull, 0, 0, 0, 0, 0); autoExpoWinSizeCombo.enabled = false } Keys.onReturnPressed: { seecamcu130.setROIAutoExposure(See3CamCu130.AutoExpFull, 0, 0, 0, 0, 0); autoExpoWinSizeCombo.enabled = false } } RadioButton { exclusiveGroup: roiExpogroup id: autoexpManual text: "Manual" activeFocusOnPress: true style: econRadioButtonStyle opacity: enabled ? 1 : 0.1 onClicked: { seecamcu130.setROIAutoExposure(See3CamCu130.AutoExpManual, 0, 0, 0, 0, 0); autoExpoWinSizeCombo.enabled = true } Keys.onReturnPressed: { seecamcu130.setROIAutoExposure(See3CamCu130.AutoExpManual, 0, 0, 0, 0, 0); autoExpoWinSizeCombo.enabled = true } } } ComboBox { id: autoExpoWinSizeCombo enabled: (autoexpManual.enabled && autoexpManual.checked) ? true : false opacity: (autoexpManual.enabled && autoexpManual.checked) ? 1 : 0.1 model: ListModel { ListElement { text: "1" } ListElement { text: "2" } ListElement { text: "3" } ListElement { text: "4" } ListElement { text: "5" } ListElement { text: "6" } ListElement { text: "7" } ListElement { text: "8" } } activeFocusOnPress: true style: econComboBoxStyle onCurrentIndexChanged: { if(skipUpdateUIOnExpWindowSize){ seecamcu130.setROIAutoExposure(See3CamCu130.AutoExpManual, 0, 0, 0, 0, autoExpoWinSizeCombo.currentText) } skipUpdateUIOnExpWindowSize = true } } Text { id: exposureCompTextTitle text: "--- Exposure Compensation ---" font.pixelSize: 14 font.family: "Ubuntu" color: "#ffffff" smooth: true Layout.alignment: Qt.AlignCenter opacity: 0.50196078431373 } Row{ spacing: 9 Text { id: exposureCompText text: "value(µs)[8000 - 1000000]" font.pixelSize: 14 font.family: "Ubuntu" color: "#ffffff" smooth: true width: 80 wrapMode: Text.WordWrap opacity: 1 } TextField { id: exposureCompValue font.pixelSize: 10 font.family: "Ubuntu" smooth: true horizontalAlignment: TextInput.AlignHCenter opacity: 1 style: econTextFieldStyle implicitHeight: 25 implicitWidth: 80 validator: IntValidator {bottom: expoCompMin; top: expoCompMax} } Button { id: exposureCompSet activeFocusOnPress : true text: "Set" style: econButtonStyle enabled: true opacity: 1 implicitHeight: 25 implicitWidth: 60 onClicked: { exposureCompSet.enabled = false setButtonClicked = true seecamcu130.setExposureCompensation(exposureCompValue.text) exposureCompSet.enabled = true } Keys.onReturnPressed: { exposureCompSet.enabled = false setButtonClicked = true seecamcu130.setExposureCompensation(exposureCompValue.text) exposureCompSet.enabled = true } } } Text { id: denoiseText text: "--- De-Noise ---" font.pixelSize: 14 font.family: "Ubuntu" color: "#ffffff" smooth: true Layout.alignment: Qt.AlignCenter opacity: 0.50196078431373 } Row{ spacing: 35 Slider { activeFocusOnPress: true updateValueWhileDragging: false id: deNoiseSlider width: 150 stepSize: 1 style:econSliderStyle minimumValue: denoiseMin maximumValue: denoiseMax onValueChanged: { deNoiseTextField.text = deNoiseSlider.value if(skipUpdateUIDenoise){ seecamcu130.setDenoiseValue(deNoiseSlider.value) } skipUpdateUIDenoise = true } } TextField { id: deNoiseTextField text: deNoiseSlider.value font.pixelSize: 10 font.family: "Ubuntu" smooth: true horizontalAlignment: TextInput.AlignHCenter style: econTextFieldStyle validator: IntValidator {bottom: deNoiseSlider.minimumValue; top: deNoiseSlider.maximumValue} onTextChanged: { if(text.length > 0){ deNoiseSlider.value = deNoiseTextField.text } } } } Text { id: imgCapText text: "--- Image Capture ---" font.pixelSize: 14 font.family: "Ubuntu" color: "#ffffff" smooth: true Layout.alignment: Qt.AlignCenter opacity: 0.50196078431373 } Text { id: burstLength text: "Burst Length :" font.pixelSize: 14 font.family: "Ubuntu" color: "#ffffff" smooth: true opacity: 1 } ComboBox { id: burstLengthCombo opacity: 1 enabled: true model: ListModel { ListElement { text: "1" } ListElement { text: "2" } ListElement { text: "3" } ListElement { text: "4" } ListElement { text: "5" } } activeFocusOnPress: true style: econComboBoxStyle onCurrentIndexChanged: { root.stillBurstLength(burstLengthCombo.currentIndex + 1) // combobox index starts from 0 if(skipUpdateUIOnBurstLength){ seecamcu130.setBurstLength(burstLengthCombo.currentText) } skipUpdateUIOnBurstLength = true } } Text { id: qFactorText text: "--- Q Factor ---" font.pixelSize: 14 font.family: "Ubuntu" color: "#ffffff" smooth: true Layout.alignment: Qt.AlignCenter opacity: 0.50196078431373 } Row{ spacing: 35 Slider { activeFocusOnPress: true updateValueWhileDragging: false id: qFactorSlider width: 150 stepSize: 1 style:econSliderStyle minimumValue: qFactorMin maximumValue: qFactorMax onValueChanged: { qFactorTextField.text = qFactorSlider.value if(skipUpdateUIQFactor){ seecamcu130.setQFactor(qFactorSlider.value) } skipUpdateUIQFactor = true } } TextField { id: qFactorTextField text: qFactorSlider.value font.pixelSize: 10 font.family: "Ubuntu" smooth: true horizontalAlignment: TextInput.AlignHCenter style: econTextFieldStyle validator: IntValidator {bottom: qFactorSlider.minimumValue; top: qFactorSlider.maximumValue} onTextChanged: { if(text.length > 0){ qFactorSlider.value = qFactorTextField.text } } } } Text { id: faceDetectionText text: "--- Face Detection ---" font.pixelSize: 14 font.family: "Ubuntu" color: "#ffffff" smooth: true Layout.alignment: Qt.AlignCenter opacity: 0.50196078431373 } Row{ spacing: 62 ExclusiveGroup { id: faceRectGroup } RadioButton { exclusiveGroup: faceRectGroup id: faceRectEnable text: "Enable" activeFocusOnPress: true style: econRadioButtonStyle onClicked:{ seecamcu130.setFaceDetectionRect(true, faceDetectEmbedData.checked, overlayRect.checked) } Keys.onReturnPressed: { seecamcu130.setFaceDetectionRect(true, faceDetectEmbedData.checked, overlayRect.checked) } } RadioButton { exclusiveGroup: faceRectGroup id:faceRectDisable text: "Disable" activeFocusOnPress: true style: econRadioButtonStyle onClicked: { seecamcu130.setFaceDetectionRect(false, faceDetectEmbedData.checked, overlayRect.checked) } Keys.onReturnPressed: { seecamcu130.setFaceDetectionRect(false, faceDetectEmbedData.checked, overlayRect.checked) } } } Row{ spacing: 5 CheckBox { id: faceDetectEmbedData activeFocusOnPress : true text: "Embed \nData" style: econCheckBoxTextWrapModeStyle enabled: faceRectEnable.checked ? true : false opacity: enabled ? 1 : 0.1 onClicked:{ enableFaceDetectEmbedData() } Keys.onReturnPressed: { enableFaceDetectEmbedData() } } CheckBox { id: overlayRect activeFocusOnPress : true text: "Overlay Rectangle" style: econCheckBoxTextWrapModeStyle enabled: faceRectEnable.checked ? true : false opacity: enabled ? 1 : 0.1 onClicked:{ seecamcu130.setFaceDetectionRect(faceRectEnable.checked, faceDetectEmbedData.checked, checked) } Keys.onReturnPressed: { seecamcu130.setFaceDetectionRect(faceRectEnable.checked, faceDetectEmbedData.checked, checked) } } } Text { id: smileDetectionText text: "--- Smile Detection ---" font.pixelSize: 14 font.family: "Ubuntu" color: "#ffffff" smooth: true Layout.alignment: Qt.AlignCenter opacity: 0.50196078431373 } Row{ spacing: 62 ExclusiveGroup { id: smileDetectGroup } RadioButton { exclusiveGroup: smileDetectGroup id: smileDetectEnable text: "Enable" activeFocusOnPress: true style: econRadioButtonStyle onClicked:{ seecamcu130.setSmileDetection(true, smileDetectEmbedData.checked) } Keys.onReturnPressed: { seecamcu130.setSmileDetection(true, smileDetectEmbedData.checked) } } RadioButton { exclusiveGroup: smileDetectGroup id:smileDetectDisable text: "Disable" activeFocusOnPress: true style: econRadioButtonStyle onClicked: { seecamcu130.setSmileDetection(false, smileDetectEmbedData.checked) } Keys.onReturnPressed: { seecamcu130.setSmileDetection(false, smileDetectEmbedData.checked) } } } Row{ spacing: 5 CheckBox { id: smileDetectEmbedData activeFocusOnPress : true text: "Embed Data" style: econCheckBoxStyle enabled: smileDetectEnable.checked ? true : false opacity: enabled ? 1 : 0.1 onClicked:{ enableSmileDetectEmbedData() } Keys.onReturnPressed: { enableSmileDetectEmbedData() } } } Text { id: frameRateText text: "--- Frame Rate Control ---" font.pixelSize: 14 font.family: "Ubuntu" color: "#ffffff" smooth: true Layout.alignment: Qt.AlignCenter opacity: 0.50196078431373 } Row{ spacing: 35 Slider { activeFocusOnPress: true updateValueWhileDragging: false id: frameRateSlider width: 150 stepSize: 1 style:econSliderStyle minimumValue: frameRateMin maximumValue: frameRateMax onValueChanged: { frameRateTextField.text = frameRateSlider.value if(skipUpdateUIFrameRate){ seecamcu130.setFrameRateCtrlValue(frameRateSlider.value) } skipUpdateUIFrameRate = true } } TextField { id: frameRateTextField text: frameRateSlider.value font.pixelSize: 10 font.family: "Ubuntu" smooth: true horizontalAlignment: TextInput.AlignHCenter style: econTextFieldStyle validator: IntValidator {bottom: frameRateSlider.minimumValue; top: frameRateSlider.maximumValue} onTextChanged: { if(text.length > 0){ frameRateSlider.value = frameRateTextField.text } } } } //Added by M.VishnuMurali(15/04/2020):UI for Flicker Detection Mode settings Text { id: flickerctrlField text: "-- Flicker Detection Control --" font.pixelSize: 14 font.family: "Ubuntu" color: "#ffffff" smooth: true Layout.alignment: Qt.AlignCenter opacity: 0.50196078431373 } ComboBox { id: flickercombo opacity: 1 enabled: true model: ListModel { ListElement { text: "AUTO" } ListElement { text: "50Hz" } ListElement { text: "60Hz" } ListElement { text: "DISABLE" } } activeFocusOnPress: true style: econComboBoxStyle onCurrentIndexChanged: { if(skipUpdateUIFlickerCtrl){ setFlickerDetectionFn(); } } } Row{ Layout.alignment: Qt.AlignCenter Button { id: defaultValue opacity: 1 activeFocusOnPress : true text: "Default" tooltip: "Click to set default values in extension controls" action: setDefault style: econButtonStyle Keys.onReturnPressed: { seecamcu130.setToDefault() } } } Row{ Button { id: serial_no_selected opacity: 1 action: serialNumber activeFocusOnPress : true tooltip: "Click to view the Serial Number" style: ButtonStyle { background: Rectangle { border.width: control.activeFocus ? 3 :0 color: "#222021" border.color: control.activeFocus ? "#ffffff" : "#222021" radius: 5 } label: Image { source: "images/serial_no_selected.png" } } Keys.onReturnPressed: { getSerialNumber() } } Button { id: f_wversion_selectedCU130 opacity: 1 action: firmwareVersion activeFocusOnPress : true tooltip: "Click to view the firmware version of the camera" style: ButtonStyle { background: Rectangle { border.width: control.activeFocus ? 3 :0 color: "#222021" border.color: control.activeFocus ? "#ffffff" : "#222021" radius: 5 } label: Image { source: "images/f_wversion_selected.png" } } Keys.onReturnPressed: { getFirmwareVersion() } } } } } } MessageDialog { id: messageDialog icon: StandardIcon.Information onAccepted: { close() } Component.onCompleted: close() } Component { id: econRadioButtonStyle RadioButtonStyle { label: Text { text: control.text font.pixelSize: 14 font.family: "Ubuntu" color: "#ffffff" smooth: true opacity: 1 } background: Rectangle { color: "#222021" border.color: control.activeFocus ? "#ffffff" : "#222021" } } } Component { id: econCheckBoxStyle CheckBoxStyle { label: Text { text: control.text font.pixelSize: 14 font.family: "Ubuntu" color: "#ffffff" smooth: true opacity: 1 } background: Rectangle { color: "#222021" border.color: control.activeFocus ? "#ffffff" : "#222021" } } } Component { id: econTextFieldStyle TextFieldStyle { textColor: "black" background: Rectangle { radius: 2 implicitWidth: 50 implicitHeight: 20 border.color: "#333" border.width: 2 y: 1 } } } Component { id: econButtonStyle ButtonStyle { background: Rectangle { implicitHeight: 38 implicitWidth: 104 border.width: control.activeFocus ? 3 :0 color: "#e76943" border.color: control.activeFocus ? "#ffffff" : "#222021" radius: control.activeFocus ? 5 : 0 } label: Text { color: "#ffffff" horizontalAlignment: Text.AlignHCenter verticalAlignment: Text.AlignVCenter font.family: "Ubuntu" font.pointSize: 10 text: control.text } } } Component { id: uvc130_scrollViewStyle ScrollViewStyle { scrollToClickedPosition: true handle: Image { id: scrollhandle source: "images/scroller.png" } scrollBarBackground: Image { id: scrollStyle source: "images/Scroller_bg.png" } incrementControl: Image { id: increment source: "images/down_arrow.png" } decrementControl: Image { id: decrement source: "images/up_arrow.png" } }} Component { id: econComboBoxStyle ComboBoxStyle { background: Image { id: burstLengthCombo_bkgrnd source: "../../Views/images/device_box.png" Rectangle { width: burstLengthCombo_bkgrnd.sourceSize.width - 28 height: burstLengthCombo_bkgrnd.sourceSize.height color: "#222021" border.color: "white" border.width: control.activeFocus ? 3 : 1 radius: control.activeFocus ? 5 : 0 } } label: Text{ anchors.fill: parent color: "#ffffff" elide: Text.ElideRight text: control.currentText verticalAlignment: Text.AlignVCenter maximumLineCount: 1 font.family: "Ubuntu" font.pixelSize: 14 } } } See3CamCu130 { id: seecamcu130 onSceneModeValue:{ defaultSceneMode(sceneMode) } onEffectModeValue:{ defaultEffectMode(effectMode) } onFlipMirrorModeChanged:{ currentFlipMirrorMode(flipMirrorMode) } onExposureCompValueReceived:{ exposureCompValue.text = exposureCompensation } onIndicateCommandStatus:{ if(setButtonClicked){ displayMessageBox(title, text) setButtonClicked = false } } onBurstLengthValue:{ skipUpdateUIOnBurstLength = false burstLengthCombo.currentIndex = burstLength - 1 } onQFactorValue:{ skipUpdateUIQFactor = false qFactorSlider.value = qFactor skipUpdateUIQFactor = true } onIndicateExposureValueRangeFailure:{ if(setButtonClicked){ displayMessageBox(title, text) setButtonClicked = false seecamcu130.getExposureCompensation() } } onDenoiseValueReceived:{ skipUpdateUIDenoise = false deNoiseSlider.value = denoiseValue skipUpdateUIDenoise = true } onFrameRateCtrlValueReceived:{ skipUpdateUIFrameRate = false frameRateSlider.value = frameRateCtrlValue skipUpdateUIFrameRate = true } onRoiAutoExpModeValue:{ currentROIAutoExposureMode(roiMode, winSize) } onFaceDetectModeValue:{ if(faceDetectMode == See3CamCu130.FaceRectEnable){ faceRectEnable.checked = true if(faceDetectEmbedDataValue == See3CamCu130.FaceDetectEmbedDataEnable){ faceDetectEmbedData.checked = true } if(faceDetectOverlayRect == See3CamCu130.FaceDetectOverlayRectEnable){ overlayRect.checked = true } }else if(faceDetectMode == See3CamCu130.FaceRectDisable){ faceRectDisable.checked = true if(faceDetectEmbedDataValue == See3CamCu130.FaceDetectEmbedDataEnable){ faceDetectEmbedData.checked = true }else{ faceDetectEmbedData.checked = false } if(faceDetectOverlayRect == See3CamCu130.FaceDetectOverlayRectEnable){ overlayRect.checked = true }else{ overlayRect.checked = false } } } onSmileDetectModeValue:{ if(smileDetectMode == See3CamCu130.SmileDetectEnable){ smileDetectEnable.checked = true if(smileDetectEmbedDataValue == See3CamCu130.SmileDetectEmbedDataEnable){ smileDetectEmbedData.checked = true } }else if(smileDetectMode == See3CamCu130.SmileDetectDisable){ smileDetectDisable.checked = true if(smileDetectEmbedDataValue == See3CamCu130.SmileDetectEmbedDataEnable){ smileDetectEmbedData.checked = true }else{ smileDetectEmbedData.checked = false } } } onFlickerDetectionMode:{ skipUpdateUIFlickerCtrl = false if(flickerMode == See3CamCu130.MODE_AUTO){ flickercombo.currentIndex = 0 }else if(flickerMode == See3CamCu130.MODE_50Hz){ flickercombo.currentIndex = 1 }else if(flickerMode == See3CamCu130.MODE_60Hz){ flickercombo.currentIndex = 2 }else if(flickerMode == See3CamCu130.MODE_DISABLE){ flickercombo.currentIndex = 3 }else{ } skipUpdateUIFlickerCtrl = true; } } Uvccamera { id: uvccamera onTitleTextChanged: { messageDialog.title = _title.toString() messageDialog.text = _text.toString() messageDialog.open() } onSerialNumber:{ messageDialog.title = qsTr("Serial Number") messageDialog.text = serialNumber; } } Component { id: econCheckBoxTextWrapModeStyle CheckBoxStyle { label: Text { text: control.text font.pixelSize: 14 font.family: "Ubuntu" color: "#ffffff" smooth: true opacity: 1 width: 100 wrapMode: Text.WordWrap } background: Rectangle { color: "#222021" border.color: control.activeFocus ? "#ffffff" : "#222021" } } } Component.onCompleted:{ getValuesFromCamera() root.disablePowerLineFreq() } function displayMessageBox(title, text){ messageDialog.title = qsTr(title) messageDialog.text = qsTr(text) messageDialog.open() } // Enable Face detect embed data function enableFaceDetectEmbedData(){ if(seecamcu130.setFaceDetectionRect(faceRectEnable.checked, faceDetectEmbedData.checked, overlayRect.checked)){ if(faceDetectEmbedData.checked){ messageDialog.title = qsTr("Status") messageDialog.text = qsTr("The last part of the frame will be replaced by face data.Refer document See3CAM_CU130_Face_and_Smile_Detection for more details") messageDialog.open() } } } // enable smile detect embed data function enableSmileDetectEmbedData(){ setButtonClicked = false if(seecamcu130.setSmileDetection(true, smileDetectEmbedData.checked)){ if(smileDetectEmbedData.checked){ messageDialog.title = qsTr("Status") messageDialog.text = qsTr("The last part of the frame will be replaced by smile data.Refer document See3CAM_CU130_Face_and_Smile_Detection for more details") messageDialog.open() } } } // current ROI auto exposure mode function currentROIAutoExposureMode(roiMode, winSize){ switch(roiMode){ case See3CamCu130.AutoExpFull: autoexpFull.checked = true autoExpoWinSizeCombo.enabled = false break case See3CamCu130.AutoExpManual: skipUpdateUIOnExpWindowSize = false autoexpManual.checked = true // If window size is got from camera is 0 then set window size to 1 in UI if(winSize == 0){ autoExpoWinSizeCombo.currentIndex = 0 }else autoExpoWinSizeCombo.currentIndex = winSize-1 break case See3CamCu130.AutoExpDisabled: autoexpFull.enabled = false autoexpManual.enabled = false autoExpoWinSizeCombo.enabled = false break } } function enableDisableAutoExposureControls(autoExposureSelect){ if(autoExposureSelect){ autoexpManual.enabled = true autoexpFull.enabled = true if(autoexpManual.checked) autoExpoWinSizeCombo.enabled = true if(autoexpFull.checked) autoExpoWinSizeCombo.enabled = false autoexpManual.opacity = 1 autoexpFull.opacity = 1 exposureCompValue.enabled = true exposureCompValue.opacity = 1 exposureCompSet.enabled = true exposureCompSet.opacity = 1 exposureCompText.opacity = 1 }else{ autoexpManual.enabled = false autoexpFull.enabled = false autoExpoWinSizeCombo.enabled = false autoexpManual.opacity = 0.1 autoexpFull.opacity = 0.1 exposureCompValue.enabled = false exposureCompValue.opacity = 0.1 exposureCompSet.enabled = false exposureCompSet.opacity = 0.1 exposureCompText.opacity = 0.1 } getAutoExpsoureControlValues.start() } function getSerialNumber() { uvccamera.getSerialNumber() messageDialog.open() } function getFirmwareVersion() { uvccamera.getFirmWareVersion() messageDialog.open() } function currentFlipMirrorMode(mode) { switch(mode) { case See3CamCu130.FLIP_ON_MIRROR_ON: flipCtrlVertical.checked = true flipCtrlHorizotal.checked = true break; case See3CamCu130.FLIP_OFF_MIRROR_ON: flipCtrlVertical.checked = true flipCtrlHorizotal.checked = false break; case See3CamCu130.FLIP_ON_MIRROR_OFF: flipCtrlVertical.checked = false flipCtrlHorizotal.checked = true break; case See3CamCu130.FLIP_OFF_MIRROR_OFF: flipCtrlVertical.checked = false flipCtrlHorizotal.checked = false break; } } // by Sankari: 28 June 2017 // Reduced scene modes function defaultSceneMode(mode) { switch(mode) { case See3CamCu130.SCENE_NORMAL : sceneNormal.checked = true break; case See3CamCu130.SCENE_DOCUMENT : sceneDoc.checked = true break; } } // by Sankari: 28 June 2017 // Reduced effect modes function defaultEffectMode(mode) { switch(mode) { case See3CamCu130.EFFECT_NORMAL : effectNormal.checked = true break; case See3CamCu130.EFFECT_BLACK_WHITE : effectBW.checked = true break; case See3CamCu130.EFFECT_GRAY : effectGrey.checked = true break; case See3CamCu130.EFFECT_NEGATIVE : effectNeg.checked = true break; case See3CamCu130.EFFECT_SKETCH : effectSketch.checked = true break; } } function setToDefaultValues(){ seecamcu130.setToDefault() getValuesFromCamera() } function getValuesFromCamera(){ seecamcu130.getSceneMode() seecamcu130.getEffectMode() seecamcu130.getOrientation() seecamcu130.getExposureCompensation() seecamcu130.getDenoiseValue() seecamcu130.getBurstLength() seecamcu130.getQFactor() seecamcu130.getAutoExpROIModeAndWindowSize() seecamcu130.getFrameRateCtrlValue() seecamcu130.getFaceDetectMode() seecamcu130.getSmileDetectMode() seecamcu130.getFlickerDetection() } //Added by M.VishnuMurali(15/04/2020):For setting Flicker detection mode function setFlickerDetectionFn() { switch(flickercombo.currentIndex){ case 0: flickerCtrl = See3CamCu130.MODE_AUTO break case 1: flickerCtrl = See3CamCu130.MODE_50Hz break case 2: flickerCtrl = See3CamCu130.MODE_60Hz break case 3: flickerCtrl = See3CamCu130.MODE_DISABLE break } seecamcu130.setFlickerDetection(flickerCtrl) } }
{ "pile_set_name": "Github" }
/* * id3-common.h * Copyright 2013 John Lindgren * * 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 * provided with the distribution. * * This software is provided "as is" and without any warranty, express or * implied. In no event shall the authors be liable for any damages arising from * the use of this software. */ #ifndef AUDTAG_ID3_COMMON_H #define AUDTAG_ID3_COMMON_H #include <libaudcore/index.h> #include <libaudcore/tuple.h> void id3_associate_string (Tuple & tuple, Tuple::Field field, const char * data, int size); void id3_associate_int (Tuple & tuple, Tuple::Field field, const char * data, int size); void id3_associate_length (Tuple & tuple, const char * data, int size); void id3_decode_genre (Tuple & tuple, const char * data, int size); void id3_decode_comment (Tuple & tuple, const char * data, int size); void id3_decode_rva (Tuple & tuple, const char * data, int size); void id3_decode_txxx (Tuple & tuple, const char * data, int size); Index<char> id3_decode_picture (const char * data, int size); #endif
{ "pile_set_name": "Github" }
# Gem plugin This plugin adds completions and aliases for [Gem](https://rubygems.org/). The completions include the common `gem` subcommands as well as the installed gems in the current directory. To use it, add `gem` to the plugins array in your zshrc file: ```zsh plugins=(... gem) ``` ## Aliases | Alias | Command | Description | |----------------------|-------------------------------|--------------------------------------------| | gemb | `gem build *.gemspec` | Build a gem from a gemspec | | gemp | `gem push *.gem` | Push a gem up to the gem server | | gemy [gem] [version] | `gem yank [gem] -v [version]` | Remove a pushed gem version from the index |
{ "pile_set_name": "Github" }
<?xml version="1.0" encoding="UTF-8" standalone="no"?> <document type="com.apple.InterfaceBuilder3.Cocoa.XIB" version="3.0" toolsVersion="6751" systemVersion="14C1514" targetRuntime="MacOSX.Cocoa" propertyAccessControl="none" useAutolayout="YES" customObjectInstantitationMethod="direct"> <dependencies> <deployment identifier="macosx"/> <plugIn identifier="com.apple.InterfaceBuilder.CocoaPlugin" version="6751"/> </dependencies> <objects> <customObject id="-2" userLabel="File's Owner" customClass="NSApplication"> <connections> <outlet property="delegate" destination="Voe-Tx-rLC" id="GzC-gU-4Uq"/> </connections> </customObject> <customObject id="-1" userLabel="First Responder" customClass="FirstResponder"/> <customObject id="-3" userLabel="Application" customClass="NSObject"/> <menu title="Main Menu" systemMenu="main" id="AYu-sK-qS6"> <items> <menuItem title="TestApp" id="1Xt-HY-uBw"> <modifierMask key="keyEquivalentModifierMask"/> <menu key="submenu" title="TestApp" systemMenu="apple" id="uQy-DD-JDr"> <items> <menuItem title="About TestApp" id="5kV-Vb-QxS"> <modifierMask key="keyEquivalentModifierMask"/> <connections> <action selector="orderFrontStandardAboutPanel:" target="-1" id="Exp-CZ-Vem"/> </connections> </menuItem> <menuItem isSeparatorItem="YES" id="VOq-y0-SEH"/> <menuItem title="Preferences…" keyEquivalent="," id="BOF-NM-1cW"/> <menuItem isSeparatorItem="YES" id="wFC-TO-SCJ"/> <menuItem title="Services" id="NMo-om-nkz"> <modifierMask key="keyEquivalentModifierMask"/> <menu key="submenu" title="Services" systemMenu="services" id="hz9-B4-Xy5"/> </menuItem> <menuItem isSeparatorItem="YES" id="4je-JR-u6R"/> <menuItem title="Hide TestApp" keyEquivalent="h" id="Olw-nP-bQN"> <connections> <action selector="hide:" target="-1" id="PnN-Uc-m68"/> </connections> </menuItem> <menuItem title="Hide Others" keyEquivalent="h" id="Vdr-fp-XzO"> <modifierMask key="keyEquivalentModifierMask" option="YES" command="YES"/> <connections> <action selector="hideOtherApplications:" target="-1" id="VT4-aY-XCT"/> </connections> </menuItem> <menuItem title="Show All" id="Kd2-mp-pUS"> <modifierMask key="keyEquivalentModifierMask"/> <connections> <action selector="unhideAllApplications:" target="-1" id="Dhg-Le-xox"/> </connections> </menuItem> <menuItem isSeparatorItem="YES" id="kCx-OE-vgT"/> <menuItem title="Quit TestApp" keyEquivalent="q" id="4sb-4s-VLi"> <connections> <action selector="terminate:" target="-1" id="Te7-pn-YzF"/> </connections> </menuItem> </items> </menu> </menuItem> <menuItem title="File" id="dMs-cI-mzQ"> <modifierMask key="keyEquivalentModifierMask"/> <menu key="submenu" title="File" id="bib-Uj-vzu"> <items> <menuItem title="New" keyEquivalent="n" id="Was-JA-tGl"> <connections> <action selector="newDocument:" target="-1" id="4Si-XN-c54"/> </connections> </menuItem> <menuItem title="Open…" keyEquivalent="o" id="IAo-SY-fd9"> <connections> <action selector="openDocument:" target="-1" id="bVn-NM-KNZ"/> </connections> </menuItem> <menuItem title="Open Recent" id="tXI-mr-wws"> <modifierMask key="keyEquivalentModifierMask"/> <menu key="submenu" title="Open Recent" systemMenu="recentDocuments" id="oas-Oc-fiZ"> <items> <menuItem title="Clear Menu" id="vNY-rz-j42"> <modifierMask key="keyEquivalentModifierMask"/> <connections> <action selector="clearRecentDocuments:" target="-1" id="Daa-9d-B3U"/> </connections> </menuItem> </items> </menu> </menuItem> <menuItem isSeparatorItem="YES" id="m54-Is-iLE"/> <menuItem title="Close" keyEquivalent="w" id="DVo-aG-piG"> <connections> <action selector="performClose:" target="-1" id="HmO-Ls-i7Q"/> </connections> </menuItem> <menuItem title="Save…" keyEquivalent="s" id="pxx-59-PXV"> <connections> <action selector="saveDocument:" target="-1" id="teZ-XB-qJY"/> </connections> </menuItem> <menuItem title="Save As…" keyEquivalent="S" id="Bw7-FT-i3A"> <connections> <action selector="saveDocumentAs:" target="-1" id="mDf-zr-I0C"/> </connections> </menuItem> <menuItem title="Revert to Saved" id="KaW-ft-85H"> <modifierMask key="keyEquivalentModifierMask"/> <connections> <action selector="revertDocumentToSaved:" target="-1" id="iJ3-Pv-kwq"/> </connections> </menuItem> <menuItem isSeparatorItem="YES" id="aJh-i4-bef"/> <menuItem title="Page Setup…" keyEquivalent="P" id="qIS-W8-SiK"> <modifierMask key="keyEquivalentModifierMask" shift="YES" command="YES"/> <connections> <action selector="runPageLayout:" target="-1" id="Din-rz-gC5"/> </connections> </menuItem> <menuItem title="Print…" keyEquivalent="p" id="aTl-1u-JFS"> <connections> <action selector="print:" target="-1" id="qaZ-4w-aoO"/> </connections> </menuItem> </items> </menu> </menuItem> <menuItem title="Edit" id="5QF-Oa-p0T"> <modifierMask key="keyEquivalentModifierMask"/> <menu key="submenu" title="Edit" id="W48-6f-4Dl"> <items> <menuItem title="Undo" keyEquivalent="z" id="dRJ-4n-Yzg"> <connections> <action selector="undo:" target="-1" id="M6e-cu-g7V"/> </connections> </menuItem> <menuItem title="Redo" keyEquivalent="Z" id="6dh-zS-Vam"> <connections> <action selector="redo:" target="-1" id="oIA-Rs-6OD"/> </connections> </menuItem> <menuItem isSeparatorItem="YES" id="WRV-NI-Exz"/> <menuItem title="Cut" keyEquivalent="x" id="uRl-iY-unG"> <connections> <action selector="cut:" target="-1" id="YJe-68-I9s"/> </connections> </menuItem> <menuItem title="Copy" keyEquivalent="c" id="x3v-GG-iWU"> <connections> <action selector="copy:" target="-1" id="G1f-GL-Joy"/> </connections> </menuItem> <menuItem title="Paste" keyEquivalent="v" id="gVA-U4-sdL"> <connections> <action selector="paste:" target="-1" id="UvS-8e-Qdg"/> </connections> </menuItem> <menuItem title="Paste and Match Style" keyEquivalent="V" id="WeT-3V-zwk"> <modifierMask key="keyEquivalentModifierMask" option="YES" command="YES"/> <connections> <action selector="pasteAsPlainText:" target="-1" id="cEh-KX-wJQ"/> </connections> </menuItem> <menuItem title="Delete" id="pa3-QI-u2k"> <modifierMask key="keyEquivalentModifierMask"/> <connections> <action selector="delete:" target="-1" id="0Mk-Ml-PaM"/> </connections> </menuItem> <menuItem title="Select All" keyEquivalent="a" id="Ruw-6m-B2m"> <connections> <action selector="selectAll:" target="-1" id="VNm-Mi-diN"/> </connections> </menuItem> <menuItem isSeparatorItem="YES" id="uyl-h8-XO2"/> <menuItem title="Find" id="4EN-yA-p0u"> <modifierMask key="keyEquivalentModifierMask"/> <menu key="submenu" title="Find" id="1b7-l0-nxx"> <items> <menuItem title="Find…" tag="1" keyEquivalent="f" id="Xz5-n4-O0W"> <connections> <action selector="performFindPanelAction:" target="-1" id="cD7-Qs-BN4"/> </connections> </menuItem> <menuItem title="Find and Replace…" tag="12" keyEquivalent="f" id="YEy-JH-Tfz"> <modifierMask key="keyEquivalentModifierMask" option="YES" command="YES"/> <connections> <action selector="performFindPanelAction:" target="-1" id="WD3-Gg-5AJ"/> </connections> </menuItem> <menuItem title="Find Next" tag="2" keyEquivalent="g" id="q09-fT-Sye"> <connections> <action selector="performFindPanelAction:" target="-1" id="NDo-RZ-v9R"/> </connections> </menuItem> <menuItem title="Find Previous" tag="3" keyEquivalent="G" id="OwM-mh-QMV"> <connections> <action selector="performFindPanelAction:" target="-1" id="HOh-sY-3ay"/> </connections> </menuItem> <menuItem title="Use Selection for Find" tag="7" keyEquivalent="e" id="buJ-ug-pKt"> <connections> <action selector="performFindPanelAction:" target="-1" id="U76-nv-p5D"/> </connections> </menuItem> <menuItem title="Jump to Selection" keyEquivalent="j" id="S0p-oC-mLd"> <connections> <action selector="centerSelectionInVisibleArea:" target="-1" id="IOG-6D-g5B"/> </connections> </menuItem> </items> </menu> </menuItem> <menuItem title="Spelling and Grammar" id="Dv1-io-Yv7"> <modifierMask key="keyEquivalentModifierMask"/> <menu key="submenu" title="Spelling" id="3IN-sU-3Bg"> <items> <menuItem title="Show Spelling and Grammar" keyEquivalent=":" id="HFo-cy-zxI"> <connections> <action selector="showGuessPanel:" target="-1" id="vFj-Ks-hy3"/> </connections> </menuItem> <menuItem title="Check Document Now" keyEquivalent=";" id="hz2-CU-CR7"> <connections> <action selector="checkSpelling:" target="-1" id="fz7-VC-reM"/> </connections> </menuItem> <menuItem isSeparatorItem="YES" id="bNw-od-mp5"/> <menuItem title="Check Spelling While Typing" id="rbD-Rh-wIN"> <modifierMask key="keyEquivalentModifierMask"/> <connections> <action selector="toggleContinuousSpellChecking:" target="-1" id="7w6-Qz-0kB"/> </connections> </menuItem> <menuItem title="Check Grammar With Spelling" id="mK6-2p-4JG"> <modifierMask key="keyEquivalentModifierMask"/> <connections> <action selector="toggleGrammarChecking:" target="-1" id="muD-Qn-j4w"/> </connections> </menuItem> <menuItem title="Correct Spelling Automatically" id="78Y-hA-62v"> <modifierMask key="keyEquivalentModifierMask"/> <connections> <action selector="toggleAutomaticSpellingCorrection:" target="-1" id="2lM-Qi-WAP"/> </connections> </menuItem> </items> </menu> </menuItem> <menuItem title="Substitutions" id="9ic-FL-obx"> <modifierMask key="keyEquivalentModifierMask"/> <menu key="submenu" title="Substitutions" id="FeM-D8-WVr"> <items> <menuItem title="Show Substitutions" id="z6F-FW-3nz"> <modifierMask key="keyEquivalentModifierMask"/> <connections> <action selector="orderFrontSubstitutionsPanel:" target="-1" id="oku-mr-iSq"/> </connections> </menuItem> <menuItem isSeparatorItem="YES" id="gPx-C9-uUO"/> <menuItem title="Smart Copy/Paste" id="9yt-4B-nSM"> <modifierMask key="keyEquivalentModifierMask"/> <connections> <action selector="toggleSmartInsertDelete:" target="-1" id="3IJ-Se-DZD"/> </connections> </menuItem> <menuItem title="Smart Quotes" id="hQb-2v-fYv"> <modifierMask key="keyEquivalentModifierMask"/> <connections> <action selector="toggleAutomaticQuoteSubstitution:" target="-1" id="ptq-xd-QOA"/> </connections> </menuItem> <menuItem title="Smart Dashes" id="rgM-f4-ycn"> <modifierMask key="keyEquivalentModifierMask"/> <connections> <action selector="toggleAutomaticDashSubstitution:" target="-1" id="oCt-pO-9gS"/> </connections> </menuItem> <menuItem title="Smart Links" id="cwL-P1-jid"> <modifierMask key="keyEquivalentModifierMask"/> <connections> <action selector="toggleAutomaticLinkDetection:" target="-1" id="Gip-E3-Fov"/> </connections> </menuItem> <menuItem title="Data Detectors" id="tRr-pd-1PS"> <modifierMask key="keyEquivalentModifierMask"/> <connections> <action selector="toggleAutomaticDataDetection:" target="-1" id="R1I-Nq-Kbl"/> </connections> </menuItem> <menuItem title="Text Replacement" id="HFQ-gK-NFA"> <modifierMask key="keyEquivalentModifierMask"/> <connections> <action selector="toggleAutomaticTextReplacement:" target="-1" id="DvP-Fe-Py6"/> </connections> </menuItem> </items> </menu> </menuItem> <menuItem title="Transformations" id="2oI-Rn-ZJC"> <modifierMask key="keyEquivalentModifierMask"/> <menu key="submenu" title="Transformations" id="c8a-y6-VQd"> <items> <menuItem title="Make Upper Case" id="vmV-6d-7jI"> <modifierMask key="keyEquivalentModifierMask"/> <connections> <action selector="uppercaseWord:" target="-1" id="sPh-Tk-edu"/> </connections> </menuItem> <menuItem title="Make Lower Case" id="d9M-CD-aMd"> <modifierMask key="keyEquivalentModifierMask"/> <connections> <action selector="lowercaseWord:" target="-1" id="iUZ-b5-hil"/> </connections> </menuItem> <menuItem title="Capitalize" id="UEZ-Bs-lqG"> <modifierMask key="keyEquivalentModifierMask"/> <connections> <action selector="capitalizeWord:" target="-1" id="26H-TL-nsh"/> </connections> </menuItem> </items> </menu> </menuItem> <menuItem title="Speech" id="xrE-MZ-jX0"> <modifierMask key="keyEquivalentModifierMask"/> <menu key="submenu" title="Speech" id="3rS-ZA-NoH"> <items> <menuItem title="Start Speaking" id="Ynk-f8-cLZ"> <modifierMask key="keyEquivalentModifierMask"/> <connections> <action selector="startSpeaking:" target="-1" id="654-Ng-kyl"/> </connections> </menuItem> <menuItem title="Stop Speaking" id="Oyz-dy-DGm"> <modifierMask key="keyEquivalentModifierMask"/> <connections> <action selector="stopSpeaking:" target="-1" id="dX8-6p-jy9"/> </connections> </menuItem> </items> </menu> </menuItem> </items> </menu> </menuItem> <menuItem title="Format" id="jxT-CU-nIS"> <modifierMask key="keyEquivalentModifierMask"/> <menu key="submenu" title="Format" id="GEO-Iw-cKr"> <items> <menuItem title="Font" id="Gi5-1S-RQB"> <modifierMask key="keyEquivalentModifierMask"/> <menu key="submenu" title="Font" systemMenu="font" id="aXa-aM-Jaq"> <items> <menuItem title="Show Fonts" keyEquivalent="t" id="Q5e-8K-NDq"> <connections> <action selector="orderFrontFontPanel:" target="YLy-65-1bz" id="WHr-nq-2xA"/> </connections> </menuItem> <menuItem title="Bold" tag="2" keyEquivalent="b" id="GB9-OM-e27"> <connections> <action selector="addFontTrait:" target="YLy-65-1bz" id="hqk-hr-sYV"/> </connections> </menuItem> <menuItem title="Italic" tag="1" keyEquivalent="i" id="Vjx-xi-njq"> <connections> <action selector="addFontTrait:" target="YLy-65-1bz" id="IHV-OB-c03"/> </connections> </menuItem> <menuItem title="Underline" keyEquivalent="u" id="WRG-CD-K1S"> <connections> <action selector="underline:" target="-1" id="FYS-2b-JAY"/> </connections> </menuItem> <menuItem isSeparatorItem="YES" id="5gT-KC-WSO"/> <menuItem title="Bigger" tag="3" keyEquivalent="+" id="Ptp-SP-VEL"> <connections> <action selector="modifyFont:" target="YLy-65-1bz" id="Uc7-di-UnL"/> </connections> </menuItem> <menuItem title="Smaller" tag="4" keyEquivalent="-" id="i1d-Er-qST"> <connections> <action selector="modifyFont:" target="YLy-65-1bz" id="HcX-Lf-eNd"/> </connections> </menuItem> <menuItem isSeparatorItem="YES" id="kx3-Dk-x3B"/> <menuItem title="Kern" id="jBQ-r6-VK2"> <modifierMask key="keyEquivalentModifierMask"/> <menu key="submenu" title="Kern" id="tlD-Oa-oAM"> <items> <menuItem title="Use Default" id="GUa-eO-cwY"> <modifierMask key="keyEquivalentModifierMask"/> <connections> <action selector="useStandardKerning:" target="-1" id="6dk-9l-Ckg"/> </connections> </menuItem> <menuItem title="Use None" id="cDB-IK-hbR"> <modifierMask key="keyEquivalentModifierMask"/> <connections> <action selector="turnOffKerning:" target="-1" id="U8a-gz-Maa"/> </connections> </menuItem> <menuItem title="Tighten" id="46P-cB-AYj"> <modifierMask key="keyEquivalentModifierMask"/> <connections> <action selector="tightenKerning:" target="-1" id="hr7-Nz-8ro"/> </connections> </menuItem> <menuItem title="Loosen" id="ogc-rX-tC1"> <modifierMask key="keyEquivalentModifierMask"/> <connections> <action selector="loosenKerning:" target="-1" id="8i4-f9-FKE"/> </connections> </menuItem> </items> </menu> </menuItem> <menuItem title="Ligatures" id="o6e-r0-MWq"> <modifierMask key="keyEquivalentModifierMask"/> <menu key="submenu" title="Ligatures" id="w0m-vy-SC9"> <items> <menuItem title="Use Default" id="agt-UL-0e3"> <modifierMask key="keyEquivalentModifierMask"/> <connections> <action selector="useStandardLigatures:" target="-1" id="7uR-wd-Dx6"/> </connections> </menuItem> <menuItem title="Use None" id="J7y-lM-qPV"> <modifierMask key="keyEquivalentModifierMask"/> <connections> <action selector="turnOffLigatures:" target="-1" id="iX2-gA-Ilz"/> </connections> </menuItem> <menuItem title="Use All" id="xQD-1f-W4t"> <modifierMask key="keyEquivalentModifierMask"/> <connections> <action selector="useAllLigatures:" target="-1" id="KcB-kA-TuK"/> </connections> </menuItem> </items> </menu> </menuItem> <menuItem title="Baseline" id="OaQ-X3-Vso"> <modifierMask key="keyEquivalentModifierMask"/> <menu key="submenu" title="Baseline" id="ijk-EB-dga"> <items> <menuItem title="Use Default" id="3Om-Ey-2VK"> <modifierMask key="keyEquivalentModifierMask"/> <connections> <action selector="unscript:" target="-1" id="0vZ-95-Ywn"/> </connections> </menuItem> <menuItem title="Superscript" id="Rqc-34-cIF"> <modifierMask key="keyEquivalentModifierMask"/> <connections> <action selector="superscript:" target="-1" id="3qV-fo-wpU"/> </connections> </menuItem> <menuItem title="Subscript" id="I0S-gh-46l"> <modifierMask key="keyEquivalentModifierMask"/> <connections> <action selector="subscript:" target="-1" id="Q6W-4W-IGz"/> </connections> </menuItem> <menuItem title="Raise" id="2h7-ER-AoG"> <modifierMask key="keyEquivalentModifierMask"/> <connections> <action selector="raiseBaseline:" target="-1" id="4sk-31-7Q9"/> </connections> </menuItem> <menuItem title="Lower" id="1tx-W0-xDw"> <modifierMask key="keyEquivalentModifierMask"/> <connections> <action selector="lowerBaseline:" target="-1" id="OF1-bc-KW4"/> </connections> </menuItem> </items> </menu> </menuItem> <menuItem isSeparatorItem="YES" id="Ndw-q3-faq"/> <menuItem title="Show Colors" keyEquivalent="C" id="bgn-CT-cEk"> <connections> <action selector="orderFrontColorPanel:" target="-1" id="mSX-Xz-DV3"/> </connections> </menuItem> <menuItem isSeparatorItem="YES" id="iMs-zA-UFJ"/> <menuItem title="Copy Style" keyEquivalent="c" id="5Vv-lz-BsD"> <modifierMask key="keyEquivalentModifierMask" option="YES" command="YES"/> <connections> <action selector="copyFont:" target="-1" id="GJO-xA-L4q"/> </connections> </menuItem> <menuItem title="Paste Style" keyEquivalent="v" id="vKC-jM-MkH"> <modifierMask key="keyEquivalentModifierMask" option="YES" command="YES"/> <connections> <action selector="pasteFont:" target="-1" id="JfD-CL-leO"/> </connections> </menuItem> </items> </menu> </menuItem> <menuItem title="Text" id="Fal-I4-PZk"> <modifierMask key="keyEquivalentModifierMask"/> <menu key="submenu" title="Text" id="d9c-me-L2H"> <items> <menuItem title="Align Left" keyEquivalent="{" id="ZM1-6Q-yy1"> <connections> <action selector="alignLeft:" target="-1" id="zUv-R1-uAa"/> </connections> </menuItem> <menuItem title="Center" keyEquivalent="|" id="VIY-Ag-zcb"> <connections> <action selector="alignCenter:" target="-1" id="spX-mk-kcS"/> </connections> </menuItem> <menuItem title="Justify" id="J5U-5w-g23"> <modifierMask key="keyEquivalentModifierMask"/> <connections> <action selector="alignJustified:" target="-1" id="ljL-7U-jND"/> </connections> </menuItem> <menuItem title="Align Right" keyEquivalent="}" id="wb2-vD-lq4"> <connections> <action selector="alignRight:" target="-1" id="r48-bG-YeY"/> </connections> </menuItem> <menuItem isSeparatorItem="YES" id="4s2-GY-VfK"/> <menuItem title="Writing Direction" id="H1b-Si-o9J"> <modifierMask key="keyEquivalentModifierMask"/> <menu key="submenu" title="Writing Direction" id="8mr-sm-Yjd"> <items> <menuItem title="Paragraph" enabled="NO" id="ZvO-Gk-QUH"> <modifierMask key="keyEquivalentModifierMask"/> </menuItem> <menuItem id="YGs-j5-SAR"> <string key="title"> Default</string> <modifierMask key="keyEquivalentModifierMask"/> <connections> <action selector="makeBaseWritingDirectionNatural:" target="-1" id="qtV-5e-UBP"/> </connections> </menuItem> <menuItem id="Lbh-J2-qVU"> <string key="title"> Left to Right</string> <modifierMask key="keyEquivalentModifierMask"/> <connections> <action selector="makeBaseWritingDirectionLeftToRight:" target="-1" id="S0X-9S-QSf"/> </connections> </menuItem> <menuItem id="jFq-tB-4Kx"> <string key="title"> Right to Left</string> <modifierMask key="keyEquivalentModifierMask"/> <connections> <action selector="makeBaseWritingDirectionRightToLeft:" target="-1" id="5fk-qB-AqJ"/> </connections> </menuItem> <menuItem isSeparatorItem="YES" id="swp-gr-a21"/> <menuItem title="Selection" enabled="NO" id="cqv-fj-IhA"> <modifierMask key="keyEquivalentModifierMask"/> </menuItem> <menuItem id="Nop-cj-93Q"> <string key="title"> Default</string> <modifierMask key="keyEquivalentModifierMask"/> <connections> <action selector="makeTextWritingDirectionNatural:" target="-1" id="lPI-Se-ZHp"/> </connections> </menuItem> <menuItem id="BgM-ve-c93"> <string key="title"> Left to Right</string> <modifierMask key="keyEquivalentModifierMask"/> <connections> <action selector="makeTextWritingDirectionLeftToRight:" target="-1" id="caW-Bv-w94"/> </connections> </menuItem> <menuItem id="RB4-Sm-HuC"> <string key="title"> Right to Left</string> <modifierMask key="keyEquivalentModifierMask"/> <connections> <action selector="makeTextWritingDirectionRightToLeft:" target="-1" id="EXD-6r-ZUu"/> </connections> </menuItem> </items> </menu> </menuItem> <menuItem isSeparatorItem="YES" id="fKy-g9-1gm"/> <menuItem title="Show Ruler" id="vLm-3I-IUL"> <modifierMask key="keyEquivalentModifierMask"/> <connections> <action selector="toggleRuler:" target="-1" id="FOx-HJ-KwY"/> </connections> </menuItem> <menuItem title="Copy Ruler" keyEquivalent="c" id="MkV-Pr-PK5"> <modifierMask key="keyEquivalentModifierMask" control="YES" command="YES"/> <connections> <action selector="copyRuler:" target="-1" id="71i-fW-3W2"/> </connections> </menuItem> <menuItem title="Paste Ruler" keyEquivalent="v" id="LVM-kO-fVI"> <modifierMask key="keyEquivalentModifierMask" control="YES" command="YES"/> <connections> <action selector="pasteRuler:" target="-1" id="cSh-wd-qM2"/> </connections> </menuItem> </items> </menu> </menuItem> </items> </menu> </menuItem> <menuItem title="View" id="H8h-7b-M4v"> <modifierMask key="keyEquivalentModifierMask"/> <menu key="submenu" title="View" id="HyV-fh-RgO"> <items> <menuItem title="Show Toolbar" keyEquivalent="t" id="snW-S8-Cw5"> <modifierMask key="keyEquivalentModifierMask" option="YES" command="YES"/> <connections> <action selector="toggleToolbarShown:" target="-1" id="BXY-wc-z0C"/> </connections> </menuItem> <menuItem title="Customize Toolbar…" id="1UK-8n-QPP"> <modifierMask key="keyEquivalentModifierMask"/> <connections> <action selector="runToolbarCustomizationPalette:" target="-1" id="pQI-g3-MTW"/> </connections> </menuItem> </items> </menu> </menuItem> <menuItem title="Window" id="aUF-d1-5bR"> <modifierMask key="keyEquivalentModifierMask"/> <menu key="submenu" title="Window" systemMenu="window" id="Td7-aD-5lo"> <items> <menuItem title="Minimize" keyEquivalent="m" id="OY7-WF-poV"> <connections> <action selector="performMiniaturize:" target="-1" id="VwT-WD-YPe"/> </connections> </menuItem> <menuItem title="Zoom" id="R4o-n2-Eq4"> <modifierMask key="keyEquivalentModifierMask"/> <connections> <action selector="performZoom:" target="-1" id="DIl-cC-cCs"/> </connections> </menuItem> <menuItem isSeparatorItem="YES" id="eu3-7i-yIM"/> <menuItem title="Bring All to Front" id="LE2-aR-0XJ"> <modifierMask key="keyEquivalentModifierMask"/> <connections> <action selector="arrangeInFront:" target="-1" id="DRN-fu-gQh"/> </connections> </menuItem> </items> </menu> </menuItem> <menuItem title="Help" id="wpr-3q-Mcd"> <modifierMask key="keyEquivalentModifierMask"/> <menu key="submenu" title="Help" systemMenu="help" id="F2S-fz-NVQ"> <items> <menuItem title="TestApp Help" keyEquivalent="?" id="FKE-Sm-Kum"> <connections> <action selector="showHelp:" target="-1" id="y7X-2Q-9no"/> </connections> </menuItem> </items> </menu> </menuItem> </items> </menu> <window title="TestApp" allowsToolTipsWhenApplicationIsInactive="NO" autorecalculatesKeyViewLoop="NO" releasedWhenClosed="NO" animationBehavior="default" id="QvC-M9-y7g"> <windowStyleMask key="styleMask" titled="YES" closable="YES" miniaturizable="YES" resizable="YES"/> <windowPositionMask key="initialPositionMask" leftStrut="YES" rightStrut="YES" topStrut="YES" bottomStrut="YES"/> <rect key="contentRect" x="335" y="390" width="800" height="480"/> <rect key="screenRect" x="0.0" y="0.0" width="1920" height="1057"/> <value key="minSize" type="size" width="320" height="240"/> <view key="contentView" id="EiT-Mj-1SZ"> <rect key="frame" x="0.0" y="0.0" width="800" height="480"/> <autoresizingMask key="autoresizingMask"/> <subviews> <customView translatesAutoresizingMaskIntoConstraints="NO" id="h0T-kw-vhv" customClass="GameView"> <rect key="frame" x="0.0" y="0.0" width="800" height="480"/> </customView> </subviews> <constraints> <constraint firstItem="h0T-kw-vhv" firstAttribute="top" secondItem="EiT-Mj-1SZ" secondAttribute="top" id="44L-is-sCD"/> <constraint firstItem="h0T-kw-vhv" firstAttribute="leading" secondItem="EiT-Mj-1SZ" secondAttribute="leading" id="HxV-rW-LUu"/> <constraint firstAttribute="bottom" secondItem="h0T-kw-vhv" secondAttribute="bottom" id="QW9-ne-wdt"/> <constraint firstAttribute="trailing" secondItem="h0T-kw-vhv" secondAttribute="trailing" id="vvR-NP-q3l"/> </constraints> </view> </window> <customObject id="Voe-Tx-rLC" customClass="AppDelegate"> <connections> <outlet property="window" destination="QvC-M9-y7g" id="gIp-Ho-8D9"/> </connections> </customObject> <customObject id="YLy-65-1bz" customClass="NSFontManager"/> <viewController id="Bgb-r8-DVb" customClass="GameViewController"> <connections> <outlet property="gameView" destination="h0T-kw-vhv" id="Ye1-dz-fy3"/> <outlet property="view" destination="EiT-Mj-1SZ" id="cVo-9Q-4BT"/> </connections> </viewController> </objects> </document>
{ "pile_set_name": "Github" }
JSON in Java [package org.json] =============================== [![Maven Central](https://img.shields.io/maven-central/v/org.json/json.svg)](https://mvnrepository.com/artifact/org.json/json) **[Click here if you just want the latest release jar file.](https://repo1.maven.org/maven2/org/json/json/20200518/json-20200518.jar)** # Overview [JSON](http://www.JSON.org/) is a light-weight language independent data interchange format. The JSON-Java package is a reference implementation that demonstrates how to parse JSON documents into Java objects and how to generate new JSON documents from the Java classes. Project goals include: * Reliable and consistent results * Adherence to the JSON specification * Easy to build, use, and include in other projects * No external dependencies * Fast execution and low memory footprint * Maintain backwards compatibility * Designed and tested to use on Java versions 1.6 - 1.11 The files in this package implement JSON encoders and decoders. The package can also convert between JSON and XML, HTTP headers, Cookies, and CDL. The license includes this restriction: ["The software shall be used for good, not evil."](https://en.wikipedia.org/wiki/Douglas_Crockford#%22Good,_not_Evil%22) If your conscience cannot live with that, then choose a different package. **If you would like to contribute to this project** Bug fixes, code improvements, and unit test coverage changes are welcome! Because this project is currrently in maintenance phase, the kinds of changes that can be accepted are limited. For more information, please read the [FAQ](https://github.com/stleary/JSON-java/wiki/FAQ). # Build Instructions The org.json package can be built from the command line, Maven, and Gradle. The unit tests can be executed from Maven, Gradle, or individually in an IDE e.g. Eclipse. **Building from the command line** *Build the class files from the package root directory src/main/java* ```` javac org\json\*.java ```` *Create the jar file in the current directory* ```` jar cf json-java.jar org/json/*.class ```` *Compile a program that uses the jar (see example code below)* ```` javac -cp .;json-java.jar Test.java ```` *Test file contents* ```` import org.json.JSONObject; public class Test { public static void main(String args[]){ JSONObject jo = new JSONObject("{ \"abc\" : \"def\" }"); System.out.println(jo.toString()); } } ```` *Excecute the Test file* ```` java -cp .;json-java.jar Test ```` *Expected output* ```` {"abc":"def"} ```` **Build tools for building the package and executing the unit tests** The test suite can be executed with Maven by running: ``` mvn clean test ``` The test suite can be executed with Gradlew by running: ``` gradlew clean build test ``` # Notes **Recent directory structure change** _Due to a recent commit - [#515 Merge tests and pom and code](https://github.com/stleary/JSON-java/pull/515) - the structure of the project has changed from a flat directory containing all of the Java files to a directory structure that includes unit tests and several tools used to build the project jar and run the unit tests. If you have difficulty using the new structure, please open an issue so we can work through it._ **Implementation notes** Numeric types in this package comply with [ECMA-404: The JSON Data Interchange Format](http://www.ecma-international.org/publications/files/ECMA-ST/ECMA-404.pdf) and [RFC 8259: The JavaScript Object Notation (JSON) Data Interchange Format](https://tools.ietf.org/html/rfc8259#section-6). This package fully supports `Integer`, `Long`, and `Double` Java types. Partial support for `BigInteger` and `BigDecimal` values in `JSONObject` and `JSONArray` objects is provided in the form of `get()`, `opt()`, and `put()` API methods. Although 1.6 compatibility is currently supported, it is not a project goal and may be removed in some future release. In compliance with RFC8259 page 10 section 9, the parser is more lax with what is valid JSON than the Generator. For Example, the tab character (U+0009) is allowed when reading JSON Text strings, but when output by the Generator, tab is properly converted to \t in the string. Other instances may occur where reading invalid JSON text does not cause an error to be generated. Malformed JSON Texts such as missing end " (quote) on strings or invalid number formats (1.2e6.3) will cause errors as such documents can not be read reliably. Some notable exceptions that the JSON Parser in this library accepts are: * Unquoted keys `{ key: "value" }` * Unquoted values `{ "key": value }` * Unescaped literals like "tab" in string values `{ "key": "value with an unescaped tab" }` * Numbers out of range for `Double` or `Long` are parsed as strings Recent pull requests added a new method `putAll` on the JSONArray. The `putAll` method works similarly as other `put` mehtods in that it does not call `JSONObject.wrap` for items added. This can lead to inconsistent object representation in JSONArray structures. For example, code like this will create a mixed JSONArray, some items wrapped, others not: ```java SomeBean[] myArr = new SomeBean[]{ new SomeBean(1), new SomeBean(2) }; // these will be wrapped JSONArray jArr = new JSONArray(myArr); // these will not be wrapped jArr.putAll(new SomeBean[]{ new SomeBean(3), new SomeBean(4) }); ``` For structure consistency, it would be recommended that the above code is changed to look like 1 of 2 ways. Option 1: ```Java SomeBean[] myArr = new SomeBean[]{ new SomeBean(1), new SomeBean(2) }; JSONArray jArr = new JSONArray(); // these will not be wrapped jArr.putAll(myArr); // these will not be wrapped jArr.putAll(new SomeBean[]{ new SomeBean(3), new SomeBean(4) }); // our jArr is now consistent. ``` Option 2: ```Java SomeBean[] myArr = new SomeBean[]{ new SomeBean(1), new SomeBean(2) }; // these will be wrapped JSONArray jArr = new JSONArray(myArr); // these will be wrapped jArr.putAll(new JSONArray(new SomeBean[]{ new SomeBean(3), new SomeBean(4) })); // our jArr is now consistent. ``` **Unit Test Conventions** Test filenames should consist of the name of the module being tested, with the suffix "Test". For example, <b>Cookie.java</b> is tested by <b>CookieTest.java</b>. <b>The fundamental issues with JSON-Java testing are:</b><br> * <b>JSONObjects</b> are unordered, making simple string comparison ineffective. * Comparisons via **equals()** is not currently supported. Neither <b>JSONArray</b> nor <b>JSONObject</b> override <b>hashCode()</b> or <b>equals()</b>, so comparison defaults to the <b>Object</b> equals(), which is not useful. * Access to the <b>JSONArray</b> and <b>JSONObject</b> internal containers for comparison is not currently available. <b>General issues with unit testing are:</b><br> * Just writing tests to make coverage goals tends to result in poor tests. * Unit tests are a form of documentation - how a given method actually works is demonstrated by the test. So for a code reviewer or future developer looking at code a good test helps explain how a function is supposed to work according to the original author. This can be difficult if you are not the original developer. * It is difficult to evaluate unit tests in a vacuum. You also need to see the code being tested to understand if a test is good. * Without unit tests it is hard to feel confident about the quality of the code, especially when fixing bugs or refactoring. Good tests prevents regressions and keeps the intent of the code correct. * If you have unit test results along with pull requests, the reviewer has an easier time understanding your code and determining if the it works as intended. # Files **JSONObject.java**: The `JSONObject` can parse text from a `String` or a `JSONTokener` to produce a map-like object. The object provides methods for manipulating its contents, and for producing a JSON compliant object serialization. **JSONArray.java**: The `JSONArray` can parse text from a String or a `JSONTokener` to produce a vector-like object. The object provides methods for manipulating its contents, and for producing a JSON compliant array serialization. **JSONTokener.java**: The `JSONTokener` breaks a text into a sequence of individual tokens. It can be constructed from a `String`, `Reader`, or `InputStream`. It also can parse text from a `String`, `Number`, `Boolean` or `null` like `"hello"`, `42`, `true`, `null` to produce a simple json object. **JSONException.java**: The `JSONException` is the standard exception type thrown by this package. **JSONPointer.java**: Implementation of [JSON Pointer (RFC 6901)](https://tools.ietf.org/html/rfc6901). Supports JSON Pointers both in the form of string representation and URI fragment representation. **JSONPropertyIgnore.java**: Annotation class that can be used on Java Bean getter methods. When used on a bean method that would normally be serialized into a `JSONObject`, it overrides the getter-to-key-name logic and forces the property to be excluded from the resulting `JSONObject`. **JSONPropertyName.java**: Annotation class that can be used on Java Bean getter methods. When used on a bean method that would normally be serialized into a `JSONObject`, it overrides the getter-to-key-name logic and uses the value of the annotation. The Bean processor will look through the class hierarchy. This means you can use the annotation on a base class or interface and the value of the annotation will be used even if the getter is overridden in a child class. **JSONString.java**: The `JSONString` interface requires a `toJSONString` method, allowing an object to provide its own serialization. **JSONStringer.java**: The `JSONStringer` provides a convenient facility for building JSON strings. **JSONWriter.java**: The `JSONWriter` provides a convenient facility for building JSON text through a writer. **CDL.java**: `CDL` provides support for converting between JSON and comma delimited lists. **Cookie.java**: `Cookie` provides support for converting between JSON and cookies. **CookieList.java**: `CookieList` provides support for converting between JSON and cookie lists. **HTTP.java**: `HTTP` provides support for converting between JSON and HTTP headers. **HTTPTokener.java**: `HTTPTokener` extends `JSONTokener` for parsing HTTP headers. **XML.java**: `XML` provides support for converting between JSON and XML. **JSONML.java**: `JSONML` provides support for converting between JSONML and XML. **XMLTokener.java**: `XMLTokener` extends `JSONTokener` for parsing XML text. # Release history: JSON-java releases can be found by searching the Maven repository for groupId "org.json" and artifactId "json". For example: [https://search.maven.org/search?q=g:org.json%20AND%20a:json&core=gav](https://search.maven.org/search?q=g:org.json%20AND%20a:json&core=gav) ~~~ 20200518 Recent commits and snapshot before project structure change 20190722 Recent commits 20180813 POM change to include Automatic-Module-Name (#431) 20180130 Recent commits 20171018 Checkpoint for recent commits. 20170516 Roll up recent commits. 20160810 Revert code that was breaking opt*() methods. 20160807 This release contains a bug in the JSONObject.opt*() and JSONArray.opt*() methods, it is not recommended for use. Java 1.6 compatability fixed, JSONArray.toList() and JSONObject.toMap(), RFC4180 compatibility, JSONPointer, some exception fixes, optional XML type conversion. Contains the latest code as of 7 Aug, 2016 20160212 Java 1.6 compatibility, OSGi bundle. Contains the latest code as of 12 Feb, 2016. 20151123 JSONObject and JSONArray initialization with generics. Contains the latest code as of 23 Nov, 2015. 20150729 Checkpoint for Maven central repository release. Contains the latest code as of 29 July, 2015. ~~~
{ "pile_set_name": "Github" }
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en"> <head> <title>5.28节,防止点击空链接,页面重置到页的首端</title> <meta http-equiv="Content-Type" content="text/html; charset=utf-8"> </head> <body> <h2>防止点击空链接,页面重置到页的首端</h2> <a href="">我是空链接</a> <br /> <a href="#">我是“#”链接</a> <script type="text/javascript"> window.onload = function(){ //一般点击空连接,页面重置到首页是因为再链接中加入了锚点"#",或者为空字符等 var as = document.getElementsByTagName("a"), i = 0, l = as.length, h = ""; while(i < l){//遍历所有a链接 h = as[i].getAttribute("href"); if(h = "#" || !h) as[i].href = "javascript:void(0)";//修改a链接 i++; } }; </script> </body> </html>
{ "pile_set_name": "Github" }
{{- if .Values.ingress.enabled -}} apiVersion: extensions/v1beta1 kind: Ingress metadata: name: {{ template "fullname" . }} labels: chart: "{{ .Chart.Name }}-{{ .Chart.Version | replace "+" "_" }}" spec: rules: - host: {{ .Release.Name }}.{{ .Values.basedomain }} http: paths: - path: / backend: serviceName: {{ template "fullname" . }} servicePort: {{ .Values.service.externalPort }} {{- end -}}
{ "pile_set_name": "Github" }
package notifier import ( "fmt" "sync" "testing" "time" "github.com/golang/mock/gomock" metricSource "github.com/moira-alert/moira/metric_source" "github.com/moira-alert/moira/metric_source/local" "github.com/op/go-logging" . "github.com/smartystreets/goconvey/convey" "github.com/moira-alert/moira" "github.com/moira-alert/moira/metrics" mock_moira_alert "github.com/moira-alert/moira/mock/moira-alert" mock_scheduler "github.com/moira-alert/moira/mock/scheduler" ) var ( plots [][]byte shutdown = make(chan struct{}) ) var ( mockCtrl *gomock.Controller sender *mock_moira_alert.MockSender notif *StandardNotifier scheduler *mock_scheduler.MockScheduler dataBase *mock_moira_alert.MockDatabase logger moira.Logger ) func TestGetMetricNames(t *testing.T) { Convey("Test non-empty notification package", t, func() { Convey("Test package with trigger events", func() { expected := []string{"metricName1", "metricName2", "metricName3", "metricName5"} actual := notificationsPackage.GetMetricNames() So(actual, ShouldResemble, expected) }) Convey("Test package with no trigger events", func() { pkg := NotificationPackage{} for _, event := range notificationsPackage.Events { if event.IsTriggerEvent { event.IsTriggerEvent = false } pkg.Events = append(pkg.Events, event) } expected := []string{"metricName1", "metricName2", "metricName3", "metricName4", "metricName5"} actual := pkg.GetMetricNames() So(actual, ShouldResemble, expected) }) }) Convey("Test empty notification package", t, func() { emptyNotificationPackage := NotificationPackage{} actual := emptyNotificationPackage.GetMetricNames() So(actual, ShouldHaveLength, 0) }) } func TestGetWindow(t *testing.T) { Convey("Test non-empty notification package", t, func() { from, to, err := notificationsPackage.GetWindow() So(err, ShouldBeNil) So(from, ShouldEqual, 11) So(to, ShouldEqual, 179) }) Convey("Test empty notification package", t, func() { emptyNotificationPackage := NotificationPackage{} _, _, err := emptyNotificationPackage.GetWindow() So(err, ShouldResemble, fmt.Errorf("not enough data to resolve package window")) }) } func TestUnknownContactType(t *testing.T) { configureNotifier(t) defer afterTest() var eventsData moira.NotificationEvents = []moira.NotificationEvent{event} pkg := NotificationPackage{ Events: eventsData, Contact: moira.ContactData{ Type: "unknown contact", }, } notification := moira.ScheduledNotification{} scheduler.EXPECT().ScheduleNotification(gomock.Any(), event, pkg.Trigger, pkg.Contact, pkg.Plotting, pkg.Throttled, pkg.FailCount+1).Return(&notification) dataBase.EXPECT().AddNotification(&notification).Return(nil) var wg sync.WaitGroup notif.Send(&pkg, &wg) wg.Wait() } func TestFailSendEvent(t *testing.T) { configureNotifier(t) defer afterTest() var eventsData moira.NotificationEvents = []moira.NotificationEvent{event} pkg := NotificationPackage{ Events: eventsData, Contact: moira.ContactData{ Type: "test", }, } notification := moira.ScheduledNotification{} sender.EXPECT().SendEvents(eventsData, pkg.Contact, pkg.Trigger, plots, pkg.Throttled).Return(fmt.Errorf("Cant't send")) scheduler.EXPECT().ScheduleNotification(gomock.Any(), event, pkg.Trigger, pkg.Contact, pkg.Plotting, pkg.Throttled, pkg.FailCount+1).Return(&notification) dataBase.EXPECT().AddNotification(&notification).Return(nil) var wg sync.WaitGroup notif.Send(&pkg, &wg) wg.Wait() time.Sleep(time.Second * 2) } func TestTimeout(t *testing.T) { configureNotifier(t) var wg sync.WaitGroup defer afterTest() var eventsData moira.NotificationEvents = []moira.NotificationEvent{event} // Configure events with long sending time pkg := NotificationPackage{ Events: eventsData, Contact: moira.ContactData{ Type: "test", }, } sender.EXPECT().SendEvents(eventsData, pkg.Contact, pkg.Trigger, plots, pkg.Throttled).Return(nil).Do(func(f ...interface{}) { fmt.Print("Trying to send for 10 second") time.Sleep(time.Second * 10) }).Times(maxParallelSendsPerSender) for i := 0; i < maxParallelSendsPerSender; i++ { notif.Send(&pkg, &wg) wg.Wait() } // Configure timeouted event notification := moira.ScheduledNotification{} pkg2 := NotificationPackage{ Events: eventsData, Contact: moira.ContactData{ Type: "test", Value: "fail contact", }, } scheduler.EXPECT().ScheduleNotification(gomock.Any(), event, pkg2.Trigger, pkg2.Contact, pkg.Plotting, pkg2.Throttled, pkg2.FailCount+1).Return(&notification) dataBase.EXPECT().AddNotification(&notification).Return(nil).Do(func(f ...interface{}) { close(shutdown) }) notif.Send(&pkg2, &wg) wg.Wait() waitTestEnd() } func waitTestEnd() { select { case <-shutdown: break case <-time.After(time.Second * 30): close(shutdown) break } } func configureNotifier(t *testing.T) { notifierMetrics := metrics.ConfigureNotifierMetrics(metrics.NewDummyRegistry(), "notifier") var location, _ = time.LoadLocation("UTC") dateTimeFormat := "15:04 02.01.2006" config := Config{ SendingTimeout: time.Millisecond * 10, ResendingTimeout: time.Hour * 24, Location: location, DateTimeFormat: dateTimeFormat, } mockCtrl = gomock.NewController(t) dataBase = mock_moira_alert.NewMockDatabase(mockCtrl) logger, _ = logging.GetLogger("Scheduler") scheduler = mock_scheduler.NewMockScheduler(mockCtrl) sender = mock_moira_alert.NewMockSender(mockCtrl) metricsSourceProvider := metricSource.CreateMetricSourceProvider(local.Create(dataBase), nil) notif = NewNotifier(dataBase, logger, config, notifierMetrics, metricsSourceProvider, map[string]moira.ImageStore{}) notif.scheduler = scheduler senderSettings := map[string]string{ "type": "test", } sender.EXPECT().Init(senderSettings, logger, location, "15:04 02.01.2006").Return(nil) notif.RegisterSender(senderSettings, sender) //nolint Convey("Should return one sender", t, func() { So(notif.GetSenders(), ShouldResemble, map[string]bool{"test": true}) }) } func afterTest() { mockCtrl.Finish() notif.StopSenders() } var subID = "SubscriptionID-000000000000001" var event = moira.NotificationEvent{ Metric: "generate.event.1", State: moira.StateOK, OldState: moira.StateWARN, TriggerID: "triggerID-0000000000001", SubscriptionID: &subID, } var notificationsPackage = NotificationPackage{ Events: []moira.NotificationEvent{ {Metric: "metricName1", Timestamp: 15, IsTriggerEvent: false}, {Metric: "metricName2", Timestamp: 11, IsTriggerEvent: false}, {Metric: "metricName3", Timestamp: 31, IsTriggerEvent: false}, {Metric: "metricName4", Timestamp: 179, IsTriggerEvent: true}, {Metric: "metricName5", Timestamp: 12, IsTriggerEvent: false}, }, }
{ "pile_set_name": "Github" }
/* tracetool - a framework for tracing the execution of C++ programs * Copyright 2013-2016 froglogic GmbH * * This file is part of tracetool. * * tracetool 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. * * tracetool 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 tracetool. If not, see <http://www.gnu.org/licenses/>. */ #ifndef TRACER_DATABASEFEEDER_H #define TRACER_DATABASEFEEDER_H #include "xmlcontenthandler.h" class DatabaseFeeder : public XmlParseEventsHandler { public: DatabaseFeeder( QSqlDatabase db ); protected: virtual void handleTraceEntry( const TraceEntry & ); virtual void applyStorageConfiguration( const StorageConfiguration & ); virtual void handleShutdownEvent( const ProcessShutdownEvent & ); // Needed for the server to send out notifications to the GUI when entries are archived virtual void archivedEntries() {} // Needed for the server subclass to nuke the database void trimDb(); private: QSqlDatabase m_db; unsigned short m_shrinkBy; unsigned long m_maximumSize; QString m_archiveDir; }; #endif // TRACER_DATABASEFEEDER_H
{ "pile_set_name": "Github" }
############################################################################## # # --- esd.m4 --- # # Configure paths for ESD # Manish Singh 98-9-30 # stolen back from Frank Belew # stolen from Manish Singh # Shamelessly stolen from Owen Taylor dnl AM_PATH_ESD([MINIMUM-VERSION, [ACTION-IF-FOUND [, ACTION-IF-NOT-FOUND]]]) dnl Test for ESD, and define ESD_CFLAGS and ESD_LIBS dnl AC_DEFUN([AM_PATH_ESD], [dnl dnl Get the cflags and libraries from the esd-config script dnl AC_ARG_WITH(esd-prefix,[ --with-esd-prefix=PFX Prefix where ESD is installed (optional)], esd_prefix="$withval", esd_prefix="") AC_ARG_WITH(esd-exec-prefix,[ --with-esd-exec-prefix=PFX Exec prefix where ESD is installed (optional)], esd_exec_prefix="$withval", esd_exec_prefix="") AC_ARG_ENABLE(esdtest, [ --disable-esdtest Do not try to compile and run a test ESD program], , enable_esdtest=yes) if test x$esd_exec_prefix != x ; then esd_args="$esd_args --exec-prefix=$esd_exec_prefix" if test x${ESD_CONFIG+set} != xset ; then ESD_CONFIG=$esd_exec_prefix/bin/esd-config fi fi if test x$esd_prefix != x ; then esd_args="$esd_args --prefix=$esd_prefix" if test x${ESD_CONFIG+set} != xset ; then ESD_CONFIG=$esd_prefix/bin/esd-config fi fi AC_PATH_PROG(ESD_CONFIG, esd-config, no) min_esd_version=ifelse([$1], ,0.2.7,$1) AC_MSG_CHECKING(for ESD - version >= $min_esd_version) no_esd="" if test "$ESD_CONFIG" = "no" ; then no_esd=yes else ESD_CFLAGS=`$ESD_CONFIG $esdconf_args --cflags` ESD_LIBS=`$ESD_CONFIG $esdconf_args --libs` esd_major_version=`$ESD_CONFIG $esd_args --version | \ sed 's/\([[0-9]]*\).\([[0-9]]*\).\([[0-9]]*\)/\1/'` esd_minor_version=`$ESD_CONFIG $esd_args --version | \ sed 's/\([[0-9]]*\).\([[0-9]]*\).\([[0-9]]*\)/\2/'` esd_micro_version=`$ESD_CONFIG $esd_config_args --version | \ sed 's/\([[0-9]]*\).\([[0-9]]*\).\([[0-9]]*\)/\3/'` if test "x$enable_esdtest" = "xyes" ; then ac_save_CFLAGS="$CFLAGS" ac_save_LIBS="$LIBS" CFLAGS="$CFLAGS $ESD_CFLAGS" LIBS="$LIBS $ESD_LIBS" dnl dnl Now check if the installed ESD is sufficiently new. (Also sanity dnl checks the results of esd-config to some extent dnl rm -f conf.esdtest AC_TRY_RUN([ #include <stdio.h> #include <stdlib.h> #include <string.h> #include <esd.h> char* my_strdup (char *str) { char *new_str; if (str) { new_str = malloc ((strlen (str) + 1) * sizeof(char)); strcpy (new_str, str); } else new_str = NULL; return new_str; } int main () { int major, minor, micro; char *tmp_version; system ("touch conf.esdtest"); /* HP/UX 9 (%@#!) writes to sscanf strings */ tmp_version = my_strdup("$min_esd_version"); if (sscanf(tmp_version, "%d.%d.%d", &major, &minor, &micro) != 3) { printf("%s, bad version string\n", "$min_esd_version"); exit(1); } if (($esd_major_version > major) || (($esd_major_version == major) && ($esd_minor_version > minor)) || (($esd_major_version == major) && ($esd_minor_version == minor) && ($esd_micro_version >= micro))) { return 0; } else { printf("\n*** 'esd-config --version' returned %d.%d.%d, but the minimum version\n", $esd_major_version, $esd_minor_version, $esd_micro_version); printf("*** of ESD required is %d.%d.%d. If esd-config is correct, then it is\n", major, minor, micro); printf("*** best to upgrade to the required version.\n"); printf("*** If esd-config was wrong, set the environment variable ESD_CONFIG\n"); printf("*** to point to the correct copy of esd-config, and remove the file\n"); printf("*** config.cache before re-running configure\n"); return 1; } } ],, no_esd=yes,[echo $ac_n "cross compiling; assumed OK... $ac_c"]) CFLAGS="$ac_save_CFLAGS" LIBS="$ac_save_LIBS" fi fi if test "x$no_esd" = x ; then AC_MSG_RESULT(yes) ifelse([$2], , :, [$2]) else AC_MSG_RESULT(no) if test "$ESD_CONFIG" = "no" ; then echo "*** The esd-config script installed by ESD could not be found" echo "*** If ESD was installed in PREFIX, make sure PREFIX/bin is in" echo "*** your path, or set the ESD_CONFIG environment variable to the" echo "*** full path to esd-config." else if test -f conf.esdtest ; then : else echo "*** Could not run ESD test program, checking why..." CFLAGS="$CFLAGS $ESD_CFLAGS" LIBS="$LIBS $ESD_LIBS" AC_TRY_LINK([ #include <stdio.h> #include <esd.h> ], [ return 0; ], [ echo "*** The test program compiled, but did not run. This usually means" echo "*** that the run-time linker is not finding ESD or finding the wrong" echo "*** version of ESD. If it is not finding ESD, you'll need to set your" echo "*** LD_LIBRARY_PATH environment variable, or edit /etc/ld.so.conf to point" echo "*** to the installed location Also, make sure you have run ldconfig if that" echo "*** is required on your system" echo "***" echo "*** If you have an old version installed, it is best to remove it, although" echo "*** you may also be able to get things to work by modifying LD_LIBRARY_PATH"], [ echo "*** The test program failed to compile or link. See the file config.log for the" echo "*** exact error that occured. This usually means ESD was incorrectly installed" echo "*** or that you have moved ESD since it was installed. In the latter case, you" echo "*** may want to edit the esd-config script: $ESD_CONFIG" ]) CFLAGS="$ac_save_CFLAGS" LIBS="$ac_save_LIBS" fi fi ESD_CFLAGS="" ESD_LIBS="" ifelse([$3], , :, [$3]) fi AC_SUBST(ESD_CFLAGS) AC_SUBST(ESD_LIBS) rm -f conf.esdtest ])
{ "pile_set_name": "Github" }
package jsoniter import ( "encoding/base64" "reflect" "strconv" "unsafe" "github.com/modern-go/reflect2" ) const ptrSize = 32 << uintptr(^uintptr(0)>>63) func createEncoderOfNative(ctx *ctx, typ reflect2.Type) ValEncoder { if typ.Kind() == reflect.Slice && typ.(reflect2.SliceType).Elem().Kind() == reflect.Uint8 { sliceDecoder := decoderOfSlice(ctx, typ) return &base64Codec{sliceDecoder: sliceDecoder} } typeName := typ.String() kind := typ.Kind() switch kind { case reflect.String: if typeName != "string" { return encoderOfType(ctx, reflect2.TypeOfPtr((*string)(nil)).Elem()) } return &stringCodec{} case reflect.Int: if typeName != "int" { return encoderOfType(ctx, reflect2.TypeOfPtr((*int)(nil)).Elem()) } if strconv.IntSize == 32 { return &int32Codec{} } return &int64Codec{} case reflect.Int8: if typeName != "int8" { return encoderOfType(ctx, reflect2.TypeOfPtr((*int8)(nil)).Elem()) } return &int8Codec{} case reflect.Int16: if typeName != "int16" { return encoderOfType(ctx, reflect2.TypeOfPtr((*int16)(nil)).Elem()) } return &int16Codec{} case reflect.Int32: if typeName != "int32" { return encoderOfType(ctx, reflect2.TypeOfPtr((*int32)(nil)).Elem()) } return &int32Codec{} case reflect.Int64: if typeName != "int64" { return encoderOfType(ctx, reflect2.TypeOfPtr((*int64)(nil)).Elem()) } return &int64Codec{} case reflect.Uint: if typeName != "uint" { return encoderOfType(ctx, reflect2.TypeOfPtr((*uint)(nil)).Elem()) } if strconv.IntSize == 32 { return &uint32Codec{} } return &uint64Codec{} case reflect.Uint8: if typeName != "uint8" { return encoderOfType(ctx, reflect2.TypeOfPtr((*uint8)(nil)).Elem()) } return &uint8Codec{} case reflect.Uint16: if typeName != "uint16" { return encoderOfType(ctx, reflect2.TypeOfPtr((*uint16)(nil)).Elem()) } return &uint16Codec{} case reflect.Uint32: if typeName != "uint32" { return encoderOfType(ctx, reflect2.TypeOfPtr((*uint32)(nil)).Elem()) } return &uint32Codec{} case reflect.Uintptr: if typeName != "uintptr" { return encoderOfType(ctx, reflect2.TypeOfPtr((*uintptr)(nil)).Elem()) } if ptrSize == 32 { return &uint32Codec{} } return &uint64Codec{} case reflect.Uint64: if typeName != "uint64" { return encoderOfType(ctx, reflect2.TypeOfPtr((*uint64)(nil)).Elem()) } return &uint64Codec{} case reflect.Float32: if typeName != "float32" { return encoderOfType(ctx, reflect2.TypeOfPtr((*float32)(nil)).Elem()) } return &float32Codec{} case reflect.Float64: if typeName != "float64" { return encoderOfType(ctx, reflect2.TypeOfPtr((*float64)(nil)).Elem()) } return &float64Codec{} case reflect.Bool: if typeName != "bool" { return encoderOfType(ctx, reflect2.TypeOfPtr((*bool)(nil)).Elem()) } return &boolCodec{} } return nil } func createDecoderOfNative(ctx *ctx, typ reflect2.Type) ValDecoder { if typ.Kind() == reflect.Slice && typ.(reflect2.SliceType).Elem().Kind() == reflect.Uint8 { sliceDecoder := decoderOfSlice(ctx, typ) return &base64Codec{sliceDecoder: sliceDecoder} } typeName := typ.String() switch typ.Kind() { case reflect.String: if typeName != "string" { return decoderOfType(ctx, reflect2.TypeOfPtr((*string)(nil)).Elem()) } return &stringCodec{} case reflect.Int: if typeName != "int" { return decoderOfType(ctx, reflect2.TypeOfPtr((*int)(nil)).Elem()) } if strconv.IntSize == 32 { return &int32Codec{} } return &int64Codec{} case reflect.Int8: if typeName != "int8" { return decoderOfType(ctx, reflect2.TypeOfPtr((*int8)(nil)).Elem()) } return &int8Codec{} case reflect.Int16: if typeName != "int16" { return decoderOfType(ctx, reflect2.TypeOfPtr((*int16)(nil)).Elem()) } return &int16Codec{} case reflect.Int32: if typeName != "int32" { return decoderOfType(ctx, reflect2.TypeOfPtr((*int32)(nil)).Elem()) } return &int32Codec{} case reflect.Int64: if typeName != "int64" { return decoderOfType(ctx, reflect2.TypeOfPtr((*int64)(nil)).Elem()) } return &int64Codec{} case reflect.Uint: if typeName != "uint" { return decoderOfType(ctx, reflect2.TypeOfPtr((*uint)(nil)).Elem()) } if strconv.IntSize == 32 { return &uint32Codec{} } return &uint64Codec{} case reflect.Uint8: if typeName != "uint8" { return decoderOfType(ctx, reflect2.TypeOfPtr((*uint8)(nil)).Elem()) } return &uint8Codec{} case reflect.Uint16: if typeName != "uint16" { return decoderOfType(ctx, reflect2.TypeOfPtr((*uint16)(nil)).Elem()) } return &uint16Codec{} case reflect.Uint32: if typeName != "uint32" { return decoderOfType(ctx, reflect2.TypeOfPtr((*uint32)(nil)).Elem()) } return &uint32Codec{} case reflect.Uintptr: if typeName != "uintptr" { return decoderOfType(ctx, reflect2.TypeOfPtr((*uintptr)(nil)).Elem()) } if ptrSize == 32 { return &uint32Codec{} } return &uint64Codec{} case reflect.Uint64: if typeName != "uint64" { return decoderOfType(ctx, reflect2.TypeOfPtr((*uint64)(nil)).Elem()) } return &uint64Codec{} case reflect.Float32: if typeName != "float32" { return decoderOfType(ctx, reflect2.TypeOfPtr((*float32)(nil)).Elem()) } return &float32Codec{} case reflect.Float64: if typeName != "float64" { return decoderOfType(ctx, reflect2.TypeOfPtr((*float64)(nil)).Elem()) } return &float64Codec{} case reflect.Bool: if typeName != "bool" { return decoderOfType(ctx, reflect2.TypeOfPtr((*bool)(nil)).Elem()) } return &boolCodec{} } return nil } type stringCodec struct { } func (codec *stringCodec) Decode(ptr unsafe.Pointer, iter *Iterator) { *((*string)(ptr)) = iter.ReadString() } func (codec *stringCodec) Encode(ptr unsafe.Pointer, stream *Stream) { str := *((*string)(ptr)) stream.WriteString(str) } func (codec *stringCodec) IsEmpty(ptr unsafe.Pointer) bool { return *((*string)(ptr)) == "" } type int8Codec struct { } func (codec *int8Codec) Decode(ptr unsafe.Pointer, iter *Iterator) { if !iter.ReadNil() { *((*int8)(ptr)) = iter.ReadInt8() } } func (codec *int8Codec) Encode(ptr unsafe.Pointer, stream *Stream) { stream.WriteInt8(*((*int8)(ptr))) } func (codec *int8Codec) IsEmpty(ptr unsafe.Pointer) bool { return *((*int8)(ptr)) == 0 } type int16Codec struct { } func (codec *int16Codec) Decode(ptr unsafe.Pointer, iter *Iterator) { if !iter.ReadNil() { *((*int16)(ptr)) = iter.ReadInt16() } } func (codec *int16Codec) Encode(ptr unsafe.Pointer, stream *Stream) { stream.WriteInt16(*((*int16)(ptr))) } func (codec *int16Codec) IsEmpty(ptr unsafe.Pointer) bool { return *((*int16)(ptr)) == 0 } type int32Codec struct { } func (codec *int32Codec) Decode(ptr unsafe.Pointer, iter *Iterator) { if !iter.ReadNil() { *((*int32)(ptr)) = iter.ReadInt32() } } func (codec *int32Codec) Encode(ptr unsafe.Pointer, stream *Stream) { stream.WriteInt32(*((*int32)(ptr))) } func (codec *int32Codec) IsEmpty(ptr unsafe.Pointer) bool { return *((*int32)(ptr)) == 0 } type int64Codec struct { } func (codec *int64Codec) Decode(ptr unsafe.Pointer, iter *Iterator) { if !iter.ReadNil() { *((*int64)(ptr)) = iter.ReadInt64() } } func (codec *int64Codec) Encode(ptr unsafe.Pointer, stream *Stream) { stream.WriteInt64(*((*int64)(ptr))) } func (codec *int64Codec) IsEmpty(ptr unsafe.Pointer) bool { return *((*int64)(ptr)) == 0 } type uint8Codec struct { } func (codec *uint8Codec) Decode(ptr unsafe.Pointer, iter *Iterator) { if !iter.ReadNil() { *((*uint8)(ptr)) = iter.ReadUint8() } } func (codec *uint8Codec) Encode(ptr unsafe.Pointer, stream *Stream) { stream.WriteUint8(*((*uint8)(ptr))) } func (codec *uint8Codec) IsEmpty(ptr unsafe.Pointer) bool { return *((*uint8)(ptr)) == 0 } type uint16Codec struct { } func (codec *uint16Codec) Decode(ptr unsafe.Pointer, iter *Iterator) { if !iter.ReadNil() { *((*uint16)(ptr)) = iter.ReadUint16() } } func (codec *uint16Codec) Encode(ptr unsafe.Pointer, stream *Stream) { stream.WriteUint16(*((*uint16)(ptr))) } func (codec *uint16Codec) IsEmpty(ptr unsafe.Pointer) bool { return *((*uint16)(ptr)) == 0 } type uint32Codec struct { } func (codec *uint32Codec) Decode(ptr unsafe.Pointer, iter *Iterator) { if !iter.ReadNil() { *((*uint32)(ptr)) = iter.ReadUint32() } } func (codec *uint32Codec) Encode(ptr unsafe.Pointer, stream *Stream) { stream.WriteUint32(*((*uint32)(ptr))) } func (codec *uint32Codec) IsEmpty(ptr unsafe.Pointer) bool { return *((*uint32)(ptr)) == 0 } type uint64Codec struct { } func (codec *uint64Codec) Decode(ptr unsafe.Pointer, iter *Iterator) { if !iter.ReadNil() { *((*uint64)(ptr)) = iter.ReadUint64() } } func (codec *uint64Codec) Encode(ptr unsafe.Pointer, stream *Stream) { stream.WriteUint64(*((*uint64)(ptr))) } func (codec *uint64Codec) IsEmpty(ptr unsafe.Pointer) bool { return *((*uint64)(ptr)) == 0 } type float32Codec struct { } func (codec *float32Codec) Decode(ptr unsafe.Pointer, iter *Iterator) { if !iter.ReadNil() { *((*float32)(ptr)) = iter.ReadFloat32() } } func (codec *float32Codec) Encode(ptr unsafe.Pointer, stream *Stream) { stream.WriteFloat32(*((*float32)(ptr))) } func (codec *float32Codec) IsEmpty(ptr unsafe.Pointer) bool { return *((*float32)(ptr)) == 0 } type float64Codec struct { } func (codec *float64Codec) Decode(ptr unsafe.Pointer, iter *Iterator) { if !iter.ReadNil() { *((*float64)(ptr)) = iter.ReadFloat64() } } func (codec *float64Codec) Encode(ptr unsafe.Pointer, stream *Stream) { stream.WriteFloat64(*((*float64)(ptr))) } func (codec *float64Codec) IsEmpty(ptr unsafe.Pointer) bool { return *((*float64)(ptr)) == 0 } type boolCodec struct { } func (codec *boolCodec) Decode(ptr unsafe.Pointer, iter *Iterator) { if !iter.ReadNil() { *((*bool)(ptr)) = iter.ReadBool() } } func (codec *boolCodec) Encode(ptr unsafe.Pointer, stream *Stream) { stream.WriteBool(*((*bool)(ptr))) } func (codec *boolCodec) IsEmpty(ptr unsafe.Pointer) bool { return !(*((*bool)(ptr))) } type base64Codec struct { sliceType *reflect2.UnsafeSliceType sliceDecoder ValDecoder } func (codec *base64Codec) Decode(ptr unsafe.Pointer, iter *Iterator) { if iter.ReadNil() { codec.sliceType.UnsafeSetNil(ptr) return } switch iter.WhatIsNext() { case StringValue: src := iter.ReadString() dst, err := base64.StdEncoding.DecodeString(src) if err != nil { iter.ReportError("decode base64", err.Error()) } else { codec.sliceType.UnsafeSet(ptr, unsafe.Pointer(&dst)) } case ArrayValue: codec.sliceDecoder.Decode(ptr, iter) default: iter.ReportError("base64Codec", "invalid input") } } func (codec *base64Codec) Encode(ptr unsafe.Pointer, stream *Stream) { src := *((*[]byte)(ptr)) if len(src) == 0 { stream.WriteNil() return } encoding := base64.StdEncoding stream.writeByte('"') size := encoding.EncodedLen(len(src)) buf := make([]byte, size) encoding.Encode(buf, src) stream.buf = append(stream.buf, buf...) stream.writeByte('"') } func (codec *base64Codec) IsEmpty(ptr unsafe.Pointer) bool { return len(*((*[]byte)(ptr))) == 0 }
{ "pile_set_name": "Github" }
using System; using System.Reflection; using GraphQL.Reflection; namespace GraphQL.Resolvers { public class DelegateFieldModelBinderResolver : IFieldResolver { private readonly Delegate _resolver; private readonly ParameterInfo[] _parameters; public DelegateFieldModelBinderResolver(Delegate resolver) { _resolver = resolver ?? throw new ArgumentNullException(nameof(resolver), "A resolver function must be specified"); _parameters = _resolver.GetMethodInfo().GetParameters(); } public object Resolve(IResolveFieldContext context) { var arguments = ReflectionHelper.BuildArguments(_parameters, context); return _resolver.DynamicInvoke(arguments); } } }
{ "pile_set_name": "Github" }
{{- if .Values.serviceAccount.create -}} apiVersion: v1 kind: ServiceAccount metadata: name: {{ template "cockroachdb.serviceAccountName" . }} labels: {{ include "cockroachdb.labels" . | indent 4 }} {{- end -}}
{ "pile_set_name": "Github" }
@font-face { font-family: 'Material Icons'; font-style: normal; font-weight: 400; src: url(../../fonts/MaterialIcons-Regular.eot); src: local("Material Icons"), local("MaterialIcons-Regular"), url(../../fonts/MaterialIcons-Regular.woff2) format("woff2"), url(../../fonts/MaterialIcons-Regular.woff) format("woff"), url(../../fonts/MaterialIcons-Regular.ttf) format("truetype") } .material-icons { font-family: 'Material Icons'; font-weight: normal; font-style: normal; line-height: 1; letter-spacing: normal; text-transform: none; display: inline-block; vertical-align: middle; white-space: nowrap; word-wrap: normal; direction: ltr; -webkit-font-feature-settings: 'liga'; -webkit-font-smoothing: antialiased } .material-icons.d3_rotation:before { content: "\e84d" } .material-icons.ac_unit:before { content: "\eb3b" } .material-icons.access_alarm:before { content: "\e190" } .material-icons.access_alarms:before { content: "\e191" } .material-icons.access_time:before { content: "\e192" } .material-icons.accessibility:before { content: "\e84e" } .material-icons.accessible:before { content: "\e914" } .material-icons.account_balance:before { content: "\e84f" } .material-icons.account_balance_wallet:before { content: "\e850" } .material-icons.account_box:before { content: "\e851" } .material-icons.account_circle:before { content: "\e853" } .material-icons.adb:before { content: "\e60e" } .material-icons.add:before { content: "\e145" } .material-icons.add_a_photo:before { content: "\e439" } .material-icons.add_alarm:before { content: "\e193" } .material-icons.add_alert:before { content: "\e003" } .material-icons.add_box:before { content: "\e146" } .material-icons.add_circle:before { content: "\e147" } .material-icons.add_circle_outline:before { content: "\e148" } .material-icons.add_location:before { content: "\e567" } .material-icons.add_shopping_cart:before { content: "\e854" } .material-icons.add_to_photos:before { content: "\e39d" } .material-icons.add_to_queue:before { content: "\e05c" } .material-icons.adjust:before { content: "\e39e" } .material-icons.airline_seat_flat:before { content: "\e630" } .material-icons.airline_seat_flat_angled:before { content: "\e631" } .material-icons.airline_seat_individual_suite:before { content: "\e632" } .material-icons.airline_seat_legroom_extra:before { content: "\e633" } .material-icons.airline_seat_legroom_normal:before { content: "\e634" } .material-icons.airline_seat_legroom_reduced:before { content: "\e635" } .material-icons.airline_seat_recline_extra:before { content: "\e636" } .material-icons.airline_seat_recline_normal:before { content: "\e637" } .material-icons.airplanemode_active:before { content: "\e195" } .material-icons.airplanemode_inactive:before { content: "\e194" } .material-icons.airplay:before { content: "\e055" } .material-icons.airport_shuttle:before { content: "\eb3c" } .material-icons.alarm:before { content: "\e855" } .material-icons.alarm_add:before { content: "\e856" } .material-icons.alarm_off:before { content: "\e857" } .material-icons.alarm_on:before { content: "\e858" } .material-icons.album:before { content: "\e019" } .material-icons.all_inclusive:before { content: "\eb3d" } .material-icons.all_out:before { content: "\e90b" } .material-icons.android:before { content: "\e859" } .material-icons.announcement:before { content: "\e85a" } .material-icons.apps:before { content: "\e5c3" } .material-icons.archive:before { content: "\e149" } .material-icons.arrow_back:before { content: "\e5c4" } .material-icons.arrow_downward:before { content: "\e5db" } .material-icons.arrow_drop_down:before { content: "\e5c5" } .material-icons.arrow_drop_down_circle:before { content: "\e5c6" } .material-icons.arrow_drop_up:before { content: "\e5c7" } .material-icons.arrow_forward:before { content: "\e5c8" } .material-icons.arrow_upward:before { content: "\e5d8" } .material-icons.art_track:before { content: "\e060" } .material-icons.aspect_ratio:before { content: "\e85b" } .material-icons.assessment:before { content: "\e85c" } .material-icons.assignment:before { content: "\e85d" } .material-icons.assignment_ind:before { content: "\e85e" } .material-icons.assignment_late:before { content: "\e85f" } .material-icons.assignment_return:before { content: "\e860" } .material-icons.assignment_returned:before { content: "\e861" } .material-icons.assignment_turned_in:before { content: "\e862" } .material-icons.assistant:before { content: "\e39f" } .material-icons.assistant_photo:before { content: "\e3a0" } .material-icons.attach_file:before { content: "\e226" } .material-icons.attach_money:before { content: "\e227" } .material-icons.attachment:before { content: "\e2bc" } .material-icons.audiotrack:before { content: "\e3a1" } .material-icons.autorenew:before { content: "\e863" } .material-icons.av_timer:before { content: "\e01b" } .material-icons.backspace:before { content: "\e14a" } .material-icons.backup:before { content: "\e864" } .material-icons.battery_alert:before { content: "\e19c" } .material-icons.battery_charging_full:before { content: "\e1a3" } .material-icons.battery_full:before { content: "\e1a4" } .material-icons.battery_std:before { content: "\e1a5" } .material-icons.battery_unknown:before { content: "\e1a6" } .material-icons.beach_access:before { content: "\eb3e" } .material-icons.beenhere:before { content: "\e52d" } .material-icons.block:before { content: "\e14b" } .material-icons.bluetooth:before { content: "\e1a7" } .material-icons.bluetooth_audio:before { content: "\e60f" } .material-icons.bluetooth_connected:before { content: "\e1a8" } .material-icons.bluetooth_disabled:before { content: "\e1a9" } .material-icons.bluetooth_searching:before { content: "\e1aa" } .material-icons.blur_circular:before { content: "\e3a2" } .material-icons.blur_linear:before { content: "\e3a3" } .material-icons.blur_off:before { content: "\e3a4" } .material-icons.blur_on:before { content: "\e3a5" } .material-icons.book:before { content: "\e865" } .material-icons.bookmark:before { content: "\e866" } .material-icons.bookmark_border:before { content: "\e867" } .material-icons.border_all:before { content: "\e228" } .material-icons.border_bottom:before { content: "\e229" } .material-icons.border_clear:before { content: "\e22a" } .material-icons.border_color:before { content: "\e22b" } .material-icons.border_horizontal:before { content: "\e22c" } .material-icons.border_inner:before { content: "\e22d" } .material-icons.border_left:before { content: "\e22e" } .material-icons.border_outer:before { content: "\e22f" } .material-icons.border_right:before { content: "\e230" } .material-icons.border_style:before { content: "\e231" } .material-icons.border_top:before { content: "\e232" } .material-icons.border_vertical:before { content: "\e233" } .material-icons.branding_watermark:before { content: "\e06b" } .material-icons.brightness_1:before { content: "\e3a6" } .material-icons.brightness_2:before { content: "\e3a7" } .material-icons.brightness_3:before { content: "\e3a8" } .material-icons.brightness_4:before { content: "\e3a9" } .material-icons.brightness_5:before { content: "\e3aa" } .material-icons.brightness_6:before { content: "\e3ab" } .material-icons.brightness_7:before { content: "\e3ac" } .material-icons.brightness_auto:before { content: "\e1ab" } .material-icons.brightness_high:before { content: "\e1ac" } .material-icons.brightness_low:before { content: "\e1ad" } .material-icons.brightness_medium:before { content: "\e1ae" } .material-icons.broken_image:before { content: "\e3ad" } .material-icons.brush:before { content: "\e3ae" } .material-icons.bubble_chart:before { content: "\e6dd" } .material-icons.bug_report:before { content: "\e868" } .material-icons.build:before { content: "\e869" } .material-icons.burst_mode:before { content: "\e43c" } .material-icons.business:before { content: "\e0af" } .material-icons.business_center:before { content: "\eb3f" } .material-icons.cached:before { content: "\e86a" } .material-icons.cake:before { content: "\e7e9" } .material-icons.call:before { content: "\e0b0" } .material-icons.call_end:before { content: "\e0b1" } .material-icons.call_made:before { content: "\e0b2" } .material-icons.call_merge:before { content: "\e0b3" } .material-icons.call_missed:before { content: "\e0b4" } .material-icons.call_missed_outgoing:before { content: "\e0e4" } .material-icons.call_received:before { content: "\e0b5" } .material-icons.call_split:before { content: "\e0b6" } .material-icons.call_to_action:before { content: "\e06c" } .material-icons.camera:before { content: "\e3af" } .material-icons.camera_alt:before { content: "\e3b0" } .material-icons.camera_enhance:before { content: "\e8fc" } .material-icons.camera_front:before { content: "\e3b1" } .material-icons.camera_rear:before { content: "\e3b2" } .material-icons.camera_roll:before { content: "\e3b3" } .material-icons.cancel:before { content: "\e5c9" } .material-icons.card_giftcard:before { content: "\e8f6" } .material-icons.card_membership:before { content: "\e8f7" } .material-icons.card_travel:before { content: "\e8f8" } .material-icons.casino:before { content: "\eb40" } .material-icons.cast:before { content: "\e307" } .material-icons.cast_connected:before { content: "\e308" } .material-icons.center_focus_strong:before { content: "\e3b4" } .material-icons.center_focus_weak:before { content: "\e3b5" } .material-icons.change_history:before { content: "\e86b" } .material-icons.chat:before { content: "\e0b7" } .material-icons.chat_bubble:before { content: "\e0ca" } .material-icons.chat_bubble_outline:before { content: "\e0cb" } .material-icons.check:before { content: "\e5ca" } .material-icons.check_box:before { content: "\e834" } .material-icons.check_box_outline_blank:before { content: "\e835" } .material-icons.check_circle:before { content: "\e86c" } .material-icons.chevron_left:before { content: "\e5cb" } .material-icons.chevron_right:before { content: "\e5cc" } .material-icons.child_care:before { content: "\eb41" } .material-icons.child_friendly:before { content: "\eb42" } .material-icons.chrome_reader_mode:before { content: "\e86d" } .material-icons.class:before { content: "\e86e" } .material-icons.clear:before { content: "\e14c" } .material-icons.clear_all:before { content: "\e0b8" } .material-icons.close:before { content: "\e5cd" } .material-icons.closed_caption:before { content: "\e01c" } .material-icons.cloud:before { content: "\e2bd" } .material-icons.cloud_circle:before { content: "\e2be" } .material-icons.cloud_done:before { content: "\e2bf" } .material-icons.cloud_download:before { content: "\e2c0" } .material-icons.cloud_off:before { content: "\e2c1" } .material-icons.cloud_queue:before { content: "\e2c2" } .material-icons.cloud_upload:before { content: "\e2c3" } .material-icons.code:before { content: "\e86f" } .material-icons.collections:before { content: "\e3b6" } .material-icons.collections_bookmark:before { content: "\e431" } .material-icons.color_lens:before { content: "\e3b7" } .material-icons.colorize:before { content: "\e3b8" } .material-icons.comment:before { content: "\e0b9" } .material-icons.compare:before { content: "\e3b9" } .material-icons.compare_arrows:before { content: "\e915" } .material-icons.computer:before { content: "\e30a" } .material-icons.confirmation_number:before { content: "\e638" } .material-icons.contact_mail:before { content: "\e0d0" } .material-icons.contact_phone:before { content: "\e0cf" } .material-icons.contacts:before { content: "\e0ba" } .material-icons.content_copy:before { content: "\e14d" } .material-icons.content_cut:before { content: "\e14e" } .material-icons.content_paste:before { content: "\e14f" } .material-icons.control_point:before { content: "\e3ba" } .material-icons.control_point_duplicate:before { content: "\e3bb" } .material-icons.copyright:before { content: "\e90c" } .material-icons.create:before { content: "\e150" } .material-icons.create_new_folder:before { content: "\e2cc" } .material-icons.credit_card:before { content: "\e870" } .material-icons.crop:before { content: "\e3be" } .material-icons.crop_16_9:before { content: "\e3bc" } .material-icons.crop_3_2:before { content: "\e3bd" } .material-icons.crop_5_4:before { content: "\e3bf" } .material-icons.crop_7_5:before { content: "\e3c0" } .material-icons.crop_din:before { content: "\e3c1" } .material-icons.crop_free:before { content: "\e3c2" } .material-icons.crop_landscape:before { content: "\e3c3" } .material-icons.crop_original:before { content: "\e3c4" } .material-icons.crop_portrait:before { content: "\e3c5" } .material-icons.crop_rotate:before { content: "\e437" } .material-icons.crop_square:before { content: "\e3c6" } .material-icons.dashboard:before { content: "\e871" } .material-icons.data_usage:before { content: "\e1af" } .material-icons.date_range:before { content: "\e916" } .material-icons.dehaze:before { content: "\e3c7" } .material-icons.delete:before { content: "\e872" } .material-icons.delete_forever:before { content: "\e92b" } .material-icons.delete_sweep:before { content: "\e16c" } .material-icons.description:before { content: "\e873" } .material-icons.desktop_mac:before { content: "\e30b" } .material-icons.desktop_windows:before { content: "\e30c" } .material-icons.details:before { content: "\e3c8" } .material-icons.developer_board:before { content: "\e30d" } .material-icons.developer_mode:before { content: "\e1b0" } .material-icons.device_hub:before { content: "\e335" } .material-icons.devices:before { content: "\e1b1" } .material-icons.devices_other:before { content: "\e337" } .material-icons.dialer_sip:before { content: "\e0bb" } .material-icons.dialpad:before { content: "\e0bc" } .material-icons.directions:before { content: "\e52e" } .material-icons.directions_bike:before { content: "\e52f" } .material-icons.directions_boat:before { content: "\e532" } .material-icons.directions_bus:before { content: "\e530" } .material-icons.directions_car:before { content: "\e531" } .material-icons.directions_railway:before { content: "\e534" } .material-icons.directions_run:before { content: "\e566" } .material-icons.directions_subway:before { content: "\e533" } .material-icons.directions_transit:before { content: "\e535" } .material-icons.directions_walk:before { content: "\e536" } .material-icons.disc_full:before { content: "\e610" } .material-icons.dns:before { content: "\e875" } .material-icons.do_not_disturb:before { content: "\e612" } .material-icons.do_not_disturb_alt:before { content: "\e611" } .material-icons.do_not_disturb_off:before { content: "\e643" } .material-icons.do_not_disturb_on:before { content: "\e644" } .material-icons.dock:before { content: "\e30e" } .material-icons.domain:before { content: "\e7ee" } .material-icons.done:before { content: "\e876" } .material-icons.done_all:before { content: "\e877" } .material-icons.donut_large:before { content: "\e917" } .material-icons.donut_small:before { content: "\e918" } .material-icons.drafts:before { content: "\e151" } .material-icons.drag_handle:before { content: "\e25d" } .material-icons.drive_eta:before { content: "\e613" } .material-icons.dvr:before { content: "\e1b2" } .material-icons.edit:before { content: "\e3c9" } .material-icons.edit_location:before { content: "\e568" } .material-icons.eject:before { content: "\e8fb" } .material-icons.email:before { content: "\e0be" } .material-icons.enhanced_encryption:before { content: "\e63f" } .material-icons.equalizer:before { content: "\e01d" } .material-icons.error:before { content: "\e000" } .material-icons.error_outline:before { content: "\e001" } .material-icons.euro_symbol:before { content: "\e926" } .material-icons.ev_station:before { content: "\e56d" } .material-icons.event:before { content: "\e878" } .material-icons.event_available:before { content: "\e614" } .material-icons.event_busy:before { content: "\e615" } .material-icons.event_note:before { content: "\e616" } .material-icons.event_seat:before { content: "\e903" } .material-icons.exit_to_app:before { content: "\e879" } .material-icons.expand_less:before { content: "\e5ce" } .material-icons.expand_more:before { content: "\e5cf" } .material-icons.explicit:before { content: "\e01e" } .material-icons.explore:before { content: "\e87a" } .material-icons.exposure:before { content: "\e3ca" } .material-icons.exposure_neg_1:before { content: "\e3cb" } .material-icons.exposure_neg_2:before { content: "\e3cc" } .material-icons.exposure_plus_1:before { content: "\e3cd" } .material-icons.exposure_plus_2:before { content: "\e3ce" } .material-icons.exposure_zero:before { content: "\e3cf" } .material-icons.extension:before { content: "\e87b" } .material-icons.face:before { content: "\e87c" } .material-icons.fast_forward:before { content: "\e01f" } .material-icons.fast_rewind:before { content: "\e020" } .material-icons.favorite:before { content: "\e87d" } .material-icons.favorite_border:before { content: "\e87e" } .material-icons.featured_play_list:before { content: "\e06d" } .material-icons.featured_video:before { content: "\e06e" } .material-icons.feedback:before { content: "\e87f" } .material-icons.fiber_dvr:before { content: "\e05d" } .material-icons.fiber_manual_record:before { content: "\e061" } .material-icons.fiber_new:before { content: "\e05e" } .material-icons.fiber_pin:before { content: "\e06a" } .material-icons.fiber_smart_record:before { content: "\e062" } .material-icons.file_download:before { content: "\e2c4" } .material-icons.file_upload:before { content: "\e2c6" } .material-icons.filter:before { content: "\e3d3" } .material-icons.filter_1:before { content: "\e3d0" } .material-icons.filter_2:before { content: "\e3d1" } .material-icons.filter_3:before { content: "\e3d2" } .material-icons.filter_4:before { content: "\e3d4" } .material-icons.filter_5:before { content: "\e3d5" } .material-icons.filter_6:before { content: "\e3d6" } .material-icons.filter_7:before { content: "\e3d7" } .material-icons.filter_8:before { content: "\e3d8" } .material-icons.filter_9:before { content: "\e3d9" } .material-icons.filter_9_plus:before { content: "\e3da" } .material-icons.filter_b_and_w:before { content: "\e3db" } .material-icons.filter_center_focus:before { content: "\e3dc" } .material-icons.filter_drama:before { content: "\e3dd" } .material-icons.filter_frames:before { content: "\e3de" } .material-icons.filter_hdr:before { content: "\e3df" } .material-icons.filter_list:before { content: "\e152" } .material-icons.filter_none:before { content: "\e3e0" } .material-icons.filter_tilt_shift:before { content: "\e3e2" } .material-icons.filter_vintage:before { content: "\e3e3" } .material-icons.find_in_page:before { content: "\e880" } .material-icons.find_replace:before { content: "\e881" } .material-icons.fingerprint:before { content: "\e90d" } .material-icons.first_page:before { content: "\e5dc" } .material-icons.fitness_center:before { content: "\eb43" } .material-icons.flag:before { content: "\e153" } .material-icons.flare:before { content: "\e3e4" } .material-icons.flash_auto:before { content: "\e3e5" } .material-icons.flash_off:before { content: "\e3e6" } .material-icons.flash_on:before { content: "\e3e7" } .material-icons.flight:before { content: "\e539" } .material-icons.flight_land:before { content: "\e904" } .material-icons.flight_takeoff:before { content: "\e905" } .material-icons.flip:before { content: "\e3e8" } .material-icons.flip_to_back:before { content: "\e882" } .material-icons.flip_to_front:before { content: "\e883" } .material-icons.folder:before { content: "\e2c7" } .material-icons.folder_open:before { content: "\e2c8" } .material-icons.folder_shared:before { content: "\e2c9" } .material-icons.folder_special:before { content: "\e617" } .material-icons.font_download:before { content: "\e167" } .material-icons.format_align_center:before { content: "\e234" } .material-icons.format_align_justify:before { content: "\e235" } .material-icons.format_align_left:before { content: "\e236" } .material-icons.format_align_right:before { content: "\e237" } .material-icons.format_bold:before { content: "\e238" } .material-icons.format_clear:before { content: "\e239" } .material-icons.format_color_fill:before { content: "\e23a" } .material-icons.format_color_reset:before { content: "\e23b" } .material-icons.format_color_text:before { content: "\e23c" } .material-icons.format_indent_decrease:before { content: "\e23d" } .material-icons.format_indent_increase:before { content: "\e23e" } .material-icons.format_italic:before { content: "\e23f" } .material-icons.format_line_spacing:before { content: "\e240" } .material-icons.format_list_bulleted:before { content: "\e241" } .material-icons.format_list_numbered:before { content: "\e242" } .material-icons.format_paint:before { content: "\e243" } .material-icons.format_quote:before { content: "\e244" } .material-icons.format_shapes:before { content: "\e25e" } .material-icons.format_size:before { content: "\e245" } .material-icons.format_strikethrough:before { content: "\e246" } .material-icons.format_textdirection_l_to_r:before { content: "\e247" } .material-icons.format_textdirection_r_to_l:before { content: "\e248" } .material-icons.format_underlined:before { content: "\e249" } .material-icons.forum:before { content: "\e0bf" } .material-icons.forward:before { content: "\e154" } .material-icons.forward_10:before { content: "\e056" } .material-icons.forward_30:before { content: "\e057" } .material-icons.forward_5:before { content: "\e058" } .material-icons.free_breakfast:before { content: "\eb44" } .material-icons.fullscreen:before { content: "\e5d0" } .material-icons.fullscreen_exit:before { content: "\e5d1" } .material-icons.functions:before { content: "\e24a" } .material-icons.g_translate:before { content: "\e927" } .material-icons.gamepad:before { content: "\e30f" } .material-icons.games:before { content: "\e021" } .material-icons.gavel:before { content: "\e90e" } .material-icons.gesture:before { content: "\e155" } .material-icons.get_app:before { content: "\e884" } .material-icons.gif:before { content: "\e908" } .material-icons.golf_course:before { content: "\eb45" } .material-icons.gps_fixed:before { content: "\e1b3" } .material-icons.gps_not_fixed:before { content: "\e1b4" } .material-icons.gps_off:before { content: "\e1b5" } .material-icons.grade:before { content: "\e885" } .material-icons.gradient:before { content: "\e3e9" } .material-icons.grain:before { content: "\e3ea" } .material-icons.graphic_eq:before { content: "\e1b8" } .material-icons.grid_off:before { content: "\e3eb" } .material-icons.grid_on:before { content: "\e3ec" } .material-icons.group:before { content: "\e7ef" } .material-icons.group_add:before { content: "\e7f0" } .material-icons.group_work:before { content: "\e886" } .material-icons.hd:before { content: "\e052" } .material-icons.hdr_off:before { content: "\e3ed" } .material-icons.hdr_on:before { content: "\e3ee" } .material-icons.hdr_strong:before { content: "\e3f1" } .material-icons.hdr_weak:before { content: "\e3f2" } .material-icons.headset:before { content: "\e310" } .material-icons.headset_mic:before { content: "\e311" } .material-icons.healing:before { content: "\e3f3" } .material-icons.hearing:before { content: "\e023" } .material-icons.help:before { content: "\e887" } .material-icons.help_outline:before { content: "\e8fd" } .material-icons.high_quality:before { content: "\e024" } .material-icons.highlight:before { content: "\e25f" } .material-icons.highlight_off:before { content: "\e888" } .material-icons.history:before { content: "\e889" } .material-icons.home:before { content: "\e88a" } .material-icons.hot_tub:before { content: "\eb46" } .material-icons.hotel:before { content: "\e53a" } .material-icons.hourglass_empty:before { content: "\e88b" } .material-icons.hourglass_full:before { content: "\e88c" } .material-icons.http:before { content: "\e902" } .material-icons.https:before { content: "\e88d" } .material-icons.image:before { content: "\e3f4" } .material-icons.image_aspect_ratio:before { content: "\e3f5" } .material-icons.import_contacts:before { content: "\e0e0" } .material-icons.import_export:before { content: "\e0c3" } .material-icons.important_devices:before { content: "\e912" } .material-icons.inbox:before { content: "\e156" } .material-icons.indeterminate_check_box:before { content: "\e909" } .material-icons.info:before { content: "\e88e" } .material-icons.info_outline:before { content: "\e88f" } .material-icons.input:before { content: "\e890" } .material-icons.insert_chart:before { content: "\e24b" } .material-icons.insert_comment:before { content: "\e24c" } .material-icons.insert_drive_file:before { content: "\e24d" } .material-icons.insert_emoticon:before { content: "\e24e" } .material-icons.insert_invitation:before { content: "\e24f" } .material-icons.insert_link:before { content: "\e250" } .material-icons.insert_photo:before { content: "\e251" } .material-icons.invert_colors:before { content: "\e891" } .material-icons.invert_colors_off:before { content: "\e0c4" } .material-icons.iso:before { content: "\e3f6" } .material-icons.keyboard:before { content: "\e312" } .material-icons.keyboard_arrow_down:before { content: "\e313" } .material-icons.keyboard_arrow_left:before { content: "\e314" } .material-icons.keyboard_arrow_right:before { content: "\e315" } .material-icons.keyboard_arrow_up:before { content: "\e316" } .material-icons.keyboard_backspace:before { content: "\e317" } .material-icons.keyboard_capslock:before { content: "\e318" } .material-icons.keyboard_hide:before { content: "\e31a" } .material-icons.keyboard_return:before { content: "\e31b" } .material-icons.keyboard_tab:before { content: "\e31c" } .material-icons.keyboard_voice:before { content: "\e31d" } .material-icons.kitchen:before { content: "\eb47" } .material-icons.label:before { content: "\e892" } .material-icons.label_outline:before { content: "\e893" } .material-icons.landscape:before { content: "\e3f7" } .material-icons.language:before { content: "\e894" } .material-icons.laptop:before { content: "\e31e" } .material-icons.laptop_chromebook:before { content: "\e31f" } .material-icons.laptop_mac:before { content: "\e320" } .material-icons.laptop_windows:before { content: "\e321" } .material-icons.last_page:before { content: "\e5dd" } .material-icons.launch:before { content: "\e895" } .material-icons.layers:before { content: "\e53b" } .material-icons.layers_clear:before { content: "\e53c" } .material-icons.leak_add:before { content: "\e3f8" } .material-icons.leak_remove:before { content: "\e3f9" } .material-icons.lens:before { content: "\e3fa" } .material-icons.library_add:before { content: "\e02e" } .material-icons.library_books:before { content: "\e02f" } .material-icons.library_music:before { content: "\e030" } .material-icons.lightbulb_outline:before { content: "\e90f" } .material-icons.line_style:before { content: "\e919" } .material-icons.line_weight:before { content: "\e91a" } .material-icons.linear_scale:before { content: "\e260" } .material-icons.link:before { content: "\e157" } .material-icons.linked_camera:before { content: "\e438" } .material-icons.list:before { content: "\e896" } .material-icons.live_help:before { content: "\e0c6" } .material-icons.live_tv:before { content: "\e639" } .material-icons.local_activity:before { content: "\e53f" } .material-icons.local_airport:before { content: "\e53d" } .material-icons.local_atm:before { content: "\e53e" } .material-icons.local_bar:before { content: "\e540" } .material-icons.local_cafe:before { content: "\e541" } .material-icons.local_car_wash:before { content: "\e542" } .material-icons.local_convenience_store:before { content: "\e543" } .material-icons.local_dining:before { content: "\e556" } .material-icons.local_drink:before { content: "\e544" } .material-icons.local_florist:before { content: "\e545" } .material-icons.local_gas_station:before { content: "\e546" } .material-icons.local_grocery_store:before { content: "\e547" } .material-icons.local_hospital:before { content: "\e548" } .material-icons.local_hotel:before { content: "\e549" } .material-icons.local_laundry_service:before { content: "\e54a" } .material-icons.local_library:before { content: "\e54b" } .material-icons.local_mall:before { content: "\e54c" } .material-icons.local_movies:before { content: "\e54d" } .material-icons.local_offer:before { content: "\e54e" } .material-icons.local_parking:before { content: "\e54f" } .material-icons.local_pharmacy:before { content: "\e550" } .material-icons.local_phone:before { content: "\e551" } .material-icons.local_pizza:before { content: "\e552" } .material-icons.local_play:before { content: "\e553" } .material-icons.local_post_office:before { content: "\e554" } .material-icons.local_printshop:before { content: "\e555" } .material-icons.local_see:before { content: "\e557" } .material-icons.local_shipping:before { content: "\e558" } .material-icons.local_taxi:before { content: "\e559" } .material-icons.location_city:before { content: "\e7f1" } .material-icons.location_disabled:before { content: "\e1b6" } .material-icons.location_off:before { content: "\e0c7" } .material-icons.location_on:before { content: "\e0c8" } .material-icons.location_searching:before { content: "\e1b7" } .material-icons.lock:before { content: "\e897" } .material-icons.lock_open:before { content: "\e898" } .material-icons.lock_outline:before { content: "\e899" } .material-icons.looks:before { content: "\e3fc" } .material-icons.looks_3:before { content: "\e3fb" } .material-icons.looks_4:before { content: "\e3fd" } .material-icons.looks_5:before { content: "\e3fe" } .material-icons.looks_6:before { content: "\e3ff" } .material-icons.looks_one:before { content: "\e400" } .material-icons.looks_two:before { content: "\e401" } .material-icons.loop:before { content: "\e028" } .material-icons.loupe:before { content: "\e402" } .material-icons.low_priority:before { content: "\e16d" } .material-icons.loyalty:before { content: "\e89a" } .material-icons.mail:before { content: "\e158" } .material-icons.mail_outline:before { content: "\e0e1" } .material-icons.map:before { content: "\e55b" } .material-icons.markunread:before { content: "\e159" } .material-icons.markunread_mailbox:before { content: "\e89b" } .material-icons.memory:before { content: "\e322" } .material-icons.menu:before { content: "\e5d2" } .material-icons.merge_type:before { content: "\e252" } .material-icons.message:before { content: "\e0c9" } .material-icons.mic:before { content: "\e029" } .material-icons.mic_none:before { content: "\e02a" } .material-icons.mic_off:before { content: "\e02b" } .material-icons.mms:before { content: "\e618" } .material-icons.mode_comment:before { content: "\e253" } .material-icons.mode_edit:before { content: "\e254" } .material-icons.monetization_on:before { content: "\e263" } .material-icons.money_off:before { content: "\e25c" } .material-icons.monochrome_photos:before { content: "\e403" } .material-icons.mood:before { content: "\e7f2" } .material-icons.mood_bad:before { content: "\e7f3" } .material-icons.more:before { content: "\e619" } .material-icons.more_horiz:before { content: "\e5d3" } .material-icons.more_vert:before { content: "\e5d4" } .material-icons.motorcycle:before { content: "\e91b" } .material-icons.mouse:before { content: "\e323" } .material-icons.move_to_inbox:before { content: "\e168" } .material-icons.movie:before { content: "\e02c" } .material-icons.movie_creation:before { content: "\e404" } .material-icons.movie_filter:before { content: "\e43a" } .material-icons.multiline_chart:before { content: "\e6df" } .material-icons.music_note:before { content: "\e405" } .material-icons.music_video:before { content: "\e063" } .material-icons.my_location:before { content: "\e55c" } .material-icons.nature:before { content: "\e406" } .material-icons.nature_people:before { content: "\e407" } .material-icons.navigate_before:before { content: "\e408" } .material-icons.navigate_next:before { content: "\e409" } .material-icons.navigation:before { content: "\e55d" } .material-icons.near_me:before { content: "\e569" } .material-icons.network_cell:before { content: "\e1b9" } .material-icons.network_check:before { content: "\e640" } .material-icons.network_locked:before { content: "\e61a" } .material-icons.network_wifi:before { content: "\e1ba" } .material-icons.new_releases:before { content: "\e031" } .material-icons.next_week:before { content: "\e16a" } .material-icons.nfc:before { content: "\e1bb" } .material-icons.no_encryption:before { content: "\e641" } .material-icons.no_sim:before { content: "\e0cc" } .material-icons.not_interested:before { content: "\e033" } .material-icons.note:before { content: "\e06f" } .material-icons.note_add:before { content: "\e89c" } .material-icons.notifications:before { content: "\e7f4" } .material-icons.notifications_active:before { content: "\e7f7" } .material-icons.notifications_none:before { content: "\e7f5" } .material-icons.notifications_off:before { content: "\e7f6" } .material-icons.notifications_paused:before { content: "\e7f8" } .material-icons.offline_pin:before { content: "\e90a" } .material-icons.ondemand_video:before { content: "\e63a" } .material-icons.opacity:before { content: "\e91c" } .material-icons.open_in_browser:before { content: "\e89d" } .material-icons.open_in_new:before { content: "\e89e" } .material-icons.open_with:before { content: "\e89f" } .material-icons.pages:before { content: "\e7f9" } .material-icons.pageview:before { content: "\e8a0" } .material-icons.palette:before { content: "\e40a" } .material-icons.pan_tool:before { content: "\e925" } .material-icons.panorama:before { content: "\e40b" } .material-icons.panorama_fish_eye:before { content: "\e40c" } .material-icons.panorama_horizontal:before { content: "\e40d" } .material-icons.panorama_vertical:before { content: "\e40e" } .material-icons.panorama_wide_angle:before { content: "\e40f" } .material-icons.party_mode:before { content: "\e7fa" } .material-icons.pause:before { content: "\e034" } .material-icons.pause_circle_filled:before { content: "\e035" } .material-icons.pause_circle_outline:before { content: "\e036" } .material-icons.payment:before { content: "\e8a1" } .material-icons.people:before { content: "\e7fb" } .material-icons.people_outline:before { content: "\e7fc" } .material-icons.perm_camera_mic:before { content: "\e8a2" } .material-icons.perm_contact_calendar:before { content: "\e8a3" } .material-icons.perm_data_setting:before { content: "\e8a4" } .material-icons.perm_device_information:before { content: "\e8a5" } .material-icons.perm_identity:before { content: "\e8a6" } .material-icons.perm_media:before { content: "\e8a7" } .material-icons.perm_phone_msg:before { content: "\e8a8" } .material-icons.perm_scan_wifi:before { content: "\e8a9" } .material-icons.person:before { content: "\e7fd" } .material-icons.person_add:before { content: "\e7fe" } .material-icons.person_outline:before { content: "\e7ff" } .material-icons.person_pin:before { content: "\e55a" } .material-icons.person_pin_circle:before { content: "\e56a" } .material-icons.personal_video:before { content: "\e63b" } .material-icons.pets:before { content: "\e91d" } .material-icons.phone:before { content: "\e0cd" } .material-icons.phone_android:before { content: "\e324" } .material-icons.phone_bluetooth_speaker:before { content: "\e61b" } .material-icons.phone_forwarded:before { content: "\e61c" } .material-icons.phone_in_talk:before { content: "\e61d" } .material-icons.phone_iphone:before { content: "\e325" } .material-icons.phone_locked:before { content: "\e61e" } .material-icons.phone_missed:before { content: "\e61f" } .material-icons.phone_paused:before { content: "\e620" } .material-icons.phonelink:before { content: "\e326" } .material-icons.phonelink_erase:before { content: "\e0db" } .material-icons.phonelink_lock:before { content: "\e0dc" } .material-icons.phonelink_off:before { content: "\e327" } .material-icons.phonelink_ring:before { content: "\e0dd" } .material-icons.phonelink_setup:before { content: "\e0de" } .material-icons.photo:before { content: "\e410" } .material-icons.photo_album:before { content: "\e411" } .material-icons.photo_camera:before { content: "\e412" } .material-icons.photo_filter:before { content: "\e43b" } .material-icons.photo_library:before { content: "\e413" } .material-icons.photo_size_select_actual:before { content: "\e432" } .material-icons.photo_size_select_large:before { content: "\e433" } .material-icons.photo_size_select_small:before { content: "\e434" } .material-icons.picture_as_pdf:before { content: "\e415" } .material-icons.picture_in_picture:before { content: "\e8aa" } .material-icons.picture_in_picture_alt:before { content: "\e911" } .material-icons.pie_chart:before { content: "\e6c4" } .material-icons.pie_chart_outlined:before { content: "\e6c5" } .material-icons.pin_drop:before { content: "\e55e" } .material-icons.place:before { content: "\e55f" } .material-icons.play_arrow:before { content: "\e037" } .material-icons.play_circle_filled:before { content: "\e038" } .material-icons.play_circle_outline:before { content: "\e039" } .material-icons.play_for_work:before { content: "\e906" } .material-icons.playlist_add:before { content: "\e03b" } .material-icons.playlist_add_check:before { content: "\e065" } .material-icons.playlist_play:before { content: "\e05f" } .material-icons.plus_one:before { content: "\e800" } .material-icons.poll:before { content: "\e801" } .material-icons.polymer:before { content: "\e8ab" } .material-icons.pool:before { content: "\eb48" } .material-icons.portable_wifi_off:before { content: "\e0ce" } .material-icons.portrait:before { content: "\e416" } .material-icons.power:before { content: "\e63c" } .material-icons.power_input:before { content: "\e336" } .material-icons.power_settings_new:before { content: "\e8ac" } .material-icons.pregnant_woman:before { content: "\e91e" } .material-icons.present_to_all:before { content: "\e0df" } .material-icons.print:before { content: "\e8ad" } .material-icons.priority_high:before { content: "\e645" } .material-icons.public:before { content: "\e80b" } .material-icons.publish:before { content: "\e255" } .material-icons.query_builder:before { content: "\e8ae" } .material-icons.question_answer:before { content: "\e8af" } .material-icons.queue:before { content: "\e03c" } .material-icons.queue_music:before { content: "\e03d" } .material-icons.queue_play_next:before { content: "\e066" } .material-icons.radio:before { content: "\e03e" } .material-icons.radio_button_checked:before { content: "\e837" } .material-icons.radio_button_unchecked:before { content: "\e836" } .material-icons.rate_review:before { content: "\e560" } .material-icons.receipt:before { content: "\e8b0" } .material-icons.recent_actors:before { content: "\e03f" } .material-icons.record_voice_over:before { content: "\e91f" } .material-icons.redeem:before { content: "\e8b1" } .material-icons.redo:before { content: "\e15a" } .material-icons.refresh:before { content: "\e5d5" } .material-icons.remove:before { content: "\e15b" } .material-icons.remove_circle:before { content: "\e15c" } .material-icons.remove_circle_outline:before { content: "\e15d" } .material-icons.remove_from_queue:before { content: "\e067" } .material-icons.remove_red_eye:before { content: "\e417" } .material-icons.remove_shopping_cart:before { content: "\e928" } .material-icons.reorder:before { content: "\e8fe" } .material-icons.repeat:before { content: "\e040" } .material-icons.repeat_one:before { content: "\e041" } .material-icons.replay:before { content: "\e042" } .material-icons.replay_10:before { content: "\e059" } .material-icons.replay_30:before { content: "\e05a" } .material-icons.replay_5:before { content: "\e05b" } .material-icons.reply:before { content: "\e15e" } .material-icons.reply_all:before { content: "\e15f" } .material-icons.report:before { content: "\e160" } .material-icons.report_problem:before { content: "\e8b2" } .material-icons.restaurant:before { content: "\e56c" } .material-icons.restaurant_menu:before { content: "\e561" } .material-icons.restore:before { content: "\e8b3" } .material-icons.restore_page:before { content: "\e929" } .material-icons.ring_volume:before { content: "\e0d1" } .material-icons.room:before { content: "\e8b4" } .material-icons.room_service:before { content: "\eb49" } .material-icons.rotate_90_degrees_ccw:before { content: "\e418" } .material-icons.rotate_left:before { content: "\e419" } .material-icons.rotate_right:before { content: "\e41a" } .material-icons.rounded_corner:before { content: "\e920" } .material-icons.router:before { content: "\e328" } .material-icons.rowing:before { content: "\e921" } .material-icons.rss_feed:before { content: "\e0e5" } .material-icons.rv_hookup:before { content: "\e642" } .material-icons.satellite:before { content: "\e562" } .material-icons.save:before { content: "\e161" } .material-icons.scanner:before { content: "\e329" } .material-icons.schedule:before { content: "\e8b5" } .material-icons.school:before { content: "\e80c" } .material-icons.screen_lock_landscape:before { content: "\e1be" } .material-icons.screen_lock_portrait:before { content: "\e1bf" } .material-icons.screen_lock_rotation:before { content: "\e1c0" } .material-icons.screen_rotation:before { content: "\e1c1" } .material-icons.screen_share:before { content: "\e0e2" } .material-icons.sd_card:before { content: "\e623" } .material-icons.sd_storage:before { content: "\e1c2" } .material-icons.search:before { content: "\e8b6" } .material-icons.security:before { content: "\e32a" } .material-icons.select_all:before { content: "\e162" } .material-icons.send:before { content: "\e163" } .material-icons.sentiment_dissatisfied:before { content: "\e811" } .material-icons.sentiment_neutral:before { content: "\e812" } .material-icons.sentiment_satisfied:before { content: "\e813" } .material-icons.sentiment_very_dissatisfied:before { content: "\e814" } .material-icons.sentiment_very_satisfied:before { content: "\e815" } .material-icons.settings:before { content: "\e8b8" } .material-icons.settings_applications:before { content: "\e8b9" } .material-icons.settings_backup_restore:before { content: "\e8ba" } .material-icons.settings_bluetooth:before { content: "\e8bb" } .material-icons.settings_brightness:before { content: "\e8bd" } .material-icons.settings_cell:before { content: "\e8bc" } .material-icons.settings_ethernet:before { content: "\e8be" } .material-icons.settings_input_antenna:before { content: "\e8bf" } .material-icons.settings_input_component:before { content: "\e8c0" } .material-icons.settings_input_composite:before { content: "\e8c1" } .material-icons.settings_input_hdmi:before { content: "\e8c2" } .material-icons.settings_input_svideo:before { content: "\e8c3" } .material-icons.settings_overscan:before { content: "\e8c4" } .material-icons.settings_phone:before { content: "\e8c5" } .material-icons.settings_power:before { content: "\e8c6" } .material-icons.settings_remote:before { content: "\e8c7" } .material-icons.settings_system_daydream:before { content: "\e1c3" } .material-icons.settings_voice:before { content: "\e8c8" } .material-icons.share:before { content: "\e80d" } .material-icons.shop:before { content: "\e8c9" } .material-icons.shop_two:before { content: "\e8ca" } .material-icons.shopping_basket:before { content: "\e8cb" } .material-icons.shopping_cart:before { content: "\e8cc" } .material-icons.short_text:before { content: "\e261" } .material-icons.show_chart:before { content: "\e6e1" } .material-icons.shuffle:before { content: "\e043" } .material-icons.signal_cellular_4_bar:before { content: "\e1c8" } .material-icons.signal_cellular_connected_no_internet_4_bar:before { content: "\e1cd" } .material-icons.signal_cellular_no_sim:before { content: "\e1ce" } .material-icons.signal_cellular_null:before { content: "\e1cf" } .material-icons.signal_cellular_off:before { content: "\e1d0" } .material-icons.signal_wifi_4_bar:before { content: "\e1d8" } .material-icons.signal_wifi_4_bar_lock:before { content: "\e1d9" } .material-icons.signal_wifi_off:before { content: "\e1da" } .material-icons.sim_card:before { content: "\e32b" } .material-icons.sim_card_alert:before { content: "\e624" } .material-icons.skip_next:before { content: "\e044" } .material-icons.skip_previous:before { content: "\e045" } .material-icons.slideshow:before { content: "\e41b" } .material-icons.slow_motion_video:before { content: "\e068" } .material-icons.smartphone:before { content: "\e32c" } .material-icons.smoke_free:before { content: "\eb4a" } .material-icons.smoking_rooms:before { content: "\eb4b" } .material-icons.sms:before { content: "\e625" } .material-icons.sms_failed:before { content: "\e626" } .material-icons.snooze:before { content: "\e046" } .material-icons.sort:before { content: "\e164" } .material-icons.sort_by_alpha:before { content: "\e053" } .material-icons.spa:before { content: "\eb4c" } .material-icons.space_bar:before { content: "\e256" } .material-icons.speaker:before { content: "\e32d" } .material-icons.speaker_group:before { content: "\e32e" } .material-icons.speaker_notes:before { content: "\e8cd" } .material-icons.speaker_notes_off:before { content: "\e92a" } .material-icons.speaker_phone:before { content: "\e0d2" } .material-icons.spellcheck:before { content: "\e8ce" } .material-icons.star:before { content: "\e838" } .material-icons.star_border:before { content: "\e83a" } .material-icons.star_half:before { content: "\e839" } .material-icons.stars:before { content: "\e8d0" } .material-icons.stay_current_landscape:before { content: "\e0d3" } .material-icons.stay_current_portrait:before { content: "\e0d4" } .material-icons.stay_primary_landscape:before { content: "\e0d5" } .material-icons.stay_primary_portrait:before { content: "\e0d6" } .material-icons.stop:before { content: "\e047" } .material-icons.stop_screen_share:before { content: "\e0e3" } .material-icons.storage:before { content: "\e1db" } .material-icons.store:before { content: "\e8d1" } .material-icons.store_mall_directory:before { content: "\e563" } .material-icons.straighten:before { content: "\e41c" } .material-icons.streetview:before { content: "\e56e" } .material-icons.strikethrough_s:before { content: "\e257" } .material-icons.style:before { content: "\e41d" } .material-icons.subdirectory_arrow_left:before { content: "\e5d9" } .material-icons.subdirectory_arrow_right:before { content: "\e5da" } .material-icons.subject:before { content: "\e8d2" } .material-icons.subscriptions:before { content: "\e064" } .material-icons.subtitles:before { content: "\e048" } .material-icons.subway:before { content: "\e56f" } .material-icons.supervisor_account:before { content: "\e8d3" } .material-icons.surround_sound:before { content: "\e049" } .material-icons.swap_calls:before { content: "\e0d7" } .material-icons.swap_horiz:before { content: "\e8d4" } .material-icons.swap_vert:before { content: "\e8d5" } .material-icons.swap_vertical_circle:before { content: "\e8d6" } .material-icons.switch_camera:before { content: "\e41e" } .material-icons.switch_video:before { content: "\e41f" } .material-icons.sync:before { content: "\e627" } .material-icons.sync_disabled:before { content: "\e628" } .material-icons.sync_problem:before { content: "\e629" } .material-icons.system_update:before { content: "\e62a" } .material-icons.system_update_alt:before { content: "\e8d7" } .material-icons.tab:before { content: "\e8d8" } .material-icons.tab_unselected:before { content: "\e8d9" } .material-icons.tablet:before { content: "\e32f" } .material-icons.tablet_android:before { content: "\e330" } .material-icons.tablet_mac:before { content: "\e331" } .material-icons.tag_faces:before { content: "\e420" } .material-icons.tap_and_play:before { content: "\e62b" } .material-icons.terrain:before { content: "\e564" } .material-icons.text_fields:before { content: "\e262" } .material-icons.text_format:before { content: "\e165" } .material-icons.textsms:before { content: "\e0d8" } .material-icons.texture:before { content: "\e421" } .material-icons.theaters:before { content: "\e8da" } .material-icons.thumb_down:before { content: "\e8db" } .material-icons.thumb_up:before { content: "\e8dc" } .material-icons.thumbs_up_down:before { content: "\e8dd" } .material-icons.time_to_leave:before { content: "\e62c" } .material-icons.timelapse:before { content: "\e422" } .material-icons.timeline:before { content: "\e922" } .material-icons.timer:before { content: "\e425" } .material-icons.timer_10:before { content: "\e423" } .material-icons.timer_3:before { content: "\e424" } .material-icons.timer_off:before { content: "\e426" } .material-icons.title:before { content: "\e264" } .material-icons.toc:before { content: "\e8de" } .material-icons.today:before { content: "\e8df" } .material-icons.toll:before { content: "\e8e0" } .material-icons.tonality:before { content: "\e427" } .material-icons.touch_app:before { content: "\e913" } .material-icons.toys:before { content: "\e332" } .material-icons.track_changes:before { content: "\e8e1" } .material-icons.traffic:before { content: "\e565" } .material-icons.train:before { content: "\e570" } .material-icons.tram:before { content: "\e571" } .material-icons.transfer_within_a_station:before { content: "\e572" } .material-icons.transform:before { content: "\e428" } .material-icons.translate:before { content: "\e8e2" } .material-icons.trending_down:before { content: "\e8e3" } .material-icons.trending_flat:before { content: "\e8e4" } .material-icons.trending_up:before { content: "\e8e5" } .material-icons.tune:before { content: "\e429" } .material-icons.turned_in:before { content: "\e8e6" } .material-icons.turned_in_not:before { content: "\e8e7" } .material-icons.tv:before { content: "\e333" } .material-icons.unarchive:before { content: "\e169" } .material-icons.undo:before { content: "\e166" } .material-icons.unfold_less:before { content: "\e5d6" } .material-icons.unfold_more:before { content: "\e5d7" } .material-icons.update:before { content: "\e923" } .material-icons.usb:before { content: "\e1e0" } .material-icons.verified_user:before { content: "\e8e8" } .material-icons.vertical_align_bottom:before { content: "\e258" } .material-icons.vertical_align_center:before { content: "\e259" } .material-icons.vertical_align_top:before { content: "\e25a" } .material-icons.vibration:before { content: "\e62d" } .material-icons.video_call:before { content: "\e070" } .material-icons.video_label:before { content: "\e071" } .material-icons.video_library:before { content: "\e04a" } .material-icons.videocam:before { content: "\e04b" } .material-icons.videocam_off:before { content: "\e04c" } .material-icons.videogame_asset:before { content: "\e338" } .material-icons.view_agenda:before { content: "\e8e9" } .material-icons.view_array:before { content: "\e8ea" } .material-icons.view_carousel:before { content: "\e8eb" } .material-icons.view_column:before { content: "\e8ec" } .material-icons.view_comfy:before { content: "\e42a" } .material-icons.view_compact:before { content: "\e42b" } .material-icons.view_day:before { content: "\e8ed" } .material-icons.view_headline:before { content: "\e8ee" } .material-icons.view_list:before { content: "\e8ef" } .material-icons.view_module:before { content: "\e8f0" } .material-icons.view_quilt:before { content: "\e8f1" } .material-icons.view_stream:before { content: "\e8f2" } .material-icons.view_week:before { content: "\e8f3" } .material-icons.vignette:before { content: "\e435" } .material-icons.visibility:before { content: "\e8f4" } .material-icons.visibility_off:before { content: "\e8f5" } .material-icons.voice_chat:before { content: "\e62e" } .material-icons.voicemail:before { content: "\e0d9" } .material-icons.volume_down:before { content: "\e04d" } .material-icons.volume_mute:before { content: "\e04e" } .material-icons.volume_off:before { content: "\e04f" } .material-icons.volume_up:before { content: "\e050" } .material-icons.vpn_key:before { content: "\e0da" } .material-icons.vpn_lock:before { content: "\e62f" } .material-icons.wallpaper:before { content: "\e1bc" } .material-icons.warning:before { content: "\e002" } .material-icons.watch:before { content: "\e334" } .material-icons.watch_later:before { content: "\e924" } .material-icons.wb_auto:before { content: "\e42c" } .material-icons.wb_cloudy:before { content: "\e42d" } .material-icons.wb_incandescent:before { content: "\e42e" } .material-icons.wb_iridescent:before { content: "\e436" } .material-icons.wb_sunny:before { content: "\e430" } .material-icons.wc:before { content: "\e63d" } .material-icons.web:before { content: "\e051" } .material-icons.web_asset:before { content: "\e069" } .material-icons.weekend:before { content: "\e16b" } .material-icons.whatshot:before { content: "\e80e" } .material-icons.widgets:before { content: "\e1bd" } .material-icons.wifi:before { content: "\e63e" } .material-icons.wifi_lock:before { content: "\e1e1" } .material-icons.wifi_tethering:before { content: "\e1e2" } .material-icons.work:before { content: "\e8f9" } .material-icons.wrap_text:before { content: "\e25b" } .material-icons.youtube_searched_for:before { content: "\e8fa" } .material-icons.zoom_in:before { content: "\e8ff" } .material-icons.zoom_out:before { content: "\e900" } .material-icons.zoom_out_map:before { content: "\e56b" }
{ "pile_set_name": "Github" }
[ { "package":"memdb", "type":"Metric", "nil":"nil", "value":"tStoreINTF" } ]
{ "pile_set_name": "Github" }
// Copyright 2016 The etcd 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 grpcproxy is an OSI level 7 proxy for etcd v3 API requests. package grpcproxy
{ "pile_set_name": "Github" }
/* * This file is part of Player Analytics (Plan). * * Plan is free software: you can redistribute it and/or modify * it under the terms of the GNU Lesser General Public License v3 as published by * the Free Software Foundation, either version 3 of the License, or * (at your option) any later version. * * Plan 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 Plan. If not, see <https://www.gnu.org/licenses/>. */ package com.djrapitops.plan.delivery.webserver; import com.djrapitops.plan.PlanSystem; import com.djrapitops.plan.delivery.domain.auth.User; import com.djrapitops.plan.settings.config.PlanConfig; import com.djrapitops.plan.settings.config.changes.ConfigUpdater; import com.djrapitops.plan.settings.config.paths.WebserverSettings; import com.djrapitops.plan.storage.database.transactions.commands.RegisterWebUserTransaction; import com.djrapitops.plan.utilities.PassEncryptUtil; import org.junit.jupiter.api.AfterAll; import org.junit.jupiter.api.BeforeAll; import org.junit.jupiter.api.io.TempDir; import utilities.RandomData; import utilities.TestResources; import utilities.mocks.PluginMockComponent; import java.io.File; import java.nio.file.Files; import java.nio.file.Path; import java.nio.file.StandardCopyOption; import java.util.Collections; class Pkcs12HttpsServerTest implements HttpsServerTest { private static final int TEST_PORT_NUMBER = RandomData.randomInt(9005, 9500); private static PlanSystem system; @BeforeAll static void setUpClass(@TempDir Path tempDir) throws Exception { File file = tempDir.resolve("TestCert.p12").toFile(); File testCert = TestResources.getTestResourceFile("TestCert.p12", ConfigUpdater.class); Files.copy(testCert.toPath(), file.toPath(), StandardCopyOption.REPLACE_EXISTING); String absolutePath = file.getAbsolutePath(); PluginMockComponent component = new PluginMockComponent(tempDir); system = component.getPlanSystem(); PlanConfig config = system.getConfigSystem().getConfig(); config.set(WebserverSettings.CERTIFICATE_PATH, absolutePath); config.set(WebserverSettings.CERTIFICATE_KEYPASS, "test"); config.set(WebserverSettings.CERTIFICATE_STOREPASS, "test"); config.set(WebserverSettings.CERTIFICATE_ALIAS, "test"); config.set(WebserverSettings.PORT, TEST_PORT_NUMBER); system.enable(); User user = new User("test", "console", null, PassEncryptUtil.createHash("testPass"), 0, Collections.emptyList()); system.getDatabaseSystem().getDatabase().executeTransaction(new RegisterWebUserTransaction(user)); } @AfterAll static void tearDownClass() { if (system != null) { system.disable(); } } @Override public WebServer getWebServer() { return system.getWebServerSystem().getWebServer(); } @Override public int testPortNumber() { return TEST_PORT_NUMBER; } }
{ "pile_set_name": "Github" }
/* Copyright (c) 2003-2017, CKSource - Frederico Knabben. All rights reserved. For licensing, see LICENSE.md or http://ckeditor.com/license */ CKEDITOR.plugins.setLang( 'about', 'et', { copy: 'Copyright &copy; $1. Kõik õigused kaitstud.', dlgTitle: 'CKEditorist', help: 'Abi jaoks vaata $1.', moreInfo: 'Litsentsi andmed leiab meie veebilehelt:', title: 'CKEditorist', userGuide: 'CKEditori kasutusjuhendit' } );
{ "pile_set_name": "Github" }
/* Copyright (c) 2012, The Linux Foundation. All rights reserved. * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License version 2 and * only version 2 as published by the Free Software Foundation. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * */ /* * RMNET SMUX Module. */ #include <linux/module.h> #include <linux/kernel.h> #include <linux/string.h> #include <linux/delay.h> #include <linux/errno.h> #include <linux/interrupt.h> #include <linux/init.h> #include <linux/netdevice.h> #include <linux/etherdevice.h> #include <linux/skbuff.h> #include <linux/wakelock.h> #include <linux/if_arp.h> #include <linux/msm_rmnet.h> #include <linux/platform_device.h> #include <linux/smux.h> #include <linux/ip.h> #ifdef CONFIG_HAS_EARLYSUSPEND #include <linux/earlysuspend.h> #endif /* Debug message support */ static int msm_rmnet_smux_debug_mask; module_param_named(debug_enable, msm_rmnet_smux_debug_mask, int, S_IRUGO | S_IWUSR | S_IWGRP); #define DEBUG_MASK_LVL0 (1U << 0) #define DEBUG_MASK_LVL1 (1U << 1) #define DEBUG_MASK_LVL2 (1U << 2) #define DBG(m, x...) do { \ if (msm_rmnet_smux_debug_mask & m) \ pr_info(x); \ } while (0) #define DBG0(x...) DBG(DEBUG_MASK_LVL0, x) #define DBG1(x...) DBG(DEBUG_MASK_LVL1, x) #define DBG2(x...) DBG(DEBUG_MASK_LVL2, x) /* Configure device instances */ #define RMNET_SMUX_DEVICE_COUNT (2) /* allow larger frames */ #define RMNET_DATA_LEN 2000 #define DEVICE_ID_INVALID -1 #define DEVICE_INACTIVE 0x00 #define DEVICE_ACTIVE 0x01 #define HEADROOM_FOR_SMUX 8 /* for mux header */ #define HEADROOM_FOR_QOS 8 #define TAILROOM 8 /* for padding by mux layer */ struct rmnet_private { struct net_device_stats stats; uint32_t ch_id; #ifdef CONFIG_MSM_RMNET_DEBUG ktime_t last_packet; unsigned long wakeups_xmit; unsigned long wakeups_rcv; unsigned long timeout_us; #endif spinlock_t lock; spinlock_t tx_queue_lock; struct tasklet_struct tsklt; /* IOCTL specified mode (protocol, QoS header) */ u32 operation_mode; uint8_t device_state; uint8_t in_reset; }; static struct net_device *netdevs[RMNET_SMUX_DEVICE_COUNT]; #ifdef CONFIG_MSM_RMNET_DEBUG static unsigned long timeout_us; #ifdef CONFIG_HAS_EARLYSUSPEND /* * If early suspend is enabled then we specify two timeout values, * screen on (default), and screen is off. */ static unsigned long timeout_suspend_us; static struct device *rmnet0; /* Set timeout in us when the screen is off. */ static ssize_t timeout_suspend_store(struct device *d, struct device_attribute *attr, const char *buf, size_t n) { timeout_suspend_us = strict_strtoul(buf, NULL, 10); return n; } static ssize_t timeout_suspend_show(struct device *d, struct device_attribute *attr, char *buf) { return snprintf(buf, PAGE_SIZE, "%lu\n", (unsigned long) timeout_suspend_us); } static DEVICE_ATTR(timeout_suspend, 0664, timeout_suspend_show, timeout_suspend_store); static void rmnet_early_suspend(struct early_suspend *handler) { if (rmnet0) { struct rmnet_private *p = netdev_priv(to_net_dev(rmnet0)); p->timeout_us = timeout_suspend_us; } } static void rmnet_late_resume(struct early_suspend *handler) { if (rmnet0) { struct rmnet_private *p = netdev_priv(to_net_dev(rmnet0)); p->timeout_us = timeout_us; } } static struct early_suspend rmnet_power_suspend = { .suspend = rmnet_early_suspend, .resume = rmnet_late_resume, }; static int __init rmnet_late_init(void) { register_early_suspend(&rmnet_power_suspend); return 0; } late_initcall(rmnet_late_init); #endif /* CONFIG_HAS_EARLYSUSPEND */ /* Returns 1 if packet caused rmnet to wakeup, 0 otherwise. */ static int rmnet_cause_wakeup(struct rmnet_private *p) { int ret = 0; ktime_t now; if (p->timeout_us == 0) /* Check if disabled */ return 0; /* Use real (wall) time. */ now = ktime_get_real(); if (ktime_us_delta(now, p->last_packet) > p->timeout_us) ret = 1; p->last_packet = now; return ret; } static ssize_t wakeups_xmit_show(struct device *d, struct device_attribute *attr, char *buf) { struct rmnet_private *p = netdev_priv(to_net_dev(d)); return snprintf(buf, PAGE_SIZE, "%lu\n", p->wakeups_xmit); } DEVICE_ATTR(wakeups_xmit, 0444, wakeups_xmit_show, NULL); static ssize_t wakeups_rcv_show(struct device *d, struct device_attribute *attr, char *buf) { struct rmnet_private *p = netdev_priv(to_net_dev(d)); return snprintf(buf, PAGE_SIZE, "%lu\n", p->wakeups_rcv); } DEVICE_ATTR(wakeups_rcv, 0444, wakeups_rcv_show, NULL); /* Set timeout in us. */ static ssize_t timeout_store(struct device *d, struct device_attribute *attr, const char *buf, size_t n) { #ifndef CONFIG_HAS_EARLYSUSPEND struct rmnet_private *p = netdev_priv(to_net_dev(d)); p->timeout_us = timeout_us = strict_strtoul(buf, NULL, 10); #else /* If using early suspend/resume hooks do not write the value on store. */ timeout_us = strict_strtoul(buf, NULL, 10); #endif /* CONFIG_HAS_EARLYSUSPEND */ return n; } static ssize_t timeout_show(struct device *d, struct device_attribute *attr, char *buf) { struct rmnet_private *p = netdev_priv(to_net_dev(d)); p = netdev_priv(to_net_dev(d)); return snprintf(buf, PAGE_SIZE, "%lu\n", timeout_us); } DEVICE_ATTR(timeout, 0664, timeout_show, timeout_store); #endif /* CONFIG_MSM_RMNET_DEBUG */ /* Forward declaration */ static int rmnet_ioctl(struct net_device *dev, struct ifreq *ifr, int cmd); static int count_this_packet(void *_hdr, int len) { struct ethhdr *hdr = _hdr; if (len >= ETH_HLEN && hdr->h_proto == htons(ETH_P_ARP)) return 0; return 1; } static __be16 rmnet_ip_type_trans(struct sk_buff *skb, struct net_device *dev) { __be16 protocol = 0; skb->dev = dev; /* Determine L3 protocol */ switch (skb->data[0] & 0xf0) { case 0x40: protocol = htons(ETH_P_IP); break; case 0x60: protocol = htons(ETH_P_IPV6); break; default: pr_err("[%s] rmnet_recv() L3 protocol decode error: 0x%02x", dev->name, skb->data[0] & 0xf0); /* skb will be dropped in upper layer for unknown protocol */ } return protocol; } static void smux_read_done(void *rcv_dev, const void *meta_data) { struct rmnet_private *p; struct net_device *dev = rcv_dev; u32 opmode; unsigned long flags; struct sk_buff *skb = NULL; const struct smux_meta_read *read_meta_info = meta_data; if (!dev || !read_meta_info) { DBG1("%s:invalid read_done callback recieved", __func__); return; } p = netdev_priv(dev); skb = (struct sk_buff *) read_meta_info->pkt_priv; if (!skb || skb->dev != dev) { DBG1("%s: ERR:skb pointer NULL in READ_DONE CALLBACK", __func__); return; } /* Handle Rx frame format */ spin_lock_irqsave(&p->lock, flags); opmode = p->operation_mode; spin_unlock_irqrestore(&p->lock, flags); if (RMNET_IS_MODE_IP(opmode)) { /* Driver in IP mode */ skb->protocol = rmnet_ip_type_trans(skb, dev); } else { /* Driver in Ethernet mode */ skb->protocol = eth_type_trans(skb, dev); } if (RMNET_IS_MODE_IP(opmode) || count_this_packet(skb->data, skb->len)) { #ifdef CONFIG_MSM_RMNET_DEBUG p->wakeups_rcv += rmnet_cause_wakeup(p); #endif p->stats.rx_packets++; p->stats.rx_bytes += skb->len; } DBG2("[%s] Rx packet #%lu len=%d\n", dev->name, p->stats.rx_packets, skb->len); /* Deliver to network stack */ netif_rx(skb); return; } static void smux_write_done(void *dev, const void *meta_data) { struct rmnet_private *p = netdev_priv(dev); u32 opmode; struct sk_buff *skb = NULL; const struct smux_meta_write *write_meta_info = meta_data; unsigned long flags; if (!dev || !write_meta_info) { DBG1("%s: ERR:invalid WRITE_DONE callback recieved", __func__); return; } skb = (struct sk_buff *) write_meta_info->pkt_priv; if (!skb) { DBG1("%s: ERR:skb pointer NULL in WRITE_DONE" " CALLBACK", __func__); return; } spin_lock_irqsave(&p->lock, flags); opmode = p->operation_mode; spin_unlock_irqrestore(&p->lock, flags); DBG1("%s: write complete\n", __func__); if (RMNET_IS_MODE_IP(opmode) || count_this_packet(skb->data, skb->len)) { p->stats.tx_packets++; p->stats.tx_bytes += skb->len; #ifdef CONFIG_MSM_RMNET_DEBUG p->wakeups_xmit += rmnet_cause_wakeup(p); #endif } DBG1("[%s] Tx packet #%lu len=%d mark=0x%x\n", ((struct net_device *)(dev))->name, p->stats.tx_packets, skb->len, skb->mark); dev_kfree_skb_any(skb); spin_lock_irqsave(&p->tx_queue_lock, flags); if (netif_queue_stopped(dev) && msm_smux_is_ch_low(p->ch_id)) { DBG0("%s: Low WM hit, waking queue=%p\n", __func__, skb); netif_wake_queue(dev); } spin_unlock_irqrestore(&p->tx_queue_lock, flags); } void rmnet_smux_notify(void *priv, int event_type, const void *metadata) { struct rmnet_private *p; struct net_device *dev; unsigned long flags; struct sk_buff *skb = NULL; u32 opmode; const struct smux_meta_disconnected *ssr_info; const struct smux_meta_read *read_meta_info; const struct smux_meta_write *write_meta_info = metadata; if (!priv) DBG0("%s: priv(cookie) NULL, ignoring notification:" " %d\n", __func__, event_type); switch (event_type) { case SMUX_CONNECTED: p = netdev_priv(priv); dev = priv; DBG0("[%s] SMUX_CONNECTED event dev:%s\n", __func__, dev->name); netif_carrier_on(dev); netif_start_queue(dev); spin_lock_irqsave(&p->lock, flags); p->device_state = DEVICE_ACTIVE; spin_unlock_irqrestore(&p->lock, flags); break; case SMUX_DISCONNECTED: p = netdev_priv(priv); dev = priv; ssr_info = metadata; DBG0("[%s] SMUX_DISCONNECTED event dev:%s\n", __func__, dev->name); if (ssr_info && ssr_info->is_ssr == 1) DBG0("SSR detected on :%s\n", dev->name); netif_carrier_off(dev); netif_stop_queue(dev); spin_lock_irqsave(&p->lock, flags); p->device_state = DEVICE_INACTIVE; spin_unlock_irqrestore(&p->lock, flags); break; case SMUX_READ_DONE: smux_read_done(priv, metadata); break; case SMUX_READ_FAIL: p = netdev_priv(priv); dev = priv; read_meta_info = metadata; if (!dev || !read_meta_info) { DBG1("%s: ERR:invalid read failed callback" " recieved", __func__); return; } skb = (struct sk_buff *) read_meta_info->pkt_priv; if (!skb) { DBG1("%s: ERR:skb pointer NULL in read fail" " CALLBACK", __func__); return; } DBG0("%s: read failed\n", __func__); opmode = p->operation_mode; if (RMNET_IS_MODE_IP(opmode) || count_this_packet(skb->data, skb->len)) p->stats.rx_dropped++; dev_kfree_skb_any(skb); break; case SMUX_WRITE_DONE: smux_write_done(priv, metadata); break; case SMUX_WRITE_FAIL: p = netdev_priv(priv); dev = priv; write_meta_info = metadata; if (!dev || !write_meta_info) { DBG1("%s: ERR:invalid WRITE_DONE" "callback recieved", __func__); return; } skb = (struct sk_buff *) write_meta_info->pkt_priv; if (!skb) { DBG1("%s: ERR:skb pointer NULL in" " WRITE_DONE CALLBACK", __func__); return; } DBG0("%s: write failed\n", __func__); opmode = p->operation_mode; if (RMNET_IS_MODE_IP(opmode) || count_this_packet(skb->data, skb->len)) { p->stats.tx_dropped++; } dev_kfree_skb_any(skb); break; case SMUX_LOW_WM_HIT: dev = priv; p = netdev_priv(priv); DBG0("[%s] Low WM hit dev:%s\n", __func__, dev->name); spin_lock_irqsave(&p->tx_queue_lock, flags); netif_wake_queue(dev); spin_unlock_irqrestore(&p->tx_queue_lock, flags); break; case SMUX_HIGH_WM_HIT: dev = priv; p = netdev_priv(priv); DBG0("[%s] High WM hit dev:%s\n", __func__, dev->name); spin_lock_irqsave(&p->tx_queue_lock, flags); netif_stop_queue(dev); spin_unlock_irqrestore(&p->tx_queue_lock, flags); break; default: dev = priv; DBG0("[%s] Invalid event:%d received on" " dev: %s\n", __func__, event_type, dev->name); break; } return; } int get_rx_buffers(void *priv, void **pkt_priv, void **buffer, int size) { struct net_device *dev = (struct net_device *) priv; struct sk_buff *skb = NULL; void *ptr = NULL; DBG0("[%s] dev:%s\n", __func__, dev->name); skb = __dev_alloc_skb(size, GFP_ATOMIC); if (skb == NULL) { DBG0("%s: unable to alloc skb\n", __func__); return -ENOMEM; } /* TODO skb_reserve(skb, NET_IP_ALIGN); for ethernet mode */ /* Populate some params now. */ skb->dev = dev; ptr = skb_put(skb, size); skb_set_network_header(skb, 0); /* done with skb setup, return the buffer pointer. */ *pkt_priv = skb; *buffer = ptr; return 0; } static int __rmnet_open(struct net_device *dev) { struct rmnet_private *p = netdev_priv(dev); DBG0("[%s] __rmnet_open()\n", dev->name); if (p->device_state == DEVICE_ACTIVE) { return 0; } else { DBG0("[%s] Platform inactive\n", dev->name); return -ENODEV; } } static int rmnet_open(struct net_device *dev) { int rc = 0; DBG0("[%s] rmnet_open()\n", dev->name); rc = __rmnet_open(dev); if (rc == 0) netif_start_queue(dev); return rc; } static int rmnet_stop(struct net_device *dev) { DBG0("[%s] rmnet_stop()\n", dev->name); netif_stop_queue(dev); return 0; } static int rmnet_change_mtu(struct net_device *dev, int new_mtu) { if (0 > new_mtu || RMNET_DATA_LEN < new_mtu) return -EINVAL; DBG0("[%s] MTU change: old=%d new=%d\n", dev->name, dev->mtu, new_mtu); dev->mtu = new_mtu; return 0; } static int _rmnet_xmit(struct sk_buff *skb, struct net_device *dev) { struct rmnet_private *p = netdev_priv(dev); struct QMI_QOS_HDR_S *qmih; u32 opmode; unsigned long flags; /* For QoS mode, prepend QMI header and assign flow ID from skb->mark */ spin_lock_irqsave(&p->lock, flags); opmode = p->operation_mode; spin_unlock_irqrestore(&p->lock, flags); if (RMNET_IS_MODE_QOS(opmode)) { qmih = (struct QMI_QOS_HDR_S *) skb_push(skb, sizeof(struct QMI_QOS_HDR_S)); qmih->version = 1; qmih->flags = 0; qmih->flow_id = skb->mark; } dev->trans_start = jiffies; return msm_smux_write(p->ch_id, skb, skb->data, skb->len); } static int rmnet_xmit(struct sk_buff *skb, struct net_device *dev) { struct rmnet_private *p = netdev_priv(dev); unsigned long flags; int ret = 0; if (netif_queue_stopped(dev) || (p->device_state == DEVICE_INACTIVE)) { pr_err("[%s]fatal: rmnet_xmit called when " "netif_queue is stopped", dev->name); return 0; } spin_lock_irqsave(&p->tx_queue_lock, flags); ret = _rmnet_xmit(skb, dev); if (ret == -EAGAIN) { /* * EAGAIN means we attempted to overflow the high watermark * Clearly the queue is not stopped like it should be, so * stop it and return BUSY to the TCP/IP framework. It will * retry this packet with the queue is restarted which happens * low watermark is called. */ netif_stop_queue(dev); ret = NETDEV_TX_BUSY; } spin_unlock_irqrestore(&p->tx_queue_lock, flags); return ret; } static struct net_device_stats *rmnet_get_stats(struct net_device *dev) { struct rmnet_private *p = netdev_priv(dev); return &p->stats; } static void rmnet_tx_timeout(struct net_device *dev) { pr_warning("[%s] rmnet_tx_timeout()\n", dev->name); } static const struct net_device_ops rmnet_ops_ether = { .ndo_open = rmnet_open, .ndo_stop = rmnet_stop, .ndo_start_xmit = rmnet_xmit, .ndo_get_stats = rmnet_get_stats, .ndo_tx_timeout = rmnet_tx_timeout, .ndo_do_ioctl = rmnet_ioctl, .ndo_change_mtu = rmnet_change_mtu, .ndo_set_mac_address = eth_mac_addr, .ndo_validate_addr = eth_validate_addr, }; static const struct net_device_ops rmnet_ops_ip = { .ndo_open = rmnet_open, .ndo_stop = rmnet_stop, .ndo_start_xmit = rmnet_xmit, .ndo_get_stats = rmnet_get_stats, .ndo_tx_timeout = rmnet_tx_timeout, .ndo_do_ioctl = rmnet_ioctl, .ndo_change_mtu = rmnet_change_mtu, .ndo_set_mac_address = 0, .ndo_validate_addr = 0, }; static int rmnet_ioctl(struct net_device *dev, struct ifreq *ifr, int cmd) { struct rmnet_private *p = netdev_priv(dev); u32 old_opmode = p->operation_mode; unsigned long flags; int prev_mtu = dev->mtu; int rc = 0; /* Process IOCTL command */ switch (cmd) { case RMNET_IOCTL_SET_LLP_ETHERNET: /* Set Ethernet protocol */ /* Perform Ethernet config only if in IP mode currently*/ if (p->operation_mode & RMNET_MODE_LLP_IP) { ether_setup(dev); random_ether_addr(dev->dev_addr); dev->mtu = prev_mtu; dev->netdev_ops = &rmnet_ops_ether; spin_lock_irqsave(&p->lock, flags); p->operation_mode &= ~RMNET_MODE_LLP_IP; p->operation_mode |= RMNET_MODE_LLP_ETH; spin_unlock_irqrestore(&p->lock, flags); DBG0("[%s] rmnet_ioctl(): " "set Ethernet protocol mode\n", dev->name); } break; case RMNET_IOCTL_SET_LLP_IP: /* Set RAWIP protocol */ /* Perform IP config only if in Ethernet mode currently*/ if (p->operation_mode & RMNET_MODE_LLP_ETH) { /* Undo config done in ether_setup() */ dev->header_ops = 0; /* No header */ dev->type = ARPHRD_RAWIP; dev->hard_header_len = 0; dev->mtu = prev_mtu; dev->addr_len = 0; dev->flags &= ~(IFF_BROADCAST | IFF_MULTICAST); dev->needed_headroom = HEADROOM_FOR_SMUX + HEADROOM_FOR_QOS; dev->needed_tailroom = TAILROOM; dev->netdev_ops = &rmnet_ops_ip; spin_lock_irqsave(&p->lock, flags); p->operation_mode &= ~RMNET_MODE_LLP_ETH; p->operation_mode |= RMNET_MODE_LLP_IP; spin_unlock_irqrestore(&p->lock, flags); DBG0("[%s] rmnet_ioctl(): " "set IP protocol mode\n", dev->name); } break; case RMNET_IOCTL_GET_LLP: /* Get link protocol state */ ifr->ifr_ifru.ifru_data = (void *)(p->operation_mode & (RMNET_MODE_LLP_ETH|RMNET_MODE_LLP_IP)); break; case RMNET_IOCTL_SET_QOS_ENABLE: /* Set QoS header enabled */ spin_lock_irqsave(&p->lock, flags); p->operation_mode |= RMNET_MODE_QOS; spin_unlock_irqrestore(&p->lock, flags); DBG0("[%s] rmnet_ioctl(): set QMI QOS header enable\n", dev->name); break; case RMNET_IOCTL_SET_QOS_DISABLE: /* Set QoS header disabled */ spin_lock_irqsave(&p->lock, flags); p->operation_mode &= ~RMNET_MODE_QOS; spin_unlock_irqrestore(&p->lock, flags); DBG0("[%s] rmnet_ioctl(): set QMI QOS header disable\n", dev->name); break; case RMNET_IOCTL_GET_QOS: /* Get QoS header state */ ifr->ifr_ifru.ifru_data = (void *)(p->operation_mode & RMNET_MODE_QOS); break; case RMNET_IOCTL_GET_OPMODE: /* Get operation mode */ ifr->ifr_ifru.ifru_data = (void *)p->operation_mode; break; case RMNET_IOCTL_OPEN: /* Open transport port */ rc = __rmnet_open(dev); DBG0("[%s] rmnet_ioctl(): open transport port\n", dev->name); break; case RMNET_IOCTL_CLOSE: /* Close transport port */ DBG0("[%s] rmnet_ioctl(): close transport port\n", dev->name); break; default: DBG0("[%s] error: rmnet_ioct called for unsupported cmd[%d]", dev->name, cmd); return -EINVAL; } DBG2("[%s] %s: cmd=0x%x opmode old=0x%08x new=0x%08x\n", dev->name, __func__, cmd, old_opmode, p->operation_mode); return rc; } static void __init rmnet_setup(struct net_device *dev) { /* Using Ethernet mode by default */ dev->netdev_ops = &rmnet_ops_ether; ether_setup(dev); /* set this after calling ether_setup */ dev->mtu = RMNET_DATA_LEN; dev->needed_headroom = HEADROOM_FOR_SMUX + HEADROOM_FOR_QOS ; dev->needed_tailroom = TAILROOM; random_ether_addr(dev->dev_addr); dev->watchdog_timeo = 1000; /* 10 seconds? */ } static int smux_rmnet_probe(struct platform_device *pdev) { int i; int r; struct rmnet_private *p; for (i = 0; i < RMNET_SMUX_DEVICE_COUNT; i++) { p = netdev_priv(netdevs[i]); if (p != NULL) { r = msm_smux_open(p->ch_id, netdevs[i], rmnet_smux_notify, get_rx_buffers); if (r < 0) { DBG0("%s: ch=%d open failed with rc %d\n", __func__, p->ch_id, r); } } } return 0; } static int smux_rmnet_remove(struct platform_device *pdev) { int i; int r; struct rmnet_private *p; for (i = 0; i < RMNET_SMUX_DEVICE_COUNT; i++) { p = netdev_priv(netdevs[i]); if (p != NULL) { r = msm_smux_close(p->ch_id); if (r < 0) { DBG0("%s: ch=%d close failed with rc %d\n", __func__, p->ch_id, r); continue; } netif_carrier_off(netdevs[i]); netif_stop_queue(netdevs[i]); } } return 0; } static struct platform_driver smux_rmnet_driver = { .probe = smux_rmnet_probe, .remove = smux_rmnet_remove, .driver = { .name = "SMUX_RMNET", .owner = THIS_MODULE, }, }; static int __init rmnet_init(void) { int ret; struct device *d; struct net_device *dev; struct rmnet_private *p; unsigned n; #ifdef CONFIG_MSM_RMNET_DEBUG timeout_us = 0; #ifdef CONFIG_HAS_EARLYSUSPEND timeout_suspend_us = 0; #endif /* CONFIG_HAS_EARLYSUSPEND */ #endif /* CONFIG_MSM_RMNET_DEBUG */ for (n = 0; n < RMNET_SMUX_DEVICE_COUNT; n++) { dev = alloc_netdev(sizeof(struct rmnet_private), "rmnet_smux%d", rmnet_setup); if (!dev) { pr_err("%s: no memory for netdev %d\n", __func__, n); return -ENOMEM; } netdevs[n] = dev; d = &(dev->dev); p = netdev_priv(dev); /* Initial config uses Ethernet */ p->operation_mode = RMNET_MODE_LLP_ETH; p->ch_id = n; p->in_reset = 0; spin_lock_init(&p->lock); spin_lock_init(&p->tx_queue_lock); #ifdef CONFIG_MSM_RMNET_DEBUG p->timeout_us = timeout_us; p->wakeups_xmit = p->wakeups_rcv = 0; #endif ret = register_netdev(dev); if (ret) { pr_err("%s: unable to register netdev" " %d rc=%d\n", __func__, n, ret); free_netdev(dev); return ret; } #ifdef CONFIG_MSM_RMNET_DEBUG if (device_create_file(d, &dev_attr_timeout)) continue; if (device_create_file(d, &dev_attr_wakeups_xmit)) continue; if (device_create_file(d, &dev_attr_wakeups_rcv)) continue; #ifdef CONFIG_HAS_EARLYSUSPEND if (device_create_file(d, &dev_attr_timeout_suspend)) continue; /* Only care about rmnet0 for suspend/resume tiemout hooks. */ if (n == 0) rmnet0 = d; #endif /* CONFIG_HAS_EARLYSUSPEND */ #endif /* CONFIG_MSM_RMNET_DEBUG */ } ret = platform_driver_register(&smux_rmnet_driver); if (ret) { pr_err("%s: registration failed n=%d rc=%d\n", __func__, n, ret); return ret; } return 0; } module_init(rmnet_init); MODULE_DESCRIPTION("MSM RMNET SMUX TRANSPORT"); MODULE_LICENSE("GPL v2");
{ "pile_set_name": "Github" }
"""External interface to the BeautifulSoup HTML parser. """ __all__ = ["fromstring", "parse", "convert_tree"] import re from lxml import etree, html try: from bs4 import ( BeautifulSoup, Tag, Comment, ProcessingInstruction, NavigableString, Declaration, Doctype) _DECLARATION_OR_DOCTYPE = (Declaration, Doctype) except ImportError: from BeautifulSoup import ( BeautifulSoup, Tag, Comment, ProcessingInstruction, NavigableString, Declaration) _DECLARATION_OR_DOCTYPE = Declaration def fromstring(data, beautifulsoup=None, makeelement=None, **bsargs): """Parse a string of HTML data into an Element tree using the BeautifulSoup parser. Returns the root ``<html>`` Element of the tree. You can pass a different BeautifulSoup parser through the `beautifulsoup` keyword, and a diffent Element factory function through the `makeelement` keyword. By default, the standard ``BeautifulSoup`` class and the default factory of `lxml.html` are used. """ return _parse(data, beautifulsoup, makeelement, **bsargs) def parse(file, beautifulsoup=None, makeelement=None, **bsargs): """Parse a file into an ElemenTree using the BeautifulSoup parser. You can pass a different BeautifulSoup parser through the `beautifulsoup` keyword, and a diffent Element factory function through the `makeelement` keyword. By default, the standard ``BeautifulSoup`` class and the default factory of `lxml.html` are used. """ if not hasattr(file, 'read'): file = open(file) root = _parse(file, beautifulsoup, makeelement, **bsargs) return etree.ElementTree(root) def convert_tree(beautiful_soup_tree, makeelement=None): """Convert a BeautifulSoup tree to a list of Element trees. Returns a list instead of a single root Element to support HTML-like soup with more than one root element. You can pass a different Element factory through the `makeelement` keyword. """ root = _convert_tree(beautiful_soup_tree, makeelement) children = root.getchildren() for child in children: root.remove(child) return children # helpers def _parse(source, beautifulsoup, makeelement, **bsargs): if beautifulsoup is None: beautifulsoup = BeautifulSoup if hasattr(beautifulsoup, "HTML_ENTITIES"): # bs3 if 'convertEntities' not in bsargs: bsargs['convertEntities'] = 'html' if hasattr(beautifulsoup, "DEFAULT_BUILDER_FEATURES"): # bs4 if 'features' not in bsargs: bsargs['features'] = 'html.parser' # use Python html parser tree = beautifulsoup(source, **bsargs) root = _convert_tree(tree, makeelement) # from ET: wrap the document in a html root element, if necessary if len(root) == 1 and root[0].tag == "html": return root[0] root.tag = "html" return root _parse_doctype_declaration = re.compile( r'(?:\s|[<!])*DOCTYPE\s*HTML' r'(?:\s+PUBLIC)?(?:\s+(\'[^\']*\'|"[^"]*"))?' r'(?:\s+(\'[^\']*\'|"[^"]*"))?', re.IGNORECASE).match class _PseudoTag: # Minimal imitation of BeautifulSoup.Tag def __init__(self, contents): self.name = 'html' self.attrs = [] self.contents = contents def __iter__(self): return self.contents.__iter__() def _convert_tree(beautiful_soup_tree, makeelement): if makeelement is None: makeelement = html.html_parser.makeelement # Split the tree into three parts: # i) everything before the root element: document type # declaration, comments, processing instructions, whitespace # ii) the root(s), # iii) everything after the root: comments, processing # instructions, whitespace first_element_idx = last_element_idx = None html_root = declaration = None for i, e in enumerate(beautiful_soup_tree): if isinstance(e, Tag): if first_element_idx is None: first_element_idx = i last_element_idx = i if html_root is None and e.name and e.name.lower() == 'html': html_root = e elif declaration is None and isinstance(e, _DECLARATION_OR_DOCTYPE): declaration = e # For a nice, well-formatted document, the variable roots below is # a list consisting of a single <html> element. However, the document # may be a soup like '<meta><head><title>Hello</head><body>Hi # all<\p>'. In this example roots is a list containing meta, head # and body elements. if first_element_idx is None: pre_root = post_root = [] roots = beautiful_soup_tree.contents else: pre_root = beautiful_soup_tree.contents[:first_element_idx] roots = beautiful_soup_tree.contents[first_element_idx:last_element_idx+1] post_root = beautiful_soup_tree.contents[last_element_idx+1:] # Reorganize so that there is one <html> root... if html_root is not None: # ... use existing one if possible, ... i = roots.index(html_root) html_root.contents = roots[:i] + html_root.contents + roots[i+1:] else: # ... otherwise create a new one. html_root = _PseudoTag(roots) convert_node = _init_node_converters(makeelement) # Process pre_root res_root = convert_node(html_root) prev = res_root for e in reversed(pre_root): converted = convert_node(e) if converted is not None: prev.addprevious(converted) prev = converted # ditto for post_root prev = res_root for e in post_root: converted = convert_node(e) if converted is not None: prev.addnext(converted) prev = converted if declaration is not None: try: # bs4 provides full Doctype string doctype_string = declaration.output_ready() except AttributeError: doctype_string = declaration.string match = _parse_doctype_declaration(doctype_string) if not match: # Something is wrong if we end up in here. Since soupparser should # tolerate errors, do not raise Exception, just let it pass. pass else: external_id, sys_uri = match.groups() docinfo = res_root.getroottree().docinfo # strip quotes and update DOCTYPE values (any of None, '', '...') docinfo.public_id = external_id and external_id[1:-1] docinfo.system_url = sys_uri and sys_uri[1:-1] return res_root def _init_node_converters(makeelement): converters = {} ordered_node_types = [] def converter(*types): def add(handler): for t in types: converters[t] = handler ordered_node_types.append(t) return handler return add def find_best_converter(node): for t in ordered_node_types: if isinstance(node, t): return converters[t] return None def convert_node(bs_node, parent=None): # duplicated in convert_tag() below try: handler = converters[type(bs_node)] except KeyError: handler = converters[type(bs_node)] = find_best_converter(bs_node) if handler is None: return None return handler(bs_node, parent) def map_attrs(bs_attrs): if isinstance(bs_attrs, dict): # bs4 attribs = {} for k, v in bs_attrs.items(): if isinstance(v, list): v = " ".join(v) attribs[k] = unescape(v) else: attribs = dict((k, unescape(v)) for k, v in bs_attrs) return attribs def append_text(parent, text): if len(parent) == 0: parent.text = (parent.text or '') + text else: parent[-1].tail = (parent[-1].tail or '') + text # converters are tried in order of their definition @converter(Tag, _PseudoTag) def convert_tag(bs_node, parent): attrs = bs_node.attrs if parent is not None: attribs = map_attrs(attrs) if attrs else None res = etree.SubElement(parent, bs_node.name, attrib=attribs) else: attribs = map_attrs(attrs) if attrs else {} res = makeelement(bs_node.name, attrib=attribs) for child in bs_node: # avoid double recursion by inlining convert_node(), see above try: handler = converters[type(child)] except KeyError: pass else: if handler is not None: handler(child, res) continue convert_node(child, res) return res @converter(Comment) def convert_comment(bs_node, parent): res = html.HtmlComment(bs_node) if parent is not None: parent.append(res) return res @converter(ProcessingInstruction) def convert_pi(bs_node, parent): if bs_node.endswith('?'): # The PI is of XML style (<?as df?>) but BeautifulSoup # interpreted it as being SGML style (<?as df>). Fix. bs_node = bs_node[:-1] res = etree.ProcessingInstruction(*bs_node.split(' ', 1)) if parent is not None: parent.append(res) return res @converter(NavigableString) def convert_text(bs_node, parent): if parent is not None: append_text(parent, unescape(bs_node)) return None return convert_node # copied from ET's ElementSoup try: from html.entities import name2codepoint # Python 3 except ImportError: from htmlentitydefs import name2codepoint handle_entities = re.compile(r"&(\w+);").sub try: unichr except NameError: # Python 3 unichr = chr def unescape(string): if not string: return '' # work around oddities in BeautifulSoup's entity handling def unescape_entity(m): try: return unichr(name2codepoint[m.group(1)]) except KeyError: return m.group(0) # use as is return handle_entities(unescape_entity, string)
{ "pile_set_name": "Github" }
{ "cells": [ { "cell_type": "markdown", "metadata": {}, "source": [ "## Training Amazon SageMaker models by using the Deep Graph Library with PyTorch backend\n", "The **Amazon SageMaker Python SDK** makes it easy to train Deep Graph Library (DGL) models. In this example, you train a simple graph neural network using the [DMLC DGL API](https://github.com/dmlc/dgl.git) and the [Cora dataset](https://relational.fit.cvut.cz/dataset/CORA). The Cora dataset describes a citation network. The Cora dataset consists of 2,708 scientific publications classified into one of seven classes. The citation network consists of 5,429 links. The task is to train a node classification model using Cora dataset. " ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "### Setup\n", "Define a few variables that are needed later in the example." ] }, { "cell_type": "code", "execution_count": null, "metadata": {}, "outputs": [], "source": [ "import sagemaker\n", "from sagemaker import get_execution_role\n", "from sagemaker.session import Session\n", "\n", "# Setup session\n", "sess = sagemaker.Session()\n", "\n", "# S3 bucket for saving code and model artifacts.\n", "# Feel free to specify a different bucket here.\n", "bucket = sess.default_bucket()\n", "\n", "# Location to put your custom code.\n", "custom_code_upload_location = 'customcode'\n", "\n", "# IAM execution role that gives Amazon SageMaker access to resources in your AWS account.\n", "# You can use the Amazon SageMaker Python SDK to get the role from the notebook environment. \n", "role = get_execution_role()" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "### The training script\n", "The pytorch_gcn.py script provides all the code you need for training an Amazon SageMaker model. " ] }, { "cell_type": "code", "execution_count": null, "metadata": {}, "outputs": [], "source": [ "!cat pytorch_gcn.py" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "### SageMaker's estimator class\n", "The Amazon SageMaker Estimator allows you to run single machine in Amazon SageMaker, using CPU or GPU-based instances.\n", "\n", "When you create the estimator, pass in the filename of the training script and the name of the IAM execution role. You can also provide a few other parameters. train_instance_count and train_instance_type determine the number and type of Amazon SageMaker instances that are used for the training job. The hyperparameters parameter is a dictionary of values that is passed to your training script as parameters so that you can use argparse to parse them. You can see how to access these values in the pytorch_gcn.py script above.\n", "\n", "Here, you can directly use the DL Container provided by Amazon SageMaker for training DGL models by specifying the PyTorch framework version (>= 1.3.1) and the python version (only py3). You can also add a task_tag with value 'DGL' to help tracking the task.\n", "\n", "For this example, choose one ml.p3.2xlarge instance. You can also use a CPU instance such as ml.c4.2xlarge for the CPU image." ] }, { "cell_type": "code", "execution_count": null, "metadata": {}, "outputs": [], "source": [ "from sagemaker.pytorch import PyTorch\n", "\n", "CODE_PATH = 'pytorch_gcn.py'\n", "account = sess.boto_session.client('sts').get_caller_identity()['Account']\n", "region = sess.boto_session.region_name\n", "\n", "params = {}\n", "params['dataset'] = 'cora'\n", "task_tags = [{'Key':'ML Task', 'Value':'DGL'}]\n", "estimator = PyTorch(entry_point=CODE_PATH,\n", " role=role,\n", " train_instance_count=1,\n", " train_instance_type='ml.p3.2xlarge', # 'ml.c4.2xlarge '\n", " framework_version=\"1.3.1\",\n", " py_version='py3',\n", " debugger_hook_config=False,\n", " tags=task_tags,\n", " hyperparameters=params,\n", " sagemaker_session=sess)" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "### Running the Training Job\n", "After you construct the Estimator object, fit it by using Amazon SageMaker. The dataset is automatically downloaded." ] }, { "cell_type": "code", "execution_count": null, "metadata": {}, "outputs": [], "source": [ "estimator.fit()" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "## Output\n", "You can get the model training output from the Amazon Sagemaker console by searching for the training task named pytorch-gcn and looking for the address of 'S3 model artifact'" ] } ], "metadata": { "kernelspec": { "display_name": "conda_pytorch_p36", "language": "python", "name": "conda_pytorch_p36" }, "language_info": { "codemirror_mode": { "name": "ipython", "version": 3 }, "file_extension": ".py", "mimetype": "text/x-python", "name": "python", "nbconvert_exporter": "python", "pygments_lexer": "ipython3", "version": "3.6.5" } }, "nbformat": 4, "nbformat_minor": 2 }
{ "pile_set_name": "Github" }
<?php /** * 2018_01_01_000003_create_oauth_refresh_tokens_table.php * Copyright (c) 2019 [email protected]. * * This file is part of Firefly III (https://github.com/firefly-iii). * * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU Affero General Public License as * published by the Free Software Foundation, either version 3 of the * License, or (at your option) any later version. * * 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 Affero General Public License for more details. * * You should have received a copy of the GNU Affero General Public License * along with this program. If not, see <https://www.gnu.org/licenses/>. */ declare(strict_types=1); use Illuminate\Database\Migrations\Migration; use Illuminate\Database\Schema\Blueprint; use Illuminate\Support\Facades\Schema; /** * Class CreateOauthRefreshTokensTable. */ class CreateOauthRefreshTokensTable extends Migration { /** * Reverse the migrations. */ public function down(): void { Schema::drop('oauth_refresh_tokens'); } /** * Run the migrations. * @SuppressWarnings(PHPMD.ShortMethodName) */ public function up(): void { Schema::create( 'oauth_refresh_tokens', static function (Blueprint $table) { $table->string('id', 100)->primary(); $table->string('access_token_id', 100)->index(); $table->boolean('revoked'); $table->dateTime('expires_at')->nullable(); } ); } }
{ "pile_set_name": "Github" }
/* * Copyright 2011 OverZealous Creations, 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. */ package com.overzealous.remark.convert; import org.jsoup.nodes.Element; import java.util.regex.Pattern; /** * Handles anchor (a) tags, both links and named anchors. * @author Phil DeJarnett */ public class Anchor extends AbstractNodeHandler { private static final Pattern INLINE_LINK_ESCAPE = Pattern.compile("([\\(\\)])"); private static final String INLINE_LINK_REPLACEMENT = "\\\\$1"; /** * Creates a link reference, and renders the correct output. * * If this happens to be a named anchor, then it is simply removed from output. * * @param parent The previous node walker, in case we just want to remove an element. * @param node Node to handle * @param converter Parent converter for this object. */ public void handleNode(NodeHandler parent, Element node, DocumentConverter converter) { if(node.hasAttr("href") && node.attr("href").trim().length() > 0) { // Must be a real link. String url = converter.cleaner.cleanUrl(node.attr("href")); String label = converter.getInlineContent(this, node); if(label.length() > 0) { if(converter.options.autoLinks && url.equals(label)) { // embed autolink converter.output.write(label); } else if(converter.options.inlineLinks) { // standard link if(converter.options.fixPegdownStrongEmphasisInLinks) { label = label.replace("***", "**"); } converter.output.printf("[%s](%s)", label, url); } else { // standard link if(converter.options.fixPegdownStrongEmphasisInLinks) { label = label.replace("***", "**"); } String linkId = converter.addLink(url, label, false); if(label.equals(linkId)) { converter.output.printf("[%s][]", label); } else { converter.output.printf("[%s][%s]", label, linkId); } } } // else, ignore links with no label } else { // named anchor, not a link // simply remove it from the flow. converter.walkNodes(parent, node); } } }
{ "pile_set_name": "Github" }
<?xml version="1.0" encoding="UTF-8"?> <project version="4"> <component name="ChangeListManager"> <list default="true" id="9d36bfd7-a2ff-41e0-b583-70ee3c8098bc" name="Default" comment="" /> <ignored path="NonViewUtils.iws" /> <ignored path=".idea/workspace.xml" /> <option name="TRACKING_ENABLED" value="true" /> <option name="SHOW_DIALOG" value="false" /> <option name="HIGHLIGHT_CONFLICTS" value="true" /> <option name="HIGHLIGHT_NON_ACTIVE_CHANGELIST" value="false" /> <option name="LAST_RESOLUTION" value="IGNORE" /> </component> <component name="ChangesViewManager" flattened_view="true" show_ignored="false" /> <component name="CreatePatchCommitExecutor"> <option name="PATCH_PATH" value="" /> </component> <component name="DaemonCodeAnalyzer"> <disable_hints /> </component> <component name="ExecutionTargetManager" SELECTED_TARGET="default_target" /> <component name="FavoritesManager"> <favorites_list name="NonViewUtils" /> </component> <component name="FileEditorManager"> <leaf> <file leaf-file-name="main1.iml" pinned="false" current="false" current-in-tab="false"> <entry file="file://$PROJECT_DIR$/NonViewUtils/utilslib/src/main/main1.iml"> <provider selected="true" editor-type-id="text-editor"> <state vertical-scroll-proportion="0.0" vertical-offset="0" max-vertical-offset="648"> <caret line="5" column="12" selection-start-line="5" selection-start-column="12" selection-end-line="5" selection-end-column="12" /> <folding /> </state> </provider> </entry> </file> <file leaf-file-name=".gitignore" pinned="false" current="false" current-in-tab="false"> <entry file="file://$PROJECT_DIR$/.gitignore"> <provider selected="true" editor-type-id="text-editor"> <state vertical-scroll-proportion="-8.12" vertical-offset="337" max-vertical-offset="891"> <caret line="20" column="16" selection-start-line="20" selection-start-column="16" selection-end-line="20" selection-end-column="16" /> <folding /> </state> </provider> </entry> </file> <file leaf-file-name="IntentUtil.java" pinned="false" current="false" current-in-tab="false"> <entry file="file://$PROJECT_DIR$/NonViewUtils/utilslib/src/main/java/org/android/share/utils/IntentUtil.java"> <provider selected="true" editor-type-id="text-editor"> <state vertical-scroll-proportion="0.0" vertical-offset="160" max-vertical-offset="702"> <caret line="14" column="14" selection-start-line="14" selection-start-column="14" selection-end-line="14" selection-end-column="14" /> <folding /> </state> </provider> </entry> </file> <file leaf-file-name="GetPhotoUtil.java" pinned="false" current="true" current-in-tab="true"> <entry file="file://$PROJECT_DIR$/NonViewUtils/utilslib/src/main/java/org/android/share/utils/photo/GetPhotoUtil.java"> <provider selected="true" editor-type-id="text-editor"> <state vertical-scroll-proportion="0.35727787" vertical-offset="0" max-vertical-offset="6345"> <caret line="21" column="18" selection-start-line="21" selection-start-column="18" selection-end-line="21" selection-end-column="18" /> <folding /> </state> </provider> </entry> </file> </leaf> </component> <component name="FindManager"> <FindUsagesManager> <setting name="OPEN_NEW_TAB" value="true" /> </FindUsagesManager> </component> <component name="IdeDocumentHistory"> <option name="changedFiles"> <list> <option value="$PROJECT_DIR$/NonViewUtils/utilslib/src/main/java/org/android/share/utils/IntentUtil.java" /> </list> </option> </component> <component name="ProjectFrameBounds"> <option name="x" value="10" /> <option name="width" value="1346" /> <option name="height" value="728" /> </component> <component name="ProjectLevelVcsManager" settingsEditedManually="false"> <OptionsSetting value="true" id="Add" /> <OptionsSetting value="true" id="Remove" /> <OptionsSetting value="true" id="Checkout" /> <OptionsSetting value="true" id="Update" /> <OptionsSetting value="true" id="Status" /> <OptionsSetting value="true" id="Edit" /> <ConfirmationsSetting value="0" id="Add" /> <ConfirmationsSetting value="0" id="Remove" /> </component> <component name="ProjectReloadState"> <option name="STATE" value="0" /> </component> <component name="ProjectView"> <navigator currentView="ProjectPane" proportions="" version="1"> <flattenPackages /> <showMembers /> <showModules /> <showLibraryContents /> <hideEmptyPackages /> <abbreviatePackageNames /> <autoscrollToSource /> <autoscrollFromSource /> <sortByType /> </navigator> <panes> <pane id="ProjectPane"> <subPane> <PATH> <PATH_ELEMENT> <option name="myItemId" value="NonViewUtils" /> <option name="myItemType" value="com.intellij.ide.projectView.impl.nodes.ProjectViewProjectNode" /> </PATH_ELEMENT> <PATH_ELEMENT> <option name="myItemId" value="External Libraries" /> <option name="myItemType" value="com.intellij.ide.projectView.impl.nodes.ExternalLibrariesNode" /> </PATH_ELEMENT> </PATH> <PATH> <PATH_ELEMENT> <option name="myItemId" value="NonViewUtils" /> <option name="myItemType" value="com.intellij.ide.projectView.impl.nodes.ProjectViewProjectNode" /> </PATH_ELEMENT> </PATH> <PATH> <PATH_ELEMENT> <option name="myItemId" value="NonViewUtils" /> <option name="myItemType" value="com.intellij.ide.projectView.impl.nodes.ProjectViewProjectNode" /> </PATH_ELEMENT> <PATH_ELEMENT> <option name="myItemId" value="main" /> <option name="myItemType" value="com.intellij.ide.projectView.impl.nodes.PsiDirectoryNode" /> </PATH_ELEMENT> </PATH> <PATH> <PATH_ELEMENT> <option name="myItemId" value="NonViewUtils" /> <option name="myItemType" value="com.intellij.ide.projectView.impl.nodes.ProjectViewProjectNode" /> </PATH_ELEMENT> <PATH_ELEMENT> <option name="myItemId" value="main" /> <option name="myItemType" value="com.intellij.ide.projectView.impl.nodes.PsiDirectoryNode" /> </PATH_ELEMENT> <PATH_ELEMENT> <option name="myItemId" value="java" /> <option name="myItemType" value="com.intellij.ide.projectView.impl.nodes.PsiDirectoryNode" /> </PATH_ELEMENT> <PATH_ELEMENT> <option name="myItemId" value="utils" /> <option name="myItemType" value="com.intellij.ide.projectView.impl.nodes.PsiDirectoryNode" /> </PATH_ELEMENT> </PATH> <PATH> <PATH_ELEMENT> <option name="myItemId" value="NonViewUtils" /> <option name="myItemType" value="com.intellij.ide.projectView.impl.nodes.ProjectViewProjectNode" /> </PATH_ELEMENT> <PATH_ELEMENT> <option name="myItemId" value="main" /> <option name="myItemType" value="com.intellij.ide.projectView.impl.nodes.PsiDirectoryNode" /> </PATH_ELEMENT> <PATH_ELEMENT> <option name="myItemId" value="java" /> <option name="myItemType" value="com.intellij.ide.projectView.impl.nodes.PsiDirectoryNode" /> </PATH_ELEMENT> <PATH_ELEMENT> <option name="myItemId" value="utils" /> <option name="myItemType" value="com.intellij.ide.projectView.impl.nodes.PsiDirectoryNode" /> </PATH_ELEMENT> <PATH_ELEMENT> <option name="myItemId" value="photo" /> <option name="myItemType" value="com.intellij.ide.projectView.impl.nodes.PsiDirectoryNode" /> </PATH_ELEMENT> </PATH> <PATH> <PATH_ELEMENT> <option name="myItemId" value="NonViewUtils" /> <option name="myItemType" value="com.intellij.ide.projectView.impl.nodes.ProjectViewProjectNode" /> </PATH_ELEMENT> <PATH_ELEMENT> <option name="myItemId" value="main" /> <option name="myItemType" value="com.intellij.ide.projectView.impl.nodes.PsiDirectoryNode" /> </PATH_ELEMENT> <PATH_ELEMENT> <option name="myItemId" value="java" /> <option name="myItemType" value="com.intellij.ide.projectView.impl.nodes.PsiDirectoryNode" /> </PATH_ELEMENT> <PATH_ELEMENT> <option name="myItemId" value="utils" /> <option name="myItemType" value="com.intellij.ide.projectView.impl.nodes.PsiDirectoryNode" /> </PATH_ELEMENT> <PATH_ELEMENT> <option name="myItemId" value="contacts" /> <option name="myItemType" value="com.intellij.ide.projectView.impl.nodes.PsiDirectoryNode" /> </PATH_ELEMENT> </PATH> <PATH> <PATH_ELEMENT> <option name="myItemId" value="NonViewUtils" /> <option name="myItemType" value="com.intellij.ide.projectView.impl.nodes.ProjectViewProjectNode" /> </PATH_ELEMENT> <PATH_ELEMENT> <option name="myItemId" value="main" /> <option name="myItemType" value="com.intellij.ide.projectView.impl.nodes.PsiDirectoryNode" /> </PATH_ELEMENT> <PATH_ELEMENT> <option name="myItemId" value="java" /> <option name="myItemType" value="com.intellij.ide.projectView.impl.nodes.PsiDirectoryNode" /> </PATH_ELEMENT> <PATH_ELEMENT> <option name="myItemId" value="utils" /> <option name="myItemType" value="com.intellij.ide.projectView.impl.nodes.PsiDirectoryNode" /> </PATH_ELEMENT> <PATH_ELEMENT> <option name="myItemId" value="activity" /> <option name="myItemType" value="com.intellij.ide.projectView.impl.nodes.PsiDirectoryNode" /> </PATH_ELEMENT> </PATH> <PATH> <PATH_ELEMENT> <option name="myItemId" value="NonViewUtils" /> <option name="myItemType" value="com.intellij.ide.projectView.impl.nodes.ProjectViewProjectNode" /> </PATH_ELEMENT> <PATH_ELEMENT> <option name="myItemId" value="androidTest" /> <option name="myItemType" value="com.intellij.ide.projectView.impl.nodes.PsiDirectoryNode" /> </PATH_ELEMENT> </PATH> <PATH> <PATH_ELEMENT> <option name="myItemId" value="NonViewUtils" /> <option name="myItemType" value="com.intellij.ide.projectView.impl.nodes.ProjectViewProjectNode" /> </PATH_ELEMENT> <PATH_ELEMENT> <option name="myItemId" value="androidTest" /> <option name="myItemType" value="com.intellij.ide.projectView.impl.nodes.PsiDirectoryNode" /> </PATH_ELEMENT> </PATH> </subPane> </pane> <pane id="PackagesPane"> <subPane> <PATH> <PATH_ELEMENT> <option name="myItemId" value="NonViewUtils" /> <option name="myItemType" value="com.intellij.ide.projectView.impl.nodes.PackageViewProjectNode" /> </PATH_ELEMENT> </PATH> </subPane> </pane> <pane id="Scope" /> <pane id="AndroidView"> <subPane> <PATH> <PATH_ELEMENT> <option name="myItemId" value="NonViewUtils" /> <option name="myItemType" value="com.android.tools.idea.navigator.nodes.AndroidViewProjectNode" /> </PATH_ELEMENT> </PATH> </subPane> </pane> </panes> </component> <component name="PropertiesComponent"> <property name="GoToClass.includeLibraries" value="false" /> <property name="GoToClass.toSaveIncludeLibraries" value="false" /> <property name="GoToFile.includeJavaFiles" value="false" /> <property name="MemberChooser.sorted" value="false" /> <property name="MemberChooser.showClasses" value="true" /> <property name="MemberChooser.copyJavadoc" value="false" /> <property name="options.lastSelected" value="project.propVCSSupport.Mappings" /> <property name="options.splitter.main.proportions" value="0.3" /> <property name="options.splitter.details.proportions" value="0.2" /> <property name="options.searchVisible" value="true" /> <property name="android.project.structure.last.selected" value="SDK Location" /> <property name="android.project.structure.proportion" value="0.15" /> <property name="recentsLimit" value="5" /> </component> <component name="RunManager" selected="Android Application.main"> <configuration default="true" type="AndroidTestRunConfigurationType" factoryName="Android Tests"> <module name="" /> <option name="TESTING_TYPE" value="0" /> <option name="INSTRUMENTATION_RUNNER_CLASS" value="" /> <option name="METHOD_NAME" value="" /> <option name="CLASS_NAME" value="" /> <option name="PACKAGE_NAME" value="" /> <option name="TARGET_SELECTION_MODE" value="EMULATOR" /> <option name="USE_LAST_SELECTED_DEVICE" value="false" /> <option name="PREFERRED_AVD" value="" /> <option name="USE_COMMAND_LINE" value="true" /> <option name="COMMAND_LINE" value="" /> <option name="WIPE_USER_DATA" value="false" /> <option name="DISABLE_BOOT_ANIMATION" value="false" /> <option name="NETWORK_SPEED" value="full" /> <option name="NETWORK_LATENCY" value="none" /> <option name="CLEAR_LOGCAT" value="false" /> <option name="SHOW_LOGCAT_AUTOMATICALLY" value="true" /> <option name="FILTER_LOGCAT_AUTOMATICALLY" value="true" /> <method /> </configuration> <configuration default="true" type="Remote" factoryName="Remote"> <option name="USE_SOCKET_TRANSPORT" value="true" /> <option name="SERVER_MODE" value="false" /> <option name="SHMEM_ADDRESS" value="javadebug" /> <option name="HOST" value="localhost" /> <option name="PORT" value="5005" /> <method /> </configuration> <configuration default="true" type="TestNG" factoryName="TestNG"> <module name="" /> <option name="ALTERNATIVE_JRE_PATH_ENABLED" value="false" /> <option name="ALTERNATIVE_JRE_PATH" /> <option name="SUITE_NAME" /> <option name="PACKAGE_NAME" /> <option name="MAIN_CLASS_NAME" /> <option name="METHOD_NAME" /> <option name="GROUP_NAME" /> <option name="TEST_OBJECT" value="CLASS" /> <option name="VM_PARAMETERS" value="-ea" /> <option name="PARAMETERS" /> <option name="WORKING_DIRECTORY" value="$PROJECT_DIR$" /> <option name="OUTPUT_DIRECTORY" /> <option name="ANNOTATION_TYPE" /> <option name="ENV_VARIABLES" /> <option name="PASS_PARENT_ENVS" value="true" /> <option name="TEST_SEARCH_SCOPE"> <value defaultName="moduleWithDependencies" /> </option> <option name="USE_DEFAULT_REPORTERS" value="false" /> <option name="PROPERTIES_FILE" /> <envs /> <properties /> <listeners /> <method /> </configuration> <configuration default="true" type="Application" factoryName="Application"> <option name="MAIN_CLASS_NAME" /> <option name="VM_PARAMETERS" /> <option name="PROGRAM_PARAMETERS" /> <option name="WORKING_DIRECTORY" value="$PROJECT_DIR$" /> <option name="ALTERNATIVE_JRE_PATH_ENABLED" value="false" /> <option name="ALTERNATIVE_JRE_PATH" /> <option name="ENABLE_SWING_INSPECTOR" value="false" /> <option name="ENV_VARIABLES" /> <option name="PASS_PARENT_ENVS" value="true" /> <module name="" /> <envs /> <method /> </configuration> <configuration default="true" type="JUnit" factoryName="JUnit"> <module name="" /> <option name="ALTERNATIVE_JRE_PATH_ENABLED" value="false" /> <option name="ALTERNATIVE_JRE_PATH" /> <option name="PACKAGE_NAME" /> <option name="MAIN_CLASS_NAME" /> <option name="METHOD_NAME" /> <option name="TEST_OBJECT" value="class" /> <option name="VM_PARAMETERS" value="-ea" /> <option name="PARAMETERS" /> <option name="WORKING_DIRECTORY" value="$PROJECT_DIR$" /> <option name="ENV_VARIABLES" /> <option name="PASS_PARENT_ENVS" value="true" /> <option name="TEST_SEARCH_SCOPE"> <value defaultName="moduleWithDependencies" /> </option> <envs /> <patterns /> <method /> </configuration> <configuration default="true" type="AndroidRunConfigurationType" factoryName="Android Application"> <module name="" /> <option name="ACTIVITY_CLASS" value="" /> <option name="MODE" value="default_activity" /> <option name="DEPLOY" value="true" /> <option name="ARTIFACT_NAME" value="" /> <option name="TARGET_SELECTION_MODE" value="EMULATOR" /> <option name="USE_LAST_SELECTED_DEVICE" value="false" /> <option name="PREFERRED_AVD" value="" /> <option name="USE_COMMAND_LINE" value="true" /> <option name="COMMAND_LINE" value="" /> <option name="WIPE_USER_DATA" value="false" /> <option name="DISABLE_BOOT_ANIMATION" value="false" /> <option name="NETWORK_SPEED" value="full" /> <option name="NETWORK_LATENCY" value="none" /> <option name="CLEAR_LOGCAT" value="false" /> <option name="SHOW_LOGCAT_AUTOMATICALLY" value="true" /> <option name="FILTER_LOGCAT_AUTOMATICALLY" value="true" /> <method /> </configuration> <configuration default="false" name="main" type="AndroidRunConfigurationType" factoryName="Android Application"> <module name="main" /> <option name="ACTIVITY_CLASS" value="" /> <option name="MODE" value="default_activity" /> <option name="DEPLOY" value="true" /> <option name="ARTIFACT_NAME" value="" /> <option name="TARGET_SELECTION_MODE" value="EMULATOR" /> <option name="USE_LAST_SELECTED_DEVICE" value="false" /> <option name="PREFERRED_AVD" value="" /> <option name="USE_COMMAND_LINE" value="true" /> <option name="COMMAND_LINE" value="" /> <option name="WIPE_USER_DATA" value="false" /> <option name="DISABLE_BOOT_ANIMATION" value="false" /> <option name="NETWORK_SPEED" value="full" /> <option name="NETWORK_LATENCY" value="none" /> <option name="CLEAR_LOGCAT" value="false" /> <option name="SHOW_LOGCAT_AUTOMATICALLY" value="true" /> <option name="FILTER_LOGCAT_AUTOMATICALLY" value="true" /> <method /> </configuration> <list size="1"> <item index="0" class="java.lang.String" itemvalue="Android Application.main" /> </list> <configuration name="&lt;template&gt;" type="Applet" default="true" selected="false"> <option name="MAIN_CLASS_NAME" /> <option name="HTML_FILE_NAME" /> <option name="HTML_USED" value="false" /> <option name="WIDTH" value="400" /> <option name="HEIGHT" value="300" /> <option name="POLICY_FILE" value="$APPLICATION_HOME_DIR$/bin/appletviewer.policy" /> <option name="VM_PARAMETERS" /> </configuration> <configuration name="&lt;template&gt;" type="#org.jetbrains.idea.devkit.run.PluginConfigurationType" default="true" selected="false"> <option name="VM_PARAMETERS" value="-Xmx512m -Xms256m -XX:MaxPermSize=250m -ea" /> </configuration> <configuration name="&lt;template&gt;" type="WebApp" default="true" selected="false"> <Host>localhost</Host> <Port>5050</Port> </configuration> </component> <component name="ShelveChangesManager" show_recycled="false" /> <component name="SliceManager"> <option name="analysisUIOptions"> <AnalysisUIOptions /> </option> </component> <component name="SvnConfiguration"> <configuration /> </component> <component name="TaskManager"> <task active="true" id="Default" summary="Default task"> <changelist id="9d36bfd7-a2ff-41e0-b583-70ee3c8098bc" name="Default" comment="" /> <created>1431681659781</created> <updated>1431681659781</updated> </task> <servers /> </component> <component name="ToolWindowManager"> <frame x="10" y="0" width="1346" height="728" extended-state="1" /> <editor active="true" /> <layout> <window_info id="Palette&#9;" active="false" anchor="left" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" weight="0.33" sideWeight="0.5" order="2" side_tool="false" content_ui="tabs" /> <window_info id="Changes" active="false" anchor="bottom" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" weight="0.33" sideWeight="0.5" order="7" side_tool="false" content_ui="tabs" /> <window_info id="Designer" active="false" anchor="right" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" weight="0.33" sideWeight="0.5" order="2" side_tool="false" content_ui="tabs" /> <window_info id="Palette" active="false" anchor="right" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" weight="0.33" sideWeight="0.5" order="0" side_tool="false" content_ui="tabs" /> <window_info id="Terminal" active="false" anchor="bottom" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" weight="0.32924694" sideWeight="0.5" order="4" side_tool="false" content_ui="tabs" /> <window_info id="Debug" active="false" anchor="bottom" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" weight="0.4" sideWeight="0.5" order="11" side_tool="false" content_ui="tabs" /> <window_info id="Event Log" active="false" anchor="bottom" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" weight="0.33" sideWeight="0.5" order="0" side_tool="true" content_ui="tabs" /> <window_info id="Favorites" active="false" anchor="left" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" weight="0.33" sideWeight="0.5" order="1" side_tool="true" content_ui="tabs" /> <window_info id="Version Control" active="false" anchor="bottom" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" weight="0.33" sideWeight="0.5" order="2" side_tool="false" content_ui="tabs" /> <window_info id="Gradle Console" active="false" anchor="bottom" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" weight="0.33" sideWeight="0.5" order="1" side_tool="true" content_ui="tabs" /> <window_info id="Build Variants" active="false" anchor="left" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" weight="0.33" sideWeight="0.5" order="0" side_tool="true" content_ui="tabs" /> <window_info id="Android" active="false" anchor="bottom" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" weight="0.26619965" sideWeight="0.5" order="6" side_tool="false" content_ui="tabs" /> <window_info id="TODO" active="false" anchor="bottom" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" weight="0.33" sideWeight="0.5" order="14" side_tool="false" content_ui="tabs" /> <window_info id="Structure" active="false" anchor="left" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" weight="0.25" sideWeight="0.5" order="4" side_tool="false" content_ui="tabs" /> <window_info id="Commander" active="false" anchor="right" auto_hide="false" internal_type="SLIDING" type="SLIDING" visible="false" weight="0.4" sideWeight="0.5" order="3" side_tool="false" content_ui="tabs" /> <window_info id="Maven Projects" active="false" anchor="right" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" weight="0.33" sideWeight="0.5" order="1" side_tool="false" content_ui="tabs" /> <window_info id="Application Servers" active="false" anchor="bottom" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" weight="0.33" sideWeight="0.5" order="3" side_tool="false" content_ui="tabs" /> <window_info id="Project" active="false" anchor="left" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="true" weight="0.2496112" sideWeight="0.5" order="3" side_tool="false" content_ui="combo" /> <window_info id="Run" active="false" anchor="bottom" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" weight="0.33" sideWeight="0.5" order="10" side_tool="false" content_ui="tabs" /> <window_info id="Memory Monitor" active="false" anchor="bottom" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" weight="0.33" sideWeight="0.5" order="5" side_tool="true" content_ui="tabs" /> <window_info id="Cvs" active="false" anchor="bottom" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" weight="0.25" sideWeight="0.5" order="12" side_tool="false" content_ui="tabs" /> <window_info id="Message" active="false" anchor="bottom" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" weight="0.33" sideWeight="0.5" order="8" side_tool="false" content_ui="tabs" /> <window_info id="Ant Build" active="false" anchor="right" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" weight="0.25" sideWeight="0.5" order="4" side_tool="false" content_ui="tabs" /> <window_info id="Find" active="false" anchor="bottom" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" weight="0.33" sideWeight="0.5" order="9" side_tool="false" content_ui="tabs" /> <window_info id="Hierarchy" active="false" anchor="right" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" weight="0.25" sideWeight="0.5" order="5" side_tool="false" content_ui="combo" /> <window_info id="Inspection" active="false" anchor="bottom" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" weight="0.4" sideWeight="0.5" order="13" side_tool="false" content_ui="tabs" /> </layout> <layout-to-restore> <window_info id="Palette&#9;" active="false" anchor="left" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" weight="0.33" sideWeight="0.5" order="2" side_tool="false" content_ui="tabs" /> <window_info id="Changes" active="false" anchor="bottom" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" weight="0.33" sideWeight="0.5" order="7" side_tool="false" content_ui="tabs" /> <window_info id="Ant Build" active="false" anchor="right" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" weight="0.25" sideWeight="0.5" order="4" side_tool="false" content_ui="tabs" /> <window_info id="Event Log" active="false" anchor="bottom" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" weight="0.33" sideWeight="0.5" order="0" side_tool="true" content_ui="tabs" /> <window_info id="Build Variants" active="false" anchor="left" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" weight="0.33" sideWeight="0.5" order="0" side_tool="true" content_ui="tabs" /> <window_info id="Gradle Console" active="false" anchor="bottom" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" weight="0.33" sideWeight="0.5" order="1" side_tool="true" content_ui="tabs" /> <window_info id="Version Control" active="false" anchor="bottom" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" weight="0.33" sideWeight="0.5" order="2" side_tool="false" content_ui="tabs" /> <window_info id="TODO" active="false" anchor="bottom" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" weight="0.33" sideWeight="0.5" order="14" side_tool="false" content_ui="tabs" /> <window_info id="Application Servers" active="false" anchor="bottom" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" weight="0.33" sideWeight="0.5" order="3" side_tool="false" content_ui="tabs" /> <window_info id="Project" active="false" anchor="left" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="true" weight="0.2496112" sideWeight="0.5" order="3" side_tool="false" content_ui="combo" /> <window_info id="Hierarchy" active="false" anchor="right" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" weight="0.25" sideWeight="0.5" order="5" side_tool="false" content_ui="combo" /> <window_info id="Run" active="false" anchor="bottom" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" weight="0.33" sideWeight="0.5" order="10" side_tool="false" content_ui="tabs" /> <window_info id="Memory Monitor" active="false" anchor="bottom" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" weight="0.33" sideWeight="0.5" order="5" side_tool="true" content_ui="tabs" /> <window_info id="Cvs" active="false" anchor="bottom" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" weight="0.25" sideWeight="0.5" order="12" side_tool="false" content_ui="tabs" /> <window_info id="Designer" active="false" anchor="right" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" weight="0.33" sideWeight="0.5" order="2" side_tool="false" content_ui="tabs" /> <window_info id="Terminal" active="false" anchor="bottom" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" weight="0.32924694" sideWeight="0.5" order="4" side_tool="false" content_ui="tabs" /> <window_info id="Palette" active="false" anchor="right" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" weight="0.33" sideWeight="0.5" order="0" side_tool="false" content_ui="tabs" /> <window_info id="Message" active="false" anchor="bottom" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" weight="0.33" sideWeight="0.5" order="8" side_tool="false" content_ui="tabs" /> <window_info id="Find" active="false" anchor="bottom" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" weight="0.33" sideWeight="0.5" order="9" side_tool="false" content_ui="tabs" /> <window_info id="Debug" active="false" anchor="bottom" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" weight="0.4" sideWeight="0.5" order="11" side_tool="false" content_ui="tabs" /> <window_info id="Favorites" active="false" anchor="left" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" weight="0.33" sideWeight="0.5" order="1" side_tool="true" content_ui="tabs" /> <window_info id="Android" active="false" anchor="bottom" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="true" weight="0.26619965" sideWeight="0.5" order="6" side_tool="false" content_ui="tabs" /> <window_info id="Structure" active="false" anchor="left" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" weight="0.25" sideWeight="0.5" order="4" side_tool="false" content_ui="tabs" /> <window_info id="Commander" active="false" anchor="right" auto_hide="false" internal_type="SLIDING" type="SLIDING" visible="false" weight="0.4" sideWeight="0.5" order="3" side_tool="false" content_ui="tabs" /> <window_info id="Maven Projects" active="false" anchor="right" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" weight="0.33" sideWeight="0.5" order="1" side_tool="false" content_ui="tabs" /> <window_info id="Inspection" active="false" anchor="bottom" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" weight="0.4" sideWeight="0.5" order="13" side_tool="false" content_ui="tabs" /> </layout-to-restore> </component> <component name="Vcs.Log.UiProperties"> <option name="RECENTLY_FILTERED_USER_GROUPS"> <collection /> </option> <option name="RECENTLY_FILTERED_BRANCH_GROUPS"> <collection /> </option> </component> <component name="VcsContentAnnotationSettings"> <option name="myLimit" value="2678400000" /> </component> <component name="VcsManagerConfiguration"> <option name="myTodoPanelSettings"> <TodoPanelSettings /> </option> </component> <component name="XDebuggerManager"> <breakpoint-manager /> </component> <component name="editorHistoryManager"> <entry file="file://$PROJECT_DIR$/NonViewUtils/app/src/androidTest/java/org/adnroid/share/utils/example/ApplicationTest.java"> <provider selected="true" editor-type-id="text-editor"> <state vertical-scroll-proportion="0.0" vertical-offset="0" max-vertical-offset="432"> <caret line="8" column="13" selection-start-line="8" selection-start-column="13" selection-end-line="8" selection-end-column="13" /> <folding /> </state> </provider> </entry> <entry file="file://$PROJECT_DIR$/NonViewUtils/utilslib/src/main/gen/org/android/share/utils/BuildConfig.java"> <provider selected="true" editor-type-id="text-editor"> <state vertical-scroll-proportion="0.3580902" vertical-offset="0" max-vertical-offset="377"> <caret line="5" column="19" selection-start-line="5" selection-start-column="19" selection-end-line="5" selection-end-column="19" /> <folding /> </state> </provider> </entry> <entry file="file://$PROJECT_DIR$/NonViewUtils/utilslib/src/main/gen/org/android/share/utils/R.java"> <provider selected="true" editor-type-id="text-editor"> <state vertical-scroll-proportion="0.3580902" vertical-offset="0" max-vertical-offset="377"> <caret line="5" column="19" selection-start-line="5" selection-start-column="19" selection-end-line="5" selection-end-column="19" /> <folding /> </state> </provider> </entry> <entry file="file://$PROJECT_DIR$/NonViewUtils/utilslib/src/main/gen/org/android/share/utils/Manifest.java"> <provider selected="true" editor-type-id="text-editor"> <state vertical-scroll-proportion="0.3580902" vertical-offset="0" max-vertical-offset="377"> <caret line="5" column="19" selection-start-line="5" selection-start-column="19" selection-end-line="5" selection-end-column="19" /> <folding /> </state> </provider> </entry> <entry file="file://$PROJECT_DIR$/NonViewUtils/utilslib/src/androidTest/java/org/adnroid/share/utils/ApplicationTest.java"> <provider selected="true" editor-type-id="text-editor"> <state vertical-scroll-proportion="0.0" vertical-offset="0" max-vertical-offset="486"> <caret line="10" column="30" selection-start-line="10" selection-start-column="30" selection-end-line="10" selection-end-column="30" /> <folding> <element signature="e#352#353#0" expanded="true" /> </folding> </state> </provider> </entry> <entry file="file://$PROJECT_DIR$/NonViewUtils/app/src/androidTest/androidTest.iml"> <provider selected="true" editor-type-id="text-editor"> <state vertical-scroll-proportion="0.0" vertical-offset="0" max-vertical-offset="542"> <caret line="0" column="0" selection-start-line="0" selection-start-column="0" selection-end-line="0" selection-end-column="0" /> <folding /> </state> </provider> </entry> <entry file="file://$PROJECT_DIR$/NonViewUtils/utilslib/src/main/java/org/android/share/utils/activity/QuickBaseActivity.java"> <provider selected="true" editor-type-id="text-editor"> <state vertical-scroll-proportion="0.0" vertical-offset="854" max-vertical-offset="2079"> <caret line="16" column="0" selection-start-line="16" selection-start-column="0" selection-end-line="16" selection-end-column="0" /> <folding /> </state> </provider> </entry> <entry file="file://$PROJECT_DIR$/NonViewUtils/utilslib/src/main/java/org/android/share/utils/Base64Coder.java"> <provider selected="true" editor-type-id="text-editor"> <state vertical-scroll-proportion="0.40053052" vertical-offset="6950" max-vertical-offset="7479"> <caret line="275" column="9" selection-start-line="275" selection-start-column="9" selection-end-line="275" selection-end-column="9" /> <folding /> </state> </provider> </entry> <entry file="file://$PROJECT_DIR$/README.md"> <provider selected="true" editor-type-id="text-editor"> <state vertical-scroll-proportion="-5.08" vertical-offset="143" max-vertical-offset="1755"> <caret line="10" column="20" selection-start-line="10" selection-start-column="20" selection-end-line="10" selection-end-column="20" /> <folding /> </state> </provider> </entry> <entry file="file://$PROJECT_DIR$/NonViewUtils/utilslib/src/main/java/org/android/share/utils/WindowUtil.java"> <provider selected="true" editor-type-id="text-editor"> <state vertical-scroll-proportion="-1.9283819" vertical-offset="3265" max-vertical-offset="3807"> <caret line="100" column="36" selection-start-line="100" selection-start-column="24" selection-end-line="100" selection-end-column="36" /> <folding /> </state> </provider> </entry> <entry file="file://$PROJECT_DIR$/NonViewUtils/utilslib/src/main/main1.iml"> <provider selected="true" editor-type-id="text-editor"> <state vertical-scroll-proportion="0.0" vertical-offset="0" max-vertical-offset="648"> <caret line="5" column="12" selection-start-line="5" selection-start-column="12" selection-end-line="5" selection-end-column="12" /> <folding /> </state> </provider> </entry> <entry file="file://$PROJECT_DIR$/NonViewUtils/utilslib/src/main/java/org/android/share/utils/EasyToast.java"> <provider selected="true" editor-type-id="text-editor"> <state vertical-scroll-proportion="0.8468809" vertical-offset="3008" max-vertical-offset="4509"> <caret line="143" column="0" selection-start-line="143" selection-start-column="0" selection-end-line="143" selection-end-column="0" /> <folding /> </state> </provider> </entry> <entry file="file://$PROJECT_DIR$/.gitignore"> <provider selected="true" editor-type-id="text-editor"> <state vertical-scroll-proportion="-8.12" vertical-offset="337" max-vertical-offset="891"> <caret line="20" column="16" selection-start-line="20" selection-start-column="16" selection-end-line="20" selection-end-column="16" /> <folding /> </state> </provider> </entry> <entry file="file://$PROJECT_DIR$/NonViewUtils/utilslib/src/main/java/org/android/share/utils/IntentUtil.java"> <provider selected="true" editor-type-id="text-editor"> <state vertical-scroll-proportion="0.0" vertical-offset="160" max-vertical-offset="702"> <caret line="14" column="14" selection-start-line="14" selection-start-column="14" selection-end-line="14" selection-end-column="14" /> <folding /> </state> </provider> </entry> <entry file="file://$PROJECT_DIR$/NonViewUtils/utilslib/src/main/java/org/android/share/utils/photo/GetPhotoUtil.java"> <provider selected="true" editor-type-id="text-editor"> <state vertical-scroll-proportion="0.35727787" vertical-offset="0" max-vertical-offset="6345"> <caret line="21" column="18" selection-start-line="21" selection-start-column="18" selection-end-line="21" selection-end-column="18" /> <folding /> </state> </provider> </entry> </component> </project>
{ "pile_set_name": "Github" }
// FSFolderCopy.cpp #include "StdAfx.h" #include <Winbase.h> #include "Common/StringConvert.h" #include "Windows/DLL.h" #include "Windows/Error.h" #include "Windows/FileDir.h" #include "../../Common/FilePathAutoRename.h" #include "FSFolder.h" using namespace NWindows; using namespace NFile; using namespace NFind; #ifndef _UNICODE extern bool g_IsNT; #endif namespace NFsFolder { /* static bool IsItWindows2000orHigher() { OSVERSIONINFO versionInfo; versionInfo.dwOSVersionInfoSize = sizeof(versionInfo); if (!::GetVersionEx(&versionInfo)) return false; return (versionInfo.dwPlatformId == VER_PLATFORM_WIN32_NT) && (versionInfo.dwMajorVersion >= 5); } */ struct CProgressInfo { UInt64 StartPos; IProgress *Progress; }; #ifndef PROGRESS_CONTINUE #define PROGRESS_CONTINUE 0 #define PROGRESS_CANCEL 1 #define COPY_FILE_FAIL_IF_EXISTS 0x00000001 typedef DWORD (WINAPI* LPPROGRESS_ROUTINE)( LARGE_INTEGER TotalFileSize, LARGE_INTEGER TotalBytesTransferred, LARGE_INTEGER StreamSize, LARGE_INTEGER StreamBytesTransferred, DWORD dwStreamNumber, DWORD dwCallbackReason, HANDLE hSourceFile, HANDLE hDestinationFile, LPVOID lpData ); #endif static DWORD CALLBACK CopyProgressRoutine( LARGE_INTEGER /* TotalFileSize */, // file size LARGE_INTEGER TotalBytesTransferred, // bytes transferred LARGE_INTEGER /* StreamSize */, // bytes in stream LARGE_INTEGER /* StreamBytesTransferred */, // bytes transferred for stream DWORD /* dwStreamNumber */, // current stream DWORD /* dwCallbackReason */, // callback reason HANDLE /* hSourceFile */, // handle to source file HANDLE /* hDestinationFile */, // handle to destination file LPVOID lpData // from CopyFileEx ) { CProgressInfo &progressInfo = *(CProgressInfo *)lpData; UInt64 completed = progressInfo.StartPos + TotalBytesTransferred.QuadPart; if (progressInfo.Progress->SetCompleted(&completed) != S_OK) return PROGRESS_CANCEL; return PROGRESS_CONTINUE; } typedef BOOL (WINAPI * CopyFileExPointer)( IN LPCSTR lpExistingFileName, IN LPCSTR lpNewFileName, IN LPPROGRESS_ROUTINE lpProgressRoutine OPTIONAL, IN LPVOID lpData OPTIONAL, IN LPBOOL pbCancel OPTIONAL, IN DWORD dwCopyFlags ); typedef BOOL (WINAPI * CopyFileExPointerW)( IN LPCWSTR lpExistingFileName, IN LPCWSTR lpNewFileName, IN LPPROGRESS_ROUTINE lpProgressRoutine OPTIONAL, IN LPVOID lpData OPTIONAL, IN LPBOOL pbCancel OPTIONAL, IN DWORD dwCopyFlags ); static bool MyCopyFile(CFSTR existingFile, CFSTR newFile, IProgress *progress, UInt64 &completedSize) { CProgressInfo progressInfo; progressInfo.Progress = progress; progressInfo.StartPos = completedSize; BOOL CancelFlag = FALSE; #ifndef _UNICODE if (g_IsNT) #endif { const wchar_t *k_DllName = #ifdef UNDER_CE L"coredll.dll" #else L"kernel32.dll" #endif ; CopyFileExPointerW copyFunctionW = (CopyFileExPointerW) My_GetProcAddress(::GetModuleHandleW(k_DllName), "CopyFileExW"); if (copyFunctionW == 0) return BOOLToBool(::CopyFileW(fs2us(existingFile), fs2us(newFile), TRUE)); if (copyFunctionW(fs2us(existingFile), fs2us(newFile), CopyProgressRoutine, &progressInfo, &CancelFlag, COPY_FILE_FAIL_IF_EXISTS)) return true; #ifdef WIN_LONG_PATH UString longPathExisting, longPathNew; if (!NDirectory::GetLongPaths(existingFile, newFile, longPathExisting, longPathNew)) return false; if (copyFunctionW(longPathExisting, longPathNew, CopyProgressRoutine, &progressInfo, &CancelFlag, COPY_FILE_FAIL_IF_EXISTS)) return true; #endif return false; } #ifndef _UNICODE else { CopyFileExPointer copyFunction = (CopyFileExPointer) ::GetProcAddress(::GetModuleHandleA("kernel32.dll"), "CopyFileExA"); if (copyFunction != 0) { if (copyFunction(fs2fas(existingFile), fs2fas(newFile), CopyProgressRoutine,&progressInfo, &CancelFlag, COPY_FILE_FAIL_IF_EXISTS)) return true; if (::GetLastError() != ERROR_CALL_NOT_IMPLEMENTED) return false; } return BOOLToBool(::CopyFile(fs2fas(existingFile), fs2fas(newFile), TRUE)); } #endif } typedef BOOL (WINAPI * MoveFileWithProgressPointer)( IN LPCWSTR lpExistingFileName, IN LPCWSTR lpNewFileName, IN LPPROGRESS_ROUTINE lpProgressRoutine OPTIONAL, IN LPVOID lpData OPTIONAL, IN DWORD dwFlags ); static bool MyMoveFile(CFSTR existingFile, CFSTR newFile, IProgress *progress, UInt64 &completedSize) { #ifndef UNDER_CE // if (IsItWindows2000orHigher()) // { CProgressInfo progressInfo; progressInfo.Progress = progress; progressInfo.StartPos = completedSize; MoveFileWithProgressPointer moveFunction = (MoveFileWithProgressPointer) My_GetProcAddress(::GetModuleHandle(TEXT("kernel32.dll")), "MoveFileWithProgressW"); if (moveFunction != 0) { if (moveFunction( fs2us(existingFile), fs2us(newFile), CopyProgressRoutine, &progressInfo, MOVEFILE_COPY_ALLOWED)) return true; if (::GetLastError() != ERROR_CALL_NOT_IMPLEMENTED) { #ifdef WIN_LONG_PATH UString longPathExisting, longPathNew; if (!NDirectory::GetLongPaths(existingFile, newFile, longPathExisting, longPathNew)) return false; if (moveFunction(longPathExisting, longPathNew, CopyProgressRoutine, &progressInfo, MOVEFILE_COPY_ALLOWED)) return true; #endif if (::GetLastError() != ERROR_CALL_NOT_IMPLEMENTED) return false; } } // } // else #endif return NDirectory::MyMoveFile(existingFile, newFile); } static HRESULT SendMessageError(IFolderOperationsExtractCallback *callback, const wchar_t *message, const FString &fileName) { return callback->ShowMessage(message + fs2us(fileName)); } static HRESULT SendMessageError(IFolderOperationsExtractCallback *callback, const char *message, const FString &fileName) { return SendMessageError(callback, MultiByteToUnicodeString(message), fileName); } static HRESULT MyCopyFile( const FString &srcPath, const CFileInfo &srcFileInfo, const FString &destPathSpec, IFolderOperationsExtractCallback *callback, UInt64 &completedSize) { FString destPath = destPathSpec; if (destPath.CompareNoCase(srcPath) == 0) { RINOK(SendMessageError(callback, "can not copy file onto itself: ", destPath)); return E_ABORT; } Int32 writeAskResult; CMyComBSTR destPathResult; RINOK(callback->AskWrite( fs2us(srcPath), BoolToInt(false), &srcFileInfo.MTime, &srcFileInfo.Size, fs2us(destPath), &destPathResult, &writeAskResult)); if (IntToBool(writeAskResult)) { FString destPathNew = us2fs(destPathResult); RINOK(callback->SetCurrentFilePath(fs2us(srcPath))); if (!MyCopyFile(srcPath, destPathNew, callback, completedSize)) { RINOK(SendMessageError(callback, NError::MyFormatMessageW(GetLastError()) + L" : ", destPathNew)); return E_ABORT; } } completedSize += srcFileInfo.Size; return callback->SetCompleted(&completedSize); } static FString CombinePath(const FString &folderPath, const FString &fileName) { return folderPath + FCHAR_PATH_SEPARATOR + fileName; } static HRESULT CopyFolder( const FString &srcPath, const FString &destPathSpec, IFolderOperationsExtractCallback *callback, UInt64 &completedSize) { RINOK(callback->SetCompleted(&completedSize)); const FString destPath = destPathSpec; int len = srcPath.Length(); if (destPath.Length() >= len && srcPath.CompareNoCase(destPath.Left(len)) == 0) { if (destPath.Length() == len || destPath[len] == FCHAR_PATH_SEPARATOR) { RINOK(SendMessageError(callback, "can not copy folder onto itself: ", destPath)); return E_ABORT; } } if (!NDirectory::CreateComplexDirectory(destPath)) { RINOK(SendMessageError(callback, "can not create folder: ", destPath)); return E_ABORT; } CEnumerator enumerator(CombinePath(srcPath, FSTRING_ANY_MASK)); CFileInfoEx fi; while (enumerator.Next(fi)) { const FString srcPath2 = CombinePath(srcPath, fi.Name); const FString destPath2 = CombinePath(destPath, fi.Name); if (fi.IsDir()) { RINOK(CopyFolder(srcPath2, destPath2, callback, completedSize)) } else { RINOK(MyCopyFile(srcPath2, fi, destPath2, callback, completedSize)); } } return S_OK; } STDMETHODIMP CFSFolder::CopyTo(const UInt32 *indices, UInt32 numItems, const wchar_t *path, IFolderOperationsExtractCallback *callback) { if (numItems == 0) return S_OK; UInt64 numFolders, numFiles, totalSize; GetItemsFullSize(indices, numItems, numFolders, numFiles, totalSize, callback); RINOK(callback->SetTotal(totalSize)); RINOK(callback->SetNumFiles(numFiles)); UString destPath = path; if (destPath.IsEmpty()) return E_INVALIDARG; bool directName = (destPath.Back() != WCHAR_PATH_SEPARATOR); if (directName) { if (numItems > 1) return E_INVALIDARG; } /* // doesn't work in network else if (!NDirectory::CreateComplexDirectory(destPath))) { DWORD lastError = ::GetLastError(); UString message = UString(L"can not create folder ") + destPath; RINOK(callback->ShowMessage(message)); return E_ABORT; } */ UInt64 completedSize = 0; RINOK(callback->SetCompleted(&completedSize)); for (UInt32 i = 0; i < numItems; i++) { const CDirItem &fi = *_refs[indices[i]]; FString destPath2 = us2fs(destPath); if (!directName) destPath2 += fi.Name; FString srcPath = _path + GetPrefix(fi) + fi.Name; if (fi.IsDir()) { RINOK(CopyFolder(srcPath, destPath2, callback, completedSize)); } else { RINOK(MyCopyFile(srcPath, fi, destPath2, callback, completedSize)); } } return S_OK; } ///////////////////////////////////////////////// // Move Operations static HRESULT MyMoveFile( const FString &srcPath, const CFileInfo &srcFileInfo, const FString &destPath, IFolderOperationsExtractCallback *callback, UInt64 &completedSize) { if (destPath.CompareNoCase(srcPath) == 0) { RINOK(SendMessageError(callback, "can not move file onto itself: ", srcPath)); return E_ABORT; } Int32 writeAskResult; CMyComBSTR destPathResult; RINOK(callback->AskWrite( fs2us(srcPath), BoolToInt(false), &srcFileInfo.MTime, &srcFileInfo.Size, fs2us(destPath), &destPathResult, &writeAskResult)); if (IntToBool(writeAskResult)) { FString destPathNew = us2fs(destPathResult); RINOK(callback->SetCurrentFilePath(fs2us(srcPath))); if (!MyMoveFile(srcPath, destPathNew, callback, completedSize)) { RINOK(SendMessageError(callback, "can not move to file: ", destPathNew)); } } completedSize += srcFileInfo.Size; RINOK(callback->SetCompleted(&completedSize)); return S_OK; } static HRESULT MyMoveFolder( const FString &srcPath, const FString &destPath, IFolderOperationsExtractCallback *callback, UInt64 &completedSize) { int len = srcPath.Length(); if (destPath.Length() >= len && srcPath.CompareNoCase(destPath.Left(len)) == 0) { if (destPath.Length() == len || destPath[len] == FCHAR_PATH_SEPARATOR) { RINOK(SendMessageError(callback, "can not move folder onto itself: ", destPath)); return E_ABORT; } } if (MyMoveFile(srcPath, destPath, callback, completedSize)) return S_OK; if (!NDirectory::CreateComplexDirectory(destPath)) { RINOK(SendMessageError(callback, "can not create folder: ", destPath)); return E_ABORT; } { CEnumerator enumerator(CombinePath(srcPath, FSTRING_ANY_MASK)); CFileInfoEx fi; while (enumerator.Next(fi)) { const FString srcPath2 = CombinePath(srcPath, fi.Name); const FString destPath2 = CombinePath(destPath, fi.Name); if (fi.IsDir()) { RINOK(MyMoveFolder(srcPath2, destPath2, callback, completedSize)); } else { RINOK(MyMoveFile(srcPath2, fi, destPath2, callback, completedSize)); } } } if (!NDirectory::MyRemoveDirectory(srcPath)) { RINOK(SendMessageError(callback, "can not remove folder: ", srcPath)); return E_ABORT; } return S_OK; } STDMETHODIMP CFSFolder::MoveTo( const UInt32 *indices, UInt32 numItems, const wchar_t *path, IFolderOperationsExtractCallback *callback) { if (numItems == 0) return S_OK; UInt64 numFolders, numFiles, totalSize; GetItemsFullSize(indices, numItems, numFolders, numFiles, totalSize, callback); RINOK(callback->SetTotal(totalSize)); RINOK(callback->SetNumFiles(numFiles)); FString destPath = us2fs(path); if (destPath.IsEmpty()) return E_INVALIDARG; bool directName = (destPath.Back() != FCHAR_PATH_SEPARATOR); if (directName) { if (numItems > 1) return E_INVALIDARG; } else if (!NDirectory::CreateComplexDirectory(destPath)) { RINOK(SendMessageError(callback, "can not create folder: ", destPath)); return E_ABORT; } UInt64 completedSize = 0; RINOK(callback->SetCompleted(&completedSize)); for (UInt32 i = 0; i < numItems; i++) { const CDirItem &fi = *_refs[indices[i]]; FString destPath2 = destPath; if (!directName) destPath2 += fi.Name; FString srcPath = _path + GetPrefix(fi) + fi.Name; if (fi.IsDir()) { RINOK(MyMoveFolder(srcPath, destPath2, callback, completedSize)); } else { RINOK(MyMoveFile(srcPath, fi, destPath2, callback, completedSize)); } } return S_OK; } STDMETHODIMP CFSFolder::CopyFrom(const wchar_t * /* fromFolderPath */, const wchar_t ** /* itemsPaths */, UInt32 /* numItems */, IProgress * /* progress */) { /* UInt64 numFolders, numFiles, totalSize; numFiles = numFolders = totalSize = 0; UInt32 i; for (i = 0; i < numItems; i++) { UString path = (UString)fromFolderPath + itemsPaths[i]; CFileInfo fi; if (!FindFile(path, fi)) return ::GetLastError(); if (fi.IsDir()) { UInt64 subFolders, subFiles, subSize; RINOK(GetFolderSize(CombinePath(path, fi.Name), subFolders, subFiles, subSize, progress)); numFolders += subFolders; numFolders++; numFiles += subFiles; totalSize += subSize; } else { numFiles++; totalSize += fi.Size; } } RINOK(progress->SetTotal(totalSize)); RINOK(callback->SetNumFiles(numFiles)); for (i = 0; i < numItems; i++) { UString path = (UString)fromFolderPath + itemsPaths[i]; } return S_OK; */ return E_NOTIMPL; } STDMETHODIMP CFSFolder::CopyFromFile(UInt32 /* index */, const wchar_t * /* fullFilePath */, IProgress * /* progress */) { return E_NOTIMPL; } }
{ "pile_set_name": "Github" }
--- -api-id: P:Windows.ApplicationModel.Activation.AppointmentsProviderAddAppointmentActivatedEventArgs.Verb -api-type: winrt property --- <!-- Property syntax public string Verb { get; } --> # Windows.ApplicationModel.Activation.AppointmentsProviderAddAppointmentActivatedEventArgs.Verb ## -description Gets the action to be performed by the appointments provider. ## -property-value The action to be performed by the appointments provider. ## -remarks ## -examples ## -see-also
{ "pile_set_name": "Github" }
--- # Handle case where openshift_master_predicates is defined - when: openshift_master_scheduler_predicates | default(none) is not none block: - name: openshift_master_scheduler_predicates is defined debug: msg: "openshift_master_scheduler_predicates is defined" - name: openshift_master_scheduler_predicates is set to defaults from an earlier release debug: msg: "WARNING: openshift_master_scheduler_predicates is set to defaults from an earlier release of OpenShift current defaults are: {{ openshift_master_scheduler_default_predicates }}" when: openshift_master_scheduler_predicates in osm_older_predicates + osm_older_predicates_no_region + [osm_prev_predicates] + [osm_prev_predicates_no_region] - name: openshift_master_scheduler_predicates does not match current defaults debug: msg: "WARNING: openshift_master_scheduler_predicates does not match current defaults of: {{ openshift_master_scheduler_default_predicates }}" when: openshift_master_scheduler_predicates != openshift_master_scheduler_default_predicates # Handle cases where openshift_master_predicates is not defined - when: openshift_master_scheduler_predicates | default(none) is none block: - name: openshift_master_scheduler_predicates is not defined debug: msg: "openshift_master_scheduler_predicates is not defined" - name: existing scheduler config does not match previous known defaults debug: msg: "WARNING: existing scheduler config does not match previous known defaults automated upgrade of scheduler config is disabled.\nexisting scheduler predicates: {{ openshift_master_scheduler_current_predicates }}\ncurrent scheduler default predicates are: {{ openshift_master_scheduler_default_predicates }}" when: - openshift_master_scheduler_current_predicates != openshift_master_scheduler_default_predicates - openshift_master_scheduler_current_predicates not in osm_older_predicates + [osm_prev_predicates] - name: set_fact openshift_upgrade_scheduler_predicates 1 set_fact: openshift_upgrade_scheduler_predicates: "{{ openshift_master_scheduler_default_predicates }}" when: - openshift_master_scheduler_current_predicates != openshift_master_scheduler_default_predicates - openshift_master_scheduler_current_predicates in osm_older_predicates + [osm_prev_predicates] - name: set_fact openshift_upgrade_scheduler_predicates 2 set_fact: openshift_upgrade_scheduler_predicates: "{{ osm_default_predicates_no_region }}" when: - openshift_master_scheduler_current_predicates != osm_default_predicates_no_region - openshift_master_scheduler_current_predicates in osm_older_predicates_no_region + [osm_prev_predicates_no_region]
{ "pile_set_name": "Github" }
package sacloud // ProductPrivateHost 専有ホストプラン type ProductPrivateHost struct { *Resource // ID propName // 名称 propDescription // 説明 propAvailability // 有功状態 propCPU // CPUコア数 propMemoryMB // メモリサイズ(MB単位) propClass // クラス propServiceClass // サービスクラス }
{ "pile_set_name": "Github" }
/* bender-tags: editor */ /* global acfTestTools */ ( function() { 'use strict'; var createFilter = acfTestTools.createFilter, createFilterTester = acfTestTools.createFilterTester; bender.editors = { editor: { name: 'editor1' } }; bender.test( { 'test elementCallbacks property': function() { var filter = new CKEDITOR.filter( 'p' ); assert.isNull( filter.elementCallbacks, 'initially null' ); filter.addElementCallback( function() {} ); assert.isArray( filter.elementCallbacks, 'becomes array' ); assert.areSame( 1, filter.elementCallbacks.length ); }, 'test callback is executed on all elements when filtering': function() { var filter = createFilter( 'p b i' ), names = []; filter.filter.addElementCallback( function( el ) { names.push( el.name ); } ); filter( '<p><b>x</b>x<b><i>y</i>x</b></p>', '<p><b>x</b>x<b><i>y</i>x</b></p>' ); assert.areSame( 'p,b,b,i', names.join( ',' ), 'all elements are visited' ); names = []; filter( '<h1>x</h1><p><u>y</u></p>', '<p>x</p><p>y</p>' ); assert.areSame( 'h1,p,u', names.join( ',' ), 'not allowed elements are visited' ); names = []; filter( '<p>x<img src="foo" alt="" />y<textarea cols="10" rows="10">x</textarea>z</p>', '<p>xyxz</p>' ); assert.areSame( 'p,img,textarea', names.join( ',' ), 'empty elements are visited' ); }, // In this test we need to use real editor, because script tag is protected by the htmlDP. 'test callback is executed on protected elements when filtering': function() { var editor = this.editors.editor, t = createFilterTester( editor ), names = []; editor.filter.addElementCallback( function( el ) { names.push( el.name ); } ); try { t( '<p>x</p><script>foo</scr' + 'ipt><p>y</p>', '<p>x</p><p>y</p>' ); assert.areSame( 'p,script,p', names.join( ',' ), 'protected elements are visited' ); } catch ( e ) { throw e; } finally { editor.filter.elementCallbacks = []; } }, 'test callback is not executed when checking': function() { var filter = new CKEDITOR.filter( 'p b' ); filter.addElementCallback( function( el ) { assert.fail( 'callback should not be executed when checking rule: ' + el.name ); } ); filter.check( 'p' ); filter.check( 'script' ); filter.check( 'h1' ); assert.isTrue( true ); }, 'test callbacks are executed until one of them returns a value': function() { var filter = createFilter( 'p' ), executed = []; filter.filter.addElementCallback( function() { executed.push( 'a' ); } ); filter.filter.addElementCallback( function() { executed.push( 'b' ); return CKEDITOR.FILTER_SKIP_TREE; } ); filter.filter.addElementCallback( function() { executed.push( 'c' ); } ); filter( '<p>a</p><p>a</p>', '<p>a</p><p>a</p>' ); assert.areSame( 'a,b,a,b', executed.join( ',' ) ); }, 'test FILTER_SKIP_TREE skips entire tree': function() { var filter = createFilter( 'p b' ); filter.filter.addElementCallback( function( el ) { if ( el.name == 'i' ) return CKEDITOR.FILTER_SKIP_TREE; } ); filter( '<p foo="1"><b bar="1">x</b></p>', '<p><b>x</b></p>' ); filter( '<p><i foo="1">x</i><u>x</u></p>', '<p><i foo="1">x</i>x</p>' ); filter( '<p><i><u>x<img alt="" src="" /></u></i></p>', '<p><i><u>x<img alt="" src="" /></u></i></p>' ); } } ); } )();
{ "pile_set_name": "Github" }
# Copyright 2017 Yahoo Holdings. Licensed under the terms of the Apache 2.0 license. See LICENSE in the project root. vespa_define_module( DEPENDS fastos vespalog vespalib staging_vespalib fnet document persistencetypes config_cloudconfig vdslib metrics configdefinitions LIBS src/vespa/persistence src/vespa/persistence/conformancetest src/vespa/persistence/dummyimpl src/vespa/persistence/spi TEST_DEPENDS GTest::GTest TESTS src/tests src/tests/dummyimpl src/tests/spi )
{ "pile_set_name": "Github" }
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"> <html xmlns="http://www.w3.org/1999/xhtml"> <head> <title>CSS Test: Left with a value of zero and no units, 0</title> <link rel="author" title="Microsoft" href="http://www.microsoft.com/" /> <link rel="reviewer" title="Gérard Talbot" href="http://www.gtalbot.org/BrowserBugsSection/css21testsuite/" /> <!-- 2012-09-17 --> <link rel="help" href="http://www.w3.org/TR/CSS21/visuren.html#propdef-left" /> <link rel="help" href="http://www.w3.org/TR/CSS21/visuren.html#position-props" /> <link rel="match" href="left-004-ref.xht" /> <meta name="flags" content="" /> <meta name="assert" content="The 'left' property sets a zero length value with no units." /> <style type="text/css"> div { height: 1in; position: relative; } #div1 { border-left: 5px solid orange; } div div { border-left: 5px solid blue; left: 0; } </style> </head> <body> <p>Test passes if there is <strong>no space between</strong> the orange and blue lines.</p> <div id="div1"> <div></div> </div> </body> </html>
{ "pile_set_name": "Github" }
path: "tensorflow.distributions.Exponential" tf_class { is_instance: "<class \'tensorflow.python.ops.distributions.exponential.Exponential\'>" is_instance: "<class \'tensorflow.python.ops.distributions.gamma.Gamma\'>" is_instance: "<class \'tensorflow.python.ops.distributions.distribution.Distribution\'>" is_instance: "<class \'tensorflow.python.ops.distributions.distribution._BaseDistribution\'>" is_instance: "<type \'object\'>" member { name: "allow_nan_stats" mtype: "<type \'property\'>" } member { name: "batch_shape" mtype: "<type \'property\'>" } member { name: "concentration" mtype: "<type \'property\'>" } member { name: "dtype" mtype: "<type \'property\'>" } member { name: "event_shape" mtype: "<type \'property\'>" } member { name: "name" mtype: "<type \'property\'>" } member { name: "parameters" mtype: "<type \'property\'>" } member { name: "rate" mtype: "<type \'property\'>" } member { name: "reparameterization_type" mtype: "<type \'property\'>" } member { name: "validate_args" mtype: "<type \'property\'>" } member_method { name: "__init__" argspec: "args=[\'self\', \'rate\', \'validate_args\', \'allow_nan_stats\', \'name\'], varargs=None, keywords=None, defaults=[\'False\', \'True\', \'Exponential\'], " } member_method { name: "batch_shape_tensor" argspec: "args=[\'self\', \'name\'], varargs=None, keywords=None, defaults=[\'batch_shape_tensor\'], " } member_method { name: "cdf" argspec: "args=[\'self\', \'value\', \'name\'], varargs=None, keywords=None, defaults=[\'cdf\'], " } member_method { name: "copy" argspec: "args=[\'self\'], varargs=None, keywords=override_parameters_kwargs, defaults=None" } member_method { name: "covariance" argspec: "args=[\'self\', \'name\'], varargs=None, keywords=None, defaults=[\'covariance\'], " } member_method { name: "cross_entropy" argspec: "args=[\'self\', \'other\', \'name\'], varargs=None, keywords=None, defaults=[\'cross_entropy\'], " } member_method { name: "entropy" argspec: "args=[\'self\', \'name\'], varargs=None, keywords=None, defaults=[\'entropy\'], " } member_method { name: "event_shape_tensor" argspec: "args=[\'self\', \'name\'], varargs=None, keywords=None, defaults=[\'event_shape_tensor\'], " } member_method { name: "is_scalar_batch" argspec: "args=[\'self\', \'name\'], varargs=None, keywords=None, defaults=[\'is_scalar_batch\'], " } member_method { name: "is_scalar_event" argspec: "args=[\'self\', \'name\'], varargs=None, keywords=None, defaults=[\'is_scalar_event\'], " } member_method { name: "kl_divergence" argspec: "args=[\'self\', \'other\', \'name\'], varargs=None, keywords=None, defaults=[\'kl_divergence\'], " } member_method { name: "log_cdf" argspec: "args=[\'self\', \'value\', \'name\'], varargs=None, keywords=None, defaults=[\'log_cdf\'], " } member_method { name: "log_prob" argspec: "args=[\'self\', \'value\', \'name\'], varargs=None, keywords=None, defaults=[\'log_prob\'], " } member_method { name: "log_survival_function" argspec: "args=[\'self\', \'value\', \'name\'], varargs=None, keywords=None, defaults=[\'log_survival_function\'], " } member_method { name: "mean" argspec: "args=[\'self\', \'name\'], varargs=None, keywords=None, defaults=[\'mean\'], " } member_method { name: "mode" argspec: "args=[\'self\', \'name\'], varargs=None, keywords=None, defaults=[\'mode\'], " } member_method { name: "param_shapes" argspec: "args=[\'cls\', \'sample_shape\', \'name\'], varargs=None, keywords=None, defaults=[\'DistributionParamShapes\'], " } member_method { name: "param_static_shapes" argspec: "args=[\'cls\', \'sample_shape\'], varargs=None, keywords=None, defaults=None" } member_method { name: "prob" argspec: "args=[\'self\', \'value\', \'name\'], varargs=None, keywords=None, defaults=[\'prob\'], " } member_method { name: "quantile" argspec: "args=[\'self\', \'value\', \'name\'], varargs=None, keywords=None, defaults=[\'quantile\'], " } member_method { name: "sample" argspec: "args=[\'self\', \'sample_shape\', \'seed\', \'name\'], varargs=None, keywords=None, defaults=[\'()\', \'None\', \'sample\'], " } member_method { name: "stddev" argspec: "args=[\'self\', \'name\'], varargs=None, keywords=None, defaults=[\'stddev\'], " } member_method { name: "survival_function" argspec: "args=[\'self\', \'value\', \'name\'], varargs=None, keywords=None, defaults=[\'survival_function\'], " } member_method { name: "variance" argspec: "args=[\'self\', \'name\'], varargs=None, keywords=None, defaults=[\'variance\'], " } }
{ "pile_set_name": "Github" }
/* * * Copyright 2015 gRPC authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. * */ #ifndef GRPCPP_SUPPORT_CONFIG_H #define GRPCPP_SUPPORT_CONFIG_H #include <grpcpp/impl/codegen/config.h> #endif // GRPCPP_SUPPORT_CONFIG_H
{ "pile_set_name": "Github" }
//------------------------------------------------------------------------------ // GB_subassigner: C(I,J)<#M> = accum (C(I,J), A) //------------------------------------------------------------------------------ // SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2020, All Rights Reserved. // http://suitesparse.com See GraphBLAS/Doc/License.txt for license. //------------------------------------------------------------------------------ // Submatrix assignment: C(I,J)<M> = A, or accum (C (I,J), A), no transpose // All assignment operations rely on this function, including the GrB_*_assign // operations in the spec, and the GxB_*_subassign operations that are a // SuiteSparse:GraphBLAS extension to the spec: // GrB_Matrix_assign, // GrB_Matrix_assign_TYPE, // GrB_Vector_assign, // GrB_Vector_assign_TYPE, // GrB_Row_assign, // GrB_Col_assign // GxB_Matrix_subassign, // GxB_Matrix_subassign_TYPE, // GxB_Vector_subassign, // GxB_Vector_subassign_TYPE, // GxB_Row_subassign, // GxB_Col_subassign // This function handles the accumulator, and the mask M, and the C_replace // option itself, without relying on GB_accum_mask or GB_mask. The mask M has // the same size as C(I,J) and A. M(0,0) governs how A(0,0) is assigned // into C(I[0],J[0]). This is how GxB_subassign operates. For GrB_assign, the // mask M in this function is the SubMask, constructed via SubMask=M(I,J). // No transposed case is handled. This function is also agnostic about the // CSR/CSC format of C, A, and M. The A matrix must have A->vlen == nI and // A->vdim == nJ (except for scalar expansion, in which case A is NULL). The // mask M must be the same size as A, if present. // Any or all of the C, M, and/or A matrices may be hypersparse or standard // non-hypersparse. // C is operated on in-place and thus cannot be aliased with the inputs A or M. // Since the pattern of C does not change here, C->p, C->h, C->nvec, and // C->nvec_nonempty are constant. C->x and C->i can be modified, but only one // entry at a time. No entries are shifted. C->x can be modified, and C->i // can be changed by turning an entry into a zombie, or by bringing a zombie // back to life, but no entry in C->i moves in position. #define GB_FREE_WORK \ { \ GB_MATRIX_FREE (&S) ; \ GB_MATRIX_FREE (&A2) ; \ GB_MATRIX_FREE (&M2) ; \ GB_FREE_MEMORY (I2, ni, sizeof (GrB_Index)) ; \ GB_FREE_MEMORY (I2k, ni, sizeof (GrB_Index)) ; \ GB_FREE_MEMORY (J2, nj, sizeof (GrB_Index)) ; \ GB_FREE_MEMORY (J2k, nj, sizeof (GrB_Index)) ; \ } #include "GB_subassign.h" #include "GB_subassign_methods.h" #include "GB_subref.h" #include "GB_dense.h" #ifdef GB_DEBUG #include "GB_iterator.h" #endif #undef GB_FREE_ALL #define GB_FREE_ALL \ { \ GB_PHIX_FREE (C) ; \ GB_FREE_WORK ; \ } GrB_Info GB_subassigner // C(I,J)<#M> = A or accum (C (I,J), A) ( GrB_Matrix C, // input/output matrix for results bool C_replace, // C matrix descriptor const GrB_Matrix M_input, // optional mask for C(I,J), unused if NULL const bool Mask_comp, // mask descriptor const bool Mask_struct, // if true, use the only structure of M const GrB_BinaryOp accum, // optional accum for Z=accum(C(I,J),A) const GrB_Matrix A_input, // input matrix (NULL for scalar expansion) const GrB_Index *I_input, // list of indices const int64_t ni_input, // number of indices const GrB_Index *J_input, // list of vector indices const int64_t nj_input, // number of column indices const bool scalar_expansion, // if true, expand scalar to A const void *scalar, // scalar to be expanded const GB_Type_code scalar_code, // type code of scalar to expand GB_Context Context ) { //-------------------------------------------------------------------------- // check inputs //-------------------------------------------------------------------------- GrB_Info info ; GrB_Matrix S = NULL ; GrB_Matrix A2 = NULL ; GrB_Matrix M2 = NULL ; GrB_Index *GB_RESTRICT I2 = NULL ; GrB_Index *GB_RESTRICT I2k = NULL ; GrB_Index *GB_RESTRICT J2 = NULL ; GrB_Index *GB_RESTRICT J2k = NULL ; GrB_Matrix A = A_input ; GrB_Matrix M = M_input ; int64_t ni = ni_input ; int64_t nj = nj_input ; // I and J are either the user inputs, or sorted copies #define I ((I_jumbled) ? I2 : I_input) #define J ((J_jumbled) ? J2 : J_input) // GB_subassigner cannot tolerate C==A and C==M aliasing. A==M is OK. ASSERT (C != NULL) ; ASSERT (!GB_aliased (C, M)) ; ASSERT (!GB_aliased (C, A)) ; //-------------------------------------------------------------------------- // delete any lingering zombies and assemble any pending tuples //-------------------------------------------------------------------------- ASSERT_MATRIX_OK (C, "C input for subassigner", GB0) ; // subassign tolerates both zombies and pending tuples in C, but not M or A GB_WAIT (M) ; GB_WAIT (A) ; //-------------------------------------------------------------------------- // check mask conditions //-------------------------------------------------------------------------- bool empty_mask = false ; // true if mask not present and complemented bool no_mask = false ; // true if mask not present and not complemented if (M == NULL) { // the mask is not present if (Mask_comp) { // empty_mask: mask is not present, and complemented empty_mask = true ; if (!C_replace) { // No work to do. This the same as the GB_RETURN_IF_QUICK_MASK // case in other GraphBLAS functions, except here only the // sub-case of C_replace == false is handled. The C_replace == // true sub-case needs to delete all entries in C(I,J), which // is handled below in GB_subassign_00. This "quick" case is // checked again if C_replace becomes effectively false, below. GBBURBLE ("quick ") ; return (GrB_SUCCESS) ; } } else { // no_mask: mask is not present, and not complemented no_mask = true ; if (C_replace) { // The mask is not present and not complemented. In this case, // C_replace is effectively false. Disable it, since it can // force pending tuples to be assembled. In the comments below // "C_replace effectively false" means that either C_replace is // false on input, or the mask is not present and not // complemented and thus C_replace is set to false here. GBBURBLE ("(no mask: C_replace effectively false) ") ; C_replace = false ; } } } //-------------------------------------------------------------------------- // check if C is empty //-------------------------------------------------------------------------- bool C_is_empty = (GB_NNZ (C) == 0 && !GB_PENDING (C) && !GB_ZOMBIES (C)) ; if (C_is_empty) { // C is completely empty. C_replace is irrelevant, so set it to false. // The burble for this case occurs below, after GB_wait (C), since C // may become empty if it contains nothing but zombies, or after the // GB_clear (C) below. C_replace = false ; } //-------------------------------------------------------------------------- // get the C matrix //-------------------------------------------------------------------------- int64_t cvlen = C->vlen ; int64_t cvdim = C->vdim ; // the matrix C may have pending tuples and/or zombies ASSERT (GB_PENDING_OK (C)) ; ASSERT (GB_ZOMBIES_OK (C)) ; ASSERT (scalar_code <= GB_UDT_code) ; //-------------------------------------------------------------------------- // determine the length and kind of I and J, and check their properties //-------------------------------------------------------------------------- int64_t nI, nJ, Icolon [3], Jcolon [3] ; int Ikind, Jkind ; GB_ijlength (I_input, ni, cvlen, &nI, &Ikind, Icolon) ; GB_ijlength (J_input, nj, cvdim, &nJ, &Jkind, Jcolon) ; // If the descriptor says that A must be transposed, it has already been // transposed in the caller. Thus C(I,J), A, and M (if present) all // have the same size: length(I)-by-length(J) bool I_unsorted, I_has_dupl, I_contig, J_unsorted, J_has_dupl, J_contig ; int64_t imin, imax, jmin, jmax ; GB_OK (GB_ijproperties (I_input, ni, nI, cvlen, &Ikind, Icolon, &I_unsorted, &I_has_dupl, &I_contig, &imin, &imax, Context)) ; GB_OK (GB_ijproperties (J_input, nj, nJ, cvdim, &Jkind, Jcolon, &J_unsorted, &J_has_dupl, &J_contig, &jmin, &jmax, Context)) ; //-------------------------------------------------------------------------- // sort I and J and remove duplicates, if needed //-------------------------------------------------------------------------- // If I or J are explicit lists, and either of are unsorted or are sorted // but have duplicate entries, then both I and J are sorted and their // duplicates are removed. A and M are adjusted accordingly. Removing // duplicates decreases the length of I and J. bool I_jumbled = (I_unsorted || I_has_dupl) ; bool J_jumbled = (J_unsorted || J_has_dupl) ; bool presort = I_jumbled || J_jumbled ; // This pre-sort of I and J is required for the parallel subassign. // Otherwise, multiple threads may attempt to modify the same part of C. // This could cause a race condition, if one thread flags a zombie at the // same time another thread is using that index in a binary search. If the // 2nd thread finds either zombie/not-zombie, this is fine, but the // modification would have to be atomic. Atomic read/write is slow, so to // avoid the use of atomics, the index lists I and J are sorted and all // duplicates are removed. // A side benefit of this pre-sort is that it ensures that the results of // GrB_assign and GxB_subassign are fully defined if I and J have // duplicates. The definition of this pre-sort is given in the M-file // below. /* function C = subassign (C, I, J, A) % submatrix assignment with pre-sort of I and J; and remove duplicates % delete duplicates from I, keeping the last one seen [I2 I2k] = sort (I) ; Idupl = [(I2 (1:end-1) == I2 (2:end)), false] ; I2 = I2 (~Idupl) ; I2k = I2k (~Idupl) ; assert (isequal (I2, unique (I))) % delete duplicates from J, keeping the last one seen [J2 J2k] = sort (J) ; Jdupl = [(J2 (1:end-1) == J2 (2:end)), false] ; J2 = J2 (~Jdupl) ; J2k = J2k (~Jdupl) ; assert (isequal (J2, unique (J))) % do the submatrix assignment, with no duplicates in I2 or J2 C (I2,J2) = A (I2k,J2k) ; */ // With this subassign script, the result returned by GB_subassigner // matches the behavior in MATLAB, so the following holds: /* C2 = C ; C2 (I,J) = A ; C3 = subassign (C, I, J, A) ; assert (isequal (C2, C3)) ; */ // That is, the pre-sort of I, J, and A has no effect on the final C, in // MATLAB. // The pre-sort itself takes additional work and memory space, but it may // actually improve the performance of GB_subassigner, since it makes // the data access of C more regular, even in the sequential case. if (presort) { ASSERT (Ikind == GB_LIST || Jkind == GB_LIST) ; if (I_jumbled) { // I2 = sort I_input and remove duplicates ASSERT (Ikind == GB_LIST) ; GB_OK (GB_ijsort (I_input, &ni, &I2, &I2k, Context)) ; // Recheck the length and properties of the new I2. This may // convert I2 to GB_ALL or GB_RANGE, after I2 has been sorted. GB_ijlength (I2, ni, cvlen, &nI, &Ikind, Icolon) ; GB_OK (GB_ijproperties (I2, ni, nI, cvlen, &Ikind, Icolon, &I_unsorted, &I_has_dupl, &I_contig, &imin, &imax, Context)) ; ASSERT (! (I_unsorted || I_has_dupl)) ; } if (J_jumbled) { // J2 = sort J_input and remove duplicates ASSERT (Jkind == GB_LIST) ; GB_OK (GB_ijsort (J_input, &nj, &J2, &J2k, Context)) ; // Recheck the length and properties of the new J2. This may // convert J2 to GB_ALL or GB_RANGE, after J2 has been sorted. GB_ijlength (J2, nj, cvdim, &nJ, &Jkind, Jcolon) ; GB_OK (GB_ijproperties (J2, nj, nJ, cvdim, &Jkind, Jcolon, &J_unsorted, &J_has_dupl, &J_contig, &jmin, &jmax, Context)) ; ASSERT (! (J_unsorted || J_has_dupl)) ; } if (!scalar_expansion) { // A2 = A (I2k, J2k) GB_OK (GB_subref (&A2, A->is_csc, A, I_jumbled ? I2k : GrB_ALL, ni, J_jumbled ? J2k : GrB_ALL, nj, false, true, Context)) ; A = A2 ; } if (M != NULL) { // M2 = M (I2k, J2k) GB_OK (GB_subref (&M2, M->is_csc, M, I_jumbled ? I2k : GrB_ALL, ni, J_jumbled ? J2k : GrB_ALL, nj, false, true, Context)) ; M = M2 ; } GB_FREE_MEMORY (I2k, ni, sizeof (GrB_Index)) ; GB_FREE_MEMORY (J2k, nj, sizeof (GrB_Index)) ; } // I and J are now sorted, with no duplicate entries. They are either // GB_ALL, GB_RANGE, or GB_STRIDE, which are intrinsically sorted with no // duplicates, or they are explicit GB_LISTs with sorted entries and no // duplicates. ASSERT (! (I_unsorted || I_has_dupl)) ; ASSERT (! (J_unsorted || J_has_dupl)) ; //-------------------------------------------------------------------------- // determine the type and nnz of A (from a scalar or matrix) //-------------------------------------------------------------------------- // also determines if A is dense. The scalar is always dense. // mn = nI * nJ; valid only if mn_ok is true. GrB_Index mn ; bool mn_ok = GB_Index_multiply (&mn, nI, nJ) ; bool A_is_dense ; // true if A is dense (or scalar expansion) int64_t anz ; // nnz(A), or mn for scalar expansion GrB_Type atype ; // the type of A or the scalar if (scalar_expansion) { // The input is a scalar; the matrix A is not present. Scalar // expansion results in an implicit dense matrix A whose type is // defined by the scalar_code. ASSERT (A == NULL) ; ASSERT (scalar != NULL) ; anz = mn ; A_is_dense = true ; // a user-defined scalar is assumed to have the same type as C->type // which is also user-defined (or else it would not be compatible). // Compatibility has already been checked in the caller. The type of // scalar for built-in types is determined by scalar_code, instead, // since it can differ from C (in which case it is typecasted into // C->type). User-defined scalars cannot be typecasted. atype = GB_code_type (scalar_code, C->type) ; ASSERT_TYPE_OK (atype, "atype for scalar expansion", GB0) ; } else { // A is an nI-by-nJ matrix, with no pending computations ASSERT_MATRIX_OK (A, "A for subassign kernel", GB0) ; ASSERT (nI == A->vlen && nJ == A->vdim) ; ASSERT (!GB_PENDING (A)) ; ASSERT (!GB_ZOMBIES (A)) ; ASSERT (scalar == NULL) ; anz = GB_NNZ (A) ; A_is_dense = (mn_ok && anz == (int64_t) mn) ; atype = A->type ; } //-------------------------------------------------------------------------- // check the size of the mask //-------------------------------------------------------------------------- // For subassignment, the mask must be |I|-by-|J| if (M != NULL) { // M can have no pending tuples nor zombies ASSERT_MATRIX_OK (M, "M for subassign kernel", GB0) ; ASSERT (!GB_PENDING (M)) ; ASSERT (!GB_ZOMBIES (M)) ; ASSERT (nI == M->vlen && nJ == M->vdim) ; } //-------------------------------------------------------------------------- // C(:,:) assignment //-------------------------------------------------------------------------- // whole_C_matrix is true if all of C(:,:) is being assigned to bool whole_C_matrix = (Ikind == GB_ALL) && (Jkind == GB_ALL) ; bool C_splat_scalar = false ; // C(:,:) = x bool C_splat_matrix = false ; // C(:,:) = A if (whole_C_matrix && no_mask && (accum == NULL)) { //---------------------------------------------------------------------- // C(:,:) = x or A: whole matrix assignment with no mask //---------------------------------------------------------------------- if (scalar_expansion) { // Method 21: C(:,:) = x C_splat_scalar = true ; } else { // Method 24: C(:,:) = A C_splat_matrix = true ; } // C_replace is already effectively false (see no_mask case above) ASSERT (C_replace == false) ; // free pending tuples early but do not clear all of C. If it is // already dense then its pattern can be reused. GB_Pending_free (&(C->Pending)) ; } else if (whole_C_matrix && C_replace && (accum == NULL)) { //---------------------------------------------------------------------- // C(:,:)<any mask, replace> = A or x, no accum operator present //---------------------------------------------------------------------- // If the entire C(:,:) is being assigned to, and if no accum operator // is present, then the matrix can be cleared of all entries now, and // then C_replace can be set false. This can only be done because C is // not aliased to M or A on input. which the caller ensures is true. // See the assertion above. Clearing C now speeds up the assignment // since the wait on C can be skipped, below. It also simplifies the // kernels. If S is constructed, it is just an empty matrix. GB_OK (GB_clear (C, Context)) ; if (C_replace) { GBBURBLE ("(C cleared early) ") ; C_replace = false ; } // By clearing C now and setting C_replace to false, the following // methods are used: 09 becomes 05, 10 becomes 06n or 06s, 17 // becomes 13, and 18 becomes 14. The S matrix for methods 06s, // 13, and 14 is still created, but it is very fast to construct // and traverse since C is empty. Method 00 can be skipped since // C is already empty (see "quick" case below). // prior time new time action // ----- ---- --- ---- ------ // 00: O(S) nothing, O(1) C already cleared // 09: O(M+S) 05: O(M) C<M> = x, no S // 10: O((A+S)*log(m)) 06n: O(M*(log(a)) C<M> = A, no S // 06s: O(A*(log(m)) C<M> = A, with S // 17: O(m*n) 13: O(m*n) C<!M> = x, with S // 18: O(A*log(m)) 14: O(A*log(m)) C<!M> = A, with S // ===================== ============== // M cmp rpl acc A S method: action // ===================== ============== // M - - - - - 05: C(I,J)<M> = x, no S // M - - - A - 06n: C(I,J)<M> = A, no S // M - - - A S 06s: C(I,J)<M> = A, with S // M - r - - S 09: C(I,J)<M,repl> = x, with S // M - r - A S 10: C(I,J)<M,repl> = A, with S // M c - - - S 13: C(I,J)<!M> = x, with S // M c - - A S 14: C(I,J)<!M> = A, with S // M c r - - S 17: C(I,J)<!M,repl> = x, with S // M c r - A S 18: C(I,J)<!M,repl> = A, with S // Methods 09, 10, 17, and 18 are now used only if C(I,J) is a // submatrix of C, and not for the whole_C_matrix case. } //-------------------------------------------------------------------------- // check compatibilty of prior pending tuples //-------------------------------------------------------------------------- // The action: ( delete ), described below, can only delete a live // entry in the pattern. It cannot delete a pending tuple; pending tuples // cannot become zombies. Thus, if this call to GB_subassigner has the // potential for creating zombies, all prior pending tuples must be // assembled now. They thus become live entries in the pattern of C, so // that this GB_subassigner can (potentially) turn them into zombies via // action: ( delete ). // If accum is NULL, the operation is C(I,J) = A, or C(I,J)<M> = A. // If A has any implicit zeros at all, or if M is present, then // the action: ( delete ) is possible. This action is taken when an entry // is found in C but not A. It is thus not possible to check A in advance // if an entry in C must be deleted. If an entry does not appear in C but // appears as a pending tuple, deleting it would require a scan of all the // pending tuples in C. This is costly, and simply assembling all pending // tuples first is faster. // The action: ( insert ), described below, adds additional pending tuples. // All pending tuples will be assembled sometime later on, using a single // pending operator, and thus the current accum operator must match the // prior pending operator. If the operators do not match, then all prior // pending tuples must be assembled now, so that this GB_subassigner can // (potentially) insert new pending tuples whose pending operator is accum. // These tests are conservative because it is possible that this // GxB_subassign will not need to use action: ( insert ). // In the discussion below, let SECOND_Ctype denote the SECOND operator // z=f(x,y) whose ztype, xtype, and ytype matches the type of C. bool wait = false ; if (C->Pending == NULL) { //---------------------------------------------------------------------- // no pending tuples currently exist //---------------------------------------------------------------------- // If any new pending tuples are added, their pending operator is // accum, or the implicit SECOND_Ctype operator if accum is NULL. // The type of any pending tuples will become C->type. // Prior zombies have no effect on this decision. wait = false ; } else { //---------------------------------------------------------------------- // prior pending tuples exist: check if action: ( delete ) can occur //---------------------------------------------------------------------- // action: ( delete ) can only operate on entries in the pattern by // turning them into zombies. It cannot delete prior pending tuples. // Thus all prior pending tuples must be assembled first if // action: ( delete ) can occur. if (C_replace) { // C_replace must use the action: ( delete ) wait = true ; } else if (accum == NULL) { // This GxB_subassign can potentially use action: ( delete ), and // thus prior pending tuples must be assembled first. However, if // A is completely dense and if there is no mask M, then C(I,J)=A // cannot delete any entries from C. if (M == NULL && A_is_dense) { // A is a dense matrix, so entries cannot be deleted wait = false ; } else { // A is sparse or M is present. // In this case, action: ( delete ) might occur wait = true ; } } //---------------------------------------------------------------------- // check if pending operator is compatible //---------------------------------------------------------------------- if (!wait) { // ( delete ) will not occur, but new pending tuples may be added // via the action: ( insert ). Check if the accum operator is the // same as the prior pending operator and ensure the types are // the same. ASSERT (C->Pending != NULL) ; ASSERT (C->Pending->type != NULL) ; if (atype != C->Pending->type) { // entries in A are copied directly into the list of pending // tuples for C, with no typecasting. The type of the prior // pending tuples must match the type of A. Since the types // do not match, prior updates must be assembled first. wait = true ; } else if ( // the types match, now check the pending operator ! ( // the operators are the same (accum == C->Pending->op) // or both operators are SECOND_Ctype, implicit or explicit || (GB_op_is_second (accum, C->type) && GB_op_is_second (C->Pending->op, C->type)) ) ) { wait = true ; } } } if (wait) { // Prior computations are not compatible with this assignment, so all // prior work must be finished. This potentially costly. // delete any lingering zombies and assemble any pending tuples ASSERT_MATRIX_OK (C, "C before wait", GB0) ; GB_OK (GB_wait (C, Context)) ; } ASSERT_MATRIX_OK (C, "C before subassign", GB0) ; ASSERT_BINARYOP_OK_OR_NULL (accum, "accum for assign", GB0) ; //-------------------------------------------------------------------------- // check again if C is empty //-------------------------------------------------------------------------- // GB_clear or GB_wait, above, may have deleted all the zombies in C, so // check again if C is empty. C_is_empty = (GB_NNZ (C) == 0 && !GB_PENDING (C) && !GB_ZOMBIES (C)) ; if (C_is_empty) { // C is completely empty. C_replace is irrelevant, so set it to false. GBBURBLE ("(C empty) ") ; C_replace = false ; } //-------------------------------------------------------------------------- // check "quick" case again //-------------------------------------------------------------------------- if (empty_mask && !C_replace) { // The mask is empty (not present, but complemented), and C_replace is // now effectively false. If C_replace was false on input, then the // "quick" case above has already been triggered. However, if C is now // empty (either cleared with GB_clear, empty on input, or empty after // GB_wait), then C_replace is now effectively false. In this case, // the "quick" case can be checked again. No more work to do. GBBURBLE ("quick ") ; return (GrB_SUCCESS) ; } //-------------------------------------------------------------------------- // keep track of the current accum operator //-------------------------------------------------------------------------- // If accum is NULL and pending tuples are added, they will be assembled // sometime later (not here) using the implied SECOND_Ctype operator. This // GB_subassigner operation corresponds to C(I,J)=A or C(I,J)<M>=A. // Subsequent calls to GrB_setElement, and subsequent calls to GrB_assign // or GxB_subassign with an explict SECOND_Ctype operator, may create // additional pending tuples and add them to the list without requiring // that they be assembled first. // If accum is non-NULL, then all prior pending tuples have the same // pending operator as this accum. If that prior operator was the implicit // SECOND_Ctype and those pending tuples still exist, then this accum // operator is the explicit SECOND_ctype operator. The implicit // SECOND_Ctype operator is replaced with the current accum, which is the // explicit SECOND_Ctype operator. if (C->Pending != NULL) { C->Pending->op = accum ; } //-------------------------------------------------------------------------- // select the method to use //-------------------------------------------------------------------------- // check if C is competely dense: all entries present and no pending work. bool C_is_dense = !GB_PENDING_OR_ZOMBIES (C) && GB_is_dense (C) ; bool C_dense_update = false ; if (C_is_dense) { GBBURBLE ("(C dense) ") ; if (whole_C_matrix && no_mask && (accum != NULL) && (C->type == accum->ztype) && (C->type == accum->xtype)) { // C(:,:) += x or A, where C is dense, no typecasting of C C_dense_update = true ; } } // simple_mask: C(I,J)<M> = ... ; or C(I,J)<M> += ... bool simple_mask = (!C_replace && M != NULL && !Mask_comp) ; // C_Mask_scalar: C(I,J)<M> = scalar or += scalar bool C_Mask_scalar = (scalar_expansion && simple_mask) ; // C_Mask_matrix: C(I,J)<M> = A or += A bool C_Mask_matrix = (!scalar_expansion && simple_mask) ; bool S_Extraction ; if (empty_mask) { // The mask is not present, but complemented. // Method 00: C(I,J)<!,repl> = empty S_Extraction = true ; } else if (C_splat_scalar) { // Method 21: C(:,:) = x where x is a scalar; C becomes dense S_Extraction = false ; } else if (C_splat_matrix) { // Method 24: C(:,:) = A S_Extraction = false ; } else if (C_dense_update) { // Methods 22 and 23: C(:,:) += x or A where C is dense S_Extraction = false ; } else if (C_Mask_scalar) { // Method 05*, or 07: C(I,J)<M> = or += scalar; C_replace false S_Extraction = false ; } else if (C_Mask_matrix) { // C(I,J)<M> = A or += A if (accum != NULL) { // Method 08: C(I,J)<M> += A S_Extraction = false ; } else { // C(I,J)<M> = A ; use 06s (with S) or 06n (without S) // method 06s (with S) is faster when nnz (A) < nnz (M). // If M and A are aliased, then nnz (A) == nnz (M), so method // 06n is used. if (C_is_dense && whole_C_matrix && M == A) { // Method 06d: C<A> = A S_Extraction = false ; } else if (C_is_empty && whole_C_matrix && A_is_dense && Mask_struct) { // Method 25: C<M,s> = A, where M is structural, A is // dense, and C starts out empty. The pattern of C will be the // same as M, and the subassign method is extremely simple. S_Extraction = false ; } else { // Method 06n: or Method 06s: S_Extraction = (anz < GB_NNZ (M)) ; } } } else { // all other methods require S S_Extraction = true ; } //-------------------------------------------------------------------------- // extract the pattern: S = C(I,J) for S_Extraction method, and quick mask //-------------------------------------------------------------------------- // S is a sparse int64_t matrix. Its "values" are not numerical, but // indices into C. For example, suppose 100 = I [5] and 200 = J [7]. Then // S(5,7) is the entry C(I(5),J(7)), and the value of S(5,7) is the // position in C that holds that particular entry C(100,200): // pC = S->x [...] gives the location of the value C->x [pC] and row index // 100 = C->i [pC], and pC will be between C->p [200] ... C->p [200+1]-1 // if C is non-hypersparse. If C is hyperparse then pC will be still // reside inside the vector jC, in the range C->p [k] ... C->p [k+1]-1, // if jC is the kth non-empty vector in the hyperlist of C. if (S_Extraction) { //---------------------------------------------------------------------- // extract symbolic structure S=C(I,J) //---------------------------------------------------------------------- // FUTURE::: if whole_C_matrix is true, then C(:,:) = ... and S == C, // except that S is zombie-free, read-only; and C collects zombies. // FUTURE:: the properties of I and J are already known, and thus do // not need to be recomputed by GB_subref. // S and C have the same CSR/CSC format. S is always returned sorted, // in the same hypersparse form as C (unless S is empty, in which case // it is always returned as hypersparse). This also checks I and J. GB_OK (GB_subref (&S, C->is_csc, C, I, ni, J, nj, true, true, Context)); ASSERT_MATRIX_OK (C, "C for subref extraction", GB0) ; ASSERT_MATRIX_OK (S, "S for subref extraction", GB0) ; #ifdef GB_DEBUG const int64_t *GB_RESTRICT Si = S->i ; const int64_t *GB_RESTRICT Sx = S->x ; // this body of code explains what S contains. // S is nI-by-nJ where nI = length (I) and nJ = length (J) GBI_for_each_vector (S) { // prepare to iterate over the entries of vector S(:,jnew) GBI_jth_iteration (jnew, pS_start, pS_end) ; // S (inew,jnew) corresponds to C (iC, jC) ; // jC = J [j] ; or J is a colon expression int64_t jC = GB_ijlist (J, jnew, Jkind, Jcolon) ; for (int64_t pS = pS_start ; pS < pS_end ; pS++) { // S (inew,jnew) is a pointer back into C (I(inew), J(jnew)) int64_t inew = Si [pS] ; ASSERT (inew >= 0 && inew < nI) ; // iC = I [iA] ; or I is a colon expression int64_t iC = GB_ijlist (I, inew, Ikind, Icolon) ; int64_t p = Sx [pS] ; ASSERT (p >= 0 && p < GB_NNZ (C)) ; int64_t pC_start, pC_end, pleft = 0, pright = C->nvec-1 ; bool found = GB_lookup (C->is_hyper, C->h, C->p, &pleft, pright, jC, &pC_start, &pC_end) ; ASSERT (found) ; // If iC == I [inew] and jC == J [jnew], (or the equivaleent // for GB_ALL, GB_RANGE, GB_STRIDE) then A(inew,jnew) will be // assigned to C(iC,jC), and p = S(inew,jnew) gives the pointer // into C to where the entry (C(iC,jC) appears in C: ASSERT (pC_start <= p && p < pC_end) ; ASSERT (iC == GB_UNFLIP (C->i [p])) ; } } #endif } //========================================================================== // submatrix assignment C(I,J)<M> = accum (C(I,J),A): meta-algorithm //========================================================================== // There are up to 64 combinations of options, but not required to be // implemented, because they are either identical to another method // (C_replace is effectively false if M=NULL and Mask_comp=false), or they // are not used (the last option, whether or not S is constructed, is // determined here; it is not a user input). The first 5 options are // determined by the input. The table below has been pruned to remove // combinations that are not used, or equivalent to other entries in the // table. Only 22 unique combinations of the 64 combinations are needed, // with additional special cases when C(:,:) is dense. // M present or NULL // Mask_comp true or false // Mask_struct structural or valued mask // C_replace true or false // accum present or NULL // A scalar (x) or matrix (A) // S constructed or not // C(I,J)<(M,comp,repl)> ( = , += ) (A, scalar), (with or without S); // I and J can be anything for any of these methods (":", colon, or list). // See the "No work to do..." comment above: // If M is not present, Mask_comp true, C_replace false: no work to do. // If M is not present, Mask_comp true, C_replace true: use Method 00 // If M is not present, Mask_comp false: C_replace is now false. // ===================== ============== // M cmp rpl acc A S method: action // ===================== ============== // - - x - - - 21: C = x, no S, C anything // - - x - A - 24: C = A, no S, C and A anything // - - - + - - 22: C += x, no S, C dense // - - - + A - 23: C += A, no S, C dense // - - - - - S 01: C(I,J) = x, with S // - - - - A S 02: C(I,J) = A, with S // - - - + - S 03: C(I,J) += x, with S // - - - + A S 04: C(I,J) += A, with S // - - r uses methods 01, 02, 03, 04 // - c - no work to do // - c r S 00: C(I,J)<!,repl> = empty, with S // M - - - - - 05d: C<M> = x, no S, C dense // M - - - - - 05e: C<M,s> = x, no S, C empty // M - - - - - 05: C(I,J)<M> = x, no S // A - - - A - 06d: C<A> = A, no S, C dense // M - - - A - 20: C<M,s> = A, A dense, C empty // M - - - A - 06n: C(I,J)<M> = A, no S // M - - - A S 06s: C(I,J)<M> = A, with S // M - - + - - 07: C(I,J)<M> += x, no S // M - - + A - 08: C(I,J)<M> += A, no S // M - r - - S 09: C(I,J)<M,repl> = x, with S // M - r - A S 10: C(I,J)<M,repl> = A, with S // M - r + - S 11: C(I,J)<M,repl> += x, with S // M - r + A S 12: C(I,J)<M,repl> += A, with S // M c - - - S 13: C(I,J)<!M> = x, with S // M c - - A S 14: C(I,J)<!M> = A, with S // M c - + - S 15: C(I,J)<!M> += x, with S // M c - + A S 16: C(I,J)<!M> += A, with S // M c r - - S 17: C(I,J)<!M,repl> = x, with S // M c r - A S 18: C(I,J)<!M,repl> = A, with S // M c r + - S 19: C(I,J)<!M,repl> += x, with S // M c r + A S 20: C(I,J)<!M,repl> += A, with S //---------------------------------------------------------------------- // FUTURE::: C<C,s> = x C == M, replace all values, C_replace ignored // FUTURE::: C<C,s> += x C == M, update all values, C_replace ignored // FUTURE::: C<C,s> = A C == M, A dense, C_replace ignored //---------------------------------------------------------------------- // For the single case C(I,J)<M>=A, two methods can be used: 06n and 06s. #define Istring ((Ikind == GB_ALL) ? ":" : "I") #define Jstring ((Jkind == GB_ALL) ? ":" : "I") if (empty_mask) { //---------------------------------------------------------------------- // C(I,J)<!,repl> = empty //---------------------------------------------------------------------- // ===================== ============== // M cmp rpl acc A S method: action // ===================== ============== // - c r S 00: C(I,J)<!,repl> = empty, with S ASSERT (C_replace) ; ASSERT (S != NULL) ; // Method 00: C(I,J) = empty ; using S GBBURBLE ("Method 00: C(%s,%s) = empty ; using S ", Istring, Jstring) ; GB_OK (GB_subassign_00 (C, I, nI, Ikind, Icolon, J, nJ, Jkind, Jcolon, S, Context)) ; } else if (C_splat_scalar) { //---------------------------------------------------------------------- // C = x where x is a scalar; C becomes dense //---------------------------------------------------------------------- // ===================== ============== // M cmp rpl acc A S method: action // ===================== ============== // - - x - - - 21: C = x, no S, C anything ASSERT (whole_C_matrix) ; // C(:,:) is modified ASSERT (M == NULL) ; // no mask present ASSERT (accum == NULL) ; // accum is not present ASSERT (!C_replace) ; // C_replace is effectively false ASSERT (S == NULL) ; // S is not used ASSERT (scalar_expansion) ; // x is a scalar // Method 21: C = x where x is a scalar; C becomes dense GBBURBLE ("Method 21: (C dense) = scalar ") ; GB_OK (GB_dense_subassign_21 (C, scalar, atype, Context)) ; } else if (C_splat_matrix) { //---------------------------------------------------------------------- // C = A //---------------------------------------------------------------------- // ===================== ============== // M cmp rpl acc A S method: action // ===================== ============== // - - x - A - 24: C = A, no S, C and A anything ASSERT (whole_C_matrix) ; // C(:,:) is modified ASSERT (M == NULL) ; // no mask present ASSERT (accum == NULL) ; // accum is not present ASSERT (!C_replace) ; // C_replace is effectively false ASSERT (S == NULL) ; // S is not used ASSERT (!scalar_expansion) ; // A is a matrix // Method 24: C = A GBBURBLE ("Method 24: C = Z ") ; GB_OK (GB_dense_subassign_24 (C, A, Context)) ; } else if (C_dense_update) { //---------------------------------------------------------------------- // C += A or x where C is dense //---------------------------------------------------------------------- // ===================== ============== // M cmp rpl acc A S method: action // ===================== ============== // - - - + - - 22: C += x, no S, C dense // - - - + A - 23: C += A, no S, C dense ASSERT (C_is_dense) ; // C is dense ASSERT (whole_C_matrix) ; // C(:,:) is modified ASSERT (M == NULL) ; // no mask present ASSERT (accum != NULL) ; // accum is present ASSERT (!C_replace) ; // C_replace is false ASSERT (S == NULL) ; // S is not used if (scalar_expansion) { // Method 22: C(:,:) += x where C is dense GBBURBLE ("Method 22: (C dense) += scalar ") ; GB_OK (GB_dense_subassign_22 (C, scalar, atype, accum, Context)) ; } else { // Method 23: C(:,:) += A where C is dense GBBURBLE ("Method 23: (C dense) += Z ") ; GB_OK (GB_dense_subassign_23 (C, A, accum, Context)) ; } } else if (C_Mask_scalar) { //---------------------------------------------------------------------- // C(I,J)<M> = scalar or +=scalar //---------------------------------------------------------------------- // ===================== ============== // M cmp rpl acc A S method: action // ===================== ============== // M - - - - - 05d: C(:,:)<M> = x, no S, C dense // M - - - - - 05e: C(:,:)<M,s> = x, no S, C empty // M - - - - - 05: C(I,J)<M> = x, no S // M - - + - - 07: C(I,J)<M> += x, no S ASSERT (scalar_expansion) ; // A is a scalar ASSERT (M != NULL && !Mask_comp) ; // mask M present, not compl. ASSERT (!C_replace) ; // C_replace is false ASSERT (S == NULL) ; // S is not used if (accum == NULL) { if (C_is_empty && whole_C_matrix && Mask_struct) { // Method 05e: C(:,:)<M> = scalar ; no S; C empty, M structural GBBURBLE ("Method 05e: (C empty)<M> = scalar ") ; GB_OK (GB_subassign_05e (C, M, scalar, atype, Context)) ; } else if (C_is_dense && whole_C_matrix) { // Method 05d: C(:,:)<M> = scalar ; no S; C is dense GBBURBLE ("Method 05d: (C dense)<M> = scalar ") ; GB_OK (GB_dense_subassign_05d (C, M, Mask_struct, scalar, atype, Context)) ; } else { // Method 05: C(I,J)<M> = scalar ; no S GBBURBLE ("Method 05: C(%s,%s)<M> = scalar ; no S ", Istring, Jstring) ; GB_OK (GB_subassign_05 (C, I, nI, Ikind, Icolon, J, nJ, Jkind, Jcolon, M, Mask_struct, scalar, atype, Context)) ; } } else { // Method 07: C(I,J)<M> += scalar ; no S GBBURBLE ("Method 07: C(%s,%s)<M> += scalar ; no S", Istring, Jstring) ; GB_OK (GB_subassign_07 (C, I, nI, Ikind, Icolon, J, nJ, Jkind, Jcolon, M, Mask_struct, accum, scalar, atype, Context)) ; } } else if (C_Mask_matrix) { //---------------------------------------------------------------------- // C(I,J)<M> = A or += A //---------------------------------------------------------------------- // ===================== ============== // M cmp rpl acc A S method: action // ===================== ============== // M - - + A - 08: C(I,J)<M> += A, no S // A - - - A - 06d: C<A> = A, no S, C dense // M - x - A - 25: C<M,s> = A, A dense, C empty // M - - - A - 06n: C(I,J)<M> = A, no S // M - - - A S 06s: C(I,J)<M> = A, with S ASSERT (!scalar_expansion) ; // A is a matrix ASSERT (M != NULL && !Mask_comp) ; // mask M present, not compl. ASSERT (!C_replace) ; if (accum != NULL) { // Method 08: C(I,J)<M> += A ; no S GBBURBLE ("Method 08: C(%s,%s)<M> += Z ; no S ", Istring, Jstring) ; ASSERT (S == NULL) ; GB_OK (GB_subassign_08 (C, I, nI, Ikind, Icolon, J, nJ, Jkind, Jcolon, M, Mask_struct, accum, A, Context)) ; } else if (C_is_dense && whole_C_matrix && M == A) { // Method 06d: C(:,:)<A> = A ; no S, C dense GBBURBLE ("Method 06d: (C dense)<Z> = Z ") ; GB_OK (GB_dense_subassign_06d (C, A, Mask_struct, Context)) ; } else if (C_is_empty && whole_C_matrix && A_is_dense && Mask_struct) { GBBURBLE ("Method 25: (C empty)<M> = (Z dense) ") ; GB_OK (GB_dense_subassign_25 (C, M, A, Context)) ; } else if (S == NULL) { // Method 06n: C(I,J)<M> = A ; no S GBBURBLE ("Method 06n: C(%s,%s)<M> = Z ; no S ", Istring, Jstring) ; GB_OK (GB_subassign_06n (C, I, nI, Ikind, Icolon, J, nJ, Jkind, Jcolon, M, Mask_struct, A, Context)) ; } else { // Method 06s: C(I,J)<M> = A ; using S GBBURBLE ("Method 06s: C(%s,%s)<M> = Z ; using S ", Istring, Jstring) ; GB_OK (GB_subassign_06s (C, I, nI, Ikind, Icolon, J, nJ, Jkind, Jcolon, M, Mask_struct, A, S, Context)) ; } } else if (M == NULL) { //---------------------------------------------------------------------- // assignment using S_Extraction method, no mask M //---------------------------------------------------------------------- // ===================== ============== // M cmp rpl acc A S method: action // ===================== ============== // - - - - - S 01: C(I,J) = x, with S // - - - - A S 02: C(I,J) = A, with S // - - - + - S 03: C(I,J) += x, with S // - - - + A S 04: C(I,J) += A, with S ASSERT (!Mask_comp) ; ASSERT (!C_replace) ; ASSERT (S != NULL) ; if (scalar_expansion) { if (accum == NULL) { // Method 01: C(I,J) = scalar ; using S GBBURBLE ("Method 01: C(%s,%s) = scalar ; using S ", Istring, Jstring) ; GB_OK (GB_subassign_01 (C, I, nI, Ikind, Icolon, J, nJ, Jkind, Jcolon, scalar, atype, S, Context)) ; } else { // Method 03: C(I,J) += scalar ; using S GBBURBLE ("Method 03: C(%s,%s) += scalar ; using S ", Istring, Jstring) ; GB_OK (GB_subassign_03 (C, I, nI, Ikind, Icolon, J, nJ, Jkind, Jcolon, accum, scalar, atype, S, Context)) ; } } else { if (accum == NULL) { // Method 02: C(I,J) = A ; using S GBBURBLE ("Method 02: C(%s,%s) = Z ; using S ", Istring, Jstring) ; GB_OK (GB_subassign_02 (C, I, nI, Ikind, Icolon, J, nJ, Jkind, Jcolon, A, S, Context)) ; } else { // Method 04: C(I,J) += A ; using S GBBURBLE ("Method 04: C(%s,%s) += Z ; using S ", Istring, Jstring) ; GB_OK (GB_subassign_04 (C, I, nI, Ikind, Icolon, J, nJ, Jkind, Jcolon, accum, A, S, Context)) ; } } } else if (scalar_expansion) { //---------------------------------------------------------------------- // C(I,J)<#M> = scalar or += scalar ; using S //---------------------------------------------------------------------- // ===================== ============== // M cmp rpl acc A S method: action // ===================== ============== // M - r - - S 09: C(I,J)<M,repl> = x, with S // M - r + - S 11: C(I,J)<M,repl> += x, with S // M c - - - S 13: C(I,J)<!M> = x, with S // M c - + - S 15: C(I,J)<!M> += x, with S // M c r - - S 17: C(I,J)<!M,repl> = x, with S // M c r + - S 19: C(I,J)<!M,repl> += x, with S ASSERT (!C_Mask_scalar) ; ASSERT (C_replace || Mask_comp) ; ASSERT (S != NULL) ; if (accum == NULL) { if (Mask_comp && C_replace) { // Method 17: C(I,J)<!M,repl> = scalar ; using S GBBURBLE ("Method 17: C(%s,%s)<!M,repl> = scalar ; using S ", Istring, Jstring) ; GB_OK (GB_subassign_17 (C, I, nI, Ikind, Icolon, J, nJ, Jkind, Jcolon, M, Mask_struct, scalar, atype, S, Context)) ; } else if (Mask_comp) { // Method 13: C(I,J)<!M> = scalar ; using S GBBURBLE ("Method 13: C(%s,%s)<!M> = scalar ; using S ", Istring, Jstring) ; GB_OK (GB_subassign_13 (C, I, nI, Ikind, Icolon, J, nJ, Jkind, Jcolon, M, Mask_struct, scalar, atype, S, Context)) ; } else // if (C_replace) { // Method 09: C(I,J)<M,repl> = scalar ; using S GBBURBLE ("Method 09: C(%s,%s)<M,repl> = scalar ; using S ", Istring, Jstring) ; ASSERT (C_replace) ; GB_OK (GB_subassign_09 (C, I, nI, Ikind, Icolon, J, nJ, Jkind, Jcolon, M, Mask_struct, scalar, atype, S, Context)) ; } } else { if (Mask_comp && C_replace) { // Method 19: C(I,J)<!M,repl> += scalar ; using S GBBURBLE ("Method 19: C(%s,%s)<!M,repl> += scalar ; using S ", Istring, Jstring) ; GB_OK (GB_subassign_19 (C, I, nI, Ikind, Icolon, J, nJ, Jkind, Jcolon, M, Mask_struct, accum, scalar, atype, S, Context)) ; } else if (Mask_comp) { // Method 15: C(I,J)<!M> += scalar ; using S GBBURBLE ("Method 15: C(%s,%s)<!M> += scalar ; using S ", Istring, Jstring) ; GB_OK (GB_subassign_15 (C, I, nI, Ikind, Icolon, J, nJ, Jkind, Jcolon, M, Mask_struct, accum, scalar, atype, S, Context)) ; } else // if (C_replace) { // Method 11: C(I,J)<M,repl> += scalar ; using S GBBURBLE ("Method 11: C(%s,%s)<M,repl> += scalar ; using S ", Istring, Jstring) ; ASSERT (C_replace) ; GB_OK (GB_subassign_11 (C, I, nI, Ikind, Icolon, J, nJ, Jkind, Jcolon, M, Mask_struct, accum, scalar, atype, S, Context)) ; } } } else { //------------------------------------------------------------------ // C(I,J)<#M> = A or += A ; using S //------------------------------------------------------------------ // ===================== ============== // M cmp rpl acc A S method: action // ===================== ============== // M - r - A S 10: C(I,J)<M,repl> = A, with S // M - r + A S 12: C(I,J)<M,repl> += A, with S // M c - - A S 14: C(I,J)<!M> = A, with S // M c - + A S 16: C(I,J)<!M> += A, with S // M c r - A S 18: C(I,J)<!M,repl> = A, with S // M c r + A S 20: C(I,J)<!M,repl> += A, with S ASSERT (Mask_comp || C_replace) ; ASSERT (S != NULL) ; if (accum == NULL) { if (Mask_comp && C_replace) { // Method 18: C(I,J)<!M,repl> = A ; using S GBBURBLE ("Method 18: C(%s,%s)<!M,repl> = Z ; using S ", Istring, Jstring) ; GB_OK (GB_subassign_18 (C, I, nI, Ikind, Icolon, J, nJ, Jkind, Jcolon, M, Mask_struct, A, S, Context)) ; } else if (Mask_comp) { // Method 14: C(I,J)<!M> = A ; using S GBBURBLE ("Method 14: C(%s,%s)<!M> = Z ; using S ", Istring, Jstring) ; GB_OK (GB_subassign_14 (C, I, nI, Ikind, Icolon, J, nJ, Jkind, Jcolon, M, Mask_struct, A, S, Context)) ; } else // if (C_replace) { // Method 10: C(I,J)<M,repl> = A ; using S GBBURBLE ("Method 10: C(%s,%s)<M,repl> = Z ; using S ", Istring, Jstring) ; ASSERT (C_replace) ; GB_OK (GB_subassign_10 (C, I, nI, Ikind, Icolon, J, nJ, Jkind, Jcolon, M, Mask_struct, A, S, Context)) ; } } else { if (Mask_comp && C_replace) { // Method 20: C(I,J)<!M,repl> += A ; using S GBBURBLE ("Method 20: C(%s,%s)<!M,repl> += Z ; using S ", Istring, Jstring) ; GB_OK (GB_subassign_20 (C, I, nI, Ikind, Icolon, J, nJ, Jkind, Jcolon, M, Mask_struct, accum, A, S, Context)) ; } else if (Mask_comp) { // Method 16: C(I,J)<!M> += A ; using S GBBURBLE ("Method 16: C(%s,%s)<!M> += Z ; using S ", Istring, Jstring) ; GB_OK (GB_subassign_16 (C, I, nI, Ikind, Icolon, J, nJ, Jkind, Jcolon, M, Mask_struct, accum, A, S, Context)) ; } else // if (C_replace) { // Method 12: C(I,J)<M,repl> += A ; using S GBBURBLE ("Method 12: C(%s,%s)<M,repl> += Z ; using S ", Istring, Jstring) ; ASSERT (C_replace) ; GB_OK (GB_subassign_12 (C, I, nI, Ikind, Icolon, J, nJ, Jkind, Jcolon, M, Mask_struct, accum, A, S, Context)) ; } // note that C(I,J)<M> += A always uses method 6b, without S. } } //-------------------------------------------------------------------------- // free workspace //-------------------------------------------------------------------------- GB_FREE_WORK ; //-------------------------------------------------------------------------- // insert C in the queue if it has work to do and isn't already queued //-------------------------------------------------------------------------- if (C->nzombies == 0 && C->Pending == NULL) { // C may be in the queue from a prior assignment, but this assignemt // can bring zombies back to life, and the zombie count can go to zero. // In that case, C must be removed from the queue. The removal does // nothing if C is already not in the queue. // FUTURE:: this might cause thrashing if lots of assigns or // setElements are done in parallel. Instead, leave the matrix in the // queue, and allow matrices to be in the queue even if they have no // unfinished computations. See also GB_setElement. GB_CRITICAL (GB_queue_remove (C)) ; } else { // If C has any zombies or pending tuples, it must be in the queue. // The queue insert does nothing if C is already in the queue. GB_CRITICAL (GB_queue_insert (C)) ; } //-------------------------------------------------------------------------- // finalize C and return result //-------------------------------------------------------------------------- ASSERT_MATRIX_OK (C, "C(I,J) result", GB0) ; return (GB_block (C, Context)) ; }
{ "pile_set_name": "Github" }
define(["../../../vaadin-text-field/theme/lumo/vaadin-text-field.js", "../../src/vaadin-grid-filter.js"], function (_vaadinTextField, _vaadinGridFilter) { "use strict"; });
{ "pile_set_name": "Github" }
2 3 2 2 1 0 scal4p48_x1.c "R. Clint Whaley" 1 2 2 0 0 scal1_x0.c "R. Clint Whaley"
{ "pile_set_name": "Github" }
<?php /* * This file is part of the Symfony package. * * (c) Fabien Potencier <[email protected]> * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ namespace Symfony\Component\Validator\Constraints; use Symfony\Component\Validator\Constraint; use Symfony\Component\Validator\ConstraintValidator; use Symfony\Component\Validator\Exception\UnexpectedTypeException; /** * @author Bernhard Schussek <[email protected]> */ class AllValidator extends ConstraintValidator { /** * {@inheritdoc} */ public function validate($value, Constraint $constraint) { if (!$constraint instanceof All) { throw new UnexpectedTypeException($constraint, All::class); } if (null === $value) { return; } if (!\is_array($value) && !$value instanceof \Traversable) { throw new UnexpectedTypeException($value, 'array or Traversable'); } $context = $this->context; $validator = $context->getValidator()->inContext($context); foreach ($value as $key => $element) { $validator->atPath('['.$key.']')->validate($element, $constraint->constraints); } } }
{ "pile_set_name": "Github" }
--- Description: . ms.assetid: bcc632ab-277a-492c-86d2-1450dc97b4c5 title: System.Contact.OtherAddress3Street ms.topic: article ms.date: 05/31/2018 --- # System.Contact.OtherAddress3Street ## Windows 10, version 1703, Windows 10, version 1607, Windows 10, version 1511, Windows 10, version 1507, Windows 8.1 ``` propertyDescription    name = System.Contact.OtherAddress3Street    shellPKey = PKEY_Contact_OtherAddress3Street    formatID = A7B6F596-D678-4BC1-B05F-0203D27E8AA1    propID = 141    SearchInfo       InInvertedIndex = true       IsColumn = true    typeInfo       type = String ``` ## Remarks PKEY values are defined in Propkey.h. ## Related topics <dl> <dt> [propertyDescription](./propdesc-schema-propertydescription.md) </dt> <dt> [searchInfo](./propdesc-schema-searchinfo.md) </dt> <dt> [labelInfo](./propdesc-schema-labelinfo.md) </dt> <dt> [typeInfo](./propdesc-schema-typeinfo.md) </dt> <dt> [displayInfo](./propdesc-schema-displayinfo.md) </dt> <dt> [stringFormat](./propdesc-schema-stringformat.md) </dt> <dt> [booleanFormat](./propdesc-schema-booleanformat.md) </dt> <dt> [numberFormat](./propdesc-schema-numberformat.md) </dt> <dt> [dateTimeFormat](./propdesc-schema-datetimeformat.md) </dt> <dt> [enumeratedList](./propdesc-schema-enumeratedlist.md) </dt> <dt> [drawControl](./propdesc-schema-drawcontrol.md) </dt> <dt> [editControl](./propdesc-schema-editcontrol.md) </dt> <dt> [filterControl](./propdesc-schema-filtercontrol.md) </dt> <dt> [queryControl](./propdesc-schema-querycontrol.md) </dt> </dl>    
{ "pile_set_name": "Github" }
@import "~office-ui-fabric-react/dist/sass/References.scss"; .renderMemberItem { display: flex; padding-left: 10px; padding-right: 10px; padding-top: 5px; padding-bottom: 5px; width: "100%"; justify-content: start; align-items: center; } .renderMemberItem:hover { background-color: $ms-color-neutralLight; } .calloutContent { height: 300px; padding: 0 10px 10px 10px; margin-bottom: 10px; overflow: auto; display: block; } .calloutHeader { padding: 10px 10px 15px 10px; } .membersContainer { max-height: 250px; height: 200px; overflow: auto; margin: 5px; } .assignsContainer { max-height: 250px; overflow: auto; margin: 5px; }
{ "pile_set_name": "Github" }
<!DOCTYPE html> <!-- Copyright (c) 2003-2016, CKSource - Frederico Knabben. All rights reserved. For licensing, see LICENSE.md or http://ckeditor.com/license --> <html> <head> <meta charset="utf-8"> <title>Full Page Editing &mdash; CKEditor Sample</title> <script src="../../../ckeditor.js"></script> <script src="../../../samples/old/sample.js"></script> <link rel="stylesheet" href="../../../samples/old/sample.css"> <meta name="ckeditor-sample-required-plugins" content="sourcearea"> <meta name="ckeditor-sample-name" content="Full page support"> <meta name="ckeditor-sample-group" content="Plugins"> <meta name="ckeditor-sample-description" content="CKEditor inserted with a JavaScript call and used to edit the whole page from &lt;html&gt; to &lt;/html&gt;."> </head> <body> <h1 class="samples"> <a href="../../../samples/old/index.html">CKEditor Samples</a> &raquo; Full Page Editing </h1> <div class="warning deprecated"> This sample is not maintained anymore. Check out its <a href="http://sdk.ckeditor.com/samples/fullpage.html">brand new version in CKEditor SDK</a>. </div> <div class="description"> <p> This sample shows how to configure CKEditor to edit entire HTML pages, from the <code>&lt;html&gt;</code> tag to the <code>&lt;/html&gt;</code> tag. </p> <p> The CKEditor instance below is inserted with a JavaScript call using the following code: </p> <pre class="samples"> CKEDITOR.replace( '<em>textarea_id</em>', { <strong>fullPage: true</strong>, <strong>allowedContent: true</strong> }); </pre> <p> Note that <code><em>textarea_id</em></code> in the code above is the <code>id</code> attribute of the <code>&lt;textarea&gt;</code> element to be replaced. </p> <p> The <code><em>allowedContent</em></code> in the code above is set to <code>true</code> to disable content filtering. Setting this option is not obligatory, but in full page mode there is a strong chance that one may want be able to freely enter any HTML content in source mode without any limitations. </p> </div> <form action="../../../samples/sample_posteddata.php" method="post"> <label for="editor1"> CKEditor output the entire page including content outside of <code>&lt;body&gt;</code> element, so content like meta and title can be changed: </label> <textarea cols="80" id="editor1" name="editor1" rows="10"> &lt;h1&gt;&lt;img align=&quot;right&quot; alt=&quot;Saturn V carrying Apollo 11&quot; src=&quot;../../../samples/old/assets/sample.jpg&quot;/&gt; Apollo 11&lt;/h1&gt; &lt;p&gt;&lt;b&gt;Apollo 11&lt;/b&gt; was the spaceflight that landed the first humans, Americans &lt;a href=&quot;http://en.wikipedia.org/wiki/Neil_Armstrong&quot; title=&quot;Neil Armstrong&quot;&gt;Neil Armstrong&lt;/a&gt; and &lt;a href=&quot;http://en.wikipedia.org/wiki/Buzz_Aldrin&quot; title=&quot;Buzz Aldrin&quot;&gt;Buzz Aldrin&lt;/a&gt;, on the Moon on July 20, 1969, at 20:18 UTC. Armstrong became the first to step onto the lunar surface 6 hours later on July 21 at 02:56 UTC.&lt;/p&gt; &lt;p&gt;Armstrong spent about &lt;s&gt;three and a half&lt;/s&gt; two and a half hours outside the spacecraft, Aldrin slightly less; and together they collected 47.5 pounds (21.5&amp;nbsp;kg) of lunar material for return to Earth. A third member of the mission, &lt;a href=&quot;http://en.wikipedia.org/wiki/Michael_Collins_(astronaut)&quot; title=&quot;Michael Collins (astronaut)&quot;&gt;Michael Collins&lt;/a&gt;, piloted the &lt;a href=&quot;http://en.wikipedia.org/wiki/Apollo_Command/Service_Module&quot; title=&quot;Apollo Command/Service Module&quot;&gt;command&lt;/a&gt; spacecraft alone in lunar orbit until Armstrong and Aldrin returned to it for the trip back to Earth.&lt;/p&gt; &lt;h2&gt;Broadcasting and &lt;em&gt;quotes&lt;/em&gt; &lt;a id=&quot;quotes&quot; name=&quot;quotes&quot;&gt;&lt;/a&gt;&lt;/h2&gt; &lt;p&gt;Broadcast on live TV to a world-wide audience, Armstrong stepped onto the lunar surface and described the event as:&lt;/p&gt; &lt;blockquote&gt;&lt;p&gt;One small step for [a] man, one giant leap for mankind.&lt;/p&gt;&lt;/blockquote&gt; &lt;p&gt;Apollo 11 effectively ended the &lt;a href=&quot;http://en.wikipedia.org/wiki/Space_Race&quot; title=&quot;Space Race&quot;&gt;Space Race&lt;/a&gt; and fulfilled a national goal proposed in 1961 by the late U.S. President &lt;a href=&quot;http://en.wikipedia.org/wiki/John_F._Kennedy&quot; title=&quot;John F. Kennedy&quot;&gt;John F. Kennedy&lt;/a&gt; in a speech before the United States Congress:&lt;/p&gt; &lt;blockquote&gt;&lt;p&gt;[...] before this decade is out, of landing a man on the Moon and returning him safely to the Earth.&lt;/p&gt;&lt;/blockquote&gt; &lt;h2&gt;Technical details &lt;a id=&quot;tech-details&quot; name=&quot;tech-details&quot;&gt;&lt;/a&gt;&lt;/h2&gt; &lt;table align=&quot;right&quot; border=&quot;1&quot; bordercolor=&quot;#ccc&quot; cellpadding=&quot;5&quot; cellspacing=&quot;0&quot; style=&quot;border-collapse:collapse;margin:10px 0 10px 15px;&quot;&gt; &lt;caption&gt;&lt;strong&gt;Mission crew&lt;/strong&gt;&lt;/caption&gt; &lt;thead&gt; &lt;tr&gt; &lt;th scope=&quot;col&quot;&gt;Position&lt;/th&gt; &lt;th scope=&quot;col&quot;&gt;Astronaut&lt;/th&gt; &lt;/tr&gt; &lt;/thead&gt; &lt;tbody&gt; &lt;tr&gt; &lt;td&gt;Commander&lt;/td&gt; &lt;td&gt;Neil A. Armstrong&lt;/td&gt; &lt;/tr&gt; &lt;tr&gt; &lt;td&gt;Command Module Pilot&lt;/td&gt; &lt;td&gt;Michael Collins&lt;/td&gt; &lt;/tr&gt; &lt;tr&gt; &lt;td&gt;Lunar Module Pilot&lt;/td&gt; &lt;td&gt;Edwin &amp;quot;Buzz&amp;quot; E. Aldrin, Jr.&lt;/td&gt; &lt;/tr&gt; &lt;/tbody&gt; &lt;/table&gt; &lt;p&gt;Launched by a &lt;strong&gt;Saturn V&lt;/strong&gt; rocket from &lt;a href=&quot;http://en.wikipedia.org/wiki/Kennedy_Space_Center&quot; title=&quot;Kennedy Space Center&quot;&gt;Kennedy Space Center&lt;/a&gt; in Merritt Island, Florida on July 16, Apollo 11 was the fifth manned mission of &lt;a href=&quot;http://en.wikipedia.org/wiki/NASA&quot; title=&quot;NASA&quot;&gt;NASA&lt;/a&gt;&amp;#39;s Apollo program. The Apollo spacecraft had three parts:&lt;/p&gt; &lt;ol&gt; &lt;li&gt;&lt;strong&gt;Command Module&lt;/strong&gt; with a cabin for the three astronauts which was the only part which landed back on Earth&lt;/li&gt; &lt;li&gt;&lt;strong&gt;Service Module&lt;/strong&gt; which supported the Command Module with propulsion, electrical power, oxygen and water&lt;/li&gt; &lt;li&gt;&lt;strong&gt;Lunar Module&lt;/strong&gt; for landing on the Moon.&lt;/li&gt; &lt;/ol&gt; &lt;p&gt;After being sent to the Moon by the Saturn V&amp;#39;s upper stage, the astronauts separated the spacecraft from it and travelled for three days until they entered into lunar orbit. Armstrong and Aldrin then moved into the Lunar Module and landed in the &lt;a href=&quot;http://en.wikipedia.org/wiki/Mare_Tranquillitatis&quot; title=&quot;Mare Tranquillitatis&quot;&gt;Sea of Tranquility&lt;/a&gt;. They stayed a total of about 21 and a half hours on the lunar surface. After lifting off in the upper part of the Lunar Module and rejoining Collins in the Command Module, they returned to Earth and landed in the &lt;a href=&quot;http://en.wikipedia.org/wiki/Pacific_Ocean&quot; title=&quot;Pacific Ocean&quot;&gt;Pacific Ocean&lt;/a&gt; on July 24.&lt;/p&gt; &lt;hr/&gt; &lt;p style=&quot;text-align: right;&quot;&gt;&lt;small&gt;Source: &lt;a href=&quot;http://en.wikipedia.org/wiki/Apollo_11&quot;&gt;Wikipedia.org&lt;/a&gt;&lt;/small&gt;&lt;/p&gt; </textarea> <script> CKEDITOR.replace( 'editor1', { fullPage: true, allowedContent: true, extraPlugins: 'wysiwygarea' }); </script> <p> <input type="submit" value="Submit"> </p> </form> <div id="footer"> <hr> <p> CKEditor - The text editor for the Internet - <a class="samples" href="http://ckeditor.com/">http://ckeditor.com</a> </p> <p id="copy"> Copyright &copy; 2003-2016, <a class="samples" href="http://cksource.com/">CKSource</a> - Frederico Knabben. All rights reserved. </p> </div> </body> </html>
{ "pile_set_name": "Github" }
fileFormatVersion: 2 guid: ad956bac3800e2347b757d68a78545fe folderAsset: yes timeCreated: 1515511351 licenseType: Pro DefaultImporter: externalObjects: {} userData: assetBundleName: assetBundleVariant:
{ "pile_set_name": "Github" }
@{ //page title ViewBag.Title = T("Admin.System.Templates.Category").Text; } <div class="row"> <div class="col-md-12"> <div class="x_panel light form-fit"> <div class="x_title"> <div class="caption level-caption"> <i class="fa fa-tasks"></i> @T("Admin.System.Templates.Category") </div> <vc:admin-widget widget-zone="category_template_list_buttons" additional-data="null" /> </div> <div class="x_content form"> <div class="form-horizontal"> <div class="form-body"> <div class="x_content"> <div id="templates-grid"></div> </div> </div> </div> </div> </div> </div> </div> <script> $(document).ready(function () { $("#templates-grid").kendoGrid({ dataSource: { transport: { read: { url: "@Html.Raw(Url.Action("CategoryTemplates", "Template"))", type: "POST", dataType: "json", data: addAntiForgeryToken }, create: { url: "@Html.Raw(Url.Action("CategoryTemplateAdd", "Template"))", type: "POST", dataType: "json", data: addAntiForgeryToken }, update: { url:"@Html.Raw(Url.Action("CategoryTemplateUpdate", "Template"))", type: "POST", dataType: "json", data: addAntiForgeryToken }, destroy: { url: "@Html.Raw(Url.Action("CategoryTemplateDelete", "Template"))", type: "POST", dataType: "json", data: addAntiForgeryToken } }, schema: { data: "Data", total: "Total", errors: "Errors", model: { id: "Id", fields: { Name: { editable: true, type: "string" }, ViewPath: { editable: true, type: "string" }, DisplayOrder: { editable: true, type: "number" }, Id: { editable: false, type: "string" } } } }, requestEnd: function (e) { if (e.type == "create" || e.type == "update") { this.read(); } }, error: function (e) { display_kendoui_grid_error(e); // Cancel the changes this.cancelChanges(); }, serverPaging: true, serverFiltering: true, serverSorting: true }, pageable: { refresh: true, numeric: false, previousNext: false, info: false }, toolbar: [{ name: "create", text: "@T("Admin.Common.AddNewRecord")" }], editable: { confirmation: false, mode: "inline" }, scrollable: false, columns: [{ field: "Name", title: "@T("Admin.System.Templates.Category.Name")", width: 300 }, { field: "ViewPath", title: "@T("Admin.System.Templates.Category.ViewPath")", width: 300 }, { field: "DisplayOrder", title: "@T("Admin.System.Templates.Category.DisplayOrder")", //integer format format: "{0:0}", width: 100 }, { command: [{ name: "edit", text: { edit: "@T("Admin.Common.Edit")", update: "@T("Admin.Common.Update")", cancel: "@T("Admin.Common.Cancel")" } }, { name: "destroy", text: "@T("Admin.Common.Delete")" }], width: 200 }] }); }); </script>
{ "pile_set_name": "Github" }
/*************************************************************************** # Copyright (c) 2018, NVIDIA CORPORATION. All rights reserved. # # Redistribution and use in source and binary forms, with or without # modification, are permitted provided that the following conditions # are met: # * Redistributions of source code must retain the above copyright # notice, this list of conditions and the following disclaimer. # * Redistributions in binary form must reproduce the above copyright # notice, this list of conditions and the following disclaimer in the # documentation and/or other materials provided with the distribution. # * Neither the name of NVIDIA CORPORATION nor the names of its # contributors may be used to endorse or promote products derived # from this software without specific prior written permission. # # THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS ``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 OWNER 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. ***************************************************************************/ #pragma once #include "Framework.h" class Tutorial09 : public Tutorial { public: void onLoad(HWND winHandle, uint32_t winWidth, uint32_t winHeight) override; void onFrameRender() override; void onShutdown() override; private: ////////////////////////////////////////////////////////////////////////// // Tutorial 02 code ////////////////////////////////////////////////////////////////////////// void initDXR(HWND winHandle, uint32_t winWidth, uint32_t winHeight); uint32_t beginFrame(); void endFrame(uint32_t rtvIndex); HWND mHwnd = nullptr; ID3D12Device5Ptr mpDevice; ID3D12CommandQueuePtr mpCmdQueue; IDXGISwapChain3Ptr mpSwapChain; uvec2 mSwapChainSize; ID3D12GraphicsCommandList4Ptr mpCmdList; ID3D12FencePtr mpFence; HANDLE mFenceEvent; uint64_t mFenceValue = 0; struct { ID3D12CommandAllocatorPtr pCmdAllocator; ID3D12ResourcePtr pSwapChainBuffer; D3D12_CPU_DESCRIPTOR_HANDLE rtvHandle; } mFrameObjects[kDefaultSwapChainBuffers]; // Heap data struct HeapData { ID3D12DescriptorHeapPtr pHeap; uint32_t usedEntries = 0; }; HeapData mRtvHeap; static const uint32_t kRtvHeapSize = 3; ////////////////////////////////////////////////////////////////////////// // Tutorial 03 ////////////////////////////////////////////////////////////////////////// void createAccelerationStructures(); ID3D12ResourcePtr mpVertexBuffer; ID3D12ResourcePtr mpTopLevelAS; ID3D12ResourcePtr mpBottomLevelAS; uint64_t mTlasSize = 0; ////////////////////////////////////////////////////////////////////////// // Tutorial 04 ////////////////////////////////////////////////////////////////////////// void createRtPipelineState(); ID3D12StateObjectPtr mpPipelineState; ID3D12RootSignaturePtr mpEmptyRootSig; ////////////////////////////////////////////////////////////////////////// // Tutorial 05 ////////////////////////////////////////////////////////////////////////// void createShaderTable(); ID3D12ResourcePtr mpShaderTable; uint32_t mShaderTableEntrySize = 0; ////////////////////////////////////////////////////////////////////////// // Tutorial 06 ////////////////////////////////////////////////////////////////////////// void createShaderResources(); ID3D12ResourcePtr mpOutputResource; ID3D12DescriptorHeapPtr mpSrvUavHeap; static const uint32_t kSrvUavHeapSize = 2; ////////////////////////////////////////////////////////////////////////// // Tutorial 09 ////////////////////////////////////////////////////////////////////////// void createConstantBuffer(); ID3D12ResourcePtr mpConstantBuffer; };
{ "pile_set_name": "Github" }
/************************************************************* * Copyright (c) 2006 Shotaro Tsuji * * 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. * *************************************************************/ /* Please send bug reports to Shotaro Tsuji 4-1010, Sakasedai 1-chome, Takaraduka-si, Hyogo-ken, 665-0024 Japan [email protected] */ #include "stdio_p.h" void clearerr(FILE *stream) { stream->_flags &= ~(__SEOF|__SERR); }
{ "pile_set_name": "Github" }
// Copyright (c) 2015 Uber Technologies, Inc. // // 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. var Writable = require('readable-stream').Writable; var inherits = require('inherits'); function LoggerStream(logger, opts, destroyCb) { if (!(this instanceof LoggerStream)) { return new LoggerStream(logger, opts, destroyCb); } Writable.call(this, { objectMode: true, highWaterMark: opts.highWaterMark }); this.logger = logger; this.closed = false; this._closeCallback = null; this._destroyCb = destroyCb || null; } inherits(LoggerStream, Writable); LoggerStream.prototype.write = function write(entry, cb) { var self = this; if (self.closed) { cb(null); // lal return false; } return Writable.prototype.write.call(self, entry, cb); }; LoggerStream.prototype._write = function write(entry, enc, cb) { var self = this; var level = entry.level; var message = entry.message; var meta = entry.meta; self.logger.log(level, message, meta, function writeDone(err) { cb(err); if (self.closed && !self._writableState.length) { self._onDrain(); } }); }; LoggerStream.prototype.close = function close(callback) { if (this.closed) { callback(new Error('LoggerStream already closed')); return; } this.closed = true; this._closeCallback = callback; if (!this._writableState.length) { this._onDrain(); } }; LoggerStream.prototype._onDrain = function onDrain() { this.destroy(); this._closeCallback(null); }; LoggerStream.prototype.destroy = function destroy() { if (this._destroyCb) { this._destroyCb(); } }; module.exports = LoggerStream;
{ "pile_set_name": "Github" }
"""Adjust some old Python 2 idioms to their modern counterparts. * Change some type comparisons to isinstance() calls: type(x) == T -> isinstance(x, T) type(x) is T -> isinstance(x, T) type(x) != T -> not isinstance(x, T) type(x) is not T -> not isinstance(x, T) * Change "while 1:" into "while True:". * Change both v = list(EXPR) v.sort() foo(v) and the more general v = EXPR v.sort() foo(v) into v = sorted(EXPR) foo(v) """ # Author: Jacques Frechet, Collin Winter # Local imports from .. import fixer_base from ..fixer_util import Call, Comma, Name, Node, BlankLine, syms CMP = "(n='!=' | '==' | 'is' | n=comp_op< 'is' 'not' >)" TYPE = "power< 'type' trailer< '(' x=any ')' > >" class FixIdioms(fixer_base.BaseFix): explicit = True # The user must ask for this fixer PATTERN = r""" isinstance=comparison< %s %s T=any > | isinstance=comparison< T=any %s %s > | while_stmt< 'while' while='1' ':' any+ > | sorted=any< any* simple_stmt< expr_stmt< id1=any '=' power< list='list' trailer< '(' (not arglist<any+>) any ')' > > > '\n' > sort= simple_stmt< power< id2=any trailer< '.' 'sort' > trailer< '(' ')' > > '\n' > next=any* > | sorted=any< any* simple_stmt< expr_stmt< id1=any '=' expr=any > '\n' > sort= simple_stmt< power< id2=any trailer< '.' 'sort' > trailer< '(' ')' > > '\n' > next=any* > """ % (TYPE, CMP, CMP, TYPE) def match(self, node): r = super(FixIdioms, self).match(node) # If we've matched one of the sort/sorted subpatterns above, we # want to reject matches where the initial assignment and the # subsequent .sort() call involve different identifiers. if r and "sorted" in r: if r["id1"] == r["id2"]: return r return None return r def transform(self, node, results): if "isinstance" in results: return self.transform_isinstance(node, results) elif "while" in results: return self.transform_while(node, results) elif "sorted" in results: return self.transform_sort(node, results) else: raise RuntimeError("Invalid match") def transform_isinstance(self, node, results): x = results["x"].clone() # The thing inside of type() T = results["T"].clone() # The type being compared against x.prefix = u"" T.prefix = u" " test = Call(Name(u"isinstance"), [x, Comma(), T]) if "n" in results: test.prefix = u" " test = Node(syms.not_test, [Name(u"not"), test]) test.prefix = node.prefix return test def transform_while(self, node, results): one = results["while"] one.replace(Name(u"True", prefix=one.prefix)) def transform_sort(self, node, results): sort_stmt = results["sort"] next_stmt = results["next"] list_call = results.get("list") simple_expr = results.get("expr") if list_call: list_call.replace(Name(u"sorted", prefix=list_call.prefix)) elif simple_expr: new = simple_expr.clone() new.prefix = u"" simple_expr.replace(Call(Name(u"sorted"), [new], prefix=simple_expr.prefix)) else: raise RuntimeError("should not have reached here") sort_stmt.remove() btwn = sort_stmt.prefix # Keep any prefix lines between the sort_stmt and the list_call and # shove them right after the sorted() call. if u"\n" in btwn: if next_stmt: # The new prefix should be everything from the sort_stmt's # prefix up to the last newline, then the old prefix after a new # line. prefix_lines = (btwn.rpartition(u"\n")[0], next_stmt[0].prefix) next_stmt[0].prefix = u"\n".join(prefix_lines) else: assert list_call.parent assert list_call.next_sibling is None # Put a blank line after list_call and set its prefix. end_line = BlankLine() list_call.parent.append_child(end_line) assert list_call.next_sibling is end_line # The new prefix should be everything up to the first new line # of sort_stmt's prefix. end_line.prefix = btwn.rpartition(u"\n")[0]
{ "pile_set_name": "Github" }
var inst = require("../index").getInstance(); inst.applyConfig({ debug: true, filter: "debug" }); module.exports = inst.use("node-flick");
{ "pile_set_name": "Github" }
private shouldConsider: aClass | count | count := 0. aClass allInstancesDo: [ :instance | count := count + 1. count >= 100 ifTrue: [ ^ true ] ]. ^ false
{ "pile_set_name": "Github" }
<?xml version="1.0"?> <ZopeData> <record id="1" aka="AAAAAAAAAAE="> <pickle> <global name="Image" module="erp5.portal_type"/> </pickle> <pickle> <dictionary> <item> <key> <string>_Access_contents_information_Permission</string> </key> <value> <tuple> <string>Anonymous</string> <string>Assignee</string> <string>Assignor</string> <string>Associate</string> <string>Auditor</string> <string>Manager</string> <string>Owner</string> </tuple> </value> </item> <item> <key> <string>_Add_portal_content_Permission</string> </key> <value> <tuple> <string>Assignee</string> <string>Assignor</string> <string>Manager</string> </tuple> </value> </item> <item> <key> <string>_Change_local_roles_Permission</string> </key> <value> <tuple> <string>Assignor</string> <string>Manager</string> </tuple> </value> </item> <item> <key> <string>_Modify_portal_content_Permission</string> </key> <value> <tuple> <string>Assignee</string> <string>Assignor</string> <string>Manager</string> </tuple> </value> </item> <item> <key> <string>_View_Permission</string> </key> <value> <tuple> <string>Anonymous</string> <string>Assignee</string> <string>Assignor</string> <string>Associate</string> <string>Auditor</string> <string>Manager</string> <string>Owner</string> </tuple> </value> </item> <item> <key> <string>_count</string> </key> <value> <persistent> <string encoding="base64">AAAAAAAAAAI=</string> </persistent> </value> </item> <item> <key> <string>_mt_index</string> </key> <value> <persistent> <string encoding="base64">AAAAAAAAAAM=</string> </persistent> </value> </item> <item> <key> <string>_tree</string> </key> <value> <persistent> <string encoding="base64">AAAAAAAAAAQ=</string> </persistent> </value> </item> <item> <key> <string>categories</string> </key> <value> <tuple> <string>publication_section/documentation/user</string> <string>contributor/person_module/20111027-2BE16E4</string> <string>classification/collaborative/team</string> <string>contributor/person_module/510</string> <string>group/nexedi</string> </tuple> </value> </item> <item> <key> <string>content_md5</string> </key> <value> <string>e4ee520b4c466099cbaee73aeecbe602</string> </value> </item> <item> <key> <string>content_type</string> </key> <value> <string>image/png</string> </value> </item> <item> <key> <string>default_reference</string> </key> <value> <string>user-Howto.Create.Bank.Accounts.Financial.Information.Tab.Screenshot</string> </value> </item> <item> <key> <string>default_source_reference</string> </key> <value> <string>purchase_invoice_transaction_journalize.png</string> </value> </item> <item> <key> <string>description</string> </key> <value> <none/> </value> </item> <item> <key> <string>filename</string> </key> <value> <string>user-Howto.Create.Bank.Accounts.Financial.Information.Tab.png</string> </value> </item> <item> <key> <string>height</string> </key> <value> <int>678</int> </value> </item> <item> <key> <string>id</string> </key> <value> <string>user-Howto.Create.Bank.Accounts.Financial.Information.Tab.Screenshot.002.en</string> </value> </item> <item> <key> <string>language</string> </key> <value> <string>en</string> </value> </item> <item> <key> <string>portal_type</string> </key> <value> <string>Image</string> </value> </item> <item> <key> <string>short_title</string> </key> <value> <string>Financial Information Tab</string> </value> </item> <item> <key> <string>subject</string> </key> <value> <tuple/> </value> </item> <item> <key> <string>title</string> </key> <value> <string>How to create Bank Accounts: Financial Information Tab</string> </value> </item> <item> <key> <string>version</string> </key> <value> <string>002</string> </value> </item> <item> <key> <string>width</string> </key> <value> <int>1300</int> </value> </item> <item> <key> <string>workflow_history</string> </key> <value> <persistent> <string encoding="base64">AAAAAAAAAAU=</string> </persistent> </value> </item> </dictionary> </pickle> </record> <record id="2" aka="AAAAAAAAAAI="> <pickle> <global name="Length" module="BTrees.Length"/> </pickle> <pickle> <int>0</int> </pickle> </record> <record id="3" aka="AAAAAAAAAAM="> <pickle> <global name="OOBTree" module="BTrees.OOBTree"/> </pickle> <pickle> <none/> </pickle> </record> <record id="4" aka="AAAAAAAAAAQ="> <pickle> <global name="OOBTree" module="BTrees.OOBTree"/> </pickle> <pickle> <none/> </pickle> </record> <record id="5" aka="AAAAAAAAAAU="> <pickle> <global name="PersistentMapping" module="Persistence.mapping"/> </pickle> <pickle> <dictionary> <item> <key> <string>data</string> </key> <value> <dictionary> <item> <key> <string>document_publication_workflow</string> </key> <value> <persistent> <string encoding="base64">AAAAAAAAAAY=</string> </persistent> </value> </item> <item> <key> <string>edit_workflow</string> </key> <value> <persistent> <string encoding="base64">AAAAAAAAAAc=</string> </persistent> </value> </item> <item> <key> <string>processing_status_workflow</string> </key> <value> <persistent> <string encoding="base64">AAAAAAAAAAg=</string> </persistent> </value> </item> </dictionary> </value> </item> </dictionary> </pickle> </record> <record id="6" aka="AAAAAAAAAAY="> <pickle> <global name="WorkflowHistoryList" module="Products.ERP5Type.Workflow"/> </pickle> <pickle> <dictionary> <item> <key> <string>_log</string> </key> <value> <list> <dictionary> <item> <key> <string>action</string> </key> <value> <string>publish_alive</string> </value> </item> <item> <key> <string>actor</string> </key> <value> <string>jingjing</string> </value> </item> <item> <key> <string>comment</string> </key> <value> <string></string> </value> </item> <item> <key> <string>error_message</string> </key> <value> <string></string> </value> </item> <item> <key> <string>time</string> </key> <value> <object> <klass> <global name="DateTime" module="DateTime.DateTime"/> </klass> <tuple> <none/> </tuple> <state> <tuple> <float>1382108037.03</float> <string>UTC</string> </tuple> </state> </object> </value> </item> <item> <key> <string>validation_state</string> </key> <value> <string>published_alive</string> </value> </item> </dictionary> </list> </value> </item> </dictionary> </pickle> </record> <record id="7" aka="AAAAAAAAAAc="> <pickle> <global name="WorkflowHistoryList" module="Products.ERP5Type.Workflow"/> </pickle> <pickle> <dictionary> <item> <key> <string>_log</string> </key> <value> <list> <dictionary> <item> <key> <string>action</string> </key> <value> <string>edit</string> </value> </item> <item> <key> <string>actor</string> </key> <value> <string>superklaus</string> </value> </item> <item> <key> <string>comment</string> </key> <value> <none/> </value> </item> <item> <key> <string>error_message</string> </key> <value> <string></string> </value> </item> <item> <key> <string>serial</string> </key> <value> <string>950.43005.17434.50043</string> </value> </item> <item> <key> <string>state</string> </key> <value> <string>current</string> </value> </item> <item> <key> <string>time</string> </key> <value> <object> <klass> <global name="DateTime" module="DateTime.DateTime"/> </klass> <tuple> <none/> </tuple> <state> <tuple> <float>1468424776.16</float> <string>UTC</string> </tuple> </state> </object> </value> </item> </dictionary> </list> </value> </item> </dictionary> </pickle> </record> <record id="8" aka="AAAAAAAAAAg="> <pickle> <global name="WorkflowHistoryList" module="Products.ERP5Type.Workflow"/> </pickle> <pickle> <dictionary> <item> <key> <string>_log</string> </key> <value> <list> <dictionary> <item> <key> <string>action</string> </key> <value> <string>detect_uploaded_file</string> </value> </item> <item> <key> <string>actor</string> </key> <value> <string>jingjing</string> </value> </item> <item> <key> <string>comment</string> </key> <value> <string></string> </value> </item> <item> <key> <string>error_message</string> </key> <value> <string></string> </value> </item> <item> <key> <string>external_processing_state</string> </key> <value> <string>uploaded</string> </value> </item> <item> <key> <string>serial</string> </key> <value> <string>0.0.0.0</string> </value> </item> <item> <key> <string>time</string> </key> <value> <object> <klass> <global name="DateTime" module="DateTime.DateTime"/> </klass> <tuple> <none/> </tuple> <state> <tuple> <float>1382108002.36</float> <string>UTC</string> </tuple> </state> </object> </value> </item> </dictionary> </list> </value> </item> </dictionary> </pickle> </record> </ZopeData>
{ "pile_set_name": "Github" }
{"name": "Hack-O-Lantern", "description": "Solved a problem on Halloween.", "event": "submit", "hidden": false, "score": 10, "processor": "hackolantern/hackolantern.py", "image": "/img/achievements/hackolantern.png", "smallimage": "/img/achievements/hackolantern_unlock.png"}
{ "pile_set_name": "Github" }
import React from 'react'; export interface GlobalHeaderProps { collapsed?: boolean; onCollapse?: (collapsed: boolean) => void; isMobile?: boolean; logo?: string; onNoticeClear?: (type: string) => void; onMenuClick?: ({ key: string }) => void; onNoticeVisibleChange?: (b: boolean) => void; } export default class GlobalHeader extends React.Component<GlobalHeaderProps, any> {}
{ "pile_set_name": "Github" }
/* * * Copyright 2014 gRPC authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. * */ package grpc import ( "bytes" "errors" "fmt" "io" "math" "net" "net/http" "reflect" "runtime" "strings" "sync" "time" "io/ioutil" "golang.org/x/net/context" "golang.org/x/net/http2" "golang.org/x/net/trace" "google.golang.org/grpc/channelz" "google.golang.org/grpc/codes" "google.golang.org/grpc/credentials" "google.golang.org/grpc/encoding" "google.golang.org/grpc/encoding/proto" "google.golang.org/grpc/grpclog" "google.golang.org/grpc/internal" "google.golang.org/grpc/keepalive" "google.golang.org/grpc/metadata" "google.golang.org/grpc/stats" "google.golang.org/grpc/status" "google.golang.org/grpc/tap" "google.golang.org/grpc/transport" ) const ( defaultServerMaxReceiveMessageSize = 1024 * 1024 * 4 defaultServerMaxSendMessageSize = math.MaxInt32 ) type methodHandler func(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor UnaryServerInterceptor) (interface{}, error) // MethodDesc represents an RPC service's method specification. type MethodDesc struct { MethodName string Handler methodHandler } // ServiceDesc represents an RPC service's specification. type ServiceDesc struct { ServiceName string // The pointer to the service interface. Used to check whether the user // provided implementation satisfies the interface requirements. HandlerType interface{} Methods []MethodDesc Streams []StreamDesc Metadata interface{} } // service consists of the information of the server serving this service and // the methods in this service. type service struct { server interface{} // the server for service methods md map[string]*MethodDesc sd map[string]*StreamDesc mdata interface{} } // Server is a gRPC server to serve RPC requests. type Server struct { opts options mu sync.Mutex // guards following lis map[net.Listener]bool conns map[io.Closer]bool serve bool drain bool cv *sync.Cond // signaled when connections close for GracefulStop m map[string]*service // service name -> service info events trace.EventLog quit chan struct{} done chan struct{} quitOnce sync.Once doneOnce sync.Once channelzRemoveOnce sync.Once serveWG sync.WaitGroup // counts active Serve goroutines for GracefulStop channelzID int64 // channelz unique identification number czmu sync.RWMutex callsStarted int64 callsFailed int64 callsSucceeded int64 lastCallStartedTime time.Time } type options struct { creds credentials.TransportCredentials codec baseCodec cp Compressor dc Decompressor unaryInt UnaryServerInterceptor streamInt StreamServerInterceptor inTapHandle tap.ServerInHandle statsHandler stats.Handler maxConcurrentStreams uint32 maxReceiveMessageSize int maxSendMessageSize int useHandlerImpl bool // use http.Handler-based server unknownStreamDesc *StreamDesc keepaliveParams keepalive.ServerParameters keepalivePolicy keepalive.EnforcementPolicy initialWindowSize int32 initialConnWindowSize int32 writeBufferSize int readBufferSize int connectionTimeout time.Duration } var defaultServerOptions = options{ maxReceiveMessageSize: defaultServerMaxReceiveMessageSize, maxSendMessageSize: defaultServerMaxSendMessageSize, connectionTimeout: 120 * time.Second, } // A ServerOption sets options such as credentials, codec and keepalive parameters, etc. type ServerOption func(*options) // WriteBufferSize lets you set the size of write buffer, this determines how much data can be batched // before doing a write on the wire. func WriteBufferSize(s int) ServerOption { return func(o *options) { o.writeBufferSize = s } } // ReadBufferSize lets you set the size of read buffer, this determines how much data can be read at most // for one read syscall. func ReadBufferSize(s int) ServerOption { return func(o *options) { o.readBufferSize = s } } // InitialWindowSize returns a ServerOption that sets window size for stream. // The lower bound for window size is 64K and any value smaller than that will be ignored. func InitialWindowSize(s int32) ServerOption { return func(o *options) { o.initialWindowSize = s } } // InitialConnWindowSize returns a ServerOption that sets window size for a connection. // The lower bound for window size is 64K and any value smaller than that will be ignored. func InitialConnWindowSize(s int32) ServerOption { return func(o *options) { o.initialConnWindowSize = s } } // KeepaliveParams returns a ServerOption that sets keepalive and max-age parameters for the server. func KeepaliveParams(kp keepalive.ServerParameters) ServerOption { return func(o *options) { o.keepaliveParams = kp } } // KeepaliveEnforcementPolicy returns a ServerOption that sets keepalive enforcement policy for the server. func KeepaliveEnforcementPolicy(kep keepalive.EnforcementPolicy) ServerOption { return func(o *options) { o.keepalivePolicy = kep } } // CustomCodec returns a ServerOption that sets a codec for message marshaling and unmarshaling. // // This will override any lookups by content-subtype for Codecs registered with RegisterCodec. func CustomCodec(codec Codec) ServerOption { return func(o *options) { o.codec = codec } } // RPCCompressor returns a ServerOption that sets a compressor for outbound // messages. For backward compatibility, all outbound messages will be sent // using this compressor, regardless of incoming message compression. By // default, server messages will be sent using the same compressor with which // request messages were sent. // // Deprecated: use encoding.RegisterCompressor instead. func RPCCompressor(cp Compressor) ServerOption { return func(o *options) { o.cp = cp } } // RPCDecompressor returns a ServerOption that sets a decompressor for inbound // messages. It has higher priority than decompressors registered via // encoding.RegisterCompressor. // // Deprecated: use encoding.RegisterCompressor instead. func RPCDecompressor(dc Decompressor) ServerOption { return func(o *options) { o.dc = dc } } // MaxMsgSize returns a ServerOption to set the max message size in bytes the server can receive. // If this is not set, gRPC uses the default limit. // // Deprecated: use MaxRecvMsgSize instead. func MaxMsgSize(m int) ServerOption { return MaxRecvMsgSize(m) } // MaxRecvMsgSize returns a ServerOption to set the max message size in bytes the server can receive. // If this is not set, gRPC uses the default 4MB. func MaxRecvMsgSize(m int) ServerOption { return func(o *options) { o.maxReceiveMessageSize = m } } // MaxSendMsgSize returns a ServerOption to set the max message size in bytes the server can send. // If this is not set, gRPC uses the default 4MB. func MaxSendMsgSize(m int) ServerOption { return func(o *options) { o.maxSendMessageSize = m } } // MaxConcurrentStreams returns a ServerOption that will apply a limit on the number // of concurrent streams to each ServerTransport. func MaxConcurrentStreams(n uint32) ServerOption { return func(o *options) { o.maxConcurrentStreams = n } } // Creds returns a ServerOption that sets credentials for server connections. func Creds(c credentials.TransportCredentials) ServerOption { return func(o *options) { o.creds = c } } // UnaryInterceptor returns a ServerOption that sets the UnaryServerInterceptor for the // server. Only one unary interceptor can be installed. The construction of multiple // interceptors (e.g., chaining) can be implemented at the caller. func UnaryInterceptor(i UnaryServerInterceptor) ServerOption { return func(o *options) { if o.unaryInt != nil { panic("The unary server interceptor was already set and may not be reset.") } o.unaryInt = i } } // StreamInterceptor returns a ServerOption that sets the StreamServerInterceptor for the // server. Only one stream interceptor can be installed. func StreamInterceptor(i StreamServerInterceptor) ServerOption { return func(o *options) { if o.streamInt != nil { panic("The stream server interceptor was already set and may not be reset.") } o.streamInt = i } } // InTapHandle returns a ServerOption that sets the tap handle for all the server // transport to be created. Only one can be installed. func InTapHandle(h tap.ServerInHandle) ServerOption { return func(o *options) { if o.inTapHandle != nil { panic("The tap handle was already set and may not be reset.") } o.inTapHandle = h } } // StatsHandler returns a ServerOption that sets the stats handler for the server. func StatsHandler(h stats.Handler) ServerOption { return func(o *options) { o.statsHandler = h } } // UnknownServiceHandler returns a ServerOption that allows for adding a custom // unknown service handler. The provided method is a bidi-streaming RPC service // handler that will be invoked instead of returning the "unimplemented" gRPC // error whenever a request is received for an unregistered service or method. // The handling function has full access to the Context of the request and the // stream, and the invocation bypasses interceptors. func UnknownServiceHandler(streamHandler StreamHandler) ServerOption { return func(o *options) { o.unknownStreamDesc = &StreamDesc{ StreamName: "unknown_service_handler", Handler: streamHandler, // We need to assume that the users of the streamHandler will want to use both. ClientStreams: true, ServerStreams: true, } } } // ConnectionTimeout returns a ServerOption that sets the timeout for // connection establishment (up to and including HTTP/2 handshaking) for all // new connections. If this is not set, the default is 120 seconds. A zero or // negative value will result in an immediate timeout. // // This API is EXPERIMENTAL. func ConnectionTimeout(d time.Duration) ServerOption { return func(o *options) { o.connectionTimeout = d } } // NewServer creates a gRPC server which has no service registered and has not // started to accept requests yet. func NewServer(opt ...ServerOption) *Server { opts := defaultServerOptions for _, o := range opt { o(&opts) } s := &Server{ lis: make(map[net.Listener]bool), opts: opts, conns: make(map[io.Closer]bool), m: make(map[string]*service), quit: make(chan struct{}), done: make(chan struct{}), } s.cv = sync.NewCond(&s.mu) if EnableTracing { _, file, line, _ := runtime.Caller(1) s.events = trace.NewEventLog("grpc.Server", fmt.Sprintf("%s:%d", file, line)) } if channelz.IsOn() { s.channelzID = channelz.RegisterServer(s, "") } return s } // printf records an event in s's event log, unless s has been stopped. // REQUIRES s.mu is held. func (s *Server) printf(format string, a ...interface{}) { if s.events != nil { s.events.Printf(format, a...) } } // errorf records an error in s's event log, unless s has been stopped. // REQUIRES s.mu is held. func (s *Server) errorf(format string, a ...interface{}) { if s.events != nil { s.events.Errorf(format, a...) } } // RegisterService registers a service and its implementation to the gRPC // server. It is called from the IDL generated code. This must be called before // invoking Serve. func (s *Server) RegisterService(sd *ServiceDesc, ss interface{}) { ht := reflect.TypeOf(sd.HandlerType).Elem() st := reflect.TypeOf(ss) if !st.Implements(ht) { grpclog.Fatalf("grpc: Server.RegisterService found the handler of type %v that does not satisfy %v", st, ht) } s.register(sd, ss) } func (s *Server) register(sd *ServiceDesc, ss interface{}) { s.mu.Lock() defer s.mu.Unlock() s.printf("RegisterService(%q)", sd.ServiceName) if s.serve { grpclog.Fatalf("grpc: Server.RegisterService after Server.Serve for %q", sd.ServiceName) } if _, ok := s.m[sd.ServiceName]; ok { grpclog.Fatalf("grpc: Server.RegisterService found duplicate service registration for %q", sd.ServiceName) } srv := &service{ server: ss, md: make(map[string]*MethodDesc), sd: make(map[string]*StreamDesc), mdata: sd.Metadata, } for i := range sd.Methods { d := &sd.Methods[i] srv.md[d.MethodName] = d } for i := range sd.Streams { d := &sd.Streams[i] srv.sd[d.StreamName] = d } s.m[sd.ServiceName] = srv } // MethodInfo contains the information of an RPC including its method name and type. type MethodInfo struct { // Name is the method name only, without the service name or package name. Name string // IsClientStream indicates whether the RPC is a client streaming RPC. IsClientStream bool // IsServerStream indicates whether the RPC is a server streaming RPC. IsServerStream bool } // ServiceInfo contains unary RPC method info, streaming RPC method info and metadata for a service. type ServiceInfo struct { Methods []MethodInfo // Metadata is the metadata specified in ServiceDesc when registering service. Metadata interface{} } // GetServiceInfo returns a map from service names to ServiceInfo. // Service names include the package names, in the form of <package>.<service>. func (s *Server) GetServiceInfo() map[string]ServiceInfo { ret := make(map[string]ServiceInfo) for n, srv := range s.m { methods := make([]MethodInfo, 0, len(srv.md)+len(srv.sd)) for m := range srv.md { methods = append(methods, MethodInfo{ Name: m, IsClientStream: false, IsServerStream: false, }) } for m, d := range srv.sd { methods = append(methods, MethodInfo{ Name: m, IsClientStream: d.ClientStreams, IsServerStream: d.ServerStreams, }) } ret[n] = ServiceInfo{ Methods: methods, Metadata: srv.mdata, } } return ret } // ErrServerStopped indicates that the operation is now illegal because of // the server being stopped. var ErrServerStopped = errors.New("grpc: the server has been stopped") func (s *Server) useTransportAuthenticator(rawConn net.Conn) (net.Conn, credentials.AuthInfo, error) { if s.opts.creds == nil { return rawConn, nil, nil } return s.opts.creds.ServerHandshake(rawConn) } type listenSocket struct { net.Listener channelzID int64 } func (l *listenSocket) ChannelzMetric() *channelz.SocketInternalMetric { return &channelz.SocketInternalMetric{ LocalAddr: l.Listener.Addr(), } } func (l *listenSocket) Close() error { err := l.Listener.Close() if channelz.IsOn() { channelz.RemoveEntry(l.channelzID) } return err } // Serve accepts incoming connections on the listener lis, creating a new // ServerTransport and service goroutine for each. The service goroutines // read gRPC requests and then call the registered handlers to reply to them. // Serve returns when lis.Accept fails with fatal errors. lis will be closed when // this method returns. // Serve will return a non-nil error unless Stop or GracefulStop is called. func (s *Server) Serve(lis net.Listener) error { s.mu.Lock() s.printf("serving") s.serve = true if s.lis == nil { // Serve called after Stop or GracefulStop. s.mu.Unlock() lis.Close() return ErrServerStopped } s.serveWG.Add(1) defer func() { s.serveWG.Done() select { // Stop or GracefulStop called; block until done and return nil. case <-s.quit: <-s.done default: } }() ls := &listenSocket{Listener: lis} s.lis[ls] = true if channelz.IsOn() { ls.channelzID = channelz.RegisterListenSocket(ls, s.channelzID, "") } s.mu.Unlock() defer func() { s.mu.Lock() if s.lis != nil && s.lis[ls] { ls.Close() delete(s.lis, ls) } s.mu.Unlock() }() var tempDelay time.Duration // how long to sleep on accept failure for { rawConn, err := lis.Accept() if err != nil { if ne, ok := err.(interface { Temporary() bool }); ok && ne.Temporary() { if tempDelay == 0 { tempDelay = 5 * time.Millisecond } else { tempDelay *= 2 } if max := 1 * time.Second; tempDelay > max { tempDelay = max } s.mu.Lock() s.printf("Accept error: %v; retrying in %v", err, tempDelay) s.mu.Unlock() timer := time.NewTimer(tempDelay) select { case <-timer.C: case <-s.quit: timer.Stop() return nil } continue } s.mu.Lock() s.printf("done serving; Accept = %v", err) s.mu.Unlock() select { case <-s.quit: return nil default: } return err } tempDelay = 0 // Start a new goroutine to deal with rawConn so we don't stall this Accept // loop goroutine. // // Make sure we account for the goroutine so GracefulStop doesn't nil out // s.conns before this conn can be added. s.serveWG.Add(1) go func() { s.handleRawConn(rawConn) s.serveWG.Done() }() } } // handleRawConn forks a goroutine to handle a just-accepted connection that // has not had any I/O performed on it yet. func (s *Server) handleRawConn(rawConn net.Conn) { rawConn.SetDeadline(time.Now().Add(s.opts.connectionTimeout)) conn, authInfo, err := s.useTransportAuthenticator(rawConn) if err != nil { s.mu.Lock() s.errorf("ServerHandshake(%q) failed: %v", rawConn.RemoteAddr(), err) s.mu.Unlock() grpclog.Warningf("grpc: Server.Serve failed to complete security handshake from %q: %v", rawConn.RemoteAddr(), err) // If serverHandshake returns ErrConnDispatched, keep rawConn open. if err != credentials.ErrConnDispatched { rawConn.Close() } rawConn.SetDeadline(time.Time{}) return } s.mu.Lock() if s.conns == nil { s.mu.Unlock() conn.Close() return } s.mu.Unlock() var serve func() c := conn.(io.Closer) if s.opts.useHandlerImpl { serve = func() { s.serveUsingHandler(conn) } } else { // Finish handshaking (HTTP2) st := s.newHTTP2Transport(conn, authInfo) if st == nil { return } c = st serve = func() { s.serveStreams(st) } } rawConn.SetDeadline(time.Time{}) if !s.addConn(c) { return } go func() { serve() s.removeConn(c) }() } // newHTTP2Transport sets up a http/2 transport (using the // gRPC http2 server transport in transport/http2_server.go). func (s *Server) newHTTP2Transport(c net.Conn, authInfo credentials.AuthInfo) transport.ServerTransport { config := &transport.ServerConfig{ MaxStreams: s.opts.maxConcurrentStreams, AuthInfo: authInfo, InTapHandle: s.opts.inTapHandle, StatsHandler: s.opts.statsHandler, KeepaliveParams: s.opts.keepaliveParams, KeepalivePolicy: s.opts.keepalivePolicy, InitialWindowSize: s.opts.initialWindowSize, InitialConnWindowSize: s.opts.initialConnWindowSize, WriteBufferSize: s.opts.writeBufferSize, ReadBufferSize: s.opts.readBufferSize, ChannelzParentID: s.channelzID, } st, err := transport.NewServerTransport("http2", c, config) if err != nil { s.mu.Lock() s.errorf("NewServerTransport(%q) failed: %v", c.RemoteAddr(), err) s.mu.Unlock() c.Close() grpclog.Warningln("grpc: Server.Serve failed to create ServerTransport: ", err) return nil } return st } func (s *Server) serveStreams(st transport.ServerTransport) { defer st.Close() var wg sync.WaitGroup st.HandleStreams(func(stream *transport.Stream) { wg.Add(1) go func() { defer wg.Done() s.handleStream(st, stream, s.traceInfo(st, stream)) }() }, func(ctx context.Context, method string) context.Context { if !EnableTracing { return ctx } tr := trace.New("grpc.Recv."+methodFamily(method), method) return trace.NewContext(ctx, tr) }) wg.Wait() } var _ http.Handler = (*Server)(nil) // serveUsingHandler is called from handleRawConn when s is configured // to handle requests via the http.Handler interface. It sets up a // net/http.Server to handle the just-accepted conn. The http.Server // is configured to route all incoming requests (all HTTP/2 streams) // to ServeHTTP, which creates a new ServerTransport for each stream. // serveUsingHandler blocks until conn closes. // // This codepath is only used when Server.TestingUseHandlerImpl has // been configured. This lets the end2end tests exercise the ServeHTTP // method as one of the environment types. // // conn is the *tls.Conn that's already been authenticated. func (s *Server) serveUsingHandler(conn net.Conn) { h2s := &http2.Server{ MaxConcurrentStreams: s.opts.maxConcurrentStreams, } h2s.ServeConn(conn, &http2.ServeConnOpts{ Handler: s, }) } // ServeHTTP implements the Go standard library's http.Handler // interface by responding to the gRPC request r, by looking up // the requested gRPC method in the gRPC server s. // // The provided HTTP request must have arrived on an HTTP/2 // connection. When using the Go standard library's server, // practically this means that the Request must also have arrived // over TLS. // // To share one port (such as 443 for https) between gRPC and an // existing http.Handler, use a root http.Handler such as: // // if r.ProtoMajor == 2 && strings.HasPrefix( // r.Header.Get("Content-Type"), "application/grpc") { // grpcServer.ServeHTTP(w, r) // } else { // yourMux.ServeHTTP(w, r) // } // // Note that ServeHTTP uses Go's HTTP/2 server implementation which is totally // separate from grpc-go's HTTP/2 server. Performance and features may vary // between the two paths. ServeHTTP does not support some gRPC features // available through grpc-go's HTTP/2 server, and it is currently EXPERIMENTAL // and subject to change. func (s *Server) ServeHTTP(w http.ResponseWriter, r *http.Request) { st, err := transport.NewServerHandlerTransport(w, r, s.opts.statsHandler) if err != nil { http.Error(w, err.Error(), http.StatusInternalServerError) return } if !s.addConn(st) { return } defer s.removeConn(st) s.serveStreams(st) } // traceInfo returns a traceInfo and associates it with stream, if tracing is enabled. // If tracing is not enabled, it returns nil. func (s *Server) traceInfo(st transport.ServerTransport, stream *transport.Stream) (trInfo *traceInfo) { tr, ok := trace.FromContext(stream.Context()) if !ok { return nil } trInfo = &traceInfo{ tr: tr, } trInfo.firstLine.client = false trInfo.firstLine.remoteAddr = st.RemoteAddr() if dl, ok := stream.Context().Deadline(); ok { trInfo.firstLine.deadline = dl.Sub(time.Now()) } return trInfo } func (s *Server) addConn(c io.Closer) bool { s.mu.Lock() defer s.mu.Unlock() if s.conns == nil { c.Close() return false } if s.drain { // Transport added after we drained our existing conns: drain it // immediately. c.(transport.ServerTransport).Drain() } s.conns[c] = true return true } func (s *Server) removeConn(c io.Closer) { s.mu.Lock() defer s.mu.Unlock() if s.conns != nil { delete(s.conns, c) s.cv.Broadcast() } } // ChannelzMetric returns ServerInternalMetric of current server. // This is an EXPERIMENTAL API. func (s *Server) ChannelzMetric() *channelz.ServerInternalMetric { s.czmu.RLock() defer s.czmu.RUnlock() return &channelz.ServerInternalMetric{ CallsStarted: s.callsStarted, CallsSucceeded: s.callsSucceeded, CallsFailed: s.callsFailed, LastCallStartedTimestamp: s.lastCallStartedTime, } } func (s *Server) incrCallsStarted() { s.czmu.Lock() s.callsStarted++ s.lastCallStartedTime = time.Now() s.czmu.Unlock() } func (s *Server) incrCallsSucceeded() { s.czmu.Lock() s.callsSucceeded++ s.czmu.Unlock() } func (s *Server) incrCallsFailed() { s.czmu.Lock() s.callsFailed++ s.czmu.Unlock() } func (s *Server) sendResponse(t transport.ServerTransport, stream *transport.Stream, msg interface{}, cp Compressor, opts *transport.Options, comp encoding.Compressor) error { var ( outPayload *stats.OutPayload ) if s.opts.statsHandler != nil { outPayload = &stats.OutPayload{} } hdr, data, err := encode(s.getCodec(stream.ContentSubtype()), msg, cp, outPayload, comp) if err != nil { grpclog.Errorln("grpc: server failed to encode response: ", err) return err } if len(data) > s.opts.maxSendMessageSize { return status.Errorf(codes.ResourceExhausted, "grpc: trying to send message larger than max (%d vs. %d)", len(data), s.opts.maxSendMessageSize) } err = t.Write(stream, hdr, data, opts) if err == nil && outPayload != nil { outPayload.SentTime = time.Now() s.opts.statsHandler.HandleRPC(stream.Context(), outPayload) } return err } func (s *Server) processUnaryRPC(t transport.ServerTransport, stream *transport.Stream, srv *service, md *MethodDesc, trInfo *traceInfo) (err error) { if channelz.IsOn() { s.incrCallsStarted() defer func() { if err != nil && err != io.EOF { s.incrCallsFailed() } else { s.incrCallsSucceeded() } }() } sh := s.opts.statsHandler if sh != nil { beginTime := time.Now() begin := &stats.Begin{ BeginTime: beginTime, } sh.HandleRPC(stream.Context(), begin) defer func() { end := &stats.End{ BeginTime: beginTime, EndTime: time.Now(), } if err != nil && err != io.EOF { end.Error = toRPCErr(err) } sh.HandleRPC(stream.Context(), end) }() } if trInfo != nil { defer trInfo.tr.Finish() trInfo.firstLine.client = false trInfo.tr.LazyLog(&trInfo.firstLine, false) defer func() { if err != nil && err != io.EOF { trInfo.tr.LazyLog(&fmtStringer{"%v", []interface{}{err}}, true) trInfo.tr.SetError() } }() } // comp and cp are used for compression. decomp and dc are used for // decompression. If comp and decomp are both set, they are the same; // however they are kept separate to ensure that at most one of the // compressor/decompressor variable pairs are set for use later. var comp, decomp encoding.Compressor var cp Compressor var dc Decompressor // If dc is set and matches the stream's compression, use it. Otherwise, try // to find a matching registered compressor for decomp. if rc := stream.RecvCompress(); s.opts.dc != nil && s.opts.dc.Type() == rc { dc = s.opts.dc } else if rc != "" && rc != encoding.Identity { decomp = encoding.GetCompressor(rc) if decomp == nil { st := status.Newf(codes.Unimplemented, "grpc: Decompressor is not installed for grpc-encoding %q", rc) t.WriteStatus(stream, st) return st.Err() } } // If cp is set, use it. Otherwise, attempt to compress the response using // the incoming message compression method. // // NOTE: this needs to be ahead of all handling, https://github.com/grpc/grpc-go/issues/686. if s.opts.cp != nil { cp = s.opts.cp stream.SetSendCompress(cp.Type()) } else if rc := stream.RecvCompress(); rc != "" && rc != encoding.Identity { // Legacy compressor not specified; attempt to respond with same encoding. comp = encoding.GetCompressor(rc) if comp != nil { stream.SetSendCompress(rc) } } p := &parser{r: stream} pf, req, err := p.recvMsg(s.opts.maxReceiveMessageSize) if err == io.EOF { // The entire stream is done (for unary RPC only). return err } if err == io.ErrUnexpectedEOF { err = status.Errorf(codes.Internal, io.ErrUnexpectedEOF.Error()) } if err != nil { if st, ok := status.FromError(err); ok { if e := t.WriteStatus(stream, st); e != nil { grpclog.Warningf("grpc: Server.processUnaryRPC failed to write status %v", e) } } else { switch st := err.(type) { case transport.ConnectionError: // Nothing to do here. case transport.StreamError: if e := t.WriteStatus(stream, status.New(st.Code, st.Desc)); e != nil { grpclog.Warningf("grpc: Server.processUnaryRPC failed to write status %v", e) } default: panic(fmt.Sprintf("grpc: Unexpected error (%T) from recvMsg: %v", st, st)) } } return err } if channelz.IsOn() { t.IncrMsgRecv() } if st := checkRecvPayload(pf, stream.RecvCompress(), dc != nil || decomp != nil); st != nil { if e := t.WriteStatus(stream, st); e != nil { grpclog.Warningf("grpc: Server.processUnaryRPC failed to write status %v", e) } return st.Err() } var inPayload *stats.InPayload if sh != nil { inPayload = &stats.InPayload{ RecvTime: time.Now(), } } df := func(v interface{}) error { if inPayload != nil { inPayload.WireLength = len(req) } if pf == compressionMade { var err error if dc != nil { req, err = dc.Do(bytes.NewReader(req)) if err != nil { return status.Errorf(codes.Internal, err.Error()) } } else { tmp, _ := decomp.Decompress(bytes.NewReader(req)) req, err = ioutil.ReadAll(tmp) if err != nil { return status.Errorf(codes.Internal, "grpc: failed to decompress the received message %v", err) } } } if len(req) > s.opts.maxReceiveMessageSize { // TODO: Revisit the error code. Currently keep it consistent with // java implementation. return status.Errorf(codes.ResourceExhausted, "grpc: received message larger than max (%d vs. %d)", len(req), s.opts.maxReceiveMessageSize) } if err := s.getCodec(stream.ContentSubtype()).Unmarshal(req, v); err != nil { return status.Errorf(codes.Internal, "grpc: error unmarshalling request: %v", err) } if inPayload != nil { inPayload.Payload = v inPayload.Data = req inPayload.Length = len(req) sh.HandleRPC(stream.Context(), inPayload) } if trInfo != nil { trInfo.tr.LazyLog(&payload{sent: false, msg: v}, true) } return nil } ctx := NewContextWithServerTransportStream(stream.Context(), stream) reply, appErr := md.Handler(srv.server, ctx, df, s.opts.unaryInt) if appErr != nil { appStatus, ok := status.FromError(appErr) if !ok { // Convert appErr if it is not a grpc status error. appErr = status.Error(codes.Unknown, appErr.Error()) appStatus, _ = status.FromError(appErr) } if trInfo != nil { trInfo.tr.LazyLog(stringer(appStatus.Message()), true) trInfo.tr.SetError() } if e := t.WriteStatus(stream, appStatus); e != nil { grpclog.Warningf("grpc: Server.processUnaryRPC failed to write status: %v", e) } return appErr } if trInfo != nil { trInfo.tr.LazyLog(stringer("OK"), false) } opts := &transport.Options{ Last: true, Delay: false, } if err := s.sendResponse(t, stream, reply, cp, opts, comp); err != nil { if err == io.EOF { // The entire stream is done (for unary RPC only). return err } if s, ok := status.FromError(err); ok { if e := t.WriteStatus(stream, s); e != nil { grpclog.Warningf("grpc: Server.processUnaryRPC failed to write status: %v", e) } } else { switch st := err.(type) { case transport.ConnectionError: // Nothing to do here. case transport.StreamError: if e := t.WriteStatus(stream, status.New(st.Code, st.Desc)); e != nil { grpclog.Warningf("grpc: Server.processUnaryRPC failed to write status %v", e) } default: panic(fmt.Sprintf("grpc: Unexpected error (%T) from sendResponse: %v", st, st)) } } return err } if channelz.IsOn() { t.IncrMsgSent() } if trInfo != nil { trInfo.tr.LazyLog(&payload{sent: true, msg: reply}, true) } // TODO: Should we be logging if writing status failed here, like above? // Should the logging be in WriteStatus? Should we ignore the WriteStatus // error or allow the stats handler to see it? return t.WriteStatus(stream, status.New(codes.OK, "")) } func (s *Server) processStreamingRPC(t transport.ServerTransport, stream *transport.Stream, srv *service, sd *StreamDesc, trInfo *traceInfo) (err error) { if channelz.IsOn() { s.incrCallsStarted() defer func() { if err != nil && err != io.EOF { s.incrCallsFailed() } else { s.incrCallsSucceeded() } }() } sh := s.opts.statsHandler if sh != nil { beginTime := time.Now() begin := &stats.Begin{ BeginTime: beginTime, } sh.HandleRPC(stream.Context(), begin) defer func() { end := &stats.End{ BeginTime: beginTime, EndTime: time.Now(), } if err != nil && err != io.EOF { end.Error = toRPCErr(err) } sh.HandleRPC(stream.Context(), end) }() } ctx := NewContextWithServerTransportStream(stream.Context(), stream) ss := &serverStream{ ctx: ctx, t: t, s: stream, p: &parser{r: stream}, codec: s.getCodec(stream.ContentSubtype()), maxReceiveMessageSize: s.opts.maxReceiveMessageSize, maxSendMessageSize: s.opts.maxSendMessageSize, trInfo: trInfo, statsHandler: sh, } // If dc is set and matches the stream's compression, use it. Otherwise, try // to find a matching registered compressor for decomp. if rc := stream.RecvCompress(); s.opts.dc != nil && s.opts.dc.Type() == rc { ss.dc = s.opts.dc } else if rc != "" && rc != encoding.Identity { ss.decomp = encoding.GetCompressor(rc) if ss.decomp == nil { st := status.Newf(codes.Unimplemented, "grpc: Decompressor is not installed for grpc-encoding %q", rc) t.WriteStatus(ss.s, st) return st.Err() } } // If cp is set, use it. Otherwise, attempt to compress the response using // the incoming message compression method. // // NOTE: this needs to be ahead of all handling, https://github.com/grpc/grpc-go/issues/686. if s.opts.cp != nil { ss.cp = s.opts.cp stream.SetSendCompress(s.opts.cp.Type()) } else if rc := stream.RecvCompress(); rc != "" && rc != encoding.Identity { // Legacy compressor not specified; attempt to respond with same encoding. ss.comp = encoding.GetCompressor(rc) if ss.comp != nil { stream.SetSendCompress(rc) } } if trInfo != nil { trInfo.tr.LazyLog(&trInfo.firstLine, false) defer func() { ss.mu.Lock() if err != nil && err != io.EOF { ss.trInfo.tr.LazyLog(&fmtStringer{"%v", []interface{}{err}}, true) ss.trInfo.tr.SetError() } ss.trInfo.tr.Finish() ss.trInfo.tr = nil ss.mu.Unlock() }() } var appErr error var server interface{} if srv != nil { server = srv.server } if s.opts.streamInt == nil { appErr = sd.Handler(server, ss) } else { info := &StreamServerInfo{ FullMethod: stream.Method(), IsClientStream: sd.ClientStreams, IsServerStream: sd.ServerStreams, } appErr = s.opts.streamInt(server, ss, info, sd.Handler) } if appErr != nil { appStatus, ok := status.FromError(appErr) if !ok { switch err := appErr.(type) { case transport.StreamError: appStatus = status.New(err.Code, err.Desc) default: appStatus = status.New(codes.Unknown, appErr.Error()) } appErr = appStatus.Err() } if trInfo != nil { ss.mu.Lock() ss.trInfo.tr.LazyLog(stringer(appStatus.Message()), true) ss.trInfo.tr.SetError() ss.mu.Unlock() } t.WriteStatus(ss.s, appStatus) // TODO: Should we log an error from WriteStatus here and below? return appErr } if trInfo != nil { ss.mu.Lock() ss.trInfo.tr.LazyLog(stringer("OK"), false) ss.mu.Unlock() } return t.WriteStatus(ss.s, status.New(codes.OK, "")) } func (s *Server) handleStream(t transport.ServerTransport, stream *transport.Stream, trInfo *traceInfo) { sm := stream.Method() if sm != "" && sm[0] == '/' { sm = sm[1:] } pos := strings.LastIndex(sm, "/") if pos == -1 { if trInfo != nil { trInfo.tr.LazyLog(&fmtStringer{"Malformed method name %q", []interface{}{sm}}, true) trInfo.tr.SetError() } errDesc := fmt.Sprintf("malformed method name: %q", stream.Method()) if err := t.WriteStatus(stream, status.New(codes.ResourceExhausted, errDesc)); err != nil { if trInfo != nil { trInfo.tr.LazyLog(&fmtStringer{"%v", []interface{}{err}}, true) trInfo.tr.SetError() } grpclog.Warningf("grpc: Server.handleStream failed to write status: %v", err) } if trInfo != nil { trInfo.tr.Finish() } return } service := sm[:pos] method := sm[pos+1:] srv, ok := s.m[service] if !ok { if unknownDesc := s.opts.unknownStreamDesc; unknownDesc != nil { s.processStreamingRPC(t, stream, nil, unknownDesc, trInfo) return } if trInfo != nil { trInfo.tr.LazyLog(&fmtStringer{"Unknown service %v", []interface{}{service}}, true) trInfo.tr.SetError() } errDesc := fmt.Sprintf("unknown service %v", service) if err := t.WriteStatus(stream, status.New(codes.Unimplemented, errDesc)); err != nil { if trInfo != nil { trInfo.tr.LazyLog(&fmtStringer{"%v", []interface{}{err}}, true) trInfo.tr.SetError() } grpclog.Warningf("grpc: Server.handleStream failed to write status: %v", err) } if trInfo != nil { trInfo.tr.Finish() } return } // Unary RPC or Streaming RPC? if md, ok := srv.md[method]; ok { s.processUnaryRPC(t, stream, srv, md, trInfo) return } if sd, ok := srv.sd[method]; ok { s.processStreamingRPC(t, stream, srv, sd, trInfo) return } if trInfo != nil { trInfo.tr.LazyLog(&fmtStringer{"Unknown method %v", []interface{}{method}}, true) trInfo.tr.SetError() } if unknownDesc := s.opts.unknownStreamDesc; unknownDesc != nil { s.processStreamingRPC(t, stream, nil, unknownDesc, trInfo) return } errDesc := fmt.Sprintf("unknown method %v", method) if err := t.WriteStatus(stream, status.New(codes.Unimplemented, errDesc)); err != nil { if trInfo != nil { trInfo.tr.LazyLog(&fmtStringer{"%v", []interface{}{err}}, true) trInfo.tr.SetError() } grpclog.Warningf("grpc: Server.handleStream failed to write status: %v", err) } if trInfo != nil { trInfo.tr.Finish() } } // The key to save ServerTransportStream in the context. type streamKey struct{} // NewContextWithServerTransportStream creates a new context from ctx and // attaches stream to it. // // This API is EXPERIMENTAL. func NewContextWithServerTransportStream(ctx context.Context, stream ServerTransportStream) context.Context { return context.WithValue(ctx, streamKey{}, stream) } // ServerTransportStream is a minimal interface that a transport stream must // implement. This can be used to mock an actual transport stream for tests of // handler code that use, for example, grpc.SetHeader (which requires some // stream to be in context). // // See also NewContextWithServerTransportStream. // // This API is EXPERIMENTAL. type ServerTransportStream interface { Method() string SetHeader(md metadata.MD) error SendHeader(md metadata.MD) error SetTrailer(md metadata.MD) error } // ServerTransportStreamFromContext returns the ServerTransportStream saved in // ctx. Returns nil if the given context has no stream associated with it // (which implies it is not an RPC invocation context). // // This API is EXPERIMENTAL. func ServerTransportStreamFromContext(ctx context.Context) ServerTransportStream { s, _ := ctx.Value(streamKey{}).(ServerTransportStream) return s } // Stop stops the gRPC server. It immediately closes all open // connections and listeners. // It cancels all active RPCs on the server side and the corresponding // pending RPCs on the client side will get notified by connection // errors. func (s *Server) Stop() { s.quitOnce.Do(func() { close(s.quit) }) defer func() { s.serveWG.Wait() s.doneOnce.Do(func() { close(s.done) }) }() s.channelzRemoveOnce.Do(func() { if channelz.IsOn() { channelz.RemoveEntry(s.channelzID) } }) s.mu.Lock() listeners := s.lis s.lis = nil st := s.conns s.conns = nil // interrupt GracefulStop if Stop and GracefulStop are called concurrently. s.cv.Broadcast() s.mu.Unlock() for lis := range listeners { lis.Close() } for c := range st { c.Close() } s.mu.Lock() if s.events != nil { s.events.Finish() s.events = nil } s.mu.Unlock() } // GracefulStop stops the gRPC server gracefully. It stops the server from // accepting new connections and RPCs and blocks until all the pending RPCs are // finished. func (s *Server) GracefulStop() { s.quitOnce.Do(func() { close(s.quit) }) defer func() { s.doneOnce.Do(func() { close(s.done) }) }() s.channelzRemoveOnce.Do(func() { if channelz.IsOn() { channelz.RemoveEntry(s.channelzID) } }) s.mu.Lock() if s.conns == nil { s.mu.Unlock() return } for lis := range s.lis { lis.Close() } s.lis = nil if !s.drain { for c := range s.conns { c.(transport.ServerTransport).Drain() } s.drain = true } // Wait for serving threads to be ready to exit. Only then can we be sure no // new conns will be created. s.mu.Unlock() s.serveWG.Wait() s.mu.Lock() for len(s.conns) != 0 { s.cv.Wait() } s.conns = nil if s.events != nil { s.events.Finish() s.events = nil } s.mu.Unlock() } func init() { internal.TestingUseHandlerImpl = func(arg interface{}) { arg.(*Server).opts.useHandlerImpl = true } } // contentSubtype must be lowercase // cannot return nil func (s *Server) getCodec(contentSubtype string) baseCodec { if s.opts.codec != nil { return s.opts.codec } if contentSubtype == "" { return encoding.GetCodec(proto.Name) } codec := encoding.GetCodec(contentSubtype) if codec == nil { return encoding.GetCodec(proto.Name) } return codec } // SetHeader sets the header metadata. // When called multiple times, all the provided metadata will be merged. // All the metadata will be sent out when one of the following happens: // - grpc.SendHeader() is called; // - The first response is sent out; // - An RPC status is sent out (error or success). func SetHeader(ctx context.Context, md metadata.MD) error { if md.Len() == 0 { return nil } stream := ServerTransportStreamFromContext(ctx) if stream == nil { return status.Errorf(codes.Internal, "grpc: failed to fetch the stream from the context %v", ctx) } return stream.SetHeader(md) } // SendHeader sends header metadata. It may be called at most once. // The provided md and headers set by SetHeader() will be sent. func SendHeader(ctx context.Context, md metadata.MD) error { stream := ServerTransportStreamFromContext(ctx) if stream == nil { return status.Errorf(codes.Internal, "grpc: failed to fetch the stream from the context %v", ctx) } if err := stream.SendHeader(md); err != nil { return toRPCErr(err) } return nil } // SetTrailer sets the trailer metadata that will be sent when an RPC returns. // When called more than once, all the provided metadata will be merged. func SetTrailer(ctx context.Context, md metadata.MD) error { if md.Len() == 0 { return nil } stream := ServerTransportStreamFromContext(ctx) if stream == nil { return status.Errorf(codes.Internal, "grpc: failed to fetch the stream from the context %v", ctx) } return stream.SetTrailer(md) } // Method returns the method string for the server context. The returned // string is in the format of "/service/method". func Method(ctx context.Context) (string, bool) { s := ServerTransportStreamFromContext(ctx) if s == nil { return "", false } return s.Method(), true }
{ "pile_set_name": "Github" }
page.title=Android 4.1 APIs excludeFromSuggestions=true sdk.platform.version=4.1 sdk.platform.apiLevel=16 @jd:body <div id="qv-wrapper"> <div id="qv"> <h2>In this document <a href="#" onclick="hideNestedItems('#toc41',this);return false;" class="header-toggle"> <span class="more">show more</span> <span class="less" style="display:none">show less</span></a></h2> <ol id="toc41" class="hide-nested"> <li><a href="#AppComponents">App Components</a> <ol> <li><a href="#Isolated">Isolated services</a></li> <li><a href="#Memory">Memory management</a></li> <li><a href="#ContentProvider">Content providers</a></li> <li><a href="#LiveWallpapers">Live Wallpapers</a></li> <li><a href="#StackNav">App stack navigation</a></li> </ol> </li> <li><a href="#Multimedia">Multimedia</a> <ol> <li><a href="#Codecs">Media codecs</a></li> <li><a href="#AudioCue">Record audio on cue</a></li> <li><a href="#TextTracks">Timed text tracks</a></li> <li><a href="#AudioEffects">Audio effects</a></li> <li><a href="#Gapless">Gapless playback</a></li> </ol> </li> <li><a href="#Camera">Camera</a> <ol> <li><a href="#AutoFocus">Auto focus movement</a></li> <li><a href="#CameraSounds">Camera sounds</a></li> </ol> </li> <li><a href="#Connectivity">Connectivity</a> <ol> <li><a href="#AndroidBeam">Android Beam</a></li> <li><a href="#LocalNsd">Network service discovery</a></li> <li><a href="#WiFiNsd">Wi-Fi P2P service discovery</a></li> <li><a href="#NetworkUsage">Network usage</a></li> </ol> </li> <li><a href="#A11y">Accessibility</a> <ol> <li><a href="#A11yService">Accessibility service APIs</a></li> <li><a href="#A11yCustomNav">Customizable app navigation</a></li> <li><a href="#A11yStructure">More accessible widgets</a></li> </ol> </li> <li><a href="#CopyPaste">Copy and Paste</a> <ol> <li><a href="#CopyIntent">Copy and paste with intents</a></li> </ol> </li> <li><a href="#Renderscript">Renderscript</a></li> <li><a href="#Animation">Animation</a> <ol> <li><a href="#ActivityOptions">Activity launch animations</a></li> <li><a href="#TimeAnimator">Time animator</a></li> </ol> </li> <li><a href="#UI">User Interface</a> <ol> <li><a href="#Notifications">Notifications</a></li> <li><a href="#SystemUI">Controls for system UI</a></li> <li><a href="#RemoteViews">Remote views</a></li> <li><a href="#Fonts">Font families</a></li> </ol> </li> <li><a href="#Input">Input Framework</a> <ol> <li><a href="#InputDevice">Multiple input devices</a></li> <li><a href="#Vibrate">Vibrate for input controllers</a></li> </ol> </li> <li><a href="#Permissions">Permissions</a></li> <li><a href="#DeviceFeatures">Device Features</a></li> </ol> <h2>See also</h2> <ol> <li><a href="{@docRoot}sdk/api_diff/16/changes.html">API Differences Report &raquo;</a> </li> </ol> </div> </div> <p>API Level: 16</p> <p>Android 4.1 ({@link android.os.Build.VERSION_CODES#JELLY_BEAN}) is a progression of the platform that offers improved performance and enhanced user experience. It adds new features for users and app developers. This document provides an introduction to the most notable and useful new APIs for app developers.</p> <div class="sidebox-wrapper"> <div class="sidebox"> <h3 id="ApiLevel">Declare your app API Level</h3> <p>To better optimize your app for devices running Android {@sdkPlatformVersion}, you should set your <a href="{@docRoot}guide/topics/manifest/uses-sdk-element.html#target">{@code targetSdkVersion}</a> to <code>"{@sdkPlatformApiLevel}"</code>, install it on an Android {@sdkPlatformVersion} system image, test it, then publish an update with this change.</p> <p>You can use APIs in Android {@sdkPlatformVersion} while also supporting older versions by adding conditions to your code that check for the system API level before executing APIs not supported by your <a href="{@docRoot}guide/topics/manifest/uses-sdk-element.html#min">{@code minSdkVersion}</a>. To learn more about maintaining backward-compatibility, read <a href="{@docRoot}training/backward-compatible-ui/index.html">Creating Backward-Compatible UIs</a>.</p> <p>More information about how API levels work is available in <a href="{@docRoot}guide/topics/manifest/uses-sdk-element.html#ApiLevels">What is API Level?</a></p> </div> </div> <p>As an app developer, Android 4.1 is available to you from the <a href="{@docRoot}tools/help/sdk-manager.html">SDK Manager</a> as a system image you can run in the Android emulator and an SDK platform against which you can build your app. You should download the system image and platform as soon as possible to build and test your app on Android 4.1.</p> <h2 id="AppComponents">App Components</h2> <h3 id="Isolated">Isolated services</h3> <p>By specifying <a href="{@docRoot}guide/topics/manifest/service-element.html#isolated">{@code android:isolatedProcess="true"}</a> in the <a href="{@docRoot}guide/topics/manifest/service-element.html">{@code <service>}</a> tag, your {@link android.app.Service} will run under its own isolated user ID process that has no permissions of its own.</p> <h3 id="Memory">Memory management</h3> <p>New {@link android.content.ComponentCallbacks2} constants such as {@link android.content.ComponentCallbacks2#TRIM_MEMORY_RUNNING_LOW} and {@link android.content.ComponentCallbacks2#TRIM_MEMORY_RUNNING_CRITICAL} provide foreground processes more information about memory state before the system calls {@link android.app.Activity#onLowMemory()}.</p> <p>New {@link android.app.ActivityManager#getMyMemoryState} method allows you to retrieve the general memory state.</p> <h3 id="ContentProvider">Content providers</h3> <p>A new method, {@link android.content.ContentResolver#acquireUnstableContentProviderClient acquireUnstableContentProviderClient()}, allows you to access a {@link android.content.ContentProviderClient} that may be "unstable" such that your app will not crash if the content provider does. It's useful when you are interacting with content providers in a separate app.</p> <h3 id="LiveWallpapers">Live Wallpapers</h3> <p>New intent protocol to directly launch the live wallpaper preview activity so you can help users easily select your live wallpaper without forcing them to leave your app and navigate through the Home wallpaper picker.</p> <p>To launch the live wallpaper picker, call {@link android.content.Context#startActivity startActivity()} with an {@link android.content.Intent} using {@link android.app.WallpaperManager#ACTION_CHANGE_LIVE_WALLPAPER} and an extra that specifies your live wallpaper {@link android.content.ComponentName} as a string in {@link android.app.WallpaperManager#EXTRA_LIVE_WALLPAPER_COMPONENT}.</p> <h3 id="StackNav">App stack navigation</h3> <p>Android 4.1 makes it much easier to implement the proper design patterns for Up navigation. All you need to do is add the <a href="{@docRoot}guide/topics/manifest/activity-element.html#parent">{@code android:parentActivityName}</a> to each <a href="{@docRoot}guide/topics/manifest/activity-element.html">{@code <activity>}</a> element in your manifest file. The system uses this information to open the appropriate activity when the user presses the Up button in the action bar (while also finishing the current activity). So if you declare the <a href="{@docRoot}guide/topics/manifest/activity-element.html#parent">{@code android:parentActivityName}</a> for each activity, you don't need the {@link android.app.Activity#onOptionsItemSelected onOptionsItemSelected()} method to handle click events on the action bar's app icon&mdash;the system now handles that event and resumes or creates the appropriate activity.</p> <p>This is particularly powerful for scenarios in which the user enters one of your app's activities through a "deep dive" intent such as from a notification or an intent from different app (as described in the design guide for <a href="{@docRoot}design/patterns/navigation.html#between-apps">Navigating Between Apps</a>). When the user enters your activity this way, your app may not naturally have a back stack of activities that can be resumed as the user navigates up. However, when you supply the <a href="{@docRoot}guide/topics/manifest/activity-element.html#parent">{@code android:parentActivityName}</a> attribute for your activities, the system recognizes whether or not your app already contains a back stack of parent activities and, if not, constructs a synthetic back stack that contains all parent activities.</p> <p class="note"><strong>Note:</strong> When the user enters a deep activity in your app and it creates a new task for your app, the system actually inserts the stack of parent activities into the task. As such, pressing the Back button also navigates back through the stack of parent activities.</p> <p>When the system creates a synthetic back stack for your app, it builds a basic {@link android.content.Intent} to create a new instance of each parent activity. So there's no saved state for the parent activities the way you'd expect had the user naturally navigated through each activity. If any of the parent activities normally show a UI that's dependent on the user's context, that context information will be missing and you should deliver it when the user navigates back through the stack. For example, if the user is viewing an album in a music app, navigating up might bring them to an activity that lists all albums in a chosen music genre. In this case, if the stack must be created, it's necessary that you inform the parent activity what genre the current album belongs to so that the parent can display the proper list as if the user actually came from that activity. To deliver such information to a synthetic parent activity, you must override the {@link android.app.Activity#onPrepareNavigateUpTaskStack onPrepareNavigateUpTaskStack()} method. This provides you with a {@link android.app.TaskStackBuilder} object that the system created in order to synthesize the parent activities. The {@link android.app.TaskStackBuilder} contains {@link android.content.Intent} objects that the system uses to create each parent activity. In your implementation of {@link android.app.Activity#onPrepareNavigateUpTaskStack onPrepareNavigateUpTaskStack()}, you can modify the appropriate {@link android.content.Intent} to add extra data that the parent activity can use to determine the appropriate context and display the appropriate UI.</p> <p>When the system creates the {@link android.app.TaskStackBuilder}, it adds the {@link android.content.Intent} objects that are used to create the parent activities in their logical order beginning from the top of the activity tree. So, the last {@link android.content.Intent} added to the internal array is the direct parent of the current activity. If you want to modify the {@link android.content.Intent} for the activity's parent, first determine the length of the array with {@link android.app.TaskStackBuilder#getIntentCount()} and pass that value to {@link android.app.TaskStackBuilder#editIntentAt editIntentAt()}.</p> <p>If your app structure is more complex, there are several other APIs available that allow you to handle the behavior of Up navigation and fully customize the synthetic back stack. Some of the APIs that give you additional control include:</p> <dl> <dt>{@link android.app.Activity#onNavigateUp}</dt> <dd>Override this to perform a custom action when the user presses the Up button.</dd> <dt>{@link android.app.Activity#navigateUpTo}</dt> <dd>Call this to finish the current activity and go to the activity indicated by the supplied {@link android.content.Intent}. If the activity exists in the back stack, but is not the closest parent, then all other activities between the current activity and the activity specified with the intent are finished as well.</dd> <dt>{@link android.app.Activity#getParentActivityIntent}</dt> <dd>Call this to get the {@link android.content.Intent} that will start the logical parent for the current activity.</dd> <dt>{@link android.app.Activity#shouldUpRecreateTask}</dt> <dd>Call this to query whether a synthetic back stack must be created in order to navigate up. Returns true if a synthetic stack must be created, false if the appropropriate stack already exists.</dd> <dt>{@link android.app.Activity#finishAffinity}</dt> <dd>Call this to finish the current activity and all parent activities with the same task affinity that are chained to the current activity. If you override the default behaviors such as {@link android.app.Activity#onNavigateUp}, you should call this method when you create a synthetic back stack upon Up navigation.</dd> <dt>{@link android.app.Activity#onCreateNavigateUpTaskStack onCreateNavigateUpTaskStack}</dt> <dd>Override this if you need to fully control how the synthetic task stack is created. If you want to simply add some extra data to the intents for your back stack, you should instead override {@link android.app.Activity#onPrepareNavigateUpTaskStack onPrepareNavigateUpTaskStack()}</dd> </dl> <p>However, most apps don't need to use these APIs or implement {@link android.app.Activity#onPrepareNavigateUpTaskStack onPrepareNavigateUpTaskStack()}, but can can achieve the correct behavior simply by adding <a href="{@docRoot}guide/topics/manifest/activity-element.html#parent">{@code android:parentActivityName}</a> to each <a href="{@docRoot}guide/topics/manifest/activity-element.html">{@code <activity>}</a> element.</p> <h2 id="Multimedia">Multimedia</h2> <h3 id="Codecs">Media codecs</h3> <p>The {@link android.media.MediaCodec} class provides access to low-level media codecs for encoding and decoding your media. You can instantiate a {@link android.media.MediaCodec} by calling {@link android.media.MediaCodec#createEncoderByType createEncoderByType()} to encode media or call {@link android.media.MediaCodec#createDecoderByType createDecoderByType()} to decode media. Each of these methods take a MIME type for the type of media you want to encode or decode, such as {@code "video/3gpp"} or {@code "audio/vorbis"}. </p> <p>With an instance of {@link android.media.MediaCodec} created, you can then call {@link android.media.MediaCodec#configure configure()} to specify properties such as the media format or whether or not the content is encrypted.</p> <p>Whether you're encoding or decoding your media, the rest of the process is the same after you create the {@link android.media.MediaCodec}. First call {@link android.media.MediaCodec#getInputBuffers()} to get an array of input {@link java.nio.ByteBuffer} objects and {@link android.media.MediaCodec#getOutputBuffers()} to get an array of output {@link java.nio.ByteBuffer} objects.</p> <p>When you're ready to encode or decode, call {@link android.media.MediaCodec#dequeueInputBuffer dequeueInputBuffer()} to get the index position of the {@link java.nio.ByteBuffer} (from the array of input buffers) that you should use to to feed in your source media. After you fill the {@link java.nio.ByteBuffer} with your source media, release ownership of the buffer by calling {@link android.media.MediaCodec#queueInputBuffer queueInputBuffer()}.</p> <p>Likewise for the output buffer, call {@link android.media.MediaCodec#dequeueOutputBuffer dequeueOutputBuffer()} to get the index position of the {@link java.nio.ByteBuffer} where you'll receive the results. After you read the output from the {@link java.nio.ByteBuffer}, release ownership by calling {@link android.media.MediaCodec#releaseOutputBuffer releaseOutputBuffer()}.</p> <p>You can handle encrypted media data in the codecs by calling {@link android.media.MediaCodec#queueSecureInputBuffer queueSecureInputBuffer()} in conjunction with the {@link android.media.MediaCrypto} APIs, instead of the normal {@link android.media.MediaCodec#queueInputBuffer queueInputBuffer()}.</p> <p>For more information about how to use codecs, see the {@link android.media.MediaCodec} documentation.</p> <!-- <h3 id="Routing">Media routing</h3> <p>The new {@link android.media.MediaRouter} class allows you to route media channels and streams from the current device to external speakers and other devices. You can acquire an instance of {@link android.media.MediaRouter} by calling {@link android.content.Context#getSystemService getSystemService(}{@link android.content.Context#MEDIA_ROUTER_SERVICE MEDIA_ROUTER_SERVICE)}.</p> --> <h3 id="AudioCue">Record audio on cue</h3> <p>New method {@link android.media.AudioRecord#startRecording startRecording()} allows you to begin audio recording based on a cue defined by a {@link android.media.MediaSyncEvent}. The {@link android.media.MediaSyncEvent} specifies an audio session (such as one defined by {@link android.media.MediaPlayer}), which when complete, triggers the audio recorder to begin recording. For example, you can use this functionality to play an audio tone that indicates the beginning of a recording session and recording automatically begins so you don't have to manually synchronize the tone and the beginning of recording.</p> <h3 id="TextTracks">Timed text tracks</h3> <p>The {@link android.media.MediaPlayer} now handles both in-band and out-of-band text tracks. In-band text tracks come as a text track within an MP4 or 3GPP media source. Out-of-band text tracks can be added as an external text source via {@link android.media.MediaPlayer#addTimedTextSource addTimedTextSource()} method. After all external text track sources are added, {@link android.media.MediaPlayer#getTrackInfo()} should be called to get the refreshed list of all available tracks in a data source.</p> <p>To set the track to use with the {@link android.media.MediaPlayer}, you must call {@link android.media.MediaPlayer#selectTrack selectTrack()}, using the index position for the track you want to use.</p> <p>To be notified when the text track is ready to play, implement the {@link android.media.MediaPlayer.OnTimedTextListener} interface and pass it to {@link android.media.MediaPlayer#setOnTimedTextListener setOnTimedTextListener()}.</p> <h3 id="AudioEffects">Audio effects</h3> <p>The {@link android.media.audiofx.AudioEffect} class now supports additional audio pre-processing types when capturing audio:</p> <ul> <li>Acoustic Echo Canceler (AEC) with {@link android.media.audiofx.AcousticEchoCanceler} removes the contribution of the signal received from the remote party from the captured audio signal.</li> <li>Automatic Gain Control (AGC) with {@link android.media.audiofx.AutomaticGainControl} automatically normalizes the output of the captured signal.</li> <li>Noise Suppressor (NS) with {@link android.media.audiofx.NoiseSuppressor} removes background noise from the captured signal.</li> </ul> <p>You can apply these pre-processor effects on audio captured with an {@link android.media.AudioRecord} using one of the {@link android.media.audiofx.AudioEffect} subclasses.</p> <p class="note"><strong>Note:</strong> It's not guaranteed that all devices support these effects, so you should always first check availability by calling {@link android.media.audiofx.AcousticEchoCanceler#isAvailable isAvailable()} on the corresponding audio effect class.</p> <h3 id="Gapless">Gapless playback</h3> <p>You can now perform gapless playback between two separate {@link android.media.MediaPlayer} objects. At any time before your first {@link android.media.MediaPlayer} finishes, call {@link android.media.MediaPlayer#setNextMediaPlayer setNextMediaPlayer()} and Android attempts to start the second player the moment that the first one stops.</p> Media router. The new APIs MediaRouter, MediaRouteActionProvider, and MediaRouteButton provide standard mechanisms and UI for choosing where to play media. <h2 id="Camera">Camera</h2> <h3 id="AutoFocus">Auto focus movement</h3> <p>The new interface {@link android.hardware.Camera.AutoFocusMoveCallback} allows you to listen for changes to the auto focus movement. You can register your interface with {@link android.hardware.Camera#setAutoFocusMoveCallback setAutoFocusMoveCallback()}. Then when the camera is in a continuous autofocus mode ({@link android.hardware.Camera.Parameters#FOCUS_MODE_CONTINUOUS_VIDEO} or {@link android.hardware.Camera.Parameters#FOCUS_MODE_CONTINUOUS_PICTURE}), you'll receive a call to {@link android.hardware.Camera.AutoFocusMoveCallback#onAutoFocusMoving onAutoFocusMoving()}, which tells you whether auto focus has started moving or has stopped moving.</p> <h3 id="CameraSounds">Camera sounds</h3> <p>The {@link android.media.MediaActionSound} class provides a simple set of APIs to produce standard sounds made by the camera or other media actions. You should use these APIs to play the appropriate sound when building a custom still or video camera.</p> <p>To play a sound, simply instantiate a {@link android.media.MediaActionSound} object, call {@link android.media.MediaActionSound#load load()} to pre-load the desired sound, then at the appropriate time, call {@link android.media.MediaActionSound#play play()}.</p> <h2 id="Connectivity">Connectivity</h2> <h3 id="AndroidBeam">Android Beam</h3> <p>Android Beam&trade; now supports large payload transfers over Bluetooth. When you define the data to transfer with either the new {@link android.nfc.NfcAdapter#setBeamPushUris setBeamPushUris()} method or the new callback interface {@link android.nfc.NfcAdapter.CreateBeamUrisCallback}, Android hands off the data transfer to Bluetooth or another alternate transport to achieve faster transfer speeds. This is especially useful for large payloads such as image and audio files and requires no visible pairing between the devices. No additional work is required by your app to take advantage of transfers over Bluetooth.</p> <p>The {@link android.nfc.NfcAdapter#setBeamPushUris setBeamPushUris()} method takes an array of {@link android.net.Uri} objects that specify the data you want to transfer from your app. Alternatively, you can implement the {@link android.nfc.NfcAdapter.CreateBeamUrisCallback} interface, which you can specify for your activity by calling {@link android.nfc.NfcAdapter#setBeamPushUrisCallback setBeamPushUrisCallback()}.</p> <p>When using the callback interface, the system calls the interface's {@link android.nfc.NfcAdapter.CreateBeamUrisCallback#createBeamUris createBeamUris()} method when the user executes a share with Android Beam so that you can define the URIs to share at share-time. This is useful if the URIs to share might vary depending on the user context within the activity, whereas calling {@link android.nfc.NfcAdapter#setBeamPushUris setBeamPushUris()} is useful when the URIs to share are unchanging and you can safely define them ahead of time.</p> <h3 id="LocalNsd">Network service discovery</h3> <p>Android 4.1 adds support for multicast DNS-based service discovery, which allows you to find and connect to services offered by peer devices over Wi-Fi, such as mobile devices, printers, cameras, media players, and others that are registered on the local network.</p> <p>The new package {@link android.net.nsd} contains the new APIs that allow you to broadcast your services on the local network, discover local devices on the network, and connect to devices.</p> <p>To register your service, you must first create an {@link android.net.nsd.NsdServiceInfo} object and define the various properties of your service with methods such as {@link android.net.nsd.NsdServiceInfo#setServiceName setServiceName()}, {@link android.net.nsd.NsdServiceInfo#setServiceType setServiceType()}, and {@link android.net.nsd.NsdServiceInfo#setPort setPort()}. </p> <p>Then you need to implement {@link android.net.nsd.NsdManager.RegistrationListener} and pass it to {@link android.net.nsd.NsdManager#registerService registerService()} with your {@link android.net.nsd.NsdServiceInfo}.</p> <p>To discover services on the network, implement {@link android.net.nsd.NsdManager.DiscoveryListener} and pass it to {@link android.net.nsd.NsdManager#discoverServices discoverServices()}.</p> <p>When your {@link android.net.nsd.NsdManager.DiscoveryListener} receives callbacks about services found, you need to resolve the service by calling {@link android.net.nsd.NsdManager#resolveService resolveService()}, passing it an implementation of {@link android.net.nsd.NsdManager.ResolveListener} that receives an {@link android.net.nsd.NsdServiceInfo} object that contains information about the discovered service, allowing you to initiate the connection.</p> <h3 id="WiFiNsd">Wi-Fi P2P service discovery</h3> <p>The Wi-Fi P2P APIs are enhanced in Android 4.1 to support pre-association service discovery in the {@link android.net.wifi.p2p.WifiP2pManager}. This allows you to discover and filter nearby devices by services using Wi-Fi P2P before connecting to one, while Network Service Discovery allows you to discover a service on an existing connected network (such as a local Wi-Fi network).</p> <p>To broadcast your app as a service over Wi-Fi so that other devices can discover your app and connect to it, call {@link android.net.wifi.p2p.WifiP2pManager#addLocalService addLocalService()} with a {@link android.net.wifi.p2p.nsd.WifiP2pServiceInfo} object that describes your app services.</p> <p>To initiate discover of nearby devices over Wi-Fi, you need to first decide whether you'll communicate using Bonjour or Upnp. To use Bonjour, first set up some callback listeners with {@link android.net.wifi.p2p.WifiP2pManager#setDnsSdResponseListeners setDnsSdResponseListeners()}, which takes both a {@link android.net.wifi.p2p.WifiP2pManager.DnsSdServiceResponseListener} and {@link android.net.wifi.p2p.WifiP2pManager.DnsSdTxtRecordListener}. To use Upnp, call {@link android.net.wifi.p2p.WifiP2pManager#setUpnpServiceResponseListener setUpnpServiceResponseListener()}, which takes a {@link android.net.wifi.p2p.WifiP2pManager.UpnpServiceResponseListener}.</p> <p>Before you can start discovering services on local devices, you also need to call {@link android.net.wifi.p2p.WifiP2pManager#addServiceRequest addServiceRequest()}. When the {@link android.net.wifi.p2p.WifiP2pManager.ActionListener} you pass to this method receives a successful callback, you can then begin discovering services on local devices by calling {@link android.net.wifi.p2p.WifiP2pManager#discoverServices discoverServices()}.</p> <p>When local services are discovered, you'll receive a callback to either the {@link android.net.wifi.p2p.WifiP2pManager.DnsSdServiceResponseListener} or {@link android.net.wifi.p2p.WifiP2pManager.UpnpServiceResponseListener}, depending on whether you registered to use Bonjour or Upnp. The callback received in either case contains a {@link android.net.wifi.p2p.WifiP2pDevice} object representing the peer device.</p> <h3 id="NetworkUsage">Network usage</h3> <p>The new method {@link android.net.ConnectivityManager#isActiveNetworkMetered} allows you to check whether the device is currently connected to a metered network. By checking this state before performing intensive network transactions, you can help manage the data usage that may cost your users money and make informed decisions about whether to perform the transactions now or later (such as when the device becomes connected to Wi-Fi).</p> <h2 id="A11y">Accessibility</h2> <h3 id="A11yService">Accessibility service APIs</h3> <p>The reach of accessibility service APIs has been significantly increased in Android 4.1. It now allows you to build services that monitor and respond to more input events, such as complex gestures using {@link android.accessibilityservice.AccessibilityService#onGesture onGesture()} and other input events through additions to the {@link android.view.accessibility.AccessibilityEvent}, {@link android.view.accessibility.AccessibilityNodeInfo} and {@link android.view.accessibility.AccessibilityRecord} classes.</p> <p>Accessibility services can also perform actions on behalf of the user, including clicking, scrolling and stepping through text using {@link android.view.accessibility.AccessibilityNodeInfo#performAction performAction} and {@link android.view.accessibility.AccessibilityNodeInfo#setMovementGranularities setMovementGranularities}. The {@link android.accessibilityservice.AccessibilityService#performGlobalAction performGlobalAction()} method also allows services to perform actions such as Back, Home, and open Recent Apps and Notifications.</p> <h3 id="A11yCustomNav">Customizable app navigation</h3> <p>When building an Android app, you can now customize navigation schemes by finding focusable elements and input widgets using {@link android.view.accessibility.AccessibilityNodeInfo#findFocus findFocus()} and {@link android.view.accessibility.AccessibilityNodeInfo#focusSearch focusSearch()}, and set focus using {@link android.view.accessibility.AccessibilityNodeInfo#setAccessibilityFocused setAccessibilityFocused()}.</p> <h3 id="A11yStructure">More accessible widgets</h3> <p>The new {@code android.view.accessibility.AccessibilityNodeProvider} class allows you to surface complex custom views to accessibility services so they can present the information in a more accessible way. The {@code android.view.accessibility.AccessibilityNodeProvider} allows a user widget with advanced content, such as a calendar grid, to present a logical semantic structure for accessibility services that is completely separate from the widget’s layout structure. This semantic structure allows accessibility services to present a more useful interaction model for users who are visually impaired.</p> <h2 id="CopyPaste">Copy and Paste</h2> <h3 id="CopyIntent">Copy and paste with intents</h3> <p>You can now associate a {@link android.content.ClipData} object with an {@link android.content.Intent} using the {@link android.content.Intent#setClipData setClipData()} method. This is especially useful when using an intent to transfer multiple {@code content:} URIs to another application, such as when sharing multiple documents. The {@code content:} URIs supplied this way will also respect the intent's flags to offer read or write access, allowing you to grant access to multiple URIs in an the intent. When starting an {@link android.content.Intent#ACTION_SEND} or {@link android.content.Intent#ACTION_SEND_MULTIPLE} intent, the URIs supplied in the intent are now automatically propagated to the {@link android.content.ClipData} so that the receiver can have access granted to them.</p> <h5>Support for HTML and string styles</h5> <p>The {@link android.content.ClipData} class now supports styled text (either as HTML or Android <a href="{@docRoot}guide/topics/resources/string-resource.html#FormattingAndStyling">styled strings</a>). You can add HTML styled text to the {@link android.content.ClipData} with {@link android.content.ClipData#newHtmlText newHtmlText()}.</p> <h2 id="Renderscript">Renderscript</h2> <p>Renderscript computation functionality has been enhanced with the following features:</p> <ul> <li>Support for multiple kernels within one script.</li> <li>Support for reading from allocation with filtered samplers from compute in a new script API {@code rsSample}.</li> <li>Support for different levels of FP precision in {@code #pragma}.</li> <li>Support for querying additional information from RS objects from a compute script.</li> <li>Numerous performance improvements.</li> </ul> <p>New pragmas are also available to define the floating point precision required by your compute Renderscripts. This lets you enable NEON like operations such as fast vector math operations on the CPU path that wouldn’t otherwise be possible with full IEEE 754-2008 standard.</p> <p class="note"><strong>Note:</strong> The experimental Renderscript graphics engine is now deprecated.</p> <h2 id="Animation">Animation</h2> <h3 id="ActivityOptions">Activity launch animations</h3> <p>You can now launch an {@link android.app.Activity} using zoom animations or your own custom animations. To specify the animation you want, use the {@link android.app.ActivityOptions} APIs to build a {@link android.os.Bundle} that you can then pass to any of the methods that start an activity, such as {@link android.app.Activity#startActivity(Intent,Bundle) startActivity()}.</p> <p>The {@link android.app.ActivityOptions} class includes a different method for each type of animation you may want to show as your activity opens:</p> <dl> <dt>{@link android.app.ActivityOptions#makeScaleUpAnimation makeScaleUpAnimation()}</dt> <dd>Creates an animation that scales up the activity window from a specified starting position on the screen and a specified starting size. For example, the home screen in Android 4.1 uses this when opening an app.</dd> <dt>{@link android.app.ActivityOptions#makeThumbnailScaleUpAnimation makeThumbnailScaleUpAnimation()}</dt> <dd>Creates an animation that scales up the activity window starting from a specified position and a provided thumbnail image. For example, the Recent Apps window in Android 4.1 uses this when returning to an app.</dd> <dt>{@link android.app.ActivityOptions#makeCustomAnimation makeCustomAnimation()}</dt> <dd>Creates an animation defined by your own resources: one that defines the animation for the activity opening and another for the activity being stopped.</dd> </dl> <h3 id="TimeAnimator">Time animator</h3> <p>The new {@link android.animation.TimeAnimator} provides a simple callback mechanism with the {@link android.animation.TimeAnimator.TimeListener} that notifies you upon every frame of the animation. There is no duration, interpolation, or object value-setting with this Animator. The listener's callback receives information for each frame including total elapsed time and the elapsed time since the previous animation frame.</p> <h2 id="UI">User Interface</h2> <h3 id="Notifications">Notifications</h3> <p>In Android 4.1, you can create notifications with larger content regions, big image previews, multiple action buttons, and configurable priority.</p> <h5>Notification styles</h5> <p>The new method {@link android.app.Notification.Builder#setStyle setStyle()} allows you to specify one of three new styles for your notification that each offer a larger content region. To specify the style for your large content region, pass {@link android.app.Notification.Builder#setStyle setStyle()} one of the following objects:</p> <dl> <dt>{@link android.app.Notification.BigPictureStyle}</dt> <dd>For notifications that includes a large image attachment.</dd> <dt>{@link android.app.Notification.BigTextStyle}</dt> <dd>For notifications that includes a lot of text, such as a single email.</dd> <dt>{@link android.app.Notification.InboxStyle}</dt> <dd>For notifications that include a list of strings, such as snippets from multiple emails.</dd> </dl> <h5>Notification actions</h5> <p>There's now support for up to two action buttons that appear at the bottom of the notification message, whether your notification uses the normal or larger style.</p> <p>To add an action button, call {@link android.app.Notification.Builder#addAction addAction()}. This method takes three arguments: a drawable resource for an icon, text for the button, and a {@link android.app.PendingIntent} that defines the action to perfrom.</p> <h5>Priorities</h5> <p>You can now hint to the system how important your notification is to affect the order of your notification in the list by setting the priority with {@link android.app.Notification.Builder#setPriority setPriority()}. You can pass this one of five different priority levels defined by {@code PRIORITY_*} constants in the {@link android.app.Notification} class. The default is {@link android.app.Notification#PRIORITY_DEFAULT}, and there's two levels higher and two levels lower.</p> <p>High priority notifications are things that users generally want to respond to quickly, such as a new instant message, text message, or impending event reminder. Low priority notifications are things like expired calendar events or app promotions.</p> <h3 id="SystemUI">Controls for system UI</h3> <p>Android 4.0 (Ice Cream Sandwich) added new flags to control the visibility of the system UI elements, such as to dim the appearance of the system bar or make it disappear completely on handsets. Android 4.1 adds a few more flags that allow you to further control the appearance of system UI elements and your activity layout in relation to them by calling {@link android.view.View#setSystemUiVisibility setSystemUiVisibility()} and passing the following flags:</p> <dl> <dt>{@link android.view.View#SYSTEM_UI_FLAG_FULLSCREEN}</dt> <dd>Hides non-critical system UI (such as the status bar). If your activity uses the action bar in overlay mode (by enabling <a href="{@docRoot}reference/android/R.attr.html#windowActionBarOverlay">{@code android:windowActionBarOverlay}</a>), then this flag also hides the action bar and does so with a coordinated animation when both hiding and showing the two.</dd> <dt>{@link android.view.View#SYSTEM_UI_FLAG_LAYOUT_FULLSCREEN}</dt> <dd>Sets your activity layout to use the same screen area that's available when you've enabled {@link android.view.View#SYSTEM_UI_FLAG_FULLSCREEN} even if the system UI elements are still visible. Although parts of your layout will be overlayed by the system UI, this is useful if your app often hides and shows the system UI with {@link android.view.View#SYSTEM_UI_FLAG_FULLSCREEN}, because it avoids your layout from adjusting to the new layout bounds each time the system UI hides or appears.</dd> <dt>{@link android.view.View#SYSTEM_UI_FLAG_LAYOUT_HIDE_NAVIGATION}</dt> <dd>Sets your activity layout to use the same screen area that's available when you've enabled {@link android.view.View#SYSTEM_UI_FLAG_HIDE_NAVIGATION} (added in Android 4.0) even if the system UI elements are still visible. Although parts of your layout will be overlayed by the navigation bar, this is useful if your app often hides and shows the navigation bar with {@link android.view.View#SYSTEM_UI_FLAG_HIDE_NAVIGATION}, because it avoids your layout from adjusting to the new layout bounds each time the navigation bar hides or appears.</dd> <dt>{@link android.view.View#SYSTEM_UI_FLAG_LAYOUT_STABLE}</dt> <dd>You might want to add this flag if you're using {@link android.view.View#SYSTEM_UI_FLAG_LAYOUT_FULLSCREEN} and/or {@link android.view.View#SYSTEM_UI_FLAG_LAYOUT_HIDE_NAVIGATION} to ensure that when you call {@link android.view.View#fitSystemWindows fitSystemWindows()} on a view that the bounds defined remain consistent with regard to the available screen space. That is, with this flag set, {@link android.view.View#fitSystemWindows fitSystemWindows()} will behave as if the visibility of system UI elements is unchanged even after you hide all system UI.</dd> <dd></dd> </dl> <p>For more discussion about the other related system UI flags, read about those added in <a href="{@docRoot}about/versions/android-4.0.html#SystemUI">Android 4.0</a>.</p> <h3 id="RemoteViews">Remote views</h3> <p>{@link android.widget.GridLayout} and {@link android.view.ViewStub} are now remotable views so you can use them in layouts for your app widgets and notification custom layouts.</p> <h3 id="Fonts">Font families</h3> <p>Android 4.1 adds several more variants of the Roboto font style for a total of 10 variants, and they're all usable by apps. Your apps now have access to the full set of both light and condensed variants.</p> <p>The complete set of Roboto font variants available is:</p> <ul> <li>Regular</li> <li>Italic</li> <li>Bold</li> <li>Bold-italic</li> <li>Light</li> <li>Light-italic</li> <li>Condensed regular</li> <li>Condensed italic</li> <li>Condensed bold</li> <li>Condensed bold-italic</li> </ul> <p>You can apply any one of these with the new {@link android.R.attr#fontFamily} attribute in combination with the {@link android.R.attr#textStyle} attribute.</p> <p>Supported values for {@link android.R.attr#fontFamily} are:</p> <ul> <li>{@code "sans-serif"} for regular Roboto</li> <li>{@code "sans-serif-light"} for Roboto Light</li> <li>{@code "sans-serif-condensed"} for Roboto Condensed</li> </ul> <p>You can then apply bold and/or italic with {@link android.R.attr#textStyle} values {@code "bold"} and {@code "italic"}. You can apply both like so: {@code android:textStyle="bold|italic"}.</p> <p>You can also use {@link android.graphics.Typeface#create Typeface.create()}. For example, {@code Typeface.create("sans-serif-light", Typeface.NORMAL)}.</p> <h2 id="Input">Input Framework</h2> <h3 id="InputDevice">Multiple input devices</h3> <p>The new {@link android.hardware.input.InputManager} class allows you to query the set of input devices current connected and register to be notified when a new device is added, changed, or removed. This is particularly useful if you're building a game that supports multiple players and you want to detect how many controllers are connected and when there are changes to the number of controllers.</p> <p>You can query all input devices connected by calling {@link android.hardware.input.InputManager#getInputDeviceIds()}. This returns an array of integers, each of which is an ID for a different input device. You can then call {@link android.hardware.input.InputManager#getInputDevice getInputDevice()} to acquire an {@link android.view.InputDevice} for a specified input device ID.</p> <p>If you want to be informed when new input devices are connected, changed, or disconnected, implement the {@link android.hardware.input.InputManager.InputDeviceListener} interface and register it with {@link android.hardware.input.InputManager#registerInputDeviceListener registerInputDeviceListener()}.</p> <h3 id="Vibrate">Vibrate for input controllers</h3> <p>If connected input devices have their own vibrate capabilities, you can now control the vibration of those devices using the existing {@link android.os.Vibrator} APIs simply by calling {@link android.view.InputDevice#getVibrator()} on the {@link android.view.InputDevice}.</p> <h2 id="Permissions">Permissions</h2> <p>The following are new permissions:</p> <dl> <dt>{@link android.Manifest.permission#READ_EXTERNAL_STORAGE}</dt> <dd>Provides protected read access to external storage. In Android 4.1 by default all applications still have read access. This will be changed in a future release to require that applications explicitly request read access using this permission. If your application already requests write access, it will automatically get read access as well. There is a new developer option to turn on read access restriction, for developers to test their applications against how Android will behave in the future.</dd> <dt>android.Manifest.permission.READ_USER_DICTIONARY</dt> <dd>Allows an application to read the user dictionary. This should only be required by an IME, or a dictionary editor like the Settings app.</dd> <dt>{@link android.Manifest.permission#READ_CALL_LOG}</dt> <dd>Allows an application to read the system's call log that contains information about incoming and outgoing calls.</dd> <dt>{@link android.Manifest.permission#WRITE_CALL_LOG}</dt> <dd>Allows an application to modify the system's call log stored on your phone</dd> <dt>android.Manifest.permission.WRITE_USER_DICTIONARY</dt> <dd>Allows an application to write to the user's word dictionary.</dd> </dl> <h2 id="DeviceFeatures">Device Features</h2> <p>Android 4.1 includes a new feature declaration for devices that are dedicated to displaying the user interface on a television screen: {@link android.content.pm.PackageManager#FEATURE_TELEVISION}. To declare that your app requires a television interface, declare this feature in your manifest file with the <a href="{@docRoot}guide/topics/manifest/uses-feature-element.html">{@code <uses-feature>}</a> element:</p> <pre> &lt;manifest ... &gt; &lt;uses-feature android:name="android.hardware.type.television" android:required="true" /&gt; ... &lt;/manifest&gt; </pre> <p>This feature defines "television" to be a typical living room television experience: displayed on a big screen, where the user is sitting far away and the dominant form of input is be something like a d-pad, and generally not through touch or a mouse/pointer-device.</p>
{ "pile_set_name": "Github" }
#!/bin/sh nice -n19 %OPTWARE_TARGET_PREFIX%/bin/hellanzb.py -D
{ "pile_set_name": "Github" }
import std.stdio, std.algorithm, std.random, std.range; void knuthShuffle(Range)(Range r) if (isRandomAccessRange!Range && hasLength!Range && hasSwappableElements!Range) { foreach_reverse (immutable i, ref ri; r[1 .. $ - 1]) ri.swap(r[uniform(0, i + 1)]); } void main() { auto a = [1, 2, 3, 4, 5, 6, 7, 8, 9]; a.knuthShuffle; a.writeln; }
{ "pile_set_name": "Github" }
layer at (0,0) size 800x600 RenderView at (0,0) size 800x600 layer at (0,0) size 800x600 RenderBlock {HTML} at (0,0) size 800x600 RenderBody {BODY} at (8,8) size 784x576 RenderBlock {OL} at (0,0) size 784x36 RenderListItem {LI} at (40,0) size 744x18 RenderListMarker at (-20,0) size 16x18: "1" RenderText {#text} at (0,0) size 156x18 text run at (0,0) width 156: "Make text bigger/smaller" RenderListItem {LI} at (40,18) size 744x18 RenderListMarker at (-20,0) size 16x18: "2" RenderText {#text} at (0,0) size 216x18 text run at (0,0) width 216: "Make the window narrower/wider" layer at (8,60) size 130x24 RenderBlock (positioned) {DIV} at (8,60) size 130x24 [border: (3px solid #000000)] RenderText {#text} at (43,3) size 84x18 text run at (43,3) width 84: "Lorem ipsum"
{ "pile_set_name": "Github" }
<annotation> <folder>widerface</folder> <filename>26--Soldier_Drilling_26_Soldier_Drilling_Soldiers_Drilling_26_73.jpg</filename> <source> <database>wider face Database</database> <annotation>PASCAL VOC2007</annotation> <image>flickr</image> <flickrid>-1</flickrid> </source> <owner> <flickrid>yanyu</flickrid> <name>yanyu</name> </owner> <size> <width>1024</width> <height>682</height> <depth>3</depth> </size> <segmented>0</segmented> <object> <name>face</name> <pose>Unspecified</pose> <truncated>1</truncated> <difficult>0</difficult> <bndbox> <xmin>77</xmin> <ymin>166</ymin> <xmax>131</xmax> <ymax>232</ymax> </bndbox> <lm> <x1>113.134</x1> <y1>189.366</y1> <x2>127.25</x2> <y2>189.366</y2> <x3>127.665</x3> <y3>201.406</y3> <x4>113.134</x4> <y4>215.938</y4> <x5>121.853</x5> <y5>215.522</y5> <visible>1</visible> <blur>0.66</blur> </lm> <has_lm>1</has_lm> </object> <object> <name>face</name> <pose>Unspecified</pose> <truncated>1</truncated> <difficult>0</difficult> <bndbox> <xmin>155</xmin> <ymin>175</ymin> <xmax>206</xmax> <ymax>232</ymax> </bndbox> <lm> <x1>189.0</x1> <y1>192.0</y1> <x2>202.0</x2> <y2>192.0</y2> <x3>205.0</x3> <y3>201.0</y3> <x4>195.0</x4> <y4>215.0</y4> <x5>200.0</x5> <y5>214.0</y5> <visible>1</visible> <blur>0.6</blur> </lm> <has_lm>1</has_lm> </object> <object> <name>face</name> <pose>Unspecified</pose> <truncated>1</truncated> <difficult>0</difficult> <bndbox> <xmin>266</xmin> <ymin>198</ymin> <xmax>314</xmax> <ymax>263</ymax> </bndbox> <lm> <x1>295.812</x1> <y1>217.629</y1> <x2>299.134</x2> <y2>217.629</y2> <x3>313.25</x3> <y3>228.424</y3> <x4>295.397</x4> <y4>245.446</y4> <x5>297.888</x5> <y5>245.031</y5> <visible>1</visible> <blur>0.63</blur> </lm> <has_lm>1</has_lm> </object> <object> <name>face</name> <pose>Unspecified</pose> <truncated>1</truncated> <difficult>0</difficult> <bndbox> <xmin>351</xmin> <ymin>173</ymin> <xmax>402</xmax> <ymax>232</ymax> </bndbox> <lm> <x1>384.25</x1> <y1>190.75</y1> <x2>396.25</x2> <y2>190.375</y2> <x3>399.25</x3> <y3>203.125</y3> <x4>383.875</x4> <y4>216.25</y4> <x5>393.25</x5> <y5>215.125</y5> <visible>1</visible> <blur>0.62</blur> </lm> <has_lm>1</has_lm> </object> <object> <name>face</name> <pose>Unspecified</pose> <truncated>1</truncated> <difficult>0</difficult> <bndbox> <xmin>460</xmin> <ymin>183</ymin> <xmax>506</xmax> <ymax>258</ymax> </bndbox> <lm> <x1>497.0</x1> <y1>214.0</y1> <x2>503.0</x2> <y2>213.0</y2> <x3>506.0</x3> <y3>223.0</y3> <x4>496.0</x4> <y4>237.0</y4> <x5>499.0</x5> <y5>236.0</y5> <visible>1</visible> <blur>0.62</blur> </lm> <has_lm>1</has_lm> </object> <object> <name>face</name> <pose>Unspecified</pose> <truncated>1</truncated> <difficult>0</difficult> <bndbox> <xmin>488</xmin> <ymin>165</ymin> <xmax>527</xmax> <ymax>209</ymax> </bndbox> <lm> <x1>501.938</x1> <y1>179.188</y1> <x2>509.531</x2> <y2>178.906</y2> <x3>510.375</x3> <y3>185.375</y3> <x4>502.781</x4> <y4>195.219</y4> <x5>509.812</x5> <y5>193.812</y5> <visible>1</visible> <blur>0.5</blur> </lm> <has_lm>1</has_lm> </object> <object> <name>face</name> <pose>Unspecified</pose> <truncated>1</truncated> <difficult>0</difficult> <bndbox> <xmin>549</xmin> <ymin>208</ymin> <xmax>591</xmax> <ymax>266</ymax> </bndbox> <lm> <x1>576.54</x1> <y1>231.201</y1> <x2>584.321</x2> <y2>229.348</y2> <x3>591.362</x3> <y3>242.317</y3> <x4>576.911</x4> <y4>252.692</y4> <x5>584.692</x5> <y5>250.839</y5> <visible>1</visible> <blur>0.63</blur> </lm> <has_lm>1</has_lm> </object> <object> <name>face</name> <pose>Unspecified</pose> <truncated>1</truncated> <difficult>0</difficult> <bndbox> <xmin>610</xmin> <ymin>225</ymin> <xmax>649</xmax> <ymax>272</ymax> </bndbox> <lm> <x1>634.585</x1> <y1>240.022</y1> <x2>646.549</x2> <y2>240.92</y2> <x3>648.344</x3> <y3>247.799</y3> <x4>638.473</x4> <y4>258.567</y4> <x5>646.25</x5> <y5>258.268</y5> <visible>1</visible> <blur>0.61</blur> </lm> <has_lm>1</has_lm> </object> <object> <name>face</name> <pose>Unspecified</pose> <truncated>1</truncated> <difficult>0</difficult> <bndbox> <xmin>666</xmin> <ymin>206</ymin> <xmax>704</xmax> <ymax>252</ymax> </bndbox> <lm> <x1>691.777</x1> <y1>220.045</y1> <x2>697.964</x2> <y2>219.161</y2> <x3>704.152</x3> <y3>228.0</y3> <x4>693.839</x4> <y4>239.196</y4> <x5>700.616</x5> <y5>238.312</y5> <visible>1</visible> <blur>0.61</blur> </lm> <has_lm>1</has_lm> </object> <object> <name>face</name> <pose>Unspecified</pose> <truncated>1</truncated> <difficult>0</difficult> <bndbox> <xmin>723</xmin> <ymin>175</ymin> <xmax>767</xmax> <ymax>230</ymax> </bndbox> <lm> <x1>748.281</x1> <y1>195.656</y1> <x2>762.719</x2> <y2>197.375</y2> <x3>761.688</x3> <y3>204.594</y3> <x4>747.594</x4> <y4>216.281</y4> <x5>763.406</x5> <y5>216.625</y5> <visible>1</visible> <blur>0.65</blur> </lm> <has_lm>1</has_lm> </object> <object> <name>face</name> <pose>Unspecified</pose> <truncated>1</truncated> <difficult>0</difficult> <bndbox> <xmin>797</xmin> <ymin>200</ymin> <xmax>835</xmax> <ymax>244</ymax> </bndbox> <lm> <x1>818.938</x1> <y1>215.312</y1> <x2>827.656</x2> <y2>214.469</y2> <x3>834.406</x3> <y3>224.312</y3> <x4>821.75</x4> <y4>232.75</y4> <x5>830.75</x5> <y5>232.469</y5> <visible>0</visible> <blur>0.6</blur> </lm> <has_lm>1</has_lm> </object> <object> <name>face</name> <pose>Unspecified</pose> <truncated>1</truncated> <difficult>0</difficult> <bndbox> <xmin>848</xmin> <ymin>224</ymin> <xmax>881</xmax> <ymax>270</ymax> </bndbox> <lm> <x1>868.714</x1> <y1>237.161</y1> <x2>869.893</x2> <y2>237.455</y2> <x3>880.5</x3> <y3>245.411</y3> <x4>870.482</x4> <y4>256.607</y4> <x5>871.366</x5> <y5>256.607</y5> <visible>1</visible> <blur>0.54</blur> </lm> <has_lm>1</has_lm> </object> <object> <name>face</name> <pose>Unspecified</pose> <truncated>1</truncated> <difficult>0</difficult> <bndbox> <xmin>889</xmin> <ymin>221</ymin> <xmax>919</xmax> <ymax>266</ymax> </bndbox> <lm> <x1>906.375</x1> <y1>235.469</y1> <x2>914.812</x2> <y2>237.438</y2> <x3>916.5</x3> <y3>243.062</y3> <x4>907.219</x4> <y4>250.375</y4> <x5>912.0</x5> <y5>251.5</y5> <visible>1</visible> <blur>0.58</blur> </lm> <has_lm>1</has_lm> </object> <object> <name>face</name> <pose>Unspecified</pose> <truncated>1</truncated> <difficult>0</difficult> <bndbox> <xmin>941</xmin> <ymin>215</ymin> <xmax>980</xmax> <ymax>260</ymax> </bndbox> <lm> <x1>964.286</x1> <y1>233.0</y1> <x2>976.571</x2> <y2>232.429</y2> <x3>974.0</x3> <y3>241.571</y3> <x4>966.0</x4> <y4>248.429</y4> <x5>975.143</x5> <y5>249.0</y5> <visible>1</visible> <blur>0.59</blur> </lm> <has_lm>1</has_lm> </object> </annotation>
{ "pile_set_name": "Github" }
/* -*- mode: C++; indent-tabs-mode: nil; -*- * * This file is a part of LEMON, a generic C++ optimization library. * * Copyright (C) 2003-2013 * Egervary Jeno Kombinatorikus Optimalizalasi Kutatocsoport * (Egervary Research Group on Combinatorial Optimization, EGRES). * * Permission to use, modify and distribute this software is granted * provided that this copyright notice appears in all copies. For * precise terms see the accompanying LICENSE file. * * This software is provided "AS IS" with no warranty of any kind, * express or implied, and with no claim as to its suitability for any * purpose. * */ ///\file ///\brief The implementation of the LP solver interface. #include <lemon/lp_base.h> namespace lemon { const LpBase::Value LpBase::INF = std::numeric_limits<LpBase::Value>::infinity(); const LpBase::Value LpBase::NaN = std::numeric_limits<LpBase::Value>::quiet_NaN(); } //namespace lemon
{ "pile_set_name": "Github" }
import inspect import numpy as np from abc import ABC from operator import itemgetter from collections import namedtuple from sklearn.model_selection import StratifiedKFold from tick.base import Base from tick.prox import ProxZero, ProxMulti, ProxTV, ProxEquality, \ ProxGroupL1 from tick.solver import SVRG from tick.survival import SimuSCCS, ModelSCCS from tick.preprocessing import LongitudinalSamplesFilter, \ LongitudinalFeaturesLagger from scipy.stats import uniform import matplotlib.pylab as plt from mpl_toolkits.mplot3d import Axes3D from matplotlib import cm from tick.preprocessing.utils import check_longitudinal_features_consistency, \ check_censoring_consistency, safe_array # Case classes Confidence_intervals = namedtuple( 'Confidence_intervals', ['refit_coeffs', 'lower_bound', 'upper_bound', 'confidence_level']) # TODO later: exploit new options of SVRG (parallel fit, variance_reduction...) # TODO later: add SAGA solver class ConvSCCS(ABC, Base): """ConvSCCS learner, estimates lagged features effect using TV and Group L1 penalties. These penalties constrain the coefficient groups modelling the lagged effects to ensure their regularity and sparsity. Parameters ---------- n_lags : `numpy.ndarray`, shape=(n_features,), dtype="uint64" Number of lags per feature. The model will regress labels on the last observed values of the features over their corresponding `n_lags` time intervals. `n_lags` values must be between 0 and `n_intervals` - 1. penalized_features : `numpy.ndarray`, shape=(n_features,), dtype="bool", default=None Booleans indicating whether the features should be penalised or not. If set to None, pernalize all features. C_tv : `float`, default=None Level of TV penalization TV penalization. This value should be `None` or greater than 0. C_group_l1 : `float`, default=None Level of group Lasso penalization. This value should be `None` or greater than 0. step : `float`, default=None Step-size parameter, the most important parameter of the solver. If set to None, it will be automatically tuned as ``step = 1 / model.get_lip_max()``. tol : `float`, default=1e-5 The tolerance of the solver (iterations stop when the stopping criterion is below it). max_iter : `int`, default=100 Maximum number of iterations of the solver, namely maximum number of epochs. verbose : `bool`, default=False If `True`, solver verboses history, otherwise nothing is displayed. print_every : `int`, default=1 Print history information every time the iteration number is a multiple of ``print_every``. Used only is ``verbose`` is True. record_every : `int`, default=1 Save history information every time the iteration number is a multiple of ``record_every``. random_state : `int`, default=None If not None, the seed of the random sampling. Attributes ---------- n_cases : `int` (read-only) Number of samples with at least one outcome. n_intervals : `int` (read-only) Number of time intervals. n_features : `int` (read-only) Number of features. n_coeffs : `int` (read-only) Total number of coefficients of the model. coeffs : `list` (read-only) List containing 1-dimensional `np.ndarray` (`dtype=float`) containing the coefficients of the model. Each numpy array contains the `(n_lags + 1)` coefficients associated with a feature. Each coefficient of such arrays can be interpreted as the log relative intensity associated with this feature, `k` periods after exposure start, where `k` is the index of the coefficient in the array. intensities : `list` (read-only) List containing 1-dimensional `np.ndarray` (`dtype=float`) containing the intensities estimated by the model. Each numpy array contains the relative intensities of a feature. Element of these arrays can be interpreted as the relative intensity associated with a feature, `k` periods after exposure start, where `k` is the index of the coefficient in the array. confidence_intervals : `Confidence_intervals` (read-only) Coefficients refitted on the model and associated confidence intervals computed using parametric bootstrap. Refitted coefficients are projected on the support of the coefficients estimated by the penalised model. Refitted coefficients and their confidence intervals follow the same structure as `coeffs`. References ---------- Morel, M., Bacry, E., Gaïffas, S., Guilloux, A., & Leroy, F. (Submitted, 2018, January). ConvSCCS: convolutional self-controlled case series model for lagged adverse event detection """ _const_attr = [ # constructed attributes '_preprocessor_obj', '_model_obj', '_solver_obj', # user defined parameters '_n_lags', '_penalized_features', '_C_tv', '_C_group_l1', '_random_state', # computed attributes 'n_cases', 'n_intervals', 'n_features', 'n_coeffs', '_coeffs', '_features_offset', '_fitted', '_step_size', # refit _coeffs, median, and CI data 'confidence_intervals', '_solver_info' ] _attrinfos = {key: {'writable': False} for key in _const_attr} def __init__(self, n_lags: np.array, penalized_features: np.array = None, C_tv=None, C_group_l1=None, step: float = None, tol: float = 1e-5, max_iter: int = 100, verbose: bool = False, print_every: int = 10, record_every: int = 10, random_state: int = None): Base.__init__(self) # Init objects to be computed later self.n_cases = None self.n_intervals = None self.n_features = None self.n_coeffs = None self._coeffs = None self.confidence_intervals = Confidence_intervals( list(), list(), list(), None) self._fitted = None self._step_size = None # Init user defined parameters self._features_offset = None self._n_lags = None self.n_lags = n_lags self._penalized_features = None self.penalized_features = penalized_features self._C_tv = None self._C_group_l1 = None self.C_tv = C_tv self.C_group_l1 = C_group_l1 self._step_size = step self.tol = tol self.max_iter = max_iter self.verbose = verbose, self.print_every = print_every self.record_every = record_every random_state = int( np.random.randint(0, 1000, 1)[0] if random_state is None else random_state) self._random_state = None self.random_state = random_state # Construct objects self._preprocessor_obj = self._construct_preprocessor_obj() self._model_obj = None self._solver_info = ( step, max_iter, tol, print_every, record_every, verbose, self.random_state) self._solver_obj = self._construct_solver_obj(*self._solver_info) # Interface def fit(self, features: list, labels: list, censoring: np.array, confidence_intervals: bool = False, n_samples_bootstrap: int = 200, confidence_level: float = .95): """Fit the model according to the given training data. Parameters ---------- features : `list` of `numpy.ndarray` or `list` of `scipy.sparse.csr_matrix`, list of length n_cases, each element of the list of shape=(n_intervals, n_features) The list of features matrices. labels : `list` of `numpy.ndarray`, list of length n_cases, each element of the list of shape=(n_intervals,) The labels vector censoring : `numpy.ndarray`, shape=(n_cases,), dtype="uint64" The censoring data. This array should contain integers in [1, n_intervals]. If the value i is equal to n_intervals, then there is no censoring for sample i. If censoring = c < n_intervals, then the observation of sample i is stopped at interval c, that is, the row c - 1 of the corresponding matrix. The last n_intervals - c rows are then set to 0. confidence_intervals : `bool`, default=False Activate parametric bootstrap confidence intervals computation. n_samples_bootstrap : `int`, default=200 Number of parametric bootstrap iterations confidence_level : `float`, default=.95 Confidence level of the bootstrapped confidence intervals Returns ------- output : `LearnerSCCS` The current instance with given data """ p_features, p_labels, p_censoring = self._prefit( features, labels, censoring) self._fit(project=False) self._postfit(p_features, p_labels, p_censoring, False, confidence_intervals, n_samples_bootstrap, confidence_level) return self.coeffs, self.confidence_intervals def score(self, features=None, labels=None, censoring=None): """Returns the negative log-likelihood of the model, using the current fitted coefficients on the passed data. If no data is passed, the negative log-likelihood is computed using the data used for training. Parameters ---------- features : `None` or `list` of `numpy.ndarray` or `list` of `scipy.sparse.csr_matrix`, list of length n_cases, each element of the list of shape=(n_intervals, n_features) The list of features matrices. labels : `None` or `list` of `numpy.ndarray`, list of length n_cases, each element of the list of shape=(n_intervals,) The labels vector censoring : `None` or `numpy.ndarray`, shape=(n_cases,), dtype="uint64" The censoring data. This array should contain integers in [1, n_intervals]. If the value i is equal to n_intervals, then there is no censoring for sample i. If censoring = c < n_intervals, then the observation of sample i is stopped at interval c, that is, the row c - 1 of the corresponding matrix. The last n_intervals - c rows are then set to 0. Returns ------- output : `float` The value of the negative log-likelihood """ return self._score(features, labels, censoring, preprocess=True) def fit_kfold_cv(self, features, labels, censoring, C_tv_range: tuple = (), C_group_l1_range: tuple = (), logscale=True, n_cv_iter: int = 30, n_folds: int = 3, shuffle: bool = True, confidence_intervals: bool = False, n_samples_bootstrap: int = 100, confidence_level: float = .95): """Perform a cross validation to find optimal hyperparameters given training data. Cross validation using stratified K-folds and random search, parameters being sampled uniformly in the range (logscale or linspace) specified by the user. Parameters ---------- features : `list` of `numpy.ndarray` or `list` of `scipy.sparse.csr_matrix` list of length n_cases, each element of the list of shape=(n_intervals, n_features) The list of features matrices. labels : `list` of `numpy.ndarray`, list of length n_cases, each element of the list of shape=(n_intervals,) The labels vector censoring : `numpy.ndarray`, shape=(n_cases,), dtype="uint64" The censoring data. This array should contain integers in [1, n_intervals]. If the value i is equal to n_intervals, then there is no censoring for sample i. If censoring = c < n_intervals, then the observation of sample i is stopped at interval c, that is, the row c - 1 of the corresponding matrix. The last n_intervals - c rows are then set to 0. C_tv_range : `tuple`, shape=(2,), dtype="int" Range in which sampling TV penalization level during the random search. `logscale=True`, range values are understood as powers of ten, i.e `(0, 5)` will result in samples being in `10**(0), 10**(5)`. C_group_l1_range : `tuple`, shape=(2,), dtype="int" Range in which sampling group L1 penalization level during the random search. `logscale=True`, range values are understood as powers of ten, i.e `(0, 5)` will result in samples being in `10**(0), 10**(5)`. logscale : `bool` If `True`, hyperparameters are sampled on logscale. n_cv_iter : `int` Number of hyperparameters samples to draw when performing random search. n_folds : `int` Number of folds used to perform the cross validation. shuffle : `bool` If `True`, the data is shuffled before performing train / validation / test splits. confidence_intervals : `bool`, default=False Activate parametric bootstrap confidence intervals computation. n_samples_bootstrap : `int`, default=200 Number of parametric bootstrap iterations confidence_level : `float`, default=.95 Confidence level of the bootstrapped confidence intervals Returns ------- output : `LearnerSCCS` The current instance with given data """ # setup the model and preprocess the data p_features, p_labels, p_censoring = self._prefit( features, labels, censoring) # split the data with stratified KFold kf = StratifiedKFold(n_folds, shuffle, self.random_state) labels_interval = np.nonzero(p_labels)[1] # Training loop model_global_parameters = { "n_intervals": self.n_intervals, "n_lags": self.n_lags, "n_features": self.n_features, } cv_tracker = CrossValidationTracker(model_global_parameters) C_tv_generator, C_group_l1_generator = self._construct_generator_obj( C_tv_range, C_group_l1_range, logscale) # TODO later: parallelize CV i = 0 while i < n_cv_iter: self._set('_coeffs', np.zeros(self.n_coeffs)) self.C_tv = C_tv_generator.rvs(1)[0] self.C_group_l1 = C_group_l1_generator.rvs(1)[0] train_scores = [] test_scores = [] for train_index, test_index in kf.split(p_features, labels_interval): train = itemgetter(*train_index.tolist()) test = itemgetter(*test_index.tolist()) X_train, X_test = list(train(p_features)), list( test(p_features)) y_train, y_test = list(train(p_labels)), list(test(p_labels)) censoring_train, censoring_test = p_censoring[train_index], \ p_censoring[test_index] self._model_obj.fit(X_train, y_train, censoring_train) self._fit(project=False) train_scores.append(self._score()) test_scores.append(self._score(X_test, y_test, censoring_test)) cv_tracker.log_cv_iteration(self.C_tv, self.C_group_l1, np.array(train_scores), np.array(test_scores)) i += 1 # refit best model on all the data best_parameters = cv_tracker.find_best_params() self.C_tv = best_parameters["C_tv"] self.C_group_l1 = best_parameters["C_group_l1"] self._set('_coeffs', np.zeros(self.n_coeffs)) self._model_obj.fit(p_features, p_labels, p_censoring) coeffs, bootstrap_ci = self._postfit( p_features, p_labels, p_censoring, True, confidence_intervals, n_samples_bootstrap, confidence_level) cv_tracker.log_best_model(self.C_tv, self.C_group_l1, self._coeffs.tolist(), self.score(), self.confidence_intervals) return self.coeffs, cv_tracker def plot_intensities(self, figsize=(10, 6), sharex=False, sharey=False): """Plot intensities estimated by the penalized model. The intensities subfigures are plotted on two columns. Parameters ---------- figsize : `tuple`, default=(10, 6) Size of the figure sharex : `bool`, default=False Constrain the x axes to have the same range. sharey : `bool`, default=False Constrain the y axes to have the same range. Returns ------- fig : `matplotlib.figure.Figure` Figure to be plotted axarr : `numpy.ndarray`, `dtype=object` `matplotlib.axes._subplots.AxesSubplot` objects associated to each intensity subplot. """ n_rows = int(np.ceil(self.n_features / 2)) remove_last_plot = self.n_features % 2 != 0 fig, axarr = plt.subplots(n_rows, 2, sharex=sharex, sharey=sharey, figsize=figsize) for i, c in enumerate(self.coeffs): self._plot_intensity(axarr[i // 2][i % 2], c, None, None) plt.suptitle('Estimated (penalized) relative risks') axarr[0][1].legend(loc='upper right') [ax[0].set_ylabel('Relative incidence') for ax in axarr] [ax.set_xlabel('Time after exposure start') for ax in axarr[-1]] if remove_last_plot: fig.delaxes(axarr[-1][-1]) return fig, axarr def plot_confidence_intervals(self, figsize=(10, 6), sharex=False, sharey=False): """Plot intensities estimated by the penalized model. The intensities subfigures are plotted on two columns. Parameters ---------- figsize : `tuple`, default=(10, 6) Size of the figure sharex : `bool`, default=False Constrain the x axes to have the same range. sharey : `bool`, default=False Constrain the y axes to have the same range. Returns ------- fig : `matplotlib.figure.Figure` Figure to be plotted axarr : `numpy.ndarray`, `dtype=object` `matplotlib.axes._subplots.AxesSubplot` objects associated to each intensity subplot """ n_rows = int(np.ceil(self.n_features / 2)) remove_last_plot = (self.n_features % 2 != 0) fig, axarr = plt.subplots(n_rows, 2, sharex=sharex, sharey=sharey, figsize=figsize) ci = self.confidence_intervals coeffs = ci['refit_coeffs'] lb = ci['lower_bound'] ub = ci['upper_bound'] for i, c in enumerate(coeffs): self._plot_intensity(axarr[i // 2][i % 2], c, lb[i], ub[i]) plt.suptitle('Estimated relative risks with 95% confidence bands') axarr[0][1].legend(loc='best') [ax[0].set_ylabel('Relative incidence') for ax in axarr] [ax.set_xlabel('Time after exposure start') for ax in axarr[-1]] if remove_last_plot: fig.delaxes(axarr[-1][-1]) return fig, axarr @staticmethod def _plot_intensity(ax, coeffs, upper_bound, lower_bound): n_coeffs = len(coeffs) if n_coeffs > 1: x = np.arange(n_coeffs) ax.step(x, np.exp(coeffs), label="Estimated RI") if upper_bound is not None and lower_bound is not None: ax.fill_between(x, np.exp(lower_bound), np.exp(upper_bound), alpha=.5, color='orange', step='pre', label="95% boostrap CI") elif n_coeffs == 1: if upper_bound is not None and lower_bound is not None: ax.errorbar(0, coeffs, yerr=(np.exp(lower_bound), np.exp(upper_bound)), fmt='o', ecolor='orange') else: ax.scatter([0], np.exp(coeffs), label="Estimated RI") return ax # Internals def _prefit(self, features, labels, censoring): n_intervals, n_features = features[0].shape if any(self.n_lags > n_intervals - 1): raise ValueError('`n_lags` should be < `n_intervals` - 1, where ' '`n_intervals` is the number of rows of the ' 'feature matrices.') n_cases = len(features) censoring = check_censoring_consistency(censoring, n_cases) features = check_longitudinal_features_consistency( features, (n_intervals, n_features), "float64") labels = check_longitudinal_features_consistency( labels, (n_intervals,), "int32") self._set('n_features', n_features) self._set('n_intervals', n_intervals) features, labels, censoring = self._preprocess_data( features, labels, censoring) n_coeffs = int(np.sum(self._n_lags) + self.n_features) self._set('n_coeffs', n_coeffs) self._set('_coeffs', np.zeros(n_coeffs)) self._set('n_cases', len(features)) # Step computation self._set("_model_obj", self._construct_model_obj()) self._model_obj.fit(features, labels, censoring) if self.step is None: self.step = 1 / self._model_obj.get_lip_max() return features, labels, censoring def _fit(self, project): prox_obj = self._construct_prox_obj(self._coeffs, project) solver_obj = self._solver_obj model_obj = self._model_obj # Now, we can pass the model and prox objects to the solver solver_obj.set_model(model_obj).set_prox(prox_obj) coeffs_start = self._coeffs # Launch the solver _coeffs = solver_obj.solve(coeffs_start, step=self.step) self._set("_coeffs", _coeffs) self._set("_fitted", True) return _coeffs def _postfit(self, p_features, p_labels, p_censoring, refit, bootstrap, n_samples_bootstrap, confidence_level): # WARNING: _refit uses already preprocessed p_features, p_labels # and p_censoring if not self._fitted: raise RuntimeError('You must fit the model first') if refit: # refit _coeffs on all the data (after Cross Validation for example) self._model_obj.fit(p_features, p_labels, p_censoring) coeffs = self._fit(project=False) self._set('_coeffs', coeffs) if bootstrap: self._model_obj.fit(p_features, p_labels, p_censoring) _refit_coeffs = self._fit(project=True) confidence_intervals = self._bootstrap( p_features, p_labels, p_censoring, _refit_coeffs, n_samples_bootstrap, confidence_level) self._set('confidence_intervals', confidence_intervals._asdict()) return self.coeffs, self.confidence_intervals # Utilities # def _preprocess_data(self, features, labels, censoring): for preprocessor in self._preprocessor_obj: features, labels, censoring = preprocessor.fit_transform( features, labels, censoring) return features, labels, censoring def _bootstrap(self, p_features, p_labels, p_censoring, coeffs, rep, confidence): # WARNING: _bootstrap inputs are already preprocessed p_features, # p_labels and p_censoring # Coeffs here are assumed to be an array (same object than self._coeffs) if confidence <= 0 or confidence >= 1: raise ValueError("`confidence_level` should be in (0, 1)") confidence = 1 - confidence if not self._fitted: raise RuntimeError('You must fit the model first') bootstrap_coeffs = [] sim = SimuSCCS(self.n_cases, self.n_intervals, self.n_features, self.n_lags, coeffs=self._format_coeffs(coeffs)) # TODO later: parallelize bootstrap (everything should be pickable...) for k in range(rep): y = sim._simulate_multinomial_outcomes(p_features, coeffs) self._model_obj.fit(p_features, y, p_censoring) bootstrap_coeffs.append(self._fit(True)) bootstrap_coeffs = np.exp(np.array(bootstrap_coeffs)) bootstrap_coeffs.sort(axis=0) lower_bound = np.log(bootstrap_coeffs[int( np.floor(rep * confidence / 2))]) upper_bound = np.log(bootstrap_coeffs[int( np.floor(rep * (1 - confidence / 2)))]) return Confidence_intervals( self._format_coeffs(coeffs), self._format_coeffs(lower_bound), self._format_coeffs(upper_bound), confidence) def _score(self, features=None, labels=None, censoring=None, preprocess=False): if not self._fitted: raise RuntimeError('You must fit the model first') all_none = all(e is None for e in [features, labels, censoring]) if all_none: loss = self._model_obj.loss(self._coeffs) else: if features is None: raise ValueError('Passed ``features`` is None') elif labels is None: raise ValueError('Passed ``labels`` is None') elif censoring is None: raise ValueError('Passed ``censoring`` is None') else: # Avoid calling preprocessing during CV if preprocess: features, labels, censoring = self._preprocess_data( features, labels, censoring) model = self._construct_model_obj().fit( features, labels, censoring) loss = model.loss(self._coeffs) return loss def _format_coeffs(self, coeffs): value = list() for i, l in enumerate(self.n_lags): start = int(self._features_offset[i]) end = int(start + l + 1) value.append(coeffs[start:end]) return value # Factories # def _construct_preprocessor_obj(self): # TODO later: fix parallel preprocessing preprocessors = list() preprocessors.append(LongitudinalSamplesFilter(n_jobs=1)) if len(self.n_lags) > 0: preprocessors.append( LongitudinalFeaturesLagger(self.n_lags, n_jobs=1)) return preprocessors def _construct_model_obj(self): return ModelSCCS(self.n_intervals, self.n_lags) def _construct_prox_obj(self, coeffs=None, project=False): n_penalized_features = len(self.penalized_features) \ if self.penalized_features is not None else 0 if project: # project future _coeffs on the support of given _coeffs if all(self.n_lags == 0): proxs = [ProxZero()] elif coeffs is not None: prox_ranges = self._detect_support(coeffs) proxs = [ProxEquality(0, range=r) for r in prox_ranges] else: raise ValueError("Coeffs are None. " + "Equality penalty cannot infer the " "coefficients support.") elif n_penalized_features > 0 and self._C_tv is not None or \ self._C_group_l1 is not None: # TV and GroupLasso penalties blocks_start = np.zeros(n_penalized_features) blocks_end = np.zeros(n_penalized_features) proxs = [] for i in self.penalized_features: start = int(self._features_offset[i]) blocks_start[i] = start end = int(blocks_start[i] + self._n_lags[i] + 1) blocks_end[i] = end if self._C_tv is not None: proxs.append(ProxTV(1 / self._C_tv, range=(start, end))) if self._C_group_l1 is not None: blocks_size = blocks_end - blocks_start proxs.append( ProxGroupL1(1 / self._C_group_l1, blocks_start.tolist(), blocks_size.tolist())) else: # Default prox: does nothing proxs = [ProxZero()] prox_obj = ProxMulti(tuple(proxs)) return prox_obj def _detect_support(self, coeffs): """Return the ranges over which consecutive coefficients are equal in case at least two coefficients are equal. This method is used to compute the ranges for ProxEquality, to enforce a support corresponding to the support of `_coeffs`. example: _coeffs = np.array([ 1. 2. 2. 1. 1.]) self._detect_support(_coeffs) >>> [(1, 3), (3, 5)] """ kernel = np.array([1, -1]) groups = [] for i in self.penalized_features: idx = int(self._features_offset[i]) n_lags = int(self._n_lags[i]) if n_lags > 0: acc = 1 for change in np.convolve(coeffs[idx:idx + n_lags + 1], kernel, 'valid'): if change: if acc > 1: groups.append((idx, idx + acc)) idx += acc acc = 1 else: acc += 1 # Last coeff always count as a change if acc > 1: groups.append((idx, idx + acc)) return groups @staticmethod def _construct_solver_obj(step, max_iter, tol, print_every, record_every, verbose, seed): # TODO: we might want to use SAGA also later... (might be faster here) # seed cannot be None in SVRG solver_obj = SVRG(step=step, max_iter=max_iter, tol=tol, print_every=print_every, record_every=record_every, verbose=verbose, seed=seed) return solver_obj @staticmethod def _construct_solver_obj_with_class( step, max_iter, tol, print_every, record_every, verbose, seed, clazz=SVRG): """All creatioon of solver by class type, removes values from constructor parameter list that do not exist on the class construct to be called """ # inspect must be first assign _, _, _, kvs = inspect.getargvalues(inspect.currentframe()) constructor_map = kvs.copy() args = inspect.getfullargspec(clazz.__init__)[0] for k, v in kvs.items(): if k not in args: del constructor_map[k] return SVRG(**constructor_map) def _construct_generator_obj(self, C_tv_range, C_group_l1_range, logspace=True): generators = [] if len(C_tv_range) == 2: if logspace: generators.append(Log10UniformGenerator(*C_tv_range)) else: generators.append(uniform(C_tv_range)) else: generators.append(null_generator) if len(C_group_l1_range) == 2: if logspace: generators.append(Log10UniformGenerator(*C_group_l1_range)) else: generators.append(uniform(C_group_l1_range)) else: generators.append(null_generator) return generators # Properties # @property def step(self): return self._step_size @step.setter def step(self, value): if value > 0: self._set('_step_size', value) self._solver_obj.step = value else: raise ValueError("step should be greater than 0.") @property def C_tv(self): return self._C_tv @C_tv.setter def C_tv(self, value): if value is None or isinstance(value, float) and value > 0: self._set('_C_tv', value) else: raise ValueError('C_tv should be a float greater than zero.') @property def C_group_l1(self): return self._C_group_l1 @C_group_l1.setter def C_group_l1(self, value): if value is None or isinstance(value, float) and value > 0: self._set('_C_group_l1', value) else: raise ValueError('C_group_l1 should be a float greater ' 'than zero.') @property def random_state(self): return self._random_state @random_state.setter def random_state(self, value): np.random.seed(value) self._set('_random_state', value) @property def n_lags(self): return self._n_lags @n_lags.setter def n_lags(self, value): offsets = [0] for l in value: if l < 0: raise ValueError('n_lags elements should be greater than or ' 'equal to 0.') offsets.append(offsets[-1] + l + 1) value = safe_array(value, dtype=np.uint64) self._set('_n_lags', value) self._set('_features_offset', offsets) self._construct_preprocessor_obj() @property def penalized_features(self): return self._penalized_features @penalized_features.setter def penalized_features(self, value): if value is None: value = [True] * len(self.n_lags) self._set('_penalized_features', value) self._construct_preprocessor_obj() @property def coeffs(self): return self._format_coeffs(self._coeffs) @coeffs.setter def coeffs(self, value): raise ValueError('coeffs cannot be set') @property def intensities(self): return [np.exp(c) for c in self.coeffs] @intensities.setter def intensities(self, value): raise ValueError('intensities cannot be set') # TODO later: put the code below somewhere else? class CrossValidationTracker: def __init__(self, model_params: dict): self.model_params = model_params self.kfold_train_scores = list() self.kfold_mean_train_scores = list() self.kfold_sd_train_scores = list() self.kfold_test_scores = list() self.kfold_mean_test_scores = list() self.kfold_sd_test_scores = list() # TODO later: make this class usable for any parameters # self.parameter_names = parameter_names # self.best_model = { # '_coeffs': list(), # 'confidence_interval': {}, # **{name: list() for name in parameter_names} # } # for field in parameter_names: # setattr(field + '_history', list()) self.C_tv_history = list() self.C_group_l1_history = list() def log_cv_iteration(self, C_tv, C_group_l1, kfold_train_scores, kfold_test_scores): self.kfold_train_scores.append(list(kfold_train_scores)) self.kfold_mean_train_scores.append(kfold_train_scores.mean()) self.kfold_sd_train_scores.append(kfold_train_scores.std()) self.kfold_test_scores.append(list(kfold_test_scores)) self.kfold_mean_test_scores.append(kfold_test_scores.mean()) self.kfold_sd_test_scores.append(kfold_test_scores.std()) self.C_tv_history.append(C_tv) self.C_group_l1_history.append(C_group_l1) def find_best_params(self): # Find best parameters best_idx = int(np.argmin(self.kfold_mean_test_scores)) best_C_tv = self.C_tv_history[best_idx] best_C_group_l1 = self.C_group_l1_history[best_idx] return {'C_tv': best_C_tv, 'C_group_l1': best_C_group_l1} def log_best_model(self, C_tv, C_group_l1, coeffs, score, confidence_interval_dict): self.best_model = { 'C_tv': C_tv, 'C_group_l1': C_group_l1, '_coeffs': list(coeffs), 'score': score, 'confidence_intervals': confidence_interval_dict } def todict(self): return { 'global_model_parameters': list(self.model_params), 'C_tv_history': list(self.C_tv_history), 'C_group_l1_history': list(self.C_group_l1_history), 'kfold_train_scores': list(self.kfold_train_scores), 'kfold_mean_train_scores': list(self.kfold_mean_train_scores), 'kfold_sd_train_scores': list(self.kfold_sd_train_scores), 'kfold_test_scores': list(self.kfold_test_scores), 'kfold_mean_test_scores': list(self.kfold_mean_test_scores), 'kfold_sd_test_scores': list(self.kfold_sd_test_scores), 'best_model': self.best_model } def plot_cv_report(self, elevation=25, azimuth=35): if len(self.C_group_l1_history) > 0 and len(self.C_tv_history) > 0: return self.plot_learning_curves_contour(elevation, azimuth) elif len(self.C_group_l1_history) == 0: return self.plot_learning_curves('Group L1') elif len(self.C_tv_history) == 0: return self.plot_learning_curves('TV') else: raise ValueError("Logged Group L1 and TV penalisation levels " "history are empty.") def plot_learning_curves(self, hyperparameter): if hyperparameter == "TV": C = self.C_tv_history elif hyperparameter == "Group L1": C = self.C_group_l1_history else: raise ValueError("hyperparameter value should be either `TV` or" " `Group L1`") x = np.log10(C) order = np.argsort(x) m = np.array(self.kfold_mean_train_scores)[order] sd = np.array(self.kfold_sd_train_scores)[order] fig = plt.figure() ax = plt.gca() p1 = ax.plot(x[order], m) p2 = ax.fill_between(x[order], m - sd, m + sd, alpha=.3) min_point_train = np.min(m - sd) m = np.array(self.kfold_mean_test_scores)[order] sd = np.array(self.kfold_sd_test_scores)[order] p3 = ax.plot(x[order], m) p4 = ax.fill_between(x[order], m - sd, m + sd, alpha=.3) min_point_test = np.min(m - sd) min_point = min(min_point_train, min_point_test) p5 = plt.scatter(np.log10(C), min_point * np.ones_like(C)) ax.legend([(p1[0], p2), (p3[0], p4), p5], ['train score', 'test score', 'tested hyperparameters'], loc='lower right') ax.set_title('Learning curves') ax.set_xlabel('C %s (log scale)' % hyperparameter) ax.set_ylabel('Loss') return fig, ax def plot_learning_curves_contour(self, elevation=25, azimuth=35): """‘elev’ stores the elevation angle in the z plane. ‘azim’ stores the azimuth angle in the x,y plane.""" sc_train = self.kfold_mean_train_scores sc_test = self.kfold_mean_test_scores X_tile = np.log10(self.C_tv_history) Y_tile = np.log10(self.C_group_l1_history) fig, axarr = plt.subplots(1, 3, figsize=(12, 4), sharey=True, sharex=True) ax = axarr[-1] ax.scatter(X_tile, Y_tile) ax.set_title("Random search tested hyperparameters") ax.set_xlabel('Strength TV') ax.set_ylabel('Strength Group L1') names = ['train', 'test'] cmaps = [cm.Blues, cm.Greens] for i, cv in enumerate([sc_train, sc_test]): Z = np.array(cv) ax = axarr[i] cax = ax.tricontourf(X_tile, Y_tile, Z, 50, cmap=cmaps[i]) ax.set_title(r'Loss (%s)' % names[i]) ax.set_xlabel("TV level (log)") idx = np.where(Z == Z.min()) x, y = (X_tile[idx][0], Y_tile[idx][0]) ax.scatter(x, y, color="red", marker="x") ax.text(x, y, r'%.2f' % Z.min(), color="red", fontsize=12) axarr[0].set_ylabel("Group L1 level (log)") plt.tight_layout() fig2 = plt.figure(figsize=(8, 6.5)) ax = Axes3D(fig2) colors = ['blue', 'green'] names = ['train', 'test'] proxies = [] proxy_names = [] for i, cv in enumerate([sc_train, sc_test]): Z = np.array(cv) ax.plot_trisurf(X_tile, Y_tile, Z, alpha=0.3, color=colors[i]) proxies.append(plt.Rectangle((0, 0), 1, 1, fc=colors[i], alpha=.3)) proxy_names.append("%s score" % names[i]) Z = np.array(sc_test) best_params = self.find_best_params() x = np.log10(best_params['C_tv']) y = np.log10(best_params['C_group_l1']) idx = np.where(X_tile == x) # should be equal to np.where(Y_tile == y) z = Z[idx] p1 = ax.scatter(x, y, z, c='red') proxies.append(p1) proxy_names.append('CV best score') ax.set_xlabel("TV level (log)") ax.set_ylabel("Group L1 level (log)") ax.set_title("Learning surfaces") ax.set_zlabel("loss") ax.view_init(elevation, azimuth) plt.legend(proxies, proxy_names, loc='best') return fig, axarr, fig2, ax # Generators for random search # generator which generates nothing DumbGenerator = namedtuple('DumbGenerator', ['rvs']) null_generator = DumbGenerator(rvs=lambda x: [None]) class Log10UniformGenerator: """Generate uniformly distributed points in the log10 space.""" def __init__(self, min_val, max_val): self.min_val = min_val self.max_val = max_val self.gen = uniform(0, 1) def rvs(self, n): return 10 ** ( self.min_val + (self.max_val - self.min_val) * self.gen.rvs(n))
{ "pile_set_name": "Github" }
<?xml version="1.0" encoding="utf-8"?> <root> <!-- Microsoft ResX Schema Version 2.0 The primary goals of this format is to allow a simple XML format that is mostly human readable. The generation and parsing of the various data types are done through the TypeConverter classes associated with the data types. Example: ... ado.net/XML headers & schema ... <resheader name="resmimetype">text/microsoft-resx</resheader> <resheader name="version">2.0</resheader> <resheader name="reader">System.Resources.ResXResourceReader, System.Windows.Forms, ...</resheader> <resheader name="writer">System.Resources.ResXResourceWriter, System.Windows.Forms, ...</resheader> <data name="Name1"><value>this is my long string</value><comment>this is a comment</comment></data> <data name="Color1" type="System.Drawing.Color, System.Drawing">Blue</data> <data name="Bitmap1" mimetype="application/x-microsoft.net.object.binary.base64"> <value>[base64 mime encoded serialized .NET Framework object]</value> </data> <data name="Icon1" type="System.Drawing.Icon, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64"> <value>[base64 mime encoded string representing a byte array form of the .NET Framework object]</value> <comment>This is a comment</comment> </data> There are any number of "resheader" rows that contain simple name/value pairs. Each data row contains a name, and value. The row also contains a type or mimetype. Type corresponds to a .NET class that support text/value conversion through the TypeConverter architecture. Classes that don't support this are serialized and stored with the mimetype set. The mimetype is used for serialized objects, and tells the ResXResourceReader how to depersist the object. This is currently not extensible. For a given mimetype the value must be set accordingly: Note - application/x-microsoft.net.object.binary.base64 is the format that the ResXResourceWriter will generate, however the reader can read any of the formats listed below. mimetype: application/x-microsoft.net.object.binary.base64 value : The object must be serialized with : System.Runtime.Serialization.Formatters.Binary.BinaryFormatter : and then encoded with base64 encoding. mimetype: application/x-microsoft.net.object.soap.base64 value : The object must be serialized with : System.Runtime.Serialization.Formatters.Soap.SoapFormatter : and then encoded with base64 encoding. mimetype: application/x-microsoft.net.object.bytearray.base64 value : The object must be serialized into a byte array : using a System.ComponentModel.TypeConverter : and then encoded with base64 encoding. --> <xsd:schema id="root" xmlns="" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:msdata="urn:schemas-microsoft-com:xml-msdata"> <xsd:import namespace="http://www.w3.org/XML/1998/namespace" /> <xsd:element name="root" msdata:IsDataSet="true"> <xsd:complexType> <xsd:choice maxOccurs="unbounded"> <xsd:element name="metadata"> <xsd:complexType> <xsd:sequence> <xsd:element name="value" type="xsd:string" minOccurs="0" /> </xsd:sequence> <xsd:attribute name="name" use="required" type="xsd:string" /> <xsd:attribute name="type" type="xsd:string" /> <xsd:attribute name="mimetype" type="xsd:string" /> <xsd:attribute ref="xml:space" /> </xsd:complexType> </xsd:element> <xsd:element name="assembly"> <xsd:complexType> <xsd:attribute name="alias" type="xsd:string" /> <xsd:attribute name="name" type="xsd:string" /> </xsd:complexType> </xsd:element> <xsd:element name="data"> <xsd:complexType> <xsd:sequence> <xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" /> <xsd:element name="comment" type="xsd:string" minOccurs="0" msdata:Ordinal="2" /> </xsd:sequence> <xsd:attribute name="name" type="xsd:string" use="required" msdata:Ordinal="1" /> <xsd:attribute name="type" type="xsd:string" msdata:Ordinal="3" /> <xsd:attribute name="mimetype" type="xsd:string" msdata:Ordinal="4" /> <xsd:attribute ref="xml:space" /> </xsd:complexType> </xsd:element> <xsd:element name="resheader"> <xsd:complexType> <xsd:sequence> <xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" /> </xsd:sequence> <xsd:attribute name="name" type="xsd:string" use="required" /> </xsd:complexType> </xsd:element> </xsd:choice> </xsd:complexType> </xsd:element> </xsd:schema> <resheader name="resmimetype"> <value>text/microsoft-resx</value> </resheader> <resheader name="version"> <value>2.0</value> </resheader> <resheader name="reader"> <value>System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value> </resheader> <resheader name="writer"> <value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value> </resheader> <assembly alias="System.Drawing" name="System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a" /> <data name="logoPictureBox.Image" type="System.Drawing.Bitmap, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64"> <value> iVBORw0KGgoAAAANSUhEUgAAAHgAAAEGCAIAAAAhWcaAAAAABGdBTUEAALGPC/xhBQAAACBjSFJNAAB6 JgAAgIQAAPoAAACA6AAAdTAAAOpgAAA6mAAAF3CculE8AABvkklEQVR4Xu29B1hUd9r+z3X939+7bzax RQWmnZmhS++9i4KCXRRRsKGoiKKIKIJKlSrSpTdpioWmYm9gLzEao4kliTGmZ3ez6767yb7/+3u+M8fD DBiTTVE33+u5cKSe85n73M/9nJk5oyEsE4rKRaIKkbhKLKmVMPUM08hIW6Ty3XL5PrlOl45Ot47uEV3d 47p6J/X0TrGFG8f09I7o6Xbr6u7X1W3X1d2nq7NbR2enjk6zjk6jjk69jk6djixDxsxhRJailJSUy5cv f/vtt3/729/+/ve//+///u8//vGPf/7zn999993333//L3b936u+WNBlInG5WFIhkVRKmCpGWiOV1kpl O2TyJrm8RS5vlevs1dHt1NU9oAuy4Esoo46yrA+xn8dX29RY1+joVOvI0mXMbEZkIUpPT7958+Zf/vKX v/71r0+ePPlPw60BylA0Bc1UMgR0lVRWLZPVyuR1cnm9XKeBBdeio9OqA+US/Xbp6h7UJYi5UrLW3aOr s6sPa3mVXF4pl6ZKJTMlQmNhYWHhhx9++B+Im4B+SrlSSblaJq+Rk6qVwwQIsh06hHiTkvheljjgwjoA HQXWuAOojbSqsa6Qy8vl0o1SyWSJUEfY0NDwpz/96T8KtwYoiysU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RtXJpMs sSotJXoLJLwlNjsDEt6wbWtC/raNBXmbiwqh4pRSYsdbKsvI62qrK7Ig5LrqrXU1udByQz3ryyRjFDY3 FrWQUrjzq6loCBZuSzX7PNdBvnnzJiLE7du332evH0ktmAYJ7hJ8cGEqYRUj/k9TMX9prI5CbJi/ZvWC mOiFsWvC1q1dtH6tUrxxyzbGR27eGJm4aUXy5qhU6DcZ+o3J2EKyRA5x4bhtOfF5ucjFmwrzEoupikuI iivIq2vhyBk1lVk1ldl11TlIFztqiZZ31G1jtZzfhPGPuvN/gqJhtRd/zHWQIV5ECL5+YcFckFBx4f9k CassjY0blm1KiNicsDxxY2TSJkxxMF9WvDDf1DXpqTGZ6WuzMmJzMtdtzVrPuvCG/NyEgm0bi/I3Fxcg FydtL04pK0GlkdfVlqZXlqdXwZErM2urkC6IllFUyw11qDylO/+HKRpW+6Oug8z3X75+qYSh398l3O/S SE+NzkiLztiyJnPLmqz0tdkZyA+xrHjhv8SCqX4L8jYVF0DCiSXkFYlJpcXkRbVlxI5TWTveAjumV+1Q aLlaoeX6mq2o3xVN3v0Ni7otNEsnNypb2C6nXIQHFfFy/vu7fp9naeQS2cblbd2Ays+NL9iWUMBeV4gt ouKSQhTiBH2BeErZ9hTWixVX7SBa5l2BhmSMKuTl3xWtpmi+YKlmVWSLpaJcLMXd9Pt67qVRmLcRRSXM ipcU73XhimscoJ7nmkq/K3pARbMxQSFYLIVi2aW4L35fP8fS4CSscnUDZfV/BZrfFf2jFa0A/vv6hdfP cJWw3xX9u6JfoPW7on9X9Ku1flf074p+tdbviv5d0a/S+r//+/8BPTxUq6Ub7iwAAAAASUVORK5CYII= </value> </data> </root>
{ "pile_set_name": "Github" }
/* * This file is part of the MicroPython project, http://micropython.org/ * * The MIT License (MIT) * * Copyright (c) 2014 Damien P. George * * 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 MICROPY_INCLUDED_PY_FROZENMOD_H #define MICROPY_INCLUDED_PY_FROZENMOD_H #include "py/lexer.h" enum { MP_FROZEN_NONE, MP_FROZEN_STR, MP_FROZEN_MPY, }; int mp_find_frozen_module(const char *str, size_t len, void **data); const char *mp_find_frozen_str(const char *str, size_t *len); mp_import_stat_t mp_frozen_stat(const char *str); #endif // MICROPY_INCLUDED_PY_FROZENMOD_H
{ "pile_set_name": "Github" }
@comment $OpenBSD: PLIST,v 1.11 2017/04/06 12:12:21 jca Exp $ @bin bin/ratpoison bin/rpws @info info/ratpoison.info @man man/man1/ratpoison.1 share/doc/ratpoison/ share/doc/ratpoison/AUTHORS share/doc/ratpoison/COPYING share/doc/ratpoison/NEWS share/doc/ratpoison/README share/emacs/ share/emacs/site-lisp/ share/emacs/site-lisp/ratpoison.el share/ratpoison/ share/ratpoison/allwindows.sh share/ratpoison/clickframe.pl share/ratpoison/genrpbindings share/ratpoison/ratdate.sh share/ratpoison/rpshowall.sh share/ratpoison/rpws share/ratpoison/sloppy.c share/ratpoison/split.sh share/ratpoison/unrat.c
{ "pile_set_name": "Github" }
// Copyright (c) 2019 Ste||ar Group // // SPDX-License-Identifier: BSL-1.0 // 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) #pragma once #include <hpx/config.hpp> #include <hpx/thread_executors/config/defines.hpp> #include <hpx/include/thread_executors.hpp> #if HPX_THREAD_EXECUTORS_HAVE_DEPRECATION_WARNINGS #if defined(HPX_MSVC) #pragma message( \ "The header hpx/runtime/threads/executors/thread_pool_os_executors.hpp is \ deprecated, \ please include hpx/include/thread_executors.hpp instead") #else #warning \ "The header hpx/runtime/threads/executors/thread_pool_os_executors.hpp is \ deprecated, \ please include hpx/include/thread_executors.hpp instead" #endif #endif
{ "pile_set_name": "Github" }
/* Copyright (c) 2006-2012, DNSPod Inc. * All rights reserved. * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions are met: * * 1. Redistributions of source code must retain the above copyright notice, this * list of conditions and the following disclaimer. * 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 OWNER 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. * The views and conclusions contained in the software and documentation are those * of the authors and should not be interpreted as representing official policies, * either expressed or implied, of the FreeBSD Project. */ //write log //write data file //read data file #ifndef _IO_H #define _IO_H #include "dns.h" #include <sys/stat.h> //read and write files #include <sys/types.h> int read_config(const char *, char *, struct htable *, char **); #define LOG_INTERVAL (900) #define TYPE_FETCHER (112) #define TYPE_QUIZZER (233) enum { NEVER_EXPIRED1 = 172800, NEVER_EXPIRED2 = 518400, }; #define LOG_CACHE_SIZE (1024 * 1024) struct log_info { int logfd; time_t lastlog; int log_type; uchar log_cache[LOG_CACHE_SIZE]; int log_cache_cursor; }; //idx and lastlog and logfd //first argu int create_new_log(uchar * prefix, int idx, int type); int write_log(struct log_info *, int, const uchar *, int, int, struct sockaddr_in *); int read_root(struct htable *, struct rbtree *); int refresh_records(struct htable *, struct rbtree *); uchar * jump_space(uchar * itor); #endif
{ "pile_set_name": "Github" }
#!/usr/bin/perl # # Copyright (c) 2004, SWITCH - Teleinformatikdienste fuer Lehre und Forschung # All rights reserved. # # Redistribution and use in source and binary forms, with or without # modification, are permitted provided that the following conditions are met: # # * Redistributions of source code must retain the above copyright notice, # this list of conditions and the following disclaimer. # * Redistributions in binary form must reproduce the above copyright notice, # this list of conditions and the following disclaimer in the documentation # and/or other materials provided with the distribution. # * Neither the name of SWITCH nor the names of its contributors may be # used to endorse or promote products derived from this software without # specific prior written permission. # # THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" # AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE # IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE # ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER 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. # # $Author: haag $ # # $Id: PortTracker.pm 67 2010-09-09 05:56:05Z haag $ # # $LastChangedRevision: 67 $ # Demo plugin for NfSen # # This plugin demonstrates the use of plugins package PortTracker; use strict; use NfSen; use NfConf; # # The plugin may send any messages to syslog # Do not initialize syslog, as this is done by # the main process nfsen-run use Sys::Syslog; our $VERSION = 130; our %cmd_lookup = ( 'get-portgraph' => \&GetPortGraph, 'get-topN' => \&GetTopN, ); my ( $nftrack, $PROFILEDATADIR ); my $PORTSDBDIR = "/data/ports-db"; my $EODATA = ".\n"; # colours used in graphs # if more than 12 graphs are drawn ( does this really make sense ? ) # the same colours are used again my @colour = ( '#ff0000', '#ff8000', '#ffff00', '#80ff00', '#00ff00', '#00ff80', '#00ffff', '#0080ff', '#0000ff', '#8000ff', '#ff00ff', '#ff0080' ); sub GetTopN { my $socket = shift; my $opts = shift; my $interval; if ( !exists $$opts{'interval'} ) { $interval = 1; } else { $interval = $$opts{'interval'}; } print $socket ".Get topN ports\n"; my $statfile = $interval == 24 ? 'portstat24.txt' : 'portstat.txt'; print $socket ".topN ports $PORTSDBDIR/$statfile\n"; if ( !open STAT, "$PORTSDBDIR/$statfile" ) { print $socket $EODATA; print $socket "ERR Open statfile '$PORTSDBDIR/$statfile': $!\n"; return; } print $socket ".topN read ports\n"; while ( <STAT> ) { chomp; print $socket "_topN=$_\n"; } print $socket $EODATA; print $socket "OK Command completed\n", } # End of GetPortGraph sub GetPortGraph { my $socket = shift; my $opts = shift; # get all arguments: # Example: # proto typw logscale light tstart tend topN track_list # tcp flows 0 0 1116495000 1116581400 '22 445 135 1433' '80 143' if ( !exists $$opts{'arg'} ) { print $socket $EODATA; print $socket "ERR Missing Arguments.\n"; } my $ARGS = $$opts{'arg'}; my $proto = shift @$ARGS; # 'tcp' or 'udp' my $type = shift @$ARGS; # 'flows', 'packets' or 'bytes' my $logscale = shift @$ARGS; # 0 or 1 my $stacked = shift @$ARGS; # 0 or 1 my $light = shift @$ARGS; # 0 or 1 my $tstart = shift @$ARGS; # start time - UNIX format my $tend = shift @$ARGS; # end time - UNIX format my $topN = shift @$ARGS; # TopN port list: string: ' ' separated port list my $track_list = shift @$ARGS; # Static track port list: string: ' ' separated port list my $skip_list = shift @$ARGS; # Static skip port list: string: ' ' separated port list if ( !defined $proto || !defined $type || !defined $logscale || !defined $stacked || !defined $light || !defined $tstart || !defined $tend || !defined $topN || !defined $track_list || !defined $skip_list ) { print $socket $EODATA; print $socket "ERR Argument Error.\n"; return; } my @skipPorts = split '-', $skip_list; my @topN = split '-', $topN; my @track_list = split '-', $track_list; # remove the common ports in both lists from the dynamic topN list my %_tmp; @_tmp{@track_list} = @track_list; delete @_tmp{@topN}; @track_list = sort keys %_tmp; # %_tmp = (); # @_tmp{@topN} = @topN; # delete @_tmp{@skipPorts}; # @topN = keys %_tmp; %_tmp = (); my @_tmp; @_tmp{@skipPorts} = @skipPorts; foreach my $port ( @topN ) { push @_tmp, $port unless exists $_tmp{$port}; } @topN = @_tmp; my $datestr = scalar localtime($tstart) . " - " . scalar localtime($tend); my $title = uc($proto) . " " . ucfirst($type); my @DEFS = (); # Compile rrd args my @rrdargs = (); push @rrdargs, "-"; # output graphics to stdout foreach my $port ( @topN, @track_list ) { # assemble filename my $fileident = $port >> 10; my $rrdfile = "$PORTSDBDIR/${proto}-${type}-$fileident.rrd"; # which ident in this rrd file my $ident = $port & 1023; # 0x0000001111111111 mask push @rrdargs, "DEF:Port${port}=$rrdfile:p${ident}:AVERAGE"; } push @rrdargs, "--start", "$tstart"; push @rrdargs, "--end", "$tend"; push @rrdargs, "--title", "$datestr - $title" unless $light; push @rrdargs, "--vertical-label", "$title" unless $light; # lin or log graph? push @rrdargs, "--logarithmic" if $logscale; if ( $light ) { push @rrdargs, "-w"; push @rrdargs, "288"; push @rrdargs, "-h"; push @rrdargs, "150"; push @rrdargs, "--no-legend"; # no legend in small pictures } else { push @rrdargs, "-w"; push @rrdargs, "576"; push @rrdargs, "-h"; push @rrdargs, "300"; } my $i=0; my $area_set = 0; my $n = scalar @topN; push @rrdargs, "COMMENT:Top $n Ports\\n"; if ( $stacked && scalar @topN ) { my $port = shift @topN; push @rrdargs, "AREA:Port${port}$colour[$i]:Port ${port}"; $i++; $area_set = 1; foreach my $port ( @topN ) { push @rrdargs, "STACK:Port${port}$colour[$i]:Port ${port}"; $i++; } } else { foreach my $port ( @topN ) { push @rrdargs, "LINE1:Port${port}$colour[$i]:Port ${port}"; $i++; } } if ( scalar @track_list) { push @rrdargs, "COMMENT:\\n"; push @rrdargs, "COMMENT:\\n"; push @rrdargs, "COMMENT:Tracked Ports\\n"; } if ( $stacked && scalar @track_list) { if ( !$area_set ) { my $port = shift @track_list; push @rrdargs, "AREA:Port${port}$colour[$i]:Port ${port}"; $i++; } foreach my $port ( @track_list ) { push @rrdargs, "STACK:Port${port}$colour[$i]:Port ${port}"; $i++; } } else { foreach my $port ( @track_list ) { push @rrdargs, "LINE2:Port${port}$colour[$i]:Port ${port}"; $i++; } } if ( scalar @skipPorts) { push @rrdargs, "COMMENT:\\n"; push @rrdargs, "COMMENT:\\n"; my $portlist = join ',', @skipPorts; push @rrdargs, "COMMENT:Skipped Ports $portlist\\n"; } my ($averages,$xsize,$ysize) = RRDs::graph( @rrdargs ); if (my $ERROR = RRDs::error) { print "ERROR: $ERROR\n"; } } # End of GenPortGraph sub nftrack_execute { my $command = shift; syslog('debug', $command); my $ret = system($command); if ( $ret == - 1 ) { syslog('err', "Failed to execute nftrack: $!\n"); } elsif ($ret & 127) { syslog('err', "nftrack died with signal %d, %s coredump\n", ($ret & 127), ($ret & 128) ? 'with' : 'without'); } else { syslog('debug', "nftrack exited with value %d\n", $ret >> 8); } } # End of nftrack_execute # # Periodic function # input: hash reference including the items: # 'profile' profile name # 'profilegroup' profile group # 'timeslot' time of slot to process: Format yyyymmddHHMM e.g. 200503031200 sub run { my $argref = shift; my $profile = $$argref{'profile'}; my $profilegroup = $$argref{'profilegroup'}; my $timeslot = $$argref{'timeslot'}; syslog('debug', "PortTracker run: Profile: $profile, Time: $timeslot"); my %profileinfo = NfProfile::ReadProfile($profile); my $netflow_sources = "$PROFILEDATADIR/$profile/$profileinfo{'sourcelist'}"; # # process all sources of this profile at once my $command = "$nftrack -M $netflow_sources -r nfcapd.$timeslot -d $PORTSDBDIR -A -t $timeslot -s -p -w $PORTSDBDIR/portstat.txt"; nftrack_execute($command); $command = "$nftrack -d $PORTSDBDIR -S -p -w $PORTSDBDIR/portstat24.txt"; nftrack_execute($command); # # Process the output and notify the duty team syslog('debug', "PortTracker run: Done."); } # End of run sub Init { syslog("info", "PortTracker: Init"); # Init some vars $nftrack = "$NfConf::PREFIX/nftrack"; $PROFILEDATADIR = "$NfConf::PROFILEDATADIR"; return 1; } sub Cleanup { syslog("info", "PortTracker Cleanup"); # not used here } 1;
{ "pile_set_name": "Github" }
/* * Translated default messages for the jQuery validation plugin. * Locale: ES (Spanish; Español) */ $.extend( $.validator.messages, { required: "Este campo es obligatorio.", remote: "Por favor, rellena este campo.", email: "Por favor, escribe una dirección de correo válida.", url: "Por favor, escribe una URL válida.", date: "Por favor, escribe una fecha válida.", dateISO: "Por favor, escribe una fecha (ISO) válida.", number: "Por favor, escribe un número válido.", digits: "Por favor, escribe sólo dígitos.", creditcard: "Por favor, escribe un número de tarjeta válido.", equalTo: "Por favor, escribe el mismo valor de nuevo.", extension: "Por favor, escribe un valor con una extensión aceptada.", maxlength: $.validator.format( "Por favor, no escribas más de {0} caracteres." ), minlength: $.validator.format( "Por favor, no escribas menos de {0} caracteres." ), rangelength: $.validator.format( "Por favor, escribe un valor entre {0} y {1} caracteres." ), range: $.validator.format( "Por favor, escribe un valor entre {0} y {1}." ), max: $.validator.format( "Por favor, escribe un valor menor o igual a {0}." ), min: $.validator.format( "Por favor, escribe un valor mayor o igual a {0}." ), nifES: "Por favor, escribe un NIF válido.", nieES: "Por favor, escribe un NIE válido.", cifES: "Por favor, escribe un CIF válido." } );
{ "pile_set_name": "Github" }
<?xml version="1.0" encoding="UTF-8"?> <project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd"> <modelVersion>4.0.0</modelVersion> <parent> <groupId>org.springframework.boot</groupId> <artifactId>spring-boot-starter-parent</artifactId> <version>2.1.6.RELEASE</version> <relativePath/> </parent> <groupId>club.mydlq</groupId> <artifactId>service-customer</artifactId> <version>0.0.1</version> <name>service-customer</name> <description>service customer</description> <properties> <java.version>1.8</java.version> </properties> <dependencies> <!--SpringBoot Web--> <dependency> <groupId>org.springframework.boot</groupId> <artifactId>spring-boot-starter-web</artifactId> </dependency> <!--SpringBoot Actuator--> <dependency> <groupId>org.springframework.boot</groupId> <artifactId>spring-boot-starter-actuator</artifactId> </dependency> <!--Feign--> <dependency> <groupId>org.springframework.cloud</groupId> <artifactId>spring-cloud-starter-openfeign</artifactId> <version>2.1.2.RELEASE</version> </dependency> <!--Service Interface API--> <dependency> <groupId>club.mydlq</groupId> <artifactId>service-feign-interface</artifactId> <version>0.0.1</version> </dependency> </dependencies> <build> <plugins> <plugin> <groupId>org.springframework.boot</groupId> <artifactId>spring-boot-maven-plugin</artifactId> </plugin> </plugins> </build> </project>
{ "pile_set_name": "Github" }
#! /bin/sh # Copyright 2018-2019 Mailgun Technologies 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. # # Make sure the script fails fast. set -e set -u set -x go run ./cmd/gubernator-server --config etc/server-1.yaml & go run ./cmd/gubernator-server --config etc/server-2.yaml & go run ./cmd/gubernator-server --config etc/server-3.yaml &
{ "pile_set_name": "Github" }
<?php /** * Copyright © Magento, Inc. All rights reserved. * See COPYING.txt for license details. */ namespace Magento\Sales\Test\Constraint; use Magento\Mtf\Constraint\AbstractConstraint; use Magento\Sales\Test\Page\Adminhtml\OrderIndex; use Magento\Sales\Test\Page\Adminhtml\SalesOrderView; /** * Assert that deny payment message exists in Comments History section on order page in Admin. * * Constraint checks deny payment message in order comments history */ class AssertDenyPaymentMessageInCommentsHistory extends AbstractConstraint { /** * Deny payment message. * * @var string */ private static $message = 'Denied the payment online'; /** * Assert that deny payment message exists in Comments History section on order page in Admin. * * @param SalesOrderView $salesOrderView * @param OrderIndex $orderIndex * @param $orderId * @return void */ public function processAssert(SalesOrderView $salesOrderView, OrderIndex $orderIndex, $orderId) { $orderIndex->open(); $orderIndex->getSalesOrderGrid()->searchAndOpen(['id' => $orderId]); /** @var \Magento\Sales\Test\Block\Adminhtml\Order\View\Tab\Info $infoTab */ $infoTab = $salesOrderView->getOrderForm()->openTab('info')->getTab('info'); $latestComment = $infoTab->getCommentsHistoryBlock()->getLatestComment(); \PHPUnit\Framework\Assert::assertContains(self::$message, $latestComment['comment']); } /** * Returns a string representation of the object. * * @return string */ public function toString() { return 'Message about denied payment is available in Comments History section.'; } }
{ "pile_set_name": "Github" }
using System.Reflection; using System.Runtime.CompilerServices; using System.Runtime.InteropServices; // 有关程序集的一般信息由以下 // 控制。更改这些特性值可修改 // 与程序集关联的信息。 [assembly: AssemblyTitle("p99_Test")] [assembly: AssemblyDescription("")] [assembly: AssemblyConfiguration("")] [assembly: AssemblyCompany("")] [assembly: AssemblyProduct("p99_Test")] [assembly: AssemblyCopyright("Copyright © 2017")] [assembly: AssemblyTrademark("")] [assembly: AssemblyCulture("")] //将 ComVisible 设置为 false 将使此程序集中的类型 //对 COM 组件不可见。 如果需要从 COM 访问此程序集中的类型, //请将此类型的 ComVisible 特性设置为 true。 [assembly: ComVisible(false)] // 如果此项目向 COM 公开,则下列 GUID 用于类型库的 ID [assembly: Guid("22c6dfee-d99e-42e8-92de-1a2465d9e329")] // 程序集的版本信息由下列四个值组成: // // 主版本 // 次版本 // 生成号 // 修订号 // //可以指定所有这些值,也可以使用“生成号”和“修订号”的默认值, // 方法是按如下所示使用“*”: : // [assembly: AssemblyVersion("1.0.*")] [assembly: AssemblyVersion("1.0.0.0")] [assembly: AssemblyFileVersion("1.0.0.0")]
{ "pile_set_name": "Github" }
/* * mutex2.c * * Declare a static mutex object, lock it, * and then unlock it again. * * Depends on API functions: * pthread_mutex_lock() * pthread_mutex_unlock() */ #include "test.h" pthread_mutex_t mutex = PTHREAD_MUTEX_INITIALIZER; int main() { assert(mutex == PTHREAD_MUTEX_INITIALIZER); assert(pthread_mutex_lock(&mutex) == 0); assert(mutex != PTHREAD_MUTEX_INITIALIZER); assert(mutex != NULL); assert(pthread_mutex_unlock(&mutex) == 0); assert(pthread_mutex_destroy(&mutex) == 0); assert(mutex == NULL); return 0; }
{ "pile_set_name": "Github" }
# - Try to find blitz lib # Once done this will define # # BLITZ_FOUND - system has blitz lib # BLITZ_INCLUDES - the blitz include directory # BLITZ_LIBRARIES - The libraries needed to use blitz # Copyright (c) 2006, Montel Laurent, <[email protected]> # Copyright (c) 2007, Allen Winter, <[email protected]> # Copyright (C) 2008 Gael Guennebaud <[email protected]> # Redistribution and use is allowed according to the terms of the BSD license. # For details see the accompanying COPYING-CMAKE-SCRIPTS file. # include(FindLibraryWithDebug) if (BLITZ_INCLUDES AND BLITZ_LIBRARIES) set(Blitz_FIND_QUIETLY TRUE) endif (BLITZ_INCLUDES AND BLITZ_LIBRARIES) find_path(BLITZ_INCLUDES NAMES blitz/array.h PATH_SUFFIXES blitz* PATHS $ENV{BLITZDIR}/include ${INCLUDE_INSTALL_DIR} ) find_library(BLITZ_LIBRARIES blitz PATHS $ENV{BLITZDIR}/lib ${LIB_INSTALL_DIR} ) include(FindPackageHandleStandardArgs) find_package_handle_standard_args(Blitz DEFAULT_MSG BLITZ_INCLUDES BLITZ_LIBRARIES) mark_as_advanced(BLITZ_INCLUDES BLITZ_LIBRARIES)
{ "pile_set_name": "Github" }
<ul id="someid" class="errorMessage"> <li><span>field error message number 1</span></li> <li><span>field error message number 3</span></li> </ul>
{ "pile_set_name": "Github" }
--- title: Docker 应用的开发环境 description: 了解支持 Docker 开发生命周期的最重要的开发工具选项。 ms.date: 08/06/2020 ms.openlocfilehash: 07b42b2bd05ab16ba0fbf61863b050ee2c9e242b ms.sourcegitcommit: ef50c99928183a0bba75e07b9f22895cd4c480f8 ms.translationtype: HT ms.contentlocale: zh-CN ms.lasthandoff: 08/07/2020 ms.locfileid: "87916034" --- # <a name="development-environment-for-docker-apps"></a>Docker 应用的开发环境 ## <a name="development-tools-choices-ide-or-editor"></a>开发工具选择:IDE 或编辑器 无论你更青睐内容丰富、功能强大的 IDE 还是灵活轻量的编辑器,Microsoft 在开发 Docker 应用程序时都能满足你的需求。 ### <a name="visual-studio-code-and-docker-cli-cross-platform-tools-for-mac-linux-and-windows"></a>Visual Studio Code 和 Docker CLI(适用于 Mac、Linux 和 Windows 的跨平台工具) 如果更青睐支持任何开发语言的轻量级跨平台编辑器,可以使用 Visual Studio Code 和 Docker CLI。 这些产品提供简单而可靠的体验,这对简化开发人员工作流至关重要。 安装“用于 Mac 的 Docker”或“用于 Windows 的 Docker”(开发环境),Docker 开发人员即可使用单个 Docker CLI 为 Windows 或 Linux(运行时环境)构建应用。 此外,Visual Studio Code 还支持 Docker 扩展(例如适用于 Dockerfile 的 IntelliSense)和在编辑器中运行 Docker 命令的快捷任务。 > [!NOTE] > 要下载 Visual Studio Code,请转到 <https://code.visualstudio.com/download>。 > > 要下载用于 Mac 和 Windows 的 Docker,请转到 <https://www.docker.com/products/docker>。 ### <a name="visual-studio-with-docker-tools-windows-development-machine"></a>附带 Docker 工具的 Visual Studio(Windows 开发计算机) 建议使用 Visual Studio 2019 并启用内置 Docker 工具。 使用 Visual Studio,可以直接在所选的 Docker 环境中开发、运行和验证应用程序。 按 F5,即可直接在 Docker 主机中调试应用程序(单个容器或多个容器);也可以按 Ctrl+F5,无需重新生成容器,即可编辑并刷新应用。 对于创建用于 Linux 或 Windows 的 Docker 容器的 Windows 开发人员,这是最简单且功能最强大的选择。 ### <a name="visual-studio-for-mac-mac-development-machine"></a>Visual Studio for Mac(Mac 开发计算机) 开发基于 Docker 的应用程序时,可以使用 [Visual Studio for Mac](https://visualstudio.microsoft.com/vs/mac/?utm_medium=microsoft&utm_source=docs.microsoft.com&utm_campaign=inline+link)。 与 Visual Studio Code for Mac 相比,Visual Studio for Mac 提供了更丰富的 IDE。 ## <a name="language-and-framework-choices"></a>选择语言和框架 可以使用 Microsoft 工具和大多数现代语言开发 Docker 应用程序。 以下是初始列表,但不局限于该表: - .NET Core 和 ASP.NET Core - Node.js - Go - Java - Ruby - Python 基本上可以使用由 Linux 或 Windows 中的 Docker 支持的任何现代语言。 >[!div class="step-by-step"] >[上一页](deploy-azure-kubernetes-service.md) >[下一页](docker-apps-inner-loop-workflow.md)
{ "pile_set_name": "Github" }
/* * {{{ header & license * Copyright (c) 2007 Sean Bright * * This program is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public License * as published by the Free Software Foundation; either version 2.1 * of the License, or (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. * }}} */ package org.xhtmlrenderer.swing; import java.awt.event.MouseEvent; import org.xhtmlrenderer.render.Box; /** * An FSMouseListener is used to track mouse events on a subclass of {@link BasicPanel}. * FSMouseListener instances can be added to the panel via {@link BasicPanel#addMouseTrackingListener(FSMouseListener)}. * The listener will automatically receive callbacks as the user moves over the panel. It's the developer's * responsibility to decide how to handle the events, in particular, locating the particular Box instance in the * tree which should be acted upon. You may find it more useful to use one of the existing subclasses, for * example {@link org.xhtmlrenderer.swing.LinkListener}, {@link org.xhtmlrenderer.swing.HoverListener}, or * {@link org.xhtmlrenderer.swing.CursorListener}. */ public interface FSMouseListener { /** * Sent when the mouse moves over a Box in the render tree. * * @param panel the panel where the box is displayed * @param box the box the mouse has just moved over */ void onMouseOver(BasicPanel panel, Box box); /** * Sent when the mouse leaves a Box in the render tree after entering it. * * @param panel the panel where the box is displayed * @param box the box the mouse has just left */ void onMouseOut(BasicPanel panel, Box box); /** * Sent when the mouse button is released while hovering over a Box in the render tree. * * @param panel the panel where the box is displayed * @param box the box where the mouse is currently located */ void onMouseUp(BasicPanel panel, Box box); /** * Sent when the mouse button is pressed. * * @param panel the panel where the box is displayed * @param e information about the mouse position, etc. */ void onMousePressed(BasicPanel panel, MouseEvent e); /** * Sent when the mouse button is held and the mouse is moved. * * @param panel the panel where the box is displayed * @param e information about the mouse position, etc. */ void onMouseDragged(BasicPanel panel, MouseEvent e); /** * Implementation-dependent. Sent via {@link BasicPanel#resetMouseTracker()}. */ void reset(); }
{ "pile_set_name": "Github" }
#name: C6X stack attribute merging, 8 816 #as: -mlittle-endian #ld: -r -melf32_tic6x_le #source: attr-stack-8.s #source: attr-stack-816.s #readelf: -A Attribute Section: c6xabi File Attributes Tag_ISA: C674x
{ "pile_set_name": "Github" }
load("//tensorflow:tensorflow.bzl", "filegroup") load("//tensorflow/core/platform:build_config.bzl", "tf_proto_library") load( "//tensorflow/core/platform:rules_cc.bzl", "cc_library", ) package( default_visibility = [ "//tensorflow/core:__subpackages__", ], licenses = ["notice"], # Apache 2.0 ) # Todo(bmzhao): Remaining targets to add to this BUILD file are all tests. cc_library( name = "arena", srcs = ["arena.cc"], hdrs = ["arena.h"], deps = [ "//tensorflow/core/lib/math:math_util", "//tensorflow/core/platform:logging", "//tensorflow/core/platform:macros", "//tensorflow/core/platform:platform_port", "//tensorflow/core/platform:types", ], ) cc_library( name = "bitmap", srcs = ["bitmap.cc"], hdrs = ["bitmap.h"], deps = [ "//tensorflow/core/platform:logging", "//tensorflow/core/platform:types", ], alwayslink = 1, ) cc_library( name = "blocking_counter", hdrs = ["blocking_counter.h"], deps = [ "//tensorflow/core/platform:blocking_counter", ], ) cc_library( name = "bits", hdrs = ["bits.h"], deps = [ "//tensorflow/core/platform:logging", "//tensorflow/core/platform:types", ], ) cc_library( name = "coding", hdrs = ["coding.h"], deps = [ "//tensorflow/core/platform:coding", ], ) cc_library( name = "errors", hdrs = ["errors.h"], deps = [ "//tensorflow/core/platform:errors", ], ) cc_library( name = "notification", hdrs = ["notification.h"], deps = [ "//tensorflow/core/platform:notification", ], ) cc_library( name = "raw_coding", hdrs = ["raw_coding.h"], deps = [ "//tensorflow/core/platform:raw_coding", ], ) cc_library( name = "refcount", hdrs = ["refcount.h"], deps = ["//tensorflow/core/platform:refcount"], ) cc_library( name = "status", hdrs = ["status.h"], deps = [ "//tensorflow/core/platform:status", ], ) cc_library( name = "stringpiece", hdrs = ["stringpiece.h"], deps = [ "//tensorflow/core/platform:stringpiece", ], ) cc_library( name = "threadpool", hdrs = ["threadpool.h"], deps = [ "//tensorflow/core/platform:env", ], ) cc_library( name = "threadpool_interface", hdrs = ["threadpool_interface.h"], deps = [ "//tensorflow/core/platform:threadpool_interface", ], ) cc_library( name = "threadpool_options", hdrs = ["threadpool_options.h"], deps = [ "//tensorflow/core/platform:threadpool_options", ], ) tf_proto_library( name = "error_codes_proto", srcs = ["error_codes.proto"], cc_api_version = 2, make_default_target_header_only = True, protodeps = [ "//tensorflow/core/protobuf:error_codes_proto_impl", ], visibility = [ "//tensorflow/core:__subpackages__", "//tensorflow/core/protobuf:__subpackages__", ], exports = ["//tensorflow/core/protobuf:error_codes_proto_impl"], ) # Export source files needed for mobile builds, which do not use granular targets. filegroup( name = "mobile_srcs_no_runtime", srcs = [ "blocking_counter.h", "coding.h", "errors.h", "refcount.h", "status.h", "stringpiece.h", ], visibility = ["//tensorflow/core:__pkg__"], ) filegroup( name = "mobile_srcs_only_runtime", srcs = [ "arena.cc", "arena.h", "bitmap.h", "bits.h", "notification.h", "threadpool.h", "threadpool_interface.h", "threadpool_options.h", ], visibility = ["//tensorflow/core:__pkg__"], ) filegroup( name = "legacy_lib_core_all_headers", srcs = [ "arena.h", "bitmap.h", "bits.h", "blocking_counter.h", "coding.h", "errors.h", "notification.h", "raw_coding.h", "refcount.h", "status.h", "status_test_util.h", "stringpiece.h", "threadpool.h", "threadpool_interface.h", "threadpool_options.h", ], visibility = ["//tensorflow/core:__pkg__"], ) filegroup( name = "legacy_lib_core_all_tests", srcs = [ "arena_test.cc", "bitmap_test.cc", "blocking_counter_test.cc", "coding_test.cc", "notification_test.cc", "refcount_test.cc", "status_test.cc", "threadpool_test.cc", ], visibility = ["//tensorflow/core:__pkg__"], ) filegroup( name = "legacy_lib_internal_core_headers", srcs = [ "blocking_counter.h", "refcount.h", ], visibility = ["//tensorflow/core:__pkg__"], ) filegroup( name = "legacy_lib_core_status_header", srcs = [ "status.h", ], visibility = ["//tensorflow/core:__pkg__"], ) filegroup( name = "legacy_lib_core_status_test_util_header", srcs = [ "status_test_util.h", ], visibility = ["//tensorflow/core:__pkg__"], ) filegroup( name = "legacy_lib_core_stringpiece_header", srcs = [ "stringpiece.h", ], visibility = ["//tensorflow/core:__pkg__"], ) filegroup( name = "legacy_lib_core_threadpool_options_header", srcs = [ "threadpool_options.h", ], visibility = ["//tensorflow/core:__pkg__"], ) filegroup( name = "legacy_lib_proto_parsing_headers", srcs = [ "errors.h", "status.h", "stringpiece.h", ], visibility = ["//tensorflow/core:__pkg__"], ) filegroup( name = "legacy_lib_core_headers", srcs = [ "arena.h", "bitmap.h", "bits.h", "coding.h", "errors.h", "notification.h", "raw_coding.h", "status.h", "stringpiece.h", "threadpool.h", "threadpool_interface.h", ], visibility = ["//tensorflow/core:__pkg__"], ) # This is needed because of how tf_android_core_proto_sources parses proto paths. exports_files( srcs = ["error_codes.proto"], visibility = ["//tensorflow/core:__pkg__"], )
{ "pile_set_name": "Github" }
defmodule DesignPathTest do use CouchTestCase @moduletag :design_docs @moduletag kind: :single_node @moduledoc """ Test CouchDB design documents path """ @tag :with_db test "design doc path", context do db_name = context[:db_name] ddoc_path_test(db_name) end @tag :with_db_name test "design doc path with slash in db name", context do db_name = URI.encode_www_form(context[:db_name] <> "/with_slashes") create_db(db_name) ddoc_path_test(db_name) end defp ddoc_path_test(db_name) do create_test_view(db_name, "_design/test") resp = Couch.get("/#{db_name}/_design/test") assert resp.body["_id"] == "_design/test" resp = Couch.get(Couch.process_url("/#{db_name}/_design%2Ftest"), follow_redirects: true ) assert resp.body["_id"] == "_design/test" resp = Couch.get("/#{db_name}/_design/test/_view/testing") assert Enum.empty?(Map.get(resp, :body)["rows"]) design_doc2 = %{ _id: "_design/test2", views: %{ testing: %{ map: "function(){emit(1,1)}" } } } resp = Couch.put("/#{db_name}/_design/test2", body: design_doc2) assert resp.status_code == 201 resp = Couch.get("/#{db_name}/_design/test2") assert resp.body["_id"] == "_design/test2" resp = Couch.get(Couch.process_url("/#{db_name}/_design%2Ftest2"), follow_redirects: true ) assert resp.body["_id"] == "_design/test2" resp = Couch.get("/#{db_name}/_design/test2/_view/testing") assert Enum.empty?(Map.get(resp, :body)["rows"]) end defp create_test_view(db_name, id) do design_doc = %{ _id: id, views: %{ testing: %{ map: "function(){emit(1,1)}" } } } create_doc(db_name, design_doc) end end
{ "pile_set_name": "Github" }
require 'rails/generators/generated_attribute' module WebAppTheme class ThemedGenerator < Rails::Generators::Base source_root File.expand_path('../templates', __FILE__) argument :controller_path, :type => :string argument :model_name, :type => :string, :required => false class_option :layout, :type => :string, :desc => 'Specify the layout name' class_option :engine, :type => :string, :default => 'erb', :desc => 'Specify the template engine' class_option :will_paginate, :type => :boolean, :default => false, :desc => 'Specify if you use will_paginate' class_option :themed_type, :type => :string, :default => 'crud', :desc => 'Specify the themed type, crud or text. Default is crud' def initialize(args, *options) super(args, *options) initialize_views_variables end def copy_views generate_views unless options.layout.blank? if options.engine =~ /erb/ gsub_file(File.join('app/views/layouts', "#{options[:layout]}.html.#{options.engine}"), /\<div\s+id=\"main-navigation\">.*\<\/ul\>/mi) do |match| match.gsub!(/\<\/ul\>/, "") %|#{match} <li class="<%= controller.controller_path == '#{@controller_file_path}' ? 'active' : '' %>"><a href="<%= #{controller_routing_path}_path %>">#{plural_model_name}</a></li></ul>| end elsif options.engine =~ /haml/ gsub_file(File.join('app/views/layouts', "#{options[:layout]}.html.#{options.engine}"), /#main-navigation.*#wrapper.wat-cf/mi) do |match| match.gsub!(/ #wrapper.wat-cf/, "") %|#{match}| + " "*6 + %|%li{:class => controller.controller_path == '#{@controller_file_path}' ? 'active' : '' }\n| + " "*7 + %|%a{:href => #{controller_routing_path}_path} #{plural_model_name}\n| + " "*3 + %|#wrapper.wat-cf| end end end end protected def initialize_views_variables @base_name, @controller_class_path, @controller_file_path, @controller_class_nesting, @controller_class_nesting_depth = extract_modules(controller_path) @controller_routing_path = @controller_file_path.gsub(/\//, '_') @model_name = @base_name.singularize unless @model_name @model_name = @model_name.camelize end def controller_routing_path @controller_routing_path end def singular_controller_routing_path @controller_routing_path.singularize end def model_name @model_name end def plural_model_name @model_name.pluralize end def resource_name @model_name.underscore end def plural_resource_name resource_name.pluralize end ## # Attempts to call #columns on the model's class # If the (Active Record) #columns method does not exist, it attempts to # perform the (Mongoid) #fields method instead def columns begin excluded_column_names = %w[id created_at updated_at] Kernel.const_get(@model_name).columns.reject{|c| excluded_column_names.include?(c.name) }.collect{|c| Rails::Generators::GeneratedAttribute.new(c.name, c.type)} rescue NoMethodError Kernel.const_get(@model_name).fields.collect{|c| c[1]}.reject{|c| excluded_column_names.include?(c.name) }.collect{|c| Rails::Generators::GeneratedAttribute.new(c.name, c.type.to_s)} end end def extract_modules(name) modules = name.include?('/') ? name.split('/') : name.split('::') name = modules.pop path = modules.map { |m| m.underscore } file_path = (path + [name.underscore]).join('/') nesting = modules.map { |m| m.camelize }.join('::') [name, path, file_path, nesting, modules.size] end def generate_views views = { 'crud' => { 'view_tables.html.erb' => File.join('app/views', @controller_file_path, "index.html.#{options.engine}"), 'view_new.html.erb' => File.join('app/views', @controller_file_path, "new.html.#{options.engine}"), 'view_edit.html.erb' => File.join('app/views', @controller_file_path, "edit.html.#{options.engine}"), 'view_form.html.erb' => File.join('app/views', @controller_file_path, "_form.html.#{options.engine}"), 'view_show.html.erb' => File.join('app/views', @controller_file_path, "show.html.#{options.engine}"), 'view_sidebar.html.erb' => File.join('app/views', @controller_file_path, "_sidebar.html.#{options.engine}") }, 'text' => { 'view_text.html.erb' => File.join('app/views', @controller_file_path, "show.html.#{options.engine}"), 'view_sidebar.html.erb' => File.join('app/views', @controller_file_path, "_sidebar.html.#{options.engine}") } } selected_views = views[options.themed_type] options.engine == 'haml' ? generate_haml_views(selected_views) : generate_erb_views(selected_views) end def generate_erb_views(views) views.each do |template_name, output_path| template template_name, output_path end end def generate_haml_views(views) require 'haml' Dir.mktmpdir('web-app-theme-haml') do |haml_root| views.each do |template_name, output_path| tmp_html_path = "#{haml_root}/#{template_name}" tmp_haml_path = "#{haml_root}/#{template_name}.haml" template template_name, tmp_html_path, :verbose => false `html2haml --erb --xhtml #{tmp_html_path} #{tmp_haml_path}` copy_file tmp_haml_path, output_path end end rescue LoadError say "HAML is not installed, or it is not specified in your Gemfile." exit end end end
{ "pile_set_name": "Github" }
/* Written 1994 by David C. Davies. Copyright 1994 David C. Davies. This software may be used and distributed according to the terms of the GNU General Public License, incorporated herein by reference. */ /* ** I/O addresses. Note that the 2k buffer option is not supported in ** this driver. */ #define DEPCA_NICSR ioaddr+0x00 /* Network interface CSR */ #define DEPCA_RBI ioaddr+0x02 /* RAM buffer index (2k buffer mode) */ #define DEPCA_DATA ioaddr+0x04 /* LANCE registers' data port */ #define DEPCA_ADDR ioaddr+0x06 /* LANCE registers' address port */ #define DEPCA_HBASE ioaddr+0x08 /* EISA high memory base address reg. */ #define DEPCA_PROM ioaddr+0x0c /* Ethernet address ROM data port */ #define DEPCA_CNFG ioaddr+0x0c /* EISA Configuration port */ #define DEPCA_RBSA ioaddr+0x0e /* RAM buffer starting address (2k buff.) */ /* ** These are LANCE registers addressable through DEPCA_ADDR */ #define CSR0 0 #define CSR1 1 #define CSR2 2 #define CSR3 3 /* ** NETWORK INTERFACE CSR (NI_CSR) bit definitions */ #define TO 0x0100 /* Time Out for remote boot */ #define SHE 0x0080 /* SHadow memory Enable */ #define BS 0x0040 /* Bank Select */ #define BUF 0x0020 /* BUFfer size (1->32k, 0->64k) */ #define RBE 0x0010 /* Remote Boot Enable (1->net boot) */ #define AAC 0x0008 /* Address ROM Address Counter (1->enable) */ #define _128KB 0x0008 /* 128kB Network RAM (1->enable) */ #define IM 0x0004 /* Interrupt Mask (1->mask) */ #define IEN 0x0002 /* Interrupt tristate ENable (1->enable) */ #define LED 0x0001 /* LED control */ /* ** Control and Status Register 0 (CSR0) bit definitions */ #define ERR 0x8000 /* Error summary */ #define BABL 0x4000 /* Babble transmitter timeout error */ #define CERR 0x2000 /* Collision Error */ #define MISS 0x1000 /* Missed packet */ #define MERR 0x0800 /* Memory Error */ #define RINT 0x0400 /* Receiver Interrupt */ #define TINT 0x0200 /* Transmit Interrupt */ #define IDON 0x0100 /* Initialization Done */ #define INTR 0x0080 /* Interrupt Flag */ #define INEA 0x0040 /* Interrupt Enable */ #define RXON 0x0020 /* Receiver on */ #define TXON 0x0010 /* Transmitter on */ #define TDMD 0x0008 /* Transmit Demand */ #define STOP 0x0004 /* Stop */ #define STRT 0x0002 /* Start */ #define INIT 0x0001 /* Initialize */ #define INTM 0xff00 /* Interrupt Mask */ #define INTE 0xfff0 /* Interrupt Enable */ /* ** CONTROL AND STATUS REGISTER 3 (CSR3) */ #define BSWP 0x0004 /* Byte SWaP */ #define ACON 0x0002 /* ALE control */ #define BCON 0x0001 /* Byte CONtrol */ /* ** Initialization Block Mode Register */ #define PROM 0x8000 /* Promiscuous Mode */ #define EMBA 0x0080 /* Enable Modified Back-off Algorithm */ #define INTL 0x0040 /* Internal Loopback */ #define DRTY 0x0020 /* Disable Retry */ #define COLL 0x0010 /* Force Collision */ #define DTCR 0x0008 /* Disable Transmit CRC */ #define LOOP 0x0004 /* Loopback */ #define DTX 0x0002 /* Disable the Transmitter */ #define DRX 0x0001 /* Disable the Receiver */ /* ** Receive Message Descriptor 1 (RMD1) bit definitions. */ #define R_OWN 0x80000000 /* Owner bit 0 = host, 1 = lance */ #define R_ERR 0x4000 /* Error Summary */ #define R_FRAM 0x2000 /* Framing Error */ #define R_OFLO 0x1000 /* Overflow Error */ #define R_CRC 0x0800 /* CRC Error */ #define R_BUFF 0x0400 /* Buffer Error */ #define R_STP 0x0200 /* Start of Packet */ #define R_ENP 0x0100 /* End of Packet */ /* ** Transmit Message Descriptor 1 (TMD1) bit definitions. */ #define T_OWN 0x80000000 /* Owner bit 0 = host, 1 = lance */ #define T_ERR 0x4000 /* Error Summary */ #define T_ADD_FCS 0x2000 /* More the 1 retry needed to Xmit */ #define T_MORE 0x1000 /* >1 retry to transmit packet */ #define T_ONE 0x0800 /* 1 try needed to transmit the packet */ #define T_DEF 0x0400 /* Deferred */ #define T_STP 0x02000000 /* Start of Packet */ #define T_ENP 0x01000000 /* End of Packet */ #define T_FLAGS 0xff000000 /* TX Flags Field */ /* ** Transmit Message Descriptor 3 (TMD3) bit definitions. */ #define TMD3_BUFF 0x8000 /* BUFFer error */ #define TMD3_UFLO 0x4000 /* UnderFLOw error */ #define TMD3_RES 0x2000 /* REServed */ #define TMD3_LCOL 0x1000 /* Late COLlision */ #define TMD3_LCAR 0x0800 /* Loss of CARrier */ #define TMD3_RTRY 0x0400 /* ReTRY error */ /* ** EISA configuration Register (CNFG) bit definitions */ #define TIMEOUT 0x0100 /* 0:2.5 mins, 1: 30 secs */ #define REMOTE 0x0080 /* Remote Boot Enable -> 1 */ #define IRQ11 0x0040 /* Enable -> 1 */ #define IRQ10 0x0020 /* Enable -> 1 */ #define IRQ9 0x0010 /* Enable -> 1 */ #define IRQ5 0x0008 /* Enable -> 1 */ #define BUFF 0x0004 /* 0: 64kB or 128kB, 1: 32kB */ #define PADR16 0x0002 /* RAM on 64kB boundary */ #define PADR17 0x0001 /* RAM on 128kB boundary */ /* ** Miscellaneous */ #define HASH_TABLE_LEN 64 /* Bits */ #define HASH_BITS 0x003f /* 6 LS bits */ #define MASK_INTERRUPTS 1 #define UNMASK_INTERRUPTS 0 #define EISA_EN 0x0001 /* Enable EISA bus buffers */ #define EISA_ID iobase+0x0080 /* ID long word for EISA card */ #define EISA_CTRL iobase+0x0084 /* Control word for EISA card */ /* ** Include the IOCTL stuff */ #include <linux/sockios.h> #define DEPCAIOCTL SIOCDEVPRIVATE struct depca_ioctl { unsigned short cmd; /* Command to run */ unsigned short len; /* Length of the data buffer */ unsigned char __user *data; /* Pointer to the data buffer */ }; /* ** Recognised commands for the driver */ #define DEPCA_GET_HWADDR 0x01 /* Get the hardware address */ #define DEPCA_SET_HWADDR 0x02 /* Get the hardware address */ #define DEPCA_SET_PROM 0x03 /* Set Promiscuous Mode */ #define DEPCA_CLR_PROM 0x04 /* Clear Promiscuous Mode */ #define DEPCA_SAY_BOO 0x05 /* Say "Boo!" to the kernel log file */ #define DEPCA_GET_MCA 0x06 /* Get a multicast address */ #define DEPCA_SET_MCA 0x07 /* Set a multicast address */ #define DEPCA_CLR_MCA 0x08 /* Clear a multicast address */ #define DEPCA_MCA_EN 0x09 /* Enable a multicast address group */ #define DEPCA_GET_STATS 0x0a /* Get the driver statistics */ #define DEPCA_CLR_STATS 0x0b /* Zero out the driver statistics */ #define DEPCA_GET_REG 0x0c /* Get the Register contents */ #define DEPCA_SET_REG 0x0d /* Set the Register contents */ #define DEPCA_DUMP 0x0f /* Dump the DEPCA Status */
{ "pile_set_name": "Github" }