text
stringlengths
2
99.9k
meta
dict
package com.sandbox.worker.core.js.models; import com.sandbox.worker.models.enums.RuntimeVersion; import java.util.Arrays; import java.util.HashMap; import java.util.List; import java.util.Map; import org.apache.commons.lang3.tuple.ImmutablePair; import static com.sandbox.worker.models.enums.RuntimeVersion.*; public class WorkerVersionContext { private RuntimeVersion version; private String name; private String librariesPath; private List<ImmutablePair<String, String>> libraryNames; private Map<String, String> optionOverrides; public WorkerVersionContext(RuntimeVersion version, String name, String librariesPath, List<ImmutablePair<String, String>> libraryNames, Map<String, String> optionOverrides) { this.version = version; this.name = name; this.librariesPath = librariesPath; this.libraryNames = libraryNames; this.optionOverrides = optionOverrides; } public RuntimeVersion getVersion() { return version; } public String getName() { return name; } public String getLibrariesPath() { return librariesPath; } public List<ImmutablePair<String, String>> getLibraryNames() { return libraryNames; } public Map<String, String> getOptionOverrides() { return optionOverrides; } public static WorkerVersionContext get(RuntimeVersion version) { switch (version) { case VERSION_1: return new WorkerVersionContext(VERSION_1, "version_1", "com/sandbox/runtime/v2/js/version_1/", Arrays.asList(new ImmutablePair("amanda", "amanda-0.4.8.min.js"), new ImmutablePair("_", "lodash-2.4.1.min.js"), new ImmutablePair("moment", "moment-2.8.2.min.js"), new ImmutablePair("validator", "validator.min.js")), new HashMap() {{ put("js.ecmascript-version", "6"); }}); case VERSION_2: return new WorkerVersionContext(VERSION_2, "version_2", "com/sandbox/runtime/v2/js/version_2/", Arrays.asList(new ImmutablePair("amanda", "amanda-0.4.8.min.js"), new ImmutablePair("_", "lodash-4.2.1.min.js"), new ImmutablePair("moment", "moment-2.11.2.min.js"), new ImmutablePair("validator", "validator-4.7.2.min.js")), new HashMap() {{ put("js.ecmascript-version", "6"); }}); case VERSION_3: return new WorkerVersionContext(VERSION_3, "version_3", "com/sandbox/runtime/v2/js/version_3/", Arrays.asList(new ImmutablePair("Ajv", "ajv-6.10.0.min.js"), new ImmutablePair("_", "lodash-4.17.11.min.js"), new ImmutablePair("moment", "moment-2.24.0.min.js"), new ImmutablePair("validator", "validator-10.11.0.min.js")), new HashMap() {{ put("js.ecmascript-version", "11"); }}); } throw new IllegalArgumentException("Unsupported version:" + version); } }
{ "pile_set_name": "Github" }
/*--------------------------------------------------------------------------------------------- * Copyright (c) Microsoft Corporation. All rights reserved. * Licensed under the Source EULA. See License.txt in the project root for license information. *--------------------------------------------------------------------------------------------*/ import * as nls from 'vs/nls'; import * as DOM from 'vs/base/browser/dom'; import { Registry } from 'vs/platform/registry/common/platform'; import { Action, IAction, Separator, SubmenuAction } from 'vs/base/common/actions'; import { IViewletService } from 'vs/workbench/services/viewlet/browser/viewlet'; import { IViewlet } from 'vs/workbench/common/viewlet'; import { CompositeDescriptor, CompositeRegistry } from 'vs/workbench/browser/composite'; import { IConstructorSignature0, IInstantiationService, BrandedService } from 'vs/platform/instantiation/common/instantiation'; import { ToggleSidebarVisibilityAction, ToggleSidebarPositionAction } from 'vs/workbench/browser/actions/layoutActions'; import { ITelemetryService } from 'vs/platform/telemetry/common/telemetry'; import { IWorkbenchLayoutService, Parts } from 'vs/workbench/services/layout/browser/layoutService'; import { IThemeService } from 'vs/platform/theme/common/themeService'; import { IEditorGroupsService } from 'vs/workbench/services/editor/common/editorGroupsService'; import { URI } from 'vs/base/common/uri'; import { IStorageService } from 'vs/platform/storage/common/storage'; import { AsyncDataTree } from 'vs/base/browser/ui/tree/asyncDataTree'; import { AbstractTree } from 'vs/base/browser/ui/tree/abstractTree'; import { ViewPaneContainer } from 'vs/workbench/browser/parts/views/viewPaneContainer'; import { IContextMenuService } from 'vs/platform/contextview/browser/contextView'; import { IExtensionService } from 'vs/workbench/services/extensions/common/extensions'; import { IWorkspaceContextService } from 'vs/platform/workspace/common/workspace'; import { IConfigurationService } from 'vs/platform/configuration/common/configuration'; import { PaneComposite } from 'vs/workbench/browser/panecomposite'; import { Event } from 'vs/base/common/event'; export abstract class Viewlet extends PaneComposite implements IViewlet { constructor(id: string, viewPaneContainer: ViewPaneContainer, @ITelemetryService telemetryService: ITelemetryService, @IStorageService protected storageService: IStorageService, @IInstantiationService protected instantiationService: IInstantiationService, @IThemeService themeService: IThemeService, @IContextMenuService protected contextMenuService: IContextMenuService, @IExtensionService protected extensionService: IExtensionService, @IWorkspaceContextService protected contextService: IWorkspaceContextService, @IWorkbenchLayoutService protected layoutService: IWorkbenchLayoutService, @IConfigurationService protected configurationService: IConfigurationService ) { super(id, viewPaneContainer, telemetryService, storageService, instantiationService, themeService, contextMenuService, extensionService, contextService); this._register(Event.any(viewPaneContainer.onDidAddViews, viewPaneContainer.onDidRemoveViews, viewPaneContainer.onTitleAreaUpdate)(() => { // Update title area since there is no better way to update secondary actions this.updateTitleArea(); })); } getContextMenuActions(): IAction[] { const parentActions = [...super.getContextMenuActions()]; if (parentActions.length) { parentActions.push(new Separator()); } const toggleSidebarPositionAction = new ToggleSidebarPositionAction(ToggleSidebarPositionAction.ID, ToggleSidebarPositionAction.getLabel(this.layoutService), this.layoutService, this.configurationService); return [...parentActions, toggleSidebarPositionAction, <IAction>{ id: ToggleSidebarVisibilityAction.ID, label: nls.localize('compositePart.hideSideBarLabel', "Hide Side Bar"), enabled: true, run: () => this.layoutService.setSideBarHidden(true) }]; } getSecondaryActions(): IAction[] { const viewVisibilityActions = this.viewPaneContainer.getViewsVisibilityActions(); const secondaryActions = this.viewPaneContainer.getSecondaryActions(); if (viewVisibilityActions.length <= 1 || viewVisibilityActions.every(({ enabled }) => !enabled)) { return secondaryActions; } if (secondaryActions.length === 0) { return viewVisibilityActions; } return [ new SubmenuAction('workbench.views', nls.localize('views', "Views"), viewVisibilityActions), new Separator(), ...secondaryActions ]; } } /** * A viewlet descriptor is a leightweight descriptor of a viewlet in the workbench. */ export class ViewletDescriptor extends CompositeDescriptor<Viewlet> { static create<Services extends BrandedService[]>( ctor: { new(...services: Services): Viewlet }, id: string, name: string, cssClass?: string, order?: number, requestedIndex?: number, iconUrl?: URI ): ViewletDescriptor { return new ViewletDescriptor(ctor as IConstructorSignature0<Viewlet>, id, name, cssClass, order, requestedIndex, iconUrl); } private constructor( ctor: IConstructorSignature0<Viewlet>, id: string, name: string, cssClass?: string, order?: number, requestedIndex?: number, readonly iconUrl?: URI ) { super(ctor, id, name, cssClass, order, requestedIndex, id); } } export const Extensions = { Viewlets: 'workbench.contributions.viewlets' }; export class ViewletRegistry extends CompositeRegistry<Viewlet> { /** * Registers a viewlet to the platform. */ registerViewlet(descriptor: ViewletDescriptor): void { super.registerComposite(descriptor); } /** * Deregisters a viewlet to the platform. */ deregisterViewlet(id: string): void { super.deregisterComposite(id); } /** * Returns the viewlet descriptor for the given id or null if none. */ getViewlet(id: string): ViewletDescriptor { return this.getComposite(id) as ViewletDescriptor; } /** * Returns an array of registered viewlets known to the platform. */ getViewlets(): ViewletDescriptor[] { return this.getComposites() as ViewletDescriptor[]; } } Registry.add(Extensions.Viewlets, new ViewletRegistry()); /** * A reusable action to show a viewlet with a specific id. */ export class ShowViewletAction extends Action { constructor( id: string, name: string, private readonly viewletId: string, @IViewletService protected viewletService: IViewletService, @IEditorGroupsService private readonly editorGroupService: IEditorGroupsService, @IWorkbenchLayoutService private readonly layoutService: IWorkbenchLayoutService ) { super(id, name); } async run(): Promise<void> { // Pass focus to viewlet if not open or focused if (this.otherViewletShowing() || !this.sidebarHasFocus()) { await this.viewletService.openViewlet(this.viewletId, true); return; } // Otherwise pass focus to editor group this.editorGroupService.activeGroup.focus(); } private otherViewletShowing(): boolean { const activeViewlet = this.viewletService.getActiveViewlet(); return !activeViewlet || activeViewlet.getId() !== this.viewletId; } private sidebarHasFocus(): boolean { const activeViewlet = this.viewletService.getActiveViewlet(); const activeElement = document.activeElement; const sidebarPart = this.layoutService.getContainer(Parts.SIDEBAR_PART); return !!(activeViewlet && activeElement && sidebarPart && DOM.isAncestor(activeElement, sidebarPart)); } } export class CollapseAction extends Action { // We need a tree getter because the action is sometimes instantiated too early constructor(treeGetter: () => AsyncDataTree<any, any, any> | AbstractTree<any, any, any>, enabled: boolean, clazz?: string) { super('workbench.action.collapse', nls.localize('collapse', "Collapse All"), clazz, enabled, async () => { const tree = treeGetter(); tree.collapseAll(); }); } }
{ "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, Service 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.kepler.org.apache.commons.collections; import java.util.Iterator; /** * Defines an iterator that can be reset back to an initial state. * <p> * This interface allows an iterator to be repeatedly reused. * * @since Commons Collections 3.0 * @version $Revision: 646777 $ $Date: 2008-04-10 13:33:15 +0100 (Thu, 10 Apr 2008) $ * * @author Stephen Colebourne */ public interface ResettableIterator extends Iterator { /** * Resets the iterator back to the position at which the iterator * was created. */ public void reset(); }
{ "pile_set_name": "Github" }
{ "images" : [ { "idiom" : "universal", "scale" : "1x", "filename" : "start.png" }, { "idiom" : "universal", "scale" : "2x" }, { "idiom" : "universal", "scale" : "3x" } ], "info" : { "version" : 1, "author" : "xcode" } }
{ "pile_set_name": "Github" }
LIBRARY lfs.dll DESCRIPTION "LuaFileSystem" VERSION 1.2 EXPORTS luaopen_lfs
{ "pile_set_name": "Github" }
//===-- PThreadEvent.h ------------------------------------------*- C++ -*-===// // // Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions. // See https://llvm.org/LICENSE.txt for license information. // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception // //===----------------------------------------------------------------------===// // // Created by Greg Clayton on 6/16/07. // //===----------------------------------------------------------------------===// #ifndef __PThreadEvent_h__ #define __PThreadEvent_h__ #include "PThreadCondition.h" #include "PThreadMutex.h" #include <stdint.h> #include <time.h> class PThreadEvent { public: PThreadEvent(uint32_t bits = 0, uint32_t validBits = 0); ~PThreadEvent(); uint32_t NewEventBit(); void FreeEventBits(const uint32_t mask); void ReplaceEventBits(const uint32_t bits); uint32_t GetEventBits() const; void SetEvents(const uint32_t mask); void ResetEvents(const uint32_t mask); // Wait for events to be set or reset. These functions take an optional // timeout value. If timeout is NULL an infinite timeout will be used. uint32_t WaitForSetEvents(const uint32_t mask, const struct timespec *timeout_abstime = NULL) const; uint32_t WaitForEventsToReset(const uint32_t mask, const struct timespec *timeout_abstime = NULL) const; uint32_t GetResetAckMask() const { return m_reset_ack_mask; } uint32_t SetResetAckMask(uint32_t mask) { return m_reset_ack_mask = mask; } uint32_t WaitForResetAck(const uint32_t mask, const struct timespec *timeout_abstime = NULL) const; protected: // pthread condition and mutex variable to control access and allow // blocking between the main thread and the spotlight index thread. mutable PThreadMutex m_mutex; mutable PThreadCondition m_set_condition; mutable PThreadCondition m_reset_condition; uint32_t m_bits; uint32_t m_validBits; uint32_t m_reset_ack_mask; private: PThreadEvent(const PThreadEvent &) = delete; PThreadEvent &operator=(const PThreadEvent &rhs) = delete; }; #endif // #ifndef __PThreadEvent_h__
{ "pile_set_name": "Github" }
<!-- DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS HEADER. Copyright (c) 2010-2011 Oracle and/or its affiliates. All rights reserved. The contents of this file are subject to the terms of either the GNU General Public License Version 2 only ("GPL") or the Common Development and Distribution License("CDDL") (collectively, the "License"). You may not use this file except in compliance with the License. You can obtain a copy of the License at https://glassfish.dev.java.net/public/CDDL+GPL_1_1.html or packager/legal/LICENSE.txt. See the License for the specific language governing permissions and limitations under the License. When distributing the software, include this License Header Notice in each file and include the License file at packager/legal/LICENSE.txt. GPL Classpath Exception: Oracle designates this particular file as subject to the "Classpath" exception as provided by Oracle in the GPL Version 2 section of the License file that accompanied this code. Modifications: If applicable, add the following below the License Header, with the fields enclosed by brackets [] replaced by your own identifying information: "Portions Copyright [year] [name of copyright owner]" Contributor(s): If you wish your version of this file to be governed by only the CDDL or only the GPL Version 2, indicate your decision by adding "[Contributor] elects to include this software in this distribution under the [CDDL or GPL Version 2] license." If you don't indicate a single choice of license, a recipient has the option to distribute your version of this file under either the CDDL, the GPL Version 2 or to extend the choice of license to its licensees as provided above. However, if you add GPL Version 2 code and therefore, elected the GPL Version 2 license, then the option applies only if the new code is made subject to such option by the copyright holder. --> <!--Portions Copyright [2018-2020] [Payara Foundation and/or its affiliates]--> <domain log-root="${com.sun.aas.instanceRoot}/logs" application-root="${com.sun.aas.instanceRoot}/applications"> <applications> <web-module context-root="/web1" location="${com.sun.aas.installRoot}/lib/install/applications/adminapp/adminapp_war" directory-deployed="true" name="adminapp" object-type="system-admin"></web-module> <web-module context-root="" location="${com.sun.aas.installRoot}/lib/install/applications/admingui/adminGUI_war" directory-deployed="true" name="admingui" object-type="system-admin"></web-module> <web-module context-root="/__wstx-services" location="${com.sun.aas.installRoot}/lib/install/applications/wstx-services" directory-deployed="true" name="WSTXServices" object-type="system-all"></web-module> <lifecycle-module name="JBIFramework" object-type="system-all" class-name="com.sun.jbi.framework.sun.SunASJBIBootstrap" classpath="${com.sun.aas.installRoot}/jbi/lib/jbi_framework.jar"> <description>"JBI Framework LifecycleModule"</description> <property name="com.sun.jbi.home" value="${com.sun.aas.installRoot}/jbi"></property> <property name="com.sun.jbi.defaultLogLevel" value="INFO"></property> </lifecycle-module> <lifecycle-module name="WSTCPConnectorLCModule" object-type="system-all" class-name="com.sun.xml.ws.transport.tcp.server.glassfish.WSTCPLifeCycleModule" classpath="${com.sun.aas.installRoot}/lib/webservices-rt.jar"></lifecycle-module> </applications> <resources> <jdbc-resource pool-name="__TimerPool" jndi-name="jdbc/__TimerPool" object-type="system-admin"></jdbc-resource> <jdbc-resource pool-name="__CallFlowPool" jndi-name="jdbc/__CallFlowPool" object-type="system-all"></jdbc-resource> <jdbc-resource pool-name="H2Pool" jndi-name="jdbc/__default"></jdbc-resource> <jdbc-connection-pool datasource-classname="org.h2.jdbcx.JdbcDataSource" res-type="javax.sql.XADataSource" name="__CallFlowPool"> <property name="URL" value="jdbc:h2:${com.sun.aas.instanceRoot}/lib/databases/sun-callflow;AUTO_SERVER=TRUE" /> </jdbc-connection-pool> <jdbc-connection-pool name="__TimerPool" datasource-classname="org.h2.jdbcx.JdbcDataSource" res-type="javax.sql.XADataSource"> <property name="URL" value="jdbc:h2:${com.sun.aas.instanceRoot}/lib/databases/ejbtimer;AUTO_SERVER=TRUE" /> </jdbc-connection-pool> <jdbc-connection-pool is-isolation-level-guaranteed="false" name="H2Pool" datasource-classname="org.h2.jdbcx.JdbcDataSource" res-type="javax.sql.DataSource"> <property name="URL" value="jdbc:h2:${com.sun.aas.instanceRoot}/lib/databases/embedded_default;AUTO_SERVER=TRUE" /> </jdbc-connection-pool> </resources> <servers> <server name="server" config-ref="server-config"> <application-ref ref="adminapp" virtual-servers="__asadmin"></application-ref> <application-ref ref="admingui" virtual-servers="__asadmin"></application-ref> <application-ref ref="JBIFramework"></application-ref> <application-ref ref="WSTXServices"></application-ref> <application-ref ref="WSTCPConnectorLCModule"></application-ref> <resource-ref ref="jdbc/__TimerPool"></resource-ref> <resource-ref ref="jdbc/__CallFlowPool"></resource-ref> <resource-ref ref="jdbc/__default"></resource-ref> <resource-ref ref="jdbc/__derby"></resource-ref> </server> </servers> <configs> <config name="server-config"> <http-service> <access-log rotation-suffix="yyyy-MM-dd" rotation-interval-in-minutes="15"></access-log> <virtual-server id="server" network-listeners="http-listener-1,http-listener-2"></virtual-server> <virtual-server id="__asadmin" network-listeners="admin-listener"></virtual-server> </http-service> <admin-service system-jmx-connector-name="system" type="das-and-server"> <jmx-connector port="8686" address="0.0.0.0" security-enabled="false" name="system" auth-realm-name="admin-realm"></jmx-connector> <das-config dynamic-reload-enabled="true" deploy-xml-validation="full" autodeploy-dir="${com.sun.aas.instanceRoot}/autodeploy" autodeploy-enabled="true"></das-config> </admin-service> <web-container> <session-config> <session-manager> <manager-properties></manager-properties> <store-properties></store-properties> </session-manager> <session-properties></session-properties> </session-config> </web-container> <ejb-container max-pool-size="32" pool-resize-quantity="8" steady-pool-size="0" session-store="${com.sun.aas.instanceRoot}/session-store"> <ejb-timer-service></ejb-timer-service> </ejb-container> <mdb-container max-pool-size="32" pool-resize-quantity="8" steady-pool-size="0"></mdb-container> <security-service> <auth-realm classname="com.sun.enterprise.security.auth.realm.file.FileRealm" name="admin-realm"> <property name="file" value="${com.sun.aas.instanceRoot}/config/admin-keyfile"></property> <property name="jaas-context" value="fileRealm"></property> </auth-realm> <auth-realm classname="com.sun.enterprise.security.auth.realm.file.FileRealm" name="file"> <property name="file" value="${com.sun.aas.instanceRoot}/config/keyfile"></property> <property name="jaas-context" value="fileRealm"></property> </auth-realm> <auth-realm classname="com.sun.enterprise.security.auth.realm.certificate.CertificateRealm" name="certificate"></auth-realm> <jacc-provider policy-provider="com.sun.enterprise.security.provider.PolicyWrapper" name="default" policy-configuration-factory-provider="com.sun.enterprise.security.provider.PolicyConfigurationFactoryImpl"> <property name="repository" value="${com.sun.aas.instanceRoot}/generated/policy"></property> </jacc-provider> <audit-module classname="com.sun.enterprise.security.ee.Audit" name="default"> <property name="auditOn" value="false"></property> </audit-module> <message-security-config auth-layer="SOAP"> <provider-config provider-type="client" provider-id="XWS_ClientProvider" class-name="com.sun.xml.wss.provider.ClientSecurityAuthModule"> <request-policy auth-source="content"></request-policy> <response-policy auth-source="content"></response-policy> <property name="encryption.key.alias" value="s1as"></property> <property name="signature.key.alias" value="s1as"></property> <property name="dynamic.username.password" value="false"></property> <property name="debug" value="false"></property> </provider-config> <provider-config provider-type="client" provider-id="ClientProvider" class-name="com.sun.xml.wss.provider.ClientSecurityAuthModule"> <request-policy auth-source="content"></request-policy> <response-policy auth-source="content"></response-policy> <property name="encryption.key.alias" value="s1as"></property> <property name="signature.key.alias" value="s1as"></property> <property name="dynamic.username.password" value="false"></property> <property name="debug" value="false"></property> <property name="security.config" value="${com.sun.aas.instanceRoot}/config/wss-server-config-1.0.xml"></property> </provider-config> <provider-config provider-type="server" provider-id="XWS_ServerProvider" class-name="com.sun.xml.wss.provider.ServerSecurityAuthModule"> <request-policy auth-source="content"></request-policy> <response-policy auth-source="content"></response-policy> <property name="encryption.key.alias" value="s1as"></property> <property name="signature.key.alias" value="s1as"></property> <property name="debug" value="false"></property> </provider-config> <provider-config provider-type="server" provider-id="ServerProvider" class-name="com.sun.xml.wss.provider.ServerSecurityAuthModule"> <request-policy auth-source="content"></request-policy> <response-policy auth-source="content"></response-policy> <property name="encryption.key.alias" value="s1as"></property> <property name="signature.key.alias" value="s1as"></property> <property name="debug" value="false"></property> <property name="security.config" value="${com.sun.aas.instanceRoot}/config/wss-server-config-1.0.xml"></property> </provider-config> </message-security-config> </security-service> <monitoring-service> <module-monitoring-levels></module-monitoring-levels> </monitoring-service> <diagnostic-service></diagnostic-service> <java-config debug-options="-Xdebug -Xrunjdwp:transport=dt_socket,server=y,suspend=n,address=9009" system-classpath="${com.sun.aas.installRoot}/lib/appserv-launch.jar" classpath-suffix=""> <jvm-options>-client</jvm-options> <jvm-options>-XX:+UnlockDiagnosticVMOptions</jvm-options> <jvm-options>-XX:+LogVMOutput</jvm-options> <jvm-options>-XX:LogFile=${com.sun.aas.instanceRoot}/logs/jvm.log</jvm-options> <jvm-options>-Djava.endorsed.dirs=${com.sun.aas.installRoot}/lib/endorsed</jvm-options> <jvm-options>-Djava.security.policy=${com.sun.aas.instanceRoot}/config/server.policy</jvm-options> <jvm-options>-Djava.security.auth.login.config=${com.sun.aas.instanceRoot}/config/login.conf</jvm-options> <jvm-options>-Dsun.rmi.dgc.server.gcInterval=3600000</jvm-options> <jvm-options>-Dsun.rmi.dgc.client.gcInterval=3600000</jvm-options> <jvm-options>-Xmx512m</jvm-options> <jvm-options>-Djavax.net.ssl.keyStore=${com.sun.aas.instanceRoot}/config/keystore.jks</jvm-options> <jvm-options>-Djavax.net.ssl.trustStore=${com.sun.aas.instanceRoot}/config/cacerts.jks</jvm-options> <jvm-options>-Djava.ext.dirs=${com.sun.aas.javaRoot}/lib/ext${path.separator}${com.sun.aas.javaRoot}/jre/lib/ext${path.separator}${com.sun.aas.instanceRoot}/lib/ext${path.separator}${fish.payara.aas.h2Root}/bin</jvm-options> <jvm-options>-Djdbc.drivers=org.h2.Driver</jvm-options> <jvm-options>-Dcom.sun.enterprise.config.config_environment_factory_class=com.sun.enterprise.config.serverbeans.AppserverConfigEnvironmentFactory</jvm-options> <jvm-options>-XX:NewRatio=2</jvm-options> </java-config> <thread-pools> <thread-pool thread-pool-id="thread-pool-1"></thread-pool> </thread-pools> <network-config> <protocols> <protocol name="http-listener-1"> <http header-buffer-length="8192" forced-response-type="text/plain; charset=iso-8859-1" default-virtual-server="server" max-connections="250" server-name="" default-response-type="text/plain; charset=iso-8859-1"> <file-cache enabled="false"></file-cache> </http> </protocol> <protocol security-enabled="true" name="http-listener-2"> <http header-buffer-length="8192" forced-response-type="text/plain; charset=iso-8859-1" default-virtual-server="server" max-connections="250" server-name="" default-response-type="text/plain; charset=iso-8859-1"> <file-cache enabled="false"></file-cache> </http> </protocol> <protocol name="admin-listener"> <http header-buffer-length="8192" forced-response-type="text/plain; charset=iso-8859-1" default-virtual-server="__asadmin" max-connections="250" server-name="" default-response-type="text/plain; charset=iso-8859-1"> <file-cache enabled="false"></file-cache> </http> </protocol> </protocols> <network-listeners> <thread-pool max-thread-pool-size="20" min-thread-pool-size="2" thread-pool-id="http-thread-pool" max-queue-size="4096"></thread-pool> <network-listener port="8080" protocol="http-listener-1" transport="tcp" name="http-listener-1" thread-pool="http-thread-pool"></network-listener> <network-listener port="8181" protocol="http-listener-2" transport="tcp" name="http-listener-2" thread-pool="http-thread-pool"></network-listener> <network-listener port="4848" protocol="admin-listener" transport="tcp" name="admin-listener" thread-pool="http-thread-pool"></network-listener> </network-listeners> <transports> <transport name="tcp"></transport> </transports> </network-config> </config> </configs> <property name="administrative.domain.name" value="domain1"></property> </domain>
{ "pile_set_name": "Github" }
package restx.http; import org.junit.Test; import org.junit.runner.RunWith; import org.junit.runners.Parameterized; import restx.http.HTTP; import java.util.Arrays; import static org.hamcrest.CoreMatchers.equalTo; import static org.hamcrest.CoreMatchers.is; import static org.junit.Assert.assertThat; /** * @author fcamblor */ @RunWith(Parameterized.class) public class HeaderTokenCompatibleWithRfc2616Test { private final String str; private final String expectedResult; @Parameterized.Parameters(name="{0}") public static Iterable<Object[]> data(){ return Arrays.asList(new Object[][]{ {"foo", String.format("foo")}, // Most of the cases // Cases to apply to rfc-2616 header tokens (p16 on http://www.ietf.org/rfc/rfc2616.txt) {"foo bar", "foo_bar"}, {"foo(bar", "foo_bar"}, {"foo)bar", "foo_bar"}, {"foo<bar", "foo_bar"}, {"foo>bar", "foo_bar"}, {"foo@bar", "foo_bar"}, {"foo,bar", "foo_bar"}, {"foo;bar", "foo_bar"}, {"foo:bar", "foo_bar"}, {"foo\\bar", "foo_bar"}, {"foo\"bar", "foo_bar"}, {"foo/bar", "foo_bar"}, {"foo[bar", "foo_bar"}, {"foo]bar", "foo_bar"}, {"foo?bar", "foo_bar"}, {"foo=bar", "foo_bar"}, {"foo{bar", "foo_bar"}, {"foo}bar", "foo_bar"} }); } public HeaderTokenCompatibleWithRfc2616Test(String str, String expectedResult) { this.str = str; this.expectedResult = expectedResult; } @Test public void should_given_string_be_correctly_converted_to_rfc2616_compatible_token(){ assertThat(HTTP.headerTokenCompatible(this.str, "_"), is(equalTo(this.expectedResult))); } }
{ "pile_set_name": "Github" }
{ "nbformat": 4, "nbformat_minor": 2, "metadata": { "language_info": { "name": "python", "codemirror_mode": { "name": "ipython", "version": 3 }, "version": "3.6.6-final" }, "orig_nbformat": 2, "file_extension": ".py", "mimetype": "text/x-python", "name": "python", "npconvert_exporter": "python", "pygments_lexer": "ipython3", "version": 3, "kernelspec": { "name": "python36664bitea6884f10f474b21a2a2f022451e0d09", "display_name": "Python 3.6.6 64-bit" } }, "cells": [ { "cell_type": "code", "execution_count": 3, "metadata": {}, "outputs": [], "source": [ "from tqdm import tqdm\n", "from tensorflow.keras.preprocessing.sequence import pad_sequences\n", "from tensorflow.keras.layers import Dense, Dropout, LSTM, Embedding, Bidirectional\n", "from tensorflow.keras.models import Sequential\n", "from tensorflow.keras.preprocessing.text import Tokenizer\n", "from tensorflow.keras.preprocessing.sequence import pad_sequences\n", "from tensorflow.keras.utils import to_categorical\n", "from sklearn.model_selection import train_test_split\n", "from sklearn.datasets import fetch_20newsgroups\n", "import numpy as np\n", "\n", "from glob import glob\n", "import random\n", "import os" ] }, { "cell_type": "code", "execution_count": 4, "metadata": {}, "outputs": [], "source": [ "def get_embedding_vectors(word_index, dim=100):\n", " embedding_matrix = np.zeros((len(word_index) + 1, dim))\n", " with open(f\"data/glove.6B.{dim}d.txt\", encoding=\"utf8\") as f:\n", " for line in tqdm(f, \"Reading GloVe\"):\n", " values = line.split()\n", " # get the word as the first word in the line\n", " word = values[0]\n", " if word in word_index:\n", " idx = word_index[word]\n", " # get the vectors as the remaining values in the line\n", " embedding_matrix[idx] = np.array(values[1:], dtype=\"float32\")\n", "\n", " return embedding_matrix\n", "\n", "\n", "def create_model(word_index, units=128, n_layers=2, cell=LSTM, bidirectional=False,\n", " embedding_size=100, sequence_length=100, dropout=0.3, \n", " loss=\"categorical_crossentropy\", optimizer=\"adam\", \n", " output_length=2):\n", " \"\"\"\n", " Constructs a RNN model given its parameters\n", " \"\"\"\n", " embedding_matrix = get_embedding_vectors(word_index, embedding_size)\n", " model = Sequential()\n", " # add the embedding layer\n", " model.add(Embedding(len(word_index) + 1,\n", " embedding_size,\n", " weights=[embedding_matrix],\n", " trainable=False,\n", " input_length=sequence_length))\n", "\n", " for i in range(n_layers):\n", " if i == n_layers - 1:\n", " # last layer\n", " if bidirectional:\n", " model.add(Bidirectional(cell(units, return_sequences=False)))\n", " else:\n", " model.add(cell(units, return_sequences=False))\n", " else:\n", " # first layer or hidden layers\n", " if bidirectional:\n", " model.add(Bidirectional(cell(units, return_sequences=True)))\n", " else:\n", " model.add(cell(units, return_sequences=True))\n", " model.add(Dropout(dropout))\n", "\n", " model.add(Dense(output_length, activation=\"softmax\"))\n", " # compile the model\n", " model.compile(optimizer=optimizer, loss=loss, metrics=[\"accuracy\"])\n", " return model\n", "\n", "\n", "\n", "def save_imdb_data():\n", "\n", " pos_training_files = glob(\"data/aclImdb/train/pos/*.txt\")\n", " neg_training_files = glob(\"data/aclImdb/train/neg/*.txt\")\n", " pos_testing_files = glob(\"data/aclImdb/test/pos/*.txt\")\n", " neg_testing_files = glob(\"data/aclImdb/test/neg/*.txt\")\n", "\n", " print(\"total pos training files:\", len(pos_training_files))\n", " print(\"total neg training files:\", len(neg_training_files))\n", " print(\"total pos testing files:\", len(pos_testing_files))\n", " print(\"total neg testing files:\", len(neg_testing_files))\n", "\n", " # load the data, 0 for negative sentiment, 1 for positive sentiment\n", " data = []\n", " for file in tqdm(pos_training_files, \"Loading positive training data\"):\n", " data.append((open(file).read().strip(), 1))\n", " \n", " for file in tqdm(neg_training_files, \"Loading negative training data\"):\n", " data.append((open(file).read().strip(), 0))\n", "\n", " for file in tqdm(pos_testing_files, \"Loading positive testing data\"):\n", " data.append((open(file).read().strip(), 1))\n", "\n", " for file in tqdm(neg_testing_files, \"Loading negative testing data\"):\n", " data.append((open(file).read().strip(), 0))\n", "\n", " # shuffle the data\n", " random.shuffle(data)\n", " with open(\"data/reviews.txt\", \"w\") as reviews_file:\n", " with open(\"data/labels.txt\", \"w\") as labels_file:\n", " for review, label in tqdm(data, \"Writing data to files\"):\n", " print(review, file=reviews_file)\n", " print(label, file=labels_file)\n", "\n", " \n", "def load_imdb_data(num_words, sequence_length, test_size=0.25, oov_token=None):\n", " # read reviews\n", " reviews = []\n", " with open(\"data/reviews.txt\") as f:\n", " for review in f:\n", " review = review.strip()\n", " reviews.append(review)\n", "\n", " labels = []\n", " with open(\"data/labels.txt\") as f:\n", " for label in f:\n", " label = label.strip()\n", " labels.append(label)\n", "\n", "\n", " tokenizer = Tokenizer(num_words=num_words, oov_token=oov_token)\n", " tokenizer.fit_on_texts(reviews)\n", " X = tokenizer.texts_to_sequences(reviews)\n", " \n", " X, y = np.array(X), np.array(labels)\n", "\n", " # pad sequences with 0's\n", " X = pad_sequences(X, maxlen=sequence_length)\n", "\n", " # convert labels to one-hot encoded\n", " y = to_categorical(y)\n", "\n", " # split data to training and testing sets\n", " X_train, X_test, y_train, y_test = train_test_split(X, y, test_size=test_size, random_state=1)\n", "\n", " data = {}\n", "\n", " data[\"X_train\"] = X_train\n", " data[\"X_test\"]= X_test\n", " data[\"y_train\"] = y_train\n", " data[\"y_test\"] = y_test\n", " data[\"tokenizer\"] = tokenizer\n", " data[\"int2label\"] = {0: \"negative\", 1: \"positive\"}\n", " data[\"label2int\"] = {\"negative\": 0, \"positive\": 1}\n", " \n", " return data\n", "\n", "\n", "def load_20_newsgroup_data(num_words, sequence_length, test_size=0.25, oov_token=None):\n", " # load the 20 news groups dataset\n", " # shuffling the data & removing each document's header, signature blocks and quotation blocks\n", " dataset = fetch_20newsgroups(subset=\"all\", shuffle=True, remove=(\"headers\", \"footers\", \"quotes\"))\n", " documents = dataset.data\n", " labels = dataset.target\n", "\n", " tokenizer = Tokenizer(num_words=num_words, oov_token=oov_token)\n", " tokenizer.fit_on_texts(documents)\n", " X = tokenizer.texts_to_sequences(documents)\n", " \n", " X, y = np.array(X), np.array(labels)\n", "\n", " # pad sequences with 0's\n", " X = pad_sequences(X, maxlen=sequence_length)\n", "\n", " # convert labels to one-hot encoded\n", " y = to_categorical(y)\n", "\n", " # split data to training and testing sets\n", " X_train, X_test, y_train, y_test = train_test_split(X, y, test_size=test_size, random_state=1)\n", "\n", " data = {}\n", "\n", " data[\"X_train\"] = X_train\n", " data[\"X_test\"]= X_test\n", " data[\"y_train\"] = y_train\n", " data[\"y_test\"] = y_test\n", " data[\"tokenizer\"] = tokenizer\n", "\n", " data[\"int2label\"] = { i: label for i, label in enumerate(dataset.target_names) }\n", " data[\"label2int\"] = { label: i for i, label in enumerate(dataset.target_names) }\n", " \n", " return data\n", "\n", "\n" ] }, { "cell_type": "code", "execution_count": 6, "metadata": {}, "outputs": [], "source": [ "# max number of words in each sentence\n", "SEQUENCE_LENGTH = 300\n", "# N-Dimensional GloVe embedding vectors\n", "# using 100 here, feel free to use 200 or 300\n", "EMBEDDING_SIZE = 300\n", "# number of words to use, discarding the rest\n", "N_WORDS = 10000\n", "# out of vocabulary token\n", "OOV_TOKEN = None\n", "# 30% testing set, 70% training set\n", "TEST_SIZE = 0.3\n", "# number of CELL layers\n", "N_LAYERS = 1\n", "# the RNN cell to use, LSTM in this case\n", "RNN_CELL = LSTM\n", "# whether it's a bidirectional RNN\n", "IS_BIDIRECTIONAL = False\n", "# number of units (RNN_CELL ,nodes) in each layer\n", "UNITS = 128\n", "# dropout rate\n", "DROPOUT = 0.4\n", "### Training parameters\n", "LOSS = \"categorical_crossentropy\"\n", "OPTIMIZER = \"adam\"\n", "BATCH_SIZE = 64\n", "EPOCHS = 6\n", "\n", "def get_model_name(dataset_name):\n", " # construct the unique model name\n", " model_name = f\"{dataset_name}-{RNN_CELL.__name__}-seq-{SEQUENCE_LENGTH}-em-{EMBEDDING_SIZE}-w-{N_WORDS}-layers-{N_LAYERS}-units-{UNITS}-opt-{OPTIMIZER}-BS-{BATCH_SIZE}-d-{DROPOUT}\"\n", " if IS_BIDIRECTIONAL:\n", " # add 'bid' str if bidirectional\n", " model_name = \"bid-\" + model_name\n", " if OOV_TOKEN:\n", " # add 'oov' str if OOV token is specified\n", " model_name += \"-oov\"\n", " return model_name" ] }, { "cell_type": "code", "execution_count": 7, "metadata": {}, "outputs": [ { "name": "stderr", "output_type": "stream", "text": "Reading GloVe: 400000it [00:17, 23047.55it/s]\nModel: \"sequential\"\n_________________________________________________________________\nLayer (type) Output Shape Param # \n=================================================================\nembedding (Embedding) (None, 300, 300) 37267200 \n_________________________________________________________________\nlstm (LSTM) (None, 128) 219648 \n_________________________________________________________________\ndropout (Dropout) (None, 128) 0 \n_________________________________________________________________\ndense (Dense) (None, 2) 258 \n=================================================================\nTotal params: 37,487,106\nTrainable params: 219,906\nNon-trainable params: 37,267,200\n_________________________________________________________________\nTrain on 35000 samples, validate on 15000 samples\nEpoch 1/6\n35000/35000 [==============================] - 186s 5ms/sample - loss: 0.4359 - accuracy: 0.7919 - val_loss: 0.2912 - val_accuracy: 0.8788\nEpoch 2/6\n35000/35000 [==============================] - 179s 5ms/sample - loss: 0.2857 - accuracy: 0.8820 - val_loss: 0.2608 - val_accuracy: 0.8919\nEpoch 3/6\n35000/35000 [==============================] - 175s 5ms/sample - loss: 0.2501 - accuracy: 0.8985 - val_loss: 0.2472 - val_accuracy: 0.8977\nEpoch 4/6\n35000/35000 [==============================] - 174s 5ms/sample - loss: 0.2184 - accuracy: 0.9129 - val_loss: 0.2525 - val_accuracy: 0.8997\nEpoch 5/6\n35000/35000 [==============================] - 185s 5ms/sample - loss: 0.1918 - accuracy: 0.9246 - val_loss: 0.2576 - val_accuracy: 0.9035\nEpoch 6/6\n35000/35000 [==============================] - 188s 5ms/sample - loss: 0.1598 - accuracy: 0.9391 - val_loss: 0.2494 - val_accuracy: 0.9004\n" } ], "source": [ "from tensorflow.keras.callbacks import TensorBoard, ModelCheckpoint\n", "\n", "import os\n", "import pickle\n", "\n", "# create these folders if they does not exist\n", "if not os.path.isdir(\"results\"):\n", " os.mkdir(\"results\")\n", "\n", "if not os.path.isdir(\"logs\"):\n", " os.mkdir(\"logs\")\n", "\n", "if not os.path.isdir(\"data\"):\n", " os.mkdir(\"data\")\n", "\n", "# load the data\n", "data = load_imdb_data(N_WORDS, SEQUENCE_LENGTH, TEST_SIZE, oov_token=OOV_TOKEN)\n", "# data = load_20_newsgroup_data(N_WORDS, SEQUENCE_LENGTH, TEST_SIZE, oov_token=OOV_TOKEN)\n", "\n", "# save the tokenizer object to use later in testing\n", "# pickle.dump(data[\"tokenizer\"], open(f\"results/{model_name}_tokenizer.pickle\", \"wb\"))\n", "\n", "model = create_model(data[\"tokenizer\"].word_index, units=UNITS, n_layers=N_LAYERS, \n", " cell=RNN_CELL, bidirectional=IS_BIDIRECTIONAL, embedding_size=EMBEDDING_SIZE, \n", " sequence_length=SEQUENCE_LENGTH, dropout=DROPOUT, \n", " loss=LOSS, optimizer=OPTIMIZER, output_length=data[\"y_train\"][0].shape[0])\n", "\n", "# checkpointer = ModelCheckpoint(os.path.join(\"results\", model_name), \n", "# save_weights_only=True, save_best_only=True, \n", "# verbose=1)\n", "model.summary()\n", "\n", "tensorboard = TensorBoard(log_dir=os.path.join(\"logs\", model_name))\n", "\n", "history = model.fit(data[\"X_train\"], data[\"y_train\"],\n", " batch_size=BATCH_SIZE,\n", " epochs=EPOCHS,\n", " validation_data=(data[\"X_test\"], data[\"y_test\"]),\n", " # callbacks=[checkpointer, tensorboard],\n", " callbacks=[tensorboard],\n", " verbose=1)\n", "\n", "\n", "model.save(os.path.join(\"results\", model_name) + \".h5\")" ] }, { "cell_type": "code", "execution_count": 16, "metadata": {}, "outputs": [], "source": [ "def get_predictions(text):\n", " sequence = data[\"tokenizer\"].texts_to_sequences([text])\n", " # pad the sequences\n", " sequence = pad_sequences(sequence, maxlen=SEQUENCE_LENGTH)\n", " # get the prediction\n", " prediction = model.predict(sequence)[0]\n", " return prediction, data[\"int2label\"][np.argmax(prediction)]" ] }, { "cell_type": "code", "execution_count": 20, "metadata": {}, "outputs": [ { "name": "stdout", "output_type": "stream", "text": "==================================================\nOutput vector: [0.38528103 0.61471903]\nPrediction: positive\n" } ], "source": [ "text = \"Not very good, but pretty good try.\"\n", "output_vector, prediction = get_predictions(text)\n", "print(\"=\"*50)\n", "print(\"Output vector:\", output_vector)\n", "print(\"Prediction:\", prediction)" ] }, { "cell_type": "code", "execution_count": null, "metadata": {}, "outputs": [], "source": [] } ] }
{ "pile_set_name": "Github" }
import shortId from "shortid"; import { locales } from "./I18NLocales"; import contentModelGroup from "./contentModelGroup"; export default [ { name: "Category", description: "Product category", modelId: "category", group: contentModelGroup.id, indexes: [{ fields: ["id"] }, { fields: ["title", "slug"] }, { fields: ["slug"] }], getUniqueIndexFields() { return ["id", "title", "slug"]; }, fields: [ { _id: shortId.generate(), label: { values: [{ locale: locales.en.id, value: "Title" }] }, type: "text", fieldId: "title", validation: [ { name: "required", message: { values: [{ locale: locales.en.id, value: "This field is required" }] } }, { name: "minLength", message: { values: [ { locale: locales.en.id, value: "Enter at least 3 characters" } ] }, settings: { min: 3.0 } } ] }, { _id: shortId.generate(), label: { values: [{ locale: locales.en.id, value: "Slug" }] }, type: "text", fieldId: "slug", validation: [ { name: "required", message: { values: [{ locale: locales.en.id, value: "This field is required" }] } } ] } ] }, { name: "Product", modelId: "product", description: "Products being sold in our webshop", group: contentModelGroup.id, indexes: [{ fields: ["id"] }], getUniqueIndexFields() { return ["id"]; }, fields: [ { _id: shortId.generate(), label: { values: [{ locale: locales.en.id, value: "Title" }] }, fieldId: "title", type: "text", validation: [ { name: "required", message: { values: [ { locale: locales.en.id, value: "Please enter a product name" } ] } } ] }, { _id: shortId.generate(), label: { values: [{ locale: locales.en.id, value: "Category" }] }, fieldId: "category", type: "ref", validation: [ { name: "required", message: { values: [{ locale: locales.en.id, value: "Please select a category" }] } } ], settings: { type: "one", modelId: "category" } }, { _id: shortId.generate(), label: { values: [{ locale: locales.en.id, value: "Price" }] }, fieldId: "price", type: "number", validation: [ { name: "required", message: { values: [{ locale: locales.en.id, value: "Please enter a price" }] } } ] }, { _id: shortId.generate(), label: { values: [{ locale: locales.en.id, value: "Price" }] }, fieldId: "inStock", type: "boolean", validation: [] }, { _id: shortId.generate(), label: { values: [{ locale: locales.en.id, value: "Price" }] }, fieldId: "itemsInStock", type: "number", validation: [] }, { _id: shortId.generate(), label: { values: [{ locale: locales.en.id, value: "Available on" }] }, fieldId: "availableOn", type: "datetime", settings: { type: "date" }, validation: [ { name: "required", message: { values: [{ locale: locales.en.id, value: "Please enter a date" }] } } ] } ] }, { name: "Review", description: "Product review", modelId: "review", group: contentModelGroup.id, indexes: [{ fields: ["id"] }], getUniqueIndexFields() { return ["id"]; }, fields: [ { _id: shortId.generate(), label: { values: [{ locale: locales.en.id, value: "Text" }] }, type: "text", fieldId: "text", validation: [ { name: "required", message: { values: [{ locale: locales.en.id, value: "This field is required" }] } } ] }, { _id: shortId.generate(), label: { values: [{ locale: locales.en.id, value: "Product" }] }, type: "ref", fieldId: "product", validation: [], settings: { type: "one", modelId: "product" } }, { _id: shortId.generate(), label: { values: [{ locale: locales.en.id, value: "Rating" }] }, type: "number", fieldId: "rating", validation: [] } ] } ];
{ "pile_set_name": "Github" }
StartChar: uni04F9 Encoding: 1273 1273 951 Width: 1060 Flags: W HStem: -10 151<225.367 492.594> 488 149<232.333 477.482> 1000 20G<68 228.5 813.941 971> 1182.9 225<198.5 433.5 604.5 839.5> VStem: 69 160<145.032 478 624 1020> 198.5 235<1182.9 1404.9> 542 159<192.534 424.396> 604.5 235<1179.9 1401.9> 811 159<0 1020> LayerCount: 2 Back Refer: 173 168 N 1 0 0 1 -8 -39 2 Refer: 811 1099 N 1 0 0 1 0 0 3 Fore Refer: 173 168 N 1 0 0 1 59.5 92.9 2 Refer: 811 1099 S 1 0 0 1 0 0 3 Validated: 1 EndChar
{ "pile_set_name": "Github" }
-- _________ __ __ -- / _____// |_____________ _/ |______ ____ __ __ ______ -- \_____ \\ __\_ __ \__ \\ __\__ \ / ___\| | \/ ___/ -- / \| | | | \// __ \| | / __ \_/ /_/ > | /\___ \ -- /_______ /|__| |__| (____ /__| (____ /\___ /|____//____ > -- \/ \/ \//_____/ \/ -- ______________________ ______________________ -- T H E W A R B E G I N S -- Stratagus - A free fantasy real time strategy game engine -- -- (c) Copyright 2016-2020 by Andrettin -- -- This program is free software; you can redistribute it and/or modify -- it under the terms of the GNU General Public License as published by -- the Free Software Foundation; either version 2 of the License, or -- (at your option) any later version. -- -- This program is distributed in the hope that it will be useful, -- but WITHOUT ANY WARRANTY; without even the implied warranty of -- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -- GNU General Public License for more details. -- -- You should have received a copy of the GNU General Public License -- along with this program; if not, write to the Free Software -- Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA -- DefineProvince("Algeria", { World = "earth", Claims = { "persian", "gaetuli-tribe", "persian", "mauri-tribe", "persian", "musulamii-tribe" }, HistoricalOwners = { 161, "persian", "gaetuli-tribe", -- South-central Algeria was inhabited by the Gaetuli in 161-180 AD; Source: "Ancient Warfare VII.6", 2013, p. 7. 161, "persian", "musulamii-tribe", -- Southeastern Algeria was inhabited by the Musulamii in 161-180 AD; Source: "Ancient Warfare VII.6", 2013, p. 7. 161, "persian", "mauri-tribe" -- Southwestern Algeria was inhabited by the Mauri in 161-180 AD; Source: "Ancient Warfare VII.6", 2013, p. 7. }, HistoricalSettlementBuildings = { 161, "unit-latin-barracks", true -- Legionary base present in Lambaesis in 161-180 AD; Source: "Ancient Warfare VII.6", 2013, p. 7. }, Regions = {"africa"} }) DefineProvince("Egypt", { World = "earth", HistoricalSettlementBuildings = { 161, "unit-latin-barracks", true -- Legionary base present in Alexandria in 161-180 AD; Source: "Ancient Warfare VII.6", 2013, p. 7. }, Regions = {"africa"} }) DefineProvince("Libya", { World = "earth", Claims = { "persian", "garamantes-tribe" }, HistoricalOwners = { 161, "persian", "garamantes-tribe" -- Inland western Libya was inhabited by the Garamantes in 161-180 AD; Source: "Ancient Warfare VII.6", 2013, p. 7. }, Regions = {"africa"} }) DefineProvince("Morocco", { World = "earth", Claims = { "persian", "mauri-tribe" }, HistoricalOwners = { 161, "persian", "mauri-tribe" -- Southern Morocco was inhabited by the Mauri in 161-180 AD; Source: "Ancient Warfare VII.6", 2013, p. 7. }, Regions = {"africa"} }) DefineProvince("Oyo", { World = "earth", HistoricalModifiers = { 1947, "upgrade-university", true -- University founded in Ibadan in 1947. Source: David Thomson, "Europe Since Napoleon", 1966, p. 863. }, Regions = {"africa"} }) DefineProvince("Tunisia", { World = "earth", Regions = {"africa"} }) -- The parts of Africa inhabited by black peoples were known as "Great Blueland" or "Blaland" to the Norse; Source: Snorri Sturlson, "Heimskringla", 1844, vol. 1, p. 216.
{ "pile_set_name": "Github" }
package ONVIF::Device::Types::IntRange; use strict; use warnings; __PACKAGE__->_set_element_form_qualified(1); sub get_xmlns { 'http://www.onvif.org/ver10/schema' }; our $XML_ATTRIBUTE_CLASS; undef $XML_ATTRIBUTE_CLASS; sub __get_attr_class { return $XML_ATTRIBUTE_CLASS; } use Class::Std::Fast::Storable constructor => 'none'; use base qw(SOAP::WSDL::XSD::Typelib::ComplexType); Class::Std::initialize(); { # BLOCK to scope variables my %Min_of :ATTR(:get<Min>); my %Max_of :ATTR(:get<Max>); __PACKAGE__->_factory( [ qw( Min Max ) ], { 'Min' => \%Min_of, 'Max' => \%Max_of, }, { 'Min' => 'SOAP::WSDL::XSD::Typelib::Builtin::int', 'Max' => 'SOAP::WSDL::XSD::Typelib::Builtin::int', }, { 'Min' => 'Min', 'Max' => 'Max', } ); } # end BLOCK 1; =pod =head1 NAME ONVIF::Device::Types::IntRange =head1 DESCRIPTION Perl data type class for the XML Schema defined complexType IntRange from the namespace http://www.onvif.org/ver10/schema. Range of values greater equal Min value and less equal Max value. =head2 PROPERTIES The following properties may be accessed using get_PROPERTY / set_PROPERTY methods: =over =item * Min =item * Max =back =head1 METHODS =head2 new Constructor. The following data structure may be passed to new(): { # ONVIF::Device::Types::IntRange Min => $some_value, # int Max => $some_value, # int }, =head1 AUTHOR Generated by SOAP::WSDL =cut
{ "pile_set_name": "Github" }
// SPDX-License-Identifier: LGPL-2.1+ /* * Copyright (C) 2018 Red Hat, Inc. */ #include "nm-default.h" #include "nm-keep-alive.h" #include "settings/nm-settings-connection.h" #include "nm-glib-aux/nm-dbus-aux.h" /*****************************************************************************/ NM_GOBJECT_PROPERTIES_DEFINE (NMKeepAlive, PROP_ALIVE, ); typedef struct { GObject *owner; NMSettingsConnection *connection; GDBusConnection *dbus_connection; char *dbus_client; GCancellable *dbus_client_confirm_cancellable; guint subscription_id; bool armed:1; bool disarmed:1; bool alive:1; bool dbus_client_confirmed:1; bool dbus_client_watching:1; bool connection_was_visible:1; } NMKeepAlivePrivate; struct _NMKeepAlive { GObject parent; NMKeepAlivePrivate _priv; }; struct _NMKeepAliveClass { GObjectClass parent; }; G_DEFINE_TYPE (NMKeepAlive, nm_keep_alive, G_TYPE_OBJECT) #define NM_KEEP_ALIVE_GET_PRIVATE(self) _NM_GET_PRIVATE (self, NMKeepAlive, NM_IS_KEEP_ALIVE) /*****************************************************************************/ #define _NMLOG_DOMAIN LOGD_CORE #define _NMLOG(level, ...) __NMLOG_DEFAULT (level, _NMLOG_DOMAIN, "keep-alive", __VA_ARGS__) /*****************************************************************************/ static gboolean _is_alive_dbus_client (NMKeepAlive *self); static void cleanup_dbus_watch (NMKeepAlive *self); /*****************************************************************************/ static gboolean _is_alive (NMKeepAlive *self) { NMKeepAlivePrivate *priv = NM_KEEP_ALIVE_GET_PRIVATE (self); nm_assert (!priv->disarmed); if (!priv->armed) { /* before arming, the instance is always alive. */ return TRUE; } if (priv->dbus_client_watching) { if (_is_alive_dbus_client (self)) { /* no matter what, the keep-alive is alive, because there is a D-Bus client * still around keeping it alive. */ return TRUE; } /* the D-Bus client is gone. The only other binding (below) for the connection's * visibility cannot keep the instance alive. * * As such, a D-Bus client watch is authoritative and overrules other conditions (that * we have so far). */ return FALSE; } if ( priv->connection && priv->connection_was_visible && !NM_FLAGS_HAS (nm_settings_connection_get_flags (priv->connection), NM_SETTINGS_CONNECTION_INT_FLAGS_VISIBLE)) { /* note that we only declare the keep-alive as dead due to invisible * connection, if * (1) we monitor a connection, obviously * (2) the connection was visible earlier and is no longer. It was * was invisible all the time, it does not suffice. */ return FALSE; } /* by default, the instance is alive. */ return TRUE; } static void _notify_alive (NMKeepAlive *self) { NMKeepAlivePrivate *priv = NM_KEEP_ALIVE_GET_PRIVATE (self); if (priv->disarmed) { /* once disarmed, the alive state is frozen. */ return; } if (priv->alive == _is_alive (self)) return; priv->alive = !priv->alive; _LOGD ("instance is now %s", priv->alive ? "alive" : "dead"); _notify (self, PROP_ALIVE); } gboolean nm_keep_alive_is_alive (NMKeepAlive *self) { return NM_KEEP_ALIVE_GET_PRIVATE (self)->alive; } /*****************************************************************************/ static void connection_flags_changed (NMSettingsConnection *connection, NMKeepAlive *self) { NMKeepAlivePrivate *priv = NM_KEEP_ALIVE_GET_PRIVATE (self); if ( !priv->connection_was_visible && NM_FLAGS_HAS (nm_settings_connection_get_flags (priv->connection), NM_SETTINGS_CONNECTION_INT_FLAGS_VISIBLE)) { /* the profile was never visible but now it becomes visible. * Remember that. * * Before this happens (that is, if the device was invisible all along), * the keep alive instance is considered alive (w.r.t. watching the connection). * * The reason is to allow a user to manually activate an invisible profile and keep * it alive. At least, as long until the user logs out the first time (which is the * first time, the profiles changes from visible to invisible). * * Yes, that is odd. How to improve? */ priv->connection_was_visible = TRUE; } _notify_alive (self); } static void _set_settings_connection_watch_visible (NMKeepAlive *self, NMSettingsConnection *connection, gboolean emit_signal) { NMKeepAlivePrivate *priv = NM_KEEP_ALIVE_GET_PRIVATE (self); gs_unref_object NMSettingsConnection *old_connection = NULL; if (priv->connection == connection) return; if (priv->connection) { g_signal_handlers_disconnect_by_func (priv->connection, G_CALLBACK (connection_flags_changed), self); old_connection = g_steal_pointer (&priv->connection); } if ( connection && !priv->disarmed) { priv->connection = g_object_ref (connection); priv->connection_was_visible = NM_FLAGS_HAS (nm_settings_connection_get_flags (priv->connection), NM_SETTINGS_CONNECTION_INT_FLAGS_VISIBLE); g_signal_connect (priv->connection, NM_SETTINGS_CONNECTION_FLAGS_CHANGED, G_CALLBACK (connection_flags_changed), self); } if (emit_signal) _notify_alive (self); } void nm_keep_alive_set_settings_connection_watch_visible (NMKeepAlive *self, NMSettingsConnection *connection) { _set_settings_connection_watch_visible (self, connection, TRUE); } /*****************************************************************************/ static void get_name_owner_cb (const char *name_owner, GError *error, gpointer user_data) { NMKeepAlive *self; NMKeepAlivePrivate *priv; if ( !name_owner && g_error_matches (error, G_IO_ERROR, G_IO_ERROR_CANCELLED)) return; self = user_data; priv = NM_KEEP_ALIVE_GET_PRIVATE (self); if ( name_owner && nm_streq (name_owner, priv->dbus_client)) { /* all good, the name is confirmed. */ return; } _LOGD ("DBus client for keep alive is not on the bus"); cleanup_dbus_watch (self); _notify_alive (self); } static gboolean _is_alive_dbus_client (NMKeepAlive *self) { NMKeepAlivePrivate *priv = NM_KEEP_ALIVE_GET_PRIVATE (self); if (!priv->dbus_client) return FALSE; if (!priv->dbus_client_confirmed) { /* it's unconfirmed that the D-Bus client is really alive. * It looks like it is, but as we are claiming that to be * the case, issue an async GetNameOwner call to make sure. */ priv->dbus_client_confirmed = TRUE; priv->dbus_client_confirm_cancellable = g_cancellable_new (); nm_dbus_connection_call_get_name_owner (priv->dbus_connection, priv->dbus_client, -1, priv->dbus_client_confirm_cancellable, get_name_owner_cb, self); } return TRUE; } static void cleanup_dbus_watch (NMKeepAlive *self) { NMKeepAlivePrivate *priv = NM_KEEP_ALIVE_GET_PRIVATE (self); if (!priv->dbus_client) return; _LOGD ("Cleanup DBus client watch"); nm_clear_g_cancellable (&priv->dbus_client_confirm_cancellable); nm_clear_g_free (&priv->dbus_client); if (priv->dbus_connection) { g_dbus_connection_signal_unsubscribe (priv->dbus_connection, nm_steal_int (&priv->subscription_id)); g_clear_object (&priv->dbus_connection); } } static void name_owner_changed_cb (GDBusConnection *connection, const char *sender_name, const char *object_path, const char *interface_name, const char *signal_name, GVariant *parameters, gpointer user_data) { NMKeepAlive *self = NM_KEEP_ALIVE (user_data); const char *old_owner; const char *new_owner; g_variant_get (parameters, "(&s&s&s)", NULL, &old_owner, &new_owner); if (!nm_streq0 (new_owner, "")) return; _LOGD ("DBus client for keep alive disappeared from bus"); cleanup_dbus_watch (self); _notify_alive (self); } void nm_keep_alive_set_dbus_client_watch (NMKeepAlive *self, GDBusConnection *connection, const char *client_address) { NMKeepAlivePrivate *priv = NM_KEEP_ALIVE_GET_PRIVATE (self); if (priv->disarmed) return; cleanup_dbus_watch (self); if (client_address) { _LOGD ("Registering dbus client watch for keep alive"); priv->dbus_client = g_strdup (client_address); priv->dbus_client_watching = TRUE; priv->dbus_client_confirmed = FALSE; priv->dbus_connection = g_object_ref (connection); priv->subscription_id = nm_dbus_connection_signal_subscribe_name_owner_changed (priv->dbus_connection, priv->dbus_client, name_owner_changed_cb, self, NULL); } else priv->dbus_client_watching = FALSE; _notify_alive (self); } /*****************************************************************************/ /** * nm_keep_alive_arm: * @self: the #NMKeepAlive * * A #NMKeepAlive instance is unarmed by default. That means, it's * alive and stays alive until being armed. Arming means, that the conditions * start to be actively evaluated, that the alive state may change, and * that property changed signals are emitted. * * The opposite is nm_keep_alive_disarm() which freezes the alive state * for good. Once disarmed, the instance cannot be armed again. Arming an * instance multiple times has no effect. Arming an already disarmed instance * also has no effect. */ void nm_keep_alive_arm (NMKeepAlive *self) { NMKeepAlivePrivate *priv = NM_KEEP_ALIVE_GET_PRIVATE (self); if (!priv->armed) { priv->armed = TRUE; _notify_alive (self); } } /** * nm_keep_alive_disarm: * @self: the #NMKeepAlive instance * * Once the instance is disarmed, it will not change its alive state * anymore and will not emit anymore property changed signals about * alive state changed. * * As such, it will also free internal resources (since they no longer * affect the externally visible state). * * Once disarmed, the instance is frozen and cannot change anymore. */ void nm_keep_alive_disarm (NMKeepAlive *self) { NMKeepAlivePrivate *priv = NM_KEEP_ALIVE_GET_PRIVATE (self); priv->disarmed = TRUE; /* release internal data. */ _set_settings_connection_watch_visible (self, NULL, FALSE); cleanup_dbus_watch (self); } /** * nm_keep_alive_destroy: * @self: (allow-none): the #NMKeepAlive instance to destroy. * * This does 3 things in one: * * - set owner to %NULL * - disarm the instance. * - unref @self. */ void nm_keep_alive_destroy (NMKeepAlive *self) { if (!self) return; _nm_keep_alive_set_owner (self, NULL); nm_keep_alive_disarm (self); g_object_unref (self); } /*****************************************************************************/ static void get_property (GObject *object, guint prop_id, GValue *value, GParamSpec *pspec) { NMKeepAlive *self = NM_KEEP_ALIVE (object); switch (prop_id) { case PROP_ALIVE: g_value_set_boolean (value, nm_keep_alive_is_alive (self)); break; default: G_OBJECT_WARN_INVALID_PROPERTY_ID (object, prop_id, pspec); break; } } /*****************************************************************************/ /** * nm_keep_alive_get_owner: * @self: the #NMKeepAlive * * Returns: the owner instance associated with this @self. This commonly * is set to be the target instance, which @self guards for being alive. * Returns a gpointer, but of course it's some GObject instance. */ gpointer /* GObject * */ nm_keep_alive_get_owner (NMKeepAlive *self) { NMKeepAlivePrivate *priv = NM_KEEP_ALIVE_GET_PRIVATE (self); nm_assert (!priv->owner || G_IS_OBJECT (priv->owner)); return priv->owner; } /** * _nm_keep_alive_set_owner: * @self: the #NMKeepAlive * @owner: the owner to set or unset. * * Sets or unsets the owner instance. Think of the owner the target * instance that is guarded by @self. It's the responsibility of the * owner to set and properly unset this pointer. As the owner also * controls the lifetime of the NMKeepAlive instance. * * This API is not to be called by everybody, but only the owner of * @self. */ void _nm_keep_alive_set_owner (NMKeepAlive *self, GObject *owner) { NMKeepAlivePrivate *priv = NM_KEEP_ALIVE_GET_PRIVATE (self); nm_assert (!owner || G_IS_OBJECT (owner)); /* it's bad style to reset the owner object. You are supposed to * set it once, and clear it once. That's it. */ nm_assert (!owner || !priv->owner); /* optimally, we would take a reference to @owner. But the * owner already owns a reference to the keep-alive, so we cannot * just own a reference back. * * We could register a weak-pointer here. But instead, declare that * owner is required to set itself as owner when creating the * keep-alive instance, and unset itself when it lets go of the * keep-alive instance (at latest, when the owner itself gets destroyed). */ priv->owner = owner; } /*****************************************************************************/ static void nm_keep_alive_init (NMKeepAlive *self) { NMKeepAlivePrivate *priv = NM_KEEP_ALIVE_GET_PRIVATE (self); priv->alive = TRUE; nm_assert (priv->alive == _is_alive (self)); } NMKeepAlive * nm_keep_alive_new (void) { return g_object_new (NM_TYPE_KEEP_ALIVE, NULL); } static void dispose (GObject *object) { NMKeepAlive *self = NM_KEEP_ALIVE (object); nm_assert (!NM_KEEP_ALIVE_GET_PRIVATE (self)->owner); /* disarm also happens to free all resources. */ nm_keep_alive_disarm (self); } static void nm_keep_alive_class_init (NMKeepAliveClass *keep_alive_class) { GObjectClass *object_class = G_OBJECT_CLASS (keep_alive_class); object_class->get_property = get_property; object_class->dispose = dispose; obj_properties[PROP_ALIVE] = g_param_spec_string (NM_KEEP_ALIVE_ALIVE, "", "", NULL, G_PARAM_READABLE | G_PARAM_STATIC_STRINGS); g_object_class_install_properties (object_class, _PROPERTY_ENUMS_LAST, obj_properties); }
{ "pile_set_name": "Github" }
#include <cstring> #include <vector> #include "gtest/gtest.h" #include "caffe/blob.hpp" #include "caffe/common.hpp" #include "caffe/filler.hpp" #include "caffe/vision_layers.hpp" #include "caffe/test/test_caffe_main.hpp" #include "caffe/test/test_gradient_check_util.hpp" namespace caffe { template <typename TypeParam> class Im2colLayerTest : public MultiDeviceTest<TypeParam> { typedef typename TypeParam::Dtype Dtype; protected: Im2colLayerTest() : blob_bottom_(new Blob<Dtype>(2, 3, 6, 5)), blob_top_(new Blob<Dtype>()) { // fill the values FillerParameter filler_param; GaussianFiller<Dtype> filler(filler_param); filler.Fill(this->blob_bottom_); blob_bottom_vec_.push_back(blob_bottom_); blob_top_vec_.push_back(blob_top_); } virtual ~Im2colLayerTest() { delete blob_bottom_; delete blob_top_; } Blob<Dtype>* const blob_bottom_; Blob<Dtype>* const blob_top_; vector<Blob<Dtype>*> blob_bottom_vec_; vector<Blob<Dtype>*> blob_top_vec_; }; TYPED_TEST_CASE(Im2colLayerTest, TestDtypesAndDevices); TYPED_TEST(Im2colLayerTest, TestSetup) { typedef typename TypeParam::Dtype Dtype; LayerParameter layer_param; ConvolutionParameter* convolution_param = layer_param.mutable_convolution_param(); convolution_param->set_kernel_size(3); convolution_param->set_stride(2); Im2colLayer<Dtype> layer(layer_param); layer.SetUp(this->blob_bottom_vec_, this->blob_top_vec_); EXPECT_EQ(this->blob_top_->num(), 2); EXPECT_EQ(this->blob_top_->channels(), 27); EXPECT_EQ(this->blob_top_->height(), 2); EXPECT_EQ(this->blob_top_->width(), 2); } TYPED_TEST(Im2colLayerTest, TestForward) { typedef typename TypeParam::Dtype Dtype; LayerParameter layer_param; ConvolutionParameter* convolution_param = layer_param.mutable_convolution_param(); convolution_param->set_kernel_size(3); convolution_param->set_stride(2); Im2colLayer<Dtype> layer(layer_param); layer.SetUp(this->blob_bottom_vec_, this->blob_top_vec_); layer.Forward(this->blob_bottom_vec_, this->blob_top_vec_); // We are lazy and will only check the top left block for (int c = 0; c < 27; ++c) { EXPECT_EQ(this->blob_bottom_->data_at(0, (c / 9), (c / 3) % 3, c % 3), this->blob_top_->data_at(0, c, 0, 0)); } } TYPED_TEST(Im2colLayerTest, TestGradient) { typedef typename TypeParam::Dtype Dtype; LayerParameter layer_param; ConvolutionParameter* convolution_param = layer_param.mutable_convolution_param(); convolution_param->set_kernel_size(3); convolution_param->set_stride(2); Im2colLayer<Dtype> layer(layer_param); GradientChecker<Dtype> checker(1e-2, 1e-2); checker.CheckGradientExhaustive(&layer, this->blob_bottom_vec_, this->blob_top_vec_); } TYPED_TEST(Im2colLayerTest, TestRect) { typedef typename TypeParam::Dtype Dtype; LayerParameter layer_param; ConvolutionParameter* convolution_param = layer_param.mutable_convolution_param(); convolution_param->set_kernel_h(5); convolution_param->set_kernel_w(3); convolution_param->set_stride(2); Im2colLayer<Dtype> layer(layer_param); layer.SetUp(this->blob_bottom_vec_, this->blob_top_vec_); layer.Forward(this->blob_bottom_vec_, this->blob_top_vec_); // We are lazy and will only check the top left block for (int c = 0; c < 45; ++c) { EXPECT_EQ(this->blob_top_->data_at(0, c, 0, 0), this->blob_bottom_->data_at(0, (c / 15), (c / 3) % 5, c % 3)); } } TYPED_TEST(Im2colLayerTest, TestRectGradient) { typedef typename TypeParam::Dtype Dtype; LayerParameter layer_param; ConvolutionParameter* convolution_param = layer_param.mutable_convolution_param(); convolution_param->set_kernel_h(5); convolution_param->set_kernel_w(3); convolution_param->set_stride(2); Im2colLayer<Dtype> layer(layer_param); GradientChecker<Dtype> checker(1e-2, 1e-2); checker.CheckGradientExhaustive(&layer, this->blob_bottom_vec_, this->blob_top_vec_); } } // namespace caffe
{ "pile_set_name": "Github" }
<?xml version="1.0" encoding="utf-8"?> <root> <!-- Microsoft ResX Schema Version 2.0 The primary goals of this format is to allow a simple XML format that is mostly human readable. The generation and parsing of the various data types are done through the TypeConverter classes associated with the data types. Example: ... ado.net/XML headers & schema ... <resheader name="resmimetype">text/microsoft-resx</resheader> <resheader name="version">2.0</resheader> <resheader name="reader">System.Resources.ResXResourceReader, System.Windows.Forms, ...</resheader> <resheader name="writer">System.Resources.ResXResourceWriter, System.Windows.Forms, ...</resheader> <data name="Name1"><value>this is my long string</value><comment>this is a comment</comment></data> <data name="Color1" type="System.Drawing.Color, System.Drawing">Blue</data> <data name="Bitmap1" mimetype="application/x-microsoft.net.object.binary.base64"> <value>[base64 mime encoded serialized .NET Framework object]</value> </data> <data name="Icon1" type="System.Drawing.Icon, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64"> <value>[base64 mime encoded string representing a byte array form of the .NET Framework object]</value> <comment>This is a comment</comment> </data> There are any number of "resheader" rows that contain simple name/value pairs. Each data row contains a name, and value. The row also contains a type or mimetype. Type corresponds to a .NET class that support text/value conversion through the TypeConverter architecture. Classes that don't support this are serialized and stored with the mimetype set. The mimetype is used for serialized objects, and tells the ResXResourceReader how to depersist the object. This is currently not extensible. For a given mimetype the value must be set accordingly: Note - application/x-microsoft.net.object.binary.base64 is the format that the ResXResourceWriter will generate, however the reader can read any of the formats listed below. mimetype: application/x-microsoft.net.object.binary.base64 value : The object must be serialized with : System.Runtime.Serialization.Formatters.Binary.BinaryFormatter : and then encoded with base64 encoding. mimetype: application/x-microsoft.net.object.soap.base64 value : The object must be serialized with : System.Runtime.Serialization.Formatters.Soap.SoapFormatter : and then encoded with base64 encoding. mimetype: application/x-microsoft.net.object.bytearray.base64 value : The object must be serialized into a byte array : using a System.ComponentModel.TypeConverter : and then encoded with base64 encoding. --> <xsd:schema id="root" xmlns="" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:msdata="urn:schemas-microsoft-com:xml-msdata"> <xsd:import namespace="http://www.w3.org/XML/1998/namespace" /> <xsd:element name="root" msdata:IsDataSet="true"> <xsd:complexType> <xsd:choice maxOccurs="unbounded"> <xsd:element name="metadata"> <xsd:complexType> <xsd:sequence> <xsd:element name="value" type="xsd:string" minOccurs="0" /> </xsd:sequence> <xsd:attribute name="name" use="required" type="xsd:string" /> <xsd:attribute name="type" type="xsd:string" /> <xsd:attribute name="mimetype" type="xsd:string" /> <xsd:attribute ref="xml:space" /> </xsd:complexType> </xsd:element> <xsd:element name="assembly"> <xsd:complexType> <xsd:attribute name="alias" type="xsd:string" /> <xsd:attribute name="name" type="xsd:string" /> </xsd:complexType> </xsd:element> <xsd:element name="data"> <xsd:complexType> <xsd:sequence> <xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" /> <xsd:element name="comment" type="xsd:string" minOccurs="0" msdata:Ordinal="2" /> </xsd:sequence> <xsd:attribute name="name" type="xsd:string" use="required" msdata:Ordinal="1" /> <xsd:attribute name="type" type="xsd:string" msdata:Ordinal="3" /> <xsd:attribute name="mimetype" type="xsd:string" msdata:Ordinal="4" /> <xsd:attribute ref="xml:space" /> </xsd:complexType> </xsd:element> <xsd:element name="resheader"> <xsd:complexType> <xsd:sequence> <xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" /> </xsd:sequence> <xsd:attribute name="name" type="xsd:string" use="required" /> </xsd:complexType> </xsd:element> </xsd:choice> </xsd:complexType> </xsd:element> </xsd:schema> <resheader name="resmimetype"> <value>text/microsoft-resx</value> </resheader> <resheader name="version"> <value>2.0</value> </resheader> <resheader name="reader"> <value>System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value> </resheader> <resheader name="writer"> <value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value> </resheader> <data name="&gt;&gt;toolStripContainer1.BottomToolStripPanel.Name" xml:space="preserve"> <value>toolStripContainer1.BottomToolStripPanel</value> </data> <data name="&gt;&gt;toolStripContainer1.BottomToolStripPanel.Type" xml:space="preserve"> <value>System.Windows.Forms.ToolStripPanel, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value> </data> <data name="&gt;&gt;toolStripContainer1.BottomToolStripPanel.Parent" xml:space="preserve"> <value>toolStripContainer1</value> </data> <data name="&gt;&gt;toolStripContainer1.BottomToolStripPanel.ZOrder" xml:space="preserve"> <value>4</value> </data> <assembly alias="mscorlib" name="mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" /> <data name="tiffviewer1.AutoScroll" type="System.Boolean, mscorlib"> <value>True</value> </data> <assembly alias="System.Windows.Forms" name="System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" /> <data name="tiffviewer1.Dock" type="System.Windows.Forms.DockStyle, System.Windows.Forms"> <value>Fill</value> </data> <assembly alias="System.Drawing" name="System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a" /> <data name="tiffviewer1.Location" type="System.Drawing.Point, System.Drawing"> <value>0, 0</value> </data> <data name="tiffviewer1.Padding" type="System.Windows.Forms.Padding, System.Windows.Forms"> <value>0, 0, 10, 10</value> </data> <data name="tiffviewer1.Size" type="System.Drawing.Size, System.Drawing"> <value>784, 527</value> </data> <data name="tiffviewer1.TabIndex" type="System.Int32, mscorlib"> <value>0</value> </data> <data name="&gt;&gt;tiffviewer1.Name" xml:space="preserve"> <value>tiffviewer1</value> </data> <data name="&gt;&gt;tiffviewer1.Type" xml:space="preserve"> <value>NAPS2.WinForms.TiffViewer, NAPS2.Core, Version=5.5.0.36524, Culture=neutral, PublicKeyToken=null</value> </data> <data name="&gt;&gt;tiffviewer1.Parent" xml:space="preserve"> <value>toolStripContainer1.ContentPanel</value> </data> <data name="&gt;&gt;tiffviewer1.ZOrder" xml:space="preserve"> <value>0</value> </data> <data name="toolStripContainer1.ContentPanel.Size" type="System.Drawing.Size, System.Drawing"> <value>784, 527</value> </data> <data name="&gt;&gt;toolStripContainer1.ContentPanel.Name" xml:space="preserve"> <value>toolStripContainer1.ContentPanel</value> </data> <data name="&gt;&gt;toolStripContainer1.ContentPanel.Type" xml:space="preserve"> <value>System.Windows.Forms.ToolStripContentPanel, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value> </data> <data name="&gt;&gt;toolStripContainer1.ContentPanel.Parent" xml:space="preserve"> <value>toolStripContainer1</value> </data> <data name="&gt;&gt;toolStripContainer1.ContentPanel.ZOrder" xml:space="preserve"> <value>0</value> </data> <data name="toolStripContainer1.Dock" type="System.Windows.Forms.DockStyle, System.Windows.Forms"> <value>Fill</value> </data> <data name="&gt;&gt;toolStripContainer1.LeftToolStripPanel.Name" xml:space="preserve"> <value>toolStripContainer1.LeftToolStripPanel</value> </data> <data name="&gt;&gt;toolStripContainer1.LeftToolStripPanel.Type" xml:space="preserve"> <value>System.Windows.Forms.ToolStripPanel, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value> </data> <data name="&gt;&gt;toolStripContainer1.LeftToolStripPanel.Parent" xml:space="preserve"> <value>toolStripContainer1</value> </data> <data name="&gt;&gt;toolStripContainer1.LeftToolStripPanel.ZOrder" xml:space="preserve"> <value>1</value> </data> <data name="toolStripContainer1.Location" type="System.Drawing.Point, System.Drawing"> <value>0, 0</value> </data> <data name="&gt;&gt;toolStripContainer1.RightToolStripPanel.Name" xml:space="preserve"> <value>toolStripContainer1.RightToolStripPanel</value> </data> <data name="&gt;&gt;toolStripContainer1.RightToolStripPanel.Type" xml:space="preserve"> <value>System.Windows.Forms.ToolStripPanel, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value> </data> <data name="&gt;&gt;toolStripContainer1.RightToolStripPanel.Parent" xml:space="preserve"> <value>toolStripContainer1</value> </data> <data name="&gt;&gt;toolStripContainer1.RightToolStripPanel.ZOrder" xml:space="preserve"> <value>2</value> </data> <data name="toolStripContainer1.Size" type="System.Drawing.Size, System.Drawing"> <value>784, 552</value> </data> <data name="toolStripContainer1.TabIndex" type="System.Int32, mscorlib"> <value>8</value> </data> <metadata name="tStrip.TrayLocation" type="System.Drawing.Point, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a"> <value>342, 54</value> </metadata> <data name="tStrip.Dock" type="System.Windows.Forms.DockStyle, System.Windows.Forms"> <value>None</value> </data> <data name="tsStretch.ImageTransparentColor" type="System.Drawing.Color, System.Drawing"> <value>Magenta</value> </data> <data name="tsStretch.Size" type="System.Drawing.Size, System.Drawing"> <value>23, 22</value> </data> <data name="tsStretch.ToolTipText" xml:space="preserve"> <value>Scale With Window</value> </data> <data name="toolStripSeparator1.Size" type="System.Drawing.Size, System.Drawing"> <value>6, 25</value> </data> <data name="tsZoomActual.ImageTransparentColor" type="System.Drawing.Color, System.Drawing"> <value>Magenta</value> </data> <data name="tsZoomActual.Size" type="System.Drawing.Size, System.Drawing"> <value>23, 22</value> </data> <data name="tsZoomActual.ToolTipText" xml:space="preserve"> <value>Zoom Actual</value> </data> <data name="tsZoomPlus.ImageTransparentColor" type="System.Drawing.Color, System.Drawing"> <value>Magenta</value> </data> <data name="tsZoomPlus.Size" type="System.Drawing.Size, System.Drawing"> <value>23, 22</value> </data> <data name="tsZoomPlus.ToolTipText" xml:space="preserve"> <value>Zoom In</value> </data> <data name="tsZoomOut.ImageTransparentColor" type="System.Drawing.Color, System.Drawing"> <value>Magenta</value> </data> <data name="tsZoomOut.Size" type="System.Drawing.Size, System.Drawing"> <value>23, 22</value> </data> <data name="tsZoomOut.ToolTipText" xml:space="preserve"> <value>Zoom Out</value> </data> <data name="toolStripSeparator2.Size" type="System.Drawing.Size, System.Drawing"> <value>6, 25</value> </data> <data name="tsZoom.Size" type="System.Drawing.Size, System.Drawing"> <value>35, 22</value> </data> <data name="tsZoom.Text" xml:space="preserve"> <value>100%</value> </data> <data name="tsZoom.ToolTipText" xml:space="preserve"> <value>Zoom</value> </data> <data name="tStrip.Location" type="System.Drawing.Point, System.Drawing"> <value>3, 0</value> </data> <data name="tStrip.Size" type="System.Drawing.Size, System.Drawing"> <value>151, 25</value> </data> <data name="tStrip.TabIndex" type="System.Int32, mscorlib"> <value>7</value> </data> <data name="&gt;&gt;tStrip.Name" xml:space="preserve"> <value>tStrip</value> </data> <data name="&gt;&gt;tStrip.Type" xml:space="preserve"> <value>System.Windows.Forms.ToolStrip, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value> </data> <data name="&gt;&gt;tStrip.Parent" xml:space="preserve"> <value>toolStripContainer1.TopToolStripPanel</value> </data> <data name="&gt;&gt;tStrip.ZOrder" xml:space="preserve"> <value>0</value> </data> <data name="&gt;&gt;toolStripContainer1.TopToolStripPanel.Name" xml:space="preserve"> <value>toolStripContainer1.TopToolStripPanel</value> </data> <data name="&gt;&gt;toolStripContainer1.TopToolStripPanel.Type" xml:space="preserve"> <value>System.Windows.Forms.ToolStripPanel, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value> </data> <data name="&gt;&gt;toolStripContainer1.TopToolStripPanel.Parent" xml:space="preserve"> <value>toolStripContainer1</value> </data> <data name="&gt;&gt;toolStripContainer1.TopToolStripPanel.ZOrder" xml:space="preserve"> <value>3</value> </data> <data name="&gt;&gt;toolStripContainer1.Name" xml:space="preserve"> <value>toolStripContainer1</value> </data> <data name="&gt;&gt;toolStripContainer1.Type" xml:space="preserve"> <value>System.Windows.Forms.ToolStripContainer, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value> </data> <data name="&gt;&gt;toolStripContainer1.Parent" xml:space="preserve"> <value>$this</value> </data> <data name="&gt;&gt;toolStripContainer1.ZOrder" xml:space="preserve"> <value>0</value> </data> <metadata name="$this.Localizable" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089"> <value>True</value> </metadata> <data name="$this.Size" type="System.Drawing.Size, System.Drawing"> <value>784, 552</value> </data> <data name="&gt;&gt;tsStretch.Name" xml:space="preserve"> <value>tsStretch</value> </data> <data name="&gt;&gt;tsStretch.Type" xml:space="preserve"> <value>System.Windows.Forms.ToolStripButton, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value> </data> <data name="&gt;&gt;toolStripSeparator1.Name" xml:space="preserve"> <value>toolStripSeparator1</value> </data> <data name="&gt;&gt;toolStripSeparator1.Type" xml:space="preserve"> <value>System.Windows.Forms.ToolStripSeparator, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value> </data> <data name="&gt;&gt;tsZoomActual.Name" xml:space="preserve"> <value>tsZoomActual</value> </data> <data name="&gt;&gt;tsZoomActual.Type" xml:space="preserve"> <value>System.Windows.Forms.ToolStripButton, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value> </data> <data name="&gt;&gt;tsZoomPlus.Name" xml:space="preserve"> <value>tsZoomPlus</value> </data> <data name="&gt;&gt;tsZoomPlus.Type" xml:space="preserve"> <value>System.Windows.Forms.ToolStripButton, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value> </data> <data name="&gt;&gt;tsZoomOut.Name" xml:space="preserve"> <value>tsZoomOut</value> </data> <data name="&gt;&gt;tsZoomOut.Type" xml:space="preserve"> <value>System.Windows.Forms.ToolStripButton, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value> </data> <data name="&gt;&gt;toolStripSeparator2.Name" xml:space="preserve"> <value>toolStripSeparator2</value> </data> <data name="&gt;&gt;toolStripSeparator2.Type" xml:space="preserve"> <value>System.Windows.Forms.ToolStripSeparator, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value> </data> <data name="&gt;&gt;tsZoom.Name" xml:space="preserve"> <value>tsZoom</value> </data> <data name="&gt;&gt;tsZoom.Type" xml:space="preserve"> <value>System.Windows.Forms.ToolStripLabel, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value> </data> <data name="&gt;&gt;$this.Name" xml:space="preserve"> <value>TiffViewerCtl</value> </data> <data name="&gt;&gt;$this.Type" xml:space="preserve"> <value>System.Windows.Forms.UserControl, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value> </data> </root>
{ "pile_set_name": "Github" }
\name{vv} \alias{vv} \title{Precomputed variogram for PM10 in data set air} \description{ Precomputed variogram for PM10 in data set air } \format{ data set structure is explained in \link{variogramST}. } \usage{ data(vv) } \examples{ \dontrun{ # obtained by: library(spacetime) library(gstat) data(air) suppressWarnings(proj4string(stations) <- CRS(proj4string(stations))) rural = STFDF(stations, dates, data.frame(PM10 = as.vector(air))) rr = rural[,"2005::2010"] unsel = which(apply(as(rr, "xts"), 2, function(x) all(is.na(x)))) r5to10 = rr[-unsel,] vv = variogram(PM10~1, r5to10, width=20, cutoff = 200, tlags=0:5) } }
{ "pile_set_name": "Github" }
mov (sp)+,r0 / return to routine that called writei jmp ret tstdeve: / check whether permanent error has occured on special file / I/O mov cdev,r1 / only works on tape; r1 has device # tstb deverr(r1) / test error bit of device bne 1f / error rts r0 / device okay 1: clrb deverr(r1) / clear error error10: jmp error / see 'error' routine dioreg: mov u.count,r3 / move char count to r3 cmp r3,$512. / more than 512. char? blos 1f / no, branch mov $512.,r3 / yes, just take 512. 1: mov u.base,r2 / put users base in r2 add r3,u.nread / add the number to be read to u.nread sub r3,u.count / update count add r3,u.base / update base rts r0 / return preread: jsr r0,bufaloc / get a free I/O buffer (r1 has block number) br 1f / branch if block already in a I/O buffer bis $2000,(r5) / set read bit (bit 100 in I/O buffer) jsr r0,poke / perform the read 1: clr *$ps / ps = 0 rts r0 dskrd: jsr r0,bufaloc / shuffle off to bufaloc; get a free I/O buffer br 1f bis $2000,(r5) / set bit 10 of word 1 of I/O queue entry / for buffer jsr r0,poke / just assigned in bufaloc, bit 10=1 says read 1: clr *$ps bit $22000,(r5) / if either bits 10, or 13 are 1; jump to idle beq 1f jsr r0,idle; s.wait+2 br 1b 1: add $8,r5 / r5 points to first word of data in block just read / in rts r0 wslot: jsr r0,bufaloc / get a free I/O buffer; pointer to first br 1f / word in buffer in r5
{ "pile_set_name": "Github" }
/* Copyright 2003-2013 Joaquin M Lopez Munoz. * Distributed under the Boost Software License, Version 1.0. * (See accompanying file LICENSE_1_0.txt or copy at * http://www.boost.org/LICENSE_1_0.txt) * * See http://www.boost.org/libs/multi_index for library home page. */ #ifndef BOOST_MULTI_INDEX_INDEXED_BY_HPP #define BOOST_MULTI_INDEX_INDEXED_BY_HPP #if defined(_MSC_VER) #pragma once #endif #include <boost/config.hpp> /* keep it first to prevent nasty warns in MSVC */ #include <boost/mpl/vector.hpp> #include <boost/preprocessor/cat.hpp> #include <boost/preprocessor/control/expr_if.hpp> #include <boost/preprocessor/repetition/enum.hpp> #include <boost/preprocessor/repetition/enum_params.hpp> /* An alias to mpl::vector used to hide MPL from the user. * indexed_by contains the index specifiers for instantiation * of a multi_index_container. */ /* This user_definable macro limits the number of elements of an index list; * useful for shortening resulting symbol names (MSVC++ 6.0, for instance, * has problems coping with very long symbol names.) */ #if !defined(BOOST_MULTI_INDEX_LIMIT_INDEXED_BY_SIZE) #define BOOST_MULTI_INDEX_LIMIT_INDEXED_BY_SIZE BOOST_MPL_LIMIT_VECTOR_SIZE #endif #if BOOST_MULTI_INDEX_LIMIT_INDEXED_BY_SIZE<BOOST_MPL_LIMIT_VECTOR_SIZE #define BOOST_MULTI_INDEX_INDEXED_BY_SIZE \ BOOST_MULTI_INDEX_LIMIT_INDEXED_BY_SIZE #else #define BOOST_MULTI_INDEX_INDEXED_BY_SIZE BOOST_MPL_LIMIT_VECTOR_SIZE #endif #define BOOST_MULTI_INDEX_INDEXED_BY_TEMPLATE_PARM(z,n,var) \ typename BOOST_PP_CAT(var,n) BOOST_PP_EXPR_IF(n,=mpl::na) namespace boost{ namespace multi_index{ template< BOOST_PP_ENUM( BOOST_MULTI_INDEX_INDEXED_BY_SIZE, BOOST_MULTI_INDEX_INDEXED_BY_TEMPLATE_PARM,T) > struct indexed_by: mpl::vector<BOOST_PP_ENUM_PARAMS(BOOST_MULTI_INDEX_INDEXED_BY_SIZE,T)> { }; } /* namespace multi_index */ } /* namespace boost */ #undef BOOST_MULTI_INDEX_INDEXED_BY_TEMPLATE_PARM #undef BOOST_MULTI_INDEX_INDEXED_BY_SIZE #endif
{ "pile_set_name": "Github" }
-- Copyright 2020 Stanford University -- -- Licensed under the Apache License, Version 2.0 (the "License"); -- you may not use this file except in compliance with the License. -- You may obtain a copy of the License at -- -- http://www.apache.org/licenses/LICENSE-2.0 -- -- Unless required by applicable law or agreed to in writing, software -- distributed under the License is distributed on an "AS IS" BASIS, -- WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -- See the License for the specific language governing permissions and -- limitations under the License. import "regent" local c = regentlib.c task f() : int var r = region(ispace(ptr, 5), int) var rc = c.legion_coloring_create() c.legion_coloring_add_point(rc, 0, c.legion_ptr_t { value = 0 }) var p = partition(disjoint, r, rc) c.legion_coloring_destroy(rc) var r0 = p[0] var x = dynamic_cast(ptr(int, r0), 0) @x = 5 var v = @x __delete(p) __delete(r) return v end task g() : int var r = region(ispace(ptr, 5), int) var rc = c.legion_coloring_create() c.legion_coloring_add_point(rc, 0, c.legion_ptr_t { value = 0 }) var p = partition(disjoint, r, rc) c.legion_coloring_destroy(rc) var r0 = p[0] var r0c = c.legion_coloring_create() c.legion_coloring_add_point(r0c, 0, c.legion_ptr_t { value = 0 }) var p0 = partition(disjoint, r0, r0c) c.legion_coloring_destroy(r0c) var r1 = p0[0] var x = dynamic_cast(ptr(int, r1), 0) @x = 5 var v = @x __delete(p) __delete(p0) __delete(r) return v end task main() regentlib.assert(f() == 5, "test failed") regentlib.assert(g() == 5, "test failed") end regentlib.start(main)
{ "pile_set_name": "Github" }
version https://git-lfs.github.com/spec/v1 oid sha256:625446ee3012df0897af767612bbce9e176b93b0da29581cea838e1499f40076 size 19891
{ "pile_set_name": "Github" }
import 'dart:async'; import 'package:flutter/foundation.dart'; import 'package:flutter/material.dart'; import 'package:flutter_redux/flutter_redux.dart'; import 'package:invoiceninja_flutter/data/models/models.dart'; import 'package:invoiceninja_flutter/redux/app/app_actions.dart'; import 'package:invoiceninja_flutter/redux/app/app_state.dart'; import 'package:invoiceninja_flutter/redux/document/document_actions.dart'; import 'package:invoiceninja_flutter/redux/product/product_actions.dart'; import 'package:invoiceninja_flutter/ui/app/dialogs/error_dialog.dart'; import 'package:invoiceninja_flutter/ui/app/snackbar_row.dart'; import 'package:invoiceninja_flutter/ui/product/view/product_view.dart'; import 'package:invoiceninja_flutter/utils/completers.dart'; import 'package:invoiceninja_flutter/utils/localization.dart'; import 'package:redux/redux.dart'; class ProductViewScreen extends StatelessWidget { const ProductViewScreen({ Key key, this.isFilter = false, }) : super(key: key); final bool isFilter; static const String route = '/product/view'; @override Widget build(BuildContext context) { return StoreConnector<AppState, ProductViewVM>( //distinct: true, converter: (Store<AppState> store) { return ProductViewVM.fromStore(store); }, builder: (context, vm) { return ProductView( viewModel: vm, isFilter: isFilter, ); }, ); } } class ProductViewVM { ProductViewVM({ @required this.state, @required this.product, @required this.company, @required this.onEntityAction, @required this.isSaving, @required this.isLoading, @required this.isDirty, @required this.onRefreshed, @required this.onUploadDocument, @required this.onDeleteDocument, }); factory ProductViewVM.fromStore(Store<AppState> store) { final state = store.state; final product = state.productState.map[state.productUIState.selectedId] ?? ProductEntity(id: state.productUIState.selectedId); Future<Null> _handleRefresh(BuildContext context) { final completer = snackBarCompleter<Null>( context, AppLocalization.of(context).refreshComplete); store.dispatch(LoadProduct( completer: completer, productId: product.id, )); return completer.future; } return ProductViewVM( state: state, isSaving: state.isSaving, isLoading: state.isLoading, isDirty: product.isNew, product: product, company: state.company, onRefreshed: (context) => _handleRefresh(context), onEntityAction: (BuildContext context, EntityAction action) => handleEntitiesActions(context, [product], action, autoPop: true), onUploadDocument: (BuildContext context, String filePath) { final Completer<DocumentEntity> completer = Completer<DocumentEntity>(); store.dispatch(SaveProductDocumentRequest( filePath: filePath, product: product, completer: completer)); completer.future.then((client) { Scaffold.of(context).showSnackBar(SnackBar( content: SnackBarRow( message: AppLocalization.of(context).uploadedDocument, ))); }).catchError((Object error) { showDialog<ErrorDialog>( context: context, builder: (BuildContext context) { return ErrorDialog(error); }); }); }, onDeleteDocument: (BuildContext context, DocumentEntity document, String password) { final completer = snackBarCompleter<Null>( context, AppLocalization.of(context).deletedDocument); completer.future.then<Null>( (value) => store.dispatch(LoadProduct(productId: product.id))); store.dispatch(DeleteDocumentRequest( completer: completer, documentIds: [document.id], password: password, )); }, ); } final AppState state; final ProductEntity product; final CompanyEntity company; final Function(BuildContext, EntityAction) onEntityAction; final Function(BuildContext) onRefreshed; final Function(BuildContext, String) onUploadDocument; final Function(BuildContext, DocumentEntity, String) onDeleteDocument; final bool isSaving; final bool isLoading; final bool isDirty; @override bool operator ==(dynamic other) => product == other.product && company == other.company; @override int get hashCode => product.hashCode ^ company.hashCode; }
{ "pile_set_name": "Github" }
module RailsAdmin ### # Features to embed swagger editor. module SwaggerHelper ### # Return swagger editor configuration. def swagger_config { # Analytics section is used for user tracking configurations. At the moment # only Google Analytics is supported. analytics: { google: { # Put your Google Analytics ID here id: 'UA-51231036-1' } }, # Code generator endpoints s are used for generating servers and client # Swagger Editor will GET list of server and client generators and POST to # each `server` and `client` with Swagger document in body to download the # product of the code generator. codegen: { # Menu items are generated based on result of GET request to these # endpoint servers: '//generator.swagger.io/api/gen/servers', clients: '//generator.swagger.io/api/gen/clients', # For each item in menu item, Swagger Editor will make calls to these # endpoint to download the generated code accordingly server: '//generator.swagger.io/api/gen/servers/{language}', client: '//generator.swagger.io/api/gen/clients/{language}' }, # Disables Code Generators disableCodeGen: false, # Folder that example files are located # Note that this string will be used in between two other url segments # so you always need the trailing and leading slashes examplesFolder: "/swagger-editor/spec-files/", # Ace editor options. This object will overload existing editor options. # See all possible options here: http://ace.c9.ionav=api&api=ace editorOptions: { "theme": "ace/theme/atom_dark" }, # List of example files to show to user to pick from. The URL to fetch each # example is a combination of `examplesFolder` and file name exampleFiles: [], # Keywords for auto-complete are generated from a JavaScript object. # See keyword-map.js for object format autocompleteExtension: {}, # Use a back-end for storing the document instead of browser local storage useBackendForStorage: true, # Change how many milliseconds after the last keypress the editor should # respond to change. keyPressDebounceTime: 200, # The timeout for throttling backend calls backendThrottle: 200, # URL of the Back-end for storing swagger document. Editor will PUT and GET # to this URL to **Save** and **Read** the Swagger document backendEndpoint: "/#{params[:model_name]}/#{params[:id]}/swagger/spec", # When using a back-end, editor by default PUTs JSON document for Saving. # Enable this to use YAML instead useYamlBackend: true, # Disables File menu which includes New, Open Example and Import commands disableFileMenu: true, # When it's enabled: # * Editor will append `brandingCssClass` class to body tag # * Editor will include branding templates at # app/templates/branding-left.html and # app/templates/branding-left.html # to it's header headerBranding: false, # Enables Try Operation functionality enableTryIt: true, # When `headerBranding` is enabled, this will be appended to body tag brandingCssClass: "", # Disables the overlay introduction panel disableNewUserIntro: false, # When Editor imports a file from a URL, it will prepend this URL to make # it possible to import contents that are not allowed to be loaded from a # different origin. If you're hosting your own editor, please replace this importProxyUrl: "https://cors-it.herokuapp.com/?url=", # Use this base path for resolving JSON Pointers ($ref). # This value should be a valid URL. # # Example: http://example.com/swaggers # # More info: https://github.com/swagger-api/swagger-editor/issues/977#issuecomment-232254578 pointerResolutionBasePath: nil } end ### # Returns api specification. def swagger_get_spec render text: @object.specification, content_type: 'text/yaml' end ### # Update api specification. def swagger_set_spec spec = request.body.read @object.update(specification: spec) unless @object.specification == spec if @object.errors.present? render text: @object.errors.full_messages.to_sentence, status: :bad_request else render text: 'Success!' end end end end
{ "pile_set_name": "Github" }
/*- * Copyright (c) 2014-2016 MongoDB, Inc. * Copyright (c) 2008-2014 WiredTiger, Inc. * All rights reserved. * * See the file LICENSE for redistribution information. */ /* * __wt_buf_grow -- * Grow a buffer that may be in-use, and ensure that all data is local to * the buffer. */ static inline int __wt_buf_grow(WT_SESSION_IMPL *session, WT_ITEM *buf, size_t size) { return (size > buf->memsize || !WT_DATA_IN_ITEM(buf) ? __wt_buf_grow_worker(session, buf, size) : 0); } /* * __wt_buf_extend -- * Grow a buffer that's currently in-use. */ static inline int __wt_buf_extend(WT_SESSION_IMPL *session, WT_ITEM *buf, size_t size) { /* * The difference between __wt_buf_grow and __wt_buf_extend is that the * latter is expected to be called repeatedly for the same buffer, and * so grows the buffer exponentially to avoid repeated costly calls to * realloc. */ return (size > buf->memsize ? __wt_buf_grow(session, buf, WT_MAX(size, 2 * buf->memsize)) : 0); } /* * __wt_buf_init -- * Initialize a buffer at a specific size. */ static inline int __wt_buf_init(WT_SESSION_IMPL *session, WT_ITEM *buf, size_t size) { buf->data = buf->mem; buf->size = 0; /* Clear existing data length */ WT_RET(__wt_buf_grow(session, buf, size)); return (0); } /* * __wt_buf_initsize -- * Initialize a buffer at a specific size, and set the data length. */ static inline int __wt_buf_initsize(WT_SESSION_IMPL *session, WT_ITEM *buf, size_t size) { buf->data = buf->mem; buf->size = 0; /* Clear existing data length */ WT_RET(__wt_buf_grow(session, buf, size)); buf->size = size; /* Set the data length. */ return (0); } /* * __wt_buf_set -- * Set the contents of the buffer. */ static inline int __wt_buf_set( WT_SESSION_IMPL *session, WT_ITEM *buf, const void *data, size_t size) { /* Ensure the buffer is large enough. */ WT_RET(__wt_buf_initsize(session, buf, size)); /* Copy the data, allowing for overlapping strings. */ if (size != 0) memmove(buf->mem, data, size); return (0); } /* * __wt_buf_setstr -- * Set the contents of the buffer to a NUL-terminated string. */ static inline int __wt_buf_setstr(WT_SESSION_IMPL *session, WT_ITEM *buf, const char *s) { return (__wt_buf_set(session, buf, s, strlen(s) + 1)); } /* * __wt_buf_free -- * Free a buffer. */ static inline void __wt_buf_free(WT_SESSION_IMPL *session, WT_ITEM *buf) { __wt_free(session, buf->mem); memset(buf, 0, sizeof(WT_ITEM)); } /* * __wt_scr_free -- * Release a scratch buffer. */ static inline void __wt_scr_free(WT_SESSION_IMPL *session, WT_ITEM **bufp) { WT_ITEM *buf; if ((buf = *bufp) != NULL) { *bufp = NULL; if (session->scratch_cached + buf->memsize >= S2C(session)->session_scratch_max) { __wt_free(session, buf->mem); buf->memsize = 0; } else session->scratch_cached += buf->memsize; buf->data = NULL; buf->size = 0; F_CLR(buf, WT_ITEM_INUSE); } }
{ "pile_set_name": "Github" }
// dorian_diatcon.scl // // A Dorian Diatonic with its own trite synemmenon replacing paramese // @60 :intervals 261.6255653006 287.78812183066 319.76457981184 359.73515228832 383.71749577421 411.12588832951 479.64686971777 523.2511306012
{ "pile_set_name": "Github" }
/* RTL files */ @import url("../dijit_rtl.css"); @import url("form/Common_rtl.css"); @import url("form/Button_rtl.css"); @import url("layout/TabContainer_rtl.css"); @import url("form/Slider_rtl.css"); @import url("form/Select_rtl.css"); @import url("Dialog_rtl.css"); @import url("Editor_rtl.css"); @import url("../../icons/editorIcons_rtl.css");/* RTL sprite for editor icons to be used by all themes*/ @import url("../../icons/commonIcons_rtl.css");/* RTL sprite for common icons to be used by all themes*/ @import url("TitlePane_rtl.css"); @import url("Menu_rtl.css"); @import url("Calendar_rtl.css"); @import url("TimePicker_rtl.css");
{ "pile_set_name": "Github" }
#!/usr/bin/php <?php /* multicpu monitors the cpu usage of multiple processes. you can configure the list of processes via munin's configuration [multicpu] env.ps_filter apache2 mysqld I have very little knowledge about munin plugins, it just 'works fine for me'. Please feel free to improve :) 0.1 initial release - Florian Fida */ // make sure that paht to ps is valid for your system $ps_cmd = '/bin/ps -eo "%C,%a"'; // list of processes to monitor, can also be set by env.ps_filter in munin config $ps_filter = array( 'apache2', 'mysqld', 'exim', 'php', 'perl', 'ruby', 'bftpd' ); $cmdl = implode(' ', $argv); $config = stripos($cmdl, 'config') !== false; if(!empty($_ENV['ps_filter'])){ $ps_filter = explode(' ', $_ENV['ps_filter']); } if($config){ $out = "multigraph multicpu_pcpu\n"; $out .= "graph_title CPU usage per process\n"; $out .= "graph_vlabel CPU usage [%]\n"; $out .= "graph_category processes\n"; foreach($ps_filter as $process) $out .= "$process.label $process\n"; $out .= "multigraph multicpu_cnt\n"; $out .= "graph_title Instances per process\n"; $out .= "graph_vlabel count\n"; $out .= "graph_category processes\n"; foreach($ps_filter as $process) $out .= "$process.label $process\n"; echo $out."\n"; exit; } $ps_txt = shell_exec($ps_cmd); $ps_a = explode("\n", $ps_txt); $result = array(); $result_cnt = array(); foreach($ps_filter as $process){ if(!isset($result[$process])) $result[$process] = 0; if(!isset($result_cnt[$process])) $result_cnt[$process] = 0; foreach($ps_a as $line){ $line_a = explode(',', $line, 2); if(count($line_a) == 2){ if(stripos($line_a[1], $process) !== false){ $result[$process] += floatval($line_a[0]); ++$result_cnt[$process]; } } } } echo "multigraph multicpu_pcpu\n"; foreach($result as $process => $value) echo "$process.value $value\n"; echo "multigraph multicpu_cnt\n"; foreach($result_cnt as $process => $value) echo "$process.value $value\n";
{ "pile_set_name": "Github" }
package org.ripple.bouncycastle.pqc.jcajce.spec; import java.security.spec.KeySpec; import java.util.Vector; import org.ripple.bouncycastle.pqc.crypto.gmss.GMSSLeaf; import org.ripple.bouncycastle.pqc.crypto.gmss.GMSSParameters; import org.ripple.bouncycastle.pqc.crypto.gmss.GMSSRootCalc; import org.ripple.bouncycastle.pqc.crypto.gmss.GMSSRootSig; import org.ripple.bouncycastle.pqc.crypto.gmss.Treehash; import org.ripple.bouncycastle.util.Arrays; /** * This class provides a specification for a GMSS private key. */ public class GMSSPrivateKeySpec implements KeySpec { private int[] index; private byte[][] currentSeed; private byte[][] nextNextSeed; private byte[][][] currentAuthPath; private byte[][][] nextAuthPath; private Treehash[][] currentTreehash; private Treehash[][] nextTreehash; private Vector[] currentStack; private Vector[] nextStack; private Vector[][] currentRetain; private Vector[][] nextRetain; private byte[][][] keep; private GMSSLeaf[] nextNextLeaf; private GMSSLeaf[] upperLeaf; private GMSSLeaf[] upperTreehashLeaf; private int[] minTreehash; private GMSSParameters gmssPS; private byte[][] nextRoot; private GMSSRootCalc[] nextNextRoot; private byte[][] currentRootSig; private GMSSRootSig[] nextRootSig; /** * @param index tree indices * @param currentSeed seed for the generation of private OTS keys for the * current subtrees (TREE) * @param nextNextSeed seed for the generation of private OTS keys for the * subtrees after next (TREE++) * @param currentAuthPath array of current authentication paths (AUTHPATH) * @param nextAuthPath array of next authentication paths (AUTHPATH+) * @param keep keep array for the authPath algorithm * @param currentTreehash treehash for authPath algorithm of current tree * @param nextTreehash treehash for authPath algorithm of next tree (TREE+) * @param currentStack shared stack for authPath algorithm of current tree * @param nextStack shared stack for authPath algorithm of next tree (TREE+) * @param currentRetain retain stack for authPath algorithm of current tree * @param nextRetain retain stack for authPath algorithm of next tree (TREE+) * @param nextNextLeaf array of upcoming leafs of the tree after next (LEAF++) of * each layer * @param upperLeaf needed for precomputation of upper nodes * @param upperTreehashLeaf needed for precomputation of upper treehash nodes * @param minTreehash index of next treehash instance to receive an update * @param nextRoot the roots of the next trees (ROOT+) * @param nextNextRoot the roots of the tree after next (ROOT++) * @param currentRootSig array of signatures of the roots of the current subtrees * (SIG) * @param nextRootSig array of signatures of the roots of the next subtree * (SIG+) * @param gmssParameterset the GMSS Parameterset */ public GMSSPrivateKeySpec(int[] index, byte[][] currentSeed, byte[][] nextNextSeed, byte[][][] currentAuthPath, byte[][][] nextAuthPath, Treehash[][] currentTreehash, Treehash[][] nextTreehash, Vector[] currentStack, Vector[] nextStack, Vector[][] currentRetain, Vector[][] nextRetain, byte[][][] keep, GMSSLeaf[] nextNextLeaf, GMSSLeaf[] upperLeaf, GMSSLeaf[] upperTreehashLeaf, int[] minTreehash, byte[][] nextRoot, GMSSRootCalc[] nextNextRoot, byte[][] currentRootSig, GMSSRootSig[] nextRootSig, GMSSParameters gmssParameterset) { this.index = index; this.currentSeed = currentSeed; this.nextNextSeed = nextNextSeed; this.currentAuthPath = currentAuthPath; this.nextAuthPath = nextAuthPath; this.currentTreehash = currentTreehash; this.nextTreehash = nextTreehash; this.currentStack = currentStack; this.nextStack = nextStack; this.currentRetain = currentRetain; this.nextRetain = nextRetain; this.keep = keep; this.nextNextLeaf = nextNextLeaf; this.upperLeaf = upperLeaf; this.upperTreehashLeaf = upperTreehashLeaf; this.minTreehash = minTreehash; this.nextRoot = nextRoot; this.nextNextRoot = nextNextRoot; this.currentRootSig = currentRootSig; this.nextRootSig = nextRootSig; this.gmssPS = gmssParameterset; } public int[] getIndex() { return Arrays.clone(index); } public byte[][] getCurrentSeed() { return clone(currentSeed); } public byte[][] getNextNextSeed() { return clone(nextNextSeed); } public byte[][][] getCurrentAuthPath() { return clone(currentAuthPath); } public byte[][][] getNextAuthPath() { return clone(nextAuthPath); } public Treehash[][] getCurrentTreehash() { return clone(currentTreehash); } public Treehash[][] getNextTreehash() { return clone(nextTreehash); } public byte[][][] getKeep() { return clone(keep); } public Vector[] getCurrentStack() { return clone(currentStack); } public Vector[] getNextStack() { return clone(nextStack); } public Vector[][] getCurrentRetain() { return clone(currentRetain); } public Vector[][] getNextRetain() { return clone(nextRetain); } public GMSSLeaf[] getNextNextLeaf() { return clone(nextNextLeaf); } public GMSSLeaf[] getUpperLeaf() { return clone(upperLeaf); } public GMSSLeaf[] getUpperTreehashLeaf() { return clone(upperTreehashLeaf); } public int[] getMinTreehash() { return Arrays.clone(minTreehash); } public GMSSRootSig[] getNextRootSig() { return clone(nextRootSig); } public GMSSParameters getGmssPS() { return gmssPS; } public byte[][] getNextRoot() { return clone(nextRoot); } public GMSSRootCalc[] getNextNextRoot() { return clone(nextNextRoot); } public byte[][] getCurrentRootSig() { return clone(currentRootSig); } private static GMSSLeaf[] clone(GMSSLeaf[] data) { if (data == null) { return null; } GMSSLeaf[] copy = new GMSSLeaf[data.length]; System.arraycopy(data, 0, copy, 0, data.length); return copy; } private static GMSSRootCalc[] clone(GMSSRootCalc[] data) { if (data == null) { return null; } GMSSRootCalc[] copy = new GMSSRootCalc[data.length]; System.arraycopy(data, 0, copy, 0, data.length); return copy; } private static GMSSRootSig[] clone(GMSSRootSig[] data) { if (data == null) { return null; } GMSSRootSig[] copy = new GMSSRootSig[data.length]; System.arraycopy(data, 0, copy, 0, data.length); return copy; } private static byte[][] clone(byte[][] data) { if (data == null) { return null; } byte[][] copy = new byte[data.length][]; for (int i = 0; i != data.length; i++) { copy[i] = Arrays.clone(data[i]); } return copy; } private static byte[][][] clone(byte[][][] data) { if (data == null) { return null; } byte[][][] copy = new byte[data.length][][]; for (int i = 0; i != data.length; i++) { copy[i] = clone(data[i]); } return copy; } private static Treehash[] clone(Treehash[] data) { if (data == null) { return null; } Treehash[] copy = new Treehash[data.length]; System.arraycopy(data, 0, copy, 0, data.length); return copy; } private static Treehash[][] clone(Treehash[][] data) { if (data == null) { return null; } Treehash[][] copy = new Treehash[data.length][]; for (int i = 0; i != data.length; i++) { copy[i] = clone(data[i]); } return copy; } private static Vector[] clone(Vector[] data) { if (data == null) { return null; } Vector[] copy = new Vector[data.length]; for (int i = 0; i != data.length; i++) { copy[i] = new Vector(data[i]); } return copy; } private static Vector[][] clone(Vector[][] data) { if (data == null) { return null; } Vector[][] copy = new Vector[data.length][]; for (int i = 0; i != data.length; i++) { copy[i] = clone(data[i]); } return copy; } }
{ "pile_set_name": "Github" }
using System; using System.Collections.Generic; using System.Runtime.Serialization; using SPMeta2.Definitions.Webparts; using SPMeta2.Models; using SPMeta2.Standard.Definitions.Webparts; using SPMeta2.Syntax.Default; namespace SPMeta2.Standard.Syntax { [Serializable] [DataContract] public class SearchNavigationWebPartModelNode : WebPartModelNode { } public static class SearchNavigationWebPartDefinitionSyntax { #region methods public static TModelNode AddSearchNavigationWebPart<TModelNode>(this TModelNode model, SearchNavigationWebPartDefinition definition) where TModelNode : ModelNode, IWebpartHostModelNode, new() { return AddSearchNavigationWebPart(model, definition, null); } public static TModelNode AddSearchNavigationWebPart<TModelNode>(this TModelNode model, SearchNavigationWebPartDefinition definition, Action<SearchNavigationWebPartModelNode> action) where TModelNode : ModelNode, IWebpartHostModelNode, new() { return model.AddTypedDefinitionNode(definition, action); } #endregion #region array overload public static TModelNode AddSearchNavigationWebParts<TModelNode>(this TModelNode model, IEnumerable<SearchNavigationWebPartDefinition> definitions) where TModelNode : ModelNode, IWebpartHostModelNode, new() { foreach (var definition in definitions) model.AddDefinitionNode(definition); return model; } #endregion } }
{ "pile_set_name": "Github" }
<?xml version="1.0" encoding="utf-8"?> <Project ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003"> <ItemGroup> <Filter Include="Source Files"> <UniqueIdentifier>{4FC737F1-C7A5-4376-A066-2A32D752A2FF}</UniqueIdentifier> <Extensions>cpp;c;cxx;def;odl;idl;hpj;bat;asm;asmx</Extensions> </Filter> <Filter Include="Source Files\Resource Files"> <UniqueIdentifier>{a4f7ce56-a3b0-484e-9fd1-af04e2193152}</UniqueIdentifier> <Extensions>rc;ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe;resx</Extensions> </Filter> <Filter Include="Header Files"> <UniqueIdentifier>{93995380-89BD-4b04-88EB-625FBE52EBFB}</UniqueIdentifier> <Extensions>h;hpp;hxx;hm;inl;inc;xsd</Extensions> </Filter> </ItemGroup> <ItemGroup> <ClCompile Include="Sapphire.cpp"> <Filter>Source Files</Filter> </ClCompile> </ItemGroup> <ItemGroup> <ClInclude Include="Sapphire.h"> <Filter>Header Files</Filter> </ClInclude> </ItemGroup> </Project>
{ "pile_set_name": "Github" }
// RUN: %clang_cc1 -fobjc-runtime-has-weak -fsyntax-only -fobjc-arc -verify -fblocks -Wno-objc-root-class %s // Simple ownership conversions + diagnostics. int &f0(id __strong const *); // expected-note{{candidate function not viable: 1st argument ('__weak id *') has __weak ownership, but parameter has __strong ownership}} void test_f0() { id __strong *sip; id __strong const *csip; id __weak *wip; id __autoreleasing *aip; id __unsafe_unretained *uip; int &ir1 = f0(sip); int &ir2 = f0(csip); int &ir3 = f0(aip); int &ir4 = f0(uip); f0(wip); // expected-error{{no matching function for call to 'f0'}} } // Simple overloading int &f1(id __strong const *); float &f1(id __weak const *); void test_f1() { id __strong *sip; id __strong const *csip; id __weak *wip; id __autoreleasing *aip; id __unsafe_unretained *uip; int &ir1 = f1(sip); int &ir2 = f1(csip); float &fr1 = f1(wip); int &ir3 = f1(aip); int &ir4 = f1(uip); } // Simple overloading int &f2(id __strong const *); // expected-note{{candidate function}} float &f2(id __autoreleasing const *); // expected-note{{candidate function}} void test_f2() { id __strong *sip; id __strong const *csip; id __weak *wip; id __autoreleasing *aip; id __unsafe_unretained *uip; // Prefer non-ownership conversions to ownership conversions. int &ir1 = f2(sip); int &ir2 = f2(csip); float &fr1 = f2(aip); f2(uip); // expected-error{{call to 'f2' is ambiguous}} } // Writeback conversion int &f3(id __autoreleasing *); // expected-note{{candidate function not viable: 1st argument ('__unsafe_unretained id *') has __unsafe_unretained ownership, but parameter has __autoreleasing ownership}} void test_f3() { id __strong sip; id __weak wip; id __autoreleasing aip; id __unsafe_unretained uip; int &ir1 = f3(&sip); int &ir2 = f3(&wip); int &ir3 = f3(&aip); f3(&uip); // expected-error{{no matching function for call to 'f3'}} } // Writeback conversion vs. no conversion int &f4(id __autoreleasing *); float &f4(id __strong *); void test_f4() { id __strong sip; id __weak wip; id __autoreleasing aip; extern __weak id weak_global_ptr; float &fr1 = f4(&sip); int &ir1 = f4(&wip); int &ir2 = f4(&aip); int &ir3 = f4(&weak_global_ptr); // expected-error{{passing address of non-local object to __autoreleasing parameter for write-back}} } // Writeback conversion vs. other conversion. int &f5(id __autoreleasing *); float &f5(id const __unsafe_unretained *); void test_f5() { id __strong sip; id __weak wip; id __autoreleasing aip; int &ir1 = f5(&wip); float &fr1 = f5(&sip); int &ir2 = f5(&aip); } @interface A @end int &f6(id __autoreleasing *); float &f6(id const __unsafe_unretained *); void test_f6() { A* __strong sip; A* __weak wip; A* __autoreleasing aip; int &ir1 = f6(&wip); float &fr1 = f6(&sip); int &ir2 = f6(&aip); } // Reference binding void f7(__strong id&); // expected-note{{candidate function not viable: 1st argument ('__weak id') has __weak ownership, but parameter has __strong ownership}} \ // expected-note{{candidate function not viable: 1st argument ('__autoreleasing id') has __autoreleasing ownership, but parameter has __strong ownership}} \ // expected-note{{candidate function not viable: 1st argument ('__unsafe_unretained id') has __unsafe_unretained ownership, but parameter has __strong ownership}} void test_f7() { __strong id strong_id; __weak id weak_id; __autoreleasing id autoreleasing_id; __unsafe_unretained id unsafe_id; f7(strong_id); f7(weak_id); // expected-error{{no matching function for call to 'f7'}} f7(autoreleasing_id); // expected-error{{no matching function for call to 'f7'}} f7(unsafe_id); // expected-error{{no matching function for call to 'f7'}} } void f8(const __strong id&); void test_f8() { __strong id strong_id; __weak id weak_id; __autoreleasing id autoreleasing_id; __unsafe_unretained id unsafe_id; f8(strong_id); f8(weak_id); f8(autoreleasing_id); f8(unsafe_id); } int &f9(__strong id&); float &f9(const __autoreleasing id&); void test_f9() { __strong id strong_id; __weak id weak_id; __autoreleasing id autoreleasing_id; __unsafe_unretained id unsafe_id; int &ir1 = f9(strong_id); float &fr1 = f9(autoreleasing_id); float &fr2 = f9(unsafe_id); float &fr2a = f9(weak_id); __strong A *strong_a; __weak A *weak_a; __autoreleasing A *autoreleasing_a; __unsafe_unretained A *unsafe_unretained_a; float &fr3 = f9(strong_a); float &fr4 = f9(autoreleasing_a); float &fr5 = f9(unsafe_unretained_a); float &fr6 = f9(weak_a); const __autoreleasing id& ar1 = strong_a; const __autoreleasing id& ar2 = autoreleasing_a; const __autoreleasing id& ar3 = unsafe_unretained_a; const __autoreleasing id& ar4 = weak_a; } // rdar://9790531 void f9790531(void *inClientData); // expected-note {{candidate function not viable: cannot implicitly convert argument of type 'MixerEQGraphTestDelegate *const __strong' to 'void *' for 1st argument under ARC}} void f9790531_1(struct S*inClientData); // expected-note {{candidate function not viable}} void f9790531_2(char * inClientData); // expected-note {{candidate function not viable}} @class UIApplication; @interface MixerEQGraphTestDelegate - (void)applicationDidFinishLaunching; @end @implementation MixerEQGraphTestDelegate - (void)applicationDidFinishLaunching { f9790531(self); // expected-error {{no matching function for call to 'f9790531'}} f9790531_1(self); // expected-error {{no matching function for call to 'f9790531_1'}} f9790531_2(self); // expected-error {{no matching function for call to 'f9790531_2'}} } @end class rdar10142572 { id f() __attribute__((ns_returns_retained)); id g(); // expected-note{{previous declaration}} }; id rdar10142572::f() { return 0; } // okay: merged down id __attribute__((ns_returns_retained)) rdar10142572::g() { return 0; } // expected-error{{function declared with 'ns_returns_retained' attribute was previously declared without the 'ns_returns_retained' attribute}}
{ "pile_set_name": "Github" }
<?xml version="1.0" encoding="UTF-8"?> <project version="4"> <component name="ProjectCodeStyleSettingsManager"> <option name="PER_PROJECT_SETTINGS"> <value> <option name="FIELD_NAME_PREFIX" value="m" /> <option name="STATIC_FIELD_NAME_PREFIX" value="s" /> <option name="CLASS_COUNT_TO_USE_IMPORT_ON_DEMAND" value="9999" /> <option name="NAMES_COUNT_TO_USE_IMPORT_ON_DEMAND" value="9999" /> <option name="IMPORT_LAYOUT_TABLE"> <value> <package name="android" withSubpackages="true" static="true" /> <emptyLine /> <package name="com.android" withSubpackages="true" static="true" /> <emptyLine /> <package name="dalvik" withSubpackages="true" static="true" /> <emptyLine /> <package name="libcore" withSubpackages="true" static="true" /> <emptyLine /> <package name="com" withSubpackages="true" static="true" /> <emptyLine /> <package name="gov" withSubpackages="true" static="true" /> <emptyLine /> <package name="junit" withSubpackages="true" static="true" /> <emptyLine /> <package name="net" withSubpackages="true" static="true" /> <emptyLine /> <package name="org" withSubpackages="true" static="true" /> <emptyLine /> <package name="java" withSubpackages="true" static="true" /> <emptyLine /> <package name="javax" withSubpackages="true" static="true" /> <emptyLine /> <package name="" withSubpackages="true" static="true" /> <emptyLine /> <package name="android" withSubpackages="true" static="false" /> <emptyLine /> <package name="com.android" withSubpackages="true" static="false" /> <emptyLine /> <package name="dalvik" withSubpackages="true" static="false" /> <emptyLine /> <package name="libcore" withSubpackages="true" static="false" /> <emptyLine /> <package name="com" withSubpackages="true" static="false" /> <emptyLine /> <package name="gov" withSubpackages="true" static="false" /> <emptyLine /> <package name="junit" withSubpackages="true" static="false" /> <emptyLine /> <package name="net" withSubpackages="true" static="false" /> <emptyLine /> <package name="org" withSubpackages="true" static="false" /> <emptyLine /> <package name="java" withSubpackages="true" static="false" /> <emptyLine /> <package name="javax" withSubpackages="true" static="false" /> <emptyLine /> <package name="" withSubpackages="true" static="false" /> </value> </option> <option name="RIGHT_MARGIN" value="100" /> <option name="JD_P_AT_EMPTY_LINES" value="false" /> <option name="JD_DO_NOT_WRAP_ONE_LINE_COMMENTS" value="true" /> <option name="JD_KEEP_EMPTY_PARAMETER" value="false" /> <option name="JD_KEEP_EMPTY_EXCEPTION" value="false" /> <option name="JD_KEEP_EMPTY_RETURN" value="false" /> <option name="JD_PRESERVE_LINE_FEEDS" value="true" /> <option name="KEEP_CONTROL_STATEMENT_IN_ONE_LINE" value="false" /> <option name="KEEP_BLANK_LINES_IN_CODE" value="1" /> <option name="BLANK_LINES_AROUND_FIELD" value="1" /> <option name="BLANK_LINES_AFTER_CLASS_HEADER" value="1" /> <option name="ALIGN_MULTILINE_PARAMETERS" value="false" /> <option name="ALIGN_MULTILINE_FOR" value="false" /> <option name="CALL_PARAMETERS_WRAP" value="1" /> <option name="METHOD_PARAMETERS_WRAP" value="1" /> <option name="EXTENDS_LIST_WRAP" value="1" /> <option name="THROWS_LIST_WRAP" value="1" /> <option name="EXTENDS_KEYWORD_WRAP" value="1" /> <option name="THROWS_KEYWORD_WRAP" value="1" /> <option name="METHOD_CALL_CHAIN_WRAP" value="1" /> <option name="BINARY_OPERATION_WRAP" value="1" /> <option name="BINARY_OPERATION_SIGN_ON_NEXT_LINE" value="true" /> <option name="TERNARY_OPERATION_WRAP" value="1" /> <option name="TERNARY_OPERATION_SIGNS_ON_NEXT_LINE" value="true" /> <option name="FOR_STATEMENT_WRAP" value="1" /> <option name="ARRAY_INITIALIZER_WRAP" value="1" /> <option name="ASSIGNMENT_WRAP" value="1" /> <option name="PLACE_ASSIGNMENT_SIGN_ON_NEXT_LINE" value="true" /> <option name="WRAP_COMMENTS" value="true" /> <option name="IF_BRACE_FORCE" value="3" /> <option name="DOWHILE_BRACE_FORCE" value="3" /> <option name="WHILE_BRACE_FORCE" value="3" /> <option name="FOR_BRACE_FORCE" value="3" /> <Objective-C-extensions> <option name="GENERATE_INSTANCE_VARIABLES_FOR_PROPERTIES" value="ASK" /> <option name="RELEASE_STYLE" value="IVAR" /> <option name="TYPE_QUALIFIERS_PLACEMENT" value="BEFORE" /> <file> <option name="com.jetbrains.cidr.lang.util.OCDeclarationKind" value="Import" /> <option name="com.jetbrains.cidr.lang.util.OCDeclarationKind" value="Macro" /> <option name="com.jetbrains.cidr.lang.util.OCDeclarationKind" value="Typedef" /> <option name="com.jetbrains.cidr.lang.util.OCDeclarationKind" value="Enum" /> <option name="com.jetbrains.cidr.lang.util.OCDeclarationKind" value="Constant" /> <option name="com.jetbrains.cidr.lang.util.OCDeclarationKind" value="Global" /> <option name="com.jetbrains.cidr.lang.util.OCDeclarationKind" value="Struct" /> <option name="com.jetbrains.cidr.lang.util.OCDeclarationKind" value="FunctionPredecl" /> <option name="com.jetbrains.cidr.lang.util.OCDeclarationKind" value="Function" /> </file> <class> <option name="com.jetbrains.cidr.lang.util.OCDeclarationKind" value="Property" /> <option name="com.jetbrains.cidr.lang.util.OCDeclarationKind" value="Synthesize" /> <option name="com.jetbrains.cidr.lang.util.OCDeclarationKind" value="InitMethod" /> <option name="com.jetbrains.cidr.lang.util.OCDeclarationKind" value="StaticMethod" /> <option name="com.jetbrains.cidr.lang.util.OCDeclarationKind" value="InstanceMethod" /> <option name="com.jetbrains.cidr.lang.util.OCDeclarationKind" value="DeallocMethod" /> </class> <extensions> <pair source="cpp" header="h" /> <pair source="c" header="h" /> </extensions> </Objective-C-extensions> <XML> <option name="XML_LEGACY_SETTINGS_IMPORTED" value="true" /> </XML> <ADDITIONAL_INDENT_OPTIONS fileType="java"> <option name="TAB_SIZE" value="8" /> </ADDITIONAL_INDENT_OPTIONS> <ADDITIONAL_INDENT_OPTIONS fileType="js"> <option name="CONTINUATION_INDENT_SIZE" value="4" /> </ADDITIONAL_INDENT_OPTIONS> <codeStyleSettings language="JAVA"> <option name="ALIGN_MULTILINE_PARAMETERS" value="false" /> <option name="ALIGN_MULTILINE_FOR" value="false" /> <option name="CALL_PARAMETERS_WRAP" value="1" /> <option name="PREFER_PARAMETERS_WRAP" value="true" /> <option name="METHOD_PARAMETERS_WRAP" value="1" /> <option name="RESOURCE_LIST_WRAP" value="1" /> <option name="EXTENDS_LIST_WRAP" value="1" /> <option name="THROWS_LIST_WRAP" value="1" /> <option name="THROWS_KEYWORD_WRAP" value="1" /> <option name="BINARY_OPERATION_WRAP" value="1" /> <option name="BINARY_OPERATION_SIGN_ON_NEXT_LINE" value="true" /> <option name="TERNARY_OPERATION_WRAP" value="1" /> <option name="TERNARY_OPERATION_SIGNS_ON_NEXT_LINE" value="true" /> <option name="FOR_STATEMENT_WRAP" value="1" /> <option name="ARRAY_INITIALIZER_WRAP" value="1" /> <option name="ASSIGNMENT_WRAP" value="1" /> <option name="IF_BRACE_FORCE" value="1" /> <option name="DOWHILE_BRACE_FORCE" value="1" /> <option name="WHILE_BRACE_FORCE" value="1" /> <option name="FOR_BRACE_FORCE" value="1" /> <option name="WRAP_LONG_LINES" value="true" /> </codeStyleSettings> <codeStyleSettings language="XML"> <option name="FORCE_REARRANGE_MODE" value="1" /> <indentOptions> <option name="CONTINUATION_INDENT_SIZE" value="4" /> </indentOptions> <arrangement> <rules> <section> <rule> <match> <AND> <NAME>xmlns:android</NAME> <XML_NAMESPACE>^$</XML_NAMESPACE> </AND> </match> </rule> </section> <section> <rule> <match> <AND> <NAME>xmlns:.*</NAME> <XML_NAMESPACE>^$</XML_NAMESPACE> </AND> </match> <order>BY_NAME</order> </rule> </section> <section> <rule> <match> <AND> <NAME>.*:id</NAME> <XML_NAMESPACE>http://schemas.android.com/apk/res/android</XML_NAMESPACE> </AND> </match> </rule> </section> <section> <rule> <match> <AND> <NAME>.*:name</NAME> <XML_NAMESPACE>http://schemas.android.com/apk/res/android</XML_NAMESPACE> </AND> </match> </rule> </section> <section> <rule> <match> <AND> <NAME>name</NAME> <XML_NAMESPACE>^$</XML_NAMESPACE> </AND> </match> </rule> </section> <section> <rule> <match> <AND> <NAME>style</NAME> <XML_NAMESPACE>^$</XML_NAMESPACE> </AND> </match> </rule> </section> <section> <rule> <match> <AND> <NAME>.*</NAME> <XML_NAMESPACE>^$</XML_NAMESPACE> </AND> </match> <order>BY_NAME</order> </rule> </section> <section> <rule> <match> <AND> <NAME>.*:layout_width</NAME> <XML_NAMESPACE>http://schemas.android.com/apk/res/android</XML_NAMESPACE> </AND> </match> </rule> </section> <section> <rule> <match> <AND> <NAME>.*:layout_height</NAME> <XML_NAMESPACE>http://schemas.android.com/apk/res/android</XML_NAMESPACE> </AND> </match> </rule> </section> <section> <rule> <match> <AND> <NAME>.*:layout_.*</NAME> <XML_NAMESPACE>http://schemas.android.com/apk/res/android</XML_NAMESPACE> </AND> </match> <order>BY_NAME</order> </rule> </section> <section> <rule> <match> <AND> <NAME>.*:width</NAME> <XML_NAMESPACE>http://schemas.android.com/apk/res/android</XML_NAMESPACE> </AND> </match> <order>BY_NAME</order> </rule> </section> <section> <rule> <match> <AND> <NAME>.*:height</NAME> <XML_NAMESPACE>http://schemas.android.com/apk/res/android</XML_NAMESPACE> </AND> </match> <order>BY_NAME</order> </rule> </section> <section> <rule> <match> <AND> <NAME>.*</NAME> <XML_NAMESPACE>http://schemas.android.com/apk/res/android</XML_NAMESPACE> </AND> </match> <order>BY_NAME</order> </rule> </section> <section> <rule> <match> <AND> <NAME>.*</NAME> <XML_NAMESPACE>.*</XML_NAMESPACE> </AND> </match> <order>BY_NAME</order> </rule> </section> </rules> </arrangement> </codeStyleSettings> </value> </option> <option name="USE_PER_PROJECT_SETTINGS" value="true" /> <option name="PREFERRED_PROJECT_CODE_STYLE" value="AndroidStyle" /> </component> </project>
{ "pile_set_name": "Github" }
# Be sure to restart your server when you modify this file. Ppwm::Application.config.session_store :cookie_store, key: '_ppwm_session' # Use the database for sessions instead of the cookie-based default, # which shouldn't be used to store highly confidential information # (create the session table with "rails generate session_migration") # Ppwm::Application.config.session_store :active_record_store
{ "pile_set_name": "Github" }
/* Copyright 2016 The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. */ package fake import ( authorizationapi "k8s.io/api/authorization/v1beta1" core "k8s.io/client-go/testing" ) func (c *FakeSelfSubjectAccessReviews) Create(sar *authorizationapi.SelfSubjectAccessReview) (result *authorizationapi.SelfSubjectAccessReview, err error) { obj, err := c.Fake.Invokes(core.NewRootCreateAction(authorizationapi.SchemeGroupVersion.WithResource("selfsubjectaccessreviews"), sar), &authorizationapi.SelfSubjectAccessReview{}) return obj.(*authorizationapi.SelfSubjectAccessReview), err }
{ "pile_set_name": "Github" }
/?sign=a...............* HTTP/4.8
{ "pile_set_name": "Github" }
<?xml version="1.0"?> <ZopeData> <record id="1" aka="AAAAAAAAAAE="> <pickle> <global name="ProxyField" module="Products.ERP5Form.ProxyField"/> </pickle> <pickle> <dictionary> <item> <key> <string>delegated_list</string> </key> <value> <list> <string>default</string> <string>enabled</string> <string>items</string> <string>title</string> </list> </value> </item> <item> <key> <string>id</string> </key> <value> <string>your_report_sale_opportunity_state</string> </value> </item> <item> <key> <string>message_values</string> </key> <value> <dictionary> <item> <key> <string>external_validator_failed</string> </key> <value> <string>The input failed the external validator.</string> </value> </item> </dictionary> </value> </item> <item> <key> <string>overrides</string> </key> <value> <dictionary> <item> <key> <string>field_id</string> </key> <value> <string></string> </value> </item> <item> <key> <string>form_id</string> </key> <value> <string></string> </value> </item> <item> <key> <string>target</string> </key> <value> <string></string> </value> </item> </dictionary> </value> </item> <item> <key> <string>tales</string> </key> <value> <dictionary> <item> <key> <string>default</string> </key> <value> <persistent> <string encoding="base64">AAAAAAAAAAI=</string> </persistent> </value> </item> <item> <key> <string>enabled</string> </key> <value> <persistent> <string encoding="base64">AAAAAAAAAAM=</string> </persistent> </value> </item> <item> <key> <string>field_id</string> </key> <value> <string></string> </value> </item> <item> <key> <string>form_id</string> </key> <value> <string></string> </value> </item> <item> <key> <string>items</string> </key> <value> <persistent> <string encoding="base64">AAAAAAAAAAQ=</string> </persistent> </value> </item> <item> <key> <string>target</string> </key> <value> <string></string> </value> </item> <item> <key> <string>title</string> </key> <value> <string></string> </value> </item> </dictionary> </value> </item> <item> <key> <string>values</string> </key> <value> <dictionary> <item> <key> <string>default</string> </key> <value> <list/> </value> </item> <item> <key> <string>enabled</string> </key> <value> <int>1</int> </value> </item> <item> <key> <string>field_id</string> </key> <value> <string>your_category_list</string> </value> </item> <item> <key> <string>form_id</string> </key> <value> <string>Base_viewDialogFieldLibrary</string> </value> </item> <item> <key> <string>items</string> </key> <value> <list/> </value> </item> <item> <key> <string>target</string> </key> <value> <string>Click to edit the target</string> </value> </item> <item> <key> <string>title</string> </key> <value> <string>State</string> </value> </item> </dictionary> </value> </item> </dictionary> </pickle> </record> <record id="2" aka="AAAAAAAAAAI="> <pickle> <global name="TALESMethod" module="Products.Formulator.TALESField"/> </pickle> <pickle> <dictionary> <item> <key> <string>_text</string> </key> <value> <string>request/sale_opportunity_state</string> </value> </item> </dictionary> </pickle> </record> <record id="3" aka="AAAAAAAAAAM="> <pickle> <global name="TALESMethod" module="Products.Formulator.TALESField"/> </pickle> <pickle> <dictionary> <item> <key> <string>_text</string> </key> <value> <string>request/sale_opportunity_state | nothing</string> </value> </item> </dictionary> </pickle> </record> <record id="4" aka="AAAAAAAAAAQ="> <pickle> <global name="TALESMethod" module="Products.Formulator.TALESField"/> </pickle> <pickle> <dictionary> <item> <key> <string>_text</string> </key> <value> <string>python: context.ERP5Site_getWorkflowStateItemList(portal_type=\'Sale Opportunity\', state_var=\'validation_state\')</string> </value> </item> </dictionary> </pickle> </record> </ZopeData>
{ "pile_set_name": "Github" }
CONFIGURATION_BUILD_DIR = ${PODS_CONFIGURATION_BUILD_DIR}/RNGestureHandler GCC_PREPROCESSOR_DEFINITIONS = $(inherited) COCOAPODS=1 HEADER_SEARCH_PATHS = $(inherited) "${PODS_ROOT}/Headers/Private" "${PODS_ROOT}/Headers/Private/RNGestureHandler" "${PODS_ROOT}/Headers/Public" "${PODS_ROOT}/Headers/Public/DoubleConversion" "${PODS_ROOT}/Headers/Public/RNGestureHandler" "${PODS_ROOT}/Headers/Public/React-Core" "${PODS_ROOT}/Headers/Public/React-RCTBlob" "${PODS_ROOT}/Headers/Public/React-RCTText" "${PODS_ROOT}/Headers/Public/React-cxxreact" "${PODS_ROOT}/Headers/Public/React-jsi" "${PODS_ROOT}/Headers/Public/React-jsiexecutor" "${PODS_ROOT}/Headers/Public/React-jsinspector" "${PODS_ROOT}/Headers/Public/Yoga" "${PODS_ROOT}/Headers/Public/glog" PODS_BUILD_DIR = ${BUILD_DIR} PODS_CONFIGURATION_BUILD_DIR = ${PODS_BUILD_DIR}/$(CONFIGURATION)$(EFFECTIVE_PLATFORM_NAME) PODS_ROOT = ${SRCROOT} PODS_TARGET_SRCROOT = ${PODS_ROOT}/../../node_modules/react-native-gesture-handler PRODUCT_BUNDLE_IDENTIFIER = org.cocoapods.${PRODUCT_NAME:rfc1034identifier} SKIP_INSTALL = YES USE_RECURSIVE_SCRIPT_INPUTS_IN_SCRIPT_PHASES = YES
{ "pile_set_name": "Github" }
# The CAP FAQ ## 0. What is this document? No subject appears to be more controversial to distributed systems engineers than the oft-quoted, oft-misunderstood CAP theorem. The purpose of this FAQ is to explain what is known about CAP, so as to help those new to the theorem get up to speed quickly, and to settle some common misconceptions or points of disagreement. Of course, there's every possibility I've made superficial or completely thorough mistakes here. Corrections and comments are welcome: <a href="mailto:[email protected]">let me have them</a>. There are some questions I still intend to answer. For example * *What's the relationship between CAP and performance?* * *What does CAP mean to me as an engineer?* * *What's the relationship between CAP and ACID?* Please suggest more. ## 1. Where did the CAP Theorem come from? Dr. Eric Brewer gave a keynote speech at the Principles of Distributed Computing conference in 2000 called 'Towards Robust Distributed Systems' [1]. In it he posed his 'CAP Theorem' - at the time unproven - which illustrated the tensions between being correct and being always available in distributed systems. Two years later, Seth Gilbert and Professor Nancy Lynch - researchers in distributed systems at MIT - formalised and proved the conjecture in their paper “Brewer's conjecture and the feasibility of consistent, available, partition-tolerant web services” [2]. [1] http://www.cs.berkeley.edu/~brewer/cs262b-2004/PODC-keynote.pdf [2] http://lpd.epfl.ch/sgilbert/pubs/BrewersConjecture-SigAct.pdf ## 2. What does the CAP Theorem actually say? The CAP Theorem (henceforth 'CAP') says that it is impossible to build an implementation of read-write storage in an asynchronous network that satisfies all of the following three properties: * Availability - will a request made to the data store always eventually complete? * Consistency - will all executions of reads and writes seen by all nodes be _atomic_ or _linearizably_ consistent? * Partition tolerance - the network is allowed to drop any messages. The next few items define any unfamiliar terms. More informally, the CAP theorem tells us that we can't build a database that both responds to every request and returns the results that you would expect every time. It's an _impossibility_ result - it tells us that something we might want to do is actually provably out of reach. It's important now because it is directly applicable to the many, many distributed systems which have been and are being built in the last few years, but it is not a death knell: it does _not_ mean that we cannot build useful systems while working within these constraints. The devil is in the details however. Before you start crying 'yes, but what about...', make sure you understand the following about exactly what the CAP theorem does and does not allow. ## 3. What is 'read-write storage'? CAP specifically concerns itself with a theoretical construct called a _register_. A register is a data structure with two operations: * set(X) sets the value of the register to X * get() returns the last value set in the register A key-value store can be modelled as a collection of registers. Even though registers appear very simple, they capture the essence of what many distributed systems want to do - write data and read it back. ## 4. What does _atomic_ (or _linearizable_) mean? Atomic, or linearizable, consistency is a guarantee about what values it's ok to return when a client performs get() operations. The idea is that the register appears to all clients as though it ran on just one machine, and responded to operations in the order they arrive. Consider an execution consisting the total set of operations performed by all clients, potentially concurrently. The results of those operations must, under atomic consistency, be equivalent to a single serial (in order, one after the other) execution of all operations. This guarantee is very strong. It rules out, amongst other guarantees, _eventual consistency_, which allows a delay before a write becomes visible. So under EC, you might have: set(10), set(5), get() = 10 But this execution is invalid under atomic consistency. Atomic consistency also ensures that external communication about the value of a register is respected. That is, if I read X and tell you about it, you can go to the register and read X for yourself. It's possible under slightly weaker guarantees (_serializability_ for example) for that not to be true. In the following we write A:<set or get> to mean that client A executes the following operation. B:set(5), A:set(10), A:get() = 10, B:get() = 10 This is an atomic history. But the following is not: B:set(5), A:set(10), A:get() = 10, B:get() = 5 even though it is equivalent to the following serial history: B:set(5), B:get() = 5, A:set(10), A:get() = 10 In the second example, if A tells B about the value of the register (10) after it does its get(), B will falsely believe that some third-party has written 5 between A:get() and B:get(). If external communication isn't allowed, B cannot know about A:set, and so sees a consistent view of the register state; it's as if B:get really did happen before A:set. Wikipedia [1] has more information. Maurice Herlihy's original paper from 1990 is available at [2]. [1] http://en.wikipedia.org/wiki/Linearizability [2] http://cs.brown.edu/~mph/HerlihyW90/p463-herlihy.pdf ## 5. What does _asynchronous_ mean? An _asynchronous_ network is one in which there is no bound on how long messages may take to be delivered by the network or processed by a machine. The important consequence of this property is that there's no way to distinguish between a machine that has failed, and one whose messages are getting delayed. ## 6. What does _available_ mean? A data store is available if and only if all get and set requests eventually return a response that's part of their specification. This does _not_ permit error responses, since a system could be trivially available by always returning an error. There is no requirement for a fixed time bound on the response, so the system can take as long as it likes to process a request. But the system must eventually respond. Notice how this is both a strong and a weak requirement. It's strong because 100% of the requests must return a response (there's no 'degree of availability' here), but weak because the response can take an unbounded (but finite) amount of time. ## 7. What is a _partition_? A partition is when the network fails to deliver some messages to one or more nodes by losing them (not by delaying them - eventual delivery is not a partition). The term is sometimes used to refer to a period during which _no_ messages are delivered between two sets of nodes. This is a more restrictive failure model. We'll call these kinds of partitions _total partitions_. The proof of CAP relied on a total partition. In practice, these are arguably the most likely since all messages may flow through one component; if that fails then message loss is usually total between two nodes. ## 8. Why is CAP true? The basic idea is that if a client writes to one side of a partition, any reads that go to the other side of that partition can't possibly know about the most recent write. Now you're faced with a choice: do you respond to the reads with potentially stale information, or do you wait (potentially forever) to hear from the other side of the partition and compromise availability? This is a proof by _construction_ - we demonstrate a single situation where a system cannot be consistent and available. One reason that CAP gets some press is that this constructed scenario is not completely unrealistic. It is not uncommon for a total partition to occur if networking equipment should fail. ## 9. When does a system have to give up C or A? CAP only guarantees that there is _some_ circumstance in which a system must give up either C or A. Let's call that circumstance a _critical condition_. The theorem doesn't say anything about how likely that critical condition is. Both C and A are strong guarantees: they hold only if 100% of operations meet their requirements. A single inconsistent read, or unavailable write, invalidates either C or A. But until that critical condition is met, a system can be happily consistent _and_ available and not contravene any known laws. Since most distributed systems are long running, and may see millions of requests in their lifetime, CAP tells us to be cautious: there's a good chance that you'll realistically hit one of these critical conditions, and it's prudent to understand how your system will fail to meet either C or A. ## 10. Why do some people get annoyed when I characterise my system as CA? Brewer's keynote, the Gilbert paper, and many other treatments, places C, A and P on an equal footing as desirable properties of an implementation and effectively say 'choose two!'. However, this is often considered to be a misleading presentation, since you cannot build - or choose! - 'partition tolerance': your system either might experience partitions or it won't. CAP is better understood as describing the tradeoffs you have to make when you are building a system that may suffer partitions. In practice, this is every distributed system: there is no 100% reliable network. So (at least in the distributed context) there is no realistic CA system. You will potentially suffer partitions, therefore you must at some point compromise C or A. Therefore it's arguably more instructive to rewrite the theorem as the following: <pre>Possibility of Partitions => Not (C and A)</pre> i.e. if your system may experience partitions, you can not always be C and A. There are some systems that won't experience partitions - single-site databases, for example. These systems aren't generally relevant to the contexts in which CAP is most useful. If you describe your distributed database as 'CA', you are misunderstanding something. ## 11. What about when messages don't get lost? A perhaps surprising result from the Gilbert paper is that no implementation of an atomic register in an asynchronous network can be available at all times, and consistent only when no messages are lost. This result depends upon the asynchronous network property, the idea being that it is impossible to tell if a message has been dropped and therefore a node cannot wait indefinitely for a response while still maintaining availability, however if it responds too early it might be inconsistent. ## 12. Is my network really asynchronous? Arguably, yes. Different networks have vastly differing characteristics. If * Your nodes do not have clocks (unlikely) or they have clocks that may drift apart (more likely) * System processes may arbitrarily delay delivery of a message (due to retries, or GC pauses) then your network may be considered _asynchronous_. Gilbert and Lynch also proved that in a _partially-synchronous_ system, where nodes have shared but not synchronised clocks and there is a bound on the processing time of every message, that it is still impossible to implement available atomic storage. However, the result from #8 does _not_ hold in the partially-synchronous model; it is possible to implement atomic storage that is available all the time, and consistent when all messages are delivered. ## 13. What, if any, is the relationship between FLP and CAP? The Fischer, Lynch and Patterson theorem ('FLP') (see [1] for a link to the paper and a proof explanation) is an extraordinary impossibility result from nearly thirty years ago, which determined that the problem of consensus - having all nodes agree on a common value - is unsolvable in general in asynchronous networks where one node might fail. The FLP result is not directly related to CAP, although they are similar in some respects. Both are impossibility results about problems that may not be solved in distributed systems. The devil is in the details. Here are some of the ways in which FLP is different from CAP: * FLP permits the possibility of one 'failed' node which is totally partitioned from the network and does not have to respond to requests. * Otherwise, FLP does not allow message loss; the network is only asynchronous but not lossy. * FLP deals with _consensus_, which is a similar but different problem to _atomic storage_. For a bit more on this topic, consult the blog post at [2]. [1] http://the-paper-trail.org/blog/a-brief-tour-of-flp-impossibility/ [2] http://the-paper-trail.org/blog/flp-and-cap-arent-the-same-thing/ ## 14. Are C and A 'spectrums'? It is possible to relax both consistency and availability guarantees from the strong requirements that CAP imposes and get useful systems. In fact, the whole point of CAP is that you _must_ do this, and any system you have designed and built relaxes one or both of these guarantees. The onus is on you to figure out when, and how, this occurs. Real systems choose to relax availability - in the case of systems for whom consistency is of the utmost importance, like ZooKeeper. Other systems, like Amazon's Dynamo, relax consistency in order to maintain high degrees of availability. Once you weaken any of the assumptions made in the statement or proof of CAP, you have to start again when it comes to proving an impossibility result. ## 15. Is a failed machine the same as a partitioned one? No. A 'failed' machine is usually excused the burden of having to respond to client requests. CAP does not allow any machines to fail (in that sense it is a strong result, since it shows impossibility without having any machines fail). It is possible to prove a similar result about the impossibility of atomic storage in an asynchronous network when there are up to N-1 failures. This result has ramifications about the tradeoff between how many nodes you write to (which is a performance concern) and how fault tolerant you are (which is a reliability concern). ## 16. Is a slow machine the same as a partitioned one? No: messages eventually get delivered to a slow machine, but they never get delivered to a totally partitioned one. However, slow machines play a significant role in making it very hard to distinguish between lost messages (or failed machines) and a slow machine. This difficulty is right at the heart of why CAP, FLP and other results are true. ## 17. Have I 'got around' or 'beaten' the CAP theorem? No. You might have designed a system that is not heavily affected by it. That's good.
{ "pile_set_name": "Github" }
<?php /** * Smarty plugin * * @package Smarty * @subpackage PluginsModifierCompiler */ /** * Smarty escape modifier plugin * Type: modifier * Name: escape * Purpose: escape string for output * * @link http://www.smarty.net/docsv2/en/language.modifier.escape count_characters (Smarty online manual) * @author Rodney Rehm * * @param array $params parameters * @param Smarty_Internal_TemplateCompilerBase $compiler * * @return string with compiled code * @throws \SmartyException */ function smarty_modifiercompiler_escape($params, Smarty_Internal_TemplateCompilerBase $compiler) { static $_double_encode = null; static $is_loaded = false; $compiler->template->_checkPlugins( array( array( 'function' => 'smarty_literal_compiler_param', 'file' => SMARTY_PLUGINS_DIR . 'shared.literal_compiler_param.php' ) ) ); if ($_double_encode === null) { $_double_encode = version_compare(PHP_VERSION, '5.2.3', '>='); } try { $esc_type = smarty_literal_compiler_param($params, 1, 'html'); $char_set = smarty_literal_compiler_param($params, 2, Smarty::$_CHARSET); $double_encode = smarty_literal_compiler_param($params, 3, true); if (!$char_set) { $char_set = Smarty::$_CHARSET; } switch ($esc_type) { case 'html': if ($_double_encode) { return 'htmlspecialchars(' . $params[ 0 ] . ', ENT_QUOTES, ' . var_export($char_set, true) . ', ' . var_export($double_encode, true) . ')'; } elseif ($double_encode) { return 'htmlspecialchars(' . $params[ 0 ] . ', ENT_QUOTES, ' . var_export($char_set, true) . ')'; } else { // fall back to modifier.escape.php } // no break case 'htmlall': if (Smarty::$_MBSTRING) { if ($_double_encode) { // php >=5.2.3 - go native return 'mb_convert_encoding(htmlspecialchars(' . $params[ 0 ] . ', ENT_QUOTES, ' . var_export($char_set, true) . ', ' . var_export($double_encode, true) . '), "HTML-ENTITIES", ' . var_export($char_set, true) . ')'; } elseif ($double_encode) { // php <5.2.3 - only handle double encoding return 'mb_convert_encoding(htmlspecialchars(' . $params[ 0 ] . ', ENT_QUOTES, ' . var_export($char_set, true) . '), "HTML-ENTITIES", ' . var_export($char_set, true) . ')'; } else { // fall back to modifier.escape.php } } // no MBString fallback if ($_double_encode) { // php >=5.2.3 - go native return 'htmlentities(' . $params[ 0 ] . ', ENT_QUOTES, ' . var_export($char_set, true) . ', ' . var_export($double_encode, true) . ')'; } elseif ($double_encode) { // php <5.2.3 - only handle double encoding return 'htmlentities(' . $params[ 0 ] . ', ENT_QUOTES, ' . var_export($char_set, true) . ')'; } else { // fall back to modifier.escape.php } // no break case 'url': return 'rawurlencode(' . $params[ 0 ] . ')'; case 'urlpathinfo': return 'str_replace("%2F", "/", rawurlencode(' . $params[ 0 ] . '))'; case 'quotes': // escape unescaped single quotes return 'preg_replace("%(?<!\\\\\\\\)\'%", "\\\'",' . $params[ 0 ] . ')'; case 'javascript': // escape quotes and backslashes, newlines, etc. return 'strtr(' . $params[ 0 ] . ', array("\\\\" => "\\\\\\\\", "\'" => "\\\\\'", "\"" => "\\\\\"", "\\r" => "\\\\r", "\\n" => "\\\n", "</" => "<\/" ))'; } } catch (SmartyException $e) { // pass through to regular plugin fallback } // could not optimize |escape call, so fallback to regular plugin if ($compiler->template->caching && ($compiler->tag_nocache | $compiler->nocache)) { $compiler->required_plugins[ 'nocache' ][ 'escape' ][ 'modifier' ][ 'file' ] = SMARTY_PLUGINS_DIR . 'modifier.escape.php'; $compiler->required_plugins[ 'nocache' ][ 'escape' ][ 'modifier' ][ 'function' ] = 'smarty_modifier_escape'; } else { $compiler->required_plugins[ 'compiled' ][ 'escape' ][ 'modifier' ][ 'file' ] = SMARTY_PLUGINS_DIR . 'modifier.escape.php'; $compiler->required_plugins[ 'compiled' ][ 'escape' ][ 'modifier' ][ 'function' ] = 'smarty_modifier_escape'; } return 'smarty_modifier_escape(' . join(', ', $params) . ')'; }
{ "pile_set_name": "Github" }
version https://git-lfs.github.com/spec/v1 oid sha256:97b401d550a953c1b42148b0877223c0bb10c7e642738be9a3403019ca2e8877 size 6755
{ "pile_set_name": "Github" }
// Copyright 2013-2020 Dirk Lemstra <https://github.com/dlemstra/Magick.NET/> // // Licensed under the ImageMagick License (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.imagemagick.org/script/license.php // // 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. using ImageMagick; using Microsoft.VisualStudio.TestTools.UnitTesting; namespace Magick.NET.Tests { public partial class MagickImageTests { [TestClass] public class TheAdaptiveResizeMethod { [TestMethod] public void ShouldNotEnlargeTheImage() { using (var image = new MagickImage(MagickColors.Black, 512, 1)) { image.AdaptiveResize(512, 512); Assert.AreEqual(1, image.Height); } } [TestMethod] public void ShouldEnlargeTheImageWhenAspectRatioIsIgnored() { using (var image = new MagickImage(MagickColors.Black, 512, 1)) { var geometry = new MagickGeometry(512, 512) { IgnoreAspectRatio = true, }; image.AdaptiveResize(geometry); Assert.AreEqual(512, image.Height); } } [TestMethod] public void ShouldResizeTheImage() { using (var image = new MagickImage(Files.MagickNETIconPNG)) { image.AdaptiveResize(100, 80); Assert.AreEqual(80, image.Width); Assert.AreEqual(80, image.Height); ColorAssert.AreEqual(new MagickColor("#347bbd"), image, 23, 42); ColorAssert.AreEqual(new MagickColor("#a8dff8"), image, 42, 42); } } } } }
{ "pile_set_name": "Github" }
.header { background: $m-primary-color; color: $white; height: $tablayout-menu-height; text-align: center; .is-icon-only{ font-size: $m-header-icon-only-font-size; } }
{ "pile_set_name": "Github" }
<?xml version="1.0" encoding="UTF-8"?> <project version="4"> <component name="ProjectModuleManager"> <modules> <module fileurl="file://$PROJECT_DIR$/flutter_jpush_example.iml" filepath="$PROJECT_DIR$/flutter_jpush_example.iml" /> <module fileurl="file://$PROJECT_DIR$/flutter_jpush_example_android.iml" filepath="$PROJECT_DIR$/flutter_jpush_example_android.iml" /> </modules> </component> </project>
{ "pile_set_name": "Github" }
<?xml version="1.0" encoding="UTF-8"?> <thing:thing-descriptions bindingId="rotel" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:thing="https://openhab.org/schemas/thing-description/v1.0.0" xsi:schemaLocation="https://openhab.org/schemas/thing-description/v1.0.0 https://openhab.org/schemas/thing-description-1.0.0.xsd"> <!-- Rotel RSX-1055 Connection Thing Type --> <thing-type id="rsx1055"> <label>RSX-1055 Surround Receiver</label> <description>Connection to the Rotel RSX-1055 surround receiver</description> <channel-groups> <channel-group id="mainZone" typeId="mainZoneType5"/> <channel-group id="zone2" typeId="zone2type2"/> </channel-groups> <properties> <property name="protocol">HEX</property> </properties> <config-description-ref uri="thing-type:rotel:serial2"/> </thing-type> </thing:thing-descriptions>
{ "pile_set_name": "Github" }
/* * Copyright (c) 2003, 2007-14 Matteo Frigo * Copyright (c) 2003, 2007-14 Massachusetts Institute of Technology * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation; either version 2 of the License, or * (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA * */ #include "ct-hc2c.h" typedef struct { hc2c_solver super; const hc2c_desc *desc; int bufferedp; khc2c k; } S; typedef struct { plan_hc2c super; khc2c k; plan *cld0, *cldm; /* children for 0th and middle butterflies */ INT r, m, v, extra_iter; INT ms, vs; stride rs, brs; twid *td; const S *slv; } P; /************************************************************* Nonbuffered code *************************************************************/ static void apply(const plan *ego_, R *cr, R *ci) { const P *ego = (const P *) ego_; plan_rdft2 *cld0 = (plan_rdft2 *) ego->cld0; plan_rdft2 *cldm = (plan_rdft2 *) ego->cldm; INT i, m = ego->m, v = ego->v; INT ms = ego->ms, vs = ego->vs; for (i = 0; i < v; ++i, cr += vs, ci += vs) { cld0->apply((plan *) cld0, cr, ci, cr, ci); ego->k(cr + ms, ci + ms, cr + (m-1)*ms, ci + (m-1)*ms, ego->td->W, ego->rs, 1, (m+1)/2, ms); cldm->apply((plan *) cldm, cr + (m/2)*ms, ci + (m/2)*ms, cr + (m/2)*ms, ci + (m/2)*ms); } } static void apply_extra_iter(const plan *ego_, R *cr, R *ci) { const P *ego = (const P *) ego_; plan_rdft2 *cld0 = (plan_rdft2 *) ego->cld0; plan_rdft2 *cldm = (plan_rdft2 *) ego->cldm; INT i, m = ego->m, v = ego->v; INT ms = ego->ms, vs = ego->vs; INT mm = (m-1)/2; for (i = 0; i < v; ++i, cr += vs, ci += vs) { cld0->apply((plan *) cld0, cr, ci, cr, ci); /* for 4-way SIMD when (m+1)/2-1 is odd: iterate over an even vector length MM-1, and then execute the last iteration as a 2-vector with vector stride 0. The twiddle factors of the second half of the last iteration are bogus, but we only store the results of the first half. */ ego->k(cr + ms, ci + ms, cr + (m-1)*ms, ci + (m-1)*ms, ego->td->W, ego->rs, 1, mm, ms); ego->k(cr + mm*ms, ci + mm*ms, cr + (m-mm)*ms, ci + (m-mm)*ms, ego->td->W, ego->rs, mm, mm+2, 0); cldm->apply((plan *) cldm, cr + (m/2)*ms, ci + (m/2)*ms, cr + (m/2)*ms, ci + (m/2)*ms); } } /************************************************************* Buffered code *************************************************************/ /* should not be 2^k to avoid associativity conflicts */ static INT compute_batchsize(INT radix) { /* round up to multiple of 4 */ radix += 3; radix &= -4; return (radix + 2); } static void dobatch(const P *ego, R *Rp, R *Ip, R *Rm, R *Im, INT mb, INT me, INT extra_iter, R *bufp) { INT b = WS(ego->brs, 1); INT rs = WS(ego->rs, 1); INT ms = ego->ms; R *bufm = bufp + b - 2; INT n = me - mb; X(cpy2d_pair_ci)(Rp + mb * ms, Ip + mb * ms, bufp, bufp + 1, ego->r / 2, rs, b, n, ms, 2); X(cpy2d_pair_ci)(Rm - mb * ms, Im - mb * ms, bufm, bufm + 1, ego->r / 2, rs, b, n, -ms, -2); if (extra_iter) { /* initialize the extra_iter element to 0. It would be ok to leave it uninitialized, since we transform uninitialized data and ignore the result. However, we want to avoid FP exceptions in case somebody is trapping them. */ A(n < compute_batchsize(ego->r)); X(zero1d_pair)(bufp + 2*n, bufp + 1 + 2*n, ego->r / 2, b); X(zero1d_pair)(bufm - 2*n, bufm + 1 - 2*n, ego->r / 2, b); } ego->k(bufp, bufp + 1, bufm, bufm + 1, ego->td->W, ego->brs, mb, me + extra_iter, 2); X(cpy2d_pair_co)(bufp, bufp + 1, Rp + mb * ms, Ip + mb * ms, ego->r / 2, b, rs, n, 2, ms); X(cpy2d_pair_co)(bufm, bufm + 1, Rm - mb * ms, Im - mb * ms, ego->r / 2, b, rs, n, -2, -ms); } static void apply_buf(const plan *ego_, R *cr, R *ci) { const P *ego = (const P *) ego_; plan_rdft2 *cld0 = (plan_rdft2 *) ego->cld0; plan_rdft2 *cldm = (plan_rdft2 *) ego->cldm; INT i, j, ms = ego->ms, v = ego->v; INT batchsz = compute_batchsize(ego->r); R *buf; INT mb = 1, me = (ego->m+1) / 2; size_t bufsz = ego->r * batchsz * 2 * sizeof(R); BUF_ALLOC(R *, buf, bufsz); for (i = 0; i < v; ++i, cr += ego->vs, ci += ego->vs) { R *Rp = cr; R *Ip = ci; R *Rm = cr + ego->m * ms; R *Im = ci + ego->m * ms; cld0->apply((plan *) cld0, Rp, Ip, Rp, Ip); for (j = mb; j + batchsz < me; j += batchsz) dobatch(ego, Rp, Ip, Rm, Im, j, j + batchsz, 0, buf); dobatch(ego, Rp, Ip, Rm, Im, j, me, ego->extra_iter, buf); cldm->apply((plan *) cldm, Rp + me * ms, Ip + me * ms, Rp + me * ms, Ip + me * ms); } BUF_FREE(buf, bufsz); } /************************************************************* common code *************************************************************/ static void awake(plan *ego_, enum wakefulness wakefulness) { P *ego = (P *) ego_; X(plan_awake)(ego->cld0, wakefulness); X(plan_awake)(ego->cldm, wakefulness); X(twiddle_awake)(wakefulness, &ego->td, ego->slv->desc->tw, ego->r * ego->m, ego->r, (ego->m - 1) / 2 + ego->extra_iter); } static void destroy(plan *ego_) { P *ego = (P *) ego_; X(plan_destroy_internal)(ego->cld0); X(plan_destroy_internal)(ego->cldm); X(stride_destroy)(ego->rs); X(stride_destroy)(ego->brs); } static void print(const plan *ego_, printer *p) { const P *ego = (const P *) ego_; const S *slv = ego->slv; const hc2c_desc *e = slv->desc; if (slv->bufferedp) p->print(p, "(hc2c-directbuf/%D-%D/%D/%D%v \"%s\"%(%p%)%(%p%))", compute_batchsize(ego->r), ego->r, X(twiddle_length)(ego->r, e->tw), ego->extra_iter, ego->v, e->nam, ego->cld0, ego->cldm); else p->print(p, "(hc2c-direct-%D/%D/%D%v \"%s\"%(%p%)%(%p%))", ego->r, X(twiddle_length)(ego->r, e->tw), ego->extra_iter, ego->v, e->nam, ego->cld0, ego->cldm); } static int applicable0(const S *ego, rdft_kind kind, INT r, INT rs, INT m, INT ms, INT v, INT vs, const R *cr, const R *ci, const planner *plnr, INT *extra_iter) { const hc2c_desc *e = ego->desc; UNUSED(v); return ( 1 && r == e->radix && kind == e->genus->kind /* first v-loop iteration */ && ((*extra_iter = 0, e->genus->okp(cr + ms, ci + ms, cr + (m-1)*ms, ci + (m-1)*ms, rs, 1, (m+1)/2, ms, plnr)) || (*extra_iter = 1, ((e->genus->okp(cr + ms, ci + ms, cr + (m-1)*ms, ci + (m-1)*ms, rs, 1, (m-1)/2, ms, plnr)) && (e->genus->okp(cr + ms, ci + ms, cr + (m-1)*ms, ci + (m-1)*ms, rs, (m-1)/2, (m-1)/2 + 2, 0, plnr))))) /* subsequent v-loop iterations */ && (cr += vs, ci += vs, 1) && e->genus->okp(cr + ms, ci + ms, cr + (m-1)*ms, ci + (m-1)*ms, rs, 1, (m+1)/2 - *extra_iter, ms, plnr) ); } static int applicable0_buf(const S *ego, rdft_kind kind, INT r, INT rs, INT m, INT ms, INT v, INT vs, const R *cr, const R *ci, const planner *plnr, INT *extra_iter) { const hc2c_desc *e = ego->desc; INT batchsz, brs; UNUSED(v); UNUSED(rs); UNUSED(ms); UNUSED(vs); return ( 1 && r == e->radix && kind == e->genus->kind /* ignore cr, ci, use buffer */ && (cr = (const R *)0, ci = cr + 1, batchsz = compute_batchsize(r), brs = 4 * batchsz, 1) && e->genus->okp(cr, ci, cr + brs - 2, ci + brs - 2, brs, 1, 1+batchsz, 2, plnr) && ((*extra_iter = 0, e->genus->okp(cr, ci, cr + brs - 2, ci + brs - 2, brs, 1, 1 + (((m-1)/2) % batchsz), 2, plnr)) || (*extra_iter = 1, e->genus->okp(cr, ci, cr + brs - 2, ci + brs - 2, brs, 1, 1 + 1 + (((m-1)/2) % batchsz), 2, plnr))) ); } static int applicable(const S *ego, rdft_kind kind, INT r, INT rs, INT m, INT ms, INT v, INT vs, R *cr, R *ci, const planner *plnr, INT *extra_iter) { if (ego->bufferedp) { if (!applicable0_buf(ego, kind, r, rs, m, ms, v, vs, cr, ci, plnr, extra_iter)) return 0; } else { if (!applicable0(ego, kind, r, rs, m, ms, v, vs, cr, ci, plnr, extra_iter)) return 0; } if (NO_UGLYP(plnr) && X(ct_uglyp)((ego->bufferedp? (INT)512 : (INT)16), v, m * r, r)) return 0; return 1; } static plan *mkcldw(const hc2c_solver *ego_, rdft_kind kind, INT r, INT rs, INT m, INT ms, INT v, INT vs, R *cr, R *ci, planner *plnr) { const S *ego = (const S *) ego_; P *pln; const hc2c_desc *e = ego->desc; plan *cld0 = 0, *cldm = 0; INT imid = (m / 2) * ms; INT extra_iter; static const plan_adt padt = { 0, awake, print, destroy }; if (!applicable(ego, kind, r, rs, m, ms, v, vs, cr, ci, plnr, &extra_iter)) return (plan *)0; cld0 = X(mkplan_d)( plnr, X(mkproblem_rdft2_d)(X(mktensor_1d)(r, rs, rs), X(mktensor_0d)(), TAINT(cr, vs), TAINT(ci, vs), TAINT(cr, vs), TAINT(ci, vs), kind)); if (!cld0) goto nada; cldm = X(mkplan_d)( plnr, X(mkproblem_rdft2_d)(((m % 2) ? X(mktensor_0d)() : X(mktensor_1d)(r, rs, rs) ), X(mktensor_0d)(), TAINT(cr + imid, vs), TAINT(ci + imid, vs), TAINT(cr + imid, vs), TAINT(ci + imid, vs), kind == R2HC ? R2HCII : HC2RIII)); if (!cldm) goto nada; if (ego->bufferedp) pln = MKPLAN_HC2C(P, &padt, apply_buf); else pln = MKPLAN_HC2C(P, &padt, extra_iter ? apply_extra_iter : apply); pln->k = ego->k; pln->td = 0; pln->r = r; pln->rs = X(mkstride)(r, rs); pln->m = m; pln->ms = ms; pln->v = v; pln->vs = vs; pln->slv = ego; pln->brs = X(mkstride)(r, 4 * compute_batchsize(r)); pln->cld0 = cld0; pln->cldm = cldm; pln->extra_iter = extra_iter; X(ops_zero)(&pln->super.super.ops); X(ops_madd2)(v * (((m - 1) / 2) / e->genus->vl), &e->ops, &pln->super.super.ops); X(ops_madd2)(v, &cld0->ops, &pln->super.super.ops); X(ops_madd2)(v, &cldm->ops, &pln->super.super.ops); if (ego->bufferedp) pln->super.super.ops.other += 4 * r * m * v; return &(pln->super.super); nada: X(plan_destroy_internal)(cld0); X(plan_destroy_internal)(cldm); return 0; } static void regone(planner *plnr, khc2c codelet, const hc2c_desc *desc, hc2c_kind hc2ckind, int bufferedp) { S *slv = (S *)X(mksolver_hc2c)(sizeof(S), desc->radix, hc2ckind, mkcldw); slv->k = codelet; slv->desc = desc; slv->bufferedp = bufferedp; REGISTER_SOLVER(plnr, &(slv->super.super)); } void X(regsolver_hc2c_direct)(planner *plnr, khc2c codelet, const hc2c_desc *desc, hc2c_kind hc2ckind) { regone(plnr, codelet, desc, hc2ckind, /* bufferedp */0); regone(plnr, codelet, desc, hc2ckind, /* bufferedp */1); }
{ "pile_set_name": "Github" }
/* * Copyright (c) 2015 - 2016 Intel Corporation. * * 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. */ /** * @file * @ingroup howtocode * @brief Equipment activity monitor in C++ * * This equipment-activity application is part of a series of how-to Intel IoT code * sample exercises using the Intel® IoT Developer Kit, Intel® Edison board, * cloud platforms, APIs, and other technologies. * * @hardware Sensors used:\n * Grove Sound Sensor\n * Grove Piezo Vibration Sensor\n * Grove RGB LCD\n * * @cc * @cxx -std=c++1y * @ld -lupm-i2clcd -lupm-jhd1313m1 -lump-mic -lupm-ldt0028 -lpaho-mqtt3cs -lcurl * * Additional source files required to build this example: * @req datastore.cpp * @req mqtt.cpp * * @date 09/22/2016 */ #include <stdlib.h> #include <iostream> #include <unistd.h> #include <sstream> #include <ctime> #include <signal.h> using namespace std; #include "kits.h" #if INTEL_IOT_KIT == DFROBOTKIT #include "dfrobotkit.hpp" #else #include "grovekit.hpp" #endif #include "../lib/restclient-cpp/include/restclient-cpp/restclient.h" #include "datastore.h" #include "services/services.h" // Call remote datastore server to log activity void notify(string message) { time_t now = time(NULL); char mbstr[sizeof "2011-10-08T07:07:09Z"]; strftime(mbstr, sizeof(mbstr), "%FT%TZ", localtime(&now)); stringstream text; text << "{\"state\":"; text << "\"" << message << " " << mbstr << "\"}"; cout << message << " " << mbstr << endl; log_service(text.str()); log_datastore(text.str()); } Devices devices; // Exit handler for program void exit_handler(int param) { devices.cleanup(); exit(1); } // The main function for the example program int main() { // handles ctrl-c or other orderly exits signal(SIGINT, exit_handler); // create and initialize UPM devices devices.init(); devices.reset(); bool movement = false; bool noise = false; bool inUse = false; // every 1 sec, check for movement and noise for (;;) { movement = devices.is_movement(); noise = devices.is_noise(); if ( movement && noise && !inUse ) { notify("equipment start"); devices.message("equipment start"); } else if ( !(movement && noise) && inUse ) { notify("equipment stop"); devices.message("equipment stop"); } inUse = movement && noise; sleep(1); } return MRAA_SUCCESS; }
{ "pile_set_name": "Github" }
// // AVIM.h // AVOSCloudIM // // Created by Qihe Bian on 12/4/14. // Copyright (c) 2014 LeanCloud Inc. All rights reserved. // #import "AVIMClient.h" #import "AVIMCommon_Internal.h" #import "LCRTMConnection.h" #import "AVIMClientInternalConversationManager_Internal.h" #import "AVIMSignature.h" #import "LCIMConversationCache.h" #import "AVApplication_Internal.h" #if DEBUG void assertContextOfQueue(dispatch_queue_t queue, BOOL isRunIn); #define AssertRunInQueue(queue) assertContextOfQueue(queue, true); #define AssertNotRunInQueue(queue) assertContextOfQueue(queue, false); #else #define AssertRunInQueue(queue) #define AssertNotRunInQueue(queue) #endif @interface LCIMProtobufCommandWrapper : NSObject @property (nonatomic) AVIMGenericCommand *outCommand; @property (nonatomic) AVIMGenericCommand *inCommand; @property (nonatomic) NSError *error; @property (nonatomic) void (^callback)(AVIMClient *client, LCIMProtobufCommandWrapper *commandWrapper); @end @interface AVIMClient () <LCRTMConnectionDelegate> @property (nonatomic, readonly) int64_t sessionConfigBitmap; @property (nonatomic, readonly) NSLock *lock; @property (nonatomic, readonly) dispatch_queue_t internalSerialQueue; @property (nonatomic, readonly) dispatch_queue_t signatureQueue; @property (nonatomic, readonly) dispatch_queue_t userInteractQueue; @property (nonatomic, readonly) LCRTMConnection *connection; @property (nonatomic, readonly) LCRTMServiceConsumer *serviceConsumer; @property (nonatomic, readonly) LCRTMConnectionDelegator *connectionDelegator; @property (nonatomic, readonly) AVInstallation *installation; @property (nonatomic, readonly) AVIMClientInternalConversationManager *conversationManager; @property (nonatomic, readonly) LCIMConversationCache *conversationCache; @property (nonatomic) void (^openingCompletion)(BOOL, NSError *); @property (nonatomic) AVIMClientOpenOption openingOption; @property (nonatomic) NSString *sessionToken; @property (nonatomic) NSDate *sessionTokenExpiration; @property (nonatomic) int64_t lastUnreadNotifTime; @property (nonatomic) int64_t lastPatchTime; @property (nonatomic) NSString *currentDeviceToken; + (NSMutableDictionary *)sessionProtocolOptions; - (instancetype)initWithClientId:(NSString *)clientId tag:(NSString *)tag installation:(AVInstallation *)installation error:(NSError * __autoreleasing *)error LC_WARN_UNUSED_RESULT; - (instancetype)initWithUser:(AVUser *)user tag:(NSString *)tag installation:(AVInstallation *)installation error:(NSError * __autoreleasing *)error LC_WARN_UNUSED_RESULT; - (void)addOperationToInternalSerialQueue:(void (^)(AVIMClient *client))block; - (void)invokeInUserInteractQueue:(void (^)(void))block; - (void)invokeDelegateInUserInteractQueue:(void (^)(id<AVIMClientDelegate> delegate))block; - (void)sendCommandWrapper:(LCIMProtobufCommandWrapper *)commandWrapper; - (void)getSignatureWithConversationId:(NSString *)conversationId action:(AVIMSignatureAction)action actionOnClientIds:(NSArray<NSString *> *)actionOnClientIds callback:(void (^)(AVIMSignature *signature))callback; - (void)getSessionTokenWithForcingRefresh:(BOOL)forcingRefresh callback:(void (^)(NSString *sessionToken, NSError *error))callback; - (void)conversation:(AVIMConversation *)conversation didUpdateForKeys:(NSArray<AVIMConversationUpdatedKey> *)keys; @end
{ "pile_set_name": "Github" }
<#import "email_macros.ftl" as emailMacros /> Dear ${emailName}, We are writing to let you know about a bug that we identified recently, which may have affected the display of one or more of the organization names in your ORCID record (${baseUriHttp}/${orcidId}). As a result, your record may currently include incorrect information about the following organization(s): <#list orgDescriptions as orgDescription> ${orgDescription} </#list> We have fixed the bug and have tried to fix the affiliation data that was affected in your record, though some correction may still be needed. We have changed the visibility setting on affected information to private - visible only to you - to allow you to review changes. We encourage you to sign into your record at https://orcid.org/my-orcid to review and, if necessary, correct the affected affiliation information. You can then decide whether to keep this information visible only to you, make it publicly available, or share it only with those you trust. We apologize for any inconvenience this may cause you. If you have any questions or concerns, or need information about how to update your record and/or the visibility settings, our global support team are available to help you, at https://support.orcid.org/hc/en-us/requests/new. Regards, Laure Haak Executive Director, ORCID [email protected] ${baseUri} <@emailMacros.msg "email.common.you_have_received_this_email" /> <#include "email_footer.ftl"/>
{ "pile_set_name": "Github" }
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd"> <HTML style="overflow:auto;"> <HEAD> <meta name="generator" content="JDiff v1.1.0"> <!-- Generated by the JDiff Javadoc doclet --> <!-- (http://www.jdiff.org) --> <meta name="description" content="JDiff is a Javadoc doclet which generates an HTML report of all the packages, classes, constructors, methods, and fields which have been removed, added or changed in any way, including their documentation, when two APIs are compared."> <meta name="keywords" content="diff, jdiff, javadiff, java diff, java difference, API difference, difference between two APIs, API diff, Javadoc, doclet"> <TITLE> android.service.voice.VoiceInteractionSession </TITLE> <link href="../../../../assets/android-developer-docs.css" rel="stylesheet" type="text/css" /> <link href="../stylesheet-jdiff.css" rel="stylesheet" type="text/css" /> <noscript> <style type="text/css"> body{overflow:auto;} #body-content{position:relative; top:0;} #doc-content{overflow:visible;border-left:3px solid #666;} #side-nav{padding:0;} #side-nav .toggle-list ul {display:block;} #resize-packages-nav{border-bottom:3px solid #666;} </style> </noscript> <style type="text/css"> </style> </HEAD> <BODY> <!-- Start of nav bar --> <a name="top"></a> <div id="header" style="margin-bottom:0;padding-bottom:0;"> <div id="headerLeft"> <a href="../../../../index.html" tabindex="-1" target="_top"><img src="../../../../assets/images/bg_logo.png" alt="Android Developers" /></a> </div> <div id="headerRight"> <div id="headerLinks"> <!-- <img src="/assets/images/icon_world.jpg" alt="" /> --> <span class="text"> <!-- &nbsp;<a href="#">English</a> | --> <nobr><a href="http://developer.android.com" target="_top">Android Developers</a> | <a href="http://www.android.com" target="_top">Android.com</a></nobr> </span> </div> <div class="and-diff-id" style="margin-top:6px;margin-right:8px;"> <table class="diffspectable"> <tr> <td colspan="2" class="diffspechead">API Diff Specification</td> </tr> <tr> <td class="diffspec" style="padding-top:.25em">To Level:</td> <td class="diffvaluenew" style="padding-top:.25em">23</td> </tr> <tr> <td class="diffspec">From Level:</td> <td class="diffvalueold">22</td> </tr> <tr> <td class="diffspec">Generated</td> <td class="diffvalue">2015.08.14 14:28</td> </tr> </table> </div><!-- End and-diff-id --> <div class="and-diff-id" style="margin-right:8px;"> <table class="diffspectable"> <tr> <td class="diffspec" colspan="2"><a href="jdiff_statistics.html">Statistics</a> </tr> </table> </div> <!-- End and-diff-id --> </div> <!-- End headerRight --> </div> <!-- End header --> <div id="body-content" xstyle="padding:12px;padding-right:18px;"> <div id="doc-content" style="position:relative;"> <div id="mainBodyFluid"> <H2> Class android.service.voice.<A HREF="../../../../reference/android/service/voice/VoiceInteractionSession.html" target="_top"><font size="+2"><code>VoiceInteractionSession</code></font></A> </H2> <p><font xsize="+1">Added interface <code>android.content.ComponentCallbacks2</code>.<br></font> <p>Changed from abstract to non-abstract. <a NAME="constructors"></a> <a NAME="methods"></a> <p> <a NAME="Added"></a> <TABLE summary="Added Methods" WIDTH="100%"> <TR> <TH VALIGN="TOP" COLSPAN=2>Added Methods</FONT></TD> </TH> <TR BGCOLOR="#FFFFFF" CLASS="TableRowColor"> <TD VALIGN="TOP" WIDTH="25%"> <A NAME="android.service.voice.VoiceInteractionSession.closeSystemDialogs_added()"></A> <nobr><code>void</code>&nbsp;<A HREF="../../../../reference/android/service/voice/VoiceInteractionSession.html#closeSystemDialogs()" target="_top"><code>closeSystemDialogs</code></A>()</nobr> </TD> <TD>&nbsp;</TD> </TR> <TR BGCOLOR="#FFFFFF" CLASS="TableRowColor"> <TD VALIGN="TOP" WIDTH="25%"> <A NAME="android.service.voice.VoiceInteractionSession.dump_added(java.lang.String, java.io.FileDescriptor, java.io.PrintWriter, java.lang.String[])"></A> <nobr><code>void</code>&nbsp;<A HREF="../../../../reference/android/service/voice/VoiceInteractionSession.html#dump(java.lang.String, java.io.FileDescriptor, java.io.PrintWriter, java.lang.String[])" target="_top"><code>dump</code></A>(<code>String,</nobr> FileDescriptor<nobr>,</nobr> PrintWriter<nobr>,</nobr> String[]<nobr><nobr></code>)</nobr> </TD> <TD>&nbsp;</TD> </TR> <TR BGCOLOR="#FFFFFF" CLASS="TableRowColor"> <TD VALIGN="TOP" WIDTH="25%"> <A NAME="android.service.voice.VoiceInteractionSession.getContext_added()"></A> <nobr><code>Context</code>&nbsp;<A HREF="../../../../reference/android/service/voice/VoiceInteractionSession.html#getContext()" target="_top"><code>getContext</code></A>()</nobr> </TD> <TD>&nbsp;</TD> </TR> <TR BGCOLOR="#FFFFFF" CLASS="TableRowColor"> <TD VALIGN="TOP" WIDTH="25%"> <A NAME="android.service.voice.VoiceInteractionSession.getDisabledShowContext_added()"></A> <nobr><code>int</code>&nbsp;<A HREF="../../../../reference/android/service/voice/VoiceInteractionSession.html#getDisabledShowContext()" target="_top"><code>getDisabledShowContext</code></A>()</nobr> </TD> <TD>&nbsp;</TD> </TR> <TR BGCOLOR="#FFFFFF" CLASS="TableRowColor"> <TD VALIGN="TOP" WIDTH="25%"> <A NAME="android.service.voice.VoiceInteractionSession.getLayoutInflater_added()"></A> <nobr><code>LayoutInflater</code>&nbsp;<A HREF="../../../../reference/android/service/voice/VoiceInteractionSession.html#getLayoutInflater()" target="_top"><code>getLayoutInflater</code></A>()</nobr> </TD> <TD>&nbsp;</TD> </TR> <TR BGCOLOR="#FFFFFF" CLASS="TableRowColor"> <TD VALIGN="TOP" WIDTH="25%"> <A NAME="android.service.voice.VoiceInteractionSession.getUserDisabledShowContext_added()"></A> <nobr><code>int</code>&nbsp;<A HREF="../../../../reference/android/service/voice/VoiceInteractionSession.html#getUserDisabledShowContext()" target="_top"><code>getUserDisabledShowContext</code></A>()</nobr> </TD> <TD>&nbsp;</TD> </TR> <TR BGCOLOR="#FFFFFF" CLASS="TableRowColor"> <TD VALIGN="TOP" WIDTH="25%"> <A NAME="android.service.voice.VoiceInteractionSession.getWindow_added()"></A> <nobr><code>Dialog</code>&nbsp;<A HREF="../../../../reference/android/service/voice/VoiceInteractionSession.html#getWindow()" target="_top"><code>getWindow</code></A>()</nobr> </TD> <TD>&nbsp;</TD> </TR> <TR BGCOLOR="#FFFFFF" CLASS="TableRowColor"> <TD VALIGN="TOP" WIDTH="25%"> <A NAME="android.service.voice.VoiceInteractionSession.hide_added()"></A> <nobr><code>void</code>&nbsp;<A HREF="../../../../reference/android/service/voice/VoiceInteractionSession.html#hide()" target="_top"><code>hide</code></A>()</nobr> </TD> <TD>&nbsp;</TD> </TR> <TR BGCOLOR="#FFFFFF" CLASS="TableRowColor"> <TD VALIGN="TOP" WIDTH="25%"> <A NAME="android.service.voice.VoiceInteractionSession.onAssistStructureFailure_added(java.lang.Throwable)"></A> <nobr><code>void</code>&nbsp;<A HREF="../../../../reference/android/service/voice/VoiceInteractionSession.html#onAssistStructureFailure(java.lang.Throwable)" target="_top"><code>onAssistStructureFailure</code></A>(<code>Throwable</code>)</nobr> </TD> <TD>&nbsp;</TD> </TR> <TR BGCOLOR="#FFFFFF" CLASS="TableRowColor"> <TD VALIGN="TOP" WIDTH="25%"> <A NAME="android.service.voice.VoiceInteractionSession.onBackPressed_added()"></A> <nobr><code>void</code>&nbsp;<A HREF="../../../../reference/android/service/voice/VoiceInteractionSession.html#onBackPressed()" target="_top"><code>onBackPressed</code></A>()</nobr> </TD> <TD>&nbsp;</TD> </TR> <TR BGCOLOR="#FFFFFF" CLASS="TableRowColor"> <TD VALIGN="TOP" WIDTH="25%"> <A NAME="android.service.voice.VoiceInteractionSession.onCancelRequest_added(android.service.voice.VoiceInteractionSession.Request)"></A> <nobr><code>void</code>&nbsp;<A HREF="../../../../reference/android/service/voice/VoiceInteractionSession.html#onCancelRequest(android.service.voice.VoiceInteractionSession.Request)" target="_top"><code>onCancelRequest</code></A>(<code>Request</code>)</nobr> </TD> <TD>&nbsp;</TD> </TR> <TR BGCOLOR="#FFFFFF" CLASS="TableRowColor"> <TD VALIGN="TOP" WIDTH="25%"> <A NAME="android.service.voice.VoiceInteractionSession.onComputeInsets_added(android.service.voice.VoiceInteractionSession.Insets)"></A> <nobr><code>void</code>&nbsp;<A HREF="../../../../reference/android/service/voice/VoiceInteractionSession.html#onComputeInsets(android.service.voice.VoiceInteractionSession.Insets)" target="_top"><code>onComputeInsets</code></A>(<code>Insets</code>)</nobr> </TD> <TD>&nbsp;</TD> </TR> <TR BGCOLOR="#FFFFFF" CLASS="TableRowColor"> <TD VALIGN="TOP" WIDTH="25%"> <A NAME="android.service.voice.VoiceInteractionSession.onConfigurationChanged_added(android.content.res.Configuration)"></A> <nobr><code>void</code>&nbsp;<A HREF="../../../../reference/android/service/voice/VoiceInteractionSession.html#onConfigurationChanged(android.content.res.Configuration)" target="_top"><code>onConfigurationChanged</code></A>(<code>Configuration</code>)</nobr> </TD> <TD>&nbsp;</TD> </TR> <TR BGCOLOR="#FFFFFF" CLASS="TableRowColor"> <TD VALIGN="TOP" WIDTH="25%"> <A NAME="android.service.voice.VoiceInteractionSession.onCreateContentView_added()"></A> <nobr><code>View</code>&nbsp;<A HREF="../../../../reference/android/service/voice/VoiceInteractionSession.html#onCreateContentView()" target="_top"><code>onCreateContentView</code></A>()</nobr> </TD> <TD>&nbsp;</TD> </TR> <TR BGCOLOR="#FFFFFF" CLASS="TableRowColor"> <TD VALIGN="TOP" WIDTH="25%"> <A NAME="android.service.voice.VoiceInteractionSession.onGetSupportedCommands_added(java.lang.String[])"></A> <nobr><code>boolean[]</code>&nbsp;<A HREF="../../../../reference/android/service/voice/VoiceInteractionSession.html#onGetSupportedCommands(java.lang.String[])" target="_top"><code>onGetSupportedCommands</code></A>(<code>String[]</code>)</nobr> </TD> <TD>&nbsp;</TD> </TR> <TR BGCOLOR="#FFFFFF" CLASS="TableRowColor"> <TD VALIGN="TOP" WIDTH="25%"> <A NAME="android.service.voice.VoiceInteractionSession.onHandleAssist_added(android.os.Bundle, android.app.assist.AssistStructure, android.app.assist.AssistContent)"></A> <nobr><code>void</code>&nbsp;<A HREF="../../../../reference/android/service/voice/VoiceInteractionSession.html#onHandleAssist(android.os.Bundle, android.app.assist.AssistStructure, android.app.assist.AssistContent)" target="_top"><code>onHandleAssist</code></A>(<code>Bundle,</nobr> AssistStructure<nobr>,</nobr> AssistContent<nobr><nobr></code>)</nobr> </TD> <TD>&nbsp;</TD> </TR> <TR BGCOLOR="#FFFFFF" CLASS="TableRowColor"> <TD VALIGN="TOP" WIDTH="25%"> <A NAME="android.service.voice.VoiceInteractionSession.onHandleScreenshot_added(android.graphics.Bitmap)"></A> <nobr><code>void</code>&nbsp;<A HREF="../../../../reference/android/service/voice/VoiceInteractionSession.html#onHandleScreenshot(android.graphics.Bitmap)" target="_top"><code>onHandleScreenshot</code></A>(<code>Bitmap</code>)</nobr> </TD> <TD>&nbsp;</TD> </TR> <TR BGCOLOR="#FFFFFF" CLASS="TableRowColor"> <TD VALIGN="TOP" WIDTH="25%"> <A NAME="android.service.voice.VoiceInteractionSession.onHide_added()"></A> <nobr><code>void</code>&nbsp;<A HREF="../../../../reference/android/service/voice/VoiceInteractionSession.html#onHide()" target="_top"><code>onHide</code></A>()</nobr> </TD> <TD>&nbsp;</TD> </TR> <TR BGCOLOR="#FFFFFF" CLASS="TableRowColor"> <TD VALIGN="TOP" WIDTH="25%"> <A NAME="android.service.voice.VoiceInteractionSession.onLockscreenShown_added()"></A> <nobr><code>void</code>&nbsp;<A HREF="../../../../reference/android/service/voice/VoiceInteractionSession.html#onLockscreenShown()" target="_top"><code>onLockscreenShown</code></A>()</nobr> </TD> <TD>&nbsp;</TD> </TR> <TR BGCOLOR="#FFFFFF" CLASS="TableRowColor"> <TD VALIGN="TOP" WIDTH="25%"> <A NAME="android.service.voice.VoiceInteractionSession.onLowMemory_added()"></A> <nobr><code>void</code>&nbsp;<A HREF="../../../../reference/android/service/voice/VoiceInteractionSession.html#onLowMemory()" target="_top"><code>onLowMemory</code></A>()</nobr> </TD> <TD>&nbsp;</TD> </TR> <TR BGCOLOR="#FFFFFF" CLASS="TableRowColor"> <TD VALIGN="TOP" WIDTH="25%"> <A NAME="android.service.voice.VoiceInteractionSession.onRequestAbortVoice_added(android.service.voice.VoiceInteractionSession.AbortVoiceRequest)"></A> <nobr><code>void</code>&nbsp;<A HREF="../../../../reference/android/service/voice/VoiceInteractionSession.html#onRequestAbortVoice(android.service.voice.VoiceInteractionSession.AbortVoiceRequest)" target="_top"><code>onRequestAbortVoice</code></A>(<code>AbortVoiceRequest</code>)</nobr> </TD> <TD>&nbsp;</TD> </TR> <TR BGCOLOR="#FFFFFF" CLASS="TableRowColor"> <TD VALIGN="TOP" WIDTH="25%"> <A NAME="android.service.voice.VoiceInteractionSession.onRequestCommand_added(android.service.voice.VoiceInteractionSession.CommandRequest)"></A> <nobr><code>void</code>&nbsp;<A HREF="../../../../reference/android/service/voice/VoiceInteractionSession.html#onRequestCommand(android.service.voice.VoiceInteractionSession.CommandRequest)" target="_top"><code>onRequestCommand</code></A>(<code>CommandRequest</code>)</nobr> </TD> <TD>&nbsp;</TD> </TR> <TR BGCOLOR="#FFFFFF" CLASS="TableRowColor"> <TD VALIGN="TOP" WIDTH="25%"> <A NAME="android.service.voice.VoiceInteractionSession.onRequestCompleteVoice_added(android.service.voice.VoiceInteractionSession.CompleteVoiceRequest)"></A> <nobr><code>void</code>&nbsp;<A HREF="../../../../reference/android/service/voice/VoiceInteractionSession.html#onRequestCompleteVoice(android.service.voice.VoiceInteractionSession.CompleteVoiceRequest)" target="_top"><code>onRequestCompleteVoice</code></A>(<code>CompleteVoiceRequest</code>)</nobr> </TD> <TD>&nbsp;</TD> </TR> <TR BGCOLOR="#FFFFFF" CLASS="TableRowColor"> <TD VALIGN="TOP" WIDTH="25%"> <A NAME="android.service.voice.VoiceInteractionSession.onRequestConfirmation_added(android.service.voice.VoiceInteractionSession.ConfirmationRequest)"></A> <nobr><code>void</code>&nbsp;<A HREF="../../../../reference/android/service/voice/VoiceInteractionSession.html#onRequestConfirmation(android.service.voice.VoiceInteractionSession.ConfirmationRequest)" target="_top"><code>onRequestConfirmation</code></A>(<code>ConfirmationRequest</code>)</nobr> </TD> <TD>&nbsp;</TD> </TR> <TR BGCOLOR="#FFFFFF" CLASS="TableRowColor"> <TD VALIGN="TOP" WIDTH="25%"> <A NAME="android.service.voice.VoiceInteractionSession.onRequestPickOption_added(android.service.voice.VoiceInteractionSession.PickOptionRequest)"></A> <nobr><code>void</code>&nbsp;<A HREF="../../../../reference/android/service/voice/VoiceInteractionSession.html#onRequestPickOption(android.service.voice.VoiceInteractionSession.PickOptionRequest)" target="_top"><code>onRequestPickOption</code></A>(<code>PickOptionRequest</code>)</nobr> </TD> <TD>&nbsp;</TD> </TR> <TR BGCOLOR="#FFFFFF" CLASS="TableRowColor"> <TD VALIGN="TOP" WIDTH="25%"> <A NAME="android.service.voice.VoiceInteractionSession.onShow_added(android.os.Bundle, int)"></A> <nobr><code>void</code>&nbsp;<A HREF="../../../../reference/android/service/voice/VoiceInteractionSession.html#onShow(android.os.Bundle, int)" target="_top"><code>onShow</code></A>(<code>Bundle,</nobr> int<nobr><nobr></code>)</nobr> </TD> <TD>&nbsp;</TD> </TR> <TR BGCOLOR="#FFFFFF" CLASS="TableRowColor"> <TD VALIGN="TOP" WIDTH="25%"> <A NAME="android.service.voice.VoiceInteractionSession.onTaskFinished_added(android.content.Intent, int)"></A> <nobr><code>void</code>&nbsp;<A HREF="../../../../reference/android/service/voice/VoiceInteractionSession.html#onTaskFinished(android.content.Intent, int)" target="_top"><code>onTaskFinished</code></A>(<code>Intent,</nobr> int<nobr><nobr></code>)</nobr> </TD> <TD>&nbsp;</TD> </TR> <TR BGCOLOR="#FFFFFF" CLASS="TableRowColor"> <TD VALIGN="TOP" WIDTH="25%"> <A NAME="android.service.voice.VoiceInteractionSession.onTaskStarted_added(android.content.Intent, int)"></A> <nobr><code>void</code>&nbsp;<A HREF="../../../../reference/android/service/voice/VoiceInteractionSession.html#onTaskStarted(android.content.Intent, int)" target="_top"><code>onTaskStarted</code></A>(<code>Intent,</nobr> int<nobr><nobr></code>)</nobr> </TD> <TD>&nbsp;</TD> </TR> <TR BGCOLOR="#FFFFFF" CLASS="TableRowColor"> <TD VALIGN="TOP" WIDTH="25%"> <A NAME="android.service.voice.VoiceInteractionSession.onTrimMemory_added(int)"></A> <nobr><code>void</code>&nbsp;<A HREF="../../../../reference/android/service/voice/VoiceInteractionSession.html#onTrimMemory(int)" target="_top"><code>onTrimMemory</code></A>(<code>int</code>)</nobr> </TD> <TD>&nbsp;</TD> </TR> <TR BGCOLOR="#FFFFFF" CLASS="TableRowColor"> <TD VALIGN="TOP" WIDTH="25%"> <A NAME="android.service.voice.VoiceInteractionSession.setDisabledShowContext_added(int)"></A> <nobr><code>void</code>&nbsp;<A HREF="../../../../reference/android/service/voice/VoiceInteractionSession.html#setDisabledShowContext(int)" target="_top"><code>setDisabledShowContext</code></A>(<code>int</code>)</nobr> </TD> <TD>&nbsp;</TD> </TR> <TR BGCOLOR="#FFFFFF" CLASS="TableRowColor"> <TD VALIGN="TOP" WIDTH="25%"> <A NAME="android.service.voice.VoiceInteractionSession.setKeepAwake_added(boolean)"></A> <nobr><code>void</code>&nbsp;<A HREF="../../../../reference/android/service/voice/VoiceInteractionSession.html#setKeepAwake(boolean)" target="_top"><code>setKeepAwake</code></A>(<code>boolean</code>)</nobr> </TD> <TD>&nbsp;</TD> </TR> <TR BGCOLOR="#FFFFFF" CLASS="TableRowColor"> <TD VALIGN="TOP" WIDTH="25%"> <A NAME="android.service.voice.VoiceInteractionSession.setTheme_added(int)"></A> <nobr><code>void</code>&nbsp;<A HREF="../../../../reference/android/service/voice/VoiceInteractionSession.html#setTheme(int)" target="_top"><code>setTheme</code></A>(<code>int</code>)</nobr> </TD> <TD>&nbsp;</TD> </TR> <TR BGCOLOR="#FFFFFF" CLASS="TableRowColor"> <TD VALIGN="TOP" WIDTH="25%"> <A NAME="android.service.voice.VoiceInteractionSession.show_added(android.os.Bundle, int)"></A> <nobr><code>void</code>&nbsp;<A HREF="../../../../reference/android/service/voice/VoiceInteractionSession.html#show(android.os.Bundle, int)" target="_top"><code>show</code></A>(<code>Bundle,</nobr> int<nobr><nobr></code>)</nobr> </TD> <TD>&nbsp;</TD> </TR> <TR BGCOLOR="#FFFFFF" CLASS="TableRowColor"> <TD VALIGN="TOP" WIDTH="25%"> <A NAME="android.service.voice.VoiceInteractionSession.startVoiceActivity_added(android.content.Intent)"></A> <nobr><code>void</code>&nbsp;<A HREF="../../../../reference/android/service/voice/VoiceInteractionSession.html#startVoiceActivity(android.content.Intent)" target="_top"><code>startVoiceActivity</code></A>(<code>Intent</code>)</nobr> </TD> <TD>&nbsp;</TD> </TR> </TABLE> &nbsp; <p> <a NAME="Changed"></a> <TABLE summary="Changed Methods" WIDTH="100%"> <TR> <TH VALIGN="TOP" COLSPAN=3>Changed Methods</FONT></TD> </TH> <TR BGCOLOR="#FFFFFF" CLASS="TableRowColor"> <TD VALIGN="TOP" WIDTH="25%"> <A NAME="android.service.voice.VoiceInteractionSession.onCreate_changed()"></A> <nobr><code>void</code>&nbsp;<A HREF="../../../../reference/android/service/voice/VoiceInteractionSession.html#onCreate()" target="_top"><code>onCreate</code></A>() </nobr> </TD> <TD VALIGN="TOP" WIDTH="30%"> Change in signature from <code>Bundle</code> to <code>void</code>.<br> </TD> <TD>&nbsp;</TD> </TR> </TABLE> &nbsp; <a NAME="fields"></a> <p> <a NAME="Added"></a> <TABLE summary="Added Fields" WIDTH="100%"> <TR> <TH VALIGN="TOP" COLSPAN=2>Added Fields</FONT></TD> </TH> <TR BGCOLOR="#FFFFFF" CLASS="TableRowColor"> <TD VALIGN="TOP" WIDTH="25%"> <A NAME="android.service.voice.VoiceInteractionSession.SHOW_SOURCE_APPLICATION"></A> <nobr><code>int</code>&nbsp;<A HREF="../../../../reference/android/service/voice/VoiceInteractionSession.html#SHOW_SOURCE_APPLICATION" target="_top"><code>SHOW_SOURCE_APPLICATION</code></A></nobr> </TD> <TD>&nbsp;</TD> </TR> <TR BGCOLOR="#FFFFFF" CLASS="TableRowColor"> <TD VALIGN="TOP" WIDTH="25%"> <A NAME="android.service.voice.VoiceInteractionSession.SHOW_SOURCE_ASSIST_GESTURE"></A> <nobr><code>int</code>&nbsp;<A HREF="../../../../reference/android/service/voice/VoiceInteractionSession.html#SHOW_SOURCE_ASSIST_GESTURE" target="_top"><code>SHOW_SOURCE_ASSIST_GESTURE</code></A></nobr> </TD> <TD>&nbsp;</TD> </TR> <TR BGCOLOR="#FFFFFF" CLASS="TableRowColor"> <TD VALIGN="TOP" WIDTH="25%"> <A NAME="android.service.voice.VoiceInteractionSession.SHOW_WITH_ASSIST"></A> <nobr><code>int</code>&nbsp;<A HREF="../../../../reference/android/service/voice/VoiceInteractionSession.html#SHOW_WITH_ASSIST" target="_top"><code>SHOW_WITH_ASSIST</code></A></nobr> </TD> <TD>&nbsp;</TD> </TR> <TR BGCOLOR="#FFFFFF" CLASS="TableRowColor"> <TD VALIGN="TOP" WIDTH="25%"> <A NAME="android.service.voice.VoiceInteractionSession.SHOW_WITH_SCREENSHOT"></A> <nobr><code>int</code>&nbsp;<A HREF="../../../../reference/android/service/voice/VoiceInteractionSession.html#SHOW_WITH_SCREENSHOT" target="_top"><code>SHOW_WITH_SCREENSHOT</code></A></nobr> </TD> <TD>&nbsp;</TD> </TR> </TABLE> &nbsp; </div> <div id="footer"> <div id="copyright"> Except as noted, this content is licensed under <a href="http://creativecommons.org/licenses/by/2.5/"> Creative Commons Attribution 2.5</a>. For details and restrictions, see the <a href="/license.html">Content License</a>. </div> <div id="footerlinks"> <p> <a href="http://www.android.com/terms.html">Site Terms of Service</a> - <a href="http://www.android.com/privacy.html">Privacy Policy</a> - <a href="http://www.android.com/branding.html">Brand Guidelines</a> </p> </div> </div> <!-- end footer --> </div><!-- end doc-content --> </div> <!-- end body-content --> <script src="https://www.google-analytics.com/ga.js" type="text/javascript"></script> <script type="text/javascript"> try { var pageTracker = _gat._getTracker("UA-5831155-1"); pageTracker._setAllowAnchor(true); pageTracker._initData(); pageTracker._trackPageview(); } catch(e) {} </script> </BODY> </HTML>
{ "pile_set_name": "Github" }
<?xml version="1.0" encoding="UTF-8"?> <phpunit colors="true" bootstrap="vendor/autoload.php"> <testsuites> <testsuite name="all"> <directory suffix="Test.php">tests/</directory> </testsuite> </testsuites> <filter> <whitelist> <directory suffix=".php">src/</directory> </whitelist> </filter> <logging> <log type="tap" target="build/report.tap"/> <log type="junit" target="build/report.junit.xml"/> <log type="coverage-html" target="build/coverage" charset="UTF-8" yui="true" highlight="true"/> <log type="coverage-text" target="build/coverage.txt"/> <log type="coverage-clover" target="build/logs/clover.xml"/> </logging> </phpunit>
{ "pile_set_name": "Github" }
/* * Copyright (c) 2000, 2017, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it * under the terms of the GNU General Public License version 2 only, as * published by the Free Software Foundation. Oracle designates this * particular file as subject to the "Classpath" exception as provided * by Oracle in the LICENSE file that accompanied this code. * * This code is distributed in the hope that it will be useful, but WITHOUT * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License * version 2 for more details (a copy is included in the LICENSE file that * accompanied this code). * * You should have received a copy of the GNU General Public License version * 2 along with this work; if not, write to the Free Software Foundation, * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. * * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA * or visit www.oracle.com if you need additional information or have any * questions. */ package javax.print.attribute.standard; import javax.print.attribute.Attribute; import javax.print.attribute.IntegerSyntax; import javax.print.attribute.PrintJobAttribute; /** * Class {@code NumberOfDocuments} is an integer valued printing attribute that * indicates the number of individual docs the printer has accepted for this * job, regardless of whether the docs' print data has reached the printer or * not. * <p> * <b>IPP Compatibility:</b> The integer value gives the IPP integer value. The * category name returned by {@code getName()} gives the IPP attribute name. * * @author Alan Kaminsky */ public final class NumberOfDocuments extends IntegerSyntax implements PrintJobAttribute { /** * Use serialVersionUID from JDK 1.4 for interoperability. */ private static final long serialVersionUID = 7891881310684461097L; /** * Construct a new number of documents attribute with the given integer * value. * * @param value Integer value * @throws IllegalArgumentException if {@code value} is negative */ public NumberOfDocuments(int value) { super (value, 0, Integer.MAX_VALUE); } /** * Returns whether this number of documents attribute is equivalent to the * passed in object. To be equivalent, all of the following conditions must * be true: * <ol type=1> * <li>{@code object} is not {@code null}. * <li>{@code object} is an instance of class {@code NumberOfDocuments}. * <li>This number of documents attribute's value and {@code object}'s * value are equal. * </ol> * * @param object {@code Object} to compare to * @return {@code true} if {@code object} is equivalent to this number of * documents attribute, {@code false} otherwise */ public boolean equals(Object object) { return (super.equals (object) && object instanceof NumberOfDocuments); } /** * Get the printing attribute class which is to be used as the "category" * for this printing attribute value. * <p> * For class {@code NumberOfDocuments}, the category is class * {@code NumberOfDocuments} itself. * * @return printing attribute class (category), an instance of class * {@link Class java.lang.Class} */ public final Class<? extends Attribute> getCategory() { return NumberOfDocuments.class; } /** * Get the name of the category of which this attribute value is an * instance. * <p> * For class {@code NumberOfDocuments}, the category name is * {@code "number-of-documents"}. * * @return attribute category name */ public final String getName() { return "number-of-documents"; } }
{ "pile_set_name": "Github" }
/* * Interface wrapper code. * * Generated by SIP 4.11.2 on Thu Jul 12 20:03:17 2012 * * Copyright (c) 2010 Riverbank Computing Limited <[email protected]> * * This file is part of PyQt. * * This file may be used under the terms of the GNU General Public * License versions 2.0 or 3.0 as published by the Free Software * Foundation and appearing in the files LICENSE.GPL2 and LICENSE.GPL3 * included in the packaging of this file. Alternatively you may (at * your option) use any later version of the GNU General Public * License if such license has been publicly approved by Riverbank * Computing Limited (or its successors, if any) and the KDE Free Qt * Foundation. In addition, as a special exception, Riverbank gives you * certain additional rights. These rights are described in the Riverbank * GPL Exception version 1.1, which can be found in the file * GPL_EXCEPTION.txt in this package. * * Please review the following information to ensure GNU General * Public Licensing requirements will be met: * http://trolltech.com/products/qt/licenses/licensing/opensource/. If * you are unsure which license is appropriate for your use, please * review the following information: * http://trolltech.com/products/qt/licenses/licensing/licensingoverview * or contact the sales department at [email protected]. * * This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE * WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. */ #include "sipAPIQtGui.h" #line 36 "/home/tsheasha/GUC/Bachelors/android-python27/python-build/PyQt-x11-gpl-4.8/sip/QtGui/qshortcut.sip" #include <qshortcut.h> #line 39 "sipQtGuiQShortcut.cpp" #line 40 "/home/tsheasha/GUC/Bachelors/android-python27/python-build/PyQt-x11-gpl-4.8/sip/QtGui/qwidget.sip" #include <qwidget.h> #line 43 "sipQtGuiQShortcut.cpp" #line 40 "/home/tsheasha/GUC/Bachelors/android-python27/python-build/PyQt-x11-gpl-4.8/sip/QtGui/qkeysequence.sip" #include <qkeysequence.h> #line 46 "sipQtGuiQShortcut.cpp" #line 40 "/home/tsheasha/GUC/Bachelors/android-python27/python-build/PyQt-x11-gpl-4.8/sip/QtCore/qnamespace.sip" #include <qnamespace.h> #line 49 "sipQtGuiQShortcut.cpp" #line 36 "/home/tsheasha/GUC/Bachelors/android-python27/python-build/PyQt-x11-gpl-4.8/sip/QtCore/qcoreevent.sip" #include <qcoreevent.h> #line 52 "sipQtGuiQShortcut.cpp" #line 41 "/home/tsheasha/GUC/Bachelors/android-python27/python-build/PyQt-x11-gpl-4.8/sip/QtCore/qstring.sip" #include <qstring.h> #line 55 "sipQtGuiQShortcut.cpp" #line 315 "/home/tsheasha/GUC/Bachelors/android-python27/python-build/PyQt-x11-gpl-4.8/sip/QtCore/qcoreevent.sip" #include <qcoreevent.h> #line 58 "sipQtGuiQShortcut.cpp" #line 303 "/home/tsheasha/GUC/Bachelors/android-python27/python-build/PyQt-x11-gpl-4.8/sip/QtCore/qcoreevent.sip" #include <qcoreevent.h> #line 61 "sipQtGuiQShortcut.cpp" #line 39 "/home/tsheasha/GUC/Bachelors/android-python27/python-build/PyQt-x11-gpl-4.8/sip/QtCore/qobject.sip" #include <qobject.h> #line 64 "sipQtGuiQShortcut.cpp" #line 41 "/home/tsheasha/GUC/Bachelors/android-python27/python-build/PyQt-x11-gpl-4.8/sip/QtCore/qvariant.sip" #include <qvariant.h> #line 67 "sipQtGuiQShortcut.cpp" #line 38 "/home/tsheasha/GUC/Bachelors/android-python27/python-build/PyQt-x11-gpl-4.8/sip/QtCore/qlist.sip" #include <qlist.h> #line 70 "sipQtGuiQShortcut.cpp" #line 42 "/home/tsheasha/GUC/Bachelors/android-python27/python-build/PyQt-x11-gpl-4.8/sip/QtCore/qbytearray.sip" #include <qbytearray.h> #line 73 "sipQtGuiQShortcut.cpp" #line 125 "/home/tsheasha/GUC/Bachelors/android-python27/python-build/PyQt-x11-gpl-4.8/sip/QtCore/qlist.sip" #include <qlist.h> #line 76 "sipQtGuiQShortcut.cpp" #line 36 "/home/tsheasha/GUC/Bachelors/android-python27/python-build/PyQt-x11-gpl-4.8/sip/QtCore/qthread.sip" #include <qthread.h> #line 79 "sipQtGuiQShortcut.cpp" #line 40 "/home/tsheasha/GUC/Bachelors/android-python27/python-build/PyQt-x11-gpl-4.8/sip/QtCore/qregexp.sip" #include <qregexp.h> #line 82 "sipQtGuiQShortcut.cpp" #line 36 "/home/tsheasha/GUC/Bachelors/android-python27/python-build/PyQt-x11-gpl-4.8/sip/QtCore/qobjectdefs.sip" #include <qobjectdefs.h> #line 85 "sipQtGuiQShortcut.cpp" class sipQShortcut : public QShortcut { public: sipQShortcut(QWidget *); sipQShortcut(const QKeySequence&,QWidget *,const char *,const char *,Qt::ShortcutContext); virtual ~sipQShortcut(); int qt_metacall(QMetaObject::Call,int,void **); void *qt_metacast(const char *); const QMetaObject *metaObject() const; /* * There is a public method for every protected method visible from * this class. */ QObject * sipProtect_sender() const; int sipProtect_receivers(const char *) const; void sipProtectVirt_timerEvent(bool,QTimerEvent *); void sipProtectVirt_childEvent(bool,QChildEvent *); void sipProtectVirt_customEvent(bool,QEvent *); void sipProtectVirt_connectNotify(bool,const char *); void sipProtectVirt_disconnectNotify(bool,const char *); bool sipProtectVirt_event(bool,QEvent *); /* * There is a protected method for every virtual method visible from * this class. */ protected: bool event(QEvent *); bool eventFilter(QObject *,QEvent *); void timerEvent(QTimerEvent *); void childEvent(QChildEvent *); void customEvent(QEvent *); void connectNotify(const char *); void disconnectNotify(const char *); public: sipSimpleWrapper *sipPySelf; private: sipQShortcut(const sipQShortcut &); sipQShortcut &operator = (const sipQShortcut &); char sipPyMethods[7]; }; sipQShortcut::sipQShortcut(QWidget *a0): QShortcut(a0), sipPySelf(0) { memset(sipPyMethods, 0, sizeof (sipPyMethods)); } sipQShortcut::sipQShortcut(const QKeySequence& a0,QWidget *a1,const char *a2,const char *a3,Qt::ShortcutContext a4): QShortcut(a0,a1,a2,a3,a4), sipPySelf(0) { memset(sipPyMethods, 0, sizeof (sipPyMethods)); } sipQShortcut::~sipQShortcut() { sipCommonDtor(sipPySelf); } const QMetaObject *sipQShortcut::metaObject() const { return sip_QtGui_qt_metaobject(sipPySelf,sipType_QShortcut); } int sipQShortcut::qt_metacall(QMetaObject::Call _c,int _id,void **_a) { _id = QShortcut::qt_metacall(_c,_id,_a); if (_id >= 0) _id = sip_QtGui_qt_metacall(sipPySelf,sipType_QShortcut,_c,_id,_a); return _id; } void *sipQShortcut::qt_metacast(const char *_clname) { return (sip_QtGui_qt_metacast && sip_QtGui_qt_metacast(sipPySelf,sipType_QShortcut,_clname)) ? this : QShortcut::qt_metacast(_clname); } bool sipQShortcut::event(QEvent *a0) { sip_gilstate_t sipGILState; PyObject *meth; meth = sipIsPyMethod(&sipGILState,&sipPyMethods[0],sipPySelf,NULL,sipName_event); if (!meth) return QShortcut::event(a0); typedef bool (*sipVH_QtCore_5)(sip_gilstate_t,PyObject *,QEvent *); return ((sipVH_QtCore_5)(sipModuleAPI_QtGui_QtCore->em_virthandlers[5]))(sipGILState,meth,a0); } bool sipQShortcut::eventFilter(QObject *a0,QEvent *a1) { sip_gilstate_t sipGILState; PyObject *meth; meth = sipIsPyMethod(&sipGILState,&sipPyMethods[1],sipPySelf,NULL,sipName_eventFilter); if (!meth) return QObject::eventFilter(a0,a1); typedef bool (*sipVH_QtCore_18)(sip_gilstate_t,PyObject *,QObject *,QEvent *); return ((sipVH_QtCore_18)(sipModuleAPI_QtGui_QtCore->em_virthandlers[18]))(sipGILState,meth,a0,a1); } void sipQShortcut::timerEvent(QTimerEvent *a0) { sip_gilstate_t sipGILState; PyObject *meth; meth = sipIsPyMethod(&sipGILState,&sipPyMethods[2],sipPySelf,NULL,sipName_timerEvent); if (!meth) { QObject::timerEvent(a0); return; } typedef void (*sipVH_QtCore_9)(sip_gilstate_t,PyObject *,QTimerEvent *); ((sipVH_QtCore_9)(sipModuleAPI_QtGui_QtCore->em_virthandlers[9]))(sipGILState,meth,a0); } void sipQShortcut::childEvent(QChildEvent *a0) { sip_gilstate_t sipGILState; PyObject *meth; meth = sipIsPyMethod(&sipGILState,&sipPyMethods[3],sipPySelf,NULL,sipName_childEvent); if (!meth) { QObject::childEvent(a0); return; } typedef void (*sipVH_QtCore_25)(sip_gilstate_t,PyObject *,QChildEvent *); ((sipVH_QtCore_25)(sipModuleAPI_QtGui_QtCore->em_virthandlers[25]))(sipGILState,meth,a0); } void sipQShortcut::customEvent(QEvent *a0) { sip_gilstate_t sipGILState; PyObject *meth; meth = sipIsPyMethod(&sipGILState,&sipPyMethods[4],sipPySelf,NULL,sipName_customEvent); if (!meth) { QObject::customEvent(a0); return; } typedef void (*sipVH_QtCore_17)(sip_gilstate_t,PyObject *,QEvent *); ((sipVH_QtCore_17)(sipModuleAPI_QtGui_QtCore->em_virthandlers[17]))(sipGILState,meth,a0); } void sipQShortcut::connectNotify(const char *a0) { sip_gilstate_t sipGILState; PyObject *meth; meth = sipIsPyMethod(&sipGILState,&sipPyMethods[5],sipPySelf,NULL,sipName_connectNotify); if (!meth) { QObject::connectNotify(a0); return; } typedef void (*sipVH_QtCore_24)(sip_gilstate_t,PyObject *,const char *); ((sipVH_QtCore_24)(sipModuleAPI_QtGui_QtCore->em_virthandlers[24]))(sipGILState,meth,a0); } void sipQShortcut::disconnectNotify(const char *a0) { sip_gilstate_t sipGILState; PyObject *meth; meth = sipIsPyMethod(&sipGILState,&sipPyMethods[6],sipPySelf,NULL,sipName_disconnectNotify); if (!meth) { QObject::disconnectNotify(a0); return; } typedef void (*sipVH_QtCore_24)(sip_gilstate_t,PyObject *,const char *); ((sipVH_QtCore_24)(sipModuleAPI_QtGui_QtCore->em_virthandlers[24]))(sipGILState,meth,a0); } QObject * sipQShortcut::sipProtect_sender() const { return QObject::sender(); } int sipQShortcut::sipProtect_receivers(const char *a0) const { return QObject::receivers(a0); } void sipQShortcut::sipProtectVirt_timerEvent(bool sipSelfWasArg,QTimerEvent *a0) { (sipSelfWasArg ? QObject::timerEvent(a0) : timerEvent(a0)); } void sipQShortcut::sipProtectVirt_childEvent(bool sipSelfWasArg,QChildEvent *a0) { (sipSelfWasArg ? QObject::childEvent(a0) : childEvent(a0)); } void sipQShortcut::sipProtectVirt_customEvent(bool sipSelfWasArg,QEvent *a0) { (sipSelfWasArg ? QObject::customEvent(a0) : customEvent(a0)); } void sipQShortcut::sipProtectVirt_connectNotify(bool sipSelfWasArg,const char *a0) { (sipSelfWasArg ? QObject::connectNotify(a0) : connectNotify(a0)); } void sipQShortcut::sipProtectVirt_disconnectNotify(bool sipSelfWasArg,const char *a0) { (sipSelfWasArg ? QObject::disconnectNotify(a0) : disconnectNotify(a0)); } bool sipQShortcut::sipProtectVirt_event(bool sipSelfWasArg,QEvent *a0) { return (sipSelfWasArg ? QShortcut::event(a0) : event(a0)); } extern "C" {static PyObject *meth_QShortcut_sender(PyObject *, PyObject *);} static PyObject *meth_QShortcut_sender(PyObject *sipSelf, PyObject *sipArgs) { PyObject *sipParseErr = NULL; { sipQShortcut *sipCpp; if (sipParseArgs(&sipParseErr, sipArgs, "B", &sipSelf, sipType_QShortcut, &sipCpp)) { QObject *sipRes = 0; #line 529 "/home/tsheasha/GUC/Bachelors/android-python27/python-build/PyQt-x11-gpl-4.8/sip/QtCore/qobject.sip" typedef QObject *(*helper_func)(QObject *); static helper_func helper = 0; if (!helper) helper = (helper_func)sipImportSymbol("qpycore_qobject_sender"); if (helper) #if defined(SIP_PROTECTED_IS_PUBLIC) sipRes = helper(sipCpp->sender()); #else sipRes = helper(sipCpp->sipProtect_sender()); #endif #line 357 "sipQtGuiQShortcut.cpp" return sipConvertFromType(sipRes,sipType_QObject,NULL); } } /* Raise an exception if the arguments couldn't be parsed. */ sipNoMethod(sipParseErr, sipName_QShortcut, sipName_sender, NULL); return NULL; } extern "C" {static PyObject *meth_QShortcut_receivers(PyObject *, PyObject *);} static PyObject *meth_QShortcut_receivers(PyObject *sipSelf, PyObject *sipArgs) { PyObject *sipParseErr = NULL; { char * a0; sipQShortcut *sipCpp; if (sipParseArgs(&sipParseErr, sipArgs, "BG", &sipSelf, sipType_QShortcut, &sipCpp, &a0)) { int sipRes = 0; #line 546 "/home/tsheasha/GUC/Bachelors/android-python27/python-build/PyQt-x11-gpl-4.8/sip/QtCore/qobject.sip" // We need to take into account any proxies for Python signals. Import the // helper if it hasn't already been done. typedef int (*helper_func)(QObject *, const char *, int); static helper_func helper = 0; if (!helper) helper = (helper_func)sipImportSymbol("qpycore_qobject_receivers"); if (helper) #if defined(SIP_PROTECTED_IS_PUBLIC) sipRes = helper(sipCpp, a0, sipCpp->receivers(a0)); #else sipRes = helper(sipCpp, a0, sipCpp->sipProtect_receivers(a0)); #endif #line 399 "sipQtGuiQShortcut.cpp" return SIPLong_FromLong(sipRes); } } /* Raise an exception if the arguments couldn't be parsed. */ sipNoMethod(sipParseErr, sipName_QShortcut, sipName_receivers, NULL); return NULL; } extern "C" {static PyObject *meth_QShortcut_timerEvent(PyObject *, PyObject *);} static PyObject *meth_QShortcut_timerEvent(PyObject *sipSelf, PyObject *sipArgs) { PyObject *sipParseErr = NULL; bool sipSelfWasArg = (!sipSelf || sipIsDerived((sipSimpleWrapper *)sipSelf)); { QTimerEvent * a0; sipQShortcut *sipCpp; if (sipParseArgs(&sipParseErr, sipArgs, "BJ8", &sipSelf, sipType_QShortcut, &sipCpp, sipType_QTimerEvent, &a0)) { Py_BEGIN_ALLOW_THREADS sipCpp->sipProtectVirt_timerEvent(sipSelfWasArg,a0); Py_END_ALLOW_THREADS Py_INCREF(Py_None); return Py_None; } } /* Raise an exception if the arguments couldn't be parsed. */ sipNoMethod(sipParseErr, sipName_QShortcut, sipName_timerEvent, NULL); return NULL; } extern "C" {static PyObject *meth_QShortcut_childEvent(PyObject *, PyObject *);} static PyObject *meth_QShortcut_childEvent(PyObject *sipSelf, PyObject *sipArgs) { PyObject *sipParseErr = NULL; bool sipSelfWasArg = (!sipSelf || sipIsDerived((sipSimpleWrapper *)sipSelf)); { QChildEvent * a0; sipQShortcut *sipCpp; if (sipParseArgs(&sipParseErr, sipArgs, "BJ8", &sipSelf, sipType_QShortcut, &sipCpp, sipType_QChildEvent, &a0)) { Py_BEGIN_ALLOW_THREADS sipCpp->sipProtectVirt_childEvent(sipSelfWasArg,a0); Py_END_ALLOW_THREADS Py_INCREF(Py_None); return Py_None; } } /* Raise an exception if the arguments couldn't be parsed. */ sipNoMethod(sipParseErr, sipName_QShortcut, sipName_childEvent, NULL); return NULL; } extern "C" {static PyObject *meth_QShortcut_customEvent(PyObject *, PyObject *);} static PyObject *meth_QShortcut_customEvent(PyObject *sipSelf, PyObject *sipArgs) { PyObject *sipParseErr = NULL; bool sipSelfWasArg = (!sipSelf || sipIsDerived((sipSimpleWrapper *)sipSelf)); { QEvent * a0; sipQShortcut *sipCpp; if (sipParseArgs(&sipParseErr, sipArgs, "BJ8", &sipSelf, sipType_QShortcut, &sipCpp, sipType_QEvent, &a0)) { Py_BEGIN_ALLOW_THREADS sipCpp->sipProtectVirt_customEvent(sipSelfWasArg,a0); Py_END_ALLOW_THREADS Py_INCREF(Py_None); return Py_None; } } /* Raise an exception if the arguments couldn't be parsed. */ sipNoMethod(sipParseErr, sipName_QShortcut, sipName_customEvent, NULL); return NULL; } extern "C" {static PyObject *meth_QShortcut_connectNotify(PyObject *, PyObject *);} static PyObject *meth_QShortcut_connectNotify(PyObject *sipSelf, PyObject *sipArgs) { PyObject *sipParseErr = NULL; bool sipSelfWasArg = (!sipSelf || sipIsDerived((sipSimpleWrapper *)sipSelf)); { char * a0; sipQShortcut *sipCpp; if (sipParseArgs(&sipParseErr, sipArgs, "BG", &sipSelf, sipType_QShortcut, &sipCpp, &a0)) { Py_BEGIN_ALLOW_THREADS sipCpp->sipProtectVirt_connectNotify(sipSelfWasArg,a0); Py_END_ALLOW_THREADS Py_INCREF(Py_None); return Py_None; } } /* Raise an exception if the arguments couldn't be parsed. */ sipNoMethod(sipParseErr, sipName_QShortcut, sipName_connectNotify, NULL); return NULL; } extern "C" {static PyObject *meth_QShortcut_disconnectNotify(PyObject *, PyObject *);} static PyObject *meth_QShortcut_disconnectNotify(PyObject *sipSelf, PyObject *sipArgs) { PyObject *sipParseErr = NULL; bool sipSelfWasArg = (!sipSelf || sipIsDerived((sipSimpleWrapper *)sipSelf)); { char * a0; sipQShortcut *sipCpp; if (sipParseArgs(&sipParseErr, sipArgs, "BG", &sipSelf, sipType_QShortcut, &sipCpp, &a0)) { Py_BEGIN_ALLOW_THREADS sipCpp->sipProtectVirt_disconnectNotify(sipSelfWasArg,a0); Py_END_ALLOW_THREADS Py_INCREF(Py_None); return Py_None; } } /* Raise an exception if the arguments couldn't be parsed. */ sipNoMethod(sipParseErr, sipName_QShortcut, sipName_disconnectNotify, NULL); return NULL; } extern "C" {static PyObject *meth_QShortcut_setKey(PyObject *, PyObject *);} static PyObject *meth_QShortcut_setKey(PyObject *sipSelf, PyObject *sipArgs) { PyObject *sipParseErr = NULL; { const QKeySequence * a0; int a0State = 0; QShortcut *sipCpp; if (sipParseArgs(&sipParseErr, sipArgs, "BJ1", &sipSelf, sipType_QShortcut, &sipCpp, sipType_QKeySequence, &a0, &a0State)) { Py_BEGIN_ALLOW_THREADS sipCpp->setKey(*a0); Py_END_ALLOW_THREADS sipReleaseType(const_cast<QKeySequence *>(a0),sipType_QKeySequence,a0State); Py_INCREF(Py_None); return Py_None; } } /* Raise an exception if the arguments couldn't be parsed. */ sipNoMethod(sipParseErr, sipName_QShortcut, sipName_setKey, NULL); return NULL; } extern "C" {static PyObject *meth_QShortcut_key(PyObject *, PyObject *);} static PyObject *meth_QShortcut_key(PyObject *sipSelf, PyObject *sipArgs) { PyObject *sipParseErr = NULL; { QShortcut *sipCpp; if (sipParseArgs(&sipParseErr, sipArgs, "B", &sipSelf, sipType_QShortcut, &sipCpp)) { QKeySequence *sipRes; Py_BEGIN_ALLOW_THREADS sipRes = new QKeySequence(sipCpp->key()); Py_END_ALLOW_THREADS return sipConvertFromNewType(sipRes,sipType_QKeySequence,NULL); } } /* Raise an exception if the arguments couldn't be parsed. */ sipNoMethod(sipParseErr, sipName_QShortcut, sipName_key, NULL); return NULL; } extern "C" {static PyObject *meth_QShortcut_setEnabled(PyObject *, PyObject *);} static PyObject *meth_QShortcut_setEnabled(PyObject *sipSelf, PyObject *sipArgs) { PyObject *sipParseErr = NULL; { bool a0; QShortcut *sipCpp; if (sipParseArgs(&sipParseErr, sipArgs, "Bb", &sipSelf, sipType_QShortcut, &sipCpp, &a0)) { Py_BEGIN_ALLOW_THREADS sipCpp->setEnabled(a0); Py_END_ALLOW_THREADS Py_INCREF(Py_None); return Py_None; } } /* Raise an exception if the arguments couldn't be parsed. */ sipNoMethod(sipParseErr, sipName_QShortcut, sipName_setEnabled, NULL); return NULL; } extern "C" {static PyObject *meth_QShortcut_isEnabled(PyObject *, PyObject *);} static PyObject *meth_QShortcut_isEnabled(PyObject *sipSelf, PyObject *sipArgs) { PyObject *sipParseErr = NULL; { QShortcut *sipCpp; if (sipParseArgs(&sipParseErr, sipArgs, "B", &sipSelf, sipType_QShortcut, &sipCpp)) { bool sipRes; Py_BEGIN_ALLOW_THREADS sipRes = sipCpp->isEnabled(); Py_END_ALLOW_THREADS return PyBool_FromLong(sipRes); } } /* Raise an exception if the arguments couldn't be parsed. */ sipNoMethod(sipParseErr, sipName_QShortcut, sipName_isEnabled, NULL); return NULL; } extern "C" {static PyObject *meth_QShortcut_setContext(PyObject *, PyObject *);} static PyObject *meth_QShortcut_setContext(PyObject *sipSelf, PyObject *sipArgs) { PyObject *sipParseErr = NULL; { Qt::ShortcutContext a0; QShortcut *sipCpp; if (sipParseArgs(&sipParseErr, sipArgs, "BE", &sipSelf, sipType_QShortcut, &sipCpp, sipType_Qt_ShortcutContext, &a0)) { Py_BEGIN_ALLOW_THREADS sipCpp->setContext(a0); Py_END_ALLOW_THREADS Py_INCREF(Py_None); return Py_None; } } /* Raise an exception if the arguments couldn't be parsed. */ sipNoMethod(sipParseErr, sipName_QShortcut, sipName_setContext, NULL); return NULL; } extern "C" {static PyObject *meth_QShortcut_context(PyObject *, PyObject *);} static PyObject *meth_QShortcut_context(PyObject *sipSelf, PyObject *sipArgs) { PyObject *sipParseErr = NULL; { QShortcut *sipCpp; if (sipParseArgs(&sipParseErr, sipArgs, "B", &sipSelf, sipType_QShortcut, &sipCpp)) { Qt::ShortcutContext sipRes; Py_BEGIN_ALLOW_THREADS sipRes = sipCpp->context(); Py_END_ALLOW_THREADS return sipConvertFromEnum(sipRes,sipType_Qt_ShortcutContext); } } /* Raise an exception if the arguments couldn't be parsed. */ sipNoMethod(sipParseErr, sipName_QShortcut, sipName_context, NULL); return NULL; } extern "C" {static PyObject *meth_QShortcut_setWhatsThis(PyObject *, PyObject *);} static PyObject *meth_QShortcut_setWhatsThis(PyObject *sipSelf, PyObject *sipArgs) { PyObject *sipParseErr = NULL; { const QString * a0; int a0State = 0; QShortcut *sipCpp; if (sipParseArgs(&sipParseErr, sipArgs, "BJ1", &sipSelf, sipType_QShortcut, &sipCpp, sipType_QString,&a0, &a0State)) { Py_BEGIN_ALLOW_THREADS sipCpp->setWhatsThis(*a0); Py_END_ALLOW_THREADS sipReleaseType(const_cast<QString *>(a0),sipType_QString,a0State); Py_INCREF(Py_None); return Py_None; } } /* Raise an exception if the arguments couldn't be parsed. */ sipNoMethod(sipParseErr, sipName_QShortcut, sipName_setWhatsThis, NULL); return NULL; } extern "C" {static PyObject *meth_QShortcut_whatsThis(PyObject *, PyObject *);} static PyObject *meth_QShortcut_whatsThis(PyObject *sipSelf, PyObject *sipArgs) { PyObject *sipParseErr = NULL; { QShortcut *sipCpp; if (sipParseArgs(&sipParseErr, sipArgs, "B", &sipSelf, sipType_QShortcut, &sipCpp)) { QString *sipRes; Py_BEGIN_ALLOW_THREADS sipRes = new QString(sipCpp->whatsThis()); Py_END_ALLOW_THREADS return sipConvertFromNewType(sipRes,sipType_QString,NULL); } } /* Raise an exception if the arguments couldn't be parsed. */ sipNoMethod(sipParseErr, sipName_QShortcut, sipName_whatsThis, NULL); return NULL; } extern "C" {static PyObject *meth_QShortcut_id(PyObject *, PyObject *);} static PyObject *meth_QShortcut_id(PyObject *sipSelf, PyObject *sipArgs) { PyObject *sipParseErr = NULL; { QShortcut *sipCpp; if (sipParseArgs(&sipParseErr, sipArgs, "B", &sipSelf, sipType_QShortcut, &sipCpp)) { int sipRes; Py_BEGIN_ALLOW_THREADS sipRes = sipCpp->id(); Py_END_ALLOW_THREADS return SIPLong_FromLong(sipRes); } } /* Raise an exception if the arguments couldn't be parsed. */ sipNoMethod(sipParseErr, sipName_QShortcut, sipName_id, NULL); return NULL; } extern "C" {static PyObject *meth_QShortcut_parentWidget(PyObject *, PyObject *);} static PyObject *meth_QShortcut_parentWidget(PyObject *sipSelf, PyObject *sipArgs) { PyObject *sipParseErr = NULL; { QShortcut *sipCpp; if (sipParseArgs(&sipParseErr, sipArgs, "B", &sipSelf, sipType_QShortcut, &sipCpp)) { QWidget *sipRes; Py_BEGIN_ALLOW_THREADS sipRes = sipCpp->parentWidget(); Py_END_ALLOW_THREADS return sipConvertFromType(sipRes,sipType_QWidget,NULL); } } /* Raise an exception if the arguments couldn't be parsed. */ sipNoMethod(sipParseErr, sipName_QShortcut, sipName_parentWidget, NULL); return NULL; } extern "C" {static PyObject *meth_QShortcut_setAutoRepeat(PyObject *, PyObject *);} static PyObject *meth_QShortcut_setAutoRepeat(PyObject *sipSelf, PyObject *sipArgs) { PyObject *sipParseErr = NULL; { bool a0; QShortcut *sipCpp; if (sipParseArgs(&sipParseErr, sipArgs, "Bb", &sipSelf, sipType_QShortcut, &sipCpp, &a0)) { Py_BEGIN_ALLOW_THREADS sipCpp->setAutoRepeat(a0); Py_END_ALLOW_THREADS Py_INCREF(Py_None); return Py_None; } } /* Raise an exception if the arguments couldn't be parsed. */ sipNoMethod(sipParseErr, sipName_QShortcut, sipName_setAutoRepeat, NULL); return NULL; } extern "C" {static PyObject *meth_QShortcut_autoRepeat(PyObject *, PyObject *);} static PyObject *meth_QShortcut_autoRepeat(PyObject *sipSelf, PyObject *sipArgs) { PyObject *sipParseErr = NULL; { QShortcut *sipCpp; if (sipParseArgs(&sipParseErr, sipArgs, "B", &sipSelf, sipType_QShortcut, &sipCpp)) { bool sipRes; Py_BEGIN_ALLOW_THREADS sipRes = sipCpp->autoRepeat(); Py_END_ALLOW_THREADS return PyBool_FromLong(sipRes); } } /* Raise an exception if the arguments couldn't be parsed. */ sipNoMethod(sipParseErr, sipName_QShortcut, sipName_autoRepeat, NULL); return NULL; } extern "C" {static PyObject *meth_QShortcut_event(PyObject *, PyObject *);} static PyObject *meth_QShortcut_event(PyObject *sipSelf, PyObject *sipArgs) { PyObject *sipParseErr = NULL; bool sipSelfWasArg = (!sipSelf || sipIsDerived((sipSimpleWrapper *)sipSelf)); { QEvent * a0; sipQShortcut *sipCpp; if (sipParseArgs(&sipParseErr, sipArgs, "BJ8", &sipSelf, sipType_QShortcut, &sipCpp, sipType_QEvent, &a0)) { bool sipRes; Py_BEGIN_ALLOW_THREADS sipRes = sipCpp->sipProtectVirt_event(sipSelfWasArg,a0); Py_END_ALLOW_THREADS return PyBool_FromLong(sipRes); } } /* Raise an exception if the arguments couldn't be parsed. */ sipNoMethod(sipParseErr, sipName_QShortcut, sipName_event, NULL); return NULL; } /* Cast a pointer to a type somewhere in its superclass hierarchy. */ extern "C" {static void *cast_QShortcut(void *, const sipTypeDef *);} static void *cast_QShortcut(void *ptr, const sipTypeDef *targetType) { void *res; if (targetType == sipType_QShortcut) return ptr; if ((res = ((const sipClassTypeDef *)sipType_QObject)->ctd_cast((QObject *)(QShortcut *)ptr,targetType)) != NULL) return res; return NULL; } /* Call the instance's destructor. */ extern "C" {static void release_QShortcut(void *, int);} static void release_QShortcut(void *sipCppV,int sipState) { Py_BEGIN_ALLOW_THREADS if (sipState & SIP_DERIVED_CLASS) delete reinterpret_cast<sipQShortcut *>(sipCppV); else delete reinterpret_cast<QShortcut *>(sipCppV); Py_END_ALLOW_THREADS } extern "C" {static void dealloc_QShortcut(sipSimpleWrapper *);} static void dealloc_QShortcut(sipSimpleWrapper *sipSelf) { if (sipIsDerived(sipSelf)) reinterpret_cast<sipQShortcut *>(sipGetAddress(sipSelf))->sipPySelf = NULL; if (sipIsPyOwned(sipSelf)) { release_QShortcut(sipGetAddress(sipSelf),sipSelf->flags); } } extern "C" {static void *init_QShortcut(sipSimpleWrapper *, PyObject *, PyObject *, PyObject **, PyObject **, PyObject **);} static void *init_QShortcut(sipSimpleWrapper *sipSelf, PyObject *sipArgs, PyObject *sipKwds, PyObject **sipUnused, PyObject **sipOwner, PyObject **sipParseErr) { sipQShortcut *sipCpp = 0; { QWidget * a0; if (sipParseKwdArgs(sipParseErr, sipArgs, sipKwds, NULL, sipUnused, "JH", sipType_QWidget, &a0, sipOwner)) { Py_BEGIN_ALLOW_THREADS sipCpp = new sipQShortcut(a0); Py_END_ALLOW_THREADS sipCpp->sipPySelf = sipSelf; return sipCpp; } } { const QKeySequence * a0; int a0State = 0; QWidget * a1; char * a2Name = 0; PyObject *a2Callable = 0; char * a3Name = 0; PyObject *a3Callable = 0; Qt::ShortcutContext a4 = Qt::WindowShortcut; static const char *sipKwdList[] = { NULL, NULL, sipName_member, sipName_ambiguousMember, sipName_context, }; if (sipParseKwdArgs(sipParseErr, sipArgs, sipKwds, sipKwdList, sipUnused, "J1JH|UUE", sipType_QKeySequence, &a0, &a0State, sipType_QWidget, &a1, sipOwner, &a2Name, &a2Callable, &a3Name, &a3Callable, sipType_Qt_ShortcutContext, &a4)) { int sipIsErr = 0; #line 43 "/home/tsheasha/GUC/Bachelors/android-python27/python-build/PyQt-x11-gpl-4.8/sip/QtGui/qshortcut.sip" // Construct the shortcut without any connections. Py_BEGIN_ALLOW_THREADS sipCpp = new sipQShortcut(*a0, a1, 0, 0, a4); Py_END_ALLOW_THREADS if (a2Name || a2Callable) { void *rx2; const char *member2; // For convenience we use sipOwner from /TransferThis/ rather than // a1Wrapper from /GetWrapper/. rx2 = sipConvertRx(0, "()", (a2Callable ? a2Callable : (PyObject *)*sipOwner), a2Name, &member2, 0); if (rx2) { Py_BEGIN_ALLOW_THREADS QObject::connect(sipCpp, SIGNAL(activated()), reinterpret_cast<QObject *>(rx2), member2); Py_END_ALLOW_THREADS } else sipIsErr = 1; } if (a3Name || a3Callable) { void *rx3; const char *member3; // For convenience we use sipOwner from /TransferThis/ rather than // a1Wrapper from /GetWrapper/. rx3 = sipConvertRx(0, "()", (a3Callable ? a3Callable : (PyObject *)*sipOwner), a3Name, &member3, 0); if (rx3) { Py_BEGIN_ALLOW_THREADS QObject::connect(sipCpp, SIGNAL(activatedAmbiguously()), reinterpret_cast<QObject *>(rx3), member3); Py_END_ALLOW_THREADS } else sipIsErr = 1; } if (sipIsErr) delete sipCpp; #line 1043 "sipQtGuiQShortcut.cpp" sipReleaseType(const_cast<QKeySequence *>(a0),sipType_QKeySequence,a0State); if (sipIsErr) { if (sipUnused) { Py_XDECREF(*sipUnused); } sipAddException(sipErrorFail, sipParseErr); return NULL; } sipCpp->sipPySelf = sipSelf; return sipCpp; } } return NULL; } /* Define this type's super-types. */ static sipEncodedTypeDef supers_QShortcut[] = {{133, 0, 1}}; static PyMethodDef methods_QShortcut[] = { {SIP_MLNAME_CAST(sipName_autoRepeat), meth_QShortcut_autoRepeat, METH_VARARGS, NULL}, {SIP_MLNAME_CAST(sipName_childEvent), meth_QShortcut_childEvent, METH_VARARGS, NULL}, {SIP_MLNAME_CAST(sipName_connectNotify), meth_QShortcut_connectNotify, METH_VARARGS, NULL}, {SIP_MLNAME_CAST(sipName_context), meth_QShortcut_context, METH_VARARGS, NULL}, {SIP_MLNAME_CAST(sipName_customEvent), meth_QShortcut_customEvent, METH_VARARGS, NULL}, {SIP_MLNAME_CAST(sipName_disconnectNotify), meth_QShortcut_disconnectNotify, METH_VARARGS, NULL}, {SIP_MLNAME_CAST(sipName_event), meth_QShortcut_event, METH_VARARGS, NULL}, {SIP_MLNAME_CAST(sipName_id), meth_QShortcut_id, METH_VARARGS, NULL}, {SIP_MLNAME_CAST(sipName_isEnabled), meth_QShortcut_isEnabled, METH_VARARGS, NULL}, {SIP_MLNAME_CAST(sipName_key), meth_QShortcut_key, METH_VARARGS, NULL}, {SIP_MLNAME_CAST(sipName_parentWidget), meth_QShortcut_parentWidget, METH_VARARGS, NULL}, {SIP_MLNAME_CAST(sipName_receivers), meth_QShortcut_receivers, METH_VARARGS, NULL}, {SIP_MLNAME_CAST(sipName_sender), meth_QShortcut_sender, METH_VARARGS, NULL}, {SIP_MLNAME_CAST(sipName_setAutoRepeat), meth_QShortcut_setAutoRepeat, METH_VARARGS, NULL}, {SIP_MLNAME_CAST(sipName_setContext), meth_QShortcut_setContext, METH_VARARGS, NULL}, {SIP_MLNAME_CAST(sipName_setEnabled), meth_QShortcut_setEnabled, METH_VARARGS, NULL}, {SIP_MLNAME_CAST(sipName_setKey), meth_QShortcut_setKey, METH_VARARGS, NULL}, {SIP_MLNAME_CAST(sipName_setWhatsThis), meth_QShortcut_setWhatsThis, METH_VARARGS, NULL}, {SIP_MLNAME_CAST(sipName_timerEvent), meth_QShortcut_timerEvent, METH_VARARGS, NULL}, {SIP_MLNAME_CAST(sipName_whatsThis), meth_QShortcut_whatsThis, METH_VARARGS, NULL} }; /* Define this type's PyQt4 signals. */ static const pyqt4QtSignal pyqt4_signals_QShortcut[] = { {"activatedAmbiguously()", 0, 0}, {"activated()", 0, 0}, {0, 0, 0} }; pyqt4ClassTypeDef sipTypeDef_QtGui_QShortcut = { { { -1, 0, 0, SIP_TYPE_SCC|SIP_TYPE_CLASS, sipNameNr_QShortcut, {0} }, { sipNameNr_QShortcut, {0, 0, 1}, 20, methods_QShortcut, 0, 0, 0, 0, {0, 0, 0, 0, 0, 0, 0, 0, 0, 0}, }, 0, -1, -1, supers_QShortcut, 0, init_QShortcut, 0, 0, #if PY_MAJOR_VERSION >= 3 0, 0, #else 0, 0, 0, 0, #endif dealloc_QShortcut, 0, 0, 0, release_QShortcut, cast_QShortcut, 0, 0, 0 }, &QShortcut::staticMetaObject, 0, pyqt4_signals_QShortcut };
{ "pile_set_name": "Github" }
/** * @requires OpenLayers/Lang.js */ /** * Namespace: OpenLayers.Lang["zh-CN"] * Dictionary for Simplified Chinese. Keys for entries are used in calls to * <OpenLayers.Lang.translate>. Entry bodies are normal strings or * strings formatted for use with <OpenLayers.String.format> calls. */ OpenLayers.Lang["zh-CN"] = { 'unhandledRequest': "未处理的请求,返回值为 ${statusText}", 'Permalink': "永久链接", 'Overlays': "叠加层", 'Base Layer': "基础图层", 'readNotImplemented': "读取功能没有实现。", 'writeNotImplemented': "写入功能没有实现。", 'noFID': "无法更新feature,缺少FID。", 'errorLoadingGML': "加载GML文件 ${url} 出现错误。", 'browserNotSupported': "你使用的浏览器不支持矢量渲染。当前支持的渲染方式包括:\n${renderers}", 'componentShouldBe': "addFeatures : 组件类型应该是 ${geomType}", // console message 'getFeatureError': "getFeatureFromEvent方法在一个没有渲染器的图层上被调用。 这通常意味着您" + "销毁了一个图层,但并未销毁其关联的handler。", // console message 'minZoomLevelError': "minZoomLevel属性仅适合用于" + "使用了固定缩放级别的图层。这个 " + "wfs 图层检查 minZoomLevel 是过去遗留下来的。" + "然而,我们不能移除它," + "而破坏依赖于它的基于OL的应用程序。" + "因此,我们废除了它 -- minZoomLevel " + "将会在3.0中被移除。请改用 " + "min/max resolution 设置,参考:" + "http://trac.openlayers.org/wiki/SettingZoomLevels", 'commitSuccess': "WFS Transaction: 成功。 ${response}", 'commitFailed': "WFS Transaction: 失败。 ${response}", 'googleWarning': "Google图层不能正确加载。<br><br>" + "要消除这个信息,请在右上角的" + "图层控制面板中选择其他的基础图层。<br><br>" + "这种情况很可能是没有正确的包含Google地图脚本库," + "或者是没有包含在你的站点上" + "使用的正确的Google Maps API密匙。<br><br>" + "开发者:获取使其正确工作的帮助信息," + "<a href='http://trac.openlayers.org/wiki/Google' " + "target='_blank'>点击这里</a>", 'getLayerWarning': "${layerType} 图层不能正确加载。<br><br>" + "要消除这个信息,请在右上角的" + "图层控制面板中选择其他的基础图层。<br><br>" + "这种情况很可能是没有正确的包含" + "${layerLib} 脚本库。<br><br>" + "开发者:获取使其正确工作的帮助信息," + "<a href='http://trac.openlayers.org/wiki/${layerLib}' " + "target='_blank'>点击这里</a>", 'Scale = 1 : ${scaleDenom}': "比例尺 = 1 : ${scaleDenom}", // console message 'layerAlreadyAdded': "你尝试添加图层: ${layerName} 到地图中,但是它之前就已经被添加。", // console message 'reprojectDeprecated': "你正在使用 ${layerName} 图层上的'reproject'选项。" + "这个选项已经不再使用:" + "它是被设计用来支持显示商业的地图数据," + "不过现在该功能可以通过使用Spherical Mercator来实现。" + "更多信息可以参阅" + "http://trac.openlayers.org/wiki/SphericalMercator.", // console message 'methodDeprecated': "该方法已经不再被支持,并且将在3.0中被移除。" + "请使用 ${newMethod} 方法来替代。", // console message 'boundsAddError': "您必须传递 x 和 y 两个参数值到 add 方法。", // console message 'lonlatAddError': "您必须传递 lon 和 lat 两个参数值到 add 方法。", // console message 'pixelAddError': "您必须传递 x and y 两个参数值到 add 方法。", // console message 'unsupportedGeometryType': "不支持的几何体类型: ${geomType}", 'end': '' };
{ "pile_set_name": "Github" }
<?xml version="1.0"?> <hibernate-mapping xmlns="urn:nhibernate-mapping-2.2" default-lazy="false" namespace="NHibernate.Test.Subclass.EnumDiscriminator" assembly="NHibernate.Test"> <class name="Foo" table="subclass_enumdiscriminator" discriminator-value="Green"> <id name="Id" type="Int64"> <generator class="assigned"/> </id> <discriminator column="Color" type="NHibernate.Test.Subclass.EnumDiscriminator.Colors, NHibernate.Test"/> <subclass name="Bar" discriminator-value="Blue"/> </class> <class name="Baz" table="subclass_enumdiscriminator"> <id name="Id" type="Int64"> <generator class="assigned"/> </id> <property name="Color"/> </class> </hibernate-mapping>
{ "pile_set_name": "Github" }
Usage: long_equals (-i|-j|--intval|--intval2=ARG) Available options: -i,-j,--intval,--intval2=ARG integer value -h,--help Show this help text
{ "pile_set_name": "Github" }
# GFS 论文阅读 - 预期背景 - Component failures are the norm rather than the exception. So constant monitoring, error detection, fault tolerance, and automatic recovery must be integral to the system. - Files are huge by traditional standards. Multi-GB files are common. - Most files are mutated by appending new data rather than overwriting existing data. - Co-designing the applications and the file system API benefits the overall system by increasing our flexibility. - Architecture ![architecture](img/gfs_figure1.png) - A GFS cluster consists of a single master and multiple chunkservers and is accessed by multiple client. - Files are divided into fixed-size chunks. Each chunk is identified by an immutable and globally unique 64 bit chunk handle assigned by the master at the time of chunk creation. Chunkservers store chunks on local disks as Linux files and read or write chunk data specified by a chunk handle and byte range. Each chunk is replicated on multiple chunkservers. - The master maintains all file system metadata. This includes the namespace, access control infomation, the mapping from files to chunks, and the current locations of chunks. It also controls system-wide activities such as chunk lease management, garbage collection of orphaned chunks, and chunk migration between chunkservers. - Neither the client nor the chunkserver caches file data. - for client, that's too big - for chunkserver, Linux's buffer cache already do this - Single master, to prevent the single master become a bottleneck, clients never read and write file data through the master, instead, a client asks the master which chunkservers it should contact, and it caches this infomation for a limited time and interacts with the chunkservers directly for many subsequent operations. - Chunk Size A large chunk size offers serveral important advantages. - Reduces clients' need to interact with the master - A client is more likely to perform many operations on a given chunk, it can reduce network overhead by keeping a persistent TCP connection to the chunkserver over an extended period of time. - Reduces the size of the metadata stored on the master. and it's disadvantage: - A small file consists of a small number of chunks, perhaps just one, so it is more likely to become hot spots. - Metadata The master stores three major types of metadata: - The file and chunk namespaces - The mapping from files to chunks - The locations of each chunk's replicas All metadata is kept in the master's memory. And the first two types(namespaces and the mapping from files to chunks) are also kept persistent by logging mutations to an operation log stored on the master's local disk and replicated on remote machines. Chunkserver store chunk location infomation, and the master asks every chunkserver for chunk location infomation. - Chunk Locations. The master does not keep a persistent record of which chunkservers have a replica of a given chunk, it can keep itself up-to-date by monitor chunkserver status with regular HeartBeat messages. - The operation log contains a historical record of critical metadata changes. So it is central to GFS. Also, it's been kept both in local disk and remote, and the file size should be small. - Chunk replicas Chunk replicas are created for three reasons: chunk creation, re-replication, and rebalancing.
{ "pile_set_name": "Github" }
/* * QEMU rocker switch emulation - switch worlds * * Copyright (c) 2014 Scott Feldman <[email protected]> * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation; either version 2 of the License, or * (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. */ #include "qemu/osdep.h" #include "qemu/iov.h" #include "rocker.h" #include "rocker_world.h" struct world { Rocker *r; enum rocker_world_type type; WorldOps *ops; }; ssize_t world_ingress(World *world, uint32_t pport, const struct iovec *iov, int iovcnt) { if (world->ops->ig) { return world->ops->ig(world, pport, iov, iovcnt); } return -1; } int world_do_cmd(World *world, DescInfo *info, char *buf, uint16_t cmd, RockerTlv *cmd_info_tlv) { if (world->ops->cmd) { return world->ops->cmd(world, info, buf, cmd, cmd_info_tlv); } return -ROCKER_ENOTSUP; } World *world_alloc(Rocker *r, size_t sizeof_private, enum rocker_world_type type, WorldOps *ops) { World *w = g_malloc0(sizeof(World) + sizeof_private); w->r = r; w->type = type; w->ops = ops; if (w->ops->init) { w->ops->init(w); } return w; } void world_free(World *world) { if (world->ops->uninit) { world->ops->uninit(world); } g_free(world); } void world_reset(World *world) { if (world->ops->uninit) { world->ops->uninit(world); } if (world->ops->init) { world->ops->init(world); } } void *world_private(World *world) { return world + 1; } Rocker *world_rocker(World *world) { return world->r; } enum rocker_world_type world_type(World *world) { return world->type; } const char *world_name(World *world) { return world->ops->name; }
{ "pile_set_name": "Github" }
package org.ovirt.engine.core.bll; import java.util.List; import javax.inject.Inject; import org.apache.commons.lang.StringUtils; import org.ovirt.engine.core.bll.context.CommandContext; import org.ovirt.engine.core.common.AuditLogType; import org.ovirt.engine.core.common.EventNotificationMethod; import org.ovirt.engine.core.common.action.EventSubscriptionParametesBase; import org.ovirt.engine.core.common.businessentities.EventSubscriber; import org.ovirt.engine.core.common.businessentities.aaa.DbUser; import org.ovirt.engine.core.common.errors.EngineMessage; import org.ovirt.engine.core.compat.Guid; import org.ovirt.engine.core.dao.DbUserDao; public class AddEventSubscriptionCommand<T extends EventSubscriptionParametesBase> extends EventSubscriptionCommandBase<T> { @Inject private DbUserDao dbUserDao; public AddEventSubscriptionCommand(T parameters, CommandContext cmdContext) { super(parameters, cmdContext); } @Override protected boolean validate() { boolean retValue; // check if user is not already subscribed to this event with same // method and address Guid subscriberId = getParameters().getEventSubscriber().getSubscriberId(); String eventName = getParameters().getEventSubscriber().getEventUpName(); EventNotificationMethod eventNotificationMethod = getParameters().getEventSubscriber().getEventNotificationMethod(); List<EventSubscriber> subscriptions = eventDao.getAllForSubscriber(subscriberId); if (isAlreadySubscribed(subscriptions, subscriberId, eventName, eventNotificationMethod)) { addValidationMessage(EngineMessage.EN_ALREADY_SUBSCRIBED); retValue = false; } else if (!eventExists(eventName)) { addValidationMessage(EngineMessage.EN_UNSUPPORTED_NOTIFICATION_EVENT); retValue = false; } else { // get notification method if (eventNotificationMethod != null) { // Validate user DbUser user = dbUserDao.get(subscriberId); if (user == null) { addValidationMessage(EngineMessage.USER_MUST_EXIST_IN_DB); retValue = false; } else { retValue = validateAdd(eventNotificationMethod, getParameters().getEventSubscriber(), user); } } else { addValidationMessage(EngineMessage.EN_UNKNOWN_NOTIFICATION_METHOD); retValue = false; } } return retValue; } private boolean eventExists(String eventName) { boolean exists = false; try { AuditLogType.valueOf(eventName); exists = true; } catch (Exception ignore) { } return exists; } /** * Determines whether [is already subscribed] [the specified subscriptions]. * * @param subscriptions The subscriptions. * @param subscriberId The subscriber id. * @param eventName Name of the event. * @param eventNotificationMethod The notification method. * @return <c>true</c> if [is already subscribed] [the specified * subscriptions]; otherwise, <c>false</c>. */ private static boolean isAlreadySubscribed(List<EventSubscriber> subscriptions, Guid subscriberId, String eventName, EventNotificationMethod eventNotificationMethod) { return subscriptions.stream() .anyMatch(subscription -> subscriberId.equals(subscription.getSubscriberId()) && StringUtils.equals(subscription.getEventUpName(), eventName) && subscription.getEventNotificationMethod() == eventNotificationMethod); } @Override protected void executeCommand() { if (getParameters().getEventSubscriber().getTagName() == null) { getParameters().getEventSubscriber().setTagName(""); } eventDao.subscribe(getParameters().getEventSubscriber()); setSucceeded(true); } }
{ "pile_set_name": "Github" }
package de.gsi.chart.ui; import java.util.ArrayList; import java.util.List; import javafx.beans.property.ObjectProperty; import javafx.beans.property.SimpleObjectProperty; import javafx.collections.ListChangeListener; import javafx.scene.Node; import javafx.scene.layout.ColumnConstraints; import javafx.scene.layout.GridPane; import javafx.scene.layout.Priority; import javafx.scene.layout.VBox; import org.kordamp.ikonli.javafx.FontIcon; /** * TilingPane that to mimics HBox-, VBox-, or TilePane layout while consistently maximising it's children and * following layout constraints from its parent * * @author rstein */ public class TilingPane extends GridPane { protected static final String FONT_AWESOME = "FontAwesome"; protected static final int FONT_SIZE = 20; private final ObjectProperty<Layout> layout = new SimpleObjectProperty<>(this, "layout", Layout.GRID) { @Override public void set(final Layout newLayout) { if (newLayout == null) { throw new IllegalArgumentException("layout must not be null"); } super.set(newLayout); } }; public TilingPane() { this(Layout.GRID); } public TilingPane(final Layout layout) { this(layout, (Node[]) null); } public TilingPane(final Layout layout, Node... nodes) { super(); this.layout.set(layout); VBox.setVgrow(this, Priority.ALWAYS); getChildren().addListener((ListChangeListener<Node>) change -> { while (change.next()) { layoutNormal(); } }); this.layout.addListener((ch, o, n) -> layoutNormal()); if (nodes != null) { getChildren().addAll(nodes); } } public Layout getLayout() { return layoutProperty().get(); } public ObjectProperty<Layout> layoutProperty() { return layout; } public void setLayout(final Layout value) { layoutProperty().set(value); } @Override public String toString() { return TilingPane.class.getSimpleName() + "('" + getLayout() + "0')"; } protected int getColumnsCount() { final int childCount = getChildren().size(); if (childCount == 0) { return 1; } switch (getLayout()) { case HBOX: return childCount; case MAXIMISE: case VBOX: return 1; case GRID: default: if (childCount < 4) { return 2; } return (int) Math.ceil(Math.sqrt(childCount)); // n-columns } } protected void layoutNormal() { if (getChildren().isEmpty()) { return; } final int colsCount = getColumnsCount(); if (getColumnConstraints().size() != colsCount) { final List<ColumnConstraints> colConstraintList = new ArrayList<>(); for (int i = 0; i < colsCount; i++) { final ColumnConstraints colConstraints = new ColumnConstraints(); // NOPMD colConstraints.setPercentWidth(100.0 / colsCount); colConstraints.setFillWidth(true); colConstraintList.add(colConstraints); } getColumnConstraints().setAll(colConstraintList); } int rowIndex = 0; int colIndex = 0; int childCount = 0; final int nChildren = getChildren().size(); int nColSpan = Math.max(1, colsCount / (nChildren - childCount)); for (final Node child : getChildren()) { GridPane.setFillWidth(child, true); GridPane.setFillHeight(child, true); GridPane.setColumnIndex(child, colIndex); GridPane.setRowIndex(child, rowIndex); if ((colIndex == 0) && ((nChildren - childCount) < colsCount)) { nColSpan = Math.max(1, colsCount / (nChildren - childCount)); } // last window fills up row if (((nChildren - childCount) == 1) && (colIndex < colsCount)) { nColSpan = colsCount - colIndex; } GridPane.setColumnSpan(child, nColSpan); colIndex += nColSpan; if (colIndex >= colsCount) { colIndex = 0; rowIndex++; } childCount++; } } public enum Layout { HBOX("HBox", "fas-arrows-alt-h:" + FONT_SIZE), VBOX("VBox", "fas-arrows-alt-v:" + FONT_SIZE), GRID("Grid", "fas-th:" + FONT_SIZE), MAXIMISE("Maximise", "fas-window-maximize:" + FONT_SIZE); private final String name; private final String iconCode; Layout(final String name, final String iconCode) { this.name = name; this.iconCode = iconCode; } public Node getIcon() { return new FontIcon(iconCode); } public String getName() { return name; } } }
{ "pile_set_name": "Github" }
'use strict'; var weak = require('./_collection-weak'); // 23.4 WeakSet Objects require('./_collection')('WeakSet', function(get){ return function WeakSet(){ return get(this, arguments.length > 0 ? arguments[0] : undefined); }; }, { // 23.4.3.1 WeakSet.prototype.add(value) add: function add(value){ return weak.def(this, value, true); } }, weak, false, true);
{ "pile_set_name": "Github" }
<?xml version="1.0"?> <xs:schema targetNamespace="urn:ddb:expandingpulley" xmlns='urn:ddb:expandingpulley' xmlns:xs="http://www.w3.org/2001/XMLSchema" > <xs:include schemaLocation="commonDefs.xs" /> <xs:element name="Data"> <xs:complexType> <xs:sequence> <xs:element ref="Instance" /> <xs:element ref="Command"/> <xs:element ref="Autoload" minOccurs="0" maxOccurs="unbounded" /> <xs:choice minOccurs="0" maxOccurs="unbounded"> <xs:element ref="Error" /> </xs:choice> <xs:choice> <xs:element ref="Success" /> <xs:element ref="Failure" /> </xs:choice> </xs:sequence> </xs:complexType> </xs:element> </xs:schema>
{ "pile_set_name": "Github" }
<?xml version="1.0"?> <ZopeData> <record id="1" aka="AAAAAAAAAAE="> <pickle> <global name="ERP5 Form" module="erp5.portal_type"/> </pickle> <pickle> <dictionary> <item> <key> <string>_bind_names</string> </key> <value> <object> <klass> <global name="NameAssignments" module="Shared.DC.Scripts.Bindings"/> </klass> <tuple/> <state> <dictionary> <item> <key> <string>_asgns</string> </key> <value> <dictionary/> </value> </item> </dictionary> </state> </object> </value> </item> <item> <key> <string>_objects</string> </key> <value> <tuple/> </value> </item> <item> <key> <string>action</string> </key> <value> <string>Base_edit</string> </value> </item> <item> <key> <string>description</string> </key> <value> <string></string> </value> </item> <item> <key> <string>edit_order</string> </key> <value> <list/> </value> </item> <item> <key> <string>encoding</string> </key> <value> <string>UTF-8</string> </value> </item> <item> <key> <string>enctype</string> </key> <value> <string>multipart/form-data</string> </value> </item> <item> <key> <string>group_list</string> </key> <value> <list> <string>left</string> <string>right</string> <string>center</string> <string>bottom</string> <string>hidden</string> </list> </value> </item> <item> <key> <string>groups</string> </key> <value> <dictionary> <item> <key> <string>bottom</string> </key> <value> <list> <string>listbox</string> </list> </value> </item> <item> <key> <string>center</string> </key> <value> <list> <string>my_title</string> </list> </value> </item> <item> <key> <string>hidden</string> </key> <value> <list> <string>listbox_reference</string> <string>listbox_int_index</string> <string>listbox_quantity_unit</string> <string>listbox_stop_date</string> <string>listbox_price</string> <string>listbox_quantity</string> <string>listbox_total_quantity</string> <string>listbox_total_price</string> </list> </value> </item> <item> <key> <string>left</string> </key> <value> <list/> </value> </item> <item> <key> <string>right</string> </key> <value> <list/> </value> </item> </dictionary> </value> </item> <item> <key> <string>id</string> </key> <value> <string>PurchasePackingList_viewDetails</string> </value> </item> <item> <key> <string>method</string> </key> <value> <string>POST</string> </value> </item> <item> <key> <string>name</string> </key> <value> <string>PurchasePackingList_viewDetails</string> </value> </item> <item> <key> <string>pt</string> </key> <value> <string>form_view</string> </value> </item> <item> <key> <string>row_length</string> </key> <value> <int>4</int> </value> </item> <item> <key> <string>stored_encoding</string> </key> <value> <string>UTF-8</string> </value> </item> <item> <key> <string>title</string> </key> <value> <string>Purchase Packing List Details</string> </value> </item> <item> <key> <string>unicode_mode</string> </key> <value> <int>0</int> </value> </item> <item> <key> <string>update_action</string> </key> <value> <string></string> </value> </item> </dictionary> </pickle> </record> </ZopeData>
{ "pile_set_name": "Github" }
package com.xmartlabs.fountain.retrofit.pagefetcher.totalentities import android.arch.core.executor.testing.InstantTaskExecutorRule import com.xmartlabs.fountain.ListResponse import com.xmartlabs.fountain.Listing import com.xmartlabs.fountain.retrofit.adapter.RetrofitNetworkDataSourceAdapter import com.xmartlabs.fountain.retrofit.adapter.toTotalEntityCountNetworkDataSourceAdapter import com.xmartlabs.fountain.retrofit.common.EntityCountMockedPageFetcher import com.xmartlabs.fountain.testutils.TestConstants import com.xmartlabs.fountain.testutils.extensions.generateIntPageResponseList import com.xmartlabs.fountain.testutils.extensions.getPagedList import com.xmartlabs.fountain.testutils.extensions.getPagedListSize import com.xmartlabs.fountain.testutils.extensions.mockLifecycleEvents import com.xmartlabs.fountain.testutils.extensions.scrollToTheEnd import org.junit.Assert import org.junit.Rule import org.junit.Test import org.junit.rules.TestRule abstract class NetworkDataSourceWithTotalEntityCountAdapterUnitTest { @get:Rule var rule: TestRule = InstantTaskExecutorRule() @Test fun testFetchOnePage() { val pageFetcher = EntityCountMockedPageFetcher(TestConstants.DEFAULT_NETWORK_PAGE_SIZE.toLong()) val mockedNetworkDataSourceAdapter = pageFetcher.toTotalEntityCountNetworkDataSourceAdapter() val listing = createListing(mockedNetworkDataSourceAdapter) .mockLifecycleEvents() Assert.assertEquals(TestConstants.DEFAULT_NETWORK_PAGE_SIZE, listing.getPagedListSize()) Assert.assertEquals(generateIntPageResponseList(1), listing.getPagedList()) listing.scrollToTheEnd() Assert.assertEquals(TestConstants.DEFAULT_NETWORK_PAGE_SIZE, listing.getPagedListSize()) Assert.assertEquals(generateIntPageResponseList(1), listing.getPagedList()) } @Test fun testFetchTwoPages() { val entityCount = 2 * TestConstants.DEFAULT_NETWORK_PAGE_SIZE val pageFetcher = EntityCountMockedPageFetcher(entityCount.toLong()) val mockedNetworkDataSourceAdapter = pageFetcher.toTotalEntityCountNetworkDataSourceAdapter() val listing = createListing(mockedNetworkDataSourceAdapter) .mockLifecycleEvents() Assert.assertEquals(TestConstants.DEFAULT_NETWORK_PAGE_SIZE, listing.getPagedListSize()) Assert.assertEquals(generateIntPageResponseList(1), listing.getPagedList()) listing.scrollToTheEnd() Assert.assertEquals(entityCount, listing.getPagedListSize()) Assert.assertEquals(generateIntPageResponseList(2), listing.getPagedList()) listing.scrollToTheEnd() Assert.assertEquals(entityCount, listing.getPagedListSize()) Assert.assertEquals(generateIntPageResponseList(2), listing.getPagedList()) } @Test fun testFetchTwoAndAHalfPages() { val entityCount = (5f / 2f * TestConstants.DEFAULT_NETWORK_PAGE_SIZE).toInt() val pageFetcher = EntityCountMockedPageFetcher(entityCount.toLong()) val mockedNetworkDataSourceAdapter = pageFetcher.toTotalEntityCountNetworkDataSourceAdapter() val listing = createListing(mockedNetworkDataSourceAdapter) .mockLifecycleEvents() Assert.assertEquals(TestConstants.DEFAULT_NETWORK_PAGE_SIZE, listing.getPagedListSize()) Assert.assertEquals(generateIntPageResponseList(1), listing.getPagedList()) listing.scrollToTheEnd() Assert.assertEquals(TestConstants.DEFAULT_NETWORK_PAGE_SIZE * 2, listing.getPagedListSize()) Assert.assertEquals(generateIntPageResponseList(2), listing.getPagedList()) listing.scrollToTheEnd() Assert.assertEquals(entityCount, listing.getPagedListSize()) Assert.assertEquals((0 until entityCount).toList(), listing.getPagedList()) listing.scrollToTheEnd() Assert.assertEquals(entityCount, listing.getPagedListSize()) Assert.assertEquals((0 until entityCount).toList(), listing.getPagedList()) } abstract fun createListing( mockedNetworkDataSourceAdapter: RetrofitNetworkDataSourceAdapter<out ListResponse<Int>> ): Listing<Int> }
{ "pile_set_name": "Github" }
/** @file Support for PCI 3.0 standard. Copyright (c) 2006 - 2014, Intel Corporation. All rights reserved.<BR> SPDX-License-Identifier: BSD-2-Clause-Patent **/ #ifndef _PCI30_H #define _PCI30_H //#include "pci23.h" #define PCI_CLASS_MASS_STORAGE_SATADPA 0x06 #pragma pack(push, 1) typedef struct { UINT32 Signature; // "PCIR" UINT16 VendorId; UINT16 DeviceId; UINT16 DeviceListOffset; UINT16 Length; UINT8 Revision; UINT8 ClassCode[3]; UINT16 ImageLength; UINT16 CodeRevision; UINT8 CodeType; UINT8 Indicator; UINT16 MaxRuntimeImageLength; UINT16 ConfigUtilityCodeHeaderOffset; UINT16 DMTFCLPEntryPointOffset; } PCI_3_0_DATA_STRUCTURE; #pragma pack(pop) #endif
{ "pile_set_name": "Github" }
{ "demoSharedZAxisBeefSandwichRecipeTitle": "Isemeshi yebhifu", "demoSharedZAxisDessertRecipeDescription": "Iresiphu ye-dessert", "demoSharedYAxisAlbumTileSubtitle": "Umculi", "demoSharedYAxisAlbumTileTitle": "I-albhamu", "demoSharedYAxisRecentSortTitle": "Okudlalwe kamuva", "demoSharedYAxisAlphabeticalSortTitle": "A-Z", "demoSharedYAxisAlbumCount": "ama-albhamu angama-268", "demoSharedYAxisTitle": "I-y-axis eyabiwe", "demoSharedXAxisCreateAccountButtonText": "DALA I-AKHAWUNTI", "demoFadeScaleAlertDialogDiscardButton": "LAHLA", "demoSharedXAxisSignInTextFieldLabel": "I-imeyili noma inombolo yefoni", "demoSharedXAxisSignInSubtitleText": "Ngena ngemvume nge-akhawunti yakho", "demoSharedXAxisSignInWelcomeText": "Sawubona David Park", "demoSharedXAxisIndividualCourseSubtitle": "Kuboniswa Ngakunye", "demoSharedXAxisBundledCourseSubtitle": "Okuhlanganisiwe", "demoFadeThroughAlbumsDestination": "Ama-albhamu", "demoSharedXAxisDesignCourseTitle": "Dizayina", "demoSharedXAxisIllustrationCourseTitle": "Umfanekiso", "demoSharedXAxisBusinessCourseTitle": "Ibhizinisi", "demoSharedXAxisArtsAndCraftsCourseTitle": "Ubuciko nokwakha", "demoMotionPlaceholderSubtitle": "Umbhalo wesibili", "demoFadeScaleAlertDialogCancelButton": "KHANSELA", "demoFadeScaleAlertDialogHeader": "Xwayisa Ibhokisi", "demoFadeScaleHideFabButton": "FIHLA I-FAB", "demoFadeScaleShowFabButton": "BONISA I-FAB", "demoFadeScaleShowAlertDialogButton": "BONISA I-MODAL", "demoFadeScaleDescription": "Iphethini yokufiphala isetshenziselwa ama-elementi e-UI angena noma aphuma ngaphakathi kwemikhawulo yesikrini, njengebhokisi elifiphala phakathi nendawo kusikrini.", "demoFadeScaleTitle": "Ukufiphala", "demoFadeThroughTextPlaceholder": "izithombe eziyi-123", "demoFadeThroughSearchDestination": "Sesha", "demoFadeThroughPhotosDestination": "Izithombe", "demoSharedXAxisCoursePageSubtitle": "Izigaba ezenziwe inqwaba zivela njengamaqembu kokuphakelayo kwakho. Ungahlala ushintsha lokhu ngemuva kwesikhathi.", "demoFadeThroughDescription": "Iphethini yokufiphala kudlulwe isetshenziselwa ukudlula okuphakathi kwama-elementi e-UI anganabo ubudlelwano obuqinile kokunye.", "demoFadeThroughTitle": "Fiphala udlulele", "demoSharedZAxisHelpSettingLabel": "Usizo", "demoMotionSubtitle": "Wonke amaphethini okudlula achazwe ngaphambilini", "demoSharedZAxisNotificationSettingLabel": "Izaziso", "demoSharedZAxisProfileSettingLabel": "Iphrofayela", "demoSharedZAxisSavedRecipesListTitle": "Amaresiphu Alondoloziwe", "demoSharedZAxisBeefSandwichRecipeDescription": "Iresiphu yesemishi yebhifu", "demoSharedZAxisCrabPlateRecipeDescription": "Iresiphu yepuleti lenkalankala", "demoSharedXAxisCoursePageTitle": "Yenza umugqa oqondile izifundo zakho", "demoSharedZAxisCrabPlateRecipeTitle": "Inkalankala", "demoSharedZAxisShrimpPlateRecipeDescription": "Iresiphu yepuleti le-shrimp", "demoSharedZAxisShrimpPlateRecipeTitle": "I-Shrimp", "demoContainerTransformTypeFadeThrough": "FIPHALA UDLULELE", "demoSharedZAxisDessertRecipeTitle": "I-Dessert", "demoSharedZAxisSandwichRecipeDescription": "Iresiphi yesemishi", "demoSharedZAxisSandwichRecipeTitle": "Isemishi", "demoSharedZAxisBurgerRecipeDescription": "Iresiphi yebhega", "demoSharedZAxisBurgerRecipeTitle": "Ibhega", "demoSharedZAxisSettingsPageTitle": "Amasethingi", "demoSharedZAxisTitle": "I-z-axis eyabiwe", "demoSharedZAxisPrivacySettingLabel": "Ubumfihlo", "demoMotionTitle": "Motion", "demoContainerTransformTitle": "Ukuguqulwa Kwesiqukathi", "demoContainerTransformDescription": "Iphethini yokuguqulwa kwesiqukathi idizayinelwe ukudlula phakathi kwama-elementi e-UI afaka isiqukathi. Le phethini idala ukuxhumana okubonakalayo phakathi kwama-elementi amabili e-UI", "demoContainerTransformModalBottomSheetTitle": "Imodi yokufiphala", "demoContainerTransformTypeFade": "UKUFIPHALA", "demoSharedYAxisAlbumTileDurationUnit": "iminithi", "demoMotionPlaceholderTitle": "Isihloko", "demoSharedXAxisForgotEmailButtonText": "UKHOHLWE I-IMEYILI?", "demoMotionSmallPlaceholderSubtitle": "Okwesibili", "demoMotionDetailsPageTitle": "Ikhasi Lemininingwane", "demoMotionListTileTitle": "Into yohlu", "demoSharedAxisDescription": "Iphethini ye-axis eyabiwe isetshenziselwa ukuguqulwa okuphakathi kwama-elementi e-UI anobudlelwane be-spatial noma bokuzulazula. Le phethini isebenzisa ukuguqulwa okwabiwe ku-axis ka-x, y, noma u-z ukuze kuphinde kuqiniswe ubudlelwane phakathi kwama-elementi.", "demoSharedXAxisTitle": "I-x-axis eyabiwe", "demoSharedXAxisBackButtonText": "EMUVA", "demoSharedXAxisNextButtonText": "OKULANDELAYO", "demoSharedXAxisCulinaryCourseTitle": "Okokupheka", "githubRepo": "{repoName} Ikhosombe le-GitHub", "fortnightlyMenuUS": "I-US", "fortnightlyMenuBusiness": "Ibhizinisi", "fortnightlyMenuScience": "Isayensi", "fortnightlyMenuSports": "Ezemidlalo", "fortnightlyMenuTravel": "Ukuvakasha", "fortnightlyMenuCulture": "Isiko", "fortnightlyTrendingTechDesign": "I-TechDesign", "rallyBudgetDetailAmountLeft": "Inani elisele", "fortnightlyHeadlineArmy": "Ukulungiswa Kwempi Eluhlaza Kusukela Ngaphakathi", "fortnightlyDescription": "Uhlelo lokusebenza lwezindaba olugxiliswe kokuqukethwe", "rallyBillDetailAmountDue": "Inani elifunekayo", "rallyBudgetDetailTotalCap": "I-cap yesamba", "rallyBudgetDetailAmountUsed": "Inani elisetshenzisiwe", "fortnightlyTrendingHealthcareRevolution": "I-HealthcareRevolution", "fortnightlyMenuFrontPage": "Ikhasi langaphambili", "fortnightlyMenuWorld": "Umhlaba", "rallyBillDetailAmountPaid": "Inani elikhokhiwe", "fortnightlyMenuPolitics": "Ipolotiki", "fortnightlyHeadlineBees": "Izinyosi Zendawo Yefamu Zinokunikezwa Okumfushane", "fortnightlyHeadlineGasoline": "Ikusasa Lephethiloli", "fortnightlyTrendingGreenArmy": "I-GreenArmy", "fortnightlyHeadlineFeminists": "Ama-Ferminist Athatha i-Partisanship", "fortnightlyHeadlineFabrics": "Abadizayinayo Basebenzisa Ubuchwepheshe Ukuze Benze Izindwangu Ezizayo", "fortnightlyHeadlineStocks": "Njengoba Izitoko Zihamba Kancane, Iningi Labantu Libheka Uhlobo Lwemali", "fortnightlyTrendingReform": "Okulungisiwe", "fortnightlyMenuTech": "Ubuchwepheshe", "fortnightlyHeadlineWar": "Owasemelika Ohlukanisiwe Ophila Ngesikhathi Sempi", "fortnightlyHeadlineHealthcare": "Ukuphenduka Okuthulile, Kodwa Okunamandla Kokunakekelwa Kwezempilo", "fortnightlyLatestUpdates": "Izibuyekezo Zakamuva", "fortnightlyTrendingStocks": "Izitoko", "rallyBillDetailTotalAmount": "Inani lesamba", "demoCupertinoPickerDateTime": "Idethi nesikhathi", "signIn": "NGENA NGEMVUME", "dataTableRowWithSugar": "{value} enoshukela", "dataTableRowApplePie": "Uphaya we-apula", "dataTableRowDonut": "Idonadi", "dataTableRowHoneycomb": "Ikhekheba lezinyosi", "dataTableRowLollipop": "I-Lollipop", "dataTableRowJellyBean": "I-Jelly bean", "dataTableRowGingerbread": "I-Gingerbread", "dataTableRowCupcake": "I-Cupcake", "dataTableRowEclair": "I-Eclair", "dataTableRowIceCreamSandwich": "Isemeshi ka-ayisikhilimu", "dataTableRowFrozenYogurt": "Iyogathi eqinile", "dataTableColumnIron": "I-ayoni (%)", "dataTableColumnCalcium": "Ikhalisiyamu (%)", "dataTableColumnSodium": "Isodiyamu (mg)", "demoTimePickerTitle": "Isikhi sesikhathi", "demo2dTransformationsResetTooltip": "Setha kabusha ukuguqula", "dataTableColumnFat": "Amafutha (g)", "dataTableColumnCalories": "Amakhalori", "dataTableColumnDessert": "Ukudla okumnandi kokugcina (1 ukuphakelwa)", "cardsDemoTravelDestinationLocation1": "E-Thanjavur, e-Tamil Nadu", "demoTimePickerDescription": "Ibonisa ibhokisi eliqukethe isikhi sesikhathi sedizayini ebalulekile.", "demoPickersShowPicker": "BONISA ISIKHI", "demoTabsScrollingTitle": "Iyapheqa", "demoTabsNonScrollingTitle": "Ukungaskroli", "craneHours": "{hours,plural, =1{1h}one{{hours}h}other{{hours}h}}", "craneMinutes": "{minutes,plural, =1{1m}one{{minutes}m}other{{minutes}m}}", "craneFlightDuration": "{hoursShortForm} {minutesShortForm}", "dataTableHeader": "Ukudla okunomsonco", "demoDatePickerTitle": "Isikhi sedethi", "demoPickersSubtitle": "Ukukhetha usuku nesikhathi", "demoPickersTitle": "Izikhi", "demo2dTransformationsEditTooltip": "Hlela uthayela", "demoDataTableDescription": "Amathebula edatha abonisa imininingwane ngefomethi eyigridi yemigqa namakholomu. Ihlela imininingwane ngendlela yokuthi kube lula ukuphequlula, ukuze abasebenzisi babheke amaphethini nemininingwane.", "demo2dTransformationsDescription": "Thepha ukuze uhlele amathayela, futhi usebenzise ukuthinta ukuze uzulazule esigcawini. Hudula ukuze unyakazise, nciza ukuze usondeze, phendukisa ngeminwe emibili. Cindezela inkinobho yokusetha kabusha ukuze ubuyele ekuqaleni komumo wesikrini.", "demo2dTransformationsSubtitle": "Nyakaza, sondeza, phendukisa", "demo2dTransformationsTitle": "2D ukuguqula", "demoCupertinoTextFieldPIN": "I-PIN", "demoCupertinoTextFieldDescription": "Inkambu yombhalo ivumela umsebenzisi afake umbhalo, kungaba khekhibhodi yekhompuyutha noma ngekhibhodi esesikrinini.", "demoCupertinoTextFieldSubtitle": "Izinkambu zombhalo wesitayela se-iOS", "demoCupertinoTextFieldTitle": "Izinkambu zombhalo", "demoDatePickerDescription": "Ibonisa ibhokisi eliqukethe isikhi sedethi yedizayini ebalulekile.", "demoCupertinoPickerTime": "Isikhathi", "demoCupertinoPickerDate": "Idethi", "demoCupertinoPickerTimer": "Isibali sikhathi", "demoCupertinoPickerDescription": "Iwijethi yesikhi sesitayela se-iOS engasetshenziselwa ukukhetha izinsuku, izikhathi, noma kokubili usuku nesikhathi.", "demoCupertinoPickerSubtitle": "Izikhi zesikhathi nosuku lwesitayela se-iOS", "demoCupertinoPickerTitle": "Izikhi", "dataTableRowWithHoney": "{value} enoju", "cardsDemoTravelDestinationCity2": "E-Chettinad", "bannerDemoResetText": "Setha kabusa isibhengenzo", "bannerDemoMultipleText": "Izenzo eziningi", "bannerDemoLeadingText": "Isithonjana esiholayo", "dismiss": "CASHISA", "cardsDemoTappable": "Iyathepheka", "cardsDemoSelectable": "Iyakhetheka (cindezela isikhathi eside)", "cardsDemoExplore": "Hlola", "cardsDemoExploreSemantics": "Hlola i-{destinationName}", "cardsDemoShareSemantics": "Yabelana nge-{destinationName}", "cardsDemoTravelDestinationTitle1": "Amadolobha aphezulu angu-10 ongawavakashela e-Tamil Nadu", "cardsDemoTravelDestinationDescription1": "Inombolo engu-10", "cardsDemoTravelDestinationCity1": "E-Thanjavur", "dataTableColumnProtein": "Amaphrotheni (g)", "cardsDemoTravelDestinationTitle2": "Izingcwethi zase-Southern India", "cardsDemoTravelDestinationDescription2": "Amaspina esilika", "bannerDemoText": "Iphasiwedi yakho ibuyekezwe kwenye yamadivayisi akho. Sicela uphinde ungene ngemvume.", "cardsDemoTravelDestinationLocation2": "E-Sivaganga, Tamil Nadu", "cardsDemoTravelDestinationTitle3": "Ithempeli lase-Brihadisvara", "cardsDemoTravelDestinationDescription3": "Amathempeli", "demoBannerTitle": "Isibhengezo", "demoBannerSubtitle": "Ukubonisa isibhengezo ngaphakathi kohlu", "demoBannerDescription": "Isibhengezo sibonisa umlayezo obalulekile, nocacile, futhi sinikeza izenzo zokufanele kwenziwe ngumsebenzisi (noma ukucashisa leso sibhengezo). Isenzo somsebenzisi sidingekile ukuze sicashiswe.", "demoCardTitle": "Amakhadi", "demoCardSubtitle": "Amakhadi wesisekelo anamakona ayindilinga", "demoCardDescription": "Ikhadi yishidi lokubalulekile okusetshenziselwa ukumelela imininingwane ethile ehlobene nakho, ngokwesibonelo i-albhamu, indawo yomhlaba, ukudla, imininingwane yokukuthinta, njll.", "demoDataTableTitle": "Amathebula edatha", "demoDataTableSubtitle": "Imigqa namakholomu emininingwane", "dataTableColumnCarbs": "Amakhabhu (g)", "placeTanjore": "E-Tanjore", "demoGridListsTitle": "Uhlu lwegridi", "placeFlowerMarket": "Imakethe yezimbali", "placeBronzeWorks": "Imisebenzi yebhulonzi", "placeMarket": "Emakethe", "placeThanjavurTemple": "E-Thanjavur Temple", "placeSaltFarm": "Ifamu yotswayi", "placeScooters": "Izikuta", "placeSilkMaker": "Isenzi sesilikhi", "placeLunchPrep": "Ukulungiswa kwesidlo sasemini", "placeBeach": "Ebhishi", "placeFisherman": "Umdobi wezinhlanzi", "demoMenuSelected": "Ikhethiwe: {value}", "demoMenuRemove": "Susa", "demoMenuGetLink": "Thola isixhumanisi", "demoMenuShare": "Yabelana", "demoBottomAppBarSubtitle": "Ibonisa ukuzula nezenzo phansi", "demoMenuAnItemWithASectionedMenu": "Into enemenyu efakwe kusigaba", "demoMenuADisabledMenuItem": "Into yemenyu ekhutshaziwe", "demoLinearProgressIndicatorTitle": "Isikhombisi sokuqhubeka se-Linear", "demoMenuContextMenuItemOne": "Into yokuqala yokuqukethwe kwemenyu", "demoMenuAnItemWithASimpleMenu": "Into enemenyu elula", "demoCustomSlidersTitle": "Izilayidi zangokwezifiso", "demoMenuAnItemWithAChecklistMenu": "Into enemenyu yohlu lokuhlola", "demoCupertinoActivityIndicatorTitle": "Isikhombi somsebenzi", "demoCupertinoActivityIndicatorSubtitle": "isikhombisi somsebenzi wesitayela se-iOS", "demoCupertinoActivityIndicatorDescription": "Isikhombisi somsebenzi wesitayela esiphendukela ku-clockwise.", "demoCupertinoNavigationBarTitle": "Ibha yokuzula", "demoCupertinoNavigationBarSubtitle": "Ibha yokuzulazula yesitayela se-iOS", "demoCupertinoNavigationBarDescription": "Ibha yokuzulazula yesitayela se-iOS. Ibha yokuzulazula ibha yamathuluzi efaka ngokuncane isihloko sekhasi, ngaphakathi kwebha yamathuluzi.", "demoCupertinoPullToRefreshTitle": "Donsa ukuze uvuselele", "demoCupertinoPullToRefreshSubtitle": "Ulawulo lwesitayela se-iOS lokudonsa ukuze uvuselele", "demoCupertinoPullToRefreshDescription": "Iwijethi esebenzisa ulawulo lwesitayela se-iOS lokudonsa ukuze uvuselele.", "demoProgressIndicatorTitle": "Isikhombisi sokuqhubeka", "demoProgressIndicatorSubtitle": "I-Linear, circular, indeterminate", "demoCircularProgressIndicatorTitle": "Isikhombisi sokuqhubeka", "demoCircularProgressIndicatorDescription": "Isikhombisi sokuqhubeka se-Material Design, okuphendukisa ukubonisa ukuthi uhlelo lokusebenza lumatasatasa.", "demoMenuFour": "Kune", "demoLinearProgressIndicatorDescription": "Isikhombisi sokuqhubeka se-Material Design linear, futhi saziwa ngebha yokuqhubeka.", "demoTooltipTitle": "Amathulithiphu", "demoTooltipSubtitle": "Umlayezo omfushane uboniswa ekucindezeleni kwesikhathi eside noma ekuhambiseni phezulu", "demoTooltipDescription": "Amathulithiphu anikeza amalebula ombhalo asiza ukuchaza ukusebenza kwenkinobho noma esinye isenzo sokusetshenziswa kubonwa. Amathulithiphu abonisa umbhalo onolwazi uma abasebenzisa bahambisa ngaphezulu, bagxila, noma bacindezela isikhathi eside ku-elementi.", "demoTooltipInstructions": "Cindezela isikhathi eside noma hambisa ngaphezulu ukuze ubonise ithulithiphu.", "placeChennai": "E-Chennai", "demoMenuChecked": "Ihloliwe: {value}", "placeChettinad": "E-Chettinad", "demoMenuPreview": "Buka kuqala", "demoBottomAppBarTitle": "Ibha yaphansi yohlelo lokusebenza", "demoBottomAppBarDescription": "Amabha wohlelo lokusebenza waphansi anikezela ngokufinyelela kwikhabethe lokuzula eliphansi futhi kufika kwizenzo ezine, kufaka phakathi inkinobho yesenzo yokuntanta.", "bottomAppBarNotch": "I-Notch", "bottomAppBarPosition": "Indawo Yenkinobho Yesenzo Yokuntanta", "bottomAppBarPositionDockedEnd": "Kudokhiwe - Phelisa", "bottomAppBarPositionDockedCenter": "Kudokhiwe - Maphakathi", "bottomAppBarPositionFloatingEnd": "Ukuntanta - Phelisa", "bottomAppBarPositionFloatingCenter": "Ukuntanta - Maphakathi", "demoSlidersEditableNumericalValue": "Ivelu lenombolo elihlelekayo", "demoGridListsSubtitle": "Isakhiwo somugqa nesekholomu", "demoGridListsDescription": "Uhlu lwegridi lufaneleke kahle kakhulu ekuphrezenteni idatha enhlobonye, ngokuvamile izithombe. Into ngayinye ekuhlu lwegridi ibizwa ngokuthi ithayili.", "demoGridListsImageOnlyTitle": "Isithombe kuphela", "demoGridListsHeaderTitle": "Nesihloko", "demoGridListsFooterTitle": "Nonyaweni", "demoSlidersTitle": "Izilayidi", "demoSlidersSubtitle": "Amawijethi wokukhetha ivelu ngokuswayipha", "demoSlidersDescription": "Izilayidi zibonisa ibanga lamavelu kwibha, kusuka lapha abasebenzisi bangakhetha khona ivelu elilodwa. Abalulekele ukulungisa izilungiselelo ezifana nevolomu, ukukhanya, noma ukufaka izihlungi zesithombe.", "demoRangeSlidersTitle": "Izilayidi zebanga", "demoRangeSlidersDescription": "Izilayidi zibonisa ibanga lamavelu kwibha. Zingaba nezithonjana ngasekugcineni kwebha ezibonisa ibanga lamavelu. Abalulekele ukulungisa izilungiselelo ezifana nevolomu, ukukhanya, noma ukufaka izihlungi zesithombe.", "demoMenuAnItemWithAContextMenuButton": "Into enemenyu yokuqukethwe", "demoCustomSlidersDescription": "Izilayidi zibonisa ibanga lamavelu kwibha, kusuka lapho abasebenzisi bangakhetha khona ivelu elilodwa noma ibanga lamavelu. Izilayidi zingaba netimu futhi zenziwe ngokwezifiso.", "demoSlidersContinuousWithEditableNumericalValue": "Ukuqhubeka ne-Editable Numerical Value", "demoSlidersDiscrete": "Lahla", "demoSlidersDiscreteSliderWithCustomTheme": "Lahla isilayidi ngetimu yangokwezifiso", "demoSlidersContinuousRangeSliderWithCustomTheme": "Ukuqhubekisa isilayidi sebanga ngetimu yangokwezifsio", "demoSlidersContinuous": "Okuqhubekayo", "placePondicherry": "E-Pondicherry", "demoMenuTitle": "Imenyu", "demoContextMenuTitle": "Imenyu yokuqukethwe", "demoSectionedMenuTitle": "Imenyu efakwe kusigaba", "demoSimpleMenuTitle": "Imenyu elula", "demoChecklistMenuTitle": "Imenyu yohlu lokuhlola", "demoMenuSubtitle": "Izinkinobho zemenyu namamenyu alula", "demoMenuDescription": "Imenyu ibonisa uhlu lwezinketho kundawo yangokwesikhashana. Zivela uma abasebenzisi bahlanganyela nenkinobho, isenzo, noma esinye isilawuli.", "demoMenuItemValueOne": "Into yemenyu yokuqala", "demoMenuItemValueTwo": "Into yemenyu yesibili", "demoMenuItemValueThree": "Into yemenyu yesithathu", "demoMenuOne": "Kunye", "demoMenuTwo": "Kubili", "demoMenuThree": "Kuthathu", "demoMenuContextMenuItemThree": "Into yesithathu yokuqukethwe kwemenyu", "demoCupertinoSwitchSubtitle": "iswishi yesitayela se-iOS", "demoSnackbarsText": "Lena i-snackbar.", "demoCupertinoSliderSubtitle": "isilayida sesitayela se-iOS", "demoCupertinoSliderDescription": "Isilayida singasetshenziswa ukuze kukhethwe isethi yamanani aqhubekayo noma okuzikhethela.", "demoCupertinoSliderContinuous": "Okuqhubekayo: {value}", "demoCupertinoSliderDiscrete": "Ukuzikhethela: {value}", "demoSnackbarsAction": "Ucindezele isenzo se-snackbar.", "backToGallery": "Buyela kwigalari", "demoCupertinoTabBarTitle": "Ibha yethebhu", "demoCupertinoSwitchDescription": "Iswishi isetshenziselwa ukuguqula isimo sokuvula/sokuvala kusilungiselelo esisodwa.", "demoSnackbarsActionButtonLabel": "ISENZO", "cupertinoTabBarProfileTab": "Iphrofayela", "demoSnackbarsButtonLabel": "BONISA I-SNACKBAR", "demoSnackbarsDescription": "Ama-snackbar azisa abasebenzisi ngenqubo uhlelo lokusebenza oluyenzile noma oluzoyenza. Avela okwesikhashana, ngaphansi kwesikrini. Akumele aphazamise umuzwa womsebenzisi, futhi awadingi ukufakwa komsebenzisi ukuze anyamalale.", "demoSnackbarsSubtitle": "Ama-snackbar abonisa imilayezo ngaphansi kwesikrini", "demoSnackbarsTitle": "Ama-snackbar", "demoCupertinoSliderTitle": "Isilayida", "cupertinoTabBarChatTab": "Xoxa", "cupertinoTabBarHomeTab": "Ekhaya", "demoCupertinoTabBarDescription": "Ibha yethebhu yokuzulazula engaphansi yesitayela se-iOS. Ibonisa amathebhu amaningi ngethebhu eyodwa eyenziwe yasebenza, ithebhu yokuqala ngokuzenzakalela.", "demoCupertinoTabBarSubtitle": "Ibha yethebhu engaphansi yesitayela se-iOS", "demoOptionsFeatureTitle": "Buka izinketho", "demoOptionsFeatureDescription": "Thepha lapha ukuze ubuke izinketho ezitholakalayo zale demo.", "demoCodeViewerCopyAll": "KOPISHA KONKE", "shrineScreenReaderRemoveProductButton": "Susa i-{product}", "shrineScreenReaderProductAddToCart": "Engeza kukalishi", "shrineScreenReaderCart": "{quantity,plural, =0{Ikalishi lokuthenga, azikho izinto}=1{Ikalishi lokuthenga, 1 into}one{Ikalishi lokuthenga, {quantity} izinto}other{Ikalishi lokuthenga, {quantity} izinto}}", "demoCodeViewerFailedToCopyToClipboardMessage": "Yehlulekile ukukopishela kubhodi lokunamathisela: {error}", "demoCodeViewerCopiedToClipboardMessage": "Kukopishwe kubhodi lokunamathisela.", "craneSleep8SemanticLabel": "Ukonakala kwase-Mayan eweni ngaphezulu kwebhishi", "craneSleep4SemanticLabel": "Ihhotela elikuhlangothi lwechibi ngaphambi kwezintaba", "craneSleep2SemanticLabel": "I-Machu Picchu citadel", "craneSleep1SemanticLabel": "I-chalet yokwakheka kwezwe eneqhwa enezihlahla ezihlala ziluhlaza", "craneSleep0SemanticLabel": "Ama-bungalow angaphezu kwamanzi", "craneFly13SemanticLabel": "Iphuli ekuhlangothi lolwandle olunezihlahla zamasundu", "craneFly12SemanticLabel": "Iphuli enezihlahla zamasundu", "craneFly11SemanticLabel": "Indlu enesibani yesitina esolwandle", "craneFly10SemanticLabel": "I-Al-Azhar Mosque towers ngesikhathi sokushona kwelanga", "craneFly9SemanticLabel": "Indoda encike kumoto endala eluhlaza okwesibhakabhaka", "craneFly8SemanticLabel": "I-Supertree Grove", "craneEat9SemanticLabel": "Ikhawunta yekhefi enama-pastry", "craneEat2SemanticLabel": "Ibhega", "craneFly5SemanticLabel": "Ihhotela elikuhlangothi lwechibi ngaphambi kwezintaba", "demoSelectionControlsSubtitle": "Amabhokisi okuthikha, izinkinobho zerediyo, namaswishi", "craneEat10SemanticLabel": "Owesifazane ophethe isemishi enkulu ye-pastrami", "craneFly4SemanticLabel": "Ama-bungalow angaphezu kwamanzi", "craneEat7SemanticLabel": "Indawo yokungena yokubhakwa kwezinkwa", "craneEat6SemanticLabel": "Isidlo se-Shrimp", "craneEat5SemanticLabel": "Indawo yokuhlala yerestshurenti ye-Artsy", "craneEat4SemanticLabel": "Isidlo sokwehlisa soshokoledi", "craneEat3SemanticLabel": "I-Korean taco", "craneFly3SemanticLabel": "I-Machu Picchu citadel", "craneEat1SemanticLabel": "Ibha engenalutho enezitulo zesitayela sedina", "craneEat0SemanticLabel": "I-pizza kuwovini onomlilo wezinkuni", "craneSleep11SemanticLabel": "I-Taipei 101 skyscraper", "craneSleep10SemanticLabel": "I-Al-Azhar Mosque towers ngesikhathi sokushona kwelanga", "craneSleep9SemanticLabel": "Indlu enesibani yesitina esolwandle", "craneEat8SemanticLabel": "Ipuleti le-crawfish", "craneSleep7SemanticLabel": "Izindawo zokuhlala ezinemibalabala e-Riberia Square", "craneSleep6SemanticLabel": "Iphuli enezihlahla zamasundu", "craneSleep5SemanticLabel": "Itende kunkambu", "settingsButtonCloseLabel": "Vala izilungiselelo", "demoSelectionControlsCheckboxDescription": "Amabhokisi okuhlola avumela umsebenzisi ukuthi akhethe izinketho eziningi kusukela kusethi. Inani elijwayelekile lebhokisi lokuhlola liyiqiniso noma lingamanga futhi inani lebhokisi lokuhlola le-tristate nalo lingaba ngelingavumelekile.", "settingsButtonLabel": "Izilungiselelo", "demoListsTitle": "Uhlu", "demoListsSubtitle": "Izendlalelo zohlu lokuskrola", "demoListsDescription": "Umugqa wokuphakama okulungisiwe oqukethe umbhalo kanye nesithonjana esilandelayo noma esiholayo.", "demoOneLineListsTitle": "Umugqa owodwa", "demoTwoLineListsTitle": "Imigqa emibili", "demoListsSecondary": "Umbhalo wesibili", "demoSelectionControlsTitle": "Izilawuli zokukhethwa", "craneFly7SemanticLabel": "I-Mount Rushmore", "demoSelectionControlsCheckboxTitle": "Ibhokisi lokuthikha", "craneSleep3SemanticLabel": "Indoda encike kumoto endala eluhlaza okwesibhakabhaka", "demoSelectionControlsRadioTitle": "Irediyo", "demoSelectionControlsRadioDescription": "Izinkinobho zerediyo zivumela umsebenzisi ukuthi akhethe inketho eyodwa kusukela kusethi. Sebenzisa izinkinobho zerediyo zokukhethwa okukhethekile uma ucabanga ukuthi umsebenzisi kumele abone zonke izinketho ezikhethekile uhlangothi ukuya kolunye.", "demoSelectionControlsSwitchTitle": "Iswishi", "demoSelectionControlsSwitchDescription": "Amaswishi okuvula/ukuvala aguqula isimo senketho eyodwa yezilungiselelo. Inketho elawulwa iswishi kanye nesimo ekuyo, kumele kwenziwe kube sobala kusukela kulebula engaphakathi komugqa ehambisanayo.", "craneFly0SemanticLabel": "I-chalet yokwakheka kwezwe eneqhwa enezihlahla ezihlala ziluhlaza", "craneFly1SemanticLabel": "Itende kunkambu", "craneFly2SemanticLabel": "Amafulegi omthandazo angaphambi kwentaba eneqhwa", "craneFly6SemanticLabel": "Ukubuka okuphezulu kwe-Palacio de Bellas Artes", "rallySeeAllAccounts": "Bona wonke ama-akhawunti", "rallyBillAmount": "{billName} inkokhelo ifuneka ngomhla ka-{date} ngokungu-{amount}.", "shrineTooltipCloseCart": "Vala ikalishi", "shrineTooltipCloseMenu": "Vala imenyu", "shrineTooltipOpenMenu": "Vula imenyu", "shrineTooltipSettings": "Izilungiselelo", "shrineTooltipSearch": "Sesha", "demoTabsDescription": "Amathebhu ahlela okuqukethwe kuzikrini ezihlukile zokuqukethwe, amasethi edatha, nokunye ukuhlanganyela.", "demoTabsSubtitle": "Amathebhu anokubuka okuzimele okuskrolekayo", "demoTabsTitle": "Amathebhu", "rallyBudgetAmount": "{budgetName} ibhajethi enokungu-{amountUsed} okusetshenzisiwe kokungu-{amountTotal}, {amountLeft} okusele", "shrineTooltipRemoveItem": "Susa into", "rallyAccountAmount": "{accountName} i-akhawunti engu-{accountNumber} enokungu-{amount}.", "rallySeeAllBudgets": "Bona wonke amabhajethi", "rallySeeAllBills": "Bona zonke izinkokhelo", "craneFormDate": "Khetha idethi", "craneFormOrigin": "Khetha okoqobo", "craneFly2": "I-Khumbu Valley, Nepal", "craneFly3": "I-Machu Picchu, Peru", "craneFly4": "I-Malé, Maldives", "craneFly5": "I-Vitznau, Switzerland", "craneFly6": "I-Mexico City, Mexico", "craneFly7": "I-Mount Rushmore, United States", "settingsTextDirectionLocaleBased": "Kususelwa kokwasendaweni", "craneFly9": "I-Havana, Cuba", "craneFly10": "I-Cairo, Egypt", "craneFly11": "I-Lisbon, e-Portugal", "craneFly12": "I-Napa, United States", "craneFly13": "I-Bali, Indonesia", "craneSleep0": "I-Malé, Maldives", "craneSleep1": "I-Aspen, United States", "craneSleep2": "I-Machu Picchu, Peru", "demoCupertinoSegmentedControlTitle": "Ulawulo olufakwe kusegmenti", "craneSleep4": "I-Vitznau, Switzerland", "craneSleep5": "I-Big Sur, United States", "craneSleep6": "I-Napa, United States", "craneSleep7": "I-Porto, Portugal", "craneSleep8": "I-Tulum, Mexico", "craneEat5": "I-Seoul, South Korea", "demoChipTitle": "Amashipsi", "demoChipSubtitle": "Izinto ezihlangene ezimela ukungena, ukuchasisa, noma isenzo", "demoActionChipTitle": "I-Chip yesenzo", "demoActionChipDescription": "Ama-chip ayisethi yezinketho acupha isenzo esiphathelene nokuqukethwe okuyinhloko. Ama-chip kufanele abonakale ngokubanzi nangokuqukethwe ku-UI.", "demoChoiceChipTitle": "I-Chip yenketho", "demoChoiceChipDescription": "Ama-chips amela inketho eyodwa kusuka kusethi. Ama-chip enketho aphathelene nombhalo wencazelo noma izigaba.", "demoFilterChipTitle": "I-chip yesihlungi", "demoFilterChipDescription": "Hlunga ama-chip wokusebenzisa noma amagama okuchaza njengendlela yokuhlunga okuqukethwe.", "demoInputChipTitle": "I-Chip yokungena", "demoInputChipDescription": "Ama-chip amela ucezu oluyingxube lolwazi, njengamabhizinisi (okomuntu, indawo, into) umbhalo wengxoxo ngendlela eminyene.", "craneSleep9": "I-Lisbon, e-Portugal", "craneEat10": "I-Lisbon, e-Portugal", "demoCupertinoSegmentedControlDescription": "Kusetshenziselwe ukukhetha phakathi kwenombolo yezinketho ezikhethekile ngokufanayo. Uma inketho eyodwa ekulawulweni okwenziwe isegmenti ikhethwa, ezinye izinketho ekulawulweni okwenziwe isegmenti ziyayeka ukukhethwa.", "chipTurnOnLights": "Vala amalambu", "chipSmall": "Okuncane", "chipMedium": "Maphakathi", "chipLarge": "Okukhulu", "chipElevator": "Ilifthi", "chipWasher": "Kokuwasha", "chipFireplace": "Iziko", "chipBiking": "Ukuhamba ngamabhayisikili", "craneFormDiners": "I-Diners", "rallyAlertsMessageUnassignedTransactions": "{count,plural, =1{Khuphula amandla akho okudonselwa intela! Nikeza izigaba kumsebenzi ongu-1 ongenasigaba.}one{Khuphula amandla akho okudonselwa intela! Nikeza izigaba kumisebenzi enganikeziwe engu-{count}.}other{Khuphula amandla akho okudonselwa intela! Nikeza izigaba kumisebenzi enganikeziwe engu-{count}.}}", "craneFormTime": "Khetha isikhathi", "craneFormLocation": "Khetha indawo", "craneFormTravelers": "Abavakashi", "craneEat8": "I-Atlanta, United States", "craneFormDestination": "Khetha indawo okuyiwa kuyo", "craneFormDates": "Khetha amadethi", "craneFly": "I-FLY", "craneSleep": "LALA", "craneEat": "I-EAT", "craneFlySubhead": "Hlola izindiza ngendawo", "craneSleepSubhead": "Hlola izinto ngendawo", "craneEatSubhead": "Hlola izindawo zokudlela ngendawo", "craneFlyStops": "{numberOfStops,plural, =0{Ukungami}=1{1 isitobhi}one{{numberOfStops} izitobhi}other{{numberOfStops} izitobhi}}", "craneSleepProperties": "{totalProperties,plural, =0{Azikho izici ezitholakalayo}=1{1 isici esitholakalayo}one{{totalProperties} Izici ezitholakalayo}other{{totalProperties} Izici ezitholakalayo}}", "craneEatRestaurants": "{totalRestaurants,plural, =0{Awekho amarestshurenti}=1{1 irestshurenti}one{{totalRestaurants} Amarestshurenti}other{{totalRestaurants} Amarestshurenti}}", "craneFly0": "I-Aspen, United States", "demoCupertinoSegmentedControlSubtitle": "ulawulo olwenziwe isegmenti lwesitayela se-iOS", "craneSleep10": "I-Cairo, Egypt", "craneEat9": "I-Madrid, Spain", "craneFly1": "I-Big Sur, United States", "craneEat7": "I-Nashville, United States", "craneEat6": "I-Seattle, United States", "craneFly8": "U-Singapore", "craneEat4": "I-Paris, France", "craneEat3": "I-Portland, United States", "craneEat2": "I-Córdoba, Argentina", "craneEat1": "I-Dallas, United States", "craneEat0": "I-Naples, Italy", "craneSleep11": "I-Taipei, Taiwan", "craneSleep3": "I-Havana, Cuba", "shrineLogoutButtonCaption": "PHUMA NGEMVUME", "rallyTitleBills": "AMABHILI", "rallyTitleAccounts": "AMA-AKHAWUNTI", "shrineProductVagabondSack": "I-Vagabond sack", "rallyAccountDetailDataInterestYtd": "I-YTD yenzalo", "shrineProductWhitneyBelt": "Ibhande le-Whitney", "shrineProductGardenStrand": "I-Garden strand", "shrineProductStrutEarrings": "Amacici e-Strut", "shrineProductVarsitySocks": "Amasokisi e-Varsity", "shrineProductWeaveKeyring": "I-Weave keyring", "shrineProductGatsbyHat": "Isigqoko se-Gatsby", "shrineProductShrugBag": "I-Shrug bag", "shrineProductGiltDeskTrio": "Okuthathu kwetafula ye-Gilt", "shrineProductCopperWireRack": "I-Copper wire rack", "shrineProductSootheCeramicSet": "Isethi ye-Soothe ceramic", "shrineProductHurrahsTeaSet": "Isethi yetiya ye-Hurrahs", "shrineProductBlueStoneMug": "I-mug yetshe eluhlaza okwesibhakabhaka", "shrineProductRainwaterTray": "Ithreyi ye-Rainwater", "shrineProductChambrayNapkins": "I-Chambray napkins", "shrineProductSucculentPlanters": "I-Succulent planters", "shrineProductQuartetTable": "Ithebula lekota", "shrineProductKitchenQuattro": "I-quattro yasekhishini", "shrineProductClaySweater": "I-Clay sweater", "shrineProductSeaTunic": "I-Sea tunic", "shrineProductPlasterTunic": "I-Plaster tunic", "rallyBudgetCategoryRestaurants": "Amarestshurenti", "shrineProductChambrayShirt": "Ishedi le-Chambray", "shrineProductSeabreezeSweater": "I-Seabreeze sweater", "shrineProductGentryJacket": "Ijakethi ye-Gentry", "shrineProductNavyTrousers": "Amabhulukwe anevi", "shrineProductWalterHenleyWhite": "I-Walter henley (emhlophe)", "shrineProductSurfAndPerfShirt": "Ishedi le-Surf and perf", "shrineProductGingerScarf": "I-Ginger scarf", "shrineProductRamonaCrossover": "I-Ramona crossover", "shrineProductClassicWhiteCollar": "Ikhola emhlophe yakudala", "shrineProductSunshirtDress": "Ingubo ye-Sunshirt", "rallyAccountDetailDataInterestRate": "Isilinganiso senzalo", "rallyAccountDetailDataAnnualPercentageYield": "Ukuvuma kwephesenti kwangonyaka", "rallyAccountDataVacation": "Uhambo", "shrineProductFineLinesTee": "I-Fine lines tee", "rallyAccountDataHomeSavings": "Ukulondoloza kwekhaya", "rallyAccountDataChecking": "Kuyahlolwa", "rallyAccountDetailDataInterestPaidLastYear": "Inzuzo ekhokhelwe unyaka owedlule", "rallyAccountDetailDataNextStatement": "Isitatimende esilandelayo", "rallyAccountDetailDataAccountOwner": "Umnikazo we-akhawunti", "rallyBudgetCategoryCoffeeShops": "Izitolo zekhofi", "rallyBudgetCategoryGroceries": "Amagrosa", "shrineProductCeriseScallopTee": "Cerise scallop tee", "rallyBudgetCategoryClothing": "Izimpahla", "rallySettingsManageAccounts": "Phatha ama-akhawunti", "rallyAccountDataCarSavings": "Ukulondoloza kwemoto", "rallySettingsTaxDocuments": "Amadokhumenti ombhalo", "rallySettingsPasscodeAndTouchId": "I-Passcode ne-Touch ID", "rallySettingsNotifications": "Izaziso", "rallySettingsPersonalInformation": "Ulwazi ngawe", "rallySettingsPaperlessSettings": "Izilungiselelo ezingenaphepha", "rallySettingsFindAtms": "Thola ama-ATMs", "rallySettingsHelp": "Usizo", "rallySettingsSignOut": "Phuma ngemvume", "rallyAccountTotal": "Isamba", "rallyBillsDue": "Ifuneka", "rallyBudgetLeft": "Kwesobunxele", "rallyAccounts": "Ama-akhawunti", "rallyBills": "Amabhili", "rallyBudgets": "Amabhajethi", "rallyAlerts": "Izexwayiso", "rallySeeAll": "BONA KONKE", "rallyFinanceLeft": "KWESOBUNXELE", "rallyTitleOverview": "UKUBUKA KONKE", "shrineProductShoulderRollsTee": "I-Shoulder rolls tee", "shrineNextButtonCaption": "OKULANDELAYO", "rallyTitleBudgets": "AMABHAJETHI", "rallyTitleSettings": "IZILUNGISELELO", "rallyLoginLoginToRally": "Ngena ku-Rally", "rallyLoginNoAccount": "Awunayo i-akhawunti?", "rallyLoginSignUp": "BHALISA", "rallyLoginUsername": "Igama lomsebenzisi", "rallyLoginPassword": "Iphasiwedi", "rallyLoginLabelLogin": "Ngena ngemvume", "rallyLoginRememberMe": "Ngikhumbule", "rallyLoginButtonLogin": "NGENA NGEMVUME", "rallyAlertsMessageHeadsUpShopping": "Amakhanda phezulu, usebenzise u-{percent} webhajethi yakho yokuthenga kule nyanga.", "rallyAlertsMessageSpentOnRestaurants": "Usebenzise u-{amount} ezindaweni zokudlela kuleli viki.", "rallyAlertsMessageATMFees": "Uchithe u-{amount} enkokhelweni ye-ATM kule nyanga", "rallyAlertsMessageCheckingAccount": "Umsebenzi omuhle! I-akhawunti yakho yokuhlola ngu-{percent} ngaphezulu kunenyanga edlule.", "shrineMenuCaption": "IMENYU", "shrineCategoryNameAll": "KONKE", "shrineCategoryNameAccessories": "IZINSIZA", "shrineCategoryNameClothing": "IZINGUBO", "shrineCategoryNameHome": "IKHAYA", "shrineLoginUsernameLabel": "Igama lomsebenzisi", "shrineLoginPasswordLabel": "Iphasiwedi", "shrineCancelButtonCaption": "KHANSELA", "shrineCartTaxCaption": "Intela:", "shrineCartPageCaption": "IKALISHI", "shrineProductQuantity": "Ubuningi: {quantity}", "shrineProductPrice": "x {price}", "shrineCartItemCount": "{quantity,plural, =0{AZIKHO IZINTO}=1{1 INTO}one{{quantity} IZINTO}other{{quantity} IZINTO}}", "shrineCartClearButtonCaption": "SULA INQOLA", "shrineCartTotalCaption": "ISAMBA", "shrineCartSubtotalCaption": "Inani elingaphansi:", "shrineCartShippingCaption": "Ukuthunyelwa:", "shrineProductGreySlouchTank": "Ithanki ye-slouch empunga", "shrineProductStellaSunglasses": "Izibuko ze-Stella", "shrineProductWhitePinstripeShirt": "Ishedi le-pinstripe elimhlophe", "demoTextFieldWhereCanWeReachYou": "Singakuthola kuphi?", "settingsTextDirectionLTR": "LTR", "settingsTextScalingLarge": "Omkhulu", "demoBottomSheetHeader": "Unhlokweni", "demoBottomSheetItem": "Into {value}", "demoBottomTextFieldsTitle": "Izinkambu zombhalo", "demoTextFieldTitle": "Izinkambu zombhalo", "demoTextFieldSubtitle": "Umugqa owodwa wombhalo ohlelekayo nezinombolo", "demoTextFieldDescription": "Izinkambu zombhalo zivumela abasebenzisi ukufaka umbhalo ku-UI. Ibonakala kumafomu nezingxoxo.", "demoTextFieldShowPasswordLabel": "Bonisa iphasiwedi", "demoTextFieldHidePasswordLabel": "Fihla iphasiwedi", "demoTextFieldFormErrors": "Sicela ulungise amaphutha abomvu ngaphambi kokuhambisa.", "demoTextFieldNameRequired": "Igama liyadingeka.", "demoTextFieldOnlyAlphabeticalChars": "Sicela ufake izinhlamvu ngokulandelana.", "demoTextFieldEnterUSPhoneNumber": "(###) ###-#### - Faka inombolo yefoni ye-US.", "demoTextFieldEnterPassword": "Sicela ufake iphasiwedi.", "demoTextFieldPasswordsDoNotMatch": "Amaphasiwedi awafani", "demoTextFieldWhatDoPeopleCallYou": "Bakubiza ngokuthini abantu?", "demoTextFieldNameField": "Igama*", "demoBottomSheetButtonText": "BONISA ISHIDI ELIPHANSI", "demoTextFieldPhoneNumber": "Inombolo yefoni*", "demoBottomSheetTitle": "Ishidi eliphansi", "demoTextFieldEmail": "I-imeyili", "demoTextFieldTellUsAboutYourself": "Sitshele ngawe (isb., bhala phansi okwenzayo noma okuthandayo onakho)", "demoTextFieldKeepItShort": "Igcine iyimfushane, le idemo nje.", "starterAppGenericButton": "INKINOBHO", "demoTextFieldLifeStory": "Indaba yempilo", "demoTextFieldSalary": "Umholo", "demoTextFieldUSD": "USD", "demoTextFieldNoMoreThan": "Hhayi ngaphezu kwezinhlamvu ezingu-8.", "demoTextFieldPassword": "Iphasiwedi*", "demoTextFieldRetypePassword": "Thayipha kabusha iphasiwedi*", "demoTextFieldSubmit": "THUMELA", "demoBottomNavigationSubtitle": "Ukuzula kwaphansi ngokubuka kwe-cross-fading", "demoBottomSheetAddLabel": "Engeza", "demoBottomSheetModalDescription": "Ishidi eliphansi le-modal kungenye indlela kumentu noma ingxoxo futhi ivimbela umsebenzisi ekusebenzisaneni nalo lonke uhlelo lokusebenza.", "demoBottomSheetModalTitle": "Ishidi laphansi le-Modal", "demoBottomSheetPersistentDescription": "Ishidi eliphansi eliphoqelelayo libonisa uolwazi olusekela okuqukethwe okuyinhloko kohlelo lokusebenza. Ishidi laphansi eliphoqelelayo lihlala libonakala ngisho noma umsebenzisi exhumana nezinye izingxenye zohlelo lokusebenza.", "demoBottomSheetPersistentTitle": "ishidi eliphansi eliphoqelelayo", "demoBottomSheetSubtitle": "Amashidi waphansi aphoqelelayo nawe-modal", "demoTextFieldNameHasPhoneNumber": "{name} inombolo yefoni ngu-{phoneNumber}", "buttonText": "INKINOBHO", "demoTypographyDescription": "Izincazelo zezitayela ezahlukahlukene ze-typographical zitholakele kudizayini ebalulekile.", "demoTypographySubtitle": "Zonke izitayela zombhalo ezichazwe ngaphambilini", "demoTypographyTitle": "I-Typography", "demoFullscreenDialogDescription": "Isici se-FullscreenDialog sicacisa uma ngabe ikhasi elingenayo liyibhokisi lesikrini esigcwele se-modal yini", "demoFlatButtonDescription": "Inkinobho ephansi ibonisa ukusaphazeka kweyinki ekucindezweni kodwa ayiphakami. Sebenzisa izinkinobho eziphansi kumabha wamathuluzi, kumabhokisi nangaphakathi kolayini ngokokugxusha", "demoBottomNavigationDescription": "Amabha wokuzula aphansi abonisa ubukhulu obuthathu bezindawo ezinhlanu phansi kwesikrini. Indawo ngayinye imelwe isithonjana kanye nelebuli yombhalo ekhethekayo. Uma isithonjana sokuzula sithephiwa, umsebenzisi uyiswa endaweni yokuzula ephathelene naleso sithonjana.", "demoBottomNavigationSelectedLabel": "Ilebuli ekhethiwe", "demoBottomNavigationPersistentLabels": "Amalebuli aphoqelelayo", "starterAppDrawerItem": "Into {value}", "demoTextFieldRequiredField": "* ibonisa inkambu edingekayo", "demoBottomNavigationTitle": "Ukuzulela phansi", "settingsLightTheme": "Ukukhanya", "settingsTheme": "itimu", "settingsPlatformIOS": "I-iOS", "settingsPlatformAndroid": "I-Android", "settingsTextDirectionRTL": "RTL", "settingsTextScalingHuge": "Nkulu kakhulu", "cupertinoButton": "Inkinobho", "settingsTextScalingNormal": "Jwayelekile", "settingsTextScalingSmall": "Omncane", "settingsSystemDefault": "Isistimu", "settingsTitle": "Izilungiselelo", "rallyDescription": "Uhlelo lokusebenza lezezimali zomuntu", "aboutDialogDescription": "Ukuze ubone ikhodi yomthombo yalolu hlelo lokusebenza, sicela uvakashele i-{repoLink}.", "bottomNavigationCommentsTab": "Amazwana", "starterAppGenericBody": "Umzimba", "starterAppGenericHeadline": "Isihlokwana", "starterAppGenericSubtitle": "Umbhalo ongezansi", "starterAppGenericTitle": "Isihloko", "starterAppTooltipSearch": "Sesha", "starterAppTooltipShare": "Yabelana", "starterAppTooltipFavorite": "Intandokazi", "starterAppTooltipAdd": "Engeza", "bottomNavigationCalendarTab": "Ikhalenda", "starterAppDescription": "Isendlalelo sokuqalisa sokuphendula", "starterAppTitle": "Uhlelo lokusebenza lokuqalisa", "aboutFlutterSamplesRepo": "Amasampuli we-Flutter we-GitHub repo", "bottomNavigationContentPlaceholder": "Isimeli sethebhu ye-{title}", "bottomNavigationCameraTab": "Ikhamela", "bottomNavigationAlarmTab": "I-alamu", "bottomNavigationAccountTab": "I-akhawunti", "demoTextFieldYourEmailAddress": "Ikheli lakho le-imeyili", "demoToggleButtonDescription": "Izinkinobho zokuguqula zingasetshenziswa ukuze zifake kuqembu izinketho ezihambisanayo. Ukuze kugcizelelwe amaqembu ezinkinobho ezihambisanayo zokuguqula, iqembu kumele labelane ngesiqukathi esijwayelekile", "colorsGrey": "OKUMPUNGA", "colorsBrown": "OKUMPOFU", "colorsDeepOrange": "OKUWOLINTSHI OKUJULILE", "colorsOrange": "IWOLINTSHI", "colorsAmber": "I-AMBER", "colorsYellow": "OKULIPHUZI", "colorsLime": "I-LIME", "colorsLightGreen": "OKULUHLAZA OKUKHANYAYO", "colorsGreen": "OKULUHLAZA OKOTSHANI", "homeHeaderGallery": "Igalari", "homeHeaderCategories": "Izigaba", "shrineDescription": "Uhlelo lokusebenza lokuthenga lwemfashini", "craneDescription": "Uhlelo lokusebenza lokuhamba olwenziwe ngezifiso", "homeCategoryReference": "IZITAYELA NOKUNYE", "demoInvalidURL": "Ayikwazanga ukubonisa i-URL:", "demoOptionsTooltip": "Izinketho", "demoInfoTooltip": "Ulwazi", "demoCodeTooltip": "Ikhodi ye-Demo", "demoDocumentationTooltip": "Amadokhumenti e-API", "demoFullscreenTooltip": "Isikrini Esigcwele", "settingsTextScaling": "Ukukalwa kombhalo", "settingsTextDirection": "Isiqondisindlela sombhalo", "settingsLocale": "Isifunda", "settingsPlatformMechanics": "I-Platform mechanics", "settingsDarkTheme": "Kumnyama", "settingsSlowMotion": "Islowu moshini", "settingsAbout": "Mayelana ne-Flutter Gallery", "settingsFeedback": "Thumela impendulo", "settingsAttribution": "Kudizayinwe ngu-TOASTER e-London", "demoButtonTitle": "Izinkinobho", "demoButtonSubtitle": "Okuphansi, okuphakanyisiwe, uhlaka, nokuningi", "demoFlatButtonTitle": "Inkinobho ephansi", "demoRaisedButtonDescription": "Izinkinobho ezingeziwe zingeza ubukhulu kaningi kuzakhiwo eziphansi. Zigcizelela imisebenzi kuzikhala ezimatasa noma ezibanzi.", "demoRaisedButtonTitle": "Inkinobho ephakanyisiwe", "demoOutlineButtonTitle": "Inkinobho yohlaka", "demoOutlineButtonDescription": "Izinkinobho zohlala ziba i-opaque ziphinde ziphakame uma zicindezelwa. Zivamise ukubhangqwa nezinkinobho eziphakanyisiwe ukuze zibonise esinye isenzo, sesibili.", "demoToggleButtonTitle": "Izinkinobho zokuguqula", "colorsTeal": "I-TEAL", "demoFloatingButtonTitle": "Inkinobho yesenzo entantayo", "demoFloatingButtonDescription": "Inkinobho yesenzo esintantayo inkinobho esandingiliza yesithonjana ehamba ngaphezulu kokuqukethwe ukuze kuphromothwe isenzo esiyinhloko kuhlelo lokusebenza.", "demoDialogTitle": "Amabhokisi", "demoDialogSubtitle": "Ilula, isexwayiso, nesikrini esigcwele", "demoAlertDialogTitle": "Isexwayiso", "demoAlertDialogDescription": "Ibhokisi lesexwayiso lazisa umsebenzisi mayelana nezimo ezidinga ukuvunywa. Ibhokisi lesexwayiso linesihloko ongasikhetha kanye nohlu ongalukhetha lwezenzo.", "demoAlertTitleDialogTitle": "Isexwayiso esinesihloko", "demoSimpleDialogTitle": "Kulula", "demoSimpleDialogDescription": "Ibhokisi elilula linikeza umsebenzisi inketho ephakathi kwezinketho ezithile. Ibhokisi elilula linesihloko ongasikhetha esiboniswa ngaphezulu kwezinketho.", "demoFullscreenDialogTitle": "Isikrini esigcwele", "demoCupertinoButtonsTitle": "Izinkinobho", "demoCupertinoButtonsSubtitle": "izinkinobho zesitayela se-iOS", "demoCupertinoButtonsDescription": "Inkinobho yesitayela se-iOS. Ithatha ifake ngaphakathi umbhalo kanye/noma isithonjana esifiphalayo siphume siphinde sifiphale singene ekuthintweni. Kungenzeka ngokukhetheka ibe nengemuva.", "demoCupertinoAlertsTitle": "Izexwayiso", "demoCupertinoAlertsSubtitle": "amabhokisi esexwayiso sesitayela se-iOS", "demoCupertinoAlertTitle": "Isexwayiso", "demoCupertinoAlertDescription": "Ibhokisi lesexwayiso lazisa umsebenzisi mayelana nezimo ezidinga ukuvunywa. Ibhokisi lesexwayiso linesihloko ongasikhetha, okuqukethwe ongakukhetha, kanye nohlu ongalukhetha lwezenzo. Isihloko siboniswa ngaphezulu kokuqukethwe futhi izenzo ziboniswa ngaphansi kokuqukethwe.", "demoCupertinoAlertWithTitleTitle": "Isexwayiso esinesihloko", "demoCupertinoAlertButtonsTitle": "Isexwayiso esinezinkinobho", "demoCupertinoAlertButtonsOnlyTitle": "Izinkinobho zesexwayiso kuphela", "demoCupertinoActionSheetTitle": "Ishidi lesenzo", "demoCupertinoActionSheetDescription": "Ishidi lesenzo uhlobo oluthile lwesexwayiso oluphrezenta umsebenzisi ngesethi yezinketho ezimbili noma ngaphezulu ezihambisana nokuqukethwe kwamanje. Ishidi lesenzo lingaba nesihloko, umlayezo ongeziwe, kanye nohlu lwezenzo.", "demoColorsTitle": "Imibala", "demoColorsSubtitle": "Yonke imibala echazwe ngaphambilini", "demoColorsDescription": "Umbala nokuhambisana kahle kwe-swatch yombala okumele i-palette yombala yedizayini yokubalulekile.", "buttonTextEnabled": "ENABLED", "buttonTextDisabled": "DISABLED", "buttonTextCreate": "Dala", "dialogSelectedOption": "Ukhethe: \"{value}\"", "dialogDiscardTitle": "Lahla okusalungiswa?", "dialogLocationTitle": "Sebenzisa isevisi yendawo ye-Google?", "dialogLocationDescription": "Vumela i-Google isize izinhlelo zokusebenza zithole indawo. Lokhu kusho ukuthumela idatha yendawo engaziwa ku-Google, nanoma kungekho zinhlelo zokusebenza ezisebenzayo.", "dialogCancel": "KHANSELA", "dialogDiscard": "LAHLA", "dialogDisagree": "UNGAVUMI", "dialogAgree": "VUMA", "dialogSetBackup": "Setha i-akhawunti yokwenza isipele", "colorsBlueGrey": "OKUMPUNGA SALUHLAZA OKWESIBHAKABHAKA", "dialogShow": "BONISA IBHOKISI", "dialogFullscreenTitle": "Ibhokisi lesikrini esigcwele", "dialogFullscreenSave": "LONDOLOZA", "dialogFullscreenDescription": "Idemo yebhokisi lesikrini esigcwele", "cupertinoButtonEnabled": "Enabled", "cupertinoButtonDisabled": "Disabled", "cupertinoButtonWithBackground": "Nengemuva", "cupertinoAlertCancel": "Khansela", "cupertinoAlertDiscard": "Lahla", "cupertinoAlertLocationTitle": "Vumela okuthi \"Amamephu\" ukuze ufinyelele kundawo yakho ngenkathi usebenzisa uhlelo lokusebenza?", "cupertinoAlertLocationDescription": "Indawo yakho yamanje izoboniswa kumephu iphinde isetshenziselwe izikhombisi-ndlela, imiphumela yosesho oluseduze, nezikhathi zokuvakasha ezilinganisiwe.", "cupertinoAlertAllow": "Vumela", "cupertinoAlertDontAllow": "Ungavumeli", "cupertinoAlertFavoriteDessert": "Khetha isidlo sokwehlisa esiyintandokazi", "cupertinoAlertDessertDescription": "Sicela ukhethe uhlobo lwakho oluyintandokazi lwesidlo sokwehlisa kusukela kuhlu olungezansi. Ukukhethwa kwakho kuzosetshenziselwa ukwenza kube ngokwakho uhlu oluphakanyisiwe lwezindawo zokudlela endaweni yangakini.", "cupertinoAlertCheesecake": "I-Cheesecake", "cupertinoAlertTiramisu": "I-Tiramisu", "cupertinoAlertApplePie": "Uphaya we-apula", "cupertinoAlertChocolateBrownie": "I-Chocolate brownie", "cupertinoShowAlert": "Bonisa isexwayiso", "colorsRed": "OKUBOMVU", "colorsPink": "OKUPHINKI", "colorsPurple": "OKUPHEPHULI", "colorsDeepPurple": "OKUPHEPHULI OKUJULILE", "colorsIndigo": "I-INDIGO", "colorsBlue": "OKULUHLAZA OKWESIBHAKABHAKA", "colorsLightBlue": "OKULUHLAZA OKWESIBHAKABHAKA NGOKUKHANYAYO", "colorsCyan": "I-CYAN", "dialogAddAccount": "Engeza i-akhawunti", "Gallery": "Igalari", "Categories": "Izigaba", "SHRINE": "I-SHRINE", "Basic shopping app": "Uhlelo lokusebenza lokuthenga oluyisisekelo", "RALLY": "I-RALLY", "CRANE": "I-CRANE", "Travel app": "Uhlelo lokusebenza lokuvakasha", "MATERIAL": "OKUBALULEKILE", "CUPERTINO": "I-CUPERTINO", "REFERENCE STYLES & MEDIA": "IZITAYELA ZENKOMBA NEMIDIYA" }
{ "pile_set_name": "Github" }
// // Pager pagination // -------------------------------------------------- .pager { padding-left: 0; margin: $line-height-computed 0; list-style: none; text-align: center; @include clearfix; li { display: inline; > a, > span { display: inline-block; padding: 5px 14px; background-color: $pager-bg; border: 1px solid $pager-border; border-radius: $pager-border-radius; } > a:hover, > a:focus { text-decoration: none; background-color: $pager-hover-bg; } } .next { > a, > span { float: right; } } .previous { > a, > span { float: left; } } .disabled { > a, > a:hover, > a:focus, > span { color: $pager-disabled-color; background-color: $pager-bg; cursor: $cursor-disabled; } } }
{ "pile_set_name": "Github" }
# -*- coding: UTF-8 -*- # File: common.py # Author: Yuxin Wu <[email protected]> import tensorflow as tf import os, shutil import re from .base import Callback from ..utils import * from ..tfutils.varmanip import get_savename_from_varname __all__ = ['ModelSaver', 'MinSaver', 'MaxSaver', 'SlotCleaner'] class ModelSaver(Callback): """ Save the model to logger directory. """ def __init__(self, keep_recent=10, keep_freq=0.5, var_collections=tf.GraphKeys.VARIABLES): """ :param keep_recent: see `tf.train.Saver` documentation. :param keep_freq: see `tf.train.Saver` documentation. """ self.keep_recent = keep_recent self.keep_freq = keep_freq if not isinstance(var_collections, list): var_collections = [var_collections] self.var_collections = var_collections def _setup_graph(self): vars = [] for key in self.var_collections: vars.extend(tf.get_collection(key)) self.path = os.path.join(logger.LOG_DIR, 'model') self.saver = tf.train.Saver( var_list=ModelSaver._get_var_dict(vars), max_to_keep=self.keep_recent, keep_checkpoint_every_n_hours=self.keep_freq) self.meta_graph_written = False @staticmethod def _get_var_dict(vars): var_dict = {} for v in vars: name = get_savename_from_varname(v.name) if name not in var_dict: if name != v.name: logger.info( "{} renamed to {} when saving model.".format(v.name, name)) var_dict[name] = v else: logger.warn("Variable {} won't be saved \ because {} will be saved".format(v.name, var_dict[name].name)) return var_dict def _trigger_epoch(self): try: if not self.meta_graph_written: self.saver.export_meta_graph( os.path.join(logger.LOG_DIR, 'graph-{}.meta'.format(logger.get_time_str())), collection_list=self.graph.get_all_collection_keys()) self.meta_graph_written = True self.saver.save( tf.get_default_session(), self.path, global_step=self.global_step, write_meta_graph=False) # create a symbolic link for the latest model latest = self.saver.last_checkpoints[-1] basename = os.path.basename(latest) linkname = os.path.join(os.path.dirname(latest), 'latest') try: os.unlink(linkname) except OSError: pass os.symlink(basename, linkname) except (OSError, IOError): # disk error sometimes.. just ignore it logger.exception("Exception in ModelSaver.trigger_epoch!") class MinSaver(Callback): def __init__(self, monitor_stat, reverse=True, filename=None): self.monitor_stat = monitor_stat self.reverse = reverse self.filename = filename self.min = None def _get_stat(self): try: v = self.trainer.stat_holder.get_stat_now(self.monitor_stat) except KeyError: v = None return v def _need_save(self): v = self._get_stat() if not v: return False return v > self.min if self.reverse else v < self.min def _trigger_epoch(self): if self.min is None or self._need_save(): self.min = self._get_stat() if self.min: self._save() def _save(self): ckpt = tf.train.get_checkpoint_state(logger.LOG_DIR) if ckpt is None: raise RuntimeError( "Cannot find a checkpoint state. Do you forget to use ModelSaver?") path = ckpt.model_checkpoint_path newname = os.path.join(logger.LOG_DIR, self.filename or ('max-' if self.reverse else 'min-' + self.monitor_stat + '.tfmodel')) shutil.copy(path, newname) logger.info("Model with {} '{}' saved.".format( 'maximum' if self.reverse else 'minimum', self.monitor_stat)) class MaxSaver(MinSaver): def __init__(self, monitor_stat): super(MaxSaver, self).__init__(monitor_stat, True) class SlotCleaner(Callback): def _setup_graph(self): self.optimizer = self.trainer.config.optimizer variables = tf.get_collection('trainable_variables') slot_names = self.optimizer.get_slot_names() slot_vars = [self.optimizer.get_slot(var, s) for s in slot_names for var in variables] self.init_slot_ops = tf.initialize_variables(slot_vars) def _before_train(self): sess = tf.get_default_session() sess.run(self.init_slot_ops)
{ "pile_set_name": "Github" }
{ "metadata": { "name": "", "signature": "sha256:edf1ca894a94cfa25a8797702bfc13da0ae902f6e98cab5e7dc188bd0b661c8f" }, "nbformat": 3, "nbformat_minor": 0, "worksheets": [ { "cells": [ { "cell_type": "markdown", "metadata": {}, "source": [ "# This file is also available in *.py format" ] }, { "cell_type": "code", "collapsed": false, "input": [ "import sys\n", "try:\n", " from setuptools import setup\n", " have_setuptools = True\n", "except ImportError:\n", " from distutils.core import setup\n", " have_setuptools = False\n", "\n", "setup_kwargs = {\n", " 'name': 'compphys',\n", " 'version': '0.1',\n", " 'description': 'Effective Computation in Physics',\n", " 'author': 'Anthony Scopatz and Kathryn D. Huff',\n", " 'author_email': '[email protected]',\n", " 'url': 'http://www.oreilly.com/',\n", " 'classifiers': [\n", " 'License :: OSI Approved',\n", " 'Intended Audience :: Developers',\n", " 'Programming Language :: Python :: 3',\n", " ],\n", " 'zip_safe': False,\n", " 'packages': ['compphys', 'compphys.more'],\n", " 'package_dir': {\n", " 'compphys': 'compphys', \n", " 'compphys.more': 'compphys/more', \n", " },\n", " 'data_files': [('compphys/raw', ['*.txt'])],\n", " }\n", "\n", "#if __name__ == '__main__':\n", "# setup(**setup_kwargs)" ], "language": "python", "metadata": {}, "outputs": [], "prompt_number": 1 } ], "metadata": {} } ] }
{ "pile_set_name": "Github" }
- name: install-home-db | Transfer oracle installfiles to server (www - get_url) get_url: url={{ oracle_sw_source_www }}/{{ item[0].filename }} dest={{ oracle_stage }} mode=775 force=no with_nested: - "{{oracle_sw_image_db}}" - "{{db_homes_installed}}" become: yes become_user: "{{ oracle_user }}" run_once: "{{ configure_cluster}}" when: item[0].version == db_homes_config[item[1].home]['version'] and item[1].state|lower == 'present' and not is_sw_source_local and oracle_sw_copy tags: - oradbsw
{ "pile_set_name": "Github" }
{ "compilerOptions": { "target": "es2017", "module": "commonjs", "lib": ["es2017", "dom"], "jsx": "react", "strict": true, "esModuleInterop": false } }
{ "pile_set_name": "Github" }
#! /usr/bin/env python # coding=utf-8 from __future__ import print_function from __future__ import unicode_literals __version__ = "1.7" import sys from os import path, extsep from subprocess import Popen, PIPE, CalledProcessError class GitArchiver(object): """ GitArchiver Scan a git repository and export all tracked files, and submodules. Checks for .gitattributes files in each directory and uses 'export-ignore' pattern entries for ignore files in the archive. Automatically detects output format extension: zip, tar, bz2, or gz. """ def __init__(self, prefix='', verbose=False, exclude=True, force_sub=False, extra=None, main_repo_abspath=None): """ @type prefix: string @param prefix: Prefix used to prepend all paths in the resulting archive. @type verbose: bool @param verbose: Determines verbosity of the output (stdout). @type exclude: bool @param exclude: Determines whether archiver should follow rules specified in .gitattributes files. Defaults to True. @type force_sub: bool @param force_sub: Determines whether submodules are initialized and updated before archiving. Defaults to False @type extra: list @param extra: List of extra paths to include in the resulting archive. @type main_repo_abspath: string @param main_repo_abspath: Absolute path to the main repository (or one of subdirectories). If None, current cwd is used. If given path is path to a subdirectory (but not a submodule directory!) it will be replaced with abspath to toplevel directory of the repository. """ if extra is None: extra = [] if main_repo_abspath is None: main_repo_abspath = path.abspath('') elif not path.isabs(main_repo_abspath): raise ValueError("You MUST pass absolute path to the main git repository.") # Raises an exception if there is no repo under main_repo_abspath. try: self.run_shell("[ -d .git ] || git rev-parse --git-dir > /dev/null 2>&1", main_repo_abspath) except Exception as e: raise ValueError("Not a git repository (or any of the parent directories).".format(path=main_repo_abspath)) # Detect toplevel directory of the repo. main_repo_abspath = path.abspath(self.read_git_shell('git rev-parse --show-toplevel', main_repo_abspath).rstrip()) self.prefix = prefix self.verbose = verbose self.exclude = exclude self.extra = extra self.force_sub = force_sub self.main_repo_abspath = main_repo_abspath def create(self, output_path, dry_run=False, output_format=None): """ Creates the archive, written to the given output_file_path Type of the archive is determined either by extension of output_file_path or by the format argument. Supported formats are: gz, zip, bz2, tar, tgz @type output_path: string @param output_path: Output file path. @type dry_run: bool @param dry_run: Determines whether create should do nothing but print what it would archive. @type output_format: string @param output_format: Determines format of the output archive. If None, format is determined from extension of output_file_path. """ if output_format is None: file_name, file_ext = path.splitext(output_path) output_format = file_ext[len(extsep):].lower() if output_format == 'zip': from zipfile import ZipFile, ZIP_DEFLATED if not dry_run: archive = ZipFile(path.abspath(output_path), 'w') add = lambda file_path, file_name: archive.write(file_path, path.join(self.prefix, file_name), ZIP_DEFLATED) elif output_format in ['tar', 'bz2', 'gz', 'tgz']: import tarfile if output_format == 'tar': t_mode = 'w' elif output_format == 'tgz': t_mode = 'w:gz' else: t_mode = 'w:{f}'.format(f=output_format) if not dry_run: archive = tarfile.open(path.abspath(output_path), t_mode) add = lambda file_path, file_name: archive.add(file_path, path.join(self.prefix, file_name)) else: raise RuntimeError("Unknown format: {f}".format(f=output_format)) for file_path in self.extra: if not dry_run: if self.verbose: print("Compressing {f} => {a}...".format(f=file_path, a=path.join(self.prefix, file_path))) add(file_path, file_path) else: print("{f} => {a}".format(f=file_path, a=path.join(self.prefix, file_path))) for file_path in self.list_files(): if not dry_run: if self.verbose: print("Compressing {f} => {a}...".format(f=path.join(self.main_repo_abspath, file_path), a=path.join(self.prefix, file_path))) add(path.join(self.main_repo_abspath, file_path), file_path) else: print("{f} => {a}".format(f=path.join(self.main_repo_abspath, file_path), a=path.join(self.prefix, file_path))) if not dry_run: archive.close() def get_path_components(self, repo_abspath, abspath): """ Splits given abspath into components until repo_abspath is reached. E.g. if repo_abspath is '/Documents/Hobby/ParaView/' and abspath is '/Documents/Hobby/ParaView/Catalyst/Editions/Base/', function will return: ['.', 'Catalyst', 'Editions', 'Base'] First element is always '.' (concrete symbol depends on OS). @type repo_abspath: string @param repo_abspath: Absolute path to the git repository. @type abspath: string @param abspath: Absolute path to within repo_abspath. @rtype: list @return: List of path components. """ components = [] while not path.samefile(abspath, repo_abspath): abspath, tail = path.split(abspath) if len(tail): components.insert(0, tail) components.insert(0, path.relpath(repo_abspath, repo_abspath)) return components def get_exclude_patterns(self, repo_abspath, repo_file_paths): """ Returns exclude patterns for a given repo. It looks for .gitattributes files in repo_file_paths. Resulting dictionary will contain exclude patterns per path (relative to the repo_abspath). E.g. {('.', 'Catalyst', 'Editions', 'Base'), ['Foo*', '*Bar']} @type repo_abspath: string @param repo_abspath: Absolute path to the git repository. @type repo_file_paths: list @param repo_file_paths: List of paths relative to the repo_abspath that are under git control. @rtype: dict @return: Dictionary representing exclude patterns. Keys are tuples of strings. Values are lists of strings. Returns None if self.exclude is not set. """ if not self.exclude: return None def read_attributes(attributes_abspath): patterns = [] if path.isfile(attributes_abspath): attributes = open(attributes_abspath, 'r').readlines() patterns = [] for line in attributes: tokens = line.strip().split() if "export-ignore" in tokens[1:]: patterns.append(tokens[0]) return patterns exclude_patterns = {(): []} # There may be no gitattributes. try: global_attributes_abspath = self.read_shell("git config --get core.attributesfile", repo_abspath).rstrip() exclude_patterns[()] = read_attributes(global_attributes_abspath) except: # And valid to not have them. pass for attributes_abspath in [path.join(repo_abspath, f) for f in repo_file_paths if f.endswith(".gitattributes")]: # Each .gitattributes affects only files within its directory. key = tuple(self.get_path_components(repo_abspath, path.dirname(attributes_abspath))) exclude_patterns[key] = read_attributes(attributes_abspath) local_attributes_abspath = path.join(repo_abspath, ".git", "info", "attributes") key = tuple(self.get_path_components(repo_abspath, repo_abspath)) if key in exclude_patterns: exclude_patterns[key].extend(read_attributes(local_attributes_abspath)) else: exclude_patterns[key] = read_attributes(local_attributes_abspath) return exclude_patterns def is_file_excluded(self, repo_abspath, repo_file_path, exclude_patterns): """ Checks whether file at a given path is excluded. @type repo_abspath: string @param repo_abspath: Absolute path to the git repository. @type repo_file_path: string @param repo_file_path: Path to a file within repo_abspath. @type exclude_patterns: dict @param exclude_patterns: Exclude patterns with format specified for get_exclude_patterns. @rtype: bool @return: True if file should be excluded. Otherwise False. """ if exclude_patterns is None or not len(exclude_patterns): return False from fnmatch import fnmatch file_name = path.basename(repo_file_path) components = self.get_path_components(repo_abspath, path.join(repo_abspath, path.dirname(repo_file_path))) is_excluded = False # We should check all patterns specified in intermediate directories to the given file. # At the end we should also check for the global patterns (key '()' or empty tuple). while not is_excluded: key = tuple(components) if key in exclude_patterns: patterns = exclude_patterns[key] for p in patterns: if fnmatch(file_name, p) or fnmatch(repo_file_path, p): if self.verbose: print("Exclude pattern matched {pattern}: {path}".format(pattern=p, path=repo_file_path)) is_excluded = True if not len(components): break components.pop() return is_excluded def list_files(self, repo_path=''): """ An iterator method that yields a file path relative to main_repo_abspath for each file that should be included in the archive. Skips those that match the exclusion patterns found in any discovered .gitattributes files along the way. Recurs into submodules as well. @type repo_path: string @param repo_path: Path to the git submodule repository within the main git repository. @rtype: iterator @return: Iterator to traverse files under git control relative to main_repo_abspath. """ repo_abspath = path.join(self.main_repo_abspath, repo_path) repo_file_paths = self.read_git_shell("git ls-files --cached --full-name --no-empty-directory", repo_abspath).splitlines() exclude_patterns = self.get_exclude_patterns(repo_abspath, repo_file_paths) for repo_file_path in repo_file_paths: # Git puts path in quotes if file path has unicode characters. repo_file_path = repo_file_path.strip('"') # file path relative to current repo file_name = path.basename(repo_file_path) # Only list symlinks and files that don't start with git. if (not path.islink(repo_file_path) and path.isdir(repo_file_path)): continue main_repo_file_path = path.join(repo_path, repo_file_path) # file path relative to the main repo if self.is_file_excluded(repo_abspath, repo_file_path, exclude_patterns): continue # Yield both repo_file_path and main_repo_file_path to preserve structure of the repo. yield main_repo_file_path if self.force_sub: self.run_shell("git submodule init", repo_abspath) self.run_shell("git submodule update", repo_abspath) # List files of every submodule. for submodule_path in self.read_shell("git submodule --quiet foreach 'pwd'", repo_abspath).splitlines(): # In order to get output path we need to exclude repository path from submodule_path. submodule_path = path.relpath(submodule_path, self.main_repo_abspath) for file_path in self.list_files(submodule_path): yield file_path @staticmethod def run_shell(cmd, cwd=None): """ Runs shell command. @type cmd: string @param cmd: Command to be executed. @type cwd: string @param cwd: Working directory. @rtype: int @return: Return code of the command. @raise CalledProcessError: Raises exception if return code of the command is non-zero. """ p = Popen(cmd, shell=True, cwd=cwd) p.wait() if p.returncode: raise CalledProcessError(returncode=p.returncode, cmd=cmd) return p.returncode @staticmethod def read_shell(cmd, cwd=None, encoding='utf-8'): """ Runs shell command and reads output. @type cmd: string @param cmd: Command to be executed. @type cwd: string @param cwd: Working directory. @type encoding: string @param encoding: Encoding used to decode bytes returned by Popen into string. @rtype: string @return: Output of the command. @raise CalledProcessError: Raises exception if return code of the command is non-zero. """ p = Popen(cmd, shell=True, stdout=PIPE, cwd=cwd) output, _ = p.communicate() output = output.decode(encoding) if p.returncode: raise CalledProcessError(returncode=p.returncode, cmd=cmd, output=output) return output @staticmethod def read_git_shell(cmd, cwd=None): """ Runs git shell command, reads output and decodes it into unicode string @type cmd: string @param cmd: Command to be executed. @type cwd: string @param cwd: Working directory. @rtype: string @return: Output of the command. @raise CalledProcessError: Raises exception if return code of the command is non-zero. """ p = Popen(cmd, shell=True, stdout=PIPE, cwd=cwd) output, _ = p.communicate() output = output.decode('unicode_escape').encode('raw_unicode_escape').decode('utf-8') if p.returncode: raise CalledProcessError(returncode=p.returncode, cmd=cmd, output=output) return output if __name__ == '__main__': from optparse import OptionParser parser = OptionParser(usage="usage: %prog [-v] [--prefix PREFIX] [--no-exclude] [--force-submodules] [--dry-run] OUTPUT_FILE", version="%prog {version}".format(version=__version__)) parser.add_option('--prefix', type='string', dest='prefix', default='', help="Prepend PREFIX to each filename in the archive. OUTPUT_FILE name is used by default to avoid tarbomb.") parser.add_option('-v', '--verbose', action='store_true', dest='verbose', help='Enable verbose mode.') parser.add_option('--no-exclude', action='store_false', dest='exclude', default=True, help="Don't read .gitattributes files for patterns containing export-ignore attrib.") parser.add_option('--force-submodules', action='store_true', dest='force_sub', help="Force a git submodule init && git submodule update at each level before iterating submodules.") parser.add_option('--extra', action='append', dest='extra', default=[], help="Any additional files to include in the archive.") parser.add_option('--dry-run', action='store_true', dest='dry_run', help="Don't actually archive anything, just show what would be done.") options, args = parser.parse_args() if len(args) != 1: parser.error("You must specify exactly one output file") output_file_path = args[0] if path.isdir(output_file_path): parser.error("You cannot use directory as output") # avoid tarbomb if options.prefix: options.prefix = path.join(options.prefix, '') else: import re output_name = path.basename(output_file_path) output_name = re.sub('(\.zip|\.tar|\.tgz|\.gz|\.bz2|\.tar\.gz|\.tar\.bz2)$', '', output_name) or "Archive" options.prefix = path.join(output_name, '') try: archiver = GitArchiver(options.prefix, options.verbose, options.exclude, options.force_sub, options.extra) archiver.create(output_file_path, options.dry_run) except Exception as e: parser.exit(2, "{exception}\n".format(exception=e)) sys.exit(0)
{ "pile_set_name": "Github" }
/*************************************************** * 版权声明 * * 本操作系统名为:MINE * 该操作系统未经授权不得以盈利或非盈利为目的进行开发, * 只允许个人学习以及公开交流使用 * * 代码最终所有权及解释权归田宇所有; * * 本模块作者: 田宇 * EMail: [email protected] * * ***************************************************/ #ifndef __CPU_H__ #define __CPU_H__ #define NR_CPUS 8 /* */ inline void get_cpuid(unsigned int Mop,unsigned int Sop,unsigned int * a,unsigned int * b,unsigned int * c,unsigned int * d) { __asm__ __volatile__ ( "cpuid \n\t" :"=a"(*a),"=b"(*b),"=c"(*c),"=d"(*d) :"0"(Mop),"2"(Sop) ); } /* */ void init_cpu(void); #endif
{ "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.ignite.internal.commandline.diagnostic; import org.apache.ignite.internal.commandline.Command; /** * */ public enum DiagnosticSubCommand { /** */ HELP("help", null), /** */ PAGE_LOCKS("pageLocks", new PageLocksCommand()); /** Diagnostic command name. */ private final String name; /** Command instance for certain type. */ private final Command command; /** * @param name Command name. * @param command Command handler. */ DiagnosticSubCommand( String name, Command command ) { this.name = name; this.command = command; } /** * @return Subcommand realization. */ public Command subcommand() { return command; } /** * @param text Command text. * @return Command for the text. */ public static DiagnosticSubCommand of(String text) { for (DiagnosticSubCommand cmd : DiagnosticSubCommand.values()) { if (cmd.name.equalsIgnoreCase(text)) return cmd; } return null; } /** {@inheritDoc} */ @Override public String toString() { return name; } }
{ "pile_set_name": "Github" }
page { background: #eee; }
{ "pile_set_name": "Github" }
/* * Copyright (c) 2002-2020 Gargoyle Software 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. */ package com.gargoylesoftware.htmlunit.html; import static java.nio.charset.StandardCharsets.UTF_8; import java.io.File; import java.util.ArrayList; import java.util.Arrays; import java.util.Collections; import java.util.List; import org.apache.commons.io.FileUtils; import org.junit.Rule; import org.junit.Test; import org.junit.rules.TemporaryFolder; import org.junit.runner.RunWith; import com.gargoylesoftware.htmlunit.BrowserRunner; import com.gargoylesoftware.htmlunit.HttpMethod; import com.gargoylesoftware.htmlunit.MockWebConnection; import com.gargoylesoftware.htmlunit.Page; import com.gargoylesoftware.htmlunit.SimpleWebTestCase; /** * Tests for {@link HtmlSelect}. * * @author <a href="mailto:[email protected]">Mike Bowler</a> * @author Mike Williams * @author Marc Guillemot * @author Ahmed Ashour */ @RunWith(BrowserRunner.class) public class HtmlSelectTest extends SimpleWebTestCase { /** JUnit rule must be public fields :-(. */ @Rule public TemporaryFolder tmpFolderProvider_ = new TemporaryFolder(); /** * Test the good path of submitting a select. * @exception Exception If the test fails */ @Test public void select() throws Exception { final String htmlContent = "<html><head><title>foo</title></head><body>\n" + "<form id='form1'><select name='select1'>\n" + "<option value='option1'>Option1</option>\n" + "<option value='option2' selected='selected'>Option2</option>\n" + "<option value='option3'>Option3</option>\n" + "</select>\n" + "<input type='submit' name='button' value='foo'/>\n" + "</form></body></html>"; final HtmlPage page = loadPage(htmlContent); final MockWebConnection webConnection = getMockConnection(page); final HtmlForm form = page.getHtmlElementById("form1"); final HtmlSelect select = form.getSelectsByName("select1").get(0); final HtmlSubmitInput button = form.getInputByName("button"); // Test that the select is being correctly identified as a submittable element assertEquals(Arrays.asList(new Object[] {select, button}), form.getSubmittableElements(button)); // Test that the correct value is being passed back up to the server final HtmlPage secondPage = button.click(); assertEquals("url", URL_FIRST + "?select1=option2&button=foo", secondPage.getUrl()); assertSame("method", HttpMethod.GET, webConnection.getLastMethod()); assertNotNull(secondPage); } /** * Tests submitting the select with no options selected. * @exception Exception If the test fails */ @Test public void select_MultipleSelectNoneSelected() throws Exception { final String htmlContent = "<html><head><title>foo</title></head><body>\n" + "<form id='form1'><select name='select1' multiple>\n" + "<option value='option1'>Option1</option>\n" + "<option value='option2'>Option2</option>\n" + "<option value='option3'>Option3</option>\n" + "</select>\n" + "<input type='submit' name='button' value='foo'/>\n" + "</form></body></html>"; final HtmlPage page = loadPage(htmlContent); final MockWebConnection webConnection = getMockConnection(page); final HtmlForm form = page.getHtmlElementById("form1"); final HtmlSelect select = form.getSelectsByName("select1").get(0); assertNotNull(select); final HtmlSubmitInput button = form.getInputByName("button"); // Test that the correct value is being passed back up to the server final HtmlPage secondPage = button.click(); assertEquals("url", URL_FIRST + "?button=foo", secondPage.getUrl()); assertSame("method", HttpMethod.GET, webConnection.getLastMethod()); assertNotNull(secondPage); } /** * Tests changing the selected option. * @exception Exception If the test fails */ @Test public void select_ChangeSelectedOption_SingleSelect() throws Exception { final String htmlContent = "<html><head><title>foo</title></head><body>\n" + "<form id='form1'><select name='select1'>\n" + "<option value='option1' selected='selected'>Option1</option>\n" + "<option value='option2'>Option2</option>\n" + "<option value='option3'>Option3</option>\n" + "</select>\n" + "<input type='submit' name='button' value='foo'/>\n" + "</form></body></html>"; final HtmlPage page = loadPage(htmlContent); final MockWebConnection webConnection = getMockConnection(page); final HtmlForm form = page.getHtmlElementById("form1"); final HtmlSelect select = form.getSelectsByName("select1").get(0); final HtmlSubmitInput button = form.getInputByName("button"); // Change the value select.setSelectedAttribute("option3", true); // Test that the correct value is being passed back up to the server final HtmlPage secondPage = button.click(); assertEquals("url", URL_FIRST + "?select1=option3&button=foo", secondPage.getUrl()); assertSame("method", HttpMethod.GET, webConnection.getLastMethod()); assertNotNull(secondPage); } /** * Tests changing the selected option. * @exception Exception If the test fails */ @Test public void select_ChangeSelectedOption_MultipleSelect() throws Exception { final String htmlContent = "<html><head><title>foo</title></head><body>\n" + "<form id='form1'><select name='select1' multiple='multiple'>\n" + "<option value='option1' selected='selected'>Option1</option>\n" + "<option value='option2'>Option2</option>\n" + "<option value='option3'>Option3</option>\n" + "</select>\n" + "<input type='submit' name='button' value='foo'/>\n" + "</form></body></html>"; final HtmlPage page = loadPage(htmlContent); final MockWebConnection webConnection = getMockConnection(page); final HtmlForm form = page.getHtmlElementById("form1"); final HtmlSelect select = form.getSelectsByName("select1").get(0); final HtmlSubmitInput button = form.getInputByName("button"); // Change the value select.setSelectedAttribute("option3", true); select.setSelectedAttribute("option2", true); // Test that the correct value is being passed back up to the server final HtmlPage secondPage = button.click(); assertEquals("url", URL_FIRST + "?select1=option1&select1=option2&select1=option3&button=foo", secondPage.getUrl()); assertSame("method", HttpMethod.GET, webConnection.getLastMethod()); assertNotNull(secondPage); } /** * Tests multiple selected options on multiple select lists. * @exception Exception If the test fails */ @Test public void select_MultipleSelectMultipleSelected() throws Exception { final String htmlContent = "<html><head><title>foo</title></head><body>\n" + "<form id='form1'><select name='select1' multiple>\n" + "<option value='option1' selected='selected'>Option1</option>\n" + "<option value='option2'>Option2</option>\n" + "<option value='option3' selected='selected'>Option3</option>\n" + "</select>\n" + "<input type='submit' name='button' value='foo'/>\n" + "</form></body></html>"; final HtmlPage page = loadPage(htmlContent); final HtmlForm form = page.getHtmlElementById("form1"); final HtmlSelect select = form.getSelectsByName("select1").get(0); final List<HtmlOption> expected = new ArrayList<>(); expected.add(select.getOptionByValue("option1")); expected.add(select.getOptionByValue("option3")); assertEquals(expected, select.getSelectedOptions()); } /** * Test multiple selected options on single select lists. This is erroneous HTML, but * browsers simply use the last option. * * @exception Exception If the test fails */ @Test public void select_SingleSelectMultipleSelected() throws Exception { final String htmlContent = "<html><head><title>foo</title></head><body>\n" + "<form id='form1'><select name='select1'>\n" + "<option value='option1' selected='selected'>Option1</option>\n" + "<option value='option2'>Option2</option>\n" + "<option value='option3' selected='selected'>Option3</option>\n" + "</select>\n" + "<input type='submit' name='button' value='foo'/>\n" + "</form></body></html>"; final HtmlPage page = loadPage(htmlContent); final HtmlForm form = page.getHtmlElementById("form1"); final HtmlSelect select = form.getSelectsByName("select1").get(0); final List<HtmlOption> expected = new ArrayList<>(); expected.add(select.getOptionByValue("option3")); assertEquals(expected, select.getSelectedOptions()); } /** * Test no selected options on single select lists. This is erroneous HTML, but * browsers simply assume the first one to be selected * * @exception Exception If the test fails */ @Test public void select_SingleSelectNoneSelected() throws Exception { final String htmlContent = "<html><head><title>foo</title></head><body>\n" + "<form id='form1'><select name='select1'>\n" + "<option value='option1'>Option1</option>\n" + "<option value='option2'>Option2</option>\n" + "<option value='option3'>Option3</option>\n" + "</select>\n" + "<input type='submit' name='button' value='foo'/>\n" + "</form></body></html>"; final HtmlPage page = loadPage(htmlContent); final HtmlForm form = page.getHtmlElementById("form1"); final HtmlSelect select = form.getSelectsByName("select1").get(0); final List<HtmlOption> expected = new ArrayList<>(); expected.add(select.getOptionByValue("option1")); assertEquals(expected, select.getSelectedOptions()); } /** * Tests no selected options on single select lists with a size more than 1. * * @exception Exception If the test fails */ @Test public void select_SingleSelectNoneSelectedButSizeGreaterThanOne() throws Exception { final String htmlContent = "<html><head><title>foo</title></head><body>\n" + "<form>\n" + "<select name='select1' size='2' id='mySelect'>\n" + "<option value='option1'>Option1</option>\n" + "<option value='option2'>Option2</option>\n" + "<option value='option3'>Option3</option>\n" + "</select>\n" + "</form></body></html>"; final HtmlPage page = loadPage(htmlContent); final HtmlSelect select = page.getHtmlElementById("mySelect"); assertEquals(Collections.EMPTY_LIST, select.getSelectedOptions()); } /** * Tests changing the selected option. * @exception Exception If the test fails */ @Test public void setSelected_IllegalValue() throws Exception { final String htmlContent = "<html><head><title>foo</title></head><body>\n" + "<form id='form1'><select name='select1'>\n" + "<option value='option1' selected='selected'>Option1</option>\n" + "<option value='option2'>Option2</option>\n" + "<option value='option3'>Option3</option>\n" + "</select>\n" + "<select name='select2'>\n" + "</select>\n" + "<input type='submit' name='button' value='foo'/>\n" + "</form></body></html>"; final HtmlPage page = loadPage(htmlContent); final HtmlForm form = page.getHtmlElementById("form1"); final HtmlSelect select = form.getSelectByName("select1"); select.setSelectedAttribute("missingOption", true); } /** * @throws Exception if the test fails */ @Test public void getOptions() throws Exception { final String htmlContent = "<html><head><title>foo</title></head><body>\n" + "<form id='form1'><select name='select1'>\n" + "<option value='option1' selected='selected'>Option1</option>\n" + "<option value='option2'>Option2</option>\n" + "<optgroup label='group1'>\n" + " <option value='option3'>Option3</option>\n" + "</optgroup>\n" + "</select>\n" + "<input type='submit' name='button' value='foo'/>\n" + "</form></body></html>"; final HtmlPage page = loadPage(htmlContent); final HtmlForm form = page.getHtmlElementById("form1"); final HtmlSelect select = form.getSelectsByName("select1").get(0); final List<HtmlOption> expectedOptions = new ArrayList<>(); expectedOptions.add(select.getOptionByValue("option1")); expectedOptions.add(select.getOptionByValue("option2")); expectedOptions.add(select.getOptionByValue("option3")); assertEquals(expectedOptions, select.getOptions()); } /** * @throws Exception if the test fails */ @Test public void select_OptionMultiple_NoValueOnAttribute() throws Exception { final String htmlContent = "<html><head><title>foo</title></head><body>\n" + "<form id='form1'><select name='select1' id='select1' multiple>\n" + "<option value='option1'>Option1</option>\n" + "<option value='option2' >Option2</option>\n" + "<option value='option3'>Option3</option>\n" + "</select>\n" + "<input type='submit' name='button' value='foo'/>\n" + "</form></body></html>"; final HtmlPage page = loadPage(htmlContent); final HtmlSelect select = page.getHtmlElementById("select1"); assertTrue(select.isMultipleSelectEnabled()); } /** * @throws Exception if the test fails */ @Test public void getOptionByValue() throws Exception { final String htmlContent = "<html><head><title>foo</title></head><body><form id='form1'>\n" + "<select name='select1'>\n" + " <option value='option1'>s1o1</option>\n" + " <option value='option2'>s1o2</option>\n" + "</select>\n" + "<select name='select2'>\n" + " <option value='option1'>s2o1</option>\n" + " <option value='option2'>s2o2</option>\n" + " <option>s2o3</option>\n" + "</select>\n" + "<input type='submit' name='button' value='foo'/>\n" + "</form></body></html>"; final HtmlPage page = loadPage(htmlContent); final HtmlForm form = page.getHtmlElementById("form1"); final HtmlSelect select = form.getSelectsByName("select2").get(0); assertEquals("s2o2", select.getOptionByValue("option2").asText()); assertEquals(select.getOption(2), select.getOptionByValue("s2o3")); } /** * @throws Exception if the test fails */ @Test public void select_SetSelected_OnChangeHandler() throws Exception { final String htmlContent = "<html><head><title>foo</title></head><body>\n" + "<form id='form1'><select name='select1' onChange='alert(\"changing\")'>\n" + "<option value='option1' selected='selected'>Option1</option>\n" + "<option value='option2'>Option2</option>\n" + "<option value='option3'>Option3</option>\n" + "</select>\n" + "<input type='submit' name='button' value='foo'/>\n" + "</form></body></html>"; final List<String> collectedAlerts = new ArrayList<>(); final HtmlPage page = loadPage(htmlContent, collectedAlerts); final HtmlForm form = page.getHtmlElementById("form1"); final HtmlSelect select = form.getSelectsByName("select1").get(0); // Change the value select.setSelectedAttribute("option3", true); final String[] expectedAlerts = {"changing"}; assertEquals(expectedAlerts, collectedAlerts); } /** * @throws Exception if the test fails */ @Test public void setSelectionOnOptionWithNoName() throws Exception { final String htmlContent = "<html><body><form name='form' method='GET' action='action.html'>\n" + "<select name='select' multiple size='5'>\n" + "<option value='1'>111</option>\n" + "<option id='option2'>222</option>\n" + "</select>\n" + "</form></body></html>"; final List<String> collectedAlerts = new ArrayList<>(); final HtmlPage page = loadPage(htmlContent, collectedAlerts); final HtmlOption option = page.getHtmlElementById("option2"); option.setSelected(true); } private static void checkOptions(final HtmlSelect select) { final List<HtmlOption> options = select.getOptions(); if (options.isEmpty()) { assertNull(select.getFirstChild()); assertNull(select.getLastChild()); } else { assertEquals(options.get(0), select.getFirstChild()); assertEquals(options.get(options.size() - 1), select.getLastChild()); } } /** @throws Exception if the test fails */ @Test public void removeOptionsFromSelect() throws Exception { final String htmlContent = "<html><body><form name='form' method='GET' action='action.html'>\n" + "<select name='select' id='theSelect'>" + "<option value='a'>111</option>" + "<option value='b'>222</option>" + "<option value='c'>333</option>" + "<option value='d'>444</option>" + "</select>\n" + "</form></body></html>"; final HtmlPage page = loadPage(htmlContent); final HtmlSelect theSelect = page.getHtmlElementById("theSelect"); assertNotNull(theSelect); assertEquals(4, theSelect.getOptions().size()); assertEquals("a", theSelect.getOption(0).getValueAttribute()); assertEquals("b", theSelect.getOption(1).getValueAttribute()); assertEquals("c", theSelect.getOption(2).getValueAttribute()); assertEquals("d", theSelect.getOption(3).getValueAttribute()); // remove from the middle theSelect.getOption(1).remove(); checkOptions(theSelect); assertEquals(3, theSelect.getOptions().size()); assertEquals("a", theSelect.getOption(0).getValueAttribute()); assertEquals("c", theSelect.getOption(1).getValueAttribute()); assertEquals("d", theSelect.getOption(2).getValueAttribute()); // remove from the end theSelect.getOption(2).remove(); checkOptions(theSelect); assertEquals(2, theSelect.getOptions().size()); assertEquals("a", theSelect.getOption(0).getValueAttribute()); assertEquals("c", theSelect.getOption(1).getValueAttribute()); // remove from the front theSelect.getOption(0).remove(); checkOptions(theSelect); assertEquals(1, theSelect.getOptions().size()); assertEquals("c", theSelect.getOption(0).getValueAttribute()); // remove from the last one theSelect.getOption(0).remove(); checkOptions(theSelect); assertEquals(0, theSelect.getOptions().size()); } /** @throws Exception if the test fails */ @Test public void editOptions() throws Exception { final String htmlContent = "<html><body><form name='form' method='GET' action='action.html'>\n" + "<select name='select' id='theSelect'>\n" + "<option value='a'>111</option>\n" + "<option value='b'>222</option>\n" + "<option value='c'>333</option>\n" + "</select>\n" + "</form></body></html>"; final HtmlPage page = loadPage(htmlContent); final HtmlSelect theSelect = page.getHtmlElementById("theSelect"); assertNotNull(theSelect); assertEquals(3, theSelect.getOptions().size()); appendOption(theSelect, "d"); assertEquals(4, theSelect.getOptions().size()); assertEquals("d", theSelect.getOption(3).getValueAttribute()); theSelect.setOptionSize(1); assertEquals(1, theSelect.getOptions().size()); assertEquals("a", theSelect.getOption(0).getValueAttribute()); appendOption(theSelect, "x"); assertEquals(2, theSelect.getOptions().size()); assertEquals("x", theSelect.getOption(1).getValueAttribute()); } void appendOption(final HtmlSelect select, final String value) { final HtmlOption option = (HtmlOption) select.getPage().getWebClient().getPageCreator().getHtmlParser() .getFactory(HtmlOption.TAG_NAME).createElement(select.getPage(), HtmlOption.TAG_NAME, null); option.setValueAttribute(value); option.setLabelAttribute(value); select.appendOption(option); } /** * Test that asText() returns a blank string if nothing is selected. * * @exception Exception If the test fails */ @Test public void asTextWhenNothingSelected() throws Exception { final String htmlContent = "<html><head><title>foo</title></head><body>\n" + "<form>\n" + "<select name='select1' size='1' id='mySelect'>\n" + "</select>\n" + "</form></body></html>"; final HtmlPage page = loadPage(htmlContent); final HtmlSelect select = page.getHtmlElementById("mySelect"); assertEquals("", select.asText()); } /** * Verifies that asText() returns all options when multiple options are selectable, instead of just * the selected ones. * @throws Exception if an error occurs */ @Test public void asTextWithMultipleSelect() throws Exception { final String html = "<html><body><form>\n" + "<select name='a' multiple>\n" + "<option value='1'>foo</option>\n" + "<option value='2'>bar</option>\n" + "<option value='3'>baz</option>\n" + "</select>\n" + "</form></body></html>"; final HtmlPage page = loadPage(html); final HtmlSelect select = (HtmlSelect) page.getDocumentElement().getElementsByTagName("select").get(0); assertEquals("foo\nbar\nbaz", select.asText()); } /** * Test that setSelectedAttribute returns the right page. * * @exception Exception If the test fails */ @Test public void setSelectedAttributeReturnedPage() throws Exception { final String content = "<html><head><title>foo</title>\n" + "<script>\n" + "function test() {\n" + " document.getElementById('iframe').src = 'about:blank';\n" + "}\n" + "</script>\n" + "</head><body>\n" + "<form>\n" + "<select name='select1' size='1' id='mySelect' onchange='test()'>\n" + "<option value='option1'>option 1</option>\n" + "<option value='option2'>option 2</option>\n" + "</select>\n" + "</form>\n" + "<iframe id='iframe' src='about:blank'></iframe>\n" + "</body></html>"; final HtmlPage page = loadPage(content); final HtmlSelect select = page.getHtmlElementById("mySelect"); final HtmlOption option = select.getOptionByValue("option2"); final Page page2 = select.setSelectedAttribute(option, true); assertEquals(page, page2); } /** * @throws Exception if the test fails */ @Test public void onChangeResultPage() throws Exception { final String htmlContent = "<html><head><title>foo</title></head><body>\n" + "<form id='form1'>\n" + "<select name='select1' id='select1' onchange='location=\"about:blank\"'>\n" + " <option id='option1'>Option1</option>\n" + " <option id='option2' selected>Number Two</option>\n" + "</select>\n" + "</form></body></html>"; final HtmlPage page = loadPage(htmlContent); final HtmlOption option1 = page.getHtmlElementById("option1"); final HtmlPage page2 = option1.click(); assertEquals("about:blank", page2.getUrl()); } /** * @throws Exception if the test fails */ @Test public void onChange_resultPage_newCurrentWindow() throws Exception { final String htmlContent = "<html><head><title>foo</title></head><body>\n" + "<form id='form1'>\n" + "<select name='select1' id='select1' onchange='window.open(\"about:blank\", \"_blank\")'>\n" + " <option id='option1'>Option1</option>\n" + " <option id='option2' selected>Number Two</option>\n" + "</select>\n" + "</form></body></html>"; final HtmlPage page = loadPage(htmlContent); final HtmlSelect select = page.getHtmlElementById("select1"); final HtmlOption option1 = page.getHtmlElementById("option1"); final HtmlPage page2 = select.setSelectedAttribute(option1, true); assertEquals("about:blank", page2.getUrl()); } /** * @throws Exception if the test fails */ @Test public void asXml_size() throws Exception { final String content = "<html><head><title>foo</title></head>\n" + "<body>\n" + "<select/>\n" + "</body></html>"; final HtmlPage page = loadPage(content); assertEquals(-1, page.asXml().indexOf("size")); } /** * @throws Exception if the test fails */ @Test public void select_focus() throws Exception { final String htmlContent = "<html><head><title>foo</title></head><body>\n" + "<form id='form1'>\n" + "<select name='select1' id='select1' multiple onfocus='alert(\"focus\")'>\n" + "<option value='option1'>Option1</option>\n" + "<option value='option2'>Option2</option>\n" + "<option value='option3' selected>Option3</option>\n" + "</select>\n" + "<input type='submit' name='button' value='foo'/>\n" + "</form></body></html>"; final List<String> collectedAlerts = new ArrayList<>(); final HtmlPage page = loadPage(htmlContent, collectedAlerts); assertEquals(Collections.emptyList(), collectedAlerts); final HtmlSelect select = page.getHtmlElementById("select1"); assertNotSame(select, page.getFocusedElement()); select.getOption(0).setSelected(true); assertSame(select, page.getFocusedElement()); final String[] expectedAlerts = {"focus"}; assertEquals(expectedAlerts, collectedAlerts); } /** * @throws Exception if the test fails */ @Test public void getOptionByText() throws Exception { final String html = "<html><head><title>foo</title></head><body><form id='form1'>\n" + "<select name='select1'>\n" + " <option value='option1'>s1o1</option>\n" + " <option value='option2'>s1o2</option>\n" + "</select>\n" + "<select name='select2'>\n" + " <option value='option1'>s2o1</option>\n" + " <option value='option2'>s2o2</option>\n" + " <option>s2o3</option>\n" + "</select>\n" + "<input type='submit' name='button' value='foo'/>\n" + "</form></body></html>"; final HtmlPage page = loadPage(html); final HtmlForm form = page.getHtmlElementById("form1"); final HtmlSelect select = form.getSelectsByName("select2").get(0); assertEquals("s2o2", select.getOptionByText("s2o2").asText()); assertEquals(select.getOption(2), select.getOptionByText("s2o3")); } /** * @throws Exception if the test fails */ @Test public void savePageSavesSelectedOption() throws Exception { final String content = "<html><body>\n" + "<form action=''>\n" + " <select id='main'>\n" + " <option value='1'>option 1</option>\n" + " <option value='2'>option 2</option>\n" + " <option value='3' selected>option 3</option>\n" + " </select>\n" + "</form>\n" + "<script>\n" + "var oSelect = document.getElementById('main');\n" + "oSelect.options[1].selected = true;\n" + "alert(oSelect.options[1].getAttribute('selected'));\n" + "</script>\n" + "</body></html>"; final HtmlPage page = loadPage(content); final HtmlSelect select = (HtmlSelect) page.getElementById("main"); assertEquals("option 2", select.getSelectedOptions().get(0).getText()); // save the file and reload it final File file = new File(tmpFolderProvider_.newFolder("tmp"), "test.html"); page.save(file); final String html2 = FileUtils.readFileToString(file, UTF_8); final HtmlPage page2 = loadPage(html2); final HtmlSelect select2 = (HtmlSelect) page2.getElementById("main"); assertEquals("option 2", select2.getSelectedOptions().get(0).getText()); } }
{ "pile_set_name": "Github" }
{ "version": 1, "defaultRegion": "us-west-2", "testCases": [ { "operationName": "ListRules", "input": {}, "errorExpectedFromService": false }, { "operationName": "DescribeRule", "input": { "Name": "fake-rule" }, "errorExpectedFromService": true } ] }
{ "pile_set_name": "Github" }
/* * An demo illustrating how to retrieve a URI from a secure HTTP server. * * Author: Roy Wood * Date: September 7, 1999 * Comments: This relies heavily on my MacSockets library. * This project is also set up so that it expects the OpenSSL source folder (0.9.4 as I write this) * to live in a folder called "OpenSSL-0.9.4" in this project's parent folder. For example: * * Macintosh HD: * Development: * OpenSSL-0.9.4: * (OpenSSL sources here) * OpenSSL Example: * (OpenSSL example junk here) * * * Also-- before attempting to compile this, make sure the aliases in "OpenSSL-0.9.4:include:openssl" * are installed! Use the AppleScript applet in the "openssl-0.9.4" folder to do this! */ /* modified to seed the PRNG */ /* modified to use CRandomizer for seeding */ // Include some funky libs I've developed over time #include "CPStringUtils.hpp" #include "ErrorHandling.hpp" #include "MacSocket.h" #include "Randomizer.h" // We use the OpenSSL implementation of SSL.... // This was a lot of work to finally get going, though you wouldn't know it by the results! #include <openssl/ssl.h> #include <openssl/err.h> #include <timer.h> // Let's try grabbing some data from here: #define kHTTPS_DNS "www.apache-ssl.org" #define kHTTPS_Port 443 #define kHTTPS_URI "/" // Forward-declare this OSErr MyMacSocket_IdleWaitCallback(void *inUserRefPtr); // My idle-wait callback. Doesn't do much, does it? Silly cooperative multitasking. OSErr MyMacSocket_IdleWaitCallback(void *inUserRefPtr) { #pragma unused(inUserRefPtr) EventRecord theEvent; ::EventAvail(everyEvent,&theEvent); CRandomizer *randomizer = (CRandomizer*)inUserRefPtr; if (randomizer) randomizer->PeriodicAction(); return(noErr); } // Finally! void main(void) { OSErr errCode; int theSocket = -1; int theTimeout = 30; SSL_CTX *ssl_ctx = nil; SSL *ssl = nil; char tempString[256]; UnsignedWide microTickCount; CRandomizer randomizer; printf("OpenSSL Demo by Roy Wood, [email protected]\n\n"); BailIfError(errCode = MacSocket_Startup()); // Create a socket-like object BailIfError(errCode = MacSocket_socket(&theSocket,false,theTimeout * 60,MyMacSocket_IdleWaitCallback,&randomizer)); // Set up the connect string and try to connect CopyCStrAndInsertCStrLongIntIntoCStr("%s:%ld",kHTTPS_DNS,kHTTPS_Port,tempString,sizeof(tempString)); printf("Connecting to %s....\n",tempString); BailIfError(errCode = MacSocket_connect(theSocket,tempString)); // Init SSL stuff SSL_load_error_strings(); SSLeay_add_ssl_algorithms(); // Pick the SSL method // ssl_ctx = SSL_CTX_new(SSLv2_client_method()); ssl_ctx = SSL_CTX_new(SSLv23_client_method()); // ssl_ctx = SSL_CTX_new(SSLv3_client_method()); // Create an SSL thingey and try to negotiate the connection ssl = SSL_new(ssl_ctx); SSL_set_fd(ssl,theSocket); errCode = SSL_connect(ssl); if (errCode < 0) { SetErrorMessageAndLongIntAndBail("OpenSSL: Can't initiate SSL connection, SSL_connect() = ",errCode); } // Request the URI from the host CopyCStrToCStr("GET ",tempString,sizeof(tempString)); ConcatCStrToCStr(kHTTPS_URI,tempString,sizeof(tempString)); ConcatCStrToCStr(" HTTP/1.0\r\n\r\n",tempString,sizeof(tempString)); errCode = SSL_write(ssl,tempString,CStrLength(tempString)); if (errCode < 0) { SetErrorMessageAndLongIntAndBail("OpenSSL: Error writing data via ssl, SSL_write() = ",errCode); } for (;;) { char tempString[256]; int bytesRead; // Read some bytes and dump them to the console bytesRead = SSL_read(ssl,tempString,sizeof(tempString) - 1); if (bytesRead == 0 && MacSocket_RemoteEndIsClosing(theSocket)) { break; } else if (bytesRead < 0) { SetErrorMessageAndLongIntAndBail("OpenSSL: Error reading data via ssl, SSL_read() = ",bytesRead); } tempString[bytesRead] = '\0'; printf("%s", tempString); } printf("\n\n\n"); // All done! errCode = noErr; EXITPOINT: // Clean up and go home if (theSocket >= 0) { MacSocket_close(theSocket); } if (ssl != nil) { SSL_free(ssl); } if (ssl_ctx != nil) { SSL_CTX_free(ssl_ctx); } if (errCode != noErr) { printf("An error occurred:\n"); printf("%s",GetErrorMessage()); } MacSocket_Shutdown(); }
{ "pile_set_name": "Github" }
Title: Skype for Linux 2.1 Beta 发布 Date: 2009-08-28 09:03 Author: toy Category: Apps Tags: IM, Skype Slug: skype-for-linux-21-beta-released 今天,Skype 针对 Linux 平台发布了 2.1 的 Beta 测试版本。Skype for Linux 2.1 Beta 的确切版本号为 2.1.0.47,历经近两年的开发,包含一些显著的改进和增强。 ![Skype](http://i.linuxtoy.org/i/2007/11/skypelinux-video.png) Skype 2.1 Beta 具有高质量的视频支持,加入了 Skype 的 SILK 音频编/解码器,支持 PulseAudio,能够发送短消息,可以对聊天消息进行编辑/移除操作,支持联系人分组,在聊天时有输入通知,等等。 更多信息,可以参阅其[发布注记](https://developer.skype.com/LinuxSkype/ReleaseNotes)。Skype 2.1 Beta 可从[这里下载](http://www.skype.com/download/skype/linux/choose/)。
{ "pile_set_name": "Github" }
[DefCore] id=Landscape_Cave Version=8,0 Category=C4D_StaticBack Width=1 Height=1 Offset=-1,-1 HideInCreator=true
{ "pile_set_name": "Github" }
#ifndef WebCore_FWD_StringHashFunctions_h #define WebCore_FWD_StringHashFunctions_h #include <JavaScriptCore/StringHashFunctions.h> #endif
{ "pile_set_name": "Github" }
fileFormatVersion: 2 guid: 2a99b40dad064a34095e6bd6894c77c8 timeCreated: 1441992101 licenseType: Pro TextureImporter: fileIDToRecycleName: {} serializedVersion: 2 mipmaps: mipMapMode: 0 enableMipMap: 0 linearTexture: 0 correctGamma: 0 fadeOut: 0 borderMipMap: 0 mipMapFadeDistanceStart: 1 mipMapFadeDistanceEnd: 3 bumpmap: convertToNormalMap: 0 externalNormalMap: 0 heightScale: .25 normalMapFilter: 0 isReadable: 0 grayScaleToAlpha: 0 generateCubemap: 0 cubemapConvolution: 0 cubemapConvolutionSteps: 8 cubemapConvolutionExponent: 1.5 seamlessCubemap: 0 textureFormat: -1 maxTextureSize: 2048 textureSettings: filterMode: -1 aniso: -1 mipBias: -1 wrapMode: 1 nPOTScale: 0 lightmap: 0 rGBM: 0 compressionQuality: 50 allowsAlphaSplitting: 0 spriteMode: 1 spriteExtrude: 1 spriteMeshType: 1 alignment: 0 spritePivot: {x: .5, y: .5} spriteBorder: {x: 0, y: 0, z: 0, w: 0} spritePixelsToUnits: 100 alphaIsTransparency: 1 textureType: 8 buildTargetSettings: [] spriteSheet: sprites: [] spritePackingTag: userData: assetBundleName: assetBundleVariant:
{ "pile_set_name": "Github" }
<UserControl x:Class="TextAdventures.Quest.EditorControls.CompassDirectionControl" xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" xmlns:d="http://schemas.microsoft.com/expression/blend/2008" mc:Ignorable="d" d:DesignHeight="300" d:DesignWidth="300"> <Grid> <Border Margin="10" BorderThickness="1" CornerRadius="0" SnapsToDevicePixels="True" x:Name="border"> <Grid> <Grid.RowDefinitions> <RowDefinition Height="Auto" /> <RowDefinition/> </Grid.RowDefinitions> <TextBlock Margin="5" HorizontalAlignment="Center" FontSize="18" Name="direction">Dir</TextBlock> <TextBlock Visibility="Collapsed" Grid.Row="1" Margin="5" HorizontalAlignment="Center" Name="noLinkDestination">(none)</TextBlock> <TextBlock Grid.Row="1" Margin="5" HorizontalAlignment="Center" VerticalAlignment="Center" Name="destination" TextWrapping="Wrap" TextTrimming="WordEllipsis"><Hyperlink Name="destinationLink" Click="Hyperlink_Click">destination</Hyperlink></TextBlock> </Grid> </Border> </Grid> </UserControl>
{ "pile_set_name": "Github" }
#!/usr/bin/env python # -*- coding: utf-8 -*- # Copyright 2017 [email protected] # Licensed under the MIT license (http://opensource.org/licenses/MIT) import struct from hexdump import hexdump from keyplus.layout.parser_info import KeyplusParserInfo from keyplus.exceptions import * import re import keyplus.keycodes as keycodes from keyplus.keycodes import * class EKCData(object): def __init__(self, data=None, addr=None): self.data = data self.addr = addr def set_keycode_map_function(self, kc_map_function): self.kc_map_function = kc_map_function def size(self): return len(self.data) # def to_bytes(self): # return bytearray(self.data) # def parse_json(self): # pass class EKCMouseGestureKey(EKCData): # Data: { # 0x00: KC_MOUSE_GESTURE # 0x02: threshold # 0x04: threshold_diag # 0x06: threshold_tap # 0x08: keycode left # 0x0A: keycode right # 0x0C: keycode up # 0x0E: keycode down # 0x10: keycode up_left # 0x12: keycode up_right # 0x14: keycode down_left # 0x16: keycode down_right # 0x18: keycode tap # } SIZE = 13*2 # Threshold for Horizontal and Vertical mouse gestures GESTURE_THRESHOLD = 110 # Threshold for Diagonal mouse gestures GESTURE_THRESHOLD_DIAG = 60 # Threshold for tap mouse gesture. The mouse has to move less than this # amount in both the X and Y axes to trigger a tap gesture. GESTURE_THRESHOLD_TAP = 20 def __init__(self): self.threshold = EKCMouseGestureKey.GESTURE_THRESHOLD self.threshold_diag = EKCMouseGestureKey.GESTURE_THRESHOLD_DIAG self.threshold_tap = EKCMouseGestureKey.GESTURE_THRESHOLD_TAP self.kc_left = None self.kc_right = None self.kc_up = None self.kc_down = None self.kc_up_left = None self.kc_up_right = None self.kc_down_left = None self.kc_down_right = None self.kc_tap = None def size(self): return self.SIZE def to_bytes(self): result = bytearray(self.SIZE) struct.pack_into("< 13H", result, 0, keycodes.KC_MOUSE_GESTURE, self.threshold, self.threshold_diag, self.threshold_tap, self.kc_map_function(self.kc_left), self.kc_map_function(self.kc_right), self.kc_map_function(self.kc_up), self.kc_map_function(self.kc_down), self.kc_map_function(self.kc_up_left), self.kc_map_function(self.kc_up_right), self.kc_map_function(self.kc_down_left), self.kc_map_function(self.kc_down_right), self.kc_map_function(self.kc_tap), ) return result def parse_json(self, kc_name, json_obj=None, parser_info=None): print_warnings = False if parser_info == None: assert(json_obj != None) print_warnings = True parser_info = KeyplusParserInfo( "<EKCMouseGestureKey Dict>", {kc_name : json_obj} ) parser_info.enter(kc_name) # Get the tap key field self.keycode = parser_info.try_get( 'keycode', field_type=str ) assert_equal(self.keycode, 'mouse_gesture') # Get movement thresholds for gestures self.threshold = parser_info.try_get( 'threshold', field_type=int, default=EKCMouseGestureKey.GESTURE_THRESHOLD ) self.threshold_diag = parser_info.try_get( 'threshold_diag', field_type=int, default=EKCMouseGestureKey.GESTURE_THRESHOLD_DIAG ) self.threshold_tap = parser_info.try_get( 'threshold_tap', field_type=int, default=EKCMouseGestureKey.GESTURE_THRESHOLD_TAP ) # Get the keycodes for different directions field self.kc_left = parser_info.try_get('left' , default='none') self.kc_right = parser_info.try_get('right', default='none') self.kc_up = parser_info.try_get('up' , default='none') self.kc_down = parser_info.try_get('down' , default='none') self.kc_up_left = parser_info.try_get('up_left' , default='none') self.kc_up_right = parser_info.try_get('up_right' , default='none') self.kc_down_left = parser_info.try_get('down_left' , default='none') self.kc_down_right = parser_info.try_get('down_right', default='none') self.kc_tap = parser_info.try_get('tap', default='none') # Finish parsing `device_name` parser_info.exit() # If this is debug code, print the warnings if print_warnings: for warn in parser_info.warnings: print(warn, file=sys.stderr) class EKCHoldKey(EKCData): # Layout option: # 1: kc_hold_key # 1: delay # 1: option_data # 1: hold_key # 1: tap_key SIZE = 5 * 2 DEFAULT_DELAY = 200 DEFAULT_ACTIVATE_TYPE = 'delay' HOLD_KEY_ACTIVATE_DELAY = (1 << 0) HOLD_KEY_ACTIVATE_OTHER_KEY = (1 << 1) ACTIVATE_TYPE_MAP = { 'delay': (1 << 0), 'other_key': (1 << 1), } def __init__(self, tap_key=None, hold_key=None, delay=200, activate_type=None, kc_map_function=None): self.tap_key = tap_key self.hold_key = hold_key self.delay = delay self.kc_map_function = kc_map_function self.activate_type = activate_type or EKCHoldKey.DEFAULT_ACTIVATE_TYPE def size(self): return self.SIZE def check_activate_type_valid(self, type_): if type_ not in EKCHoldKey.ACTIVATE_TYPE_MAP: raise KeyplusSettingsError( "Unknown 'activate_type', got '{}', but expected one of: {}" .format( self.activate_type, list(EKCHoldKey.ACTIVATE_TYPE_MAP.keys()) ) ) def to_bytes(self): result = bytearray(self.SIZE) option_data = 0 self.check_activate_type_valid(self.activate_type) option_data |= EKCHoldKey.ACTIVATE_TYPE_MAP[self.activate_type] # _16(KC_HOLD_KEY), \ # _16(200), \ # _16(0), \ # _16(KC_STICKY_LSHIFT), \ # _16(KC_ENT), struct.pack_into("< 5H", result, 0, keycodes.KC_HOLD_KEY, self.delay, option_data, self.kc_map_function(self.hold_key), self.kc_map_function(self.tap_key) ) return result def parse_json(self, kc_name, json_obj=None, parser_info=None): print_warnings = False if parser_info == None: assert(json_obj != None) print_warnings = True parser_info = KeyplusParserInfo( "<EKCHoldKeycode Dict>", {kc_name : json_obj} ) parser_info.enter(kc_name) # Get the tap key field self.keycode = parser_info.try_get( 'keycode', field_type=str ) assert_equal(self.keycode, 'hold') # Get the hold key field self.hold_key = parser_info.try_get('hold_key') # Get the tap key field self.tap_key = parser_info.try_get('tap_key') # Get the delay key field self.delay = parser_info.try_get( 'delay', field_type=int, default=EKCHoldKey.DEFAULT_DELAY ) # Get the delay key field self.activate_type = parser_info.try_get( 'activate_type', field_type=str, field_valid_values=EKCHoldKey.ACTIVATE_TYPE_MAP.keys(), default=EKCHoldKey.DEFAULT_ACTIVATE_TYPE, ) # Finish parsing `device_name` parser_info.exit() # If this is debug code, print the warnings if print_warnings: for warn in parser_info.warnings: print(warn, file=sys.stderr) UINT = 0 INT = 1 STR = 2 INT8 = 3 INT8_MAX = 0x7F INT8_MIN = -(0x7F+1) INT16_MAX = 0x7FFF INT16_MIN = -(0x7FFF+1) SPECIAL_CMD_REPEAT = 100 SPECIAL_CMD_REPEAT_END = 101 class EKCMacroKey(EKCData): # Data: { # 0x00: KC_MACRO # 0x02: n:offset to release program address # 0x02..0x02+n-1: macro press program # 0x02+n..: macro release program # } KEYCODE_TYPE = 'macro' def __init__(self): self._commands_press = [] self._commands_release = [] self._repeat_addresses = [] self._macro_regexes = [ (re.compile("macro_finish\(\)") , MACRO_CMD_FINISH , () ), (re.compile("set_rate\((\d+)\)") , MACRO_CMD_SET_RATE , (UINT,) ), (re.compile("set_clear_rate\((\d+)\)") , MACRO_CMD_SET_CLEAR_RATE , (UINT,) ), (re.compile("press\(([^)]+)\)") , MACRO_CMD_PRESS , (STR,) ), (re.compile("release\(([^)]+)\)") , MACRO_CMD_RELEASE , (STR,) ), (re.compile("clear_keyboard\(\)") , MACRO_CMD_CLEAR_KEYBOARD , () ), (re.compile("clear_mouse\(\)") , MACRO_CMD_CLEAR_MOUSE , () ), (re.compile("macro_repeat\((\d+)\)") , MACRO_CMD_REPEAT_BLOCK , (UINT,) ), (re.compile("macro_jmp\((-?\d+)\)") , MACRO_CMD_REPEAT_JMP , (INT,) ), (re.compile("repeat\((\d+)\)") , MACRO_CMD_REPEAT_BLOCK , SPECIAL_CMD_REPEAT ), (re.compile("end_repeat\(\)") , MACRO_CMD_REPEAT_JMP , SPECIAL_CMD_REPEAT_END ), (re.compile("move_mouse\(([^)]*)\)") , MACRO_CMD_MOUSE_MOVE , (INT, INT) ), (re.compile("scroll_mouse\(([^)]*)\)") , MACRO_CMD_MOUSE_WHEEL , (INT8, INT8) ), ] self._binary_form = bytearray() self._dirty = False def _push_repeat_address(self): self._repeat_addresses.append(self._current_addr) def _pop_repeat_address(self): return self._repeat_addresses.pop() def size(self): if self._dirty: return len(self.to_bytes()) else: return len(self._binary_form) def parse_macro_command(self, command): if not isinstance(command, str): return None for cmd_info in self._macro_regexes: regex = cmd_info[0] match = regex.match(command) command_name = regex.pattern[:regex.pattern.find('\\')] + '()' if match: return (cmd_info[1], match.groups(), cmd_info[2], command_name) return None def compile_instruction(self, command, parser_info=None): if isinstance(command, list): return compile_command_list(command, parser_info) cmd_info = self.parse_macro_command(command) if not cmd_info: return None cmd = cmd_info[0] cmd_args = cmd_info[1] arg_type = cmd_info[2] command_name = cmd_info[3] result = bytearray() result += struct.pack("< H", cmd) def parse_int_arg(args, limit_lo=0, limit_hi=0xFFFF): result = [] for (i, int_str) in enumerate(args): try: arg = int(int_str) except: raise KeyplusParseError( "Expected integer at arg{} for macro command '{}', got: {}" .format( i, command_name, int_str, ) ) if not limit_lo <= arg <= limit_hi: raise KeyplusParseError( "For '{}' expected integer in range ({},{}), but got: {}".format( command_name, limit_lo, limit_hi, arg ) ) result.append(arg) return result def split_args(cmd_args, length): try: args = cmd_args[0].split(',') assert(len(args) == length) return args except: raise KeyplusParseError( "For '{}' expected two arguments, but got: {}".format( command_name, args ) ) if arg_type == (UINT,): # Macro command takes a single positive integer argument arg = parse_int_arg(cmd_args)[0] result += struct.pack("< H", arg) elif arg_type == (INT,): arg = parse_int_arg(cmd_args, INT16_MIN, INT16_MAX)[0] result += struct.pack("< h", arg) elif arg_type == (INT, INT): args = split_args(cmd_args, 2) args = parse_int_arg(args, INT16_MIN, INT16_MAX) result += struct.pack("< 2h", *args) elif arg_type == (INT8, INT8): args = split_args(cmd_args, 2) args = parse_int_arg(args, INT8_MIN, INT8_MAX) result += struct.pack("< 2b", *args) elif arg_type == (): # Macro command takes no arguments pass elif arg_type == (STR,): # Macro command a single keycode argument result += struct.pack("< H", self.kc_map_function(cmd_args[0])) elif arg_type == SPECIAL_CMD_REPEAT: int_arg = parse_int_arg(cmd_args)[0] result += struct.pack("< H", int_arg) self._push_repeat_address() elif arg_type == SPECIAL_CMD_REPEAT_END: last_repeat_addr = self._pop_repeat_address() jmp_offset = -(self._current_addr - last_repeat_addr) try: result += struct.pack("< h", jmp_offset) except: raise KeyplusParseError( "Macro repeat block too big. " "Max repeat block size is {} bytes, got {}.".format( 0x7FFF, -jmp_offset ) ) else: if parser_info: pass else: raise Exception("Unknown command" + str(cmd_info)) return result def compile_command_list(self, command_list, parser_info=None): result = bytearray() for cmd in command_list: cmd_data = self.compile_instruction(cmd, parser_info) if not cmd_data: cmd_data = struct.pack("< H", self.kc_map_function(cmd)) self._size_last_command = len(cmd_data) self._current_addr += len(cmd_data) result += cmd_data return result def compile_program(self, command_list, parser_info=None): self._current_addr = 0 return self.compile_command_list(command_list, parser_info) def to_bytes(self): if not self._dirty: return self._binary_form result = bytearray() result += struct.pack("< H", keycodes.KC_MACRO) press_program = self.compile_program(self._commands_press) press_program += struct.pack("< H", keycodes.MACRO_CMD_FINISH) release_program = self.compile_program(self._commands_release) release_program += struct.pack("< H", keycodes.MACRO_CMD_FINISH) # Add release program offset if len(self._commands_release) == 0: # 0 indicates no program to be run on key release result += struct.pack("< H", 0) else: offset = len(press_program) + 2 result += struct.pack("< H", offset) # Add the press program result += press_program # Add the release program if necessary if len(self._commands_release) > 0: result += release_program self._binary_form = result self._dirty = False return result def parse_json(self, kc_name, json_obj=None, parser_info=None): print_warnings = False if parser_info == None: assert(json_obj != None) print_warnings = True parser_info = KeyplusParserInfo( "<EKCMacroKey Dict>", {kc_name : json_obj} ) self._dirty = True self._kc_name = kc_name parser_info.enter(kc_name) # Get the tap key field self.keycode = parser_info.try_get('keycode', field_type=str) assert_equal(self.keycode, self.KEYCODE_TYPE) # Get movement thresholds for gestures self._commands_press = parser_info.try_get( 'commands', field_type=list, default=[] ) if self._commands_press == None: self._commands_press = [] # Get movement thresholds for gestures self._commands_release = parser_info.try_get( 'commands_release', field_type=list, default=[] ) if self._commands_release == None: self._commands_release = [] # Finish parsing `device_name` parser_info.exit() # If this is debug code, print the warnings if print_warnings: for warn in parser_info.warnings: print(warn, file=sys.stderr) # def __init__(self, macro_data): # ekc_format = bytearray() # for item in macro_data: # if type(item) == dict: # event_type = item[event] # elif type(item) == str: class EKCMacroRepeatKey(EKCData): pass class EKCDataTable(EKCData): # def __init__(self, children=[]): def __init__(self): self.children = [] self.children_addresses = [] self.current_size = 0 def add_child(self, child): child_id = len(self.children) self.children.append(child) self.children_addresses.append(self.current_size) child.addr = self.current_size self.current_size += child.size() return child_id def size(self): return self.current_size def to_bytes(self): total_size = self.size() if total_size > 0xFFFF: raise ValueError("EKC data section too large: {} bytes".format(total_size)) result = bytearray(0) # first byte is the total size of the data result += struct.pack('<H', total_size) # after append all the children for (i, child) in enumerate(self.children): result += child.to_bytes() return result pack = to_bytes EKCKeycodeTable = { 'hold': EKCHoldKey, 'mouse_gesture': EKCMouseGestureKey, 'macro': EKCMacroKey, } if __name__ == '__main__': ekc_data = EKCDataTable() ekc_data.add_child(EKCData([1,2,3])) sticky_ent = EKCHoldKey(keycodes.KC_ENTER, keycodes.KC_STICKY_LSHIFT) ekc_data.add_child(sticky_ent) hexdump(ekc_data.to_bytes())
{ "pile_set_name": "Github" }
/* Copyright (C) 2002 by Red Hat, Incorporated. All rights reserved. * * Permission to use, copy, modify, and distribute this software * is freely granted, provided that this notice is preserved. */ #include "fdlibm.h" #ifdef __STDC__ float fmaf(float x, float y, float z) #else float fmaf(x,y,z) float x; float y; float z; #endif { /* NOTE: The floating-point exception behavior of this is not as * required. But since the basic function is not really done properly, * it is not worth bothering to get the exceptions right, either. */ /* Let the implementation handle this. */ /* <= NONSENSE! */ /* In floating-point implementations in which double is larger than float, * computing as double should provide the desired function. Otherwise, * the behavior will not be as specified in the standards. */ return (float) (((double) x * (double) y) + (double) z); } #ifdef _DOUBLE_IS_32BITS #ifdef __STDC__ double fma(double x, double y, double z) #else double fma(x,y,z) double x; double y; double z; #endif { return (double) fmaf((float) x, (float) y, (float) z); } #endif /* defined(_DOUBLE_IS_32BITS) */
{ "pile_set_name": "Github" }
local token = vfs.Read("/home/caps/github_token") os.execute("tar --exclude=binaries_downloaded --exclude=al_config.ini --exclude=x64.tar.gz -zcvf x64.tar.gz ./*") http.Get("https://api.github.com/repos/CapsAdmin/goluwa/releases", function(data) for i,v in ipairs(serializer.Decode("json", data.content)) do if v.tag_name == "linux-binaries" then if v.assets and v.assets[1] then sockets.Request({ method = "DELETE", url = v.assets[1].url, username = "CapsAdmin", token = token, }) end local data = vfs.Read(e.ROOT_FOLDER .. "data/bin/linux_x64/x64.tar.gz") sockets.Request({ method = "POST", url = v.upload_url:match("(.+assets){").."?name=x64.tar.gz", post_data = data, username = "CapsAdmin", token = token, header = { ["Content-Type"] = "application/zip", ["Content-Length"] = #data, }, callback = table.print, }) end end end)
{ "pile_set_name": "Github" }
""" The Galaxy web application framework """ from .framework import url_for from .framework.base import httpexceptions from .framework.decorators import ( do_not_cache, error, expose, expose_api, expose_api_anonymous, expose_api_anonymous_and_sessionless, expose_api_raw, expose_api_raw_anonymous, expose_api_raw_anonymous_and_sessionless, format_return_as_json, json, json_pretty, legacy_expose_api, legacy_expose_api_anonymous, legacy_expose_api_raw, legacy_expose_api_raw_anonymous, require_admin, require_login, ) __all__ = ('FormBuilder', 'do_not_cache', 'error', 'expose', 'expose_api', 'expose_api_anonymous', 'expose_api_anonymous_and_sessionless', 'expose_api_raw', 'expose_api_raw_anonymous', 'expose_api_raw_anonymous_and_sessionless', 'form', 'format_return_as_json', 'httpexceptions', 'json', 'json_pretty', 'legacy_expose_api', 'legacy_expose_api_anonymous', 'legacy_expose_api_raw', 'legacy_expose_api_raw_anonymous', 'require_admin', 'require_login', 'url_for')
{ "pile_set_name": "Github" }
{ "methods": [ { "type": "Method", "parameter": [ { "types": [ "Function" ], "name": "fnc", "optional": false }, { "types": [ "String" ], "name": "cacheId", "optional": true }, { "types": [ "Number" ], "name": "delay", "optional": true }, { "types": [ "Object" ], "name": "scope", "optional": true }, { "types": [ "Array" ], "name": "parameters", "optional": true }, { "types": [ "String" ], "name": "strategy", "optional": true, "defaultValue": "loop", "description": "loop will trigger the function at least every delay, wait will clear the timeout" } ], "annotations": {}, "definedInFile": "js/core/Base.js", "lineNumbers": [ 84, 118 ], "description": "", "private": "", "definedBy": "js.core.Base", "name": "_debounceFunctionCall", "visibility": "protected" }, { "type": "Method", "parameter": [ { "name": "domEvent" } ], "annotations": {}, "definedInFile": "js/core/DomElement.js", "lineNumbers": [ 1029, 1034 ], "definedBy": "js.core.Base", "overwritesMethod": true, "name": "ctor", "visibility": "public" }, { "type": "Method", "parameter": [], "annotations": {}, "definedInFile": "js/core/Base.js", "lineNumbers": [ 41, 43 ], "description": "this is an empty function doing nothing. It can be used as fallback if a method requires a\ncallback function, which hasn't been passed.\n\n```\nfunction myFunction(callback) {\ncallback = callback || this.emptyCallback;\n}\n```\n", "returns": { "types": [ "Function" ], "description": "a function doing nothing" }, "definedBy": "js.core.Base", "name": "emptyCallback", "visibility": "public" }, { "type": "Method", "parameter": [ { "types": [ "String", "Array" ], "name": "message", "optional": false, "description": "the message to log" }, { "types": [ "String" ], "name": "level", "optional": true, "defaultValue": "\"info\"", "description": "the service level of (debug, info, warn, error)" } ], "annotations": {}, "definedInFile": "js/core/Base.js", "lineNumbers": [ 51, 72 ], "description": "logs messages to configured logging functions\n", "definedBy": "js.core.Base", "name": "log", "visibility": "public" }, { "type": "Method", "parameter": [], "annotations": {}, "definedInFile": "js/core/DomElement.js", "lineNumbers": [ 1046, 1056 ], "definedBy": "js.core.EventDispatcher.Event", "overwritesMethod": true, "name": "preventDefault", "visibility": "public" }, { "type": "Method", "parameter": [], "annotations": {}, "definedInFile": "js/core/Base.js", "lineNumbers": [ 25, 27 ], "description": "determinate if the application runs in the browser or on node\n", "returns": { "types": [ "Boolean" ], "description": "true if the application runs in a browser" }, "definedBy": "js.core.Base", "name": "runsInBrowser", "visibility": "public" }, { "type": "Method", "parameter": [], "annotations": {}, "definedInFile": "js/core/EventDispatcher.js", "lineNumbers": [ 262, 265 ], "definedBy": "js.core.EventDispatcher.Event", "name": "stopImmediatePropagation", "visibility": "public" }, { "type": "Method", "parameter": [], "annotations": {}, "definedInFile": "js/core/DomElement.js", "lineNumbers": [ 1035, 1045 ], "definedBy": "js.core.EventDispatcher.Event", "overwritesMethod": true, "name": "stopPropagation", "visibility": "public" }, { "type": "Method", "parameter": [ { "types": null, "name": "fnc", "optional": false, "description": "the function to synchronize" }, { "types": null, "name": "cacheId", "optional": false, "description": "the cacheId for the fnc call" }, { "types": null, "name": "callback", "optional": false, "description": "the callback to be called in the fnc" }, { "types": null, "name": "scope", "optional": false, "description": "the fnc scope" }, { "types": null, "name": "clear", "optional": false, "description": "if you want to clear the cache after all callbacks are called" } ], "annotations": {}, "definedInFile": "js/core/Base.js", "lineNumbers": [ 127, 167 ], "description": "", "definedBy": "js.core.Base", "name": "synchronizeFunctionCall", "visibility": "public" } ], "staticMethods": [], "defaults": {}, "properties": {}, "fqClassName": "js.core.DomElement.Event", "dependencies": [ "inherit", "js.core.Base", "js.core.Component", "js.core.Content", "js.core.EventDispatcher", "require", "underscore" ], "description": "", "inherit": "js.core.EventDispatcher.Event", "type": "js", "file": "js/core/DomElement.js", "package": "js.core", "inheritancePath": [ "js.core.EventDispatcher.Event", "js.core.Base" ] }
{ "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 CalDavSynchronizer.OAuth.Swisscom.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", "4.0.0.0")] [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()] internal 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)] internal static global::System.Resources.ResourceManager ResourceManager { get { if (object.ReferenceEquals(resourceMan, null)) { global::System.Resources.ResourceManager temp = new global::System.Resources.ResourceManager("CalDavSynchronizer.OAuth.Swisscom.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)] internal static global::System.Globalization.CultureInfo Culture { get { return resourceCulture; } set { resourceCulture = value; } } } }
{ "pile_set_name": "Github" }
# coding=UTF-8 import bluetooth ''' can't run in mac os Traceback (most recent call last): File "bluebug.py", line 6, in <module> phoneSock.connect((tgtPhone, port)) File "build/bdist.macosx-10.11-x86_64/egg/bluetooth/osx.py", line 119, in connect File "build/bdist.macosx-10.11-x86_64/egg/lightblue/_bluetoothsockets.py", line 351, in connect ValueError: depythonifying 'pointer', got 'tuple' ''' tgtPhone = '80:EA:96:8E:69:A7'#这个得改成你自己的 port = 17 phoneSock = bluetooth.BluetoothSocket(bluetooth.RFCOMM) phoneSock.connect((tgtPhone, port)) for contact in range(1, 5): atCmd = 'AT+CPBR=' + str(contact) + '\n' phoneSock.send(atCmd) result = phoneSock.recv(1024) print '[+] ' + str(contact) + ': ' + result phoneSock.close()
{ "pile_set_name": "Github" }
src/003_preg_match.php:13 PhanTypeMismatchArgumentInternal Argument 1 ($numerator) is $matches of type array{0:string} but \intdiv() takes int
{ "pile_set_name": "Github" }
<?xml version="1.0" encoding="utf-8"?> <ripple xmlns:android="http://schemas.android.com/apk/res/android" xmlns:tools="http://schemas.android.com/tools" tools:background="#FFFF00" android:color="?android:attr/colorAccent"> <item android:id="@android:id/mask"> <shape android:shape="rectangle"> <solid android:color="?android:attr/colorAccent" /> <corners android:radius="13dp" /> </shape> </item> <item android:id="@android:id/background"> <shape android:shape="rectangle"> <corners android:radius="16dp"/> <size android:height="32dp" android:width="32dp" /> <solid android:color="@color/md_black_1000"/> <stroke android:width="0.1dp" android:color="#EDEDED" /> </shape> </item> </ripple>
{ "pile_set_name": "Github" }
package com.ppdai.das.console.api.impl; import com.google.common.collect.Lists; import com.ppdai.das.console.common.utils.Transform; import com.ppdai.das.console.dto.entry.configCheck.ConfigDataResponse; import com.ppdai.das.console.dto.entry.configCheck.ItemResponse; import com.ppdai.das.console.dto.entry.configCheck.TitleResponse; import com.ppdai.das.console.dto.entry.das.DasGroup; import com.ppdai.das.console.dto.entry.das.DatabaseSet; import com.ppdai.das.console.dto.entry.das.DatabaseSetEntry; import com.ppdai.das.console.dto.entry.das.LoginUser; import com.ppdai.das.console.enums.StrategyTypeEnum; import com.ppdai.das.console.openapi.ConfigProvider; import com.ppdai.das.console.openapi.vo.DatabaseSetEntryVO; import com.ppdai.das.console.openapi.vo.DatabaseSetVO; import com.ppdai.das.console.api.DbSetConfiguration; import org.apache.commons.collections.ListUtils; import org.apache.commons.collections.MapUtils; import org.apache.commons.lang.StringUtils; import org.springframework.beans.factory.annotation.Autowired; import java.sql.SQLException; import java.util.List; import java.util.Map; public class DbSetManager implements DbSetConfiguration { @Autowired private Transform transform; @Autowired private ConfigProvider configProvider; @Override public void addDbSet(LoginUser user, DatabaseSet dbset) throws Exception { configProvider.addDataBaseSet(transform.toDatabaseSetVO(dbset)); } @Override public void updateDbSet(LoginUser user, DatabaseSet oldDbset, DatabaseSet newDbset) throws Exception { if (!oldDbset.getName().equals(newDbset.getName())) { configProvider.deleteDataBaseSet(oldDbset.getName()); configProvider.addDataBaseSet(transform.toDatabaseSetVO(newDbset)); } else { configProvider.updateDatabaseSet(transform.toDatabaseSetVO(newDbset)); } } @Override public void deleteDbSet(LoginUser user, DatabaseSet dbset) throws Exception { configProvider.deleteDataBaseSet(dbset.getName()); } @Override public void syncDbSet(LoginUser user, DatabaseSet dbset) throws Exception { configProvider.updateDatabaseSet(transform.toDatabaseSetVO(dbset)); } @Override public void addDbSetEntryList(LoginUser user, List<DatabaseSetEntry> dbsetEntryList) throws Exception { configProvider.addDatabaseSetEntries(transform.toDatabaseSetEntryVOList(dbsetEntryList)); } @Override public void updateDbSetEntry(LoginUser user, DatabaseSetEntry odlDbSetEntry, DatabaseSetEntry newDbSetEntry) throws Exception { if (!odlDbSetEntry.getName().equals(newDbSetEntry.getName())) { configProvider.deleteDatabaseSetEntry(odlDbSetEntry.getName()); configProvider.addDatabaseSetEntries(Lists.newArrayList(transform.toDatabaseSetEntryVO(newDbSetEntry))); } else { configProvider.updateDatabaseSetEntry(transform.toDatabaseSetEntryVO(newDbSetEntry)); } } @Override public void deleteDbSetEntry(LoginUser user, DatabaseSetEntry dbsetEntry) throws Exception { configProvider.deleteDatabaseSetEntry(dbsetEntry.getName()); } @Override public void syncDbsetEntry(LoginUser user, DatabaseSetEntry dbsetEntry) throws Exception { configProvider.updateDatabaseSetEntry(transform.toDatabaseSetEntryVO(dbsetEntry)); } @Override public List<ConfigDataResponse> getCheckData(LoginUser user, DatabaseSet dbset) throws Exception { DatabaseSetVO dasdatabaseSetVO = transform.toDatabaseSetVO(dbset); DatabaseSetVO condatabaseSetVO = configProvider.getDatabaseSet(dbset.getName()); if (null == condatabaseSetVO || StringUtils.isBlank(condatabaseSetVO.getDatabaseSetName())) { throw new Exception("数据错误,逻辑库信息为空!!!"); } if (dasdatabaseSetVO.getShardingStrategy().size() != condatabaseSetVO.getShardingStrategy().size()) { throw new Exception("数据错误,逻辑库策略信息与DAS不匹配!!!"); } List<TitleResponse> dastitles = Lists.newArrayList(new TitleResponse("DataBaseSet Name", dasdatabaseSetVO.getDatabaseSetName())); List<TitleResponse> contitles = Lists.newArrayList(new TitleResponse("DataBaseSet Name", condatabaseSetVO.getDatabaseSetName())); ConfigDataResponse das = new ConfigDataResponse("DAS", dastitles, toList(dbset)); ConfigDataResponse con = new ConfigDataResponse(configProvider.getConfigCenterName(), contitles, toList(condatabaseSetVO)); return Lists.newArrayList(das, con); } @Override public List<ConfigDataResponse> getCheckData(LoginUser user, DatabaseSetEntry dbsetEntry) throws Exception { DatabaseSetEntryVO dasdatabaseSetEntryVO = transform.toDatabaseSetEntryVO(dbsetEntry); DatabaseSetEntryVO condatabaseSetEntryVO = configProvider.getDatabaseSetEntry(dbsetEntry.getName()); if (null == condatabaseSetEntryVO || StringUtils.isBlank(condatabaseSetEntryVO.getDatabaseSetName()) || StringUtils.isBlank(condatabaseSetEntryVO.getDatabasesetEntryName())) { throw new Exception("数据错误,逻辑库映射信息为空!!!"); } List<TitleResponse> dastitles = Lists.newArrayList(new TitleResponse("DatabaseSetEntry Name", dasdatabaseSetEntryVO.getDatabasesetEntryName())); List<TitleResponse> contitles = Lists.newArrayList(new TitleResponse("DatabaseSetEntry Name", condatabaseSetEntryVO.getDatabasesetEntryName())); ConfigDataResponse das = new ConfigDataResponse("DAS", dastitles, toList(dbsetEntry)); ConfigDataResponse con = new ConfigDataResponse(configProvider.getConfigCenterName(), contitles, toList(condatabaseSetEntryVO)); return Lists.newArrayList(das, con); } @Override public List<ConfigDataResponse> getAllCheckData(LoginUser user, DasGroup dasGroup, DatabaseSet dbset) { return ListUtils.EMPTY_LIST; } private List<ItemResponse> toList(DatabaseSet dbset) { return toList(transform.toDatabaseSetVO(dbset)); } private List<ItemResponse> toList(DatabaseSetVO dbset) { List<ItemResponse> list = Lists.newArrayList( new ItemResponse("databaseSetName", dbset.getDatabaseSetName()), new ItemResponse("strategyType", dbset.getStrategyType().getDetail()), new ItemResponse("dataBaseType", dbset.getDataBaseType().getName()) ); if (MapUtils.isNotEmpty(dbset.getShardingStrategy())) { for (Map.Entry<String, String> entry : dbset.getShardingStrategy().entrySet()) { list.add(new ItemResponse(entry.getKey(), entry.getValue())); } } if (dbset.getStrategyType() != StrategyTypeEnum.NoStrategy) { list.add(new ItemResponse("StrategyClassName", dbset.getStrategyClassName())); } return list; } private List<ItemResponse> toList(DatabaseSetEntry dbsetEntry) throws SQLException { return toList(transform.toDatabaseSetEntryVO(dbsetEntry)); } private List<ItemResponse> toList(DatabaseSetEntryVO databaseSetEntryVO) { List<ItemResponse> list = Lists.newArrayList( new ItemResponse("databaseName", databaseSetEntryVO.getDatabaseName()), new ItemResponse("databasesetEntryName", databaseSetEntryVO.getDatabasesetEntryName()), new ItemResponse("databaseMasterSlaveType", databaseSetEntryVO.getDatabaseMasterSlaveType().getName()), new ItemResponse("sharding", databaseSetEntryVO.getSharding()) ); return list; } }
{ "pile_set_name": "Github" }
12 0 1 1 0 1 0 0 0 0 1 1 0 1 0 0 0 0 1 0 0 0 0 0 0 1 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 1 0 0 0 0 0 0 1 0 0 0 0 0 1 0 0 0 0 0 0 1 0 1 0 0 0 1 0 0 1 0 0 0 0 0 1 0 0 0 0 0 1 0 0 0 0 0 0 1 0 0 0 0 0 1 0 0 0 0 0 0 0 0 0 0 0 0 1 0 0 0 0 0 0 0 0 0 0 0 1 0 0 0 0 1 1 0 0 0 0 0 0 0 0 0 0 0 0 1 0 0 0 0
{ "pile_set_name": "Github" }
require 'test_helper' class UsersHelperTest < ActionView::TestCase end
{ "pile_set_name": "Github" }
"use strict"; module.exports = function(Promise, PromiseArray, tryConvertToPromise, INTERNAL, async, getDomain) { var util = require("./util"); var canEvaluate = util.canEvaluate; var tryCatch = util.tryCatch; var errorObj = util.errorObj; var reject; if (!false) { if (canEvaluate) { var thenCallback = function(i) { return new Function("value", "holder", " \n\ 'use strict'; \n\ holder.pIndex = value; \n\ holder.checkFulfillment(this); \n\ ".replace(/Index/g, i)); }; var promiseSetter = function(i) { return new Function("promise", "holder", " \n\ 'use strict'; \n\ holder.pIndex = promise; \n\ ".replace(/Index/g, i)); }; var generateHolderClass = function(total) { var props = new Array(total); for (var i = 0; i < props.length; ++i) { props[i] = "this.p" + (i+1); } var assignment = props.join(" = ") + " = null;"; var cancellationCode= "var promise;\n" + props.map(function(prop) { return " \n\ promise = " + prop + "; \n\ if (promise instanceof Promise) { \n\ promise.cancel(); \n\ } \n\ "; }).join("\n"); var passedArguments = props.join(", "); var name = "Holder$" + total; var code = "return function(tryCatch, errorObj, Promise, async) { \n\ 'use strict'; \n\ function [TheName](fn) { \n\ [TheProperties] \n\ this.fn = fn; \n\ this.asyncNeeded = true; \n\ this.now = 0; \n\ } \n\ \n\ [TheName].prototype._callFunction = function(promise) { \n\ promise._pushContext(); \n\ var ret = tryCatch(this.fn)([ThePassedArguments]); \n\ promise._popContext(); \n\ if (ret === errorObj) { \n\ promise._rejectCallback(ret.e, false); \n\ } else { \n\ promise._resolveCallback(ret); \n\ } \n\ }; \n\ \n\ [TheName].prototype.checkFulfillment = function(promise) { \n\ var now = ++this.now; \n\ if (now === [TheTotal]) { \n\ if (this.asyncNeeded) { \n\ async.invoke(this._callFunction, this, promise); \n\ } else { \n\ this._callFunction(promise); \n\ } \n\ \n\ } \n\ }; \n\ \n\ [TheName].prototype._resultCancelled = function() { \n\ [CancellationCode] \n\ }; \n\ \n\ return [TheName]; \n\ }(tryCatch, errorObj, Promise, async); \n\ "; code = code.replace(/\[TheName\]/g, name) .replace(/\[TheTotal\]/g, total) .replace(/\[ThePassedArguments\]/g, passedArguments) .replace(/\[TheProperties\]/g, assignment) .replace(/\[CancellationCode\]/g, cancellationCode); return new Function("tryCatch", "errorObj", "Promise", "async", code) (tryCatch, errorObj, Promise, async); }; var holderClasses = []; var thenCallbacks = []; var promiseSetters = []; for (var i = 0; i < 8; ++i) { holderClasses.push(generateHolderClass(i + 1)); thenCallbacks.push(thenCallback(i + 1)); promiseSetters.push(promiseSetter(i + 1)); } reject = function (reason) { this._reject(reason); }; }} Promise.join = function () { var last = arguments.length - 1; var fn; if (last > 0 && typeof arguments[last] === "function") { fn = arguments[last]; if (!false) { if (last <= 8 && canEvaluate) { var ret = new Promise(INTERNAL); ret._captureStackTrace(); var HolderClass = holderClasses[last - 1]; var holder = new HolderClass(fn); var callbacks = thenCallbacks; for (var i = 0; i < last; ++i) { var maybePromise = tryConvertToPromise(arguments[i], ret); if (maybePromise instanceof Promise) { maybePromise = maybePromise._target(); var bitField = maybePromise._bitField; ; if (((bitField & 50397184) === 0)) { maybePromise._then(callbacks[i], reject, undefined, ret, holder); promiseSetters[i](maybePromise, holder); holder.asyncNeeded = false; } else if (((bitField & 33554432) !== 0)) { callbacks[i].call(ret, maybePromise._value(), holder); } else if (((bitField & 16777216) !== 0)) { ret._reject(maybePromise._reason()); } else { ret._cancel(); } } else { callbacks[i].call(ret, maybePromise, holder); } } if (!ret._isFateSealed()) { if (holder.asyncNeeded) { var domain = getDomain(); if (domain !== null) { holder.fn = util.domainBind(domain, holder.fn); } } ret._setAsyncGuaranteed(); ret._setOnCancel(holder); } return ret; } } } var $_len = arguments.length;var args = new Array($_len); for(var $_i = 0; $_i < $_len; ++$_i) {args[$_i] = arguments[$_i];}; if (fn) args.pop(); var ret = new PromiseArray(args).promise(); return fn !== undefined ? ret.spread(fn) : ret; }; };
{ "pile_set_name": "Github" }
Add support for static only build This patch adds support for a BUILD_SHARED_LIB variable that allows to enable/disable the build of the shared library, in order to support static-only builds. Signed-off-by: Thomas Petazzoni <[email protected]> Index: b/Makefile =================================================================== --- a/Makefile +++ b/Makefile @@ -85,6 +85,9 @@ # Build and install static library BUILD_STATIC_LIB := 1 +# Build and install shared library +BUILD_SHARED_LIB := 1 + # Set these to add preprocessor or compiler flags, or use # environment variables # CFLAGS := Index: b/lib/Module.mk =================================================================== --- a/lib/Module.mk +++ b/lib/Module.mk @@ -43,8 +43,14 @@ LIBSTLIBNAME := libsensors.a LIBSHSONAME := libsensors.so.$(LIBMAINVER) +ifeq ($(BUILD_SHARED_LIB),1) LIBTARGETS := $(MODULE_DIR)/$(LIBSHLIBNAME) \ $(MODULE_DIR)/$(LIBSHSONAME) $(MODULE_DIR)/$(LIBSHBASENAME) +LIBDEP_FOR_PROGS := $(LIBSHBASENAME) +else +LIBDEP_FOR_PROGS := $(LIBSTLIBNAME) +endif + ifeq ($(BUILD_STATIC_LIB),1) LIBTARGETS += $(MODULE_DIR)/$(LIBSTLIBNAME) endif @@ -131,9 +137,11 @@ ifeq ($(BUILD_STATIC_LIB),1) $(INSTALL) -m 644 $(LIB_DIR)/$(LIBSTLIBNAME) $(DESTDIR)$(LIBDIR) endif +ifeq ($(BUILD_SHARED_LIB),1) $(INSTALL) -m 755 $(LIB_DIR)/$(LIBSHLIBNAME) $(DESTDIR)$(LIBDIR) $(LN) $(LIBSHLIBNAME) $(DESTDIR)$(LIBDIR)/$(LIBSHSONAME) $(LN) $(LIBSHSONAME) $(DESTDIR)$(LIBDIR)/$(LIBSHBASENAME) +endif @if [ -z "$(DESTDIR)" -a "$(LIBDIR)" != "/usr/lib" -a "$(LIBDIR)" != "/lib" ] ; then \ if [ -e "/usr/lib/$(LIBSHSONAME)" -o -e "/usr/lib/$(LIBSHBASENAME)" ] ; then \ echo '******************************************************************************' ; \ Index: b/prog/sensord/Module.mk =================================================================== --- a/prog/sensord/Module.mk +++ b/prog/sensord/Module.mk @@ -41,7 +41,7 @@ REMOVESENSORDBIN := $(patsubst $(MODULE_DIR)/%,$(DESTDIR)$(SBINDIR)/%,$(PROGSENSORDTARGETS)) REMOVESENSORDMAN := $(patsubst $(MODULE_DIR)/%,$(DESTDIR)$(PROGSENSORDMAN8DIR)/%,$(PROGSENSORDMAN8FILES)) -$(PROGSENSORDTARGETS): $(PROGSENSORDSOURCES:.c=.ro) lib/$(LIBSHBASENAME) +$(PROGSENSORDTARGETS): $(PROGSENSORDSOURCES:.c=.ro) lib/$(LIBDEP_FOR_PROGS) $(CC) $(EXLDFLAGS) -o $@ $(PROGSENSORDSOURCES:.c=.ro) -Llib -lsensors -lrrd all-prog-sensord: $(PROGSENSORDTARGETS) Index: b/prog/sensors/Module.mk =================================================================== --- a/prog/sensors/Module.mk +++ b/prog/sensors/Module.mk @@ -39,8 +39,8 @@ LIBICONV := $(shell if /sbin/ldconfig -p | grep -q '/libiconv\.so$$' ; then echo \-liconv; else echo; fi) -$(PROGSENSORSTARGETS): $(PROGSENSORSSOURCES:.c=.ro) lib/$(LIBSHBASENAME) - $(CC) $(EXLDFLAGS) -o $@ $(PROGSENSORSSOURCES:.c=.ro) $(LIBICONV) -Llib -lsensors +$(PROGSENSORSTARGETS): $(PROGSENSORSSOURCES:.c=.ro) lib/$(LIBDEP_FOR_PROGS) + $(CC) $(EXLDFLAGS) -o $@ $(PROGSENSORSSOURCES:.c=.ro) $(LIBICONV) -Llib -lsensors -lm all-prog-sensors: $(PROGSENSORSTARGETS) user :: all-prog-sensors
{ "pile_set_name": "Github" }
3039 House Kurita Mech - Assault special Hatamoto-Hi HTM-27U, 1 King Crab KGC-000, 2 Hatamoto-Kaze HTM-27V, 3 Highlander HGN-732, 4 Charger CGR-1A9, 5 Hatamoto-Chi HTM-27T, 6 Katana (Crockett) CRK-5003-2, 5 Hatamoto-Ku HTM-27W, 4 Thug THG-11E, 3 Hatamoto-Mizo HTM-27Y, 2 Mauler MAL-1R, 1 ##Version 1 - May 2011 ##From RUS Files ##Editted by Dave "Hammer" Nawton
{ "pile_set_name": "Github" }
/***************************************************************************/ /* */ /* pstypes.h */ /* */ /* Adobe's code for defining data types (specification only). */ /* */ /* Copyright 2011-2013 Adobe Systems Incorporated. */ /* */ /* This software, and all works of authorship, whether in source or */ /* object code form as indicated by the copyright notice(s) included */ /* herein (collectively, the "Work") is made available, and may only be */ /* used, modified, and distributed under the FreeType Project License, */ /* LICENSE.TXT. Additionally, subject to the terms and conditions of the */ /* FreeType Project License, each contributor to the Work hereby grants */ /* to any individual or legal entity exercising permissions granted by */ /* the FreeType Project License and this section (hereafter, "You" or */ /* "Your") a perpetual, worldwide, non-exclusive, no-charge, */ /* royalty-free, irrevocable (except as stated in this section) patent */ /* license to make, have made, use, offer to sell, sell, import, and */ /* otherwise transfer the Work, where such license applies only to those */ /* patent claims licensable by such contributor that are necessarily */ /* infringed by their contribution(s) alone or by combination of their */ /* contribution(s) with the Work to which such contribution(s) was */ /* submitted. If You institute patent litigation against any entity */ /* (including a cross-claim or counterclaim in a lawsuit) alleging that */ /* the Work or a contribution incorporated within the Work constitutes */ /* direct or contributory patent infringement, then any patent licenses */ /* granted to You under this License for that Work shall terminate as of */ /* the date such litigation is filed. */ /* */ /* By using, modifying, or distributing the Work you indicate that you */ /* have read and understood the terms and conditions of the */ /* FreeType Project License as well as those provided in this section, */ /* and you accept them fully. */ /* */ /***************************************************************************/ #ifndef PSTYPES_H_ #define PSTYPES_H_ #include <ft2build.h> #include FT_FREETYPE_H FT_BEGIN_HEADER /* * The data models that we expect to support are as follows: * * name char short int long long-long pointer example * ----------------------------------------------------- * ILP32 8 16 32 32 64* 32 32-bit MacOS, x86 * LLP64 8 16 32 32 64 64 x64 * LP64 8 16 32 64 64 64 64-bit MacOS * * *) type may be supported by emulation on a 32-bit architecture * */ /* integers at least 32 bits wide */ #define CF2_UInt FT_UFast #define CF2_Int FT_Fast /* fixed-float numbers */ typedef FT_Int32 CF2_F16Dot16; FT_END_HEADER #endif /* PSTYPES_H_ */ /* END */
{ "pile_set_name": "Github" }
const GLib = imports.gi.GLib; const Gio = imports.gi.Gio; const FileQueryInfoFlags = imports.gi.Gio.FileQueryInfoFlags; const FileCopyFlags = imports.gi.Gio.FileCopyFlags; const FileTest = GLib.FileTest; const ExtensionUtils = imports.misc.extensionUtils; const Me = ExtensionUtils.getCurrentExtension(); const Prefs = Me.imports.prefs; const SettingsSchema = Prefs.SettingsSchema; const REGISTRY_DIR = GLib.get_user_cache_dir() + '/' + Me.uuid; const REGISTRY_FILE = 'registry.txt'; const REGISTRY_PATH = REGISTRY_DIR + '/' + REGISTRY_FILE; const BACKUP_REGISTRY_PATH = REGISTRY_PATH + '~'; // Print objects... why no dev tools function prettyPrint (name, obj, recurse, _indent) { let prefix = ''; let indent = typeof _indent === 'number' ? _indent : 0; for (let i = 0; i < indent; i++) { prefix += ' '; } recurse = typeof recurse === 'boolean' ? recurse : true; if (typeof name !== 'string') { obj = arguments[0]; recurse = arguments[1]; _indent = arguments[2]; name = obj.toString(); } log(prefix + '--------------'); log(prefix + name); log(prefix + '--------------'); for (let k in obj) { if (typeof obj[k] === 'object' && recurse) { prettyPrint(name + '::' + k, obj[k], true, indent + 1); } else { log(prefix + k, typeof obj[k] === 'function' ? '[Func]' : obj[k]); } } } // I/O Files function writeRegistry (registry) { let json = JSON.stringify(registry); let contents = new GLib.Bytes(json); // Make sure dir exists GLib.mkdir_with_parents(REGISTRY_DIR, parseInt('0775', 8)); // Write contents to file asynchronously let file = Gio.file_new_for_path(REGISTRY_PATH); file.replace_async(null, false, Gio.FileCreateFlags.NONE, GLib.PRIORITY_DEFAULT, null, function (obj, res) { let stream = obj.replace_finish(res); stream.write_bytes_async(contents, GLib.PRIORITY_DEFAULT, null, function (w_obj, w_res) { w_obj.write_bytes_finish(w_res); stream.close(null); }); }); } function readRegistry (callback) { if (typeof callback !== 'function') throw TypeError('`callback` must be a function'); if (GLib.file_test(REGISTRY_PATH, FileTest.EXISTS)) { let file = Gio.file_new_for_path(REGISTRY_PATH); let CACHE_FILE_SIZE = SettingsSchema.get_int(Prefs.Fields.CACHE_FILE_SIZE); file.query_info_async('*', FileQueryInfoFlags.NONE, GLib.PRIORITY_DEFAULT, null, function (src, res) { // Check if file size is larger than CACHE_FILE_SIZE // If so, make a backup of file, and invoke callback with empty array let file_info = src.query_info_finish(res); if (file_info.get_size() >= CACHE_FILE_SIZE * 1024) { let destination = Gio.file_new_for_path(BACKUP_REGISTRY_PATH); file.move(destination, FileCopyFlags.OVERWRITE, null, null); callback([]); return; } file.load_contents_async(null, function (obj, res) { let registry; let [success, contents] = obj.load_contents_finish(res); if (success) { try { let max_size = SettingsSchema.get_int(Prefs.Fields.HISTORY_SIZE); // are we running gnome 3.30 or higher? if (contents instanceof Uint8Array) { contents = imports.byteArray.toString(contents); } registry = JSON.parse(contents); let registryNoFavorite = registry.filter( item => item['favorite'] === false); while (registryNoFavorite.length > max_size) { let oldestNoFavorite = registryNoFavorite.shift(); let itemIdx = registry.indexOf(oldestNoFavorite); registry.splice(itemIdx,1); registryNoFavorite = registry.filter( item => item["favorite"] === false); } } catch (e) { registry = []; } } else { registry = []; } callback(registry); }); }); } else { callback([]); } }
{ "pile_set_name": "Github" }
AircraftLanding AircraftTakingOff2 BeachByDrone BirdCloseup Blossom BrowsingPhone Cat Chickens CloudsTimelapse Clownfishes CoupleWalking CranerCurves Cruise Deers DieselTrain DogChewingTennis Dolphin DrivingCar Elephant FatherAndChild1 FlyingKite FlyingOverForest FlyOverHouses Football Freeway1 FrozenLeaves1 FrozenLeaves2 GannetFlying2 Gherkin GirlOnPhone GirlOnShoulder GreenTurtle HandOverGrass IceSkating IndonesianFarmland ItalianStreet Kittens LadyOverlooking Lemurs LondonDocklands LondonNightTraffic Marathon Monkeys MotherAndSon Motocross MotorTricks NightStreet Pigeons Promenade RicePaddies RoadAndCars SanFrancisco Setangibeach SkateboardingInRoad Skateboarding SlamDunk SpaceShuttle Squirrel Sunflowers SurferRunning Swans SwimmerEmerging TajMahal TimeSquare Toddler Tombstone TouristBoat TrainStation USAFlagFlying UsingSmartphone VRHeadset WalkingInSurf Wallride WatchingWaterfall Waterfall1 WestminsterBridge WindTurbines WomanUsingPhone WomanWorking YogaHut1
{ "pile_set_name": "Github" }