text
stringlengths 2
100k
| meta
dict |
---|---|
Appium iOS Inspector
====================
[](#Inspector Screenshot)
The tool for iOS elements location. It is based on the original source of [Selendroid Inspector](https://github.com/selendroid/selendroid)
[Here](http://appium.io) you can find more information about Appium automation tool.
Usage
-----
Execute your iOS test using [Appium](http://appium.io) (by default it is expected to listen on http://localhost:4723) and set a breakpoint where you want to investigate the UI tree. Open/refresh `iOS Inspector.html` web page in your favourite web browser, wait for a while until the data is loaded and you are ready to go. The inspector currently supports showing of element attributes, element location by XPath, dynamic setting of retina scale factor and, naturally, two-way visual elements location using the screenshot and the UI tree.
Note: The Accessibility Id property can be presented as @name attribute in XPath expressions.
Customizations
--------------
Change the default Appium server address using query parameter `port` e.g.
```<path to Appium-iOS-Inspector>/iOS Inspector.html?host=127.0.0.1&port=1234```
Change the default session index (zero) by proving the `sessionIndex` query parameter. Negative indexes are also supported, for example, in order to inspect the most recent running session you might type:
```iOS Inspector.html?sessionIndex=-1```
Known Issues
------------
If the inspector fails to load the page source even though Appium session is running on localhost and you observe a CORS error in the browser console then try to run the appium with `--allow-cors` argument (supported since version 1.10.0). Also in Chrome it might be happening because of the known [bug](https://bugs.chromium.org/p/chromium/issues/detail?id=67743). Visit the issue link to get more information on possible workarounds.
License
-------
[The Apache Software License, Version 2.0](http://www.apache.org/licenses/LICENSE-2.0)
|
{
"pile_set_name": "Github"
}
|
<?php
/*
* Copyright 2014 Google Inc.
*
* Licensed under the Apache License, Version 2.0 (the "License"); you may not
* use this file except in compliance with the License. You may obtain a copy of
* the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
* WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
* License for the specific language governing permissions and limitations under
* the License.
*/
/**
* The "orderDocuments" collection of methods.
* Typical usage is:
* <code>
* $dfareportingService = new Google_Service_Dfareporting(...);
* $orderDocuments = $dfareportingService->orderDocuments;
* </code>
*/
class Google_Service_Dfareporting_Resource_OrderDocuments extends Google_Service_Resource
{
/**
* Gets one order document by ID. (orderDocuments.get)
*
* @param string $profileId User profile ID associated with this request.
* @param string $projectId Project ID for order documents.
* @param string $id Order document ID.
* @param array $optParams Optional parameters.
* @return Google_Service_Dfareporting_OrderDocument
*/
public function get($profileId, $projectId, $id, $optParams = array())
{
$params = array('profileId' => $profileId, 'projectId' => $projectId, 'id' => $id);
$params = array_merge($params, $optParams);
return $this->call('get', array($params), "Google_Service_Dfareporting_OrderDocument");
}
/**
* Retrieves a list of order documents, possibly filtered. This method supports
* paging. (orderDocuments.listOrderDocuments)
*
* @param string $profileId User profile ID associated with this request.
* @param string $projectId Project ID for order documents.
* @param array $optParams Optional parameters.
*
* @opt_param string sortField Field by which to sort the list.
* @opt_param string sortOrder Order of sorted results.
* @opt_param string pageToken Value of the nextPageToken from the previous
* result page.
* @opt_param string ids Select only order documents with these IDs.
* @opt_param string siteId Select only order documents that are associated with
* these sites.
* @opt_param string searchString Allows searching for order documents by name
* or ID. Wildcards (*) are allowed. For example, "orderdocument*2015" will
* return order documents with names like "orderdocument June 2015",
* "orderdocument April 2015", or simply "orderdocument 2015". Most of the
* searches also add wildcards implicitly at the start and the end of the search
* string. For example, a search string of "orderdocument" will match order
* documents with name "my orderdocument", "orderdocument 2015", or simply
* "orderdocument".
* @opt_param int maxResults Maximum number of results to return.
* @opt_param bool approved Select only order documents that have been approved
* by at least one user.
* @opt_param string orderId Select only order documents for specified orders.
* @return Google_Service_Dfareporting_OrderDocumentsListResponse
*/
public function listOrderDocuments($profileId, $projectId, $optParams = array())
{
$params = array('profileId' => $profileId, 'projectId' => $projectId);
$params = array_merge($params, $optParams);
return $this->call('list', array($params), "Google_Service_Dfareporting_OrderDocumentsListResponse");
}
}
|
{
"pile_set_name": "Github"
}
|
/**
* Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
* SPDX-License-Identifier: Apache-2.0.
*/
#include <aws/codepipeline/model/ApprovalStatus.h>
#include <aws/core/utils/HashingUtils.h>
#include <aws/core/Globals.h>
#include <aws/core/utils/EnumParseOverflowContainer.h>
using namespace Aws::Utils;
namespace Aws
{
namespace CodePipeline
{
namespace Model
{
namespace ApprovalStatusMapper
{
static const int Approved_HASH = HashingUtils::HashString("Approved");
static const int Rejected_HASH = HashingUtils::HashString("Rejected");
ApprovalStatus GetApprovalStatusForName(const Aws::String& name)
{
int hashCode = HashingUtils::HashString(name.c_str());
if (hashCode == Approved_HASH)
{
return ApprovalStatus::Approved;
}
else if (hashCode == Rejected_HASH)
{
return ApprovalStatus::Rejected;
}
EnumParseOverflowContainer* overflowContainer = Aws::GetEnumOverflowContainer();
if(overflowContainer)
{
overflowContainer->StoreOverflow(hashCode, name);
return static_cast<ApprovalStatus>(hashCode);
}
return ApprovalStatus::NOT_SET;
}
Aws::String GetNameForApprovalStatus(ApprovalStatus enumValue)
{
switch(enumValue)
{
case ApprovalStatus::Approved:
return "Approved";
case ApprovalStatus::Rejected:
return "Rejected";
default:
EnumParseOverflowContainer* overflowContainer = Aws::GetEnumOverflowContainer();
if(overflowContainer)
{
return overflowContainer->RetrieveOverflow(static_cast<int>(enumValue));
}
return {};
}
}
} // namespace ApprovalStatusMapper
} // namespace Model
} // namespace CodePipeline
} // namespace Aws
|
{
"pile_set_name": "Github"
}
|
-- walhook.test
--
-- execsql { CREATE TABLE t2(a, b) }
CREATE TABLE t2(a, b)
|
{
"pile_set_name": "Github"
}
|
@@
identifier x;
@@
- int
+ float
foo(int x) {
...
}
|
{
"pile_set_name": "Github"
}
|
/**
* Copyright (c) 2009--2010 Red Hat, Inc.
*
* This software is licensed to you under the GNU General Public License,
* version 2 (GPLv2). There is NO WARRANTY for this software, express or
* implied, including the implied warranties of MERCHANTABILITY or FITNESS
* FOR A PARTICULAR PURPOSE. You should have received a copy of GPLv2
* along with this software; if not, see
* http://www.gnu.org/licenses/old-licenses/gpl-2.0.txt.
*
* Red Hat trademarks are not licensed under GPLv2. No permission is
* granted to use or replicate Red Hat trademarks that are incorporated
* in this software or its documentation.
*/
package com.redhat.rhn.frontend.action.configuration.sdc.test;
import com.redhat.rhn.domain.config.ConfigChannel;
import com.redhat.rhn.domain.server.Server;
import com.redhat.rhn.domain.server.test.ServerFactoryTest;
import com.redhat.rhn.frontend.dto.ConfigChannelDto;
import com.redhat.rhn.manager.system.SystemManager;
import com.redhat.rhn.testing.ConfigTestUtils;
import com.redhat.rhn.testing.RhnMockStrutsTestCase;
/**
* ChannelListActionTest
* @version $Rev$
*/
public class ChannelListActionTest extends RhnMockStrutsTestCase {
public void testExecute() throws Exception {
//Create a config channel and a server
ConfigChannel channel = ConfigTestUtils.createConfigChannel(user.getOrg());
Server server = ServerFactoryTest.createTestServer(user, true);
//associate the two.
server.subscribeConfigChannel(channel, user);
SystemManager.storeServer(server);
setRequestPathInfo("/systems/details/configuration/ConfigChannelList");
addRequestParameter("sid", server.getId().toString());
actionPerform();
verifyPageList(ConfigChannelDto.class);
}
}
|
{
"pile_set_name": "Github"
}
|
Subject: re : deal 144932 ces - lila allen
yes . i have confirmed that fw rabalais is agent for dallas ( aka sam allen ) ,
which was put under lila allen ' s name . please change deal 144932 from sam
allen to dallas exploration .
ami
from : megan parker 03 / 23 / 2000 11 : 32 am
to : julie meyers / hou / ect @ ect
cc : ami chokshi / corp / enron @ enron
subject : re : deal 144932 ces - lila allen
i looked in global and dallas exploration is in there . can we put the deal
under dallas exploration ? that is where is it was set up at columbia . i
have a letter and the gisb contract from sam allen that we are to pay dallas
exploration .
megan
|
{
"pile_set_name": "Github"
}
|
'\"
'\" Copyright (c) 1993-1998 Lucent Technologies, Inc.
'\"
'\" See the file "license.terms" for information on usage and redistribution
'\" of this file, and for a DISCLAIMER OF ALL WARRANTIES.
'\"
.TH Itcl_InitStack 3 3.0 itcl "[incr\ Tcl] Library Procedures"
.so man.macros
.BS
'\" Note: do not modify the .SH NAME line immediately below!
.SH NAME
Itcl_InitStack, Itcl_DeleteStack, Itcl_PushStack, Itcl_PopStack, Itcl_PeekStack, Itcl_GetStackValue, Itcl_GetStackSize \- Manipulate an Itcl stack object.
.SH SYNOPSIS
.nf
\fB#include <itcl.h>\fR
int
\fBItcl_InitStack\fR(\fIstack\fR)
int
\fBItcl_DeleteStack\fR(\fIstack\fR)
int
\fBItcl_PushStack\fR(\fIcdata, stack\fR)
ClientData
\fBItcl_PopStack\fR(\fIstack\fR)
ClientData
\fBItcl_PeekStack\fR(\fIstack\fR)
ClientData
\fBItcl_GetStackValue\fR(\fIstack, pos\fR)
int
\fBItcl_GetStackSize\fR(\fIstack\fR)
.fi
.SH ARGUMENTS
.AP Itcl_Stack *stack in
Stack info structure.
.AP int pos in
position in stack order from the top.
.AP ClientData clientData in
Arbitrary one-word value to save in the stack.
.BE
.SH DESCRIPTION
.PP
\fBItcl_InitStack\fR initializes a stack structure and \fBItcl_DeleteStack\fR
deletes it. \fBItcl_PushStack\fR pushes the \fIcdata\fR value onto the stack.
\fBItcl_PopStack\fR removes and returns the top most \fIcdata\fR value.
\fBItcl_PeekStack\fR returns the top most value, but does not remove it.
\fBItcl_GetStackValue\fR gets a value at some index within the stack. Index
"0" is the first value pushed onto the stack. \fBItcl_GetStackSize\fR
returns the count of entries on the stack.
.SH KEYWORDS
stack
|
{
"pile_set_name": "Github"
}
|
{
"$schema": "http://json.schemastore.org/launchsettings.json",
"iisSettings": {
"windowsAuthentication": false,
"anonymousAuthentication": true,
"iisExpress": {
"applicationUrl": "http://localhost:23063",
"sslPort": 44355
}
},
"profiles": {
"IIS Express": {
"commandName": "IISExpress",
"launchBrowser": true,
"launchUrl": "api/values",
"environmentVariables": {
"ASPNETCORE_ENVIRONMENT": "Development"
}
},
"HouseMapAPI": {
"commandName": "Project",
"launchBrowser": true,
"launchUrl": "v2/cities/上海",
"applicationUrl": "http://localhost:5090",
"environmentVariables": {
"ASPNETCORE_ENVIRONMENT": "Development"
}
}
}
}
|
{
"pile_set_name": "Github"
}
|
package com.github.database.rider.junit5.util;
/**
* COPIED from core module to not depend on JUnit4
*/
import org.hibernate.Session;
import org.hibernate.internal.SessionImpl;
import org.junit.runner.Description;
import org.junit.runners.model.Statement;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import javax.persistence.EntityManager;
import javax.persistence.EntityManagerFactory;
import javax.persistence.EntityTransaction;
import javax.persistence.Persistence;
import java.sql.Connection;
import java.util.Map;
import java.util.concurrent.ConcurrentHashMap;
import static com.github.database.rider.core.util.ClassUtils.isOnClasspath;
public class EntityManagerProvider {
private static Map<String, EntityManagerProvider> providers = new ConcurrentHashMap<>();//one emf per unit
private EntityManagerFactory emf;
private EntityManager em;
private EntityTransaction tx;
private Connection conn;
private static PropertyResolutionUtil propertyResolutionUtil = new PropertyResolutionUtil();
private static Map<String, String> overridingProperties;
private static EntityManagerProvider instance;
private static Logger log = LoggerFactory.getLogger(EntityManagerProvider.class);
private EntityManagerProvider() {
}
public static synchronized EntityManagerProvider instance(String unitName) {
instance = providers.get(unitName);
if (instance == null) {
instance = new EntityManagerProvider();
providers.put(unitName,instance);
}
try {
instance.init(unitName);
} catch (Exception e) {
log.error("Could not initialize persistence unit " + unitName, e);
}
return instance;
}
/**
* Allows to pass in overriding Properties that may be specific to the JPA Vendor.
*
* @param unitName unit name
* @param overridingPersistenceProps properties to override persistence.xml props or define additions to them
*
* @return EntityManagerProvider instance
*/
public static synchronized EntityManagerProvider instance(String unitName, Map<String,String> overridingPersistenceProps) {
overridingProperties = overridingPersistenceProps;
return instance(unitName);
}
/**
* @param unitName unit name
* clear entities on underlying context
* @return a clean EntityManagerProvider
*/
public static synchronized EntityManagerProvider newInstance(String unitName) {
instance = new EntityManagerProvider();
providers.put(unitName,instance);
try {
instance.init(unitName);
} catch (Exception e) {
log.error("Could not initialize persistence unit " + unitName, e);
}
return instance;
}
private void init(String unitName) {
if (emf == null) {
log.debug("creating emf for unit {}", unitName);
Map<String,String> dbConfig = getDbPropertyConfig();
log.debug("using dbConfig '{}' to create emf", dbConfig);
emf = dbConfig == null ? Persistence.createEntityManagerFactory(unitName) : Persistence.createEntityManagerFactory(unitName, dbConfig);
em = emf.createEntityManager();
tx = em.getTransaction();
if (isHibernateOnClasspath() && em.getDelegate() instanceof Session) {
conn = ((SessionImpl) em.unwrap(Session.class)).connection();
} else{
/**
* see here:http://wiki.eclipse.org/EclipseLink/Examples/JPA/EMAPI#Getting_a_JDBC_Connection_from_an_EntityManager
*/
tx.begin();
conn = em.unwrap(Connection.class);
tx.commit();
}
}
emf.getCache().evictAll();
}
private Map<String, String> getDbPropertyConfig() {
if(overridingProperties == null) {
return propertyResolutionUtil.getSystemJavaxPersistenceOverrides();
}
return propertyResolutionUtil.persistencePropertiesOverrides(overridingProperties);
}
/**
*
* @param puName unit name
* @return jdbc connection of provider instance represented by given puName
*/
public Connection connection(String puName) {
return instance(puName).conn;
}
/**
*
* @return jdbc conection of current provider instance
*/
public Connection connection() {
checkInstance();
return instance.conn;
}
/**
*
* @param puName unit name
* @return entityManager represented by given puName
*/
public static EntityManager em(String puName) {
return instance(puName).em;
}
/**
*
* @param puName unit name
* @return entityManagerFactory represented by given puName
*/
public static EntityManagerFactory emf(String puName) {
return instance(puName).emf;
}
/**
*
* @return entityManager of current instance of this provider
*/
public static EntityManager em() {
checkInstance();
return instance.em;
}
public EntityManager getEm() {
return em();
}
public static EntityManagerFactory emf(){
return instance.emf;
}
public EntityManagerFactory getEmf() {
return instance.emf;
}
public EntityManager getEm(String puName){
return em(puName);
}
/**
* @param puName unit name
* clears entityManager persistence context and entityManager factory cache represented by given puName
* @return provider represented by puName
*/
public static EntityManagerProvider clear(String puName){
em(puName).clear();
emf(puName).getCache().evictAll();
return providers.get(puName);
}
/**
* clears entityManager persistence context and entity manager factory cache of current instance of this provider
* @return current provider
*/
public static EntityManagerProvider clear(){
em().clear();
emf().getCache().evictAll();
return instance;
}
/**
* @param puName unit name
* @return transaction of entityManager represented by given puName
*/
public static EntityTransaction tx(String puName) {
return em(puName).getTransaction();
}
/**
*
* @return transaction of entityManager of current instance of this provider
*/
public static EntityTransaction tx() {
checkInstance();
return instance.tx;
}
private boolean isHibernateOnClasspath() {
return isOnClasspath("org.hibernate.Session");
}
private static void checkInstance() {
if(instance == null){
throw new IllegalStateException("Call instance('PU_NAME') before calling em()");
}
}
public static boolean isEntityManagerActive(){
return instance != null && em().isOpen();
}
}
|
{
"pile_set_name": "Github"
}
|
<?xml version="1.0" encoding="utf-8"?>
<FictionBook xmlns="http://www.gribuser.ru/xml/fictionbook/2.0" xmlns:l="http://www.w3.org/1999/xlink"><description><title-info><author><last-name>FBReader</last-name></author> <book-title>Acerca de FBReader</book-title> <lang>es</lang></title-info></description>
<body>
<title><p>Acerca de FBReader &FBReaderVersion;</p></title>
<p>FBReader es un lector de libros electrónicos para Linux/Windows PDA/UMPC/PC. FBReader soporta varios formatos: <code>ePub</code>, <code>fb2</code>, <code>chm</code>, <code>rtf</code>, <code>plucker</code>, etc. También puede leer directamente archivos comprimidos en formato <code>zip</code>, <code>tar</code>, <code>gzip</code> y <code>bzip2</code> .</p>
<p>FBReader es distribuido bajo los términos de la <a l:href="http://www.gnu.org/licenses/gpl.html">Licencia Pública General de GNU</a>. Una parte de FBReader para Windows XP se basa en el trabajo del Grupo Independiente JPEG.</p>
<p>Si le gusta el programa y desea apoyar su desarrollo, por favor visite nuestra <a l:href="http://www.fbreader.org/donation/make.php">página de donaciones</a>.</p>
<empty-line/>
<subtitle><p>Cómo empezar</p></subtitle>
<p>FBReader reconoce automáticamente los archivos <code> ePub</code>, <code>fb2</code> y <code>OpenReader </code> que estén en los <code>Directorios de Libros.</code> La ubicación de estos <code>Directorios</code> se puede modificar en el diálogo de Preferencias. (Haciendo click en <image l:href="#settings.png" voffset="-6"/>, en la barra de herramientas). Allí hay que dirigirse a la solapa <code>Biblioteca</code> e indicar la ubicación de los <code>Directorios</code>. Esta opción debe tener la lista de <code>Directorios</code> (separados por punto y coma) que contienen los archivos <code>*.epub</code>, <code>*.fb2</code>, <code>*.orb</code> etc.</p>
<p>Luego puede abrir la <code>Biblioteca</code> (haciendo click en <image l:href="#books.png" voffset="-6"/>) y seleccionar el Libro de su preferencia.</p>
<p>Para leer un archivo de otro formato, primero es necesario agregarlo a la Biblioteca. Hay que entrar en la opción <code>Añadir Libro a la Biblioteca</code> (<image l:href="#addbook.png"/>), seleccionar el archivo e ingresar la información del Libro. La próxima vez que inicie el programa puede leerlo directamente desde la <code>Biblioteca</code> (<image l:href="#books.png" voffset="-6"/>).</p>
<empty-line/>
<subtitle><p>Sitios relacionados</p></subtitle>
<p>Para mayor información sobre este programa puede dirigirse a la <a l:href="http://www.fbreader.org">Página principal de FBReader</a>.</p>
<p>Si desea ser notificado sobre los nuevos lanzamientos, puede suscribirse al <a l:href="http://freshmeat.net/projects/fbreader">Proyecto de FBReader en freshmeat</a>.</p>
<p>Si quiere realizar cualquier pregunta o sugerencia, por favor use el <a l:href="http://groups.google.com/group/fbreader">Grupo de FBReader en Googlegroups</a>.</p>
<empty-line/>
<subtitle><p>Librerías de terceros</p></subtitle>
<p>FBReader for Windows XP distribution includes several non-GPL'ed third-party libraries.</p>
<p><a l:href="http://expat.sourceforge.net">Expat</a> – XML parsing library. Copyright © 1998, 1999, 2000 Thai Open Source Software Center Ltd and Clark Cooper.</p>
<p>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:</p>
<p>The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.</p>
<p><a l:href="http://libungif.sourceforge.net">Libungif</a> – library for working with GIF images. Copyright © 1997 Eric S. Raymond <<a l:href="mailto:[email protected]">[email protected]</a>>.</p>
<p>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:</p>
<p>The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.</p>
<p><a l:href="http://www.remotesensing.org/libtiff">Libtiff</a> – Tag Image File Format (TIFF) library. Copyright © 1988-1997 Sam Leffler. Copyright © 1991-1997 Silicon Graphics, Inc. Portions Copyright © 1985-1987, 1990 Regents of the University of California. Portions Copyright © 1990, 1991 Digital Equipment Corporation. Portions Copyright © 1990 Sun Microsystems, Inc. Portions Copyright © 1990, 1995 Frank D. Cringle. Portions Copyright © 1996 BancTec AB. Portions Copyright © 1996 Mike Johnson. Portions Copyright © 1996 Pixar. Portions Copyright © 1997 Greg Ward Larson. Portions Copyright © 2000 Frank Warmerdam.</p>
<p>Permission to use, copy, modify, distribute, and sell this software and its documentation for any purpose is hereby granted without fee, provided that (i) the above copyright notices and this permission notice appear in all copies of the software and related documentation, and (ii) the names of Sam Leffler and Silicon Graphics may not be used in any advertising or publicity relating to the software without the specific, prior written permission of Sam Leffler and Silicon Graphics.</p>
<p><a l:href="http://www.ijg.org">Libjpeg</a> – The Independent JPEG Group's JPEG library. Copyright © 1991-1998, Thomas G. Lane.</p>
</body>
<binary content-type="image/png" id="settings.png">
iVBORw0KGgoAAAANSUhEUgAAACAAAAAgCAYAAABzenr0AAAABmJLR0QA/wD/
AP+gvaeTAAAACXBIWXMAAAsTAAALEwEAmpwYAAAAB3RJTUUH2AsdFiIVNd73
uAAACXNJREFUWMO1l2mMndV5x3/nPe9617l37szYM+OVMXbGGHATO6ZesA04
JjQqNBtKgWwKigNlcZUUukREDUIKJU1oVUSkqIkVURwsI4PsELCJwQFDvWMb
jBnPeGYym5eZuXOX977bOf3QUiEZV5i2z5dzpOf/6Pw+PHrO/xFcQuzsf+H1
3f42e/jM2e7yVOC1F+awsHmRv2b2qj+d785/iY8R4qMKh2u9LZt6fnVm0+hj
JNqkUJhBTk5n4LVBVk1bFn5j5W23Lmtf/eylAhgfVVixJrr2T75BNQUqaxOL
iM5ZreRnOmw59G/23/3mwWeeGP7R7f9vAHU5NafP78PzpiGTLNK3KEqPfMaE
tpjDyWH593se2fTEKz/dcCkA5kcVvn56/xzHFgSNEGkLIGKiNsXSq1dwdN9J
lBFCOuLRsUf+5Z97Hi+ubL3ulcHg1Iod1WfmrOSGvuuyNz7RWmop/48A23uf
W/HbY9sXlUqlw9//44f3fjB3Ohy6pmpHGK7Gsi1Qmpqq4BZnM7t7Fsf6DxNW
oRhY7Ozf8cNTzjscyb7OdaWbeGPwFcaHxm8frg6tbs90nP3QJnxt8tVr/vHA
w7sPnH3bTlREWqRo1dOH5pUWjBpZ6b3VONQ9lh3BkwJhakxh0uK0cuXsxYwN
j3DovQM0nDptC1qZZnbQn36P9spM8m6Otan1nJw8wblna/9+9/X3r148c7H/
/rvy/UvLuvw9z1V/varuxERpH9+tMWVM5qaMyfaRZLjlrDGG2WxgSUEiI6Rr
oEVCpTaFcAVWUZLtTFMrljnnjtI20YllmzRMnxE1xGJvGft79ncMnjvd/ebT
+zdf0ISRDpNYRGS0R0Z4ZFwXO6OomGeom2exUzGmjhAaHMdB2wrtKSaCcSaC
c+i0xvCg0CjRHs6g4BYpZ8eZtCeYzkw+Zaxg7vQutv3h6Vv+6rV777wAYGX3
6p9Pq3eGZsNETwlETSC1gWFoLFdgW5KkGmApB9v0ULEGCdliFukaCFOjpMI0
TWZMdDEkTyNDiyv0Er5ib2Bf401e6n2RKWeSPW/t/toFALdM/1LPZ0t/9uPQ
Usi0jeOlsR0PLQWNKEQaDvlUCUd50FDY0gItkFIixH+dWoCpGMj00BJPJ21n
+KL8Kk9sf5x/+Nmj9GX7aJYtfGrup3/xoZPwrfKRzLqD6/qJkyKxIuWaSFuC
AZZlY0kbNRFTpkxbVwnLMZGxRGKQbU1T11VkzcRoUph4zE+uov9cP3u3HkRr
TZjzuYqFm3fd/satFx3FXz/85RcP9Ry6wU818GUN05Y0Z5tRkxEnDvYgT3no
aTEVFdH+ifwLS25Y7JZT46sTmZAVeXy7gq/r5MIC1lCK/VsOkbGyVGUZUVJD
v12xb+FVs64oX3QS9lV68xU5RWD4mJ5FNp1jfHCCngN9NIZAKEGlHpGaFM9/
t/TQnRu8BzZ0BrN+j4yRiaBarjNbdJFrFCjXJ6m2VRiUw8jI4pt/tOG+Dz5+
AcCBscOLBmt9S3U+IbYjGmEdERsE5wPC0YQWmcMpGngmLClds+X+dfcPrs+s
P9HFgq1u7BIZDTrznVQnaxRSzSy6fBH5VAYjgoLTRG3MH7/oX/Do0Ue6v7/j
wd/U/DqKBGkKhBAEQUClUiMIQMeas7qKFzgsvWzpy+/Xzst3vdwUNdFwKlRU
lTDn8we/n4Jd5Luf+1tuvuxmRvvPsqf/d5tePLnt2gsAPr/jxh/908EfH99n
/74jK3PEUxrVAMdywNBYKYN8m4VKKbABQyHlf88wkki9o9R/NpQvKsRGjMwJ
huvDSBe+dfO3uGvD3YwOjHY8+PRDuzZuv++He8qvSgB5x5YvfeXV8y8/5rfW
SYox2WoGhMZ0LEIVYQhBc66Z6aVpBI2ArGdRs+sUdMuRd3a8ewRgyX2Lr3jH
OvJtqSwSCyzl4OAwGY3TG77LGXuY+YUF3LrqNp4f3G4c7Du46kTPiaX3bLxn
q5EpZD9peS4oA1WRVBoVMAWGZaB1Agl4TorpLR3M6ZxDLluEvOBY460vbN77
zAyAIWtgbWCFqEBiBQ7ChyiKSFIBQabG8dphdk/t5PWp3dxy22dw5mn29O5c
v/vYznvNjJdLXOVRn4pocrPIpgahCEgCH8uxsYRFWA1pnd3GmvVreP7AdsLz
IcOj/Z/73tt3NW48eu3vTsYnvqi0AEvjxinqokJsh8jYICcKRCJmPDdML2/T
FrQSOJM0zUyRbU0hH/ibBwdS5OckAZUoikZSDTcXJrGt0prE0YSRwrQdGkaI
KgraO9pwcg5WkyQ/L71QFcObIoIZtmkRqxihYlKGgFgRS5c4NPASG60VdVMT
mYqju4fonOjkG1d/+4EP9YT3Hrxz6fb3nttWz1enua5L2sxCoPA8D09mUWZE
YARYWYmyEkIdkE6nMU2TQAtM0SBxEpTnoquKVulRiyYIcgp1PM3I3jOszK19
+Zdffuq6i5rS5b+68oHR/NAjsRuTdly01pgWEKewUybKBtMFLAMhNK7tIYRB
wc5Rq56hInwC00ZNGSzrvPqlyclyX9VOmH2iM5xbnLd3+Yxrn12WX+5f1JIV
0qWeMXsMP64jhIFjmSjDwEwLYqmIVUgUC1zTRQoTFWmkEAzGISePn6JyPoIG
XB7M2fvk3ZvXXbInPBdPtpRVDdO2sUWWuBEThBGm5yMtiekIhBaoWBEmIUJK
crk0ncPNjPVILCNCiDzGZKbvY7nikejM1XUdIHCgITGVi2enkZGJTAxEbKIi
iANFEoJKNI7t0VLoRqkcwktBVlLV5/MfC0Da8TWuKdHVkKgSIqKEeq1MUtXQ
sDBCSVxNSBoKoQVJmOD7AfOdEs3KxEpCIrNKVExaLhngod3fywgVdsskwYw1
OctFEjEwOMHI6dEBf6LeJxITlETHmjhW+L5PpVKmng1opENqZkxkJLSVWocu
GaDUMiNfkO2yUouoFMuM6CGCfuGv4/o7an+RzOr7/Ojcxy/7+XfmxZdzPhom
cCZQ0qcancfNVFGWoins4Kb0HQMPL3/yLz/Wbrip9xcbtx3Z8oMz5ZHM3OL8
d9d2rfvzr3Z/7cAHNT849tc/2Tr61L1TqSlcK40KFNfOvp53dx1nbeeap/5k
4We/88lpa8r8b2L/8JszL5Y7VNtv37fvrl1dWzv0ghfm6lW7VuiNRzf2/uvx
J9f/n2/HF13ZB17K//rUU4/JlLnoypYlm5fnrvrZlaVPVz9q/X8A8yhCVXd4
BFAAAAAASUVORK5CYII=
====
</binary>
<binary content-type="image/png" id="books.png">
iVBORw0KGgoAAAANSUhEUgAAACAAAAAgCAYAAABzenr0AAAABmJLR0QA/wD/
AP+gvaeTAAAACXBIWXMAAAsTAAALEwEAmpwYAAAAB3RJTUUH2AsdFwIdr0Mx
HwAACg1JREFUWMPFl1uopedZx3/v6Tuubx33mn2c2ZNMMulkstudZBwDNqUp
o21i8bYXVa/sRa+KdxW8KAFrJSAEggWxII221KYXNWolxdBIQxqa1Exm2jl1
9sweZ58P67DX+s7f93qxixAEISL63j8vP57D//k/8P/8xIcNeOv+3UcH46OV
v1nrr1xf31zZTYvVw2l8qsxzIkqCbDw51Wu9+MefffCFZx/7yOh/DPDmlu3e
3RqsvntnfeX9zb2Vtbhc3bVmdaKMAoXwLHYyxTgOMi/ouiHZaAJJjs1KVmY2
RhcfOvvCp86de/G51eXJfwvwt7+IV9++u7ny3r31lXs7GytW2JX16NQiFqiA
yoKQeI5PM2zRCAKeUNeYb4cst0NaRlMUku+99iZDIm5tD1ChoeNpzva7hxfP
LH7tqTNLX3/u3Nx/ARGf+Mpfv3P5SD856SxQuT4idPF8zTPEdALDYtNhOVLM
uxkndE5LFniipBAPMRNI/GqI7zusxzlf+vq3iJcf5/1Bxv4AMJZWJFlsKs6E
au/xdvgnn3zw9F9+6uJHkg9k4LVXvmvboUecJFjXR/kejg4JXI8g8PB9F+NI
HKNQSiClRFU+A1vSDSNG2ZDad/mzL3yVNz/9NOMbBbfjlEIbgvkFrDH0mj4n
fYdGerR9tt97/rOz5hvPPnkq1wCPXrhAWlbMCAclDJHXJOz6v2K0IAXWVhRF
QZJOSbIMlU2I64xk+9/JiXHDFnWSICYVrm1Q7N4EP6Qwls7SAu2wifIlqbBz
P9u6+RdV3Pjyq7e2/kgDbCdj0vEEv9aYtET6DXZ2M4QQSO3gBT6O56Mdg5QK
P3AJpKKlXVwXVNBmOE5onWjjC8u0jqGjQQqKvfvsxmNGOy3Onl7m6QsfI3Q1
3/zBP5yqAueLGoDNAZ3AIRdTymZF0oF5r4+UGuU4oDSFhbICIQSOY7Clzyge
YiufYVyzdnuD7Xab2rO4nZwLYhHpBWxPYkZVxWhnnys721zduIMVFRQ+P3rn
OhrgzuYhnWaH6eQIpQoCb8qbFEipkcpgpSLLS6ZJSmVBKsORcRlMpxRoto2g
3szY1gtsbIxgOGYhipCi4mSkOOO1cNx54jRhOJ6QFTkbzRmm9+6gn/nT79rf
/7cJVatBQYQjQOQZSt4mz3Oq0h53ghXYogAEwhj8IsZWUFaaImhwupphUmv2
r9yF8T57t69ifI+o3yOY6dGaX0A2QjQ13V4Xt6yZbTXRprxNtb9LftBACY1M
E+x4hBe0kVlGVZRoCbKy1FWJlgrfcdmpBwR1hgek3Q7BpMOBZ4iUoG5FOOfO
oR1N7TrspAl3r11DVOBLh07Uwl9e5uITj5Ti6lqy8Oq/vL1Ra42QKdIOUSRk
lcA1mmYjpBOGGAF1keFpRej5nOguEuZDXBVzRxW8+713een6TY5w2djZBnUG
HIUODTp0EEIQaAenVqTjmLbe56tf+sJv6cce9DdvXLuOEgITupSuIrUFzbim
LEustZRlSVEUGGMwxlAUBY4RZJXAD7uckYLJx5+gcfkK/YdX2BhrSCuUdKlq
g6RFe24R2WgySnLidspge40XvvXDz2iASlsqKpxS0MHgWqDbpa5rjDEopajr
+li5hKAsS0odUMcNqnSCFJq5pdNEjR4WF1f7WJOQT/chUVhVY9KQfr/DI4uL
SMfljX++w+Bw/6IGGMWKJE1R2Zi5oEHLNdTFLnVdH6verwCEOFZBay2pCWm4
mrKyKCnASsbDMVG/ot/pcri7Rh4PwVqKcsrG3iYbV94B7UFVQhCyO7h3PIYn
vIig3aO2OUFoQBQUpovvOzjmg8sjzSCOE5zRFlUO2XSCEzQo8gKpLM3Io1tW
2LqHNJosKxBCQH2cPS0tQmkKVdPy9DHAKDtklEuydEo4lShZk03uEEURjuNg
rcVxHMIwPP4kz+i1+2RpjK8dcD2GW3cJGi7tnk+bksOJS292HmHBVZrA83Gk
QlowxmB9ycW5J9FffvmV3/vKD98iqyU9z+ex2XlORi1McUA3s4RhiNaaAIdY
1VRVRZpm3N07JEtifFdTq5z3bt8jE4o4S6nqnJl2m2YjwnUcXCUJjKEsCvJ4
ipSS7YNNHvv4CvqN99e/eWtak0qXsE7517fuUezvkTZ9jDHUdf2BZrTWIqXk
3EJIlaVERtNtRkziDKe9xGBYMhpmLHYisumAwfaI6WjIaHDI0WBAXeY4WqGi
JpcXmujZoy2ODgt2pzVITZYn5OmE0REgBFgLjoNxHKqqwlqL7/u8njXRSuIW
BZHcR5cWKQ37v9gijhPWsvtURUan1WSm16YfSGa9JlEjIAwDYhOxsX7n2A98
/zvfXi/z6hRC0ej1GY2PmKSCCsvhZMJgOiUpSwZpwv5wRJwmTA9rtg72KKgw
tcRYgeP5JFpS+S4zyQG+71PXx2XzfZ9ut8v8/DwLCws0WzO8/oO//7EGiMIG
jX6I74ekRcnCiT6t0EMbQ1Fb0roEbaiEpKhragEcJYyzBCsFRVKwc3+XH//k
J2xOjljb2yZonqAsS5SjcLTGdV2cICJOCq5cvc7a7dvYZHQ8BUHQIHB9XEfT
CDxarSZVndFoODiehxAKxLEWVPZ4OckAJrlglEyZlAnCTSn27vLg8gMgMn65
k3E0GSGEwHdc8jwlv3ETW9cURYFX53z03MPHAMY0OIonVFVFWaQcjQe4/RPE
cY5XALWAqj5uQARCCEa725RKEKdT8rQgyyz3Ngc88sAKg3zAeDKkKCxlnjKx
MZIaJSGKInrtNgtNh0/8xq8fWzLpN8jTnChsUWeSpVOLbMcZkzhnPxkRj0ck
0xhVg5ISaSFsNSllzmg0pc4KDkdjJmmB8hoor4lrJuTxFC2h12rRCAMagc/8
bJ+5uRM0Rf7LCx89/7v6+//4evD+rbVTUhk2RkfMz3Uxk4xu00dKiavaSLGA
rGqMkAhq8jwnLSR5meAryEYj9pIxkbaQjKmmY3oNj6V+i6gR0AoCHlhe4snV
j+FouXHzxrXnz58591dPX1yt9cvf/s5r9/dH1MohTWOWTy6AKFk+0aPZiJid
7TPb69KMGrSjJr53PI7ZUQUiI5sOEEnMaH+fhZkurTBkaX6ObDxmaXGB06dO
sjTfxzdmL5scPN/otL/xh3/w+Q/a8r9744p85/LPW/c27p+9fuPKb4a++XSe
qkfBdrUS1FVBWeY0fI9mFCGl4FR7jmbToRsqep7mxntX2Bom9B5dZX2aMGcs
jzz8EJv31w+n48ELv/Pbn3np0iefnnyo2/CffvS2+7PLlxeuXrv1+MFg+Fxe
sVpZVsqydDzPI03TY2/gOARB8J97o65rgqP10fnz51985pln/vzSpUuj/7Xj
FOD1n15t/PS9n58+ODj4teFweCnP85U8z1eSJEEplYRh+NIXP/fs15566qnD
/9NT++VXXpUfNuY/AN2DyvmFX+9DAAAAAElFTkSuQmCC
====
</binary>
<binary content-type="image/png" id="addbook.png">
iVBORw0KGgoAAAANSUhEUgAAACAAAAAgCAYAAABzenr0AAAABmJLR0QA/wD/
AP+gvaeTAAAACXBIWXMAAAsTAAALEwEAmpwYAAAAB3RJTUUH2AsdFwUYkGhT
VwAACFpJREFUWMOtl0mMnVeZhp8z/PMd69at0RU7cdmJHRwldhoMLJgUETCI
VjdNN0IsWIAEEkJCAsECBGKBRLOjV91qNYEgEIhByIJuIYQUhZBBmIDJ4MR2
OXZVuQbXcO9/7/3Hcw6LRqyCKMDf+nyvHr36zvudIzhg/T69KAeNQStJk9SK
6uG0GC1vDG+du7a++tCVyyvMT8//8PSpB758V2fuxdl4IZ/xZquD6IqDAnzi
qU+8+yn12w+v1NffoazUU1GHkwvHOdJY4OmfPsnVi5cxmeN0dCb/6Hs/fvc7
T73j+kF09YEdMM/9+En7GESWJIppxxoRl4SBwJqCShjK0HFp7+XQBrZxUF15
0IPGVBBaVArxQNDci5gZz3JMnmDaLOKbDrVNqOOaXOTmtgMkpkGiu5gF2I4K
brqMAocnfChLRJ0T+RbjWXJT3n6AurND4GrEEKhrcrXFnthB08ZzfZSLUdrh
lT4zVbs+qO6BZ8CXEW6ocbHADxWTfMLm7gb5TE6326WXzDDxRsTLmuvt9frr
N34QD9Jhcbw9S7+1RDuYdsf8OXsggH//1ddcJXbYU1vE4hBCOH40eoTS1JA7
rG8xypLqlJqK1507y4NvexACy0r6G9aClZVBuapmkkV25Ygv/c8nmY1muPDi
L06fvuctz/5FgP+69B+M/A2qZEKUHCIsfNZaL5GHGl/4lEVJrUte3H+eb6z9
N71ihsXeIcgdvSnBOqu6jhKO1wsc8ae4tHqRVd1i895z0YEcWBEvUwUWAhDR
dQKjqT1ASlzhECGICDI/50L2NJFJWLKHUEKxMO5TJZamhDLdpdM7wXR7jkpH
bFaVOxCAlh5WFjACIwzCBoSFpDKaWhd4yqM0FQjYD1L2q5SN0QaNRsy1okdu
BEveHZyI72BCxTBVFGGE7XXkgQCcM0RO4FUBe7VFaw9TTDBU+E0PIQR1ZbDS
ggUUOAvjesJYTLBlRFUqVjsbrLNNJ1mkIIKiOtgQmrjGCgikBjGmUA4jQTUN
NY5qUuNHAdrXZPkEFSqEL7GlBVnjhYbaZOyKHVaHN4hFTNu2aL9KPLwqwIn0
FDfNKqPuPr1Ri67sc7l7GSMs0dhiOh5l6GCY8Yb4QY5693PTbHJVvkDQrlit
hmgk49pyRdXshBkLdZ+Rtyj+5mV03xNn3O/qizRCyYgKQsnhYJb3HXsv8U6f
377yHOtqhSBXhNMN0nFGkk9xZ3jmSvWK97M3z7/u1w/fc/aR+VZY/U1BJIyG
oKJCgdIgPALn03AJN369zqVfXWXi7RLKO/j8+z7wrx+4/4Pf/f/OHwLwyN+b
hM08I7aOiVeD7xASBukuWztbbNwcItKYVqOBsdPMVkd/cNujWIYhToKnocLg
hGGiarbYZhAIZKeLcQKnayxG3vZldEumZAnoGpgAFdjQsFFtsSNT8khRighf
G8bU0W13oJn5ZUvja9UAT5ExxljD5s4WZTVLpCN8r02rgJ9fXXv0i088U4U2
2u62Y6a74cWuUuWC374URMHIVNX1o21/+0+34Oq1FVkURVDXtbtyU+oX/A2X
pv3wxZu3VLFTBM1m2v3O6NPn6a0sEQG9CMICEVmW7GHUS4fRK4cotyUuG9O7
5yxHDv0DnZFHIismwQR0zbSfQDnBVzDfbn/v6MLcR8Q/feWRzwyj7mKhdGcy
GfWSIpiSykxVpu4JnXQslZTJOhde+k8y8SxCgpdFqMRjEg+hhuTWEmZtCmxI
JWLuO/12mr0TVDpBBgItSgKhEKWgU62zNYLcauZU/oy+q99++OXd0ZtaQYhO
FNuNEqksGIMShrq2WGUQQoCRWGkpPYerC8j/aGIZIEwTQQNPVPhYQuXAFti8
AmnQ2kdZQX/pLg5PL1GVMLn+wnH91Q/945u/8Oj581NTnXPtRkBsHE7DyDjS
WrOWptzM9rgetdkcN8kZoEKPujYgJRQx2b5B5R5+Mo3WA6rKkGcpRSWRytHt
tjh6+BDzvT5b44yd4YRrl68QDzYiDXBnolnsBrRDxWzpkJFH7YWUcZeJ0qTB
Ud50qkVqXuHx8gmqQc211TU2x7fItwpMV+B3A8rApydOMiw11WBCrz/Pwtwc
zdgnG2U8v/k8q2nBYD9luLXBfTMNXwD832NPnT+8MHOuGylsSyGlxDmBFjFK
hiShJqs2QaZQLeFMzdjmTDBkgzGTtYzfX8k5/8wVbswLxuMxWvo0ojYaQZWN
cOWIQDu294b02i1mW5E9Ndf5rAYYW499owlUDOMcTwqEA0GBcCUm8/CtQriI
UVWAGJGZMeu7e4z3bxEpRapTLqXP0j32MDe3XqLK9smjjFD6aGvxRY1ScPbY
YXrN5JWjM+2zHzv3+g39/cd/99DKrdG5PTlkfVzymriDDD0CX6I9ifYAT6JU
jHOOduGBVER+E2NihrlF1CPqyQiBZTwYQpXTDqAhS7yyohPHLM7NsLjYYlGF
z/Xb4QP/8tYzFYD+xVMXPnNjUK4IT98pXUXpcqLQpxtpOrFmphky12wz25ki
UAHT0RTD8XWsFpRlgJ/X2HxCOcjphNOMshSRp0SRYDaO6PenWez16bbFhSiu
/+1j73zjy6+6jh/9yeNqc2v7/md29u92Si/XUiyPjTuZlvXJtKqj3FqMkNxn
90mCkE7UIglCnBPsDgesbW+yMxgw0Ufot2MWplvMJpqOV+7Ot/x/PnHX0mPH
jyy6melZ91e/Bz73zf9d3B4Ol/OiuvuWbt1fFMXyZDK5M8+L5cLWlA5KZyit
4YGoQSsO6TejzcV+61P3Hp7/1rtef6/9u3/Hf67e/7Vvnxlm4+W8LJeNccv9
/cHM8WNHf/na06e++p6zJ8vVQSYOtSP35/r/ABPJ7DnErBKYAAAAAElFTkSu
QmCC
====
</binary>
</FictionBook>
|
{
"pile_set_name": "Github"
}
|
#import <objc/runtime.h>
#import <string.h>
#import <stddef.h>
#import <stdlib.h>
#import <ctype.h>
const char *property_getAttributes(objc_property_t property) {
return property->attributes;
}
const char *property_getName(objc_property_t property) {
return property->name;
}
id objc_assign_ivar(id self, id value, unsigned int offset) {
// NSCLog("objc_assign_ivar(%x,%s,%x,%s,%d)",self,(self!=nil)?self->isa->name:"nil",value,(value!=nil)?value->isa->name:"nil",offset);
id *ivar = (id *)(((uint8_t *)self) + offset);
return *ivar = value;
}
void objc_copyStruct(void *dest, const void *src, size_t size, BOOL atomic, BOOL hasStrong) {
int i;
for(i = 0; i < size; i++)
((uint8_t *)dest)[i] = ((uint8_t *)src)[i];
}
void objc_setProperty(id self, SEL _cmd, size_t offset, id value, BOOL isAtomic, BOOL shouldCopy) {
if(isAtomic) {
// NSUnimplementedFunction();
}
void *buffer = (void *)self + offset;
id oldValue = *(id *)buffer;
static SEL copySelector = NULL;
static SEL retainSelector = NULL;
static SEL releaseSelector = NULL;
if(copySelector == NULL)
copySelector = sel_getUid("copy");
if(retainSelector == NULL)
retainSelector = sel_getUid("retain");
if(releaseSelector == NULL)
releaseSelector = sel_getUid("releaseSelector");
SEL useSelector = shouldCopy ? copySelector : retainSelector;
struct objc_method *assignMethod = class_getClassMethod(object_getClass(value), useSelector);
if(assignMethod != NULL)
value = assignMethod->method_imp(value, useSelector);
*(id *)buffer = value;
struct objc_method *releaseMethod = class_getClassMethod(object_getClass(oldValue), releaseSelector);
if(releaseMethod != NULL)
releaseMethod->method_imp(oldValue, releaseSelector);
}
id objc_getProperty(id self, SEL _cmd, size_t offset, BOOL isAtomic) {
if(isAtomic) {
// NSUnimplementedFunction();
}
void *buffer = (void *)self + offset;
id value = *(id *)buffer;
return value;
}
|
{
"pile_set_name": "Github"
}
|
# Generated by superflore -- DO NOT EDIT
#
# Copyright Open Source Robotics Foundation
inherit ros_distro_dashing
inherit ros_superflore_generated
DESCRIPTION = "Most implementations (windows, posix, ...) have slightly different api for low level input-output functions. These are gathered here and re-represented with a cross platform set of functions."
AUTHOR = "Daniel Stonier <[email protected]>"
ROS_AUTHOR = "Daniel Stonier <[email protected]>"
HOMEPAGE = "http://wiki.ros.org/ecl_io"
SECTION = "devel"
LICENSE = "BSD"
LIC_FILES_CHKSUM = "file://package.xml;beginline=12;endline=12;md5=d566ef916e9dedc494f5f793a6690ba5"
ROS_CN = "ecl_lite"
ROS_BPN = "ecl_io"
ROS_BUILD_DEPENDS = " \
ecl-build \
ecl-config \
ecl-errors \
ecl-license \
"
ROS_BUILDTOOL_DEPENDS = " \
ament-cmake-ros-native \
"
ROS_EXPORT_DEPENDS = ""
ROS_BUILDTOOL_EXPORT_DEPENDS = ""
ROS_EXEC_DEPENDS = " \
ecl-config \
ecl-errors \
ecl-license \
"
# Currently informational only -- see http://www.ros.org/reps/rep-0149.html#dependency-tags.
ROS_TEST_DEPENDS = ""
DEPENDS = "${ROS_BUILD_DEPENDS} ${ROS_BUILDTOOL_DEPENDS}"
# Bitbake doesn't support the "export" concept, so build them as if we needed them to build this package (even though we actually
# don't) so that they're guaranteed to have been staged should this package appear in another's DEPENDS.
DEPENDS += "${ROS_EXPORT_DEPENDS} ${ROS_BUILDTOOL_EXPORT_DEPENDS}"
RDEPENDS_${PN} += "${ROS_EXEC_DEPENDS}"
# matches with: https://github.com/yujinrobot-release/ecl_lite-release/archive/release/dashing/ecl_io/1.0.3-2.tar.gz
ROS_BRANCH ?= "branch=release/dashing/ecl_io"
SRC_URI = "git://github.com/yujinrobot-release/ecl_lite-release;${ROS_BRANCH};protocol=https"
SRCREV = "b52b55a89bf1c3142f6f685ff112a94eacaf9af3"
S = "${WORKDIR}/git"
ROS_BUILD_TYPE = "ament_cmake"
inherit ros_${ROS_BUILD_TYPE}
|
{
"pile_set_name": "Github"
}
|
/* Copyright (c) 2013 Nordic Semiconductor. All Rights Reserved.
*
* The information contained herein is property of Nordic Semiconductor ASA.
* Terms and conditions of usage are described in detail in NORDIC
* SEMICONDUCTOR STANDARD SOFTWARE LICENSE AGREEMENT.
*
* Licensees are granted free, non-transferable use of the information. NO
* WARRANTY of ANY KIND is provided. This heading must NOT be removed from
* the file.
*
*/
#include "ble_gattc_evt_app.h"
#include <string.h>
#include "ble_serialization.h"
#include "app_util.h"
uint32_t ble_gattc_evt_write_rsp_dec(uint8_t const * const p_buf,
uint32_t packet_len,
ble_evt_t * const p_event,
uint32_t * const p_event_len)
{
uint32_t index = 0;
SER_ASSERT_NOT_NULL(p_buf);
SER_ASSERT_NOT_NULL(p_event_len);
SER_ASSERT_LENGTH_LEQ(13, packet_len);
uint16_t tmp_attr_len = uint16_decode(&(p_buf[11]));
uint32_t event_len = offsetof(ble_evt_t, evt.gattc_evt.params.write_rsp) +
sizeof (ble_gattc_evt_write_rsp_t) - 1 + tmp_attr_len;
if (p_event == NULL)
{
*p_event_len = event_len;
return NRF_SUCCESS;
}
SER_ASSERT(event_len <= *p_event_len, NRF_ERROR_DATA_SIZE);
p_event->header.evt_id = BLE_GATTC_EVT_WRITE_RSP;
p_event->header.evt_len = event_len;
uint16_dec(p_buf, packet_len, &index, &(p_event->evt.gattc_evt.conn_handle));
uint16_dec(p_buf, packet_len, &index, &(p_event->evt.gattc_evt.gatt_status));
uint16_dec(p_buf, packet_len, &index, &(p_event->evt.gattc_evt.error_handle));
uint16_dec(p_buf, packet_len, &index, &(p_event->evt.gattc_evt.params.write_rsp.handle));
uint8_dec(p_buf, packet_len, &index, &(p_event->evt.gattc_evt.params.write_rsp.write_op));
uint16_dec(p_buf, packet_len, &index, &(p_event->evt.gattc_evt.params.write_rsp.offset));
uint16_dec(p_buf, packet_len, &index, &(p_event->evt.gattc_evt.params.write_rsp.len));
SER_ASSERT_LENGTH_LEQ(index + tmp_attr_len, packet_len);
if (tmp_attr_len > 0)
{
memcpy(&(p_event->evt.gattc_evt.params.write_rsp.data[0]), &(p_buf[index]), tmp_attr_len);
index += tmp_attr_len;
}
SER_ASSERT_LENGTH_EQ(index, packet_len);
*p_event_len = event_len;
return NRF_SUCCESS;
}
|
{
"pile_set_name": "Github"
}
|
using GameObjects;
using GameObjects.Influences;
using System;
using System.Runtime.Serialization;namespace GameObjects.Influences.InfluenceKindPack
{
[DataContract]public class InfluenceKind6530 : InfluenceKind
{
private float rate = 0;
public override void ApplyInfluenceKind(Troop troop)
{
troop.reduceInjuredOnAttack += this.rate;
}
public override void InitializeParameter(string parameter)
{
try
{
this.rate = float.Parse(parameter);
}
catch
{
}
}
public override void PurifyInfluenceKind(Troop troop)
{
troop.reduceInjuredOnAttack -= this.rate;
}
}
}
|
{
"pile_set_name": "Github"
}
|
<?xml version="1.0" encoding="UTF-8"?>
<ui version="4.0">
<class>LoginDialog</class>
<widget class="QDialog" name="LoginDialog">
<property name="geometry">
<rect>
<x>0</x>
<y>0</y>
<width>548</width>
<height>456</height>
</rect>
</property>
<property name="windowTitle">
<string>Login Dialog</string>
</property>
<layout class="QGridLayout" name="gridLayout">
<item row="1" column="0">
<widget class="QWebView" name="webView">
<property name="url">
<url>
<string>about:blank</string>
</url>
</property>
</widget>
</item>
<item row="4" column="0">
<widget class="QPushButton" name="CancelButton">
<property name="text">
<string>Cancel</string>
</property>
</widget>
</item>
<item row="3" column="0">
<widget class="QPushButton" name="GetHQpreview">
<property name="text">
<string>Get HQ Preview File Instead</string>
</property>
</widget>
</item>
<item row="0" column="0">
<widget class="QLabel" name="FreeSoundLoginLabel">
<property name="text">
<string><html><head/><body><p>Enter your freesound account details to download the highest quality version of this file. Or use the High Quality preview file instead (no freesound account required).</p></body></html></string>
</property>
<property name="wordWrap">
<bool>true</bool>
</property>
</widget>
</item>
</layout>
</widget>
<customwidgets>
<customwidget>
<class>QWebView</class>
<extends>QWidget</extends>
<header>QtWebKitWidgets/QWebView</header>
</customwidget>
</customwidgets>
<resources/>
<connections/>
</ui>
|
{
"pile_set_name": "Github"
}
|
/*M///////////////////////////////////////////////////////////////////////////////////////
//
// IMPORTANT: READ BEFORE DOWNLOADING, COPYING, INSTALLING OR USING.
//
// By downloading, copying, installing or using the software you agree to this license.
// If you do not agree to this license, do not download, install,
// copy or use the software.
//
//
// License Agreement
// For Open Source Computer Vision Library
//
// Copyright (C) 2013, OpenCV Foundation, all rights reserved.
// Third party copyrights are property of their respective owners.
//
// Redistribution and use in source and binary forms, with or without modification,
// are permitted provided that the following conditions are met:
//
// * Redistribution's of source code must retain the above copyright notice,
// this list of conditions and the following disclaimer.
//
// * Redistribution's 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.
//
// * The name of the copyright holders may not be used to endorse or promote products
// derived from this software without specific prior written permission.
//
// This software is provided by the copyright holders and contributors "as is" and
// any express or implied warranties, including, but not limited to, the implied
// warranties of merchantability and fitness for a particular purpose are disclaimed.
// In no event shall the OpenCV Foundation 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.
//
//M*/
#ifndef __OPENCV_OPENCL_HPP__
#define __OPENCV_OPENCL_HPP__
#include "opencv2/core.hpp"
namespace cv { namespace ocl {
//! @addtogroup core_opencl
//! @{
CV_EXPORTS_W bool haveOpenCL();
CV_EXPORTS_W bool useOpenCL();
CV_EXPORTS_W bool haveAmdBlas();
CV_EXPORTS_W bool haveAmdFft();
CV_EXPORTS_W void setUseOpenCL(bool flag);
CV_EXPORTS_W void finish();
CV_EXPORTS bool haveSVM();
class CV_EXPORTS Context;
class CV_EXPORTS Device;
class CV_EXPORTS Kernel;
class CV_EXPORTS Program;
class CV_EXPORTS ProgramSource;
class CV_EXPORTS Queue;
class CV_EXPORTS PlatformInfo;
class CV_EXPORTS Image2D;
class CV_EXPORTS Device
{
public:
Device();
explicit Device(void* d);
Device(const Device& d);
Device& operator = (const Device& d);
~Device();
void set(void* d);
enum
{
TYPE_DEFAULT = (1 << 0),
TYPE_CPU = (1 << 1),
TYPE_GPU = (1 << 2),
TYPE_ACCELERATOR = (1 << 3),
TYPE_DGPU = TYPE_GPU + (1 << 16),
TYPE_IGPU = TYPE_GPU + (1 << 17),
TYPE_ALL = 0xFFFFFFFF
};
String name() const;
String extensions() const;
String version() const;
String vendorName() const;
String OpenCL_C_Version() const;
String OpenCLVersion() const;
int deviceVersionMajor() const;
int deviceVersionMinor() const;
String driverVersion() const;
void* ptr() const;
int type() const;
int addressBits() const;
bool available() const;
bool compilerAvailable() const;
bool linkerAvailable() const;
enum
{
FP_DENORM=(1 << 0),
FP_INF_NAN=(1 << 1),
FP_ROUND_TO_NEAREST=(1 << 2),
FP_ROUND_TO_ZERO=(1 << 3),
FP_ROUND_TO_INF=(1 << 4),
FP_FMA=(1 << 5),
FP_SOFT_FLOAT=(1 << 6),
FP_CORRECTLY_ROUNDED_DIVIDE_SQRT=(1 << 7)
};
int doubleFPConfig() const;
int singleFPConfig() const;
int halfFPConfig() const;
bool endianLittle() const;
bool errorCorrectionSupport() const;
enum
{
EXEC_KERNEL=(1 << 0),
EXEC_NATIVE_KERNEL=(1 << 1)
};
int executionCapabilities() const;
size_t globalMemCacheSize() const;
enum
{
NO_CACHE=0,
READ_ONLY_CACHE=1,
READ_WRITE_CACHE=2
};
int globalMemCacheType() const;
int globalMemCacheLineSize() const;
size_t globalMemSize() const;
size_t localMemSize() const;
enum
{
NO_LOCAL_MEM=0,
LOCAL_IS_LOCAL=1,
LOCAL_IS_GLOBAL=2
};
int localMemType() const;
bool hostUnifiedMemory() const;
bool imageSupport() const;
bool imageFromBufferSupport() const;
uint imagePitchAlignment() const;
uint imageBaseAddressAlignment() const;
size_t image2DMaxWidth() const;
size_t image2DMaxHeight() const;
size_t image3DMaxWidth() const;
size_t image3DMaxHeight() const;
size_t image3DMaxDepth() const;
size_t imageMaxBufferSize() const;
size_t imageMaxArraySize() const;
enum
{
UNKNOWN_VENDOR=0,
VENDOR_AMD=1,
VENDOR_INTEL=2,
VENDOR_NVIDIA=3
};
int vendorID() const;
// FIXIT
// dev.isAMD() doesn't work for OpenCL CPU devices from AMD OpenCL platform.
// This method should use platform name instead of vendor name.
// After fix restore code in arithm.cpp: ocl_compare()
inline bool isAMD() const { return vendorID() == VENDOR_AMD; }
inline bool isIntel() const { return vendorID() == VENDOR_INTEL; }
inline bool isNVidia() const { return vendorID() == VENDOR_NVIDIA; }
int maxClockFrequency() const;
int maxComputeUnits() const;
int maxConstantArgs() const;
size_t maxConstantBufferSize() const;
size_t maxMemAllocSize() const;
size_t maxParameterSize() const;
int maxReadImageArgs() const;
int maxWriteImageArgs() const;
int maxSamplers() const;
size_t maxWorkGroupSize() const;
int maxWorkItemDims() const;
void maxWorkItemSizes(size_t*) const;
int memBaseAddrAlign() const;
int nativeVectorWidthChar() const;
int nativeVectorWidthShort() const;
int nativeVectorWidthInt() const;
int nativeVectorWidthLong() const;
int nativeVectorWidthFloat() const;
int nativeVectorWidthDouble() const;
int nativeVectorWidthHalf() const;
int preferredVectorWidthChar() const;
int preferredVectorWidthShort() const;
int preferredVectorWidthInt() const;
int preferredVectorWidthLong() const;
int preferredVectorWidthFloat() const;
int preferredVectorWidthDouble() const;
int preferredVectorWidthHalf() const;
size_t printfBufferSize() const;
size_t profilingTimerResolution() const;
static const Device& getDefault();
protected:
struct Impl;
Impl* p;
};
class CV_EXPORTS Context
{
public:
Context();
explicit Context(int dtype);
~Context();
Context(const Context& c);
Context& operator = (const Context& c);
bool create();
bool create(int dtype);
size_t ndevices() const;
const Device& device(size_t idx) const;
Program getProg(const ProgramSource& prog,
const String& buildopt, String& errmsg);
static Context& getDefault(bool initialize = true);
void* ptr() const;
friend void initializeContextFromHandle(Context& ctx, void* platform, void* context, void* device);
bool useSVM() const;
void setUseSVM(bool enabled);
struct Impl;
Impl* p;
};
class CV_EXPORTS Platform
{
public:
Platform();
~Platform();
Platform(const Platform& p);
Platform& operator = (const Platform& p);
void* ptr() const;
static Platform& getDefault();
friend void initializeContextFromHandle(Context& ctx, void* platform, void* context, void* device);
protected:
struct Impl;
Impl* p;
};
// TODO Move to internal header
void initializeContextFromHandle(Context& ctx, void* platform, void* context, void* device);
class CV_EXPORTS Queue
{
public:
Queue();
explicit Queue(const Context& c, const Device& d=Device());
~Queue();
Queue(const Queue& q);
Queue& operator = (const Queue& q);
bool create(const Context& c=Context(), const Device& d=Device());
void finish();
void* ptr() const;
static Queue& getDefault();
protected:
struct Impl;
Impl* p;
};
class CV_EXPORTS KernelArg
{
public:
enum { LOCAL=1, READ_ONLY=2, WRITE_ONLY=4, READ_WRITE=6, CONSTANT=8, PTR_ONLY = 16, NO_SIZE=256 };
KernelArg(int _flags, UMat* _m, int wscale=1, int iwscale=1, const void* _obj=0, size_t _sz=0);
KernelArg();
static KernelArg Local() { return KernelArg(LOCAL, 0); }
static KernelArg PtrWriteOnly(const UMat& m)
{ return KernelArg(PTR_ONLY+WRITE_ONLY, (UMat*)&m); }
static KernelArg PtrReadOnly(const UMat& m)
{ return KernelArg(PTR_ONLY+READ_ONLY, (UMat*)&m); }
static KernelArg PtrReadWrite(const UMat& m)
{ return KernelArg(PTR_ONLY+READ_WRITE, (UMat*)&m); }
static KernelArg ReadWrite(const UMat& m, int wscale=1, int iwscale=1)
{ return KernelArg(READ_WRITE, (UMat*)&m, wscale, iwscale); }
static KernelArg ReadWriteNoSize(const UMat& m, int wscale=1, int iwscale=1)
{ return KernelArg(READ_WRITE+NO_SIZE, (UMat*)&m, wscale, iwscale); }
static KernelArg ReadOnly(const UMat& m, int wscale=1, int iwscale=1)
{ return KernelArg(READ_ONLY, (UMat*)&m, wscale, iwscale); }
static KernelArg WriteOnly(const UMat& m, int wscale=1, int iwscale=1)
{ return KernelArg(WRITE_ONLY, (UMat*)&m, wscale, iwscale); }
static KernelArg ReadOnlyNoSize(const UMat& m, int wscale=1, int iwscale=1)
{ return KernelArg(READ_ONLY+NO_SIZE, (UMat*)&m, wscale, iwscale); }
static KernelArg WriteOnlyNoSize(const UMat& m, int wscale=1, int iwscale=1)
{ return KernelArg(WRITE_ONLY+NO_SIZE, (UMat*)&m, wscale, iwscale); }
static KernelArg Constant(const Mat& m);
template<typename _Tp> static KernelArg Constant(const _Tp* arr, size_t n)
{ return KernelArg(CONSTANT, 0, 1, 1, (void*)arr, n); }
int flags;
UMat* m;
const void* obj;
size_t sz;
int wscale, iwscale;
};
class CV_EXPORTS Kernel
{
public:
Kernel();
Kernel(const char* kname, const Program& prog);
Kernel(const char* kname, const ProgramSource& prog,
const String& buildopts = String(), String* errmsg=0);
~Kernel();
Kernel(const Kernel& k);
Kernel& operator = (const Kernel& k);
bool empty() const;
bool create(const char* kname, const Program& prog);
bool create(const char* kname, const ProgramSource& prog,
const String& buildopts, String* errmsg=0);
int set(int i, const void* value, size_t sz);
int set(int i, const Image2D& image2D);
int set(int i, const UMat& m);
int set(int i, const KernelArg& arg);
template<typename _Tp> int set(int i, const _Tp& value)
{ return set(i, &value, sizeof(value)); }
template<typename _Tp0>
Kernel& args(const _Tp0& a0)
{
set(0, a0); return *this;
}
template<typename _Tp0, typename _Tp1>
Kernel& args(const _Tp0& a0, const _Tp1& a1)
{
int i = set(0, a0); set(i, a1); return *this;
}
template<typename _Tp0, typename _Tp1, typename _Tp2>
Kernel& args(const _Tp0& a0, const _Tp1& a1, const _Tp2& a2)
{
int i = set(0, a0); i = set(i, a1); set(i, a2); return *this;
}
template<typename _Tp0, typename _Tp1, typename _Tp2, typename _Tp3>
Kernel& args(const _Tp0& a0, const _Tp1& a1, const _Tp2& a2, const _Tp3& a3)
{
int i = set(0, a0); i = set(i, a1); i = set(i, a2); i = set(i, a3); return *this;
}
template<typename _Tp0, typename _Tp1, typename _Tp2, typename _Tp3, typename _Tp4>
Kernel& args(const _Tp0& a0, const _Tp1& a1, const _Tp2& a2,
const _Tp3& a3, const _Tp4& a4)
{
int i = set(0, a0); i = set(i, a1); i = set(i, a2);
i = set(i, a3); set(i, a4); return *this;
}
template<typename _Tp0, typename _Tp1, typename _Tp2,
typename _Tp3, typename _Tp4, typename _Tp5>
Kernel& args(const _Tp0& a0, const _Tp1& a1, const _Tp2& a2,
const _Tp3& a3, const _Tp4& a4, const _Tp5& a5)
{
int i = set(0, a0); i = set(i, a1); i = set(i, a2);
i = set(i, a3); i = set(i, a4); set(i, a5); return *this;
}
template<typename _Tp0, typename _Tp1, typename _Tp2, typename _Tp3,
typename _Tp4, typename _Tp5, typename _Tp6>
Kernel& args(const _Tp0& a0, const _Tp1& a1, const _Tp2& a2, const _Tp3& a3,
const _Tp4& a4, const _Tp5& a5, const _Tp6& a6)
{
int i = set(0, a0); i = set(i, a1); i = set(i, a2); i = set(i, a3);
i = set(i, a4); i = set(i, a5); set(i, a6); return *this;
}
template<typename _Tp0, typename _Tp1, typename _Tp2, typename _Tp3,
typename _Tp4, typename _Tp5, typename _Tp6, typename _Tp7>
Kernel& args(const _Tp0& a0, const _Tp1& a1, const _Tp2& a2, const _Tp3& a3,
const _Tp4& a4, const _Tp5& a5, const _Tp6& a6, const _Tp7& a7)
{
int i = set(0, a0); i = set(i, a1); i = set(i, a2); i = set(i, a3);
i = set(i, a4); i = set(i, a5); i = set(i, a6); set(i, a7); return *this;
}
template<typename _Tp0, typename _Tp1, typename _Tp2, typename _Tp3, typename _Tp4,
typename _Tp5, typename _Tp6, typename _Tp7, typename _Tp8>
Kernel& args(const _Tp0& a0, const _Tp1& a1, const _Tp2& a2, const _Tp3& a3,
const _Tp4& a4, const _Tp5& a5, const _Tp6& a6, const _Tp7& a7,
const _Tp8& a8)
{
int i = set(0, a0); i = set(i, a1); i = set(i, a2); i = set(i, a3); i = set(i, a4);
i = set(i, a5); i = set(i, a6); i = set(i, a7); set(i, a8); return *this;
}
template<typename _Tp0, typename _Tp1, typename _Tp2, typename _Tp3, typename _Tp4,
typename _Tp5, typename _Tp6, typename _Tp7, typename _Tp8, typename _Tp9>
Kernel& args(const _Tp0& a0, const _Tp1& a1, const _Tp2& a2, const _Tp3& a3,
const _Tp4& a4, const _Tp5& a5, const _Tp6& a6, const _Tp7& a7,
const _Tp8& a8, const _Tp9& a9)
{
int i = set(0, a0); i = set(i, a1); i = set(i, a2); i = set(i, a3); i = set(i, a4); i = set(i, a5);
i = set(i, a6); i = set(i, a7); i = set(i, a8); set(i, a9); return *this;
}
template<typename _Tp0, typename _Tp1, typename _Tp2, typename _Tp3,
typename _Tp4, typename _Tp5, typename _Tp6, typename _Tp7,
typename _Tp8, typename _Tp9, typename _Tp10>
Kernel& args(const _Tp0& a0, const _Tp1& a1, const _Tp2& a2, const _Tp3& a3,
const _Tp4& a4, const _Tp5& a5, const _Tp6& a6, const _Tp7& a7,
const _Tp8& a8, const _Tp9& a9, const _Tp10& a10)
{
int i = set(0, a0); i = set(i, a1); i = set(i, a2); i = set(i, a3); i = set(i, a4); i = set(i, a5);
i = set(i, a6); i = set(i, a7); i = set(i, a8); i = set(i, a9); set(i, a10); return *this;
}
template<typename _Tp0, typename _Tp1, typename _Tp2, typename _Tp3,
typename _Tp4, typename _Tp5, typename _Tp6, typename _Tp7,
typename _Tp8, typename _Tp9, typename _Tp10, typename _Tp11>
Kernel& args(const _Tp0& a0, const _Tp1& a1, const _Tp2& a2, const _Tp3& a3,
const _Tp4& a4, const _Tp5& a5, const _Tp6& a6, const _Tp7& a7,
const _Tp8& a8, const _Tp9& a9, const _Tp10& a10, const _Tp11& a11)
{
int i = set(0, a0); i = set(i, a1); i = set(i, a2); i = set(i, a3); i = set(i, a4); i = set(i, a5);
i = set(i, a6); i = set(i, a7); i = set(i, a8); i = set(i, a9); i = set(i, a10); set(i, a11); return *this;
}
template<typename _Tp0, typename _Tp1, typename _Tp2, typename _Tp3,
typename _Tp4, typename _Tp5, typename _Tp6, typename _Tp7,
typename _Tp8, typename _Tp9, typename _Tp10, typename _Tp11, typename _Tp12>
Kernel& args(const _Tp0& a0, const _Tp1& a1, const _Tp2& a2, const _Tp3& a3,
const _Tp4& a4, const _Tp5& a5, const _Tp6& a6, const _Tp7& a7,
const _Tp8& a8, const _Tp9& a9, const _Tp10& a10, const _Tp11& a11,
const _Tp12& a12)
{
int i = set(0, a0); i = set(i, a1); i = set(i, a2); i = set(i, a3); i = set(i, a4); i = set(i, a5);
i = set(i, a6); i = set(i, a7); i = set(i, a8); i = set(i, a9); i = set(i, a10); i = set(i, a11);
set(i, a12); return *this;
}
template<typename _Tp0, typename _Tp1, typename _Tp2, typename _Tp3,
typename _Tp4, typename _Tp5, typename _Tp6, typename _Tp7,
typename _Tp8, typename _Tp9, typename _Tp10, typename _Tp11, typename _Tp12,
typename _Tp13>
Kernel& args(const _Tp0& a0, const _Tp1& a1, const _Tp2& a2, const _Tp3& a3,
const _Tp4& a4, const _Tp5& a5, const _Tp6& a6, const _Tp7& a7,
const _Tp8& a8, const _Tp9& a9, const _Tp10& a10, const _Tp11& a11,
const _Tp12& a12, const _Tp13& a13)
{
int i = set(0, a0); i = set(i, a1); i = set(i, a2); i = set(i, a3); i = set(i, a4); i = set(i, a5);
i = set(i, a6); i = set(i, a7); i = set(i, a8); i = set(i, a9); i = set(i, a10); i = set(i, a11);
i = set(i, a12); set(i, a13); return *this;
}
template<typename _Tp0, typename _Tp1, typename _Tp2, typename _Tp3,
typename _Tp4, typename _Tp5, typename _Tp6, typename _Tp7,
typename _Tp8, typename _Tp9, typename _Tp10, typename _Tp11, typename _Tp12,
typename _Tp13, typename _Tp14>
Kernel& args(const _Tp0& a0, const _Tp1& a1, const _Tp2& a2, const _Tp3& a3,
const _Tp4& a4, const _Tp5& a5, const _Tp6& a6, const _Tp7& a7,
const _Tp8& a8, const _Tp9& a9, const _Tp10& a10, const _Tp11& a11,
const _Tp12& a12, const _Tp13& a13, const _Tp14& a14)
{
int i = set(0, a0); i = set(i, a1); i = set(i, a2); i = set(i, a3); i = set(i, a4); i = set(i, a5);
i = set(i, a6); i = set(i, a7); i = set(i, a8); i = set(i, a9); i = set(i, a10); i = set(i, a11);
i = set(i, a12); i = set(i, a13); set(i, a14); return *this;
}
template<typename _Tp0, typename _Tp1, typename _Tp2, typename _Tp3,
typename _Tp4, typename _Tp5, typename _Tp6, typename _Tp7,
typename _Tp8, typename _Tp9, typename _Tp10, typename _Tp11, typename _Tp12,
typename _Tp13, typename _Tp14, typename _Tp15>
Kernel& args(const _Tp0& a0, const _Tp1& a1, const _Tp2& a2, const _Tp3& a3,
const _Tp4& a4, const _Tp5& a5, const _Tp6& a6, const _Tp7& a7,
const _Tp8& a8, const _Tp9& a9, const _Tp10& a10, const _Tp11& a11,
const _Tp12& a12, const _Tp13& a13, const _Tp14& a14, const _Tp15& a15)
{
int i = set(0, a0); i = set(i, a1); i = set(i, a2); i = set(i, a3); i = set(i, a4); i = set(i, a5);
i = set(i, a6); i = set(i, a7); i = set(i, a8); i = set(i, a9); i = set(i, a10); i = set(i, a11);
i = set(i, a12); i = set(i, a13); i = set(i, a14); set(i, a15); return *this;
}
bool run(int dims, size_t globalsize[],
size_t localsize[], bool sync, const Queue& q=Queue());
bool runTask(bool sync, const Queue& q=Queue());
size_t workGroupSize() const;
size_t preferedWorkGroupSizeMultiple() const;
bool compileWorkGroupSize(size_t wsz[]) const;
size_t localMemSize() const;
void* ptr() const;
struct Impl;
protected:
Impl* p;
};
class CV_EXPORTS Program
{
public:
Program();
Program(const ProgramSource& src,
const String& buildflags, String& errmsg);
explicit Program(const String& buf);
Program(const Program& prog);
Program& operator = (const Program& prog);
~Program();
bool create(const ProgramSource& src,
const String& buildflags, String& errmsg);
bool read(const String& buf, const String& buildflags);
bool write(String& buf) const;
const ProgramSource& source() const;
void* ptr() const;
String getPrefix() const;
static String getPrefix(const String& buildflags);
protected:
struct Impl;
Impl* p;
};
class CV_EXPORTS ProgramSource
{
public:
typedef uint64 hash_t;
ProgramSource();
explicit ProgramSource(const String& prog);
explicit ProgramSource(const char* prog);
~ProgramSource();
ProgramSource(const ProgramSource& prog);
ProgramSource& operator = (const ProgramSource& prog);
const String& source() const;
hash_t hash() const;
protected:
struct Impl;
Impl* p;
};
class CV_EXPORTS PlatformInfo
{
public:
PlatformInfo();
explicit PlatformInfo(void* id);
~PlatformInfo();
PlatformInfo(const PlatformInfo& i);
PlatformInfo& operator =(const PlatformInfo& i);
String name() const;
String vendor() const;
String version() const;
int deviceNumber() const;
void getDevice(Device& device, int d) const;
protected:
struct Impl;
Impl* p;
};
CV_EXPORTS const char* convertTypeStr(int sdepth, int ddepth, int cn, char* buf);
CV_EXPORTS const char* typeToStr(int t);
CV_EXPORTS const char* memopTypeToStr(int t);
CV_EXPORTS const char* vecopTypeToStr(int t);
CV_EXPORTS String kernelToStr(InputArray _kernel, int ddepth = -1, const char * name = NULL);
CV_EXPORTS void getPlatfomsInfo(std::vector<PlatformInfo>& platform_info);
enum OclVectorStrategy
{
// all matrices have its own vector width
OCL_VECTOR_OWN = 0,
// all matrices have maximal vector width among all matrices
// (useful for cases when matrices have different data types)
OCL_VECTOR_MAX = 1,
// default strategy
OCL_VECTOR_DEFAULT = OCL_VECTOR_OWN
};
CV_EXPORTS int predictOptimalVectorWidth(InputArray src1, InputArray src2 = noArray(), InputArray src3 = noArray(),
InputArray src4 = noArray(), InputArray src5 = noArray(), InputArray src6 = noArray(),
InputArray src7 = noArray(), InputArray src8 = noArray(), InputArray src9 = noArray(),
OclVectorStrategy strat = OCL_VECTOR_DEFAULT);
CV_EXPORTS int checkOptimalVectorWidth(const int *vectorWidths,
InputArray src1, InputArray src2 = noArray(), InputArray src3 = noArray(),
InputArray src4 = noArray(), InputArray src5 = noArray(), InputArray src6 = noArray(),
InputArray src7 = noArray(), InputArray src8 = noArray(), InputArray src9 = noArray(),
OclVectorStrategy strat = OCL_VECTOR_DEFAULT);
// with OCL_VECTOR_MAX strategy
CV_EXPORTS int predictOptimalVectorWidthMax(InputArray src1, InputArray src2 = noArray(), InputArray src3 = noArray(),
InputArray src4 = noArray(), InputArray src5 = noArray(), InputArray src6 = noArray(),
InputArray src7 = noArray(), InputArray src8 = noArray(), InputArray src9 = noArray());
CV_EXPORTS void buildOptionsAddMatrixDescription(String& buildOptions, const String& name, InputArray _m);
class CV_EXPORTS Image2D
{
public:
Image2D();
// src: The UMat from which to get image properties and data
// norm: Flag to enable the use of normalized channel data types
// alias: Flag indicating that the image should alias the src UMat.
// If true, changes to the image or src will be reflected in
// both objects.
explicit Image2D(const UMat &src, bool norm = false, bool alias = false);
Image2D(const Image2D & i);
~Image2D();
Image2D & operator = (const Image2D & i);
// Indicates if creating an aliased image should succeed. Depends on the
// underlying platform and the dimensions of the UMat.
static bool canCreateAlias(const UMat &u);
// Indicates if the image format is supported.
static bool isFormatSupported(int depth, int cn, bool norm);
void* ptr() const;
protected:
struct Impl;
Impl* p;
};
CV_EXPORTS MatAllocator* getOpenCLAllocator();
#ifdef __OPENCV_BUILD
namespace internal {
CV_EXPORTS bool isPerformanceCheckBypassed();
#define OCL_PERFORMANCE_CHECK(condition) (cv::ocl::internal::isPerformanceCheckBypassed() || (condition))
CV_EXPORTS bool isCLBuffer(UMat& u);
} // namespace internal
#endif
//! @}
}}
#endif
|
{
"pile_set_name": "Github"
}
|
//
// Created by cpasjuste on 07/12/18.
//
#include "cross2d/c2d.h"
#include "main.h"
#include "menu_main_options.h"
using namespace c2d;
MenuMainOptions::MenuMainOptions(Main *main, const c2d::FloatRect &rect, const std::vector<MenuItem> &items)
: Menu(main, rect, "OPTIONS", items, true) {
}
void MenuMainOptions::onOptionSelection(MenuItem *item) {
setVisibility(Visibility::Hidden);
main->getMenuMain()->getMenuMainOptionsSubmenu(item->name)->setVisibility(Visibility::Visible);
}
bool MenuMainOptions::onInput(c2d::Input::Player *players) {
if (players[0].keys & Input::Right || players[0].keys & Input::Key::Fire2) {
setVisibility(Visibility::Hidden, true);
main->getMenuMain()->setVisibility(Visibility::Visible, true);
return true;
}
if (players[0].keys & Input::Left) {
onOptionSelection(getSelection());
return true;
}
return Menu::onInput(players);
}
|
{
"pile_set_name": "Github"
}
|
{
"version": "1.0",
"examples": {
"DescribeStream": [
{
"input": {
"StreamArn": "arn:aws:dynamodb:us-west-2:111122223333:table/Forum/stream/2015-05-20T20:51:10.252"
},
"output": {
"StreamDescription": {
"CreationRequestDateTime": "Wed May 20 13:51:10 PDT 2015",
"KeySchema": [
{
"AttributeName": "ForumName",
"KeyType": "HASH"
},
{
"AttributeName": "Subject",
"KeyType": "RANGE"
}
],
"Shards": [
{
"SequenceNumberRange": {
"EndingSequenceNumber": "20500000000000000910398",
"StartingSequenceNumber": "20500000000000000910398"
},
"ShardId": "shardId-00000001414562045508-2bac9cd2"
},
{
"ParentShardId": "shardId-00000001414562045508-2bac9cd2",
"SequenceNumberRange": {
"EndingSequenceNumber": "820400000000000001192334",
"StartingSequenceNumber": "820400000000000001192334"
},
"ShardId": "shardId-00000001414576573621-f55eea83"
},
{
"ParentShardId": "shardId-00000001414576573621-f55eea83",
"SequenceNumberRange": {
"EndingSequenceNumber": "1683700000000000001135967",
"StartingSequenceNumber": "1683700000000000001135967"
},
"ShardId": "shardId-00000001414592258131-674fd923"
},
{
"ParentShardId": "shardId-00000001414592258131-674fd923",
"SequenceNumberRange": {
"StartingSequenceNumber": "2574600000000000000935255"
},
"ShardId": "shardId-00000001414608446368-3a1afbaf"
}
],
"StreamArn": "arn:aws:dynamodb:us-west-2:111122223333:table/Forum/stream/2015-05-20T20:51:10.252",
"StreamLabel": "2015-05-20T20:51:10.252",
"StreamStatus": "ENABLED",
"StreamViewType": "NEW_AND_OLD_IMAGES",
"TableName": "Forum"
}
},
"comments": {
"input": {
},
"output": {
}
},
"description": "The following example describes a stream with a given stream ARN.",
"id": "to-describe-a-stream-with-a-given-stream-arn-1473457835200",
"title": "To describe a stream with a given stream ARN"
}
],
"GetRecords": [
{
"input": {
"ShardIterator": "arn:aws:dynamodb:us-west-2:111122223333:table/Forum/stream/2015-05-20T20:51:10.252|1|AAAAAAAAAAEvJp6D+zaQ... <remaining characters omitted> ..."
},
"output": {
"NextShardIterator": "arn:aws:dynamodb:us-west-2:111122223333:table/Forum/stream/2015-05-20T20:51:10.252|1|AAAAAAAAAAGQBYshYDEe ... <remaining characters omitted> ...",
"Records": [
{
"awsRegion": "us-west-2",
"dynamodb": {
"ApproximateCreationDateTime": "1.46480646E9",
"Keys": {
"ForumName": {
"S": "DynamoDB"
},
"Subject": {
"S": "DynamoDB Thread 3"
}
},
"SequenceNumber": "300000000000000499659",
"SizeBytes": 41,
"StreamViewType": "KEYS_ONLY"
},
"eventID": "e2fd9c34eff2d779b297b26f5fef4206",
"eventName": "INSERT",
"eventSource": "aws:dynamodb",
"eventVersion": "1.0"
},
{
"awsRegion": "us-west-2",
"dynamodb": {
"ApproximateCreationDateTime": "1.46480527E9",
"Keys": {
"ForumName": {
"S": "DynamoDB"
},
"Subject": {
"S": "DynamoDB Thread 1"
}
},
"SequenceNumber": "400000000000000499660",
"SizeBytes": 41,
"StreamViewType": "KEYS_ONLY"
},
"eventID": "4b25bd0da9a181a155114127e4837252",
"eventName": "MODIFY",
"eventSource": "aws:dynamodb",
"eventVersion": "1.0"
},
{
"awsRegion": "us-west-2",
"dynamodb": {
"ApproximateCreationDateTime": "1.46480646E9",
"Keys": {
"ForumName": {
"S": "DynamoDB"
},
"Subject": {
"S": "DynamoDB Thread 2"
}
},
"SequenceNumber": "500000000000000499661",
"SizeBytes": 41,
"StreamViewType": "KEYS_ONLY"
},
"eventID": "740280c73a3df7842edab3548a1b08ad",
"eventName": "REMOVE",
"eventSource": "aws:dynamodb",
"eventVersion": "1.0"
}
]
},
"comments": {
"input": {
},
"output": {
}
},
"description": "The following example retrieves all the stream records from a shard.",
"id": "to-retrieve-all-the-stream-records-from-a-shard-1473707781419",
"title": "To retrieve all the stream records from a shard"
}
],
"GetShardIterator": [
{
"input": {
"ShardId": "00000001414576573621-f55eea83",
"ShardIteratorType": "TRIM_HORIZON",
"StreamArn": "arn:aws:dynamodb:us-west-2:111122223333:table/Forum/stream/2015-05-20T20:51:10.252"
},
"output": {
"ShardIterator": "arn:aws:dynamodb:us-west-2:111122223333:table/Forum/stream/2015-05-20T20:51:10.252|1|AAAAAAAAAAEvJp6D+zaQ... <remaining characters omitted> ..."
},
"comments": {
"input": {
},
"output": {
}
},
"description": "The following example returns a shard iterator for the provided stream ARN and shard ID.",
"id": "to-obtain-a-shard-iterator-for-the-provided-stream-arn-and-shard-id-1473459941476",
"title": "To obtain a shard iterator for the provided stream ARN and shard ID"
}
],
"ListStreams": [
{
"input": {
},
"output": {
"Streams": [
{
"StreamArn": "arn:aws:dynamodb:us-wesst-2:111122223333:table/Forum/stream/2015-05-20T20:51:10.252",
"StreamLabel": "2015-05-20T20:51:10.252",
"TableName": "Forum"
},
{
"StreamArn": "arn:aws:dynamodb:us-west-2:111122223333:table/Forum/stream/2015-05-20T20:50:02.714",
"StreamLabel": "2015-05-20T20:50:02.714",
"TableName": "Forum"
},
{
"StreamArn": "arn:aws:dynamodb:us-west-2:111122223333:table/Forum/stream/2015-05-19T23:03:50.641",
"StreamLabel": "2015-05-19T23:03:50.641",
"TableName": "Forum"
}
]
},
"comments": {
"input": {
},
"output": {
}
},
"description": "The following example lists all of the stream ARNs.",
"id": "to-list-all-of-the-stream-arns--1473459534285",
"title": "To list all of the stream ARNs "
}
]
}
}
|
{
"pile_set_name": "Github"
}
|
import AppKit
extension HistoryMenuItem {
class CopyMenuItem: HistoryMenuItem {
static var keyEquivalentModifierMask: NSEvent.ModifierFlags {
if UserDefaults.standard.pasteByDefault {
return .option
} else {
return .command
}
}
override func select() {
clipboard.copy(item)
}
override func alternate() {
keyEquivalentModifierMask = CopyMenuItem.keyEquivalentModifierMask
if UserDefaults.standard.pasteByDefault {
isAlternate = true
isHidden = true
}
}
}
}
|
{
"pile_set_name": "Github"
}
|
#ifndef BOOST_MPL_AUX_CONFIG_USE_PREPROCESSED_HPP_INCLUDED
#define BOOST_MPL_AUX_CONFIG_USE_PREPROCESSED_HPP_INCLUDED
// Copyright Aleksey Gurtovoy 2000-2004
//
// Distributed under the Boost Software License, Version 1.0.
// (See accompanying file LICENSE_1_0.txt or copy at
// http://www.boost.org/LICENSE_1_0.txt)
//
// See http://www.boost.org/libs/mpl for documentation.
// $Id$
// $Date$
// $Revision$
// #define BOOST_MPL_CFG_NO_PREPROCESSED_HEADERS
#endif // BOOST_MPL_AUX_CONFIG_USE_PREPROCESSED_HPP_INCLUDED
|
{
"pile_set_name": "Github"
}
|
# -*- coding: utf-8 -*-
from fractions import Fraction
from .account import Account
from .amount import Amount
from .asset import Asset
from .exceptions import InvalidAssetException
from .instance import BlockchainInstance
from .utils import assets_from_string, formatTimeString, parse_time
from graphenecommon.price import Price as GraphenePrice
@BlockchainInstance.inject
class Price(GraphenePrice):
"""
This class deals with all sorts of prices of any pair of assets to simplify dealing
with the tuple::
(quote, base)
each being an instance of :class:`bitshares.amount.Amount`. The
amount themselves define the price.
.. note::
The price (floating) is derived as ``base/quote``
:param list args: Allows to deal with different representations of a price
:param bitshares.asset.Asset base: Base asset
:param bitshares.asset.Asset quote: Quote asset
:param bitshares.bitshares.BitShares blockchain_instance: BitShares instance
:returns: All data required to represent a price
:rtype: dict
Way to obtain a proper instance:
* ``args`` is a str with a price and two assets
* ``args`` can be a floating number and ``base`` and ``quote`` being instances of :class:`bitshares.asset.Asset`
* ``args`` can be a floating number and ``base`` and ``quote`` being instances of ``str``
* ``args`` can be dict with keys ``price``, ``base``, and ``quote`` (*graphene balances*)
* ``args`` can be dict with keys ``base`` and ``quote``
* ``args`` can be dict with key ``receives`` (filled orders)
* ``args`` being a list of ``[quote, base]`` both being instances of :class:`bitshares.amount.Amount`
* ``args`` being a list of ``[quote, base]`` both being instances of ``str`` (``amount symbol``)
* ``base`` and ``quote`` being instances of :class:`bitshares.asset.Amount`
This allows instanciations like:
* ``Price("0.315 USD/BTS")``
* ``Price(0.315, base="USD", quote="BTS")``
* ``Price(0.315, base=Asset("USD"), quote=Asset("BTS"))``
* ``Price({"base": {"amount": 1, "asset_id": "1.3.0"}, "quote": {"amount": 10, "asset_id": "1.3.106"}})``
* ``Price({"receives": {"amount": 1, "asset_id": "1.3.0"}, "pays": {"amount": 10, "asset_id": "1.3.106"}}, base_asset=Asset("1.3.0"))``
* ``Price(quote="10 GOLD", base="1 USD")``
* ``Price("10 GOLD", "1 USD")``
* ``Price(Amount("10 GOLD"), Amount("1 USD"))``
* ``Price(1.0, "USD/GOLD")``
Instances of this class can be used in regular mathematical expressions
(``+-*/%``) such as:
.. code-block:: python
>>> from bitshares.price import Price
>>> Price("0.3314 USD/BTS") * 2
0.662600000 USD/BTS
"""
def define_classes(self):
self.amount_class = Amount
self.asset_class = Asset
@property
def market(self):
"""
Open the corresponding market.
:returns: Instance of :class:`bitshares.market.Market` for the
corresponding pair of assets.
"""
from .market import Market
return Market(
base=self["base"]["asset"],
quote=self["quote"]["asset"],
blockchain_instance=self.blockchain,
)
class Order(Price):
"""
This class inherits :class:`bitshares.price.Price` but has the ``base`` and
``quote`` Amounts not only be used to represent the price (as a ratio of base and
quote) but instead has those amounts represent the amounts of an actual order!
:param bitshares.bitshares.BitShares blockchain_instance: BitShares instance
.. note::
If an order is marked as deleted, it will carry the
'deleted' key which is set to ``True`` and all other
data be ``None``.
"""
def __init__(self, *args, **kwargs):
# This class does not have @BlockchainInstance.inject because of MRO, so we need
# to init BlockchainInstance manually! Fixes
# https://github.com/bitshares/python-bitshares/issues/234
BlockchainInstance.__init__(self, **kwargs)
if len(args) == 1 and isinstance(args[0], str):
"""Load from id."""
order = self.blockchain.rpc.get_objects([args[0]])[0]
if order:
Price.__init__(
self, order["sell_price"], blockchain_instance=self.blockchain
)
self.update(order)
self["deleted"] = False
else:
self["id"] = args[0]
self["deleted"] = True
self["quote"] = None
self["base"] = None
self["price"] = None
self["seller"] = None
elif len(args) == 1 and isinstance(args[0], dict) and "sell_price" in args[0]:
"""Load from object 1.7.xxx."""
# Take all the arguments with us
self.update(args[0])
Price.__init__(
self, args[0]["sell_price"], blockchain_instance=self.blockchain
)
elif (
len(args) == 1
and isinstance(args[0], dict)
and "min_to_receive" in args[0]
and "amount_to_sell" in args[0]
):
"""Load from an operation."""
# Take all the arguments with us
self.update(args[0])
Price.__init__(
self,
Amount(args[0]["min_to_receive"], blockchain_instance=self.blockchain),
Amount(args[0]["amount_to_sell"], blockchain_instance=self.blockchain),
)
else:
# Try load Order as Price
Price.__init__(self, *args, **kwargs)
if "for_sale" in self:
self["for_sale"] = Amount(
{"amount": self["for_sale"], "asset_id": self["base"]["asset"]["id"]},
blockchain_instance=self.blockchain,
)
@property
def for_sale(self):
if "for_sale" in self:
return Amount(
{"amount": self["for_sale"], "asset_id": self["base"]["asset"]["id"]},
blockchain_instance=self.blockchain,
)
@property
def price(self):
return self["price"]
@property
def to_buy(self):
if "for_sale" in self:
return Amount(
float(self["for_sale"]) / self["price"],
self["quote"]["asset"],
blockchain_instance=self.blockchain,
)
def __repr__(self):
if "deleted" in self and self["deleted"]:
return "deleted order %s" % self["id"]
else:
t = ""
if "time" in self and self["time"]:
t += "(%s) " % self["time"]
if "type" in self and self["type"]:
t += "%s " % str(self["type"])
if "for_sale" in self and self["for_sale"]:
t += "buy {} for {} ".format(
str(
Amount(
float(self["for_sale"]) / self["price"],
self["quote"]["asset"],
blockchain_instance=self.blockchain,
)
),
str(self["for_sale"]),
)
elif "amount_to_sell" in self:
t += "sell {} for {} ".format(
str(
Amount(
self["amount_to_sell"], blockchain_instance=self.blockchain
)
),
str(
Amount(
self["min_to_receive"], blockchain_instance=self.blockchain
)
),
)
elif "quote" in self and "base" in self:
t += "{} for {} ".format(
str(
Amount(
{
"amount": self["quote"],
"asset_id": self["quote"]["asset"]["id"],
},
blockchain_instance=self.blockchain,
)
),
str(
Amount(
{
"amount": self["base"],
"asset_id": self["base"]["asset"]["id"],
},
blockchain_instance=self.blockchain,
)
),
)
return t + "@ " + Price.__repr__(self)
__str__ = __repr__
class FilledOrder(Price):
"""
This class inherits :class:`bitshares.price.Price` but has the ``base`` and
``quote`` Amounts not only be used to represent the price (as a ratio of base and
quote) but instead has those amounts represent the amounts of an actually filled
order!
:param bitshares.bitshares.BitShares blockchain_instance: BitShares instance
.. note:: Instances of this class come with an additional ``time`` key
that shows when the order has been filled!
"""
def copy(self):
return self.__class__(
self.order, base=self["base"].copy(), quote=self["quote"].copy()
)
def __init__(self, order, **kwargs):
self.order = order
if isinstance(order, dict) and "price" in order:
Price.__init__(
self,
order.get("price"),
base=kwargs.get("base"),
quote=kwargs.get("quote"),
)
self.update(order)
self["time"] = formatTimeString(order["date"])
elif isinstance(order, dict):
# filled orders from account history
if "op" in order:
if isinstance(order["op"], (list, set)):
order = order["op"][1]
elif isinstance(order["op"], dict):
order = order["op"]
base_asset = kwargs.get("base_asset", order["receives"]["asset_id"])
Price.__init__(self, order, base_asset=base_asset)
# To be on the save side, store the entire order object in this
# dict as well
self.update(order)
# Post-Process some additional stuff
if "time" in order:
self["time"] = formatTimeString(order["time"])
if "account_id" in order:
self["account_id"] = order["account_id"]
else:
raise ValueError("Couldn't parse 'Price'.")
def __repr__(self):
t = ""
if "time" in self and self["time"]:
t += "(%s) " % self["time"]
if "type" in self and self["type"]:
t += "%s " % str(self["type"])
if "quote" in self and self["quote"]:
t += "%s " % str(self["quote"])
if "base" in self and self["base"]:
t += "%s " % str(self["base"])
return t + "@ " + Price.__repr__(self)
__str__ = __repr__
class UpdateCallOrder(Price):
""" This class inherits :class:`bitshares.price.Price` but has the ``base``
and ``quote`` Amounts not only be used to represent the **call
price** (as a ratio of base and quote).
:param bitshares.bitshares.BitShares blockchain_instance: BitShares instance
"""
def __init__(self, call, **kwargs):
BlockchainInstance.__init__(self, **kwargs)
if isinstance(call, dict) and "call_price" in call:
Price.__init__(
self,
call.get("call_price"),
base=call["call_price"].get("base"),
quote=call["call_price"].get("quote"),
)
else:
raise ValueError("Couldn't parse 'Call'.")
def __repr__(self):
t = "Margin Call: "
if "quote" in self and self["quote"]:
t += "%s " % str(self["quote"])
if "base" in self and self["base"]:
t += "%s " % str(self["base"])
return t + "@ " + Price.__repr__(self)
__str__ = __repr__
@BlockchainInstance.inject
class PriceFeed(dict):
"""
This class is used to represent a price feed consisting of.
* a witness,
* a symbol,
* a core exchange rate,
* the maintenance collateral ratio,
* the max short squeeze ratio,
* a settlement price, and
* a date
:param bitshares.bitshares.BitShares blockchain_instance: BitShares instance
"""
def __init__(self, feed, **kwargs):
if len(feed) == 2:
dict.__init__(
self,
{
"producer": Account(
feed[0], lazy=True, blockchain_instance=self.blockchain
),
"date": parse_time(feed[1][0]),
"maintenance_collateral_ratio": feed[1][1][
"maintenance_collateral_ratio"
],
"maximum_short_squeeze_ratio": feed[1][1][
"maximum_short_squeeze_ratio"
],
"settlement_price": Price(feed[1][1]["settlement_price"]),
"core_exchange_rate": Price(feed[1][1]["core_exchange_rate"]),
},
)
else:
dict.__init__(
self,
{
"maintenance_collateral_ratio": feed[
"maintenance_collateral_ratio"
],
"maximum_short_squeeze_ratio": feed["maximum_short_squeeze_ratio"],
"settlement_price": Price(feed["settlement_price"]),
"core_exchange_rate": Price(feed["core_exchange_rate"]),
},
)
|
{
"pile_set_name": "Github"
}
|
/**
* Copyright (c) 2016-present, Facebook, Inc.
* All rights reserved.
*
* This source code is licensed under the license found in the LICENSE file in
* the root directory of this source tree.
*/
#import "FBRetainCyclePresenter.h"
#import "FBMemoryProfilerPresenting.h"
#import "FBSingleRetainCycleViewController.h"
#import <FBRetainCycleDetector/FBObjectiveCGraphElement.h>
static NSString *const FBRetainCycleDetectorIdentifier = @"retain_cycle_detector_identifier";
static NSString *const FBRetainCycleFromMemoryProfilerPerfEvent = @"retain_cycle_detector_memory_profiler_perf";
@interface FBRetainCyclePresenter () <UITableViewDataSource, UITableViewDelegate>
@end
@implementation FBRetainCyclePresenter
{
NSArray<NSArray<FBObjectiveCGraphElement *> *> *_retainCycles;
__weak id<FBMemoryProfilerPresenting> _delegate;
UINavigationController *_resultsViewController;
}
- (instancetype)initWithDelegate:(id<FBMemoryProfilerPresenting>)delegate
{
if (self = [super init]) {
_delegate = delegate;
}
return self;
}
- (void)presentRetainCycles:(NSSet<NSArray<FBObjectiveCGraphElement *> *> *)retainCycles
{
if (![_delegate memoryProfilerCanPresent]) {
return;
}
_retainCycles = [retainCycles allObjects];
UITableViewController *tableViewController = [UITableViewController new];
tableViewController.tableView.delegate = self;
tableViewController.tableView.dataSource = self;
_resultsViewController = [[UINavigationController alloc] initWithRootViewController:tableViewController];
UIBarButtonItem *closeButton = [[UIBarButtonItem alloc] initWithTitle:@"Close"
style:UIBarButtonItemStylePlain
target:self
action:@selector(_dismissTableViewController)];
tableViewController.navigationItem.rightBarButtonItem = closeButton;
tableViewController.title = @"Results";
[_delegate memoryProfilerPresenter:self presentViewController:_resultsViewController];
}
- (void)_dismissTableViewController
{
[_delegate memoryProfilerPresenter:self dismissViewController:_resultsViewController];
_resultsViewController = nil;
_retainCycles = nil;
}
#pragma mark - UITableViewDataSource
- (NSInteger)tableView:(UITableView *)tableView numberOfRowsInSection:(NSInteger)section
{
return [_retainCycles count];
}
- (UITableViewCell *)tableView:(UITableView *)tableView
cellForRowAtIndexPath:(NSIndexPath *)indexPath
{
UITableViewCell *cell = [tableView dequeueReusableCellWithIdentifier:FBRetainCycleDetectorIdentifier];
if (!cell) {
cell = [[UITableViewCell alloc] initWithStyle:UITableViewCellStyleSubtitle
reuseIdentifier:FBRetainCycleDetectorIdentifier];
}
NSArray<FBObjectiveCGraphElement *> *retainCycle = _retainCycles[indexPath.row];
cell.textLabel.text = [retainCycle[0] classNameOrNull];
return cell;
}
- (void)tableView:(UITableView *)tableView didSelectRowAtIndexPath:(NSIndexPath *)indexPath
{
FBSingleRetainCycleViewController *summary = [[FBSingleRetainCycleViewController alloc] initWithRetainCycle:_retainCycles[indexPath.row]];
[_resultsViewController pushViewController:summary
animated:YES];
}
@end
|
{
"pile_set_name": "Github"
}
|
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8" />
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<meta http-equiv="X-UA-Compatible" content="ie=edge" />
<title>Creepyface Firefly</title>
<script src="../../../node_modules/creepyface/dist/creepyface.umd.js"></script>
<script src="../dist/index.js"></script>
<style>
body,
html {
height: 100%;
display: flex;
flex-direction: column;
align-items: center;
justify-content: center;
}
img[data-creepyface] {
max-width: 10em;
}
</style>
</head>
<body>
<img
src="https://creepyface.io/img/0/serious"
data-creepyface
data-points="firefly"
data-src-hover="https://creepyface.io/img/0/hover"
data-src-look-0="https://creepyface.io/img/0/0"
data-src-look-45="https://creepyface.io/img/0/45"
data-src-look-90="https://creepyface.io/img/0/90"
data-src-look-135="https://creepyface.io/img/0/135"
data-src-look-180="https://creepyface.io/img/0/180"
data-src-look-225="https://creepyface.io/img/0/225"
data-src-look-270="https://creepyface.io/img/0/270"
data-src-look-315="https://creepyface.io/img/0/315"
/>
</body>
</html>
|
{
"pile_set_name": "Github"
}
|
/* crypto/ec/ec_cvt.c */
/*
* Originally written by Bodo Moeller for the OpenSSL project.
*/
/* ====================================================================
* Copyright (c) 1998-2002 The OpenSSL Project. All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
* are met:
*
* 1. Redistributions of source code must retain the above copyright
* notice, this list of conditions and the following disclaimer.
*
* 2. Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in
* the documentation and/or other materials provided with the
* distribution.
*
* 3. All advertising materials mentioning features or use of this
* software must display the following acknowledgment:
* "This product includes software developed by the OpenSSL Project
* for use in the OpenSSL Toolkit. (http://www.openssl.org/)"
*
* 4. The names "OpenSSL Toolkit" and "OpenSSL Project" must not be used to
* endorse or promote products derived from this software without
* prior written permission. For written permission, please contact
* [email protected].
*
* 5. Products derived from this software may not be called "OpenSSL"
* nor may "OpenSSL" appear in their names without prior written
* permission of the OpenSSL Project.
*
* 6. Redistributions of any form whatsoever must retain the following
* acknowledgment:
* "This product includes software developed by the OpenSSL Project
* for use in the OpenSSL Toolkit (http://www.openssl.org/)"
*
* THIS SOFTWARE IS PROVIDED BY THE OpenSSL PROJECT ``AS IS'' AND ANY
* EXPRESSED OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
* PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE OpenSSL PROJECT OR
* ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
* SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
* NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
* LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
* HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,
* STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
* ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED
* OF THE POSSIBILITY OF SUCH DAMAGE.
* ====================================================================
*
* This product includes cryptographic software written by Eric Young
* ([email protected]). This product includes software written by Tim
* Hudson ([email protected]).
*
*/
/* ====================================================================
* Copyright 2002 Sun Microsystems, Inc. ALL RIGHTS RESERVED.
*
* Portions of the attached software ("Contribution") are developed by
* SUN MICROSYSTEMS, INC., and are contributed to the OpenSSL project.
*
* The Contribution is licensed pursuant to the OpenSSL open source
* license provided above.
*
* The elliptic curve binary polynomial software is originally written by
* Sheueling Chang Shantz and Douglas Stebila of Sun Microsystems Laboratories.
*
*/
#include <openssl/err.h>
#include "ec_lcl.h"
EC_GROUP *EC_GROUP_new_curve_GFp(const BIGNUM *p, const BIGNUM *a, const BIGNUM *b, BN_CTX *ctx)
{
const EC_METHOD *meth;
EC_GROUP *ret;
#if defined(OPENSSL_BN_ASM_MONT)
/*
* This might appear controversial, but the fact is that generic
* prime method was observed to deliver better performance even
* for NIST primes on a range of platforms, e.g.: 60%-15%
* improvement on IA-64, ~25% on ARM, 30%-90% on P4, 20%-25%
* in 32-bit build and 35%--12% in 64-bit build on Core2...
* Coefficients are relative to optimized bn_nist.c for most
* intensive ECDSA verify and ECDH operations for 192- and 521-
* bit keys respectively. Choice of these boundary values is
* arguable, because the dependency of improvement coefficient
* from key length is not a "monotone" curve. For example while
* 571-bit result is 23% on ARM, 384-bit one is -1%. But it's
* generally faster, sometimes "respectfully" faster, sometimes
* "tolerably" slower... What effectively happens is that loop
* with bn_mul_add_words is put against bn_mul_mont, and the
* latter "wins" on short vectors. Correct solution should be
* implementing dedicated NxN multiplication subroutines for
* small N. But till it materializes, let's stick to generic
* prime method...
* <appro>
*/
meth = EC_GFp_mont_method();
#else
meth = EC_GFp_nist_method();
#endif
ret = EC_GROUP_new(meth);
if (ret == NULL)
return NULL;
if (!EC_GROUP_set_curve_GFp(ret, p, a, b, ctx))
{
unsigned long err;
err = ERR_peek_last_error();
if (!(ERR_GET_LIB(err) == ERR_LIB_EC &&
((ERR_GET_REASON(err) == EC_R_NOT_A_NIST_PRIME) ||
(ERR_GET_REASON(err) == EC_R_NOT_A_SUPPORTED_NIST_PRIME))))
{
/* real error */
EC_GROUP_clear_free(ret);
return NULL;
}
/* not an actual error, we just cannot use EC_GFp_nist_method */
ERR_clear_error();
EC_GROUP_clear_free(ret);
meth = EC_GFp_mont_method();
ret = EC_GROUP_new(meth);
if (ret == NULL)
return NULL;
if (!EC_GROUP_set_curve_GFp(ret, p, a, b, ctx))
{
EC_GROUP_clear_free(ret);
return NULL;
}
}
return ret;
}
#ifndef OPENSSL_NO_EC2M
EC_GROUP *EC_GROUP_new_curve_GF2m(const BIGNUM *p, const BIGNUM *a, const BIGNUM *b, BN_CTX *ctx)
{
const EC_METHOD *meth;
EC_GROUP *ret;
meth = EC_GF2m_simple_method();
ret = EC_GROUP_new(meth);
if (ret == NULL)
return NULL;
if (!EC_GROUP_set_curve_GF2m(ret, p, a, b, ctx))
{
EC_GROUP_clear_free(ret);
return NULL;
}
return ret;
}
#endif
|
{
"pile_set_name": "Github"
}
|
/*=auto=========================================================================
Portions (c) Copyright 2005 Brigham and Women's Hospital (BWH) All Rights Reserved.
See COPYRIGHT.txt
or http://www.slicer.org/copyright/copyright.txt for details.
=========================================================================auto=*/
/// vtkMRMLLogicExport
///
/// The vtkMRMLLogicExport captures some system differences between Unix
/// and Windows operating systems.
#ifndef __vtkMRMLLogicExport_h
#define __vtkMRMLLogicExport_h
#include <vtkMRMLLogicConfigure.h>
#if defined(WIN32) && !defined(VTKMRMLLogic_STATIC)
#if defined(MRMLLogic_EXPORTS)
#define VTK_MRML_LOGIC_EXPORT __declspec( dllexport )
#else
#define VTK_MRML_LOGIC_EXPORT __declspec( dllimport )
#endif
#else
#define VTK_MRML_LOGIC_EXPORT
#endif
#endif
|
{
"pile_set_name": "Github"
}
|
{
"input": {
"data": {
"a": "a",
"c": null
}
},
"spec": {
"data": {
"a?": "x",
"b?": "y",
"c": "z"
}
},
"context": { },
"OVERWRITR": {
"data": {
"a": "x",
"c": "z"
}
}
,
"DEFAULTR": {
"data": {
"a": "a",
"c": "z"
}
},
"DEFINR": {
"data": {
"a": "a",
"c": null
}
}
}
|
{
"pile_set_name": "Github"
}
|
# Author: Justin Henderson
# SANS Instructor and author of SANS SEC555: SIEM and Tactical Analytics
# Email: [email protected]
# Last Update: 12/9/2016
#
# This conf file is based on accepting logs for weird.log from Bro systems
filter {
if [type] == "bro_rdp" {
csv {
columns => ["timestamp","uid","source_ip","source_port","destination_ip","destination_port","cookie","result","security_protocol","keyboard_layout","client_build","client_name","client_digital_product_id","desktop_width","desktop_height","requested_color_depth","certificate_type","certificate_count","certificate_permanent","encryption_level","encryption_method"]
separator => " "
}
mutate {
#add_tag => [ "conf_file_1110"]
}
}
}
|
{
"pile_set_name": "Github"
}
|
<!---
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License. See accompanying LICENSE file.
-->
# <a name="PathCapabilities"></a> interface `PathCapabilities`
The `PathCapabilities` interface provides a way to programmatically query the
operations offered under a given path by an instance of `FileSystem`, `FileContext`
or other implementing class.
```java
public interface PathCapabilities {
boolean hasPathCapability(Path path, String capability)
throws IOException;
}
```
There are a number of goals here:
1. Allow callers to probe for optional filesystem operations without actually
having to invoke them.
1. Allow filesystems with their own optional per-instance features to declare
whether or not they are active for the specific instance.
1. Allow for fileystem connectors which work with object stores to expose the
fundamental difference in semantics of these stores (e.g: files not visible
until closed, file rename being `O(data)`), directory rename being non-atomic,
etc.
### Available Capabilities
Capabilities are defined as strings and split into "Common Capabilites"
and non-standard ones for a specific store.
The common capabilities are all defined under the prefix `fs.capability.`
Consult the javadocs for `org.apache.hadoop.fs.CommonPathCapabilities` for these.
Individual filesystems MAY offer their own set of capabilities which
can be probed for. These MUST begin with `fs.` + the filesystem scheme +
`.capability`. For example `fs.s3a.capability.select.sql`;
### `boolean hasPathCapability(path, capability)`
Probe for the instance offering a specific capability under the
given path.
#### Postconditions
```python
if fs_supports_the_feature(path, capability):
return True
else:
return False
```
Return: `True`, iff the specific capability is available.
A filesystem instance *MUST NOT* return `True` for any capability unless it is
known to be supported by that specific instance. As a result, if a caller
probes for a capability then it can assume that the specific feature/semantics
are available.
If the probe returns `False` then it can mean one of:
1. The capability is unknown.
1. The capability is known, and known to be unavailable on this instance.
1. The capability is known but this local class does not know if it is supported
under the supplied path.
This predicate is intended to be low cost. If it requires remote calls other
than path/link resolution, it SHOULD conclude that the availability
of the feature is unknown and return `False`.
The predicate MUST also be side-effect free.
*Validity of paths*
There is no requirement that the existence of the path must be checked;
the parameter exists so that any filesystem which relays operations to other
filesystems (e.g `viewfs`) can resolve and relay it to the nested filesystem.
Consider the call to be *relatively* lightweight.
Because of this, it may be that while the filesystem declares that
it supports a capability under a path, the actual invocation of the operation
may fail for other reasons.
As an example, while a filesystem may support `append()` under a path,
if invoked on a directory, the call may fail.
That is for a path `root = new Path("/")`: the capabilities call may succeed
```java
fs.hasCapabilities(root, "fs.capability.append") == true
```
But a subsequent call to the operation on that specific path may fail,
because the root path is a directory:
```java
fs.append(root)
```
Similarly, there is no checking that the caller has the permission to
perform a specific operation: just because a feature is available on that
path does not mean that the caller can execute the operation.
The `hasCapabilities(path, capability)` probe is therefore declaring that
the operation will not be rejected as unsupported, not that a specific invocation
will be permitted on that path by the caller.
*Duration of availability*
As the state of a remote store changes,so may path capabilities. This
may be due to changes in the local state of the fileystem (e.g. symbolic links
or mount points changing), or changes in its functionality (e.g. a feature
becoming availaible/unavailable due to operational changes, system upgrades, etc.)
*Capabilities which must be invoked to determine availablity*
Some operations may be known by the client connector, and believed to be available,
but may actually fail when invoked due to the state and permissons of the remote
store —state which is cannot be determined except by attempting
side-effecting operations.
A key example of this is symbolic links and the local filesystem.
The filesystem declares that it supports this unless symbolic links are explicitly
disabled —when invoked they may actually fail.
### Implementors Notes
Implementors *MUST NOT* return `true` for any capability which is not guaranteed
to be supported. To return `true` indicates that the implementation/deployment
of the filesystem does, to the best of the knowledge of the filesystem client,
offer the desired operations *and semantics* queried for.
For performance reasons, implementations *SHOULD NOT* check the path for
existence, unless it needs to resolve symbolic links in parts of the path
to determine whether a feature is present. This is required of `FileContext`
and `viewfs`.
Individual filesystems *MUST NOT* unilaterally define new `fs.capability`-prefixed
capabilities. Instead they *MUST* do one of the following:
* Define and stabilize new cross-filesystem capability flags (preferred),
and so formally add a new `fs.capability` value.
* Use the scheme of the filesystem to as a prefix for their own options,
e.g `fs.hdfs.`
|
{
"pile_set_name": "Github"
}
|
/*
* $Id: json_object.h,v 1.12 2006/01/30 23:07:57 mclark Exp $
*
* Copyright (c) 2004, 2005 Metaparadigm Pte. Ltd.
* Michael Clark <[email protected]>
* Copyright (c) 2009 Hewlett-Packard Development Company, L.P.
*
* This library is free software; you can redistribute it and/or modify
* it under the terms of the MIT license. See COPYING for details.
*
*/
#ifndef _json_object_h_
#define _json_object_h_
#include "json_inttypes.h"
#ifdef __cplusplus
extern "C" {
#endif
#define JSON_OBJECT_DEF_HASH_ENTRIES 16
/**
* A flag for the json_object_to_json_string_ext() and
* json_object_to_file_ext() functions which causes the output
* to have no extra whitespace or formatting applied.
*/
#define JSON_C_TO_STRING_PLAIN 0
/**
* A flag for the json_object_to_json_string_ext() and
* json_object_to_file_ext() functions which causes the output to have
* minimal whitespace inserted to make things slightly more readable.
*/
#define JSON_C_TO_STRING_SPACED (1<<0)
/**
* A flag for the json_object_to_json_string_ext() and
* json_object_to_file_ext() functions which causes
* the output to be formatted.
*
* See the "Two Space Tab" option at http://jsonformatter.curiousconcept.com/
* for an example of the format.
*/
#define JSON_C_TO_STRING_PRETTY (1<<1)
/**
* A flag to drop trailing zero for float values
*/
#define JSON_C_TO_STRING_NOZERO (1<<2)
#undef FALSE
#define FALSE ((json_bool)0)
#undef TRUE
#define TRUE ((json_bool)1)
extern const char *json_number_chars;
extern const char *json_hex_chars;
/* CAW: added for ANSI C iteration correctness */
struct json_object_iter
{
char *key;
struct json_object *val;
struct lh_entry *entry;
};
/* forward structure definitions */
typedef int json_bool;
typedef struct printbuf printbuf;
typedef struct lh_table lh_table;
typedef struct array_list array_list;
typedef struct json_object json_object;
typedef struct json_object_iter json_object_iter;
typedef struct json_tokener json_tokener;
/**
* Type of custom user delete functions. See json_object_set_serializer.
*/
typedef void (json_object_delete_fn)(struct json_object *jso, void *userdata);
/**
* Type of a custom serialization function. See json_object_set_serializer.
*/
typedef int (json_object_to_json_string_fn)(struct json_object *jso,
struct printbuf *pb,
int level,
int flags);
/* supported object types */
typedef enum json_type {
/* If you change this, be sure to update json_type_to_name() too */
json_type_null,
json_type_boolean,
json_type_double,
json_type_int,
json_type_object,
json_type_array,
json_type_string,
} json_type;
/* reference counting functions */
/**
* Increment the reference count of json_object, thereby grabbing shared
* ownership of obj.
*
* @param obj the json_object instance
*/
extern struct json_object* json_object_get(struct json_object *obj);
/**
* Decrement the reference count of json_object and free if it reaches zero.
* You must have ownership of obj prior to doing this or you will cause an
* imbalance in the reference count.
*
* @param obj the json_object instance
* @returns 1 if the object was freed.
*/
int json_object_put(struct json_object *obj);
/**
* Check if the json_object is of a given type
* @param obj the json_object instance
* @param type one of:
json_type_null (i.e. obj == NULL),
json_type_boolean,
json_type_double,
json_type_int,
json_type_object,
json_type_array,
json_type_string,
*/
extern int json_object_is_type(struct json_object *obj, enum json_type type);
/**
* Get the type of the json_object. See also json_type_to_name() to turn this
* into a string suitable, for instance, for logging.
*
* @param obj the json_object instance
* @returns type being one of:
json_type_null (i.e. obj == NULL),
json_type_boolean,
json_type_double,
json_type_int,
json_type_object,
json_type_array,
json_type_string,
*/
extern enum json_type json_object_get_type(struct json_object *obj);
/** Stringify object to json format.
* Equivalent to json_object_to_json_string_ext(obj, JSON_C_TO_STRING_SPACED)
* @param obj the json_object instance
* @returns a string in JSON format
*/
extern const char* json_object_to_json_string(struct json_object *obj);
/** Stringify object to json format
* @param obj the json_object instance
* @param flags formatting options, see JSON_C_TO_STRING_PRETTY and other constants
* @returns a string in JSON format
*/
extern const char* json_object_to_json_string_ext(struct json_object *obj, int
flags);
/**
* Set a custom serialization function to be used when this particular object
* is converted to a string by json_object_to_json_string.
*
* If a custom serializer is already set on this object, any existing
* user_delete function is called before the new one is set.
*
* If to_string_func is NULL, the other parameters are ignored
* and the default behaviour is reset.
*
* The userdata parameter is optional and may be passed as NULL. If provided,
* it is passed to to_string_func as-is. This parameter may be NULL even
* if user_delete is non-NULL.
*
* The user_delete parameter is optional and may be passed as NULL, even if
* the userdata parameter is non-NULL. It will be called just before the
* json_object is deleted, after it's reference count goes to zero
* (see json_object_put()).
* If this is not provided, it is up to the caller to free the userdata at
* an appropriate time. (i.e. after the json_object is deleted)
*
* @param jso the object to customize
* @param to_string_func the custom serialization function
* @param userdata an optional opaque cookie
* @param user_delete an optional function from freeing userdata
*/
void json_object_set_serializer(json_object *jso,
json_object_to_json_string_fn to_string_func,
void *userdata,
json_object_delete_fn *user_delete);
/* object type methods */
/** Create a new empty object with a reference count of 1. The caller of
* this object initially has sole ownership. Remember, when using
* json_object_object_add or json_object_array_put_idx, ownership will
* transfer to the object/array. Call json_object_get if you want to maintain
* shared ownership or also add this object as a child of multiple objects or
* arrays. Any ownerships you acquired but did not transfer must be released
* through json_object_put.
*
* @returns a json_object of type json_type_object
*/
extern struct json_object* json_object_new_object(void);
/** Get the hashtable of a json_object of type json_type_object
* @param obj the json_object instance
* @returns a linkhash
*/
extern struct lh_table* json_object_get_object(struct json_object *obj);
/** Get the size of an object in terms of the number of fields it has.
* @param obj the json_object whose length to return
*/
extern int json_object_object_length(struct json_object* obj);
/** Add an object field to a json_object of type json_type_object
*
* The reference count will *not* be incremented. This is to make adding
* fields to objects in code more compact. If you want to retain a reference
* to an added object, independent of the lifetime of obj, you must wrap the
* passed object with json_object_get.
*
* Upon calling this, the ownership of val transfers to obj. Thus you must
* make sure that you do in fact have ownership over this object. For instance,
* json_object_new_object will give you ownership until you transfer it,
* whereas json_object_object_get does not.
*
* @param obj the json_object instance
* @param key the object field name (a private copy will be duplicated)
* @param val a json_object or NULL member to associate with the given field
*/
extern void json_object_object_add(struct json_object* obj, const char *key,
struct json_object *val);
/** Get the json_object associate with a given object field
*
* *No* reference counts will be changed. There is no need to manually adjust
* reference counts through the json_object_put/json_object_get methods unless
* you need to have the child (value) reference maintain a different lifetime
* than the owning parent (obj). Ownership of the returned value is retained
* by obj (do not do json_object_put unless you have done a json_object_get).
* If you delete the value from obj (json_object_object_del) and wish to access
* the returned reference afterwards, make sure you have first gotten shared
* ownership through json_object_get (& don't forget to do a json_object_put
* or transfer ownership to prevent a memory leak).
*
* @param obj the json_object instance
* @param key the object field name
* @returns the json_object associated with the given field name
* @deprecated Please use json_object_object_get_ex
*/
extern struct json_object* json_object_object_get(struct json_object* obj,
const char *key);
/** Get the json_object associated with a given object field.
*
* This returns true if the key is found, false in all other cases (including
* if obj isn't a json_type_object).
*
* *No* reference counts will be changed. There is no need to manually adjust
* reference counts through the json_object_put/json_object_get methods unless
* you need to have the child (value) reference maintain a different lifetime
* than the owning parent (obj). Ownership of value is retained by obj.
*
* @param obj the json_object instance
* @param key the object field name
* @param value a pointer where to store a reference to the json_object
* associated with the given field name.
*
* It is safe to pass a NULL value.
* @returns whether or not the key exists
*/
extern json_bool json_object_object_get_ex(struct json_object* obj,
const char *key,
struct json_object **value);
/** Delete the given json_object field
*
* The reference count will be decremented for the deleted object. If there
* are no more owners of the value represented by this key, then the value is
* freed. Otherwise, the reference to the value will remain in memory.
*
* @param obj the json_object instance
* @param key the object field name
*/
extern void json_object_object_del(struct json_object* obj, const char *key);
/**
* Iterate through all keys and values of an object.
*
* Adding keys to the object while iterating is NOT allowed.
*
* Deleting an existing key, or replacing an existing key with a
* new value IS allowed.
*
* @param obj the json_object instance
* @param key the local name for the char* key variable defined in the body
* @param val the local name for the json_object* object variable defined in
* the body
*/
#if defined(__GNUC__) && !defined(__STRICT_ANSI__) && __STDC_VERSION__ >= 199901L
# define json_object_object_foreach(obj,key,val) \
char *key; \
struct json_object *val __attribute__((__unused__)); \
for(struct lh_entry *entry ## key = json_object_get_object(obj)->head, *entry_next ## key = NULL; \
({ if(entry ## key) { \
key = (char*)entry ## key->k; \
val = (struct json_object*)entry ## key->v; \
entry_next ## key = entry ## key->next; \
} ; entry ## key; }); \
entry ## key = entry_next ## key )
#else /* ANSI C or MSC */
# define json_object_object_foreach(obj,key,val) \
char *key;\
struct json_object *val; \
struct lh_entry *entry ## key; \
struct lh_entry *entry_next ## key = NULL; \
for(entry ## key = json_object_get_object(obj)->head; \
(entry ## key ? ( \
key = (char*)entry ## key->k, \
val = (struct json_object*)entry ## key->v, \
entry_next ## key = entry ## key->next, \
entry ## key) : 0); \
entry ## key = entry_next ## key)
#endif /* defined(__GNUC__) && !defined(__STRICT_ANSI__) && __STDC_VERSION__ >= 199901L */
/** Iterate through all keys and values of an object (ANSI C Safe)
* @param obj the json_object instance
* @param iter the object iterator
*/
#define json_object_object_foreachC(obj,iter) \
for(iter.entry = json_object_get_object(obj)->head; (iter.entry ? (iter.key = (char*)iter.entry->k, iter.val = (struct json_object*)iter.entry->v, iter.entry) : 0); iter.entry = iter.entry->next)
/* Array type methods */
/** Create a new empty json_object of type json_type_array
* @returns a json_object of type json_type_array
*/
extern struct json_object* json_object_new_array(void);
/** Get the arraylist of a json_object of type json_type_array
* @param obj the json_object instance
* @returns an arraylist
*/
extern struct array_list* json_object_get_array(struct json_object *obj);
/** Get the length of a json_object of type json_type_array
* @param obj the json_object instance
* @returns an int
*/
extern int json_object_array_length(struct json_object *obj);
/** Sorts the elements of jso of type json_type_array
*
* Pointers to the json_object pointers will be passed as the two arguments
* to @sort_fn
*
* @param obj the json_object instance
* @param sort_fn a sorting function
*/
extern void json_object_array_sort(struct json_object *jso, int(*sort_fn)(const void *, const void *));
/** Add an element to the end of a json_object of type json_type_array
*
* The reference count will *not* be incremented. This is to make adding
* fields to objects in code more compact. If you want to retain a reference
* to an added object you must wrap the passed object with json_object_get
*
* @param obj the json_object instance
* @param val the json_object to be added
*/
extern int json_object_array_add(struct json_object *obj,
struct json_object *val);
/** Insert or replace an element at a specified index in an array (a json_object of type json_type_array)
*
* The reference count will *not* be incremented. This is to make adding
* fields to objects in code more compact. If you want to retain a reference
* to an added object you must wrap the passed object with json_object_get
*
* The reference count of a replaced object will be decremented.
*
* The array size will be automatically be expanded to the size of the
* index if the index is larger than the current size.
*
* @param obj the json_object instance
* @param idx the index to insert the element at
* @param val the json_object to be added
*/
extern int json_object_array_put_idx(struct json_object *obj, int idx,
struct json_object *val);
/** Get the element at specificed index of the array (a json_object of type json_type_array)
* @param obj the json_object instance
* @param idx the index to get the element at
* @returns the json_object at the specified index (or NULL)
*/
extern struct json_object* json_object_array_get_idx(struct json_object *obj,
int idx);
/* json_bool type methods */
/** Create a new empty json_object of type json_type_boolean
* @param b a json_bool TRUE or FALSE (0 or 1)
* @returns a json_object of type json_type_boolean
*/
extern struct json_object* json_object_new_boolean(json_bool b);
/** Get the json_bool value of a json_object
*
* The type is coerced to a json_bool if the passed object is not a json_bool.
* integer and double objects will return FALSE if there value is zero
* or TRUE otherwise. If the passed object is a string it will return
* TRUE if it has a non zero length. If any other object type is passed
* TRUE will be returned if the object is not NULL.
*
* @param obj the json_object instance
* @returns a json_bool
*/
extern json_bool json_object_get_boolean(struct json_object *obj);
/* int type methods */
/** Create a new empty json_object of type json_type_int
* Note that values are stored as 64-bit values internally.
* To ensure the full range is maintained, use json_object_new_int64 instead.
* @param i the integer
* @returns a json_object of type json_type_int
*/
extern struct json_object* json_object_new_int(int32_t i);
/** Create a new empty json_object of type json_type_int
* @param i the integer
* @returns a json_object of type json_type_int
*/
extern struct json_object* json_object_new_int64(int64_t i);
/** Get the int value of a json_object
*
* The type is coerced to a int if the passed object is not a int.
* double objects will return their integer conversion. Strings will be
* parsed as an integer. If no conversion exists then 0 is returned
* and errno is set to EINVAL. null is equivalent to 0 (no error values set)
*
* Note that integers are stored internally as 64-bit values.
* If the value of too big or too small to fit into 32-bit, INT32_MAX or
* INT32_MIN are returned, respectively.
*
* @param obj the json_object instance
* @returns an int
*/
extern int32_t json_object_get_int(struct json_object *obj);
/** Get the int value of a json_object
*
* The type is coerced to a int64 if the passed object is not a int64.
* double objects will return their int64 conversion. Strings will be
* parsed as an int64. If no conversion exists then 0 is returned.
*
* NOTE: Set errno to 0 directly before a call to this function to determine
* whether or not conversion was successful (it does not clear the value for
* you).
*
* @param obj the json_object instance
* @returns an int64
*/
extern int64_t json_object_get_int64(struct json_object *obj);
/* double type methods */
/** Create a new empty json_object of type json_type_double
* @param d the double
* @returns a json_object of type json_type_double
*/
extern struct json_object* json_object_new_double(double d);
/** Get the double floating point value of a json_object
*
* The type is coerced to a double if the passed object is not a double.
* integer objects will return their double conversion. Strings will be
* parsed as a double. If no conversion exists then 0.0 is returned and
* errno is set to EINVAL. null is equivalent to 0 (no error values set)
*
* If the value is too big to fit in a double, then the value is set to
* the closest infinity with errno set to ERANGE. If strings cannot be
* converted to their double value, then EINVAL is set & NaN is returned.
*
* Arrays of length 0 are interpreted as 0 (with no error flags set).
* Arrays of length 1 are effectively cast to the equivalent object and
* converted using the above rules. All other arrays set the error to
* EINVAL & return NaN.
*
* NOTE: Set errno to 0 directly before a call to this function to
* determine whether or not conversion was successful (it does not clear
* the value for you).
*
* @param obj the json_object instance
* @returns a double floating point number
*/
extern double json_object_get_double(struct json_object *obj);
/* string type methods */
/** Create a new empty json_object of type json_type_string
*
* A copy of the string is made and the memory is managed by the json_object
*
* @param s the string
* @returns a json_object of type json_type_string
*/
extern struct json_object* json_object_new_string(const char *s);
extern struct json_object* json_object_new_string_len(const char *s, int len);
/** Get the string value of a json_object
*
* If the passed object is not of type json_type_string then the JSON
* representation of the object is returned.
*
* The returned string memory is managed by the json_object and will
* be freed when the reference count of the json_object drops to zero.
*
* @param obj the json_object instance
* @returns a string
*/
extern const char* json_object_get_string(struct json_object *obj);
/** Get the string length of a json_object
*
* If the passed object is not of type json_type_string then zero
* will be returned.
*
* @param obj the json_object instance
* @returns int
*/
extern int json_object_get_string_len(struct json_object *obj);
#ifdef __cplusplus
}
#endif
#endif
|
{
"pile_set_name": "Github"
}
|
/*
* Copyright (C) 2016 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.
*/
package com.android.settings.core;
import android.content.Context;
import android.os.Bundle;
import android.text.TextUtils;
import android.util.Log;
import androidx.annotation.XmlRes;
import androidx.preference.Preference;
import androidx.preference.PreferenceScreen;
import com.android.settings.overlay.FeatureFactory;
import com.android.settings.survey.SurveyMixin;
import com.android.settingslib.core.instrumentation.Instrumentable;
import com.android.settingslib.core.instrumentation.MetricsFeatureProvider;
import com.android.settingslib.core.instrumentation.VisibilityLoggerMixin;
import com.android.settingslib.core.lifecycle.ObservablePreferenceFragment;
/**
* Instrumented fragment that logs visibility state.
*/
public abstract class InstrumentedPreferenceFragment extends ObservablePreferenceFragment
implements Instrumentable {
private static final String TAG = "InstrumentedPrefFrag";
protected MetricsFeatureProvider mMetricsFeatureProvider;
// metrics placeholder value. Only use this for development.
protected final int PLACEHOLDER_METRIC = 10000;
private VisibilityLoggerMixin mVisibilityLoggerMixin;
@Override
public void onAttach(Context context) {
mMetricsFeatureProvider = FeatureFactory.getFactory(context).getMetricsFeatureProvider();
// Mixin that logs visibility change for activity.
mVisibilityLoggerMixin = new VisibilityLoggerMixin(getMetricsCategory(),
mMetricsFeatureProvider);
getSettingsLifecycle().addObserver(mVisibilityLoggerMixin);
getSettingsLifecycle().addObserver(new SurveyMixin(this, getClass().getSimpleName()));
super.onAttach(context);
}
@Override
public void onResume() {
mVisibilityLoggerMixin.setSourceMetricsCategory(getActivity());
super.onResume();
}
@Override
public void onCreatePreferences(Bundle savedInstanceState, String rootKey) {
final int resId = getPreferenceScreenResId();
if (resId > 0) {
addPreferencesFromResource(resId);
}
}
@Override
public void addPreferencesFromResource(@XmlRes int preferencesResId) {
super.addPreferencesFromResource(preferencesResId);
updateActivityTitleWithScreenTitle(getPreferenceScreen());
}
@Override
public <T extends Preference> T findPreference(CharSequence key) {
if (key == null) {
return null;
}
return super.findPreference(key);
}
protected final Context getPrefContext() {
return getPreferenceManager().getContext();
}
protected final VisibilityLoggerMixin getVisibilityLogger() {
return mVisibilityLoggerMixin;
}
/**
* Get the res id for static preference xml for this fragment.
*/
protected int getPreferenceScreenResId() {
return -1;
}
private void updateActivityTitleWithScreenTitle(PreferenceScreen screen) {
if (screen != null) {
final CharSequence title = screen.getTitle();
if (!TextUtils.isEmpty(title)) {
getActivity().setTitle(title);
} else {
Log.w(TAG, "Screen title missing for fragment " + this.getClass().getName());
}
}
}
}
|
{
"pile_set_name": "Github"
}
|
package org.zstack.network.service.lb;
import org.zstack.header.query.ExpandedQueries;
import org.zstack.header.query.ExpandedQuery;
import org.zstack.header.search.Inventory;
import org.zstack.network.service.vip.VipInventory;
import java.sql.Timestamp;
import java.util.ArrayList;
import java.util.Collection;
import java.util.List;
/**
* Created by shixin on 03/22/2018.
*/
@Inventory(mappingVOClass = CertificateVO.class)
@ExpandedQueries({
@ExpandedQuery(expandedField = "listener", inventoryClass = LoadBalancerListenerCertificateRefInventory.class,
foreignKey = "uuid", expandedInventoryKey = "certificateUuid"),
})
public class CertificateInventory {
private String name;
private String uuid;
private String certificate;
private String description;
private List<LoadBalancerListenerCertificateRefInventory> listeners;
private Timestamp createDate;
private Timestamp lastOpDate;
public static CertificateInventory valueOf(CertificateVO vo) {
CertificateInventory inv = new CertificateInventory();
inv.setUuid(vo.getUuid());
inv.setName(vo.getName());
inv.setCertificate(vo.getCertificate());
inv.setDescription(vo.getDescription());
inv.setListeners(LoadBalancerListenerCertificateRefInventory.valueOf(vo.getListeners()));
inv.setCreateDate(vo.getCreateDate());
inv.setLastOpDate(vo.getLastOpDate());
return inv;
}
public static List<CertificateInventory> valueOf(Collection<CertificateVO> vos) {
List<CertificateInventory> invs = new ArrayList<CertificateInventory>();
for (CertificateVO vo : vos) {
invs.add(valueOf(vo));
}
return invs;
}
public List<LoadBalancerListenerCertificateRefInventory> getListeners() {
return listeners;
}
public void setListeners(List<LoadBalancerListenerCertificateRefInventory> listeners) {
this.listeners = listeners;
}
public String getName() {
return name;
}
public void setName(String name) {
this.name = name;
}
public String getUuid() {
return uuid;
}
public void setUuid(String uuid) {
this.uuid = uuid;
}
public String getCertificate() {
return certificate;
}
public void setCertificate(String certificate) {
this.certificate = certificate;
}
public Timestamp getCreateDate() {
return createDate;
}
public void setCreateDate(Timestamp createDate) {
this.createDate = createDate;
}
public Timestamp getLastOpDate() {
return lastOpDate;
}
public void setLastOpDate(Timestamp lastOpDate) {
this.lastOpDate = lastOpDate;
}
public String getDescription() {
return description;
}
public void setDescription(String description) {
this.description = description;
}
}
|
{
"pile_set_name": "Github"
}
|
{-# LANGUAGE DataKinds #-}
{-# LANGUAGE DeriveDataTypeable #-}
{-# LANGUAGE DeriveGeneric #-}
{-# LANGUAGE FlexibleInstances #-}
{-# LANGUAGE NoImplicitPrelude #-}
{-# LANGUAGE OverloadedStrings #-}
{-# LANGUAGE RecordWildCards #-}
{-# LANGUAGE TypeFamilies #-}
{-# LANGUAGE TypeOperators #-}
{-# OPTIONS_GHC -fno-warn-duplicate-exports #-}
{-# OPTIONS_GHC -fno-warn-unused-binds #-}
{-# OPTIONS_GHC -fno-warn-unused-imports #-}
-- |
-- Module : Network.Google.Resource.LibraryAgent.Shelves.List
-- Copyright : (c) 2015-2016 Brendan Hay
-- License : Mozilla Public License, v. 2.0.
-- Maintainer : Brendan Hay <[email protected]>
-- Stability : auto-generated
-- Portability : non-portable (GHC extensions)
--
-- Lists shelves. The order is unspecified but deterministic. Newly created
-- shelves will not necessarily be added to the end of this list.
--
-- /See:/ <https://cloud.google.com/docs/quota Library Agent API Reference> for @libraryagent.shelves.list@.
module Network.Google.Resource.LibraryAgent.Shelves.List
(
-- * REST Resource
ShelvesListResource
-- * Creating a Request
, shelvesList
, ShelvesList
-- * Request Lenses
, slXgafv
, slUploadProtocol
, slAccessToken
, slUploadType
, slPageToken
, slPageSize
, slCallback
) where
import Network.Google.LibraryAgent.Types
import Network.Google.Prelude
-- | A resource alias for @libraryagent.shelves.list@ method which the
-- 'ShelvesList' request conforms to.
type ShelvesListResource =
"v1" :>
"shelves" :>
QueryParam "$.xgafv" Xgafv :>
QueryParam "upload_protocol" Text :>
QueryParam "access_token" Text :>
QueryParam "uploadType" Text :>
QueryParam "pageToken" Text :>
QueryParam "pageSize" (Textual Int32) :>
QueryParam "callback" Text :>
QueryParam "alt" AltJSON :>
Get '[JSON]
GoogleExampleLibraryagentV1ListShelvesResponse
-- | Lists shelves. The order is unspecified but deterministic. Newly created
-- shelves will not necessarily be added to the end of this list.
--
-- /See:/ 'shelvesList' smart constructor.
data ShelvesList =
ShelvesList'
{ _slXgafv :: !(Maybe Xgafv)
, _slUploadProtocol :: !(Maybe Text)
, _slAccessToken :: !(Maybe Text)
, _slUploadType :: !(Maybe Text)
, _slPageToken :: !(Maybe Text)
, _slPageSize :: !(Maybe (Textual Int32))
, _slCallback :: !(Maybe Text)
}
deriving (Eq, Show, Data, Typeable, Generic)
-- | Creates a value of 'ShelvesList' with the minimum fields required to make a request.
--
-- Use one of the following lenses to modify other fields as desired:
--
-- * 'slXgafv'
--
-- * 'slUploadProtocol'
--
-- * 'slAccessToken'
--
-- * 'slUploadType'
--
-- * 'slPageToken'
--
-- * 'slPageSize'
--
-- * 'slCallback'
shelvesList
:: ShelvesList
shelvesList =
ShelvesList'
{ _slXgafv = Nothing
, _slUploadProtocol = Nothing
, _slAccessToken = Nothing
, _slUploadType = Nothing
, _slPageToken = Nothing
, _slPageSize = Nothing
, _slCallback = Nothing
}
-- | V1 error format.
slXgafv :: Lens' ShelvesList (Maybe Xgafv)
slXgafv = lens _slXgafv (\ s a -> s{_slXgafv = a})
-- | Upload protocol for media (e.g. \"raw\", \"multipart\").
slUploadProtocol :: Lens' ShelvesList (Maybe Text)
slUploadProtocol
= lens _slUploadProtocol
(\ s a -> s{_slUploadProtocol = a})
-- | OAuth access token.
slAccessToken :: Lens' ShelvesList (Maybe Text)
slAccessToken
= lens _slAccessToken
(\ s a -> s{_slAccessToken = a})
-- | Legacy upload protocol for media (e.g. \"media\", \"multipart\").
slUploadType :: Lens' ShelvesList (Maybe Text)
slUploadType
= lens _slUploadType (\ s a -> s{_slUploadType = a})
-- | A token identifying a page of results the server should return.
-- Typically, this is the value of ListShelvesResponse.next_page_token
-- returned from the previous call to \`ListShelves\` method.
slPageToken :: Lens' ShelvesList (Maybe Text)
slPageToken
= lens _slPageToken (\ s a -> s{_slPageToken = a})
-- | Requested page size. Server may return fewer shelves than requested. If
-- unspecified, server will pick an appropriate default.
slPageSize :: Lens' ShelvesList (Maybe Int32)
slPageSize
= lens _slPageSize (\ s a -> s{_slPageSize = a}) .
mapping _Coerce
-- | JSONP
slCallback :: Lens' ShelvesList (Maybe Text)
slCallback
= lens _slCallback (\ s a -> s{_slCallback = a})
instance GoogleRequest ShelvesList where
type Rs ShelvesList =
GoogleExampleLibraryagentV1ListShelvesResponse
type Scopes ShelvesList =
'["https://www.googleapis.com/auth/cloud-platform"]
requestClient ShelvesList'{..}
= go _slXgafv _slUploadProtocol _slAccessToken
_slUploadType
_slPageToken
_slPageSize
_slCallback
(Just AltJSON)
libraryAgentService
where go
= buildClient (Proxy :: Proxy ShelvesListResource)
mempty
|
{
"pile_set_name": "Github"
}
|
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<!--NewPage-->
<HTML>
<HEAD>
<!-- Generated by javadoc (build 1.6.0_65) on Wed Mar 26 02:13:04 PDT 2014 -->
<TITLE>
ThumbImagePresenter
</TITLE>
<META NAME="date" CONTENT="2014-03-26">
<LINK REL ="stylesheet" TYPE="text/css" HREF="../../../../stylesheet.css" TITLE="Style">
<SCRIPT type="text/javascript">
function windowTitle()
{
if (location.href.indexOf('is-external=true') == -1) {
parent.document.title="ThumbImagePresenter";
}
}
</SCRIPT>
<NOSCRIPT>
</NOSCRIPT>
</HEAD>
<BODY BGCOLOR="white" onload="windowTitle();">
<HR>
<!-- ========= START OF TOP NAVBAR ======= -->
<A NAME="navbar_top"><!-- --></A>
<A HREF="#skip-navbar_top" title="Skip navigation links"></A>
<TABLE BORDER="0" WIDTH="100%" CELLPADDING="1" CELLSPACING="0" SUMMARY="">
<TR>
<TD COLSPAN=2 BGCOLOR="#EEEEFF" CLASS="NavBarCell1">
<A NAME="navbar_top_firstrow"><!-- --></A>
<TABLE BORDER="0" CELLPADDING="0" CELLSPACING="3" SUMMARY="">
<TR ALIGN="center" VALIGN="top">
<TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../../../overview-summary.html"><FONT CLASS="NavBarFont1"><B>Overview</B></FONT></A> </TD>
<TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="package-summary.html"><FONT CLASS="NavBarFont1"><B>Package</B></FONT></A> </TD>
<TD BGCOLOR="#FFFFFF" CLASS="NavBarCell1Rev"> <FONT CLASS="NavBarFont1Rev"><B>Class</B></FONT> </TD>
<TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="package-tree.html"><FONT CLASS="NavBarFont1"><B>Tree</B></FONT></A> </TD>
<TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../../../deprecated-list.html"><FONT CLASS="NavBarFont1"><B>Deprecated</B></FONT></A> </TD>
<TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../../../index-files/index-1.html"><FONT CLASS="NavBarFont1"><B>Index</B></FONT></A> </TD>
<TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../../../help-doc.html"><FONT CLASS="NavBarFont1"><B>Help</B></FONT></A> </TD>
</TR>
</TABLE>
</TD>
<TD ALIGN="right" VALIGN="top" ROWSPAN=3><EM>
</EM>
</TD>
</TR>
<TR>
<TD BGCOLOR="white" CLASS="NavBarCell2"><FONT SIZE="-2">
<A HREF="../../../../com/bumptech/glide/presenter/ImagePresenter.ImageReadyCallback.html" title="interface in com.bumptech.glide.presenter"><B>PREV CLASS</B></A>
<A HREF="../../../../com/bumptech/glide/presenter/ThumbImagePresenter.Builder.html" title="class in com.bumptech.glide.presenter"><B>NEXT CLASS</B></A></FONT></TD>
<TD BGCOLOR="white" CLASS="NavBarCell2"><FONT SIZE="-2">
<A HREF="../../../../index.html?com/bumptech/glide/presenter/ThumbImagePresenter.html" target="_top"><B>FRAMES</B></A>
<A HREF="ThumbImagePresenter.html" target="_top"><B>NO FRAMES</B></A>
<SCRIPT type="text/javascript">
<!--
if(window==top) {
document.writeln('<A HREF="../../../../allclasses-noframe.html"><B>All Classes</B></A>');
}
//-->
</SCRIPT>
<NOSCRIPT>
<A HREF="../../../../allclasses-noframe.html"><B>All Classes</B></A>
</NOSCRIPT>
</FONT></TD>
</TR>
<TR>
<TD VALIGN="top" CLASS="NavBarCell3"><FONT SIZE="-2">
SUMMARY: <A HREF="#nested_class_summary">NESTED</A> | FIELD | CONSTR | <A HREF="#method_summary">METHOD</A></FONT></TD>
<TD VALIGN="top" CLASS="NavBarCell3"><FONT SIZE="-2">
DETAIL: FIELD | CONSTR | <A HREF="#method_detail">METHOD</A></FONT></TD>
</TR>
</TABLE>
<A NAME="skip-navbar_top"></A>
<!-- ========= END OF TOP NAVBAR ========= -->
<HR>
<!-- ======== START OF CLASS DATA ======== -->
<H2>
<FONT SIZE="-1">
com.bumptech.glide.presenter</FONT>
<BR>
Class ThumbImagePresenter<A,B,C extends <A HREF="../../../../com/bumptech/glide/presenter/target/Target.html" title="interface in com.bumptech.glide.presenter.target">Target</A>></H2>
<PRE>
java.lang.Object
<IMG SRC="../../../../resources/inherit.gif" ALT="extended by "><B>com.bumptech.glide.presenter.ThumbImagePresenter<A,B,C></B>
</PRE>
<DL>
<DT><B>All Implemented Interfaces:</B> <DD><A HREF="../../../../com/bumptech/glide/presenter/ImagePresenter.ImagePresenterCoordinator.html" title="interface in com.bumptech.glide.presenter">ImagePresenter.ImagePresenterCoordinator</A></DD>
</DL>
<HR>
<DL>
<DT><PRE>public class <B>ThumbImagePresenter<A,B,C extends <A HREF="../../../../com/bumptech/glide/presenter/target/Target.html" title="interface in com.bumptech.glide.presenter.target">Target</A>></B><DT>extends java.lang.Object<DT>implements <A HREF="../../../../com/bumptech/glide/presenter/ImagePresenter.ImagePresenterCoordinator.html" title="interface in com.bumptech.glide.presenter">ImagePresenter.ImagePresenterCoordinator</A></DL>
</PRE>
<P>
Wraps a pair of <A HREF="../../../../com/bumptech/glide/presenter/ImagePresenter.html" title="class in com.bumptech.glide.presenter"><CODE>ImagePresenter</CODE></A> objects and uses them to load and display an image and a thumbnail for that
image. The image load is started first. If the image load does not return synchronously (ie if the image is not
cached), then the thumbnail load is started. If the thumbnail load does not return synchronously, the placeholder
image is shown. If the thumbnail load completes before the image load (expected in most cases), the thumbnail is
shown until the image load completes. If the image load completes first, the thumbnail will never be shown.
<P>
<P>
<HR>
<P>
<!-- ======== NESTED CLASS SUMMARY ======== -->
<A NAME="nested_class_summary"><!-- --></A>
<TABLE BORDER="1" WIDTH="100%" CELLPADDING="3" CELLSPACING="0" SUMMARY="">
<TR BGCOLOR="#CCCCFF" CLASS="TableHeadingColor">
<TH ALIGN="left" COLSPAN="2"><FONT SIZE="+2">
<B>Nested Class Summary</B></FONT></TH>
</TR>
<TR BGCOLOR="white" CLASS="TableRowColor">
<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
<CODE>static class</CODE></FONT></TD>
<TD><CODE><B><A HREF="../../../../com/bumptech/glide/presenter/ThumbImagePresenter.Builder.html" title="class in com.bumptech.glide.presenter">ThumbImagePresenter.Builder</A><<A HREF="../../../../com/bumptech/glide/presenter/ThumbImagePresenter.Builder.html" title="type parameter in ThumbImagePresenter.Builder">A</A>,<A HREF="../../../../com/bumptech/glide/presenter/ThumbImagePresenter.Builder.html" title="type parameter in ThumbImagePresenter.Builder">B</A>,<A HREF="../../../../com/bumptech/glide/presenter/ThumbImagePresenter.Builder.html" title="type parameter in ThumbImagePresenter.Builder">C</A> extends <A HREF="../../../../com/bumptech/glide/presenter/target/Target.html" title="interface in com.bumptech.glide.presenter.target">Target</A>></B></CODE>
<BR>
A builder for a <A HREF="../../../../com/bumptech/glide/presenter/ThumbImagePresenter.html" title="class in com.bumptech.glide.presenter"><CODE>ThumbImagePresenter</CODE></A>.</TD>
</TR>
</TABLE>
<!-- ========== METHOD SUMMARY =========== -->
<A NAME="method_summary"><!-- --></A>
<TABLE BORDER="1" WIDTH="100%" CELLPADDING="3" CELLSPACING="0" SUMMARY="">
<TR BGCOLOR="#CCCCFF" CLASS="TableHeadingColor">
<TH ALIGN="left" COLSPAN="2"><FONT SIZE="+2">
<B>Method Summary</B></FONT></TH>
</TR>
<TR BGCOLOR="white" CLASS="TableRowColor">
<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
<CODE> boolean</CODE></FONT></TD>
<TD><CODE><B><A HREF="../../../../com/bumptech/glide/presenter/ThumbImagePresenter.html#canSetImage(com.bumptech.glide.presenter.ImagePresenter)">canSetImage</A></B>(<A HREF="../../../../com/bumptech/glide/presenter/ImagePresenter.html" title="class in com.bumptech.glide.presenter">ImagePresenter</A> presenter)</CODE>
<BR>
Determines if a presenter can display a loaded bitmap</TD>
</TR>
<TR BGCOLOR="white" CLASS="TableRowColor">
<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
<CODE> boolean</CODE></FONT></TD>
<TD><CODE><B><A HREF="../../../../com/bumptech/glide/presenter/ThumbImagePresenter.html#canSetPlaceholder(com.bumptech.glide.presenter.ImagePresenter)">canSetPlaceholder</A></B>(<A HREF="../../../../com/bumptech/glide/presenter/ImagePresenter.html" title="class in com.bumptech.glide.presenter">ImagePresenter</A> presenter)</CODE>
<BR>
Determines if a presenter can display a placeholder</TD>
</TR>
<TR BGCOLOR="white" CLASS="TableRowColor">
<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
<CODE> void</CODE></FONT></TD>
<TD><CODE><B><A HREF="../../../../com/bumptech/glide/presenter/ThumbImagePresenter.html#clear()">clear</A></B>()</CODE>
<BR>
Calls the corresponding method on both image presenters</TD>
</TR>
<TR BGCOLOR="white" CLASS="TableRowColor">
<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
<CODE> void</CODE></FONT></TD>
<TD><CODE><B><A HREF="../../../../com/bumptech/glide/presenter/ThumbImagePresenter.html#resetPlaceholder()">resetPlaceholder</A></B>()</CODE>
<BR>
Show the placeholder if one is set, otherwise clear the view</TD>
</TR>
<TR BGCOLOR="white" CLASS="TableRowColor">
<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
<CODE> void</CODE></FONT></TD>
<TD><CODE><B><A HREF="../../../../com/bumptech/glide/presenter/ThumbImagePresenter.html#setModels(A, B)">setModels</A></B>(<A HREF="../../../../com/bumptech/glide/presenter/ThumbImagePresenter.html" title="type parameter in ThumbImagePresenter">A</A> fullModel,
<A HREF="../../../../com/bumptech/glide/presenter/ThumbImagePresenter.html" title="type parameter in ThumbImagePresenter">B</A> thumbModel)</CODE>
<BR>
Sets models to load the full and thumb image.</TD>
</TR>
</TABLE>
<A NAME="methods_inherited_from_class_java.lang.Object"><!-- --></A>
<TABLE BORDER="1" WIDTH="100%" CELLPADDING="3" CELLSPACING="0" SUMMARY="">
<TR BGCOLOR="#EEEEFF" CLASS="TableSubHeadingColor">
<TH ALIGN="left"><B>Methods inherited from class java.lang.Object</B></TH>
</TR>
<TR BGCOLOR="white" CLASS="TableRowColor">
<TD><CODE>clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait</CODE></TD>
</TR>
</TABLE>
<P>
<!-- ============ METHOD DETAIL ========== -->
<A NAME="method_detail"><!-- --></A>
<TABLE BORDER="1" WIDTH="100%" CELLPADDING="3" CELLSPACING="0" SUMMARY="">
<TR BGCOLOR="#CCCCFF" CLASS="TableHeadingColor">
<TH ALIGN="left" COLSPAN="1"><FONT SIZE="+2">
<B>Method Detail</B></FONT></TH>
</TR>
</TABLE>
<A NAME="setModels(java.lang.Object,java.lang.Object)"><!-- --></A><A NAME="setModels(A, B)"><!-- --></A><H3>
setModels</H3>
<PRE>
public void <B>setModels</B>(<A HREF="../../../../com/bumptech/glide/presenter/ThumbImagePresenter.html" title="type parameter in ThumbImagePresenter">A</A> fullModel,
<A HREF="../../../../com/bumptech/glide/presenter/ThumbImagePresenter.html" title="type parameter in ThumbImagePresenter">B</A> thumbModel)</PRE>
<DL>
<DD>Sets models to load the full and thumb image. If the load for fullModel finishes before the one for thumbModel
then only the full image will be shown
<P>
<DD><DL>
</DL>
</DD>
<DD><DL>
<DT><B>See Also:</B><DD><A HREF="../../../../com/bumptech/glide/presenter/ImagePresenter.html#setModel(T)"><CODE>ImagePresenter.setModel(Object)</CODE></A></DL>
</DD>
</DL>
<HR>
<A NAME="clear()"><!-- --></A><H3>
clear</H3>
<PRE>
public void <B>clear</B>()</PRE>
<DL>
<DD>Calls the corresponding method on both image presenters
<P>
<DD><DL>
</DL>
</DD>
<DD><DL>
<DT><B>See Also:</B><DD><A HREF="../../../../com/bumptech/glide/presenter/ImagePresenter.html#clear()"><CODE>ImagePresenter.clear()</CODE></A></DL>
</DD>
</DL>
<HR>
<A NAME="canSetImage(com.bumptech.glide.presenter.ImagePresenter)"><!-- --></A><H3>
canSetImage</H3>
<PRE>
public boolean <B>canSetImage</B>(<A HREF="../../../../com/bumptech/glide/presenter/ImagePresenter.html" title="class in com.bumptech.glide.presenter">ImagePresenter</A> presenter)</PRE>
<DL>
<DD><B>Description copied from interface: <CODE><A HREF="../../../../com/bumptech/glide/presenter/ImagePresenter.ImagePresenterCoordinator.html#canSetImage(com.bumptech.glide.presenter.ImagePresenter)">ImagePresenter.ImagePresenterCoordinator</A></CODE></B></DD>
<DD>Determines if a presenter can display a loaded bitmap
<P>
<DD><DL>
<DT><B>Specified by:</B><DD><CODE><A HREF="../../../../com/bumptech/glide/presenter/ImagePresenter.ImagePresenterCoordinator.html#canSetImage(com.bumptech.glide.presenter.ImagePresenter)">canSetImage</A></CODE> in interface <CODE><A HREF="../../../../com/bumptech/glide/presenter/ImagePresenter.ImagePresenterCoordinator.html" title="interface in com.bumptech.glide.presenter">ImagePresenter.ImagePresenterCoordinator</A></CODE></DL>
</DD>
<DD><DL>
<DT><B>Parameters:</B><DD><CODE>presenter</CODE> - The presenter requesting permission to display a bitmap
<DT><B>Returns:</B><DD>True iff the presenter can display a bitmap</DL>
</DD>
</DL>
<HR>
<A NAME="canSetPlaceholder(com.bumptech.glide.presenter.ImagePresenter)"><!-- --></A><H3>
canSetPlaceholder</H3>
<PRE>
public boolean <B>canSetPlaceholder</B>(<A HREF="../../../../com/bumptech/glide/presenter/ImagePresenter.html" title="class in com.bumptech.glide.presenter">ImagePresenter</A> presenter)</PRE>
<DL>
<DD><B>Description copied from interface: <CODE><A HREF="../../../../com/bumptech/glide/presenter/ImagePresenter.ImagePresenterCoordinator.html#canSetPlaceholder(com.bumptech.glide.presenter.ImagePresenter)">ImagePresenter.ImagePresenterCoordinator</A></CODE></B></DD>
<DD>Determines if a presenter can display a placeholder
<P>
<DD><DL>
<DT><B>Specified by:</B><DD><CODE><A HREF="../../../../com/bumptech/glide/presenter/ImagePresenter.ImagePresenterCoordinator.html#canSetPlaceholder(com.bumptech.glide.presenter.ImagePresenter)">canSetPlaceholder</A></CODE> in interface <CODE><A HREF="../../../../com/bumptech/glide/presenter/ImagePresenter.ImagePresenterCoordinator.html" title="interface in com.bumptech.glide.presenter">ImagePresenter.ImagePresenterCoordinator</A></CODE></DL>
</DD>
<DD><DL>
<DT><B>Parameters:</B><DD><CODE>presenter</CODE> - The presenter requesting permission to display a placeholder
<DT><B>Returns:</B><DD>True iff the presenter can display a placeholder</DL>
</DD>
</DL>
<HR>
<A NAME="resetPlaceholder()"><!-- --></A><H3>
resetPlaceholder</H3>
<PRE>
public void <B>resetPlaceholder</B>()</PRE>
<DL>
<DD>Show the placeholder if one is set, otherwise clear the view
<P>
<DD><DL>
</DL>
</DD>
<DD><DL>
<DT><B>See Also:</B><DD><A HREF="../../../../com/bumptech/glide/presenter/ImagePresenter.html#resetPlaceHolder()"><CODE>ImagePresenter.resetPlaceHolder()</CODE></A></DL>
</DD>
</DL>
<!-- ========= END OF CLASS DATA ========= -->
<HR>
<!-- ======= START OF BOTTOM NAVBAR ====== -->
<A NAME="navbar_bottom"><!-- --></A>
<A HREF="#skip-navbar_bottom" title="Skip navigation links"></A>
<TABLE BORDER="0" WIDTH="100%" CELLPADDING="1" CELLSPACING="0" SUMMARY="">
<TR>
<TD COLSPAN=2 BGCOLOR="#EEEEFF" CLASS="NavBarCell1">
<A NAME="navbar_bottom_firstrow"><!-- --></A>
<TABLE BORDER="0" CELLPADDING="0" CELLSPACING="3" SUMMARY="">
<TR ALIGN="center" VALIGN="top">
<TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../../../overview-summary.html"><FONT CLASS="NavBarFont1"><B>Overview</B></FONT></A> </TD>
<TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="package-summary.html"><FONT CLASS="NavBarFont1"><B>Package</B></FONT></A> </TD>
<TD BGCOLOR="#FFFFFF" CLASS="NavBarCell1Rev"> <FONT CLASS="NavBarFont1Rev"><B>Class</B></FONT> </TD>
<TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="package-tree.html"><FONT CLASS="NavBarFont1"><B>Tree</B></FONT></A> </TD>
<TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../../../deprecated-list.html"><FONT CLASS="NavBarFont1"><B>Deprecated</B></FONT></A> </TD>
<TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../../../index-files/index-1.html"><FONT CLASS="NavBarFont1"><B>Index</B></FONT></A> </TD>
<TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../../../help-doc.html"><FONT CLASS="NavBarFont1"><B>Help</B></FONT></A> </TD>
</TR>
</TABLE>
</TD>
<TD ALIGN="right" VALIGN="top" ROWSPAN=3><EM>
</EM>
</TD>
</TR>
<TR>
<TD BGCOLOR="white" CLASS="NavBarCell2"><FONT SIZE="-2">
<A HREF="../../../../com/bumptech/glide/presenter/ImagePresenter.ImageReadyCallback.html" title="interface in com.bumptech.glide.presenter"><B>PREV CLASS</B></A>
<A HREF="../../../../com/bumptech/glide/presenter/ThumbImagePresenter.Builder.html" title="class in com.bumptech.glide.presenter"><B>NEXT CLASS</B></A></FONT></TD>
<TD BGCOLOR="white" CLASS="NavBarCell2"><FONT SIZE="-2">
<A HREF="../../../../index.html?com/bumptech/glide/presenter/ThumbImagePresenter.html" target="_top"><B>FRAMES</B></A>
<A HREF="ThumbImagePresenter.html" target="_top"><B>NO FRAMES</B></A>
<SCRIPT type="text/javascript">
<!--
if(window==top) {
document.writeln('<A HREF="../../../../allclasses-noframe.html"><B>All Classes</B></A>');
}
//-->
</SCRIPT>
<NOSCRIPT>
<A HREF="../../../../allclasses-noframe.html"><B>All Classes</B></A>
</NOSCRIPT>
</FONT></TD>
</TR>
<TR>
<TD VALIGN="top" CLASS="NavBarCell3"><FONT SIZE="-2">
SUMMARY: <A HREF="#nested_class_summary">NESTED</A> | FIELD | CONSTR | <A HREF="#method_summary">METHOD</A></FONT></TD>
<TD VALIGN="top" CLASS="NavBarCell3"><FONT SIZE="-2">
DETAIL: FIELD | CONSTR | <A HREF="#method_detail">METHOD</A></FONT></TD>
</TR>
</TABLE>
<A NAME="skip-navbar_bottom"></A>
<!-- ======== END OF BOTTOM NAVBAR ======= -->
<HR>
</BODY>
</HTML>
|
{
"pile_set_name": "Github"
}
|
// Copyright 2009 the Sputnik authors. All rights reserved.
// This code is governed by the BSD license found in the LICENSE file.
/**
* No matter how control leaves the embedded 'Statement',
* the scope chain is always restored to its former state
*
* @path ch12/12.10/S12.10_A3.9_T1.js
* @description Using "for-in" statement within "with" statement, leading to normal completion
* @noStrict
*/
this.p1 = 1;
var result = "result";
var myObj = {
p1: 'a',
value: 'myObj_value',
valueOf : function(){return 'obj_valueOf';}
}
with(myObj){
for(var prop in myObj){
p1 = 'x1';
}
}
//////////////////////////////////////////////////////////////////////////////
//CHECK#1
if(p1 !== 1){
$ERROR('#1: p1 === 1. Actual: p1 ==='+ p1 );
}
//
//////////////////////////////////////////////////////////////////////////////
//////////////////////////////////////////////////////////////////////////////
//CHECK#2
if(myObj.p1 !== "x1"){
$ERROR('#2: myObj.p1 === "x1". Actual: myObj.p1 ==='+ myObj.p1 );
}
//
//////////////////////////////////////////////////////////////////////////////
|
{
"pile_set_name": "Github"
}
|
// SPDX-License-Identifier: GPL-2.0+
//
// max8998.c - Voltage regulator driver for the Maxim 8998
//
// Copyright (C) 2009-2010 Samsung Electronics
// Kyungmin Park <[email protected]>
// Marek Szyprowski <[email protected]>
#include <linux/module.h>
#include <linux/init.h>
#include <linux/i2c.h>
#include <linux/err.h>
#include <linux/gpio.h>
#include <linux/slab.h>
#include <linux/interrupt.h>
#include <linux/mutex.h>
#include <linux/of.h>
#include <linux/of_gpio.h>
#include <linux/platform_device.h>
#include <linux/regulator/driver.h>
#include <linux/regulator/of_regulator.h>
#include <linux/mfd/max8998.h>
#include <linux/mfd/max8998-private.h>
struct max8998_data {
struct device *dev;
struct max8998_dev *iodev;
int num_regulators;
u8 buck1_vol[4]; /* voltages for selection */
u8 buck2_vol[2];
unsigned int buck1_idx; /* index to last changed voltage */
/* value in a set */
unsigned int buck2_idx;
};
static int max8998_get_enable_register(struct regulator_dev *rdev,
int *reg, int *shift)
{
int ldo = rdev_get_id(rdev);
switch (ldo) {
case MAX8998_LDO2 ... MAX8998_LDO5:
*reg = MAX8998_REG_ONOFF1;
*shift = 3 - (ldo - MAX8998_LDO2);
break;
case MAX8998_LDO6 ... MAX8998_LDO13:
*reg = MAX8998_REG_ONOFF2;
*shift = 7 - (ldo - MAX8998_LDO6);
break;
case MAX8998_LDO14 ... MAX8998_LDO17:
*reg = MAX8998_REG_ONOFF3;
*shift = 7 - (ldo - MAX8998_LDO14);
break;
case MAX8998_BUCK1 ... MAX8998_BUCK4:
*reg = MAX8998_REG_ONOFF1;
*shift = 7 - (ldo - MAX8998_BUCK1);
break;
case MAX8998_EN32KHZ_AP ... MAX8998_ENVICHG:
*reg = MAX8998_REG_ONOFF4;
*shift = 7 - (ldo - MAX8998_EN32KHZ_AP);
break;
case MAX8998_ESAFEOUT1 ... MAX8998_ESAFEOUT2:
*reg = MAX8998_REG_CHGR2;
*shift = 7 - (ldo - MAX8998_ESAFEOUT1);
break;
default:
return -EINVAL;
}
return 0;
}
static int max8998_ldo_is_enabled(struct regulator_dev *rdev)
{
struct max8998_data *max8998 = rdev_get_drvdata(rdev);
struct i2c_client *i2c = max8998->iodev->i2c;
int ret, reg, shift = 8;
u8 val;
ret = max8998_get_enable_register(rdev, ®, &shift);
if (ret)
return ret;
ret = max8998_read_reg(i2c, reg, &val);
if (ret)
return ret;
return val & (1 << shift);
}
static int max8998_ldo_enable(struct regulator_dev *rdev)
{
struct max8998_data *max8998 = rdev_get_drvdata(rdev);
struct i2c_client *i2c = max8998->iodev->i2c;
int reg, shift = 8, ret;
ret = max8998_get_enable_register(rdev, ®, &shift);
if (ret)
return ret;
return max8998_update_reg(i2c, reg, 1<<shift, 1<<shift);
}
static int max8998_ldo_disable(struct regulator_dev *rdev)
{
struct max8998_data *max8998 = rdev_get_drvdata(rdev);
struct i2c_client *i2c = max8998->iodev->i2c;
int reg, shift = 8, ret;
ret = max8998_get_enable_register(rdev, ®, &shift);
if (ret)
return ret;
return max8998_update_reg(i2c, reg, 0, 1<<shift);
}
static int max8998_get_voltage_register(struct regulator_dev *rdev,
int *_reg, int *_shift, int *_mask)
{
int ldo = rdev_get_id(rdev);
struct max8998_data *max8998 = rdev_get_drvdata(rdev);
int reg, shift = 0, mask = 0xff;
switch (ldo) {
case MAX8998_LDO2 ... MAX8998_LDO3:
reg = MAX8998_REG_LDO2_LDO3;
mask = 0xf;
if (ldo == MAX8998_LDO2)
shift = 4;
else
shift = 0;
break;
case MAX8998_LDO4 ... MAX8998_LDO7:
reg = MAX8998_REG_LDO4 + (ldo - MAX8998_LDO4);
break;
case MAX8998_LDO8 ... MAX8998_LDO9:
reg = MAX8998_REG_LDO8_LDO9;
mask = 0xf;
if (ldo == MAX8998_LDO8)
shift = 4;
else
shift = 0;
break;
case MAX8998_LDO10 ... MAX8998_LDO11:
reg = MAX8998_REG_LDO10_LDO11;
if (ldo == MAX8998_LDO10) {
shift = 5;
mask = 0x7;
} else {
shift = 0;
mask = 0x1f;
}
break;
case MAX8998_LDO12 ... MAX8998_LDO17:
reg = MAX8998_REG_LDO12 + (ldo - MAX8998_LDO12);
break;
case MAX8998_BUCK1:
reg = MAX8998_REG_BUCK1_VOLTAGE1 + max8998->buck1_idx;
break;
case MAX8998_BUCK2:
reg = MAX8998_REG_BUCK2_VOLTAGE1 + max8998->buck2_idx;
break;
case MAX8998_BUCK3:
reg = MAX8998_REG_BUCK3;
break;
case MAX8998_BUCK4:
reg = MAX8998_REG_BUCK4;
break;
default:
return -EINVAL;
}
*_reg = reg;
*_shift = shift;
*_mask = mask;
return 0;
}
static int max8998_get_voltage_sel(struct regulator_dev *rdev)
{
struct max8998_data *max8998 = rdev_get_drvdata(rdev);
struct i2c_client *i2c = max8998->iodev->i2c;
int reg, shift = 0, mask, ret;
u8 val;
ret = max8998_get_voltage_register(rdev, ®, &shift, &mask);
if (ret)
return ret;
ret = max8998_read_reg(i2c, reg, &val);
if (ret)
return ret;
val >>= shift;
val &= mask;
return val;
}
static int max8998_set_voltage_ldo_sel(struct regulator_dev *rdev,
unsigned selector)
{
struct max8998_data *max8998 = rdev_get_drvdata(rdev);
struct i2c_client *i2c = max8998->iodev->i2c;
int reg, shift = 0, mask, ret;
ret = max8998_get_voltage_register(rdev, ®, &shift, &mask);
if (ret)
return ret;
ret = max8998_update_reg(i2c, reg, selector<<shift, mask<<shift);
return ret;
}
static inline void buck1_gpio_set(int gpio1, int gpio2, int v)
{
gpio_set_value(gpio1, v & 0x1);
gpio_set_value(gpio2, (v >> 1) & 0x1);
}
static inline void buck2_gpio_set(int gpio, int v)
{
gpio_set_value(gpio, v & 0x1);
}
static int max8998_set_voltage_buck_sel(struct regulator_dev *rdev,
unsigned selector)
{
struct max8998_data *max8998 = rdev_get_drvdata(rdev);
struct max8998_platform_data *pdata = max8998->iodev->pdata;
struct i2c_client *i2c = max8998->iodev->i2c;
int buck = rdev_get_id(rdev);
int reg, shift = 0, mask, ret, j;
static u8 buck1_last_val;
ret = max8998_get_voltage_register(rdev, ®, &shift, &mask);
if (ret)
return ret;
switch (buck) {
case MAX8998_BUCK1:
dev_dbg(max8998->dev,
"BUCK1, selector:%d, buck1_vol1:%d, buck1_vol2:%d\n"
"buck1_vol3:%d, buck1_vol4:%d\n",
selector, max8998->buck1_vol[0], max8998->buck1_vol[1],
max8998->buck1_vol[2], max8998->buck1_vol[3]);
if (gpio_is_valid(pdata->buck1_set1) &&
gpio_is_valid(pdata->buck1_set2)) {
/* check if requested voltage */
/* value is already defined */
for (j = 0; j < ARRAY_SIZE(max8998->buck1_vol); j++) {
if (max8998->buck1_vol[j] == selector) {
max8998->buck1_idx = j;
buck1_gpio_set(pdata->buck1_set1,
pdata->buck1_set2, j);
goto buck1_exit;
}
}
if (pdata->buck_voltage_lock)
return -EINVAL;
/* no predefine regulator found */
max8998->buck1_idx = (buck1_last_val % 2) + 2;
dev_dbg(max8998->dev, "max8998->buck1_idx:%d\n",
max8998->buck1_idx);
max8998->buck1_vol[max8998->buck1_idx] = selector;
ret = max8998_get_voltage_register(rdev, ®,
&shift,
&mask);
ret = max8998_write_reg(i2c, reg, selector);
buck1_gpio_set(pdata->buck1_set1,
pdata->buck1_set2, max8998->buck1_idx);
buck1_last_val++;
buck1_exit:
dev_dbg(max8998->dev, "%s: SET1:%d, SET2:%d\n",
i2c->name, gpio_get_value(pdata->buck1_set1),
gpio_get_value(pdata->buck1_set2));
break;
} else {
ret = max8998_write_reg(i2c, reg, selector);
}
break;
case MAX8998_BUCK2:
dev_dbg(max8998->dev,
"BUCK2, selector:%d buck2_vol1:%d, buck2_vol2:%d\n",
selector, max8998->buck2_vol[0], max8998->buck2_vol[1]);
if (gpio_is_valid(pdata->buck2_set3)) {
/* check if requested voltage */
/* value is already defined */
for (j = 0; j < ARRAY_SIZE(max8998->buck2_vol); j++) {
if (max8998->buck2_vol[j] == selector) {
max8998->buck2_idx = j;
buck2_gpio_set(pdata->buck2_set3, j);
goto buck2_exit;
}
}
if (pdata->buck_voltage_lock)
return -EINVAL;
max8998_get_voltage_register(rdev,
®, &shift, &mask);
ret = max8998_write_reg(i2c, reg, selector);
max8998->buck2_vol[max8998->buck2_idx] = selector;
buck2_gpio_set(pdata->buck2_set3, max8998->buck2_idx);
buck2_exit:
dev_dbg(max8998->dev, "%s: SET3:%d\n", i2c->name,
gpio_get_value(pdata->buck2_set3));
} else {
ret = max8998_write_reg(i2c, reg, selector);
}
break;
case MAX8998_BUCK3:
case MAX8998_BUCK4:
ret = max8998_update_reg(i2c, reg, selector<<shift,
mask<<shift);
break;
}
return ret;
}
static int max8998_set_voltage_buck_time_sel(struct regulator_dev *rdev,
unsigned int old_selector,
unsigned int new_selector)
{
struct max8998_data *max8998 = rdev_get_drvdata(rdev);
struct i2c_client *i2c = max8998->iodev->i2c;
int buck = rdev_get_id(rdev);
u8 val = 0;
int difference, ret;
if (buck < MAX8998_BUCK1 || buck > MAX8998_BUCK4)
return -EINVAL;
/* Voltage stabilization */
ret = max8998_read_reg(i2c, MAX8998_REG_ONOFF4, &val);
if (ret)
return ret;
/* lp3974 hasn't got ENRAMP bit - ramp is assumed as true */
/* MAX8998 has ENRAMP bit implemented, so test it*/
if (max8998->iodev->type == TYPE_MAX8998 && !(val & MAX8998_ENRAMP))
return 0;
difference = (new_selector - old_selector) * rdev->desc->uV_step / 1000;
if (difference > 0)
return DIV_ROUND_UP(difference, (val & 0x0f) + 1);
return 0;
}
static const struct regulator_ops max8998_ldo_ops = {
.list_voltage = regulator_list_voltage_linear,
.map_voltage = regulator_map_voltage_linear,
.is_enabled = max8998_ldo_is_enabled,
.enable = max8998_ldo_enable,
.disable = max8998_ldo_disable,
.get_voltage_sel = max8998_get_voltage_sel,
.set_voltage_sel = max8998_set_voltage_ldo_sel,
};
static const struct regulator_ops max8998_buck_ops = {
.list_voltage = regulator_list_voltage_linear,
.map_voltage = regulator_map_voltage_linear,
.is_enabled = max8998_ldo_is_enabled,
.enable = max8998_ldo_enable,
.disable = max8998_ldo_disable,
.get_voltage_sel = max8998_get_voltage_sel,
.set_voltage_sel = max8998_set_voltage_buck_sel,
.set_voltage_time_sel = max8998_set_voltage_buck_time_sel,
};
static const struct regulator_ops max8998_others_ops = {
.is_enabled = max8998_ldo_is_enabled,
.enable = max8998_ldo_enable,
.disable = max8998_ldo_disable,
};
#define MAX8998_LINEAR_REG(_name, _ops, _min, _step, _max) \
{ \
.name = #_name, \
.id = MAX8998_##_name, \
.ops = _ops, \
.min_uV = (_min), \
.uV_step = (_step), \
.n_voltages = ((_max) - (_min)) / (_step) + 1, \
.type = REGULATOR_VOLTAGE, \
.owner = THIS_MODULE, \
}
#define MAX8998_OTHERS_REG(_name, _id) \
{ \
.name = #_name, \
.id = _id, \
.ops = &max8998_others_ops, \
.type = REGULATOR_VOLTAGE, \
.owner = THIS_MODULE, \
}
static const struct regulator_desc regulators[] = {
MAX8998_LINEAR_REG(LDO2, &max8998_ldo_ops, 800000, 50000, 1300000),
MAX8998_LINEAR_REG(LDO3, &max8998_ldo_ops, 800000, 50000, 1300000),
MAX8998_LINEAR_REG(LDO4, &max8998_ldo_ops, 1600000, 100000, 3600000),
MAX8998_LINEAR_REG(LDO5, &max8998_ldo_ops, 1600000, 100000, 3600000),
MAX8998_LINEAR_REG(LDO6, &max8998_ldo_ops, 1600000, 100000, 3600000),
MAX8998_LINEAR_REG(LDO7, &max8998_ldo_ops, 1600000, 100000, 3600000),
MAX8998_LINEAR_REG(LDO8, &max8998_ldo_ops, 3000000, 100000, 3600000),
MAX8998_LINEAR_REG(LDO9, &max8998_ldo_ops, 2800000, 100000, 3100000),
MAX8998_LINEAR_REG(LDO10, &max8998_ldo_ops, 950000, 50000, 1300000),
MAX8998_LINEAR_REG(LDO11, &max8998_ldo_ops, 1600000, 100000, 3600000),
MAX8998_LINEAR_REG(LDO12, &max8998_ldo_ops, 800000, 100000, 3300000),
MAX8998_LINEAR_REG(LDO13, &max8998_ldo_ops, 800000, 100000, 3300000),
MAX8998_LINEAR_REG(LDO14, &max8998_ldo_ops, 1200000, 100000, 3300000),
MAX8998_LINEAR_REG(LDO15, &max8998_ldo_ops, 1200000, 100000, 3300000),
MAX8998_LINEAR_REG(LDO16, &max8998_ldo_ops, 1600000, 100000, 3600000),
MAX8998_LINEAR_REG(LDO17, &max8998_ldo_ops, 1600000, 100000, 3600000),
MAX8998_LINEAR_REG(BUCK1, &max8998_buck_ops, 750000, 25000, 1525000),
MAX8998_LINEAR_REG(BUCK2, &max8998_buck_ops, 750000, 25000, 1525000),
MAX8998_LINEAR_REG(BUCK3, &max8998_buck_ops, 1600000, 100000, 3600000),
MAX8998_LINEAR_REG(BUCK4, &max8998_buck_ops, 800000, 100000, 2300000),
MAX8998_OTHERS_REG(EN32KHz-AP, MAX8998_EN32KHZ_AP),
MAX8998_OTHERS_REG(EN32KHz-CP, MAX8998_EN32KHZ_CP),
MAX8998_OTHERS_REG(ENVICHG, MAX8998_ENVICHG),
MAX8998_OTHERS_REG(ESAFEOUT1, MAX8998_ESAFEOUT1),
MAX8998_OTHERS_REG(ESAFEOUT2, MAX8998_ESAFEOUT2),
};
static int max8998_pmic_dt_parse_dvs_gpio(struct max8998_dev *iodev,
struct max8998_platform_data *pdata,
struct device_node *pmic_np)
{
int gpio;
gpio = of_get_named_gpio(pmic_np, "max8998,pmic-buck1-dvs-gpios", 0);
if (!gpio_is_valid(gpio)) {
dev_err(iodev->dev, "invalid buck1 gpio[0]: %d\n", gpio);
return -EINVAL;
}
pdata->buck1_set1 = gpio;
gpio = of_get_named_gpio(pmic_np, "max8998,pmic-buck1-dvs-gpios", 1);
if (!gpio_is_valid(gpio)) {
dev_err(iodev->dev, "invalid buck1 gpio[1]: %d\n", gpio);
return -EINVAL;
}
pdata->buck1_set2 = gpio;
gpio = of_get_named_gpio(pmic_np, "max8998,pmic-buck2-dvs-gpio", 0);
if (!gpio_is_valid(gpio)) {
dev_err(iodev->dev, "invalid buck 2 gpio: %d\n", gpio);
return -EINVAL;
}
pdata->buck2_set3 = gpio;
return 0;
}
static int max8998_pmic_dt_parse_pdata(struct max8998_dev *iodev,
struct max8998_platform_data *pdata)
{
struct device_node *pmic_np = iodev->dev->of_node;
struct device_node *regulators_np, *reg_np;
struct max8998_regulator_data *rdata;
unsigned int i;
int ret;
regulators_np = of_get_child_by_name(pmic_np, "regulators");
if (!regulators_np) {
dev_err(iodev->dev, "could not find regulators sub-node\n");
return -EINVAL;
}
/* count the number of regulators to be supported in pmic */
pdata->num_regulators = of_get_child_count(regulators_np);
rdata = devm_kcalloc(iodev->dev,
pdata->num_regulators, sizeof(*rdata),
GFP_KERNEL);
if (!rdata) {
of_node_put(regulators_np);
return -ENOMEM;
}
pdata->regulators = rdata;
for (i = 0; i < ARRAY_SIZE(regulators); ++i) {
reg_np = of_get_child_by_name(regulators_np,
regulators[i].name);
if (!reg_np)
continue;
rdata->id = regulators[i].id;
rdata->initdata = of_get_regulator_init_data(iodev->dev,
reg_np,
®ulators[i]);
rdata->reg_node = reg_np;
++rdata;
}
pdata->num_regulators = rdata - pdata->regulators;
of_node_put(reg_np);
of_node_put(regulators_np);
ret = max8998_pmic_dt_parse_dvs_gpio(iodev, pdata, pmic_np);
if (ret)
return -EINVAL;
if (of_find_property(pmic_np, "max8998,pmic-buck-voltage-lock", NULL))
pdata->buck_voltage_lock = true;
ret = of_property_read_u32(pmic_np,
"max8998,pmic-buck1-default-dvs-idx",
&pdata->buck1_default_idx);
if (!ret && pdata->buck1_default_idx >= 4) {
pdata->buck1_default_idx = 0;
dev_warn(iodev->dev, "invalid value for default dvs index, using 0 instead\n");
}
ret = of_property_read_u32(pmic_np,
"max8998,pmic-buck2-default-dvs-idx",
&pdata->buck2_default_idx);
if (!ret && pdata->buck2_default_idx >= 2) {
pdata->buck2_default_idx = 0;
dev_warn(iodev->dev, "invalid value for default dvs index, using 0 instead\n");
}
ret = of_property_read_u32_array(pmic_np,
"max8998,pmic-buck1-dvs-voltage",
pdata->buck1_voltage,
ARRAY_SIZE(pdata->buck1_voltage));
if (ret) {
dev_err(iodev->dev, "buck1 voltages not specified\n");
return -EINVAL;
}
ret = of_property_read_u32_array(pmic_np,
"max8998,pmic-buck2-dvs-voltage",
pdata->buck2_voltage,
ARRAY_SIZE(pdata->buck2_voltage));
if (ret) {
dev_err(iodev->dev, "buck2 voltages not specified\n");
return -EINVAL;
}
return 0;
}
static int max8998_pmic_probe(struct platform_device *pdev)
{
struct max8998_dev *iodev = dev_get_drvdata(pdev->dev.parent);
struct max8998_platform_data *pdata = iodev->pdata;
struct regulator_config config = { };
struct regulator_dev *rdev;
struct max8998_data *max8998;
struct i2c_client *i2c;
int i, ret;
unsigned int v;
if (!pdata) {
dev_err(pdev->dev.parent, "No platform init data supplied\n");
return -ENODEV;
}
if (IS_ENABLED(CONFIG_OF) && iodev->dev->of_node) {
ret = max8998_pmic_dt_parse_pdata(iodev, pdata);
if (ret)
return ret;
}
max8998 = devm_kzalloc(&pdev->dev, sizeof(struct max8998_data),
GFP_KERNEL);
if (!max8998)
return -ENOMEM;
max8998->dev = &pdev->dev;
max8998->iodev = iodev;
max8998->num_regulators = pdata->num_regulators;
platform_set_drvdata(pdev, max8998);
i2c = max8998->iodev->i2c;
max8998->buck1_idx = pdata->buck1_default_idx;
max8998->buck2_idx = pdata->buck2_default_idx;
/* NOTE: */
/* For unused GPIO NOT marked as -1 (thereof equal to 0) WARN_ON */
/* will be displayed */
/* Check if MAX8998 voltage selection GPIOs are defined */
if (gpio_is_valid(pdata->buck1_set1) &&
gpio_is_valid(pdata->buck1_set2)) {
/* Check if SET1 is not equal to 0 */
if (!pdata->buck1_set1) {
dev_err(&pdev->dev,
"MAX8998 SET1 GPIO defined as 0 !\n");
WARN_ON(!pdata->buck1_set1);
return -EIO;
}
/* Check if SET2 is not equal to 0 */
if (!pdata->buck1_set2) {
dev_err(&pdev->dev,
"MAX8998 SET2 GPIO defined as 0 !\n");
WARN_ON(!pdata->buck1_set2);
return -EIO;
}
gpio_request(pdata->buck1_set1, "MAX8998 BUCK1_SET1");
gpio_direction_output(pdata->buck1_set1,
max8998->buck1_idx & 0x1);
gpio_request(pdata->buck1_set2, "MAX8998 BUCK1_SET2");
gpio_direction_output(pdata->buck1_set2,
(max8998->buck1_idx >> 1) & 0x1);
/* Set predefined values for BUCK1 registers */
for (v = 0; v < ARRAY_SIZE(pdata->buck1_voltage); ++v) {
int index = MAX8998_BUCK1 - MAX8998_LDO2;
i = 0;
while (regulators[index].min_uV +
regulators[index].uV_step * i
< pdata->buck1_voltage[v])
i++;
max8998->buck1_vol[v] = i;
ret = max8998_write_reg(i2c,
MAX8998_REG_BUCK1_VOLTAGE1 + v, i);
if (ret)
return ret;
}
}
if (gpio_is_valid(pdata->buck2_set3)) {
/* Check if SET3 is not equal to 0 */
if (!pdata->buck2_set3) {
dev_err(&pdev->dev,
"MAX8998 SET3 GPIO defined as 0 !\n");
WARN_ON(!pdata->buck2_set3);
return -EIO;
}
gpio_request(pdata->buck2_set3, "MAX8998 BUCK2_SET3");
gpio_direction_output(pdata->buck2_set3,
max8998->buck2_idx & 0x1);
/* Set predefined values for BUCK2 registers */
for (v = 0; v < ARRAY_SIZE(pdata->buck2_voltage); ++v) {
int index = MAX8998_BUCK2 - MAX8998_LDO2;
i = 0;
while (regulators[index].min_uV +
regulators[index].uV_step * i
< pdata->buck2_voltage[v])
i++;
max8998->buck2_vol[v] = i;
ret = max8998_write_reg(i2c,
MAX8998_REG_BUCK2_VOLTAGE1 + v, i);
if (ret)
return ret;
}
}
for (i = 0; i < pdata->num_regulators; i++) {
int index = pdata->regulators[i].id - MAX8998_LDO2;
config.dev = max8998->dev;
config.of_node = pdata->regulators[i].reg_node;
config.init_data = pdata->regulators[i].initdata;
config.driver_data = max8998;
rdev = devm_regulator_register(&pdev->dev, ®ulators[index],
&config);
if (IS_ERR(rdev)) {
ret = PTR_ERR(rdev);
dev_err(max8998->dev, "regulator %s init failed (%d)\n",
regulators[index].name, ret);
return ret;
}
}
return 0;
}
static const struct platform_device_id max8998_pmic_id[] = {
{ "max8998-pmic", TYPE_MAX8998 },
{ "lp3974-pmic", TYPE_LP3974 },
{ }
};
MODULE_DEVICE_TABLE(platform, max8998_pmic_id);
static struct platform_driver max8998_pmic_driver = {
.driver = {
.name = "max8998-pmic",
},
.probe = max8998_pmic_probe,
.id_table = max8998_pmic_id,
};
static int __init max8998_pmic_init(void)
{
return platform_driver_register(&max8998_pmic_driver);
}
subsys_initcall(max8998_pmic_init);
static void __exit max8998_pmic_cleanup(void)
{
platform_driver_unregister(&max8998_pmic_driver);
}
module_exit(max8998_pmic_cleanup);
MODULE_DESCRIPTION("MAXIM 8998 voltage regulator driver");
MODULE_AUTHOR("Kyungmin Park <[email protected]>");
MODULE_LICENSE("GPL");
|
{
"pile_set_name": "Github"
}
|
# TensorFlow SavedModel Import Demo
This demo imports a TensorFlow model that is generated by tf.while_loop
for inference in the browser. The model was pre-converted to TensorFlow.js
format and hosted on Google Cloud, using the steps in
the repo's [README.md](../../README.md).
The following commands will start a web server on `localhost:1234` and open
a browser page with the demo.
The demo allows you to change the conditions of the loop interactively and observe the execution result right in the browser.
```bash
cd demo # If not already in the demo directory.
yarn # Installs dependencies.
yarn control_flow # Starts a web server and opens a page. Also watches for changes.
```
|
{
"pile_set_name": "Github"
}
|
# These are supported funding model platforms
github: spacehuhn
patreon: spacehuhn
open_collective: # Replace with a single Open Collective username
ko_fi: # Replace with a single Ko-fi username
tidelift: # Replace with a single Tidelift platform-name/package-name e.g., npm/babel
community_bridge: # Replace with a single Community Bridge project-name e.g., cloud-foundry
liberapay: spacehuhn
issuehunt: # Replace with a single IssueHunt username
otechie: # Replace with a single Otechie username
custom: ['paypal.me/spacechicken','tindie.com/stores/Spacehuhn/']
|
{
"pile_set_name": "Github"
}
|
<?xml version="1.0" encoding="utf-8"?>
<Project ToolsVersion="4.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<PropertyGroup>
<Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
<Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
<ProjectTypeGuids>{82b43b9b-a64c-4715-b499-d71e9ca2bd60};{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}</ProjectTypeGuids>
<ProjectGuid>{E0B3D9B1-A682-4124-8AE5-0A94644EFF36}</ProjectGuid>
<OutputType>Library</OutputType>
<AppDesignerFolder>Properties</AppDesignerFolder>
<RootNamespace>WpfTemplateProject</RootNamespace>
<AssemblyName>WpfTemplateProject</AssemblyName>
<TargetFrameworkVersion>v4.0</TargetFrameworkVersion>
<FileAlignment>512</FileAlignment>
<GeneratePkgDefFile>false</GeneratePkgDefFile>
<IncludeAssemblyInVSIXContainer>false</IncludeAssemblyInVSIXContainer>
<IncludeDebugSymbolsInVSIXContainer>false</IncludeDebugSymbolsInVSIXContainer>
<IncludeDebugSymbolsInLocalVSIXDeployment>false</IncludeDebugSymbolsInLocalVSIXDeployment>
<CreateVsixContainer>false</CreateVsixContainer>
<DeployExtension>false</DeployExtension>
<DeployVSTemplates>false</DeployVSTemplates>
<CopyVsixManifestToOutput>false</CopyVsixManifestToOutput>
<CopyBuildOutputToOutputDirectory>false</CopyBuildOutputToOutputDirectory>
<CopyOutputSymbolsToOutputDirectory>false</CopyOutputSymbolsToOutputDirectory>
<SccProjectName>
</SccProjectName>
<SccLocalPath>
</SccLocalPath>
<SccAuxPath>
</SccAuxPath>
<SccProvider>
</SccProvider>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
<DebugSymbols>true</DebugSymbols>
<DebugType>full</DebugType>
<Optimize>false</Optimize>
<OutputPath>bin\Debug\</OutputPath>
<DefineConstants>DEBUG;TRACE</DefineConstants>
<ErrorReport>prompt</ErrorReport>
<WarningLevel>4</WarningLevel>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
<DebugType>pdbonly</DebugType>
<Optimize>true</Optimize>
<OutputPath>bin\Release\</OutputPath>
<DefineConstants>TRACE</DefineConstants>
<ErrorReport>prompt</ErrorReport>
<WarningLevel>4</WarningLevel>
</PropertyGroup>
<ItemGroup>
<Reference Include="Microsoft.VisualStudio.CoreUtility">
<Private>False</Private>
</Reference>
<Reference Include="System" />
<Reference Include="System.Core" />
<Reference Include="System.Data" />
<Reference Include="System.Xml" />
</ItemGroup>
<ItemGroup>
<None Include="App.xaml.cs">
<DependentUpon>App.xaml</DependentUpon>
</None>
<None Include="MainWindow.xaml.cs">
<DependentUpon>MainWindow.xaml</DependentUpon>
</None>
<None Include="Properties\AssemblyInfo.cs" />
<None Include="app.config" />
<None Include="Properties\Resources.Designer.cs" />
<None Include="Properties\Settings.Designer.cs" />
</ItemGroup>
<ItemGroup>
<None Include="AssemblyInfo.cs" />
<None Include="Properties\Settings.settings" />
<None Include="WpfTemplateProject.ico" />
</ItemGroup>
<ItemGroup>
<VSTemplate Include="WpfTemplateProject.vstemplate" />
</ItemGroup>
<ItemGroup>
<None Include="Properties\Resources.resx" />
</ItemGroup>
<ItemGroup>
<None Include="Dependencies\SharpGL.dll" />
<None Include="Dependencies\SharpGL.SceneGraph.dll" />
<None Include="Dependencies\SharpGL.WPF.dll" />
</ItemGroup>
<ItemGroup>
<None Include="__TemplateIcon.ico" />
</ItemGroup>
<ItemGroup>
<None Include="App.xaml">
<Generator>MSBuild:Compile</Generator>
<SubType>Designer</SubType>
</None>
</ItemGroup>
<ItemGroup>
<None Include="MainWindow.xaml">
<Generator>MSBuild:Compile</Generator>
<SubType>Designer</SubType>
</None>
</ItemGroup>
<ItemGroup>
<None Include="WpfTemplate.csproj" />
</ItemGroup>
<Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
<Import Project="$(MSBuildExtensionsPath)\Microsoft\VisualStudio\v10.0\VSSDK\Microsoft.VsSDK.targets" />
<!-- To modify your build process, add your task inside one of the targets below and uncomment it.
Other similar extension points exist, see Microsoft.Common.targets.
<Target Name="BeforeBuild">
</Target>
<Target Name="AfterBuild">
</Target>
-->
</Project>
|
{
"pile_set_name": "Github"
}
|
class SlugValidator < ActiveModel::EachValidator
def validate_each(record, attribute, value)
unless value =~ /^[\w-]+$/i
record.errors.add(attribute, :slug, options.merge(value: value))
end
end
end
|
{
"pile_set_name": "Github"
}
|
require('../../modules/es6.typed.data-view');
require('../../modules/es6.object.to-string');
module.exports = require('../../modules/_core').DataView;
|
{
"pile_set_name": "Github"
}
|
"use strict";
Object.defineProperty(exports, "__esModule", {
value: true
});
exports.default = void 0;
var _default = pattern => /(\[ext\])|(\[name\])|(\[path\])|(\[folder\])|(\[emoji(?::(\d+))?\])|(\[(?:([^:\]]+):)?(?:hash|contenthash)(?::([a-z]+\d*))?(?::(\d+))?\])|(\[\d+\])/.test(pattern);
exports.default = _default;
|
{
"pile_set_name": "Github"
}
|
# See the OWNERS docs at https://go.k8s.io/owners
reviewers:
- thockin
- smarterclayton
- wojtek-t
- deads2k
- brendandburns
- derekwaynecarr
- caesarxuchao
- mikedanese
- liggitt
- nikhiljindal
- gmarek
- justinsb
- ncdc
- dims
- hongchaodeng
- krousey
- euank
- ingvagabund
- jianhuiz
- sdminonne
- enj
|
{
"pile_set_name": "Github"
}
|
import React, { FC } from 'react';
const giphyLogo = require('./giphy-logo.png').default;
type Props = {
link?: string;
};
const Credit: FC<Props> = ({ link }) => (
<div className="credit">
<a
href={link || 'https://giphy.com/'}
target="_blank"
rel="noopener noreferrer"
>
<img src={giphyLogo} />
</a>
</div>
);
export default Credit;
|
{
"pile_set_name": "Github"
}
|
// *** WARNING: this file was generated by the Pulumi Terraform Bridge (tfgen) Tool. ***
// *** Do not edit by hand unless you're certain you know what you are doing! ***
using System;
using System.Collections.Generic;
using System.Collections.Immutable;
using System.Threading.Tasks;
using Pulumi.Serialization;
namespace Pulumi.Aws.WafV2.Inputs
{
public sealed class WebAclRuleStatementOrStatementStatementNotStatementStatementNotStatementStatementXssMatchStatementFieldToMatchGetArgs : Pulumi.ResourceArgs
{
/// <summary>
/// Inspect all query arguments.
/// </summary>
[Input("allQueryArguments")]
public Input<Inputs.WebAclRuleStatementOrStatementStatementNotStatementStatementNotStatementStatementXssMatchStatementFieldToMatchAllQueryArgumentsGetArgs>? AllQueryArguments { get; set; }
/// <summary>
/// Inspect the request body, which immediately follows the request headers.
/// </summary>
[Input("body")]
public Input<Inputs.WebAclRuleStatementOrStatementStatementNotStatementStatementNotStatementStatementXssMatchStatementFieldToMatchBodyGetArgs>? Body { get; set; }
/// <summary>
/// Inspect the HTTP method. The method indicates the type of operation that the request is asking the origin to perform.
/// </summary>
[Input("method")]
public Input<Inputs.WebAclRuleStatementOrStatementStatementNotStatementStatementNotStatementStatementXssMatchStatementFieldToMatchMethodGetArgs>? Method { get; set; }
/// <summary>
/// Inspect the query string. This is the part of a URL that appears after a `?` character, if any.
/// </summary>
[Input("queryString")]
public Input<Inputs.WebAclRuleStatementOrStatementStatementNotStatementStatementNotStatementStatementXssMatchStatementFieldToMatchQueryStringGetArgs>? QueryString { get; set; }
/// <summary>
/// Inspect a single header. See Single Header below for details.
/// </summary>
[Input("singleHeader")]
public Input<Inputs.WebAclRuleStatementOrStatementStatementNotStatementStatementNotStatementStatementXssMatchStatementFieldToMatchSingleHeaderGetArgs>? SingleHeader { get; set; }
/// <summary>
/// Inspect a single query argument. See Single Query Argument below for details.
/// </summary>
[Input("singleQueryArgument")]
public Input<Inputs.WebAclRuleStatementOrStatementStatementNotStatementStatementNotStatementStatementXssMatchStatementFieldToMatchSingleQueryArgumentGetArgs>? SingleQueryArgument { get; set; }
/// <summary>
/// Inspect the request URI path. This is the part of a web request that identifies a resource, for example, `/images/daily-ad.jpg`.
/// </summary>
[Input("uriPath")]
public Input<Inputs.WebAclRuleStatementOrStatementStatementNotStatementStatementNotStatementStatementXssMatchStatementFieldToMatchUriPathGetArgs>? UriPath { get; set; }
public WebAclRuleStatementOrStatementStatementNotStatementStatementNotStatementStatementXssMatchStatementFieldToMatchGetArgs()
{
}
}
}
|
{
"pile_set_name": "Github"
}
|
var _ = require('lodash');
exports.parse = function(node, state) {
_.extend(state, {
itemArrayDefinition: {
parents: [
'Ti.UI.ButtonBar',
'Ti.UI.iOS.TabbedBar',
'Ti.UI.TabbedBar'
],
children: [
'Alloy.Abstract.BarItemType'
],
translations: [
{ from: 'Ti.UI.Label', to: 'Alloy.Abstract.BarItemType' }
],
property: 'labels'
}
});
return require('./Alloy.Abstract._ItemArray').parse(node, state);
};
|
{
"pile_set_name": "Github"
}
|
libavcodec/rl2.o: libavcodec/rl2.c libavutil/internal.h config.h \
libavutil/attributes.h libavutil/timer.h libavutil/log.h \
libavutil/avutil.h libavutil/common.h libavutil/macros.h \
libavutil/version.h libavutil/avconfig.h libavutil/intmath.h \
libavutil/mem.h libavutil/error.h libavutil/internal.h \
libavutil/rational.h libavutil/mathematics.h libavutil/intfloat.h \
libavutil/pixfmt.h libavutil/cpu.h libavutil/dict.h libavutil/libm.h \
libavutil/intreadwrite.h libavutil/bswap.h libavutil/mem.h \
libavcodec/avcodec.h libavutil/samplefmt.h libavutil/attributes.h \
libavutil/avutil.h libavutil/buffer.h libavutil/cpu.h \
libavutil/channel_layout.h libavutil/dict.h libavutil/frame.h \
libavutil/buffer.h libavutil/samplefmt.h libavutil/log.h \
libavutil/pixfmt.h libavutil/rational.h libavcodec/version.h \
libavutil/version.h libavcodec/internal.h libavutil/mathematics.h
|
{
"pile_set_name": "Github"
}
|
<annotation>
<folder>widerface</folder>
<filename>23--Shoppers_23_Shoppers_Shoppers_23_85.jpg</filename>
<source>
<database>wider face Database</database>
<annotation>PASCAL VOC2007</annotation>
<image>flickr</image>
<flickrid>-1</flickrid>
</source>
<owner>
<flickrid>yanyu</flickrid>
<name>yanyu</name>
</owner>
<size>
<width>1024</width>
<height>683</height>
<depth>3</depth>
</size>
<segmented>0</segmented>
<object>
<name>face</name>
<pose>Unspecified</pose>
<truncated>1</truncated>
<difficult>0</difficult>
<bndbox>
<xmin>194</xmin>
<ymin>190</ymin>
<xmax>368</xmax>
<ymax>350</ymax>
</bndbox>
<lm>
<x1>252.062</x1>
<y1>256.375</y1>
<x2>327.531</x2>
<y2>238.875</y2>
<x3>307.844</x3>
<y3>270.594</y3>
<x4>288.156</x4>
<y4>319.812</y4>
<x5>336.281</x5>
<y5>306.688</y5>
<visible>0</visible>
<blur>0.88</blur>
</lm>
<has_lm>1</has_lm>
</object>
</annotation>
|
{
"pile_set_name": "Github"
}
|
// Copyright 2014 The Chromium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
#include "chrome/browser/chromeos/file_manager/filesystem_api_util.h"
#include <memory>
#include "base/callback.h"
#include "base/files/file.h"
#include "base/files/file_path.h"
#include "chrome/browser/chromeos/drive/file_system_util.h"
#include "chrome/browser/chromeos/file_manager/app_id.h"
#include "chrome/browser/chromeos/file_manager/fileapi_util.h"
#include "chrome/browser/chromeos/file_system_provider/mount_path_util.h"
#include "chrome/browser/chromeos/file_system_provider/provided_file_system_interface.h"
#include "chrome/browser/extensions/extension_util.h"
#include "chrome/browser/profiles/profile.h"
#include "components/drive/chromeos/file_system_interface.h"
#include "components/drive/file_errors.h"
#include "components/drive/file_system_core_util.h"
#include "content/public/browser/browser_thread.h"
#include "content/public/browser/storage_partition.h"
#include "google_apis/drive/task_util.h"
#include "storage/browser/fileapi/file_system_context.h"
namespace file_manager {
namespace util {
namespace {
// Helper function used to implement GetNonNativeLocalPathMimeType. It extracts
// the mime type from the passed Drive resource entry.
void GetMimeTypeAfterGetResourceEntryForDrive(
const base::Callback<void(bool, const std::string&)>& callback,
drive::FileError error,
std::unique_ptr<drive::ResourceEntry> entry) {
DCHECK_CURRENTLY_ON(content::BrowserThread::UI);
if (error != drive::FILE_ERROR_OK || !entry->has_file_specific_info() ||
entry->file_specific_info().content_mime_type().empty()) {
callback.Run(false, std::string());
return;
}
callback.Run(true, entry->file_specific_info().content_mime_type());
}
// Helper function used to implement GetNonNativeLocalPathMimeType. It extracts
// the mime type from the passed metadata from a providing extension.
void GetMimeTypeAfterGetMetadataForProvidedFileSystem(
const base::Callback<void(bool, const std::string&)>& callback,
std::unique_ptr<chromeos::file_system_provider::EntryMetadata> metadata,
base::File::Error result) {
DCHECK_CURRENTLY_ON(content::BrowserThread::UI);
if (result != base::File::FILE_OK || !metadata->mime_type.get()) {
callback.Run(false, std::string());
return;
}
callback.Run(true, *metadata->mime_type);
}
// Helper function to converts a callback that takes boolean value to that takes
// File::Error, by regarding FILE_OK as the only successful value.
void BoolCallbackAsFileErrorCallback(
const base::Callback<void(bool)>& callback,
base::File::Error error) {
return callback.Run(error == base::File::FILE_OK);
}
// Part of PrepareFileOnIOThread. It tries to create a new file if the given
// |url| is not already inhabited.
void PrepareFileAfterCheckExistOnIOThread(
scoped_refptr<storage::FileSystemContext> file_system_context,
const storage::FileSystemURL& url,
const storage::FileSystemOperation::StatusCallback& callback,
base::File::Error error) {
DCHECK_CURRENTLY_ON(content::BrowserThread::IO);
if (error != base::File::FILE_ERROR_NOT_FOUND) {
callback.Run(error);
return;
}
// Call with the second argument |exclusive| set to false, meaning that it
// is not an error even if the file already exists (it can happen if the file
// is created after the previous FileExists call and before this CreateFile.)
//
// Note that the preceding call to FileExists is necessary for handling
// read only filesystems that blindly rejects handling CreateFile().
file_system_context->operation_runner()->CreateFile(url, false, callback);
}
// Checks whether a file exists at the given |url|, and try creating it if it
// is not already there.
void PrepareFileOnIOThread(
scoped_refptr<storage::FileSystemContext> file_system_context,
const storage::FileSystemURL& url,
const base::Callback<void(bool)>& callback) {
DCHECK_CURRENTLY_ON(content::BrowserThread::IO);
file_system_context->operation_runner()->FileExists(
url,
base::Bind(&PrepareFileAfterCheckExistOnIOThread,
file_system_context,
url,
base::Bind(&BoolCallbackAsFileErrorCallback, callback)));
}
} // namespace
bool IsNonNativeFileSystemType(storage::FileSystemType type) {
switch (type) {
case storage::kFileSystemTypeNativeLocal:
case storage::kFileSystemTypeRestrictedNativeLocal:
return false;
default:
// The path indeed corresponds to a mount point not associated with a
// native local path.
return true;
}
}
bool IsUnderNonNativeLocalPath(Profile* profile,
const base::FilePath& path) {
DCHECK_CURRENTLY_ON(content::BrowserThread::UI);
GURL url;
if (!util::ConvertAbsoluteFilePathToFileSystemUrl(
profile, path, kFileManagerAppId, &url)) {
return false;
}
storage::FileSystemURL filesystem_url =
GetFileSystemContextForExtensionId(profile, kFileManagerAppId)
->CrackURL(url);
if (!filesystem_url.is_valid())
return false;
return IsNonNativeFileSystemType(filesystem_url.type());
}
void GetNonNativeLocalPathMimeType(
Profile* profile,
const base::FilePath& path,
const base::Callback<void(bool, const std::string&)>& callback) {
DCHECK_CURRENTLY_ON(content::BrowserThread::UI);
DCHECK(IsUnderNonNativeLocalPath(profile, path));
if (drive::util::IsUnderDriveMountPoint(path)) {
drive::FileSystemInterface* file_system =
drive::util::GetFileSystemByProfile(profile);
if (!file_system) {
content::BrowserThread::PostTask(
content::BrowserThread::UI,
FROM_HERE,
base::Bind(callback, false, std::string()));
return;
}
file_system->GetResourceEntry(
drive::util::ExtractDrivePath(path),
base::Bind(&GetMimeTypeAfterGetResourceEntryForDrive, callback));
return;
}
if (chromeos::file_system_provider::util::IsFileSystemProviderLocalPath(
path)) {
chromeos::file_system_provider::util::LocalPathParser parser(profile, path);
if (!parser.Parse()) {
content::BrowserThread::PostTask(
content::BrowserThread::UI,
FROM_HERE,
base::Bind(callback, false, std::string()));
return;
}
parser.file_system()->GetMetadata(
parser.file_path(),
chromeos::file_system_provider::ProvidedFileSystemInterface::
METADATA_FIELD_MIME_TYPE,
base::Bind(&GetMimeTypeAfterGetMetadataForProvidedFileSystem,
callback));
return;
}
// We don't have a way to obtain metadata other than drive and FSP. Returns an
// error with empty MIME type, that leads fallback guessing mime type from
// file extensions.
content::BrowserThread::PostTask(
content::BrowserThread::UI,
FROM_HERE,
base::Bind(callback, false /* failure */, std::string()));
}
void IsNonNativeLocalPathDirectory(
Profile* profile,
const base::FilePath& path,
const base::Callback<void(bool)>& callback) {
DCHECK_CURRENTLY_ON(content::BrowserThread::UI);
DCHECK(IsUnderNonNativeLocalPath(profile, path));
util::CheckIfDirectoryExists(
GetFileSystemContextForExtensionId(profile, kFileManagerAppId), path,
base::Bind(&BoolCallbackAsFileErrorCallback, callback));
}
void PrepareNonNativeLocalFileForWritableApp(
Profile* profile,
const base::FilePath& path,
const base::Callback<void(bool)>& callback) {
DCHECK_CURRENTLY_ON(content::BrowserThread::UI);
DCHECK(IsUnderNonNativeLocalPath(profile, path));
GURL url;
if (!util::ConvertAbsoluteFilePathToFileSystemUrl(
profile, path, kFileManagerAppId, &url)) {
// Posting to the current thread, so that we always call back asynchronously
// independent from whether or not the operation succeeds.
content::BrowserThread::PostTask(content::BrowserThread::UI,
FROM_HERE,
base::Bind(callback, false));
return;
}
scoped_refptr<storage::FileSystemContext> const file_system_context =
GetFileSystemContextForExtensionId(profile, kFileManagerAppId);
DCHECK(file_system_context);
storage::ExternalFileSystemBackend* const backend =
file_system_context->external_backend();
DCHECK(backend);
const storage::FileSystemURL internal_url =
backend->CreateInternalURL(file_system_context.get(), path);
content::BrowserThread::PostTask(
content::BrowserThread::IO, FROM_HERE,
base::Bind(&PrepareFileOnIOThread, file_system_context, internal_url,
google_apis::CreateRelayCallback(callback)));
}
} // namespace util
} // namespace file_manager
|
{
"pile_set_name": "Github"
}
|
import { ValidateOnConfig } from './useField';
interface Config {
validateOn: ValidateOnConfig;
errorClass: string;
}
const config: Config = {
validateOn: { change: true, blur: true },
errorClass: 'invalid-field',
};
export default config;
|
{
"pile_set_name": "Github"
}
|
{
"images" : [
{
"idiom" : "universal",
"scale" : "1x"
},
{
"idiom" : "universal",
"filename" : "[email protected]",
"scale" : "2x"
},
{
"idiom" : "universal",
"scale" : "3x"
}
],
"info" : {
"version" : 1,
"author" : "xcode"
}
}
|
{
"pile_set_name": "Github"
}
|
##
# This file is part of WhatWeb and may be subject to
# redistribution and commercial restrictions. Please see the WhatWeb
# web site for more information on licensing and terms of use.
# http://www.morningstarsecurity.com/research/whatweb
##
Plugin.define "Diaspora" do
author "Brendan Coles <[email protected]>" # 2011-10-30
version "0.1"
description "Diaspora - social networking service"
website "https://joindiaspora.com/"
# Source: https://github.com/diaspora/diaspora
# Needs more matches
# ShodanHQ results as at 2011-10-30 #
# 31 for _diaspora_session
# 7 for X-Git-Update
# Google results as at 2011-10-30 #
# 182 for intitle:"Sign In" "Sign up" "Forgot your password?" inurl:"users/sign_in"
# Dorks #
dorks [
'intitle:"Sign In" "Sign up" "Forgot your password?" inurl:"users/sign_in"'
]
# Matches #
matches [
# Set-Cookie: _diaspora_session=
{ :search=>"headers[set-cookie]", :regexp=>/_diaspora_session=/ },
# X-Git-Update
{ :search=>"headers[x-git-update]", :string=>/^([\d]{4}-[\d]{2}-[\d]{2} [\d]{2}:[\d]{2}:[\d]{2} .+)$/ },
# X-Git-Revision
{ :search=>"headers[x-git-revision]", :regexp=>/^[a-f\d]{32}$/ },
# Login Page # Remember Me
{ :text=>'<input name="user[remember_me]" type="hidden" value="0" /><input id="user_remember_me" name="user[remember_me]" type="checkbox" value="1" />' },
]
end
|
{
"pile_set_name": "Github"
}
|
GNU GENERAL PUBLIC LICENSE
Version 3, 29 June 2007
Copyright (C) 2007 Free Software Foundation, Inc. <http://fsf.org/>
Everyone is permitted to copy and distribute verbatim copies
of this license document, but changing it is not allowed.
Preamble
The GNU General Public License is a free, copyleft license for
software and other kinds of works.
The licenses for most software and other practical works are designed
to take away your freedom to share and change the works. By contrast,
the GNU General Public License is intended to guarantee your freedom to
share and change all versions of a program--to make sure it remains free
software for all its users. We, the Free Software Foundation, use the
GNU General Public License for most of our software; it applies also to
any other work released this way by its authors. You can apply it to
your programs, too.
When we speak of free software, we are referring to freedom, not
price. Our General Public Licenses are designed to make sure that you
have the freedom to distribute copies of free software (and charge for
them if you wish), that you receive source code or can get it if you
want it, that you can change the software or use pieces of it in new
free programs, and that you know you can do these things.
To protect your rights, we need to prevent others from denying you
these rights or asking you to surrender the rights. Therefore, you have
certain responsibilities if you distribute copies of the software, or if
you modify it: responsibilities to respect the freedom of others.
For example, if you distribute copies of such a program, whether
gratis or for a fee, you must pass on to the recipients the same
freedoms that you received. You must make sure that they, too, receive
or can get the source code. And you must show them these terms so they
know their rights.
Developers that use the GNU GPL protect your rights with two steps:
(1) assert copyright on the software, and (2) offer you this License
giving you legal permission to copy, distribute and/or modify it.
For the developers' and authors' protection, the GPL clearly explains
that there is no warranty for this free software. For both users' and
authors' sake, the GPL requires that modified versions be marked as
changed, so that their problems will not be attributed erroneously to
authors of previous versions.
Some devices are designed to deny users access to install or run
modified versions of the software inside them, although the manufacturer
can do so. This is fundamentally incompatible with the aim of
protecting users' freedom to change the software. The systematic
pattern of such abuse occurs in the area of products for individuals to
use, which is precisely where it is most unacceptable. Therefore, we
have designed this version of the GPL to prohibit the practice for those
products. If such problems arise substantially in other domains, we
stand ready to extend this provision to those domains in future versions
of the GPL, as needed to protect the freedom of users.
Finally, every program is threatened constantly by software patents.
States should not allow patents to restrict development and use of
software on general-purpose computers, but in those that do, we wish to
avoid the special danger that patents applied to a free program could
make it effectively proprietary. To prevent this, the GPL assures that
patents cannot be used to render the program non-free.
The precise terms and conditions for copying, distribution and
modification follow.
TERMS AND CONDITIONS
0. Definitions.
"This License" refers to version 3 of the GNU General Public License.
"Copyright" also means copyright-like laws that apply to other kinds of
works, such as semiconductor masks.
"The Program" refers to any copyrightable work licensed under this
License. Each licensee is addressed as "you". "Licensees" and
"recipients" may be individuals or organizations.
To "modify" a work means to copy from or adapt all or part of the work
in a fashion requiring copyright permission, other than the making of an
exact copy. The resulting work is called a "modified version" of the
earlier work or a work "based on" the earlier work.
A "covered work" means either the unmodified Program or a work based
on the Program.
To "propagate" a work means to do anything with it that, without
permission, would make you directly or secondarily liable for
infringement under applicable copyright law, except executing it on a
computer or modifying a private copy. Propagation includes copying,
distribution (with or without modification), making available to the
public, and in some countries other activities as well.
To "convey" a work means any kind of propagation that enables other
parties to make or receive copies. Mere interaction with a user through
a computer network, with no transfer of a copy, is not conveying.
An interactive user interface displays "Appropriate Legal Notices"
to the extent that it includes a convenient and prominently visible
feature that (1) displays an appropriate copyright notice, and (2)
tells the user that there is no warranty for the work (except to the
extent that warranties are provided), that licensees may convey the
work under this License, and how to view a copy of this License. If
the interface presents a list of user commands or options, such as a
menu, a prominent item in the list meets this criterion.
1. Source Code.
The "source code" for a work means the preferred form of the work
for making modifications to it. "Object code" means any non-source
form of a work.
A "Standard Interface" means an interface that either is an official
standard defined by a recognized standards body, or, in the case of
interfaces specified for a particular programming language, one that
is widely used among developers working in that language.
The "System Libraries" of an executable work include anything, other
than the work as a whole, that (a) is included in the normal form of
packaging a Major Component, but which is not part of that Major
Component, and (b) serves only to enable use of the work with that
Major Component, or to implement a Standard Interface for which an
implementation is available to the public in source code form. A
"Major Component", in this context, means a major essential component
(kernel, window system, and so on) of the specific operating system
(if any) on which the executable work runs, or a compiler used to
produce the work, or an object code interpreter used to run it.
The "Corresponding Source" for a work in object code form means all
the source code needed to generate, install, and (for an executable
work) run the object code and to modify the work, including scripts to
control those activities. However, it does not include the work's
System Libraries, or general-purpose tools or generally available free
programs which are used unmodified in performing those activities but
which are not part of the work. For example, Corresponding Source
includes interface definition files associated with source files for
the work, and the source code for shared libraries and dynamically
linked subprograms that the work is specifically designed to require,
such as by intimate data communication or control flow between those
subprograms and other parts of the work.
The Corresponding Source need not include anything that users
can regenerate automatically from other parts of the Corresponding
Source.
The Corresponding Source for a work in source code form is that
same work.
2. Basic Permissions.
All rights granted under this License are granted for the term of
copyright on the Program, and are irrevocable provided the stated
conditions are met. This License explicitly affirms your unlimited
permission to run the unmodified Program. The output from running a
covered work is covered by this License only if the output, given its
content, constitutes a covered work. This License acknowledges your
rights of fair use or other equivalent, as provided by copyright law.
You may make, run and propagate covered works that you do not
convey, without conditions so long as your license otherwise remains
in force. You may convey covered works to others for the sole purpose
of having them make modifications exclusively for you, or provide you
with facilities for running those works, provided that you comply with
the terms of this License in conveying all material for which you do
not control copyright. Those thus making or running the covered works
for you must do so exclusively on your behalf, under your direction
and control, on terms that prohibit them from making any copies of
your copyrighted material outside their relationship with you.
Conveying under any other circumstances is permitted solely under
the conditions stated below. Sublicensing is not allowed; section 10
makes it unnecessary.
3. Protecting Users' Legal Rights From Anti-Circumvention Law.
No covered work shall be deemed part of an effective technological
measure under any applicable law fulfilling obligations under article
11 of the WIPO copyright treaty adopted on 20 December 1996, or
similar laws prohibiting or restricting circumvention of such
measures.
When you convey a covered work, you waive any legal power to forbid
circumvention of technological measures to the extent such circumvention
is effected by exercising rights under this License with respect to
the covered work, and you disclaim any intention to limit operation or
modification of the work as a means of enforcing, against the work's
users, your or third parties' legal rights to forbid circumvention of
technological measures.
4. Conveying Verbatim Copies.
You may convey verbatim copies of the Program's source code as you
receive it, in any medium, provided that you conspicuously and
appropriately publish on each copy an appropriate copyright notice;
keep intact all notices stating that this License and any
non-permissive terms added in accord with section 7 apply to the code;
keep intact all notices of the absence of any warranty; and give all
recipients a copy of this License along with the Program.
You may charge any price or no price for each copy that you convey,
and you may offer support or warranty protection for a fee.
5. Conveying Modified Source Versions.
You may convey a work based on the Program, or the modifications to
produce it from the Program, in the form of source code under the
terms of section 4, provided that you also meet all of these conditions:
a) The work must carry prominent notices stating that you modified
it, and giving a relevant date.
b) The work must carry prominent notices stating that it is
released under this License and any conditions added under section
7. This requirement modifies the requirement in section 4 to
"keep intact all notices".
c) You must license the entire work, as a whole, under this
License to anyone who comes into possession of a copy. This
License will therefore apply, along with any applicable section 7
additional terms, to the whole of the work, and all its parts,
regardless of how they are packaged. This License gives no
permission to license the work in any other way, but it does not
invalidate such permission if you have separately received it.
d) If the work has interactive user interfaces, each must display
Appropriate Legal Notices; however, if the Program has interactive
interfaces that do not display Appropriate Legal Notices, your
work need not make them do so.
A compilation of a covered work with other separate and independent
works, which are not by their nature extensions of the covered work,
and which are not combined with it such as to form a larger program,
in or on a volume of a storage or distribution medium, is called an
"aggregate" if the compilation and its resulting copyright are not
used to limit the access or legal rights of the compilation's users
beyond what the individual works permit. Inclusion of a covered work
in an aggregate does not cause this License to apply to the other
parts of the aggregate.
6. Conveying Non-Source Forms.
You may convey a covered work in object code form under the terms
of sections 4 and 5, provided that you also convey the
machine-readable Corresponding Source under the terms of this License,
in one of these ways:
a) Convey the object code in, or embodied in, a physical product
(including a physical distribution medium), accompanied by the
Corresponding Source fixed on a durable physical medium
customarily used for software interchange.
b) Convey the object code in, or embodied in, a physical product
(including a physical distribution medium), accompanied by a
written offer, valid for at least three years and valid for as
long as you offer spare parts or customer support for that product
model, to give anyone who possesses the object code either (1) a
copy of the Corresponding Source for all the software in the
product that is covered by this License, on a durable physical
medium customarily used for software interchange, for a price no
more than your reasonable cost of physically performing this
conveying of source, or (2) access to copy the
Corresponding Source from a network server at no charge.
c) Convey individual copies of the object code with a copy of the
written offer to provide the Corresponding Source. This
alternative is allowed only occasionally and noncommercially, and
only if you received the object code with such an offer, in accord
with subsection 6b.
d) Convey the object code by offering access from a designated
place (gratis or for a charge), and offer equivalent access to the
Corresponding Source in the same way through the same place at no
further charge. You need not require recipients to copy the
Corresponding Source along with the object code. If the place to
copy the object code is a network server, the Corresponding Source
may be on a different server (operated by you or a third party)
that supports equivalent copying facilities, provided you maintain
clear directions next to the object code saying where to find the
Corresponding Source. Regardless of what server hosts the
Corresponding Source, you remain obligated to ensure that it is
available for as long as needed to satisfy these requirements.
e) Convey the object code using peer-to-peer transmission, provided
you inform other peers where the object code and Corresponding
Source of the work are being offered to the general public at no
charge under subsection 6d.
A separable portion of the object code, whose source code is excluded
from the Corresponding Source as a System Library, need not be
included in conveying the object code work.
A "User Product" is either (1) a "consumer product", which means any
tangible personal property which is normally used for personal, family,
or household purposes, or (2) anything designed or sold for incorporation
into a dwelling. In determining whether a product is a consumer product,
doubtful cases shall be resolved in favor of coverage. For a particular
product received by a particular user, "normally used" refers to a
typical or common use of that class of product, regardless of the status
of the particular user or of the way in which the particular user
actually uses, or expects or is expected to use, the product. A product
is a consumer product regardless of whether the product has substantial
commercial, industrial or non-consumer uses, unless such uses represent
the only significant mode of use of the product.
"Installation Information" for a User Product means any methods,
procedures, authorization keys, or other information required to install
and execute modified versions of a covered work in that User Product from
a modified version of its Corresponding Source. The information must
suffice to ensure that the continued functioning of the modified object
code is in no case prevented or interfered with solely because
modification has been made.
If you convey an object code work under this section in, or with, or
specifically for use in, a User Product, and the conveying occurs as
part of a transaction in which the right of possession and use of the
User Product is transferred to the recipient in perpetuity or for a
fixed term (regardless of how the transaction is characterized), the
Corresponding Source conveyed under this section must be accompanied
by the Installation Information. But this requirement does not apply
if neither you nor any third party retains the ability to install
modified object code on the User Product (for example, the work has
been installed in ROM).
The requirement to provide Installation Information does not include a
requirement to continue to provide support service, warranty, or updates
for a work that has been modified or installed by the recipient, or for
the User Product in which it has been modified or installed. Access to a
network may be denied when the modification itself materially and
adversely affects the operation of the network or violates the rules and
protocols for communication across the network.
Corresponding Source conveyed, and Installation Information provided,
in accord with this section must be in a format that is publicly
documented (and with an implementation available to the public in
source code form), and must require no special password or key for
unpacking, reading or copying.
7. Additional Terms.
"Additional permissions" are terms that supplement the terms of this
License by making exceptions from one or more of its conditions.
Additional permissions that are applicable to the entire Program shall
be treated as though they were included in this License, to the extent
that they are valid under applicable law. If additional permissions
apply only to part of the Program, that part may be used separately
under those permissions, but the entire Program remains governed by
this License without regard to the additional permissions.
When you convey a copy of a covered work, you may at your option
remove any additional permissions from that copy, or from any part of
it. (Additional permissions may be written to require their own
removal in certain cases when you modify the work.) You may place
additional permissions on material, added by you to a covered work,
for which you have or can give appropriate copyright permission.
Notwithstanding any other provision of this License, for material you
add to a covered work, you may (if authorized by the copyright holders of
that material) supplement the terms of this License with terms:
a) Disclaiming warranty or limiting liability differently from the
terms of sections 15 and 16 of this License; or
b) Requiring preservation of specified reasonable legal notices or
author attributions in that material or in the Appropriate Legal
Notices displayed by works containing it; or
c) Prohibiting misrepresentation of the origin of that material, or
requiring that modified versions of such material be marked in
reasonable ways as different from the original version; or
d) Limiting the use for publicity purposes of names of licensors or
authors of the material; or
e) Declining to grant rights under trademark law for use of some
trade names, trademarks, or service marks; or
f) Requiring indemnification of licensors and authors of that
material by anyone who conveys the material (or modified versions of
it) with contractual assumptions of liability to the recipient, for
any liability that these contractual assumptions directly impose on
those licensors and authors.
All other non-permissive additional terms are considered "further
restrictions" within the meaning of section 10. If the Program as you
received it, or any part of it, contains a notice stating that it is
governed by this License along with a term that is a further
restriction, you may remove that term. If a license document contains
a further restriction but permits relicensing or conveying under this
License, you may add to a covered work material governed by the terms
of that license document, provided that the further restriction does
not survive such relicensing or conveying.
If you add terms to a covered work in accord with this section, you
must place, in the relevant source files, a statement of the
additional terms that apply to those files, or a notice indicating
where to find the applicable terms.
Additional terms, permissive or non-permissive, may be stated in the
form of a separately written license, or stated as exceptions;
the above requirements apply either way.
8. Termination.
You may not propagate or modify a covered work except as expressly
provided under this License. Any attempt otherwise to propagate or
modify it is void, and will automatically terminate your rights under
this License (including any patent licenses granted under the third
paragraph of section 11).
However, if you cease all violation of this License, then your
license from a particular copyright holder is reinstated (a)
provisionally, unless and until the copyright holder explicitly and
finally terminates your license, and (b) permanently, if the copyright
holder fails to notify you of the violation by some reasonable means
prior to 60 days after the cessation.
Moreover, your license from a particular copyright holder is
reinstated permanently if the copyright holder notifies you of the
violation by some reasonable means, this is the first time you have
received notice of violation of this License (for any work) from that
copyright holder, and you cure the violation prior to 30 days after
your receipt of the notice.
Termination of your rights under this section does not terminate the
licenses of parties who have received copies or rights from you under
this License. If your rights have been terminated and not permanently
reinstated, you do not qualify to receive new licenses for the same
material under section 10.
9. Acceptance Not Required for Having Copies.
You are not required to accept this License in order to receive or
run a copy of the Program. Ancillary propagation of a covered work
occurring solely as a consequence of using peer-to-peer transmission
to receive a copy likewise does not require acceptance. However,
nothing other than this License grants you permission to propagate or
modify any covered work. These actions infringe copyright if you do
not accept this License. Therefore, by modifying or propagating a
covered work, you indicate your acceptance of this License to do so.
10. Automatic Licensing of Downstream Recipients.
Each time you convey a covered work, the recipient automatically
receives a license from the original licensors, to run, modify and
propagate that work, subject to this License. You are not responsible
for enforcing compliance by third parties with this License.
An "entity transaction" is a transaction transferring control of an
organization, or substantially all assets of one, or subdividing an
organization, or merging organizations. If propagation of a covered
work results from an entity transaction, each party to that
transaction who receives a copy of the work also receives whatever
licenses to the work the party's predecessor in interest had or could
give under the previous paragraph, plus a right to possession of the
Corresponding Source of the work from the predecessor in interest, if
the predecessor has it or can get it with reasonable efforts.
You may not impose any further restrictions on the exercise of the
rights granted or affirmed under this License. For example, you may
not impose a license fee, royalty, or other charge for exercise of
rights granted under this License, and you may not initiate litigation
(including a cross-claim or counterclaim in a lawsuit) alleging that
any patent claim is infringed by making, using, selling, offering for
sale, or importing the Program or any portion of it.
11. Patents.
A "contributor" is a copyright holder who authorizes use under this
License of the Program or a work on which the Program is based. The
work thus licensed is called the contributor's "contributor version".
A contributor's "essential patent claims" are all patent claims
owned or controlled by the contributor, whether already acquired or
hereafter acquired, that would be infringed by some manner, permitted
by this License, of making, using, or selling its contributor version,
but do not include claims that would be infringed only as a
consequence of further modification of the contributor version. For
purposes of this definition, "control" includes the right to grant
patent sublicenses in a manner consistent with the requirements of
this License.
Each contributor grants you a non-exclusive, worldwide, royalty-free
patent license under the contributor's essential patent claims, to
make, use, sell, offer for sale, import and otherwise run, modify and
propagate the contents of its contributor version.
In the following three paragraphs, a "patent license" is any express
agreement or commitment, however denominated, not to enforce a patent
(such as an express permission to practice a patent or covenant not to
sue for patent infringement). To "grant" such a patent license to a
party means to make such an agreement or commitment not to enforce a
patent against the party.
If you convey a covered work, knowingly relying on a patent license,
and the Corresponding Source of the work is not available for anyone
to copy, free of charge and under the terms of this License, through a
publicly available network server or other readily accessible means,
then you must either (1) cause the Corresponding Source to be so
available, or (2) arrange to deprive yourself of the benefit of the
patent license for this particular work, or (3) arrange, in a manner
consistent with the requirements of this License, to extend the patent
license to downstream recipients. "Knowingly relying" means you have
actual knowledge that, but for the patent license, your conveying the
covered work in a country, or your recipient's use of the covered work
in a country, would infringe one or more identifiable patents in that
country that you have reason to believe are valid.
If, pursuant to or in connection with a single transaction or
arrangement, you convey, or propagate by procuring conveyance of, a
covered work, and grant a patent license to some of the parties
receiving the covered work authorizing them to use, propagate, modify
or convey a specific copy of the covered work, then the patent license
you grant is automatically extended to all recipients of the covered
work and works based on it.
A patent license is "discriminatory" if it does not include within
the scope of its coverage, prohibits the exercise of, or is
conditioned on the non-exercise of one or more of the rights that are
specifically granted under this License. You may not convey a covered
work if you are a party to an arrangement with a third party that is
in the business of distributing software, under which you make payment
to the third party based on the extent of your activity of conveying
the work, and under which the third party grants, to any of the
parties who would receive the covered work from you, a discriminatory
patent license (a) in connection with copies of the covered work
conveyed by you (or copies made from those copies), or (b) primarily
for and in connection with specific products or compilations that
contain the covered work, unless you entered into that arrangement,
or that patent license was granted, prior to 28 March 2007.
Nothing in this License shall be construed as excluding or limiting
any implied license or other defenses to infringement that may
otherwise be available to you under applicable patent law.
12. No Surrender of Others' Freedom.
If conditions are imposed on you (whether by court order, agreement or
otherwise) that contradict the conditions of this License, they do not
excuse you from the conditions of this License. If you cannot convey a
covered work so as to satisfy simultaneously your obligations under this
License and any other pertinent obligations, then as a consequence you may
not convey it at all. For example, if you agree to terms that obligate you
to collect a royalty for further conveying from those to whom you convey
the Program, the only way you could satisfy both those terms and this
License would be to refrain entirely from conveying the Program.
13. Use with the GNU Affero General Public License.
Notwithstanding any other provision of this License, you have
permission to link or combine any covered work with a work licensed
under version 3 of the GNU Affero General Public License into a single
combined work, and to convey the resulting work. The terms of this
License will continue to apply to the part which is the covered work,
but the special requirements of the GNU Affero General Public License,
section 13, concerning interaction through a network will apply to the
combination as such.
14. Revised Versions of this License.
The Free Software Foundation may publish revised and/or new versions of
the GNU General Public License from time to time. Such new versions will
be similar in spirit to the present version, but may differ in detail to
address new problems or concerns.
Each version is given a distinguishing version number. If the
Program specifies that a certain numbered version of the GNU General
Public License "or any later version" applies to it, you have the
option of following the terms and conditions either of that numbered
version or of any later version published by the Free Software
Foundation. If the Program does not specify a version number of the
GNU General Public License, you may choose any version ever published
by the Free Software Foundation.
If the Program specifies that a proxy can decide which future
versions of the GNU General Public License can be used, that proxy's
public statement of acceptance of a version permanently authorizes you
to choose that version for the Program.
Later license versions may give you additional or different
permissions. However, no additional obligations are imposed on any
author or copyright holder as a result of your choosing to follow a
later version.
15. Disclaimer of Warranty.
THERE IS NO WARRANTY FOR THE PROGRAM, TO THE EXTENT PERMITTED BY
APPLICABLE LAW. EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT
HOLDERS AND/OR OTHER PARTIES PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY
OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO,
THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
PURPOSE. THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE PROGRAM
IS WITH YOU. SHOULD THE PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF
ALL NECESSARY SERVICING, REPAIR OR CORRECTION.
16. Limitation of Liability.
IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING
WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MODIFIES AND/OR CONVEYS
THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, INCLUDING ANY
GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THE
USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED TO LOSS OF
DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD
PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER PROGRAMS),
EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF
SUCH DAMAGES.
17. Interpretation of Sections 15 and 16.
If the disclaimer of warranty and limitation of liability provided
above cannot be given local legal effect according to their terms,
reviewing courts shall apply local law that most closely approximates
an absolute waiver of all civil liability in connection with the
Program, unless a warranty or assumption of liability accompanies a
copy of the Program in return for a fee.
END OF TERMS AND CONDITIONS
How to Apply These Terms to Your New Programs
If you develop a new program, and you want it to be of the greatest
possible use to the public, the best way to achieve this is to make it
free software which everyone can redistribute and change under these terms.
To do so, attach the following notices to the program. It is safest
to attach them to the start of each source file to most effectively
state the exclusion of warranty; and each file should have at least
the "copyright" line and a pointer to where the full notice is found.
<one line to give the program's name and a brief idea of what it does.>
Copyright (C) <year> <name of author>
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program. If not, see <http://www.gnu.org/licenses/>.
Also add information on how to contact you by electronic and paper mail.
If the program does terminal interaction, make it output a short
notice like this when it starts in an interactive mode:
<program> Copyright (C) <year> <name of author>
This program comes with ABSOLUTELY NO WARRANTY; for details type `show w'.
This is free software, and you are welcome to redistribute it
under certain conditions; type `show c' for details.
The hypothetical commands `show w' and `show c' should show the appropriate
parts of the General Public License. Of course, your program's commands
might be different; for a GUI interface, you would use an "about box".
You should also get your employer (if you work as a programmer) or school,
if any, to sign a "copyright disclaimer" for the program, if necessary.
For more information on this, and how to apply and follow the GNU GPL, see
<http://www.gnu.org/licenses/>.
The GNU General Public License does not permit incorporating your program
into proprietary programs. If your program is a subroutine library, you
may consider it more useful to permit linking proprietary applications with
the library. If this is what you want to do, use the GNU Lesser General
Public License instead of this License. But first, please read
<http://www.gnu.org/philosophy/why-not-lgpl.html>.
|
{
"pile_set_name": "Github"
}
|
#
# Makefile for the linux ncp filesystem routines.
#
obj-$(CONFIG_NCP_FS) += ncpfs.o
ncpfs-y := dir.o file.o inode.o ioctl.o mmap.o ncplib_kernel.o sock.o \
ncpsign_kernel.o getopt.o
ncpfs-$(CONFIG_NCPFS_EXTRAS) += symlink.o
ncpfs-$(CONFIG_NCPFS_NFS_NS) += symlink.o
# If you want debugging output, please uncomment the following line
# ccflags-y := -DDEBUG_NCP=1
CFLAGS_ncplib_kernel.o := -finline-functions
|
{
"pile_set_name": "Github"
}
|
package com.neu.his.cloud.service.pms.mapper;
import com.neu.his.cloud.service.pms.model.SmsDescription;
import com.neu.his.cloud.service.pms.model.SmsDescriptionExample;
import java.util.List;
import org.apache.ibatis.annotations.Param;
public interface SmsDescriptionMapper {
int countByExample(SmsDescriptionExample example);
int deleteByExample(SmsDescriptionExample example);
int deleteByPrimaryKey(Long id);
int insert(SmsDescription record);
int insertSelective(SmsDescription record);
List<SmsDescription> selectByExample(SmsDescriptionExample example);
SmsDescription selectByPrimaryKey(Long id);
int updateByExampleSelective(@Param("record") SmsDescription record, @Param("example") SmsDescriptionExample example);
int updateByExample(@Param("record") SmsDescription record, @Param("example") SmsDescriptionExample example);
int updateByPrimaryKeySelective(SmsDescription record);
int updateByPrimaryKey(SmsDescription record);
}
|
{
"pile_set_name": "Github"
}
|
// RUN: %clang_cc1 -fsyntax-only -verify -Wno-objc-root-class %s
//rdar: //8591619
// pr8453
@protocol NSCopying @end
@protocol NSPROTO @end
@protocol NSPROTO1 @end
@protocol NSPROTO2 @end
@interface NSObject <NSCopying, NSPROTO, NSPROTO1> {
Class isa;
}
@end
void gorf(NSObject <NSCopying> *); // expected-note {{passing argument to parameter here}}
NSObject <NSCopying> *foo(id <NSCopying> bar, id id_obj)
{
NSObject <NSCopying> *Init = bar; // expected-warning {{initializing 'NSObject<NSCopying> *' with an expression of incompatible type 'id<NSCopying>'}}
NSObject *Init1 = bar; // expected-warning {{initializing 'NSObject *' with an expression of incompatible type 'id<NSCopying>'}}
NSObject <NSCopying> *I = id_obj;
NSObject *I1 = id_obj;
gorf(bar); // expected-warning {{passing 'id<NSCopying>' to parameter of incompatible type 'NSObject<NSCopying> *'}}
gorf(id_obj);
return bar; // expected-warning {{returning 'id<NSCopying>' from a function with incompatible result type 'NSObject<NSCopying> *'}}
}
void test(id <NSCopying, NSPROTO, NSPROTO2> bar)
{
NSObject <NSCopying> *Init = bar; // expected-warning {{initializing 'NSObject<NSCopying> *' with an expression of incompatible type 'id<NSCopying,NSPROTO,NSPROTO2>'}}
}
// rdar://8843851
@interface NSObject (CAT)
+ (struct S*)Meth : (struct S*)arg;
@end
struct S {
char *types;
};
@interface I
@end
@implementation I
- (struct S *)Meth : (struct S*)a {
return [NSObject Meth : a];
}
@end
|
{
"pile_set_name": "Github"
}
|
/* ------------------------------------------------------------------------------
*
* # Pace. Progress bar theme
*
* Bar css spinner theme for Pace. Default size
*
* Version: 1.0
* Latest update: May 25, 2015
*
* ---------------------------------------------------------------------------- */
// Preloader template. Default dark background
// ------------------------------
.preloader,
.preloader-light {
position: fixed;
top: 0;
left: 0;
width: 100%;
height: 100%;
background-color: @color-slate-800; // Change it to any suitable dark color
z-index: 9000;
.opacity(0.9);
}
// Light background
.preloader-light {
background-color: #fff; // Change it to any suitable light color
}
// Change colors for the light version. Feel free to change colors
.pace-light {
&.pace {
background-color: fade(#000, 80%);
}
.pace-progress {
background-color: #fff;
&:after {
color: @color-slate-800;
}
}
}
// Pace theme styles
// ------------------------------
// Base
.pace {
-moz-background-clip: padding;
-webkit-background-clip: padding-box;
background-clip: padding-box;
-webkit-pointer-events: none;
pointer-events: none;
position: fixed;
margin: auto;
top: 0;
left: 0;
right: 0;
bottom: 0;
width: 200px;
height: 6px;
background-color: fade(#000, 40%);
z-index: 9999;
border-radius: 100px;
.user-select(none);
.box-shadow(0 0 5px fade(#fff, 10%));
}
// Progress
.pace-progress {
-webkit-background-clip: padding-box;
-moz-background-clip: padding;
background-clip: padding-box;
max-width: 198px;
z-index: 9999;
display: block;
position: absolute;
left: 1px;
top: 1px;
height: 4px;
background: @color-blue-400; /* Change it to any suitable bright color */
color: #fff;
line-height: 32px;
font-size: @font-size-small;
border-radius: 100px;
.transition(width 1s ease-in-out 1s linear);
.translate3d(0,0,0);
}
// Hide inactive
.pace-inactive {
display: none;
}
// Uncomment code below to show loader text with indicator
/*
.pace-progress:after {
content: attr(data-progress-text);
text-align: center;
width: 100%;
display: inline-block;
margin-top: 5px;
}
*/
|
{
"pile_set_name": "Github"
}
|
package com.tencent.mm.plugin.appbrand.jsapi.q;
import android.app.Activity;
import android.os.PowerManager;
import android.os.PowerManager.WakeLock;
import com.tencent.matrix.trace.core.AppMethodBeat;
import com.tencent.mm.plugin.appbrand.g;
import com.tencent.mm.plugin.appbrand.g.d;
import com.tencent.mm.plugin.appbrand.jsapi.a;
import com.tencent.mm.plugin.appbrand.jsapi.c;
import com.tencent.mm.sdk.platformtools.ab;
import org.json.JSONObject;
public final class j extends a {
public static final int CTRL_INDEX = -2;
public static final String NAME = "setKeepScreenOn";
private static boolean hXH = false;
private c hxS;
WakeLock wakeLock;
static /* synthetic */ boolean a(j jVar) {
AppMethodBeat.i(126426);
boolean isHeld = jVar.isHeld();
AppMethodBeat.o(126426);
return isHeld;
}
static /* synthetic */ boolean b(j jVar) {
AppMethodBeat.i(126427);
boolean release = jVar.release();
AppMethodBeat.o(126427);
return release;
}
static /* synthetic */ boolean c(j jVar) {
AppMethodBeat.i(126428);
boolean aEV = jVar.aEV();
AppMethodBeat.o(126428);
return aEV;
}
public final void a(final c cVar, JSONObject jSONObject, int i) {
AppMethodBeat.i(126422);
if (jSONObject == null) {
ab.e("MicroMsg.JsApiSetKeepScreenOn", "setKeepScreenOn data is null");
cVar.M(i, j("fail:data is null", null));
AppMethodBeat.o(126422);
} else if (cVar.getContext() == null) {
ab.e("MicroMsg.JsApiSetKeepScreenOn", "setKeepScreenOn, server context is nul");
cVar.M(i, j("fail:context is null", null));
AppMethodBeat.o(126422);
} else if (cVar.getContext() instanceof Activity) {
boolean optBoolean = jSONObject.optBoolean("keepScreenOn", false);
hXH = optBoolean;
ab.i("MicroMsg.JsApiSetKeepScreenOn", "setKeepScreenOn, keepScreenOn:%b, appId:%s", Boolean.valueOf(optBoolean), cVar.getAppId());
synchronized (this) {
try {
this.hxS = cVar;
} finally {
while (true) {
}
AppMethodBeat.o(126422);
}
}
if (optBoolean) {
g.a(cVar.getAppId(), new g.c() {
public final void onDestroy() {
AppMethodBeat.i(126419);
ab.i("MicroMsg.JsApiSetKeepScreenOn", "onDestroy");
if (j.a(j.this)) {
j.b(j.this);
}
g.b(cVar.getAppId(), this);
AppMethodBeat.o(126419);
}
public final void a(d dVar) {
AppMethodBeat.i(126420);
ab.i("MicroMsg.JsApiSetKeepScreenOn", "onPause");
if (j.a(j.this)) {
j.b(j.this);
}
AppMethodBeat.o(126420);
}
public final void onResume() {
AppMethodBeat.i(126421);
ab.i("MicroMsg.JsApiSetKeepScreenOn", "onResume");
if (j.hXH) {
j.c(j.this);
}
AppMethodBeat.o(126421);
}
});
optBoolean = aEV();
} else if (isHeld()) {
ab.i("MicroMsg.JsApiSetKeepScreenOn", "reset screen off");
optBoolean = release();
} else {
ab.e("MicroMsg.JsApiSetKeepScreenOn", "fail, has not set screen");
cVar.M(i, j("fail:has not set screen", null));
AppMethodBeat.o(126422);
return;
}
if (optBoolean) {
ab.i("MicroMsg.JsApiSetKeepScreenOn", "setKeepScreenOn ok");
cVar.M(i, j("ok", null));
return;
}
ab.e("MicroMsg.JsApiSetKeepScreenOn", "setKeepScreenOn fail");
cVar.M(i, j("fail", null));
AppMethodBeat.o(126422);
} else {
ab.e("MicroMsg.JsApiSetKeepScreenOn", "setKeepScreenOn, server context is not activity, don't do invoke");
cVar.M(i, j("fail:context is null", null));
AppMethodBeat.o(126422);
}
}
private synchronized boolean aEV() {
boolean z;
AppMethodBeat.i(126423);
if (this.hxS.getContext() == null) {
ab.e("MicroMsg.JsApiSetKeepScreenOn", "acquire fail, server context is nul");
z = false;
AppMethodBeat.o(126423);
} else {
ab.e("MicroMsg.JsApiSetKeepScreenOn", "acquire ok");
Activity activity = (Activity) this.hxS.getContext();
if (this.wakeLock == null) {
this.wakeLock = ((PowerManager) activity.getSystemService("power")).newWakeLock(536870922, "MicroMsg.JsApiSetKeepScreenOn");
}
if (this.wakeLock.isHeld()) {
ab.i("MicroMsg.JsApiSetKeepScreenOn", "wakeLock has held ");
} else {
this.wakeLock.acquire();
ab.i("MicroMsg.JsApiSetKeepScreenOn", "wakeLock acquire");
}
z = true;
AppMethodBeat.o(126423);
}
return z;
}
private synchronized boolean release() {
boolean z;
AppMethodBeat.i(126424);
ab.e("MicroMsg.JsApiSetKeepScreenOn", "release");
if (this.wakeLock == null || !this.wakeLock.isHeld()) {
ab.e("MicroMsg.JsApiSetKeepScreenOn", "wakeLock is null");
z = false;
AppMethodBeat.o(126424);
} else {
this.wakeLock.release();
this.wakeLock = null;
z = true;
AppMethodBeat.o(126424);
}
return z;
}
private synchronized boolean isHeld() {
boolean z;
AppMethodBeat.i(126425);
if (this.wakeLock == null || !this.wakeLock.isHeld()) {
z = false;
AppMethodBeat.o(126425);
} else {
z = true;
AppMethodBeat.o(126425);
}
return z;
}
}
|
{
"pile_set_name": "Github"
}
|
StartChar: ygrave
Encoding: 7923 7923 520
Width: 510
VWidth: 0
Flags: HM
LayerCount: 3
Fore
Refer: 2374 768 N 1 0 0 1 133 65 2
Refer: 1538 121 N 1 0 0 1 0 0 3
MultipleSubs2: "CCMP_Precomp subtable" y gravecomb
Position2: "rtbd subtable" dx=0 dy=0 dh=-22 dv=0
EndChar
|
{
"pile_set_name": "Github"
}
|
// SPDX-License-Identifier: GPL-2.0-or-later
/* handling of writes to regular files and writing back to the server
*
* Copyright (C) 2007 Red Hat, Inc. All Rights Reserved.
* Written by David Howells ([email protected])
*/
#include <linux/backing-dev.h>
#include <linux/slab.h>
#include <linux/fs.h>
#include <linux/pagemap.h>
#include <linux/writeback.h>
#include <linux/pagevec.h>
#include "internal.h"
/*
* mark a page as having been made dirty and thus needing writeback
*/
int afs_set_page_dirty(struct page *page)
{
_enter("");
return __set_page_dirty_nobuffers(page);
}
/*
* partly or wholly fill a page that's under preparation for writing
*/
static int afs_fill_page(struct afs_vnode *vnode, struct key *key,
loff_t pos, unsigned int len, struct page *page)
{
struct afs_read *req;
size_t p;
void *data;
int ret;
_enter(",,%llu", (unsigned long long)pos);
if (pos >= vnode->vfs_inode.i_size) {
p = pos & ~PAGE_MASK;
ASSERTCMP(p + len, <=, PAGE_SIZE);
data = kmap(page);
memset(data + p, 0, len);
kunmap(page);
return 0;
}
req = kzalloc(struct_size(req, array, 1), GFP_KERNEL);
if (!req)
return -ENOMEM;
refcount_set(&req->usage, 1);
req->pos = pos;
req->len = len;
req->nr_pages = 1;
req->pages = req->array;
req->pages[0] = page;
get_page(page);
ret = afs_fetch_data(vnode, key, req);
afs_put_read(req);
if (ret < 0) {
if (ret == -ENOENT) {
_debug("got NOENT from server"
" - marking file deleted and stale");
set_bit(AFS_VNODE_DELETED, &vnode->flags);
ret = -ESTALE;
}
}
_leave(" = %d", ret);
return ret;
}
/*
* prepare to perform part of a write to a page
*/
int afs_write_begin(struct file *file, struct address_space *mapping,
loff_t pos, unsigned len, unsigned flags,
struct page **pagep, void **fsdata)
{
struct afs_vnode *vnode = AFS_FS_I(file_inode(file));
struct page *page;
struct key *key = afs_file_key(file);
unsigned long priv;
unsigned f, from = pos & (PAGE_SIZE - 1);
unsigned t, to = from + len;
pgoff_t index = pos >> PAGE_SHIFT;
int ret;
_enter("{%llx:%llu},{%lx},%u,%u",
vnode->fid.vid, vnode->fid.vnode, index, from, to);
/* We want to store information about how much of a page is altered in
* page->private.
*/
BUILD_BUG_ON(PAGE_SIZE > 32768 && sizeof(page->private) < 8);
page = grab_cache_page_write_begin(mapping, index, flags);
if (!page)
return -ENOMEM;
if (!PageUptodate(page) && len != PAGE_SIZE) {
ret = afs_fill_page(vnode, key, pos & PAGE_MASK, PAGE_SIZE, page);
if (ret < 0) {
unlock_page(page);
put_page(page);
_leave(" = %d [prep]", ret);
return ret;
}
SetPageUptodate(page);
}
/* page won't leak in error case: it eventually gets cleaned off LRU */
*pagep = page;
try_again:
/* See if this page is already partially written in a way that we can
* merge the new write with.
*/
t = f = 0;
if (PagePrivate(page)) {
priv = page_private(page);
f = priv & AFS_PRIV_MAX;
t = priv >> AFS_PRIV_SHIFT;
ASSERTCMP(f, <=, t);
}
if (f != t) {
if (PageWriteback(page)) {
trace_afs_page_dirty(vnode, tracepoint_string("alrdy"),
page->index, priv);
goto flush_conflicting_write;
}
/* If the file is being filled locally, allow inter-write
* spaces to be merged into writes. If it's not, only write
* back what the user gives us.
*/
if (!test_bit(AFS_VNODE_NEW_CONTENT, &vnode->flags) &&
(to < f || from > t))
goto flush_conflicting_write;
if (from < f)
f = from;
if (to > t)
t = to;
} else {
f = from;
t = to;
}
priv = (unsigned long)t << AFS_PRIV_SHIFT;
priv |= f;
trace_afs_page_dirty(vnode, tracepoint_string("begin"),
page->index, priv);
SetPagePrivate(page);
set_page_private(page, priv);
_leave(" = 0");
return 0;
/* The previous write and this write aren't adjacent or overlapping, so
* flush the page out.
*/
flush_conflicting_write:
_debug("flush conflict");
ret = write_one_page(page);
if (ret < 0) {
_leave(" = %d", ret);
return ret;
}
ret = lock_page_killable(page);
if (ret < 0) {
_leave(" = %d", ret);
return ret;
}
goto try_again;
}
/*
* finalise part of a write to a page
*/
int afs_write_end(struct file *file, struct address_space *mapping,
loff_t pos, unsigned len, unsigned copied,
struct page *page, void *fsdata)
{
struct afs_vnode *vnode = AFS_FS_I(file_inode(file));
struct key *key = afs_file_key(file);
loff_t i_size, maybe_i_size;
int ret;
_enter("{%llx:%llu},{%lx}",
vnode->fid.vid, vnode->fid.vnode, page->index);
maybe_i_size = pos + copied;
i_size = i_size_read(&vnode->vfs_inode);
if (maybe_i_size > i_size) {
write_seqlock(&vnode->cb_lock);
i_size = i_size_read(&vnode->vfs_inode);
if (maybe_i_size > i_size)
i_size_write(&vnode->vfs_inode, maybe_i_size);
write_sequnlock(&vnode->cb_lock);
}
if (!PageUptodate(page)) {
if (copied < len) {
/* Try and load any missing data from the server. The
* unmarshalling routine will take care of clearing any
* bits that are beyond the EOF.
*/
ret = afs_fill_page(vnode, key, pos + copied,
len - copied, page);
if (ret < 0)
goto out;
}
SetPageUptodate(page);
}
set_page_dirty(page);
if (PageDirty(page))
_debug("dirtied");
ret = copied;
out:
unlock_page(page);
put_page(page);
return ret;
}
/*
* kill all the pages in the given range
*/
static void afs_kill_pages(struct address_space *mapping,
pgoff_t first, pgoff_t last)
{
struct afs_vnode *vnode = AFS_FS_I(mapping->host);
struct pagevec pv;
unsigned count, loop;
_enter("{%llx:%llu},%lx-%lx",
vnode->fid.vid, vnode->fid.vnode, first, last);
pagevec_init(&pv);
do {
_debug("kill %lx-%lx", first, last);
count = last - first + 1;
if (count > PAGEVEC_SIZE)
count = PAGEVEC_SIZE;
pv.nr = find_get_pages_contig(mapping, first, count, pv.pages);
ASSERTCMP(pv.nr, ==, count);
for (loop = 0; loop < count; loop++) {
struct page *page = pv.pages[loop];
ClearPageUptodate(page);
SetPageError(page);
end_page_writeback(page);
if (page->index >= first)
first = page->index + 1;
lock_page(page);
generic_error_remove_page(mapping, page);
unlock_page(page);
}
__pagevec_release(&pv);
} while (first <= last);
_leave("");
}
/*
* Redirty all the pages in a given range.
*/
static void afs_redirty_pages(struct writeback_control *wbc,
struct address_space *mapping,
pgoff_t first, pgoff_t last)
{
struct afs_vnode *vnode = AFS_FS_I(mapping->host);
struct pagevec pv;
unsigned count, loop;
_enter("{%llx:%llu},%lx-%lx",
vnode->fid.vid, vnode->fid.vnode, first, last);
pagevec_init(&pv);
do {
_debug("redirty %lx-%lx", first, last);
count = last - first + 1;
if (count > PAGEVEC_SIZE)
count = PAGEVEC_SIZE;
pv.nr = find_get_pages_contig(mapping, first, count, pv.pages);
ASSERTCMP(pv.nr, ==, count);
for (loop = 0; loop < count; loop++) {
struct page *page = pv.pages[loop];
redirty_page_for_writepage(wbc, page);
end_page_writeback(page);
if (page->index >= first)
first = page->index + 1;
}
__pagevec_release(&pv);
} while (first <= last);
_leave("");
}
/*
* completion of write to server
*/
static void afs_pages_written_back(struct afs_vnode *vnode,
pgoff_t first, pgoff_t last)
{
struct pagevec pv;
unsigned long priv;
unsigned count, loop;
_enter("{%llx:%llu},{%lx-%lx}",
vnode->fid.vid, vnode->fid.vnode, first, last);
pagevec_init(&pv);
do {
_debug("done %lx-%lx", first, last);
count = last - first + 1;
if (count > PAGEVEC_SIZE)
count = PAGEVEC_SIZE;
pv.nr = find_get_pages_contig(vnode->vfs_inode.i_mapping,
first, count, pv.pages);
ASSERTCMP(pv.nr, ==, count);
for (loop = 0; loop < count; loop++) {
priv = page_private(pv.pages[loop]);
trace_afs_page_dirty(vnode, tracepoint_string("clear"),
pv.pages[loop]->index, priv);
set_page_private(pv.pages[loop], 0);
end_page_writeback(pv.pages[loop]);
}
first += count;
__pagevec_release(&pv);
} while (first <= last);
afs_prune_wb_keys(vnode);
_leave("");
}
/*
* Find a key to use for the writeback. We cached the keys used to author the
* writes on the vnode. *_wbk will contain the last writeback key used or NULL
* and we need to start from there if it's set.
*/
static int afs_get_writeback_key(struct afs_vnode *vnode,
struct afs_wb_key **_wbk)
{
struct afs_wb_key *wbk = NULL;
struct list_head *p;
int ret = -ENOKEY, ret2;
spin_lock(&vnode->wb_lock);
if (*_wbk)
p = (*_wbk)->vnode_link.next;
else
p = vnode->wb_keys.next;
while (p != &vnode->wb_keys) {
wbk = list_entry(p, struct afs_wb_key, vnode_link);
_debug("wbk %u", key_serial(wbk->key));
ret2 = key_validate(wbk->key);
if (ret2 == 0) {
refcount_inc(&wbk->usage);
_debug("USE WB KEY %u", key_serial(wbk->key));
break;
}
wbk = NULL;
if (ret == -ENOKEY)
ret = ret2;
p = p->next;
}
spin_unlock(&vnode->wb_lock);
if (*_wbk)
afs_put_wb_key(*_wbk);
*_wbk = wbk;
return 0;
}
static void afs_store_data_success(struct afs_operation *op)
{
struct afs_vnode *vnode = op->file[0].vnode;
op->ctime = op->file[0].scb.status.mtime_client;
afs_vnode_commit_status(op, &op->file[0]);
if (op->error == 0) {
afs_pages_written_back(vnode, op->store.first, op->store.last);
afs_stat_v(vnode, n_stores);
atomic_long_add((op->store.last * PAGE_SIZE + op->store.last_to) -
(op->store.first * PAGE_SIZE + op->store.first_offset),
&afs_v2net(vnode)->n_store_bytes);
}
}
static const struct afs_operation_ops afs_store_data_operation = {
.issue_afs_rpc = afs_fs_store_data,
.issue_yfs_rpc = yfs_fs_store_data,
.success = afs_store_data_success,
};
/*
* write to a file
*/
static int afs_store_data(struct address_space *mapping,
pgoff_t first, pgoff_t last,
unsigned offset, unsigned to)
{
struct afs_vnode *vnode = AFS_FS_I(mapping->host);
struct afs_operation *op;
struct afs_wb_key *wbk = NULL;
int ret;
_enter("%s{%llx:%llu.%u},%lx,%lx,%x,%x",
vnode->volume->name,
vnode->fid.vid,
vnode->fid.vnode,
vnode->fid.unique,
first, last, offset, to);
ret = afs_get_writeback_key(vnode, &wbk);
if (ret) {
_leave(" = %d [no keys]", ret);
return ret;
}
op = afs_alloc_operation(wbk->key, vnode->volume);
if (IS_ERR(op)) {
afs_put_wb_key(wbk);
return -ENOMEM;
}
afs_op_set_vnode(op, 0, vnode);
op->file[0].dv_delta = 1;
op->store.mapping = mapping;
op->store.first = first;
op->store.last = last;
op->store.first_offset = offset;
op->store.last_to = to;
op->mtime = vnode->vfs_inode.i_mtime;
op->flags |= AFS_OPERATION_UNINTR;
op->ops = &afs_store_data_operation;
try_next_key:
afs_begin_vnode_operation(op);
afs_wait_for_operation(op);
switch (op->error) {
case -EACCES:
case -EPERM:
case -ENOKEY:
case -EKEYEXPIRED:
case -EKEYREJECTED:
case -EKEYREVOKED:
_debug("next");
ret = afs_get_writeback_key(vnode, &wbk);
if (ret == 0) {
key_put(op->key);
op->key = key_get(wbk->key);
goto try_next_key;
}
break;
}
afs_put_wb_key(wbk);
_leave(" = %d", op->error);
return afs_put_operation(op);
}
/*
* Synchronously write back the locked page and any subsequent non-locked dirty
* pages.
*/
static int afs_write_back_from_locked_page(struct address_space *mapping,
struct writeback_control *wbc,
struct page *primary_page,
pgoff_t final_page)
{
struct afs_vnode *vnode = AFS_FS_I(mapping->host);
struct page *pages[8], *page;
unsigned long count, priv;
unsigned n, offset, to, f, t;
pgoff_t start, first, last;
loff_t i_size, end;
int loop, ret;
_enter(",%lx", primary_page->index);
count = 1;
if (test_set_page_writeback(primary_page))
BUG();
/* Find all consecutive lockable dirty pages that have contiguous
* written regions, stopping when we find a page that is not
* immediately lockable, is not dirty or is missing, or we reach the
* end of the range.
*/
start = primary_page->index;
priv = page_private(primary_page);
offset = priv & AFS_PRIV_MAX;
to = priv >> AFS_PRIV_SHIFT;
trace_afs_page_dirty(vnode, tracepoint_string("store"),
primary_page->index, priv);
WARN_ON(offset == to);
if (offset == to)
trace_afs_page_dirty(vnode, tracepoint_string("WARN"),
primary_page->index, priv);
if (start >= final_page ||
(to < PAGE_SIZE && !test_bit(AFS_VNODE_NEW_CONTENT, &vnode->flags)))
goto no_more;
start++;
do {
_debug("more %lx [%lx]", start, count);
n = final_page - start + 1;
if (n > ARRAY_SIZE(pages))
n = ARRAY_SIZE(pages);
n = find_get_pages_contig(mapping, start, ARRAY_SIZE(pages), pages);
_debug("fgpc %u", n);
if (n == 0)
goto no_more;
if (pages[0]->index != start) {
do {
put_page(pages[--n]);
} while (n > 0);
goto no_more;
}
for (loop = 0; loop < n; loop++) {
page = pages[loop];
if (to != PAGE_SIZE &&
!test_bit(AFS_VNODE_NEW_CONTENT, &vnode->flags))
break;
if (page->index > final_page)
break;
if (!trylock_page(page))
break;
if (!PageDirty(page) || PageWriteback(page)) {
unlock_page(page);
break;
}
priv = page_private(page);
f = priv & AFS_PRIV_MAX;
t = priv >> AFS_PRIV_SHIFT;
if (f != 0 &&
!test_bit(AFS_VNODE_NEW_CONTENT, &vnode->flags)) {
unlock_page(page);
break;
}
to = t;
trace_afs_page_dirty(vnode, tracepoint_string("store+"),
page->index, priv);
if (!clear_page_dirty_for_io(page))
BUG();
if (test_set_page_writeback(page))
BUG();
unlock_page(page);
put_page(page);
}
count += loop;
if (loop < n) {
for (; loop < n; loop++)
put_page(pages[loop]);
goto no_more;
}
start += loop;
} while (start <= final_page && count < 65536);
no_more:
/* We now have a contiguous set of dirty pages, each with writeback
* set; the first page is still locked at this point, but all the rest
* have been unlocked.
*/
unlock_page(primary_page);
first = primary_page->index;
last = first + count - 1;
end = (loff_t)last * PAGE_SIZE + to;
i_size = i_size_read(&vnode->vfs_inode);
_debug("write back %lx[%u..] to %lx[..%u]", first, offset, last, to);
if (end > i_size)
to = i_size & ~PAGE_MASK;
ret = afs_store_data(mapping, first, last, offset, to);
switch (ret) {
case 0:
ret = count;
break;
default:
pr_notice("kAFS: Unexpected error from FS.StoreData %d\n", ret);
/* Fall through */
case -EACCES:
case -EPERM:
case -ENOKEY:
case -EKEYEXPIRED:
case -EKEYREJECTED:
case -EKEYREVOKED:
afs_redirty_pages(wbc, mapping, first, last);
mapping_set_error(mapping, ret);
break;
case -EDQUOT:
case -ENOSPC:
afs_redirty_pages(wbc, mapping, first, last);
mapping_set_error(mapping, -ENOSPC);
break;
case -EROFS:
case -EIO:
case -EREMOTEIO:
case -EFBIG:
case -ENOENT:
case -ENOMEDIUM:
case -ENXIO:
trace_afs_file_error(vnode, ret, afs_file_error_writeback_fail);
afs_kill_pages(mapping, first, last);
mapping_set_error(mapping, ret);
break;
}
_leave(" = %d", ret);
return ret;
}
/*
* write a page back to the server
* - the caller locked the page for us
*/
int afs_writepage(struct page *page, struct writeback_control *wbc)
{
int ret;
_enter("{%lx},", page->index);
ret = afs_write_back_from_locked_page(page->mapping, wbc, page,
wbc->range_end >> PAGE_SHIFT);
if (ret < 0) {
_leave(" = %d", ret);
return 0;
}
wbc->nr_to_write -= ret;
_leave(" = 0");
return 0;
}
/*
* write a region of pages back to the server
*/
static int afs_writepages_region(struct address_space *mapping,
struct writeback_control *wbc,
pgoff_t index, pgoff_t end, pgoff_t *_next)
{
struct page *page;
int ret, n;
_enter(",,%lx,%lx,", index, end);
do {
n = find_get_pages_range_tag(mapping, &index, end,
PAGECACHE_TAG_DIRTY, 1, &page);
if (!n)
break;
_debug("wback %lx", page->index);
/*
* at this point we hold neither the i_pages lock nor the
* page lock: the page may be truncated or invalidated
* (changing page->mapping to NULL), or even swizzled
* back from swapper_space to tmpfs file mapping
*/
ret = lock_page_killable(page);
if (ret < 0) {
put_page(page);
_leave(" = %d", ret);
return ret;
}
if (page->mapping != mapping || !PageDirty(page)) {
unlock_page(page);
put_page(page);
continue;
}
if (PageWriteback(page)) {
unlock_page(page);
if (wbc->sync_mode != WB_SYNC_NONE)
wait_on_page_writeback(page);
put_page(page);
continue;
}
if (!clear_page_dirty_for_io(page))
BUG();
ret = afs_write_back_from_locked_page(mapping, wbc, page, end);
put_page(page);
if (ret < 0) {
_leave(" = %d", ret);
return ret;
}
wbc->nr_to_write -= ret;
cond_resched();
} while (index < end && wbc->nr_to_write > 0);
*_next = index;
_leave(" = 0 [%lx]", *_next);
return 0;
}
/*
* write some of the pending data back to the server
*/
int afs_writepages(struct address_space *mapping,
struct writeback_control *wbc)
{
pgoff_t start, end, next;
int ret;
_enter("");
if (wbc->range_cyclic) {
start = mapping->writeback_index;
end = -1;
ret = afs_writepages_region(mapping, wbc, start, end, &next);
if (start > 0 && wbc->nr_to_write > 0 && ret == 0)
ret = afs_writepages_region(mapping, wbc, 0, start,
&next);
mapping->writeback_index = next;
} else if (wbc->range_start == 0 && wbc->range_end == LLONG_MAX) {
end = (pgoff_t)(LLONG_MAX >> PAGE_SHIFT);
ret = afs_writepages_region(mapping, wbc, 0, end, &next);
if (wbc->nr_to_write > 0)
mapping->writeback_index = next;
} else {
start = wbc->range_start >> PAGE_SHIFT;
end = wbc->range_end >> PAGE_SHIFT;
ret = afs_writepages_region(mapping, wbc, start, end, &next);
}
_leave(" = %d", ret);
return ret;
}
/*
* write to an AFS file
*/
ssize_t afs_file_write(struct kiocb *iocb, struct iov_iter *from)
{
struct afs_vnode *vnode = AFS_FS_I(file_inode(iocb->ki_filp));
ssize_t result;
size_t count = iov_iter_count(from);
_enter("{%llx:%llu},{%zu},",
vnode->fid.vid, vnode->fid.vnode, count);
if (IS_SWAPFILE(&vnode->vfs_inode)) {
printk(KERN_INFO
"AFS: Attempt to write to active swap file!\n");
return -EBUSY;
}
if (!count)
return 0;
result = generic_file_write_iter(iocb, from);
_leave(" = %zd", result);
return result;
}
/*
* flush any dirty pages for this process, and check for write errors.
* - the return status from this call provides a reliable indication of
* whether any write errors occurred for this process.
*/
int afs_fsync(struct file *file, loff_t start, loff_t end, int datasync)
{
struct inode *inode = file_inode(file);
struct afs_vnode *vnode = AFS_FS_I(inode);
_enter("{%llx:%llu},{n=%pD},%d",
vnode->fid.vid, vnode->fid.vnode, file,
datasync);
return file_write_and_wait_range(file, start, end);
}
/*
* notification that a previously read-only page is about to become writable
* - if it returns an error, the caller will deliver a bus error signal
*/
vm_fault_t afs_page_mkwrite(struct vm_fault *vmf)
{
struct file *file = vmf->vma->vm_file;
struct inode *inode = file_inode(file);
struct afs_vnode *vnode = AFS_FS_I(inode);
unsigned long priv;
_enter("{{%llx:%llu}},{%lx}",
vnode->fid.vid, vnode->fid.vnode, vmf->page->index);
sb_start_pagefault(inode->i_sb);
/* Wait for the page to be written to the cache before we allow it to
* be modified. We then assume the entire page will need writing back.
*/
#ifdef CONFIG_AFS_FSCACHE
fscache_wait_on_page_write(vnode->cache, vmf->page);
#endif
if (PageWriteback(vmf->page) &&
wait_on_page_bit_killable(vmf->page, PG_writeback) < 0)
return VM_FAULT_RETRY;
if (lock_page_killable(vmf->page) < 0)
return VM_FAULT_RETRY;
/* We mustn't change page->private until writeback is complete as that
* details the portion of the page we need to write back and we might
* need to redirty the page if there's a problem.
*/
wait_on_page_writeback(vmf->page);
priv = (unsigned long)PAGE_SIZE << AFS_PRIV_SHIFT; /* To */
priv |= 0; /* From */
trace_afs_page_dirty(vnode, tracepoint_string("mkwrite"),
vmf->page->index, priv);
SetPagePrivate(vmf->page);
set_page_private(vmf->page, priv);
file_update_time(file);
sb_end_pagefault(inode->i_sb);
return VM_FAULT_LOCKED;
}
/*
* Prune the keys cached for writeback. The caller must hold vnode->wb_lock.
*/
void afs_prune_wb_keys(struct afs_vnode *vnode)
{
LIST_HEAD(graveyard);
struct afs_wb_key *wbk, *tmp;
/* Discard unused keys */
spin_lock(&vnode->wb_lock);
if (!mapping_tagged(&vnode->vfs_inode.i_data, PAGECACHE_TAG_WRITEBACK) &&
!mapping_tagged(&vnode->vfs_inode.i_data, PAGECACHE_TAG_DIRTY)) {
list_for_each_entry_safe(wbk, tmp, &vnode->wb_keys, vnode_link) {
if (refcount_read(&wbk->usage) == 1)
list_move(&wbk->vnode_link, &graveyard);
}
}
spin_unlock(&vnode->wb_lock);
while (!list_empty(&graveyard)) {
wbk = list_entry(graveyard.next, struct afs_wb_key, vnode_link);
list_del(&wbk->vnode_link);
afs_put_wb_key(wbk);
}
}
/*
* Clean up a page during invalidation.
*/
int afs_launder_page(struct page *page)
{
struct address_space *mapping = page->mapping;
struct afs_vnode *vnode = AFS_FS_I(mapping->host);
unsigned long priv;
unsigned int f, t;
int ret = 0;
_enter("{%lx}", page->index);
priv = page_private(page);
if (clear_page_dirty_for_io(page)) {
f = 0;
t = PAGE_SIZE;
if (PagePrivate(page)) {
f = priv & AFS_PRIV_MAX;
t = priv >> AFS_PRIV_SHIFT;
}
trace_afs_page_dirty(vnode, tracepoint_string("launder"),
page->index, priv);
ret = afs_store_data(mapping, page->index, page->index, t, f);
}
trace_afs_page_dirty(vnode, tracepoint_string("laundered"),
page->index, priv);
set_page_private(page, 0);
ClearPagePrivate(page);
#ifdef CONFIG_AFS_FSCACHE
if (PageFsCache(page)) {
fscache_wait_on_page_write(vnode->cache, page);
fscache_uncache_page(vnode->cache, page);
}
#endif
return ret;
}
|
{
"pile_set_name": "Github"
}
|
/*
* Copyright (c) 2012 The WebRTC project authors. All Rights Reserved.
*
* Use of this source code is governed by a BSD-style license
* that can be found in the LICENSE file in the root of the source
* tree. An additional intellectual property rights grant can be found
* in the file PATENTS. All contributing project authors may
* be found in the AUTHORS file in the root of the source tree.
*/
// We don't test the value of pitch gain and lags as they are created by iSAC
// routines. However, interpolation of pitch-gain and lags is in a separate
// class and has its own unit-test.
#include "modules/audio_processing/vad/vad_audio_proc.h"
#include <math.h>
#include <stdio.h>
#include <string>
#include "modules/audio_processing/vad/common.h"
#include "test/gtest.h"
#include "test/testsupport/fileutils.h"
namespace webrtc {
TEST(AudioProcessingTest, DISABLED_ComputingFirstSpectralPeak) {
VadAudioProc audioproc;
std::string peak_file_name =
test::ResourcePath("audio_processing/agc/agc_spectral_peak", "dat");
FILE* peak_file = fopen(peak_file_name.c_str(), "rb");
ASSERT_TRUE(peak_file != NULL);
std::string pcm_file_name =
test::ResourcePath("audio_processing/agc/agc_audio", "pcm");
FILE* pcm_file = fopen(pcm_file_name.c_str(), "rb");
ASSERT_TRUE(pcm_file != NULL);
// Read 10 ms audio in each iteration.
const size_t kDataLength = kLength10Ms;
int16_t data[kDataLength] = {0};
AudioFeatures features;
double sp[kMaxNumFrames];
while (fread(data, sizeof(int16_t), kDataLength, pcm_file) == kDataLength) {
audioproc.ExtractFeatures(data, kDataLength, &features);
if (features.num_frames > 0) {
ASSERT_LT(features.num_frames, kMaxNumFrames);
// Read reference values.
const size_t num_frames = features.num_frames;
ASSERT_EQ(num_frames, fread(sp, sizeof(sp[0]), num_frames, peak_file));
for (size_t n = 0; n < features.num_frames; n++)
EXPECT_NEAR(features.spectral_peak[n], sp[n], 3);
}
}
fclose(peak_file);
fclose(pcm_file);
}
} // namespace webrtc
|
{
"pile_set_name": "Github"
}
|
---
common_packages:
- sudo
- htop
- mc
- git
- apt-transport-https
- python-setuptools # easy_install (necessary for install python pip)
debian_release: jessie
certs_ca_password: '1234'
|
{
"pile_set_name": "Github"
}
|
在 NGN 大会 召开 国内 厂商 交换 国外 厂商 IMS 之间 争论 一次 到达 高峰 华为 提供 新闻稿 描述 NGN 方面 领先 国际 著名 咨询 公司 Dittberner 最新 报告 显示 年华 NGN 出货 全球 排名 年华 NGN 出货 端口 再次 蝉联 全球 27.68%
国内 运营商 纷纷 进行 转型 之际 华为 国内 厂商 提出 固网 智能化 遇上 机会 华为 国内 NGN 网络 智能化 独家 规模 割接 用户 华为 NGN 网络 智能化 系统 快乐 祥和 中国 华为 资料 指出
IMS 发展 重点 国外 厂商 固网 智能化 提出 置疑 认为 固网 交换 移动 软交换 不能 走向 融合 没有 国际 标准 软交换 只能 窄带 话音 用户 没有 潜力 对此 华为 副总裁 郭海 认为 国外 国内 情况 具有 很大 不同 国外 路网 已经 饱和 话音 业务 停滞不前 运营商 更多 考虑到 数据 业务
郭海 认为 运营商 策略 重点 已经 发生 重大 改变 不再 简单 追求 渗透率 综合 信息 服务 降低 总体 拥有 成本 技术 已经 退居 地位 到底 软交换 IMS 其实 已经 并不 重要 重要 商业 模式 业务 创新 交换 IMS 核心 运营商 CAPEX 更多 业务 创新
即使如此 国内 运营商 观念 需要 尽快 进行 转变 运营商 尽快 提高 软件 业务 重视 程度 习惯 于为 东西 付费 明白 共赢 实现 更大 发展 现在 运营商 采购 更多 战略 采购 运营商 很难 具体 标书 需求 关注 生命 周期 成本 情况下 关注 业务 创新 未来 致胜 关键
运营 模式 转型 运营商 转型 重要 战略 NGN 引入 带来 不仅仅 技术 变革 重要 产业 价值链 变化 积极 把握 变化 建立 产业 价值链 控制 转型 成功 保证 华为 认为
|
{
"pile_set_name": "Github"
}
|
/**
* The MIT License (MIT)
*
* Copyright (c) 2014 Segment.io, 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
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
* SOFTWARE.
*/
package com.segment.analytics.integrations;
import static com.segment.analytics.internal.Utils.assertNotNull;
import static com.segment.analytics.internal.Utils.isNullOrEmpty;
import androidx.annotation.NonNull;
import androidx.annotation.Nullable;
import com.segment.analytics.Traits;
import com.segment.analytics.internal.Private;
import java.util.Collections;
import java.util.Date;
import java.util.LinkedHashMap;
import java.util.Map;
public class IdentifyPayload extends BasePayload {
static final String TRAITS_KEY = "traits";
IdentifyPayload(
@NonNull String messageId,
@NonNull Date timestamp,
@NonNull Map<String, Object> context,
@NonNull Map<String, Object> integrations,
@Nullable String userId,
@NonNull String anonymousId,
@NonNull Map<String, Object> traits,
boolean nanosecondTimestamps) {
super(
Type.identify,
messageId,
timestamp,
context,
integrations,
userId,
anonymousId,
nanosecondTimestamps);
put(TRAITS_KEY, traits);
}
/**
* A dictionary of traits you know about a user, for example email or name. We have a collection
* of special traits that we recognize with semantic meaning, which you should always use when
* recording that information. You can also add any custom traits that are specific to your
* project to the dictionary, like friendCount or subscriptionType.
*/
@NonNull
public Traits traits() {
return getValueMap(TRAITS_KEY, Traits.class);
}
@Override
public String toString() {
return "IdentifyPayload{\"userId=\"" + userId() + "\"}";
}
@NonNull
@Override
public IdentifyPayload.Builder toBuilder() {
return new Builder(this);
}
/** Fluent API for creating {@link IdentifyPayload} instances. */
public static class Builder extends BasePayload.Builder<IdentifyPayload, Builder> {
private Map<String, Object> traits;
public Builder() {
// Empty constructor.
}
@Private
Builder(IdentifyPayload identify) {
super(identify);
traits = identify.traits();
}
@NonNull
public Builder traits(@NonNull Map<String, ?> traits) {
assertNotNull(traits, "traits");
this.traits = Collections.unmodifiableMap(new LinkedHashMap<>(traits));
return this;
}
@Override
IdentifyPayload realBuild(
@NonNull String messageId,
@NonNull Date timestamp,
@NonNull Map<String, Object> context,
@NonNull Map<String, Object> integrations,
String userId,
@NonNull String anonymousId,
boolean nanosecondTimestamps) {
if (isNullOrEmpty(userId) && isNullOrEmpty(traits)) {
throw new NullPointerException("either userId or traits are required");
}
return new IdentifyPayload(
messageId,
timestamp,
context,
integrations,
userId,
anonymousId,
traits,
nanosecondTimestamps);
}
@Override
Builder self() {
return this;
}
}
}
|
{
"pile_set_name": "Github"
}
|
---
title: CaffeNet C++ Classification example
description: A simple example performing image classification using the low-level C++ API.
category: example
include_in_docs: true
priority: 10
---
# Classifying ImageNet: using the C++ API
Caffe, at its core, is written in C++. It is possible to use the C++
API of Caffe to implement an image classification application similar
to the Python code presented in one of the Notebook examples. To look
at a more general-purpose example of the Caffe C++ API, you should
study the source code of the command line tool `caffe` in `tools/caffe.cpp`.
## Presentation
A simple C++ code is proposed in
`examples/cpp_classification/classification.cpp`. For the sake of
simplicity, this example does not support oversampling of a single
sample nor batching of multiple independent samples. This example is
not trying to reach the maximum possible classification throughput on
a system, but special care was given to avoid unnecessary
pessimization while keeping the code readable.
## Compiling
The C++ example is built automatically when compiling Caffe. To
compile Caffe you should follow the documented instructions. The
classification example will be built as `examples/classification.bin`
in your build directory.
## Usage
To use the pre-trained CaffeNet model with the classification example,
you need to download it from the "Model Zoo" using the following
script:
```
./scripts/download_model_binary.py models/bvlc_reference_caffenet
```
The ImageNet labels file (also called the *synset file*) is also
required in order to map a prediction to the name of the class:
```
./data/ilsvrc12/get_ilsvrc_aux.sh
```
Using the files that were downloaded, we can classify the provided cat
image (`examples/images/cat.jpg`) using this command:
```
./build/examples/cpp_classification/classification.bin \
models/bvlc_reference_caffenet/deploy.prototxt \
models/bvlc_reference_caffenet/bvlc_reference_caffenet.caffemodel \
data/ilsvrc12/imagenet_mean.binaryproto \
data/ilsvrc12/synset_words.txt \
examples/images/cat.jpg
```
The output should look like this:
```
---------- Prediction for examples/images/cat.jpg ----------
0.3134 - "n02123045 tabby, tabby cat"
0.2380 - "n02123159 tiger cat"
0.1235 - "n02124075 Egyptian cat"
0.1003 - "n02119022 red fox, Vulpes vulpes"
0.0715 - "n02127052 lynx, catamount"
```
## Improving Performance
To further improve performance, you will need to leverage the GPU
more, here are some guidelines:
* Move the data on the GPU early and perform all preprocessing
operations there.
* If you have many images to classify simultaneously, you should use
batching (independent images are classified in a single forward pass).
* Use multiple classification threads to ensure the GPU is always fully
utilized and not waiting for an I/O blocked CPU thread.
|
{
"pile_set_name": "Github"
}
|
require_relative "../../../../base"
describe "VagrantPlugins::GuestLinux::Cap::Halt" do
let(:caps) do
VagrantPlugins::GuestLinux::Plugin
.components
.guest_capabilities[:linux]
end
let(:machine) { double("machine") }
let(:comm) { VagrantTests::DummyCommunicator::Communicator.new(machine) }
context "systemd not enabled" do
before do
allow(machine).to receive(:communicate).and_return(comm)
allow(comm).to receive(:test).and_return(false)
end
after do
comm.verify_expectations!
end
describe ".halt" do
let(:cap) { caps.get(:halt) }
it "runs the shutdown command" do
comm.expect_command("shutdown -h now")
cap.halt(machine)
end
it "does not raise an IOError" do
comm.stub_command("shutdown -h now", raise: IOError)
expect {
cap.halt(machine)
}.to_not raise_error
end
it "does not raise a SSHDisconnected" do
comm.stub_command("shutdown -h now", raise: Vagrant::Errors::SSHDisconnected)
expect {
cap.halt(machine)
}.to_not raise_error
end
end
context "systemd enabled" do
before do
allow(machine).to receive(:communicate).and_return(comm)
allow(comm).to receive(:test).and_return(true)
end
after do
comm.verify_expectations!
end
describe ".halt" do
let(:cap) { caps.get(:halt) }
it "runs the shutdown command" do
comm.expect_command("systemctl poweroff")
cap.halt(machine)
end
end
end
end
end
|
{
"pile_set_name": "Github"
}
|
//
// NSMutableDictionary+SafeKit.m
// SafeKitExample
//
// Created by zhangyu on 14-3-13.
// Copyright (c) 2014年 zhangyu. All rights reserved.
//
#import "NSMutableDictionary+SafeKit.h"
#import "NSObject+swizzle.h"
@implementation NSMutableDictionary(SafeKit)
- (void)safe_removeObjectForKey:(id)aKey {
if (!aKey) {
return;
}
[self safe_removeObjectForKey:aKey];
}
- (void)safe_setObject:(id)anObject forKey:(id <NSCopying>)aKey {
if (!anObject) {
return;
}
if (!aKey) {
return;
}
[self safe_setObject:anObject forKey:aKey];
}
+ (void) load {
static dispatch_once_t onceToken;
dispatch_once(&onceToken, ^{
[self safe_swizzleMethod:@selector(safe_removeObjectForKey:) tarClass:@"__NSDictionaryM" tarSel:@selector(removeObjectForKey:)];
[self safe_swizzleMethod:@selector(safe_setObject:forKey:) tarClass:@"__NSDictionaryM" tarSel:@selector(setObject:forKey:)];
});
}
@end
|
{
"pile_set_name": "Github"
}
|
//package nt;
import javax.swing.*;
import java.awt.*;
import java.awt.event.*;
import java.applet.*;
public class P4 extends JPanel
{
private JButton B1;
private JLabel etiq;
private JTextArea texto;
public P4 ()
{
setLayout (new BorderLayout ());
texto = new JTextArea ("Texto de ayuda breve y about");
etiq = new JLabel ("Una simple etiqueta");
B1 = new JButton ("boton1");
add (texto, BorderLayout.CENTER);
add (B1, BorderLayout.NORTH);
}
}
|
{
"pile_set_name": "Github"
}
|
load(
"@io_bazel_rules_go//proto:def.bzl",
"go_proto_library",
)
package(default_visibility = ["//visibility:public"])
load(
"@io_bazel_rules_go//go:def.bzl",
"go_library",
)
proto_library(
name = "v1_proto",
srcs = [
"model.proto",
"service.proto",
],
tags = ["automanaged"],
)
go_proto_library(
name = "v1_go_proto",
compilers = ["@io_bazel_rules_go//proto:go_grpc"],
importpath = "go-common/app/service/openplatform/pgc-season/api/grpc/season/v1",
proto = ":v1_proto",
tags = ["automanaged"],
)
go_library(
name = "go_default_library",
srcs = ["client.go"],
embed = [":v1_go_proto"],
importpath = "go-common/app/service/openplatform/pgc-season/api/grpc/season/v1",
tags = ["automanaged"],
visibility = ["//visibility:public"],
deps = [
"//library/net/rpc/warden:go_default_library",
"@com_github_gogo_protobuf//proto:go_default_library",
"@org_golang_google_grpc//:go_default_library",
"@org_golang_x_net//context:go_default_library",
],
)
filegroup(
name = "package-srcs",
srcs = glob(["**"]),
tags = ["automanaged"],
visibility = ["//visibility:private"],
)
filegroup(
name = "all-srcs",
srcs = [":package-srcs"],
tags = ["automanaged"],
visibility = ["//visibility:public"],
)
|
{
"pile_set_name": "Github"
}
|
// Copyright 2016 The Snappy-Go Authors. All rights reserved.
// Use of this source code is governed by a BSD-style
// license that can be found in the LICENSE file.
// +build !amd64 appengine !gc noasm
package snappy
// decode writes the decoding of src to dst. It assumes that the varint-encoded
// length of the decompressed bytes has already been read, and that len(dst)
// equals that length.
//
// It returns 0 on success or a decodeErrCodeXxx error code on failure.
func decode(dst, src []byte) int {
var d, s, offset, length int
for s < len(src) {
switch src[s] & 0x03 {
case tagLiteral:
x := uint32(src[s] >> 2)
switch {
case x < 60:
s++
case x == 60:
s += 2
if uint(s) > uint(len(src)) { // The uint conversions catch overflow from the previous line.
return decodeErrCodeCorrupt
}
x = uint32(src[s-1])
case x == 61:
s += 3
if uint(s) > uint(len(src)) { // The uint conversions catch overflow from the previous line.
return decodeErrCodeCorrupt
}
x = uint32(src[s-2]) | uint32(src[s-1])<<8
case x == 62:
s += 4
if uint(s) > uint(len(src)) { // The uint conversions catch overflow from the previous line.
return decodeErrCodeCorrupt
}
x = uint32(src[s-3]) | uint32(src[s-2])<<8 | uint32(src[s-1])<<16
case x == 63:
s += 5
if uint(s) > uint(len(src)) { // The uint conversions catch overflow from the previous line.
return decodeErrCodeCorrupt
}
x = uint32(src[s-4]) | uint32(src[s-3])<<8 | uint32(src[s-2])<<16 | uint32(src[s-1])<<24
}
length = int(x) + 1
if length <= 0 {
return decodeErrCodeUnsupportedLiteralLength
}
if length > len(dst)-d || length > len(src)-s {
return decodeErrCodeCorrupt
}
copy(dst[d:], src[s:s+length])
d += length
s += length
continue
case tagCopy1:
s += 2
if uint(s) > uint(len(src)) { // The uint conversions catch overflow from the previous line.
return decodeErrCodeCorrupt
}
length = 4 + int(src[s-2])>>2&0x7
offset = int(uint32(src[s-2])&0xe0<<3 | uint32(src[s-1]))
case tagCopy2:
s += 3
if uint(s) > uint(len(src)) { // The uint conversions catch overflow from the previous line.
return decodeErrCodeCorrupt
}
length = 1 + int(src[s-3])>>2
offset = int(uint32(src[s-2]) | uint32(src[s-1])<<8)
case tagCopy4:
s += 5
if uint(s) > uint(len(src)) { // The uint conversions catch overflow from the previous line.
return decodeErrCodeCorrupt
}
length = 1 + int(src[s-5])>>2
offset = int(uint32(src[s-4]) | uint32(src[s-3])<<8 | uint32(src[s-2])<<16 | uint32(src[s-1])<<24)
}
if offset <= 0 || d < offset || length > len(dst)-d {
return decodeErrCodeCorrupt
}
// Copy from an earlier sub-slice of dst to a later sub-slice. Unlike
// the built-in copy function, this byte-by-byte copy always runs
// forwards, even if the slices overlap. Conceptually, this is:
//
// d += forwardCopy(dst[d:d+length], dst[d-offset:])
for end := d + length; d != end; d++ {
dst[d] = dst[d-offset]
}
}
if d != len(dst) {
return decodeErrCodeCorrupt
}
return 0
}
|
{
"pile_set_name": "Github"
}
|
// ----------------------------------------------------------------------- //
//
// MODULE : HUDDamage.h
//
// PURPOSE : HUDItem to display player damage icons
//
// (c) 2001 Monolith Productions, Inc. All Rights Reserved
//
// ----------------------------------------------------------------------- //
#ifndef __HUD_DAMAGE_H
#define __HUD_DAMAGE_H
#include "HUDItem.h"
class CHUDDamage : public CHUDItem
{
public:
CHUDDamage();
~CHUDDamage();
LTBOOL Init();
void Render();
void Update();
void UpdateLayout();
private:
LTIntPt m_BasePos;
uint16 m_nIconHt;
LTBOOL m_bDraw;
LTPoly_GT4 *m_Poly;
HTEXTURE *m_hIcon; // icon
};
#endif
|
{
"pile_set_name": "Github"
}
|
ace.define("ace/mode/lucene_highlight_rules",["require","exports","module","ace/lib/oop","ace/lib/lang","ace/mode/text_highlight_rules"], function(require, exports, module) {
"use strict";
var oop = require("../lib/oop");
var lang = require("../lib/lang");
var TextHighlightRules = require("./text_highlight_rules").TextHighlightRules;
var LuceneHighlightRules = function() {
this.$rules = {
"start" : [
{
token : "constant.character.negation",
regex : "[\\-]"
}, {
token : "constant.character.interro",
regex : "[\\?]"
}, {
token : "constant.character.asterisk",
regex : "[\\*]"
}, {
token: 'constant.character.proximity',
regex: '~[0-9]+\\b'
}, {
token : 'keyword.operator',
regex: '(?:AND|OR|NOT)\\b'
}, {
token : "paren.lparen",
regex : "[\\(]"
}, {
token : "paren.rparen",
regex : "[\\)]"
}, {
token : "keyword",
regex : "[\\S]+:"
}, {
token : "string", // " string
regex : '".*?"'
}, {
token : "text",
regex : "\\s+"
}
]
};
};
oop.inherits(LuceneHighlightRules, TextHighlightRules);
exports.LuceneHighlightRules = LuceneHighlightRules;
});
ace.define("ace/mode/lucene",["require","exports","module","ace/lib/oop","ace/mode/text","ace/mode/lucene_highlight_rules"], function(require, exports, module) {
'use strict';
var oop = require("../lib/oop");
var TextMode = require("./text").Mode;
var LuceneHighlightRules = require("./lucene_highlight_rules").LuceneHighlightRules;
var Mode = function() {
this.HighlightRules = LuceneHighlightRules;
this.$behaviour = this.$defaultBehaviour;
};
oop.inherits(Mode, TextMode);
(function() {
this.$id = "ace/mode/lucene";
}).call(Mode.prototype);
exports.Mode = Mode;
});
|
{
"pile_set_name": "Github"
}
|
<!ENTITY window.title "">
<!ENTITY menu.tools "">
<!ENTITY menu.tools.ak "">
<!ENTITY sqliteVersion "">
<!ENTITY sqliteVersion.ak "">
<!ENTITY mi.options "">
<!ENTITY mi.options.ak "">
<!ENTITY mi.sharedPagerCache "">
<!ENTITY mi.sharedPagerCache.ak "">
<!ENTITY mi.extensionTable "">
<!ENTITY mi.extensionTable.ak "">
<!ENTITY mi.openOnConnectSqlTab "">
<!ENTITY mi.openOnConnectSqlTab.ak "">
<!ENTITY mi.console "">
<!ENTITY mi.console.ak "">
<!ENTITY mi.aboutconfig "">
<!ENTITY mi.aboutconfig.ak "">
<!ENTITY menu.db "">
<!ENTITY menu.db.ak "">
<!ENTITY menu.db.new "">
<!ENTITY menu.db.new.ak "">
<!ENTITY menu.db.newMemory "">
<!ENTITY menu.db.newMemory.ak "">
<!ENTITY menu.db.connect "">
<!ENTITY menu.db.connect.ak "">
<!ENTITY menu.db.connectADS "">
<!ENTITY menu.db.attach "">
<!ENTITY menu.db.attach.ak "">
<!ENTITY menu.db.detach "">
<!ENTITY menu.db.detach.ak "">
<!ENTITY menu.db.close "">
<!ENTITY menu.db.close.ak "">
<!ENTITY menu.db.mru "">
<!ENTITY menu.db.mru.ak "">
<!ENTITY menu.db.copy "">
<!ENTITY menu.db.copy.ak "">
<!ENTITY menu.db.compact "">
<!ENTITY menu.db.compact.ak "">
<!ENTITY menu.db.analyze "">
<!ENTITY menu.db.analyze.ak "">
<!ENTITY menu.db.check "">
<!ENTITY menu.db.check.ak "">
<!ENTITY menu.db.checkComplete "">
<!ENTITY menu.db.checkComplete.ak "">
<!ENTITY menu.db.checkQuick "">
<!ENTITY menu.db.checkQuick.ak "">
<!ENTITY exportAll "">
<!ENTITY exportAll.ak "">
<!ENTITY exportDb "">
<!ENTITY exportDb.ak "">
<!ENTITY exportDbStr "">
<!ENTITY exportDbStr.ak "">
<!ENTITY import "">
<!ENTITY import.ak "">
<!ENTITY refresh "">
<!ENTITY refresh.ak "">
<!ENTITY reconnect "">
<!ENTITY reconnect.ak "">
<!ENTITY refreshDirection "">
<!ENTITY exit "">
<!ENTITY exit.ak "">
<!ENTITY createTable "">
<!ENTITY dropTable "">
<!ENTITY modifyTable "">
<!ENTITY emptyTable "">
<!ENTITY reindexTable "">
<!ENTITY renameTable "">
<!ENTITY copyTable "">
<!ENTITY exportTable "">
<!ENTITY createIndex "">
<!ENTITY dropIndex "">
<!ENTITY reindexIndex "">
<!ENTITY createView "">
<!ENTITY dropView "">
<!ENTITY renameView "">
<!ENTITY modifyView "">
<!ENTITY exportView "">
<!ENTITY createTrigger "">
<!ENTITY dropTrigger "">
<!ENTITY renameTrigger "">
<!ENTITY menu.table "">
<!ENTITY menu.table.ak "">
<!ENTITY menu.index "">
<!ENTITY menu.index.ak "">
<!ENTITY menu.view "">
<!ENTITY menu.view.ak "">
<!ENTITY menu.trigger "">
<!ENTITY menu.trigger.ak "">
<!ENTITY create "">
<!ENTITY create.ak "">
<!ENTITY drop "">
<!ENTITY drop.ak "">
<!ENTITY export "">
<!ENTITY export.ak "">
<!ENTITY empty "">
<!ENTITY empty.ak "">
<!ENTITY rename "">
<!ENTITY rename.ak "">
<!ENTITY modify "">
<!ENTITY modify.ak "">
<!ENTITY copy "">
<!ENTITY copy.ak "">
<!ENTITY reindex "">
<!ENTITY reindex.ak "">
<!ENTITY analyze "">
<!ENTITY analyze.ak "">
<!ENTITY menu.help "">
<!ENTITY menu.help.ak "">
<!ENTITY menu.help.reportProblem "">
<!ENTITY menu.help.reportProblem.ak "">
<!ENTITY menu.help.faq "">
<!ENTITY menu.help.faq.ak "">
<!ENTITY menu.help.sqlitehome "">
<!ENTITY menu.help.sqlitehome.ak "">
<!ENTITY menu.help.sqlitesyntax "">
<!ENTITY menu.help.sqlitesyntax.ak "">
<!ENTITY menu.help.extensionhome "">
<!ENTITY menu.help.extensionhome.ak "">
<!ENTITY menu.help.aboutextension "">
<!ENTITY menu.help.aboutextension.ak "">
<!ENTITY profile.dblist.select "">
<!ENTITY profile.dblist.buttonlabel "">
<!ENTITY string.enterSql "">
<!ENTITY string.enterSql.ak "">
<!ENTITY tab.structure "">
<!ENTITY tab.browse "">
<!ENTITY tab.execute "">
<!ENTITY tab.dbinfo "">
<!ENTITY tab.udf "">
<!ENTITY tab.connectSql "">
<!ENTITY btn.search "">
<!ENTITY btn.search.ak "">
<!ENTITY btn.showAll "">
<!ENTITY btn.showAll.ak "">
<!ENTITY btn.exporttable "">
<!ENTITY btn.exporttable.ak "">
<!ENTITY btn.addcol "">
<!ENTITY btn.addrecord "">
<!ENTITY btn.addrecord.ak "">
<!ENTITY menu.editSelected "">
<!ENTITY menu.editSelected.ak "">
<!ENTITY menu.deleteSelected "">
<!ENTITY menu.deleteSelected.ak "">
<!ENTITY menu.duplicateRecord "">
<!ENTITY menu.duplicateRecord.ak "">
<!ENTITY menu.copyColName "">
<!ENTITY menu.copyColName.ak "">
<!ENTITY menu.copyCell "">
<!ENTITY menu.copyCell.ak "">
<!ENTITY menu.copyRows "">
<!ENTITY menu.copyRows.ak "">
<!ENTITY menu.copyRowsForExcel "">
<!ENTITY menu.copyRowsAsSql "">
<!ENTITY menu.copyRowsAsSql.ak "">
<!ENTITY menu.editColumn "">
<!ENTITY menu.editColumn.ak "">
<!ENTITY menu.dropColumn "">
<!ENTITY menu.dropColumn.ak "">
<!ENTITY btn.runsql "">
<!ENTITY btn.runsql.ak "">
<!ENTITY btn.runsql.tooltiptext "">
<!ENTITY buttonRun "">
<!ENTITY buttonRun.ak "">
<!ENTITY buttonExecute "">
<!ENTITY buttonExecute.ak "">
<!ENTITY label.sqlLastError "">
<!ENTITY mb.queryActions "">
<!ENTITY mi.viewQueryAsTable "">
<!ENTITY mi.viewQueryAsTable.ak "">
<!ENTITY mi.viewQueryAsCsv "">
<!ENTITY mi.viewQueryAsCsv.ak "">
<!ENTITY mi.saveQueryAsCsv "">
<!ENTITY mi.saveQueryAsCsv.ak "">
<!ENTITY label.resultOfQuery "">
<!ENTITY label.resultOfQuery.ak "">
<!ENTITY btn.prevSql "">
<!ENTITY btn.nextSql "">
<!ENTITY btn.saveQuery "">
<!ENTITY btn.clearHistory "">
<!ENTITY sbp.db "">
<!ENTITY masterinfo.tbl_name "">
<!ENTITY masterinfo.rootpage "">
<!ENTITY masterinfo.sql "">
<!ENTITY table "">
<!ENTITY index "">
<!ENTITY view "">
<!ENTITY trigger "">
<!ENTITY first "">
<!ENTITY previous "">
<!ENTITY next "">
<!ENTITY last "">
<!ENTITY to "">
<!ENTITY of "">
<!ENTITY about "">
<!ENTITY version "">
<!ENTITY author "">
<!ENTITY license "">
<!ENTITY license.mpl "">
<!ENTITY dir "">
<!ENTITY profileDir "">
<!ENTITY userDir "">
<!ENTITY selectUserDir "">
<!ENTITY infoFromMaster "">
<!ENTITY moreInfo "">
<!ENTITY numColumns "">
<!ENTITY numIndexes "">
<!ENTITY numTriggers "">
<!ENTITY numRecords "">
<!ENTITY Columns "">
<!ENTITY name "">
<!ENTITY type "">
<!ENTITY pKey "">
<!ENTITY notNull "">
<!ENTITY default "">
<!ENTITY indexProp "">
<!ENTITY indexedTable "">
<!ENTITY indexedFields "">
<!ENTITY indexDuplicate "">
<!ENTITY selectAllRecords "">
<!ENTITY selectAllRecords.ak "">
<!---->
<!ENTITY From "">
<!ENTITY To "">
<!ENTITY Database "">
<!ENTITY Database.ak "">
<!ENTITY Table "">
<!ENTITY onlyStructure "">
<!ENTITY enterNewTable "">
<!ENTITY enterNewTable.ak "">
<!---->
<!ENTITY Name.ak "">
<!ENTITY ViewName "">
<!ENTITY Temporary "">
<!ENTITY Temporary.ak "">
<!ENTITY ifNotExists "">
<!ENTITY ifNotExists.ak "">
<!ENTITY SelectStatement "">
<!ENTITY SelectStatement.ak "">
<!ENTITY createIndex.dbName "">
<!ENTITY createIndex.indexname "">
<!ENTITY createIndex.indexproperties "">
<!ENTITY createIndex.tabletoindex "">
<!ENTITY createIndex.loading "">
<!ENTITY createIndex.duplicatevalues "">
<!ENTITY createIndex.allowed "">
<!ENTITY createIndex.notallowed "">
<!ENTITY createIndex.indexcolumns "">
<!ENTITY createTable.dbName "">
<!ENTITY createTable.tablename "">
<!ENTITY createTable.temptable "">
<!ENTITY createTable.temptable.ak "">
<!ENTITY createTable.ifnotexists "">
<!ENTITY createTable.ifnotexists.ak "">
<!ENTITY createTable.tablecolumns "">
<!ENTITY createTable.colname "">
<!ENTITY createTable.datatype "">
<!ENTITY createTable.primarykey "">
<!ENTITY createTable.autoincrement "">
<!ENTITY createTable.allownull "">
<!ENTITY createTable.default "">
<!ENTITY createTable.unique "">
<!ENTITY createTable.primarykey.yes "">
<!ENTITY createTable.autoincrement.yes "">
<!ENTITY createTable.autoincrement.tooltip "">
<!ENTITY createTable.allownull.yes "">
<!ENTITY createTable.unique.column "">
<!ENTITY createTable.unique.columnlist "">
<!ENTITY createTrigger.dbName "">
<!ENTITY createTrigger.triggername "">
<!ENTITY createTrigger.tabletoindex "">
<!ENTITY createTrigger.loading "">
<!ENTITY createTrigger.tempObject "">
<!ENTITY createTrigger.tempObject.ak "">
<!ENTITY createTrigger.ifnotexists "">
<!ENTITY createTrigger.ifnotexists.ak "">
<!ENTITY createTrigger.databaseevent "">
<!ENTITY createTrigger.triggerTime "">
<!ENTITY createTrigger.triggerTime.ak "">
<!ENTITY createTrigger.dbEvent "">
<!ENTITY createTrigger.dbEvent.ak "">
<!ENTITY createTrigger.triggeraction "">
<!ENTITY createTrigger.foreachrow "">
<!ENTITY createTrigger.foreachrow.ak "">
<!ENTITY createTrigger.txtWhenExpression "">
<!ENTITY createTrigger.txtWhenExpression.ak "">
<!ENTITY createTrigger.txtTriggerSteps "">
<!ENTITY createTrigger.txtTriggerSteps.ak "">
<!---->
<!ENTITY confirm.button.accept "">
<!ENTITY confirm.button.cancel "">
<!---->
<!ENTITY rowOperations.tablenames "">
<!ENTITY rowOperations.tablenames.ak "">
<!ENTITY rowOperations.loading "">
<!ENTITY oldValues "">
<!ENTITY newValues "">
|
{
"pile_set_name": "Github"
}
|
<?xml version="1.0" encoding="utf-8"?>
<resources>
<string name="actfm_picture_clear">Убрать изображение</string>
<string name="TVA_add_comment">Добавить комментарий…</string>
<string name="enter_filter_name">Введите имя фильтра</string>
<string name="backup_BPr_header">Резервные копии</string>
<string name="backup_BAc_import">Импортировать резервную копию</string>
<string name="backup_BAc_export">Сделать резервную копию сейчас</string>
<string name="export_toast">Сохранено %1$s в %2$s.</string>
<string name="import_summary_title">Итог восстановления</string>
<string name="import_summary_message">Файл %1$s содержал %2$s.
\n
\n %3$s импортировано,
\n %4$s уже существовало
\n %5$s с ошибками
\n</string>
<string name="import_progress_read">Чтение задачи %d…</string>
<string name="read_permission_label">Разрешения Tasks</string>
<string name="discard_confirmation">Вы действительно хотите отказаться от сделанных изменений?</string>
<string name="keep_editing">Продолжить редактировать</string>
<string name="DLG_delete_this_task_question">Удалить эту задачу?</string>
<string name="DLG_hour_minutes">Время (час : мин)</string>
<string name="DLG_undo">Отмена</string>
<string name="WID_dateButtonUnset">Установить</string>
<string name="TLA_no_items">Задач нет.</string>
<string name="TLA_menu_sort">Сортировка</string>
<string name="TLA_menu_search">Поиск</string>
<string name="TLA_menu_settings">Настройки</string>
<string name="TAd_actionEditTask">Редактировать</string>
<string name="action_call">Позвонить</string>
<string name="action_open">Открыть</string>
<string name="SSD_sort_auto">Умная сортировка</string>
<string name="SSD_sort_alpha">По названию</string>
<string name="SSD_sort_due">По намеченному сроку</string>
<string name="SSD_sort_importance">По приоритету</string>
<string name="SSD_sort_modified">Последние изменённые</string>
<string name="FLA_search_filter">Соответствует \'%s\'</string>
<string name="FLA_new_filter">Создать новый фильтр</string>
<string name="TEA_title_hint">Имя задачи</string>
<string name="TEA_importance_label">Приоритет</string>
<string name="TEA_no_date">Без даты</string>
<string name="TEA_hideUntil_label">Скрыть до</string>
<string name="TEA_hideUntil_display">Скрыть до %s</string>
<string name="TEA_note_label">Описание</string>
<string name="TEA_estimatedDuration_label">Сколько времени это займет\?</string>
<string name="TEA_elapsedDuration_label">Затраченное время</string>
<string name="save">Сохранить </string>
<string name="TEA_timer_est">Расчет %s</string>
<string name="TEA_timer_elap">Прошло %s</string>
<string name="TEA_no_time">Без времени</string>
<string name="due_date">Намеченная дата</string>
<string name="due_time">Намеченное время</string>
<string name="day_before_due">Сутки до намеченной даты</string>
<string name="week_before_due">Неделя до намеченной даты</string>
<string name="TEA_hideUntil_due_date" comment="Used for displaying the chosen hide until value in the task edit screen. Should be the same as due_date, just without capitalization.">намеченной даты</string>
<string name="TEA_hideUntil_due_time" comment="Used for displaying the chosen hide until value in the task edit screen. Should be the same as due_time, just without capitalization.">намеченного времени</string>
<string name="TEA_hideUntil_day_before_due" comment="Used for displaying the chosen hide until value in the task edit screen. Should be the same as day_before_due, just without capitalization.">сутки до намеченной даты</string>
<string name="TEA_hideUntil_week_before_due" comment="Used for displaying the chosen hide until value in the task edit screen. Should be the same as week_before_due, just without capitalization.">неделя до намеченной даты</string>
<string name="TEA_control_when">Когда</string>
<string name="TEA_control_repeat">Повтор</string>
<string name="TEA_control_gcal">Календарь</string>
<string name="TEA_control_importance">Приоритет</string>
<string name="TEA_control_location">Место</string>
<string name="TEA_control_notes">Описание</string>
<string name="TEA_control_files">Файлы</string>
<string name="TEA_control_reminders">Напоминания</string>
<string name="TEA_control_timer">Учет времени</string>
<string name="TEA_control_hidden_section">----Всегда скрывать----</string>
<string name="TEA_load_more">Загрузить больше…</string>
<string name="CRA_ignore">Игнорировать</string>
<string name="CRA_title">Необходим список встреч?</string>
<string name="CRA_ignore_body">Вы пропустили несколько событий календаря. Прекратить спрашивать о них?</string>
<string name="CRA_ignore_all">Пропустить все события</string>
<string name="CRA_ignore_this">Пропустить только это событие</string>
<string name="CRA_speech_bubble_start">Похоже скоро начнется %s. Хотите создать список действий?</string>
<string name="CRA_speech_bubble_end">Похоже Вы только что завершили %s. Хотите создать список действий?</string>
<string name="CRA_postpone">Возможно позднее</string>
<string name="CRA_calendar_reminders_pref_title">Ассистент календаря</string>
<string name="CRA_calendar_reminders_pref_desc_enabled">Tasks будет напоминать вам о предстоящих событиях в календаре и напомнит вам подготовиться к ним</string>
<string name="CRA_default_list_name">Пункты события: %s</string>
<string name="none">Нет</string>
<string name="EPr_filters_to_show_title">Показать фильтры</string>
<string name="EPr_edit_screen_options">Настройки экрана редактирования</string>
<string name="EPr_beastMode_reset">Сброс настроек</string>
<string name="EPr_fullTask_title">Показывать полный заголовок задачи</string>
<string name="EPr_show_task_edit_comments">Показывать комментарии в редакторе задачи</string>
<string name="task_list_options">Настройки списка задач</string>
<string name="EPr_cal_end_or_start_at_due_time">Время события в календаре</string>
<string name="EPr_cal_end_at_due_time">Завершать события в календаре при наступлении срока</string>
<string name="EPr_cal_start_at_due_time">Начинать события в календаре при наступлении срока</string>
<string name="EPr_reset_preferences">Сбросить настройки</string>
<string name="EPr_reset_preferences_warning">Настройки будут сброшены в первоначальное состояние</string>
<string name="EPr_delete_task_data">Удалить все задачи</string>
<string name="EPr_delete_task_data_warning">Все задачи будут удалены навсегда</string>
<string name="EPr_manage_delete_completed_gcal">Удалить календарные события для завершенных задач</string>
<string name="EPr_manage_delete_completed_gcal_message">Вы уверены, что хотите удалить все Ваши события для завершенных задач\?</string>
<string name="EPr_manage_delete_completed_gcal_status">Удалено %d календарных событий!</string>
<string name="EPr_manage_delete_all_gcal">Удалить все календарные события для задач</string>
<string name="EPr_manage_delete_all_gcal_message">Вы уверены, что хотите удалить все Ваши события для задач\?</string>
<string name="EPr_manage_delete_all_gcal_status">Удалено %d календарных событий!</string>
<string name="task_defaults">Параметры по умолчанию</string>
<string name="EPr_default_urgency_title">Намеченный срок по умолчанию</string>
<string name="EPr_default_importance_title">Приоритет по умолчанию</string>
<string name="EPr_default_hideUntil_title">Срок скрытия по умолчанию</string>
<string name="EPr_default_reminders_title">Напоминания по умолчанию</string>
<string name="EPr_default_location_reminder_title">Напоминания о месте по умолчанию</string>
<string name="EPr_default_location_radius">Радиус по умолчанию</string>
<string name="EPr_default_reminders_mode_title">Тип звонка/вибрации по умолчанию</string>
<string name="priority_high">Высокий</string>
<string name="priority_medium">Средний</string>
<string name="priority_low">Низкий</string>
<string name="no_deadline">Без срока выполнения</string>
<string name="day_after_tomorrow">Послезавтра</string>
<string name="next_week">Следующая неделя</string>
<string name="dont_hide">Не скрывать</string>
<string name="at_deadline">В срок</string>
<string name="at_deadline_or_overdue">Вовремя или просрочена</string>
<string name="no_reminders">Без напоминаний</string>
<string name="default_location_reminder_on_arrival">По прибытии</string>
<string name="default_location_reminder_on_departure">Покинув место</string>
<string name="default_location_reminder_on_arrival_or_departure">По прибытии и покинув место</string>
<string name="BFE_Active">Мои задачи</string>
<string name="BFE_Recent">Недавно изменённые</string>
<string name="CFA_type_add">или</string>
<string name="CFA_type_subtract">не</string>
<string name="CFA_type_intersect">и</string>
<string name="CFA_context_chain">%s содержит критерий</string>
<string name="CFA_context_delete">Удалить строку</string>
<string name="CFA_button_add">Добавить условие</string>
<string name="CFC_dueBefore_text">Конечный срок: ?</string>
<string name="CFC_dueBefore_name">Конечный срок…</string>
<string name="no_due_date">Нет даты выполнения задания</string>
<string name="next_month">Ближайшие 30 дней</string>
<string name="CFC_importance_text">Приоритет как минимум ?</string>
<string name="CFC_importance_name">Приоритет…</string>
<string name="CFC_tag_text">Тег: ? </string>
<string name="CFC_tag_name">Тег…</string>
<string name="CFC_tag_contains_name">Название тега содержит…</string>
<string name="CFC_tag_contains_text">Название тега содержит: ?</string>
<string name="CFC_title_contains_name">Название содержит…</string>
<string name="CFC_title_contains_text">Название содержит: ?</string>
<string name="gcal_TEA_error">Ошибка при добавлении задачи в календарь!</string>
<string name="gcal_TEA_showCalendar_label">Открыть событие календаря</string>
<string name="delete_calendar_event_confirmation">Удалить событие в календаре?</string>
<string name="calendar_event_not_found">Событие в календаре не найдено</string>
<string name="gcal_completed_title">%s (выполнено)</string>
<string name="CFC_gtasks_list_text">В списке: \?</string>
<string name="CFC_gtasks_list_name">В списке GTasks…</string>
<string name="gtasks_GTA_clear_completed">Очистить завершенные</string>
<string name="gtasks_GLA_authenticating">Авторизация…</string>
<string name="gtasks_GLA_errorIOAuth">При обращении к серверам Google возникли проблемы. Пожалуйста, попробуйте позже.</string>
<string name="gtasks_error_accountNotFound">Учетная запись %s не найдена — пожалуйста, выйдите и войдите снова через настройки Google Tasks.</string>
<string name="premium_record_audio">Записать заметку</string>
<string name="premium_remove_file_confirm">Вы уверены? Действие нельзя отменить</string>
<string name="audio_recording_title">Запись звука</string>
<string name="audio_stop_recording">Остановить запись</string>
<string name="ring_once">1 раз</string>
<string name="ring_five_times">5 раз</string>
<string name="ring_nonstop">Пока не выкл.</string>
<string name="random_reminder_hour">час</string>
<string name="random_reminder_day">день</string>
<string name="random_reminder_week">неделя</string>
<string name="random_reminder_two_weeks">через две недели</string>
<string name="random_reminder_month">месяц</string>
<string name="random_reminder_two_months">в два месяца</string>
<string name="rmd_NoA_done">Завершено</string>
<string name="rmd_NoA_snooze">Отложить</string>
<string name="snooze_all">Отложить все</string>
<string name="rmd_EPr_quiet_hours_start_title">Начало тихих часов</string>
<string name="rmd_EPr_quiet_hours_end_title">Конец тихих часов</string>
<string name="rmd_EPr_rmd_time_title">Напоминание по умолчанию</string>
<string name="rmd_EPr_rmd_time_desc">Уведомления для задач без срока выполнения появятся в %s</string>
<string name="persistent_notifications">Постоянные напоминания</string>
<string name="persistent_notifications_description">Постоянные уведомления нельзя убрать</string>
<string name="rmd_EPr_defaultRemind_title">Случайные напоминания</string>
<string name="default_random_reminder_disabled">отключено</string>
<string name="default_random_reminder_hourly">ежечасно</string>
<string name="default_random_reminder_daily">ежедневно</string>
<string name="default_random_reminder_weekly">еженедельно</string>
<string name="default_random_reminder_bi_weekly">каждые две недели</string>
<string name="default_random_reminder_monthly">ежемесячно</string>
<string name="default_random_reminder_bi_monthly">каждые два месяца</string>
<string name="repeat_every">Каждую(ые)</string>
<string name="repeat_option_does_not_repeat">Не повторять</string>
<string name="repeat_option_every_day">Ежедневно</string>
<string name="repeat_option_every_week">Еженедельно</string>
<string name="repeat_option_every_month">Ежемесячно</string>
<string name="repeat_option_every_year">Ежегодно</string>
<string name="repeat_option_custom">Другой…</string>
<string name="repeat_minutely">ПОВТОРЯТЬ ЕЖЕМИНУТНО</string>
<string name="repeat_hourly">ПОВТОРЯТЬ ЕЖЕЧАСНО</string>
<string name="repeat_daily">ПОВТОРЯТЬ ЕЖЕДНЕВНО</string>
<string name="repeat_weekly">ПОВТОРЯТЬ ЕЖЕНЕДЕЛЬНО</string>
<string name="repeat_monthly">ПОВТОРЯТЬ ЕЖЕМЕСЯЧНО</string>
<string name="repeat_yearly">ПОВТОРЯТЬ ЕЖЕГОДНО</string>
<plurals name="task_count">
<item quantity="one">%d задача</item>
<item quantity="few">%d задачи</item>
<item quantity="many">%d задач</item>
</plurals>
<plurals name="repeat_times">
<item quantity="one">раз</item>
<item quantity="few">раза</item>
<item quantity="many">раз</item>
</plurals>
<plurals name="repeat_minutes">
<item quantity="one">минута</item>
<item quantity="few">минуты</item>
<item quantity="many">минут</item>
</plurals>
<plurals name="repeat_n_minutes">
<item quantity="one">%d минуту</item>
<item quantity="few">%d минуты</item>
<item quantity="many">%d минут</item>
</plurals>
<plurals name="repeat_hours">
<item quantity="one">час</item>
<item quantity="few">часа</item>
<item quantity="many">часов</item>
</plurals>
<plurals name="repeat_n_hours">
<item quantity="one">%d час</item>
<item quantity="few">%d часа</item>
<item quantity="many">%d часов</item>
</plurals>
<plurals name="repeat_days">
<item quantity="one">день</item>
<item quantity="few">дня</item>
<item quantity="many">дней</item>
</plurals>
<plurals name="repeat_n_days">
<item quantity="one">%d день</item>
<item quantity="few">%d дня</item>
<item quantity="many">%d дней</item>
</plurals>
<plurals name="repeat_weeks">
<item quantity="one">неделю</item>
<item quantity="few">недели</item>
<item quantity="many">недель</item>
</plurals>
<plurals name="repeat_n_weeks">
<item quantity="one">%d неделя</item>
<item quantity="few">%d недели</item>
<item quantity="many">%d недель</item>
</plurals>
<plurals name="repeat_months">
<item quantity="one">месяц</item>
<item quantity="few">месяца</item>
<item quantity="many">месяцев</item>
</plurals>
<plurals name="repeat_n_months">
<item quantity="one">%d месяц</item>
<item quantity="few">%d месяца</item>
<item quantity="many">%d месяцев</item>
</plurals>
<plurals name="repeat_years">
<item quantity="one">год</item>
<item quantity="few">года</item>
<item quantity="many">лет</item>
</plurals>
<plurals name="repeat_n_years">
<item quantity="one">%d год</item>
<item quantity="few">%d года</item>
<item quantity="many">%d лет</item>
</plurals>
<string name="repeat_type_due">намеченной даты</string>
<string name="repeat_type_completion">даты завершения</string>
<string name="repeat_forever">Повторять всегда</string>
<string name="repeat_until">Повторять до %s</string>
<string name="repeat_number_of_times">Повторять несколько раз</string>
<string name="repeat_occurs">Повторять</string>
<string name="repeat_snackbar">«%1$s» перенесено на %2$s</string>
<string name="new_tag">Создать новый тег</string>
<string name="new_list">Создать новый список</string>
<string name="delete_tag_confirmation">Удалить %s?</string>
<string name="TPl_notification">Для %s действуют таймеры!</string>
<string name="TFE_workingOn">Задачи с таймером</string>
<string name="TEA_timer_controls">Таймер</string>
<string name="TEA_timer_comment_started">задача началась:</string>
<string name="TEA_timer_comment_stopped">задача завершилась:</string>
<string name="TEA_timer_comment_spent">Времени затрачено:</string>
<string name="voice_create_prompt">Говорите, чтобы создать задачу</string>
<string name="EPr_voiceInputEnabled_title">Голосовой ввод</string>
<string name="EPr_voiceRemindersEnabled_title">Голосовые напоминания</string>
<string name="EPr_voiceRemindersEnabled_desc_enabled">Tasks будет произносить название задач во время напоминаний</string>
<string name="delete_task">Удалить задачу</string>
<string name="voice_command_added_task">Добавленная задача</string>
<plurals name="Ntasks">
<item quantity="one">1 задача</item>
<item quantity="few">%d задачи</item>
<item quantity="many">%d задач</item>
</plurals>
<string name="today">Сегодня</string>
<string name="tomorrow">Завтра</string>
<string name="next">Следующ. %s</string>
<string name="yesterday">Вчера</string>
<string name="tmrw">Завтра</string>
<string name="yest">Вчера</string>
<string name="sync_SPr_interval_title">Фоновая синхронизация</string>
<string name="widget_show_checkboxes">Показать кнопки для галочек</string>
<string name="widget_show_header">Показать заголовок</string>
<string name="widget_show_settings">Показать настройки</string>
<string name="notifications">Уведомления</string>
<string name="silent">Без звука</string>
<string name="sound">Звук</string>
<string name="vibrations">Вибрация</string>
<string name="quiet_hours">Тихие часы</string>
<string name="attachment_directory">Папка вложений</string>
<string name="backup_directory">Папка резервных копий</string>
<string name="google_drive_backup">Резервное копирование в Google Drive</string>
<string name="miscellaneous">Прочие настройки</string>
<string name="synchronization">Синхронизация</string>
<string name="enabled">Включить режим</string>
<string name="font_size">Размер шрифта</string>
<string name="row_spacing">Межстрочный интервал</string>
<string name="customize_edit_screen">Настроить экран редактирования</string>
<string name="source_code">Исходный код</string>
<string name="translations">Участвовать в переводе программы</string>
<string name="contact_developer">Связь с разработчиком</string>
<string name="rate_tasks">Оставить отзыв</string>
<string name="quiet_hours_summary">Выкл. напоминания в тихие часы</string>
<string name="TLA_menu_donate">Поддержать разработку</string>
<string name="add_reminder">Добавить напоминание</string>
<string name="add_location">Добавить место</string>
<string name="remove">Удалить</string>
<string name="randomly_once">Случайно один раз</string>
<string name="randomly">Случайно</string>
<string name="pick_a_date">Дата</string>
<string name="pick_a_time">Время</string>
<string name="pick_a_date_and_time">Дата и время</string>
<string name="when_overdue">Когда просрочено</string>
<string name="when_due">В срок</string>
<string name="geofence_radius">Радиус</string>
<string name="location_radius_meters">%s м</string>
<string name="tags">Теги</string>
<string name="filters">Фильтры</string>
<string name="date_shortcut_hour">На час</string>
<string name="date_shortcut_morning">Утро</string>
<string name="date_shortcut_afternoon">Обед</string>
<string name="date_shortcut_evening">Вечер</string>
<string name="date_shortcut_night">Ночь</string>
<string name="date_shortcut_tomorrow_morning">Завтра утром</string>
<string name="date_shortcut_tomorrow_afternoon">Завтра после обеда</string>
<string name="date_shortcut_must_come_before">%1$s должно идти перед %2$s</string>
<string name="date_shortcut_must_come_after">%1$s должно идти после %2$s</string>
<string name="discard_changes">Отменить изменения?</string>
<string name="discard">Отмена</string>
<string name="tag_settings">Настройки тегов</string>
<string name="list_settings">Настройки списка</string>
<string name="delete">Удалить</string>
<string name="copy">Копия</string>
<string name="move">Перенести</string>
<string name="filter_settings">Настройки фильтра</string>
<string name="show_hidden">Показать скрытые</string>
<string name="show_completed">Показать выполненные</string>
<string name="reverse">Наоборот</string>
<string name="add_attachment">Прикрепить файл</string>
<string name="take_a_picture">Сделать снимок</string>
<string name="pick_from_gallery">Выбрать изображение из галереи</string>
<string name="pick_from_storage">Выбрать файл с диска</string>
<string name="privacy_policy">Политика конфиденциальности</string>
<string name="send_anonymous_statistics">Содействовать улучшению Tasks</string>
<string name="send_anonymous_statistics_summary">Отправлять анонимную статистику и отчёты об ошибках для содействия улучшению программы. Персональная информация не собирается.</string>
<string name="tag_already_exists">Тег уже существует</string>
<string name="name_cannot_be_empty">Необходимо задать имя</string>
<string name="username_required">Требуется имя пользователя</string>
<string name="password_required">Требуется пароль</string>
<string name="url_required">Требуется URL</string>
<string name="url_host_name_required">Требуется имя хоста</string>
<string name="url_invalid_scheme">Должно начинаться с http(s)://</string>
<string name="no_title">(Без заголовка)</string>
<string name="back_button_saves_task">Кнопка «Назад» сохраняет задачу</string>
<string name="default_list">Список по умолчанию</string>
<string name="filter">Фильтр</string>
<string name="opacity">Непрозрачность</string>
<string name="theme">Цветовая тема</string>
<string name="color">Цвет</string>
<string name="accent">Акцент</string>
<string name="launcher_icon">Иконка запуска</string>
<string name="theme_black">Чёрная</string>
<string name="theme_light">Светлая</string>
<string name="theme_dark">Тёмная</string>
<string name="theme_wallpaper">Как обои</string>
<string name="theme_day_night">День / ночь</string>
<string name="language">Язык</string>
<string name="restart_required">Перезапустите Tasks для применения изменений</string>
<string name="restart_now">Перезапустить сейчас</string>
<string name="restart_later">Позже</string>
<string name="settings_localization">Локализация</string>
<string name="led_notification">LED уведомления</string>
<string name="hardware_support_required">Необходима аппаратная поддержка</string>
<string name="no_calendars_found">Календарей не найдено</string>
<string name="widget_settings">Настройки виджета</string>
<string name="widget_header_settings">Настройки заголовка</string>
<string name="widget_row_settings">Настройки строк</string>
<string name="clear_completed_tasks_confirmation">Очистить завершенные задачи?</string>
<string name="copy_multiple_tasks_confirmation">Клонировано %s задач(и)</string>
<string name="delete_multiple_tasks_confirmation">%s удалено</string>
<string name="delete_selected_tasks">Удалить выделенную(-ые) задачу(-и)?</string>
<string name="copy_selected_tasks">Скопировать выделенные задачи?</string>
<string name="date_and_time">Дата и время</string>
<string name="start_of_week">Начало недели</string>
<string name="use_locale_default">Как в системе</string>
<string name="add_account">Добавить учётную запись</string>
<string name="user">Пользователь</string>
<string name="password">Пароль</string>
<string name="notification_disable_battery_optimizations_description">Оптимизация расхода может задерживать уведомления</string>
<string name="bundle_notifications">Группировать уведомления</string>
<string name="badges">Ярлыки</string>
<string name="list">Список</string>
<string name="repeats_from">Повторять от</string>
<string name="repeats_single">Повторять %s</string>
<string name="repeats_single_on">Повторять %1$s в %2$s</string>
<string name="repeats_single_until">Повторять %1$s до %2$s</string>
<string name="repeats_single_number_of_times">Повторять %1$s, %2$d %3$s</string>
<string name="repeats_single_on_until">Повторять %1$s в %2$s до %3$s</string>
<string name="repeats_single_on_number_of_times">Повторять %1$s в %2$s, %3$d %4$s</string>
<string name="repeats_minutely">Ежеминутно</string>
<string name="repeats_hourly">ежечасно</string>
<string name="repeats_daily">ежедневно</string>
<string name="repeats_weekly">еженедельно</string>
<string name="repeats_monthly">ежемесячно</string>
<string name="repeats_yearly">ежегодно</string>
<string name="repeats_plural">Повторять каждые %s</string>
<string name="repeats_plural_on">Повторять каждые %1$s в %2$s</string>
<string name="repeats_plural_until">Повторять каждые %1$s до %2$s</string>
<string name="repeats_plural_number_of_times">Повторять каждые %1$s, %2$d %3$s</string>
<string name="repeats_plural_on_until">Повторять каждые %1$s в %2$s до %3$s</string>
<string name="repeats_plural_on_number_of_times">Повторять каждые %1$s в %2$s, %3$d %4$s</string>
<string name="dont_add_to_calendar">Не добавлять в календарь</string>
<string name="default_calendar">Календарь по умолчанию</string>
<string name="badges_description">Отображать количество задач на иконке приложения. Не все лаунчеры это поддерживают.</string>
<string name="bundle_notifications_summary">Группировать несколько уведомлений в одно общее</string>
<string name="repeat_monthly_same_day_each_month">в тот же день ежемесячно</string>
<string name="repeat_monthly_every_day_of_nth_week">каждый %1$s %2$s</string>
<string name="repeat_monthly_on_every_day_of_nth_week">в каждый %1$s %2$s</string>
<string name="repeat_monthly_first_week">первая</string>
<string name="repeat_monthly_second_week">вторая</string>
<string name="repeat_monthly_third_week">третья</string>
<string name="repeat_monthly_fourth_week">четвёртая</string>
<string name="repeat_monthly_last_week">последняя</string>
<string name="tasker_create_task">Создать задачу</string>
<string name="tasker_list_notification">Список уведомлений</string>
<string name="help">Помощь</string>
<string name="caldav_home_set_not_found">Домашний набор не найден</string>
<string name="network_error">Не удалось подключиться</string>
<string name="background_sync_unmetered_only">Только на соединениях без тарификации</string>
<string name="upgrade_to_pro">Обновить до версии Про</string>
<string name="manage_subscription">Управление подпиской</string>
<string name="refresh_purchases">Обновить покупки</string>
<string name="button_subscribe">Подписаться</string>
<string name="button_more_info">Подробнее</string>
<string name="about">О программе</string>
<string name="license_summary">Tasks является свободным программным обеспечением с открытым исходным кодом, лицензированным под GNU General Public License v3.0</string>
<string name="pro_dashclock_extension">Расширение для Dashclock</string>
<string name="requires_pro_subscription">Требуется версия Про</string>
<string name="logout">Отключиться</string>
<string name="logout_warning">Отключиться от %s? Все данные учётной записи на этом устройстве будут удалены</string>
<string name="cannot_access_account">Учётная запись недоступна</string>
<string name="reinitialize_account">Инициализировать заново</string>
<string name="action_create_new_task">Создать новую задачу</string>
<string name="show_description">Показать описание</string>
<string name="show_full_description">Показать полное описание</string>
<string name="linkify">Показать ссылки</string>
<string name="linkify_description">Добавить ссылки на сайты, адреса и номера телефонов</string>
<string name="location_remind_arrival">Напомнить по прибытии</string>
<string name="location_remind_departure">Напомнить покинув место</string>
<string name="visit_website">Посетить вебсайт</string>
<string name="location_arrived">Прибытие в %s</string>
<string name="location_departed">Покинули %s</string>
<string name="choose_a_location">Выбрать местоположение</string>
<string name="pick_this_location">Выбрать это местоположение</string>
<string name="or_choose_a_location">Или выбрать местоположение</string>
<string name="map_search_provider">Поставщик системы поиска</string>
<string name="missing_permissions">Отсутствующие разрешения</string>
<string name="version_string">Версия %s</string>
<string name="gtasks_GPr_header">Google Tasks</string>
<string name="open_map">Открыть карту</string>
<string name="choose_new_location">Выберите новое местоположение</string>
<string name="invalid_backup_file">Неверный файл резервной копии</string>
<string name="icon">Иконка</string>
<string name="button_current_subscription">Текущая подписка</string>
<string name="button_restore_subscription">Восстановить подписку</string>
<string name="button_unsubscribe">Отменить подписку</string>
<string name="name_your_price">Назовите свою цену</string>
<string name="url">URL</string>
<string name="error_adding_account">Ошибка: %s</string>
<string name="list_separator_with_space">", "</string>
<string name="building_notifications">Генерация уведомлений</string>
<string name="manage_subscription_summary">Повысить, понизить уровень подписки или отменить ее</string>
<string name="button_downgrade">Понизить уровень подписки</string>
<string name="button_upgrade">Повысить уровень подписки</string>
<string name="SSD_sort_my_order">Ручная сортировка</string>
<string name="EPr_temp_show_completed_tasks">Временно показывать задачи после завершения</string>
<string name="EPr_temp_completed_tasks_showing">Задачи будут временно видны в списке после завершения</string>
<string name="EPr_temp_completed_tasks_not_showing">Задачи сразу же исчезнут из списка после завершения</string>
<plurals name="subtask_count">
<item quantity="one">%d подзадача</item>
<item quantity="few">%d подзадачи</item>
<item quantity="many">%d подзадач</item>
</plurals>
<string name="TEA_add_subtask">Добавить подзадачу</string>
<string name="subtasks">Подзадачи</string>
<string name="location_permission_required_location">Доступ к данным о геолокации нужен, чтобы определить Ваше текущее местоположение</string>
<string name="third_party_licenses">Сторонние лицензии</string>
<string name="google_tasks_add_to_top">Новые задачи наверху</string>
<string name="monthly">Ежемесячно</string>
<string name="annually">Ежегодно</string>
<string name="caldav_account_repeating_tasks">Позволить серверу запланировать повторяющиеся задачи</string>
<string name="expand_subtasks">Развернуть подзадачи</string>
<string name="collapse_subtasks">Свернуть подзадачи</string>
<string name="subtasks_multilevel_google_task">Многоуровневые подзадачи не поддерживаются Google Tasks</string>
<string name="enter_title_hint">Введите название</string>
<string name="enter_tag_name">Введите имя тега</string>
<string name="create_new_tag">Создать \"%s\"</string>
<string name="encryption_password_required">Требуется пароль шифрования</string>
<string name="encryption_password">Пароль шифрования</string>
<string name="display_name">Имя</string>
<string name="this_feature_requires_a_subscription">Эта функция требует подписки</string>
<string name="choose_synchronization_service">Выберите платформу</string>
<string name="google_tasks_selection_description">Простой сервис, который синхронизируется с Вашим аккаунтом Google</string>
<string name="caldav_selection_description">Синхронизация, основанная на открытых стандартах</string>
<string name="etesync_selection_description">Синхронизация с открытым исходным кодом, основанная на end-to-end шифровании</string>
<string name="passwords_do_not_match">Пароли не совпадают</string>
<string name="reenter_encryption_password">Подтвердите пароль шифрования</string>
<string name="show_advanced_settings">Показать расширенные настройки</string>
<string name="caldav_account_description">Требует аккаунта у провайдера CalDAV или собственного сервера. Список провайдеров можно найти на tasks.org/caldav</string>
<string name="etesync_account_description">Требует аккаунта на EteSync.com или собственного сервера</string>
<string name="etesync_encryption_description">Запомните выбранный пароль шифрования, его нельзя будет восстановить!</string>
<string name="encryption_password_wrong">Неверный пароль шифрования</string>
<string name="help_and_feedback">Помощь и обратная связь</string>
<string name="documentation">Документация</string>
<string name="preferences_look_and_feel">Внешний вид</string>
<string name="preferences_advanced">Расширенные</string>
<string name="accounts">Учетные записи</string>
<string name="wearable_notifications">Уведомления носимых устройств</string>
<string name="wearable_notifications_summary">Отображать уведомления на Вашем носимом устройстве</string>
<string name="troubleshooting">Решение проблем</string>
<string name="notification_troubleshooting_summary">Нажмите здесь в случае проблем с уведомлениями</string>
<string name="disable_battery_optimizations">Выключить оптимизацию энергопотребления</string>
<string name="more_settings">Прочие настройки</string>
<string name="more_notification_settings_summary">Рингтон, вибровызов и прочее</string>
<string name="invalid_username_or_password">Неверное имя пользователя или пароль</string>
<string name="theme_system_default">Системная по умолчанию</string>
<string name="color_wheel">Палитра</string>
<string name="upgrade_blurb_1">Привет! Меня зовут Алекс. Я - независимый разработчик, стоящий за программой Tasks</string>
<string name="upgrade_blurb_2">Я потратил тысячи часов, работая над Tasks, и я публикую весь исходный код онлайн, бесплатно. Для того, чтобы поддержать мою работу, некоторые функциональности требуют подписки</string>
<string name="upgrade_blurb_3">Выберите любую сумму подписки для того, чтобы начать Ваш бесплатный пробный период. Вы можете отказаться в любой момент</string>
<string name="upgrade_blurb_4">Ваша поддержка много значит для меня, спасибо!</string>
<string name="back">Назад</string>
<string name="chip_style">Стиль индикаторов списков</string>
<string name="chip_style_outlined">Контурный</string>
<string name="chip_style_filled">Заполненный</string>
<string name="chips">Индикаторы списков</string>
<string name="chip_appearance">Внешний вид индикаторов списков</string>
<string name="desaturate_colors">Уменьшить насыщенность цветов</string>
<string name="desaturate_colors_summary_on">Цвета будут менее насыщенными в темных темах</string>
<string name="desaturate_colors_summary_off">Цвета не будут менее насыщенными в темных темах</string>
<string name="shortcut_pick_time">Выбрать время</string>
<string name="no_time">Без времени</string>
<string name="no_date">Без даты</string>
<string name="chip_appearance_icon_only">Только иконка</string>
<string name="chip_appearance_text_only">Только текст</string>
<string name="chip_appearance_text_and_icon">Текст и иконка</string>
<string name="add_place">Добавить место</string>
<string name="hide_unused_places">Спрятать неиспользуемые места</string>
<string name="hide_unused_tags">Спрятать неиспользуемые метки</string>
<string name="navigation_drawer">Панель навигации</string>
<string name="place_settings">Настройки места</string>
<string name="places">Места</string>
<string name="menu_discard_changes">Отменить изменения</string>
<string name="hide_check_button">Скрыть кнопку для галочки</string>
<string name="share">Поделиться</string>
<string name="select_all">Выбрать всё</string>
<string name="calendar_event_created">В календаре создано событие для %s</string>
<string name="auto_dismiss_datetime_summary">Закрывать выбор даты и времени после назначения даты или времени</string>
<string name="auto_dismiss_datetime">Автоматически закрывать выбор даты и времени</string>
<string name="compact">Компактный</string>
<string name="settings_default">По умолчанию</string>
<string name="widget_id">Идентификатор виджета: %d</string>
<string name="auto_dismiss_datetime_widget_summary">Автоматически закрывать при выборе из виджета</string>
<string name="auto_dismiss_datetime_widget">Виджет</string>
<string name="auto_dismiss_datetime_edit_summary">Автоматически закрывать при выборе из экрана редактирования задачи</string>
<string name="auto_dismiss_datetime_edit">Редактирование задачи</string>
<string name="auto_dismiss_datetime_list_summary">Автоматически закрывать при выборе из списка задач</string>
<string name="auto_dismiss_datetime_list">Список задач</string>
<string name="widget_due_date_hidden">Спрятано</string>
<string name="widget_due_date_below_title">Под названием</string>
<string name="widget_due_date_after_title">После названия</string>
<string name="widget_due_date_reschedule">Перенести задачу</string>
<string name="widget_open_list">Открыть список</string>
<string name="widget_do_nothing">Ничего не делать</string>
<string name="widget_on_click">По щелчку</string>
<string name="widget_footer">Футер</string>
<string name="widget_footer_settings">Настройки футера</string>
<string name="opacity_footer">Непрозрачность футера</string>
<string name="opacity_row">Непрозрачность строки</string>
<string name="opacity_header">Непрозрачность заголовка</string>
<string name="widget_show_dividers">Показать разделители</string>
<string name="widget_show_menu">Показать меню</string>
<string name="widget_hide_background">Спрятать фон</string>
<string name="filter_eisenhower_box_4">Матрица Эйзенхауера 4</string>
<string name="filter_eisenhower_box_3">Матрица Эйзенхауера 3</string>
<string name="filter_eisenhower_box_2">Матрица Эйзенхауера 2</string>
<string name="filter_eisenhower_box_1">Матрица Эйзенхауера 1</string>
<string name="filter_no_priority">Без приоритета</string>
<string name="filter_low_priority">Низкий приоритет</string>
<string name="filter_medium_priority">Средний приоритет</string>
<string name="filter_high_priority">Высокий приоритет</string>
<string name="add_filter">Добавить фильтр</string>
<string name="add_tags">Добавить теги</string>
<string name="filter_no_tags">Без тегов</string>
<string name="filter_after_today">После сегодняшнего дня</string>
<string name="filter_any_due_date">Любая дата выполнения</string>
<string name="filter_today_only">Только сегодняшние</string>
<string name="filter_overdue">Просроченные</string>
<string name="custom_filter_not">НЕ</string>
<string name="custom_filter_or">ИЛИ</string>
<string name="custom_filter_and">И</string>
<string name="custom_filter_criteria">Критерии фильтрации</string>
<string name="sort_created">По времени создания</string>
<string name="got_it">Понятно!</string>
<string name="no_thanks">Нет, спасибо</string>
<string name="support_development_subscribe">Разблокировать дополнительные функции и поддержать ПО с открытым исходным кодом</string>
<string name="tell_me_how_im_doing">Пожалуйста, дайте мне знать, как я справляюсь</string>
<string name="enjoying_tasks">Нравится Tasks\?</string>
<string name="whats_new_in_version">Что нового в версии %s</string>
<string name="whats_new">Что нового</string>
<string name="action_new_task">Новая задача</string>
<string name="sort_modified_group">Модифицировано %s</string>
<string name="sort_created_group">Создано %s</string>
<string name="yesterday_lowercase">вчера</string>
<string name="tomorrow_lowercase">завтра</string>
<string name="today_lowercase">сегодня</string>
<string name="permission_read_tasks">Полный доступ к базе данных задач</string>
<string name="reset_sort_order">Сбросить порядок сортировки</string>
<string name="lists">Списки</string>
<string name="open_last_viewed_list">Открыть последний просмотренный список</string>
<string name="on_launch">При запуске</string>
<string name="disable_sort_groups">Отключить сортировку групп</string>
<string name="improve_performance_summary">Отключите группы сортировки и складные подзадачи, чтобы повысить производительность приложения</string>
<string name="improve_performance">Улучшить производительность</string>
<string name="date_shortcut_tomorrow_night">Завтра ночью</string>
<string name="date_shortcut_tomorrow_evening">Завтра вечером</string>
<string name="CFC_list_name">В списке…</string>
<string name="astrid_sort_order_summary">Включите режим ручной сортировки Astrid для «Мои задачи», «Сегодня» и тегов. Этот режим сортировки будет заменен на «Мой порядок» в будущем обновлении</string>
<string name="astrid_sort_order">Ручная сортировка Astrid</string>
<string name="manage_lists">Управление списками</string>
<string name="davx5_selection_description">Синхронизируйте свои задачи с приложением DAVx⁵</string>
<string name="account">Учётная запись</string>
<string name="device_settings">Настройки устройства</string>
<string name="last_backup_never">никогда</string>
<string name="last_backup">Последнее резервное копирование: %s</string>
<string name="android_auto_backup_device_summary">Вы также должны выбрать службу резервного копирования в настройках вашего устройства. Не все устройства поддерживают резервное копирование.</string>
<string name="android_auto_backup">Служба резервного копирования Android</string>
<string name="automatic_backups">Автоматическое резервное копирование</string>
<string name="background_location">Местоположение на заднем плане</string>
<string name="foreground_location">Расположение на переднем плане</string>
<string name="background_location_permission_required">Разрешения на местоположение необходимы для напоминаний на основе местоположения. Если вы ранее отклоняли запрос разрешения на определение местоположения, вы должны вручную предоставить разрешение в настройках вашего устройства.</string>
<string name="no_app_found">Ни одно приложение не может обработать этот запрос</string>
<string name="backup_location_warning">ВНИМАНИЕ: Файлы, расположенные в %s, будут удалены при удалении Tasks! Выберите произвольное расположение, чтобы Android не смог удалить ваши файлы.</string>
<string name="backups_ignore_warnings_summary">Игнорировать предупреждения о резервном копировании, если вам не нужны резервные копии или у вас есть собственное решение для резервного копирования</string>
<string name="backups_ignore_warnings">Игнорировать предупреждения</string>
</resources>
|
{
"pile_set_name": "Github"
}
|
exports = module.exports = typeof Object.keys === 'function'
? Object.keys : shim;
exports.shim = shim;
function shim (obj) {
var keys = [];
for (var key in obj) keys.push(key);
return keys;
}
|
{
"pile_set_name": "Github"
}
|
# coding=utf-8
from flask_redis import FlaskRedis
from flask_cache import Cache
redis_store = FlaskRedis()
cache = Cache()
|
{
"pile_set_name": "Github"
}
|
<?php
/**
* Bitrix Framework
* @package bitrix
* @subpackage iblock
*/
namespace Bitrix\Iblock\InheritedProperty;
use Bitrix\Iblock\Template\Entity\Element;
class ElementTemplates extends BaseTemplate
{
/**
* @param integer $iblockId Identifier of the iblock of element.
* @param integer $elementId Identifier of the element.
*/
public static function __construct($iblockId, $elementId)
{
$entity = new ElementValues($iblockId, $elementId);
parent::__construct($entity);
}
}
|
{
"pile_set_name": "Github"
}
|
require('./_typed-array')('Int8', 1, function (init) {
return function Int8Array(data, byteOffset, length) {
return init(this, data, byteOffset, length);
};
});
|
{
"pile_set_name": "Github"
}
|
---
apiVersion: template.openshift.io/v1
kind: Template
metadata:
name: log-anomaly-detector
objects:
- apiVersion: v1
kind: PersistentVolumeClaim
metadata:
labels:
app: log-anomaly-detector-${APP_NAME}
name: log-anomaly-detector-${APP_NAME}
spec:
accessModes:
- ReadWriteOnce
resources:
requests:
storage: 1Gi
- apiVersion: image.openshift.io/v1
kind: ImageStream
metadata:
labels:
app: log-anomaly-detector
name: log-anomaly-detector
spec:
lookupPolicy:
local: true
- apiVersion: build.openshift.io/v1
kind: BuildConfig
metadata:
labels:
app: log-anomaly-detector
name: anomaly-detector
spec:
output:
to:
kind: ImageStreamTag
name: log-anomaly-detector:latest
source:
git:
ref: ${GIT_REF}
uri: ${GIT_URI}
type: Git
strategy:
sourceStrategy:
from:
kind: ImageStreamTag
name: python:3.6
namespace: openshift
type: Source
triggers:
- imageChange: {}
type: ImageChange
- type: ConfigChange
- apiVersion: apps.openshift.io/v1
kind: DeploymentConfig
metadata:
labels:
app: log-anomaly-detector-${APP_NAME}
name: log-anomaly-detector-${APP_NAME}
spec:
replicas: 1
selector:
deploymentconfig: log-anomaly-detector-${APP_NAME}
template:
metadata:
labels:
app: log-anomaly-detector-${APP_NAME}
deploymentconfig: log-anomaly-detector-${APP_NAME}
spec:
containers:
- args:
- app.py
- run
- --config-yaml
- validation_data/.env_config.yaml
command:
- python
image: log-anomaly-detector:latest
imagePullPolicy: Always
name: log-anomaly-detector
resources:
limits:
cpu: 1
memory: 1Gi
volumeMounts:
- mountPath: /opt/app-root/src/models
name: model-storage
- mountPath: /opt/app-root/src/validation_data
name: volume-ehbcr
dnsPolicy: ClusterFirst
restartPolicy: Always
schedulerName: default-scheduler
securityContext: {}
terminationGracePeriodSeconds: 30
volumes:
- claimName: log-anomaly-detector-${APP_NAME}
name: model-storage
persistentVolumeClaim: null
- configMap:
defaultMode: 420
name: ${CONFIGMAP_NAME}
name: volume-ehbcr
test: false
triggers:
- type: ConfigChange
- imageChangeParams:
automatic: true
containerNames:
- log-anomaly-detector
from:
kind: ImageStreamTag
name: log-anomaly-detector:latest
type: ImageChange
- apiVersion: v1
kind: Service
metadata:
name: log-anomaly-detector-${APP_NAME}-svc
labels:
app: log-anomaly-detector-${APP_NAME}
spec:
selector:
app: log-anomaly-detector-${APP_NAME}
ports:
- protocol: TCP
name: metrics
port: 8080
targetPort: 8080
- apiVersion: v1
kind: ConfigMap
metadata:
name: sample-config
labels:
app: log-anomaly-detector-${APP_NAME}
data:
.env_config.yaml: |
STORAGE_DATASOURCE: "es"
STORAGE_DATASINK: "es"
ES_ENDPOINT: ${ES_ENDPOINT}
ES_QUERY: 'ecommerce'
ES_USE_SSL: False
ES_INPUT_INDEX: "lad-"
ES_TARGET_INDEX: "odcs-anomaly-detect-"
ES_VERSION: 7
FACT_STORE_URL: ${FACT_STORE_URL}
INFER_ANOMALY_THRESHOLD: 1.3
INFER_TIME_SPAN: 10
INFER_LOOPS: 1
PARALLELISM: 6
SOMPY_TRAIN_ROUGH_LEN: 100
SOMPY_TRAIN_FINETUNE_LEN: 5
SOMPY_INIT: "random"
parameters:
- name: APP_NAME
value: "demo"
- name: CONFIGMAP_NAME
value: "sample-config"
- name: ES_ENDPOINT
displayName: Host URL for elasticsearch
required: true
- name: FACT_STORE_URL
displayName: Host URL for FactStore
required: true
- name: CMD
value: run --config-yaml validation_data/.env_config.yaml
- name: GIT_URI
value: https://github.com/AICoE/log-anomaly-detector.git
- name: GIT_REF
value: master
|
{
"pile_set_name": "Github"
}
|
#
# MDEV-21963 Bind BINLOG ADMIN to a number of global system variables
#
SET @global=@@global.log_bin_trust_function_creators;
# Test that "SET log_bin_trust_function_creators" is not allowed without BINLOG ADMIN or SUPER
CREATE USER user1@localhost;
GRANT ALL PRIVILEGES ON *.* TO user1@localhost;
REVOKE BINLOG ADMIN, SUPER ON *.* FROM user1@localhost;
connect user1,localhost,user1,,;
connection user1;
SET GLOBAL log_bin_trust_function_creators=1;
ERROR 42000: Access denied; you need (at least one of) the SUPER, BINLOG ADMIN privilege(s) for this operation
SET log_bin_trust_function_creators=1;
ERROR HY000: Variable 'log_bin_trust_function_creators' is a GLOBAL variable and should be set with SET GLOBAL
SET SESSION log_bin_trust_function_creators=1;
ERROR HY000: Variable 'log_bin_trust_function_creators' is a GLOBAL variable and should be set with SET GLOBAL
disconnect user1;
connection default;
DROP USER user1@localhost;
# Test that "SET log_bin_trust_function_creators" is allowed with BINLOG ADMIN
CREATE USER user1@localhost;
GRANT BINLOG ADMIN ON *.* TO user1@localhost;
connect user1,localhost,user1,,;
connection user1;
SET GLOBAL log_bin_trust_function_creators=1;
SET log_bin_trust_function_creators=1;
ERROR HY000: Variable 'log_bin_trust_function_creators' is a GLOBAL variable and should be set with SET GLOBAL
SET SESSION log_bin_trust_function_creators=1;
ERROR HY000: Variable 'log_bin_trust_function_creators' is a GLOBAL variable and should be set with SET GLOBAL
disconnect user1;
connection default;
DROP USER user1@localhost;
# Test that "SET log_bin_trust_function_creators" is allowed with SUPER
CREATE USER user1@localhost;
GRANT SUPER ON *.* TO user1@localhost;
connect user1,localhost,user1,,;
connection user1;
SET GLOBAL log_bin_trust_function_creators=1;
SET log_bin_trust_function_creators=1;
ERROR HY000: Variable 'log_bin_trust_function_creators' is a GLOBAL variable and should be set with SET GLOBAL
SET SESSION log_bin_trust_function_creators=1;
ERROR HY000: Variable 'log_bin_trust_function_creators' is a GLOBAL variable and should be set with SET GLOBAL
disconnect user1;
connection default;
DROP USER user1@localhost;
SET @@global.log_bin_trust_function_creators=@global;
|
{
"pile_set_name": "Github"
}
|
<!--TO READ THIS HELP FILE, RIGHT-CLICK ON THE FILE NAME IN THE
SOLUTION EXPLORER PANE AND SELECT "VIEW IN BROWSER"-->
<html><head><title>Multithreading Sample</title></head><body><h1>Multithreading Sample</h1><div id="mainSection"><div id="mainBody"><div id="allHistory" class="saveHistory" onsave="saveAll()" onload="loadAll()"><font color="DarkGray"></font><p /></div><div class="introduction"><p>To get samples and instructions for installing them, see the following:</p><ul><li><p>Click <span class="ui">Samples</span> on the Visual Studio <span class="ui">Help</span> menu.</p><p>For more information, see <mshelp:link keywords="e121a9c2-b35b-4b3f-8cba-30edd84c835f" tabindex="0" xmlns:mshelp="http://msdn.microsoft.com/mshelp">Locating Sample Files</mshelp:link>.</p></li><li><p>The most recent versions and the complete list of samples are available on the Visual Studio 2008 Samples Web site. </p></li><li><p>You can also locate samples on your computer's hard disk. By default, samples and a Readme file are copied to a folder under \Program Files\Visual Studio 9\Samples\. For Visual Studio Express Editions, all samples are located on the Internet.</p><div class="alert"><table width="100%" IS" without warranties.</p></td></tr></table></div></li></ul></div><h3 class="procedureSubHeading">To run this sample</h3><div class="subSection"><ul><li><p>Press F5.</p></li></ul></div><h1 class="heading"><span style="cursor:default;" tabindex="0">Demonstrates</span></h1><div id="demonstratesSection" class="section" name="collapseableSection" style=""><p>This sample runs a time-consuming task on a separate thread, launched by a button click:</p><ul><li><p><span class="label">Run on same thread</span> The task runs on the same thread as the main form. This blocks the user from interacting with the main form until the task finishes. No multithreading code is needed for this task. </p></li><li><p><span class="label">Run on worker pool thread</span> The task uses the <span class="code">BeginInvoke</span> method created by the compiler for all delegates to run the task. </p></li><li><p><span class="label">Background worker</span> This task uses the <mshelp:link keywords="bef7b0ab-ce57-475a-a2d6-fb8a702a9417" tabindex="0" xmlns:mshelp="http://msdn.microsoft.com/mshelp">BackgroundWorker Component</mshelp:link> to create a new thread.</p></li></ul><p>This example does not include synchronization, because the multiple threads are not accessing any data. </p></div></div><div id="footer"><div class="footerLine"></div><!--<include item="copyrightStatement"/>--><A NAME="feedback"></A><span id="fb" class="feedbackcss" />
</div></div></body></html>
|
{
"pile_set_name": "Github"
}
|
(defsystem "ultralisp-test"
:class :package-inferred-system
:pathname "t"
:depends-on ("hamcrest"
"ultralisp"
"ultralisp-test/models/project"
"ultralisp-test/github/webhook"
"ultralisp-test/pipeline"
"ultralisp-test/db")
:perform (test-op :after (op c)
(symbol-call :log :config
:sane2 :warn)
(symbol-call :rove :run c)))
|
{
"pile_set_name": "Github"
}
|
eclipse.preferences.version=1
org.eclipse.jdt.core.compiler.codegen.inlineJsrBytecode=enabled
org.eclipse.jdt.core.compiler.codegen.targetPlatform=12
org.eclipse.jdt.core.compiler.codegen.unusedLocal=preserve
org.eclipse.jdt.core.compiler.compliance=12
org.eclipse.jdt.core.compiler.debug.lineNumber=generate
org.eclipse.jdt.core.compiler.debug.localVariable=generate
org.eclipse.jdt.core.compiler.debug.sourceFile=generate
org.eclipse.jdt.core.compiler.problem.assertIdentifier=error
org.eclipse.jdt.core.compiler.problem.enablePreviewFeatures=disabled
org.eclipse.jdt.core.compiler.problem.enumIdentifier=error
org.eclipse.jdt.core.compiler.problem.reportPreviewFeatures=warning
org.eclipse.jdt.core.compiler.release=enabled
org.eclipse.jdt.core.compiler.source=12
|
{
"pile_set_name": "Github"
}
|
@echo off
echo on
set ROOT_FOLDER=%~dp0\..\..
rem force root folder to an absolute path
pushd %ROOT_FOLDER%
set ROOT_FOLDER=%CD%
set NEW_FOLDER=%ROOT_FOLDER%\Utilities\CMake\output
set OLD_FOLDER=%ROOT_FOLDER%\Build
call %ROOT_FOLDER%\Utilities\CMake\scripts\RunCMake.cmd
call %ROOT_FOLDER%\Utilities\CMake\scripts\RunCMake.cmd -DWINRT=TRUE
call %ROOT_FOLDER%\Utilities\CMake\scripts\RunCMake.cmd -DXDK=TRUE
call %ROOT_FOLDER%\Utilities\CMake\scripts\RunCMake.cmd -DXDK=TRUE -DWINRT=TRUE
call %ROOT_FOLDER%\Utilities\CMake\scripts\RunCMake.cmd -DUNITTEST=TRUE -DTAEF=TRUE
call %ROOT_FOLDER%\Utilities\CMake\scripts\RunCMake.cmd -DUNITTEST=TRUE -DTE=TRUE
%ROOT_FOLDER%\Utilities\CMake\ProjectFileProcessor\bin\Debug\ProjectFileProcessor.exe %ROOT_FOLDER%
if "%1" EQU "skipCopy" goto skipCopy
copy %NEW_FOLDER%\Microsoft.Xbox.Services.110.XDK.WinRT.vcxproj* %OLD_FOLDER%\Microsoft.Xbox.Services.110.XDK.WinRT
copy %NEW_FOLDER%\Microsoft.Xbox.Services.140.UWP.Cpp.vcxproj* %OLD_FOLDER%\Microsoft.Xbox.Services.140.UWP.Cpp
copy %NEW_FOLDER%\Microsoft.Xbox.Services.140.UWP.WinRT.vcxproj* %OLD_FOLDER%\Microsoft.Xbox.Services.140.UWP.WinRT
copy %NEW_FOLDER%\Microsoft.Xbox.Services.140.XDK.Cpp.vcxproj* %OLD_FOLDER%\Microsoft.Xbox.Services.140.XDK.Cpp
copy %NEW_FOLDER%\Microsoft.Xbox.Services.141.UWP.Cpp.vcxproj* %OLD_FOLDER%\Microsoft.Xbox.Services.141.UWP.Cpp
copy %NEW_FOLDER%\Microsoft.Xbox.Services.141.XDK.Cpp.vcxproj* %OLD_FOLDER%\Microsoft.Xbox.Services.141.XDK.Cpp
copy %NEW_FOLDER%\Microsoft.Xbox.Services.UnitTest.140.TAEF.vcxproj* %OLD_FOLDER%\Microsoft.Xbox.Services.UnitTest.140.TAEF
copy %NEW_FOLDER%\Microsoft.Xbox.Services.UnitTest.140.TE.vcxproj* %OLD_FOLDER%\Microsoft.Xbox.Services.UnitTest.140.TE
:skipCopy
goto done
:help
echo.
echo MakeProjects.cmd [skipCopy]
echo.
echo Example:
echo MakeProjects.cmd
echo.
:done
|
{
"pile_set_name": "Github"
}
|
# Event 100 - task_0
###### Version: 0
## Description
None
## Data Dictionary
|Standard Name|Field Name|Type|Description|Sample Value|
|---|---|---|---|---|
|TBD|_String1|UnicodeString|None|`None`|
## Tags
* etw_level_Informational
* etw_task_task_0
|
{
"pile_set_name": "Github"
}
|
'use strict'
const tman = require('tman')
const should = require('should')
module.exports = function (thunks) {
tman.suite('thunk with generator', function () {
tman.it('yield any value', function (done) {
var thunk = thunks()
thunk(function * () {
should(yield 1).be.equal(1)
should(yield null).be.equal(null)
should(yield thunk(1)).be.equal(1)
should(yield Promise.resolve(1)).be.equal(1)
should(yield [1, 2, 3]).be.eql([1, 2, 3])
should(yield [1, 2, thunk(3)]).be.eql([1, 2, 3])
should(yield {}).be.eql({})
should(yield {
name: 'thunks',
version: thunk('v2')
}).be.eql({
name: 'thunks',
version: 'v2'
})
should(yield [{},
[],
[{}]
]).be.eql([{},
[],
[{}]
])
should(yield function (callback) {
callback(null, 1, 2, 3)
}).be.eql([1, 2, 3])
return yield [
1,
function (cb) {
setTimeout(function () {
cb(null, 2)
})
},
thunk(3),
Promise.resolve(4),
thunk(function * () {
return yield 5
})
]
})(function (err, res) {
should(err).be.equal(null)
should(res).be.eql([1, 2, 3, 4, 5])
})(done)
})
tman.it('catch error', function (done) {
var thunk = thunks()
var error = null
thunk(function * () {
try {
yield function (cb) {
throw new Error('catch error 1')
}
} catch (err) {
error = err
}
should(error).be.instanceOf(Error)
should(error.message).be.equal('catch error 1')
try {
yield function * () {
throw new Error('catch error 2')
}
} catch (err) {
error = err
}
should(error).be.instanceOf(Error)
should(error.message).be.equal('catch error 2')
yield [1, Promise.reject(new Error('reject error')), 3]
})(function (err, res) {
should(err).be.instanceOf(Error)
should(err.message).be.equal('reject error')
should(res).be.equal(undefined)
})(done)
})
tman.it('call with context', function (done) {
var thunk = thunks()
var x = {}
thunk.call(x, function * () {
should(this).be.equal(x)
return yield [
function (callback) {
should(this).be.equal(x)
callback(null, 1)
}, [
function (callback) {
should(this).be.equal(x)
callback(null, 1)
}
]
]
})(function (err, res) {
should(err).be.equal(null)
should(res).be.eql([1, [1]])
})(done)
})
tman.it('nested yield and chained generator', function (done) {
var thunk = thunks()
thunk(function * () {
should(yield function * () {
return yield 1
}).be.equal(1)
return function * () {
return yield [1, 2, 3, 4, 5]
}
})(function * (err, res) {
should(err).be.equal(null)
should(res).be.eql([1, 2, 3, 4, 5])
should(yield res).be.eql([1, 2, 3, 4, 5])
return (function * () {
return yield [1, 2, 3, 4, 5]
})()
})(function * (err, res) {
should(err).be.equal(null)
should(res).be.eql([1, 2, 3, 4, 5])
})(done)
})
tman.it('nested yield 2', function (done) {
var thunk = thunks()
thunk(function * () {
return yield [
thunk.all([
function * () {
return yield 1
}, (function * () {
return yield 2
}())
]),
thunk.seq([
function * () {
return yield 3
},
(function * () {
return yield 4
}())
]),
{
a: thunk(5),
b: yield 6
}
]
})(function (error, res) {
should(error).be.equal(null)
should(res).be.eql([
[1, 2],
[3, 4],
{ a: 5, b: 6 }
])
})(done)
})
tman.it('stop thunk', function (done) {
var thunk = thunks()
thunk(function * () {
thunk.stop()
should('It will not run!').be.equal('')
})(function () {
should('It will not run!').be.equal('')
})
thunk(function * () {
try {
yield function * () {
thunk.stop()
should('It will not run!').be.equal('')
}
} catch (e) {
should('It will not run!').be.equal('')
}
})(function () {
should('It will not run!').be.equal('')
})
done()
})
tman.it('stop thunk with onstop', function (done) {
var thunk = thunks({
onstop: function (sig) {
should(sig.message).be.equal('generator')
done()
}
})
var thunk2 = thunks()
thunk2.delay(100)(function * () {
try {
yield function * () {
thunk.stop('generator')
should('It will not run!').be.equal('')
}
} catch (e) {
should('It will not run!').be.equal('')
}
})(function () {
should('It will not run!').be.equal('')
})
})
tman.it('cancel with thunk generator', function (done) {
var count = 0
var thunk = thunks()
thunk(function * () {
yield function (cb) {
should(++count).be.equal(1)
setTimeout(cb, 100)
}
yield function (cb) {
should(++count).be.equal(2)
setTimeout(cb, 100)
}
yield function (cb) {
// should not run
should(true).be.equal(false)
setTimeout(cb, 100)
}
})(function () {
// should not run
should(true).be.equal(false)
})
thunk.delay(150)(function () {
thunk.cancel()
should(++count).be.equal(3)
})
setTimeout(function () {
should(++count).be.equal(4)
done()
}, 250)
})
tman.it('generator in thunk.persist', function (done) {
var x = {}
var thunk = thunks()
var test = thunk.persist(thunk(x))
test(function * (error, value) {
should(error).be.equal(null)
should(value).be.equal(x)
return yield test
})(function (error, value) {
should(error).be.equal(null)
should(value).be.equal(x)
})(done)
})
tman.it('not thunkable generator function', function (done) {
function * nonThunkable (a) {}
var thunk = thunks()
thunk(nonThunkable)(function (err) {
should(err).be.instanceOf(Error)
should(err.message).containEql('Not thunkable function')
should(err.message).containEql('nonThunkable')
return thunk(function * () {
yield nonThunkable
})(function (err) {
should(err).be.instanceOf(Error)
should(err.message).containEql('Not thunkable function')
should(err.message).containEql('nonThunkable')
})
})(done)
})
tman.it('extremely yield (100000)', function (done) {
this.timeout(20000) // run with istanbul will take long time.
var thunk = thunks()
thunk(function * () {
var result = 100000
var i = result
while (i--) result -= yield thunk(1)
should(result).be.equal(0)
})(done)
})
tman.it('thunks.isGeneratorFn', function () {
should(thunks.isGeneratorFn(function * () {})).be.true()
})
tman.it('thunks.isAsyncFn', function () {
should(thunks.isAsyncFn(function * () {})).be.false()
})
tman.it('thunks.isThunkableFn', function () {
should(thunks.isThunkableFn(function * () {})).be.true()
})
})
}
|
{
"pile_set_name": "Github"
}
|
<?php
/**
* @package Core
* @subpackage system
* @deprecated
*/
require_once ( __DIR__ . "/kalturaSystemAction.class.php" );
/**
* @package Core
* @subpackage system
* @deprecated
*/
class flavorParamsAction extends kalturaSystemAction
{
public function execute()
{
$this->forceSystemAuthentication();
$this->pid = $this->getRequestParameter("pid", 0);
if (!is_null($this->getRequestParameter("advanced")))
{
$this->getResponse()->setCookie('flavor-params-advanced', $this->getRequestParameter("advanced"));
$this->advanced = (int)$this->getRequestParameter("advanced");
}
else
{
$this->advanced = (int)$this->getRequest()->getCookie('flavor-params-advanced');
}
myDbHelper::$use_alternative_con = null;
$this->editFlavorParam = null;
// if ($this->getRequestParameter("id"))
{
$this->editFlavorParam = assetParamsPeer::retrieveByPK($this->getRequestParameter("id"));
if ($this->getRequestParameter("clone"))
{
$newFalvorParams = $this->editFlavorParam->copy();
$newFalvorParams->setSourceAssetParamsIds($this->editFlavorParam->getSourceAssetParamsIds());
$newFalvorParams->setChunkedEncodeMode($this->editFlavorParam->getChunkedEncodeMode());
$newFalvorParams->setAspectRatioProcessingMode($this->editFlavorParam->getAspectRatioProcessingMode());
$newFalvorParams->setForceFrameToMultiplication16($this->editFlavorParam->getForceFrameToMultiplication16());
$newFalvorParams->setIsGopInSec($this->editFlavorParam->getIsGopInSec());
$newFalvorParams->setIsAvoidVideoShrinkFramesizeToSource($this->editFlavorParam->getIsAvoidVideoShrinkFramesizeToSource());
$newFalvorParams->setIsAvoidVideoShrinkBitrateToSource($this->editFlavorParam->getIsAvoidVideoShrinkBitrateToSource());
$newFalvorParams->setIsVideoFrameRateForLowBrAppleHls($this->editFlavorParam->getIsVideoFrameRateForLowBrAppleHls());
$newFalvorParams->setIsAvoidForcedKeyFrames($this->editFlavorParam->getIsAvoidForcedKeyFrames());
$newFalvorParams->setMultiStream($this->editFlavorParam->getMultiStream());
$newFalvorParams->setAnamorphicPixels($this->editFlavorParam->getAnamorphicPixels());
$newFalvorParams->setMaxFrameRate($this->editFlavorParam->getMaxFrameRate());
$newFalvorParams->setWatermarkData($this->editFlavorParam->getWatermarkData());
$newFalvorParams->setSubtitlesData($this->editFlavorParam->getSubtitlesData());
$newFalvorParams->setIsDefault(false);
$newFalvorParams->setPartnerId(-1);
$newFalvorParams->save();
$this->redirect("system/flavorParams?pid=".$this->pid."&id=".$newFalvorParams->getId());
}
if ($this->getRequestParameter("delete"))
{
if ($this->advanced || $this->editFlavorParam->getPartnerId() != 0)
{
$this->editFlavorParam->setDeletedAt(time());
$this->editFlavorParam->save();
}
$this->redirect("system/flavorParams?pid=".$this->pid);
}
if ($this->getRequest()->getMethod() == sfRequest::POST)
{
if ($this->advanced || $this->editFlavorParam->getPartnerId() != 0)
{
$partnerId = $this->getRequestParameter("partner-id");
if ($this->advanced)
{
$this->editFlavorParam->setPartnerId($partnerId);
}
else
{
if ($partnerId != 0)
$this->editFlavorParam->setPartnerId($partnerId);
}
if ($this->advanced >= 1)
{
$this->editFlavorParam->setName($this->getRequestParameter("name"));
$this->editFlavorParam->setSystemName($this->getRequestParameter("systemName"));
$this->editFlavorParam->setDescription($this->getRequestParameter("description"));
$this->editFlavorParam->setIsDefault($this->getRequestParameter("is-default", false));
$this->editFlavorParam->setReadyBehavior($this->getRequestParameter("ready-behavior"));
$this->editFlavorParam->setTags($this->getRequestParameter("tags"));
$this->editFlavorParam->setSourceAssetParamsIds($this->getRequestParameter("sourceAssetParamsIds"));
$this->editFlavorParam->setFormat($this->getRequestParameter("format"));
$this->editFlavorParam->setTwoPass($this->getRequestParameter("two-pass", false));
$this->editFlavorParam->setChunkedEncodeMode($this->getRequestParameter("chunkedEncodeMode",0));
$this->editFlavorParam->setRotate($this->getRequestParameter("rotate", false));
$this->editFlavorParam->setAspectRatioProcessingMode($this->getRequestParameter("aspectRatioProcessingMode",0));
$this->editFlavorParam->setIsGopInSec($this->getRequestParameter("isGopInSec",0));
$this->editFlavorParam->setForceFrameToMultiplication16($this->getRequestParameter("forceFrameToMultiplication16")?"1":"0");
$this->editFlavorParam->setIsAvoidVideoShrinkFramesizeToSource($this->getRequestParameter("isAvoidVideoShrinkFramesizeToSource",0));
$this->editFlavorParam->setIsAvoidVideoShrinkBitrateToSource($this->getRequestParameter("isAvoidVideoShrinkBitrateToSource",0));
$this->editFlavorParam->setIsVideoFrameRateForLowBrAppleHls($this->getRequestParameter("isVideoFrameRateForLowBrAppleHls",0));
$this->editFlavorParam->setIsAvoidForcedKeyFrames($this->getRequestParameter("isAvoidForcedKeyFrames",0));
$this->editFlavorParam->setMultiStream($this->getRequestParameter("multiStream",0));
$this->editFlavorParam->setAnamorphicPixels($this->getRequestParameter("anamorphicPixels",0));
$this->editFlavorParam->setWidth($this->getRequestParameter("width"));
$this->editFlavorParam->setHeight($this->getRequestParameter("height"));
$this->editFlavorParam->setVideoCodec($this->getRequestParameter("video-codec"));
$this->editFlavorParam->setVideoBitrate($this->getRequestParameter("video-bitrate"));
$this->editFlavorParam->setWatermarkData($this->getRequestParameter("watermarkData",0));
$this->editFlavorParam->setSubtitlesData($this->getRequestParameter("subtitlesData",0));
$this->editFlavorParam->setFrameRate($this->getRequestParameter("frame-rate"));
$this->editFlavorParam->setMaxFrameRate($this->getRequestParameter("max-frame-rate"));
$this->editFlavorParam->setGopSize($this->getRequestParameter("gop-size"));
$this->editFlavorParam->setAudioCodec($this->getRequestParameter("audio-codec"));
$this->editFlavorParam->setAudioBitrate($this->getRequestParameter("audio-bitrate"));
$this->editFlavorParam->setAudioChannels($this->getRequestParameter("audio-channels"));
$this->editFlavorParam->setAudioSampleRate($this->getRequestParameter("audio-sample-rate"));
$this->editFlavorParam->setAudioResolution($this->getRequestParameter("audio-resolution"));
$this->editFlavorParam->setConversionEngines($this->getRequestParameter("conversion-engines"));
$this->editFlavorParam->setConversionEnginesExtraParams($this->getRequestParameter("conversion-engines-extra-params"));
$this->editFlavorParam->setOperators($this->getRequestParameter("operators"));
$this->editFlavorParam->setEngineVersion($this->getRequestParameter("engine-version"));
$this->editFlavorParam->setType($this->getRequestParameter("type"));
}
$this->editFlavorParam->save();
}
$this->redirect("system/flavorParams?pid=".$this->editFlavorParam->getPartnerId());
}
}
$c = new Criteria();
$c->add(assetParamsPeer::PARTNER_ID, array(0, intval($this->pid)), Criteria::IN);
$this->flavorParams = assetParamsPeer::doSelect($c);
$this->formats = self::getEnumValues("flavorParams", "CONTAINER_FORMAT");
$this->videoCodecs = self::getEnumValues("flavorParams", "VIDEO_CODEC");
$this->audioCodecs = self::getEnumValues("flavorParams", "AUDIO_CODEC");
$this->readyBehaviors = self::getEnumValues("flavorParamsConversionProfile", "READY_BEHAVIOR");
$this->creationModes = self::getEnumValues("flavorParams", "CREATION_MODE");
}
private function getEnumValues($peer, $prefix)
{
$reflectionClass = new ReflectionClass($peer);
$allConsts = $reflectionClass->getConstants();
$consts = array();
foreach($allConsts as $key => $value)
{
if (strpos($key, $prefix) === 0)
{
$consts[str_replace($prefix.'_', '', $key)] = $value;
}
}
return $consts;
}
static function getEnumValue($peer, $prefix, $value)
{
$reflectionClass = new ReflectionClass($peer);
$allConsts = $reflectionClass->getConstants();
foreach($allConsts as $key => $enumVal)
{
if ($enumVal == $value)
return str_replace($prefix.'_', '', $key);
}
return '';
}
}
?>
|
{
"pile_set_name": "Github"
}
|
/* Copyrignt (C) 2014 Codership Oy <[email protected]> */
#include "gcomm/protonet.hpp"
#include "gcomm/util.hpp"
#include "gcomm/conf.hpp"
#include <map>
#include <stdexcept>
static gu::Config conf;
class Client : public gcomm::Toplay
{
public:
Client(gcomm::Protonet& pnet, const std::string& uri)
:
gcomm::Toplay(conf),
uri_ (uri),
pnet_ (pnet),
pstack_(),
socket_(pnet_.socket(uri)),
msg_ ()
{
pstack_.push_proto(this);
pnet_.insert(&pstack_);
}
~Client()
{
pnet_.erase(&pstack_);
pstack_.pop_proto(this);
socket_->close();
}
void connect(bool f = false)
{
socket_->connect(uri_);
}
std::string msg() const
{
return std::string(msg_.begin(), msg_.end());
}
void handle_up(const void* id, const gcomm::Datagram& dg,
const gcomm::ProtoUpMeta& um)
{
if (um.err_no() != 0)
{
log_error << "socket failed: " << um.err_no();
socket_->close();
throw std::exception();
}
else
{
assert(id == socket_->id());
msg_.insert(msg_.begin(), gcomm::begin(dg),
gcomm::begin(dg) + gcomm::available(dg));
}
}
private:
gu::URI uri_;
gcomm::Protonet& pnet_;
gcomm::Protostack pstack_;
gcomm::SocketPtr socket_;
gu::Buffer msg_;
};
class Server : public gcomm::Toplay
{
public:
Server(gcomm::Protonet& pnet, const std::string& uri)
:
gcomm::Toplay(conf),
uri_(uri),
pnet_(pnet),
pstack_(),
listener_(),
smap_(),
msg_("hello ssl")
{
pstack_.push_proto(this);
pnet_.insert(&pstack_);
listener_ = pnet_.acceptor(uri_);
}
~Server()
{
delete listener_;
pnet_.erase(&pstack_);
pstack_.pop_proto(this);
}
void listen()
{
listener_->listen(uri_);
}
void handle_up(const void* id, const gcomm::Datagram& dg,
const gcomm::ProtoUpMeta& um)
{
if (id == listener_->id())
{
gcomm::SocketPtr socket(listener_->accept());
if (smap_.insert(
std::make_pair(socket->id(), socket)).second == false)
{
throw std::logic_error("duplicate socket entry");
}
return;
}
std::map<const void*, gcomm::SocketPtr>::iterator si(smap_.find(id));
if (si == smap_.end())
{
throw std::logic_error("could not find socket from map");
}
gcomm::SocketPtr socket(si->second);
if (socket->state() == gcomm::Socket::S_CONNECTED)
{
gcomm::Datagram msg;
msg.payload().resize(msg_.size());
std::copy(msg_.begin(), msg_.end(), msg.payload().begin());
socket->send(0, msg);
}
else if (socket->state() == gcomm::Socket::S_CLOSED ||
socket->state() == gcomm::Socket::S_FAILED)
{
std::cerr << "socket " << id << " failed" << std::endl;
socket->close();
smap_.erase(id);
}
else
{
std::cerr << "socket state: " << socket->state() << std::endl;
}
}
private:
Server(const Server&);
void operator=(const Server&);
gu::URI uri_;
gcomm::Protonet& pnet_;
gcomm::Protostack pstack_;
gcomm::Acceptor* listener_;
std::map<const void*, gcomm::SocketPtr> smap_;
const std::string msg_;
};
int main(int argc, char* argv[])
{
if (argc != 4)
{
std::cerr << "usage: " << argv[0] << " <-s|-c> <conf> <uri>"
<< std::endl;
return 1;
}
gu::Config conf;
gcomm::Conf::register_params(conf);
conf.parse(argv[2]);
std::auto_ptr<gcomm::Protonet> pnet(gcomm::Protonet::create(conf));
if (std::string("-s") == argv[1])
{
Server server(*pnet, argv[3]);
server.listen();
while (true)
{
pnet->event_loop(gu::datetime::Period(1 * gu::datetime::Sec));
}
}
else if (std::string("-c") == argv[1])
{
Client client(*pnet, argv[3]);
client.connect();
while (true)
{
pnet->event_loop(gu::datetime::Period(1*gu::datetime::MSec));
std::string msg(client.msg());
if (msg != "")
{
std::cout << "read message from server: '" << msg << "'" << std::endl;
break;
}
}
}
return 0;
}
|
{
"pile_set_name": "Github"
}
|
--
-- Created by IntelliJ IDEA.
-- User: romansztergbaum
-- Date: 17/07/2018
-- Time: 16:47
-- To change this template use File | Settings | File Templates.
--
local entities = {}
function update()
local transform = shiva.entity_registry:get_transform_2d_component(kirito_id)
if (shiva.is_key_pressed(Keyboard.D) == true) then
transform.x = transform.x + 10
end
if (shiva.is_key_pressed(Keyboard.Q) == true) then
transform.x = transform.x - 10
end
if (shiva.is_key_pressed(Keyboard.Z) == true) then
transform.y = transform.y - 10
end
if (shiva.is_key_pressed(Keyboard.S) == true) then
transform.y = transform.y + 10
end
end
function on_key_pressed(evt)
print("shift: " .. (evt.shift and 'true' or 'false'))
print("system: " .. (evt.system and 'true' or 'false'))
print("alt: " .. (evt.alt and 'true' or 'false'))
print("ctrl: " .. (evt.control and 'true' or 'false'))
if (evt.keycode == Keyboard.Escape) then
print("should quit_game")
shiva.dispatcher:trigger_quit_game_event(1)
elseif (evt.keycode == Keyboard.Right) then
shiva.dispatcher:trigger_change_scene_event("sprite_scene")
end
end
function on_key_released(evt)
end
function leave()
for key, value in pairs(entities) do
shiva.entity_registry:destroy(value)
entities[key] = nil
end
shiva.resource_registry:unload_all_resources("game_scene")
print("leaving game scene, nb entities: " .. shiva.entity_registry:nb_entities())
end
function prepare_scripted_entities()
entities[#entities + 1] = shiva.entity_registry:create_scripted_game_object("player.lua", "player_table")
end
function on_after_load_resources(evt)
prepare_scripted_entities()
--local id = shiva.anim:create_game_object_with_animated_sprite(anim_status.playing,
-- 0.12, true, 1, 1, 1, 9, "game_scene/mage_idle_dir_1")
-- local id = shiva.anim:create_game_object_with_animated_sprite(anim_status.playing,
-- 0.09, true, 1, 12, 7, 80, "game_scene/bheet_arrival")
other_id = shiva.entity_registry:create_text("Hello from game_scene", "game_scene/kenney_future", 24)
shiva.entity_registry:add_layer_1_component(other_id)
entities[#entities + 1] = other_id
kirito_id = shiva.entity_registry:create_game_object_with_sprite("game_scene/kirito", 450, 150)
local transform = shiva.entity_registry:get_transform_2d_component(kirito_id)
transform.scale_x = 0.3
transform.scale_y = 0.3
shiva.entity_registry:add_layer_1_component(kirito_id)
entities[#entities + 1] = kirito_id
print("after_loading_resources game scene, nb entities: " .. shiva.entity_registry:nb_entities())
end
function enter()
print("enter game scene")
shiva.resource_registry:load_all_resources("game_scene")
shiva.dispatcher:trigger_enable_system_event("imgui_system", system_type.post_update)
end
return {
on_key_released = on_key_released,
on_key_pressed = on_key_pressed,
on_after_load_resources = on_after_load_resources,
leave = leave,
enter = enter,
update = update,
scene_active = false
}
|
{
"pile_set_name": "Github"
}
|
G04 #@! TF.GenerationSoftware,KiCad,Pcbnew,(5.1.2-1)-1*
G04 #@! TF.CreationDate,2019-07-19T11:43:15-07:00*
G04 #@! TF.ProjectId,class v3 - programmer,636c6173-7320-4763-9320-2d2070726f67,rev?*
G04 #@! TF.SameCoordinates,Original*
G04 #@! TF.FileFunction,Profile,NP*
%FSLAX46Y46*%
G04 Gerber Fmt 4.6, Leading zero omitted, Abs format (unit mm)*
G04 Created by KiCad (PCBNEW (5.1.2-1)-1) date 2019-07-19 11:43:15*
%MOMM*%
%LPD*%
G04 APERTURE LIST*
%ADD10C,0.001000*%
G04 APERTURE END LIST*
D10*
X119290000Y-84450000D02*
X135090000Y-84450000D01*
X119290000Y-84450000D02*
X119290000Y-95950000D01*
X119290000Y-95950000D02*
X135090000Y-95950000D01*
X135090000Y-84450000D02*
X135090000Y-95950000D01*
X116240000Y-84470000D02*
X116240000Y-95970000D01*
X109190000Y-84470000D02*
X116240000Y-84470000D01*
X109190000Y-84470000D02*
X109190000Y-95970000D01*
X109190000Y-95970000D02*
X116240000Y-95970000D01*
M02*
|
{
"pile_set_name": "Github"
}
|
みなみもえ最新番号
【APKH-023】ヤリ部屋に連れ込まれた女子大生 ナンパから即挿入の常習娘!名前も知らない人のモノをズボズボ入れられ… みなみもえ
【DOKS-374】ノーカットドキュメント 指示しないオナニー
【DIV-217】グラマラスレズビアン!健康とメンタル面の向上を求めにやってきた女性客に、スタイル抜群ヨガインストラクターがキツイヨガポーズで耐える表情にS心をくすぐらせ、ヨガウェアで強調させられたエロボディに欲情し…
【GS-016】毎度毎度露出度の高いソソる恰好でやってくる美人家庭教師。授業中も密着してくるはボディタッチしまくるは超耳元で解説してくるはで、いいかげん僕も限界!どうみても誘って来てる素振りにとうとう我慢できず押し倒すも、もやしっ子の僕は完全に力負けしてあえなく撃沈!
【LIA-420】超接写!マン肉こすり付けオナニー2
【RAW-023】某有名体育大学1年 剣道部選手みなみもえ AVデビュー AV女優新世代を発掘します!</a>2015-05-22プレステージ$$$RAW133分钟
|
{
"pile_set_name": "Github"
}
|
The nation's top communications regulator said Tuesday he will resign as head of the Federal Communications Commission.
Saying he wanted to spend more time with his family and complete two books, FCC Chairman Reed Hundt said he asked President Bill Clinton to begin looking for a replacement. Hundt's term does not expire until June 30, 1998.
The new FCC chief must be cleared by the Senate. Hundt, who said he does not yet have future professional plans, will remain a voting member of the five-member FCC in the meantime.
He said he will remain as FCC chairman until a successor is installed.
"I expect that I'll be here for some time yet," Hundt, 49, told a news conference. "I don't have any plans with anybody whatsoever."
Hundt, a close ally of Vice President Al Gore, became chairman in November 1993. During his controversial 3-1/2-year tenure to date, he has presided over implementing last year's big communications law and requiring television broadcasters to air 3 hours a week of educational TV for children.
Among those considered possible successors are Susan Ness, a current FCC commissioner, and the agency's general counsel, William Kennard. Clinton nominated Kennard last Friday to fill one of two commissioner slots already vacant.
Other possible replacements include: Kathy Wallman, now a senior White House economic aide and formerly the head of the FCC's common carrier bureau; and Ralph Everett, a Washington attorney and former Senate staff member.
"Chairman Hundt has been a strong and visionary leader of the FCC during this historic period in telecommunications policy," Clinton said in a statement.
Clinton praised Hundt's "steadfast commitment to the public interest and to bringing the benefits of competition to consumers."
Hundt's departure -- and the arrival of new commissioners in coming months -- are expected to generate new uncertainties about federal communications policy.
"It could potentially be a huge change," said analyst Scott Cleland of Legg Mason Precursor, a unit of the brokerage firm Legg Mason Inc. "If it's anything like previous transitions, (FCC) chairmen can reinvent the wheel."
Hundt has moved aggressively to implement last year's communications law and pry open local phone monopolies to competition -- although a key part of that effort is embroiled in a court fight against regional Baby Bell phone companies.
Hundt also has overseen the granting of free licenses to TV stations for the introduction of high-definition digital TV and moved to open foreign markets to competition.
"He is in no small part responsible for the pro-competitive revolution in telecommunications that is sweeping the globe," said attorney Scott Harris of Gibson, Dunn & Crutcher.
But Hundt often clashed with key members of Congress and the Baby Bells, who complained that his FCC policies amounted to micro-managing of the communications industry.
"His departure is fitting and timely," said Representative W.J. "Billy" Tauzin, R-La., adding that Hundt "remains a good friend and a person I deeply respect" despite policy differences between the two.
Tauzin, the head of the powerful House Telecommunications Subcommittee, told Reuters that under the next chairman the FCC has "got to be an agency that tries to downsize itself and its influence on the industry."
Broadcasters also have criticised Hundt's policies.
But consumer advocates generally have praised Hundt's stands on issues ranging from children's TV to opening the $100 billion local phone market to competition.
|
{
"pile_set_name": "Github"
}
|
jsonschema>=2.5.1
xmltodict>=0.11.0
furl>=0.5.6
mock>=2.0.0 ; python_version < '3.3'
|
{
"pile_set_name": "Github"
}
|
<iq from="[email protected]" type="set" id="announce2">
<pubsub xmlns="http://jabber.org/protocol/pubsub">
<publish node="eu.siacs.conversations.axolotl.bundles:31415">
<item id="current">
<bundle xmlns="eu.siacs.conversations.axolotl">
<identityKey>QkFTRTY0IEVOQ09ERUQ=</identityKey>
<prekeys>
<preKeyPublic preKeyId="1">QkFTRTY0IEVOQ09ERUQ=</preKeyPublic>
<preKeyPublic preKeyId="2">QkFTRTY0IEVOQ09ERUQ=</preKeyPublic>
<preKeyPublic preKeyId="3">QkFTRTY0IEVOQ09ERUQ=</preKeyPublic>
</prekeys>
<signedPreKeySignature>QkFTRTY0IEVOQ09ERUQ=</signedPreKeySignature>
<signedPreKeyPublic signedPreKeyId="1">QkFTRTY0IEVOQ09ERUQ=</signedPreKeyPublic>
</bundle>
</item>
</publish>
</pubsub>
</iq>
|
{
"pile_set_name": "Github"
}
|
<!-- saved from url=(0063)https://pdos.csail.mit.edu/6.828/2018/homework/xv6-uthread.html -->
<html><head><meta http-equiv="Content-Type" content="text/html; charset=windows-1252">
<title>Homework: User-level threads</title>
<link rel="stylesheet" href="./Lec-10-Homework-User-level-threads_files/homework.css" type="text/css">
</head>
<body>
<h1>Homework: User-level threads</h1>
<p>In this assignment you will complete a simple user-level thread package by
implementing the code to perform context switching between threads. Submit
your solutions before the beginning of the next lecture to <a href="https://6828.scripts.mit.edu/2018/handin.py/">the submission web site</a>.
</p><h2>Switching threads</h2>
<p>Download <a href="https://pdos.csail.mit.edu/6.828/2018/homework/uthread.c">uthread.c</a> and <a href="https://pdos.csail.mit.edu/6.828/2018/homework/uthread_switch.S">uthread_switch.S</a> into your xv6 directory.
Make sure <tt>uthread_switch.S</tt> ends with <tt>.S</tt>, not
<tt>.s</tt>. Add the
following rule to the xv6 Makefile after the _forktest rule:
</p><pre>_uthread: uthread.o uthread_switch.o
$(LD) $(LDFLAGS) -N -e main -Ttext 0 -o _uthread uthread.o uthread_switch.o $(ULIB)
$(OBJDUMP) -S _uthread > uthread.asm
</pre>
Make sure that the blank space at the start of each line is a tab,
not spaces.
<p>
Add <tt>_uthread</tt> in the Makefile to the list of user programs defined by UPROGS.
</p><p>Run xv6, then run <tt>uthread</tt> from the xv6 shell. The xv6 kernel will print an error message about <tt>uthread</tt> encountering a page fault.
</p><p>Your job is to complete <tt>thread_switch.S</tt>, so that you see output similar to
this (make sure to run with CPUS=1):
</p><pre>~/classes/6828/xv6$ make CPUS=1 qemu-nox
dd if=/dev/zero of=xv6.img count=10000
10000+0 records in
10000+0 records out
5120000 bytes (5.1 MB, 4.9 MiB) copied, 0.0190287 s, 269 MB/s
dd if=bootblock of=xv6.img conv=notrunc
1+0 records in
1+0 records out
512 bytes copied, 7.2168e-05 s, 7.1 MB/s
dd if=kernel of=xv6.img seek=1 conv=notrunc
291+1 records in
291+1 records out
149040 bytes (149 kB, 146 KiB) copied, 0.000528827 s, 282 MB/s
qemu-system-i386 -nographic -drive file=fs.img,index=1,media=disk,format=raw -drive file=xv6.img,index=0,media=disk,format=raw -smp 1 -m 512
xv6...
cpu0: starting
sb: size 1000 nblocks 941 ninodes 200 nlog 30 logstart 2 inodestart 32 bmap start 58
init: starting sh
$ uthread
my thread running
my thread 0x2D68
my thread running
my thread 0x4D70
my thread 0x2D68
my thread 0x4D70
my thread 0x2D68
my thread 0x4D70
my thread 0x2D68
...
</pre>
<p><tt>uthread</tt> creates two threads and switches back and forth between
them. Each thread prints "my thread ..." and then yields to give the other
thread a chance to run.
</p><p>To observe the above output, you need to complete <tt>thread_switch.S</tt>, but before
jumping into <tt>uthread_switch.S</tt>, first understand how <tt>uthread.c</tt>
uses <tt>thread_switch</tt>. <tt>uthread.c</tt> has two global variables
<tt>current_thread</tt> and <tt>next_thread</tt>. Each is a pointer to a
<tt>thread</tt> structure. The thread structure has a stack for a thread and a
saved stack pointer (<tt>sp</tt>, which points into the thread's stack). The
job of <tt>uthread_switch</tt> is to save the current thread state into the
structure pointed to by <tt>current_thread</tt>, restore <tt>next_thread</tt>'s
state, and make <tt>current_thread</tt> point to where <tt>next_thread</tt> was
pointing to, so that when <tt>uthread_switch</tt> returns <tt>next_thread</tt>
is running and is the <tt>current_thread</tt>.
</p><p>You should study <tt>thread_create</tt>, which sets up the initial stack for
a new thread. It provides hints about what <tt>thread_switch</tt> should do.
The intent is that
<tt>thread_switch</tt> use the assembly instructions <tt>popal</tt> and
<tt>pushal</tt> to restore and save all eight x86 registers.
Note that <tt>thread_create</tt> simulates eight pushed registers (32 bytes)
on a new thread's stack.
</p><p>To write the assembly in <tt>thread_switch</tt>, you need to know how the C
compiler lays out <tt>struct thread</tt> in memory, which is as
follows:
</p><pre> --------------------
| 4 bytes for state|
--------------------
| stack size bytes |
| for stack |
--------------------
| 4 bytes for sp |
-------------------- <--- current_thread
......
......
--------------------
| 4 bytes for state|
--------------------
| stack size bytes |
| for stack |
--------------------
| 4 bytes for sp |
-------------------- <--- next_thread
</pre>
The variables <tt>next_thread</tt> and <tt>current_thread</tt> each contain the
address of a <tt>struct thread</tt>.
<p>
To write the <tt>sp</tt> field of the struct that <tt>current_thread</tt>
points to, you should write assembly like this:
</p><pre> movl current_thread, %eax
movl %esp, (%eax)
</pre>
This saves <tt>%esp</tt> in <tt>current_thread->sp</tt>. This works because
<tt>sp</tt> is at
offset 0 in the struct.
You can study the assembly the compiler generates for
<tt>uthread.c</tt> by looking at <tt>uthread.asm</tt>.
<p>To test your code it might be helpful to single step through your
<tt>thread_switch</tt> using <tt>gdb</tt>. You can get started
in this way:
</p><pre>(gdb) symbol-file _uthread
Load new symbol table from "/Users/kaashoek/classes/6828/xv6/_uthread"? (y or n) y
Reading symbols from /Users/kaashoek/classes/6828/xv6/_uthread...done.
(gdb) b thread_switch
Breakpoint 1 at 0x204: file uthread_switch.S, line 9.
(gdb)
</pre>
<p>The breakpoint may (or may not) be triggered before you even run
<tt>uthread</tt>. How could that happen?
</p><p>Once your xv6 shell runs, type "uthread", and gdb will break at
<tt>thread_switch</tt>. Now you can type commands like the following to inspect
the state of <tt>uthread</tt>:
</p><pre>(gdb) p/x next_thread->sp
$4 = 0x4ae8
(gdb) x/9x next_thread->sp
0x4ae8 <all_thread+16360>: 0x00000000 0x00000000 0x00000000 0x00000000
0x4af8 <all_thread+16376>: 0x00000000 0x00000000 0x00000000 0x00000000
0x4b08 <all_thread+16392>: 0x000000d8
</all_thread+16392></all_thread+16376></all_thread+16360></pre>
What address is <tt>0xd8</tt>, which sits on the top of the stack of <tt>next_thread</tt>?
<div class="question">
<p><b>Submit</b>: your modified uthread_switch.S
</p></div>
<h2>Optional challenges</h2>
<p>The user-level thread package interacts badly with the operating system in
several ways. For example, if one user-level thread blocks in a system call,
another user-level thread won't run, because the user-level threads scheduler
doesn't know that one of its threads has been descheduled by the xv6 scheduler. As
another example, two user-level threads will not run concurrently on different
cores, because the xv6 scheduler isn't aware that there are multiple
threads that could run in parallel. Note that if two user-level threads were to
run truly in parallel, this implementation won't work because of several races
(e.g., two threads on different processors could call <tt>thread_schedule</tt>
concurrently, select the same runnable thread, and both run it on different
processors.)
</p><p>There are several ways of addressing these problems. One is using <a href="http://en.wikipedia.org/wiki/Scheduler_activations">scheduler
activations</a> and another is to use one kernel thread per user-level thread
(as Linux kernels do). Implement one of these ways in xv6.
</p><p>Add locks, condition variables, barriers, etc. to your thread package.
</p></body></html>
|
{
"pile_set_name": "Github"
}
|
// Copyright 2012 Joyent, Inc. All rights reserved.
var assert = require('assert-plus');
var sshpk = require('sshpk');
var util = require('util');
var HASH_ALGOS = {
'sha1': true,
'sha256': true,
'sha512': true
};
var PK_ALGOS = {
'rsa': true,
'dsa': true,
'ecdsa': true
};
function HttpSignatureError(message, caller) {
if (Error.captureStackTrace)
Error.captureStackTrace(this, caller || HttpSignatureError);
this.message = message;
this.name = caller.name;
}
util.inherits(HttpSignatureError, Error);
function InvalidAlgorithmError(message) {
HttpSignatureError.call(this, message, InvalidAlgorithmError);
}
util.inherits(InvalidAlgorithmError, HttpSignatureError);
function validateAlgorithm(algorithm) {
var alg = algorithm.toLowerCase().split('-');
if (alg.length !== 2) {
throw (new InvalidAlgorithmError(alg[0].toUpperCase() + ' is not a ' +
'valid algorithm'));
}
if (alg[0] !== 'hmac' && !PK_ALGOS[alg[0]]) {
throw (new InvalidAlgorithmError(alg[0].toUpperCase() + ' type keys ' +
'are not supported'));
}
if (!HASH_ALGOS[alg[1]]) {
throw (new InvalidAlgorithmError(alg[1].toUpperCase() + ' is not a ' +
'supported hash algorithm'));
}
return (alg);
}
///--- API
module.exports = {
HASH_ALGOS: HASH_ALGOS,
PK_ALGOS: PK_ALGOS,
HttpSignatureError: HttpSignatureError,
InvalidAlgorithmError: InvalidAlgorithmError,
validateAlgorithm: validateAlgorithm,
/**
* Converts an OpenSSH public key (rsa only) to a PKCS#8 PEM file.
*
* The intent of this module is to interoperate with OpenSSL only,
* specifically the node crypto module's `verify` method.
*
* @param {String} key an OpenSSH public key.
* @return {String} PEM encoded form of the RSA public key.
* @throws {TypeError} on bad input.
* @throws {Error} on invalid ssh key formatted data.
*/
sshKeyToPEM: function sshKeyToPEM(key) {
assert.string(key, 'ssh_key');
var k = sshpk.parseKey(key, 'ssh');
return (k.toString('pem'));
},
/**
* Generates an OpenSSH fingerprint from an ssh public key.
*
* @param {String} key an OpenSSH public key.
* @return {String} key fingerprint.
* @throws {TypeError} on bad input.
* @throws {Error} if what you passed doesn't look like an ssh public key.
*/
fingerprint: function fingerprint(key) {
assert.string(key, 'ssh_key');
var k = sshpk.parseKey(key, 'ssh');
return (k.fingerprint('md5').toString('hex'));
},
/**
* Converts a PKGCS#8 PEM file to an OpenSSH public key (rsa)
*
* The reverse of the above function.
*/
pemToRsaSSHKey: function pemToRsaSSHKey(pem, comment) {
assert.equal('string', typeof (pem), 'typeof pem');
var k = sshpk.parseKey(pem, 'pem');
k.comment = comment;
return (k.toString('ssh'));
}
};
|
{
"pile_set_name": "Github"
}
|
[android-components](../../index.md) / [mozilla.components.concept.engine.webnotifications](../index.md) / [WebNotificationDelegate](index.md) / [onShowNotification](./on-show-notification.md)
# onShowNotification
`open fun onShowNotification(webNotification: `[`WebNotification`](../-web-notification/index.md)`): `[`Unit`](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-unit/index.html) [(source)](https://github.com/mozilla-mobile/android-components/blob/master/components/concept/engine/src/main/java/mozilla/components/concept/engine/webnotifications/WebNotificationDelegate.kt#L17)
Invoked when a web notification is to be shown.
### Parameters
`webNotification` - The web notification intended to be shown.
|
{
"pile_set_name": "Github"
}
|
<!DOCTYPE html>
<html>
<head>
<style>
span.b { display: inline-block; height: 20px; }
span.break::before { content: "\A"; white-space: pre-wrap; }
</style>
</head>
<body>
<span style="background: url(blue-16x20-green-16x20.png)">
<span class="b" style="width: 8px"></span><span class="break"></span>
<span class="b" style="width: 24px"></span>
</span>
</body>
</html>
|
{
"pile_set_name": "Github"
}
|
{
"name": "crazy attribute",
"options": {
"handler": {},
"parser": {}
},
"html": "<p <='' FAIL>stuff</p>",
"expected": [
{
"event": "opentagname",
"data": [
"p"
]
},
{
"event": "attribute",
"data": [
"<",
""
]
},
{
"event": "attribute",
"data": [
"fail",
""
]
},
{
"event": "opentag",
"data": [
"p",
{
"<": "",
"fail": ""
}
]
},
{
"event": "text",
"data": [
"stuff"
]
},
{
"event": "closetag",
"data": [
"p"
]
}
]
}
|
{
"pile_set_name": "Github"
}
|
{
"name": "@bbc/psammead-bulleted-list",
"version": "1.0.17",
"main": "dist/index.js",
"module": "esm/index.js",
"sideEffects": false,
"description": "React styled component for ordered and unordered lists",
"repository": {
"type": "git",
"url": "https://github.com/BBC-News/psammead/tree/latest/packages/components/psammead-bulleted-list"
},
"author": {
"name": "Psammead Maintainers",
"email": "[email protected]"
},
"license": "Apache-2.0",
"bugs": {
"url": "https://github.com/bbc/psammead/issues"
},
"homepage": "https://github.com/BBC-News/psammead/blob/latest/packages/components/psammead-bulleted-list/README.md",
"dependencies": {
"@bbc/gel-foundations": "^4.3.0",
"@bbc/psammead-styles": "^4.4.3"
},
"peerDependencies": {
"styled-components": "^4.3.2",
"react-dom": "^16.12.0"
}
}
|
{
"pile_set_name": "Github"
}
|
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.