text
stringlengths
2
99k
meta
dict
#include <core.p4> header IPv4_option_NOP { bit<8> value; } struct Parsed_Packet { IPv4_option_NOP[3] nop; } package Switch(); Switch() main;
{ "pile_set_name": "Github" }
import LinkedList from '../../../../data-structures/linked-list/LinkedList'; import traversal from '../traversal'; describe('traversal', () => { it('should traverse linked list', () => { const linkedList = new LinkedList(); linkedList .append(1) .append(2) .append(3); const traversedNodeValues = []; const traversalCallback = (nodeValue) => { traversedNodeValues.push(nodeValue); }; traversal(linkedList, traversalCallback); expect(traversedNodeValues).toEqual([1, 2, 3]); }); });
{ "pile_set_name": "Github" }
; Test return attributes ; RUN: llvm-as < %s | llvm-dis | grep "define inreg i32" ; RUN: llvm-as < %s | llvm-dis | grep "call inreg i32" ; RUN: verify-uselistorder %s define inreg i32 @fn1() { ret i32 0 } define void @fn2() { %t = call inreg i32 @fn1() ret void }
{ "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.flink.runtime.dispatcher; import org.apache.flink.util.FlinkException; /** * Base class for {@link Dispatcher} related exceptions. */ public class DispatcherException extends FlinkException { private static final long serialVersionUID = 3781733042984381286L; public DispatcherException(String message) { super(message); } public DispatcherException(Throwable cause) { super(cause); } public DispatcherException(String message, Throwable cause) { super(message, cause); } }
{ "pile_set_name": "Github" }
gaia2 (2.4.3-1) unstable; urgency=low * New upstream release -- Nicolas Wack <nicolas.wack@upf.edu> Mon, 19 Dec 2011 16:37:49 +0100 gaia2 (2.4.2-1) unstable; urgency=low * New upstream release -- Nicolas Wack <nicolas.wack@upf.edu> Wed, 28 Sep 2011 18:21:33 +0200 gaia2 (2.4.1-1) unstable; urgency=low * New upstream release -- Nicolas Wack <nicolas.wack@upf.edu> Wed, 14 Sep 2011 17:57:46 +0200 gaia2 (2.4-1) unstable; urgency=low * New upstream release -- Nicolas Wack <nicolas.wack@upf.edu> Tue, 16 Aug 2011 16:04:31 +0200 gaia2 (2.3.5-1) unstable; urgency=low * New upstream release -- Nicolas Wack <nicolas.wack@upf.edu> Wed, 13 Apr 2011 18:56:16 +0200 gaia2 (2.3.4-1) unstable; urgency=low * New upstream release -- Nicolas Wack <nicolas.wack@upf.edu> Tue, 05 Apr 2011 19:34:55 +0200 gaia2 (2.3.3-1) unstable; urgency=low * New upstream release -- Nicolas Wack <nicolas.wack@upf.edu> Tue, 15 Mar 2011 18:50:35 +0100 gaia2 (2.3.2.5-1) unstable; urgency=low * New upstream release -- Nicolas Wack <nicolas.wack@upf.edu> Wed, 26 Jan 2011 16:31:36 +0100 gaia2 (2.3.2.4-1) unstable; urgency=low * New upstream release -- Nicolas Wack <nicolas.wack@upf.edu> Fri, 10 Dec 2010 11:42:46 +0100 gaia2 (2.3.2.2-1) unstable; urgency=low * New upstream release -- Nicolas Wack <nicolas.wack@upf.edu> Mon, 27 Sep 2010 16:04:23 +0200 gaia2 (2.3.2.1-1) unstable; urgency=low * New upstream release -- Nicolas Wack <nicolas.wack@upf.edu> Tue, 17 Aug 2010 18:41:26 +0200 gaia2 (2.3.2-1) unstable; urgency=low * New upstream release -- Nicolas Wack <nicolas.wack@upf.edu> Wed, 07 Jul 2010 17:56:27 +0200 gaia2 (2.3.1-1) unstable; urgency=low * New upstream release -- Nicolas Wack <nicolas.wack@upf.edu> Thu, 11 Mar 2010 18:16:09 +0100 gaia2 (2.3-1) unstable; urgency=low * New upstream release -- Nicolas Wack <nicolas.wack@upf.edu> Fri, 27 Nov 2009 18:34:32 +0100 gaia2 (2.2.3-1) unstable; urgency=low * New upstream release -- Nicolas Wack <nicolas.wack@upf.edu> Wed, 16 Sep 2009 15:16:38 +0200 gaia2 (2.2.2.1-1) unstable; urgency=low * New upstream release -- Nicolas Wack <nicolas.wack@upf.edu> Mon, 06 Jul 2009 17:43:28 +0200 gaia2 (2.2.2-1) unstable; urgency=low * New upstream release -- Nicolas Wack <nicolas.wack@upf.edu> Thu, 18 Jun 2009 18:50:06 +0200 gaia2 (2.2.1-1) unstable; urgency=low * New upstream release -- Nicolas Wack <nicolas.wack@upf.edu> Thu, 12 Mar 2009 19:59:51 +0100 gaia2 (2.2-1) unstable; urgency=low * New upstream release -- Nicolas Wack <nicolas.wack@upf.edu> Fri, 06 Mar 2009 19:26:12 +0100 gaia2 (2.1.2-1) unstable; urgency=low * New upstream release -- Nicolas Wack <nicolas.wack@upf.edu> Wed, 10 Dec 2008 18:58:46 +0100 gaia2 (2.1-1) unstable; urgency=low * new upstream version -- Nicolas Wack <nwack@iua.upf.edu> Mon, 04 Aug 2008 11:30:51 +0200 gaia2 (2.0.7-1) unstable; urgency=low * Changed package name to libgaia2 -- Koppi <koppi@iua.upf.edu> Tue, 06 May 2008 10:23:21 +0200 gaia (2.0.5-1) unstable; urgency=low * New upstream version. -- Paul Brossier <pbrossier@iua.upf.edu> Wed, 10 Oct 2007 15:23:27 +0200 gaia (2.0.2-1) unstable; urgency=low * New release 2.0.2. * Compile against commercial Qt. -- Paul Brossier <pbrossier@iua.upf.edu> Mon, 20 Aug 2007 18:26:13 +0200 gaia (2.0-3) unstable; urgency=low * Rebuild agains qt4-upf. -- Paul Brossier <piem@debian.org> Thu, 16 Aug 2007 17:59:12 +0200 gaia (2.0-2) unstable; urgency=low * Switch back to python 2.4 * remove doc/ in clean rules -- Paul Brossier <piem@debian.org> Fri, 10 Aug 2007 12:56:36 +0200 gaia (2.0-1) unstable; urgency=low * New upstream version, first actual package -- Paul Brossier <pbrossier@iua.upf.edu> Wed, 11 Jul 2007 17:57:36 +0200 gaia (1.4-1) unstable; urgency=low * Initial package draft. -- Paul Brossier <piem@debian.org> Tue, 23 Jan 2007 15:15:42 +0000
{ "pile_set_name": "Github" }
#!/bin/bash # # Swap File Creator # # This script will create and configure a swap file # on your droplet at creation time. # Tested on: # Fedora 22 # Fedora 23 # # <%MODE%> Please replace using "automatic" or "manual" mode. # # * automatic mode: # # Based Red Hat Enterprise Linux Administration Guide # Swap should equal 2x physical RAM for up to 2 GB of physical RAM, # and then an additional 1x physical RAM for any amount above 2 GB, # but never less than 32 MB.For more informationm, please visit: # https://goo.gl/kFGdnO # # โ•”โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•ฆโ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•— # โ•‘(M) Amount of RAM in G โ•‘ (S) Amount of swap in G โ•‘ # โ• โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•ฌโ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•ฃ # โ•‘ M < 2G โ•‘ S = M * 2G โ•‘ # โ• โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•ฌโ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•ฃ # โ•‘ 2G < M < 32G โ•‘ S = M + 2G โ•‘ # โ• โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•ฌโ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•ฃ # โ•‘ 32G < M โ•‘ S = 32G or S = M โ•‘ # โ•šโ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•ฉโ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ• # # # * manual mode: # * Replace <%SWAP_FILE_SIZE%> with your custom swap size mode=<%MODE%> function automatic() { min="2147483648" max="34359738368" echo "Detecting current RAM size..." ram_size="$(free -b | grep Mem | awk '{ print $2 }' )" echo "... Physical Memory Size: $ram_size" echo "Calculating recommended SWAP file size..." if [[ $ram_size -le $min ]] then echo "The RAM size is less than 2G" swapsize=$(( $ram_size * 2 )) echo "...recommended size: $swapsize" elif [[ $ram_size -ge $min ]] && [[ $ram_size -lt $max ]] then echo "The RAM size is equal to 2G and less than 32G" swapsize=$(( $ram_size + $min )) echo "...recommended size: $swapsize" elif [[ $ram_size -ge $max ]] then echo "The RAM size is greater than 32G" swapsize=$max echo "...recommended size: $swapsize" fi } if [[ $mode == automatic ]] then echo "Running automatic mode..." automatic elif [[ $mode == manual ]] then echo "Running on manual mode..." swapsize="<%SWAP_FILE_SIZE%>" fi fallocate -l $swapsize /swapfile chmod 600 /swapfile mkswap /swapfile -L swap swapon /swapfile echo "/swapfile swap swap sw 0 0" >> /etc/fstab
{ "pile_set_name": "Github" }
๏ปฟ Microsoft Visual Studio Solution File, Format Version 12.00 # Visual Studio 2012 Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "CustomActionSelector.Server", "CustomActionSelector.Server\CustomActionSelector.Server.csproj", "{BCC66C89-1AF0-411A-B2F3-99120E96987F}" EndProject Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "CustomActionSelector.Client", "CustomActionSelector.Client\CustomActionSelector.Client.csproj", "{AE86BB88-6932-41A6-9440-21B51E0BAF21}" EndProject Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Solution Items", "Solution Items", "{C283AB73-2077-4E62-BA90-09496D8B837A}" ProjectSection(SolutionItems) = preProject ReadMe.txt = ReadMe.txt EndProjectSection EndProject Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = ".nuget", ".nuget", "{3905034E-F840-4227-8704-8875943775AD}" ProjectSection(SolutionItems) = preProject .nuget\nuget.config = .nuget\nuget.config .nuget\NuGet.targets = .nuget\NuGet.targets EndProjectSection EndProject Global GlobalSection(SolutionConfigurationPlatforms) = preSolution Debug|Any CPU = Debug|Any CPU Release|Any CPU = Release|Any CPU EndGlobalSection GlobalSection(ProjectConfigurationPlatforms) = postSolution {BCC66C89-1AF0-411A-B2F3-99120E96987F}.Debug|Any CPU.ActiveCfg = Debug|Any CPU {BCC66C89-1AF0-411A-B2F3-99120E96987F}.Debug|Any CPU.Build.0 = Debug|Any CPU {BCC66C89-1AF0-411A-B2F3-99120E96987F}.Release|Any CPU.ActiveCfg = Release|Any CPU {BCC66C89-1AF0-411A-B2F3-99120E96987F}.Release|Any CPU.Build.0 = Release|Any CPU {AE86BB88-6932-41A6-9440-21B51E0BAF21}.Debug|Any CPU.ActiveCfg = Debug|Any CPU {AE86BB88-6932-41A6-9440-21B51E0BAF21}.Debug|Any CPU.Build.0 = Debug|Any CPU {AE86BB88-6932-41A6-9440-21B51E0BAF21}.Release|Any CPU.ActiveCfg = Release|Any CPU {AE86BB88-6932-41A6-9440-21B51E0BAF21}.Release|Any CPU.Build.0 = Release|Any CPU EndGlobalSection GlobalSection(SolutionProperties) = preSolution HideSolutionNode = FALSE EndGlobalSection EndGlobal
{ "pile_set_name": "Github" }
pragma solidity ^0.5.0; contract A { uint a; function f1(uint i) public { a = i; } function f2(uint i) public { a = i; } function g(uint i) public { function (uint256) f = i < 100 ? f1 : f2; f(i); } function h() public { msg.sender.transfer(a); } }
{ "pile_set_name": "Github" }
// ๅŠŸ่ƒฝ๏ผšไปฃ็  3-4 ๅŒ้˜ˆๅ€ผๆณ•็š„ๅฎž็Žฐ // ไฝœ่€…๏ผšๆœฑไผŸ zhu1988wei@163.com // ๆฅๆบ๏ผšใ€ŠOpenCVๅ›พๅƒๅค„็†็ผ–็จ‹ๅฎžไพ‹ใ€‹ // ๅšๅฎข๏ผšhttp://blog.csdn.net/zhuwei1988 // ๆ›ดๆ–ฐ๏ผš2016-8-1 // ่ฏดๆ˜Ž๏ผš็‰ˆๆƒๆ‰€ๆœ‰๏ผŒๅผ•็”จๆˆ–ๆ‘˜ๅฝ•่ฏท่”็ณปไฝœ่€…๏ผŒๅนถๆŒ‰็…งไธŠ้ขๆ ผๅผๆณจๆ˜Žๅ‡บๅค„๏ผŒ่ฐข่ฐขใ€‚// #include "opencv2/imgproc/imgproc.hpp" #include "opencv2/highgui/highgui.hpp" int main( ) { // ๅ›พๅƒ่ฏปๅ–ๅŠๅˆคๆ–ญ cv::Mat srcImage = cv::imread("..\\images\\hand1.jpg"); if( !srcImage.data ) return 1; // ็ฐๅบฆ่ฝฌๆข cv::Mat srcGray; cv::cvtColor(srcImage, srcGray, CV_RGB2GRAY); cv::imshow("srcGray", srcGray); // ๅˆๅง‹ๅŒ–้˜ˆๅ€ผๅ‚ๆ•ฐ const int maxVal = 255; int low_threshold = 150; int high_threshold = 210; cv::Mat dstTempImage1, dstTempImage2, dstImage; // ๅฐ้˜ˆๅ€ผๅฏนๆบ็ฐๅบฆๅ›พๅƒ่ฟ›่กŒ้˜ˆๅ€ผๅŒ–ๆ“ไฝœ cv::threshold( srcGray, dstTempImage1, low_threshold, maxVal, cv::THRESH_BINARY ); // ๅคง้˜ˆๅ€ผๅฏนๆบ็ฐๅบฆๅ›พๅƒ่ฟ›่กŒ้˜ˆๅ€ผๅŒ–ๆ“ไฝœ cv::threshold( srcGray, dstTempImage2, high_threshold, maxVal,cv::THRESH_BINARY_INV ); // ็Ÿฉ้˜ตไธŽ่ฟ็ฎ—ๅพ—ๅˆฐไบŒๅ€ผๅŒ–็ป“ๆžœ cv::bitwise_and( dstTempImage1, dstTempImage2, dstImage ); cv::imshow("dstImage", dstImage); cv::waitKey(0); return 0; }
{ "pile_set_name": "Github" }
# -*- coding: utf-8 -*- import random from captcha.conf import settings import django if django.VERSION < (1, 10): # NOQA from django.core.urlresolvers import reverse # NOQA else: # NOQA from django.urls import reverse # NOQA from six import u, text_type def math_challenge(): operators = ("+", "*", "-") operands = (random.randint(1, 10), random.randint(1, 10)) operator = random.choice(operators) if operands[0] < operands[1] and "-" == operator: operands = (operands[1], operands[0]) challenge = "%d%s%d" % (operands[0], operator, operands[1]) return ( "{}=".format(challenge.replace("*", settings.CAPTCHA_MATH_CHALLENGE_OPERATOR)), text_type(eval(challenge)), ) def random_char_challenge(): chars, ret = u("abcdefghijklmnopqrstuvwxyz"), u("") for i in range(settings.CAPTCHA_LENGTH): ret += random.choice(chars) return ret.upper(), ret def unicode_challenge(): chars, ret = u("รคร รกรซรฉรจรฏรญรฎรถรณรฒรผรบรน"), u("") for i in range(settings.CAPTCHA_LENGTH): ret += random.choice(chars) return ret.upper(), ret def word_challenge(): fd = open(settings.CAPTCHA_WORDS_DICTIONARY, "r") l = fd.readlines() fd.close() while True: word = random.choice(l).strip() if ( len(word) >= settings.CAPTCHA_DICTIONARY_MIN_LENGTH and len(word) <= settings.CAPTCHA_DICTIONARY_MAX_LENGTH ): break return word.upper(), word.lower() def huge_words_and_punctuation_challenge(): "Yay, undocumneted. Mostly used to test Issue 39 - http://code.google.com/p/django-simple-captcha/issues/detail?id=39" fd = open(settings.CAPTCHA_WORDS_DICTIONARY, "rb") l = fd.readlines() fd.close() word = "" while True: word1 = random.choice(l).strip() word2 = random.choice(l).strip() punct = random.choice(settings.CAPTCHA_PUNCTUATION) word = "%s%s%s" % (word1, punct, word2) if ( len(word) >= settings.CAPTCHA_DICTIONARY_MIN_LENGTH and len(word) <= settings.CAPTCHA_DICTIONARY_MAX_LENGTH ): break return word.upper(), word.lower() def noise_arcs(draw, image): size = image.size draw.arc([-20, -20, size[0], 20], 0, 295, fill=settings.CAPTCHA_FOREGROUND_COLOR) draw.line( [-20, 20, size[0] + 20, size[1] - 20], fill=settings.CAPTCHA_FOREGROUND_COLOR ) draw.line([-20, 0, size[0] + 20, size[1]], fill=settings.CAPTCHA_FOREGROUND_COLOR) return draw def noise_dots(draw, image): size = image.size for p in range(int(size[0] * size[1] * 0.1)): draw.point( (random.randint(0, size[0]), random.randint(0, size[1])), fill=settings.CAPTCHA_FOREGROUND_COLOR, ) return draw def noise_null(draw, image): return draw def post_smooth(image): from PIL import ImageFilter return image.filter(ImageFilter.SMOOTH) def captcha_image_url(key): """Return url to image. Need for ajax refresh and, etc""" return reverse("captcha-image", args=[key]) def captcha_audio_url(key): """Return url to image. Need for ajax refresh and, etc""" return reverse("captcha-audio", args=[key])
{ "pile_set_name": "Github" }
//List of files which are indexed. fl = new Array(); fl["0"]= "ch01.html"; fl["1"]= "ch02.html"; fl["2"]= "ch02s01.html"; fl["3"]= "ch02s02.html"; fl["4"]= "ch02s03.html"; fl["5"]= "ch02s04.html"; fl["6"]= "ch03.html"; fl["7"]= "ch03s01.html"; fl["8"]= "ch03s02.html";
{ "pile_set_name": "Github" }
๏ปฟ<?xml version="1.0" encoding="utf-8"?> <root> <!-- Microsoft ResX Schema Version 2.0 The primary goals of this format is to allow a simple XML format that is mostly human readable. The generation and parsing of the various data types are done through the TypeConverter classes associated with the data types. Example: ... ado.net/XML headers & schema ... <resheader name="resmimetype">text/microsoft-resx</resheader> <resheader name="version">2.0</resheader> <resheader name="reader">System.Resources.ResXResourceReader, System.Windows.Forms, ...</resheader> <resheader name="writer">System.Resources.ResXResourceWriter, System.Windows.Forms, ...</resheader> <data name="Name1"><value>this is my long string</value><comment>this is a comment</comment></data> <data name="Color1" type="System.Drawing.Color, System.Drawing">Blue</data> <data name="Bitmap1" mimetype="application/x-microsoft.net.object.binary.base64"> <value>[base64 mime encoded serialized .NET Framework object]</value> </data> <data name="Icon1" type="System.Drawing.Icon, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64"> <value>[base64 mime encoded string representing a byte array form of the .NET Framework object]</value> <comment>This is a comment</comment> </data> There are any number of "resheader" rows that contain simple name/value pairs. Each data row contains a name, and value. The row also contains a type or mimetype. Type corresponds to a .NET class that support text/value conversion through the TypeConverter architecture. Classes that don't support this are serialized and stored with the mimetype set. The mimetype is used for serialized objects, and tells the ResXResourceReader how to depersist the object. This is currently not extensible. For a given mimetype the value must be set accordingly: Note - application/x-microsoft.net.object.binary.base64 is the format that the ResXResourceWriter will generate, however the reader can read any of the formats listed below. mimetype: application/x-microsoft.net.object.binary.base64 value : The object must be serialized with : System.Runtime.Serialization.Formatters.Binary.BinaryFormatter : and then encoded with base64 encoding. mimetype: application/x-microsoft.net.object.soap.base64 value : The object must be serialized with : System.Runtime.Serialization.Formatters.Soap.SoapFormatter : and then encoded with base64 encoding. mimetype: application/x-microsoft.net.object.bytearray.base64 value : The object must be serialized into a byte array : using a System.ComponentModel.TypeConverter : and then encoded with base64 encoding. --> <xsd:schema id="root" xmlns="" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:msdata="urn:schemas-microsoft-com:xml-msdata"> <xsd:import namespace="http://www.w3.org/XML/1998/namespace" /> <xsd:element name="root" msdata:IsDataSet="true"> <xsd:complexType> <xsd:choice maxOccurs="unbounded"> <xsd:element name="metadata"> <xsd:complexType> <xsd:sequence> <xsd:element name="value" type="xsd:string" minOccurs="0" /> </xsd:sequence> <xsd:attribute name="name" use="required" type="xsd:string" /> <xsd:attribute name="type" type="xsd:string" /> <xsd:attribute name="mimetype" type="xsd:string" /> <xsd:attribute ref="xml:space" /> </xsd:complexType> </xsd:element> <xsd:element name="assembly"> <xsd:complexType> <xsd:attribute name="alias" type="xsd:string" /> <xsd:attribute name="name" type="xsd:string" /> </xsd:complexType> </xsd:element> <xsd:element name="data"> <xsd:complexType> <xsd:sequence> <xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" /> <xsd:element name="comment" type="xsd:string" minOccurs="0" msdata:Ordinal="2" /> </xsd:sequence> <xsd:attribute name="name" type="xsd:string" use="required" msdata:Ordinal="1" /> <xsd:attribute name="type" type="xsd:string" msdata:Ordinal="3" /> <xsd:attribute name="mimetype" type="xsd:string" msdata:Ordinal="4" /> <xsd:attribute ref="xml:space" /> </xsd:complexType> </xsd:element> <xsd:element name="resheader"> <xsd:complexType> <xsd:sequence> <xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" /> </xsd:sequence> <xsd:attribute name="name" type="xsd:string" use="required" /> </xsd:complexType> </xsd:element> </xsd:choice> </xsd:complexType> </xsd:element> </xsd:schema> <resheader name="resmimetype"> <value>text/microsoft-resx</value> </resheader> <resheader name="version"> <value>2.0</value> </resheader> <resheader name="reader"> <value>System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value> </resheader> <resheader name="writer"> <value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value> </resheader> </root>
{ "pile_set_name": "Github" }
๏ปฟusing LmpClient.Extensions; using System.Collections.Generic; using System.Linq; namespace LmpClient.VesselUtilities { /// <summary> /// This is a proof of concept. A class that can reload vessel parts /// </summary> public class OwnVesselReloader { public static bool ReloadOwnVessel(ProtoVessel protoVessel) { var partIdsToRemove = FlightGlobals.ActiveVessel.parts.Select(p => p.flightID) .Except(protoVessel.protoPartSnapshots.Select(pp => pp.flightID)).ToArray(); foreach (var partIdToRemove in partIdsToRemove) { FlightGlobals.ActiveVessel.FindPart(partIdToRemove)?.Die(); } var partIdsToCreate = protoVessel.protoPartSnapshots.Select(pp => pp.flightID) .Except(FlightGlobals.ActiveVessel.parts.Select(p => p.flightID)).ToArray(); var partsToInit = new List<ProtoPartSnapshot>(); foreach (var partIdToCreate in partIdsToCreate) { var newProtoPart = protoVessel.GetProtoPart(partIdToCreate); var newPart = newProtoPart.Load(FlightGlobals.ActiveVessel, false); FlightGlobals.ActiveVessel.parts.Add(newPart); partsToInit.Add(newProtoPart); } //Init new parts. This must be done in another loop as otherwise new parts won't have their correct attachment parts. foreach (var partSnapshot in partsToInit) partSnapshot.Init(FlightGlobals.ActiveVessel); var crewedParts = FlightGlobals.ActiveVessel.parts.Where(p => p.protoModuleCrew.Any()) .Select(p => new { p.protoModuleCrew.Count, p.flightID, p, p.protoModuleCrew }).ToArray(); var crewedProtoParts = protoVessel.protoPartSnapshots.Where(p => p.protoModuleCrew.Any()) .Select(p => new { p.protoModuleCrew.Count, p.flightID, p, p.protoModuleCrew }).ToArray(); foreach (var crewedPart in crewedParts) { var crewedProtoPart = crewedProtoParts.FirstOrDefault(pp => pp.flightID == crewedPart.flightID); if (crewedProtoPart != null) { if (crewedProtoPart.Count > crewedPart.Count) { var crewToAdd = crewedProtoPart.protoModuleCrew.Select(c => c.name) .Except(crewedPart.protoModuleCrew.Select(c => c.name)).ToArray(); foreach (var crewMember in crewToAdd) { crewedPart.p.AddCrew(crewedProtoPart.protoModuleCrew.First(m => m.name == crewMember)); } } else if (crewedProtoPart.Count < crewedPart.Count) { var crewToRemove = crewedPart.protoModuleCrew.Select(c => c.name) .Except(crewedProtoPart.protoModuleCrew.Select(c => c.name)).ToArray(); foreach (var crewMember in crewToRemove) { crewedPart.p.RemoveCrew(crewedPart.protoModuleCrew.First(m => m.name == crewMember)); } } } } FlightGlobals.ActiveVessel.RebuildCrewList(); return true; } } }
{ "pile_set_name": "Github" }
--- fixes: - Allow the configuration of image_member_quota in Glance API. This error blocks the ability of sharing images if the default value (128) is reached.
{ "pile_set_name": "Github" }
#!/bin/sh # SUMMARY: Namespace stress with a single long running UDP/IPv6 "connection" over a veth pair in reverse order # LABELS: # REPEAT: set -e # Source libraries. Uncomment if needed/defined #. "${RT_LIB}" . "${RT_PROJECT_ROOT}/_lib/lib.sh" NAME=test-ns clean_up() { rm -rf ${NAME}-* } trap clean_up EXIT linuxkit build -format kernel+initrd -name ${NAME} ../../common.yml test.yml RESULT="$(linuxkit run -cpus 2 ${NAME})" echo "${RESULT}" | grep -q "suite PASSED" exit 0
{ "pile_set_name": "Github" }
// Copyright (c) 2015, Cisco Systems // All rights reserved. // // Redistribution and use in source and binary forms, with or without // modification, are permitted provided that the following conditions // are met: // // 1. Redistributions of source code must retain the above copyright notice, // this list of conditions and the following disclaimer. // // 2. Redistributions in binary form must reproduce the above copyright // notice, this list of conditions and the following disclaimer in the // documentation and/or other materials provided with the distribution. // // 3. Neither the name of the copyright holder 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 HOLDER OR // CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, // EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, // PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR // PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF // LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING // NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS // SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. // This file is autogenerated // // The following edits are possible, without affecting the validity of the // file: // // * Fields may be renamed. // * Fields may be deleted. // * The unique numbered tag for a field may be changed, provided that // the ordering of tags for fields within a message is preserved. // * Message types may be renamed. // * Message types may be deleted (if all fields that reference them // have been deleted). // // All Cisco message and field extensions must be preserved (except when the // field itself is being deleted). syntax = "proto3"; package cisco_ios_xr_ipv6_ospfv3_oper.ospfv3.processes.process.default_vrf.areas.area.retransmission_list_table.retransmission; // OSPFv3 retransmission list information message ospfv3_edm_retrans_KEYS { string process_name = 1; uint32 area_id = 2; string interface_name = 3; string neighbor_address = 4; } message ospfv3_edm_retrans { // Neighbor IP address string retransmission_neighbor_address = 50; // If true, virtual link is retransmitted bool is_retransmission_virtual_link = 51; // Retransmission virtual link ID uint32 retransmission_virtual_link_id = 52; // If true, sham link is retransmitted bool is_retransmission_sham_link = 53; // Retransmission sham link ID uint32 retransmission_sham_link_id = 54; // Amount of time remaining on retransmission timer (ms) uint32 retransmission_timer = 55; // Retransmission queue length uint32 retransmission_length = 56; // List of virtual link scope entries repeated ospfv3_edm_lsa_sum retransmission_virtual_link_db_list = 57; // List of area scope entries repeated ospfv3_edm_lsa_sum retransmission_area_db_list = 58; // List of AS scope entries repeated ospfv3_edm_lsa_sum retransmission_asdb_list = 59; } // LSA summary entry message ospfv3_edm_lsa_sum { // LSA type string header_lsa_type = 1; // Age of the LSA (seconds) uint32 header_lsa_age = 2; // LSA ID string header_lsa_id = 3; // Router ID of the advertising router string header_advertising_router = 4; // Current LSA sequence number sint32 header_sequence_number = 5; }
{ "pile_set_name": "Github" }
// go run mksysnum.go https://gitweb.dragonflybsd.org/dragonfly.git/blob_plain/HEAD:/sys/kern/syscalls.master // Code generated by the command above; see README.md. DO NOT EDIT. // +build amd64,dragonfly package unix const ( // SYS_NOSYS = 0; // { int nosys(void); } syscall nosys_args int SYS_EXIT = 1 // { void exit(int rval); } SYS_FORK = 2 // { int fork(void); } SYS_READ = 3 // { ssize_t read(int fd, void *buf, size_t nbyte); } SYS_WRITE = 4 // { ssize_t write(int fd, const void *buf, size_t nbyte); } SYS_OPEN = 5 // { int open(char *path, int flags, int mode); } SYS_CLOSE = 6 // { int close(int fd); } SYS_WAIT4 = 7 // { int wait4(int pid, int *status, int options, struct rusage *rusage); } wait4 wait_args int SYS_LINK = 9 // { int link(char *path, char *link); } SYS_UNLINK = 10 // { int unlink(char *path); } SYS_CHDIR = 12 // { int chdir(char *path); } SYS_FCHDIR = 13 // { int fchdir(int fd); } SYS_MKNOD = 14 // { int mknod(char *path, int mode, int dev); } SYS_CHMOD = 15 // { int chmod(char *path, int mode); } SYS_CHOWN = 16 // { int chown(char *path, int uid, int gid); } SYS_OBREAK = 17 // { int obreak(char *nsize); } break obreak_args int SYS_GETFSSTAT = 18 // { int getfsstat(struct statfs *buf, long bufsize, int flags); } SYS_GETPID = 20 // { pid_t getpid(void); } SYS_MOUNT = 21 // { int mount(char *type, char *path, int flags, caddr_t data); } SYS_UNMOUNT = 22 // { int unmount(char *path, int flags); } SYS_SETUID = 23 // { int setuid(uid_t uid); } SYS_GETUID = 24 // { uid_t getuid(void); } SYS_GETEUID = 25 // { uid_t geteuid(void); } SYS_PTRACE = 26 // { int ptrace(int req, pid_t pid, caddr_t addr, int data); } SYS_RECVMSG = 27 // { int recvmsg(int s, struct msghdr *msg, int flags); } SYS_SENDMSG = 28 // { int sendmsg(int s, caddr_t msg, int flags); } SYS_RECVFROM = 29 // { int recvfrom(int s, caddr_t buf, size_t len, int flags, caddr_t from, int *fromlenaddr); } SYS_ACCEPT = 30 // { int accept(int s, caddr_t name, int *anamelen); } SYS_GETPEERNAME = 31 // { int getpeername(int fdes, caddr_t asa, int *alen); } SYS_GETSOCKNAME = 32 // { int getsockname(int fdes, caddr_t asa, int *alen); } SYS_ACCESS = 33 // { int access(char *path, int flags); } SYS_CHFLAGS = 34 // { int chflags(char *path, int flags); } SYS_FCHFLAGS = 35 // { int fchflags(int fd, int flags); } SYS_SYNC = 36 // { int sync(void); } SYS_KILL = 37 // { int kill(int pid, int signum); } SYS_GETPPID = 39 // { pid_t getppid(void); } SYS_DUP = 41 // { int dup(int fd); } SYS_PIPE = 42 // { int pipe(void); } SYS_GETEGID = 43 // { gid_t getegid(void); } SYS_PROFIL = 44 // { int profil(caddr_t samples, size_t size, size_t offset, u_int scale); } SYS_KTRACE = 45 // { int ktrace(const char *fname, int ops, int facs, int pid); } SYS_GETGID = 47 // { gid_t getgid(void); } SYS_GETLOGIN = 49 // { int getlogin(char *namebuf, u_int namelen); } SYS_SETLOGIN = 50 // { int setlogin(char *namebuf); } SYS_ACCT = 51 // { int acct(char *path); } SYS_SIGALTSTACK = 53 // { int sigaltstack(stack_t *ss, stack_t *oss); } SYS_IOCTL = 54 // { int ioctl(int fd, u_long com, caddr_t data); } SYS_REBOOT = 55 // { int reboot(int opt); } SYS_REVOKE = 56 // { int revoke(char *path); } SYS_SYMLINK = 57 // { int symlink(char *path, char *link); } SYS_READLINK = 58 // { int readlink(char *path, char *buf, int count); } SYS_EXECVE = 59 // { int execve(char *fname, char **argv, char **envv); } SYS_UMASK = 60 // { int umask(int newmask); } umask umask_args int SYS_CHROOT = 61 // { int chroot(char *path); } SYS_MSYNC = 65 // { int msync(void *addr, size_t len, int flags); } SYS_VFORK = 66 // { pid_t vfork(void); } SYS_SBRK = 69 // { int sbrk(int incr); } SYS_SSTK = 70 // { int sstk(int incr); } SYS_MUNMAP = 73 // { int munmap(void *addr, size_t len); } SYS_MPROTECT = 74 // { int mprotect(void *addr, size_t len, int prot); } SYS_MADVISE = 75 // { int madvise(void *addr, size_t len, int behav); } SYS_MINCORE = 78 // { int mincore(const void *addr, size_t len, char *vec); } SYS_GETGROUPS = 79 // { int getgroups(u_int gidsetsize, gid_t *gidset); } SYS_SETGROUPS = 80 // { int setgroups(u_int gidsetsize, gid_t *gidset); } SYS_GETPGRP = 81 // { int getpgrp(void); } SYS_SETPGID = 82 // { int setpgid(int pid, int pgid); } SYS_SETITIMER = 83 // { int setitimer(u_int which, struct itimerval *itv, struct itimerval *oitv); } SYS_SWAPON = 85 // { int swapon(char *name); } SYS_GETITIMER = 86 // { int getitimer(u_int which, struct itimerval *itv); } SYS_GETDTABLESIZE = 89 // { int getdtablesize(void); } SYS_DUP2 = 90 // { int dup2(int from, int to); } SYS_FCNTL = 92 // { int fcntl(int fd, int cmd, long arg); } SYS_SELECT = 93 // { int select(int nd, fd_set *in, fd_set *ou, fd_set *ex, struct timeval *tv); } SYS_FSYNC = 95 // { int fsync(int fd); } SYS_SETPRIORITY = 96 // { int setpriority(int which, int who, int prio); } SYS_SOCKET = 97 // { int socket(int domain, int type, int protocol); } SYS_CONNECT = 98 // { int connect(int s, caddr_t name, int namelen); } SYS_GETPRIORITY = 100 // { int getpriority(int which, int who); } SYS_BIND = 104 // { int bind(int s, caddr_t name, int namelen); } SYS_SETSOCKOPT = 105 // { int setsockopt(int s, int level, int name, caddr_t val, int valsize); } SYS_LISTEN = 106 // { int listen(int s, int backlog); } SYS_GETTIMEOFDAY = 116 // { int gettimeofday(struct timeval *tp, struct timezone *tzp); } SYS_GETRUSAGE = 117 // { int getrusage(int who, struct rusage *rusage); } SYS_GETSOCKOPT = 118 // { int getsockopt(int s, int level, int name, caddr_t val, int *avalsize); } SYS_READV = 120 // { int readv(int fd, struct iovec *iovp, u_int iovcnt); } SYS_WRITEV = 121 // { int writev(int fd, struct iovec *iovp, u_int iovcnt); } SYS_SETTIMEOFDAY = 122 // { int settimeofday(struct timeval *tv, struct timezone *tzp); } SYS_FCHOWN = 123 // { int fchown(int fd, int uid, int gid); } SYS_FCHMOD = 124 // { int fchmod(int fd, int mode); } SYS_SETREUID = 126 // { int setreuid(int ruid, int euid); } SYS_SETREGID = 127 // { int setregid(int rgid, int egid); } SYS_RENAME = 128 // { int rename(char *from, char *to); } SYS_FLOCK = 131 // { int flock(int fd, int how); } SYS_MKFIFO = 132 // { int mkfifo(char *path, int mode); } SYS_SENDTO = 133 // { int sendto(int s, caddr_t buf, size_t len, int flags, caddr_t to, int tolen); } SYS_SHUTDOWN = 134 // { int shutdown(int s, int how); } SYS_SOCKETPAIR = 135 // { int socketpair(int domain, int type, int protocol, int *rsv); } SYS_MKDIR = 136 // { int mkdir(char *path, int mode); } SYS_RMDIR = 137 // { int rmdir(char *path); } SYS_UTIMES = 138 // { int utimes(char *path, struct timeval *tptr); } SYS_ADJTIME = 140 // { int adjtime(struct timeval *delta, struct timeval *olddelta); } SYS_SETSID = 147 // { int setsid(void); } SYS_QUOTACTL = 148 // { int quotactl(char *path, int cmd, int uid, caddr_t arg); } SYS_STATFS = 157 // { int statfs(char *path, struct statfs *buf); } SYS_FSTATFS = 158 // { int fstatfs(int fd, struct statfs *buf); } SYS_GETFH = 161 // { int getfh(char *fname, struct fhandle *fhp); } SYS_GETDOMAINNAME = 162 // { int getdomainname(char *domainname, int len); } SYS_SETDOMAINNAME = 163 // { int setdomainname(char *domainname, int len); } SYS_UNAME = 164 // { int uname(struct utsname *name); } SYS_SYSARCH = 165 // { int sysarch(int op, char *parms); } SYS_RTPRIO = 166 // { int rtprio(int function, pid_t pid, struct rtprio *rtp); } SYS_EXTPREAD = 173 // { ssize_t extpread(int fd, void *buf, size_t nbyte, int flags, off_t offset); } SYS_EXTPWRITE = 174 // { ssize_t extpwrite(int fd, const void *buf, size_t nbyte, int flags, off_t offset); } SYS_NTP_ADJTIME = 176 // { int ntp_adjtime(struct timex *tp); } SYS_SETGID = 181 // { int setgid(gid_t gid); } SYS_SETEGID = 182 // { int setegid(gid_t egid); } SYS_SETEUID = 183 // { int seteuid(uid_t euid); } SYS_PATHCONF = 191 // { int pathconf(char *path, int name); } SYS_FPATHCONF = 192 // { int fpathconf(int fd, int name); } SYS_GETRLIMIT = 194 // { int getrlimit(u_int which, struct rlimit *rlp); } getrlimit __getrlimit_args int SYS_SETRLIMIT = 195 // { int setrlimit(u_int which, struct rlimit *rlp); } setrlimit __setrlimit_args int SYS_MMAP = 197 // { caddr_t mmap(caddr_t addr, size_t len, int prot, int flags, int fd, int pad, off_t pos); } // SYS_NOSYS = 198; // { int nosys(void); } __syscall __syscall_args int SYS_LSEEK = 199 // { off_t lseek(int fd, int pad, off_t offset, int whence); } SYS_TRUNCATE = 200 // { int truncate(char *path, int pad, off_t length); } SYS_FTRUNCATE = 201 // { int ftruncate(int fd, int pad, off_t length); } SYS___SYSCTL = 202 // { int __sysctl(int *name, u_int namelen, void *old, size_t *oldlenp, void *new, size_t newlen); } __sysctl sysctl_args int SYS_MLOCK = 203 // { int mlock(const void *addr, size_t len); } SYS_MUNLOCK = 204 // { int munlock(const void *addr, size_t len); } SYS_UNDELETE = 205 // { int undelete(char *path); } SYS_FUTIMES = 206 // { int futimes(int fd, struct timeval *tptr); } SYS_GETPGID = 207 // { int getpgid(pid_t pid); } SYS_POLL = 209 // { int poll(struct pollfd *fds, u_int nfds, int timeout); } SYS___SEMCTL = 220 // { int __semctl(int semid, int semnum, int cmd, union semun *arg); } SYS_SEMGET = 221 // { int semget(key_t key, int nsems, int semflg); } SYS_SEMOP = 222 // { int semop(int semid, struct sembuf *sops, u_int nsops); } SYS_MSGCTL = 224 // { int msgctl(int msqid, int cmd, struct msqid_ds *buf); } SYS_MSGGET = 225 // { int msgget(key_t key, int msgflg); } SYS_MSGSND = 226 // { int msgsnd(int msqid, const void *msgp, size_t msgsz, int msgflg); } SYS_MSGRCV = 227 // { int msgrcv(int msqid, void *msgp, size_t msgsz, long msgtyp, int msgflg); } SYS_SHMAT = 228 // { caddr_t shmat(int shmid, const void *shmaddr, int shmflg); } SYS_SHMCTL = 229 // { int shmctl(int shmid, int cmd, struct shmid_ds *buf); } SYS_SHMDT = 230 // { int shmdt(const void *shmaddr); } SYS_SHMGET = 231 // { int shmget(key_t key, size_t size, int shmflg); } SYS_CLOCK_GETTIME = 232 // { int clock_gettime(clockid_t clock_id, struct timespec *tp); } SYS_CLOCK_SETTIME = 233 // { int clock_settime(clockid_t clock_id, const struct timespec *tp); } SYS_CLOCK_GETRES = 234 // { int clock_getres(clockid_t clock_id, struct timespec *tp); } SYS_NANOSLEEP = 240 // { int nanosleep(const struct timespec *rqtp, struct timespec *rmtp); } SYS_MINHERIT = 250 // { int minherit(void *addr, size_t len, int inherit); } SYS_RFORK = 251 // { int rfork(int flags); } SYS_OPENBSD_POLL = 252 // { int openbsd_poll(struct pollfd *fds, u_int nfds, int timeout); } SYS_ISSETUGID = 253 // { int issetugid(void); } SYS_LCHOWN = 254 // { int lchown(char *path, int uid, int gid); } SYS_LCHMOD = 274 // { int lchmod(char *path, mode_t mode); } SYS_LUTIMES = 276 // { int lutimes(char *path, struct timeval *tptr); } SYS_EXTPREADV = 289 // { ssize_t extpreadv(int fd, struct iovec *iovp, u_int iovcnt, int flags, off_t offset); } SYS_EXTPWRITEV = 290 // { ssize_t extpwritev(int fd, struct iovec *iovp,u_int iovcnt, int flags, off_t offset); } SYS_FHSTATFS = 297 // { int fhstatfs(const struct fhandle *u_fhp, struct statfs *buf); } SYS_FHOPEN = 298 // { int fhopen(const struct fhandle *u_fhp, int flags); } SYS_MODNEXT = 300 // { int modnext(int modid); } SYS_MODSTAT = 301 // { int modstat(int modid, struct module_stat* stat); } SYS_MODFNEXT = 302 // { int modfnext(int modid); } SYS_MODFIND = 303 // { int modfind(const char *name); } SYS_KLDLOAD = 304 // { int kldload(const char *file); } SYS_KLDUNLOAD = 305 // { int kldunload(int fileid); } SYS_KLDFIND = 306 // { int kldfind(const char *file); } SYS_KLDNEXT = 307 // { int kldnext(int fileid); } SYS_KLDSTAT = 308 // { int kldstat(int fileid, struct kld_file_stat* stat); } SYS_KLDFIRSTMOD = 309 // { int kldfirstmod(int fileid); } SYS_GETSID = 310 // { int getsid(pid_t pid); } SYS_SETRESUID = 311 // { int setresuid(uid_t ruid, uid_t euid, uid_t suid); } SYS_SETRESGID = 312 // { int setresgid(gid_t rgid, gid_t egid, gid_t sgid); } SYS_AIO_RETURN = 314 // { int aio_return(struct aiocb *aiocbp); } SYS_AIO_SUSPEND = 315 // { int aio_suspend(struct aiocb * const * aiocbp, int nent, const struct timespec *timeout); } SYS_AIO_CANCEL = 316 // { int aio_cancel(int fd, struct aiocb *aiocbp); } SYS_AIO_ERROR = 317 // { int aio_error(struct aiocb *aiocbp); } SYS_AIO_READ = 318 // { int aio_read(struct aiocb *aiocbp); } SYS_AIO_WRITE = 319 // { int aio_write(struct aiocb *aiocbp); } SYS_LIO_LISTIO = 320 // { int lio_listio(int mode, struct aiocb * const *acb_list, int nent, struct sigevent *sig); } SYS_YIELD = 321 // { int yield(void); } SYS_MLOCKALL = 324 // { int mlockall(int how); } SYS_MUNLOCKALL = 325 // { int munlockall(void); } SYS___GETCWD = 326 // { int __getcwd(u_char *buf, u_int buflen); } SYS_SCHED_SETPARAM = 327 // { int sched_setparam (pid_t pid, const struct sched_param *param); } SYS_SCHED_GETPARAM = 328 // { int sched_getparam (pid_t pid, struct sched_param *param); } SYS_SCHED_SETSCHEDULER = 329 // { int sched_setscheduler (pid_t pid, int policy, const struct sched_param *param); } SYS_SCHED_GETSCHEDULER = 330 // { int sched_getscheduler (pid_t pid); } SYS_SCHED_YIELD = 331 // { int sched_yield (void); } SYS_SCHED_GET_PRIORITY_MAX = 332 // { int sched_get_priority_max (int policy); } SYS_SCHED_GET_PRIORITY_MIN = 333 // { int sched_get_priority_min (int policy); } SYS_SCHED_RR_GET_INTERVAL = 334 // { int sched_rr_get_interval (pid_t pid, struct timespec *interval); } SYS_UTRACE = 335 // { int utrace(const void *addr, size_t len); } SYS_KLDSYM = 337 // { int kldsym(int fileid, int cmd, void *data); } SYS_JAIL = 338 // { int jail(struct jail *jail); } SYS_SIGPROCMASK = 340 // { int sigprocmask(int how, const sigset_t *set, sigset_t *oset); } SYS_SIGSUSPEND = 341 // { int sigsuspend(const sigset_t *sigmask); } SYS_SIGACTION = 342 // { int sigaction(int sig, const struct sigaction *act, struct sigaction *oact); } SYS_SIGPENDING = 343 // { int sigpending(sigset_t *set); } SYS_SIGRETURN = 344 // { int sigreturn(ucontext_t *sigcntxp); } SYS_SIGTIMEDWAIT = 345 // { int sigtimedwait(const sigset_t *set,siginfo_t *info, const struct timespec *timeout); } SYS_SIGWAITINFO = 346 // { int sigwaitinfo(const sigset_t *set,siginfo_t *info); } SYS___ACL_GET_FILE = 347 // { int __acl_get_file(const char *path, acl_type_t type, struct acl *aclp); } SYS___ACL_SET_FILE = 348 // { int __acl_set_file(const char *path, acl_type_t type, struct acl *aclp); } SYS___ACL_GET_FD = 349 // { int __acl_get_fd(int filedes, acl_type_t type, struct acl *aclp); } SYS___ACL_SET_FD = 350 // { int __acl_set_fd(int filedes, acl_type_t type, struct acl *aclp); } SYS___ACL_DELETE_FILE = 351 // { int __acl_delete_file(const char *path, acl_type_t type); } SYS___ACL_DELETE_FD = 352 // { int __acl_delete_fd(int filedes, acl_type_t type); } SYS___ACL_ACLCHECK_FILE = 353 // { int __acl_aclcheck_file(const char *path, acl_type_t type, struct acl *aclp); } SYS___ACL_ACLCHECK_FD = 354 // { int __acl_aclcheck_fd(int filedes, acl_type_t type, struct acl *aclp); } SYS_EXTATTRCTL = 355 // { int extattrctl(const char *path, int cmd, const char *filename, int attrnamespace, const char *attrname); } SYS_EXTATTR_SET_FILE = 356 // { int extattr_set_file(const char *path, int attrnamespace, const char *attrname, void *data, size_t nbytes); } SYS_EXTATTR_GET_FILE = 357 // { int extattr_get_file(const char *path, int attrnamespace, const char *attrname, void *data, size_t nbytes); } SYS_EXTATTR_DELETE_FILE = 358 // { int extattr_delete_file(const char *path, int attrnamespace, const char *attrname); } SYS_AIO_WAITCOMPLETE = 359 // { int aio_waitcomplete(struct aiocb **aiocbp, struct timespec *timeout); } SYS_GETRESUID = 360 // { int getresuid(uid_t *ruid, uid_t *euid, uid_t *suid); } SYS_GETRESGID = 361 // { int getresgid(gid_t *rgid, gid_t *egid, gid_t *sgid); } SYS_KQUEUE = 362 // { int kqueue(void); } SYS_KEVENT = 363 // { int kevent(int fd, const struct kevent *changelist, int nchanges, struct kevent *eventlist, int nevents, const struct timespec *timeout); } SYS_KENV = 390 // { int kenv(int what, const char *name, char *value, int len); } SYS_LCHFLAGS = 391 // { int lchflags(char *path, int flags); } SYS_UUIDGEN = 392 // { int uuidgen(struct uuid *store, int count); } SYS_SENDFILE = 393 // { int sendfile(int fd, int s, off_t offset, size_t nbytes, struct sf_hdtr *hdtr, off_t *sbytes, int flags); } SYS_VARSYM_SET = 450 // { int varsym_set(int level, const char *name, const char *data); } SYS_VARSYM_GET = 451 // { int varsym_get(int mask, const char *wild, char *buf, int bufsize); } SYS_VARSYM_LIST = 452 // { int varsym_list(int level, char *buf, int maxsize, int *marker); } SYS_EXEC_SYS_REGISTER = 465 // { int exec_sys_register(void *entry); } SYS_EXEC_SYS_UNREGISTER = 466 // { int exec_sys_unregister(int id); } SYS_SYS_CHECKPOINT = 467 // { int sys_checkpoint(int type, int fd, pid_t pid, int retval); } SYS_MOUNTCTL = 468 // { int mountctl(const char *path, int op, int fd, const void *ctl, int ctllen, void *buf, int buflen); } SYS_UMTX_SLEEP = 469 // { int umtx_sleep(volatile const int *ptr, int value, int timeout); } SYS_UMTX_WAKEUP = 470 // { int umtx_wakeup(volatile const int *ptr, int count); } SYS_JAIL_ATTACH = 471 // { int jail_attach(int jid); } SYS_SET_TLS_AREA = 472 // { int set_tls_area(int which, struct tls_info *info, size_t infosize); } SYS_GET_TLS_AREA = 473 // { int get_tls_area(int which, struct tls_info *info, size_t infosize); } SYS_CLOSEFROM = 474 // { int closefrom(int fd); } SYS_STAT = 475 // { int stat(const char *path, struct stat *ub); } SYS_FSTAT = 476 // { int fstat(int fd, struct stat *sb); } SYS_LSTAT = 477 // { int lstat(const char *path, struct stat *ub); } SYS_FHSTAT = 478 // { int fhstat(const struct fhandle *u_fhp, struct stat *sb); } SYS_GETDIRENTRIES = 479 // { int getdirentries(int fd, char *buf, u_int count, long *basep); } SYS_GETDENTS = 480 // { int getdents(int fd, char *buf, size_t count); } SYS_USCHED_SET = 481 // { int usched_set(pid_t pid, int cmd, void *data, int bytes); } SYS_EXTACCEPT = 482 // { int extaccept(int s, int flags, caddr_t name, int *anamelen); } SYS_EXTCONNECT = 483 // { int extconnect(int s, int flags, caddr_t name, int namelen); } SYS_MCONTROL = 485 // { int mcontrol(void *addr, size_t len, int behav, off_t value); } SYS_VMSPACE_CREATE = 486 // { int vmspace_create(void *id, int type, void *data); } SYS_VMSPACE_DESTROY = 487 // { int vmspace_destroy(void *id); } SYS_VMSPACE_CTL = 488 // { int vmspace_ctl(void *id, int cmd, struct trapframe *tframe, struct vextframe *vframe); } SYS_VMSPACE_MMAP = 489 // { int vmspace_mmap(void *id, void *addr, size_t len, int prot, int flags, int fd, off_t offset); } SYS_VMSPACE_MUNMAP = 490 // { int vmspace_munmap(void *id, void *addr, size_t len); } SYS_VMSPACE_MCONTROL = 491 // { int vmspace_mcontrol(void *id, void *addr, size_t len, int behav, off_t value); } SYS_VMSPACE_PREAD = 492 // { ssize_t vmspace_pread(void *id, void *buf, size_t nbyte, int flags, off_t offset); } SYS_VMSPACE_PWRITE = 493 // { ssize_t vmspace_pwrite(void *id, const void *buf, size_t nbyte, int flags, off_t offset); } SYS_EXTEXIT = 494 // { void extexit(int how, int status, void *addr); } SYS_LWP_CREATE = 495 // { int lwp_create(struct lwp_params *params); } SYS_LWP_GETTID = 496 // { lwpid_t lwp_gettid(void); } SYS_LWP_KILL = 497 // { int lwp_kill(pid_t pid, lwpid_t tid, int signum); } SYS_LWP_RTPRIO = 498 // { int lwp_rtprio(int function, pid_t pid, lwpid_t tid, struct rtprio *rtp); } SYS_PSELECT = 499 // { int pselect(int nd, fd_set *in, fd_set *ou, fd_set *ex, const struct timespec *ts, const sigset_t *sigmask); } SYS_STATVFS = 500 // { int statvfs(const char *path, struct statvfs *buf); } SYS_FSTATVFS = 501 // { int fstatvfs(int fd, struct statvfs *buf); } SYS_FHSTATVFS = 502 // { int fhstatvfs(const struct fhandle *u_fhp, struct statvfs *buf); } SYS_GETVFSSTAT = 503 // { int getvfsstat(struct statfs *buf, struct statvfs *vbuf, long vbufsize, int flags); } SYS_OPENAT = 504 // { int openat(int fd, char *path, int flags, int mode); } SYS_FSTATAT = 505 // { int fstatat(int fd, char *path, struct stat *sb, int flags); } SYS_FCHMODAT = 506 // { int fchmodat(int fd, char *path, int mode, int flags); } SYS_FCHOWNAT = 507 // { int fchownat(int fd, char *path, int uid, int gid, int flags); } SYS_UNLINKAT = 508 // { int unlinkat(int fd, char *path, int flags); } SYS_FACCESSAT = 509 // { int faccessat(int fd, char *path, int amode, int flags); } SYS_MQ_OPEN = 510 // { mqd_t mq_open(const char * name, int oflag, mode_t mode, struct mq_attr *attr); } SYS_MQ_CLOSE = 511 // { int mq_close(mqd_t mqdes); } SYS_MQ_UNLINK = 512 // { int mq_unlink(const char *name); } SYS_MQ_GETATTR = 513 // { int mq_getattr(mqd_t mqdes, struct mq_attr *mqstat); } SYS_MQ_SETATTR = 514 // { int mq_setattr(mqd_t mqdes, const struct mq_attr *mqstat, struct mq_attr *omqstat); } SYS_MQ_NOTIFY = 515 // { int mq_notify(mqd_t mqdes, const struct sigevent *notification); } SYS_MQ_SEND = 516 // { int mq_send(mqd_t mqdes, const char *msg_ptr, size_t msg_len, unsigned msg_prio); } SYS_MQ_RECEIVE = 517 // { ssize_t mq_receive(mqd_t mqdes, char *msg_ptr, size_t msg_len, unsigned *msg_prio); } SYS_MQ_TIMEDSEND = 518 // { int mq_timedsend(mqd_t mqdes, const char *msg_ptr, size_t msg_len, unsigned msg_prio, const struct timespec *abs_timeout); } SYS_MQ_TIMEDRECEIVE = 519 // { ssize_t mq_timedreceive(mqd_t mqdes, char *msg_ptr, size_t msg_len, unsigned *msg_prio, const struct timespec *abs_timeout); } SYS_IOPRIO_SET = 520 // { int ioprio_set(int which, int who, int prio); } SYS_IOPRIO_GET = 521 // { int ioprio_get(int which, int who); } SYS_CHROOT_KERNEL = 522 // { int chroot_kernel(char *path); } SYS_RENAMEAT = 523 // { int renameat(int oldfd, char *old, int newfd, char *new); } SYS_MKDIRAT = 524 // { int mkdirat(int fd, char *path, mode_t mode); } SYS_MKFIFOAT = 525 // { int mkfifoat(int fd, char *path, mode_t mode); } SYS_MKNODAT = 526 // { int mknodat(int fd, char *path, mode_t mode, dev_t dev); } SYS_READLINKAT = 527 // { int readlinkat(int fd, char *path, char *buf, size_t bufsize); } SYS_SYMLINKAT = 528 // { int symlinkat(char *path1, int fd, char *path2); } SYS_SWAPOFF = 529 // { int swapoff(char *name); } SYS_VQUOTACTL = 530 // { int vquotactl(const char *path, struct plistref *pref); } SYS_LINKAT = 531 // { int linkat(int fd1, char *path1, int fd2, char *path2, int flags); } SYS_EACCESS = 532 // { int eaccess(char *path, int flags); } SYS_LPATHCONF = 533 // { int lpathconf(char *path, int name); } SYS_VMM_GUEST_CTL = 534 // { int vmm_guest_ctl(int op, struct vmm_guest_options *options); } SYS_VMM_GUEST_SYNC_ADDR = 535 // { int vmm_guest_sync_addr(long *dstaddr, long *srcaddr); } SYS_PROCCTL = 536 // { int procctl(idtype_t idtype, id_t id, int cmd, void *data); } SYS_CHFLAGSAT = 537 // { int chflagsat(int fd, const char *path, int flags, int atflags);} SYS_PIPE2 = 538 // { int pipe2(int *fildes, int flags); } SYS_UTIMENSAT = 539 // { int utimensat(int fd, const char *path, const struct timespec *ts, int flags); } SYS_FUTIMENS = 540 // { int futimens(int fd, const struct timespec *ts); } SYS_ACCEPT4 = 541 // { int accept4(int s, caddr_t name, int *anamelen, int flags); } SYS_LWP_SETNAME = 542 // { int lwp_setname(lwpid_t tid, const char *name); } SYS_PPOLL = 543 // { int ppoll(struct pollfd *fds, u_int nfds, const struct timespec *ts, const sigset_t *sigmask); } SYS_LWP_SETAFFINITY = 544 // { int lwp_setaffinity(pid_t pid, lwpid_t tid, const cpumask_t *mask); } SYS_LWP_GETAFFINITY = 545 // { int lwp_getaffinity(pid_t pid, lwpid_t tid, cpumask_t *mask); } SYS_LWP_CREATE2 = 546 // { int lwp_create2(struct lwp_params *params, const cpumask_t *mask); } )
{ "pile_set_name": "Github" }
#pragma glslify: envMapEquirect = require(../../local_modules/glsl-envmap-equirect) #pragma glslify: envMapCube = require(../../local_modules/glsl-envmap-cube) #pragma glslify: toGamma = require(glsl-gamma/out) #pragma glslify: toLinear = require(glsl-gamma/in) #pragma glslify: tonemapUncharted2 = require(../../local_modules/glsl-tonemap-uncharted2) #pragma glslify: random = require(glsl-random) //Disney //https://github.com/wdas/brdf/blob/master/src/brdfs/disney.brdf #ifdef GL_ES precision highp float; #endif #ifdef GL_ES #extension GL_EXT_shader_texture_lod : require #else #extension GL_ARB_shader_texture_lod : require #endif uniform float uExposure; uniform float uIor; varying vec3 vNormalWorld; varying vec3 vEyeDirWorld; float saturate(float f) { return clamp(f, 0.0, 1.0); } uniform vec4 uAlbedoColor; //assumes sRGB color, not linear vec3 getAlbedo() { return toLinear(uAlbedoColor.rgb); } uniform float uRoughness; float getRoughness() { return uRoughness; } uniform float uMetalness; float getMetalness() { return uMetalness; } uniform samplerCube uReflectionMap; uniform samplerCube uIrradianceMap; vec3 getIrradiance(vec3 eyeDirWorld, vec3 normalWorld) { float maxMipMapLevel = 7.0; //TODO: const vec3 reflectionWorld = reflect(-eyeDirWorld, normalWorld); vec3 R = envMapCube(reflectionWorld); return textureCube(uIrradianceMap, R).rgb; } vec3 EnvBRDFApprox( vec3 SpecularColor, float Roughness, float NoV ) { const vec4 c0 = vec4(-1, -0.0275, -0.572, 0.022 ); const vec4 c1 = vec4( 1, 0.0425, 1.04, -0.04 ); vec4 r = Roughness * c0 + c1; float a004 = min( r.x * r.x, exp2( -9.28 * NoV ) ) * r.x + r.y; vec2 AB = vec2( -1.04, 1.04 ) * a004 + r.zw; return SpecularColor * AB.x + AB.y; } vec3 getPrefilteredReflection(vec3 eyeDirWorld, vec3 normalWorld, float roughness) { float maxMipMapLevel = 5; //TODO: const vec3 reflectionWorld = reflect(-eyeDirWorld, normalWorld); //vec3 R = envMapCube(data.normalWorld); vec3 R = envMapCube(reflectionWorld); float lod = roughness * maxMipMapLevel; float upLod = floor(lod); float downLod = ceil(lod); //vec4 a = textureCubeLod(reflectionMap, fixSeams(reflectionWorld, upLod), upLod); //vec4 b = textureCubeLod(reflectionMap, fixSeams(reflectionWorld, downLod), downLod); vec3 a = textureCubeLod(uReflectionMap, R, upLod).rgb; vec3 b = textureCubeLod(uReflectionMap, R, downLod).rgb; return mix(a, b, lod - upLod); } varying vec3 vPositionView; uniform mat4 uInverseViewMatrix; void main() { vec3 normalWorld = normalize(vNormalWorld); vec3 eyeDirWorld = normalize(vEyeDirWorld); vec3 albedo = getAlbedo(); float roughness = getRoughness(); float metalness = getMetalness(); vec3 irradianceColor = getIrradiance(eyeDirWorld, normalWorld); vec3 reflectionColor = getPrefilteredReflection(eyeDirWorld, normalWorld, roughness); vec3 F0 = vec3(abs((1.0 - uIor) / (1.0 + uIor))); F0 = F0 * F0; //F0 = vec3(0.04); //0.04 is default for non-metals in UE4 F0 = mix(F0, albedo, metalness); float NdotV = saturate( dot( normalWorld, eyeDirWorld ) ); vec3 reflectance = EnvBRDFApprox( F0, roughness, NdotV ); vec3 diffuseColor = albedo * (1.0 - metalness); //TODO: No kd? so not really energy conserving //we could use disney brdf for irradiance map to compensate for that like in Frostbite vec3 color = diffuseColor * irradianceColor + reflectionColor * reflectance; color *= uExposure; color = tonemapUncharted2(color); color = toGamma(color); gl_FragColor.rgb = color; gl_FragColor.a = 1.0; }
{ "pile_set_name": "Github" }
๏ปฟ<?xml version="1.0" encoding="utf-8"?> <Project Sdk="Microsoft.NET.Sdk"> <PropertyGroup> <TargetFramework>netstandard2.0</TargetFramework> </PropertyGroup> <ItemGroup> <PackageReference Include="FodyHelpers" Version="6.1.0" /> </ItemGroup> </Project>
{ "pile_set_name": "Github" }
-- -- Test cube datatype -- CREATE EXTENSION cube; -- Check whether any of our opclasses fail amvalidate SELECT amname, opcname FROM pg_opclass opc LEFT JOIN pg_am am ON am.oid = opcmethod WHERE opc.oid >= 16384 AND NOT amvalidate(opc.oid); -- -- testing the input and output functions -- -- Any number (a one-dimensional point) SELECT '1'::cube AS cube; SELECT '-1'::cube AS cube; SELECT '1.'::cube AS cube; SELECT '-1.'::cube AS cube; SELECT '.1'::cube AS cube; SELECT '-.1'::cube AS cube; SELECT '1.0'::cube AS cube; SELECT '-1.0'::cube AS cube; SELECT 'infinity'::cube AS cube; SELECT '-infinity'::cube AS cube; SELECT 'NaN'::cube AS cube; SELECT '.1234567890123456'::cube AS cube; SELECT '+.1234567890123456'::cube AS cube; SELECT '-.1234567890123456'::cube AS cube; -- simple lists (points) SELECT '()'::cube AS cube; SELECT '1,2'::cube AS cube; SELECT '(1,2)'::cube AS cube; SELECT '1,2,3,4,5'::cube AS cube; SELECT '(1,2,3,4,5)'::cube AS cube; -- double lists (cubes) SELECT '(),()'::cube AS cube; SELECT '(0),(0)'::cube AS cube; SELECT '(0),(1)'::cube AS cube; SELECT '[(0),(0)]'::cube AS cube; SELECT '[(0),(1)]'::cube AS cube; SELECT '(0,0,0,0),(0,0,0,0)'::cube AS cube; SELECT '(0,0,0,0),(1,0,0,0)'::cube AS cube; SELECT '[(0,0,0,0),(0,0,0,0)]'::cube AS cube; SELECT '[(0,0,0,0),(1,0,0,0)]'::cube AS cube; -- invalid input: parse errors SELECT ''::cube AS cube; SELECT 'ABC'::cube AS cube; SELECT '[]'::cube AS cube; SELECT '[()]'::cube AS cube; SELECT '[(1)]'::cube AS cube; SELECT '[(1),]'::cube AS cube; SELECT '[(1),2]'::cube AS cube; SELECT '[(1),(2),(3)]'::cube AS cube; SELECT '1,'::cube AS cube; SELECT '1,2,'::cube AS cube; SELECT '1,,2'::cube AS cube; SELECT '(1,)'::cube AS cube; SELECT '(1,2,)'::cube AS cube; SELECT '(1,,2)'::cube AS cube; -- invalid input: semantic errors and trailing garbage SELECT '[(1),(2)],'::cube AS cube; -- 0 SELECT '[(1,2,3),(2,3)]'::cube AS cube; -- 1 SELECT '[(1,2),(1,2,3)]'::cube AS cube; -- 1 SELECT '(1),(2),'::cube AS cube; -- 2 SELECT '(1,2,3),(2,3)'::cube AS cube; -- 3 SELECT '(1,2),(1,2,3)'::cube AS cube; -- 3 SELECT '(1,2,3)ab'::cube AS cube; -- 4 SELECT '(1,2,3)a'::cube AS cube; -- 5 SELECT '(1,2)('::cube AS cube; -- 5 SELECT '1,2ab'::cube AS cube; -- 6 SELECT '1 e7'::cube AS cube; -- 6 SELECT '1,2a'::cube AS cube; -- 7 SELECT '1..2'::cube AS cube; -- 7 SELECT '-1e-700'::cube AS cube; -- out of range -- -- Testing building cubes from float8 values -- SELECT cube(0::float8); SELECT cube(1::float8); SELECT cube(1,2); SELECT cube(cube(1,2),3); SELECT cube(cube(1,2),3,4); SELECT cube(cube(cube(1,2),3,4),5); SELECT cube(cube(cube(1,2),3,4),5,6); -- -- Test that the text -> cube cast was installed. -- SELECT '(0)'::text::cube; -- -- Test the float[] -> cube cast -- SELECT cube('{0,1,2}'::float[], '{3,4,5}'::float[]); SELECT cube('{0,1,2}'::float[], '{3}'::float[]); SELECT cube(NULL::float[], '{3}'::float[]); SELECT cube('{0,1,2}'::float[]); SELECT cube_subset(cube('(1,3,5),(6,7,8)'), ARRAY[3,2,1,1]); SELECT cube_subset(cube('(1,3,5),(1,3,5)'), ARRAY[3,2,1,1]); SELECT cube_subset(cube('(1,3,5),(6,7,8)'), ARRAY[4,0]); SELECT cube_subset(cube('(6,7,8),(6,7,8)'), ARRAY[4,0]); -- test for limits: this should pass SELECT cube_subset(cube('(6,7,8),(6,7,8)'), array(SELECT 1 as a FROM generate_series(1,100))); -- and this should fail SELECT cube_subset(cube('(6,7,8),(6,7,8)'), array(SELECT 1 as a FROM generate_series(1,101))); -- -- Test point processing -- SELECT cube('(1,2),(1,2)'); -- cube_in SELECT cube('{0,1,2}'::float[], '{0,1,2}'::float[]); -- cube_a_f8_f8 SELECT cube('{5,6,7,8}'::float[]); -- cube_a_f8 SELECT cube(1.37); -- cube_f8 SELECT cube(1.37, 1.37); -- cube_f8_f8 SELECT cube(cube(1,1), 42); -- cube_c_f8 SELECT cube(cube(1,2), 42); -- cube_c_f8 SELECT cube(cube(1,1), 42, 42); -- cube_c_f8_f8 SELECT cube(cube(1,1), 42, 24); -- cube_c_f8_f8 SELECT cube(cube(1,2), 42, 42); -- cube_c_f8_f8 SELECT cube(cube(1,2), 42, 24); -- cube_c_f8_f8 -- -- Testing limit of CUBE_MAX_DIM dimensions check in cube_in. -- -- create too big cube from literal select '(0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0)'::cube; select '(0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0),(0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0)'::cube; -- from an array select cube(array(SELECT 0 as a FROM generate_series(1,101))); select cube(array(SELECT 0 as a FROM generate_series(1,101)),array(SELECT 0 as a FROM generate_series(1,101))); -- extend cube beyond limit -- this should work select cube(array(SELECT 0 as a FROM generate_series(1,100))); select cube(array(SELECT 0 as a FROM generate_series(1,100)),array(SELECT 0 as a FROM generate_series(1,100))); -- this should fail select cube(cube(array(SELECT 0 as a FROM generate_series(1,100))), 0); select cube(cube(array(SELECT 0 as a FROM generate_series(1,100)),array(SELECT 0 as a FROM generate_series(1,100))), 0, 0); -- -- testing the operators -- -- equality/inequality: -- SELECT '24, 33.20'::cube = '24, 33.20'::cube AS bool; SELECT '24, 33.20'::cube != '24, 33.20'::cube AS bool; SELECT '24, 33.20'::cube = '24, 33.21'::cube AS bool; SELECT '24, 33.20'::cube != '24, 33.21'::cube AS bool; SELECT '(2,0),(3,1)'::cube = '(2,0,0,0,0),(3,1,0,0,0)'::cube AS bool; SELECT '(2,0),(3,1)'::cube = '(2,0,0,0,0),(3,1,0,0,1)'::cube AS bool; -- "lower than" / "greater than" -- (these operators are not useful for anything but ordering) -- SELECT '1'::cube > '2'::cube AS bool; SELECT '1'::cube < '2'::cube AS bool; SELECT '1,1'::cube > '1,2'::cube AS bool; SELECT '1,1'::cube < '1,2'::cube AS bool; SELECT '(2,0),(3,1)'::cube > '(2,0,0,0,0),(3,1,0,0,1)'::cube AS bool; SELECT '(2,0),(3,1)'::cube < '(2,0,0,0,0),(3,1,0,0,1)'::cube AS bool; SELECT '(2,0),(3,1)'::cube > '(2,0,0,0,1),(3,1,0,0,0)'::cube AS bool; SELECT '(2,0),(3,1)'::cube < '(2,0,0,0,1),(3,1,0,0,0)'::cube AS bool; SELECT '(2,0),(3,1)'::cube > '(2,0,0,0,0),(3,1,0,0,0)'::cube AS bool; SELECT '(2,0),(3,1)'::cube < '(2,0,0,0,0),(3,1,0,0,0)'::cube AS bool; SELECT '(2,0,0,0,0),(3,1,0,0,1)'::cube > '(2,0),(3,1)'::cube AS bool; SELECT '(2,0,0,0,0),(3,1,0,0,1)'::cube < '(2,0),(3,1)'::cube AS bool; SELECT '(2,0,0,0,1),(3,1,0,0,0)'::cube > '(2,0),(3,1)'::cube AS bool; SELECT '(2,0,0,0,1),(3,1,0,0,0)'::cube < '(2,0),(3,1)'::cube AS bool; SELECT '(2,0,0,0,0),(3,1,0,0,0)'::cube > '(2,0),(3,1)'::cube AS bool; SELECT '(2,0,0,0,0),(3,1,0,0,0)'::cube < '(2,0),(3,1)'::cube AS bool; -- "overlap" -- SELECT '1'::cube && '1'::cube AS bool; SELECT '1'::cube && '2'::cube AS bool; SELECT '[(-1,-1,-1),(1,1,1)]'::cube && '0'::cube AS bool; SELECT '[(-1,-1,-1),(1,1,1)]'::cube && '1'::cube AS bool; SELECT '[(-1,-1,-1),(1,1,1)]'::cube && '1,1,1'::cube AS bool; SELECT '[(-1,-1,-1),(1,1,1)]'::cube && '[(1,1,1),(2,2,2)]'::cube AS bool; SELECT '[(-1,-1,-1),(1,1,1)]'::cube && '[(1,1),(2,2)]'::cube AS bool; SELECT '[(-1,-1,-1),(1,1,1)]'::cube && '[(2,1,1),(2,2,2)]'::cube AS bool; -- "contained in" (the left operand is the cube entirely enclosed by -- the right operand): -- SELECT '0'::cube <@ '0'::cube AS bool; SELECT '0,0,0'::cube <@ '0,0,0'::cube AS bool; SELECT '0,0'::cube <@ '0,0,1'::cube AS bool; SELECT '0,0,0'::cube <@ '0,0,1'::cube AS bool; SELECT '1,0,0'::cube <@ '0,0,1'::cube AS bool; SELECT '(1,0,0),(0,0,1)'::cube <@ '(1,0,0),(0,0,1)'::cube AS bool; SELECT '(1,0,0),(0,0,1)'::cube <@ '(-1,-1,-1),(1,1,1)'::cube AS bool; SELECT '(1,0,0),(0,0,1)'::cube <@ '(-1,-1,-1,-1),(1,1,1,1)'::cube AS bool; SELECT '0'::cube <@ '(-1),(1)'::cube AS bool; SELECT '1'::cube <@ '(-1),(1)'::cube AS bool; SELECT '-1'::cube <@ '(-1),(1)'::cube AS bool; SELECT '(-1),(1)'::cube <@ '(-1),(1)'::cube AS bool; SELECT '(-1),(1)'::cube <@ '(-1,-1),(1,1)'::cube AS bool; SELECT '(-2),(1)'::cube <@ '(-1),(1)'::cube AS bool; SELECT '(-2),(1)'::cube <@ '(-1,-1),(1,1)'::cube AS bool; -- "contains" (the left operand is the cube that entirely encloses the -- right operand) -- SELECT '0'::cube @> '0'::cube AS bool; SELECT '0,0,0'::cube @> '0,0,0'::cube AS bool; SELECT '0,0,1'::cube @> '0,0'::cube AS bool; SELECT '0,0,1'::cube @> '0,0,0'::cube AS bool; SELECT '0,0,1'::cube @> '1,0,0'::cube AS bool; SELECT '(1,0,0),(0,0,1)'::cube @> '(1,0,0),(0,0,1)'::cube AS bool; SELECT '(-1,-1,-1),(1,1,1)'::cube @> '(1,0,0),(0,0,1)'::cube AS bool; SELECT '(-1,-1,-1,-1),(1,1,1,1)'::cube @> '(1,0,0),(0,0,1)'::cube AS bool; SELECT '(-1),(1)'::cube @> '0'::cube AS bool; SELECT '(-1),(1)'::cube @> '1'::cube AS bool; SELECT '(-1),(1)'::cube @> '-1'::cube AS bool; SELECT '(-1),(1)'::cube @> '(-1),(1)'::cube AS bool; SELECT '(-1,-1),(1,1)'::cube @> '(-1),(1)'::cube AS bool; SELECT '(-1),(1)'::cube @> '(-2),(1)'::cube AS bool; SELECT '(-1,-1),(1,1)'::cube @> '(-2),(1)'::cube AS bool; -- Test of distance function -- SELECT cube_distance('(0)'::cube,'(2,2,2,2)'::cube); SELECT cube_distance('(0)'::cube,'(.3,.4)'::cube); SELECT cube_distance('(2,3,4)'::cube,'(2,3,4)'::cube); SELECT cube_distance('(42,42,42,42)'::cube,'(137,137,137,137)'::cube); SELECT cube_distance('(42,42,42)'::cube,'(137,137)'::cube); -- Test of cube function (text to cube) -- SELECT cube('(1,1.2)'::text); SELECT cube(NULL); -- Test of cube_dim function (dimensions stored in cube) -- SELECT cube_dim('(0)'::cube); SELECT cube_dim('(0,0)'::cube); SELECT cube_dim('(0,0,0)'::cube); SELECT cube_dim('(42,42,42),(42,42,42)'::cube); SELECT cube_dim('(4,8,15,16,23),(4,8,15,16,23)'::cube); -- Test of cube_ll_coord function (retrieves LL coordinate values) -- SELECT cube_ll_coord('(-1,1),(2,-2)'::cube, 1); SELECT cube_ll_coord('(-1,1),(2,-2)'::cube, 2); SELECT cube_ll_coord('(-1,1),(2,-2)'::cube, 3); SELECT cube_ll_coord('(1,2),(1,2)'::cube, 1); SELECT cube_ll_coord('(1,2),(1,2)'::cube, 2); SELECT cube_ll_coord('(1,2),(1,2)'::cube, 3); SELECT cube_ll_coord('(42,137)'::cube, 1); SELECT cube_ll_coord('(42,137)'::cube, 2); SELECT cube_ll_coord('(42,137)'::cube, 3); -- Test of cube_ur_coord function (retrieves UR coordinate values) -- SELECT cube_ur_coord('(-1,1),(2,-2)'::cube, 1); SELECT cube_ur_coord('(-1,1),(2,-2)'::cube, 2); SELECT cube_ur_coord('(-1,1),(2,-2)'::cube, 3); SELECT cube_ur_coord('(1,2),(1,2)'::cube, 1); SELECT cube_ur_coord('(1,2),(1,2)'::cube, 2); SELECT cube_ur_coord('(1,2),(1,2)'::cube, 3); SELECT cube_ur_coord('(42,137)'::cube, 1); SELECT cube_ur_coord('(42,137)'::cube, 2); SELECT cube_ur_coord('(42,137)'::cube, 3); -- Test of cube_is_point -- SELECT cube_is_point('(0)'::cube); SELECT cube_is_point('(0,1,2)'::cube); SELECT cube_is_point('(0,1,2),(0,1,2)'::cube); SELECT cube_is_point('(0,1,2),(-1,1,2)'::cube); SELECT cube_is_point('(0,1,2),(0,-1,2)'::cube); SELECT cube_is_point('(0,1,2),(0,1,-2)'::cube); -- Test of cube_enlarge (enlarging and shrinking cubes) -- SELECT cube_enlarge('(0)'::cube, 0, 0); SELECT cube_enlarge('(0)'::cube, 0, 1); SELECT cube_enlarge('(0)'::cube, 0, 2); SELECT cube_enlarge('(2),(-2)'::cube, 0, 4); SELECT cube_enlarge('(0)'::cube, 1, 0); SELECT cube_enlarge('(0)'::cube, 1, 1); SELECT cube_enlarge('(0)'::cube, 1, 2); SELECT cube_enlarge('(2),(-2)'::cube, 1, 4); SELECT cube_enlarge('(0)'::cube, -1, 0); SELECT cube_enlarge('(0)'::cube, -1, 1); SELECT cube_enlarge('(0)'::cube, -1, 2); SELECT cube_enlarge('(2),(-2)'::cube, -1, 4); SELECT cube_enlarge('(0,0,0)'::cube, 1, 0); SELECT cube_enlarge('(0,0,0)'::cube, 1, 2); SELECT cube_enlarge('(2,-2),(-3,7)'::cube, 1, 2); SELECT cube_enlarge('(2,-2),(-3,7)'::cube, 3, 2); SELECT cube_enlarge('(2,-2),(-3,7)'::cube, -1, 2); SELECT cube_enlarge('(2,-2),(-3,7)'::cube, -3, 2); SELECT cube_enlarge('(42,-23,-23),(42,23,23)'::cube, -23, 5); SELECT cube_enlarge('(42,-23,-23),(42,23,23)'::cube, -24, 5); -- Test of cube_union (MBR for two cubes) -- SELECT cube_union('(1,2),(3,4)'::cube, '(5,6,7),(8,9,10)'::cube); SELECT cube_union('(1,2)'::cube, '(4,2,0,0)'::cube); SELECT cube_union('(1,2),(1,2)'::cube, '(4,2),(4,2)'::cube); SELECT cube_union('(1,2),(1,2)'::cube, '(1,2),(1,2)'::cube); SELECT cube_union('(1,2),(1,2)'::cube, '(1,2,0),(1,2,0)'::cube); -- Test of cube_inter -- SELECT cube_inter('(1,2),(10,11)'::cube, '(3,4), (16,15)'::cube); -- intersects SELECT cube_inter('(1,2),(10,11)'::cube, '(3,4), (6,5)'::cube); -- includes SELECT cube_inter('(1,2),(10,11)'::cube, '(13,14), (16,15)'::cube); -- no intersection SELECT cube_inter('(1,2),(10,11)'::cube, '(3,14), (16,15)'::cube); -- no intersection, but one dimension intersects SELECT cube_inter('(1,2),(10,11)'::cube, '(10,11), (16,15)'::cube); -- point intersection SELECT cube_inter('(1,2,3)'::cube, '(1,2,3)'::cube); -- point args SELECT cube_inter('(1,2,3)'::cube, '(5,6,3)'::cube); -- point args -- Test of cube_size -- SELECT cube_size('(4,8),(15,16)'::cube); SELECT cube_size('(42,137)'::cube); -- Test of distances -- SELECT cube_distance('(1,1)'::cube, '(4,5)'::cube); SELECT '(1,1)'::cube <-> '(4,5)'::cube as d_e; SELECT distance_chebyshev('(1,1)'::cube, '(4,5)'::cube); SELECT '(1,1)'::cube <=> '(4,5)'::cube as d_c; SELECT distance_taxicab('(1,1)'::cube, '(4,5)'::cube); SELECT '(1,1)'::cube <#> '(4,5)'::cube as d_t; -- zero for overlapping SELECT cube_distance('(2,2),(10,10)'::cube, '(0,0),(5,5)'::cube); SELECT distance_chebyshev('(2,2),(10,10)'::cube, '(0,0),(5,5)'::cube); SELECT distance_taxicab('(2,2),(10,10)'::cube, '(0,0),(5,5)'::cube); -- coordinate access SELECT cube(array[10,20,30], array[40,50,60])->1; SELECT cube(array[40,50,60], array[10,20,30])->1; SELECT cube(array[10,20,30], array[40,50,60])->6; SELECT cube(array[10,20,30], array[40,50,60])->0; SELECT cube(array[10,20,30], array[40,50,60])->7; SELECT cube(array[10,20,30], array[40,50,60])->-1; SELECT cube(array[10,20,30], array[40,50,60])->-6; SELECT cube(array[10,20,30])->3; SELECT cube(array[10,20,30])->6; SELECT cube(array[10,20,30])->-6; -- "normalized" coordinate access SELECT cube(array[10,20,30], array[40,50,60])~>1; SELECT cube(array[40,50,60], array[10,20,30])~>1; SELECT cube(array[10,20,30], array[40,50,60])~>2; SELECT cube(array[40,50,60], array[10,20,30])~>2; SELECT cube(array[10,20,30], array[40,50,60])~>3; SELECT cube(array[40,50,60], array[10,20,30])~>3; SELECT cube(array[40,50,60], array[10,20,30])~>0; SELECT cube(array[40,50,60], array[10,20,30])~>4; SELECT cube(array[40,50,60], array[10,20,30])~>(-1); -- Load some example data and build the index -- CREATE TABLE test_cube (c cube); \copy test_cube from 'data/test_cube.data' CREATE INDEX test_cube_ix ON test_cube USING gist (c); SELECT * FROM test_cube WHERE c && '(3000,1000),(0,0)' ORDER BY c; -- Test sorting SELECT * FROM test_cube WHERE c && '(3000,1000),(0,0)' GROUP BY c ORDER BY c; -- Test index-only scans SET enable_bitmapscan = false; EXPLAIN (COSTS OFF) SELECT c FROM test_cube WHERE c <@ '(3000,1000),(0,0)' ORDER BY c; SELECT c FROM test_cube WHERE c <@ '(3000,1000),(0,0)' ORDER BY c; RESET enable_bitmapscan; -- Test kNN INSERT INTO test_cube VALUES ('(1,1)'), ('(100000)'), ('(0, 100000)'); -- Some corner cases SET enable_seqscan = false; -- Test different metrics SELECT *, c <-> '(100, 100),(500, 500)'::cube as dist FROM test_cube ORDER BY c <-> '(100, 100),(500, 500)'::cube LIMIT 5; SELECT *, c <=> '(100, 100),(500, 500)'::cube as dist FROM test_cube ORDER BY c <=> '(100, 100),(500, 500)'::cube LIMIT 5; SELECT *, c <#> '(100, 100),(500, 500)'::cube as dist FROM test_cube ORDER BY c <#> '(100, 100),(500, 500)'::cube LIMIT 5; -- Test sorting by coordinates SELECT c~>1, c FROM test_cube ORDER BY c~>1 LIMIT 15; -- ascending by left bound SELECT c~>2, c FROM test_cube ORDER BY c~>2 LIMIT 15; -- ascending by right bound SELECT c~>3, c FROM test_cube ORDER BY c~>3 LIMIT 15; -- ascending by lower bound SELECT c~>4, c FROM test_cube ORDER BY c~>4 LIMIT 15; -- ascending by upper bound SELECT c~>(-1), c FROM test_cube ORDER BY c~>(-1) LIMIT 15; -- descending by left bound SELECT c~>(-2), c FROM test_cube ORDER BY c~>(-2) LIMIT 15; -- descending by right bound SELECT c~>(-3), c FROM test_cube ORDER BY c~>(-3) LIMIT 15; -- descending by lower bound SELECT c~>(-4), c FROM test_cube ORDER BY c~>(-4) LIMIT 15; -- descending by upper bound -- Same queries with sequential scan (should give the same results as above) RESET enable_seqscan; SET enable_indexscan = OFF; SELECT *, c <-> '(100, 100),(500, 500)'::cube as dist FROM test_cube ORDER BY c <-> '(100, 100),(500, 500)'::cube LIMIT 5; SELECT *, c <=> '(100, 100),(500, 500)'::cube as dist FROM test_cube ORDER BY c <=> '(100, 100),(500, 500)'::cube LIMIT 5; SELECT *, c <#> '(100, 100),(500, 500)'::cube as dist FROM test_cube ORDER BY c <#> '(100, 100),(500, 500)'::cube LIMIT 5; SELECT c~>1, c FROM test_cube ORDER BY c~>1 LIMIT 15; -- ascending by left bound SELECT c~>2, c FROM test_cube ORDER BY c~>2 LIMIT 15; -- ascending by right bound SELECT c~>3, c FROM test_cube ORDER BY c~>3 LIMIT 15; -- ascending by lower bound SELECT c~>4, c FROM test_cube ORDER BY c~>4 LIMIT 15; -- ascending by upper bound SELECT c~>(-1), c FROM test_cube ORDER BY c~>(-1) LIMIT 15; -- descending by left bound SELECT c~>(-2), c FROM test_cube ORDER BY c~>(-2) LIMIT 15; -- descending by right bound SELECT c~>(-3), c FROM test_cube ORDER BY c~>(-3) LIMIT 15; -- descending by lower bound SELECT c~>(-4), c FROM test_cube ORDER BY c~>(-4) LIMIT 15; -- descending by upper bound RESET enable_indexscan;
{ "pile_set_name": "Github" }
/// Copyright (c) 2009 Microsoft Corporation /// /// 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 Microsoft 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. ES5Harness.registerTest({ id: "15.2.3.5-4-164", path: "TestCases/chapter15/15.2/15.2.3/15.2.3.5/15.2.3.5-4-164.js", description: "Object.create - 'value' property of one property in 'Properties' is an inherited accessor property without a get function (8.10.5 step 5.a)", test: function testcase() { var proto = {}; Object.defineProperty(proto, "value", { set: function () { } }); var ConstructFun = function () { }; ConstructFun.prototype = proto; var descObj = new ConstructFun(); var newObj = Object.create({}, { prop: descObj }); return newObj.hasOwnProperty("prop") && typeof (newObj.prop) === "undefined"; }, precondition: function prereq() { return fnExists(Object.create) && fnExists(Object.defineProperty); } });
{ "pile_set_name": "Github" }
.TH std::char_traits<CharT>::eof 3 "2019.08.27" "http://cppreference.com" "C++ Standard Libary" .SH NAME std::char_traits<CharT>::eof \- std::char_traits<CharT>::eof .SH Synopsis static int_type eof(); \fI(until C++11)\fP static constexpr int_type eof() noexcept; \fI(since C++11)\fP Returns a value not equivalent to any valid value of type char_type. Formally, returns a value e such that X::eq_int_type(e, X::to_int_type(c)) is false for all values c. .SH Parameters \fI(none)\fP .SH Return value A value not equivalent to any valid value of type char_type. .SH Complexity Constant. .SH See also not_eof checks whether a character is eof value \fB[static]\fP \fI(public static member function)\fP
{ "pile_set_name": "Github" }
/* sxr -- Scala X-Ray * Copyright 2009 Mark Harrah */ package sxr /** Escapes a raw string for use in HTML.*/ object Escape { def apply(s: String) = { val out = new StringBuilder for(i <- 0 until s.length) { s.charAt(i) match { case '>' => out.append("&gt;") case '&' => out.append("&amp;") case '<' => out.append("&lt;") case '"' => out.append("&quot;") case c => out.append(c) } } out.toString } }
{ "pile_set_name": "Github" }
{ "@context": "e128-context-3.jsonld" }
{ "pile_set_name": "Github" }
SoundFX 1.3 6 24 4 15 15 6 47 8 0 64 2 0 1 3 4 5 1 3 64 1 0 hammelody1 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 63 64 128 0 0 0 0 0 0 0 0 0 0 0 0 0 64 1 0 hammelody2 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 63 64 128 0 0 0 0 0 0 0 1 0 0 0 0 0 64 1 0 hammcomp 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 37 64 128 0 0 0 0 0 0 0 2 0 0 0 0 0 64 1 0 chat 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 15 64 128 0 0 0 0 0 0 0 3 0 0 0 0 0 64 1 0 basstrum 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 19 64 128 0 0 0 0 0 0 0 4 0 0 0 0 0 64 1 0 znare-echo 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 21 64 128 0 0 0 0 0 0 0 5 0 0 0 0 0 64 1 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 64 128 0 0 0 0 0 0 0 6 0 0 0 0 0 64 1 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 64 128 0 0 0 0 0 0 0 7 0 0 0 0 0 64 1 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 64 128 0 0 0 0 0 0 0 8 0 0 0 0 0 64 1 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 64 128 0 0 0 0 0 0 0 9 0 0 0 0 0 64 1 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 64 128 0 0 0 0 0 0 0 10 0 0 0 0 0 64 1 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 64 128 0 0 0 0 0 0 0 11 0 0 0 0 0 64 1 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 64 128 0 0 0 0 0 0 0 12 0 0 0 0 0 64 1 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 64 128 0 0 0 0 0 0 0 13 0 0 0 0 0 64 1 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 64 128 0 0 0 0 0 0 0 14 0 0 0 0 0 64 0 1 2 3 64 4 5 6 7 64 8 9 10 11 64 12 13 14 15 64 16 17 18 19 64 20 21 22 23 64 c6d5f807d23d750ab4ccca9751012b46 64 c6d5f807d23d750ab4ccca9751012b46 64 1d629b6fb52d9e3ba8dd8027fc761d8f 64 011efad19cb2781f7838416cf23ba1fa 64 c6d5f807d23d750ab4ccca9751012b46 64 c6d5f807d23d750ab4ccca9751012b46 64 3960f1b96cf845153059059a91902a6d 64 9d91f0f92ca5d1b0075e1005593e381f 64 694af1988afafe0219d256285460ac28 64 32f303ff433dffcc9215cfe3fced53b1 64 cbc685d81bbe928efa56a9fd65f695d5 64 18f35ac6a97a423ebee8dc5ac21400bb 64 c6d5f807d23d750ab4ccca9751012b46 64 c2a82d4d4a76fe31a4e7fb7b78baa485 64 3960f1b96cf845153059059a91902a6d 64 9d91f0f92ca5d1b0075e1005593e381f 64 c8995e7af0dd2a5caf33114369a2eb64 64 c6d5f807d23d750ab4ccca9751012b46 64 c6d5f807d23d750ab4ccca9751012b46 64 9d91f0f92ca5d1b0075e1005593e381f 64 c31def8d8bae1511b33c8375fde71e2c 64 0b2b802e73f94ac35fbe13dd8a28d98d 64 7aad9c98a3f283eef5c2f3a6c34f3c4c 64 110521c571495280982d528f9fc72d44 42440 0 2 0 0c91a5d2fa095da0eb17aada074a40bf 42388 0 2 0 8b9af0ab40ef39ee31be2771f2891d78 10524 0 2 0 c89d14ebb41898df1780d3653bf5ce2f 1364 0 2 0 308fdc0d36c186386283009d00f3a6fe 1156 0 2 0 5136d055b8c7c47c3c5ca40767d7e05a 11308 0 2 0 18b6783ec583f1ead8e36db086ecbb3a 0 0 0 0 d41d8cd98f00b204e9800998ecf8427e 0 0 0 0 d41d8cd98f00b204e9800998ecf8427e 0 0 0 0 d41d8cd98f00b204e9800998ecf8427e 0 0 0 0 d41d8cd98f00b204e9800998ecf8427e 0 0 0 0 d41d8cd98f00b204e9800998ecf8427e 0 0 0 0 d41d8cd98f00b204e9800998ecf8427e 0 0 0 0 d41d8cd98f00b204e9800998ecf8427e 0 0 0 0 d41d8cd98f00b204e9800998ecf8427e 0 0 0 0 d41d8cd98f00b204e9800998ecf8427e 0 64 0 255 64 0 255 64 0 0 64 0
{ "pile_set_name": "Github" }
// RUN: %clang_cc1 -fsyntax-only -verify %s // rdar://15505492 @import Foundation; // expected-error {{use of '@import' when modules are disabled}} @interface Subclass + (int)magicNumber; @end int main (void) { return Subclass.magicNumber; }
{ "pile_set_name": "Github" }
/* Unix SMB/CIFS implementation. Utility functions for Samba Copyright (C) Andrew Tridgell 1992-1999 Copyright (C) Jelmer Vernooij 2005 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 _SAMBA_UTIL_NET_H_ #define _SAMBA_UTIL_NET_H_ #include "system/network.h" /* The following definitions come from lib/util/util_net.c */ void zero_sockaddr(struct sockaddr_storage *pss); bool interpret_string_addr_internal(struct addrinfo **ppres, const char *str, int flags); bool interpret_string_addr(struct sockaddr_storage *pss, const char *str, int flags); /******************************************************************* Map a text hostname or IP address (IPv4 or IPv6) into a struct sockaddr_storage. Version that prefers IPv4. ******************************************************************/ bool interpret_string_addr_prefer_ipv4(struct sockaddr_storage *pss, const char *str, int flags); void set_sockaddr_port(struct sockaddr *psa, uint16_t port); /** Check if an IP is the 0.0.0.0. **/ _PUBLIC_ bool is_zero_ip_v4(struct in_addr ip); void in_addr_to_sockaddr_storage(struct sockaddr_storage *ss, struct in_addr ip); #if defined(HAVE_IPV6) /** * Convert an IPv6 struct in_addr to a struct sockaddr_storage. */ void in6_addr_to_sockaddr_storage(struct sockaddr_storage *ss, struct in6_addr ip); #endif /** Are two IPs on the same subnet? **/ _PUBLIC_ bool same_net_v4(struct in_addr ip1,struct in_addr ip2,struct in_addr mask); /** Return true if a string could be a pure IP address. **/ _PUBLIC_ bool is_ipaddress(const char *str); bool is_broadcast_addr(const struct sockaddr *pss); bool is_loopback_ip_v4(struct in_addr ip); bool is_loopback_addr(const struct sockaddr *pss); bool is_zero_addr(const struct sockaddr_storage *pss); void zero_ip_v4(struct in_addr *ip); bool is_linklocal_addr(const struct sockaddr_storage *pss); /** Interpret an internet address or name into an IP address in 4 byte form. **/ _PUBLIC_ uint32_t interpret_addr(const char *str); /** A convenient addition to interpret_addr(). **/ _PUBLIC_ struct in_addr interpret_addr2(const char *str); _PUBLIC_ bool is_ipaddress_v4(const char *str); _PUBLIC_ bool is_ipv6_literal(const char *str); _PUBLIC_ bool is_ipaddress_v6(const char *str); bool is_address_any(const struct sockaddr *psa); bool same_net(const struct sockaddr *ip1, const struct sockaddr *ip2, const struct sockaddr *mask); bool sockaddr_equal(const struct sockaddr *ip1, const struct sockaddr *ip2); bool is_address_any(const struct sockaddr *psa); uint16_t get_sockaddr_port(const struct sockaddr_storage *pss); char *print_sockaddr_len(char *dest, size_t destlen, const struct sockaddr *psa, socklen_t psalen); char *print_sockaddr(char *dest, size_t destlen, const struct sockaddr_storage *psa); char *print_canonical_sockaddr(TALLOC_CTX *ctx, const struct sockaddr_storage *pss); int get_socket_port(int fd); const char *client_socket_addr(int fd, char *addr, size_t addr_len); void set_socket_options(int fd, const char *options); #endif /* _SAMBA_UTIL_NET_H_ */
{ "pile_set_name": "Github" }
123456 123456 MyFirstName MyLastName MyDevelopmentUnitName MyCompanyName MyCity MT BR y 123456
{ "pile_set_name": "Github" }
<?php /** * @package Joomla.Component.Builder * * @created 30th April, 2015 * @author Llewellyn van der Merwe <http://www.joomlacomponentbuilder.com> * @github Joomla Component Builder <https://github.com/vdm-io/Joomla-Component-Builder> * @copyright Copyright (C) 2015 - 2020 Vast Development Method. All rights reserved. * @license GNU General Public License version 2 or later; see LICENSE.txt */ // No direct access to this file defined('_JEXEC') or die('Restricted access'); // load tooltip behavior JHtml::_('behavior.tooltip'); JHtml::_('behavior.multiselect'); JHtml::_('dropdown.init'); JHtml::_('formbehavior.chosen', 'select'); if ($this->saveOrder) { $saveOrderingUrl = 'index.php?option=com_componentbuilder&task=templates.saveOrderAjax&tmpl=component'; JHtml::_('sortablelist.sortable', 'templateList', 'adminForm', strtolower($this->listDirn), $saveOrderingUrl); } ?> <script type="text/javascript"> Joomla.orderTable = function() { table = document.getElementById("sortTable"); direction = document.getElementById("directionTable"); order = table.options[table.selectedIndex].value; if (order != '<?php echo $this->listOrder; ?>') { dirn = 'asc'; } else { dirn = direction.options[direction.selectedIndex].value; } Joomla.tableOrdering(order, dirn, ''); } </script> <form action="<?php echo JRoute::_('index.php?option=com_componentbuilder&view=templates'); ?>" method="post" name="adminForm" id="adminForm"> <?php if(!empty( $this->sidebar)): ?> <div id="j-sidebar-container" class="span2"> <?php echo $this->sidebar; ?> </div> <div id="j-main-container" class="span10"> <?php else : ?> <div id="j-main-container"> <?php endif; ?> <?php if (empty($this->items)): ?> <?php echo $this->loadTemplate('toolbar');?> <div class="alert alert-no-items"> <?php echo JText::_('JGLOBAL_NO_MATCHING_RESULTS'); ?> </div> <?php else : ?> <?php echo $this->loadTemplate('toolbar');?> <table class="table table-striped" id="templateList"> <thead><?php echo $this->loadTemplate('head');?></thead> <tfoot><?php echo $this->loadTemplate('foot');?></tfoot> <tbody><?php echo $this->loadTemplate('body');?></tbody> </table> <?php //Load the batch processing form. ?> <?php if ($this->canCreate && $this->canEdit) : ?> <?php echo JHtml::_( 'bootstrap.renderModal', 'collapseModal', array( 'title' => JText::_('COM_COMPONENTBUILDER_TEMPLATES_BATCH_OPTIONS'), 'footer' => $this->loadTemplate('batch_footer') ), $this->loadTemplate('batch_body') ); ?> <?php endif; ?> <input type="hidden" name="filter_order" value="<?php echo $this->listOrder; ?>" /> <input type="hidden" name="filter_order_Dir" value="<?php echo $this->listDirn; ?>" /> <input type="hidden" name="boxchecked" value="0" /> </div> <?php endif; ?> <input type="hidden" name="task" value="" /> <?php echo JHtml::_('form.token'); ?> </form> <script type="text/javascript"> // templates footer script jQuery.fn.selText = function() { var obj = this[0]; if (jQuery.browser.msie) { var range = obj.offsetParent.createTextRange(); range.moveToElementText(obj); range.select(); } else if (jQuery.browser.mozilla || $.browser.opera) { var selection = obj.ownerDocument.defaultView.getSelection(); var range = obj.ownerDocument.createRange(); range.selectNodeContents(obj); selection.removeAllRanges(); selection.addRange(range); } else if (jQuery.browser.safari) { var selection = obj.ownerDocument.defaultView.getSelection(); selection.setBaseAndExtent(obj, 0, obj, 1); } return this; } // make sure the code bocks are active jQuery("code").click(function() { jQuery(this).selText().addClass("selected"); }); </script>
{ "pile_set_name": "Github" }
sta<caret>te $var =123;
{ "pile_set_name": "Github" }
/* * FltLib related functions tests * * Copyright 2016 Ged Murphy (ged.murphy@reactos.org) * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU General Public Licence 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 * 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 */ #include <apitest.h> #include <stdio.h> #include <assert.h> #include <winuser.h> #include <winreg.h> #include <winsvc.h> // // Tests for: // FilterAttach // FilterAttachAtAltitude // FilterDetach // static void test_FIXME(void) { } START_TEST(instance) { test_FIXME(); }
{ "pile_set_name": "Github" }
<?php /* * 2007-2016 PrestaShop * * NOTICE OF LICENSE * * This source file is subject to the Academic Free License (AFL 3.0) * that is bundled with this package in the file LICENSE.txt. * It is also available through the world-wide-web at this URL: * http://opensource.org/licenses/afl-3.0.php * If you did not receive a copy of the license and are unable to * obtain it through the world-wide-web, please send an email * to license@prestashop.com so we can send you a copy immediately. * * DISCLAIMER * * Do not edit or add to this file if you wish to upgrade PrestaShop to newer * versions in the future. If you wish to customize PrestaShop for your * needs please refer to http://www.prestashop.com for more information. * * @author PrestaShop SA <contact@prestashop.com> * @copyright 2007-2016 PrestaShop SA * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) * International Registered Trademark & Property of PrestaShop SA */ header('Expires: Mon, 26 Jul 1997 05:00:00 GMT'); header('Last-Modified: '.gmdate('D, d M Y H:i:s').' GMT'); header('Cache-Control: no-store, no-cache, must-revalidate'); header('Cache-Control: post-check=0, pre-check=0', false); header('Pragma: no-cache'); header('Location: ../'); exit;
{ "pile_set_name": "Github" }
# $NetBSD: Makefile,v 1.16 2020/09/13 16:04:28 taca Exp $ DISTNAME= posix-spawn-0.3.15 CATEGORIES= devel MAINTAINER= pkgsrc-users@NetBSD.org HOMEPAGE= https://github.com/rtomayko/posix-spawn/ COMMENT= Ruby wrapper for the posix_spawn() system call LICENSE= mit RUBYGEM_OPTIONS+= --format-executable .include "../../lang/ruby/gem.mk" .include "../../mk/bsd.pkg.mk"
{ "pile_set_name": "Github" }
// // basic_datagram_socket.hpp // ~~~~~~~~~~~~~~~~~~~~~~~~~ // // Copyright (c) 2003-2018 Christopher M. Kohlhoff (chris at kohlhoff dot com) // // Distributed under the Boost Software License, Version 1.0. (See accompanying // file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) // #ifndef BOOST_ASIO_BASIC_DATAGRAM_SOCKET_HPP #define BOOST_ASIO_BASIC_DATAGRAM_SOCKET_HPP #if defined(_MSC_VER) && (_MSC_VER >= 1200) # pragma once #endif // defined(_MSC_VER) && (_MSC_VER >= 1200) #include <boost/asio/detail/config.hpp> #include <cstddef> #include <boost/asio/basic_socket.hpp> #include <boost/asio/detail/handler_type_requirements.hpp> #include <boost/asio/detail/throw_error.hpp> #include <boost/asio/detail/type_traits.hpp> #include <boost/asio/error.hpp> #if defined(BOOST_ASIO_ENABLE_OLD_SERVICES) # include <boost/asio/datagram_socket_service.hpp> #endif // defined(BOOST_ASIO_ENABLE_OLD_SERVICES) #include <boost/asio/detail/push_options.hpp> namespace boost { namespace asio { /// Provides datagram-oriented socket functionality. /** * The basic_datagram_socket class template provides asynchronous and blocking * datagram-oriented socket functionality. * * @par Thread Safety * @e Distinct @e objects: Safe.@n * @e Shared @e objects: Unsafe. */ template <typename Protocol BOOST_ASIO_SVC_TPARAM_DEF1(= datagram_socket_service<Protocol>)> class basic_datagram_socket : public basic_socket<Protocol BOOST_ASIO_SVC_TARG> { public: /// The native representation of a socket. #if defined(GENERATING_DOCUMENTATION) typedef implementation_defined native_handle_type; #else typedef typename basic_socket< Protocol BOOST_ASIO_SVC_TARG>::native_handle_type native_handle_type; #endif /// The protocol type. typedef Protocol protocol_type; /// The endpoint type. typedef typename Protocol::endpoint endpoint_type; /// Construct a basic_datagram_socket without opening it. /** * This constructor creates a datagram socket without opening it. The open() * function must be called before data can be sent or received on the socket. * * @param io_context The io_context object that the datagram socket will use * to dispatch handlers for any asynchronous operations performed on the * socket. */ explicit basic_datagram_socket(boost::asio::io_context& io_context) : basic_socket<Protocol BOOST_ASIO_SVC_TARG>(io_context) { } /// Construct and open a basic_datagram_socket. /** * This constructor creates and opens a datagram socket. * * @param io_context The io_context object that the datagram socket will use * to dispatch handlers for any asynchronous operations performed on the * socket. * * @param protocol An object specifying protocol parameters to be used. * * @throws boost::system::system_error Thrown on failure. */ basic_datagram_socket(boost::asio::io_context& io_context, const protocol_type& protocol) : basic_socket<Protocol BOOST_ASIO_SVC_TARG>(io_context, protocol) { } /// Construct a basic_datagram_socket, opening it and binding it to the given /// local endpoint. /** * This constructor creates a datagram socket and automatically opens it bound * to the specified endpoint on the local machine. The protocol used is the * protocol associated with the given endpoint. * * @param io_context The io_context object that the datagram socket will use * to dispatch handlers for any asynchronous operations performed on the * socket. * * @param endpoint An endpoint on the local machine to which the datagram * socket will be bound. * * @throws boost::system::system_error Thrown on failure. */ basic_datagram_socket(boost::asio::io_context& io_context, const endpoint_type& endpoint) : basic_socket<Protocol BOOST_ASIO_SVC_TARG>(io_context, endpoint) { } /// Construct a basic_datagram_socket on an existing native socket. /** * This constructor creates a datagram socket object to hold an existing * native socket. * * @param io_context The io_context object that the datagram socket will use * to dispatch handlers for any asynchronous operations performed on the * socket. * * @param protocol An object specifying protocol parameters to be used. * * @param native_socket The new underlying socket implementation. * * @throws boost::system::system_error Thrown on failure. */ basic_datagram_socket(boost::asio::io_context& io_context, const protocol_type& protocol, const native_handle_type& native_socket) : basic_socket<Protocol BOOST_ASIO_SVC_TARG>( io_context, protocol, native_socket) { } #if defined(BOOST_ASIO_HAS_MOVE) || defined(GENERATING_DOCUMENTATION) /// Move-construct a basic_datagram_socket from another. /** * This constructor moves a datagram socket from one object to another. * * @param other The other basic_datagram_socket object from which the move * will occur. * * @note Following the move, the moved-from object is in the same state as if * constructed using the @c basic_datagram_socket(io_context&) constructor. */ basic_datagram_socket(basic_datagram_socket&& other) : basic_socket<Protocol BOOST_ASIO_SVC_TARG>(std::move(other)) { } /// Move-assign a basic_datagram_socket from another. /** * This assignment operator moves a datagram socket from one object to * another. * * @param other The other basic_datagram_socket object from which the move * will occur. * * @note Following the move, the moved-from object is in the same state as if * constructed using the @c basic_datagram_socket(io_context&) constructor. */ basic_datagram_socket& operator=(basic_datagram_socket&& other) { basic_socket<Protocol BOOST_ASIO_SVC_TARG>::operator=(std::move(other)); return *this; } /// Move-construct a basic_datagram_socket from a socket of another protocol /// type. /** * This constructor moves a datagram socket from one object to another. * * @param other The other basic_datagram_socket object from which the move * will occur. * * @note Following the move, the moved-from object is in the same state as if * constructed using the @c basic_datagram_socket(io_context&) constructor. */ template <typename Protocol1 BOOST_ASIO_SVC_TPARAM1> basic_datagram_socket( basic_datagram_socket<Protocol1 BOOST_ASIO_SVC_TARG1>&& other, typename enable_if<is_convertible<Protocol1, Protocol>::value>::type* = 0) : basic_socket<Protocol BOOST_ASIO_SVC_TARG>(std::move(other)) { } /// Move-assign a basic_datagram_socket from a socket of another protocol /// type. /** * This assignment operator moves a datagram socket from one object to * another. * * @param other The other basic_datagram_socket object from which the move * will occur. * * @note Following the move, the moved-from object is in the same state as if * constructed using the @c basic_datagram_socket(io_context&) constructor. */ template <typename Protocol1 BOOST_ASIO_SVC_TPARAM1> typename enable_if<is_convertible<Protocol1, Protocol>::value, basic_datagram_socket>::type& operator=( basic_datagram_socket<Protocol1 BOOST_ASIO_SVC_TARG1>&& other) { basic_socket<Protocol BOOST_ASIO_SVC_TARG>::operator=(std::move(other)); return *this; } #endif // defined(BOOST_ASIO_HAS_MOVE) || defined(GENERATING_DOCUMENTATION) /// Destroys the socket. /** * This function destroys the socket, cancelling any outstanding asynchronous * operations associated with the socket as if by calling @c cancel. */ ~basic_datagram_socket() { } /// Send some data on a connected socket. /** * This function is used to send data on the datagram socket. The function * call will block until the data has been sent successfully or an error * occurs. * * @param buffers One ore more data buffers to be sent on the socket. * * @returns The number of bytes sent. * * @throws boost::system::system_error Thrown on failure. * * @note The send operation can only be used with a connected socket. Use * the send_to function to send data on an unconnected datagram socket. * * @par Example * To send a single data buffer use the @ref buffer function as follows: * @code socket.send(boost::asio::buffer(data, size)); @endcode * See the @ref buffer documentation for information on sending multiple * buffers in one go, and how to use it with arrays, boost::array or * std::vector. */ template <typename ConstBufferSequence> std::size_t send(const ConstBufferSequence& buffers) { boost::system::error_code ec; std::size_t s = this->get_service().send( this->get_implementation(), buffers, 0, ec); boost::asio::detail::throw_error(ec, "send"); return s; } /// Send some data on a connected socket. /** * This function is used to send data on the datagram socket. The function * call will block until the data has been sent successfully or an error * occurs. * * @param buffers One ore more data buffers to be sent on the socket. * * @param flags Flags specifying how the send call is to be made. * * @returns The number of bytes sent. * * @throws boost::system::system_error Thrown on failure. * * @note The send operation can only be used with a connected socket. Use * the send_to function to send data on an unconnected datagram socket. */ template <typename ConstBufferSequence> std::size_t send(const ConstBufferSequence& buffers, socket_base::message_flags flags) { boost::system::error_code ec; std::size_t s = this->get_service().send( this->get_implementation(), buffers, flags, ec); boost::asio::detail::throw_error(ec, "send"); return s; } /// Send some data on a connected socket. /** * This function is used to send data on the datagram socket. The function * call will block until the data has been sent successfully or an error * occurs. * * @param buffers One or more data buffers to be sent on the socket. * * @param flags Flags specifying how the send call is to be made. * * @param ec Set to indicate what error occurred, if any. * * @returns The number of bytes sent. * * @note The send operation can only be used with a connected socket. Use * the send_to function to send data on an unconnected datagram socket. */ template <typename ConstBufferSequence> std::size_t send(const ConstBufferSequence& buffers, socket_base::message_flags flags, boost::system::error_code& ec) { return this->get_service().send( this->get_implementation(), buffers, flags, ec); } /// Start an asynchronous send on a connected socket. /** * This function is used to asynchronously send data on the datagram socket. * The function call always returns immediately. * * @param buffers One or more data buffers to be sent on the socket. Although * the buffers object may be copied as necessary, ownership of the underlying * memory blocks is retained by the caller, which must guarantee that they * remain valid until the handler is called. * * @param handler The handler to be called when the send operation completes. * Copies will be made of the handler as required. The function signature of * the handler must be: * @code void handler( * const boost::system::error_code& error, // Result of operation. * std::size_t bytes_transferred // Number of bytes sent. * ); @endcode * Regardless of whether the asynchronous operation completes immediately or * not, the handler will not be invoked from within this function. Invocation * of the handler will be performed in a manner equivalent to using * boost::asio::io_context::post(). * * @note The async_send operation can only be used with a connected socket. * Use the async_send_to function to send data on an unconnected datagram * socket. * * @par Example * To send a single data buffer use the @ref buffer function as follows: * @code * socket.async_send(boost::asio::buffer(data, size), handler); * @endcode * See the @ref buffer documentation for information on sending multiple * buffers in one go, and how to use it with arrays, boost::array or * std::vector. */ template <typename ConstBufferSequence, typename WriteHandler> BOOST_ASIO_INITFN_RESULT_TYPE(WriteHandler, void (boost::system::error_code, std::size_t)) async_send(const ConstBufferSequence& buffers, BOOST_ASIO_MOVE_ARG(WriteHandler) handler) { // If you get an error on the following line it means that your handler does // not meet the documented type requirements for a WriteHandler. BOOST_ASIO_WRITE_HANDLER_CHECK(WriteHandler, handler) type_check; #if defined(BOOST_ASIO_ENABLE_OLD_SERVICES) return this->get_service().async_send(this->get_implementation(), buffers, 0, BOOST_ASIO_MOVE_CAST(WriteHandler)(handler)); #else // defined(BOOST_ASIO_ENABLE_OLD_SERVICES) async_completion<WriteHandler, void (boost::system::error_code, std::size_t)> init(handler); this->get_service().async_send(this->get_implementation(), buffers, 0, init.completion_handler); return init.result.get(); #endif // defined(BOOST_ASIO_ENABLE_OLD_SERVICES) } /// Start an asynchronous send on a connected socket. /** * This function is used to asynchronously send data on the datagram socket. * The function call always returns immediately. * * @param buffers One or more data buffers to be sent on the socket. Although * the buffers object may be copied as necessary, ownership of the underlying * memory blocks is retained by the caller, which must guarantee that they * remain valid until the handler is called. * * @param flags Flags specifying how the send call is to be made. * * @param handler The handler to be called when the send operation completes. * Copies will be made of the handler as required. The function signature of * the handler must be: * @code void handler( * const boost::system::error_code& error, // Result of operation. * std::size_t bytes_transferred // Number of bytes sent. * ); @endcode * Regardless of whether the asynchronous operation completes immediately or * not, the handler will not be invoked from within this function. Invocation * of the handler will be performed in a manner equivalent to using * boost::asio::io_context::post(). * * @note The async_send operation can only be used with a connected socket. * Use the async_send_to function to send data on an unconnected datagram * socket. */ template <typename ConstBufferSequence, typename WriteHandler> BOOST_ASIO_INITFN_RESULT_TYPE(WriteHandler, void (boost::system::error_code, std::size_t)) async_send(const ConstBufferSequence& buffers, socket_base::message_flags flags, BOOST_ASIO_MOVE_ARG(WriteHandler) handler) { // If you get an error on the following line it means that your handler does // not meet the documented type requirements for a WriteHandler. BOOST_ASIO_WRITE_HANDLER_CHECK(WriteHandler, handler) type_check; #if defined(BOOST_ASIO_ENABLE_OLD_SERVICES) return this->get_service().async_send(this->get_implementation(), buffers, flags, BOOST_ASIO_MOVE_CAST(WriteHandler)(handler)); #else // defined(BOOST_ASIO_ENABLE_OLD_SERVICES) async_completion<WriteHandler, void (boost::system::error_code, std::size_t)> init(handler); this->get_service().async_send(this->get_implementation(), buffers, flags, init.completion_handler); return init.result.get(); #endif // defined(BOOST_ASIO_ENABLE_OLD_SERVICES) } /// Send a datagram to the specified endpoint. /** * This function is used to send a datagram to the specified remote endpoint. * The function call will block until the data has been sent successfully or * an error occurs. * * @param buffers One or more data buffers to be sent to the remote endpoint. * * @param destination The remote endpoint to which the data will be sent. * * @returns The number of bytes sent. * * @throws boost::system::system_error Thrown on failure. * * @par Example * To send a single data buffer use the @ref buffer function as follows: * @code * boost::asio::ip::udp::endpoint destination( * boost::asio::ip::address::from_string("1.2.3.4"), 12345); * socket.send_to(boost::asio::buffer(data, size), destination); * @endcode * See the @ref buffer documentation for information on sending multiple * buffers in one go, and how to use it with arrays, boost::array or * std::vector. */ template <typename ConstBufferSequence> std::size_t send_to(const ConstBufferSequence& buffers, const endpoint_type& destination) { boost::system::error_code ec; std::size_t s = this->get_service().send_to( this->get_implementation(), buffers, destination, 0, ec); boost::asio::detail::throw_error(ec, "send_to"); return s; } /// Send a datagram to the specified endpoint. /** * This function is used to send a datagram to the specified remote endpoint. * The function call will block until the data has been sent successfully or * an error occurs. * * @param buffers One or more data buffers to be sent to the remote endpoint. * * @param destination The remote endpoint to which the data will be sent. * * @param flags Flags specifying how the send call is to be made. * * @returns The number of bytes sent. * * @throws boost::system::system_error Thrown on failure. */ template <typename ConstBufferSequence> std::size_t send_to(const ConstBufferSequence& buffers, const endpoint_type& destination, socket_base::message_flags flags) { boost::system::error_code ec; std::size_t s = this->get_service().send_to( this->get_implementation(), buffers, destination, flags, ec); boost::asio::detail::throw_error(ec, "send_to"); return s; } /// Send a datagram to the specified endpoint. /** * This function is used to send a datagram to the specified remote endpoint. * The function call will block until the data has been sent successfully or * an error occurs. * * @param buffers One or more data buffers to be sent to the remote endpoint. * * @param destination The remote endpoint to which the data will be sent. * * @param flags Flags specifying how the send call is to be made. * * @param ec Set to indicate what error occurred, if any. * * @returns The number of bytes sent. */ template <typename ConstBufferSequence> std::size_t send_to(const ConstBufferSequence& buffers, const endpoint_type& destination, socket_base::message_flags flags, boost::system::error_code& ec) { return this->get_service().send_to(this->get_implementation(), buffers, destination, flags, ec); } /// Start an asynchronous send. /** * This function is used to asynchronously send a datagram to the specified * remote endpoint. The function call always returns immediately. * * @param buffers One or more data buffers to be sent to the remote endpoint. * Although the buffers object may be copied as necessary, ownership of the * underlying memory blocks is retained by the caller, which must guarantee * that they remain valid until the handler is called. * * @param destination The remote endpoint to which the data will be sent. * Copies will be made of the endpoint as required. * * @param handler The handler to be called when the send operation completes. * Copies will be made of the handler as required. The function signature of * the handler must be: * @code void handler( * const boost::system::error_code& error, // Result of operation. * std::size_t bytes_transferred // Number of bytes sent. * ); @endcode * Regardless of whether the asynchronous operation completes immediately or * not, the handler will not be invoked from within this function. Invocation * of the handler will be performed in a manner equivalent to using * boost::asio::io_context::post(). * * @par Example * To send a single data buffer use the @ref buffer function as follows: * @code * boost::asio::ip::udp::endpoint destination( * boost::asio::ip::address::from_string("1.2.3.4"), 12345); * socket.async_send_to( * boost::asio::buffer(data, size), destination, handler); * @endcode * See the @ref buffer documentation for information on sending multiple * buffers in one go, and how to use it with arrays, boost::array or * std::vector. */ template <typename ConstBufferSequence, typename WriteHandler> BOOST_ASIO_INITFN_RESULT_TYPE(WriteHandler, void (boost::system::error_code, std::size_t)) async_send_to(const ConstBufferSequence& buffers, const endpoint_type& destination, BOOST_ASIO_MOVE_ARG(WriteHandler) handler) { // If you get an error on the following line it means that your handler does // not meet the documented type requirements for a WriteHandler. BOOST_ASIO_WRITE_HANDLER_CHECK(WriteHandler, handler) type_check; #if defined(BOOST_ASIO_ENABLE_OLD_SERVICES) return this->get_service().async_send_to( this->get_implementation(), buffers, destination, 0, BOOST_ASIO_MOVE_CAST(WriteHandler)(handler)); #else // defined(BOOST_ASIO_ENABLE_OLD_SERVICES) async_completion<WriteHandler, void (boost::system::error_code, std::size_t)> init(handler); this->get_service().async_send_to( this->get_implementation(), buffers, destination, 0, init.completion_handler); return init.result.get(); #endif // defined(BOOST_ASIO_ENABLE_OLD_SERVICES) } /// Start an asynchronous send. /** * This function is used to asynchronously send a datagram to the specified * remote endpoint. The function call always returns immediately. * * @param buffers One or more data buffers to be sent to the remote endpoint. * Although the buffers object may be copied as necessary, ownership of the * underlying memory blocks is retained by the caller, which must guarantee * that they remain valid until the handler is called. * * @param flags Flags specifying how the send call is to be made. * * @param destination The remote endpoint to which the data will be sent. * Copies will be made of the endpoint as required. * * @param handler The handler to be called when the send operation completes. * Copies will be made of the handler as required. The function signature of * the handler must be: * @code void handler( * const boost::system::error_code& error, // Result of operation. * std::size_t bytes_transferred // Number of bytes sent. * ); @endcode * Regardless of whether the asynchronous operation completes immediately or * not, the handler will not be invoked from within this function. Invocation * of the handler will be performed in a manner equivalent to using * boost::asio::io_context::post(). */ template <typename ConstBufferSequence, typename WriteHandler> BOOST_ASIO_INITFN_RESULT_TYPE(WriteHandler, void (boost::system::error_code, std::size_t)) async_send_to(const ConstBufferSequence& buffers, const endpoint_type& destination, socket_base::message_flags flags, BOOST_ASIO_MOVE_ARG(WriteHandler) handler) { // If you get an error on the following line it means that your handler does // not meet the documented type requirements for a WriteHandler. BOOST_ASIO_WRITE_HANDLER_CHECK(WriteHandler, handler) type_check; #if defined(BOOST_ASIO_ENABLE_OLD_SERVICES) return this->get_service().async_send_to( this->get_implementation(), buffers, destination, flags, BOOST_ASIO_MOVE_CAST(WriteHandler)(handler)); #else // defined(BOOST_ASIO_ENABLE_OLD_SERVICES) async_completion<WriteHandler, void (boost::system::error_code, std::size_t)> init(handler); this->get_service().async_send_to( this->get_implementation(), buffers, destination, flags, init.completion_handler); return init.result.get(); #endif // defined(BOOST_ASIO_ENABLE_OLD_SERVICES) } /// Receive some data on a connected socket. /** * This function is used to receive data on the datagram socket. The function * call will block until data has been received successfully or an error * occurs. * * @param buffers One or more buffers into which the data will be received. * * @returns The number of bytes received. * * @throws boost::system::system_error Thrown on failure. * * @note The receive operation can only be used with a connected socket. Use * the receive_from function to receive data on an unconnected datagram * socket. * * @par Example * To receive into a single data buffer use the @ref buffer function as * follows: * @code socket.receive(boost::asio::buffer(data, size)); @endcode * See the @ref buffer documentation for information on receiving into * multiple buffers in one go, and how to use it with arrays, boost::array or * std::vector. */ template <typename MutableBufferSequence> std::size_t receive(const MutableBufferSequence& buffers) { boost::system::error_code ec; std::size_t s = this->get_service().receive( this->get_implementation(), buffers, 0, ec); boost::asio::detail::throw_error(ec, "receive"); return s; } /// Receive some data on a connected socket. /** * This function is used to receive data on the datagram socket. The function * call will block until data has been received successfully or an error * occurs. * * @param buffers One or more buffers into which the data will be received. * * @param flags Flags specifying how the receive call is to be made. * * @returns The number of bytes received. * * @throws boost::system::system_error Thrown on failure. * * @note The receive operation can only be used with a connected socket. Use * the receive_from function to receive data on an unconnected datagram * socket. */ template <typename MutableBufferSequence> std::size_t receive(const MutableBufferSequence& buffers, socket_base::message_flags flags) { boost::system::error_code ec; std::size_t s = this->get_service().receive( this->get_implementation(), buffers, flags, ec); boost::asio::detail::throw_error(ec, "receive"); return s; } /// Receive some data on a connected socket. /** * This function is used to receive data on the datagram socket. The function * call will block until data has been received successfully or an error * occurs. * * @param buffers One or more buffers into which the data will be received. * * @param flags Flags specifying how the receive call is to be made. * * @param ec Set to indicate what error occurred, if any. * * @returns The number of bytes received. * * @note The receive operation can only be used with a connected socket. Use * the receive_from function to receive data on an unconnected datagram * socket. */ template <typename MutableBufferSequence> std::size_t receive(const MutableBufferSequence& buffers, socket_base::message_flags flags, boost::system::error_code& ec) { return this->get_service().receive( this->get_implementation(), buffers, flags, ec); } /// Start an asynchronous receive on a connected socket. /** * This function is used to asynchronously receive data from the datagram * socket. The function call always returns immediately. * * @param buffers One or more buffers into which the data will be received. * Although the buffers object may be copied as necessary, ownership of the * underlying memory blocks is retained by the caller, which must guarantee * that they remain valid until the handler is called. * * @param handler The handler to be called when the receive operation * completes. Copies will be made of the handler as required. The function * signature of the handler must be: * @code void handler( * const boost::system::error_code& error, // Result of operation. * std::size_t bytes_transferred // Number of bytes received. * ); @endcode * Regardless of whether the asynchronous operation completes immediately or * not, the handler will not be invoked from within this function. Invocation * of the handler will be performed in a manner equivalent to using * boost::asio::io_context::post(). * * @note The async_receive operation can only be used with a connected socket. * Use the async_receive_from function to receive data on an unconnected * datagram socket. * * @par Example * To receive into a single data buffer use the @ref buffer function as * follows: * @code * socket.async_receive(boost::asio::buffer(data, size), handler); * @endcode * See the @ref buffer documentation for information on receiving into * multiple buffers in one go, and how to use it with arrays, boost::array or * std::vector. */ template <typename MutableBufferSequence, typename ReadHandler> BOOST_ASIO_INITFN_RESULT_TYPE(ReadHandler, void (boost::system::error_code, std::size_t)) async_receive(const MutableBufferSequence& buffers, BOOST_ASIO_MOVE_ARG(ReadHandler) handler) { // If you get an error on the following line it means that your handler does // not meet the documented type requirements for a ReadHandler. BOOST_ASIO_READ_HANDLER_CHECK(ReadHandler, handler) type_check; #if defined(BOOST_ASIO_ENABLE_OLD_SERVICES) return this->get_service().async_receive(this->get_implementation(), buffers, 0, BOOST_ASIO_MOVE_CAST(ReadHandler)(handler)); #else // defined(BOOST_ASIO_ENABLE_OLD_SERVICES) async_completion<ReadHandler, void (boost::system::error_code, std::size_t)> init(handler); this->get_service().async_receive(this->get_implementation(), buffers, 0, init.completion_handler); return init.result.get(); #endif // defined(BOOST_ASIO_ENABLE_OLD_SERVICES) } /// Start an asynchronous receive on a connected socket. /** * This function is used to asynchronously receive data from the datagram * socket. The function call always returns immediately. * * @param buffers One or more buffers into which the data will be received. * Although the buffers object may be copied as necessary, ownership of the * underlying memory blocks is retained by the caller, which must guarantee * that they remain valid until the handler is called. * * @param flags Flags specifying how the receive call is to be made. * * @param handler The handler to be called when the receive operation * completes. Copies will be made of the handler as required. The function * signature of the handler must be: * @code void handler( * const boost::system::error_code& error, // Result of operation. * std::size_t bytes_transferred // Number of bytes received. * ); @endcode * Regardless of whether the asynchronous operation completes immediately or * not, the handler will not be invoked from within this function. Invocation * of the handler will be performed in a manner equivalent to using * boost::asio::io_context::post(). * * @note The async_receive operation can only be used with a connected socket. * Use the async_receive_from function to receive data on an unconnected * datagram socket. */ template <typename MutableBufferSequence, typename ReadHandler> BOOST_ASIO_INITFN_RESULT_TYPE(ReadHandler, void (boost::system::error_code, std::size_t)) async_receive(const MutableBufferSequence& buffers, socket_base::message_flags flags, BOOST_ASIO_MOVE_ARG(ReadHandler) handler) { // If you get an error on the following line it means that your handler does // not meet the documented type requirements for a ReadHandler. BOOST_ASIO_READ_HANDLER_CHECK(ReadHandler, handler) type_check; #if defined(BOOST_ASIO_ENABLE_OLD_SERVICES) return this->get_service().async_receive(this->get_implementation(), buffers, flags, BOOST_ASIO_MOVE_CAST(ReadHandler)(handler)); #else // defined(BOOST_ASIO_ENABLE_OLD_SERVICES) async_completion<ReadHandler, void (boost::system::error_code, std::size_t)> init(handler); this->get_service().async_receive(this->get_implementation(), buffers, flags, init.completion_handler); return init.result.get(); #endif // defined(BOOST_ASIO_ENABLE_OLD_SERVICES) } /// Receive a datagram with the endpoint of the sender. /** * This function is used to receive a datagram. The function call will block * until data has been received successfully or an error occurs. * * @param buffers One or more buffers into which the data will be received. * * @param sender_endpoint An endpoint object that receives the endpoint of * the remote sender of the datagram. * * @returns The number of bytes received. * * @throws boost::system::system_error Thrown on failure. * * @par Example * To receive into a single data buffer use the @ref buffer function as * follows: * @code * boost::asio::ip::udp::endpoint sender_endpoint; * socket.receive_from( * boost::asio::buffer(data, size), sender_endpoint); * @endcode * See the @ref buffer documentation for information on receiving into * multiple buffers in one go, and how to use it with arrays, boost::array or * std::vector. */ template <typename MutableBufferSequence> std::size_t receive_from(const MutableBufferSequence& buffers, endpoint_type& sender_endpoint) { boost::system::error_code ec; std::size_t s = this->get_service().receive_from( this->get_implementation(), buffers, sender_endpoint, 0, ec); boost::asio::detail::throw_error(ec, "receive_from"); return s; } /// Receive a datagram with the endpoint of the sender. /** * This function is used to receive a datagram. The function call will block * until data has been received successfully or an error occurs. * * @param buffers One or more buffers into which the data will be received. * * @param sender_endpoint An endpoint object that receives the endpoint of * the remote sender of the datagram. * * @param flags Flags specifying how the receive call is to be made. * * @returns The number of bytes received. * * @throws boost::system::system_error Thrown on failure. */ template <typename MutableBufferSequence> std::size_t receive_from(const MutableBufferSequence& buffers, endpoint_type& sender_endpoint, socket_base::message_flags flags) { boost::system::error_code ec; std::size_t s = this->get_service().receive_from( this->get_implementation(), buffers, sender_endpoint, flags, ec); boost::asio::detail::throw_error(ec, "receive_from"); return s; } /// Receive a datagram with the endpoint of the sender. /** * This function is used to receive a datagram. The function call will block * until data has been received successfully or an error occurs. * * @param buffers One or more buffers into which the data will be received. * * @param sender_endpoint An endpoint object that receives the endpoint of * the remote sender of the datagram. * * @param flags Flags specifying how the receive call is to be made. * * @param ec Set to indicate what error occurred, if any. * * @returns The number of bytes received. */ template <typename MutableBufferSequence> std::size_t receive_from(const MutableBufferSequence& buffers, endpoint_type& sender_endpoint, socket_base::message_flags flags, boost::system::error_code& ec) { return this->get_service().receive_from(this->get_implementation(), buffers, sender_endpoint, flags, ec); } /// Start an asynchronous receive. /** * This function is used to asynchronously receive a datagram. The function * call always returns immediately. * * @param buffers One or more buffers into which the data will be received. * Although the buffers object may be copied as necessary, ownership of the * underlying memory blocks is retained by the caller, which must guarantee * that they remain valid until the handler is called. * * @param sender_endpoint An endpoint object that receives the endpoint of * the remote sender of the datagram. Ownership of the sender_endpoint object * is retained by the caller, which must guarantee that it is valid until the * handler is called. * * @param handler The handler to be called when the receive operation * completes. Copies will be made of the handler as required. The function * signature of the handler must be: * @code void handler( * const boost::system::error_code& error, // Result of operation. * std::size_t bytes_transferred // Number of bytes received. * ); @endcode * Regardless of whether the asynchronous operation completes immediately or * not, the handler will not be invoked from within this function. Invocation * of the handler will be performed in a manner equivalent to using * boost::asio::io_context::post(). * * @par Example * To receive into a single data buffer use the @ref buffer function as * follows: * @code socket.async_receive_from( * boost::asio::buffer(data, size), sender_endpoint, handler); @endcode * See the @ref buffer documentation for information on receiving into * multiple buffers in one go, and how to use it with arrays, boost::array or * std::vector. */ template <typename MutableBufferSequence, typename ReadHandler> BOOST_ASIO_INITFN_RESULT_TYPE(ReadHandler, void (boost::system::error_code, std::size_t)) async_receive_from(const MutableBufferSequence& buffers, endpoint_type& sender_endpoint, BOOST_ASIO_MOVE_ARG(ReadHandler) handler) { // If you get an error on the following line it means that your handler does // not meet the documented type requirements for a ReadHandler. BOOST_ASIO_READ_HANDLER_CHECK(ReadHandler, handler) type_check; #if defined(BOOST_ASIO_ENABLE_OLD_SERVICES) return this->get_service().async_receive_from( this->get_implementation(), buffers, sender_endpoint, 0, BOOST_ASIO_MOVE_CAST(ReadHandler)(handler)); #else // defined(BOOST_ASIO_ENABLE_OLD_SERVICES) async_completion<ReadHandler, void (boost::system::error_code, std::size_t)> init(handler); this->get_service().async_receive_from( this->get_implementation(), buffers, sender_endpoint, 0, init.completion_handler); return init.result.get(); #endif // defined(BOOST_ASIO_ENABLE_OLD_SERVICES) } /// Start an asynchronous receive. /** * This function is used to asynchronously receive a datagram. The function * call always returns immediately. * * @param buffers One or more buffers into which the data will be received. * Although the buffers object may be copied as necessary, ownership of the * underlying memory blocks is retained by the caller, which must guarantee * that they remain valid until the handler is called. * * @param sender_endpoint An endpoint object that receives the endpoint of * the remote sender of the datagram. Ownership of the sender_endpoint object * is retained by the caller, which must guarantee that it is valid until the * handler is called. * * @param flags Flags specifying how the receive call is to be made. * * @param handler The handler to be called when the receive operation * completes. Copies will be made of the handler as required. The function * signature of the handler must be: * @code void handler( * const boost::system::error_code& error, // Result of operation. * std::size_t bytes_transferred // Number of bytes received. * ); @endcode * Regardless of whether the asynchronous operation completes immediately or * not, the handler will not be invoked from within this function. Invocation * of the handler will be performed in a manner equivalent to using * boost::asio::io_context::post(). */ template <typename MutableBufferSequence, typename ReadHandler> BOOST_ASIO_INITFN_RESULT_TYPE(ReadHandler, void (boost::system::error_code, std::size_t)) async_receive_from(const MutableBufferSequence& buffers, endpoint_type& sender_endpoint, socket_base::message_flags flags, BOOST_ASIO_MOVE_ARG(ReadHandler) handler) { // If you get an error on the following line it means that your handler does // not meet the documented type requirements for a ReadHandler. BOOST_ASIO_READ_HANDLER_CHECK(ReadHandler, handler) type_check; #if defined(BOOST_ASIO_ENABLE_OLD_SERVICES) return this->get_service().async_receive_from( this->get_implementation(), buffers, sender_endpoint, flags, BOOST_ASIO_MOVE_CAST(ReadHandler)(handler)); #else // defined(BOOST_ASIO_ENABLE_OLD_SERVICES) async_completion<ReadHandler, void (boost::system::error_code, std::size_t)> init(handler); this->get_service().async_receive_from( this->get_implementation(), buffers, sender_endpoint, flags, init.completion_handler); return init.result.get(); #endif // defined(BOOST_ASIO_ENABLE_OLD_SERVICES) } }; } // namespace asio } // namespace boost #include <boost/asio/detail/pop_options.hpp> #endif // BOOST_ASIO_BASIC_DATAGRAM_SOCKET_HPP
{ "pile_set_name": "Github" }
/* * Copyright (c) 2007-present, Stephen Colebourne & Michael Nascimento Santos * * All rights reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions are met: * * * Redistributions of source code must retain the above copyright notice, * this list of conditions and the following disclaimer. * * * Redistributions in binary form must reproduce the above copyright notice, * this list of conditions and the following disclaimer in the documentation * and/or other materials provided with the distribution. * * * Neither the name of JSR-310 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. */ package org.threeten.bp.chrono; import static org.threeten.bp.chrono.MinguoChronology.YEARS_DIFFERENCE; import static org.threeten.bp.temporal.ChronoField.DAY_OF_MONTH; import static org.threeten.bp.temporal.ChronoField.MONTH_OF_YEAR; import static org.threeten.bp.temporal.ChronoField.YEAR; import java.io.DataInput; import java.io.DataOutput; import java.io.IOException; import java.io.Serializable; import org.threeten.bp.Clock; import org.threeten.bp.DateTimeException; import org.threeten.bp.LocalDate; import org.threeten.bp.LocalTime; import org.threeten.bp.Period; import org.threeten.bp.ZoneId; import org.threeten.bp.jdk8.Jdk8Methods; import org.threeten.bp.temporal.ChronoField; import org.threeten.bp.temporal.TemporalAccessor; import org.threeten.bp.temporal.TemporalAdjuster; import org.threeten.bp.temporal.TemporalAmount; import org.threeten.bp.temporal.TemporalField; import org.threeten.bp.temporal.TemporalQuery; import org.threeten.bp.temporal.TemporalUnit; import org.threeten.bp.temporal.UnsupportedTemporalTypeException; import org.threeten.bp.temporal.ValueRange; /** * A date in the Minguo calendar system. * <p> * This date operates using the {@linkplain MinguoChronology Minguo calendar}. * This calendar system is primarily used in the Republic of China, often known as Taiwan. * Dates are aligned such that {@code 0001-01-01 (Minguo)} is {@code 1912-01-01 (ISO)}. * * <h3>Specification for implementors</h3> * This class is immutable and thread-safe. */ public final class MinguoDate extends ChronoDateImpl<MinguoDate> implements Serializable { /** * Serialization version. */ private static final long serialVersionUID = 1300372329181994526L; /** * The underlying date. */ private final LocalDate isoDate; //----------------------------------------------------------------------- /** * Obtains the current {@code MinguoDate} from the system clock in the default time-zone. * <p> * This will query the {@link Clock#systemDefaultZone() system clock} in the default * time-zone to obtain the current date. * <p> * Using this method will prevent the ability to use an alternate clock for testing * because the clock is hard-coded. * * @return the current date using the system clock and default time-zone, not null */ public static MinguoDate now() { return now(Clock.systemDefaultZone()); } /** * Obtains the current {@code MinguoDate} from the system clock in the specified time-zone. * <p> * This will query the {@link Clock#system(ZoneId) system clock} to obtain the current date. * Specifying the time-zone avoids dependence on the default time-zone. * <p> * Using this method will prevent the ability to use an alternate clock for testing * because the clock is hard-coded. * * @param zone the zone ID to use, not null * @return the current date using the system clock, not null */ public static MinguoDate now(ZoneId zone) { return now(Clock.system(zone)); } /** * Obtains the current {@code MinguoDate} from the specified clock. * <p> * This will query the specified clock to obtain the current date - today. * Using this method allows the use of an alternate clock for testing. * The alternate clock may be introduced using {@linkplain Clock dependency injection}. * * @param clock the clock to use, not null * @return the current date, not null * @throws DateTimeException if the current date cannot be obtained */ public static MinguoDate now(Clock clock) { return new MinguoDate(LocalDate.now(clock)); } /** * Obtains a {@code MinguoDate} representing a date in the Minguo calendar * system from the proleptic-year, month-of-year and day-of-month fields. * <p> * This returns a {@code MinguoDate} with the specified fields. * The day must be valid for the year and month, otherwise an exception will be thrown. * * @param prolepticYear the Minguo proleptic-year * @param month the Minguo month-of-year, from 1 to 12 * @param dayOfMonth the Minguo day-of-month, from 1 to 31 * @return the date in Minguo calendar system, not null * @throws DateTimeException if the value of any field is out of range, * or if the day-of-month is invalid for the month-year */ public static MinguoDate of(int prolepticYear, int month, int dayOfMonth) { return MinguoChronology.INSTANCE.date(prolepticYear, month, dayOfMonth); } /** * Obtains a {@code MinguoDate} from a temporal object. * <p> * This obtains a date in the Minguo calendar system based on the specified temporal. * A {@code TemporalAccessor} represents an arbitrary set of date and time information, * which this factory converts to an instance of {@code MinguoDate}. * <p> * The conversion typically uses the {@link ChronoField#EPOCH_DAY EPOCH_DAY} * field, which is standardized across calendar systems. * <p> * This method matches the signature of the functional interface {@link TemporalQuery} * allowing it to be used as a query via method reference, {@code MinguoDate::from}. * * @param temporal the temporal object to convert, not null * @return the date in Minguo calendar system, not null * @throws DateTimeException if unable to convert to a {@code MinguoDate} */ public static MinguoDate from(TemporalAccessor temporal) { return MinguoChronology.INSTANCE.date(temporal); } //----------------------------------------------------------------------- /** * Creates an instance from an ISO date. * * @param isoDate the standard local date, validated not null */ MinguoDate(LocalDate date) { Jdk8Methods.requireNonNull(date, "date"); this.isoDate = date; } //----------------------------------------------------------------------- @Override public MinguoChronology getChronology() { return MinguoChronology.INSTANCE; } @Override public MinguoEra getEra() { return (MinguoEra) super.getEra(); } @Override public int lengthOfMonth() { return isoDate.lengthOfMonth(); } @Override public ValueRange range(TemporalField field) { if (field instanceof ChronoField) { if (isSupported(field)) { ChronoField f = (ChronoField) field; switch (f) { case DAY_OF_MONTH: case DAY_OF_YEAR: case ALIGNED_WEEK_OF_MONTH: return isoDate.range(field); case YEAR_OF_ERA: { ValueRange range = YEAR.range(); long max = (getProlepticYear() <= 0 ? -range.getMinimum() + 1 + YEARS_DIFFERENCE : range.getMaximum() - YEARS_DIFFERENCE); return ValueRange.of(1, max); } } return getChronology().range(f); } throw new UnsupportedTemporalTypeException("Unsupported field: " + field); } return field.rangeRefinedBy(this); } @Override public long getLong(TemporalField field) { if (field instanceof ChronoField) { switch ((ChronoField) field) { case PROLEPTIC_MONTH: return getProlepticMonth(); case YEAR_OF_ERA: { int prolepticYear = getProlepticYear(); return (prolepticYear >= 1 ? prolepticYear : 1 - prolepticYear); } case YEAR: return getProlepticYear(); case ERA: return (getProlepticYear() >= 1 ? 1 : 0); } return isoDate.getLong(field); } return field.getFrom(this); } private long getProlepticMonth() { return getProlepticYear() * 12L + isoDate.getMonthValue() - 1; } private int getProlepticYear() { return isoDate.getYear() - YEARS_DIFFERENCE; } //----------------------------------------------------------------------- @Override public MinguoDate with(TemporalAdjuster adjuster) { return (MinguoDate) super.with(adjuster); } @Override public MinguoDate with(TemporalField field, long newValue) { if (field instanceof ChronoField) { ChronoField f = (ChronoField) field; if (getLong(f) == newValue) { return this; } switch (f) { case PROLEPTIC_MONTH: getChronology().range(f).checkValidValue(newValue, f); return plusMonths(newValue - getProlepticMonth()); case YEAR_OF_ERA: case YEAR: case ERA: { int nvalue = getChronology().range(f).checkValidIntValue(newValue, f); switch (f) { case YEAR_OF_ERA: return with(isoDate.withYear(getProlepticYear() >= 1 ? nvalue + YEARS_DIFFERENCE : (1 - nvalue) + YEARS_DIFFERENCE)); case YEAR: return with(isoDate.withYear(nvalue + YEARS_DIFFERENCE)); case ERA: return with(isoDate.withYear((1 - getProlepticYear()) + YEARS_DIFFERENCE)); } } } return with(isoDate.with(field, newValue)); } return field.adjustInto(this, newValue); } @Override public MinguoDate plus(TemporalAmount amount) { return (MinguoDate) super.plus(amount); } @Override public MinguoDate plus(long amountToAdd, TemporalUnit unit) { return (MinguoDate) super.plus(amountToAdd, unit); } @Override public MinguoDate minus(TemporalAmount amount) { return (MinguoDate) super.minus(amount); } @Override public MinguoDate minus(long amountToAdd, TemporalUnit unit) { return (MinguoDate) super.minus(amountToAdd, unit); } //----------------------------------------------------------------------- @Override MinguoDate plusYears(long years) { return with(isoDate.plusYears(years)); } @Override MinguoDate plusMonths(long months) { return with(isoDate.plusMonths(months)); } @Override MinguoDate plusDays(long days) { return with(isoDate.plusDays(days)); } private MinguoDate with(LocalDate newDate) { return (newDate.equals(isoDate) ? this : new MinguoDate(newDate)); } @Override @SuppressWarnings("unchecked") public final ChronoLocalDateTime<MinguoDate> atTime(LocalTime localTime) { return (ChronoLocalDateTime<MinguoDate>) super.atTime(localTime); } @Override public ChronoPeriod until(ChronoLocalDate endDate) { Period period = isoDate.until(endDate); return getChronology().period(period.getYears(), period.getMonths(), period.getDays()); } @Override // override for performance public long toEpochDay() { return isoDate.toEpochDay(); } //------------------------------------------------------------------------- @Override // override for performance public boolean equals(Object obj) { if (this == obj) { return true; } if (obj instanceof MinguoDate) { MinguoDate otherDate = (MinguoDate) obj; return this.isoDate.equals(otherDate.isoDate); } return false; } @Override // override for performance public int hashCode() { return getChronology().getId().hashCode() ^ isoDate.hashCode(); } //----------------------------------------------------------------------- private Object writeReplace() { return new Ser(Ser.MINGUO_DATE_TYPE, this); } void writeExternal(DataOutput out) throws IOException { // MinguoChrono is implicit in the MINGUO_DATE_TYPE out.writeInt(get(YEAR)); out.writeByte(get(MONTH_OF_YEAR)); out.writeByte(get(DAY_OF_MONTH)); } static ChronoLocalDate readExternal(DataInput in) throws IOException { int year = in.readInt(); int month = in.readByte(); int dayOfMonth = in.readByte(); return MinguoChronology.INSTANCE.date(year, month, dayOfMonth); } }
{ "pile_set_name": "Github" }
#lang ivy1.6 include order module sequence_numbers = { type t instance iter : order_iterator_impl(this) action next(seq:t) returns (res:t) interpret t->bv[8] implement next { res := seq + 1 } }
{ "pile_set_name": "Github" }
Files: tests/test-nonblocking-pipe.sh tests/test-nonblocking-pipe-main.c tests/test-nonblocking-pipe-child.c tests/test-nonblocking-pipe.h tests/test-nonblocking-writer.h tests/test-nonblocking-reader.h tests/test-nonblocking-misc.h tests/macros.h Depends-on: stdbool unistd nonblocking wait-process pipe-posix dup2 environ posix_spawnp binary-io gettimeofday snprintf vsnprintf strerror ssize_t usleep read write configure.ac: Makefile.am: TESTS += test-nonblocking-pipe.sh check_PROGRAMS += test-nonblocking-pipe-main test-nonblocking-pipe-child test_nonblocking_pipe_main_LDADD = $(LDADD) @LIBINTL@
{ "pile_set_name": "Github" }
--- spack-src/prism/Makefile.bak 2019-04-19 07:53:32.000000000 +0900 +++ spack-src/prism/Makefile 2020-09-08 15:22:09.775733701 +0900 @@ -66,6 +66,9 @@ ifneq (,$(findstring ia64, $(shell uname -m))) ARCH = ia64 endif + ifneq (,$(findstring aarch64, $(shell uname -m))) + ARCH = aarch64 + endif endif # For Mac/Windows, we decide whether to build in 64-bit mode based on # whether java is 32/64-bit (since these need to match) @@ -173,6 +176,14 @@ LDFLAGS = $(CUDD_XCFLAGS) $(OPTIMISE) BINDISTSUFFIX = linux64 else + ifeq ($(ARCH),aarch64) + # Position Independent Code required on Aarch64 + CUDD_XCFLAGS = -fPIC -DPIC -DHAVE_IEEE_754 -DBSD -DSIZEOF_VOID_P=8 -DSIZEOF_LONG=8 $(DEBUG) $(WARNINGS) + CFLAGS = $(CUDD_XCFLAGS) $(OPTIMISE) + CPPFLAGS = --std=c++11 $(CUDD_XCFLAGS) $(OPTIMISE) + LDFLAGS = $(CUDD_XCFLAGS) $(OPTIMISE) + BINDISTSUFFIX = linux64 + else CUDD_XCFLAGS = -m32 -malign-double -DHAVE_IEEE_754 -DBSD $(DEBUG) $(WARNINGS) CFLAGS = $(CUDD_XCFLAGS) $(OPTIMISE) CPPFLAGS = --std=c++11 $(CUDD_XCFLAGS) $(OPTIMISE) @@ -180,6 +191,7 @@ BINDISTSUFFIX = linux32 endif endif + endif BIN_TARGETS=prism.linux xprism.linux JFLAGS = -encoding UTF8 SHARED = -shared
{ "pile_set_name": "Github" }
#ifndef __BRUBECK_SERVER_H__ #define __BRUBECK_SERVER_H__ struct brubeck_internal_stats { int sample_freq; struct { uint32_t metrics; uint32_t errors; uint32_t unique_keys; struct { uint32_t failed; uint32_t from_future; uint32_t delayed; uint32_t replayed; } secure; } live, sample; }; // Server struct brubeck_server { const char *name; const char *dump_path; const char *config_name; int running; int active_backends; int active_samplers; int fd_signal; int fd_expire; int fd_update; struct brubeck_slab slab; brubeck_hashtable_t *metrics; int at_capacity; struct brubeck_sampler *samplers[8]; struct brubeck_backend *backends[8]; json_t *config; struct brubeck_internal_stats internal_stats; }; #define brubeck_stats_inc(server, STAT) brubeck_atomic_inc(&server->internal_stats.live.STAT) #define brubeck_stats_sample(server, STAT) (server->internal_stats.sample.STAT) void brubeck_http_endpoint_init(struct brubeck_server *server, const char *listen_on); void brubeck_internal__init(struct brubeck_server *server); void brubeck_internal__sample(struct brubeck_metric *metric, brubeck_sample_cb sample, void *opaque); void brubeck_server_new_metric(struct brubeck_server *server, struct brubeck_metric *metric); int brubeck_server_run(struct brubeck_server *server); void brubeck_server_init(struct brubeck_server *server, const char *config); void brubeck_server_conf(struct brubeck_server *server, int argc, char *argv[]); void brubeck_cache_load(struct brubeck_server *server); void brubeck_cache_save(struct brubeck_server *server); #endif
{ "pile_set_name": "Github" }
--- title: File Transform task description: Apply configuration file transformations and variable substitution to a target package or folder ms.topic: reference ms.assetid: 7B6A6B5C-8AA1-410A-AE1F-08D59AF00E7B ms.custom: seodec18 ms.author: ronai author: RoopeshNair ms.date: 02/21/2019 monikerRange: '> tfs-2018' --- # File Transform task Use this task to apply file transformations and variable substitutions on configuration and parameters files. For details of how translations are processed, see [File transforms and variable substitution reference](../transforms-variable-substitution.md). **File transformations** * At present file transformations are supported for only XML files. * To apply XML transformation to configuration files (*.config) you must specify a newline-separated list of transformation file rules using the syntax: `-transform <path to the transform file> -xml <path to the source file> -result <path to the result file>` * File transformations are useful in many scenarios, particularly when you are deploying to an App service and want to add, remove or modify configurations for different environments (such as Dev, Test, or Prod) by following the standard [Web.config Transformation Syntax](https://docs.microsoft.com/aspnet/web-forms/overview/deployment/visual-studio-web-deployment/web-config-transformations). * You can also use this functionality to transform other files, including Console or Windows service application configuration files (for example, FabrikamService.exe.config). * Config file transformations are run before variable substitutions. **Variable substitution** * At present only XML and JSON file formats are supported for variable substitution. * Tokens defined in the target configuration files are updated and then replaced with variable values. * Variable substitutions are run after config file transformations. * Variable substitution is applied for only the JSON keys predefined in the object hierarchy. It does not create new keys. **Examples** If you need XML transformation to run on all the configuration files named with pattern **.Production.config**, the transformation rule should be specified as: `-transform **\*.Production.config -xml **\*.config` If you have a configuration file named based on the stage name in your pipeline, you can use: `-transform **\*.$(Release.EnvironmentName).config -xml **\*.config` To substitute JSON variables that are nested or hierarchical, specify them using JSONPath expressions. For example, to replace the value of **ConnectionString** in the sample below, you must define a variable as `Data.DefaultConnection.ConnectionString` in the build or release pipeline (or in a stage within the release pipeline). ``` { "Data": { "DefaultConnection": { "ConnectionString": "Server=(localdb)\SQLEXPRESS;Database=MyDB;Trusted_Connection=True" } } } ``` > [!NOTE] > Only custom variables defined in build and release pipelines are used in substitution. Default and system pipeline variables are excluded. > If the same variables are defined in the release pipeline and in a stage, the stage-defined variables supersede the pipeline-defined variables. See also: [File transforms and variable substitution reference](../transforms-variable-substitution.md). ## Demands None ## YAML snippet [!INCLUDE [FileTransformV1](../includes/yaml/FileTransformV1.md)] ## Arguments <table> <thead> <tr> <th>Argument</th> <th>Description</th> </tr> </thead> <tr> <td>Package or folder<br />folderPath</td> <td>File path to the package or a folder. Variables ( Build | Release ), wildcards are supported. For example, <code>$(System.DefaultWorkingDirectory)/<em>*/</em>.zip</code>. For zipped folders, the contents are extracted to the TEMP location, transformations executed, and the results zipped in original artifact location. </td> </tr> <tr> <td>XML transformation<br />enableXmlTransform</td> <td>Enable this option to apply XML transformations based on the rules specified below. Config transforms run prior to any variable substitution. XML transformations are supported only for the Windows platform. </td> </tr> <tr> <td>Transformation rules<br />xmlTransformationRules</td> <td>Provide a newline-separated list of transformation file rules using the syntax<br /> <code>-transform &lt;path to=&quot;&quot; the transform file&gt; -xml &lt;path to the source configuration file&gt; -result &lt;path to the result file&gt;</code><br /> The result file path is optional and, if not specified, the source configuration file will be replaced with the transformed result file. </td> </tr> <tr> <td>File format<br />fileType</td> <td>Specify the file format on which substitution is to be performed. Variable substitution runs after any configuration transforms. For XML, Variables defined in the build or release pipelines will be matched against the token (&#39;key&#39; or &#39;name&#39;) entries in the appSettings, applicationSettings, and connectionStrings sections of any config file and parameters.xml file. </td> </tr> <tr> <td>Target files<br />targetFiles</td> <td>Provide a newline-separated list of files for variable substitution. Files names must be specified relative to the root folder. </td> </tr> </table> ## Open source This task is open source on [GitHub](https://github.com/Microsoft/azure-pipelines-tasks). Feedback and contributions are welcome.
{ "pile_set_name": "Github" }
// This file is derived from the Cesium code base under Apache 2 license // See LICENSE.md and https://github.com/AnalyticalGraphicsInc/cesium/blob/master/LICENSE.md // Reference code: // https://github.com/AnalyticalGraphicsInc/cesium/blob/master/Source/Scene/Composite3DTileContent.js#L182 import {parse3DTileHeaderSync} from './helpers/parse-3d-tile-header'; // eslint-disable-next-line max-params export async function parseComposite3DTile( tile, arrayBuffer, byteOffset, options, context, parse3DTile ) { byteOffset = parse3DTileHeaderSync(tile, arrayBuffer, byteOffset); const view = new DataView(arrayBuffer); // Extract number of tiles tile.tilesLength = view.getUint32(byteOffset, true); byteOffset += 4; // extract each tile from the byte stream tile.tiles = []; while (tile.tiles.length < tile.tilesLength && tile.byteLength - byteOffset > 12) { const subtile = {}; tile.tiles.push(subtile); byteOffset = await parse3DTile(arrayBuffer, byteOffset, options, context, subtile); // TODO - do we need to add any padding in between tiles? } return byteOffset; }
{ "pile_set_name": "Github" }
package com.example.library.utils import android.annotation.TargetApi import android.app.Activity import android.content.ContentUris import android.content.ContentValues import android.content.Context import android.content.DialogInterface import android.content.Intent import android.database.Cursor import android.net.Uri import android.os.Build import android.os.Environment import android.provider.DocumentsContract import android.provider.MediaStore import android.support.v7.app.AlertDialog import com.bumptech.glide.Glide import com.bumptech.glide.request.FutureTarget import io.reactivex.Observable import io.reactivex.ObservableSource import io.reactivex.functions.Function /** * ๅ›พ็‰‡ๅทฅๅ…ท็ฑป */ object ImageUtils { /** * ๆ‹็…ง */ private const val REQUEST_CODE_FROM_CAMERA = 1 shl 10 /** * ็›ธๅ†Œ */ private const val REQUEST_CODE_FROM_ALBUM = 1 shl 12 /** * ่ฃๅ‰ช */ private const val REQUEST_CODE_CROP_IMAGE = 1 shl 14 /** * ๅญ˜ๆ”พๆ‹็…งๅ›พ็‰‡็š„uriๅœฐๅ€ */ var imageUriFromCamera: Uri? = null /** * ๅญ˜ๆ”พ่ฃๅ‰ชๅ›พ็‰‡็š„uriๅœฐๅ€ */ var cropImageUri: Uri? = null /** * ๆ˜พ็คบ่Žทๅ–็…ง็‰‡ไธๅŒๆ–นๅผๅฏน่ฏๆก† */ @JvmOverloads fun showImagePickDialog(activity: Activity, addRequest: Int = 0) { val title = "้€‰ๆ‹ฉ่Žทๅ–ๅ›พ็‰‡ๆ–นๅผ" val items = arrayOf("ๆ‹็…ง", "็›ธๅ†Œ") AlertDialog.Builder(activity) .setTitle(title) .setItems(items) { dialog, which -> dialog.dismiss() when (which) { 0 -> pickImageFromCamera(activity, addRequest) 1 -> pickImageFromAlbum(activity, addRequest) else -> { } } } .setNegativeButton("ๅ–ๆถˆ", null) .show() } /** * ๆ‰“ๅผ€็›ธๆœบๆ‹็…ง่Žทๅ–ๅ›พ็‰‡ */ @TargetApi(Build.VERSION_CODES.JELLY_BEAN) fun pickImageFromCamera(activity: Activity, addRequest: Int) { // ๅ…ˆ็”Ÿๆˆไธ€ไธชuriๅœฐๅ€็”จไบŽๅญ˜ๆ”พๆ‹็…ง่Žทๅ–็š„ๅ›พ็‰‡ imageUriFromCamera = createImageUri(activity) val intent = Intent() intent.action = MediaStore.ACTION_IMAGE_CAPTURE intent.putExtra(MediaStore.EXTRA_OUTPUT, imageUriFromCamera) activity.startActivityForResult(intent, REQUEST_CODE_FROM_CAMERA + addRequest) } /** * ๆ‰“ๅผ€็›ธๆœบๆ‹็…ง่Žทๅ–ๅ›พ็‰‡ */ fun pickImageFromCamera(activity: Activity) { pickImageFromCamera(activity, 0) } /** * ๆ‰“ๅผ€ๆœฌๅœฐ็›ธๅ†Œ้€‰ๅ–ๅ›พ็‰‡ */ @TargetApi(Build.VERSION_CODES.JELLY_BEAN) fun pickImageFromAlbum(activity: Activity, addRequest: Int) { val intent = Intent() intent.action = Intent.ACTION_GET_CONTENT intent.type = "image/*" activity.startActivityForResult(intent, REQUEST_CODE_FROM_ALBUM + addRequest) } /** * ๆ‰“ๅผ€ๆœฌๅœฐ็›ธๅ†Œ้€‰ๅ–ๅ›พ็‰‡ */ fun pickImageFromAlbum(activity: Activity) { pickImageFromAlbum(activity, 0) } /** * ๅ›พ็‰‡่ฃๅ‰ช */ fun cropImage(activity: Activity, srcUri: Uri) { cropImageUri = createImageUri(activity) val intent = Intent("com.android.camera.action.CROP") intent.setDataAndType(srcUri, "image/*") intent.putExtra("crop", "true") //////////////////////////////////////////////////////////////// // 1.ๅฎฝ้ซ˜ๅ’Œๆฏ”ไพ‹้ƒฝไธ่ฎพ็ฝฎๆ—ถ,่ฃๅ‰ชๆก†ๅฏไปฅ่‡ช่กŒ่ฐƒๆ•ด(ๆฏ”ไพ‹ๅ’Œๅคงๅฐ้ƒฝๅฏไปฅ้šๆ„่ฐƒๆ•ด) //////////////////////////////////////////////////////////////// // 2.ๅช่ฎพ็ฝฎ่ฃๅ‰ชๆก†ๅฎฝ้ซ˜ๆฏ”(aspect)ๅŽ,่ฃๅ‰ชๆก†ๆฏ”ไพ‹ๅ›บๅฎšไธๅฏ่ฐƒๆ•ด,ๅช่ƒฝ่ฐƒๆ•ดๅคงๅฐ ///////////////////////////////// // 3.่ฃๅ‰ชๅŽ็”Ÿๆˆๅ›พ็‰‡ๅฎฝ้ซ˜(output)็š„่ฎพ็ฝฎๅ’Œ่ฃๅ‰ชๆก†ๆ— ๅ…ณ,ๅชๅ†ณๅฎšๆœ€็ปˆ็”Ÿๆˆๅ›พ็‰‡ๅคงๅฐ //////////////////////////////////////////////////////////////// // 4.่ฃๅ‰ชๆก†ๅฎฝ้ซ˜ๆฏ”ไพ‹(aspect)ๅฏไปฅๅ’Œ่ฃๅ‰ชๅŽ็”Ÿๆˆๅ›พ็‰‡ๆฏ”ไพ‹(output)ไธๅŒ,ๆญคๆ—ถ, // ไผšไปฅ่ฃๅ‰ชๆก†็š„ๅฎฝไธบๅ‡†,ๆŒ‰็…ง่ฃๅ‰ชๅฎฝ้ซ˜ๆฏ”ไพ‹็”Ÿๆˆไธ€ไธชๅ›พ็‰‡,่ฏฅๅ›พๅ’Œๆก†้€‰้ƒจๅˆ†ๅฏ่ƒฝไธๅŒ, // ไธๅŒ็š„ๆƒ…ๅ†ตๅฏ่ƒฝๆ˜ฏๆˆชๅ–ๆก†้€‰็š„ไธ€้ƒจๅˆ†,ไนŸๅฏ่ƒฝ่ถ…ๅ‡บๆก†้€‰้ƒจๅˆ†,ๅ‘ไธ‹ๅปถไผธ่กฅ่ถณ //////////////////////////////////////////////////////////////// // aspectX aspectY ๆ˜ฏ่ฃๅ‰ชๆก†ๅฎฝ้ซ˜็š„ๆฏ”ไพ‹ intent.putExtra("aspectX", 1) intent.putExtra("aspectY", 1) // outputX outputY ๆ˜ฏ่ฃๅ‰ชๅŽ็”Ÿๆˆๅ›พ็‰‡็š„ๅฎฝ้ซ˜ // intent.putExtra("outputX", 300); // intent.putExtra("outputY", 100); // return-dataไธบtrueๆ—ถ,ไผš็›ดๆŽฅ่ฟ”ๅ›žbitmapๆ•ฐๆฎ,ไฝ†ๆ˜ฏๅคงๅ›พ่ฃๅ‰ชๆ—ถไผšๅ‡บ็ŽฐOOM,ๆŽจ่ไธ‹้ขไธบfalseๆ—ถ็š„ๆ–นๅผ // return-dataไธบfalseๆ—ถ,ไธไผš่ฟ”ๅ›žbitmap,ไฝ†้œ€่ฆๆŒ‡ๅฎšไธ€ไธชMediaStore.EXTRA_OUTPUTไฟๅญ˜ๅ›พ็‰‡uri intent.putExtra("return-data", false) intent.putExtra(MediaStore.EXTRA_OUTPUT, cropImageUri) activity.startActivityForResult(intent, REQUEST_CODE_CROP_IMAGE) } /** * ๅˆ›ๅปบไธ€ๆกๅ›พ็‰‡uri,็”จไบŽไฟๅญ˜ๆ‹็…งๅŽ็š„็…ง็‰‡ */ private fun createImageUri(context: Context): Uri? { val name = "boreImg" + System.currentTimeMillis() val values = ContentValues() values.put(MediaStore.Images.Media.TITLE, name) values.put(MediaStore.Images.Media.DISPLAY_NAME, "$name.jpeg") values.put(MediaStore.Images.Media.MIME_TYPE, "image/jpeg") return context.contentResolver.insert(MediaStore.Images.Media .EXTERNAL_CONTENT_URI, values) } /** * ๅˆ ้™คไธ€ๆกๅ›พ็‰‡ */ fun deleteImageUri(context: Context, uri: Uri) { context.contentResolver.delete(uri, null, null) } /** * ็”จ็ฌฌไธ‰ๆ–นๅบ”็”จappๆ‰“ๅผ€ๅ›พ็‰‡ */ fun openImageByOtherApp(context: Context, imageUri: Uri) { val intent = Intent() intent.action = Intent.ACTION_VIEW intent.setDataAndType(imageUri, "image/*") context.startActivity(intent) } /** * ๆ นๆฎUri่Žทๅ–ๅ›พ็‰‡็ปๅฏน่ทฏๅพ„๏ผŒ่งฃๅ†ณAndroid4.4ไปฅไธŠ็‰ˆๆœฌUri่ฝฌๆข */ fun getImageAbsolutePath19(context: Context?, imageUri: Uri?): String? { if (context == null || imageUri == null) return null if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.KITKAT && DocumentsContract.isDocumentUri(context, imageUri)) { if (isExternalStorageDocument(imageUri)) { val docId = DocumentsContract.getDocumentId(imageUri) val split = docId.split(":".toRegex()).dropLastWhile { it.isEmpty() }.toTypedArray() val type = split[0] if ("primary".equals(type, ignoreCase = true)) { return Environment.getExternalStorageDirectory().toString() + "/" + split[1] } } else if (isDownloadsDocument(imageUri)) { val id = DocumentsContract.getDocumentId(imageUri) val contentUri = ContentUris.withAppendedId(Uri.parse("content://downloads/public_downloads"), java.lang.Long.valueOf(id)) return getDataColumn(context, contentUri, null, null) } else if (isMediaDocument(imageUri)) { val docId = DocumentsContract.getDocumentId(imageUri) val split = docId.split(":".toRegex()).dropLastWhile { it.isEmpty() }.toTypedArray() val type = split[0] var contentUri: Uri? = null if ("image" == type) { contentUri = MediaStore.Images.Media.EXTERNAL_CONTENT_URI } else if ("video" == type) { contentUri = MediaStore.Video.Media.EXTERNAL_CONTENT_URI } else if ("audio" == type) { contentUri = MediaStore.Audio.Media.EXTERNAL_CONTENT_URI } val selection = MediaStore.Images.Media._ID + "=?" val selectionArgs = arrayOf(split[1]) return getDataColumn(context, contentUri, selection, selectionArgs) } } // MediaStore (and general) if ("content".equals(imageUri.scheme, ignoreCase = true)) { // Return the remote address return if (isGooglePhotosUri(imageUri)) imageUri.lastPathSegment else getDataColumn(context, imageUri, null, null) } else if ("file".equals(imageUri.scheme, ignoreCase = true)) { return imageUri.path }// File return null } private fun getDataColumn(context: Context, uri: Uri?, selection: String?, selectionArgs: Array<String>?): String? { var cursor: Cursor? = null val column = MediaStore.Images.Media.DATA val projection = arrayOf(column) try { cursor = context.contentResolver.query(uri!!, projection, selection, selectionArgs, null) if (cursor != null && cursor.moveToFirst()) { val index = cursor.getColumnIndexOrThrow(column) return cursor.getString(index) } } finally { cursor?.close() } return null } /** * @param uri The Uri to check. * @return Whether the Uri authority is ExternalStorageProvider. */ private fun isExternalStorageDocument(uri: Uri): Boolean { return "com.android.externalstorage.documents" == uri.authority } /** * @param uri The Uri to check. * @return Whether the Uri authority is DownloadsProvider. */ private fun isDownloadsDocument(uri: Uri): Boolean { return "com.android.providers.downloads.documents" == uri.authority } /** * @param uri The Uri to check. * @return Whether the Uri authority is MediaProvider. */ private fun isMediaDocument(uri: Uri): Boolean { return "com.android.providers.media.documents" == uri.authority } /** * @param uri The Uri to check. * @return Whether the Uri authority is Google Photos. */ private fun isGooglePhotosUri(uri: Uri): Boolean { return "com.google.android.apps.photos.content" == uri.authority } }
{ "pile_set_name": "Github" }
#ifndef BOOST_MPL_LIMITS_UNROLLING_HPP_INCLUDED #define BOOST_MPL_LIMITS_UNROLLING_HPP_INCLUDED // Copyright Aleksey Gurtovoy 2000-2004 // // Distributed under the Boost Software License, Version 1.0. // (See accompanying file LICENSE_1_0.txt or copy at // http://www.boost.org/LICENSE_1_0.txt) // // See http://www.boost.org/libs/mpl for documentation. // $Id$ // $Date$ // $Revision$ #if !defined(BOOST_MPL_LIMIT_UNROLLING) # define BOOST_MPL_LIMIT_UNROLLING 4 #endif #endif // BOOST_MPL_LIMITS_UNROLLING_HPP_INCLUDED
{ "pile_set_name": "Github" }
<?php /** * PHPExcel * * Copyright (c) 2006 - 2015 PHPExcel * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2.1 of the License, or (at your option) any later version. * * This library is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA * * @category PHPExcel * @package PHPExcel_Writer_Excel2007 * @copyright Copyright (c) 2006 - 2015 PHPExcel (http://www.codeplex.com/PHPExcel) * @license http://www.gnu.org/licenses/old-licenses/lgpl-2.1.txt LGPL * @version ##VERSION##, ##DATE## */ /** * PHPExcel_Writer_Excel2007_Theme * * @category PHPExcel * @package PHPExcel_Writer_Excel2007 * @copyright Copyright (c) 2006 - 2015 PHPExcel (http://www.codeplex.com/PHPExcel) */ class PHPExcel_Writer_Excel2007_Theme extends PHPExcel_Writer_Excel2007_WriterPart { /** * Map of Major fonts to write * @static array of string * */ private static $majorFonts = array( 'Jpan' => '๏ผญ๏ผณ ๏ผฐใ‚ดใ‚ทใƒƒใ‚ฏ', 'Hang' => '๋ง‘์€ ๊ณ ๋”•', 'Hans' => 'ๅฎ‹ไฝ“', 'Hant' => 'ๆ–ฐ็ดฐๆ˜Ž้ซ”', 'Arab' => 'Times New Roman', 'Hebr' => 'Times New Roman', 'Thai' => 'Tahoma', 'Ethi' => 'Nyala', 'Beng' => 'Vrinda', 'Gujr' => 'Shruti', 'Khmr' => 'MoolBoran', 'Knda' => 'Tunga', 'Guru' => 'Raavi', 'Cans' => 'Euphemia', 'Cher' => 'Plantagenet Cherokee', 'Yiii' => 'Microsoft Yi Baiti', 'Tibt' => 'Microsoft Himalaya', 'Thaa' => 'MV Boli', 'Deva' => 'Mangal', 'Telu' => 'Gautami', 'Taml' => 'Latha', 'Syrc' => 'Estrangelo Edessa', 'Orya' => 'Kalinga', 'Mlym' => 'Kartika', 'Laoo' => 'DokChampa', 'Sinh' => 'Iskoola Pota', 'Mong' => 'Mongolian Baiti', 'Viet' => 'Times New Roman', 'Uigh' => 'Microsoft Uighur', 'Geor' => 'Sylfaen', ); /** * Map of Minor fonts to write * @static array of string * */ private static $minorFonts = array( 'Jpan' => '๏ผญ๏ผณ ๏ผฐใ‚ดใ‚ทใƒƒใ‚ฏ', 'Hang' => '๋ง‘์€ ๊ณ ๋”•', 'Hans' => 'ๅฎ‹ไฝ“', 'Hant' => 'ๆ–ฐ็ดฐๆ˜Ž้ซ”', 'Arab' => 'Arial', 'Hebr' => 'Arial', 'Thai' => 'Tahoma', 'Ethi' => 'Nyala', 'Beng' => 'Vrinda', 'Gujr' => 'Shruti', 'Khmr' => 'DaunPenh', 'Knda' => 'Tunga', 'Guru' => 'Raavi', 'Cans' => 'Euphemia', 'Cher' => 'Plantagenet Cherokee', 'Yiii' => 'Microsoft Yi Baiti', 'Tibt' => 'Microsoft Himalaya', 'Thaa' => 'MV Boli', 'Deva' => 'Mangal', 'Telu' => 'Gautami', 'Taml' => 'Latha', 'Syrc' => 'Estrangelo Edessa', 'Orya' => 'Kalinga', 'Mlym' => 'Kartika', 'Laoo' => 'DokChampa', 'Sinh' => 'Iskoola Pota', 'Mong' => 'Mongolian Baiti', 'Viet' => 'Arial', 'Uigh' => 'Microsoft Uighur', 'Geor' => 'Sylfaen', ); /** * Map of core colours * @static array of string * */ private static $colourScheme = array( 'dk2' => '1F497D', 'lt2' => 'EEECE1', 'accent1' => '4F81BD', 'accent2' => 'C0504D', 'accent3' => '9BBB59', 'accent4' => '8064A2', 'accent5' => '4BACC6', 'accent6' => 'F79646', 'hlink' => '0000FF', 'folHlink' => '800080', ); /** * Write theme to XML format * * @param PHPExcel $pPHPExcel * @return string XML Output * @throws PHPExcel_Writer_Exception */ public function writeTheme(PHPExcel $pPHPExcel = null) { // Create XML writer $objWriter = null; if ($this->getParentWriter()->getUseDiskCaching()) { $objWriter = new PHPExcel_Shared_XMLWriter(PHPExcel_Shared_XMLWriter::STORAGE_DISK, $this->getParentWriter()->getDiskCachingDirectory()); } else { $objWriter = new PHPExcel_Shared_XMLWriter(PHPExcel_Shared_XMLWriter::STORAGE_MEMORY); } // XML header $objWriter->startDocument('1.0', 'UTF-8', 'yes'); // a:theme $objWriter->startElement('a:theme'); $objWriter->writeAttribute('xmlns:a', 'http://schemas.openxmlformats.org/drawingml/2006/main'); $objWriter->writeAttribute('name', 'Office Theme'); // a:themeElements $objWriter->startElement('a:themeElements'); // a:clrScheme $objWriter->startElement('a:clrScheme'); $objWriter->writeAttribute('name', 'Office'); // a:dk1 $objWriter->startElement('a:dk1'); // a:sysClr $objWriter->startElement('a:sysClr'); $objWriter->writeAttribute('val', 'windowText'); $objWriter->writeAttribute('lastClr', '000000'); $objWriter->endElement(); $objWriter->endElement(); // a:lt1 $objWriter->startElement('a:lt1'); // a:sysClr $objWriter->startElement('a:sysClr'); $objWriter->writeAttribute('val', 'window'); $objWriter->writeAttribute('lastClr', 'FFFFFF'); $objWriter->endElement(); $objWriter->endElement(); // a:dk2 $this->writeColourScheme($objWriter); $objWriter->endElement(); // a:fontScheme $objWriter->startElement('a:fontScheme'); $objWriter->writeAttribute('name', 'Office'); // a:majorFont $objWriter->startElement('a:majorFont'); $this->writeFonts($objWriter, 'Cambria', self::$majorFonts); $objWriter->endElement(); // a:minorFont $objWriter->startElement('a:minorFont'); $this->writeFonts($objWriter, 'Calibri', self::$minorFonts); $objWriter->endElement(); $objWriter->endElement(); // a:fmtScheme $objWriter->startElement('a:fmtScheme'); $objWriter->writeAttribute('name', 'Office'); // a:fillStyleLst $objWriter->startElement('a:fillStyleLst'); // a:solidFill $objWriter->startElement('a:solidFill'); // a:schemeClr $objWriter->startElement('a:schemeClr'); $objWriter->writeAttribute('val', 'phClr'); $objWriter->endElement(); $objWriter->endElement(); // a:gradFill $objWriter->startElement('a:gradFill'); $objWriter->writeAttribute('rotWithShape', '1'); // a:gsLst $objWriter->startElement('a:gsLst'); // a:gs $objWriter->startElement('a:gs'); $objWriter->writeAttribute('pos', '0'); // a:schemeClr $objWriter->startElement('a:schemeClr'); $objWriter->writeAttribute('val', 'phClr'); // a:tint $objWriter->startElement('a:tint'); $objWriter->writeAttribute('val', '50000'); $objWriter->endElement(); // a:satMod $objWriter->startElement('a:satMod'); $objWriter->writeAttribute('val', '300000'); $objWriter->endElement(); $objWriter->endElement(); $objWriter->endElement(); // a:gs $objWriter->startElement('a:gs'); $objWriter->writeAttribute('pos', '35000'); // a:schemeClr $objWriter->startElement('a:schemeClr'); $objWriter->writeAttribute('val', 'phClr'); // a:tint $objWriter->startElement('a:tint'); $objWriter->writeAttribute('val', '37000'); $objWriter->endElement(); // a:satMod $objWriter->startElement('a:satMod'); $objWriter->writeAttribute('val', '300000'); $objWriter->endElement(); $objWriter->endElement(); $objWriter->endElement(); // a:gs $objWriter->startElement('a:gs'); $objWriter->writeAttribute('pos', '100000'); // a:schemeClr $objWriter->startElement('a:schemeClr'); $objWriter->writeAttribute('val', 'phClr'); // a:tint $objWriter->startElement('a:tint'); $objWriter->writeAttribute('val', '15000'); $objWriter->endElement(); // a:satMod $objWriter->startElement('a:satMod'); $objWriter->writeAttribute('val', '350000'); $objWriter->endElement(); $objWriter->endElement(); $objWriter->endElement(); $objWriter->endElement(); // a:lin $objWriter->startElement('a:lin'); $objWriter->writeAttribute('ang', '16200000'); $objWriter->writeAttribute('scaled', '1'); $objWriter->endElement(); $objWriter->endElement(); // a:gradFill $objWriter->startElement('a:gradFill'); $objWriter->writeAttribute('rotWithShape', '1'); // a:gsLst $objWriter->startElement('a:gsLst'); // a:gs $objWriter->startElement('a:gs'); $objWriter->writeAttribute('pos', '0'); // a:schemeClr $objWriter->startElement('a:schemeClr'); $objWriter->writeAttribute('val', 'phClr'); // a:shade $objWriter->startElement('a:shade'); $objWriter->writeAttribute('val', '51000'); $objWriter->endElement(); // a:satMod $objWriter->startElement('a:satMod'); $objWriter->writeAttribute('val', '130000'); $objWriter->endElement(); $objWriter->endElement(); $objWriter->endElement(); // a:gs $objWriter->startElement('a:gs'); $objWriter->writeAttribute('pos', '80000'); // a:schemeClr $objWriter->startElement('a:schemeClr'); $objWriter->writeAttribute('val', 'phClr'); // a:shade $objWriter->startElement('a:shade'); $objWriter->writeAttribute('val', '93000'); $objWriter->endElement(); // a:satMod $objWriter->startElement('a:satMod'); $objWriter->writeAttribute('val', '130000'); $objWriter->endElement(); $objWriter->endElement(); $objWriter->endElement(); // a:gs $objWriter->startElement('a:gs'); $objWriter->writeAttribute('pos', '100000'); // a:schemeClr $objWriter->startElement('a:schemeClr'); $objWriter->writeAttribute('val', 'phClr'); // a:shade $objWriter->startElement('a:shade'); $objWriter->writeAttribute('val', '94000'); $objWriter->endElement(); // a:satMod $objWriter->startElement('a:satMod'); $objWriter->writeAttribute('val', '135000'); $objWriter->endElement(); $objWriter->endElement(); $objWriter->endElement(); $objWriter->endElement(); // a:lin $objWriter->startElement('a:lin'); $objWriter->writeAttribute('ang', '16200000'); $objWriter->writeAttribute('scaled', '0'); $objWriter->endElement(); $objWriter->endElement(); $objWriter->endElement(); // a:lnStyleLst $objWriter->startElement('a:lnStyleLst'); // a:ln $objWriter->startElement('a:ln'); $objWriter->writeAttribute('w', '9525'); $objWriter->writeAttribute('cap', 'flat'); $objWriter->writeAttribute('cmpd', 'sng'); $objWriter->writeAttribute('algn', 'ctr'); // a:solidFill $objWriter->startElement('a:solidFill'); // a:schemeClr $objWriter->startElement('a:schemeClr'); $objWriter->writeAttribute('val', 'phClr'); // a:shade $objWriter->startElement('a:shade'); $objWriter->writeAttribute('val', '95000'); $objWriter->endElement(); // a:satMod $objWriter->startElement('a:satMod'); $objWriter->writeAttribute('val', '105000'); $objWriter->endElement(); $objWriter->endElement(); $objWriter->endElement(); // a:prstDash $objWriter->startElement('a:prstDash'); $objWriter->writeAttribute('val', 'solid'); $objWriter->endElement(); $objWriter->endElement(); // a:ln $objWriter->startElement('a:ln'); $objWriter->writeAttribute('w', '25400'); $objWriter->writeAttribute('cap', 'flat'); $objWriter->writeAttribute('cmpd', 'sng'); $objWriter->writeAttribute('algn', 'ctr'); // a:solidFill $objWriter->startElement('a:solidFill'); // a:schemeClr $objWriter->startElement('a:schemeClr'); $objWriter->writeAttribute('val', 'phClr'); $objWriter->endElement(); $objWriter->endElement(); // a:prstDash $objWriter->startElement('a:prstDash'); $objWriter->writeAttribute('val', 'solid'); $objWriter->endElement(); $objWriter->endElement(); // a:ln $objWriter->startElement('a:ln'); $objWriter->writeAttribute('w', '38100'); $objWriter->writeAttribute('cap', 'flat'); $objWriter->writeAttribute('cmpd', 'sng'); $objWriter->writeAttribute('algn', 'ctr'); // a:solidFill $objWriter->startElement('a:solidFill'); // a:schemeClr $objWriter->startElement('a:schemeClr'); $objWriter->writeAttribute('val', 'phClr'); $objWriter->endElement(); $objWriter->endElement(); // a:prstDash $objWriter->startElement('a:prstDash'); $objWriter->writeAttribute('val', 'solid'); $objWriter->endElement(); $objWriter->endElement(); $objWriter->endElement(); // a:effectStyleLst $objWriter->startElement('a:effectStyleLst'); // a:effectStyle $objWriter->startElement('a:effectStyle'); // a:effectLst $objWriter->startElement('a:effectLst'); // a:outerShdw $objWriter->startElement('a:outerShdw'); $objWriter->writeAttribute('blurRad', '40000'); $objWriter->writeAttribute('dist', '20000'); $objWriter->writeAttribute('dir', '5400000'); $objWriter->writeAttribute('rotWithShape', '0'); // a:srgbClr $objWriter->startElement('a:srgbClr'); $objWriter->writeAttribute('val', '000000'); // a:alpha $objWriter->startElement('a:alpha'); $objWriter->writeAttribute('val', '38000'); $objWriter->endElement(); $objWriter->endElement(); $objWriter->endElement(); $objWriter->endElement(); $objWriter->endElement(); // a:effectStyle $objWriter->startElement('a:effectStyle'); // a:effectLst $objWriter->startElement('a:effectLst'); // a:outerShdw $objWriter->startElement('a:outerShdw'); $objWriter->writeAttribute('blurRad', '40000'); $objWriter->writeAttribute('dist', '23000'); $objWriter->writeAttribute('dir', '5400000'); $objWriter->writeAttribute('rotWithShape', '0'); // a:srgbClr $objWriter->startElement('a:srgbClr'); $objWriter->writeAttribute('val', '000000'); // a:alpha $objWriter->startElement('a:alpha'); $objWriter->writeAttribute('val', '35000'); $objWriter->endElement(); $objWriter->endElement(); $objWriter->endElement(); $objWriter->endElement(); $objWriter->endElement(); // a:effectStyle $objWriter->startElement('a:effectStyle'); // a:effectLst $objWriter->startElement('a:effectLst'); // a:outerShdw $objWriter->startElement('a:outerShdw'); $objWriter->writeAttribute('blurRad', '40000'); $objWriter->writeAttribute('dist', '23000'); $objWriter->writeAttribute('dir', '5400000'); $objWriter->writeAttribute('rotWithShape', '0'); // a:srgbClr $objWriter->startElement('a:srgbClr'); $objWriter->writeAttribute('val', '000000'); // a:alpha $objWriter->startElement('a:alpha'); $objWriter->writeAttribute('val', '35000'); $objWriter->endElement(); $objWriter->endElement(); $objWriter->endElement(); $objWriter->endElement(); // a:scene3d $objWriter->startElement('a:scene3d'); // a:camera $objWriter->startElement('a:camera'); $objWriter->writeAttribute('prst', 'orthographicFront'); // a:rot $objWriter->startElement('a:rot'); $objWriter->writeAttribute('lat', '0'); $objWriter->writeAttribute('lon', '0'); $objWriter->writeAttribute('rev', '0'); $objWriter->endElement(); $objWriter->endElement(); // a:lightRig $objWriter->startElement('a:lightRig'); $objWriter->writeAttribute('rig', 'threePt'); $objWriter->writeAttribute('dir', 't'); // a:rot $objWriter->startElement('a:rot'); $objWriter->writeAttribute('lat', '0'); $objWriter->writeAttribute('lon', '0'); $objWriter->writeAttribute('rev', '1200000'); $objWriter->endElement(); $objWriter->endElement(); $objWriter->endElement(); // a:sp3d $objWriter->startElement('a:sp3d'); // a:bevelT $objWriter->startElement('a:bevelT'); $objWriter->writeAttribute('w', '63500'); $objWriter->writeAttribute('h', '25400'); $objWriter->endElement(); $objWriter->endElement(); $objWriter->endElement(); $objWriter->endElement(); // a:bgFillStyleLst $objWriter->startElement('a:bgFillStyleLst'); // a:solidFill $objWriter->startElement('a:solidFill'); // a:schemeClr $objWriter->startElement('a:schemeClr'); $objWriter->writeAttribute('val', 'phClr'); $objWriter->endElement(); $objWriter->endElement(); // a:gradFill $objWriter->startElement('a:gradFill'); $objWriter->writeAttribute('rotWithShape', '1'); // a:gsLst $objWriter->startElement('a:gsLst'); // a:gs $objWriter->startElement('a:gs'); $objWriter->writeAttribute('pos', '0'); // a:schemeClr $objWriter->startElement('a:schemeClr'); $objWriter->writeAttribute('val', 'phClr'); // a:tint $objWriter->startElement('a:tint'); $objWriter->writeAttribute('val', '40000'); $objWriter->endElement(); // a:satMod $objWriter->startElement('a:satMod'); $objWriter->writeAttribute('val', '350000'); $objWriter->endElement(); $objWriter->endElement(); $objWriter->endElement(); // a:gs $objWriter->startElement('a:gs'); $objWriter->writeAttribute('pos', '40000'); // a:schemeClr $objWriter->startElement('a:schemeClr'); $objWriter->writeAttribute('val', 'phClr'); // a:tint $objWriter->startElement('a:tint'); $objWriter->writeAttribute('val', '45000'); $objWriter->endElement(); // a:shade $objWriter->startElement('a:shade'); $objWriter->writeAttribute('val', '99000'); $objWriter->endElement(); // a:satMod $objWriter->startElement('a:satMod'); $objWriter->writeAttribute('val', '350000'); $objWriter->endElement(); $objWriter->endElement(); $objWriter->endElement(); // a:gs $objWriter->startElement('a:gs'); $objWriter->writeAttribute('pos', '100000'); // a:schemeClr $objWriter->startElement('a:schemeClr'); $objWriter->writeAttribute('val', 'phClr'); // a:shade $objWriter->startElement('a:shade'); $objWriter->writeAttribute('val', '20000'); $objWriter->endElement(); // a:satMod $objWriter->startElement('a:satMod'); $objWriter->writeAttribute('val', '255000'); $objWriter->endElement(); $objWriter->endElement(); $objWriter->endElement(); $objWriter->endElement(); // a:path $objWriter->startElement('a:path'); $objWriter->writeAttribute('path', 'circle'); // a:fillToRect $objWriter->startElement('a:fillToRect'); $objWriter->writeAttribute('l', '50000'); $objWriter->writeAttribute('t', '-80000'); $objWriter->writeAttribute('r', '50000'); $objWriter->writeAttribute('b', '180000'); $objWriter->endElement(); $objWriter->endElement(); $objWriter->endElement(); // a:gradFill $objWriter->startElement('a:gradFill'); $objWriter->writeAttribute('rotWithShape', '1'); // a:gsLst $objWriter->startElement('a:gsLst'); // a:gs $objWriter->startElement('a:gs'); $objWriter->writeAttribute('pos', '0'); // a:schemeClr $objWriter->startElement('a:schemeClr'); $objWriter->writeAttribute('val', 'phClr'); // a:tint $objWriter->startElement('a:tint'); $objWriter->writeAttribute('val', '80000'); $objWriter->endElement(); // a:satMod $objWriter->startElement('a:satMod'); $objWriter->writeAttribute('val', '300000'); $objWriter->endElement(); $objWriter->endElement(); $objWriter->endElement(); // a:gs $objWriter->startElement('a:gs'); $objWriter->writeAttribute('pos', '100000'); // a:schemeClr $objWriter->startElement('a:schemeClr'); $objWriter->writeAttribute('val', 'phClr'); // a:shade $objWriter->startElement('a:shade'); $objWriter->writeAttribute('val', '30000'); $objWriter->endElement(); // a:satMod $objWriter->startElement('a:satMod'); $objWriter->writeAttribute('val', '200000'); $objWriter->endElement(); $objWriter->endElement(); $objWriter->endElement(); $objWriter->endElement(); // a:path $objWriter->startElement('a:path'); $objWriter->writeAttribute('path', 'circle'); // a:fillToRect $objWriter->startElement('a:fillToRect'); $objWriter->writeAttribute('l', '50000'); $objWriter->writeAttribute('t', '50000'); $objWriter->writeAttribute('r', '50000'); $objWriter->writeAttribute('b', '50000'); $objWriter->endElement(); $objWriter->endElement(); $objWriter->endElement(); $objWriter->endElement(); $objWriter->endElement(); $objWriter->endElement(); // a:objectDefaults $objWriter->writeElement('a:objectDefaults', null); // a:extraClrSchemeLst $objWriter->writeElement('a:extraClrSchemeLst', null); $objWriter->endElement(); // Return return $objWriter->getData(); } /** * Write fonts to XML format * * @param PHPExcel_Shared_XMLWriter $objWriter * @param string $latinFont * @param array of string $fontSet * @return string XML Output * @throws PHPExcel_Writer_Exception */ private function writeFonts($objWriter, $latinFont, $fontSet) { // a:latin $objWriter->startElement('a:latin'); $objWriter->writeAttribute('typeface', $latinFont); $objWriter->endElement(); // a:ea $objWriter->startElement('a:ea'); $objWriter->writeAttribute('typeface', ''); $objWriter->endElement(); // a:cs $objWriter->startElement('a:cs'); $objWriter->writeAttribute('typeface', ''); $objWriter->endElement(); foreach ($fontSet as $fontScript => $typeface) { $objWriter->startElement('a:font'); $objWriter->writeAttribute('script', $fontScript); $objWriter->writeAttribute('typeface', $typeface); $objWriter->endElement(); } } /** * Write colour scheme to XML format * * @param PHPExcel_Shared_XMLWriter $objWriter * @return string XML Output * @throws PHPExcel_Writer_Exception */ private function writeColourScheme($objWriter) { foreach (self::$colourScheme as $colourName => $colourValue) { $objWriter->startElement('a:'.$colourName); $objWriter->startElement('a:srgbClr'); $objWriter->writeAttribute('val', $colourValue); $objWriter->endElement(); $objWriter->endElement(); } } }
{ "pile_set_name": "Github" }
.select2-result-label { .variant-autocomplete-item { .variant-details { padding: 0 10px; float: left; } .variant-image { margin-top: 5px; background-color: white; float: left; margin-right: 10px; } ul.variant-details { li { display: inline-block; &:after { content: ' / '; } &:last-child:after { content: ''; } } } } }
{ "pile_set_name": "Github" }
/* * Copyright (c) 2011-2018, Meituan Dianping. All Rights Reserved. * * 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. */ #include "encoder.h" #include "ccat/message.h" #include "ccat/message_helper.h" #include "lib/cat_time_util.h" #define POLICY_DEFAULT 0 #define POLICY_WITHOUT_STATUS 1 #define POLICY_WITH_DURATION 2 #define CAT_ENCODE_VERSION "PT1" #define CAT_TAB '\t' #define CAT_ENDL '\n' static inline sds sdscatwithnull(sds s, const char *buf) { return catsdscat(s, buf == NULL ? "null" : buf); } static inline sds sdscatwithdefault(sds s, const char *buf, const char *defaultStr) { return catsdscat(s, buf == NULL ? defaultStr : buf); } void catTextEncodeHeader(CatEncoder *encoder, CatMessageTree *tree) { sds tmpBuf = *encoder->buf; tmpBuf = sdscatwithnull(tmpBuf, CAT_ENCODE_VERSION); tmpBuf = catsdscatchar(tmpBuf, CAT_TAB); tmpBuf = sdscatwithnull(tmpBuf, encoder->appkey); tmpBuf = catsdscatchar(tmpBuf, CAT_TAB); tmpBuf = sdscatwithnull(tmpBuf, encoder->hostname); tmpBuf = catsdscatchar(tmpBuf, CAT_TAB); tmpBuf = sdscatwithnull(tmpBuf, encoder->ip); tmpBuf = catsdscatchar(tmpBuf, CAT_TAB); tmpBuf = sdscatwithnull(tmpBuf, tree->threadGroupName); tmpBuf = catsdscatchar(tmpBuf, CAT_TAB); tmpBuf = sdscatwithnull(tmpBuf, tree->threadId); tmpBuf = catsdscatchar(tmpBuf, CAT_TAB); tmpBuf = sdscatwithnull(tmpBuf, tree->threadName); tmpBuf = catsdscatchar(tmpBuf, CAT_TAB); tmpBuf = sdscatwithnull(tmpBuf, tree->messageId); tmpBuf = catsdscatchar(tmpBuf, CAT_TAB); tmpBuf = sdscatwithnull(tmpBuf, tree->parentMessageId); tmpBuf = catsdscatchar(tmpBuf, CAT_TAB); tmpBuf = sdscatwithnull(tmpBuf, tree->rootMessageId); tmpBuf = catsdscatchar(tmpBuf, CAT_TAB); tmpBuf = sdscatwithnull(tmpBuf, tree->sessionToken); tmpBuf = catsdscatchar(tmpBuf, CAT_ENDL); *encoder->buf = tmpBuf; } void catEncodeLine(CatEncoder *encoder, CatMessage *message, char type, int policy) { sds tmpBuf = *encoder->buf; CatMessageInner *pMsgInner = getInnerMsg(message); tmpBuf = catsdscatchar(tmpBuf, type); if (type == 'T' && isCatTransaction(message)) { unsigned long long durationMs = getCatTransactionDurationUs((CatTransaction *) message) / 1000; tmpBuf = catsdscatprintf(tmpBuf, "%s", GetCatTimeString(getCatMessageTimeStamp(message) + durationMs)); } else { tmpBuf = catsdscatprintf(tmpBuf, "%s", GetCatTimeString(getCatMessageTimeStamp(message))); } tmpBuf = catsdscatchar(tmpBuf, CAT_TAB); tmpBuf = sdscatwithnull(tmpBuf, pMsgInner->type); tmpBuf = catsdscatchar(tmpBuf, CAT_TAB); tmpBuf = sdscatwithnull(tmpBuf, pMsgInner->name); tmpBuf = catsdscatchar(tmpBuf, CAT_TAB); if (policy != POLICY_WITHOUT_STATUS) { // Set status to "DefaultStatus" while status is null tmpBuf = sdscatwithdefault(tmpBuf, pMsgInner->status, "DefaultStatus"); tmpBuf = catsdscatchar(tmpBuf, CAT_TAB); if (policy == POLICY_WITH_DURATION && isCatTransaction(message)) { unsigned long long durationUs = getCatTransactionDurationUs((CatTransaction *) message); tmpBuf = catsdscatprintf(tmpBuf, "%lldus\t", durationUs); } tmpBuf = sdscatwithnull(tmpBuf, pMsgInner->data); tmpBuf = catsdscatchar(tmpBuf, CAT_TAB); } tmpBuf = catsdscatchar(tmpBuf, CAT_ENDL); *encoder->buf = tmpBuf; } static inline void catTextTransaction(CatEncoder *encoder, CatTransaction *transaction) { CATStaticQueue *children = getCatTransactionChildren(transaction); if (isCATStaticQueueEmpty(children)) { catEncodeLine(encoder, (CatMessage *) transaction, 'A', POLICY_WITH_DURATION); } else { size_t len = getCATStaticStackSize(children); catEncodeLine(encoder, (CatMessage *) transaction, 't', POLICY_WITHOUT_STATUS); size_t i; for (i = 0; i < len; i++) { CatMessage *child = getCATStaticStackByIndex(children, i); if (child != NULL) { encoder->message(encoder, child); } } catEncodeLine(encoder, (CatMessage *) transaction, 'T', POLICY_WITH_DURATION); } } static inline void catTextEvent(CatEncoder *encoder, CatEvent *event) { catEncodeLine(encoder, event, 'E', POLICY_DEFAULT); } static inline void catTextMetric(CatEncoder *encoder, CatMetric *metric) { catEncodeLine(encoder, metric, 'M', POLICY_DEFAULT); } static inline void catTextHeartbeat(CatEncoder *encoder, CatMetric *heartbeat) { catEncodeLine(encoder, heartbeat, 'H', POLICY_DEFAULT); } CatEncoder *newCatTextEncoder() { CatEncoder *encoder = newCatEncoder(); encoder->header = catTextEncodeHeader; encoder->transaction = catTextTransaction; encoder->event = catTextEvent; encoder->metric = catTextMetric; encoder->heartbeat = catTextHeartbeat; return encoder; }
{ "pile_set_name": "Github" }
<?xml version="1.0" <!DOCTYPE fontconfig SYSTEM "fonts.dtd"> <!-- /etc/fonts.conf file to configure system font access --> <fontconfig> <!-- Enable sub-pixel rendering <match target="font"> <test qual="all" name="rgba"> <const>unknown</const> </test> <edit name="rgba" mode="assign"><const>rgb</const></edit> </match> --> <alias> <family>serif</family> <prefer> <family>Bitstream Vera Serif</family> </prefer> </alias> <alias> <family>sans-serif</family> <prefer> <family>Bitstream Vera Sans</family> </prefer> </alias> <alias> <family>monospace</family> <prefer> <family>Bitstream Vera Sans Mono</family> </prefer> </alias> </fontconfig>
{ "pile_set_name": "Github" }
<?php /** * Created by Hisune EchartsPHP AutoGenerate. * @author: Hisune <hi@hisune.com> */ namespace Hisune\EchartsPHP\Doc\IDE\Grid\Tooltip; use Hisune\EchartsPHP\Property; /** * @property string $color Default: '#fff' * text color. * * @property string $fontStyle Default: 'normal' * font style * Options are: * * normal * italic * oblique * * @property string $fontWeight Default: 'normal' * font thick weight * Options are: * * normal * bold * bolder * lighter * 100 | 200 | 300 | 400... * * @property string $fontFamily Default: 'sans-serif' * font family * Can also be serif , monospace, ... * * @property int $fontSize Default: 14 * font size * * @property int $lineHeight * Line height of the text fregment. * If lineHeight is not set in rich, lineHeight in parent level will be used. For example: * { * lineHeight: 56, * rich: { * a: { * // `lineHeight` is not set, then it will be 56 * } * } * } * * @property int|string $width * Width of the text block. It is the width of the text by default. In most cases, there is no need to specify it. You may want to use it in some cases like make simple table or using background image (see backgroundColor). * Notice, width and height specifies the width and height of the content, without padding. * width can also be percent string, like 100%, which represents the percent of contentWidth (that is, the width without padding) of its container box. It is based on contentWidth because that each text fregment is layout based on the content box, where it makes no sense that calculating width based on outerWith in prectice. * Notice, width and height only work when rich specified. * * @property int|string $height * Height of the text block. It is the width of the text by default. You may want to use it in some cases like using background image (see backgroundColor). * Notice, width and height specifies the width and height of the content, without padding. * Notice, width and height only work when rich specified. * * @property string $textBorderColor Default: 'transparent' * Storke color of the text. * * @property int $textBorderWidth Default: 0 * Storke line width of the text. * * @property string $textShadowColor Default: 'transparent' * Shadow color of the text itself. * * @property int $textShadowBlur Default: 0 * Shadow blue of the text itself. * * @property int $textShadowOffsetX Default: 0 * Shadow X offset of the text itself. * * @property int $textShadowOffsetY Default: 0 * Shadow Y offset of the text itself. * * {_more_} */ class TextStyle extends Property {}
{ "pile_set_name": "Github" }
--- ./src/Makefile.orig 2020-03-28 14:25:12.000000000 +0100 +++ ./src/Makefile 2020-04-03 21:01:21.744145133 +0200 @@ -206,7 +206,7 @@ # Enable multi-threading support. PARALLEL_CFLAGS = -Dgmic_is_parallel ifneq ($(OS),Windows) -PARALLEL_LIBS = -lpthread +#PARALLEL_LIBS = -lpthread endif # Enable parallelization in CImg, using OpenMP. @@ -346,8 +346,8 @@ GMIC_CLI_CFLAGS = $(MANDATORY_CFLAGS) $(ABORT_CFLAGS) $(PARALLEL_CFLAGS) $(EIGEN_CFLAGS) $(FFTW_CFLAGS) $(CURL_CFLAGS) $(PNG_CFLAGS) $(JPEG_CFLAGS) $(TIFF_CFLAGS) GMIC_CLI_LIBS = $(MANDATORY_LIBS) $(PARALLEL_LIBS) $(EIGEN_LIBS) $(FFTW_LIBS) $(CURL_LIBS) $(PNG_LIBS) $(JPEG_LIBS) $(TIFF_LIBS) ifeq ($(OS),Unix) # Unix -GMIC_CLI_CFLAGS += $(OPENMP_CFLAGS) $(X11_CFLAGS) $(OPENEXR_CFLAGS) $(OPENCV_CFLAGS) # $(XSHM_CFLAGS) # $(MAGICK_CFLAGS) -GMIC_CLI_LIBS += $(OPENMP_LIBS) $(X11_LIBS) $(OPENEXR_LIBS) $(OPENCV_LIBS) # $(XSHM_LIBS) # $(MAGICK_LIBS) +#GMIC_CLI_CFLAGS += $(OPENMP_CFLAGS) $(X11_CFLAGS) $(OPENEXR_CFLAGS) $(OPENCV_CFLAGS) # $(XSHM_CFLAGS) # $(MAGICK_CFLAGS) +#GMIC_CLI_LIBS += $(OPENMP_LIBS) $(X11_LIBS) $(OPENEXR_LIBS) $(OPENCV_LIBS) # $(XSHM_LIBS) # $(MAGICK_LIBS) else ifeq ($(OS),Darwin) # MacOSX GMIC_CLI_CFLAGS += $(X11_CFLAGS) $(OPENEXR_CFLAGS) $(OPENCV_CFLAGS) @@ -360,13 +360,15 @@ cli: $(MAKE) "CFLAGS+=$(GMIC_CLI_CFLAGS) $(OPT_CLI_CFLAGS)" "LIBS+=$(GMIC_CLI_LIBS) $(OPT_LIBS)" _cli - $(STRIP) gmic$(EXE) + $(STRIP) gmic$(EXE) gmic-gm$(EXE) debug: $(MAKE) "CFLAGS+=$(GMIC_CLI_CFLAGS) $(DEBUG_CFLAGS)" "LIBS+=$(GMIC_CLI_LIBS)" _cli _cli: gmic_cli.o gmic.cpp gmic.h gmic_stdlib.h CImg.h $(CXX) -o gmic gmic_cli.cpp gmic_cli.o $(CFLAGS) $(LIBS) + $(CXX) -o gmic_cli_gm.o -c gmic.cpp $(CFLAGS) $(MAGICK_CFLAGS) + $(CXX) -o gmic-gm gmic_cli.cpp gmic_cli_gm.o $(CFLAGS) $(MAGICK_CFLAGS) $(LIBS) $(MAGICK_LIBS) gmic_cli.o: gmic.cpp gmic.h gmic_stdlib.h CImg.h $(CXX) -o gmic_cli.o -c gmic.cpp $(CFLAGS)
{ "pile_set_name": "Github" }
export declare class DocumentReference { readonly id: string; readonly projection: Object; set(data: Object): Promise<any>; update(data: Object): Promise<any>; remove(): Promise<any>; get(): Promise<any>; field(projection: Object): DocumentReference; }
{ "pile_set_name": "Github" }
vtk_module_test_data( Data/GIS/raster.tif Data/autoshop.jpg Data/anisotropyTex.png Data/bunny.ply Data/clouds.jpeg Data/dragon.ply Data/normalMapping.png Data/skybox-nx.jpg Data/skybox-ny.jpg Data/skybox-nz.jpg Data/skybox-px.jpg Data/skybox-py.jpg Data/skybox-pz.jpg Data/skybox/,REGEX:.*\.jpg Data/spiaggia_di_mondello_1k.hdr Data/,REGEX:vtk_.*\.png Data/wintersun.jpg) add_subdirectory(Cxx) if (VTK_WRAP_PYTHON) add_subdirectory(Python) endif ()
{ "pile_set_name": "Github" }
## logs logs is a Go logs manager. It can use many logs adapters. The repo is inspired by `database/sql` . ## How to install? go get github.com/astaxie/beego/logs ## What adapters are supported? As of now this logs support console, file,smtp and conn. ## How to use it? First you must import it import ( "github.com/astaxie/beego/logs" ) Then init a Log (example with console adapter) log := NewLogger(10000) log.SetLogger("console", "") > the first params stand for how many channel Use it like this: log.Trace("trace") log.Info("info") log.Warn("warning") log.Debug("debug") log.Critical("critical") ## File adapter Configure file adapter like this: log := NewLogger(10000) log.SetLogger("file", `{"filename":"test.log"}`) ## Conn adapter Configure like this: log := NewLogger(1000) log.SetLogger("conn", `{"net":"tcp","addr":":7020"}`) log.Info("info") ## Smtp adapter Configure like this: log := NewLogger(10000) log.SetLogger("smtp", `{"username":"beegotest@gmail.com","password":"xxxxxxxx","host":"smtp.gmail.com:587","sendTos":["xiemengjun@gmail.com"]}`) log.Critical("sendmail critical") time.Sleep(time.Second * 30)
{ "pile_set_name": "Github" }
// // Pager pagination // -------------------------------------------------- .pager { padding-left: 0; margin: @line-height-computed 0; list-style: none; text-align: center; &:extend(.clearfix all); li { display: inline; > a, > span { display: inline-block; padding: 5px 14px; background-color: @pager-bg; border: 1px solid @pager-border; border-radius: @pager-border-radius; } > a:hover, > a:focus { text-decoration: none; background-color: @pager-hover-bg; } } .next { > a, > span { float: right; } } .previous { > a, > span { float: left; } } .disabled { > a, > a:hover, > a:focus, > span { color: @pager-disabled-color; background-color: @pager-bg; cursor: @cursor-disabled; } } }
{ "pile_set_name": "Github" }
function handleDragStart(e) { var refIndex = parseInt(e.target.getAttribute("class").split("fileindex")[1]); var fullPath = require('path').join(desktopPath, filesOnDesktop[refIndex ]); var fs = require('fs').stat(fullPath); if(fs.type == "file") { /* var file = fs.file; var leafName = fs.leafName; */ console.log("Starting drag...to "+fullPath); var leafName = filesOnDesktop[refIndex]; require('dragdrop').setDragData(e,fullPath,leafName, "copy", function(s) { console.log("success!") }, function (e) { console.log("error" + e) } ); var image = document.createElement("img"); image.setAttribute("border", "0"); image.setAttribute("src", "images/question.png"); image.setAttribute("width", "48"); image.setAttribute("height", "48"); e.dataTransfer.setDragImage(image, 25, 25); } else { console.log("I can only associate files to the drag, for now..."); } } function handleDragEnd(e) { } function dragEnable() { var dragItems = document.querySelectorAll("[draggable=true]"); for (var i = 0, l = dragItems.length; i < l; ++i) { dragItems[i].addEventListener("dragstart", handleDragStart, true); dragItems[i].addEventListener("dragend", handleDragEnd, true); } }
{ "pile_set_name": "Github" }
# WebWorks System Event Log Information ## NOTE: THIS IS A WORK IN PROGRESS The WebWorks System Event Log API will allow you to write to the Blackberry System Event Log from within your WebWorks applications. **Authors:** [John Mutter](https://github.com/jmutter) [Matthew Haag](https://github.com/muerl) ## Known Issues * None ## Tested On * BlackBerry Bold 9900 v7.0.0.261 * BlackBerry Torch 9800 v6.0.0.227 **Requires BlackBerry WebWorks SDK for Smartphones v2.0 or higher** Have a problem with this extension? [Log an Issue](https://github.com/blackberry/WebWorks-Community-APIs/issues) or contact the Authors ## How To Configure The Extension For Use 1. Locate your BlackBerry WebWorks SDK for Smartphone extensions directory using your File Explorer. Default path is _**C:\Program Files\Research In Motion\BlackBerry WebWorks Packager\ext**_ 2. Create a new _**webworks.system.log**_ directory in the _**ext**_ directory 3. Download the source from this repository and unzip it to a location on your computer 4. Copy extracted contents to the _**webworks.system.log**_ directory **NOTE:** Be sure to back-up this _**ext\webworks.system.log**_ directory in your WebWorks SDK extensions directory before performing a WebWorks SDK upgrade. Simply copy it back into the _**ext**_ directory after you have completed your SDK upgrade. ## Required Feature ID Whenever you use the below feature id in any of your WebWorks applications this extension will be loaded for use. <feature id="blackberry.ext.system.log" /> ## Summary blackberry.ext.system.log.setup ( [String:App Guid Name] , [String:App Name] , [Integer:Mode] ) blackberry.ext.system.log.write ( [String:System Log Message Text] ) ## Options Summary ## Item Summary [String:App Guid Name] // This should be a unique package like name to identify your application example... "com.demo.myapp" [String:App Name] // This is the friendly name you would see listed as the origin of the log message. "My Application Name" [String:System Log Message Text] // This is the physical text that would make up the actual system event log message. [Integer:Mode] //This is an ENUM, 1 for System Log, 2 for Standard Out, 3 for both. There are defined ENUMs but they are broken will be fixed in next version ## Initialization Example function setupLog() { blackberry.ext.system.log.setup ( "com.demo.myappname", "My Application", 3 ); } function writeLog(){ blackberry.ext.system.log.write( "Test Message"); }
{ "pile_set_name": "Github" }
<?php declare(strict_types=1); /** * Pimcore * * This source file is available under two different licenses: * - GNU General Public License version 3 (GPLv3) * - Pimcore Enterprise License (PEL) * Full copyright and license information is available in * LICENSE.md which is distributed with this source code. * * @copyright Copyright (c) Pimcore GmbH (http://www.pimcore.org) * @license http://www.pimcore.org/license GPLv3 and PEL */ namespace Pimcore\Document\Tag; use Pimcore\Document\Editable\UsageRecorderSubscriber as EditableUsageRecorderSubscriber; @trigger_error(sprintf('Class "%s" is deprecated since v6.8 and will be removed in 7. Use "%s" instead.', UsageRecorderSubscriber::class, EditableUsageRecorderSubscriber::class), E_USER_DEPRECATED); class_exists(EditableUsageRecorderSubscriber::class); if (false) { /** * @deprecated use \Pimcore\Document\Editable\UsageRecorderSubscriber instead. */ class UsageRecorderSubscriber extends EditableUsageRecorderSubscriber { } }
{ "pile_set_name": "Github" }
/* -------------------------------------------------------------------------- */ /* Copyright 2002-2020, OpenNebula Project, OpenNebula Systems */ /* */ /* Licensed under the Apache License, Version 2.0 (the "License"); you may */ /* not use this file except in compliance with the License. You may obtain */ /* a copy of the License at */ /* */ /* http://www.apache.org/licenses/LICENSE-2.0 */ /* */ /* Unless required by applicable law or agreed to in writing, software */ /* distributed under the License is distributed on an "AS IS" BASIS, */ /* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. */ /* See the License for the specific language governing permissions and */ /* limitations under the License. */ /* -------------------------------------------------------------------------- */ #include "MarketPlaceAppPool.h" #include "Nebula.h" #include "Client.h" using namespace std; /* -------------------------------------------------------------------------- */ /* -------------------------------------------------------------------------- */ static int master_allocate(MarketPlaceApp * mp, string& error) { Client * client = Client::client(); xmlrpc_c::value result; vector<xmlrpc_c::value> values; std::string mp_xml; std::ostringstream oss("Cannot allocate marketapp at federation master: ", std::ios::ate); mp->to_xml(mp_xml); try { client->call("one.marketapp.allocatedb", "s", &result, mp_xml.c_str()); } catch (exception const& e) { oss << e.what(); error = oss.str(); return -1; } values = xmlrpc_c::value_array(result).vectorValueValue(); if ( xmlrpc_c::value_boolean(values[0]) == false ) { std::string error_xml = xmlrpc_c::value_string(values[1]); oss << error_xml; error = oss.str(); return -1; } int oid = xmlrpc_c::value_int(values[1]); return oid; } /* -------------------------------------------------------------------------- */ int MarketPlaceAppPool:: allocate( int uid, int gid, const std::string& uname, const std::string& gname, int umask, std::unique_ptr<MarketPlaceAppTemplate> apptemplate, int mp_id, const std::string& mp_name, int * oid, std::string& error_str) { MarketPlaceApp * mp; int db_oid; std::string name; std::ostringstream oss; // ------------------------------------------------------------------------- // Build the marketplace app object // ------------------------------------------------------------------------- mp = new MarketPlaceApp(uid, gid, uname, gname, umask, move(apptemplate)); mp->market_id = mp_id; mp->market_name = mp_name; mp->zone_id = Nebula::instance().get_zone_id(); mp->state = MarketPlaceApp::INIT; mp->get_template_attribute("NAME", name); if ( !PoolObjectSQL::name_is_valid(name, error_str) ) { goto error_name; } db_oid = exist(name, uid); if( db_oid != -1 ) { goto error_duplicated; } if ( mp->parse_template(error_str) != 0 ) { goto error_template; } // ------------------------------------------------------------------------- // Insert the object in the Database // ------------------------------------------------------------------------- if (Nebula::instance().is_federation_slave()) { *oid = master_allocate(mp, error_str); delete mp; return *oid; } *oid = PoolSQL::allocate(mp, error_str); return *oid; error_duplicated: oss << "NAME is already taken by MARKETPLACEAPP " << db_oid; error_str = oss.str(); error_name: error_template: delete mp; *oid = -1; return *oid; } /* -------------------------------------------------------------------------- */ /* -------------------------------------------------------------------------- */ int MarketPlaceAppPool::drop(PoolObjectSQL * objsql, std::string& error_msg) { if (Nebula::instance().is_federation_slave()) { Client * client = Client::client(); xmlrpc_c::value result; vector<xmlrpc_c::value> values; std::ostringstream oss("Cannot drop marketapp at federation master: ", std::ios::ate); try { client->call("one.marketapp.dropdb", "i", &result, objsql->get_oid()); } catch (exception const& e) { oss << e.what(); error_msg = oss.str(); return -1; } values = xmlrpc_c::value_array(result).vectorValueValue(); if ( xmlrpc_c::value_boolean(values[0]) == false ) { std::string error = xmlrpc_c::value_string(values[1]); oss << error; error_msg = oss.str(); return -1; } return 0; } return PoolSQL::drop(objsql, error_msg); } /* -------------------------------------------------------------------------- */ /* -------------------------------------------------------------------------- */ int MarketPlaceAppPool::import(const std::string& t64, int mp_id, const std::string& mp_name, int& app_id, std::string& error_str) { // ------------------------------------------------------------------------- // Build the marketplace app object // ------------------------------------------------------------------------- MarketPlaceApp * app = new MarketPlaceApp(UserPool::ONEADMIN_ID, GroupPool::ONEADMIN_ID, UserPool::oneadmin_name, GroupPool::ONEADMIN_NAME ,0133, 0); if ( app->from_template64(t64, error_str) != 0 ) { delete app; return -1; } app->market_id = mp_id; app->market_name = mp_name; app->zone_id = Nebula::instance().get_zone_id(); if ( !PoolObjectSQL::name_is_valid(app->name, error_str) ) { std::ostringstream oss; oss << "imported-" << app->get_origin_id(); app->name = oss.str(); if ( !PoolObjectSQL::name_is_valid(app->name, error_str) ) { error_str = "Cannot generate a valida name for app"; delete app; return -1; } } if ( auto mp_aux = get(app->name, 0) ) //Marketplace app already imported { app_id = mp_aux->oid; if ( mp_aux->version != app->version || mp_aux->md5 != app->md5 ) { mp_aux->from_template64(t64, error_str); update(mp_aux.get()); } delete app; return -2; } // ------------------------------------------------------------------------- // Insert the object in the Database // ------------------------------------------------------------------------- if (Nebula::instance().is_federation_slave()) { app_id = master_allocate(app, error_str); delete app; return app_id; } app_id = PoolSQL::allocate(app, error_str); return app_id; } /* -------------------------------------------------------------------------- */ /* -------------------------------------------------------------------------- */ int MarketPlaceAppPool::update(PoolObjectSQL * objsql) { if (Nebula::instance().is_federation_slave()) { std::string tmpl_xml; Client * client = Client::client(); xmlrpc_c::value result; vector<xmlrpc_c::value> values; std::ostringstream oss("Cannot update marketapp at federation master: ", std::ios::ate); try { client->call("one.marketapp.updatedb", "is", &result, objsql->get_oid(), objsql->to_xml(tmpl_xml).c_str()); } catch (exception const& e) { oss << e.what(); NebulaLog::log("MKP", Log::ERROR, oss); return -1; } values = xmlrpc_c::value_array(result).vectorValueValue(); if ( xmlrpc_c::value_boolean(values[0]) == false ) { std::string error = xmlrpc_c::value_string(values[1]); oss << error; NebulaLog::log("MKP", Log::ERROR, oss); return -1; } return 0; } return PoolSQL::update(objsql); } /* -------------------------------------------------------------------------- */ /* -------------------------------------------------------------------------- */ const int MarketPlaceAppPool::MAX_MISSING_MONITORS = 3; bool MarketPlaceAppPool::test_map_check(int app_id) { auto it = map_check.find(app_id); if ( it == map_check.end() ) { map_check.insert(make_pair(app_id, 1)); return false; } it->second++; bool to_delete = it->second >= MAX_MISSING_MONITORS; if ( to_delete ) { map_check.erase(it); } return to_delete; } void MarketPlaceAppPool::reset_map_check(int app_id) { auto it = map_check.find(app_id); if ( it == map_check.end() ) { map_check.insert(make_pair(app_id, -1)); } else { it->second = -1; } }
{ "pile_set_name": "Github" }
Gibraltar is a British overseas territory. Contact the Gibraltar Government to find out about getting married there, including what documents youโ€™ll need. $A Civil Status and Registration Office Government of Gibraltar Secretaryโ€™s Lane Gibraltar $A $C **Telephone**: +350 200 72289\\ **E-mail**: <marriages.csro@gibraltar.gov.gi> $C
{ "pile_set_name": "Github" }
๏ปฟ<?xml version="1.0" encoding="utf-8"?> <packages> <package id="Should" version="1.1.20" targetFramework="net452" /> <package id="xunit" version="2.1.0" targetFramework="net452" /> <package id="xunit.abstractions" version="2.0.0" targetFramework="net452" /> <package id="xunit.assert" version="2.1.0" targetFramework="net452" /> <package id="xunit.core" version="2.1.0" targetFramework="net452" /> <package id="xunit.extensibility.core" version="2.1.0" targetFramework="net452" /> <package id="xunit.extensibility.execution" version="2.1.0" targetFramework="net452" /> </packages>
{ "pile_set_name": "Github" }
// CodeMirror, copyright (c) by Marijn Haverbeke and others // Distributed under an MIT license: http://codemirror.net/LICENSE (function(mod) { if (typeof exports == "object" && typeof module == "object") // CommonJS mod(require("../../lib/codemirror")); else if (typeof define == "function" && define.amd) // AMD define(["../../lib/codemirror"], mod); else // Plain browser env mod(CodeMirror); })(function(CodeMirror) { "use strict"; CodeMirror.defineMode("css", function(config, parserConfig) { if (!parserConfig.propertyKeywords) parserConfig = CodeMirror.resolveMode("text/css"); var indentUnit = config.indentUnit, tokenHooks = parserConfig.tokenHooks, documentTypes = parserConfig.documentTypes || {}, mediaTypes = parserConfig.mediaTypes || {}, mediaFeatures = parserConfig.mediaFeatures || {}, propertyKeywords = parserConfig.propertyKeywords || {}, nonStandardPropertyKeywords = parserConfig.nonStandardPropertyKeywords || {}, fontProperties = parserConfig.fontProperties || {}, counterDescriptors = parserConfig.counterDescriptors || {}, colorKeywords = parserConfig.colorKeywords || {}, valueKeywords = parserConfig.valueKeywords || {}, allowNested = parserConfig.allowNested; var type, override; function ret(style, tp) { type = tp; return style; } // Tokenizers function tokenBase(stream, state) { var ch = stream.next(); if (tokenHooks[ch]) { var result = tokenHooks[ch](stream, state); if (result !== false) return result; } if (ch == "@") { stream.eatWhile(/[\w\\\-]/); return ret("def", stream.current()); } else if (ch == "=" || (ch == "~" || ch == "|") && stream.eat("=")) { return ret(null, "compare"); } else if (ch == "\"" || ch == "'") { state.tokenize = tokenString(ch); return state.tokenize(stream, state); } else if (ch == "#") { stream.eatWhile(/[\w\\\-]/); return ret("atom", "hash"); } else if (ch == "!") { stream.match(/^\s*\w*/); return ret("keyword", "important"); } else if (/\d/.test(ch) || ch == "." && stream.eat(/\d/)) { stream.eatWhile(/[\w.%]/); return ret("number", "unit"); } else if (ch === "-") { if (/[\d.]/.test(stream.peek())) { stream.eatWhile(/[\w.%]/); return ret("number", "unit"); } else if (stream.match(/^-[\w\\\-]+/)) { stream.eatWhile(/[\w\\\-]/); if (stream.match(/^\s*:/, false)) return ret("variable-2", "variable-definition"); return ret("variable-2", "variable"); } else if (stream.match(/^\w+-/)) { return ret("meta", "meta"); } } else if (/[,+>*\/]/.test(ch)) { return ret(null, "select-op"); } else if (ch == "." && stream.match(/^-?[_a-z][_a-z0-9-]*/i)) { return ret("qualifier", "qualifier"); } else if (/[:;{}\[\]\(\)]/.test(ch)) { return ret(null, ch); } else if ((ch == "u" && stream.match(/rl(-prefix)?\(/)) || (ch == "d" && stream.match("omain(")) || (ch == "r" && stream.match("egexp("))) { stream.backUp(1); state.tokenize = tokenParenthesized; return ret("property", "word"); } else if (/[\w\\\-]/.test(ch)) { stream.eatWhile(/[\w\\\-]/); return ret("property", "word"); } else { return ret(null, null); } } function tokenString(quote) { return function(stream, state) { var escaped = false, ch; while ((ch = stream.next()) != null) { if (ch == quote && !escaped) { if (quote == ")") stream.backUp(1); break; } escaped = !escaped && ch == "\\"; } if (ch == quote || !escaped && quote != ")") state.tokenize = null; return ret("string", "string"); }; } function tokenParenthesized(stream, state) { stream.next(); // Must be '(' if (!stream.match(/\s*[\"\')]/, false)) state.tokenize = tokenString(")"); else state.tokenize = null; return ret(null, "("); } // Context management function Context(type, indent, prev) { this.type = type; this.indent = indent; this.prev = prev; } function pushContext(state, stream, type) { state.context = new Context(type, stream.indentation() + indentUnit, state.context); return type; } function popContext(state) { state.context = state.context.prev; return state.context.type; } function pass(type, stream, state) { return states[state.context.type](type, stream, state); } function popAndPass(type, stream, state, n) { for (var i = n || 1; i > 0; i--) state.context = state.context.prev; return pass(type, stream, state); } // Parser function wordAsValue(stream) { var word = stream.current().toLowerCase(); if (valueKeywords.hasOwnProperty(word)) override = "atom"; else if (colorKeywords.hasOwnProperty(word)) override = "keyword"; else override = "variable"; } var states = {}; states.top = function(type, stream, state) { if (type == "{") { return pushContext(state, stream, "block"); } else if (type == "}" && state.context.prev) { return popContext(state); } else if (/@(media|supports|(-moz-)?document)/.test(type)) { return pushContext(state, stream, "atBlock"); } else if (/@(font-face|counter-style)/.test(type)) { state.stateArg = type; return "restricted_atBlock_before"; } else if (/^@(-(moz|ms|o|webkit)-)?keyframes$/.test(type)) { return "keyframes"; } else if (type && type.charAt(0) == "@") { return pushContext(state, stream, "at"); } else if (type == "hash") { override = "builtin"; } else if (type == "word") { override = "tag"; } else if (type == "variable-definition") { return "maybeprop"; } else if (type == "interpolation") { return pushContext(state, stream, "interpolation"); } else if (type == ":") { return "pseudo"; } else if (allowNested && type == "(") { return pushContext(state, stream, "parens"); } return state.context.type; }; states.block = function(type, stream, state) { if (type == "word") { var word = stream.current().toLowerCase(); if (propertyKeywords.hasOwnProperty(word)) { override = "property"; return "maybeprop"; } else if (nonStandardPropertyKeywords.hasOwnProperty(word)) { override = "string-2"; return "maybeprop"; } else if (allowNested) { override = stream.match(/^\s*:(?:\s|$)/, false) ? "property" : "tag"; return "block"; } else { override += " error"; return "maybeprop"; } } else if (type == "meta") { return "block"; } else if (!allowNested && (type == "hash" || type == "qualifier")) { override = "error"; return "block"; } else { return states.top(type, stream, state); } }; states.maybeprop = function(type, stream, state) { if (type == ":") return pushContext(state, stream, "prop"); return pass(type, stream, state); }; states.prop = function(type, stream, state) { if (type == ";") return popContext(state); if (type == "{" && allowNested) return pushContext(state, stream, "propBlock"); if (type == "}" || type == "{") return popAndPass(type, stream, state); if (type == "(") return pushContext(state, stream, "parens"); if (type == "hash" && !/^#([0-9a-fA-f]{3}|[0-9a-fA-f]{6})$/.test(stream.current())) { override += " error"; } else if (type == "word") { wordAsValue(stream); } else if (type == "interpolation") { return pushContext(state, stream, "interpolation"); } return "prop"; }; states.propBlock = function(type, _stream, state) { if (type == "}") return popContext(state); if (type == "word") { override = "property"; return "maybeprop"; } return state.context.type; }; states.parens = function(type, stream, state) { if (type == "{" || type == "}") return popAndPass(type, stream, state); if (type == ")") return popContext(state); if (type == "(") return pushContext(state, stream, "parens"); if (type == "interpolation") return pushContext(state, stream, "interpolation"); if (type == "word") wordAsValue(stream); return "parens"; }; states.pseudo = function(type, stream, state) { if (type == "word") { override = "variable-3"; return state.context.type; } return pass(type, stream, state); }; states.atBlock = function(type, stream, state) { if (type == "(") return pushContext(state, stream, "atBlock_parens"); if (type == "}") return popAndPass(type, stream, state); if (type == "{") return popContext(state) && pushContext(state, stream, allowNested ? "block" : "top"); if (type == "word") { var word = stream.current().toLowerCase(); if (word == "only" || word == "not" || word == "and" || word == "or") override = "keyword"; else if (documentTypes.hasOwnProperty(word)) override = "tag"; else if (mediaTypes.hasOwnProperty(word)) override = "attribute"; else if (mediaFeatures.hasOwnProperty(word)) override = "property"; else if (propertyKeywords.hasOwnProperty(word)) override = "property"; else if (nonStandardPropertyKeywords.hasOwnProperty(word)) override = "string-2"; else if (valueKeywords.hasOwnProperty(word)) override = "atom"; else override = "error"; } return state.context.type; }; states.atBlock_parens = function(type, stream, state) { if (type == ")") return popContext(state); if (type == "{" || type == "}") return popAndPass(type, stream, state, 2); return states.atBlock(type, stream, state); }; states.restricted_atBlock_before = function(type, stream, state) { if (type == "{") return pushContext(state, stream, "restricted_atBlock"); if (type == "word" && state.stateArg == "@counter-style") { override = "variable"; return "restricted_atBlock_before"; } return pass(type, stream, state); }; states.restricted_atBlock = function(type, stream, state) { if (type == "}") { state.stateArg = null; return popContext(state); } if (type == "word") { if ((state.stateArg == "@font-face" && !fontProperties.hasOwnProperty(stream.current().toLowerCase())) || (state.stateArg == "@counter-style" && !counterDescriptors.hasOwnProperty(stream.current().toLowerCase()))) override = "error"; else override = "property"; return "maybeprop"; } return "restricted_atBlock"; }; states.keyframes = function(type, stream, state) { if (type == "word") { override = "variable"; return "keyframes"; } if (type == "{") return pushContext(state, stream, "top"); return pass(type, stream, state); }; states.at = function(type, stream, state) { if (type == ";") return popContext(state); if (type == "{" || type == "}") return popAndPass(type, stream, state); if (type == "word") override = "tag"; else if (type == "hash") override = "builtin"; return "at"; }; states.interpolation = function(type, stream, state) { if (type == "}") return popContext(state); if (type == "{" || type == ";") return popAndPass(type, stream, state); if (type != "variable") override = "error"; return "interpolation"; }; return { startState: function(base) { return {tokenize: null, state: "top", stateArg: null, context: new Context("top", base || 0, null)}; }, token: function(stream, state) { if (!state.tokenize && stream.eatSpace()) return null; var style = (state.tokenize || tokenBase)(stream, state); if (style && typeof style == "object") { type = style[1]; style = style[0]; } override = style; state.state = states[state.state](type, stream, state); return override; }, indent: function(state, textAfter) { var cx = state.context, ch = textAfter && textAfter.charAt(0); var indent = cx.indent; if (cx.type == "prop" && (ch == "}" || ch == ")")) cx = cx.prev; if (cx.prev && (ch == "}" && (cx.type == "block" || cx.type == "top" || cx.type == "interpolation" || cx.type == "restricted_atBlock") || ch == ")" && (cx.type == "parens" || cx.type == "atBlock_parens") || ch == "{" && (cx.type == "at" || cx.type == "atBlock"))) { indent = cx.indent - indentUnit; cx = cx.prev; } return indent; }, electricChars: "}", blockCommentStart: "/*", blockCommentEnd: "*/", fold: "brace" }; }); function keySet(array) { var keys = {}; for (var i = 0; i < array.length; ++i) { keys[array[i]] = true; } return keys; } var documentTypes_ = [ "domain", "regexp", "url", "url-prefix" ], documentTypes = keySet(documentTypes_); var mediaTypes_ = [ "all", "aural", "braille", "handheld", "print", "projection", "screen", "tty", "tv", "embossed" ], mediaTypes = keySet(mediaTypes_); var mediaFeatures_ = [ "width", "min-width", "max-width", "height", "min-height", "max-height", "device-width", "min-device-width", "max-device-width", "device-height", "min-device-height", "max-device-height", "aspect-ratio", "min-aspect-ratio", "max-aspect-ratio", "device-aspect-ratio", "min-device-aspect-ratio", "max-device-aspect-ratio", "color", "min-color", "max-color", "color-index", "min-color-index", "max-color-index", "monochrome", "min-monochrome", "max-monochrome", "resolution", "min-resolution", "max-resolution", "scan", "grid" ], mediaFeatures = keySet(mediaFeatures_); var propertyKeywords_ = [ "align-content", "align-items", "align-self", "alignment-adjust", "alignment-baseline", "anchor-point", "animation", "animation-delay", "animation-direction", "animation-duration", "animation-fill-mode", "animation-iteration-count", "animation-name", "animation-play-state", "animation-timing-function", "appearance", "azimuth", "backface-visibility", "background", "background-attachment", "background-clip", "background-color", "background-image", "background-origin", "background-position", "background-repeat", "background-size", "baseline-shift", "binding", "bleed", "bookmark-label", "bookmark-level", "bookmark-state", "bookmark-target", "border", "border-bottom", "border-bottom-color", "border-bottom-left-radius", "border-bottom-right-radius", "border-bottom-style", "border-bottom-width", "border-collapse", "border-color", "border-image", "border-image-outset", "border-image-repeat", "border-image-slice", "border-image-source", "border-image-width", "border-left", "border-left-color", "border-left-style", "border-left-width", "border-radius", "border-right", "border-right-color", "border-right-style", "border-right-width", "border-spacing", "border-style", "border-top", "border-top-color", "border-top-left-radius", "border-top-right-radius", "border-top-style", "border-top-width", "border-width", "bottom", "box-decoration-break", "box-shadow", "box-sizing", "break-after", "break-before", "break-inside", "caption-side", "clear", "clip", "color", "color-profile", "column-count", "column-fill", "column-gap", "column-rule", "column-rule-color", "column-rule-style", "column-rule-width", "column-span", "column-width", "columns", "content", "counter-increment", "counter-reset", "crop", "cue", "cue-after", "cue-before", "cursor", "direction", "display", "dominant-baseline", "drop-initial-after-adjust", "drop-initial-after-align", "drop-initial-before-adjust", "drop-initial-before-align", "drop-initial-size", "drop-initial-value", "elevation", "empty-cells", "fit", "fit-position", "flex", "flex-basis", "flex-direction", "flex-flow", "flex-grow", "flex-shrink", "flex-wrap", "float", "float-offset", "flow-from", "flow-into", "font", "font-feature-settings", "font-family", "font-kerning", "font-language-override", "font-size", "font-size-adjust", "font-stretch", "font-style", "font-synthesis", "font-variant", "font-variant-alternates", "font-variant-caps", "font-variant-east-asian", "font-variant-ligatures", "font-variant-numeric", "font-variant-position", "font-weight", "grid", "grid-area", "grid-auto-columns", "grid-auto-flow", "grid-auto-position", "grid-auto-rows", "grid-column", "grid-column-end", "grid-column-start", "grid-row", "grid-row-end", "grid-row-start", "grid-template", "grid-template-areas", "grid-template-columns", "grid-template-rows", "hanging-punctuation", "height", "hyphens", "icon", "image-orientation", "image-rendering", "image-resolution", "inline-box-align", "justify-content", "left", "letter-spacing", "line-break", "line-height", "line-stacking", "line-stacking-ruby", "line-stacking-shift", "line-stacking-strategy", "list-style", "list-style-image", "list-style-position", "list-style-type", "margin", "margin-bottom", "margin-left", "margin-right", "margin-top", "marker-offset", "marks", "marquee-direction", "marquee-loop", "marquee-play-count", "marquee-speed", "marquee-style", "max-height", "max-width", "min-height", "min-width", "move-to", "nav-down", "nav-index", "nav-left", "nav-right", "nav-up", "object-fit", "object-position", "opacity", "order", "orphans", "outline", "outline-color", "outline-offset", "outline-style", "outline-width", "overflow", "overflow-style", "overflow-wrap", "overflow-x", "overflow-y", "padding", "padding-bottom", "padding-left", "padding-right", "padding-top", "page", "page-break-after", "page-break-before", "page-break-inside", "page-policy", "pause", "pause-after", "pause-before", "perspective", "perspective-origin", "pitch", "pitch-range", "play-during", "position", "presentation-level", "punctuation-trim", "quotes", "region-break-after", "region-break-before", "region-break-inside", "region-fragment", "rendering-intent", "resize", "rest", "rest-after", "rest-before", "richness", "right", "rotation", "rotation-point", "ruby-align", "ruby-overhang", "ruby-position", "ruby-span", "shape-image-threshold", "shape-inside", "shape-margin", "shape-outside", "size", "speak", "speak-as", "speak-header", "speak-numeral", "speak-punctuation", "speech-rate", "stress", "string-set", "tab-size", "table-layout", "target", "target-name", "target-new", "target-position", "text-align", "text-align-last", "text-decoration", "text-decoration-color", "text-decoration-line", "text-decoration-skip", "text-decoration-style", "text-emphasis", "text-emphasis-color", "text-emphasis-position", "text-emphasis-style", "text-height", "text-indent", "text-justify", "text-outline", "text-overflow", "text-shadow", "text-size-adjust", "text-space-collapse", "text-transform", "text-underline-position", "text-wrap", "top", "transform", "transform-origin", "transform-style", "transition", "transition-delay", "transition-duration", "transition-property", "transition-timing-function", "unicode-bidi", "vertical-align", "visibility", "voice-balance", "voice-duration", "voice-family", "voice-pitch", "voice-range", "voice-rate", "voice-stress", "voice-volume", "volume", "white-space", "widows", "width", "word-break", "word-spacing", "word-wrap", "z-index", // SVG-specific "clip-path", "clip-rule", "mask", "enable-background", "filter", "flood-color", "flood-opacity", "lighting-color", "stop-color", "stop-opacity", "pointer-events", "color-interpolation", "color-interpolation-filters", "color-rendering", "fill", "fill-opacity", "fill-rule", "image-rendering", "marker", "marker-end", "marker-mid", "marker-start", "shape-rendering", "stroke", "stroke-dasharray", "stroke-dashoffset", "stroke-linecap", "stroke-linejoin", "stroke-miterlimit", "stroke-opacity", "stroke-width", "text-rendering", "baseline-shift", "dominant-baseline", "glyph-orientation-horizontal", "glyph-orientation-vertical", "text-anchor", "writing-mode" ], propertyKeywords = keySet(propertyKeywords_); var nonStandardPropertyKeywords_ = [ "scrollbar-arrow-color", "scrollbar-base-color", "scrollbar-dark-shadow-color", "scrollbar-face-color", "scrollbar-highlight-color", "scrollbar-shadow-color", "scrollbar-3d-light-color", "scrollbar-track-color", "shape-inside", "searchfield-cancel-button", "searchfield-decoration", "searchfield-results-button", "searchfield-results-decoration", "zoom" ], nonStandardPropertyKeywords = keySet(nonStandardPropertyKeywords_); var fontProperties_ = [ "font-family", "src", "unicode-range", "font-variant", "font-feature-settings", "font-stretch", "font-weight", "font-style" ], fontProperties = keySet(fontProperties_); var counterDescriptors_ = [ "additive-symbols", "fallback", "negative", "pad", "prefix", "range", "speak-as", "suffix", "symbols", "system" ], counterDescriptors = keySet(counterDescriptors_); var colorKeywords_ = [ "aliceblue", "antiquewhite", "aqua", "aquamarine", "azure", "beige", "bisque", "black", "blanchedalmond", "blue", "blueviolet", "brown", "burlywood", "cadetblue", "chartreuse", "chocolate", "coral", "cornflowerblue", "cornsilk", "crimson", "cyan", "darkblue", "darkcyan", "darkgoldenrod", "darkgray", "darkgreen", "darkkhaki", "darkmagenta", "darkolivegreen", "darkorange", "darkorchid", "darkred", "darksalmon", "darkseagreen", "darkslateblue", "darkslategray", "darkturquoise", "darkviolet", "deeppink", "deepskyblue", "dimgray", "dodgerblue", "firebrick", "floralwhite", "forestgreen", "fuchsia", "gainsboro", "ghostwhite", "gold", "goldenrod", "gray", "grey", "green", "greenyellow", "honeydew", "hotpink", "indianred", "indigo", "ivory", "khaki", "lavender", "lavenderblush", "lawngreen", "lemonchiffon", "lightblue", "lightcoral", "lightcyan", "lightgoldenrodyellow", "lightgray", "lightgreen", "lightpink", "lightsalmon", "lightseagreen", "lightskyblue", "lightslategray", "lightsteelblue", "lightyellow", "lime", "limegreen", "linen", "magenta", "maroon", "mediumaquamarine", "mediumblue", "mediumorchid", "mediumpurple", "mediumseagreen", "mediumslateblue", "mediumspringgreen", "mediumturquoise", "mediumvioletred", "midnightblue", "mintcream", "mistyrose", "moccasin", "navajowhite", "navy", "oldlace", "olive", "olivedrab", "orange", "orangered", "orchid", "palegoldenrod", "palegreen", "paleturquoise", "palevioletred", "papayawhip", "peachpuff", "peru", "pink", "plum", "powderblue", "purple", "rebeccapurple", "red", "rosybrown", "royalblue", "saddlebrown", "salmon", "sandybrown", "seagreen", "seashell", "sienna", "silver", "skyblue", "slateblue", "slategray", "snow", "springgreen", "steelblue", "tan", "teal", "thistle", "tomato", "turquoise", "violet", "wheat", "white", "whitesmoke", "yellow", "yellowgreen" ], colorKeywords = keySet(colorKeywords_); var valueKeywords_ = [ "above", "absolute", "activeborder", "additive", "activecaption", "afar", "after-white-space", "ahead", "alias", "all", "all-scroll", "alphabetic", "alternate", "always", "amharic", "amharic-abegede", "antialiased", "appworkspace", "arabic-indic", "armenian", "asterisks", "attr", "auto", "avoid", "avoid-column", "avoid-page", "avoid-region", "background", "backwards", "baseline", "below", "bidi-override", "binary", "bengali", "blink", "block", "block-axis", "bold", "bolder", "border", "border-box", "both", "bottom", "break", "break-all", "break-word", "bullets", "button", "button-bevel", "buttonface", "buttonhighlight", "buttonshadow", "buttontext", "calc", "cambodian", "capitalize", "caps-lock-indicator", "caption", "captiontext", "caret", "cell", "center", "checkbox", "circle", "cjk-decimal", "cjk-earthly-branch", "cjk-heavenly-stem", "cjk-ideographic", "clear", "clip", "close-quote", "col-resize", "collapse", "column", "compact", "condensed", "contain", "content", "content-box", "context-menu", "continuous", "copy", "counter", "counters", "cover", "crop", "cross", "crosshair", "currentcolor", "cursive", "cyclic", "dashed", "decimal", "decimal-leading-zero", "default", "default-button", "destination-atop", "destination-in", "destination-out", "destination-over", "devanagari", "disc", "discard", "disclosure-closed", "disclosure-open", "document", "dot-dash", "dot-dot-dash", "dotted", "double", "down", "e-resize", "ease", "ease-in", "ease-in-out", "ease-out", "element", "ellipse", "ellipsis", "embed", "end", "ethiopic", "ethiopic-abegede", "ethiopic-abegede-am-et", "ethiopic-abegede-gez", "ethiopic-abegede-ti-er", "ethiopic-abegede-ti-et", "ethiopic-halehame-aa-er", "ethiopic-halehame-aa-et", "ethiopic-halehame-am-et", "ethiopic-halehame-gez", "ethiopic-halehame-om-et", "ethiopic-halehame-sid-et", "ethiopic-halehame-so-et", "ethiopic-halehame-ti-er", "ethiopic-halehame-ti-et", "ethiopic-halehame-tig", "ethiopic-numeric", "ew-resize", "expanded", "extends", "extra-condensed", "extra-expanded", "fantasy", "fast", "fill", "fixed", "flat", "flex", "footnotes", "forwards", "from", "geometricPrecision", "georgian", "graytext", "groove", "gujarati", "gurmukhi", "hand", "hangul", "hangul-consonant", "hebrew", "help", "hidden", "hide", "higher", "highlight", "highlighttext", "hiragana", "hiragana-iroha", "horizontal", "hsl", "hsla", "icon", "ignore", "inactiveborder", "inactivecaption", "inactivecaptiontext", "infinite", "infobackground", "infotext", "inherit", "initial", "inline", "inline-axis", "inline-block", "inline-flex", "inline-table", "inset", "inside", "intrinsic", "invert", "italic", "japanese-formal", "japanese-informal", "justify", "kannada", "katakana", "katakana-iroha", "keep-all", "khmer", "korean-hangul-formal", "korean-hanja-formal", "korean-hanja-informal", "landscape", "lao", "large", "larger", "left", "level", "lighter", "line-through", "linear", "linear-gradient", "lines", "list-item", "listbox", "listitem", "local", "logical", "loud", "lower", "lower-alpha", "lower-armenian", "lower-greek", "lower-hexadecimal", "lower-latin", "lower-norwegian", "lower-roman", "lowercase", "ltr", "malayalam", "match", "matrix", "matrix3d", "media-controls-background", "media-current-time-display", "media-fullscreen-button", "media-mute-button", "media-play-button", "media-return-to-realtime-button", "media-rewind-button", "media-seek-back-button", "media-seek-forward-button", "media-slider", "media-sliderthumb", "media-time-remaining-display", "media-volume-slider", "media-volume-slider-container", "media-volume-sliderthumb", "medium", "menu", "menulist", "menulist-button", "menulist-text", "menulist-textfield", "menutext", "message-box", "middle", "min-intrinsic", "mix", "mongolian", "monospace", "move", "multiple", "myanmar", "n-resize", "narrower", "ne-resize", "nesw-resize", "no-close-quote", "no-drop", "no-open-quote", "no-repeat", "none", "normal", "not-allowed", "nowrap", "ns-resize", "numbers", "numeric", "nw-resize", "nwse-resize", "oblique", "octal", "open-quote", "optimizeLegibility", "optimizeSpeed", "oriya", "oromo", "outset", "outside", "outside-shape", "overlay", "overline", "padding", "padding-box", "painted", "page", "paused", "persian", "perspective", "plus-darker", "plus-lighter", "pointer", "polygon", "portrait", "pre", "pre-line", "pre-wrap", "preserve-3d", "progress", "push-button", "radial-gradient", "radio", "read-only", "read-write", "read-write-plaintext-only", "rectangle", "region", "relative", "repeat", "repeating-linear-gradient", "repeating-radial-gradient", "repeat-x", "repeat-y", "reset", "reverse", "rgb", "rgba", "ridge", "right", "rotate", "rotate3d", "rotateX", "rotateY", "rotateZ", "round", "row-resize", "rtl", "run-in", "running", "s-resize", "sans-serif", "scale", "scale3d", "scaleX", "scaleY", "scaleZ", "scroll", "scrollbar", "se-resize", "searchfield", "searchfield-cancel-button", "searchfield-decoration", "searchfield-results-button", "searchfield-results-decoration", "semi-condensed", "semi-expanded", "separate", "serif", "show", "sidama", "simp-chinese-formal", "simp-chinese-informal", "single", "skew", "skewX", "skewY", "skip-white-space", "slide", "slider-horizontal", "slider-vertical", "sliderthumb-horizontal", "sliderthumb-vertical", "slow", "small", "small-caps", "small-caption", "smaller", "solid", "somali", "source-atop", "source-in", "source-out", "source-over", "space", "spell-out", "square", "square-button", "start", "static", "status-bar", "stretch", "stroke", "sub", "subpixel-antialiased", "super", "sw-resize", "symbolic", "symbols", "table", "table-caption", "table-cell", "table-column", "table-column-group", "table-footer-group", "table-header-group", "table-row", "table-row-group", "tamil", "telugu", "text", "text-bottom", "text-top", "textarea", "textfield", "thai", "thick", "thin", "threeddarkshadow", "threedface", "threedhighlight", "threedlightshadow", "threedshadow", "tibetan", "tigre", "tigrinya-er", "tigrinya-er-abegede", "tigrinya-et", "tigrinya-et-abegede", "to", "top", "trad-chinese-formal", "trad-chinese-informal", "translate", "translate3d", "translateX", "translateY", "translateZ", "transparent", "ultra-condensed", "ultra-expanded", "underline", "up", "upper-alpha", "upper-armenian", "upper-greek", "upper-hexadecimal", "upper-latin", "upper-norwegian", "upper-roman", "uppercase", "urdu", "url", "var", "vertical", "vertical-text", "visible", "visibleFill", "visiblePainted", "visibleStroke", "visual", "w-resize", "wait", "wave", "wider", "window", "windowframe", "windowtext", "words", "x-large", "x-small", "xor", "xx-large", "xx-small" ], valueKeywords = keySet(valueKeywords_); var allWords = documentTypes_.concat(mediaTypes_).concat(mediaFeatures_).concat(propertyKeywords_) .concat(nonStandardPropertyKeywords_).concat(colorKeywords_).concat(valueKeywords_); CodeMirror.registerHelper("hintWords", "css", allWords); function tokenCComment(stream, state) { var maybeEnd = false, ch; while ((ch = stream.next()) != null) { if (maybeEnd && ch == "/") { state.tokenize = null; break; } maybeEnd = (ch == "*"); } return ["comment", "comment"]; } function tokenSGMLComment(stream, state) { if (stream.skipTo("-->")) { stream.match("-->"); state.tokenize = null; } else { stream.skipToEnd(); } return ["comment", "comment"]; } CodeMirror.defineMIME("text/css", { documentTypes: documentTypes, mediaTypes: mediaTypes, mediaFeatures: mediaFeatures, propertyKeywords: propertyKeywords, nonStandardPropertyKeywords: nonStandardPropertyKeywords, fontProperties: fontProperties, counterDescriptors: counterDescriptors, colorKeywords: colorKeywords, valueKeywords: valueKeywords, tokenHooks: { "<": function(stream, state) { if (!stream.match("!--")) return false; state.tokenize = tokenSGMLComment; return tokenSGMLComment(stream, state); }, "/": function(stream, state) { if (!stream.eat("*")) return false; state.tokenize = tokenCComment; return tokenCComment(stream, state); } }, name: "css" }); CodeMirror.defineMIME("text/x-scss", { mediaTypes: mediaTypes, mediaFeatures: mediaFeatures, propertyKeywords: propertyKeywords, nonStandardPropertyKeywords: nonStandardPropertyKeywords, colorKeywords: colorKeywords, valueKeywords: valueKeywords, fontProperties: fontProperties, allowNested: true, tokenHooks: { "/": function(stream, state) { if (stream.eat("/")) { stream.skipToEnd(); return ["comment", "comment"]; } else if (stream.eat("*")) { state.tokenize = tokenCComment; return tokenCComment(stream, state); } else { return ["operator", "operator"]; } }, ":": function(stream) { if (stream.match(/\s*\{/)) return [null, "{"]; return false; }, "$": function(stream) { stream.match(/^[\w-]+/); if (stream.match(/^\s*:/, false)) return ["variable-2", "variable-definition"]; return ["variable-2", "variable"]; }, "#": function(stream) { if (!stream.eat("{")) return false; return [null, "interpolation"]; } }, name: "css", helperType: "scss" }); CodeMirror.defineMIME("text/x-less", { mediaTypes: mediaTypes, mediaFeatures: mediaFeatures, propertyKeywords: propertyKeywords, nonStandardPropertyKeywords: nonStandardPropertyKeywords, colorKeywords: colorKeywords, valueKeywords: valueKeywords, fontProperties: fontProperties, allowNested: true, tokenHooks: { "/": function(stream, state) { if (stream.eat("/")) { stream.skipToEnd(); return ["comment", "comment"]; } else if (stream.eat("*")) { state.tokenize = tokenCComment; return tokenCComment(stream, state); } else { return ["operator", "operator"]; } }, "@": function(stream) { if (stream.match(/^(charset|document|font-face|import|(-(moz|ms|o|webkit)-)?keyframes|media|namespace|page|supports)\b/, false)) return false; stream.eatWhile(/[\w\\\-]/); if (stream.match(/^\s*:/, false)) return ["variable-2", "variable-definition"]; return ["variable-2", "variable"]; }, "&": function() { return ["atom", "atom"]; } }, name: "css", helperType: "less" }); });
{ "pile_set_name": "Github" }
<?php /* * This file is part of the symfony package. * (c) 2004-2006 Fabien Potencier <fabien.potencier@symfony-project.com> * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ /** * sfCompareValidator checks the equality of two different request parameters. * * passwordValidator: * class: sfCompareValidator * param: * check: password2 * compare_error: The passwords you entered do not match. Please try again. * * @package symfony * @subpackage validator * @author Fabien Potencier <fabien.potencier@symfony-project.com> * @version SVN: $Id: sfCompareValidator.class.php 3233 2007-01-11 21:01:08Z fabien $ */ class sfCompareValidator extends sfValidator { /** * Executes this validator. * * @param mixed A file or parameter value/array * @param error An error message reference * * @return bool true, if this validator executes successfully, otherwise false */ public function execute(&$value, &$error) { $check_param = $this->getParameterHolder()->get('check'); $check_value = $this->getContext()->getRequest()->getParameter($check_param); if ($value !== $check_value) { $error = $this->getParameterHolder()->get('compare_error'); return false; } return true; } public function initialize($context, $parameters = null) { // initialize parent parent::initialize($context); // set defaults $this->getParameterHolder()->set('compare_error', 'Invalid input'); $this->getParameterHolder()->add($parameters); return true; } }
{ "pile_set_name": "Github" }
import caffe.proto.caffe_pb2 as caffe_pb2 from google.protobuf.text_format import Merge import argparse if __name__ == '__main__': parser = argparse.ArgumentParser() parser.add_argument('source_prototxt') parser.add_argument('target_prototxt') args = parser.parse_args() net = caffe_pb2.NetParameter() Merge(open(args.source_prototxt, 'r').read(), net) for layer in net.layer: if layer.type == "Convolution": if layer.convolution_param.group !=1: layer.type = "DepthwiseConvolution" with open(args.target_prototxt, 'w') as tf: tf.write(str(net))
{ "pile_set_name": "Github" }
#include "meta.h" #include "../util.h" /* BGW (FF XI) */ VGMSTREAM * init_vgmstream_bgw(STREAMFILE *streamFile) { VGMSTREAM * vgmstream = NULL; char filename[260]; off_t start_offset; int32_t loop_start; int loop_flag = 0; int channel_count; /* check extension, case insensitive */ streamFile->get_name(streamFile,filename,sizeof(filename)); if (strcasecmp("bgw",filename_extension(filename))) goto fail; /* "BGMStream" */ if (read_32bitBE(0,streamFile) != 0x42474d53 || read_32bitBE(4,streamFile) != 0x74726561 || read_32bitBE(8,streamFile) != 0x6d000000 || read_32bitBE(12,streamFile) != 0) goto fail; /* check file size with header value */ if (read_32bitLE(0x10,streamFile) != get_streamfile_size(streamFile)) goto fail; channel_count = read_8bit(0x2e,streamFile); loop_start = read_32bitLE(0x1c,streamFile); loop_flag = (loop_start > 0); /* build the VGMSTREAM */ vgmstream = allocate_vgmstream(channel_count,loop_flag); if (!vgmstream) goto fail; /* fill in the vital statistics */ start_offset = read_32bitLE(0x28,streamFile); vgmstream->channels = channel_count; vgmstream->sample_rate = 44100; vgmstream->coding_type = coding_FFXI; vgmstream->num_samples = read_32bitLE(0x18,streamFile)*16; if (loop_flag) { vgmstream->loop_start_sample = (loop_start-1)*16; vgmstream->loop_end_sample = vgmstream->num_samples; } vgmstream->layout_type = layout_interleave; vgmstream->interleave_block_size = 9; vgmstream->meta_type = meta_FFXI_BGW; /* open the file for reading */ { int i; STREAMFILE * file; file = streamFile->open(streamFile,filename,STREAMFILE_DEFAULT_BUFFER_SIZE); if (!file) goto fail; for (i=0;i<channel_count;i++) { vgmstream->ch[i].streamfile = file; vgmstream->ch[i].channel_start_offset= vgmstream->ch[i].offset=start_offset+i*9; } } return vgmstream; /* clean up anything we may have opened */ fail: if (vgmstream) close_vgmstream(vgmstream); return NULL; } /* .spw (SEWave, PlayOnline viewer for FFXI), very similar to bgw */ VGMSTREAM * init_vgmstream_spw(STREAMFILE *streamFile) { VGMSTREAM * vgmstream = NULL; char filename[260]; off_t start_offset; int loop_flag = 0; int32_t loop_start; int channel_count; /* check extension, case insensitive */ streamFile->get_name(streamFile,filename,sizeof(filename)); if (strcasecmp("spw",filename_extension(filename))) goto fail; /* "SeWave" */ if (read_32bitBE(0,streamFile) != 0x53655761 || read_32bitBE(4,streamFile) != 0x76650000) goto fail; /* check file size with header value */ if (read_32bitLE(0x8,streamFile) != get_streamfile_size(streamFile)) goto fail; channel_count = read_8bit(0x2a,streamFile); loop_start = read_32bitLE(0x18,streamFile); loop_flag = (loop_start > 0); /* build the VGMSTREAM */ vgmstream = allocate_vgmstream(channel_count,loop_flag); if (!vgmstream) goto fail; /* fill in the vital statistics */ start_offset = read_32bitLE(0x24,streamFile); vgmstream->channels = channel_count; vgmstream->sample_rate = 44100; vgmstream->coding_type = coding_FFXI; vgmstream->num_samples = read_32bitLE(0x14,streamFile)*16; if (loop_flag) { vgmstream->loop_start_sample = (loop_start-1)*16; vgmstream->loop_end_sample = vgmstream->num_samples; } vgmstream->layout_type = layout_interleave; vgmstream->interleave_block_size = 9; vgmstream->meta_type = meta_FFXI_SPW; /* open the file for reading */ { int i; STREAMFILE * file; file = streamFile->open(streamFile,filename,STREAMFILE_DEFAULT_BUFFER_SIZE); if (!file) goto fail; for (i=0;i<channel_count;i++) { vgmstream->ch[i].streamfile = file; vgmstream->ch[i].channel_start_offset= vgmstream->ch[i].offset=start_offset+i*9; } } return vgmstream; /* clean up anything we may have opened */ fail: if (vgmstream) close_vgmstream(vgmstream); return NULL; }
{ "pile_set_name": "Github" }
/* eslint-disable functional/no-expression-statement, @typescript-eslint/naming-convention */ import test from 'ava'; import { AuthenticationProgramStateBCH, BytecodeGenerationResult, hexToBin, } from '../../lib'; import { expectCompilationResult, privkey, } from './compiler-bch.e2e.spec.helper'; test( '[BCH compiler] Key โ€“ ECDSA: use a private key', expectCompilationResult, '<owner.signature.all_outputs>', { keys: { privateKeys: { owner: privkey } } }, { bytecode: hexToBin( '473044022059e9ad8fabd511fa2ef6935dae6395d5d3ce93b929436c835c9c8372b353bd3d0220527c17e2e4ec12f7b8969a9bb80e58ab1a24e44c2e5512916d1bcb3fc4dc2f2241' ), success: true, }, { owner: { type: 'Key' }, } ); test( '[BCH compiler] Key โ€“ schnorr: use a private key', expectCompilationResult, '<owner.schnorr_signature.all_outputs>', { keys: { privateKeys: { owner: privkey } } }, { bytecode: hexToBin( '41313d8a853bd82f5fe251d6b04581333800001ee7680c5e4775db3afabf4873360b3481802d8d656cc608e4625d6568bf1a8801bb1efff19a8306267681177aed41' ), success: true, }, { owner: { type: 'Key' }, } ); test( '[BCH compiler] Key โ€“ derive a public key from a private key', expectCompilationResult, '<owner.public_key>', { keys: { privateKeys: { owner: privkey } } }, { bytecode: hexToBin( '210376ea9e36a75d2ecf9c93a0be76885e36f822529db22acfdc761c9b5b4544f5c5' ), success: true, }, { owner: { type: 'Key' }, } ); test( '[BCH compiler] Key โ€“ derive a public key: no secp256k1', expectCompilationResult, '<owner.public_key>', { keys: { privateKeys: { owner: privkey } } }, { errorType: 'resolve', errors: [ { error: 'Cannot resolve "owner.public_key" โ€“ the "secp256k1" property was not provided in the compilation environment.', range: { endColumn: 18, endLineNumber: 1, startColumn: 2, startLineNumber: 1, }, }, ], success: false, } as BytecodeGenerationResult<AuthenticationProgramStateBCH>, { owner: { type: 'Key' }, }, { secp256k1: undefined } ); test( '[BCH compiler] Key โ€“ use a provided public key (without secp256k1)', expectCompilationResult, '<owner.public_key>', { bytecode: { 'owner.public_key': hexToBin( '0376ea9e36a75d2ecf9c93a0be76885e36f822529db22acfdc761c9b5b4544f5c5' ), }, }, { bytecode: hexToBin( '210376ea9e36a75d2ecf9c93a0be76885e36f822529db22acfdc761c9b5b4544f5c5' ), success: true, }, { owner: { type: 'Key' }, }, { secp256k1: undefined } ); test( '[BCH compiler] Key โ€“ public_key: no matching public or private keys', expectCompilationResult, '<owner.public_key>', { bytecode: {}, keys: { privateKeys: {}, }, }, { errorType: 'resolve', errors: [ { error: 'Identifier "owner.public_key" refers to a public key, but no public or private keys for "owner" were provided in the compilation data.', missingIdentifier: 'owner.public_key', owningEntity: 'ownerEntityId', range: { endColumn: 18, endLineNumber: 1, startColumn: 2, startLineNumber: 1, }, }, ], success: false, } as BytecodeGenerationResult<AuthenticationProgramStateBCH>, { owner: { type: 'Key' }, } ); test( '[BCH compiler] Key โ€“ ECDSA: use a provided signature (without secp256k1)', expectCompilationResult, '<owner.signature.all_outputs>', { bytecode: { 'owner.signature.all_outputs': hexToBin( '3044022059e9ad8fabd511fa2ef6935dae6395d5d3ce93b929436c835c9c8372b353bd3d0220527c17e2e4ec12f7b8969a9bb80e58ab1a24e44c2e5512916d1bcb3fc4dc2f2241' ), }, keys: {}, }, { bytecode: hexToBin( '473044022059e9ad8fabd511fa2ef6935dae6395d5d3ce93b929436c835c9c8372b353bd3d0220527c17e2e4ec12f7b8969a9bb80e58ab1a24e44c2e5512916d1bcb3fc4dc2f2241' ), success: true, }, { owner: { type: 'Key' }, }, { secp256k1: undefined } ); test( '[BCH compiler] Key โ€“ schnorr: use a provided signature', expectCompilationResult, '<owner.schnorr_signature.all_outputs>', { bytecode: { 'owner.schnorr_signature.all_outputs': hexToBin( '313d8a853bd82f5fe251d6b04581333800001ee7680c5e4775db3afabf4873360b3481802d8d656cc608e4625d6568bf1a8801bb1efff19a8306267681177aed41' ), }, }, { bytecode: hexToBin( '41313d8a853bd82f5fe251d6b04581333800001ee7680c5e4775db3afabf4873360b3481802d8d656cc608e4625d6568bf1a8801bb1efff19a8306267681177aed41' ), success: true, }, { owner: { type: 'Key' }, } ); test( '[BCH compiler] Key โ€“ malformed identifier', expectCompilationResult, '<owner.signature>', { keys: { privateKeys: { owner: privkey } } }, { errorType: 'resolve', errors: [ { error: 'Invalid signature identifier. Signatures must be of the form: "[variable_id].signature.[signing_serialization_type]".', range: { endColumn: 17, endLineNumber: 1, startColumn: 2, startLineNumber: 1, }, }, ], success: false, } as BytecodeGenerationResult<AuthenticationProgramStateBCH>, { owner: { type: 'Key' }, } ); test( '[BCH compiler] Key โ€“ ECDSA: wrong private key', expectCompilationResult, '<owner.signature.all_outputs>', { keys: { privateKeys: { wrong: privkey } } }, { errorType: 'resolve', errors: [ { error: 'Identifier "owner.signature.all_outputs" refers to a Key, but a private key for "owner" (or an existing signature) was not provided in the compilation data.', missingIdentifier: 'owner.signature.all_outputs', owningEntity: 'ownerEntityId', range: { endColumn: 29, endLineNumber: 1, startColumn: 2, startLineNumber: 1, }, }, ], success: false, } as BytecodeGenerationResult<AuthenticationProgramStateBCH>, { owner: { type: 'Key' }, } ); test( '[BCH compiler] Key โ€“ schnorr: wrong private key', expectCompilationResult, '<owner.schnorr_signature.all_outputs>', { keys: { privateKeys: { wrong: privkey } } }, { errorType: 'resolve', errors: [ { error: 'Identifier "owner.schnorr_signature.all_outputs" refers to a Key, but a private key for "owner" (or an existing signature) was not provided in the compilation data.', missingIdentifier: 'owner.schnorr_signature.all_outputs', owningEntity: 'ownerEntityId', range: { endColumn: 37, endLineNumber: 1, startColumn: 2, startLineNumber: 1, }, }, ], success: false, } as BytecodeGenerationResult<AuthenticationProgramStateBCH>, { owner: { type: 'Key' }, } ); test( '[BCH compiler] Key โ€“ signature with no "privateKeys"', expectCompilationResult, '<owner.schnorr_signature.all_outputs>', { keys: {} }, { errorType: 'resolve', errors: [ { error: 'Identifier "owner.schnorr_signature.all_outputs" refers to a Key, but a private key for "owner" (or an existing signature) was not provided in the compilation data.', missingIdentifier: 'owner.schnorr_signature.all_outputs', owningEntity: 'ownerEntityId', range: { endColumn: 37, endLineNumber: 1, startColumn: 2, startLineNumber: 1, }, }, ], success: false, } as BytecodeGenerationResult<AuthenticationProgramStateBCH>, { owner: { type: 'Key' }, } ); test( '[BCH compiler] Key โ€“ ECDSA: unknown signing serialization algorithm', expectCompilationResult, '<owner.signature.another>', { keys: { privateKeys: { owner: privkey } } }, { errorType: 'resolve', errors: [ { error: 'Unknown signing serialization algorithm, "another".', range: { endColumn: 25, endLineNumber: 1, startColumn: 2, startLineNumber: 1, }, }, ], success: false, } as BytecodeGenerationResult<AuthenticationProgramStateBCH>, { owner: { type: 'Key' }, } ); test( '[BCH compiler] Key โ€“ schnorr: unknown signing serialization algorithm', expectCompilationResult, '<owner.schnorr_signature.another>', { keys: { privateKeys: { owner: privkey } } }, { errorType: 'resolve', errors: [ { error: 'Unknown signing serialization algorithm, "another".', range: { endColumn: 33, endLineNumber: 1, startColumn: 2, startLineNumber: 1, }, }, ], success: false, } as BytecodeGenerationResult<AuthenticationProgramStateBCH>, { owner: { type: 'Key' }, } ); test( '[BCH compiler] Key โ€“ unrecognized identifier fragment', expectCompilationResult, '<owner.signature.some.future_operation.with_more_levels>', { keys: { privateKeys: { owner: privkey } } }, { errorType: 'resolve', errors: [ { error: 'Unknown component in "owner.signature.some.future_operation.with_more_levels" โ€“ the fragment "future_operation" is not recognized.', range: { endColumn: 56, endLineNumber: 1, startColumn: 2, startLineNumber: 1, }, }, ], success: false, } as BytecodeGenerationResult<AuthenticationProgramStateBCH>, { owner: { type: 'Key' }, } ); test( '[BCH compiler] Key โ€“ ECDSA: no secp256k1', expectCompilationResult, '<owner.signature.all_outputs>', { keys: { privateKeys: { owner: privkey } } }, { errorType: 'resolve', errors: [ { error: 'Cannot resolve "owner.signature.all_outputs" โ€“ the "secp256k1" property was not provided in the compilation environment.', range: { endColumn: 29, endLineNumber: 1, startColumn: 2, startLineNumber: 1, }, }, ], success: false, } as BytecodeGenerationResult<AuthenticationProgramStateBCH>, { owner: { type: 'Key' }, }, { secp256k1: undefined } ); test( '[BCH compiler] Key โ€“ schnorr: no secp256k1', expectCompilationResult, '<owner.schnorr_signature.all_outputs>', { keys: { privateKeys: { owner: privkey } } }, { errorType: 'resolve', errors: [ { error: 'Cannot resolve "owner.schnorr_signature.all_outputs" โ€“ the "secp256k1" property was not provided in the compilation environment.', range: { endColumn: 37, endLineNumber: 1, startColumn: 2, startLineNumber: 1, }, }, ], success: false, } as BytecodeGenerationResult<AuthenticationProgramStateBCH>, { owner: { type: 'Key' }, }, { secp256k1: undefined } ); test( '[BCH compiler] Key โ€“ ECDSA: no sha256', expectCompilationResult, '<owner.signature.all_outputs>', { keys: { privateKeys: { owner: privkey } } }, { errorType: 'resolve', errors: [ { error: 'Cannot resolve "owner.signature.all_outputs" โ€“ the "sha256" property was not provided in the compilation environment.', range: { endColumn: 29, endLineNumber: 1, startColumn: 2, startLineNumber: 1, }, }, ], success: false, } as BytecodeGenerationResult<AuthenticationProgramStateBCH>, { owner: { type: 'Key' }, }, { sha256: undefined } ); test( '[BCH compiler] Key โ€“ schnorr: no sha256', expectCompilationResult, '<owner.schnorr_signature.all_outputs>', { keys: { privateKeys: { owner: privkey } } }, { errorType: 'resolve', errors: [ { error: 'Cannot resolve "owner.schnorr_signature.all_outputs" โ€“ the "sha256" property was not provided in the compilation environment.', range: { endColumn: 37, endLineNumber: 1, startColumn: 2, startLineNumber: 1, }, }, ], success: false, } as BytecodeGenerationResult<AuthenticationProgramStateBCH>, { owner: { type: 'Key' }, }, { sha256: undefined } ); test( '[BCH compiler] Key โ€“ error in coveredBytecode compilation', expectCompilationResult, '', { keys: { privateKeys: { owner: privkey } } }, { errorType: 'resolve', errors: [ { error: 'Compilation error in resolved script "lock": [1, 1] Unknown identifier "invalid".', range: { endColumn: 29, endLineNumber: 1, startColumn: 2, startLineNumber: 1, }, }, ], success: false, } as BytecodeGenerationResult<AuthenticationProgramStateBCH>, { owner: { type: 'Key' }, }, { scripts: { lock: 'invalid', test: '<owner.signature.all_outputs>', }, } );
{ "pile_set_name": "Github" }
<manifest xmlns:android="http://schemas.android.com/apk/res/android" package="org.aicaprio.curtainview"/>
{ "pile_set_name": "Github" }
version: 1.1 kind: component tags: [examples, keras] inputs: - {name: conv1_size, type: int, value: 32, isOptional: true} - {name: conv2_size, type: int, value: 64, isOptional: true} - {name: dropout, type: float, value: 0.8, isOptional: true} - {name: hidden1_size, type: int, value: 500, isOptional: true} - {name: optimizer, type: str, value: adam, isOptional: true} - {name: log_learning_rate, type: int, value: -3, isOptional: true} - {name: epochs, type: int, value: 1, isOptional: true} run: kind: job init: - git: {"url": "https://github.com/polyaxon/polyaxon-examples"} container: image: polyaxon/polyaxon-examples command: ["python", "-u", "{{ globals.artifacts_path }}/polyaxon-examples/in_cluster/keras/mnist/model.py"] imagePullPolicy: "Always" args: ["--conv1_size={{ conv1_size }}", "--conv2_size={{ conv2_size }}", "--dropout={{ dropout }}", "--hidden1_size={{ hidden1_size }}", "--optimizer={{ optimizer }}", "--log_learning_rate={{ log_learning_rate }}", "--epochs={{ epochs }}"]
{ "pile_set_name": "Github" }
{-# LANGUAGE OverloadedStrings #-} module Language.PlutusCore.Pretty.Utils ( prettyBytes ) where import PlutusPrelude import qualified Data.ByteString as BS import qualified Data.Text as T import Data.Text.Prettyprint.Doc.Internal import Numeric (showHex) asBytes :: Word8 -> Doc ann asBytes x = Text 2 $ T.pack $ addLeadingZero $ showHex x mempty where addLeadingZero :: String -> String addLeadingZero | x < 16 = ('0' :) | otherwise = id prettyBytes :: BS.ByteString -> Doc ann prettyBytes b = "#" <> fold (asBytes <$> BS.unpack b)
{ "pile_set_name": "Github" }
{ "@f": "@font-face {\n\tfont-family: ${1};\n\tsrc: url(${1});\n}", "@ff": "@font-face {\n\tfont-family: '${1:FontName}';\n\tsrc: url('${2:FileName}.eot');\n\tsrc: url('${2:FileName}.eot?#iefix') format('embedded-opentype'),\n\t\t url('${2:FileName}.woff') format('woff'),\n\t\t url('${2:FileName}.ttf') format('truetype'),\n\t\t url('${2:FileName}.svg#${1:FontName}') format('svg');\n\tfont-style: ${3:normal};\n\tfont-weight: ${4:normal};\n}", "@i|@import": "@import url(${0});", "@kf": "@keyframes ${1:identifier} {\n\t${2}\n}", "@m|@media": "@media ${1:screen} {\n\t${0}\n}", "ac": "align-content:start|end|flex-start|flex-end|center|space-between|space-around|stretch|space-evenly", "ai": "align-items:start|end|flex-start|flex-end|center|baseline|stretch", "anim": "animation:${1:name} ${2:duration} ${3:timing-function} ${4:delay} ${5:iteration-count} ${6:direction} ${7:fill-mode}", "animdel": "animation-delay:time", "animdir": "animation-direction:normal|reverse|alternate|alternate-reverse", "animdur": "animation-duration:${1:0}s", "animfm": "animation-fill-mode:both|forwards|backwards", "animic": "animation-iteration-count:1|infinite", "animn": "animation-name", "animps": "animation-play-state:running|paused", "animtf": "animation-timing-function:linear|ease|ease-in|ease-out|ease-in-out|cubic-bezier(${1:0.1}, ${2:0.7}, ${3:1.0}, ${3:0.1})", "ap": "appearance:none", "as": "align-self:start|end|auto|flex-start|flex-end|center|baseline|stretch", "b": "bottom", "bd": "border:${1:1px} ${2:solid} ${3:#000}", "bdb": "border-bottom:${1:1px} ${2:solid} ${3:#000}", "bdbc": "border-bottom-color:${1:#000}", "bdbi": "border-bottom-image:url(${0})", "bdbk": "border-break:close", "bdbli": "border-bottom-left-image:url(${0})|continue", "bdblrs": "border-bottom-left-radius", "bdbri": "border-bottom-right-image:url(${0})|continue", "bdbrrs": "border-bottom-right-radius", "bdbs": "border-bottom-style", "bdbw": "border-bottom-width", "bdc": "border-color:${1:#000}", "bdci": "border-corner-image:url(${0})|continue", "bdcl": "border-collapse:collapse|separate", "bdf": "border-fit:repeat|clip|scale|stretch|overwrite|overflow|space", "bdi": "border-image:url(${0})", "bdl": "border-left:${1:1px} ${2:solid} ${3:#000}", "bdlc": "border-left-color:${1:#000}", "bdlen": "border-length", "bdli": "border-left-image:url(${0})", "bdls": "border-left-style", "bdlw": "border-left-width", "bdr": "border-right:${1:1px} ${2:solid} ${3:#000}", "bdrc": "border-right-color:${1:#000}", "bdri": "border-right-image:url(${0})", "bdrs": "border-radius", "bdrst": "border-right-style", "bdrw": "border-right-width", "bds": "border-style:none|hidden|dotted|dashed|solid|double|dot-dash|dot-dot-dash|wave|groove|ridge|inset|outset", "bdsp": "border-spacing", "bdt": "border-top:${1:1px} ${2:solid} ${3:#000}", "bdtc": "border-top-color:${1:#000}", "bdti": "border-top-image:url(${0})", "bdtli": "border-top-left-image:url(${0})|continue", "bdtlrs": "border-top-left-radius", "bdtri": "border-top-right-image:url(${0})|continue", "bdtrrs": "border-top-right-radius", "bdts": "border-top-style", "bdtw": "border-top-width", "bdw": "border-width", "bfv": "backface-visibility:hidden|visible", "bg": "background:${1:#000}", "bga": "background-attachment:fixed|scroll", "bgbk": "background-break:bounding-box|each-box|continuous", "bgc": "background-color:#${1:fff}", "bgcp": "background-clip:padding-box|border-box|content-box|no-clip", "bgi": "background-image:url(${0})", "bgo": "background-origin:padding-box|border-box|content-box", "bgp": "background-position:${1:0} ${2:0}", "bgpx": "background-position-x", "bgpy": "background-position-y", "bgr": "background-repeat:no-repeat|repeat-x|repeat-y|space|round", "bgsz": "background-size:contain|cover", "bxsh": "box-shadow:${1:inset }${2:hoff} ${3:voff} ${4:blur} ${5:#000}|none", "bxsz": "box-sizing:border-box|content-box|border-box", "c": "color:${1:#000}", "cl": "clear:both|left|right|none", "cm": "/* ${0} */", "cnt": "content:'${0}'|normal|open-quote|no-open-quote|close-quote|no-close-quote|attr(${0})|counter(${0})|counters(${0})", "coi": "counter-increment", "colm": "columns", "colmc": "column-count", "colmf": "column-fill", "colmg": "column-gap", "colmr": "column-rule", "colmrc": "column-rule-color", "colmrs": "column-rule-style", "colmrw": "column-rule-width", "colms": "column-span", "colmw": "column-width", "cor": "counter-reset", "cp": "clip:auto|rect(${1:top} ${2:right} ${3:bottom} ${4:left})", "cps": "caption-side:top|bottom", "cur": "cursor:pointer|auto|default|crosshair|hand|help|move|pointer|text", "d": "display:grid|inline-grid|subgrid|block|none|flex|inline-flex|inline|inline-block|list-item|run-in|compact|table|inline-table|table-caption|table-column|table-column-group|table-header-group|table-footer-group|table-row|table-row-group|table-cell|ruby|ruby-base|ruby-base-group|ruby-text|ruby-text-group", "ec": "empty-cells:show|hide", "f": "font:${1:1em} ${2:sans-serif}", "fd": "font-display:auto|block|swap|fallback|optional", "fef": "font-effect:none|engrave|emboss|outline", "fem": "font-emphasize", "femp": "font-emphasize-position:before|after", "fems": "font-emphasize-style:none|accent|dot|circle|disc", "ff": "font-family:serif|sans-serif|cursive|fantasy|monospace", "fft": "font-family:\"Times New Roman\", Times, Baskerville, Georgia, serif", "ffa": "font-family:Arial, \"Helvetica Neue\", Helvetica, sans-serif", "ffv": "font-family:Verdana, Geneva, sans-serif", "fl": "float:left|right|none", "fs": "font-style:italic|normal|oblique", "fsm": "font-smoothing:antialiased|subpixel-antialiased|none", "fst": "font-stretch:normal|ultra-condensed|extra-condensed|condensed|semi-condensed|semi-expanded|expanded|extra-expanded|ultra-expanded", "fv": "font-variant:normal|small-caps", "fvs": "font-variation-settings:normal|inherit|initial|unset", "fw": "font-weight:normal|bold|bolder|lighter", "fx": "flex", "fxb": "flex-basis:fill|max-content|min-content|fit-content|content", "fxd": "flex-direction:row|row-reverse|column|column-reverse", "fxf": "flex-flow", "fxg": "flex-grow", "fxsh": "flex-shrink", "fxw": "flex-wrap:nowrap|wrap|wrap-reverse", "fsz": "font-size", "fsza": "font-size-adjust", "gtc": "grid-template-columns:repeat()|minmax()", "gtr": "grid-template-rows:repeat()|minmax()", "gta": "grid-template-areas", "gt": "grid-template", "gg": "grid-gap", "gcg": "grid-column-gap", "grg": "grid-row-gap", "gac": "grid-auto-columns:auto|minmax()", "gar": "grid-auto-rows:auto|minmax()", "gaf": "grid-auto-flow:row|column|dense|inherit|initial|unset", "gd": "grid", "gc": "grid-column", "gcs": "grid-column-start", "gce": "grid-column-end", "gr": "grid-row", "grs": "grid-row-start", "gre": "grid-row-end", "ga": "grid-area", "h": "height", "jc": "justify-content:start|end|stretch|flex-start|flex-end|center|space-between|space-around|space-evenly", "ji": "justify-items:start|end|center|stretch", "js": "justify-self:start|end|center|stretch", "l": "left", "lg": "background-image:linear-gradient(${1})", "lh": "line-height", "lis": "list-style", "lisi": "list-style-image", "lisp": "list-style-position:inside|outside", "list": "list-style-type:disc|circle|square|decimal|decimal-leading-zero|lower-roman|upper-roman", "lts": "letter-spacing:normal", "m": "margin", "mah": "max-height", "mar": "max-resolution", "maw": "max-width", "mb": "margin-bottom", "mih": "min-height", "mir": "min-resolution", "miw": "min-width", "ml": "margin-left", "mr": "margin-right", "mt": "margin-top", "ol": "outline", "olc": "outline-color:${1:#000}|invert", "olo": "outline-offset", "ols": "outline-style:none|dotted|dashed|solid|double|groove|ridge|inset|outset", "olw": "outline-width|thin|medium|thick", "op": "opacity", "ord": "order", "ori": "orientation:landscape|portrait", "orp": "orphans", "ov": "overflow:hidden|visible|hidden|scroll|auto", "ovs": "overflow-style:scrollbar|auto|scrollbar|panner|move|marquee", "ovx": "overflow-x:hidden|visible|hidden|scroll|auto", "ovy": "overflow-y:hidden|visible|hidden|scroll|auto", "p": "padding", "pb": "padding-bottom", "pgba": "page-break-after:auto|always|left|right", "pgbb": "page-break-before:auto|always|left|right", "pgbi": "page-break-inside:auto|avoid", "pl": "padding-left", "pos": "position:relative|absolute|relative|fixed|static", "pr": "padding-right", "pt": "padding-top", "q": "quotes", "qen": "quotes:'\\201C' '\\201D' '\\2018' '\\2019'", "qru": "quotes:'\\00AB' '\\00BB' '\\201E' '\\201C'", "r": "right", "rsz": "resize:none|both|horizontal|vertical", "t": "top", "ta": "text-align:left|center|right|justify", "tal": "text-align-last:left|center|right", "tbl": "table-layout:fixed", "td": "text-decoration:none|underline|overline|line-through", "te": "text-emphasis:none|accent|dot|circle|disc|before|after", "th": "text-height:auto|font-size|text-size|max-size", "ti": "text-indent", "tj": "text-justify:auto|inter-word|inter-ideograph|inter-cluster|distribute|kashida|tibetan", "to": "text-outline:${1:0} ${2:0} ${3:#000}", "tov": "text-overflow:ellipsis|clip", "tr": "text-replace", "trf": "transform:${1}|skewX(${1:angle})|skewY(${1:angle})|scale(${1:x}, ${2:y})|scaleX(${1:x})|scaleY(${1:y})|scaleZ(${1:z})|scale3d(${1:x}, ${2:y}, ${3:z})|rotate(${1:angle})|rotateX(${1:angle})|rotateY(${1:angle})|rotateZ(${1:angle})|translate(${1:x}, ${2:y})|translateX(${1:x})|translateY(${1:y})|translateZ(${1:z})|translate3d(${1:tx}, ${2:ty}, ${3:tz})", "trfo": "transform-origin", "trfs": "transform-style:preserve-3d", "trs": "transition:${1:prop} ${2:time}", "trsde": "transition-delay:${1:time}", "trsdu": "transition-duration:${1:time}", "trsp": "transition-property:${1:prop}", "trstf": "transition-timing-function:${1:fn}", "tsh": "text-shadow:${1:hoff} ${2:voff} ${3:blur} ${4:#000}", "tt": "text-transform:uppercase|lowercase|capitalize|none", "tw": "text-wrap:none|normal|unrestricted|suppress", "us": "user-select:none", "v": "visibility:hidden|visible|collapse", "va": "vertical-align:top|super|text-top|middle|baseline|bottom|text-bottom|sub", "w": "width", "whs": "white-space:nowrap|pre|pre-wrap|pre-line|normal", "whsc": "white-space-collapse:normal|keep-all|loose|break-strict|break-all", "wid": "widows", "wm": "writing-mode:lr-tb|lr-tb|lr-bt|rl-tb|rl-bt|tb-rl|tb-lr|bt-lr|bt-rl", "wob": "word-break:normal|keep-all|break-all", "wos": "word-spacing", "wow": "word-wrap:none|unrestricted|suppress|break-word|normal", "z": "z-index", "zom": "zoom:1" }
{ "pile_set_name": "Github" }
<?xml version="1.0" encoding="utf-8"?> <adaptive-icon xmlns:android="http://schemas.android.com/apk/res/android"> <background android:drawable="@drawable/ic_launcher_background" /> <foreground android:drawable="@drawable/ic_launcher_foreground" /> </adaptive-icon>
{ "pile_set_name": "Github" }
.. title:: clang-tidy - modernize-use-equals-delete modernize-use-equals-delete =========================== This check marks unimplemented private special member functions with ``= delete``. To avoid false-positives, this check only applies in a translation unit that has all other member functions implemented. .. code-block:: c++ struct A { private: A(const A&); A& operator=(const A&); }; // becomes struct A { private: A(const A&) = delete; A& operator=(const A&) = delete; }; .. option:: IgnoreMacros If this option is set to non-zero (default is `1`), the check will not warn about functions declared inside macros.
{ "pile_set_name": "Github" }
if (CLANGD_ENABLE_REMOTE) generate_grpc_protos(RemoteIndexProtos "Index.proto") include_directories(${CMAKE_CURRENT_BINARY_DIR}) include_directories(${CMAKE_CURRENT_SOURCE_DIR}/../../) # FIXME(kirillbobyrev): target_compile_definitions is not working with # add_clang_library for some reason. Is there any way to make this # target-local? add_definitions(-DGOOGLE_PROTOBUF_NO_RTTI=1) add_clang_library(clangdRemoteIndex Client.cpp LINK_LIBS RemoteIndexProtos clangdRemoteMarshalling protobuf grpc++ clangDaemon clangdSupport DEPENDS RemoteIndexProtos ) add_subdirectory(marshalling) add_subdirectory(server) else() # Provides a dummy implementation of clangdRemoteIndex. add_subdirectory(unimplemented) endif()
{ "pile_set_name": "Github" }
// Copyright 2000-2018 JetBrains s.r.o. Use of this source code is governed by the Apache 2.0 license that can be found in the LICENSE file. package com.intellij.util.indexing; import com.intellij.util.io.DataInputOutputUtil; import consulo.container.boot.ContainerPathManager; import java.io.*; class PersistentIndicesConfiguration { private static final int INDICES_CONFIGURATION_VERSION = 1; static void saveConfiguration() { try (DataOutputStream out = new DataOutputStream(new BufferedOutputStream(new FileOutputStream(indicesConfigurationFile())))) { DataInputOutputUtil.writeINT(out, INDICES_CONFIGURATION_VERSION); IndexingStamp.savePersistentIndexStamp(out); } catch (IOException ignored) { } } static void loadConfiguration() { try (DataInputStream in = new DataInputStream(new BufferedInputStream(new FileInputStream(indicesConfigurationFile())))) { if (DataInputOutputUtil.readINT(in) == INDICES_CONFIGURATION_VERSION) { IndexingStamp.initPersistentIndexStamp(in); } } catch (IOException ignored) { } } private static File indicesConfigurationFile() { return new File(ContainerPathManager.get().getIndexRoot(), "indices.config"); } }
{ "pile_set_name": "Github" }
-P:minibox:Ygeneric-constructor-code -P:minibox:warn-off
{ "pile_set_name": "Github" }
<template> <div class="bottom alignCenter scrollStyle" ref="bottom"> <div class="playControl"> <i class="iconfont icon-shangyishou prev" @click="prev" v-if="!isPreNext"></i> <i class="iconfont icon-icon-test1 prev" style="font-size:32px;" v-if="isPreNext"></i> <i class="iconfont palyClass play" :class="palyClass" @click="playState"></i> <i class="iconfont icon-xiayishou next" @click="next" v-if="!isPreNext"></i> <i class="iconfont icon-icon-test1 next" style="font-size:32px;" v-if="isPreNext"></i> </div> <div class="timeContainer alignCenter"> <span class="run">{{currentTime | songTime}}</span> <div class="timeschedule alignCenter" @click="toTime" ref="timeContainer"> <div class="box" ref="box" @mousedown.stop="drap" :style="{'left':`${time}px`}"></div> <div class="in"></div> <div class="out" :style="{'width':`${timeSchedule}%`}"></div> </div> <span class="duration" v-if = "currentSong.duration">{{currentSong.duration | time}}</span> <span class="duration" v-if = "!currentSong.duration">00:00</span> </div> <div class="soundContainer alignCenter"> <i class="iconfont icon-horn-copy sound"></i> <div class="soundschedule alignCenter"> <div class="in"></div> <div class="out"></div> </div> </div> <div class="other alignCenter"> <i class="iconfont mode" :class="[modeClass]" @click="changeMode"></i> <i class="iconfont icon-geci word"></i> <div class="listContainer alignCenter" @click="showDrop=!showDrop"> <i class="iconfont icon-bofangliebiao list" ></i> <span class="num">{{playList.length}}</span> </div> </div> <audio ref="audio" :src="currentSong.url" @timeupdate="updateTime" @ended="end" autoplay> </audio> <div class="dropListContainer" v-if="showDrop"> <dropList :width="580"> <template v-slot:header> <div class="bplayContainer allCenter"> <div class="bplayItem" :class="{'active':activeCur== 'playList'}" @click="activeCur ='playList'" > ๆ’ญๆ”พๅˆ—่กจ </div> <div class="bplayItem" :class="{'active':activeCur== 'playHistory'}" @click="activeCur ='playHistory'" > ๅކๅฒ่ฎฐๅฝ• </div> </div> </template> <div class="bDetail spCenter alignCenter"> <p class="bNum" v-if="activeCur == 'playList'">ๅ…ฑ{{sequenceList.length}}้ฆ–</p> <p class="bNum" v-if="activeCur == 'playHistory'">ๅ…ฑ{{playHistoryList.length}}้ฆ–</p> <div class="bControl alignCenter"> <div class="bCollection"> <i class="iconfont icon-shoucanggedan"></i> <span class="bcol">ๆ”ถ่—ๅ…จ้ƒจ</span> </div> <div class="bClear"> <i class="iconfont icon-lajixiang"></i> <span class="bcle">ๆธ…็ฉบ</span> </div> </div> </div> <div class="albumContainer"> <album :Songs="sequenceList" :types="3" :width='100' :nameWidth="55" :show="activeCur == 'playList'" :key="`value:${renderAlbum1}`"> </album> <album :Songs="playHistoryList" :types="4" :width='100' :nameWidth="55" :show="activeCur == 'playHistory'" :key="`value:${renderAlbum2}`"> </album> </div> </dropList> </div> <div class="modules" @click="showDrop = false" ref="modules" v-show="showDrop" style="position: fixed; width: 100%; top: 0; left: 0; z-index: 99; height: 630px;" ></div> </div> </template> <script> import {mapGetters,mapMutations,mapActions} from 'vuex' import DropList from '../base/DropList' import Album from '../base/Album' import {Axios,getSongUrl} from '../common/api' const offSetLeft = 250 const boxWidth = 12 export default { data() { return { timeWidth: 0, time: 0, activeCur:'playList', currentTime:0, timeSchedule:0, showDrop:false, isPreNext:false, mode:[ 'sequence', 'random', 'loop' ], nowMode:'sequence', } }, computed: { ...mapGetters([ 'currentSong', 'playList', 'sequenceList', 'currentIndex', 'playing', 'playHistoryList' ]), renderAlbum1() { if(this.activeCur==="playList") { return 1 } return 2 }, renderAlbum2() { if(this.activeCur==="playHistory") { return 3 } return 4 }, modeClass() { switch (this.nowMode) { case 'sequence': return 'icon-biao-' case 'random': return 'icon-bofangye-caozuolan-suijibofang' case 'loop': return 'icon-danquxunhuan' default: break; } }, palyClass() { if(this.playing) { return 'icon-zanting' } return 'icon-bofang' }, percent() { return this.currentTime * 1000/this.currentSong.duration } }, components: { DropList, Album }, watch: { currentTime(newVal) { this.time = this.percent * this.timeWidth - boxWidth/2 }, time(newVal) { if(newVal < 0) { this.timeSchedule = 0 return 0 } this.timeSchedule = (newVal / this.timeWidth)*100 } }, mounted() { this.init() }, updated() { // ่ฎพ็ฝฎ่ฟ›ๅบฆๆก็š„ๅฎฝๅบฆ this.timeWidth = this.$refs.timeContainer.offsetWidth }, filters: { songTime(value) { var min = Math.floor(value/60) var seconds = Math.floor(value % 60) if(seconds < 10) { seconds = '0' + seconds } if(min < 10) { min = '0' + min } return `${min}:${seconds}` } }, methods: { init() { // ่ฎพ็ฝฎvuexไธญ็š„audio๏ผŒๆไพ›็ป™ๆญŒๆ›ฒ่ฏฆๆƒ…้กตไฝฟ็”จ this.setAudio(this.$refs.audio) // ่ฎพ็ฝฎ่ฟ›ๅบฆๆก็š„ๅฎฝๅบฆ this.timeWidth = this.$refs.timeContainer.offsetWidth // ่ฎพ็ฝฎ่’™็‰ˆๅฑ‚็š„้ซ˜ๅบฆ๏ผŒไธ้ฎไฝๅบ•้ƒจ this.$refs.modules.style.height = document.documentElement.clientHeight - this.$refs.bottom.clientHeight window.onresize = () => { this.timeWidth = this.$refs.timeContainer.offsetWidth setTimeout(() => { this.$refs.modules.style.height = `${document.documentElement.clientHeight - this.$refs.bottom.clientHeight}px` }, 200); } }, drap(e) { e.stopPropagation() if(!this.currentSong.duration) { return } let box = this.$refs.box var _this = this let startX = offSetLeft - boxWidth/2 let moveX = 0,endX = 0 document.addEventListener('mousemove',move) document.addEventListener('mouseup',function (e) { e.stopPropagation() document.removeEventListener("mousemove",move) }) function move(e) { e.stopPropagation() moveX = e.clientX - offSetLeft - boxWidth/2 if(e.clientX - offSetLeft >= _this.timeWidth) { _this.time = _this.timeWidth - boxWidth/2 moveX = 0 }else if(e.clientX - offSetLeft <= 0) { moveX = 0 - boxWidth/2 }else { _this.time = moveX _this.$refs.audio.currentTime = _this.time / _this.timeWidth * _this.currentSong.duration / 1000 } } }, toTime(e) { if(!this.currentSong.duration) { return } this.time = e.clientX - offSetLeft - boxWidth/2 this.$refs.audio.currentTime = this.time / this.timeWidth * this.currentSong.duration / 1000 if(e.clientX > this.timeWidth + offSetLeft) { this.time = this.timeWidth }else if(e.clientX < offSetLeft) { this.time = 0 } }, updateTime(e) { this.currentTime = e.target.currentTime }, changeMode() { this.nowMode = this.nowMode == this.mode[0] ? this.mode[1] : this.nowMode == this.mode[1] ? this.mode[2] : this.mode[0] this.setPlayMode(this.nowMode) let index = this.sequenceList.findIndex((item) => { return item == this.currentSong }) if(this.nowMode == this.mode[2]) { this.setCurrentIndex(index) this.setPlayList(this.sequenceList) return }else { this.selectPlay({ list:this.sequenceList, index:this.currentIndex }) } }, end() { this.setPlayState(true) if(this.nowMode === this.mode[2]) { this.loop() }else { this.next() } }, loop() { this.$refs.audio.currentTime = 0 this.$refs.audio.play() this.isPreNext = false }, next() { if(!this.currentSong.duration) { return } this.isPreNext = true this.setPlayState(true) if(this.playList === 1 || this.nowMode === this.mode[2]) { this.loop() }else if(this.nowMode === this.mode[0]) { let index = this.currentIndex + 1 if(index === this.playList.length) { index = 0 } this.setPlayList(this.sequenceList) this._getUrl(this.playList[index].mid,index) }else{ let index = this.currentIndex this.setPlayList(this.sequenceList) /*ๆ ‡่ฎฐ*/ this._getUrl(this.playList[index].mid,index) } }, prev() { if(!this.currentSong.duration) { return } this.isPreNext = true; this.setPlayState(true) if(this.playList === 1 || this.nowMode === this.mode[2]) { this.loop() }else if(this.nowMode === this.mode[0]) { let index = this.currentIndex - 1 if(index === - 1) { index = this.playList.length - 1 } this.setPlayList(this.sequenceList) this._getUrl(this.playList[index].mid,index) }else { /*ๆ ‡่ฎฐ*/ let index = this.currentIndex this.setPlayList(this.sequenceList) /*ๆ ‡่ฎฐ*/ this._getUrl(this.playList[index].mid,index) } }, playState() { if(!this.currentSong.duration) { return } if(this.playing) { this.$refs.audio.pause() this.setPlayState(false) }else { this.$refs.audio.play() this.setPlayState(true) } }, _getUrl(mid,index) { let params = { id: mid } Axios(getSongUrl,params).then((res) => { let url = res.data[0].url let list = this.playList.slice(0) list[index].url = url this.selectPlay({ list:this.sequenceList, index:index }) this.isPreNext = false; }) }, ...mapActions([ 'selectPlay', ]), ...mapMutations({ setCurrentIndex:'SET_CURRENT_INDEX', setPlayList:'SET_PLAYLIST', setPlayMode:'SET_PLAY_MODE', setPlayState:'SET_PLAY_STATE', setAudio:'SET_AUDIO' }) } } </script> <style lang='scss'> @import '../assets/css/base.scss'; .bottom { position: fixed; z-index: 1000; bottom: 0; box-sizing: border-box; border-top: 1px solid $borderColor; width: 100%; height: 50px; background: #F6F6F8; .playControl { width: 200px; i { font-size: 35px; color:#D23030; } .prev { padding-left: 30px; } .play { padding: 0 20px; } } .timeContainer { flex: 1; margin-right: 10px; span { font-size: 13px; padding: 0 10px; } .timeschedule { flex: 1; padding: 10px 0; position: relative; .box { position: absolute; width: 12px; height: 12px; border-radius: 50%; z-index: 100; background: #f1f1f1; top: 3px; left: -6px; border: 1px solid #C2C2C4; &::before { content: ''; width: 4px; height: 4px; position: absolute; left: 4px; top: 4px; background: #D23030; border-radius: 50%; } } .in { position: absolute; width: 100%; left: 0; height: 4px; background: #C2C2C4; border-radius: 3px; } .out { left: 0; /* width: 100%; */ position: absolute; height: 4px; background: #D23030; border-radius: 3px; } } } .soundContainer { width: 130px; .sound { font-size: 20px; } .soundschedule { width: 90px; position: relative; .in { position: absolute; width: 100%; left: 0; height: 4px; background: #C2C2C4; border-radius: 3px; } .out { left: 0; width: 100%; position: absolute; height: 4px; background: #D23030; border-radius: 3px; } } } .other { width: 140px; i{ font-size: 20px; } .mode { padding-right: 10px; } .word { padding-right: 10px; color: #888; font-size: 25px; position: relative; top: 2px; } .listContainer { width: 50px; border-radius: 10px; background: $borderColor; padding: none; .list { font-size: 18px; position: relative; top: 2px; } .num { font-size: 13px; display: block; margin-right: 10px; } } } .dropListContainer { position: absolute; right: 0; height: 470px; top: -470px; width: 580px; .bplayContainer { width: 100%; height: 40px; border-bottom: 1px solid $borderColor; .bplayItem { font-size: 14px; padding: 5px 30px; border-top: 1px solid $borderColor; border-bottom: 1px solid $borderColor; color: #555555; cursor: pointer; &:first-child { border-top-left-radius: 5px; border-bottom-left-radius: 5px; border-right: 1px solid $borderColor; border-left: 1px solid $borderColor; } &:last-child { border-top-right-radius: 5px; border-bottom-right-radius: 5px; border-right: 1px solid $borderColor; } &.active { background: #7C7D85; color:#f1f1f1; } } } .bDetail { width: 100%; height: 30px; color: #666666; font-size: 13px; border-bottom: 1px solid #EBECED; .bNum { padding: 5px 20px; } .bCollection { padding-right: 10px; border-right: 1px solid $borderColor; .icon-shoucanggedan { font-size: 15px; } } .bClear { padding-left: 10px; padding-right: 20px; } } .albumContainer { height:390px; overflow:hidden; overflow-y: scroll; } } } </style>
{ "pile_set_name": "Github" }
/****************************************************************************** * * Copyright(c) 2007 - 2011 Realtek Corporation. All rights reserved. * * This program is free software; you can redistribute it and/or modify it * under the terms of version 2 of the GNU General Public License as * published by the Free Software Foundation. * * This program is distributed in the hope that it will be useful, but WITHOUT * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for * more details. * * You should have received a copy of the GNU General Public License along with * this program; if not, write to the Free Software Foundation, Inc., * 51 Franklin Street, Fifth Floor, Boston, MA 02110, USA * * ******************************************************************************/ #include <osdep_service.h> #include <drv_types.h> #include <wifi.h> #include <recv_osdep.h> #include <osdep_intf.h> #include <usb_ops_linux.h> /* alloc os related resource in struct recv_frame */ void rtw_os_recv_resource_alloc(struct recv_frame *precvframe) { precvframe->pkt_newalloc = NULL; precvframe->pkt = NULL; } /* alloc os related resource in struct recv_buf */ int rtw_os_recvbuf_resource_alloc(struct adapter *padapter, struct recv_buf *precvbuf) { precvbuf->pskb = NULL; precvbuf->reuse = false; precvbuf->purb = usb_alloc_urb(0, GFP_KERNEL); if (!precvbuf->purb) return _FAIL; return _SUCCESS; } void rtw_handle_tkip_mic_err(struct adapter *padapter, u8 bgroup) { union iwreq_data wrqu; struct iw_michaelmicfailure ev; struct mlme_priv *pmlmepriv = &padapter->mlmepriv; struct security_priv *psecuritypriv = &padapter->securitypriv; u32 cur_time = 0; if (psecuritypriv->last_mic_err_time == 0) { psecuritypriv->last_mic_err_time = jiffies; } else { cur_time = jiffies; if (cur_time - psecuritypriv->last_mic_err_time < 60*HZ) { psecuritypriv->btkip_countermeasure = true; psecuritypriv->last_mic_err_time = 0; psecuritypriv->btkip_countermeasure_time = cur_time; } else { psecuritypriv->last_mic_err_time = jiffies; } } memset(&ev, 0x00, sizeof(ev)); if (bgroup) ev.flags |= IW_MICFAILURE_GROUP; else ev.flags |= IW_MICFAILURE_PAIRWISE; ev.src_addr.sa_family = ARPHRD_ETHER; memcpy(ev.src_addr.sa_data, &pmlmepriv->assoc_bssid[0], ETH_ALEN); memset(&wrqu, 0x00, sizeof(wrqu)); wrqu.data.length = sizeof(ev); wireless_send_event(padapter->pnetdev, IWEVMICHAELMICFAILURE, &wrqu, (char *)&ev); } int rtw_recv_indicatepkt(struct adapter *padapter, struct recv_frame *precv_frame) { struct recv_priv *precvpriv; struct __queue *pfree_recv_queue; struct sk_buff *skb; struct mlme_priv *pmlmepriv = &padapter->mlmepriv; precvpriv = &(padapter->recvpriv); pfree_recv_queue = &(precvpriv->free_recv_queue); skb = precv_frame->pkt; if (!skb) { RT_TRACE(_module_recv_osdep_c_, _drv_err_, ("rtw_recv_indicatepkt():skb == NULL something wrong!!!!\n")); goto _recv_indicatepkt_drop; } RT_TRACE(_module_recv_osdep_c_, _drv_info_, ("rtw_recv_indicatepkt():skb != NULL !!!\n")); RT_TRACE(_module_recv_osdep_c_, _drv_info_, ("rtw_recv_indicatepkt():precv_frame->rx_head =%p precv_frame->hdr.rx_data =%p\n", precv_frame->rx_head, precv_frame->rx_data)); RT_TRACE(_module_recv_osdep_c_, _drv_info_, ("precv_frame->hdr.rx_tail =%p precv_frame->rx_end =%p precv_frame->hdr.len =%d\n", precv_frame->rx_tail, precv_frame->rx_end, precv_frame->len)); skb->data = precv_frame->rx_data; skb_set_tail_pointer(skb, precv_frame->len); skb->len = precv_frame->len; RT_TRACE(_module_recv_osdep_c_, _drv_info_, ("skb->head =%p skb->data =%p skb->tail =%p skb->end =%p skb->len =%d\n", skb->head, skb->data, skb_tail_pointer(skb), skb_end_pointer(skb), skb->len)); if (check_fwstate(pmlmepriv, WIFI_AP_STATE)) { struct sk_buff *pskb2 = NULL; struct sta_info *psta = NULL; struct sta_priv *pstapriv = &padapter->stapriv; struct rx_pkt_attrib *pattrib = &precv_frame->attrib; int bmcast = IS_MCAST(pattrib->dst); if (memcmp(pattrib->dst, myid(&padapter->eeprompriv), ETH_ALEN)) { if (bmcast) { psta = rtw_get_bcmc_stainfo(padapter); pskb2 = skb_clone(skb, GFP_ATOMIC); } else { psta = rtw_get_stainfo(pstapriv, pattrib->dst); } if (psta) { struct net_device *pnetdev; pnetdev = (struct net_device *)padapter->pnetdev; skb->dev = pnetdev; skb_set_queue_mapping(skb, rtw_recv_select_queue(skb)); rtw_xmit_entry(skb, pnetdev); if (bmcast) skb = pskb2; else goto _recv_indicatepkt_end; } } } rcu_read_lock(); rcu_dereference(padapter->pnetdev->rx_handler_data); rcu_read_unlock(); skb->ip_summed = CHECKSUM_NONE; skb->dev = padapter->pnetdev; skb->protocol = eth_type_trans(skb, padapter->pnetdev); netif_rx(skb); _recv_indicatepkt_end: /* pointers to NULL before rtw_free_recvframe() */ precv_frame->pkt = NULL; rtw_free_recvframe(precv_frame, pfree_recv_queue); RT_TRACE(_module_recv_osdep_c_, _drv_info_, ("\n rtw_recv_indicatepkt :after netif_rx!!!!\n")); return _SUCCESS; _recv_indicatepkt_drop: /* enqueue back to free_recv_queue */ rtw_free_recvframe(precv_frame, pfree_recv_queue); return _FAIL; } void rtw_init_recv_timer(struct recv_reorder_ctrl *preorder_ctrl) { setup_timer(&preorder_ctrl->reordering_ctrl_timer, rtw_reordering_ctrl_timeout_handler, (unsigned long)preorder_ctrl); }
{ "pile_set_name": "Github" }
/* * Copyright (c) 2000-2007 Apple Inc. All rights reserved. * * @APPLE_OSREFERENCE_LICENSE_HEADER_START@ * * This file contains Original Code and/or Modifications of Original Code * as defined in and that are subject to the Apple Public Source License * Version 2.0 (the 'License'). You may not use this file except in * compliance with the License. The rights granted to you under the License * may not be used to create, or enable the creation or redistribution of, * unlawful or unlicensed copies of an Apple operating system, or to * circumvent, violate, or enable the circumvention or violation of, any * terms of an Apple operating system software license agreement. * * Please obtain a copy of the License at * http://www.opensource.apple.com/apsl/ and read it before using this file. * * The Original Code and all software distributed under the License are * distributed on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES, * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY, * FITNESS FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT OR NON-INFRINGEMENT. * Please see the License for the specific language governing rights and * limitations under the License. * * @APPLE_OSREFERENCE_LICENSE_HEADER_END@ */ /* * Copyright (C) 1992, NeXT, Inc. * * File: kern/mach_loader.h * * Mach object file loader API. * * HISTORY * 24-Aug-92 Doug Mitchell at NeXT * Created. */ #ifndef _BSD_KERN_MACH_LOADER_H_ #define _BSD_KERN_MACH_LOADER_H_ #include <mach/mach_types.h> #include <mach-o/loader.h> typedef int load_return_t; /* * Structure describing the result from calling load_machfile(), if that * function returns LOAD_SUCCESS. */ typedef struct _load_result { user_addr_t mach_header; user_addr_t entry_point; // The user stack pointer and addressable user stack size. user_addr_t user_stack; mach_vm_size_t user_stack_size; // The allocation containing the stack and guard area. user_addr_t user_stack_alloc; mach_vm_size_t user_stack_alloc_size; mach_vm_address_t all_image_info_addr; mach_vm_size_t all_image_info_size; int thread_count; unsigned int /* boolean_t */ unixproc :1, needs_dynlinker :1, dynlinker :1, validentry :1, has_pagezero :1, using_lcmain :1, #if __arm64__ legacy_footprint :1, #endif /* __arm64__ */ is_64bit_addr :1, is_64bit_data :1; unsigned int csflags; unsigned char uuid[16]; mach_vm_address_t min_vm_addr; mach_vm_address_t max_vm_addr; unsigned int platform_binary; off_t cs_end_offset; void *threadstate; size_t threadstate_sz; } load_result_t; struct image_params; load_return_t load_machfile( struct image_params *imgp, struct mach_header *header, thread_t thread, vm_map_t *mapp, load_result_t *result); #define LOAD_SUCCESS 0 #define LOAD_BADARCH 1 /* CPU type/subtype not found */ #define LOAD_BADMACHO 2 /* malformed mach-o file */ #define LOAD_SHLIB 3 /* shlib version mismatch */ #define LOAD_FAILURE 4 /* Miscellaneous error */ #define LOAD_NOSPACE 5 /* No VM available */ #define LOAD_PROTECT 6 /* protection violation */ #define LOAD_RESOURCE 7 /* resource allocation failure */ #define LOAD_ENOENT 8 /* resource not found */ #define LOAD_IOERROR 9 /* IO error */ #define LOAD_DECRYPTFAIL 10 /* FP decrypt failure */ #define LOAD_BADMACHO_UPX 11 /* malformed mach-o file */ #define LOAD_BADARCH_X86 12 /* -no32exec boot-arg + attempted load of 32bit x86 binary */ #endif /* _BSD_KERN_MACH_LOADER_H_ */
{ "pile_set_name": "Github" }
--- title: ๅœจ Windows 10ใ€8.1ใ€8 ไธŠๅฎ‰่ฃ… .NET Framework 3.5 description: ไบ†่งฃๅฆ‚ไฝ•ๅœจ Windows 10ใ€Windows 8.1 ๅ’Œ Windows 8 ไธŠๅฎ‰่ฃ… .NET Framework 3.5ใ€‚ ms.date: 07/16/2018 ms.openlocfilehash: cfe21c0821b8f3223301dcc802533e1aaf024a79 ms.sourcegitcommit: 7588136e355e10cbc2582f389c90c127363c02a5 ms.translationtype: HT ms.contentlocale: zh-CN ms.lasthandoff: 03/15/2020 ms.locfileid: "76965940" --- # <a name="install-the-net-framework-35-on-windows-10-windows-81-and-windows-8"></a>ๅœจ Windows 10ใ€Windows 8.1 ๅ’Œ Windows 8 ไธŠๅฎ‰่ฃ… .NET Framework 3.5 ๅฟ…้กปๅฎ‰่ฃ… .NET Framework 3.5๏ผŒๆ‰่ƒฝๅœจ Windows 10ใ€Windows 8.1 ๅ’Œ Windows 8 ไธŠ่ฟ่กŒๅบ”็”จใ€‚ ๅฏนไบŽๆ—ง็‰ˆ Windows๏ผŒไนŸๅฏไปฅๆŒ‰็…งไปฅไธ‹่ฏดๆ˜Žๆ“ไฝœใ€‚ ## <a name="download-the-offline-installer"></a>ไธ‹่ฝฝ่„ฑๆœบๅฎ‰่ฃ…็จ‹ๅบ .NET Framework 3.5 SP1 ่„ฑๆœบๅฎ‰่ฃ…็จ‹ๅบๅฏๅœจ [.NET Framework 3.5 SP1 ไธ‹่ฝฝ้กต](https://dotnet.microsoft.com/download/dotnet-framework/net35-sp1)ไธŠๆ‰พๅˆฐ๏ผŒๅนถไธ”้€‚็”จไบŽ Windows 10 ไน‹ๅ‰็š„ Windows ็‰ˆๆœฌใ€‚ ## <a name="install-the-net-framework-35-on-demand"></a>ๆŒ‰้œ€ๅฎ‰่ฃ….NET Framework 3.5 ๅฆ‚ๆžœๅฐ่ฏ•่ฟ่กŒ็š„ๅบ”็”จ่ฆๆฑ‚ๅฎ‰่ฃ… .NET Framework 3.5๏ผŒๅˆ™ไผš็œ‹ๅˆฐไปฅไธ‹้…็ฝฎๅฏน่ฏๆก†ใ€‚ ้€‰ๆ‹ฉโ€œๅฎ‰่ฃ…ๆญคๅŠŸ่ƒฝโ€ ๏ผŒๅฏ็”จ .NET Framework 3.5ใ€‚ ๆญค้€‰้กน้œ€่ฆ Internet ่ฟžๆŽฅใ€‚ ![.NET Framework ๅฎ‰่ฃ…ๅฏน่ฏๆก†็š„ๅฑๅน•ๆˆชๅ›พใ€‚](./media/dotnet-35-windows-10/dotnet-framework-installation-dialog.png) ### <a name="why-am-i-getting-this-pop-up"></a>ไธบไป€ไนˆๆˆ‘ไผš็œ‹ๅˆฐๆญคๅผนๅ‡บ้กน๏ผŸ .NET Framework ๆ˜ฏ็”ฑ Microsoft ๅˆ›ๅปบ๏ผŒ็”จไบŽๆไพ›ๅบ”็”จ็จ‹ๅบ่ฟ่กŒ็Žฏๅขƒใ€‚ ๆœ‰ๅคš็งไธๅŒ็‰ˆๆœฌใ€‚ ่ฎธๅคšๅ…ฌๅธ้ƒฝๅผ€ๅ‘ไฝฟ็”จ .NET Framework ่ฟ่กŒ็š„ๅบ”็”จ็จ‹ๅบ๏ผŒๅนถไธ”่ฟ™ไบ›ๅบ”็”จ้ƒฝๅฎš็›ฎๆ ‡ๅˆฐๅ…ทไฝ“็‰ˆๆœฌใ€‚ ๅฆ‚ๆžœ็œ‹ๅˆฐๆญคๅผนๅ‡บ้กน๏ผŒ่กจๆ˜Žๅฐ่ฏ•่ฟ่กŒ็š„ๅบ”็”จ็จ‹ๅบ้œ€่ฆ .NET Framework ็‰ˆๆœฌ 3.5๏ผŒไฝ†ๆœชๅœจ็ณป็ปŸไธŠๅฎ‰่ฃ…ๆญค็‰ˆๆœฌใ€‚ ## <a name="enable-the-net-framework-35-in-control-panel"></a>ๅœจๆŽงๅˆถ้ขๆฟไธญๅฏ็”จ .NET Framework 3.5 ๅฏไปฅ้€š่ฟ‡ Windows ๆŽงๅˆถ้ขๆฟๅฏ็”จ .NET Framework 3.5ใ€‚ ๆญค้€‰้กน้œ€่ฆ Internet ่ฟžๆŽฅใ€‚ 1. ๆŒ‰ไธ‹้”ฎ็›˜ไธŠ็š„ Windows ๅพฝๆ ‡้”ฎ ![Windows ๅพฝๆ ‡้”ฎๅพฝๆ ‡็š„ๅฑๅน•ๆˆชๅ›พ](./media/dotnet-35-windows-10/windows-keyboard-logo.png)๏ผŒ ้”ฎๅ…ฅโ€œWindows ๅŠŸ่ƒฝโ€๏ผŒ็„ถๅŽๆŒ‰ Enterใ€‚ ้šๅณๆ˜พ็คบโ€œๆ‰“ๅผ€ๆˆ–ๅ…ณ้—ญ Windows ๅŠŸ่ƒฝโ€ๅฏน่ฏๆก† ใ€‚ 2. ๅฆ‚ๆžœๅผนๅ‡บๆ็คบ๏ผŒ้€‰ๆ‹ฉโ€œ.NET Framework 3.5 (ๅŒ…ๆ‹ฌ .NET 2.0 ๅ’Œ 3.0)โ€ ๅค้€‰ๆก†๏ผŒ้€‰ๆ‹ฉโ€œ็กฎๅฎšโ€๏ผŒ็„ถๅŽ้‡ๅฏ่ฎก็ฎ—ๆœบ ใ€‚ ![ๆ˜พ็คบ้€š่ฟ‡ๆŽงๅˆถ้ขๆฟๅฎ‰่ฃ… .NET ็š„ๅฑๅน•ๆˆชๅ›พใ€‚](./media/dotnet-35-windows-10/dotnet-control-panel.png) ๆ— ้œ€้€‰ๆ‹ฉโ€œWindows Communication Foundation (WCF) HTTP ๆฟ€ๆดปโ€ ๅ’Œโ€œWindows Communication Foundation (WCF) ้ž HTTP ๆฟ€ๆดปโ€ ็š„ๅญ้กน๏ผŒ้™ค้žๆ˜ฏ้œ€่ฆไฝฟ็”จๆญคๅŠŸ่ƒฝ็š„ๅผ€ๅ‘่€…ๆˆ–ๆœๅŠกๅ™จ็ฎก็†ๅ‘˜ใ€‚ ## <a name="troubleshoot-the-installation-of-the-net-framework-35"></a>.NET Framework 3.5 ๅฎ‰่ฃ…็–‘้šพ่งฃ็ญ” ๅฎ‰่ฃ…่ฟ‡็จ‹ไธญ๏ผŒไฝ ๅฏ่ƒฝไผš้‡ๅˆฐ้”™่ฏฏ 0x800f0906ใ€0x800f0907ใ€0x800f081f ๆˆ– 0x800F0922๏ผŒๆญคๆ—ถ่ฏทๅ‚้˜… [.NET Framework 3.5 ๅฎ‰่ฃ…้”™่ฏฏ๏ผš0x800f0906ใ€0x800f0907 ๆˆ– 0x800f081f](https://support.microsoft.com/help/2734782/net-framework-3-5-installation-error-0x800f0906--0x800f081f--0x800f09)๏ผŒไบ†่งฃๅฆ‚ไฝ•่งฃๅ†ณ่ฟ™ไบ›้—ฎ้ข˜ใ€‚ ๅฆ‚ๆžœไปๆ— ๆณ•่งฃๅ†ณๅฎ‰่ฃ…้—ฎ้ข˜๏ผŒๆˆ–ๆœช่ฟžๆŽฅๅˆฐ Internet๏ผŒๅฏไปฅๅฐ่ฏ•ไฝฟ็”จ Windows ๅฎ‰่ฃ…ไป‹่ดจ่ฟ›่กŒๅฎ‰่ฃ…ใ€‚ ๆœ‰ๅ…ณ่ฏฆ็ป†ไฟกๆฏ๏ผŒ่ฏทๅ‚้˜…[ไฝฟ็”จ้ƒจ็ฝฒๆ˜ ๅƒๆœๅŠกๅ’Œ็ฎก็† (DISM) ้ƒจ็ฝฒ .NET Framework 3.5](/windows-hardware/manufacture/desktop/deploy-net-framework-35-by-using-deployment-image-servicing-and-management--dism)ใ€‚ ๅฆ‚ๆžœๆฒกๆœ‰ๅฎ‰่ฃ…ๅช’ไฝ“๏ผŒ่ฏทๅ‚้˜…[ๅˆ›ๅปบ้€‚็”จไบŽ Windows ็š„ๅฎ‰่ฃ…ๅช’ไฝ“](https://support.microsoft.com/help/15088/windows-create-installation-media)ใ€‚ > [!WARNING] > ๅฆ‚ๆžœไธไพ่ต– Windows ๆ›ดๆ–ฐไฝœไธบๆบๆฅๅฎ‰่ฃ… .NET Framework 3.5๏ผŒๅˆ™ๅฟ…้กป็กฎไฟไธฅๆ ผไฝฟ็”จๆฅ่‡ช็›ธๅŒ็š„ใ€ๅฏนๅบ”็š„ Windows ๆ“ไฝœ็ณป็ปŸ็‰ˆๆœฌ็š„ๆบใ€‚ ไฝฟ็”จไธๅฏนๅบ”ไบŽ็›ธๅŒ Windows ็‰ˆๆœฌ็š„ๆบ่ทฏๅพ„ๅนถไธไผš้˜ปๆญขๅฎ‰่ฃ…ไธŽ .NET Framework 3.5 ไธๅŒน้…็š„็‰ˆๆœฌใ€‚ ไฝ†ๆ˜ฏ๏ผŒ่ฟ™ไผšๅฏผ่‡ด็ณป็ปŸไธๅ—ๆ”ฏๆŒไธ”ๆ— ๆณ•ๆไพ›ๆœๅŠกใ€‚
{ "pile_set_name": "Github" }
# Copyright 2019 The dm_control 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. # ============================================================================ """Composer entities corresponding to props. A "prop" is typically a non-actuated entity representing an object in the world. """ from dm_control.entities.props.duplo import Duplo from dm_control.entities.props.position_detector import PositionDetector from dm_control.entities.props.primitive import Primitive
{ "pile_set_name": "Github" }
<answer>fun sendMessageToClient( client: Client?, message: String?, mailer: Mailer ) { val email = client?.personalInfo?.email if (email != null && message != null) { mailer.sendMessage(email, message) } }</answer> class Client (val personalInfo: PersonalInfo?) class PersonalInfo (val email: String?) interface Mailer { fun sendMessage(email: String, message: String) }
{ "pile_set_name": "Github" }
fileFormatVersion: 2 guid: 3ff33a0e71e7b854bb7aa86eef2bbf8d timeCreated: 1503273277 licenseType: Free NativeFormatImporter: mainObjectFileID: 2100000 userData: assetBundleName: assetBundleVariant:
{ "pile_set_name": "Github" }
/* This test purpose is simply to check Standard header independancy that * is to say that the header can be included alone without any previous * include. * Additionnaly, for C Standard headers that STLport expose, it can also be * used to check that files included by those headers are compatible with * pure C compilers. */ #include <valarray>
{ "pile_set_name": "Github" }
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <html><head><title></title> <meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/> <meta name="generator" content="Doxygen 1.8.14"/> <link rel="stylesheet" type="text/css" href="search.css"/> <script type="text/javascript" src="typedefs_0.js"></script> <script type="text/javascript" src="search.js"></script> </head> <body class="SRPage"> <div id="SRIndex"> <div class="SRStatus" id="Loading">Loading...</div> <div id="SRResults"></div> <script type="text/javascript"><!-- /* @license magnet:?xt=urn:btih:cf05388f2679ee054f2beb29a391d25f4e673ac3&amp;dn=gpl-2.0.txt GPL-v2 */ createResults(); /* @license-end */ --></script> <div class="SRStatus" id="Searching">Searching...</div> <div class="SRStatus" id="NoMatches">No Matches</div> <script type="text/javascript"><!-- /* @license magnet:?xt=urn:btih:cf05388f2679ee054f2beb29a391d25f4e673ac3&amp;dn=gpl-2.0.txt GPL-v2 */ document.getElementById("Loading").style.display="none"; document.getElementById("NoMatches").style.display="none"; var searchResults = new SearchResults("searchResults"); searchResults.Search(); /* @license-end */ --></script> </div> </body> </html>
{ "pile_set_name": "Github" }
public class Test { public static void main(String[] args) { System.out.println("simple:website<caret>"); } }
{ "pile_set_name": "Github" }
/* * Copyright (C) 2014 The AppCan Open Source Project. * * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU Lesser General Public License as published by * the Free Software Foundation, either version 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 Lesser General Public License for more details. * You should have received a copy of the GNU Lesser General Public License * along with this program. If not, see <http://www.gnu.org/licenses/>. * */ package org.zywx.wbpalmstar.engine; import android.os.Build; import android.webkit.WebSettings; import android.webkit.WebSettings.PluginState; import java.lang.reflect.Method; public class EBrowserSetting7 extends EBrowserSetting { public EBrowserSetting7(EBrowserView inView) { super(inView); } public void initBaseSetting(boolean webApp) { super.initBaseSetting(webApp); mWebSetting.setAppCacheEnabled(true); mWebSetting.setAppCachePath(mBrwView.getContext().getDir("cache", 0).getPath()); mWebSetting.setDatabaseEnabled(true); mWebSetting.setDomStorageEnabled(true); mWebSetting.setLoadWithOverviewMode(false); if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.JELLY_BEAN) { mWebSetting.setAllowFileAccessFromFileURLs(true); mWebSetting.setAllowUniversalAccessFromFileURLs(true); } mWebSetting.setDatabasePath(mBrwView.getContext().getDir("database", 0).getPath()); if (Build.VERSION.SDK_INT >= 8) { try { mWebSetting.setPluginState(PluginState.ON); } catch (Exception e) { e.printStackTrace(); } } if (Build.VERSION.SDK_INT > 10) { invoke(); } } @SuppressWarnings("rawtypes") private void invoke() { Class[] paramTypes = {boolean.class}; try { Method setEnableSmoothTransition = WebSettings.class.getDeclaredMethod("setEnableSmoothTransition", paramTypes); setEnableSmoothTransition.invoke(mWebSetting, true); } catch (Exception e) { // e.printStackTrace(); } try { Method setAutoFillEnabled = WebSettings.class.getDeclaredMethod("setAutoFillEnabled", paramTypes); setAutoFillEnabled.invoke(mWebSetting, false); } catch (Exception e) { // e.printStackTrace(); } try { Method setHardwareAccelSkiaEnabled = WebSettings.class.getDeclaredMethod("setHardwareAccelSkiaEnabled", paramTypes); setHardwareAccelSkiaEnabled.invoke(mWebSetting, false); } catch (Exception e) { // e.printStackTrace(); } try { Method setForceUserScalable = WebSettings.class.getDeclaredMethod("setForceUserScalable", paramTypes); setForceUserScalable.invoke(mWebSetting, false); } catch (Exception e) { // e.printStackTrace(); } } }
{ "pile_set_name": "Github" }
apiVersion: scheduling.k8s.io/v1 description: "19" globalDefault: true kind: PriorityClass metadata: annotations: "9": "10" clusterName: "15" creationTimestamp: null deletionGracePeriodSeconds: -4955867275792137171 finalizers: - "14" generateName: "3" generation: 8071137005907523419 labels: "7": "8" managedFields: - apiVersion: "17" fieldsType: "18" manager: "16" operation: ้Šๅ”Š้ฃ™ลž-Uๅœดรทa/ษ”}ๆ‘(ๆน—ฤ†] name: "2" namespace: "4" ownerReferences: - apiVersion: "11" blockOwnerDeletion: true controller: false kind: "12" name: "13" uid: Dzๅป”ศ‡{sลŠฦp resourceVersion: "11042405498087606203" selfLink: "5" uid: "7" preemptionPolicy: JๆžŠa value: -595102844
{ "pile_set_name": "Github" }
var test = require('tape'); var parse = require('../'); test('boolean default true', function (t) { var argv = parse([], { boolean: 'sometrue', default: { sometrue: true } }); t.equal(argv.sometrue, true); t.end(); }); test('boolean default false', function (t) { var argv = parse([], { boolean: 'somefalse', default: { somefalse: false } }); t.equal(argv.somefalse, false); t.end(); }); test('boolean default to null', function (t) { var argv = parse([], { boolean: 'maybe', default: { maybe: null } }); t.equal(argv.maybe, null); var argv = parse(['--maybe'], { boolean: 'maybe', default: { maybe: null } }); t.equal(argv.maybe, true); t.end(); })
{ "pile_set_name": "Github" }
EXTRA_DIST=\ protocol.txt \ scripting.txt
{ "pile_set_name": "Github" }
๏ปฟ<BSPagination Alignment="Alignment.Center"> <BSPaginationItem IsDisabled="true"> <BSPaginationLink Href="#" PaginationLinkType="PaginationLinkType.PreviousText" /> </BSPaginationItem> <BSPaginationItem> <BSPaginationLink Href="#" PaginationLinkType="PaginationLinkType.Custom">1</BSPaginationLink> </BSPaginationItem> <BSPaginationItem> <BSPaginationLink Href="#" PaginationLinkType="PaginationLinkType.Custom">2</BSPaginationLink> </BSPaginationItem> <BSPaginationItem> <BSPaginationLink Href="#" PaginationLinkType="PaginationLinkType.Custom">3</BSPaginationLink> </BSPaginationItem> <BSPaginationItem> <BSPaginationLink Href="#" PaginationLinkType="PaginationLinkType.NextText" /> </BSPaginationItem> </BSPagination>
{ "pile_set_name": "Github" }
<?xml version="1.0" encoding="UTF-8"?> <ui version="4.0"> <class>SignVerifyMessageDialog</class> <widget class="QDialog" name="SignVerifyMessageDialog"> <property name="geometry"> <rect> <x>0</x> <y>0</y> <width>700</width> <height>380</height> </rect> </property> <property name="windowTitle"> <string>Signatures - Sign / Verify a Message</string> </property> <property name="modal"> <bool>true</bool> </property> <layout class="QVBoxLayout" name="verticalLayout"> <item> <widget class="QTabWidget" name="tabWidget"> <property name="currentIndex"> <number>0</number> </property> <widget class="QWidget" name="tabSignMessage"> <attribute name="title"> <string>&amp;Sign Message</string> </attribute> <layout class="QVBoxLayout" name="verticalLayout_SM"> <item> <widget class="QLabel" name="infoLabel_SM"> <property name="text"> <string>You can sign messages/agreements with your addresses to prove you can receive taucoins sent to them. Be careful not to sign anything vague or random, as phishing attacks may try to trick you into signing your identity over to them. Only sign fully-detailed statements you agree to.</string> </property> <property name="textFormat"> <enum>Qt::PlainText</enum> </property> <property name="wordWrap"> <bool>true</bool> </property> </widget> </item> <item> <layout class="QHBoxLayout" name="horizontalLayout_1_SM"> <property name="spacing"> <number>0</number> </property> <item> <widget class="QValidatedLineEdit" name="addressIn_SM"> <property name="toolTip"> <string>The Taucoin address to sign the message with</string> </property> </widget> </item> <item> <widget class="QPushButton" name="addressBookButton_SM"> <property name="toolTip"> <string>Choose previously used address</string> </property> <property name="text"> <string/> </property> <property name="icon"> <iconset resource="../bitcoin.qrc"> <normaloff>:/icons/address-book</normaloff>:/icons/address-book</iconset> </property> <property name="shortcut"> <string>Alt+A</string> </property> <property name="autoDefault"> <bool>false</bool> </property> </widget> </item> <item> <widget class="QPushButton" name="pasteButton_SM"> <property name="toolTip"> <string>Paste address from clipboard</string> </property> <property name="text"> <string/> </property> <property name="icon"> <iconset resource="../bitcoin.qrc"> <normaloff>:/icons/editpaste</normaloff>:/icons/editpaste</iconset> </property> <property name="shortcut"> <string>Alt+P</string> </property> <property name="autoDefault"> <bool>false</bool> </property> </widget> </item> </layout> </item> <item> <widget class="QPlainTextEdit" name="messageIn_SM"> <property name="toolTip"> <string>Enter the message you want to sign here</string> </property> </widget> </item> <item> <widget class="QLabel" name="signatureLabel_SM"> <property name="text"> <string>Signature</string> </property> <property name="textFormat"> <enum>Qt::PlainText</enum> </property> </widget> </item> <item> <layout class="QHBoxLayout" name="horizontalLayout_2_SM"> <property name="spacing"> <number>0</number> </property> <item> <widget class="QLineEdit" name="signatureOut_SM"> <property name="font"> <font> <italic>true</italic> </font> </property> <property name="readOnly"> <bool>true</bool> </property> </widget> </item> <item> <widget class="QPushButton" name="copySignatureButton_SM"> <property name="toolTip"> <string>Copy the current signature to the system clipboard</string> </property> <property name="text"> <string/> </property> <property name="icon"> <iconset resource="../bitcoin.qrc"> <normaloff>:/icons/editcopy</normaloff>:/icons/editcopy</iconset> </property> <property name="autoDefault"> <bool>false</bool> </property> </widget> </item> </layout> </item> <item> <layout class="QHBoxLayout" name="horizontalLayout_3_SM"> <item> <widget class="QPushButton" name="signMessageButton_SM"> <property name="toolTip"> <string>Sign the message to prove you own this Taucoin address</string> </property> <property name="text"> <string>Sign &amp;Message</string> </property> <property name="icon"> <iconset resource="../bitcoin.qrc"> <normaloff>:/icons/edit</normaloff>:/icons/edit</iconset> </property> <property name="autoDefault"> <bool>false</bool> </property> </widget> </item> <item> <widget class="QPushButton" name="clearButton_SM"> <property name="toolTip"> <string>Reset all sign message fields</string> </property> <property name="text"> <string>Clear &amp;All</string> </property> <property name="icon"> <iconset resource="../bitcoin.qrc"> <normaloff>:/icons/remove</normaloff>:/icons/remove</iconset> </property> <property name="autoDefault"> <bool>false</bool> </property> </widget> </item> <item> <spacer name="horizontalSpacer_1_SM"> <property name="orientation"> <enum>Qt::Horizontal</enum> </property> <property name="sizeHint" stdset="0"> <size> <width>40</width> <height>48</height> </size> </property> </spacer> </item> <item> <widget class="QLabel" name="statusLabel_SM"> <property name="font"> <font> <weight>75</weight> <bold>true</bold> </font> </property> <property name="text"> <string/> </property> <property name="wordWrap"> <bool>true</bool> </property> </widget> </item> <item> <spacer name="horizontalSpacer_2_SM"> <property name="orientation"> <enum>Qt::Horizontal</enum> </property> <property name="sizeHint" stdset="0"> <size> <width>40</width> <height>48</height> </size> </property> </spacer> </item> </layout> </item> </layout> </widget> <widget class="QWidget" name="tabVerifyMessage"> <attribute name="title"> <string>&amp;Verify Message</string> </attribute> <layout class="QVBoxLayout" name="verticalLayout_VM"> <item> <widget class="QLabel" name="infoLabel_VM"> <property name="text"> <string>Enter the receiver's address, message (ensure you copy line breaks, spaces, tabs, etc. exactly) and signature below to verify the message. Be careful not to read more into the signature than what is in the signed message itself, to avoid being tricked by a man-in-the-middle attack. Note that this only proves the signing party receives with the address, it cannot prove sendership of any transaction!</string> </property> <property name="textFormat"> <enum>Qt::PlainText</enum> </property> <property name="alignment"> <set>Qt::AlignLeading|Qt::AlignLeft|Qt::AlignTop</set> </property> <property name="wordWrap"> <bool>true</bool> </property> </widget> </item> <item> <layout class="QHBoxLayout" name="horizontalLayout_1_VM"> <property name="spacing"> <number>0</number> </property> <item> <widget class="QValidatedLineEdit" name="addressIn_VM"> <property name="toolTip"> <string>The Taucoin address the message was signed with</string> </property> </widget> </item> <item> <widget class="QPushButton" name="addressBookButton_VM"> <property name="toolTip"> <string>Choose previously used address</string> </property> <property name="text"> <string/> </property> <property name="icon"> <iconset resource="../bitcoin.qrc"> <normaloff>:/icons/address-book</normaloff>:/icons/address-book</iconset> </property> <property name="shortcut"> <string>Alt+A</string> </property> <property name="autoDefault"> <bool>false</bool> </property> </widget> </item> </layout> </item> <item> <widget class="QPlainTextEdit" name="messageIn_VM"/> </item> <item> <widget class="QValidatedLineEdit" name="signatureIn_VM"/> </item> <item> <layout class="QHBoxLayout" name="horizontalLayout_2_VM"> <item> <widget class="QPushButton" name="verifyMessageButton_VM"> <property name="toolTip"> <string>Verify the message to ensure it was signed with the specified Taucoin address</string> </property> <property name="text"> <string>Verify &amp;Message</string> </property> <property name="icon"> <iconset resource="../bitcoin.qrc"> <normaloff>:/icons/transaction_0</normaloff>:/icons/transaction_0</iconset> </property> <property name="autoDefault"> <bool>false</bool> </property> </widget> </item> <item> <widget class="QPushButton" name="clearButton_VM"> <property name="toolTip"> <string>Reset all verify message fields</string> </property> <property name="text"> <string>Clear &amp;All</string> </property> <property name="icon"> <iconset resource="../bitcoin.qrc"> <normaloff>:/icons/remove</normaloff>:/icons/remove</iconset> </property> <property name="autoDefault"> <bool>false</bool> </property> </widget> </item> <item> <spacer name="horizontalSpacer_1_VM"> <property name="orientation"> <enum>Qt::Horizontal</enum> </property> <property name="sizeHint" stdset="0"> <size> <width>40</width> <height>48</height> </size> </property> </spacer> </item> <item> <widget class="QLabel" name="statusLabel_VM"> <property name="font"> <font> <weight>75</weight> <bold>true</bold> </font> </property> <property name="text"> <string/> </property> <property name="wordWrap"> <bool>true</bool> </property> </widget> </item> <item> <spacer name="horizontalSpacer_2_VM"> <property name="orientation"> <enum>Qt::Horizontal</enum> </property> <property name="sizeHint" stdset="0"> <size> <width>40</width> <height>48</height> </size> </property> </spacer> </item> </layout> </item> </layout> </widget> </widget> </item> </layout> </widget> <customwidgets> <customwidget> <class>QValidatedLineEdit</class> <extends>QLineEdit</extends> <header>qvalidatedlineedit.h</header> </customwidget> </customwidgets> <resources> <include location="../bitcoin.qrc"/> </resources> <connections/> </ui>
{ "pile_set_name": "Github" }
var searchData= [ ['margin_28',['Margin',['../structwkhtmltopdf_1_1settings_1_1Margin.html',1,'wkhtmltopdf::settings::Margin'],['../structwkhtmltopdf_1_1settings_1_1PdfGlobal.html#a5134abc2cf21870b455416d5efc466f6',1,'wkhtmltopdf::settings::PdfGlobal::margin()']]] ];
{ "pile_set_name": "Github" }
// Copyright (C) 2019 tribe29 GmbH - License: GNU General Public License v2 // This file is part of Checkmk (https://checkmk.com). It is subject to the // terms and conditions defined in the file COPYING, which is part of this // source code package. #include "TableCommands.h" #include <memory> #include <vector> #include "Column.h" #include "MonitoringCore.h" #include "Query.h" #include "Row.h" #include "StringLambdaColumn.h" TableCommands::TableCommands(MonitoringCore *mc) : Table(mc) { addColumns(this, "", ColumnOffsets{}); } std::string TableCommands::name() const { return "commands"; } std::string TableCommands::namePrefix() const { return "command_"; } // static void TableCommands::addColumns(Table *table, const std::string &prefix, const ColumnOffsets &offsets) { table->addColumn(std::make_unique<StringLambdaColumn<Command>>( prefix + "name", "The name of the command", offsets, [](const Command &cmd) { return cmd._name; })); table->addColumn(std::make_unique<StringLambdaColumn<Command>>( prefix + "line", "The shell command line", offsets, [](const Command &cmd) { return cmd._command_line; })); } void TableCommands::answerQuery(Query *query) { for (auto &cmd : core()->commands()) { if (!query->processDataset(Row{&cmd})) { break; } } }
{ "pile_set_name": "Github" }
import defined from "../Core/defined.js"; import FrustumOutlineGeometry from "../Core/FrustumOutlineGeometry.js"; function createFrustumOutlineGeometry(frustumGeometry, offset) { if (defined(offset)) { frustumGeometry = FrustumOutlineGeometry.unpack(frustumGeometry, offset); } return FrustumOutlineGeometry.createGeometry(frustumGeometry); } export default createFrustumOutlineGeometry;
{ "pile_set_name": "Github" }
// RUN: %clang_cc1 -std=c++11 -triple x86_64-linux-gnu -fms-extensions -ast-dump -ast-dump-filter Test %s | FileCheck -strict-whitespace %s class testEnumDecl { enum class TestEnumDeclScoped; enum TestEnumDeclFixed : int; }; // CHECK: EnumDecl{{.*}} class TestEnumDeclScoped 'int' // CHECK: EnumDecl{{.*}} TestEnumDeclFixed 'int' class testFieldDecl { int TestFieldDeclInit = 0; }; // CHECK: FieldDecl{{.*}} TestFieldDeclInit 'int' // CHECK-NEXT: IntegerLiteral namespace testVarDeclNRVO { class A { }; A foo() { A TestVarDeclNRVO; return TestVarDeclNRVO; } } // CHECK: VarDecl{{.*}} TestVarDeclNRVO 'testVarDeclNRVO::A' nrvo void testParmVarDeclInit(int TestParmVarDeclInit = 0); // CHECK: ParmVarDecl{{.*}} TestParmVarDeclInit 'int' // CHECK-NEXT: IntegerLiteral{{.*}} namespace TestNamespaceDecl { int i; } // CHECK: NamespaceDecl{{.*}} TestNamespaceDecl // CHECK-NEXT: VarDecl namespace TestNamespaceDecl { int j; } // CHECK: NamespaceDecl{{.*}} TestNamespaceDecl // CHECK-NEXT: original Namespace // CHECK-NEXT: VarDecl inline namespace TestNamespaceDeclInline { } // CHECK: NamespaceDecl{{.*}} TestNamespaceDeclInline inline namespace testUsingDirectiveDecl { namespace A { } } namespace TestUsingDirectiveDecl { using namespace testUsingDirectiveDecl::A; } // CHECK: NamespaceDecl{{.*}} TestUsingDirectiveDecl // CHECK-NEXT: UsingDirectiveDecl{{.*}} Namespace{{.*}} 'A' namespace testNamespaceAlias { namespace A { } } namespace TestNamespaceAlias = testNamespaceAlias::A; // CHECK: NamespaceAliasDecl{{.*}} TestNamespaceAlias // CHECK-NEXT: Namespace{{.*}} 'A' using TestTypeAliasDecl = int; // CHECK: TypeAliasDecl{{.*}} TestTypeAliasDecl 'int' namespace testTypeAliasTemplateDecl { template<typename T> class A; template<typename T> using TestTypeAliasTemplateDecl = A<T>; } // CHECK: TypeAliasTemplateDecl{{.*}} TestTypeAliasTemplateDecl // CHECK-NEXT: TemplateTypeParmDecl // CHECK-NEXT: TypeAliasDecl{{.*}} TestTypeAliasTemplateDecl 'A<T>' namespace testCXXRecordDecl { class TestEmpty {}; // CHECK: CXXRecordDecl{{.*}} class TestEmpty // CHECK-NEXT: DefinitionData pass_in_registers empty aggregate standard_layout trivially_copyable pod trivial literal has_constexpr_non_copy_move_ctor can_const_default_init // CHECK-NEXT: DefaultConstructor exists trivial constexpr // CHECK-NEXT: CopyConstructor simple trivial has_const_param // CHECK-NEXT: MoveConstructor exists simple trivial // CHECK-NEXT: CopyAssignment trivial has_const_param // CHECK-NEXT: MoveAssignment exists simple trivial // CHECK-NEXT: Destructor simple irrelevant trivial class A { }; class B { }; class TestCXXRecordDecl : virtual A, public B { int i; }; } // CHECK: CXXRecordDecl{{.*}} class TestCXXRecordDecl // CHECK-NEXT: DefinitionData{{$}} // CHECK-NEXT: DefaultConstructor exists non_trivial // CHECK-NEXT: CopyConstructor simple non_trivial has_const_param // CHECK-NEXT: MoveConstructor exists simple non_trivial // CHECK-NEXT: CopyAssignment non_trivial has_const_param // CHECK-NEXT: MoveAssignment exists simple non_trivial // CHECK-NEXT: Destructor simple irrelevant trivial // CHECK-NEXT: virtual private 'testCXXRecordDecl::A' // CHECK-NEXT: public 'testCXXRecordDecl::B' // CHECK-NEXT: CXXRecordDecl{{.*}} class TestCXXRecordDecl // CHECK-NEXT: FieldDecl template<class...T> class TestCXXRecordDeclPack : public T... { }; // CHECK: CXXRecordDecl{{.*}} class TestCXXRecordDeclPack // CHECK: public 'T'... // CHECK-NEXT: CXXRecordDecl{{.*}} class TestCXXRecordDeclPack thread_local int TestThreadLocalInt; // CHECK: TestThreadLocalInt {{.*}} tls_dynamic class testCXXMethodDecl { virtual void TestCXXMethodDeclPure() = 0; void TestCXXMethodDeclDelete() = delete; void TestCXXMethodDeclThrow() throw(); void TestCXXMethodDeclThrowType() throw(int); }; // CHECK: CXXMethodDecl{{.*}} TestCXXMethodDeclPure 'void ()' virtual pure // CHECK: CXXMethodDecl{{.*}} TestCXXMethodDeclDelete 'void ()' delete // CHECK: CXXMethodDecl{{.*}} TestCXXMethodDeclThrow 'void () throw()' // CHECK: CXXMethodDecl{{.*}} TestCXXMethodDeclThrowType 'void () throw(int)' namespace testCXXConstructorDecl { class A { }; class TestCXXConstructorDecl : public A { int I; TestCXXConstructorDecl(A &a, int i) : A(a), I(i) { } TestCXXConstructorDecl(A &a) : TestCXXConstructorDecl(a, 0) { } }; } // CHECK: CXXConstructorDecl{{.*}} TestCXXConstructorDecl 'void {{.*}}' // CHECK-NEXT: ParmVarDecl{{.*}} a // CHECK-NEXT: ParmVarDecl{{.*}} i // CHECK-NEXT: CXXCtorInitializer{{.*}}A // CHECK-NEXT: Expr // CHECK: CXXCtorInitializer{{.*}}I // CHECK-NEXT: Expr // CHECK: CompoundStmt // CHECK: CXXConstructorDecl{{.*}} TestCXXConstructorDecl 'void {{.*}}' // CHECK-NEXT: ParmVarDecl{{.*}} a // CHECK-NEXT: CXXCtorInitializer{{.*}}TestCXXConstructorDecl // CHECK-NEXT: CXXConstructExpr{{.*}}TestCXXConstructorDecl class TestCXXDestructorDecl { ~TestCXXDestructorDecl() { } }; // CHECK: CXXDestructorDecl{{.*}} ~TestCXXDestructorDecl 'void () noexcept' // CHECK-NEXT: CompoundStmt // Test that the range of a defaulted members is computed correctly. class TestMemberRanges { public: TestMemberRanges() = default; TestMemberRanges(const TestMemberRanges &Other) = default; TestMemberRanges(TestMemberRanges &&Other) = default; ~TestMemberRanges() = default; TestMemberRanges &operator=(const TestMemberRanges &Other) = default; TestMemberRanges &operator=(TestMemberRanges &&Other) = default; }; void SomeFunction() { TestMemberRanges A; TestMemberRanges B(A); B = A; A = static_cast<TestMemberRanges &&>(B); TestMemberRanges C(static_cast<TestMemberRanges &&>(A)); } // CHECK: CXXConstructorDecl{{.*}} <line:{{.*}}:3, col:30> // CHECK: CXXConstructorDecl{{.*}} <line:{{.*}}:3, col:59> // CHECK: CXXConstructorDecl{{.*}} <line:{{.*}}:3, col:54> // CHECK: CXXDestructorDecl{{.*}} <line:{{.*}}:3, col:31> // CHECK: CXXMethodDecl{{.*}} <line:{{.*}}:3, col:70> // CHECK: CXXMethodDecl{{.*}} <line:{{.*}}:3, col:65> class TestCXXConversionDecl { operator int() { return 0; } }; // CHECK: CXXConversionDecl{{.*}} operator int 'int ()' // CHECK-NEXT: CompoundStmt namespace TestStaticAssertDecl { static_assert(true, "msg"); } // CHECK: NamespaceDecl{{.*}} TestStaticAssertDecl // CHECK-NEXT: StaticAssertDecl{{.*> .*$}} // CHECK-NEXT: CXXBoolLiteralExpr // CHECK-NEXT: StringLiteral namespace testFunctionTemplateDecl { class A { }; class B { }; class C { }; class D { }; template<typename T> void TestFunctionTemplate(T) { } // implicit instantiation void bar(A a) { TestFunctionTemplate(a); } // explicit specialization template<> void TestFunctionTemplate(B); // explicit instantiation declaration extern template void TestFunctionTemplate(C); // explicit instantiation definition template void TestFunctionTemplate(D); } // CHECK: FunctionTemplateDecl 0x{{.+}} <{{.+}}:[[@LINE-14]]:3, col:55> col:29 TestFunctionTemplate // CHECK-NEXT: |-TemplateTypeParmDecl 0x{{.+}} <col:12, col:21> col:21 referenced typename depth 0 index 0 T // CHECK-NEXT: |-FunctionDecl 0x{{.+}} <col:24, col:55> col:29 TestFunctionTemplate 'void (T)' // CHECK-NEXT: | |-ParmVarDecl 0x{{.+}} <col:50> col:51 'T' // CHECK-NEXT: | `-CompoundStmt 0x{{.+}} <col:53, col:55> // CHECK-NEXT: |-FunctionDecl 0x{{.+}} <col:24, col:55> col:29 used TestFunctionTemplate 'void (testFunctionTemplateDecl::A)' // CHECK-NEXT: | |-TemplateArgument type 'testFunctionTemplateDecl::A' // CHECK-NEXT: | |-ParmVarDecl 0x{{.+}} <col:50> col:51 'testFunctionTemplateDecl::A':'testFunctionTemplateDecl::A' // CHECK-NEXT: | `-CompoundStmt 0x{{.+}} <col:53, col:55> // CHECK-NEXT: |-Function 0x{{.+}} 'TestFunctionTemplate' 'void (testFunctionTemplateDecl::B)' // CHECK-NEXT: |-FunctionDecl 0x{{.+}} <col:24, col:55> col:29 TestFunctionTemplate 'void (testFunctionTemplateDecl::C)' // CHECK-NEXT: | |-TemplateArgument type 'testFunctionTemplateDecl::C' // CHECK-NEXT: | `-ParmVarDecl 0x{{.+}} <col:50> col:51 'testFunctionTemplateDecl::C':'testFunctionTemplateDecl::C' // CHECK-NEXT: `-FunctionDecl 0x{{.+}} <col:24, col:55> col:29 TestFunctionTemplate 'void (testFunctionTemplateDecl::D)' // CHECK-NEXT: |-TemplateArgument type 'testFunctionTemplateDecl::D' // CHECK-NEXT: |-ParmVarDecl 0x{{.+}} <col:50> col:51 'testFunctionTemplateDecl::D':'testFunctionTemplateDecl::D' // CHECK-NEXT: `-CompoundStmt 0x{{.+}} <col:53, col:55> // CHECK: FunctionDecl 0x{{.+}} prev 0x{{.+}} <{{.+}}:[[@LINE-26]]:3, col:41> col:19 TestFunctionTemplate 'void (testFunctionTemplateDecl::B)' // CHECK-NEXT: |-TemplateArgument type 'testFunctionTemplateDecl::B' // CHECK-NEXT: `-ParmVarDecl 0x{{.+}} <col:40> col:41 'testFunctionTemplateDecl::B' namespace testClassTemplateDecl { class A { }; class B { }; class C { }; class D { }; template<typename T> class TestClassTemplate { public: TestClassTemplate(); ~TestClassTemplate(); int j(); int i; }; // implicit instantiation TestClassTemplate<A> a; // explicit specialization template<> class TestClassTemplate<B> { int j; }; // explicit instantiation declaration extern template class TestClassTemplate<C>; // explicit instantiation definition template class TestClassTemplate<D>; // partial explicit specialization template<typename T1, typename T2> class TestClassTemplatePartial { int i; }; template<typename T1> class TestClassTemplatePartial<T1, A> { int j; }; template<typename T = int> struct TestTemplateDefaultType; template<typename T> struct TestTemplateDefaultType { }; template<int I = 42> struct TestTemplateDefaultNonType; template<int I> struct TestTemplateDefaultNonType { }; template<template<typename> class TT = TestClassTemplate> struct TestTemplateTemplateDefaultType; template<template<typename> class TT> struct TestTemplateTemplateDefaultType { }; } // CHECK: ClassTemplateDecl 0x{{.+}} <{{.+}}:[[@LINE-40]]:3, line:[[@LINE-34]]:3> line:[[@LINE-40]]:30 TestClassTemplate // CHECK-NEXT: |-TemplateTypeParmDecl 0x{{.+}} <col:12, col:21> col:21 typename depth 0 index 0 T // CHECK-NEXT: |-CXXRecordDecl 0x{{.+}} <col:24, line:[[@LINE-36]]:3> line:[[@LINE-42]]:30 class TestClassTemplate definition // CHECK-NEXT: | |-DefinitionData standard_layout has_user_declared_ctor can_const_default_init // CHECK-NEXT: | | |-DefaultConstructor exists non_trivial user_provided // CHECK-NEXT: | | |-CopyConstructor simple trivial has_const_param needs_implicit implicit_has_const_param // CHECK-NEXT: | | |-MoveConstructor // CHECK-NEXT: | | |-CopyAssignment trivial has_const_param needs_implicit implicit_has_const_param // CHECK-NEXT: | | |-MoveAssignment // CHECK-NEXT: | | `-Destructor non_trivial user_declared // CHECK-NEXT: | |-CXXRecordDecl 0x{{.+}} <col:24, col:30> col:30 implicit referenced class TestClassTemplate // CHECK-NEXT: | |-AccessSpecDecl 0x{{.+}} <line:[[@LINE-50]]:3, col:9> col:3 public // CHECK-NEXT: | |-CXXConstructorDecl 0x{{.+}} <line:[[@LINE-50]]:5, col:23> col:5 TestClassTemplate<T> 'void ()' // CHECK-NEXT: | |-CXXDestructorDecl 0x{{.+}} <line:[[@LINE-50]]:5, col:24> col:5 ~TestClassTemplate<T> 'void ()' // CHECK-NEXT: | |-CXXMethodDecl 0x{{.+}} <line:[[@LINE-50]]:5, col:11> col:9 j 'int ()' // CHECK-NEXT: | `-FieldDecl 0x{{.+}} <line:[[@LINE-50]]:5, col:9> col:9 i 'int' // CHECK-NEXT: |-ClassTemplateSpecializationDecl 0x{{.+}} <line:[[@LINE-56]]:3, line:[[@LINE-50]]:3> line:[[@LINE-56]]:30 class TestClassTemplate definition // CHECK-NEXT: | |-DefinitionData standard_layout has_user_declared_ctor can_const_default_init // CHECK-NEXT: | | |-DefaultConstructor exists non_trivial user_provided // CHECK-NEXT: | | |-CopyConstructor simple trivial has_const_param implicit_has_const_param // CHECK-NEXT: | | |-MoveConstructor // CHECK-NEXT: | | |-CopyAssignment trivial has_const_param needs_implicit implicit_has_const_param // CHECK-NEXT: | | |-MoveAssignment // CHECK-NEXT: | | `-Destructor non_trivial user_declared // CHECK-NEXT: | |-TemplateArgument type 'testClassTemplateDecl::A' // CHECK-NEXT: | |-CXXRecordDecl 0x{{.+}} prev 0x{{.+}} <col:24, col:30> col:30 implicit class TestClassTemplate // CHECK-NEXT: | |-AccessSpecDecl 0x{{.+}} <line:[[@LINE-65]]:3, col:9> col:3 public // CHECK-NEXT: | |-CXXConstructorDecl 0x{{.+}} <line:[[@LINE-65]]:5, col:23> col:5 used TestClassTemplate 'void ()' // CHECK-NEXT: | |-CXXDestructorDecl 0x{{.+}} <line:[[@LINE-65]]:5, col:24> col:5 used ~TestClassTemplate 'void () noexcept' // CHECK-NEXT: | |-CXXMethodDecl 0x{{.+}} <line:[[@LINE-65]]:5, col:11> col:9 j 'int ()' // CHECK-NEXT: | |-FieldDecl 0x{{.+}} <line:[[@LINE-65]]:5, col:9> col:9 i 'int' // CHECK-NEXT: | `-CXXConstructorDecl 0x{{.+}} <line:[[@LINE-71]]:30> col:30 implicit constexpr TestClassTemplate 'void (const testClassTemplateDecl::TestClassTemplate<testClassTemplateDecl::A> &)' inline default trivial noexcept-unevaluated 0x{{.+}} // CHECK-NEXT: | `-ParmVarDecl 0x{{.+}} <col:30> col:30 'const testClassTemplateDecl::TestClassTemplate<testClassTemplateDecl::A> &' // CHECK-NEXT: |-ClassTemplateSpecialization 0x{{.+}} 'TestClassTemplate' // CHECK-NEXT: |-ClassTemplateSpecialization 0x{{.+}} 'TestClassTemplate' // CHECK-NEXT: `-ClassTemplateSpecialization 0x{{.+}} 'TestClassTemplate' // CHECK: ClassTemplateSpecializationDecl 0x{{.+}} <{{.+}}:[[@LINE-65]]:3, line:[[@LINE-63]]:3> line:[[@LINE-65]]:20 class TestClassTemplate definition // CHECK-NEXT: |-DefinitionData pass_in_registers standard_layout trivially_copyable trivial literal // CHECK-NEXT: | |-DefaultConstructor exists trivial needs_implicit // CHECK-NEXT: | |-CopyConstructor simple trivial has_const_param needs_implicit implicit_has_const_param // CHECK-NEXT: | |-MoveConstructor exists simple trivial needs_implicit // CHECK-NEXT: | |-CopyAssignment trivial has_const_param needs_implicit implicit_has_const_param // CHECK-NEXT: | |-MoveAssignment exists simple trivial needs_implicit // CHECK-NEXT: | `-Destructor simple irrelevant trivial needs_implicit // CHECK-NEXT: |-TemplateArgument type 'testClassTemplateDecl::B' // CHECK-NEXT: |-CXXRecordDecl 0x{{.+}} <col:14, col:20> col:20 implicit class TestClassTemplate // CHECK-NEXT: `-FieldDecl 0x{{.+}} <line:[[@LINE-74]]:5, col:9> col:9 j 'int' // CHECK: ClassTemplateSpecializationDecl 0x{{.+}} <{{.+}}:256:3, col:44> col:25 class TestClassTemplate definition // CHECK-NEXT: |-DefinitionData standard_layout has_user_declared_ctor can_const_default_init // CHECK-NEXT: | |-DefaultConstructor exists non_trivial user_provided // CHECK-NEXT: | |-CopyConstructor simple trivial has_const_param needs_implicit implicit_has_const_param // CHECK-NEXT: | |-MoveConstructor // CHECK-NEXT: | |-CopyAssignment trivial has_const_param needs_implicit implicit_has_const_param // CHECK-NEXT: | |-MoveAssignment // CHECK-NEXT: | `-Destructor non_trivial user_declared // CHECK-NEXT: |-TemplateArgument type 'testClassTemplateDecl::C' // CHECK-NEXT: |-CXXRecordDecl 0x{{.+}} prev 0x{{.+}} <line:[[@LINE-98]]:24, col:30> col:30 implicit class TestClassTemplate // CHECK-NEXT: |-AccessSpecDecl 0x{{.+}} <line:[[@LINE-98]]:3, col:9> col:3 public // CHECK-NEXT: |-CXXConstructorDecl 0x{{.+}} <line:[[@LINE-98]]:5, col:23> col:5 TestClassTemplate 'void ()' // CHECK-NEXT: |-CXXDestructorDecl 0x{{.+}} <line:[[@LINE-98]]:5, col:24> col:5 ~TestClassTemplate 'void ()' noexcept-unevaluated 0x{{.+}} // CHECK-NEXT: |-CXXMethodDecl 0x{{.+}} <line:[[@LINE-98]]:5, col:11> col:9 j 'int ()' // CHECK-NEXT: `-FieldDecl 0x{{.+}} <line:[[@LINE-98]]:5, col:9> col:9 i 'int' // CHECK: ClassTemplateSpecializationDecl 0x{{.+}} <{{.+}}:[[@LINE-85]]:3, col:37> col:18 class TestClassTemplate definition // CHECK-NEXT: |-DefinitionData standard_layout has_user_declared_ctor can_const_default_init // CHECK-NEXT: | |-DefaultConstructor exists non_trivial user_provided // CHECK-NEXT: | |-CopyConstructor simple trivial has_const_param needs_implicit implicit_has_const_param // CHECK-NEXT: | |-MoveConstructor // CHECK-NEXT: | |-CopyAssignment trivial has_const_param needs_implicit implicit_has_const_param // CHECK-NEXT: | |-MoveAssignment // CHECK-NEXT: | `-Destructor non_trivial user_declared // CHECK-NEXT: |-TemplateArgument type 'testClassTemplateDecl::D' // CHECK-NEXT: |-CXXRecordDecl 0x{{.+}} prev 0x{{.+}} <line:[[@LINE-114]]:24, col:30> col:30 implicit class TestClassTemplate // CHECK-NEXT: |-AccessSpecDecl 0x{{.+}} <line:[[@LINE-114]]:3, col:9> col:3 public // CHECK-NEXT: |-CXXConstructorDecl 0x{{.+}} <line:[[@LINE-114]]:5, col:23> col:5 TestClassTemplate 'void ()' // CHECK-NEXT: |-CXXDestructorDecl 0x{{.+}} <line:[[@LINE-114]]:5, col:24> col:5 ~TestClassTemplate 'void ()' noexcept-unevaluated 0x{{.+}} // CHECK-NEXT: |-CXXMethodDecl 0x{{.+}} <line:[[@LINE-114]]:5, col:11> col:9 j 'int ()' // CHECK-NEXT: `-FieldDecl 0x{{.+}} <line:[[@LINE-114]]:5, col:9> col:9 i 'int' // CHECK: ClassTemplateDecl 0x{{.+}} <{{.+}}:[[@LINE-98]]:3, line:[[@LINE-96]]:3> line:[[@LINE-98]]:44 TestClassTemplatePartial // CHECK-NEXT: |-TemplateTypeParmDecl 0x{{.+}} <col:12, col:21> col:21 typename depth 0 index 0 T1 // CHECK-NEXT: |-TemplateTypeParmDecl 0x{{.+}} <col:25, col:34> col:34 typename depth 0 index 1 T2 // CHECK-NEXT: `-CXXRecordDecl 0x{{.+}} <col:38, line:[[@LINE-99]]:3> line:[[@LINE-101]]:44 class TestClassTemplatePartial definition // CHECK-NEXT: |-DefinitionData standard_layout trivially_copyable trivial literal // CHECK-NEXT: | |-DefaultConstructor exists trivial needs_implicit // CHECK-NEXT: | |-CopyConstructor simple trivial has_const_param needs_implicit implicit_has_const_param // CHECK-NEXT: | |-MoveConstructor exists simple trivial needs_implicit // CHECK-NEXT: | |-CopyAssignment trivial has_const_param needs_implicit implicit_has_const_param // CHECK-NEXT: | |-MoveAssignment exists simple trivial needs_implicit // CHECK-NEXT: | `-Destructor simple irrelevant trivial needs_implicit // CHECK-NEXT: |-CXXRecordDecl 0x{{.+}} <col:38, col:44> col:44 implicit class TestClassTemplatePartial // CHECK-NEXT: `-FieldDecl 0x{{.+}} <line:[[@LINE-109]]:5, col:9> col:9 i 'int' // CHECK: ClassTemplatePartialSpecializationDecl 0x{{.+}} <{{.+}}:[[@LINE-109]]:3, line:[[@LINE-107]]:3> line:[[@LINE-109]]:31 class TestClassTemplatePartial definition // CHECK-NEXT: |-DefinitionData standard_layout trivially_copyable trivial literal // CHECK-NEXT: | |-DefaultConstructor exists trivial needs_implicit // CHECK-NEXT: | |-CopyConstructor simple trivial has_const_param needs_implicit implicit_has_const_param // CHECK-NEXT: | |-MoveConstructor exists simple trivial needs_implicit // CHECK-NEXT: | |-CopyAssignment trivial has_const_param needs_implicit implicit_has_const_param // CHECK-NEXT: | |-MoveAssignment exists simple trivial needs_implicit // CHECK-NEXT: | `-Destructor simple irrelevant trivial needs_implicit // CHECK-NEXT: |-TemplateArgument type 'type-parameter-0-0' // CHECK-NEXT: |-TemplateArgument type 'testClassTemplateDecl::A' // CHECK-NEXT: |-TemplateTypeParmDecl 0x{{.+}} <col:12, col:21> col:21 referenced typename depth 0 index 0 T1 // CHECK-NEXT: |-CXXRecordDecl 0x{{.+}} <col:25, col:31> col:31 implicit class TestClassTemplatePartial // CHECK-NEXT: `-FieldDecl 0x{{.+}} <line:[[@LINE-120]]:5, col:9> col:9 j 'int' // CHECK: ClassTemplateDecl 0x{{.+}} <{{.+}}:[[@LINE-119]]:3, col:37> col:37 TestTemplateDefaultType // CHECK-NEXT: |-TemplateTypeParmDecl 0x{{.+}} <col:12, col:25> col:21 typename depth 0 index 0 T // CHECK-NEXT: | `-TemplateArgument type 'int' // CHECK-NEXT: `-CXXRecordDecl 0x{{.+}} <col:30, col:37> col:37 struct TestTemplateDefaultType // CHECK: ClassTemplateDecl 0x{{.+}} prev 0x{{.+}} <{{.+}}:[[@LINE-123]]:3, col:57> col:31 TestTemplateDefaultType // CHECK-NEXT: |-TemplateTypeParmDecl 0x{{.+}} <col:12, col:21> col:21 typename depth 0 index 0 T // CHECK-NEXT: | `-TemplateArgument type 'int' // CHECK-NEXT: | `-inherited from TemplateTypeParm 0x{{.+}} 'T' // CHECK-NEXT: `-CXXRecordDecl 0x{{.+}} prev 0x{{.+}} <col:24, col:57> col:31 struct TestTemplateDefaultType definition // CHECK-NEXT: |-DefinitionData empty aggregate standard_layout trivially_copyable pod trivial literal has_constexpr_non_copy_move_ctor can_const_default_init // CHECK-NEXT: | |-DefaultConstructor exists trivial constexpr needs_implicit defaulted_is_constexpr // CHECK-NEXT: | |-CopyConstructor simple trivial has_const_param needs_implicit implicit_has_const_param // CHECK-NEXT: | |-MoveConstructor exists simple trivial needs_implicit // CHECK-NEXT: | |-CopyAssignment trivial has_const_param needs_implicit implicit_has_const_param // CHECK-NEXT: | |-MoveAssignment exists simple trivial needs_implicit // CHECK-NEXT: | `-Destructor simple irrelevant trivial needs_implicit // CHECK-NEXT: `-CXXRecordDecl 0x{{.+}} <col:24, col:31> col:31 implicit struct TestTemplateDefaultType // CHECK: ClassTemplateDecl 0x{{.+}} <{{.+}}:[[@LINE-135]]:3, col:31> col:31 TestTemplateDefaultNonType // CHECK-NEXT: |-NonTypeTemplateParmDecl 0x{{.+}} <col:12, col:20> col:16 'int' depth 0 index 0 I // CHECK-NEXT: | `-TemplateArgument expr // CHECK-NEXT: | `-ConstantExpr 0x{{.+}} <col:20> 'int' // CHECK-NEXT: | `-IntegerLiteral 0x{{.+}} <col:20> 'int' 42 // CHECK-NEXT: `-CXXRecordDecl 0x{{.+}} <col:24, col:31> col:31 struct TestTemplateDefaultNonType // CHECK: ClassTemplateDecl 0x{{.+}} <{{.+}}:275:3, col:68> col:68 TestTemplateTemplateDefaultType // CHECK-NEXT: |-TemplateTemplateParmDecl 0x{{.+}} <col:12, col:42> col:37 depth 0 index 0 TT // CHECK-NEXT: | |-TemplateTypeParmDecl 0x{{.+}} <col:21> col:21 typename depth 1 index 0 // CHECK-NEXT: | `-TemplateArgument <col:42> template TestClassTemplate // CHECK-NEXT: `-CXXRecordDecl 0x{{.+}} <col:61, col:68> col:68 struct TestTemplateTemplateDefaultType // CHECK: ClassTemplateDecl 0x{{.+}} prev 0x{{.+}} <{{.+}}:276:3, col:82> col:48 TestTemplateTemplateDefaultType // CHECK-NEXT: |-TemplateTemplateParmDecl 0x{{.+}} <col:12, col:37> col:37 depth 0 index 0 TT // CHECK-NEXT: | |-TemplateTypeParmDecl 0x{{.+}} <col:21> col:21 typename depth 1 index 0 // CHECK-NEXT: | `-TemplateArgument <line:275:42> template TestClassTemplate // CHECK-NEXT: | `-inherited from TemplateTemplateParm 0x{{.+}} 'TT' // CHECK-NEXT: `-CXXRecordDecl 0x{{.+}} prev 0x{{.+}} <line:276:41, col:82> col:48 struct TestTemplateTemplateDefaultType definition // CHECK-NEXT: |-DefinitionData empty aggregate standard_layout trivially_copyable pod trivial literal has_constexpr_non_copy_move_ctor can_const_default_init // CHECK-NEXT: | |-DefaultConstructor exists trivial constexpr needs_implicit defaulted_is_constexpr // CHECK-NEXT: | |-CopyConstructor simple trivial has_const_param needs_implicit implicit_has_const_param // CHECK-NEXT: | |-MoveConstructor exists simple trivial needs_implicit // CHECK-NEXT: | |-CopyAssignment trivial has_const_param needs_implicit implicit_has_const_param // CHECK-NEXT: | |-MoveAssignment exists simple trivial needs_implicit // CHECK-NEXT: | `-Destructor simple irrelevant trivial needs_implicit // CHECK-NEXT: `-CXXRecordDecl 0x{{.+}} <col:41, col:48> col:48 implicit struct TestTemplateTemplateDefaultType // PR15220 dump instantiation only once namespace testCanonicalTemplate { class A {}; template<typename T> void TestFunctionTemplate(T); template<typename T> void TestFunctionTemplate(T); void bar(A a) { TestFunctionTemplate(a); } // CHECK: FunctionTemplateDecl 0x{{.+}} <{{.+}}:[[@LINE-3]]:3, col:51> col:29 TestFunctionTemplate // CHECK-NEXT: |-TemplateTypeParmDecl 0x{{.+}} <col:12, col:21> col:21 referenced typename depth 0 index 0 T // CHECK-NEXT: |-FunctionDecl 0x{{.*}} <col:24, col:51> col:29 TestFunctionTemplate 'void (T)' // CHECK-NEXT: | `-ParmVarDecl 0x{{.*}} <col:50> col:51 'T' // CHECK-NEXT: `-FunctionDecl 0x{{.*}} <line:[[@LINE-6]]:24, col:51> col:29 used TestFunctionTemplate 'void (testCanonicalTemplate::A)' // CHECK-NEXT: |-TemplateArgument type 'testCanonicalTemplate::A' // CHECK-NEXT: `-ParmVarDecl 0x{{.*}} <col:50> col:51 'testCanonicalTemplate::A':'testCanonicalTemplate::A' // CHECK: FunctionTemplateDecl 0x{{.+}} prev 0x{{.+}} <{{.+}}:[[@LINE-10]]:3, col:51> col:29 TestFunctionTemplate // CHECK-NEXT: |-TemplateTypeParmDecl 0x{{.+}} <col:12, col:21> col:21 referenced typename depth 0 index 0 T // CHECK-NEXT: |-FunctionDecl{{.*}} 0x{{.+}} prev 0x{{.+}} <col:24, col:51> col:29 TestFunctionTemplate 'void (T)' // CHECK-NEXT: | `-ParmVarDecl 0x{{.+}} <col:50> col:51 'T' // CHECK-NEXT: `-Function 0x{{.+}} 'TestFunctionTemplate' 'void (testCanonicalTemplate::A)' // CHECK-NOT: TemplateArgument template<typename T1> class TestClassTemplate { template<typename T2> friend class TestClassTemplate; }; TestClassTemplate<A> a; // CHECK: ClassTemplateDecl 0x{{.+}} <{{.+}}:[[@LINE-4]]:3, line:[[@LINE-2]]:3> line:[[@LINE-4]]:31 TestClassTemplate // CHECK-NEXT: |-TemplateTypeParmDecl 0x{{.+}} <col:12, col:21> col:21 typename depth 0 index 0 T1 // CHECK-NEXT: |-CXXRecordDecl 0x{{.+}} <col:25, line:[[@LINE-4]]:3> line:[[@LINE-6]]:31 class TestClassTemplate definition // CHECK-NEXT: | |-DefinitionData empty aggregate standard_layout trivially_copyable pod trivial literal has_constexpr_non_copy_move_ctor can_const_default_init // CHECK-NEXT: | | |-DefaultConstructor exists trivial constexpr needs_implicit defaulted_is_constexpr // CHECK-NEXT: | | |-CopyConstructor simple trivial has_const_param needs_implicit implicit_has_const_param // CHECK-NEXT: | | |-MoveConstructor exists simple trivial needs_implicit // CHECK-NEXT: | | |-CopyAssignment trivial has_const_param needs_implicit implicit_has_const_param // CHECK-NEXT: | | |-MoveAssignment exists simple trivial needs_implicit // CHECK-NEXT: | | `-Destructor simple irrelevant trivial needs_implicit // CHECK-NEXT: | |-CXXRecordDecl 0x{{.+}} <col:25, col:31> col:31 implicit class TestClassTemplate // CHECK-NEXT: | `-FriendDecl 0x{{.+}} <line:[[@LINE-14]]:5, col:40> col:40 // CHECK-NEXT: | `-ClassTemplateDecl 0x{{.+}} parent 0x{{.+}} <col:5, col:40> col:40 TestClassTemplate // CHECK-NEXT: | |-TemplateTypeParmDecl 0x{{.+}} <col:14, col:23> col:23 typename depth 1 index 0 T2 // CHECK-NEXT: | `-CXXRecordDecl 0x{{.+}} parent 0x{{.+}} <col:34, col:40> col:40 class TestClassTemplate // CHECK-NEXT: `-ClassTemplateSpecializationDecl 0x{{.+}} <line:[[@LINE-19]]:3, line:[[@LINE-17]]:3> line:[[@LINE-19]]:31 class TestClassTemplate definition // CHECK-NEXT: |-DefinitionData pass_in_registers empty aggregate standard_layout trivially_copyable pod trivial literal has_constexpr_non_copy_move_ctor can_const_default_init // CHECK-NEXT: | |-DefaultConstructor exists trivial constexpr defaulted_is_constexpr // CHECK-NEXT: | |-CopyConstructor simple trivial has_const_param implicit_has_const_param // CHECK-NEXT: | |-MoveConstructor exists simple trivial // CHECK-NEXT: | |-CopyAssignment trivial has_const_param needs_implicit implicit_has_const_param // CHECK-NEXT: | |-MoveAssignment exists simple trivial needs_implicit // CHECK-NEXT: | `-Destructor simple irrelevant trivial needs_implicit // CHECK-NEXT: |-TemplateArgument type 'testCanonicalTemplate::A' // CHECK-NEXT: |-CXXRecordDecl 0x{{.+}} prev 0x{{.+}} <col:25, col:31> col:31 implicit class TestClassTemplate // CHECK-NEXT: |-FriendDecl 0x{{.+}} <line:[[@LINE-28]]:5, col:40> col:40 // CHECK-NEXT: | `-ClassTemplateDecl 0x{{.+}} parent 0x{{.+}} prev 0x{{.+}} <col:5, col:40> col:40 TestClassTemplate // CHECK-NEXT: | |-TemplateTypeParmDecl 0x{{.+}} <col:14, col:23> col:23 typename depth 0 index 0 T2 // CHECK-NEXT: | |-CXXRecordDecl 0x{{.+}} parent 0x{{.+}} prev 0x{{.+}} <col:34, col:40> col:40 class TestClassTemplate // CHECK-NEXT: | `-ClassTemplateSpecialization 0x{{.+}} 'TestClassTemplate' // CHECK-NEXT: |-CXXConstructorDecl 0x{{.+}} <line:[[@LINE-34]]:31> col:31 implicit used constexpr TestClassTemplate 'void () noexcept' inline default trivial // CHECK-NEXT: | `-CompoundStmt 0x{{.+}} <col:31> // CHECK-NEXT: |-CXXConstructorDecl 0x{{.+}} <col:31> col:31 implicit constexpr TestClassTemplate 'void (const testCanonicalTemplate::TestClassTemplate<testCanonicalTemplate::A> &)' inline default trivial noexcept-unevaluated 0x{{.+}} // CHECK-NEXT: | `-ParmVarDecl 0x{{.+}} <col:31> col:31 'const testCanonicalTemplate::TestClassTemplate<testCanonicalTemplate::A> &' // CHECK-NEXT: `-CXXConstructorDecl 0x{{.+}} <col:31> col:31 implicit constexpr TestClassTemplate 'void (testCanonicalTemplate::TestClassTemplate<testCanonicalTemplate::A> &&)' inline default trivial noexcept-unevaluated 0x{{.+}} // CHECK-NEXT: `-ParmVarDecl 0x{{.+}} <col:31> col:31 'testCanonicalTemplate::TestClassTemplate<testCanonicalTemplate::A> &&' template<typename T1> class TestClassTemplate2; template<typename T1> class TestClassTemplate2; template<typename T1> class TestClassTemplate2 { }; TestClassTemplate2<A> a2; // CHECK: ClassTemplateDecl 0x{{.+}} <{{.+}}:[[@LINE-5]]:3, col:31> col:31 TestClassTemplate2 // CHECK-NEXT: |-TemplateTypeParmDecl 0x{{.+}} <col:12, col:21> col:21 typename depth 0 index 0 T1 // CHECK-NEXT: |-CXXRecordDecl 0x{{.+}} <col:25, col:31> col:31 class TestClassTemplate2 // CHECK-NEXT: `-ClassTemplateSpecializationDecl 0x{{.+}} <line:[[@LINE-6]]:3, line:[[@LINE-5]]:3> line:[[@LINE-6]]:31 class TestClassTemplate2 definition // CHECK-NEXT: |-DefinitionData pass_in_registers empty aggregate standard_layout trivially_copyable pod trivial literal has_constexpr_non_copy_move_ctor can_const_default_init // CHECK-NEXT: | |-DefaultConstructor exists trivial constexpr defaulted_is_constexpr // CHECK-NEXT: | |-CopyConstructor simple trivial has_const_param implicit_has_const_param // CHECK-NEXT: | |-MoveConstructor exists simple trivial // CHECK-NEXT: | |-CopyAssignment trivial has_const_param needs_implicit implicit_has_const_param // CHECK-NEXT: | |-MoveAssignment exists simple trivial needs_implicit // CHECK-NEXT: | `-Destructor simple irrelevant trivial needs_implicit // CHECK-NEXT: |-TemplateArgument type 'testCanonicalTemplate::A' // CHECK-NEXT: |-CXXRecordDecl 0x{{.+}} prev 0x{{.+}} <col:25, col:31> col:31 implicit class TestClassTemplate2 // CHECK-NEXT: |-CXXConstructorDecl 0x{{.+}} <col:31> col:31 implicit used constexpr TestClassTemplate2 'void () noexcept' inline default trivial // CHECK-NEXT: | `-CompoundStmt 0x{{.+}} <col:31> // CHECK-NEXT: |-CXXConstructorDecl 0x{{.+}} <col:31> col:31 implicit constexpr TestClassTemplate2 'void (const testCanonicalTemplate::TestClassTemplate2<testCanonicalTemplate::A> &)' inline default trivial noexcept-unevaluated 0x{{.+}} // CHECK-NEXT: | `-ParmVarDecl 0x{{.+}} <col:31> col:31 'const testCanonicalTemplate::TestClassTemplate2<testCanonicalTemplate::A> &' // CHECK-NEXT: `-CXXConstructorDecl 0x{{.+}} <col:31> col:31 implicit constexpr TestClassTemplate2 'void (testCanonicalTemplate::TestClassTemplate2<testCanonicalTemplate::A> &&)' inline default trivial noexcept-unevaluated 0x{{.+}} // CHECK-NEXT: `-ParmVarDecl 0x{{.+}} <col:31> col:31 'testCanonicalTemplate::TestClassTemplate2<testCanonicalTemplate::A> &&' // CHECK: ClassTemplateDecl 0x{{.+}} prev 0x{{.+}} <{{.+}}:[[@LINE-24]]:3, col:31> col:31 TestClassTemplate2 // CHECK-NEXT: |-TemplateTypeParmDecl 0x{{.+}} <col:12, col:21> col:21 typename depth 0 index 0 T1 // CHECK-NEXT: |-CXXRecordDecl 0x{{.+}} prev 0x{{.+}} <col:25, col:31> col:31 class TestClassTemplate2 // CHECK-NEXT: `-ClassTemplateSpecialization 0x{{.+}} 'TestClassTemplate2' // CHECK: ClassTemplateDecl 0x{{.+}} prev 0x{{.+}} <{{.+}}:[[@LINE-28]]:3, line:[[@LINE-27]]:3> line:[[@LINE-28]]:31 TestClassTemplate2 // CHECK-NEXT: |-TemplateTypeParmDecl 0x{{.+}} <col:12, col:21> col:21 typename depth 0 index 0 T1 // CHECK-NEXT: |-CXXRecordDecl 0x{{.+}} prev 0x{{.+}} <col:25, line:[[@LINE-29]]:3> line:[[@LINE-30]]:31 class TestClassTemplate2 definition // CHECK-NEXT: | |-DefinitionData empty aggregate standard_layout trivially_copyable pod trivial literal has_constexpr_non_copy_move_ctor can_const_default_init // CHECK-NEXT: | | |-DefaultConstructor exists trivial constexpr needs_implicit defaulted_is_constexpr // CHECK-NEXT: | | |-CopyConstructor simple trivial has_const_param needs_implicit implicit_has_const_param // CHECK-NEXT: | | |-MoveConstructor exists simple trivial needs_implicit // CHECK-NEXT: | | |-CopyAssignment trivial has_const_param needs_implicit implicit_has_const_param // CHECK-NEXT: | | |-MoveAssignment exists simple trivial needs_implicit // CHECK-NEXT: | | `-Destructor simple irrelevant trivial needs_implicit // CHECK-NEXT: | `-CXXRecordDecl 0x{{.+}} <col:25, col:31> col:31 implicit class TestClassTemplate2 // CHECK-NEXT: `-ClassTemplateSpecialization 0x{{.+}} 'TestClassTemplate2' struct S { template<typename T> static const T TestVarTemplate; // declaration of a static data member template }; template<typename T> const T S::TestVarTemplate = { }; // definition of a static data member template void f() { int i = S::TestVarTemplate<int>; int j = S::TestVarTemplate<int>; } // CHECK: VarTemplateDecl 0x{{.+}} <{{.+}}:[[@LINE-11]]:7, col:43> col:43 TestVarTemplate // CHECK-NEXT: |-TemplateTypeParmDecl 0x{{.+}} <col:16, col:25> col:25 referenced typename depth 0 index 0 T // CHECK-NEXT: |-VarDecl 0x{{.+}} <col:28, col:43> col:43 TestVarTemplate 'const T' static // CHECK-NEXT: |-VarTemplateSpecializationDecl 0x{{.+}} parent 0x{{.+}} prev 0x{{.+}} <line:[[@LINE-11]]:3, col:34> col:14 referenced TestVarTemplate 'const int':'const int' cinit // CHECK-NEXT: | |-TemplateArgument type 'int' // CHECK-NEXT: | `-InitListExpr 0x{{.+}} <col:32, col:34> 'int':'int' // CHECK-NEXT: `-VarTemplateSpecializationDecl 0x{{.+}} <line:[[@LINE-17]]:28, col:43> col:43 referenced TestVarTemplate 'const int':'const int' static // CHECK-NEXT: `-TemplateArgument type 'int' // CHECK: VarTemplateSpecializationDecl 0x{{.+}} <{{.+}}:[[@LINE-20]]:28, col:43> col:43 referenced TestVarTemplate 'const int':'const int' static // CHECK-NEXT:`-TemplateArgument type 'int' // CHECK: VarTemplateDecl 0x{{.+}} parent 0x{{.+}} prev 0x{{.+}} <{{.+}}:[[@LINE-21]]:3, line:[[@LINE-20]]:34> col:14 TestVarTemplate // CHECK-NEXT: |-TemplateTypeParmDecl 0x{{.+}} <line:[[@LINE-22]]:12, col:21> col:21 referenced typename depth 0 index 0 T // CHECK-NEXT: |-VarDecl 0x{{.+}} parent 0x{{.+}} prev 0x{{.+}} <line:[[@LINE-22]]:3, col:34> col:14 TestVarTemplate 'const T' cinit // CHECK-NEXT: | `-InitListExpr 0x{{.+}} <col:32, col:34> 'void' // CHECK-NEXT: |-VarTemplateSpecialization 0x{{.+}} 'TestVarTemplate' 'const int':'const int' // CHECK-NEXT: `-VarTemplateSpecialization 0x{{.+}} 'TestVarTemplate' 'const int':'const int' // CHECK: VarTemplateSpecializationDecl 0x{{.+}} parent 0x{{.+}} prev 0x{{.+}} <{{.+}}:[[@LINE-27]]:3, col:34> col:14 referenced TestVarTemplate 'const int':'const int' cinit // CHECK-NEXT: |-TemplateArgument type 'int' // CHECK-NEXT: `-InitListExpr 0x{{.+}} <col:32, col:34> 'int':'int' } template <class T> class TestClassScopeFunctionSpecialization { template<class U> void foo(U a) { } template<> void foo<int>(int a) { } }; // CHECK: ClassScopeFunctionSpecializationDecl // CHECK-NEXT: CXXMethod{{.*}} foo 'void (int)' // CHECK-NEXT: ParmVarDecl // CHECK-NEXT: CompoundStmt // CHECK-NEXT: TemplateArgument{{.*}} 'int' namespace TestTemplateTypeParmDecl { template<typename ... T, class U = int> void foo(); } // CHECK: NamespaceDecl{{.*}} TestTemplateTypeParmDecl // CHECK-NEXT: FunctionTemplateDecl // CHECK-NEXT: TemplateTypeParmDecl{{.*}} typename depth 0 index 0 ... T // CHECK-NEXT: TemplateTypeParmDecl{{.*}} class depth 0 index 1 U // CHECK-NEXT: TemplateArgument type 'int' namespace TestNonTypeTemplateParmDecl { template<int I = 1, int ... J> void foo(); } // CHECK: NamespaceDecl{{.*}} TestNonTypeTemplateParmDecl // CHECK-NEXT: FunctionTemplateDecl // CHECK-NEXT: NonTypeTemplateParmDecl{{.*}} 'int' depth 0 index 0 I // CHECK-NEXT: TemplateArgument expr // CHECK-NEXT: ConstantExpr{{.*}} 'int' // CHECK-NEXT: IntegerLiteral{{.*}} 'int' 1 // CHECK-NEXT: NonTypeTemplateParmDecl{{.*}} 'int' depth 0 index 1 ... J namespace TestTemplateTemplateParmDecl { template<typename T> class A; template <template <typename> class T = A, template <typename> class ... U> void foo(); } // CHECK: NamespaceDecl{{.*}} TestTemplateTemplateParmDecl // CHECK: FunctionTemplateDecl // CHECK-NEXT: TemplateTemplateParmDecl{{.*}} T // CHECK-NEXT: TemplateTypeParmDecl{{.*}} typename // CHECK-NEXT: TemplateArgument{{.*}} template A // CHECK-NEXT: TemplateTemplateParmDecl{{.*}} ... U // CHECK-NEXT: TemplateTypeParmDecl{{.*}} typename namespace TestTemplateArgument { template<typename> class A { }; template<template<typename> class ...> class B { }; int foo(); template<typename> class testType { }; template class testType<int>; // CHECK: ClassTemplateSpecializationDecl{{.*}} class testType // CHECK: TemplateArgument{{.*}} type 'int' template<int fp(void)> class testDecl { }; template class testDecl<foo>; // CHECK: ClassTemplateSpecializationDecl{{.*}} class testDecl // CHECK: TemplateArgument{{.*}} decl // CHECK-NEXT: Function{{.*}}foo template class testDecl<nullptr>; // CHECK: ClassTemplateSpecializationDecl{{.*}} class testDecl // CHECK: TemplateArgument{{.*}} nullptr template<int> class testIntegral { }; template class testIntegral<1>; // CHECK: ClassTemplateSpecializationDecl{{.*}} class testIntegral // CHECK: TemplateArgument{{.*}} integral 1 template<template<typename> class> class testTemplate { }; template class testTemplate<A>; // CHECK: ClassTemplateSpecializationDecl{{.*}} class testTemplate // CHECK: TemplateArgument{{.*}} A template<template<typename> class ...T> class C { B<T...> testTemplateExpansion; }; // FIXME: Need TemplateSpecializationType dumping to test TemplateExpansion. template<int, int = 0> class testExpr; template<int I> class testExpr<I> { }; // CHECK: ClassTemplatePartialSpecializationDecl{{.*}} class testExpr // CHECK: TemplateArgument{{.*}} expr // CHECK-NEXT: DeclRefExpr{{.*}}I template<int, int ...> class testPack { }; template class testPack<0, 1, 2>; // CHECK: ClassTemplateSpecializationDecl{{.*}} class testPack // CHECK: TemplateArgument{{.*}} integral 0 // CHECK-NEXT: TemplateArgument{{.*}} pack // CHECK-NEXT: TemplateArgument{{.*}} integral 1 // CHECK-NEXT: TemplateArgument{{.*}} integral 2 } namespace testUsingDecl { int i; } namespace TestUsingDecl { using testUsingDecl::i; } // CHECK: NamespaceDecl{{.*}} TestUsingDecl // CHECK-NEXT: UsingDecl{{.*}} testUsingDecl::i // CHECK-NEXT: UsingShadowDecl{{.*}} Var{{.*}} 'i' 'int' namespace testUnresolvedUsing { class A { }; template<class T> class B { public: A a; }; template<class T> class TestUnresolvedUsing : public B<T> { using typename B<T>::a; using B<T>::a; }; } // CHECK: CXXRecordDecl{{.*}} TestUnresolvedUsing // CHECK: UnresolvedUsingTypenameDecl{{.*}} B<T>::a // CHECK: UnresolvedUsingValueDecl{{.*}} B<T>::a namespace TestLinkageSpecDecl { extern "C" void test1(); extern "C++" void test2(); } // CHECK: NamespaceDecl{{.*}} TestLinkageSpecDecl // CHECK-NEXT: LinkageSpecDecl{{.*}} C // CHECK-NEXT: FunctionDecl // CHECK-NEXT: LinkageSpecDecl{{.*}} C++ // CHECK-NEXT: FunctionDecl class TestAccessSpecDecl { public: private: protected: }; // CHECK: CXXRecordDecl{{.*}} class TestAccessSpecDecl // CHECK: CXXRecordDecl{{.*}} class TestAccessSpecDecl // CHECK-NEXT: AccessSpecDecl{{.*}} public // CHECK-NEXT: AccessSpecDecl{{.*}} private // CHECK-NEXT: AccessSpecDecl{{.*}} protected template<typename T> class TestFriendDecl { friend int foo(); friend class A; friend T; }; // CHECK: CXXRecord{{.*}} TestFriendDecl // CHECK: CXXRecord{{.*}} TestFriendDecl // CHECK-NEXT: FriendDecl // CHECK-NEXT: FunctionDecl{{.*}} foo // CHECK-NEXT: FriendDecl{{.*}} 'class A':'A' // CHECK-NEXT: FriendDecl{{.*}} 'T' namespace TestFileScopeAsmDecl { asm("ret"); } // CHECK: NamespaceDecl{{.*}} TestFileScopeAsmDecl{{$}} // CHECK: FileScopeAsmDecl{{.*> .*$}} // CHECK-NEXT: StringLiteral namespace TestFriendDecl2 { void f(); struct S { friend void f(); }; } // CHECK: NamespaceDecl [[TestFriendDecl2:0x.*]] <{{.*}}> {{.*}} TestFriendDecl2 // CHECK: |-FunctionDecl [[TestFriendDecl2_f:0x.*]] <{{.*}}> {{.*}} f 'void ()' // CHECK: `-CXXRecordDecl {{.*}} struct S // CHECK: |-CXXRecordDecl {{.*}} struct S // CHECK: `-FriendDecl // CHECK: `-FunctionDecl {{.*}} parent [[TestFriendDecl2]] prev [[TestFriendDecl2_f]] <{{.*}}> {{.*}} f 'void ()' namespace Comment { extern int Test; /// Something here. extern int Test; extern int Test; } // CHECK: VarDecl {{.*}} Test 'int' extern // CHECK-NOT: FullComment // CHECK: VarDecl {{.*}} Test 'int' extern // CHECK: `-FullComment // CHECK: `-ParagraphComment // CHECK: `-TextComment // CHECK: VarDecl {{.*}} Test 'int' extern // CHECK-NOT: FullComment
{ "pile_set_name": "Github" }
๏ปฟ/* setcolor.cpp ะฃัั‚ะฐะฝะพะฒะบะฐ ั„ะฐั€ะพะฒัะบะธั… ั†ะฒะตั‚ะพะฒ */ /* Copyright ยฉ 1996 Eugene Roshal Copyright ยฉ 2000 Far Group All rights reserved. Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met: 1. Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer. 2. Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution. 3. The name of the authors may not be used to endorse or promote products derived from this software without specific prior written permission. THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``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 AUTHOR 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. */ // Self: #include "setcolor.hpp" // Internal: #include "farcolor.hpp" #include "vmenu.hpp" #include "vmenu2.hpp" #include "dialog.hpp" #include "filepanels.hpp" #include "ctrlobj.hpp" #include "scrbuf.hpp" #include "panel.hpp" #include "interf.hpp" #include "config.hpp" #include "console.hpp" #include "colormix.hpp" #include "lang.hpp" #include "manager.hpp" #include "global.hpp" #include "strmix.hpp" #include "lockscrn.hpp" // Platform: // Common: #include "common.hpp" #include "common/null_iterator.hpp" #include "common/scope_exit.hpp" // External: #include "format.hpp" //---------------------------------------------------------------------------- static void ChangeColor(PaletteColors PaletteIndex) { auto NewColor = Global->Opt->Palette[PaletteIndex]; if (!console.GetColorDialog(NewColor)) return; Global->Opt->Palette.Set(PaletteIndex, { &NewColor, 1 }); { SCOPED_ACTION(LockScreen); Global->CtrlObject->Cp()->LeftPanel()->Update(UPDATE_KEEP_SELECTION); Global->CtrlObject->Cp()->LeftPanel()->Redraw(); Global->CtrlObject->Cp()->RightPanel()->Update(UPDATE_KEEP_SELECTION); Global->CtrlObject->Cp()->RightPanel()->Redraw(); Global->WindowManager->ResizeAllWindows(); // ั€ะตั„ั€ะตัˆะธะผ Global->WindowManager->PluginCommit(); // ะบะพะผะผะธั‚ะธะผ. if (Global->Opt->Clock) ShowTime(); } Global->WindowManager->PluginCommit(); // ะบะพะผะผะธั‚ะธะผ. } enum list_mode { lm_list_normal, lm_list_warning, lm_combo_normal, lm_combo_warning, list_modes_count }; struct color_item { lng LngId; PaletteColors Color; span<const color_item> SubColor; }; static void SetItemColors(span<const color_item> const Items, COORD Position = {}) { const auto ItemsMenu = VMenu2::create(msg(lng::MSetColorItemsTitle), {}); for (const auto& i: Items) { ItemsMenu->AddItem(msg(i.LngId)); } ItemsMenu->SetPosition({ Position.X += 10, Position.Y += 5, 0, 0 }); ItemsMenu->SetMenuFlags(VMENU_WRAPMODE); ItemsMenu->RunEx([&](int Msg, void *param) { const auto ItemsCode = reinterpret_cast<intptr_t>(param); if (Msg != DN_CLOSE || ItemsCode < 0) return 0; if (!Items[ItemsCode].SubColor.empty()) { SetItemColors(Items[ItemsCode].SubColor, Position); } else { ChangeColor(Items[ItemsCode].Color); } return 1; }); } void SetColors() { static const color_item PanelItems[] = { { lng::MSetColorPanelNormal, COL_PANELTEXT }, { lng::MSetColorPanelSelected, COL_PANELSELECTEDTEXT }, { lng::MSetColorPanelHighlightedText, COL_PANELHIGHLIGHTTEXT }, { lng::MSetColorPanelHighlightedInfo, COL_PANELINFOTEXT }, { lng::MSetColorPanelDragging, COL_PANELDRAGTEXT }, { lng::MSetColorPanelBox, COL_PANELBOX }, { lng::MSetColorPanelNormalCursor, COL_PANELCURSOR }, { lng::MSetColorPanelSelectedCursor, COL_PANELSELECTEDCURSOR }, { lng::MSetColorPanelNormalTitle, COL_PANELTITLE }, { lng::MSetColorPanelSelectedTitle, COL_PANELSELECTEDTITLE }, { lng::MSetColorPanelColumnTitle, COL_PANELCOLUMNTITLE }, { lng::MSetColorPanelTotalInfo, COL_PANELTOTALINFO }, { lng::MSetColorPanelSelectedInfo, COL_PANELSELECTEDINFO }, { lng::MSetColorPanelScrollbar, COL_PANELSCROLLBAR }, { lng::MSetColorPanelScreensNumber, COL_PANELSCREENSNUMBER }, }, ListItemsNormal[] = { { lng::MSetColorDialogListText, COL_DIALOGLISTTEXT }, { lng::MSetColorDialogListHighLight, COL_DIALOGLISTHIGHLIGHT }, { lng::MSetColorDialogListSelectedText, COL_DIALOGLISTSELECTEDTEXT }, { lng::MSetColorDialogListSelectedHighLight, COL_DIALOGLISTSELECTEDHIGHLIGHT }, { lng::MSetColorDialogListDisabled, COL_DIALOGLISTDISABLED }, { lng::MSetColorDialogListBox, COL_DIALOGLISTBOX }, { lng::MSetColorDialogListTitle, COL_DIALOGLISTTITLE }, { lng::MSetColorDialogListScrollBar, COL_DIALOGLISTSCROLLBAR }, { lng::MSetColorDialogListArrows, COL_DIALOGLISTARROWS }, { lng::MSetColorDialogListArrowsSelected, COL_DIALOGLISTARROWSSELECTED }, { lng::MSetColorDialogListArrowsDisabled, COL_DIALOGLISTARROWSDISABLED }, { lng::MSetColorDialogListGrayed, COL_DIALOGLISTGRAY }, { lng::MSetColorDialogSelectedListGrayed, COL_DIALOGLISTSELECTEDGRAYTEXT }, }, ListItemsWarn[] = { { lng::MSetColorDialogListText, COL_WARNDIALOGLISTTEXT }, { lng::MSetColorDialogListHighLight, COL_WARNDIALOGLISTHIGHLIGHT }, { lng::MSetColorDialogListSelectedText, COL_WARNDIALOGLISTSELECTEDTEXT }, { lng::MSetColorDialogListSelectedHighLight, COL_WARNDIALOGLISTSELECTEDHIGHLIGHT }, { lng::MSetColorDialogListDisabled, COL_WARNDIALOGLISTDISABLED }, { lng::MSetColorDialogListBox, COL_WARNDIALOGLISTBOX }, { lng::MSetColorDialogListTitle, COL_WARNDIALOGLISTTITLE }, { lng::MSetColorDialogListScrollBar, COL_WARNDIALOGLISTSCROLLBAR }, { lng::MSetColorDialogListArrows, COL_WARNDIALOGLISTARROWS }, { lng::MSetColorDialogListArrowsSelected, COL_WARNDIALOGLISTARROWSSELECTED }, { lng::MSetColorDialogListArrowsDisabled, COL_WARNDIALOGLISTARROWSDISABLED }, { lng::MSetColorDialogListGrayed, COL_WARNDIALOGLISTGRAY }, { lng::MSetColorDialogSelectedListGrayed, COL_WARNDIALOGLISTSELECTEDGRAYTEXT }, }, ComboItemsNormal[] = { { lng::MSetColorDialogListText, COL_DIALOGCOMBOTEXT }, { lng::MSetColorDialogListHighLight, COL_DIALOGCOMBOHIGHLIGHT }, { lng::MSetColorDialogListSelectedText, COL_DIALOGCOMBOSELECTEDTEXT }, { lng::MSetColorDialogListSelectedHighLight, COL_DIALOGCOMBOSELECTEDHIGHLIGHT }, { lng::MSetColorDialogListDisabled, COL_DIALOGCOMBODISABLED }, { lng::MSetColorDialogListBox, COL_DIALOGCOMBOBOX }, { lng::MSetColorDialogListTitle, COL_DIALOGCOMBOTITLE }, { lng::MSetColorDialogListScrollBar, COL_DIALOGCOMBOSCROLLBAR }, { lng::MSetColorDialogListArrows, COL_DIALOGCOMBOARROWS }, { lng::MSetColorDialogListArrowsSelected, COL_DIALOGCOMBOARROWSSELECTED }, { lng::MSetColorDialogListArrowsDisabled, COL_DIALOGCOMBOARROWSDISABLED }, { lng::MSetColorDialogListGrayed, COL_DIALOGCOMBOGRAY }, { lng::MSetColorDialogSelectedListGrayed, COL_DIALOGCOMBOSELECTEDGRAYTEXT }, }, ComboItemsWarn[] = { { lng::MSetColorDialogListText, COL_WARNDIALOGCOMBOTEXT }, { lng::MSetColorDialogListHighLight, COL_WARNDIALOGCOMBOHIGHLIGHT }, { lng::MSetColorDialogListSelectedText, COL_WARNDIALOGCOMBOSELECTEDTEXT }, { lng::MSetColorDialogListSelectedHighLight, COL_WARNDIALOGCOMBOSELECTEDHIGHLIGHT }, { lng::MSetColorDialogListDisabled, COL_WARNDIALOGCOMBODISABLED }, { lng::MSetColorDialogListBox, COL_WARNDIALOGCOMBOBOX }, { lng::MSetColorDialogListTitle, COL_WARNDIALOGCOMBOTITLE }, { lng::MSetColorDialogListScrollBar, COL_WARNDIALOGCOMBOSCROLLBAR }, { lng::MSetColorDialogListArrows, COL_WARNDIALOGCOMBOARROWS }, { lng::MSetColorDialogListArrowsSelected, COL_WARNDIALOGCOMBOARROWSSELECTED }, { lng::MSetColorDialogListArrowsDisabled, COL_WARNDIALOGCOMBOARROWSDISABLED }, { lng::MSetColorDialogListGrayed, COL_WARNDIALOGCOMBOGRAY }, { lng::MSetColorDialogSelectedListGrayed, COL_WARNDIALOGCOMBOSELECTEDGRAYTEXT }, }, DialogItems[] = { { lng::MSetColorDialogNormal, COL_DIALOGTEXT }, { lng::MSetColorDialogHighlighted, COL_DIALOGHIGHLIGHTTEXT }, { lng::MSetColorDialogDisabled, COL_DIALOGDISABLED }, { lng::MSetColorDialogBox, COL_DIALOGBOX }, { lng::MSetColorDialogBoxTitle, COL_DIALOGBOXTITLE }, { lng::MSetColorDialogHighlightedBoxTitle, COL_DIALOGHIGHLIGHTBOXTITLE }, { lng::MSetColorDialogTextInput, COL_DIALOGEDIT }, { lng::MSetColorDialogUnchangedTextInput, COL_DIALOGEDITUNCHANGED }, { lng::MSetColorDialogSelectedTextInput, COL_DIALOGEDITSELECTED }, { lng::MSetColorDialogEditDisabled, COL_DIALOGEDITDISABLED }, { lng::MSetColorDialogButtons, COL_DIALOGBUTTON }, { lng::MSetColorDialogSelectedButtons, COL_DIALOGSELECTEDBUTTON }, { lng::MSetColorDialogHighlightedButtons, COL_DIALOGHIGHLIGHTBUTTON }, { lng::MSetColorDialogSelectedHighlightedButtons, COL_DIALOGHIGHLIGHTSELECTEDBUTTON }, { lng::MSetColorDialogDefaultButton, COL_DIALOGDEFAULTBUTTON }, { lng::MSetColorDialogSelectedDefaultButton, COL_DIALOGSELECTEDDEFAULTBUTTON }, { lng::MSetColorDialogHighlightedDefaultButton, COL_DIALOGHIGHLIGHTDEFAULTBUTTON }, { lng::MSetColorDialogSelectedHighlightedDefaultButton, COL_DIALOGHIGHLIGHTSELECTEDDEFAULTBUTTON }, { lng::MSetColorDialogListBoxControl, {}, ListItemsNormal }, { lng::MSetColorDialogComboBoxControl, {}, ComboItemsNormal }, }, WarnDialogItems[] = { { lng::MSetColorDialogNormal, COL_WARNDIALOGTEXT }, { lng::MSetColorDialogHighlighted, COL_WARNDIALOGHIGHLIGHTTEXT }, { lng::MSetColorDialogDisabled, COL_WARNDIALOGDISABLED }, { lng::MSetColorDialogBox, COL_WARNDIALOGBOX }, { lng::MSetColorDialogBoxTitle, COL_WARNDIALOGBOXTITLE }, { lng::MSetColorDialogHighlightedBoxTitle, COL_WARNDIALOGHIGHLIGHTBOXTITLE }, { lng::MSetColorDialogTextInput, COL_WARNDIALOGEDIT }, { lng::MSetColorDialogUnchangedTextInput, COL_WARNDIALOGEDITUNCHANGED }, { lng::MSetColorDialogSelectedTextInput, COL_WARNDIALOGEDITSELECTED }, { lng::MSetColorDialogEditDisabled, COL_WARNDIALOGEDITDISABLED }, { lng::MSetColorDialogButtons, COL_WARNDIALOGBUTTON }, { lng::MSetColorDialogSelectedButtons, COL_WARNDIALOGSELECTEDBUTTON }, { lng::MSetColorDialogHighlightedButtons, COL_WARNDIALOGHIGHLIGHTBUTTON }, { lng::MSetColorDialogSelectedHighlightedButtons, COL_WARNDIALOGHIGHLIGHTSELECTEDBUTTON }, { lng::MSetColorDialogDefaultButton, COL_WARNDIALOGDEFAULTBUTTON }, { lng::MSetColorDialogSelectedDefaultButton, COL_WARNDIALOGSELECTEDDEFAULTBUTTON }, { lng::MSetColorDialogHighlightedDefaultButton, COL_WARNDIALOGHIGHLIGHTDEFAULTBUTTON }, { lng::MSetColorDialogSelectedHighlightedDefaultButton, COL_WARNDIALOGHIGHLIGHTSELECTEDDEFAULTBUTTON }, { lng::MSetColorDialogListBoxControl, {}, ListItemsWarn }, { lng::MSetColorDialogComboBoxControl, {}, ComboItemsWarn }, }, MenuItems[] = { { lng::MSetColorMenuNormal, COL_MENUTEXT }, { lng::MSetColorMenuSelected, COL_MENUSELECTEDTEXT }, { lng::MSetColorMenuHighlighted, COL_MENUHIGHLIGHT }, { lng::MSetColorMenuSelectedHighlighted, COL_MENUSELECTEDHIGHLIGHT }, { lng::MSetColorMenuDisabled, COL_MENUDISABLEDTEXT }, { lng::MSetColorMenuBox, COL_MENUBOX }, { lng::MSetColorMenuTitle, COL_MENUTITLE }, { lng::MSetColorMenuScrollBar, COL_MENUSCROLLBAR }, { lng::MSetColorMenuArrows, COL_MENUARROWS }, { lng::MSetColorMenuArrowsSelected, COL_MENUARROWSSELECTED }, { lng::MSetColorMenuArrowsDisabled, COL_MENUARROWSDISABLED }, { lng::MSetColorMenuGrayed, COL_MENUGRAYTEXT }, { lng::MSetColorMenuSelectedGrayed, COL_MENUSELECTEDGRAYTEXT }, }, HMenuItems[] = { { lng::MSetColorHMenuNormal, COL_HMENUTEXT }, { lng::MSetColorHMenuSelected, COL_HMENUSELECTEDTEXT }, { lng::MSetColorHMenuHighlighted, COL_HMENUHIGHLIGHT }, { lng::MSetColorHMenuSelectedHighlighted, COL_HMENUSELECTEDHIGHLIGHT }, }, KeyBarItems[] = { { lng::MSetColorKeyBarNumbers, COL_KEYBARNUM }, { lng::MSetColorKeyBarNames, COL_KEYBARTEXT }, { lng::MSetColorKeyBarBackground, COL_KEYBARBACKGROUND }, }, CommandLineItems[] = { { lng::MSetColorCommandLineNormal, COL_COMMANDLINE }, { lng::MSetColorCommandLineSelected, COL_COMMANDLINESELECTED }, { lng::MSetColorCommandLinePrefix, COL_COMMANDLINEPREFIX }, { lng::MSetColorCommandLineUserScreen, COL_COMMANDLINEUSERSCREEN }, }, ClockItems[] = { { lng::MSetColorClockNormal, COL_CLOCK }, { lng::MSetColorClockNormalEditor, COL_EDITORCLOCK }, { lng::MSetColorClockNormalViewer, COL_VIEWERCLOCK }, }, ViewerItems[] = { { lng::MSetColorViewerNormal, COL_VIEWERTEXT }, { lng::MSetColorViewerSelected, COL_VIEWERSELECTEDTEXT }, { lng::MSetColorViewerStatus, COL_VIEWERSTATUS }, { lng::MSetColorViewerArrows, COL_VIEWERARROWS }, { lng::MSetColorViewerScrollbar, COL_VIEWERSCROLLBAR }, }, EditorItems[] = { { lng::MSetColorEditorNormal, COL_EDITORTEXT }, { lng::MSetColorEditorSelected, COL_EDITORSELECTEDTEXT }, { lng::MSetColorEditorStatus, COL_EDITORSTATUS }, { lng::MSetColorEditorScrollbar, COL_EDITORSCROLLBAR }, }, HelpItems[] = { { lng::MSetColorHelpNormal, COL_HELPTEXT }, { lng::MSetColorHelpHighlighted, COL_HELPHIGHLIGHTTEXT }, { lng::MSetColorHelpReference, COL_HELPTOPIC }, { lng::MSetColorHelpSelectedReference, COL_HELPSELECTEDTOPIC }, { lng::MSetColorHelpBox, COL_HELPBOX }, { lng::MSetColorHelpBoxTitle, COL_HELPBOXTITLE }, { lng::MSetColorHelpScrollbar, COL_HELPSCROLLBAR }, }; { // NOT constexpr, see VS bug #3103404 static const struct { lng MenuId; span<const color_item> Subitems; } Groups[] { { lng::MSetColorPanel, PanelItems }, { lng::MSetColorDialog, DialogItems }, { lng::MSetColorWarning, WarnDialogItems }, { lng::MSetColorMenu, MenuItems }, { lng::MSetColorHMenu, HMenuItems }, { lng::MSetColorKeyBar, KeyBarItems }, { lng::MSetColorCommandLine, CommandLineItems }, { lng::MSetColorClock, ClockItems }, { lng::MSetColorViewer, ViewerItems }, { lng::MSetColorEditor, EditorItems }, { lng::MSetColorHelp, HelpItems }, }; const auto GroupsMenu = VMenu2::create(msg(lng::MSetColorGroupsTitle), {}); for (const auto& i: Groups) { GroupsMenu->AddItem(msg(i.MenuId)); } { MenuItemEx tmp; tmp.Flags = LIF_SEPARATOR; GroupsMenu->AddItem(tmp); } const auto DefaultId = static_cast<int>(GroupsMenu->size()); GroupsMenu->AddItem(msg(lng::MSetDefaultColors)); const auto BlackWhiteId = static_cast<int>(GroupsMenu->size()); GroupsMenu->AddItem(msg(lng::MSetBW)); GroupsMenu->SetPosition({ 2, 1, 0, 0 }); GroupsMenu->SetMenuFlags(VMENU_WRAPMODE); const auto GroupsCode=GroupsMenu->RunEx([&](int Msg, void *param) { const auto ItemsCode = reinterpret_cast<intptr_t>(param); if (Msg != DN_CLOSE || ItemsCode < 0 || static_cast<size_t>(ItemsCode) >= std::size(Groups)) return 0; SetItemColors(Groups[ItemsCode].Subitems); return 1; }); if (GroupsCode == DefaultId) { Global->Opt->Palette.ResetToDefault(); } else if (GroupsCode == BlackWhiteId) { Global->Opt->Palette.ResetToBlack(); } } Global->CtrlObject->Cp()->SetScreenPosition(); Global->CtrlObject->Cp()->LeftPanel()->Redraw(); Global->CtrlObject->Cp()->RightPanel()->Redraw(); } template<class T> constexpr auto distinct(T value) { return (~value & 0xff) >> 4 | value; } static const int ColorIndex[] { distinct(B_BLACK), distinct(B_RED), distinct(B_DARKGRAY), distinct(B_LIGHTRED), distinct(B_BLUE), distinct(B_MAGENTA), distinct(B_LIGHTBLUE), distinct(B_LIGHTMAGENTA), distinct(B_GREEN), distinct(B_BROWN), distinct(B_LIGHTGREEN), distinct(B_YELLOW), distinct(B_CYAN), distinct(B_LIGHTGRAY), distinct(B_LIGHTCYAN), distinct(B_WHITE) }; enum color_dialog_items { cd_border, cd_fg_box, cd_fg_color_first, cd_fg_color_last = cd_fg_color_first + 15, cd_fg_colorcode, cd_fg_advanced, cd_fg_transparent, cd_bg_box, cd_bg_color_first, cd_bg_color_last = cd_bg_color_first + 15, cd_bg_colorcode, cd_bg_advanced, cd_bg_transparent, cd_sample_first, cd_sample_last = cd_sample_first + 2, cd_separator, cd_button_ok, cd_button_cancel, cd_count }; static string color_code(COLORREF Color) { return format(FSTR(L"{0:06X}"), colors::color_value(colors::ARGB2ABGR(Color))); } // BUGBUG static bool IgnoreEditChange = false; static intptr_t GetColorDlgProc(Dialog* Dlg, intptr_t Msg, intptr_t Param1, void* Param2) { const auto ColorState = reinterpret_cast<FarColor*>(Dlg->SendMessage(DM_GETDLGDATA, 0, nullptr)); auto& CurColor = ColorState[0]; const auto GetColor = [Param1](size_t const Offset) { return colors::ConsoleColorToFarColor(ColorIndex[Param1 - Offset]); }; const auto Flag4Bit = [](bool const IsFg) { return IsFg? FCF_FG_4BIT : FCF_BG_4BIT; }; const auto SetComponentColorValue = [&CurColor](bool IsFg, COLORREF const Value) { auto& Component = IsFg? CurColor.ForegroundColor : CurColor.BackgroundColor; Component = colors::alpha_value(Component) | colors::color_value(Value); }; const auto DM_UPDATECOLORCODE = DM_USER + 1; switch (Msg) { case DN_CTLCOLORDLGITEM: { const auto Colors = static_cast<FarDialogItemColors*>(Param2); if (Param1 >= cd_fg_color_first && Param1 <= cd_fg_color_last) { Colors->Colors[0] = GetColor(cd_fg_color_first); return TRUE; } else if (Param1 >= cd_bg_color_first && Param1 <= cd_bg_color_last) { Colors->Colors[0] = GetColor(cd_bg_color_first); return TRUE; } else if (Param1 >= cd_sample_first && Param1 <= cd_sample_last) { Colors->Colors[0] = colors::merge(ColorState[1], ColorState[0]); return TRUE; } else return FALSE; } case DN_BTNCLICK: { if (Param2 && ((Param1 >= cd_fg_color_first && Param1 <= cd_fg_color_last) || (Param1 >= cd_bg_color_first && Param1 <= cd_bg_color_last))) { const auto IsFg = Param1 >= cd_fg_color_first && Param1 <= cd_fg_color_last; const auto First = IsFg? cd_fg_color_first : cd_bg_color_first; const auto ChosenColor = GetColor(First).BackgroundColor; SetComponentColorValue(IsFg, ChosenColor); CurColor.Flags |= Flag4Bit(IsFg); Dlg->SendMessage(DM_UPDATECOLORCODE, IsFg? cd_fg_colorcode : cd_bg_colorcode, ToPtr(colors::ConsoleIndexToTrueColor(ChosenColor))); return TRUE; } else if (Param1 == cd_fg_transparent || Param1 == cd_bg_transparent) { const auto IsFg = Param1 == cd_fg_transparent; auto& Component = IsFg? CurColor.ForegroundColor : CurColor.BackgroundColor; Param2? colors::make_transparent(Component) : colors::make_opaque(Component); } else if (Param1 == cd_fg_advanced || Param1 == cd_bg_advanced) { const auto IsFg = Param1 == cd_fg_advanced; auto CustomColors = Global->Opt->Palette.GetCustomColors(); CHOOSECOLOR Params{sizeof(Params)}; Params.hwndOwner = console.GetWindow(); Params.Flags = CC_ANYCOLOR | CC_FULLOPEN | CC_RGBINIT; Params.lpCustColors = CustomColors.data(); auto& Component = IsFg? CurColor.ForegroundColor : CurColor.BackgroundColor; Params.rgbResult = colors::color_value(CurColor.Flags & Flag4Bit(IsFg)? colors::ConsoleIndexToTrueColor(Component) : Component ); if (ChooseColor(&Params)) { SetComponentColorValue(IsFg, Params.rgbResult); CurColor.Flags &= ~Flag4Bit(IsFg); Dlg->SendMessage(DM_SETCHECK, IsFg? cd_fg_color_first : cd_bg_color_first, ToPtr(BSTATE_3STATE)); Dlg->SendMessage(DM_UPDATECOLORCODE, IsFg? cd_fg_colorcode : cd_bg_colorcode, ToPtr(Params.rgbResult)); Global->Opt->Palette.SetCustomColors(CustomColors); } return TRUE; } } break; case DN_EDITCHANGE: if (!IgnoreEditChange && (Param1 == cd_fg_colorcode || Param1 == cd_bg_colorcode)) { const auto& Item = *static_cast<const FarDialogItem*>(Param2); const auto Iterator = null_iterator(Item.Data); if (std::any_of(Iterator, Iterator.end(), std::iswxdigit)) { const auto IsFg = Param1 == cd_fg_colorcode; const auto ChosenColor = colors::ARGB2ABGR(std::wcstoul(Item.Data, nullptr, 16)); SetComponentColorValue(IsFg, ChosenColor); CurColor.Flags &= ~Flag4Bit(IsFg); Dlg->SendMessage(DM_SETCHECK, IsFg? cd_fg_color_first : cd_bg_color_first, ToPtr(BSTATE_3STATE)); } } return TRUE; case DM_UPDATECOLORCODE: { IgnoreEditChange = true; SCOPE_EXIT{ IgnoreEditChange = false; }; Dlg->SendMessage(DM_SETTEXTPTR, Param1, UNSAFE_CSTR(color_code(static_cast<int>(reinterpret_cast<intptr_t>(Param2))))); } return TRUE; default: break; } return Dlg->DefProc(Msg, Param1, Param2); } bool GetColorDialogInternal(FarColor& Color, bool const bCentered, const FarColor* const BaseColor) { auto ColorDlg = MakeDialogItems<cd_count>( { { DI_DOUBLEBOX, {{3, 1 }, {35, 14}}, DIF_NONE, msg(lng::MSetColorTitle), }, { DI_SINGLEBOX, {{5, 2 }, {18, 7 }}, DIF_NONE, msg(lng::MSetColorForeground), }, { DI_RADIOBUTTON, {{6, 3 }, {0, 3 }}, DIF_MOVESELECT | DIF_GROUP,}, { DI_RADIOBUTTON, {{6, 4 }, {0, 4 }}, DIF_MOVESELECT, }, { DI_RADIOBUTTON, {{6, 5 }, {0, 5 }}, DIF_MOVESELECT, }, { DI_RADIOBUTTON, {{6, 6 }, {0, 6 }}, DIF_MOVESELECT, }, { DI_RADIOBUTTON, {{9, 3 }, {0, 3 }}, DIF_MOVESELECT, }, { DI_RADIOBUTTON, {{9, 4 }, {0, 4 }}, DIF_MOVESELECT, }, { DI_RADIOBUTTON, {{9, 5 }, {0, 5 }}, DIF_MOVESELECT, }, { DI_RADIOBUTTON, {{9, 6 }, {0, 6 }}, DIF_MOVESELECT, }, { DI_RADIOBUTTON, {{12, 3 }, {0, 3 }}, DIF_MOVESELECT, }, { DI_RADIOBUTTON, {{12, 4 }, {0, 4 }}, DIF_MOVESELECT, }, { DI_RADIOBUTTON, {{12, 5 }, {0, 5 }}, DIF_MOVESELECT, }, { DI_RADIOBUTTON, {{12, 6 }, {0, 6 }}, DIF_MOVESELECT, }, { DI_RADIOBUTTON, {{15, 3 }, {0, 3 }}, DIF_MOVESELECT, }, { DI_RADIOBUTTON, {{15, 4 }, {0, 4 }}, DIF_MOVESELECT, }, { DI_RADIOBUTTON, {{15, 5 }, {0, 5 }}, DIF_MOVESELECT, }, { DI_RADIOBUTTON, {{15, 6 }, {0, 6 }}, DIF_MOVESELECT, }, { DI_FIXEDIT, {{5, 8 }, {10, 8 }}, DIF_MASKEDIT, }, { DI_BUTTON, {{12, 8 }, {18, 8 }}, DIF_NONE, msg(lng::MSetColorForeRGB), }, { DI_CHECKBOX, {{5, 9 }, {0, 9 }}, DIF_NONE, msg(lng::MSetColorForeTransparent), }, { DI_SINGLEBOX, {{20, 2 }, {33, 7 }}, DIF_NONE, msg(lng::MSetColorBackground), }, { DI_RADIOBUTTON, {{21, 3 }, {0, 3 }}, DIF_MOVESELECT | DIF_GROUP, }, { DI_RADIOBUTTON, {{21, 4 }, {0, 4 }}, DIF_MOVESELECT, }, { DI_RADIOBUTTON, {{21, 5 }, {0, 5 }}, DIF_MOVESELECT, }, { DI_RADIOBUTTON, {{21, 6 }, {0, 6 }}, DIF_MOVESELECT, }, { DI_RADIOBUTTON, {{24, 3 }, {0, 3 }}, DIF_MOVESELECT, }, { DI_RADIOBUTTON, {{24, 4 }, {0, 4 }}, DIF_MOVESELECT, }, { DI_RADIOBUTTON, {{24, 5 }, {0, 5 }}, DIF_MOVESELECT, }, { DI_RADIOBUTTON, {{24, 6 }, {0, 6 }}, DIF_MOVESELECT, }, { DI_RADIOBUTTON, {{27, 3 }, {0, 3 }}, DIF_MOVESELECT, }, { DI_RADIOBUTTON, {{27, 4 }, {0, 4 }}, DIF_MOVESELECT, }, { DI_RADIOBUTTON, {{27, 5 }, {0, 5 }}, DIF_MOVESELECT, }, { DI_RADIOBUTTON, {{27, 6 }, {0, 6 }}, DIF_MOVESELECT, }, { DI_RADIOBUTTON, {{30, 3 }, {0, 3 }}, DIF_MOVESELECT, }, { DI_RADIOBUTTON, {{30, 4 }, {0, 4 }}, DIF_MOVESELECT, }, { DI_RADIOBUTTON, {{30, 5 }, {0, 5 }}, DIF_MOVESELECT, }, { DI_RADIOBUTTON, {{30, 6 }, {0, 6 }}, DIF_MOVESELECT, }, { DI_FIXEDIT, {{20, 8 }, {25, 8 }}, DIF_MASKEDIT, }, { DI_BUTTON, {{27, 8 }, {33, 8 }}, DIF_NONE, msg(lng::MSetColorBackRGB), }, { DI_CHECKBOX, {{22, 9 }, {0, 9 }}, DIF_NONE, msg(lng::MSetColorBackTransparent), }, { DI_TEXT, {{5, 9 }, {33, 9 }}, DIF_NONE, msg(lng::MSetColorSample), }, { DI_TEXT, {{5, 10}, {33, 10}}, DIF_NONE, msg(lng::MSetColorSample), }, { DI_TEXT, {{5, 11}, {33, 11}}, DIF_NONE, msg(lng::MSetColorSample), }, { DI_TEXT, {{-1, 12}, {0, 12}}, DIF_SEPARATOR, }, { DI_BUTTON, {{0, 13}, {0, 13}}, DIF_CENTERGROUP | DIF_DEFAULTBUTTON, msg(lng::MSetColorSet), }, { DI_BUTTON, {{0, 13}, {0, 13}}, DIF_CENTERGROUP, msg(lng::MSetColorCancel), }, }); ColorDlg[cd_fg_colorcode].strData = color_code(Color.IsFg4Bit()? colors::ConsoleIndexToTrueColor(Color.ForegroundColor) : Color.ForegroundColor); ColorDlg[cd_bg_colorcode].strData = color_code(Color.IsBg4Bit()? colors::ConsoleIndexToTrueColor(Color.BackgroundColor) : Color.BackgroundColor); ColorDlg[cd_fg_colorcode].strMask = ColorDlg[cd_bg_colorcode].strMask = L"HHHHHH"sv; FarColor CurColor[]{ Color, BaseColor? *BaseColor : colors::ConsoleColorToFarColor(F_BLACK | B_BLACK) }; if (Color.IsFg4Bit() || Color.IsBg4Bit()) { const auto ConsoleColor = colors::FarColorToConsoleColor(Color); if (Color.IsFg4Bit()) { for (size_t i = cd_fg_color_first; i <= cd_fg_color_last; ++i) { if (((ColorIndex[i - cd_fg_color_first] & B_MASK) >> 4) == (ConsoleColor & F_MASK)) { ColorDlg[i].Selected = true; ColorDlg[i].Flags |= DIF_FOCUS; break; } } } if (Color.IsBg4Bit()) { for (size_t i = cd_bg_color_first; i <= cd_bg_color_last; ++i) { if ((ColorIndex[i - cd_bg_color_first] & B_MASK) == (ConsoleColor & B_MASK)) { ColorDlg[i].Selected = true; break; } } } } else { ColorDlg[cd_fg_colorcode].Flags |= DIF_FOCUS; } if (BaseColor) { ColorDlg[0].Y2++; for (size_t i = cd_sample_first; i < cd_count; ++i) { ColorDlg[i].Y1+=1; ColorDlg[i].Y2+=1; } ColorDlg[cd_border].X2 += 4; ColorDlg[cd_fg_box].X2 += 2; ColorDlg[cd_bg_box].X1 += 2; ColorDlg[cd_bg_box].X2 += 4; for (size_t i = cd_fg_color_first; i <= cd_fg_color_last; ++i) { ColorDlg[i].X1+=1; } for (size_t i = cd_bg_color_first; i <= cd_bg_color_last; ++i) { ColorDlg[i].X1+=3; } for (size_t i = cd_sample_first; i <= cd_sample_last; ++i) { ColorDlg[i].X2+=4; } ColorDlg[cd_bg_advanced].X1 += 2; ColorDlg[cd_bg_advanced].X2 += 2; ColorDlg[cd_bg_colorcode].X1 += 2; ColorDlg[cd_bg_colorcode].X2 += 2; ColorDlg[cd_fg_transparent].Selected = colors::is_transparent(Color.ForegroundColor); ColorDlg[cd_bg_transparent].Selected = colors::is_transparent(Color.BackgroundColor); } else { ColorDlg[cd_fg_transparent].Flags|=DIF_HIDDEN; ColorDlg[cd_bg_transparent].Flags|=DIF_HIDDEN; } const auto Dlg = Dialog::create(ColorDlg, GetColorDlgProc, CurColor); if (bCentered) Dlg->SetPosition({ -1, -1, 39 + (BaseColor? 4 : 0), 16 + (BaseColor? 1 : 0) }); else Dlg->SetPosition({ 37, 2, 75 + (BaseColor? 4 : 0), 17 + (BaseColor? 1 : 0)}); Dlg->Process(); if (Dlg->GetExitCode() != cd_button_ok) return false; Color = CurColor[0]; return true; }
{ "pile_set_name": "Github" }
<!-- ~ Copyright (c) 2018 Wolfram Research, Inc. All rights reserved. ~ Redistribution or use of this work in any form, with or without modification, ~ requires written permission from the copyright holder. --> <h3><a href="http://reference.wolfram.com/mathematica/ref/HolidayCalendar.html">HolidayCalendar</a></h3> <ul> <li>HolidayCalendar is an option that specifies the holiday calendar schedule in business day functions. </ul><p><b>Attributes:</b> Protected, ReadProtected</p><p><b>Symbol has no options.</b></p>
{ "pile_set_name": "Github" }
#include "../../../src/scripttools/debugging/qscriptdebuggerjob_p_p.h"
{ "pile_set_name": "Github" }
/** * DSS - Digital Signature Services * Copyright (C) 2015 European Commission, provided under the CEF programme * * This file is part of the "DSS - Digital Signature Services" project. * * 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 */ package eu.europa.esig.dss.cades.extension; import static org.junit.jupiter.api.Assertions.assertNotNull; import static org.junit.jupiter.api.Assertions.assertTrue; import java.io.File; import java.io.FileOutputStream; import java.io.IOException; import java.util.Arrays; import java.util.UUID; import eu.europa.esig.dss.cades.CAdESSignatureParameters; import eu.europa.esig.dss.cades.signature.CAdESService; import eu.europa.esig.dss.cades.signature.CAdESTimestampParameters; import eu.europa.esig.dss.diagnostic.DiagnosticData; import eu.europa.esig.dss.diagnostic.SignatureWrapper; import eu.europa.esig.dss.enumerations.SignaturePackaging; import eu.europa.esig.dss.model.DSSDocument; import eu.europa.esig.dss.model.DSSException; import eu.europa.esig.dss.model.FileDocument; import eu.europa.esig.dss.model.SignatureValue; import eu.europa.esig.dss.model.ToBeSigned; import eu.europa.esig.dss.signature.DocumentSignatureService; import eu.europa.esig.dss.spi.x509.tsp.TSPSource; import eu.europa.esig.dss.test.extension.AbstractTestExtension; import eu.europa.esig.dss.validation.reports.Reports; import eu.europa.esig.validationreport.jaxb.SignatureIdentifierType; import eu.europa.esig.validationreport.jaxb.SignatureValidationReportType; import eu.europa.esig.validationreport.jaxb.ValidationReportType; public abstract class AbstractCAdESTestExtension extends AbstractTestExtension<CAdESSignatureParameters, CAdESTimestampParameters> { @Override protected TSPSource getUsedTSPSourceAtSignatureTime() { return getGoodTsa(); } @Override protected TSPSource getUsedTSPSourceAtExtensionTime() { return getAlternateGoodTsa(); } @Override protected DSSDocument getOriginalDocument() { File originalDoc = new File("target/original-" + UUID.randomUUID().toString() + ".bin"); try (FileOutputStream fos = new FileOutputStream(originalDoc)) { fos.write("Hello world!".getBytes()); } catch (IOException e) { throw new DSSException("Unable to create the original document", e); } return new FileDocument(originalDoc); } @Override protected void checkSignatureIdentifier(DiagnosticData diagnosticData) { for (SignatureWrapper signatureWrapper : diagnosticData.getSignatures()) { assertNotNull(signatureWrapper.getSignatureValue()); } } @Override protected void checkReportsSignatureIdentifier(Reports reports) { DiagnosticData diagnosticData = reports.getDiagnosticData(); ValidationReportType etsiValidationReport = reports.getEtsiValidationReportJaxb(); for (SignatureValidationReportType signatureValidationReport : etsiValidationReport.getSignatureValidationReport()) { SignatureWrapper signature = diagnosticData.getSignatureById(signatureValidationReport.getSignatureIdentifier().getId()); SignatureIdentifierType signatureIdentifier = signatureValidationReport.getSignatureIdentifier(); assertNotNull(signatureIdentifier); assertNotNull(signatureIdentifier.getSignatureValue()); assertTrue(Arrays.equals(signature.getSignatureValue(), signatureIdentifier.getSignatureValue().getValue())); } } @Override protected DSSDocument getSignedDocument(DSSDocument doc) { // Sign CAdESSignatureParameters signatureParameters = new CAdESSignatureParameters(); signatureParameters.setSigningCertificate(getSigningCert()); signatureParameters.setCertificateChain(getCertificateChain()); signatureParameters.setSignaturePackaging(SignaturePackaging.ENVELOPING); signatureParameters.setSignatureLevel(getOriginalSignatureLevel()); CAdESService service = new CAdESService(getCompleteCertificateVerifier()); service.setTspSource(getUsedTSPSourceAtSignatureTime()); ToBeSigned dataToSign = service.getDataToSign(doc, signatureParameters); SignatureValue signatureValue = getToken().sign(dataToSign, signatureParameters.getDigestAlgorithm(), getPrivateKeyEntry()); return service.signDocument(doc, signatureParameters, signatureValue); } @Override protected DocumentSignatureService<CAdESSignatureParameters, CAdESTimestampParameters> getSignatureServiceToExtend() { CAdESService service = new CAdESService(getCompleteCertificateVerifier()); service.setTspSource(getUsedTSPSourceAtExtensionTime()); return service; } @Override protected CAdESSignatureParameters getExtensionParameters() { CAdESSignatureParameters extensionParameters = new CAdESSignatureParameters(); extensionParameters.setSignatureLevel(getFinalSignatureLevel()); return extensionParameters; } @Override protected String getSigningAlias() { return GOOD_USER; } }
{ "pile_set_name": "Github" }
#!/bin/sh N_STRUCTS=300 # Utility routine to "hand" check VTTs. let i=1; while [ $i != $N_STRUCTS ]; do sed -n "/^__ZTT.*s$i:/,/\.[sgm][elo]/p" test-clang.s | grep -v '\.[sgm][elo]' | sed -e 's/[()]//g' -e '/^$/d' >test-clang-ztt sed -n "/^__ZTT.*s$i:/,/\.[sgm][elo]/p" test-gcc.s | grep -v '\.[sgm][elo]' | sed -e 's/[()]//g' -e 's/ + /+/' >test-gcc-ztt diff -U3 test-gcc-ztt test-clang-ztt if [ $? != 0 ]; then echo "FAIL: s$i VTT" else echo "PASS: s$i VTT" fi let i=i+1 done
{ "pile_set_name": "Github" }
This module manages attributes that can be attached to subroutine and variable declarations. Although it can be used directly, it is mainly intended to be infrastructure for modules that supply particular attribute semantics. Meanings are assigned to attributes by code which is usually supplied by modules and which runs at compile time. The built-in mechanism for attribute control is awkward to use, difficult in particular to enable multiple attributes supplied by different modules, and it scopes attribute meanings according to the package of the object to which attributes are being applied. This module is intended to overcome these limitations. This module supplies a simple pragma to declare an attribute, associating the attribute's name with a handler function that implements its semantics. The declaration is lexically scoped, lasting only until the end of the enclosing block. A declaration can be overridden, giving an attribute name a different meaning or making it meaningless, in an inner nested block.
{ "pile_set_name": "Github" }
{ "name": "20", "version": "3.1.9", "description": "A use of angular framework to write the news system, I used the style of weui, production of carousel figure by swiper, using nodejs's native module to make the server, using the gulp to build the project automation, I am wscats, my master is autumnswind,", "main": "http.js", "scripts": { "gulp": "gulp", "test": "gulp && node http", "cms": "node cms/news.js", "http": "node http", "dev": "npm run cms && npm run http" }, "repository": { "type": "git", "url": "https://github.com/Wscats" }, "keywords": [ "node", "weui", "angular", "swiper", "node-server", "gulp", "autumnswind", "wscats" ], "author": { "name": "wscats" }, "license": "ISC", "_id": "20@3.1.6", "_shasum": "ba74f967dced66a2ded61202ff52664435f1ef61", "_from": "20@latest", "_npmVersion": "2.15.1", "_nodeVersion": "4.4.4", "_npmUser": { "name": "autumnswind", "email": "AutumnsWinds@gmail.com" }, "dist": { "shasum": "ba74f967dced66a2ded61202ff52664435f1ef61", "tarball": "https://registry.npmjs.org/20/-/20-3.1.6.tgz" }, "maintainers": [ { "name": "autumnswind", "email": "AutumnsWinds@gmail.com" } ], "_npmOperationalInternal": { "host": "packages-18-east.internal.npmjs.com", "tmp": "tmp/20-3.1.6.tgz_1481208347093_0.9346606880426407" }, "directories": {}, "_resolved": "https://registry.npmjs.org/20/-/20-3.1.6.tgz", "dependencies": { "gulp": "*", "gulp-uglify": "*", "gulp-rename": "*", "gulp-concat": "*", "gulp-minify-css": "*", "gulp-minify-html": "*", "gulp-imagemin": "*" }, "bugs": { "url": "https://github.com/Wscats/news/issues" }, "readme": "ERROR: No README data found!" }
{ "pile_set_name": "Github" }