text
stringlengths
2
99k
meta
dict
<?xml version="1.0" encoding="UTF-8"?> <document type="com.apple.InterfaceBuilder3.CocoaTouch.Storyboard.XIB" version="3.0" toolsVersion="11762" systemVersion="16E195" targetRuntime="iOS.CocoaTouch" propertyAccessControl="none" useAutolayout="YES" launchScreen="YES" useTraitCollections="YES" colorMatched="YES" initialViewController="01J-lp-oVM"> <device id="retina4_7" orientation="portrait"> <adaptation id="fullscreen"/> </device> <dependencies> <deployment identifier="iOS"/> <plugIn identifier="com.apple.InterfaceBuilder.IBCocoaTouchPlugin" version="11757"/> <capability name="documents saved in the Xcode 8 format" minToolsVersion="8.0"/> </dependencies> <scenes> <!--View Controller--> <scene sceneID="EHf-IW-A2E"> <objects> <viewController id="01J-lp-oVM" sceneMemberID="viewController"> <layoutGuides> <viewControllerLayoutGuide type="top" id="Llm-lL-Icb"/> <viewControllerLayoutGuide type="bottom" id="xb3-aO-Qok"/> </layoutGuides> <view key="view" contentMode="scaleToFill" id="Ze5-6b-2t3"> <rect key="frame" x="0.0" y="0.0" width="375" height="667"/> <autoresizingMask key="autoresizingMask" widthSizable="YES" heightSizable="YES"/> <subviews> <imageView userInteractionEnabled="NO" contentMode="scaleAspectFit" horizontalHuggingPriority="251" verticalHuggingPriority="251" image="Default-568.png" translatesAutoresizingMaskIntoConstraints="NO" id="d24-uc-Ffb"> <rect key="frame" x="0.0" y="0.0" width="375" height="667"/> </imageView> </subviews> <color key="backgroundColor" red="1" green="1" blue="1" alpha="1" colorSpace="custom" customColorSpace="sRGB"/> <constraints> <constraint firstItem="d24-uc-Ffb" firstAttribute="leading" secondItem="Ze5-6b-2t3" secondAttribute="leading" id="Wm8-e0-7w6"/> <constraint firstItem="d24-uc-Ffb" firstAttribute="top" secondItem="Ze5-6b-2t3" secondAttribute="top" id="h1w-qY-oJ5"/> <constraint firstAttribute="trailing" secondItem="d24-uc-Ffb" secondAttribute="trailing" id="l42-mL-RgE"/> <constraint firstItem="d24-uc-Ffb" firstAttribute="bottom" secondItem="xb3-aO-Qok" secondAttribute="top" id="tA3-1I-UsG"/> </constraints> </view> </viewController> <placeholder placeholderIdentifier="IBFirstResponder" id="iYj-Kq-Ea1" userLabel="First Responder" sceneMemberID="firstResponder"/> </objects> <point key="canvasLocation" x="52" y="374.66266866566718"/> </scene> </scenes> <resources> <image name="Default-568.png" width="1242" height="2208"/> </resources> </document>
{ "pile_set_name": "Github" }
require('../../modules/es6.reflect.own-keys'); module.exports = require('../../modules/$.core').Reflect.ownKeys;
{ "pile_set_name": "Github" }
/* * Copyright 2000-2018 JetBrains s.r.o. and Kotlin Programming Language contributors. * Use of this source code is governed by the Apache 2.0 license that can be found in the license/LICENSE.txt file. */ package org.jetbrains.kotlin.idea.caches.resolve import com.intellij.openapi.project.Project import com.intellij.psi.PsiClass import com.intellij.psi.PsiManager import org.jetbrains.kotlin.asJava.KotlinAsJavaSupport import org.jetbrains.kotlin.asJava.classes.KtLightClassForFacade import org.jetbrains.kotlin.asJava.toLightClass import org.jetbrains.kotlin.fileClasses.JvmFileClassUtil import org.jetbrains.kotlin.fileClasses.javaFileFacadeFqName import org.jetbrains.kotlin.idea.caches.project.getModuleInfo import org.jetbrains.kotlin.idea.caches.resolve.util.isInDumbMode import org.jetbrains.kotlin.psi.KtClassOrObject import org.jetbrains.kotlin.psi.KtFile import org.jetbrains.kotlin.psi.KtFileClassProvider import org.jetbrains.kotlin.psi.analysisContext import org.jetbrains.kotlin.platform.jvm.isJvm import org.jetbrains.kotlin.scripting.definitions.runReadAction class KtFileClassProviderImpl(val project: Project) : KtFileClassProvider { override fun getFileClasses(file: KtFile): Array<PsiClass> { if (file.project.isInDumbMode()) { return PsiClass.EMPTY_ARRAY } // TODO We don't currently support finding light classes for scripts if (file.isCompiled || runReadAction { file.isScript() }) { return PsiClass.EMPTY_ARRAY } val result = arrayListOf<PsiClass>() file.declarations.filterIsInstance<KtClassOrObject>().map { it.toLightClass() }.filterNotNullTo(result) val moduleInfo = file.getModuleInfo() // prohibit obtaining light classes for non-jvm modules trough KtFiles // common files might be in fact compiled to jvm and thus correspond to a PsiClass // this API does not provide context (like GSS) to be able to determine if this file is in fact seen through a jvm module // this also fixes a problem where a Java JUnit run configuration producer would produce run configurations for a common file if (!moduleInfo.platform.isJvm()) return emptyArray() val jvmClassInfo = JvmFileClassUtil.getFileClassInfoNoResolve(file) val fileClassFqName = file.javaFileFacadeFqName val kotlinAsJavaSupport = KotlinAsJavaSupport.getInstance(project) val facadeClasses = when { file.analysisContext != null && file.hasTopLevelCallables() -> listOf( KtLightClassForFacade.createForSyntheticFile( PsiManager.getInstance( file.project ), fileClassFqName, file ) ) jvmClassInfo.withJvmMultifileClass -> kotlinAsJavaSupport.getFacadeClasses(fileClassFqName, moduleInfo.contentScope()) file.hasTopLevelCallables() -> (kotlinAsJavaSupport as IDEKotlinAsJavaSupport).createLightClassForFileFacade( fileClassFqName, listOf(file), moduleInfo ) else -> emptyList<PsiClass>() } facadeClasses.filterTo(result) { it is KtLightClassForFacade && file in it.files } return result.toTypedArray() } }
{ "pile_set_name": "Github" }
package com.didiglobal.sds.admin.dao.bean; import java.util.Date; /** * @auther manzhizhen * @date 2019/1/19 */ public class UserPrivilege { private Long id; private String userName; private String appGroupName; private String appName; /** * 0-没有读权限,1-有读权限 */ private Integer read; /** * 0-没有写权限,1-有写权限 */ private Integer write; private Date createTime; private Date modifiedTime; public Long getId() { return id; } public void setId(Long id) { this.id = id; } public String getUserName() { return userName; } public void setUserName(String userName) { this.userName = userName; } public String getAppGroupName() { return appGroupName; } public void setAppGroupName(String appGroupName) { this.appGroupName = appGroupName; } public String getAppName() { return appName; } public void setAppName(String appName) { this.appName = appName; } public Integer getRead() { return read; } public void setRead(Integer read) { this.read = read; } public Integer getWrite() { return write; } public void setWrite(Integer write) { this.write = write; } public Date getCreateTime() { return createTime; } public void setCreateTime(Date createTime) { this.createTime = createTime; } public Date getModifiedTime() { return modifiedTime; } public void setModifiedTime(Date modifiedTime) { this.modifiedTime = modifiedTime; } @Override public String toString() { final StringBuilder sb = new StringBuilder("UserPrivilege{"); sb.append("id=").append(id); sb.append(", userName='").append(userName).append('\''); sb.append(", appGroupName='").append(appGroupName).append('\''); sb.append(", appName='").append(appName).append('\''); sb.append(", read=").append(read); sb.append(", write=").append(write); sb.append(", createTime=").append(createTime); sb.append(", modifiedTime=").append(modifiedTime); sb.append('}'); return sb.toString(); } }
{ "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.druid.cli; import com.google.common.annotations.VisibleForTesting; import com.google.common.collect.ImmutableList; import com.google.common.collect.ImmutableMap; import com.google.inject.Binder; import com.google.inject.Inject; import com.google.inject.Injector; import com.google.inject.Key; import com.google.inject.Provider; import com.google.inject.multibindings.Multibinder; import org.apache.druid.curator.discovery.ServiceAnnouncer; import org.apache.druid.discovery.DiscoveryDruidNode; import org.apache.druid.discovery.DruidNodeAnnouncer; import org.apache.druid.discovery.DruidService; import org.apache.druid.discovery.NodeRole; import org.apache.druid.guice.LazySingleton; import org.apache.druid.guice.LifecycleModule; import org.apache.druid.guice.annotations.Self; import org.apache.druid.java.util.common.lifecycle.Lifecycle; import org.apache.druid.java.util.common.logger.Logger; import org.apache.druid.java.util.emitter.EmittingLogger; import org.apache.druid.server.DruidNode; import java.lang.annotation.Annotation; import java.util.List; /** * */ public abstract class ServerRunnable extends GuiceRunnable { private static final EmittingLogger log = new EmittingLogger(ServerRunnable.class); public ServerRunnable(Logger log) { super(log); } @Override public void run() { final Injector injector = makeInjector(); final Lifecycle lifecycle = initLifecycle(injector); try { lifecycle.join(); } catch (Exception e) { throw new RuntimeException(e); } } public static void bindNodeRoleAndAnnouncer(Binder binder, DiscoverySideEffectsProvider discoverySideEffectsProvider) { Multibinder<NodeRole> selfBinder = Multibinder.newSetBinder(binder, NodeRole.class, Self.class); selfBinder.addBinding().toInstance(discoverySideEffectsProvider.nodeRole); bindAnnouncer( binder, discoverySideEffectsProvider ); } public static void bindNodeRoleAndAnnouncer( Binder binder, Class<? extends Annotation> annotation, DiscoverySideEffectsProvider discoverySideEffectsProvider ) { Multibinder<NodeRole> selfBinder = Multibinder.newSetBinder(binder, NodeRole.class, Self.class); selfBinder.addBinding().toInstance(discoverySideEffectsProvider.nodeRole); bindAnnouncer( binder, annotation, discoverySideEffectsProvider ); } private static void bindAnnouncer( final Binder binder, final DiscoverySideEffectsProvider provider ) { binder.bind(DiscoverySideEffectsProvider.Child.class) .toProvider(provider) .in(LazySingleton.class); LifecycleModule.registerKey(binder, Key.get(DiscoverySideEffectsProvider.Child.class)); } private static void bindAnnouncer( final Binder binder, final Class<? extends Annotation> annotation, final DiscoverySideEffectsProvider provider ) { binder.bind(DiscoverySideEffectsProvider.Child.class) .annotatedWith(annotation) .toProvider(provider) .in(LazySingleton.class); LifecycleModule.registerKey(binder, Key.get(DiscoverySideEffectsProvider.Child.class, annotation)); } /** * This is a helper class used by CliXXX classes to announce {@link DiscoveryDruidNode} * as part of {@link Lifecycle.Stage#ANNOUNCEMENTS}. */ protected static class DiscoverySideEffectsProvider implements Provider<DiscoverySideEffectsProvider.Child> { public static class Child { } public static class Builder { private NodeRole nodeRole; private List<Class<? extends DruidService>> serviceClasses = ImmutableList.of(); private boolean useLegacyAnnouncer; public Builder(final NodeRole nodeRole) { this.nodeRole = nodeRole; } public Builder serviceClasses(final List<Class<? extends DruidService>> serviceClasses) { this.serviceClasses = serviceClasses; return this; } public Builder useLegacyAnnouncer(final boolean useLegacyAnnouncer) { this.useLegacyAnnouncer = useLegacyAnnouncer; return this; } public DiscoverySideEffectsProvider build() { return new DiscoverySideEffectsProvider( nodeRole, serviceClasses, useLegacyAnnouncer ); } } public static Builder builder(final NodeRole nodeRole) { return new Builder(nodeRole); } @Inject @Self private DruidNode druidNode; @Inject private DruidNodeAnnouncer announcer; @Inject private ServiceAnnouncer legacyAnnouncer; @Inject private Lifecycle lifecycle; @Inject private Injector injector; private final NodeRole nodeRole; private final List<Class<? extends DruidService>> serviceClasses; private final boolean useLegacyAnnouncer; private DiscoverySideEffectsProvider( final NodeRole nodeRole, final List<Class<? extends DruidService>> serviceClasses, final boolean useLegacyAnnouncer ) { this.nodeRole = nodeRole; this.serviceClasses = serviceClasses; this.useLegacyAnnouncer = useLegacyAnnouncer; } @VisibleForTesting DiscoverySideEffectsProvider( final NodeRole nodeRole, final List<Class<? extends DruidService>> serviceClasses, final boolean useLegacyAnnouncer, final DruidNode druidNode, final DruidNodeAnnouncer announcer, final ServiceAnnouncer legacyAnnouncer, final Lifecycle lifecycle, final Injector injector ) { this.nodeRole = nodeRole; this.serviceClasses = serviceClasses; this.useLegacyAnnouncer = useLegacyAnnouncer; this.druidNode = druidNode; this.announcer = announcer; this.legacyAnnouncer = legacyAnnouncer; this.lifecycle = lifecycle; this.injector = injector; } @Override public Child get() { ImmutableMap.Builder<String, DruidService> builder = new ImmutableMap.Builder<>(); for (Class<? extends DruidService> clazz : serviceClasses) { DruidService service = injector.getInstance(clazz); if (service.isDiscoverable()) { builder.put(service.getName(), service); } else { log.info( "Service[%s] is not discoverable. This will not be listed as a service provided by this node.", service.getName() ); } } DiscoveryDruidNode discoveryDruidNode = new DiscoveryDruidNode(druidNode, nodeRole, builder.build()); lifecycle.addHandler( new Lifecycle.Handler() { @Override public void start() { announcer.announce(discoveryDruidNode); if (useLegacyAnnouncer) { legacyAnnouncer.announce(discoveryDruidNode.getDruidNode()); } } @Override public void stop() { // Reverse order vs. start(). if (useLegacyAnnouncer) { legacyAnnouncer.unannounce(discoveryDruidNode.getDruidNode()); } announcer.unannounce(discoveryDruidNode); } }, Lifecycle.Stage.ANNOUNCEMENTS ); return new Child(); } } }
{ "pile_set_name": "Github" }
<?php /** * Copyright © Magento, Inc. All rights reserved. * See COPYING.txt for license details. */ declare(strict_types=1); namespace Magento\Security\Model; /** * Tests for \Magento\Security\Model\UserExpirationManager * @magentoAppArea adminhtml * @SuppressWarnings(PHPMD.CouplingBetweenObjects) */ class UserExpirationManagerTest extends \PHPUnit\Framework\TestCase { /** * @var \Magento\Framework\ObjectManagerInterface */ private $objectManager; /** * @var \Magento\Backend\Model\Auth */ private $auth; /** * @var \Magento\Backend\Model\Auth\Session */ private $authSession; /** * @var \Magento\Security\Model\AdminSessionInfo */ private $adminSessionInfo; /** * @var \Magento\Security\Model\UserExpirationManager */ private $userExpirationManager; protected function setUp(): void { $this->objectManager = \Magento\TestFramework\Helper\Bootstrap::getObjectManager(); $this->auth = $this->objectManager->create(\Magento\Backend\Model\Auth::class); $this->authSession = $this->objectManager->create(\Magento\Backend\Model\Auth\Session::class); $this->adminSessionInfo = $this->objectManager->create(\Magento\Security\Model\AdminSessionInfo::class); $this->auth->setAuthStorage($this->authSession); $this->userExpirationManager = $this->objectManager->create(\Magento\Security\Model\UserExpirationManager::class); } /** * @magentoDataFixture Magento/Security/_files/expired_users.php */ public function testUserIsExpired() { $adminUserNameFromFixture = 'adminUserExpired'; $user = $this->loadUserByUsername($adminUserNameFromFixture); static::assertTrue($this->userExpirationManager->isUserExpired($user->getId())); } /** * @magentoDataFixture Magento/Security/_files/expired_users.php * @magentoAppIsolation enabled */ public function testDeactivateExpiredUsersWithExpiredUser() { $adminUsernameFromFixture = 'adminUserNotExpired'; $this->loginUser($adminUsernameFromFixture); $user = $this->loadUserByUsername($adminUsernameFromFixture); $sessionId = $this->authSession->getSessionId(); $this->expireUser($user); $this->userExpirationManager->deactivateExpiredUsersById([$user->getId()]); $this->adminSessionInfo->load($sessionId, 'session_id'); $user->reload(); $userExpirationModel = $this->loadExpiredUserModelByUser($user); static::assertEquals(0, $user->getIsActive()); static::assertNull($userExpirationModel->getId()); static::assertEquals(AdminSessionInfo::LOGGED_OUT, (int)$this->adminSessionInfo->getStatus()); } /** * @magentoDataFixture Magento/Security/_files/expired_users.php * @magentoAppIsolation enabled */ public function testDeactivateExpiredUsersWithNonExpiredUser() { $adminUsernameFromFixture = 'adminUserNotExpired'; $this->loginUser($adminUsernameFromFixture); $user = $this->loadUserByUsername($adminUsernameFromFixture); $sessionId = $this->authSession->getSessionId(); $this->userExpirationManager->deactivateExpiredUsersById([$user->getId()]); $user->reload(); $userExpirationModel = $this->loadExpiredUserModelByUser($user); $this->adminSessionInfo->load($sessionId, 'session_id'); static::assertEquals(1, $user->getIsActive()); static::assertEquals($user->getId(), $userExpirationModel->getId()); static::assertEquals(AdminSessionInfo::LOGGED_IN, (int)$this->adminSessionInfo->getStatus()); } /** * Test deactivating without inputting a user. * * @magentoDataFixture Magento/Security/_files/expired_users.php */ public function testDeactivateExpiredUsers() { $notExpiredUser = $this->loadUserByUsername('adminUserNotExpired'); $expiredUser = $this->loadUserByUsername('adminUserExpired'); $this->userExpirationManager->deactivateExpiredUsers(); $notExpiredUserExpirationModel = $this->loadExpiredUserModelByUser($notExpiredUser); $expiredUserExpirationModel = $this->loadExpiredUserModelByUser($expiredUser); static::assertNotNull($notExpiredUserExpirationModel->getId()); static::assertNull($expiredUserExpirationModel->getId()); $notExpiredUser->reload(); $expiredUser->reload(); static::assertEquals($notExpiredUser->getIsActive(), 1); static::assertEquals($expiredUser->getIsActive(), 0); } /** * Login the given user and return a user model. * * @param string $username * @throws \Magento\Framework\Exception\AuthenticationException */ private function loginUser(string $username) { $this->auth->login( $username, \Magento\TestFramework\Bootstrap::ADMIN_PASSWORD ); } /** * @param $username * @return \Magento\User\Model\User */ private function loadUserByUsername(string $username): \Magento\User\Model\User { /** @var \Magento\User\Model\User $user */ $user = $this->objectManager->create(\Magento\User\Model\User::class); $user->loadByUsername($username); return $user; } /** * Expire the given user and return the UserExpiration model. * * @param \Magento\User\Model\User $user * @throws \Exception */ private function expireUser(\Magento\User\Model\User $user) { $expireDate = new \DateTime(); $expireDate->modify('-10 days'); /** @var \Magento\Security\Api\Data\UserExpirationInterface $userExpiration */ $userExpiration = $this->objectManager->create(\Magento\Security\Api\Data\UserExpirationInterface::class); $userExpiration->setId($user->getId()) ->setExpiresAt($expireDate->format('Y-m-d H:i:s')) ->save(); } /** * @param \Magento\User\Model\User $user * @return \Magento\Security\Model\UserExpiration */ private function loadExpiredUserModelByUser(\Magento\User\Model\User $user): \Magento\Security\Model\UserExpiration { /** @var \Magento\Security\Model\UserExpiration $expiredUserModel */ $expiredUserModel = $this->objectManager->create(\Magento\Security\Model\UserExpiration::class); $expiredUserModel->load($user->getId()); return $expiredUserModel; } }
{ "pile_set_name": "Github" }
github.com/Shopify/toxiproxy v2.1.4+incompatible h1:TKdv8HiTLgE5wdJuEML90aBgNWsokNbMijUGhmcoBJc= github.com/Shopify/toxiproxy v2.1.4+incompatible/go.mod h1:OXgGpZ6Cli1/URJOF1DMxUHB2q5Ap20/P/eIdh4G0pI= github.com/davecgh/go-spew v1.1.0/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= github.com/davecgh/go-spew v1.1.1 h1:vj9j/u1bqnvCEfJOwUhtlOARqs3+rkHYY13jYWTU97c= github.com/davecgh/go-spew v1.1.1/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= github.com/eapache/go-resiliency v1.2.0 h1:v7g92e/KSN71Rq7vSThKaWIq68fL4YHvWyiUKorFR1Q= github.com/eapache/go-resiliency v1.2.0/go.mod h1:kFI+JgMyC7bLPUVY133qvEBtVayf5mFgVsvEsIPBvNs= github.com/eapache/go-xerial-snappy v0.0.0-20180814174437-776d5712da21 h1:YEetp8/yCZMuEPMUDHG0CW/brkkEp8mzqk2+ODEitlw= github.com/eapache/go-xerial-snappy v0.0.0-20180814174437-776d5712da21/go.mod h1:+020luEh2TKB4/GOp8oxxtq0Daoen/Cii55CzbTV6DU= github.com/eapache/queue v1.1.0 h1:YOEu7KNc61ntiQlcEeUIoDTJ2o8mQznoNvUhiigpIqc= github.com/eapache/queue v1.1.0/go.mod h1:6eCeP0CKFpHLu8blIFXhExK/dRa7WDZfr6jVFPTqq+I= github.com/fortytw2/leaktest v1.3.0 h1:u8491cBMTQ8ft8aeV+adlcytMZylmA5nnwwkRZjI8vw= github.com/fortytw2/leaktest v1.3.0/go.mod h1:jDsjWgpAGjm2CA7WthBh/CdZYEPF31XHquHwclZch5g= github.com/frankban/quicktest v1.7.2 h1:2QxQoC1TS09S7fhCPsrvqYdvP1H5M1P1ih5ABm3BTYk= github.com/frankban/quicktest v1.7.2/go.mod h1:jaStnuzAqU1AJdCO0l53JDCJrVDKcS03DbaAcR7Ks/o= github.com/golang/snappy v0.0.1 h1:Qgr9rKW7uDUkrbSmQeiDsGa8SjGyCOGtuasMWwvp2P4= github.com/golang/snappy v0.0.1/go.mod h1:/XxbfmMg8lxefKM7IXC3fBNl/7bRcc72aCRzEWrmP2Q= github.com/google/go-cmp v0.3.1/go.mod h1:8QqcDgzrUqlUb/G2PQTWiueGozuR1884gddMywk6iLU= github.com/google/go-cmp v0.4.0 h1:xsAVV57WRhGj6kEIi8ReJzQlHHqcBYCElAvkovg3B/4= github.com/google/go-cmp v0.4.0/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE= github.com/hashicorp/go-uuid v1.0.2 h1:cfejS+Tpcp13yd5nYHWDI6qVCny6wyX2Mt5SGur2IGE= github.com/hashicorp/go-uuid v1.0.2/go.mod h1:6SBZvOh/SIDV7/2o3Jml5SYk/TvGqwFJ/bN7x4byOro= github.com/jcmturner/gofork v1.0.0 h1:J7uCkflzTEhUZ64xqKnkDxq3kzc96ajM1Gli5ktUem8= github.com/jcmturner/gofork v1.0.0/go.mod h1:MK8+TM0La+2rjBD4jE12Kj1pCCxK7d2LK/UM3ncEo0o= github.com/klauspost/compress v1.9.8 h1:VMAMUUOh+gaxKTMk+zqbjsSjsIcUcL/LF4o63i82QyA= github.com/klauspost/compress v1.9.8/go.mod h1:RyIbtBH6LamlWaDj8nUwkbUhJ87Yi3uG0guNDohfE1A= github.com/kr/pretty v0.1.0 h1:L/CwN0zerZDmRFUapSPitk6f+Q3+0za1rQkzVuMiMFI= github.com/kr/pretty v0.1.0/go.mod h1:dAy3ld7l9f0ibDNOQOHHMYYIIbhfbHSm3C4ZsoJORNo= github.com/kr/pretty v0.2.0 h1:s5hAObm+yFO5uHYt5dYjxi2rXrsnmRpJx4OYvIWUaQs= github.com/kr/pretty v0.2.0/go.mod h1:ipq/a2n7PKx3OHsz4KJII5eveXtPO4qwEXGdVfWzfnI= github.com/kr/pty v1.1.1/go.mod h1:pFQYn66WHrOpPYNljwOMqo10TkYh1fy3cYio2l3bCsQ= github.com/kr/text v0.1.0 h1:45sCR5RtlFHMR4UwH9sdQ5TC8v0qDQCHnXt+kaKSTVE= github.com/kr/text v0.1.0/go.mod h1:4Jbv+DJW3UT/LiOwJeYQe1efqtUx/iVham/4vfdArNI= github.com/pierrec/lz4 v2.4.1+incompatible h1:mFe7ttWaflA46Mhqh+jUfjp2qTbPYxLB2/OyBppH9dg= github.com/pierrec/lz4 v2.4.1+incompatible/go.mod h1:pdkljMzZIN41W+lC3N2tnIh5sFi+IEE17M5jbnwPHcY= github.com/pmezard/go-difflib v1.0.0 h1:4DBwDE0NGyQoBHbLQYPwSUPoCMWR5BEzIk/f1lZbAQM= github.com/pmezard/go-difflib v1.0.0/go.mod h1:iKH77koFhYxTK1pcRnkKkqfTogsbg7gZNVY4sRDYZ/4= github.com/rcrowley/go-metrics v0.0.0-20190826022208-cac0b30c2563 h1:dY6ETXrvDG7Sa4vE8ZQG4yqWg6UnOcbqTAahkV813vQ= github.com/rcrowley/go-metrics v0.0.0-20190826022208-cac0b30c2563/go.mod h1:bCqnVzQkZxMG4s8nGwiZ5l3QUCyqpo9Y+/ZMZ9VjZe4= github.com/stretchr/objx v0.1.0/go.mod h1:HFkY916IF+rwdDfMAkV7OtwuqBVzrE8GR6GFx+wExME= github.com/stretchr/testify v1.4.0 h1:2E4SXV/wtOkTonXsotYi4li6zVWxYlZuYNCXe9XRJyk= github.com/stretchr/testify v1.4.0/go.mod h1:j7eGeouHqKxXV5pUuKE4zz7dFj8WfuZ+81PSLYec5m4= github.com/xdg/scram v0.0.0-20180814205039-7eeb5667e42c h1:u40Z8hqBAAQyv+vATcGgV0YCnDjqSL7/q/JyPhhJSPk= github.com/xdg/scram v0.0.0-20180814205039-7eeb5667e42c/go.mod h1:lB8K/P019DLNhemzwFU4jHLhdvlE6uDZjXFejJXr49I= github.com/xdg/stringprep v1.0.0 h1:d9X0esnoa3dFsV0FG35rAT0RIhYFlPq7MiP+DW89La0= github.com/xdg/stringprep v1.0.0/go.mod h1:Jhud4/sHMO4oL310DaZAKk9ZaJ08SJfe+sJh0HrGL1Y= golang.org/x/crypto v0.0.0-20190308221718-c2843e01d9a2 h1:VklqNMn3ovrHsnt90PveolxSbWFaJdECFbxSq0Mqo2M= golang.org/x/crypto v0.0.0-20190308221718-c2843e01d9a2/go.mod h1:djNgcEr1/C05ACkg1iLfiJU5Ep61QUkGW8qpdssI0+w= golang.org/x/crypto v0.0.0-20200204104054-c9f3fb736b72 h1:+ELyKg6m8UBf0nPFSqD0mi7zUfwPyXo23HNjMnXPz7w= golang.org/x/crypto v0.0.0-20200204104054-c9f3fb736b72/go.mod h1:LzIPMQfyMNhhGPhUkYOs5KpL4U8rLKemX1yGLhDgUto= golang.org/x/net v0.0.0-20190404232315-eb5bcb51f2a3 h1:0GoQqolDA55aaLxZyTzK/Y2ePZzZTUrRacwib7cNsYQ= golang.org/x/net v0.0.0-20190404232315-eb5bcb51f2a3/go.mod h1:t9HGtf8HONx5eT2rtn7q6eTqICYqUVnKs3thJo3Qplg= golang.org/x/net v0.0.0-20200202094626-16171245cfb2 h1:CCH4IOTTfewWjGOlSp+zGcjutRKlBEZQ6wTn8ozI/nI= golang.org/x/net v0.0.0-20200202094626-16171245cfb2/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= golang.org/x/sys v0.0.0-20190215142949-d0b11bdaac8a/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= golang.org/x/sys v0.0.0-20190412213103-97732733099d/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/text v0.3.0 h1:g61tztE5qeGQ89tm6NTjjM9VPIm088od1l6aSorWRWg= golang.org/x/text v0.3.0/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ= golang.org/x/text v0.3.2 h1:tW2bmiBqwgJj/UpqtC8EpXEZVYOwU0yG4iWbprSVAcs= golang.org/x/text v0.3.2/go.mod h1:bEr9sfX3Q8Zfm5fL9x+3itogRgK3+ptLWKqgva+5dAk= golang.org/x/tools v0.0.0-20180917221912-90fa682c2a6e/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ= golang.org/x/xerrors v0.0.0-20191204190536-9bdfabe68543 h1:E7g+9GITq07hpfrRu66IVDexMakfv52eLZ2CXBWiKr4= golang.org/x/xerrors v0.0.0-20191204190536-9bdfabe68543/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405 h1:yhCVgyC4o1eVCa2tZl7eS0r+SDo693bJlVdllGtEeKM= gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= gopkg.in/check.v1 v1.0.0-20190902080502-41f04d3bba15 h1:YR8cESwS4TdDjEe65xsg0ogRM/Nc3DYOhEAlW+xobZo= gopkg.in/check.v1 v1.0.0-20190902080502-41f04d3bba15/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= gopkg.in/jcmturner/aescts.v1 v1.0.1 h1:cVVZBK2b1zY26haWB4vbBiZrfFQnfbTVrE3xZq6hrEw= gopkg.in/jcmturner/aescts.v1 v1.0.1/go.mod h1:nsR8qBOg+OucoIW+WMhB3GspUQXq9XorLnQb9XtvcOo= gopkg.in/jcmturner/dnsutils.v1 v1.0.1 h1:cIuC1OLRGZrld+16ZJvvZxVJeKPsvd5eUIvxfoN5hSM= gopkg.in/jcmturner/dnsutils.v1 v1.0.1/go.mod h1:m3v+5svpVOhtFAP/wSz+yzh4Mc0Fg7eRhxkJMWSIz9Q= gopkg.in/jcmturner/goidentity.v3 v3.0.0 h1:1duIyWiTaYvVx3YX2CYtpJbUFd7/UuPYCfgXtQ3VTbI= gopkg.in/jcmturner/goidentity.v3 v3.0.0/go.mod h1:oG2kH0IvSYNIu80dVAyu/yoefjq1mNfM5bm88whjWx4= gopkg.in/jcmturner/gokrb5.v7 v7.5.0 h1:a9tsXlIDD9SKxotJMK3niV7rPZAJeX2aD/0yg3qlIrg= gopkg.in/jcmturner/gokrb5.v7 v7.5.0/go.mod h1:l8VISx+WGYp+Fp7KRbsiUuXTTOnxIc3Tuvyavf11/WM= gopkg.in/jcmturner/rpc.v1 v1.1.0 h1:QHIUxTX1ISuAv9dD2wJ9HWQVuWDX/Zc0PfeC2tjc4rU= gopkg.in/jcmturner/rpc.v1 v1.1.0/go.mod h1:YIdkC4XfD6GXbzje11McwsDuOlZQSb9W4vfLvuNnlv8= gopkg.in/yaml.v2 v2.2.2 h1:ZCJp+EgiOT7lHqUV2J862kp8Qj64Jo6az82+3Td9dZw= gopkg.in/yaml.v2 v2.2.2/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI= gopkg.in/yaml.v2 v2.2.8 h1:obN1ZagJSUGI0Ek/LBmuj4SNLPfIny3KsKFopxRdj10= gopkg.in/yaml.v2 v2.2.8/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI=
{ "pile_set_name": "Github" }
# Logger Custom Output This program is ported by C# from examples\logger_custom_output_ex.cpp. ## How to use? ## 1. Build 1. Open command prompt and change to &lt;LoggerCustomOutput_dir&gt; 1. Type the following command ```` dotnet build -c Release ```` 2. Copy ***DlibDotNet.dll***, ***DlibDotNetNative.dll*** and ***DlibDotNetNativeDnn.dll*** to output directory; &lt;LoggerCustomOutput_dir&gt;\bin\Release\netcoreapp2.0. **NOTE** - You should build ***DlibDotNetNative.dll*** and ***DlibDotNetNativeDnn.dll*** with CUDA. - If you want to run at Linux and MacOS, you should build the **DlibDotNet** at first. Please refer the [Tutorial for Linux](https://github.com/takuya-takeuchi/DlibDotNet/wiki/Tutorial-for-Linux) or [Tutorial for MacOS](https://github.com/takuya-takeuchi/DlibDotNet/wiki/Tutorial-for-MacOS). ## 2. Run ```` cd <LoggerCustomOutput_dir> dotnet run --configuration Release INFO [0] main: This is an informational message. ERROR [0] main: An error message! ````
{ "pile_set_name": "Github" }
{ "images" : [ { "idiom" : "universal", "scale" : "1x" }, { "idiom" : "universal", "scale" : "2x", "filename" : "MediaAudio@2x.png" }, { "idiom" : "universal", "scale" : "3x" } ], "info" : { "version" : 1, "author" : "xcode", "template-rendering-intent" : "template" } }
{ "pile_set_name": "Github" }
/* ********************************************************** * Copyright (c) 2011-2020 Google, Inc. All rights reserved. * Copyright (c) 2009-2010 VMware, Inc. All rights reserved. * **********************************************************/ /* Dr. Memory: the memory debugger * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; * version 2.1 of the License, and no later version. * This library is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Library General Public License for more details. * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. */ #include <windows.h> #include <process.h> /* for _beginthreadex */ #include <stdio.h> #define NUM_THREADS 3 int WINAPI run_and_exit_func(void *arg) { MEMORY_BASIC_INFORMATION mbi; char *p = malloc(4); int i = (int)(intptr_t) arg; if (i == 0) *(p+5) = 3; else { if (*p == 'a') *p = 'b'; } free(p); VirtualQuery(&mbi, &mbi, sizeof(mbi)); Sleep(100); _endthreadex(0); /* doesn't close thread handle */ return 0; } int WINAPI run_func(void *arg) { MEMORY_BASIC_INFORMATION mbi; while (1) { /* make a syscall that DR intercepts to increase chance * of a racy crash */ VirtualQuery(&mbi, &mbi, sizeof(mbi)); Sleep(100); } _endthread(); /* closes the thread handle for us */ return 0; } int main() { int i, tid; /* Keep these reachable so the handles don't count as leaks. */ static HANDLE thread[NUM_THREADS]; printf("Starting\n"); /* make some threads that exit to test leaks, etc. */ for (i = 0; i < NUM_THREADS; i++) { thread[i] = (HANDLE) _beginthreadex(NULL, 0, run_and_exit_func, (void*)(intptr_t)i, 0, &tid); } /* i#680: Wait for the first batch of threads to exit, or we may not catch * their errors before we exit. */ for (i = 0; i < NUM_THREADS; i++) { WaitForSingleObject(thread[i], INFINITE); CloseHandle(thread[i]); } /* make some threads and then just exit the process while they're still * running to test exit races (PR 470957) */ for (i = 0; i < NUM_THREADS; i++) { thread[i] = (HANDLE) _beginthreadex(NULL, 0, run_func, NULL, 0, &tid); } /* don't wait */ printf("Exiting\n"); return 0; }
{ "pile_set_name": "Github" }
package services import ( "fmt" "math/rand" "net" "reflect" "sort" "strings" "testing" "github.com/stretchr/testify/assert" ) // ------------------------------------------ // Test setup with mock services type MockAddr struct { NetworkAttr string StringAttr string } func (addr MockAddr) Network() string { return addr.NetworkAttr } func (addr MockAddr) String() string { return addr.StringAttr } var ( lo = getLocalhostIfaceName() lo6 = fmt.Sprintf("%s:inet6", lo) ) func getLocalhostIfaceName() string { ifaces, _ := net.Interfaces() for _, iface := range ifaces { if strings.HasPrefix(iface.Name, "lo") { return iface.Name } } return "" } func TestGetIp(t *testing.T) { ip, _ := GetIP([]string{lo, "inet"}) assert.Equal(t, "127.0.0.1", ip, "expected to find loopback IP") ip, err := GetIP([]string{"interface-does-not-exist"}) assert.Error(t, err, "expected interface not found, but instead got an IP") ip, _ = GetIP([]string{"static:192.168.1.100", lo}) assert.Equal(t, "192.168.1.100", ip, "expected to find static IP") // these tests can't pass if the test runner doesn't have a valid inet // address, so we'll skip these tests in that environment. interfaces, _ := net.Interfaces() allIps, _ := getinterfaceIPs(interfaces) for _, ip := range allIps { if ip.IsIPv4() && !ip.IP.IsLoopback() { if ip, err := GetIP([]string{}); ip == "" { t.Errorf("expected default interface to yield an IP, but got nothing: %v", err) } if ip, _ := GetIP(nil); ip == "" { t.Errorf("expected default interface to yield an IP, but got nothing.") } if ip, _ := GetIP([]string{"inet"}); ip == "" { t.Errorf("expected to find IP for inet, but found nothing.") } if ip, _ := GetIP([]string{"inet", lo}); ip == "127.0.0.1" { t.Errorf("expected to find inet ip, but found loopback instead") } } } } func TestInterfaceIpsLoopback(t *testing.T) { interfaces := make([]net.Interface, 1) interfaces[0] = net.Interface{ Index: 1, MTU: 65536, Name: lo, Flags: net.FlagUp | net.FlagLoopback, } interfaceIps, err := getinterfaceIPs(interfaces) if err != nil { t.Error(err) return } /* Because we are testing inside of Docker we can expect that the loopback * interface to always be on the IPv4 address 127.0.0.1 and to be at * index 1 */ for _, ip := range interfaceIps { if ip.Name != lo { t.Errorf("Expecting loopback interface, but got: %s", ip.Name) } if ip.IsIPv4() && ip.IPString() != "127.0.0.1" { t.Errorf("Expecting loopback interface [127.0.0.1] to be returned, got %s", ip.IPString()) } if !ip.IsIPv4() && !strings.HasSuffix(ip.IPString(), "::1") { t.Errorf("Expecting loopback interface [::1] to be returned, got %s", ip.IPString()) } } } func TestInterfaceIpsError(t *testing.T) { interfaces := make([]net.Interface, 2) interfaces[0] = net.Interface{ Index: 1, MTU: 65536, Name: lo, Flags: net.FlagUp | net.FlagLoopback, } interfaces[1] = net.Interface{ Index: -1, MTU: 65536, Name: "barf", Flags: net.FlagUp | net.FlagBroadcast | net.FlagMulticast, HardwareAddr: []byte{0x10, 0xC3, 0x7B, 0x45, 0xA2, 0xFF}, } interfaceIps, err := getinterfaceIPs(interfaces) if err != nil { t.Error(err) return } /* We expect to get only a single valid ip address back because the second * value is junk. */ if len(interfaceIps) == 0 { t.Error("No IPs were parsed from interface. Expecting: 127.0.0.1") } for _, ip := range interfaceIps { if ip.Name != lo { t.Errorf("Expecting loopback interface, but got: %s", ip.Name) } if ip.IsIPv4() && ip.IPString() != "127.0.0.1" { t.Errorf("Expecting loopback interface [127.0.0.1] to be returned, got %s", ip.IPString()) } if !ip.IsIPv4() && !strings.HasSuffix(ip.IPString(), "::1") { t.Errorf("Expecting loopback interface [::1] to be returned, got %s", ip.IPString()) } } } func TestInterfaceSpecParse(t *testing.T) { // Test Error Cases testSpecError(t, "") // Nothing testSpecError(t, "!") // Nonsense testSpecError(t, "127.0.0.1") // No Network testSpecError(t, "eth0:inet5") // Invalid IP Version testSpecError(t, "eth0[-1]") // Invalid Index testSpecError(t, "static:abcdef") // Invalid IP // Test Interface Case testSpecInterfaceName(t, "eth0", "eth0", false, -1) testSpecInterfaceName(t, "eth0:inet6", "eth0", true, -1) testSpecInterfaceName(t, "eth0[1]", "eth0", false, 1) testSpecInterfaceName(t, "eth0[2]", "eth0", false, 2) testSpecInterfaceName(t, "inet", "*", false, -1) testSpecInterfaceName(t, "inet6", "*", true, -1) testSpecInterfaceName(t, "static:192.168.1.100", "static", false, 1) // Test CIDR Case testSpecCIDR(t, "10.0.0.0/16") testSpecCIDR(t, "fdc6:238c:c4bc::/48") } func testSpecError(t *testing.T, specStr string) { if spec, err := parseInterfaceSpec(specStr); err == nil { t.Errorf("Expected error but got %s", spec) } } func testSpecInterfaceName(t *testing.T, specStr string, name string, ipv6 bool, index int) { spec, err := parseInterfaceSpec(specStr) if err != nil { t.Errorf("Expected parse to succeed, but got error: %s", err) } if name == "static" { staticSpec, ok := spec.(staticInterfaceSpec) if !ok { t.Errorf("Expected %s to parse as staticInterfaceSpec", spec) return } if staticSpec.Name != "static" { t.Errorf("Expected to parse interface name static but got %s", staticSpec.Name) } return } if index < 0 { inetSpec, ok := spec.(inetInterfaceSpec) if !ok { t.Errorf("Expected %s to parse as inetInterfaceSpec", spec) return } if inetSpec.Name != name { t.Errorf("Expected to parse interface name %s but got %s", name, inetSpec.Name) } if inetSpec.IPv6 != ipv6 { if ipv6 { t.Errorf("Expected spec %s to be IPv6", spec) } else { t.Errorf("Expected spec %s to be IPv4", spec) } } return } indexSpec, ok := spec.(indexInterfaceSpec) if !ok { t.Errorf("Expected %s to parse as indexInterfaceSpec", spec) return } if indexSpec.Name != name { t.Errorf("Expected to parse interface name %s but got %s", name, indexSpec.Name) } if indexSpec.Index != index { t.Errorf("Expected index to be %d but was %d", index, indexSpec.Index) } } func testSpecCIDR(t *testing.T, specStr string) { spec, err := parseInterfaceSpec(specStr) if err != nil { t.Errorf("Expected parse to succeed, but got error: %s", err) } cidrSpec, ok := spec.(cidrInterfaceSpec) if !ok { t.Errorf("Expected %s to parse as cidrInterfaceSpec", spec) return } if cidrSpec.Network == nil { t.Errorf("Expected spec to be a network CIDR") } } func TestFindIPWithSpecs(t *testing.T) { iips := getTestIPs() // Loopback testIPSpec(t, iips, "127.0.0.1", lo) testIPSpec(t, iips, "::1", lo6) // Static testIPSpec(t, iips, "192.168.1.100", "static:192.168.1.100") // Interface Name testIPSpec(t, iips, "10.2.0.1", "eth0") testIPSpec(t, iips, "10.2.0.1", "eth0:inet") testIPSpec(t, iips, "", "eth0:inet6") // Indexes testIPSpec(t, iips, "192.168.1.100", "eth0[1]") testIPSpec(t, iips, "", "eth0[2]") // IPv4 CIDR testIPSpec(t, iips, "10.0.0.100", "10.0.0.0/16") testIPSpec(t, iips, "10.1.0.200", "10.1.0.0/16") testIPSpec(t, iips, "10.2.0.1", "10.0.0.0/8") // IPv6 CIDR testIPSpec(t, iips, "fdc6:238c:c4bc::1", "eth2:inet6") // First IPv4 testIPSpec(t, iips, "10.2.0.1", "inet") // First IPv6 testIPSpec(t, iips, "fdc6:238c:c4bc::1", "inet6") // Test Multiple testIPSpec(t, iips, "fdc6:238c:c4bc::1", "eth3", "fdc6:238c:c4bc::/48", "inet", "inet6") testIPSpec(t, iips, "10.0.0.100", "eth3", "10.0.0.0/16", "inet", "inet6", "fdc6:238c:c4bc::/48") // Test that inet and inet6 will never find the loopback address loopback := []interfaceIP{ newInterfaceIP(lo6, "::1"), newInterfaceIP(lo, "127.0.0.1"), } testIPSpec(t, loopback, "", "inet") testIPSpec(t, loopback, "", "inet6") } func testIPSpec(t *testing.T, iips []interfaceIP, expectedIP string, specList ...string) { specs, err := parseInterfaceSpecs(specList) if err != nil { t.Fatalf("Fatal parse error of spec list: %s, %s", specList, err) } foundIP, err := findIPWithSpecs(specs, iips) if err != nil && expectedIP != "" { t.Errorf("Expected to find an IP, but got an error instead: %s", err) } if foundIP != expectedIP { t.Errorf("Expected to find IP %s but found %s instead", expectedIP, foundIP) } } func TestInterfaceIPSorting(t *testing.T) { sortedIIPs := getTestIPs() var unsortedIIPs = make([]interfaceIP, len(sortedIIPs)) copy(unsortedIIPs, sortedIIPs) // Shuffle unsortedIIPs rand.Seed(1) // Deterministic for i := range unsortedIIPs { j := rand.Intn(i + 1) unsortedIIPs[i], unsortedIIPs[j] = unsortedIIPs[j], unsortedIIPs[i] } // Do Stable Sort sort.Stable(ByInterfaceThenIP(unsortedIIPs)) if !reflect.DeepEqual(unsortedIIPs, sortedIIPs) { t.Errorf("Interface IPs are not sorted as expected") t.Log("=== EXPECTED ===") for _, ip := range sortedIIPs { t.Logf("%s: %s", ip.Name, ip) } t.Log("=== ACTUAL ===") for _, ip := range unsortedIIPs { t.Logf("%s: %s", ip.Name, ip) } } } // -------- Helper Functions func getTestIPs() []interfaceIP { return []interfaceIP{ newInterfaceIP("eth0", "10.2.0.1"), newInterfaceIP("eth0", "192.168.1.100"), newInterfaceIP("eth1", "10.0.0.100"), newInterfaceIP("eth1", "10.0.0.200"), newInterfaceIP("eth2", "10.1.0.200"), newInterfaceIP("eth2", "fdc6:238c:c4bc::1"), newInterfaceIP(lo, "::1"), newInterfaceIP(lo, "127.0.0.1"), newInterfaceIP("static:192.168.1.100", "192.168.1.100"), } } func newInterfaceIP(name string, ip string) interfaceIP { return interfaceIP{ Name: name, IP: net.ParseIP(ip), } }
{ "pile_set_name": "Github" }
<?xml version="1.0" encoding="utf-8"?> <xliff xmlns="urn:oasis:names:tc:xliff:document:1.2" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" version="1.2" xsi:schemaLocation="urn:oasis:names:tc:xliff:document:1.2 xliff-core-1.2-transitional.xsd"> <file datatype="xml" source-language="en" target-language="pl" original="../ErrorControl.resx"> <body /> </file> </xliff>
{ "pile_set_name": "Github" }
.header { background-color: #cecece; padding-top: 7rem; padding-bottom: 7rem; }
{ "pile_set_name": "Github" }
<template> <transition name="fade"> <div class="am-datepicker" v-if="visible"> <span class="am-datepicker-caret"></span> <table class="am-datepicker-table"> <thead> <tr class="am-datepicker-header"> <th class="am-datepicker-prev" > <i class="am-datepicker-prev-icon" v-show="activeType !== 'month'" @click.stop="preHandle"></i> </th> <th colspan="5" class="am-datepicker-switch"> <div class="am-datepicker-select" @click.stop="selectType">{{ headerTitle }}</div> </th> <th class="am-datepicker-next"> <i class="am-datepicker-next-icon" v-show="activeType !== 'month'" @click.stop="nextHandle"></i> </th> </tr> </thead> <am-datepicker-year v-model="year" v-if="activeType === 'year'" :curYear="curYear" :defaultValue="defaultValue" :disabledBeforeDate="disabledBeforeDate" :disabledAfterDate="disabledAfterDate" @change="selectYear"> </am-datepicker-year> <am-datepicker-month v-model="month" :curYear="curYear" :curMonth="curMonth" v-if="activeType === 'month'" @change="selectMonth" :defaultValue="defaultValue" :disabledBeforeDate="disabledBeforeDate" :disabledAfterDate="disabledAfterDate" :language="language"> </am-datepicker-month> <am-datepicker-date v-if="activeType === 'date'" :year="year" :curYear="curYear" :month="month" :curMonth="curMonth" :curDate="curDate" :language="language" @change="selectDate" :defaultValue="defaultValue" :disabledBeforeDate="disabledBeforeDate" :disabledAfterDate="disabledAfterDate" > </am-datepicker-date> </table> </div> </transition> </template> <script> import Popup from '../../../mixins/popup'; import { monthZHMap, monthENMap } from './language'; import AmDatepickerYear from './year'; import AmDatepickerMonth from './month'; import AmDatepickerDate from './date'; import { on, off } from '../../../utils/dom'; import { detectMobile } from '../../../utils/navigator'; export default { name: 'am-datepicker', mixins: [ Popup ], data() { const { year, month, date } = this.parseDate(this.defaultValue); return { year, month, date, curYear: year, curMonth: month, curDate: date, activeType: this.modelType }; }, props: { modelType: { type: String, default: 'date', validator(value) { return ['year', 'month', 'date'].includes(value); } }, value: {}, defaultValue: { type: [Number, String], default: +new Date() }, disabledBeforeDate: { type: [Number, String, Boolean] }, disabledAfterDate: { type: [Number, String, Boolean] }, language: { type: String, default: 'zh', validator(value) { return ['zh', 'en'].includes(value); } }, format: { type: String, default: 'yyyy-mm-dd' } }, methods: { parseDate(stamp) { const d = new Date(stamp); return { year: d.getFullYear(), month: d.getMonth() + 1, date: d.getDate() }; }, preHandle() { switch (this.activeType) { case 'year': this.year -= 10; break; case 'date': if (this.month === 1) { this.year -= 1; this.month = 12; } else { this.month -= 1; } break; } }, nextHandle() { switch (this.activeType) { case 'year': this.year += 10; break; case 'date': if (this.month === 12) { this.year += 1; this.month = 1; } else { this.month += 1; } break; } }, selectType() { if (this.activeType !== 'month' && this.modelType !== 'year') { this.activeType = 'month'; } else { this.activeType = 'year'; } }, selectYear(year) { this.curYear = year; if (this.modelType === 'year') { this.hide(); } else { this.activeType = this.modelType; } }, selectMonth(month) { this.curMonth = month; if (this.modelType === 'month') { this.hide(); } else { this.activeType = this.modelType; } }, selectDate(dateObj) { this.curYear = dateObj.year; this.curMonth = dateObj.month; this.curDate = dateObj.date; if (this.modelType === 'date') { this.hide(); } else { this.activeType = this.modelType; } }, autoShow(e) { this.visible = !this.visible; e.stopPropagation(); }, globalClickHandle() { this.hide(); }, popupPosition() { const { top, left, height } = this.$parent.$el.getBoundingClientRect(); const { top: offsetTop, left: offsetLeft } = this.getPageOffset(); return { top: top + offsetTop + height + 'px', left: (detectMobile() ? 0 : left + offsetLeft) + 'px', zIndex: this.getZIndex() }; } }, watch: { curYear(curVal, oldVal) { this.$emit('change-year', curVal); this.$emit('input', this.result); }, curMonth(curVal, oldVal) { this.$emit('change-month', curVal); this.$emit('input', this.result); }, curDate(curVal, oldVal) { this.$emit('change-date', curVal); this.$emit('input', this.result); } }, computed: { headerTitle() { let str; switch (this.activeType) { case 'year': let _year = parseInt(this.curYear / 10, 10) * 10; str = (_year - 1) + ' - ' + (_year + 9); break; default: if (this.language === 'zh') { str = this.year + '年 ' + monthZHMap[this.month] + '月'; } else { str = monthENMap[this.month] + ', ' + this.year; } break; } return str; }, result() { let str = this.format; function double(num) { if (num > 9) { return num; } return '0' + num; } str = str.replace('yyyy', this.curYear); str = str.replace('mm', double(this.curMonth)); str = str.replace('dd', double(this.curDate)); return str; } }, components: { AmDatepickerYear, AmDatepickerMonth, AmDatepickerDate }, mounted() { document.body.appendChild(this.$el); on(this.$parent.$el, 'click', this.autoShow); on(document.body, 'click', this.globalClickHandle); }, beforeDestroy() { off(this.$parent.$el, 'click', this.autoShow); off(document.body, 'click', this.globalClickHandle); } }; </script>
{ "pile_set_name": "Github" }
// // SplitString.cs // // Author: // Mike Krüger <mkrueger@novell.com> // // Copyright (c) 2011 Mike Krüger <mkrueger@novell.com> // // 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. using System; using System.Threading; using System.Collections.Generic; namespace ICSharpCode.NRefactory.CSharp.Refactoring { [ContextAction("Split string literal", Description = "Splits string literal into two.")] public class SplitStringAction: ICodeActionProvider { public IEnumerable<CodeAction> GetActions(RefactoringContext context) { if (context.IsSomethingSelected) { yield break; } var pexpr = context.GetNode<PrimitiveExpression>(); if (pexpr == null || !(pexpr.Value is string)) { yield break; } if (pexpr.LiteralValue.StartsWith("@")) { if (!(pexpr.StartLocation < new TextLocation(context.Location.Line, context.Location.Column - 2) && new TextLocation(context.Location.Line, context.Location.Column + 2) < pexpr.EndLocation)) { yield break; } } else { if (!(pexpr.StartLocation < new TextLocation(context.Location.Line, context.Location.Column - 1) && new TextLocation(context.Location.Line, context.Location.Column + 1) < pexpr.EndLocation)) { yield break; } } yield return new CodeAction(context.TranslateString("Split string literal"), script => { int offset = context.GetOffset (context.Location); script.InsertText (offset, pexpr.LiteralValue.StartsWith ("@") ? "\" + @\"" : "\" + \""); }); } } }
{ "pile_set_name": "Github" }
AM_CFLAGS = -I$(top_srcdir)/include \ -I$(top_srcdir)/include/X11 \ -I$(top_srcdir)/include/X11/extensions \ $(XSCRNSAVER_CFLAGS) \ $(MALLOC_ZERO_CFLAGS) \ $(CWARNFLAGS) lib_LTLIBRARIES = libXss.la libXss_la_SOURCES = \ XScrnSaver.c libXss_la_LIBADD = $(XSCRNSAVER_LIBS) libXss_la_LDFLAGS = -version-info 1:0:0 -no-undefined libXScrnSaverincludedir = $(includedir)/X11/extensions libXScrnSaverinclude_HEADERS = $(top_srcdir)/include/X11/extensions/scrnsaver.h if LINT ALL_LINT_FLAGS=$(LINT_FLAGS) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) \ $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) lint: $(LINT) $(ALL_LINT_FLAGS) $(libXss_la_SOURCES) endif LINT if MAKE_LINT_LIB lintlibdir = $(libdir) lintlib_DATA = $(LINTLIB) $(LINTLIB): $(libXss_la_SOURCES) $(LINT) -y -oXss -x $(ALL_LINT_FLAGS) $(libXss_la_SOURCES) endif MAKE_LINT_LIB
{ "pile_set_name": "Github" }
/* * Copyright 2017 Netflix, 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.netflix.spinnaker.clouddriver.titus.client; import com.netflix.spinnaker.clouddriver.titus.client.model.JobDescription; public interface TitusJobCustomizer { void customize(JobDescription jobDescription); }
{ "pile_set_name": "Github" }
/* automatically generated by JSCoverage - do not edit */ if (typeof _$jscoverage === 'undefined') _$jscoverage = {}; if (! _$jscoverage['middleware/basicAuth.js']) { _$jscoverage['middleware/basicAuth.js'] = []; _$jscoverage['middleware/basicAuth.js'][13] = 0; _$jscoverage['middleware/basicAuth.js'][48] = 0; _$jscoverage['middleware/basicAuth.js'][49] = 0; _$jscoverage['middleware/basicAuth.js'][52] = 0; _$jscoverage['middleware/basicAuth.js'][53] = 0; _$jscoverage['middleware/basicAuth.js'][54] = 0; _$jscoverage['middleware/basicAuth.js'][55] = 0; _$jscoverage['middleware/basicAuth.js'][56] = 0; _$jscoverage['middleware/basicAuth.js'][57] = 0; _$jscoverage['middleware/basicAuth.js'][58] = 0; _$jscoverage['middleware/basicAuth.js'][62] = 0; _$jscoverage['middleware/basicAuth.js'][64] = 0; _$jscoverage['middleware/basicAuth.js'][65] = 0; _$jscoverage['middleware/basicAuth.js'][67] = 0; _$jscoverage['middleware/basicAuth.js'][68] = 0; _$jscoverage['middleware/basicAuth.js'][70] = 0; _$jscoverage['middleware/basicAuth.js'][72] = 0; _$jscoverage['middleware/basicAuth.js'][74] = 0; _$jscoverage['middleware/basicAuth.js'][78] = 0; _$jscoverage['middleware/basicAuth.js'][80] = 0; _$jscoverage['middleware/basicAuth.js'][84] = 0; _$jscoverage['middleware/basicAuth.js'][85] = 0; _$jscoverage['middleware/basicAuth.js'][86] = 0; _$jscoverage['middleware/basicAuth.js'][87] = 0; _$jscoverage['middleware/basicAuth.js'][88] = 0; _$jscoverage['middleware/basicAuth.js'][89] = 0; _$jscoverage['middleware/basicAuth.js'][90] = 0; _$jscoverage['middleware/basicAuth.js'][94] = 0; _$jscoverage['middleware/basicAuth.js'][95] = 0; _$jscoverage['middleware/basicAuth.js'][96] = 0; _$jscoverage['middleware/basicAuth.js'][98] = 0; } _$jscoverage['middleware/basicAuth.js'][13]++; var utils = require("../utils"), unauthorized = utils.unauthorized; _$jscoverage['middleware/basicAuth.js'][48]++; module.exports = (function basicAuth(callback, realm) { _$jscoverage['middleware/basicAuth.js'][49]++; var username, password; _$jscoverage['middleware/basicAuth.js'][52]++; if ("string" == typeof callback) { _$jscoverage['middleware/basicAuth.js'][53]++; username = callback; _$jscoverage['middleware/basicAuth.js'][54]++; password = realm; _$jscoverage['middleware/basicAuth.js'][55]++; if ("string" != typeof password) { _$jscoverage['middleware/basicAuth.js'][55]++; throw new Error("password argument required"); } _$jscoverage['middleware/basicAuth.js'][56]++; realm = arguments[2]; _$jscoverage['middleware/basicAuth.js'][57]++; callback = (function (user, pass) { _$jscoverage['middleware/basicAuth.js'][58]++; return user == username && pass == password; }); } _$jscoverage['middleware/basicAuth.js'][62]++; realm = realm || "Authorization Required"; _$jscoverage['middleware/basicAuth.js'][64]++; return (function (req, res, next) { _$jscoverage['middleware/basicAuth.js'][65]++; var authorization = req.headers.authorization; _$jscoverage['middleware/basicAuth.js'][67]++; if (req.user) { _$jscoverage['middleware/basicAuth.js'][67]++; return next(); } _$jscoverage['middleware/basicAuth.js'][68]++; if (! authorization) { _$jscoverage['middleware/basicAuth.js'][68]++; return unauthorized(res, realm); } _$jscoverage['middleware/basicAuth.js'][70]++; var parts = authorization.split(" "); _$jscoverage['middleware/basicAuth.js'][72]++; if (parts.length !== 2) { _$jscoverage['middleware/basicAuth.js'][72]++; return next(utils.error(400)); } _$jscoverage['middleware/basicAuth.js'][74]++; var scheme = parts[0], credentials = new Buffer(parts[1], "base64").toString(), index = credentials.indexOf(":"); _$jscoverage['middleware/basicAuth.js'][78]++; if ("Basic" != scheme || index < 0) { _$jscoverage['middleware/basicAuth.js'][78]++; return next(utils.error(400)); } _$jscoverage['middleware/basicAuth.js'][80]++; var user = credentials.slice(0, index), pass = credentials.slice(index + 1); _$jscoverage['middleware/basicAuth.js'][84]++; if (callback.length >= 3) { _$jscoverage['middleware/basicAuth.js'][85]++; var pause = utils.pause(req); _$jscoverage['middleware/basicAuth.js'][86]++; callback(user, pass, (function (err, user) { _$jscoverage['middleware/basicAuth.js'][87]++; if (err || ! user) { _$jscoverage['middleware/basicAuth.js'][87]++; return unauthorized(res, realm); } _$jscoverage['middleware/basicAuth.js'][88]++; req.user = req.remoteUser = user; _$jscoverage['middleware/basicAuth.js'][89]++; next(); _$jscoverage['middleware/basicAuth.js'][90]++; pause.resume(); })); } else { _$jscoverage['middleware/basicAuth.js'][94]++; if (callback(user, pass)) { _$jscoverage['middleware/basicAuth.js'][95]++; req.user = req.remoteUser = user; _$jscoverage['middleware/basicAuth.js'][96]++; next(); } else { _$jscoverage['middleware/basicAuth.js'][98]++; unauthorized(res, realm); } } }); }); _$jscoverage['middleware/basicAuth.js'].source = ["","/*!"," * Connect - basicAuth"," * Copyright(c) 2010 Sencha Inc."," * Copyright(c) 2011 TJ Holowaychuk"," * MIT Licensed"," */","","/**"," * Module dependencies."," */","","var utils = require('../utils')"," , unauthorized = utils.unauthorized;","","/**"," * Basic Auth:"," *"," * Enfore basic authentication by providing a `callback(user, pass)`,"," * which must return `true` in order to gain access. Alternatively an async"," * method is provided as well, invoking `callback(user, pass, callback)`. Populates"," * `req.user`. The final alternative is simply passing username / password"," * strings."," *"," * Simple username and password"," *"," * connect(connect.basicAuth('username', 'password'));"," *"," * Callback verification"," *"," * connect()"," * .use(connect.basicAuth(function(user, pass){"," * return 'tj' == user &amp; 'wahoo' == pass;"," * }))"," *"," * Async callback verification, accepting `fn(err, user)`."," *"," * connect()"," * .use(connect.basicAuth(function(user, pass, fn){"," * User.authenticate({ user: user, pass: pass }, fn);"," * }))"," *"," * @param {Function|String} callback or username"," * @param {String} realm"," * @api public"," */","","module.exports = function basicAuth(callback, realm) {"," var username, password;",""," // user / pass strings"," if ('string' == typeof callback) {"," username = callback;"," password = realm;"," if ('string' != typeof password) throw new Error('password argument required');"," realm = arguments[2];"," callback = function(user, pass){"," return user == username &amp;&amp; pass == password;"," }"," }",""," realm = realm || 'Authorization Required';",""," return function(req, res, next) {"," var authorization = req.headers.authorization;",""," if (req.user) return next();"," if (!authorization) return unauthorized(res, realm);",""," var parts = authorization.split(' ');",""," if (parts.length !== 2) return next(utils.error(400));",""," var scheme = parts[0]"," , credentials = new Buffer(parts[1], 'base64').toString()"," , index = credentials.indexOf(':');",""," if ('Basic' != scheme || index &lt; 0) return next(utils.error(400));"," "," var user = credentials.slice(0, index)"," , pass = credentials.slice(index + 1);",""," // async"," if (callback.length &gt;= 3) {"," var pause = utils.pause(req);"," callback(user, pass, function(err, user){"," if (err || !user) return unauthorized(res, realm);"," req.user = req.remoteUser = user;"," next();"," pause.resume();"," });"," // sync"," } else {"," if (callback(user, pass)) {"," req.user = req.remoteUser = user;"," next();"," } else {"," unauthorized(res, realm);"," }"," }"," }","};",""];
{ "pile_set_name": "Github" }
# /etc/ipsec.secrets - strongSwan IPsec secrets file : RSA moonKey.pem
{ "pile_set_name": "Github" }
/** * Copyright (C) 2014-2017 Xavier Witdouck * * 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.zavtech.morpheus.array.sparse; import java.io.IOException; import java.io.ObjectInputStream; import java.io.ObjectOutputStream; import java.time.Instant; import java.time.ZoneId; import java.time.ZonedDateTime; import java.util.HashMap; import java.util.Map; import java.util.function.Predicate; import gnu.trove.map.TIntLongMap; import gnu.trove.map.TIntShortMap; import gnu.trove.map.hash.TIntLongHashMap; import gnu.trove.map.hash.TIntShortHashMap; import com.zavtech.morpheus.array.Array; import com.zavtech.morpheus.array.ArrayBase; import com.zavtech.morpheus.array.ArrayCursor; import com.zavtech.morpheus.array.ArrayException; import com.zavtech.morpheus.array.ArrayStyle; import com.zavtech.morpheus.array.ArrayValue; /** * An Array implementation containing a sparse array of LocalDateTine values stored as a long of epoch milliseconds. * * <p><strong>This is open source software released under the <a href="http://www.apache.org/licenses/LICENSE-2.0">Apache 2.0 License</a></strong></p> * * @author Xavier Witdouck */ class SparseArrayOfZonedDateTimes extends ArrayBase<ZonedDateTime> { private static final long serialVersionUID = 1L; private static final Map<ZoneId,Short> zoneIdMap1 = new HashMap<>(); private static final Map<Short,ZoneId> zoneIdMap2 = new HashMap<>(); /** * Static initializer */ static { short counter = 0; for (String key: ZoneId.getAvailableZoneIds()) { final short index = ++counter; final ZoneId zoneId = ZoneId.of(key); zoneIdMap1.put(zoneId, index); zoneIdMap2.put(index, zoneId); } } private static final long nullValue = Long.MIN_VALUE; private static final short NULL_ZONE = -1; private static final short UTC_ZONE = zoneIdMap1.get(ZoneId.of("UTC")); private int length; private TIntLongMap values; private TIntShortMap zoneIds; private ZonedDateTime defaultValue; private final short defaultZoneId; private long defaultValueAsLong; /** * Constructor * @param length the length for this array */ SparseArrayOfZonedDateTimes(int length, ZonedDateTime defaultValue) { super(ZonedDateTime.class, ArrayStyle.SPARSE, false); this.length = length; this.defaultValue = defaultValue; this.defaultValueAsLong = defaultValue != null ? defaultValue.toInstant().toEpochMilli() : nullValue; this.defaultZoneId = defaultValue != null ? zoneIdMap1.get(defaultValue.getZone()) : NULL_ZONE; this.values = new TIntLongHashMap((int)Math.max(length * 0.5, 10d), 0.8f, -1, defaultValueAsLong); this.zoneIds = new TIntShortHashMap((int)Math.max(length * 0.5, 10d), 0.8f, -1, defaultZoneId); } /** * Constructor * @param source the source array to shallow copy * @param parallel true for the parallel version */ private SparseArrayOfZonedDateTimes(SparseArrayOfZonedDateTimes source, boolean parallel) { super(source.type(), ArrayStyle.SPARSE, parallel); this.length = source.length; this.defaultValue = source.defaultValue; this.defaultValueAsLong = source.defaultValueAsLong; this.defaultZoneId = source.defaultZoneId; this.values = source.values; this.zoneIds = source.zoneIds; } @Override public final int length() { return length; } @Override() public final float loadFactor() { return (float)values.size() / (float)length(); } @Override public final ZonedDateTime defaultValue() { return defaultValue; } @Override public final Array<ZonedDateTime> parallel() { return isParallel() ? this : new SparseArrayOfZonedDateTimes(this, true); } @Override public final Array<ZonedDateTime> sequential() { return isParallel() ? new SparseArrayOfZonedDateTimes(this, false) : this; } @Override() public final Array<ZonedDateTime> copy() { try { final SparseArrayOfZonedDateTimes copy = (SparseArrayOfZonedDateTimes)super.clone(); copy.values = new TIntLongHashMap(values); copy.zoneIds = new TIntShortHashMap(zoneIds); copy.defaultValue = this.defaultValue; copy.defaultValueAsLong = this.defaultValueAsLong; return copy; } catch (Exception ex) { throw new ArrayException("Failed to copy Array: " + this, ex); } } @Override() public final Array<ZonedDateTime> copy(int[] indexes) { final SparseArrayOfZonedDateTimes clone = new SparseArrayOfZonedDateTimes(indexes.length, defaultValue); for (int i = 0; i < indexes.length; ++i) { final long value = getLong(indexes[i]); if (value != defaultValueAsLong) { clone.values.put(i, value); clone.zoneIds.put(i, this.zoneIds.get(i)); } } return clone; } @Override() public final Array<ZonedDateTime> copy(int start, int end) { final int length = end - start; final SparseArrayOfZonedDateTimes clone = new SparseArrayOfZonedDateTimes(length, defaultValue); for (int i=0; i<length; ++i) { final long value = getLong(start+i); if (value != defaultValueAsLong) { final short zoneId = zoneIds.get(start+i); clone.setLong(i, value); clone.zoneIds.put(i, zoneId); } } return clone; } @Override protected final Array<ZonedDateTime> sort(int start, int end, int multiplier) { return doSort(start, end, (i, j) -> { final long v1 = values.get(i); final long v2 = values.get(j); return multiplier * Long.compare(v1, v2); }); } @Override public final int compare(int i, int j) { return Long.compare(values.get(i), values.get(j)); } @Override public final Array<ZonedDateTime> swap(int i, int j) { final long v1 = values.get(i); final long v2 = values.get(j); final short z1 = zoneIds.get(i); final short z2 = zoneIds.get(j); if (v1 == defaultValueAsLong) { this.values.remove(j); this.zoneIds.remove(j); } else { this.values.put(j, v1); this.zoneIds.put(j, z1); } if (v2 == defaultValueAsLong) { this.values.remove(i); this.zoneIds.remove(i); } else { this.values.put(i, v2); this.zoneIds.put(i, z2); } return this; } @Override public final Array<ZonedDateTime> filter(Predicate<ArrayValue<ZonedDateTime>> predicate) { int count = 0; final int length = this.length(); final ArrayCursor<ZonedDateTime> cursor = cursor(); final Array<ZonedDateTime> matches = Array.of(type(), length, loadFactor()); for (int i=0; i<length; ++i) { cursor.moveTo(i); final boolean match = predicate.test(cursor); if (match) matches.setValue(count++, cursor.getValue()); } return count == length ? matches : matches.copy(0, count); } @Override public final Array<ZonedDateTime> update(Array<ZonedDateTime> from, int[] fromIndexes, int[] toIndexes) { if (fromIndexes.length != toIndexes.length) { throw new ArrayException("The from index array must have the same length as the to index array"); } else { for (int i=0; i<fromIndexes.length; ++i) { final int toIndex = toIndexes[i]; final int fromIndex = fromIndexes[i]; final ZonedDateTime update = from.getValue(fromIndex); this.setValue(toIndex, update); } } return this; } @Override public final Array<ZonedDateTime> update(int toIndex, Array<ZonedDateTime> from, int fromIndex, int length) { if (from instanceof SparseArrayOfZonedDateTimes) { final SparseArrayOfZonedDateTimes other = (SparseArrayOfZonedDateTimes)from; for (int i=0; i<length; ++i) { this.values.put(toIndex + i, other.values.get(fromIndex + i)); this.zoneIds.put(toIndex + i, other.zoneIds.get(fromIndex + i)); } } else { for (int i=0; i<length; ++i) { final ZonedDateTime update = from.getValue(fromIndex + i); this.setValue(toIndex + i, update); } } return this; } @Override public final Array<ZonedDateTime> expand(int newLength) { this.length = newLength > length ? newLength : length; return this; } @Override public Array<ZonedDateTime> fill(ZonedDateTime value, int start, int end) { final long fillValue = value != null ? value.toInstant().toEpochMilli() : nullValue; if (fillValue == defaultValueAsLong) { this.values.clear(); this.zoneIds.clear(); } else { final short fillZoneId = value != null ? zoneIdMap1.get(value.getZone()) : NULL_ZONE; for (int i=start; i<end; ++i) { this.values.put(i, fillValue); this.zoneIds.put(i, fillZoneId); } } return this; } @Override public boolean isNull(int index) { return values.get(index) == nullValue; } @Override public final boolean isEqualTo(int index, ZonedDateTime value) { if (value == null) { return isNull(index); } else { final long epochMills = value.toInstant().toEpochMilli(); if (epochMills != values.get(index)) { return false; } else { final ZoneId zoneId = value.getZone(); final short code1 = zoneIdMap1.get(zoneId); final short code2 = zoneIds.get(index); return code1 == code2; } } } @Override public final long getLong(int index) { this.checkBounds(index, length); return values.get(index); } @Override public final ZonedDateTime getValue(int index) { this.checkBounds(index, length); final long value = values.get(index); if (value == nullValue) { return null; } else { final ZoneId zone = zoneIdMap2.get(zoneIds.get(index)); final Instant instant = Instant.ofEpochMilli(value); return ZonedDateTime.ofInstant(instant, zone); } } @Override public final long setLong(int index, long value) { this.checkBounds(index, length); final long oldValue = getLong(index); if (value == defaultValueAsLong) { this.values.remove(index); this.zoneIds.remove(index); return oldValue; } else { final short zoneId = zoneIds.get(index); this.values.put(index, value); this.zoneIds.put(index, zoneId != NULL_ZONE ? zoneId : UTC_ZONE); return oldValue; } } @Override public final ZonedDateTime setValue(int index, ZonedDateTime value) { this.checkBounds(index, length); final ZonedDateTime oldValue = getValue(index); final long valueAsLong = value == null ? nullValue : value.toInstant().toEpochMilli(); if (valueAsLong == defaultValueAsLong) { this.values.remove(index); this.zoneIds.remove(index); return oldValue; } else { final short zoneId = value == null ? NULL_ZONE : zoneIdMap1.get(value.getZone()); this.values.put(index, valueAsLong); this.zoneIds.put(index, zoneId); return oldValue; } } @Override public int binarySearch(int start, int end, ZonedDateTime value) { int low = start; int high = end - 1; final long valueAsLong = value.toInstant().toEpochMilli(); while (low <= high) { final int midIndex = (low + high) >>> 1; final long midValue = getLong(midIndex); final int result = Long.compare(midValue, valueAsLong); if (result < 0) { low = midIndex + 1; } else if (result > 0) { high = midIndex - 1; } else { return midIndex; } } return -(low + 1); } @Override public final void read(ObjectInputStream is, int count) throws IOException { for (int i=0; i<count; ++i) { final long value = is.readLong(); this.values.put(i, value); if (value != defaultValueAsLong) { final short zoneId = is.readShort(); this.zoneIds.put(i, zoneId); } } } @Override public final void write(ObjectOutputStream os, int[] indexes) throws IOException { for (int index : indexes) { final long value = getLong(index); os.writeLong(value); if (value != defaultValueAsLong) { final short zoneId = zoneIds.get(index); os.writeShort(zoneId); } } } }
{ "pile_set_name": "Github" }
node_modules/ bower_components/ .tmp/
{ "pile_set_name": "Github" }
cmake.settings.formatter.spaceBeforeMethodCallParentheses= \u547d\u4ee4\u8c03\u7528\u62ec\u53f7 cmake.settings.formatter.spaceWithinMethodCallParentheses= \u547d\u4ee4\u8c03\u7528\u62ec\u53f7 cmake.settings.formatter.spaceBeforeMethodParentheses= \u547d\u4ee4\u5b9a\u4e49\u62ec\u53f7 cmake.settings.formatter.spaceWithinMethodParentheses= \u547d\u4ee4\u5b9a\u4e49\u62ec\u53f7 cmake.settings.formatter.commandCallArguments= \u547d\u4ee4\u8c03\u7528\u53c2\u6570 cmake.command.name= \u547d\u4ee4 cmake.argument.command.name= \u547d\u4ee4 cmake.search.element= CMake \u5143\u7d20 cmake.var.reference.incorrect=\u53d8\u91cf\u5f15\u7528\u4e0d\u6b63\u786e cmake.var.reference.expected.start=\u53d8\u91cf\u5f15\u7528\u671f\u671b\u4ee5 (''$ {'') \u5f00\u59cb cmake.var.reference.expected.end=\u53d8\u91cf\u5f15\u7528\u671f\u671b\u4ee5 (''{0}'') \u7ed3\u675f cmake.action.newCMakeLists.title= CMakeLists.txt cmake.action.newCMakeLists.error= \u65e0\u6cd5\u521b\u5efa CMakeLists.txt cmake.action.newCMakeLists.error.description= ''CMakeLists.txt'' \u5df2\u5b58\u5728\u4e8e\u76ee\u5f55\u201c{0}\u201d\u4e2d
{ "pile_set_name": "Github" }
// Licensed to the .NET Foundation under one or more agreements. // The .NET Foundation licenses this file to you under the MIT License. // See the LICENSE file in the project root for more information. using System.Collections.Generic; using System.Threading; using System.Threading.Tasks; namespace System.Linq { public static partial class AsyncEnumerableEx { /// <summary> /// Invokes a specified action after the source async-enumerable sequence terminates gracefully or exceptionally. /// </summary> /// <typeparam name="TSource">The type of the elements in the source sequence.</typeparam> /// <param name="source">Source sequence.</param> /// <param name="finallyAction">Action to invoke after the source async-enumerable sequence terminates.</param> /// <returns>Source sequence with the action-invoking termination behavior applied.</returns> /// <exception cref="ArgumentNullException"><paramref name="source"/> or <paramref name="finallyAction"/> is null.</exception> public static IAsyncEnumerable<TSource> Finally<TSource>(this IAsyncEnumerable<TSource> source, Action finallyAction) { if (source == null) throw Error.ArgumentNull(nameof(source)); if (finallyAction == null) throw Error.ArgumentNull(nameof(finallyAction)); return Core(source, finallyAction); static async IAsyncEnumerable<TSource> Core(IAsyncEnumerable<TSource> source, Action finallyAction, [System.Runtime.CompilerServices.EnumeratorCancellation] CancellationToken cancellationToken = default) { try { await foreach (var item in source.WithCancellation(cancellationToken).ConfigureAwait(false)) { yield return item; } } finally { finallyAction(); } } } /// <summary> /// Invokes a specified asynchronous action after the source async-enumerable sequence terminates gracefully or exceptionally. /// </summary> /// <typeparam name="TSource">The type of the elements in the source sequence.</typeparam> /// <param name="source">Source sequence.</param> /// <param name="finallyAction">Action to invoke and await asynchronously after the source async-enumerable sequence terminates.</param> /// <returns>Source sequence with the action-invoking termination behavior applied.</returns> /// <exception cref="ArgumentNullException"><paramref name="source"/> or <paramref name="finallyAction"/> is null.</exception> public static IAsyncEnumerable<TSource> Finally<TSource>(this IAsyncEnumerable<TSource> source, Func<Task> finallyAction) { if (source == null) throw Error.ArgumentNull(nameof(source)); if (finallyAction == null) throw Error.ArgumentNull(nameof(finallyAction)); return Core(source, finallyAction); static async IAsyncEnumerable<TSource> Core(IAsyncEnumerable<TSource> source, Func<Task> finallyAction, [System.Runtime.CompilerServices.EnumeratorCancellation] CancellationToken cancellationToken = default) { try { await foreach (var item in source.WithCancellation(cancellationToken).ConfigureAwait(false)) { yield return item; } } finally { // REVIEW: No cancellation support for finally action. await finallyAction().ConfigureAwait(false); } } } } }
{ "pile_set_name": "Github" }
/* * JPEG-LS common code * Copyright (c) 2003 Michael Niedermayer * Copyright (c) 2006 Konstantin Shishkov * * This file is part of FFmpeg. * * FFmpeg is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2.1 of the License, or (at your option) any later version. * * FFmpeg is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with FFmpeg; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA */ /** * @file * JPEG-LS common code. */ #ifndef AVCODEC_JPEGLS_H #define AVCODEC_JPEGLS_H #include "libavutil/common.h" #include "avcodec.h" #include "internal.h" #undef near /* This file uses struct member 'near' which in windows.h is defined as empty. */ typedef struct JpeglsContext { AVCodecContext *avctx; } JpeglsContext; typedef struct JLSState { int T1, T2, T3; int A[367], B[367], C[365], N[367]; int limit, reset, bpp, qbpp, maxval, range; int near, twonear; int run_index[4]; } JLSState; /** * Calculate initial JPEG-LS parameters */ void ff_jpegls_init_state(JLSState *state); /** * Calculate quantized gradient value, used for context determination */ static inline int ff_jpegls_quantize(JLSState *s, int v) { if (v == 0) return 0; if (v < 0) { if (v <= -s->T3) return -4; if (v <= -s->T2) return -3; if (v <= -s->T1) return -2; if (v < -s->near) return -1; return 0; } else { if (v <= s->near) return 0; if (v < s->T1) return 1; if (v < s->T2) return 2; if (v < s->T3) return 3; return 4; } } /** * Calculate JPEG-LS codec values */ void ff_jpegls_reset_coding_parameters(JLSState *s, int reset_all); static inline void ff_jpegls_downscale_state(JLSState *state, int Q) { if (state->N[Q] == state->reset) { state->A[Q] >>= 1; state->B[Q] >>= 1; state->N[Q] >>= 1; } state->N[Q]++; } static inline int ff_jpegls_update_state_regular(JLSState *state, int Q, int err) { if(FFABS(err) > 0xFFFF) return -0x10000; state->A[Q] += FFABS(err); err *= state->twonear; state->B[Q] += err; ff_jpegls_downscale_state(state, Q); if (state->B[Q] <= -state->N[Q]) { state->B[Q] = FFMAX(state->B[Q] + state->N[Q], 1 - state->N[Q]); if (state->C[Q] > -128) state->C[Q]--; } else if (state->B[Q] > 0) { state->B[Q] = FFMIN(state->B[Q] - state->N[Q], 0); if (state->C[Q] < 127) state->C[Q]++; } return err; } #define R(a, i) (bits == 8 ? ((uint8_t *)(a))[i] : ((uint16_t *)(a))[i]) #define W(a, i, v) (bits == 8 ? (((uint8_t *)(a))[i] = v) : (((uint16_t *)(a))[i] = v)) #endif /* AVCODEC_JPEGLS_H */
{ "pile_set_name": "Github" }
/** * Copyright (C) 2008, Creative Technology Ltd. All Rights Reserved. * * This source file is released under GPL v2 license (no other versions). * See the COPYING file included in the main directory of this source * distribution for the license terms and conditions. * * @File ctresource.c * * @Brief * This file contains the implementation of some generic helper functions. * * @Author Liu Chun * @Date May 15 2008 * */ #include "ctresource.h" #include "cthardware.h" #include <linux/err.h> #include <linux/slab.h> #define AUDIO_SLOT_BLOCK_NUM 256 /* Resource allocation based on bit-map management mechanism */ static int get_resource(u8 *rscs, unsigned int amount, unsigned int multi, unsigned int *ridx) { int i, j, k, n; /* Check whether there are sufficient resources to meet request. */ for (i = 0, n = multi; i < amount; i++) { j = i / 8; k = i % 8; if (rscs[j] & ((u8)1 << k)) { n = multi; continue; } if (!(--n)) break; /* found sufficient contiguous resources */ } if (i >= amount) { /* Can not find sufficient contiguous resources */ return -ENOENT; } /* Mark the contiguous bits in resource bit-map as used */ for (n = multi; n > 0; n--) { j = i / 8; k = i % 8; rscs[j] |= ((u8)1 << k); i--; } *ridx = i + 1; return 0; } static int put_resource(u8 *rscs, unsigned int multi, unsigned int idx) { unsigned int i, j, k, n; /* Mark the contiguous bits in resource bit-map as used */ for (n = multi, i = idx; n > 0; n--) { j = i / 8; k = i % 8; rscs[j] &= ~((u8)1 << k); i++; } return 0; } int mgr_get_resource(struct rsc_mgr *mgr, unsigned int n, unsigned int *ridx) { int err; if (n > mgr->avail) return -ENOENT; err = get_resource(mgr->rscs, mgr->amount, n, ridx); if (!err) mgr->avail -= n; return err; } int mgr_put_resource(struct rsc_mgr *mgr, unsigned int n, unsigned int idx) { put_resource(mgr->rscs, n, idx); mgr->avail += n; return 0; } static unsigned char offset_in_audio_slot_block[NUM_RSCTYP] = { /* SRC channel is at Audio Ring slot 1 every 16 slots. */ [SRC] = 0x1, [AMIXER] = 0x4, [SUM] = 0xc, }; static int rsc_index(const struct rsc *rsc) { return rsc->conj; } static int audio_ring_slot(const struct rsc *rsc) { return (rsc->conj << 4) + offset_in_audio_slot_block[rsc->type]; } static int rsc_next_conj(struct rsc *rsc) { unsigned int i; for (i = 0; (i < 8) && (!(rsc->msr & (0x1 << i))); ) i++; rsc->conj += (AUDIO_SLOT_BLOCK_NUM >> i); return rsc->conj; } static int rsc_master(struct rsc *rsc) { return rsc->conj = rsc->idx; } static const struct rsc_ops rsc_generic_ops = { .index = rsc_index, .output_slot = audio_ring_slot, .master = rsc_master, .next_conj = rsc_next_conj, }; int rsc_init(struct rsc *rsc, u32 idx, enum RSCTYP type, u32 msr, struct hw *hw) { int err = 0; rsc->idx = idx; rsc->conj = idx; rsc->type = type; rsc->msr = msr; rsc->hw = hw; rsc->ops = &rsc_generic_ops; if (!hw) { rsc->ctrl_blk = NULL; return 0; } switch (type) { case SRC: err = hw->src_rsc_get_ctrl_blk(&rsc->ctrl_blk); break; case AMIXER: err = hw->amixer_rsc_get_ctrl_blk(&rsc->ctrl_blk); break; case SRCIMP: case SUM: case DAIO: break; default: dev_err(((struct hw *)hw)->card->dev, "Invalid resource type value %d!\n", type); return -EINVAL; } if (err) { dev_err(((struct hw *)hw)->card->dev, "Failed to get resource control block!\n"); return err; } return 0; } int rsc_uninit(struct rsc *rsc) { if ((NULL != rsc->hw) && (NULL != rsc->ctrl_blk)) { switch (rsc->type) { case SRC: rsc->hw->src_rsc_put_ctrl_blk(rsc->ctrl_blk); break; case AMIXER: rsc->hw->amixer_rsc_put_ctrl_blk(rsc->ctrl_blk); break; case SUM: case DAIO: break; default: dev_err(((struct hw *)rsc->hw)->card->dev, "Invalid resource type value %d!\n", rsc->type); break; } rsc->hw = rsc->ctrl_blk = NULL; } rsc->idx = rsc->conj = 0; rsc->type = NUM_RSCTYP; rsc->msr = 0; return 0; } int rsc_mgr_init(struct rsc_mgr *mgr, enum RSCTYP type, unsigned int amount, struct hw *hw) { int err = 0; mgr->type = NUM_RSCTYP; mgr->rscs = kzalloc(((amount + 8 - 1) / 8), GFP_KERNEL); if (!mgr->rscs) return -ENOMEM; switch (type) { case SRC: err = hw->src_mgr_get_ctrl_blk(&mgr->ctrl_blk); break; case SRCIMP: err = hw->srcimp_mgr_get_ctrl_blk(&mgr->ctrl_blk); break; case AMIXER: err = hw->amixer_mgr_get_ctrl_blk(&mgr->ctrl_blk); break; case DAIO: err = hw->daio_mgr_get_ctrl_blk(hw, &mgr->ctrl_blk); break; case SUM: break; default: dev_err(hw->card->dev, "Invalid resource type value %d!\n", type); err = -EINVAL; goto error; } if (err) { dev_err(hw->card->dev, "Failed to get manager control block!\n"); goto error; } mgr->type = type; mgr->avail = mgr->amount = amount; mgr->hw = hw; return 0; error: kfree(mgr->rscs); return err; } int rsc_mgr_uninit(struct rsc_mgr *mgr) { if (NULL != mgr->rscs) { kfree(mgr->rscs); mgr->rscs = NULL; } if ((NULL != mgr->hw) && (NULL != mgr->ctrl_blk)) { switch (mgr->type) { case SRC: mgr->hw->src_mgr_put_ctrl_blk(mgr->ctrl_blk); break; case SRCIMP: mgr->hw->srcimp_mgr_put_ctrl_blk(mgr->ctrl_blk); break; case AMIXER: mgr->hw->amixer_mgr_put_ctrl_blk(mgr->ctrl_blk); break; case DAIO: mgr->hw->daio_mgr_put_ctrl_blk(mgr->ctrl_blk); break; case SUM: break; default: dev_err(((struct hw *)mgr->hw)->card->dev, "Invalid resource type value %d!\n", mgr->type); break; } mgr->hw = mgr->ctrl_blk = NULL; } mgr->type = NUM_RSCTYP; mgr->avail = mgr->amount = 0; return 0; }
{ "pile_set_name": "Github" }
package cn.iocoder.mall.system.biz.bo.smsSign; import com.fasterxml.jackson.annotation.JsonFormat; import lombok.Data; import lombok.experimental.Accessors; import java.util.Date; /** * sms page * * @author Sin * @time 2019/5/19 4:23 PM */ @Data @Accessors(chain = true) public class ListSmsSignBO { /** * 编号 */ private Integer id; /** * 短信平台 */ private Integer platform; /** * 签名名称 */ private String sign; /** * 审核状态 * <p> * - 1、审核中 * - 2、审核成功 * - 3、审核失败 */ private Integer applyStatus; /** * 审核信息 */ private String applyMessage; /** * 更新时间 */ @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8") private Date updateTime; /** * 创建时间 */ @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8") private Date createTime; }
{ "pile_set_name": "Github" }
import * as React from 'react'; import { createSvgIcon } from '../utils/createSvgIcon'; export const FilesAftereffectsIcon = createSvgIcon({ svg: ({ classes }) => ( <svg role="presentation" focusable="false" viewBox="8 8 16 16" className={classes.svg}> <g> <path d="M20.5 8H15c-.4 0-.777.156-1.083.463l-3.478 3.968c-.283.283-.439.66-.439 1.06V22.5c0 .827.673 1.5 1.5 1.5h9c.827 0 1.5-.673 1.5-1.5v-13c0-.827-.673-1.5-1.5-1.5zm-6.514 1.9V13h-2.718l2.718-3.1zM21 22.5a.5.5 0 0 1-.5.5h-9a.5.5 0 0 1-.5-.5V14h3.986V9.003c.005 0 .01-.003.014-.003h5.5a.5.5 0 0 1 .5.5v13zM14.011 16l-1.261 3.936h.742l.338-1.116h1.25l.356 1.116h.77L14.929 16h-.917zm-.064 2.277l.304-.969c.07-.234.128-.508.187-.736h.011c.059.228.123.497.199.736l.31.97h-1.01zm3.913-1.25c-.911 0-1.39.742-1.39 1.53 0 .87.543 1.443 1.465 1.443.41 0 .748-.082.993-.181l-.105-.496a2.136 2.136 0 0 1-.788.128c-.456 0-.859-.222-.876-.736h1.903c.012-.064.024-.17.024-.303 0-.625-.298-1.384-1.226-1.384zm-.701 1.186c.029-.292.216-.695.66-.695.479 0 .595.432.59.695h-1.25z" /> </g> </svg> ), displayName: 'FilesAftereffectsIcon', });
{ "pile_set_name": "Github" }
/****************************************************************************** * * (C)Copyright 1998,1999 SysKonnect, * a business unit of Schneider & Koch & Co. Datensysteme GmbH. * * 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. * * The information in this file is provided "AS IS" without warranty. * ******************************************************************************/ /* * defines for all SMT attributes */ /* * this boring file was produced by perl * thanks Larry ! */ #define SMT_P0012 0x0012 #define SMT_P0015 0x0015 #define SMT_P0016 0x0016 #define SMT_P0017 0x0017 #define SMT_P0018 0x0018 #define SMT_P0019 0x0019 #define SMT_P001A 0x001a #define SMT_P001B 0x001b #define SMT_P001C 0x001c #define SMT_P001D 0x001d #define SMT_P100A 0x100a #define SMT_P100B 0x100b #define SMT_P100C 0x100c #define SMT_P100D 0x100d #define SMT_P100E 0x100e #define SMT_P100F 0x100f #define SMT_P1010 0x1010 #define SMT_P1011 0x1011 #define SMT_P1012 0x1012 #define SMT_P1013 0x1013 #define SMT_P1014 0x1014 #define SMT_P1015 0x1015 #define SMT_P1016 0x1016 #define SMT_P1017 0x1017 #define SMT_P1018 0x1018 #define SMT_P1019 0x1019 #define SMT_P101A 0x101a #define SMT_P101B 0x101b #define SMT_P101C 0x101c #define SMT_P101D 0x101d #define SMT_P101E 0x101e #define SMT_P101F 0x101f #define SMT_P1020 0x1020 #define SMT_P1021 0x1021 #define SMT_P1022 0x1022 #define SMT_P1023 0x1023 #define SMT_P1024 0x1024 #define SMT_P1025 0x1025 #define SMT_P1026 0x1026 #define SMT_P1027 0x1027 #define SMT_P1028 0x1028 #define SMT_P1029 0x1029 #define SMT_P102A 0x102a #define SMT_P102B 0x102b #define SMT_P102C 0x102c #define SMT_P102D 0x102d #define SMT_P102E 0x102e #define SMT_P102F 0x102f #define SMT_P1030 0x1030 #define SMT_P1031 0x1031 #define SMT_P1032 0x1032 #define SMT_P1033 0x1033 #define SMT_P1034 0x1034 #define SMT_P1035 0x1035 #define SMT_P1036 0x1036 #define SMT_P1037 0x1037 #define SMT_P1038 0x1038 #define SMT_P1039 0x1039 #define SMT_P103A 0x103a #define SMT_P103B 0x103b #define SMT_P103C 0x103c #define SMT_P103D 0x103d #define SMT_P103E 0x103e #define SMT_P103F 0x103f #define SMT_P1040 0x1040 #define SMT_P1041 0x1041 #define SMT_P1042 0x1042 #define SMT_P1043 0x1043 #define SMT_P1044 0x1044 #define SMT_P1045 0x1045 #define SMT_P1046 0x1046 #define SMT_P1047 0x1047 #define SMT_P1048 0x1048 #define SMT_P1049 0x1049 #define SMT_P104A 0x104a #define SMT_P104B 0x104b #define SMT_P104C 0x104c #define SMT_P104D 0x104d #define SMT_P104E 0x104e #define SMT_P104F 0x104f #define SMT_P1050 0x1050 #define SMT_P1051 0x1051 #define SMT_P1052 0x1052 #define SMT_P1053 0x1053 #define SMT_P1054 0x1054 #define SMT_P10F0 0x10f0 #define SMT_P10F1 0x10f1 #ifdef ESS #define SMT_P10F2 0x10f2 #define SMT_P10F3 0x10f3 #define SMT_P10F4 0x10f4 #define SMT_P10F5 0x10f5 #define SMT_P10F6 0x10f6 #define SMT_P10F7 0x10f7 #endif #ifdef SBA #define SMT_P10F8 0x10f8 #define SMT_P10F9 0x10f9 #endif #define SMT_P200A 0x200a #define SMT_P200B 0x200b #define SMT_P200C 0x200c #define SMT_P200D 0x200d #define SMT_P200E 0x200e #define SMT_P200F 0x200f #define SMT_P2010 0x2010 #define SMT_P2011 0x2011 #define SMT_P2012 0x2012 #define SMT_P2013 0x2013 #define SMT_P2014 0x2014 #define SMT_P2015 0x2015 #define SMT_P2016 0x2016 #define SMT_P2017 0x2017 #define SMT_P2018 0x2018 #define SMT_P2019 0x2019 #define SMT_P201A 0x201a #define SMT_P201B 0x201b #define SMT_P201C 0x201c #define SMT_P201D 0x201d #define SMT_P201E 0x201e #define SMT_P201F 0x201f #define SMT_P2020 0x2020 #define SMT_P2021 0x2021 #define SMT_P2022 0x2022 #define SMT_P2023 0x2023 #define SMT_P2024 0x2024 #define SMT_P2025 0x2025 #define SMT_P2026 0x2026 #define SMT_P2027 0x2027 #define SMT_P2028 0x2028 #define SMT_P2029 0x2029 #define SMT_P202A 0x202a #define SMT_P202B 0x202b #define SMT_P202C 0x202c #define SMT_P202D 0x202d #define SMT_P202E 0x202e #define SMT_P202F 0x202f #define SMT_P2030 0x2030 #define SMT_P2031 0x2031 #define SMT_P2032 0x2032 #define SMT_P2033 0x2033 #define SMT_P2034 0x2034 #define SMT_P2035 0x2035 #define SMT_P2036 0x2036 #define SMT_P2037 0x2037 #define SMT_P2038 0x2038 #define SMT_P2039 0x2039 #define SMT_P203A 0x203a #define SMT_P203B 0x203b #define SMT_P203C 0x203c #define SMT_P203D 0x203d #define SMT_P203E 0x203e #define SMT_P203F 0x203f #define SMT_P2040 0x2040 #define SMT_P2041 0x2041 #define SMT_P2042 0x2042 #define SMT_P2043 0x2043 #define SMT_P2044 0x2044 #define SMT_P2045 0x2045 #define SMT_P2046 0x2046 #define SMT_P2047 0x2047 #define SMT_P2048 0x2048 #define SMT_P2049 0x2049 #define SMT_P204A 0x204a #define SMT_P204B 0x204b #define SMT_P204C 0x204c #define SMT_P204D 0x204d #define SMT_P204E 0x204e #define SMT_P204F 0x204f #define SMT_P2050 0x2050 #define SMT_P2051 0x2051 #define SMT_P2052 0x2052 #define SMT_P2053 0x2053 #define SMT_P2054 0x2054 #define SMT_P2055 0x2055 #define SMT_P2056 0x2056 #define SMT_P2057 0x2057 #define SMT_P2058 0x2058 #define SMT_P2059 0x2059 #define SMT_P205A 0x205a #define SMT_P205B 0x205b #define SMT_P205C 0x205c #define SMT_P205D 0x205d #define SMT_P205E 0x205e #define SMT_P205F 0x205f #define SMT_P2060 0x2060 #define SMT_P2061 0x2061 #define SMT_P2062 0x2062 #define SMT_P2063 0x2063 #define SMT_P2064 0x2064 #define SMT_P2065 0x2065 #define SMT_P2066 0x2066 #define SMT_P2067 0x2067 #define SMT_P2068 0x2068 #define SMT_P2069 0x2069 #define SMT_P206A 0x206a #define SMT_P206B 0x206b #define SMT_P206C 0x206c #define SMT_P206D 0x206d #define SMT_P206E 0x206e #define SMT_P206F 0x206f #define SMT_P2070 0x2070 #define SMT_P2071 0x2071 #define SMT_P2072 0x2072 #define SMT_P2073 0x2073 #define SMT_P2074 0x2074 #define SMT_P2075 0x2075 #define SMT_P2076 0x2076 #define SMT_P208C 0x208c #define SMT_P208D 0x208d #define SMT_P208E 0x208e #define SMT_P208F 0x208f #define SMT_P2090 0x2090 #define SMT_P20F0 0x20F0 #define SMT_P20F1 0x20F1 #define SMT_P320A 0x320a #define SMT_P320B 0x320b #define SMT_P320C 0x320c #define SMT_P320D 0x320d #define SMT_P320E 0x320e #define SMT_P320F 0x320f #define SMT_P3210 0x3210 #define SMT_P3211 0x3211 #define SMT_P3212 0x3212 #define SMT_P3213 0x3213 #define SMT_P3214 0x3214 #define SMT_P3215 0x3215 #define SMT_P3216 0x3216 #define SMT_P3217 0x3217 #define SMT_P400A 0x400a #define SMT_P400B 0x400b #define SMT_P400C 0x400c #define SMT_P400D 0x400d #define SMT_P400E 0x400e #define SMT_P400F 0x400f #define SMT_P4010 0x4010 #define SMT_P4011 0x4011 #define SMT_P4012 0x4012 #define SMT_P4013 0x4013 #define SMT_P4014 0x4014 #define SMT_P4015 0x4015 #define SMT_P4016 0x4016 #define SMT_P4017 0x4017 #define SMT_P4018 0x4018 #define SMT_P4019 0x4019 #define SMT_P401A 0x401a #define SMT_P401B 0x401b #define SMT_P401C 0x401c #define SMT_P401D 0x401d #define SMT_P401E 0x401e #define SMT_P401F 0x401f #define SMT_P4020 0x4020 #define SMT_P4021 0x4021 #define SMT_P4022 0x4022 #define SMT_P4023 0x4023 #define SMT_P4024 0x4024 #define SMT_P4025 0x4025 #define SMT_P4026 0x4026 #define SMT_P4027 0x4027 #define SMT_P4028 0x4028 #define SMT_P4029 0x4029 #define SMT_P402A 0x402a #define SMT_P402B 0x402b #define SMT_P402C 0x402c #define SMT_P402D 0x402d #define SMT_P402E 0x402e #define SMT_P402F 0x402f #define SMT_P4030 0x4030 #define SMT_P4031 0x4031 #define SMT_P4032 0x4032 #define SMT_P4033 0x4033 #define SMT_P4034 0x4034 #define SMT_P4035 0x4035 #define SMT_P4036 0x4036 #define SMT_P4037 0x4037 #define SMT_P4038 0x4038 #define SMT_P4039 0x4039 #define SMT_P403A 0x403a #define SMT_P403B 0x403b #define SMT_P403C 0x403c #define SMT_P403D 0x403d #define SMT_P403E 0x403e #define SMT_P403F 0x403f #define SMT_P4040 0x4040 #define SMT_P4041 0x4041 #define SMT_P4042 0x4042 #define SMT_P4043 0x4043 #define SMT_P4044 0x4044 #define SMT_P4045 0x4045 #define SMT_P4046 0x4046 #define SMT_P4050 0x4050 #define SMT_P4051 0x4051 #define SMT_P4052 0x4052 #define SMT_P4053 0x4053
{ "pile_set_name": "Github" }
import heterocl as hcl def test_ap_int(): hcl.init(); A = hcl.placeholder((1, 32), dtype=hcl.Int(3)) B = hcl.placeholder((1, 32), dtype=hcl.UInt(3)) C = hcl.compute(A.shape, lambda i, j: A[i][j] + B[i][j], dtype=hcl.Int(8)) s = hcl.create_schedule([A, B, C]) code = hcl.build(s, target='aocl') assert "ap_int<3>" in code assert "ap_uint<3>" in code assert "int8" in code def test_pragma(): hcl.init() A = hcl.placeholder((10, 32), "A") B = hcl.placeholder((10, 32)) C = hcl.compute(A.shape, lambda i, j: A[i][j] + B[i][j]) # unroll s1 = hcl.create_schedule([A, B, C]) s1[C].unroll(C.axis[1], factor=4) code1 = hcl.build(s1, target='aocl') assert "#pragma unroll 4" in code1 # pipeline s2 = hcl.create_schedule([A, B, C]) s2[C].pipeline(C.axis[0], initiation_interval=2) code2 = hcl.build(s2, target='aocl') assert "#pragma ii 2" in code2 def test_reorder(): hcl.init() A = hcl.placeholder((10, 100), "A") def two_stage(A): B = hcl.compute(A.shape, lambda x, y : A[x, y] + 1, "B") C = hcl.compute(A.shape, lambda x, y : B[x, y] + 1, "C") return C s = hcl.create_schedule([A], two_stage) s_B = two_stage.B code = hcl.build(s, target='aocl') s[s_B].reorder(s_B.axis[1], s_B.axis[0]) code2 = hcl.build(s, target='aocl') def test_split_fuse(): hcl.init() A = hcl.placeholder((10, 100), "A") def two_stage(A): B = hcl.compute(A.shape, lambda x, y : A[x, y] + 1, "B") C = hcl.compute(A.shape, lambda x, y : B[x, y] + 1, 'C') return C s = hcl.create_schedule([A], two_stage) s_B = two_stage.B x_out, x_in = s[s_B].split(s_B.axis[0], 5) code = hcl.build(s, target='aocl') s2 = hcl.create_schedule([A], two_stage) s2_B = two_stage.B x_y = s[s_B].fuse(s2_B.axis[0], s2_B.axis[1]) code2 = hcl.build(s2, target='aocl') def test_binary_conv(): hcl.init() A = hcl.placeholder((1, 32, 14, 14), dtype=hcl.UInt(1), name="A") B = hcl.placeholder((64, 32, 3, 3), dtype=hcl.UInt(1), name="B") rc = hcl.reduce_axis(0, 32) ry = hcl.reduce_axis(0, 3) rx = hcl.reduce_axis(0, 3) C = hcl.compute((1, 64, 12, 12), lambda nn, ff, yy, xx: hcl.sum( A[nn, rc, yy + ry, xx + rx] * B[ff, rc, ry, rx], axis=[rc, ry, rx]), dtype=hcl.UInt(8), name="C") s = hcl.create_schedule([A, B, C]) s[C].split(C.axis[1], factor=5) code = hcl.build(s, target='aocl') assert "for (int ff_outer = 0; ff_outer < 13; ++ff_outer)" in code assert "for (int ff_inner = 0; ff_inner < 5; ++ff_inner)" in code assert "if (ff_inner < (64 - (ff_outer * 5)))" in code if __name__ == '__main__': test_ap_int() test_pragma() test_reorder() test_split_fuse() test_binary_conv()
{ "pile_set_name": "Github" }
package dns // Dedup removes identical RRs from rrs. It preserves the original ordering. // The lowest TTL of any duplicates is used in the remaining one. Dedup modifies // rrs. // m is used to store the RRs temporary. If it is nil a new map will be allocated. func Dedup(rrs []RR, m map[string]RR) []RR { if m == nil { m = make(map[string]RR) } // Save the keys, so we don't have to call normalizedString twice. keys := make([]*string, 0, len(rrs)) for _, r := range rrs { key := normalizedString(r) keys = append(keys, &key) if _, ok := m[key]; ok { // Shortest TTL wins. if m[key].Header().Ttl > r.Header().Ttl { m[key].Header().Ttl = r.Header().Ttl } continue } m[key] = r } // If the length of the result map equals the amount of RRs we got, // it means they were all different. We can then just return the original rrset. if len(m) == len(rrs) { return rrs } j := 0 for i, r := range rrs { // If keys[i] lives in the map, we should copy and remove it. if _, ok := m[*keys[i]]; ok { delete(m, *keys[i]) rrs[j] = r j++ } if len(m) == 0 { break } } return rrs[:j] } // normalizedString returns a normalized string from r. The TTL // is removed and the domain name is lowercased. We go from this: // DomainName<TAB>TTL<TAB>CLASS<TAB>TYPE<TAB>RDATA to: // lowercasename<TAB>CLASS<TAB>TYPE... func normalizedString(r RR) string { // A string Go DNS makes has: domainname<TAB>TTL<TAB>... b := []byte(r.String()) // find the first non-escaped tab, then another, so we capture where the TTL lives. esc := false ttlStart, ttlEnd := 0, 0 for i := 0; i < len(b) && ttlEnd == 0; i++ { switch { case b[i] == '\\': esc = !esc case b[i] == '\t' && !esc: if ttlStart == 0 { ttlStart = i continue } if ttlEnd == 0 { ttlEnd = i } case b[i] >= 'A' && b[i] <= 'Z' && !esc: b[i] += 32 default: esc = false } } // remove TTL. copy(b[ttlStart:], b[ttlEnd:]) cut := ttlEnd - ttlStart return string(b[:len(b)-cut]) }
{ "pile_set_name": "Github" }
<!DOCTYPE html> <html> <head> <title>Api Documentation</title> <meta http-equiv="Content-Type" content="text/html; charset=UTF-8"/> <meta name="viewport" content="width=device-width, initial-scale=1"> <link type='text/css' rel='stylesheet' href='../../apidoc/stylesheets/bundled/bootstrap.min.css'/> <link type='text/css' rel='stylesheet' href='../../apidoc/stylesheets/bundled/prettify.css'/> <link type='text/css' rel='stylesheet' href='../../apidoc/stylesheets/bundled/bootstrap-responsive.min.css'/> <link type='text/css' rel='stylesheet' href='../../apidoc/stylesheets/application.css'/> <!-- IE6-8 support of HTML5 elements --> <!--[if lt IE 9]> <script src="//html5shim.googlecode.com/svn/trunk/html5.js"></script> <![endif]--> </head> <body> <div class="container-fluid"> <div class="row-fluid"> <div id='container'> <ul class='breadcrumb'> <li> <a href='../../apidoc/v2.gl.html'>Foreman v2</a> <span class='divider'>/</span> </li> <li class='active'> Bookmarks </li> <li class='pull-right'> &nbsp;[ <a href="../../apidoc/v2/bookmarks.ca.html">ca</a> | <a href="../../apidoc/v2/bookmarks.cs_CZ.html">cs_CZ</a> | <a href="../../apidoc/v2/bookmarks.de.html">de</a> | <a href="../../apidoc/v2/bookmarks.en.html">en</a> | <a href="../../apidoc/v2/bookmarks.en_GB.html">en_GB</a> | <a href="../../apidoc/v2/bookmarks.es.html">es</a> | <a href="../../apidoc/v2/bookmarks.fr.html">fr</a> | <b><a href="../../apidoc/v2/bookmarks.gl.html">gl</a></b> | <a href="../../apidoc/v2/bookmarks.it.html">it</a> | <a href="../../apidoc/v2/bookmarks.ja.html">ja</a> | <a href="../../apidoc/v2/bookmarks.ko.html">ko</a> | <a href="../../apidoc/v2/bookmarks.nl_NL.html">nl_NL</a> | <a href="../../apidoc/v2/bookmarks.pl.html">pl</a> | <a href="../../apidoc/v2/bookmarks.pt_BR.html">pt_BR</a> | <a href="../../apidoc/v2/bookmarks.ru.html">ru</a> | <a href="../../apidoc/v2/bookmarks.sv_SE.html">sv_SE</a> | <a href="../../apidoc/v2/bookmarks.zh_CN.html">zh_CN</a> | <a href="../../apidoc/v2/bookmarks.zh_TW.html">zh_TW</a> ] </li> </ul> <div class='page-header'> <h1> Bookmarks <br> <small></small> </h1> </div> <div class='accordion' id='accordion'> <hr> <div class='pull-right small'> <a href='../../apidoc/v2/bookmarks/index.gl.html'> >>> </a> </div> <div> <h2> <a href='#description-index' class='accordion-toggle' data-toggle='collapse' data-parent='#accordion'> GET /api/bookmarks </a> <br> <small>List all bookmarks</small> </h2> </div> <div id='description-index' class='collapse accordion-body'> <h3><span class="translation_missing" title="translation missing: gl.apipie.examples">Examples</span></h3> <pre class="prettyprint">GET /api/v2/bookmarks?page=1&amp;per_page=10&amp;search= 200 { &quot;total&quot;: 2, &quot;subtotal&quot;: 2, &quot;page&quot;: 1, &quot;per_page&quot;: 10, &quot;search&quot;: &quot;&quot;, &quot;sort&quot;: { &quot;by&quot;: null, &quot;order&quot;: null }, &quot;results&quot;: [ { &quot;name&quot;: &quot;foo&quot;, &quot;controller&quot;: &quot;hosts&quot;, &quot;query&quot;: &quot;foo=boo&quot;, &quot;public&quot;: true, &quot;id&quot;: 980190962, &quot;owner_id&quot;: null, &quot;owner_type&quot;: null }, { &quot;name&quot;: &quot;three&quot;, &quot;controller&quot;: &quot;hosts&quot;, &quot;query&quot;: &quot;three&quot;, &quot;public&quot;: true, &quot;id&quot;: 113629430, &quot;owner_id&quot;: null, &quot;owner_type&quot;: null } ] }</pre> <h3><span class="translation_missing" title="translation missing: gl.apipie.params">Params</span></h3> <table class='table'> <thead> <tr> <th><span class="translation_missing" title="translation missing: gl.apipie.param_name">Param Name</span></th> <th><span class="translation_missing" title="translation missing: gl.apipie.description">Description</span></th> </tr> </thead> <tbody> <tr style='background-color:rgb(255,255,255);'> <td> <strong>location_id </strong><br> <small> <span class="translation_missing" title="translation missing: gl.apipie.optional">Optional</span> </small> </td> <td> <p>Set the current location context for the request</p> <p><strong>Validations:</strong></p> <ul> <li> <p>Must be a Integer</p> </li> </ul> </td> </tr> <tr style='background-color:rgb(255,255,255);'> <td> <strong>organization_id </strong><br> <small> <span class="translation_missing" title="translation missing: gl.apipie.optional">Optional</span> </small> </td> <td> <p>Set the current organization context for the request</p> <p><strong>Validations:</strong></p> <ul> <li> <p>Must be a Integer</p> </li> </ul> </td> </tr> <tr style='background-color:rgb(255,255,255);'> <td> <strong>search </strong><br> <small> <span class="translation_missing" title="translation missing: gl.apipie.optional">Optional</span> </small> </td> <td> <p>filter results</p> <p><strong>Validations:</strong></p> <ul> <li> <p>Must be a String</p> </li> </ul> </td> </tr> <tr style='background-color:rgb(255,255,255);'> <td> <strong>order </strong><br> <small> <span class="translation_missing" title="translation missing: gl.apipie.optional">Optional</span> </small> </td> <td> <p>Sort field and order, eg. ‘id DESC’</p> <p><strong>Validations:</strong></p> <ul> <li> <p>Must be a String</p> </li> </ul> </td> </tr> <tr style='background-color:rgb(255,255,255);'> <td> <strong>page </strong><br> <small> <span class="translation_missing" title="translation missing: gl.apipie.optional">Optional</span> </small> </td> <td> <p>Page number, starting at 1</p> <p><strong>Validations:</strong></p> <ul> <li> <p>Must be a number.</p> </li> </ul> </td> </tr> <tr style='background-color:rgb(255,255,255);'> <td> <strong>per_page </strong><br> <small> <span class="translation_missing" title="translation missing: gl.apipie.optional">Optional</span> </small> </td> <td> <p>Number of results per page to return</p> <p><strong>Validations:</strong></p> <ul> <li> <p>Must be a number.</p> </li> </ul> </td> </tr> </tbody> </table> <h3>Search fields</h3> <table class='table'> <thead> <tr> <th width="20%">Field name</th> <th width="20%">Tipo</th> <th width="60%">Possible values</th> </tr> </thead> <tbody> <tr> <td>controller</td> <td>string</td> <td></td> </tr> <tr> <td>name</td> <td>string</td> <td></td> </tr> </tbody> </table> </div> <hr> <div class='pull-right small'> <a href='../../apidoc/v2/bookmarks/show.gl.html'> >>> </a> </div> <div> <h2> <a href='#description-show' class='accordion-toggle' data-toggle='collapse' data-parent='#accordion'> GET /api/bookmarks/:id </a> <br> <small>Show a bookmark</small> </h2> </div> <div id='description-show' class='collapse accordion-body'> <h3><span class="translation_missing" title="translation missing: gl.apipie.examples">Examples</span></h3> <pre class="prettyprint">GET /api/bookmarks/980190962-foo 200 { &quot;name&quot;: &quot;foo&quot;, &quot;controller&quot;: &quot;hosts&quot;, &quot;query&quot;: &quot;foo=boo&quot;, &quot;public&quot;: true, &quot;id&quot;: 980190962, &quot;owner_id&quot;: null, &quot;owner_type&quot;: null }</pre> <h3><span class="translation_missing" title="translation missing: gl.apipie.params">Params</span></h3> <table class='table'> <thead> <tr> <th><span class="translation_missing" title="translation missing: gl.apipie.param_name">Param Name</span></th> <th><span class="translation_missing" title="translation missing: gl.apipie.description">Description</span></th> </tr> </thead> <tbody> <tr style='background-color:rgb(255,255,255);'> <td> <strong>location_id </strong><br> <small> <span class="translation_missing" title="translation missing: gl.apipie.optional">Optional</span> </small> </td> <td> <p>Set the current location context for the request</p> <p><strong>Validations:</strong></p> <ul> <li> <p>Must be a Integer</p> </li> </ul> </td> </tr> <tr style='background-color:rgb(255,255,255);'> <td> <strong>organization_id </strong><br> <small> <span class="translation_missing" title="translation missing: gl.apipie.optional">Optional</span> </small> </td> <td> <p>Set the current organization context for the request</p> <p><strong>Validations:</strong></p> <ul> <li> <p>Must be a Integer</p> </li> </ul> </td> </tr> <tr style='background-color:rgb(255,255,255);'> <td> <strong>id </strong><br> <small> <span class="translation_missing" title="translation missing: gl.apipie.required">Required</span> </small> </td> <td> <p><strong>Validations:</strong></p> <ul> <li> <p>Must be an identifier, string from 1 to 128 characters containing only alphanumeric characters, space, underscore(_), hypen(-) with no leading or trailing space.</p> </li> </ul> </td> </tr> </tbody> </table> </div> <hr> <div class='pull-right small'> <a href='../../apidoc/v2/bookmarks/create.gl.html'> >>> </a> </div> <div> <h2> <a href='#description-create' class='accordion-toggle' data-toggle='collapse' data-parent='#accordion'> POST /api/bookmarks </a> <br> <small>Create a bookmark</small> </h2> </div> <div id='description-create' class='collapse accordion-body'> <h3><span class="translation_missing" title="translation missing: gl.apipie.examples">Examples</span></h3> <pre class="prettyprint">POST /api/bookmarks { &quot;bookmark&quot;: { &quot;public&quot;: false, &quot;controller&quot;: &quot;hosts&quot;, &quot;name&quot;: &quot;foo-bar&quot;, &quot;query&quot;: &quot;bar&quot; } } 201 { &quot;name&quot;: &quot;foo-bar&quot;, &quot;controller&quot;: &quot;hosts&quot;, &quot;query&quot;: &quot;bar&quot;, &quot;public&quot;: false, &quot;id&quot;: 980190963, &quot;owner_id&quot;: 135138680, &quot;owner_type&quot;: &quot;User&quot; }</pre> <h3><span class="translation_missing" title="translation missing: gl.apipie.params">Params</span></h3> <table class='table'> <thead> <tr> <th><span class="translation_missing" title="translation missing: gl.apipie.param_name">Param Name</span></th> <th><span class="translation_missing" title="translation missing: gl.apipie.description">Description</span></th> </tr> </thead> <tbody> <tr style='background-color:rgb(255,255,255);'> <td> <strong>location_id </strong><br> <small> <span class="translation_missing" title="translation missing: gl.apipie.optional">Optional</span> </small> </td> <td> <p>Set the current location context for the request</p> <p><strong>Validations:</strong></p> <ul> <li> <p>Must be a Integer</p> </li> </ul> </td> </tr> <tr style='background-color:rgb(255,255,255);'> <td> <strong>organization_id </strong><br> <small> <span class="translation_missing" title="translation missing: gl.apipie.optional">Optional</span> </small> </td> <td> <p>Set the current organization context for the request</p> <p><strong>Validations:</strong></p> <ul> <li> <p>Must be a Integer</p> </li> </ul> </td> </tr> <tr style='background-color:rgb(255,255,255);'> <td> <strong>bookmark </strong><br> <small> <span class="translation_missing" title="translation missing: gl.apipie.required">Required</span> </small> </td> <td> <p><strong>Validations:</strong></p> <ul> <li> <p>Must be a Hash</p> </li> </ul> </td> </tr> <tr style='background-color:rgb(250,250,250);'> <td> <strong>bookmark[name] </strong><br> <small> <span class="translation_missing" title="translation missing: gl.apipie.required">Required</span> </small> </td> <td> <p><strong>Validations:</strong></p> <ul> <li> <p>Must be a String</p> </li> </ul> </td> </tr> <tr style='background-color:rgb(250,250,250);'> <td> <strong>bookmark[controller] </strong><br> <small> <span class="translation_missing" title="translation missing: gl.apipie.required">Required</span> </small> </td> <td> <p><strong>Validations:</strong></p> <ul> <li> <p>Must be a String</p> </li> </ul> </td> </tr> <tr style='background-color:rgb(250,250,250);'> <td> <strong>bookmark[query] </strong><br> <small> <span class="translation_missing" title="translation missing: gl.apipie.required">Required</span> </small> </td> <td> <p><strong>Validations:</strong></p> <ul> <li> <p>Must be a String</p> </li> </ul> </td> </tr> <tr style='background-color:rgb(250,250,250);'> <td> <strong>bookmark[public] </strong><br> <small> <span class="translation_missing" title="translation missing: gl.apipie.optional">Optional</span> , &lt;span class=&quot;translation_missing&quot; title=&quot;translation missing: gl.apipie.nil_allowed&quot;&gt;Nil Allowed&lt;/span&gt; </small> </td> <td> <p><strong>Validations:</strong></p> <ul> <li> <p>Must be one of: <code>true</code>, <code>false</code>, <code>1</code>, <code>0</code>.</p> </li> </ul> </td> </tr> </tbody> </table> </div> <hr> <div class='pull-right small'> <a href='../../apidoc/v2/bookmarks/update.gl.html'> >>> </a> </div> <div> <h2> <a href='#description-update' class='accordion-toggle' data-toggle='collapse' data-parent='#accordion'> PUT /api/bookmarks/:id </a> <br> <small>Update a bookmark</small> </h2> </div> <div id='description-update' class='collapse accordion-body'> <h3><span class="translation_missing" title="translation missing: gl.apipie.examples">Examples</span></h3> <pre class="prettyprint">PUT /api/bookmarks/980190962-foo { &quot;bookmark&quot;: { &quot;public&quot;: false, &quot;controller&quot;: &quot;hosts&quot;, &quot;name&quot;: &quot;facts.architecture&quot;, &quot;query&quot;: &quot; facts.architecture = x86_64&quot; } } 200 { &quot;name&quot;: &quot;facts.architecture&quot;, &quot;controller&quot;: &quot;hosts&quot;, &quot;query&quot;: &quot;facts.architecture = x86_64&quot;, &quot;public&quot;: false, &quot;id&quot;: 980190962, &quot;owner_id&quot;: 135138680, &quot;owner_type&quot;: &quot;User&quot; }</pre> <h3><span class="translation_missing" title="translation missing: gl.apipie.params">Params</span></h3> <table class='table'> <thead> <tr> <th><span class="translation_missing" title="translation missing: gl.apipie.param_name">Param Name</span></th> <th><span class="translation_missing" title="translation missing: gl.apipie.description">Description</span></th> </tr> </thead> <tbody> <tr style='background-color:rgb(255,255,255);'> <td> <strong>location_id </strong><br> <small> <span class="translation_missing" title="translation missing: gl.apipie.optional">Optional</span> </small> </td> <td> <p>Set the current location context for the request</p> <p><strong>Validations:</strong></p> <ul> <li> <p>Must be a Integer</p> </li> </ul> </td> </tr> <tr style='background-color:rgb(255,255,255);'> <td> <strong>organization_id </strong><br> <small> <span class="translation_missing" title="translation missing: gl.apipie.optional">Optional</span> </small> </td> <td> <p>Set the current organization context for the request</p> <p><strong>Validations:</strong></p> <ul> <li> <p>Must be a Integer</p> </li> </ul> </td> </tr> <tr style='background-color:rgb(255,255,255);'> <td> <strong>id </strong><br> <small> <span class="translation_missing" title="translation missing: gl.apipie.required">Required</span> </small> </td> <td> <p><strong>Validations:</strong></p> <ul> <li> <p>Must be an identifier, string from 1 to 128 characters containing only alphanumeric characters, space, underscore(_), hypen(-) with no leading or trailing space.</p> </li> </ul> </td> </tr> <tr style='background-color:rgb(255,255,255);'> <td> <strong>bookmark </strong><br> <small> <span class="translation_missing" title="translation missing: gl.apipie.required">Required</span> </small> </td> <td> <p><strong>Validations:</strong></p> <ul> <li> <p>Must be a Hash</p> </li> </ul> </td> </tr> <tr style='background-color:rgb(250,250,250);'> <td> <strong>bookmark[name] </strong><br> <small> <span class="translation_missing" title="translation missing: gl.apipie.optional">Optional</span> </small> </td> <td> <p><strong>Validations:</strong></p> <ul> <li> <p>Must be a String</p> </li> </ul> </td> </tr> <tr style='background-color:rgb(250,250,250);'> <td> <strong>bookmark[controller] </strong><br> <small> <span class="translation_missing" title="translation missing: gl.apipie.optional">Optional</span> </small> </td> <td> <p><strong>Validations:</strong></p> <ul> <li> <p>Must be a String</p> </li> </ul> </td> </tr> <tr style='background-color:rgb(250,250,250);'> <td> <strong>bookmark[query] </strong><br> <small> <span class="translation_missing" title="translation missing: gl.apipie.optional">Optional</span> </small> </td> <td> <p><strong>Validations:</strong></p> <ul> <li> <p>Must be a String</p> </li> </ul> </td> </tr> <tr style='background-color:rgb(250,250,250);'> <td> <strong>bookmark[public] </strong><br> <small> <span class="translation_missing" title="translation missing: gl.apipie.optional">Optional</span> , &lt;span class=&quot;translation_missing&quot; title=&quot;translation missing: gl.apipie.nil_allowed&quot;&gt;Nil Allowed&lt;/span&gt; </small> </td> <td> <p><strong>Validations:</strong></p> <ul> <li> <p>Must be one of: <code>true</code>, <code>false</code>, <code>1</code>, <code>0</code>.</p> </li> </ul> </td> </tr> </tbody> </table> </div> <hr> <div class='pull-right small'> <a href='../../apidoc/v2/bookmarks/destroy.gl.html'> >>> </a> </div> <div> <h2> <a href='#description-destroy' class='accordion-toggle' data-toggle='collapse' data-parent='#accordion'> DELETE /api/bookmarks/:id </a> <br> <small>Delete a bookmark</small> </h2> </div> <div id='description-destroy' class='collapse accordion-body'> <h3><span class="translation_missing" title="translation missing: gl.apipie.examples">Examples</span></h3> <pre class="prettyprint">DELETE /api/bookmarks/980190962-foo { &quot;bookmark&quot;: {} } 200 { &quot;id&quot;: 980190962, &quot;name&quot;: &quot;foo&quot;, &quot;query&quot;: &quot;foo=boo&quot;, &quot;controller&quot;: &quot;hosts&quot;, &quot;public&quot;: true, &quot;owner_id&quot;: null, &quot;owner_type&quot;: null }</pre> <h3><span class="translation_missing" title="translation missing: gl.apipie.params">Params</span></h3> <table class='table'> <thead> <tr> <th><span class="translation_missing" title="translation missing: gl.apipie.param_name">Param Name</span></th> <th><span class="translation_missing" title="translation missing: gl.apipie.description">Description</span></th> </tr> </thead> <tbody> <tr style='background-color:rgb(255,255,255);'> <td> <strong>location_id </strong><br> <small> <span class="translation_missing" title="translation missing: gl.apipie.optional">Optional</span> </small> </td> <td> <p>Set the current location context for the request</p> <p><strong>Validations:</strong></p> <ul> <li> <p>Must be a Integer</p> </li> </ul> </td> </tr> <tr style='background-color:rgb(255,255,255);'> <td> <strong>organization_id </strong><br> <small> <span class="translation_missing" title="translation missing: gl.apipie.optional">Optional</span> </small> </td> <td> <p>Set the current organization context for the request</p> <p><strong>Validations:</strong></p> <ul> <li> <p>Must be a Integer</p> </li> </ul> </td> </tr> <tr style='background-color:rgb(255,255,255);'> <td> <strong>id </strong><br> <small> <span class="translation_missing" title="translation missing: gl.apipie.required">Required</span> </small> </td> <td> <p><strong>Validations:</strong></p> <ul> <li> <p>Must be an identifier, string from 1 to 128 characters containing only alphanumeric characters, space, underscore(_), hypen(-) with no leading or trailing space.</p> </li> </ul> </td> </tr> </tbody> </table> </div> </div> </div> </div> <hr> <footer></footer> </div> <script type='text/javascript' src='../../apidoc/javascripts/bundled/jquery.js'></script> <script type='text/javascript' src='../../apidoc/javascripts/bundled/bootstrap-collapse.js'></script> <script type='text/javascript' src='../../apidoc/javascripts/bundled/prettify.js'></script> <script type='text/javascript' src='../../apidoc/javascripts/apipie.js'></script> </body> </html>
{ "pile_set_name": "Github" }
<?php /** * This source file is part of the open source project * ExpressionEngine (https://expressionengine.com) * * @link https://expressionengine.com/ * @copyright Copyright (c) 2003-2019, EllisLab Corp. (https://ellislab.com) * @license https://expressionengine.com/license Licensed under Apache License, Version 2.0 */ /** * Bold RTE Tool */ class Bold_rte { public $info = array( 'name' => 'Bold', 'version' => '1.0', 'description' => 'Bolds and un-bolds selected text', 'cp_only' => 'n' ); /** * Globals we need * * @access public */ function globals() { ee()->lang->loadfile('rte'); return array( 'rte.bold' => array( 'add' => lang('make_bold'), 'remove' => lang('remove_bold'), 'title' => lang('title_bold') ) ); } /** * JS Definition * * @access public */ function definition() { ob_start(); ?> WysiHat.addButton('bold', { cssClass: 'rte-bold', title: EE.rte.bold.title, label: EE.rte.bold.add, 'toggle-text': EE.rte.bold.remove }); <?php $buffer = ob_get_contents(); ob_end_clean(); return $buffer; } } // END Bold_rte // EOF
{ "pile_set_name": "Github" }
/* SqLiteStorage.h This file is part of Charm, a task-based time tracking application. Copyright (C) 2007-2019 Klarälvdalens Datakonsult AB, a KDAB Group company, info@kdab.com Author: Mirko Boehm <mirko.boehm@kdab.com> Author: Mike McQuaid <mike.mcquaid@kdab.com> 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, see <http://www.gnu.org/licenses/>. */ #ifndef SQLITESTORAGE_H #define SQLITESTORAGE_H #include <QSqlDatabase> #include <QDir> #include "SqlStorage.h" class Configuration; class SqLiteStorage : public SqlStorage { public: SqLiteStorage(); ~SqLiteStorage(); QString description() const override; bool connect(Configuration &) override; bool disconnect() override; QSqlDatabase &database() override; protected: bool createDatabase(Configuration &) override; bool createDatabaseTables() override; bool migrateDatabaseDirectory(QDir, const QDir &) const; QString lastInsertRowFunction() const override; private: QSqlDatabase m_database; }; #endif
{ "pile_set_name": "Github" }
class JoinTeamRequest < ActiveRecord::Base belongs_to :team has_one :participant, dependent: :nullify attr_accessible :comments, :status end
{ "pile_set_name": "Github" }
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd"> <modelVersion>4.0.0</modelVersion> <parent> <groupId>com.castle</groupId> <artifactId>castle-themes</artifactId> <version>2.0</version> </parent> <artifactId>castle-theme-adminlte</artifactId> <name>Castle Theme Adminlte</name> <description>The Adminlte of Castle Theme.</description> <dependencies> <dependency> <groupId>com.castle</groupId> <artifactId>castle-web</artifactId> <version>${project.version}</version> </dependency> </dependencies> </project>
{ "pile_set_name": "Github" }
// CodeContracts // // Copyright (c) Microsoft Corporation // // All rights reserved. // // MIT License // // Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: // // The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. // // THE SOFTWARE IS PROVIDED *AS IS*, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. // File System.Windows.Media.Animation.MatrixKeyFrame.cs // Automatically generated contract file. using System.Collections.Generic; using System.IO; using System.Text; using System.Diagnostics.Contracts; using System; // Disable the "this variable is not used" warning as every field would imply it. #pragma warning disable 0414 // Disable the "this variable is never assigned to". #pragma warning disable 0067 // Disable the "this event is never assigned to". #pragma warning disable 0649 // Disable the "this variable is never used". #pragma warning disable 0169 // Disable the "new keyword not required" warning. #pragma warning disable 0109 // Disable the "extern without DllImport" warning. #pragma warning disable 0626 // Disable the "could hide other member" warning, can happen on certain properties. #pragma warning disable 0108 namespace System.Windows.Media.Animation { abstract public partial class MatrixKeyFrame : System.Windows.Freezable, IKeyFrame { #region Methods and constructors public System.Windows.Media.Matrix InterpolateValue(System.Windows.Media.Matrix baseValue, double keyFrameProgress) { return default(System.Windows.Media.Matrix); } protected abstract System.Windows.Media.Matrix InterpolateValueCore(System.Windows.Media.Matrix baseValue, double keyFrameProgress); protected MatrixKeyFrame() { } protected MatrixKeyFrame(System.Windows.Media.Matrix value) { } protected MatrixKeyFrame(System.Windows.Media.Matrix value, KeyTime keyTime) { } #endregion #region Properties and indexers public KeyTime KeyTime { get { return default(KeyTime); } set { } } Object System.Windows.Media.Animation.IKeyFrame.Value { get { return default(Object); } set { } } public System.Windows.Media.Matrix Value { get { return default(System.Windows.Media.Matrix); } set { } } #endregion #region Fields public readonly static System.Windows.DependencyProperty KeyTimeProperty; public readonly static System.Windows.DependencyProperty ValueProperty; #endregion } }
{ "pile_set_name": "Github" }
# -*- coding: utf-8 -*- """ Created on Wed Mar 6 14:31:30 2019 @author: qinzhen """ import numpy as np from numpy.linalg import inv #(b) def E(u,v): return np.exp(u) + np.exp(2 * v) + np.exp(u * v) + u * u - 3 * u * v + 4 * v * v - 3 * u - 5 * v u = 1 / np.sqrt(13) v = 3 / (2 * np.sqrt(13)) print(E(u,v)) #(c) m1 = np.array([[3, -2], [-2, 10]]) m2 = np.array([[2], [3]]) d = inv(m1).dot(m2) l = np.sqrt((d * d).sum()) d1 = 0.5 * d / l u = d1[0] v = d1[1] print(E(u, v)) print(d1)
{ "pile_set_name": "Github" }
# $Id: mk-hdr.awk,v 1.2 2007/03/31 15:48:45 tom Exp $ ############################################################################## # Copyright (c) 2007 Free Software Foundation, Inc. # # # # Permission is hereby granted, free of charge, to any person obtaining a # # copy of this software and associated documentation files (the "Software"), # # to deal in the Software without restriction, including without limitation # # the rights to use, copy, modify, merge, publish, distribute, distribute # # with modifications, 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 ABOVE 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. # # # # Except as contained in this notice, the name(s) of the above copyright # # holders shall not be used in advertising or otherwise to promote the sale, # # use or other dealings in this Software without prior written # # authorization. # ############################################################################## # # Author: Thomas E. Dickey 2007 # # Generate install/uninstall rules for header files # Variables: # subset ("none", "base", "base+ext_funcs" or "termlib", etc.) # compat ("yes" or "no", flag to add link to curses.h # function basename(path) { sub(/^.*\//,"",path) return path; } BEGIN { found = 0 using = 1 count = 0 } /^@/ { using = 0 if (subset == "none") { using = 1 } else if (index(subset,$2) > 0) { using = 1 } else { using = 0 } } /^[@#]/ { next } { if (using && NF != 0) { if (found == 0) { print "" print "# generated by mk-hdr.awk" printf "# subset: %s\n", subset printf "# compat: %s\n", compat print "" found = 1 } data[count] = $1 count = count + 1 } } END { if ( count > 0 ) { print "${DESTDIR}${includedir} :" print " sh ${srcdir}/../mkdirs.sh $@" print "" print "install \\" print "install.libs \\" print "install.includes :: ${AUTO_SRC} ${DESTDIR}${includedir} \\" for (i = 0; i < count - 1; ++i) { printf " %s \\\n", data[i] } printf " %s\n", data[count - 1] for (i = 0; i < count; ++i) { printf " @ (cd ${DESTDIR}${includedir} && rm -f %s) ; ../headers.sh ${INSTALL_DATA} ${DESTDIR}${includedir} ${srcdir} %s\n", basename(data[i]), data[i] if (data[i] == "curses.h" && compat == "yes") { printf " @ (cd ${DESTDIR}${includedir} && rm -f ncurses.h && ${LN_S} %s ncurses.h)\n", data[i] } } print "" print "uninstall \\" print "uninstall.libs \\" print "uninstall.includes ::" for (i = 0; i < count; ++i) { printf " -@ (cd ${DESTDIR}${includedir} && rm -f %s)\n", basename(data[i]) if (data[i] == "curses.h" && compat == "yes") { printf " -@ (cd ${DESTDIR}${includedir} && rm -f ncurses.h)\n" } } } } # vile:ts=4 sw=4
{ "pile_set_name": "Github" }
<environment names="Development"> <script src="~/lib/jquery-validation/dist/jquery.validate.js"></script> <script src="~/lib/jquery-validation-unobtrusive/jquery.validate.unobtrusive.js"></script> </environment> <environment names="Staging,Production"> <script src="https://ajax.aspnetcdn.com/ajax/jquery.validate/1.14.0/jquery.validate.min.js" asp-fallback-src="~/lib/jquery-validation/dist/jquery.validate.min.js" asp-fallback-test="window.jQuery && window.jQuery.validator" crossorigin="anonymous" integrity="sha384-Fnqn3nxp3506LP/7Y3j/25BlWeA3PXTyT1l78LjECcPaKCV12TsZP7yyMxOe/G/k"> </script> <script src="https://ajax.aspnetcdn.com/ajax/jquery.validation.unobtrusive/3.2.6/jquery.validate.unobtrusive.min.js" asp-fallback-src="~/lib/jquery-validation-unobtrusive/jquery.validate.unobtrusive.min.js" asp-fallback-test="window.jQuery && window.jQuery.validator && window.jQuery.validator.unobtrusive" crossorigin="anonymous" integrity="sha384-JrXK+k53HACyavUKOsL+NkmSesD2P+73eDMrbTtTk0h4RmOF8hF8apPlkp26JlyH"> </script> </environment>
{ "pile_set_name": "Github" }
# -*- coding: utf-8 -*- """Markdown filters with mistune Used from markdown.py """ # Copyright (c) IPython Development Team. # Distributed under the terms of the Modified BSD License. from __future__ import print_function import re import cgi import mistune from pygments import highlight from pygments.lexers import get_lexer_by_name from pygments.formatters import HtmlFormatter from pygments.util import ClassNotFound from nbconvert.filters.strings import add_anchor class MathBlockGrammar(mistune.BlockGrammar): """This defines a single regex comprised of the different patterns that identify math content spanning multiple lines. These are used by the MathBlockLexer. """ multi_math_str = "|".join([r"^\$\$.*?\$\$", r"^\\\\\[.*?\\\\\]", r"^\\begin\{([a-z]*\*?)\}(.*?)\\end\{\1\}"]) multiline_math = re.compile(multi_math_str, re.DOTALL) class MathBlockLexer(mistune.BlockLexer): """ This acts as a pass-through to the MathInlineLexer. It is needed in order to avoid other block level rules splitting math sections apart. """ default_rules = (['multiline_math'] + mistune.BlockLexer.default_rules) def __init__(self, rules=None, **kwargs): if rules is None: rules = MathBlockGrammar() super(MathBlockLexer, self).__init__(rules, **kwargs) def parse_multiline_math(self, m): """Add token to pass through mutiline math.""" self.tokens.append({ "type": "multiline_math", "text": m.group(0) }) class MathInlineGrammar(mistune.InlineGrammar): """This defines different ways of declaring math objects that should be passed through to mathjax unaffected. These are used by the MathInlineLexer. """ inline_math = re.compile(r"^\$(.+?)\$|^\\\\\((.+?)\\\\\)", re.DOTALL) block_math = re.compile(r"^\$\$(.*?)\$\$|^\\\\\[(.*?)\\\\\]", re.DOTALL) latex_environment = re.compile(r"^\\begin\{([a-z]*\*?)\}(.*?)\\end\{\1\}", re.DOTALL) text = re.compile(r'^[\s\S]+?(?=[\\<!\[_*`~$]|https?://| {2,}\n|$)') class MathInlineLexer(mistune.InlineLexer): """This interprets the content of LaTeX style math objects using the rules defined by the MathInlineGrammar. In particular this grabs ``$$...$$``, ``\\[...\\]``, ``\\(...\\)``, ``$...$``, and ``\begin{foo}...\end{foo}`` styles for declaring mathematics. It strips delimiters from all these varieties, and extracts the type of environment in the last case (``foo`` in this example). """ default_rules = (['block_math', 'inline_math', 'latex_environment'] + mistune.InlineLexer.default_rules) def __init__(self, renderer, rules=None, **kwargs): if rules is None: rules = MathInlineGrammar() super(MathInlineLexer, self).__init__(renderer, rules, **kwargs) def output_inline_math(self, m): return self.renderer.inline_math(m.group(1) or m.group(2)) def output_block_math(self, m): return self.renderer.block_math(m.group(1) or m.group(2) or "") def output_latex_environment(self, m): return self.renderer.latex_environment(m.group(1), m.group(2)) class MarkdownWithMath(mistune.Markdown): def __init__(self, renderer, **kwargs): if 'inline' not in kwargs: kwargs['inline'] = MathInlineLexer if 'block' not in kwargs: kwargs['block'] = MathBlockLexer super(MarkdownWithMath, self).__init__(renderer, **kwargs) def output_multiline_math(self): return self.inline(self.token["text"]) class IPythonRenderer(mistune.Renderer): def block_code(self, code, lang): if lang: try: lexer = get_lexer_by_name(lang, stripall=True) except ClassNotFound: code = lang + '\n' + code lang = None if not lang: return '\n<pre><code>%s</code></pre>\n' % \ mistune.escape(code) formatter = HtmlFormatter() return highlight(code, lexer, formatter) def header(self, text, level, raw=None): html = super(IPythonRenderer, self).header(text, level, raw=raw) anchor_link_text = self.options.get('anchor_link_text', u'¶') return add_anchor(html, anchor_link_text=anchor_link_text) # We must be careful here for compatibility # html.escape() is not availale on python 2.7 # For more details, see: # https://wiki.python.org/moin/EscapingHtml def escape_html(self, text): return cgi.escape(text) def block_math(self, text): return '$$%s$$' % self.escape_html(text) def latex_environment(self, name, text): name = self.escape_html(name) text = self.escape_html(text) return r'\begin{%s}%s\end{%s}' % (name, text, name) def inline_math(self, text): return '$%s$' % self.escape_html(text) def markdown2html_mistune(source): """Convert a markdown string to HTML using mistune""" return MarkdownWithMath(renderer=IPythonRenderer( escape=False)).render(source)
{ "pile_set_name": "Github" }
import React, { Component } from 'react'; import { ActivityIndicator, View, FlatList, Text } from 'react-native'; import TodoItem from './TodoItem' class TodosList extends Component { constructor(props) { super(props); this.state = { todos: [], loading: false}; } componentDidMount = async () => { this.setState( { loading: true }); var result = await fetch("https://jsonplaceholder.typicode.com/todos/"); var json = await result.json(); console.log(json); this.setState( { todos: json.slice(1, 20), loading: false}); } render() { return( <View> <ActivityIndicator size="large" animating={this.state.loading} /> <FlatList data={this.state.todos} style={{ height: 150}} renderItem={({item}) => <TodoItem title={item.title} />} keyExtractor={item => item.id.toString()} /> </View> ); } } export default TodosList
{ "pile_set_name": "Github" }
<?php /** * Copyright © Magento, Inc. All rights reserved. * See COPYING.txt for license details. */ declare(strict_types=1); namespace Magento\Test\Di\Aggregate; use Magento\Test\Di\Child; use Magento\Test\Di\DiParent; class WithOptional { public $parent; public $child; /** * WithOptional constructor. * @param DiParent|null $parent * @param Child|null $child */ public function __construct(DiParent $parent = null, Child $child = null) { $this->parent = $parent; $this->child = $child; } }
{ "pile_set_name": "Github" }
<!DOCTYPE HTML> <!-- NewPage --> <html lang="en"> <head> <!-- Generated by javadoc (11.0.7) on Tue Jul 14 14:13:05 PDT 2020 --> <title>SerializableConfiguration</title> <meta http-equiv="Content-Type" content="text/html; charset=utf-8"> <meta name="dc.created" content="2020-07-14"> <link rel="stylesheet" type="text/css" href="../../../../stylesheet.css" title="Style"> <link rel="stylesheet" type="text/css" href="../../../../jquery/jquery-ui.css" title="Style"> <script type="text/javascript" src="../../../../script.js"></script> <script type="text/javascript" src="../../../../jquery/jszip/dist/jszip.min.js"></script> <script type="text/javascript" src="../../../../jquery/jszip-utils/dist/jszip-utils.min.js"></script> <!--[if IE]> <script type="text/javascript" src="../../../../jquery/jszip-utils/dist/jszip-utils-ie.min.js"></script> <![endif]--> <script type="text/javascript" src="../../../../jquery/jquery-3.3.1.js"></script> <script type="text/javascript" src="../../../../jquery/jquery-migrate-3.0.1.js"></script> <script type="text/javascript" src="../../../../jquery/jquery-ui.js"></script> </head> <body> <script type="text/javascript"><!-- try { if (location.href.indexOf('is-external=true') == -1) { parent.document.title="SerializableConfiguration"; } } catch(err) { } //--> var data = {"i0":10}; var tabs = {65535:["t0","All Methods"],2:["t2","Instance Methods"],8:["t4","Concrete Methods"]}; var altColor = "altColor"; var rowColor = "rowColor"; var tableTab = "tableTab"; var activeTableTab = "activeTableTab"; var pathtoroot = "../../../../"; var useModuleDirectories = true; loadScripts(document, 'script');</script> <noscript> <div>JavaScript is disabled on your browser.</div> </noscript> <header role="banner"> <nav role="navigation"> <div class="fixedNav"> <!-- ========= START OF TOP NAVBAR ======= --> <div class="topNav"><a id="navbar.top"> <!-- --> </a> <div class="skipNav"><a href="#skip.navbar.top" title="Skip navigation links">Skip navigation links</a></div> <a id="navbar.top.firstrow"> <!-- --> </a> <ul class="navList" title="Navigation"> <li><a href="../../../../index.html">Overview</a></li> <li><a href="package-summary.html">Package</a></li> <li class="navBarCell1Rev">Class</li> <li><a href="package-tree.html">Tree</a></li> <li><a href="../../../../deprecated-list.html">Deprecated</a></li> <li><a href="../../../../index-all.html">Index</a></li> <li><a href="../../../../help-doc.html">Help</a></li> </ul> </div> <div class="subNav"> <ul class="navList" id="allclasses_navbar_top"> <li><a href="../../../../allclasses.html">All&nbsp;Classes</a></li> </ul> <ul class="navListSearch"> <li><label for="search">SEARCH:</label> <input type="text" id="search" value="search" disabled="disabled"> <input type="reset" id="reset" value="reset" disabled="disabled"> </li> </ul> <div> <script type="text/javascript"><!-- allClassesLink = document.getElementById("allclasses_navbar_top"); if(window==top) { allClassesLink.style.display = "block"; } else { allClassesLink.style.display = "none"; } //--> </script> <noscript> <div>JavaScript is disabled on your browser.</div> </noscript> </div> <div> <ul class="subNavList"> <li>Summary:&nbsp;</li> <li>Nested&nbsp;|&nbsp;</li> <li>Field&nbsp;|&nbsp;</li> <li><a href="#constructor.summary">Constr</a>&nbsp;|&nbsp;</li> <li><a href="#method.summary">Method</a></li> </ul> <ul class="subNavList"> <li>Detail:&nbsp;</li> <li>Field&nbsp;|&nbsp;</li> <li><a href="#constructor.detail">Constr</a>&nbsp;|&nbsp;</li> <li><a href="#method.detail">Method</a></li> </ul> </div> <a id="skip.navbar.top"> <!-- --> </a></div> <!-- ========= END OF TOP NAVBAR ========= --> </div> <div class="navPadding">&nbsp;</div> <script type="text/javascript"><!-- $('.navPadding').css('padding-top', $('.fixedNav').css("height")); //--> </script> </nav> </header> <!-- ======== START OF CLASS DATA ======== --> <main role="main"> <div class="header"> <div class="subTitle"><span class="packageLabelInType">Package</span>&nbsp;<a href="package-summary.html">org.apache.iceberg.hadoop</a></div> <h2 title="Class SerializableConfiguration" class="title">Class SerializableConfiguration</h2> </div> <div class="contentContainer"> <ul class="inheritance"> <li>java.lang.Object</li> <li> <ul class="inheritance"> <li>org.apache.iceberg.hadoop.SerializableConfiguration</li> </ul> </li> </ul> <div class="description"> <ul class="blockList"> <li class="blockList"> <dl> <dt>All Implemented Interfaces:</dt> <dd><code>java.io.Serializable</code></dd> </dl> <hr> <pre>public class <span class="typeNameLabel">SerializableConfiguration</span> extends java.lang.Object implements java.io.Serializable</pre> <div class="block">Wraps a <code>Configuration</code> object in a <code>Serializable</code> layer.</div> <dl> <dt><span class="seeLabel">See Also:</span></dt> <dd><a href="../../../../serialized-form.html#org.apache.iceberg.hadoop.SerializableConfiguration">Serialized Form</a></dd> </dl> </li> </ul> </div> <div class="summary"> <ul class="blockList"> <li class="blockList"> <!-- ======== CONSTRUCTOR SUMMARY ======== --> <section role="region"> <ul class="blockList"> <li class="blockList"><a id="constructor.summary"> <!-- --> </a> <h3>Constructor Summary</h3> <table class="memberSummary"> <caption><span>Constructors</span><span class="tabEnd">&nbsp;</span></caption> <tr> <th class="colFirst" scope="col">Constructor</th> <th class="colLast" scope="col">Description</th> </tr> <tr class="altColor"> <th class="colConstructorName" scope="row"><code><span class="memberNameLink"><a href="#%3Cinit%3E(org.apache.hadoop.conf.Configuration)">SerializableConfiguration</a></span>&#8203;(org.apache.hadoop.conf.Configuration&nbsp;hadoopConf)</code></th> <td class="colLast">&nbsp;</td> </tr> </table> </li> </ul> </section> <!-- ========== METHOD SUMMARY =========== --> <section role="region"> <ul class="blockList"> <li class="blockList"><a id="method.summary"> <!-- --> </a> <h3>Method Summary</h3> <table class="memberSummary"> <caption><span id="t0" class="activeTableTab"><span>All Methods</span><span class="tabEnd">&nbsp;</span></span><span id="t2" class="tableTab"><span><a href="javascript:show(2);">Instance Methods</a></span><span class="tabEnd">&nbsp;</span></span><span id="t4" class="tableTab"><span><a href="javascript:show(8);">Concrete Methods</a></span><span class="tabEnd">&nbsp;</span></span></caption> <tr> <th class="colFirst" scope="col">Modifier and Type</th> <th class="colSecond" scope="col">Method</th> <th class="colLast" scope="col">Description</th> </tr> <tr id="i0" class="altColor"> <td class="colFirst"><code>org.apache.hadoop.conf.Configuration</code></td> <th class="colSecond" scope="row"><code><span class="memberNameLink"><a href="#get()">get</a></span>()</code></th> <td class="colLast">&nbsp;</td> </tr> </table> <ul class="blockList"> <li class="blockList"><a id="methods.inherited.from.class.java.lang.Object"> <!-- --> </a> <h3>Methods inherited from class&nbsp;java.lang.Object</h3> <code>clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait</code></li> </ul> </li> </ul> </section> </li> </ul> </div> <div class="details"> <ul class="blockList"> <li class="blockList"> <!-- ========= CONSTRUCTOR DETAIL ======== --> <section role="region"> <ul class="blockList"> <li class="blockList"><a id="constructor.detail"> <!-- --> </a> <h3>Constructor Detail</h3> <a id="&lt;init&gt;(org.apache.hadoop.conf.Configuration)"> <!-- --> </a> <ul class="blockListLast"> <li class="blockList"> <h4>SerializableConfiguration</h4> <pre>public&nbsp;SerializableConfiguration&#8203;(org.apache.hadoop.conf.Configuration&nbsp;hadoopConf)</pre> </li> </ul> </li> </ul> </section> <!-- ============ METHOD DETAIL ========== --> <section role="region"> <ul class="blockList"> <li class="blockList"><a id="method.detail"> <!-- --> </a> <h3>Method Detail</h3> <a id="get()"> <!-- --> </a> <ul class="blockListLast"> <li class="blockList"> <h4>get</h4> <pre class="methodSignature">public&nbsp;org.apache.hadoop.conf.Configuration&nbsp;get()</pre> </li> </ul> </li> </ul> </section> </li> </ul> </div> </div> </main> <!-- ========= END OF CLASS DATA ========= --> <footer role="contentinfo"> <nav role="navigation"> <!-- ======= START OF BOTTOM NAVBAR ====== --> <div class="bottomNav"><a id="navbar.bottom"> <!-- --> </a> <div class="skipNav"><a href="#skip.navbar.bottom" title="Skip navigation links">Skip navigation links</a></div> <a id="navbar.bottom.firstrow"> <!-- --> </a> <ul class="navList" title="Navigation"> <li><a href="../../../../index.html">Overview</a></li> <li><a href="package-summary.html">Package</a></li> <li class="navBarCell1Rev">Class</li> <li><a href="package-tree.html">Tree</a></li> <li><a href="../../../../deprecated-list.html">Deprecated</a></li> <li><a href="../../../../index-all.html">Index</a></li> <li><a href="../../../../help-doc.html">Help</a></li> </ul> </div> <div class="subNav"> <ul class="navList" id="allclasses_navbar_bottom"> <li><a href="../../../../allclasses.html">All&nbsp;Classes</a></li> </ul> <div> <script type="text/javascript"><!-- allClassesLink = document.getElementById("allclasses_navbar_bottom"); if(window==top) { allClassesLink.style.display = "block"; } else { allClassesLink.style.display = "none"; } //--> </script> <noscript> <div>JavaScript is disabled on your browser.</div> </noscript> </div> <div> <ul class="subNavList"> <li>Summary:&nbsp;</li> <li>Nested&nbsp;|&nbsp;</li> <li>Field&nbsp;|&nbsp;</li> <li><a href="#constructor.summary">Constr</a>&nbsp;|&nbsp;</li> <li><a href="#method.summary">Method</a></li> </ul> <ul class="subNavList"> <li>Detail:&nbsp;</li> <li>Field&nbsp;|&nbsp;</li> <li><a href="#constructor.detail">Constr</a>&nbsp;|&nbsp;</li> <li><a href="#method.detail">Method</a></li> </ul> </div> <a id="skip.navbar.bottom"> <!-- --> </a></div> <!-- ======== END OF BOTTOM NAVBAR ======= --> </nav> </footer> </body> </html>
{ "pile_set_name": "Github" }
<?php /** * Zend Framework * * LICENSE * * This source file is subject to the new BSD license that is bundled * with this package in the file LICENSE.txt. * It is also available through the world-wide-web at this URL: * http://framework.zend.com/license/new-bsd * If you did not receive a copy of the license and are unable to * obtain it through the world-wide-web, please send an email * to license@zend.com so we can send you a copy immediately. * * @category Zend * @package Zend_XmlRpc * @subpackage Generator * @copyright Copyright (c) 2005-2012 Zend Technologies USA Inc. (http://www.zend.com) * @license http://framework.zend.com/license/new-bsd New BSD License * @version $Id: DomDocument.php 24593 2012-01-05 20:35:02Z matthew $ */ /** * @var Zend_XmlRpc_Generator_GeneratorAbstract */ require_once 'Zend/XmlRpc/Generator/GeneratorAbstract.php'; /** * DOMDocument based implementation of a XML/RPC generator */ class Zend_XmlRpc_Generator_DomDocument extends Zend_XmlRpc_Generator_GeneratorAbstract { /** * @var DOMDocument */ protected $_dom; /** * @var DOMNode */ protected $_currentElement; /** * Start XML element * * @param string $name * @return void */ protected function _openElement($name) { $newElement = $this->_dom->createElement($name); $this->_currentElement = $this->_currentElement->appendChild($newElement); } /** * Write XML text data into the currently opened XML element * * @param string $text */ protected function _writeTextData($text) { $this->_currentElement->appendChild($this->_dom->createTextNode($text)); } /** * Close an previously opened XML element * * Resets $_currentElement to the next parent node in the hierarchy * * @param string $name * @return void */ protected function _closeElement($name) { if (isset($this->_currentElement->parentNode)) { $this->_currentElement = $this->_currentElement->parentNode; } } /** * Save XML as a string * * @return string */ public function saveXml() { return $this->_dom->saveXml(); } /** * Initializes internal objects * * @return void */ protected function _init() { $this->_dom = new DOMDocument('1.0', $this->_encoding); $this->_currentElement = $this->_dom; } }
{ "pile_set_name": "Github" }
package relayedTx import ( "encoding/hex" "fmt" "math/big" "github.com/ElrondNetwork/elrond-go/core" "github.com/ElrondNetwork/elrond-go/core/check" "github.com/ElrondNetwork/elrond-go/data/state" "github.com/ElrondNetwork/elrond-go/data/transaction" "github.com/ElrondNetwork/elrond-go/integrationTests" "github.com/ElrondNetwork/elrond-go/p2p" "github.com/ElrondNetwork/elrond-go/process" ) func CreateGeneralSetupForRelayTxTest() ([]*integrationTests.TestProcessorNode, []int, []*integrationTests.TestWalletAccount, *integrationTests.TestWalletAccount, p2p.Messenger) { numOfShards := 2 nodesPerShard := 1 numMetachainNodes := 1 advertiser := integrationTests.CreateMessengerWithKadDht("") _ = advertiser.Bootstrap() nodes := integrationTests.CreateNodes( numOfShards, nodesPerShard, numMetachainNodes, integrationTests.GetConnectableAddress(advertiser), ) idxProposers := make([]int, numOfShards+1) for i := 0; i < numOfShards; i++ { idxProposers[i] = i * nodesPerShard } idxProposers[numOfShards] = numOfShards * nodesPerShard integrationTests.DisplayAndStartNodes(nodes) initialVal := big.NewInt(1000000000) integrationTests.MintAllNodes(nodes, initialVal) numPlayers := 5 numShards := nodes[0].ShardCoordinator.NumberOfShards() players := make([]*integrationTests.TestWalletAccount, numPlayers) for i := 0; i < numPlayers; i++ { shardId := uint32(i) % numShards players[i] = integrationTests.CreateTestWalletAccount(nodes[0].ShardCoordinator, shardId) } relayerAccount := integrationTests.CreateTestWalletAccount(nodes[0].ShardCoordinator, 0) integrationTests.MintAllPlayers(nodes, []*integrationTests.TestWalletAccount{relayerAccount}, initialVal) return nodes, idxProposers, players, relayerAccount, advertiser } func CreateAndSendRelayedAndUserTx( nodes []*integrationTests.TestProcessorNode, relayer *integrationTests.TestWalletAccount, player *integrationTests.TestWalletAccount, rcvAddr []byte, value *big.Int, gasLimit uint64, txData []byte, ) *transaction.Transaction { txDispatcherNode := getNodeWithinSameShardAsPlayer(nodes, player.Address) userTx := createUserTx(player, rcvAddr, value, gasLimit, txData) relayedTx := createRelayedTx(txDispatcherNode.EconomicsData, relayer, userTx) _, err := txDispatcherNode.SendTransaction(relayedTx) if err != nil { fmt.Println(err.Error()) } return relayedTx } func createUserTx( player *integrationTests.TestWalletAccount, rcvAddr []byte, value *big.Int, gasLimit uint64, txData []byte, ) *transaction.Transaction { tx := &transaction.Transaction{ Nonce: player.Nonce, Value: big.NewInt(0).Set(value), RcvAddr: rcvAddr, SndAddr: player.Address, GasPrice: integrationTests.MinTxGasPrice, GasLimit: gasLimit, Data: txData, ChainID: integrationTests.ChainID, Version: integrationTests.MinTransactionVersion, } txBuff, _ := tx.GetDataForSigning(integrationTests.TestAddressPubkeyConverter, integrationTests.TestTxSignMarshalizer) tx.Signature, _ = player.SingleSigner.Sign(player.SkTxSign, txBuff) player.Nonce++ return tx } func createRelayedTx( feeHandler process.FeeHandler, relayer *integrationTests.TestWalletAccount, userTx *transaction.Transaction, ) *transaction.Transaction { userTxMarshaled, _ := integrationTests.TestTxSignMarshalizer.Marshal(userTx) txData := core.RelayedTransaction + "@" + hex.EncodeToString(userTxMarshaled) tx := &transaction.Transaction{ Nonce: relayer.Nonce, Value: big.NewInt(0).Set(userTx.Value), RcvAddr: userTx.SndAddr, SndAddr: relayer.Address, GasPrice: integrationTests.MinTxGasPrice, Data: []byte(txData), ChainID: userTx.ChainID, Version: userTx.Version, } gasLimit := feeHandler.ComputeGasLimit(tx) tx.GasLimit = userTx.GasLimit + gasLimit txBuff, _ := tx.GetDataForSigning(integrationTests.TestAddressPubkeyConverter, integrationTests.TestTxSignMarshalizer) tx.Signature, _ = relayer.SingleSigner.Sign(relayer.SkTxSign, txBuff) relayer.Nonce++ txFee := big.NewInt(0).Mul(big.NewInt(0).SetUint64(tx.GasLimit), big.NewInt(0).SetUint64(tx.GasPrice)) relayer.Balance.Sub(relayer.Balance, txFee) relayer.Balance.Sub(relayer.Balance, tx.Value) return tx } func createAndSendSimpleTransaction( nodes []*integrationTests.TestProcessorNode, player *integrationTests.TestWalletAccount, rcvAddr []byte, value *big.Int, gasLimit uint64, txData []byte, ) { txDispatcherNode := getNodeWithinSameShardAsPlayer(nodes, player.Address) userTx := createUserTx(player, rcvAddr, value, gasLimit, txData) _, err := txDispatcherNode.SendTransaction(userTx) if err != nil { fmt.Println(err.Error()) } } func getNodeWithinSameShardAsPlayer( nodes []*integrationTests.TestProcessorNode, player []byte, ) *integrationTests.TestProcessorNode { nodeWithCaller := nodes[0] playerShId := nodeWithCaller.ShardCoordinator.ComputeId(player) for _, node := range nodes { if node.ShardCoordinator.SelfId() == playerShId { nodeWithCaller = node break } } return nodeWithCaller } func GetUserAccount( nodes []*integrationTests.TestProcessorNode, address []byte, ) state.UserAccountHandler { shardID := nodes[0].ShardCoordinator.ComputeId(address) for _, node := range nodes { if node.ShardCoordinator.SelfId() == shardID { acc, _ := node.AccntState.GetExistingAccount(address) if check.IfNil(acc) { return nil } userAcc := acc.(state.UserAccountHandler) return userAcc } } return nil }
{ "pile_set_name": "Github" }
<div class="page"> <div class="navbar"> <div class="navbar-bg"></div> <div class="navbar-inner sliding"> <div class="left"> <a href="#" class="link back"> <i class="icon icon-back"></i> <span class="if-not-md">Back</span> </a> </div> <div class="title">Content Block</div> </div> </div> <div class="page-content"> <p>This paragraph is outside of content block. Not cool, but useful for any custom elements with custom styling.</p> <div class="block"> <p>Here comes paragraph within content block. Donec et nulla auctor massa pharetra adipiscing ut sit amet sem. Suspendisse molestie velit vitae mattis tincidunt. Ut sit amet quam mollis, vulputate turpis vel, sagittis felis. </p> </div> <div class="block block-strong"> <p>Here comes another text block with additional "block-strong" class. Praesent nec imperdiet diam. Maecenas vel lectus porttitor, consectetur magna nec, viverra sem. Aliquam sed risus dolor. Morbi tincidunt ut libero id sodales. Integer blandit varius nisi quis consectetur. </p> </div> <div class="block-title">Block title</div> <div class="block"> <p>Donec et nulla auctor massa pharetra adipiscing ut sit amet sem. Suspendisse molestie velit vitae mattis tincidunt. Ut sit amet quam mollis, vulputate turpis vel, sagittis felis. </p> </div> <div class="block-title">Another ultra long content block title</div> <div class="block block-strong"> <p>Donec et nulla auctor massa pharetra adipiscing ut sit amet sem. Suspendisse molestie velit vitae mattis tincidunt. Ut sit amet quam mollis, vulputate turpis vel, sagittis felis. </p> </div> <div class="block-title">Inset</div> <div class="block block-strong inset"> <p>Donec et nulla auctor massa pharetra adipiscing ut sit amet sem. Suspendisse molestie velit vitae mattis tincidunt. Ut sit amet quam mollis, vulputate turpis vel, sagittis felis. </p> </div> <div class="block-title">Tablet Inset</div> <div class="block block-strong medium-inset"> <p>Donec et nulla auctor massa pharetra adipiscing ut sit amet sem. Suspendisse molestie velit vitae mattis tincidunt. Ut sit amet quam mollis, vulputate turpis vel, sagittis felis. </p> </div> <div class="block-title">With Header & Footer</div> <div class="block"> <div class="block-header">Block Header</div> <p>Here comes paragraph within content block. Donec et nulla auctor massa pharetra adipiscing ut sit amet sem. Suspendisse molestie velit vitae mattis tincidunt. Ut sit amet quam mollis, vulputate turpis vel, sagittis felis. </p> <div class="block-footer">Block Footer</div> </div> <div class="block-header">Block Header</div> <div class="block"> <p>Here comes paragraph within content block. Donec et nulla auctor massa pharetra adipiscing ut sit amet sem. Suspendisse molestie velit vitae mattis tincidunt. Ut sit amet quam mollis, vulputate turpis vel, sagittis felis. </p> </div> <div class="block-footer">Block Footer</div> <div class="block block-strong"> <div class="block-header">Block Header</div> <p>Here comes paragraph within content block. Donec et nulla auctor massa pharetra adipiscing ut sit amet sem. Suspendisse molestie velit vitae mattis tincidunt. Ut sit amet quam mollis, vulputate turpis vel, sagittis felis. </p> <div class="block-footer">Block Footer</div> </div> <div class="block-header">Block Header</div> <div class="block block-strong"> <p>Here comes paragraph within content block. Donec et nulla auctor massa pharetra adipiscing ut sit amet sem. Suspendisse molestie velit vitae mattis tincidunt. Ut sit amet quam mollis, vulputate turpis vel, sagittis felis. </p> </div> <div class="block-footer">Block Footer</div> <div class="block-title block-title-large">Block Title Large</div> <div class="block block-strong"> <p>Donec et nulla auctor massa pharetra adipiscing ut sit amet sem. Suspendisse molestie velit vitae mattis tincidunt. Ut sit amet quam mollis, vulputate turpis vel, sagittis felis. </p> </div> <div class="block-title block-title-medium">Block Title Medium</div> <div class="block block-strong"> <p>Donec et nulla auctor massa pharetra adipiscing ut sit amet sem. Suspendisse molestie velit vitae mattis tincidunt. Ut sit amet quam mollis, vulputate turpis vel, sagittis felis. </p> </div> </div> </div>
{ "pile_set_name": "Github" }
%verify "executed" %include "armv5te-vfp/funop.S" {"instr":"fsitos s1, s0"}
{ "pile_set_name": "Github" }
'use strict'; exports.__esModule = true; var _declaration = require('./declaration'); var _declaration2 = _interopRequireDefault(_declaration); var _tokenize = require('./tokenize'); var _tokenize2 = _interopRequireDefault(_tokenize); var _comment = require('./comment'); var _comment2 = _interopRequireDefault(_comment); var _atRule = require('./at-rule'); var _atRule2 = _interopRequireDefault(_atRule); var _root = require('./root'); var _root2 = _interopRequireDefault(_root); var _rule = require('./rule'); var _rule2 = _interopRequireDefault(_rule); function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } } var Parser = function () { function Parser(input) { _classCallCheck(this, Parser); this.input = input; this.root = new _root2.default(); this.current = this.root; this.spaces = ''; this.semicolon = false; this.createTokenizer(); this.root.source = { input: input, start: { line: 1, column: 1 } }; } Parser.prototype.createTokenizer = function createTokenizer() { this.tokenizer = (0, _tokenize2.default)(this.input); }; Parser.prototype.parse = function parse() { var token = void 0; while (!this.tokenizer.endOfFile()) { token = this.tokenizer.nextToken(); switch (token[0]) { case 'space': this.spaces += token[1]; break; case ';': this.freeSemicolon(token); break; case '}': this.end(token); break; case 'comment': this.comment(token); break; case 'at-word': this.atrule(token); break; case '{': this.emptyRule(token); break; default: this.other(token); break; } } this.endFile(); }; Parser.prototype.comment = function comment(token) { var node = new _comment2.default(); this.init(node, token[2], token[3]); node.source.end = { line: token[4], column: token[5] }; var text = token[1].slice(2, -2); if (/^\s*$/.test(text)) { node.text = ''; node.raws.left = text; node.raws.right = ''; } else { var match = text.match(/^(\s*)([^]*[^\s])(\s*)$/); node.text = match[2]; node.raws.left = match[1]; node.raws.right = match[3]; } }; Parser.prototype.emptyRule = function emptyRule(token) { var node = new _rule2.default(); this.init(node, token[2], token[3]); node.selector = ''; node.raws.between = ''; this.current = node; }; Parser.prototype.other = function other(start) { var end = false; var type = null; var colon = false; var bracket = null; var brackets = []; var tokens = []; var token = start; while (token) { type = token[0]; tokens.push(token); if (type === '(' || type === '[') { if (!bracket) bracket = token; brackets.push(type === '(' ? ')' : ']'); } else if (brackets.length === 0) { if (type === ';') { if (colon) { this.decl(tokens); return; } else { break; } } else if (type === '{') { this.rule(tokens); return; } else if (type === '}') { this.tokenizer.back(tokens.pop()); end = true; break; } else if (type === ':') { colon = true; } } else if (type === brackets[brackets.length - 1]) { brackets.pop(); if (brackets.length === 0) bracket = null; } token = this.tokenizer.nextToken(); } if (this.tokenizer.endOfFile()) end = true; if (brackets.length > 0) this.unclosedBracket(bracket); if (end && colon) { while (tokens.length) { token = tokens[tokens.length - 1][0]; if (token !== 'space' && token !== 'comment') break; this.tokenizer.back(tokens.pop()); } this.decl(tokens); return; } else { this.unknownWord(tokens); } }; Parser.prototype.rule = function rule(tokens) { tokens.pop(); var node = new _rule2.default(); this.init(node, tokens[0][2], tokens[0][3]); node.raws.between = this.spacesAndCommentsFromEnd(tokens); this.raw(node, 'selector', tokens); this.current = node; }; Parser.prototype.decl = function decl(tokens) { var node = new _declaration2.default(); this.init(node); var last = tokens[tokens.length - 1]; if (last[0] === ';') { this.semicolon = true; tokens.pop(); } if (last[4]) { node.source.end = { line: last[4], column: last[5] }; } else { node.source.end = { line: last[2], column: last[3] }; } while (tokens[0][0] !== 'word') { if (tokens.length === 1) this.unknownWord(tokens); node.raws.before += tokens.shift()[1]; } node.source.start = { line: tokens[0][2], column: tokens[0][3] }; node.prop = ''; while (tokens.length) { var type = tokens[0][0]; if (type === ':' || type === 'space' || type === 'comment') { break; } node.prop += tokens.shift()[1]; } node.raws.between = ''; var token = void 0; while (tokens.length) { token = tokens.shift(); if (token[0] === ':') { node.raws.between += token[1]; break; } else { node.raws.between += token[1]; } } if (node.prop[0] === '_' || node.prop[0] === '*') { node.raws.before += node.prop[0]; node.prop = node.prop.slice(1); } node.raws.between += this.spacesAndCommentsFromStart(tokens); this.precheckMissedSemicolon(tokens); for (var i = tokens.length - 1; i > 0; i--) { token = tokens[i]; if (token[1].toLowerCase() === '!important') { node.important = true; var string = this.stringFrom(tokens, i); string = this.spacesFromEnd(tokens) + string; if (string !== ' !important') node.raws.important = string; break; } else if (token[1].toLowerCase() === 'important') { var cache = tokens.slice(0); var str = ''; for (var j = i; j > 0; j--) { var _type = cache[j][0]; if (str.trim().indexOf('!') === 0 && _type !== 'space') { break; } str = cache.pop()[1] + str; } if (str.trim().indexOf('!') === 0) { node.important = true; node.raws.important = str; tokens = cache; } } if (token[0] !== 'space' && token[0] !== 'comment') { break; } } this.raw(node, 'value', tokens); if (node.value.indexOf(':') !== -1) this.checkMissedSemicolon(tokens); }; Parser.prototype.atrule = function atrule(token) { var node = new _atRule2.default(); node.name = token[1].slice(1); if (node.name === '') { this.unnamedAtrule(node, token); } this.init(node, token[2], token[3]); var prev = void 0; var shift = void 0; var last = false; var open = false; var params = []; while (!this.tokenizer.endOfFile()) { token = this.tokenizer.nextToken(); if (token[0] === ';') { node.source.end = { line: token[2], column: token[3] }; this.semicolon = true; break; } else if (token[0] === '{') { open = true; break; } else if (token[0] === '}') { if (params.length > 0) { shift = params.length - 1; prev = params[shift]; while (prev && prev[0] === 'space') { prev = params[--shift]; } if (prev) { node.source.end = { line: prev[4], column: prev[5] }; } } this.end(token); break; } else { params.push(token); } if (this.tokenizer.endOfFile()) { last = true; break; } } node.raws.between = this.spacesAndCommentsFromEnd(params); if (params.length) { node.raws.afterName = this.spacesAndCommentsFromStart(params); this.raw(node, 'params', params); if (last) { token = params[params.length - 1]; node.source.end = { line: token[4], column: token[5] }; this.spaces = node.raws.between; node.raws.between = ''; } } else { node.raws.afterName = ''; node.params = ''; } if (open) { node.nodes = []; this.current = node; } }; Parser.prototype.end = function end(token) { if (this.current.nodes && this.current.nodes.length) { this.current.raws.semicolon = this.semicolon; } this.semicolon = false; this.current.raws.after = (this.current.raws.after || '') + this.spaces; this.spaces = ''; if (this.current.parent) { this.current.source.end = { line: token[2], column: token[3] }; this.current = this.current.parent; } else { this.unexpectedClose(token); } }; Parser.prototype.endFile = function endFile() { if (this.current.parent) this.unclosedBlock(); if (this.current.nodes && this.current.nodes.length) { this.current.raws.semicolon = this.semicolon; } this.current.raws.after = (this.current.raws.after || '') + this.spaces; }; Parser.prototype.freeSemicolon = function freeSemicolon(token) { this.spaces += token[1]; if (this.current.nodes) { var prev = this.current.nodes[this.current.nodes.length - 1]; if (prev && prev.type === 'rule' && !prev.raws.ownSemicolon) { prev.raws.ownSemicolon = this.spaces; this.spaces = ''; } } }; // Helpers Parser.prototype.init = function init(node, line, column) { this.current.push(node); node.source = { start: { line: line, column: column }, input: this.input }; node.raws.before = this.spaces; this.spaces = ''; if (node.type !== 'comment') this.semicolon = false; }; Parser.prototype.raw = function raw(node, prop, tokens) { var token = void 0, type = void 0; var length = tokens.length; var value = ''; var clean = true; for (var i = 0; i < length; i += 1) { token = tokens[i]; type = token[0]; if (type === 'comment' || type === 'space' && i === length - 1) { clean = false; } else { value += token[1]; } } if (!clean) { var raw = tokens.reduce(function (all, i) { return all + i[1]; }, ''); node.raws[prop] = { value: value, raw: raw }; } node[prop] = value; }; Parser.prototype.spacesAndCommentsFromEnd = function spacesAndCommentsFromEnd(tokens) { var lastTokenType = void 0; var spaces = ''; while (tokens.length) { lastTokenType = tokens[tokens.length - 1][0]; if (lastTokenType !== 'space' && lastTokenType !== 'comment') break; spaces = tokens.pop()[1] + spaces; } return spaces; }; Parser.prototype.spacesAndCommentsFromStart = function spacesAndCommentsFromStart(tokens) { var next = void 0; var spaces = ''; while (tokens.length) { next = tokens[0][0]; if (next !== 'space' && next !== 'comment') break; spaces += tokens.shift()[1]; } return spaces; }; Parser.prototype.spacesFromEnd = function spacesFromEnd(tokens) { var lastTokenType = void 0; var spaces = ''; while (tokens.length) { lastTokenType = tokens[tokens.length - 1][0]; if (lastTokenType !== 'space') break; spaces = tokens.pop()[1] + spaces; } return spaces; }; Parser.prototype.stringFrom = function stringFrom(tokens, from) { var result = ''; for (var i = from; i < tokens.length; i++) { result += tokens[i][1]; } tokens.splice(from, tokens.length - from); return result; }; Parser.prototype.colon = function colon(tokens) { var brackets = 0; var token = void 0, type = void 0, prev = void 0; for (var i = 0; i < tokens.length; i++) { token = tokens[i]; type = token[0]; if (type === '(') { brackets += 1; } else if (type === ')') { brackets -= 1; } else if (brackets === 0 && type === ':') { if (!prev) { this.doubleColon(token); } else if (prev[0] === 'word' && prev[1] === 'progid') { continue; } else { return i; } } prev = token; } return false; }; // Errors Parser.prototype.unclosedBracket = function unclosedBracket(bracket) { throw this.input.error('Unclosed bracket', bracket[2], bracket[3]); }; Parser.prototype.unknownWord = function unknownWord(tokens) { throw this.input.error('Unknown word', tokens[0][2], tokens[0][3]); }; Parser.prototype.unexpectedClose = function unexpectedClose(token) { throw this.input.error('Unexpected }', token[2], token[3]); }; Parser.prototype.unclosedBlock = function unclosedBlock() { var pos = this.current.source.start; throw this.input.error('Unclosed block', pos.line, pos.column); }; Parser.prototype.doubleColon = function doubleColon(token) { throw this.input.error('Double colon', token[2], token[3]); }; Parser.prototype.unnamedAtrule = function unnamedAtrule(node, token) { throw this.input.error('At-rule without name', token[2], token[3]); }; Parser.prototype.precheckMissedSemicolon = function precheckMissedSemicolon(tokens) { // Hook for Safe Parser tokens; }; Parser.prototype.checkMissedSemicolon = function checkMissedSemicolon(tokens) { var colon = this.colon(tokens); if (colon === false) return; var founded = 0; var token = void 0; for (var j = colon - 1; j >= 0; j--) { token = tokens[j]; if (token[0] !== 'space') { founded += 1; if (founded === 2) break; } } throw this.input.error('Missed semicolon', token[2], token[3]); }; return Parser; }(); exports.default = Parser; module.exports = exports['default']; //# sourceMappingURL=data:application/json;charset=utf8;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbInBhcnNlci5lczYiXSwibmFtZXMiOlsiUGFyc2VyIiwiaW5wdXQiLCJyb290IiwiY3VycmVudCIsInNwYWNlcyIsInNlbWljb2xvbiIsImNyZWF0ZVRva2VuaXplciIsInNvdXJjZSIsInN0YXJ0IiwibGluZSIsImNvbHVtbiIsInRva2VuaXplciIsInBhcnNlIiwidG9rZW4iLCJlbmRPZkZpbGUiLCJuZXh0VG9rZW4iLCJmcmVlU2VtaWNvbG9uIiwiZW5kIiwiY29tbWVudCIsImF0cnVsZSIsImVtcHR5UnVsZSIsIm90aGVyIiwiZW5kRmlsZSIsIm5vZGUiLCJpbml0IiwidGV4dCIsInNsaWNlIiwidGVzdCIsInJhd3MiLCJsZWZ0IiwicmlnaHQiLCJtYXRjaCIsInNlbGVjdG9yIiwiYmV0d2VlbiIsInR5cGUiLCJjb2xvbiIsImJyYWNrZXQiLCJicmFja2V0cyIsInRva2VucyIsInB1c2giLCJsZW5ndGgiLCJkZWNsIiwicnVsZSIsImJhY2siLCJwb3AiLCJ1bmNsb3NlZEJyYWNrZXQiLCJ1bmtub3duV29yZCIsInNwYWNlc0FuZENvbW1lbnRzRnJvbUVuZCIsInJhdyIsImxhc3QiLCJiZWZvcmUiLCJzaGlmdCIsInByb3AiLCJzcGFjZXNBbmRDb21tZW50c0Zyb21TdGFydCIsInBy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jtcbiAgICAgICAgd2hpbGUgKCAhdGhpcy50b2tlbml6ZXIuZW5kT2ZGaWxlKCkgKSB7XG4gICAgICAgICAgICB0b2tlbiA9IHRoaXMudG9rZW5pemVyLm5leHRUb2tlbigpO1xuXG4gICAgICAgICAgICBzd2l0Y2ggKCB0b2tlblswXSApIHtcblxuICAgICAgICAgICAgY2FzZSAnc3BhY2UnOlxuICAgICAgICAgICAgICAgIHRoaXMuc3BhY2VzICs9IHRva2VuWzFdO1xuICAgICAgICAgICAgICAgIGJyZWFrO1xuXG4gICAgICAgICAgICBjYXNlICc7JzpcbiAgICAgICAgICAgICAgICB0aGlzLmZyZWVTZW1pY29sb24odG9rZW4pO1xuICAgICAgICAgICAgICAgIGJyZWFrO1xuXG4gICAgICAgICAgICBjYXNlICd9JzpcbiAgICAgICAgICAgICAgICB0aGlzLmVuZCh0b2tlbik7XG4gICAgICAgICAgICAgICAgYnJlYWs7XG5cbiAgICAgICAgICAgIGNhc2UgJ2NvbW1lbnQnOlxuICAgICAgICAgICAgICAgIHRoaXMuY29tbWVudCh0b2tlbik7XG4gICAgICAgICAgICAgICAgYnJlYWs7XG5cbiAgICAgICAgICAgIGNhc2UgJ2F0LXdvcmQnOlxuICAgICAgICAgICAgICAgIHRoaXMuYXRydWxlKHRva2VuKTtcbiAgICAgICAgICAgICAgICBicmVhaztcblxuICAgICAgICAgICAgY2FzZSAneyc6XG4gICAgICAgICAgICAgICAgdGhpcy5lbXB0eVJ1bGUodG9rZW4pO1xuICAgICAgICAgICAgICAgIGJyZWFrO1xuXG4gICAgICAgICAgICBkZWZhdWx0OlxuICAgICAgICAgICAgICAgIHRoaXMub3RoZXIodG9rZW4pO1xuICAgICAgICAgICAgICAgIGJyZWFrO1xuICAgICAgICAgICAgfVxuICAgICAgICB9XG4gICAgICAgIHRoaXMuZW5kRmlsZSgpO1xuICAgIH1cblxuICAgIGNvbW1lbnQodG9rZW4pIHtcbiAgICAgICAgbGV0IG5vZGUgPSBuZXcgQ29tbWVudCgpO1xuICAgICAgICB0aGlzLmluaXQobm9kZSwgdG9rZW5bMl0sIHRva2VuWzNdKTtcbiAgICAgICAgbm9kZS5zb3VyY2UuZW5kID0geyBsaW5lOiB0b2tlbls0XSwgY29sdW1uOiB0b2tlbls1XSB9O1xuXG4gICAgICAgIGxldCB0ZXh0ID0gdG9rZW5bMV0uc2xpY2UoMiwgLTIpO1xuICAgICAgICBpZiAoIC9eXFxzKiQvLnRlc3QodGV4dCkgKSB7XG4gICAgICAgICAgICBub2RlLnRleHQgICAgICAgPSAnJztcbiAgICAgICAgICAgIG5vZGUucmF3cy5sZWZ0ICA9IHRleHQ7XG4gICAgICAgICAgICBub2RlLnJhd3MucmlnaHQgPSAnJztcbiAgICAgICAgfSBlbHNlIHtcbiAgICAgICAgICAgIGxldCBtYXRjaCA9IHRleHQubWF0Y2goL14oXFxzKikoW15dKlteXFxzXSkoXFxzKikkLyk7XG4gICAgICAgICAgICBub2RlLnRleHQgICAgICAgPSBtYXRjaFsyXTtcbiAgICAgICAgICAgIG5vZGUucmF3cy5sZWZ0ICA9IG1hdGNoWzFdO1xuICAgICAgICAgICAgbm9kZS5yYXdzLnJpZ2h0ID0gbWF0Y2hbM107XG4gICAgICAgIH1cbiAgICB9XG5cbiAgICBlbXB0eVJ1bGUodG9rZW4pIHtcbiAgICAgICAgbGV0IG5vZGUgPSBuZXcgUnVsZSgpO1xuICAgICAgICB0aGlzLmluaXQobm9kZSwgdG9rZW5bMl0sIHRva2VuWzNdKTtcbiAgICAgICAgbm9kZS5zZWxlY3RvciA9ICcnO1xuICAgICAgICBub2RlLnJhd3MuYmV0d2VlbiA9ICcnO1xuICAgICAgICB0aGlzLmN1cnJlbnQgPSBub2RlO1xuICAgIH1cblxuICAgIG90aGVyKHN0YXJ0KSB7XG4gICAgICAgIGxldCBlbmQgICAgICA9IGZhbHNlO1xuICAgICAgICBsZXQgdHlwZSAgICAgPSBudWxsO1xuICAgICAgICBsZXQgY29sb24gICAgPSBmYWxzZTtcbiAgICAgICAgbGV0IGJyYWNrZXQgID0gbnVsbDtcbiAgICAgICAgbGV0IGJyYWNrZXRzID0gW107XG5cbiAgICAgICAgbGV0IHRva2VucyA9IFtdO1xuICAgICAgICBsZXQgdG9rZW4gPSBzdGFydDtcbiAgICAgICAgd2hpbGUgKCB0b2tlbiApIHtcbiAgICAgICAgICAgIHR5cGUgPSB0b2tlblswXTtcbiAgICAgICAgICAgIHRva2Vucy5wdXNoKHRva2VuKTtcblxuICAgICAgICAgICAgaWYgKCB0eXBlID09PSAnKCcgfHwgdHlwZSA9PT0gJ1snICkge1xuICAgICAgICAgICAgICAgIGlmICggIWJyYWNrZXQgKSBicmFja2V0ID0gdG9rZW47XG4gICAgICAgICAgICAgICAgYnJhY2tldHMucHVzaCh0eXBlID09PSAnKCcgPyAnKScgOiAnXScpO1xuXG4gICAgICAgICAgICB9IGVsc2UgaWYgKCBicmFja2V0cy5sZW5ndGggPT09IDAgKSB7XG4gICAgICAgICAgICAgICAgaWYgKCB0eXBlID09PSAnOycgKSB7XG4gICAgICAgICAgICAgICAgICAgIGlmICggY29sb24gKSB7XG4gICAgICAgICAgICAgICAgICAgICAgICB0aGlzLmRlY2wodG9rZW5zKTtcbiAgICAgICAgICAgICAgICAgICAgICAgIHJldHVybjtcbiAgICAgICAgICAgICAgICAgICAgfSBlbHNlIHtcbiAgICAgICAgICAgICAgICAgICAgICAgIGJyZWFrO1xuICAgICAgICAgICAgICAgICAgICB9XG5cbiAgICAgICAgICAgICAgICB9IGVsc2UgaWYgKCB0eXBlID09PSAneycgKSB7XG4gICAgICAgICAgICAgICAgICAgIHRoaXMucnVsZSh0b2tlbnMpO1xuICAgICAgICAgICAgICAgICAgICByZXR1cm47XG5cbiAgICAgICAgICAgICAgICB9IGVsc2UgaWYgKCB0eXBlID09PSAnfScgKSB7XG4gICAgICAgICAgICAgICAgICAgIHRoaXMudG9rZW5pemVyLmJhY2sodG9rZW5zLnBvcCgpKTtcbiAgICAgICAgICAgICAgICAgICAgZW5kID0gdHJ1ZTtcbiAgICAgICAgICAgICAgICAgICAgYnJlYWs7XG5cbiAgICAgICAgICAgICAgICB9IGVsc2UgaWYgKCB0eXBlID09PSAnOicgKSB7XG4gICAgICAgICAgICAgICAgICAgIGNvbG9uID0gdHJ1ZTtcbiAgICAgICAgICAgICAgICB9XG5cbiAgICAgICAgICAgIH0gZWxzZSBpZiAoIHR5cGUgPT09IGJyYWNrZXRzW2JyYWNrZXRzLmxlbmd0aCAtIDFdICkge1xuICAgICAgICAgICAgICAgIGJyYWNrZXRzLnBvcCgpO1xuICAgICAgICAgICAgICAgIGlmICggYnJhY2tldHMubGVuZ3RoID09PSAwICkgYnJhY2tldCA9IG51bGw7XG4gICAgICAgICAgICB9XG5cbiAgICAgICAgICAgIHRva2VuID0gdGhpcy50b2tlbml6ZXIubmV4dFRva2VuKCk7XG4gICAgICAgIH1cblxuICAgICAgICBpZiAoIHRoaXMudG9rZW5pemVyLmVuZE9mRmlsZSgpICkgZW5kID0gdHJ1ZTtcbiAgICAgICAgaWYgKCBicmFja2V0cy5sZW5ndGggPiAwICkgdGhpcy51bmNsb3NlZEJyYWNrZXQoYnJhY2tldCk7XG5cbiAgICAgICAgaWYgKCBlbmQgJiYgY29sb24gKSB7XG4gICAgICAgICAgICB3aGlsZSAoIHRva2Vucy5sZW5ndGggKSB7XG4gICAgICAgICAgICAgICAgdG9rZW4gPSB0b2tlbnNbdG9rZW5zLmxlbmd0aCAtIDFdWzBdO1xuICAgICAgICAgICAgICAgIGlmICggdG9rZW4gIT09ICdzcGFjZScgJiYgdG9rZW4gIT09ICdjb21tZW50JyApIGJyZWFrO1xuICAgICAgICAgICAgICAgIHRoaXMudG9rZW5pemVyLmJhY2sodG9rZW5zLnBvcCgpKTtcbiAgICAgICAgICAgIH1cbiAgICAgICAgICAgIHRoaXMuZGVjbCh0b2tlbnMpO1xuICAgICAgICAgICAgcmV0dXJuO1xuICAgICAgICB9IGVsc2Uge1xuICAgICAgICAgICAgdGhpcy51bmtub3duV29yZCh0b2tlbnMpO1xuICAgICAgICB9XG4gICAgfVxuXG4gICAgcnVsZSh0b2tlbnMpIHtcbiAgICAgICAgdG9rZW5zLnBvcCgpO1xuXG4gICAgICAgIGxldCBub2RlID0gbmV3IFJ1bGUoKTtcbiAgICAgICAgdGhpcy5pbml0KG5vZGUsIHRva2Vuc1swXVsyXSwgdG9rZW5zWzBdWzNdKTtcblxuICAgICAgICBub2RlLnJhd3MuYmV0d2VlbiA9IHRoaXMuc3BhY2VzQW5kQ29tbWVudHNGcm9tRW5kKHRva2Vucyk7XG4gICAgICAgIHRoaXMucmF3KG5vZGUsICdzZWxlY3RvcicsIHRva2Vucyk7XG4gICAgICAgIHRoaXMuY3VycmVudCA9IG5vZGU7XG4gICAgfVxuXG4gICAgZGVjbCh0b2tlbnMpIHtcbiAgICAgICAgbGV0IG5vZGUgPSBuZXcgRGVjbGFyYXRpb24oKTtcbiAgICAgICAgdGhpcy5pbml0KG5vZGUpO1xuXG4gICAgICAgIGxldCBsYXN0ID0gdG9rZW5zW3Rva2Vucy5sZW5ndGggLSAxXTtcbiAgICAgICAgaWYgKCBsYXN0WzBdID09PSAnOycgKSB7XG4gICAgICAgICAgICB0aGlzLnNlbWljb2xvbiA9IHRydWU7XG4gICAgICAgICAgICB0b2tlbnMucG9wKCk7XG4gICAgICAgIH1cbiAgICAgICAgaWYgKCBsYXN0WzRdICkge1xuICAgICAgICAgICAgbm9kZS5zb3VyY2UuZW5kID0geyBsaW5lOiBsYXN0WzRdLCBjb2x1bW46IGxhc3RbNV0gfTtcbiAgICAgICAgfSBlbHNlIHtcbiAgICAgICAgICAgIG5vZGUuc291cmNlLmVuZCA9IHsgbGluZTogbGFzdFsyXSwgY29sdW1uOiBsYXN0WzNdIH07XG4gICAgICAgIH1cblxuICAgICAgICB3aGlsZSAoIHRva2Vuc1swXVswXSAhPT0gJ3dvcmQnICkge1xuICAgICAgICAgICAgaWYgKCB0b2tlbnMubGVuZ3RoID09PSAxICkgdGhpcy51bmtub3duV29yZCh0b2tlbnMpO1xuICAgICAgICAgICAgbm9kZS5yYXdzLmJlZm9yZSArPSB0b2tlbnMuc2hpZnQoKVsxXTtcbiAgICAgICAgfVxuICAgICAgICBub2RlLnNvdXJjZS5zdGFydCA9IHsgbGluZTogdG9rZW5zWzBdWzJdLCBjb2x1bW46IHRva2Vuc1swXVszXSB9O1xuXG4gICAgICAgIG5vZGUucHJvcCA9ICcnO1xuICAgICAgICB3aGlsZSAoIHRva2Vucy5sZW5ndGggKSB7XG4gICAgICAgICAgICBsZXQgdHlwZSA9IHRva2Vuc1swXVswXTtcbiAgICAgICAgICAgIGlmICggdHlwZSA9PT0gJzonIHx8IHR5cGUgPT09ICdzcGFjZScgfHwgdHlwZSA9PT0gJ2NvbW1lbnQnICkge1xuICAgICAgICAgICAgICAgIGJyZWFrO1xuICAgICAgICAgICAgfVxuICAgICAgICAgICAgbm9kZS5wcm9wICs9IHRva2Vucy5zaGlmdCgpWzFdO1xuICAgICAgICB9XG5cbiAgICAgICAgbm9kZS5yYXdzLmJldHdlZW4gPSAnJztcblxuICAgICAgICBsZXQgdG9rZW47XG4gICAgICAgIHdoaWxlICggdG9rZW5zLmxlbmd0aCApIHtcbiAgICAgICAgICAgIHRva2VuID0gdG9rZW5zLnNoaWZ0KCk7XG5cbiAgICAgICAgICAgIGlmICggdG9rZW5bMF0gPT09ICc6JyApIHtcbiAgICAgICAgICAgICAgICBub2RlLnJhd3MuYmV0d2VlbiArPSB0b2tlblsxXTtcbiAgICAgICAgICAgICAgICBicmVhaztcbiAgICAgICAgICAgIH0gZWxzZSB7XG4gICAgICAgICAgICAgICAgbm9kZS5yYXdzLmJldHdlZW4gKz0gdG9rZW5bMV07XG4gICAgICAgICAgICB9XG4gICAgICAgIH1cblxuICAgICAgICBpZiAoIG5vZGUucHJvcFswXSA9PT0gJ18nIHx8IG5vZGUucHJvcFswXSA9PT0gJyonICkge1xuICAgICAgICAgICAgbm9kZS5yYXdzLmJlZm9yZSArPSBub2RlLnByb3BbMF07XG4gICAgICAgICAgICBub2RlLnByb3AgPSBub2RlLnByb3Auc2xpY2UoMSk7XG4gICAgICAgIH1cbiAgICAgICAgbm9kZS5yYXdzLmJldHdlZW4gKz0gdGhpcy5zcGFjZXNBbmRDb21tZW50c0Zyb21TdGFydCh0b2tlbnMpO1xuICAgICAgICB0aGlzLnByZWNoZWNrTWlzc2VkU2VtaWNvbG9uKHRva2Vucyk7XG5cbiAgICAgICAgZm9yICggbGV0IGkgPSB0b2tlbnMubGVuZ3RoIC0gMTsgaSA+IDA7IGktLSApIHtcbiAgICAgICAgICAgIHRva2VuID0gdG9rZW5zW2ldO1xuICAgICAgICAgICAgaWYgKCB0b2tlblsxXS50b0xvd2VyQ2FzZSgpID09PSAnIWltcG9ydGFudCcgKSB7XG4gICAgICAgICAgICAgICAgbm9kZS5pbXBvcnRhbnQgPSB0cnVlO1xuICAgICAgICAgICAgICAgIGxldCBzdHJpbmcgPSB0aGlzLnN0cmluZ0Zyb20odG9rZW5zLCBpKTtcbiAgICAgICAgICAgICAgICBzdHJpbmcgPSB0aGlzLnNwYWNlc0Zyb21FbmQodG9rZW5zKSArIHN0cmluZztcbiAgICAgICAgICAgICAgICBpZiAoIHN0cmluZyAhPT0gJyAhaW1wb3J0YW50JyApIG5vZGUucmF3cy5pbXBvcnRhbnQgPSBzdHJpbmc7XG4gICAgICAgICAgICAgICAgYnJlYWs7XG5cbiAgICAgICAgICAgIH0gZWxzZSBpZiAodG9rZW5bMV0udG9Mb3dlckNhc2UoKSA9PT0gJ2ltcG9ydGFudCcpIHtcbiAgICAgICAgICAgICAgICBsZXQgY2FjaGUgPSB0b2tlbnMuc2xpY2UoMCk7XG4gICAgICAgICAgICAgICAgbGV0IHN0ciAgID0gJyc7XG4gICAgICAgICAgICAgICAgZm9yICggbGV0IGogPSBpOyBqID4gMDsgai0tICkge1xuICAgICAgICAgICAgICAgICAgICBsZXQgdHlwZSA9IGNhY2hlW2pdWzBdO1xuICAgICAgICAgICAgICAgICAgICBpZiAoIHN0ci50cmltKCkuaW5kZXhPZignIScpID09PSAwICYmIHR5cGUgIT09ICdzcGFjZScgKSB7XG4gICAgICAgICAgICAgICAgICAgICAgICBicmVhaztcbiAgICAgICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgICAgICAgICBzdHIgPSBjYWNoZS5wb3AoKVsxXSArIHN0cjtcbiAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICAgICAgaWYgKCBzdHIudHJpbSgpLmluZGV4T2YoJyEnKSA9PT0gMCApIHtcbiAgICAgICAgICAgICAgICAgICAgbm9kZS5pbXBvcnRhbnQgPSB0cnVlO1xuICAgICAgICAgICAgICAgICAgICBub2RlLnJhd3MuaW1wb3J0YW50ID0gc3RyO1xuICAgICAgICAgICAgICAgICAgICB0b2tlbnMgPSBjYWNoZTtcbiAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICB9XG5cbiAgICAgICAgICAgIGlmICggdG9rZW5bMF0gIT09ICdzcGFjZScgJiYgdG9rZW5bMF0gIT09ICdjb21tZW50JyApIHtcbiAgICAgICAgICAgICAgICBicmVhaztcbiAgICAgICAgICAgIH1cbiAgICAgICAgfVxuXG4gICAgICAgIHRoaXMucmF3KG5vZGUsICd2YWx1ZScsIHRva2Vucyk7XG5cbiAgICAgICAgaWYgKCBub2RlLnZhbHVlLmluZGV4T2YoJzonKSAhPT0gLTEgKSB0aGlzLmNoZWNrTWlzc2VkU2VtaWNvbG9uKHRva2Vucyk7XG4gICAgfVxuXG4gICAgYXRydWxlKHRva2VuKSB7XG4gICAgICAgIGxldCBub2RlICA9IG5ldyBBdFJ1bGUoKTtcbiAgICAgICAgbm9kZS5uYW1lID0gdG9rZW5bMV0uc2xpY2UoMSk7XG4gICAgICAgIGlmICggbm9kZS5uYW1lID09PSAnJyApIHtcbiAgICAgICAgICAgIHRoaXMudW5uYW1lZEF0cnVsZShub2RlLCB0b2tlbik7XG4gICAgICAgIH1cbiAgICAgICAgdGhpcy5pbml0KG5vZGUsIHRva2VuWzJdLCB0b2tlblszXSk7XG5cbiAgICAgICAgbGV0IHByZXY7XG4gICAgICAgIGxldCBzaGlmdDtcbiAgICAgICAgbGV0IGxhc3QgICA9IGZhbHNlO1xuICAgICAgICBsZXQgb3BlbiAgID0gZmFsc2U7XG4gICAgICAgIGxldCBwYXJhbXMgPSBbXTtcblxuICAgICAgICB3aGlsZSAoICF0aGlzLnRva2VuaXplci5lbmRPZkZpbGUoKSApIHtcbiAgICAgICAgICAgIHRva2VuID0gdGhpcy50b2tlbml6ZXIubmV4dFRva2VuKCk7XG5cbiAgICAgICAgICAgIGlmICggdG9rZW5bMF0gPT09ICc7JyApIHtcbiAgICAgICAgICAgICAgICBub2RlLnNvdXJjZS5lbmQgPSB7IGxpbmU6IHRva2VuWzJdLCBjb2x1bW46IHRva2VuWzNdIH07XG4gICAgICAgICAgICAgICAgdGhpcy5zZW1pY29sb24gPSB0cnVlO1xuICAgICAgICAgICAgICAgIGJyZWFrO1xuICAgICAgICAgICAgfSBlbHNlIGlmICggdG9rZW5bMF0gPT09ICd7JyApIHtcbiAgICAgICAgICAgICAgICBvcGVuID0gdHJ1ZTtcbiAgICAgICAgICAgICAgICBicmVhaztcbiAgICAgICAgICAgIH0gZWxzZSBpZiAoIHRva2VuWzBdID09PSAnfScpIHtcbiAgICAgICAgICAgICAgICBpZiAoIHBhcmFtcy5sZW5ndGggPiAwICkge1xuICAgICAgICAgICAgICAgICAgICBzaGlmdCA9IHBhcmFtcy5sZW5ndGggLSAxO1xuICAgICAgICAgICAgICAgICAgICBwcmV2ID0gcGFyYW1zW3NoaWZ0XTtcbiAgICAgICAgICAgICAgICAgICAgd2hpbGUgKCBwcmV2ICYmIHByZXZbMF0gPT09ICdzcGFjZScgKSB7XG4gICAgICAgICAgICAgICAgICAgICAgICBwcmV2ID0gcGFyYW1zWy0tc2hpZnRdO1xuICAgICAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICAgICAgICAgIGlmICggcHJldiApIHtcbiAgICAgICAgICAgICAgICAgICAgICAgIG5vZGUuc291cmNlLmVuZCA9IHsgbGluZTogcHJldls0XSwgY29sdW1uOiBwcmV2WzVdIH07XG4gICAgICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICAgICAgdGhpcy5lbmQodG9rZW4pO1xuICAgICAgICAgICAgICAgIGJyZWFrO1xuICAgICAgICAgICAgfSBlbHNlIHtcbiAgICAgICAgICAgICAgICBwYXJhbXMucHVzaCh0b2tlbik7XG4gICAgICAgICAgICB9XG5cbiAgICAgICAgICAgIGlmICggdGhpcy50b2tlbml6ZXIuZW5kT2ZGaWxlKCkgKSB7XG4gICAgICAgICAgICAgICAgbGFzdCA9IHRydWU7XG4gICAgICAgICAgICAgICAgYnJlYWs7XG4gICAgICAgICAgICB9XG4gICAgICAgIH1cblxuICAgICAgICBub2RlLnJhd3MuYmV0d2VlbiA9IHRoaXMuc3BhY2VzQW5kQ29tbWVudHNGcm9tRW5kKHBhcmFtcyk7XG4gICAgICAgIGlmICggcGFyYW1zLmxlbmd0aCApIHtcbiAgICAgICAgICAgIG5vZGUucmF3cy5hZnRlck5hbWUgPSB0aGlzLnNwYWNlc0FuZENvbW1lbnRzRnJvbVN0YXJ0KHBhcmFtcyk7XG4gICAgICAgICAgICB0aGlzLnJhdyhub2RlLCAncGFyYW1zJywgcGFyYW1zKTtcbiAgICAgICAgICAgIGlmICggbGFzdCApIHtcbiAgICAgICAgICAgICAgICB0b2tlbiA9IHBhcmFtc1twYXJhbXMubGVuZ3RoIC0gMV07XG4gICAgICAgICAgICAgICAgbm9kZS5zb3VyY2UuZW5kICAgPSB7IGxpbmU6IHRva2VuWzRdLCBjb2x1bW46IHRva2VuWzVdIH07XG4gICAgICAgICAgICAgICAgdGhpcy5zcGFjZXMgICAgICAgPSBub2RlLnJhd3MuYmV0d2VlbjtcbiAgICAgICAgICAgICAgICBub2RlLnJhd3MuYmV0d2VlbiA9ICcnO1xuICAgICAgICAgICAgfVxuICAgICAgICB9IGVsc2Uge1xuICAgICAgICAgICAgbm9kZS5yYXdzLmFmdGVyTmFtZSA9ICcnO1xuICAgICAgICAgICAgbm9kZS5wYXJhbXMgICAgICAgICA9ICcnO1xuICAgICAgICB9XG5cbiAgICAgICAgaWYgKCBvcGVuICkge1xuICAgICAgICAgICAgbm9kZS5ub2RlcyAgID0gW107XG4gICAgICAgICAgICB0aGlzLmN1cnJlbnQgPSBub2RlO1xuICAgICAgICB9XG4gICAgfVxuXG4gICAgZW5kKHRva2VuKSB7XG4gICAgICAgIGlmICggdGhpcy5jdXJyZW50Lm5vZGVzICYmIHRoaXMuY3VycmVudC5ub2Rlcy5sZW5ndGggKSB7XG4gICAgICAgICAgICB0aGlzLmN1cnJlbnQucmF3cy5zZW1pY29sb24gPSB0aGlzLnNlbWljb2xvbjtcbiAgICAgICAgfVxuICAgICAgICB0aGlzLnNlbWljb2xvbiA9IGZhbHNlO1xuXG4gICAgICAgIHRoaXMuY3VycmVudC5yYXdzLmFmdGVyID0gKHRoaXMuY3VycmVudC5yYXdzLmFmdGVyIHx8ICcnKSArIHRoaXMuc3BhY2VzO1xuICAgICAgICB0aGlzLnNwYWNlcyA9ICcnO1xuXG4gICAgICAgIGlmICggdGhpcy5jdXJyZW50LnBhcmVudCApIHtcbiAgICAgICAgICAgIHRoaXMuY3VycmVudC5zb3VyY2UuZW5kID0geyBsaW5lOiB0b2tlblsyXSwgY29sdW1uOiB0b2tlblszXSB9O1xuICAgICAgICAgICAgdGhpcy5jdXJyZW50ID0gdGhpcy5jdXJyZW50LnBhcmVudDtcbiAgICAgICAgfSBlbHNlIHtcbiAgICAgICAgICAgIHRoaXMudW5leHBlY3RlZENsb3NlKHRva2VuKTtcbiAgICAgICAgfVxuICAgIH1cblxuICAgIGVuZEZpbGUoKSB7XG4gICAgICAgIGlmICggdGhpcy5jdXJyZW50LnBhcmVudCApIHRoaXMudW5jbG9zZWRCbG9jaygpO1xuICAgICAgICBpZiAoIHRoaXMuY3VycmVudC5ub2RlcyAmJiB0aGlzLmN1cnJlbnQubm9kZXMubGVuZ3RoICkge1xuICAgICAgICAgICAgdGhpcy5jdXJyZW50LnJhd3Muc2VtaWNvbG9uID0gdGhpcy5zZW1pY29sb247XG4gICAgICAgIH1cbiAgICAgICAgdGhpcy5jdXJyZW50LnJhd3MuYWZ0ZXIgPSAodGhpcy5jdXJyZW50LnJhd3MuYWZ0ZXIgfHwgJycpICsgdGhpcy5zcGFjZXM7XG4gICAgfVxuXG4gICAgZnJlZVNlbWljb2xvbih0b2tlbikge1xuICAgICAgICB0aGlzLnNwYWNlcyArPSB0b2tlblsxXTtcbiAgICAgICAgaWYgKCB0aGlzLmN1cnJlbnQubm9kZXMgKSB7XG4gICAgICAgICAgICBsZXQgcHJldiA9IHRoaXMuY3VycmVudC5ub2Rlc1t0aGlzLmN1cnJlbnQubm9kZXMubGVuZ3RoIC0gMV07XG4gICAgICAgICAgICBpZiAoIHByZXYgJiYgcHJldi50eXBlID09PSAncnVsZScgJiYgIXByZXYucmF3cy5vd25TZW1pY29sb24gKSB7XG4gICAgICAgICAgICAgICAgcHJldi5yYXdzLm93blNlbWljb2xvbiA9IHRoaXMuc3BhY2VzO1xuICAgICAgICAgICAgICAgIHRoaXMuc3BhY2VzID0gJyc7XG4gICAgICAgICAgICB9XG4gICAgICAgIH1cbiAgICB9XG5cbiAgICAvLyBIZWxwZXJzXG5cbiAgICBpbml0KG5vZGUsIGxpbmUsIGNvbHVtbikge1xuICAgICAgICB0aGlzLmN1cnJlbnQucHVzaChub2RlKTtcblxuICAgICAgICBub2RlLnNvdXJjZSA9IHsgc3RhcnQ6IHsgbGluZSwgY29sdW1uIH0sIGlucHV0OiB0aGlzLmlucHV0IH07XG4gICAgICAgIG5vZGUucmF3cy5iZWZvcmUgPSB0aGlzLnNwYWNlcztcbiAgICAgICAgdGhpcy5zcGFjZXMgPSAnJztcbiAgICAgICAgaWYgKCBub2RlLnR5cGUgIT09ICdjb21tZW50JyApIHRoaXMuc2VtaWNvbG9uID0gZmFsc2U7XG4gICAgfVxuXG4gICAgcmF3KG5vZGUsIHByb3AsIHRva2Vucykge1xuICAgICAgICBsZXQgdG9rZW4sIHR5cGU7XG4gICAgICAgIGxldCBsZW5ndGggPSB0b2tlbnMubGVuZ3RoO1xuICAgICAgICBsZXQgdmFsdWUgID0gJyc7XG4gICAgICAgIGxldCBjbGVhbiAgPSB0cnVlO1xuICAgICAgICBmb3IgKCBsZXQgaSA9IDA7IGkgPCBsZW5ndGg7IGkgKz0gMSApIHtcbiAgICAgICAgICAgIHRva2VuID0gdG9rZW5zW2ldO1xuICAgICAgICAgICAgdHlwZSAgPSB0b2tlblswXTtcbiAgICAgICAgICAgIGlmICggdHlwZSA9PT0gJ2NvbW1lbnQnIHx8IHR5cGUgPT09ICdzcGFjZScgJiYgaSA9PT0gbGVuZ3RoIC0gMSApIHtcbiAgICAgICAgICAgICAgICBjbGVhbiA9IGZhbHNlO1xuICAgICAgICAgICAgfSBlbHNlIHtcbiAgICAgICAgICAgICAgICB2YWx1ZSArPSB0b2tlblsxXTtcbiAgICAgICAgICAgIH1cbiAgICAgICAgfVxuICAgICAgICBpZiAoICFjbGVhbiApIHtcbiAgICAgICAgICAgIGxldCByYXcgPSB0b2tlbnMucmVkdWNlKCAoYWxsLCBpKSA9PiBhbGwgKyBpWzFdLCAnJyk7XG4gICAgICAgICAgICBub2RlLnJhd3NbcHJvcF0gPSB7IHZhbHVlLCByYXcgfTtcbiAgICAgICAgfVxuICAgICAgICBub2RlW3Byb3BdID0gdmFsdWU7XG4gICAgfVxuXG4gICAgc3BhY2VzQW5kQ29tbWVudHNGcm9tRW5kKHRva2Vucykge1xuICAgICAgICBsZXQgbGFzdFRva2VuVHlwZTtcbiAgICAgICAgbGV0IHNwYWNlcyA9ICcnO1xuICAgICAgICB3aGlsZSAoIHRva2Vucy5sZW5ndGggKSB7XG4gICAgICAgICAgICBsYXN0VG9rZW5UeXBlID0gdG9rZW5zW3Rva2Vucy5sZW5ndGggLSAxXVswXTtcbiAgICAgICAgICAgIGlmICggbGFzdFRva2VuVHlwZSAhPT0gJ3NwYWNlJyAmJlxuICAgICAgICAgICAgICAgIGxhc3RUb2tlblR5cGUgIT09ICdjb21tZW50JyApIGJyZWFrO1xuICAgICAgICAgICAgc3BhY2VzID0gdG9rZW5zLnBvcCgpWzFdICsgc3BhY2VzO1xuICAgICAgICB9XG4gICAgICAgIHJldHVybiBzcGFjZXM7XG4gICAgfVxuXG4gICAgc3BhY2VzQW5kQ29tbWVudHNGcm9tU3RhcnQodG9rZW5zKSB7XG4gICAgICAgIGxldCBuZXh0O1xuICAgICAgICBsZXQgc3BhY2VzID0gJyc7XG4gICAgICAgIHdoaWxlICggdG9rZW5zLmxlbmd0aCApIHtcbiAgICAgICAgICAgIG5leHQgPSB0b2tlbnNbMF1bMF07XG4gICAgICAgICAgICBpZiAoIG5leHQgIT09ICdzcGFjZScgJiYgbmV4dCAhPT0gJ2NvbW1lbnQnICkgYnJlYWs7XG4gICAgICAgICAgICBzcGFjZXMgKz0gdG9rZW5zLnNoaWZ0KClbMV07XG4gICAgICAgIH1cbiAgICAgICAgcmV0dXJuIHNwYWNlcztcbiAgICB9XG5cbiAgICBzcGFjZXNGcm9tRW5kKHRva2Vucykge1xuICAgICAgICBsZXQgbGFzdFRva2VuVHlwZTtcbiAgICAgICAgbGV0IHNwYWNlcyA9ICcnO1xuICAgICAgICB3aGlsZSAoIHRva2Vucy5sZW5ndGggKSB7XG4gICAgICAgICAgICBsYXN0VG9rZW5UeXBlID0gdG9rZW5zW3Rva2Vucy5sZW5ndGggLSAxXVswXTtcbiAgICAgICAgICAgIGlmICggbGFzdFRva2VuVHlwZSAhPT0gJ3NwYWNlJyApIGJyZWFrO1xuICAgICAgICAgICAgc3BhY2VzID0gdG9rZW5zLnBvcCgpWzFdICsgc3BhY2VzO1xuICAgICAgICB9XG4gICAgICAgIHJldHVybiBzcGFjZXM7XG4gICAgfVxuXG4gICAgc3RyaW5nRnJvbSh0b2tlbnMsIGZyb20pIHtcbiAgICAgICAgbGV0IHJlc3VsdCA9ICcnO1xuICAgICAgICBmb3IgKCBsZXQgaSA9IGZyb207IGkgPCB0b2tlbnMubGVuZ3RoOyBpKysgKSB7XG4gICAgICAgICAgICByZXN1bHQgKz0gdG9rZW5zW2ldWzFdO1xuICAgICAgICB9XG4gICAgICAgIHRva2Vucy5zcGxpY2UoZnJvbSwgdG9rZW5zLmxlbmd0aCAtIGZyb20pO1xuICAgICAgICByZXR1cm4gcmVzdWx0O1xuICAgIH1cblxuICAgIGNvbG9uKHRva2Vucykge1xuICAgICAgICBsZXQgYnJhY2tldHMgPSAwO1xuICAgICAgICBsZXQgdG9rZW4sIHR5cGUsIHByZXY7XG4gICAgICAgIGZvciAoIGxldCBpID0gMDsgaSA8IHRva2Vucy5sZW5ndGg7IGkrKyApIHtcbiAgICAgICAgICAgIHRva2VuID0gdG9rZW5zW2ldO1xuICAgICAgICAgICAgdHlwZSAgPSB0b2tlblswXTtcblxuICAgICAgICAgICAgaWYgKCB0eXBlID09PSAnKCcgKSB7XG4gICAgICAgICAgICAgICAgYnJhY2tldHMgKz0gMTtcbiAgICAgICAgICAgIH0gZWxzZSBpZiAoIHR5cGUgPT09ICcpJyApIHtcbiAgICAgICAgICAgICAgICBicmFja2V0cyAtPSAxO1xuICAgICAgICAgICAgfSBlbHNlIGlmICggYnJhY2tldHMgPT09IDAgJiYgdHlwZSA9PT0gJzonICkge1xuICAgICAgICAgICAgICAgIGlmICggIXByZXYgKSB7XG4gICAgICAgICAgICAgICAgICAgIHRoaXMuZG91YmxlQ29sb24odG9rZW4pO1xuICAgICAgICAgICAgICAgIH0gZWxzZSBpZiAoIHByZXZbMF0gPT09ICd3b3JkJyAmJiBwcmV2WzFdID09PSAncHJvZ2lkJyApIHtcbiAgICAgICAgICAgICAgICAgICAgY29udGludWU7XG4gICAgICAgICAgICAgICAgfSBlbHNlIHtcbiAgICAgICAgICAgICAgICAgICAgcmV0dXJuIGk7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4gICAgcHJlY2hlY2tNaXNzZWRTZW1pY29sb24odG9rZW5zKSB7XG4gICAgICAgIC8vIEhvb2sgZm9yIFNhZmUgUGFyc2VyXG4gICAgICAgIHRva2VucztcbiAgICB9XG5cbiAgICBjaGVja01pc3NlZFNlbWljb2xvbih0b2tlbnMpIHtcbiAgICAgICAgbGV0IGNvbG9uID0gdGhpcy5jb2xvbih0b2tlbnMpO1xuICAgICAgICBpZiAoIGNvbG9uID09PSBmYWxzZSApIHJldHVybjtcblxuICAgICAgICBsZXQgZm91bmRlZCA9IDA7XG4gICAgICAgIGxldCB0b2tlbjtcbiAgICAgICAgZm9yICggbGV0IGogPSBjb2xvbiAtIDE7IGogPj0gMDsgai0tICkge1xuICAgICAgICAgICAgdG9rZW4gPSB0b2tlbnNbal07XG4gICAgICAgICAgICBpZiAoIHRva2VuWzBdICE9PSAnc3BhY2UnICkge1xuICAgICAgICAgICAgICAgIGZvdW5kZWQgKz0gMTtcbiAgICAgICAgICAgICAgICBpZiAoIGZvdW5kZWQgPT09IDIgKSBicmVhaztcbiAgICAgICAgICAgIH1cbiAgICAgICAgfVxuICAgICAgICB0aHJvdyB0aGlzLmlucHV0LmVycm9yKCdNaXNzZWQgc2VtaWNvbG9uJywgdG9rZW5bMl0sIHRva2VuWzNdKTtcbiAgICB9XG5cbn1cbiJdfQ==
{ "pile_set_name": "Github" }
<?php // This file is part of Moodle - http://moodle.org/ // // Moodle is free software: you can redistribute it and/or modify // it under the terms of the GNU General Public License as published by // the Free Software Foundation, either version 3 of the License, or // (at your option) any later version. // // Moodle 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 Moodle. If not, see <http://www.gnu.org/licenses/>. /** * Strings for component 'qbehaviour_manualgraded', language 'en'. * * @package qbehaviour * @subpackage manualgraded * @copyright 2009 The Open University * @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later */ $string['pluginname'] = 'Manually graded'; $string['privacy:metadata'] = 'The Manually graded question behaviour plugin does not store any personal data.';
{ "pile_set_name": "Github" }
/* * Copyright (C) 2008 The Android Open Source Project * * 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. */ /* ---- includes ----------------------------------------------------------- */ #include "b_BasicEm/Math.h" #include "b_BasicEm/Functions.h" #include "b_ImageEm/APhImage.h" #include "b_ImageEm/ComplexImage.h" /* ------------------------------------------------------------------------- */ /* ========================================================================= */ /* */ /* ---- \ghd{ auxiliary functions } ---------------------------------------- */ /* */ /* ========================================================================= */ /* ------------------------------------------------------------------------- */ /* ========================================================================= */ /* */ /* ---- \ghd{ constructor / destructor } ----------------------------------- */ /* */ /* ========================================================================= */ /* ------------------------------------------------------------------------- */ void bim_APhImage_init( struct bbs_Context* cpA, struct bim_APhImage* ptrA ) { bbs_APhArr_init( cpA, &ptrA->arrE ); ptrA->widthE = 0; ptrA->heightE = 0; } /* ------------------------------------------------------------------------- */ void bim_APhImage_create( struct bbs_Context* cpA, struct bim_APhImage* ptrA, uint32 widthA, uint32 heightA, struct bbs_MemSeg* mspA ) { if( bbs_Context_error( cpA ) ) return; if( ptrA->arrE.arrPtrE != 0 ) { bim_APhImage_size( cpA, ptrA, widthA, heightA ); } else { bbs_APhArr_create( cpA, &ptrA->arrE, widthA * heightA, mspA ); ptrA->widthE = widthA; ptrA->heightE = heightA; } } /* ------------------------------------------------------------------------- */ void bim_APhImage_exit( struct bbs_Context* cpA, struct bim_APhImage* ptrA ) { bbs_APhArr_exit( cpA, &ptrA->arrE ); ptrA->widthE = 0; ptrA->heightE = 0; } /* ------------------------------------------------------------------------- */ /* ========================================================================= */ /* */ /* ---- \ghd{ operators } -------------------------------------------------- */ /* */ /* ========================================================================= */ /* ------------------------------------------------------------------------- */ void bim_APhImage_copy( struct bbs_Context* cpA, struct bim_APhImage* ptrA, const struct bim_APhImage* srcPtrA ) { #ifdef DEBUG1 if( ptrA->arrE.allocatedSizeE < srcPtrA->arrE.allocatedSizeE ) { bbs_ERROR0( "void bim_APhImage_copy( struct bim_APhImage*, uint32 sizeA ):\n" "Unsufficient allocated memory" ); return; } #endif ptrA->widthE = srcPtrA->widthE; ptrA->heightE = srcPtrA->heightE; bbs_APhArr_copy( cpA, &ptrA->arrE, &srcPtrA->arrE ); } /* ------------------------------------------------------------------------- */ flag bim_APhImage_equal( struct bbs_Context* cpA, const struct bim_APhImage* ptrA, const struct bim_APhImage* srcPtrA ) { if( ptrA->widthE != srcPtrA->widthE ) return FALSE; if( ptrA->heightE != srcPtrA->heightE ) return FALSE; return bbs_APhArr_equal( cpA, &ptrA->arrE, &srcPtrA->arrE ); } /* ------------------------------------------------------------------------- */ /* ========================================================================= */ /* */ /* ---- \ghd{ query functions } -------------------------------------------- */ /* */ /* ========================================================================= */ /* ------------------------------------------------------------------------- */ /* ========================================================================= */ /* */ /* ---- \ghd{ modify functions } ------------------------------------------- */ /* */ /* ========================================================================= */ /* ------------------------------------------------------------------------- */ void bim_APhImage_size( struct bbs_Context* cpA, struct bim_APhImage* ptrA, uint32 widthA, uint32 heightA ) { #ifdef DEBUG1 if( ptrA->arrE.allocatedSizeE < widthA * heightA ) { bbs_ERROR0( "void bim_APhImage_size( struct bim_APhImage*, uint32 sizeA ):\n" "Unsufficient allocated memory" ); return; } #endif ptrA->widthE = widthA; ptrA->heightE = heightA; bbs_APhArr_size( cpA, &ptrA->arrE, widthA * heightA ); } /* ------------------------------------------------------------------------- */ /* ========================================================================= */ /* */ /* ---- \ghd{ I/O } -------------------------------------------------------- */ /* */ /* ========================================================================= */ /* ------------------------------------------------------------------------- */ uint32 bim_APhImage_memSize( struct bbs_Context* cpA, const struct bim_APhImage* ptrA ) { return bbs_SIZEOF16( uint32 ) + bbs_SIZEOF16( uint32 ) /* version */ + bbs_SIZEOF16( ptrA->widthE ) + bbs_SIZEOF16( ptrA->heightE ) + bbs_APhArr_memSize( cpA, &ptrA->arrE ); } /* ------------------------------------------------------------------------- */ uint32 bim_APhImage_memWrite( struct bbs_Context* cpA, const struct bim_APhImage* ptrA, uint16* memPtrA ) { uint32 memSizeL = bim_APhImage_memSize( cpA, ptrA ); memPtrA += bbs_memWrite32( &memSizeL, memPtrA ); memPtrA += bbs_memWriteUInt32( bim_APH_IMAGE_VERSION, memPtrA ); memPtrA += bbs_memWrite32( &ptrA->widthE, memPtrA ); memPtrA += bbs_memWrite32( &ptrA->heightE, memPtrA ); bbs_APhArr_memWrite( cpA, &ptrA->arrE, memPtrA ); return memSizeL; } /* ------------------------------------------------------------------------- */ uint32 bim_APhImage_memRead( struct bbs_Context* cpA, struct bim_APhImage* ptrA, const uint16* memPtrA, struct bbs_MemSeg* mspA ) { uint32 memSizeL, widthL, heightL, versionL; if( bbs_Context_error( cpA ) ) return 0; memPtrA += bbs_memRead32( &memSizeL, memPtrA ); memPtrA += bbs_memReadVersion32( cpA, &versionL, bim_APH_IMAGE_VERSION, memPtrA ); memPtrA += bbs_memRead32( &widthL, memPtrA ); memPtrA += bbs_memRead32( &heightL, memPtrA ); ptrA->widthE = widthL; ptrA->heightE = heightL; bbs_APhArr_memRead( cpA, &ptrA->arrE, memPtrA, mspA ); if( memSizeL != bim_APhImage_memSize( cpA, ptrA ) ) { bbs_ERR0( bbs_ERR_CORRUPT_DATA, "uint32 bim_APhImage_memRead( const struct bim_APhImage*, const void* ):\n" "size mismatch" ); return 0; } return memSizeL; } /* ------------------------------------------------------------------------- */ /* ========================================================================= */ /* */ /* ---- \ghd{ exec functions } --------------------------------------------- */ /* */ /* ========================================================================= */ /* ------------------------------------------------------------------------- */ void bim_APhImage_setAllPixels( struct bbs_Context* cpA, struct bim_APhImage* ptrA, struct bbs_APh valueA ) { long iL; struct bbs_APh* ptrL = ptrA->arrE.arrPtrE; for( iL = ptrA->widthE * ptrA->heightE; iL > 0; iL-- ) { *ptrL++ = valueA; } } /* ------------------------------------------------------------------------- */ /** | | | | | (loop x1) | (loop x2) | (loop x3) | o------------->-o------------>--o------------->-o | | | | | | | | | | | | | | | | ( sectionL->x1E, sectionL->y1E ) | | ---------o- R-------------------------------|---------------- | | | | | | | | | | | | | | | | | | | | (loop y1)| | | | | | | | | V | | | | | | |( 0, 0 ) | | X ---------o------------------I-------------------------------------------------> | | | | | | | | | | | | | | | | | | | | | | | | | (loop y2)| | | | | | | | | | | | | | | | | | | V | | | | | | | | | ---------o------------------|---------------I | | | | ( srcPtrA->widthE, srcPtrA->heightE ) | | | | | | | | | | | | | | | | | | | | (loop y3)| | | | | | | | | | | V | | | | | | | ---------o--------------------------------------------------R | ( sectionL->x2E, sectionL->y2E ) | Y | | | V To understand how the algorithm work refer to the diagram above. The image boundaries are indicated by letter "I" ( 0, 0 ) to ( srcPtrA->widthE, srcPtrA->heightE ) The rectangle boundaries are indicated by letter "R" ( sectionPtrA->x1E, sectionPtrA->y1E ) to ( sectionPtrA->x2E, sectionPtrA->y2E ) In the above example the intersection of the image and the rectange is ( 0, 0 ), ( srcPtrA->widthE, srcPtrA->heightE ) The size of the destination image is always ( ( sectionL->x2E, sectionL->y2E ) - ( sectionL->x1E, sectionL->y1E ) ) All coordinates are assumed to be relative to the original image. 1. parse all pixels in "loop y1" 1.a. parse all pixels in "loop x1" 1.b. parse all pixels in "loop x2" 1.c. parse all pixels in "loop x3" 2. parse all pixels in "loop y2" 2.a. parse all pixels in "loop x1" 2.b. parse all pixels in "loop x2" 2.c. parse all pixels in "loop x3" 3. parse all pixels in "loop y3" 3.a. parse all pixels in "loop x1" 3.b. parse all pixels in "loop x2" 3.c. parse all pixels in "loop x3" */ /** copies a section of given image */ void bim_APhImage_copySection( struct bbs_Context* cpA, struct bim_APhImage* ptrA, const struct bim_APhImage* srcPtrA, const struct bts_Int16Rect* sectionPtrA ) { struct bbs_APh* srcPixelPtrL; struct bbs_APh* dstPixelPtrL; int32 yIndexL; int32 xIndexL; struct bts_Int16Rect srcImageSubSectionL; struct bts_Int16Rect sectionL; /* make sure that the rectangle passed is correct, in case the x2 < x1 or y2 < y1, swap them */ sectionL.x1E = bbs_min( sectionPtrA->x1E, sectionPtrA->x2E ); sectionL.x2E = bbs_max( sectionPtrA->x1E, sectionPtrA->x2E ); sectionL.y1E = bbs_min( sectionPtrA->y1E, sectionPtrA->y2E ); sectionL.y2E = bbs_max( sectionPtrA->y1E, sectionPtrA->y2E ); /* find the intersection betweem the rectangle and the image, the image always starts at 0,0 */ srcImageSubSectionL.x1E = bbs_max( 0, sectionL.x1E ); srcImageSubSectionL.y1E = bbs_max( 0, sectionL.y1E ); srcImageSubSectionL.x2E = bbs_min( ( int32 ) srcPtrA->widthE, sectionL.x2E ); srcImageSubSectionL.y2E = bbs_min( ( int32 ) srcPtrA->heightE, sectionL.y2E ); /* If the image and the rectangle do not intersect in X direction, set the intersecting rectangle to the image coordinates */ if( srcImageSubSectionL.x2E < srcImageSubSectionL.x1E ) { srcImageSubSectionL.x1E = 0; srcImageSubSectionL.x2E = srcPtrA->widthE; } /* do the same as above in the Y direction */ if( srcImageSubSectionL.y2E < srcImageSubSectionL.y1E ) { srcImageSubSectionL.y1E = 0; srcImageSubSectionL.y2E = srcPtrA->heightE; } /* set size, and allocate required memory for the destination image if required */ bim_APhImage_size( cpA, ptrA, sectionL.x2E - sectionL.x1E, sectionL.y2E - sectionL.y1E ); /* get the pointer to the destination image */ dstPixelPtrL = ptrA->arrE.arrPtrE; /* 1. parse all pixels in "loop y1" */ for( yIndexL = sectionL.y1E; yIndexL < srcImageSubSectionL.y1E && yIndexL < sectionL.y2E; yIndexL++ ) { /* move to the first pixel that needs to be copied. */ srcPixelPtrL = srcPtrA->arrE.arrPtrE; /* 1.a. parse all pixels in "loop x1" */ for( xIndexL = sectionL.x1E; xIndexL < srcImageSubSectionL.x1E && xIndexL < sectionL.x2E; xIndexL++ ) { *dstPixelPtrL++ = *srcPixelPtrL; } /* 1.b. parse all pixels in "loop x2" */ for( ; xIndexL < srcImageSubSectionL.x2E && xIndexL < sectionL.x2E; xIndexL++ ) { *dstPixelPtrL++ = *srcPixelPtrL++; } srcPixelPtrL--; /* 1.c. parse all pixels in "loop x3" */ for( ; xIndexL < sectionL.x2E; xIndexL++ ) { *dstPixelPtrL++ = *srcPixelPtrL; } } /* 2. parse all pixels in "loop y2" */ for( ; yIndexL < srcImageSubSectionL.y2E && yIndexL < sectionL.y2E; yIndexL++ ) { /* move to the first pixel that needs to be copied. */ srcPixelPtrL = srcPtrA->arrE.arrPtrE + yIndexL * srcPtrA->widthE + srcImageSubSectionL.x1E; /* 2.a. parse all pixels in "loop x1" */ for( xIndexL = sectionL.x1E; xIndexL < srcImageSubSectionL.x1E && xIndexL < sectionL.x2E; xIndexL++ ) { *dstPixelPtrL++ = *srcPixelPtrL; } /* 2.b. parse all pixels in "loop x2" */ for( ; xIndexL < srcImageSubSectionL.x2E && xIndexL < sectionL.x2E; xIndexL++ ) { *dstPixelPtrL++ = *srcPixelPtrL++; } srcPixelPtrL--; /* 2.c. parse all pixels in "loop x3" */ for( ; xIndexL < sectionL.x2E; xIndexL++ ) { *dstPixelPtrL++ = *srcPixelPtrL; } } /* 3. parse all pixels in "loop y3" */ for( ; yIndexL < sectionL.y2E; yIndexL++ ) { srcPixelPtrL = srcPtrA->arrE.arrPtrE + ( srcImageSubSectionL.y2E - 1 ) * srcPtrA->widthE + srcImageSubSectionL.x1E; /* 3.a. parse all pixels in "loop x1" */ for( xIndexL = sectionL.x1E; xIndexL < srcImageSubSectionL.x1E && xIndexL < sectionL.x2E; xIndexL++ ) { *dstPixelPtrL++ = *srcPixelPtrL; } /* 3.b. parse all pixels in "loop x3" */ for( ; xIndexL < srcImageSubSectionL.x2E && xIndexL < sectionL.x2E; xIndexL++ ) { *dstPixelPtrL++ = *srcPixelPtrL++; } srcPixelPtrL--; /* 3.c. parse all pixels in "loop x3" */ for( ; xIndexL < sectionL.x2E; xIndexL++ ) { *dstPixelPtrL++ = *srcPixelPtrL; } } } /* ------------------------------------------------------------------------- */ void bim_APhImage_importComplex( struct bbs_Context* cpA, struct bim_APhImage* dstPtrA, const struct bim_ComplexImage* srcPtrA ) { long iL; struct bbs_APh* dstL; const struct bbs_Complex* srcL; bim_APhImage_size( cpA, dstPtrA, srcPtrA->widthE, srcPtrA->heightE ); dstL = dstPtrA->arrE.arrPtrE; srcL = srcPtrA->arrE.arrPtrE; for( iL = srcPtrA->widthE * srcPtrA->heightE; iL > 0; iL-- ) { bbs_APh_importComplex( dstL++, srcL++ ); } } /* ------------------------------------------------------------------------- */ /* ========================================================================= */
{ "pile_set_name": "Github" }
/* * Copyright 2012 Red Hat Inc. * * Permission is hereby granted, free of charge, to any person obtaining a * copy of this software and associated documentation files (the "Software"), * to deal in the Software without restriction, including without limitation * the rights to use, copy, modify, merge, publish, distribute, sublicense, * and/or sell copies of the Software, and to permit persons to whom the * Software is furnished to do so, subject to the following conditions: * * The above copyright notice and this permission notice shall be included in * all copies or substantial portions of the Software. * * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL * THE COPYRIGHT HOLDER(S) OR AUTHOR(S) BE LIABLE FOR ANY CLAIM, DAMAGES OR * OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, * ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR * OTHER DEALINGS IN THE SOFTWARE. * * Authors: Ben Skeggs */ #include "dmacnv50.h" #include "rootnv50.h" #include <nvif/class.h> static const struct nv50_disp_mthd_list gt200_disp_ovly_mthd_base = { .mthd = 0x0000, .addr = 0x000000, .data = { { 0x0080, 0x000000 }, { 0x0084, 0x6109a0 }, { 0x0088, 0x6109c0 }, { 0x008c, 0x6109c8 }, { 0x0090, 0x6109b4 }, { 0x0094, 0x610970 }, { 0x00a0, 0x610998 }, { 0x00a4, 0x610964 }, { 0x00b0, 0x610c98 }, { 0x00b4, 0x610ca4 }, { 0x00b8, 0x610cac }, { 0x00c0, 0x610958 }, { 0x00e0, 0x6109a8 }, { 0x00e4, 0x6109d0 }, { 0x00e8, 0x6109d8 }, { 0x0100, 0x61094c }, { 0x0104, 0x610984 }, { 0x0108, 0x61098c }, { 0x0800, 0x6109f8 }, { 0x0808, 0x610a08 }, { 0x080c, 0x610a10 }, { 0x0810, 0x610a00 }, {} } }; static const struct nv50_disp_chan_mthd gt200_disp_ovly_chan_mthd = { .name = "Overlay", .addr = 0x000540, .prev = 0x000004, .data = { { "Global", 1, &gt200_disp_ovly_mthd_base }, {} } }; const struct nv50_disp_dmac_oclass gt200_disp_ovly_oclass = { .base.oclass = GT200_DISP_OVERLAY_CHANNEL_DMA, .base.minver = 0, .base.maxver = 0, .ctor = nv50_disp_ovly_new, .func = &nv50_disp_dmac_func, .mthd = &gt200_disp_ovly_chan_mthd, .chid = 3, };
{ "pile_set_name": "Github" }
--- title: "Overview" section: "Testing" layout: overview menu: toc: identifier: "testing-overview" parent: "testing" weight: 1 --- Unto all code, good or bad, comes the needs to test it. Verification that our code does what we expect is very important. Over the last 20 years, there has been an explosion in different testing techniques and tools. This chapter will get you going with PonyTest, the current Pony testing tool.
{ "pile_set_name": "Github" }
<assembly> <id>ows-simulate-plugin</id> <formats> <format>zip</format> </formats> <includeBaseDirectory>false</includeBaseDirectory> <fileSets> <fileSet> <directory>release/target/dependency</directory> <outputDirectory/> <includes> <include>gs-ows-simulate*.jar</include> </includes> </fileSet> </fileSets> </assembly>
{ "pile_set_name": "Github" }
<html> <body> <ul> <li><a href="event1.html">site_with_processor</a></li> </ul> </body> </html>
{ "pile_set_name": "Github" }
using System.Reflection; using System.Runtime.CompilerServices; using System.Runtime.InteropServices; // General Information about an assembly is controlled through the following // set of attributes. Change these attribute values to modify the information // associated with an assembly. [assembly: AssemblyTitle("PaketBug")] [assembly: AssemblyDescription("")] [assembly: AssemblyConfiguration("")] [assembly: AssemblyCompany("")] [assembly: AssemblyProduct("PaketBug")] [assembly: AssemblyCopyright("Copyright © 2015")] [assembly: AssemblyTrademark("")] [assembly: AssemblyCulture("")] // Setting ComVisible to false makes the types in this assembly not visible // to COM components. If you need to access a type in this assembly from // COM, set the ComVisible attribute to true on that type. [assembly: ComVisible(false)] // The following GUID is for the ID of the typelib if this project is exposed to COM [assembly: Guid("5b41a984-0c88-41c7-8669-41d298d0e450")] // Version information for an assembly consists of the following four values: // // Major Version // Minor Version // Build Number // Revision // // You can specify all the values or you can default the Build and Revision Numbers // by using the '*' as shown below: // [assembly: AssemblyVersion("1.0.*")] [assembly: AssemblyVersion("1.0.0.0")] [assembly: AssemblyFileVersion("1.0.0.0")]
{ "pile_set_name": "Github" }
JASC-PAL 0100 16 213 213 172 82 82 106 123 123 123 172 172 164 255 255 255 213 222 222 164 180 189 255 0 255 131 115 74 213 213 148 197 189 139 172 156 115 148 131 90 197 197 205 205 82 65 0 0 0
{ "pile_set_name": "Github" }
/* Generated by RuntimeBrowser Image: /System/Library/PrivateFrameworks/UserActivity.framework/UserActivity */ @interface UASharedPasteboardInfo : NSObject <NSCopying, NSSecureCoding> { NSFileHandle * _dataFile; long long _dataSize; NSArray * _items; NSDictionary * _sandboxExtensions; NSString * _sharedDataPath; } @property (retain) NSFileHandle *dataFile; @property long long dataSize; @property (copy) NSArray *items; @property (copy) NSDictionary *sandboxExtensions; @property (copy) NSString *sharedDataPath; + (bool)supportsSecureCoding; - (void).cxx_destruct; - (id)copyWithZone:(struct _NSZone { }*)arg1; - (id)dataFile; - (long long)dataSize; - (id)description; - (void)encodeWithCoder:(id)arg1; - (id)initWithCoder:(id)arg1; - (bool)isEqual:(id)arg1; - (id)items; - (id)sandboxExtensions; - (void)setDataFile:(id)arg1; - (void)setDataSize:(long long)arg1; - (void)setItems:(id)arg1; - (void)setSandboxExtensions:(id)arg1; - (void)setSharedDataPath:(id)arg1; - (id)sharedDataPath; @end
{ "pile_set_name": "Github" }
<vector xmlns:android="http://schemas.android.com/apk/res/android" android:width="24dp" android:height="24dp" android:viewportWidth="24.0" android:viewportHeight="24.0"> <path android:fillColor="#FF000000" android:pathData="M17,3L5,3c-1.11,0 -2,0.9 -2,2v14c0,1.1 0.89,2 2,2h14c1.1,0 2,-0.9 2,-2L21,7l-4,-4zM12,19c-1.66,0 -3,-1.34 -3,-3s1.34,-3 3,-3 3,1.34 3,3 -1.34,3 -3,3zM15,9L5,9L5,5h10v4z"/> </vector>
{ "pile_set_name": "Github" }
" Menu Translations: Slovenian / Slovensko " Maintainer: Mojca Miklavec <mojca.miklavec.lists@gmail.com> " Originally By: Mojca Miklavec <mojca.miklavec.lists@gmail.com> " Last Change: 2016 Oct 17 " vim:set foldmethod=marker tabstop=8: " TODO: add/check all '&'s " Quit when menu translations have already been done. if exists("did_menu_trans") finish endif let did_menu_trans = 1 let s:keepcpo= &cpo set cpo&vim scriptencoding latin2 " {{{ FILE / DATOTEKA menutrans &File &Datoteka menutrans &Open\.\.\.<Tab>:e &Odpri\ \.\.\.<Tab>:e menutrans Sp&lit-Open\.\.\.<Tab>:sp Odpri\ de&ljeno\ \.\.\.<Tab>:sp menutrans Open\ Tab\.\.\.<Tab>:tabnew Odpri\ v\ zavi&hku\ \.\.\.<Tab>:tabnew menutrans &New<Tab>:enew &Nova<Tab>:enew menutrans &Close<Tab>:close &Zapri<Tab>:close menutrans &Save<Tab>:w &Shrani<Tab>:w menutrans Save\ &As\.\.\.<Tab>:sav Shrani\ &kot\ \.\.\.<Tab>:sav menutrans &Print Na&tisni menutrans Sa&ve-Exit<Tab>:wqa Shrani\ in\ &konèaj<Tab>:wqa menutrans E&xit<Tab>:qa &Izhod<Tab>:qa if has("diff") menutrans Split\ &Diff\ with\.\.\. Primerjaj\ z\ (di&ff)\ \.\.\. menutrans Split\ Patched\ &By\.\.\. &Popravi\ s\ (patch)\ \.\.\. endif " }}} FILE / DATOTEKA " {{{ EDIT / UREDI menutrans &Edit &Uredi menutrans &Undo<Tab>u &Razveljavi<Tab>u menutrans &Redo<Tab>^R &Obnovi<Tab>^R menutrans Rep&eat<Tab>\. Po&novi<Tab>\. menutrans Cu&t<Tab>"+x &Izre¾i<Tab>"+x menutrans &Copy<Tab>"+y &Kopiraj<Tab>"+y menutrans &Paste<Tab>"+gP &Prilepi<Tab>"+gP menutrans Put\ &Before<Tab>[p Vrini\ pred<Tab>[p menutrans Put\ &After<Tab>]p Vrini\ za<Tab>]p menutrans &Delete<Tab>x Iz&bri¹i<Tab>x menutrans &Select\ all<Tab>ggVG Izberi\ vse<Tab>ggVG menutrans &Find\.\.\. Po&i¹èi\ \.\.\. menutrans Find\ and\ Rep&lace\.\.\. Poi¹èi\ in\ &zamenjaj\ \.\.\. " [-- SETTINGS --] menutrans Settings\ &Window Nastavitve\ \.\.\. menutrans Startup\ &Settings Zaèetne nastavitve menutrans &Global\ Settings &Globalne\ nastavitve menutrans Toggle\ Pattern\ &Highlight<Tab>:set\ hls! Vkljuèi/izkljuèi\ poudarjanje\ iskanega\ niza<Tab>:set\ hls! menutrans Toggle\ &Ignore-case<Tab>:set\ ic! Vkljuèi/izkljuèi\ loèevanje\ velikih\ in\ malih\ èrk<Tab>:set\ ic! menutrans Toggle\ &Showmatch<Tab>:set\ sm! Vkljuèi/izkljuèi\ kratek\ skok\ na\ pripadajoèi\ oklepaj<Tab>:set\ sm! menutrans &Context\ lines ©t\.\ vidnih\ vrstic\ pred/za\ kurzorjem menutrans &Virtual\ Edit Dovoli\ polo¾aj\ kazalèka,\ kjer\ ni\ besedila menutrans Never Nikoli menutrans Block\ Selection Le\ med\ izbiranjem\ bloka menutrans Insert\ mode Le\ v\ naèinu\ za\ pisanje menutrans Block\ and\ Insert Pri\ obojem menutrans Always Vedno menutrans Toggle\ Insert\ &Mode<Tab>:set\ im! Vkljuèi/izkljuèi\ naèin\ za\ pisanje<Tab>:set\ im! menutrans Toggle\ Vi\ C&ompatible<Tab>:set\ cp! Vkljuèi/izkljuèi\ zdru¾ljivost\ z\ Vi-jem<Tab>:set\ cp! menutrans Search\ &Path\.\.\. Pot\ za\ iskanje\ \.\.\. menutrans Ta&g\ Files\.\.\. Ta&g-datoteke\.\.\. menutrans Toggle\ &Toolbar Poka¾i/skrij\ Orodja menutrans Toggle\ &Bottom\ Scrollbar Poka¾i/skrij\ spodnji\ drsnik menutrans Toggle\ &Left\ Scrollbar Poka¾i/skrij\ levi\ drsnik menutrans Toggle\ &Right\ Scrollbar Poka¾i/skrij\ desni\ drsnik " Edit/File Settings menutrans F&ile\ Settings &Nastavitve\ datoteke " Boolean options menutrans Toggle\ Line\ &Numbering<Tab>:set\ nu! Poka¾i/skrij\ ¹tevilke\ vrstic<Tab>:set\ nu! menutrans Toggle\ &List\ Mode<Tab>:set\ list! Poka¾i/skrij\ nevidne\ znake<Tab>:set\ list! " space/tab menutrans Toggle\ Line\ &Wrap<Tab>:set\ wrap! Vkljuèi/izkljuèi\ prelome\ vrstic<Tab>:set\ wrap! menutrans Toggle\ W&rap\ at\ word<Tab>:set\ lbr! Vkljuèi/izkljuèi\ prelome\ vrstic\ med\ besedami<Tab>:set\ lbr! menutrans Toggle\ &expand-tab<Tab>:set\ et! Vkljuèi/izkljuèi\ zamenjavo\ tabulatorjev\ s\ presledki<Tab>:set\ et! menutrans Toggle\ &auto-indent<Tab>:set\ ai! Vkljuèi/izkljuèi\ avtomatsko\ zamikanje\ vrstic<Tab>:set\ ai! menutrans Toggle\ &C-indenting<Tab>:set\ cin! Vkljuèi/izkljuèi\ C-jevski\ naèin\ zamikanja\ vrstic<Tab>:set\ cin! " other options menutrans &Shiftwidth ©irina\ zamika\ vrstic menutrans Soft\ &Tabstop ©irina &tabulatorja menutrans Te&xt\ Width\.\.\. ©irina\ besedila\ \.\.\. menutrans &File\ Format\.\.\. Format\ &datoteke\ \.\.\. menutrans C&olor\ Scheme &Barvna\ shema\ \.\.\. menutrans &Keymap Razporeditev\ tip&k menutrans Select\ Fo&nt\.\.\. Pisava\ \.\.\. " }}} EDIT / UREDI " {{{ TOOLS / ORODJA menutrans &Tools O&rodja menutrans &Jump\ to\ this\ tag<Tab>g^] &Skoèi\ k\ tej\ znaèki<Tab>g^] menutrans Jump\ &back<Tab>^T Skoèi\ Na&zaj<Tab>^T menutrans Build\ &Tags\ File Napravi\ datoteke\ z\ znaèkami\ (tag) if has("spell") menutrans &Spelling Èrkovalnik menutrans &Spell\ Check\ On &Vkljuèi menutrans Spell\ Check\ &Off &Izkljuèi menutrans To\ &Next\ error<Tab>]s K\ &naslednji\ napaki<Tab>]s menutrans To\ &Previous\ error<Tab>[s K\ &prej¹nji\ napaki<Tab>[s menutrans Suggest\ &Corrections<Tab>z= Predlagaj\ popravek<Tab>z= menutrans &Repeat\ correction<Tab>:spellrepall Po&novi\ popravke\ na\ vseh\ besedah<Tab>:spellrepall menutrans Set\ language\ to\ "en" Èrkovalnik:\ angle¹ki\ "en" menutrans Set\ language\ to\ "en_au" Èrkovalnik:\ angle¹ki\ "en_au" menutrans Set\ language\ to\ "en_ca" Èrkovalnik:\ angle¹ki\ "en_ca" menutrans Set\ language\ to\ "en_gb" Èrkovalnik:\ angle¹ki\ "en_gb" menutrans Set\ language\ to\ "en_nz" Èrkovalnik:\ angle¹ki\ "en_nz" menutrans Set\ language\ to\ "en_us" Èrkovalnik:\ angle¹ki\ "en_us" menutrans Set\ language\ to\ "sl" Èrkovalnik:\ slovenski\ "sl" menutrans Set\ language\ to\ "de" Èrkovalnik:\ nem¹ki\ "de" menutrans Set\ language\ to\ Èrkovalnik:\ menutrans &Find\ More\ Languages &Ostali\ jeziki endif if has("folding") menutrans &Folding Zavihek " open close folds menutrans &Enable/Disable\ folds<Tab>zi Omogoèi/onemogoèi\ zavihke<Tab>zi menutrans &View\ Cursor\ Line<Tab>zv Poka¾i\ vrstico\ s\ kazalcem<Tab>zv " kjer je kazalec menutrans Vie&w\ Cursor\ Line\ only<Tab>zMzx Poka¾i\ samo\ vrstico\ s\ kazalcem<Tab>zMzx menutrans C&lose\ more\ folds<Tab>zm Zapri\ veè\ zavihkov<Tab>zm menutrans &Close\ all\ folds<Tab>zM Zapri\ vse\ zavihke<Tab>zM menutrans O&pen\ more\ folds<Tab>zr Odpri\ veè\ zavihkov<Tab>zr menutrans &Open\ all\ folds<Tab>zR Odpri\ vse\ zavihke<Tab>zR " fold method menutrans Fold\ Met&hod Ustvarjanje\ zavihkov menutrans M&anual &Roèno menutrans I&ndent Glede\ na\ &poravnavo menutrans E&xpression Z\ &izrazi\ (foldexpr) menutrans S&yntax Glede\ na\ &sintakso menutrans &Diff Razlike\ (&diff) menutrans Ma&rker Z\ &markerji/oznaèbami " create and delete folds " TODO accelerators menutrans Create\ &Fold<Tab>zf Ustvari\ zavihek<Tab>zf menutrans &Delete\ Fold<Tab>zd Izbri¹i\ zavihek<Tab>zd menutrans Delete\ &All\ Folds<Tab>zD Izbri¹i\ vse\ zavihke<Tab>zD " moving around in folds menutrans Fold\ column\ &width ©irina\ stolpca\ z\ zavihkom endif " has folding if has("diff") menutrans &Diff Razlike\ (&Diff) menutrans &Update &Posodobi<Tab> menutrans &Get\ Block &Sprejmi\ (spremeni\ to\ okno) " TODO: check if translation is OK menutrans &Put\ Block &Po¹lji\ (spremeni\ drugo\ okno) endif menutrans &Make<Tab>:make Napravi\ (&make)<Tab>:make menutrans &List\ Errors<Tab>:cl Poka¾i\ napake<Tab>:cl menutrans L&ist\ Messages<Tab>:cl! Poka¾i\ sporoèila<Tab>:cl! menutrans &Next\ Error<Tab>:cn K\ &naslednji\ napaki<Tab>:cn menutrans &Previous\ Error<Tab>:cp K\ &prej¹nji\ napaki<Tab>:cp menutrans &Older\ List<Tab>:cold K\ &starej¹emu\ seznamu\ napak<Tab>:cold menutrans N&ewer\ List<Tab>:cnew K\ &novej¹emu\ seznamu\ napak<Tab>:cnew menutrans Error\ &Window Okno\ z\ napakami menutrans &Update<Tab>:cwin &Posodobi<Tab>:cwin menutrans &Open<Tab>:copen &Odpri<Tab>:copen menutrans &Close<Tab>:cclose &Zapri<Tab>:cclose menutrans &Set\ Compiler Nastavi\ &prevajalnik menutrans Se&T\ Compiler Nastavi\ &prevajalnik " bug in original translation? menutrans &Convert\ to\ HEX<Tab>:%!xxd Pretvori\ v\ HE&X<Tab>:%!xxd menutrans Conve&rt\ back<Tab>:%!xxd\ -r Povrni\ pretvo&rbo<Tab>:%!xxd\ -r " }}} TOOLS / ORODJA " {{{ SYNTAX / BARVANJE KODE menutrans &Syntax &Barvanje\ kode menutrans &Show\ filetypes\ in\ menu Podprte\ vrste\ datotek menutrans Set\ '&syntax'\ only Samo\ barvanje\ ('&syntax') menutrans Set\ '&filetype'\ too Tudi\ obna¹anje\ ('&filetype') menutrans &Off &Izkljuèeno menutrans &Manual &Roèno menutrans A&utomatic &Avtomatsko menutrans on/off\ for\ &This\ file Vkljuèi/izkljuèi\ za\ to\ datoteko menutrans Co&lor\ test Preizkus\ barv menutrans &Highlight\ test Preizkus\ barvanja\ kode menutrans &Convert\ to\ HTML Pretvori\ v\ &HTML " }}} SYNTAX / BARVANJE KODE " {{{ BUFFERS / MEDPOMNILNIK menutrans &Buffers &Medpomnilnik " XXX: ni najbolje: okno bi bolj pristajalo, ampak okno je ¾e menutrans &Refresh\ menu &Osve¾i menutrans Delete &Bri¹i menutrans &Alternate &Menjaj menutrans &Next &Naslednji menutrans &Previous &Prej¹nji menutrans [No\ File] [Brez\ datoteke] " }}} BUFFERS / MEDPOMNILNIK " {{{ WINDOW / OKNO menutrans &Window &Okno menutrans &New<Tab>^Wn &Novo<Tab>^Wn menutrans S&plit<Tab>^Ws Razdeli<Tab>^Ws menutrans Split\ &Vertically<Tab>^Wv Razdeli\ navpièno<Tab>^Ws menutrans Split\ File\ E&xplorer Razdeli:\ Vsebina\ mape menutrans Sp&lit\ To\ #<Tab>^W^^ Razdeli\ v\ #<Tab>^W^^ menutrans &Close<Tab>^Wc &Zapri<Tab>^Wc menutrans Close\ &Other(s)<Tab>^Wo Zapri\ &ostala<Tab>^Wo menutrans Move\ &To Premakni menutrans &Top<Tab>^WK &Gor<Tab>^WK menutrans &Bottom<Tab>^WJ &Dol<Tab>^WJ menutrans &Left\ side<Tab>^WH &Levo<Tab>^WH menutrans &Right\ side<Tab>^WL &Desno<Tab>^WL menutrans Rotate\ &Up<Tab>^WR Zavrti\ navzgor<Tab>^WR menutrans Rotate\ &Down<Tab>^Wr Zavrti\ navzdol<Tab>^Wr menutrans &Equal\ Size<Tab>^W= &Enaka\ velikost<Tab>^W= menutrans &Max\ Height<Tab>^W_ Najvi¹je<Tab>^W_ menutrans M&in\ Height<Tab>^W1_ Najni¾je<Tab>^W1_ menutrans Max\ &Width<Tab>^W\| Naj¹ir¹e<Tab>^W\| menutrans Min\ Widt&h<Tab>^W1\| Najo¾je<Tab>^W1\| " }}} WINDOW / OKNO " {{{ HELP / POMOÈ menutrans &Help &Pomoè menutrans &Overview<Tab><F1> Hitri\ pregled<Tab><F1> menutrans &User\ Manual P&riroènik menutrans &How-to\ links &How-to\ kazalo menutrans &Find\.\.\. Po&i¹èi\ \.\.\. " conflicts with Edit.Find menutrans &Credits &Avtorji menutrans Co&pying &Licenca menutrans &Sponsor/Register Registracija\ in\ &donacije menutrans O&rphans &Sirotam menutrans &Version &Verzija menutrans &About &O\ programu " }}} HELP / POMOÈ " {{{ POPUP menutrans &Undo &Razveljavi menutrans Cu&t &Izre¾i menutrans &Copy &Kopiraj menutrans &Paste &Prilepi menutrans &Delete &Zbri¹i menutrans Select\ Blockwise Izbiraj\ po\ blokih menutrans Select\ &Word Izberi\ &besedo menutrans Select\ &Sentence Izberi\ &stavek menutrans Select\ Pa&ragraph Izberi\ &odstavek menutrans Select\ &Line Izberi\ vrs&tico menutrans Select\ &Block Izberi\ b&lok menutrans Select\ &All Izberi\ &vse " }}} POPUP " {{{ TOOLBAR if has("toolbar") if exists("*Do_toolbar_tmenu") delfun Do_toolbar_tmenu endif fun Do_toolbar_tmenu() tmenu ToolBar.Open Odpri datoteko tmenu ToolBar.Save Shrani datoteko tmenu ToolBar.SaveAll Shrani vse datoteke tmenu ToolBar.Print Natisni tmenu ToolBar.Undo Razveljavi tmenu ToolBar.Redo Obnovi tmenu ToolBar.Cut Izre¾i tmenu ToolBar.Copy Kopiraj tmenu ToolBar.Paste Prilepi tmenu ToolBar.Find Najdi ... tmenu ToolBar.FindNext Najdi naslednje tmenu ToolBar.FindPrev Najdi prej¹nje tmenu ToolBar.Replace Najdi in zamenjaj ... tmenu ToolBar.LoadSesn Nalo¾i sejo tmenu ToolBar.SaveSesn Shrani trenutno sejo tmenu ToolBar.RunScript Izberi Vim skripto za izvajanje tmenu ToolBar.Make Napravi trenutni projekt (:make) tmenu ToolBar.RunCtags Napravi znaèke v trenutnem direktoriju (!ctags -R.) tmenu ToolBar.TagJump Skoèi k znaèki pod kurzorjem tmenu ToolBar.Help Pomoè za Vim tmenu ToolBar.FindHelp I¹èi v pomoèi za Vim endfun endif " }}} TOOLBAR " {{{ DIALOG TEXTS let g:menutrans_no_file = "[Brez datoteke]" let g:menutrans_help_dialog = "Vnesite ukaz ali besedo, za katero ¾elite pomoè:\n\nUporabite predpono i_ za ukaze v naèinu za pisanje (npr.: i_CTRL-X)\nUporabite predpono c_ za ukaze v ukazni vrstici (command-line) (npr.: c_<Del>)\nUporabite predpono ' za imena opcij (npr.: 'shiftwidth')" let g:menutrans_path_dialog = "Vnesite poti za iskanje datotek.\nImena direktorijev loèite z vejico." let g:menutrans_tags_dialog = "Vnesite imena datotek z znaèkami ('tag').\nImana loèite z vejicami." let g:menutrans_textwidth_dialog = "Vnesite novo ¹irino besedila (ali 0 za izklop formatiranja): " let g:menutrans_fileformat_dialog = "Izberite format datoteke" let g:menutrans_fileformat_choices = "&Unix\n&Dos\n&Mac\n&Preklièi" " }}} let &cpo = s:keepcpo unlet s:keepcpo
{ "pile_set_name": "Github" }
// Margin and Padding @each $breakpoint in map-keys($grid-breakpoints) { @include media-breakpoint-up($breakpoint) { $infix: breakpoint-infix($breakpoint, $grid-breakpoints); @each $prop, $abbrev in (margin: m, padding: p) { @each $size, $lengths in $spacers { $length-x: map-get($lengths, x); $length-y: map-get($lengths, y); .#{$abbrev}#{$infix}-#{$size} { #{$prop}: $length-y $length-x !important; } .#{$abbrev}t#{$infix}-#{$size} { #{$prop}-top: $length-y !important; } .#{$abbrev}r#{$infix}-#{$size} { #{$prop}-right: $length-x !important; } .#{$abbrev}b#{$infix}-#{$size} { #{$prop}-bottom: $length-y !important; } .#{$abbrev}l#{$infix}-#{$size} { #{$prop}-left: $length-x !important; } .#{$abbrev}x#{$infix}-#{$size} { #{$prop}-right: $length-x !important; #{$prop}-left: $length-x !important; } .#{$abbrev}y#{$infix}-#{$size} { #{$prop}-top: $length-y !important; #{$prop}-bottom: $length-y !important; } } } // Some special margin utils .m#{$infix}-auto { margin: auto !important; } .mt#{$infix}-auto { margin-top: auto !important; } .mr#{$infix}-auto { margin-right: auto !important; } .mb#{$infix}-auto { margin-bottom: auto !important; } .ml#{$infix}-auto { margin-left: auto !important; } .mx#{$infix}-auto { margin-right: auto !important; margin-left: auto !important; } .my#{$infix}-auto { margin-top: auto !important; margin-bottom: auto !important; } } }
{ "pile_set_name": "Github" }
/* * Copyright (C) 2015 Apple Inc. All rights reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions * are met: * 1. Redistributions of source code must retain the above copyright * notice, this list of conditions and the following disclaimer. * 2. Redistributions in binary form must reproduce the above copyright * notice, this list of conditions and the following disclaimer in the * documentation and/or other materials provided with the distribution. * * THIS SOFTWARE IS PROVIDED BY APPLE INC. ``AS IS'' AND ANY * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE INC. OR * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY * OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ #include "config.h" #if ENABLE(WEBGL) #include "WebGLQuery.h" #include "WebGLContextGroup.h" #include "WebGLRenderingContextBase.h" namespace WebCore { Ref<WebGLQuery> WebGLQuery::create(WebGLRenderingContextBase* ctx) { return adoptRef(*new WebGLQuery(ctx)); } WebGLQuery::~WebGLQuery() { deleteObject(0); } WebGLQuery::WebGLQuery(WebGLRenderingContextBase* ctx) : WebGLSharedObject(ctx) { // FIXME: Call createQuery from GraphicsContext3D. } void WebGLQuery::deleteObjectImpl(GraphicsContext3D* context3d, Platform3DObject object) { UNUSED_PARAM(context3d); UNUSED_PARAM(object); // FIXME: Call deleteQuery from GraphicsContext3D. } } #endif // ENABLE(WEBGL)
{ "pile_set_name": "Github" }
<?php namespace Kahlan\Matcher; class ToBeNull extends ToBe { /** * Expect that `$actual` is `null`. * * @param mixed $actual The actual value. * @param null $expected The expected vale * * @return bool */ public static function match($actual, $expected = null) { return parent::match($actual, null); } /** * Returns the description message. * * @return string The description message. */ public static function description() { return "be null."; } }
{ "pile_set_name": "Github" }
SET(Open_BLAS_INCLUDE_SEARCH_PATHS /usr/include /usr/include/openblas /usr/include/openblas-base /usr/local/include /usr/local/include/openblas /usr/local/include/openblas-base /opt/OpenBLAS/include $ENV{OpenBLAS_HOME} $ENV{OpenBLAS_HOME}/include ) SET(Open_BLAS_LIB_SEARCH_PATHS /lib/ /lib/openblas-base /lib64/ /usr/lib /usr/lib/openblas-base /usr/lib64 /usr/local/lib /usr/local/lib64 /opt/OpenBLAS/lib $ENV{OpenBLAS}cd $ENV{OpenBLAS}/lib $ENV{OpenBLAS_HOME} $ENV{OpenBLAS_HOME}/lib ) FIND_PATH(OpenBLAS_INCLUDE_DIR NAMES cblas.h PATHS ${Open_BLAS_INCLUDE_SEARCH_PATHS}) FIND_LIBRARY(OpenBLAS_LIB NAMES openblas PATHS ${Open_BLAS_LIB_SEARCH_PATHS}) SET(OpenBLAS_FOUND ON) # Check include files IF(NOT OpenBLAS_INCLUDE_DIR) SET(OpenBLAS_FOUND OFF) MESSAGE(STATUS "Could not find OpenBLAS include. Turning OpenBLAS_FOUND off") ENDIF() # Check libraries IF(NOT OpenBLAS_LIB) SET(OpenBLAS_FOUND OFF) MESSAGE(STATUS "Could not find OpenBLAS lib. Turning OpenBLAS_FOUND off") ENDIF() IF (OpenBLAS_FOUND) IF (NOT OpenBLAS_FIND_QUIETLY) MESSAGE(STATUS "Found OpenBLAS libraries: ${OpenBLAS_LIB}") MESSAGE(STATUS "Found OpenBLAS include: ${OpenBLAS_INCLUDE_DIR}") ENDIF (NOT OpenBLAS_FIND_QUIETLY) ELSE (OpenBLAS_FOUND) IF (OpenBLAS_FIND_REQUIRED) MESSAGE(FATAL_ERROR "Could not find OpenBLAS") ENDIF (OpenBLAS_FIND_REQUIRED) ENDIF (OpenBLAS_FOUND) MARK_AS_ADVANCED( OpenBLAS_INCLUDE_DIR OpenBLAS_LIB OpenBLAS )
{ "pile_set_name": "Github" }
/* * Based on documentation provided by Dave Jones. Thanks! * * Licensed under the terms of the GNU GPL License version 2. * * BIG FAT DISCLAIMER: Work in progress code. Possibly *dangerous* */ #include <linux/kernel.h> #include <linux/module.h> #include <linux/init.h> #include <linux/cpufreq.h> #include <linux/ioport.h> #include <linux/slab.h> #include <linux/timex.h> #include <linux/io.h> #include <linux/delay.h> #include <asm/cpu_device_id.h> #include <asm/msr.h> #include <asm/tsc.h> #if defined CONFIG_ACPI_PROCESSOR || defined CONFIG_ACPI_PROCESSOR_MODULE #include <linux/acpi.h> #include <acpi/processor.h> #endif #define EPS_BRAND_C7M 0 #define EPS_BRAND_C7 1 #define EPS_BRAND_EDEN 2 #define EPS_BRAND_C3 3 #define EPS_BRAND_C7D 4 struct eps_cpu_data { u32 fsb; #if defined CONFIG_ACPI_PROCESSOR || defined CONFIG_ACPI_PROCESSOR_MODULE u32 bios_limit; #endif struct cpufreq_frequency_table freq_table[]; }; static struct eps_cpu_data *eps_cpu[NR_CPUS]; /* Module parameters */ static int freq_failsafe_off; static int voltage_failsafe_off; static int set_max_voltage; #if defined CONFIG_ACPI_PROCESSOR || defined CONFIG_ACPI_PROCESSOR_MODULE static int ignore_acpi_limit; static struct acpi_processor_performance *eps_acpi_cpu_perf; /* Minimum necessary to get acpi_processor_get_bios_limit() working */ static int eps_acpi_init(void) { eps_acpi_cpu_perf = kzalloc(sizeof(struct acpi_processor_performance), GFP_KERNEL); if (!eps_acpi_cpu_perf) return -ENOMEM; if (!zalloc_cpumask_var(&eps_acpi_cpu_perf->shared_cpu_map, GFP_KERNEL)) { kfree(eps_acpi_cpu_perf); eps_acpi_cpu_perf = NULL; return -ENOMEM; } if (acpi_processor_register_performance(eps_acpi_cpu_perf, 0)) { free_cpumask_var(eps_acpi_cpu_perf->shared_cpu_map); kfree(eps_acpi_cpu_perf); eps_acpi_cpu_perf = NULL; return -EIO; } return 0; } static int eps_acpi_exit(struct cpufreq_policy *policy) { if (eps_acpi_cpu_perf) { acpi_processor_unregister_performance(eps_acpi_cpu_perf, 0); free_cpumask_var(eps_acpi_cpu_perf->shared_cpu_map); kfree(eps_acpi_cpu_perf); eps_acpi_cpu_perf = NULL; } return 0; } #endif static unsigned int eps_get(unsigned int cpu) { struct eps_cpu_data *centaur; u32 lo, hi; if (cpu) return 0; centaur = eps_cpu[cpu]; if (centaur == NULL) return 0; /* Return current frequency */ rdmsr(MSR_IA32_PERF_STATUS, lo, hi); return centaur->fsb * ((lo >> 8) & 0xff); } static int eps_set_state(struct eps_cpu_data *centaur, unsigned int cpu, u32 dest_state) { struct cpufreq_freqs freqs; u32 lo, hi; int err = 0; int i; freqs.old = eps_get(cpu); freqs.new = centaur->fsb * ((dest_state >> 8) & 0xff); freqs.cpu = cpu; cpufreq_notify_transition(&freqs, CPUFREQ_PRECHANGE); /* Wait while CPU is busy */ rdmsr(MSR_IA32_PERF_STATUS, lo, hi); i = 0; while (lo & ((1 << 16) | (1 << 17))) { udelay(16); rdmsr(MSR_IA32_PERF_STATUS, lo, hi); i++; if (unlikely(i > 64)) { err = -ENODEV; goto postchange; } } /* Set new multiplier and voltage */ wrmsr(MSR_IA32_PERF_CTL, dest_state & 0xffff, 0); /* Wait until transition end */ i = 0; do { udelay(16); rdmsr(MSR_IA32_PERF_STATUS, lo, hi); i++; if (unlikely(i > 64)) { err = -ENODEV; goto postchange; } } while (lo & ((1 << 16) | (1 << 17))); /* Return current frequency */ postchange: rdmsr(MSR_IA32_PERF_STATUS, lo, hi); freqs.new = centaur->fsb * ((lo >> 8) & 0xff); #ifdef DEBUG { u8 current_multiplier, current_voltage; /* Print voltage and multiplier */ rdmsr(MSR_IA32_PERF_STATUS, lo, hi); current_voltage = lo & 0xff; printk(KERN_INFO "eps: Current voltage = %dmV\n", current_voltage * 16 + 700); current_multiplier = (lo >> 8) & 0xff; printk(KERN_INFO "eps: Current multiplier = %d\n", current_multiplier); } #endif cpufreq_notify_transition(&freqs, CPUFREQ_POSTCHANGE); return err; } static int eps_target(struct cpufreq_policy *policy, unsigned int target_freq, unsigned int relation) { struct eps_cpu_data *centaur; unsigned int newstate = 0; unsigned int cpu = policy->cpu; unsigned int dest_state; int ret; if (unlikely(eps_cpu[cpu] == NULL)) return -ENODEV; centaur = eps_cpu[cpu]; if (unlikely(cpufreq_frequency_table_target(policy, &eps_cpu[cpu]->freq_table[0], target_freq, relation, &newstate))) { return -EINVAL; } /* Make frequency transition */ dest_state = centaur->freq_table[newstate].index & 0xffff; ret = eps_set_state(centaur, cpu, dest_state); if (ret) printk(KERN_ERR "eps: Timeout!\n"); return ret; } static int eps_verify(struct cpufreq_policy *policy) { return cpufreq_frequency_table_verify(policy, &eps_cpu[policy->cpu]->freq_table[0]); } static int eps_cpu_init(struct cpufreq_policy *policy) { unsigned int i; u32 lo, hi; u64 val; u8 current_multiplier, current_voltage; u8 max_multiplier, max_voltage; u8 min_multiplier, min_voltage; u8 brand = 0; u32 fsb; struct eps_cpu_data *centaur; struct cpuinfo_x86 *c = &cpu_data(0); struct cpufreq_frequency_table *f_table; int k, step, voltage; int ret; int states; #if defined CONFIG_ACPI_PROCESSOR || defined CONFIG_ACPI_PROCESSOR_MODULE unsigned int limit; #endif if (policy->cpu != 0) return -ENODEV; /* Check brand */ printk(KERN_INFO "eps: Detected VIA "); switch (c->x86_model) { case 10: rdmsr(0x1153, lo, hi); brand = (((lo >> 2) ^ lo) >> 18) & 3; printk(KERN_CONT "Model A "); break; case 13: rdmsr(0x1154, lo, hi); brand = (((lo >> 4) ^ (lo >> 2))) & 0x000000ff; printk(KERN_CONT "Model D "); break; } switch (brand) { case EPS_BRAND_C7M: printk(KERN_CONT "C7-M\n"); break; case EPS_BRAND_C7: printk(KERN_CONT "C7\n"); break; case EPS_BRAND_EDEN: printk(KERN_CONT "Eden\n"); break; case EPS_BRAND_C7D: printk(KERN_CONT "C7-D\n"); break; case EPS_BRAND_C3: printk(KERN_CONT "C3\n"); return -ENODEV; break; } /* Enable Enhanced PowerSaver */ rdmsrl(MSR_IA32_MISC_ENABLE, val); if (!(val & MSR_IA32_MISC_ENABLE_ENHANCED_SPEEDSTEP)) { val |= MSR_IA32_MISC_ENABLE_ENHANCED_SPEEDSTEP; wrmsrl(MSR_IA32_MISC_ENABLE, val); /* Can be locked at 0 */ rdmsrl(MSR_IA32_MISC_ENABLE, val); if (!(val & MSR_IA32_MISC_ENABLE_ENHANCED_SPEEDSTEP)) { printk(KERN_INFO "eps: Can't enable Enhanced PowerSaver\n"); return -ENODEV; } } /* Print voltage and multiplier */ rdmsr(MSR_IA32_PERF_STATUS, lo, hi); current_voltage = lo & 0xff; printk(KERN_INFO "eps: Current voltage = %dmV\n", current_voltage * 16 + 700); current_multiplier = (lo >> 8) & 0xff; printk(KERN_INFO "eps: Current multiplier = %d\n", current_multiplier); /* Print limits */ max_voltage = hi & 0xff; printk(KERN_INFO "eps: Highest voltage = %dmV\n", max_voltage * 16 + 700); max_multiplier = (hi >> 8) & 0xff; printk(KERN_INFO "eps: Highest multiplier = %d\n", max_multiplier); min_voltage = (hi >> 16) & 0xff; printk(KERN_INFO "eps: Lowest voltage = %dmV\n", min_voltage * 16 + 700); min_multiplier = (hi >> 24) & 0xff; printk(KERN_INFO "eps: Lowest multiplier = %d\n", min_multiplier); /* Sanity checks */ if (current_multiplier == 0 || max_multiplier == 0 || min_multiplier == 0) return -EINVAL; if (current_multiplier > max_multiplier || max_multiplier <= min_multiplier) return -EINVAL; if (current_voltage > 0x1f || max_voltage > 0x1f) return -EINVAL; if (max_voltage < min_voltage || current_voltage < min_voltage || current_voltage > max_voltage) return -EINVAL; /* Check for systems using underclocked CPU */ if (!freq_failsafe_off && max_multiplier != current_multiplier) { printk(KERN_INFO "eps: Your processor is running at different " "frequency then its maximum. Aborting.\n"); printk(KERN_INFO "eps: You can use freq_failsafe_off option " "to disable this check.\n"); return -EINVAL; } if (!voltage_failsafe_off && max_voltage != current_voltage) { printk(KERN_INFO "eps: Your processor is running at different " "voltage then its maximum. Aborting.\n"); printk(KERN_INFO "eps: You can use voltage_failsafe_off " "option to disable this check.\n"); return -EINVAL; } /* Calc FSB speed */ fsb = cpu_khz / current_multiplier; #if defined CONFIG_ACPI_PROCESSOR || defined CONFIG_ACPI_PROCESSOR_MODULE /* Check for ACPI processor speed limit */ if (!ignore_acpi_limit && !eps_acpi_init()) { if (!acpi_processor_get_bios_limit(policy->cpu, &limit)) { printk(KERN_INFO "eps: ACPI limit %u.%uGHz\n", limit/1000000, (limit%1000000)/10000); eps_acpi_exit(policy); /* Check if max_multiplier is in BIOS limits */ if (limit && max_multiplier * fsb > limit) { printk(KERN_INFO "eps: Aborting.\n"); return -EINVAL; } } } #endif /* Allow user to set lower maximum voltage then that reported * by processor */ if (brand == EPS_BRAND_C7M && set_max_voltage) { u32 v; /* Change mV to something hardware can use */ v = (set_max_voltage - 700) / 16; /* Check if voltage is within limits */ if (v >= min_voltage && v <= max_voltage) { printk(KERN_INFO "eps: Setting %dmV as maximum.\n", v * 16 + 700); max_voltage = v; } } /* Calc number of p-states supported */ if (brand == EPS_BRAND_C7M) states = max_multiplier - min_multiplier + 1; else states = 2; /* Allocate private data and frequency table for current cpu */ centaur = kzalloc(sizeof(struct eps_cpu_data) + (states + 1) * sizeof(struct cpufreq_frequency_table), GFP_KERNEL); if (!centaur) return -ENOMEM; eps_cpu[0] = centaur; /* Copy basic values */ centaur->fsb = fsb; #if defined CONFIG_ACPI_PROCESSOR || defined CONFIG_ACPI_PROCESSOR_MODULE centaur->bios_limit = limit; #endif /* Fill frequency and MSR value table */ f_table = &centaur->freq_table[0]; if (brand != EPS_BRAND_C7M) { f_table[0].frequency = fsb * min_multiplier; f_table[0].index = (min_multiplier << 8) | min_voltage; f_table[1].frequency = fsb * max_multiplier; f_table[1].index = (max_multiplier << 8) | max_voltage; f_table[2].frequency = CPUFREQ_TABLE_END; } else { k = 0; step = ((max_voltage - min_voltage) * 256) / (max_multiplier - min_multiplier); for (i = min_multiplier; i <= max_multiplier; i++) { voltage = (k * step) / 256 + min_voltage; f_table[k].frequency = fsb * i; f_table[k].index = (i << 8) | voltage; k++; } f_table[k].frequency = CPUFREQ_TABLE_END; } policy->cpuinfo.transition_latency = 140000; /* 844mV -> 700mV in ns */ policy->cur = fsb * current_multiplier; ret = cpufreq_frequency_table_cpuinfo(policy, &centaur->freq_table[0]); if (ret) { kfree(centaur); return ret; } cpufreq_frequency_table_get_attr(&centaur->freq_table[0], policy->cpu); return 0; } static int eps_cpu_exit(struct cpufreq_policy *policy) { unsigned int cpu = policy->cpu; /* Bye */ cpufreq_frequency_table_put_attr(policy->cpu); kfree(eps_cpu[cpu]); eps_cpu[cpu] = NULL; return 0; } static struct freq_attr *eps_attr[] = { &cpufreq_freq_attr_scaling_available_freqs, NULL, }; static struct cpufreq_driver eps_driver = { .verify = eps_verify, .target = eps_target, .init = eps_cpu_init, .exit = eps_cpu_exit, .get = eps_get, .name = "e_powersaver", .owner = THIS_MODULE, .attr = eps_attr, }; /* This driver will work only on Centaur C7 processors with * Enhanced SpeedStep/PowerSaver registers */ static const struct x86_cpu_id eps_cpu_id[] = { { X86_VENDOR_CENTAUR, 6, X86_MODEL_ANY, X86_FEATURE_EST }, {} }; MODULE_DEVICE_TABLE(x86cpu, eps_cpu_id); static int __init eps_init(void) { if (!x86_match_cpu(eps_cpu_id) || boot_cpu_data.x86_model < 10) return -ENODEV; if (cpufreq_register_driver(&eps_driver)) return -EINVAL; return 0; } static void __exit eps_exit(void) { cpufreq_unregister_driver(&eps_driver); } /* Allow user to overclock his machine or to change frequency to higher after * unloading module */ module_param(freq_failsafe_off, int, 0644); MODULE_PARM_DESC(freq_failsafe_off, "Disable current vs max frequency check"); module_param(voltage_failsafe_off, int, 0644); MODULE_PARM_DESC(voltage_failsafe_off, "Disable current vs max voltage check"); #if defined CONFIG_ACPI_PROCESSOR || defined CONFIG_ACPI_PROCESSOR_MODULE module_param(ignore_acpi_limit, int, 0644); MODULE_PARM_DESC(ignore_acpi_limit, "Don't check ACPI's processor speed limit"); #endif module_param(set_max_voltage, int, 0644); MODULE_PARM_DESC(set_max_voltage, "Set maximum CPU voltage (mV) C7-M only"); MODULE_AUTHOR("Rafal Bilski <rafalbilski@interia.pl>"); MODULE_DESCRIPTION("Enhanced PowerSaver driver for VIA C7 CPU's."); MODULE_LICENSE("GPL"); module_init(eps_init); module_exit(eps_exit);
{ "pile_set_name": "Github" }
// // The LLC struct in the Link Data : // typdef union _LLC_HDR { struct _LLC_I { // C compilers should allocate the bits from lo to high UINT fDSAP:7; // Destination SAP UINT fGI:1; // Group / Indivual SAP UINT fSSAP:7; // Source SAP UINT fCr:1; // Command/Response UINT fNs:7; // Transmitter send sequence number UINT fType:1; // Set always to 0 UINT fNr:7; // Transmitter receive sequence number UINT fPF:1; // Poll/Final Bit } I; // Information frame struct LLC_S { UINT fDSAP:7; // Destination SAP UINT fGI:1; // Group / Indivual SAP UINT fSSAP:7; // Source SAP UINT fCr:1; // Command/Response UINT fCmd:8; // 0x80, 0x90, 0xA0, 0xB0 UINT fNr:7; // Transmitter receive sequence number UINT fPF:1; // Poll/Final Bit } S; // Supervisory frame struct _LLC_U { UINT fDSAP:7; // Destination SAP UINT fGI:1; // Group / Indivual SAP UINT fSSAP:7; // Source SAP UINT fCr:1; // Command/Response UINT fCmd1:3; // U- commands UINT fPF:1; // Poll/Final Bit UINT fCmd2:2; // U- commands UINT fRes:2; // the topmouts bits are always 11 } U; // U command frame struct _LLC_U_RAW { UINT fDSAP:7; // Destination SAP UINT fGI:1; // Group / Indivual SAP UINT fSSAP:7; // Source SAP UINT fCr:1; // Command/Response UINT fCmd:8; // U- command (OR THIS!!!) UINT fPadding:8; // this is already data } rawU; // U command frame // struct _LLC_TYPE { UINT fDSAP:7; // Destination SAP UINT fGI:1; // Group / Indivual SAP UINT fSSAP:7; // Source SAP UINT fCr:1; // Command/Response UINT fCmd:6; // the command or Ns bits UINT fIsUFrame:1; // 1 => U, 0 => S frame (if not I frame) UINT fIsNotI:1; // 0 => I frame UINT fNr:7; // Transmitter receive seq number for I/S UINT fPF:1; // Poll/Final Bit for I/S frames } type; ULONG ulRawLLc; } LLC_HDR; // ... somewhere in the link struct LLCHDR xmtLcc; // the next transmitted frame, set to 0 when done LLCHDR rvcLcc; // the last received frame // // The first index select the conditon, usActionId is returned if the // condition is true, otherwise the next element is executed typedef struct _COND_ACTS { USHORT usConditionId; USHORT usActionId; } COND_ACTS, FAR *PCOND_ACTS; // // Structure includes all typedef struct _FSM { { PCOND_ACTS pActionSelectIds; // condition-action pairs PUSHORT pusActionPrimtives; // action primitive procedures (USHORT *ActionSelect)(VOID *, PUSHORT, USHORT); // selects the action (UINT *ExecPrimitives)(VOID *, PUSHORT, USHORT); // execs selected action struct { BOOL boolStateProcExists; (UINT * StateProcedure)( VOID *pContext, USHORT ); PUSHORT pusInputs; // returns action selection id #if sizeof(INT) == 4 INT iReserved; // makes element 16 bytes even if 32 bit word #endif } aStates[1]; // for all states } FSM, FAR *PFSM;
{ "pile_set_name": "Github" }
/home/ksw/develop/ijkplayer-android/android/ijkplayer/ijkplayer-x86/src/main/obj/local/x86/objs/ijkj4a/j4a/class/java/nio/Buffer.o: \ /home/ksw/develop/ijkplayer-android/android/ijkplayer/ijkplayer-x86/src/main/jni/ijkmedia/ijkj4a/j4a/class/java/nio/Buffer.c \ /home/ksw/develop/ijkplayer-android/android/ijkplayer/ijkplayer-x86/src/main/jni/ijkmedia/ijkj4a/j4a/class/java/nio/Buffer.h \ /home/ksw/develop/ijkplayer-android/android/ijkplayer/ijkplayer-x86/src/main/jni/ijkmedia/ijkj4a/j4a/j4a_base.h /home/ksw/develop/ijkplayer-android/android/ijkplayer/ijkplayer-x86/src/main/jni/ijkmedia/ijkj4a/j4a/class/java/nio/Buffer.h: /home/ksw/develop/ijkplayer-android/android/ijkplayer/ijkplayer-x86/src/main/jni/ijkmedia/ijkj4a/j4a/j4a_base.h:
{ "pile_set_name": "Github" }
#Ant properties #Automatically generated by the ant prepare.settings.files task eclipse.preferences.version=1 editor_save_participant_org.eclipse.jdt.ui.postsavelistener.cleanup=true org.eclipse.jdt.ui.ignorelowercasenames=true org.eclipse.jdt.ui.importorder=java;javax;org;com; org.eclipse.jdt.ui.javadoc=true org.eclipse.jdt.ui.ondemandthreshold=99 org.eclipse.jdt.ui.staticondemandthreshold=99 org.eclipse.jdt.ui.text.custom_code_templates=<?xml version\="1.0" encoding\="UTF-8"?><templates><template autoinsert\="true" context\="typecomment_context" deleted\="false" description\="Comment for created types" enabled\="true" id\="org.eclipse.jdt.ui.text.codetemplates.typecomment" name\="typecomment">/**\n *\n * ${tags}\n */</template><template autoinsert\="true" context\="delegatecomment_context" deleted\="false" description\="Comment for delegate methods" enabled\="true" id\="org.eclipse.jdt.ui.text.codetemplates.delegatecomment" name\="delegatecomment">/**\n * ${tags}\n * ${see_to_target}\n */</template><template autoinsert\="true" context\="methodcomment_context" deleted\="false" description\="Comment for non-overriding methods" enabled\="true" id\="org.eclipse.jdt.ui.text.codetemplates.methodcomment" name\="methodcomment">/**\n * ${tags}\n */</template><template autoinsert\="true" context\="fieldcomment_context" deleted\="false" description\="Comment for fields" enabled\="true" id\="org.eclipse.jdt.ui.text.codetemplates.fieldcomment" name\="fieldcomment">/** */</template><template autoinsert\="true" context\="constructorcomment_context" deleted\="false" description\="Comment for created constructors" enabled\="true" id\="org.eclipse.jdt.ui.text.codetemplates.constructorcomment" name\="constructorcomment">/**\n * ${tags}\n */</template><template autoinsert\="true" context\="settercomment_context" deleted\="false" description\="Comment for setter method" enabled\="true" id\="org.eclipse.jdt.ui.text.codetemplates.settercomment" name\="settercomment">/**\n * @param ${param} the ${bare_field_name} to set\n */</template><template autoinsert\="true" context\="filecomment_context" deleted\="false" description\="Comment for created Java files" enabled\="true" id\="org.eclipse.jdt.ui.text.codetemplates.filecomment" name="filecomment">/*******************************************************************************\n * Copyright (c) ${year} IBM Corporation and others.\n * All rights reserved. This program and the accompanying materials\n * are made available under the terms of the Eclipse Public License v1.0\n * which accompanies this distribution, and is available at\n * http://www.eclipse.org/legal/epl-v10.html\n *\n * Contributors:\n * IBM Corporation - initial API and implementation\n *******************************************************************************/</template><template autoinsert\="true" context\="gettercomment_context" deleted\="false" description\="Comment for getter method" enabled\="true" id\="org.eclipse.jdt.ui.text.codetemplates.gettercomment" name\="gettercomment">/**\n * @return the ${bare_field_name}\n */</template><template autoinsert\="true" context\="newtype_context" deleted\="false" description\="Newly created files" enabled\="true" id\="org.eclipse.jdt.ui.text.codetemplates.newtype" name\="newtype">${filecomment}\n${package_declaration}\n\n${typecomment}\n${type_declaration}</template><template autoinsert\="true" context\="classbody_context" deleted\="false" description\="Code in new class type bodies" enabled\="true" id\="org.eclipse.jdt.ui.text.codetemplates.classbody" name\="classbody">\n</template><template autoinsert\="true" context\="interfacebody_context" deleted\="false" description\="Code in new interface type bodies" enabled\="true" id\="org.eclipse.jdt.ui.text.codetemplates.interfacebody" name\="interfacebody">\n</template><template autoinsert\="true" context\="enumbody_context" deleted\="false" description\="Code in new enum type bodies" enabled\="true" id\="org.eclipse.jdt.ui.text.codetemplates.enumbody" name\="enumbody">\n</template><template autoinsert\="true" context\="annotationbody_context" deleted\="false" description\="Code in new annotation type bodies" enabled\="true" id\="org.eclipse.jdt.ui.text.codetemplates.annotationbody" name\="annotationbody">\n</template><template autoinsert\="true" context\="catchblock_context" deleted\="false" description\="Code in new catch blocks" enabled\="true" id\="org.eclipse.jdt.ui.text.codetemplates.catchblock" name\="catchblock">// ${todo} Auto-generated catch block\n// Do you need FFDC here? Remember FFDC instrumentation and @FFDCIgnore\n${exception_var}.printStackTrace();</template><template autoinsert\="true" context\="methodbody_context" deleted\="false" description\="Code in created method stubs" enabled\="true" id\="org.eclipse.jdt.ui.text.codetemplates.methodbody" name\="methodbody">// ${todo} Auto-generated method stub\n${body_statement}</template><template autoinsert\="true" context\="constructorbody_context" deleted\="false" description\="Code in created constructor stubs" enabled\="true" id\="org.eclipse.jdt.ui.text.codetemplates.constructorbody" name\="constructorbody">${body_statement}\n// ${todo} Auto-generated constructor stub</template><template autoinsert\="true" context\="getterbody_context" deleted\="false" description\="Code in created getters" enabled\="true" id\="org.eclipse.jdt.ui.text.codetemplates.getterbody" name\="getterbody">return ${field};</template><template autoinsert\="true" context\="setterbody_context" deleted\="false" description\="Code in created setters" enabled\="true" id\="org.eclipse.jdt.ui.text.codetemplates.setterbody" name\="setterbody">${field} \= ${param};</template></templates> sp_cleanup.add_default_serial_version_id=true sp_cleanup.add_generated_serial_version_id=false sp_cleanup.add_missing_annotations=true sp_cleanup.add_missing_deprecated_annotations=true sp_cleanup.add_missing_methods=false sp_cleanup.add_missing_nls_tags=false sp_cleanup.add_missing_override_annotations=true sp_cleanup.add_missing_override_annotations_interface_methods=true sp_cleanup.add_serial_version_id=false sp_cleanup.always_use_blocks=true sp_cleanup.always_use_parentheses_in_expressions=false sp_cleanup.always_use_this_for_non_static_field_access=false sp_cleanup.always_use_this_for_non_static_method_access=false sp_cleanup.convert_to_enhanced_for_loop=false sp_cleanup.correct_indentation=false sp_cleanup.format_source_code=true sp_cleanup.format_source_code_changes_only=false sp_cleanup.make_local_variable_final=false sp_cleanup.make_parameters_final=false sp_cleanup.make_private_fields_final=true sp_cleanup.make_type_abstract_if_missing_method=false sp_cleanup.make_variable_declarations_final=true sp_cleanup.never_use_blocks=false sp_cleanup.never_use_parentheses_in_expressions=true sp_cleanup.on_save_use_additional_actions=true sp_cleanup.organize_imports=true sp_cleanup.qualify_static_field_accesses_with_declaring_class=false sp_cleanup.qualify_static_member_accesses_through_instances_with_declaring_class=true sp_cleanup.qualify_static_member_accesses_through_subtypes_with_declaring_class=true sp_cleanup.qualify_static_member_accesses_with_declaring_class=false sp_cleanup.qualify_static_method_accesses_with_declaring_class=false sp_cleanup.remove_private_constructors=true sp_cleanup.remove_trailing_whitespaces=true sp_cleanup.remove_trailing_whitespaces_all=true sp_cleanup.remove_trailing_whitespaces_ignore_empty=false sp_cleanup.remove_unnecessary_casts=true sp_cleanup.remove_unnecessary_nls_tags=true sp_cleanup.remove_unused_imports=true sp_cleanup.remove_unused_local_variables=false sp_cleanup.remove_unused_private_fields=true sp_cleanup.remove_unused_private_members=false sp_cleanup.remove_unused_private_methods=true sp_cleanup.remove_unused_private_types=true sp_cleanup.sort_members=false sp_cleanup.sort_members_all=false sp_cleanup.use_blocks=false sp_cleanup.use_blocks_only_for_return_and_throw=false sp_cleanup.use_parentheses_in_expressions=false sp_cleanup.use_this_for_non_static_field_access=false sp_cleanup.use_this_for_non_static_field_access_only_if_necessary=true sp_cleanup.use_this_for_non_static_method_access=false sp_cleanup.use_this_for_non_static_method_access_only_if_necessary=true
{ "pile_set_name": "Github" }
<?php /* * This file is part of the Symfony package. * * (c) Fabien Potencier <fabien@symfony.com> * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ namespace Symfony\Component\CssSelector\Tests\Node; use PHPUnit\Framework\TestCase; use Symfony\Component\CssSelector\Node\Specificity; class SpecificityTest extends TestCase { /** @dataProvider getValueTestData */ public function testValue(Specificity $specificity, $value) { $this->assertEquals($value, $specificity->getValue()); } /** @dataProvider getValueTestData */ public function testPlusValue(Specificity $specificity, $value) { $this->assertEquals($value + 123, $specificity->plus(new Specificity(1, 2, 3))->getValue()); } public function getValueTestData() { return array( array(new Specificity(0, 0, 0), 0), array(new Specificity(0, 0, 2), 2), array(new Specificity(0, 3, 0), 30), array(new Specificity(4, 0, 0), 400), array(new Specificity(4, 3, 2), 432), ); } /** @dataProvider getCompareTestData */ public function testCompareTo(Specificity $a, Specificity $b, $result) { $this->assertEquals($result, $a->compareTo($b)); } public function getCompareTestData() { return array( array(new Specificity(0, 0, 0), new Specificity(0, 0, 0), 0), array(new Specificity(0, 0, 1), new Specificity(0, 0, 1), 0), array(new Specificity(0, 0, 2), new Specificity(0, 0, 1), 1), array(new Specificity(0, 0, 2), new Specificity(0, 0, 3), -1), array(new Specificity(0, 4, 0), new Specificity(0, 4, 0), 0), array(new Specificity(0, 6, 0), new Specificity(0, 5, 11), 1), array(new Specificity(0, 7, 0), new Specificity(0, 8, 0), -1), array(new Specificity(9, 0, 0), new Specificity(9, 0, 0), 0), array(new Specificity(11, 0, 0), new Specificity(10, 11, 0), 1), array(new Specificity(12, 11, 0), new Specificity(13, 0, 0), -1), ); } }
{ "pile_set_name": "Github" }
<?xml version="1.0" encoding="UTF-8"?> <!DOCTYPE pkgmetadata SYSTEM "http://www.gentoo.org/dtd/metadata.dtd"> <pkgmetadata> <maintainer type="person"> <email>0xd34df00d@gmail.com</email> <name>Georg Rudoy</name> </maintainer> <maintainer type="project"> <email>proxy-maint@gentoo.org</email> <name>Proxy Maintainers</name> </maintainer> </pkgmetadata>
{ "pile_set_name": "Github" }
package test; interface IBar {}
{ "pile_set_name": "Github" }
# # S/390 crypto devices # ap-objs := ap_bus.o obj-$(CONFIG_ZCRYPT) += ap.o zcrypt_api.o zcrypt_pcicc.o zcrypt_pcixcc.o obj-$(CONFIG_ZCRYPT) += zcrypt_pcica.o zcrypt_cex2a.o zcrypt_cex4.o obj-$(CONFIG_ZCRYPT) += zcrypt_msgtype6.o zcrypt_msgtype50.o
{ "pile_set_name": "Github" }
# -*- coding: utf-8 -*- from lmfdb.tests import LmfdbTest class LocalFieldTest(LmfdbTest): # All tests should pass # def test_search_ramif_cl_deg(self): L = self.tc.get('/LocalNumberField/?n=8&c=24&gal=8T5&p=2&e=8&count=20') assert '4 matches' in L.get_data(as_text=True) def test_search_top_slope(self): L = self.tc.get('/LocalNumberField/?p=2&topslope=3.5') assert '81' in L.get_data(as_text=True) # number of matches L = self.tc.get('/LocalNumberField/?p=2&topslope=3.4..3.55') assert '81' in L.get_data(as_text=True) # number of matches L = self.tc.get('/LocalNumberField/?p=2&topslope=7/2') assert '81' in L.get_data(as_text=True) # number of matches def test_field_page(self): L = self.tc.get('/LocalNumberField/11.6.4.2') assert 'x^{2} - x + 7' in L.get_data(as_text=True) # bad (not robust) test, but it's the best i was able to find... assert 'x^{3} - 11 t' in L.get_data(as_text=True) # bad (not robust) test, but it's the best i was able to find... def test_global_splitting_models(self): # The first one will have to change if we compute a GSM for it L = self.tc.get('/LocalNumberField/163.8.7.2') assert 'Not computed' in L.get_data(as_text=True) L = self.tc.get('/LocalNumberField/2.8.0.1') assert 'Does not exist' in L.get_data(as_text=True)
{ "pile_set_name": "Github" }
import { h, Component } from 'preact' export class Greeting extends Component { constructor(props) { super(props); this.state = { greeting: 'hi' }; this.setGreeting = this.setGreeting.bind(this); } setGreeting() { this.setState({ greeting: 'bye' }); } render() { return ( <div> <p className="class-text">I'm a class component</p> <p className="greeting-text">{this.state.greeting}</p> <button className="greeting-button" onClick={this.setGreeting}>set</button> </div> ) } }
{ "pile_set_name": "Github" }
-----BEGIN EC PRIVATE KEY----- MIHcAgEBBEIBsbatB7t55zINpZhg6ijgVShPYFjyed5mbgbUNdKve9oo2Z+ke33Q lj4WsAcweO6LijjZZqWC9G0Z/5XfOtloWq6gBwYFK4EEACOhgYkDgYYABAAd4ULV T2nrA47kt6+dPKB3Nv2c9xnrNU1ph57n88E2+w+/nwj4a+X6Eo7BoFHT5sZD6Fra j/rPNmPCYL0shEtvVgDO6OSKnmXQnK3YnyNd7gXzuKZGvnFfH2fVtDTg/yOh/Afv d0AZPkDu/287zf12WqkVUDNST+TyBfVETiksTC9qwQ== -----END EC PRIVATE KEY-----
{ "pile_set_name": "Github" }
#!/bin/sh # # Provisioning script for Stratio Sandbox. # More info at https://github.com/Stratio/sandbox # # ############## ## SERVICES ## ############## echo -e 'Installing Stratio Decision services...' yum -y -q --nogpgcheck install httpd stratio-decision stratio-decision-shell chkconfig zookeeper off chkconfig kafka off chkconfig decision off chkconfig cassandra on chkconfig elasticsearch on chkconfig httpd on cat >/etc/rc.local <<EOF #!/bin/sh # # This script will be executed *after* all the other init scripts. # You can put your own initialization stuff in here if you don't # want to do the full Sys V style init stuff. service zookeeper start sleep 5 service kafka start sleep 5 service decision start touch /var/lock/subsys/local EOF if ! grep -R "analyzer.default.type" "/etc/sds/elasticsearch/elasticsearch.yml"; then echo "index.analysis.analyzer.default.type: keyword" >> /etc/sds/elasticsearch/elasticsearch.yml fi service zookeeper restart service kafka restart service cassandra restart service mongodb restart service elasticsearch restart service decision restart service httpd restart ############ ## KIBANA ## ############ if [ ! -d "/var/www/html/kibana" ]; then echo -e 'Downloading kibana...' wget -q 'https://download.elasticsearch.org/kibana/kibana/kibana-3.1.0.tar.gz' -P /home/vagrant/downloads echo -e 'Uncompressing kibana...' tar -xzf /home/vagrant/downloads/kibana-3.1.0.tar.gz -C /var/www/html mv /var/www/html/kibana-3.1.0 /var/www/html/kibana fi ################################ ## STRATIO DECISION EXAMPLES ## ################################ DOWNLOAD_EXAMPLES_URL="https://s3.amazonaws.com/stratioorg/decision-examples-${STRATIO_MODULE_VERSION}-app.tar.gz" echo $DOWNLOAD_EXAMPLES_URL if [ ! -d "/opt/sds/decision-examples" ]; then echo -e 'Building Stratio Decision Examples...' mkdir /opt/sds/decision-examples wget -q $DOWNLOAD_EXAMPLES_URL -P /home/vagrant/downloads tar -xzf /home/vagrant/downloads/decision-examples-$STRATIO_MODULE_VERSION-app.tar.gz -C /home/vagrant/downloads cp -fr /home/vagrant/downloads/decision-examples-$STRATIO_MODULE_VERSION/* /opt/sds/decision-examples fi ####################### ## KIBANA DASHBOARDS ## ####################### cp -f /opt/sds/decision-examples/dashboards/*.json /var/www/html/kibana/app/dashboards chmod -R 777 /var/www/html/kibana/app/dashboards ##################### ## WELCOME MESSAGE ## #####################
{ "pile_set_name": "Github" }
type Bluebird$RangeError = Error; type Bluebird$CancellationErrors = Error; type Bluebird$TimeoutError = Error; type Bluebird$RejectionError = Error; type Bluebird$OperationalError = Error; type Bluebird$ConcurrencyOption = { concurrency: number }; type Bluebird$SpreadOption = { spread: boolean }; type Bluebird$MultiArgsOption = { multiArgs: boolean }; type Bluebird$BluebirdConfig = { warnings?: boolean, longStackTraces?: boolean, cancellation?: boolean, monitoring?: boolean }; declare class Bluebird$PromiseInspection<T> { isCancelled(): boolean; isFulfilled(): boolean; isRejected(): boolean; pending(): boolean; reason(): any; value(): T; } type Bluebird$PromisifyOptions = {| multiArgs?: boolean, context: any |}; declare type Bluebird$PromisifyAllOptions = { suffix?: string, filter?: ( name: string, func: Function, target?: any, passesDefaultFilter?: boolean ) => boolean, // The promisifier gets a reference to the original method and should return a function which returns a promise promisifier?: (originalMethod: Function) => () => Bluebird$Promise<any> }; declare type $Promisable<T> = Promise<T> | T; declare class Bluebird$Disposable<R> {} declare class Bluebird$Promise<+R> extends Promise<R> { static RangeError: Class<Bluebird$RangeError>; static CancellationErrors: Class<Bluebird$CancellationErrors>; static TimeoutError: Class<Bluebird$TimeoutError>; static RejectionError: Class<Bluebird$RejectionError>; static OperationalError: Class<Bluebird$OperationalError>; static Defer: Class<Bluebird$Defer>; static PromiseInspection: Class<Bluebird$PromiseInspection<*>>; static all<T>( Promises: $Promisable<Iterable<$Promisable<T>>> ): Bluebird$Promise<Array<T>>; static props( input: Object | Map<*, *> | $Promisable<Object | Map<*, *>> ): Bluebird$Promise<*>; static any<T, Elem: $Promisable<T>>( Promises: Iterable<Elem> | $Promisable<Iterable<Elem>> ): Bluebird$Promise<T>; static race<T, Elem: $Promisable<T>>( Promises: Iterable<Elem> | $Promisable<Iterable<Elem>> ): Bluebird$Promise<T>; static reject<T>(error?: any): Bluebird$Promise<T>; static resolve<T>(object?: $Promisable<T>): Bluebird$Promise<T>; static some<T, Elem: $Promisable<T>>( Promises: Iterable<Elem> | $Promisable<Iterable<Elem>>, count: number ): Bluebird$Promise<Array<T>>; static join<T, A>( value1: $Promisable<A>, handler: (a: A) => $Promisable<T> ): Bluebird$Promise<T>; static join<T, A, B>( value1: $Promisable<A>, value2: $Promisable<B>, handler: (a: A, b: B) => $Promisable<T> ): Bluebird$Promise<T>; static join<T, A, B, C>( value1: $Promisable<A>, value2: $Promisable<B>, value3: $Promisable<C>, handler: (a: A, b: B, c: C) => $Promisable<T> ): Bluebird$Promise<T>; static map<T, U, Elem: $Promisable<T>>( Promises: Iterable<Elem> | $Promisable<Iterable<Elem>>, mapper: (item: T, index: number, arrayLength: number) => $Promisable<U>, options?: Bluebird$ConcurrencyOption ): Bluebird$Promise<Array<U>>; static mapSeries<T, U, Elem: $Promisable<T>>( Promises: Iterable<Elem> | $Promisable<Iterable<Elem>>, mapper: (item: T, index: number, arrayLength: number) => $Promisable<U> ): Bluebird$Promise<Array<U>>; static reduce<T, U, Elem: $Promisable<T>>( Promises: Iterable<Elem> | $Promisable<Iterable<Elem>>, reducer: ( total: U, current: T, index: number, arrayLength: number ) => $Promisable<U>, initialValue?: $Promisable<U> ): Bluebird$Promise<U>; static filter<T, Elem: $Promisable<T>>( Promises: Iterable<Elem> | $Promisable<Iterable<Elem>>, filterer: ( item: T, index: number, arrayLength: number ) => $Promisable<boolean>, option?: Bluebird$ConcurrencyOption ): Bluebird$Promise<Array<T>>; static each<T, Elem: $Promisable<T>>( Promises: Iterable<Elem> | $Promisable<Iterable<Elem>>, iterator: ( item: T, index: number, arrayLength: number ) => $Promisable<mixed> ): Bluebird$Promise<Array<T>>; static try<T>( fn: () => $Promisable<T>, args: ?Array<any>, ctx: ?any ): Bluebird$Promise<T>; static attempt<T>( fn: () => $Promisable<T>, args: ?Array<any>, ctx: ?any ): Bluebird$Promise<T>; static delay<T>(ms: number, value: $Promisable<T>): Bluebird$Promise<T>; static delay(ms: number): Bluebird$Promise<void>; static config(config: Bluebird$BluebirdConfig): void; static defer(): Bluebird$Defer; static setScheduler( scheduler: (callback: (...args: Array<any>) => void) => void ): void; static promisify( nodeFunction: Function, receiver?: Bluebird$PromisifyOptions ): Function; static promisifyAll( target: Object | Array<Object>, options?: Bluebird$PromisifyAllOptions ): void; static coroutine(generatorFunction: Function): Function; static spawn<T>(generatorFunction: Function): Promise<T>; // It doesn't seem possible to have type-generics for a variable number of arguments. // Handle up to 3 arguments, then just give up and accept 'any'. static method<T, R: $Promisable<T>>(fn: () => R): () => Bluebird$Promise<T>; static method<T, R: $Promisable<T>, A>( fn: (a: A) => R ): (a: A) => Bluebird$Promise<T>; static method<T, R: $Promisable<T>, A, B>( fn: (a: A, b: B) => R ): (a: A, b: B) => Bluebird$Promise<T>; static method<T, R: $Promisable<T>, A, B, C>( fn: (a: A, b: B, c: C) => R ): (a: A, b: B, c: C) => Bluebird$Promise<T>; static method<T, R: $Promisable<T>>( fn: (...args: any) => R ): (...args: any) => Bluebird$Promise<T>; static cast<T>(value: $Promisable<T>): Bluebird$Promise<T>; // static bind(ctx: any): Bluebird$Promise<void>; static is(value: any): boolean; static longStackTraces(): void; static onPossiblyUnhandledRejection(handler: (reason: any) => any): void; static fromCallback<T>( resolver: (fn: (error: ?Error, value?: T) => any) => any, options?: Bluebird$MultiArgsOption ): Bluebird$Promise<T>; constructor( callback: ( resolve: (result?: $Promisable<R>) => void, reject: (error?: any) => void, onCancel?: (fn?: () => void) => void, ) => mixed ): void; then(onFulfill: null | void, onReject: null | void): Bluebird$Promise<R>; then<U>( onFulfill: null | void, onReject: (error: any) => Promise<U> | U ): Bluebird$Promise<R | U>; then<U>( onFulfill: (value: R) => Promise<U> | U, onReject: null | void | ((error: any) => Promise<U> | U) ): Bluebird$Promise<U>; catch(onReject: null | void): Promise<R>; catch<U>(onReject?: (error: any) => $Promisable<U>): Bluebird$Promise<U>; catch<U, ErrorT: Error>( err: Class<ErrorT>, onReject: (error: ErrorT) => $Promisable<U> ): Bluebird$Promise<U>; catch<U, ErrorT: Error>( err1: Class<ErrorT>, err2: Class<ErrorT>, onReject: (error: ErrorT) => $Promisable<U> ): Bluebird$Promise<U>; catch<U, ErrorT: Error>( err1: Class<ErrorT>, err2: Class<ErrorT>, err3: Class<ErrorT>, onReject: (error: ErrorT) => $Promisable<U> ): Bluebird$Promise<U>; caught<U, ErrorT: Error>( err: Class<ErrorT>, onReject: (error: Error) => $Promisable<U> ): Bluebird$Promise<U>; caught<U, ErrorT: Error>( err1: Class<ErrorT>, err2: Class<ErrorT>, onReject: (error: ErrorT) => $Promisable<U> ): Bluebird$Promise<U>; caught<U, ErrorT: Error>( err1: Class<ErrorT>, err2: Class<ErrorT>, err3: Class<ErrorT>, onReject: (error: ErrorT) => $Promisable<U> ): Bluebird$Promise<U>; caught<U>(onReject: (error: any) => $Promisable<U>): Bluebird$Promise<U>; error<U>(onReject?: (error: any) => ?$Promisable<U>): Bluebird$Promise<U>; done<U>( onFulfill?: (value: R) => mixed, onReject?: (error: any) => mixed ): void; finally<T>(onDone?: (value: R) => mixed): Bluebird$Promise<T>; lastly<T>(onDone?: (value: R) => mixed): Bluebird$Promise<T>; tap<T>(onDone?: (value: R) => mixed): Bluebird$Promise<T>; delay(ms: number): Bluebird$Promise<R>; timeout(ms: number, message?: string): Bluebird$Promise<R>; cancel(): void; // bind(ctx: any): Bluebird$Promise<R>; call(propertyName: string, ...args: Array<any>): Bluebird$Promise<any>; throw(reason: Error): Bluebird$Promise<R>; thenThrow(reason: Error): Bluebird$Promise<R>; all<T>(): Bluebird$Promise<Array<T>>; any<T>(): Bluebird$Promise<T>; some<T>(count: number): Bluebird$Promise<Array<T>>; race<T>(): Bluebird$Promise<T>; map<T, U>( mapper: (item: T, index: number, arrayLength: number) => $Promisable<U>, options?: Bluebird$ConcurrencyOption ): Bluebird$Promise<Array<U>>; mapSeries<T, U>( mapper: (item: T, index: number, arrayLength: number) => $Promisable<U> ): Bluebird$Promise<Array<U>>; reduce<T, U>( reducer: ( total: T, item: U, index: number, arrayLength: number ) => $Promisable<T>, initialValue?: $Promisable<T> ): Bluebird$Promise<T>; filter<T>( filterer: ( item: T, index: number, arrayLength: number ) => $Promisable<boolean>, options?: Bluebird$ConcurrencyOption ): Bluebird$Promise<Array<T>>; each<T, U>( iterator: (item: T, index: number, arrayLength: number) => $Promisable<U> ): Bluebird$Promise<Array<T>>; asCallback<T>( callback: (error: ?any, value?: T) => any, options?: Bluebird$SpreadOption ): void; return<T>(value: T): Bluebird$Promise<T>; thenReturn<T>(value: T): Bluebird$Promise<T>; spread<T>(...args: Array<T>): Bluebird$Promise<*>; reflect(): Bluebird$Promise<Bluebird$PromiseInspection<*>>; isFulfilled(): boolean; isRejected(): boolean; isPending(): boolean; isResolved(): boolean; value(): R; reason(): any; disposer( disposer: (value: R, promise: Promise<*>) => void ): Bluebird$Disposable<R>; static using<T, A>( disposable: Bluebird$Disposable<T>, handler: (value: T) => $Promisable<A> ): Bluebird$Promise<A>; suppressUnhandledRejections(): void; } declare class Bluebird$Defer { promise: Bluebird$Promise<*>; resolve: (value: any) => any; reject: (value: any) => any; } declare module "bluebird" { declare module.exports: typeof Bluebird$Promise; declare type Disposable<T> = Bluebird$Disposable<T>; }
{ "pile_set_name": "Github" }
@import "../../base"; @import "./index";
{ "pile_set_name": "Github" }
alias tmux="tmux -2" # Fix tmux making vim colors funky alias tmuxh='tmux attach -t host-session || tmux new-session -s host-session' alias tmuxp='tmux attach -t pair-session || tmux new-session -t host-session -s pair-session'
{ "pile_set_name": "Github" }
using System.Threading.Tasks; using Nethereum.ABI.FunctionEncoding.Attributes; using Nethereum.RPC.Eth.DTOs; namespace Nethereum.Contracts.ContractHandlers { public interface IContractQueryHandler<TFunctionMessage> where TFunctionMessage : FunctionMessage, new() { Task<TFunctionOutput> QueryAsync<TFunctionOutput>(string contractAddress, TFunctionMessage functionMessage = null, BlockParameter block = null); Task<TFunctionOutput> QueryDeserializingToObjectAsync<TFunctionOutput>(TFunctionMessage functionMessage, string contractAddress, BlockParameter block = null) where TFunctionOutput : IFunctionOutputDTO, new(); Task<byte[]> QueryRawAsBytesAsync(string contractAddress, TFunctionMessage functionMessage = null, BlockParameter block = null); Task<string> QueryRawAsync(string contractAddress, TFunctionMessage functionMessage = null, BlockParameter block = null); } }
{ "pile_set_name": "Github" }
# AUTOGENERATED FILE FROM balenalib/apalis-imx6q-ubuntu:focal-run # remove several traces of debian python RUN apt-get purge -y python.* # http://bugs.python.org/issue19846 # > At the moment, setting "LANG=C" on a Linux system *fundamentally breaks Python 3*, and that's not OK. ENV LANG C.UTF-8 # install python dependencies RUN apt-get update && apt-get install -y --no-install-recommends \ ca-certificates \ netbase \ && rm -rf /var/lib/apt/lists/* # key 63C7CC90: public key "Simon McVittie <smcv@pseudorandom.co.uk>" imported # key 3372DCFA: public key "Donald Stufft (dstufft) <donald@stufft.io>" imported RUN gpg --keyserver keyring.debian.org --recv-keys 4DE8FF2A63C7CC90 \ && gpg --keyserver keyserver.ubuntu.com --recv-key 6E3CBCE93372DCFA \ && gpg --keyserver keyserver.ubuntu.com --recv-keys 0x52a43a1e4b77b059 ENV PYTHON_VERSION 3.7.8 # if this is called "PIP_VERSION", pip explodes with "ValueError: invalid truth value '<VERSION>'" ENV PYTHON_PIP_VERSION 20.1.1 ENV SETUPTOOLS_VERSION 49.1.0 RUN set -x \ && buildDeps=' \ curl \ ' \ && apt-get update && apt-get install -y $buildDeps --no-install-recommends && rm -rf /var/lib/apt/lists/* \ && curl -SLO "http://resin-packages.s3.amazonaws.com/python/v$PYTHON_VERSION/Python-$PYTHON_VERSION.linux-armv7hf-openssl1.1.tar.gz" \ && echo "d698c5962ad32b8bfe6d24624c26799859b6cdd5efa9ba69bb61ab0318411fae Python-$PYTHON_VERSION.linux-armv7hf-openssl1.1.tar.gz" | sha256sum -c - \ && tar -xzf "Python-$PYTHON_VERSION.linux-armv7hf-openssl1.1.tar.gz" --strip-components=1 \ && rm -rf "Python-$PYTHON_VERSION.linux-armv7hf-openssl1.1.tar.gz" \ && ldconfig \ && if [ ! -e /usr/local/bin/pip3 ]; then : \ && curl -SLO "https://raw.githubusercontent.com/pypa/get-pip/430ba37776ae2ad89f794c7a43b90dc23bac334c/get-pip.py" \ && echo "19dae841a150c86e2a09d475b5eb0602861f2a5b7761ec268049a662dbd2bd0c get-pip.py" | sha256sum -c - \ && python3 get-pip.py \ && rm get-pip.py \ ; fi \ && pip3 install --no-cache-dir --upgrade --force-reinstall pip=="$PYTHON_PIP_VERSION" setuptools=="$SETUPTOOLS_VERSION" \ && find /usr/local \ \( -type d -a -name test -o -name tests \) \ -o \( -type f -a -name '*.pyc' -o -name '*.pyo' \) \ -exec rm -rf '{}' + \ && cd / \ && rm -rf /usr/src/python ~/.cache # make some useful symlinks that are expected to exist RUN cd /usr/local/bin \ && ln -sf pip3 pip \ && { [ -e easy_install ] || ln -s easy_install-* easy_install; } \ && ln -sf idle3 idle \ && ln -sf pydoc3 pydoc \ && ln -sf python3 python \ && ln -sf python3-config python-config # set PYTHONPATH to point to dist-packages ENV PYTHONPATH /usr/lib/python3/dist-packages:$PYTHONPATH CMD ["echo","'No CMD command was set in Dockerfile! Details about CMD command could be found in Dockerfile Guide section in our Docs. Here's the link: https://balena.io/docs"] RUN curl -SLO "https://raw.githubusercontent.com/balena-io-library/base-images/8accad6af708fca7271c5c65f18a86782e19f877/scripts/assets/tests/test-stack@python.sh" \ && echo "Running test-stack@python" \ && chmod +x test-stack@python.sh \ && bash test-stack@python.sh \ && rm -rf test-stack@python.sh RUN [ ! -d /.balena/messages ] && mkdir -p /.balena/messages; echo 'Here are a few details about this Docker image (For more information please visit https://www.balena.io/docs/reference/base-images/base-images/): \nArchitecture: ARM v7 \nOS: Ubuntu focal \nVariant: run variant \nDefault variable(s): UDEV=off \nThe following software stack is preinstalled: \nPython v3.7.8, Pip v20.1.1, Setuptools v49.1.0 \nExtra features: \n- Easy way to install packages with `install_packages <package-name>` command \n- Run anywhere with cross-build feature (for ARM only) \n- Keep the container idling with `balena-idle` command \n- Show base image details with `balena-info` command' > /.balena/messages/image-info RUN echo '#!/bin/sh.real\nbalena-info\nrm -f /bin/sh\ncp /bin/sh.real /bin/sh\n/bin/sh "$@"' > /bin/sh-shim \ && chmod +x /bin/sh-shim \ && cp /bin/sh /bin/sh.real \ && mv /bin/sh-shim /bin/sh
{ "pile_set_name": "Github" }
{ "AWSTemplateFormatVersion": "2010-09-09", "Description": "CoreOS on EC2: http://coreos.com/docs/running-coreos/cloud-providers/ec2/", "Mappings" : { "RegionMap" : { "us-east-1" : { "AMI" : "ami-4e715d26" } } }, "Parameters": { "InstanceType" : { "Description" : "EC2 PV instance type (m3.medium, etc).", "Type" : "String", "Default" : "m3.medium", "ConstraintDescription" : "Must be a valid EC2 PV instance type." }, "ClusterSize": { "Default": "3", "MinValue": "1", "MaxValue": "12", "Description": "Number of nodes in cluster (1-12). 3 or larger is recommended.", "Type": "Number" }, "DiscoveryURL": { "Description": "An unique etcd cluster discovery URL. Grab a new token from https://discovery.etcd.io/new", "Type": "String" }, "AdvertisedIPAddress": { "Description": "Use 'private' if your etcd cluster is within one region or 'public' if it spans regions or cloud providers.", "Default": "private", "AllowedValues": ["private", "public"], "Type": "String" }, "AllowSSHFrom": { "Description": "The net block (CIDR) that SSH is available to.", "Default": "0.0.0.0/0", "Type": "String" }, "KeyPair" : { "Description" : "The name of an EC2 Key Pair to allow SSH access to the instance.", "Type" : "String" } }, "Resources": { "CoreOSSecurityGroup": { "Type": "AWS::EC2::SecurityGroup", "Properties": { "GroupDescription": "CoreOS SecurityGroup", "SecurityGroupIngress": [ {"IpProtocol": "tcp", "FromPort": "22", "ToPort": "22", "CidrIp": {"Ref": "AllowSSHFrom"}} ] } }, "Ingress4001": { "Type": "AWS::EC2::SecurityGroupIngress", "Properties": { "GroupName": {"Ref": "CoreOSSecurityGroup"}, "IpProtocol": "tcp", "FromPort": "4001", "ToPort": "4001", "SourceSecurityGroupId": { "Fn::GetAtt" : [ "CoreOSSecurityGroup", "GroupId" ] } } }, "Ingress7001": { "Type": "AWS::EC2::SecurityGroupIngress", "Properties": { "GroupName": {"Ref": "CoreOSSecurityGroup"}, "IpProtocol": "tcp", "FromPort": "7001", "ToPort": "7001", "SourceSecurityGroupId": { "Fn::GetAtt" : [ "CoreOSSecurityGroup", "GroupId" ] } } }, "Ingress112xx": { "Type": "AWS::EC2::SecurityGroupIngress", "Properties": { "GroupName": {"Ref": "CoreOSSecurityGroup"}, "IpProtocol": "tcp", "FromPort": "11209", "ToPort": "11211", "SourceSecurityGroupId": { "Fn::GetAtt" : [ "CoreOSSecurityGroup", "GroupId" ] } } }, "Ingress8091": { "Type": "AWS::EC2::SecurityGroupIngress", "Properties": { "GroupName": {"Ref": "CoreOSSecurityGroup"}, "IpProtocol": "tcp", "FromPort": "8091", "ToPort": "8091", "CidrIp": "0.0.0.0/0" } }, "Ingress8092": { "Type": "AWS::EC2::SecurityGroupIngress", "Properties": { "GroupName": {"Ref": "CoreOSSecurityGroup"}, "IpProtocol": "tcp", "FromPort": "8092", "ToPort": "8092", "SourceSecurityGroupId": { "Fn::GetAtt" : [ "CoreOSSecurityGroup", "GroupId" ] } } }, "Ingress4369": { "Type": "AWS::EC2::SecurityGroupIngress", "Properties": { "GroupName": {"Ref": "CoreOSSecurityGroup"}, "IpProtocol": "tcp", "FromPort": "4369", "ToPort": "4369", "SourceSecurityGroupId": { "Fn::GetAtt" : [ "CoreOSSecurityGroup", "GroupId" ] } } }, "Ingress211xx": { "Type": "AWS::EC2::SecurityGroupIngress", "Properties": { "GroupName": {"Ref": "CoreOSSecurityGroup"}, "IpProtocol": "tcp", "FromPort": "21100", "ToPort": "21199", "SourceSecurityGroupId": { "Fn::GetAtt" : [ "CoreOSSecurityGroup", "GroupId" ] } } }, "Ingress8484": { "Type": "AWS::EC2::SecurityGroupIngress", "Properties": { "GroupName": {"Ref": "CoreOSSecurityGroup"}, "IpProtocol": "tcp", "FromPort": "8484", "ToPort": "8484", "SourceSecurityGroupId": { "Fn::GetAtt" : [ "CoreOSSecurityGroup", "GroupId" ] } } }, "Ingress8423": { "Type": "AWS::EC2::SecurityGroupIngress", "Properties": { "GroupName": {"Ref": "CoreOSSecurityGroup"}, "IpProtocol": "tcp", "FromPort": "8423", "ToPort": "8423", "SourceSecurityGroupId": { "Fn::GetAtt" : [ "CoreOSSecurityGroup", "GroupId" ] } } }, "Ingress4985": { "Type": "AWS::EC2::SecurityGroupIngress", "Properties": { "GroupName": {"Ref": "CoreOSSecurityGroup"}, "IpProtocol": "tcp", "FromPort": "4985", "ToPort": "4985", "SourceSecurityGroupId": { "Fn::GetAtt" : [ "CoreOSSecurityGroup", "GroupId" ] } } }, "Ingress4984": { "Type": "AWS::EC2::SecurityGroupIngress", "Properties": { "GroupName": {"Ref": "CoreOSSecurityGroup"}, "IpProtocol": "tcp", "FromPort": "4984", "ToPort": "4984", "CidrIp": "0.0.0.0/0" } }, "Ingress80": { "Type": "AWS::EC2::SecurityGroupIngress", "Properties": { "GroupName": {"Ref": "CoreOSSecurityGroup"}, "IpProtocol": "tcp", "FromPort": "80", "ToPort": "80", "CidrIp": "0.0.0.0/0" } }, "CoreOSServerAutoScale": { "Type": "AWS::AutoScaling::AutoScalingGroup", "Properties": { "AvailabilityZones": {"Fn::GetAZs": ""}, "LaunchConfigurationName": {"Ref": "CoreOSServerLaunchConfig"}, "MinSize": "1", "MaxSize": "12", "DesiredCapacity": {"Ref": "ClusterSize"}, "Tags": [ {"Key": "Name", "Value": { "Ref" : "AWS::StackName" }, "PropagateAtLaunch": true} ] } }, "CoreOSServerLaunchConfig": { "Type": "AWS::AutoScaling::LaunchConfiguration", "Properties": { "ImageId" : { "Fn::FindInMap" : [ "RegionMap", { "Ref" : "AWS::Region" }, "AMI" ]}, "InstanceType": {"Ref": "InstanceType"}, "KeyName": {"Ref": "KeyPair"}, "SecurityGroups": [{"Ref": "CoreOSSecurityGroup"}], "BlockDeviceMappings": [{ "DeviceName": "/dev/xvda", "Ebs" : {"VolumeSize": "20"} }], "UserData" : { "Fn::Base64": { "Fn::Join": [ "", [ "#cloud-config\n\n", "write_files:\n", " - path: /etc/systemd/system/docker.service.d/increase-ulimit.conf\n", " owner: core:core\n", " permissions: 0644\n", " content: |\n", " [Service]\n", " LimitMEMLOCK=infinity\n", " - path: /etc/systemd/system/fleet.socket.d/30-ListenStream.conf\n", " owner: core:core\n", " permissions: 0644\n", " content: |\n", " [Socket]\n", " ListenStream=127.0.0.1:49153\n", " - path: /opt/couchbase/var/.README\n", " owner: core:core\n", " permissions: 0644\n", " content: |\n", " Couchbase /opt/couchbase/var data volume in container mounted here\n", " - path: /var/lib/cbfs/data/.README\n", " owner: core:core\n", " permissions: 0644\n", " content: |\n", " CBFS files are stored here\n", " - path: /opt/bin/etcdctl-get-first\n", " owner: core:core\n", " permissions: 0744\n", " content: |\n", " etcdctl ls $1 | head -n1 | awk -F/ '{print $4}'\n", " - path: /opt/bin/couchbase-server-ip\n", " owner: core:core\n", " permissions: 0744\n", " content: |\n", " MAX_ATTEMPTS=50\n", " SLEEP_SECS=10\n", " num_attempts=0\n", " COUCHBASE_SERVER_IP=$(/opt/bin/etcdctl-get-first /couchbase.com/couchbase-node-state)\n", " while [ -z \"$COUCHBASE_SERVER_IP\" ]; do\n", " sleep $SLEEP_SECS\n", " num_attempts=$((num_attempts+1))\n", " if [[ \"$num_attempts\" -gt \"$MAX_ATTEMPTS\" ]]; then\n", " echo \"Failed to get couchbase ip after $MAX_ATTEMPTS attempts\"\n", " exit 1\n", " fi\n", " COUCHBASE_SERVER_IP=$(/opt/bin/etcdctl-get-first /couchbase.com/couchbase-node-state)\n", " done\n", " echo $COUCHBASE_SERVER_IP\n", "coreos:\n", " etcd:\n", " discovery: ", { "Ref": "DiscoveryURL" }, "\n", " addr: $", { "Ref": "AdvertisedIPAddress" }, "_ipv4:4001\n", " peer-addr: $", { "Ref": "AdvertisedIPAddress" }, "_ipv4:7001\n", " units:\n", " - name: etcd.service\n", " command: start\n", " - name: fleet.service\n", " command: start\n", " - name: docker.service\n", " command: restart\n" ] ] } } } } } }
{ "pile_set_name": "Github" }
{{template "Public/header.html" .}} <script language="javascript" src="/public/js/Content/focus.js"></script> <body> <div class="subnav"> <div class="content-menu ib-a blue line-x"> <a href='/Focus/'><em>{{msg . "focus_list"}}</em></a><span>|</span><a href='javascript:;' class="on"><em>{{msg . "focus_add"}}</em></a> </div> </div> <div class="pad_10"> <div class="common-form"> <form name="myform" enctype="multipart/form-data" onsubmit="return form_submit()" action="/Focus/add/" method="post" id="myform"> <table width="100%" class="table_form contentWrap"> <tr> <td><strong>{{msg . "focus_cate"}}:</strong></td> <td> <select id="cid" name="cid"> <option value="">{{msg . "focus_select"}}</option> {{range .Cate_list}} <option value="{{.Id}}">{{.Name}}</option> {{end}} </select> <div id="cidTip" class=""></div> </td> </tr> <tr> <td width="80"><strong>{{msg . "focus_title"}}:</strong></td> <td> <input type="text" name="title" id="title" size="60px" class="input-text"></input> <div id="titleTip" class=""></div> </td> </tr> <tr> <td><strong>{{msg . "focus_url"}}:</strong></td> <td> <input type="text" name="url" id="url" size="60px" class="input-text"></input> <div id="urlTip" class=""></div> </td> </tr> <tr> <td><strong>{{msg . "focus_img"}}:</strong></td> <td> <input type="file" name="img" id="img" size="60px" class="input-text"></input> <div id="imgTip" class=""></div> </td> </tr> <tr> <td><strong>{{msg . "focus_order"}}:</strong></td> <td><input type="text" name="order" id="order" onafterpaste="this.value=this.value.replace(/\D/g,'')" onkeyup="this.value=this.value.replace(/\D/g,'')" value="" size="8" class="input-text" id="email" size="30"></input></td> </tr> <tr> <td><strong>{{msg . "focus_content"}}:</strong></td> <td> <textarea style="width: 50%; height: 70px;" id="content" name="content"></textarea> <div id="contentTip" class=""></div> </td> </tr> <tr> <td><strong>{{msg . "focus_status"}}:</strong></td> <td><input type="radio" value="1" name="status">&nbsp;{{msg . "focus_checked"}}&nbsp;&nbsp;&nbsp; <input type="radio" checked="checked" value="0" name="status">&nbsp;{{msg . "focus_nocheck"}}&nbsp;&nbsp;&nbsp;</td> </tr> </table> <div class="bk15"></div> <input type="hidden" name="csrf_token" value="{{ .csrf_token }}" /> <input name="dosubmit" type="submit" value="{{msg . "submit"}}" class="button"> </form> </div> </div> </body> {{template "Public/footer.html" .}}
{ "pile_set_name": "Github" }
<!DOCTYPE html> <html> <body> <div>This text should appear</div> </body> </html>
{ "pile_set_name": "Github" }
apiVersion: v1 kind: Service metadata: name: dm-master labels: app: dm-master spec: ports: - name: dm-master port: 8261 targetPort: 8261 - name: dm-master-peer port: 8291 targetPort: 8291 selector: app: dm-master --- apiVersion: apps/v1 kind: StatefulSet metadata: name: dm-master labels: app: dm-master spec: selector: matchLabels: app: dm-master serviceName: dm-master replicas: 3 # TODO: 1 for debug; 3 DM-master instances podManagementPolicy: Parallel template: metadata: labels: app: dm-master spec: containers: - name: dm-master image: dm:chaos # build this image in GitHub action workflow imagePullPolicy: IfNotPresent volumeMounts: - mountPath: /data name: dm-master env: - name: MY_POD_NAME valueFrom: fieldRef: fieldPath: metadata.name - name: MY_POD_NAMESPACE valueFrom: fieldRef: fieldPath: metadata.namespace ports: - containerPort: 8261 name: dm-master - containerPort: 8291 name: dm-master-peer command: - "/dm-master" - "--data-dir=/data" - "--name=$(MY_POD_NAME)" - "--master-addr=0.0.0.0:8261" - "--advertise-addr=http://$(MY_POD_NAME).dm-master.$(MY_POD_NAMESPACE):8261" - "--peer-urls=:8291" - "--advertise-peer-urls=http://$(MY_POD_NAME).dm-master.$(MY_POD_NAMESPACE):8291" - "--initial-cluster=dm-master-0=http://dm-master-0.dm-master.$(MY_POD_NAMESPACE):8291,dm-master-1=http://dm-master-1.dm-master.$(MY_POD_NAMESPACE):8291,dm-master-2=http://dm-master-2.dm-master.$(MY_POD_NAMESPACE):8291" volumeClaimTemplates: - metadata: name: dm-master spec: accessModes: - ReadWriteOnce resources: requests: storage: 1Gi
{ "pile_set_name": "Github" }
/* Given a 2D board and a word, find if the word exists in the grid. The word can be constructed from letters of sequentially adjacent cell, where "adjacent" cells are those horizontally or vertically neighboring. The same letter cell may not be used more than once. For example, Given board = [ ['A','B','C','E'], ['S','F','C','S'], ['A','D','E','E'] ] word = "ABCCED", -> returns true, word = "SEE", -> returns true, word = "ABCB", -> returns false. */ class Solution { public: bool safe(vector<vector<char>>& board,vector<vector<bool>>& visited,int i,int j,char next,int f){ if(i>=0 && i<board.size() && j>=0 && j<board[0].size() && board[i][j]==next && visited[i][j]==false && f==0){ return true; } return false; } bool existUtil(vector<vector<char>>& board,vector<vector<bool>>& visited,int i,int j,int k,string word,int &f){ if(k==word.length()-1){ f=1; return true; } visited[i][j]=true; k=k+1; if(safe(board,visited,i+1,j,word[k],f)){ existUtil(board,visited,i+1,j,k,word,f); } if(safe(board,visited,i-1,j,word[k],f)){ existUtil(board,visited,i-1,j,k,word,f); } if(safe(board,visited,i,j+1,word[k],f)){ existUtil(board,visited,i,j+1,k,word,f); } if(safe(board,visited,i,j-1,word[k],f)){ existUtil(board,visited,i,j-1,k,word,f); } if(f==1){ return true; } visited[i][j]=false; k=k-1; return false; } bool exist(vector<vector<char>>& board, string word) { vector<vector<bool>> visited; for(int i=0;i<board.size();i++){ vector<bool> a; for(int j=0;j<board[i].size();j++){ a.push_back(false); } visited.push_back(a); } if(word.length()==0){ return true; } for(int i=0;i<board.size();i++){ for(int j=0;j<board[i].size();j++){ int k=0; int f=0; if(board[i][j]==word[0]){ existUtil(board,visited,i,j,k,word,f); if(f==1){ return true; } } } } return false; } };
{ "pile_set_name": "Github" }
<?php declare(strict_types=1); namespace Shopware\Core\System\Snippet; interface SnippetValidatorInterface { public function validate(): array; }
{ "pile_set_name": "Github" }
using System; using System.Collections.Generic; using System.Linq; using System.Text; using System.Threading.Tasks; namespace DotVVM.Samples.BasicSamples.ViewModels.ControlSamples.RadioButton { public class NullableViewModel { public enum SampleEnum { First, Second } public SampleEnum? SampleItem { get; set; } public void SetNull() => SampleItem = null; public void SetFirst() => SampleItem = SampleEnum.First; public void SetSecond() => SampleItem = SampleEnum.Second; } }
{ "pile_set_name": "Github" }
package dk.bayes.math.accuracy import org.junit._ import Assert._ import breeze.linalg.DenseVector import breeze.linalg.DenseMatrix class loglikTest { @Test def test_binary = { val predicted = DenseVector(0.6d,0.3,0.2) val actual = DenseVector(1d,0,1d) assertEquals(-2.4769,loglik(predicted,actual),0.0001) } @Test def test_multiclass_two_classes = { val predicted = DenseMatrix((0.4,0.6),(0.7,0.3),(0.8,0.2)) val actual = DenseVector(1d,0,1d) assertEquals(-2.4769,loglik(predicted,actual),0.0001) } }
{ "pile_set_name": "Github" }
using System; using System.Diagnostics; using Org.BouncyCastle.Crypto.Utilities; using Org.BouncyCastle.Utilities; namespace Org.BouncyCastle.Crypto.Digests { /// <summary> /// Implementation of Keccak based on following KeccakNISTInterface.c from http://keccak.noekeon.org/ /// </summary> /// <remarks> /// Following the naming conventions used in the C source code to enable easy review of the implementation. /// </remarks> public class KeccakDigest : IDigest, IMemoable { private static readonly ulong[] KeccakRoundConstants = KeccakInitializeRoundConstants(); private static readonly int[] KeccakRhoOffsets = KeccakInitializeRhoOffsets(); private static ulong[] KeccakInitializeRoundConstants() { ulong[] keccakRoundConstants = new ulong[24]; byte LFSRState = 0x01; for (int i = 0; i < 24; i++) { keccakRoundConstants[i] = 0; for (int j = 0; j < 7; j++) { int bitPosition = (1 << j) - 1; // LFSR86540 bool loBit = (LFSRState & 0x01) != 0; if (loBit) { keccakRoundConstants[i] ^= 1UL << bitPosition; } bool hiBit = (LFSRState & 0x80) != 0; LFSRState <<= 1; if (hiBit) { LFSRState ^= 0x71; } } } return keccakRoundConstants; } private static int[] KeccakInitializeRhoOffsets() { int[] keccakRhoOffsets = new int[25]; int x, y, t, newX, newY; int rhoOffset = 0; keccakRhoOffsets[0] = rhoOffset; x = 1; y = 0; for (t = 1; t < 25; t++) { rhoOffset = (rhoOffset + t) & 63; keccakRhoOffsets[(((x) % 5) + 5 * ((y) % 5))] = rhoOffset; newX = (0 * x + 1 * y) % 5; newY = (2 * x + 3 * y) % 5; x = newX; y = newY; } return keccakRhoOffsets; } private static readonly int STATE_LENGTH = (1600 / 8); private ulong[] state = new ulong[STATE_LENGTH / 8]; protected byte[] dataQueue = new byte[1536 / 8]; protected int rate; protected int bitsInQueue; protected int fixedOutputLength; protected bool squeezing; protected int bitsAvailableForSqueezing; public KeccakDigest() : this(288) { } public KeccakDigest(int bitLength) { Init(bitLength); } public KeccakDigest(KeccakDigest source) { CopyIn(source); } private void CopyIn(KeccakDigest source) { Array.Copy(source.state, 0, this.state, 0, source.state.Length); Array.Copy(source.dataQueue, 0, this.dataQueue, 0, source.dataQueue.Length); this.rate = source.rate; this.bitsInQueue = source.bitsInQueue; this.fixedOutputLength = source.fixedOutputLength; this.squeezing = source.squeezing; this.bitsAvailableForSqueezing = source.bitsAvailableForSqueezing; } public virtual string AlgorithmName { get { return "Keccak-" + fixedOutputLength; } } public virtual int GetDigestSize() { return fixedOutputLength >> 3; } public virtual void Update(byte input) { Absorb(new byte[]{ input }, 0, 1); } public virtual void BlockUpdate(byte[] input, int inOff, int len) { Absorb(input, inOff, len); } public virtual int DoFinal(byte[] output, int outOff) { Squeeze(output, outOff, fixedOutputLength >> 3); Reset(); return GetDigestSize(); } /* * TODO Possible API change to support partial-byte suffixes. */ protected virtual int DoFinal(byte[] output, int outOff, byte partialByte, int partialBits) { if (partialBits > 0) { AbsorbBits(partialByte, partialBits); } Squeeze(output, outOff, fixedOutputLength >> 3); Reset(); return GetDigestSize(); } public virtual void Reset() { Init(fixedOutputLength); } /** * Return the size of block that the compression function is applied to in bytes. * * @return internal byte length of a block. */ public virtual int GetByteLength() { return rate >> 3; } private void Init(int bitLength) { switch (bitLength) { case 128: case 224: case 256: case 288: case 384: case 512: InitSponge(1600 - (bitLength << 1)); break; default: throw new ArgumentException("must be one of 128, 224, 256, 288, 384, or 512.", "bitLength"); } } private void InitSponge(int rate) { if (rate <= 0 || rate >= 1600 || (rate & 63) != 0) throw new InvalidOperationException("invalid rate value"); this.rate = rate; Array.Clear(state, 0, state.Length); Arrays.Fill(this.dataQueue, (byte)0); this.bitsInQueue = 0; this.squeezing = false; this.bitsAvailableForSqueezing = 0; this.fixedOutputLength = (1600 - rate) >> 1; } protected void Absorb(byte[] data, int off, int len) { if ((bitsInQueue & 7) != 0) throw new InvalidOperationException("attempt to absorb with odd length queue"); if (squeezing) throw new InvalidOperationException("attempt to absorb while squeezing"); int bytesInQueue = bitsInQueue >> 3; int rateBytes = rate >> 3; int count = 0; while (count < len) { if (bytesInQueue == 0 && count <= (len - rateBytes)) { do { KeccakAbsorb(data, off + count); count += rateBytes; } while (count <= (len - rateBytes)); } else { int partialBlock = System.Math.Min(rateBytes - bytesInQueue, len - count); Array.Copy(data, off + count, dataQueue, bytesInQueue, partialBlock); bytesInQueue += partialBlock; count += partialBlock; if (bytesInQueue == rateBytes) { KeccakAbsorb(dataQueue, 0); bytesInQueue = 0; } } } bitsInQueue = bytesInQueue << 3; } protected void AbsorbBits(int data, int bits) { if (bits < 1 || bits > 7) throw new ArgumentException("must be in the range 1 to 7", "bits"); if ((bitsInQueue & 7) != 0) throw new InvalidOperationException("attempt to absorb with odd length queue"); if (squeezing) throw new InvalidOperationException("attempt to absorb while squeezing"); int mask = (1 << bits) - 1; dataQueue[bitsInQueue >> 3] = (byte)(data & mask); // NOTE: After this, bitsInQueue is no longer a multiple of 8, so no more absorbs will work bitsInQueue += bits; } private void PadAndSwitchToSqueezingPhase() { Debug.Assert(bitsInQueue < rate); dataQueue[bitsInQueue >> 3] |= (byte)(1U << (bitsInQueue & 7)); if (++bitsInQueue == rate) { KeccakAbsorb(dataQueue, 0); bitsInQueue = 0; } { int full = bitsInQueue >> 6, partial = bitsInQueue & 63; int off = 0; for (int i = 0; i < full; ++i) { state[i] ^= Pack.LE_To_UInt64(dataQueue, off); off += 8; } if (partial > 0) { ulong mask = (1UL << partial) - 1UL; state[full] ^= Pack.LE_To_UInt64(dataQueue, off) & mask; } state[(rate - 1) >> 6] ^= (1UL << 63); } KeccakPermutation(); KeccakExtract(); bitsAvailableForSqueezing = rate; bitsInQueue = 0; squeezing = true; } protected void Squeeze(byte[] output, int off, int len) { if (!squeezing) { PadAndSwitchToSqueezingPhase(); } long outputLength = (long)len << 3; long i = 0; while (i < outputLength) { if (bitsAvailableForSqueezing == 0) { KeccakPermutation(); KeccakExtract(); bitsAvailableForSqueezing = rate; } int partialBlock = (int)System.Math.Min((long)bitsAvailableForSqueezing, outputLength - i); Array.Copy(dataQueue, (rate - bitsAvailableForSqueezing) >> 3, output, off + (int)(i >> 3), partialBlock >> 3); bitsAvailableForSqueezing -= partialBlock; i += partialBlock; } } private void KeccakAbsorb(byte[] data, int off) { int count = rate >> 6; for (int i = 0; i < count; ++i) { state[i] ^= Pack.LE_To_UInt64(data, off); off += 8; } KeccakPermutation(); } private void KeccakExtract() { Pack.UInt64_To_LE(state, 0, rate >> 6, dataQueue, 0); } private void KeccakPermutation() { for (int i = 0; i < 24; i++) { Theta(state); Rho(state); Pi(state); Chi(state); Iota(state, i); } } private static ulong leftRotate(ulong v, int r) { return (v << r) | (v >> -r); } private static void Theta(ulong[] A) { ulong C0 = A[0 + 0] ^ A[0 + 5] ^ A[0 + 10] ^ A[0 + 15] ^ A[0 + 20]; ulong C1 = A[1 + 0] ^ A[1 + 5] ^ A[1 + 10] ^ A[1 + 15] ^ A[1 + 20]; ulong C2 = A[2 + 0] ^ A[2 + 5] ^ A[2 + 10] ^ A[2 + 15] ^ A[2 + 20]; ulong C3 = A[3 + 0] ^ A[3 + 5] ^ A[3 + 10] ^ A[3 + 15] ^ A[3 + 20]; ulong C4 = A[4 + 0] ^ A[4 + 5] ^ A[4 + 10] ^ A[4 + 15] ^ A[4 + 20]; ulong dX = leftRotate(C1, 1) ^ C4; A[0] ^= dX; A[5] ^= dX; A[10] ^= dX; A[15] ^= dX; A[20] ^= dX; dX = leftRotate(C2, 1) ^ C0; A[1] ^= dX; A[6] ^= dX; A[11] ^= dX; A[16] ^= dX; A[21] ^= dX; dX = leftRotate(C3, 1) ^ C1; A[2] ^= dX; A[7] ^= dX; A[12] ^= dX; A[17] ^= dX; A[22] ^= dX; dX = leftRotate(C4, 1) ^ C2; A[3] ^= dX; A[8] ^= dX; A[13] ^= dX; A[18] ^= dX; A[23] ^= dX; dX = leftRotate(C0, 1) ^ C3; A[4] ^= dX; A[9] ^= dX; A[14] ^= dX; A[19] ^= dX; A[24] ^= dX; } private static void Rho(ulong[] A) { // KeccakRhoOffsets[0] == 0 for (int x = 1; x < 25; x++) { A[x] = leftRotate(A[x], KeccakRhoOffsets[x]); } } private static void Pi(ulong[] A) { ulong a1 = A[1]; A[1] = A[6]; A[6] = A[9]; A[9] = A[22]; A[22] = A[14]; A[14] = A[20]; A[20] = A[2]; A[2] = A[12]; A[12] = A[13]; A[13] = A[19]; A[19] = A[23]; A[23] = A[15]; A[15] = A[4]; A[4] = A[24]; A[24] = A[21]; A[21] = A[8]; A[8] = A[16]; A[16] = A[5]; A[5] = A[3]; A[3] = A[18]; A[18] = A[17]; A[17] = A[11]; A[11] = A[7]; A[7] = A[10]; A[10] = a1; } private static void Chi(ulong[] A) { ulong chiC0, chiC1, chiC2, chiC3, chiC4; for (int yBy5 = 0; yBy5 < 25; yBy5 += 5) { chiC0 = A[0 + yBy5] ^ ((~A[(((0 + 1) % 5) + yBy5)]) & A[(((0 + 2) % 5) + yBy5)]); chiC1 = A[1 + yBy5] ^ ((~A[(((1 + 1) % 5) + yBy5)]) & A[(((1 + 2) % 5) + yBy5)]); chiC2 = A[2 + yBy5] ^ ((~A[(((2 + 1) % 5) + yBy5)]) & A[(((2 + 2) % 5) + yBy5)]); chiC3 = A[3 + yBy5] ^ ((~A[(((3 + 1) % 5) + yBy5)]) & A[(((3 + 2) % 5) + yBy5)]); chiC4 = A[4 + yBy5] ^ ((~A[(((4 + 1) % 5) + yBy5)]) & A[(((4 + 2) % 5) + yBy5)]); A[0 + yBy5] = chiC0; A[1 + yBy5] = chiC1; A[2 + yBy5] = chiC2; A[3 + yBy5] = chiC3; A[4 + yBy5] = chiC4; } } private static void Iota(ulong[] A, int indexRound) { A[0] ^= KeccakRoundConstants[indexRound]; } public virtual IMemoable Copy() { return new KeccakDigest(this); } public virtual void Reset(IMemoable other) { CopyIn((KeccakDigest)other); } } }
{ "pile_set_name": "Github" }
File: kt19679.kt - 0e1526bdde83e0ccfefb0f6068ba6075 packageHeader importList topLevelObject declaration functionDeclaration modifiers modifier functionModifier INLINE("inline") FUN("fun") simpleIdentifier Identifier("test") functionValueParameters LPAREN("(") functionValueParameter parameter simpleIdentifier Identifier("s") COLON(":") type functionType functionTypeParameters LPAREN("(") RPAREN(")") ARROW("->") type typeReference userType simpleUserType simpleIdentifier Identifier("Unit") COMMA(",") functionValueParameter parameter simpleIdentifier Identifier("p") COLON(":") type nullableType parenthesizedType LPAREN("(") type functionType functionTypeParameters LPAREN("(") RPAREN(")") ARROW("->") type typeReference userType simpleUserType simpleIdentifier Identifier("Unit") RPAREN(")") quest QUEST_NO_WS("?") RPAREN(")") functionBody block LCURL("{") NL("\n") statements statement expression disjunction conjunction equality comparison genericCallLikeComparison infixOperation elvisExpression infixFunctionCall rangeExpression additiveExpression multiplicativeExpression asExpression prefixUnaryExpression postfixUnaryExpression primaryExpression simpleIdentifier Identifier("s") callSuffix valueArguments LPAREN("(") RPAREN(")") semis NL("\n") statement expression disjunction conjunction equality comparison genericCallLikeComparison infixOperation elvisExpression infixFunctionCall rangeExpression additiveExpression multiplicativeExpression asExpression prefixUnaryExpression postfixUnaryExpression primaryExpression simpleIdentifier Identifier("p") postfixUnarySuffix navigationSuffix memberAccessOperator safeNav QUEST_NO_WS("?") DOT(".") simpleIdentifier Identifier("invoke") postfixUnarySuffix callSuffix valueArguments LPAREN("(") RPAREN(")") semis NL("\n") RCURL("}") semis EOF("<EOF>") EOF("<EOF>")
{ "pile_set_name": "Github" }
<?xml version='1.0' encoding='utf-8'?> <SettingsFile xmlns="http://schemas.microsoft.com/VisualStudio/2004/01/settings" CurrentProfile="(Default)" GeneratedClassNamespace="text_bf.Properties" GeneratedClassName="Settings"> <Profiles /> <Settings> <Setting Name="PluginName" Type="System.String" Scope="Application"> <Value Profile="(Default)">BF</Value> </Setting> <Setting Name="SortEntries" Type="System.Boolean" Scope="User"> <Value Profile="(Default)">False</Value> </Setting> </Settings> </SettingsFile>
{ "pile_set_name": "Github" }
/* * Copyright 2016-2018 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * 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.creactiviti.piper.config; import org.springframework.boot.autoconfigure.jackson.Jackson2ObjectMapperBuilderCustomizer; import org.springframework.context.annotation.Configuration; import org.springframework.http.converter.json.Jackson2ObjectMapperBuilder; @Configuration public class JsonConfiguration implements Jackson2ObjectMapperBuilderCustomizer { @Override public void customize(Jackson2ObjectMapperBuilder aJacksonObjectMapperBuilder) { //aJacksonObjectMapperBuilder.serializerByType(Throwable.class, new ExceptionSerializer()); //aJacksonObjectMapperBuilder.deserializerByType(JobTaskException.class, new JobTaskExceptionDeserializer()); } }
{ "pile_set_name": "Github" }
/* * Copyright 1999 Sun Microsystems, Inc. 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. Sun designates this * particular file as subject to the "Classpath" exception as provided * by Sun 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 Sun Microsystems, Inc., 4150 Network Circle, Santa Clara, * CA 95054 USA or visit www.sun.com if you need additional information or * have any questions. */ package javax.naming; /** * This class represents the string form of the address of * a communications end-point. * It consists of a type that describes the communication mechanism * and a string contents specific to that communication mechanism. * The format and interpretation of * the address type and the contents of the address are based on * the agreement of three parties: the client that uses the address, * the object/server that can be reached using the address, and the * administrator or program that creates the address. * * <p> An example of a string reference address is a host name. * Another example of a string reference address is a URL. * * <p> A string reference address is immutable: * once created, it cannot be changed. Multithreaded access to * a single StringRefAddr need not be synchronized. * * @author Rosanna Lee * @author Scott Seligman * * @see RefAddr * @see BinaryRefAddr * @since 1.3 */ public class StringRefAddr extends RefAddr { /** * Contains the contents of this address. * Can be null. * @serial */ private String contents; /** * Constructs a new instance of StringRefAddr using its address type * and contents. * * @param addrType A non-null string describing the type of the address. * @param addr The possibly null contents of the address in the form of a string. */ public StringRefAddr(String addrType, String addr) { super(addrType); contents = addr; } /** * Retrieves the contents of this address. The result is a string. * * @return The possibly null address contents. */ public Object getContent() { return contents; } /** * Use serialVersionUID from JNDI 1.1.1 for interoperability */ private static final long serialVersionUID = -8913762495138505527L; }
{ "pile_set_name": "Github" }
// Copyright Joyent, Inc. and other Node contributors. // // 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. 'use strict'; const common = require('../common'); if (common.isOSX) common.skip('because of 17894467 Apple bug'); const assert = require('assert'); const dgram = require('dgram'); const client = dgram.createSocket('udp4'); client.bind(0, common.mustCall(function() { const port = this.address().port; client.on('message', common.mustCall(function onMessage(buffer) { assert.strictEqual(buffer.length, 0); clearInterval(interval); client.close(); })); const buf = Buffer.alloc(0); const interval = setInterval(function() { client.send(buf, 0, 0, port, '127.0.0.1', common.mustCall()); }, 10); }));
{ "pile_set_name": "Github" }
package org.fluxtream.connectors.beddit; import org.scribe.builder.api.DefaultApi20; import org.scribe.extractors.AccessTokenExtractor; import org.scribe.extractors.JsonTokenExtractor; import org.scribe.model.OAuthConfig; import org.scribe.model.Verb; import org.scribe.utils.OAuthEncoder; /** * Created by candide on 09/02/15. */ public class BedditApi extends DefaultApi20 { public BedditApi() {} public String getAuthorizationUrl(OAuthConfig config) { return String.format("https://cloudapi.beddit.com/api/v1/auth/authorize_web?client_id=%s&response_type=code&redirect_uri=%s", new Object[]{config.getApiKey(), OAuthEncoder.encode(config.getCallback()) } ); } public String getAccessTokenEndpoint() { return "https://cloudapi.beddit.com/api/v1/auth/authorize?grant_type=authorization_code"; } public Verb getAccessTokenVerb() { return Verb.POST; } public AccessTokenExtractor getAccessTokenExtractor() { return new JsonTokenExtractor(); } }
{ "pile_set_name": "Github" }
########################################################################## # # pgAdmin 4 - PostgreSQL Tools # # Copyright (C) 2013 - 2020, The pgAdmin Development Team # This software is released under the PostgreSQL Licence # ########################################################################## import sys import traceback from urllib.parse import urlencode from regression.python_test_utils import test_utils as utils import os import json # Load test data from json file. CURRENT_PATH = os.path.dirname(os.path.realpath(__file__)) with open(CURRENT_PATH + "/index_constraint_test_data.json") as data_file: test_cases = json.load(data_file) # api method call def api_create(self): return self.tester.post("{0}{1}/{2}/{3}/{4}/{5}/". format(self.url, utils.SERVER_GROUP, self.server_id, self.db_id, self.schema_id, self.table_id), data=json.dumps(self.data), content_type='html/json' ) def api_delete(self, index_constraint_id=None): if index_constraint_id is None: index_constraint_id = self.index_constraint_id return self.tester.delete("{0}{1}/{2}/{3}/{4}/{5}/{6}". format(self.url, utils.SERVER_GROUP, self.server_id, self.db_id, self.schema_id, self.table_id, index_constraint_id), data=json.dumps(self.data), follow_redirects=True ) def api_get(self, index_constraint_id=None): if index_constraint_id is None: index_constraint_id = self.index_constraint_id return self.tester.get("{0}{1}/{2}/{3}/{4}/{5}/{6}". format(self.url, utils.SERVER_GROUP, self.server_id, self.db_id, self.schema_id, self.table_id, index_constraint_id), data=json.dumps(self.data), follow_redirects=True ) def api_get_msql(self, url_encode_data): return self.tester.get("{0}{1}/{2}/{3}/{4}/{5}/{6}?{7}". format(self.url, utils.SERVER_GROUP, self.server_id, self.db_id, self.schema_id, self.table_id, self.index_constraint_id, urlencode(url_encode_data)), data=json.dumps(self.data), follow_redirects=True ) def api_put(self): return self.tester.put("{0}{1}/{2}/{3}/{4}/{5}/{6}". format(self.url, utils.SERVER_GROUP, self.server_id, self.db_id, self.schema_id, self.table_id, self.index_constraint_id ), data=json.dumps(self.data), follow_redirects=True ) def create_index_constraint(server, db_name, schema_name, table_name, key_name, key_type): """ This function creates a index constraint(PK or UK) under provided table. :param server: server details :type server: dict :param db_name: database name :type db_name: str :param schema_name: schema name :type schema_name: str :param table_name: table name :type table_name: str :param key_name: test name for primary or unique key :type key_name: str :param key_type: key type i.e. primary or unique key :type key_type: str :return oid: key constraint id :rtype: int """ try: connection = utils.get_db_connection(db_name, server['username'], server['db_password'], server['host'], server['port'], server['sslmode']) old_isolation_level = connection.isolation_level connection.set_isolation_level(0) pg_cursor = connection.cursor() query = "ALTER TABLE %s.%s ADD CONSTRAINT %s %s (id)" % \ (schema_name, table_name, key_name, key_type) pg_cursor.execute(query) connection.set_isolation_level(old_isolation_level) connection.commit() # Get oid of newly added index constraint pg_cursor.execute( "SELECT conindid FROM pg_constraint where conname='%s'" % key_name) index_constraint = pg_cursor.fetchone() connection.close() oid = index_constraint[0] return oid except Exception: traceback.print_exc(file=sys.stderr) def verify_index_constraint(server, db_name, constraint_name): """ This function verifies that index constraint(PK or UK) is exists or not. :param constraint_name: :param server: server details :type server: dict :param db_name: database name :type db_name: str :return index_constraint: index constraint record from database :rtype: tuple """ try: connection = utils.get_db_connection(db_name, server['username'], server['db_password'], server['host'], server['port'], server['sslmode']) pg_cursor = connection.cursor() pg_cursor.execute( "SELECT oid FROM pg_constraint where conname='%s'" % constraint_name) index_constraint = pg_cursor.fetchone() connection.close() return index_constraint except Exception: traceback.print_exc(file=sys.stderr) def create_unique_index(server, db_name, schema_name, table_name, index_name, column_name): """ This function creates a unique index for provided table. :param server: server details :type server: dict :param db_name: database name :type db_name: str :param schema_name: schema name :type schema_name: str :param table_name: table name :type table_name: str :param index_name: index name :type index_name: str :param column_name: column on which index to be created :type column_name: str """ try: connection = utils.get_db_connection(db_name, server['username'], server['db_password'], server['host'], server['port'], server['sslmode']) old_isolation_level = connection.isolation_level connection.set_isolation_level(0) pg_cursor = connection.cursor() query = "CREATE UNIQUE INDEX CONCURRENTLY %s ON %s.%s (%s)" % \ (index_name, schema_name, table_name, column_name) pg_cursor.execute(query) connection.set_isolation_level(old_isolation_level) connection.commit() connection.close() except Exception: traceback.print_exc(file=sys.stderr)
{ "pile_set_name": "Github" }
import Prelude extension ShippingRulesEnvelope { public enum lens { public static let shippingRules = Lens<ShippingRulesEnvelope, [ShippingRule]>( view: { $0.shippingRules }, set: { shippingRules, _ in .init(shippingRules: shippingRules) } ) } }
{ "pile_set_name": "Github" }
// Copyright (c) 1998-1999 Matra Datavision // Copyright (c) 1999-2014 OPEN CASCADE SAS // // This file is part of Open CASCADE Technology software library. // // This library is free software; you can redistribute it and/or modify it under // the terms of the GNU Lesser General Public License version 2.1 as published // by the Free Software Foundation, with special exception defined in the file // OCCT_LGPL_EXCEPTION.txt. Consult the file LICENSE_LGPL_21.txt included in OCCT // distribution for complete text of the license and disclaimer of any warranty. // // Alternatively, this file may be used under the terms of Open CASCADE // commercial license or contractual agreement. #ifndef TColStd_DataMapOfTransientTransient_HeaderFile #define TColStd_DataMapOfTransientTransient_HeaderFile #include <Standard_Transient.hxx> #include <Standard_Transient.hxx> #include <TColStd_MapTransientHasher.hxx> #include <NCollection_DataMap.hxx> typedef NCollection_DataMap<Handle(Standard_Transient),Handle(Standard_Transient),TColStd_MapTransientHasher> TColStd_DataMapOfTransientTransient; typedef NCollection_DataMap<Handle(Standard_Transient),Handle(Standard_Transient),TColStd_MapTransientHasher>::Iterator TColStd_DataMapIteratorOfDataMapOfTransientTransient; #endif
{ "pile_set_name": "Github" }
module Listen VERSION = '1.1.6' end
{ "pile_set_name": "Github" }
/* * Taken from kernel for decoupling from <asm/page.h>. --zaitcev * * $Id: pgtsrmmu.h,v 1.2 1999/04/19 01:04:31 zaitcev Exp $ * pgtsrmmu.h: SRMMU page table defines and code. * * Copyright (C) 1995 David S. Miller (davem@caip.rutgers.edu) */ #ifndef _PGTSRMMU_H #define _PGTSRMMU_H /* PMD_SHIFT determines the size of the area a second-level page table can map */ #define SRMMU_PMD_SHIFT 18 #define SRMMU_PMD_SIZE (1UL << SRMMU_PMD_SHIFT) #define SRMMU_PMD_MASK (~(SRMMU_PMD_SIZE-1)) #define SRMMU_PMD_ALIGN(addr) (((addr)+SRMMU_PMD_SIZE-1)&SRMMU_PMD_MASK) /* PGDIR_SHIFT determines what a third-level page table entry can map */ #define SRMMU_PGDIR_SHIFT 24 #define SRMMU_PGDIR_SIZE (1UL << SRMMU_PGDIR_SHIFT) #define SRMMU_PGDIR_MASK (~(SRMMU_PGDIR_SIZE-1)) #define SRMMU_PGDIR_ALIGN(addr) (((addr)+SRMMU_PGDIR_SIZE-1)&SRMMU_PGDIR_MASK) #define SRMMU_PTRS_PER_PTE 64 #define SRMMU_PTRS_PER_PMD 64 #define SRMMU_PTRS_PER_PGD 256 #define SRMMU_PTE_TABLE_SIZE 0x100 /* 64 entries, 4 bytes a piece */ #define SRMMU_PMD_TABLE_SIZE 0x100 /* 64 entries, 4 bytes a piece */ #define SRMMU_PGD_TABLE_SIZE 0x400 /* 256 entries, 4 bytes a piece */ #define SRMMU_VMALLOC_START (0xfe300000) #define SRMMU_VMALLOC_END ~0x0UL /* Definition of the values in the ET field of PTD's and PTE's */ #define SRMMU_ET_MASK 0x3 #define SRMMU_ET_INVALID 0x0 #define SRMMU_ET_PTD 0x1 #define SRMMU_ET_PTE 0x2 #define SRMMU_ET_REPTE 0x3 /* AIEEE, SuperSparc II reverse endian page! */ /* Physical page extraction from PTP's and PTE's. */ #define SRMMU_CTX_PMASK 0xfffffff0 #define SRMMU_PTD_PMASK 0xfffffff0 #define SRMMU_PTE_PMASK 0xffffff00 /* The pte non-page bits. Some notes: * 1) cache, dirty, valid, and ref are frobbable * for both supervisor and user pages. * 2) exec and write will only give the desired effect * on user pages * 3) use priv and priv_readonly for changing the * characteristics of supervisor ptes */ #define SRMMU_CACHE 0x80 #define SRMMU_DIRTY 0x40 #define SRMMU_REF 0x20 #define SRMMU_EXEC 0x08 #define SRMMU_WRITE 0x04 #define SRMMU_VALID 0x02 /* SRMMU_ET_PTE */ #define SRMMU_PRIV 0x1c #define SRMMU_PRIV_RDONLY 0x18 #define SRMMU_CHG_MASK (0xffffff00 | SRMMU_REF | SRMMU_DIRTY) /* SRMMU Register addresses in ASI 0x4. These are valid for all * current SRMMU implementations that exist. */ #define SRMMU_CTRL_REG 0x00000000 #define SRMMU_CTXTBL_PTR 0x00000100 #define SRMMU_CTX_REG 0x00000200 #define SRMMU_FAULT_STATUS 0x00000300 #define SRMMU_FAULT_ADDR 0x00000400 #ifndef __ASSEMBLY__ /* Accessing the MMU control register. */ static __inline__ unsigned int srmmu_get_mmureg(void) { unsigned int retval; __asm__ __volatile__("lda [%%g0] %1, %0\n\t" : "=r" (retval) : "i" (ASI_M_MMUREGS)); return retval; } static __inline__ void srmmu_set_mmureg(unsigned long regval) { __asm__ __volatile__("sta %0, [%%g0] %1\n\t" : : "r" (regval), "i" (ASI_M_MMUREGS) : "memory"); } static __inline__ void srmmu_set_ctable_ptr(unsigned long paddr) { paddr = ((paddr >> 4) & SRMMU_CTX_PMASK); __asm__ __volatile__("sta %0, [%1] %2\n\t" : : "r" (paddr), "r" (SRMMU_CTXTBL_PTR), "i" (ASI_M_MMUREGS) : "memory"); } static __inline__ unsigned long srmmu_get_ctable_ptr(void) { unsigned int retval; __asm__ __volatile__("lda [%1] %2, %0\n\t" : "=r" (retval) : "r" (SRMMU_CTXTBL_PTR), "i" (ASI_M_MMUREGS)); return (retval & SRMMU_CTX_PMASK) << 4; } static __inline__ void srmmu_set_context(int context) { __asm__ __volatile__("sta %0, [%1] %2\n\t" : : "r" (context), "r" (SRMMU_CTX_REG), "i" (ASI_M_MMUREGS) : "memory"); } static __inline__ int srmmu_get_context(void) { register int retval; __asm__ __volatile__("lda [%1] %2, %0\n\t" : "=r" (retval) : "r" (SRMMU_CTX_REG), "i" (ASI_M_MMUREGS)); return retval; } static __inline__ unsigned int srmmu_get_fstatus(void) { unsigned int retval; __asm__ __volatile__("lda [%1] %2, %0\n\t" : "=r" (retval) : "r" (SRMMU_FAULT_STATUS), "i" (ASI_M_MMUREGS)); return retval; } static __inline__ unsigned int srmmu_get_faddr(void) { unsigned int retval; __asm__ __volatile__("lda [%1] %2, %0\n\t" : "=r" (retval) : "r" (SRMMU_FAULT_ADDR), "i" (ASI_M_MMUREGS)); return retval; } /* This is guaranteed on all SRMMU's. */ static __inline__ void srmmu_flush_whole_tlb(void) { __asm__ __volatile__("sta %%g0, [%0] %1\n\t": : "r" (0x400), /* Flush entire TLB!! */ "i" (ASI_M_FLUSH_PROBE) : "memory"); } /* These flush types are not available on all chips... */ static __inline__ void srmmu_flush_tlb_ctx(void) { __asm__ __volatile__("sta %%g0, [%0] %1\n\t": : "r" (0x300), /* Flush TLB ctx.. */ "i" (ASI_M_FLUSH_PROBE) : "memory"); } static __inline__ void srmmu_flush_tlb_region(unsigned long addr) { addr &= SRMMU_PGDIR_MASK; __asm__ __volatile__("sta %%g0, [%0] %1\n\t": : "r" (addr | 0x200), /* Flush TLB region.. */ "i" (ASI_M_FLUSH_PROBE) : "memory"); } static __inline__ void srmmu_flush_tlb_segment(unsigned long addr) { addr &= SRMMU_PMD_MASK; __asm__ __volatile__("sta %%g0, [%0] %1\n\t": : "r" (addr | 0x100), /* Flush TLB segment.. */ "i" (ASI_M_FLUSH_PROBE) : "memory"); } static __inline__ void srmmu_flush_tlb_page(unsigned long page) { page &= PAGE_MASK; __asm__ __volatile__("sta %%g0, [%0] %1\n\t": : "r" (page), /* Flush TLB page.. */ "i" (ASI_M_FLUSH_PROBE) : "memory"); } static __inline__ unsigned long srmmu_hwprobe(unsigned long vaddr) { unsigned long retval; vaddr &= PAGE_MASK; __asm__ __volatile__("lda [%1] %2, %0\n\t" : "=r" (retval) : "r" (vaddr | 0x400), "i" (ASI_M_FLUSH_PROBE)); return retval; } static __inline__ int srmmu_get_pte (unsigned long addr) { register unsigned long entry; __asm__ __volatile__("\n\tlda [%1] %2,%0\n\t" : "=r" (entry): "r" ((addr & 0xfffff000) | 0x400), "i" (ASI_M_FLUSH_PROBE)); return entry; } #endif /* !(__ASSEMBLY__) */ #endif /* !(_SPARC_PGTSRMMU_H) */
{ "pile_set_name": "Github" }