text
stringlengths 2
14k
| meta
dict |
|---|---|
/**
******************************************************************************
* @file usbd_msc_core.h
* @author MCD Application Team
* @version V1.0.0
* @date 22-July-2011
* @brief header for the usbd_msc_core.c file
******************************************************************************
* @attention
*
* THE PRESENT FIRMWARE WHICH IS FOR GUIDANCE ONLY AIMS AT PROVIDING CUSTOMERS
* WITH CODING INFORMATION REGARDING THEIR PRODUCTS IN ORDER FOR THEM TO SAVE
* TIME. AS A RESULT, STMICROELECTRONICS SHALL NOT BE HELD LIABLE FOR ANY
* DIRECT, INDIRECT OR CONSEQUENTIAL DAMAGES WITH RESPECT TO ANY CLAIMS ARISING
* FROM THE CONTENT OF SUCH FIRMWARE AND/OR THE USE MADE BY CUSTOMERS OF THE
* CODING INFORMATION CONTAINED HEREIN IN CONNECTION WITH THEIR PRODUCTS.
*
* <h2><center>© COPYRIGHT 2011 STMicroelectronics</center></h2>
******************************************************************************
*/
/* Define to prevent recursive inclusion -------------------------------------*/
#ifndef _USB_MSC_CORE_H_
#define _USB_MSC_CORE_H_
#include "usbd_ioreq.h"
/** @addtogroup USBD_MSC_BOT
* @{
*/
/** @defgroup USBD_MSC
* @brief This file is the Header file for USBD_msc.c
* @{
*/
/** @defgroup USBD_BOT_Exported_Defines
* @{
*/
#define BOT_GET_MAX_LUN 0xFE
#define BOT_RESET 0xFF
#define USB_MSC_CONFIG_DESC_SIZ 32
#define MSC_EPIN_SIZE *(uint16_t *)(((USB_OTG_CORE_HANDLE *)pdev)->dev.pConfig_descriptor + 22)
#define MSC_EPOUT_SIZE *(uint16_t *)(((USB_OTG_CORE_HANDLE *)pdev)->dev.pConfig_descriptor + 29)
/**
* @}
*/
/** @defgroup USB_CORE_Exported_Types
* @{
*/
extern USBD_Class_cb_TypeDef USBD_MSC_cb;
/**
* @}
*/
/**
* @}
*/
#endif // _USB_MSC_CORE_H_
/**
* @}
*/
/******************* (C) COPYRIGHT 2011 STMicroelectronics *****END OF FILE****/
|
{
"pile_set_name": "Github"
}
|
require 'sass/script'
require 'sass/script/css_lexer'
module Sass
module Script
# This is a subclass of {Parser} for use in parsing plain CSS properties.
#
# @see Sass::SCSS::CssParser
class CssParser < Parser
private
# @private
def lexer_class; CssLexer; end
# We need a production that only does /,
# since * and % aren't allowed in plain CSS
production :div, :unary_plus, :div
def string
tok = try_tok(:string)
return number unless tok
unless @lexer.peek && @lexer.peek.type == :begin_interpolation
return literal_node(tok.value, tok.source_range)
end
end
# Short-circuit all the SassScript-only productions
alias_method :interpolation, :space
alias_method :or_expr, :div
alias_method :unary_div, :ident
alias_method :paren, :string
end
end
end
|
{
"pile_set_name": "Github"
}
|
@if "%DEBUG%" == "" @echo off
@rem ##########################################################################
@rem
@rem Gradle startup script for Windows
@rem
@rem ##########################################################################
@rem Set local scope for the variables with windows NT shell
if "%OS%"=="Windows_NT" setlocal
@rem Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script.
set DEFAULT_JVM_OPTS=
set DIRNAME=%~dp0
if "%DIRNAME%" == "" set DIRNAME=.
set APP_BASE_NAME=%~n0
set APP_HOME=%DIRNAME%
@rem Find java.exe
if defined JAVA_HOME goto findJavaFromJavaHome
set JAVA_EXE=java.exe
%JAVA_EXE% -version >NUL 2>&1
if "%ERRORLEVEL%" == "0" goto init
echo.
echo ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH.
echo.
echo Please set the JAVA_HOME variable in your environment to match the
echo location of your Java installation.
goto fail
:findJavaFromJavaHome
set JAVA_HOME=%JAVA_HOME:"=%
set JAVA_EXE=%JAVA_HOME%/bin/java.exe
if exist "%JAVA_EXE%" goto init
echo.
echo ERROR: JAVA_HOME is set to an invalid directory: %JAVA_HOME%
echo.
echo Please set the JAVA_HOME variable in your environment to match the
echo location of your Java installation.
goto fail
:init
@rem Get command-line arguments, handling Windowz variants
if not "%OS%" == "Windows_NT" goto win9xME_args
if "%@eval[2+2]" == "4" goto 4NT_args
:win9xME_args
@rem Slurp the command line arguments.
set CMD_LINE_ARGS=
set _SKIP=2
:win9xME_args_slurp
if "x%~1" == "x" goto execute
set CMD_LINE_ARGS=%*
goto execute
:4NT_args
@rem Get arguments from the 4NT Shell from JP Software
set CMD_LINE_ARGS=%$
:execute
@rem Setup the command line
set CLASSPATH=%APP_HOME%\gradle\wrapper\gradle-wrapper.jar
@rem Execute Gradle
"%JAVA_EXE%" %DEFAULT_JVM_OPTS% %JAVA_OPTS% %GRADLE_OPTS% "-Dorg.gradle.appname=%APP_BASE_NAME%" -classpath "%CLASSPATH%" org.gradle.wrapper.GradleWrapperMain %CMD_LINE_ARGS%
:end
@rem End local scope for the variables with windows NT shell
if "%ERRORLEVEL%"=="0" goto mainEnd
:fail
rem Set variable GRADLE_EXIT_CONSOLE if you need the _script_ return code instead of
rem the _cmd.exe /c_ return code!
if not "" == "%GRADLE_EXIT_CONSOLE%" exit 1
exit /b 1
:mainEnd
if "%OS%"=="Windows_NT" endlocal
:omega
|
{
"pile_set_name": "Github"
}
|
{%- import '_macros.j2' as macros with context -%}
{%- set config_name_default = 'www' -%}
{%- set config_default = {
'listen': '/run/php/php7.1-fpm.sock',
'pm.max_children': 20
} -%}
{%- set config_extra = {
} -%}
{% include manala_php_version|string ~ '/_base.j2' %}
|
{
"pile_set_name": "Github"
}
|
/*
Copyright 2016 The Kubernetes Authors.
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
*/
package workqueue
import (
"container/heap"
"sync"
"time"
"k8s.io/apimachinery/pkg/util/clock"
utilruntime "k8s.io/apimachinery/pkg/util/runtime"
)
// DelayingInterface is an Interface that can Add an item at a later time. This makes it easier to
// requeue items after failures without ending up in a hot-loop.
type DelayingInterface interface {
Interface
// AddAfter adds an item to the workqueue after the indicated duration has passed
AddAfter(item interface{}, duration time.Duration)
}
// NewDelayingQueue constructs a new workqueue with delayed queuing ability
func NewDelayingQueue() DelayingInterface {
return NewDelayingQueueWithCustomClock(clock.RealClock{}, "")
}
// NewNamedDelayingQueue constructs a new named workqueue with delayed queuing ability
func NewNamedDelayingQueue(name string) DelayingInterface {
return NewDelayingQueueWithCustomClock(clock.RealClock{}, name)
}
// NewDelayingQueueWithCustomClock constructs a new named workqueue
// with ability to inject real or fake clock for testing purposes
func NewDelayingQueueWithCustomClock(clock clock.Clock, name string) DelayingInterface {
ret := &delayingType{
Interface: NewNamed(name),
clock: clock,
heartbeat: clock.NewTicker(maxWait),
stopCh: make(chan struct{}),
waitingForAddCh: make(chan *waitFor, 1000),
metrics: newRetryMetrics(name),
}
go ret.waitingLoop()
return ret
}
// delayingType wraps an Interface and provides delayed re-enquing
type delayingType struct {
Interface
// clock tracks time for delayed firing
clock clock.Clock
// stopCh lets us signal a shutdown to the waiting loop
stopCh chan struct{}
// stopOnce guarantees we only signal shutdown a single time
stopOnce sync.Once
// heartbeat ensures we wait no more than maxWait before firing
heartbeat clock.Ticker
// waitingForAddCh is a buffered channel that feeds waitingForAdd
waitingForAddCh chan *waitFor
// metrics counts the number of retries
metrics retryMetrics
}
// waitFor holds the data to add and the time it should be added
type waitFor struct {
data t
readyAt time.Time
// index in the priority queue (heap)
index int
}
// waitForPriorityQueue implements a priority queue for waitFor items.
//
// waitForPriorityQueue implements heap.Interface. The item occurring next in
// time (i.e., the item with the smallest readyAt) is at the root (index 0).
// Peek returns this minimum item at index 0. Pop returns the minimum item after
// it has been removed from the queue and placed at index Len()-1 by
// container/heap. Push adds an item at index Len(), and container/heap
// percolates it into the correct location.
type waitForPriorityQueue []*waitFor
func (pq waitForPriorityQueue) Len() int {
return len(pq)
}
func (pq waitForPriorityQueue) Less(i, j int) bool {
return pq[i].readyAt.Before(pq[j].readyAt)
}
func (pq waitForPriorityQueue) Swap(i, j int) {
pq[i], pq[j] = pq[j], pq[i]
pq[i].index = i
pq[j].index = j
}
// Push adds an item to the queue. Push should not be called directly; instead,
// use `heap.Push`.
func (pq *waitForPriorityQueue) Push(x interface{}) {
n := len(*pq)
item := x.(*waitFor)
item.index = n
*pq = append(*pq, item)
}
// Pop removes an item from the queue. Pop should not be called directly;
// instead, use `heap.Pop`.
func (pq *waitForPriorityQueue) Pop() interface{} {
n := len(*pq)
item := (*pq)[n-1]
item.index = -1
*pq = (*pq)[0:(n - 1)]
return item
}
// Peek returns the item at the beginning of the queue, without removing the
// item or otherwise mutating the queue. It is safe to call directly.
func (pq waitForPriorityQueue) Peek() interface{} {
return pq[0]
}
// ShutDown stops the queue. After the queue drains, the returned shutdown bool
// on Get() will be true. This method may be invoked more than once.
func (q *delayingType) ShutDown() {
q.stopOnce.Do(func() {
q.Interface.ShutDown()
close(q.stopCh)
q.heartbeat.Stop()
})
}
// AddAfter adds the given item to the work queue after the given delay
func (q *delayingType) AddAfter(item interface{}, duration time.Duration) {
// don't add if we're already shutting down
if q.ShuttingDown() {
return
}
q.metrics.retry()
// immediately add things with no delay
if duration <= 0 {
q.Add(item)
return
}
select {
case <-q.stopCh:
// unblock if ShutDown() is called
case q.waitingForAddCh <- &waitFor{data: item, readyAt: q.clock.Now().Add(duration)}:
}
}
// maxWait keeps a max bound on the wait time. It's just insurance against weird things happening.
// Checking the queue every 10 seconds isn't expensive and we know that we'll never end up with an
// expired item sitting for more than 10 seconds.
const maxWait = 10 * time.Second
// waitingLoop runs until the workqueue is shutdown and keeps a check on the list of items to be added.
func (q *delayingType) waitingLoop() {
defer utilruntime.HandleCrash()
// Make a placeholder channel to use when there are no items in our list
never := make(<-chan time.Time)
// Make a timer that expires when the item at the head of the waiting queue is ready
var nextReadyAtTimer clock.Timer
waitingForQueue := &waitForPriorityQueue{}
heap.Init(waitingForQueue)
waitingEntryByData := map[t]*waitFor{}
for {
if q.Interface.ShuttingDown() {
return
}
now := q.clock.Now()
// Add ready entries
for waitingForQueue.Len() > 0 {
entry := waitingForQueue.Peek().(*waitFor)
if entry.readyAt.After(now) {
break
}
entry = heap.Pop(waitingForQueue).(*waitFor)
q.Add(entry.data)
delete(waitingEntryByData, entry.data)
}
// Set up a wait for the first item's readyAt (if one exists)
nextReadyAt := never
if waitingForQueue.Len() > 0 {
if nextReadyAtTimer != nil {
nextReadyAtTimer.Stop()
}
entry := waitingForQueue.Peek().(*waitFor)
nextReadyAtTimer = q.clock.NewTimer(entry.readyAt.Sub(now))
nextReadyAt = nextReadyAtTimer.C()
}
select {
case <-q.stopCh:
return
case <-q.heartbeat.C():
// continue the loop, which will add ready items
case <-nextReadyAt:
// continue the loop, which will add ready items
case waitEntry := <-q.waitingForAddCh:
if waitEntry.readyAt.After(q.clock.Now()) {
insert(waitingForQueue, waitingEntryByData, waitEntry)
|
{
"pile_set_name": "Github"
}
|
// Copyright 2012 Citrix Systems, Inc. Licensed under the
// Apache License, Version 2.0 (the "License"); you may not use this
// file except in compliance with the License. Citrix Systems, Inc.
// reserves all rights not expressly granted by 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.
//
// Automatically generated by addcopyright.py at 04/03/2012
package com.cloud.test.stress;
import java.util.Arrays;
import java.util.Iterator;
import java.util.List;
import org.apache.log4j.Logger;
import com.trilead.ssh2.Connection;
import com.trilead.ssh2.Session;
public class SshTest {
public static final Logger s_logger = Logger.getLogger(SshTest.class.getName());
public static String host = "";
public static String password = "password";
public static String url = "http://google.com";
public static void main (String[] args) {
// Parameters
List<String> argsList = Arrays.asList(args);
Iterator<String> iter = argsList.iterator();
while (iter.hasNext()) {
String arg = iter.next();
if (arg.equals("-h")) {
host = iter.next();
}
if (arg.equals("-p")) {
password = iter.next();
}
if (arg.equals("-u")) {
url = iter.next();
}
}
if (host == null || host.equals("")) {
s_logger.info("Did not receive a host back from test, ignoring ssh test");
System.exit(2);
}
if (password == null){
s_logger.info("Did not receive a password back from test, ignoring ssh test");
System.exit(2);
}
try {
s_logger.info("Attempting to SSH into host " + host);
Connection conn = new Connection(host);
conn.connect(null, 60000, 60000);
s_logger.info("User + ssHed successfully into host " + host);
boolean isAuthenticated = conn.authenticateWithPassword("root", password);
if (isAuthenticated == false) {
s_logger.info("Authentication failed for root with password" + password);
System.exit(2);
}
String linuxCommand = "wget " + url;
Session sess = conn.openSession();
sess.execCommand(linuxCommand);
sess.close();
conn.close();
} catch (Exception e) {
s_logger.error("SSH test fail with error", e);
System.exit(2);
}
}
}
|
{
"pile_set_name": "Github"
}
|
{
"acno": "D40572",
"acquisitionYear": 1856,
"additionalImages": [
{
"copyright": null,
"creativeCommons": null,
"filenameBase": "D40572",
"sizes": [
{
"caption": "Enhanced image",
"cleared": true,
"file": "enhanced_images/D405/D40572_E.jpg",
"height": 337,
"resolution": 512,
"size": "large",
"width": 512
}
]
}
],
"all_artists": "Joseph Mallord William Turner",
"catTextResId": 1129878,
"catalogueGroup": {
"accessionRanges": "D05491-D05617; D40568-D40574; D41505",
"completeStatus": "COMPLETE",
"finbergNumber": "XC",
"groupType": "Turner Sketchbook",
"id": 65737,
"shortTitle": "Studies for Pictures: Isleworth Sketchbook"
},
"classification": "on paper, unique",
"contributorCount": 1,
"contributors": [
{
"birthYear": 1775,
"date": "1775\u20131851",
"displayOrder": 1,
"fc": "Joseph Mallord William Turner",
"gender": "Male",
"id": 558,
"mda": "Turner, Joseph Mallord William",
"role": "artist",
"startLetter": "T"
}
],
"creditLine": "Accepted by the nation as part of the Turner Bequest 1856",
"dateRange": {
"endYear": 1805,
"startYear": 1805,
"text": "1805"
},
"dateText": "1805",
"depth": "",
"dimensions": "support: 150 x 258 mm",
"finberg": null,
"foreignTitle": null,
"groupTitle": "Studies for Pictures: Isleworth Sketchbook",
"height": "258",
"id": 64321,
"inscription": null,
"medium": "Pen and ink on paper",
"movementCount": 0,
"pageNumber": 98,
"subjectCount": 1,
"subjects": {
"children": [
{
"children": [
{
"children": [
{
"id": 1827,
"name": "tree"
}
],
"id": 1809,
"name": "trees"
}
],
"id": 60,
"name": "nature"
}
],
"id": 1,
"name": "subject"
},
"thumbnailCopyright": null,
"thumbnailUrl": "http://www.tate.org.uk/art/images/work/D/D40/D40572_8.jpg",
"title": "A View on the Thames",
"units": "mm",
"url": "http://www.tate.org.uk/art/artworks/turner-a-view-on-the-thames-d40572",
"width": "150"
}
|
{
"pile_set_name": "Github"
}
|
//
// Created by Dusan Klinec on 28.12.17.
//
#include <gtest/gtest.h>
#include "../WBAES.h"
#include "../WBAESGenerator.h"
#include "../EncTools.h"
#include "Commons.h"
using namespace std;
TEST(WBAES, GenerateKey)
{
initDefaultModulus();
shared_ptr<WBAES> wbaes(new WBAES());
WBAESGenerator generator;
ExtEncoding coding;
generator.generateExtEncoding(&coding, 0);
generator.generateTables(const_cast<BYTE *>(test_key), KEY_SIZE_16, wbaes.get(), &coding, true);
generator.generateTables(const_cast<BYTE *>(test_key), KEY_SIZE_16, wbaes.get(), &coding, false);
W128b plain{}, cipher{}, state{};
arr_to_W128b(const_cast<BYTE *>(test_plaintext), 0, plain);
arr_to_W128b(const_cast<BYTE *>(test_plaintext), 0, state);
arr_to_W128b(const_cast<BYTE *>(test_ciphertext), 0, cipher);
generator.applyExternalEnc(state, &coding, true);
wbaes->encrypt(state);
generator.applyExternalEnc(state, &coding, false);
EXPECT_TRUE(compare_W128b(state, cipher));
generator.applyExternalEnc(state, &coding, true);
wbaes->decrypt(state);
generator.applyExternalEnc(state, &coding, false);
EXPECT_TRUE(compare_W128b(state, plain));
std::stringstream inout;
generator.save(inout, wbaes.get(), &coding);
}
TEST(WBAES, EncDec)
{
initDefaultModulus();
std::stringstream inout;
// Generating part
// Different scope to prevent unwanted access after generation.
{
shared_ptr<WBAES> wbaes(new WBAES());
WBAESGenerator generator;
ExtEncoding coding;
generator.generateExtEncoding(&coding, 0);
generator.generateTables(const_cast<BYTE *>(test_key), KEY_SIZE_16, wbaes.get(), &coding, true);
generator.generateTables(const_cast<BYTE *>(test_key), KEY_SIZE_16, wbaes.get(), &coding, false);
generator.save(inout, wbaes.get(), &coding);
}
// Load phase
shared_ptr<WBAES> wbaes2(new WBAES());
WBAESGenerator generator2;
ExtEncoding coding2;
generator2.load(inout, wbaes2.get(), &coding2);
W128b plain{}, cipher{}, state{};
arr_to_W128b(const_cast<BYTE *>(test_plaintext), 0, plain);
arr_to_W128b(const_cast<BYTE *>(test_plaintext), 0, state);
arr_to_W128b(const_cast<BYTE *>(test_ciphertext), 0, cipher);
generator2.applyExternalEnc(state, &coding2, true);
wbaes2->encrypt(state);
generator2.applyExternalEnc(state, &coding2, false);
EXPECT_TRUE(compare_W128b(state, cipher));
generator2.applyExternalEnc(state, &coding2, true);
wbaes2->decrypt(state);
generator2.applyExternalEnc(state, &coding2, false);
EXPECT_TRUE(compare_W128b(state, plain));
}
TEST(WBAES, TestVectors)
{
initDefaultModulus();
WBAESGenerator generator;
shared_ptr<WBAES> wbaes(new WBAES());
// Test WB AES with test vectors.
// This test also demonstrates usage of external encodings by wrapping AES
int errors = generator.testWithVectors(false, wbaes.get());
EXPECT_EQ(errors, 0);
// Test WB AES with test vectors - no external encoding.
errors = generator.testWithVectors(false, wbaes.get(), WBAESGEN_EXTGEN_ID);
EXPECT_EQ(errors, 0);
}
|
{
"pile_set_name": "Github"
}
|
The direct utility estimation method in
Section <a class="sectionRef" title="" href="#">passive-rl-section</a> uses distinguished terminal
states to indicate the end of a trial. How could it be modified for
environments with discounted rewards and no terminal states?
|
{
"pile_set_name": "Github"
}
|
fileFormatVersion: 2
guid: 012c135e7de4d094baea093d738625b2
folderAsset: yes
DefaultImporter:
userData:
assetBundleName:
|
{
"pile_set_name": "Github"
}
|
/**
* Buttons
* --------------------------------------------------
*/
.button {
// set the color defaults
@include button-style($button-default-bg, $button-default-border, $button-default-active-bg, $button-default-active-border, $button-default-text);
position: relative;
display: inline-block;
margin: 0;
padding: 0 $button-padding;
min-width: ($button-padding * 3) + $button-font-size;
min-height: $button-height + 5px;
border-width: $button-border-width;
border-style: solid;
border-radius: $button-border-radius;
vertical-align: top;
text-align: center;
text-overflow: ellipsis;
font-size: $button-font-size;
line-height: $button-height - $button-border-width + 1px;
cursor: pointer;
&:after {
// used to create a larger button "hit" area
position: absolute;
top: -6px;
right: -6px;
bottom: -6px;
left: -6px;
content: ' ';
}
.icon {
vertical-align: top;
pointer-events: none;
}
.icon:before,
&.icon:before,
&.icon-left:before,
&.icon-right:before {
display: inline-block;
padding: 0 0 $button-border-width 0;
vertical-align: inherit;
font-size: $button-icon-size;
line-height: $button-height - $button-border-width;
pointer-events: none;
}
&.icon-left:before {
float: left;
padding-right: .2em;
padding-left: 0;
}
&.icon-right:before {
float: right;
padding-right: 0;
padding-left: .2em;
}
&.button-block, &.button-full {
margin-top: $button-block-margin;
margin-bottom: $button-block-margin;
}
&.button-light {
@include button-style($button-light-bg, $button-default-border, $button-light-active-bg, $button-default-active-border, $button-light-text);
@include button-clear($button-light-border);
@include button-outline($button-light-border);
}
&.button-stable {
@include button-style($button-stable-bg, $button-default-border, $button-stable-active-bg, $button-default-active-border, $button-stable-text);
@include button-clear($button-stable-border);
@include button-outline($button-stable-border);
}
&.button-positive {
@include button-style($button-positive-bg, $button-default-border, $button-positive-active-bg, $button-default-active-border, $button-positive-text);
@include button-clear($button-positive-bg);
@include button-outline($button-positive-bg);
}
&.button-calm {
@include button-style($button-calm-bg, $button-default-border, $button-calm-active-bg, $button-default-active-border, $button-calm-text);
@include button-clear($button-calm-bg);
@include button-outline($button-calm-bg);
}
&.button-assertive {
@include button-style($button-assertive-bg, $button-default-border, $button-assertive-active-bg, $button-default-active-border, $button-assertive-text);
@include button-clear($button-assertive-bg);
@include button-outline($button-assertive-bg);
}
&.button-balanced {
@include button-style($button-balanced-bg, $button-default-border, $button-balanced-active-bg, $button-default-active-border, $button-balanced-text);
@include button-clear($button-balanced-bg);
@include button-outline($button-balanced-bg);
}
&.button-energized {
@include button-style($button-energized-bg, $button-default-border, $button-energized-active-bg, $button-default-active-border, $button-energized-text);
@include button-clear($button-energized-bg);
@include button-outline($button-energized-bg);
}
&.button-royal {
@include button-style($button-royal-bg, $button-default-border, $button-royal-active-bg, $button-default-active-border, $button-royal-text);
@include button-clear($button-royal-bg);
@include button-outline($button-royal-bg);
}
&.button-dark {
@include button-style($button-dark-bg, $button-default-border, $button-dark-active-bg, $button-default-active-border, $button-dark-text);
@include button-clear($button-dark-bg);
@include button-outline($button-dark-bg);
}
}
.button-small {
padding: 2px $button-small-padding 1px;
min-width: $button-small-height;
min-height: $button-small-height + 2;
font-size: $button-small-font-size;
line-height: $button-small-height - $button-border-width - 1;
.icon:before,
&.icon:before,
&.icon-left:before,
&.icon-right:before {
font-size: $button-small-icon-size;
line-height: $button-small-icon-size + 3;
margin-top: 3px;
}
}
.button-large {
padding: 0 $button-large-padding;
min-width: ($button-large-padding * 3) + $button-large-font-size;
min-height: $button-large-height + 5;
font-size: $button-large-font-size;
line-height: $button-large-height - $button-border-width;
.icon:before,
&.icon:before,
&.icon-left:before,
&.icon-right:before {
padding-bottom: ($button-border-width * 2);
font-size: $button-large-icon-size;
line-height: $button-large-height - ($button-border-width * 2) - 1;
}
}
.button-icon {
@include transition(opacity .1s);
padding: 0 6px;
min-width: initial;
border-color: transparent;
background: none;
&.button.active,
&.button.activated {
border-color: transparent;
background: none;
box-shadow: none;
opacity: 0.3;
}
.icon:before,
&.icon:before {
font-size: $button-large-icon-size;
}
}
.button-clear {
@include button-clear($button-default-border);
@include transition(opacity .1s);
padding: 0 $button-clear-padding;
max-height: $button-height;
border-color: transparent;
background: none;
box-shadow: none;
&.active,
&.activated {
opacity: 0.3;
}
}
.button-outline {
@include button-outline($button-default-border);
@include transition(opacity .1s);
background: none;
box-shadow: none;
}
.padding > .button.button-block:first-child {
margin-top: 0;
}
.button-block {
display: block;
clear: both;
&:after {
|
{
"pile_set_name": "Github"
}
|
'use strict';
module.exports = function(Chart) {
var helpers = Chart.helpers;
Chart.scaleService = {
// Scale registration object. Extensions can register new scale types (such as log or DB scales) and then
// use the new chart options to grab the correct scale
constructors: {},
// Use a registration function so that we can move to an ES6 map when we no longer need to support
// old browsers
// Scale config defaults
defaults: {},
registerScaleType: function(type, scaleConstructor, defaults) {
this.constructors[type] = scaleConstructor;
this.defaults[type] = helpers.clone(defaults);
},
getScaleConstructor: function(type) {
return this.constructors.hasOwnProperty(type) ? this.constructors[type] : undefined;
},
getScaleDefaults: function(type) {
// Return the scale defaults merged with the global settings so that we always use the latest ones
return this.defaults.hasOwnProperty(type) ? helpers.scaleMerge(Chart.defaults.scale, this.defaults[type]) : {};
},
updateScaleDefaults: function(type, additions) {
var defaults = this.defaults;
if (defaults.hasOwnProperty(type)) {
defaults[type] = helpers.extend(defaults[type], additions);
}
},
addScalesToLayout: function(chart) {
// Adds each scale to the chart.boxes array to be sized accordingly
helpers.each(chart.scales, function(scale) {
// Set ILayoutItem parameters for backwards compatibility
scale.fullWidth = scale.options.fullWidth;
scale.position = scale.options.position;
scale.weight = scale.options.weight;
Chart.layoutService.addBox(chart, scale);
});
}
};
};
|
{
"pile_set_name": "Github"
}
|
describe Wordmove::Doctor::Mysql do
let(:movefile_name) { 'multi_environments' }
let(:movefile_dir) { "spec/fixtures/movefiles" }
let(:doctor) { described_class.new(movefile_name, movefile_dir) }
context ".new" do
it "implements #check! method" do
expect_any_instance_of(described_class).to receive(:check!)
silence_stream(STDOUT) { doctor.check! }
end
it "calls mysql client check" do
expect(doctor).to receive(:mysql_client_doctor)
silence_stream(STDOUT) { doctor.check! }
end
it "calls mysqldump check" do
expect(doctor).to receive(:mysqldump_doctor)
silence_stream(STDOUT) { doctor.check! }
end
it "calls mysql server check" do
expect(doctor).to receive(:mysql_server_doctor)
silence_stream(STDOUT) { doctor.check! }
end
it "calls mysql database check" do
# expect(doctor).to receive(:mysql_database_doctor)
silence_stream(STDOUT) { doctor.check! }
end
end
end
|
{
"pile_set_name": "Github"
}
|
b9be2701e164b0f70a8abd4916bf98b34f4f7233
|
{
"pile_set_name": "Github"
}
|
package mirror.android.os;
import android.os.Parcel;
import mirror.RefClass;
import mirror.RefObject;
public class BundleICS {
public static Class<?> TYPE = RefClass.load(BundleICS.class, "android.os.Bundle");
public static RefObject<Parcel> mParcelledData;
}
|
{
"pile_set_name": "Github"
}
|
/*
* Copyright 2011 David Jurgens
*
* This file is part of the S-Space package and is covered under the terms and
* conditions therein.
*
* The S-Space package is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License version 2 as published
* by the Free Software Foundation and distributed hereunder to you.
*
* THIS SOFTWARE IS PROVIDED "AS IS" AND NO REPRESENTATIONS OR WARRANTIES,
* EXPRESS OR IMPLIED ARE MADE. BY WAY OF EXAMPLE, BUT NOT LIMITATION, WE MAKE
* NO REPRESENTATIONS OR WARRANTIES OF MERCHANT- ABILITY OR FITNESS FOR ANY
* PARTICULAR PURPOSE OR THAT THE USE OF THE LICENSED SOFTWARE OR DOCUMENTATION
* WILL NOT INFRINGE ANY THIRD PARTY PATENTS, COPYRIGHTS, TRADEMARKS OR OTHER
* RIGHTS.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
package edu.ucla.sspace.graph;
import java.util.*;
import edu.ucla.sspace.util.OpenIntSet;
import org.junit.Ignore;
import org.junit.Test;
import static org.junit.Assert.*;
/**
*
*/
public class DirectedMultigraphTests {
@Test public void testConstructor() {
Set<Integer> vertices = new HashSet<Integer>();
DirectedMultigraph<String> g = new DirectedMultigraph<String>();
assertEquals(0, g.order());
assertEquals(0, g.size());
}
@Test(expected=NullPointerException.class) public void testConstructor2NullArg() {
Graph<Edge> g = new SparseUndirectedGraph((Graph<DirectedTypedEdge<String>>)null);
}
@Test public void testAdd() {
DirectedMultigraph<String> g = new DirectedMultigraph<String>();
assertTrue(g.add(0));
assertEquals(1, g.order());
assertTrue(g.contains(0));
// second add should have no effect
assertFalse(g.add(0));
assertEquals(1, g.order());
assertTrue(g.contains(0));
assertTrue(g.add(1));
assertEquals(2, g.order());
assertTrue(g.contains(1));
}
@Test public void testEquals() {
DirectedMultigraph<String> g1 = new DirectedMultigraph<String>();
DirectedMultigraph<String> g2 = new DirectedMultigraph<String>();
for (int i = 0; i < 10; ++i) {
for (int j = i + 1; j < 10; ++j) {
g1.add(new SimpleDirectedTypedEdge<String>("type-1",i, j));
g2.add(new SimpleDirectedTypedEdge<String>("type-1",i, j));
}
}
assertEquals(g1, g2);
g1 = new DirectedMultigraph<String>();
g2 = new DirectedMultigraph<String>();
for (int i = 0; i < 10; ++i) {
for (int j = i + 1; j < 10; ++j) {
g1.add(new SimpleDirectedTypedEdge<String>("type-1",i, j));
g2.add(new SimpleDirectedTypedEdge<String>("type-1",j, i));
}
}
assertFalse(g1.equals(g2));
assertFalse(g2.equals(g1));
}
@Test public void testEqualGeneric() {
DirectedMultigraph<String> g1 = new DirectedMultigraph<String>();
Graph<DirectedTypedEdge<String>> g2 = new GenericGraph<DirectedTypedEdge<String>>();
for (int i = 0; i < 10; ++i) {
for (int j = i + 1; j < 10; ++j) {
g1.add(new SimpleDirectedTypedEdge<String>("type-1",i, j));
g2.add(new SimpleDirectedTypedEdge<String>("type-1",i, j));
}
}
assertEquals(g1, g2);
}
@Test public void testContainsEdge() {
DirectedMultigraph<String> g = new DirectedMultigraph<String>();
for (int i = 0; i < 100; ++i)
for (int j = i + 1; j < 100; ++j)
g.add(new SimpleDirectedTypedEdge<String>("type-1",i, j));
for (int i = 0; i < 100; ++i) {
for (int j = i + 1; j < 100; ++j) {
g.contains(new SimpleDirectedTypedEdge<String>("type-1",i, j));
g.contains(new SimpleDirectedTypedEdge<String>("type-1",j, i));
g.contains(i, j);
g.contains(j, i);
}
}
}
@Test public void testAddEdge() {
DirectedMultigraph<String> g = new DirectedMultigraph<String>();
assertTrue(g.add(new SimpleDirectedTypedEdge<String>("type-1",0, 1)));
assertEquals(2, g.order());
assertEquals(1, g.size());
assertTrue(g.contains(new SimpleDirectedTypedEdge<String>("type-1",0, 1)));
g.add(new SimpleDirectedTypedEdge<String>("type-1",0, 2));
assertEquals(3, g.order());
assertEquals(2, g.size());
assertTrue(g.contains(new SimpleDirectedTypedEdge<String>("type-1",0, 2)));
g.add(new SimpleDirectedTypedEdge<String>("type-1",3, 4));
assertEquals(5, g.order());
assertEquals(3, g.size());
assertTrue(g.contains(new SimpleDirectedTypedEdge<String>("type-1",3, 4)));
}
@Test public void testRemoveLesserVertexWithEdges() {
DirectedMultigraph<String> g = new DirectedMultigraph<String>();
for (int i = 1; i < 100; ++i) {
DirectedTypedEdge<String> e = new SimpleDirectedTypedEdge<String>("type-1",0, i);
g.add(e);
}
assertTrue(g.contains(0));
assertTrue(g.remove(0));
assertEquals(99, g.order());
assertEquals(0, g.size());
}
@Test public void testRemoveHigherVertexWithEdges() {
DirectedMultigraph<String> g = new DirectedMultigraph<String>();
for (int i = 0; i < 99; ++i) {
DirectedTypedEdge<String> e = new SimpleDirectedTypedEdge<String>("type-1",100, i);
g.add(e);
}
assertTrue(g.contains(100));
assertTrue(g.remove(100));
assertEquals(99, g.order());
assertEquals(0, g.size());
}
@Test public void testRemoveVertex() {
DirectedMultigraph<String> g = new DirectedMultigraph<String>();
for (int i = 0; i < 100; ++i) {
g.add(i);
}
for (int i = 99; i >= 0; --i) {
assertTrue(g.remove(i));
assertEquals(i, g.order());
assertFalse(g.contains(i));
assertFalse(g.remove(i));
}
}
@Test public void testRemoveEdge() {
DirectedMultigraph<String> g = new DirectedMultigraph<String>();
for (int i = 1; i < 100; ++i) {
DirectedTypedEdge<String> e = new SimpleDirectedTypedEdge<String>("type-1",0, i);
g.add(e);
}
for (int i = 99; i > 0; --i) {
DirectedTypedEdge<String> e = new SimpleDirectedTypedEdge<String>("type-1",
|
{
"pile_set_name": "Github"
}
|
package org.matomo.sdk.dispatcher;
import androidx.annotation.Nullable;
public enum DispatchMode {
/**
* Dispatch always (default)
*/
ALWAYS("always"),
/**
* Dispatch only on WIFI
*/
WIFI_ONLY("wifi_only"),
/**
* The dispatcher will assume being offline. This is not persisted and will revert on app restart.
* Ensures no information is lost when tracking exceptions. See #247
*/
EXCEPTION("exception");
private final String key;
DispatchMode(String key) {this.key = key;}
@Override
public String toString() {
return key;
}
@Nullable
public static DispatchMode fromString(String raw) {
for (DispatchMode mode : DispatchMode.values()) {
if (mode.key.equals(raw)) return mode;
}
return null;
}
}
|
{
"pile_set_name": "Github"
}
|
Certificate:
Data:
Version: 3 (0x2)
Serial Number: 4 (0x4)
Signature Algorithm: ecdsa-with-SHA256
Issuer: CN=prime256v1 ecdsa Test intermediate CA
Validity
Not Before: Apr 22 20:28:41 2016 GMT
Not After : Apr 20 20:28:41 2026 GMT
Subject: C=US, ST=California, L=Mountain View, O=Test CA, CN=127.0.0.1
Subject Public Key Info:
Public Key Algorithm: id-ecPublicKey
Public-Key: (256 bit)
pub:
04:f5:4f:70:de:c3:d2:11:bb:c8:08:6e:4c:63:d8:
13:80:10:b0:b8:e9:df:9c:fa:d0:f4:e3:61:5e:1e:
1f:fe:65:8e:4b:a9:3f:d4:47:9f:71:e9:89:82:82:
d8:10:63:fa:af:37:5b:3b:d1:da:56:05:da:a2:20:
e1:20:37:c3:c0
ASN1 OID: prime256v1
X509v3 extensions:
X509v3 Basic Constraints: critical
CA:FALSE
X509v3 Subject Key Identifier:
7E:DD:18:69:14:9C:D6:E5:9C:DD:47:DB:87:60:79:AD:01:07:9A:66
X509v3 Authority Key Identifier:
keyid:0D:6B:B6:D7:DD:7F:CD:4E:AD:06:6B:22:E1:11:08:58:10:AB:16:2A
X509v3 Extended Key Usage:
TLS Web Server Authentication, TLS Web Client Authentication
X509v3 Subject Alternative Name:
IP Address:127.0.0.1
Signature Algorithm: ecdsa-with-SHA256
30:45:02:20:25:fd:ba:76:81:1b:d3:25:17:82:31:ad:73:72:
50:94:ac:e3:69:a6:b1:58:fe:b7:5e:48:ed:23:0d:a2:05:40:
02:21:00:d5:0e:02:63:c9:1c:7a:5a:10:13:1e:b8:05:87:71:
9c:b5:e2:66:cb:27:c8:17:b3:b1:68:29:c4:5e:b9:ac:5f
-----BEGIN CERTIFICATE-----
MIICADCCAaagAwIBAgIBBDAKBggqhkjOPQQDAjAwMS4wLAYDVQQDDCVwcmltZTI1
NnYxIGVjZHNhIFRlc3QgaW50ZXJtZWRpYXRlIENBMB4XDTE2MDQyMjIwMjg0MVoX
DTI2MDQyMDIwMjg0MVowYDELMAkGA1UEBhMCVVMxEzARBgNVBAgMCkNhbGlmb3Ju
aWExFjAUBgNVBAcMDU1vdW50YWluIFZpZXcxEDAOBgNVBAoMB1Rlc3QgQ0ExEjAQ
BgNVBAMMCTEyNy4wLjAuMTBZMBMGByqGSM49AgEGCCqGSM49AwEHA0IABPVPcN7D
0hG7yAhuTGPYE4AQsLjp35z60PTjYV4eH/5ljkupP9RHn3HpiYKC2BBj+q83WzvR
2lYF2qIg4SA3w8CjgYAwfjAMBgNVHRMBAf8EAjAAMB0GA1UdDgQWBBR+3RhpFJzW
5ZzdR9uHYHmtAQeaZjAfBgNVHSMEGDAWgBQNa7bX3X/NTq0GayLhEQhYEKsWKjAd
BgNVHSUEFjAUBggrBgEFBQcDAQYIKwYBBQUHAwIwDwYDVR0RBAgwBocEfwAAATAK
BggqhkjOPQQDAgNIADBFAiAl/bp2gRvTJReCMa1zclCUrONpprFY/rdeSO0jDaIF
QAIhANUOAmPJHHpaEBMeuAWHcZy14mbLJ8gXs7FoKcReuaxf
-----END CERTIFICATE-----
|
{
"pile_set_name": "Github"
}
|
{
"name": "volumetric_lighting_scattering.comp",
"properties": {
"name": "volumetric_lighting_scattering.comp",
"gpuProgramName": "volumetric_lighting_scattering.comp.glsl",
"entryPoint": "main",
"preprocessorDefines": "",
"gpuProgramType": 3
}
}
|
{
"pile_set_name": "Github"
}
|
#!/usr/bin/env python
r'''
Fix several issues in the Latex file.
Latex should be given as input. The following changes are made, and the
result is thrown in the standard output:
1. It removes \url{X} and converts it to X for all X that contain a
dollar sign. Assumes \url{} doesn't cross line boundaries, which
appears to be true. If this is not done, some strange code appears
inside the URLs (and it's also made a link, which doesn't make
sense).
2. It formats notes, hints and tips the same as warnings. This is
because warnings show in a box, which is nice, but the other
admonitions only show with a top and bottom line, which can look
confusing depending on where in the page it's shown.
'''
import re
import sys
regexp = re.compile(r'''\\url\{
(
[^}]* # Anything (but end of url),
\$ # then a dollar sign,
[^}]* # then anything (but end of url)
)
\} # then end of url
''', flags=re.VERBOSE)
def fix_urls(line):
return re.sub(regexp, r'\1', line)
def fix_admonitions(line):
line = line.replace(r'\begin{notice}{tip}',
r'\begin{notice}{warning}')
line = line.replace(r'\begin{notice}{note}',
r'\begin{notice}{warning}')
line = line.replace(r'\begin{notice}{hint}',
r'\begin{notice}{warning}')
return line
for line in sys.stdin:
line = fix_urls(line)
line = fix_admonitions(line)
sys.stdout.write(line)
|
{
"pile_set_name": "Github"
}
|
* Broadcom BCM283x GPIO controller
Required properties:
- compatible: must be "brcm,bcm2835-gpio"
- reg: exactly one register range with length 0xb4
|
{
"pile_set_name": "Github"
}
|
<?php
/**
* PHPExcel
*
* Copyright (C) 2006 - 2014 PHPExcel
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public
* License as published by the Free Software Foundation; either
* version 2.1 of the License, or (at your option) any later version.
*
* This library is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public
* License along with this library; if not, write to the Free Software
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
*
* @category PHPExcel
* @package PHPExcel
* @copyright Copyright (c) 2006 - 2014 PHPExcel (http://www.codeplex.com/PHPExcel)
* @license http://www.gnu.org/licenses/old-licenses/lgpl-2.1.txt LGPL
* @version ##VERSION##, ##DATE##
*/
/** Error reporting */
error_reporting(E_ALL);
ini_set('display_errors', TRUE);
ini_set('display_startup_errors', TRUE);
define('EOL',(PHP_SAPI == 'cli') ? PHP_EOL : '<br />');
date_default_timezone_set('Europe/London');
/** Include PHPExcel */
require_once dirname(__FILE__) . '/../Classes/PHPExcel.php';
// Create new PHPExcel object
echo date('H:i:s') , " Create new PHPExcel object" , EOL;
$objPHPExcel = new PHPExcel();
// Set document properties
echo date('H:i:s') , " Set document properties" , EOL;
$objPHPExcel->getProperties()->setCreator("Maarten Balliauw")
->setLastModifiedBy("Maarten Balliauw")
->setTitle("Office 2007 XLSX Test Document")
->setSubject("Office 2007 XLSX Test Document")
->setDescription("Test document for Office 2007 XLSX, generated using PHP classes.")
->setKeywords("office 2007 openxml php")
->setCategory("Test result file");
// Add some data
echo date('H:i:s') , " Add some data" , EOL;
$objPHPExcel->setActiveSheetIndex(0);
$objPHPExcel->getActiveSheet()->setCellValue('A1', 'Hello');
$objPHPExcel->getActiveSheet()->setCellValue('B2', 'world!');
$objPHPExcel->getActiveSheet()->setCellValue('C1', 'Hello');
$objPHPExcel->getActiveSheet()->setCellValue('D2', 'world!');
// Rename worksheet
echo date('H:i:s') , " Rename worksheet" , EOL;
$objPHPExcel->getActiveSheet()->setTitle('Simple');
// Set document security
echo date('H:i:s') , " Set document security" , EOL;
$objPHPExcel->getSecurity()->setLockWindows(true);
$objPHPExcel->getSecurity()->setLockStructure(true);
$objPHPExcel->getSecurity()->setWorkbookPassword("PHPExcel");
// Set sheet security
echo date('H:i:s') , " Set sheet security" , EOL;
$objPHPExcel->getActiveSheet()->getProtection()->setPassword('PHPExcel');
$objPHPExcel->getActiveSheet()->getProtection()->setSheet(true); // This should be enabled in order to enable any of the following!
$objPHPExcel->getActiveSheet()->getProtection()->setSort(true);
$objPHPExcel->getActiveSheet()->getProtection()->setInsertRows(true);
$objPHPExcel->getActiveSheet()->getProtection()->setFormatCells(true);
// Set active sheet index to the first sheet, so Excel opens this as the first sheet
$objPHPExcel->setActiveSheetIndex(0);
// Save Excel 95 file
echo date('H:i:s') , " Write to Excel5 format" , EOL;
$callStartTime = microtime(true);
$objWriter = PHPExcel_IOFactory::createWriter($objPHPExcel, 'Excel5');
$objWriter->save(str_replace('.php', '.xls', __FILE__));
$callEndTime = microtime(true);
$callTime = $callEndTime - $callStartTime;
echo date('H:i:s') , " File written to " , str_replace('.php', '.xls', pathinfo(__FILE__, PATHINFO_BASENAME)) , EOL;
echo 'Call time to write Workbook was ' , sprintf('%.4f',$callTime) , " seconds" , EOL;
// Echo memory usage
echo date('H:i:s') , ' Current memory usage: ' , (memory_get_usage(true) / 1024 / 1024) , " MB" , EOL;
// Echo memory peak usage
echo date('H:i:s') , " Peak memory usage: " , (memory_get_peak_usage(true) / 1024 / 1024) , " MB" , EOL;
// Echo done
echo date('H:i:s') , " Done writing file" , EOL;
echo 'File has been created in ' , getcwd() , EOL;
|
{
"pile_set_name": "Github"
}
|
/*
* Copyright (c) 2014, 2018, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
* under the terms of the GNU General Public License version 2 only, as
* published by the Free Software Foundation. Oracle designates this
* particular file as subject to the "Classpath" exception as provided
* by Oracle in the LICENSE file that accompanied this code.
*
* This code is distributed in the hope that it will be useful, but WITHOUT
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
* version 2 for more details (a copy is included in the LICENSE file that
* accompanied this code).
*
* You should have received a copy of the GNU General Public License version
* 2 along with this work; if not, write to the Free Software Foundation,
* Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
*
* Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
* or visit www.oracle.com if you need additional information or have any
* questions.
*/
/**
* Defines the <em>{@index rmic rmic}</em> compiler for generating stubs and
* skeletons using the Java Remote Method Protocol (JRMP) for remote objects.
*
* <dl style="font-family:'DejaVu Sans', Arial, Helvetica, sans serif">
* <dt class="simpleTagLabel">Tool Guides:
* <dd>{@extLink rmic_tool_reference rmic}
* </dl>
*
* @moduleGraph
* @since 9
*/
module jdk.rmic {
requires jdk.compiler;
requires jdk.javadoc;
}
|
{
"pile_set_name": "Github"
}
|
# bedup - Btrfs deduplication
# Copyright (C) 2012 Gabriel de Perthuis <g2p.code+bedup@gmail.com>
#
# This file is part of bedup.
#
# bedup 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.
#
# bedup is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with bedup. If not, see <http://www.gnu.org/licenses/>.
# This file is a workaround for Python2.6
# Also has workarounds for -mtrace
import sys
try:
# For -mtrace
sys.path.remove('bedup')
except ValueError:
pass
# -mtrace can't use relative imports either
from bedup.__main__ import script_main
if __name__ == '__main__':
script_main()
|
{
"pile_set_name": "Github"
}
|
/*
* This library is part of OpenCms -
* the Open Source Content Management System
*
* Copyright (C) Alkacon Software (http://www.alkacon.com)
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public
* License as published by the Free Software Foundation; either
* version 2.1 of the License, or (at your option) any later version.
*
* This library is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* Lesser General Public License for more details.
*
* For further information about Alkacon Software, please see the
* company website: http://www.alkacon.com
*
* For further information about OpenCms, please see the
* project website: http://www.opencms.org
*
* You should have received a copy of the GNU Lesser General Public
* License along with this library; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*/
package org.opencms.cmis;
import java.math.BigInteger;
import java.util.Iterator;
import java.util.List;
/**
* Helper class to ease implementation of CMIS service methods which support paging.<p>
*
* This class works as an iterator for a given list, and limits the number of iterations based on skip/max parameters
* which are usually passed to the service methods.<p>
*
* @param <A> the content type of the list
*/
public class CmsObjectListLimiter<A> implements Iterable<A>, Iterator<A> {
/** The list for which this object acts as an iterator. */
private List<A> m_baseList;
/** The maximum number of objects which can still be returned. */
private int m_max;
/** The index of the next object to return. */
private int m_next;
/**
* Creates a new instance.<p>
*
* @param baseList the list over which we want to iterate
* @param maxItems the maximum number of items
* @param skipCount the number of items to skip
*/
public CmsObjectListLimiter(List<A> baseList, BigInteger maxItems, BigInteger skipCount) {
// skip and max
m_baseList = baseList;
m_next = (skipCount == null ? 0 : skipCount.intValue());
if (m_next < 0) {
m_next = 0;
}
m_max = (maxItems == null ? Integer.MAX_VALUE : maxItems.intValue());
if (m_max < 0) {
m_max = Integer.MAX_VALUE;
}
}
/**
* Checks if there are more items left in the base list which were not returned.<p>
*
* @return true if there are more items left in the base list which were not returned
*/
public boolean hasMore() {
return m_next < m_baseList.size();
}
/**
* @see java.util.Iterator#hasNext()
*/
public boolean hasNext() {
return (m_next < m_baseList.size()) && (m_max > 0);
}
/**
* @see java.lang.Iterable#iterator()
*/
public Iterator<A> iterator() {
return this;
}
/**
* @see java.util.Iterator#next()
*/
public A next() {
A result = m_baseList.get(m_next);
m_next += 1;
m_max -= 1;
return result;
}
/**
* @see java.util.Iterator#remove()
*/
public void remove() {
throw new UnsupportedOperationException();
}
}
|
{
"pile_set_name": "Github"
}
|
/*
Copyright The Kubernetes Authors.
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
*/
// Code generated by informer-gen. DO NOT EDIT.
package v1
import (
"context"
time "time"
corev1 "k8s.io/api/core/v1"
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
runtime "k8s.io/apimachinery/pkg/runtime"
watch "k8s.io/apimachinery/pkg/watch"
internalinterfaces "k8s.io/client-go/informers/internalinterfaces"
kubernetes "k8s.io/client-go/kubernetes"
v1 "k8s.io/client-go/listers/core/v1"
cache "k8s.io/client-go/tools/cache"
)
// PersistentVolumeInformer provides access to a shared informer and lister for
// PersistentVolumes.
type PersistentVolumeInformer interface {
Informer() cache.SharedIndexInformer
Lister() v1.PersistentVolumeLister
}
type persistentVolumeInformer struct {
factory internalinterfaces.SharedInformerFactory
tweakListOptions internalinterfaces.TweakListOptionsFunc
}
// NewPersistentVolumeInformer constructs a new informer for PersistentVolume type.
// Always prefer using an informer factory to get a shared informer instead of getting an independent
// one. This reduces memory footprint and number of connections to the server.
func NewPersistentVolumeInformer(client kubernetes.Interface, resyncPeriod time.Duration, indexers cache.Indexers) cache.SharedIndexInformer {
return NewFilteredPersistentVolumeInformer(client, resyncPeriod, indexers, nil)
}
// NewFilteredPersistentVolumeInformer constructs a new informer for PersistentVolume type.
// Always prefer using an informer factory to get a shared informer instead of getting an independent
// one. This reduces memory footprint and number of connections to the server.
func NewFilteredPersistentVolumeInformer(client kubernetes.Interface, resyncPeriod time.Duration, indexers cache.Indexers, tweakListOptions internalinterfaces.TweakListOptionsFunc) cache.SharedIndexInformer {
return cache.NewSharedIndexInformer(
&cache.ListWatch{
ListFunc: func(options metav1.ListOptions) (runtime.Object, error) {
if tweakListOptions != nil {
tweakListOptions(&options)
}
return client.CoreV1().PersistentVolumes().List(context.TODO(), options)
},
WatchFunc: func(options metav1.ListOptions) (watch.Interface, error) {
if tweakListOptions != nil {
tweakListOptions(&options)
}
return client.CoreV1().PersistentVolumes().Watch(context.TODO(), options)
},
},
&corev1.PersistentVolume{},
resyncPeriod,
indexers,
)
}
func (f *persistentVolumeInformer) defaultInformer(client kubernetes.Interface, resyncPeriod time.Duration) cache.SharedIndexInformer {
return NewFilteredPersistentVolumeInformer(client, resyncPeriod, cache.Indexers{cache.NamespaceIndex: cache.MetaNamespaceIndexFunc}, f.tweakListOptions)
}
func (f *persistentVolumeInformer) Informer() cache.SharedIndexInformer {
return f.factory.InformerFor(&corev1.PersistentVolume{}, f.defaultInformer)
}
func (f *persistentVolumeInformer) Lister() v1.PersistentVolumeLister {
return v1.NewPersistentVolumeLister(f.Informer().GetIndexer())
}
|
{
"pile_set_name": "Github"
}
|
R = degreesRing 1
t = R_0
h = 1-t^2-2*t^5-t^6+2*t^7+3*t^8-2*t^10
assert( h % (1-t) == 0 )
assert( (h // (1-t)) * (1-t) == h )
debug Core
S = QQ[x,y]/(x^2-5)
assert ( 1//x * x == 1 )
raw (1_S) // (raw x)
S = QQ[x]/(x^2-5)
assert ( 1//x * x == 1 )
raw (1_S) // (raw x)
use ambient S
x
rawExtendedGCD(raw x, raw(x^2-5))
R = QQ[x]
gcdCoefficients(x,x^2-5)
rawExtendedGCD(raw x, raw(x^2-5))
-- this never could have worked:
-- R = ZZ[x]
-- gcdCoefficients(x,x^2-5)
-- rawExtendedGCD(raw x, raw(x^2-5))
R = QQ[x,y]/(x^2-5)
1//x
R = QQ[x]/(x^2+1)[y]
r = 1_R % (x*1_R)
q = 1_R // (x*1_R)
assert(1_R - x*q - r == 0)
1_R % gb ideal (x*1_R)
remquottest = (f,g) -> (
r = f % g;
q = f // g;
f - q*g - r)
S = ZZ[x,y,z]/(3*x^2-y-1)
assert(remquottest(1_S, x^2) == 0)
assert(remquottest(y^3, x+1) == 0)
(x+1)*q
T = ZZ[a]/(a^3-a-1)
A = T[x,y,z]/(x*a-1)
assert(remquottest(1,x) == 0)
assert(remquottest(1,x*y) == 0)
assert(remquottest(x*y,a+1) == 0)
B = GF(8,Variable=>w)[symbol x]/(x^3-w-1)
assert(remquottest(x+w, x^23) == 0)
|
{
"pile_set_name": "Github"
}
|
CMAKE_PROGRESS_1 = 1
|
{
"pile_set_name": "Github"
}
|
/*
Copyright 2017 The Kubernetes Authors.
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
*/
package v1beta1
import (
"errors"
"k8s.io/apimachinery/pkg/util/json"
)
var jsTrue = []byte("true")
var jsFalse = []byte("false")
func (s JSONSchemaPropsOrBool) MarshalJSON() ([]byte, error) {
if s.Schema != nil {
return json.Marshal(s.Schema)
}
if s.Schema == nil && !s.Allows {
return jsFalse, nil
}
return jsTrue, nil
}
func (s *JSONSchemaPropsOrBool) UnmarshalJSON(data []byte) error {
var nw JSONSchemaPropsOrBool
switch {
case len(data) == 0:
case data[0] == '{':
var sch JSONSchemaProps
if err := json.Unmarshal(data, &sch); err != nil {
return err
}
nw.Allows = true
nw.Schema = &sch
case len(data) == 4 && string(data) == "true":
nw.Allows = true
case len(data) == 5 && string(data) == "false":
nw.Allows = false
default:
return errors.New("boolean or JSON schema expected")
}
*s = nw
return nil
}
func (s JSONSchemaPropsOrStringArray) MarshalJSON() ([]byte, error) {
if len(s.Property) > 0 {
return json.Marshal(s.Property)
}
if s.Schema != nil {
return json.Marshal(s.Schema)
}
return []byte("null"), nil
}
func (s *JSONSchemaPropsOrStringArray) UnmarshalJSON(data []byte) error {
var first byte
if len(data) > 1 {
first = data[0]
}
var nw JSONSchemaPropsOrStringArray
if first == '{' {
var sch JSONSchemaProps
if err := json.Unmarshal(data, &sch); err != nil {
return err
}
nw.Schema = &sch
}
if first == '[' {
if err := json.Unmarshal(data, &nw.Property); err != nil {
return err
}
}
*s = nw
return nil
}
func (s JSONSchemaPropsOrArray) MarshalJSON() ([]byte, error) {
if len(s.JSONSchemas) > 0 {
return json.Marshal(s.JSONSchemas)
}
return json.Marshal(s.Schema)
}
func (s *JSONSchemaPropsOrArray) UnmarshalJSON(data []byte) error {
var nw JSONSchemaPropsOrArray
var first byte
if len(data) > 1 {
first = data[0]
}
if first == '{' {
var sch JSONSchemaProps
if err := json.Unmarshal(data, &sch); err != nil {
return err
}
nw.Schema = &sch
}
if first == '[' {
if err := json.Unmarshal(data, &nw.JSONSchemas); err != nil {
return err
}
}
*s = nw
return nil
}
func (s JSON) MarshalJSON() ([]byte, error) {
if len(s.Raw) > 0 {
return s.Raw, nil
}
return []byte("null"), nil
}
func (s *JSON) UnmarshalJSON(data []byte) error {
if len(data) > 0 && string(data) != "null" {
s.Raw = data
}
return nil
}
|
{
"pile_set_name": "Github"
}
|
/**
* Returns a Buffer from a "ff 00 ff"-type hex string.
*/
getBufferFromHexString = function(byteStr) {
var bytes = byteStr.split(' ');
var buf = new Buffer(bytes.length);
for (var i = 0; i < bytes.length; ++i) {
buf[i] = parseInt(bytes[i], 16);
}
return buf;
}
/**
* Returns a hex string from a Buffer.
*/
getHexStringFromBuffer = function(data) {
var s = '';
for (var i = 0; i < data.length; ++i) {
s += padl(data[i].toString(16), 2, '0') + ' ';
}
return s.trim();
}
/**
* Splits a buffer in two parts.
*/
splitBuffer = function(buffer) {
var b1 = new Buffer(Math.ceil(buffer.length / 2));
buffer.copy(b1, 0, 0, b1.length);
var b2 = new Buffer(Math.floor(buffer.length / 2));
buffer.copy(b2, 0, b1.length, b1.length + b2.length);
return [b1, b2];
}
/**
* Performs hybi07+ type masking on a hex string or buffer.
*/
mask = function(buf, maskString) {
if (typeof buf == 'string') buf = new Buffer(buf);
var mask = getBufferFromHexString(maskString || '34 83 a8 68');
for (var i = 0; i < buf.length; ++i) {
buf[i] ^= mask[i % 4];
}
return buf;
}
/**
* Returns a hex string representing the length of a message
*/
getHybiLengthAsHexString = function(len, masked) {
if (len < 126) {
var buf = new Buffer(1);
buf[0] = (masked ? 0x80 : 0) | len;
}
else if (len < 65536) {
var buf = new Buffer(3);
buf[0] = (masked ? 0x80 : 0) | 126;
getBufferFromHexString(pack(4, len)).copy(buf, 1);
}
else {
var buf = new Buffer(9);
buf[0] = (masked ? 0x80 : 0) | 127;
getBufferFromHexString(pack(16, len)).copy(buf, 1);
}
return getHexStringFromBuffer(buf);
}
/**
* Unpacks a Buffer into a number.
*/
unpack = function(buffer) {
var n = 0;
for (var i = 0; i < buffer.length; ++i) {
n = (i == 0) ? buffer[i] : (n * 256) + buffer[i];
}
return n;
}
/**
* Returns a hex string, representing a specific byte count 'length', from a number.
*/
pack = function(length, number) {
return padl(number.toString(16), length, '0').replace(/([0-9a-f][0-9a-f])/gi, '$1 ').trim();
}
/**
* Left pads the string 's' to a total length of 'n' with char 'c'.
*/
padl = function(s, n, c) {
return new Array(1 + n - s.length).join(c) + s;
}
|
{
"pile_set_name": "Github"
}
|
fileFormatVersion: 2
guid: c83956915580e42489479d2a109470ab
timeCreated: 1470404606
licenseType: Store
ShaderImporter:
defaultTextures: []
userData:
assetBundleName:
assetBundleVariant:
|
{
"pile_set_name": "Github"
}
|
YUI Doc generates API documentation from a modified JavaDoc syntax.
Current version (0.3.50)
Usage: yuidoc <options> <input path>
Common Options:
-c, --config, --configfile <filename> A JSON config file to provide configuration data.
You can also create a yuidoc.json file and place it
anywhere under your source tree and YUI Doc will find it
and use it.
-e, --extension <comma sep list of file extensions> The list of file extensions to parse
for api documentation. (defaults to .js)
-x, --exclude <comma sep list of directories> Directories to exclude from parsing
(defaults to '.DS_Store,.svn,CVS,.git,build_rollup_tmp,build_tmp')
-v, --version Show the current YUIDoc version
--project-version Set the doc version for the template
-N, --no-color Turn off terminal colors (for automation)
-C, --no-code Turn off code generation (don't include source files in output)
-n, --norecurse Do not recurse directories (default is to recurse)
-S, --selleck Look for Selleck component data and attach to API meta data
-V, --view Dump the Handlebars.js view data instead of writing template files
-p, --parse-only Only parse the API docs and create the JSON data, do not render templates
-o, --outdir <directory path> Path to put the generated files (defaults to ./out)
-t, --themedir <directory path> Path to a custom theme directory containing Handlebars templates
-H, --helpers <comma separated list of paths to files> Require these file and add Handlebars helpers. See docs for more information
--charset CHARSET Use this as the default charset for all file operations. Defaults to 'utf8'
-h, --help Show this help
-q, --quiet Supress logging output
-T, --theme <simple|default> Choose one of the built in themes (default is default)
--syntaxtype <js|coffee> Choose comment syntax type (default is js)
--server <port> Fire up the YUIDoc server for faster API doc developement. Pass optional port to listen on. (default is 3000)
--lint Lint your docs, will print parser warnings and exit code 1 if there are any
<input path> Supply a list of paths (shell globbing is handy here)
|
{
"pile_set_name": "Github"
}
|
"""多线程抓取斗鱼美女主播首页美女主播图片"""
'''
@Time : 2018/1/23 下午5:59
@Author : scrappy_zhang
@File : net07_douyu_threading.py
'''
import urllib.request
import re
import time
import threading
max_retry_count = 3
def down_img(url):
"""
下载图片
https://rpic.douyucdn.cn/live-cover/appCovers/2017/10/24/12017.jpg
"""
for i in range(max_retry_count):
try:
response = urllib.request.urlopen(url)
# bytes
data = response.read()
# 从url中得到文件名
file_name = url[url.rfind('/') + 1:]
# 打开文件用以写入
with open("img/" + file_name, "wb") as file:
file.write(data)
except Exception as e:
print("出错 %s 正在重试" % e)
else:
break
if __name__ == '__main__':
start = time.time() # 程序大约的开始时间
home = """https://www.douyu.com/directory/game/yz?page=1&isAjax=1""" # 首页地址
# 请求的时候需要带上头部 可以防止初步的反爬措施
headers = {
"Host": "www.douyu.com",
"User-Agent": "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_11_6) AppleWebKit/537.36 (KHTML, like Gecko) "
"Chrome/62.0.3202.94 Safari/537.36"
}
# 构造好请求对象 将请求提交到服务器 获取的响应就是到首页的html代码
request = urllib.request.Request(url=home, headers=headers)
# urlopen函数可以直接传入url网址 也可以指定好一个请求对象
response = urllib.request.urlopen(request)
# 将收到的响应对象中数据的bytes数据读出出来 并且解码
html_data = response.read().decode()
# 使用正则 从所要抓取的网页中 提取出所有美女主播的图片链接,并存入一个列表
img_list = re.findall(r"https://.*?\.(?:jpg)", html_data)
# 下载美女主播图片
for img_url in img_list:
td = threading.Thread(target=down_img, args=(img_url,))
td.start()
# 阻塞程序直到所有线程运行完毕
while True:
length = len(threading.enumerate())
if length == 1:
break
end = time.time() # 程序大约的结束时间
print('耗时:', end - start)
|
{
"pile_set_name": "Github"
}
|
// Animated Icons
// --------------------------
.#{$fa-css-prefix}-spin {
animation: fa-spin 2s infinite linear;
}
.#{$fa-css-prefix}-pulse {
animation: fa-spin 1s infinite steps(8);
}
@keyframes fa-spin {
0% {
transform: rotate(0deg);
}
100% {
transform: rotate(360deg);
}
}
|
{
"pile_set_name": "Github"
}
|
GNU AFFERO GENERAL PUBLIC LICENSE
Version 3, 19 November 2007
Copyright (C) 2007 Free Software Foundation, Inc. <http://fsf.org/>
Everyone is permitted to copy and distribute verbatim copies
of this license document, but changing it is not allowed.
Preamble
The GNU Affero General Public License is a free, copyleft license for
software and other kinds of works, specifically designed to ensure
cooperation with the community in the case of network server software.
The licenses for most software and other practical works are designed
to take away your freedom to share and change the works. By contrast,
our General Public Licenses are intended to guarantee your freedom to
share and change all versions of a program--to make sure it remains free
software for all its users.
When we speak of free software, we are referring to freedom, not
price. Our General Public Licenses are designed to make sure that you
have the freedom to distribute copies of free software (and charge for
them if you wish), that you receive source code or can get it if you
want it, that you can change the software or use pieces of it in new
free programs, and that you know you can do these things.
Developers that use our General Public Licenses protect your rights
with two steps: (1) assert copyright on the software, and (2) offer
you this License which gives you legal permission to copy, distribute
and/or modify the software.
A secondary benefit of defending all users' freedom is that
improvements made in alternate versions of the program, if they
receive widespread use, become available for other developers to
incorporate. Many developers of free software are heartened and
encouraged by the resulting cooperation. However, in the case of
software used on network servers, this result may fail to come about.
The GNU General Public License permits making a modified version and
letting the public access it on a server without ever releasing its
source code to the public.
The GNU Affero General Public License is designed specifically to
ensure that, in such cases, the modified source code becomes available
to the community. It requires the operator of a network server to
provide the source code of the modified version running there to the
users of that server. Therefore, public use of a modified version, on
a publicly accessible server, gives the public access to the source
code of the modified version.
An older license, called the Affero General Public License and
published by Affero, was designed to accomplish similar goals. This is
a different license, not a version of the Affero GPL, but Affero has
released a new version of the Affero GPL which permits relicensing under
this license.
The precise terms and conditions for copying, distribution and
modification follow.
TERMS AND CONDITIONS
0. Definitions.
"This License" refers to version 3 of the GNU Affero General Public License.
"Copyright" also means copyright-like laws that apply to other kinds of
works, such as semiconductor masks.
"The Program" refers to any copyrightable work licensed under this
License. Each licensee is addressed as "you". "Licensees" and
"recipients" may be individuals or organizations.
To "modify" a work means to copy from or adapt all or part of the work
in a fashion requiring copyright permission, other than the making of an
exact copy. The resulting work is called a "modified version" of the
earlier work or a work "based on" the earlier work.
A "covered work" means either the unmodified Program or a work based
on the Program.
To "propagate" a work means to do anything with it that, without
permission, would make you directly or secondarily liable for
infringement under applicable copyright law, except executing it on a
computer or modifying a private copy. Propagation includes copying,
distribution (with or without modification), making available to the
public, and in some countries other activities as well.
To "convey" a work means any kind of propagation that enables other
parties to make or receive copies. Mere interaction with a user through
a computer network, with no transfer of a copy, is not conveying.
An interactive user interface displays "Appropriate Legal Notices"
to the extent that it includes a convenient and prominently visible
feature that (1) displays an appropriate copyright notice, and (2)
tells the user that there is no warranty for the work (except to the
extent that warranties are provided), that licensees may convey the
work under this License, and how to view a copy of this License. If
the interface presents a list of user commands or options, such as a
menu, a prominent item in the list meets this criterion.
1. Source Code.
The "source code" for a work means the preferred form of the work
for making modifications to it. "Object code" means any non-source
form of a work.
A "Standard Interface" means an interface that either is an official
standard defined by a recognized standards body, or, in the case of
interfaces specified for a particular programming language, one that
is widely used among developers working in that language.
The "System Libraries" of an executable work include anything, other
than the work as a whole, that (a) is included in the normal form of
packaging a Major Component, but which is not part of that Major
Component, and (b) serves only to enable use of the work with that
Major Component, or to implement a Standard Interface for which an
implementation is available to the public in source code form. A
"Major Component", in this context, means a major essential component
(kernel, window system, and so on) of the specific operating system
(if any) on which the executable work runs, or a compiler used to
produce the work, or an object code interpreter used to run it.
The "Corresponding Source" for a work in object code form means all
the source code needed to generate, install, and (for an executable
work) run the object code and to modify the work, including scripts to
control those activities. However, it does not include the work's
System Libraries, or general-purpose tools or generally available free
programs which are used unmodified in performing those activities but
which are not part of the work. For example, Corresponding Source
includes interface definition files associated with source files for
the work, and the source code for shared libraries and dynamically
linked subprograms that the work is specifically designed to require,
such as by intimate data communication or control flow between those
subprograms and other parts of the work.
The Corresponding Source need not include anything that users
can regenerate automatically from other parts of the Corresponding
Source.
The Corresponding Source for a work in source code form is that
same work.
2. Basic Permissions.
All rights granted under this License are granted for the term of
copyright on the Program, and are irrevocable provided the stated
conditions are met. This License explicitly affirms your unlimited
permission to run the unmodified Program. The output from running a
covered work is covered by this License only if the output, given its
content, constitutes a covered work. This License acknowledges your
rights of fair use or other equivalent, as provided by copyright law.
You may make, run and propagate covered works that you do not
convey, without conditions so long as your license otherwise remains
in force. You may convey covered works to others for the sole purpose
of having them make modifications exclusively for you, or provide you
with facilities for running those works, provided that you comply with
the terms of this License in conveying all material for which you do
not control copyright. Those thus making or running the covered works
for you must do so exclusively on your behalf, under your direction
and control, on terms that prohibit them from making any copies of
your copyrighted material outside their relationship with you.
Conveying under any other circumstances is permitted solely under
the conditions stated below. Sublicensing is not allowed; section 10
makes it unnecessary.
3. Protecting Users' Legal Rights From Anti-Circumvention Law.
No covered work shall be deemed part of an effective technological
measure under any applicable law fulfilling obligations under article
11 of the WIPO copyright treaty adopted on 20 December 1996, or
similar laws prohibiting or restricting circumvention of such
measures.
When you convey a covered work, you waive any legal power to forbid
circumvention of technological measures to the extent such circumvention
is effected by exercising rights under this License with respect to
the covered work, and you disclaim any intention to limit operation or
modification of the work as a means of enforcing, against the work's
users, your or third parties' legal rights to forbid circumvention of
technological measures.
4. Conveying Verbatim Copies.
You may convey verbatim copies of the Program's source code as you
receive it, in any medium, provided that you conspicuously and
appropriately publish on each copy an appropriate copyright notice;
keep intact all notices stating that this License and any
non-permissive terms added in accord with section 7 apply to the
|
{
"pile_set_name": "Github"
}
|
<?php
session_start();
if(!((($_SERVER['HTTP_X_REQUESTED_WITH'] == 'XMLHttpRequest')||defined('evolette')) && $_SESSION['authorized']===true)) exit();
?>
<div id="ev-feat" style="display:none">
<h2 class="content-heading h-help">Evolette Features</h2>
<p>Evolette has a lot of native scripts for jQuery (no third party hevyweight scripts or plugins). All scripts are well documented, so you'll have no problems to use them. It also powered with TinyMCE WYSIWYG edtor.</p>
<h2 class="inner-heading h-help">Security</h2>
<p>Evolette is well secured. In a word, security is based on the dynamic sessions.</p>
<h2 class="inner-heading h-help">Ajax Features</h2>
<p>Ajax features of templates are very easy to use. They are based on adding special CLASS attribute value to links or forms, which allows you to load desired file (or post a form fields values) to content section or to popup window, or just to send them to file without any callback.</p>
<h2 class="inner-heading h-help">To Do List</h2>
<p>There is an editable To Do list. In this template To Do content is stored in the file. But if your CMS will use not one administrator user, it is better to save it to database for each user. <a class="popup" href="index.php?content=todo">Open To Do</a></p>
<h2 class="inner-heading h-help">Mailing engine</h2>
<p>Evolette has its own simple mailing engine.</p>
<ul>
<li>Message Form could be opened empty like this: <a class="popup" href="index.php?content=new-message">open form</a>.</li>
<li>By using a special CLASS for link, form could be opened with prefilled email address: <a class="sendMessage" href="demo@idangero.us">open form</a>.</li>
<li>Or it can be opened with all prefilled fields by specifying their values in the HREF attribute: <a class="popup" href="?content=new-message&mailto=demo@idangero.us&subject=Demo Subject&message=This message posted from link">open form</a>. </li>
</ul>
<p>You can try to send a message to any email. Mailing Engine is fully functioning!</p>
<h2 class="inner-heading h-help">Popup Engine</h2>
<p>Evolette has a very simple and powerful popup engine, which allows you to include any file to popup window or to include any text message without including a file. It also allows to open included file with an additional POSTed variables.</p>
<h2 class="inner-heading h-help">Forms Handling Engine</h2>
<p>As the Evolette is fully Ajax template, so it's impossible to submit forms with a simple POST or GET methods. Therefore there is a Form Handling engine which takes all form fields values and sends them to target file(specified in the ACTION attribute of form) by one of three ways: first way is to open target file with posted vars in the popup window (like Mailing Engine or To Do), second one is to open target file in content section (like on the article adding/editing page), and the last way is to post vars to file without any callback.</p>
<p>It's very easy to use form handling, all you'll need is to specify special class for form.</p>
<h2 class="inner-heading h-help">Wrappers</h2>
<p>There is a few elements wrappers used in Evolette. Their usage make the creation of some elements much faster. For example good-looking button code looks like: <br />
<strong><span class="button-l"><span class="button-m"><input type="submit" class="button"/></span></span></strong></p>
<p>But it is not so easy to write this code every time. Here is why we need a wrappers. With wrapper all you need is to write: <strong><input type="submit" class="button"/></strong> , and script will wrap this button with spans automatically</p>
</div>
|
{
"pile_set_name": "Github"
}
|
{
"images" : [
{
"idiom" : "universal",
"filename" : "email.pdf",
"scale" : "1x"
},
{
"idiom" : "universal",
"scale" : "2x"
},
{
"idiom" : "universal",
"scale" : "3x"
}
],
"info" : {
"version" : 1,
"author" : "xcode"
},
"properties" : {
"preserves-vector-representation" : true
}
}
|
{
"pile_set_name": "Github"
}
|
/*
Copyright (c) 2015, Apple Inc. All rights reserved.
Copyright (c) 2015, Ricardo Sánchez-Sáez.
Redistribution and use in source and binary forms, with or without modification,
are permitted provided that the following conditions are met:
1. Redistributions of source code must retain the above copyright notice, this
list of conditions and the following disclaimer.
2. Redistributions in binary form must reproduce the above copyright notice,
this list of conditions and the following disclaimer in the documentation and/or
other materials provided with the distribution.
3. Neither the name of the copyright holder(s) nor the names of any contributors
may be used to endorse or promote products derived from this software without
specific prior written permission. No license is granted to the trademarks of
the copyright holders even if such marks are included in this software.
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.
*/
#import "ORKTintedImageView.h"
#import "ORKTintedImageView_Internal.h"
#import "ORKHelpers_Internal.h"
#define ORKTintedImageLog(...)
ORK_INLINE BOOL ORKIsImageAnimated(UIImage *image) {
return image.images.count > 1;
}
UIImage *ORKImageByTintingImage(UIImage *image, UIColor *tintColor, CGFloat scale) {
if (!image || !tintColor || !(scale > 0)) {
return nil;
}
ORKTintedImageLog(@"%@ %@ %f", image, tintColor, scale);
UIGraphicsBeginImageContextWithOptions(image.size, NO, scale);
CGContextRef context = UIGraphicsGetCurrentContext();
CGContextSetBlendMode(context, kCGBlendModeNormal);
CGContextSetAlpha(context, 1);
CGRect r = (CGRect){{0,0},image.size};
CGContextBeginTransparencyLayerWithRect(context, r, NULL);
[tintColor setFill];
[image drawInRect:r];
UIRectFillUsingBlendMode(r, kCGBlendModeSourceIn);
CGContextEndTransparencyLayer(context);
UIImage *outputImage = UIGraphicsGetImageFromCurrentImageContext();
UIGraphicsEndImageContext();
return outputImage;
}
@interface ORKTintedImageCacheKey : NSObject
- (instancetype)initWithImage:(UIImage *)image tintColor:(UIColor *)tintColor scale:(CGFloat)scale;
@property (nonatomic, readonly) UIImage *image;
@property (nonatomic, readonly) UIColor *tintColor;
@property (nonatomic, readonly) CGFloat scale;
@end
@implementation ORKTintedImageCacheKey {
UIImage *_image;
UIColor *_tintColor;
CGFloat _scale;
}
- (instancetype)initWithImage:(UIImage *)image tintColor:(UIColor *)tintColor scale:(CGFloat)scale {
self = [super init];
if (self) {
_image = image;
_tintColor = tintColor;
_scale = scale;
}
return self;
}
- (BOOL)isEqual:(id)object {
if ([self class] != [object class]) {
return NO;
}
__typeof(self) castObject = object;
return (ORKEqualObjects(self.image, castObject.image)
&& ORKEqualObjects(self.tintColor, castObject.tintColor)
&& ORKCGFloatNearlyEqualToFloat(self.scale, castObject.scale));
}
@end
@interface ORKTintedImageCache ()
- (UIImage *)tintedImageForImage:(UIImage *)image tintColor:(UIColor *)tintColor scale:(CGFloat)scale;
@end
@implementation ORKTintedImageCache
+ (instancetype)sharedCache
{
static dispatch_once_t onceToken;
static id sharedInstance = nil;
dispatch_once(&onceToken, ^{
sharedInstance = [[[self class] alloc] init];
});
return sharedInstance;
}
- (UIImage *)tintedImageForImage:(UIImage *)image tintColor:(UIColor *)tintColor scale:(CGFloat)scale {
UIImage *tintedImage = nil;
ORKTintedImageCacheKey *key = [[ORKTintedImageCacheKey alloc] initWithImage:image tintColor:tintColor scale:scale];
tintedImage = [self objectForKey:key];
if (!tintedImage) {
tintedImage = ORKImageByTintingImage(image, tintColor, scale);
if (tintedImage) {
[self setObject:tintedImage forKey:key];
}
}
return tintedImage;
}
- (void)cacheImage:(UIImage *)image tintColor:(UIColor *)tintColor scale:(CGFloat)scale {
[[ORKTintedImageCache sharedCache] tintedImageForImage:image tintColor:tintColor scale:scale];
}
@end
@implementation ORKTintedImageView {
UIImage *_originalImage;
UIImage *_tintedImage;
UIColor *_appliedTintColor;
CGFloat _appliedScaleFactor;
}
- (void)setShouldApplyTint:(BOOL)shouldApplyTint {
_shouldApplyTint = shouldApplyTint;
self.image = _originalImage;
}
- (UIImage *)imageByTintingImage:(UIImage *)image {
if (!image || (image.renderingMode == UIImageRenderingModeAlwaysOriginal
|| (image.renderingMode == UIImageRenderingModeAutomatic && !_shouldApplyTint))) {
return image;
}
UIColor *tintColor = self.tintColor;
CGFloat screenScale = self.window.screen.scale; // Use screen.scale; self.contentScaleFactor remains 1.0 until later
if (screenScale > 0 && (![_appliedTintColor isEqual:tintColor] || !ORKCGFloatNearlyEqualToFloat(_appliedScaleFactor, screenScale))) {
_appliedTintColor = tintColor;
_appliedScaleFactor = screenScale;
if (!ORKIsImageAnimated(image)) {
if (_enableTintedImageCaching) {
_tintedImage = [[ORKTintedImageCache sharedCache] tintedImageForImage:image tintColor:tintColor scale:screenScale];
} else {
_tintedImage = [image imageWithRenderingMode:UIImageRenderingModeAlwaysTemplate];
}
} else {
NSArray *animationImages = image.images;
NSMutableArray *tintedAnimationImages = [[NSMutableArray alloc] initWithCapacity:animationImages.count];
for (UIImage *animationImage in animationImages) {
UIImage *tintedAnimationImage = nil;
if (_enableTintedImageCaching) {
tintedAnimationImage = [[ORKTintedImageCache sharedCache] tintedImageForImage:animationImage tintColor:tintColor scale:screenScale];
} else {
tintedAnimationImage = ORKImageByTintingImage(animationImage, tintColor, screenScale);
}
if (tintedAnimationImage) {
[tintedAnimationImages addObject:tintedAnimationImage];
}
}
_tintedImage = [UIImage animatedImageWithImages:tintedAnimationImages duration:image.duration];
}
}
return _tintedImage;
}
- (void)setImage:(UIImage *)image {
_originalImage = image;
image = [self imageByTintingImage:image];
[super setImage:image];
}
-
|
{
"pile_set_name": "Github"
}
|
//
// NSImage+Thumbnail.swift
// WWDC
//
// Created by Guilherme Rambo on 21/05/17.
// Copyright © 2017 Guilherme Rambo. All rights reserved.
//
import Cocoa
extension NSImage {
static func thumbnailImage(with url: URL, maxWidth: CGFloat) -> NSImage? {
guard let inputImage = NSImage(contentsOf: url) else { return nil }
let aspectRatio = inputImage.size.width / inputImage.size.height
let thumbSize = NSSize(width: maxWidth, height: maxWidth * aspectRatio)
let outputImage = NSImage(size: thumbSize)
outputImage.lockFocus()
inputImage.draw(in: NSRect(x: 0, y: 0, width: thumbSize.width, height: thumbSize.height), from: .zero, operation: .sourceOver, fraction: 1)
outputImage.unlockFocus()
return outputImage
}
}
extension NSImage {
func makeFreestandingTemplate(outputSize: NSSize) -> NSImage {
let insetPercentage: CGFloat = 0.25
var insetSize = outputSize
let widthInset = outputSize.width * insetPercentage
let heightInset = outputSize.height * insetPercentage
insetSize.width -= 2 * widthInset
insetSize.height -= 2 * heightInset
let destinationRect = NSRect(origin: CGPoint(x: widthInset, y: heightInset), size: insetSize)
// Circle Template
let circle = CAShapeLayer()
circle.path = CGPath(ellipseIn: CGRect(origin: .zero, size: outputSize), transform: nil)
// New image
let newImage = NSImage(size: outputSize)
newImage.lockFocus()
// Render both into new image
let ctx = NSGraphicsContext.current!.cgContext
circle.render(in: ctx)
draw(in: destinationRect, from: .zero, operation: .xor, fraction: 1)
newImage.unlockFocus()
newImage.isTemplate = true
return newImage
}
}
|
{
"pile_set_name": "Github"
}
|
<pre class='metadata'>
Title: Font Metrics API Level 1
Status: DREAM
Group: houdini
ED: https://drafts.css-houdini.org/font-metrics-api-1/
Shortname: font-metrics-api
Level: 1
Abstract:
Editor: Emil A Eklund, eae@google.com, w3cid 93298
Editor: Alan Stearns, stearns@adobe.com, w3cid 46659
</pre>
<pre class=link-defaults>
spec:dom; type:interface; text:Document
spec:dom; type:interface; text:Element;
spec:cssom-1; type:interface; text:CSS;
</pre>
Introduction {#intro}
=====================
The API exposed by this specification is designed to provide basic font metrics
for both in-document and out-of-document content.
Note: In a future version of this spec support may be added for exposing
information about individual runs of text, including information about
directionality, script, and character properties.
Measure API {#measure-api}
============================================
<pre class='idl'>
partial interface Document {
FontMetrics measureElement(Element element);
FontMetrics measureText(DOMString text, StylePropertyMapReadOnly styleMap);
};
</pre>
Two methods are provided for measuring text, one for in-document measurements
and another for out-of-document measurements. Both return a {{FontMetrics}}
object.
{{Document/measureElement()}} takes an {{Element}} and returns a {{FontMetrics}}
object. If the {{Element}} is not in the document or isn't rendered an empty
{{FontMetrics}} object will be returned.
{{Document/measureText()}} takes a {{DOMString}} and a
{{StylePropertyMapReadOnly}}, returning a {{FontMetrics}} object. Unless a font
is specified as a part of the styleMap the user agents default will be used.
Note: The only styles that apply to the {{Document/measureText()}} method are
those that are passed in as a part of the styleMap. Document styles do not apply.
{{FontMetrics}} object {#fontmetrics-definition}
----------------------------
<pre class='idl'>
interface FontMetrics {
readonly attribute double width;
readonly attribute FrozenArray<double> advances;
readonly attribute double boundingBoxLeft;
readonly attribute double boundingBoxRight;
readonly attribute double height;
readonly attribute double emHeightAscent;
readonly attribute double emHeightDescent;
readonly attribute double boundingBoxAscent;
readonly attribute double boundingBoxDescent;
readonly attribute double fontBoundingBoxAscent;
readonly attribute double fontBoundingBoxDescent;
readonly attribute Baseline dominantBaseline;
readonly attribute FrozenArray<Baseline> baselines;
readonly attribute FrozenArray<Font> fonts;
};
</pre>
The {{FontMetrics}} object has the following attributes:
{{FontMetrics/width}}
The advance width of the line box, in CSS pixels.
{{FontMetrics/advances}}
List of advances for each codepoint in the given text relative to the preceding
codepoint, in CSS pixels. Where a glyph is composed of a sequence of codepoints
the advance for the all but the first codepoint in the sequence will be zero.
{{FontMetrics/boundingBoxLeft}}
The distance parallel to the {{FontMetrics/dominantBaseline}} from the alignment
point given by the text-align property to the left side of the bounding
rectangle of the given text, in CSS pixels; positive numbers indicating a
distance going left from the given alignment point.
Note: The sum of this value and {{FontMetrics/boundingBoxRight}} can be wider
than the {{FontMetrics/width}}, in particular with slanted fonts where
characters overhang their advance width.
{{FontMetrics/boundingBoxRight}}
The distance parallel to the {{FontMetrics/dominantBaseline}} from the alignment
point given by the text-align property to the right side of the bounding
rectangle of the given text, in CSS pixels. Positive numbers indicating a
distance going right from the given alignment point.
{{FontMetrics/height}}
The distance between the highest top and the lowest bottom of the em squares in
the line box, in CSS pixels.
{{FontMetrics/emHeightAscent}}
The distance from the {{FontMetrics/dominantBaseline}} to the highest top of the
em squares in the line box, in CSS pixels.
Positive numbers indicating that the {{FontMetrics/dominantBaseline}} is below
the top of that em square (so this value will usually be positive).
Zero if the {{FontMetrics/dominantBaseline}} is the top of that em square.
Half the font size if the {{FontMetrics/dominantBaseline}} is the middle of that
em square.
{{FontMetrics/emHeightDescent}}
The distance from the {{FontMetrics/dominantBaseline}} to the lowest bottom of
the em squares in the line box, in CSS pixels.
Positive numbers indicating that the {{FontMetrics/dominantBaseline}} is below
the bottom of that em square (so this value will usually be negative).
Zero if the {{FontMetrics/dominantBaseline}} is the bottom of that em square.
{{FontMetrics/boundingBoxAscent}}
The distance from the {{FontMetrics/dominantBaseline}} to the top of the
bounding rectangle of the given text, in CSS pixels; positive numbers indicating
a distance going up from the {{FontMetrics/dominantBaseline}}.
Note: This number can vary greatly based on the input text, even if the first
font specified covers all the characters in the input.
{{FontMetrics/boundingBoxDescent}}
The distance from the {{FontMetrics/dominantBaseline}} to the bottom of the
bounding rectangle of the given text, in CSS pixels; positive numbers indicating
a distance going down from the {{FontMetrics/dominantBaseline}}.
{{FontMetrics/fontBoundingBoxAscent}}
The distance from the {{FontMetrics/dominantBaseline}} to the top of the highest
bounding rectangle of all the fonts used to render the text, in CSS pixels;
positive numbers indicating a distance going up from the
{{FontMetrics/dominantBaseline}}.
Note: This value and {{FontMetrics/fontBoundingBoxDescent}} are useful when
metrics independent of the actual text being measured are desired as the values
will be consistent regardless of the text as long as the same fonts are being
used.
The {{FontMetrics/boundingBoxAscent}} attribute (and its corresponding attribute
for the descent) are useful when metrics specific to the given text are desired.
{{FontMetrics/fontBoundingBoxDescent}}
The distance from the {{FontMetrics/dominantBaseline}} to the bottom of the
lowest bounding rectangle of all the fonts used to render the text, in
CSS pixels; positive numbers indicating a distance going down from the
{{FontMetrics/dominantBaseline}}.
{{FontMetrics/dominantBaseline}}
Reference to the dominant {{Baseline}} for the given text in the list of
{{FontMetrics/baselines}}.
{{FontMetrics/baselines}}
List of all {{Baseline}}s for the given text.
{{Baseline}} object {#baseline-definition}
----------------------------
<pre class='idl'>
interface Baseline {
readonly attribute DOMString name;
readonly attribute double value;
};
</pre>
Each {{Baseline}} object represents a baseline of the measured text and has the
following attributes:
{{Baseline/name}}
Name of the baseline in question.
{{Baseline/value}}
Distance from the {{FontMetrics/dominantBaseline}}, in CSS pixels.
Positive numbers indicating a distance going down from the
{{FontMetrics/dominantBaseline}}.
{{Font}} object {#font-definition}
----------------------------
<pre class='idl'>
interface Font {
readonly attribute DOMString name;
readonly attribute unsigned long glyphsRendered;
};
</pre>
Each {{Font}} object represents a font that was used for at least one glyph in
the measured text. It contains the following fields:
{{Font/name}}
Font family name.
{{Font/glyphsRendered}}
Number of glyphs used from the specific font. If multiple fonts are required to
render the specified text this attribute will indicate how many glyphs where
used from each font.
Note: Indicates the number of glyphs which may be lower than the number of
codepoints.
|
{
"pile_set_name": "Github"
}
|
[cuckoo]
# If turned on, Cuckoo will delete the original file after its analysis
# has been completed.
delete_original = off
# If turned on, Cuckoo will delete the copy of the original file in the
# local binaries repository after the analysis has finished. (On *nix this
# will also invalidate the file called "binary" in each analysis directory,
# as this is a symlink.)
delete_bin_copy = off
# Specify the name of the machinery module to use, this module will
# define the interaction between Cuckoo and your virtualization software
# of choice.
machinery = virtualbox
# Enable creation of memory dump of the analysis machine before shutting
# down. Even if turned off, this functionality can also be enabled at
# submission. Currently available for: VirtualBox and libvirt modules (KVM).
memory_dump = off
# When the timeout of an analysis is hit, the VM is just killed by default.
# For some long-running setups it might be interesting to terminate the
# moinitored processes before killing the VM so that connections are closed.
terminate_processes = off
# Enable automatically re-schedule of "broken" tasks each startup.
# Each task found in status "processing" is re-queued for analysis.
reschedule = off
# Enable processing of results within the main cuckoo process.
# This is the default behavior but can be switched off for setups that
# require high stability and process the results in a separate task.
process_results = on
# Limit the amount of analysis jobs a Cuckoo process goes through.
# This can be used together with a watchdog to mitigate risk of memory leaks.
max_analysis_count = 0
# Limit the number of concurrently executing analysis machines.
# This may be useful on systems with limited resources.
# Set to 0 to disable any limits.
max_machines_count = 0
# Limit the amount of VMs that are allowed to start in parallel. Generally
# speaking starting the VMs is one of the more CPU intensive parts of the
# actual analysis. This option tries to avoid maxing out the CPU completely.
max_vmstartup_count = 10
# Minimum amount of free space (in MB) available before starting a new task.
# This tries to avoid failing an analysis because the reports can't be written
# due out-of-diskspace errors. Setting this value to 0 disables the check.
# (Note: this feature is currently not supported under Windows.)
freespace = 64
# Temporary directory containing the files uploaded through Cuckoo interfaces
# (web.py, api.py, Django web interface).
tmppath = /tmp
# Delta in days from current time to set the guest clocks to for file analyses
# A negative value sets the clock back, a positive value sets it forward.
# The default of 0 disables this option
# Note that this can still be overridden by the per-analysis clock setting
# and it is not performed by default for URL analysis as it will generally
# result in SSL errors
daydelta = 0
[resultserver]
# The Result Server is used to receive in real time the behavioral logs
# produced by the analyzer.
# Specify the IP address of the host. The analysis machines should be able
# to contact the host through such address, so make sure it's valid.
# NOTE: if you set resultserver IP to 0.0.0.0 you have to set the option
# `resultserver_ip` for all your virtual machines in machinery configuration.
ip = 192.168.56.1
# Specify a port number to bind the result server on.
port = 2042
# Should the server write the legacy CSV format?
# (if you have any custom processing on those, switch this on)
store_csvs = off
# Maximum size of uploaded files from VM (screenshots, dropped files, log)
# The value is expressed in bytes, by default 10Mb.
upload_max_size = 10485760
[processing]
# Set the maximum size of analyses generated files to process. This is used
# to avoid the processing of big files which may take a lot of processing
# time. The value is expressed in bytes, by default 100Mb.
analysis_size_limit = 104857600
# The number of calls per process to process. 0 switches the limit off.
# 10000 api calls should be processed in less than 2 minutes
analysis_call_limit = 0
# Enable or disable DNS lookups.
resolve_dns = on
# Enable or disable reverse DNS lookups
# This information currently is not displayed in the web interface
reverse_dns = off
# Use ram to boost processing speed. You will need more than 20GB of RAM for this feature.
# Please read "performance" section in the documentation.
ram_boost = off
# Enable PCAP sorting, needed for the connection content view in the web interface.
sort_pcap = on
[database]
# Specify the database connection string.
# Examples, see documentation for more:
# sqlite:///foo.db
# postgresql://foo:bar@localhost:5432/mydatabase
# mysql://foo:bar@localhost/mydatabase
# If empty, default is a SQLite in db/cuckoo.db.
connection =
# Database connection timeout in seconds.
# If empty, default is set to 60 seconds.
timeout =
[timeouts]
# Set the default analysis timeout expressed in seconds. This value will be
# used to define after how many seconds the analysis will terminate unless
# otherwise specified at submission.
default = 120
# Set the critical timeout expressed in (relative!) seconds. It will be added
# to the default timeout above and after this timeout is hit
# Cuckoo will consider the analysis failed and it will shutdown the machine
# no matter what. When this happens the analysis results will most likely
# be lost.
critical = 60
# Maximum time to wait for virtual machine status change. For example when
# shutting down a vm. Default is 300 seconds.
vm_state = 300
|
{
"pile_set_name": "Github"
}
|
/*
* Copyright 2003-2018 JetBrains s.r.o.
*
* 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 jetbrains.mps.idea.java.psi;
import com.intellij.openapi.project.Project;
import com.intellij.psi.PsiClass;
import com.intellij.psi.PsiCodeBlock;
import com.intellij.psi.PsiDirectory;
import com.intellij.psi.PsiElement;
import com.intellij.psi.PsiExpression;
import com.intellij.psi.PsiField;
import com.intellij.psi.PsiFile;
import com.intellij.psi.PsiFileSystemItem;
import com.intellij.psi.PsiJavaFile;
import com.intellij.psi.PsiMethod;
import com.intellij.psi.PsiModifier;
import com.intellij.psi.PsiModifierList;
import com.intellij.psi.PsiParameter;
import com.intellij.psi.PsiParameterList;
import com.intellij.psi.PsiReferenceList;
import com.intellij.psi.PsiTreeChangeEvent;
import com.intellij.psi.PsiTypeParameter;
import com.intellij.psi.PsiTypeParameterList;
import com.intellij.psi.PsiWhiteSpace;
import jetbrains.mps.ide.platform.watching.ReloadParticipant;
import jetbrains.mps.idea.java.psi.JavaPsiListener.FSMove;
import jetbrains.mps.idea.java.psi.JavaPsiListener.FSRename;
import jetbrains.mps.idea.java.psi.JavaPsiListener.PsiEvent;
import org.jetbrains.annotations.NotNull;
import org.jetbrains.mps.openapi.util.ProgressMonitor;
import java.util.HashMap;
import java.util.HashSet;
import java.util.Map;
import java.util.Map.Entry;
import java.util.Set;
/**
* danilla 5/25/13
*/
public class PsiChangeProcessor extends ReloadParticipant {
// Per project change data
// The thing is there's only one instance of reload participant for a given participant class,
// whereas PsiChangesWatcher is a project component (as PsiManager)
private Map<Project, PsiChangeData> changeData = new HashMap<Project, PsiChangeData>();
public PsiChangeProcessor() {
}
@Override
public boolean wantsToShowProgress() {
// we'll not request progress indicator for psi updates
return false;
}
// TODO look with what locks is it called
@Override
public void update(ProgressMonitor monitor) {
monitor.start("PSI update", changeData.size() + 1);
try {
for (Entry<Project, PsiChangeData> e : changeData.entrySet()) {
final Project project = e.getKey();
final PsiChangeData change = e.getValue();
// we do update asynchronously, so we want to check if project is live yet
if (project.isDisposed()) {
continue;
}
project.getComponent(PsiChangesWatcher.class).notifyListeners(change);
monitor.advance(1);
}
} finally {
// clean-up
changeData = new HashMap<>();
}
monitor.done();
}
@Override
public boolean isEmpty() {
for (PsiChangeData data : changeData.values()) {
if (data.isNotEmpty()) {
return false;
}
}
return true;
}
// The following methods are called by PsiChangesWatcher when it receives a PSI event
// We're not PsiTreeChangeAdapter ourselves for a reason:
// we're a ReloadParticipant => we can be instantiated by ReloadManager itself and there's only
// one instance of us per application, whereas psi listeners exist per project (as well as PsiManager)
// todo filter out changes not related to stub structure
/*package*/ void childAdded(final PsiTreeChangeEvent event) {
if (!filter(event.getChild())) return;
PsiChangeData data = projectData(event.getChild());
PsiElement elem = event.getChild();
if (elem instanceof PsiFileSystemItem) {
data.created.add((PsiFileSystemItem) elem);
} else {
data.changed.add(elem.getContainingFile());
}
}
/*package*/ void childRemoved(PsiTreeChangeEvent event) {
if (!(event.getChild() instanceof PsiFileSystemItem)
&& !filter(event.getParent())) { // can't use getChild() here as it's not valid any longer
return;
}
// so, if fs item or passed filtering then proceed
PsiChangeData data = projectData(event.getParent());
PsiElement elem = event.getChild();
if (elem instanceof PsiFileSystemItem) {
data.removed.add((PsiFileSystemItem) elem);
} else {
// todo fix is parent is a file itself
data.changed.add(event.getParent().getContainingFile());
}
}
/*package*/ void childReplaced(PsiTreeChangeEvent event) {
// if both are uninteresting, only then ignore
if (!filter(event.getOldChild()) && !filter(event.getNewChild())) return;
PsiChangeData data = projectData(event.getNewChild());
// todo Q: should we check if it's PsiFile?
data.changed.add(event.getNewChild().getContainingFile());
}
/*package*/ void childrenChanged(PsiTreeChangeEvent event) {
if (!filter(event.getParent())) return;
if (event.getParent() instanceof PsiFile) {
// it's some generic notification, we don't need it
// (don't remember already what that means)
return;
}
PsiChangeData data = projectData(event.getParent());
data.changed.add(event.getParent().getContainingFile());
}
/*package*/ void childMoved(@NotNull PsiTreeChangeEvent event) {
if (!filter(event.getChild())) return;
PsiChangeData data = projectData(event.getChild());
PsiElement elem = event.getChild();
if (elem instanceof PsiFileSystemItem) {
// file item;
data.moved.add(new FSMove((PsiFileSystemItem) elem, (PsiFileSystemItem) event.getOldParent(), (PsiFileSystemItem) event.getNewParent()));
} else {
// todo what if old/new parent is PsiFileSystemItem ?
data.changed.add(event.getOldParent().getContainingFile());
data.changed.add(event.getNewParent().getContainingFile());
}
}
/*package*/ void propertyChanged(@NotNull PsiTreeChangeEvent event) {
if (!(event.getElement() instanceof PsiFileSystemItem
&& (PsiTreeChangeEvent.PROP_FILE_NAME.equals(event.getPropertyName())
|| PsiTreeChangeEvent.PROP_DIRECTORY_NAME.equals(event.getPropertyName()))) ) {
return;
}
PsiChangeData data = projectData(event.getElement());
FSRename rename = new FSRename((PsiFileSystemItem) event.getElement(), (String) event.getOldValue());
data.renamed.add(rename);
}
private PsiChangeData projectData(PsiElement subject) {
Project project = subject.getProject();
PsiChangeData data = changeData.get(project);
if (data == null) {
data = new PsiChangeData();
changeData.put(project, data);
}
return data;
}
private boolean filter(PsiElement elem) {
if (elem == null || elem instanceof PsiWhiteSpace) {
return false;
|
{
"pile_set_name": "Github"
}
|
package cnab
import (
"testing"
"github.com/docker/cli/cli/command"
cliflags "github.com/docker/cli/cli/flags"
"gotest.tools/assert"
)
func TestRequiresBindMount(t *testing.T) {
dockerCli, err := command.NewDockerCli()
assert.NilError(t, err)
err = dockerCli.Initialize(cliflags.NewClientOptions())
assert.NilError(t, err)
testCases := []struct {
name string
targetContextName string
targetOrchestrator string
expectedRequired bool
expectedEndpoint string
expectedError string
}{
{
name: "kubernetes-orchestrator",
targetContextName: "target-context",
targetOrchestrator: "kubernetes",
expectedRequired: false,
expectedEndpoint: "",
expectedError: "",
},
{
name: "no-context",
targetContextName: "",
targetOrchestrator: "swarm",
expectedRequired: true,
expectedEndpoint: "/var/run/docker.sock",
expectedError: "",
},
}
for _, testCase := range testCases {
t.Run(testCase.name, func(t *testing.T) {
result, err := RequiredBindMount(testCase.targetContextName, testCase.targetOrchestrator, dockerCli.ContextStore())
if testCase.expectedError == "" {
assert.NilError(t, err)
} else {
assert.Error(t, err, testCase.expectedError)
}
assert.Equal(t, testCase.expectedRequired, result.required)
assert.Equal(t, testCase.expectedEndpoint, result.endpoint)
})
}
}
func TestIsDockerHostLocal(t *testing.T) {
testCases := []struct {
name string
host string
expected bool
}{
{
name: "not-local",
host: "tcp://not.local.host",
expected: false,
},
{
name: "no-endpoint",
host: "",
expected: true,
},
{
name: "docker-sock",
host: "unix:///var/run/docker.sock",
expected: true,
},
{
name: "named-pipe",
host: "npipe:////./pipe/docker_engine",
expected: true,
},
}
for _, testCase := range testCases {
t.Run(testCase.name, func(t *testing.T) {
assert.Equal(t, testCase.expected, isDockerHostLocal(testCase.host))
})
}
}
func TestSocketPath(t *testing.T) {
testCases := []struct {
name string
host string
expected string
}{
{
name: "unixSocket",
host: "unix:///my/socket.sock",
expected: "/my/socket.sock",
},
{
name: "namedPipe",
host: "npipe:////./docker",
expected: "/var/run/docker.sock",
},
{
name: "emptyHost",
host: "",
expected: "/var/run/docker.sock",
},
{
name: "tcpHost",
host: "tcp://my/tcp/endpoint",
expected: "/var/run/docker.sock",
},
}
for _, testCase := range testCases {
t.Run(testCase.name, func(t *testing.T) {
assert.Equal(t, testCase.expected, socketPath(testCase.host))
})
}
}
|
{
"pile_set_name": "Github"
}
|
Branch
|
{
"pile_set_name": "Github"
}
|
<!DOCTYPE html>
<html>
<head>
</head>
<body style="font-family: Arial;">
<h1 style="border: 1px solid #ccc; color: red;">Hi</h1>
<table>
<tr>
<td class="headline" style="font-size: 24px; padding: 5px;">Some Headline</td>
</tr>
</table>
</body>
</html>
|
{
"pile_set_name": "Github"
}
|
cheats = 2
cheat0_desc = "Extra Characters"
cheat0_enable = false
cheat0_code = "8113A488 1000;8113A48A 07FF;8113A48C 2000;8113A48E 3FFF"
cheat1_desc = "Infinite Creation Points"
cheat1_enable = false
cheat1_code = "80136245 0000"
|
{
"pile_set_name": "Github"
}
|
// RUN: %clang_cc1 -verify -fopenmp %s
// RUN: %clang_cc1 -verify -fopenmp-simd %s
void foo() {
}
bool foobool(int argc) {
return argc;
}
struct S1; // expected-note 2 {{declared here}} expected-note 2 {{forward declaration of 'S1'}}
extern S1 a;
class S2 {
mutable int a;
public:
S2() : a(0) {}
};
const S2 b;
const S2 ba[5];
class S3 {
int a;
public:
S3() : a(0) {}
};
const S3 ca[5];
class S4 {
int a;
S4(); // expected-note {{implicitly declared private here}}
public:
S4(int v) : a(v) {
#pragma omp parallel for private(a) private(this->a)
for (int k = 0; k < v; ++k)
++this->a;
}
};
class S5 {
int a;
S5() : a(0) {} // expected-note {{implicitly declared private here}}
public:
S5(int v) : a(v) {}
S5 &operator=(S5 &s) {
#pragma omp parallel for private(a) private(this->a) private(s.a) // expected-error {{expected variable name or data member of current class}}
for (int k = 0; k < s.a; ++k)
++s.a;
return *this;
}
};
template <typename T>
class S6 {
public:
T a;
S6() : a(0) {}
S6(T v) : a(v) {
#pragma omp parallel for private(a) private(this->a)
for (int k = 0; k < v; ++k)
++this->a;
}
S6 &operator=(S6 &s) {
#pragma omp parallel for private(a) private(this->a) private(s.a) // expected-error {{expected variable name or data member of current class}}
for (int k = 0; k < s.a; ++k)
++s.a;
return *this;
}
};
template <typename T>
class S7 : public T {
T a;
S7() : a(0) {}
public:
S7(T v) : a(v) {
#pragma omp parallel for private(a) private(this->a) private(T::a)
for (int k = 0; k < a.a; ++k)
++this->a.a;
}
S7 &operator=(S7 &s) {
#pragma omp parallel for private(a) private(this->a) private(s.a) private(s.T::a) // expected-error 2 {{expected variable name or data member of current class}}
for (int k = 0; k < s.a.a; ++k)
++s.a.a;
return *this;
}
};
S3 h;
#pragma omp threadprivate(h) // expected-note 2 {{defined as threadprivate or thread local}}
template <class I, class C>
int foomain(I argc, C **argv) {
I e(4);
I g(5);
int i;
int &j = i;
#pragma omp parallel for private // expected-error {{expected '(' after 'private'}}
for (int k = 0; k < argc; ++k)
++k;
#pragma omp parallel for private( // expected-error {{expected expression}} expected-error {{expected ')'}} expected-note {{to match this '('}}
for (int k = 0; k < argc; ++k)
++k;
#pragma omp parallel for private() // expected-error {{expected expression}}
for (int k = 0; k < argc; ++k)
++k;
#pragma omp parallel for private(argc // expected-error {{expected ')'}} expected-note {{to match this '('}}
for (int k = 0; k < argc; ++k)
++k;
#pragma omp parallel for private(argc, // expected-error {{expected expression}} expected-error {{expected ')'}} expected-note {{to match this '('}}
for (int k = 0; k < argc; ++k)
++k;
#pragma omp parallel for private(argc > 0 ? argv[1] : argv[2]) // expected-error {{expected variable name}}
for (int k = 0; k < argc; ++k)
++k;
#pragma omp parallel for private(argc)
for (int k = 0; k < argc; ++k)
++k;
#pragma omp parallel for private(S1) // expected-error {{'S1' does not refer to a value}}
for (int k = 0; k < argc; ++k)
++k;
#pragma omp parallel for private(a, b) // expected-error {{private variable with incomplete type 'S1'}}
for (int k = 0; k < argc; ++k)
++k;
#pragma omp parallel for private(argv[1]) // expected-error {{expected variable name}}
for (int k = 0; k < argc; ++k)
++k;
#pragma omp parallel for private(e, g)
for (int k = 0; k < argc; ++k)
++k;
#pragma omp parallel for private(h) // expected-error {{threadprivate or thread local variable cannot be private}}
for (int k = 0; k < argc; ++k)
++k;
#pragma omp parallel for nowait // expected-error {{unexpected OpenMP clause 'nowait' in directive '#pragma omp parallel for'}}
for (int k = 0; k < argc; ++k)
++k;
#pragma omp parallel
{
int v = 0;
int i;
#pragma omp parallel for private(i)
for (int k = 0; k < argc; ++k) {
i = k;
v += i;
}
}
#pragma omp parallel shared(i)
#pragma omp parallel private(i)
#pragma omp parallel for private(j)
for (int k = 0; k < argc; ++k)
++k;
#pragma omp parallel for private(i)
for (int k = 0; k < argc; ++k)
++k;
return 0;
}
namespace A {
double x;
#pragma omp threadprivate(x) // expected-note {{defined as threadprivate or thread local}}
}
namespace B {
using A::x;
}
int main(int argc, char **argv) {
S4 e(4);
S5 g(5);
S6<float> s6(0.0) , s6_0(1.0);
S7<S6<float> > s7(0.0) , s7_0(1.0);
int i;
int &j = i;
#pragma omp parallel for private // expected-error {{expected '(' after 'private'}}
for (int k = 0; k < argc; ++k)
++k;
#pragma omp parallel for private( // expected-error {{expected expression}} expected-error {{expected ')'}} expected-note {{to match this '('}}
for (int k = 0; k < argc; ++k)
++k;
#pragma omp parallel for private() // expected-error {{expected expression}}
for (int k = 0; k < argc; ++k)
++k;
#pragma omp parallel for private(argc // expected-error {{expected ')'}} expected-note {{to match this '('}}
for (int k = 0; k < argc; ++k)
++k;
#pragma omp parallel for private(argc, // expected-error {{expected expression}} expected-error {{expected ')'}} expected-note {{to match this '('}}
for (int k = 0; k < argc; ++k)
++k;
#pragma omp parallel for private(argc > 0 ? argv[1] : argv[2]) // expected-error {{expected variable name}}
|
{
"pile_set_name": "Github"
}
|
import 'reflect-metadata'
import 'react-dates/initialize'
import 'map.prototype.tojson' // to visualize Map in Redux Dev Tools
import 'set.prototype.tojson' // to visualize Set in Redux Dev Tools
import 'src/helpers/errorPrototypeTojson' // to visualize Error in Redux Dev Tools
import { enableES5 } from 'immer'
import React, { useEffect, useState, Suspense } from 'react'
import { AppProps } from 'next/app'
import { I18nextProvider } from 'react-i18next'
import type { Store } from 'redux'
import { ConnectedRouter } from 'connected-next-router'
import type { Persistor } from 'redux-persist'
import { Layout } from 'src/components/Layout/Layout'
import { ThemeProvider } from 'styled-components'
import { Provider } from 'react-redux'
import { PersistGate } from 'redux-persist/integration/react'
import { MDXProvider } from '@mdx-js/react'
import { initialize } from 'src/initialize'
import { init } from 'src/state/app/init.actions'
import i18n from 'src/i18n/i18n'
import Loading from 'src/components/Loading/Loading'
import { LinkExternal } from 'src/components/Link/LinkExternal'
import { SEO } from 'src/components/Common/SEO'
import { theme } from 'src/theme'
import 'src/styles/global.scss'
enableES5()
export interface AppState {
persistor: Persistor
store: Store
}
export default function MyApp({ Component, pageProps, router }: AppProps) {
const [state, setState] = useState<AppState | undefined>()
useEffect(() => {
initialize({ router })
// eslint-disable-next-line promise/always-return
.then((state: AppState) => {
setState(state)
state.store.dispatch(init())
})
.catch((error: Error) => {
throw error
})
}, [router])
if (!state) {
return <Loading />
}
const { store, persistor } = state
return (
<Suspense fallback={<Loading />}>
<Provider store={store}>
<ConnectedRouter>
<ThemeProvider theme={theme}>
<I18nextProvider i18n={i18n}>
<MDXProvider components={{ a: LinkExternal }}>
<PersistGate loading={<Loading />} persistor={persistor}>
<SEO />
<Layout>
<Component {...pageProps} />
</Layout>
</PersistGate>
</MDXProvider>
</I18nextProvider>
</ThemeProvider>
</ConnectedRouter>
</Provider>
</Suspense>
)
}
|
{
"pile_set_name": "Github"
}
|
/*
* Copyright (C) 2016 Apple 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 APPLE INC. AND ITS 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 APPLE INC. OR ITS CONTRIBUTORS
* BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
* CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
* SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
* INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
* CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
* ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF
* THE POSSIBILITY OF SUCH DAMAGE.
*/
#include "config.h"
#include "TypedArrayCTest.h"
#include "JavaScript.h"
#include <limits.h>
#include <math.h>
#include <stdio.h>
#include <wtf/Assertions.h>
extern "C" void JSSynchronousGarbageCollectForDebugging(JSContextRef);
static void id(void*, void*) { }
static void freePtr(void* ptr, void*)
{
free(ptr);
}
static const unsigned numLengths = 3;
static const unsigned lengths[numLengths] =
{
0,
1,
10,
};
static const unsigned byteSizes[kJSTypedArrayTypeArrayBuffer] =
{
1, // kJSTypedArrayTypeInt8Array
2, // kJSTypedArrayTypeInt16Array
4, // kJSTypedArrayTypeInt32Array
1, // kJSTypedArrayTypeUint8Array
1, // kJSTypedArrayTypeUint8ClampedArray
2, // kJSTypedArrayTypeUint16Array
4, // kJSTypedArrayTypeUint32Array
4, // kJSTypedArrayTypeFloat32Array
8, // kJSTypedArrayTypeFloat64Array
};
static const char* typeToString[kJSTypedArrayTypeArrayBuffer] =
{
"kJSTypedArrayTypeInt8Array",
"kJSTypedArrayTypeInt16Array",
"kJSTypedArrayTypeInt32Array",
"kJSTypedArrayTypeUint8Array",
"kJSTypedArrayTypeUint8ClampedArray",
"kJSTypedArrayTypeUint16Array",
"kJSTypedArrayTypeUint32Array",
"kJSTypedArrayTypeFloat32Array",
"kJSTypedArrayTypeFloat64Array",
};
inline int unexpectedException(const char* name)
{
fprintf(stderr, "%s FAILED: unexpected exception\n", name);
return 1;
}
static int assertEqualsAsNumber(JSGlobalContextRef context, JSValueRef value, double expectedValue)
{
double number = JSValueToNumber(context, value, nullptr);
if (number != expectedValue && !(isnan(number) && isnan(expectedValue))) {
fprintf(stderr, "assertEqualsAsNumber FAILED: %p, %lf\n", value, expectedValue);
return 1;
}
return 0;
}
static int testAccess(JSGlobalContextRef context, JSObjectRef typedArray, JSTypedArrayType type, unsigned elementLength, void* expectedPtr = nullptr, JSObjectRef expectedBuffer = nullptr, unsigned expectedOffset = 0)
{
JSValueRef exception = nullptr;
// Test typedArray basic functions.
JSTypedArrayType actualType = JSValueGetTypedArrayType(context, typedArray, &exception);
if (type != actualType || exception) {
fprintf(stderr, "TypedArray type FAILED: %p, got: %s, expected: %s\n", typedArray, typeToString[actualType], typeToString[type]);
return 1;
}
unsigned length = JSObjectGetTypedArrayLength(context, typedArray, &exception);
if (elementLength != length || exception) {
fprintf(stderr, "TypedArray length FAILED: %p (%s), got: %d, expected: %d\n", typedArray, typeToString[type], length, elementLength);
return 1;
}
unsigned byteLength = JSObjectGetTypedArrayByteLength(context, typedArray, &exception);
unsigned expectedLength = byteSizes[type] * elementLength;
if (byteLength != expectedLength || exception) {
fprintf(stderr, "TypedArray byteLength FAILED: %p (%s), got: %d, expected: %d\n", typedArray, typeToString[type], byteLength, expectedLength);
return 1;
}
unsigned offset = JSObjectGetTypedArrayByteOffset(context, typedArray, &exception);
if (expectedOffset != offset || exception) {
fprintf(stderr, "TypedArray byteOffset FAILED: %p (%s), got: %d, expected: %d\n", typedArray, typeToString[type], offset, expectedOffset);
return 1;
}
void* ptr = JSObjectGetTypedArrayBytesPtr(context, typedArray, &exception);
if (exception)
return unexpectedException("TypedArray get bytes ptr");
JSObjectRef buffer = JSObjectGetTypedArrayBuffer(context, typedArray, &exception);
if (exception)
return unexpectedException("TypedArray get buffer");
void* bufferPtr = JSObjectGetArrayBufferBytesPtr(context, buffer, &exception);
if (exception)
return unexpectedException("ArrayBuffer get bytes ptr");
if (bufferPtr != ptr) {
fprintf(stderr, "FAIL: TypedArray bytes ptr and ArrayBuffer byte ptr were not the same: %p (%s) TypedArray: %p, ArrayBuffer: %p\n", typedArray, typeToString[type], ptr, bufferPtr);
return 1;
}
if (expectedPtr && ptr != expectedPtr) {
fprintf(stderr, "FAIL: TypedArray bytes ptr and the ptr used to construct the array were not the same: %p (%s) TypedArray: %p, bytes ptr: %p\n", typedArray, typeToString[type], ptr, expectedPtr);
return 1;
}
if (expectedBuffer && expectedBuffer != buffer) {
fprintf(stderr, "FAIL: TypedArray buffer and the ArrayBuffer buffer used to construct the array were not the same: %p (%s) TypedArray buffer: %p, data: %p\n", typedArray, typeToString[type], buffer, expectedBuffer);
return 1;
}
return 0;
}
static int testConstructors(JSGlobalContextRef context, JSTypedArrayType type, unsigned length)
{
int failed = 0;
JSValueRef exception = nullptr;
JSObjectRef typedArray;
// Test create with length.
typedArray = JSObjectMakeTypedArray(context, type, length, &exception);
failed = failed || exception || testAccess(context, typedArray, type, length);
void* ptr = calloc(length, byteSizes[type]); // This is to be freed by data
JSObjectRef data = JSObjectMakeArrayBufferWithBytesNoCopy(context, ptr, length * byteSizes[type], freePtr, nullptr, &exception);
failed = failed || exception;
// Test create with existing ptr.
typedArray = JSObjectMakeTypedArrayWithBytesNoCopy(context, type, ptr, length * byteSizes[type], id, nullptr, &exception);
failed = failed || exception || testAccess(context, typedArray, type, length, ptr);
// Test create with existing ArrayBuffer.
typedArray = JSObjectMakeTypedArrayWithArrayBuffer(context, type, data, &exception);
failed = failed || exception || testAccess(context, typedArray, type, length, ptr, data);
// Test create with existing ArrayBuffer and offset.
|
{
"pile_set_name": "Github"
}
|
'use strict'
var consoleControl = require('console-control-strings')
var ThemeSet = require('./theme-set.js')
var themes = module.exports = new ThemeSet()
themes.addTheme('ASCII', {
preProgressbar: '[',
postProgressbar: ']',
progressbarTheme: {
complete: '#',
remaining: '.'
},
activityIndicatorTheme: '-\\|/',
preSubsection: '>'
})
themes.addTheme('colorASCII', themes.getTheme('ASCII'), {
progressbarTheme: {
preComplete: consoleControl.color('inverse'),
complete: ' ',
postComplete: consoleControl.color('stopInverse'),
preRemaining: consoleControl.color('brightBlack'),
remaining: '.',
postRemaining: consoleControl.color('reset')
}
})
themes.addTheme('brailleSpinner', {
preProgressbar: '⸨',
postProgressbar: '⸩',
progressbarTheme: {
complete: '░',
remaining: '⠂'
},
activityIndicatorTheme: '⠋⠙⠹⠸⠼⠴⠦⠧⠇⠏',
preSubsection: '>'
})
themes.addTheme('colorBrailleSpinner', themes.getTheme('brailleSpinner'), {
progressbarTheme: {
preComplete: consoleControl.color('inverse'),
complete: ' ',
postComplete: consoleControl.color('stopInverse'),
preRemaining: consoleControl.color('brightBlack'),
remaining: '░',
postRemaining: consoleControl.color('reset')
}
})
themes.setDefault({}, 'ASCII')
themes.setDefault({hasColor: true}, 'colorASCII')
themes.setDefault({platform: 'darwin', hasUnicode: true}, 'brailleSpinner')
themes.setDefault({platform: 'darwin', hasUnicode: true, hasColor: true}, 'colorBrailleSpinner')
|
{
"pile_set_name": "Github"
}
|
<?xml version="1.0" encoding="UTF-8"?>
<!--
Licensed to the Apache Software Foundation (ASF) under one or more
contributor license agreements. See the NOTICE file distributed with
this work for additional information regarding copyright ownership.
The ASF licenses this file to You under the Apache License, Version 2.0
(the "License"); you may not use this file except in compliance with
the License. You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
-->
<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/maven-v4_0_0.xsd">
<modelVersion>4.0.0</modelVersion>
<parent>
<groupId>org.apache.camel</groupId>
<artifactId>components</artifactId>
<version>3.6.0-SNAPSHOT</version>
</parent>
<artifactId>camel-lucene</artifactId>
<packaging>jar</packaging>
<name>Camel :: Lucene</name>
<description>Camel Lucene based search component</description>
<properties>
<camel.osgi.import.additional>
org.apache.lucene.*;version="${lucene-version-range}"
</camel.osgi.import.additional>
</properties>
<dependencies>
<dependency>
<groupId>org.apache.camel</groupId>
<artifactId>camel-support</artifactId>
</dependency>
<dependency>
<groupId>org.apache.lucene</groupId>
<artifactId>lucene-core</artifactId>
<version>${lucene-version}</version>
</dependency>
<dependency>
<groupId>org.apache.lucene</groupId>
<artifactId>lucene-queryparser</artifactId>
<version>${lucene-version}</version>
</dependency>
<dependency>
<groupId>org.apache.lucene</groupId>
<artifactId>lucene-analyzers-common</artifactId>
<version>${lucene-version}</version>
</dependency>
<!-- test dependencies -->
<dependency>
<groupId>org.apache.camel</groupId>
<artifactId>camel-test-junit5</artifactId>
<scope>test</scope>
</dependency>
<dependency>
<groupId>org.junit.jupiter</groupId>
<artifactId>junit-jupiter</artifactId>
<scope>test</scope>
</dependency>
<dependency>
<groupId>org.apache.logging.log4j</groupId>
<artifactId>log4j-slf4j-impl</artifactId>
<scope>test</scope>
</dependency>
</dependencies>
<build>
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-clean-plugin</artifactId>
<configuration>
<filesets>
<fileset>
<directory>${basedir}/res</directory>
</fileset>
</filesets>
</configuration>
</plugin>
</plugins>
</build>
</project>
|
{
"pile_set_name": "Github"
}
|
package com.cheng.improve151suggest;
import android.os.Bundle;
import android.support.v7.app.AppCompatActivity;
import android.widget.ListView;
import java.util.Arrays;
import com.cheng.highqualitycodestudy.R;
import com.cheng.improve151suggest.adapter.I151SuggestListAdapter;
/**
第10章 性能和效率
建议132: 提升java性能的基本方法
建议133: 若非必要,不要克隆对象
建议134: 推荐使用“望闻问切”的方式诊断性能
建议135: 必须定义性能衡量标准
建议136: 枪打出头鸟—解决首要系统性能问题
建议137: 调整jvm参数以提升性能
建议138: 性能是个大“咕咚”
*/
public class I151SChapter10Activity extends AppCompatActivity {
private static final String TAG = "I151SChapter10Activity";
private ListView mChapterLV;
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_i151suggestchapter);
initView();
initData();
}
private void initView() {
this.mChapterLV = (ListView) findViewById(R.id.isi_chapter_lv);
}
private void initData() {
String[] suggests = getResources().getStringArray(R.array.i151schapter10);
I151SuggestListAdapter adapter = new I151SuggestListAdapter(this, Arrays.asList(suggests));
mChapterLV.setAdapter(adapter);
}
/**
* 建议132: 提升java性能的基本方法
*/
private void suggest132() {
/*
1)不要在循环条件中计算
如果在循环(如for循环、while循环)条件中计算,则每循环一遍就要计算一次,这会降低系统效率
2)尽可能把变量、方法声明为final static类型
假设要将阿拉伯数字转换为中文数字,其定义如下:
public String toChineseNum(int num) {
// 中文数字
String[] cns = {"零", "壹", "贰", "叁", "肆", "伍", "陆", "柒", "捌", "玖"};
return cns[num];
}
每次调用该方法时都会重新生成一个cns数组,注意该数组不会改变,属于不变数组,在这种情况下,把它声
明为类变量,并且加上final static修饰会更合适,在类加载后就生成了该数组,每次方法调用则不再重新
生成数组对象了,这有助于提高系统性能,代码如下:
// 声明为类变量
final static String[] cns = {"零", "壹", "贰", "叁", "肆", "伍", "陆", "柒", "捌", "玖"};
public String toChineseNum(int num) {
return cns[num];
}
3)缩小变量的作用范围
关于变量,能定义在方法内的就定义在方法内,能定义在一个循环体内的就定义在循环体内,能放置在一个
try...catch块内的就放置在该块内,其目的是加快GC的回收
4)频繁字符串操作使用StringBuilder或StringBuffer
虽然String的联接操作(“+”号)已经做了很多优化,但在大量的追加操作上StringBuilder或StringBuffer
还是比“+”号的性能好很多
5)使用非线性检索
如果在ArrayList中存储了大量的数据,使用indexOf查找元素会比java.utils.Collections.binarySearch
的效率低很多,原因是binarySearch是二分搜索法,而indexOf使用的是逐个元素对比的方法。这里要注意:
使用binarySearch搜索时,元素必须进行排序,否则准确性就不可靠了
6)覆写Exception的fillInStackTrace方法
fillInStackTrace方法是用来记录异常时的栈信息的,这是非常耗时的动作,如果在开发时不需要关注栈信
息,则可以覆盖之,如下覆盖fillInStackTrace的自定义异常会使性能提升10倍以上:
class MyException extends Exception {
public Throwable fillInStackTrace() {
return this;
}
}
7)不要建立冗余对象
不需要建立的对象就不能建立,说起来很容易,要完全遵循此规则难度就很大了,我们经常就会无意地创建冗
余对象,例如这样一段代码:
public void doSomething() {
// 异常信息
String exceptionMsg = "我出现异常了,快来救救我";
try {
Thread.sleep(10);
} catch (Exception e) {
// 转换为自定义运行期异常
throw new MyException(e, exceptionMsg);
}
}
注意看变量exceptionMsg,这个字符串变量在什么时候会被用到?只有在抛出异常时它才有用武之地,那它
是什么时候创建的呢?只要该方法被调用就创建,不管会不会抛出异常。我们知道异常不是我们的主逻辑,不
是我们代码必须或经常要到达的区域,那位了这个不经常出现的场景就每次都多定义一个字符串变量,合适吗?
而且还要占用更多的内存!所以,在catch块中定义exceptionMsg才是正道:需要的时候才创建对象
我们知道运行一段程序需要三种资源:CPU、内存、I/O,提升CPU的处理速度可以加快代码的执行速度,直接
变现就是返回时间缩短了,效率提交了;内存是Java程序必须考虑的问题,在32位的机器上,一个JVM最多只
能使用2GB的内存,而且程序占用的内存越大,寻址效率也就越低,这也是影响效率的一个因素。I/O是程序展
示和存储数据的主要通道,如果它很缓慢就会影响正常的显式效果。所以我们在编程时需要从这三个方面入手
*/
/**
* 注意
* Java
|
{
"pile_set_name": "Github"
}
|
{
"pagination": {
"GetBotAliases": {
"input_token": "nextToken",
"output_token": "nextToken",
"limit_key": "maxResults"
},
"GetBotChannelAssociations": {
"input_token": "nextToken",
"output_token": "nextToken",
"limit_key": "maxResults"
},
"GetBotVersions": {
"input_token": "nextToken",
"output_token": "nextToken",
"limit_key": "maxResults"
},
"GetBots": {
"input_token": "nextToken",
"output_token": "nextToken",
"limit_key": "maxResults"
},
"GetBuiltinIntents": {
"input_token": "nextToken",
"output_token": "nextToken",
"limit_key": "maxResults"
},
"GetBuiltinSlotTypes": {
"input_token": "nextToken",
"output_token": "nextToken",
"limit_key": "maxResults"
},
"GetIntentVersions": {
"input_token": "nextToken",
"output_token": "nextToken",
"limit_key": "maxResults"
},
"GetIntents": {
"input_token": "nextToken",
"output_token": "nextToken",
"limit_key": "maxResults"
},
"GetSlotTypeVersions": {
"input_token": "nextToken",
"output_token": "nextToken",
"limit_key": "maxResults"
},
"GetSlotTypes": {
"input_token": "nextToken",
"output_token": "nextToken",
"limit_key": "maxResults"
}
}
}
|
{
"pile_set_name": "Github"
}
|
//--------------------------------------------------------------------------
// Copyright (C) 2015-2020 Cisco and/or its affiliates. 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 as published
// by the Free Software Foundation. You may not use, modify or distribute
// this program under any other version of the GNU General Public License.
//
// This program is distributed in the hope that it will be useful, but
// WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
// General Public License for more details.
//
// You should have received a copy of the GNU General Public License along
// with this program; if not, write to the Free Software Foundation, Inc.,
// 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
//--------------------------------------------------------------------------
// pp_ips_action_iface.h author Joel Cornett <jocornet@cisco.com>
#ifndef PP_IPS_ACTION_IFACE_H
#define PP_IPS_ACTION_IFACE_H
#include "lua/lua_iface.h"
namespace snort
{
class IpsAction;
}
extern const struct Lua::InstanceInterface<snort::IpsAction> IpsActionIface;
#endif
|
{
"pile_set_name": "Github"
}
|
# ===================================================================
#
# Copyright (c) 2014, Legrandin <helderijs@gmail.com>
# All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions
# are met:
#
# 1. Redistributions of source code must retain the above copyright
# notice, this list of conditions and the following disclaimer.
# 2. Redistributions in binary form must reproduce the above copyright
# notice, this list of conditions and the following disclaimer in
# the documentation and/or other materials provided with the
# distribution.
#
# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
# "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
# LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
# FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
# COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
# INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,
# BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
# LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
# CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
# LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN
# ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
# POSSIBILITY OF SUCH DAMAGE.
# ===================================================================
import unittest
from binascii import unhexlify
from Crypto.SelfTest.loader import load_tests
from Crypto.SelfTest.st_common import list_test_cases
from Crypto.Util.py3compat import tobytes, _memoryview, is_string
from Crypto.Cipher import AES, DES3, DES
from Crypto.Hash import SHAKE128
def get_tag_random(tag, length):
return SHAKE128.new(data=tobytes(tag)).read(length)
class BlockChainingTests(unittest.TestCase):
key_128 = get_tag_random("key_128", 16)
key_192 = get_tag_random("key_192", 24)
iv_128 = get_tag_random("iv_128", 16)
iv_64 = get_tag_random("iv_64", 8)
data_128 = get_tag_random("data_128", 16)
def test_loopback_128(self):
cipher = AES.new(self.key_128, self.aes_mode, self.iv_128)
pt = get_tag_random("plaintext", 16 * 100)
ct = cipher.encrypt(pt)
cipher = AES.new(self.key_128, self.aes_mode, self.iv_128)
pt2 = cipher.decrypt(ct)
self.assertEqual(pt, pt2)
def test_loopback_64(self):
cipher = DES3.new(self.key_192, self.des3_mode, self.iv_64)
pt = get_tag_random("plaintext", 8 * 100)
ct = cipher.encrypt(pt)
cipher = DES3.new(self.key_192, self.des3_mode, self.iv_64)
pt2 = cipher.decrypt(ct)
self.assertEqual(pt, pt2)
def test_iv(self):
# If not passed, the iv is created randomly
cipher = AES.new(self.key_128, self.aes_mode)
iv1 = cipher.iv
cipher = AES.new(self.key_128, self.aes_mode)
iv2 = cipher.iv
self.assertNotEqual(iv1, iv2)
self.assertEqual(len(iv1), 16)
# IV can be passed in uppercase or lowercase
cipher = AES.new(self.key_128, self.aes_mode, self.iv_128)
ct = cipher.encrypt(self.data_128)
cipher = AES.new(self.key_128, self.aes_mode, iv=self.iv_128)
self.assertEquals(ct, cipher.encrypt(self.data_128))
cipher = AES.new(self.key_128, self.aes_mode, IV=self.iv_128)
self.assertEquals(ct, cipher.encrypt(self.data_128))
def test_iv_must_be_bytes(self):
self.assertRaises(TypeError, AES.new, self.key_128, self.aes_mode,
iv = u'test1234567890-*')
def test_only_one_iv(self):
# Only one IV/iv keyword allowed
self.assertRaises(TypeError, AES.new, self.key_128, self.aes_mode,
iv=self.iv_128, IV=self.iv_128)
def test_iv_with_matching_length(self):
self.assertRaises(ValueError, AES.new, self.key_128, self.aes_mode,
b"")
self.assertRaises(ValueError, AES.new, self.key_128, self.aes_mode,
self.iv_128[:15])
self.assertRaises(ValueError, AES.new, self.key_128, self.aes_mode,
self.iv_128 + b"0")
def test_block_size_128(self):
cipher = AES.new(self.key_128, self.aes_mode, self.iv_128)
self.assertEqual(cipher.block_size, AES.block_size)
def test_block_size_64(self):
cipher = DES3.new(self.key_192, self.des3_mode, self.iv_64)
self.assertEqual(cipher.block_size, DES3.block_size)
def test_unaligned_data_128(self):
cipher = AES.new(self.key_128, self.aes_mode, self.iv_128)
for wrong_length in range(1,16):
self.assertRaises(ValueError, cipher.encrypt, b"5" * wrong_length)
cipher = AES.new(self.key_128, self.aes_mode, self.iv_128)
for wrong_length in range(1,16):
self.assertRaises(ValueError, cipher.decrypt, b"5" * wrong_length)
def test_unaligned_data_64(self):
cipher = DES3.new(self.key_192, self.des3_mode, self.iv_64)
for wrong_length in range(1,8):
self.assertRaises(ValueError, cipher.encrypt, b"5" * wrong_length)
cipher = DES3.new(self.key_192, self.des3_mode, self.iv_64)
for wrong_length in range(1,8):
self.assertRaises(ValueError, cipher.decrypt, b"5" * wrong_length)
def test_IV_iv_attributes(self):
data = get_tag_random("data", 16 * 100)
for func in "encrypt", "decrypt":
cipher = AES.new(self.key_128, self.aes_mode, self.iv_128)
getattr(cipher, func)(data)
self.assertEqual(cipher.iv, self.iv_128)
self.assertEqual(cipher.IV, self.iv_128)
def test_unknown_parameters(self):
self.assertRaises(TypeError, AES.new, self.key_128, self.aes_mode,
self.iv_128, 7)
self.assertRaises(TypeError, AES.new, self.key_128, self.aes_mode,
iv=self.iv_128, unknown=7)
# But some are only known by the base cipher (e.g. use_aesni consumed by the AES module)
AES.new(self.key_128, self.aes_mode, iv=self.iv_128, use_aesni=False)
def test_null_encryption_decryption(self):
for func in "encrypt", "decrypt":
cipher = AES.new(self.key_128, self.aes_mode, self.iv_128)
result = getattr(cipher, func)(b"")
self.assertEqual(result, b"")
def test_either_encrypt_or_decrypt
|
{
"pile_set_name": "Github"
}
|
// +build windows
package winio
import (
"syscall"
"unsafe"
)
//sys lookupAccountName(systemName *uint16, accountName string, sid *byte, sidSize *uint32, refDomain *uint16, refDomainSize *uint32, sidNameUse *uint32) (err error) = advapi32.LookupAccountNameW
//sys convertSidToStringSid(sid *byte, str **uint16) (err error) = advapi32.ConvertSidToStringSidW
//sys convertStringSecurityDescriptorToSecurityDescriptor(str string, revision uint32, sd *uintptr, size *uint32) (err error) = advapi32.ConvertStringSecurityDescriptorToSecurityDescriptorW
//sys convertSecurityDescriptorToStringSecurityDescriptor(sd *byte, revision uint32, secInfo uint32, sddl **uint16, sddlSize *uint32) (err error) = advapi32.ConvertSecurityDescriptorToStringSecurityDescriptorW
//sys localFree(mem uintptr) = LocalFree
//sys getSecurityDescriptorLength(sd uintptr) (len uint32) = advapi32.GetSecurityDescriptorLength
const (
cERROR_NONE_MAPPED = syscall.Errno(1332)
)
type AccountLookupError struct {
Name string
Err error
}
func (e *AccountLookupError) Error() string {
if e.Name == "" {
return "lookup account: empty account name specified"
}
var s string
switch e.Err {
case cERROR_NONE_MAPPED:
s = "not found"
default:
s = e.Err.Error()
}
return "lookup account " + e.Name + ": " + s
}
type SddlConversionError struct {
Sddl string
Err error
}
func (e *SddlConversionError) Error() string {
return "convert " + e.Sddl + ": " + e.Err.Error()
}
// LookupSidByName looks up the SID of an account by name
func LookupSidByName(name string) (sid string, err error) {
if name == "" {
return "", &AccountLookupError{name, cERROR_NONE_MAPPED}
}
var sidSize, sidNameUse, refDomainSize uint32
err = lookupAccountName(nil, name, nil, &sidSize, nil, &refDomainSize, &sidNameUse)
if err != nil && err != syscall.ERROR_INSUFFICIENT_BUFFER {
return "", &AccountLookupError{name, err}
}
sidBuffer := make([]byte, sidSize)
refDomainBuffer := make([]uint16, refDomainSize)
err = lookupAccountName(nil, name, &sidBuffer[0], &sidSize, &refDomainBuffer[0], &refDomainSize, &sidNameUse)
if err != nil {
return "", &AccountLookupError{name, err}
}
var strBuffer *uint16
err = convertSidToStringSid(&sidBuffer[0], &strBuffer)
if err != nil {
return "", &AccountLookupError{name, err}
}
sid = syscall.UTF16ToString((*[0xffff]uint16)(unsafe.Pointer(strBuffer))[:])
localFree(uintptr(unsafe.Pointer(strBuffer)))
return sid, nil
}
func SddlToSecurityDescriptor(sddl string) ([]byte, error) {
var sdBuffer uintptr
err := convertStringSecurityDescriptorToSecurityDescriptor(sddl, 1, &sdBuffer, nil)
if err != nil {
return nil, &SddlConversionError{sddl, err}
}
defer localFree(sdBuffer)
sd := make([]byte, getSecurityDescriptorLength(sdBuffer))
copy(sd, (*[0xffff]byte)(unsafe.Pointer(sdBuffer))[:len(sd)])
return sd, nil
}
func SecurityDescriptorToSddl(sd []byte) (string, error) {
var sddl *uint16
// The returned string length seems to including an aribtrary number of terminating NULs.
// Don't use it.
err := convertSecurityDescriptorToStringSecurityDescriptor(&sd[0], 1, 0xff, &sddl, nil)
if err != nil {
return "", err
}
defer localFree(uintptr(unsafe.Pointer(sddl)))
return syscall.UTF16ToString((*[0xffff]uint16)(unsafe.Pointer(sddl))[:]), nil
}
|
{
"pile_set_name": "Github"
}
|
'use strict';
angular.module("ngLocale", [], ["$provide", function($provide) {
var PLURAL_CATEGORY = {ZERO: "zero", ONE: "one", TWO: "two", FEW: "few", MANY: "many", OTHER: "other"};
function getDecimals(n) {
n = n + '';
var i = n.indexOf('.');
return (i == -1) ? 0 : n.length - i - 1;
}
function getVF(n, opt_precision) {
var v = opt_precision;
if (undefined === v) {
v = Math.min(getDecimals(n), 3);
}
var base = Math.pow(10, v);
var f = ((n * base) | 0) % base;
return {v: v, f: f};
}
$provide.value("$locale", {
"DATETIME_FORMATS": {
"AMPMS": [
"prije podne",
"popodne"
],
"DAY": [
"nedjelja",
"ponedjeljak",
"utorak",
"srijeda",
"\u010detvrtak",
"petak",
"subota"
],
"ERANAMES": [
"Prije nove ere",
"Nove ere"
],
"ERAS": [
"p. n. e.",
"n. e."
],
"FIRSTDAYOFWEEK": 0,
"MONTH": [
"januar",
"februar",
"mart",
"april",
"maj",
"juni",
"juli",
"august",
"septembar",
"oktobar",
"novembar",
"decembar"
],
"SHORTDAY": [
"ned",
"pon",
"uto",
"sri",
"\u010det",
"pet",
"sub"
],
"SHORTMONTH": [
"jan",
"feb",
"mar",
"apr",
"maj",
"jun",
"jul",
"aug",
"sep",
"okt",
"nov",
"dec"
],
"STANDALONEMONTH": [
"januar",
"februar",
"mart",
"april",
"maj",
"juni",
"juli",
"august",
"septembar",
"oktobar",
"novembar",
"decembar"
],
"WEEKENDRANGE": [
5,
6
],
"fullDate": "EEEE, dd. MMMM y.",
"longDate": "dd. MMMM y.",
"medium": "dd. MMM. y. HH:mm:ss",
"mediumDate": "dd. MMM. y.",
"mediumTime": "HH:mm:ss",
"short": "dd.MM.yy. HH:mm",
"shortDate": "dd.MM.yy.",
"shortTime": "HH:mm"
},
"NUMBER_FORMATS": {
"CURRENCY_SYM": "KM",
"DECIMAL_SEP": ",",
"GROUP_SEP": ".",
"PATTERNS": [
{
"gSize": 3,
"lgSize": 3,
"maxFrac": 3,
"minFrac": 0,
"minInt": 1,
"negPre": "-",
"negSuf": "",
"posPre": "",
"posSuf": ""
},
{
"gSize": 3,
"lgSize": 3,
"maxFrac": 2,
"minFrac": 2,
"minInt": 1,
"negPre": "-",
"negSuf": "\u00a0\u00a4",
"posPre": "",
"posSuf": "\u00a0\u00a4"
}
]
},
"id": "bs",
"localeID": "bs",
"pluralCat": function(n, opt_precision) { var i = n | 0; var vf = getVF(n, opt_precision); if (vf.v == 0 && i % 10 == 1 && i % 100 != 11 || vf.f % 10 == 1 && vf.f % 100 != 11) { return PLURAL_CATEGORY.ONE; } if (vf.v == 0 && i % 10 >= 2 && i % 10 <= 4 && (i % 100 < 12 || i % 100 > 14) || vf.f % 10 >= 2 && vf.f % 10 <= 4 && (vf.f % 100 < 12 || vf.f % 100 > 14)) { return PLURAL_CATEGORY.FEW; } return PLURAL_CATEGORY.OTHER;}
});
}]);
|
{
"pile_set_name": "Github"
}
|
CC-P3-OTTERBOX-OBIPHONE4
CC-P3-OTTERBOX-OBIPHONE5
CC-P3-BELKIN-SILBLKIPH4
CC-P3-BELKIN-SILBLKIPH5
CC-P3-APPLE-BUMPIPHONE4
CC-P4-OTTERBOX-OBDROID4
CC-T7-ZAGG-FOLIOMINI
CC-T7-BELKIN-SLEEVE
CC-T10-RIM-BBERRYPLAY
CC-T11-ZAGG-FOLIO
CC-T11-BELKIN-SLEEVE
DP-IPHONE4
DP-IPHONE5
DP-NOKLUMIA
DP-HTCONE
DP-HTCREZOUND
DP-HTCDROIDINC
DP-MOTDROID2
DP-MOTDROID3
DP-MOTDROIDRAZ
DP-SAMSGALAX
DP-SAMSGALAX3
DP-SAMSGALAX4
DP-SAMSGALAXTAB
BT-HS-BEATSWIRELESS
BT-HS-PLANT-M25
BT-HS-PLANT-VOYLEGEND
BT-HS-JAWB-ICONTHD
BT-HS-JABRA-WAVE
BT-HS-SAMS-HM1300
BT-SP-JAWB-JAMBOX
BT-SP-JAWB-JAMBOXBIG
BT-SP-BOSESNDLNK2
BT-KB-LOGITECH
BT-MO-MOT-BTMOUSE
BT-CK-JABRA-FREEWAY
BT-CK-D-ROADSTER2
BA-MOPHIE-JUICEPACKPLUS
BA-MOPHIE-JUICEPACKAIR
BA-NOK-LUMIA
BA-HTC-REZOUND
BA-SAMS-STELLAR
MC-SANDISK-MICROSD4GB
MC-SANDISK-MICROSD8GB
MC-SANDISK-MICROSD16GB
MC-SANDISK-MICROSD32GB
MC-SANDISK-MICROSD64GB
MC-SANDISK-READER
MC-INTUIT-CCREADER
MC-SQUARE-CCREADER
CH-APPLE-5W
CH-APPLE-10W
CH-APPLE-12W
CH-APPLE-5WL
CH-APPLE-10WL
CH-APPLE-12WL
CH-MOT-MICROUSB
CH-RIM-MICROUSB
CH-SAMS-MICROUSB
CH-NOK-INDUCTIVE
HS-APPLE-EARBUDS
HS-KLIPSCH-IMAGEONE
HS-SENNH-CX870
HS-BOSE-MIE2I
HS-SKULLC-MERGER
HS-MONST-NERGY
HS-PLANT-MX200
MO-IBOLT-MOUNT
MO-MOT-RAZRM
MO-IGRIP-WINDOW
MO-IGRIP-VENT
AC-ASSTCHARMS
AC-BLING
AC-SIERRA-HOTSPOT3G
AC-SIERRA-HOTSPOT4G
AC-MOTO-HOTSPOT3G
AC-MOTO-HOTSPOT4G
AC-SAMS-NETEXTEND
|
{
"pile_set_name": "Github"
}
|
/*
***********************************************************************************************************************
*
* Copyright (c) 2019-2020 Advanced Micro Devices, Inc. All Rights Reserved.
*
* 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.
*
**********************************************************************************************************************/
#include "protocols/loggingServer.h"
#include "msgChannel.h"
#define LOGGING_SERVER_MIN_VERSION 2
#define LOGGING_SERVER_MAX_VERSION 3
namespace DevDriver
{
namespace LoggingProtocol
{
static const NamedLoggingCategory kDefaultLoggingCategories[kReservedCategoryCount] = {
{kGeneralCategoryMask, "General"},
{kSystemCategoryMask, "System"},
};
static_assert(kGeneralCategoryOffset == 0, "General category offset has changed unexpectedly");
static_assert(kSystemCategoryOffset == 1, "System category offset has changed unexpectedly");
LoggingServer::LoggingServer(IMsgChannel* pMsgChannel)
: BaseProtocolServer(pMsgChannel, Protocol::Logging, LOGGING_SERVER_MIN_VERSION, LOGGING_SERVER_MAX_VERSION)
, m_categories()
, m_activeSessions(pMsgChannel->GetAllocCb())
, m_numCategories(0)
{
DD_ASSERT(m_pMsgChannel != nullptr);
// Initialize the category table
memset(&m_categories[0], 0, sizeof(m_categories));
// Initialize default logging categories
for (uint32 i = 0; i < kReservedCategoryCount; i++)
{
// Only initialize valid categorie entries
if (kDefaultLoggingCategories[i].category != 0 && kDefaultLoggingCategories[i].name[0] != 0)
{
// Validate that there hasn't been a mistake made somewhere
DD_ASSERT(kDefaultLoggingCategories[i].category ==
((LoggingCategory)1 << (kDefinableCategoryCount + i)));
// Copy the category definition into our table and increment count
m_categories[kDefinableCategoryCount + i] = kDefaultLoggingCategories[i];
m_numCategories++;
}
}
}
LoggingServer::~LoggingServer()
{
}
bool LoggingServer::AcceptSession(const SharedPointer<ISession>& pSession)
{
DD_UNUSED(pSession);
return true;
}
void LoggingServer::SessionEstablished(const SharedPointer<ISession>& pSession)
{
DD_UNUSED(pSession);
// Allocate session data for the newly established session
LoggingSession* pSessionData = DD_NEW(LoggingSession, m_pMsgChannel->GetAllocCb())(m_pMsgChannel->GetAllocCb(), pSession);
// WA: Force MSVC's static analyzer to ignore unhandled OOM.
DD_ASSUME(pSessionData != nullptr);
pSessionData->state = SessionState::ReceivePayload;
pSessionData->loggingEnabled = false;
memset(&pSessionData->scratchPayload, 0, sizeof(pSessionData->scratchPayload));
// Default to all messages enabled.
pSessionData->filter.priority = LogLevel::Error;
pSessionData->filter.category = kAllLoggingCategories;
LockData();
m_activeSessions.PushBack(pSessionData);
UnlockData();
pSession->SetUserData(pSessionData);
}
void LoggingServer::UpdateSession(const SharedPointer<ISession>& pSession)
{
LoggingSession *pSessionData = reinterpret_cast<LoggingSession*>(pSession->GetUserData());
switch (pSessionData->state)
{
case SessionState::ReceivePayload:
{
const Result result = pSession->ReceivePayload(&pSessionData->scratchPayload, kNoWait);
if (result == Result::Success)
{
pSessionData->state = SessionState::ProcessPayload;
}
else if (result == Result::NotReady)
{
// If there's no messages to receive, we should send log messages if logging is enabled.
if (pSessionData->loggingEnabled)
{
LockData();
// Send as many log messages from our queue as possible.
while (pSessionData->messages.PeekFront() != nullptr)
{
const SizedPayloadContainer* pPayload = pSessionData->messages.PeekFront();
if (pSessionData->SendPayload(pPayload, kNoWait) == Result::Success)
{
DD_PRINT(LogLevel::Debug, "Sent Logging Payload To Session %d!", pSession->GetSessionId());
// Pop the message off the queue since it was successfully sent.
pSessionData->messages.PopFront();
}
else
{
break;
}
}
UnlockData();
}
}
break;
}
case SessionState::ProcessPayload:
{
SizedPayloadContainer& container = pSessionData->scratchPayload;
switch (container.GetPayload<LoggingHeader>().command)
{
case LoggingMessage::QueryCategoriesRequest:
{
LockData();
const uint32 numCategories = (m_numCategories <= kMaxCategoryCount) ? m_numCategories : 0;
UnlockData();
container.CreatePayload<QueryCategoriesNumResponsePayload>(numCategories);
pSessionData->state = SessionState::SendCategoriesNumResponse;
break;
}
case LoggingMessage::EnableLoggingRequest:
{
DD_PRINT(LogLevel::Debug, "Starting Logging!");
LockData();
pSessionData->filter = container.GetPayload<EnableLoggingRequestPayload>().filter;
pSessionData->loggingEnabled = true;
UnlockData();
container.CreatePayload<EnableLoggingResponsePayload>(Result::Success);
pSessionData->state = SessionState::SendPayload;
break;
}
case LoggingMessage::DisableLogging:
{
DD_PRINT(LogLevel::Debug, "Stopping Logging!");
LockData();
pSessionData->loggingEnabled = false;
pSessionData->state = SessionState::FinishLogging;
// We have no additional messages to send so let the client know via the sentinel.
SizedPayloadContainer* pPayload = pSessionData->messages.AllocateBack();
if (pPayload != nullptr)
{
pPayload->CreatePayload<LoggingHeader>(LoggingMessage::LogMessageSentinel);
}
DD_PRINT(LogLevel::Debug, "Inserted logging sentinel");
UnlockData();
break;
}
default:
{
DD_UNREACHABLE();
break;
}
}
break;
}
case SessionState::FinishLogging:
{
DD_PRINT(LogLevel::Debug, "Finishing Logging!");
LockData();
// Send as many log messages from our queue as possible.
if (pSessionData->messages.Size() > 0)
{
DD_PRINT(LogLevel::Debug, "Logging messages remaining: %u", pSessionData->messages.Size());
const SizedPayloadContainer* pPayload = pSessionData->messages.PeekFront();
|
{
"pile_set_name": "Github"
}
|
// Copyright (C) 2002-2014 Nikolaus Gebhardt
// This file is part of the "irrKlang" library.
// For conditions of distribution and use, see copyright notice in irrKlang.h
#ifndef __I_IRRKLANG_AUDIO_STREAM_H_INCLUDED__
#define __I_IRRKLANG_AUDIO_STREAM_H_INCLUDED__
#include "ik_IRefCounted.h"
#include "ik_SAudioStreamFormat.h"
namespace irrklang
{
//! Reads and decodes audio data into an usable audio stream for the ISoundEngine
class IAudioStream : public IRefCounted
{
public:
//! destructor
virtual ~IAudioStream() {};
//! returns format of the audio stream
virtual SAudioStreamFormat getFormat() = 0;
//! sets the position of the audio stream.
/** For example to let the stream be read from the beginning of the file again,
setPosition(0) would be called. This is usually done be the sound engine to
loop a stream after if has reached the end. Return true if sucessful and 0 if not.
\param pos: Position in frames.*/
virtual bool setPosition(ik_s32 pos) = 0;
//! returns true if the audio stream is seekable
/* Some file formats like (MODs) don't support seeking */
virtual bool getIsSeekingSupported() { return true; }
//! tells the audio stream to read frameCountToRead audio frames into the specified buffer
/** \param target: Target data buffer to the method will write the read frames into. The
specified buffer will be at least getFormat().getFrameSize()*frameCountToRead bytes big.
\param frameCountToRead: amount of frames to be read.
\returns Returns amount of frames really read. Should be frameCountToRead in most cases. */
virtual ik_s32 readFrames(void* target, ik_s32 frameCountToRead) = 0;
};
} // end namespace irrklang
#endif
|
{
"pile_set_name": "Github"
}
|
var baseClamp = require('./_baseClamp'),
baseToString = require('./_baseToString'),
toInteger = require('./toInteger'),
toString = require('./toString');
/**
* Checks if `string` starts with the given target string.
*
* @static
* @memberOf _
* @since 3.0.0
* @category String
* @param {string} [string=''] The string to inspect.
* @param {string} [target] The string to search for.
* @param {number} [position=0] The position to search from.
* @returns {boolean} Returns `true` if `string` starts with `target`,
* else `false`.
* @example
*
* _.startsWith('abc', 'a');
* // => true
*
* _.startsWith('abc', 'b');
* // => false
*
* _.startsWith('abc', 'b', 1);
* // => true
*/
function startsWith(string, target, position) {
string = toString(string);
position = position == null
? 0
: baseClamp(toInteger(position), 0, string.length);
target = baseToString(target);
return string.slice(position, position + target.length) == target;
}
module.exports = startsWith;
|
{
"pile_set_name": "Github"
}
|
created_by: Создал
about: Описание
add_description: Добавить описание
phone: Мобильный телефон
email: Email
|
{
"pile_set_name": "Github"
}
|
class Testp
convert
A '2'
B '3'
end
prechigh
left B
preclow
rule
/* comment */
target: A B C nonterminal { action "string" == /regexp/o
1 /= 3 }
; # comment
nonterminal: A '+' B = A;
/* end */
end
---- driver
# driver is old name
|
{
"pile_set_name": "Github"
}
|
QS prev_prev_son==- { "b^*","ch^*","d^*","dh^*","f^*","g^*","hh^*","jh^*","k^*","p^*","s^*","sh^*","t^*","th^*","v^*","z^*","zh^*" }
QS prev_prev_vc==+ { "aa^*","ae^*","ah^*","ao^*","aw^*","ax^*","ay^*","eh^*","er^*","ey^*","ih^*","iy^*","ow^*","oy^*","uh^*","uw^*" }
QS prev_prev_cvox==+ { "b^*","d^*","dh^*","g^*","jh^*","l^*","m^*","n^*","ng^*","r^*","v^*","w^*","y^*","z^*","zh^*" }
QS prev_prev_ccor==+ { "ch^*","d^*","dh^*","jh^*","l^*","n^*","r^*","s^*","sh^*","t^*","th^*","z^*","zh^*" }
QS prev_prev_cont==+ { "dh^*","f^*","hh^*","l^*","r^*","s^*","sh^*","th^*","v^*","w^*","y^*","z^*","zh^*" }
QS prev_prev_vrnd==- { "aa^*","ae^*","ah^*","aw^*","ax^*","ay^*","eh^*","er^*","ey^*","ih^*","iy^*" }
QS prev_prev_ccor==+&&son==- { "ch^*","d^*","dh^*","jh^*","s^*","sh^*","t^*","th^*","z^*","zh^*" }
QS prev_prev_cvox==- { "ch^*","f^*","hh^*","k^*","p^*","s^*","sh^*","t^*","th^*" }
QS prev_prev_cont==+&&ccor==+ { "dh^*","l^*","r^*","s^*","sh^*","th^*","z^*","zh^*" }
QS prev_prev_cont==-&&cvox==+ { "b^*","d^*","g^*","jh^*","m^*","n^*","ng^*" }
QS prev_prev_csib==+ { "ch^*","jh^*","s^*","sh^*","z^*","zh^*" }
QS prev_prev_vlng==s { "ae^*","ah^*","eh^*","ih^*","uh^*" }
QS prev_prev_vfront==2 { "ah^*","aw^*","ax^*","ay^*","er^*" }
QS prev_prev_cvox==-&&ctype==f { "f^*","hh^*","s^*","sh^*","th^*" }
QS prev_prev_cvox==+&&cplace==a { "d^*","l^*","n^*","r^*","z^*" }
QS prev_prev_cplace==l { "b^*","m^*","p^*","w^*" }
QS prev_prev_vheight==1 { "ih^*","iy^*","uh^*","uw^*" }
QS prev_prev_vlng==l { "aa^*","ao^*","iy^*","uw^*" }
QS prev_prev_vrnd==-&&vheight==3 { "aa^*","ae^*","aw^*","ay^*" }
QS prev_prev_cvox==+&&clab==+ { "b^*","m^*","v^*","w^*" }
QS prev_prev_cont==+&&cplace==a { "l^*","r^*","s^*","z^*" }
QS prev_prev_vfront==2&&vheight==2 { "ah^*","ax^*","er^*" }
QS prev_prev_ctype==s&&cplace==a { "d^*","t^*" }
QS prev_prev_vfront==1&&vheight==2 { "eh^*","ey^*" }
QS prev_prev_cvox==-&&cplace==p { "ch^*","sh^*" }
QS prev_prev_name==ey { "ey^*" }
QS prev_prev_name==f { "f^*" }
QS prev_prev_name==pau { "pau^*" }
QS prev_vc==- { "*^b-*","*^ch-*","*^d-*","*^dh-*","*^f-*","*^g-*","*^hh-*","*^jh-*","*^k-*","*^l-*","*^m-*","*^n-*","*^ng-*","*^p-*","*^r-*","*^s-*","*^sh-*","*^t-*","*^th-*","*^v-*","*^w-*","*^y-*","*^z-*","*^zh-*" }
QS prev_son==- { "*^b-*","*^ch-*","*^d-*","*^dh-*","*^f-*","*^g-*","*^hh-*","*^jh-*","*^k-*","*^p-*","*^s-*","*^sh-*","*^t-*","*^th-*","*^v-*","*^z-*","*^zh-*" }
QS prev_vc==+ { "*^aa-*","*^ae-*","*^ah-*","*^ao-*","*^aw-*","*^ax-*","*^ay-*","*^eh-*","*^er-*","*^ey-*","*^ih-*","*^iy-*","*^ow-*","*^oy-*","*^uh-*","*^uw-*" }
QS prev_cvox==+ { "*^b-*","*^d-*","*^dh-*","*^g-*","*^jh-*","*^l-*","*^m-*","*^n-*","*^ng-*","*^r-*","*^v-*","*^w-*","*^y-*","*^z-*","*^zh-*" }
QS prev_ccor==+ { "*^ch-*","*^d-*","*^dh-*","*^jh-*","*^l-*","*^n-*","*^r-*","*^s-*","*^sh-*","*^t-*","*^th-*","*^z-*","*^zh-*" }
QS prev_cont==+ { "*^dh-*","*^f-*","*^hh-*","*^l-*","*^r-*","*^s-*","*^sh-*","*^th-*","*^v-*","*^w-*","*^y-*","*^z-*","*^zh-*" }
QS prev_vrnd==- { "*^aa-*","*^ae-*","*^ah-*","*^aw-*","*^ax-*","*^ay-*","*^eh-*","*^er-*","*^ey-*","*^ih-*","*^iy-*" }
QS prev_cont==- { "*^b-*","*^ch-*","*^d-*","*^g-*","*^jh-*","*^k-*","*^m-*","*^n-*","*^ng-*","*^p-*","*^t-*" }
QS prev_ccor==+&&son==- { "*^ch-*","*^d-*","*^dh-*","*^jh-*","*^s-*","*^sh-*","*^t-*","*^th-*","*^z-*","*^zh-*" }
QS prev_cvox==- { "*^ch-*","*^f-*","*^hh-*","*^k-*","*^p-*","*^s-*","*^sh-*","*^t-*","*^th-*" }
QS prev_ctype==f { "*^dh-*","*^f-*","*^hh-*","*^s-*","*^sh-*","*^th-*","*^v-*","*^z-*","*^zh-*" }
QS prev_cvox==+&&son==- { "*^b-*","*^d-*","*^dh-*","*^g-*","*^jh-*","*^v-*","*^z-*","*^zh-*" }
QS prev_cont==+&&ccor==+ { "*^dh-*","*^l-*","*^r-*","*^s-*","*^sh-*","*^th-*","*^z-*","*^zh-*" }
QS prev_cont==+&&cvox==+ { "*^dh-*","*^l-*","*^r-*","*^v-*","*^w-*","*^y-*","*^z-*","*^zh-*" }
QS prev_ccor==+&&cvox==+ { "*^d-*","*^dh-*","*^jh-*","*^l-*","*^n-*","*^r-*","*^z-*","*^zh-*" }
QS prev_son==+ { "*^l-*","*^m-*","*^n-*","*^ng-*","*^r-*","*^w-*","*^y-*" }
QS prev_cont==-&&cvox==+ { "*^b-*","*^d-*","*^g-*","*^jh-*","*^m-*","*^n-*","*^ng-*" }
QS prev_cplace==a { "*^d-*","*^l-*","*^n-*","*^r-*","*^s-*","*^t-*","*^z-*" }
QS prev_ccor==+&&ctype==f { "*^dh-*","*^s-*","*^sh-*","*^th-*","*^z-*","*^zh-*" }
QS prev_csib==+ { "*^ch-*","*^jh-*","*^s-*","*^sh-*","*^z-*","*^zh-*
|
{
"pile_set_name": "Github"
}
|
949766990624ce317509f3680e69089d frame00000000
984d4251242c09bebf30cf9bb4219218 frame00000001
286d19f66ae198cdb56163d91a3e7921 frame00000002
358b955835be99e3bf0cfca484134676 frame00000003
6d55c71bef2bddf93261b3ea49879904 frame00000004
1de3c18386b9f2b6390276afc8b86c84 frame00000005
eb73c0cc2e9b92ace70072143584f1b4 frame00000006
3d9ef6ea34e70f5d402a792acd14570d frame00000007
d42fb0105ea5f44817860af7c902a031 frame00000008
cc139e6a11a9e07d4e60ad3cc038efca frame00000009
df4eb79e71e5161305f10ea24821eaf3 frame00000010
3ffa41ca9e9e3f3a0e53ebeae55912dd frame00000011
6b04ae74da25f03df54c67f8c1fd26a7 frame00000012
9236ef57e6f2cbd9fb9d87c5daa00e44 frame00000013
ad526cd7f586388f8a23c27c467615f5 frame00000014
69d43917a68c84f5f0dd6d2d2f3f4e14 frame00000015
a393c90d279e8418dcbb0c711a853e2f frame00000016
370251e2208e50aedc6c62b6dd514de8 frame00000017
1f31672ee07ce97c39132aa6973419a6 frame00000018
761499e623ba9e0a6e1611f067126659 frame00000019
498a6ff7da0fa419037e97025213459b frame00000020
0634a2330b150de121ee043229dcf4df frame00000021
ef04e209a43e38b7a2603fa0818fa787 frame00000022
96ce1b661011fd4de386c2a0eea41027 frame00000023
a0af61289c2c4d5856f04e9615794397 frame00000024
92133fa92ce2711c4f980f615c6687fe frame00000025
3f45e37617ab5730070ae4d8bdb531bb frame00000026
c455fc5f35f0a87f388d3487a062709d frame00000027
a83cbf3c05d91035d6f8916b51e8b653 frame00000028
afa9f1c40996e6ddeeab0e1f385acf75 frame00000029
d603863e8d9be7b0f76889a1a375eb4e frame00000030
5dae2d9c68165fad94d2211b4f56fd4f frame00000031
eadef42e2be5cfc5be8720a5b523d617 frame00000032
8ea1c668e31f74ef54ec0e34cf5cc135 frame00000033
09478cf4e5b038be1ae789db5bf5efd7 frame00000034
2a6d575597141a2d675d86e95a14d775 frame00000035
3f02a1fd9ea69daa67a8c80f3989effb frame00000036
4e016a88b221fff1476421cac61b4a2d frame00000037
5df900bc3bd8b9f91e0fd8686cea43cf frame00000038
52bbfd5b0a00e63d8066cde7c79456a5 frame00000039
b3a2ef46cd3fdb55385cf0dab10e055f frame00000040
07b0115d815e42ae0defae7b214d031a frame00000041
32cb902e0bb79a24045e44f7398f6119 frame00000042
3bf7eb348ebf36ad10b45d6b8ef046ae frame00000043
bdf0cddc3f37ed9fc7b47192f0d21e9a frame00000044
eaace1163c89963dd455f05eb92844e8 frame00000045
22a9e5afd2c91b6f555d4f773343ff8a frame00000046
91aa7961b1d8a3e7f6a986cd147a2b4a frame00000047
139b4276a45a305bf0d4c05d739a949c frame00000048
89c82c8d3e8878b00a1a1eac6ffbd6d0 frame00000049
b4d0e6e5a7c264f82f4ae71d85951d87 frame00000050
cb967a3e01e530b69e13c9c478a97c45 frame00000051
514bb22f69d186a172754883b3c7bf9c frame00000052
c8633576d7257929a4d000af07f6d370 frame00000053
5c5d376a55063f027632f309354bf4a0 frame00000054
f3660cd1812ab8753182b52fe520662b frame00000055
d1aa271ae6da5035581585d3423f4d1d frame00000056
63b20728f0488189469b656cf2dd9cb3 frame00000057
c97054884b569b16b155b98c468bf012 frame00000058
10430ef205ee7143cc5ba61cf4bcf4ff frame00000059
a46ab9c1c4918ffc34032a976afb5448 frame00000060
3ac6d62d28131b4b15da3a63f144a915 frame00000061
d468ef5f2e1b6eb7b84796b8af5d713f frame00000062
48235442fbc96a9e2ba9d93f8034c73a frame00000063
7e57a7d9708bbe2a41484102a95fb912 frame00000064
a626cd0bb96de92884a53b4d6197a81f frame00000065
b94fabad35ee0119691cc2dc902ea51b frame00000066
30a4fcddf17ab386060455b25e0acd47 frame00000067
b5a03b3509dca43b55d4998dbbb11e80 frame00000068
0553d9b24728b866f9a87c9a9cce5119 frame00000069
7218596e89d1cdbfb300992a6395dc2a frame00000070
033af528b4337d9cd448f60e11c01d32 frame00000071
ac64d8c0cf5e89411b6cce277cfaf7cc frame00000072
ae03aaa83ae3a3f92731e25fbf35099a frame00000073
2005b41146d4574bec40984703165d64 frame00000074
f4093ef5246fa190b74a2016b18e7d1b frame00000075
d3627ee398669c261fb962128232950b frame00000076
9e981cd5ca6a4316ea36d847d052c7b3 frame00000077
741136e487cec3ffc14247d6a7741ee1 frame00000078
23168bd90a690e4d0d387cc8b90a8bf8 frame00000079
ad1a1e967daca551502cff560bbf15bc frame00000080
0d75e810bfbc7b875b60c0e1909737bf frame00000081
0d75e810bfbc7b875b60c0e1909737bf frame00000082
0d75e810bfbc7b875b60c0e1909737bf frame00000083
0d75e810bfbc7b875b60c0e1909737bf frame00000084
0d75e810bfbc7b875b60c0e1909737bf frame00000085
0d75e810bfbc7b875b60c0e1909737bf frame00000086
0d75e810bfbc7b875b60c0e
|
{
"pile_set_name": "Github"
}
|
export { default } from './checkout-confirmation'
|
{
"pile_set_name": "Github"
}
|
package com.rhwayfun.springboot.configuration.property;
import org.springframework.boot.context.properties.ConfigurationProperties;
import org.springframework.context.annotation.Configuration;
/**
* 带前缀属性配置
* 使用@ConfigurationProperties将property的配置映射到这个类的属性中
*
* property加载顺序:
*
* 1. Devtools global settings properties on your home directory (~/.spring-boot-devtools.properties when devtools is active).
* 2. @TestPropertySource annotations on your tests.
* 3. @SpringBootTest#properties annotation attribute on your tests.
* 4. Command line arguments.
* 5. Properties from SPRING_APPLICATION_JSON (inline JSON embedded in an environment variable or system property)
* 6. ServletConfig init parameters.
* 7. ServletContext init parameters.
* 8. JNDI attributes from java:comp/env.
* 9. Java System properties (System.getProperties()).
* 10. OS environment variables.
* 11. A RandomValuePropertySource that only has properties in random.*.
* 12. Profile-specific application properties outside of your packaged jar (application-{profile}.properties and YAML variants)
* 13. Profile-specific application properties packaged inside your jar (application-{profile}.properties and YAML variants)
* 14. Application properties outside of your packaged jar (application.properties and YAML variants).
* 15. Application properties packaged inside your jar (application.properties and YAML variants).
* 16. @PropertySource annotations on your @Configuration classes.
* 17. Default properties (specified using SpringApplication.setDefaultProperties).
*
* @author happyxiaofan
* @since 0.0.1
*/
@Configuration
@ConfigurationProperties(prefix = "my.config")
public class SimpleProperty {
private String app;
private String user;
private int age;
private String email;
private String blog;
private String github;
public String getApp() {
return app;
}
public void setApp(String app) {
this.app = app;
}
public String getUser() {
return user;
}
public void setUser(String user) {
this.user = user;
}
public int getAge() {
return age;
}
public void setAge(int age) {
this.age = age;
}
public String getEmail() {
return email;
}
public void setEmail(String email) {
this.email = email;
}
public String getBlog() {
return blog;
}
public void setBlog(String blog) {
this.blog = blog;
}
public String getGithub() {
return github;
}
public void setGithub(String github) {
this.github = github;
}
}
|
{
"pile_set_name": "Github"
}
|
0
0
18
74
9
30
0
61
0
15
41
9
0
0
7
14
27
17
0
9
2
17
25
2
30
5
19
36
0
0
0
0
0
26
0
0
5
0
9
12
3
2
45
33
25
33
0
36
34
29
12
5
81
3
0
2
10
29
76
2
0
21
66
0
0
0
0
0
0
2
0
0
0
0
0
41
0
72
0
2
5
5
5
24
0
22
2
31
26
34
5
0
0
27
0
0
0
2
2
47
48
0
37
25
27
28
2
14
7
4
0
23
28
0
0
0
0
0
0
0
0
0
14
24
29
26
0
9
21
24
0
2
3
34
3
3
15
29
0
0
0
2
0
0
0
0
0
45
0
5
2
5
5
40
0
0
2
9
2
84
71
0
0
0
0
0
0
0
0
0
0
4
17
7
2
28
3
0
0
0
2
0
20
2
12
0
2
63
0
3
66
0
25
1
0
70
26
12
39
0
0
0
3
69
0
2
2
3
7
70
31
0
0
0
0
0
29
31
4
26
0
2
56
42
15
36
29
2
0
0
0
0
2
28
0
25
3
0
0
7
0
24
0
0
10
8
0
31
0
23
51
0
0
0
0
23
59
37
0
3
2
63
2
2
0
2
0
2
3
52
0
4
0
0
0
0
0
0
0
0
6
2
8
2
1
4
39
2
|
{
"pile_set_name": "Github"
}
|
---
layout: feature
title: 'Tense'
shortdef: 'tense'
udver: '2'
---
### Description
Tense feature matches the inflectional endings in verbs. In Uralic grammars
there have been various practices in refering to present/future tense and
past/preterite tense, in Universal dependencies we use `Pres` for common
non-past and `Past` for common past, unless language has more complex tense
system. Many grammars give descriptions of e.g. perfect and pluperfect tenses,
but if it's based on auxiliary verb constructions, this is not marked on UD
level.
|
{
"pile_set_name": "Github"
}
|
<?php
/**
* Efficiently run operations on batches of results for any function
* that supports an options array.
*
* This is usually used with elgg_get_entities() and friends,
* elgg_get_annotations(), and elgg_get_metadata().
*
* If you pass a valid PHP callback, all results will be run through that
* callback. You can still foreach() through the result set after. Valid
* PHP callbacks can be a string, an array, or a closure.
* {@link http://php.net/manual/en/language.pseudo-types.php}
*
* The callback function must accept 3 arguments: an entity, the getter
* used, and the options used.
*
* Results from the callback are stored in callbackResult. If the callback
* returns only booleans, callbackResults will be the combined result of
* all calls. If no entities are processed, callbackResults will be null.
*
* If the callback returns anything else, callbackresult will be an indexed
* array of whatever the callback returns. If returning error handling
* information, you should include enough information to determine which
* result you're referring to.
*
* Don't combine returning bools and returning something else.
*
* Note that returning false will not stop the foreach.
*
* @warning If your callback or foreach loop deletes or disable entities
* you MUST call setIncrementOffset(false) or set that when instantiating.
* This forces the offset to stay what it was in the $options array.
*
* @example
* <code>
* // using foreach
* $batch = new ElggBatch('elgg_get_entities', array());
* $batch->setIncrementOffset(false);
*
* foreach ($batch as $entity) {
* $entity->disable();
* }
*
* // using both a callback
* $callback = function($result, $getter, $options) {
* var_dump("Looking at annotation id: $result->id");
* return true;
* }
*
* $batch = new ElggBatch('elgg_get_annotations', array('guid' => 2), $callback);
* </code>
*
* @package Elgg.Core
* @subpackage DataModel
* @link http://docs.elgg.org/DataModel/ElggBatch
* @since 1.8
*/
class ElggBatch
implements Iterator {
/**
* The objects to interator over.
*
* @var array
*/
private $results = array();
/**
* The function used to get results.
*
* @var mixed A string, array, or closure, or lamda function
*/
private $getter = null;
/**
* The number of results to grab at a time.
*
* @var int
*/
private $chunkSize = 25;
/**
* A callback function to pass results through.
*
* @var mixed A string, array, or closure, or lamda function
*/
private $callback = null;
/**
* Start after this many results.
*
* @var int
*/
private $offset = 0;
/**
* Stop after this many results.
*
* @var int
*/
private $limit = 0;
/**
* Number of processed results.
*
* @var int
*/
private $retrievedResults = 0;
/**
* The index of the current result within the current chunk
*
* @var int
*/
private $resultIndex = 0;
/**
* The index of the current chunk
*
* @var int
*/
private $chunkIndex = 0;
/**
* The number of results iterated through
*
* @var int
*/
private $processedResults = 0;
/**
* Is the getter a valid callback
*
* @var bool
*/
private $validGetter = null;
/**
* The result of running all entities through the callback function.
*
* @var mixed
*/
public $callbackResult = null;
/**
* If false, offset will not be incremented. This is used for callbacks/loops that delete.
*
* @var bool
*/
private $incrementOffset = true;
/**
* Batches operations on any elgg_get_*() or compatible function that supports
* an options array.
*
* Instead of returning all objects in memory, it goes through $chunk_size
* objects, then requests more from the server. This avoids OOM errors.
*
* @param string $getter The function used to get objects. Usually
* an elgg_get_*() function, but can be any valid PHP callback.
* @param array $options The options array to pass to the getter function. If limit is
* not set, 10 is used as the default. In most cases that is not
* what you want.
* @param mixed $callback An optional callback function that all results will be passed
* to upon load. The callback needs to accept $result, $getter,
* $options.
* @param int $chunk_size The number of entities to pull in before requesting more.
* You have to balance this between running out of memory in PHP
* and hitting the db server too often.
* @param bool $inc_offset Increment the offset on each fetch. This must be false for
* callbacks that delete rows. You can set this after the
* object is created with {@see ElggBatch::setIncrementOffset()}.
*/
public function __construct($getter, $options, $callback = null, $chunk_size = 25,
$inc_offset = true) {
$this->getter = $getter;
$this->options = $options;
$this->callback = $callback;
$this->chunkSize = $chunk_size;
$this->setIncrementOffset($inc_offset);
if ($this->chunkSize <= 0) {
$this->chunkSize = 25;
}
// store these so we can compare later
$this->offset = elgg_extract('offset', $options, 0);
$this->limit = elgg_extract('limit', $options, 10);
// if passed a callback, create a new ElggBatch with the same options
// and pass each to the callback.
if ($callback && is_callable($callback)) {
$batch = new ElggBatch($getter, $options, null, $chunk_size, $inc_offset);
$all_results = null;
foreach ($batch as $result) {
if (is_string($callback)) {
$result = $callback($result, $getter, $options);
} else {
$result = call_user_func_array($callback, array($result, $getter, $options));
}
if (!isset($all_results)) {
if ($result === true || $result === false || $result === null) {
$all_results = $result;
} else {
$all_results = array();
}
}
if (($result === true || $result === false || $result === null) && !is_array($all_results)) {
$all_results = $result && $all_results;
} else {
$all_results[] = $result;
}
}
$this->callbackResult = $all_results;
}
}
/**
* Fetches the next chunk of results
*
* @return bool
*/
private function getNextResultsChunk() {
// reset memory caches after first chunk load
if ($this->chunkIndex > 0) {
global $DB_QUERY_CACHE, $ENTITY_CACHE;
$DB_QUERY_CACHE = $ENTITY_CACHE = array();
}
// always reset results.
$this->results = array();
if (!isset($this->validGetter)) {
$this->validGetter = is_callable($this->getter);
}
if (!$this->validGetter) {
return false;
}
$limit = $this->chunkSize;
// if someone passed limit = 0 they want everything.
if ($this->limit != 0) {
if ($this->retrievedResults >= $this->limit) {
return false;
}
// if original limit < chunk size, set limit to original limit
// else if the number of results we'll fetch if greater than the original limit
if ($this->limit < $this->chunkSize
|
{
"pile_set_name": "Github"
}
|
// Copyright (c) 2012-2014 The Bitcoin developers
// Copyright (c) 2014-2015 The Dash developers
// Copyright (c) 2015-2018 The Luxcore developers
// Distributed under the MIT software license, see the accompanying
// file COPYING or http://www.opensource.org/licenses/mit-license.php.
#ifndef BITCOIN_RPCSERVER_H
#define BITCOIN_RPCSERVER_H
#include "amount.h"
#include "rpcprotocol.h"
#include "uint256.h"
#include <list>
#include <map>
#include <stdint.h>
#include <string>
#include <httpserver.h>
#include <boost/function.hpp>
#include "univalue/univalue.h"
class CRPCCommand;
namespace RPCServer
{
void OnStarted(boost::function<void ()> slot);
void OnStopped(boost::function<void ()> slot);
void OnPreCommand(boost::function<void (const CRPCCommand&)> slot);
void OnPostCommand(boost::function<void (const CRPCCommand&)> slot);
}
class CBlockIndex;
class CNetAddr;
/** Wrapper for UniValue::VType, which includes typeAny:
* Used to denote don't care type. Only used by RPCTypeCheckObj */
struct UniValueType {
UniValueType(UniValue::VType _type) : typeAny(false), type(_type) {}
UniValueType() : typeAny(true) {}
bool typeAny;
UniValue::VType type;
};
class JSONRequest
{
public:
UniValue id;
std::string strMethod;
UniValue params;
bool isLongPolling;
/**
* If using batch JSON request, this object won't get the underlying HTTPRequest.
*/
JSONRequest() {
id = NullUniValue;
params = NullUniValue;
req = NULL;
isLongPolling = false;
};
JSONRequest(HTTPRequest *req);
/**
* Start long-polling
*/
void PollStart();
/**
* Ping long-poll connection with an empty character to make sure it's still alive.
*/
void PollPing();
/**
* Returns whether the underlying long-poll connection is still alive.
*/
bool PollAlive();
/**
* End a long poll request.
*/
void PollCancel();
/**
* Return the JSON result of a long poll request
*/
void PollReply(const UniValue& result);
void parse(const UniValue& valRequest);
// FIXME: make this private?
HTTPRequest *req;
};
class JSONRPCRequest
{
public:
UniValue id;
std::string strMethod;
UniValue params;
bool fHelp;
std::string URI;
std::string authUser;
bool isLongPolling;
/**
* If using batch JSON request, this object won't get the underlying HTTPRequest.
*/
JSONRPCRequest() {
id = NullUniValue;
params = NullUniValue;
fHelp = false;
req = NULL;
isLongPolling = false;
};
JSONRPCRequest(HTTPRequest *_req);
/**
* Start long-polling
*/
void PollStart();
/**
* Ping long-poll connection with an empty character to make sure it's still alive.
*/
void PollPing();
/**
* Returns whether the underlying long-poll connection is still alive.
*/
bool PollAlive();
/**
* End a long poll request.
*/
void PollCancel();
/**
* Return the JSON result of a long poll request
*/
void PollReply(const UniValue& result);
void parse(const UniValue& valRequest);
// FIXME: make this private?
HTTPRequest *req;
};
/** Query whether RPC is running */
bool IsRPCRunning();
/**
* Set
* the RPC warmup status. When this is done, all RPC calls will error out
* immediately with RPC_IN_WARMUP.
*/
void SetRPCWarmupStatus(const std::string& newStatus);
/* Mark warmup as done. RPC calls will be processed from now on. */
void SetRPCWarmupFinished();
/* returns the current warmup state. */
bool RPCIsInWarmup(std::string* statusOut);
/**
* Type-check arguments; throws JSONRPCError if wrong type given. Does not check that
* the right number of arguments are passed, just that any passed are the correct type.
* Use like: RPCTypeCheck(params, boost::assign::list_of(str_type)(int_type)(obj_type));
*/
void RPCTypeCheck(const UniValue& params,
const std::list<UniValue::VType>& typesExpected,
bool fAllowNull = false);
/**
* Check for expected keys/value types in an Object.
* Use like: RPCTypeCheck(object, boost::assign::map_list_of("name", str_type)("value", int_type));
*/
void RPCTypeCheckObj(const UniValue& o,
const std::map<std::string, UniValueType>& typesExpected,
bool fAllowNull = false);
/** Opaque base class for timers returned by NewTimerFunc.
* This provides no methods at the moment, but makes sure that delete
* cleans up the whole state.
*/
class RPCTimerBase
{
public:
virtual ~RPCTimerBase() {}
};
/**
* RPC timer "driver".
*/
class RPCTimerInterface
{
public:
virtual ~RPCTimerInterface() {}
/** Implementation name */
virtual const char *Name() = 0;
/** Factory function for timers.
* RPC will call the function to create a timer that will call func in *millis* milliseconds.
* @note As the RPC mechanism is backend-neutral, it can use different implementations of timers.
* This is needed to cope with the case in which there is no HTTP server, but
* only GUI RPC console, and to break the dependency of pcserver on httprpc.
*/
virtual RPCTimerBase* NewTimer(boost::function<void(void)>& func, int64_t millis) = 0;
};
/** Set the factory function for timers */
void RPCSetTimerInterface(RPCTimerInterface *iface);
/** Set the factory function for timer, but only, if unset */
void RPCSetTimerInterfaceIfUnset(RPCTimerInterface *iface);
/** Unset factory function for timers */
void RPCUnsetTimerInterface(RPCTimerInterface *iface);
/**
* Run func nSeconds from now.
* Overrides previous timer <name> (if any).
*/
void RPCRunLater(const std::string& name, boost::function<void(void)> func, int64_t nSeconds);
typedef UniValue(*rpcfn_type)(const UniValue& params, bool fHelp);
class CRPCCommand
{
public:
std::string category;
std::string name;
rpcfn_type actor;
bool okSafeMode;
bool threadSafe;
bool reqWallet;
};
/**
* LUX RPC command dispatcher.
*/
class CRPCTable
{
private:
std::map<std::string, const CRPCCommand*> mapCommands;
public:
CRPCTable();
const CRPCCommand* operator[](const std::string& name) const;
std::string help(std::string name) const;
/**
* Execute a method.
* @param method Method to execute
* @param params Array of arguments (JSON objects)
* @returns Result of the call.
* @throws an exception (UniValue) when an error happens.
*/
UniValue execute(const std::string& method, const UniValue& params) const;
/**
* Returns a list of registered commands
* @returns List of registered commands.
*/
std::vector<std::string> listCommands() const;
};
extern const CRPCTable tableRPC;
/**
* Utilities: convert hex-encoded Values
*
|
{
"pile_set_name": "Github"
}
|
/*
* Copyright (c) Facebook, Inc. and its affiliates.
*
* This source code is licensed under the MIT license found in the
* LICENSE file in the root directory of this source tree.
*/
package com.facebook.fresco.samples.showcase.drawee;
import android.graphics.drawable.Animatable;
import android.net.Uri;
import android.os.Bundle;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import androidx.annotation.Nullable;
import com.facebook.common.references.CloseableReference;
import com.facebook.datasource.RetainingDataSourceSupplier;
import com.facebook.drawee.backends.pipeline.Fresco;
import com.facebook.drawee.controller.BaseControllerListener;
import com.facebook.drawee.controller.ControllerListener;
import com.facebook.drawee.view.SimpleDraweeView;
import com.facebook.fresco.samples.showcase.BaseShowcaseFragment;
import com.facebook.fresco.samples.showcase.R;
import com.facebook.imagepipeline.image.CloseableImage;
import com.facebook.imagepipeline.image.ImageInfo;
import com.facebook.imagepipeline.request.ImageRequest;
import java.util.List;
public class RetainingDataSourceSupplierFragment extends BaseShowcaseFragment {
private List<Uri> mSampleUris;
private int mUriIndex = 0;
private ControllerListener controllerListener =
new BaseControllerListener<ImageInfo>() {
@Override
public void onFinalImageSet(
String id, @Nullable ImageInfo imageInfo, @Nullable Animatable anim) {
if (anim != null) {
// app-specific logic to enable animation starting
anim.start();
}
}
};
@Override
public void onCreate(@Nullable Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
mSampleUris = sampleUris().getSampleGifUris();
}
@Nullable
@Override
public View onCreateView(
LayoutInflater inflater, @Nullable ViewGroup container, @Nullable Bundle savedInstanceState) {
return inflater.inflate(R.layout.fragment_drawee_retaining_supplier, container, false);
}
@Override
public void onViewCreated(View view, @Nullable Bundle savedInstanceState) {
final SimpleDraweeView simpleDraweeView = view.findViewById(R.id.drawee_view);
final RetainingDataSourceSupplier<CloseableReference<CloseableImage>> retainingSupplier =
new RetainingDataSourceSupplier<>();
simpleDraweeView.setController(
Fresco.newDraweeControllerBuilder()
.setDataSourceSupplier(retainingSupplier)
.setControllerListener(controllerListener)
.build());
replaceImage(retainingSupplier);
simpleDraweeView.setOnClickListener(
new View.OnClickListener() {
@Override
public void onClick(View view) {
replaceImage(retainingSupplier);
}
});
}
@Override
public int getTitleId() {
return R.string.drawee_retaining_supplier_title;
}
private void replaceImage(
RetainingDataSourceSupplier<CloseableReference<CloseableImage>> retainingSupplier) {
retainingSupplier.replaceSupplier(
Fresco.getImagePipeline()
.getDataSourceSupplier(
ImageRequest.fromUri(getNextUri()), null, ImageRequest.RequestLevel.FULL_FETCH));
}
private synchronized Uri getNextUri() {
int previousIndex = mUriIndex;
mUriIndex = (mUriIndex + 1) % mSampleUris.size();
return mSampleUris.get(previousIndex);
}
}
|
{
"pile_set_name": "Github"
}
|
{
"forge_marker": 1,
"parent":"thebetweenlands:block/log_rotten_bark_carved",
"textures": {
"up": "thebetweenlands:blocks/rotten_bark_rotated",
"down": "thebetweenlands:blocks/rotten_bark_rotated",
"north": "thebetweenlands:blocks/rotten_bark_carved_11",
"east": "thebetweenlands:blocks/rotten_bark_carved_11",
"south": "thebetweenlands:blocks/rotten_bark_carved_11",
"west": "thebetweenlands:blocks/rotten_bark_carved_11"
}
}
|
{
"pile_set_name": "Github"
}
|
import { IconDefinition, IconPrefix, IconName } from "@fortawesome/fontawesome-common-types";
export const definition: IconDefinition;
export const faPinterest: IconDefinition;
export const prefix: IconPrefix;
export const iconName: IconName;
export const width: number;
export const height: number;
export const ligatures: string[];
export const unicode: string;
export const svgPathData: string;
|
{
"pile_set_name": "Github"
}
|
/*
* CoreShop.
*
* This source file is subject to the GNU General Public License version 3 (GPLv3)
* For the full copyright and license information, please view the LICENSE.md and gpl-3.0.txt
* files that are distributed with this source code.
*
* @copyright Copyright (c) 2015-2020 Dominik Pfaffenbauer (https://www.pfaffenbauer.at)
* @license https://www.coreshop.org/license GNU General Public License version 3 (GPLv3)
*
*/
pimcore.registerNS('coreshop.notification.rule.item');
coreshop.notification.rule.item = Class.create(coreshop.rules.item, {
iconCls: 'coreshop_icon_notification_rule',
url: {
save: '/admin/coreshop/notification_rules/save'
},
getPanel: function () {
var items = this.getItems();
this.panel = new Ext.TabPanel({
activeTab: 0,
title: this.data.name,
closable: true,
deferredRender: false,
forceLayout: true,
iconCls: this.iconCls,
buttons: [{
text: t('save'),
iconCls: 'pimcore_icon_apply',
handler: this.save.bind(this)
}],
items: items
});
if (this.data.type) {
this.reloadTypes(this.data.type);
}
return this.panel;
},
getSettings: function () {
var data = this.data;
var types = [];
this.parentPanel.getConfig().types.forEach(function (type) {
types.push([type, t('coreshop_notification_rule_type_' + type)]);
}.bind(this));
var typesStore = new Ext.data.ArrayStore({
data: types,
fields: ['type', 'typeName'],
idProperty: 'type'
});
this.settingsForm = Ext.create('Ext.form.Panel', {
iconCls: 'coreshop_icon_settings',
title: t('settings'),
bodyStyle: 'padding:10px;',
autoScroll: true,
border: false,
items: [
{
xtype: 'textfield',
name: 'name',
fieldLabel: t('name'),
width: 250,
value: data.name
},
{
xtype: 'checkbox',
name: 'active',
fieldLabel: t('active'),
checked: data.active
},
{
xtype: 'combo',
fieldLabel: t('coreshop_notification_rule_type'),
name: 'type',
displayField: 'type',
valueField: 'type',
store: typesStore,
value: this.data.type,
width: 250,
listeners: {
change: function (combo, value) {
this.reloadTypes(value);
}.bind(this)
}
}
]
});
return this.settingsForm;
},
getItems: function () {
return [
this.getSettings()
];
},
reloadTypes: function (type) {
if (this.actions) {
this.actions.destroy();
}
if (this.conditions) {
this.conditions.destroy();
}
var items = this.getItemsForType(type);
this.panel.add(items);
},
getItemsForType: function (type) {
var actionContainerClass = this.getActionContainerClass();
var conditionContainerClass = this.getConditionContainerClass();
var allowedActions = this.parentPanel.getActionsForType(type);
var allowedConditions = this.parentPanel.getConditionsForType(type);
this.actions = new actionContainerClass(allowedActions, type);
this.conditions = new conditionContainerClass(allowedConditions, type);
var items = [
this.conditions.getLayout(),
this.actions.getLayout()
];
// add saved conditions
if (this.data.conditions) {
Ext.each(this.data.conditions, function (condition) {
var conditionType = condition.type.replace(type + '.', '');
if (allowedConditions.indexOf(conditionType) >= 0) {
this.conditions.addCondition(conditionType, condition, false);
}
}.bind(this));
}
// add saved actions
if (this.data.actions) {
Ext.each(this.data.actions, function (action) {
var actionType = action.type.replace(type + '.', '');
if (allowedActions.indexOf(actionType) >= 0) {
this.actions.addAction(actionType, action, false);
}
}.bind(this));
}
return items;
},
getActionContainerClass: function () {
return coreshop.notification.rule.action;
},
getConditionContainerClass: function () {
return coreshop.notification.rule.condition;
}
});
|
{
"pile_set_name": "Github"
}
|
//
// bind/bind_mf2_cc.hpp - member functions, type<> syntax
//
// Do not include this header directly.
//
// Copyright (c) 2001 Peter Dimov and Multi Media Ltd.
// Copyright (c) 2008 Peter Dimov
//
// 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
//
// See http://www.boost.org/libs/bind/bind.html for documentation.
//
// 0
template<class Rt2, class R, class T,
class A1>
_bi::bind_t<Rt2, _mfi::BOOST_BIND_MF_NAME(mf0)<R, T>, typename _bi::list_av_1<A1>::type>
BOOST_BIND(boost::type<Rt2>, R (BOOST_BIND_MF_CC T::*f) (), A1 a1)
{
typedef _mfi::BOOST_BIND_MF_NAME(mf0)<R, T> F;
typedef typename _bi::list_av_1<A1>::type list_type;
return _bi::bind_t<Rt2, F, list_type>(F(f), list_type(a1));
}
template<class Rt2, class R, class T,
class A1>
_bi::bind_t<Rt2, _mfi::BOOST_BIND_MF_NAME(cmf0)<R, T>, typename _bi::list_av_1<A1>::type>
BOOST_BIND(boost::type<Rt2>, R (BOOST_BIND_MF_CC T::*f) () const, A1 a1)
{
typedef _mfi::BOOST_BIND_MF_NAME(cmf0)<R, T> F;
typedef typename _bi::list_av_1<A1>::type list_type;
return _bi::bind_t<Rt2, F, list_type>(F(f), list_type(a1));
}
// 1
template<class Rt2, class R, class T,
class B1,
class A1, class A2>
_bi::bind_t<Rt2, _mfi::BOOST_BIND_MF_NAME(mf1)<R, T, B1>, typename _bi::list_av_2<A1, A2>::type>
BOOST_BIND(boost::type<Rt2>, R (BOOST_BIND_MF_CC T::*f) (B1), A1 a1, A2 a2)
{
typedef _mfi::BOOST_BIND_MF_NAME(mf1)<R, T, B1> F;
typedef typename _bi::list_av_2<A1, A2>::type list_type;
return _bi::bind_t<Rt2, F, list_type>(F(f), list_type(a1, a2));
}
template<class Rt2, class R, class T,
class B1,
class A1, class A2>
_bi::bind_t<Rt2, _mfi::BOOST_BIND_MF_NAME(cmf1)<R, T, B1>, typename _bi::list_av_2<A1, A2>::type>
BOOST_BIND(boost::type<Rt2>, R (BOOST_BIND_MF_CC T::*f) (B1) const, A1 a1, A2 a2)
{
typedef _mfi::BOOST_BIND_MF_NAME(cmf1)<R, T, B1> F;
typedef typename _bi::list_av_2<A1, A2>::type list_type;
return _bi::bind_t<Rt2, F, list_type>(F(f), list_type(a1, a2));
}
// 2
template<class Rt2, class R, class T,
class B1, class B2,
class A1, class A2, class A3>
_bi::bind_t<Rt2, _mfi::BOOST_BIND_MF_NAME(mf2)<R, T, B1, B2>, typename _bi::list_av_3<A1, A2, A3>::type>
BOOST_BIND(boost::type<Rt2>, R (BOOST_BIND_MF_CC T::*f) (B1, B2), A1 a1, A2 a2, A3 a3)
{
typedef _mfi::BOOST_BIND_MF_NAME(mf2)<R, T, B1, B2> F;
typedef typename _bi::list_av_3<A1, A2, A3>::type list_type;
return _bi::bind_t<Rt2, F, list_type>(F(f), list_type(a1, a2, a3));
}
template<class Rt2, class R, class T,
class B1, class B2,
class A1, class A2, class A3>
_bi::bind_t<Rt2, _mfi::BOOST_BIND_MF_NAME(cmf2)<R, T, B1, B2>, typename _bi::list_av_3<A1, A2, A3>::type>
BOOST_BIND(boost::type<Rt2>, R (BOOST_BIND_MF_CC T::*f) (B1, B2) const, A1 a1, A2 a2, A3 a3)
{
typedef _mfi::BOOST_BIND_MF_NAME(cmf2)<R, T, B1, B2> F;
typedef typename _bi::list_av_3<A1, A2, A3>::type list_type;
return _bi::bind_t<Rt2, F, list_type>(F(f), list_type(a1, a2, a3));
}
// 3
template<class Rt2, class R, class T,
class B1, class B2, class B3,
class A1, class A2, class A3, class A4>
_bi::bind_t<Rt2, _mfi::BOOST_BIND_MF_NAME(mf3)<R, T, B1, B2, B3>, typename _bi::list_av_4<A1, A2, A3, A4>::type>
BOOST_BIND(boost::type<Rt2>, R (BOOST_BIND_MF_CC T::*f) (B1, B2, B3), A1 a1, A2 a2, A3 a3, A4 a4)
{
typedef _mfi::BOOST_BIND_MF_NAME(mf3)<R, T, B1, B2, B3> F;
typedef typename _bi::list_av_4<A1, A2, A3, A4>::type list_type;
return _bi::bind_t<Rt2, F, list_type>(F(f), list_type(a1, a2, a3, a4));
}
template<class Rt2, class R, class T,
class B1, class B2, class B3,
class A1, class A2, class A3, class A4>
_bi::bind_t<Rt2, _mfi::BOOST_BIND_MF_NAME(cmf3)<R, T, B1, B2, B3>, typename _bi::list_av_4<A1, A2, A3, A4>::type>
BOOST_BIND(boost::type<Rt2>, R (BOOST_BIND_MF_CC T::*f) (B1, B2, B3) const, A1 a1, A2 a2, A3 a3, A4 a4)
{
typedef _mfi::BOOST_BIND_MF_NAME(cmf3)<R, T, B1, B2, B3> F;
typedef typename _bi::list_av_4<A1, A2, A3, A4>::type list_type;
return _bi::bind_t<Rt2, F, list_type>(F(f), list_type(a1, a2, a3, a4));
}
// 4
|
{
"pile_set_name": "Github"
}
|
/*
* Copyright (c) 2020, the SerenityOS developers.
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions are met:
*
* 1. Redistributions of source code must retain the above copyright notice, this
* list of conditions and the following disclaimer.
*
* 2. Redistributions in binary form must reproduce the above copyright notice,
* this list of conditions and the following disclaimer in the documentation
* and/or other materials provided with the distribution.
*
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
* AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
* DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE
* FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
* DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
* SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
* CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
* OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
#include <LibELF/Loader.h>
#include <stddef.h>
#include <stdint.h>
extern "C" int LLVMFuzzerTestOneInput(const uint8_t* data, size_t size)
{
ELF::Loader::create(data, size, /*verbose_logging=*/false);
return 0;
}
|
{
"pile_set_name": "Github"
}
|
// Load modules
var Url = require('url');
var Code = require('code');
var Hawk = require('../lib');
var Lab = require('lab');
// Declare internals
var internals = {};
// Test shortcuts
var lab = exports.lab = Lab.script();
var describe = lab.experiment;
var it = lab.test;
var expect = Code.expect;
describe('Hawk', function () {
var credentialsFunc = function (id, callback) {
var credentials = {
id: id,
key: 'werxhqb98rpaxn39848xrunpaw3489ruxnpa98w4rxn',
algorithm: (id === '1' ? 'sha1' : 'sha256'),
user: 'steve'
};
return callback(null, credentials);
};
it('generates a header then successfully parse it (configuration)', function (done) {
var req = {
method: 'GET',
url: '/resource/4?filter=a',
host: 'example.com',
port: 8080
};
credentialsFunc('123456', function (err, credentials1) {
req.authorization = Hawk.client.header(Url.parse('http://example.com:8080/resource/4?filter=a'), req.method, { credentials: credentials1, ext: 'some-app-data' }).field;
expect(req.authorization).to.exist();
Hawk.server.authenticate(req, credentialsFunc, {}, function (err, credentials2, artifacts) {
expect(err).to.not.exist();
expect(credentials2.user).to.equal('steve');
expect(artifacts.ext).to.equal('some-app-data');
done();
});
});
});
it('generates a header then successfully parse it (node request)', function (done) {
var req = {
method: 'POST',
url: '/resource/4?filter=a',
headers: {
host: 'example.com:8080',
'content-type': 'text/plain;x=y'
}
};
var payload = 'some not so random text';
credentialsFunc('123456', function (err, credentials1) {
var reqHeader = Hawk.client.header('http://example.com:8080/resource/4?filter=a', req.method, { credentials: credentials1, ext: 'some-app-data', payload: payload, contentType: req.headers['content-type'] });
req.headers.authorization = reqHeader.field;
Hawk.server.authenticate(req, credentialsFunc, {}, function (err, credentials2, artifacts) {
expect(err).to.not.exist();
expect(credentials2.user).to.equal('steve');
expect(artifacts.ext).to.equal('some-app-data');
expect(Hawk.server.authenticatePayload(payload, credentials2, artifacts, req.headers['content-type'])).to.equal(true);
var res = {
headers: {
'content-type': 'text/plain'
}
};
res.headers['server-authorization'] = Hawk.server.header(credentials2, artifacts, { payload: 'some reply', contentType: 'text/plain', ext: 'response-specific' });
expect(res.headers['server-authorization']).to.exist();
expect(Hawk.client.authenticate(res, credentials2, artifacts, { payload: 'some reply' })).to.equal(true);
done();
});
});
});
it('generates a header then successfully parse it (absolute request uri)', function (done) {
var req = {
method: 'POST',
url: 'http://example.com:8080/resource/4?filter=a',
headers: {
host: 'example.com:8080',
'content-type': 'text/plain;x=y'
}
};
var payload = 'some not so random text';
credentialsFunc('123456', function (err, credentials1) {
var reqHeader = Hawk.client.header('http://example.com:8080/resource/4?filter=a', req.method, { credentials: credentials1, ext: 'some-app-data', payload: payload, contentType: req.headers['content-type'] });
req.headers.authorization = reqHeader.field;
Hawk.server.authenticate(req, credentialsFunc, {}, function (err, credentials2, artifacts) {
expect(err).to.not.exist();
expect(credentials2.user).to.equal('steve');
expect(artifacts.ext).to.equal('some-app-data');
expect(Hawk.server.authenticatePayload(payload, credentials2, artifacts, req.headers['content-type'])).to.equal(true);
var res = {
headers: {
'content-type': 'text/plain'
}
};
res.headers['server-authorization'] = Hawk.server.header(credentials2, artifacts, { payload: 'some reply', contentType: 'text/plain', ext: 'response-specific' });
expect(res.headers['server-authorization']).to.exist();
expect(Hawk.client.authenticate(res, credentials2, artifacts, { payload: 'some reply' })).to.equal(true);
done();
});
});
});
it('generates a header then successfully parse it (no server header options)', function (done) {
var req = {
method: 'POST',
url: '/resource/4?filter=a',
headers: {
host: 'example.com:8080',
'content-type': 'text/plain;x=y'
}
};
var payload = 'some not so random text';
credentialsFunc('123456', function (err, credentials1) {
var reqHeader = Hawk.client.header('http://example.com:8080/resource/4?filter=a', req.method, { credentials: credentials1, ext: 'some-app-data', payload: payload, contentType: req.headers['content-type'] });
req.headers.authorization = reqHeader.field;
Hawk.server.authenticate(req, credentialsFunc, {}, function (err, credentials2, artifacts) {
expect(err).to.not.exist();
expect(credentials2.user).to.equal('steve');
expect(artifacts.ext).to.equal('some-app-data');
expect(Hawk.server.authenticatePayload(payload, credentials2, artifacts, req.headers['content-type'])).to.equal(true);
var res = {
headers: {
'content-type': 'text/plain'
}
};
res.headers['server-authorization'] = Hawk.server.header(credentials2, artifacts);
expect(res.headers['server-authorization']).to.exist();
expect(Hawk.client.authenticate(res, credentials2, artifacts)).to.equal(true);
done();
});
});
});
it('generates a header then fails to parse it (missing server header hash)', function (done) {
var req = {
method: 'POST',
url: '/resource/4?filter=a',
headers: {
host: 'example.com:8080',
'content-type': 'text/plain;x=y'
}
};
var payload = 'some not so random text';
credentialsFunc('123456', function (err, credentials1) {
var reqHeader = Hawk.client.header('http://example.com:8080/resource/4?filter=a', req.method, { credentials: credentials1, ext: 'some-app-data', payload: payload, contentType: req.headers['content-type'] });
req.headers.authorization = reqHeader.field;
Hawk.server.authenticate(req, credentialsFunc, {}, function (err, credentials2, artifacts) {
expect(err).to.not.exist();
expect(credentials2.user).to.equal('steve');
expect(artifacts.ext).to.equal('some-app-data');
expect(Hawk.server.authenticatePayload(payload, credentials2, artifacts, req.headers['content-type'])).to
|
{
"pile_set_name": "Github"
}
|
Cython==0.29.21
numpy==1.19.1
cachetools==4.1.1
ruamel.yaml==0.16.10
eth-account==0.5.2
aioconsole==0.2.1
aiokafka==0.6.0
SQLAlchemy==1.3.18
binance==0.3
ujson==3.1.0
websockets==8.1
signalr-client-aio==0.0.1.6.2
web3==5.12.0
prompt-toolkit==3.0.5
0x-order-utils==4.0.0
0x-contract-wrappers==2.0.0
eth-bloom==1.0.3
pyperclip==1.8.0
telegram==0.0.1
jwt==1.0.0
mypy-extensions==0.4.3
python-telegram-bot==12.8
python-binance==0.7.5
pandas==1.1.0
aiohttp==3.6.2
|
{
"pile_set_name": "Github"
}
|
/*
* Copyright (c) Enalean, 2019-Present. All Rights Reserved.
*
* This file is a part of Tuleap.
*
* Tuleap 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.
*
* Tuleap is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with Tuleap. If not, see <http://www.gnu.org/licenses/>.
*/
import Vue from "vue";
import { Component, Prop } from "vue-property-decorator";
import { ColumnDefinition } from "../../../../../type";
@Component
export default class ClassesForCollapsedColumnMixin extends Vue {
@Prop({ required: true })
readonly column!: ColumnDefinition;
get classes(): string[] {
if (!this.column.is_collapsed) {
return [];
}
const classes = ["taskboard-cell-collapsed"];
if (this.column.has_hover) {
classes.push("taskboard-cell-collapsed-hover");
}
return classes;
}
}
|
{
"pile_set_name": "Github"
}
|
<?xml version="1.0" encoding="UTF-8"?>
<ajxp_plugin label="CONF_MESSAGE[Notification Center]" description="CONF_MESSAGE[Handle users watches and notifications]" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:noNamespaceSchemaLocation="file:../core.ajaxplorer/ajxp_registry.xsd">
<class_definition classname="Pydio\Notification\Core\NotificationCenter" filename="plugins/core.notifications/NotificationCenter.php"/>
<client_settings>
<resources>
<i18n namespace="notification.tpl.short" path="plugins/core.notifications/templates/short"/>
<i18n namespace="notification.tpl.long" path="plugins/core.notifications/templates/long"/>
<i18n namespace="notification.tpl.group" path="plugins/core.notifications/templates/group"/>
<i18n namespace="notification.tpl.block" path="plugins/core.notifications/templates/block"/>
<i18n namespace="notification.tpl.location" path="plugins/core.notifications/templates/location"/>
<i18n namespace="notification_center" path="plugins/core.notifications/res/i18n"/>
<js className="PydioNotifications" file="plugins/core.notifications/res/build/PydioNotifications.js" depends="React,PydioComponents"/>
</resources>
</client_settings>
<server_settings>
<param name="activate_notifications" scope="user" description="CONF_MESSAGE[Activate desktop notifications]" label="CONF_MESSAGE[Desktop Notifications]" type="button" choices="run_client_action:activateDesktopNotifications" expose="true" editable="true"/>
<global_param name="USER_EVENTS" description="CONF_MESSAGE[Display a new entry with all events happening on a user workspaces, and alerts. An SQL database must be setup for the FEED_DRIVER configuration.]" label="CONF_MESSAGE[User events and alerts]" type="boolean" default="false"/>
<global_param name="SHOW_WORKSPACES_ACTIVITY" label="CONF_MESSAGE[Display Workspaces Activity]" description="CONF_MESSAGE[Display workspaces activity to the users in the right-hand information panel]" type="boolean" default="true"/>
<global_param type="plugin_instance:feed" name="UNIQUE_FEED_INSTANCE" group="CONF_MESSAGE[Instance Params]" label="CONF_MESSAGE[Feed Instance]" description="CONF_MESSAGE[Choose the plugin]" mandatory="true" default="feed.sql"/>
</server_settings>
<registry_contributions>
<actions>
<action name="get_my_feed">
<processing>
<serverCallback methodName="loadUserFeed"/>
</processing>
</action>
<action name="feed">
<rightsContext adminOnly="false" noUser="false" read="false" userLogged="only" write="false"/>
<processing>
<serverCallback methodName="loadUserFeed" restParams="/feed_type/path+" developerComment="Load an activity feed for the given node. Filtered by what the current user is authorized to see">
<input_param name="path" type="path" description="Optional filter to get activity on a file or a folder"/>
<input_param name="format" type="string" description="html, json, xml, array (internal value)"/>
<input_param name="feed_type" type="string" description="notif, alert or all"/>
<input_param name="offset" type="integer" description="Offset for pagination"/>
<input_param name="limit" type="integer" description="Limit for pagination"/>
<input_param name="merge_description" type="boolean" description="Wether to merge notification title and description in text"/>
<input_param name="merge_description_as_label" type="boolean" description="Wether to merge notification title and description in title"/>
<input_param name="current_repository" type="boolean"
description="Wether to get activity from current repository (true), or compute all from authorized repositories for user (false)"/>
</serverCallback>
</processing>
</action>
<action name="clear_feed">
<processing><serverCallback methodName="clearUserFeed" restParams="/context_type/context_value">
<input_param name="context_type" type="string" description="all|repository|user"/>
<input_param name="context_value" type="string" description="Either empty, or a repo ID, or a userId depending on the context_type"/>
</serverCallback></processing>
</action>
<action name="dismiss_user_alert">
<gui text="notification_center.7" title="notification_center.7" iconClass="mdi mdi-close-circle" src="notification_center/ICON_SIZE/feed.png" accessKey="" hasAccessKey="false">
<context selection="true" dir="" recycle="true" actionBar="true" actionBarGroup="inline-notifications" contextMenu="false" infoPanel="false"/>
<selectionContext dir="true" file="true" recycle="false" unique="true"/>
</gui>
<rightsContext adminOnly="false" noUser="true" read="false" userLogged="only" write="false"/>
<processing>
<clientCallback module="PydioCoreActions.Callbacks.dismissUserAlert"/>
<serverCallback methodName="dismissUserAlert" restParams="/alert_id/occurences" developerComment="Dismiss one or more occurences of alerts">
<input_param name="alert_id" type="integer" description="Id passed in /feed action list"/>
<input_param name="occurences" type="integer" description="1 or more"/>
</serverCallback>
</processing>
</action>
<action name="update_alerts_last_read">
<processing>
<serverCallback methodName="updateAlertsLastRead" restParams="/repository_scope">
<input_param name="repository_scope" type="string" description="all|repositoryId"/>
</serverCallback>
</processing>
</action>
<action name="load_user_recent_items">
<processing>
<serverCallback methodName="loadRecentItemsList" restParams="/"/>
</processing>
</action>
<action name="activateDesktopNotifications">
<gui src="" iconClass="icon-rss" text="notification_center.1" title="notification_title.2">
<context dir="true" recycle="true" selection="false"/>
</gui>
<processing>
<clientCallback module="PydioCoreActions.Callbacks.activateDesktopNotifications"/>
</processing>
</action>
</actions>
<hooks>
<serverCallback methodName="persistChangeHookToFeed" hookName="node.change" defer="true"/>
<serverCallback methodName="persistReadHookToRecentList" hookName="node.read"/>
<serverCallback methodName="persistNotificationToAlerts" hookName="msg.notification"/>
<serverCallback methodName="loadRepositoryInfo" hookName="repository.load_info"/>
<serverCallback methodName="shareAssignRight" hookName="node.share.assign_right"/>
</hooks>
<client_configs>
<component_config component="InfoPanel">
<infoPanel mime="ajxp_root_node,generic_dir,generic_file" reactComponent="PydioNotifications.ActivityPanel"/>
</component_config>
<component_config component="AjxpReactComponent::left_navigator">
<additional_content
id="navigation_alerts"
position="0"
type="ListProvider"
options='{"title":"notification_center.3", "titleClassName":"colorcode-alert", "startOpen":true, "dataModelBadge":{"property":"metadata","metadata_sum":"event_occurence", "className":"alerts_number_badge"}, "fit":"content","silentLoading":true,"actionBarGroups":["inline-notifications"],"nodeProviderProperties":{"get_action":"get_my_feed", "connexion_discrete":true, "format":"xml", "current_repository":"true", "feed_type":"alert", "merge_description":"false"},"reloadOnServerMessage":"tree/reload_user_feed", "connexion_discrete":true, "tipAttribute":"event_description_long", "emptyChildrenMessage":"notification_center
|
{
"pile_set_name": "Github"
}
|
// Copyright (c) 2009-2019 The Regents of the University of Michigan
// This file is part of the HOOMD-blue project, released under the BSD 3-Clause License.
// Maintainers: jglaser, pschwende
/*! \file GlobalArray.h
\brief Defines the GlobalArray class
*/
/*! GlobalArray internally uses managed memory to store data, to allow buffers being accessed from
multiple devices.
cudaMemAdvise() can be called on GlobalArray's data, which is obtained using ::get().
GlobalArray<> supports all functionality that GPUArray<> does, and should eventually replace GPUArray.
In fact, for performance considerations in single GPU situations, GlobalArray internally falls
back on GPUArray (and whenever it doesn't have an ExecutionConfiguration). This behavior is controlled
by the result of ExecutionConfiguration::allConcurrentManagedAccess().
One difference to GPUArray is that GlobalArray doesn't zero its memory space, so it is important to
explicitly initialize the data.
Internally, GlobalArray<> uses a smart pointer to comply with RAII semantics.
As for GPUArray, access to the data is provided through ArrayHandle<> objects, with proper access_mode
and access_location flags.
*/
#pragma once
#ifdef ENABLE_CUDA
#include <cuda_runtime.h>
#endif
#include <memory>
#include "GPUArray.h"
#include "MemoryTraceback.h"
#include <type_traits>
#include <string>
#include <unistd.h>
#include <vector>
#include <sstream>
#define checkAcquired(a) { \
assert(!(a).m_acquired); \
if ((a).m_acquired) \
{ \
throw std::runtime_error("GlobalArray already acquired - ArrayHandle scoping mistake?"); \
} \
}
#define TAG_ALLOCATION(array) { \
array.setTag(std::string(#array)); \
}
namespace hoomd
{
namespace detail
{
#ifdef __GNUC__
#define GCC_VERSION (__GNUC__ * 10000 \
+ __GNUC_MINOR__ * 100 \
+ __GNUC_PATCHLEVEL__)
/* Test for GCC < 5.0 */
#if GCC_VERSION < 50000
// work around GCC missing feature
#define NO_STD_ALIGN
// https://stackoverflow.com/questions/27064791/stdalign-not-supported-by-g4-9
// https://gcc.gnu.org/bugzilla/show_bug.cgi?id=57350
inline void *my_align( std::size_t alignment, std::size_t size,
void *&ptr, std::size_t &space ) {
std::uintptr_t pn = reinterpret_cast< std::uintptr_t >( ptr );
std::uintptr_t aligned = ( pn + alignment - 1 ) & - alignment;
std::size_t padding = aligned - pn;
if ( space < size + padding ) return nullptr;
space -= padding;
return ptr = reinterpret_cast< void * >( aligned );
}
#endif
#endif
template<class T>
class managed_deleter
{
public:
//! Default constructor
managed_deleter()
: m_use_device(false), m_N(0), m_allocation_ptr(nullptr), m_allocation_bytes(0)
{}
//! Ctor
/*! \param exec_conf Execution configuration
\param use_device whether the array is managed or on the host
\param N number of elements
\param allocation_ptr true start of allocation, before alignment
\param allocation_bytes Size of allocation
*/
managed_deleter(std::shared_ptr<const ExecutionConfiguration> exec_conf,
bool use_device, std::size_t N, void *allocation_ptr, size_t allocation_bytes)
: m_exec_conf(exec_conf), m_use_device(use_device), m_N(N),
m_allocation_ptr(allocation_ptr), m_allocation_bytes(allocation_bytes)
{ }
//! Set the tag
void setTag(const std::string& tag)
{
m_tag = tag;
}
//! Destroy the items and delete the managed array
/*! \param ptr Start of aligned memory allocation
*/
void operator()(T *ptr)
{
if (ptr == nullptr)
return;
if (!m_exec_conf)
return;
#ifdef ENABLE_CUDA
if (m_use_device)
{
cudaDeviceSynchronize();
CHECK_CUDA_ERROR();
}
#endif
// we used placement new in the allocation, so call destructors explicitly
for (std::size_t i = 0; i < m_N; ++i)
{
ptr[i].~T();
}
#ifdef ENABLE_CUDA
if (m_use_device)
{
std::ostringstream oss;
oss << "Freeing " << m_allocation_bytes
<< " bytes of managed memory";
if (m_tag != "")
oss << " [" << m_tag << "]";
oss << std::endl;
this->m_exec_conf->msg->notice(10) << oss.str();
cudaFree(m_allocation_ptr);
CHECK_CUDA_ERROR();
}
else
#endif
{
free(m_allocation_ptr);
}
// update memory allocation table
if (m_exec_conf->getMemoryTracer())
this->m_exec_conf->getMemoryTracer()->unregisterAllocation(reinterpret_cast<const void *>(ptr),
sizeof(T)*m_N);
}
private:
std::shared_ptr<const ExecutionConfiguration> m_exec_conf; //!< The execution configuration
bool m_use_device; //!< Whether to use cudaMallocManaged
unsigned int m_N; //!< Number of elements in array
void *m_allocation_ptr; //!< Start of unaligned allocation
size_t m_allocation_bytes; //!< Size of actual allocation
std::string m_tag; //!< Name of the array
};
#ifdef ENABLE_CUDA
class event_deleter
{
public:
//! Default constructor
event_deleter()
{}
//! Constructor with execution configuration
/*! \param exec_conf The execution configuration (needed for CHECK_CUDA_ERROR)
*/
event_deleter(std::shared_ptr<const ExecutionConfiguration> exec_conf)
: m_exec_conf(exec_conf)
{ }
//! Destroy the event and free the memory location
/*! \param ptr Start of memory area
*/
void operator()(cudaEvent_t *ptr)
{
cudaEventDestroy(*ptr);
CHECK_CUDA_ERROR();
delete ptr;
}
private:
std::shared_ptr<const ExecutionConfiguration> m_exec_conf; //!< The execution configuration
};
#endif
} // end namespace detail
} // end namespace hoomd
//! Forward declarations
template<class T>
class GlobalArrayDispatch;
template<class T>
class ArrayHandle;
//! Definition of GlobalArray using CRTP
template<class T>
class GlobalArray : public GPUArrayBase<T, GlobalArray<T> >
{
public:
//! Empty constructor
GlobalArray()
: m_num_elements(0), m_pitch(0), m_height(0), m_acquired(false), m_align_bytes(0), m_is_managed(false)
{ }
/*! Allocate a 1D array in managed memory
\param num_elements Number of elements in array
\param exec_conf The current execution configuration
*/
GlobalArray(unsigned int num_elements, std::shared_ptr<const ExecutionConfiguration> exec_conf,
const std::string& tag = std::string(), bool force_managed=false)
: m_exec_conf(exec_conf),
#ifndef ALWAYS_USE_MANAGED_MEMORY
// explicit copy should be elided
m_fall
|
{
"pile_set_name": "Github"
}
|
K 10
svn:ignore
V 4
obj
END
|
{
"pile_set_name": "Github"
}
|
// Copyright 2019 The MediaPipe 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.
#include "mediapipe/gpu/gl_context.h"
#include <sys/types.h>
#include <cmath>
#include <memory>
#include <string>
#include <utility>
#include "absl/base/dynamic_annotations.h"
#include "absl/memory/memory.h"
#include "absl/synchronization/mutex.h"
#include "mediapipe/framework/port/logging.h"
#include "mediapipe/framework/port/ret_check.h"
#include "mediapipe/framework/port/status.h"
#include "mediapipe/framework/port/status_builder.h"
#include "mediapipe/gpu/gl_context_internal.h"
#ifndef __EMSCRIPTEN__
#include "absl/debugging/leak_check.h"
#include "mediapipe/gpu/gl_thread_collector.h"
#endif
#ifndef GL_MAJOR_VERSION
#define GL_MAJOR_VERSION 0x821B
#endif
#ifndef GL_MINOR_VERSION
#define GL_MINOR_VERSION 0x821C
#endif
namespace mediapipe {
static void SetThreadName(const char* name) {
#if defined(__GLIBC_PREREQ)
#define LINUX_STYLE_SETNAME_NP __GLIBC_PREREQ(2, 12)
#elif defined(__BIONIC__)
#define LINUX_STYLE_SETNAME_NP 1
#endif // __GLIBC_PREREQ
#if LINUX_STYLE_SETNAME_NP
char thread_name[16]; // Linux requires names (with nul) fit in 16 chars
strncpy(thread_name, name, sizeof(thread_name));
thread_name[sizeof(thread_name) - 1] = '\0';
int res = pthread_setname_np(pthread_self(), thread_name);
if (res != 0) {
LOG_FIRST_N(INFO, 1) << "Can't set pthread names: name: \"" << name
<< "\"; error: " << res;
}
#elif __APPLE__
pthread_setname_np(name);
#endif
ANNOTATE_THREAD_NAME(name);
}
GlContext::DedicatedThread::DedicatedThread() {
CHECK_EQ(pthread_create(&gl_thread_id_, nullptr, ThreadBody, this), 0);
}
GlContext::DedicatedThread::~DedicatedThread() {
if (IsCurrentThread()) {
CHECK(self_destruct_);
CHECK_EQ(pthread_detach(gl_thread_id_), 0);
} else {
// Give an invalid job to signal termination.
PutJob({});
CHECK_EQ(pthread_join(gl_thread_id_, nullptr), 0);
}
}
void GlContext::DedicatedThread::SelfDestruct() {
self_destruct_ = true;
// Give an invalid job to signal termination.
PutJob({});
}
GlContext::DedicatedThread::Job GlContext::DedicatedThread::GetJob() {
absl::MutexLock lock(&mutex_);
while (jobs_.empty()) {
has_jobs_cv_.Wait(&mutex_);
}
Job job = std::move(jobs_.front());
jobs_.pop_front();
return job;
}
void GlContext::DedicatedThread::PutJob(Job job) {
absl::MutexLock lock(&mutex_);
jobs_.push_back(std::move(job));
has_jobs_cv_.SignalAll();
}
void* GlContext::DedicatedThread::ThreadBody(void* instance) {
DedicatedThread* thread = static_cast<DedicatedThread*>(instance);
thread->ThreadBody();
return nullptr;
}
#ifdef __APPLE__
#define AUTORELEASEPOOL @autoreleasepool
#else
#define AUTORELEASEPOOL
#endif // __APPLE__
void GlContext::DedicatedThread::ThreadBody() {
SetThreadName("mediapipe_gl_runner");
#ifndef __EMSCRIPTEN__
GlThreadCollector::ThreadStarting();
#endif
// The dedicated GL thread is not meant to be used on Apple platforms, but
// in case it is, the use of an autorelease pool here will reap each task's
// temporary allocations.
while (true) AUTORELEASEPOOL {
Job job = GetJob();
// Lack of a job means termination. Or vice versa.
if (!job) {
break;
}
job();
}
if (self_destruct_) {
delete this;
}
#ifndef __EMSCRIPTEN__
GlThreadCollector::ThreadEnding();
#endif
}
::mediapipe::Status GlContext::DedicatedThread::Run(GlStatusFunction gl_func) {
// Neither ENDO_SCOPE nor ENDO_TASK seem to work here.
if (IsCurrentThread()) {
return gl_func();
}
bool done = false; // Guarded by mutex_ after initialization.
::mediapipe::Status status;
PutJob([this, gl_func, &done, &status]() {
status = gl_func();
absl::MutexLock lock(&mutex_);
done = true;
gl_job_done_cv_.SignalAll();
});
absl::MutexLock lock(&mutex_);
while (!done) {
gl_job_done_cv_.Wait(&mutex_);
}
return status;
}
void GlContext::DedicatedThread::RunWithoutWaiting(GlVoidFunction gl_func) {
// Note: this is invoked by GlContextExecutor. To avoid starvation of
// non-calculator tasks in the presence of GL source calculators, calculator
// tasks must always be scheduled as new tasks, or another solution needs to
// be set up to avoid starvation. See b/78522434.
CHECK(gl_func);
PutJob(std::move(gl_func));
}
bool GlContext::DedicatedThread::IsCurrentThread() {
return pthread_equal(gl_thread_id_, pthread_self());
}
bool GlContext::ParseGlVersion(absl::string_view version_string, GLint* major,
GLint* minor) {
size_t pos = version_string.find('.');
if (pos == absl::string_view::npos || pos < 1) {
return false;
}
// GL_VERSION is supposed to start with the version number; see, e.g.,
// https://www.khronos.org/registry/OpenGL-Refpages/es3/html/glGetString.xhtml
// https://www.khronos.org/opengl/wiki/OpenGL_Context#OpenGL_version_number
// However, in rare cases one will encounter non-conforming configurations
// that have some prefix before the number. To deal with that, we walk
// backwards from the dot.
size_t start = pos - 1;
while (start > 0 && isdigit(version_string[start - 1])) --start;
if (!absl::SimpleAtoi(version_string.substr(start, (pos - start)), major)) {
return false;
}
auto rest = version_string.substr(pos + 1);
pos = rest.find(' ');
size_t pos2 = rest.find('.');
if (pos == absl::string_view::npos ||
(pos2 != absl::string_view::npos && pos2 < pos)) {
pos = pos2;
}
if (!absl
|
{
"pile_set_name": "Github"
}
|
namespace Scada.Scheme.Model.PropertyGrid
{
partial class FrmFontDialog
{
/// <summary>
/// Required designer variable.
/// </summary>
private System.ComponentModel.IContainer components = null;
/// <summary>
/// Clean up any resources being used.
/// </summary>
/// <param name="disposing">true if managed resources should be disposed; otherwise, false.</param>
protected override void Dispose(bool disposing)
{
if (disposing && (components != null))
{
components.Dispose();
}
base.Dispose(disposing);
}
#region Windows Form Designer generated code
/// <summary>
/// Required method for Designer support - do not modify
/// the contents of this method with the code editor.
/// </summary>
private void InitializeComponent()
{
this.lblFontName = new System.Windows.Forms.Label();
this.lblFontSize = new System.Windows.Forms.Label();
this.btnCancel = new System.Windows.Forms.Button();
this.btnOK = new System.Windows.Forms.Button();
this.cbFontSize = new System.Windows.Forms.ComboBox();
this.gbStyle = new System.Windows.Forms.GroupBox();
this.chkUnderline = new System.Windows.Forms.CheckBox();
this.chkItalic = new System.Windows.Forms.CheckBox();
this.chkBold = new System.Windows.Forms.CheckBox();
this.cbFontName = new System.Windows.Forms.ComboBox();
this.gbStyle.SuspendLayout();
this.SuspendLayout();
//
// lblFontName
//
this.lblFontName.AutoSize = true;
this.lblFontName.Location = new System.Drawing.Point(9, 9);
this.lblFontName.Name = "lblFontName";
this.lblFontName.Size = new System.Drawing.Size(28, 13);
this.lblFontName.TabIndex = 0;
this.lblFontName.Text = "Font";
//
// lblFontSize
//
this.lblFontSize.AutoSize = true;
this.lblFontSize.Location = new System.Drawing.Point(165, 9);
this.lblFontSize.Name = "lblFontSize";
this.lblFontSize.Size = new System.Drawing.Size(27, 13);
this.lblFontSize.TabIndex = 2;
this.lblFontSize.Text = "Size";
//
// btnCancel
//
this.btnCancel.DialogResult = System.Windows.Forms.DialogResult.Cancel;
this.btnCancel.Location = new System.Drawing.Point(193, 153);
this.btnCancel.Name = "btnCancel";
this.btnCancel.Size = new System.Drawing.Size(75, 23);
this.btnCancel.TabIndex = 6;
this.btnCancel.Text = "Cancel";
this.btnCancel.UseVisualStyleBackColor = true;
//
// btnOK
//
this.btnOK.Location = new System.Drawing.Point(112, 153);
this.btnOK.Name = "btnOK";
this.btnOK.Size = new System.Drawing.Size(75, 23);
this.btnOK.TabIndex = 5;
this.btnOK.Text = "OK";
this.btnOK.UseVisualStyleBackColor = true;
this.btnOK.Click += new System.EventHandler(this.btnOK_Click);
//
// cbFontSize
//
this.cbFontSize.FormattingEnabled = true;
this.cbFontSize.Items.AddRange(new object[] {
"8",
"9",
"10",
"11",
"12",
"14",
"16",
"18",
"20",
"22",
"24",
"26",
"28",
"36",
"48",
"72"});
this.cbFontSize.Location = new System.Drawing.Point(168, 25);
this.cbFontSize.Name = "cbFontSize";
this.cbFontSize.Size = new System.Drawing.Size(100, 21);
this.cbFontSize.TabIndex = 3;
//
// gbStyle
//
this.gbStyle.Controls.Add(this.chkUnderline);
this.gbStyle.Controls.Add(this.chkItalic);
this.gbStyle.Controls.Add(this.chkBold);
this.gbStyle.Location = new System.Drawing.Point(12, 52);
this.gbStyle.Name = "gbStyle";
this.gbStyle.Padding = new System.Windows.Forms.Padding(10, 3, 10, 10);
this.gbStyle.Size = new System.Drawing.Size(256, 95);
this.gbStyle.TabIndex = 4;
this.gbStyle.TabStop = false;
this.gbStyle.Text = "Style";
//
// chkUnderline
//
this.chkUnderline.AutoSize = true;
this.chkUnderline.Location = new System.Drawing.Point(13, 65);
this.chkUnderline.Name = "chkUnderline";
this.chkUnderline.Size = new System.Drawing.Size(71, 17);
this.chkUnderline.TabIndex = 2;
this.chkUnderline.Text = "Underline";
this.chkUnderline.UseVisualStyleBackColor = true;
//
// chkItalic
//
this.chkItalic.AutoSize = true;
this.chkItalic.Location = new System.Drawing.Point(13, 42);
this.chkItalic.Name = "chkItalic";
this.chkItalic.Size = new System.Drawing.Size(48, 17);
this.chkItalic.TabIndex = 1;
this.chkItalic.Text = "Italic";
this.chkItalic.UseVisualStyleBackColor = true;
//
// chkBold
//
this.chkBold.AutoSize = true;
this.chkBold.Location = new System.Drawing.Point(13, 19);
this.chkBold.Name = "chkBold";
this.chkBold.Size = new System.Drawing.Size(47, 17);
this.chkBold.TabIndex = 0;
this.chkBold.Text = "Bold";
this.chkBold.UseVisualStyleBackColor = true;
//
// cbFontName
//
this.cbFontName.DrawMode = System.Windows.Forms.DrawMode.OwnerDrawVariable;
this.cbFontName.FormattingEnabled = true;
this.cbFontName.Location = new System.Drawing.Point(12, 25);
this.cbFontName.Name = "cbFontName";
this.cbFontName.Size = new System.Drawing.Size(150, 21);
this.cbFontName.TabIndex = 1;
this.cbFontName.DrawItem += new System.Windows.Forms.DrawItemEventHandler(this.cbFontName_DrawItem);
this.cbFontName.MeasureItem += new System.Windows.Forms.MeasureItemEventHandler(this.cbFontName_MeasureItem);
//
// FrmFontDialog
//
this.AcceptButton = this.btnOK;
this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F);
this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
this.CancelButton = this.btnCancel;
this.ClientSize = new System.Drawing.Size(281, 188);
this.Controls.Add(this.cbFontName);
this.Controls.Add(this.gbStyle);
this.Controls.Add(this.cbFontSize);
this.Controls.Add(this.btnOK);
this.Controls.Add(this.btnCancel);
this.Controls.Add(this.lblFontSize);
this.Controls.Add(this.lbl
|
{
"pile_set_name": "Github"
}
|
#
class ClassPropertyDescriptor:
"""
ClassPropertyDescriptor
"""
def __init__(self, fget, fset=None):
self.fget = fget
self.fset = fset
def __get__(self, obj, klass=None):
"""
__get__
"""
if klass is None:
klass = type(obj)
return self.fget.__get__(obj, klass)()
def __set__(self, obj, value):
"""
__set__
"""
if not self.fset:
raise AttributeError("can't set attribute")
type_ = type(obj)
return self.fset.__get__(obj, type_)(value)
def setter(self, func):
"""
setter
"""
if not isinstance(func, (classmethod, staticmethod)):
func = classmethod(func)
self.fset = func
return self
def classproperty(func):
"""
classproperty
"""
if not isinstance(func, (classmethod, staticmethod)):
func = classmethod(func)
return ClassPropertyDescriptor(func)
|
{
"pile_set_name": "Github"
}
|
/* Command line option handling.
Copyright (C) 2002-2020 Free Software Foundation, Inc.
This file is part of GCC.
GCC is free software; you can redistribute it and/or modify it under
the terms of the GNU General Public License as published by the Free
Software Foundation; either version 3, or (at your option) any later
version.
GCC is distributed in the hope that it will be useful, but WITHOUT ANY
WARRANTY; without even the implied warranty of MERCHANTABILITY or
FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
for more details.
You should have received a copy of the GNU General Public License
along with GCC; see the file COPYING3. If not see
<http://www.gnu.org/licenses/>. */
#ifndef GCC_OPTS_H
#define GCC_OPTS_H
#include "obstack.h"
/* Specifies how a switch's VAR_VALUE relates to its FLAG_VAR. */
enum cl_var_type {
/* The switch is enabled when FLAG_VAR is nonzero. */
CLVC_BOOLEAN,
/* The switch is enabled when FLAG_VAR == VAR_VALUE. */
CLVC_EQUAL,
/* The switch is enabled when VAR_VALUE is not set in FLAG_VAR. */
CLVC_BIT_CLEAR,
/* The switch is enabled when VAR_VALUE is set in FLAG_VAR. */
CLVC_BIT_SET,
/* The switch is enabled when FLAG_VAR is less than HOST_WIDE_INT_M1U. */
CLVC_SIZE,
/* The switch takes a string argument and FLAG_VAR points to that
argument. */
CLVC_STRING,
/* The switch takes an enumerated argument (VAR_ENUM says what
enumeration) and FLAG_VAR points to that argument. */
CLVC_ENUM,
/* The switch should be stored in the VEC pointed to by FLAG_VAR for
later processing. */
CLVC_DEFER
};
struct cl_option
{
/* Text of the option, including initial '-'. */
const char *opt_text;
/* Help text for --help, or NULL. */
const char *help;
/* Error message for missing argument, or NULL. */
const char *missing_argument_error;
/* Warning to give when this option is used, or NULL. */
const char *warn_message;
/* Argument of alias target when positive option given, or NULL. */
const char *alias_arg;
/* Argument of alias target when negative option given, or NULL. */
const char *neg_alias_arg;
/* Alias target, or N_OPTS if not an alias. */
unsigned short alias_target;
/* Previous option that is an initial substring of this one, or
N_OPTS if none. */
unsigned short back_chain;
/* Option length, not including initial '-'. */
unsigned char opt_len;
/* Next option in a sequence marked with Negative, or -1 if none.
For a single option with both a negative and a positve form
(such as -Wall and -Wno-all), NEG_IDX is equal to the option's
own index (i.e., cl_options[IDX].neg_idx == IDX holds). */
int neg_index;
/* CL_* flags for this option. */
unsigned int flags;
/* Disabled in this configuration. */
BOOL_BITFIELD cl_disabled : 1;
/* Options marked with CL_SEPARATE take a number of separate
arguments (1 to 4) that is one more than the number in this
bit-field. */
unsigned int cl_separate_nargs : 2;
/* Option is an alias when used with separate argument. */
BOOL_BITFIELD cl_separate_alias : 1;
/* Alias to negative form of option. */
BOOL_BITFIELD cl_negative_alias : 1;
/* Option takes no argument in the driver. */
BOOL_BITFIELD cl_no_driver_arg : 1;
/* Reject this option in the driver. */
BOOL_BITFIELD cl_reject_driver : 1;
/* Reject no- form. */
BOOL_BITFIELD cl_reject_negative : 1;
/* Missing argument OK (joined). */
BOOL_BITFIELD cl_missing_ok : 1;
/* Argument is an integer >=0. */
BOOL_BITFIELD cl_uinteger : 1;
/* Argument is a HOST_WIDE_INT. */
BOOL_BITFIELD cl_host_wide_int : 1;
/* Argument should be converted to lowercase. */
BOOL_BITFIELD cl_tolower : 1;
/* Report argument with -fverbose-asm */
BOOL_BITFIELD cl_report : 1;
/* Argument is an unsigned integer with an optional byte suffix. */
BOOL_BITFIELD cl_byte_size: 1;
/* Offset of field for this option in struct gcc_options, or
(unsigned short) -1 if none. */
unsigned short flag_var_offset;
/* Index in cl_enums of enum used for this option's arguments, for
CLVC_ENUM options. */
unsigned short var_enum;
/* How this option's value is determined and sets a field. */
enum cl_var_type var_type;
/* Value or bit-mask with which to set a field. */
HOST_WIDE_INT var_value;
/* Range info minimum, or -1. */
int range_min;
/* Range info maximum, or -1. */
int range_max;
};
/* Records that the state of an option consists of SIZE bytes starting
at DATA. DATA might point to CH in some cases. */
struct cl_option_state {
const void *data;
size_t size;
char ch;
};
extern const struct cl_option cl_options[];
extern const unsigned int cl_options_count;
extern const char *const lang_names[];
extern const unsigned int cl_lang_count;
#define CL_PARAMS (1U << 16) /* Fake entry. Used to display --param info with --help. */
#define CL_WARNING (1U << 17) /* Enables an (optional) warning message. */
#define CL_OPTIMIZATION (1U << 18) /* Enables an (optional) optimization. */
#define CL_DRIVER (1U << 19) /* Driver option. */
#define CL_TARGET (1U << 20) /* Target-specific option. */
#define CL_COMMON (1U << 21) /* Language-independent. */
#define CL_MIN_OPTION_CLASS CL_PARAMS
#define CL_MAX_OPTION_CLASS CL_COMMON
/* From here on the bits describe attributes of the options.
Before this point the bits have described the class of the option.
This distinction is important because --help will not list options
which only have these higher bits set. */
#define CL_JOINED (1U << 22) /* If takes joined argument. */
#define CL_SEPARATE (1U << 23) /* If takes a separate argument. */
#define CL_UNDOCUMENTED (1U << 24) /* Do not output with --help. */
#define CL_NO_DWARF_RECORD (1U << 25) /* Do not add to producer string. */
#define CL_PCH_IGNORE (1U << 26) /* Do compare state for pch. */
/* Flags for an enumerated option argument. */
#define CL_ENUM_CANONICAL (1 << 0) /* Canonical for this value. */
#define CL_ENUM_DRIVER_ONLY (1 << 1) /* Only accepted in the driver. */
/* Structure describing an enumerated option argument. */
struct cl_enum_arg
{
/* The argument text, or NULL at the end of the array. */
const char *arg;
/* The corresponding integer value. */
int value;
/* Flags associated with this argument. */
unsigned int flags;
};
/* Structure describing an enumerated set of option arguments. */
struct cl_enum
{
/* Help text, or NULL
|
{
"pile_set_name": "Github"
}
|
# frozen_string_literal: true
require 'spec_helper'
describe 'Rake task buttons', type: :feature do
before do
sign_in_as_user FactoryGirl.create(:superuser)
# The following is necessary to "undo" a stub / mock called for all feature
# specs that was designed to avoid weird issues with persistent AppConfig
# settings across tests. In principle, we shouldn't really be using mock
# data in feature specs, but rather than try to fix all specs we're going to
# just make sure that for these specs we get an actual AppConfig object so
# that the form renders correctly. For reference, the stub occurs in
# spec/support/app_config_helpers.rb, called in
# spec/support/feature_helpers.rb.
FactoryGirl.create(:app_config).tap do |ac|
allow(AppConfig).to receive(:first).and_return(ac)
end
end
it 'works for daily tasks' do
visit root_path
click_on 'Settings'
click_on 'Run Daily Tasks'
expect(page).to have_css('.alert-success',
text: /Daily tasks queued and running/)
end
it 'works for hourly tasks' do
visit root_path
click_on 'Settings'
click_on 'Run Hourly Tasks'
expect(page).to have_css('.alert-success',
text: /Hourly tasks queued and running/)
end
end
|
{
"pile_set_name": "Github"
}
|
#ifndef DEMO_MODEL_H
#define DEMO_MODEL_H
#include <Aabb.h>
#include <Timer.h>
#include <DX12_ResourceDescTable.h>
#include <SkinnedDecals.h>
#define CURRENT_DEMO_MODEL_VERSION 1
#define SKINNING_THREAD_GROUP_SIZE 64
class DX12_PipelineState;
class DX12_Buffer;
class DX12_TimerQuery;
class Material;
class Shading;
struct WeightIndex
{
UINT firstIndex;
UINT numIndices;
};
struct Weight
{
UINT jointIndex;
float weight;
Vector3 position;
Vector3 normal;
Vector3 tangent;
};
struct Joint
{
Vector3 translation;
Quat rotation;
};
struct AnimFrame
{
Joint *joints;
Aabb bounds;
};
struct DemoSubModel
{
DemoSubModel():
baseNoDecalsPS(nullptr),
baseWithDecalsPS(nullptr),
material(nullptr),
firstIndex(0),
numIndices(0)
{
}
DX12_PipelineState *baseNoDecalsPS;
DX12_PipelineState *baseWithDecalsPS;
DX12_ResourceDescTable materialDT;
Material *material;
UINT firstIndex;
UINT numIndices;
};
// DemoModel
//
// Simple model format (".model") for storing animated models (only one animation set is supported).
// Data generated by loading a MD5 model, precalculating all information that is required for culling,
// skinning and rendering the model, and storing these information into a binary file format.
class DemoModel
{
public:
friend class SkinnedDecals;
struct ModelConstData
{
Matrix4 transformMatrix;
UINT numVertices;
UINT debugDecalMask;
};
DemoModel():
subModels(nullptr),
animFrames(nullptr),
numSubModels(0),
numJoints(0),
numAnimFrames(0),
currentAnimFrameIndex(0),
nextAnimFrameIndex(0),
pauseAnim(false),
visible(false),
useDecals(true),
debugDecalMask(false),
indexBuffer(nullptr),
weightIndexSB(nullptr),
weightSB(nullptr),
jointSB(nullptr),
vertexPositionSB(nullptr),
vertexNormalSB(nullptr),
vertexTangentSB(nullptr),
vertexUvHandednessSB(nullptr),
modelCB(nullptr),
skinningPS(nullptr),
skinningTQ(nullptr),
basePassTQ(nullptr),
skinnedDecals(nullptr),
shadingPP(nullptr)
{
interpAnimFrame.joints = nullptr;
}
~DemoModel()
{
Release();
}
void Release();
bool Load(const char *filename);
bool InitSkinnedDecals(const char** materialNames, UINT numMaterials);
void Render();
const DemoSubModel* GetSubModel(UINT index) const
{
assert(index < numSubModels);
return &subModels[index];
}
UINT GetNumSubModels() const
{
return numSubModels;
}
void SetPosition(const Vector3 &position)
{
this->position = position;
}
Vector3 GetPosition() const
{
return position;
}
void SetRotation(const Vector3 &rotation)
{
this->rotation = rotation;
}
Vector3 GetRotation() const
{
return rotation;
}
const Aabb& GetBounds() const
{
return interpAnimFrame.bounds;
}
void PauseAnim(bool pauseAnim)
{
this->pauseAnim = pauseAnim;
}
bool IsAnimPaused() const
{
return pauseAnim;
}
void UseDecals(bool useDecals)
{
this->useDecals = useDecals;
}
bool AreDecalsUsed() const
{
return useDecals;
}
void EnableDebugDecalMask(bool enable)
{
debugDecalMask = enable;
}
bool IsDebugDecalMaskEnabled() const
{
return debugDecalMask;
}
float GetSkinningGpuTime() const
{
return skinningTQ->GetGpuElapsedTime();
}
float GetBasePassGpuTime() const
{
return basePassTQ->GetGpuElapsedTime();
}
SkinnedDecals *GetSkinnedDecals()
{
return skinnedDecals;
}
private:
void UpdateSkeleton();
void UpdateBuffers();
void PerformSkinning();
void RenderBasePass();
DemoSubModel *subModels;
AnimFrame *animFrames;
AnimFrame interpAnimFrame;
Timer animTimer;
UINT numSubModels;
UINT numJoints;
UINT numAnimFrames;
UINT currentAnimFrameIndex, nextAnimFrameIndex;
ModelConstData modelConstData;
Vector3 position;
Vector3 rotation;
bool pauseAnim;
bool visible;
bool useDecals;
bool debugDecalMask;
DX12_Buffer *indexBuffer;
DX12_Buffer *weightIndexSB;
DX12_Buffer *weightSB;
DX12_Buffer *jointSB;
DX12_Buffer *vertexPositionSB;
DX12_Buffer *vertexNormalSB;
DX12_Buffer *vertexTangentSB;
DX12_Buffer *vertexUvHandednessSB;
DX12_Buffer *modelCB;
DX12_PipelineState *skinningPS;
DX12_ResourceDescTable skinningDT;
DX12_ResourceDescTable basePassVertexDT;
DX12_TimerQuery *skinningTQ;
DX12_TimerQuery *basePassTQ;
SkinnedDecals *skinnedDecals;
Shading *shadingPP;
};
#endif
|
{
"pile_set_name": "Github"
}
|
use strict;
use warnings;
use Net::EmptyPort qw(check_port empty_port);
use Test::More;
use t::Util;
plan skip_all => 'curl not found'
unless prog_exists('curl');
plan skip_all => 'curl does not support HTTP/2'
unless curl_supports_http2();
my $upstream_port = empty_port();
$| = 1;
my $socket = new IO::Socket::INET (
LocalHost => '127.0.0.1',
LocalPort => $upstream_port,
Proto => 'tcp',
Listen => 1,
Reuse => 1
);
die "cannot create socket $!\n" unless $socket;
check_port($upstream_port) or die "can't connect to server socket";
# accept and close check_port's connection
my $client_socket = $socket->accept();
close($client_socket);
my $server = spawn_h2o(<< "EOT");
hosts:
default:
paths:
"/":
proxy.reverse.url: http://127.0.0.1:$upstream_port
EOT
sub doone {
my $cmd = shift;
my $upstream_response = shift;
my $expected = shift;
my $test_description = shift;
die unless pipe(my $reader, my $writer);
my $pid = fork();
die if not defined $pid;
if ($pid == 0) {
$| = 1;
close($reader);
print $writer qx{$cmd};
close($writer);
exit(0);
}
close($writer);
my $req;
$client_socket = $socket->accept();
$client_socket->recv($req, 1024);
$client_socket->send($upstream_response);
close($client_socket);
my $curl_output = do { local $/; <$reader> };
like $curl_output, qr{$expected}, $test_description;
close($reader);
wait();
}
sub doit {
my $proto = shift;
my $cmd = "curl -k -svo /dev/null --http${proto} https://127.0.0.1:$server->{'tls_port'}/ 2>&1";
my $resp_preface = "HTTP/1.1 200 Ok\r\nTransfer-encoding:chunked\r\n\r\n";
my $err_string = "Illegal or missing hexadecimal sequence in chunked-encoding";
if ($proto == "2") {
# curl-7.57.0 includes "was not closed cleanly"
# curl-7.68.0 includes "left intact"
$err_string = qr{(?:left intact|was not closed cleanly)};
}
doone($cmd, $resp_preface."1\r\na", "left intact", "HTTP/$proto curl reports a clean connection on missing \\r\\n0\\r\\n");
doone($cmd, $resp_preface, $err_string, "HTTP/$proto curl reports a broken connection when upstream sent no chunks");
doone($cmd, $resp_preface."2\r\na", $err_string, "HTTP/$proto curl reports a broken connection on truncated chunk");
doone($cmd, $resp_preface."1", $err_string, "HTTP/$proto curl reports a broken connection on truncated chunk size");
}
subtest "HTTP/1.1" => sub {
doit("1.1");
};
subtest "HTTP/2" => sub {
doit("2");
};
$socket->close();
done_testing();
|
{
"pile_set_name": "Github"
}
|
#include <CtrlLib/CtrlLib.h>
#include <plugin/jpg/jpg.h>
using namespace Upp;
static void sLoadImage(const String& path, Image& result)
{
result = StreamRaster::LoadFileAny(path);
}
GUI_APP_MAIN
{
FileSel fs;
fs.AllFilesType();
fs.Type("Text", "*.txt");
fs.WhenIconLazy = sLoadImage;
fs.ExecuteOpen();
}
|
{
"pile_set_name": "Github"
}
|
"""runpy.py - locating and running Python code using the module namespace
Provides support for locating and running Python scripts using the Python
module namespace instead of the native filesystem.
This allows Python code to play nicely with non-filesystem based PEP 302
importers when locating support scripts as well as when importing modules.
"""
# Written by Nick Coghlan <ncoghlan at gmail.com>
# to implement PEP 338 (Executing Modules as Scripts)
import sys
import imp
from pkgutil import read_code
try:
from imp import get_loader
except ImportError:
from pkgutil import get_loader
__all__ = [
"run_module", "run_path",
]
class _TempModule(object):
"""Temporarily replace a module in sys.modules with an empty namespace"""
def __init__(self, mod_name):
self.mod_name = mod_name
self.module = imp.new_module(mod_name)
self._saved_module = []
def __enter__(self):
mod_name = self.mod_name
try:
self._saved_module.append(sys.modules[mod_name])
except KeyError:
pass
sys.modules[mod_name] = self.module
return self
def __exit__(self, *args):
if self._saved_module:
sys.modules[self.mod_name] = self._saved_module[0]
else:
del sys.modules[self.mod_name]
self._saved_module = []
class _ModifiedArgv0(object):
def __init__(self, value):
self.value = value
self._saved_value = self._sentinel = object()
def __enter__(self):
if self._saved_value is not self._sentinel:
raise RuntimeError("Already preserving saved value")
self._saved_value = sys.argv[0]
sys.argv[0] = self.value
def __exit__(self, *args):
self.value = self._sentinel
sys.argv[0] = self._saved_value
def _run_code(code, run_globals, init_globals=None,
mod_name=None, mod_fname=None,
mod_loader=None, pkg_name=None):
"""Helper to run code in nominated namespace"""
if init_globals is not None:
run_globals.update(init_globals)
run_globals.update(__name__ = mod_name,
__file__ = mod_fname,
__loader__ = mod_loader,
__package__ = pkg_name)
exec code in run_globals
return run_globals
def _run_module_code(code, init_globals=None,
mod_name=None, mod_fname=None,
mod_loader=None, pkg_name=None):
"""Helper to run code in new namespace with sys modified"""
with _TempModule(mod_name) as temp_module, _ModifiedArgv0(mod_fname):
mod_globals = temp_module.module.__dict__
_run_code(code, mod_globals, init_globals,
mod_name, mod_fname, mod_loader, pkg_name)
# Copy the globals of the temporary module, as they
# may be cleared when the temporary module goes away
return mod_globals.copy()
# This helper is needed due to a missing component in the PEP 302
# loader protocol (specifically, "get_filename" is non-standard)
# Since we can't introduce new features in maintenance releases,
# support was added to zipimporter under the name '_get_filename'
def _get_filename(loader, mod_name):
for attr in ("get_filename", "_get_filename"):
meth = getattr(loader, attr, None)
if meth is not None:
return meth(mod_name)
return None
# Helper to get the loader, code and filename for a module
def _get_module_details(mod_name):
loader = get_loader(mod_name)
if loader is None:
raise ImportError("No module named %s" % mod_name)
if loader.is_package(mod_name):
if mod_name == "__main__" or mod_name.endswith(".__main__"):
raise ImportError("Cannot use package as __main__ module")
try:
pkg_main_name = mod_name + ".__main__"
return _get_module_details(pkg_main_name)
except ImportError, e:
raise ImportError(("%s; %r is a package and cannot " +
"be directly executed") %(e, mod_name))
code = loader.get_code(mod_name)
if code is None:
raise ImportError("No code object available for %s" % mod_name)
filename = _get_filename(loader, mod_name)
return mod_name, loader, code, filename
def _get_main_module_details():
# Helper that gives a nicer error message when attempting to
# execute a zipfile or directory by invoking __main__.py
main_name = "__main__"
try:
return _get_module_details(main_name)
except ImportError as exc:
if main_name in str(exc):
raise ImportError("can't find %r module in %r" %
(main_name, sys.path[0]))
raise
# This function is the actual implementation of the -m switch and direct
# execution of zipfiles and directories and is deliberately kept private.
# This avoids a repeat of the situation where run_module() no longer met the
# needs of mainmodule.c, but couldn't be changed because it was public
def _run_module_as_main(mod_name, alter_argv=True):
"""Runs the designated module in the __main__ namespace
Note that the executed module will have full access to the
__main__ namespace. If this is not desirable, the run_module()
function should be used to run the module code in a fresh namespace.
At the very least, these variables in __main__ will be overwritten:
__name__
__file__
__loader__
__package__
"""
try:
if alter_argv or mod_name != "__main__": # i.e. -m switch
mod_name, loader, code, fname = _get_module_details(mod_name)
else: # i.e. directory or zipfile execution
mod_name, loader, code, fname = _get_main_module_details()
except ImportError as exc:
msg = "%s: %s" % (sys.executable, str(exc))
sys.exit(msg)
pkg_name = mod_name.rpartition('.')[0]
main_globals = sys.modules["__main__"].__dict__
if alter_argv:
sys.argv[0] = fname
return _run_code(code, main_globals, None,
"__main__", fname, loader, pkg_name)
def run_module(mod_name, init_globals=None,
run_name=None, alter_sys=False):
"""Execute a module's code without importing it
Returns the resulting top level namespace dictionary
"""
mod_name, loader, code, fname = _get_module_details(mod_name)
if run_name is None:
run_name = mod_name
pkg_name = mod_name.rpartition('.')[0]
if alter_sys:
return _run_module_code(code, init_globals, run_name,
fname, loader, pkg_name)
else:
# Leave the sys module alone
return _run_code(code, {}, init_globals, run_name,
fname, loader, pkg_name)
# XXX (ncoghlan): Perhaps expose the C API function
# as imp.get_importer instead of reimplementing it in Python?
def _get_importer(path_name):
"""Python version of PyImport_GetImporter C API function"""
cache = sys.path_importer_cache
try:
importer = cache[path_name]
|
{
"pile_set_name": "Github"
}
|
@ECHO OFF
FOR /F "tokens=*" %%G IN ('DIR /B /AD /S _ReSharper.*') DO echo "%%G" && rd /Q /S "%%G"
FOR /F "tokens=*" %%G IN ('DIR /B /AD /S *Debug*') DO echo "%%G" && rd /Q /S "%%G"
FOR /F "tokens=*" %%G IN ('DIR /B /AD /S *Release*') DO echo "%%G" && rd /Q /S "%%G"
FOR /F "tokens=*" %%G IN ('DIR /B /AD /S *ipch') DO echo "%%G" && rd /Q /S "%%G"
FOR /F "tokens=*" %%G IN ('DIR /B /S *.user') DO echo "%%G" && del /Q "%%G"
FOR /F "tokens=*" %%G IN ('DIR /B /S *.bak') DO echo "%%G" && del /Q "%%G"
FOR /F "tokens=*" %%G IN ('DIR /B /S *.ncb') DO echo "%%G" && del /Q "%%G"
FOR /F "tokens=*" %%G IN ('DIR /B /S *.zip') DO echo "%%G" && del /Q "%%G"
FOR /F "tokens=*" %%G IN ('DIR /B /S *.xml') DO echo "%%G" && del /Q "%%G"
FOR /F "tokens=*" %%G IN ('DIR /B /S *.sdf') DO echo "%%G" && del /Q "%%G"
FOR /F "tokens=*" %%G IN ('DIR /B /S /AH *.suo') DO echo "%%G" && del /Q /AH "%%G"
|
{
"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: Attribute selectors with hyphens and underscores</title>
<link rel="author" title="Microsoft" href="http://www.microsoft.com/" />
<link rel="help" href="http://www.w3.org/TR/CSS21/syndata.html" />
<link rel="match" href="../reference/filler-text-below-green.xht"/>
<meta name="flags" content="" />
<meta name="assert" content="Attribute selectors are valid if they begin with hyphens and then underscores." />
<style type="text/css">
[-_hyphenunderscore="true"], div
{
color: green;
}
</style>
</head>
<body>
<p>Test passes if the "Filler Text" below is green.</p>
<div>Filler Text</div>
</body>
</html>
|
{
"pile_set_name": "Github"
}
|
" Author: Sumner Evans <sumner.evans98@gmail.com>
" Description: write-good for Texinfo files
call ale#handlers#writegood#DefineLinter('texinfo')
|
{
"pile_set_name": "Github"
}
|
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.IO;
using Newtonsoft.Json;
using Duplicati.Library.Interface;
namespace Duplicati.Library.Main.Volumes
{
public class IndexVolumeWriter : VolumeWriterBase
{
private StreamWriter m_streamwriter = null;
private JsonWriter m_writer = null;
private long m_volumes = 0;
private long m_blocks = 0;
private long m_blocklists = 0;
public long VolumeCount { get { return m_volumes; } }
public long BlockCount { get { return m_blocks; } }
public long Blocklists { get { return m_blocklists; } }
public IndexVolumeWriter(Options options)
: base(options)
{
}
public override RemoteVolumeType FileType { get { return RemoteVolumeType.Index; } }
public void StartVolume(string filename)
{
if (m_writer != null || m_streamwriter != null)
throw new InvalidOperationException("Previous volume not finished, call FinishVolume before starting a new volume");
m_volumes++;
m_streamwriter = new StreamWriter(m_compression.CreateFile(INDEX_VOLUME_FOLDER + filename, CompressionHint.Compressible, DateTime.UtcNow));
m_writer = new JsonTextWriter(m_streamwriter);
m_writer.WriteStartObject();
m_writer.WritePropertyName("blocks");
m_writer.WriteStartArray();
}
public void AddBlock(string hash, long size)
{
m_writer.WriteStartObject();
m_writer.WritePropertyName("hash");
m_writer.WriteValue(hash);
m_writer.WritePropertyName("size");
m_writer.WriteValue(size);
m_writer.WriteEndObject();
m_blocks++;
}
public void FinishVolume(string volumehash, long volumesize)
{
m_writer.WriteEndArray();
m_writer.WritePropertyName("volumehash");
m_writer.WriteValue(volumehash);
m_writer.WritePropertyName("volumesize");
m_writer.WriteValue(volumesize);
m_writer.WriteEndObject();
try { m_writer.Close(); }
finally { m_writer = null; }
try { m_streamwriter.Dispose(); }
finally { m_streamwriter = null; }
}
public void WriteBlocklist(string hash, byte[] data, int offset, int size)
{
if (size % m_blockhashsize != 0)
throw new InvalidDataException($"Attempted to write a blocklist with {size} bytes which is not evenly divisible with {m_blockhashsize}");
m_blocklists++;
//Filenames are encoded with "modified Base64 for URL" https://en.wikipedia.org/wiki/Base64#URL_applications,
using (var s = m_compression.CreateFile(INDEX_BLOCKLIST_FOLDER + Library.Utility.Utility.Base64PlainToBase64Url(hash), CompressionHint.Noncompressible, DateTime.UtcNow))
s.Write(data, offset, size);
}
public void WriteBlocklist(string hash, Stream source)
{
m_blocklists++;
//Filenames are encoded with "modified Base64 for URL" https://en.wikipedia.org/wiki/Base64#URL_applications,
using (var s = m_compression.CreateFile(INDEX_BLOCKLIST_FOLDER + Library.Utility.Utility.Base64PlainToBase64Url(hash), CompressionHint.Noncompressible, DateTime.UtcNow))
{
var size = Library.Utility.Utility.CopyStream(source, s);
if (size % m_blockhashsize != 0)
throw new InvalidDataException($"Wrote a blocklist with {size} bytes which is not evenly divisible with {m_blockhashsize}");
}
}
public void CopyFrom(IndexVolumeReader rd, Func<string, string> filename_mapping)
{
foreach(var n in rd.Volumes)
{
this.StartVolume(filename_mapping(n.Filename));
foreach(var x in n.Blocks)
this.AddBlock(x.Key, x.Value);
this.FinishVolume(n.Hash, n.Length);
}
foreach(var b in rd.BlockLists)
using(var s = b.Data)
this.WriteBlocklist(b.Hash, s);
}
public override void Dispose()
{
if (m_writer != null || m_streamwriter != null)
throw new InvalidOperationException("Attempted to dispose an index volume that was being written");
base.Dispose();
}
}
}
|
{
"pile_set_name": "Github"
}
|
-------------------
基本的根据条件检索 |
-------------------
# 可以一次性检索多个index
* 直接检索多个index
GET /<index>,<index>/_search
* 一次性检索所有的index
GET /_all/_search
* 通过 * 来匹配多个index
GET /<prefix>*,*<sufix>/_search
-------------------
基本的根据条件检索 |
-------------------
# 请求
GET /<index>/_search?q=<query>
{
"took" : 2,
* 执行搜索的时间(以毫秒为单位)
"timed_out" : false,
* 搜索是否超时
"_shards" : {
"total" : 1,
* 搜索了多少个分片
"successful" : 1,
* 搜索成功的分片数量
"skipped" : 0,
* 跳过的分片数量
"failed" : 0
* 搜索失败的分片数量
},
"hits" : {
"total" : {
"value" : 13,
"relation" : "eq"
},
"max_score" : 1.0,
"hits" : [
{
"_index" : "customer",
"_type" : "_doc",
"_id" : "TsVMQGsBor31qRgUxQmS",
"_score" : 1.0,
"_source" : {
"name" : "KevinBlandy"
}
}
]
}
}
-------------------
query参数 |
-------------------
# 过滤参数:q
q=*
* 检索所有, q=*
q=<value>
* 任何字段, 只要包含该值就满足条件
* 搜索的是_all field
q=<field>:<value>
* 全文检索, 只要是指定字段中有关键字的都OK, :q=name:KevinBlandy
* 有多个匹配value值, 使用逗号分隔
q=<field>:<+/-><value>
* + 表示必须包含, - 表示必须不包含: q=-author.name:Litch
# 排序擦数:sort
sort=<field>:<asc/desc>
* 如果有多个, 使用逗号分隔:sort=age:asc,_id:desc
# 分页参数:size & from
* size,每页显示的记录数量, 默认10
* from,从第几条数据开始检索,默认0(表示第一条)
* deep paging问题
* deep paging,简单来说,就是搜索得特别深,比如1000000条数据,每页显示10条,此时需要检索最后一页的数据
* 符合请求的数据,可能存在于多个primary shard,replica shard,于是就要把所有数据汇总到 coordinating node(协调节点)
* 由协调节点进行排序,取出最符合条件的数据,按照分页返回
* 这个过程耗费带宽,内存,网络计算,这个就是deep paging问题,我们的开发尽量要避免这种情
# _source 数据过滤参数:
_source
* 检索数据是否要携带 _source 数据, 值可以是 true/false
* 也可以通过该参数来指定要检索的字段
GET /goods/_doc/1?_source=author.name,author.age
_source_includes
_source_excludes
* 过滤/包含指定的 _source 数据
* 支持有多个值, 使用否号分割
* 支持通配符:*
GET /goods/_doc/1?_source=*.name
# stored_fields
//TODO
# timeout 超时参数
* 默认无超时
# df
# analyzer
# analyze_wildcard
# batched_reduce_size
# default_operator
# lenient
# explain
# track_scores
# track_total_hits
# terminate_after
# search_type
# allow_partial_search_results
# scroll
* 滚动搜索(有点像迭代器的感觉)
* 每次仅仅响应一批数据, 直到响应完毕所有
* 第一次检索的时候, 会生成快照, 在响应完毕之前, doc的修改不可见(可重复读的感觉)
# filter_path
* 可以过滤整个JSON结果的字段, 包括元数据信息
* 支持对象导航
GET /<index>/_search?filter_path=hits.hits // 仅仅显示hits信息
# error_trace
* true/false, 是否在异常的时候, 响应堆栈信息
|
{
"pile_set_name": "Github"
}
|
package controllers;
import java.math.BigDecimal;
import apimodels.Client;
import java.time.LocalDate;
import java.time.OffsetDateTime;
import apimodels.OuterComposite;
import apimodels.User;
import play.mvc.Controller;
import play.mvc.Result;
import play.mvc.Http;
import java.util.List;
import java.util.Map;
import java.util.ArrayList;
import com.fasterxml.jackson.databind.ObjectMapper;
import com.fasterxml.jackson.databind.JsonNode;
import com.google.inject.Inject;
import java.io.File;
import swagger.SwaggerUtils;
import com.fasterxml.jackson.core.type.TypeReference;
import javax.validation.constraints.*;
import play.Configuration;
import swagger.SwaggerUtils.ApiAction;
public class FakeApiController extends Controller {
private final FakeApiControllerImpInterface imp;
private final ObjectMapper mapper;
private final Configuration configuration;
@Inject
private FakeApiController(Configuration configuration, FakeApiControllerImpInterface imp) {
this.imp = imp;
mapper = new ObjectMapper();
this.configuration = configuration;
}
@ApiAction
public Result fakeOuterBooleanSerialize() throws Exception {
JsonNode nodebody = request().body().asJson();
Boolean body;
if (nodebody != null) {
body = mapper.readValue(nodebody.toString(), Boolean.class);
if (configuration.getBoolean("useInputBeanValidation")) {
SwaggerUtils.validate(body);
}
} else {
body = null;
}
Boolean obj = imp.fakeOuterBooleanSerialize(body);
JsonNode result = mapper.valueToTree(obj);
return ok(result);
}
@ApiAction
public Result fakeOuterCompositeSerialize() throws Exception {
JsonNode nodebody = request().body().asJson();
OuterComposite body;
if (nodebody != null) {
body = mapper.readValue(nodebody.toString(), OuterComposite.class);
if (configuration.getBoolean("useInputBeanValidation")) {
SwaggerUtils.validate(body);
}
} else {
body = null;
}
OuterComposite obj = imp.fakeOuterCompositeSerialize(body);
if (configuration.getBoolean("useOutputBeanValidation")) {
SwaggerUtils.validate(obj);
}
JsonNode result = mapper.valueToTree(obj);
return ok(result);
}
@ApiAction
public Result fakeOuterNumberSerialize() throws Exception {
JsonNode nodebody = request().body().asJson();
BigDecimal body;
if (nodebody != null) {
body = mapper.readValue(nodebody.toString(), BigDecimal.class);
if (configuration.getBoolean("useInputBeanValidation")) {
SwaggerUtils.validate(body);
}
} else {
body = null;
}
BigDecimal obj = imp.fakeOuterNumberSerialize(body);
if (configuration.getBoolean("useOutputBeanValidation")) {
SwaggerUtils.validate(obj);
}
JsonNode result = mapper.valueToTree(obj);
return ok(result);
}
@ApiAction
public Result fakeOuterStringSerialize() throws Exception {
JsonNode nodebody = request().body().asJson();
String body;
if (nodebody != null) {
body = mapper.readValue(nodebody.toString(), String.class);
if (configuration.getBoolean("useInputBeanValidation")) {
SwaggerUtils.validate(body);
}
} else {
body = null;
}
String obj = imp.fakeOuterStringSerialize(body);
JsonNode result = mapper.valueToTree(obj);
return ok(result);
}
@ApiAction
public Result testBodyWithQueryParams() throws Exception {
JsonNode nodebody = request().body().asJson();
User body;
if (nodebody != null) {
body = mapper.readValue(nodebody.toString(), User.class);
if (configuration.getBoolean("useInputBeanValidation")) {
SwaggerUtils.validate(body);
}
} else {
throw new IllegalArgumentException("'body' parameter is required");
}
String valuequery = request().getQueryString("query");
String query;
if (valuequery != null) {
query = valuequery;
} else {
throw new IllegalArgumentException("'query' parameter is required");
}
imp.testBodyWithQueryParams(body, query);
return ok();
}
@ApiAction
public Result testClientModel() throws Exception {
JsonNode nodebody = request().body().asJson();
Client body;
if (nodebody != null) {
body = mapper.readValue(nodebody.toString(), Client.class);
if (configuration.getBoolean("useInputBeanValidation")) {
SwaggerUtils.validate(body);
}
} else {
throw new IllegalArgumentException("'body' parameter is required");
}
Client obj = imp.testClientModel(body);
if (configuration.getBoolean("useOutputBeanValidation")) {
SwaggerUtils.validate(obj);
}
JsonNode result = mapper.valueToTree(obj);
return ok(result);
}
@ApiAction
public Result testEndpointParameters() throws Exception {
String valueinteger = (request().body().asMultipartFormData().asFormUrlEncoded().get("integer"))[0];
Integer integer;
if (valueinteger != null) {
integer = Integer.parseInt(valueinteger);
} else {
integer = null;
}
String valueint32 = (request().body().asMultipartFormData().asFormUrlEncoded().get("int32"))[0];
Integer int32;
if (valueint32 != null) {
int32 = Integer.parseInt(valueint32);
} else {
int32 = null;
}
String valueint64 = (request().body().asMultipartFormData().asFormUrlEncoded().get("int64"))[0];
Long int64;
if (valueint64 != null) {
int64 = Long.parseLong(valueint64);
} else {
int64 = null;
}
String valuenumber = (request().body().asMultipartFormData().asFormUrlEncoded().get("number"))[0];
BigDecimal number;
if (valuenumber != null) {
number = new BigDecimal(valuenumber);
} else {
throw new IllegalArgumentException("'number' parameter is required");
}
String value_float = (request().body().asMultipartFormData().asFormUrlEncoded().get("float"))[0];
Float _float;
if (value_float != null) {
_float = Float.parseFloat(value_float);
} else {
_float = null;
}
String value_double = (request().body().asMultipartFormData().asFormUrlEncoded().get("double"))[0];
Double _double;
if (value_double != null) {
_double = Double.parseDouble(value_double);
} else {
throw new IllegalArgumentException("'double' parameter is required");
}
String valuestring = (request().body().asMultipartFormData().asFormUrlEncoded().get("string"))[0];
String string;
if (valuestring != null) {
string = valuestring;
} else {
string = null;
}
String valuepatternWithoutDelimiter = (request().body().asMultipartFormData().asFormUrlEncoded().get("pattern_without_delimiter"))[0];
String patternWithoutDelimiter;
if (valuepatternWithoutDelimiter != null) {
patternWithoutDelimiter = valuepatternWithoutDelimiter;
} else {
throw new IllegalArgumentException("'pattern_without_delimiter' parameter is required");
}
String value_byte = (request().body().asMultipartFormData().asFormUrlEncoded().get("byte"))[0];
byte[] _byte;
if (value
|
{
"pile_set_name": "Github"
}
|
/* eslint-disable max-len, max-statements, complexity,
default-case */
// Copyright 2014 The Chromium Authors. 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 Google Inc. 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.
/**
* Copyright 2018-2020 Florian Bruhin (The Compiler) <mail@qutebrowser.org>
*
* This file is part of qutebrowser.
*
* qutebrowser is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* qutebrowser is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with qutebrowser. If not, see <http://www.gnu.org/licenses/>.
*/
/**
* Ported chrome-caretbrowsing extension.
* https://cs.chromium.org/chromium/src/ui/accessibility/extensions/caretbrowsing/
*
* The behavior is based on Mozilla's spec whenever possible:
* http://www.mozilla.org/access/keyboard/proposal
*
* The one exception is that Esc is used to escape out of a form control,
* rather than their proposed key (which doesn't seem to work in the
* latest Firefox anyway).
*
* Some details about how Chrome selection works, which will help in
* understanding the code:
*
* The Selection object (window.getSelection()) has four components that
* completely describe the state of the caret or selection:
*
* base and anchor: this is the start of the selection, the fixed point.
* extent and focus: this is the end of the selection, the part that
* moves when you hold down shift and press the left or right arrows.
*
* When the selection is a cursor, the base, anchor, extent, and focus are
* all the same.
*
* There's only one time when the base and anchor are not the same, or the
* extent and focus are not the same, and that's when the selection is in
* an ambiguous state - i.e. it's not clear which edge is the focus and which
* is the anchor. As an example, if you double-click to select a word, then
* the behavior is dependent on your next action. If you press Shift+Right,
* the right edge becomes the focus. But if you press Shift+Left, the left
* edge becomes the focus.
*
* When the selection is in an ambiguous state, the base and extent are set
* to the position where the mouse clicked, and the anchor and focus are set
* to the boundaries of the selection.
*
* The only way to set the selection and give it direction is to use
* the non-standard Selection.setBaseAndExtent method. If you try to use
* Selection.addRange(), the anchor will always be on the left and the focus
* will always be on the right, making it impossible to manipulate
* selections that move from right to left.
*
* Finally, Chrome will throw an exception if you try to set an invalid
* selection - a selection where the left and right edges are not the same,
* but it doesn't span any visible characters. A common example is that
* there are often many whitespace characters in the DOM that are not
* visible on the page; trying to select them will fail. Another example is
* any node that's invisible or not displayed.
*
* While there are probably many possible methods to determine what is
* selectable, this code uses the method of determining if there's a valid
* bounding box for the range or not - keep moving the cursor forwards until
* the range from the previous position and candidate next position has a
* valid bounding box.
*/
"use strict";
window._qutebrowser.caret = (function() {
function isElementInViewport(node) {
let i;
let boundingRect = (node.getClientRects()[0] ||
node.getBoundingClientRect());
if (boundingRect.width <= 1 && boundingRect.height <= 1) {
const rects = node.getClientRects();
for (i = 0; i < rects.length; i++) {
if (rects[i].width > rects[0].height &&
rects[i].height > rects[0].height) {
boundingRect = rects[i];
}
}
}
if (boundingRect === undefined) {
return null;
}
if (boundingRect.top > innerHeight || boundingRect.left > innerWidth) {
return null;
}
if (boundingRect.width <= 1 || boundingRect.height <= 1) {
const children = node.children;
let visibleChildNode = false;
for (i = 0; i < children.length; ++i) {
boundingRect = (children[i].getClientRects()[0] ||
children[i].getBoundingClientRect());
if (boundingRect.width > 1 && boundingRect.height > 1) {
visibleChildNode = true;
break;
}
}
if (visibleChildNode === false) {
return null;
}
}
if (boundingRect.top + boundingRect.height < 10 ||
boundingRect.left + boundingRect.width < -10) {
return null;
}
const computedStyle = window.getComputedStyle(node, null);
if (computedStyle.visibility !== "visible" ||
computedStyle.display === "none" ||
node.hasAttribute("disabled") ||
parseInt(computedStyle.width, 10) === 0 ||
parseInt(computedStyle.height, 10) === 0) {
return null;
}
return boundingRect.top >= -20;
}
function positionCaret() {
const walker = document.createTreeWalker(document.body, -1);
let node;
const textNodes = [];
let el;
while ((node = walker.nextNode())) {
if (node.nodeType === 3 && node.nodeValue.trim() !== "") {
textNodes.push(node);
}
}
for (let i = 0; i < textNodes.length; i++) {
const element = textNodes[i].parentElement;
if (isElementInViewport(element)) {
el = element;
break;
}
}
if (el !== undefined) {
/* eslint-disable no-use-before-define */
const start = new Cursor(el, 0, "");
const end = new Cursor(el, 0, "");
const nodesCrossed = [];
const result = TraverseUtil.getNextChar(
start, end, nodesCrossed, true);
if (result === null) {
return;
}
CaretBrowsing.setAndValidateSelection(start, start);
/* eslint-enable no-use-before-define */
}
}
/**
* Return whether a node is focusable. This includes nodes whose tab
|
{
"pile_set_name": "Github"
}
|
/*
* JBoss, Home of Professional Open Source
* Copyright 2015, Red Hat, Inc. and/or its affiliates, and individual
* contributors by the @authors tag. See the copyright.txt in the
* distribution for a full listing of individual contributors.
*
* 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 org.jboss.as.quickstarts.loggingToolsQS.loggers;
import org.jboss.logging.BasicLogger;
import org.jboss.logging.Logger;
import org.jboss.logging.Logger.Level;
import org.jboss.logging.annotations.Cause;
import org.jboss.logging.annotations.LogMessage;
import org.jboss.logging.annotations.Message;
import org.jboss.logging.annotations.MessageLogger;
@MessageLogger(projectCode = "GTRDATES")
public interface DateLogger extends BasicLogger {
DateLogger LOGGER = Logger.getMessageLogger(DateLogger.class, DateLogger.class.getPackage().getName());
@LogMessage(level = Level.ERROR)
@Message(id = 3, value = "Invalid date passed as string: %s")
void logStringCouldntParseAsDate(String dateString, @Cause Throwable exception);
@LogMessage
@Message(id = 4, value = "Requested number of days until '%s'")
void logDaysUntilRequest(String dateString);
}
|
{
"pile_set_name": "Github"
}
|
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.