text
stringlengths
2
100k
meta
dict
<?xml version="1.0" encoding="utf-8"?> <vector xmlns:android="http://schemas.android.com/apk/res/android" android:width="24dp" android:height="24dp" android:viewportHeight="24" android:viewportWidth="24"> <path android:fillColor="#ff000000" android:pathData="M11.99,2C6.47,2 2,6.48 2,12s4.47,10 9.99,10C17.52,22 22,17.52 22,12S17.52,2 11.99,2zM12,20c-4.42,0 -8,-3.58 -8,-8s3.58,-8 8,-8 8,3.58 8,8 -3.58,8 -8,8z"/> <path android:fillColor="#ff000000" android:pathData="M12.5,7H11v6l5.25,3.15 0.75,-1.23 -4.5,-2.67z"/> </vector>
{ "pile_set_name": "Github" }
/* * Copyright 2002-2019 the original author or 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 * * https://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.springframework.context.index.sample.cdi; import javax.transaction.Transactional; /** * Test candidate for {@link Transactional}. This verifies that the annotation processor * can process an annotation that declares itself with an annotation that is not on the * classpath. * * @author Vedran Pavic * @author Stephane Nicoll */ @Transactional public class SampleTransactional { }
{ "pile_set_name": "Github" }
package main import ( "encoding/json" "hooks" "net" "os" "strings" "testing" "github.com/0xrawsec/golang-evtx/evtx" "github.com/0xrawsec/golang-utils/log" "github.com/0xrawsec/golang-utils/readers" ) var ( // DNSFilter filters any Windows-DNS-Client log DNSFilter = hooks.NewFilter([]int64{}, []string{"Microsoft-Windows-DNS-Client/Operational"}) // SysmonNetConnFilter filters any Sysmon network connection SysmonNetConnFilter = hooks.NewFilter([]int64{3}, []string{"Microsoft-Windows-Sysmon/Operational"}) eventSource = "new-events.json" queryValue = evtx.Path("/Event/EventData/QueryName") queryType = evtx.Path("/Event/EventData/QueryType") queryResults = evtx.Path("/Event/EventData/QueryResults") destIP = evtx.Path("/Event/EventData/DestinationIp") destHostname = evtx.Path("/Event/EventData/DestinationHostname") dnsResolution = make(map[string]string) ) func hookDNS(e *evtx.GoEvtxMap) { if qtype, err := e.GetInt(&queryType); err == nil { // request for A or AAAA records if qtype == 1 || qtype == 28 { if qresults, err := e.GetString(&queryResults); err == nil { if qresults != "" { records := strings.Split(qresults, ";") for _, r := range records { // check if it is a valid IP if net.ParseIP(r) != nil { log.Infof("%s : %s", r, e.GetStringStrict(&queryValue)) dnsResolution[r] = e.GetStringStrict(&queryValue) } } } } } } } func hookNetConn(e *evtx.GoEvtxMap) { if ip, err := e.GetString(&destIP); err == nil { if dom, ok := dnsResolution[ip]; ok { e.Set(&destHostname, dom) } } } func TestHook(t *testing.T) { hm := hooks.NewHookMan() hm.Hook(hookDNS, DNSFilter) hm.Hook(hookNetConn, SysmonNetConnFilter) f, err := os.Open(eventSource) if err != nil { t.Logf("Cannot open file: %s", eventSource) t.Fail() return } for line := range readers.Readlines(f) { e := evtx.GoEvtxMap{} err := json.Unmarshal(line, &e) if err != nil { t.Logf("JSON deserialization issue") t.Fail() } if hm.RunHooksOn(&e) { t.Log(string(evtx.ToJSON(e))) } } }
{ "pile_set_name": "Github" }
/* * Copyright (c) 2011, 2017, Oracle and/or its affiliates. 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. */ package com.sun.org.apache.xerces.internal.impl.xs; import com.sun.org.apache.xerces.internal.dom.DOMErrorImpl; import com.sun.org.apache.xerces.internal.dom.DOMMessageFormatter; import com.sun.org.apache.xerces.internal.dom.DOMStringListImpl; import com.sun.org.apache.xerces.internal.impl.Constants; import com.sun.org.apache.xerces.internal.impl.XMLEntityManager; import com.sun.org.apache.xerces.internal.impl.XMLErrorReporter; import com.sun.org.apache.xerces.internal.impl.dv.InvalidDatatypeValueException; import com.sun.org.apache.xerces.internal.impl.dv.SchemaDVFactory; import com.sun.org.apache.xerces.internal.impl.dv.xs.SchemaDVFactoryImpl; import com.sun.org.apache.xerces.internal.impl.xs.models.CMBuilder; import com.sun.org.apache.xerces.internal.impl.xs.models.CMNodeFactory; import com.sun.org.apache.xerces.internal.impl.xs.traversers.XSDHandler; import com.sun.org.apache.xerces.internal.util.DOMEntityResolverWrapper; import com.sun.org.apache.xerces.internal.util.DOMErrorHandlerWrapper; import com.sun.org.apache.xerces.internal.util.DefaultErrorHandler; import com.sun.org.apache.xerces.internal.util.MessageFormatter; import com.sun.org.apache.xerces.internal.util.ParserConfigurationSettings; import com.sun.org.apache.xerces.internal.util.Status; import com.sun.org.apache.xerces.internal.util.SymbolTable; import com.sun.org.apache.xerces.internal.util.URI.MalformedURIException; import com.sun.org.apache.xerces.internal.util.XMLSymbols; import com.sun.org.apache.xerces.internal.utils.XMLSecurityManager; import com.sun.org.apache.xerces.internal.utils.XMLSecurityPropertyManager; import com.sun.org.apache.xerces.internal.xni.QName; import com.sun.org.apache.xerces.internal.xni.XNIException; import com.sun.org.apache.xerces.internal.xni.grammars.Grammar; import com.sun.org.apache.xerces.internal.xni.grammars.XMLGrammarDescription; import com.sun.org.apache.xerces.internal.xni.grammars.XMLGrammarLoader; import com.sun.org.apache.xerces.internal.xni.grammars.XMLGrammarPool; import com.sun.org.apache.xerces.internal.xni.grammars.XSGrammar; import com.sun.org.apache.xerces.internal.xni.parser.XMLComponent; import com.sun.org.apache.xerces.internal.xni.parser.XMLComponentManager; import com.sun.org.apache.xerces.internal.xni.parser.XMLConfigurationException; import com.sun.org.apache.xerces.internal.xni.parser.XMLEntityResolver; import com.sun.org.apache.xerces.internal.xni.parser.XMLErrorHandler; import com.sun.org.apache.xerces.internal.xni.parser.XMLInputSource; import com.sun.org.apache.xerces.internal.xs.LSInputList; import com.sun.org.apache.xerces.internal.xs.StringList; import com.sun.org.apache.xerces.internal.xs.XSLoader; import com.sun.org.apache.xerces.internal.xs.XSModel; import java.io.BufferedInputStream; import java.io.File; import java.io.FileInputStream; import java.io.FileNotFoundException; import java.io.IOException; import java.io.InputStream; import java.io.Reader; import java.io.StringReader; import java.util.ArrayList; import java.util.HashMap; import java.util.Locale; import java.util.Map; import java.util.StringTokenizer; import java.util.WeakHashMap; import javax.xml.XMLConstants; import jdk.xml.internal.JdkXmlFeatures; import jdk.xml.internal.JdkXmlUtils; import jdk.xml.internal.SecuritySupport; import org.w3c.dom.DOMConfiguration; import org.w3c.dom.DOMError; import org.w3c.dom.DOMErrorHandler; import org.w3c.dom.DOMException; import org.w3c.dom.DOMStringList; import org.w3c.dom.ls.LSInput; import org.w3c.dom.ls.LSResourceResolver; import org.xml.sax.InputSource; /** * This class implements xni.grammars.XMLGrammarLoader. * It also serves as implementation of xs.XSLoader interface and DOMConfiguration interface. * * This class is designed to interact either with a proxy for a user application * which wants to preparse schemas, or with our own Schema validator. * It is hoped that none of these "external" classes will therefore need to communicate directly * with XSDHandler in future. * <p>This class only knows how to make XSDHandler do its thing. * The caller must ensure that all its properties (schemaLocation, JAXPSchemaSource * etc.) have been properly set. * * @xerces.internal * * @author Neil Graham, IBM * @LastModified: Sep 2017 */ public class XMLSchemaLoader implements XMLGrammarLoader, XMLComponent, XSElementDeclHelper, // XML Component API XSLoader, DOMConfiguration { // Feature identifiers: /** Feature identifier: schema full checking*/ protected static final String SCHEMA_FULL_CHECKING = Constants.XERCES_FEATURE_PREFIX + Constants.SCHEMA_FULL_CHECKING; /** Feature identifier: continue after fatal error. */ protected static final String CONTINUE_AFTER_FATAL_ERROR = Constants.XERCES_FEATURE_PREFIX + Constants.CONTINUE_AFTER_FATAL_ERROR_FEATURE; /** Feature identifier: allow java encodings to be recognized when parsing schema docs. */ protected static final String ALLOW_JAVA_ENCODINGS = Constants.XERCES_FEATURE_PREFIX + Constants.ALLOW_JAVA_ENCODINGS_FEATURE; /** Feature identifier: standard uri conformant feature. */ protected static final String STANDARD_URI_CONFORMANT_FEATURE = Constants.XERCES_FEATURE_PREFIX + Constants.STANDARD_URI_CONFORMANT_FEATURE; /** Feature identifier: validate annotations. */ protected static final String VALIDATE_ANNOTATIONS = Constants.XERCES_FEATURE_PREFIX + Constants.VALIDATE_ANNOTATIONS_FEATURE; /** Feature: disallow doctype*/ protected static final String DISALLOW_DOCTYPE = Constants.XERCES_FEATURE_PREFIX + Constants.DISALLOW_DOCTYPE_DECL_FEATURE; /** Feature: generate synthetic annotations */ protected static final String GENERATE_SYNTHETIC_ANNOTATIONS = Constants.XERCES_FEATURE_PREFIX + Constants.GENERATE_SYNTHETIC_ANNOTATIONS_FEATURE; /** Feature identifier: honour all schemaLocations */ protected static final String HONOUR_ALL_SCHEMALOCATIONS = Constants.XERCES_FEATURE_PREFIX + Constants.HONOUR_ALL_SCHEMALOCATIONS_FEATURE; protected static final String AUGMENT_PSVI = Constants.XERCES_FEATURE_PREFIX + Constants.SCHEMA_AUGMENT_PSVI; protected static final String PARSER_SETTINGS = Constants.XERCES_FEATURE_PREFIX + Constants.PARSER_SETTINGS; /** Feature identifier: namespace growth */ protected static final String NAMESPACE_GROWTH = Constants.XERCES_FEATURE_PREFIX + Constants.NAMESPACE_GROWTH_FEATURE; /** Feature identifier: tolerate duplicates */ protected static final String TOLERATE_DUPLICATES = Constants.XERCES_FEATURE_PREFIX + Constants.TOLERATE_DUPLICATES_FEATURE; /** Property identifier: Schema DV Factory */ protected static final String SCHEMA_DV_FACTORY = Constants.XERCES_PROPERTY_PREFIX + Constants.SCHEMA_DV_FACTORY_PROPERTY; protected static final String OVERRIDE_PARSER = JdkXmlUtils.OVERRIDE_PARSER; // recognized features: private static final String[] RECOGNIZED_FEATURES = { SCHEMA_FULL_CHECKING, AUGMENT_PSVI, CONTINUE_AFTER_FATAL_ERROR, ALLOW_JAVA_ENCODINGS, STANDARD_URI_CONFORMANT_FEATURE, DISALLOW_DOCTYPE, GENERATE_SYNTHETIC_ANNOTATIONS, VALIDATE_ANNOTATIONS, HONOUR_ALL_SCHEMALOCATIONS, NAMESPACE_GROWTH, TOLERATE_DUPLICATES, OVERRIDE_PARSER, XMLConstants.USE_CATALOG }; // property identifiers /** Property identifier: symbol table. */ public static final String SYMBOL_TABLE = Constants.XERCES_PROPERTY_PREFIX + Constants.SYMBOL_TABLE_PROPERTY; /** Property identifier: error reporter. */ public static final String ERROR_REPORTER = Constants.XERCES_PROPERTY_PREFIX + Constants.ERROR_REPORTER_PROPERTY; /** Property identifier: error handler. */ public static final String ERROR_HANDLER = Constants.XERCES_PROPERTY_PREFIX + Constants.ERROR_HANDLER_PROPERTY; /** Property identifier: entity resolver. */ public static final String ENTITY_RESOLVER = Constants.XERCES_PROPERTY_PREFIX + Constants.ENTITY_RESOLVER_PROPERTY; /** Property identifier: grammar pool. */ public static final String XMLGRAMMAR_POOL = Constants.XERCES_PROPERTY_PREFIX + Constants.XMLGRAMMAR_POOL_PROPERTY; /** Property identifier: schema location. */ protected static final String SCHEMA_LOCATION = Constants.XERCES_PROPERTY_PREFIX + Constants.SCHEMA_LOCATION; /** Property identifier: no namespace schema location. */ protected static final String SCHEMA_NONS_LOCATION = Constants.XERCES_PROPERTY_PREFIX + Constants.SCHEMA_NONS_LOCATION; /** Property identifier: JAXP schema source. */ protected static final String JAXP_SCHEMA_SOURCE = Constants.JAXP_PROPERTY_PREFIX + Constants.SCHEMA_SOURCE; protected static final String SECURITY_MANAGER = Constants.XERCES_PROPERTY_PREFIX + Constants.SECURITY_MANAGER_PROPERTY; /** Property identifier: locale. */ protected static final String LOCALE = Constants.XERCES_PROPERTY_PREFIX + Constants.LOCALE_PROPERTY; protected static final String ENTITY_MANAGER = Constants.XERCES_PROPERTY_PREFIX + Constants.ENTITY_MANAGER_PROPERTY; /** Property identifier: Security property manager. */ private static final String XML_SECURITY_PROPERTY_MANAGER = Constants.XML_SECURITY_PROPERTY_MANAGER; /** Property identifier: access to external dtd */ public static final String ACCESS_EXTERNAL_DTD = XMLConstants.ACCESS_EXTERNAL_DTD; /** Property identifier: access to external schema */ public static final String ACCESS_EXTERNAL_SCHEMA = XMLConstants.ACCESS_EXTERNAL_SCHEMA; // recognized properties private static final String [] RECOGNIZED_PROPERTIES = { ENTITY_MANAGER, SYMBOL_TABLE, ERROR_REPORTER, ERROR_HANDLER, ENTITY_RESOLVER, XMLGRAMMAR_POOL, SCHEMA_LOCATION, SCHEMA_NONS_LOCATION, JAXP_SCHEMA_SOURCE, SECURITY_MANAGER, LOCALE, SCHEMA_DV_FACTORY, XML_SECURITY_PROPERTY_MANAGER, JdkXmlUtils.CATALOG_DEFER, JdkXmlUtils.CATALOG_FILES, JdkXmlUtils.CATALOG_PREFER, JdkXmlUtils.CATALOG_RESOLVE, JdkXmlUtils.CDATA_CHUNK_SIZE }; // Data // features and properties private final ParserConfigurationSettings fLoaderConfig = new ParserConfigurationSettings(); private XMLErrorReporter fErrorReporter = new XMLErrorReporter (); private XMLEntityManager fEntityManager = null; private XMLEntityResolver fUserEntityResolver = null; private XMLGrammarPool fGrammarPool = null; private String fExternalSchemas = null; private String fExternalNoNSSchema = null; // JAXP property: schema source private Object fJAXPSource = null; // is Schema Full Checking enabled private boolean fIsCheckedFully = false; // boolean that tells whether we've tested the JAXP property. private boolean fJAXPProcessed = false; // if features/properties has not been changed, the value of this attribute is "false" private boolean fSettingsChanged = true; // xml schema parsing private XSDHandler fSchemaHandler; private XSGrammarBucket fGrammarBucket; private XSDeclarationPool fDeclPool = null; private SubstitutionGroupHandler fSubGroupHandler; private final CMNodeFactory fNodeFactory = new CMNodeFactory(); //component mgr will be set later private CMBuilder fCMBuilder; private XSDDescription fXSDDescription = new XSDDescription(); private String faccessExternalSchema = Constants.EXTERNAL_ACCESS_DEFAULT; private WeakHashMap<Object, SchemaGrammar> fJAXPCache; private Locale fLocale = Locale.getDefault(); // XSLoader attributes private DOMStringList fRecognizedParameters = null; /** DOM L3 error handler */ private DOMErrorHandlerWrapper fErrorHandler = null; /** DOM L3 resource resolver */ private DOMEntityResolverWrapper fResourceResolver = null; // default constructor. Create objects we absolutely need: public XMLSchemaLoader() { this( new SymbolTable(), null, new XMLEntityManager(), null, null, null); } public XMLSchemaLoader(SymbolTable symbolTable) { this( symbolTable, null, new XMLEntityManager(), null, null, null); } /** * This constractor is used by the XMLSchemaValidator. Additional properties, i.e. XMLEntityManager, * will be passed during reset(XMLComponentManager). * @param errorReporter * @param grammarBucket * @param sHandler * @param builder */ XMLSchemaLoader(XMLErrorReporter errorReporter, XSGrammarBucket grammarBucket, SubstitutionGroupHandler sHandler, CMBuilder builder) { this(null, errorReporter, null, grammarBucket, sHandler, builder); } XMLSchemaLoader(SymbolTable symbolTable, XMLErrorReporter errorReporter, XMLEntityManager entityResolver, XSGrammarBucket grammarBucket, SubstitutionGroupHandler sHandler, CMBuilder builder) { // store properties and features in configuration fLoaderConfig.addRecognizedFeatures(RECOGNIZED_FEATURES); fLoaderConfig.addRecognizedProperties(RECOGNIZED_PROPERTIES); if (symbolTable != null){ fLoaderConfig.setProperty(SYMBOL_TABLE, symbolTable); } if(errorReporter == null) { errorReporter = new XMLErrorReporter (); errorReporter.setLocale(fLocale); errorReporter.setProperty(ERROR_HANDLER, new DefaultErrorHandler()); } fErrorReporter = errorReporter; // make sure error reporter knows about schemas... if(fErrorReporter.getMessageFormatter(XSMessageFormatter.SCHEMA_DOMAIN) == null) { fErrorReporter.putMessageFormatter(XSMessageFormatter.SCHEMA_DOMAIN, new XSMessageFormatter()); } fLoaderConfig.setProperty(ERROR_REPORTER, fErrorReporter); fEntityManager = entityResolver; // entity manager is null if XMLSchemaValidator creates the loader if (fEntityManager != null){ fLoaderConfig.setProperty(ENTITY_MANAGER, fEntityManager); } // by default augment PSVI (i.e. don't use declaration pool) fLoaderConfig.setFeature(AUGMENT_PSVI, true); if(grammarBucket == null ) { grammarBucket = new XSGrammarBucket(); } fGrammarBucket = grammarBucket; if (sHandler == null) { sHandler = new SubstitutionGroupHandler(this); } fSubGroupHandler = sHandler; if(builder == null) { builder = new CMBuilder(fNodeFactory); } fCMBuilder = builder; fSchemaHandler = new XSDHandler(fGrammarBucket); fJAXPCache = new WeakHashMap<>(); fSettingsChanged = true; } /** * Returns a list of feature identifiers that are recognized by * this XMLGrammarLoader. This method may return null if no features * are recognized. */ public String[] getRecognizedFeatures() { return RECOGNIZED_FEATURES.clone(); } // getRecognizedFeatures(): String[] /** * Returns the state of a feature. * * @param featureId The feature identifier. * * @throws XMLConfigurationException Thrown on configuration error. */ public boolean getFeature(String featureId) throws XMLConfigurationException { return fLoaderConfig.getFeature(featureId); } // getFeature (String): boolean /** * Sets the state of a feature. * * @param featureId The feature identifier. * @param state The state of the feature. * * @throws XMLConfigurationException Thrown when a feature is not * recognized or cannot be set. */ public void setFeature(String featureId, boolean state) throws XMLConfigurationException { fSettingsChanged = true; if(featureId.equals(CONTINUE_AFTER_FATAL_ERROR)) { fErrorReporter.setFeature(CONTINUE_AFTER_FATAL_ERROR, state); } else if(featureId.equals(GENERATE_SYNTHETIC_ANNOTATIONS)) { fSchemaHandler.setGenerateSyntheticAnnotations(state); } fLoaderConfig.setFeature(featureId, state); } // setFeature(String, boolean) /** * Returns a list of property identifiers that are recognized by * this XMLGrammarLoader. This method may return null if no properties * are recognized. */ public String[] getRecognizedProperties() { return RECOGNIZED_PROPERTIES.clone(); } // getRecognizedProperties(): String[] /** * Returns the state of a property. * * @param propertyId The property identifier. * * @throws XMLConfigurationException Thrown on configuration error. */ public Object getProperty(String propertyId) throws XMLConfigurationException { return fLoaderConfig.getProperty(propertyId); } // getProperty(String): Object /** * Sets the state of a property. * * @param propertyId The property identifier. * @param state The state of the property. * * @throws XMLConfigurationException Thrown when a property is not * recognized or cannot be set. */ public void setProperty(String propertyId, Object state) throws XMLConfigurationException { fSettingsChanged = true; fLoaderConfig.setProperty(propertyId, state); if (propertyId.equals(JAXP_SCHEMA_SOURCE)) { fJAXPSource = state; fJAXPProcessed = false; } else if (propertyId.equals(XMLGRAMMAR_POOL)) { fGrammarPool = (XMLGrammarPool)state; } else if (propertyId.equals(SCHEMA_LOCATION)) { fExternalSchemas = (String)state; } else if (propertyId.equals(SCHEMA_NONS_LOCATION)) { fExternalNoNSSchema = (String) state; } else if (propertyId.equals(LOCALE)) { setLocale((Locale) state); } else if (propertyId.equals(ENTITY_RESOLVER)) { fEntityManager.setProperty(ENTITY_RESOLVER, state); } else if (propertyId.equals(ERROR_REPORTER)) { fErrorReporter = (XMLErrorReporter)state; if (fErrorReporter.getMessageFormatter(XSMessageFormatter.SCHEMA_DOMAIN) == null) { fErrorReporter.putMessageFormatter(XSMessageFormatter.SCHEMA_DOMAIN, new XSMessageFormatter()); } } else if (propertyId.equals(XML_SECURITY_PROPERTY_MANAGER)) { XMLSecurityPropertyManager spm = (XMLSecurityPropertyManager)state; faccessExternalSchema = spm.getValue(XMLSecurityPropertyManager.Property.ACCESS_EXTERNAL_SCHEMA); } } // setProperty(String, Object) /** * Set the locale to use for messages. * * @param locale The locale object to use for localization of messages. * * @exception XNIException Thrown if the parser does not support the * specified locale. */ public void setLocale(Locale locale) { fLocale = locale; fErrorReporter.setLocale(locale); } // setLocale(Locale) /** Return the Locale the XMLGrammarLoader is using. */ public Locale getLocale() { return fLocale; } // getLocale(): Locale /** * Sets the error handler. * * @param errorHandler The error handler. */ public void setErrorHandler(XMLErrorHandler errorHandler) { fErrorReporter.setProperty(ERROR_HANDLER, errorHandler); } // setErrorHandler(XMLErrorHandler) /** Returns the registered error handler. */ public XMLErrorHandler getErrorHandler() { return fErrorReporter.getErrorHandler(); } // getErrorHandler(): XMLErrorHandler /** * Sets the entity resolver. * * @param entityResolver The new entity resolver. */ public void setEntityResolver(XMLEntityResolver entityResolver) { fUserEntityResolver = entityResolver; fLoaderConfig.setProperty(ENTITY_RESOLVER, entityResolver); fEntityManager.setProperty(ENTITY_RESOLVER, entityResolver); } // setEntityResolver(XMLEntityResolver) /** Returns the registered entity resolver. */ public XMLEntityResolver getEntityResolver() { return fUserEntityResolver; } // getEntityResolver(): XMLEntityResolver /** * Returns a Grammar object by parsing the contents of the * entities pointed to by sources. * * @param source the locations of the entity which forms * the staring point of the grammars to be constructed * @throws IOException when a problem is encounted reading the entity * @throws XNIException when a condition arises (such as a FatalError) that requires parsing * of the entity be terminated */ public void loadGrammar(XMLInputSource source[]) throws IOException, XNIException { int numSource = source.length; for (int i = 0; i < numSource; ++i) { loadGrammar(source[i]); } } /** * Returns a Grammar object by parsing the contents of the * entity pointed to by source. * * @param source the location of the entity which forms * the starting point of the grammar to be constructed. * @throws IOException When a problem is encountered reading the entity * XNIException When a condition arises (such as a FatalError) that requires parsing * of the entity be terminated. */ public Grammar loadGrammar(XMLInputSource source) throws IOException, XNIException { // REVISIT: this method should have a namespace parameter specified by // user. In this case we can easily detect if a schema asked to be loaded // is already in the local cache. reset(fLoaderConfig); fSettingsChanged = false; XSDDescription desc = new XSDDescription(); desc.fContextType = XSDDescription.CONTEXT_PREPARSE; desc.setBaseSystemId(source.getBaseSystemId()); desc.setLiteralSystemId( source.getSystemId()); // none of the other fields make sense for preparsing Map<String, LocationArray> locationPairs = new HashMap<>(); // Process external schema location properties. // We don't call tokenizeSchemaLocationStr here, because we also want // to check whether the values are valid URI. processExternalHints(fExternalSchemas, fExternalNoNSSchema, locationPairs, fErrorReporter); SchemaGrammar grammar = loadSchema(desc, source, locationPairs); if(grammar != null && fGrammarPool != null) { fGrammarPool.cacheGrammars(XMLGrammarDescription.XML_SCHEMA, fGrammarBucket.getGrammars()); // NOTE: we only need to verify full checking in case the schema was not provided via JAXP // since full checking already verified for all JAXP schemas if(fIsCheckedFully && fJAXPCache.get(grammar) != grammar) { XSConstraints.fullSchemaChecking(fGrammarBucket, fSubGroupHandler, fCMBuilder, fErrorReporter); } } return grammar; } // loadGrammar(XMLInputSource): Grammar /** * This method is called either from XMLGrammarLoader.loadGrammar or from XMLSchemaValidator. * Note: in either case, the EntityManager (or EntityResolvers) are not going to be invoked * to resolve the location of the schema in XSDDescription * @param desc * @param source * @param locationPairs * @return An XML Schema grammar * @throws IOException * @throws XNIException */ SchemaGrammar loadSchema(XSDDescription desc, XMLInputSource source, Map<String, LocationArray> locationPairs) throws IOException, XNIException { // this should only be done once per invocation of this object; // unless application alters JAXPSource in the mean time. if(!fJAXPProcessed) { processJAXPSchemaSource(locationPairs); } if (desc.isExternal() && !source.isCreatedByResolver()) { String accessError = SecuritySupport.checkAccess(desc.getExpandedSystemId(), faccessExternalSchema, Constants.ACCESS_EXTERNAL_ALL); if (accessError != null) { throw new XNIException(fErrorReporter.reportError(XSMessageFormatter.SCHEMA_DOMAIN, "schema_reference.access", new Object[] { SecuritySupport.sanitizePath(desc.getExpandedSystemId()), accessError }, XMLErrorReporter.SEVERITY_ERROR)); } } SchemaGrammar grammar = fSchemaHandler.parseSchema(source, desc, locationPairs); return grammar; } // loadSchema(XSDDescription, XMLInputSource): SchemaGrammar /** * This method tries to resolve location of the given schema. * The loader stores the namespace/location pairs in a map (use "" as the * namespace of absent namespace). When resolving an entity, loader first tries * to find in the map whether there is a value for that namespace, * if so, pass that location value to the user-defined entity resolver. * * @param desc * @param locationPairs * @param entityResolver * @return the XMLInputSource * @throws IOException */ public static XMLInputSource resolveDocument(XSDDescription desc, Map<String, LocationArray> locationPairs, XMLEntityResolver entityResolver) throws IOException { String loc = null; // we consider the schema location properties for import if (desc.getContextType() == XSDDescription.CONTEXT_IMPORT || desc.fromInstance()) { // use empty string as the key for absent namespace String namespace = desc.getTargetNamespace(); String ns = namespace == null ? XMLSymbols.EMPTY_STRING : namespace; // get the location hint for that namespace LocationArray tempLA = locationPairs.get(ns); if(tempLA != null) loc = tempLA.getFirstLocation(); } // if it's not import, or if the target namespace is not set // in the schema location properties, use location hint if (loc == null) { String[] hints = desc.getLocationHints(); if (hints != null && hints.length > 0) loc = hints[0]; } String expandedLoc = XMLEntityManager.expandSystemId(loc, desc.getBaseSystemId(), false); desc.setLiteralSystemId(loc); desc.setExpandedSystemId(expandedLoc); return entityResolver.resolveEntity(desc); } // add external schema locations to the location pairs public static void processExternalHints(String sl, String nsl, Map<String, LocationArray> locations, XMLErrorReporter er) { if (sl != null) { try { // get the attribute decl for xsi:schemaLocation // because external schema location property has the same syntax // as xsi:schemaLocation XSAttributeDecl attrDecl = SchemaGrammar.SG_XSI.getGlobalAttributeDecl(SchemaSymbols.XSI_SCHEMALOCATION); // validation the string value to get the list of URI's attrDecl.fType.validate(sl, null, null); if (!tokenizeSchemaLocationStr(sl, locations, null)) { // report warning (odd number of items) er.reportError(XSMessageFormatter.SCHEMA_DOMAIN, "SchemaLocation", new Object[]{sl}, XMLErrorReporter.SEVERITY_WARNING); } } catch (InvalidDatatypeValueException ex) { // report warning (not list of URI's) er.reportError(XSMessageFormatter.SCHEMA_DOMAIN, ex.getKey(), ex.getArgs(), XMLErrorReporter.SEVERITY_WARNING); } } if (nsl != null) { try { // similarly for no ns schema location property XSAttributeDecl attrDecl = SchemaGrammar.SG_XSI.getGlobalAttributeDecl( SchemaSymbols.XSI_NONAMESPACESCHEMALOCATION); attrDecl.fType.validate(nsl, null, null); LocationArray la = locations.get(XMLSymbols.EMPTY_STRING); if(la == null) { la = new LocationArray(); locations.put(XMLSymbols.EMPTY_STRING, la); } la.addLocation(nsl); } catch (InvalidDatatypeValueException ex) { // report warning (not a URI) er.reportError(XSMessageFormatter.SCHEMA_DOMAIN, ex.getKey(), ex.getArgs(), XMLErrorReporter.SEVERITY_WARNING); } } } // this method takes a SchemaLocation string. // If an error is encountered, false is returned; // otherwise, true is returned. In either case, locations // is augmented to include as many tokens as possible. // @param schemaStr The schemaLocation string to tokenize // @param locations HashMap mapping namespaces to LocationArray objects holding lists of locaitons // @return true if no problems; false if string could not be tokenized public static boolean tokenizeSchemaLocationStr(String schemaStr, Map<String, XMLSchemaLoader.LocationArray> locations, String base) { if (schemaStr!= null) { StringTokenizer t = new StringTokenizer(schemaStr, " \n\t\r"); String namespace, location; while (t.hasMoreTokens()) { namespace = t.nextToken (); if (!t.hasMoreTokens()) { return false; // error! } location = t.nextToken(); LocationArray la = locations.get(namespace); if(la == null) { la = new LocationArray(); locations.put(namespace, la); } if (base != null) { try { location = XMLEntityManager.expandSystemId(location, base, false); } catch (MalformedURIException e) { } } la.addLocation(location); } } return true; } // tokenizeSchemaLocation(String, HashMap): boolean /** * Translate the various JAXP SchemaSource property types to XNI * XMLInputSource. Valid types are: String, org.xml.sax.InputSource, * InputStream, File, or Object[] of any of previous types. * REVISIT: the JAXP 1.2 spec is less than clear as to whether this property * should be available to imported schemas. I have assumed * that it should. - NG * Note: all JAXP schema files will be checked for full-schema validity if the feature was set up * */ private void processJAXPSchemaSource( Map<String, LocationArray> locationPairs) throws IOException { fJAXPProcessed = true; if (fJAXPSource == null) { return; } Class<?> componentType = fJAXPSource.getClass().getComponentType(); XMLInputSource xis = null; String sid = null; if (componentType == null) { // Not an array if (fJAXPSource instanceof InputStream || fJAXPSource instanceof InputSource) { SchemaGrammar g = fJAXPCache.get(fJAXPSource); if (g != null) { fGrammarBucket.putGrammar(g); return; } } fXSDDescription.reset(); xis = xsdToXMLInputSource(fJAXPSource); sid = xis.getSystemId(); fXSDDescription.fContextType = XSDDescription.CONTEXT_PREPARSE; if (sid != null) { fXSDDescription.setBaseSystemId(xis.getBaseSystemId()); fXSDDescription.setLiteralSystemId(sid); fXSDDescription.setExpandedSystemId(sid); fXSDDescription.fLocationHints = new String[]{sid}; } SchemaGrammar g = loadSchema(fXSDDescription, xis, locationPairs); // it is possible that we won't be able to resolve JAXP schema-source location if (g != null) { if (fJAXPSource instanceof InputStream || fJAXPSource instanceof InputSource) { fJAXPCache.put(fJAXPSource, g); if (fIsCheckedFully) { XSConstraints.fullSchemaChecking(fGrammarBucket, fSubGroupHandler, fCMBuilder, fErrorReporter); } } fGrammarBucket.putGrammar(g); } return; } else if ( (componentType != Object.class) && (componentType != String.class) && !File.class.isAssignableFrom(componentType) && !InputStream.class.isAssignableFrom(componentType) && !InputSource.class.isAssignableFrom(componentType) && !componentType.isInterface() ) { // Not an Object[], String[], File[], InputStream[], InputSource[] MessageFormatter mf = fErrorReporter.getMessageFormatter(XSMessageFormatter.SCHEMA_DOMAIN); throw new XMLConfigurationException( Status.NOT_SUPPORTED, mf.formatMessage(fErrorReporter.getLocale(), "jaxp12-schema-source-type.2", new Object [] {componentType.getName()})); } // JAXP spec. allow []s of type String, File, InputStream, // InputSource also, apart from [] of type Object. Object[] objArr = (Object[]) fJAXPSource; // make local array for storing target namespaces of schemasources specified in object arrays. ArrayList<String> jaxpSchemaSourceNamespaces = new ArrayList<>(); for (int i = 0; i < objArr.length; i++) { if (objArr[i] instanceof InputStream || objArr[i] instanceof InputSource) { SchemaGrammar g = fJAXPCache.get(objArr[i]); if (g != null) { fGrammarBucket.putGrammar(g); continue; } } fXSDDescription.reset(); xis = xsdToXMLInputSource(objArr[i]); sid = xis.getSystemId(); fXSDDescription.fContextType = XSDDescription.CONTEXT_PREPARSE; if (sid != null) { fXSDDescription.setBaseSystemId(xis.getBaseSystemId()); fXSDDescription.setLiteralSystemId(sid); fXSDDescription.setExpandedSystemId(sid); fXSDDescription.fLocationHints = new String[]{sid}; } String targetNamespace = null ; // load schema SchemaGrammar grammar = fSchemaHandler.parseSchema(xis,fXSDDescription, locationPairs); if (fIsCheckedFully) { XSConstraints.fullSchemaChecking(fGrammarBucket, fSubGroupHandler, fCMBuilder, fErrorReporter); } if (grammar != null) { targetNamespace = grammar.getTargetNamespace(); if (jaxpSchemaSourceNamespaces.contains(targetNamespace)) { // when an array of objects is passed it is illegal to have two schemas that share same namespace. MessageFormatter mf = fErrorReporter.getMessageFormatter(XSMessageFormatter.SCHEMA_DOMAIN); throw new java.lang.IllegalArgumentException(mf.formatMessage(fErrorReporter.getLocale(), "jaxp12-schema-source-ns", null)); } else { jaxpSchemaSourceNamespaces.add(targetNamespace) ; } if(objArr[i] instanceof InputStream || objArr[i] instanceof InputSource) { fJAXPCache.put(objArr[i], grammar); } fGrammarBucket.putGrammar(grammar); } else { //REVISIT: What should be the acutal behavior if grammar can't be loaded as specified in schema source? } } }//processJAXPSchemaSource private XMLInputSource xsdToXMLInputSource(Object val) { if (val instanceof String) { // String value is treated as a URI that is passed through the // EntityResolver String loc = (String) val; fXSDDescription.reset(); fXSDDescription.setValues(null, loc, null, null); XMLInputSource xis = null; try { xis = fEntityManager.resolveEntity(fXSDDescription); } catch (IOException ex) { fErrorReporter.reportError(XSMessageFormatter.SCHEMA_DOMAIN, "schema_reference.4", new Object[] { loc }, XMLErrorReporter.SEVERITY_ERROR); } if (xis == null) { // REVISIT: can this happen? // Treat value as a URI and pass in as systemId return new XMLInputSource(null, loc, null, false); } return xis; } else if (val instanceof InputSource) { return saxToXMLInputSource((InputSource) val); } else if (val instanceof InputStream) { return new XMLInputSource(null, null, null, (InputStream) val, null); } else if (val instanceof File) { File file = (File) val; InputStream is = null; try { is = new BufferedInputStream(new FileInputStream(file)); } catch (FileNotFoundException ex) { fErrorReporter.reportError(XSMessageFormatter.SCHEMA_DOMAIN, "schema_reference.4", new Object[] { file.toString() }, XMLErrorReporter.SEVERITY_ERROR); } return new XMLInputSource(null, file.toURI().toString(), null, is, null); } MessageFormatter mf = fErrorReporter.getMessageFormatter(XSMessageFormatter.SCHEMA_DOMAIN); throw new XMLConfigurationException( Status.NOT_SUPPORTED, mf.formatMessage(fErrorReporter.getLocale(), "jaxp12-schema-source-type.1", new Object [] {val != null ? val.getClass().getName() : "null"})); } //Convert a SAX InputSource to an equivalent XNI XMLInputSource private static XMLInputSource saxToXMLInputSource(InputSource sis) { String publicId = sis.getPublicId(); String systemId = sis.getSystemId(); Reader charStream = sis.getCharacterStream(); if (charStream != null) { return new XMLInputSource(publicId, systemId, null, charStream, null); } InputStream byteStream = sis.getByteStream(); if (byteStream != null) { return new XMLInputSource(publicId, systemId, null, byteStream, sis.getEncoding()); } return new XMLInputSource(publicId, systemId, null, false); } public static class LocationArray{ int length ; String [] locations = new String[2]; public void resize(int oldLength , int newLength){ String [] temp = new String[newLength] ; System.arraycopy(locations, 0, temp, 0, Math.min(oldLength, newLength)); locations = temp ; length = Math.min(oldLength, newLength); } public void addLocation(String location){ if(length >= locations.length ){ resize(length, Math.max(1, length*2)); } locations[length++] = location; }//setLocation() public String [] getLocationArray(){ if(length < locations.length ){ resize(locations.length, length); } return locations; }//getLocationArray() public String getFirstLocation(){ return length > 0 ? locations[0] : null; } public int getLength(){ return length ; } } //locationArray /* (non-Javadoc) * @see com.sun.org.apache.xerces.internal.xni.parser.XMLComponent#getFeatureDefault(java.lang.String) */ public Boolean getFeatureDefault(String featureId) { if (featureId.equals(AUGMENT_PSVI)){ return Boolean.TRUE; } return null; } /* (non-Javadoc) * @see com.sun.org.apache.xerces.internal.xni.parser.XMLComponent#getPropertyDefault(java.lang.String) */ public Object getPropertyDefault(String propertyId) { // TODO Auto-generated method stub return null; } /* (non-Javadoc) * @see com.sun.org.apache.xerces.internal.xni.parser.XMLComponent#reset(com.sun.org.apache.xerces.internal.xni.parser.XMLComponentManager) */ public void reset(XMLComponentManager componentManager) throws XMLConfigurationException { XMLSecurityPropertyManager spm = (XMLSecurityPropertyManager)componentManager.getProperty(XML_SECURITY_PROPERTY_MANAGER); if (spm == null) { spm = new XMLSecurityPropertyManager(); setProperty(XML_SECURITY_PROPERTY_MANAGER, spm); } XMLSecurityManager sm = (XMLSecurityManager)componentManager.getProperty(SECURITY_MANAGER); if (sm == null) setProperty(SECURITY_MANAGER,new XMLSecurityManager(true)); faccessExternalSchema = spm.getValue(XMLSecurityPropertyManager.Property.ACCESS_EXTERNAL_SCHEMA); fGrammarBucket.reset(); fSubGroupHandler.reset(); boolean parser_settings = true; // If the component manager is the loader config don't bother querying it since it doesn't // recognize the PARSER_SETTINGS feature. Prevents an XMLConfigurationException from being // thrown. if (componentManager != fLoaderConfig) { parser_settings = componentManager.getFeature(PARSER_SETTINGS, true); } if (!parser_settings || !fSettingsChanged){ // need to reprocess JAXP schema sources fJAXPProcessed = false; // reinitialize grammar bucket initGrammarBucket(); if (fDeclPool != null) { fDeclPool.reset(); } return; } //pass the component manager to the factory.. fNodeFactory.reset(componentManager); // get registered entity manager to be able to resolve JAXP schema-source property: // Note: in case XMLSchemaValidator has created the loader, // the entity manager property is null fEntityManager = (XMLEntityManager)componentManager.getProperty(ENTITY_MANAGER); // get the error reporter fErrorReporter = (XMLErrorReporter)componentManager.getProperty(ERROR_REPORTER); // Determine schema dv factory to use SchemaDVFactory dvFactory = null; dvFactory = fSchemaHandler.getDVFactory(); if (dvFactory == null) { dvFactory = SchemaDVFactory.getInstance(); fSchemaHandler.setDVFactory(dvFactory); } // get schema location properties try { fExternalSchemas = (String) componentManager.getProperty(SCHEMA_LOCATION); fExternalNoNSSchema = (String) componentManager.getProperty(SCHEMA_NONS_LOCATION); } catch (XMLConfigurationException e) { fExternalSchemas = null; fExternalNoNSSchema = null; } // get JAXP sources if available fJAXPSource = componentManager.getProperty(JAXP_SCHEMA_SOURCE, null); fJAXPProcessed = false; // clear grammars, and put the one for schema namespace there fGrammarPool = (XMLGrammarPool) componentManager.getProperty(XMLGRAMMAR_POOL, null); initGrammarBucket(); boolean psvi = componentManager.getFeature(AUGMENT_PSVI, false); // Only use the decl pool when there is no chance that the schema // components will be exposed or cached. // TODO: when someone calls loadGrammar(XMLInputSource), the schema is // always exposed even without the use of a grammar pool. // Disabling the "decl pool" feature for now until we understand when // it can be safely used. if (!psvi && fGrammarPool == null && false) { if (fDeclPool != null) { fDeclPool.reset(); } else { fDeclPool = new XSDeclarationPool(); } fCMBuilder.setDeclPool(fDeclPool); fSchemaHandler.setDeclPool(fDeclPool); if (dvFactory instanceof SchemaDVFactoryImpl) { fDeclPool.setDVFactory((SchemaDVFactoryImpl)dvFactory); ((SchemaDVFactoryImpl)dvFactory).setDeclPool(fDeclPool); } } else { fCMBuilder.setDeclPool(null); fSchemaHandler.setDeclPool(null); if (dvFactory instanceof SchemaDVFactoryImpl) { ((SchemaDVFactoryImpl)dvFactory).setDeclPool(null); } } // get continue-after-fatal-error feature try { boolean fatalError = componentManager.getFeature(CONTINUE_AFTER_FATAL_ERROR, false); if (!fatalError) { fErrorReporter.setFeature(CONTINUE_AFTER_FATAL_ERROR, fatalError); } } catch (XMLConfigurationException e) { } // set full validation to false fIsCheckedFully = componentManager.getFeature(SCHEMA_FULL_CHECKING, false); // get generate-synthetic-annotations feature fSchemaHandler.setGenerateSyntheticAnnotations(componentManager.getFeature(GENERATE_SYNTHETIC_ANNOTATIONS, false)); fSchemaHandler.reset(componentManager); } private void initGrammarBucket(){ if(fGrammarPool != null) { Grammar [] initialGrammars = fGrammarPool.retrieveInitialGrammarSet(XMLGrammarDescription.XML_SCHEMA); final int length = (initialGrammars != null) ? initialGrammars.length : 0; for (int i = 0; i < length; ++i) { // put this grammar into the bucket, along with grammars // imported by it (directly or indirectly) if (!fGrammarBucket.putGrammar((SchemaGrammar)(initialGrammars[i]), true)) { // REVISIT: a conflict between new grammar(s) and grammars // in the bucket. What to do? A warning? An exception? fErrorReporter.reportError(XSMessageFormatter.SCHEMA_DOMAIN, "GrammarConflict", null, XMLErrorReporter.SEVERITY_WARNING); } } } } /* (non-Javadoc) * @see com.sun.org.apache.xerces.internal.xs.XSLoader#getConfig() */ public DOMConfiguration getConfig() { return this; } /* (non-Javadoc) * @see com.sun.org.apache.xerces.internal.xs.XSLoader#load(org.w3c.dom.ls.LSInput) */ public XSModel load(LSInput is) { try { Grammar g = loadGrammar(dom2xmlInputSource(is)); return ((XSGrammar) g).toXSModel(); } catch (Exception e) { reportDOMFatalError(e); return null; } } /* (non-Javadoc) * @see com.sun.org.apache.xerces.internal.xs.XSLoader#loadInputList(com.sun.org.apache.xerces.internal.xs.LSInputList) */ public XSModel loadInputList(LSInputList is) { int length = is.getLength(); SchemaGrammar[] gs = new SchemaGrammar[length]; for (int i = 0; i < length; i++) { try { gs[i] = (SchemaGrammar) loadGrammar(dom2xmlInputSource(is.item(i))); } catch (Exception e) { reportDOMFatalError(e); return null; } } return new XSModelImpl(gs); } /* (non-Javadoc) * @see com.sun.org.apache.xerces.internal.xs.XSLoader#loadURI(java.lang.String) */ public XSModel loadURI(String uri) { try { Grammar g = loadGrammar(new XMLInputSource(null, uri, null, false)); return ((XSGrammar)g).toXSModel(); } catch (Exception e){ reportDOMFatalError(e); return null; } } /* (non-Javadoc) * @see com.sun.org.apache.xerces.internal.xs.XSLoader#loadURIList(com.sun.org.apache.xerces.internal.xs.StringList) */ public XSModel loadURIList(StringList uriList) { int length = uriList.getLength(); SchemaGrammar[] gs = new SchemaGrammar[length]; for (int i = 0; i < length; i++) { try { gs[i] = (SchemaGrammar) loadGrammar(new XMLInputSource(null, uriList.item(i), null, false)); } catch (Exception e) { reportDOMFatalError(e); return null; } } return new XSModelImpl(gs); } void reportDOMFatalError(Exception e) { if (fErrorHandler != null) { DOMErrorImpl error = new DOMErrorImpl(); error.fException = e; error.fMessage = e.getMessage(); error.fSeverity = DOMError.SEVERITY_FATAL_ERROR; fErrorHandler.getErrorHandler().handleError(error); } } /* (non-Javadoc) * @see DOMConfiguration#canSetParameter(String, Object) */ public boolean canSetParameter(String name, Object value) { if(value instanceof Boolean){ if (name.equals(Constants.DOM_VALIDATE) || name.equals(SCHEMA_FULL_CHECKING) || name.equals(VALIDATE_ANNOTATIONS) || name.equals(CONTINUE_AFTER_FATAL_ERROR) || name.equals(ALLOW_JAVA_ENCODINGS) || name.equals(STANDARD_URI_CONFORMANT_FEATURE) || name.equals(GENERATE_SYNTHETIC_ANNOTATIONS) || name.equals(HONOUR_ALL_SCHEMALOCATIONS) || name.equals(NAMESPACE_GROWTH) || name.equals(TOLERATE_DUPLICATES) || name.equals(OVERRIDE_PARSER)) { return true; } return false; } if (name.equals(Constants.DOM_ERROR_HANDLER) || name.equals(Constants.DOM_RESOURCE_RESOLVER) || name.equals(SYMBOL_TABLE) || name.equals(ERROR_REPORTER) || name.equals(ERROR_HANDLER) || name.equals(ENTITY_RESOLVER) || name.equals(XMLGRAMMAR_POOL) || name.equals(SCHEMA_LOCATION) || name.equals(SCHEMA_NONS_LOCATION) || name.equals(JAXP_SCHEMA_SOURCE) || name.equals(SCHEMA_DV_FACTORY)) { return true; } return false; } /* (non-Javadoc) * @see DOMConfiguration#getParameter(String) */ public Object getParameter(String name) throws DOMException { if (name.equals(Constants.DOM_ERROR_HANDLER)){ return (fErrorHandler != null) ? fErrorHandler.getErrorHandler() : null; } else if (name.equals(Constants.DOM_RESOURCE_RESOLVER)) { return (fResourceResolver != null) ? fResourceResolver.getEntityResolver() : null; } try { boolean feature = getFeature(name); return (feature) ? Boolean.TRUE : Boolean.FALSE; } catch (Exception e) { Object property; try { property = getProperty(name); return property; } catch (Exception ex) { String msg = DOMMessageFormatter.formatMessage( DOMMessageFormatter.DOM_DOMAIN, "FEATURE_NOT_SUPPORTED", new Object[] { name }); throw new DOMException(DOMException.NOT_SUPPORTED_ERR, msg); } } } /* (non-Javadoc) * @see DOMConfiguration#getParameterNames() */ public DOMStringList getParameterNames() { if (fRecognizedParameters == null){ ArrayList<String> v = new ArrayList<>(); v.add(Constants.DOM_VALIDATE); v.add(Constants.DOM_ERROR_HANDLER); v.add(Constants.DOM_RESOURCE_RESOLVER); v.add(SYMBOL_TABLE); v.add(ERROR_REPORTER); v.add(ERROR_HANDLER); v.add(ENTITY_RESOLVER); v.add(XMLGRAMMAR_POOL); v.add(SCHEMA_LOCATION); v.add(SCHEMA_NONS_LOCATION); v.add(JAXP_SCHEMA_SOURCE); v.add(SCHEMA_FULL_CHECKING); v.add(CONTINUE_AFTER_FATAL_ERROR); v.add(ALLOW_JAVA_ENCODINGS); v.add(STANDARD_URI_CONFORMANT_FEATURE); v.add(VALIDATE_ANNOTATIONS); v.add(GENERATE_SYNTHETIC_ANNOTATIONS); v.add(HONOUR_ALL_SCHEMALOCATIONS); v.add(NAMESPACE_GROWTH); v.add(TOLERATE_DUPLICATES); v.add(OVERRIDE_PARSER); fRecognizedParameters = new DOMStringListImpl(v); } return fRecognizedParameters; } /* (non-Javadoc) * @see DOMConfiguration#setParameter(String, Object) */ public void setParameter(String name, Object value) throws DOMException { if (value instanceof Boolean) { boolean state = ((Boolean) value).booleanValue(); if (name.equals("validate") && state) { return; } try { setFeature(name, state); } catch (Exception e) { String msg = DOMMessageFormatter.formatMessage( DOMMessageFormatter.DOM_DOMAIN, "FEATURE_NOT_SUPPORTED", new Object[] { name }); throw new DOMException(DOMException.NOT_SUPPORTED_ERR, msg); } return; } if (name.equals(Constants.DOM_ERROR_HANDLER)) { if (value instanceof DOMErrorHandler) { try { fErrorHandler = new DOMErrorHandlerWrapper((DOMErrorHandler) value); setErrorHandler(fErrorHandler); } catch (XMLConfigurationException e) { } } else { // REVISIT: type mismatch String msg = DOMMessageFormatter.formatMessage( DOMMessageFormatter.DOM_DOMAIN, "FEATURE_NOT_SUPPORTED", new Object[] { name }); throw new DOMException(DOMException.NOT_SUPPORTED_ERR, msg); } return; } if (name.equals(Constants.DOM_RESOURCE_RESOLVER)) { if (value instanceof LSResourceResolver) { try { fResourceResolver = new DOMEntityResolverWrapper((LSResourceResolver) value); setEntityResolver(fResourceResolver); } catch (XMLConfigurationException e) {} } else { // REVISIT: type mismatch String msg = DOMMessageFormatter.formatMessage( DOMMessageFormatter.DOM_DOMAIN, "FEATURE_NOT_SUPPORTED", new Object[] { name }); throw new DOMException(DOMException.NOT_SUPPORTED_ERR, msg); } return; } try { setProperty(name, value); } catch (Exception ex) { String msg = DOMMessageFormatter.formatMessage( DOMMessageFormatter.DOM_DOMAIN, "FEATURE_NOT_SUPPORTED", new Object[] { name }); throw new DOMException(DOMException.NOT_SUPPORTED_ERR, msg); } } XMLInputSource dom2xmlInputSource(LSInput is) { // need to wrap the LSInput with an XMLInputSource XMLInputSource xis = null; /** * An LSParser looks at inputs specified in LSInput in * the following order: characterStream, byteStream, * stringData, systemId, publicId. For consistency * have the same behaviour for XSLoader. */ // check whether there is a Reader // according to DOM, we need to treat such reader as "UTF-16". if (is.getCharacterStream() != null) { xis = new XMLInputSource(is.getPublicId(), is.getSystemId(), is.getBaseURI(), is.getCharacterStream(), "UTF-16"); } // check whether there is an InputStream else if (is.getByteStream() != null) { xis = new XMLInputSource(is.getPublicId(), is.getSystemId(), is.getBaseURI(), is.getByteStream(), is.getEncoding()); } // if there is a string data, use a StringReader // according to DOM, we need to treat such data as "UTF-16". else if (is.getStringData() != null && is.getStringData().length() != 0) { xis = new XMLInputSource(is.getPublicId(), is.getSystemId(), is.getBaseURI(), new StringReader(is.getStringData()), "UTF-16"); } // otherwise, just use the public/system/base Ids else { xis = new XMLInputSource(is.getPublicId(), is.getSystemId(), is.getBaseURI(), false); } return xis; } // Implements XSElementDeclHelper interface public XSElementDecl getGlobalElementDecl(QName element) { SchemaGrammar sGrammar = fGrammarBucket.getGrammar(element.uri); if (sGrammar != null) { return sGrammar.getGlobalElementDecl(element.localpart); } return null; } } // XMLGrammarLoader
{ "pile_set_name": "Github" }
//------------------------------------------------------------------------------------------------// // // // A b s t r a c t N o t e I n t e r // // // //------------------------------------------------------------------------------------------------// // <editor-fold defaultstate="collapsed" desc="hdr"> // // Copyright © Audiveris 2018. All rights reserved. // // This program is free software: you can redistribute it and/or modify it under the terms of the // GNU Affero General Public License as published by the Free Software Foundation, either version // 3 of the License, or (at your option) any later version. // // This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; // without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. // See the GNU Affero General Public License for more details. // // You should have received a copy of the GNU Affero General Public License along with this // program. If not, see <http://www.gnu.org/licenses/>. //------------------------------------------------------------------------------------------------// // </editor-fold> package org.audiveris.omr.sig.inter; import org.audiveris.omr.glyph.Glyph; import org.audiveris.omr.glyph.Shape; import org.audiveris.omr.math.Rational; import org.audiveris.omr.sheet.Staff; import org.audiveris.omr.sheet.rhythm.Measure; import org.audiveris.omr.sheet.rhythm.Voice; import org.audiveris.omr.sig.GradeImpacts; import org.audiveris.omr.sig.relation.AugmentationRelation; import org.audiveris.omr.sig.relation.DoubleDotRelation; import org.audiveris.omr.sig.relation.Relation; import org.slf4j.Logger; import org.slf4j.LoggerFactory; import java.awt.Rectangle; import java.util.EnumMap; import java.util.Map; /** * Class {@code AbstractNoteInter} is an abstract base for all notes interpretations, * that is heads (with or without stem) and rests. * * @author Hervé Bitteur */ public abstract class AbstractNoteInter extends AbstractPitchedInter { private static final Logger logger = LoggerFactory.getLogger(AbstractNoteInter.class); /** The quarter duration value. */ public static final Rational QUARTER_DURATION = new Rational(1, 4); /** All shape-based intrinsic durations. */ private static final Map<Shape, Rational> shapeDurations = buildShapeDurations(); /** * Creates a new AbstractNoteInter object. * * @param glyph the underlying glyph, if any * @param bounds the object bounds * @param shape the underlying shape * @param impacts the grade details * @param staff the related staff * @param pitch the note pitch */ public AbstractNoteInter (Glyph glyph, Rectangle bounds, Shape shape, GradeImpacts impacts, Staff staff, Double pitch) { super(glyph, bounds, shape, impacts, staff, pitch); } /** * Creates a new AbstractNoteInter object. * * @param glyph the underlying glyph, if any * @param bounds the object bounds * @param shape the underlying shape * @param grade the assignment quality * @param staff the related staff * @param pitch the note pitch */ public AbstractNoteInter (Glyph glyph, Rectangle bounds, Shape shape, double grade, Staff staff, Double pitch) { super(glyph, bounds, shape, grade, staff, pitch); } /** * No-arg constructor meant for JAXB. */ protected AbstractNoteInter () { } //----------// // getChord // //----------// /** * Report the containing chord, if any. * * @return containing chord or null */ public AbstractChordInter getChord () { return (AbstractChordInter) getEnsemble(); } //-------------// // getDotCount // //-------------// /** * Report the number of augmentation dots (0, 1 or 2) that apply to this note. * * @return the count of augmentation dots */ public int getDotCount () { AugmentationDotInter firstDot = getFirstAugmentationDot(); if (firstDot != null) { if (sig.hasRelation(firstDot, DoubleDotRelation.class)) { return 2; } return 1; } return 0; } //-------------------------// // getFirstAugmentationDot // //-------------------------// /** * Report the first augmentation dot, if any, that is linked to this note. * * @return the first dot, if any */ public AugmentationDotInter getFirstAugmentationDot () { for (Relation dn : sig.getRelations(this, AugmentationRelation.class)) { return (AugmentationDotInter) sig.getOppositeInter(this, dn); } return null; } //-------// // added // //-------// /** * Since a note instance is held by its containing staff, make sure staff * notes collection is updated. * * @see #remove() */ @Override public void added () { super.added(); if (staff != null) { staff.addNote(this); } } //-----------// // getOctave // //-----------// /** * Report the octave for this note, using the current clef, and the pitch position * of the note. * * @return the related octave */ public int getOctave () { AbstractChordInter chord = getChord(); Measure measure = chord.getMeasure(); ClefInter clef = measure.getClefBefore(getCenter(), getStaff()); return ClefInter.octaveOf(clef, pitch); } //---------// // getStep // //---------// /** * Report the note step (within the octave). * * @return the note step */ public Step getStep () { AbstractChordInter chord = getChord(); Measure measure = chord.getMeasure(); ClefInter clef = measure.getClefBefore(getCenter(), staff); return ClefInter.noteStepOf(clef, (int) Math.rint(pitch)); } //----------// // getVoice // //----------// @Override public Voice getVoice () { final AbstractChordInter chord = getChord(); if (chord != null) { return chord.getVoice(); } return null; } //--------// // remove // //--------// /** * Since a note instance is held by its containing staff, make sure staff * notes collection is updated. * * @param extensive true for non-manual removals only * @see #added() */ @Override public void remove (boolean extensive) { if (staff != null) { staff.removeNote(this); } super.remove(extensive); } //------------------// // getShapeDuration // //------------------// /** * Report the duration indicated by the shape of the note or rest * (regardless of any beam, flag, dot or tuplet). * * @param shape the shape of the note / rest * @return the corresponding intrinsic duration */ public static Rational getShapeDuration (Shape shape) { return shapeDurations.get(shape); } //---------------------// // buildShapeDurations // //---------------------// /** * Populate the map of intrinsic shape durations. * * @return the populated map */ private static EnumMap<Shape, Rational> buildShapeDurations () { EnumMap<Shape, Rational> map = new EnumMap<>(Shape.class); map.put(Shape.LONG_REST, new Rational(4, 1)); // 4 measures map.put(Shape.BREVE_REST, new Rational(2, 1)); // 2 measures map.put(Shape.BREVE, new Rational(2, 1)); map.put(Shape.WHOLE_REST, Rational.ONE); // 1 measure map.put(Shape.WHOLE_NOTE, Rational.ONE); map.put(Shape.HALF_REST, new Rational(1, 2)); map.put(Shape.NOTEHEAD_VOID, new Rational(1, 2)); map.put(Shape.NOTEHEAD_VOID_SMALL, new Rational(1, 2)); map.put(Shape.QUARTER_REST, QUARTER_DURATION); map.put(Shape.NOTEHEAD_BLACK, QUARTER_DURATION); map.put(Shape.NOTEHEAD_BLACK_SMALL, QUARTER_DURATION); map.put(Shape.EIGHTH_REST, new Rational(1, 8)); map.put(Shape.ONE_16TH_REST, new Rational(1, 16)); map.put(Shape.ONE_32ND_REST, new Rational(1, 32)); map.put(Shape.ONE_64TH_REST, new Rational(1, 64)); map.put(Shape.ONE_128TH_REST, new Rational(1, 128)); return map; } /** Names of the various note steps. */ public static enum Step { /** La */ A, /** Si */ B, /** Do */ C, /** Ré */ D, /** Mi */ E, /** Fa */ F, /** Sol */ G; } }
{ "pile_set_name": "Github" }
// Karma configuration file, see link for more information // https://karma-runner.github.io/1.0/config/configuration-file.html const { join } = require('path'); const getBaseKarmaConfig = require('../../karma.conf'); module.exports = function(config) { const baseConfig = getBaseKarmaConfig(); config.set({ ...baseConfig, coverageIstanbulReporter: { ...baseConfig.coverageIstanbulReporter, dir: join(__dirname, '../../coverage/libs/material') } }); };
{ "pile_set_name": "Github" }
// Code generated by linux/mkall.go generatePtraceRegSet("arm64"). DO NOT EDIT. package unix import "unsafe" // PtraceGetRegSetArm64 fetches the registers used by arm64 binaries. func PtraceGetRegSetArm64(pid, addr int, regsout *PtraceRegsArm64) error { iovec := Iovec{(*byte)(unsafe.Pointer(regsout)), uint64(unsafe.Sizeof(*regsout))} return ptrace(PTRACE_GETREGSET, pid, uintptr(addr), uintptr(unsafe.Pointer(&iovec))) } // PtraceSetRegSetArm64 sets the registers used by arm64 binaries. func PtraceSetRegSetArm64(pid, addr int, regs *PtraceRegsArm64) error { iovec := Iovec{(*byte)(unsafe.Pointer(regs)), uint64(unsafe.Sizeof(*regs))} return ptrace(PTRACE_SETREGSET, pid, uintptr(addr), uintptr(unsafe.Pointer(&iovec))) }
{ "pile_set_name": "Github" }
/** * This header is generated by class-dump-z 0.2b. * * Source: (null) */ #import <AssistantServices/SAAceSerializable.h> @protocol SADomainObjectCommand <SAAceSerializable> @end
{ "pile_set_name": "Github" }
/* * * Copyright 2015-2016 gRPC authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. * */ #include <stdbool.h> #include <stdio.h> #include <stdlib.h> #include <string.h> #include <grpc/support/alloc.h> #include <grpc/support/host_port.h> #include <grpc/support/port_platform.h> #include <grpc/support/string_util.h> #include "src/core/ext/filters/client_channel/lb_policy_factory.h" #include "src/core/ext/filters/client_channel/parse_address.h" #include "src/core/ext/filters/client_channel/resolver_registry.h" #include "src/core/lib/channel/channel_args.h" #include "src/core/lib/iomgr/combiner.h" #include "src/core/lib/iomgr/resolve_address.h" #include "src/core/lib/iomgr/unix_sockets_posix.h" #include "src/core/lib/slice/slice_internal.h" #include "src/core/lib/slice/slice_string_helpers.h" #include "src/core/lib/support/string.h" typedef struct { /** base class: must be first */ grpc_resolver base; /** the addresses that we've 'resolved' */ grpc_lb_addresses *addresses; /** channel args */ grpc_channel_args *channel_args; /** have we published? */ bool published; /** pending next completion, or NULL */ grpc_closure *next_completion; /** target result address for next completion */ grpc_channel_args **target_result; } sockaddr_resolver; static void sockaddr_destroy(grpc_exec_ctx *exec_ctx, grpc_resolver *r); static void sockaddr_maybe_finish_next_locked(grpc_exec_ctx *exec_ctx, sockaddr_resolver *r); static void sockaddr_shutdown_locked(grpc_exec_ctx *exec_ctx, grpc_resolver *r); static void sockaddr_channel_saw_error_locked(grpc_exec_ctx *exec_ctx, grpc_resolver *r); static void sockaddr_next_locked(grpc_exec_ctx *exec_ctx, grpc_resolver *r, grpc_channel_args **target_result, grpc_closure *on_complete); static const grpc_resolver_vtable sockaddr_resolver_vtable = { sockaddr_destroy, sockaddr_shutdown_locked, sockaddr_channel_saw_error_locked, sockaddr_next_locked}; static void sockaddr_shutdown_locked(grpc_exec_ctx *exec_ctx, grpc_resolver *resolver) { sockaddr_resolver *r = (sockaddr_resolver *)resolver; if (r->next_completion != NULL) { *r->target_result = NULL; GRPC_CLOSURE_SCHED( exec_ctx, r->next_completion, GRPC_ERROR_CREATE_FROM_STATIC_STRING("Resolver Shutdown")); r->next_completion = NULL; } } static void sockaddr_channel_saw_error_locked(grpc_exec_ctx *exec_ctx, grpc_resolver *resolver) { sockaddr_resolver *r = (sockaddr_resolver *)resolver; r->published = false; sockaddr_maybe_finish_next_locked(exec_ctx, r); } static void sockaddr_next_locked(grpc_exec_ctx *exec_ctx, grpc_resolver *resolver, grpc_channel_args **target_result, grpc_closure *on_complete) { sockaddr_resolver *r = (sockaddr_resolver *)resolver; GPR_ASSERT(!r->next_completion); r->next_completion = on_complete; r->target_result = target_result; sockaddr_maybe_finish_next_locked(exec_ctx, r); } static void sockaddr_maybe_finish_next_locked(grpc_exec_ctx *exec_ctx, sockaddr_resolver *r) { if (r->next_completion != NULL && !r->published) { r->published = true; grpc_arg arg = grpc_lb_addresses_create_channel_arg(r->addresses); *r->target_result = grpc_channel_args_copy_and_add(r->channel_args, &arg, 1); GRPC_CLOSURE_SCHED(exec_ctx, r->next_completion, GRPC_ERROR_NONE); r->next_completion = NULL; } } static void sockaddr_destroy(grpc_exec_ctx *exec_ctx, grpc_resolver *gr) { sockaddr_resolver *r = (sockaddr_resolver *)gr; grpc_lb_addresses_destroy(exec_ctx, r->addresses); grpc_channel_args_destroy(exec_ctx, r->channel_args); gpr_free(r); } static char *ip_get_default_authority(grpc_uri *uri) { const char *path = uri->path; if (path[0] == '/') ++path; return gpr_strdup(path); } static char *ipv4_get_default_authority(grpc_resolver_factory *factory, grpc_uri *uri) { return ip_get_default_authority(uri); } static char *ipv6_get_default_authority(grpc_resolver_factory *factory, grpc_uri *uri) { return ip_get_default_authority(uri); } #ifdef GRPC_HAVE_UNIX_SOCKET char *unix_get_default_authority(grpc_resolver_factory *factory, grpc_uri *uri) { return gpr_strdup("localhost"); } #endif static void do_nothing(void *ignored) {} static grpc_resolver *sockaddr_create(grpc_exec_ctx *exec_ctx, grpc_resolver_args *args, bool parse(const grpc_uri *uri, grpc_resolved_address *dst)) { if (0 != strcmp(args->uri->authority, "")) { gpr_log(GPR_ERROR, "authority based uri's not supported by the %s scheme", args->uri->scheme); return NULL; } /* Construct addresses. */ grpc_slice path_slice = grpc_slice_new(args->uri->path, strlen(args->uri->path), do_nothing); grpc_slice_buffer path_parts; grpc_slice_buffer_init(&path_parts); grpc_slice_split(path_slice, ",", &path_parts); grpc_lb_addresses *addresses = grpc_lb_addresses_create(path_parts.count, NULL /* user_data_vtable */); bool errors_found = false; for (size_t i = 0; i < addresses->num_addresses; i++) { grpc_uri ith_uri = *args->uri; char *part_str = grpc_slice_to_c_string(path_parts.slices[i]); ith_uri.path = part_str; if (!parse(&ith_uri, &addresses->addresses[i].address)) { errors_found = true; /* GPR_TRUE */ } gpr_free(part_str); if (errors_found) break; } grpc_slice_buffer_destroy_internal(exec_ctx, &path_parts); grpc_slice_unref_internal(exec_ctx, path_slice); if (errors_found) { grpc_lb_addresses_destroy(exec_ctx, addresses); return NULL; } /* Instantiate resolver. */ sockaddr_resolver *r = (sockaddr_resolver *)gpr_zalloc(sizeof(sockaddr_resolver)); r->addresses = addresses; r->channel_args = grpc_channel_args_copy(args->args); grpc_resolver_init(&r->base, &sockaddr_resolver_vtable, args->combiner); return &r->base; } /* * FACTORY */ static void sockaddr_factory_ref(grpc_resolver_factory *factory) {} static void sockaddr_factory_unref(grpc_resolver_factory *factory) {} #define DECL_FACTORY(name) \ static grpc_resolver *name##_factory_create_resolver( \ grpc_exec_ctx *exec_ctx, grpc_resolver_factory *factory, \ grpc_resolver_args *args) { \ return sockaddr_create(exec_ctx, args, grpc_parse_##name); \ } \ static const grpc_resolver_factory_vtable name##_factory_vtable = { \ sockaddr_factory_ref, sockaddr_factory_unref, \ name##_factory_create_resolver, name##_get_default_authority, #name}; \ static grpc_resolver_factory name##_resolver_factory = { \ &name##_factory_vtable} #ifdef GRPC_HAVE_UNIX_SOCKET DECL_FACTORY(unix); #endif DECL_FACTORY(ipv4); DECL_FACTORY(ipv6); void grpc_resolver_sockaddr_init(void) { grpc_register_resolver_type(&ipv4_resolver_factory); grpc_register_resolver_type(&ipv6_resolver_factory); #ifdef GRPC_HAVE_UNIX_SOCKET grpc_register_resolver_type(&unix_resolver_factory); #endif } void grpc_resolver_sockaddr_shutdown(void) {}
{ "pile_set_name": "Github" }
/* * $HeadURL: http://svn.apache.org/repos/asf/httpcomponents/httpcore/trunk/module-main/src/main/java/org/apache/http/message/AbstractHttpMessage.java $ * $Revision: 620287 $ * $Date: 2008-02-10 07:15:53 -0800 (Sun, 10 Feb 2008) $ * * ==================================================================== * 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. * ==================================================================== * * This software consists of voluntary contributions made by many * individuals on behalf of the Apache Software Foundation. For more * information on the Apache Software Foundation, please see * <http://www.apache.org/>. * */ package org.apache.http.message; import java.util.Iterator; import org.apache.http.Header; import org.apache.http.HeaderIterator; import org.apache.http.HttpMessage; import org.apache.http.params.HttpParams; import org.apache.http.params.BasicHttpParams; /** * Basic implementation of an HTTP message that can be modified. * * @author <a href="mailto:oleg at ural.ru">Oleg Kalnichevski</a> * * @version $Revision: 620287 $ * * @since 4.0 */ public abstract class AbstractHttpMessage implements HttpMessage { protected HeaderGroup headergroup; protected HttpParams params; protected AbstractHttpMessage(final HttpParams params) { super(); this.headergroup = new HeaderGroup(); this.params = params; } protected AbstractHttpMessage() { this(null); } // non-javadoc, see interface HttpMessage public boolean containsHeader(String name) { return this.headergroup.containsHeader(name); } // non-javadoc, see interface HttpMessage public Header[] getHeaders(final String name) { return this.headergroup.getHeaders(name); } // non-javadoc, see interface HttpMessage public Header getFirstHeader(final String name) { return this.headergroup.getFirstHeader(name); } // non-javadoc, see interface HttpMessage public Header getLastHeader(final String name) { return this.headergroup.getLastHeader(name); } // non-javadoc, see interface HttpMessage public Header[] getAllHeaders() { return this.headergroup.getAllHeaders(); } // non-javadoc, see interface HttpMessage public void addHeader(final Header header) { this.headergroup.addHeader(header); } // non-javadoc, see interface HttpMessage public void addHeader(final String name, final String value) { if (name == null) { throw new IllegalArgumentException("Header name may not be null"); } this.headergroup.addHeader(new BasicHeader(name, value)); } // non-javadoc, see interface HttpMessage public void setHeader(final Header header) { this.headergroup.updateHeader(header); } // non-javadoc, see interface HttpMessage public void setHeader(final String name, final String value) { if (name == null) { throw new IllegalArgumentException("Header name may not be null"); } this.headergroup.updateHeader(new BasicHeader(name, value)); } // non-javadoc, see interface HttpMessage public void setHeaders(final Header[] headers) { this.headergroup.setHeaders(headers); } // non-javadoc, see interface HttpMessage public void removeHeader(final Header header) { this.headergroup.removeHeader(header); } // non-javadoc, see interface HttpMessage public void removeHeaders(final String name) { if (name == null) { return; } for (Iterator i = this.headergroup.iterator(); i.hasNext(); ) { Header header = (Header) i.next(); if (name.equalsIgnoreCase(header.getName())) { i.remove(); } } } // non-javadoc, see interface HttpMessage public HeaderIterator headerIterator() { return this.headergroup.iterator(); } // non-javadoc, see interface HttpMessage public HeaderIterator headerIterator(String name) { return this.headergroup.iterator(name); } // non-javadoc, see interface HttpMessage public HttpParams getParams() { if (this.params == null) { this.params = new BasicHttpParams(); } return this.params; } // non-javadoc, see interface HttpMessage public void setParams(final HttpParams params) { if (params == null) { throw new IllegalArgumentException("HTTP parameters may not be null"); } this.params = params; } }
{ "pile_set_name": "Github" }
# -*- coding: utf-8 -*- """ Keyhole Markup Language (KML) output support in ObsPy :copyright: The ObsPy Development Team ([email protected]) :license: GNU Lesser General Public License, Version 3 (https://www.gnu.org/copyleft/lesser.html) """ from math import log from lxml.etree import Element, SubElement, tostring from matplotlib.cm import get_cmap from obspy import UTCDateTime from obspy.core.event import Catalog from obspy.core.inventory.inventory import Inventory def inventory_to_kml_string( inventory, icon_url="https://maps.google.com/mapfiles/kml/shapes/triangle.png", icon_size=1.5, label_size=1.0, cmap="Paired", encoding="UTF-8", timespans=True, strip_far_future_end_times=True): """ Convert an :class:`~obspy.core.inventory.inventory.Inventory` to a KML string representation. :type inventory: :class:`~obspy.core.inventory.inventory.Inventory` :param inventory: Input station metadata. :type icon_url: str :param icon_url: Internet URL of icon to use for station (e.g. PNG image). :type icon_size: float :param icon_size: Icon size. :type label_size: float :param label_size: Label size. :type encoding: str :param encoding: Encoding used for XML string. :type timespans: bool :param timespans: Whether to add timespan information to the single station elements in the KML or not. If timespans are used, the displayed information in e.g. Google Earth will represent a snapshot in time, such that using the time slider different states of the inventory in time can be visualized. If timespans are not used, any station active at any point in time is always shown. :type strip_far_future_end_times: bool :param strip_far_future_end_times: Leave out likely fictitious end times of stations (more than twenty years after current time). Far future end times may produce time sliders with bad overall time span in third party applications viewing the KML file. :rtype: byte string :return: Encoded byte string containing KML information of the station metadata. """ twenty_years_from_now = UTCDateTime() + 3600 * 24 * 365 * 20 # construct the KML file kml = Element("kml") kml.set("xmlns", "http://www.opengis.net/kml/2.2") document = SubElement(kml, "Document") SubElement(document, "name").text = "Inventory" # style definition cmap = get_cmap(name=cmap, lut=len(inventory.networks)) for i in range(len(inventory.networks)): color = _rgba_tuple_to_kml_color_code(cmap(i)) style = SubElement(document, "Style") style.set("id", "station_%i" % i) iconstyle = SubElement(style, "IconStyle") SubElement(iconstyle, "color").text = color SubElement(iconstyle, "scale").text = str(icon_size) icon = SubElement(iconstyle, "Icon") SubElement(icon, "href").text = icon_url hotspot = SubElement(iconstyle, "hotSpot") hotspot.set("x", "0.5") hotspot.set("y", "0.5") hotspot.set("xunits", "fraction") hotspot.set("yunits", "fraction") labelstyle = SubElement(style, "LabelStyle") SubElement(labelstyle, "color").text = color SubElement(labelstyle, "scale").text = str(label_size) for i, net in enumerate(inventory): folder = SubElement(document, "Folder") SubElement(folder, "name").text = str(net.code) SubElement(folder, "open").text = "1" SubElement(folder, "description").text = str(net) style = SubElement(folder, "Style") liststyle = SubElement(style, "ListStyle") SubElement(liststyle, "listItemType").text = "check" SubElement(liststyle, "bgColor").text = "00ffff" SubElement(liststyle, "maxSnippetLines").text = "5" # add one marker per station code for sta in net: placemark = SubElement(folder, "Placemark") SubElement(placemark, "name").text = ".".join((net.code, sta.code)) SubElement(placemark, "styleUrl").text = "#station_%i" % i SubElement(placemark, "color").text = color if sta.longitude is not None and sta.latitude is not None: point = SubElement(placemark, "Point") SubElement(point, "coordinates").text = "%.6f,%.6f,0" % \ (sta.longitude, sta.latitude) SubElement(placemark, "description").text = str(sta) if timespans: start = sta.start_date end = sta.end_date if start is not None or end is not None: timespan = SubElement(placemark, "TimeSpan") if start is not None: SubElement(timespan, "begin").text = str(start) if end is not None: if not strip_far_future_end_times or \ end < twenty_years_from_now: SubElement(timespan, "end").text = str(end) if timespans: start = net.start_date end = net.end_date if start is not None or end is not None: timespan = SubElement(folder, "TimeSpan") if start is not None: SubElement(timespan, "begin").text = str(start) if end is not None: if not strip_far_future_end_times or \ end < twenty_years_from_now: SubElement(timespan, "end").text = str(end) # generate and return KML string return tostring(kml, pretty_print=True, xml_declaration=True, encoding=encoding) def catalog_to_kml_string( catalog, icon_url="https://maps.google.com/mapfiles/kml/shapes/earthquake.png", label_func=None, icon_size_func=None, encoding="UTF-8", timestamps=True): """ Convert a :class:`~obspy.core.event.Catalog` to a KML string representation. :type catalog: :class:`~obspy.core.event.Catalog` :param catalog: Input catalog data. :type icon_url: str :param icon_url: Internet URL of icon to use for events (e.g. PNG image). :type label_func: func :type label_func: Custom function to use for determining each event's label. User provided function is supposed to take an :class:`~obspy.core.event.Event` object as single argument, e.g. for empty labels use `label_func=lambda x: ""`. :type icon_size_func: func :type icon_size_func: Custom function to use for determining each event's icon size. User provided function should take an :class:`~obspy.core.event.Event` object as single argument and return a float. :type encoding: str :param encoding: Encoding used for XML string. :type timestamps: bool :param timestamps: Whether to add timestamp information to the event elements in the KML or not. If timestamps are used, the displayed information in e.g. Google Earth will represent a snapshot in time, such that using the time slider different states of the catalog in time can be visualized. If timespans are not used, any event happening at any point in time is always shown. :rtype: byte string :return: Encoded byte string containing KML information of the event metadata. """ # default label and size functions if not label_func: def label_func(event): origin = (event.preferred_origin() or event.origins and event.origins[0] or None) mag = (event.preferred_magnitude() or event.magnitudes and event.magnitudes[0] or None) label = origin.time and str(origin.time.date) or "" if mag: label += " %.1f" % mag.mag return label if not icon_size_func: def icon_size_func(event): mag = (event.preferred_magnitude() or event.magnitudes and event.magnitudes[0] or None) if mag: try: icon_size = 1.2 * log(1.5 + mag.mag) except ValueError: icon_size = 0.1 else: icon_size = 0.5 return icon_size # construct the KML file kml = Element("kml") kml.set("xmlns", "http://www.opengis.net/kml/2.2") document = SubElement(kml, "Document") SubElement(document, "name").text = "Catalog" # style definitions for earthquakes style = SubElement(document, "Style") style.set("id", "earthquake") iconstyle = SubElement(style, "IconStyle") SubElement(iconstyle, "scale").text = "0.5" icon = SubElement(iconstyle, "Icon") SubElement(icon, "href").text = icon_url hotspot = SubElement(iconstyle, "hotSpot") hotspot.set("x", "0.5") hotspot.set("y", "0.5") hotspot.set("xunits", "fraction") hotspot.set("yunits", "fraction") labelstyle = SubElement(style, "LabelStyle") SubElement(labelstyle, "color").text = "ff0000ff" SubElement(labelstyle, "scale").text = "0.8" folder = SubElement(document, "Folder") SubElement(folder, "name").text = "Catalog" SubElement(folder, "open").text = "1" SubElement(folder, "description").text = str(catalog) style = SubElement(folder, "Style") liststyle = SubElement(style, "ListStyle") SubElement(liststyle, "listItemType").text = "check" SubElement(liststyle, "bgColor").text = "00ffffff" SubElement(liststyle, "maxSnippetLines").text = "5" # add one marker per event for event in catalog: origin = (event.preferred_origin() or event.origins and event.origins[0] or None) placemark = SubElement(folder, "Placemark") SubElement(placemark, "name").text = label_func(event) SubElement(placemark, "styleUrl").text = "#earthquake" style = SubElement(placemark, "Style") icon_style = SubElement(style, "IconStyle") liststyle = SubElement(style, "ListStyle") SubElement(liststyle, "maxSnippetLines").text = "5" SubElement(icon_style, "scale").text = "%.5f" % icon_size_func(event) if origin: if origin.longitude is not None and origin.latitude is not None: point = SubElement(placemark, "Point") SubElement(point, "coordinates").text = "%.6f,%.6f,0" % \ (origin.longitude, origin.latitude) SubElement(placemark, "description").text = str(event) if timestamps: time = _get_event_timestamp(event) if time is not None: SubElement(placemark, "TimeStamp").text = str(time) # generate and return KML string return tostring(kml, pretty_print=True, xml_declaration=True, encoding=encoding) def _write_kml(obj, filename, **kwargs): """ Write :class:`~obspy.core.inventory.inventory.Inventory` or :class:`~obspy.core.event.Catalog` object to a KML file. For additional parameters see :meth:`inventory_to_kml_string` and :meth:`catalog_to_kml_string`. :type obj: :class:`~obspy.core.event.Catalog` or :class:`~obspy.core.inventory.Inventory` :param obj: ObsPy object for KML output :type filename: str :param filename: Filename to write to. Suffix ".kml" will be appended if not already present. """ if isinstance(obj, Catalog): kml_string = catalog_to_kml_string(obj, **kwargs) elif isinstance(obj, Inventory): kml_string = inventory_to_kml_string(obj, **kwargs) else: msg = ("Object for KML output must be " "a Catalog or Inventory.") raise TypeError(msg) if not filename.endswith(".kml"): filename += ".kml" with open(filename, "wb") as fh: fh.write(kml_string) def _rgba_tuple_to_kml_color_code(rgba): """ Convert tuple of (red, green, blue, alpha) float values (0.0-1.0) to KML hex color code string "aabbggrr". """ try: r, g, b, a = rgba except Exception: r, g, b = rgba a = 1.0 return "".join(["%02x" % int(x * 255) for x in (a, b, g, r)]) def _get_event_timestamp(event): """ Get timestamp information for the event. Search is perfomed in the following order: - origin time of preferred origin - origin time of first origin found that has a origin time - minimum of all found pick times - `None` if no time is found in the above search """ origin = event.preferred_origin() if origin is not None and origin.time is not None: return origin.time for origin in event.origins: if origin.time is not None: return origin.time pick_times = [pick.time for pick in event.picks if pick.time is not None] if pick_times: return min(pick_times) return None if __name__ == '__main__': import doctest doctest.testmod(exclude_empty=True)
{ "pile_set_name": "Github" }
from loguru import logger from flexget import plugin from flexget.config_schema import one_or_more from flexget.entry import Entry from flexget.event import event from flexget.utils.cached_input import cached from flexget.utils.requests import RequestException logger = logger.bind(name='kitsu') class KitsuAnime: """ Creates an entry for each item in your kitsu.io list. Syntax: kitsu: username: <value> lists: - <current|planned|completed|on_hold|dropped> - <current|planned|completed|on_hold|dropped> type: - <ona|ova|tv|movie|music|special> - <ona|ova|tv|movie|music|special> status: <airing|finished> latest: <yes|no> """ schema = { 'type': 'object', 'properties': { 'username': {'type': 'string'}, 'lists': one_or_more( { 'type': 'string', 'enum': ['current', 'planned', 'completed', 'on_hold', 'dropped'], } ), 'type': one_or_more( {'type': 'string', 'enum': ['ona', 'ova', 'tv', 'movie', 'music', 'special']} ), 'latest': {'type': 'boolean', 'default': False}, 'status': {'type': 'string', 'enum': ['airing', 'finished']}, }, 'required': ['username'], 'additionalProperties': False, } @cached('kitsu', persist='2 hours') def on_task_input(self, task, config): user_payload = {'filter[name]': config['username']} try: user_response = task.requests.get( 'https://kitsu.io/api/edge/users', params=user_payload ) except RequestException as e: error_message = 'Error finding User url: {url}'.format(url=e.request.url) if hasattr(e, 'response'): error_message += ' status: {status}'.format(status=e.response.status_code) logger.opt(exception=True).debug(error_message) raise plugin.PluginError(error_message) user = user_response.json() if not len(user['data']): raise plugin.PluginError( 'no such username found "{name}"'.format(name=config['username']) ) next_url = 'https://kitsu.io/api/edge/users/{id}/library-entries'.format( id=user['data'][0]['id'] ) payload = { 'filter[status]': ','.join(config['lists']), 'filter[media_type]': 'Anime', 'include': 'media', 'page[limit]': 20, } try: response = task.requests.get(next_url, params=payload) except RequestException as e: error_message = 'Error getting list from {url}'.format(url=e.request.url) if hasattr(e, 'response'): error_message += ' status: {status}'.format(status=e.response.status_code) logger.opt(exception=True).debug(error_message) raise plugin.PluginError(error_message) json_data = response.json() while json_data: for item, anime in zip(json_data['data'], json_data['included']): if item['relationships']['media']['data']['id'] != anime['id']: raise ValueError( 'Anime IDs {id1} and {id2} do not match'.format( id1=item['relationships']['media']['data']['id'], id2=anime['id'] ) ) status = config.get('status') if status is not None: if status == 'airing' and anime['attributes']['endDate'] is not None: continue if status == 'finished' and anime['attributes']['endDate'] is None: continue types = config.get('type') if types is not None: subType = anime['attributes']['subtype'] if subType is None or not subType.lower() in types: continue entry = Entry() entry['title'] = anime['attributes']['canonicalTitle'] titles_en = anime['attributes']['titles'].get('en') if titles_en: entry['kitsu_title_en'] = titles_en titles_en_jp = anime['attributes']['titles'].get('en_jp') if titles_en_jp: entry['kitsu_title_en_jp'] = titles_en_jp titles_ja_jp = anime['attributes']['titles'].get('ja_jp') if titles_ja_jp: entry['kitsu_title_ja_jp'] = titles_ja_jp entry['url'] = anime['links']['self'] if entry.isvalid(): if config.get('latest'): entry['series_episode'] = item['progress'] entry['series_id_type'] = 'sequence' entry['title'] += ' ' + str(entry['progress']) yield entry next_url = json_data['links'].get('next') if next_url: try: response = task.requests.get(next_url) except RequestException as e: error_message = 'Error getting list from next page url: {url}'.format( url=e.request.url ) if hasattr(e, 'response'): error_message += ' status: {status}'.format(status=e.response.status_code) logger.opt(exception=True).debug(error_message) raise plugin.PluginError(error_message) json_data = response.json() else: break @event('plugin.register') def register_plugin(): plugin.register(KitsuAnime, 'kitsu', api_ver=2)
{ "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"), require("../htmlmixed/htmlmixed"), require("../../addon/mode/multiplex")); else if (typeof define == "function" && define.amd) // AMD define(["../../lib/codemirror", "../htmlmixed/htmlmixed", "../../addon/mode/multiplex"], mod); else // Plain browser env mod(CodeMirror); })(function(CodeMirror) { "use strict"; CodeMirror.defineMode("htmlembedded", function(config, parserConfig) { var closeComment = parserConfig.closeComment || "--%>" return CodeMirror.multiplexingMode(CodeMirror.getMode(config, "htmlmixed"), { open: parserConfig.openComment || "<%--", close: closeComment, delimStyle: "comment", mode: {token: function(stream) { stream.skipTo(closeComment) || stream.skipToEnd() return "comment" }} }, { open: parserConfig.open || parserConfig.scriptStartRegex || "<%", close: parserConfig.close || parserConfig.scriptEndRegex || "%>", mode: CodeMirror.getMode(config, parserConfig.scriptingModeSpec) }); }, "htmlmixed"); CodeMirror.defineMIME("application/x-ejs", {name: "htmlembedded", scriptingModeSpec:"javascript"}); CodeMirror.defineMIME("application/x-aspx", {name: "htmlembedded", scriptingModeSpec:"text/x-csharp"}); CodeMirror.defineMIME("application/x-jsp", {name: "htmlembedded", scriptingModeSpec:"text/x-java"}); CodeMirror.defineMIME("application/x-erb", {name: "htmlembedded", scriptingModeSpec:"ruby"}); });
{ "pile_set_name": "Github" }
#!/usr/bin/perl -w BEGIN { unshift @INC, 't/lib'; } use strict; use warnings; our (%INIT, %CUSTOM); use Test::More tests => 14; use File::Spec::Functions qw( catfile updir ); use_ok('TAP::Parser::SubclassTest'); # TODO: for my $source ( ... ) ? my @t_path = (); { # perl source %INIT = %CUSTOM = (); my $source = catfile( @t_path, 't', 'subclass_tests', 'perl_source' ); my $p = TAP::Parser::SubclassTest->new( { source => $source } ); # The grammar is lazily constructed so we need to ask for it to # trigger it's creation. my $grammer = $p->_grammar; ok( $p->{initialized}, 'new subclassed parser' ); is( $p->grammar_class => 'MyGrammar', 'grammar_class' ); is( $p->result_factory_class => 'MyResultFactory', 'result_factory_class' ); is( $INIT{MyGrammar}, 1, 'initialized MyGrammar' ); is( $CUSTOM{MyGrammar}, 1, '... and it was customized' ); # make sure overrided make_* methods work... %CUSTOM = (); $p->make_grammar; is( $CUSTOM{MyGrammar}, 1, 'make custom grammar' ); $p->make_result; is( $CUSTOM{MyResult}, 1, 'make custom result' ); # make sure parser helpers use overrided classes too (the parser should # be the central source of configuration/overriding functionality) # The source is already tested above (parser doesn't keep a copy of the # source currently). So only one to check is the Grammar: %INIT = %CUSTOM = (); my $r = $p->_grammar->tokenize; isa_ok( $r, 'MyResult', 'i has results' ); is( $INIT{MyResult}, 1, 'initialized MyResult' ); is( $CUSTOM{MyResult}, 1, '... and it was customized' ); is( $INIT{MyResultFactory}, 1, '"initialized" MyResultFactory' ); } SKIP: { # non-perl source %INIT = %CUSTOM = (); my $cat = '/bin/cat'; unless ( -e $cat ) { skip "no '$cat'", 2; } my $file = catfile( @t_path, 't', 'data', 'catme.1' ); my $p = TAP::Parser::SubclassTest->new( { exec => [ $cat => $file ], sources => { MySourceHandler => { accept_all => 1 } }, } ); is( $CUSTOM{MySourceHandler}, 1, 'customized a MySourceHandler' ); is( $INIT{MyIterator}, 1, 'initialized MyIterator subclass' ); }
{ "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.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: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" type="xsd:string" /> <xsd:attribute name="type" type="xsd:string" /> <xsd:attribute name="mimetype" type="xsd:string" /> </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" msdata:Ordinal="1" /> <xsd:attribute name="type" type="xsd:string" msdata:Ordinal="3" /> <xsd:attribute name="mimetype" type="xsd:string" msdata:Ordinal="4" /> </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=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value> </resheader> <resheader name="writer"> <value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value> </resheader> </root>
{ "pile_set_name": "Github" }
{ "images" : [ { "idiom" : "universal", "scale" : "1x" }, { "idiom" : "universal", "filename" : "[email protected]", "scale" : "2x" }, { "idiom" : "universal", "scale" : "3x" } ], "info" : { "version" : 1, "author" : "xcode" } }
{ "pile_set_name": "Github" }
# 条形图 #### 示例 <vuep template="#simple-bar"></vuep> <script v-pre type="text/x-template" id="simple-bar"> <template> <ve-bar :data="chartData"></ve-bar> </template> <script> export default { data () { return { chartData: { columns: ['日期', '访问用户', '下单用户', '下单率'], rows: [ { '日期': '1/1', '访问用户': 1393, '下单用户': 1093, '下单率': 0.32 }, { '日期': '1/2', '访问用户': 3530, '下单用户': 3230, '下单率': 0.26 }, { '日期': '1/3', '访问用户': 2923, '下单用户': 2623, '下单率': 0.76 }, { '日期': '1/4', '访问用户': 1723, '下单用户': 1423, '下单率': 0.49 }, { '日期': '1/5', '访问用户': 3792, '下单用户': 3492, '下单率': 0.323 }, { '日期': '1/6', '访问用户': 4593, '下单用户': 4293, '下单率': 0.78 } ] } } } } </script> </script> #### 指定指标维度 <vuep template="#order-dimesion"></vuep> <script v-pre type="text/x-template" id="order-dimesion"> <template> <ve-bar :data="chartData" :settings="chartSettings"></ve-bar> </template> <script> export default { data () { this.chartSettings = { dimension: ['日期'], metrics: ['访问用户'] } return { chartData: { columns: ['日期', '访问用户', '下单用户', '下单率'], rows: [ { '日期': '1/1', '访问用户': 1393, '下单用户': 1093, '下单率': 0.32 }, { '日期': '1/2', '访问用户': 3530, '下单用户': 3230, '下单率': 0.26 }, { '日期': '1/3', '访问用户': 2923, '下单用户': 2623, '下单率': 0.76 }, { '日期': '1/4', '访问用户': 1723, '下单用户': 1423, '下单率': 0.49 }, { '日期': '1/5', '访问用户': 3792, '下单用户': 3492, '下单率': 0.323 }, { '日期': '1/6', '访问用户': 4593, '下单用户': 4293, '下单率': 0.78 } ] } } } } </script> </script> #### 排序条形图 <vuep template="#order-bar"></vuep> <script v-pre type="text/x-template" id="order-bar"> <template> <ve-bar :data="chartData" :settings="chartSettings"></ve-bar> </template> <script> export default { data () { this.chartSettings = { metrics: ['访问用户'], dataOrder: { label: '访问用户', order: 'desc' } } return { chartData: { columns: ['日期', '访问用户', '下单用户', '下单率'], rows: [ { '日期': '1/1', '访问用户': 1393, '下单用户': 1093, '下单率': 0.32 }, { '日期': '1/2', '访问用户': 3530, '下单用户': 3230, '下单率': 0.26 }, { '日期': '1/3', '访问用户': 2923, '下单用户': 2623, '下单率': 0.76 }, { '日期': '1/4', '访问用户': 1723, '下单用户': 1423, '下单率': 0.49 }, { '日期': '1/5', '访问用户': 3792, '下单用户': 3492, '下单率': 0.323 }, { '日期': '1/6', '访问用户': 4593, '下单用户': 4293, '下单率': 0.78 } ] } } } } </script> </script> #### 条形轴配置双y轴 <vuep template="#double-yAxis"></vuep> <script v-pre type="text/x-template" id="double-yAxis"> <template> <ve-bar :data="chartData" :settings="chartSettings"></ve-bar> </template> <script> export default { data () { this.chartSettings = { xAxisType: ['KMB', 'KMB'], xAxisName: ['下单用户', '访问用户'], axisSite: { top: ['访问用户'] } } return { chartData: { columns: ['日期', '访问用户', '下单用户'], rows: [ { '日期': '1/1', '访问用户': 1393, '下单用户': 1093 }, { '日期': '1/2', '访问用户': 3530, '下单用户': 3230 }, { '日期': '1/3', '访问用户': 2923, '下单用户': 2623 }, { '日期': '1/4', '访问用户': 1723, '下单用户': 1423 }, { '日期': '1/5', '访问用户': 3792, '下单用户': 3492 }, { '日期': '1/6', '访问用户': 4593, '下单用户': 4293 } ] } } } } </script> </script> #### 设置legend别名 <vuep template="#set-alias"></vuep> <script v-pre type="text/x-template" id="set-alias"> <template> <ve-bar :data="chartData" :settings="chartSettings"></ve-bar> </template> <script> export default { data () { this.chartSettings = { labelMap: { 'PV': '访问用户', 'Order': '下单用户' }, legendName: { '访问用户': '访问用户 total: 10000' } } return { chartData: { columns: ['date', 'PV', 'Order', 'OrderRate'], rows: [ { 'date': '1/1', 'PV': 1393, 'Order': 1093, 'OrderRate': 0.32 }, { 'date': '1/2', 'PV': 3530, 'Order': 3230, 'OrderRate': 0.26 }, { 'date': '1/3', 'PV': 2923, 'Order': 2623, 'OrderRate': 0.76 }, { 'date': '1/4', 'PV': 1723, 'Order': 1423, 'OrderRate': 0.49 }, { 'date': '1/5', 'PV': 3792, 'Order': 3492, 'OrderRate': 0.323 }, { 'date': '1/6', 'PV': 4593, 'Order': 4293, 'OrderRate': 0.78 } ] } } } } </script> </script> #### 堆叠条形图 <vuep template="#stacked-bar"></vuep> <script v-pre type="text/x-template" id="stacked-bar"> <template> <ve-bar :data="chartData" :settings="chartSettings"></ve-bar> </template> <script> export default { data () { this.chartSettings = { stack: { 'xxx': ['访问用户', '下单用户'] } } return { chartData: { columns: ['日期', '访问用户', '下单用户', '下单率'], rows: [ { '日期': '1/1', '访问用户': 1393, '下单用户': 1093, '下单率': 0.32 }, { '日期': '1/2', '访问用户': 3530, '下单用户': 3230, '下单率': 0.26 }, { '日期': '1/3', '访问用户': 2923, '下单用户': 2623, '下单率': 0.76 }, { '日期': '1/4', '访问用户': 1723, '下单用户': 1423, '下单率': 0.49 }, { '日期': '1/5', '访问用户': 3792, '下单用户': 3492, '下单率': 0.323 }, { '日期': '1/6', '访问用户': 4593, '下单用户': 4293, '下单率': 0.78 } ] } } } } </script> </script> #### 设置纵轴为连续的数值轴 <vuep template="#set-value-axis"></vuep> <script v-pre type="text/x-template" id="set-value-axis"> <template> <ve-bar :data="chartData" :settings="chartSettings"></ve-bar> </template> <script> export default { data () { this.chartSettings = { yAxisType: 'value' } return { chartData: { columns: ['日期', '访问用户'], rows: [ { '日期': 1, '访问用户': 1393 }, { '日期': 2, '访问用户': 3530 }, { '日期': 5, '访问用户': 2923 }, { '日期': 10, '访问用户': 1723 }, { '日期': 15, '访问用户': 3792 }, { '日期': 36, '访问用户': 4593 } ] } } } } </script> </script> #### settings 配置项 | 配置项 | 简介 | 类型 | 备注 | | --- | --- | --- | --- | | dimension | 维度 | array | 默认columns第一项为维度 | | metrics | 指标 | array | 默认columns第二项起为指标 | | xAxisType | 上下坐标轴数据类型 | array | 可选值: KMB, normal, percent | | xAxisName | 上下坐标轴标题 | array | - | | axisSite | 指标所在的轴 | object | 默认不在top轴的指标都在bottom轴 | | stack | 堆叠选项 | object | - | | digit | 设置数据类型为percent时保留的位数 | number | 默认为2 | | dataOrder | 设置数据排序方式 | boolean, object | 默认为false | | scale | 是否是脱离 0 值比例 | array | 默认为[false, false],表示上下两个轴都不会脱离0值比例。设置成 true 后坐标刻度不会强制包含零刻度 | | min | 上下坐标轴最小值 | array | - | | max | 上下坐标轴最大值 | array | - | | labelMap | 设置指标的别名,同时作用于提示框和图例| object | - | | legendName | 设置图表上方图例的别名 | object | - | | label | 设置图形上的文本标签 | object | 内容参考[文档](http://echarts.baidu.com/option.html#series-bar.label) | | itemStyle | 图形样式 | object | 内容参考[文档](http://echarts.baidu.com/option.html#series-bar.itemStyle) | | yAxisType | 纵轴的类型 | string | 可选值'category','value',默认为'category' | | opacity | 透明度 | number | - | > 备注1. axisSite 可以设置 top 和 bottom,例如示例所示 `axisSite: { top: ['占比'] }` 即将占比的数据置于上轴上。 > 备注2. stack 用于将两数据堆叠起来,例如实例中所示`stack: { '销售额': ['销售额-1季度', '销售额-2季度'] }` 即将'销售额-1季度', '销售额-2季度'相应的数据堆叠在一起。 > 备注3. dataOrder 用于设置数据的排序方式,用于更加清晰的展示数据的升降。例如: `{ label: '成本', order: 'asc }` 表示数据按照成本指标升序展示,降序为`desc`。 > 备注4. min和max的值可以直接设置为数字,例如:`[100, 300]`;也可以设置为`['dataMin', 'dataMin']`, `['dataMax', 'dataMax']`,此时表示使用该坐标轴上的最小值或最大值为最小或最大刻度。 > 备注5. 为了优化连续的数值型横轴显示多指标的时候样式,在此情况下默认设置opacity为0.5。
{ "pile_set_name": "Github" }
//System Includes #include <map> #include <thread> #include <string> #include <memory> #include <ciso646> #include <stdexcept> #include <functional> //Project Includes #include <restbed> //External Includes #include <catch.hpp> //System Namespaces using std::thread; using std::string; using std::multimap; using std::shared_ptr; using std::make_shared; //Project Namespaces using namespace restbed; //External Namespaces void put_handler( const shared_ptr< Session > session ) { session->close( 200, "Hello, World!", { { "Content-Length", "13" }, { "Connection", "close" } } ); } SCENARIO( "publishing single path resources", "[resource]" ) { auto resource = make_shared< Resource >( ); resource->set_path( "/resources/1" ); resource->set_method_handler( "PUT", put_handler ); auto settings = make_shared< Settings >( ); settings->set_port( 1984 ); shared_ptr< thread > worker = nullptr; Service service; service.publish( resource ); service.set_ready_handler( [ &worker ]( Service & service ) { worker = make_shared< thread >( [ &service ] ( ) { GIVEN( "I publish a resource at '/resources/1' with a HTTP 'PUT' method handler" ) { WHEN( "I perform a HTTP 'PUT' request to '/resources/1'" ) { auto request = make_shared< Request >( ); request->set_port( 1984 ); request->set_host( "localhost" ); request->set_method( "PUT" ); request->set_path( "/resources/1" ); auto response = Http::sync( request ); THEN( "I should see a '200' (OK) status code" ) { REQUIRE( 200 == response->get_status_code( ) ); REQUIRE( "OK" == response->get_status_message( ) ); } AND_THEN( "I should see a response body of 'Hello, World!'" ) { auto actual = Http::fetch( 13, response ); Bytes expectation { 'H', 'e', 'l', 'l', 'o', ',', ' ', 'W', 'o', 'r', 'l', 'd', '!' }; REQUIRE( actual == expectation ); } multimap< string, string > headers = response->get_headers( ); AND_THEN( "I should see a 'Connection' header value of 'close'" ) { auto header = headers.find( "Connection" ); REQUIRE( header not_eq headers.end( ) ); REQUIRE( "close" == headers.find( "Connection" )->second ); } AND_THEN( "I should see a 'Content-Length' header value of '13'" ) { auto header = headers.find( "Content-Length" ); REQUIRE( header not_eq headers.end( ) ); REQUIRE( "13" == headers.find( "Content-Length" )->second ); } } service.stop( ); } } ); } ); service.start( settings ); worker->join( ); }
{ "pile_set_name": "Github" }
EESchema-LIBRARY Version 2.3 #encoding utf-8 # # MMBT3906-TPCT-ND # DEF MMBT3906-TPCT-ND Q 0 0 Y Y 1 F N F0 "Q" -94 154 60 H V C CNN F1 "MMBT3906-TPCT-ND" 200 0 60 V V C CNN F2 "digikey-footprints:SOT-23-3" 300 300 60 H I L CNN F3 "" 200 300 60 H I L CNN DRAW C 0 0 118 0 1 0 f P 2 0 1 0 -150 0 -100 0 N P 2 0 1 0 -140 0 0 0 N P 2 0 1 0 0 -50 100 -100 N P 2 0 1 0 0 50 100 100 N P 2 0 1 0 0 100 0 -100 N P 4 0 1 0 40 100 20 60 60 50 40 100 F X B 1 -200 0 100 R 50 50 1 1 I X C 2 100 -200 100 U 50 50 1 1 P X E 3 100 200 100 D 50 50 1 1 P ENDDRAW ENDDEF # #End Library
{ "pile_set_name": "Github" }
/* * Licensed to Julian Hyde under one or more contributor license * agreements. See the NOTICE file distributed with this work * for additional information regarding copyright ownership. * Julian Hyde 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 net.hydromatic.morel.foreign; import org.apache.calcite.DataContext; import org.apache.calcite.adapter.java.JavaTypeFactory; import org.apache.calcite.linq4j.QueryProvider; import org.apache.calcite.linq4j.function.Function1; import org.apache.calcite.rel.type.RelDataType; import org.apache.calcite.rel.type.RelDataTypeField; import org.apache.calcite.schema.SchemaPlus; import org.apache.calcite.schema.Schemas; import org.apache.calcite.schema.Table; import org.apache.calcite.tools.Frameworks; import org.apache.calcite.tools.RelBuilder; import org.apache.calcite.util.ImmutableNullableList; import com.google.common.collect.ImmutableList; import com.google.common.collect.ImmutableSortedMap; import net.hydromatic.morel.type.PrimitiveType; import net.hydromatic.morel.type.RecordType; import net.hydromatic.morel.type.Type; import net.hydromatic.morel.type.TypeSystem; import java.sql.Date; import java.sql.Time; import java.sql.Timestamp; import java.util.ArrayList; import java.util.Comparator; import java.util.List; import java.util.Locale; import java.util.Objects; /** Value based on a Calcite schema. * * <p>In ML, it appears as a record with a field for each table. */ public class CalciteForeignValue implements ForeignValue { private final SchemaPlus schema; private final boolean lower; private final RelBuilder relBuilder; /** Creates a CalciteForeignValue. */ public CalciteForeignValue(SchemaPlus schema, boolean lower) { this.schema = Objects.requireNonNull(schema); this.lower = lower; this.relBuilder = RelBuilder.create(Frameworks.newConfigBuilder() .defaultSchema(rootSchema(schema)) .build()); } private static SchemaPlus rootSchema(SchemaPlus schema) { for (;;) { if (schema.getParentSchema() == null) { return schema; } schema = schema.getParentSchema(); } } public Type type(TypeSystem typeSystem) { final ImmutableSortedMap.Builder<String, Type> fields = ImmutableSortedMap.orderedBy(RecordType.ORDERING); schema.getTableNames().forEach(tableName -> fields.put(convert(tableName), toType(schema.getTable(tableName), typeSystem))); return typeSystem.recordType(fields.build()); } private Type toType(Table table, TypeSystem typeSystem) { final ImmutableSortedMap.Builder<String, Type> fields = ImmutableSortedMap.orderedBy(RecordType.ORDERING); table.getRowType(relBuilder.getTypeFactory()) .getFieldList() .forEach(field -> fields.put(convert(field.getName()), toType(field).mlType)); return typeSystem.listType(typeSystem.recordType(fields.build())); } private String convert(String name) { return lower ? name.toLowerCase(Locale.ROOT) : name; } private FieldConverter toType(RelDataTypeField field) { final int ordinal = field.getIndex(); switch (field.getType().getSqlTypeName()) { case BOOLEAN: return new FieldConverter(PrimitiveType.BOOL, ordinal) { public Boolean convertFrom(Object[] sourceValues) { return (Boolean) sourceValues[ordinal]; } }; case TINYINT: case SMALLINT: case INTEGER: case BIGINT: return new FieldConverter(PrimitiveType.INT, ordinal) { public Integer convertFrom(Object[] sourceValues) { final Number sourceValue = (Number) sourceValues[ordinal]; return sourceValue == null ? 0 : sourceValue.intValue(); } }; case FLOAT: case REAL: case DOUBLE: case DECIMAL: return new FieldConverter(PrimitiveType.REAL, ordinal) { public Float convertFrom(Object[] sourceValues) { final Number sourceValue = (Number) sourceValues[ordinal]; return sourceValue == null ? 0f : sourceValue.floatValue(); } }; case DATE: return new FieldConverter(PrimitiveType.STRING, ordinal) { public String convertFrom(Object[] sourceValues) { final Date sourceValue = (Date) sourceValues[ordinal]; return sourceValue == null ? "" : sourceValue.toString(); } }; case TIME: return new FieldConverter(PrimitiveType.STRING, ordinal) { public String convertFrom(Object[] sourceValues) { final Time sourceValue = (Time) sourceValues[ordinal]; return sourceValue == null ? "" : sourceValue.toString(); } }; case TIMESTAMP: return new FieldConverter(PrimitiveType.STRING, ordinal) { public String convertFrom(Object[] sourceValues) { final Timestamp sourceValue = (Timestamp) sourceValues[ordinal]; return sourceValue == null ? "" : sourceValue.toString(); } }; case VARCHAR: case CHAR: default: return new FieldConverter(PrimitiveType.STRING, ordinal) { public String convertFrom(Object[] sourceValues) { final String sourceValue = (String) sourceValues[ordinal]; return sourceValue == null ? "" : sourceValue; } }; } } public Object value() { final ImmutableList.Builder<List<Object>> fieldValues = ImmutableList.builder(); final List<String> names = Schemas.path(schema).names(); schema.getTableNames().forEach(tableName -> fieldValues.add( new RelList(relBuilder.scan(plus(names, tableName)).build(), new EmptyDataContext((JavaTypeFactory) relBuilder.getTypeFactory(), rootSchema(schema)), new Converter(relBuilder.scan(plus(names, tableName)).build().getRowType())))); return fieldValues.build(); } /** Returns a copy of a list with one element appended. */ private static <E> List<E> plus(List<E> list, E e) { return ImmutableList.<E>builder().addAll(list).add(e).build(); } /** Converts from a Calcite row to an SML record. * * <p>The Calcite row is represented as an array, ordered by field ordinal; * the SML record is represented by a list, ordered by field name * (lower-case if {@link #lower}). */ private class Converter implements Function1<Object[], List<Object>> { final Object[] tempValues; final FieldConverter[] fieldConverters; Converter(RelDataType rowType) { final List<RelDataTypeField> fields = new ArrayList<>(rowType.getFieldList()); fields.sort(Comparator.comparing(f -> convert(f.getName()))); tempValues = new Object[fields.size()]; fieldConverters = new FieldConverter[fields.size()]; for (int i = 0; i < fieldConverters.length; i++) { fieldConverters[i] = toType(fields.get(i)); } } public List<Object> apply(Object[] a) { for (int i = 0; i < tempValues.length; i++) { tempValues[i] = fieldConverters[i].convertFrom(a); } return ImmutableNullableList.copyOf(tempValues); } } /** Data context that has no variables. */ private static class EmptyDataContext implements DataContext { private final JavaTypeFactory typeFactory; private final SchemaPlus rootSchema; EmptyDataContext(JavaTypeFactory typeFactory, SchemaPlus rootSchema) { this.typeFactory = typeFactory; this.rootSchema = rootSchema; } public SchemaPlus getRootSchema() { return rootSchema; } public JavaTypeFactory getTypeFactory() { return typeFactory; } public QueryProvider getQueryProvider() { throw new UnsupportedOperationException(); } public Object get(String name) { return null; } } /** Converts a field from Calcite to SML format. */ private abstract static class FieldConverter { final Type mlType; final int ordinal; FieldConverter(Type mlType, int ordinal) { this.mlType = mlType; this.ordinal = ordinal; } /** Given a Calcite row, returns the value of this field in SML format. */ public abstract Object convertFrom(Object[] sourceValues); } } // End CalciteForeignValue.java
{ "pile_set_name": "Github" }
// Copyright (c) 2012 The Chromium Authors. All rights reserved. // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. // Use trace_analyzer::Query and trace_analyzer::TraceAnalyzer to search for // specific trace events that were generated by the trace_event.h API. // // Basic procedure: // - Get trace events JSON string from base::trace_event::TraceLog. // - Create TraceAnalyzer with JSON string. // - Call TraceAnalyzer::AssociateBeginEndEvents (optional). // - Call TraceAnalyzer::AssociateEvents (zero or more times). // - Call TraceAnalyzer::FindEvents with queries to find specific events. // // A Query is a boolean expression tree that evaluates to true or false for a // given trace event. Queries can be combined into a tree using boolean, // arithmetic and comparison operators that refer to data of an individual trace // event. // // The events are returned as trace_analyzer::TraceEvent objects. // TraceEvent contains a single trace event's data, as well as a pointer to // a related trace event. The related trace event is typically the matching end // of a begin event or the matching begin of an end event. // // The following examples use this basic setup code to construct TraceAnalyzer // with the json trace string retrieved from TraceLog and construct an event // vector for retrieving events: // // TraceAnalyzer analyzer(json_events); // TraceEventVector events; // // EXAMPLE 1: Find events named "my_event". // // analyzer.FindEvents(Query(EVENT_NAME) == "my_event", &events); // // EXAMPLE 2: Find begin events named "my_event" with duration > 1 second. // // Query q = (Query(EVENT_NAME) == Query::String("my_event") && // Query(EVENT_PHASE) == Query::Phase(TRACE_EVENT_PHASE_BEGIN) && // Query(EVENT_DURATION) > Query::Double(1000000.0)); // analyzer.FindEvents(q, &events); // // EXAMPLE 3: Associating event pairs across threads. // // If the test needs to analyze something that starts and ends on different // threads, the test needs to use INSTANT events. The typical procedure is to // specify the same unique ID as a TRACE_EVENT argument on both the start and // finish INSTANT events. Then use the following procedure to associate those // events. // // Step 1: instrument code with custom begin/end trace events. // [Thread 1 tracing code] // TRACE_EVENT_INSTANT1("test_latency", "timing1_begin", "id", 3); // [Thread 2 tracing code] // TRACE_EVENT_INSTANT1("test_latency", "timing1_end", "id", 3); // // Step 2: associate these custom begin/end pairs. // Query begin(Query(EVENT_NAME) == Query::String("timing1_begin")); // Query end(Query(EVENT_NAME) == Query::String("timing1_end")); // Query match(Query(EVENT_ARG, "id") == Query(OTHER_ARG, "id")); // analyzer.AssociateEvents(begin, end, match); // // Step 3: search for "timing1_begin" events with existing other event. // Query q = (Query(EVENT_NAME) == Query::String("timing1_begin") && // Query(EVENT_HAS_OTHER)); // analyzer.FindEvents(q, &events); // // Step 4: analyze events, such as checking durations. // for (size_t i = 0; i < events.size(); ++i) { // double duration; // EXPECT_TRUE(events[i].GetAbsTimeToOtherEvent(&duration)); // EXPECT_LT(duration, 1000000.0/60.0); // expect less than 1/60 second. // } // // There are two helper functions, Start(category_filter_string) and Stop(), for // facilitating the collection of process-local traces and building a // TraceAnalyzer from them. A typical test, that uses the helper functions, // looks like the following: // // TEST_F(...) { // Start("*"); // [Invoke the functions you want to test their traces] // auto analyzer = Stop(); // // [Use the analyzer to verify produced traces, as explained above] // } // // Note: The Stop() function needs a SingleThreadTaskRunner. #ifndef BASE_TEST_TRACE_EVENT_ANALYZER_H_ #define BASE_TEST_TRACE_EVENT_ANALYZER_H_ #include <stddef.h> #include <stdint.h> #include <map> #include <memory> #include <string> #include <vector> #include "base/macros.h" #include "base/memory/ref_counted.h" #include "base/trace_event/trace_event.h" namespace base { class Value; } namespace trace_analyzer { class QueryNode; // trace_analyzer::TraceEvent is a more convenient form of the // base::trace_event::TraceEvent class to make tracing-based tests easier to // write. struct TraceEvent { // ProcessThreadID contains a Process ID and Thread ID. struct ProcessThreadID { ProcessThreadID() : process_id(0), thread_id(0) {} ProcessThreadID(int process_id, int thread_id) : process_id(process_id), thread_id(thread_id) {} bool operator< (const ProcessThreadID& rhs) const { if (process_id != rhs.process_id) return process_id < rhs.process_id; return thread_id < rhs.thread_id; } int process_id; int thread_id; }; TraceEvent(); TraceEvent(TraceEvent&& other); ~TraceEvent(); bool SetFromJSON(const base::Value* event_value) WARN_UNUSED_RESULT; bool operator< (const TraceEvent& rhs) const { return timestamp < rhs.timestamp; } TraceEvent& operator=(TraceEvent&& rhs); bool has_other_event() const { return other_event; } // Returns absolute duration in microseconds between this event and other // event. Must have already verified that other_event exists by // Query(EVENT_HAS_OTHER) or by calling has_other_event(). double GetAbsTimeToOtherEvent() const; // Return the argument value if it exists and it is a string. bool GetArgAsString(const std::string& name, std::string* arg) const; // Return the argument value if it exists and it is a number. bool GetArgAsNumber(const std::string& name, double* arg) const; // Return the argument value if it exists. bool GetArgAsValue(const std::string& name, std::unique_ptr<base::Value>* arg) const; // Check if argument exists and is string. bool HasStringArg(const std::string& name) const; // Check if argument exists and is number (double, int or bool). bool HasNumberArg(const std::string& name) const; // Check if argument exists. bool HasArg(const std::string& name) const; // Get known existing arguments as specific types. // Useful when you have already queried the argument with // Query(HAS_NUMBER_ARG) or Query(HAS_STRING_ARG). std::string GetKnownArgAsString(const std::string& name) const; double GetKnownArgAsDouble(const std::string& name) const; int GetKnownArgAsInt(const std::string& name) const; bool GetKnownArgAsBool(const std::string& name) const; std::unique_ptr<base::Value> GetKnownArgAsValue( const std::string& name) const; // Process ID and Thread ID. ProcessThreadID thread; // Time since epoch in microseconds. // Stored as double to match its JSON representation. double timestamp; double duration; char phase; std::string category; std::string name; std::string id; double thread_duration = 0.0; double thread_timestamp = 0.0; std::string scope; std::string bind_id; bool flow_out = false; bool flow_in = false; std::string global_id2; std::string local_id2; // All numbers and bool values from TraceEvent args are cast to double. // bool becomes 1.0 (true) or 0.0 (false). std::map<std::string, double> arg_numbers; std::map<std::string, std::string> arg_strings; std::map<std::string, std::unique_ptr<base::Value>> arg_values; // The other event associated with this event (or NULL). const TraceEvent* other_event; // A back-link for |other_event|. That is, if other_event is not null, then // |event->other_event->prev_event == event| is always true. const TraceEvent* prev_event; }; typedef std::vector<const TraceEvent*> TraceEventVector; class Query { public: Query(const Query& query); ~Query(); //////////////////////////////////////////////////////////////// // Query literal values // Compare with the given string. static Query String(const std::string& str); // Compare with the given number. static Query Double(double num); static Query Int(int32_t num); static Query Uint(uint32_t num); // Compare with the given bool. static Query Bool(bool boolean); // Compare with the given phase. static Query Phase(char phase); // Compare with the given string pattern. Only works with == and != operators. // Example: Query(EVENT_NAME) == Query::Pattern("MyEvent*") static Query Pattern(const std::string& pattern); //////////////////////////////////////////////////////////////// // Query event members static Query EventPid() { return Query(EVENT_PID); } static Query EventTid() { return Query(EVENT_TID); } // Return the timestamp of the event in microseconds since epoch. static Query EventTime() { return Query(EVENT_TIME); } // Return the absolute time between event and other event in microseconds. // Only works if Query::EventHasOther() == true. static Query EventDuration() { return Query(EVENT_DURATION); } // Return the duration of a COMPLETE event. static Query EventCompleteDuration() { return Query(EVENT_COMPLETE_DURATION); } static Query EventPhase() { return Query(EVENT_PHASE); } static Query EventCategory() { return Query(EVENT_CATEGORY); } static Query EventName() { return Query(EVENT_NAME); } static Query EventId() { return Query(EVENT_ID); } static Query EventPidIs(int process_id) { return Query(EVENT_PID) == Query::Int(process_id); } static Query EventTidIs(int thread_id) { return Query(EVENT_TID) == Query::Int(thread_id); } static Query EventThreadIs(const TraceEvent::ProcessThreadID& thread) { return EventPidIs(thread.process_id) && EventTidIs(thread.thread_id); } static Query EventTimeIs(double timestamp) { return Query(EVENT_TIME) == Query::Double(timestamp); } static Query EventDurationIs(double duration) { return Query(EVENT_DURATION) == Query::Double(duration); } static Query EventPhaseIs(char phase) { return Query(EVENT_PHASE) == Query::Phase(phase); } static Query EventCategoryIs(const std::string& category) { return Query(EVENT_CATEGORY) == Query::String(category); } static Query EventNameIs(const std::string& name) { return Query(EVENT_NAME) == Query::String(name); } static Query EventIdIs(const std::string& id) { return Query(EVENT_ID) == Query::String(id); } // Evaluates to true if arg exists and is a string. static Query EventHasStringArg(const std::string& arg_name) { return Query(EVENT_HAS_STRING_ARG, arg_name); } // Evaluates to true if arg exists and is a number. // Number arguments include types double, int and bool. static Query EventHasNumberArg(const std::string& arg_name) { return Query(EVENT_HAS_NUMBER_ARG, arg_name); } // Evaluates to arg value (string or number). static Query EventArg(const std::string& arg_name) { return Query(EVENT_ARG, arg_name); } // Return true if associated event exists. static Query EventHasOther() { return Query(EVENT_HAS_OTHER); } // Access the associated other_event's members: static Query OtherPid() { return Query(OTHER_PID); } static Query OtherTid() { return Query(OTHER_TID); } static Query OtherTime() { return Query(OTHER_TIME); } static Query OtherPhase() { return Query(OTHER_PHASE); } static Query OtherCategory() { return Query(OTHER_CATEGORY); } static Query OtherName() { return Query(OTHER_NAME); } static Query OtherId() { return Query(OTHER_ID); } static Query OtherPidIs(int process_id) { return Query(OTHER_PID) == Query::Int(process_id); } static Query OtherTidIs(int thread_id) { return Query(OTHER_TID) == Query::Int(thread_id); } static Query OtherThreadIs(const TraceEvent::ProcessThreadID& thread) { return OtherPidIs(thread.process_id) && OtherTidIs(thread.thread_id); } static Query OtherTimeIs(double timestamp) { return Query(OTHER_TIME) == Query::Double(timestamp); } static Query OtherPhaseIs(char phase) { return Query(OTHER_PHASE) == Query::Phase(phase); } static Query OtherCategoryIs(const std::string& category) { return Query(OTHER_CATEGORY) == Query::String(category); } static Query OtherNameIs(const std::string& name) { return Query(OTHER_NAME) == Query::String(name); } static Query OtherIdIs(const std::string& id) { return Query(OTHER_ID) == Query::String(id); } // Evaluates to true if arg exists and is a string. static Query OtherHasStringArg(const std::string& arg_name) { return Query(OTHER_HAS_STRING_ARG, arg_name); } // Evaluates to true if arg exists and is a number. // Number arguments include types double, int and bool. static Query OtherHasNumberArg(const std::string& arg_name) { return Query(OTHER_HAS_NUMBER_ARG, arg_name); } // Evaluates to arg value (string or number). static Query OtherArg(const std::string& arg_name) { return Query(OTHER_ARG, arg_name); } // Access the associated prev_event's members: static Query PrevPid() { return Query(PREV_PID); } static Query PrevTid() { return Query(PREV_TID); } static Query PrevTime() { return Query(PREV_TIME); } static Query PrevPhase() { return Query(PREV_PHASE); } static Query PrevCategory() { return Query(PREV_CATEGORY); } static Query PrevName() { return Query(PREV_NAME); } static Query PrevId() { return Query(PREV_ID); } static Query PrevPidIs(int process_id) { return Query(PREV_PID) == Query::Int(process_id); } static Query PrevTidIs(int thread_id) { return Query(PREV_TID) == Query::Int(thread_id); } static Query PrevThreadIs(const TraceEvent::ProcessThreadID& thread) { return PrevPidIs(thread.process_id) && PrevTidIs(thread.thread_id); } static Query PrevTimeIs(double timestamp) { return Query(PREV_TIME) == Query::Double(timestamp); } static Query PrevPhaseIs(char phase) { return Query(PREV_PHASE) == Query::Phase(phase); } static Query PrevCategoryIs(const std::string& category) { return Query(PREV_CATEGORY) == Query::String(category); } static Query PrevNameIs(const std::string& name) { return Query(PREV_NAME) == Query::String(name); } static Query PrevIdIs(const std::string& id) { return Query(PREV_ID) == Query::String(id); } // Evaluates to true if arg exists and is a string. static Query PrevHasStringArg(const std::string& arg_name) { return Query(PREV_HAS_STRING_ARG, arg_name); } // Evaluates to true if arg exists and is a number. // Number arguments include types double, int and bool. static Query PrevHasNumberArg(const std::string& arg_name) { return Query(PREV_HAS_NUMBER_ARG, arg_name); } // Evaluates to arg value (string or number). static Query PrevArg(const std::string& arg_name) { return Query(PREV_ARG, arg_name); } //////////////////////////////////////////////////////////////// // Common queries: // Find BEGIN events that have a corresponding END event. static Query MatchBeginWithEnd() { return (Query(EVENT_PHASE) == Query::Phase(TRACE_EVENT_PHASE_BEGIN)) && Query(EVENT_HAS_OTHER); } // Find COMPLETE events. static Query MatchComplete() { return (Query(EVENT_PHASE) == Query::Phase(TRACE_EVENT_PHASE_COMPLETE)); } // Find ASYNC_BEGIN events that have a corresponding ASYNC_END event. static Query MatchAsyncBeginWithNext() { return (Query(EVENT_PHASE) == Query::Phase(TRACE_EVENT_PHASE_ASYNC_BEGIN)) && Query(EVENT_HAS_OTHER); } // Find BEGIN events of given |name| which also have associated END events. static Query MatchBeginName(const std::string& name) { return (Query(EVENT_NAME) == Query(name)) && MatchBeginWithEnd(); } // Find COMPLETE events of given |name|. static Query MatchCompleteName(const std::string& name) { return (Query(EVENT_NAME) == Query(name)) && MatchComplete(); } // Match given Process ID and Thread ID. static Query MatchThread(const TraceEvent::ProcessThreadID& thread) { return (Query(EVENT_PID) == Query::Int(thread.process_id)) && (Query(EVENT_TID) == Query::Int(thread.thread_id)); } // Match event pair that spans multiple threads. static Query MatchCrossThread() { return (Query(EVENT_PID) != Query(OTHER_PID)) || (Query(EVENT_TID) != Query(OTHER_TID)); } //////////////////////////////////////////////////////////////// // Operators: // Boolean operators: Query operator==(const Query& rhs) const; Query operator!=(const Query& rhs) const; Query operator< (const Query& rhs) const; Query operator<=(const Query& rhs) const; Query operator> (const Query& rhs) const; Query operator>=(const Query& rhs) const; Query operator&&(const Query& rhs) const; Query operator||(const Query& rhs) const; Query operator!() const; // Arithmetic operators: // Following operators are applied to double arguments: Query operator+(const Query& rhs) const; Query operator-(const Query& rhs) const; Query operator*(const Query& rhs) const; Query operator/(const Query& rhs) const; Query operator-() const; // Mod operates on int64_t args (doubles are casted to int64_t beforehand): Query operator%(const Query& rhs) const; // Return true if the given event matches this query tree. // This is a recursive method that walks the query tree. bool Evaluate(const TraceEvent& event) const; enum TraceEventMember { EVENT_INVALID, EVENT_PID, EVENT_TID, EVENT_TIME, EVENT_DURATION, EVENT_COMPLETE_DURATION, EVENT_PHASE, EVENT_CATEGORY, EVENT_NAME, EVENT_ID, EVENT_HAS_STRING_ARG, EVENT_HAS_NUMBER_ARG, EVENT_ARG, EVENT_HAS_OTHER, EVENT_HAS_PREV, OTHER_PID, OTHER_TID, OTHER_TIME, OTHER_PHASE, OTHER_CATEGORY, OTHER_NAME, OTHER_ID, OTHER_HAS_STRING_ARG, OTHER_HAS_NUMBER_ARG, OTHER_ARG, PREV_PID, PREV_TID, PREV_TIME, PREV_PHASE, PREV_CATEGORY, PREV_NAME, PREV_ID, PREV_HAS_STRING_ARG, PREV_HAS_NUMBER_ARG, PREV_ARG, OTHER_FIRST_MEMBER = OTHER_PID, OTHER_LAST_MEMBER = OTHER_ARG, PREV_FIRST_MEMBER = PREV_PID, PREV_LAST_MEMBER = PREV_ARG, }; enum Operator { OP_INVALID, // Boolean operators: OP_EQ, OP_NE, OP_LT, OP_LE, OP_GT, OP_GE, OP_AND, OP_OR, OP_NOT, // Arithmetic operators: OP_ADD, OP_SUB, OP_MUL, OP_DIV, OP_MOD, OP_NEGATE }; enum QueryType { QUERY_BOOLEAN_OPERATOR, QUERY_ARITHMETIC_OPERATOR, QUERY_EVENT_MEMBER, QUERY_NUMBER, QUERY_STRING }; // Compare with the given member. explicit Query(TraceEventMember member); // Compare with the given member argument value. Query(TraceEventMember member, const std::string& arg_name); // Compare with the given string. explicit Query(const std::string& str); // Compare with the given number. explicit Query(double num); // Construct a boolean Query that returns (left <binary_op> right). Query(const Query& left, const Query& right, Operator binary_op); // Construct a boolean Query that returns (<binary_op> left). Query(const Query& left, Operator unary_op); // Try to compare left_ against right_ based on operator_. // If either left or right does not convert to double, false is returned. // Otherwise, true is returned and |result| is set to the comparison result. bool CompareAsDouble(const TraceEvent& event, bool* result) const; // Try to compare left_ against right_ based on operator_. // If either left or right does not convert to string, false is returned. // Otherwise, true is returned and |result| is set to the comparison result. bool CompareAsString(const TraceEvent& event, bool* result) const; // Attempt to convert this Query to a double. On success, true is returned // and the double value is stored in |num|. bool GetAsDouble(const TraceEvent& event, double* num) const; // Attempt to convert this Query to a string. On success, true is returned // and the string value is stored in |str|. bool GetAsString(const TraceEvent& event, std::string* str) const; // Evaluate this Query as an arithmetic operator on left_ and right_. bool EvaluateArithmeticOperator(const TraceEvent& event, double* num) const; // For QUERY_EVENT_MEMBER Query: attempt to get the double value of the Query. bool GetMemberValueAsDouble(const TraceEvent& event, double* num) const; // For QUERY_EVENT_MEMBER Query: attempt to get the string value of the Query. bool GetMemberValueAsString(const TraceEvent& event, std::string* num) const; // Does this Query represent a value? bool is_value() const { return type_ != QUERY_BOOLEAN_OPERATOR; } bool is_unary_operator() const { return operator_ == OP_NOT || operator_ == OP_NEGATE; } bool is_comparison_operator() const { return operator_ != OP_INVALID && operator_ < OP_AND; } static const TraceEvent* SelectTargetEvent(const TraceEvent* ev, TraceEventMember member); const Query& left() const; const Query& right() const; private: QueryType type_; Operator operator_; scoped_refptr<QueryNode> left_; scoped_refptr<QueryNode> right_; TraceEventMember member_; double number_; std::string string_; bool is_pattern_; }; // Implementation detail: // QueryNode allows Query to store a ref-counted query tree. class QueryNode : public base::RefCounted<QueryNode> { public: explicit QueryNode(const Query& query); const Query& query() const { return query_; } private: friend class base::RefCounted<QueryNode>; ~QueryNode(); Query query_; }; // TraceAnalyzer helps tests search for trace events. class TraceAnalyzer { public: ~TraceAnalyzer(); // Use trace events from JSON string generated by tracing API. // Returns non-NULL if the JSON is successfully parsed. static TraceAnalyzer* Create(const std::string& json_events) WARN_UNUSED_RESULT; void SetIgnoreMetadataEvents(bool ignore) { ignore_metadata_events_ = ignore; } // Associate BEGIN and END events with each other. This allows Query(OTHER_*) // to access the associated event and enables Query(EVENT_DURATION). // An end event will match the most recent begin event with the same name, // category, process ID and thread ID. This matches what is shown in // about:tracing. After association, the BEGIN event will point to the // matching END event, but the END event will not point to the BEGIN event. void AssociateBeginEndEvents(); // Associate ASYNC_BEGIN, ASYNC_STEP and ASYNC_END events with each other. // An ASYNC_END event will match the most recent ASYNC_BEGIN or ASYNC_STEP // event with the same name, category, and ID. This creates a singly linked // list of ASYNC_BEGIN->ASYNC_STEP...->ASYNC_END. // |match_pid| - If true, will only match async events which are running // under the same process ID, otherwise will allow linking // async events from different processes. void AssociateAsyncBeginEndEvents(bool match_pid = true); // AssociateEvents can be used to customize event associations by setting the // other_event member of TraceEvent. This should be used to associate two // INSTANT events. // // The assumptions are: // - |first| events occur before |second| events. // - the closest matching |second| event is the correct match. // // |first| - Eligible |first| events match this query. // |second| - Eligible |second| events match this query. // |match| - This query is run on the |first| event. The OTHER_* EventMember // queries will point to an eligible |second| event. The query // should evaluate to true if the |first|/|second| pair is a match. // // When a match is found, the pair will be associated by having the first // event's other_event member point to the other. AssociateEvents does not // clear previous associations, so it is possible to associate multiple pairs // of events by calling AssociateEvents more than once with different queries. // // NOTE: AssociateEvents will overwrite existing other_event associations if // the queries pass for events that already had a previous association. // // After calling any Find* method, it is not allowed to call AssociateEvents // again. void AssociateEvents(const Query& first, const Query& second, const Query& match); // For each event, copy its arguments to the other_event argument map. If // argument name already exists, it will not be overwritten. void MergeAssociatedEventArgs(); // Find all events that match query and replace output vector. size_t FindEvents(const Query& query, TraceEventVector* output); // Find first event that matches query or NULL if not found. const TraceEvent* FindFirstOf(const Query& query); // Find last event that matches query or NULL if not found. const TraceEvent* FindLastOf(const Query& query); const std::string& GetThreadName(const TraceEvent::ProcessThreadID& thread); private: TraceAnalyzer(); bool SetEvents(const std::string& json_events) WARN_UNUSED_RESULT; // Read metadata (thread names, etc) from events. void ParseMetadata(); std::map<TraceEvent::ProcessThreadID, std::string> thread_names_; std::vector<TraceEvent> raw_events_; bool ignore_metadata_events_; bool allow_association_changes_; DISALLOW_COPY_AND_ASSIGN(TraceAnalyzer); }; // Utility functions for collecting process-local traces and creating a // |TraceAnalyzer| from the result. Please see comments in trace_config.h to // understand how the |category_filter_string| works. Use "*" to enable all // default categories. void Start(const std::string& category_filter_string); std::unique_ptr<TraceAnalyzer> Stop(); // Utility functions for TraceEventVector. struct RateStats { double min_us; double max_us; double mean_us; double standard_deviation_us; }; struct RateStatsOptions { RateStatsOptions() : trim_min(0u), trim_max(0u) {} // After the times between events are sorted, the number of specified elements // will be trimmed before calculating the RateStats. This is useful in cases // where extreme outliers are tolerable and should not skew the overall // average. size_t trim_min; // Trim this many minimum times. size_t trim_max; // Trim this many maximum times. }; // Calculate min/max/mean and standard deviation from the times between // adjacent events. bool GetRateStats(const TraceEventVector& events, RateStats* stats, const RateStatsOptions* options); // Starting from |position|, find the first event that matches |query|. // Returns true if found, false otherwise. bool FindFirstOf(const TraceEventVector& events, const Query& query, size_t position, size_t* return_index); // Starting from |position|, find the last event that matches |query|. // Returns true if found, false otherwise. bool FindLastOf(const TraceEventVector& events, const Query& query, size_t position, size_t* return_index); // Find the closest events to |position| in time that match |query|. // return_second_closest may be NULL. Closeness is determined by comparing // with the event timestamp. // Returns true if found, false otherwise. If both return parameters are // requested, both must be found for a successful result. bool FindClosest(const TraceEventVector& events, const Query& query, size_t position, size_t* return_closest, size_t* return_second_closest); // Count matches, inclusive of |begin_position|, exclusive of |end_position|. size_t CountMatches(const TraceEventVector& events, const Query& query, size_t begin_position, size_t end_position); // Count all matches. static inline size_t CountMatches(const TraceEventVector& events, const Query& query) { return CountMatches(events, query, 0u, events.size()); } } // namespace trace_analyzer #endif // BASE_TEST_TRACE_EVENT_ANALYZER_H_
{ "pile_set_name": "Github" }
// Copyright © 2008-2020 Pioneer Developers. See AUTHORS.txt for details // Licensed under the terms of the GPL v3. See licenses/GPL-3.txt #include "Light.h" namespace Graphics { Light::Light() : m_type(LIGHT_POINT), m_position(0.f), m_diffuse(Color::WHITE), m_specular(Color::BLANK) { } Light::Light(LightType t, const vector3f &p, const Color &d, const Color &s) : m_type(t), m_position(p), m_diffuse(d), m_specular(s) { } } // namespace Graphics
{ "pile_set_name": "Github" }
require 'test_helper' require "generators/push_type/node/node_generator" module PushType class NodeGeneratorTest < Rails::Generators::TestCase tests NodeGenerator destination Rails.root.join('tmp/generators') before :all do prepare_destination run_generator ['home_page', 'foo', 'bar:text'] end it { assert_file 'app/models/home_page.rb', %r{class HomePage < PushType::Node} } it { assert_file 'app/models/home_page.rb', %r{field :foo, :string} } it { assert_file 'app/models/home_page.rb', %r{field :bar, :text} } it { assert_file 'app/views/nodes/home_page.html.erb', %r{<h1><%= @node.title %></h1>} } it { assert_file 'app/views/nodes/home_page.html.erb', %r{<div>Foo:</div>} } it { assert_file 'app/views/nodes/home_page.html.erb', %r{<div><%= @node.foo %></div>} } end end
{ "pile_set_name": "Github" }
.TH std::ignore 3 "2019.08.27" "http://cppreference.com" "C++ Standard Libary" .SH NAME std::ignore \- std::ignore .SH Synopsis Defined in header <tuple> const /*unspecified*/ ignore; \fI(since C++11)\fP \fI(until C++17)\fP inline constexpr /*unspecified*/ ignore; \fI(since C++17)\fP An object of unspecified type such that any value can be assigned to it with no effect. Intended for use with std::tie when unpacking a std::tuple, as a placeholder for the arguments that are not used. .SH Example unpack a pair returned by set.insert(), but only save the boolean. // Run this code #include <iostream> #include <string> #include <set> #include <tuple> int main() { std::set<std::string> set_of_str; bool inserted = false; std::tie(std::ignore, inserted) = set_of_str.insert("Test"); if (inserted) { std::cout << "Value was inserted successfully\\n"; } } .SH Output: Value was inserted successfully .SH See also tie creates a tuple of lvalue references or unpacks a tuple into individual objects \fI(function template)\fP
{ "pile_set_name": "Github" }
/*************************************************************************** * _ _ ____ _ * Project ___| | | | _ \| | * / __| | | | |_) | | * | (__| |_| | _ <| |___ * \___|\___/|_| \_\_____| * * Copyright (C) 1998 - 2015, Daniel Stenberg, <[email protected]>, et al. * * This software is licensed as described in the file COPYING, which * you should have received as part of this distribution. The terms * are also available at https://curl.haxx.se/docs/copyright.html. * * You may opt to use, copy, modify, merge, publish, distribute and/or sell * copies of the Software, and permit persons to whom the Software is * furnished to do so, under the terms of the COPYING file. * * This software is distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY * KIND, either express or implied. * ***************************************************************************/ #include "tool_setup.h" #include "rawstr.h" #define ENABLE_CURLX_PRINTF /* use our own printf() functions */ #include "curlx.h" #include "tool_cfgable.h" #include "tool_getparam.h" #include "tool_getpass.h" #include "tool_homedir.h" #include "tool_msgs.h" #include "tool_paramhlp.h" #include "tool_version.h" #include "memdebug.h" /* keep this as LAST include */ struct getout *new_getout(struct OperationConfig *config) { struct getout *node = calloc(1, sizeof(struct getout)); struct getout *last = config->url_last; if(node) { /* append this new node last in the list */ if(last) last->next = node; else config->url_list = node; /* first node */ /* move the last pointer */ config->url_last = node; node->flags = config->default_node_flags; } return node; } ParameterError file2string(char **bufp, FILE *file) { char buffer[256]; char *ptr; char *string = NULL; size_t stringlen = 0; size_t buflen; if(file) { while(fgets(buffer, sizeof(buffer), file)) { if((ptr = strchr(buffer, '\r')) != NULL) *ptr = '\0'; if((ptr = strchr(buffer, '\n')) != NULL) *ptr = '\0'; buflen = strlen(buffer); if((ptr = realloc(string, stringlen+buflen+1)) == NULL) { Curl_safefree(string); return PARAM_NO_MEM; } string = ptr; strcpy(string+stringlen, buffer); stringlen += buflen; } } *bufp = string; return PARAM_OK; } ParameterError file2memory(char **bufp, size_t *size, FILE *file) { char *newbuf; char *buffer = NULL; size_t alloc = 512; size_t nused = 0; size_t nread; if(file) { do { if(!buffer || (alloc == nused)) { /* size_t overflow detection for huge files */ if(alloc+1 > ((size_t)-1)/2) { Curl_safefree(buffer); return PARAM_NO_MEM; } alloc *= 2; /* allocate an extra char, reserved space, for null termination */ if((newbuf = realloc(buffer, alloc+1)) == NULL) { Curl_safefree(buffer); return PARAM_NO_MEM; } buffer = newbuf; } nread = fread(buffer+nused, 1, alloc-nused, file); nused += nread; } while(nread); /* null terminate the buffer in case it's used as a string later */ buffer[nused] = '\0'; /* free trailing slack space, if possible */ if(alloc != nused) { if((newbuf = realloc(buffer, nused+1)) == NULL) { Curl_safefree(buffer); return PARAM_NO_MEM; } buffer = newbuf; } /* discard buffer if nothing was read */ if(!nused) { Curl_safefree(buffer); /* no string */ } } *size = nused; *bufp = buffer; return PARAM_OK; } void cleanarg(char *str) { #ifdef HAVE_WRITABLE_ARGV /* now that GetStr has copied the contents of nextarg, wipe the next * argument out so that the username:password isn't displayed in the * system process list */ if(str) { size_t len = strlen(str); memset(str, ' ', len); } #else (void)str; #endif } /* * Parse the string and write the long in the given address. Return PARAM_OK * on success, otherwise a parameter specific error enum. * * Since this function gets called with the 'nextarg' pointer from within the * getparameter a lot, we must check it for NULL before accessing the str * data. */ ParameterError str2num(long *val, const char *str) { if(str) { char *endptr; long num = strtol(str, &endptr, 10); if((endptr != str) && (endptr == str + strlen(str))) { *val = num; return PARAM_OK; /* Ok */ } } return PARAM_BAD_NUMERIC; /* badness */ } /* * Parse the string and write the long in the given address. Return PARAM_OK * on success, otherwise a parameter error enum. ONLY ACCEPTS POSITIVE NUMBERS! * * Since this function gets called with the 'nextarg' pointer from within the * getparameter a lot, we must check it for NULL before accessing the str * data. */ ParameterError str2unum(long *val, const char *str) { ParameterError result = str2num(val, str); if(result != PARAM_OK) return result; if(*val < 0) return PARAM_NEGATIVE_NUMERIC; return PARAM_OK; } /* * Parse the string and write the double in the given address. Return PARAM_OK * on success, otherwise a parameter specific error enum. * * Since this function gets called with the 'nextarg' pointer from within the * getparameter a lot, we must check it for NULL before accessing the str * data. */ ParameterError str2double(double *val, const char *str) { if(str) { char *endptr; double num = strtod(str, &endptr); if((endptr != str) && (endptr == str + strlen(str))) { *val = num; return PARAM_OK; /* Ok */ } } return PARAM_BAD_NUMERIC; /* badness */ } /* * Parse the string and write the double in the given address. Return PARAM_OK * on success, otherwise a parameter error enum. ONLY ACCEPTS POSITIVE NUMBERS! * * Since this function gets called with the 'nextarg' pointer from within the * getparameter a lot, we must check it for NULL before accessing the str * data. */ ParameterError str2udouble(double *val, const char *str) { ParameterError result = str2double(val, str); if(result != PARAM_OK) return result; if(*val < 0) return PARAM_NEGATIVE_NUMERIC; return PARAM_OK; } /* * Parse the string and modify the long in the given address. Return * non-zero on failure, zero on success. * * The string is a list of protocols * * Since this function gets called with the 'nextarg' pointer from within the * getparameter a lot, we must check it for NULL before accessing the str * data. */ long proto2num(struct OperationConfig *config, long *val, const char *str) { char *buffer; const char *sep = ","; char *token; static struct sprotos { const char *name; long bit; } const protos[] = { { "all", CURLPROTO_ALL }, { "http", CURLPROTO_HTTP }, { "https", CURLPROTO_HTTPS }, { "ftp", CURLPROTO_FTP }, { "ftps", CURLPROTO_FTPS }, { "scp", CURLPROTO_SCP }, { "sftp", CURLPROTO_SFTP }, { "telnet", CURLPROTO_TELNET }, { "ldap", CURLPROTO_LDAP }, { "ldaps", CURLPROTO_LDAPS }, { "dict", CURLPROTO_DICT }, { "file", CURLPROTO_FILE }, { "tftp", CURLPROTO_TFTP }, { "imap", CURLPROTO_IMAP }, { "imaps", CURLPROTO_IMAPS }, { "pop3", CURLPROTO_POP3 }, { "pop3s", CURLPROTO_POP3S }, { "smtp", CURLPROTO_SMTP }, { "smtps", CURLPROTO_SMTPS }, { "rtsp", CURLPROTO_RTSP }, { "gopher", CURLPROTO_GOPHER }, { "smb", CURLPROTO_SMB }, { "smbs", CURLPROTO_SMBS }, { NULL, 0 } }; if(!str) return 1; buffer = strdup(str); /* because strtok corrupts it */ if(!buffer) return 1; for(token = strtok(buffer, sep); token; token = strtok(NULL, sep)) { enum e_action { allow, deny, set } action = allow; struct sprotos const *pp; /* Process token modifiers */ while(!ISALNUM(*token)) { /* may be NULL if token is all modifiers */ switch (*token++) { case '=': action = set; break; case '-': action = deny; break; case '+': action = allow; break; default: /* Includes case of terminating NULL */ Curl_safefree(buffer); return 1; } } for(pp=protos; pp->name; pp++) { if(curlx_raw_equal(token, pp->name)) { switch (action) { case deny: *val &= ~(pp->bit); break; case allow: *val |= pp->bit; break; case set: *val = pp->bit; break; } break; } } if(!(pp->name)) { /* unknown protocol */ /* If they have specified only this protocol, we say treat it as if no protocols are allowed */ if(action == set) *val = 0; warnf(config->global, "unrecognized protocol '%s'\n", token); } } Curl_safefree(buffer); return 0; } /** * Check if the given string is a protocol supported by libcurl * * @param str the protocol name * @return PARAM_OK protocol supported * @return PARAM_LIBCURL_UNSUPPORTED_PROTOCOL protocol not supported * @return PARAM_REQUIRES_PARAMETER missing parameter */ int check_protocol(const char *str) { const char * const *pp; const curl_version_info_data *curlinfo = curl_version_info(CURLVERSION_NOW); if(!str) return PARAM_REQUIRES_PARAMETER; for(pp = curlinfo->protocols; *pp; pp++) { if(curlx_raw_equal(*pp, str)) return PARAM_OK; } return PARAM_LIBCURL_UNSUPPORTED_PROTOCOL; } /** * Parses the given string looking for an offset (which may be a * larger-than-integer value). The offset CANNOT be negative! * * @param val the offset to populate * @param str the buffer containing the offset * @return PARAM_OK if successful, a parameter specific error enum if failure. */ ParameterError str2offset(curl_off_t *val, const char *str) { char *endptr; if(str[0] == '-') /* offsets aren't negative, this indicates weird input */ return PARAM_NEGATIVE_NUMERIC; #if(CURL_SIZEOF_CURL_OFF_T > CURL_SIZEOF_LONG) *val = curlx_strtoofft(str, &endptr, 0); if((*val == CURL_OFF_T_MAX || *val == CURL_OFF_T_MIN) && (ERRNO == ERANGE)) return PARAM_BAD_NUMERIC; #else *val = strtol(str, &endptr, 0); if((*val == LONG_MIN || *val == LONG_MAX) && ERRNO == ERANGE) return PARAM_BAD_NUMERIC; #endif if((endptr != str) && (endptr == str + strlen(str))) return PARAM_OK; return PARAM_BAD_NUMERIC; } static CURLcode checkpasswd(const char *kind, /* for what purpose */ const size_t i, /* operation index */ const bool last, /* TRUE if last operation */ char **userpwd) /* pointer to allocated string */ { char *psep; char *osep; if(!*userpwd) return CURLE_OK; /* Attempt to find the password separator */ psep = strchr(*userpwd, ':'); /* Attempt to find the options separator */ osep = strchr(*userpwd, ';'); if(!psep && **userpwd != ';') { /* no password present, prompt for one */ char passwd[256] = ""; char prompt[256]; size_t passwdlen; size_t userlen = strlen(*userpwd); char *passptr; if(osep) *osep = '\0'; /* build a nice-looking prompt */ if(!i && last) curlx_msnprintf(prompt, sizeof(prompt), "Enter %s password for user '%s':", kind, *userpwd); else curlx_msnprintf(prompt, sizeof(prompt), "Enter %s password for user '%s' on URL #%" CURL_FORMAT_CURL_OFF_TU ":", kind, *userpwd, (curl_off_t) (i + 1)); /* get password */ getpass_r(prompt, passwd, sizeof(passwd)); passwdlen = strlen(passwd); if(osep) *osep = ';'; /* extend the allocated memory area to fit the password too */ passptr = realloc(*userpwd, passwdlen + 1 + /* an extra for the colon */ userlen + 1); /* an extra for the zero */ if(!passptr) return CURLE_OUT_OF_MEMORY; /* append the password separated with a colon */ passptr[userlen] = ':'; memcpy(&passptr[userlen+1], passwd, passwdlen+1); *userpwd = passptr; } return CURLE_OK; } ParameterError add2list(struct curl_slist **list, const char *ptr) { struct curl_slist *newlist = curl_slist_append(*list, ptr); if(newlist) *list = newlist; else return PARAM_NO_MEM; return PARAM_OK; } int ftpfilemethod(struct OperationConfig *config, const char *str) { if(curlx_raw_equal("singlecwd", str)) return CURLFTPMETHOD_SINGLECWD; if(curlx_raw_equal("nocwd", str)) return CURLFTPMETHOD_NOCWD; if(curlx_raw_equal("multicwd", str)) return CURLFTPMETHOD_MULTICWD; warnf(config->global, "unrecognized ftp file method '%s', using default\n", str); return CURLFTPMETHOD_MULTICWD; } int ftpcccmethod(struct OperationConfig *config, const char *str) { if(curlx_raw_equal("passive", str)) return CURLFTPSSL_CCC_PASSIVE; if(curlx_raw_equal("active", str)) return CURLFTPSSL_CCC_ACTIVE; warnf(config->global, "unrecognized ftp CCC method '%s', using default\n", str); return CURLFTPSSL_CCC_PASSIVE; } long delegation(struct OperationConfig *config, char *str) { if(curlx_raw_equal("none", str)) return CURLGSSAPI_DELEGATION_NONE; if(curlx_raw_equal("policy", str)) return CURLGSSAPI_DELEGATION_POLICY_FLAG; if(curlx_raw_equal("always", str)) return CURLGSSAPI_DELEGATION_FLAG; warnf(config->global, "unrecognized delegation method '%s', using none\n", str); return CURLGSSAPI_DELEGATION_NONE; } /* * my_useragent: returns allocated string with default user agent */ static char *my_useragent(void) { return strdup(CURL_NAME "/" CURL_VERSION); } CURLcode get_args(struct OperationConfig *config, const size_t i) { CURLcode result = CURLE_OK; bool last = (config->next ? FALSE : TRUE); /* Check we have a password for the given host user */ if(config->userpwd && !config->oauth_bearer) { result = checkpasswd("host", i, last, &config->userpwd); if(result) return result; } /* Check we have a password for the given proxy user */ if(config->proxyuserpwd) { result = checkpasswd("proxy", i, last, &config->proxyuserpwd); if(result) return result; } /* Check we have a user agent */ if(!config->useragent) { config->useragent = my_useragent(); if(!config->useragent) { helpf(config->global->errors, "out of memory\n"); result = CURLE_OUT_OF_MEMORY; } } return result; }
{ "pile_set_name": "Github" }
var tagDefFactory = require('./param'); describe('param tagDef', function() { it("should add the injected transforms to the transforms property", function() { var extractNameTransform = function() {}; var extractTypeTransform = function() {}; var wholeTagTransform = function() {}; var tagDef = tagDefFactory(extractTypeTransform, extractNameTransform, wholeTagTransform); expect(tagDef.transforms).toEqual([extractTypeTransform, extractNameTransform, wholeTagTransform]); }); });
{ "pile_set_name": "Github" }
boost
{ "pile_set_name": "Github" }
owner = TUR controller = TUR add_core = TUR infra = 4 infra = 4 infra = 4
{ "pile_set_name": "Github" }
;;; foldout.el --- folding extensions for outline-mode and outline-minor-mode ;; Copyright (C) 1994, 2001-2020 Free Software Foundation, Inc. ;; Author: Kevin Broadey <[email protected]> ;; Maintainer: [email protected] ;; Created: 27 Jan 1994 ;; Version: 1.10 ;; Keywords: folding, outlines ;; This file is part of GNU Emacs. ;; GNU Emacs 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. ;; GNU Emacs 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 GNU Emacs. If not, see <https://www.gnu.org/licenses/>. ;;; Commentary: ;; This file provides folding editor extensions for outline-mode and ;; outline-minor-mode buffers. What's a "folding editor"? Read on... ;; ;; Imagine you're in an outline-mode buffer and you've hidden all the text and ;; subheadings under your level-1 headings. You now want to look at the stuff ;; hidden under one of these headings. Normally you'd do C-c C-e (show-entry) ;; to expose the body or C-c C-i to expose the child (level-2) headings. ;; ;; With foldout, you do C-c C-z (foldout-zoom-subtree). This exposes the body ;; and child subheadings and narrows the buffer so that only the level-1 ;; heading, the body and the level-2 headings are visible. If you now want to ;; look under one of the level-2 headings, position the cursor on it and do C-c ;; C-z again. This exposes the level-2 body and its level-3 child subheadings ;; and narrows the buffer again. You can keep on zooming in on successive ;; subheadings as much as you like. A string in the mode line tells you how ;; deep you've gone. ;; ;; When zooming in on a heading you might only want to see the child ;; subheadings. You do this by specifying a numeric argument: C-u C-c C-z. ;; You can specify the number of levels of children too (c.f. show-children): ;; e.g. M-2 C-c C-z exposes two levels of child subheadings. Alternatively, ;; you might only be interested in the body. You do this by specifying a ;; negative argument: M-- C-c C-z. You can also cause the whole subtree to be ;; expanded, similar to C-c C-s (show-subtree), by specifying a zero argument: ;; M-0 C-c C-z. ;; ;; While you're zoomed in you can still use outline-mode's exposure and hiding ;; functions. It won't upset foldout at all. Also, since the buffer is ;; narrowed, "global" editing actions will only affect the stuff under the ;; zoomed-in heading. This is useful for restricting changes to a particular ;; chapter or section of your document. ;; ;; You unzoom (exit) a fold by doing C-c C-x (foldout-exit-fold). This hides ;; all the text and subheadings under the top-level heading and returns you to ;; the previous view of the buffer. Specifying a numeric argument exits that ;; many folds. Specifying a zero argument exits *all* folds. ;; ;; You might want to exit a fold *without* hiding the text and subheadings. ;; You do this by specifying a negative argument. For example, M--2 C-c C-x ;; exits two folds and leaves the text and subheadings exposed. ;; ;; Foldout also provides mouse bindings for entering and exiting folds and for ;; showing and hiding text. Hold down Meta and Control, then click a mouse ;; button as follows:- ;; ;; mouse-1 (foldout-mouse-zoom) zooms in on the heading clicked on:- ;; ;; single click expose body ;; double click expose subheadings ;; triple click expose body and subheadings ;; quad click expose entire subtree ;; ;; mouse-2 (foldout-mouse-show) exposes text under the heading clicked on:- ;; ;; single click expose body ;; double click expose subheadings ;; triple click expose body and subheadings ;; quad click expose entire subtree ;; ;; mouse-3 (foldout-mouse-hide-or-exit) hides text under the heading clicked ;; on or exits the fold:- ;; ;; single click hide subtree ;; double click exit fold and hide text ;; triple click exit fold without hiding text ;; quad click exit all folds and hide text ;; ;; You can change the modifier keys used by setting `foldout-mouse-modifiers'. ;;; Installation: ;; To use foldout, put this in your .emacs:- ;; ;; (require 'foldout) ;; ;; If you don't want it loaded until you need it, try this instead:- ;; ;; (eval-after-load "outline" '(require 'foldout)) ;;; Advertisements: ;; Get out-xtra.el by Per Abrahamsen <[email protected]> for more ;; outline-mode goodies. In particular, `outline-hide-sublevels' makes ;; setup a lot easier. ;; ;; folding.el by Jamie Lokier <[email protected]> supports folding by ;; recognizing special marker text in you file. ;; ;; c-outline.el (by me) provides outline-mode support to recognize `C' ;; statements as outline headings, so with foldout you can have a folding `C' ;; code editor without having to put in start- and end-of-fold markers. This ;; is a real winner! ;;; ChangeLog: ;; 1.10 21-Mar-94 ;; foldout.el is now part of the GNU Emacs distribution!! ;; Put in changes made by RMS to version 1.8 to keep the diffs to a minimum. ;; bugfix: numeric arg to foldout-exit-fold wasn't working - looks like I don't ;; know how to use the Common LISP `loop' macro after all, so use `while' ;; instead. ;; 1.9 15-Mar-94 ;; Didn't test that very well, did I? The change to foldout-zoom-subtree ;; affected foldout-mouse-zoom: if the heading under the `level n' one clicked ;; on was at `level n+2' then it didn't get exposed. Sorry about that! ;; 1.8 15-Mar-94 ;; Changed meaning of prefix arg to foldout-zoom-subtree. arg > 0 now means ;; "expose that many children" instead of just "expose children" so it is more ;; like `show-children' (C-c C-i). Arg of C-u on its own only shows one level ;; of children, though, so you can still zoom by doing C-u C-c C-z. ;; ;; I can't think of a good meaning for the value of a negative prefix. Any ;; suggestions? ;; ;; Added advertisement for my c-outline.el package. Now you can have a folding ;; editor for c-mode without any effort! ;; 1.7 7-Mar-94 ;; I got fed up trying to work out how many blank lines there were outside the ;; narrowed region when inside a fold. Now *all* newlines before the following ;; heading are *in* the narrowed region. Thus, if the cursor is at point-max, ;; the number of blank lines above it is the number you'll get above the next ;; heading. ;; ;; Since all newlines are now inside the narrowed region, when exiting a fold ;; add a newline at the end of the region if there isn't one so that the ;; following heading doesn't accidentally get joined to the body text. ;; ;; Bugfix: `foldout-mouse-modifiers' should be `defvar', not `defconst'. ;; ;; Use "cond" instead of "case" so that lemacs-19.9 users can use the mouse. ;; ;; Improve "Commentary" entry on using the mouse. ;; ;; Add "Installation" keyword. ;; 1.6 3-Mar-94 ;; Add mouse support functions foldout-mouse-zoom, foldout-mouse-show, ;; foldout-mouse-hide-or-exit. ;; 1.5 11-Feb-94 ;; Rename `foldout-enter-subtree' to `foldout-zoom-subtree' and change ;; keystroke from C-g to C-z. This is more mnemonic and leaves C-g alone, as ;; users expect this to cancel the current key sequence. ;; ;; Added better commentary at the request of RMS. Added stuff to comply with ;; the lisp-mnt.el conventions. Added instructions on how best to load the ;; package. ;; 1.4 2-Feb-94 ;; Bugfix: end-of-fold marking was wrong:- ;; ;; End of narrowed region should be one character on from ;; (outline-end-of-subtree) so it includes the end-of-line at the end of the ;; last line of the subtree. ;; ;; End-of-fold marker should be outside the narrowed region so text inserted ;; at the end of the region goes before the marker. Need to make a special ;; case for end-of-buffer because it is impossible to set a marker that will ;; follow eob. Bummer. ;; 1.3 28-Jan-94 ;; Changed `foldout-zoom-subtree'. A zero arg now makes it expose the entire ;; subtree on entering the fold. As before, < 0 shows only the body and > 0 ;; shows only the subheadings. ;; 1.2 28-Jan-94 ;; Fixed a dumb bug - didn't make `foldout-mode-line-string' buffer-local :-( ;; ;; Changed `foldout-exit-fold' to use prefix arg to say how many folds to exit. ;; Negative arg means exit but don't hide text. Zero arg means exit all folds. ;; ;; Added `foldout-inhibit-key-bindings' to inhibit key bindings. ;; 1.1 27-Jan-94 ;; Released to the net. Inspired by a question in gnu.emacs.help from ;; Jason D Lohn <[email protected]>. ;;; Code: (require 'outline) (defvar foldout-fold-list nil "List of start and end markers for the folds currently entered. An end marker of nil means the fold ends after (point-max).") (make-variable-buffer-local 'foldout-fold-list) (defvar foldout-mode-line-string nil "Mode line string announcing that we are in an outline fold.") (make-variable-buffer-local 'foldout-mode-line-string) ;; put our minor mode string immediately following outline-minor-mode's (or (assq 'foldout-mode-line-string minor-mode-alist) (let ((outl-entry (memq (assq 'outline-minor-mode minor-mode-alist) minor-mode-alist)) (foldout-entry '((foldout-mode-line-string foldout-mode-line-string)))) ;; something's wrong with outline if we can't find it (if (null outl-entry) (error "Can't find outline-minor-mode in minor-mode-alist")) ;; slip our fold announcement into the list (setcdr outl-entry (nconc foldout-entry (cdr outl-entry))) )) ;; outline-flag-region has different `flag' values in outline.el and ;; noutline.el for hiding and showing text. (defconst foldout-hide-flag (if (featurep 'noutline) t ?\^M)) (defconst foldout-show-flag (if (featurep 'noutline) nil ?\n)) (defun foldout-zoom-subtree (&optional exposure) "Open the subtree under the current heading and narrow to it. Normally the body and the immediate subheadings are exposed, but optional arg EXPOSURE \(interactively with prefix arg) changes this:- EXPOSURE > 0 exposes n levels of subheadings (c.f. show-children) EXPOSURE < 0 exposes only the body EXPOSURE = 0 exposes the entire subtree" (interactive "P") (save-excursion (widen) (outline-back-to-heading) (let* ((exposure-value (prefix-numeric-value exposure)) (start (point)) (start-marker (point-marker)) (end (progn (outline-end-of-subtree) (skip-chars-forward "\n\^M") (point))) ;; I need a marker that will follow the end of the region even when ;; text is inserted right at the end. Text gets inserted *after* ;; markers, so I need it at end+1. Unfortunately I can't set a ;; marker at (point-max)+1, so I use nil to mean the region ends at ;; (point-max). (end-marker (if (eobp) nil (set-marker (make-marker) (1+ end)))) ) ;; narrow to this subtree (narrow-to-region start end) ;; show the body and/or subheadings for this heading (goto-char start) (cond ((null exposure) (outline-show-entry) (outline-show-children)) ((< exposure-value 0) (outline-show-entry)) ((consp exposure) (outline-show-children)) ((> exposure-value 0) (outline-show-children exposure-value)) (t (outline-show-subtree)) ) ;; save the location of the fold we are entering (setq foldout-fold-list (cons (cons start-marker end-marker) foldout-fold-list)) ;; update the mode line (foldout-update-mode-line) ))) (defun foldout-exit-fold (&optional num-folds) "Return to the ARG'th enclosing fold view. With ARG = 0 exit all folds. Normally causes exited folds to be hidden, but with ARG < 0, -ARG folds are exited and text is left visible." (interactive "p") (let ((hide-fold t) start-marker end-marker beginning-of-heading end-of-subtree) ;; check there are some folds to leave (if (null foldout-fold-list) (error "Not in a fold!")) (cond ;; catch a request to leave all folds ((zerop num-folds) (setq num-folds (length foldout-fold-list))) ;; have we been told not to hide the fold? ((< num-folds 0) (setq hide-fold nil num-folds (- num-folds))) ) ;; limit the number of folds if we've been told to exit too many (setq num-folds (min num-folds (length foldout-fold-list))) ;; exit the folds (widen) (while (not (zerop num-folds)) ;; get the fold at the top of the stack (setq start-marker (car (car foldout-fold-list)) end-marker (cdr (car foldout-fold-list)) foldout-fold-list (cdr foldout-fold-list) num-folds (1- num-folds)) ;; Make sure there is a newline at the end of this fold, ;; otherwise the following heading will get joined to the body ;; text. (if end-marker (progn (goto-char end-marker) (forward-char -1) (or (memq (preceding-char) '(?\n ?\^M)) (insert ?\n)))) ;; If this is the last fold to exit, hide the text unless we've ;; been told not to. Note that at the moment point is at the ;; beginning of the following heading if there is one. ;; Also, make sure that the newline before the following heading ;; is \n otherwise it will be hidden. If there is a newline ;; before this one, make it visible too so we do the same as ;; outline.el and leave a blank line before the heading. (when (zerop num-folds) (if end-marker (setq beginning-of-heading (point) end-of-subtree (progn (forward-char -1) (if (memq (preceding-char) '(?\n ?\^M)) (forward-char -1)) (point)))) ;; hide the subtree (when hide-fold (goto-char start-marker) (outline-hide-subtree)) ;; make sure the next heading is exposed (if end-marker (outline-flag-region end-of-subtree beginning-of-heading foldout-show-flag))) ;; zap the markers so they don't slow down editing (set-marker start-marker nil) (if end-marker (set-marker end-marker nil))) ;; narrow to the enclosing fold if there is one (if foldout-fold-list (progn (setq start-marker (car (car foldout-fold-list)) end-marker (cdr (car foldout-fold-list))) (narrow-to-region start-marker (if end-marker (1- (marker-position end-marker)) (point-max))))) (recenter) ;; update the mode line (foldout-update-mode-line))) (defun foldout-update-mode-line () "Set the mode line to indicate our fold depth." (let ((depth (length foldout-fold-list))) (setq foldout-mode-line-string (cond ;; if we're not in a fold, keep quiet ((zerop depth) nil) ;; in outline-minor-mode we're after "Outl:xx" in the mode line (outline-minor-mode (format ":%d" depth)) ;; otherwise just announce the depth (I guess we're in outline-mode) ((= depth 1) " Inside 1 fold") (t (format " Inside %d folds" depth)))))) (defun foldout-mouse-zoom (event) "Zoom in on the heading clicked on. How much is exposed by the zoom depends on the number of mouse clicks:- 1 expose body 2 expose subheadings 3 expose body and subheadings 4 expose entire subtree" (interactive "@e") ;; swallow intervening mouse events so we only get the final click-count. (setq event (foldout-mouse-swallow-events event)) ;; go to the heading clicked on (foldout-mouse-goto-heading event) ;; zoom away (foldout-zoom-subtree (let ((nclicks (event-click-count event))) (cond ((= nclicks 1) -1) ; body only ((= nclicks 2) '(1)) ; subheadings only ((= nclicks 3) nil) ; body and subheadings (t 0))))) ; entire subtree (defun foldout-mouse-show (event) "Show what is hidden under the heading clicked on. What gets exposed depends on the number of mouse clicks:- 1 expose body 2 expose subheadings 3 expose body and subheadings 4 expose entire subtree" (interactive "@e") ;; swallow intervening mouse events so we only get the final click-count. (setq event (foldout-mouse-swallow-events event)) ;; expose the text (foldout-mouse-goto-heading event) (let ((nclicks (event-click-count event))) (cond ((= nclicks 1) (outline-show-entry)) ((= nclicks 2) (outline-show-children)) ((= nclicks 3) (outline-show-entry) (outline-show-children)) (t (outline-show-subtree))))) (defun foldout-mouse-hide-or-exit (event) "Hide the subtree under the heading clicked on, or exit a fold. What happens depends on the number of mouse clicks:- 1 hide subtree 2 exit fold and hide text 3 exit fold without hiding text 4 exit all folds and hide text" (interactive "@e") ;; swallow intervening mouse events so we only get the final click-count. (setq event (foldout-mouse-swallow-events event)) ;; hide or exit (let ((nclicks (event-click-count event))) (if (= nclicks 1) (progn (foldout-mouse-goto-heading event) (outline-hide-subtree)) (foldout-exit-fold (cond ((= nclicks 2) 1) ; exit and hide ((= nclicks 3) -1) ; exit don't hide (t 0)))))) ; exit all (defun foldout-mouse-swallow-events (event) "Swallow intervening mouse events so we only get the final click-count. Signal an error if the final event isn't the same type as the first one." (let ((initial-event-type (event-basic-type event))) (while (null (sit-for (/ double-click-time 1000.0) 'nodisplay)) (setq event (read-event))) (or (eq initial-event-type (event-basic-type event)) (error ""))) event) (defun foldout-mouse-goto-heading (event) "Go to the heading where the mouse event started. Signal an error if the event didn't occur on a heading." (goto-char (posn-point (event-start event))) (or (outline-on-heading-p) ;; outline.el sometimes treats beginning-of-buffer as a heading ;; even though outline-on-heading returns nil. (save-excursion (beginning-of-line) (bobp)) (error "Not a heading line"))) ;;; Keymaps: (defvar foldout-inhibit-key-bindings nil "Set non-nil before loading foldout to inhibit key bindings.") (defvar foldout-mouse-modifiers '(meta control) "List of modifier keys to apply to foldout's mouse events. The default (meta control) makes foldout bind its functions to M-C-down-mouse-{1,2,3}. Valid modifiers are shift, control, meta, alt, hyper and super.") (if foldout-inhibit-key-bindings () (define-key outline-mode-map "\C-c\C-z" 'foldout-zoom-subtree) (define-key outline-mode-map "\C-c\C-x" 'foldout-exit-fold) (let ((map (lookup-key outline-minor-mode-map outline-minor-mode-prefix))) (unless map (setq map (make-sparse-keymap)) (define-key outline-minor-mode-map outline-minor-mode-prefix map)) (define-key map "\C-z" 'foldout-zoom-subtree) (define-key map "\C-x" 'foldout-exit-fold)) (let* ((modifiers (apply 'concat (mapcar (function (lambda (modifier) (vector (cond ((eq modifier 'shift) ?S) ((eq modifier 'control) ?C) ((eq modifier 'meta) ?M) ((eq modifier 'alt) ?A) ((eq modifier 'hyper) ?H) ((eq modifier 'super) ?s) (t (error "invalid mouse modifier %s" modifier))) ?-))) foldout-mouse-modifiers))) (mouse-1 (vector (intern (concat modifiers "down-mouse-1")))) (mouse-2 (vector (intern (concat modifiers "down-mouse-2")))) (mouse-3 (vector (intern (concat modifiers "down-mouse-3"))))) (define-key outline-mode-map mouse-1 'foldout-mouse-zoom) (define-key outline-mode-map mouse-2 'foldout-mouse-show) (define-key outline-mode-map mouse-3 'foldout-mouse-hide-or-exit) (define-key outline-minor-mode-map mouse-1 'foldout-mouse-zoom) (define-key outline-minor-mode-map mouse-2 'foldout-mouse-show) (define-key outline-minor-mode-map mouse-3 'foldout-mouse-hide-or-exit) )) (provide 'foldout) ;;; foldout.el ends here
{ "pile_set_name": "Github" }
<?php /** * Zend Framework (http://framework.zend.com/) * * @link http://github.com/zendframework/zf2 for the canonical source repository * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com) * @license http://framework.zend.com/license/new-bsd New BSD License */ namespace Zend\Mail\Header\Exception; use Zend\Mail\Exception; class RuntimeException extends Exception\RuntimeException implements ExceptionInterface { }
{ "pile_set_name": "Github" }
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd"> <html> <head> <title>dojox.fx.flip | experimental fx add-ons for the Dojo Toolkit</title> <script type="text/javascript" src="../../../dojo/dojo.js" data-dojo-config="isDebug:true, parseOnLoad: true" ></script> <style type="text/css"> @import "../../../dojo/resources/dojo.css"; @import "../../../dijit/themes/tundra/tundra.css"; .testBox { overflow:hidden; font: 20px arial, sans-serif; line-height:200px; text-align:center; width:300px; height:200px; } .pageContainer{ position:relative; border:1px solid #999; } .page{ padding:13px; width:200px; height:360px; background:#f0ecec; color:#333; font:11px arial, sans-serif; } table.demoContainer{ border-collapse: collapse; margin-top:20px; } table.demoContainer thead th{ font: 20px arial, sans-serif; border-bottom:1px solid #999; text-align:center; color: #666; } table.demoContainer thead th.view{ border-right:1px solid #999; } table.demoContainer td.view{ border-right: 1px solid #999; width:400px; padding:10px 0px 30px 100px; text-align:center; } div.controls{ width:300px; height:200px; margin: 40px 20px 0 20px; } div.topBottom{ width:100%; text-align:center; } div.middle{ margin:40px 0; width:100%; height:40px; line-height:40px; text-align:center; position:relative; } input.button{ border:1px solid #999; color: #333; background: #ddd; padding:5px; } </style> <script type="text/javascript"> dojo.require("dojox.fx.flip"); // fx.flip example: var flipinit = function(){ dojo.connect(dojo.byId("flipTop"), "onclick", function(e){ var anim = dojox.fx.flip({ node: "flip1", dir: "top", depth: .5, endColor: "#666", duration:400 }); dojo.connect(anim, "onEnd", this, function(){ var n = dojo.byId("flip1"); n.innerHTML = "TOP"; dojo.style(n, { color: "#ddd", background: "#666" }); }) anim.play(); }); dojo.connect(dojo.byId("flipRight"), "onclick", function(e){ var anim = dojox.fx.flip({ node: "flip1", dir: "right", depth: .5, endColor: "yellow", duration:400 }) dojo.connect(anim, "onEnd", this, function(){ var n = dojo.byId("flip1"); n.innerHTML = "RIGHT"; dojo.style(n, { color: "red", background: "yellow" }); }) anim.play(); }); dojo.connect(dojo.byId("flipBottom"), "onclick", function(e){ var anim = dojox.fx.flip({ node: "flip1", dir: "bottom", depth: .5, endColor: "red", duration: 400 }) dojo.connect(anim, "onEnd", this, function(){ var n = dojo.byId("flip1"); n.innerHTML = "BOTTOM"; dojo.style(n, { color: "yellow", background: "red" }); }) anim.play(); }); dojo.connect(dojo.byId("flipLeft"), "onclick", function(e){ var anim = dojox.fx.flip({ node: "flip1", dir: "left", depth: .5, endColor: "blue", duration:400 }); dojo.connect(anim, "onEnd", this, function(){ var n = dojo.byId("flip1"); n.innerHTML = "LEFT"; dojo.style(n, { color: "white", background: "blue" }); }); anim.play(); }); }; // fx.flip, half flip example: var halfflipinit = function(){ dojo.connect(dojo.byId("halfflipreset"), "onclick", function(){ dojo.style(dojo.byId("hflip1"), { visibility: "hidden" }); }); dojo.connect(dojo.byId("halfflip"), "onclick", function(e){ var anim = dojox.fx.flip({ node: "hflip1", dir: "top", shift: -150, whichAnim: "last", depth: .5, endColor: "#666", duration: 1000 }) dojo.connect(anim, "onEnd", this, function(){ var n = dojo.byId("hflip1"); }) anim.play(); }); }; // fx.flipCube example: var cubeinit = function(){ dojo.connect(dojo.byId("cflipTop"), "onclick", function(e){ var anim = dojox.fx.flipCube({ node: dojo.byId("cflip1"), dir: "top", endColor: "#666666", duration:500 }); dojo.connect(anim, "onEnd", this, function(){ var n = dojo.byId("cflip1"); n.innerHTML = "TOP"; dojo.style(n, { color: "#ddd", background: "#666" }); }); anim.play(); }); dojo.connect(dojo.byId("cflipRight"), "onclick", function(e){ var anim = dojox.fx.flipCube({ node: dojo.byId("cflip1"), dir: "right", endColor: "yellow", duration:500 }); dojo.connect(anim, "onEnd", this, function(){ var n = dojo.byId("cflip1"); n.innerHTML = "RIGHT"; dojo.style(n, { color: "red", background: "yellow" }); }); anim.play(); }); dojo.connect(dojo.byId("cflipBottom"), "onclick", function(e){ var anim = dojox.fx.flipCube({ node: dojo.byId("cflip1"), dir: "bottom", endColor: "red", duration: 500 }); dojo.connect(anim, "onEnd", this, function(){ var n = dojo.byId("cflip1"); n.innerHTML = "BOTTOM"; dojo.style(n, { color: "yellow", background: "red" }); }); anim.play(); }); dojo.connect(dojo.byId("cflipLeft"), "onclick", function(e){ var anim = dojox.fx.flipCube({ node: "cflip1", dir: "left", endColor: "blue", duration: 500 }); dojo.connect(anim, "onEnd", this, function(){ var n = dojo.byId("cflip1"); n.innerHTML = "LEFT"; dojo.style(n, { color: "white", background: "blue" }); }); anim.play(); }); }; // fx.flipGrid example: var gridinit = function(){ dojo.connect(dojo.byId("reset"), "onclick", function(e){ dojo.byId("flipGrid").disabled = ""; dojo.style(dojo.byId("gflip1"), { visibility: "visible" }); }); dojo.connect(dojo.byId("flipGrid"), "onclick", function(e){ var anim = dojox.fx.flipGrid({ node: dojo.byId("gflip1"), dir: "right", cols: 7, rows: 5, duration:900 }); dojo.connect(anim, "play", this, function(){ dojo.byId("flipGrid").disabled = "disabled"; }); anim.play(); }); }; // fx.flipPage example: var currentPage = 0, pages = 4 ; var pageinit = function(){ dojo.connect(dojo.byId("flipPageRight"), "onclick", function(e){ var anim = dojox.fx.flipPage({ node: dojo.byId("page" + (currentPage + 1)), dir: "left", endColor: "yellow", depth: .3, duration:3000 }); dojo.connect(anim, "play", this, function(){ dojo.byId("page" + (currentPage + 1)).style.display = "none"; dojo.byId("page" + ((currentPage + 3) % pages)).style.display = "block"; }); dojo.connect(anim, "onEnd", this, function(){ dojo.byId("page" + currentPage).style.display = "none"; dojo.byId("page" + (currentPage + 1)).style.display = "none"; currentPage = (currentPage + 2) % pages; dojo.byId("page" + currentPage).style.display = "block"; dojo.byId("page" + (currentPage + 1)).style.display = "block"; }); anim.play(); }); dojo.connect(dojo.byId("flipPageLeft"), "onclick", function(e){ var anim = dojox.fx.flipPage({ node: dojo.byId("page" + currentPage), dir: "right", endColor: "blue", depth: .3, duration:3000 }); dojo.connect(anim, "play", this, function(){ dojo.byId("page" + (currentPage) % pages).style.display = "none"; dojo.byId("page" + ((currentPage + 2) % pages)).style.display = "block"; }); dojo.connect(anim, "onEnd", this, function(){ dojo.byId("page" + currentPage).style.display = "none"; dojo.byId("page" + (currentPage + 1)).style.display = "none"; currentPage = (currentPage + 2) % pages; dojo.byId("page" + currentPage).style.display = "block"; dojo.byId("page" + (currentPage + 1)).style.display = "block"; }); anim.play(); }); }; dojo.ready(flipinit); dojo.ready(halfflipinit); dojo.ready(cubeinit); dojo.ready(gridinit); dojo.ready(pageinit); </script> </head> <body class="tundra"> <table class="demoContainer"> <thead> <tr><th class="view">dojox.fx.flip test</th><th></th></tr> </thead> <tbody> <tr> <td class="view"> <div style="width:300px;height:200px;background:#666;color:#ddd;" id="flip1" class="testBox"> dojox.fx.flip </div> </td> <td> <div class="controls"> <div class="topBottom"><input type="button" class="button" style="margin:auto" id="flipTop" value="flip top" /></div> <div class="middle"> <div style="position:absolute;margin:auto;right:0;top:0"><input type="button" class="button" id="flipRight" value="flip right" /></div> controls <div style="position:absolute;margin:auto;left:0;top:0"><input type="button" class="button" id="flipLeft" value="flip left" /></div> </div> <div class="topBottom"><input type="button" class="button" id="flipBottom" value="flip bottom" /></div> </div> </td> </tr> </tbody> <thead> <tr><th class="view">dojox.fx.flip test - half flip</th><th></th></tr> </thead> <tbody> <tr> <td class="view"> <div style="width:300px;height:200px;background:#666;color:#ddd;visibility:hidden" id="hflip1" class="testBox"> WOOT! </div> </td> <td> <div class="controls"> <div class="middle"> <div style="position:absolute;left:60px;top:0"><input type="button" class="button" id="halfflip" value="half flip" /></div> <div style="position:absolute;right:60px;top:0"><input type="button" class="button" id="halfflipreset" value="reset" /></div> </div> </div> </td> </tr> </tbody> <thead> <tr><th class="view">dojox.fx.flipCube test</th><th></th></tr> </thead> <tbody> <tr> <td class="view"> <div style="width:300px;height:200px;background:#666;color:#ddd" id="cflip1" class="testBox"> dojox.fx.flipCube </div> </td> <td> <div class="controls"> <div class="topBottom"><input type="button" class="button" style="margin:auto" id="cflipTop" value="flip top" /></div> <div class="middle"> <div style="position:absolute;margin:auto;right:0;top:0"><input type="button" class="button" id="cflipRight" value="flip right" /></div> controls <div style="position:absolute;margin:auto;left:0;top:0"><input type="button" class="button" id="cflipLeft" value="flip left" /></div> </div> <div class="topBottom"><input type="button" class="button" id="cflipBottom" value="flip bottom" /></div> </div> </td> </tr> </tbody> <thead> <tr><th class="view">dojox.fx.flipGrid test</th><th></th></tr> </thead> <tbody> <tr> <td class="view"> <div style="width:300px;height:200px;background:#666;color:#ddd" id="gflip1" class="testBox"> dojox.fx.flipGrid </div> <td> <div class="controls"> <div class="middle"> <div style="position:absolute;left:60px;top:0"><input type="button" class="button" id="flipGrid" value="flip grid" /></div> <div style="position:absolute;right:60px;top:0"><input type="button" class="button" id="reset" value="reset" /></div> </div> </div> </td> </tr> </tbody> <thead> <tr><th class="view">dojox.fx.flipPage test</th><th></th></tr> </thead> <tbody> <tr> <td class="view" style="padding-left:20px"> <table style="height:300px; width:400px; border-collapse:collapse"> <tbody> <tr> <td> <div id="pageContainer0" class="pageContainer"> <div style="display:none" id="page2" class="page"> Ed una lupa, che di tutte brame sembiava carca ne la sua magrezza, e molte genti f&eacute; gi&agrave; viver grame, questa mi porse tanto di gravezza con la paura ch'uscia di sua vista, ch'io perdei la speranza de l'altezza. E qual &egrave; quei che volontieri acquista, e giugne 'l tempo che perder lo face, che 'n tutt'i suoi pensier piange e s'attrista; tal mi fece la bestia sanza pace, che, venendomi 'ncontro, a poco a poco mi ripigneva l&agrave; dove 'l sol tace. Mentre ch'i' rovinava in basso loco, dinanzi a li occhi mi si fu offerto chi per lungo silenzio parea fioco. Quando vidi costui nel gran diserto, &laquo;Miserere di me&raquo;, gridai a lui, &laquo;qual che tu sii, od ombra od omo certo!&raquo;. Rispuosemi: &laquo;Non omo, omo gi&agrave; fui, e li parenti miei furon lombardi, mantoani per patria ambedui. Nacqui sub Iulio, ancor che fosse tardi, e vissi a Roma sotto 'l buono Augusto nel tempo de li d&egrave;i falsi e bugiardi. Poeta fui, e cantai di quel giusto [...] </div> <div class="page" id="page0"> Nel mezzo del cammin di nostra vita mi ritrovai per una selva oscura ch&eacute; la diritta via era smarrita. Ahi quanto a dir qual era &egrave; cosa dura esta selva selvaggia e aspra e forte che nel pensier rinova la paura! Tant'&egrave; amara che poco &egrave; pi&ugrave; morte; ma per trattar del ben ch'i' vi trovai, dir&ograve; de l'altre cose ch'i' v'ho scorte. Io non so ben ridir com'i' v'intrai, tant'era pien di sonno a quel punto che la verace via abbandonai. Ma poi ch'i' fui al pi&egrave; d'un colle giunto, l&agrave; dove terminava quella valle che m'avea di paura il cor compunto, guardai in alto, e vidi le sue spalle vestite gi&agrave; de' raggi del pianeta che mena dritto altrui per ogne calle. Allor fu la paura un poco queta che nel lago del cor m'era durata la notte ch'i' passai con tanta pieta. E come quei che con lena affannata uscito fuor del pelago a la riva si volge a l'acqua perigliosa e guata, cos&igrave; l'animo mio, ch'ancor fuggiva, </div> </div> </td> <td> <div id="pageContainer1" class="pageContainer"> <div style="display:none;" id="page3" class="page"></div> <div id="page1" class="page"> si volse a retro a rimirar lo passo che non lasci&ograve; gi&agrave; mai persona viva. Poi ch'&egrave;i posato un poco il corpo lasso, ripresi via per la piaggia diserta, s&igrave; che 'l pi&egrave; fermo sempre era 'l pi&ugrave; basso. Ed ecco, quasi al cominciar de l'erta, una lonza leggera e presta molto, che di pel macolato era coverta; e non mi si partia dinanzi al volto, anzi 'mpediva tanto il mio cammino, ch'i' fui per ritornar pi&ugrave; volte v&ograve;lto. Temp'era dal principio del mattino, e 'l sol montava 'n s&ugrave; con quelle stelle ch'eran con lui quando l'amor divino mosse di prima quelle cose belle; s&igrave; ch'a bene sperar m'era cagione di quella fiera a la gaetta pelle l'ora del tempo e la dolce stagione; ma non s&igrave; che paura non mi desse la vista che m'apparve d'un leone. Questi parea che contra me venisse con la test'alta e con rabbiosa fame, s&igrave; che parea che l'aere ne tremesse. </div> </div> </td> </tr> </tbody> </table> </td> <td> <div class="middle"> <div style="position:absolute;left:30px;top:0"><input type="button" class="button" value="previous page" id="flipPageLeft" /></div> <div style="position:absolute;right:30px;top:0"><input type="button" class="button" id="flipPageRight" value="next page" /></div> </div> </td> </tr> </tbody> </table> </body> </html>
{ "pile_set_name": "Github" }
/* crypto/rc2/rc2.h */ /* Copyright (C) 1995-1997 Eric Young ([email protected]) * All rights reserved. * * This package is an SSL implementation written * by Eric Young ([email protected]). * The implementation was written so as to conform with Netscapes SSL. * * This library is free for commercial and non-commercial use as long as * the following conditions are aheared to. The following conditions * apply to all code found in this distribution, be it the RC4, RSA, * lhash, DES, etc., code; not just the SSL code. The SSL documentation * included with this distribution is covered by the same copyright terms * except that the holder is Tim Hudson ([email protected]). * * Copyright remains Eric Young's, and as such any Copyright notices in * the code are not to be removed. * If this package is used in a product, Eric Young should be given attribution * as the author of the parts of the library used. * This can be in the form of a textual message at program startup or * in documentation (online or textual) provided with the package. * * 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 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. All advertising materials mentioning features or use of this software * must display the following acknowledgement: * "This product includes cryptographic software written by * Eric Young ([email protected])" * The word 'cryptographic' can be left out if the rouines from the library * being used are not cryptographic related :-). * 4. If you include any Windows specific code (or a derivative thereof) from * the apps directory (application code) you must include an acknowledgement: * "This product includes software written by Tim Hudson ([email protected])" * * THIS SOFTWARE IS PROVIDED BY ERIC YOUNG ``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 OR CONTRIBUTORS BE LIABLE * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF * SUCH DAMAGE. * * The licence and distribution terms for any publically available version or * derivative of this code cannot be changed. i.e. this code cannot simply be * copied and put under another distribution licence * [including the GNU Public Licence.] */ #ifndef HEADER_RC2_H #define HEADER_RC2_H #include <openssl/opensslconf.h> /* OPENSSL_NO_RC2, RC2_INT */ #ifdef OPENSSL_NO_RC2 #error RC2 is disabled. #endif #define RC2_ENCRYPT 1 #define RC2_DECRYPT 0 #define RC2_BLOCK 8 #define RC2_KEY_LENGTH 16 #ifdef __cplusplus extern "C" { #endif typedef struct rc2_key_st { RC2_INT data[64]; } RC2_KEY; #ifdef OPENSSL_FIPS void private_RC2_set_key(RC2_KEY *key, int len, const unsigned char *data,int bits); #endif void RC2_set_key(RC2_KEY *key, int len, const unsigned char *data,int bits); void RC2_ecb_encrypt(const unsigned char *in,unsigned char *out,RC2_KEY *key, int enc); void RC2_encrypt(unsigned long *data,RC2_KEY *key); void RC2_decrypt(unsigned long *data,RC2_KEY *key); void RC2_cbc_encrypt(const unsigned char *in, unsigned char *out, long length, RC2_KEY *ks, unsigned char *iv, int enc); void RC2_cfb64_encrypt(const unsigned char *in, unsigned char *out, long length, RC2_KEY *schedule, unsigned char *ivec, int *num, int enc); void RC2_ofb64_encrypt(const unsigned char *in, unsigned char *out, long length, RC2_KEY *schedule, unsigned char *ivec, int *num); #ifdef __cplusplus } #endif #endif
{ "pile_set_name": "Github" }
//------------------------------------------------------------------------------ // <auto-generated> // This code was generated by a tool. // Runtime Version:4.0.30319.42000 // // Changes to this file may cause incorrect behavior and will be lost if // the code is regenerated. // </auto-generated> //------------------------------------------------------------------------------ namespace ChummerHub.Client.Properties { using System; /// <summary> /// A strongly-typed resource class, for looking up localized strings, etc. /// </summary> // This class was auto-generated by the StronglyTypedResourceBuilder // class via a tool like ResGen or Visual Studio. // To add or remove a member, edit your .ResX file then rerun ResGen // with the /str option, or rebuild your VS project. [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Resources.Tools.StronglyTypedResourceBuilder", "16.0.0.0")] [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()] public class Resources { private static global::System.Resources.ResourceManager resourceMan; private static global::System.Globalization.CultureInfo resourceCulture; [global::System.Diagnostics.CodeAnalysis.SuppressMessageAttribute("Microsoft.Performance", "CA1811:AvoidUncalledPrivateCode")] internal Resources() { } /// <summary> /// Returns the cached ResourceManager instance used by this class. /// </summary> [global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Advanced)] public static global::System.Resources.ResourceManager ResourceManager { get { if (object.ReferenceEquals(resourceMan, null)) { global::System.Resources.ResourceManager temp = new global::System.Resources.ResourceManager("ChummerHub.Client.Properties.Resources", typeof(Resources).Assembly); resourceMan = temp; } return resourceMan; } } /// <summary> /// Overrides the current thread's CurrentUICulture property for all /// resource lookups using this strongly typed resource class. /// </summary> [global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Advanced)] public static global::System.Globalization.CultureInfo Culture { get { return resourceCulture; } set { resourceCulture = value; } } /// <summary> /// Looks up a localized resource of type System.Drawing.Bitmap. /// </summary> public static System.Drawing.Bitmap group { get { object obj = ResourceManager.GetObject("group", resourceCulture); return ((System.Drawing.Bitmap)(obj)); } } } }
{ "pile_set_name": "Github" }
/* * Copyright 2013 The Netty Project * * The Netty Project 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. */ /** * Copyright (c) 2004-2011 QOS.ch * All rights reserved. * * Permission is hereby granted, free of charge, to any person obtaining * a copy of this software and associated documentation files (the * "Software"), to deal in the Software without restriction, including * without limitation the rights to use, copy, modify, merge, publish, * distribute, sublicense, and/or sell copies of the Software, and to * permit persons to whom the Software is furnished to do so, subject to * the following conditions: * * The above copyright notice and this permission notice shall be * included in all copies or substantial portions of the Software. * * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND * NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE * LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION * OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION * WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. * */ package io.netty.util.internal.logging; /** * Holds the results of formatting done by {@link MessageFormatter}. */ final class FormattingTuple { private final String message; private final Throwable throwable; FormattingTuple(String message, Throwable throwable) { this.message = message; this.throwable = throwable; } public String getMessage() { return message; } public Throwable getThrowable() { return throwable; } }
{ "pile_set_name": "Github" }
use ::game::{Config}; /* * The reason we don't use a simple bool for key state is that * it would skip a key that was pressed and released on the same frame. * This somehow increases the logic required to handle key presses, * but handles instant key presses much better. */ #[derive(PartialEq, Copy, Clone)] enum KeyState { Up, Down, BeenDown, } impl KeyState { fn up(&mut self) { *self = match *self { KeyState::Up => KeyState::Up, KeyState::Down => KeyState::BeenDown, KeyState::BeenDown => KeyState::BeenDown, }; } fn down(&mut self) { *self = KeyState::Down; } fn tick(&mut self) { *self = match *self { KeyState::Up => KeyState::Up, KeyState::Down => KeyState::Down, KeyState::BeenDown => KeyState::Up, }; } fn been_pressed(&self) -> bool { *self != KeyState::Up } fn is_down(&self) -> bool { *self == KeyState::Down } } #[derive(Copy, Clone)] pub enum InputIndex { Shoot = 0, Forward = 1, Backward = 2, Left = 3, Right = 4, _NumberOfInputs = 5, } pub struct Inputs { inputs: [KeyState; InputIndex::_NumberOfInputs as usize], } impl Inputs { pub fn new() -> Inputs { Inputs { inputs: [KeyState::Up; InputIndex::_NumberOfInputs as usize], } } pub fn been_pressed(&self, idx: InputIndex) -> bool { self.inputs[idx as usize].been_pressed() } pub fn is_down(&self, idx: InputIndex) -> bool { self.inputs[idx as usize].is_down() } pub fn tick(&mut self) { for input in self.inputs.iter_mut() { input.tick(); } } pub fn key_down(&mut self, code: u32, config: &Config) { if let Some(index) = config.lookup_input_key(code) { self.inputs[index as usize].down(); } } pub fn key_up(&mut self, code: u32, config: &Config) { if let Some(index) = config.lookup_input_key(code) { self.inputs[index as usize].up(); } } }
{ "pile_set_name": "Github" }
/* * Copyright 2014-2016 Fukurou Mishiranu * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ package com.mishiranu.dashchan.util; public class FlagUtils { public static boolean get(int flags, int flag) { return (flags & flag) == flag; } public static int set(int flags, int flag, boolean value) { if (value) { flags |= flag; } else { flags &= ~flag; } return flags; } }
{ "pile_set_name": "Github" }
<Canvas> <Kind>42</Kind> <Name>Presets</Name> <IsMinified>0</IsMinified> <XPosition>425.000000000</XPosition> <YPosition>1.000000000</YPosition> </Canvas> <Widget> <Kind>2</Kind> <Name>conflictForces</Name> <Value>0</Value> </Widget> <Widget> <Kind>2</Kind> <Name>DeFrag</Name> <Value>0</Value> </Widget> <Widget> <Kind>2</Kind> <Name>Fire</Name> <Value>0</Value> </Widget> <Widget> <Kind>2</Kind> <Name>GhostInTheShell</Name> <Value>0</Value> </Widget> <Widget> <Kind>2</Kind> <Name>Glitch</Name> <Value>0</Value> </Widget> <Widget> <Kind>2</Kind> <Name>Hall</Name> <Value>0</Value> </Widget> <Widget> <Kind>2</Kind> <Name>interestingSorting</Name> <Value>0</Value> </Widget> <Widget> <Kind>2</Kind> <Name>lines</Name> <Value>0</Value> </Widget> <Widget> <Kind>2</Kind> <Name>NoisePixels</Name> <Value>0</Value> </Widget> <Widget> <Kind>2</Kind> <Name>pixelsThunder</Name> <Value>0</Value> </Widget> <Widget> <Kind>2</Kind> <Name>randomCaos</Name> <Value>0</Value> </Widget> <Widget> <Kind>2</Kind> <Name>randomDeFragWar</Name> <Value>0</Value> </Widget> <Widget> <Kind>2</Kind> <Name>randomWaves</Name> <Value>0</Value> </Widget> <Widget> <Kind>2</Kind> <Name>SortingAtari</Name> <Value>0</Value> </Widget> <Widget> <Kind>2</Kind> <Name>sortingThunder</Name> <Value>0</Value> </Widget> <Widget> <Kind>2</Kind> <Name>sortingThunderSmall</Name> <Value>0</Value> </Widget> <Widget> <Kind>2</Kind> <Name>vert</Name> <Value>0</Value> </Widget> <Widget> <Kind>2</Kind> <Name>gx_work_01a</Name> <Value>0</Value> </Widget> <Widget> <Kind>2</Kind> <Name>gx_work_02a</Name> <Value>1</Value> </Widget>
{ "pile_set_name": "Github" }
body { font-family: "Helvetica Neue", Arial; font-weight: 200; } a { color: hsl(200, 50%, 50%); } a.active { color: hsl(20, 50%, 50%); } #example { position: absolute; } .App { width: 1000px; margin:0 auto; } .Master { overflow: auto; padding: 10px 40px; border-right: 1px solid #ccc; text-align: center; } .Detail { overflow: auto; padding: 40px; }
{ "pile_set_name": "Github" }
<?xml version='1.0' encoding='utf-8'?> <section xmlns="https://code.dccouncil.us/schemas/dc-library" xmlns:codified="https://code.dccouncil.us/schemas/codified" xmlns:codify="https://code.dccouncil.us/schemas/codify" xmlns:xi="http://www.w3.org/2001/XInclude" containing-doc="D.C. Code"> <num>21-150</num> <heading>Proof.</heading> <text>Every fact material to determine the propriety of a sale or exchange shall be clearly proved, in a proceeding brought pursuant to section 21-148 , by disinterested witnesses, whose testimony shall be taken in writing in the presence of the guardian ad litem or upon interrogatories agreed upon by him.</text> <annotations> <annotation doc="Pub. L. 89-183" type="History">Sept. 14, 1965, 79 Stat. 743, Pub. L. 89-183, § 1</annotation> <annotation type="Prior Codifications">1973 Ed., § 21-150.</annotation> <annotation type="Prior Codifications">1981 Ed., § 21-150.</annotation> </annotations> </section>
{ "pile_set_name": "Github" }
require 'test_helper' class FrontPageTest < ActionDispatch::IntegrationTest test 'new front page' do get '/' assert_select 'h1', 'MapKnitter' end end
{ "pile_set_name": "Github" }
# chain.conf # config file for etherSimulator.pl # Specify the probability of correct delivery between nodea and nodeb (bidirectional) # probability:nodea:nodeb:probability # nodea and nodeb are integers 0 to 255 # probability is a float range 0.0 to 1.0 # In this example, the probability of successful transmission # between nodes 10 and 2 (and vice versa) is given as 0.5 (ie 50% chance) probability:10:2:0.5
{ "pile_set_name": "Github" }
/** * @file libasm/src/arch/mips/handlers/asm_mips_add_d.c ** @ingroup MIPS_instrs */ /* Adam 'pi3' Zabrocki */ /* Manuel Martin - 2007 */ #include <libasm.h> int asm_mips_add_d(asm_instr *ins, u_char *buf, u_int len, asm_processor *proc) { struct s_mips_decode_reg temp; ins->instr = ASM_MIPS_ADD_D; ins->type = ASM_TYPE_ARITH | ASM_TYPE_ARCH; mips_convert_format_r(&temp, buf); ins->op[0].regset = ASM_MIPS_REG_FPU; ins->op[0].baser = temp.sa; asm_mips_operand_fetch(&ins->op[0], buf, ASM_MIPS_OTYPE_REGISTER, ins); ins->op[1].regset = ASM_MIPS_REG_FPU; ins->op[1].baser = temp.rd; asm_mips_operand_fetch(&ins->op[1], buf, ASM_MIPS_OTYPE_REGISTER, ins); ins->op[2].regset = ASM_MIPS_REG_FPU; ins->op[2].baser = temp.rt; asm_mips_operand_fetch(&ins->op[2], buf, ASM_MIPS_OTYPE_REGISTER, ins); /* Exception: Reserved Instruction, Coprocessor Unusable */ /* FPU Exceptions: Inexact, Unimplemented Operation, Invalid Operation, Overflow, Underflow */ return 4; }
{ "pile_set_name": "Github" }
FROM maven:3.5.3-jdk-8 WORKDIR /act COPY pom.xml pom.xml COPY src src RUN mvn package -q -P eclipselink_mysql WORKDIR /act/target/dist RUN tar xzf *.tar.gz CMD ["java", "-server", "-Djava.security.egd=file:/dev/./urandom", "-Xms1G", "-Xmx1G", "-Xss320k", "-XX:+UseNUMA", "-XX:+UseParallelGC", "-XX:+AggressiveOpts", "-Dapp.mode=prod", "-Dapp.nodeGroup=", "-Dprofile=eclipselink_mysql", "-Dxio.worker_threads.max=256", "-Dmysql.host=tfb-database", "-cp", "/act/target/dist/classes:/act/target/dist/lib/*", "com.techempower.act.AppEntry"]
{ "pile_set_name": "Github" }
{ "action": { "hacking": { "variety": [ "Unknown" ], "vector": [ "Web application" ] } }, "actor": { "external": { "country": [ "Unknown" ], "motive": [ "Unknown" ], "region": [ "000000" ], "variety": [ "Unknown" ] } }, "asset": { "assets": [ { "variety": "S - Web application" } ], "cloud": [ "Unknown" ] }, "attribute": { "confidentiality": { "data": [ { "variety": "Personal" } ], "data_disclosure": "Yes" } }, "discovery_method": { "unknown": true }, "incident_id": "0EE9BF5D-5421-49DE-AB8E-8D069DAA7226", "plus": { "analysis_status": "First pass", "created": "2013-09-10T20:13:32Z", "master_id": "0EE9BF5D-5421-49DE-AB8E-8D069DAA7226", "modified": "2014-04-27T19:37:02Z", "timeline": { "notification": { "day": 22, "month": 7, "year": 2013 } } }, "reference": "http://news.cnet.com/8301-13579_3-57594770-37/apple-developer-site-targeted-in-security-attack-still-down/, http://www.guardian.co.uk/technology/2013/jul/22/apple-developer-site-hacked", "schema_version": "1.3.4", "security_incident": "Confirmed", "source_id": "vcdb", "summary": "Apple's website for developers was accessed by unauthorized parties. Registered developer names, mailing addresses, and email addresses may have been accessed on Thursday, July 18. Encrypted customer information was not affected.", "timeline": { "incident": { "day": 18, "month": 7, "year": 2013 } }, "victim": { "country": [ "US" ], "employee_count": "50001 to 100000", "industry": "334220", "region": [ "019021" ], "state": "CA", "victim_id": "Apple Inc." } }
{ "pile_set_name": "Github" }
apiVersion: extensions/v1beta1 kind: Deployment metadata: name: reviews-v2 spec: replicas: 1 template: metadata: labels: app: reviews version: v2 spec: containers: - name: reviews image: istio/examples-bookinfo-reviews-v2:1.8.0 imagePullPolicy: IfNotPresent ports: - containerPort: 9080 --- apiVersion: networking.istio.io/v1alpha3 kind: DestinationRule metadata: name: reviews spec: host: reviews trafficPolicy: tls: mode: ISTIO_MUTUAL subsets: - name: v1 labels: version: v1 - name: v2 labels: version: v2 --- apiVersion: networking.istio.io/v1alpha3 kind: VirtualService metadata: name: reviews spec: hosts: - reviews http: - match: - headers: end-user: exact: jason route: - destination: host: reviews subset: v2 - route: - destination: host: reviews subset: v1 ---
{ "pile_set_name": "Github" }
##Agent-updater It is required to deploy "falcon-agent" for each machine. If there are just a small number of machines in the company, it is OK to install manually with tools such as pssh, ansible and fabric. But if there is a large number of machines in the company, installing, upgrading and rollbacking "falcon-agent" manually can be a nightmare. A tool named "agent-updater" is developed, which can be used to manage "falcon-agent". "agent-updater" also has an agent: "ops-updater", which can be regarded as a super agent and used to manage the agents of other agents. It is recommended to install ops-updater together when setting the machine up. Usually, ops-upgrader doesn't need upgrades. Please refer to https://github.com/open-falcon/ops-updater for details. If you want to learn how to use the Go language to write a complete project, you can study "agent-updater". I have even recorded a Video course to demonstrate how to develop it step by step. Tutorial link: * http://www.jikexueyuan.com/course/1336.html * http://www.jikexueyuan.com/course/1357.html * http://www.jikexueyuan.com/course/1462.html * http://www.jikexueyuan.com/course/1490.html
{ "pile_set_name": "Github" }
/* * The MIT License * * Copyright 2018 The OpenNARS authors. * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal * in the Software without restriction, including without limitation the rights * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell * copies of the Software, and to permit persons to whom the Software is * furnished to do so, subject to the following conditions: * * The above copyright notice and this permission notice shall be included in * all copies or substantial portions of the Software. * * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN * THE SOFTWARE. */ package org.opennars.storage; import org.opennars.entity.Item; import java.io.Serializable; import java.util.*; import org.opennars.inference.BudgetFunctions; import org.opennars.main.Parameters; /** * Original Bag implementation which distributes items into * discrete levels (queues) according to priority */ public class Bag<Type extends Item<K>,K> implements Serializable, Iterable<Type> { /** priority levels */ private final int TOTAL_LEVEL; /** firing threshold */ private final int THRESHOLD; /** shared DISTRIBUTOR that produce the probability distribution */ private final Distributor DISTRIBUTOR; /** mapping from key to item */ private HashMap<K, Type> nameTable; /** array of lists of items, for items on different level */ private ArrayList<ArrayList<Type>> itemTable; /** defined in different bags */ private final int capacity; /** current sum of occupied level */ private int mass; /** index to get next level, kept in individual objects */ private int levelIndex; /** current take out level */ private int currentLevel; /** maximum number of items to be taken out at current level */ private int currentCounter; public Bag(final int levels, final int capacity, Parameters narParameters) { this(levels, capacity, (int) (narParameters.BAG_THRESHOLD * levels)); } /** thresholdLevel = 0 disables "fire level completely" threshold effect */ public Bag(final int levels, final int capacity, final int thresholdLevel) { this.TOTAL_LEVEL = levels; DISTRIBUTOR = new Distributor(TOTAL_LEVEL); this.THRESHOLD = thresholdLevel; this.capacity = capacity; clear(); } public void clear() { itemTable = new ArrayList<ArrayList<Type>>(TOTAL_LEVEL); for (int i = 0; i < TOTAL_LEVEL; i++) { itemTable.add(new ArrayList<Type>()); } nameTable = new LinkedHashMap<K, Type>(); currentLevel = TOTAL_LEVEL - 1; levelIndex = capacity % TOTAL_LEVEL; // so that different bags start at different point mass = 0; currentCounter = 0; } /** * Get the average priority of Items * @return The average priority of Items in the bag */ public float getAveragePriority() { if (nameTable.isEmpty()) { return 0.01f; } float f = (float) mass / (nameTable.size() * TOTAL_LEVEL); if (f > 1) { return 1.0f; } return f; } /** * Check if an item is in the bag * @param it An item * @return Whether the Item is in the Bag */ public boolean contains(Type it) { return nameTable.containsValue(it); } /** * Get an Item by key * @param key The key of the Item * @return The Item with the given key */ public Type get(K key) { return nameTable.get(key); } /** * Add a new Item into the Bag * @param newItem The new Item * @return Whether the new Item is added into the Bag */ public Type putIn(Type newItem) { K newKey = newItem.name(); Type oldItem = nameTable.put(newKey, newItem); if (oldItem != null) { // merge duplications outOfBase(oldItem); newItem.merge(oldItem); } Type overflowItem = intoBase(newItem); // put the (new or merged) item into itemTable if (overflowItem != null) { // remove overflow K overflowKey = overflowItem.name(); nameTable.remove(overflowKey); return overflowItem; } else { return null; } } /** * Put an item back into the itemTable * <p> * The only place where the forgetting rate is applied * * @param oldItem The Item to put back * @param m related memory * @return the item which was removed, or null if none removed */ public Type putBack(final Type oldItem, final float forgetCycles, final Memory m) { final float relativeThreshold = m.narParameters.FORGET_QUALITY_RELATIVE; BudgetFunctions.applyForgetting(oldItem.budget, forgetCycles, relativeThreshold); return putIn(oldItem); } /** * Choose an Item according to priority distribution and take it out of the Bag * @return The selected Item */ public Type takeOut() { if (nameTable.isEmpty()) { // empty bag return null; } if (emptyLevel(currentLevel) || (currentCounter == 0)) { // done with the current level currentLevel = DISTRIBUTOR.pick(levelIndex); levelIndex = DISTRIBUTOR.next(levelIndex); while (emptyLevel(currentLevel)) { // look for a non-empty level currentLevel = DISTRIBUTOR.pick(levelIndex); levelIndex = DISTRIBUTOR.next(levelIndex); } if (currentLevel < THRESHOLD) { // for dormant levels, take one item currentCounter = 1; } else { // for active levels, take all current items currentCounter = itemTable.get(currentLevel).size(); } } Type selected = takeOutFirst(currentLevel); // take out the first item in the level int belongingLevel = getLevel(selected); if(currentLevel != belongingLevel) { intoBase(selected); return takeOut(); } currentCounter--; nameTable.remove(selected.name()); return selected; } /** * Pick an item by key, then remove it from the bag * @param key The given key * @return The Item with the key */ public Type pickOut(K key) { Type picked = nameTable.get(key); if (picked != null) { outOfBase(picked); nameTable.remove(key); } return picked; } public Type pickOut(Type val) { return pickOut(val.name()); } /** * Check whether a level is empty * @param n The level index * @return Whether that level is empty */ protected boolean emptyLevel(int n) { return itemTable.get(n).isEmpty(); } /** * Decide the put-in level according to priority * @param item The Item to put in * @return The put-in level */ private int getLevel(Type item) { float fl = item.getPriority() * TOTAL_LEVEL; int level = (int) Math.ceil(fl) - 1; return (level < 0) ? 0 : level; // cannot be -1 } /** * Insert an item into the itemTable, and return the overflow * @param newItem The Item to put in * @return The overflow Item */ private Type intoBase(Type newItem) { Type oldItem = null; int inLevel = getLevel(newItem); if (nameTable.size() > capacity) { // the bag is full int outLevel = 0; while (emptyLevel(outLevel)) { outLevel++; } if (outLevel > inLevel) { // ignore the item and exit return newItem; } else { // remove an old item in the lowest non-empty level oldItem = takeOutFirst(outLevel); } } itemTable.get(inLevel).add(newItem); // FIFO mass += (inLevel + 1); // increase total mass return oldItem; // TODO return null is a bad smell } /** * Take out the first or last Type in a level from the itemTable * @param level The current level * @return The first Item */ private Type takeOutFirst(int level) { Type selected = itemTable.get(level).get(0); itemTable.get(level).remove(0); mass -= (level + 1); return selected; } /** * Remove an item from itemTable, then adjust mass * @param oldItem The Item to be removed */ protected void outOfBase(Type oldItem) { int level = getLevel(oldItem); itemTable.get(level).remove(oldItem); mass -= (level + 1); } /** * Collect Bag content into a String for display */ @Override public String toString() { StringBuffer buf = new StringBuffer(" "); for (int i = TOTAL_LEVEL; i >= 0 ; i--) { if (!emptyLevel(i - 1)) { buf = buf.append("\n --- Level " + i + ":\n "); for (int j = 0; j < itemTable.get(i - 1).size(); j++) { buf = buf.append(itemTable.get(i - 1).get(j).toString() + "\n "); } } } return buf.toString(); } /** TODO bad paste from preceding */ public String toStringLong() { StringBuffer buf = new StringBuffer(" BAG " + getClass().getSimpleName() ); buf.append(" ").append( showSizes() ); for (int i = TOTAL_LEVEL; i >= 0; i--) { if (!emptyLevel(i - 1)) { buf = buf.append("\n --- LEVEL " + i + ":\n "); for (int j = 0; j < itemTable.get(i - 1).size(); j++) { buf = buf.append(itemTable.get(i - 1).get(j).toStringLong() + "\n "); } } } buf.append(">>>> end of Bag").append( getClass().getSimpleName() ); return buf.toString(); } String showSizes() { StringBuilder buf = new StringBuilder(" "); int levels = 0; for ( ArrayList<Type> items : itemTable) { if ((items != null) && ! items.isEmpty()) { levels++; buf.append( items.size() ).append( " " ); } } return "Levels: " + Integer.toString( levels ) + ", sizes: " + buf; } public int size() { return nameTable.size(); } @Override public Iterator<Type> iterator() { return nameTable.values().iterator(); } }
{ "pile_set_name": "Github" }
{ "key" : "film", "pkg" : [ "film" ], "features" : [ "doobie", "datamodel", "auth", "graphql", "service", "slick", "controller", "notes", "json", "core" ], "ignored" : [ ], "overrides" : [ { "k" : "className", "v" : "FilmRow" }, { "k" : "title", "v" : "Film" }, { "k" : "plural", "v" : "Films" }, { "k" : "film_id.type", "v" : "integer" }, { "k" : "title.globalSearch", "v" : "true" }, { "k" : "description.localSearch", "v" : "true" }, { "k" : "release_year.summary", "v" : "true" }, { "k" : "release_year.globalSearch", "v" : "true" }, { "k" : "release_year.localSearch", "v" : "true" }, { "k" : "rental_duration.summary", "v" : "true" }, { "k" : "rental_duration.localSearch", "v" : "true" }, { "k" : "rental_rate.summary", "v" : "true" }, { "k" : "rental_rate.localSearch", "v" : "true" }, { "k" : "length.summary", "v" : "true" }, { "k" : "length.globalSearch", "v" : "true" }, { "k" : "length.localSearch", "v" : "true" }, { "k" : "fk.film_language_id_fkey.propertyName", "v" : "language" }, { "k" : "fk.film_original_language_id_fkey.propertyName", "v" : "originalLanguage" }, { "k" : "reference.filmCategoryFilmIdFkey.propertyName", "v" : "categories" }, { "k" : "reference.filmActorFilmIdFkey.propertyName", "v" : "actors" }, { "k" : "reference.inventoryFilmIdFkey.propertyName", "v" : "inventories" }, { "k" : "defaultOrder", "v" : "asc-title" } ] }
{ "pile_set_name": "Github" }
package org.elmlang.intellijplugin.features.completion; import com.intellij.codeInsight.completion.*; import com.intellij.patterns.PlatformPatterns; import org.elmlang.intellijplugin.ElmLanguage; public class ElmCompletionContributor extends CompletionContributor { public ElmCompletionContributor() { extend( CompletionType.BASIC, PlatformPatterns .psiElement() .withLanguage(ElmLanguage.INSTANCE), getProvider() ); } private static CompletionProvider<CompletionParameters> getProvider() { return new ElmMainCompletionProvider( new ElmValueCompletionProvider(), new ElmKeywordsCompletionsProvider(), new ElmTypeCompletionProvider(), new ElmModuleCompletionProvider(), new ElmAbsoluteValueCompletionProvider(), new ElmCurrentModuleCompletionProvider(), new ElmRecordFieldsCompletionProvider(), new ElmAfterAnnotationCompletionProvider(), new ElmSingleModuleValueCompletionProvider()); } }
{ "pile_set_name": "Github" }
--- a/driver/wl_linux.c +++ b/driver/wl_linux.c @@ -2082,7 +2082,11 @@ static void _wl_set_multicast_list(struct net_device *dev) { wl_info_t *wl; +#if LINUX_VERSION_CODE <= KERNEL_VERSION(2,6,34) struct dev_mc_list *mclist; +#else + struct netdev_hw_addr *ha; +#endif int i; if (!dev) @@ -2098,14 +2102,24 @@ _wl_set_multicast_list(struct net_device wl->pub->allmulti = (dev->flags & IFF_ALLMULTI)? TRUE: FALSE; /* copy the list of multicasts into our private table */ +#if LINUX_VERSION_CODE <= KERNEL_VERSION(2,6,34) for (i = 0, mclist = dev->mc_list; mclist && (i < dev->mc_count); i++, mclist = mclist->next) { +#else + i = 0; + netdev_for_each_mc_addr(ha, dev) { +#endif if (i >= MAXMULTILIST) { wl->pub->allmulti = TRUE; i = 0; break; } +#if LINUX_VERSION_CODE <= KERNEL_VERSION(2,6,34) wl->pub->multicast[i] = *((struct ether_addr*) mclist->dmi_addr); +#else + wl->pub->multicast[i] = *((struct ether_addr*) ha->addr); + i++; +#endif } wl->pub->nmulticast = i; wlc_set(wl->wlc, WLC_SET_PROMISC, (dev->flags & IFF_PROMISC));
{ "pile_set_name": "Github" }
# Git Remotes In this lesson, we will cover the `git remote` command and remote repositories. A remote tells Git where the other versions of a project are stored. These versions are housed in "remote repositories," usually on another person's computer or a server. Remote repositories are the versions of your project that are not on your local machine. These are typically the repositories that you are pulling code from and pushing code to when you use Git. ## Learning outcomes *Look through these now and then use them to test yourself after doing the assignment* By the end of this you should be able to: * Explain why we use remote repositories * Fork and clone a repository to your machine * Add a remote to a repository * View remotes on a local project * Remove a remote from a repository * Pull changes from a remote branch * Push changes to a remote branch * Submit a pull request to a remote repository that doesn't belong to you # Introduction to Remotes GitHub has an excellent definition for remotes: "A remote URL is Git's fancy way of saying 'the place where your code is stored.'" Remotes allow us to work in tandem with other developers by giving us central locations to store and share different versions of our projects. There is a subtle, but important difference between a "remote" and a "remote repository." A remote is the bookmark-like tool that developers use to tell Git where a remote repository is located. The remote repository is where the code actually lives, typically this is on a server or another computer. ## Assignment 1. Read an [intro to remote repositories](https://www.git-tower.com/learn/git/ebook/en/command-line/remote-repositories/introduction#start) 2. Take a few minutes to watch [this overview](https://www.youtube.com/watch?v=kd4jMl_3LQE) of Git remotes and remote repositories # Forking and Cloning a Remote Repository Forking is a way for developers to make their own copies of a GitHub repository. It's important to note that forking is specific to the GitHub website, so it is not a part of Git. When you create a fork on GitHub, you've made an identical copy of a repository under your own user account. This allows developers to copy and change a project without affecting the original. Cloning is Git's way of getting a copy of a project. You'll have to clone a repository before you can make changes to it or see the source code on your own computer. Cloning helps you edit a repository on your local computer without making irreversible changes. Remember forking is specific to GitHub, and cloning is a feature of Git. ## Assignment 1. Watch [episode 1.3](https://www.youtube.com/watch?v=_NrSWLQsDL4&list=PLRqwX-V7Uu6ZF9C0YMKuns9sLDzK6zoiV&index=3) of [The Coding Train](https://www.youtube.com/channel/UCvjgXvBlbQiydffZU7m1_aw)'s [Git and GitHub for Poets](https://www.youtube.com/playlist?list=PLRqwX-V7Uu6ZF9C0YMKuns9sLDzK6zoiV) to learn about making forks on GitHub 2. Watch [episode 1.6](https://youtu.be/yXT1ElMEkW8?list=PLRqwX-V7Uu6ZF9C0YMKuns9sLDzK6zoiV) of [The Coding Train](https://www.youtube.com/channel/UCvjgXvBlbQiydffZU7m1_aw)'s [Git and GitHub for Poets](https://www.youtube.com/playlist?list=PLRqwX-V7Uu6ZF9C0YMKuns9sLDzK6zoiV) to understand cloning a remote repository # Using the git remote Command Here, we will discuss using the `git remote` command. First we will learn to add a new remote, then we will see how to view all remotes on a git repository. Here are some examples of the `git remote` command in action. Feel free to refer to this section in the future: ```bash # Adding a new remote called "origin" to a git repository $ git remote add add origin <remote repository URL> # Getting more information about a remote named "origin" $ git remote show origin # Renaming a remote called "origin" to "old-origin" $ git remote rename origin old-origin # Removing an existing remote called "old-origin" from a git repository $ git remote remove old-origin # Removing all references to stale branches (those that have are available locally, but not upstream) $ git remote prune origin ``` ## Assignment 1. Read [GitHub](https://www.github.com)'s guide for [Adding a remote](https://help.github.com/articles/adding-a-remote/) 2. Read [Listing Remote Branches](http://gitready.com/intermediate/2009/02/13/list-remote-branches.html) from [Nick Quaranto](http://gitready.com/) 3. Read [GitHub](https://www.github.com)'s guide for [Removing a remote](https://help.github.com/articles/removing-a-remote/) # Working with a Remote Repository Finally, we are going to look at making changes to a repository and making a pull request to a remote repository that you don't own. You will learn about two important features in Git by reviewing these resources. First pulling and then pushing. In Git, a pull asks the remote repository code that has been added since your last use of `git pull`. The opposite of `git pull` is `git push`. When you push with Git, you're sending code up to the remote repository. This is how you will add commits to the remote repository to be pulled down by your fellow developers. On top of that, you'll learn about pull requests. You've probably heard about pull requests before. A pull request allows developers to submit code to other repositories. Usually, a pull request will have to be merged by someone who owns the repository. When you make a pull request, you are asking a remote repository to pull your changes into their codebase. ## Assignment 1. Watch this [60-second video](https://www.youtube.com/watch?v=-uQHV9GOA0w) covering git pull and git push 2. Take a look at [Pushing and Pulling](http://gitready.com/beginner/2009/01/21/pushing-and-pulling.html) from [Nick Quaranto](http://gitready.com/) 3. Watch [Git & GitHub: Pull requests](https://www.youtube.com/watch?v=FQsBmnZvBdc) from [Codecourse](https://www.youtube.com/watch?v=FQsBmnZvBdc) ## Exercises * Follow [this tutorial](https://www.digitalocean.com/community/tutorials/how-to-create-a-pull-request-on-github) from [DigitalOcean](https://www.digitalocean.com) to see forking, cloning, remotes, and pull requests in action ## Additional Resources *This section contains helpful links to other content. It isn't required, so consider it supplemental for if you need to dive deeper into something* * [Working with Remotes](https://git-scm.com/book/en/v2/Git-Basics-Working-with-Remotes) from [Pro Git](https://git-scm.com/book/en/v2) by Scott Chacon and Ben Straub * [What is version control: centralized vs. DVCS](https://www.atlassian.com/blog/software-teams/version-control-centralized-dvcs) from [Atlassian](https://www.atlassian.com/)
{ "pile_set_name": "Github" }
// RUN: %clang -g -std=c++11 -S -emit-llvm %s -o - | FileCheck %s template<typename T> struct foo { }; namespace x { // splitting these over multiple lines to make sure the right token is used for // the location template<typename T> using # 42 bar = foo<T*>; } // CHECK: !DIGlobalVariable(name: "bi",{{.*}} type: [[BINT:![0-9]+]] x::bar<int> bi; // CHECK: !DIGlobalVariable(name: "bf",{{.*}} type: [[BFLOAT:![0-9]+]] // CHECK: [[BFLOAT]] = !DIDerivedType(tag: DW_TAG_typedef, name: "bar<float>" x::bar<float> bf; using // CHECK: !DIGlobalVariable(name: "n",{{.*}} type: [[NARF:![0-9]+]] # 142 narf // CHECK: [[NARF]] = !DIDerivedType(tag: DW_TAG_typedef, name: "narf" // CHECK-SAME: line: 142 = int; narf n; template <typename T> using tv = void; // CHECK: !DIDerivedType(tag: DW_TAG_typedef, name: "tv<int>" tv<int> *tvp; using v = void; // CHECK: !DIDerivedType(tag: DW_TAG_typedef, name: "v" v *vp; // CHECK: [[BINT]] = !DIDerivedType(tag: DW_TAG_typedef, name: "bar<int>" // CHECK-SAME: line: 42,
{ "pile_set_name": "Github" }
// BZ_HAVE_SYSTEM_V_MATH #ifndef _ALL_SOURCE #define _ALL_SOURCE #endif #ifndef _XOPEN_SOURCE #define _XOPEN_SOURCE #endif #ifndef _XOPEN_SOURCE_EXTENDED #define _XOPEN_SOURCE_EXTENDED 1 #endif #include <math.h> int main() { double x = 1.0; double y = 1.0; _class(x); itrunc(x); nearest(x); rsqrt(x); uitrunc(x); copysign(x,y); drem(x,y); hypot(x,y); nextafter(x,y); remainder(x,y); scalb(x,y); unordered(x,y); return 0; }
{ "pile_set_name": "Github" }
/** ****************************************************************************** * @file stm32f4xx_iwdg.h * @author MCD Application Team * @version V1.7.0 * @date 22-April-2016 * @brief This file contains all the functions prototypes for the IWDG * firmware library. ****************************************************************************** * @attention * * <h2><center>&copy; COPYRIGHT 2016 STMicroelectronics</center></h2> * * Licensed under MCD-ST Liberty SW License Agreement V2, (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.st.com/software_license_agreement_liberty_v2 * * 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. * ****************************************************************************** */ /* Define to prevent recursive inclusion -------------------------------------*/ #ifndef __STM32F4xx_IWDG_H #define __STM32F4xx_IWDG_H #ifdef __cplusplus extern "C" { #endif /* Includes ------------------------------------------------------------------*/ #include "stm32f4xx.h" /** @addtogroup STM32F4xx_StdPeriph_Driver * @{ */ /** @addtogroup IWDG * @{ */ /* Exported types ------------------------------------------------------------*/ /* Exported constants --------------------------------------------------------*/ /** @defgroup IWDG_Exported_Constants * @{ */ /** @defgroup IWDG_WriteAccess * @{ */ #define IWDG_WriteAccess_Enable ((uint16_t)0x5555) #define IWDG_WriteAccess_Disable ((uint16_t)0x0000) #define IS_IWDG_WRITE_ACCESS(ACCESS) (((ACCESS) == IWDG_WriteAccess_Enable) || \ ((ACCESS) == IWDG_WriteAccess_Disable)) /** * @} */ /** @defgroup IWDG_prescaler * @{ */ #define IWDG_Prescaler_4 ((uint8_t)0x00) #define IWDG_Prescaler_8 ((uint8_t)0x01) #define IWDG_Prescaler_16 ((uint8_t)0x02) #define IWDG_Prescaler_32 ((uint8_t)0x03) #define IWDG_Prescaler_64 ((uint8_t)0x04) #define IWDG_Prescaler_128 ((uint8_t)0x05) #define IWDG_Prescaler_256 ((uint8_t)0x06) #define IS_IWDG_PRESCALER(PRESCALER) (((PRESCALER) == IWDG_Prescaler_4) || \ ((PRESCALER) == IWDG_Prescaler_8) || \ ((PRESCALER) == IWDG_Prescaler_16) || \ ((PRESCALER) == IWDG_Prescaler_32) || \ ((PRESCALER) == IWDG_Prescaler_64) || \ ((PRESCALER) == IWDG_Prescaler_128)|| \ ((PRESCALER) == IWDG_Prescaler_256)) /** * @} */ /** @defgroup IWDG_Flag * @{ */ #define IWDG_FLAG_PVU ((uint16_t)0x0001) #define IWDG_FLAG_RVU ((uint16_t)0x0002) #define IS_IWDG_FLAG(FLAG) (((FLAG) == IWDG_FLAG_PVU) || ((FLAG) == IWDG_FLAG_RVU)) #define IS_IWDG_RELOAD(RELOAD) ((RELOAD) <= 0xFFF) /** * @} */ /** * @} */ /* Exported macro ------------------------------------------------------------*/ /* Exported functions --------------------------------------------------------*/ /* Prescaler and Counter configuration functions ******************************/ void IWDG_WriteAccessCmd(uint16_t IWDG_WriteAccess); void IWDG_SetPrescaler(uint8_t IWDG_Prescaler); void IWDG_SetReload(uint16_t Reload); void IWDG_ReloadCounter(void); /* IWDG activation function ***************************************************/ void IWDG_Enable(void); /* Flag management function ***************************************************/ FlagStatus IWDG_GetFlagStatus(uint16_t IWDG_FLAG); #ifdef __cplusplus } #endif #endif /* __STM32F4xx_IWDG_H */ /** * @} */ /** * @} */ /************************ (C) COPYRIGHT STMicroelectronics *****END OF FILE****/
{ "pile_set_name": "Github" }
# Update the box apt-get -y update apt-get -y install linux-headers-$(uname -r) build-essential apt-get -y install zlib1g-dev libssl-dev libreadline5-dev apt-get -y install curl unzip # Set up sudo cp /etc/sudoers /etc/sudoers.orig sed -i -e 's/%sudo ALL=(ALL) ALL/%sudo ALL=NOPASSWD:ALL/g' /etc/sudoers # Tweak sshd to prevent DNS resolution (speed up logins) echo 'UseDNS no' >> /etc/ssh/sshd_config # Remove 5s grub timeout to speed up booting echo <<EOF > /etc/default/grub # If you change this file, run 'update-grub' afterwards to update # /boot/grub/grub.cfg. GRUB_DEFAULT=0 GRUB_TIMEOUT=0 GRUB_DISTRIBUTOR=`lsb_release -i -s 2> /dev/null || echo Debian` GRUB_CMDLINE_LINUX_DEFAULT="quiet" GRUB_CMDLINE_LINUX="debian-installer=en_US" EOF update-grub
{ "pile_set_name": "Github" }
/******************************************************************************* * Copyright 2012-2019 Amazon.com, Inc. or its affiliates. All Rights Reserved. * Licensed under the Apache License, Version 2.0 (the "License"). You may not use * this file except in compliance with the License. A copy of the License is located at * * http://aws.amazon.com/apache2.0 * * or in the "license" file accompanying this file. * This file 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. * ***************************************************************************** * * AWS Tools for Windows (TM) PowerShell (TM) * */ using System; using System.Collections.Generic; using System.Linq; using System.Management.Automation; using System.Text; using Amazon.PowerShell.Common; using Amazon.Runtime; using Amazon.SimpleNotificationService; using Amazon.SimpleNotificationService.Model; namespace Amazon.PowerShell.Cmdlets.SNS { [AWSClientCmdlet("Amazon Simple Notification Service (SNS)", "SNS", "2010-03-31", "SimpleNotificationService")] public abstract partial class AmazonSimpleNotificationServiceClientCmdlet : ServiceCmdlet { protected IAmazonSimpleNotificationService Client { get; private set; } protected IAmazonSimpleNotificationService CreateClient(AWSCredentials credentials, RegionEndpoint region) { var config = new AmazonSimpleNotificationServiceConfig { RegionEndpoint = region }; Amazon.PowerShell.Utils.Common.PopulateConfig(this, config); this.CustomizeClientConfig(config); var client = new AmazonSimpleNotificationServiceClient(credentials, config); client.BeforeRequestEvent += RequestEventHandler; client.AfterResponseEvent += ResponseEventHandler; return client; } protected override void ProcessRecord() { base.ProcessRecord(); Client = CreateClient(_CurrentCredentials, _RegionEndpoint); } } }
{ "pile_set_name": "Github" }
(function() { var mode = CodeMirror.getMode({indentUnit: 2}, "javascript"); function MT(name) { test.mode(name, mode, Array.prototype.slice.call(arguments, 1)); } MT("locals", "[keyword function] [variable foo]([def a], [def b]) { [keyword var] [def c] [operator =] [number 10]; [keyword return] [variable-2 a] [operator +] [variable-2 c] [operator +] [variable d]; }"); MT("comma-and-binop", "[keyword function](){ [keyword var] [def x] [operator =] [number 1] [operator +] [number 2], [def y]; }"); MT("destructuring", "([keyword function]([def a], [[[def b], [def c] ]]) {", " [keyword let] {[def d], [property foo]: [def c][operator =][number 10], [def x]} [operator =] [variable foo]([variable-2 a]);", " [[[variable-2 c], [variable y] ]] [operator =] [variable-2 c];", "})();"); MT("class", "[keyword class] [variable Point] [keyword extends] [variable SuperThing] {", " [[ [string-2 /expr/] ]]: [number 24],", " [property constructor]([def x], [def y]) {", " [keyword super]([string 'something']);", " [keyword this].[property x] [operator =] [variable-2 x];", " }", "}"); MT("module", "[keyword module] [string 'foo'] {", " [keyword export] [keyword let] [def x] [operator =] [number 42];", " [keyword export] [keyword *] [keyword from] [string 'somewhere'];", "}"); MT("import", "[keyword function] [variable foo]() {", " [keyword import] [def $] [keyword from] [string 'jquery'];", " [keyword module] [def crypto] [keyword from] [string 'crypto'];", " [keyword import] { [def encrypt], [def decrypt] } [keyword from] [string 'crypto'];", "}"); MT("const", "[keyword function] [variable f]() {", " [keyword const] [[ [def a], [def b] ]] [operator =] [[ [number 1], [number 2] ]];", "}"); MT("for/of", "[keyword for]([keyword let] [variable of] [keyword of] [variable something]) {}"); MT("generator", "[keyword function*] [variable repeat]([def n]) {", " [keyword for]([keyword var] [def i] [operator =] [number 0]; [variable-2 i] [operator <] [variable-2 n]; [operator ++][variable-2 i])", " [keyword yield] [variable-2 i];", "}"); MT("fatArrow", "[variable array].[property filter]([def a] [operator =>] [variable-2 a] [operator +] [number 1]);", "[variable a];", // No longer in scope "[keyword let] [variable f] [operator =] ([[ [def a], [def b] ]], [def c]) [operator =>] [variable-2 a] [operator +] [variable-2 c];", "[variable c];"); MT("spread", "[keyword function] [variable f]([def a], [meta ...][def b]) {", " [variable something]([variable-2 a], [meta ...][variable-2 b]);", "}"); MT("comprehension", "[keyword function] [variable f]() {", " [[([variable x] [operator +] [number 1]) [keyword for] ([keyword var] [def x] [keyword in] [variable y]) [keyword if] [variable pred]([variable-2 x]) ]];", " ([variable u] [keyword for] ([keyword var] [def u] [keyword of] [variable generateValues]()) [keyword if] ([variable-2 u].[property color] [operator ===] [string 'blue']));", "}"); MT("quasi", "[variable re][string-2 `fofdlakj${][variable x] [operator +] ([variable re][string-2 `foo`]) [operator +] [number 1][string-2 }fdsa`] [operator +] [number 2]"); MT("indent_statement", "[keyword var] [variable x] [operator =] [number 10]", "[variable x] [operator +=] [variable y] [operator +]", " [atom Infinity]", "[keyword debugger];"); MT("indent_if", "[keyword if] ([number 1])", " [keyword break];", "[keyword else] [keyword if] ([number 2])", " [keyword continue];", "[keyword else]", " [number 10];", "[keyword if] ([number 1]) {", " [keyword break];", "} [keyword else] [keyword if] ([number 2]) {", " [keyword continue];", "} [keyword else] {", " [number 10];", "}"); MT("indent_for", "[keyword for] ([keyword var] [variable i] [operator =] [number 0];", " [variable i] [operator <] [number 100];", " [variable i][operator ++])", " [variable doSomething]([variable i]);", "[keyword debugger];"); MT("indent_c_style", "[keyword function] [variable foo]()", "{", " [keyword debugger];", "}"); MT("multilinestring", "[keyword var] [variable x] [operator =] [string 'foo\\]", "[string bar'];"); MT("scary_regexp", "[string-2 /foo[[/]]bar/];"); var jsonld_mode = CodeMirror.getMode( {indentUnit: 2}, {name: "javascript", jsonld: true} ); function LD(name) { test.mode(name, jsonld_mode, Array.prototype.slice.call(arguments, 1)); } LD("json_ld_keywords", '{', ' [meta "@context"]: {', ' [meta "@base"]: [string "http://example.com"],', ' [meta "@vocab"]: [string "http://xmlns.com/foaf/0.1/"],', ' [property "likesFlavor"]: {', ' [meta "@container"]: [meta "@list"]', ' [meta "@reverse"]: [string "@beFavoriteOf"]', ' },', ' [property "nick"]: { [meta "@container"]: [meta "@set"] },', ' [property "nick"]: { [meta "@container"]: [meta "@index"] }', ' },', ' [meta "@graph"]: [[ {', ' [meta "@id"]: [string "http://dbpedia.org/resource/John_Lennon"],', ' [property "name"]: [string "John Lennon"],', ' [property "modified"]: {', ' [meta "@value"]: [string "2010-05-29T14:17:39+02:00"],', ' [meta "@type"]: [string "http://www.w3.org/2001/XMLSchema#dateTime"]', ' }', ' } ]]', '}'); LD("json_ld_fake", '{', ' [property "@fake"]: [string "@fake"],', ' [property "@contextual"]: [string "@identifier"],', ' [property "[email protected]"]: [string "@graphical"],', ' [property "@ID"]: [string "@@ID"]', '}'); })();
{ "pile_set_name": "Github" }
// cgo -godefs types_netbsd.go | go run mkpost.go // Code generated by the command above; see README.md. DO NOT EDIT. // +build amd64,netbsd package unix const ( sizeofPtr = 0x8 sizeofShort = 0x2 sizeofInt = 0x4 sizeofLong = 0x8 sizeofLongLong = 0x8 ) type ( _C_short int16 _C_int int32 _C_long int64 _C_long_long int64 ) type Timespec struct { Sec int64 Nsec int64 } type Timeval struct { Sec int64 Usec int32 Pad_cgo_0 [4]byte } type Rusage struct { Utime Timeval Stime Timeval Maxrss int64 Ixrss int64 Idrss int64 Isrss int64 Minflt int64 Majflt int64 Nswap int64 Inblock int64 Oublock int64 Msgsnd int64 Msgrcv int64 Nsignals int64 Nvcsw int64 Nivcsw int64 } type Rlimit struct { Cur uint64 Max uint64 } type _Gid_t uint32 type Stat_t struct { Dev uint64 Mode uint32 Pad_cgo_0 [4]byte Ino uint64 Nlink uint32 Uid uint32 Gid uint32 Pad_cgo_1 [4]byte Rdev uint64 Atimespec Timespec Mtimespec Timespec Ctimespec Timespec Birthtimespec Timespec Size int64 Blocks int64 Blksize uint32 Flags uint32 Gen uint32 Spare [2]uint32 Pad_cgo_2 [4]byte } type Statfs_t [0]byte type Flock_t struct { Start int64 Len int64 Pid int32 Type int16 Whence int16 } type Dirent struct { Fileno uint64 Reclen uint16 Namlen uint16 Type uint8 Name [512]int8 Pad_cgo_0 [3]byte } type Fsid struct { X__fsid_val [2]int32 } const ( PathMax = 0x400 ) type RawSockaddrInet4 struct { Len uint8 Family uint8 Port uint16 Addr [4]byte /* in_addr */ Zero [8]int8 } type RawSockaddrInet6 struct { Len uint8 Family uint8 Port uint16 Flowinfo uint32 Addr [16]byte /* in6_addr */ Scope_id uint32 } type RawSockaddrUnix struct { Len uint8 Family uint8 Path [104]int8 } type RawSockaddrDatalink struct { Len uint8 Family uint8 Index uint16 Type uint8 Nlen uint8 Alen uint8 Slen uint8 Data [12]int8 } type RawSockaddr struct { Len uint8 Family uint8 Data [14]int8 } type RawSockaddrAny struct { Addr RawSockaddr Pad [92]int8 } type _Socklen uint32 type Linger struct { Onoff int32 Linger int32 } type Iovec struct { Base *byte Len uint64 } type IPMreq struct { Multiaddr [4]byte /* in_addr */ Interface [4]byte /* in_addr */ } type IPv6Mreq struct { Multiaddr [16]byte /* in6_addr */ Interface uint32 } type Msghdr struct { Name *byte Namelen uint32 Pad_cgo_0 [4]byte Iov *Iovec Iovlen int32 Pad_cgo_1 [4]byte Control *byte Controllen uint32 Flags int32 } type Cmsghdr struct { Len uint32 Level int32 Type int32 } type Inet6Pktinfo struct { Addr [16]byte /* in6_addr */ Ifindex uint32 } type IPv6MTUInfo struct { Addr RawSockaddrInet6 Mtu uint32 } type ICMPv6Filter struct { Filt [8]uint32 } const ( SizeofSockaddrInet4 = 0x10 SizeofSockaddrInet6 = 0x1c SizeofSockaddrAny = 0x6c SizeofSockaddrUnix = 0x6a SizeofSockaddrDatalink = 0x14 SizeofLinger = 0x8 SizeofIPMreq = 0x8 SizeofIPv6Mreq = 0x14 SizeofMsghdr = 0x30 SizeofCmsghdr = 0xc SizeofInet6Pktinfo = 0x14 SizeofIPv6MTUInfo = 0x20 SizeofICMPv6Filter = 0x20 ) const ( PTRACE_TRACEME = 0x0 PTRACE_CONT = 0x7 PTRACE_KILL = 0x8 ) type Kevent_t struct { Ident uint64 Filter uint32 Flags uint32 Fflags uint32 Pad_cgo_0 [4]byte Data int64 Udata int64 } type FdSet struct { Bits [8]uint32 } const ( SizeofIfMsghdr = 0x98 SizeofIfData = 0x88 SizeofIfaMsghdr = 0x18 SizeofIfAnnounceMsghdr = 0x18 SizeofRtMsghdr = 0x78 SizeofRtMetrics = 0x50 ) type IfMsghdr struct { Msglen uint16 Version uint8 Type uint8 Addrs int32 Flags int32 Index uint16 Pad_cgo_0 [2]byte Data IfData } type IfData struct { Type uint8 Addrlen uint8 Hdrlen uint8 Pad_cgo_0 [1]byte Link_state int32 Mtu uint64 Metric uint64 Baudrate uint64 Ipackets uint64 Ierrors uint64 Opackets uint64 Oerrors uint64 Collisions uint64 Ibytes uint64 Obytes uint64 Imcasts uint64 Omcasts uint64 Iqdrops uint64 Noproto uint64 Lastchange Timespec } type IfaMsghdr struct { Msglen uint16 Version uint8 Type uint8 Addrs int32 Flags int32 Metric int32 Index uint16 Pad_cgo_0 [6]byte } type IfAnnounceMsghdr struct { Msglen uint16 Version uint8 Type uint8 Index uint16 Name [16]int8 What uint16 } type RtMsghdr struct { Msglen uint16 Version uint8 Type uint8 Index uint16 Pad_cgo_0 [2]byte Flags int32 Addrs int32 Pid int32 Seq int32 Errno int32 Use int32 Inits int32 Pad_cgo_1 [4]byte Rmx RtMetrics } type RtMetrics struct { Locks uint64 Mtu uint64 Hopcount uint64 Recvpipe uint64 Sendpipe uint64 Ssthresh uint64 Rtt uint64 Rttvar uint64 Expire int64 Pksent int64 } type Mclpool [0]byte const ( SizeofBpfVersion = 0x4 SizeofBpfStat = 0x80 SizeofBpfProgram = 0x10 SizeofBpfInsn = 0x8 SizeofBpfHdr = 0x20 ) type BpfVersion struct { Major uint16 Minor uint16 } type BpfStat struct { Recv uint64 Drop uint64 Capt uint64 Padding [13]uint64 } type BpfProgram struct { Len uint32 Pad_cgo_0 [4]byte Insns *BpfInsn } type BpfInsn struct { Code uint16 Jt uint8 Jf uint8 K uint32 } type BpfHdr struct { Tstamp BpfTimeval Caplen uint32 Datalen uint32 Hdrlen uint16 Pad_cgo_0 [6]byte } type BpfTimeval struct { Sec int64 Usec int64 } type Termios struct { Iflag uint32 Oflag uint32 Cflag uint32 Lflag uint32 Cc [20]uint8 Ispeed int32 Ospeed int32 } type Winsize struct { Row uint16 Col uint16 Xpixel uint16 Ypixel uint16 } const ( AT_FDCWD = -0x64 AT_SYMLINK_NOFOLLOW = 0x200 ) type PollFd struct { Fd int32 Events int16 Revents int16 } const ( POLLERR = 0x8 POLLHUP = 0x10 POLLIN = 0x1 POLLNVAL = 0x20 POLLOUT = 0x4 POLLPRI = 0x2 POLLRDBAND = 0x80 POLLRDNORM = 0x40 POLLWRBAND = 0x100 POLLWRNORM = 0x4 ) type Sysctlnode struct { Flags uint32 Num int32 Name [32]int8 Ver uint32 X__rsvd uint32 Un [16]byte X_sysctl_size [8]byte X_sysctl_func [8]byte X_sysctl_parent [8]byte X_sysctl_desc [8]byte } type Utsname struct { Sysname [256]byte Nodename [256]byte Release [256]byte Version [256]byte Machine [256]byte }
{ "pile_set_name": "Github" }
-- file dummy.vhd package COMPONENTS is component DUMMY_MODULE port (I : in bit; O : out bit); end component; end package; entity DUMMY_MODULE is port (I: in bit; O: out bit); end entity; architecture RTL of DUMMY_MODULE is begin O <= I; end architecture; -- file dummy_top.vhd library DUMMY; use DUMMY.COMPONENTS.DUMMY_MODULE; entity DUMMY_TOP is port (I : in bit; O : out bit); end entity; architecture RTL of DUMMY_TOP is begin U: DUMMY_MODULE port map(I=>I, O=>O); end architecture;
{ "pile_set_name": "Github" }
STARTFONT 2.1 FONT Nimbus10 SIZE 10 78 78 FONTBOUNDINGBOX 9 10 0 -1 COMMENT "Generated by fontforge, http://fontforge.sourceforge.net" COMMENT "" STARTPROPERTIES 7 DEFAULT_CHAR 0 POINT_SIZE 360 FONT_DESCENT 1 FONT_ASCENT 9 COPYRIGHT "Public domain font. Share and enjoy." CHARSET_REGISTRY "ISO10646" CHARSET_ENCODING "1" ENDPROPERTIES CHARS 371 STARTCHAR uni0000 ENCODING 0 SWIDTH 727 0 DWIDTH 8 0 BBX 7 9 1 0 BITMAP AA 00 82 00 82 00 82 00 AA ENDCHAR STARTCHAR space ENCODING 32 SWIDTH 272 0 DWIDTH 3 0 BBX 1 1 0 0 BITMAP 00 ENDCHAR STARTCHAR exclam ENCODING 33 SWIDTH 272 0 DWIDTH 3 0 BBX 2 8 1 0 BITMAP C0 C0 C0 C0 C0 C0 00 C0 ENDCHAR STARTCHAR quotedbl ENCODING 34 SWIDTH 363 0 DWIDTH 4 0 BBX 3 2 1 6 BITMAP A0 A0 ENDCHAR STARTCHAR numbersign ENCODING 35 SWIDTH 727 0 DWIDTH 8 0 BBX 7 8 1 0 BITMAP 14 14 7E 28 28 FC 50 50 ENDCHAR STARTCHAR dollar ENCODING 36 SWIDTH 545 0 DWIDTH 6 0 BBX 5 9 1 0 BITMAP 20 70 A8 E0 70 38 A8 70 20 ENDCHAR STARTCHAR percent ENCODING 37 SWIDTH 909 0 DWIDTH 10 0 BBX 9 8 1 0 BITMAP 6E00 B400 6400 0800 0800 1300 1580 3300 ENDCHAR STARTCHAR ampersand ENCODING 38 SWIDTH 636 0 DWIDTH 7 0 BBX 6 8 1 0 BITMAP 70 D8 D8 60 DC D8 D8 70 ENDCHAR STARTCHAR quotesingle ENCODING 39 SWIDTH 181 0 DWIDTH 2 0 BBX 1 2 1 6 BITMAP 80 80 ENDCHAR STARTCHAR parenleft ENCODING 40 SWIDTH 363 0 DWIDTH 4 0 BBX 3 10 1 -1 BITMAP 20 40 C0 C0 C0 C0 C0 C0 40 20 ENDCHAR STARTCHAR parenright ENCODING 41 SWIDTH 363 0 DWIDTH 4 0 BBX 3 10 1 -1 BITMAP 80 40 60 60 60 60 60 60 40 80 ENDCHAR STARTCHAR asterisk ENCODING 42 SWIDTH 545 0 DWIDTH 6 0 BBX 5 5 1 2 BITMAP 20 A8 70 A8 20 ENDCHAR STARTCHAR plus ENCODING 43 SWIDTH 545 0 DWIDTH 6 0 BBX 5 5 1 2 BITMAP 20 20 F8 20 20 ENDCHAR STARTCHAR comma ENCODING 44 SWIDTH 272 0 DWIDTH 3 0 BBX 3 3 0 -1 BITMAP 60 60 C0 ENDCHAR STARTCHAR hyphen ENCODING 45 SWIDTH 545 0 DWIDTH 6 0 BBX 5 1 1 4 BITMAP F8 ENDCHAR STARTCHAR period ENCODING 46 SWIDTH 272 0 DWIDTH 3 0 BBX 2 2 1 0 BITMAP C0 C0 ENDCHAR STARTCHAR slash ENCODING 47 SWIDTH 545 0 DWIDTH 6 0 BBX 5 9 1 -1 BITMAP 08 18 10 30 20 60 40 C0 80 ENDCHAR STARTCHAR zero ENCODING 48 SWIDTH 545 0 DWIDTH 6 0 BBX 5 8 1 0 BITMAP 70 D8 D8 D8 D8 D8 D8 70 ENDCHAR STARTCHAR one ENCODING 49 SWIDTH 545 0 DWIDTH 6 0 BBX 4 8 1 0 BITMAP 30 70 B0 30 30 30 30 30 ENDCHAR STARTCHAR two ENCODING 50 SWIDTH 545 0 DWIDTH 6 0 BBX 5 8 1 0 BITMAP 70 98 18 30 60 C0 C0 F8 ENDCHAR STARTCHAR three ENCODING 51 SWIDTH 545 0 DWIDTH 6 0 BBX 5 8 1 0 BITMAP F8 30 20 70 18 18 D8 70 ENDCHAR STARTCHAR four ENCODING 52 SWIDTH 545 0 DWIDTH 6 0 BBX 5 8 1 0 BITMAP 18 38 78 D8 D8 F8 18 18 ENDCHAR STARTCHAR five ENCODING 53 SWIDTH 545 0 DWIDTH 6 0 BBX 5 8 1 0 BITMAP F8 C0 F0 18 18 18 D8 70 ENDCHAR STARTCHAR six ENCODING 54 SWIDTH 545 0 DWIDTH 6 0 BBX 5 8 1 0 BITMAP 70 C0 C0 F0 D8 D8 D8 70 ENDCHAR STARTCHAR seven ENCODING 55 SWIDTH 545 0 DWIDTH 6 0 BBX 5 8 1 0 BITMAP F8 18 18 30 60 60 60 60 ENDCHAR STARTCHAR eight ENCODING 56 SWIDTH 545 0 DWIDTH 6 0 BBX 5 8 1 0 BITMAP 70 D8 D8 70 D8 D8 D8 70 ENDCHAR STARTCHAR nine ENCODING 57 SWIDTH 545 0 DWIDTH 6 0 BBX 5 8 1 0 BITMAP 70 D8 D8 D8 78 18 18 70 ENDCHAR STARTCHAR colon ENCODING 58 SWIDTH 272 0 DWIDTH 3 0 BBX 2 6 1 0 BITMAP C0 C0 00 00 C0 C0 ENDCHAR STARTCHAR semicolon ENCODING 59 SWIDTH 272 0 DWIDTH 3 0 BBX 3 7 0 -1 BITMAP 60 60 00 00 60 60 C0 ENDCHAR STARTCHAR less ENCODING 60 SWIDTH 545 0 DWIDTH 6 0 BBX 5 7 1 1 BITMAP 18 30 60 C0 60 30 18 ENDCHAR STARTCHAR equal ENCODING 61 SWIDTH 545 0 DWIDTH 6 0 BBX 5 3 1 3 BITMAP F8 00 F8 ENDCHAR STARTCHAR greater ENCODING 62 SWIDTH 545 0 DWIDTH 6 0 BBX 5 7 1 1 BITMAP C0 60 30 18 30 60 C0 ENDCHAR STARTCHAR question ENCODING 63 SWIDTH 545 0 DWIDTH 6 0 BBX 5 8 1 0 BITMAP 70 98 18 30 60 60 00 60 ENDCHAR STARTCHAR at ENCODING 64 SWIDTH 818 0 DWIDTH 9 0 BBX 8 8 1 0 BITMAP 3C 42 9D A5 A5 9A 40 3E ENDCHAR STARTCHAR A ENCODING 65 SWIDTH 545 0 DWIDTH 6 0 BBX 5 8 1 0 BITMAP 70 D8 D8 D8 F8 D8 D8 D8 ENDCHAR STARTCHAR B ENCODING 66 SWIDTH 545 0 DWIDTH 6 0 BBX 5 8 1 0 BITMAP F0 D8 D8 F0 D8 D8 D8 F0 ENDCHAR STARTCHAR C ENCODING 67 SWIDTH 545 0 DWIDTH 6 0 BBX 5 8 1 0 BITMAP 70 C8 C0 C0 C0 C0 D8 70 ENDCHAR STARTCHAR D ENCODING 68 SWIDTH 545 0 DWIDTH 6 0 BBX 5 8 1 0 BITMAP F0 D8 D8 D8 D8 D8 D8 F0 ENDCHAR STARTCHAR E ENCODING 69 SWIDTH 545 0 DWIDTH 6 0 BBX 5 8 1 0 BITMAP F8 C0 C0 F0 C0 C0 C0 F8 ENDCHAR STARTCHAR F ENCODING 70 SWIDTH 2160 0 DWIDTH 6 0 BBX 5 8 1 0 BITMAP F8 C0 C0 F0 C0 C0 C0 C0 ENDCHAR STARTCHAR G ENCODING 71 SWIDTH 545 0 DWIDTH 6 0 BBX 5 8 1 0 BITMAP 70 D8 C0 C0 D8 D8 D8 78 ENDCHAR STARTCHAR H ENCODING 72 SWIDTH 545 0 DWIDTH 6 0 BBX 5 8 1 0 BITMAP D8 D8 D8 F8 D8 D8 D8 D8 ENDCHAR STARTCHAR I ENCODING 73 SWIDTH 272 0 DWIDTH 3 0 BBX 2 8 1 0 BITMAP C0 C0 C0 C0 C0 C0 C0 C0 ENDCHAR STARTCHAR J ENCODING 74 SWIDTH 545 0 DWIDTH 6 0 BBX 5 8 1 0 BITMAP 18 18 18 18 18 D8 D8 70 ENDCHAR STARTCHAR K ENCODING 75 SWIDTH 636 0 DWIDTH 7 0 BBX 6 8 1 0 BITMAP CC D8 F0 E0 F0 D8 CC CC ENDCHAR STARTCHAR L ENCODING 76 SWIDTH 545 0 DWIDTH 6 0 BBX 5 8 1 0 BITMAP C0 C0 C0 C0 C0 C0 C0 F8 ENDCHAR STARTCHAR M ENCODING 77 SWIDTH 818 0 DWIDTH 9 0 BBX 8 8 1 0 BITMAP 81 C3 E7 FF BB 93 83 83 ENDCHAR STARTCHAR N ENCODING 78 SWIDTH 636 0 DWIDTH 7 0 BBX 6 8 1 0 BITMAP 84 C4 E4 F4 BC 9C 8C 84 ENDCHAR STARTCHAR O ENCODING 79 SWIDTH 545 0 DWIDTH 6 0 BBX 5 8 1 0 BITMAP 70 D8 D8 D8 D8 D8 D8 70 ENDCHAR STARTCHAR P ENCODING 80 SWIDTH 545 0 DWIDTH 6 0 BBX 5 8 1 0 BITMAP F0 D8 D8 D8 F0 C0 C0 C0 ENDCHAR STARTCHAR Q ENCODING 81 SWIDTH 545 0 DWIDTH 6 0 BBX 5 9 1 -1 BITMAP 70 D8 D8 D8 D8 D8 D8 70 18 ENDCHAR STARTCHAR R ENCODING 82 SWIDTH 545 0 DWIDTH 6 0 BBX 5 8 1 0 BITMAP F0 D8 D8 F0 D8 D8 D8 D8 ENDCHAR STARTCHAR S ENCODING 83 SWIDTH 545 0 DWIDTH 6 0 BBX 5 8 1 0 BITMAP 70 C8 C0 60 30 18 D8 70 ENDCHAR STARTCHAR T ENCODING 84 SWIDTH 636 0 DWIDTH 7 0 BBX 6 8 1 0 BITMAP FC 30 30 30 30 30 30 30 ENDCHAR STARTCHAR U ENCODING 85 SWIDTH 545 0 DWIDTH 6 0 BBX 5 8 1 0 BITMAP D8 D8 D8 D8 D8 D8 D8 70 ENDCHAR STARTCHAR V ENCODING 86 SWIDTH 545 0 DWIDTH 6 0 BBX 5 8 1 0 BITMAP D8 D8 D8 D8 D8 D8 D0 E0 ENDCHAR STARTCHAR W ENCODING 87 SWIDTH 818 0 DWIDTH 9 0 BBX 8 8 1 0 BITMAP DB DB DB DB DB DB DA FC ENDCHAR STARTCHAR X ENCODING 88 SWIDTH 545 0 DWIDTH 6 0 BBX 5 8 1 0 BITMAP D8 D8 D8 70 D8 D8 D8 D8 ENDCHAR STARTCHAR Y ENCODING 89 SWIDTH 636 0 DWIDTH 7 0 BBX 6 8 1 0 BITMAP CC CC CC 78 30 30 30 30 ENDCHAR STARTCHAR Z ENCODING 90 SWIDTH 636 0 DWIDTH 7 0 BBX 6 8 1 0 BITMAP FC 0C 18 30 60 C0 C0 FC ENDCHAR STARTCHAR bracketleft ENCODING 91 SWIDTH 363 0 DWIDTH 4 0 BBX 3 9 1 0 BITMAP E0 C0 C0 C0 C0 C0 C0 C0 E0 ENDCHAR STARTCHAR backslash ENCODING 92 SWIDTH 545 0 DWIDTH 6 0 BBX 5 8 1 0 BITMAP 80 C0 40 60 20 30 10 18 ENDCHAR STARTCHAR bracketright ENCODING 93 SWIDTH 363 0 DWIDTH 4 0 BBX 3 9 1 0 BITMAP E0 60 60 60 60 60 60 60 E0 ENDCHAR STARTCHAR asciicircum ENCODING 94 SWIDTH 454 0 DWIDTH 5 0 BBX 4 2 1 7 BITMAP 60 B0 ENDCHAR STARTCHAR underscore ENCODING 95 SWIDTH 636 0 DWIDTH 7 0 BBX 6 1 1 0 BITMAP FC ENDCHAR STARTCHAR grave ENCODING 96 SWIDTH 363 0 DWIDTH 4 0 BBX 3 2 1 7 BITMAP C0 60 ENDCHAR STARTCHAR a ENCODING 97 SWIDTH 545 0 DWIDTH 6 0 BBX 5 6 1 0 BITMAP 70 98 78 D8 D8 78 ENDCHAR STARTCHAR b ENCODING 98 SWIDTH 545 0 DWIDTH 6 0 BBX 5 8 1 0 BITMAP C0 C0 F0 D8 D8 D8 D8 F0 ENDCHAR STARTCHAR c ENCODING 99 SWIDTH 545 0 DWIDTH 6 0 BBX 5 6 1 0 BITMAP 70 C8 C0 C0 C8 70 ENDCHAR STARTCHAR d ENCODING 100 SWIDTH 545 0 DWIDTH 6 0 BBX 5 8 1 0 BITMAP 18 18 78 D8 D8 D8 D8 78 ENDCHAR STARTCHAR e ENCODING 101 SWIDTH 545 0 DWIDTH 6 0 BBX 5 6 1 0 BITMAP 70 D8 F8 C0 C8 70 ENDCHAR STARTCHAR f ENCODING 102 SWIDTH 545 0 DWIDTH 6 0 BBX 5 8 1 0 BITMAP 38 60 F0 60 60 60 60 60 ENDCHAR STARTCHAR g ENCODING 103 SWIDTH 545 0 DWIDTH 6 0 BBX 5 7 1 -1 BITMAP 78 D8 D8 D8 78 18 F0 ENDCHAR STARTCHAR h ENCODING 104 SWIDTH 545 0 DWIDTH 6 0 BBX 5 8 1 0 BITMAP C0 C0 F0 D8 D8 D8 D8 D8 ENDCHAR STARTCHAR i ENCODING 105 SWIDTH 272 0 DWIDTH 3 0 BBX 2 8 1 0 BITMAP C0 00 C0 C0 C0 C0 C0 C0 ENDCHAR STARTCHAR j ENCODING 106 SWIDTH 363 0 DWIDTH 4 0 BBX 4 9 0 -1 BITMAP 30 00 30 30 30 30 30 30 E0 ENDCHAR STARTCHAR k ENCODING 107 SWIDTH 545 0 DWIDTH 6 0 BBX 5 8 1 0 BITMAP C0 C0 D8 F0 E0 F0 D8 D8 ENDCHAR STARTCHAR l ENCODING 108 SWIDTH 272 0 DWIDTH 3 0 BBX 2 8 1 0 BITMAP C0 C0 C0 C0 C0 C0 C0 C0 ENDCHAR STARTCHAR m ENCODING 109 SWIDTH 818 0 DWIDTH 9 0 BBX 8 6 1 0 BITMAP FE DB DB DB DB DB ENDCHAR STARTCHAR n ENCODING 110 SWIDTH 545 0 DWIDTH 6 0 BBX 5 6 1 0 BITMAP F0 D8 D8 D8 D8 D8 ENDCHAR STARTCHAR o ENCODING 111 SWIDTH 545 0 DWIDTH 6 0 BBX 5 6 1 0 BITMAP 70 D8 D8 D8 D8 70 ENDCHAR STARTCHAR p ENCODING 112 SWIDTH 545 0 DWIDTH 6 0 BBX 5 7 1 -1 BITMAP F0 D8 D8 D8 F0 C0 C0 ENDCHAR STARTCHAR q ENCODING 113 SWIDTH 545 0 DWIDTH 6 0 BBX 5 7 1 -1 BITMAP 78 D8 D8 D8 78 18 18 ENDCHAR STARTCHAR r ENCODING 114 SWIDTH 454 0 DWIDTH 5 0 BBX 4 6 1 0 BITMAP D0 F0 C0 C0 C0 C0 ENDCHAR STARTCHAR s ENCODING 115 SWIDTH 545 0 DWIDTH 6 0 BBX 5 6 1 0 BITMAP 70 C8 60 30 D8 70 ENDCHAR STARTCHAR t ENCODING 116 SWIDTH 454 0 DWIDTH 5 0 BBX 4 8 1 0 BITMAP 60 60 F0 60 60 60 60 30 ENDCHAR STARTCHAR u ENCODING 117 SWIDTH 545 0 DWIDTH 6 0 BBX 5 6 1 0 BITMAP D8 D8 D8 D8 D8 78 ENDCHAR STARTCHAR v ENCODING 118 SWIDTH 545 0 DWIDTH 6 0 BBX 5 6 1 0 BITMAP D8 D8 D8 D8 D0 E0 ENDCHAR STARTCHAR w ENCODING 119 SWIDTH 818 0 DWIDTH 9 0 BBX 8 6 1 0 BITMAP DB DB DB DB DA FC ENDCHAR STARTCHAR x ENCODING 120 SWIDTH 545 0 DWIDTH 6 0 BBX 5 6 1 0 BITMAP D8 D8 70 D8 D8 D8 ENDCHAR STARTCHAR y ENCODING 121 SWIDTH 545 0 DWIDTH 6 0 BBX 5 7 1 -1 BITMAP D8 D8 D8 D8 78 18 F0 ENDCHAR STARTCHAR z ENCODING 122 SWIDTH 545 0 DWIDTH 6 0 BBX 5 6 1 0 BITMAP F8 18 30 60 C0 F8 ENDCHAR STARTCHAR braceleft ENCODING 123 SWIDTH 363 0 DWIDTH 4 0 BBX 3 9 1 0 BITMAP 20 40 40 40 80 40 40 40 20 ENDCHAR STARTCHAR bar ENCODING 124 SWIDTH 181 0 DWIDTH 2 0 BBX 1 9 1 0 BITMAP 80 80 80 80 80 80 80 80 80 ENDCHAR STARTCHAR braceright ENCODING 125 SWIDTH 363 0 DWIDTH 4 0 BBX 3 9 1 0 BITMAP 80 40 40 40 20 40 40 40 80 ENDCHAR STARTCHAR asciitilde ENCODING 126 SWIDTH 545 0 DWIDTH 6 0 BBX 5 2 1 6 BITMAP 68 B0 ENDCHAR STARTCHAR exclamdown ENCODING 161 SWIDTH 272 0 DWIDTH 3 0 BBX 2 8 1 0 BITMAP C0 00 C0 C0 C0 C0 C0 C0 ENDCHAR STARTCHAR cent ENCODING 162 SWIDTH 545 0 DWIDTH 6 0 BBX 5 9 1 -1 BITMAP 20 20 70 C8 C0 C0 C8 70 20 ENDCHAR STARTCHAR sterling ENCODING 163 SWIDTH 727 0 DWIDTH 8 0 BBX 7 8 1 0 BITMAP 1C 32 30 78 30 30 72 DE ENDCHAR STARTCHAR currency ENCODING 164 SWIDTH 545 0 DWIDTH 6 0 BBX 5 5 1 2 BITMAP D8 70 50 70 D8 ENDCHAR STARTCHAR yen ENCODING 165 SWIDTH 636 0 DWIDTH 7 0 BBX 6 8 1 0 BITMAP CC CC 78 FC 30 FC 30 30 ENDCHAR STARTCHAR brokenbar ENCODING 166 SWIDTH 181 0 DWIDTH 2 0 BBX 1 9 1 0 BITMAP 80 80 80 00 00 00 80 80 80 ENDCHAR STARTCHAR section ENCODING 167 SWIDTH 545 0 DWIDTH 6 0 BBX 5 9 1 -1 BITMAP 70 C8 C0 70 D8 D8 70 18 F0 ENDCHAR STARTCHAR dieresis ENCODING 168 SWIDTH 454 0 DWIDTH 5 0 BBX 4 1 1 8 BITMAP 90 ENDCHAR STARTCHAR copyright ENCODING 169 SWIDTH 909 0 DWIDTH 10 0 BBX 9 9 1 0 BITMAP 3E00 4100 9C80 B280 B080 B280 9C80 4100 3E00 ENDCHAR STARTCHAR ordfeminine ENCODING 170 SWIDTH 454 0 DWIDTH 5 0 BBX 4 6 1 2 BITMAP E0 10 F0 D0 00 F0 ENDCHAR STARTCHAR guillemotleft ENCODING 171 SWIDTH 636 0 DWIDTH 7 0 BBX 6 5 1 2 BITMAP 24 48 90 48 24 ENDCHAR STARTCHAR logicalnot ENCODING 172 SWIDTH 545 0 DWIDTH 6 0 BBX 5 3 1 3 BITMAP F8 08 08 ENDCHAR STARTCHAR uni00AD ENCODING 173 SWIDTH 454 0 DWIDTH 5 0 BBX 4 1 1 4 BITMAP F0 ENDCHAR STARTCHAR registered ENCODING 174 SWIDTH 909 0 DWIDTH 10 0 BBX 9 9 1 0 BITMAP 3E00 4100 BC80 B680 BC80 B680 B680 4100 3E00 ENDCHAR STARTCHAR macron ENCODING 175 SWIDTH 636 0 DWIDTH 7 0 BBX 7 1 0 8 BITMAP FE ENDCHAR STARTCHAR degree ENCODING 176 SWIDTH 454 0 DWIDTH 5 0 BBX 4 3 1 5 BITMAP 60 B0 60 ENDCHAR STARTCHAR plusminus ENCODING 177 SWIDTH 545 0 DWIDTH 6 0 BBX 5 7 1 1 BITMAP 20 20 F8 20 20 00 F8 ENDCHAR STARTCHAR uni00B2 ENCODING 178 SWIDTH 454 0 DWIDTH 5 0 BBX 4 4 1 4 BITMAP E0 30 60 F0 ENDCHAR STARTCHAR uni00B3 ENCODING 179 SWIDTH 454 0 DWIDTH 5 0 BBX 4 4 1 4 BITMAP F0 60 30 E0 ENDCHAR STARTCHAR acute ENCODING 180 SWIDTH 363 0 DWIDTH 4 0 BBX 3 2 1 7 BITMAP 60 C0 ENDCHAR STARTCHAR uni00B5 ENCODING 181 SWIDTH 545 0 DWIDTH 6 0 BBX 5 7 1 -1 BITMAP D8 D8 D8 D8 E8 C0 C0 ENDCHAR STARTCHAR paragraph ENCODING 182 SWIDTH 818 0 DWIDTH 9 0 BBX 8 10 1 -1 BITMAP 7F F6 F6 F6 76 36 36 36 36 36 ENDCHAR STARTCHAR periodcentered ENCODING 183 SWIDTH 272 0 DWIDTH 3 0 BBX 2 2 1 3 BITMAP C0 C0 ENDCHAR STARTCHAR cedilla ENCODING 184 SWIDTH 363 0 DWIDTH 4 0 BBX 3 3 1 -1 BITMAP 40 20 C0 ENDCHAR STARTCHAR uni00B9 ENCODING 185 SWIDTH 363 0 DWIDTH 4 0 BBX 2 4 1 4 BITMAP 40 C0 40 40 ENDCHAR STARTCHAR ordmasculine ENCODING 186 SWIDTH 454 0 DWIDTH 5 0 BBX 4 6 1 2 BITMAP 60 90 90 60 00 F0 ENDCHAR STARTCHAR guillemotright ENCODING 187 SWIDTH 636 0 DWIDTH 7 0 BBX 6 5 1 2 BITMAP 90 48 24 48 90 ENDCHAR STARTCHAR onequarter ENCODING 188 SWIDTH 818 0 DWIDTH 9 0 BBX 8 9 1 0 BITMAP 62 E2 64 68 08 13 27 2F 43 ENDCHAR STARTCHAR onehalf ENCODING 189 SWIDTH 818 0 DWIDTH 9 0 BBX 8 9 1 0 BITMAP 62 E2 64 68 08 1E 23 26 4F ENDCHAR STARTCHAR threequarters ENCODING 190 SWIDTH 818 0 DWIDTH 9 0 BBX 8 9 1 0 BITMAP F2 62 34 E8 08 13 27 2F 43 ENDCHAR STARTCHAR questiondown ENCODING 191 SWIDTH 545 0 DWIDTH 6 0 BBX 5 8 1 0 BITMAP 30 00 30 30 60 C0 C8 70 ENDCHAR STARTCHAR Agrave ENCODING 192 SWIDTH 545 0 DWIDTH 6 0 BBX 5 9 1 0 BITMAP 60 20 70 D8 D8 F8 D8 D8 D8 ENDCHAR STARTCHAR Aacute ENCODING 193 SWIDTH 545 0 DWIDTH 6 0 BBX 5 9 1 0 BITMAP 30 20 70 D8 D8 F8 D8 D8 D8 ENDCHAR STARTCHAR Acircumflex ENCODING 194 SWIDTH 545 0 DWIDTH 6 0 BBX 5 9 1 0 BITMAP 70 88 70 D8 D8 F8 D8 D8 D8 ENDCHAR STARTCHAR Atilde ENCODING 195 SWIDTH 545 0 DWIDTH 6 0 BBX 5 9 1 0 BITMAP 68 B0 70 D8 D8 F8 D8 D8 D8 ENDCHAR STARTCHAR Adieresis ENCODING 196 SWIDTH 545 0 DWIDTH 6 0 BBX 5 9 1 0 BITMAP 50 00 70 D8 D8 F8 D8 D8 D8 ENDCHAR STARTCHAR Aring ENCODING 197 SWIDTH 545 0 DWIDTH 6 0 BBX 5 9 1 0 BITMAP 30 58 70 D8 D8 F8 D8 D8 D8 ENDCHAR STARTCHAR AE ENCODING 198 SWIDTH 818 0 DWIDTH 9 0 BBX 8 8 1 0 BITMAP 7F D8 D8 DE F8 D8 D8 DF ENDCHAR STARTCHAR Ccedilla ENCODING 199 SWIDTH 545 0 DWIDTH 6 0 BBX 5 9 1 -1 BITMAP 70 C8 C0 C0 C0 C0 D8 70 C0 ENDCHAR STARTCHAR Egrave ENCODING 200 SWIDTH 545 0 DWIDTH 6 0 BBX 5 9 1 0 BITMAP 60 20 F8 C0 C0 F0 C0 C0 F8 ENDCHAR STARTCHAR Eacute ENCODING 201 SWIDTH 545 0 DWIDTH 6 0 BBX 5 9 1 0 BITMAP 30 20 F8 C0 C0 F0 C0 C0 F8 ENDCHAR STARTCHAR Ecircumflex ENCODING 202 SWIDTH 545 0 DWIDTH 6 0 BBX 5 9 1 0 BITMAP 70 88 F8 C0 C0 F0 C0 C0 F8 ENDCHAR STARTCHAR Edieresis ENCODING 203 SWIDTH 545 0 DWIDTH 6 0 BBX 5 9 1 0 BITMAP 50 00 F8 C0 C0 F0 C0 C0 F8 ENDCHAR STARTCHAR Igrave ENCODING 204 SWIDTH 272 0 DWIDTH 3 0 BBX 2 9 1 0 BITMAP C0 40 C0 C0 C0 C0 C0 C0 C0 ENDCHAR STARTCHAR Iacute ENCODING 205 SWIDTH 272 0 DWIDTH 3 0 BBX 2 9 1 0 BITMAP C0 80 C0 C0 C0 C0 C0 C0 C0 ENDCHAR STARTCHAR Icircumflex ENCODING 206 SWIDTH 454 0 DWIDTH 5 0 BBX 4 9 1 0 BITMAP 60 90 60 60 60 60 60 60 60 ENDCHAR STARTCHAR Idieresis ENCODING 207 SWIDTH 454 0 DWIDTH 5 0 BBX 4 9 1 0 BITMAP 90 00 60 60 60 60 60 60 60 ENDCHAR STARTCHAR Eth ENCODING 208 SWIDTH 636 0 DWIDTH 7 0 BBX 6 8 1 0 BITMAP 78 6C 6C EC 6C 6C 6C 78 ENDCHAR STARTCHAR Ntilde ENCODING 209 SWIDTH 545 0 DWIDTH 6 0 BBX 5 9 1 0 BITMAP 68 B0 88 C8 E8 F8 B8 98 88 ENDCHAR STARTCHAR Ograve ENCODING 210 SWIDTH 545 0 DWIDTH 6 0 BBX 5 9 1 0 BITMAP 60 20 70 D8 D8 D8 D8 D8 70 ENDCHAR STARTCHAR Oacute ENCODING 211 SWIDTH 545 0 DWIDTH 6 0 BBX 5 9 1 0 BITMAP 30 20 70 D8 D8 D8 D8 D8 70 ENDCHAR STARTCHAR Ocircumflex ENCODING 212 SWIDTH 545 0 DWIDTH 6 0 BBX 5 9 1 0 BITMAP 70 88 70 D8 D8 D8 D8 D8 70 ENDCHAR STARTCHAR Otilde ENCODING 213 SWIDTH 545 0 DWIDTH 6 0 BBX 5 9 1 0 BITMAP 68 B0 70 D8 D8 D8 D8 D8 70 ENDCHAR STARTCHAR Odieresis ENCODING 214 SWIDTH 545 0 DWIDTH 6 0 BBX 5 9 1 0 BITMAP 50 00 70 D8 D8 D8 D8 D8 70 ENDCHAR STARTCHAR multiply ENCODING 215 SWIDTH 545 0 DWIDTH 6 0 BBX 5 5 1 2 BITMAP 88 50 20 50 88 ENDCHAR STARTCHAR Oslash ENCODING 216 SWIDTH 545 0 DWIDTH 6 0 BBX 5 9 1 0 BITMAP 08 70 D8 D8 F8 D8 D8 70 80 ENDCHAR STARTCHAR Ugrave ENCODING 217 SWIDTH 545 0 DWIDTH 6 0 BBX 5 9 1 0 BITMAP 60 20 D8 D8 D8 D8 D8 D8 70 ENDCHAR STARTCHAR Uacute ENCODING 218 SWIDTH 545 0 DWIDTH 6 0 BBX 5 9 1 0 BITMAP 30 20 D8 D8 D8 D8 D8 D8 70 ENDCHAR STARTCHAR Ucircumflex ENCODING 219 SWIDTH 545 0 DWIDTH 6 0 BBX 5 9 1 0 BITMAP 70 88 D8 D8 D8 D8 D8 D8 70 ENDCHAR STARTCHAR Udieresis ENCODING 220 SWIDTH 545 0 DWIDTH 6 0 BBX 5 9 1 0 BITMAP 50 00 D8 D8 D8 D8 D8 D8 70 ENDCHAR STARTCHAR Yacute ENCODING 221 SWIDTH 636 0 DWIDTH 7 0 BBX 6 9 1 0 BITMAP 30 20 CC CC CC 78 30 30 30 ENDCHAR STARTCHAR Thorn ENCODING 222 SWIDTH 545 0 DWIDTH 6 0 BBX 5 8 1 0 BITMAP C0 C0 F0 D8 D8 F0 C0 C0 ENDCHAR STARTCHAR germandbls ENCODING 223 SWIDTH 545 0 DWIDTH 6 0 BBX 5 9 1 -1 BITMAP 70 D8 D8 F0 D8 D8 D8 F0 80 ENDCHAR STARTCHAR agrave ENCODING 224 SWIDTH 545 0 DWIDTH 6 0 BBX 5 9 1 0 BITMAP 60 20 00 70 98 78 D8 D8 78 ENDCHAR STARTCHAR aacute ENCODING 225 SWIDTH 545 0 DWIDTH 6 0 BBX 5 9 1 0 BITMAP 30 20 00 70 98 78 D8 D8 78 ENDCHAR STARTCHAR acircumflex ENCODING 226 SWIDTH 545 0 DWIDTH 6 0 BBX 5 9 1 0 BITMAP 30 58 00 70 98 78 D8 D8 78 ENDCHAR STARTCHAR atilde ENCODING 227 SWIDTH 545 0 DWIDTH 6 0 BBX 5 9 1 0 BITMAP 68 B0 00 70 98 78 D8 D8 78 ENDCHAR STARTCHAR adieresis ENCODING 228 SWIDTH 545 0 DWIDTH 6 0 BBX 5 8 1 0 BITMAP 50 00 70 98 78 D8 D8 78 ENDCHAR STARTCHAR aring ENCODING 229 SWIDTH 545 0 DWIDTH 6 0 BBX 5 9 1 0 BITMAP 30 58 30 70 98 78 D8 D8 78 ENDCHAR STARTCHAR ae ENCODING 230 SWIDTH 909 0 DWIDTH 10 0 BBX 9 6 1 0 BITMAP 7700 9D80 7F80 DC00 DC80 7700 ENDCHAR STARTCHAR ccedilla ENCODING 231 SWIDTH 545 0 DWIDTH 6 0 BBX 5 7 1 -1 BITMAP 70 C8 C0 C0 C8 70 C0 ENDCHAR STARTCHAR egrave ENCODING 232 SWIDTH 545 0 DWIDTH 6 0 BBX 5 9 1 0 BITMAP 60 20 00 70 D8 F8 C0 C8 70 ENDCHAR STARTCHAR eacute ENCODING 233 SWIDTH 545 0 DWIDTH 6 0 BBX 5 9 1 0 BITMAP 30 20 00 70 D8 F8 C0 C8 70 ENDCHAR STARTCHAR ecircumflex ENCODING 234 SWIDTH 545 0 DWIDTH 6 0 BBX 5 9 1 0 BITMAP 30 58 00 70 D8 F8 C0 C8 70 ENDCHAR STARTCHAR edieresis ENCODING 235 SWIDTH 545 0 DWIDTH 6 0 BBX 5 8 1 0 BITMAP 50 00 70 D8 F8 C0 C8 70 ENDCHAR STARTCHAR igrave ENCODING 236 SWIDTH 272 0 DWIDTH 3 0 BBX 2 9 1 0 BITMAP C0 40 00 C0 C0 C0 C0 C0 C0 ENDCHAR STARTCHAR iacute ENCODING 237 SWIDTH 272 0 DWIDTH 3 0 BBX 2 9 1 0 BITMAP C0 80 00 C0 C0 C0 C0 C0 C0 ENDCHAR STARTCHAR icircumflex ENCODING 238 SWIDTH 307 0 DWIDTH 4 0 BBX 4 9 0 0 BITMAP 60 B0 00 60 60 60 60 60 60 ENDCHAR STARTCHAR idieresis ENCODING 239 SWIDTH 307 0 DWIDTH 4 0 BBX 4 8 0 0 BITMAP 90 00 60 60 60 60 60 60 ENDCHAR STARTCHAR eth ENCODING 240 SWIDTH 545 0 DWIDTH 6 0 BBX 5 9 1 0 BITMAP 68 30 58 18 78 D8 D8 D8 70 ENDCHAR STARTCHAR ntilde ENCODING 241 SWIDTH 545 0 DWIDTH 6 0 BBX 5 9 1 0 BITMAP 68 B0 00 F0 D8 D8 D8 D8 D8 ENDCHAR STARTCHAR ograve ENCODING 242 SWIDTH 545 0 DWIDTH 6 0 BBX 5 9 1 0 BITMAP 60 20 00 70 D8 D8 D8 D8 70 ENDCHAR STARTCHAR oacute ENCODING 243 SWIDTH 545 0 DWIDTH 6 0 BBX 5 9 1 0 BITMAP 30 20 00 70 D8 D8 D8 D8 70 ENDCHAR STARTCHAR ocircumflex ENCODING 244 SWIDTH 545 0 DWIDTH 6 0 BBX 5 9 1 0 BITMAP 30 58 00 70 D8 D8 D8 D8 70 ENDCHAR STARTCHAR otilde ENCODING 245 SWIDTH 545 0 DWIDTH 6 0 BBX 5 9 1 0 BITMAP 68 B0 00 70 D8 D8 D8 D8 70 ENDCHAR STARTCHAR odieresis ENCODING 246 SWIDTH 545 0 DWIDTH 6 0 BBX 5 8 1 0 BITMAP 50 00 70 D8 D8 D8 D8 70 ENDCHAR STARTCHAR divide ENCODING 247 SWIDTH 545 0 DWIDTH 6 0 BBX 5 5 1 1 BITMAP 20 00 F8 00 20 ENDCHAR STARTCHAR oslash ENCODING 248 SWIDTH 545 0 DWIDTH 6 0 BBX 5 9 1 -1 BITMAP 08 10 70 D8 F8 D8 D8 70 80 ENDCHAR STARTCHAR ugrave ENCODING 249 SWIDTH 545 0 DWIDTH 6 0 BBX 5 9 1 0 BITMAP 60 20 00 D8 D8 D8 D8 D8 78 ENDCHAR STARTCHAR uacute ENCODING 250 SWIDTH 545 0 DWIDTH 6 0 BBX 5 9 1 0 BITMAP 30 20 00 D8 D8 D8 D8 D8 78 ENDCHAR STARTCHAR ucircumflex ENCODING 251 SWIDTH 545 0 DWIDTH 6 0 BBX 5 9 1 0 BITMAP 30 58 00 D8 D8 D8 D8 D8 78 ENDCHAR STARTCHAR udieresis ENCODING 252 SWIDTH 545 0 DWIDTH 6 0 BBX 5 8 1 0 BITMAP 50 00 D8 D8 D8 D8 D8 78 ENDCHAR STARTCHAR yacute ENCODING 253 SWIDTH 545 0 DWIDTH 6 0 BBX 5 10 1 -1 BITMAP 30 20 00 D8 D8 D8 D8 78 18 F0 ENDCHAR STARTCHAR thorn ENCODING 254 SWIDTH 545 0 DWIDTH 6 0 BBX 5 9 1 -1 BITMAP C0 C0 F0 D8 D8 D8 F0 C0 C0 ENDCHAR STARTCHAR ydieresis ENCODING 255 SWIDTH 545 0 DWIDTH 6 0 BBX 5 9 1 -1 BITMAP 50 00 D8 D8 D8 D8 78 18 F0 ENDCHAR STARTCHAR tonos ENCODING 900 SWIDTH 272 0 DWIDTH 3 0 BBX 2 2 1 7 BITMAP C0 80 ENDCHAR STARTCHAR dieresistonos ENCODING 901 SWIDTH 454 0 DWIDTH 5 0 BBX 4 3 1 6 BITMAP 60 40 90 ENDCHAR STARTCHAR Alphatonos ENCODING 902 SWIDTH 727 0 DWIDTH 8 0 BBX 7 9 1 0 BITMAP 80 9C 36 36 36 3E 36 36 36 ENDCHAR STARTCHAR anoteleia ENCODING 903 SWIDTH 272 0 DWIDTH 3 0 BBX 2 2 1 3 BITMAP C0 C0 ENDCHAR STARTCHAR Epsilontonos ENCODING 904 SWIDTH 727 0 DWIDTH 8 0 BBX 7 9 1 0 BITMAP 80 BE 30 30 3C 30 30 30 3E ENDCHAR STARTCHAR Etatonos ENCODING 905 SWIDTH 727 0 DWIDTH 8 0 BBX 7 9 1 0 BITMAP 80 B6 36 36 3E 36 36 36 36 ENDCHAR STARTCHAR Iotatonos ENCODING 906 SWIDTH 454 0 DWIDTH 5 0 BBX 4 9 1 0 BITMAP 80 B0 30 30 30 30 30 30 30 ENDCHAR STARTCHAR Omicrontonos ENCODING 908 SWIDTH 727 0 DWIDTH 8 0 BBX 7 9 1 0 BITMAP 80 9C 36 36 36 36 36 36 1C ENDCHAR STARTCHAR Upsilontonos ENCODING 910 SWIDTH 818 0 DWIDTH 9 0 BBX 8 9 1 0 BITMAP 80 B3 33 33 1E 0C 0C 0C 0C ENDCHAR STARTCHAR Omegatonos ENCODING 911 SWIDTH 909 0 DWIDTH 10 0 BBX 9 9 1 0 BITMAP 8000 9F00 3180 3180 3180 3180 1B00 0A00 3B80 ENDCHAR STARTCHAR iotadieresistonos ENCODING 912 SWIDTH 1000 0 DWIDTH 4 0 BBX 4 9 0 0 BITMAP 30 20 90 60 60 60 60 60 60 ENDCHAR STARTCHAR Alpha ENCODING 913 SWIDTH 545 0 DWIDTH 6 0 BBX 5 8 1 0 BITMAP 70 D8 D8 D8 F8 D8 D8 D8 ENDCHAR STARTCHAR Beta ENCODING 914 SWIDTH 545 0 DWIDTH 6 0 BBX 5 8 1 0 BITMAP F0 D8 D8 F0 D8 D8 D8 F0 ENDCHAR STARTCHAR Gamma ENCODING 915 SWIDTH 1000 0 DWIDTH 6 0 BBX 5 8 1 0 BITMAP F8 C0 C0 C0 C0 C0 C0 C0 ENDCHAR STARTCHAR Delta ENCODING 916 SWIDTH 818 0 DWIDTH 9 0 BBX 8 8 1 0 BITMAP 18 18 3C 2C 6E 46 C7 FF ENDCHAR STARTCHAR Epsilon ENCODING 917 SWIDTH 545 0 DWIDTH 6 0 BBX 5 8 1 0 BITMAP F8 C0 C0 F0 C0 C0 C0 F8 ENDCHAR STARTCHAR Zeta ENCODING 918 SWIDTH 636 0 DWIDTH 7 0 BBX 6 8 1 0 BITMAP FC 0C 18 30 60 C0 C0 FC ENDCHAR STARTCHAR Eta ENCODING 919 SWIDTH 545 0 DWIDTH 6 0 BBX 5 8 1 0 BITMAP D8 D8 D8 F8 D8 D8 D8 D8 ENDCHAR STARTCHAR Theta ENCODING 920 SWIDTH 636 0 DWIDTH 7 0 BBX 6 8 1 0 BITMAP 78 CC CC FC CC CC CC 78 ENDCHAR STARTCHAR Iota ENCODING 921 SWIDTH 272 0 DWIDTH 3 0 BBX 2 8 1 0 BITMAP C0 C0 C0 C0 C0 C0 C0 C0 ENDCHAR STARTCHAR Kappa ENCODING 922 SWIDTH 636 0 DWIDTH 7 0 BBX 6 8 1 0 BITMAP CC D8 F0 E0 F0 D8 CC CC ENDCHAR STARTCHAR Lambda ENCODING 923 SWIDTH 818 0 DWIDTH 9 0 BBX 8 8 1 0 BITMAP 18 18 3C 2C 6E 46 C7 C3 ENDCHAR STARTCHAR Mu ENCODING 924 SWIDTH 818 0 DWIDTH 9 0 BBX 8 8 1 0 BITMAP 81 C3 E7 FF BB 93 83 83 ENDCHAR STARTCHAR Nu ENCODING 925 SWIDTH 636 0 DWIDTH 7 0 BBX 6 8 1 0 BITMAP 84 C4 E4 F4 BC 9C 8C 84 ENDCHAR STARTCHAR Xi ENCODING 926 SWIDTH 545 0 DWIDTH 6 0 BBX 5 8 1 0 BITMAP F8 00 00 70 00 00 00 F8 ENDCHAR STARTCHAR Omicron ENCODING 927 SWIDTH 545 0 DWIDTH 6 0 BBX 5 8 1 0 BITMAP 70 D8 D8 D8 D8 D8 D8 70 ENDCHAR STARTCHAR Pi ENCODING 928 SWIDTH 545 0 DWIDTH 6 0 BBX 5 8 1 0 BITMAP F8 D8 D8 D8 D8 D8 D8 D8 ENDCHAR STARTCHAR Rho ENCODING 929 SWIDTH 545 0 DWIDTH 6 0 BBX 5 8 1 0 BITMAP F0 D8 D8 D8 F0 C0 C0 C0 ENDCHAR STARTCHAR Sigma ENCODING 931 SWIDTH 545 0 DWIDTH 6 0 BBX 5 8 1 0 BITMAP F8 C0 60 30 60 C0 C8 F8 ENDCHAR STARTCHAR Tau ENCODING 932 SWIDTH 636 0 DWIDTH 7 0 BBX 6 8 1 0 BITMAP FC 30 30 30 30 30 30 30 ENDCHAR STARTCHAR Upsilon ENCODING 933 SWIDTH 636 0 DWIDTH 7 0 BBX 6 8 1 0 BITMAP CC CC CC 78 30 30 30 30 ENDCHAR STARTCHAR Phi ENCODING 934 SWIDTH 818 0 DWIDTH 9 0 BBX 8 8 1 0 BITMAP 18 7E DB DB DB DB 7E 18 ENDCHAR STARTCHAR Chi ENCODING 935 SWIDTH 545 0 DWIDTH 6 0 BBX 5 8 1 0 BITMAP D8 D8 D8 70 D8 D8 D8 D8 ENDCHAR STARTCHAR Psi ENCODING 936 SWIDTH 818 0 DWIDTH 9 0 BBX 8 8 1 0 BITMAP DB DB DB DB 7E 18 18 18 ENDCHAR STARTCHAR Omega ENCODING 937 SWIDTH 727 0 DWIDTH 8 0 BBX 7 8 1 0 BITMAP 7C C6 C6 C6 C6 6C 28 EE ENDCHAR STARTCHAR Iotadieresis ENCODING 938 SWIDTH 1000 0 DWIDTH 4 0 BBX 4 9 0 0 BITMAP 90 00 60 60 60 60 60 60 60 ENDCHAR STARTCHAR Upsilondieresis ENCODING 939 SWIDTH 636 0 DWIDTH 7 0 BBX 6 9 1 0 BITMAP 48 00 CC CC CC 78 30 30 30 ENDCHAR STARTCHAR alphatonos ENCODING 940 SWIDTH 636 0 DWIDTH 7 0 BBX 6 9 1 0 BITMAP 30 20 00 6C D8 D8 D8 D8 74 ENDCHAR STARTCHAR epsilontonos ENCODING 941 SWIDTH 545 0 DWIDTH 6 0 BBX 5 9 1 0 BITMAP 30 20 00 70 C8 60 C0 C8 70 ENDCHAR STARTCHAR etatonos ENCODING 942 SWIDTH 545 0 DWIDTH 6 0 BBX 5 10 1 -1 BITMAP 30 20 00 F0 D8 D8 D8 D8 D8 18 ENDCHAR STARTCHAR iotatonos ENCODING 943 SWIDTH 272 0 DWIDTH 3 0 BBX 2 9 1 0 BITMAP C0 80 00 C0 C0 C0 C0 C0 C0 ENDCHAR STARTCHAR upsilondieresistonos ENCODING 944 SWIDTH 545 0 DWIDTH 6 0 BBX 5 9 1 0 BITMAP 30 20 88 00 D8 D8 D8 D8 70 ENDCHAR STARTCHAR alpha ENCODING 945 SWIDTH 636 0 DWIDTH 7 0 BBX 6 6 1 0 BITMAP 6C D8 D8 D8 D8 74 ENDCHAR STARTCHAR beta ENCODING 946 SWIDTH 545 0 DWIDTH 6 0 BBX 5 9 1 -1 BITMAP 70 D8 D8 F0 D8 D8 D8 F0 C0 ENDCHAR STARTCHAR gamma ENCODING 947 SWIDTH 636 0 DWIDTH 7 0 BBX 6 7 1 -1 BITMAP CC CC CC CC 78 30 30 ENDCHAR STARTCHAR delta ENCODING 948 SWIDTH 545 0 DWIDTH 6 0 BBX 5 8 1 0 BITMAP 78 C0 70 D8 D8 D8 D8 70 ENDCHAR STARTCHAR epsilon ENCODING 949 SWIDTH 545 0 DWIDTH 6 0 BBX 5 6 1 0 BITMAP 70 C8 60 C0 C8 70 ENDCHAR STARTCHAR zeta ENCODING 950 SWIDTH 461 0 DWIDTH 6 0 BBX 5 9 1 -1 BITMAP F0 20 40 C0 C0 C0 70 18 30 ENDCHAR STARTCHAR eta ENCODING 951 SWIDTH 545 0 DWIDTH 6 0 BBX 5 7 1 -1 BITMAP F0 D8 D8 D8 D8 D8 18 ENDCHAR STARTCHAR theta ENCODING 952 SWIDTH 545 0 DWIDTH 6 0 BBX 5 8 1 0 BITMAP 70 D8 D8 F8 D8 D8 D8 70 ENDCHAR STARTCHAR iota ENCODING 953 SWIDTH 272 0 DWIDTH 3 0 BBX 2 6 1 0 BITMAP C0 C0 C0 C0 C0 C0 ENDCHAR STARTCHAR kappa ENCODING 954 SWIDTH 545 0 DWIDTH 6 0 BBX 5 6 1 0 BITMAP D8 D8 F0 D0 D8 D8 ENDCHAR STARTCHAR lambda ENCODING 955 SWIDTH 636 0 DWIDTH 7 0 BBX 6 8 1 0 BITMAP 60 20 30 30 78 58 CC CC ENDCHAR STARTCHAR mu ENCODING 956 SWIDTH 545 0 DWIDTH 6 0 BBX 5 7 1 -1 BITMAP D8 D8 D8 D8 E8 C0 C0 ENDCHAR STARTCHAR nu ENCODING 957 SWIDTH 545 0 DWIDTH 6 0 BBX 5 6 1 0 BITMAP D8 D8 D8 D8 D0 E0 ENDCHAR STARTCHAR xi ENCODING 958 SWIDTH 461 0 DWIDTH 6 0 BBX 5 9 1 -1 BITMAP 70 C0 C0 70 C0 C0 70 18 30 ENDCHAR STARTCHAR omicron ENCODING 959 SWIDTH 545 0 DWIDTH 6 0 BBX 5 6 1 0 BITMAP 70 D8 D8 D8 D8 70 ENDCHAR STARTCHAR pi ENCODING 960 SWIDTH 727 0 DWIDTH 8 0 BBX 7 6 1 0 BITMAP FE 6C 6C 6C 6C 6C ENDCHAR STARTCHAR rho ENCODING 961 SWIDTH 545 0 DWIDTH 6 0 BBX 5 7 1 -1 BITMAP 70 D8 D8 D8 F0 C0 C0 ENDCHAR STARTCHAR sigma1 ENCODING 962 SWIDTH 461 0 DWIDTH 6 0 BBX 5 7 1 -1 BITMAP 70 C0 C0 C0 70 18 30 ENDCHAR STARTCHAR sigma ENCODING 963 SWIDTH 636 0 DWIDTH 7 0 BBX 6 6 1 0 BITMAP 7C D8 D8 D8 D8 70 ENDCHAR STARTCHAR tau ENCODING 964 SWIDTH 636 0 DWIDTH 7 0 BBX 6 6 1 0 BITMAP FC 30 30 30 30 30 ENDCHAR STARTCHAR upsilon ENCODING 965 SWIDTH 545 0 DWIDTH 6 0 BBX 5 6 1 0 BITMAP D8 D8 D8 D8 D8 70 ENDCHAR STARTCHAR phi ENCODING 966 SWIDTH 818 0 DWIDTH 9 0 BBX 8 9 1 -1 BITMAP 18 18 7E DB DB DB 7E 18 18 ENDCHAR STARTCHAR chi ENCODING 967 SWIDTH 545 0 DWIDTH 6 0 BBX 5 7 1 -1 BITMAP D8 D8 D8 70 D8 D8 D8 ENDCHAR STARTCHAR psi ENCODING 968 SWIDTH 818 0 DWIDTH 9 0 BBX 8 7 1 -1 BITMAP DB DB DB DB 7E 18 18 ENDCHAR STARTCHAR omega ENCODING 969 SWIDTH 818 0 DWIDTH 9 0 BBX 8 6 1 0 BITMAP 66 C3 DB DB DB 6E ENDCHAR STARTCHAR iotadieresis ENCODING 970 SWIDTH 1000 0 DWIDTH 4 0 BBX 4 8 0 0 BITMAP 90 00 60 60 60 60 60 60 ENDCHAR STARTCHAR upsilondieresis ENCODING 971 SWIDTH 545 0 DWIDTH 6 0 BBX 5 8 1 0 BITMAP 50 00 D8 D8 D8 D8 D8 70 ENDCHAR STARTCHAR omicrontonos ENCODING 972 SWIDTH 545 0 DWIDTH 6 0 BBX 5 9 1 0 BITMAP 30 20 00 70 D8 D8 D8 D8 70 ENDCHAR STARTCHAR upsilontonos ENCODING 973 SWIDTH 545 0 DWIDTH 6 0 BBX 5 9 1 0 BITMAP 30 20 00 D8 D8 D8 D8 D8 70 ENDCHAR STARTCHAR omegatonos ENCODING 974 SWIDTH 818 0 DWIDTH 9 0 BBX 8 9 1 0 BITMAP 0C 08 00 66 C3 DB DB DB 6E ENDCHAR STARTCHAR afii10023 ENCODING 1025 SWIDTH 545 0 DWIDTH 6 0 BBX 5 9 1 0 BITMAP 50 00 F8 C0 C0 F0 C0 C0 F8 ENDCHAR STARTCHAR afii10017 ENCODING 1040 SWIDTH 545 0 DWIDTH 6 0 BBX 5 8 1 0 BITMAP 70 D8 D8 D8 F8 D8 D8 D8 ENDCHAR STARTCHAR afii10018 ENCODING 1041 SWIDTH 545 0 DWIDTH 6 0 BBX 5 8 1 0 BITMAP F8 C0 C0 F0 D8 D8 D8 F0 ENDCHAR STARTCHAR afii10019 ENCODING 1042 SWIDTH 545 0 DWIDTH 6 0 BBX 5 8 1 0 BITMAP F0 D8 D8 F0 D8 D8 D8 F0 ENDCHAR STARTCHAR afii10020 ENCODING 1043 SWIDTH 1000 0 DWIDTH 6 0 BBX 5 8 1 0 BITMAP F8 C0 C0 C0 C0 C0 C0 C0 ENDCHAR STARTCHAR afii10021 ENCODING 1044 SWIDTH 727 0 DWIDTH 8 0 BBX 7 9 1 -1 BITMAP 3C 2C 6C 6C 6C 6C 6C FE C6 ENDCHAR STARTCHAR afii10022 ENCODING 1045 SWIDTH 545 0 DWIDTH 6 0 BBX 5 8 1 0 BITMAP F8 C0 C0 F0 C0 C0 C0 F8 ENDCHAR STARTCHAR afii10024 ENCODING 1046 SWIDTH 818 0 DWIDTH 9 0 BBX 8 8 1 0 BITMAP DB DB DB 7E DB DB DB DB ENDCHAR STARTCHAR afii10025 ENCODING 1047 SWIDTH 545 0 DWIDTH 6 0 BBX 5 8 1 0 BITMAP 70 D8 18 30 18 18 D8 70 ENDCHAR STARTCHAR afii10026 ENCODING 1048 SWIDTH 636 0 DWIDTH 7 0 BBX 6 8 1 0 BITMAP 84 8C 9C BC F4 E4 C4 84 ENDCHAR STARTCHAR afii10027 ENCODING 1049 SWIDTH 636 0 DWIDTH 7 0 BBX 6 9 1 0 BITMAP 58 B4 8C 9C BC F4 E4 C4 84 ENDCHAR STARTCHAR afii10028 ENCODING 1050 SWIDTH 636 0 DWIDTH 7 0 BBX 6 8 1 0 BITMAP CC D8 F0 E0 F0 D8 CC CC ENDCHAR STARTCHAR afii10029 ENCODING 1051 SWIDTH 545 0 DWIDTH 6 0 BBX 5 8 1 0 BITMAP 78 58 D8 D8 D8 D8 D8 D8 ENDCHAR STARTCHAR afii10030 ENCODING 1052 SWIDTH 818 0 DWIDTH 9 0 BBX 8 8 1 0 BITMAP 81 C3 E7 FF BB 93 83 83 ENDCHAR STARTCHAR afii10031 ENCODING 1053 SWIDTH 545 0 DWIDTH 6 0 BBX 5 8 1 0 BITMAP D8 D8 D8 F8 D8 D8 D8 D8 ENDCHAR STARTCHAR afii10032 ENCODING 1054 SWIDTH 545 0 DWIDTH 6 0 BBX 5 8 1 0 BITMAP 70 D8 D8 D8 D8 D8 D8 70 ENDCHAR STARTCHAR afii10033 ENCODING 1055 SWIDTH 545 0 DWIDTH 6 0 BBX 5 8 1 0 BITMAP F8 D8 D8 D8 D8 D8 D8 D8 ENDCHAR STARTCHAR afii10034 ENCODING 1056 SWIDTH 545 0 DWIDTH 6 0 BBX 5 8 1 0 BITMAP F0 D8 D8 D8 F0 C0 C0 C0 ENDCHAR STARTCHAR afii10035 ENCODING 1057 SWIDTH 545 0 DWIDTH 6 0 BBX 5 8 1 0 BITMAP 70 C8 C0 C0 C0 C0 C8 70 ENDCHAR STARTCHAR afii10036 ENCODING 1058 SWIDTH 636 0 DWIDTH 7 0 BBX 6 8 1 0 BITMAP FC 30 30 30 30 30 30 30 ENDCHAR STARTCHAR afii10037 ENCODING 1059 SWIDTH 545 0 DWIDTH 6 0 BBX 5 8 1 0 BITMAP D8 D8 D8 D8 78 18 98 70 ENDCHAR STARTCHAR afii10038 ENCODING 1060 SWIDTH 818 0 DWIDTH 9 0 BBX 8 8 1 0 BITMAP 18 7E DB DB DB 7E 18 18 ENDCHAR STARTCHAR afii10039 ENCODING 1061 SWIDTH 545 0 DWIDTH 6 0 BBX 5 8 1 0 BITMAP D8 D8 D8 70 D8 D8 D8 D8 ENDCHAR STARTCHAR afii10040 ENCODING 1062 SWIDTH 636 0 DWIDTH 7 0 BBX 6 9 1 -1 BITMAP D8 D8 D8 D8 D8 D8 D8 FC 04 ENDCHAR STARTCHAR afii10041 ENCODING 1063 SWIDTH 545 0 DWIDTH 6 0 BBX 5 8 1 0 BITMAP D8 D8 D8 D8 78 18 18 18 ENDCHAR STARTCHAR afii10042 ENCODING 1064 SWIDTH 818 0 DWIDTH 9 0 BBX 8 8 1 0 BITMAP DB DB DB DB DB DB DB FF ENDCHAR STARTCHAR afii10043 ENCODING 1065 SWIDTH 909 0 DWIDTH 10 0 BBX 9 9 1 -1 BITMAP DB00 DB00 DB00 DB00 DB00 DB00 DB00 FF80 0080 ENDCHAR STARTCHAR afii10044 ENCODING 1066 SWIDTH 545 0 DWIDTH 6 0 BBX 6 8 0 0 BITMAP E0 60 60 78 6C 6C 6C 78 ENDCHAR STARTCHAR afii10045 ENCODING 1067 SWIDTH 727 0 DWIDTH 8 0 BBX 7 8 1 0 BITMAP C6 C6 C6 F6 DE DE DE F6 ENDCHAR STARTCHAR afii10046 ENCODING 1068 SWIDTH 545 0 DWIDTH 6 0 BBX 5 8 1 0 BITMAP C0 C0 C0 F0 D8 D8 D8 F0 ENDCHAR STARTCHAR afii10047 ENCODING 1069 SWIDTH 545 0 DWIDTH 6 0 BBX 5 8 1 0 BITMAP 70 98 18 78 18 18 98 70 ENDCHAR STARTCHAR afii10048 ENCODING 1070 SWIDTH 818 0 DWIDTH 9 0 BBX 8 8 1 0 BITMAP CE DB DB FB DB DB DB CE ENDCHAR STARTCHAR afii10049 ENCODING 1071 SWIDTH 545 0 DWIDTH 6 0 BBX 5 8 1 0 BITMAP 78 D8 D8 78 D8 D8 D8 D8 ENDCHAR STARTCHAR afii10065 ENCODING 1072 SWIDTH 545 0 DWIDTH 6 0 BBX 5 6 1 0 BITMAP 70 98 78 D8 D8 78 ENDCHAR STARTCHAR afii10066 ENCODING 1073 SWIDTH 545 0 DWIDTH 6 0 BBX 5 9 1 0 BITMAP 10 60 C0 F0 D8 D8 D8 D8 70 ENDCHAR STARTCHAR afii10067 ENCODING 1074 SWIDTH 545 0 DWIDTH 6 0 BBX 5 6 1 0 BITMAP F0 D8 F0 D8 D8 F0 ENDCHAR STARTCHAR afii10068 ENCODING 1075 SWIDTH 454 0 DWIDTH 5 0 BBX 4 6 1 0 BITMAP F0 C0 C0 C0 C0 C0 ENDCHAR STARTCHAR afii10069 ENCODING 1076 SWIDTH 727 0 DWIDTH 8 0 BBX 7 7 1 -1 BITMAP 3C 2C 6C 6C 6C FE C6 ENDCHAR STARTCHAR afii10070 ENCODING 1077 SWIDTH 545 0 DWIDTH 6 0 BBX 5 6 1 0 BITMAP 70 D8 F8 C0 C8 70 ENDCHAR STARTCHAR afii10072 ENCODING 1078 SWIDTH 818 0 DWIDTH 9 0 BBX 8 6 1 0 BITMAP DB DB 7E DB DB DB ENDCHAR STARTCHAR afii10073 ENCODING 1079 SWIDTH 545 0 DWIDTH 6 0 BBX 5 6 1 0 BITMAP 70 98 30 18 98 70 ENDCHAR STARTCHAR afii10074 ENCODING 1080 SWIDTH 545 0 DWIDTH 6 0 BBX 5 6 1 0 BITMAP D8 D8 D8 D8 D8 78 ENDCHAR STARTCHAR afii10075 ENCODING 1081 SWIDTH 545 0 DWIDTH 6 0 BBX 5 9 1 0 BITMAP 58 30 00 D8 D8 D8 D8 D8 78 ENDCHAR STARTCHAR afii10076 ENCODING 1082 SWIDTH 636 0 DWIDTH 7 0 BBX 6 6 1 0 BITMAP CC D8 F0 D8 CC CC ENDCHAR STARTCHAR afii10077 ENCODING 1083 SWIDTH 545 0 DWIDTH 6 0 BBX 5 6 1 0 BITMAP 78 58 D8 D8 D8 D8 ENDCHAR STARTCHAR afii10078 ENCODING 1084 SWIDTH 818 0 DWIDTH 9 0 BBX 8 6 1 0 BITMAP 83 C7 EF BB 93 83 ENDCHAR STARTCHAR afii10079 ENCODING 1085 SWIDTH 545 0 DWIDTH 6 0 BBX 5 6 1 0 BITMAP D8 D8 F8 D8 D8 D8 ENDCHAR STARTCHAR afii10080 ENCODING 1086 SWIDTH 545 0 DWIDTH 6 0 BBX 5 6 1 0 BITMAP 70 D8 D8 D8 D8 70 ENDCHAR STARTCHAR afii10081 ENCODING 1087 SWIDTH 545 0 DWIDTH 6 0 BBX 5 6 1 0 BITMAP F8 D8 D8 D8 D8 D8 ENDCHAR STARTCHAR afii10082 ENCODING 1088 SWIDTH 545 0 DWIDTH 6 0 BBX 5 7 1 -1 BITMAP F0 D8 D8 D8 F0 C0 C0 ENDCHAR STARTCHAR afii10083 ENCODING 1089 SWIDTH 545 0 DWIDTH 6 0 BBX 5 6 1 0 BITMAP 70 C8 C0 C0 C8 70 ENDCHAR STARTCHAR afii10084 ENCODING 1090 SWIDTH 636 0 DWIDTH 7 0 BBX 6 6 1 0 BITMAP FC 30 30 30 30 30 ENDCHAR STARTCHAR afii10085 ENCODING 1091 SWIDTH 545 0 DWIDTH 6 0 BBX 5 7 1 -1 BITMAP D8 D8 D8 D8 78 18 F0 ENDCHAR STARTCHAR afii10086 ENCODING 1092 SWIDTH 818 0 DWIDTH 9 0 BBX 8 9 1 -1 BITMAP 18 18 7E DB DB DB 7E 18 18 ENDCHAR STARTCHAR afii10087 ENCODING 1093 SWIDTH 545 0 DWIDTH 6 0 BBX 5 6 1 0 BITMAP D8 D8 70 D8 D8 D8 ENDCHAR STARTCHAR afii10088 ENCODING 1094 SWIDTH 636 0 DWIDTH 7 0 BBX 6 7 1 -1 BITMAP D8 D8 D8 D8 D8 FC 04 ENDCHAR STARTCHAR afii10089 ENCODING 1095 SWIDTH 545 0 DWIDTH 6 0 BBX 5 6 1 0 BITMAP D8 D8 D8 78 18 18 ENDCHAR STARTCHAR afii10090 ENCODING 1096 SWIDTH 818 0 DWIDTH 9 0 BBX 8 6 1 0 BITMAP DB DB DB DB DB FF ENDCHAR STARTCHAR afii10091 ENCODING 1097 SWIDTH 909 0 DWIDTH 10 0 BBX 9 7 1 -1 BITMAP DB00 DB00 DB00 DB00 DB00 FF80 0080 ENDCHAR STARTCHAR afii10092 ENCODING 1098 SWIDTH 545 0 DWIDTH 6 0 BBX 6 6 0 0 BITMAP E0 60 78 6C 6C 78 ENDCHAR STARTCHAR afii10093 ENCODING 1099 SWIDTH 727 0 DWIDTH 8 0 BBX 7 6 1 0 BITMAP C6 C6 F6 DE DE F6 ENDCHAR STARTCHAR afii10094 ENCODING 1100 SWIDTH 545 0 DWIDTH 6 0 BBX 5 6 1 0 BITMAP C0 C0 F0 D8 D8 F0 ENDCHAR STARTCHAR afii10095 ENCODING 1101 SWIDTH 545 0 DWIDTH 6 0 BBX 5 6 1 0 BITMAP 70 98 38 18 98 70 ENDCHAR STARTCHAR afii10096 ENCODING 1102 SWIDTH 818 0 DWIDTH 9 0 BBX 8 6 1 0 BITMAP CE DB FB DB DB CE ENDCHAR STARTCHAR afii10097 ENCODING 1103 SWIDTH 545 0 DWIDTH 6 0 BBX 5 6 1 0 BITMAP 78 D8 78 D8 D8 D8 ENDCHAR STARTCHAR uni0450 ENCODING 1104 SWIDTH 545 0 DWIDTH 6 0 BBX 5 9 1 0 BITMAP 60 20 00 70 D8 F8 C0 C8 70 ENDCHAR STARTCHAR afii10071 ENCODING 1105 SWIDTH 545 0 DWIDTH 6 0 BBX 5 8 1 0 BITMAP 50 00 70 D8 F8 C0 C8 70 ENDCHAR STARTCHAR afii57664 ENCODING 1488 SWIDTH 636 0 DWIDTH 7 0 BBX 6 8 1 0 BITMAP CC CC EC 78 DC CC CC CC ENDCHAR STARTCHAR afii57665 ENCODING 1489 SWIDTH 636 0 DWIDTH 7 0 BBX 6 8 1 0 BITMAP F0 18 18 18 18 18 18 FC ENDCHAR STARTCHAR afii57666 ENCODING 1490 SWIDTH 545 0 DWIDTH 6 0 BBX 5 8 1 0 BITMAP E0 30 30 30 30 30 70 D8 ENDCHAR STARTCHAR afii57667 ENCODING 1491 SWIDTH 636 0 DWIDTH 7 0 BBX 6 8 1 0 BITMAP FC 18 18 18 18 18 18 18 ENDCHAR STARTCHAR afii57668 ENCODING 1492 SWIDTH 545 0 DWIDTH 6 0 BBX 5 8 1 0 BITMAP F0 18 D8 D8 D8 D8 D8 D8 ENDCHAR STARTCHAR afii57669 ENCODING 1493 SWIDTH 363 0 DWIDTH 4 0 BBX 3 8 1 0 BITMAP C0 60 60 60 60 60 60 60 ENDCHAR STARTCHAR afii57670 ENCODING 1494 SWIDTH 545 0 DWIDTH 6 0 BBX 5 8 1 0 BITMAP F8 10 30 30 30 30 30 30 ENDCHAR STARTCHAR afii57671 ENCODING 1495 SWIDTH 545 0 DWIDTH 6 0 BBX 5 8 1 0 BITMAP F0 D8 D8 D8 D8 D8 D8 D8 ENDCHAR STARTCHAR afii57672 ENCODING 1496 SWIDTH 636 0 DWIDTH 7 0 BBX 6 8 1 0 BITMAP D8 CC CC CC CC CC CC 78 ENDCHAR STARTCHAR afii57673 ENCODING 1497 SWIDTH 333 0 DWIDTH 5 0 BBX 4 4 1 4 BITMAP E0 30 30 30 ENDCHAR STARTCHAR afii57674 ENCODING 1498 SWIDTH 545 0 DWIDTH 6 0 BBX 5 9 1 -1 BITMAP F8 18 18 18 18 18 18 18 18 ENDCHAR STARTCHAR afii57675 ENCODING 1499 SWIDTH 545 0 DWIDTH 6 0 BBX 5 8 1 0 BITMAP F0 18 18 18 18 18 18 F0 ENDCHAR STARTCHAR afii57676 ENCODING 1500 SWIDTH 636 0 DWIDTH 7 0 BBX 6 9 1 0 BITMAP C0 C0 FC 0C 0C 18 30 30 30 ENDCHAR STARTCHAR afii57677 ENCODING 1501 SWIDTH 545 0 DWIDTH 6 0 BBX 5 8 1 0 BITMAP F0 D8 D8 D8 D8 D8 D8 F8 ENDCHAR STARTCHAR afii57678 ENCODING 1502 SWIDTH 636 0 DWIDTH 7 0 BBX 6 8 1 0 BITMAP D8 EC CC CC CC CC CC DC ENDCHAR STARTCHAR afii57679 ENCODING 1503 SWIDTH 454 0 DWIDTH 5 0 BBX 4 9 1 -1 BITMAP E0 30 30 30 30 30 30 30 30 ENDCHAR STARTCHAR afii57680 ENCODING 1504 SWIDTH 454 0 DWIDTH 5 0 BBX 4 8 1 0 BITMAP E0 30 30 30 30 30 30 F0 ENDCHAR STARTCHAR afii57681 ENCODING 1505 SWIDTH 545 0 DWIDTH 6 0 BBX 5 8 1 0 BITMAP 70 D8 D8 D8 D8 D8 D0 70 ENDCHAR STARTCHAR afii57682 ENCODING 1506 SWIDTH 636 0 DWIDTH 7 0 BBX 6 8 1 0 BITMAP 6C 6C 6C 6C 6C 6C 6C F8 ENDCHAR STARTCHAR afii57683 ENCODING 1507 SWIDTH 636 0 DWIDTH 7 0 BBX 6 9 1 -1 BITMAP F8 CC CC CC 6C 0C 0C 0C 0C ENDCHAR STARTCHAR afii57684 ENCODING 1508 SWIDTH 636 0 DWIDTH 7 0 BBX 6 8 1 0 BITMAP F8 CC CC EC 0C 0C 0C F8 ENDCHAR STARTCHAR afii57685 ENCODING 1509 SWIDTH 545 0 DWIDTH 6 0 BBX 5 9 1 -1 BITMAP D8 D8 D8 D8 D8 D0 E0 C0 C0 ENDCHAR STARTCHAR afii57686 ENCODING 1510 SWIDTH 636 0 DWIDTH 7 0 BBX 6 8 1 0 BITMAP CC CC CC 68 30 18 0C F8 ENDCHAR STARTCHAR afii57687 ENCODING 1511 SWIDTH 636 0 DWIDTH 7 0 BBX 6 9 1 -1 BITMAP F8 0C CC CC CC CC DC C0 C0 ENDCHAR STARTCHAR afii57688 ENCODING 1512 SWIDTH 545 0 DWIDTH 6 0 BBX 5 8 1 0 BITMAP F0 18 18 18 18 18 18 18 ENDCHAR STARTCHAR afii57689 ENCODING 1513 SWIDTH 818 0 DWIDTH 9 0 BBX 8 8 1 0 BITMAP DB DB DB DB DB DB DB FE ENDCHAR STARTCHAR afii57690 ENCODING 1514 SWIDTH 636 0 DWIDTH 7 0 BBX 6 8 1 0 BITMAP 78 6C 6C 6C 6C 6C 6C EC ENDCHAR STARTCHAR afii57716 ENCODING 1520 SWIDTH 636 0 DWIDTH 7 0 BBX 6 8 1 0 BITMAP D8 6C 6C 6C 6C 6C 6C 6C ENDCHAR STARTCHAR afii57717 ENCODING 1521 SWIDTH 727 0 DWIDTH 8 0 BBX 7 8 1 0 BITMAP EC 36 36 06 06 06 06 06 ENDCHAR STARTCHAR afii57718 ENCODING 1522 SWIDTH 727 0 DWIDTH 8 0 BBX 7 3 1 5 BITMAP EC 36 36 ENDCHAR STARTCHAR uni05F3 ENCODING 1523 SWIDTH 363 0 DWIDTH 4 0 BBX 3 2 1 7 BITMAP 60 C0 ENDCHAR STARTCHAR uni05F4 ENCODING 1524 SWIDTH 636 0 DWIDTH 7 0 BBX 6 2 1 7 BITMAP 6C D8 ENDCHAR STARTCHAR quoteleft ENCODING 8216 SWIDTH 307 0 DWIDTH 4 0 BBX 3 3 1 6 BITMAP 60 C0 C0 ENDCHAR STARTCHAR quoteright ENCODING 8217 SWIDTH 1000 0 DWIDTH 4 0 BBX 3 3 0 6 BITMAP 60 60 C0 ENDCHAR STARTCHAR quotesinglbase ENCODING 8218 SWIDTH 1000 0 DWIDTH 4 0 BBX 3 3 0 -1 BITMAP 60 60 C0 ENDCHAR STARTCHAR quotereversed ENCODING 8219 SWIDTH 1000 0 DWIDTH 4 0 BBX 3 3 1 6 BITMAP C0 C0 60 ENDCHAR STARTCHAR quotedblleft ENCODING 8220 SWIDTH 1000 0 DWIDTH 7 0 BBX 6 3 1 6 BITMAP 6C D8 D8 ENDCHAR STARTCHAR quotedblright ENCODING 8221 SWIDTH 538 0 DWIDTH 7 0 BBX 6 3 0 6 BITMAP 6C 6C D8 ENDCHAR STARTCHAR quotedblbase ENCODING 8222 SWIDTH 1000 0 DWIDTH 7 0 BBX 6 3 0 -1 BITMAP 6C 6C D8 ENDCHAR STARTCHAR uni201F ENCODING 8223 SWIDTH 1000 0 DWIDTH 7 0 BBX 6 3 1 6 BITMAP D8 D8 6C ENDCHAR STARTCHAR Euro ENCODING 8364 SWIDTH 636 0 DWIDTH 7 0 BBX 6 8 1 0 BITMAP 38 64 60 F8 60 F0 64 38 ENDCHAR ENDFONT
{ "pile_set_name": "Github" }
title: $:/language/Docs/Types/application/javascript description: JavaScript kode name: application/javascript group: Udvikler
{ "pile_set_name": "Github" }
//===----------------------------------------------------------------------===// // // The LLVM Compiler Infrastructure // // This file is dual licensed under the MIT and the University of Illinois Open // Source Licenses. See LICENSE.TXT for details. // //===----------------------------------------------------------------------===// // <unordered_set> // template <class Value, class Hash = hash<Value>, class Pred = equal_to<Value>, // class Alloc = allocator<Value>> // class unordered_multiset // unordered_multiset& operator=(const unordered_multiset& u); #include <unordered_set> #include <cassert> #include <cfloat> #include "../../../test_compare.h" #include "../../../test_hash.h" #include "../../../test_allocator.h" int main() { { typedef test_allocator<int> A; typedef std::unordered_multiset<int, test_hash<std::hash<int> >, test_compare<std::equal_to<int> >, A > C; typedef int P; P a[] = { P(1), P(2), P(3), P(4), P(1), P(2) }; C c0(a, a + sizeof(a)/sizeof(a[0]), 7, test_hash<std::hash<int> >(8), test_compare<std::equal_to<int> >(9), A(10) ); C c(a, a + 2, 7, test_hash<std::hash<int> >(2), test_compare<std::equal_to<int> >(3), A(4) ); c = c0; assert(c.bucket_count() == 7); assert(c.size() == 6); C::const_iterator i = c.cbegin(); assert(*i == 1); ++i; assert(*i == 1); ++i; assert(*i == 2); ++i; assert(*i == 2); ++i; assert(*i == 3); ++i; assert(*i == 4); assert(c.hash_function() == test_hash<std::hash<int> >(8)); assert(c.key_eq() == test_compare<std::equal_to<int> >(9)); assert(c.get_allocator() == A(4)); assert(!c.empty()); assert(std::distance(c.begin(), c.end()) == c.size()); assert(std::distance(c.cbegin(), c.cend()) == c.size()); assert(fabs(c.load_factor() - (float)c.size()/c.bucket_count()) < FLT_EPSILON); assert(c.max_load_factor() == 1); } { typedef other_allocator<int> A; typedef std::unordered_multiset<int, test_hash<std::hash<int> >, test_compare<std::equal_to<int> >, A > C; typedef int P; P a[] = { P(1), P(2), P(3), P(4), P(1), P(2) }; C c0(a, a + sizeof(a)/sizeof(a[0]), 7, test_hash<std::hash<int> >(8), test_compare<std::equal_to<int> >(9), A(10) ); C c(a, a + 2, 7, test_hash<std::hash<int> >(2), test_compare<std::equal_to<int> >(3), A(4) ); c = c0; assert(c.bucket_count() >= 7); assert(c.size() == 6); C::const_iterator i = c.cbegin(); assert(*i == 1); ++i; assert(*i == 1); ++i; assert(*i == 2); ++i; assert(*i == 2); ++i; assert(*i == 3); ++i; assert(*i == 4); assert(c.hash_function() == test_hash<std::hash<int> >(8)); assert(c.key_eq() == test_compare<std::equal_to<int> >(9)); assert(c.get_allocator() == A(10)); assert(!c.empty()); assert(std::distance(c.begin(), c.end()) == c.size()); assert(std::distance(c.cbegin(), c.cend()) == c.size()); assert(fabs(c.load_factor() - (float)c.size()/c.bucket_count()) < FLT_EPSILON); assert(c.max_load_factor() == 1); } }
{ "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.batik.dom.svg; /** * Constants for the SVGPathSeg interface. * * @author <a href="mailto:[email protected]">Nicolas Socheleau</a> * @version $Id$ */ public interface SVGPathSegConstants { String PATHSEG_ARC_ABS_LETTER = "A"; String PATHSEG_ARC_REL_LETTER = "a"; String PATHSEG_CLOSEPATH_LETTER = "z"; String PATHSEG_CURVETO_CUBIC_ABS_LETTER = "C"; String PATHSEG_CURVETO_CUBIC_REL_LETTER = "c"; String PATHSEG_CURVETO_CUBIC_SMOOTH_ABS_LETTER = "S"; String PATHSEG_CURVETO_CUBIC_SMOOTH_REL_LETTER = "s"; String PATHSEG_CURVETO_QUADRATIC_ABS_LETTER = "Q"; String PATHSEG_CURVETO_QUADRATIC_REL_LETTER = "q"; String PATHSEG_CURVETO_QUADRATIC_SMOOTH_ABS_LETTER = "T"; String PATHSEG_CURVETO_QUADRATIC_SMOOTH_REL_LETTER = "t"; String PATHSEG_LINETO_ABS_LETTER = "L"; String PATHSEG_LINETO_HORIZONTAL_ABS_LETTER = "H"; String PATHSEG_LINETO_HORIZONTAL_REL_LETTER = "h"; String PATHSEG_LINETO_REL_LETTER = "l"; String PATHSEG_LINETO_VERTICAL_ABS_LETTER = "V"; String PATHSEG_LINETO_VERTICAL_REL_LETTER = "v"; String PATHSEG_MOVETO_ABS_LETTER = "M"; String PATHSEG_MOVETO_REL_LETTER = "m"; /** * Path segment letters. */ String[] PATHSEG_LETTERS = { null, PATHSEG_CLOSEPATH_LETTER, PATHSEG_MOVETO_ABS_LETTER, PATHSEG_MOVETO_REL_LETTER, PATHSEG_LINETO_ABS_LETTER, PATHSEG_LINETO_REL_LETTER, PATHSEG_CURVETO_CUBIC_ABS_LETTER, PATHSEG_CURVETO_CUBIC_REL_LETTER, PATHSEG_CURVETO_QUADRATIC_ABS_LETTER, PATHSEG_CURVETO_QUADRATIC_REL_LETTER, PATHSEG_ARC_ABS_LETTER, PATHSEG_ARC_REL_LETTER, PATHSEG_LINETO_HORIZONTAL_ABS_LETTER, PATHSEG_LINETO_HORIZONTAL_REL_LETTER, PATHSEG_LINETO_VERTICAL_ABS_LETTER, PATHSEG_LINETO_VERTICAL_REL_LETTER, PATHSEG_CURVETO_CUBIC_SMOOTH_ABS_LETTER, PATHSEG_CURVETO_CUBIC_SMOOTH_REL_LETTER, PATHSEG_CURVETO_QUADRATIC_SMOOTH_ABS_LETTER, PATHSEG_CURVETO_QUADRATIC_SMOOTH_REL_LETTER, }; }
{ "pile_set_name": "Github" }
.walkthrough-menu { .hed { text-align: left; margin-bottom: 20px; } ul{ margin: 20px 0 0; padding: 0; li { list-style: none; display:inline-block; padding: 20px; cursor: pointer; &:hover { background-color: #eee; } img, span { display: block; } span { margin-top:10px; } } } }
{ "pile_set_name": "Github" }
<image> <filename>image_005189.jpg</filename> <folder></folder> <size> <width>256</width> <height>256</height> </size> <origSize> <width>800</width> <height>800</height> </origSize> <generated>1</generated> </image> <file> <filename>image_005189.xml</filename> <folder></folder> </file> <object> <objectId>1</objectId> <name>sky</name> <masks> <filename>masks/image_005189.mat</filename> </masks> <keyword>sky</keyword> </object> <objImgSrc> <filename>opencountry_n18053.jpg</filename> <folder>spatial_envelope_256x256_static_8outdoorcategories</folder> <size> <width>800</width> <height>800</height> </size> <origSize> <width>256</width> <height>256</height> </origSize> </objImgSrc> <bgImgSrc> <filename>opencountry_nat874.jpg</filename> <folder>spatial_envelope_256x256_static_8outdoorcategories</folder> <size> <width>800</width> <height>800</height> </size> <origSize> <width>256</width> <height>256</height> </origSize> </bgImgSrc>
{ "pile_set_name": "Github" }
/*********************************************************************************************************************************** Pq Test Harness Scripted testing for PostgreSQL libpq so exact results can be returned for unit testing. See PostgreSQL client unit tests for usage examples. ***********************************************************************************************************************************/ #ifndef TEST_COMMON_HARNESS_PQ_H #define TEST_COMMON_HARNESS_PQ_H #ifndef HARNESS_PQ_REAL #include <libpq-fe.h> #include "common/macro.h" #include "common/time.h" #include "version.h" /*********************************************************************************************************************************** Function constants ***********************************************************************************************************************************/ #define HRNPQ_CANCEL "PQcancel" #define HRNPQ_CLEAR "PQclear" #define HRNPQ_CONNECTDB "PQconnectdb" #define HRNPQ_CONSUMEINPUT "PQconsumeInput" #define HRNPQ_ERRORMESSAGE "PQerrorMessage" #define HRNPQ_FINISH "PQfinish" #define HRNPQ_FREECANCEL "PQfreeCancel" #define HRNPQ_FTYPE "PQftype" #define HRNPQ_GETCANCEL "PQgetCancel" #define HRNPQ_GETISNULL "PQgetisnull" #define HRNPQ_GETRESULT "PQgetResult" #define HRNPQ_GETVALUE "PQgetvalue" #define HRNPQ_ISBUSY "PQisbusy" #define HRNPQ_NFIELDS "PQnfields" #define HRNPQ_NTUPLES "PQntuples" #define HRNPQ_RESULTERRORMESSAGE "PQresultErrorMessage" #define HRNPQ_RESULTSTATUS "PQresultStatus" #define HRNPQ_SENDQUERY "PQsendQuery" #define HRNPQ_STATUS "PQstatus" /*********************************************************************************************************************************** Macros for defining groups of functions that implement various queries and commands ***********************************************************************************************************************************/ #define HRNPQ_MACRO_OPEN(sessionParam, connectParam) \ {.session = sessionParam, .function = HRNPQ_CONNECTDB, .param = "[\"" connectParam "\"]"}, \ {.session = sessionParam, .function = HRNPQ_STATUS, .resultInt = CONNECTION_OK} #define HRNPQ_MACRO_SET_CLIENT_ENCODING(sessionParam) \ {.session = sessionParam, .function = HRNPQ_SENDQUERY, .param = "[\"set client_encoding = 'UTF8'\"]", .resultInt = 1}, \ {.session = sessionParam, .function = HRNPQ_CONSUMEINPUT}, \ {.session = sessionParam, .function = HRNPQ_ISBUSY}, \ {.session = sessionParam, .function = HRNPQ_GETRESULT}, \ {.session = sessionParam, .function = HRNPQ_RESULTSTATUS, .resultInt = PGRES_COMMAND_OK}, \ {.session = sessionParam, .function = HRNPQ_CLEAR}, \ {.session = sessionParam, .function = HRNPQ_GETRESULT, .resultNull = true} #define HRNPQ_MACRO_SET_SEARCH_PATH(sessionParam) \ {.session = sessionParam, .function = HRNPQ_SENDQUERY, .param = "[\"set search_path = 'pg_catalog'\"]", .resultInt = 1}, \ {.session = sessionParam, .function = HRNPQ_CONSUMEINPUT}, \ {.session = sessionParam, .function = HRNPQ_ISBUSY}, \ {.session = sessionParam, .function = HRNPQ_GETRESULT}, \ {.session = sessionParam, .function = HRNPQ_RESULTSTATUS, .resultInt = PGRES_COMMAND_OK}, \ {.session = sessionParam, .function = HRNPQ_CLEAR}, \ {.session = sessionParam, .function = HRNPQ_GETRESULT, .resultNull = true} #define HRNPQ_MACRO_VALIDATE_QUERY(sessionParam, versionParam, pgPathParam, archiveMode, archiveCommand) \ {.session = sessionParam, .function = HRNPQ_SENDQUERY, .param = \ "[\"select (select setting from pg_catalog.pg_settings where name = 'server_version_num')::int4," \ " (select setting from pg_catalog.pg_settings where name = 'data_directory')::text," \ " (select setting from pg_catalog.pg_settings where name = 'archive_mode')::text," \ " (select setting from pg_catalog.pg_settings where name = 'archive_command')::text\"]", \ .resultInt = 1}, \ {.session = sessionParam, .function = HRNPQ_CONSUMEINPUT}, \ {.session = sessionParam, .function = HRNPQ_ISBUSY}, \ {.session = sessionParam, .function = HRNPQ_GETRESULT}, \ {.session = sessionParam, .function = HRNPQ_RESULTSTATUS, .resultInt = PGRES_TUPLES_OK}, \ {.session = sessionParam, .function = HRNPQ_NTUPLES, .resultInt = 1}, \ {.session = sessionParam, .function = HRNPQ_NFIELDS, .resultInt = 4}, \ {.session = sessionParam, .function = HRNPQ_FTYPE, .param = "[0]", .resultInt = HRNPQ_TYPE_INT}, \ {.session = sessionParam, .function = HRNPQ_FTYPE, .param = "[1]", .resultInt = HRNPQ_TYPE_TEXT}, \ {.session = sessionParam, .function = HRNPQ_FTYPE, .param = "[2]", .resultInt = HRNPQ_TYPE_TEXT}, \ {.session = sessionParam, .function = HRNPQ_FTYPE, .param = "[3]", .resultInt = HRNPQ_TYPE_TEXT}, \ {.session = sessionParam, .function = HRNPQ_GETVALUE, .param = "[0,0]", .resultZ = STRINGIFY(versionParam)}, \ {.session = sessionParam, .function = HRNPQ_GETVALUE, .param = "[0,1]", .resultZ = pgPathParam}, \ {.session = sessionParam, .function = HRNPQ_GETVALUE, .param = "[0,2]", .resultZ = archiveMode == NULL ? "on" \ : archiveMode}, \ {.session = sessionParam, .function = HRNPQ_GETVALUE, .param = "[0,3]", .resultZ = archiveCommand == NULL ? PROJECT_BIN \ : archiveCommand}, \ {.session = sessionParam, .function = HRNPQ_CLEAR}, \ {.session = sessionParam, .function = HRNPQ_GETRESULT, .resultNull = true} #define HRNPQ_MACRO_SET_APPLICATION_NAME(sessionParam) \ {.session = sessionParam, .function = HRNPQ_SENDQUERY, \ .param = strZ(strNewFmt("[\"set application_name = '" PROJECT_NAME " [%s]'\"]", cfgCommandName(cfgCommand()))), \ .resultInt = 1}, \ {.session = sessionParam, .function = HRNPQ_CONSUMEINPUT}, \ {.session = sessionParam, .function = HRNPQ_ISBUSY}, \ {.session = sessionParam, .function = HRNPQ_GETRESULT}, \ {.session = sessionParam, .function = HRNPQ_RESULTSTATUS, .resultInt = PGRES_COMMAND_OK}, \ {.session = sessionParam, .function = HRNPQ_CLEAR}, \ {.session = sessionParam, .function = HRNPQ_GETRESULT, .resultNull = true} #define HRNPQ_MACRO_SET_MAX_PARALLEL_WORKERS_PER_GATHER(sessionParam) \ {.session = sessionParam, .function = HRNPQ_SENDQUERY, .param = "[\"set max_parallel_workers_per_gather = 0\"]", \ .resultInt = 1}, \ {.session = sessionParam, .function = HRNPQ_CONSUMEINPUT}, \ {.session = sessionParam, .function = HRNPQ_ISBUSY}, \ {.session = sessionParam, .function = HRNPQ_GETRESULT}, \ {.session = sessionParam, .function = HRNPQ_RESULTSTATUS, .resultInt = PGRES_COMMAND_OK}, \ {.session = sessionParam, .function = HRNPQ_CLEAR}, \ {.session = sessionParam, .function = HRNPQ_GETRESULT, .resultNull = true} #define HRNPQ_MACRO_IS_STANDBY_QUERY(sessionParam, standbyParam) \ {.session = sessionParam, .function = HRNPQ_SENDQUERY, .param = "[\"select pg_catalog.pg_is_in_recovery()\"]", .resultInt = 1},\ {.session = sessionParam, .function = HRNPQ_CONSUMEINPUT}, \ {.session = sessionParam, .function = HRNPQ_ISBUSY}, \ {.session = sessionParam, .function = HRNPQ_GETRESULT}, \ {.session = sessionParam, .function = HRNPQ_RESULTSTATUS, .resultInt = PGRES_TUPLES_OK}, \ {.session = sessionParam, .function = HRNPQ_NTUPLES, .resultInt = 1}, \ {.session = sessionParam, .function = HRNPQ_NFIELDS, .resultInt = 1}, \ {.session = sessionParam, .function = HRNPQ_FTYPE, .param = "[0]", .resultInt = HRNPQ_TYPE_BOOL}, \ {.session = sessionParam, .function = HRNPQ_GETVALUE, .param = "[0,0]", .resultZ = STRINGIFY(standbyParam)}, \ {.session = sessionParam, .function = HRNPQ_CLEAR}, \ {.session = sessionParam, .function = HRNPQ_GETRESULT, .resultNull = true} #define HRNPQ_MACRO_CREATE_RESTORE_POINT(sessionParam, lsnParam) \ {.session = sessionParam, \ .function = HRNPQ_SENDQUERY, .param = "[\"select pg_catalog.pg_create_restore_point('pgBackRest Archive Check')::text\"]", \ .resultInt = 1}, \ {.session = sessionParam, .function = HRNPQ_CONSUMEINPUT}, \ {.session = sessionParam, .function = HRNPQ_ISBUSY}, \ {.session = sessionParam, .function = HRNPQ_GETRESULT}, \ {.session = sessionParam, .function = HRNPQ_RESULTSTATUS, .resultInt = PGRES_TUPLES_OK}, \ {.session = sessionParam, .function = HRNPQ_NTUPLES, .resultInt = 1}, \ {.session = sessionParam, .function = HRNPQ_NFIELDS, .resultInt = 1}, \ {.session = sessionParam, .function = HRNPQ_FTYPE, .param = "[0]", .resultInt = HRNPQ_TYPE_TEXT}, \ {.session = sessionParam, .function = HRNPQ_GETVALUE, .param = "[0,0]", .resultZ = lsnParam}, \ {.session = sessionParam, .function = HRNPQ_CLEAR}, \ {.session = sessionParam, .function = HRNPQ_GETRESULT, .resultNull = true} #define HRNPQ_MACRO_WAL_SWITCH(sessionParam, walNameParam, walFileNameParam) \ {.session = sessionParam, .function = HRNPQ_SENDQUERY, \ .param = "[\"select pg_catalog.pg_" walNameParam "file_name(pg_catalog.pg_switch_" walNameParam "())::text\"]", \ .resultInt = 1}, \ {.session = sessionParam, .function = HRNPQ_CONSUMEINPUT}, \ {.session = sessionParam, .function = HRNPQ_ISBUSY}, \ {.session = sessionParam, .function = HRNPQ_GETRESULT}, \ {.session = sessionParam, .function = HRNPQ_RESULTSTATUS, .resultInt = PGRES_TUPLES_OK}, \ {.session = sessionParam, .function = HRNPQ_NTUPLES, .resultInt = 1}, \ {.session = sessionParam, .function = HRNPQ_NFIELDS, .resultInt = 1}, \ {.session = sessionParam, .function = HRNPQ_FTYPE, .param = "[0]", .resultInt = HRNPQ_TYPE_TEXT}, \ {.session = sessionParam, .function = HRNPQ_GETVALUE, .param = "[0,0]", .resultZ = walFileNameParam}, \ {.session = sessionParam, .function = HRNPQ_CLEAR}, \ {.session = sessionParam, .function = HRNPQ_GETRESULT, .resultNull = true} #define HRNPQ_MACRO_TIME_QUERY(sessionParam, timeParam) \ {.session = sessionParam, \ .function = HRNPQ_SENDQUERY, .param = "[\"select (extract(epoch from clock_timestamp()) * 1000)::bigint\"]", \ .resultInt = 1}, \ {.session = sessionParam, .function = HRNPQ_CONSUMEINPUT}, \ {.session = sessionParam, .function = HRNPQ_ISBUSY}, \ {.session = sessionParam, .function = HRNPQ_GETRESULT}, \ {.session = sessionParam, .function = HRNPQ_RESULTSTATUS, .resultInt = PGRES_TUPLES_OK}, \ {.session = sessionParam, .function = HRNPQ_NTUPLES, .resultInt = 1}, \ {.session = sessionParam, .function = HRNPQ_NFIELDS, .resultInt = 1}, \ {.session = sessionParam, .function = HRNPQ_FTYPE, .param = "[0]", .resultInt = HRNPQ_TYPE_INT}, \ {.session = sessionParam, .function = HRNPQ_GETVALUE, .param = "[0,0]", \ .resultZ = strZ(strNewFmt("%" PRId64, (int64_t)(timeParam)))}, \ {.session = sessionParam, .function = HRNPQ_CLEAR}, \ {.session = sessionParam, .function = HRNPQ_GETRESULT, .resultNull = true} #define HRNPQ_MACRO_ADVISORY_LOCK(sessionParam, lockAcquiredParam) \ {.session = sessionParam, \ .function = HRNPQ_SENDQUERY, .param = "[\"select pg_catalog.pg_try_advisory_lock(12340078987004321)::bool\"]", \ .resultInt = 1}, \ {.session = sessionParam, .function = HRNPQ_CONSUMEINPUT}, \ {.session = sessionParam, .function = HRNPQ_ISBUSY}, \ {.session = sessionParam, .function = HRNPQ_GETRESULT}, \ {.session = sessionParam, .function = HRNPQ_RESULTSTATUS, .resultInt = PGRES_TUPLES_OK}, \ {.session = sessionParam, .function = HRNPQ_NTUPLES, .resultInt = 1}, \ {.session = sessionParam, .function = HRNPQ_NFIELDS, .resultInt = 1}, \ {.session = sessionParam, .function = HRNPQ_FTYPE, .param = "[0]", .resultInt = HRNPQ_TYPE_BOOL}, \ {.session = sessionParam, .function = HRNPQ_GETVALUE, .param = "[0,0]", .resultZ = cvtBoolToConstZ(lockAcquiredParam)}, \ {.session = sessionParam, .function = HRNPQ_CLEAR}, \ {.session = sessionParam, .function = HRNPQ_GETRESULT, .resultNull = true} #define HRNPQ_MACRO_IS_IN_BACKUP(sessionParam, inBackupParam) \ {.session = sessionParam, \ .function = HRNPQ_SENDQUERY, .param = "[\"select pg_catalog.pg_is_in_backup()::bool\"]", \ .resultInt = 1}, \ {.session = sessionParam, .function = HRNPQ_CONSUMEINPUT}, \ {.session = sessionParam, .function = HRNPQ_ISBUSY}, \ {.session = sessionParam, .function = HRNPQ_GETRESULT}, \ {.session = sessionParam, .function = HRNPQ_RESULTSTATUS, .resultInt = PGRES_TUPLES_OK}, \ {.session = sessionParam, .function = HRNPQ_NTUPLES, .resultInt = 1}, \ {.session = sessionParam, .function = HRNPQ_NFIELDS, .resultInt = 1}, \ {.session = sessionParam, .function = HRNPQ_FTYPE, .param = "[0]", .resultInt = HRNPQ_TYPE_BOOL}, \ {.session = sessionParam, .function = HRNPQ_GETVALUE, .param = "[0,0]", .resultZ = cvtBoolToConstZ(inBackupParam)}, \ {.session = sessionParam, .function = HRNPQ_CLEAR}, \ {.session = sessionParam, .function = HRNPQ_GETRESULT, .resultNull = true} #define HRNPQ_MACRO_START_BACKUP_83(sessionParam, lsnParam, walSegmentNameParam) \ {.session = sessionParam, \ .function = HRNPQ_SENDQUERY, \ .param = \ "[\"select lsn::text as lsn,\\n" \ " pg_catalog.pg_xlogfile_name(lsn)::text as wal_segment_name\\n" \ " from pg_catalog.pg_start_backup('pgBackRest backup started at ' || current_timestamp) as lsn\"]", \ .resultInt = 1}, \ {.session = sessionParam, .function = HRNPQ_CONSUMEINPUT}, \ {.session = sessionParam, .function = HRNPQ_ISBUSY}, \ {.session = sessionParam, .function = HRNPQ_GETRESULT}, \ {.session = sessionParam, .function = HRNPQ_RESULTSTATUS, .resultInt = PGRES_TUPLES_OK}, \ {.session = sessionParam, .function = HRNPQ_NTUPLES, .resultInt = 1}, \ {.session = sessionParam, .function = HRNPQ_NFIELDS, .resultInt = 2}, \ {.session = sessionParam, .function = HRNPQ_FTYPE, .param = "[0]", .resultInt = HRNPQ_TYPE_TEXT}, \ {.session = sessionParam, .function = HRNPQ_FTYPE, .param = "[1]", .resultInt = HRNPQ_TYPE_TEXT}, \ {.session = sessionParam, .function = HRNPQ_GETVALUE, .param = "[0,0]", .resultZ = lsnParam}, \ {.session = sessionParam, .function = HRNPQ_GETVALUE, .param = "[0,1]", .resultZ = walSegmentNameParam}, \ {.session = sessionParam, .function = HRNPQ_CLEAR}, \ {.session = sessionParam, .function = HRNPQ_GETRESULT, .resultNull = true} #define HRNPQ_MACRO_START_BACKUP_84_95(sessionParam, startFastParam, lsnParam, walSegmentNameParam) \ {.session = sessionParam, \ .function = HRNPQ_SENDQUERY, \ .param = strZ(strNewFmt( \ "[\"select lsn::text as lsn,\\n" \ " pg_catalog.pg_xlogfile_name(lsn)::text as wal_segment_name\\n" \ " from pg_catalog.pg_start_backup('pgBackRest backup started at ' || current_timestamp, %s) as lsn\"]", \ cvtBoolToConstZ(startFastParam))), \ .resultInt = 1}, \ {.session = sessionParam, .function = HRNPQ_CONSUMEINPUT}, \ {.session = sessionParam, .function = HRNPQ_ISBUSY}, \ {.session = sessionParam, .function = HRNPQ_GETRESULT}, \ {.session = sessionParam, .function = HRNPQ_RESULTSTATUS, .resultInt = PGRES_TUPLES_OK}, \ {.session = sessionParam, .function = HRNPQ_NTUPLES, .resultInt = 1}, \ {.session = sessionParam, .function = HRNPQ_NFIELDS, .resultInt = 2}, \ {.session = sessionParam, .function = HRNPQ_FTYPE, .param = "[0]", .resultInt = HRNPQ_TYPE_TEXT}, \ {.session = sessionParam, .function = HRNPQ_FTYPE, .param = "[1]", .resultInt = HRNPQ_TYPE_TEXT}, \ {.session = sessionParam, .function = HRNPQ_GETVALUE, .param = "[0,0]", .resultZ = lsnParam}, \ {.session = sessionParam, .function = HRNPQ_GETVALUE, .param = "[0,1]", .resultZ = walSegmentNameParam}, \ {.session = sessionParam, .function = HRNPQ_CLEAR}, \ {.session = sessionParam, .function = HRNPQ_GETRESULT, .resultNull = true} #define HRNPQ_MACRO_START_BACKUP_96(sessionParam, startFastParam, lsnParam, walSegmentNameParam) \ {.session = sessionParam, \ .function = HRNPQ_SENDQUERY, \ .param = strZ(strNewFmt( \ "[\"select lsn::text as lsn,\\n" \ " pg_catalog.pg_xlogfile_name(lsn)::text as wal_segment_name\\n" \ " from pg_catalog.pg_start_backup('pgBackRest backup started at ' || current_timestamp, %s, false) as lsn\"]", \ cvtBoolToConstZ(startFastParam))), \ .resultInt = 1}, \ {.session = sessionParam, .function = HRNPQ_CONSUMEINPUT}, \ {.session = sessionParam, .function = HRNPQ_ISBUSY}, \ {.session = sessionParam, .function = HRNPQ_GETRESULT}, \ {.session = sessionParam, .function = HRNPQ_RESULTSTATUS, .resultInt = PGRES_TUPLES_OK}, \ {.session = sessionParam, .function = HRNPQ_NTUPLES, .resultInt = 1}, \ {.session = sessionParam, .function = HRNPQ_NFIELDS, .resultInt = 2}, \ {.session = sessionParam, .function = HRNPQ_FTYPE, .param = "[0]", .resultInt = HRNPQ_TYPE_TEXT}, \ {.session = sessionParam, .function = HRNPQ_FTYPE, .param = "[1]", .resultInt = HRNPQ_TYPE_TEXT}, \ {.session = sessionParam, .function = HRNPQ_GETVALUE, .param = "[0,0]", .resultZ = lsnParam}, \ {.session = sessionParam, .function = HRNPQ_GETVALUE, .param = "[0,1]", .resultZ = walSegmentNameParam}, \ {.session = sessionParam, .function = HRNPQ_CLEAR}, \ {.session = sessionParam, .function = HRNPQ_GETRESULT, .resultNull = true} #define HRNPQ_MACRO_START_BACKUP_GE_10(sessionParam, startFastParam, lsnParam, walSegmentNameParam) \ {.session = sessionParam, \ .function = HRNPQ_SENDQUERY, \ .param = strZ(strNewFmt( \ "[\"select lsn::text as lsn,\\n" \ " pg_catalog.pg_walfile_name(lsn)::text as wal_segment_name\\n" \ " from pg_catalog.pg_start_backup('pgBackRest backup started at ' || current_timestamp, %s, false) as lsn\"]", \ cvtBoolToConstZ(startFastParam))), \ .resultInt = 1}, \ {.session = sessionParam, .function = HRNPQ_CONSUMEINPUT}, \ {.session = sessionParam, .function = HRNPQ_ISBUSY}, \ {.session = sessionParam, .function = HRNPQ_GETRESULT}, \ {.session = sessionParam, .function = HRNPQ_RESULTSTATUS, .resultInt = PGRES_TUPLES_OK}, \ {.session = sessionParam, .function = HRNPQ_NTUPLES, .resultInt = 1}, \ {.session = sessionParam, .function = HRNPQ_NFIELDS, .resultInt = 2}, \ {.session = sessionParam, .function = HRNPQ_FTYPE, .param = "[0]", .resultInt = HRNPQ_TYPE_TEXT}, \ {.session = sessionParam, .function = HRNPQ_FTYPE, .param = "[1]", .resultInt = HRNPQ_TYPE_TEXT}, \ {.session = sessionParam, .function = HRNPQ_GETVALUE, .param = "[0,0]", .resultZ = lsnParam}, \ {.session = sessionParam, .function = HRNPQ_GETVALUE, .param = "[0,1]", .resultZ = walSegmentNameParam}, \ {.session = sessionParam, .function = HRNPQ_CLEAR}, \ {.session = sessionParam, .function = HRNPQ_GETRESULT, .resultNull = true} #define HRNPQ_MACRO_STOP_BACKUP_LE_95(sessionParam, lsnParam, walSegmentNameParam) \ {.session = sessionParam, \ .function = HRNPQ_SENDQUERY, \ .param = \ "[\"select lsn::text as lsn,\\n" \ " pg_catalog.pg_xlogfile_name(lsn)::text as wal_segment_name\\n" \ " from pg_catalog.pg_stop_backup() as lsn\"]", \ .resultInt = 1}, \ {.session = sessionParam, .function = HRNPQ_CONSUMEINPUT}, \ {.session = sessionParam, .function = HRNPQ_ISBUSY}, \ {.session = sessionParam, .function = HRNPQ_GETRESULT}, \ {.session = sessionParam, .function = HRNPQ_RESULTSTATUS, .resultInt = PGRES_TUPLES_OK}, \ {.session = sessionParam, .function = HRNPQ_NTUPLES, .resultInt = 1}, \ {.session = sessionParam, .function = HRNPQ_NFIELDS, .resultInt = 2}, \ {.session = sessionParam, .function = HRNPQ_FTYPE, .param = "[0]", .resultInt = HRNPQ_TYPE_TEXT}, \ {.session = sessionParam, .function = HRNPQ_FTYPE, .param = "[1]", .resultInt = HRNPQ_TYPE_TEXT}, \ {.session = sessionParam, .function = HRNPQ_GETVALUE, .param = "[0,0]", .resultZ = lsnParam}, \ {.session = sessionParam, .function = HRNPQ_GETVALUE, .param = "[0,1]", .resultZ = walSegmentNameParam}, \ {.session = sessionParam, .function = HRNPQ_CLEAR}, \ {.session = sessionParam, .function = HRNPQ_GETRESULT, .resultNull = true} #define HRNPQ_MACRO_STOP_BACKUP_96(sessionParam, lsnParam, walSegmentNameParam, tablespaceMapParam) \ {.session = sessionParam, \ .function = HRNPQ_SENDQUERY, \ .param = \ "[\"select lsn::text as lsn,\\n" \ " pg_catalog.pg_xlogfile_name(lsn)::text as wal_segment_name,\\n" \ " labelfile::text as backuplabel_file,\\n" \ " spcmapfile::text as tablespacemap_file\\n" \ " from pg_catalog.pg_stop_backup(false)\"]", \ .resultInt = 1}, \ {.session = sessionParam, .function = HRNPQ_CONSUMEINPUT}, \ {.session = sessionParam, .function = HRNPQ_ISBUSY}, \ {.session = sessionParam, .function = HRNPQ_GETRESULT}, \ {.session = sessionParam, .function = HRNPQ_RESULTSTATUS, .resultInt = PGRES_TUPLES_OK}, \ {.session = sessionParam, .function = HRNPQ_NTUPLES, .resultInt = 1}, \ {.session = sessionParam, .function = HRNPQ_NFIELDS, .resultInt = 4}, \ {.session = sessionParam, .function = HRNPQ_FTYPE, .param = "[0]", .resultInt = HRNPQ_TYPE_TEXT}, \ {.session = sessionParam, .function = HRNPQ_FTYPE, .param = "[1]", .resultInt = HRNPQ_TYPE_TEXT}, \ {.session = sessionParam, .function = HRNPQ_FTYPE, .param = "[2]", .resultInt = HRNPQ_TYPE_TEXT}, \ {.session = sessionParam, .function = HRNPQ_FTYPE, .param = "[3]", .resultInt = HRNPQ_TYPE_TEXT}, \ {.session = sessionParam, .function = HRNPQ_GETVALUE, .param = "[0,0]", .resultZ = lsnParam}, \ {.session = sessionParam, .function = HRNPQ_GETVALUE, .param = "[0,1]", .resultZ = walSegmentNameParam}, \ {.session = sessionParam, .function = HRNPQ_GETVALUE, .param = "[0,2]", .resultZ = "BACKUP_LABEL_DATA"}, \ {.session = sessionParam, .function = HRNPQ_GETVALUE, .param = "[0,3]", \ .resultZ = tablespaceMapParam ? "TABLESPACE_MAP_DATA" : "\n"}, \ {.session = sessionParam, .function = HRNPQ_CLEAR}, \ {.session = sessionParam, .function = HRNPQ_GETRESULT, .resultNull = true} #define HRNPQ_MACRO_STOP_BACKUP_GE_10(sessionParam, lsnParam, walSegmentNameParam, tablespaceMapParam) \ {.session = sessionParam, \ .function = HRNPQ_SENDQUERY, \ .param = \ "[\"select lsn::text as lsn,\\n" \ " pg_catalog.pg_walfile_name(lsn)::text as wal_segment_name,\\n" \ " labelfile::text as backuplabel_file,\\n" \ " spcmapfile::text as tablespacemap_file\\n" \ " from pg_catalog.pg_stop_backup(false, false)\"]", \ .resultInt = 1}, \ {.session = sessionParam, .function = HRNPQ_CONSUMEINPUT}, \ {.session = sessionParam, .function = HRNPQ_ISBUSY}, \ {.session = sessionParam, .function = HRNPQ_GETRESULT}, \ {.session = sessionParam, .function = HRNPQ_RESULTSTATUS, .resultInt = PGRES_TUPLES_OK}, \ {.session = sessionParam, .function = HRNPQ_NTUPLES, .resultInt = 1}, \ {.session = sessionParam, .function = HRNPQ_NFIELDS, .resultInt = 4}, \ {.session = sessionParam, .function = HRNPQ_FTYPE, .param = "[0]", .resultInt = HRNPQ_TYPE_TEXT}, \ {.session = sessionParam, .function = HRNPQ_FTYPE, .param = "[1]", .resultInt = HRNPQ_TYPE_TEXT}, \ {.session = sessionParam, .function = HRNPQ_FTYPE, .param = "[2]", .resultInt = HRNPQ_TYPE_TEXT}, \ {.session = sessionParam, .function = HRNPQ_FTYPE, .param = "[3]", .resultInt = HRNPQ_TYPE_TEXT}, \ {.session = sessionParam, .function = HRNPQ_GETVALUE, .param = "[0,0]", .resultZ = lsnParam}, \ {.session = sessionParam, .function = HRNPQ_GETVALUE, .param = "[0,1]", .resultZ = walSegmentNameParam}, \ {.session = sessionParam, .function = HRNPQ_GETVALUE, .param = "[0,2]", .resultZ = "BACKUP_LABEL_DATA"}, \ {.session = sessionParam, .function = HRNPQ_GETVALUE, .param = "[0,3]", \ .resultZ = tablespaceMapParam ? "TABLESPACE_MAP_DATA" : "\n"}, \ {.session = sessionParam, .function = HRNPQ_CLEAR}, \ {.session = sessionParam, .function = HRNPQ_GETRESULT, .resultNull = true} #define HRNPQ_MACRO_DATABASE_LIST_1(sessionParam, databaseNameParam) \ {.session = sessionParam, \ .function = HRNPQ_SENDQUERY, \ .param = "[\"select oid::oid, datname::text, datlastsysoid::oid from pg_catalog.pg_database\"]", \ .resultInt = 1}, \ {.session = sessionParam, .function = HRNPQ_CONSUMEINPUT}, \ {.session = sessionParam, .function = HRNPQ_ISBUSY}, \ {.session = sessionParam, .function = HRNPQ_GETRESULT}, \ {.session = sessionParam, .function = HRNPQ_RESULTSTATUS, .resultInt = PGRES_TUPLES_OK}, \ {.session = sessionParam, .function = HRNPQ_NTUPLES, .resultInt = 1}, \ {.session = sessionParam, .function = HRNPQ_NFIELDS, .resultInt = 3}, \ {.session = sessionParam, .function = HRNPQ_FTYPE, .param = "[0]", .resultInt = HRNPQ_TYPE_INT}, \ {.session = sessionParam, .function = HRNPQ_FTYPE, .param = "[1]", .resultInt = HRNPQ_TYPE_TEXT}, \ {.session = sessionParam, .function = HRNPQ_FTYPE, .param = "[2]", .resultInt = HRNPQ_TYPE_INT}, \ {.session = sessionParam, .function = HRNPQ_GETVALUE, .param = "[0,0]", .resultZ = STRINGIFY(16384)}, \ {.session = sessionParam, .function = HRNPQ_GETVALUE, .param = "[0,1]", .resultZ = databaseNameParam}, \ {.session = sessionParam, .function = HRNPQ_GETVALUE, .param = "[0,2]", .resultZ = STRINGIFY(13777)}, \ {.session = sessionParam, .function = HRNPQ_CLEAR}, \ {.session = sessionParam, .function = HRNPQ_GETRESULT, .resultNull = true} #define HRNPQ_MACRO_TABLESPACE_LIST_0(sessionParam) \ {.session = sessionParam, \ .function = HRNPQ_SENDQUERY, .param = "[\"select oid::oid, spcname::text from pg_catalog.pg_tablespace\"]", \ .resultInt = 1}, \ {.session = sessionParam, .function = HRNPQ_CONSUMEINPUT}, \ {.session = sessionParam, .function = HRNPQ_ISBUSY}, \ {.session = sessionParam, .function = HRNPQ_GETRESULT}, \ {.session = sessionParam, .function = HRNPQ_RESULTSTATUS, .resultInt = PGRES_TUPLES_OK}, \ {.session = sessionParam, .function = HRNPQ_NTUPLES, .resultInt = 0}, \ {.session = sessionParam, .function = HRNPQ_NFIELDS, .resultInt = 2}, \ {.session = sessionParam, .function = HRNPQ_FTYPE, .param = "[0]", .resultInt = HRNPQ_TYPE_INT}, \ {.session = sessionParam, .function = HRNPQ_FTYPE, .param = "[1]", .resultInt = HRNPQ_TYPE_TEXT}, \ {.session = sessionParam, .function = HRNPQ_CLEAR}, \ {.session = sessionParam, .function = HRNPQ_GETRESULT, .resultNull = true} #define HRNPQ_MACRO_TABLESPACE_LIST_1(sessionParam, id1Param, name1Param) \ {.session = sessionParam, \ .function = HRNPQ_SENDQUERY, .param = "[\"select oid::oid, spcname::text from pg_catalog.pg_tablespace\"]", \ .resultInt = 1}, \ {.session = sessionParam, .function = HRNPQ_CONSUMEINPUT}, \ {.session = sessionParam, .function = HRNPQ_ISBUSY}, \ {.session = sessionParam, .function = HRNPQ_GETRESULT}, \ {.session = sessionParam, .function = HRNPQ_RESULTSTATUS, .resultInt = PGRES_TUPLES_OK}, \ {.session = sessionParam, .function = HRNPQ_NTUPLES, .resultInt = 1}, \ {.session = sessionParam, .function = HRNPQ_NFIELDS, .resultInt = 2}, \ {.session = sessionParam, .function = HRNPQ_FTYPE, .param = "[0]", .resultInt = HRNPQ_TYPE_INT}, \ {.session = sessionParam, .function = HRNPQ_FTYPE, .param = "[1]", .resultInt = HRNPQ_TYPE_TEXT}, \ {.session = sessionParam, .function = HRNPQ_GETVALUE, .param = "[0,0]", .resultZ = strZ(strNewFmt("%d", id1Param))}, \ {.session = sessionParam, .function = HRNPQ_GETVALUE, .param = "[0,1]", .resultZ = name1Param}, \ {.session = sessionParam, .function = HRNPQ_CLEAR}, \ {.session = sessionParam, .function = HRNPQ_GETRESULT, .resultNull = true} #define HRNPQ_MACRO_CHECKPOINT(sessionParam) \ {.session = sessionParam, .function = HRNPQ_SENDQUERY, .param = "[\"checkpoint\"]", .resultInt = 1}, \ {.session = sessionParam, .function = HRNPQ_CONSUMEINPUT}, \ {.session = sessionParam, .function = HRNPQ_ISBUSY}, \ {.session = sessionParam, .function = HRNPQ_GETRESULT}, \ {.session = sessionParam, .function = HRNPQ_RESULTSTATUS, .resultInt = PGRES_COMMAND_OK}, \ {.session = sessionParam, .function = HRNPQ_CLEAR}, \ {.session = sessionParam, .function = HRNPQ_GETRESULT, .resultNull = true} #define HRNPQ_MACRO_REPLAY_TARGET_REACHED( \ sessionParam, walNameParam, lsnNameParam, targetLsnParam, targetReachedParam, replayLsnParam) \ {.session = sessionParam, \ .function = HRNPQ_SENDQUERY, \ .param = strZ(strNewFmt( \ "[\"select replayLsn::text,\\n" \ " (replayLsn > '%s')::bool as targetReached\\n" \ " from pg_catalog.pg_last_" walNameParam "_replay_" lsnNameParam "() as replayLsn\"]", targetLsnParam)), \ .resultInt = 1}, \ {.session = sessionParam, .function = HRNPQ_CONSUMEINPUT}, \ {.session = sessionParam, .function = HRNPQ_ISBUSY}, \ {.session = sessionParam, .function = HRNPQ_GETRESULT}, \ {.session = sessionParam, .function = HRNPQ_RESULTSTATUS, .resultInt = PGRES_TUPLES_OK}, \ {.session = sessionParam, .function = HRNPQ_NTUPLES, .resultInt = 1}, \ {.session = sessionParam, .function = HRNPQ_NFIELDS, .resultInt = 2}, \ {.session = sessionParam, .function = HRNPQ_FTYPE, .param = "[0]", .resultInt = HRNPQ_TYPE_TEXT}, \ {.session = sessionParam, .function = HRNPQ_FTYPE, .param = "[1]", .resultInt = HRNPQ_TYPE_BOOL}, \ {.session = sessionParam, .function = HRNPQ_GETVALUE, .param = "[0,0]", .resultZ = replayLsnParam}, \ {.session = sessionParam, .function = HRNPQ_GETVALUE, .param = "[0,1]", .resultZ = cvtBoolToConstZ(targetReachedParam)}, \ {.session = sessionParam, .function = HRNPQ_CLEAR}, \ {.session = sessionParam, .function = HRNPQ_GETRESULT, .resultNull = true} #define HRNPQ_MACRO_REPLAY_TARGET_REACHED_LE_96(sessionParam, targetLsnParam, targetReachedParam, reachedLsnParam) \ HRNPQ_MACRO_REPLAY_TARGET_REACHED(sessionParam, "xlog", "location", targetLsnParam, targetReachedParam, reachedLsnParam) #define HRNPQ_MACRO_REPLAY_TARGET_REACHED_GE_10(sessionParam, targetLsnParam, targetReachedParam, reachedLsnParam) \ HRNPQ_MACRO_REPLAY_TARGET_REACHED(sessionParam, "wal", "lsn", targetLsnParam, targetReachedParam, reachedLsnParam) #define HRNPQ_MACRO_CHECKPOINT_TARGET_REACHED(sessionParam, lsnNameParam, targetLsnParam, targetReachedParam, checkpointLsnParam) \ {.session = sessionParam, \ .function = HRNPQ_SENDQUERY, \ .param = strZ(strNewFmt( \ "[\"select (checkpoint_" lsnNameParam " > '%s')::bool as targetReached,\\n" \ " checkpoint_" lsnNameParam "::text as checkpointLsn\\n" \ " from pg_catalog.pg_control_checkpoint()\"]", targetLsnParam)), \ .resultInt = 1}, \ {.session = sessionParam, .function = HRNPQ_CONSUMEINPUT}, \ {.session = sessionParam, .function = HRNPQ_ISBUSY}, \ {.session = sessionParam, .function = HRNPQ_GETRESULT}, \ {.session = sessionParam, .function = HRNPQ_RESULTSTATUS, .resultInt = PGRES_TUPLES_OK}, \ {.session = sessionParam, .function = HRNPQ_NTUPLES, .resultInt = 1}, \ {.session = sessionParam, .function = HRNPQ_NFIELDS, .resultInt = 2}, \ {.session = sessionParam, .function = HRNPQ_FTYPE, .param = "[0]", .resultInt = HRNPQ_TYPE_BOOL}, \ {.session = sessionParam, .function = HRNPQ_FTYPE, .param = "[1]", .resultInt = HRNPQ_TYPE_TEXT}, \ {.session = sessionParam, .function = HRNPQ_GETVALUE, .param = "[0,0]", .resultZ = cvtBoolToConstZ(targetReachedParam)}, \ {.session = sessionParam, .function = HRNPQ_GETVALUE, .param = "[0,1]", .resultZ = checkpointLsnParam}, \ {.session = sessionParam, .function = HRNPQ_CLEAR}, \ {.session = sessionParam, .function = HRNPQ_GETRESULT, .resultNull = true} #define HRNPQ_MACRO_CHECKPOINT_TARGET_REACHED_96(sessionParam, targetLsnParam, targetReachedParam, checkpointLsnParam) \ HRNPQ_MACRO_CHECKPOINT_TARGET_REACHED(sessionParam, "location", targetLsnParam, targetReachedParam, checkpointLsnParam) #define HRNPQ_MACRO_CHECKPOINT_TARGET_REACHED_GE_10(sessionParam, targetLsnParam, targetReachedParam, checkpointLsnParam) \ HRNPQ_MACRO_CHECKPOINT_TARGET_REACHED(sessionParam, "lsn", targetLsnParam, targetReachedParam, checkpointLsnParam) #define HRNPQ_MACRO_REPLAY_WAIT_LE_95(sessionParam, targetLsnParam) \ HRNPQ_MACRO_REPLAY_TARGET_REACHED_LE_96(sessionParam, targetLsnParam, true, "X/X"), \ HRNPQ_MACRO_CHECKPOINT(sessionParam) #define HRNPQ_MACRO_REPLAY_WAIT_96(sessionParam, targetLsnParam) \ HRNPQ_MACRO_REPLAY_TARGET_REACHED_LE_96(sessionParam, targetLsnParam, true, "X/X"), \ HRNPQ_MACRO_CHECKPOINT(sessionParam), \ HRNPQ_MACRO_CHECKPOINT_TARGET_REACHED_96(sessionParam, targetLsnParam, true, "X/X") #define HRNPQ_MACRO_REPLAY_WAIT_GE_10(sessionParam, targetLsnParam) \ HRNPQ_MACRO_REPLAY_TARGET_REACHED_GE_10(sessionParam, targetLsnParam, true, "X/X"), \ HRNPQ_MACRO_CHECKPOINT(sessionParam), \ HRNPQ_MACRO_CHECKPOINT_TARGET_REACHED_GE_10(sessionParam, targetLsnParam, true, "X/X") #define HRNPQ_MACRO_CLOSE(sessionParam) \ {.session = sessionParam, .function = HRNPQ_FINISH} #define HRNPQ_MACRO_DONE() \ {.function = NULL} /*********************************************************************************************************************************** Macros to simplify dbOpen() for specific database versions ***********************************************************************************************************************************/ #define HRNPQ_MACRO_OPEN_LE_91(sessionParam, connectParam, pgVersion, pgPathParam, archiveMode, archiveCommand) \ HRNPQ_MACRO_OPEN(sessionParam, connectParam), \ HRNPQ_MACRO_SET_SEARCH_PATH(sessionParam), \ HRNPQ_MACRO_SET_CLIENT_ENCODING(sessionParam), \ HRNPQ_MACRO_VALIDATE_QUERY(sessionParam, pgVersion, pgPathParam, archiveMode, archiveCommand) #define HRNPQ_MACRO_OPEN_GE_92(sessionParam, connectParam, pgVersion, pgPathParam, standbyParam, archiveMode, archiveCommand) \ HRNPQ_MACRO_OPEN(sessionParam, connectParam), \ HRNPQ_MACRO_SET_SEARCH_PATH(sessionParam), \ HRNPQ_MACRO_SET_CLIENT_ENCODING(sessionParam), \ HRNPQ_MACRO_VALIDATE_QUERY(sessionParam, pgVersion, pgPathParam, archiveMode, archiveCommand), \ HRNPQ_MACRO_SET_APPLICATION_NAME(sessionParam), \ HRNPQ_MACRO_IS_STANDBY_QUERY(sessionParam, standbyParam) #define HRNPQ_MACRO_OPEN_GE_96(sessionParam, connectParam, pgVersion, pgPathParam, standbyParam, archiveMode, archiveCommand) \ HRNPQ_MACRO_OPEN(sessionParam, connectParam), \ HRNPQ_MACRO_SET_SEARCH_PATH(sessionParam), \ HRNPQ_MACRO_SET_CLIENT_ENCODING(sessionParam), \ HRNPQ_MACRO_VALIDATE_QUERY(sessionParam, pgVersion, pgPathParam, archiveMode, archiveCommand), \ HRNPQ_MACRO_SET_APPLICATION_NAME(sessionParam), \ HRNPQ_MACRO_SET_MAX_PARALLEL_WORKERS_PER_GATHER(sessionParam), \ HRNPQ_MACRO_IS_STANDBY_QUERY(sessionParam, standbyParam) /*********************************************************************************************************************************** Data type constants ***********************************************************************************************************************************/ #define HRNPQ_TYPE_BOOL 16 #define HRNPQ_TYPE_INT 20 #define HRNPQ_TYPE_TEXT 25 /*********************************************************************************************************************************** Structure for scripting pq responses ***********************************************************************************************************************************/ typedef struct HarnessPq { unsigned int session; // Session number when multiple sessions are run concurrently const char *function; // Function call expected const char *param; // Params expected by the function for verification int resultInt; // Int result value const char *resultZ; // Zero-terminated result value bool resultNull; // Return null from function that normally returns a struct ptr TimeMSec sleep; // Sleep specified milliseconds before returning from function } HarnessPq; /*********************************************************************************************************************************** Functions ***********************************************************************************************************************************/ void harnessPqScriptSet(HarnessPq *harnessPqScriptParam); // Are we strict about requiring PQfinish()? Strict is a good idea for low-level testing of Pq code but is a nuissance for // higher-level testing since it can mask other errors. When not strict, PGfinish() is allowed at any time and does not need to be // scripted. void harnessPqScriptStrictSet(bool strict); #endif // HARNESS_PQ_REAL #endif
{ "pile_set_name": "Github" }
// // This assembly path is required to be on VS binding paths to successfully deserializing // ToolboxItemData. (Use a unique GUID below to avoid conflicting with other binding paths.) // [$RootKey$\BindingPaths\{16C5BE51-7549-4DCE-973A-1AA42BBB4601}] "$PackageFolder$"=""
{ "pile_set_name": "Github" }
/* * 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. * * Copyright 2012-2020 the original author or authors. */ package org.assertj.core.api.offsetdatetime; import static java.time.OffsetDateTime.now; import static org.assertj.core.api.Assertions.assertThat; import static org.assertj.core.api.Assertions.assertThatThrownBy; import static org.assertj.core.api.BDDAssertions.then; import static org.assertj.core.api.BDDAssertions.thenIllegalArgumentException; import static org.assertj.core.util.AssertionsUtil.expectAssertionError; import static org.mockito.Mockito.verify; import java.time.OffsetDateTime; import java.time.format.DateTimeParseException; import java.time.temporal.Temporal; import org.assertj.core.api.AbstractOffsetDateTimeAssertBaseTest; import org.assertj.core.api.OffsetDateTimeAssert; import org.assertj.core.api.ThrowableAssert.ThrowingCallable; import org.junit.jupiter.api.DisplayName; import org.junit.jupiter.api.Test; /** * @author Joel Costigliola * @author Marcin Zajączkowski */ @DisplayName("OffsetDateTimeAssert isEqualTo") class OffsetDateTimeAssert_isEqualTo_Test extends AbstractOffsetDateTimeAssertBaseTest { private Object otherType = new Object(); @Override protected OffsetDateTimeAssert invoke_api_method() { return assertions.isEqualTo(REFERENCE) .isEqualTo(BEFORE.toString()) .isEqualTo((OffsetDateTime) null) .isEqualTo(otherType); } @Override protected void verify_internal_effects() { verify(comparables).assertEqual(getInfo(assertions), getActual(assertions), REFERENCE); verify(comparables).assertEqual(getInfo(assertions), getActual(assertions), BEFORE); verify(objects).assertEqual(getInfo(assertions), getActual(assertions), null); verify(comparables).assertEqual(getInfo(assertions), getActual(assertions), otherType); } @Test void should_pass_if_actual_is_equal_to_offsetDateTime_with_different_offset() { assertThat(REFERENCE_WITH_DIFFERENT_OFFSET).isEqualTo(REFERENCE); } @Test void should_pass_if_actual_is_equal_to_offsetDateTime_with_different_offset_as_a_Temporal() { // GIVEN Temporal reference = REFERENCE; // WHEN/THEN then(REFERENCE_WITH_DIFFERENT_OFFSET).isEqualTo(reference); } @Test void should_fail_if_actual_is_not_equal_to_offsetDateTime_with_different_offset() { // WHEN AssertionError assertionError = expectAssertionError(() -> assertThat(AFTER_WITH_DIFFERENT_OFFSET).isEqualTo(REFERENCE)); // THEN then(assertionError).hasMessage("%nExpecting:%n <%s>%nto be equal to:%n <%s>%nwhen comparing values using 'OffsetDateTime.timeLineOrder()'%nbut was not.", AFTER_WITH_DIFFERENT_OFFSET + " (java.time.OffsetDateTime)", REFERENCE + " (java.time.OffsetDateTime)"); } @Test void should_fail_if_offsetDateTime_as_string_parameter_is_null() { // GIVEN String otherOffsetDateTimeAsString = null; // WHEN ThrowingCallable code = () -> assertThat(now()).isEqualTo(otherOffsetDateTimeAsString); // THEN thenIllegalArgumentException().isThrownBy(code) .withMessage("The String representing the OffsetDateTime to compare actual with should not be null"); } @Test void should_pass_if_both_are_null() { // GIVEN OffsetDateTime nullActual = null; OffsetDateTime nullExpected = null; // WHEN/THEN then(nullActual).isEqualTo(nullExpected); } @Test void should_fail_if_given_string_parameter_cant_be_parsed() { assertThatThrownBy(() -> assertions.isEqualTo("not an OffsetDateTime")).isInstanceOf(DateTimeParseException.class); } }
{ "pile_set_name": "Github" }
/* Copyright The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. */ // Code generated by client-gen. DO NOT EDIT. package v1 import ( rest "k8s.io/client-go/rest" ) // SelfSubjectAccessReviewsGetter has a method to return a SelfSubjectAccessReviewInterface. // A group's client should implement this interface. type SelfSubjectAccessReviewsGetter interface { SelfSubjectAccessReviews() SelfSubjectAccessReviewInterface } // SelfSubjectAccessReviewInterface has methods to work with SelfSubjectAccessReview resources. type SelfSubjectAccessReviewInterface interface { SelfSubjectAccessReviewExpansion } // selfSubjectAccessReviews implements SelfSubjectAccessReviewInterface type selfSubjectAccessReviews struct { client rest.Interface } // newSelfSubjectAccessReviews returns a SelfSubjectAccessReviews func newSelfSubjectAccessReviews(c *AuthorizationV1Client) *selfSubjectAccessReviews { return &selfSubjectAccessReviews{ client: c.RESTClient(), } }
{ "pile_set_name": "Github" }
"Start(bb0[0])" "Mid(bb0[0])" "Mid(bb0[0])" "Start(bb0[1])" "Start(bb0[1])" "Mid(bb0[1])" "Mid(bb0[1])" "Start(bb0[2])" "Start(bb0[2])" "Mid(bb0[2])" "Mid(bb0[2])" "Start(bb0[3])" "Start(bb0[3])" "Mid(bb0[3])" "Mid(bb0[3])" "Start(bb0[4])" "Start(bb0[4])" "Mid(bb0[4])" "Mid(bb0[4])" "Start(bb0[5])" "Start(bb0[5])" "Mid(bb0[5])" "Mid(bb0[5])" "Start(bb0[6])" "Start(bb0[6])" "Mid(bb0[6])" "Mid(bb0[6])" "Start(bb0[7])" "Start(bb0[7])" "Mid(bb0[7])" "Mid(bb0[7])" "Start(bb0[8])" "Start(bb0[8])" "Mid(bb0[8])" "Mid(bb0[8])" "Start(bb0[9])" "Start(bb0[9])" "Mid(bb0[9])" "Mid(bb0[9])" "Start(bb0[10])" "Start(bb0[10])" "Mid(bb0[10])" "Mid(bb0[10])" "Start(bb0[11])" "Start(bb0[11])" "Mid(bb0[11])" "Mid(bb0[11])" "Start(bb4[0])" "Mid(bb0[11])" "Start(bb3[0])" "Start(bb1[0])" "Mid(bb1[0])" "Start(bb2[0])" "Mid(bb2[0])" "Mid(bb2[0])" "Start(bb1[0])" "Start(bb3[0])" "Mid(bb3[0])" "Mid(bb3[0])" "Start(bb2[0])" "Start(bb4[0])" "Mid(bb4[0])" "Mid(bb4[0])" "Start(bb5[0])" "Mid(bb4[0])" "Start(bb2[0])" "Start(bb5[0])" "Mid(bb5[0])" "Mid(bb5[0])" "Start(bb5[1])" "Start(bb5[1])" "Mid(bb5[1])" "Mid(bb5[1])" "Start(bb5[2])" "Start(bb5[2])" "Mid(bb5[2])" "Mid(bb5[2])" "Start(bb6[0])" "Mid(bb5[2])" "Start(bb2[0])" "Start(bb6[0])" "Mid(bb6[0])" "Mid(bb6[0])" "Start(bb6[1])" "Start(bb6[1])" "Mid(bb6[1])" "Mid(bb6[1])" "Start(bb6[2])" "Start(bb6[2])" "Mid(bb6[2])" "Mid(bb6[2])" "Start(bb6[3])" "Start(bb6[3])" "Mid(bb6[3])" "Mid(bb6[3])" "Start(bb6[4])" "Start(bb6[4])" "Mid(bb6[4])" "Mid(bb6[4])" "Start(bb6[5])" "Start(bb6[5])" "Mid(bb6[5])" "Mid(bb6[5])" "Start(bb6[6])" "Start(bb6[6])" "Mid(bb6[6])" "Mid(bb6[6])" "Start(bb6[7])" "Start(bb6[7])" "Mid(bb6[7])" "Mid(bb6[7])" "Start(bb7[0])" "Mid(bb6[7])" "Start(bb8[0])" "Start(bb7[0])" "Mid(bb7[0])" "Mid(bb7[0])" "Start(bb7[1])" "Start(bb7[1])" "Mid(bb7[1])" "Mid(bb7[1])" "Start(bb10[0])" "Mid(bb7[1])" "Start(bb9[0])" "Start(bb8[0])" "Mid(bb8[0])" "Mid(bb8[0])" "Start(bb1[0])" "Start(bb9[0])" "Mid(bb9[0])" "Mid(bb9[0])" "Start(bb11[0])" "Mid(bb9[0])" "Start(bb10[0])" "Start(bb10[0])" "Mid(bb10[0])" "Mid(bb10[0])" "Start(bb10[1])" "Start(bb10[1])" "Mid(bb10[1])" "Mid(bb10[1])" "Start(bb13[0])" "Mid(bb10[1])" "Start(bb8[0])" "Start(bb11[0])" "Mid(bb11[0])" "Mid(bb11[0])" "Start(bb11[1])" "Start(bb11[1])" "Mid(bb11[1])" "Mid(bb11[1])" "Start(bb11[2])" "Start(bb11[2])" "Mid(bb11[2])" "Mid(bb11[2])" "Start(bb11[3])" "Start(bb11[3])" "Mid(bb11[3])" "Mid(bb11[3])" "Start(bb11[4])" "Start(bb11[4])" "Mid(bb11[4])" "Mid(bb11[4])" "Start(bb11[5])" "Start(bb11[5])" "Mid(bb11[5])" "Mid(bb11[5])" "Start(bb12[0])" "Mid(bb11[5])" "Start(bb8[0])" "Start(bb12[0])" "Mid(bb12[0])" "Mid(bb12[0])" "Start(bb12[1])" "Start(bb12[1])" "Mid(bb12[1])" "Mid(bb12[1])" "Start(bb12[2])" "Start(bb12[2])" "Mid(bb12[2])" "Mid(bb12[2])" "Start(bb12[3])" "Start(bb12[3])" "Mid(bb12[3])" "Mid(bb12[3])" "Start(bb12[4])" "Start(bb12[4])" "Mid(bb12[4])" "Mid(bb12[4])" "Start(bb14[0])" "Start(bb13[0])" "Mid(bb13[0])" "Mid(bb13[0])" "Start(bb13[1])" "Start(bb13[1])" "Mid(bb13[1])" "Mid(bb13[1])" "Start(bb13[2])" "Start(bb13[2])" "Mid(bb13[2])" "Mid(bb13[2])" "Start(bb14[0])" "Start(bb14[0])" "Mid(bb14[0])" "Mid(bb14[0])" "Start(bb14[1])" "Start(bb14[1])" "Mid(bb14[1])" "Mid(bb14[1])" "Start(bb14[2])" "Start(bb14[2])" "Mid(bb14[2])" "Mid(bb14[2])" "Start(bb14[3])" "Start(bb14[3])" "Mid(bb14[3])" "Mid(bb14[3])" "Start(bb15[0])" "Mid(bb14[3])" "Start(bb8[0])" "Start(bb15[0])" "Mid(bb15[0])" "Mid(bb15[0])" "Start(bb15[1])" "Start(bb15[1])" "Mid(bb15[1])" "Mid(bb15[1])" "Start(bb15[2])" "Start(bb15[2])" "Mid(bb15[2])" "Mid(bb15[2])" "Start(bb15[3])" "Start(bb15[3])" "Mid(bb15[3])" "Mid(bb15[3])" "Start(bb15[4])" "Start(bb15[4])" "Mid(bb15[4])" "Mid(bb15[4])" "Start(bb16[0])" "Mid(bb15[4])" "Start(bb17[0])" "Start(bb16[0])" "Mid(bb16[0])" "Mid(bb16[0])" "Start(bb16[1])" "Start(bb16[1])" "Mid(bb16[1])" "Mid(bb16[1])" "Start(bb16[2])" "Start(bb16[2])" "Mid(bb16[2])" "Mid(bb16[2])" "Start(bb16[3])" "Start(bb16[3])" "Mid(bb16[3])" "Mid(bb16[3])" "Start(bb16[4])" "Start(bb16[4])" "Mid(bb16[4])" "Mid(bb16[4])" "Start(bb18[0])" "Mid(bb16[4])" "Start(bb1[0])" "Start(bb17[0])" "Mid(bb17[0])" "Mid(bb17[0])" "Start(bb8[0])" "Start(bb18[0])" "Mid(bb18[0])" "Mid(bb18[0])" "Start(bb18[1])" "Start(bb18[1])" "Mid(bb18[1])" "Mid(bb18[1])" "Start(bb18[2])" "Start(bb18[2])" "Mid(bb18[2])"
{ "pile_set_name": "Github" }
<% provide(:title, "Help") %> <h1>Help</h1> <p> Get help on the Ruby on Rails Tutorial at the <a href="http://railstutorial.jp/help">Rails Tutorial help page</a>. To get help on this sample app, see the <a href="http://railstutorial.jp/book"><em>Ruby on Rails Tutorial</em> book</a>. </p>
{ "pile_set_name": "Github" }
# This Source Code Form is subject to the terms of the Mozilla Public # License, v. 2.0. If a copy of the MPL was not distributed with this # file, You can obtain one at http://mozilla.org/MPL/2.0/. searchtip=Zoeken bij %S # LOCALIZATION NOTE (searchPlaceholder): this is shown in the searchbox when # the user hasn't typed anything yet. searchPlaceholder=Zoeken # LOCALIZATION NOTE (searchHeader): this is displayed at the top of the panel # showing search suggestions. # %S is replaced with the name of the current default search engine. searchHeader=%S doorzoeken # LOCALIZATION NOTE (cmd_pasteAndSearch): "Search" is a verb, this is the # search bar equivalent to the url bar's "Paste & Go" cmd_pasteAndSearch=Plakken & Zoeken cmd_clearHistory=Zoekgeschiedenis wissen cmd_clearHistory_accesskey=Z cmd_showSuggestions=Suggesties tonen cmd_showSuggestions_accesskey=S # LOCALIZATION NOTE (cmd_addFoundEngine): %S is replaced by the name of # a search engine offered by a web page. Each engine is displayed as a # menuitem at the bottom of the search panel. cmd_addFoundEngine=‘%S’ toevoegen # LOCALIZATION NOTE (cmd_addFoundEngineMenu): When more than 5 engines # are offered by a web page, instead of listing all of them in the # search panel using the cmd_addFoundEngine string, they will be # grouped in a submenu using cmd_addFoundEngineMenu as a label. cmd_addFoundEngineMenu=Zoekmachine toevoegen # LOCALIZATION NOTE (searchForSomethingWith): # This string is used to build the header above the list of one-click # search providers: "Search for <user-typed string> with:" # NB: please leave the <span> and its class exactly as it is in English. searchForSomethingWith=Zoeken naar <span class='contentSearchSearchWithHeaderSearchText'></span> met: # LOCALIZATION NOTE (searchWithHeader): # The wording of this string should be as close as possible to # searchForSomethingWith. This string will be used when the user # has not typed anything. searchWithHeader=Zoeken met: # LOCALIZATION NOTE (searchSettings): # This is the label for the button that opens Search preferences. searchSettings=Zoekinstellingen wijzigen
{ "pile_set_name": "Github" }
// // HEPhotoBrowserAnimator.swift // SwiftPhotoSelector // // Created by heyode on 2018/9/20. // Copyright (c) 2018 heyode <[email protected]> // // Permission is hereby granted, free of charge, to any person obtaining a copy // of this software and associated documentation files (the "Software"), to deal // in the Software without restriction, including without limitation the rights // to use, copy, modify, merge, publish, distribute, sublicense, and/or sell // copies of the Software, and to permit persons to whom the Software is // furnished to do so, subject to the following conditions: // // The above copyright notice and this permission notice shall be included in // all copies or substantial portions of the Software. // // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, // FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE // AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, // OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN // THE SOFTWARE. import UIKit //MARK: - push或者present目标vc需要实现的协议 public protocol HETargetViewControllerDelegate : UIViewController { /// 目标vc需要展示的UIImageView /// /// - Returns: 目标vc需要展示的UIImageView func getTargetImageView() -> UIImageView } //MARK: - 定义协议用来拿到图片起始位置;最终位置和图片 public protocol HEPhotoBrowserAnimatorPushDelegate : class { /// 获取图片动画前的位置 /// /// - Parameter indexPath: 图片的下标 /// - Returns: 动画开始前图片在keywindow上的frame func imageViewRectOfAnimatorStart(at indexPath : IndexPath) ->CGRect /// 获取图片动画后的位置 /// /// - Parameter indexPath: 图片的下标 /// - Returns: 动画开始后图片在keywindow上的frame func imageViewRectOfAnimatorEnd(at indexPath : IndexPath) ->CGRect } public protocol HEPhotoBrowserAnimatorPopDelegate : class{ /// 获取当前浏览的图片的下标 /// /// - Returns: 当前浏览图片的下标 func indexOfPopViewImageView() -> IndexPath /// 获取当前浏览的图片 /// /// - Returns: 当前浏览的图片 func imageViewOfPopView() -> UIImageView } public enum HETransitionType :Int { case navigation case modal } public class HEPhotoBrowserAnimator: NSObject { public var transitionType : HETransitionType = .navigation /// transitionType == modal时,判断当前动画是present还是dismiss public var isPresented: Bool! public weak var popDelegate : HEPhotoBrowserAnimatorPopDelegate? public weak var pushDelegate : HEPhotoBrowserAnimatorPushDelegate? // 用于接受外界的图片索引 public var selIndex : IndexPath? // 用于接受外界的operation public var operation:UINavigationController.Operation! // dimmiss不能共用单独写出来 public func dimmiss(transitionContext: UIViewControllerContextTransitioning){ guard let popDel = popDelegate ,let index = popDelegate?.indexOfPopViewImageView(),let toFrame = pushDelegate?.imageViewRectOfAnimatorStart(at: index)else { return } let containerview = transitionContext.containerView let tempImageView = UIImageView() tempImageView.image = popDel.imageViewOfPopView().image tempImageView.frame = popDel.imageViewOfPopView().frame tempImageView.layer.masksToBounds = true tempImageView.contentMode = .scaleAspectFill containerview.addSubview(tempImageView) UIView.animate(withDuration: transitionDuration(using: transitionContext), animations: { tempImageView.frame = toFrame }) { (finished: Bool) in //告诉上下文动画完成 transitionContext.completeTransition(true) } } public func popAnimator(transitionContext: UIViewControllerContextTransitioning,isPop:Bool ) { guard let toViewController = transitionContext.viewController(forKey: UITransitionContextViewControllerKey.to) , let popDel = popDelegate ,let index = popDelegate?.indexOfPopViewImageView(),let toFrame = pushDelegate?.imageViewRectOfAnimatorStart(at: index) else { return } let containerview = transitionContext.containerView if isPop { // pop时的处理 toViewController.view.alpha = 0 containerview.addSubview(toViewController.view) }else{// dismiss时特殊处理 let dismissView = transitionContext.view(forKey: UITransitionContextViewKey.from) dismissView?.removeFromSuperview() } let tempImageView = UIImageView() tempImageView.image = popDel.imageViewOfPopView().image tempImageView.frame = popDel.imageViewOfPopView().frame tempImageView.layer.masksToBounds = true tempImageView.contentMode = .scaleAspectFill containerview.addSubview(tempImageView) UIView.animate(withDuration: transitionDuration(using: transitionContext), animations: { tempImageView.frame = toFrame if isPop == true{// pop时的处理 toViewController.view.alpha = 1.0 } }) { (finished: Bool) in if isPop{// pop时的处理 tempImageView.removeFromSuperview() } //告诉上下文动画完成 transitionContext.completeTransition(true) } } public func pushAnimator(transitionContext: UIViewControllerContextTransitioning) { guard let toViewController = transitionContext.viewController(forKey: UITransitionContextViewControllerKey.to) as? HETargetViewControllerDelegate, let pushDel = pushDelegate,let indexPath = selIndex else { return } let containerView = transitionContext.containerView let backgroundView = UIView.init(frame: containerView.bounds) backgroundView.backgroundColor = UIColor.black containerView.addSubview(backgroundView) containerView.addSubview(toViewController.view) let animateImageView = toViewController.getTargetImageView() animateImageView.frame = pushDel.imageViewRectOfAnimatorStart(at: indexPath) backgroundView.addSubview(animateImageView) let targartSize = zommView(orgmSize: toViewController.getTargetImageView().frame.size) toViewController.view.isHidden = true UIView.animate(withDuration: transitionDuration(using: transitionContext), delay: 0, options: UIView.AnimationOptions.curveEaseInOut, animations: { animateImageView.frame = CGRect.init(origin: CGPoint.zero, size: targartSize) animateImageView.center = backgroundView.center },completion: { finished in backgroundView.removeFromSuperview() toViewController.view.isHidden = false transitionContext.completeTransition(true) }) } private func zommView(orgmSize:CGSize) -> CGSize { var culH = kScreenHeight let culW = kScreenWidth let x = orgmSize.width / kScreenWidth culH = orgmSize.height * x return CGSize.init(width: culW, height: culH) } } extension HEPhotoBrowserAnimator : UIViewControllerAnimatedTransitioning,UIViewControllerTransitioningDelegate{ public func animationController(forPresented presented: UIViewController, presenting: UIViewController, source: UIViewController) -> UIViewControllerAnimatedTransitioning? { isPresented = true return self } public func animationController(forDismissed dismissed: UIViewController) -> UIViewControllerAnimatedTransitioning? { isPresented = false return self } // 返回动画时间 public func transitionDuration(using transitionContext: UIViewControllerContextTransitioning?) -> TimeInterval { return 0.3 } // 要设置的动画 //UIKit calls this method when presenting or dismissing a view controller. Use this method to configure the animations associated with your custom transition. You can use view-based animations or Core Animation to configure your animations. public func animateTransition(using transitionContext: UIViewControllerContextTransitioning) { if transitionType == .navigation{ // 用于push时的过场动画 if operation == UINavigationController.Operation.pop { popAnimator(transitionContext: transitionContext,isPop: true) } else { pushAnimator(transitionContext: transitionContext) } }else{ // 用于present时的过场动画 if isPresented { pushAnimator(transitionContext: transitionContext) } else { popAnimator(transitionContext: transitionContext,isPop: false) } } } }
{ "pile_set_name": "Github" }
/* * Copyright 1995-2016 The OpenSSL Project Authors. All Rights Reserved. * * Licensed under the OpenSSL license (the "License"). You may not use * this file except in compliance with the License. You can obtain a copy * in the file LICENSE in the source distribution or at * https://www.openssl.org/source/license.html */ #ifndef HEADER_RIPEMD_H # define HEADER_RIPEMD_H # include <openssl/opensslconf.h> #ifndef OPENSSL_NO_RMD160 # include <openssl/e_os2.h> # include <stddef.h> # ifdef __cplusplus extern "C" { # endif # define RIPEMD160_LONG unsigned int # define RIPEMD160_CBLOCK 64 # define RIPEMD160_LBLOCK (RIPEMD160_CBLOCK/4) # define RIPEMD160_DIGEST_LENGTH 20 typedef struct RIPEMD160state_st { RIPEMD160_LONG A, B, C, D, E; RIPEMD160_LONG Nl, Nh; RIPEMD160_LONG data[RIPEMD160_LBLOCK]; unsigned int num; } RIPEMD160_CTX; int RIPEMD160_Init(RIPEMD160_CTX *c); int RIPEMD160_Update(RIPEMD160_CTX *c, const void *data, size_t len); int RIPEMD160_Final(unsigned char *md, RIPEMD160_CTX *c); unsigned char *RIPEMD160(const unsigned char *d, size_t n, unsigned char *md); void RIPEMD160_Transform(RIPEMD160_CTX *c, const unsigned char *b); # ifdef __cplusplus } # endif # endif #endif
{ "pile_set_name": "Github" }
#!/usr/bin/env bash # 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. # The name of the script being executed. HADOOP_SHELL_EXECNAME="yarn" MYNAME="${BASH_SOURCE-$0}" ## @description build up the yarn command's usage text. ## @audience public ## @stability stable ## @replaceable no function hadoop_usage { hadoop_add_option "--buildpaths" "attempt to add class files from build tree" hadoop_add_option "--daemon (start|status|stop)" "operate on a daemon" hadoop_add_option "--hostnames list[,of,host,names]" "hosts to use in worker mode" hadoop_add_option "--loglevel level" "set the log4j level for this command" hadoop_add_option "--hosts filename" "list of hosts to use in worker mode" hadoop_add_option "--workers" "turn on worker mode" hadoop_add_subcommand "app|application" client "prints application(s) report/kill application/manage long running application" hadoop_add_subcommand "applicationattempt" client "prints applicationattempt(s) report" hadoop_add_subcommand "classpath" client "prints the class path needed to get the hadoop jar and the required libraries" hadoop_add_subcommand "cluster" client "prints cluster information" hadoop_add_subcommand "container" client "prints container(s) report" hadoop_add_subcommand "daemonlog" admin "get/set the log level for each daemon" hadoop_add_subcommand "envvars" client "display computed Hadoop environment variables" hadoop_add_subcommand "jar <jar>" client "run a jar file" hadoop_add_subcommand "logs" client "dump container logs" hadoop_add_subcommand "node" admin "prints node report(s)" hadoop_add_subcommand "nodemanager" daemon "run a nodemanager on each worker" hadoop_add_subcommand "proxyserver" daemon "run the web app proxy server" hadoop_add_subcommand "queue" client "prints queue information" hadoop_add_subcommand "registrydns" daemon "run the registry DNS server" hadoop_add_subcommand "resourcemanager" daemon "run the ResourceManager" hadoop_add_subcommand "fs2cs" client "converts Fair Scheduler configuration to Capacity Scheduler (EXPERIMENTAL)" hadoop_add_subcommand "rmadmin" admin "admin tools" hadoop_add_subcommand "router" daemon "run the Router daemon" hadoop_add_subcommand "schedulerconf" client "Updates scheduler configuration" hadoop_add_subcommand "scmadmin" admin "SharedCacheManager admin tools" hadoop_add_subcommand "sharedcachemanager" daemon "run the SharedCacheManager daemon" hadoop_add_subcommand "timelinereader" client "run the timeline reader server" hadoop_add_subcommand "timelineserver" daemon "run the timeline server" hadoop_add_subcommand "top" client "view cluster information" hadoop_add_subcommand "nodeattributes" client "node attributes cli client" hadoop_add_subcommand "version" client "print the version" hadoop_generate_usage "${HADOOP_SHELL_EXECNAME}" true } ## @description Default command handler for yarn command ## @audience public ## @stability stable ## @replaceable no ## @param CLI arguments function yarncmd_case { subcmd=$1 shift case ${subcmd} in app|application|applicationattempt|container) HADOOP_CLASSNAME=org.apache.hadoop.yarn.client.cli.ApplicationCLI set -- "${subcmd}" "$@" HADOOP_SUBCMD_ARGS=("$@") local sld="${HADOOP_YARN_HOME}/${YARN_DIR},\ ${HADOOP_YARN_HOME}/${YARN_LIB_JARS_DIR},\ ${HADOOP_HDFS_HOME}/${HDFS_DIR},\ ${HADOOP_HDFS_HOME}/${HDFS_LIB_JARS_DIR},\ ${HADOOP_COMMON_HOME}/${HADOOP_COMMON_DIR},\ ${HADOOP_COMMON_HOME}/${HADOOP_COMMON_LIB_JARS_DIR}" hadoop_translate_cygwin_path sld hadoop_add_param HADOOP_OPTS service.libdir "-Dservice.libdir=${sld}" ;; classpath) hadoop_do_classpath_subcommand HADOOP_CLASSNAME "$@" ;; cluster) HADOOP_CLASSNAME=org.apache.hadoop.yarn.client.cli.ClusterCLI ;; daemonlog) HADOOP_CLASSNAME=org.apache.hadoop.log.LogLevel ;; envvars) echo "JAVA_HOME='${JAVA_HOME}'" echo "HADOOP_YARN_HOME='${HADOOP_YARN_HOME}'" echo "YARN_DIR='${YARN_DIR}'" echo "YARN_LIB_JARS_DIR='${YARN_LIB_JARS_DIR}'" echo "HADOOP_CONF_DIR='${HADOOP_CONF_DIR}'" echo "HADOOP_TOOLS_HOME='${HADOOP_TOOLS_HOME}'" echo "HADOOP_TOOLS_DIR='${HADOOP_TOOLS_DIR}'" echo "HADOOP_TOOLS_LIB_JARS_DIR='${HADOOP_TOOLS_LIB_JARS_DIR}'" exit 0 ;; jar) HADOOP_CLASSNAME=org.apache.hadoop.util.RunJar ;; historyserver) HADOOP_SUBCMD_SUPPORTDAEMONIZATION="true" echo "DEPRECATED: Use of this command to start the timeline server is deprecated." 1>&2 echo "Instead use the timelineserver command for it." 1>&2 echo "Starting the History Server anyway..." 1>&2 HADOOP_CLASSNAME='org.apache.hadoop.yarn.server.applicationhistoryservice.ApplicationHistoryServer' ;; logs) HADOOP_CLASSNAME=org.apache.hadoop.yarn.client.cli.LogsCLI ;; node) HADOOP_CLASSNAME=org.apache.hadoop.yarn.client.cli.NodeCLI ;; nodemanager) HADOOP_SUBCMD_SUPPORTDAEMONIZATION="true" hadoop_add_classpath "$HADOOP_YARN_HOME/$YARN_DIR/timelineservice/*" hadoop_add_classpath "$HADOOP_YARN_HOME/$YARN_DIR/timelineservice/lib/*" HADOOP_CLASSNAME='org.apache.hadoop.yarn.server.nodemanager.NodeManager' # Backwards compatibility if [[ -n "${YARN_NODEMANAGER_HEAPSIZE}" ]]; then HADOOP_HEAPSIZE_MAX="${YARN_NODEMANAGER_HEAPSIZE}" fi ;; proxyserver) HADOOP_SUBCMD_SUPPORTDAEMONIZATION="true" HADOOP_CLASSNAME='org.apache.hadoop.yarn.server.webproxy.WebAppProxyServer' # Backwards compatibility if [[ -n "${YARN_PROXYSERVER_HEAPSIZE}" ]]; then HADOOP_HEAPSIZE_MAX="${YARN_PROXYSERVER_HEAPSIZE}" fi ;; queue) HADOOP_CLASSNAME=org.apache.hadoop.yarn.client.cli.QueueCLI ;; registrydns) echo "DEPRECATED: Use of this command is deprecated." 1>&2 HADOOP_SUBCMD_SUPPORTDAEMONIZATION="true" HADOOP_SECURE_CLASSNAME='org.apache.hadoop.registry.server.dns.PrivilegedRegistryDNSStarter' HADOOP_CLASSNAME='org.apache.hadoop.registry.server.dns.RegistryDNSServer' ;; resourcemanager) HADOOP_SUBCMD_SUPPORTDAEMONIZATION="true" hadoop_add_classpath "$HADOOP_YARN_HOME/$YARN_DIR/timelineservice/*" hadoop_add_classpath "$HADOOP_YARN_HOME/$YARN_DIR/timelineservice/lib/*" HADOOP_CLASSNAME='org.apache.hadoop.yarn.server.resourcemanager.ResourceManager' # Backwards compatibility if [[ -n "${YARN_RESOURCEMANAGER_HEAPSIZE}" ]]; then HADOOP_HEAPSIZE_MAX="${YARN_RESOURCEMANAGER_HEAPSIZE}" fi local sld="${HADOOP_YARN_HOME}/${YARN_DIR},\ ${HADOOP_YARN_HOME}/${YARN_LIB_JARS_DIR},\ ${HADOOP_HDFS_HOME}/${HDFS_DIR},\ ${HADOOP_HDFS_HOME}/${HDFS_LIB_JARS_DIR},\ ${HADOOP_COMMON_HOME}/${HADOOP_COMMON_DIR},\ ${HADOOP_COMMON_HOME}/${HADOOP_COMMON_LIB_JARS_DIR}" hadoop_translate_cygwin_path sld hadoop_add_param HADOOP_OPTS service.libdir "-Dservice.libdir=${sld}" ;; fs2cs) HADOOP_CLASSNAME="org.apache.hadoop.yarn.server.resourcemanager.scheduler.fair.converter.FSConfigToCSConfigConverterMain" ;; rmadmin) HADOOP_CLASSNAME='org.apache.hadoop.yarn.client.cli.RMAdminCLI' ;; router) HADOOP_SUBCMD_SUPPORTDAEMONIZATION="true" HADOOP_CLASSNAME='org.apache.hadoop.yarn.server.router.Router' ;; schedulerconf) HADOOP_CLASSNAME='org.apache.hadoop.yarn.client.cli.SchedConfCLI' ;; scmadmin) HADOOP_CLASSNAME='org.apache.hadoop.yarn.client.SCMAdmin' ;; sharedcachemanager) HADOOP_SUBCMD_SUPPORTDAEMONIZATION="true" HADOOP_CLASSNAME='org.apache.hadoop.yarn.server.sharedcachemanager.SharedCacheManager' ;; timelinereader) HADOOP_SUBCMD_SUPPORTDAEMONIZATION="true" hadoop_add_classpath "$HADOOP_YARN_HOME/$YARN_DIR/timelineservice/*" hadoop_add_classpath "$HADOOP_YARN_HOME/$YARN_DIR/timelineservice/lib/*" HADOOP_CLASSNAME='org.apache.hadoop.yarn.server.timelineservice.reader.TimelineReaderServer' ;; nodeattributes) HADOOP_SUBCMD_SUPPORTDAEMONIZATION="false" HADOOP_CLASSNAME='org.apache.hadoop.yarn.client.cli.NodeAttributesCLI' ;; timelineserver) HADOOP_SUBCMD_SUPPORTDAEMONIZATION="true" HADOOP_CLASSNAME='org.apache.hadoop.yarn.server.applicationhistoryservice.ApplicationHistoryServer' # Backwards compatibility if [[ -n "${YARN_TIMELINESERVER_HEAPSIZE}" ]]; then HADOOP_HEAPSIZE_MAX="${YARN_TIMELINESERVER_HEAPSIZE}" fi ;; version) HADOOP_CLASSNAME=org.apache.hadoop.util.VersionInfo ;; top) doNotSetCols=0 doNotSetRows=0 for i in "$@"; do if [[ $i == "-cols" ]]; then doNotSetCols=1 fi if [[ $i == "-rows" ]]; then doNotSetRows=1 fi done if [ $doNotSetCols == 0 ] && [ -n "${TERM}" ]; then cols=$(tput cols) if [ -n "$cols" ]; then args=( $@ ) args=("${args[@]}" "-cols" "$cols") set -- "${args[@]}" fi fi if [ $doNotSetRows == 0 ] && [ -n "${TERM}" ]; then rows=$(tput lines) if [ -n "$rows" ]; then args=( $@ ) args=("${args[@]}" "-rows" "$rows") set -- "${args[@]}" fi fi HADOOP_CLASSNAME=org.apache.hadoop.yarn.client.cli.TopCLI HADOOP_SUBCMD_ARGS=("$@") ;; *) HADOOP_CLASSNAME="${subcmd}" if ! hadoop_validate_classname "${HADOOP_CLASSNAME}"; then hadoop_exit_with_usage 1 fi ;; esac } # let's locate libexec... if [[ -n "${HADOOP_HOME}" ]]; then HADOOP_DEFAULT_LIBEXEC_DIR="${HADOOP_HOME}/libexec" else bin=$(cd -P -- "$(dirname -- "${MYNAME}")" >/dev/null && pwd -P) HADOOP_DEFAULT_LIBEXEC_DIR="${bin}/../libexec" fi HADOOP_LIBEXEC_DIR="${HADOOP_LIBEXEC_DIR:-$HADOOP_DEFAULT_LIBEXEC_DIR}" HADOOP_NEW_CONFIG=true if [[ -f "${HADOOP_LIBEXEC_DIR}/yarn-config.sh" ]]; then # shellcheck source=./hadoop-yarn-project/hadoop-yarn/bin/yarn-config.sh . "${HADOOP_LIBEXEC_DIR}/yarn-config.sh" else echo "ERROR: Cannot execute ${HADOOP_LIBEXEC_DIR}/yarn-config.sh." 2>&1 exit 1 fi # now that we have support code, let's abs MYNAME so we can use it later MYNAME=$(hadoop_abs "${MYNAME}") # if no args specified, show usage if [[ $# = 0 ]]; then hadoop_exit_with_usage 1 fi # get arguments HADOOP_SUBCMD=$1 shift if hadoop_need_reexec yarn "${HADOOP_SUBCMD}"; then hadoop_uservar_su yarn "${HADOOP_SUBCMD}" \ "${MYNAME}" \ "--reexec" \ "${HADOOP_USER_PARAMS[@]}" exit $? fi hadoop_verify_user_perm "${HADOOP_SHELL_EXECNAME}" "${HADOOP_SUBCMD}" HADOOP_SUBCMD_ARGS=("$@") if declare -f yarn_subcommand_"${HADOOP_SUBCMD}" >/dev/null 2>&1; then hadoop_debug "Calling dynamically: yarn_subcommand_${HADOOP_SUBCMD} ${HADOOP_SUBCMD_ARGS[*]}" "yarn_subcommand_${HADOOP_SUBCMD}" "${HADOOP_SUBCMD_ARGS[@]}" else yarncmd_case "${HADOOP_SUBCMD}" "${HADOOP_SUBCMD_ARGS[@]}" fi # It's unclear if YARN_CLIENT_OPTS is actually a useful # thing to have separate from HADOOP_CLIENT_OPTS. Someone # might use it, so let's not deprecate it and just override # HADOOP_CLIENT_OPTS instead before we (potentially) add it # to the command line if [[ -n "${YARN_CLIENT_OPTS}" ]]; then HADOOP_CLIENT_OPTS=${YARN_CLIENT_OPTS} fi hadoop_add_client_opts if [[ ${HADOOP_WORKER_MODE} = true ]]; then hadoop_common_worker_mode_execute "${HADOOP_YARN_HOME}/bin/yarn" "${HADOOP_USER_PARAMS[@]}" exit $? fi hadoop_subcommand_opts "${HADOOP_SHELL_EXECNAME}" "${HADOOP_SUBCMD}" # everything is in globals at this point, so call the generic handler hadoop_generic_java_subcmd_handler
{ "pile_set_name": "Github" }
<?xml version="1.0" encoding="UTF-8"?> <DDDefinition xmlns="http://www.cern.ch/cms/DDL" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://www.cern.ch/cms/DDL ../../DDLSchema/DDLSchema.xsd"> <ConstantsSection label="CTPPS_210_Left_Station.xml" eval="true"> <Constant name="RP_210_Left_Station_Length" value="[CTPPS_Stations_Assembly:CTPPS_220_Left_Station_Position_z]-[CTPPS_Stations_Assembly:CTPPS_210_Left_Station_Position_z]"/> <!--Positions calculated from the wall closer to IP point--> <Constant name="RP_210_Left_Prim_Vert_z" value="608*mm"/> <Constant name="RP_210_Left_Prim_Hor_z" value="1058*mm"/> <Constant name="RP_210_Left_Sec_Hor_z" value="9781*mm"/> <Constant name="RP_210_Left_Sec_Vert_z" value="10231*mm"/> <Constant name="RP_210_Left_Sec_Rot_Angle" value="8*deg"/> <Constant name="RP_210_Left_Sec_Rot_Angle_neg8" value="-8*deg"/> <Constant name="RP_210_Left_Sec_Rot_Angle_180" value="180*deg"/> <Constant name="RP_210_Left_Sec_Rot_Angle_172" value="172*deg"/> <Constant name="RP_210_Left_Hor_Vac_Length" value="[RP_Device:RP_Device_Envelope_Radius]+[RP_Device:RP_Device_Length_y]/2-[RP_Horizontal_Device:RP_Device_Hor_Closed_Wall_Thick_Int]"/> </ConstantsSection> <RotationSection label="CTPPS_210_Left_Station.xml"> <Rotation name="RP_210_Left_Sec_Rotation" phiX="[RP_210_Left_Sec_Rot_Angle]" thetaX="90*deg" phiY="(90*deg+[RP_210_Left_Sec_Rot_Angle])" thetaY="90*deg" phiZ="0*deg" thetaZ="0*deg"/> <Rotation name="RP_210_Left_90_y_Sec_Rotation_neg8" phiX="0*deg" thetaX="180*deg" phiY="82*deg" thetaY="90*deg" phiZ="-8*deg" thetaZ="90*deg"/> <Rotation name="RP_210_Left_90_x_Sec_Rotation" phiX="(0*deg+[RP_210_Left_Sec_Rot_Angle_neg8])" thetaX="90*deg" phiY="0*deg" thetaY="180*deg" phiZ="(90*deg+[RP_210_Left_Sec_Rot_Angle_neg8])" thetaZ="90*deg"/> <Rotation name="RP_210_Left_Sec_Rotation_neg8" phiX="[RP_210_Left_Sec_Rot_Angle_neg8]" thetaX="90*deg" phiY="(90*deg+[RP_210_Left_Sec_Rot_Angle_neg8])" thetaY="90*deg" phiZ="0*deg" thetaZ="0*deg"/> <Rotation name="RP_210_Left_Sec_Rotation_180" phiX="[RP_210_Left_Sec_Rot_Angle_180]" thetaX="90*deg" phiY="(90*deg+[RP_210_Left_Sec_Rot_Angle_180])" thetaY="90*deg" phiZ="0*deg" thetaZ="0*deg"/> <Rotation name="RP_210_Left_Sec_Rotation_172" phiX="[RP_210_Left_Sec_Rot_Angle_172]" thetaX="90*deg" phiY="(90*deg+[RP_210_Left_Sec_Rot_Angle_172])" thetaY="90*deg" phiZ="0*deg" thetaZ="0*deg"/> </RotationSection> <SolidSection label="CTPPS_210_Left_Station.xml"> <Tube rMin="0*mm" rMax="[RP_Device:RP_Device_Envelope_Radius]*1.1" dz="[RP_210_Left_Station_Length]/2" name="RP_210_Left_Station"/> <Tube rMin="[RP_Device:RP_Device_Beam_Hole_Diam]/2" rMax="[RP_Device:RP_Device_Beam_Hole_Diam]/2+[RP_Device:RP_Device_Wall_Thickness]" dz="([RP_210_Left_Prim_Vert_z]-[RP_Device:RP_Device_Length_z]/2)/2" name="RP_210_Left_Station_Tube_1"/> <Tube rMin="[RP_Device:RP_Device_Beam_Hole_Diam]/2" rMax="[RP_Device:RP_Device_Beam_Hole_Diam]/2+[RP_Device:RP_Device_Wall_Thickness]" dz="([RP_210_Left_Prim_Hor_z]-[RP_210_Left_Prim_Vert_z]-[RP_Device:RP_Device_Length_z])/2" name="RP_210_Left_Station_Tube_2"/> <Tube rMin="[RP_Device:RP_Device_Beam_Hole_Diam]/2" rMax="[RP_Device:RP_Device_Beam_Hole_Diam]/2+[RP_Device:RP_Device_Wall_Thickness]" dz="([RP_210_Left_Sec_Hor_z]-[RP_210_Left_Prim_Hor_z]-[RP_Device:RP_Device_Length_z])/2" name="RP_210_Left_Station_Tube_3"/> <Tube rMin="[RP_Device:RP_Device_Beam_Hole_Diam]/2" rMax="[RP_Device:RP_Device_Beam_Hole_Diam]/2+[RP_Device:RP_Device_Wall_Thickness]" dz="([RP_210_Left_Sec_Vert_z]-[RP_210_Left_Sec_Hor_z]-[RP_Device:RP_Device_Length_z])/2" name="RP_210_Left_Station_Tube_4"/> <Tube rMin="[RP_Device:RP_Device_Beam_Hole_Diam]/2" rMax="[RP_Device:RP_Device_Beam_Hole_Diam]/2+[RP_Device:RP_Device_Wall_Thickness]" dz="([RP_210_Left_Station_Length]-[RP_210_Left_Sec_Vert_z]-[RP_Device:RP_Device_Length_z]/2)/2" name="RP_210_Left_Station_Tube_5"/> <Tube rMin="0*mm" rMax="[RP_Device:RP_Device_Beam_Hole_Diam]/2" dz="[RP_210_Left_Station_Length]/2" name="RP_210_Left_Station_Vacuum_1"/> <Tube rMin="0*mm" rMax="[RP_Device:RP_Device_RP_Hole_Diam]/2" dz="[RP_Device:RP_Device_Envelope_Radius]" name="RP_210_Left_Station_Vert_Vacuum"/> <UnionSolid name="RP_210_Left_Station_Vacuum_2"> <rSolid name="RP_210_Left_Station_Vacuum_1"/> <rSolid name="RP_210_Left_Station_Vert_Vacuum"/> <rRotation name="RP_Transformations:RP_x_90_rot"/> <Translation x="0*mm" y="0*mm" z="-[RP_210_Left_Station_Length]/2+[RP_210_Left_Prim_Vert_z]"/> </UnionSolid> <UnionSolid name="RP_210_Left_Station_Vacuum_3"> <rSolid name="RP_210_Left_Station_Vacuum_2"/> <rSolid name="RP_210_Left_Station_Vert_Vacuum"/> <rRotation name="RP_210_Left_90_x_Sec_Rotation"/> <Translation x="0*mm" y="0*mm" z="-[RP_210_Left_Station_Length]/2+[RP_210_Left_Sec_Vert_z]"/> </UnionSolid> <Polycone name="RP_210_Left_Station_Hor_Vacuum" startPhi="0*deg" deltaPhi="360*deg" > <ZSection z="-[RP_Device:RP_Device_Length_y]/2+[RP_Horizontal_Device:RP_Device_Hor_Closed_Wall_Thick_Int]" rMin="0*mm" rMax="[RP_Device:RP_Device_RP_Hole_Diam]/2"/> <ZSection z="-[RP_Device:RP_Device_Length_y]/2+[RP_Horizontal_Device:RP_Device_Hor_Closed_Wall_Thick_Int] + [RP_210_Left_Hor_Vac_Length]" rMin="0*mm" rMax="[RP_Device:RP_Device_RP_Hole_Diam]/2"/> </Polycone> <UnionSolid name="RP_210_Left_Station_Vacuum_4"> <rSolid name="RP_210_Left_Station_Vacuum_3"/> <rSolid name="RP_210_Left_Station_Hor_Vacuum"/> <rRotation name="RP_Transformations:RP_y_90_rot"/> <Translation x="0*mm" y="0*mm" z="-[RP_210_Left_Station_Length]/2+[RP_210_Left_Prim_Hor_z]"/> </UnionSolid> <UnionSolid name="RP_210_Left_Station_Vacuum_5"> <rSolid name="RP_210_Left_Station_Vacuum_4"/> <rSolid name="RP_210_Left_Station_Hor_Vacuum"/> <rRotation name="RP_210_Left_90_y_Sec_Rotation_neg8"/> <Translation x="0*mm" y="0*mm" z="-[RP_210_Left_Station_Length]/2+[RP_210_Left_Sec_Hor_z]"/> </UnionSolid> <Polycone name="RP_210_Left_Station_Vacuum_1_Far" startPhi="0*deg" deltaPhi="360*deg" > <ZSection z="0*mm" rMin="0*mm" rMax="[RP_Device:RP_Device_Beam_Hole_Diam]/2"/> <ZSection z="[RP_210_Left_Station_Length]/2" rMin="0*mm" rMax="[RP_Device:RP_Device_Beam_Hole_Diam]/2"/> </Polycone> <UnionSolid name="RP_210_Left_Station_Vacuum_2_Far"> <rSolid name="RP_210_Left_Station_Vacuum_1_Far"/> <rSolid name="RP_210_Left_Station_Vert_Vacuum"/> <rRotation name="RP_Transformations:RP_x_90_rot"/> <Translation x="0*mm" y="0*mm" z="-[RP_210_Left_Station_Length]/2+[RP_210_Left_Sec_Vert_z]"/> </UnionSolid> <UnionSolid name="RP_210_Left_Station_Vacuum_3_Far"> <rSolid name="RP_210_Left_Station_Vacuum_2_Far"/> <rSolid name="RP_210_Left_Station_Hor_Vacuum"/> <rRotation name="RP_Transformations:RP_y_90_rot"/> <Translation x="0*mm" y="0*mm" z="-[RP_210_Left_Station_Length]/2+[RP_210_Left_Sec_Hor_z]"/> </UnionSolid> </SolidSection> <LogicalPartSection label="CTPPS_210_Left_Station.xml"> <LogicalPart name="RP_210_Left_Station"> <rSolid name="RP_210_Left_Station"/> <rMaterial name="RP_Materials:Air"/> </LogicalPart> <LogicalPart name="RP_210_Left_Station_Tube_1"> <rSolid name="RP_210_Left_Station_Tube_1"/> <rMaterial name="RP_Materials:AISI-316L-Steel"/> </LogicalPart> <LogicalPart name="RP_210_Left_Station_Tube_2"> <rSolid name="RP_210_Left_Station_Tube_2"/> <rMaterial name="RP_Materials:AISI-316L-Steel"/> </LogicalPart> <LogicalPart name="RP_210_Left_Station_Tube_3"> <rSolid name="RP_210_Left_Station_Tube_3"/> <rMaterial name="RP_Materials:AISI-316L-Steel"/> </LogicalPart> <LogicalPart name="RP_210_Left_Station_Tube_4"> <rSolid name="RP_210_Left_Station_Tube_4"/> <rMaterial name="RP_Materials:AISI-316L-Steel"/> </LogicalPart> <LogicalPart name="RP_210_Left_Station_Tube_5"> <rSolid name="RP_210_Left_Station_Tube_5"/> <rMaterial name="RP_Materials:AISI-316L-Steel"/> </LogicalPart> <LogicalPart name="RP_210_Left_Station_Vacuum_5"> <rSolid name="RP_210_Left_Station_Vacuum_5"/> <rMaterial name="RP_Materials:RP_Primary_Vacuum"/> </LogicalPart> <LogicalPart name="RP_210_Left_Station_Vacuum_3_Far"> <rSolid name="RP_210_Left_Station_Vacuum_3_Far"/> <rMaterial name="RP_Materials:RP_Primary_Vacuum"/> </LogicalPart> </LogicalPartSection> <PosPartSection label="CTPPS_210_Left_Station.xml"> <PosPart copyNumber="1"> <rParent name="RP_210_Left_Station"/> <rChild name="RP_Vertical_Device:RP_Device_Vert_Corp_3"/> <Translation x="0*mm" y="0*mm" z="-[RP_210_Left_Station_Length]/2+[RP_210_Left_Prim_Vert_z]"/> </PosPart> <PosPart copyNumber="2"> <rParent name="RP_210_Left_Station"/> <rChild name="RP_Vertical_Device:RP_Device_Vert_Corp_3"/> <rRotation name="RP_210_Left_Sec_Rotation_neg8"/> <Translation x="0*mm" y="0*mm" z="-[RP_210_Left_Station_Length]/2+[RP_210_Left_Sec_Vert_z]"/> </PosPart> <PosPart copyNumber="1"> <rParent name="RP_210_Left_Station"/> <rChild name="RP_Horizontal_Device:RP_Device_Hor_Corp_3"/> <rRotation name="RP_210_Left_Sec_Rotation_180"/> <Translation x="0*mm" y="0*mm" z="-[RP_210_Left_Station_Length]/2+[RP_210_Left_Prim_Hor_z]"/> </PosPart> <PosPart copyNumber="2"> <rParent name="RP_210_Left_Station"/> <rChild name="RP_Horizontal_Device:RP_Device_Hor_Corp_3"/> <rRotation name="RP_210_Left_Sec_Rotation_172"/> <Translation x="0*mm" y="0*mm" z="-[RP_210_Left_Station_Length]/2+[RP_210_Left_Sec_Hor_z]"/> </PosPart> <PosPart copyNumber="1"> <rParent name="RP_210_Left_Station"/> <rChild name="RP_210_Left_Station_Tube_1"/> <Translation x="0*mm" y="0*mm" z="-[RP_210_Left_Station_Length]/2+([RP_210_Left_Prim_Vert_z]-[RP_Device:RP_Device_Length_z]/2)/2"/> </PosPart> <PosPart copyNumber="1"> <rParent name="RP_210_Left_Station"/> <rChild name="RP_210_Left_Station_Tube_2"/> <Translation x="0*mm" y="0*mm" z="-[RP_210_Left_Station_Length]/2+([RP_210_Left_Prim_Vert_z]+[RP_210_Left_Prim_Hor_z])/2"/> </PosPart> <PosPart copyNumber="1"> <rParent name="RP_210_Left_Station"/> <rChild name="RP_210_Left_Station_Tube_3"/> <Translation x="0*mm" y="0*mm" z="-[RP_210_Left_Station_Length]/2+([RP_210_Left_Prim_Hor_z]+[RP_210_Left_Sec_Hor_z])/2"/> </PosPart> <PosPart copyNumber="1"> <rParent name="RP_210_Left_Station"/> <rChild name="RP_210_Left_Station_Tube_4"/> <Translation x="0*mm" y="0*mm" z="-[RP_210_Left_Station_Length]/2+([RP_210_Left_Sec_Hor_z]+[RP_210_Left_Sec_Vert_z])/2"/> </PosPart> <PosPart copyNumber="1"> <rParent name="RP_210_Left_Station"/> <rChild name="RP_210_Left_Station_Tube_5"/> <Translation x="0*mm" y="0*mm" z="[RP_210_Left_Station_Length]/2-([RP_210_Left_Station_Length]-[RP_210_Left_Sec_Vert_z]-[RP_Device:RP_Device_Length_z]/2)/2"/> </PosPart> <PosPart copyNumber="1"> <rParent name="RP_210_Left_Station"/> <rChild name="RP_210_Left_Station_Vacuum_5"/> <rRotation name="RP_210_Left_Sec_Rotation_180"/> <!--<rRotation name="RP_210_Left_Sec_Rotation_180"/>--> </PosPart> <PosPart copyNumber="1"> <rParent name="RP_210_Left_Station_Vacuum_5"/> <rChild name="RP_210_Left_Station_Vacuum_3_Far"/> <rRotation name="RP_210_Left_Sec_Rotation_neg8"/> </PosPart> <PosPart copyNumber="0"> <rParent name="RP_210_Left_Station_Vacuum_5"/> <rChild name="RP_Box_000:RP_box_primary_vacuum"/> <rRotation name="RP_Transformations:RP_z_180_rot"/> <Translation x="0*mm" y="-[RP_Dist_Beam_Cent:RP_147_Left_Det_Dist_1]-[RP_Box:RP_Box_primary_vacuum_y]/2" z="[RP_210_Left_Prim_Vert_z]-[RP_210_Left_Station_Length]/2"/> </PosPart> <PosPart copyNumber="1"> <rParent name="RP_210_Left_Station_Vacuum_5"/> <rChild name="RP_Box_001:RP_box_primary_vacuum"/> <Translation x="0*mm" y="[RP_Dist_Beam_Cent:RP_147_Left_Det_Dist_0]+[RP_Box:RP_Box_primary_vacuum_y]/2" z="[RP_210_Left_Prim_Vert_z]-[RP_210_Left_Station_Length]/2"/> </PosPart> <PosPart copyNumber="2"> <rParent name="RP_210_Left_Station_Vacuum_5"/> <rChild name="RP_Box_002:RP_box_primary_vacuum"/> <rRotation name="RP_Transformations:RP_90_cw_z_rot"/> <Translation x="-(-[RP_Dist_Beam_Cent:RP_147_Left_Det_Dist_2]-[RP_Box:RP_Box_primary_vacuum_y]/2)" y="0*mm" z="[RP_210_Left_Prim_Hor_z]-[RP_210_Left_Station_Length]/2"/> </PosPart> <PosPart copyNumber="10003"> <rParent name="RP_210_Left_Station_Vacuum_3_Far"/> <rChild name="RP_Box_003:RP_box_primary_vacuum"/> <rRotation name="RP_Transformations:RP_90_cw_z_rot"/> <Translation x="-(-[RP_Dist_Beam_Cent:RP_147_Left_Det_Dist_3]-[RP_Box:RP_Box_primary_vacuum_y]/2)" y="0*mm" z="[RP_210_Left_Sec_Hor_z]-[RP_210_Left_Station_Length]/2"/> </PosPart> <PosPart copyNumber="4"> <rParent name="RP_210_Left_Station_Vacuum_3_Far"/> <rChild name="RP_Box_004:RP_box_primary_vacuum"/> <rRotation name="RP_Transformations:RP_z_180_rot"/> <Translation x="0*mm" y="-[RP_Dist_Beam_Cent:RP_147_Left_Det_Dist_5]-[RP_Box:RP_Box_primary_vacuum_y]/2" z="[RP_210_Left_Sec_Vert_z]-[RP_210_Left_Station_Length]/2"/> </PosPart> <PosPart copyNumber="5"> <rParent name="RP_210_Left_Station_Vacuum_3_Far"/> <rChild name="RP_Box_005:RP_box_primary_vacuum"/> <Translation x="0*mm" y="[RP_Dist_Beam_Cent:RP_147_Left_Det_Dist_4]+[RP_Box:RP_Box_primary_vacuum_y]/2" z="[RP_210_Left_Sec_Vert_z]-[RP_210_Left_Station_Length]/2"/> </PosPart> </PosPartSection> </DDDefinition>
{ "pile_set_name": "Github" }
/* Copyright (c) 2018, Lars Brubaker, John Lewin All rights reserved. Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met: 1. Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer. 2. Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution. THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. The views and conclusions contained in the software and documentation are those of the authors and should not be interpreted as representing official policies, either expressed or implied, of the FreeBSD Project. */ using MatterHackers.Agg.UI; namespace MatterHackers.MatterControl.SlicerConfiguration { public class TextField : UIField { protected MHTextEditWidget textEditWidget; private ThemeConfig theme; public TextField(ThemeConfig theme) { this.theme = theme; } public override void Initialize(int tabIndex) { textEditWidget = new MHTextEditWidget("", theme, pixelWidth: ControlWidth, tabIndex: tabIndex) { ToolTipText = this.HelpText, SelectAllOnFocus = true, Name = this.Name, }; textEditWidget.ActualTextEditWidget.EditComplete += (s, e) => { if (this.Value != textEditWidget.Text) { this.SetValue( textEditWidget.Text, userInitiated: true); } }; this.Content = textEditWidget; } protected override void OnValueChanged(FieldChangedEventArgs fieldChangedEventArgs) { if (this.Value != textEditWidget.Text) { textEditWidget.Text = this.Value; } base.OnValueChanged(fieldChangedEventArgs); } } public class ReadOnlyTextField : UIField { TextWidget textWidget; private ThemeConfig theme; public ReadOnlyTextField(ThemeConfig theme) { this.theme = theme; } public override void Initialize(int tabIndex) { textWidget = new TextWidget("", textColor: theme.TextColor, pointSize: theme.DefaultFontSize) { TabIndex = tabIndex, ToolTipText = this.HelpText, AutoExpandBoundsToText = true, Name = this.Name, }; this.Content = textWidget; } protected override void OnValueChanged(FieldChangedEventArgs fieldChangedEventArgs) { if (this.Value != textWidget.Text) { textWidget.Text = this.Value; } base.OnValueChanged(fieldChangedEventArgs); } } }
{ "pile_set_name": "Github" }
<?php /* * Copyright 2014 Google Inc. * * Licensed under the Apache License, Version 2.0 (the "License"); you may not * use this file except in compliance with the License. You may obtain a copy of * the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the * License for the specific language governing permissions and limitations under * the License. */ class Google_Service_Dataflow_SendDebugCaptureRequest extends Google_Model { public $componentId; public $data; public $location; public $workerId; public function setComponentId($componentId) { $this->componentId = $componentId; } public function getComponentId() { return $this->componentId; } public function setData($data) { $this->data = $data; } public function getData() { return $this->data; } public function setLocation($location) { $this->location = $location; } public function getLocation() { return $this->location; } public function setWorkerId($workerId) { $this->workerId = $workerId; } public function getWorkerId() { return $this->workerId; } }
{ "pile_set_name": "Github" }
using System; using System.Collections.Generic; using Rebus.Messages; using Rebus.Transport; namespace Rebus.Pipeline { /// <summary> /// Implementation of <see cref="IMessageContext"/> that provides the static gateway <see cref="Current"/> property to get /// the current message context. /// </summary> public class MessageContext : IMessageContext { internal MessageContext(ITransactionContext transactionContext) { if (transactionContext == null) throw new ArgumentNullException(nameof(transactionContext)); TransactionContext = transactionContext; } /// <summary> /// This is the outermost context, the one that spans the entire queue receive transaction. The other properties on the message /// context are merely provided as a convenience. /// </summary> public ITransactionContext TransactionContext { get; } /// <summary> /// Gets the step context, i.e. the context that is passed down through the step pipeline when a message is received. /// </summary> public IncomingStepContext IncomingStepContext => TransactionContext.GetOrThrow<IncomingStepContext>(StepContext.StepContextKey); /// <summary> /// Gets the <see cref="IMessageContext.TransportMessage"/> model for the message currently being handled. /// </summary> public TransportMessage TransportMessage => IncomingStepContext.Load<TransportMessage>(); /// <summary> /// Gets the <see cref="IMessageContext.Message"/> model for the message currently being handled. /// </summary> public Message Message => IncomingStepContext.Load<Message>(); /// <summary> /// Gets the headers dictionary of the incoming message (same as accessing the Headers of the context's transport message, /// or the logical message if the message has been properly deserialized) /// </summary> public Dictionary<string, string> Headers => TransportMessage.Headers; /// <summary> /// Gets the current message context from the current <see cref="AmbientTransactionContext"/> (accessed by /// <see cref="AmbientTransactionContext.Current"/>), returning null if no transaction context was found /// </summary> public static IMessageContext Current { get { var transactionContext = AmbientTransactionContext.Current; return transactionContext != null && transactionContext.Items.ContainsKey(StepContext.StepContextKey) ? new MessageContext(transactionContext) : null; } } } }
{ "pile_set_name": "Github" }
LeadParagraph ============= ### Import ```js import LeadParagraph from '@govuk-react/lead-paragraph'; ``` <!-- STORY --> ### Usage Simple ```jsx <LeadParagraph>LeadParagraph example</LeadParagraph> ``` ### References - https://design-system.service.gov.uk/styles/typography/#paragraphs ### Properties Prop | Required | Default | Type | Description :--- | :------- | :------ | :--- | :---------- `children` | true | `````` | node | Text in the Lead paragraph
{ "pile_set_name": "Github" }
<?xml version="1.0" encoding="UTF-8"?> <xs:schema xmlns:ds="http://www.w3.org/2000/09/xmldsig#" xmlns="http://www.portalfiscal.inf.br/cte" xmlns:xs="http://www.w3.org/2001/XMLSchema" targetNamespace="http://www.portalfiscal.inf.br/cte" elementFormDefault="qualified" attributeFormDefault="unqualified"> <xs:include schemaLocation="cteTiposBasico_v3.00.xsd"/> <xs:element name="retCTeOS" type="TRetCTeOS"> <xs:annotation> <xs:documentation>Schema XML de validação do retorno do recibo de envio do CT-e OS (Modelo 67)</xs:documentation> </xs:annotation> </xs:element> </xs:schema>
{ "pile_set_name": "Github" }
<?xml version="1.0" encoding="UTF-8"?> <!DOCTYPE plist PUBLIC "-//Apple Computer//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd"> <plist version="1.0"> <dict> <key>Q</key> <dict> <key>X</key> <integer>-17</integer> <key>public.kern2.A</key> <integer>-12</integer> <key>public.kern2.T</key> <integer>-26</integer> <key>public.kern2.W</key> <integer>-12</integer> <key>public.kern2.Y</key> <integer>-26</integer> </dict> <key>V</key> <dict> <key>ae</key> <integer>-54</integer> <key>oe</key> <integer>-50</integer> <key>public.kern2.A</key> <integer>-46</integer> <key>public.kern2.W</key> <integer>-12</integer> <key>public.kern2.a</key> <integer>-54</integer> <key>public.kern2.c</key> <integer>-50</integer> <key>public.kern2.d</key> <integer>-50</integer> <key>public.kern2.e</key> <integer>-50</integer> <key>public.kern2.eng</key> <integer>-34</integer> <key>public.kern2.f</key> <integer>-24</integer> <key>public.kern2.g</key> <integer>-50</integer> <key>public.kern2.m</key> <integer>-34</integer> <key>public.kern2.o</key> <integer>-50</integer> <key>public.kern2.p</key> <integer>-34</integer> <key>public.kern2.r</key> <integer>-34</integer> <key>public.kern2.s</key> <integer>-54</integer> <key>public.kern2.t</key> <integer>-24</integer> <key>public.kern2.u</key> <integer>-48</integer> <key>public.kern2.w</key> <integer>-34</integer> <key>public.kern2.y</key> <integer>-34</integer> <key>public.kern2.z</key> <integer>-34</integer> <key>q</key> <integer>-50</integer> <key>v</key> <integer>-34</integer> <key>x</key> <integer>-34</integer> </dict> <key>X</key> <dict> <key>Q</key> <integer>-20</integer> <key>ae</key> <integer>-24</integer> <key>oe</key> <integer>-24</integer> <key>public.kern2.C</key> <integer>-20</integer> <key>public.kern2.G</key> <integer>-20</integer> <key>public.kern2.O</key> <integer>-20</integer> <key>public.kern2.S</key> <integer>-20</integer> <key>public.kern2.U</key> <integer>-20</integer> <key>public.kern2.a</key> <integer>-24</integer> <key>public.kern2.c</key> <integer>-24</integer> <key>public.kern2.d</key> <integer>-24</integer> <key>public.kern2.eng</key> <integer>-24</integer> <key>public.kern2.m</key> <integer>-24</integer> <key>public.kern2.o</key> <integer>-24</integer> <key>public.kern2.p</key> <integer>-24</integer> <key>public.kern2.r</key> <integer>-24</integer> <key>public.kern2.s</key> <integer>-24</integer> <key>public.kern2.w</key> <integer>-36</integer> <key>public.kern2.z</key> <integer>-24</integer> <key>q</key> <integer>-24</integer> <key>v</key> <integer>-48</integer> <key>x</key> <integer>-24</integer> </dict> <key>germandbls</key> <dict> <key>public.kern2.f</key> <integer>-12</integer> <key>public.kern2.t</key> <integer>-12</integer> <key>public.kern2.w</key> <integer>-12</integer> <key>public.kern2.y</key> <integer>-12</integer> <key>v</key> <integer>-12</integer> </dict> <key>public.kern1.A</key> <dict> <key>Q</key> <integer>-12</integer> <key>V</key> <integer>-46</integer> <key>oe</key> <integer>-12</integer> <key>public.kern2.C</key> <integer>-12</integer> <key>public.kern2.G</key> <integer>-12</integer> <key>public.kern2.O</key> <integer>-12</integer> <key>public.kern2.S</key> <integer>-12</integer> <key>public.kern2.T</key> <integer>-52</integer> <key>public.kern2.U</key> <integer>-12</integer> <key>public.kern2.W</key> <integer>-41</integer> <key>public.kern2.Y</key> <integer>-46</integer> <key>public.kern2.c</key> <integer>-12</integer> <key>public.kern2.d</key> <integer>-12</integer> <key>public.kern2.e</key> <integer>-12</integer> <key>public.kern2.g</key> <integer>-12</integer> <key>public.kern2.o</key> <integer>-12</integer> <key>public.kern2.w</key> <integer>-24</integer> <key>public.kern2.y</key> <integer>-60</integer> <key>q</key> <integer>-12</integer> <key>v</key> <integer>-66</integer> </dict> <key>public.kern1.B</key> <dict> <key>V</key> <integer>-12</integer> <key>X</key> <integer>-17</integer> <key>public.kern2.A</key> <integer>-6</integer> <key>public.kern2.W</key> <integer>-12</integer> <key>public.kern2.Y</key> <integer>-17</integer> </dict> <key>public.kern1.C</key> <dict> <key>V</key> <integer>-12</integer> <key>X</key> <integer>-12</integer> <key>public.kern2.A</key> <integer>-12</integer> <key>public.kern2.T</key> <integer>-12</integer> <key>public.kern2.W</key> <integer>-6</integer> <key>public.kern2.Y</key> <integer>-12</integer> </dict> <key>public.kern1.D</key> <dict> <key>V</key> <integer>-12</integer> <key>X</key> <integer>-17</integer> <key>public.kern2.A</key> <integer>-12</integer> <key>public.kern2.T</key> <integer>-26</integer> <key>public.kern2.W</key> <integer>-12</integer> <key>public.kern2.Y</key> <integer>-35</integer> </dict> <key>public.kern1.F</key> <dict> <key>ae</key> <integer>-24</integer> <key>oe</key> <integer>-24</integer> <key>public.kern2.A</key> <integer>-35</integer> <key>public.kern2.J</key> <integer>-58</integer> <key>public.kern2.W</key> <integer>-12</integer> <key>public.kern2.a</key> <integer>-24</integer> <key>public.kern2.c</key> <integer>-24</integer> <key>public.kern2.d</key> <integer>-24</integer> <key>public.kern2.e</key> <integer>-24</integer> <key>public.kern2.g</key> <integer>-24</integer> <key>public.kern2.o</key> <integer>-24</integer> <key>public.kern2.s</key> <integer>-24</integer> <key>public.kern2.w</key> <integer>-24</integer> <key>public.kern2.y</key> <integer>-24</integer> <key>q</key> <integer>-24</integer> <key>v</key> <integer>-24</integer> </dict> <key>public.kern1.G</key> <dict> <key>V</key> <integer>-12</integer> <key>X</key> <integer>-12</integer> <key>public.kern2.A</key> <integer>-12</integer> <key>public.kern2.T</key> <integer>-12</integer> <key>public.kern2.W</key> <integer>-6</integer> <key>public.kern2.Y</key> <integer>-12</integer> </dict> <key>public.kern1.J</key> <dict> <key>public.kern2.A</key> <integer>-12</integer> </dict> <key>public.kern1.K</key> <dict> <key>Q</key> <integer>-23</integer> <key>ae</key> <integer>-24</integer> <key>oe</key> <integer>-24</integer> <key>public.kern2.C</key> <integer>-23</integer> <key>public.kern2.G</key> <integer>-23</integer> <key>public.kern2.O</key> <integer>-23</integer> <key>public.kern2.S</key> <integer>-17</integer> <key>public.kern2.U</key> <integer>-12</integer> <key>public.kern2.W</key> <integer>-35</integer> <key>public.kern2.a</key> <integer>-24</integer> <key>public.kern2.c</key> <integer>-24</integer> <key>public.kern2.d</key> <integer>-24</integer> <key>public.kern2.dotlessi</key> <integer>-24</integer> <key>public.kern2.e</key> <integer>-24</integer> <key>public.kern2.f</key> <integer>-50</integer> <key>public.kern2.g</key> <integer>-32</integer> <key>public.kern2.l</key> <integer>-24</integer> <key>public.kern2.o</key> <integer>-24</integer> <key>public.kern2.s</key> <integer>-24</integer> <key>public.kern2.t</key> <integer>-72</integer> <key>public.kern2.u</key> <integer>-24</integer> <key>public.kern2.w</key> <integer>-72</integer> <key>public.kern2.y</key> <integer>-72</integer> <key>q</key> <integer>-24</integer> <key>v</key> <integer>-72</integer> <key>x</key> <integer>-24</integer> </dict> <key>public.kern1.L</key> <dict> <key>Q</key> <integer>-17</integer> <key>V</key> <integer>-29</integer> <key>public.kern2.C</key> <integer>-17</integer> <key>public.kern2.G</key> <integer>-17</integer> <key>public.kern2.O</key> <integer>-17</integer> <key>public.kern2.S</key> <integer>-17</integer> <key>public.kern2.T</key> <integer>-73</integer> <key>public.kern2.U</key> <integer>-17</integer> <key>public.kern2.W</key> <integer>-17</integer> <key>public.kern2.Y</key> <integer>-76</integer> <key>public.kern2.w</key> <integer>-60</integer> <key>v</key> <integer>-84</integer> </dict> <key>public.kern1.O</key> <dict> <key>X</key> <integer>-17</integer> <key>public.kern2.A</key> <integer>-12</integer> <key>public.kern2.T</key> <integer>-26</integer> <key>public.kern2.W</key> <integer>-12</integer> <key>public.kern2.Y</key> <integer>-26</integer> </dict> <key>public.kern1.P</key> <dict> <key>Q</key> <integer>-12</integer> <key>ae</key> <integer>-36</integer> <key>oe</key> <integer>-30</integer> <key>public.kern2.A</key> <integer>-23</integer> <key>public.kern2.C</key> <integer>-12</integer> <key>public.kern2.G</key> <integer>-12</integer> <key>public.kern2.J</key> <integer>-180</integer> <key>public.kern2.O</key> <integer>-12</integer> <key>public.kern2.S</key> <integer>-12</integer> <key>public.kern2.W</key> <integer>-12</integer> <key>public.kern2.Y</key> <integer>-17</integer> <key>public.kern2.a</key> <integer>-36</integer> <key>public.kern2.c</key> <integer>-30</integer> <key>public.kern2.d</key> <integer>-30</integer> <key>public.kern2.e</key> <integer>-30</integer> <key>public.kern2.eng</key> <integer>-20</integer> <key>public.kern2.g</key> <integer>-30</integer> <key>public.kern2.m</key> <integer>-20</integer> <key>public.kern2.o</key> <integer>-30</integer> <key>public.kern2.p</key> <integer>-20</integer> <key>public.kern2.r</key> <integer>-20</integer> <key>public.kern2.s</key> <integer>-25</integer> <key>public.kern2.u</key> <integer>-12</integer> <key>public.kern2.w</key> <integer>-10</integer> <key>public.kern2.z</key> <integer>-15</integer> <key>q</key> <integer>-30</integer> </dict> <key>public.kern1.R</key> <dict> <key>Q</key> <integer>-10</integer> <key>public.kern2.A</key> <integer>-10</integer> <key>public.kern2.C</key> <integer>-10</integer> <key>public.kern2.G</key> <integer>-10</integer> <key>public.kern2.O</key> <integer>-10</integer> <key>public.kern2.T</key> <integer>-17</integer> <key>public.kern2.Y</key> <integer>-17</integer> </dict> <key>public.kern1.S</key> <dict> <key>public.kern2.A</key> <integer>-12</integer> </dict> <key>public.kern1.T</key> <dict> <key>Q</key> <integer>-17</integer> <key>ae</key> <integer>-108</integer> <key>oe</key> <integer>-108</integer> <key>public.kern2.A</key> <integer>-52</integer> <key>public.kern2.C</key> <integer>-17</integer> <key>public.kern2.G</key> <integer>-17</integer> <key>public.kern2.J</key> <integer>-120</integer> <key>public.kern2.O</key> <integer>-17</integer> <key>public.kern2.S</key> <integer>-17</integer> <key>public.kern2.W</key> <integer>-12</integer> <key>public.kern2.a</key> <integer>-108</integer> <key>public.kern2.c</key> <integer>-108</integer> <key>public.kern2.d</key> <integer>-108</integer> <key>public.kern2.dotlessi</key> <integer>-24</integer> <key>public.kern2.dotlessj</key> <integer>-24</integer> <key>public.kern2.e</key> <integer>-108</integer> <key>public.kern2.eng</key> <integer>-96</integer> <key>public.kern2.f</key> <integer>-60</integer> <key>public.kern2.g</key> <integer>-108</integer> <key>public.kern2.m</key> <integer>-96</integer> <key>public.kern2.o</key> <integer>-108</integer> <key>public.kern2.p</key> <integer>-96</integer> <key>public.kern2.r</key> <integer>-96</integer> <key>public.kern2.s</key> <integer>-108</integer> <key>public.kern2.t</key> <integer>-60</integer> <key>public.kern2.u</key> <integer>-96</integer> <key>public.kern2.w</key> <integer>-96</integer> <key>public.kern2.y</key> <integer>-96</integer> <key>public.kern2.z</key> <integer>-96</integer> <key>q</key> <integer>-108</integer> <key>v</key> <integer>-96</integer> <key>x</key> <integer>-96</integer> </dict> <key>public.kern1.U</key> <dict> <key>public.kern2.A</key> <integer>-12</integer> </dict> <key>public.kern1.W</key> <dict> <key>ae</key> <integer>-32</integer> <key>oe</key> <integer>-26</integer> <key>public.kern2.A</key> <integer>-41</integer> <key>public.kern2.a</key> <integer>-32</integer> <key>public.kern2.c</key> <integer>-26</integer> <key>public.kern2.d</key> <integer>-26</integer> <key>public.kern2.e</key> <integer>-26</integer> <key>public.kern2.eng</key> <integer>-26</integer> <key>public.kern2.f</key> <integer>-12</integer> <key>public.kern2.g</key> <integer>-26</integer> <key>public.kern2.m</key> <integer>-26</integer> <key>public.kern2.o</key> <integer>-26</integer> <key>public.kern2.p</key> <integer>-26</integer> <key>public.kern2.r</key> <integer>-26</integer> <key>public.kern2.s</key> <integer>-26</integer> <key>public.kern2.t</key> <integer>-12</integer> <key>public.kern2.u</key> <integer>-12</integer> <key>public.kern2.z</key> <integer>-12</integer> <key>q</key> <integer>-26</integer> </dict> <key>public.kern1.Y</key> <dict> <key>Q</key> <integer>-26</integer> <key>ae</key> <integer>-120</integer> <key>oe</key> <integer>-98</integer> <key>public.kern2.A</key> <integer>-46</integer> <key>public.kern2.C</key> <integer>-26</integer> <key>public.kern2.G</key> <integer>-26</integer> <key>public.kern2.J</key> <integer>-58</integer> <key>public.kern2.O</key> <integer>-26</integer> <key>public.kern2.S</key> <integer>-26</integer> <key>public.kern2.W</key> <integer>-12</integer> <key>public.kern2.a</key> <integer>-120</integer> <key>public.kern2.c</key> <integer>-98</integer> <key>public.kern2.d</key> <integer>-98</integer> <key>public.kern2.dotlessi</key> <integer>-44</integer> <key>public.kern2.dotlessj</key> <integer>-44</integer> <key>public.kern2.e</key> <integer>-98</integer> <key>public.kern2.eng</key> <integer>-72</integer> <key>public.kern2.f</key> <integer>-66</integer> <key>public.kern2.g</key> <integer>-98</integer> <key>public.kern2.l</key> <integer>-32</integer> <key>public.kern2.m</key> <integer>-72</integer> <key>public.kern2.o</key> <integer>-98</integer> <key>public.kern2.p</key> <integer>-72</integer> <key>public.kern2.r</key> <integer>-72</integer> <key>public.kern2.s</key> <integer>-90</integer> <key>public.kern2.t</key> <integer>-66</integer> <key>public.kern2.u</key> <integer>-72</integer> <key>public.kern2.w</key> <integer>-72</integer> <key>public.kern2.y</key> <integer>-72</integer> <key>public.kern2.z</key> <integer>-72</integer> <key>q</key> <integer>-98</integer> <key>v</key> <integer>-72</integer> <key>x</key> <integer>-72</integer> </dict> <key>public.kern1.Z</key> <dict> <key>Q</key> <integer>-20</integer> <key>public.kern2.C</key> <integer>-12</integer> <key>public.kern2.G</key> <integer>-12</integer> <key>public.kern2.J</key> <integer>-10</integer> <key>public.kern2.O</key> <integer>-12</integer> <key>public.kern2.S</key> <integer>-20</integer> <key>public.kern2.U</key> <integer>-6</integer> <key>public.kern2.W</key> <integer>-12</integer> <key>public.kern2.f</key> <integer>-24</integer> <key>public.kern2.t</key> <integer>-24</integer> <key>public.kern2.w</key> <integer>-48</integer> <key>public.kern2.y</key> <integer>-48</integer> <key>v</key> <integer>-48</integer> </dict> <key>public.kern1.a</key> <dict> <key>public.kern2.f</key> <integer>-12</integer> <key>public.kern2.t</key> <integer>-12</integer> <key>public.kern2.w</key> <integer>-12</integer> <key>public.kern2.y</key> <integer>-12</integer> <key>v</key> <integer>-12</integer> </dict> <key>public.kern1.b</key> <dict> <key>public.kern2.f</key> <integer>-12</integer> <key>public.kern2.t</key> <integer>-12</integer> <key>public.kern2.w</key> <integer>-12</integer> <key>public.kern2.y</key> <integer>-22</integer> <key>v</key> <integer>-12</integer> </dict> <key>public.kern1.c</key> <dict> <key>public.kern2.f</key> <integer>-12</integer> <key>public.kern2.t</key> <integer>-12</integer> </dict> <key>public.kern1.comma</key> <dict> <key>public.kern2.quotedblright</key> <integer>-86</integer> </dict> <key>public.kern1.e</key> <dict> <key>public.kern2.f</key> <integer>-12</integer> <key>public.kern2.t</key> <integer>-12</integer> <key>public.kern2.w</key> <integer>-12</integer> <key>public.kern2.y</key> <integer>-22</integer> <key>v</key> <integer>-12</integer> </dict> <key>public.kern1.eng</key> <dict> <key>public.kern2.f</key> <integer>-12</integer> <key>public.kern2.t</key> <integer>-12</integer> <key>public.kern2.y</key> <integer>-6</integer> <key>v</key> <integer>-6</integer> </dict> <key>public.kern1.f</key> <dict> <key>germandbls</key> <integer>-6</integer> <key>public.kern2.a</key> <integer>-6</integer> <key>public.kern2.c</key> <integer>-6</integer> <key>public.kern2.comma</key> <integer>-23</integer> <key>public.kern2.e</key> <integer>-6</integer> <key>public.kern2.g</key> <integer>-6</integer> <key>public.kern2.o</key> <integer>-6</integer> <key>public.kern2.s</key> <integer>-6</integer> <key>q</key> <integer>-6</integer> </dict> <key>public.kern1.h</key> <dict> <key>public.kern2.f</key> <integer>-12</integer> <key>public.kern2.t</key> <integer>-12</integer> <key>public.kern2.y</key> <integer>-6</integer> <key>v</key> <integer>-6</integer> </dict> <key>public.kern1.k</key> <dict> <key>public.kern2.a</key> <integer>-30</integer> <key>public.kern2.c</key> <integer>-30</integer> <key>public.kern2.e</key> <integer>-30</integer> <key>public.kern2.g</key> <integer>-30</integer> <key>public.kern2.o</key> <integer>-30</integer> <key>public.kern2.s</key> <integer>-12</integer> <key>q</key> <integer>-30</integer> </dict> <key>public.kern1.m</key> <dict> <key>public.kern2.f</key> <integer>-12</integer> <key>public.kern2.t</key> <integer>-12</integer> <key>public.kern2.y</key> <integer>-6</integer> <key>v</key> <integer>-6</integer> </dict> <key>public.kern1.o</key> <dict> <key>public.kern2.f</key> <integer>-12</integer> <key>public.kern2.t</key> <integer>-12</integer> <key>public.kern2.w</key> <integer>-12</integer> <key>public.kern2.y</key> <integer>-22</integer> <key>v</key> <integer>-12</integer> </dict> <key>public.kern1.p</key> <dict> <key>public.kern2.f</key> <integer>-12</integer> <key>public.kern2.t</key> <integer>-12</integer> <key>public.kern2.w</key> <integer>-12</integer> <key>public.kern2.y</key> <integer>-22</integer> <key>v</key> <integer>-12</integer> </dict> <key>public.kern1.quotedblleft</key> <dict> <key>public.kern2.A</key> <integer>-46</integer> <key>public.kern2.J</key> <integer>-58</integer> <key>public.kern2.c</key> <integer>-26</integer> <key>public.kern2.e</key> <integer>-26</integer> <key>public.kern2.g</key> <integer>-26</integer> <key>public.kern2.o</key> <integer>-26</integer> <key>public.kern2.s</key> <integer>-26</integer> <key>q</key> <integer>-26</integer> </dict> <key>public.kern1.quotedblright</key> <dict> <key>germandbls</key> <integer>-12</integer> <key>public.kern2.comma</key> <integer>-86</integer> <key>public.kern2.s</key> <integer>-12</integer> </dict> <key>public.kern1.r</key> <dict> <key>public.kern2.a</key> <integer>-24</integer> <key>public.kern2.c</key> <integer>-24</integer> <key>public.kern2.comma</key> <integer>-43</integer> <key>public.kern2.e</key> <integer>-24</integer> <key>public.kern2.g</key> <integer>-24</integer> <key>public.kern2.o</key> <integer>-24</integer> <key>public.kern2.s</key> <integer>-24</integer> <key>q</key> <integer>-24</integer> <key>space</key> <integer>-10</integer> </dict> <key>public.kern1.s</key> <dict> <key>public.kern2.f</key> <integer>-12</integer> <key>public.kern2.t</key> <integer>-12</integer> <key>public.kern2.w</key> <integer>-12</integer> <key>public.kern2.y</key> <integer>-22</integer> <key>v</key> <integer>-12</integer> </dict> <key>public.kern1.w</key> <dict> <key>germandbls</key> <integer>-12</integer> <key>public.kern2.a</key> <integer>-16</integer> <key>public.kern2.c</key> <integer>-12</integer> <key>public.kern2.comma</key> <integer>-23</integer> <key>public.kern2.e</key> <integer>-12</integer> <key>public.kern2.g</key> <integer>-12</integer> <key>public.kern2.o</key> <integer>-12</integer> <key>public.kern2.s</key> <integer>-12</integer> <key>q</key> <integer>-12</integer> </dict> <key>public.kern1.y</key> <dict> <key>germandbls</key> <integer>-22</integer> <key>public.kern2.a</key> <integer>-22</integer> <key>public.kern2.c</key> <integer>-22</integer> <key>public.kern2.comma</key> <integer>-29</integer> <key>public.kern2.e</key> <integer>-22</integer> <key>public.kern2.g</key> <integer>-22</integer> <key>public.kern2.o</key> <integer>-22</integer> <key>public.kern2.s</key> <integer>-22</integer> <key>q</key> <integer>-22</integer> </dict> <key>public.kern1.z</key> <dict> <key>germandbls</key> <integer>-12</integer> <key>public.kern2.a</key> <integer>-12</integer> <key>public.kern2.c</key> <integer>-12</integer> <key>public.kern2.e</key> <integer>-12</integer> <key>public.kern2.g</key> <integer>-12</integer> <key>public.kern2.o</key> <integer>-12</integer> <key>public.kern2.s</key> <integer>-12</integer> <key>q</key> <integer>-12</integer> </dict> <key>space</key> <dict> <key>V</key> <integer>-17</integer> <key>public.kern2.A</key> <integer>-12</integer> <key>public.kern2.J</key> <integer>-12</integer> <key>public.kern2.T</key> <integer>-17</integer> <key>public.kern2.W</key> <integer>-12</integer> <key>public.kern2.Y</key> <integer>-17</integer> <key>public.kern2.w</key> <integer>-10</integer> <key>public.kern2.y</key> <integer>-12</integer> <key>v</key> <integer>-12</integer> </dict> <key>v</key> <dict> <key>germandbls</key> <integer>-12</integer> <key>public.kern2.a</key> <integer>-22</integer> <key>public.kern2.c</key> <integer>-12</integer> <key>public.kern2.comma</key> <integer>-29</integer> <key>public.kern2.e</key> <integer>-12</integer> <key>public.kern2.g</key> <integer>-12</integer> <key>public.kern2.o</key> <integer>-12</integer> <key>public.kern2.s</key> <integer>-12</integer> <key>q</key> <integer>-12</integer> </dict> <key>x</key> <dict> <key>public.kern2.a</key> <integer>-12</integer> <key>public.kern2.c</key> <integer>-17</integer> <key>public.kern2.e</key> <integer>-17</integer> <key>public.kern2.g</key> <integer>-17</integer> <key>public.kern2.o</key> <integer>-17</integer> <key>q</key> <integer>-17</integer> </dict> </dict> </plist>
{ "pile_set_name": "Github" }
// // Generated by class-dump 3.5 (64 bit). // // class-dump is Copyright (C) 1997-1998, 2000-2001, 2004-2013 by Steve Nygard. // #import "NSSliderCell.h" @interface NSProSliderCell : NSSliderCell { long long _nibVersion; struct { unsigned int needToSendEndSliderAction:1; unsigned int reserved:31; } _pscFlags; void *_reserved3; } + (void)drawKnobInCell:(id)arg1 rect:(struct CGRect)arg2; + (union _themeatom_union)_atomForKnobInCell:(id)arg1; + (id)metricsForCell:(id)arg1; + (id)_knobMetricsForCell:(id)arg1; + (id)_trackMetricsForCell:(id)arg1; + (id)_metricsCacheKeyForCell:(id)arg1; + (id)_knobFacetUsingBestOverridePointForCell:(id)arg1; + (id)_knobFacetForCell:(id)arg1; + (id)_knobFacet; + (BOOL)_implementsDeprecatedSelector:(SEL)arg1; + (void)initialize; + (long long)_knobDirectionForCell:(id)arg1; - (void)_setNibVersion:(long long)arg1; - (long long)_nibVersion; - (BOOL)isValidControlSize:(unsigned long long)arg1; - (BOOL)_supportsClassicLargeMetrics; - (BOOL)_needRedrawOnWindowChangedKeyState; - (void)stopTracking:(struct CGPoint)arg1 at:(struct CGPoint)arg2 inView:(id)arg3 mouseIsUp:(BOOL)arg4; - (BOOL)_sendActionFrom:(id)arg1; - (BOOL)startTrackingAt:(struct CGPoint)arg1 inView:(id)arg2; - (struct CGRect)rectOfTickMarkAtIndex:(long long)arg1; - (void)drawWithFrame:(struct CGRect)arg1 inView:(id)arg2; - (void)drawBarInside:(struct CGRect)arg1 flipped:(BOOL)arg2; - (BOOL)_calcTrackRect:(struct CGRect *)arg1 andAdjustRect:(BOOL)arg2; - (void)drawKnob; - (void)drawKnob:(struct CGRect)arg1; - (struct CGRect)knobRectFlipped:(BOOL)arg1; - (struct CGRect)_oldKnobRectFlipped:(BOOL)arg1; - (double)knobThickness; - (struct CGSize)cellSizeForBounds:(struct CGRect)arg1; - (void)_drawTrackInRect:(struct CGRect)arg1; - (void)encodeWithCoder:(id)arg1; - (id)initWithCoder:(id)arg1; - (id)init; - (struct CGRect)barImageBoundsInTrackRect:(struct CGRect)arg1; - (id)_baseFacet; - (long long)_currentThemeStateInView:(id)arg1; - (void)updateRenditionKey:(id)arg1 getFocus:(char *)arg2 userInfo:(id)arg3; @end
{ "pile_set_name": "Github" }
show_sdiff(record u, x) { record r; text s; r.copy(u); for (s in x) { if (r.key(s)) { r.delete(s); } else { r.p_integer(s, 0); } } r.vcall(o_, 0, "\n"); } new_set(...) { record r; ucall(r_p_integer, 1, r, 0); r; } main(void) { show_sdiff(new_set("John", "Bob", "Mary", "Serena"), new_set("Jim", "Mary", "John", "Bob")); 0; }
{ "pile_set_name": "Github" }
From ffff12fd321c7a056e796e74cc508726b0626ae0 Mon Sep 17 00:00:00 2001 From: Romain Naour <[email protected]> Date: Wed, 22 Jul 2015 22:43:25 +0200 Subject: [PATCH] fix static linking with icu-uc During static linking with a C application and libicuuc.a, -lstdc++ is required. Add -lstdc++ in Libs.private of icu-uc.pc. Fixes: http://autobuild.buildroot.net/results/210/2107f9dfb39eeb6559fb4271c7af8b39aef521ca/ Signed-off-by: Romain Naour <[email protected]> --- source/Makefile.in | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/source/Makefile.in b/source/Makefile.in index 9db6c52..ca48e16 100644 --- a/source/Makefile.in +++ b/source/Makefile.in @@ -264,7 +264,7 @@ config/icu-uc.pc: config/icu.pc Makefile icudefs.mk @echo "Description: $(PACKAGE_ICU_DESCRIPTION): Common and Data libraries" >> $@ @echo "Name: $(PACKAGE)-uc" >> $@ @echo "Libs:" '-L$${libdir}' "${ICULIBS_UC}" "${ICULIBS_DT}" >> $@ - @echo "Libs.private:" '$${baselibs}' >> $@ + @echo "Libs.private:" '$${baselibs}' -lstdc++ >> $@ @echo $@ updated. config/icu-i18n.pc: config/icu.pc Makefile icudefs.mk -- 2.4.3
{ "pile_set_name": "Github" }
package(default_visibility = ["//visibility:public"]) load( "@io_bazel_rules_go//go:def.bzl", "go_library", "go_test", ) go_test( name = "go_default_test", srcs = ["tls_test.go"], embed = [":go_default_library"], deps = [ "//vendor/github.com/coreos/etcd/integration:go_default_library", "//vendor/github.com/coreos/etcd/pkg/transport:go_default_library", "//vendor/golang.org/x/net/context:go_default_library", "//vendor/k8s.io/apimachinery/pkg/api/testing:go_default_library", "//vendor/k8s.io/apimachinery/pkg/apis/meta/v1:go_default_library", "//vendor/k8s.io/apimachinery/pkg/runtime:go_default_library", "//vendor/k8s.io/apimachinery/pkg/runtime/serializer:go_default_library", "//vendor/k8s.io/apiserver/pkg/apis/example:go_default_library", "//vendor/k8s.io/apiserver/pkg/apis/example/v1:go_default_library", "//vendor/k8s.io/apiserver/pkg/storage/etcd/testing/testingcert:go_default_library", "//vendor/k8s.io/apiserver/pkg/storage/storagebackend:go_default_library", ], ) go_library( name = "go_default_library", srcs = [ "etcd2.go", "etcd3.go", "factory.go", ], importpath = "k8s.io/apiserver/pkg/storage/storagebackend/factory", deps = [ "//vendor/github.com/coreos/etcd/client:go_default_library", "//vendor/github.com/coreos/etcd/clientv3:go_default_library", "//vendor/github.com/coreos/etcd/pkg/transport:go_default_library", "//vendor/golang.org/x/net/context:go_default_library", "//vendor/k8s.io/apimachinery/pkg/util/net:go_default_library", "//vendor/k8s.io/apiserver/pkg/storage:go_default_library", "//vendor/k8s.io/apiserver/pkg/storage/etcd:go_default_library", "//vendor/k8s.io/apiserver/pkg/storage/etcd3:go_default_library", "//vendor/k8s.io/apiserver/pkg/storage/storagebackend:go_default_library", "//vendor/k8s.io/apiserver/pkg/storage/value:go_default_library", ], ) filegroup( name = "package-srcs", srcs = glob(["**"]), tags = ["automanaged"], visibility = ["//visibility:private"], ) filegroup( name = "all-srcs", srcs = [":package-srcs"], tags = ["automanaged"], )
{ "pile_set_name": "Github" }
Write a comment here *** Parameters: *** {} # params *** Markdown input: *** | | 1 | 2 | |----|----|----| | A | X | | | B | | X | *** Output of inspect *** md_el(:document,[ md_el(:table,[ [md_el(:head_cell,[],{},[]),md_el(:head_cell,["1"],{},[]),md_el(:head_cell,["2"],{},[])], [md_el(:cell,["A"],{},[]),md_el(:cell,["X"],{},[]),md_el(:cell,[],{},[])], [md_el(:cell,["B"],{},[]),md_el(:cell,[],{},[]),md_el(:cell,["X"],{},[])] ],{:align=>[:left, :left, :left]},[]) ],{},[]) *** Output of to_html *** <table><thead><tr><th></th><th>1</th><th>2</th></tr></thead><tbody><tr><td style="text-align: left;">A</td><td style="text-align: left;">X</td><td style="text-align: left;"></td></tr> <tr><td style="text-align: left;">B</td><td style="text-align: left;"></td><td style="text-align: left;">X</td></tr> </tbody></table> *** Output of to_latex *** \begin{tabular}{l|l|l} &1&2\\ \hline A&X&\\ B&&X\\ \end{tabular} *** Output of to_md *** 12AXBX *** Output of to_s *** 12AXBX
{ "pile_set_name": "Github" }
<?xml version="1.0" encoding="utf-8"?> <string xmlns="http://tempuri.org/">{ "Info": [ { "IsSuccess": "True", "InAddress": "苗栗縣頭份市尖豐路32號", "InSRS": "EPSG:4326", "InFuzzyType": "[單雙號機制]+[最近門牌號機制]", "InFuzzyBuffer": "0", "InIsOnlyFullMatch": "False", "InIsLockCounty": "True", "InIsLockTown": "False", "InIsLockVillage": "False", "InIsLockRoadSection": "False", "InIsLockLane": "False", "InIsLockAlley": "False", "InIsLockArea": "False", "InIsSameNumber_SubNumber": "True", "InCanIgnoreVillage": "True", "InCanIgnoreNeighborhood": "True", "InReturnMaxCount": "0", "OutTotal": "1", "OutMatchType": "完全比對", "OutMatchCode": "[苗栗縣]\tFULL:1", "OutTraceInfo": "[苗栗縣]\t { 完全比對 } 找到符合的門牌地址" } ], "AddressList": [ { "FULL_ADDR": "苗栗縣頭份市尖山里11鄰尖豐路32號", "COUNTY": "苗栗縣", "TOWN": "頭份市", "VILLAGE": "尖山里", "NEIGHBORHOOD": "11鄰", "ROAD": "尖豐路", "SECTION": "", "LANE": "", "ALLEY": "", "SUB_ALLEY": "", "TONG": "", "NUMBER": "32號", "X": 120.880349, "Y": 24.663636 } ] }</string>
{ "pile_set_name": "Github" }
<!doctype html> <html> <head> <meta http-equiv="content-type" content="text/html; charset=UTF-8"> <title>Spectrum - The No Hassle jQuery Colorpicker</title> <meta name="description" content="Spectrum is a JavaScript colorpicker plugin using the jQuery framework. It is highly customizable, but can also be used as a simple input type=color polyfill"> <meta name="author" content="Brian Grinstead and Spectrum contributors"> <link rel="stylesheet" type="text/css" href="spectrum.css"> <link rel="stylesheet" type="text/css" href="docs/bootstrap.css"> <link rel="stylesheet" type="text/css" href="docs/docs.css"> <script type="text/javascript" src="docs/jquery-1.9.1.js"></script> <script type="text/javascript" src="spectrum.js"></script> <script type='text/javascript' src='docs/toc.js'></script> <script type='text/javascript' src='docs/docs.js'></script> </head> <body> <div id='header'> <h1><a href='http://bgrins.github.com/spectrum'>Spectrum</a></h1> <h2><em>The No Hassle jQuery Colorpicker</em></h2> <div id='links'> <a href='http://github.com/bgrins/spectrum/zipball/1.5.1' class="btn btn-primary">Download Zip</a> View the <a href='http://github.com/bgrins/spectrum'>Source code</a>. Spectrum is a project by <a href='http://twitter.com/bgrins'>@bgrins</a>. </div> <br style='clear:both;' /> </div> <div id='toc'></div> <div id='toc-slider'></div> <div id='docs'> <div id='docs-content'> <div id='switch-current'> <input type='text' name='color1' id='pick1' value='#ddddff' /> <div id='switch-current-hsv' class='switch-current-output'></div> <div id='switch-current-rgb' class='switch-current-output'></div> <div id='switch-current-hex' class='switch-current-output'></div> </div> <div style='text-align:center;'> <input id="full" /> </div> <pre class='prettyprint hide' id='code-heading'> &lt;input type='color' value='#f594d0' /&gt; <input type='color' class='basic' value='#f594d0' /> </pre> <h2 id="why">Why A Colorpicker?</h2> <p><em>I wasn't satisfied with the solutions available for colorpicking</em>. Many of them included a ton of images, were hard to skin or customize, or were very large plugins. Here are the goals I had when making a new one: </p> <h3 id="why-footprint" class='point'>Small Footprint</h3> <div class='note'>see a working <a href='http://jsfiddle.net/bgrins/ctkY3/'>jsFiddle example</a></div> <p>Just include the needed CSS and JavaScript files, and you are ready to go! </p> <pre class='prettyprint' id='code-subheading'> &lt;script src='<a href='http://bgrins.github.com/spectrum/spectrum.js' target="_blank">spectrum.js</a>'&gt;&lt;/script&gt; &lt;link rel='stylesheet' href='<a href='http://bgrins.github.com/spectrum/spectrum.css' target="_blank">spectrum.css</a>' /&gt; </pre> <p><strong>We don't need no stinkin' images!</strong></p> <p>Nobody wants to add a bunch of code into their project. Spectrum is contained in two files, and both are careful not to mess with your existing code.</p> <h3 id="why-polyfill" class='point'>Polyfill</h3> <p>I wanted an option for the most basic use case, a polyfill for the <a href='http://dev.w3.org/html5/markup/input.color.html'>input[type=color]</a> HTML5 control. This mode needs to work without JavaScript enabled - and fallback to an input[type=text] like other HTML5 inputs. </p> <p>If you don't want this behavior to happen, but still want to use spectrum elsewhere on the page, you can set <code>$.fn.spectrum.load = false;</code> right after loading the script file.</p> <h3 id="why-customizable" class='point'>Customizable</h3> <p>Just because you don't <em>have</em> to change anything to get it to work, doesn't mean you <em>can't</em>! It is easy to skin and customize the plugin with CSS, and there are a wide range of modes and options to explore. </p> <h3 id="why-mobile" class='point'>Mobile Support</h3> <p>Along with desktop browser support, I wanted a mobile colorpicker that was touch friendly, worked in iOS and Android, and used standards that maximize future mobile support. </p> <h3 id="why-devtools" class='point'>Devtools</h3> <p> Believe it or not, <strong>this colorpicker lives inside of Chrome, Firefox, and Safari devtools</strong> to make picking colors easier for web developers and designers. </p> <p> When I started the project, I wrote about <a href="http://www.briangrinstead.com/blog/chrome-developer-tools-colorpicker-concept">developer tools concept colorpicker implementation</a>. After that, I was <a href="http://groups.google.com/group/google-chrome-developer-tools/browse_thread/thread/4dd1e853b8051727/4549a6f0788885d4">contacted on the devtools mailing list</a> and got some initial feedback about the possibility of integrating it with devtools. Then I pulled the jQuery dependency out of a branch and I submitted a patch to the WebKit project. </p> <p> From there, I opened a <a href="https://bugs.webkit.org/show_bug.cgi?id=71262">bug</a> to start working on it Web Inspector. 50+ comments and 10 patches later, the case <a href="http://www.webkit.org/blog/1804/last-week-in-webkit-calculated-css-values-and-the-translate-attribute/">landed in WebKit</a>. Here is the <a href='https://bugzilla.mozilla.org/show_bug.cgi?id=911702'>Firefox bug</a> where it was added. </p> <h2 id="modes">Modes</h2> <h3 id="modes-custom" class='point'>Custom</h3> <p>If you want to get more into the functionality, just create a normal input and initialize it as a normal jQuery plugin. <strong>You can set a lot of options</strong> when initializing the colorpicker. See the 'Options' section below. </p> <pre class='prettyprint'> &lt;input type='text' id="custom" /&gt; </pre> <pre class='prettyprint'> &lt;script&gt; $("#custom").spectrum({ color: "#f00" }); &lt;/script&gt; </pre> <div class='example'> <input type='text' id='custom' /> </div> <h3 id="modes-flat" class='point'>Flat</h3> <p><strong>Flat</strong> This means that it will always show up at full size, and be positioned as an inline-block element. Look to the left for a full sized flat picker. </p> <pre class='prettyprint'> &lt;input type='text' id="flat" /&gt; &lt;br/&gt; &lt;input type='text' id="flat" /&gt; </pre> <pre class='prettyprint'> $("#flat").spectrum({ flat: true, showInput: true }); $("#flatClearable").spectrum({ flat: true, showInput: true, allowEmpty:true }); </pre> <div class='example'> <input type='text' id='flat' value="limegreen" /> <br/> <input type='text' id='flatClearable' value="limegreen" /> </div> <h3 id="modes-input" class='point'>input[type=color]</h3> <p> If you just want to provide a polyfill for the native color input, the easiest way is to create an input with the type of color. Once a user's browser supports a native color control, it will opt to use their native control instead. </p> <p><strong>Unlike the other modes, your value must be a 6 character hex value starting with a '#'.</strong> Why? Because the spec <a href='http://dev.w3.org/html5/markup/input.color.html#input.color.attrs.value'>says so</a>, that's why. </p> <pre class='prettyprint' id='code-subheading'> &lt;input type='color' name='color' /&gt; &lt;input type='color' name='color2' value='#3355cc' /&gt; </pre> <div class='example'> <form method="get"> <input type='color' name='color' /> <input type='color' name='color2' value='#3355cc' /> <input type='color' name='color3' value='#000000' /> <input type="submit" /> </form> </div> <p><strong>That's it!</strong> The field will degrade to a text input if the user does not have JavaScript enabled, so that they will still be able to manually enter a color. You don't need to add a single line of code. </p> <!-- <div class="alert"> Heads up! Make sure you do not have a <code>maxlength</code> property set on your input. It has been known to break IE10. </div> --> <h2 id="options">Options</h2> <pre class='prettyprint'> $("#picker").spectrum({ color: <strong>tinycolor</strong>, flat: bool, showInput: bool, showInitial: bool, allowEmpty: bool, showAlpha: bool, disabled: bool, localStorageKey: string, showPalette: bool, showPaletteOnly: bool, togglePaletteOnly: bool, showSelectionPalette: bool, clickoutFiresChange: bool, cancelText: string, chooseText: string, togglePaletteMoreText: string, togglePaletteLessText: string, containerClassName: string, replacerClassName: string, preferredFormat: string, maxSelectionSize: int, palette: [[string]], selectionPalette: [string] }); </pre> <div class="alert alert-info"> Tip: options can be specified in an options object in the <code>spectrum</code> initializer, like <code>$(element).spectrum({showAlpha: true })</code> or on the element's markup, like <code>&lt;input data-show-alpha="true" /&gt;</code>. </div> <h3 id="options-color">Color</h3> <div class='option-content'> <div class='description'> <p> The initial color will be set with the <code>color</code> option. If you don't pass in a color, Spectrum will use the <code>value</code> attribute on the input. </p> <p> The color parsing is based on the <a href='https://github.com/bgrins/TinyColor'>TinyColor</a> plugin. This should parse any color string you throw at it.</p> </p> </div> <pre class='prettyprint'> &lt;input type='text' class='basic' value='red' /&gt; &lt;input type='text' class='basic' value='#0f0' /&gt; &lt;input type='text' class='basic' value='blue' /&gt; &lt;br /&gt; &lt;input type='text' class='override' /&gt; &lt;br /&gt; &lt;input type='text' class='startEmpty' value='' /&gt; </pre> <pre class='prettyprint'> &lt;script&gt; $(".basic").spectrum(); $(".override").spectrum({ color: "yellow" }); (".startEmpty").spectrum({ allowEmpty: true }); &lt;/script&gt; </pre> <div class='example'> <input type='text' class='basic' value='red' /> <input type='text' class='basic' value='green' /> <input type='text' class='basic' value='blue' /> <br /> <input type='text' class='override' /> <br/> <input type='text' class='startEmpty' value='' /> </div> </div> <h3 id="options-showInput">Show Input</h3> <div class='option-content'> <div class='description'> <p>You can add an input to allow free form typing. The color parsing is very permissive in the allowed strings. See <a href='https://github.com/bgrins/TinyColor'>TinyColor</a> for more details. </div> <pre class='prettyprint'> $("#showInput").spectrum({ showInput: true }); $("#showInputWithClear").spectrum({ showInput: true, allowEmpty:true }); </pre> <div class='example'> <input type='text' name='showInput' id='showInput' /> <br/> <input type='text' name='showInputWithClear' id='showInputWithClear' value='' /> </div> </div> <h3 id="options-showAlpha">Show Alpha</h3> <div class='option-content'> <div class='description'> <p>You can allow alpha transparency selection. Check out these examples: </p> </div> <pre class='prettyprint'> $("#showAlpha").spectrum({ showAlpha: true }); </pre> <div class='example'> <input type='text' name='showAlpha' id='showAlpha' /> </div> <div class='example'> <input type='text' name='showAlphaWithInput' id='showAlphaWithInput' /> </div> </div> <h3 id="options-disabled">Disabled</h3> <div class='option-content'> <div class='description'> <p>Spectrum can be automatically disabled if you pass in the <code>disabled</code> flag. Additionally, if the input that you initialize spectrum on is disabled, this will be the default value. Note: you <strong>cannot</strong> enable spectrum if the input is disabled (see below).</p> </div> <pre class='prettyprint'> $("#disabled").spectrum({ disabled: true }); $("input:disabled").spectrum({ }); </pre> <div class='example'> <input type='text' name='disabled' id='disabled' value='lightblue' /> <input type='text' disabled value='lightblue' /> <button id='toggle-disabled' class='btn'>Toggle Disabled</button> </div> </div> <h3 id="options-showPalette">Show Palette</h3> <div class='option-content'> <div class='description'> <p>Spectrum can show a palette below the colorpicker to make it convenient for users to choose from frequently or recently used colors. When the colorpicker is closed, the current color will be added to the palette if it isn't there already. Check it out here: </p> </div> <pre class='prettyprint'> $("#showPalette").spectrum({ showPalette: true, palette: [ ['black', 'white', 'blanchedalmond'], ['rgb(255, 128, 0);', 'hsv 100 70 50', 'lightyellow'] ] }); </pre> <div class='example'> <input type='text' name='showPalette' id='showPalette' value='lightblue' /> </div> </div> <h3 id="options-showPaletteOnly">Show Palette Only</h3> <div class='option-content'> <div class='note'>see a working <a href='http://jsfiddle.net/bgrins/S45tW/'>jsFiddle example</a></div> <div class='description'> <p>If you'd like, spectrum can show the palettes you specify, and nothing else.</p> </div> <pre class='prettyprint'> $("#showPaletteOnly").spectrum({ showPaletteOnly: true, showPalette:true, color: 'blanchedalmond', palette: [ ['black', 'white', 'blanchedalmond', 'rgb(255, 128, 0);', 'hsv 100 70 50'], ['red', 'yellow', 'green', 'blue', 'violet'] ] }); </pre> <div class='example'> <span class='label label-result'> Result </span> <input type='text' name='showPaletteOnly' id='showPaletteOnly' /> </div> </div> <h3 id="options-togglePaletteOnly">Toggle Palette Only</h3> <div class='option-content'> <div class='description'> <p>Spectrum can show a button to toggle the colorpicker next to the palette. This way, the user can choose from a limited number of colors in the palette, but still be able to pick a color that's not in the palette.<br /> The default value for <code>togglePaletteOnly</code> is FALSE. Set it to TRUE to enable the Toggle button.<br /><br /> You can also change the text on the Toggle Button with the options <code>togglePaletteMoreText</code> (default is "more") and <code>togglePaletteLessText</code> (default is "less").</p> </div> <pre class='prettyprint'> $("#togglePaletteOnly").spectrum({ showPaletteOnly: true, togglePaletteOnly: true, togglePaletteMoreText: 'more', togglePaletteLessText: 'less', color: 'blanchedalmond', palette: [ ["#000","#444","#666","#999","#ccc","#eee","#f3f3f3","#fff"], ["#f00","#f90","#ff0","#0f0","#0ff","#00f","#90f","#f0f"], ["#f4cccc","#fce5cd","#fff2cc","#d9ead3","#d0e0e3","#cfe2f3","#d9d2e9","#ead1dc"], ["#ea9999","#f9cb9c","#ffe599","#b6d7a8","#a2c4c9","#9fc5e8","#b4a7d6","#d5a6bd"], ["#e06666","#f6b26b","#ffd966","#93c47d","#76a5af","#6fa8dc","#8e7cc3","#c27ba0"], ["#c00","#e69138","#f1c232","#6aa84f","#45818e","#3d85c6","#674ea7","#a64d79"], ["#900","#b45f06","#bf9000","#38761d","#134f5c","#0b5394","#351c75","#741b47"], ["#600","#783f04","#7f6000","#274e13","#0c343d","#073763","#20124d","#4c1130"] ] }); </pre> <div class='example'> <span class='label label-result'> Result </span> <input type='text' name='togglePaletteOnly' id='togglePaletteOnly' /> </div> </div> <h3 id="options-showSelectionPalette">Show Selection Palette</h3> <div class='option-content'> <div class='description'> <p>Spectrum can keep track of what has been selected by the user with the <code>showSelectionPalette</code> option.</p> <p>If the <code>localStorageKey</code> option is defined, the selection will be saved in the browser's localStorage object</p> </div> <pre class='prettyprint'> $("#showSelectionPalette").spectrum({ showPalette: true, showSelectionPalette: true, // true by default palette: [ ] }); $("#showSelectionPaletteStorage").spectrum({ showPalette: true, showSelectionPalette: true, palette: [ ], localStorageKey: "spectrum.homepage", // Any Spectrum with the same string will share selection }); </pre> <div class='example'> <span class='label label-info'>This colorpicker will store what you pick:</span><br /><br /> <input type='text' name='showSelectionPalette' id='showSelectionPalette' value='lightblue' /><br /><br /> <span class='label label-info'>Try switching between the two colorpickers or reloading your page, the chosen colors are always available:</span><br /><br /> <input type='text' name='showSelectionPaletteStorage' id='showSelectionPaletteStorage' value='lightblue' /> <input type='text' name='showSelectionPaletteStorage2' id='showSelectionPaletteStorage2' value='pink' /> </div> </div> <h3 id="options-hideAfterPaletteSelect">Hide After Palette Select</h3> <div class='option-content'> <div class='description'> <p>You can have the colorpicker automatically hide after a palette color is selected.</p> </div> <pre class='prettyprint'> $("#hideAfterPaletteSelect").spectrum({ showPaletteOnly: true, showPalette:true, hideAfterPaletteSelect:true, color: 'blanchedalmond', palette: [ ['black', 'white', 'blanchedalmond', 'rgb(255, 128, 0);', 'hsv 100 70 50'], ['red', 'yellow', 'green', 'blue', 'violet'] ] }); </pre> <div class='example'> <span class='label label-result'> Result </span> <input type='text' name='hideAfterPaletteSelect' id='hideAfterPaletteSelect' /> </div> </div> <h3 id="options-clickoutFiresChange">Clickout Fires Change</h3> <div class='option-content'> <div class='description'> <p> When clicking outside of the colorpicker, you can force it to fire a <code>change</code> event rather than having it revert the change. </p> </div> <pre class='prettyprint'> $("#clickoutFiresChange").spectrum({ clickoutFiresChange: true }); $("#clickoutDoesntChange").spectrum({ }); </pre> <div class='example'> <input type='text' name='clickoutFiresChange' id='clickoutFiresChange' value='goldenrod' /> <input type='text' name='clickoutDoesntFireChange' id='clickoutDoesntFireChange' value='goldenrod' /> </div> </div> <h3 id="options-showInitial">Show Initial</h3> <div class='option-content'> <div class='description'> <p> Spectrum can show the color that was initially set when opening. This provides an easy way to click back to what was set when opened. </p> </div> <pre class='prettyprint'> $("#showInitial").spectrum({ showInitial: true }); </pre> <div class='example'> <input type='text' name='showInitial' id='showInitial' value='goldenrod' /> </div> </div> <h3 id="options-showInputAndInitial">Show Input and Initial</h3> <div class='option-content'> <div class='description'> <p>If you specify both the <code>showInput</code> and <code>showInitial</code> options, the CSS keeps things in order by wrapping the buttons to the bottom row, and shrinking the input. <em>Note: this is all customizable via CSS.</em></p> </div> <pre class='prettyprint'> $("#showInputAndInitial").spectrum({ showInitial: true, showInput: true }); </pre> <div class='example'> <input type='text' name='showInputAndInitial' id='showInputAndInitial' value='goldenrod' /> </div> </div> <h3>Show Input, Initial, and Clear</h3> <div class='option-content'> <div class='description'> <p>If you specify both the <code>showInput</code>, <code>showInitial</code>, and <code>allowEmpty</code> options, the CSS keeps things in order by wrapping the buttons to the bottom row, and shrinking the input. <em>Note: this is all customizable via CSS.</em></p> </div> <pre class='prettyprint'> $("#showInputInitialClear").spectrum({ allowEmpty:true, showInitial: true, showInput: true }); </pre> <div class='example'> <input type='text' name='showInputInitialClear' id='showInputInitialClear' value='' /> </div> </div> <h3 id="options-buttonText">Button Text</h3> <div class='option-content'> <div class='description'> <p>You can set the button's text using <code>cancelText</code> and <code>chooseText</code> properties.</p> </div> <pre class='prettyprint'> $("#buttonText").spectrum({ allowEmpty:true, chooseText: "Alright", cancelText: "No way" }); </pre> <div class='example'> <input type='text' name='buttonText' id='buttonText' value='orangered' /> </div> </div> <h3 id="options-showButtons">Show Buttons</h3> <div class='option-content'> <div class='description'> <p> You can show or hide the buttons using the <code>showButtons</code> property. If there are no buttons, the behavior will be to fire the `change` event (and update the original input) when the picker is closed. </p> </div> <pre class='prettyprint'> $("#hideButtons").spectrum({ showButtons: false }); </pre> <div class='example'> <input type='text' name='hideButtons' id='hideButtons' value='orangered' /> </div> </div> <h3 id="options-containerClassName">Container Class Name</h3> <div class='option-content'> <div class='description'> <p> You can add an additional class name to the just the container element using the <code>containerClassName</code> property. </p> </div> <pre class='prettyprint'> $("#containerClassName").spectrum({ containerClassName: 'awesome' }); </pre> <pre class='prettyprint'> .awesome { background: purple; } </pre> <style type='text/css'> .awesome { background: purple; } </style> <div class='example'> <input type='text' name='containerClassName' id='containerClassName' value='orangered' /> </div> </div> <h3 id="options-replacerClassName">Replacer Class Name</h3> <div class='option-content'> <div class='description'> <p> You can add an additional class name to just the replacer element using the <code>replacerClassName</code> property. </p> </div> <pre class='prettyprint'> $("#replacerClassName").spectrum({ replacerClassName: 'awesome' }); </pre> <pre class='prettyprint'> .awesome { background: purple; } </pre> <style type='text/css'> .awesome { background: purple; } </style> <div class='example'> <input type='text' name='replacerClassName' id='replacerClassName' value='orangered' /> </div> </div> <h3 id="options-preferredFormat">Preferred Format</h3> <div class='option-content'> <div class='description'> <p>You can set the format that is displayed in the text box.</p> <p>This will also change the format that is displayed in the titles from the palette swatches.</p> </div> <pre class='prettyprint'> $("#preferredHex").spectrum({ preferredFormat: "hex", showInput: true, showPalette: true, palette: [["red", "rgba(0, 255, 0, .5)", "rgb(0, 0, 255)"]] }); $("#preferredHex3").spectrum({ preferredFormat: "hex3", showInput: true, showPalette: true, palette: [["red", "rgba(0, 255, 0, .5)", "rgb(0, 0, 255)"]] }); $("#preferredHsl").spectrum({ preferredFormat: "hsl", showInput: true, showPalette: true, palette: [["red", "rgba(0, 255, 0, .5)", "rgb(0, 0, 255)"]] }); $("#preferredRgb").spectrum({ preferredFormat: "rgb", showInput: true, showPalette: true, palette: [["red", "rgba(0, 255, 0, .5)", "rgb(0, 0, 255)"]] }); $("#preferredName").spectrum({ preferredFormat: "name", showInput: true, showPalette: true, palette: [["red", "rgba(0, 255, 0, .5)", "rgb(0, 0, 255)"]] }); $("#preferredNone").spectrum({ showInput: true, showPalette: true, palette: [["red", "rgba(0, 255, 0, .5)", "rgb(0, 0, 255)"]] }); </pre> <div class='example'> <div class='alert alert-info'>Hex</div> <input type='text' name='preferredHex' id='preferredHex' value='orangered' /> <div class='alert alert-info'>Hex (3 Characters If Possible)</div> <input type='text' name='preferredHex3' id='preferredHex3' value='orangered' /> <div class='alert alert-info'>Hsl</div> <input type='text' name='preferredHsl' id='preferredHsl' value='orangered' /> <div class='alert alert-info'>Rgb</div> <input type='text' name='preferredRgb' id='preferredRgb' value='orangered' /> <div class='alert alert-info'>Name (Falls back to hex)</div> <input type='text' name='preferredName' id='preferredName' value='orangered' /> <div class='alert alert-info'>None (Depends on input - try changing formats with the text box)</div> <input type='text' name='preferredNone' id='preferredNone' value='orangered' /> </div> </div> <h3 id="options-appendTo">appendTo</h3> <div class='option-content'> <div class='description'> <p>You can choose which element the colorpicker container is appended to (default is <code>"body"</code>). This can be any valid object taken into the jQuery <a href="https://api.jquery.com/appendTo/">appendTo</a> function.</p> <p>Changing this can help resolve issues with opening the colorpicker in a modal dialog or fixed position container, for instance.</p> </div> </div> <h2 id="events">Events</h2> <pre class='prettyprint'> $("#picker").spectrum({ move: function(tinycolor) { }, show: function(tinycolor) { }, hide: function(tinycolor) { }, beforeShow: function(tinycolor) { }, }); </pre> <h3 id="events-change">change</h3> <div class='option-content'> <div class='description'> <p>Called as the original input changes. Only happens when the input is closed or the 'Choose' button is clicked.</p> </div> <pre class='prettyprint'> change: function(color) { color.toHexString(); // #ff0000 } </pre> <div class='example'> <input type='text' value='blanchedalmond' name='changeOnMoveNo' id='changeOnMoveNo' /> <em id='changeOnMoveNoLabel' class='em-label'></em> </div> </div> <h3 id="events-move">move</h3> <div class='option-content'> <div class='description'> <p>Called as the user moves around within the colorpicker</p> </div> <pre class='prettyprint'> move: function(color) { color.toHexString(); // #ff0000 } </pre> <div class='example'> <input type='text' value='blanchedalmond' name='changeOnMove' id='changeOnMove' /> <em id='changeOnMoveLabel' class='em-label'></em> </div> </div> <h3 id="events-hide">hide</h3> <div class='option-content'> <div class='description'> <p> Called after the colorpicker is hidden. This happens when clicking outside of the picker while it is open. Note, when any colorpicker on the page is shown it will hide any that are already open. This event is ignored on a flat colorpicker. </p> </div> <pre class='prettyprint'> hide: function(color) { color.toHexString(); // #ff0000 } </pre> <div class='example'> <input type='text' value='blanchedalmond' name='eventhide' id='eventhide' /> <em id='eventhideLabel' class='em-label'></em> </div> </div> <h3 id="events-show">show</h3> <div class='option-content'> <div class='description'> <p> Called after the colorpicker is opened. This is ignored on a flat colorpicker. Note, when any colorpicker on the page is shown it will hide any that are already open. </p> </div> <pre class='prettyprint'> show: function(color) { color.toHexString(); // #ff0000 } </pre> <div class='example'> <input type='text' value='blanchedalmond' name='eventshow' id='eventshow' /> <em id='eventshowLabel' class='em-label'></em> </div> </div> <h3 id="events-beforeShow">beforeShow</h3> <div class='option-content'> <div class='description'> <p> You can prevent the colorpicker from showing up if you return false in the beforeShow event. This event is ignored on a flat colorpicker. </p> </div> <pre class='prettyprint'> beforeShow: function(color) { return false; // Will never show up } </pre> <div class='example'> <input type='text' value='blanchedalmond' name='beforeShow' id='beforeShow' /> </div> </div> <h3 id="events-dragstart">dragstart</h3> <div class='option-content'> <div class='description'> <p> Called at the beginning of a drag event on either hue slider, alpha slider, or main color picker areas </p> </div> <pre class='prettyprint'> $(element).on("dragstart.spectrum"): function(e, color) { color.toHexString(); // #ff0000 } </pre> <div class='example'> <input type='text' value='blanchedalmond' name='eventdragstart' id='eventdragstart' /> <em id='eventdragstartLabel' class='em-label'></em> </div> </div> <h3 id="events-dragstop">dragstop</h3> <div class='option-content'> <div class='description'> <p> Called at the end of a drag event on either hue slider, alpha slider, or main color picker areas </p> </div> <pre class='prettyprint'> $(element).on("dragstop.spectrum"): function(e, color) { color.toHexString(); // #ff0000 } </pre> <div class='example'> <input type='text' value='blanchedalmond' name='eventdragstop' id='eventdragstop' /> <em id='eventdragstopLabel' class='em-label'></em> </div> </div> <h2 id="methods">Methods</h2> <pre class='prettyprint'> $("#picker").spectrum("show"); $("#picker").spectrum("hide"); $("#picker").spectrum("toggle"); $("#picker").spectrum("get"); $("#picker").spectrum("set", colorString); $("#picker").spectrum("container"); $("#picker").spectrum("reflow"); $("#picker").spectrum("destroy"); $("#picker").spectrum("enable"); $("#picker").spectrum("disable"); $("#picker").spectrum("option", optionName); $("#picker").spectrum("option", optionName, newOptionValue); </pre> <h3 id="methods-show">show</h3> <div class='option-content'> <div class='description'> <p> Shows the colorpicker. </p> </div> </div> <h3 id="methods-hide">hide</h3> <div class='option-content'> <div class='description'> <p> Hides the colorpicker. </p> </div> </div> <h3 id="methods-toggle">toggle</h3> <div class='option-content'> <div class='description'> <p> Toggles the colorpicker. </p> <p class="warning"> <b>Warning:</b> If you are calling toggle from a click handler, make sure you <code>return false</code> to prevent the colorpicker from immediately hiding after it is toggled. </p> </div> <pre class='prettyprint'> $("#btn-toggle").click(function() { $("#toggle").spectrum("toggle"); return false; }); </pre> <div class='example'> <input type='text' value='blanchedalmond' name='toggle' id='toggle' /> <button id='btn-toggle'>Toggle</button> </div> </div> <h3 id="methods-get">get</h3> <div class='option-content'> <div class='description'> <p> Gets the current value from the colorpicker. </p> </div> </div> <h3 id="methods-set">set</h3> <div class='option-content'> <div class='description'> <p> Setting the colorpicker programmatically will update the original input. </p> <p> Note: this will <strong>not</strong> fire the <code>change</code> event, to prevent infinite loops from calling <code>set</code> from within <code>change</code>. </p> </div> <pre class='prettyprint'> &lt;input type='text' value='blanchedalmond' name='triggerSet' id='triggerSet' /&gt; &lt;input type='text' placeholder='Enter A Color' id='enterAColor' /&gt; &lt;button id='btnEnterAColor'&gt;Trigger Set&lt;/button&gt; &lt;script&gt; $("#triggerSet").spectrum(); // Show the original input to demonstrate the value changing when calling `set` $("#triggerSet").show(); $("#btnEnterAColor").click(function() { $("#triggerSet").spectrum("set", $("#enterAColor").val()); }); &lt;/script&gt; </pre> <div class='example'> <input type='text' value='blanchedalmond' name='triggerSet' id='triggerSet' /><br /><br /> <input type='text' placeholder='Enter A Color' id='enterAColor' /><button id='btnEnterAColor'>Trigger Set</button> </div> </div> <h3 id="methods-container">container</h3> <div class='option-content'> <div class='description'> <p> Retrieves the container element of the colorpicker, in case you want to manaully position it or do other things. </p> </div> </div> <h3 id="methods-reflow">reflow</h3> <div class='option-content'> <div class='description'> <p> Resets the positioning of the container element. This could be used was hidden when initialized, or if the colorpicker is inside of a moving area. </p> </div> </div> <h3 id="methods-destroy">destroy</h3> <div class='option-content'> <div class='description'> <p> Removes the colorpicker functionality and restores the element to its original state. </p> </div> </div> <h3 id="methods-enable">enable</h3> <div class='option-content'> <div class='description'> <p> Allows selection of the colorpicker component. If it is already enabled, this method does nothing. </p> <p> Additionally, this will cause the original (now hidden) input to be set as disabled. </p> </div> </div> <h3 id="methods-disable">disable</h3> <div class='option-content'> <div class='description'> <p> Disables selection of the colorpicker component. Adds the <code>sp-disabled</code> class onto the replacer element. If it is already disabled, this method does nothing. </p> <p> Additionally, this will remove the <code>disabled</code> property on the original (now hidden). </p> </div> </div> <h3 id="methods-option">option</h3> <div class='option-content'> <div class='description'> <p> Calling <code>option</code> with an option name will return the current value of that option. So, for example: </p> <pre class='prettyprint'> $("input").spectrum({ showInput: true }); $("input").spectrum("option", "showInput"); // true </pre> <p> Calling <code>option</code> with an option name and an option value will set the option to the new value. </p> <pre class='prettyprint'> $("input").spectrum({ showInput: true }); $("input").spectrum("option", "showInput", false); $("input").spectrum("option", "showInput"); // false </pre> </div> </div> <h2 id="skinning">Skinning</h2> <p>Since it is all built with HTML/CSS, you can skin it easily. There are two parts to the <a href='https://github.com/bgrins/spectrum/blob/master/spectrum.css'>spectrum.css</a> file, the core rules (at the top of the file), and the themable rules (at the bottom). Feel free to tweak these rules to make it look how you want.</p> <h3 id="skinning-nonInput" class='point'>Non-input elements</h3> <p> You can use any element you would like to trigger the colorpicker: <a href='#' id='openWithLink'>Click me to open a colorpicker</a>, though it is strongly recommended to stick with <code>&lt;input&gt;</code> tags. </p> <h2 id="details">Nitty Gritty</h2> <h3 id="details-browserSupport" class='point'>Browser Support</h3> <p>I wanted this to work in the latest and greatest browsers, but also target backwords compatibility and <strong>mobile support</strong>. Here are the currently supported browers: <ul> <li>IE <small>6+</small></li> <li>Chrome <small>4+</small></li> <li>Firefox <small>3.6+</small></li> <li>Safari <small>4+</small></li> <li>Opera <small>11.1+</small></li> <li>iOS</li> </ul> <h3 id="details-ieImplementation" class='point'>IE Implementation</h3> <p> IE Support is provided using <a href='http://msdn.microsoft.com/en-us/library/ms532997(v=vs.85).aspx'>proprietary filters</a>. Other browsers use CSS gradients. </p> <h3 id="details-acceptedColorInputs" class='point'>Accepted Color Inputs</h3> <p>Spectrum will use the color passed in to initialize. If there is no color passed in, it will try to parse a color based on the <code>value</code> of the input. The color parsing is based on the <a href='https://github.com/bgrins/TinyColor'>TinyColor</a> plugin, and accepts many forms of input:</p> <pre class='prettyprint'> red #fff fff #ffffff ffffff rgb(255, 0, 0) rgb 255 0 0 hsl(0, 100, 50) hsl(0, 100%, 50%) hsl 0 100 50 hsl 0 100% 50% hsv(0, 100%, 100%) hsv(0, 100, 100) hsv 0 100% 100% hsv 0 100 100 </pre> <p>It also provides the following forms of output:</p> <pre class='prettyprint'> var t = $("#element").spectrum("get"); t.toHex() // "ff0000" t.toHexString() // "#ff0000" t.toRgb() // {"r":255,"g":0,"b":0} t.toRgbString() // "rgb(255, 0, 0)" t.toHsv() // {"h":0,"s":1,"v":1} t.toHsvString() // "hsv(0, 100%, 100%)" t.toHsl() // {"h":0,"s":1,"l":0.5} t.toHslString() // "hsl(0, 100%, 50%)" t.toName() // "red" </pre> <div class='footer'> <h2>Share</h2> <p> If you've made it this far, please share one of these links to help others find this project! <br /> <a href='http://bgrins.github.com/spectrum'>JavaScript Colorpicker</a> | <a href='http://bgrins.github.com/spectrum'>jQuery Colorpicker</a> | <a href='http://bgrins.github.com/spectrum'>Mobile Colorpicker</a> | <a href='http://bgrins.github.com/spectrum'>Spectrum colorpicker</a> </p> <p> Thanks to all the <a href='https://github.com/bgrins/spectrum/graphs/contributors'>spectrum contributors</a> for committing code, documentation, and <a href='https://github.com/bgrins/spectrum/tree/master/i18n'>translations</a>. </p> <p> If you want to let me (<a href='http://twitter.com/bgrins'>@bgrins</a>) know you are using it, send me a link where it can be seen or add it to the <a href='https://github.com/bgrins/spectrum/wiki/Sites-Using-Spectrum'>list of projects using Spectrum</a>! </p> </div> </div> </div> <script type="text/javascript" src="docs/prettify.js"></script> <script type="text/javascript"> var _gaq = _gaq || []; _gaq.push(['_setAccount', 'UA-8259845-4']); _gaq.push(['_trackPageview']); (function() { var ga = document.createElement('script'); ga.type = 'text/javascript'; ga.async = true; ga.src = ('https:' == document.location.protocol ? 'https://ssl' : 'http://www') + '.google-analytics.com/ga.js'; var s = document.getElementsByTagName('script')[0]; s.parentNode.insertBefore(ga, s); })(); </script> </body> </html>
{ "pile_set_name": "Github" }
<?php namespace Drupal\media_test_oembed; use Drupal\media\OEmbed\UrlResolver as BaseUrlResolver; /** * Overrides the oEmbed URL resolver service for testing purposes. */ class UrlResolver extends BaseUrlResolver { /** * Sets the endpoint URL for an oEmbed resource URL. * * @param string $url * The resource URL. * @param string $endpoint_url * The endpoint URL. */ public static function setEndpointUrl($url, $endpoint_url) { $urls = \Drupal::state()->get(static::class, []); $urls[$url] = $endpoint_url; \Drupal::state()->set(static::class, $urls); } /** * {@inheritdoc} */ public function getResourceUrl($url, $max_width = NULL, $max_height = NULL) { $urls = \Drupal::state()->get(static::class, []); if (isset($urls[$url])) { return $urls[$url]; } return parent::getResourceUrl($url, $max_width, $max_height); } }
{ "pile_set_name": "Github" }
<?xml version="1.0" encoding="UTF-8"?> <!DOCTYPE helpset PUBLIC "-//Sun Microsystems Inc.//DTD JavaHelp HelpSet Version 2.0//EN" "http://java.sun.com/products/javahelp/helpset_2_0.dtd"> <helpset version="2.0" xml:lang="sr-CS"> <title>Active Scan Rules - Alpha | ZAP Extension</title> <maps> <homeID>top</homeID> <mapref location="map.jhm"/> </maps> <view> <name>TOC</name> <label>Contents</label> <type>org.zaproxy.zap.extension.help.ZapTocView</type> <data>toc.xml</data> </view> <view> <name>Index</name> <label>Index</label> <type>javax.help.IndexView</type> <data>index.xml</data> </view> <view> <name>Search</name> <label>Search</label> <type>javax.help.SearchView</type> <data engine="com.sun.java.help.search.DefaultSearchEngine"> JavaHelpSearch </data> </view> <view> <name>Favorites</name> <label>Favorites</label> <type>javax.help.FavoritesView</type> </view> </helpset>
{ "pile_set_name": "Github" }
import "hash" rule k3ed_15e76b9140000932 { meta: copyright="Copyright (c) 2014-2017 Support Intelligence Inc, All Rights Reserved." engine="saphire/1.2.2 divinorum/0.99 icewater/0.3.01" viz_url="http://icewater.io/en/cluster/query?h64=k3ed.15e76b9140000932" cluster="k3ed.15e76b9140000932" cluster_size="160 samples" filetype = "pe" tlp = "amber" version = "icewater foxtail" author = "Rick Wesson (@wessorh) [email protected]" date = "20171009" license = "RIL v1.0 see https://raw.githubusercontent.com/SupportIntelligence/Icewater/master/LICENSE" family="malicious proxy heuristic" md5_hashes="['381f2908603e456179e0f132aeff7fb9', 'efbf8d6febb346c7e45c67915cfc5a07', '2092c0328d50bb0a6415cae5e39e268a']" condition: filesize > 16384 and filesize < 65536 and hash.md5(17920,1024) == "c963f892cbf765f52338f04e7c608d8b" }
{ "pile_set_name": "Github" }
name: Code Style Check on: pull_request: push: branches: - master jobs: code_style: runs-on: ubuntu-latest steps: - uses: actions/checkout@v2 - uses: shivammathur/setup-php@v1 with: php-version: 7.3 coverage: none # disable xdebug, pcov - run: composer install --no-progress # fix code style, automatically - run: composer fix-cs # push changes back # note that this might not work with PRs from forks: # https://github.com/stefanzweifel/git-auto-commit-action/issues/25 - uses: stefanzweifel/[email protected] with: commit_message: Automatic Fix of Code Style branch: ${{ github.head_ref }} # check if some unfixable code style issues remain - run: composer check-cs
{ "pile_set_name": "Github" }
-- name: GetAuthor :one SELECT * FROM authors WHERE id = $1 LIMIT 1; -- name: ListAuthors :many SELECT * FROM authors ORDER BY name; -- name: CreateAuthor :one INSERT INTO authors ( name, bio ) VALUES ( $1, $2 ) RETURNING *; -- name: DeleteAuthor :exec DELETE FROM authors WHERE id = $1;
{ "pile_set_name": "Github" }
This Malta target is intended to be used with the Qemu emulator. It can be used to prototype an OpenWrt firmware for MIPS processors. One could also use it to troubleshoot MIPS applications without access to real hardware. To use the images built by OpenWrt with qemu, use the following commands: For the little-endian image: qemu-system-mipsel -kernel bin/malta/openwrt-malta-le-vmlinux-initramfs.elf -nographic -m 256 For the big-endian image: qemu-system-mips -kernel bin/malta/openwrt-malta-be-vmlinux-initramfs.elf -nographic -m 256 and enjoy the system bootin.
{ "pile_set_name": "Github" }
/* ** Example Winamp .RAW input plug-in ** Copyright (c) 1998, Justin Frankel/Nullsoft Inc. */ #include <windows.h> #include <windowsx.h> #include <mmreg.h> #include <msacm.h> #include <math.h> #include <string.h> #include <stdio.h> #include <time.h> //#include "FileDlg.h" //#include "Reg.h" //#include "WinResUtil.h" //#include "./VBA/GBA.h" //#include "./VBA/Globals.h" //#include "./VBA/Sound.h" //#include "./VBA/Util.h" //#include "./VBA/win32/VBA.h" #include "resource.h" #include "gsf.h" #include "VBA/psftag.h" #include "loadpic.h" #include "in2.h" #define ProgName "Highly Advanced" #define AppVer " v0.11" #define AppCredit ProgName AppVer " by Zoopd and CaitSith2.\nBased on the Visual Boy Advance code.\nOriginal PSF concept by Neill Corlett." //#define AppName ProgName " (x86)" #define AppReg "Software\\Zoopd and Caitsith2\\" ProgName short sample_buffer[576*2*2]; // used for DSP #define WINAMP_BUFFER_SIZE (576*4) #ifndef _DEBUG // avoid CRT. Evil. Big. Bloated. BOOL WINAPI _DllMainCRTStartup(HANDLE hInst, ULONG ul_reason_for_call, LPVOID lpReserved) { return TRUE; } int main(void) { return 0; } #endif // post this to the main window at end of file (after playback as stopped) #define WM_WA_MPEG_EOF WM_USER+2 // raw configuration //#define NCH 2 //#define SAMPLERATE 44100 //#define BPS 16 int TrackLength=0; int FadeLength=0; int cpupercent=0; int IgnoreTrackLength=0; int deflen=120,deffade=4,silencelength=5,silencedetected=0; int DetectSilence=0; int TrailingSilence=1000; char titlefmt[256]="%game% - %title%"; char *infoDlgpsftag=NULL; char *getfileinfopsftag=NULL; int infoDlgWriteNewTags=0; int infoDlgDisableTimer=0; int sndBitsPerSample; int sndSamplesPerSec; int sndNumChannels; int relvolume=1000; int defvolume=1000; unsigned char endofseek = 0; extern unsigned short soundFinalWave[1470]; extern int soundBufferLen; extern char soundEcho; extern char soundLowPass; extern char soundReverse; extern char soundQuality; In_Module mod; // the output module (declared near the bottom of this file) char lastfn[MAX_PATH]; // currently playing file (used for getting info on the current file) unsigned char IsCurrentFile = FALSE; int file_length; // file length, in bytes double decode_pos_ms; // current decoding position, in milliseconds int paused; // are we paused? int seek_needed; // if != -1, it is the point that the decode thread should seek to, in ms. //char sample_buffer[576*NCH*(BPS/8)*2]; // sample buffer HANDLE input_file=INVALID_HANDLE_VALUE; // input file handle int killDecodeThread=0; // the kill switch for the decode thread HANDLE thread_handle=INVALID_HANDLE_VALUE; // the handle to the decode thread DWORD WINAPI __stdcall DecodeThread(void *b); // the decode thread procedure BOOL CALLBACK configDlgProc(HWND hDlg, UINT uMsg, WPARAM wParam, LPARAM lParam); int infoDlg(char *fn, HWND hwnd); void ReadSettings(void); void WriteSettings(void); int track_length; void GetFile(char *filename, char *buffer) { char *p = strrchr(filename, '\\'); if(p) strcpy(buffer,p+1); } void config(HWND hwndParent) { DialogBox(mod.hDllInstance, (const char *)IDD_CONFIG, hwndParent, configDlgProc); } void about(HWND hwndParent) { MessageBox(hwndParent,AppCredit,"About",MB_OK); } extern int soundInterpolation; #ifndef NO_INTERPOLATION extern void interp_setup(int which); extern void interp_cleanup(); #endif void init() { // DisplayError("Init Started"); srand(time(NULL)); // DisplayError("Random Seed Initialized"); ReadSettings(); // DisplayError("User Settings Loaded"); #ifndef NO_INTERPOLATION interp_setup(soundInterpolation); #endif // DisplayError("Interpolation Set up"); } void quit() { #ifndef NO_INTERPOLATION interp_cleanup(); #endif WriteSettings(); } int isourfile(char *fn) { return 0; } // used for detecting URL streams.. unused here. strncmp(fn,"http://",7) to detect HTTP streams, etc int SongChanged=FALSE; int play(char *fn) { int maxlatency; int thread_id; input_file = CreateFile(fn,GENERIC_READ,FILE_SHARE_READ|FILE_SHARE_WRITE,NULL, OPEN_EXISTING,FILE_ATTRIBUTE_NORMAL,NULL); if (input_file == INVALID_HANDLE_VALUE) // error opening file { return 1; } file_length=GetFileSize(input_file,NULL); if(IsCurrentFile) { if(!strcmp(fn,lastfn)) { IsCurrentFile = TRUE; SongChanged=FALSE; } else { IsCurrentFile = FALSE; SongChanged=TRUE; } } strcpy(lastfn,fn); paused=0; decode_pos_ms=0; seek_needed=-1; GSFRun(fn); maxlatency = mod.outMod->Open(sndSamplesPerSec,sndNumChannels,sndBitsPerSample, -1,-1); if (maxlatency < 0) // error opening device { CloseHandle(input_file); input_file=INVALID_HANDLE_VALUE; return 1; } // dividing by 1000 for the first parameter of setinfo makes it // display 'H'... for hundred.. i.e. 14H Kbps. mod.SetInfo((sndSamplesPerSec*sndBitsPerSample*sndNumChannels)/1000,sndSamplesPerSec/1000,sndNumChannels,1); // initialize vis stuff mod.SAVSAInit(maxlatency,sndSamplesPerSec); mod.VSASetInfo(sndSamplesPerSec,sndNumChannels); mod.outMod->SetVolume(-666); // set the output plug-ins default volume killDecodeThread=0; thread_handle = (HANDLE) CreateThread(NULL,0,(LPTHREAD_START_ROUTINE) DecodeThread,(void *) &killDecodeThread,0,&thread_id); return 0; } void pause() { paused=1; mod.outMod->Pause(1); } void unpause() { paused=0; mod.outMod->Pause(0); } int ispaused() { return paused; } void stop() { if (thread_handle != INVALID_HANDLE_VALUE) { if (paused) unpause(); killDecodeThread=1; if (WaitForSingleObject(thread_handle,5000) == WAIT_TIMEOUT) { MessageBox(mod.hMainWindow,"error asking thread to die!\n","error killing decode thread",0); TerminateThread(thread_handle,0); } CloseHandle(thread_handle); thread_handle = INVALID_HANDLE_VALUE; } if (input_file != INVALID_HANDLE_VALUE) { CloseHandle(input_file); input_file=INVALID_HANDLE_VALUE; } GSFClose(); mod.outMod->Close(); mod.SAVSADeInit(); } void end_of_track() //wrapper, since stop is a variable in the emulator code { PostMessage(mod.hMainWindow,WM_WA_MPEG_EOF,0,0); ExitThread(0); } int getlength() { return track_length; //return (file_length*10)/(sndSamplesPerSec/100*sndNumChannels*(sndBitsPerSample/8)); } int getoutputtime() { return decode_pos_ms+(mod.outMod->GetOutputTime()-mod.outMod->GetWrittenTime()); } void setoutputtime(int time_in_ms) { seek_needed=time_in_ms; } void setvolume(int volume) { mod.outMod->SetVolume(volume); } void setpan(int pan) { mod.outMod->SetPan(pan); } extern int LengthFromString(const char * timestring); extern int VolumeFromString(const char * volumestring); void getfileinfo(char *filename, char *title, int *length_in_ms) { DWORD dwRead; DWORD FileSize; DWORD tagstart; DWORD taglen; DWORD reservesize; HANDLE hFile; BYTE buffer[256],length[256],fade[256], volume[256]; BYTE Test[5]; //char *psftag; if (!filename || !*filename) filename=lastfn; //if (title) sprintf(title,"%s",filename); if(!strcmp(filename,lastfn)) IsCurrentFile = TRUE; else IsCurrentFile = FALSE; hFile = CreateFile(filename,GENERIC_READ,FILE_SHARE_READ,NULL, OPEN_EXISTING,FILE_ATTRIBUTE_NORMAL | FILE_FLAG_RANDOM_ACCESS, NULL); if (hFile == INVALID_HANDLE_VALUE) { return; } ReadFile(hFile,Test,4,&dwRead,NULL); if (!IsValidGSF(Test)) { CloseHandle(hFile); return; } // Read GSF contents ReadFile(hFile,&reservesize,4,&dwRead,NULL); // size of reserved area ReadFile(hFile,&FileSize,4,&dwRead,NULL); // size of program ReadFile(hFile,Test,4,&dwRead,NULL); // CRC (no check yet) tagstart=SetFilePointer(hFile,0,0,FILE_CURRENT)+FileSize+reservesize; SetFilePointer(hFile,tagstart,0,FILE_BEGIN); ReadFile(hFile,Test,5,&dwRead,NULL); // read tags if there are any if (IsTagPresent(Test)) { tagstart+=5; taglen=SetFilePointer(hFile,0,0,FILE_END)-tagstart; SetFilePointer(hFile,tagstart,0,FILE_BEGIN); getfileinfopsftag=malloc(taglen+2); ReadFile(hFile,getfileinfopsftag,taglen,&dwRead,NULL); getfileinfopsftag[taglen]='\0'; psftag_raw_getvar(getfileinfopsftag,"length",length,sizeof(length)-1); psftag_raw_getvar(getfileinfopsftag,"fade",fade,sizeof(fade)-1); psftag_raw_getvar(getfileinfopsftag,"volume",volume,sizeof(volume)-1); if (length_in_ms) *length_in_ms=LengthFromString(length)+LengthFromString(fade); //if (IgnoreTrackLength) *length_in_ms=0; // create title from PSF tag if (title) { DWORD c=0,tagnamestart; char tempchar; sprintf(title,""); while (c < strlen(titlefmt)) { if (titlefmt[c]=='%') { tagnamestart=++c; for (;c<strlen(titlefmt) && titlefmt[c] != '%'; c++); if (c == strlen(titlefmt)) { DisplayError("Bad title format string (unterminated token)"); return; } titlefmt[c]='\0'; if(!strcmp(titlefmt+tagnamestart,"file")) GetFile(filename,buffer); else psftag_raw_getvar(getfileinfopsftag,titlefmt+tagnamestart,buffer,sizeof(buffer)-1); strcat(title,buffer); titlefmt[c]='%'; } else { tempchar=titlefmt[c+1]; titlefmt[c+1]='\0'; strcat(title,titlefmt+c); titlefmt[c+1]=tempchar; } c++; } } free(getfileinfopsftag); getfileinfopsftag=NULL; } else { if (title) { GetFile(filename,buffer); sprintf(title,""); strcat(title,buffer); } } if (*length_in_ms <= 0) *length_in_ms=(deflen+deffade)*1000; CloseHandle(hFile); if(IsCurrentFile) { track_length = *length_in_ms; // relvolume=VolumeFromString(volume); // if(relvolume==0) // { // relvolume=defvolume; // } } } void eq_set(int on, char data[10], int preamp) { // most plug-ins can't even do an EQ anyhow.. I'm working on writing // a generic PCM EQ, but it looks like it'll be a little too CPU // consuming to be useful :) } // render 576 samples into buf. // note that if you adjust the size of sample_buffer, for say, 1024 // sample blocks, it will still work, but some of the visualization // might not look as good as it could. Stick with 576 sample blocks // if you can, and have an additional auxiliary (overflow) buffer if // necessary.. DWORD WINAPI __stdcall DecodeThread(void *b) { int done=0; while (! *((int *)b) ) { /*if (seek_needed != -1) { int offs; decode_pos_ms = seek_needed-(seek_needed%1000); seek_needed=-1; done=0; mod.outMod->Flush(decode_pos_ms); offs = (decode_pos_ms/1000) * SAMPLERATE; SetFilePointer(input_file,offs*NCH*(BPS/8),NULL,FILE_BEGIN); } if (done) { mod.outMod->CanWrite(); if (!mod.outMod->IsPlaying()) { PostMessage(mod.hMainWindow,WM_WA_MPEG_EOF,0,0); return 0; } Sleep(10); } else if (mod.outMod->CanWrite() >= ((576*NCH*(BPS/8))<<(mod.dsp_isactive()?1:0))) { int l=576*NCH*(BPS/8); l=get_576_samples(sample_buffer); if (!l) { done=1; } else { mod.SAAddPCMData((char *)sample_buffer,NCH,BPS,decode_pos_ms); mod.VSAAddPCMData((char *)sample_buffer,NCH,BPS,decode_pos_ms); decode_pos_ms+=(576*1000)/SAMPLERATE; if (mod.dsp_isactive()) l=mod.dsp_dosamples((short *)sample_buffer,l/NCH/(BPS/8),BPS,NCH,SAMPLERATE)*(NCH*(BPS/8)); mod.outMod->Write(sample_buffer,l); } } else*/ //while (mod->outMod->CanWrite() < (remainingBytes/WINAMP_BUFFER_SIZE)*WINAMP_BUFFER_SIZE) EmulationLoop(); //else // Sleep(50); } return 0; } In_Module mod = { IN_VER, ProgName AppVer, 0, // hMainWindow 0, // hDllInstance "gsf\0GSF File (*.gsf)\0minigsf\0Mini-GSF File (*.minigsf)\0", 1, // is_seekable 1, // uses output config, about, init, quit, getfileinfo, infoDlg, isourfile, play, pause, unpause, ispaused, stop, getlength, getoutputtime, setoutputtime, setvolume, setpan, 0,0,0,0,0,0,0,0,0, // vis stuff 0,0, // dsp eq_set, NULL, // setinfo 0 // out_mod }; __declspec( dllexport ) In_Module * winampGetInModule2() { return &mod; } int buffertime = 0; void writeSound(void) { int ret = soundBufferLen; //int i; while (mod.outMod->CanWrite() < ((ret*sndNumChannels*(sndBitsPerSample/8))<<(mod.dsp_isactive()?1:0))) Sleep(50); mod.SAAddPCMData((char *)soundFinalWave,sndNumChannels,sndBitsPerSample,decode_pos_ms); mod.VSAAddPCMData((char *)soundFinalWave,sndNumChannels,sndBitsPerSample,decode_pos_ms); decode_pos_ms += (ret/(2*sndNumChannels) * 1000) / (float)sndSamplesPerSec; if (mod.dsp_isactive()) ret=mod.dsp_dosamples((short *)soundFinalWave,ret/sndNumChannels/(sndBitsPerSample/8),sndBitsPerSample,sndNumChannels,sndSamplesPerSec)*(sndNumChannels*(sndBitsPerSample/8)); //if(soundFinalWave[0]==0&&soundFinalWave[1]==0&&soundFinalWave[2]==0&&soundFinalWave[3]==0) // DisplayError("%.2X%.2X%.2X%.2X - %d", soundFinalWave[0],soundFinalWave[1],soundFinalWave[2],soundFinalWave[3],ret); mod.outMod->Write((char *)&soundFinalWave,ret); if (seek_needed != -1) //if a seek is initiated { mod.outMod->Flush((long)decode_pos_ms); if (seek_needed < decode_pos_ms) //if we are asked to seek backwards. we have to start from the beginning { GSFClose(); GSFRun(lastfn); decode_pos_ms = 0; } } } BOOL CALLBACK rawDlgProc(HWND hDlg, UINT uMsg, WPARAM wParam, LPARAM lParam) { DWORD c,d; switch (uMsg) { case WM_CLOSE: EndDialog(hDlg,TRUE); return 0; case WM_INITDIALOG: { char *LFpsftag; //char LFpsftag[500001]; LFpsftag = malloc(strlen(infoDlgpsftag)*3+1); // <= includes terminating null for (c=0, d=0; c <= strlen(infoDlgpsftag); c++, d++) { LFpsftag[d]=infoDlgpsftag[c]; if (infoDlgpsftag[c]=='\n') { LFpsftag[d++]='\r'; LFpsftag[d]='\r'; LFpsftag[d]='\n'; } } SetDlgItemText(hDlg,IDC_RAWTAG,LFpsftag); free(LFpsftag); break; } case WM_COMMAND: switch (GET_WM_COMMAND_ID(wParam, lParam)) { case IDOK: GetDlgItemText(hDlg,IDC_RAWTAG,infoDlgpsftag,50000); // remove 0x0d (in PSF a newline is 0x0a) for (c=0,d=0; c < strlen(infoDlgpsftag); c++) { if (infoDlgpsftag[c] != 0x0d) { infoDlgpsftag[d]=infoDlgpsftag[c]; d++; } } infoDlgpsftag[d]='\0'; case IDCANCEL: EndDialog(hDlg,TRUE); break; } default: return 0; } return 1; } unsigned char pimpbot = FALSE; unsigned char PepperisaGoodBoy = TRUE; int playforever=0; int SetinfoDlgText(HWND hDlg) { char Buffer[1024]; char *LFpsftag; DWORD c,d; psftag_raw_getvar(infoDlgpsftag,"title",Buffer,sizeof(Buffer)-1); SetDlgItemText(hDlg,IDC_TITLE,Buffer); psftag_raw_getvar(infoDlgpsftag,"artist",Buffer,sizeof(Buffer)-1); SetDlgItemText(hDlg,IDC_ARTIST,Buffer); psftag_raw_getvar(infoDlgpsftag,"game",Buffer,sizeof(Buffer)-1); SetDlgItemText(hDlg,IDC_GAME,Buffer); psftag_raw_getvar(infoDlgpsftag,"year",Buffer,sizeof(Buffer)-1); SetDlgItemText(hDlg,IDC_YEAR,Buffer); psftag_raw_getvar(infoDlgpsftag,"copyright",Buffer,sizeof(Buffer)-1); SetDlgItemText(hDlg,IDC_COPYRIGHT,Buffer); psftag_raw_getvar(infoDlgpsftag,"gsfby",Buffer,sizeof(Buffer)-1); SetDlgItemText(hDlg,IDC_GSFBY,Buffer); psftag_raw_getvar(infoDlgpsftag,"tagger",Buffer,sizeof(Buffer)-1); SetDlgItemText(hDlg,IDC_TAGBY,Buffer); psftag_raw_getvar(infoDlgpsftag,"volume",Buffer,sizeof(Buffer)-1); SetDlgItemText(hDlg,IDC_VOLUME,Buffer); psftag_raw_getvar(infoDlgpsftag,"length",Buffer,sizeof(Buffer)-1); SetDlgItemText(hDlg,IDC_LENGTH,Buffer); psftag_raw_getvar(infoDlgpsftag,"fade",Buffer,sizeof(Buffer)-1); SetDlgItemText(hDlg,IDC_FADE,Buffer); psftag_raw_getvar(infoDlgpsftag,"comment",Buffer,sizeof(Buffer)-1); LFpsftag = malloc(strlen(Buffer)*3+1); for (c=0, d=0; c <= strlen(Buffer); c++, d++) { LFpsftag[d]=Buffer[c]; if (Buffer[c]=='\n') { LFpsftag[d++]='\r'; LFpsftag[d]='\r'; LFpsftag[d]='\n'; } } SetDlgItemText(hDlg,IDC_COMMENT,LFpsftag); free(LFpsftag); return 0; } BOOL CALLBACK infoDlgProc(HWND hDlg, UINT uMsg, WPARAM wParam, LPARAM lParam) { char Buffer[1024]; char *LFpsftag; //char LFpsftag[50001]; DWORD c,d; IPicture * pPicture; HANDLE surpriseImage; int randNum; switch (uMsg) { case WM_CLOSE: if(decode_pos_ms >= TrackLength-FadeLength) TrackLength=decode_pos_ms+FadeLength; EndDialog(hDlg,TRUE); return 0; case WM_INITDIALOG: pimpbot = FALSE; randNum = rand(); SetWindowLong(hDlg, DWL_USER, (LONG)0); if (PepperisaGoodBoy) { pPicture = NULL; if (randNum < RAND_MAX*0.025) // 1/10th a chance of occurring { pPicture = LoadPic(MAKEINTRESOURCE(IDB_BIGKITTY), "JPG", mod.hDllInstance); } else if (randNum >= RAND_MAX*0.025 && randNum < RAND_MAX*0.05) { pPicture = LoadPic(MAKEINTRESOURCE(IDB_PIMPBOT), "JPG", mod.hDllInstance); pimpbot = TRUE; } else if (randNum >= RAND_MAX*0.05 && randNum < RAND_MAX*0.1) { pPicture = LoadPic(MAKEINTRESOURCE(IDB_PEPPER), "JPG", mod.hDllInstance); } if (pPicture) { if (IPicture_getHandle(pPicture, (OLE_HANDLE *)&surpriseImage) == S_OK) { SendMessage( GetDlgItem(hDlg, IDC_LOGO), STM_SETIMAGE, IMAGE_BITMAP, (long)surpriseImage); //change the logo graphic SetWindowLong(hDlg, DWL_USER, (LONG)pPicture); } else { IPicture_Release(pPicture); } } } if(infoDlgDisableTimer) { CheckDlgButton(hDlg,IDC_DTIMER,BST_CHECKED); playforever=1; } SetinfoDlgText(hDlg); break; case WM_LBUTTONDOWN: if (pimpbot) { if (rand() > RAND_MAX/2) PlaySound((LPCSTR)IDR_PIMPBOT1, mod.hDllInstance, SND_RESOURCE|SND_ASYNC); else PlaySound((LPCSTR)IDR_PIMPBOT2, mod.hDllInstance, SND_RESOURCE|SND_ASYNC); } break; case WM_COMMAND: switch (GET_WM_COMMAND_ID(wParam, lParam)) { case IDOK: GetDlgItemText(hDlg,IDC_TITLE,Buffer,1024); psftag_raw_setvar(infoDlgpsftag,50000-1,"title",Buffer); GetDlgItemText(hDlg,IDC_ARTIST,Buffer,1024); psftag_raw_setvar(infoDlgpsftag,50000-1,"artist",Buffer); GetDlgItemText(hDlg,IDC_GAME,Buffer,1024); psftag_raw_setvar(infoDlgpsftag,50000-1,"game",Buffer); GetDlgItemText(hDlg,IDC_YEAR,Buffer,1024); psftag_raw_setvar(infoDlgpsftag,50000-1,"year",Buffer); GetDlgItemText(hDlg,IDC_COPYRIGHT,Buffer,1024); psftag_raw_setvar(infoDlgpsftag,50000-1,"copyright",Buffer); GetDlgItemText(hDlg,IDC_GSFBY,Buffer,1024); psftag_raw_setvar(infoDlgpsftag,50000-1,"gsfby",Buffer); GetDlgItemText(hDlg,IDC_TAGBY,Buffer,1024); psftag_raw_setvar(infoDlgpsftag,50000-1,"tagger",Buffer); GetDlgItemText(hDlg,IDC_VOLUME,Buffer,1024); psftag_raw_setvar(infoDlgpsftag,50000-1,"volume",Buffer); if(IsCurrentFile&&!SongChanged) { relvolume=VolumeFromString(Buffer); if(relvolume==0) relvolume=defvolume; } GetDlgItemText(hDlg,IDC_LENGTH,Buffer,1024); psftag_raw_setvar(infoDlgpsftag,50000-1,"length",Buffer); if(IsCurrentFile&&!SongChanged) TrackLength=LengthFromString(Buffer); GetDlgItemText(hDlg,IDC_FADE,Buffer,1024); psftag_raw_setvar(infoDlgpsftag,50000-1,"fade",Buffer); if(IsCurrentFile&&!SongChanged) { FadeLength=LengthFromString(Buffer); TrackLength+=FadeLength; if(TrackLength == 0) { TrackLength = (deflen + deffade)*1000; FadeLength = deffade*1000; } track_length=TrackLength; } //mod.GetLength; GetDlgItemText(hDlg,IDC_COMMENT,Buffer,1024); // remove 0x0d (in PSF a newline is 0x0a) for (c=0,d=0; c < strlen(Buffer); c++) { if (Buffer[c] != 0x0d) { Buffer[d]=Buffer[c]; d++; } } Buffer[d]='\0'; psftag_raw_setvar(infoDlgpsftag,50000,"comment",Buffer); infoDlgWriteNewTags=1; case IDCANCEL: if(decode_pos_ms >= TrackLength-FadeLength) TrackLength=decode_pos_ms+FadeLength; EndDialog(hDlg, TRUE); break; case IDC_NOWBUT: if(decode_pos_ms != 0) { sprintf(Buffer,"%i:%02i.%i",getoutputtime()/60000,(getoutputtime()%60000)/1000,getoutputtime()%1000); SetDlgItemText(hDlg,IDC_LENGTH,Buffer); } break; case IDC_DTIMER: infoDlgDisableTimer=(IsDlgButtonChecked(hDlg, IDC_DTIMER) == BST_CHECKED) ? TRUE : FALSE; playforever=infoDlgDisableTimer; if(decode_pos_ms >= TrackLength-FadeLength) TrackLength=decode_pos_ms+FadeLength; break; //case IDC_SECRETBUTTON: // PlaySound((LPCSTR)IDR_WAVE1, mod.hDllInstance, SND_RESOURCE|SND_ASYNC); // surpriseImage = LoadImage(mod.hDllInstance, MAKEINTRESOURCE(IDB_BIGKITTY), IMAGE_BITMAP, 0, 0, 0); //change the logo graphic //SendMessage( GetDlgItem(hDlg, IDC_SECRETBUTTON), STM_SETIMAGE, IMAGE_BITMAP, (long)surpriseImage); //'' // SendMessage(GetDlgItem(hDlg,IDC_SECRETBUTTON),BM_SETIMAGE,IMAGE_BITMAP, (long)surpriseImage); // break; case IDC_LAUNCHCONFIG: DialogBox(mod.hDllInstance, (const char *)IDD_CONFIG, hDlg, configDlgProc); break; case IDC_VIEWRAW: DialogBox(mod.hDllInstance, (const char *)IDD_RAWTAG, hDlg, rawDlgProc); SetinfoDlgText(hDlg); } break; case WM_DESTROY: pPicture = (IPicture *) GetWindowLong(hDlg, DWL_USER); if (pPicture) IPicture_Release(pPicture); break; default: return 0; } return 1; } int infoDlg(char *fn, HWND hwnd) { char infoDlg_fn[MAX_PATH]; playforever=infoDlgDisableTimer; SongChanged=FALSE; // sprintf(infoDlgfn,"Info for %s",fn); infoDlgpsftag=malloc(50001); //malloc(taglen+2); // for safety when editing infoDlgpsftag[0]='\0'; sprintf(infoDlg_fn,"%s",fn); psftag_readfromfile(infoDlgpsftag,infoDlg_fn); if(!strcmp(infoDlg_fn,lastfn)) IsCurrentFile = TRUE; else IsCurrentFile = FALSE; infoDlgWriteNewTags=0; DialogBox(mod.hDllInstance, (const char *)IDD_GSFINFO, hwnd, infoDlgProc); if (infoDlgWriteNewTags) { psftag_writetofile(infoDlgpsftag,infoDlg_fn); } free(infoDlgpsftag); infoDlgpsftag=NULL; playforever=0; return 0; } BOOL CALLBACK configDlgProc(HWND hDlg, UINT uMsg, WPARAM wParam, LPARAM lParam) { static int mypri; char buf[256]; //HANDLE hSlider; switch (uMsg) { case WM_CLOSE: EndDialog(hDlg,TRUE); return 0; case WM_INITDIALOG: if (soundEcho) CheckDlgButton(hDlg,IDC_ECHO,BST_CHECKED); if (soundLowPass) CheckDlgButton(hDlg,IDC_LOWPASSFILTER,BST_CHECKED); if (soundReverse) CheckDlgButton(hDlg,IDC_REVERSESTEREO,BST_CHECKED); if (IgnoreTrackLength) CheckDlgButton(hDlg,IDC_PLAYFOREVER,BST_CHECKED); else CheckDlgButton(hDlg,IDC_DEFLEN,BST_CHECKED); //if (IgnoreTrackLength) CheckDlgButton(hDlg,IDC_NOLENGTH,BST_CHECKED); //if (soundQuality == 1) CheckDlgButton(hDlg,IDC_44KHZ,BST_CHECKED); //if (soundQuality == 2) CheckDlgButton(hDlg,IDC_22KHZ,BST_CHECKED); { HWND w = GetDlgItem(hDlg, IDC_INTERP); SendMessage(w, CB_ADDSTRING, 0, (LPARAM)&"none"); SendMessage(w, CB_ADDSTRING, 0, (LPARAM)&"linear"); SendMessage(w, CB_ADDSTRING, 0, (LPARAM)&"cubic"); SendMessage(w, CB_ADDSTRING, 0, (LPARAM)&"FIR"); SendMessage(w, CB_ADDSTRING, 0, (LPARAM)&"bandlimited"); SendMessage(w, CB_SETCURSEL, soundInterpolation, 0); #ifdef NO_INTERPOLATION ShowWindow(w,FALSE); w = GetDlgItem(hDlg, IDC_INTERP_STATIC); ShowWindow(w,FALSE); #endif } if (DetectSilence) CheckDlgButton(hDlg,IDC_DETSIL,BST_CHECKED); //if (UseRecompiler) CheckDlgButton(hDlg,IDC_RECOMPILER,BST_CHECKED); SetDlgItemText(hDlg,IDC_TITLEFORMAT,titlefmt); sprintf(buf,"%i",deflen); SetDlgItemText(hDlg,IDC_DEFLENVAL,buf); sprintf(buf,"%i",deffade); SetDlgItemText(hDlg,IDC_DEFFADEVAL,buf); sprintf(buf,"%i",silencelength); SetDlgItemText(hDlg,IDC_DETSILVAL,buf); sprintf(buf,"%i.%.3i",defvolume/1000,defvolume%1000); SetDlgItemText(hDlg,IDC_DEFVOLUME,buf); sprintf(buf,"%i",TrailingSilence); SetDlgItemText(hDlg,IDC_TRAILINGSILENCE,buf); // set CPU Priority slider //hSlider=GetDlgItem(hDlg,IDC_PRISLIDER); //SendMessage(hSlider, TBM_SETRANGE, (WPARAM) TRUE, // redraw flag // (LPARAM) MAKELONG(1, 7)); // min. & max. positions //SendMessage(hSlider, TBM_SETPOS, //(WPARAM) TRUE, // redraw flag //(LPARAM) CPUPriority+1); //mypri=CPUPriority; //SetDlgItemText(hDlg,IDC_CPUPRI,pristr[CPUPriority]); break; case WM_COMMAND: switch (GET_WM_COMMAND_ID(wParam, lParam)) { case IDOK: soundEcho=(IsDlgButtonChecked(hDlg, IDC_ECHO) == BST_CHECKED) ? TRUE : FALSE; soundLowPass=(IsDlgButtonChecked(hDlg, IDC_LOWPASSFILTER) == BST_CHECKED) ? TRUE : FALSE; soundReverse=(IsDlgButtonChecked(hDlg, IDC_REVERSESTEREO) == BST_CHECKED) ? TRUE : FALSE; IgnoreTrackLength=(IsDlgButtonChecked(hDlg, IDC_PLAYFOREVER) == BST_CHECKED) ? TRUE : FALSE; DetectSilence=(IsDlgButtonChecked(hDlg,IDC_DETSIL) == BST_CHECKED) ? TRUE : FALSE; //if ((IsDlgButtonChecked(hDlg, IDC_44KHZ) == BST_CHECKED) ? TRUE : FALSE) // soundQuality = 1; //if ((IsDlgButtonChecked(hDlg, IDC_22KHZ) == BST_CHECKED) ? TRUE : FALSE) // soundQuality = 2; soundInterpolation = SendDlgItemMessage(hDlg, IDC_INTERP, CB_GETCURSEL, 0, 0); if (soundInterpolation < 0 || soundInterpolation > 4) soundInterpolation = 0; GetDlgItemText(hDlg,IDC_TITLEFORMAT,titlefmt,sizeof(titlefmt)-1); GetDlgItemText(hDlg,IDC_TRAILINGSILENCE,buf,sizeof(buf)-1); sscanf(buf,"%i",&TrailingSilence); GetDlgItemText(hDlg,IDC_DEFLENVAL,buf,sizeof(buf)-1); sscanf(buf,"%i",&deflen); GetDlgItemText(hDlg,IDC_DEFFADEVAL,buf,sizeof(buf)-1); sscanf(buf,"%i",&deffade); GetDlgItemText(hDlg,IDC_DETSILVAL,buf,sizeof(buf)-1); sscanf(buf,"%i",&silencelength); GetDlgItemText(hDlg,IDC_DEFVOLUME,buf,sizeof(buf)-1); defvolume=VolumeFromString(buf); silencedetected=0; //CPUPriority=mypri; WriteSettings(); if(decode_pos_ms >= TrackLength-FadeLength) TrackLength=decode_pos_ms+FadeLength; case IDCANCEL: EndDialog(hDlg,TRUE); break; } /* case WM_HSCROLL: if (lParam==GetDlgItem(hDlg,IDC_PRISLIDER)) { //DisplayError("HScroll=%i",HIWORD(wParam)); if (LOWORD(wParam)==TB_THUMBPOSITION || LOWORD(wParam)==TB_THUMBTRACK) mypri=HIWORD(wParam)-1; else mypri=SendMessage(GetDlgItem(hDlg,IDC_PRISLIDER),TBM_GETPOS,0,0)-1; SetDlgItemText(hDlg,IDC_CPUPRI,pristr[mypri]); } break; */ default: return 0; } return 1; } void WriteSettings(void) { HKEY hKey; DWORD dwDisp; RegCreateKeyEx(HKEY_CURRENT_USER,AppReg,0,NULL,REG_OPTION_NON_VOLATILE,KEY_ALL_ACCESS,NULL,&hKey,&dwDisp); RegSetValueEx(hKey,"Title Format",0,REG_SZ,titlefmt,strlen(titlefmt)); dwDisp = soundEcho; RegSetValueEx(hKey,"Echo",0,REG_DWORD,(BYTE*)&dwDisp,sizeof(dwDisp)); dwDisp = soundLowPass; RegSetValueEx(hKey,"Low-pass Filter",0,REG_DWORD,(BYTE*)&dwDisp,sizeof(dwDisp)); dwDisp = soundReverse; RegSetValueEx(hKey,"Reverse Stereo",0,REG_DWORD,(BYTE*)&dwDisp,sizeof(dwDisp)); RegSetValueEx(hKey,"Ignore Track Limits",0,REG_DWORD,(BYTE*)&IgnoreTrackLength,sizeof(IgnoreTrackLength)); //RegSetValueEx(hKey,"Sample Rate",0,REG_DWORD,(BYTE*)&soundQuality,sizeof(soundQuality)); RegSetValueEx(hKey,"Interpolation",0,REG_DWORD,(BYTE*)&soundInterpolation,sizeof(soundInterpolation)); dwDisp = PepperisaGoodBoy; RegSetValueEx(hKey,"Pepper is a Good Boy",0,REG_DWORD,(BYTE*)&dwDisp,sizeof(dwDisp)); //RegSetValueEx(hKey,"Audio HLE",0,REG_DWORD,(BYTE*)&AudioHLE,sizeof(AudioHLE)); RegSetValueEx(hKey,"Default Length Value",0,REG_DWORD,(BYTE*)&deflen,sizeof(deflen)); RegSetValueEx(hKey,"Default Fade Value",0,REG_DWORD,(BYTE*)&deffade,sizeof(deflen)); RegSetValueEx(hKey,"Detect Silence",0,REG_DWORD,(BYTE*)&DetectSilence,sizeof(DetectSilence)); RegSetValueEx(hKey,"Detect Silence Value",0,REG_DWORD,(BYTE*)&silencelength,sizeof(silencelength)); RegSetValueEx(hKey,"Trailing Silence",0,REG_DWORD,(BYTE*)&TrailingSilence,sizeof(TrailingSilence)); RegSetValueEx(hKey,"Default Volume",0,REG_DWORD,(BYTE*)&defvolume,sizeof(defvolume)); //RegSetValueEx(hKey,"Use Recompiler",0,REG_DWORD,(BYTE*)&UseRecompiler,sizeof(UseRecompiler)); //RegSetValueEx(hKey,"CPU Thread Priority",0,REG_DWORD,(BYTE*)&CPUPriority,sizeof(CPUPriority)); RegCloseKey(hKey); } void ReadSettings(void) { HKEY hKey; long lResult; unsigned long dwDataType,bufferlength,dwTemp; lResult=RegOpenKeyEx(HKEY_CURRENT_USER,AppReg,0,KEY_QUERY_VALUE,&hKey); if (lResult == ERROR_SUCCESS) { bufferlength = sizeof(titlefmt); RegQueryValueEx(hKey,"Title Format",0,&dwDataType,titlefmt,&bufferlength); bufferlength = sizeof(dwTemp); RegQueryValueEx(hKey,"Echo",0,&dwDataType,(BYTE*)&dwTemp,&bufferlength); soundEcho = !!dwTemp; bufferlength = sizeof(dwTemp); RegQueryValueEx(hKey,"Low-pass Filter",0,&dwDataType,(BYTE*)&dwTemp,&bufferlength); soundLowPass = !!dwTemp; bufferlength = sizeof(dwTemp); RegQueryValueEx(hKey,"Reverse Stereo",0,&dwDataType,(BYTE*)&dwTemp,&bufferlength); soundReverse = !!dwTemp; bufferlength = sizeof(IgnoreTrackLength); RegQueryValueEx(hKey,"Ignore Track Limits",0,&dwDataType,(BYTE*)&IgnoreTrackLength,&bufferlength); //bufferlength = sizeof(soundQuality); //RegQueryValueEx(hKey,"Sample Rate",0,&dwDataType,(BYTE*)&soundQuality,&bufferlength); bufferlength = sizeof(soundInterpolation); RegQueryValueEx(hKey,"Interpolation",0,&dwDataType,(BYTE*)&soundInterpolation,&bufferlength); //bufferlength = sizeof(FastSeek); //RegQueryValueEx(hKey,"Fast Seek",0,&dwDataType,(BYTE*)&FastSeek,&bufferlength); //bufferlength = sizeof(AudioHLE); //RegQueryValueEx(hKey,"Audio HLE",0,&dwDataType,(BYTE*)&AudioHLE,&bufferlength); bufferlength = sizeof(dwTemp); RegQueryValueEx(hKey,"Pepper is a Good Boy",0,&dwDataType,(BYTE*)&dwTemp,&bufferlength); PepperisaGoodBoy = !!dwTemp; bufferlength = sizeof(deflen); RegQueryValueEx(hKey,"Default Length Value",0,&dwDataType,(BYTE*)&deflen,&bufferlength); bufferlength = sizeof(deffade); RegQueryValueEx(hKey,"Default Fade Value",0,&dwDataType,(BYTE*)&deffade,&bufferlength); bufferlength = sizeof(DetectSilence); RegQueryValueEx(hKey,"Detect Silence",0,&dwDataType,(BYTE*)&DetectSilence,&bufferlength); bufferlength = sizeof(silencelength); RegQueryValueEx(hKey,"Detect Silence Value",0,&dwDataType,(BYTE*)&silencelength,&bufferlength); bufferlength = sizeof(TrailingSilence); RegQueryValueEx(hKey,"Trailing Silence",0,&dwDataType,(BYTE*)&TrailingSilence,&bufferlength); bufferlength = sizeof(defvolume); RegQueryValueEx(hKey,"Default Volume",0,&dwDataType,(BYTE*)&defvolume,&bufferlength); //bufferlength = sizeof(UseRecompiler); //RegQueryValueEx(hKey,"Use Recompiler",0,&dwDataType,(BYTE*)&UseRecompiler,&bufferlength); //bufferlength = sizeof(CPUPriority); //RegQueryValueEx(hKey,"CPU Thread Priority",0,&dwDataType,(BYTE*)&CPUPriority,&bufferlength); RegCloseKey(hKey); } else { WriteSettings(); } }
{ "pile_set_name": "Github" }
好奇心原文链接:[火星哥成为最大赢家,除此之外这届格莱美还发生了什么?_娱乐_好奇心日报-周哲浩](https://www.qdaily.com/articles/49701.html) WebArchive归档链接:[火星哥成为最大赢家,除此之外这届格莱美还发生了什么?_娱乐_好奇心日报-周哲浩](http://web.archive.org/web/20180912001149/http://www.qdaily.com:80/articles/49701.html) ![image](http://ww3.sinaimg.cn/large/007d5XDply1g3ybz121faj30u04pix6p)
{ "pile_set_name": "Github" }
project('meson-hello', 'c') executable('hello', 'hello.c', install : true)
{ "pile_set_name": "Github" }
// RUN: %clang_cc1 -fsyntax-only -verify %s -fblocks int (*FP)(); int (^IFP) (); int (^II) (int); int main() { int (*FPL) (int) = FP; // C doesn't consider this an error. // For Blocks, the ASTContext::typesAreBlockCompatible() makes sure this is an error. int (^PFR) (int) = IFP; // OK PFR = II; // OK int (^IFP) () = PFR; // OK const int (^CIC) () = IFP; // OK - initializing 'const int (^)()' with an expression of type 'int (^)()'}} const int (^CICC) () = CIC; int * const (^IPCC) () = 0; int * const (^IPCC1) () = IPCC; int * (^IPCC2) () = IPCC; // expected-error {{incompatible block pointer types initializing 'int *(^)()' with an expression of type 'int *const (^)()'}} int (^IPCC3) (const int) = PFR; int (^IPCC4) (int, char (^CArg) (double)); int (^IPCC5) (int, char (^CArg) (double)) = IPCC4; int (^IPCC6) (int, char (^CArg) (float)) = IPCC4; // expected-error {{incompatible block pointer types initializing 'int (^)(int, char (^)(float))' with an expression of type 'int (^)(int, char (^)(double))'}} IPCC2 = 0; IPCC2 = 1; // expected-error {{invalid block pointer conversion assigning to 'int *(^)()' from 'int'}} int (^x)() = 0; int (^y)() = 3; // expected-error {{invalid block pointer conversion initializing 'int (^)()' with an expression of type 'int'}} int a = 1; int (^z)() = a+4; // expected-error {{invalid block pointer conversion initializing 'int (^)()' with an expression of type 'int'}} } int blah() { int (^IFP) (float); char (^PCP)(double, double, char); IFP(1.0); IFP (1.0, 2.0); // expected-error {{too many arguments to block call}} char ch = PCP(1.0, 2.0, 'a'); return PCP(1.0, 2.0); // expected-error {{too few arguments to block}} }
{ "pile_set_name": "Github" }
--TEST-- ReflectionType leak --FILE-- <?php $closure = function(Test $x): Test2 { return new Test2($x); }; $rm = new ReflectionMethod($closure, '__invoke'); $rp = $rm->getParameters()[0]; $rt = $rp->getType(); $rrt = $rm->getReturnType(); unset($rm, $rp); var_dump($rt->getName(), $rrt->getName()); --EXPECT-- string(4) "Test" string(5) "Test2"
{ "pile_set_name": "Github" }