text
stringlengths
2
9.79k
meta
dict
sentences_perturbed
int64
0
2
doc_stats
dict
// https://github.com/lightbend/mima/issues/422 resolvers += Resolver.url( "typesafe sbt-plugins", url("https://dl.bintray.com/typesafe/sbt-plugins") )(Resolver.ivyStylePatterns)
{ "pile_set_name": "Github" }
null
null
// Copyright 2009 The 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 darwin dragonfly freebsd linux netbsd openbsd solaris package syscall import ( "internal/race" "runtime" "sync" "unsafe" ) var ( Stdin = 0 Stdout = 1 Stderr = 2 ) const ( darwin64Bit = runtime.GOOS == "darwin" && sizeofPtr == 8 dragonfly64Bit = runtime.GOOS == "dragonfly" && sizeofPtr == 8 netbsd32Bit = runtime.GOOS == "netbsd" && sizeofPtr == 4 solaris64Bit = runtime.GOOS == "solaris" && sizeofPtr == 8 ) func Syscall(trap, a1, a2, a3 uintptr) (r1, r2 uintptr, err Errno) func Syscall6(trap, a1, a2, a3, a4, a5, a6 uintptr) (r1, r2 uintptr, err Errno) func RawSyscall(trap, a1, a2, a3 uintptr) (r1, r2 uintptr, err Errno) func RawSyscall6(trap, a1, a2, a3, a4, a5, a6 uintptr) (r1, r2 uintptr, err Errno) // Mmap manager, for use by operating system-specific implementations. type mmapper struct { sync.Mutex active map[*byte][]byte // active mappings; key is last byte in mapping mmap func(addr, length uintptr, prot, flags, fd int, offset int64) (uintptr, error) munmap func(addr uintptr, length uintptr) error } func (m *mmapper) Mmap(fd int, offset int64, length int, prot int, flags int) (data []byte, err error) { if length <= 0 { return nil, EINVAL } // Map the requested memory. addr, errno := m.mmap(0, uintptr(length), prot, flags, fd, offset) if errno != nil { return nil, errno } // Slice memory layout var sl = struct { addr uintptr len int cap int }{addr, length, length} // Use unsafe to turn sl into a []byte. b := *(*[]byte)(unsafe.Pointer(&sl)) // Register mapping in m and return it. p := &b[cap(b)-1] m.Lock() defer m.Unlock() m.active[p] = b return b, nil } func (m *mmapper) Munmap(data []byte) (err error) { if len(data) == 0 || len(data) != cap(data) { return EINVAL } // Find the base of the mapping. p := &data[cap(data)-1] m.Lock() defer m.Unlock() b := m.active[p] if b == nil || &b[0] != &data[0] { return EINVAL } // Unmap the memory and update m. if errno := m.munmap(uintptr(unsafe.Pointer(&b[0])), uintptr(len(b))); errno != nil { return errno } delete(m.active, p) return nil } // An Errno is an unsigned number describing an error condition. // It implements the error interface. The zero Errno is by convention // a non-error, so code to convert from Errno to error should use: // err = nil // if errno != 0 { // err = errno // } type Errno uintptr func (e Errno) Error() string { if 0 <= int(e) && int(e) < len(errors) { s := errors[e] if s != "" { return s } } return "errno " + itoa(int(e)) } func (e Errno) Temporary() bool { return e == EINTR || e == EMFILE || e == ECONNRESET || e == ECONNABORTED || e.Timeout() } func (e Errno) Timeout() bool { return e == EAGAIN || e == EWOULDBLOCK || e == ETIMEDOUT } // Do the interface allocations only once for common // Errno values. var ( errEAGAIN error = EAGAIN errEINVAL error = EINVAL errENOENT error = ENOENT ) // errnoErr returns common boxed Errno values, to prevent // allocations at runtime. func errnoErr(e Errno) error { switch e { case 0: return nil case EAGAIN: return errEAGAIN case EINVAL: return errEINVAL case ENOENT: return errENOENT } return e } // A Signal is a number describing a process signal. // It implements the os.Signal interface. type Signal int func (s Signal) Signal() {} func (s Signal) String() string { if 0 <= s && int(s) < len(signals) { str := signals[s] if str != "" { return str } } return "signal " + itoa(int(s)) } func Read(fd int, p []byte) (n int, err error) { n, err = read(fd, p) if race.Enabled { if n > 0 { race.WriteRange(unsafe.Pointer(&p[0]), n) } if err == nil { race.Acquire(unsafe.Pointer(&ioSync)) } } if msanenabled && n > 0 { msanWrite(unsafe.Pointer(&p[0]), n) } return } func Write(fd int, p []byte) (n int, err error) { if race.Enabled { race.ReleaseMerge(unsafe.Pointer(&ioSync)) } n, err = write(fd, p) if race.Enabled && n > 0 { race.ReadRange(unsafe.Pointer(&p[0]), n) } if msanenabled && n > 0 { msanRead(unsafe.Pointer(&p[0]), n) } return } // For testing: clients can set this flag to force // creation of IPv6 sockets to return EAFNOSUPPORT. var SocketDisableIPv6 bool type Sockaddr interface { sockaddr() (ptr unsafe.Pointer, len _Socklen, err error) // lowercase; only we can define Sockaddrs } type SockaddrInet4 struct { Port int Addr [4]byte raw RawSockaddrInet4 } type SockaddrInet6 struct { Port int ZoneId uint32 Addr [16]byte raw RawSockaddrInet6 } type SockaddrUnix struct { Name string raw RawSockaddrUnix } func Bind(fd int, sa Sockaddr) (err error) { ptr, n, err := sa.sockaddr() if err != nil { return err } return bind(fd, ptr, n) } func Connect(fd int, sa Sockaddr) (err error) { ptr, n, err := sa.sockaddr() if err != nil { return err } return connect(fd, ptr, n) } func Getpeername(fd int) (sa Sockaddr, err error) { var rsa RawSockaddrAny var len _Socklen = SizeofSockaddrAny if err = getpeername(fd, &rsa, &len); err != nil { return } return anyToSockaddr(&rsa) } func GetsockoptInt(fd, level, opt int) (value int, err error) { var n int32 vallen := _Socklen(4) err = getsockopt(fd, level, opt, unsafe.Pointer(&n), &vallen) return int(n), err } func Recv
{ "pile_set_name": "Github" }
null
null
include_directories ("${CMAKE_CURRENT_SOURCE_DIR}") include_directories ("${CMAKE_CURRENT_BINARY_DIR}") set (FUSIONDALE_ONE_LIBS pthread dl rt direct fusion fusiondale one ) DEFINE_DIRECTFB_MODULE (ifusiondale_one ifusiondale_one ifusiondale_one.c "${FUSIONDALE_ONE_LIBS}" ${INTERFACES_DIR}/IFusionDale ) DEFINE_DIRECTFB_MODULE (ifusiondalemessenger_one ifusiondalemessenger_one ifusiondalemessenger_one.c "${FUSIONDALE_ONE_LIBS}" ${INTERFACES_DIR}/IFusionDaleMessenger ) DEFINE_DIRECTFB_MODULE (icoma_one icoma_one icoma_one.c "${FUSIONDALE_ONE_LIBS}" ${INTERFACES_DIR}/IComa ) DEFINE_DIRECTFB_MODULE (icomacomponent_one icomacomponent_one icomacomponent_one.c "${FUSIONDALE_ONE_LIBS}" ${INTERFACES_DIR}/IComaComponent )
{ "pile_set_name": "Github" }
null
null
/** * The MIT License * Copyright (c) 2014-2016 Ilkka Seppälä * * 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.iluwatar.servicelayer.common; import java.util.List; /** * * Dao interface. * * @param <E> * */ public interface Dao<E extends BaseEntity> { E find(Long id); void persist(E entity); E merge(E entity); void delete(E entity); List<E> findAll(); }
{ "pile_set_name": "Github" }
null
null
# frozen_string_literal: true require 'spec_helper' describe Overcommit::Hook::PreCommit::HtmlHint do let(:config) { Overcommit::ConfigurationLoader.default_configuration } let(:context) { double('context') } subject { described_class.new(config, context) } before do subject.stub(:applicable_files).and_return(%w[file1.html file2.html]) end context 'when htmlhint exits successfully' do let(:result) { double('result') } before do subject.stub(:execute).and_return(result) end context 'with no errors' do before do result.stub(:stdout).and_return('') end it { should pass } end context 'and it reports an error' do before do result.stub(:stdout).and_return([ 'file1.html:', "\tline 355, col 520: \e[31mId redefinition of [ stats ].\e[39m", '', '', '1 problem.' ].join("\n")) end it { should fail_hook } end end end
{ "pile_set_name": "Github" }
null
null
[preset00] fRating=1 fGammaAdj=2 fDecay=0.99 fVideoEchoZoom=2 fVideoEchoAlpha=0 nVideoEchoOrientation=0 nWaveMode=2 bAdditiveWaves=0 bWaveDots=0 bWaveThick=0 bModWaveAlphaByVolume=1 bMaximizeWaveColor=0 bTexWrap=1 bDarkenCenter=0 bRedBlueStereo=0 bBrighten=0 bDarken=0 bSolarize=0 bInvert=0 fWaveAlpha=2.426125 fWaveScale=1.8817 fWaveSmoothing=0.9 fWaveParam=0 fModWaveAlphaStart=0.75 fModWaveAlphaEnd=0.95 fWarpAnimSpeed=1 fWarpScale=1 fZoomExponent=1 fShader=0 zoom=1.02 rot=0 cx=0.5 cy=0.5 dx=0 dy=0 warp=0.076 sx=1 sy=1 wave_r=0.65 wave_g=0.15 wave_b=0.35 wave_x=0.5 wave_y=0.5 ob_size=0.01 ob_r=0 ob_g=0 ob_b=0 ob_a=0 ib_size=0.01 ib_r=0.25 ib_g=0.25 ib_b=0.25 ib_a=0 nMotionVectorsX=12 nMotionVectorsY=9 mv_dx=0 mv_dy=0 mv_l=0.9 mv_r=1 mv_g=1 mv_b=1 mv_a=0 per_frame_1=wave_r = wave_r + 1.000*( 0.60*sin(1.517*time) + 0.40*sin(1.580*time) ); per_frame_2=wave_g = wave_g + 1.000*( 0.60*sin(1.088*time) + 0.40*sin(1.076*time) ); per_frame_3=wave_b = wave_b + 1.000*( 0.60*sin(1.037*time) + 0.40*sin(0.922*time) ); per_frame_4=rot = rot + 0.040*( 0.60*sin(0.381*time) + 0.40*sin(0.579*time) ); per_frame_5=cx = cx + 0.110*( 0.60*sin(0.374*time) + 0.40*sin(0.294*time) ); per_frame_6=cy = cy + 0.110*( 0.60*sin(0.393*time) + 0.40*sin(0.223*time) ); per_frame_7=q1=cos(1.41*time); per_frame_8=q2=time + 0.3*sin(time*1.47); per_pixel_1=rot=rot+0.05*sin(rad*13.5 + q2*1.3 + q*1.31); per_pixel_2=zoom=zoom+0.05*sin(ang*10.0 + rad*7.5 + q2*1.63 + q);
{ "pile_set_name": "Github" }
null
null
--- title: Master.DrawRectangle Method (Visio) keywords: vis_sdr.chm10716220 f1_keywords: - vis_sdr.chm10716220 ms.prod: visio api_name: - Visio.Master.DrawRectangle ms.assetid: e41ec411-ccd7-0fe6-f560-cf3934d18b59 ms.date: 06/08/2017 --- # Master.DrawRectangle Method (Visio) Adds a rectangle to the **Shapes** collection of a page, master, or group. ## Syntax _expression_ . **DrawRectangle**( **_x1_** , **_y1_** , **_x2_** , **_y2_** ) _expression_ A variable that represents a **Master** object. ### Parameters |**Name**|**Required/Optional**|**Data Type**|**Description**| |:-----|:-----|:-----|:-----| | _x1_|Required| **Double**|The _x_-coordinate of one corner of the rectangle's width-height box.| | _y1_|Required| **Double**|The _y_-coordinate of one corner of the rectangle's width-height box.| | _x2_|Required| **Double**|The _x_-coordinate of the other corner of the rectangle's width-height box.| | _y2_|Required| **Double**|The _y_-coordinate of the other corner of the rectangle's width-height box.| ### Return Value Shape ## Remarks Using the **DrawRectangle** method is equivalent to using the **Rectangle** tool in the application. The arguments are in internal drawing units with respect to the coordinate space of the page, master, or group where the rectangle is being placed. ## Example The following example shows how to draw a rectangle on the active page. ```vb Public Sub DrawRectangle_Example() Dim vsoShape As Visio.Shape Set vsoShape = ActivePage.DrawRectangle(1, 4, 4, 1) End Sub ```
{ "pile_set_name": "Github" }
null
null
/* * Copyright Andrey Semashev 2007 - 2015. * 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) */ /*! * \file keywords/depth.hpp * \author Andrey Semashev * \date 14.03.2009 * * The header contains the \c depth keyword declaration. */ #ifndef BOOST_LOG_KEYWORDS_DEPTH_HPP_INCLUDED_ #define BOOST_LOG_KEYWORDS_DEPTH_HPP_INCLUDED_ #include <boost/parameter/keyword.hpp> #include <boost/log/detail/config.hpp> #ifdef BOOST_HAS_PRAGMA_ONCE #pragma once #endif namespace boost { BOOST_LOG_OPEN_NAMESPACE namespace keywords { //! The keyword for passing maximum scopes depth to the \c named_scope formatter BOOST_PARAMETER_KEYWORD(tag, depth) } // namespace keywords BOOST_LOG_CLOSE_NAMESPACE // namespace log } // namespace boost #endif // BOOST_LOG_KEYWORDS_DEPTH_HPP_INCLUDED_
{ "pile_set_name": "Github" }
null
null
<?php /** * Tabs * * PHP version 5 * * @category Class * @package DocuSign\eSign * @author Swaagger Codegen team * @link https://github.com/swagger-api/swagger-codegen */ /** * DocuSign REST API * * The DocuSign REST API provides you with a powerful, convenient, and simple Web services API for interacting with DocuSign. * * OpenAPI spec version: v2.1 * Contact: devcenter@docusign.com * Generated by: https://github.com/swagger-api/swagger-codegen.git * Swagger Codegen version: 2.4.13-SNAPSHOT */ /** * NOTE: This class is auto generated by the swagger code generator program. * https://github.com/swagger-api/swagger-codegen * Do not edit the class manually. */ namespace DocuSign\eSign\Model; use \ArrayAccess; use \DocuSign\eSign\ObjectSerializer; /** * Tabs Class Doc Comment * * @category Class * @package DocuSign\eSign * @author Swagger Codegen team * @link https://github.com/swagger-api/swagger-codegen */ class Tabs implements ModelInterface, ArrayAccess { const DISCRIMINATOR = null; /** * The original name of the model. * * @var string */ protected static $swaggerModelName = 'tabs'; /** * Array of property to type mappings. Used for (de)serialization * * @var string[] */ protected static $swaggerTypes = [ 'approve_tabs' => '\DocuSign\eSign\Model\Approve[]', 'checkbox_tabs' => '\DocuSign\eSign\Model\Checkbox[]', 'comment_thread_tabs' => '\DocuSign\eSign\Model\CommentThread[]', 'company_tabs' => '\DocuSign\eSign\Model\Company[]', 'date_signed_tabs' => '\DocuSign\eSign\Model\DateSigned[]', 'date_tabs' => '\DocuSign\eSign\Model\\Date[]', 'decline_tabs' => '\DocuSign\eSign\Model\Decline[]', 'draw_tabs' => '\DocuSign\eSign\Model\Draw[]', 'email_address_tabs' => '\DocuSign\eSign\Model\EmailAddress[]', 'email_tabs' => '\DocuSign\eSign\Model\Email[]', 'envelope_id_tabs' => '\DocuSign\eSign\Model\EnvelopeId[]', 'first_name_tabs' => '\DocuSign\eSign\Model\FirstName[]', 'formula_tabs' => '\DocuSign\eSign\Model\FormulaTab[]', 'full_name_tabs' => '\DocuSign\eSign\Model\FullName[]', 'initial_here_tabs' => '\DocuSign\eSign\Model\InitialHere[]', 'last_name_tabs' => '\DocuSign\eSign\Model\LastName[]', 'list_tabs' => '\DocuSign\eSign\Model\array[]', 'notarize_tabs' => '\DocuSign\eSign\Model\Notarize[]', 'notary_certificate_tabs' => '\DocuSign\eSign\Model\NotaryCertificate[]', 'notary_seal_tabs' => '\DocuSign\eSign\Model\NotarySeal[]', 'note_tabs' => '\DocuSign\eSign\Model\Note[]', 'number_tabs' => '\DocuSign\eSign\Model\Number[]', 'poly_line_overlay_tabs' => '\DocuSign\eSign\Model\PolyLineOverlay[]', 'radio_group_tabs' => '\DocuSign\eSign\Model\RadioGroup[]', 'signer_attachment_tabs' => '\DocuSign\eSign\Model\SignerAttachment[]', 'sign_here_tabs' => '\DocuSign\eSign\Model\SignHere[]', 'smart_section_tabs' => '\DocuSign\eSign\Model\SmartSection[]', 'ssn_tabs' => '\DocuSign\eSign\Model\Ssn[]', 'tab_groups' => '\DocuSign\eSign\Model\TabGroup[]', 'text_tabs' => '\DocuSign\eSign\Model\Text[]', 'title_tabs' => '\DocuSign\eSign\Model\Title[]', 'view_tabs' => '\DocuSign\eSign\Model\View[]', 'zip_tabs' => '\DocuSign\eSign\Model\Zip[]' ]; /** * Array of property to format mappings. Used for (de)serialization * * @var string[] */ protected static $swaggerFormats = [ 'approve_tabs' => null, 'checkbox_tabs' => null, 'comment_thread_tabs' => null, 'company_tabs' => null, 'date_signed_tabs' => null, 'date_tabs' => null, 'decline_tabs' => null, 'draw_tabs' => null, 'email_address_tabs' => null, 'email_tabs' => null, 'envelope_id_tabs' => null, 'first_name_tabs' => null, 'formula_tabs' => null, 'full_name_tabs' => null, 'initial_here_tabs' => null, 'last_name_tabs' => null, 'list_tabs' => null, 'notarize_tabs' => null, 'notary_certificate_tabs' => null, 'notary_seal_tabs' => null, 'note_tabs' => null, 'number_tabs' => null, 'poly_line_overlay_tabs' => null, 'radio_group_tabs' => null, 'signer_attachment_tabs' => null, 'sign_here_tabs' => null, 'smart_section_tabs' => null, 'ssn_tabs' => null, 'tab_groups' => null, 'text_tabs' => null, 'title_tabs' => null, 'view_tabs' => null, 'zip_tabs' => null ]; /** * Array of property to type mappings. Used for (de)serialization * * @return array */ public static function swaggerTypes() { return self::$swaggerTypes; } /** * Array of property to format mappings. Used for (de)serialization * * @return array */ public static function swaggerFormats() { return self::$swaggerFormats; } /** * Array of attributes where the key is the local name, * and the value is the original name * * @var string[] */ protected static $attributeMap = [ 'approve_tabs' => 'approveTabs', 'checkbox_tabs' => 'checkboxTabs', 'comment_thread_tabs' => 'commentThreadTabs', 'company_tabs' => 'companyTabs', 'date_signed_tabs' => 'dateSignedTabs', 'date_tabs' => 'dateTabs', 'decline_tabs' => 'declineTabs', 'draw_tabs' => 'drawTabs', 'email_address_tabs' => 'emailAddressTabs', 'email_tabs' => 'emailTabs', 'envelope_id_tabs' => 'envelopeIdTabs', 'first_name_tabs' => 'firstNameTabs', 'formula_tabs' => 'formulaTabs', 'full_name_tabs' => 'fullNameTabs', 'initial_here_tabs' => 'initialHereTabs', 'last_name_tabs' => 'lastNameTabs', 'list_tabs' => 'listTabs', 'notarize_tabs' => 'notarizeTabs', 'not
{ "pile_set_name": "Github" }
null
null
/* This project 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. Deviation 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 Deviation. If not, see <http://www.gnu.org/licenses/>. */ #include "common.h" #include "target/drivers/mcu/stm32/spi.h" void MMC_Init() { rcc_periph_clock_enable(get_rcc_from_pin(MMC_SPI.csn)); GPIO_setup_output(MMC_SPI.csn, OTYPE_PUSHPULL); GPIO_pin_set(MMC_SPI.csn); if (HAS_PIN(MMC_PRESENT)) { rcc_periph_clock_enable(get_rcc_from_pin(MMC_PRESENT)); GPIO_setup_input(MMC_PRESENT, ITYPE_PULLUP); } if (HAS_PIN(MMC_PROTECT)) { rcc_periph_clock_enable(get_rcc_from_pin(MMC_PROTECT)); GPIO_setup_input(MMC_PROTECT, ITYPE_PULLUP); } _spi_init(MMC_SPI_CFG); rcc_periph_clock_enable(get_rcc_from_port(MMC_RX_DMA.dma)); }
{ "pile_set_name": "Github" }
null
null
ALTER TABLE STORE_INFO ADD COLUMN STATUS VARCHAR(50);
{ "pile_set_name": "Github" }
null
null
#import "GeneratedPluginRegistrant.h"
{ "pile_set_name": "Github" }
null
null
package Moose::Exception::RoleNameRequired; our $VERSION = '2.2014'; use Moose; extends 'Moose::Exception'; with 'Moose::Exception::Role::Class'; sub _build_message { "You must supply a role name to look for"; } __PACKAGE__->meta->make_immutable; 1;
{ "pile_set_name": "Github" }
null
null
""" A module containing volatile, experimental and legacy code. """ from . import layers from . import models
{ "pile_set_name": "Github" }
null
null
/* * edge_se3Switchable.cpp * * Created on: 17.10.2011 * Author: niko * * Updated on: 14.01.2013 * Author: Christian Kerl <christian.kerl@in.tum.de> */ #include "edge_se3Switchable.h" #include "vertex_switchLinear.h" #include "g2o/types/slam3d/vertex_se3.h" #include "g2o/types/slam3d/isometry3d_gradients.h" using namespace std; using namespace Eigen; // ================================================ EdgeSE3Switchable::EdgeSE3Switchable() : g2o::BaseMultiEdge<6, Eigen::Isometry3d>() { resize(3); _jacobianOplus.clear(); _jacobianOplus.push_back(JacobianType(0, 6, 6)); _jacobianOplus.push_back(JacobianType(0, 6, 6)); _jacobianOplus.push_back(JacobianType(0, 6, 1)); } // ================================================ bool EdgeSE3Switchable::read(std::istream& is) { /* g2o::Vector7d meas; for (int i=0; i<7; i++) is >> meas[i]; // normalize the quaternion to recover numerical precision lost by storing as human readable text Vector4d::MapType(meas.data()+3).normalize(); setMeasurement(g2o::internal::fromVectorQT(meas)); for (int i=0; i<6; i++) for (int j=i; j<6; j++) { is >> information()(i,j); if (i!=j) information()(j,i) = information()(i,j); } return true;*/ return false; } // ================================================ bool EdgeSE3Switchable::write(std::ostream& os) const { /* g2o::Vector7d meas = g2o::internal::toVectorQT(measurement()); for (int i=0; i<7; i++) os << meas[i] << " "; for (int i = 0; i < 6; ++i) for (int j = i; j < 6; ++j) os << " " << information()(i, j); return os.good();*/ return false; } // ================================================ void EdgeSE3Switchable::linearizeOplus() { g2o::VertexSE3* from = static_cast<g2o::VertexSE3*>(_vertices[0]); g2o::VertexSE3* to = static_cast<g2o::VertexSE3*>(_vertices[1]); const VertexSwitchLinear* vSwitch = static_cast<const VertexSwitchLinear*>(_vertices[2]); Eigen::Isometry3d E; const Eigen::Isometry3d& Xi=from->estimate(); const Eigen::Isometry3d& Xj=to->estimate(); const Eigen::Isometry3d& Z=_measurement; g2o::internal::computeEdgeSE3Gradient(E, _jacobianOplus[0], _jacobianOplus[1], Z, Xi, Xj); _jacobianOplus[0]*=vSwitch->estimate(); _jacobianOplus[1]*=vSwitch->estimate(); // derivative w.r.t switch vertex _jacobianOplus[2].setZero(); _jacobianOplus[2] = g2o::internal::toVectorMQT(E) * vSwitch->gradient(); } // ================================================ void EdgeSE3Switchable::computeError() { const g2o::VertexSE3* v1 = dynamic_cast<const g2o::VertexSE3*>(_vertices[0]); const g2o::VertexSE3* v2 = dynamic_cast<const g2o::VertexSE3*>(_vertices[1]); const VertexSwitchLinear* v3 = static_cast<const VertexSwitchLinear*>(_vertices[2]); Eigen::Isometry3d delta = _inverseMeasurement * (v1->estimate().inverse()*v2->estimate()); _error = g2o::internal::toVectorMQT(delta) * v3->estimate(); } /* #include <GL/gl.h> #ifdef G2O_HAVE_OPENGL EdgeSE3SwitchableDrawAction::EdgeSE3SwitchableDrawAction(): DrawAction(typeid(EdgeSE3Switchable).name()){} g2o::HyperGraphElementAction* EdgeSE3SwitchableDrawAction::operator()(g2o::HyperGraph::HyperGraphElement* element, g2o::HyperGraphElementAction::Parameters* ){ if (typeid(*element).name()!=_typeName) return 0; EdgeSE3Switchable* e = static_cast<EdgeSE3Switchable*>(element); g2o::VertexSE3* fromEdge = static_cast<g2o::VertexSE3*>(e->vertices()[0]); g2o::VertexSE3* toEdge = static_cast<g2o::VertexSE3*>(e->vertices()[1]); VertexSwitchLinear* s = static_cast<VertexSwitchLinear*>(e->vertices()[2]); glColor3f(s->estimate()*1.0,s->estimate()*0.1,s->estimate()*0.1); glPushAttrib(GL_ENABLE_BIT); glDisable(GL_LIGHTING); glBegin(GL_LINES); glVertex3f(fromEdge->estimate().translation().x(),fromEdge->estimate().translation().y(),fromEdge->estimate().translation().z()); glVertex3f(toEdge->estimate().translation().x(),toEdge->estimate().translation().y(),toEdge->estimate().translation().z()); glEnd(); glPopAttrib(); return this; } #endif */
{ "pile_set_name": "Github" }
null
null
# -*- coding: utf-8 -*- """ To be used with processors in module `highstate_doc`. """ # Import Python libs from __future__ import absolute_import, print_function, unicode_literals __virtualname__ = "highstate_doc" def note(name, source=None, contents=None, **kwargs): """ Add content to a document generated using `highstate_doc.render`. This state does not preform any tasks on the host. It only is used in highstate_doc lowstate processors to include extra documents. .. code-block:: yaml {{sls}} example note: highstate_doc.note: - name: example note - require_in: - pkg: somepackage - contents: | example `highstate_doc.note` ------------------ This state does not do anything to the system! It is only used by a `processor` you can use `requisites` and `order` to move your docs around the rendered file. .. this message appare above the `pkg: somepackage` state. - source: salt://{{tpldir}}/also_include_a_file.md {{sls}} extra help: highstate_doc.note: - name: example - order: 0 - source: salt://{{tpldir}}/HELP.md """ comment = "" if source: comment += "include file: {0}\n".format(source) if contents and len(contents) < 200: comment += contents return {"name": name, "result": True, "comment": comment, "changes": {}}
{ "pile_set_name": "Github" }
null
null
#-------------------------------------------------------------------------------- vsim -c -do simulate_mti.do
{ "pile_set_name": "Github" }
null
null
{ "contextState": true, "closureShortcuts": false, "closureStorageField": "C", "varStorageField": "V", "evalCtx": { "a": ["_a", 0], "b": ["_b", 1], "c": ["_c", 2] }, "contextMethodOps":true, "injectEvalCtx":true, "injectFuncMeta": "meta" }
{ "pile_set_name": "Github" }
null
null
#!/usr/bin/perl -w # # Boost.Function library # # Copyright (C) 2001-2003 Douglas Gregor (gregod@cs.rpi.edu) # # Permission to copy, use, sell and distribute this software is granted # provided this copyright notice appears in all copies. # Permission to modify the code and to distribute modified code is granted # provided this copyright notice appears in all copies, and a notice # that the code was modified is included with the copyright notice. # # This software is provided "as is" without express or implied warranty, # and with no claim as to its suitability for any purpose. # # For more information, see http://www.boost.org use English; $max_args = $ARGV[0]; open (OUT, ">maybe_include.hpp") or die("Cannot write to maybe_include.hpp"); for($on_arg = 0; $on_arg <= $max_args; ++$on_arg) { if ($on_arg == 0) { print OUT "#if"; } else { print OUT "#elif"; } print OUT " BOOST_FUNCTION_NUM_ARGS == $on_arg\n"; print OUT "# ifndef BOOST_FUNCTION_$on_arg\n"; print OUT "# define BOOST_FUNCTION_$on_arg\n"; print OUT "# include <boost/function/function_template.hpp>\n"; print OUT "# endif\n"; } print OUT "#else\n"; print OUT "# error Cannot handle Boost.Function objects that accept more than $max_args arguments!\n"; print OUT "#endif\n";
{ "pile_set_name": "Github" }
null
null
<!DOCTYPE html> <html lang="en"> <head> <meta charset="utf-8"> <title>ReefJS Test</title> <meta name="viewport" content="width=device-width, initial-scale=1.0"> <!-- stylesheets --> <style type="text/css"> body { font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "Roboto", "Oxygen", "Ubuntu", "Cantarell", "Fira Sans", "Droid Sans", "Helvetica Neue", sans-serif; font-size: 112.5%; margin-left: auto; margin-right: auto; max-width: 32em; width: 88%; } label, input { display: block; width: 100%; } </style> <!-- scripts --> <script src="../dist/reef.js"></script> </head> <body> <main> <div id="test2"></div> <div id="test"></div> <div id="app"></div> <script> // Turn on debug mode Reef.debug(true); var test2 = new Reef('#test2', { data: { showContent: true, xss: `<img onerror="alert('xss attack yo!')" src=x>` }, template: function (props) { if (!props.showContent) return 'Hi'; return ` ${props.xss} <style>.color { color: red; }</style> <p class="color">Hi!</p>`; } }); test2.render(); setTimeout(function () { sourceOfTruth.data.showContent = true; }, 2000); var test = new Reef('#test', { data: { items: [1, 2, 3, 4], sub: true }, template: function (props) { var html = '<ul>' + props.items.map(function (item) { return '<li>' + item + '</li>'; }).join('') + '</ul>'; if (props.sub) { html += '<div><div><div>Hello</div>World</div>!</div>'; } return html; } }); test.render(); var sourceOfTruth = new Reef.Store({ data: { heading: '', items: { todos: [ 'Buy milk', 'Bake a birthday cake', 'Go apple picking' ], heading: 'Things' }, } }); var wrapper = new Reef('#app', { store: sourceOfTruth, template: function (props) { return '<h1 sandwich="tuna">' + (props.items.heading.length > 0 ? props.items.heading : 'Hello, world!') + '</h1><div id="content"></div>'; }, attachTo: [sourceOfTruth] }); var app = new Reef('#content', { store: sourceOfTruth, template: function (props) { var html = '<h1>Todos</h1><ul sandwich="tuna">'; var styles = props.heading.length > 4 ? ' style="font-weight: bold; color: rebeccapurple; background-color: gainsboro;"' : ''; props.items.todos.forEach(function (todo) { html += '<li' + styles + '>' + todo + '</li>'; }); html += '<input type="checkbox" defaultChecked>'; html += '<input type="text" id="heading"><br>'; html += '<strong>The title is:</strong> ' + (props.heading.length > 0 ? props.heading : 'Hello, world!'); html += '</ul>'; html += ` <label for="wizards">Who is the best wizard?</label> <select> <option value="harry">Harry</option> <option value="hermione" defaultSelected>Hermione</option> <option value="neville">Neville</option> </select><br><br>`; // html += '<img src="x" onerror="alert(\'XSS attack!\')">'; html += '<svg xmlns="http://www.w3.org/2000/svg" style="height:.8em;width:.8em" viewBox="0 0 16 16"><path fill="currentColor" d="M14 9v2.066c-1.258 1.285-3.016 2.526-5 2.852V8.001h3v-1L9 5.83A3.001 3.001 0 0 0 8 .001 3 3 0 0 0 7 5.83L4 7.001v1h3v5.917c-1.984-.326-3.742-1.567-5-2.852V9H0v1c0 2 4 6 8 6s8-4 8-6V9h-2zM9 3a1 1 0 1 1-2 0 1 1 0 0 1 2 0z"/></svg>'; html += '<button ' + (props.heading.length > 4 ? 'disabled' : '') + '>Disabled Button</button>'; return html; }, attachTo: [wrapper] }); // app.attach(wrapper); wrapper.render(); // Update state on input change document.addEventListener('input', function (event) { if (!event.target.matches('#heading')) return; sourceOfTruth.data.heading = event.target.value; }, false); </script> </main> </body> </html>
{ "pile_set_name": "Github" }
null
null
using System; using System.Collections.Generic; using System.Linq; using System.Text; namespace DvdLib.Ifo { public class Program { public readonly List<Cell> Cells; public Program(List<Cell> cells) { Cells = cells; } } }
{ "pile_set_name": "Github" }
null
null
#ifndef MATH_GRISU_H #define MATH_GRISU_H int dtoa_grisu3(double v, char *dst, int size); #endif
{ "pile_set_name": "Github" }
null
null
<?php /** * Magento * * NOTICE OF LICENSE * * This source file is subject to the Academic Free License (AFL 3.0) * that is bundled with this package in the file LICENSE_AFL.txt. * It is also available through the world-wide-web at this URL: * http://opensource.org/licenses/afl-3.0.php * If you did not receive a copy of the license and are unable to * obtain it through the world-wide-web, please send an email * to license@magentocommerce.com so we can send you a copy immediately. * * DISCLAIMER * * Do not edit or add to this file if you wish to upgrade Magento to newer * versions in the future. If you wish to customize Magento for your * needs please refer to http://www.magentocommerce.com for more information. * * @category design * @package base_default * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) */ ?> <?php if($this->getResultCount()): ?> <?php echo $this->getMessagesBlock()->getGroupedHtml() ?> <div class="page-title"> <?php if ($this->helper('rss/catalog')->getTagFeedUrl()): ?> <a href="<?php echo $this->helper('rss/catalog')->getTagFeedUrl() ?>" class="nobr link-rss"><?php echo $this->__('Subscribe to Feed') ?></a> <?php endif; ?> <h1><?php echo ($this->getHeaderText() || $this->getHeaderText() === false) ? $this->getHeaderText() : $this->__("Search results for '%s'", $this->helper('catalogsearch')->getEscapedQueryText()) ?></h1> </div> <?php if ($messages = $this->getNoteMessages()):?> <p class="note-msg"> <?php foreach ($messages as $message):?> <?php echo $message?><br /> <?php endforeach;?> </p> <?php endif; ?> <?php echo $this->getProductListHtml() ?> <?php else: ?> <div class="page-title"> <h1><?php echo ($this->getHeaderText() || $this->getHeaderText() === false) ? $this->getHeaderText() : $this->__("Search results for '%s'", $this->helper('catalogsearch')->getEscapedQueryText()) ?></h1> </div> <p class="note-msg"> <?php echo ($this->getNoResultText()) ? $this->getNoResultText() : $this->__('Your search returns no results.') ?> <?php if ($messages = $this->getNoteMessages()):?> <?php foreach ($messages as $message):?> <br /><?php echo $message?> <?php endforeach;?> <?php endif; ?> </p> <?php endif; ?>
{ "pile_set_name": "Github" }
null
null
package tahrir.tools; import tahrir.io.crypto.TrCrypto; import tahrir.io.net.PhysicalNetworkLocation; import tahrir.io.net.RemoteNodeAddress; import tahrir.io.net.TrPeerManager; import tahrir.io.net.udpV1.UdpNetworkLocation; import java.net.InetAddress; import java.net.UnknownHostException; import java.security.interfaces.RSAPublicKey; import java.util.Random; public class Generic { public static Integer randomInt(Integer i) { return new Random().nextInt(i); } public static Integer genericPort() { return randomInt(60000); } public static Integer genericSessionId() { return randomInt(1000); } public static Integer genericTopologyLocation() { return new Random().nextInt(); } public static InetAddress genericInetAddress() { try { return InetAddress.getByName("127.0.0.1"); } catch (UnknownHostException e) { throw new RuntimeException(e); } } public static RemoteNodeAddress genericRemoteNodeAddress() { final RSAPublicKey pubKey = TrCrypto.createRsaKeyPair().a; final PhysicalNetworkLocation location = new UdpNetworkLocation(genericInetAddress(), genericPort()); return new RemoteNodeAddress(location, pubKey); } public static TrPeerManager.TopologyLocationInfo genericTopologyLocationInfo() { return new TrPeerManager.TopologyLocationInfo(null); } }
{ "pile_set_name": "Github" }
null
null
// // ACAppDelegate.h // ParallaxDemo // // Created by Arnaud Coomans on 6/11/13. // Copyright (c) 2013 acoomans. All rights reserved. // #import <UIKit/UIKit.h> @class ACViewController; @interface ACAppDelegate : UIResponder <UIApplicationDelegate> @property (strong, nonatomic) UIWindow *window; @property (strong, nonatomic) ACViewController *viewController; @end
{ "pile_set_name": "Github" }
null
null
// Copyright 2016 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 "components/sync/model/data_type_error_handler_impl.h" #include "base/bind.h" #include "base/metrics/histogram_macros.h" namespace syncer { DataTypeErrorHandlerImpl::DataTypeErrorHandlerImpl( const scoped_refptr<base::SingleThreadTaskRunner>& ui_thread, const base::Closure& dump_stack, const ErrorCallback& sync_callback) : ui_thread_(ui_thread), dump_stack_(dump_stack), sync_callback_(sync_callback) {} DataTypeErrorHandlerImpl::~DataTypeErrorHandlerImpl() {} void DataTypeErrorHandlerImpl::OnUnrecoverableError(const SyncError& error) { if (!dump_stack_.is_null()) dump_stack_.Run(); UMA_HISTOGRAM_ENUMERATION("Sync.DataTypeRunFailures", ModelTypeToHistogramInt(error.model_type()), MODEL_TYPE_COUNT); ui_thread_->PostTask(error.location(), base::Bind(sync_callback_, error)); } SyncError DataTypeErrorHandlerImpl::CreateAndUploadError( const tracked_objects::Location& location, const std::string& message, ModelType type) { if (!dump_stack_.is_null()) dump_stack_.Run(); return SyncError(location, SyncError::DATATYPE_ERROR, message, type); } std::unique_ptr<DataTypeErrorHandler> DataTypeErrorHandlerImpl::Copy() const { return base::MakeUnique<DataTypeErrorHandlerImpl>(ui_thread_, dump_stack_, sync_callback_); } } // namespace syncer
{ "pile_set_name": "Github" }
null
null
# Copyright (c) 2017 OpenStack Foundation # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writing, software # distributed under the License is distributed on an "AS IS" BASIS, # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or # implied. # See the License for the specific language governing permissions and # limitations under the License. import json import six from xml.etree.cElementTree import Element, SubElement, tostring from swift.common.constraints import valid_api_version from swift.common.http import HTTP_NO_CONTENT from swift.common.request_helpers import get_param from swift.common.swob import HTTPException, HTTPNotAcceptable, Request, \ RESPONSE_REASONS, HTTPBadRequest, wsgi_quote, wsgi_to_bytes from swift.common.utils import RESERVED, get_logger, list_from_csv #: Mapping of query string ``format=`` values to their corresponding #: content-type values. FORMAT2CONTENT_TYPE = {'plain': 'text/plain', 'json': 'application/json', 'xml': 'application/xml'} #: Maximum size of a valid JSON container listing body. If we receive #: a container listing response larger than this, assume it's a staticweb #: response and pass it on to the client. # Default max object length is 1024, default container listing limit is 1e4; # add a fudge factor for things like hash, last_modified, etc. MAX_CONTAINER_LISTING_CONTENT_LENGTH = 1024 * 10000 * 2 def get_listing_content_type(req): """ Determine the content type to use for an account or container listing response. :param req: request object :returns: content type as a string (e.g. text/plain, application/json) :raises HTTPNotAcceptable: if the requested content type is not acceptable :raises HTTPBadRequest: if the 'format' query param is provided and not valid UTF-8 """ query_format = get_param(req, 'format') if query_format: req.accept = FORMAT2CONTENT_TYPE.get( query_format.lower(), FORMAT2CONTENT_TYPE['plain']) try: out_content_type = req.accept.best_match( ['text/plain', 'application/json', 'application/xml', 'text/xml']) except ValueError: raise HTTPBadRequest(request=req, body=b'Invalid Accept header') if not out_content_type: raise HTTPNotAcceptable(request=req) return out_content_type def to_xml(document_element): result = tostring(document_element, encoding='UTF-8').replace( b"<?xml version='1.0' encoding='UTF-8'?>", b'<?xml version="1.0" encoding="UTF-8"?>', 1) if not result.startswith(b'<?xml '): # py3 tostring doesn't (necessarily?) include the XML declaration; # add it if it's missing. result = b'<?xml version="1.0" encoding="UTF-8"?>\n' + result return result def account_to_xml(listing, account_name): doc = Element('account', name=account_name) doc.text = '\n' for record in listing: if 'subdir' in record: name = record.pop('subdir') sub = SubElement(doc, 'subdir', name=name) else: sub = SubElement(doc, 'container') for field in ('name', 'count', 'bytes', 'last_modified'): SubElement(sub, field).text = six.text_type( record.pop(field)) sub.tail = '\n' return to_xml(doc) def container_to_xml(listing, base_name): doc = Element('container', name=base_name) for record in listing: if 'subdir' in record: name = record.pop('subdir') sub = SubElement(doc, 'subdir', name=name) SubElement(sub, 'name').text = name else: sub = SubElement(doc, 'object') for field in ('name', 'hash', 'bytes', 'content_type', 'last_modified'): SubElement(sub, field).text = six.text_type( record.pop(field)) return to_xml(doc) def listing_to_text(listing): def get_lines(): for item in listing: if 'name' in item: yield item['name'].encode('utf-8') + b'\n' else: yield item['subdir'].encode('utf-8') + b'\n' return b''.join(get_lines()) class ListingFilter(object): def __init__(self, app, conf, logger=None): self.app = app self.logger = logger or get_logger(conf, log_route='listing-filter') def filter_reserved(self, listing, account, container): new_listing = [] for entry in list(listing): for key in ('name', 'subdir'): value = entry.get(key, '') if six.PY2: value = value.encode('utf-8') if RESERVED in value: if container: self.logger.warning( 'Container listing for %s/%s had ' 'reserved byte in %s: %r', wsgi_quote(account), wsgi_quote(container), key, value) else: self.logger.warning( 'Account listing for %s had ' 'reserved byte in %s: %r', wsgi_quote(account), key, value) break # out of the *key* loop; check next entry else: new_listing.append(entry) return new_listing def __call__(self, env, start_response): req = Request(env) try: # account and container only version, acct, cont = req.split_path(2, 3) except ValueError: is_account_or_container_req = False else: is_account_or_container_req = True if not is_account_or_container_req: return self.app(env, start_response) if not valid_api_version(version) or req.method not in ('GET', 'HEAD'): return self.app(env, start_response) # OK, definitely have an account/container request. # Get the desired content-type, then force it to a JSON request. try: out_content_type = get_listing_content_type(req) except HTTPException as err: return err(env, start_response) params = req.params can_vary = 'format' not in params params['format'] = 'json' req.params = params # Give other middlewares a chance to be in charge env.setdefault('swift.format_listing', True) status, headers, resp_iter = req.call_application(self.app) if not env.get('swift.format_listing'): start_response(status, headers) return resp_iter header_to_index = {} resp_content_type = resp_length = None for i, (header, value) in enumerate(headers): header = header.lower() if header == 'content-type': header_to_index[header] = i resp_content_type = value.partition(';')[0] elif header == 'content-length': header_to_index[header] = i resp_length = int(value) elif header == 'vary': header_to_index[header] = i if not status.startswith(('200 ', '204 ')): start_response(status, headers) return resp_
{ "pile_set_name": "Github" }
null
null
console.log('hello this is myindex'); module.exports=function(){ console.log('hello this is myindex'); }
{ "pile_set_name": "Github" }
null
null
# KUDO Cassandra Architecture Apache Cassandra is a stateful workload. KUDO Cassandra uses kubernetes statefulset as the basic piece of the KUDO Cassandra Architecture As a StatefulSet maintains sticky identities for each of its Pods, this helps KUDO Cassandra to automate all necessary operations with Apache Cassandra nodes. To help with updates and upgrades, KUDO Cassandra comes with a custom config maps thats helps for rolling updates for KUDO Cassandra. Apache Cassandra maintenance jobs like `repair` and `backup/restore` are configured as kubernetes jobs and are only deployed on-demand when configuring their respective parameters. ![](images/architecture.png) ## Multi-Datacenter Architecture KUDO Cassandra can span a ring across multiple kubernetes clusters, to facilitate the deployment across various regions and zones. Read more about multidataceneter configuration options in the [multi-dataceneter](./multidataceneter.md) docs. ![](images/multi-dc-arch.png)
{ "pile_set_name": "Github" }
null
null
use crate::aio::{ActualConnection, Connect}; use crate::types::RedisResult; #[cfg(feature = "tls")] use async_native_tls::{TlsConnector, TlsStream}; use async_std::net::TcpStream; #[cfg(unix)] use async_std::os::unix::net::UnixStream; use async_trait::async_trait; use std::net::SocketAddr; #[cfg(unix)] use std::path::Path; use std::pin::Pin; use tokio::io::{AsyncRead, AsyncWrite}; /// Wraps the async_std TcpStream in order to implement the required Traits for it pub struct TcpStreamAsyncStdWrapped(TcpStream); /// Wraps the async_native_tls TlsStream in order to implement the required Traits for it #[cfg(feature = "tls")] pub struct TlsStreamAsyncStdWrapped(TlsStream<TcpStream>); #[cfg(unix)] /// Wraps the async_std UnixStream in order to implement the required Traits for it pub struct UnixStreamAsyncStdWrapped(UnixStream); impl AsyncWrite for TcpStreamAsyncStdWrapped { fn poll_write( mut self: Pin<&mut Self>, cx: &mut core::task::Context, buf: &[u8], ) -> std::task::Poll<Result<usize, tokio::io::Error>> { async_std::io::Write::poll_write(Pin::new(&mut self.0), cx, buf) } fn poll_flush( mut self: Pin<&mut Self>, cx: &mut core::task::Context, ) -> std::task::Poll<Result<(), tokio::io::Error>> { async_std::io::Write::poll_flush(Pin::new(&mut self.0), cx) } fn poll_shutdown( mut self: Pin<&mut Self>, cx: &mut core::task::Context, ) -> std::task::Poll<Result<(), tokio::io::Error>> { async_std::io::Write::poll_close(Pin::new(&mut self.0), cx) } } impl AsyncRead for TcpStreamAsyncStdWrapped { fn poll_read( mut self: Pin<&mut Self>, cx: &mut core::task::Context, buf: &mut [u8], ) -> std::task::Poll<Result<usize, tokio::io::Error>> { async_std::io::Read::poll_read(Pin::new(&mut self.0), cx, buf) } } #[cfg(feature = "tls")] impl AsyncWrite for TlsStreamAsyncStdWrapped { fn poll_write( mut self: Pin<&mut Self>, cx: &mut core::task::Context, buf: &[u8], ) -> std::task::Poll<Result<usize, tokio::io::Error>> { async_std::io::Write::poll_write(Pin::new(&mut self.0), cx, buf) } fn poll_flush( mut self: Pin<&mut Self>, cx: &mut core::task::Context, ) -> std::task::Poll<Result<(), tokio::io::Error>> { async_std::io::Write::poll_flush(Pin::new(&mut self.0), cx) } fn poll_shutdown( mut self: Pin<&mut Self>, cx: &mut core::task::Context, ) -> std::task::Poll<Result<(), tokio::io::Error>> { async_std::io::Write::poll_close(Pin::new(&mut self.0), cx) } } #[cfg(feature = "tls")] impl AsyncRead for TlsStreamAsyncStdWrapped { fn poll_read( mut self: Pin<&mut Self>, cx: &mut core::task::Context, buf: &mut [u8], ) -> std::task::Poll<Result<usize, tokio::io::Error>> { async_std::io::Read::poll_read(Pin::new(&mut self.0), cx, buf) } } #[cfg(unix)] impl AsyncWrite for UnixStreamAsyncStdWrapped { fn poll_write( mut self: Pin<&mut Self>, cx: &mut core::task::Context, buf: &[u8], ) -> std::task::Poll<Result<usize, tokio::io::Error>> { async_std::io::Write::poll_write(Pin::new(&mut self.0), cx, buf) } fn poll_flush( mut self: Pin<&mut Self>, cx: &mut core::task::Context, ) -> std::task::Poll<Result<(), tokio::io::Error>> { async_std::io::Write::poll_flush(Pin::new(&mut self.0), cx) } fn poll_shutdown( mut self: Pin<&mut Self>, cx: &mut core::task::Context, ) -> std::task::Poll<Result<(), tokio::io::Error>> { async_std::io::Write::poll_close(Pin::new(&mut self.0), cx) } } #[cfg(unix)] impl AsyncRead for UnixStreamAsyncStdWrapped { fn poll_read( mut self: Pin<&mut Self>, cx: &mut core::task::Context, buf: &mut [u8], ) -> std::task::Poll<Result<usize, tokio::io::Error>> { async_std::io::Read::poll_read(Pin::new(&mut self.0), cx, buf) } } /// Represents an AsyncStd connectable pub struct AsyncStd; #[async_trait] impl Connect for AsyncStd { async fn connect_tcp(socket_addr: SocketAddr) -> RedisResult<ActualConnection> { Ok(TcpStream::connect(&socket_addr) .await .map(|con| ActualConnection::TcpAsyncStd(TcpStreamAsyncStdWrapped(con)))?) } #[cfg(feature = "tls")] async fn connect_tcp_tls( hostname: &str, socket_addr: SocketAddr, insecure: bool, ) -> RedisResult<ActualConnection> { let tcp_stream = TcpStream::connect(&socket_addr).await?; let tls_connector = if insecure { TlsConnector::new() .danger_accept_invalid_certs(true) .danger_accept_invalid_hostnames(true) .use_sni(false) } else { TlsConnector::new() }; Ok(tls_connector .connect(hostname, tcp_stream) .await .map(|con| ActualConnection::TcpTlsAsyncStd(TlsStreamAsyncStdWrapped(con)))?) } #[cfg(unix)] async fn connect_unix(path: &Path) -> RedisResult<ActualConnection> { Ok(UnixStream::connect(path) .await .map(|con| ActualConnection::UnixAsyncStd(UnixStreamAsyncStdWrapped(con)))?) } }
{ "pile_set_name": "Github" }
null
null
/* * This file contains low level CPU setup functions. * Kumar Gala <galak@kernel.crashing.org> * Copyright 2009 Freescale Semiconductor, Inc. * * Based on cpu_setup_6xx code by * Benjamin Herrenschmidt <benh@kernel.crashing.org> * * This program is free software; you can redistribute it and/or * modify it under the terms of the GNU General Public License * as published by the Free Software Foundation; either version * 2 of the License, or (at your option) any later version. * */ #include <asm/processor.h> #include <asm/cputable.h> #include <asm/ppc_asm.h> _GLOBAL(__e500_icache_setup) mfspr r0, SPRN_L1CSR1 andi. r3, r0, L1CSR1_ICE bnelr /* Already enabled */ oris r0, r0, L1CSR1_CPE@h ori r0, r0, (L1CSR1_ICFI | L1CSR1_ICLFR | L1CSR1_ICE) mtspr SPRN_L1CSR1, r0 /* Enable I-Cache */ isync blr _GLOBAL(__e500_dcache_setup) mfspr r0, SPRN_L1CSR0 andi. r3, r0, L1CSR0_DCE bnelr /* Already enabled */ msync isync li r0, 0 mtspr SPRN_L1CSR0, r0 /* Disable */ msync isync li r0, (L1CSR0_DCFI | L1CSR0_CLFC) mtspr SPRN_L1CSR0, r0 /* Invalidate */ isync 1: mfspr r0, SPRN_L1CSR0 andi. r3, r0, L1CSR0_CLFC bne+ 1b /* Wait for lock bits reset */ oris r0, r0, L1CSR0_CPE@h ori r0, r0, L1CSR0_DCE msync isync mtspr SPRN_L1CSR0, r0 /* Enable */ isync blr #ifdef CONFIG_PPC32 _GLOBAL(__setup_cpu_e200) /* enable dedicated debug exception handling resources (Debug APU) */ mfspr r3,SPRN_HID0 ori r3,r3,HID0_DAPUEN@l mtspr SPRN_HID0,r3 b __setup_e200_ivors _GLOBAL(__setup_cpu_e500v1) _GLOBAL(__setup_cpu_e500v2) mflr r4 bl __e500_icache_setup bl __e500_dcache_setup bl __setup_e500_ivors #ifdef CONFIG_FSL_RIO /* Ensure that RFXE is set */ mfspr r3,SPRN_HID1 oris r3,r3,HID1_RFXE@h mtspr SPRN_HID1,r3 #endif mtlr r4 blr _GLOBAL(__setup_cpu_e500mc) mflr r4 bl __e500_icache_setup bl __e500_dcache_setup bl __setup_e500mc_ivors mtlr r4 blr #endif /* Right now, restore and setup are the same thing */ _GLOBAL(__restore_cpu_e5500) _GLOBAL(__setup_cpu_e5500) mflr r4 bl __e500_icache_setup bl __e500_dcache_setup #ifdef CONFIG_PPC_BOOK3E_64 bl .__setup_base_ivors bl .setup_perfmon_ivor bl .setup_doorbell_ivors bl .setup_ehv_ivors #else bl __setup_e500mc_ivors #endif mtlr r4 blr
{ "pile_set_name": "Github" }
null
null
// // LDMasterViewController.h // LivelyDemo // // Created by Romain Goyet on 24/04/12. // Copyright (c) 2012 Applidium. All rights reserved. // #import <UIKit/UIKit.h> @interface LDMasterViewController : UITableViewController <UIActionSheetDelegate> { NSArray * _objects; } - (IBAction)pickTransform:(id)sender; @end
{ "pile_set_name": "Github" }
null
null
from binaryninja import * import base64 import copy import json def falcon_export(bv) : filename = interaction.get_save_filename_input("Filename for Binja export") segments = [] for segment in bv.segments : segments.append({ 'address': segment.start, 'bytes': base64.b64encode(bv.read(segment.start, segment.length)) }) functions = [] for function in bv.functions : functions.append({ 'name': function.name, 'address': function.start, }) fh = open(filename, 'wb') fh.write(json.dumps({ 'functions': functions, 'segments': segments, 'arch': bv.arch.name, 'entry': bv.entry_point })) fh.close() PluginCommand.register("Export for Falcon", "Export disassembly information for Falcon", falcon_export)
{ "pile_set_name": "Github" }
null
null
/*! * jQuery Validation Plugin v1.14.0 * * http://jqueryvalidation.org/ * * Copyright (c) 2015 Jörn Zaefferer * Released under the MIT license */ (function( factory ) { if ( typeof define === "function" && define.amd ) { define( ["jquery"], factory ); } else { factory( jQuery ); } }(function( $ ) { $.extend($.fn, { // http://jqueryvalidation.org/validate/ validate: function( options ) { // if nothing is selected, return nothing; can't chain anyway if ( !this.length ) { if ( options && options.debug && window.console ) { console.warn( "Nothing selected, can't validate, returning nothing." ); } return; } // check if a validator for this form was already created var validator = $.data( this[ 0 ], "validator" ); if ( validator ) { return validator; } // Add novalidate tag if HTML5. this.attr( "novalidate", "novalidate" ); validator = new $.validator( options, this[ 0 ] ); $.data( this[ 0 ], "validator", validator ); if ( validator.settings.onsubmit ) { this.on( "click.validate", ":submit", function( event ) { if ( validator.settings.submitHandler ) { validator.submitButton = event.target; } // allow suppressing validation by adding a cancel class to the submit button if ( $( this ).hasClass( "cancel" ) ) { validator.cancelSubmit = true; } // allow suppressing validation by adding the html5 formnovalidate attribute to the submit button if ( $( this ).attr( "formnovalidate" ) !== undefined ) { validator.cancelSubmit = true; } }); // validate the form on submit this.on( "submit.validate", function( event ) { if ( validator.settings.debug ) { // prevent form submit to be able to see console output event.preventDefault(); } function handle() { var hidden, result; if ( validator.settings.submitHandler ) { if ( validator.submitButton ) { // insert a hidden input as a replacement for the missing submit button hidden = $( "<input type='hidden'/>" ) .attr( "name", validator.submitButton.name ) .val( $( validator.submitButton ).val() ) .appendTo( validator.currentForm ); } result = validator.settings.submitHandler.call( validator, validator.currentForm, event ); if ( validator.submitButton ) { // and clean up afterwards; thanks to no-block-scope, hidden can be referenced hidden.remove(); } if ( result !== undefined ) { return result; } return false; } return true; } // prevent submit for invalid forms or custom submit handlers if ( validator.cancelSubmit ) { validator.cancelSubmit = false; return handle(); } if ( validator.form() ) { if ( validator.pendingRequest ) { validator.formSubmitted = true; return false; } return handle(); } else { validator.focusInvalid(); return false; } }); } return validator; }, // http://jqueryvalidation.org/valid/ valid: function() { var valid, validator, errorList; if ( $( this[ 0 ] ).is( "form" ) ) { valid = this.validate().form(); } else { errorList = []; valid = true; validator = $( this[ 0 ].form ).validate(); this.each( function() { valid = validator.element( this ) && valid; errorList = errorList.concat( validator.errorList ); }); validator.errorList = errorList; } return valid; }, // http://jqueryvalidation.org/rules/ rules: function( command, argument ) { var element = this[ 0 ], settings, staticRules, existingRules, data, param, filtered; if ( command ) { settings = $.data( element.form, "validator" ).settings; staticRules = settings.rules; existingRules = $.validator.staticRules( element ); switch ( command ) { case "add": $.extend( existingRules, $.validator.normalizeRule( argument ) ); // remove messages from rules, but allow them to be set separately delete existingRules.messages; staticRules[ element.name ] = existingRules; if ( argument.messages ) { settings.messages[ element.name ] = $.extend( settings.messages[ element.name ], argument.messages ); } break; case "remove": if ( !argument ) { delete staticRules[ element.name ]; return existingRules; } filtered = {}; $.each( argument.split( /\s/ ), function( index, method ) { filtered[ method ] = existingRules[ method ]; delete existingRules[ method ]; if ( method === "required" ) { $( element ).removeAttr( "aria-required" ); } }); return filtered; } } data = $.validator.normalizeRules( $.extend( {}, $.validator.classRules( element ), $.validator.attributeRules( element ), $.validator.dataRules( element ), $.validator.staticRules( element ) ), element ); // make sure required is at front if ( data.required ) { param = data.required; delete data.required; data = $.extend( { required: param }, data ); $( element ).attr( "aria-required", "true" ); } // make sure remote is at back if ( data.remote ) { param = data.remote; delete data.remote; data = $.extend( data, { remote: param }); } return data; } }); // Custom selectors $.extend( $.expr[ ":" ], { // http://jqueryvalidation.org/blank-selector/ blank: function( a ) { return !$.trim( "" + $( a ).val() ); }, // http://jqueryvalidation.org/filled-selector/ filled: function( a ) { return !!$.trim( "" + $( a ).val() ); }, // http://jqueryvalidation.org/unchecked-selector/ unchecked: function( a ) { return !$( a ).prop( "checked" ); } }); // constructor for validator $.validator = function( options, form ) { this.settings = $.extend( true, {}, $.validator.defaults, options ); this.currentForm = form; this.init(); }; // http://jqueryvalidation.org/jQuery.validator.format/ $.validator.format = function( source, params ) { if ( arguments.length === 1 ) { return function() { var args = $.makeArray( arguments ); args.unshift( source ); return $.validator.format.apply( this, args ); }; } if ( arguments.length > 2 && params.constructor !== Array ) { params = $.makeArray( arguments ).slice( 1 ); } if ( params.constructor !== Array ) { params = [ params ]; } $.each( params, function( i, n ) { source = source.replace( new RegExp( "\\{" + i + "\\}", "g" ), function() { return n; }); }); return source; }; $.extend( $.validator, { defaults: { messages: {}, groups: {}, rules: {}, errorClass: "error", validClass: "valid", errorElement: "label", focusCleanup: false, focusInvalid: true, errorContainer: $( [] ), errorLabelContainer: $( [] ), onsubmit: true, ignore: ":hidden", ignoreTitle:
{ "pile_set_name": "Github" }
null
null
import maya.cmds as mc import maya.mel as mm import glTools.utils.base import glTools.utils.curve import glTools.utils.mesh import glTools.utils.namespace import glTools.utils.osUtils import glTools.utils.stringUtils import glTools.utils.surface import re class UserInputError(Exception): pass class UIError(Exception): pass # ============== # - Text Field - # ============== def loadFilePath(textField,fileFilter=None,caption='Load File',startDir=None): ''' Select a file path to load into a specified textField. @param textField: TextField UI object to load file path to @type textField: str @param fileFilter: File filter to apply to the file selection UI @type fileFilter: str @param caption: File selection UI caption string @type caption: str @param startDir: Directory to start browsing from. In None, use the default or last selected directory. @type startDir: str ''' # Get File Path filePath = mc.fileDialog2( fileFilter=fileFilter, dialogStyle=2, fileMode=1, caption=caption, okCaption='Load', startingDirectory=startDir ) # Check File Path if not filePath: print('Invalid file path!') return # Load File Path to TextField if mc.textField(textField,q=True,ex=True): mc.textField(textField,e=True,text=filePath[0]) elif mc.textFieldGrp(textField,q=True,ex=True): mc.textFieldGrp(textField,e=True,text=filePath[0]) elif mc.textFieldButtonGrp(textField,q=True,ex=True): mc.textFieldButtonGrp(textField,e=True,text=filePath[0]) else: print('UI element "" is not a valid textField, textFieldGrp or textFieldButtonGrp!') return # Return Result return filePath[0] def loadDirectoryPath(textField,caption='Load Directory',startDir=None): ''' Select a file path to load into a specified textField. @param textField: TextField UI object to load file path to @type textField: str @param caption: File selection UI caption string @type caption: str @param startDir: Directory to start browsing from. In None, use the default or last selected directory. @type startDir: str ''' # Get File Path dirPath = mc.fileDialog2( dialogStyle=2, fileMode=3, caption=caption, okCaption='Load', startingDirectory=startDir ) # Check File Path if not dirPath: print('Invalid directory path!') return # Load File Path to TextField if mc.textField(textField,q=True,ex=True): mc.textField(textField,e=True,text=dirPath[0]) elif mc.textFieldGrp(textField,q=True,ex=True): mc.textFieldGrp(textField,e=True,text=dirPath[0]) elif mc.textFieldButtonGrp(textField,q=True,ex=True): mc.textFieldButtonGrp(textField,e=True,text=dirPath[0]) else: print('UI element "'+textField+'" is of type "'+mc.objectTypeUI(textField)+'"! Expected textField, textFieldGrp or textFieldButtonGrp.') return # Return Result return dirPath[0] def importFolderBrowser(textField): # ,caption='Import',startingDirectory=None): ''' Set the input directory from file browser selection ''' mm.eval('global proc importGetFolder(string $textField,string $path,string $type){ textFieldButtonGrp -e -text $path $textField; deleteUI projectViewerWindow; }') mm.eval('fileBrowser "importGetFolder '+textField+'" Import "" 4') #dirPath = mc.fileDialog2(dialogStyle=2,fileMode=3,caption='Load Scenegraph XML',okCaption='Load',startingDirectory=startingDirectory) def exportFolderBrowser(textField): ''' Set the output directory from file browser selection ''' mm.eval('global proc exportGetFolder(string $textField,string $path,string $type){ textFieldButtonGrp -e -text $path $textField; /*deleteUI projectViewerWindow;*/ }') mm.eval('fileBrowser "exportGetFolder '+textField+'" Export "" 4') def loadNsSel(textField,topOnly=True): ''' Load selected namespace into UI text field @param textField: TextField UI object to load namespace selection into @type textField: str @param topOnly: Return the top level namespace only. @type topOnly: bool ''' # Get Selection sel = mc.ls(sl=True) if not sel: return # Get Selected Namespace NS = '' NS = glTools.utils.namespace.getNS(sel[0],topOnly) # Update UI mc.textFieldButtonGrp(textField,e=True,text=NS) def loadObjectSel(textField,prefixTextField=''): ''' Load selected object into UI text field @param textField: TextField UI object to load object selection into @type textField: str @param prefixTextField: TextField UI object to load object name prefix into @type prefixTextField: str ''' # Get user selection sel = mc.ls(sl=True) # Check selection if not sel: return # Update UI mc.textFieldButtonGrp(textField,e=True,text=sel[0]) if prefixTextField: if not mc.textFieldGrp(prefixTextField,q=True,text=True): prefix = glTools.utils.stringUtils.stripSuffix(sel[0]) mc.textFieldGrp(prefixTextField,e=True,text=prefix) def loadTypeSel(textField,prefixTextField='',selType=''): ''' Load selected joint into UI text field @param textField: TextField UI object to load joint selection into @type textField: str @param prefixTextField: TextField UI object to load curve name prefix into @type prefixTextField: str ''' if not selType: raise UserInputError('No selection type specified!!') # Get user selection sel = mc.ls(sl=True,type=selType) # Check selection if not sel: return # Update UI mc.textFieldButtonGrp(textField,e=True,text=sel[0]) if prefixTextField: prefix = glTools.utils.stringUtils.stripSuffix(sel[0]) mc.textFieldGrp(prefixTextField,e=True,text=prefix) def loadCurveSel(textField,prefixTextField=''): ''' Load selected curve into UI text field @param textField: TextField UI object to load curve selection into @type textField: str @param prefixTextField: TextField UI object to load curve name prefix into @type prefixTextField: str ''' # Get user selection sel = mc.ls(sl=True) # Check selection if not sel: return if not glTools.utils.curve.isCurve(sel[0]): raise UserInputError('Object "'+sel[0]+'" is not a valid nurbs curve!!') # Update UI mc.textFieldButtonGrp(textField,e=True,text=sel[0]) if prefixTextField: if not mc.textFieldGrp(prefixTextField,q=True,text=True): prefix = glTools.utils.stringUtils.stripSuffix(sel[0]) mc.textFieldGrp(prefixTextField,e=True,text=prefix) def loadSurfaceSel(textField,prefixTextField=''): ''' Load selected surface into UI text field @param textField: TextField UI object to load surface selection into @
{ "pile_set_name": "Github" }
null
null
<?php namespace Cdn\Request\V20180510; /** * @deprecated Please use https://github.com/aliyun/openapi-sdk-php * * Request of SetHttpErrorPageConfig * * @method string getPageUrl() * @method string getErrorCode() * @method string getDomainName() * @method string getOwnerId() * @method string getConfigId() */ class SetHttpErrorPageConfigRequest extends \RpcAcsRequest { /** * Class constructor. */ public function __construct() { parent::__construct( 'Cdn', '2018-05-10', 'SetHttpErrorPageConfig' ); } /** * @param string $pageUrl * * @return $this */ public function setPageUrl($pageUrl) { $this->requestParameters['PageUrl'] = $pageUrl; $this->queryParameters['PageUrl'] = $pageUrl; return $this; } /** * @param string $errorCode * * @return $this */ public function setErrorCode($errorCode) { $this->requestParameters['ErrorCode'] = $errorCode; $this->queryParameters['ErrorCode'] = $errorCode; return $this; } /** * @param string $domainName * * @return $this */ public function setDomainName($domainName) { $this->requestParameters['DomainName'] = $domainName; $this->queryParameters['DomainName'] = $domainName; return $this; } /** * @param string $ownerId * * @return $this */ public function setOwnerId($ownerId) { $this->requestParameters['OwnerId'] = $ownerId; $this->queryParameters['OwnerId'] = $ownerId; return $this; } /** * @param string $configId * * @return $this */ public function setConfigId($configId) { $this->requestParameters['ConfigId'] = $configId; $this->queryParameters['ConfigId'] = $configId; return $this; } }
{ "pile_set_name": "Github" }
null
null
Invalid group use syntax ----- <?php // Missing semicolon use Foo\{Bar} use Bar\{Foo}; ----- !!php7 Syntax error, unexpected T_USE, expecting ';' from 4:1 to 4:3 array( 0: Stmt_GroupUse( type: TYPE_UNKNOWN (0) prefix: Name( parts: array( 0: Foo ) ) uses: array( 0: Stmt_UseUse( type: TYPE_NORMAL (1) name: Name( parts: array( 0: Bar ) ) alias: null ) ) comments: array( 0: // Missing semicolon ) ) 1: Stmt_GroupUse( type: TYPE_UNKNOWN (0) prefix: Name( parts: array( 0: Bar ) ) uses: array( 0: Stmt_UseUse( type: TYPE_NORMAL (1) name: Name( parts: array( 0: Foo ) ) alias: null ) ) ) ) ----- <?php // Missing NS separator use Foo {Bar, Baz}; ----- !!php7 Syntax error, unexpected '{', expecting ';' from 3:9 to 3:9 array( 0: Stmt_Use( type: TYPE_NORMAL (1) uses: array( 0: Stmt_UseUse( type: TYPE_UNKNOWN (0) name: Name( parts: array( 0: Foo ) ) alias: null ) ) comments: array( 0: // Missing NS separator ) ) 1: Stmt_Expression( expr: Expr_ConstFetch( name: Name( parts: array( 0: Bar ) ) ) ) 2: Stmt_Expression( expr: Expr_ConstFetch( name: Name( parts: array( 0: Baz ) ) ) ) ) ----- <?php // Extra NS separator use Foo\{\Bar}; ----- Syntax error, unexpected T_NS_SEPARATOR, expecting T_STRING or T_FUNCTION or T_CONST from 3:10 to 3:10 array( 0: Stmt_Expression( expr: Expr_ConstFetch( name: Name_FullyQualified( parts: array( 0: Bar ) ) ) ) )
{ "pile_set_name": "Github" }
null
null
// // PFPurchaseTableViewCell.h // Parse // // Created by Qian Wang on 5/21/12. // Copyright (c) 2012 Parse Inc. All rights reserved. // #import <UIKit/UIKit.h> #import "PFTableViewCell.h" /*! An enum that represents states of the PFPurchaseTableViewCell. @see PFPurchaseTableViewCell */ typedef NS_ENUM(uint8_t, PFPurchaseTableViewCellState) { /*! Normal state of the cell. */ PFPurchaseTableViewCellStateNormal = 0, /*! Downloading state of the cell. */ PFPurchaseTableViewCellStateDownloading, /*! State of the cell, when the product was downloaded. */ PFPurchaseTableViewCellStateDownloaded }; /*! PFPurchaseTableViewCell is a subclass PFTableViewCell that is used to show products in a PFProductTableViewController. @see PFProductTableViewController */ @interface PFPurchaseTableViewCell : PFTableViewCell /*! State of the cell */ @property (nonatomic, assign) PFPurchaseTableViewCellState state; /*! Label where price of the product is displayed. */ @property (nonatomic, strong, readonly) UILabel *priceLabel; /*! Progress view that is shown, when the product is downloading. */ @property (nonatomic, strong, readonly) UIProgressView *progressView; @end
{ "pile_set_name": "Github" }
null
null
/* * Copyright (C) 2011 Google Inc. All rights reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions * are met: * * 1. Redistributions of source code must retain the above copyright * notice, this list of conditions and the following disclaimer. * 2. Redistributions in binary form must reproduce the above copyright * notice, this list of conditions and the following disclaimer in the * documentation and/or other materials provided with the distribution. * 3. Neither the name of Apple Inc. ("Apple") nor the names of * its contributors may be used to endorse or promote products derived * from this software without specific prior written permission. * * THIS SOFTWARE IS PROVIDED BY APPLE AND ITS 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 APPLE 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. */ #ifndef DynamicsCompressorKernel_h #define DynamicsCompressorKernel_h #include "AudioArray.h" #include <memory> #include <wtf/Vector.h> namespace WebCore { class DynamicsCompressorKernel { public: DynamicsCompressorKernel(float sampleRate, unsigned numberOfChannels); void setNumberOfChannels(unsigned); // Performs stereo-linked compression. void process(float* sourceChannels[], float* destinationChannels[], unsigned numberOfChannels, unsigned framesToProcess, float dbThreshold, float dbKnee, float ratio, float attackTime, float releaseTime, float preDelayTime, float dbPostGain, float effectBlend, float releaseZone1, float releaseZone2, float releaseZone3, float releaseZone4 ); void reset(); unsigned latencyFrames() const { return m_lastPreDelayFrames; } float sampleRate() const { return m_sampleRate; } float meteringGain() const { return m_meteringGain; } protected: float m_sampleRate; float m_detectorAverage; float m_compressorGain; // Metering float m_meteringReleaseK; float m_meteringGain; // Lookahead section. enum { MaxPreDelayFrames = 1024 }; enum { MaxPreDelayFramesMask = MaxPreDelayFrames - 1 }; enum { DefaultPreDelayFrames = 256 }; // setPreDelayTime() will override this initial value unsigned m_lastPreDelayFrames; void setPreDelayTime(float); Vector<std::unique_ptr<AudioFloatArray>> m_preDelayBuffers; int m_preDelayReadIndex; int m_preDelayWriteIndex; float m_maxAttackCompressionDiffDb; // Static compression curve. float kneeCurve(float x, float k); float saturate(float x, float k); float slopeAt(float x, float k); float kAtSlope(float desiredSlope); float updateStaticCurveParameters(float dbThreshold, float dbKnee, float ratio); // Amount of input change in dB required for 1 dB of output change. // This applies to the portion of the curve above m_kneeThresholdDb (see below). float m_ratio; float m_slope; // Inverse ratio. // The input to output change below the threshold is linear 1:1. float m_linearThreshold; float m_dbThreshold; // m_dbKnee is the number of dB above the threshold before we enter the "ratio" portion of the curve. // m_kneeThresholdDb = m_dbThreshold + m_dbKnee // The portion between m_dbThreshold and m_kneeThresholdDb is the "soft knee" portion of the curve // which transitions smoothly from the linear portion to the ratio portion. float m_dbKnee; float m_kneeThreshold; float m_kneeThresholdDb; float m_ykneeThresholdDb; // Internal parameter for the knee portion of the curve. float m_K; }; } // namespace WebCore #endif // DynamicsCompressorKernel_h
{ "pile_set_name": "Github" }
null
null
statement ok CREATE TABLE xyz ( x INT, y INT, z INT, pk1 INT, pk2 INT, PRIMARY KEY (pk1, pk2) ) statement ok INSERT INTO xyz VALUES (1, 1, NULL, 1, 1), (1, 1, 2, 2, 2), (1, 1, 2, 3, 3), (1, 2, 1, 4, 4), (2, 2, 3, 5, 5), (4, 5, 6, 6, 6), (4, 1, 6, 7, 7) statement ok CREATE TABLE abc ( a STRING, b STRING, c STRING, PRIMARY KEY (a, b, c) ) statement ok INSERT INTO abc VALUES ('1', '1', '1'), ('1', '1', '2'), ('1', '2', '2') ################## # Simple queries # ################## # 3/3 columns query III rowsort SELECT DISTINCT ON (x, y, z) x, y, z FROM xyz ---- 1 1 NULL 1 1 2 1 2 1 2 2 3 4 5 6 4 1 6 query I rowsort SELECT DISTINCT ON (y, x, z) x FROM xyz ---- 1 1 1 2 4 4 query I rowsort SELECT DISTINCT ON (z, y, x) z FROM xyz ---- NULL 2 1 3 6 6 query TTT rowsort SELECT DISTINCT ON (b, c, a) a, c, b FROM abc ---- 1 1 1 1 2 1 1 2 2 query T rowsort SELECT DISTINCT ON (b, c, a) a FROM abc ---- 1 1 1 # We need to rowsort this since the ORDER BY isn't on the entire SELECT columns. query T rowsort SELECT DISTINCT ON (c, a, b) b FROM abc ORDER BY b ---- 1 1 2 # 2/3 columns query II rowsort SELECT DISTINCT ON (x, y) y, x FROM xyz ---- 1 1 2 1 2 2 5 4 1 4 query I rowsort SELECT DISTINCT ON (y, x) x FROM xyz ---- 1 1 2 4 4 query I rowsort SELECT DISTINCT ON (x, y) y FROM xyz ---- 1 2 2 5 1 query TT SELECT DISTINCT ON (a, c) a, b FROM abc ORDER BY a, c, b ---- 1 1 1 1 # We wrap this with an ORDER BY otherwise this would be non-deterministic. query TTT SELECT DISTINCT ON (c, a) b, c, a FROM abc ORDER BY c, a, b DESC ---- 1 1 1 2 2 1 # 1/3 columns query I rowsort SELECT DISTINCT ON (y) y FROM xyz ---- 1 2 5 query T rowsort SELECT DISTINCT ON (c) a FROM abc ---- 1 1 query T rowsort SELECT DISTINCT ON (b) b FROM abc ---- 1 2 # We wrap this with an ORDER BY otherwise this would be non-deterministic. query TTT SELECT DISTINCT ON (a) a, b, c FROM abc ORDER BY a, b, c ---- 1 1 1 query TT SELECT DISTINCT ON (a) a, c FROM abc ORDER BY a, c DESC, b ---- 1 2 ################# # With ORDER BY # ################# statement error SELECT DISTINCT ON expressions must match initial ORDER BY expressions SELECT DISTINCT ON (x) x, y, z FROM xyz ORDER BY y statement error SELECT DISTINCT ON expressions must match initial ORDER BY expressions SELECT DISTINCT ON (y) x, y, z FROM xyz ORDER BY x, y statement error SELECT DISTINCT ON expressions must match initial ORDER BY expressions SELECT DISTINCT ON (y, z) x, y, z FROM xyz ORDER BY x query I SELECT DISTINCT ON (x) x FROM xyz ORDER BY x DESC ---- 4 2 1 # We add a filter to eliminate one of the rows that may be flakily returned # depending on parallel execution of DISTINCT ON. query III SELECT DISTINCT ON (x, z) y, z, x FROM xyz WHERE (x,y,z) != (4, 1, 6) ORDER BY z ---- 1 NULL 1 2 1 1 1 2 1 2 3 2 5 6 4 query III SELECT DISTINCT ON (x) y, z, x FROM xyz ORDER BY x ASC, z DESC, y DESC ---- 1 2 1 2 3 2 5 6 4 # Regression test for #35437: Discard extra ordering columns after performing # DISTINCT operation. query T SELECT (SELECT DISTINCT ON (a) a FROM abc ORDER BY a, b||'foo') || 'bar'; ---- 1bar ##################### # With aggregations # ##################### statement error column "y" must appear in the GROUP BY clause or be used in an aggregate function SELECT DISTINCT ON(max(x)) y FROM xyz statement error column "z" must appear in the GROUP BY clause or be used in an aggregate function SELECT DISTINCT ON(max(x), z) min(y) FROM xyz query I SELECT DISTINCT ON (max(x)) min(y) FROM xyz ---- 1 query I SELECT DISTINCT ON (min(x)) max(y) FROM xyz ---- 5 query T SELECT DISTINCT ON(min(a), max(b), min(c)) max(c) FROM abc ---- 2 ################# # With GROUP BY # ################# statement error column "x" must appear in the GROUP BY clause or be used in an aggregate function SELECT DISTINCT ON (x) min(x) FROM xyz GROUP BY y query I rowsort SELECT DISTINCT ON(y) min(x) FROM xyz GROUP BY y ---- 1 1 4 query I SELECT DISTINCT ON(min(x)) min(x) FROM xyz GROUP BY y HAVING min(x) = 1 ---- 1 ######################### # With window functions # ######################### query I rowsort SELECT DISTINCT ON(row_number() OVER(ORDER BY (pk1, pk2))) y FROM xyz ---- 1 1 1 2 2 5 1 query I SELECT DISTINCT ON(row_number() OVER(ORDER BY (pk1, pk2))) y FROM xyz ORDER BY row_number() OVER(ORDER BY (pk1, pk2)) DESC ---- 1 5 2 2 1 1 1 ########################### # With ordinal references # ########################### statement error DISTINCT ON position 2 is not in select list SELECT DISTINCT ON (2) x FROM xyz query I rowsort SELECT DISTINCT ON (1) x FROM xyz ---- 1 2 4 query III rowsort SELECT DISTINCT ON (1,2,3) x, y, z FROM xyz ---- 1 1 NULL 1 1 2 1 2 1 2 2 3 4 5 6 4 1 6 ######################### # With alias references # ######################### # This should prioritize alias (use 'x' as the key). # This would be non-deterministic if we don't select y (actually x) from the # subquery. query I rowsort SELECT y FROM (SELECT DISTINCT ON(y) x AS y, y AS x FROM xyz) ---- 1 2 4 # Ignores the alias. query I rowsort SELECT DISTINCT ON(x) x AS y FROM xyz ---- 1 2 4 ################################## # With nested parentheses/tuples # ################################## query II rowsort SELECT DISTINCT ON(((x)), (x, y)) x, y FROM xyz ---- 1 1 1 2 2 2 4 5 4 1 ################################ # Hybrid PK and non-PK queries # ################################ # We need to rowsort this since the ORDER BY
{ "pile_set_name": "Github" }
null
null
snippet Ada Gitignore Template ### Ada ### # Object file *.o # Ada Library Information *.ali ${0}
{ "pile_set_name": "Github" }
null
null
// Copyright 2009 The 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,openbsd package unix func setTimespec(sec, nsec int64) Timespec { return Timespec{Sec: sec, Nsec: nsec} } func setTimeval(sec, usec int64) Timeval { return Timeval{Sec: sec, Usec: usec} } func SetKevent(k *Kevent_t, fd, mode, flags int) { k.Ident = uint64(fd) k.Filter = int16(mode) k.Flags = uint16(flags) } func (iov *Iovec) SetLen(length int) { iov.Len = uint64(length) } func (msghdr *Msghdr) SetControllen(length int) { msghdr.Controllen = uint32(length) } func (msghdr *Msghdr) SetIovlen(length int) { msghdr.Iovlen = uint32(length) } func (cmsg *Cmsghdr) SetLen(length int) { cmsg.Len = uint32(length) } // SYS___SYSCTL is used by syscall_bsd.go for all BSDs, but in modern versions // of openbsd/amd64 the syscall is called sysctl instead of __sysctl. const SYS___SYSCTL = SYS_SYSCTL
{ "pile_set_name": "Github" }
null
null
julia 0.4 Compat 0.9.4
{ "pile_set_name": "Github" }
null
null
.. _IP:LocalLink_PerformanceCounter: PoC.net.FramePerformanceCounter ############################### .. only:: html .. |gh-src| image:: /_static/logos/GitHub-Mark-32px.png :scale: 40 :target: https://github.com/VLSI-EDA/PoC/blob/master/src/net/net_FramePerformanceCounter.vhdl :alt: Source Code on GitHub .. |gh-tb| image:: /_static/logos/GitHub-Mark-32px.png :scale: 40 :target: https://github.com/VLSI-EDA/PoC/blob/master/tb/net/net_FramePerformanceCounter_tb.vhdl :alt: Source Code on GitHub .. sidebar:: GitHub Links * |gh-src| :pocsrc:`Sourcecode <net/net_FramePerformanceCounter.vhdl>` * |gh-tb| :poctb:`Testbench <net/net_FramePerformanceCounter_tb.vhdl>` .. rubric:: Entity Declaration: .. literalinclude:: ../../../src/net/net_FramePerformanceCounter.vhdl :language: vhdl :tab-width: 2 :linenos: :lines: 11-35 .. only:: latex Source file: :pocsrc:`net/net_FramePerformanceCounter.vhdl <net/net_FramePerformanceCounter.vhdl>`
{ "pile_set_name": "Github" }
null
null
/* @ngInject */ function confirmModal(pmModal, gettextCatalog, translator) { const I18N = translator(() => ({ confirm: gettextCatalog.getString('Confirm', null, 'Default text for the confirm button in the confirm modal'), cancel: gettextCatalog.getString('Cancel', null, 'Default text for the cancel button in the confirm modal') })); const getClassName = ({ isDanger = false, isWarning = false } = {}) => { const danger = isDanger && 'alert-danger'; const warning = isWarning && 'alert-warning'; return ['alert', danger, warning].filter(Boolean).join(' '); }; return pmModal({ controllerAs: 'ctrl', templateUrl: require('../../../templates/modals/confirm.tpl.html'), /* @ngInject */ controller: function(params, hotkeys) { hotkeys.unbind(['enter']); this.title = params.title; this.icon = params.icon; this.learnMore = params.learnMore; this.message = params.message; this.confirmText = params.confirmText || I18N.confirm; this.hideClose = params.hideClose; this.classNameMessage = !params.customAlert ? getClassName(params) : ''; this.class = params.class; this.confirmClass = params.confirmClass || 'primary'; this.cancelText = params.cancelText || I18N.cancel; this.confirm = () => (hotkeys.bind(['enter']), params.confirm()); this.cancel = (type = 'cross') => (hotkeys.bind(['enter']), params.cancel(type)); // The button is not directly available setTimeout(() => angular.element('#confirmModalBtn').focus(), 100); } }); } export default confirmModal;
{ "pile_set_name": "Github" }
null
null
{ "paths": { "customizerJs": [ "../assets/js/vendor/autoprefixer.js", "../assets/js/vendor/less.min.js", "../assets/js/vendor/jszip.min.js", "../assets/js/vendor/uglify.min.js", "../assets/js/vendor/Blob.js", "../assets/js/vendor/FileSaver.js", "../assets/js/raw-files.min.js", "../assets/js/src/customizer.js" ], "docsJs": [ "../assets/js/vendor/holder.js", "../assets/js/vendor/ZeroClipboard.min.js", "../assets/js/vendor/anchor.js", "../assets/js/src/application.js" ] }, "config": { "autoprefixerBrowsers": [ "Android 2.3", "Android >= 4", "Chrome >= 20", "Firefox >= 24", "Explorer >= 8", "iOS >= 6", "Opera >= 12", "Safari >= 6" ], "jqueryCheck": [ "if (typeof jQuery === 'undefined') {", " throw new Error('Bootstrap\\'s JavaScript requires jQuery')", "}\n" ], "jqueryVersionCheck": [ "+function ($) {", " 'use strict';", " var version = $.fn.jquery.split(' ')[0].split('.')", " if ((version[0] < 2 && version[1] < 9) || (version[0] == 1 && version[1] == 9 && version[2] < 1)) {", " throw new Error('Bootstrap\\'s JavaScript requires jQuery version 1.9.1 or higher')", " }", "}(jQuery);\n\n" ] } }
{ "pile_set_name": "Github" }
null
null
/******************************************************************************* * AMetal * ---------------------------- * innovating embedded platform * * Copyright (c) 2001-2018 Guangzhou ZHIYUAN Electronics Co., Ltd. * All rights reserved. * * Contact information: * web site: http://www.zlg.cn/ *******************************************************************************/ /** * \file * \brief tim0 定时器 CAP 例程,通过标准接口实现 * * - 操作步骤: * 1. 使用杜邦线,将 PIOB_3 与 PIOA_0 连接。 * * - 实验现象: * 1. TIM3 通过 PIOB_3 引脚输出 2KHz 的 PWM; * 2. TIM0 捕获输入通道 0 使用 PIOA_0 引脚捕获; * 3. 串口打印出利用捕获功能得到的 PWM 信号的周期和频率。 * * \note * 1. 如需观察串口打印的调试信息,需要将 PIOA_10 引脚连接 PC 串口的 TXD, * PIOA_9 引脚连接 PC 串口的 RXD。 * * \par 源代码 * \snippet demo_hc32f07x_std_tim0_cap.c src_hc32f07x_std_tim0_cap * * \internal * \par Modification history * - 1.00 19-09-20 zp, first implementation * \endinternal */ /** * \addtogroup demo_if_hc32f07x_std_tim0_cap * \copydoc demo_hc32f07x_std_tim0_cap.c */ /** [src_hc32f07x_std_tim0_cap] */ #include "ametal.h" #include "am_vdebug.h" #include "am_hc32f07x_inst_init.h" #include "demo_std_entries.h" #include "demo_amf07x_core_entries.h" /** * \brief 例程入口 */ void demo_hc32f07x_core_std_tim0_cap_entry (void) { am_pwm_handle_t tim3_pwm_handle = am_hc32_tim3_pwm_inst_init(); am_cap_handle_t tim0_cap_handle = am_hc32_tim0_cap_inst_init(); AM_DBG_INFO("demo amf07x_core std tim0 cap!\r\n"); /* TIM3 输出频率为 2KHz 的 PWM */ am_pwm_config(tim3_pwm_handle, 0, 500000 / 2, 500000); am_pwm_enable(tim3_pwm_handle, 0); demo_std_timer_cap_entry(tim0_cap_handle, 0); } /** [src_hc32f07x_std_tim0_cap] */ /* end of file */
{ "pile_set_name": "Github" }
null
null
case SSD1963_800ALT: LCD_Write_COM(0xE2); //PLL multiplier, set PLL clock to 120M LCD_Write_DATA(0x23); //N=0x36 for 6.5M, 0x23 for 10M crystal LCD_Write_DATA(0x02); LCD_Write_DATA(0x04); LCD_Write_COM(0xE0); // PLL enable LCD_Write_DATA(0x01); delay(10); LCD_Write_COM(0xE0); LCD_Write_DATA(0x03); delay(10); LCD_Write_COM(0x01); // software reset delay(100); LCD_Write_COM(0xE6); //PLL setting for PCLK, depends on resolution LCD_Write_DATA(0x04); LCD_Write_DATA(0x93); LCD_Write_DATA(0xE0); LCD_Write_COM(0xB0); //LCD SPECIFICATION LCD_Write_DATA(0x00); // 0x24 LCD_Write_DATA(0x00); LCD_Write_DATA(0x03); //Set HDP 799 LCD_Write_DATA(0x1F); LCD_Write_DATA(0x01); //Set VDP 479 LCD_Write_DATA(0xDF); LCD_Write_DATA(0x00); LCD_Write_COM(0xB4); //HSYNC LCD_Write_DATA(0x03); //Set HT 928 LCD_Write_DATA(0xA0); LCD_Write_DATA(0x00); //Set HPS 46 LCD_Write_DATA(0x2E); LCD_Write_DATA(0x30); //Set HPW 48 LCD_Write_DATA(0x00); //Set LPS 15 LCD_Write_DATA(0x0F); LCD_Write_DATA(0x00); LCD_Write_COM(0xB6); //VSYNC LCD_Write_DATA(0x02); //Set VT 525 LCD_Write_DATA(0x0D); LCD_Write_DATA(0x00); //Set VPS 16 LCD_Write_DATA(0x10); LCD_Write_DATA(0x10); //Set VPW 16 LCD_Write_DATA(0x00); //Set FPS 8 LCD_Write_DATA(0x08); LCD_Write_COM(0xBA); LCD_Write_DATA(0x05); //GPIO[3:0] out 1 LCD_Write_COM(0xB8); LCD_Write_DATA(0x07); //GPIO3=input, GPIO[2:0]=output LCD_Write_DATA(0x01); //GPIO0 normal LCD_Write_COM(0x36); //rotation LCD_Write_DATA(0x22); // -- Set to 0x21 to rotate 180 degrees LCD_Write_COM(0xF0); //pixel data interface LCD_Write_DATA(0x03); delay(10); setXY(0, 0, 799, 479); LCD_Write_COM(0x29); //display on LCD_Write_COM(0xBE); //set PWM for B/L LCD_Write_DATA(0x06); LCD_Write_DATA(0xF0); LCD_Write_DATA(0x01); LCD_Write_DATA(0xF0); LCD_Write_DATA(0x00); LCD_Write_DATA(0x00); LCD_Write_COM(0xD0); LCD_Write_DATA(0x0D); LCD_Write_COM(0x2C); break;
{ "pile_set_name": "Github" }
null
null
<!DOCTYPE html><html class="theme-next muse use-motion" lang="zh-CN"><head><meta name="generator" content="Hexo 3.8.0"><meta charset="UTF-8"><meta http-equiv="X-UA-Compatible" content="IE=edge"><meta name="viewport" content="width=device-width,initial-scale=1,maximum-scale=2"><meta name="theme-color" content="#222"><script src="//cdn.jsdelivr.net/npm/pace-js@1.0.2/pace.min.js"></script><link href="/lib/pace/pace-theme-corner-indicator.min.css?v=1.0.2" rel="stylesheet"><meta name="google-site-verification" content="sDeZZSmv4NPbU3sXi1IL5l8PiZt1wVqR5EKUsxOjruY"><link href="https://cdn.jsdelivr.net/npm/@fancyapps/fancybox@3.2.5/dist/jquery.fancybox.min.css" rel="stylesheet" type="text/css"><link href="https://fonts.googleapis.cnpmjs.org/css?family=Noto Serif SC:300,300italic,400,400italic,700,700italic|Noto Serif SC:300,300italic,400,400italic,700,700italic|Roboto Mono:300,300italic,400,400italic,700,700italic&subset=latin,latin-ext" rel="stylesheet" type="text/css"><link href="//cdn.jsdelivr.net/npm/font-awesome@4.7.0/css/font-awesome.min.css" rel="stylesheet" type="text/css"><link href="/css/main.css?v=6.6.0" rel="stylesheet" type="text/css"><link rel="apple-touch-icon" sizes="180x180" href="/images/apple-touch-icon-next.png?v=6.6.0"><link rel="icon" type="image/png" sizes="32x32" href="/images/favicon-32x32-next.png?v=6.6.0"><link rel="icon" type="image/png" sizes="16x16" href="/images/favicon-16x16-next.png?v=6.6.0"><link rel="mask-icon" href="/images/logo.svg?v=6.6.0" color="#222"><script id="hexo.configurations">var NexT=window.NexT||{},CONFIG={root:"/",scheme:"Muse",version:"6.6.0",sidebar:{position:"left",display:"hide",offset:12,b2t:!1,scrollpercent:!0,onmobile:!0},fancybox:!0,fastclick:!1,lazyload:!1,tabs:!0,motion:{enable:!0,async:!1,transition:{post_block:"fadeIn",post_header:"slideDownIn",post_body:"slideDownIn",coll_header:"slideLeftIn",sidebar:"slideUpIn"}},algolia:{applicationID:"",apiKey:"",indexName:"",hits:{per_page:10},labels:{input_placeholder:"Search for Posts",hits_empty:"We didn't find any results for the search: ${query}",hits_stats:"${hits} results found in ${time} ms"}}}</script><meta name="description" content="【微信首发】macOS Catalina 10.15.7 19H2 正式版 Clover 5122/OC/PE三分区支持Intel及AMD双平台原版镜像9月24日,苹果向macOS推送10.15.7系统补充更新,macOS Catalina 10.15.7 为您的 Mac 提供了重要的安全性更新和错误修复。解决了 macOS 不会自动接入 Wi-Fi 网络的问题修复了文件可能无法通过 iClou"><meta name="keywords" content="镜像,下载,Catalina,dmg,10.15.7,19H2,三EFI分区"><meta property="og:type" content="article"><meta property="og:title" content="【微信首发】macOS Catalina 10.15.7 19H2 正式版 Clover 5122&#x2F;OC&#x2F;PE三分区支持Intel及AMD双平台原版镜像"><meta property="og:url" content="https://blog.daliansky.net/WeChat-First-macOS-Catalina-10.15.7-19H2-official-version-Clover-5122-OC-WEPE-supports-both-INTEL-and-AMD-original-images.html"><meta property="og:site_name" content="黑果小兵的部落阁"><meta property="og:description" content="【微信首发】macOS Catalina 10.15.7 19H2 正式版 Clover 5122/OC/PE三分区支持Intel及AMD双平台原版镜像9月24日,苹果向macOS推送10.15.7系统补充更新,macOS Catalina 10.15.7 为您的 Mac 提供了重要的安全性更新和错误修复。解决了 macOS 不会自动接入 Wi-Fi 网络的问题修复了文件可能无法通过 iClou"><meta property="og:locale" content="zh-CN"><meta property="og:image" content="http://7.daliansky.net/10.15.7/19H2_Air13.png"><meta property="og:updated_time" content="2020-09-28T00:54:57.075Z"><meta name="twitter:card" content="summary"><meta name="twitter:title" content="【微信首发】macOS Catalina 10.15.7 19H2 正式版 Clover 5122&#x2F;OC&#x2F;PE三分区支持Intel及AMD双平台原版镜像"><meta name="twitter:description" content="【微信首发】macOS Catalina 10.15.7 19H2 正式版 Clover 5122/OC/PE三分区支持Intel及AMD双平台原版镜像9月24日,苹果向macOS推送10.15.7系统补充更新,macOS Catalina 10.15.7 为您的 Mac 提供了重要的安全性更新和错误修复。解决了 macOS 不会自动接入 Wi-Fi 网络的问题修复了文件可能无法通过 iClou"><meta name="twitter:image" content="http://7.daliansky.net/10.15.7/19H2_Air13.png"><link rel="alternate" href="/atom.xml" title="黑果小兵的部落阁" type="application/atom+xml"><link rel="canonical" href="https://blog.daliansky.net/WeChat-First-macOS-Catalina-10.15.7-19H2-official-version-Clover-5122-OC-WEPE-supports-both-INTEL-and-AMD-original-images.html"><script id="page.configurations">CONFIG.page={sidebar:""}</script><title>【微信首发】macOS Catalina 10.15.7 19H2 正式版 Clover 5122/OC/PE三分区支持Intel及AMD双平台原版镜像 | 黑果小兵的部落阁</title><script async src="https://www.googletagmanager.com/gtag/js?id=UA-18130737-1"></script><script>function gtag(){dataLayer.push(arguments)}window.dataLayer=window.dataLayer||[],gtag("js",new Date),gtag("config","UA-18130737-1")</script><noscript><style>.sidebar-inner,.use-motion .brand,.use-motion .collection-title,.
{ "pile_set_name": "Github" }
null
null
{ "nodeconntype":{ "type":"bool", "value":false }, "nodeparmtype":{ "type":"bool", "value":false } }
{ "pile_set_name": "Github" }
null
null
# Fees Rippled's fee mechanism consists of several interrelated processes: 1. [Rapid Fee escalation](#fee-escalation) 2. [The Transaction Queue](#transaction-queue) ## Fee Escalation The guiding principal of fee escalation is that when things are going smoothly, fees stay low, but as soon as high levels of traffic appear on the network, fees will grow quickly to extreme levels. This should dissuade malicious users from abusing the system, while giving legitimate users the ability to pay a higher fee to get high-priority transactions into the open ledger, even during unfavorable conditions. How fees escalate: 1. There is a base [fee level](#fee-level) of 256, which is the minimum that a typical transaction is required to pay. For a [reference transaction](#reference-transaction), that corresponds to the network base fee, which is currently 10 drops. 2. However, there is a limit on the number of transactions that can get into an open ledger for that base fee level. The limit will vary based on the [health](#consensus-health) of the consensus process, but will be at least [5](#other-constants). * If consensus stays [healthy](#consensus-health), the limit will be the max of the number of transactions in the validated ledger plus [20%](#other-constants) or the current limit until it gets to [50](#other-constants), at which point, the limit will be the largest number of transactions plus [20%](#other-constants) in the last [20](#other-constants) validated ledgers which had more than [50](#other-constants) transactions. Any time the limit decreases (i.e. a large ledger is no longer recent), the limit will decrease to the new largest value by 10% each time the ledger has more than 50 transactions. * If consensus does not stay [healthy](#consensus-health), the limit will clamp down to the smaller of the number of transactions in the validated ledger minus [50%](#other-constants) or the previous limit minus [50%](#other-constants). * The intended effect of these mechanisms is to allow as many base fee level transactions to get into the ledger as possible while the network is [healthy](#consensus-health), but to respond quickly to any condition that makes it [unhealthy](#consensus-health), including, but not limited to, malicious attacks. 3. Once there are more transactions in the open ledger than indicated by the limit, the required fee level jumps drastically. * The formula is `( lastLedgerMedianFeeLevel * TransactionsInOpenLedger^2 / limit^2 )`, and returns a [fee level](#fee-level). 4. That may still be pretty small, but as more transactions get into the ledger, the fee level increases exponentially. * For example, if the limit is 6, and the median fee is minimal, and assuming all [reference transactions](#reference-transaction), the 8th transaction only requires a [level](#fee-level) of about 174,000 or about 6800 drops, but the 20th transaction requires a [level](#fee-level) of about 1,283,000 or about 50,000 drops. 5. Finally, as each ledger closes, the median fee level of that ledger is computed and used as `lastLedgerMedianFeeLevel` (with a [minimum value of 128,000](#other-constants)) in the fee escalation formula for the next open ledger. * Continuing the example above, if ledger consensus completes with only those 20 transactions, and all of those transactions paid the minimum required fee at each step, the limit will be adjusted from 6 to 24, and the `lastLedgerMedianFeeLevel` will be about 322,000, which is 12,600 drops for a [reference transaction](#reference-transaction). * This will only require 10 drops for the first 25 transactions, but the 26th transaction will require a level of about 349,150 or about 13,649 drops. * This example assumes a cold-start scenario, with a single, possibly malicious, user willing to pay arbitrary amounts to get transactions into the open ledger. It ignores the effects of the [Transaction Queue](#transaction-queue). Any lower fee level transactions submitted by other users at the same time as this user's transactions will go into the transaction queue, and will have the first opportunity to be applied to the _next_ open ledger. The next section describes how that works in more detail. ## Transaction Queue An integral part of making fee escalation work for users of the network is the transaction queue. The queue allows legitimate transactions to be considered by the network for future ledgers if the escalated open ledger fee gets too high. This allows users to submit low priority transactions with a low fee, and wait for high fees to drop. It also allows legitimate users to continue submitting transactions during high traffic periods, and give those transactions a much better chance to succeed. 1. If an incoming transaction meets both the base [fee level](#fee-level) and the load fee minimum, but does not have a high enough [fee level](#fee-level) to immediately go into the open ledger, it is instead put into the queue and broadcast to peers. Each peer will then make an independent decision about whether to put the transaction into its open ledger or the queue. In principle, peers with identical open ledgers will come to identical decisions. Any discrepancies will be resolved as usual during consensus. 2. When consensus completes, the open ledger limit is adjusted, and the required [fee level](#fee-level) drops back to the base [fee level](#fee-level). Before the ledger is made available to external transactions, transactions are applied from the queue to the ledger from highest [fee level](#fee-level) to lowest. These transactions count against the open ledger limit, so the required [fee level](#fee-level) may start rising during this process. 3. Once the queue is empty, or the required [fee level](#fee-level) rises too high for the remaining transactions in the queue, the ledger is opened up for normal transaction processing. 4. A transaction in the queue can stay there indefinitely in principle, but in practice, either * it will eventually get applied to the ledger, * it will attempt to apply to the ledger and fail, * it will attempt to apply to the ledger and retry [10 times](#other-constants), * its last ledger sequence number will expire, * the user will replace it by submitting another transaction with the same sequence number and at least a [25% higher fee](#other-constants), or * it will get dropped when the queue fills up with more valuable transactions. The size limit is computed dynamically, and can hold transactions for the next [20 ledgers](#other-constants) (restricted to a minimum of [2000 transactions](#other-constants)). The lower the transaction's fee, the more likely that it will get dropped if the network is busy. If a transaction is submitted for an account with one or more transactions already in the queue, and a sequence number that is sequential with the other transactions in the queue for that account, it will be considered for the queue if it meets these additional criteria: * the account has fewer than [10](#other-constants) transactions already in the queue. * all other queued transactions for that account, in the case where they spend the maximum possible XRP, leave enough XRP balance to pay the fee, * the total fees for the other queued transactions are less than both the network's minimum reserve and the account's XRP balance, and * none of the prior queued transactions affect the ability of subsequent transactions to claim a fee. Currently, there is an additional restriction that the queue cannot work with transactions using the `sfPreviousTxnID` or `sfAccountTxnID` fields. `sfPreviousTxnID` is deprecated and shouldn't be used anyway. Future development will make the queue aware of `sfAccountTxnID` mechanisms. ## Technical Details ### Fee Level "Fee level" is used to allow the cost of different types of transactions to be compared directly. For a [reference transaction](#reference-transaction), the base fee level is 256. If a transaction is submitted with a higher `Fee` field, the fee level is scaled appropriately. Examples, assuming a [reference transaction](#reference-transaction) base fee of 10 drops: 1. A single-signed [reference transaction](#reference-transaction) with `Fee=20` will have a
{ "pile_set_name": "Github" }
null
null
/****************************************************************************** * * Project: PDF driver * Purpose: GDALDataset driver for PDF dataset (read vector features) * Author: Even Rouault, <even dot rouault at spatialys.com> * ****************************************************************************** * Copyright (c) 2010-2014, Even Rouault <even dot rouault at spatialys.com> * * Permission is hereby granted, free of charge, to any person obtaining a * copy of this software and associated documentation files (the "Software"), * to deal in the Software without restriction, including without limitation * the rights to use, copy, modify, merge, publish, distribute, sublicense, * and/or sell copies of the Software, and to permit persons to whom the * Software is furnished to do so, subject to the following conditions: * * The above copyright notice and this permission notice shall be included * in all copies or substantial portions of the Software. * * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER * DEALINGS IN THE SOFTWARE. ****************************************************************************/ #include "gdal_pdf.h" #include <array> #define SQUARE(x) ((x)*(x)) #define EPSILON 1e-5 CPL_CVSID("$Id$") #ifdef HAVE_PDF_READ_SUPPORT constexpr int BEZIER_STEPS = 10; /************************************************************************/ /* OpenVectorLayers() */ /************************************************************************/ int PDFDataset::OpenVectorLayers(GDALPDFDictionary* poPageDict) { if( bHasLoadedLayers ) return TRUE; bHasLoadedLayers = TRUE; if( poPageDict == nullptr ) { poPageDict = poPageObj->GetDictionary(); if ( poPageDict == nullptr ) return FALSE; } GetCatalog(); if( poCatalogObject == nullptr ) return FALSE; GDALPDFObject* poContents = poPageDict->Get("Contents"); if (poContents == nullptr) return FALSE; if (poContents->GetType() != PDFObjectType_Dictionary && poContents->GetType() != PDFObjectType_Array) return FALSE; GDALPDFObject* poResources = poPageDict->Get("Resources"); if (poResources == nullptr || poResources->GetType() != PDFObjectType_Dictionary) return FALSE; GDALPDFObject* poStructTreeRoot = poCatalogObject->GetDictionary()->Get("StructTreeRoot"); if (CPLTestBool(CPLGetConfigOption("OGR_PDF_READ_NON_STRUCTURED", "NO")) || poStructTreeRoot == nullptr || poStructTreeRoot->GetType() != PDFObjectType_Dictionary) { ExploreContentsNonStructured(poContents, poResources); } else { int nDepth = 0; int nVisited = 0; bool bStop = false; ExploreContents(poContents, poResources, nDepth, nVisited, bStop); std::set< std::pair<int,int> > aoSetAlreadyVisited; ExploreTree(poStructTreeRoot, aoSetAlreadyVisited, 0); } CleanupIntermediateResources(); int bEmptyDS = TRUE; for(int i=0;i<nLayers;i++) { if (papoLayers[i]->GetFeatureCount() != 0) { bEmptyDS = FALSE; break; } } return !bEmptyDS; } /************************************************************************/ /* CleanupIntermediateResources() */ /************************************************************************/ void PDFDataset::CleanupIntermediateResources() { std::map<int,OGRGeometry*>::iterator oMapIter = oMapMCID.begin(); for( ; oMapIter != oMapMCID.end(); ++oMapIter) delete oMapIter->second; oMapMCID.erase(oMapMCID.begin(), oMapMCID.end()); } /************************************************************************/ /* InitMapOperators() */ /************************************************************************/ typedef struct { char szOpName[4]; int nArgs; } PDFOperator; static const PDFOperator asPDFOperators [] = { { "b", 0 }, { "B", 0 }, { "b*", 0 }, { "B*", 0 }, { "BDC", 2 }, // BI { "BMC", 1 }, // BT { "BX", 0 }, { "c", 6 }, { "cm", 6 }, { "CS", 1 }, { "cs", 1 }, { "d", 1 }, /* we have ignored the first arg */ // d0 // d1 { "Do", 1 }, { "DP", 2 }, // EI { "EMC", 0 }, // ET { "EX", 0 }, { "f", 0 }, { "F", 0 }, { "f*", 0 }, { "G", 1 }, { "g", 1 }, { "gs", 1 }, { "h", 0 }, { "i", 1 }, // ID { "j", 1 }, { "J", 1 }, { "K", 4 }, { "k", 4 }, { "l", 2 }, { "m", 2 }, { "M", 1 }, { "MP", 1 }, { "n", 0 }, { "q", 0 }, { "Q", 0 }, { "re", 4 }, { "RG", 3 }, { "rg", 3 }, { "ri", 1 }, { "s", 0 }, { "S", 0 }, { "SC", -1 }, { "sc", -1 }, { "SCN", -1 }, { "scn", -1 }, { "sh", 1 }, // T* { "Tc", 1}, { "Td", 2}, { "TD", 2}, { "Tf", 1}, { "Tj", 1}, { "TJ", 1}, { "TL", 1}, { "Tm", 6}, { "Tr", 1}, { "Ts", 1}, { "Tw", 1}, { "Tz", 1}, { "v", 4 }, { "w", 1 }, { "W", 0 }, { "W*", 0 }, { "y", 4 }, // ' // " }; void PDFDataset::InitMapOperators() { for(size_t i=0;i<sizeof(asPDFOperators) / sizeof(asPDFOperators[0]); i++) oMapOperators[asPDFOperators[i].szOpName] = asPDFOperators[i].nArgs; } /************************************************************************/ /* TestCapability() */ /************************************************************************/ int PDFDataset::TestCapability( CPL_UNUSED const char * pszCap ) { return FALSE; } /************************************************************************/ /* GetLayer() */ /************************************************************************/ OGRLayer *PDFDataset::GetLayer( int iLayer ) { OpenVectorLayers(nullptr); if (iLayer < 0 || iLayer >= nLayers) return nullptr; return papoLayers[iLayer]; } /************************************************************************/ /* GetLayerCount() */ /************************************************************************/ int PDFDataset::GetLayerCount() { OpenVectorLayers(nullptr); return nLayers; } /************************************************************************/ /* ExploreTree() */ /************************************************************************/ void PDFDataset::ExploreTree(GDALPDFObject* poObj, std::set< std::pair<int,int> > aoSetAlreadyVisited, int nRecLevel) {
{ "pile_set_name": "Github" }
null
null
package com.mossle.cms.persistence.manager; import com.mossle.cms.persistence.domain.CommentVoter; import com.mossle.core.hibernate.HibernateEntityDao; import org.springframework.stereotype.Service; @Service public class CommentVoterManager extends HibernateEntityDao<CommentVoter> { }
{ "pile_set_name": "Github" }
null
null
# SPDX-License-Identifier: Apache-2.0 if(DEFINED TOOLCHAIN_HOME) set(find_program_clang_args PATHS ${TOOLCHAIN_HOME} NO_DEFAULT_PATH) endif() find_program(CMAKE_C_COMPILER clang ${find_program_clang_args})
{ "pile_set_name": "Github" }
null
null
// boost integer.hpp header file -------------------------------------------// // Copyright Beman Dawes and Daryle Walker 1999. 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/integer for documentation. // Revision History // 22 Sep 01 Added value-based integer templates. (Daryle Walker) // 01 Apr 01 Modified to use new <boost/limits.hpp> header. (John Maddock) // 30 Jul 00 Add typename syntax fix (Jens Maurer) // 28 Aug 99 Initial version #ifndef BOOST_INTEGER_HPP #define BOOST_INTEGER_HPP #include <boost/integer_fwd.hpp> // self include #include <boost/integer_traits.hpp> // for boost::::boost::integer_traits #include <boost/limits.hpp> // for ::std::numeric_limits #include <boost/cstdint.hpp> // for boost::int64_t and BOOST_NO_INTEGRAL_INT64_T #include <boost/static_assert.hpp> // // We simply cannot include this header on gcc without getting copious warnings of the kind: // // boost/integer.hpp:77:30: warning: use of C99 long long integer constant // // And yet there is no other reasonable implementation, so we declare this a system header // to suppress these warnings. // #if defined(__GNUC__) && (__GNUC__ >= 4) #pragma GCC system_header #endif namespace boost { // Helper templates ------------------------------------------------------// // fast integers from least integers // int_fast_t<> works correctly for unsigned too, in spite of the name. template< typename LeastInt > struct int_fast_t { typedef LeastInt fast; typedef fast type; }; // imps may specialize namespace detail{ // convert category to type template< int Category > struct int_least_helper {}; // default is empty template< int Category > struct uint_least_helper {}; // default is empty // specializatons: 1=long, 2=int, 3=short, 4=signed char, // 6=unsigned long, 7=unsigned int, 8=unsigned short, 9=unsigned char // no specializations for 0 and 5: requests for a type > long are in error #ifdef BOOST_HAS_LONG_LONG template<> struct int_least_helper<1> { typedef boost::long_long_type least; }; #elif defined(BOOST_HAS_MS_INT64) template<> struct int_least_helper<1> { typedef __int64 least; }; #endif template<> struct int_least_helper<2> { typedef long least; }; template<> struct int_least_helper<3> { typedef int least; }; template<> struct int_least_helper<4> { typedef short least; }; template<> struct int_least_helper<5> { typedef signed char least; }; #ifdef BOOST_HAS_LONG_LONG template<> struct uint_least_helper<1> { typedef boost::ulong_long_type least; }; #elif defined(BOOST_HAS_MS_INT64) template<> struct uint_least_helper<1> { typedef unsigned __int64 least; }; #endif template<> struct uint_least_helper<2> { typedef unsigned long least; }; template<> struct uint_least_helper<3> { typedef unsigned int least; }; template<> struct uint_least_helper<4> { typedef unsigned short least; }; template<> struct uint_least_helper<5> { typedef unsigned char least; }; template <int Bits> struct exact_signed_base_helper{}; template <int Bits> struct exact_unsigned_base_helper{}; template <> struct exact_signed_base_helper<sizeof(signed char)* CHAR_BIT> { typedef signed char exact; }; template <> struct exact_unsigned_base_helper<sizeof(unsigned char)* CHAR_BIT> { typedef unsigned char exact; }; #if USHRT_MAX != UCHAR_MAX template <> struct exact_signed_base_helper<sizeof(short)* CHAR_BIT> { typedef short exact; }; template <> struct exact_unsigned_base_helper<sizeof(unsigned short)* CHAR_BIT> { typedef unsigned short exact; }; #endif #if UINT_MAX != USHRT_MAX template <> struct exact_signed_base_helper<sizeof(int)* CHAR_BIT> { typedef int exact; }; template <> struct exact_unsigned_base_helper<sizeof(unsigned int)* CHAR_BIT> { typedef unsigned int exact; }; #endif #if ULONG_MAX != UINT_MAX && ( !defined __TI_COMPILER_VERSION__ || \ ( __TI_COMPILER_VERSION__ >= 7000000 && !defined __TI_40BIT_LONG__ ) ) template <> struct exact_signed_base_helper<sizeof(long)* CHAR_BIT> { typedef long exact; }; template <> struct exact_unsigned_base_helper<sizeof(unsigned long)* CHAR_BIT> { typedef unsigned long exact; }; #endif #if defined(BOOST_HAS_LONG_LONG) &&\ ((defined(ULLONG_MAX) && (ULLONG_MAX != ULONG_MAX)) ||\ (defined(ULONG_LONG_MAX) && (ULONG_LONG_MAX != ULONG_MAX)) ||\ (defined(ULONGLONG_MAX) && (ULONGLONG_MAX != ULONG_MAX)) ||\ (defined(_ULLONG_MAX) && (_ULLONG_MAX != ULONG_MAX))) template <> struct exact_signed_base_helper<sizeof(boost::long_long_type)* CHAR_BIT> { typedef boost::long_long_type exact; }; template <> struct exact_unsigned_base_helper<sizeof(boost::ulong_long_type)* CHAR_BIT> { typedef boost::ulong_long_type exact; }; #endif } // namespace detail // integer templates specifying number of bits ---------------------------// // signed template< int Bits > // bits (including sign) required struct int_t : public boost::detail::exact_signed_base_helper<Bits> { BOOST_STATIC_ASSERT_MSG(Bits <= (int)(sizeof(boost::intmax_t) * CHAR_BIT), "No suitable signed integer type with the requested number of bits is available."); typedef typename boost::detail::int_least_helper < #ifdef BOOST_HAS_LONG_LONG (Bits <= (int)(sizeof(boost::long_long_type) * CHAR_BIT)) + #else 1 + #endif (Bits-1 <= ::std::numeric_limits<long>::digits) + (Bits-1 <= ::std::numeric_limits<int>::digits) + (Bits-1 <= ::std::numeric_limits<short>::digits) + (Bits-1 <= ::std::numeric_limits<signed char>::digits) >::least least; typedef typename int_fast_t<least>::type fast; }; // unsigned template< int Bits > // bits required struct uint_t : public boost::detail::exact_unsigned_base_helper<Bits> { BOOST_STATIC_ASSERT_MSG(Bits <= (int)(sizeof(boost::uintmax_t) * CHAR_BIT), "No suitable unsigned integer type with the requested number of bits is available."); #if (defined(__BORLANDC__) || defined(__CODEGEAR__)) && defined(BOOST_NO_INTEGRAL_INT64_T) // It's really not clear why this workaround should be needed... shrug I guess! JM BOOST_STATIC_CONSTANT(int, s = 6 + (Bits <= ::std::numeric_limits<unsigned long>::digits) + (Bits <= ::std::numeric_limits<unsigned int>::digits) + (Bits <= ::std::numeric_limits<unsigned short>::digits) + (Bits <= ::std::numeric_limits<unsigned char>::digits)); typedef typename detail::int_least_helper< ::boost::uint_t<Bits>::s>::least least;
{ "pile_set_name": "Github" }
null
null
// SPDX-License-Identifier: GPL-2.0 /* * Miscellaneous character driver for ChromeOS Embedded Controller * * Copyright 2014 Google, Inc. * Copyright 2019 Google LLC * * This file is a rework and part of the code is ported from * drivers/mfd/cros_ec_dev.c that was originally written by * Bill Richardson. */ #include <linux/init.h> #include <linux/device.h> #include <linux/fs.h> #include <linux/miscdevice.h> #include <linux/module.h> #include <linux/notifier.h> #include <linux/platform_data/cros_ec_chardev.h> #include <linux/platform_data/cros_ec_commands.h> #include <linux/platform_data/cros_ec_proto.h> #include <linux/platform_device.h> #include <linux/poll.h> #include <linux/slab.h> #include <linux/types.h> #include <linux/uaccess.h> #define DRV_NAME "cros-ec-chardev" /* Arbitrary bounded size for the event queue */ #define CROS_MAX_EVENT_LEN PAGE_SIZE struct chardev_data { struct cros_ec_dev *ec_dev; struct miscdevice misc; }; struct chardev_priv { struct cros_ec_dev *ec_dev; struct notifier_block notifier; wait_queue_head_t wait_event; unsigned long event_mask; struct list_head events; size_t event_len; }; struct ec_event { struct list_head node; size_t size; u8 event_type; u8 data[]; }; static int ec_get_version(struct cros_ec_dev *ec, char *str, int maxlen) { static const char * const current_image_name[] = { "unknown", "read-only", "read-write", "invalid", }; struct ec_response_get_version *resp; struct cros_ec_command *msg; int ret; msg = kzalloc(sizeof(*msg) + sizeof(*resp), GFP_KERNEL); if (!msg) return -ENOMEM; msg->command = EC_CMD_GET_VERSION + ec->cmd_offset; msg->insize = sizeof(*resp); ret = cros_ec_cmd_xfer_status(ec->ec_dev, msg); if (ret < 0) { snprintf(str, maxlen, "Unknown EC version, returned error: %d\n", msg->result); goto exit; } resp = (struct ec_response_get_version *)msg->data; if (resp->current_image >= ARRAY_SIZE(current_image_name)) resp->current_image = 3; /* invalid */ snprintf(str, maxlen, "%s\n%s\n%s\n%s\n", CROS_EC_DEV_VERSION, resp->version_string_ro, resp->version_string_rw, current_image_name[resp->current_image]); ret = 0; exit: kfree(msg); return ret; } static int cros_ec_chardev_mkbp_event(struct notifier_block *nb, unsigned long queued_during_suspend, void *_notify) { struct chardev_priv *priv = container_of(nb, struct chardev_priv, notifier); struct cros_ec_device *ec_dev = priv->ec_dev->ec_dev; struct ec_event *event; unsigned long event_bit = 1 << ec_dev->event_data.event_type; int total_size = sizeof(*event) + ec_dev->event_size; if (!(event_bit & priv->event_mask) || (priv->event_len + total_size) > CROS_MAX_EVENT_LEN) return NOTIFY_DONE; event = kzalloc(total_size, GFP_KERNEL); if (!event) return NOTIFY_DONE; event->size = ec_dev->event_size; event->event_type = ec_dev->event_data.event_type; memcpy(event->data, &ec_dev->event_data.data, ec_dev->event_size); spin_lock(&priv->wait_event.lock); list_add_tail(&event->node, &priv->events); priv->event_len += total_size; wake_up_locked(&priv->wait_event); spin_unlock(&priv->wait_event.lock); return NOTIFY_OK; } static struct ec_event *cros_ec_chardev_fetch_event(struct chardev_priv *priv, bool fetch, bool block) { struct ec_event *event; int err; spin_lock(&priv->wait_event.lock); if (!block && list_empty(&priv->events)) { event = ERR_PTR(-EWOULDBLOCK); goto out; } if (!fetch) { event = NULL; goto out; } err = wait_event_interruptible_locked(priv->wait_event, !list_empty(&priv->events)); if (err) { event = ERR_PTR(err); goto out; } event = list_first_entry(&priv->events, struct ec_event, node); list_del(&event->node); priv->event_len -= sizeof(*event) + event->size; out: spin_unlock(&priv->wait_event.lock); return event; } /* * Device file ops */ static int cros_ec_chardev_open(struct inode *inode, struct file *filp) { struct miscdevice *mdev = filp->private_data; struct cros_ec_dev *ec_dev = dev_get_drvdata(mdev->parent); struct chardev_priv *priv; int ret; priv = kzalloc(sizeof(*priv), GFP_KERNEL); if (!priv) return -ENOMEM; priv->ec_dev = ec_dev; filp->private_data = priv; INIT_LIST_HEAD(&priv->events); init_waitqueue_head(&priv->wait_event); nonseekable_open(inode, filp); priv->notifier.notifier_call = cros_ec_chardev_mkbp_event; ret = blocking_notifier_chain_register(&ec_dev->ec_dev->event_notifier, &priv->notifier); if (ret) { dev_err(ec_dev->dev, "failed to register event notifier\n"); kfree(priv); } return ret; } static __poll_t cros_ec_chardev_poll(struct file *filp, poll_table *wait) { struct chardev_priv *priv = filp->private_data; poll_wait(filp, &priv->wait_event, wait); if (list_empty(&priv->events)) return 0; return EPOLLIN | EPOLLRDNORM; } static ssize_t cros_ec_chardev_read(struct file *filp, char __user *buffer, size_t length, loff_t *offset) { char msg[sizeof(struct ec_response_get_version) + sizeof(CROS_EC_DEV_VERSION)]; struct chardev_priv *priv = filp->private_data; struct cros_ec_dev *ec_dev = priv->ec_dev; size_t count; int ret; if (priv->event_mask) { /* queued MKBP event */ struct ec_event *event; event = cros_ec_chardev_fetch_event(priv, length != 0, !(filp->f_flags & O_NONBLOCK)); if (IS_ERR(event)) return PTR_ERR(event); /* * length == 0 is special - no IO is
{ "pile_set_name": "Github" }
null
null
// // Copyright (c) 2020 Amer Koleci and contributors. // // Permission is hereby granted, free of charge, to any person obtaining a copy // of this software and associated documentation files (the "Software"), to deal // in the Software without restriction, including without limitation the rights // to use, copy, modify, merge, publish, distribute, sublicense, and/or sell // copies of the Software, and to permit persons to whom the Software is // furnished to do so, subject to the following conditions: // // The above copyright notice and this permission notice shall be included in // all copies or substantial portions of the Software. // // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, // FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE // AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, // OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN // THE SOFTWARE. // #include "VulkanTexture.h" #include "VulkanGraphicsDevice.h" namespace Alimer { VulkanTexture::VulkanTexture(VulkanGraphicsDevice* device, const TextureDescription& desc, VkImage handle_, VkImageLayout layout) : Texture(desc) , device{ device } , layout{ layout } { if (handle_ != VK_NULL_HANDLE) { handle = handle_; allocation = VK_NULL_HANDLE; } else { VkImageCreateInfo createInfo{ VK_STRUCTURE_TYPE_IMAGE_CREATE_INFO }; createInfo.flags = 0u; createInfo.imageType = VK_IMAGE_TYPE_2D; createInfo.format = VK_FORMAT_R8G8B8A8_UNORM; // GetVkFormat(desc->format); createInfo.extent.width = desc.width; createInfo.extent.height = desc.height; createInfo.extent.depth = desc.depth; createInfo.mipLevels = desc.mipLevels; createInfo.arrayLayers = desc.arrayLayers; createInfo.samples = VK_SAMPLE_COUNT_1_BIT; createInfo.tiling = VK_IMAGE_TILING_OPTIMAL; createInfo.usage = VK_IMAGE_USAGE_SAMPLED_BIT; // vgpu_vkGetImageUsage(desc->usage, desc->format); createInfo.sharingMode = VK_SHARING_MODE_EXCLUSIVE; createInfo.queueFamilyIndexCount = 0; createInfo.pQueueFamilyIndices = nullptr; createInfo.initialLayout = VK_IMAGE_LAYOUT_UNDEFINED; VmaAllocationCreateInfo allocCreateInfo = {}; allocCreateInfo.usage = VMA_MEMORY_USAGE_GPU_ONLY; VkResult result = vmaCreateImage(device->GetAllocator(), &createInfo, &allocCreateInfo, &handle, &allocation, nullptr); if (result != VK_SUCCESS) { LOGE("Vulkan: Failed to create image"); } } } VulkanTexture::~VulkanTexture() { Destroy(); } void VulkanTexture::Destroy() { if (handle != VK_NULL_HANDLE && allocation != VK_NULL_HANDLE) { //unmap(); //vmaDestroyImage(device->GetAllocator(), handle, allocation); } } void VulkanTexture::BackendSetName() { device->SetObjectName(VK_OBJECT_TYPE_IMAGE, (uint64_t)handle, name); } void VulkanTexture::Barrier(VkCommandBuffer commandBuffer, VkImageLayout newLayout) { if (layout == newLayout) return; VkImageMemoryBarrier imageMemoryBarrier{ VK_STRUCTURE_TYPE_IMAGE_MEMORY_BARRIER }; imageMemoryBarrier.srcQueueFamilyIndex = VK_QUEUE_FAMILY_IGNORED; imageMemoryBarrier.dstQueueFamilyIndex = VK_QUEUE_FAMILY_IGNORED; imageMemoryBarrier.oldLayout = layout; imageMemoryBarrier.newLayout = newLayout; imageMemoryBarrier.image = handle; imageMemoryBarrier.subresourceRange.aspectMask = VK_IMAGE_ASPECT_COLOR_BIT; imageMemoryBarrier.subresourceRange.baseMipLevel = 0; imageMemoryBarrier.subresourceRange.levelCount = VK_REMAINING_MIP_LEVELS; imageMemoryBarrier.subresourceRange.baseArrayLayer = 0; imageMemoryBarrier.subresourceRange.layerCount = VK_REMAINING_ARRAY_LAYERS; // Source layouts (old) // Source access mask controls actions that have to be finished on the old layout // before it will be transitioned to the new layout switch (layout) { case VK_IMAGE_LAYOUT_UNDEFINED: // Image layout is undefined (or does not matter) // Only valid as initial layout // No flags required, listed only for completeness imageMemoryBarrier.srcAccessMask = 0; break; case VK_IMAGE_LAYOUT_PREINITIALIZED: // Image is preinitialized // Only valid as initial layout for linear images, preserves memory contents // Make sure host writes have been finished imageMemoryBarrier.srcAccessMask = VK_ACCESS_HOST_WRITE_BIT; break; case VK_IMAGE_LAYOUT_COLOR_ATTACHMENT_OPTIMAL: // Image is a color attachment // Make sure any writes to the color buffer have been finished imageMemoryBarrier.srcAccessMask = VK_ACCESS_COLOR_ATTACHMENT_WRITE_BIT; break; case VK_IMAGE_LAYOUT_DEPTH_STENCIL_ATTACHMENT_OPTIMAL: // Image is a depth/stencil attachment // Make sure any writes to the depth/stencil buffer have been finished imageMemoryBarrier.srcAccessMask = VK_ACCESS_DEPTH_STENCIL_ATTACHMENT_WRITE_BIT; break; case VK_IMAGE_LAYOUT_TRANSFER_SRC_OPTIMAL: // Image is a transfer source // Make sure any reads from the image have been finished imageMemoryBarrier.srcAccessMask = VK_ACCESS_TRANSFER_READ_BIT; break; case VK_IMAGE_LAYOUT_TRANSFER_DST_OPTIMAL: // Image is a transfer destination // Make sure any writes to the image have been finished imageMemoryBarrier.srcAccessMask = VK_ACCESS_TRANSFER_WRITE_BIT; break; case VK_IMAGE_LAYOUT_SHADER_READ_ONLY_OPTIMAL: // Image is read by a shader // Make sure any shader reads from the image have been finished imageMemoryBarrier.srcAccessMask = VK_ACCESS_SHADER_READ_BIT; break; default: // Other source layouts aren't handled (yet) break; } // Target layouts (new) // Destination access mask controls the dependency for the new image layout switch (newLayout) { case VK_IMAGE_LAYOUT_TRANSFER_DST_OPTIMAL: // Image will be used as a transfer destination // Make sure any writes to the image have been finished imageMemoryBarrier.dstAccessMask = VK_ACCESS_TRANSFER_WRITE_BIT; break; case VK_IMAGE_LAYOUT_TRANSFER_SRC_OPTIMAL: // Image will be used as a transfer source // Make sure any reads from the image have been finished imageMemoryBarrier.dstAccessMask = VK_ACCESS_TRANSFER_READ_BIT; break; case VK_IMAGE_LAYOUT_COLOR_ATTACHMENT_OPTIMAL: // Image will be used as a color attachment // Make sure any writes to the color buffer have been finished imageMemoryBarrier.dstAccessMask = VK
{ "pile_set_name": "Github" }
null
null
/* * * Bluetooth low-complexity, subband codec (SBC) library * * Copyright (C) 2008-2010 Nokia Corporation * Copyright (C) 2004-2010 Marcel Holtmann <marcel@holtmann.org> * Copyright (C) 2004-2005 Henryk Ploetz <henryk@ploetzli.ch> * Copyright (C) 2005-2006 Brad Midgley <bmidgley@xmission.com> * * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2.1 of the License, or (at your option) any later version. * * This library is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA * */ #include <stdint.h> #include <limits.h> #include "sbc.h" #include "sbc_math.h" #include "sbc_tables.h" #include "sbc_primitives_neon.h" /* * ARM NEON optimizations */ #ifdef SBC_BUILD_WITH_NEON_SUPPORT static inline void _sbc_analyze_four_neon(const int16_t *in, int32_t *out, const FIXED_T *consts) { /* TODO: merge even and odd cases (or even merge all four calls to this * function) in order to have only aligned reads from 'in' array * and reduce number of load instructions */ asm volatile ( "vld1.16 {d4, d5}, [%0, :64]!\n" "vld1.16 {d8, d9}, [%1, :128]!\n" "vmull.s16 q0, d4, d8\n" "vld1.16 {d6, d7}, [%0, :64]!\n" "vmull.s16 q1, d5, d9\n" "vld1.16 {d10, d11}, [%1, :128]!\n" "vmlal.s16 q0, d6, d10\n" "vld1.16 {d4, d5}, [%0, :64]!\n" "vmlal.s16 q1, d7, d11\n" "vld1.16 {d8, d9}, [%1, :128]!\n" "vmlal.s16 q0, d4, d8\n" "vld1.16 {d6, d7}, [%0, :64]!\n" "vmlal.s16 q1, d5, d9\n" "vld1.16 {d10, d11}, [%1, :128]!\n" "vmlal.s16 q0, d6, d10\n" "vld1.16 {d4, d5}, [%0, :64]!\n" "vmlal.s16 q1, d7, d11\n" "vld1.16 {d8, d9}, [%1, :128]!\n" "vmlal.s16 q0, d4, d8\n" "vmlal.s16 q1, d5, d9\n" "vpadd.s32 d0, d0, d1\n" "vpadd.s32 d1, d2, d3\n" "vrshrn.s32 d0, q0, %3\n" "vld1.16 {d2, d3, d4, d5}, [%1, :128]!\n" "vdup.i32 d1, d0[1]\n" /* TODO: can be eliminated */ "vdup.i32 d0, d0[0]\n" /* TODO: can be eliminated */ "vmull.s16 q3, d2, d0\n" "vmull.s16 q4, d3, d0\n" "vmlal.s16 q3, d4, d1\n" "vmlal.s16 q4, d5, d1\n" "vpadd.s32 d0, d6, d7\n" /* TODO: can be eliminated */ "vpadd.s32 d1, d8, d9\n" /* TODO: can be eliminated */ "vst1.32 {d0, d1}, [%2, :128]\n" : "+r" (in), "+r" (consts) : "r" (out), "i" (SBC_PROTO_FIXED4_SCALE) : "memory", "d0", "d1", "d2", "d3", "d4", "d5", "d6", "d7", "d8", "d9", "d10", "d11"); } static inline void _sbc_analyze_eight_neon(const int16_t *in, int32_t *out, const FIXED_T *consts) { /* TODO: merge even and odd cases (or even merge all four calls to this * function) in order to have only aligned reads from 'in' array * and reduce number of load instructions */ asm volatile ( "vld1.16 {d4, d5}, [%0, :64]!\n" "vld1.16 {d8, d9}, [%1, :128]!\n" "vmull.s16 q6, d4, d8\n" "vld1.16 {d6, d7}, [%0, :64]!\n" "vmull.s16 q7, d5, d9\n" "vld1.16 {d10, d11}, [%1, :128]!\n" "vmull.s16 q8, d6, d10\n" "vld1.16 {d4, d5}, [%0, :64]!\n" "vmull.s16 q9, d7, d11\n" "vld1.16 {d8, d9}, [%1, :128]!\n" "vmlal.s16 q6, d4, d8\n" "vld1.16 {d6, d7}, [%0, :64]!\n" "vmlal.s16 q7, d5, d9\n" "vld1.16 {d10, d11}, [%1, :128]!\n" "vmlal.s16 q8, d6, d10\n" "vld1.16 {d4, d5}, [%0, :64]!\n" "vmlal.s16 q9, d7, d11\n" "vld1.16 {d8, d9}, [%1, :128]!\n" "vmlal.s16 q6, d4, d8\n" "vld1.16 {d6, d7}, [%0, :64]!\n" "vmlal.s16 q7, d5, d9\n" "vld1.16 {d10, d11}, [%1, :128]!\n" "vmlal.s16 q8, d6, d10\n" "vld1.16 {d4, d5}, [%0, :64]!\n" "vmlal.s16 q9,
{ "pile_set_name": "Github" }
null
null
/*************************************************** This is an example sketch for our optical Fingerprint sensor Designed specifically to work with the Adafruit Fingerprint sensor ----> http://www.adafruit.com/products/751 These displays use TTL Serial to communicate, 2 pins are required to interface Adafruit invests time and resources providing this open source code, please support Adafruit and open-source hardware by purchasing products from Adafruit! Written by Limor Fried/Ladyada for Adafruit Industries. BSD license, all text above must be included in any redistribution ****************************************************/ #include <Adafruit_Fingerprint.h> #if (defined(__AVR__) || defined(ESP8266)) && !defined(__AVR_ATmega2560__) // For UNO and others without hardware serial, we must use software serial... // pin #2 is IN from sensor (GREEN wire) // pin #3 is OUT from arduino (WHITE wire) // Set up the serial port to use softwareserial.. SoftwareSerial mySerial(2, 3); #else // On Leonardo/M0/etc, others with hardware serial, use hardware serial! // #0 is green wire, #1 is white #define mySerial Serial1 #endif Adafruit_Fingerprint finger = Adafruit_Fingerprint(&mySerial); void setup() { Serial.begin(9600); while (!Serial); // For Yun/Leo/Micro/Zero/... delay(100); Serial.println("\n\nDelete Finger"); // set the data rate for the sensor serial port finger.begin(57600); if (finger.verifyPassword()) { Serial.println("Found fingerprint sensor!"); } else { Serial.println("Did not find fingerprint sensor :("); while (1); } } uint8_t readnumber(void) { uint8_t num = 0; while (num == 0) { while (! Serial.available()); num = Serial.parseInt(); } return num; } void loop() // run over and over again { Serial.println("Please type in the ID # (from 1 to 127) you want to delete..."); uint8_t id = readnumber(); if (id == 0) {// ID #0 not allowed, try again! return; } Serial.print("Deleting ID #"); Serial.println(id); deleteFingerprint(id); } uint8_t deleteFingerprint(uint8_t id) { uint8_t p = -1; p = finger.deleteModel(id); if (p == FINGERPRINT_OK) { Serial.println("Deleted!"); } else if (p == FINGERPRINT_PACKETRECIEVEERR) { Serial.println("Communication error"); return p; } else if (p == FINGERPRINT_BADLOCATION) { Serial.println("Could not delete in that location"); return p; } else if (p == FINGERPRINT_FLASHERR) { Serial.println("Error writing to flash"); return p; } else { Serial.print("Unknown error: 0x"); Serial.println(p, HEX); return p; } }
{ "pile_set_name": "Github" }
null
null
<?xml version="1.0" encoding="iso-8859-1"?> <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "DTD/xhtml1-strict.dtd"> <html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en"> <!-- qtsingleapplication-2.6_1-opensource/examples/loader/loader.qdoc --> <head> <title>Loading Documents</title> <link href="classic.css" rel="stylesheet" type="text/css" /> </head> <body> <table border="0" cellpadding="0" cellspacing="0" width="100%"> <tr> <td align="left" valign="top" width="32"><img src="images/qt-logo.png" align="left" width="57" height="67" border="0" /></td> <td width="1">&nbsp;&nbsp;</td><td class="postheader" valign="center"><a href="index.html"><font color="#004faf">Home</font></a></td> </tr></table><h1 class="title">Loading Documents<br /><span class="subtitle"></span> </h1> <p>The application in this example loads or prints the documents passed as commandline parameters to further instances of this application.</p> <pre><span class="comment"> /**************************************************************************** ** ** Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). ** All rights reserved. ** Contact: Nokia Corporation (qt-info@nokia.com) ** ** This file is part of a Qt Solutions component. ** ** Commercial Usage ** Licensees holding valid Qt Commercial licenses may use this file in ** accordance with the Qt Solutions Commercial License Agreement provided ** with the Software or, alternatively, in accordance with the terms ** contained in a written agreement between you and Nokia. ** ** GNU Lesser General Public License Usage ** Alternatively, this file may be used under the terms of the GNU Lesser ** General Public License version 2.1 as published by the Free Software ** Foundation and appearing in the file LICENSE.LGPL included in the ** packaging of this file. Please review the following information to ** ensure the GNU Lesser General Public License version 2.1 requirements ** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. ** ** In addition, as a special exception, Nokia gives you certain ** additional rights. These rights are described in the Nokia Qt LGPL ** Exception version 1.1, included in the file LGPL_EXCEPTION.txt in this ** package. ** ** GNU General Public License Usage ** Alternatively, this file may be used under the terms of the GNU ** General Public License version 3.0 as published by the Free Software ** Foundation and appearing in the file LICENSE.GPL included in the ** packaging of this file. Please review the following information to ** ensure the GNU General Public License version 3.0 requirements will be ** met: http://www.gnu.org/copyleft/gpl.html. ** ** Please note Third Party Software included with Qt Solutions may impose ** additional restrictions and it is the user's responsibility to ensure ** that they have met the licensing requirements of the GPL, LGPL, or Qt ** Solutions Commercial license and the relevant license of the Third ** Party Software they are using. ** ** If you are unsure which license is appropriate for your use, please ** contact Nokia at qt-info@nokia.com. ** ****************************************************************************/</span> #include &lt;qtsingleapplication.h&gt; #include &lt;QtCore/QFile&gt; #include &lt;QtGui/QMainWindow&gt; #include &lt;QtGui/QPrinter&gt; #include &lt;QtGui/QPainter&gt; #include &lt;QtGui/QTextEdit&gt; #include &lt;QtGui/QMdiArea&gt; #include &lt;QtCore/QTextStream&gt; class MainWindow : public QMainWindow { Q_OBJECT public: MainWindow(); public slots: void handleMessage(const QString&amp; message); signals: void needToShow(); private: QMdiArea *workspace; };</pre> <p>The user interface in this application is a <a href="http://qt.nokia.com/doc/4.5/qmainwindow.html">QMainWindow</a> subclass with a <a href="http://qt.nokia.com/doc/4.5/qmdiarea.html">QMdiArea</a> as the central widget. It implements a slot <tt>handleMessage()</tt> that will be connected to the messageReceived() signal of the <a href="qtsingleapplication.html">QtSingleApplication</a> class.</p> <pre> MainWindow::MainWindow() { workspace = new QMdiArea(this); setCentralWidget(workspace); }</pre> <p>The <a href="http://qt.nokia.com/doc/4.5/designer-to-know.html">MainWindow</a> constructor creates a minimal user interface.</p> <pre> void MainWindow::handleMessage(const QString&amp; message) { enum Action { Nothing, Open, Print } action; action = Nothing; QString filename = message; if (message.toLower().startsWith(&quot;/print &quot;)) { filename = filename.mid(7); action = Print; } else if (!message.isEmpty()) { action = Open; } if (action == Nothing) { emit needToShow(); return; } QFile file(filename); QString contents; if (file.open(QIODevice::ReadOnly)) contents = file.readAll(); else contents = &quot;[[Error: Could not load file &quot; + filename + &quot;]]&quot;; QTextEdit *view = new QTextEdit; view-&gt;setPlainText(contents); switch(action) {</pre> <p>The handleMessage() slot interprets the message passed in as a filename that can be prepended with <i>/print</i> to indicate that the file should just be printed rather than loaded.</p> <pre> case Print: { QPrinter printer; view-&gt;print(&amp;printer); delete view; } break; case Open: { workspace-&gt;addSubWindow(view); view-&gt;setWindowTitle(message); view-&gt;show(); emit needToShow(); } break; default: break; }; }</pre> <p>Loading the file will also activate the window.</p> <pre> #include &quot;main.moc&quot; int main(int argc, char **argv) { QtSingleApplication instance(&quot;File loader QtSingleApplication example&quot;, argc, argv); QString message; for (int a = 1; a &lt; argc; ++a) { message += argv[a]; if (a &lt; argc-1) message += &quot; &quot;; } if (instance.sendMessage(message)) return 0;</pre> <p>The <tt>main</tt> entry point function creates a <a href="qtsingleapplication.html">QtSingleApplication</a> object, and creates a message to send to a running instance of the application. If the message was sent successfully the process exits immediately.</p> <pre> MainWindow mw; mw.handleMessage(message); mw.show(); QObject::connect(&amp;instance, SIGNAL(messageReceived(const QString&amp;)), &amp;mw, SLOT(handleMessage(const QString&amp;))); instance.setActivationWindow(&amp;mw, false); QObject::connect(&amp;mw, SIGNAL(needToShow()), &amp;instance, SLOT(activateWindow())); return instance.exec(); }</pre> <p>If the message could not be sent the application starts up. Note that <tt>false</tt> is passed to the call to setActivationWindow() to prevent automatic activation for every message received, e.g&#x2e; when the application should just print a file. Instead, the message handling function determines whether activation is requested, and signals that by emitting the needToShow() signal. This is
{ "pile_set_name": "Github" }
null
null
#if !defined(AFX_MYFRAME_H__C71BE42C_F09F_458C_BB9C_33FC5544FFB9__INCLUDED_) #define AFX_MYFRAME_H__C71BE42C_F09F_458C_BB9C_33FC5544FFB9__INCLUDED_ #if _MSC_VER > 1000 #pragma once #endif // _MSC_VER > 1000 // MyFrame.h : header file // #define IMAGE_WIDTH 176 #define IMAGE_HEIGHT 144 ///////////////////////////////////////////////////////////////////////////// // CMyFrame window class CMyFrame : public CStatic { // Construction public: CMyFrame(); // Attributes public: // Operations public: // Overrides // ClassWizard generated virtual function overrides //{{AFX_VIRTUAL(CMyFrame) //}}AFX_VIRTUAL // Implementation public: void DrawOneFrame(LPBITMAPINFO pInfo, LPVOID pData); virtual ~CMyFrame(); void SaveFrame(); BOOL SaveBitmapToFile(HBITMAP hBitmap , CString lpFileName); HBITMAP hBitmap; // Generated message map functions protected: //{{AFX_MSG(CMyFrame) afx_msg void OnPaint(); afx_msg BOOL OnEraseBkgnd(CDC* pDC); afx_msg void OnLButtonDblClk(UINT nFlags, CPoint point); //}}AFX_MSG DECLARE_MESSAGE_MAP() }; ///////////////////////////////////////////////////////////////////////////// //{{AFX_INSERT_LOCATION}} // Microsoft Visual C++ will insert additional declarations immediately before the previous line. #endif // !defined(AFX_MYFRAME_H__C71BE42C_F09F_458C_BB9C_33FC5544FFB9__INCLUDED_)
{ "pile_set_name": "Github" }
null
null
// Copyright 2017 ZhongAn Information Technology Services Co.,Ltd. // // 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 types import ( "errors" "fmt" "os" "path/filepath" "github.com/dappledger/AnnChain/gemmill/utils" ) var ( ErrFileNotFound = errors.New("priv_validator.json not found") ErrBranchIsUsed = errors.New("priv_validator:branch name is used") ErrPVRevertFromBackup = errors.New("priv_validator:revert from backup, not find data") ) const ( PRIV_FILE_NAME = "priv_validator.json" ) type PrivValidatorTool struct { dir string pv *PrivValidator } func (pt *PrivValidatorTool) Init(dir string) error { var err error pt.pv, err = LoadPrivValidator(dir) if err != nil { return err } if pt.pv == nil { return ErrFileNotFound } return nil } func (pt *PrivValidatorTool) backupName(branchName string) string { return fmt.Sprintf("%v/%v-%v.json", filepath.Dir(pt.pv.filePath), PRIV_FILE_NAME, branchName) } func (pt *PrivValidatorTool) BackupData(branchName string) error { bkName := pt.backupName(branchName) find, err := utils.PathExists(bkName) if err != nil { return err } if find { return ErrBranchIsUsed } preDir := pt.pv.filePath pt.pv.SetFile(bkName) pt.pv.Save() pt.pv.SetFile(preDir) return nil } func (pt *PrivValidatorTool) RevertFromBackup(branchName string) error { bkName := pt.backupName(branchName) find, err := utils.PathExists(bkName) if err != nil { return err } if !find { return ErrPVRevertFromBackup } utils.CopyFile(pt.pv.filePath, bkName) return nil } func (pt *PrivValidatorTool) DelBackup(branchName string) { os.Remove(pt.backupName(branchName)) } func (pt *PrivValidatorTool) SaveNewPrivV(toHeight int64) error { pt.pv.LastHeight = toHeight pt.pv.LastRound = 0 pt.pv.LastStep = 0 pt.pv.LastSignature = nil pt.pv.LastSignBytes = make([]byte, 0) pt.pv.Save() return nil }
{ "pile_set_name": "Github" }
null
null
from __future__ import absolute_import import cython from Cython.Plex.Actions cimport Action cdef class Scanner: cdef public lexicon cdef public stream cdef public name cdef public unicode buffer cdef public Py_ssize_t buf_start_pos cdef public Py_ssize_t next_pos cdef public Py_ssize_t cur_pos cdef public Py_ssize_t cur_line cdef public Py_ssize_t cur_line_start cdef public Py_ssize_t start_pos cdef public Py_ssize_t start_line cdef public Py_ssize_t start_col cdef public text cdef public initial_state # int? cdef public state_name cdef public list queue cdef public bint trace cdef public cur_char cdef public long input_state cdef public level @cython.locals(input_state=long) cdef next_char(self) @cython.locals(action=Action) cpdef tuple read(self) cdef tuple scan_a_token(self) cdef tuple position(self) @cython.locals(cur_pos=Py_ssize_t, cur_line=Py_ssize_t, cur_line_start=Py_ssize_t, input_state=long, next_pos=Py_ssize_t, state=dict, buf_start_pos=Py_ssize_t, buf_len=Py_ssize_t, buf_index=Py_ssize_t, trace=bint, discard=Py_ssize_t, data=unicode, buffer=unicode) cdef run_machine_inlined(self) cdef begin(self, state) cdef produce(self, value, text = *)
{ "pile_set_name": "Github" }
null
null
#import "PNAPICallBuilder.h" #import "PNStructures.h" #pragma mark Class forward @class PNAPNSModificationAPICallBuilder, PNAPNSAuditAPICallBuilder; NS_ASSUME_NONNULL_BEGIN /** * @brief APNS API call builder. * * @author Serhii Mamontov * @version 4.12.0 * @since 4.5.4 * @copyright © 2010-2019 PubNub, Inc. */ @interface PNAPNSAPICallBuilder : PNAPICallBuilder #pragma mark - APNS state manipulation /** * @brief Push notifications state manipulation API access builder block. * * @return API call configuration builder. * * @since 4.5.4 */ @property (nonatomic, readonly, strong) PNAPNSModificationAPICallBuilder * (^enable)(void); /** * @brief Push notifications state manipulation API access builder block. * * @return API call configuration builder. * * @since 4.5.4 */ @property (nonatomic, readonly, strong) PNAPNSModificationAPICallBuilder * (^disable)(void); /** * @brief Push notifications state manipulation API access builder block. * * @return API call configuration builder. * * @since 4.12.0 */ @property (nonatomic, readonly, strong) PNAPNSModificationAPICallBuilder * (^disableAll)(void); #pragma mark - APNS state audition /** * @brief Push notifications state audition API access builder block. * * @return API call configuration builder. * * @since 4.5.4 */ @property (nonatomic, readonly, strong) PNAPNSAuditAPICallBuilder * (^audit)(void); #pragma mark - @end NS_ASSUME_NONNULL_END
{ "pile_set_name": "Github" }
null
null
<?xml version="1.0" encoding="UTF-8" ?> <!-- Copyright (c) 2010 International Business Machines Corporation and others. All rights reserved. --> <!DOCTYPE ldml SYSTEM "http://www.unicode.org/repos/cldr/trunk/common/dtd/ldml.dtd"> <ldml> <identity> <version number="$Revision: 1.1 $"/> <generation date="$Date: 2009/03/24 17:39:34 $"/> <language type="et"/> </identity> </ldml>
{ "pile_set_name": "Github" }
null
null
// // AVAssetCatalogCreatorTests.swift // AVAssetCatalogCreatorTests // // Created by Angel Vasa on 23/04/16. // Copyright © 2016 Angel Vasa. All rights reserved. // import XCTest @testable import AVAssetCatalogCreator class AVAssetCatalogCreatorTests: XCTestCase { override func setUp() { super.setUp() // Put setup code here. This method is called before the invocation of each test method in the class. } override func tearDown() { // Put teardown code here. This method is called after the invocation of each test method in the class. super.tearDown() } func testExample() { // This is an example of a functional test case. // Use XCTAssert and related functions to verify your tests produce the correct results. } func testPerformanceExample() { // This is an example of a performance test case. self.measureBlock { // Put the code you want to measure the time of here. } } }
{ "pile_set_name": "Github" }
null
null
/* CacheFiles extended attribute management * * Copyright (C) 2007 Red Hat, Inc. All Rights Reserved. * Written by David Howells (dhowells@redhat.com) * * This program is free software; you can redistribute it and/or * modify it under the terms of the GNU General Public Licence * as published by the Free Software Foundation; either version * 2 of the Licence, or (at your option) any later version. */ #include <linux/module.h> #include <linux/sched.h> #include <linux/file.h> #include <linux/fs.h> #include <linux/fsnotify.h> #include <linux/quotaops.h> #include <linux/xattr.h> #include <linux/slab.h> #include "internal.h" static const char cachefiles_xattr_cache[] = XATTR_USER_PREFIX "CacheFiles.cache"; /* * check the type label on an object * - done using xattrs */ int cachefiles_check_object_type(struct cachefiles_object *object) { struct dentry *dentry = object->dentry; char type[3], xtype[3]; int ret; ASSERT(dentry); ASSERT(d_backing_inode(dentry)); if (!object->fscache.cookie) strcpy(type, "C3"); else snprintf(type, 3, "%02x", object->fscache.cookie->def->type); _enter("%p{%s}", object, type); /* attempt to install a type label directly */ ret = vfs_setxattr(dentry, cachefiles_xattr_cache, type, 2, XATTR_CREATE); if (ret == 0) { _debug("SET"); /* we succeeded */ goto error; } if (ret != -EEXIST) { pr_err("Can't set xattr on %pd [%lu] (err %d)\n", dentry, d_backing_inode(dentry)->i_ino, -ret); goto error; } /* read the current type label */ ret = vfs_getxattr(dentry, cachefiles_xattr_cache, xtype, 3); if (ret < 0) { if (ret == -ERANGE) goto bad_type_length; pr_err("Can't read xattr on %pd [%lu] (err %d)\n", dentry, d_backing_inode(dentry)->i_ino, -ret); goto error; } /* check the type is what we're expecting */ if (ret != 2) goto bad_type_length; if (xtype[0] != type[0] || xtype[1] != type[1]) goto bad_type; ret = 0; error: _leave(" = %d", ret); return ret; bad_type_length: pr_err("Cache object %lu type xattr length incorrect\n", d_backing_inode(dentry)->i_ino); ret = -EIO; goto error; bad_type: xtype[2] = 0; pr_err("Cache object %pd [%lu] type %s not %s\n", dentry, d_backing_inode(dentry)->i_ino, xtype, type); ret = -EIO; goto error; } /* * set the state xattr on a cache file */ int cachefiles_set_object_xattr(struct cachefiles_object *object, struct cachefiles_xattr *auxdata) { struct dentry *dentry = object->dentry; int ret; ASSERT(dentry); _enter("%p,#%d", object, auxdata->len); /* attempt to install the cache metadata directly */ _debug("SET #%u", auxdata->len); clear_bit(FSCACHE_COOKIE_AUX_UPDATED, &object->fscache.cookie->flags); ret = vfs_setxattr(dentry, cachefiles_xattr_cache, &auxdata->type, auxdata->len, XATTR_CREATE); if (ret < 0 && ret != -ENOMEM) cachefiles_io_error_obj( object, "Failed to set xattr with error %d", ret); _leave(" = %d", ret); return ret; } /* * update the state xattr on a cache file */ int cachefiles_update_object_xattr(struct cachefiles_object *object, struct cachefiles_xattr *auxdata) { struct dentry *dentry = object->dentry; int ret; if (!dentry) return -ESTALE; _enter("%p,#%d", object, auxdata->len); /* attempt to install the cache metadata directly */ _debug("SET #%u", auxdata->len); clear_bit(FSCACHE_COOKIE_AUX_UPDATED, &object->fscache.cookie->flags); ret = vfs_setxattr(dentry, cachefiles_xattr_cache, &auxdata->type, auxdata->len, XATTR_REPLACE); if (ret < 0 && ret != -ENOMEM) cachefiles_io_error_obj( object, "Failed to update xattr with error %d", ret); _leave(" = %d", ret); return ret; } /* * check the consistency between the backing cache and the FS-Cache cookie */ int cachefiles_check_auxdata(struct cachefiles_object *object) { struct cachefiles_xattr *auxbuf; enum fscache_checkaux validity; struct dentry *dentry = object->dentry; ssize_t xlen; int ret; ASSERT(dentry); ASSERT(d_backing_inode(dentry)); ASSERT(object->fscache.cookie->def->check_aux); auxbuf = kmalloc(sizeof(struct cachefiles_xattr) + 512, GFP_KERNEL); if (!auxbuf) return -ENOMEM; xlen = vfs_getxattr(dentry, cachefiles_xattr_cache, &auxbuf->type, 512 + 1); ret = -ESTALE; if (xlen < 1 || auxbuf->type != object->fscache.cookie->def->type) goto error; xlen--; validity = fscache_check_aux(&object->fscache, &auxbuf->data, xlen, i_size_read(d_backing_inode(dentry))); if (validity != FSCACHE_CHECKAUX_OKAY) goto error; ret = 0; error: kfree(auxbuf); return ret; } /* * check the state xattr on a cache file * - return -ESTALE if the object should be deleted */ int cachefiles_check_object_xattr(struct cachefiles_object *object, struct cachefiles_xattr *auxdata) { struct cachefiles_xattr *auxbuf; struct dentry *dentry = object->dentry; int ret; _enter("%p,#%d", object, auxdata->len); ASSERT(dentry); ASSERT(d_backing_inode(dentry)); auxbuf = kmalloc(sizeof(struct cachefiles_xattr) + 512, cachefiles_gfp); if (!auxbuf) { _leave(" = -ENOMEM"); return -ENOMEM; } /* read the current type label */ ret = vfs_getxattr(dentry, cachefiles_xattr_cache, &auxbuf->type, 512 + 1); if (ret < 0) { if (ret == -ENODATA) goto stale; /* no attribute - power went off * mid-cull? */ if (ret == -ERANGE) goto bad_type_length; cachefiles_io_error_obj(object, "Can't read xattr on %lu (err %d)",
{ "pile_set_name": "Github" }
null
null
--TEST-- Test pclose() function : usage variation --CREDITS-- Dave Kelsey <d_kelsey@uk.ibm.com> --FILE-- <?php /* Prototype : int pclose(resource fp) * Description: Close a file pointer opened by popen() * Source code: ext/standard/file.c * Alias to functions: */ echo "*** Testing pclose() : usage variation ***\n"; // Define error handler function test_error_handler($err_no, $err_msg, $filename, $linenum, $vars) { if (error_reporting() != 0) { // report non-silenced errors echo "Error: $err_no - $err_msg, $filename($linenum)\n"; } } set_error_handler('test_error_handler'); // Initialise function arguments not being substituted (if any) //get an unset variable $unset_var = 10; unset ($unset_var); // define some classes class classWithToString { public function __toString() { return "Class A object"; } } class classWithoutToString { } // heredoc string $heredoc = <<<EOT hello world EOT; // add arrays $index_array = array (1, 2, 3); $assoc_array = array ('one' => 1, 'two' => 2); //array of values to iterate over $inputs = array( // int data 'int 0' => 0, 'int 1' => 1, 'int 12345' => 12345, 'int -12345' => -2345, // float data 'float 10.5' => 10.5, 'float -10.5' => -10.5, 'float 12.3456789000e10' => 12.3456789000e10, 'float -12.3456789000e10' => -12.3456789000e10, 'float .5' => .5, // array data 'empty array' => array(), 'int indexed array' => $index_array, 'associative array' => $assoc_array, 'nested arrays' => array('foo', $index_array, $assoc_array), // null data 'uppercase NULL' => NULL, 'lowercase null' => null, // boolean data 'lowercase true' => true, 'lowercase false' =>false, 'uppercase TRUE' =>TRUE, 'uppercase FALSE' =>FALSE, // empty data 'empty string DQ' => "", 'empty string SQ' => '', // string data 'string DQ' => "string", 'string SQ' => 'string', 'mixed case string' => "sTrInG", 'heredoc' => $heredoc, // object data 'instance of classWithToString' => new classWithToString(), 'instance of classWithoutToString' => new classWithoutToString(), // undefined data 'undefined var' => @$undefined_var, // unset data 'unset var' => @$unset_var, ); // loop through each element of the array for fp foreach($inputs as $key =>$value) { echo "\n--$key--\n"; var_dump( pclose($value) ); }; ?> ===DONE=== --EXPECTF-- *** Testing pclose() : usage variation *** --int 0-- Error: 2 - pclose() expects parameter 1 to be resource, integer given, %s(%d) bool(false) --int 1-- Error: 2 - pclose() expects parameter 1 to be resource, integer given, %s(%d) bool(false) --int 12345-- Error: 2 - pclose() expects parameter 1 to be resource, integer given, %s(%d) bool(false) --int -12345-- Error: 2 - pclose() expects parameter 1 to be resource, integer given, %s(%d) bool(false) --float 10.5-- Error: 2 - pclose() expects parameter 1 to be resource, double given, %s(%d) bool(false) --float -10.5-- Error: 2 - pclose() expects parameter 1 to be resource, double given, %s(%d) bool(false) --float 12.3456789000e10-- Error: 2 - pclose() expects parameter 1 to be resource, double given, %s(%d) bool(false) --float -12.3456789000e10-- Error: 2 - pclose() expects parameter 1 to be resource, double given, %s(%d) bool(false) --float .5-- Error: 2 - pclose() expects parameter 1 to be resource, double given, %s(%d) bool(false) --empty array-- Error: 2 - pclose() expects parameter 1 to be resource, array given, %s(%d) bool(false) --int indexed array-- Error: 2 - pclose() expects parameter 1 to be resource, array given, %s(%d) bool(false) --associative array-- Error: 2 - pclose() expects parameter 1 to be resource, array given, %s(%d) bool(false) --nested arrays-- Error: 2 - pclose() expects parameter 1 to be resource, array given, %s(%d) bool(false) --uppercase NULL-- Error: 2 - pclose() expects parameter 1 to be resource, null given, %s(%d) bool(false) --lowercase null-- Error: 2 - pclose() expects parameter 1 to be resource, null given, %s(%d) bool(false) --lowercase true-- Error: 2 - pclose() expects parameter 1 to be resource, boolean given, %s(%d) bool(false) --lowercase false-- Error: 2 - pclose() expects parameter 1 to be resource, boolean given, %s(%d) bool(false) --uppercase TRUE-- Error: 2 - pclose() expects parameter 1 to be resource, boolean given, %s(%d) bool(false) --uppercase FALSE-- Error: 2 - pclose() expects parameter 1 to be resource, boolean given, %s(%d) bool(false) --empty string DQ-- Error: 2 - pclose() expects parameter 1 to be resource, string given, %s(%d) bool(false) --empty string SQ-- Error: 2 - pclose() expects parameter 1 to be resource, string given, %s(%d) bool(false) --string DQ-- Error: 2 - pclose() expects parameter 1 to be resource, string given, %s(%d) bool(false) --string SQ-- Error: 2 - pclose() expects parameter 1 to be resource, string given, %s(%d) bool(false) --mixed case string-- Error: 2 - pclose() expects parameter 1 to be resource, string given, %s(%d) bool(false) --heredoc-- Error: 2 - pclose() expects parameter 1 to be resource, string given, %s(%d) bool(false) --instance of classWithToString-- Error: 2 - pclose() expects parameter 1 to be resource, object given, %s(%d) bool(false) --instance of classWithoutToString-- Error: 2 - pclose() expects parameter 1 to be resource, object given, %s(%d) bool(false) --undefined var-- Error: 2 - pclose() expects parameter 1 to be resource, null given, %s(%d) bool(false) --unset var-- Error: 2 - pclose() expects parameter 1 to be resource, null given, %s(%d) bool(false) ===DONE===
{ "pile_set_name": "Github" }
null
null
using System; using System.Globalization; namespace NuGetGallery { [Serializable] public class EntityException : Exception { public EntityException(string message) : base(message) { } public EntityException( string message, params object[] args) : base(String.Format(CultureInfo.CurrentCulture, message, args)) { } } }
{ "pile_set_name": "Github" }
null
null
<?xml version="1.0" encoding="UTF-8"?> <monster name="Yalahari" nameDescription="a Yalahari" race="blood" experience="5" speed="200"> <health now="150" max="150" /> <look type="309" corpse="20550" /> <targetchange interval="5000" chance="8" /> <flags> <flag summonable="0" /> <flag attackable="1" /> <flag hostile="0" /> <flag illusionable="0" /> <flag convinceable="0" /> <flag pushable="0" /> <flag canpushitems="1" /> <flag canpushcreatures="0" /> <flag targetdistance="1" /> <flag staticattack="90" /> <flag runonhealth="0" /> </flags> <defenses armor="0" defense="0" /> <immunities> <immunity earth="1" /> <immunity physical="1" /> <immunity death="1" /> </immunities> <voices interval="5000" chance="11"> <voice sentence="Welcome to Yalahar, outsider." /> <voice sentence="Hail Yalahar." /> <voice sentence="You can learn a lot from us." /> <voice sentence="Our wisdom and knowledge are unequalled in this world." /> <voice sentence="That knowledge would overburden your fragile mind." /> <voice sentence="I wouldn't expect you to understand." /> <voice sentence="One day Yalahar will return to its former glory." /> </voices> </monster>
{ "pile_set_name": "Github" }
null
null
/** * MediaWiki style sheet for common core styles on interfaces * * Styles for the Monobook/Vector pattern of laying out common interfaces. * These ids/classes are not built into the system, * they are outputted by the actual MonoBook/Vector code by convention. */ /* stylelint-disable selector-class-pattern */ /* Categories */ .catlinks { border: 1px solid #a2a9b1; background-color: #f8f9fa; padding: 5px; margin-top: 1em; clear: both; } textarea { /* Support: Firefox */ /* Border rule required to override system appearance on Linux (T136415) */ border: 1px solid #c8ccd1; } .editOptions { background-color: #eaecf0; color: #202122; border: 1px solid #c8ccd1; border-top: 0; padding: 1em 1em 1.5em 1em; margin-bottom: 2em; } .usermessage { background-color: #ffce7b; border: 1px solid #ffa500; color: #000; font-weight: bold; margin: 2em 0 1em; padding: 0.5em 1em; vertical-align: middle; } #siteNotice { position: relative; text-align: center; margin: 0; } #localNotice { margin-bottom: 0.9em; } /* Sub-navigation */ #siteSub { display: none; } #contentSub, #contentSub2 { font-size: 84%; line-height: 1.2em; margin: 0 0 1.4em 1em; color: #54595d; width: auto; } span.subpages { display: block; } /** * Hide empty portlets. Controlled by mw.util.(show|hide)Portlet. * * Note: Historically this class was provided by the skins themselves but in * I2ba68122fd82a254a5ad0e45157f095508f6fa39 was moved into core to formalize * the behaviour of hidden portlets. */ .emptyPortlet { display: none; } /* Hide links which require JavaScript to work */ .client-nojs #t-print { display: none; /* T167956 */ }
{ "pile_set_name": "Github" }
null
null
import { LinearGradient } from 'expo-linear-gradient'; import React from 'react'; import { Dimensions, Image, StyleSheet, TouchableOpacity, TouchableWithoutFeedback, View, } from 'react-native'; import { connect } from 'react-redux'; import dispatch from '../../rematch/dispatch'; import Indicator from './Indicator'; // import Image from 'react-native-image-progress'; // import CircleSnail from 'react-native-progress/CircleSnail'; // indicator={CircleSnail} const ENABLE_TOUCHABLES = true; const circleSnailProps = { thickness: 1, color: '#ddd', size: 80 }; const { width, height } = Dimensions.get('window'); class Story extends React.Component { render() { const { story } = this.props; if (!ENABLE_TOUCHABLES) { return ( <View style={{ flex: 1 }}> <Image source={story.items[story.idx]} style={styles.deck} indicatorProps={circleSnailProps} /> {this.renderIndicators()} {this.renderCloseButton()} {this.renderBackButton()} </View> ); } return ( <TouchableOpacity onPress={() => { dispatch().stories.onNextItem(); }} delayPressIn={200} onPressIn={() => { dispatch().stories.pause(); }} > <View style={{ flex: 1 }}> <Image source={story.items[story.idx]} style={styles.deck} indicatorProps={circleSnailProps} /> {this.renderIndicators()} {this.renderCloseButton()} {this.renderBackButton()} </View> </TouchableOpacity> ); } renderCloseButton() { return ( <TouchableWithoutFeedback onPress={() => { dispatch().stories.dismissCarousel(); }} > <View style={styles.closeButton}> <View style={[styles.closeCross, { transform: [{ rotate: '45deg' }] }]} /> <View style={[styles.closeCross, { transform: [{ rotate: '-45deg' }] }]} /> </View> </TouchableWithoutFeedback> ); } renderIndicators() { const { story, currentDeck } = this.props; return ( <View style={styles.indicatorWrap}> <LinearGradient colors={['rgba(0,0,0,0.33)', 'transparent']} locations={[0, 0.95]} style={styles.indicatorBg} /> <View style={styles.indicators}> {story.items.map((item, i) => ( <Indicator key={i} i={i} animate={currentDeck && story.idx == i} story={story} /> ))} </View> </View> ); } renderBackButton() { const { backOpacity } = this.props; return ( <TouchableWithoutFeedback onPress={() => { dispatch().stories.onPrevItem(); }} onPressIn={() => dispatch().stories.setBackOpacity(1)} onLongPress={() => dispatch().stories.setBackOpacity(0)} > <LinearGradient colors={['rgba(0,0,0,0.33)', 'transparent']} locations={[0, 0.85]} start={[0, 0]} end={[1, 0]} style={[ styles.back, { opacity: backOpacity, }, ]} /> </TouchableWithoutFeedback> ); } } export default connect(({ stories }) => ({ ...stories }))(Story); const styles = StyleSheet.create({ deck: { width, height, backgroundColor: 'black', }, progressIndicator: { position: 'absolute', top: 0, left: 0, right: 0, bottom: 0, backgroundColor: 'white', justifyContent: 'center', alignItems: 'center', }, indicatorWrap: { position: 'absolute', top: 0, left: 0, right: 0, }, indicators: { height: 30, alignItems: 'center', paddingHorizontal: 8, flexDirection: 'row', }, indicatorBg: { position: 'absolute', top: 0, left: 0, right: 0, height: 50, }, back: { backgroundColor: 'transparent', position: 'absolute', top: 0, left: 0, bottom: 0, width: 90, }, closeButton: { position: 'absolute', top: 0, right: 0, width: 70, height: 70, zIndex: 1, }, closeCross: { position: 'absolute', top: 32, right: 8, width: 20, height: 1, backgroundColor: '#fff', }, });
{ "pile_set_name": "Github" }
null
null
--- -api-id: P:Windows.UI.Xaml.UIElement.Clip -api-type: winrt property --- <!-- Property syntax public Windows.UI.Xaml.Media.RectangleGeometry Clip { get; set; } --> # Windows.UI.Xaml.UIElement.Clip ## -description Gets or sets the [RectangleGeometry](../windows.ui.xaml.media/rectanglegeometry.md) used to define the outline of the contents of a [UIElement](uielement.md). ## -xaml-syntax ```xaml <uiElement>   <uiElement.Clip>     rectangleGeometry   </uiElement.Clip> </uiElement> ``` ## -property-value The rectangle geometry to be used for clipping area sizing. The default value is **null** (no clipping). ## -remarks The clipping geometry for UIElement.Clip in the Windows Runtime API must be a [RectangleGeometry](../windows.ui.xaml.media/rectanglegeometry.md). You can't specify a non-rectangular geometry, as is permitted in some XAML frameworks like Microsoft Silverlight. The clipped area is the "outside" of the geometry. In other words, the content that is shown (not clipped) is the area of the rectangle that is drawn with [Fill](../windows.ui.xaml.shapes/shape_fill.md) if the geometry were used as data for a [Path](../windows.ui.xaml.shapes/path.md) rather than for clipping. The clipped area is any area that falls outside the rectangle. The clipped area isn't hit-testable. ## -examples This example is simple XAML markup that specifies a Clip using an inline [RectangleGeometry](../windows.ui.xaml.media/rectanglegeometry.md) that specifies its dimensions through an attribute syntax. [!code-xaml[GeometryOvw4](../windows.ui.xaml/code/geometries_snip/csharp/GeometryOvw4.xaml#SnippetGeometryOvw4)] ## -see-also
{ "pile_set_name": "Github" }
null
null
.text .type _aesni_ctr32_ghash_6x,@function .align 32 _aesni_ctr32_ghash_6x: vmovdqu 32(%r11),%xmm2 subq $6,%rdx vpxor %xmm4,%xmm4,%xmm4 vmovdqu 0-128(%rcx),%xmm15 vpaddb %xmm2,%xmm1,%xmm10 vpaddb %xmm2,%xmm10,%xmm11 vpaddb %xmm2,%xmm11,%xmm12 vpaddb %xmm2,%xmm12,%xmm13 vpaddb %xmm2,%xmm13,%xmm14 vpxor %xmm15,%xmm1,%xmm9 vmovdqu %xmm4,16+8(%rsp) jmp .Loop6x .align 32 .Loop6x: addl $100663296,%ebx jc .Lhandle_ctr32 vmovdqu 0-32(%r9),%xmm3 vpaddb %xmm2,%xmm14,%xmm1 vpxor %xmm15,%xmm10,%xmm10 vpxor %xmm15,%xmm11,%xmm11 .Lresume_ctr32: vmovdqu %xmm1,(%r8) vpclmulqdq $0x10,%xmm3,%xmm7,%xmm5 vpxor %xmm15,%xmm12,%xmm12 vmovups 16-128(%rcx),%xmm2 vpclmulqdq $0x01,%xmm3,%xmm7,%xmm6 xorq %r12,%r12 cmpq %r14,%r15 vaesenc %xmm2,%xmm9,%xmm9 vmovdqu 48+8(%rsp),%xmm0 vpxor %xmm15,%xmm13,%xmm13 vpclmulqdq $0x00,%xmm3,%xmm7,%xmm1 vaesenc %xmm2,%xmm10,%xmm10 vpxor %xmm15,%xmm14,%xmm14 setnc %r12b vpclmulqdq $0x11,%xmm3,%xmm7,%xmm7 vaesenc %xmm2,%xmm11,%xmm11 vmovdqu 16-32(%r9),%xmm3 negq %r12 vaesenc %xmm2,%xmm12,%xmm12 vpxor %xmm5,%xmm6,%xmm6 vpclmulqdq $0x00,%xmm3,%xmm0,%xmm5 vpxor %xmm4,%xmm8,%xmm8 vaesenc %xmm2,%xmm13,%xmm13 vpxor %xmm5,%xmm1,%xmm4 andq $0x60,%r12 vmovups 32-128(%rcx),%xmm15 vpclmulqdq $0x10,%xmm3,%xmm0,%xmm1 vaesenc %xmm2,%xmm14,%xmm14 vpclmulqdq $0x01,%xmm3,%xmm0,%xmm2 leaq (%r14,%r12,1),%r14 vaesenc %xmm15,%xmm9,%xmm9 vpxor 16+8(%rsp),%xmm8,%xmm8 vpclmulqdq $0x11,%xmm3,%xmm0,%xmm3 vmovdqu 64+8(%rsp),%xmm0 vaesenc %xmm15,%xmm10,%xmm10 movbeq 88(%r14),%r13 vaesenc %xmm15,%xmm11,%xmm11 movbeq 80(%r14),%r12 vaesenc %xmm15,%xmm12,%xmm12 movq %r13,32+8(%rsp) vaesenc %xmm15,%xmm13,%xmm13 movq %r12,40+8(%rsp) vmovdqu 48-32(%r9),%xmm5 vaesenc %xmm15,%xmm14,%xmm14 vmovups 48-128(%rcx),%xmm15 vpxor %xmm1,%xmm6,%xmm6 vpclmulqdq $0x00,%xmm5,%xmm0,%xmm1 vaesenc %xmm15,%xmm9,%xmm9 vpxor %xmm2,%xmm6,%xmm6 vpclmulqdq $0x10,%xmm5,%xmm0,%xmm2 vaesenc %xmm15,%xmm10,%xmm10 vpxor %xmm3,%xmm7,%xmm7 vpclmulqdq $0x01,%xmm5,%xmm0,%xmm3 vaesenc %xmm15,%xmm11,%xmm11 vpclmulqdq $0x11,%xmm5,%xmm0,%xmm5 vmovdqu 80+8(%rsp),%xmm0 vaesenc %xmm15,%xmm12,%xmm12 vaesenc %xmm15,%xmm13,%xmm13 vpxor %xmm1,%xmm4,%xmm4 vmovdqu 64-32(%r9),%xmm1 vaesenc %xmm15,%xmm14,%xmm14 vmovups 64-128(%rcx),%xmm15 vpxor %xmm2,%xmm6,%xmm6 vpclmulqdq $0x00,%xmm1,%xmm0,%xmm2 vaesenc %xmm15,%xmm9,%xmm9 vpxor %xmm3,%xmm6,%xmm6 vpclmulqdq $0x10,%xmm1,%xmm0,%xmm3 vaesenc %xmm15,%xmm10,%xmm10 movbeq 72(%r14),%r13 vpxor %xmm5,%xmm7,%xmm7 vpclmulqdq $0x01,%xmm1,%xmm0,%xmm5 vaesenc %xmm15,%xmm11,%xmm11 movbeq 64(%r14),%r12 vpclmulqdq $0x11,%xmm1,%xmm0,%xmm1 vmovdqu 96+8(%rsp),%xmm0 vaesenc %xmm15,%xmm12,%xmm12 movq %r13,48+8(%rsp) vaesenc %xmm15,%xmm13,%xmm13 movq %r12,56+8(%rsp) vpxor %xmm2,%xmm4,%xmm4 vmovdqu 96-32(%r9),%xmm2 vaesenc %xmm15,%xmm14,%xmm14 vmovups 80-128(%rcx),%xmm15 vpxor %xmm3,%xmm6,%xmm6 vpclmulqdq $0x00,%xmm2,%xmm0,%xmm3 vaesenc %xmm15,%xmm9,%xmm9 vpxor %xmm5,%xmm6,%xmm6 vpclmulqdq $0x10,%xmm2,%xmm0,%xmm5 vaesenc %xmm15,%xmm10,%xmm10 movbeq 56(%r14),%r13 vpxor %xmm1,%xmm7,%xmm7 vpclmulqdq $0x01,%xmm2,%xmm0,%xmm1 vpxor 112+8(%rsp),%xmm8,%xmm8 vaesenc %xmm15,%xmm11,%xmm11 movbeq 48(%r14),%r12 vpclmulqdq $0x11,%xmm2,%xmm0,%xmm2 vaesenc %xmm15,%xmm12,%xmm12 movq %r13,64+8(%rsp) vaesenc %xmm15,%xmm13,%xmm13 movq %r12,72+8(%rsp) vpxor %xmm3,%xmm4,%xmm4 vmovdqu 112-32(%r9),%xmm3 vaesenc %xmm15,%xmm14,%xmm14 vmovups 96-128(%rcx),%xmm15 vpxor %xmm5,%xmm6,%xmm6 vpclmulqdq $0x10,%xmm3,%
{ "pile_set_name": "Github" }
null
null
<!-- Copyright 2012 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. --> <resources> <!-- These action bar item IDs (menu item IDs) are defined here for programmatic use. Normally, IDs are created using the "@+id/foo" syntax, but since these IDs aren't created in menu XML, rather used for programmatically-instantiated action bar items, they are defined here. --> <item type="id" name="action_next" /> <item type="id" name="action_flip" /> </resources>
{ "pile_set_name": "Github" }
null
null
# Generated by Django 2.2.10 on 2020-05-07 09:37 from django.db import migrations, models import uuid class Migration(migrations.Migration): initial = True dependencies = [ ] operations = [ migrations.CreateModel( name='TaskInfo', fields=[ ('task_id', models.UUIDField(default=uuid.uuid4, editable=False, primary_key=True, serialize=False)), ('user_id', models.IntegerField(verbose_name='任务创建用户 ID')), ('task_name', models.CharField(max_length=255, verbose_name='任务名称')), ('task_status', models.IntegerField(default=1)), ('task_start_date', models.DateTimeField(auto_now_add=True, verbose_name='任务创建时间')), ('task_end_date', models.DateTimeField(null=True, verbose_name='任务结束时间')), ('operation_type', models.CharField(max_length=255, verbose_name='执行操作名称')), ('operation_args', models.TextField(default='', verbose_name='执行操作参数')), ('task_msg', models.TextField(default='', verbose_name='任务执行消息')), ('is_show', models.BooleanField(default=False, verbose_name='任务是否被查看')), ('create_date', models.DateTimeField(auto_now_add=True, verbose_name='创建时间')), ('update_date', models.DateTimeField(auto_now=True, verbose_name='更新时间')), ], options={ 'db_table': 'task_info', }, ), ]
{ "pile_set_name": "Github" }
null
null
id: 0 protocol: \[\] ip_source: \[\] port_source: \[\] ip_dest: \[\] port_dest: \[\] action: deny
{ "pile_set_name": "Github" }
null
null
apiVersion: v1 appVersion: "1.0" name: flowing-retail-zeebe-simple-monitor-db version: 0.1.0
{ "pile_set_name": "Github" }
null
null
{ "parent": "builtin/generated", "textures": { "layer0": "mcpatcher/cit/potions/blank", "layer1": "mcpatcher/cit/potions/splash/farming_s" }, "display": { "thirdperson": { "rotation": [ -90, 0, 0 ], "translation": [ 0, 1, -3 ], "scale": [ 0.55, 0.55, 0.55 ] }, "firstperson": { "rotation": [ 0, -135, 25 ], "translation": [ 0, 4, 2 ], "scale": [ 1.7, 1.7, 1.7 ] } } }
{ "pile_set_name": "Github" }
null
null
'use strict' // When writing files on Windows, translate the characters to their // 0xf000 higher-encoded versions. const raw = [ '|', '<', '>', '?', ':' ] const win = raw.map(char => String.fromCharCode(0xf000 + char.charCodeAt(0))) const toWin = new Map(raw.map((char, i) => [char, win[i]])) const toRaw = new Map(win.map((char, i) => [char, raw[i]])) module.exports = { encode: s => raw.reduce((s, c) => s.split(c).join(toWin.get(c)), s), decode: s => win.reduce((s, c) => s.split(c).join(toRaw.get(c)), s) }
{ "pile_set_name": "Github" }
null
null
import common.Node; import common.TreeNode; // https://leetcode-cn.com/problems/longest-arithmetic-subsequence-of-given-difference/ /** * Definition for a binary tree node. * public class TreeNode { * int val; * TreeNode left; * TreeNode right; * TreeNode(int x) { val = x; } * } */ class L1218_Longest_Arithmetic_Subsequence_of_Given_Difference { public TreeNode lcaDeepestLeaves(TreeNode root) { if (root == null) { return null; } int left = depth(root.left); int right = depth(root.right); if (left == right) { return root; } return left > right ? lcaDeepestLeaves(root.left) : lcaDeepestLeaves(root.right); } private int depth(TreeNode root) { if (root == null) { return 0; } int left = depth(root.left); int right = depth(root.right); return Math.max(left, right) + 1; } }
{ "pile_set_name": "Github" }
null
null
#include "inmemorysessionstore.h" #include "state/LocalStorageProtocol.pb.h" #include <iostream> #include <vector> InMemorySessionStore::InMemorySessionStore() { } SessionRecord *InMemorySessionStore::loadSession(uint64_t recipientId, int deviceId) { SessionsKeyPair key(recipientId, deviceId); if (sessions.find(key) != sessions.end()) { return new SessionRecord(sessions.at(key)); } else { return new SessionRecord(); } } std::vector<int> InMemorySessionStore::getSubDeviceSessions(uint64_t recipientId) { std::vector<int> deviceIds; for (auto it: sessions) { if (it.first.first == recipientId) { deviceIds.push_back(it.first.second); } } return deviceIds; } void InMemorySessionStore::storeSession(uint64_t recipientId, int deviceId, SessionRecord *record) { SessionsKeyPair key(recipientId, deviceId); ByteArray serialized = record->serialize(); sessions.emplace(key, serialized); } bool InMemorySessionStore::containsSession(uint64_t recipientId, int deviceId) { SessionsKeyPair key(recipientId, deviceId); return sessions.find(key) != sessions.end(); } void InMemorySessionStore::deleteSession(uint64_t recipientId, int deviceId) { SessionsKeyPair key(recipientId, deviceId); sessions.erase(key); } void InMemorySessionStore::deleteAllSessions(uint64_t recipientId) { bool modified; do { modified = false; for (auto & key: sessions) { if (key.first.first == recipientId) { sessions.erase(key.first); modified = true; break; } } } while (modified); }
{ "pile_set_name": "Github" }
null
null
<?xml version="1.0"?> <!DOCTYPE suppressions PUBLIC "-//Puppy Crawl//DTD Suppressions 1.0//EN" "http://www.puppycrawl.com/dtds/suppressions_1_0.dtd"> <suppressions> <suppress checks="MemberName" files="AccessTokenResponse.java" lines="1-9999"/> <suppress checks="MethodName" files="AccessTokenResponse.java" lines="1-9999"/> <suppress checks="MemberName" files="IdToken.java" lines="1-9999"/> <suppress checks="MethodName" files="IdToken.java" lines="1-9999"/> </suppressions>
{ "pile_set_name": "Github" }
null
null
<!DOCTYPE html> <html lang="en"> <head> <title>Schedule Typescript Component</title> <meta charset="utf-8" /> <meta name="viewport" content="width=device-width, initial-scale=1.0, user-scalable=no" /> <meta name="description" content="Typescript UI Controls" /> <meta name="author" content="Syncfusion" /> <link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/css/bootstrap.min.css" /> <link rel="stylesheet" href="../css/material.css" /> <script data-main="views" src="../../node_modules/requirejs/require.js"></script> <script src="require.config.js"></script> </head> <body> <div class="container-fluid" style="margin-top:15px;"> <div class="row"> <div class="col-md-12"> <div id="schedule"> </div> </div> </div> </div> </body> </html>
{ "pile_set_name": "Github" }
null
null
/********************************************************************* * NAN - Native Abstractions for Node.js * * Copyright (c) 2015 NAN contributors * * MIT License <https://github.com/rvagg/nan/blob/master/LICENSE.md> ********************************************************************/ #ifndef NAN_IMPLEMENTATION_12_INL_H_ #define NAN_IMPLEMENTATION_12_INL_H_ //============================================================================== // node v0.11 implementation //============================================================================== #if defined(_MSC_VER) # pragma warning( disable : 4530 ) # include <string> # pragma warning( default : 4530 ) #else # include <string> #endif namespace NanIntern { //=== Array ==================================================================== Factory<v8::Array>::return_t Factory<v8::Array>::New() { return v8::Array::New(v8::Isolate::GetCurrent()); } Factory<v8::Array>::return_t Factory<v8::Array>::New(int length) { return v8::Array::New(v8::Isolate::GetCurrent(), length); } //=== Boolean ================================================================== Factory<v8::Boolean>::return_t Factory<v8::Boolean>::New(bool value) { return v8::Boolean::New(v8::Isolate::GetCurrent(), value); } //=== Boolean Object =========================================================== Factory<v8::BooleanObject>::return_t Factory<v8::BooleanObject>::New(bool value) { return v8::BooleanObject::New(value).As<v8::BooleanObject>(); } //=== Context ================================================================== Factory<v8::Context>::return_t Factory<v8::Context>::New( v8::ExtensionConfiguration* extensions , v8::Handle<v8::ObjectTemplate> tmpl , v8::Handle<v8::Value> obj) { return v8::Context::New(v8::Isolate::GetCurrent(), extensions, tmpl, obj); } //=== Date ===================================================================== Factory<v8::Date>::return_t Factory<v8::Date>::New(double value) { return v8::Date::New(v8::Isolate::GetCurrent(), value).As<v8::Date>(); } //=== External ================================================================= Factory<v8::External>::return_t Factory<v8::External>::New(void * value) { return v8::External::New(v8::Isolate::GetCurrent(), value); } //=== Function ================================================================= Factory<v8::Function>::return_t Factory<v8::Function>::New( NanFunctionCallback callback , v8::Handle<v8::Value> data) { return v8::Function::New( v8::Isolate::GetCurrent() , callback , data); } //=== Function Template ======================================================== Factory<v8::FunctionTemplate>::return_t Factory<v8::FunctionTemplate>::New( NanFunctionCallback callback , v8::Handle<v8::Value> data , v8::Handle<v8::Signature> signature) { return v8::FunctionTemplate::New( v8::Isolate::GetCurrent() , callback , data , signature); } //=== Number =================================================================== Factory<v8::Number>::return_t Factory<v8::Number>::New(double value) { return v8::Number::New(v8::Isolate::GetCurrent(), value); } //=== Number Object ============================================================ Factory<v8::NumberObject>::return_t Factory<v8::NumberObject>::New(double value) { return v8::NumberObject::New( v8::Isolate::GetCurrent() , value).As<v8::NumberObject>(); } //=== Integer, Int32 and Uint32 ================================================ template <typename T> typename IntegerFactory<T>::return_t IntegerFactory<T>::New(int32_t value) { return To<T>(T::New(v8::Isolate::GetCurrent(), value)); } template <typename T> typename IntegerFactory<T>::return_t IntegerFactory<T>::New(uint32_t value) { return To<T>(T::NewFromUnsigned(v8::Isolate::GetCurrent(), value)); } Factory<v8::Uint32>::return_t Factory<v8::Uint32>::New(int32_t value) { return To<v8::Uint32>( v8::Uint32::NewFromUnsigned(v8::Isolate::GetCurrent(), value)); } Factory<v8::Uint32>::return_t Factory<v8::Uint32>::New(uint32_t value) { return To<v8::Uint32>( v8::Uint32::NewFromUnsigned(v8::Isolate::GetCurrent(), value)); } //=== Object =================================================================== Factory<v8::Object>::return_t Factory<v8::Object>::New() { return v8::Object::New(v8::Isolate::GetCurrent()); } //=== Object Template ========================================================== Factory<v8::ObjectTemplate>::return_t Factory<v8::ObjectTemplate>::New() { return v8::ObjectTemplate::New(v8::Isolate::GetCurrent()); } //=== RegExp =================================================================== Factory<v8::RegExp>::return_t Factory<v8::RegExp>::New( v8::Handle<v8::String> pattern , v8::RegExp::Flags flags) { return v8::RegExp::New(pattern, flags); } //=== Script =================================================================== Factory<v8::Script>::return_t Factory<v8::Script>::New( v8::Local<v8::String> source) { v8::ScriptCompiler::Source src(source); return v8::ScriptCompiler::Compile(v8::Isolate::GetCurrent(), &src); } Factory<v8::Script>::return_t Factory<v8::Script>::New( v8::Local<v8::String> source , v8::ScriptOrigin const& origin) { v8::ScriptCompiler::Source src(source, origin); return v8::ScriptCompiler::Compile(v8::Isolate::GetCurrent(), &src); } //=== Signature ================================================================ Factory<v8::Signature>::return_t Factory<v8::Signature>::New( Factory<v8::Signature>::FTH receiver , int argc , Factory<v8::Signature>::FTH argv[]) { return v8::Signature::New(v8::Isolate::GetCurrent(), receiver, argc, argv); } //=== String =================================================================== Factory<v8::String>::return_t Factory<v8::String>::New() { return v8::String::Empty(v8::Isolate::GetCurrent()); } Factory<v8::String>::return_t Factory<v8::String>::New(const char * value, int length) { return v8::String::NewFromUtf8(v8::Isolate::GetCurrent(), value, v8::String::kNormalString, length); } Factory<v8::String>::return_t Factory<v8::String>::New(std::string const& value) { assert(value.size() <= INT_MAX && "string too long"); return v8::String::NewFromUtf8(v8::Isolate::GetCurrent(), value.data(), v8::String::kNormalString, static_cast<int>(value.size())); } Factory<v8::String>::return_t Factory<v8::String>::New(const uint8_t * value, int length) { return v8::String::NewFromOneByte(v8::Isolate::GetCurrent(), value, v8::String::kNormalString, length); } Factory<v8::String>::return_t Factory<v8::String>::New(const uint16_t * value, int length) { return v8::String::NewFromTwoByte(v8::Isolate::GetCurrent(), value, v8::String::kNormalString, length); } Factory<v8::String>::return_t Factory<v8::String>::New(v8::String::ExternalStringResource * value) { return v8::String::NewExternal(v8::Isolate::GetCurrent(), value); } Factory<v8
{ "pile_set_name": "Github" }
null
null
/** * Copyright (c) Microsoft Corporation. All rights reserved. * Licensed under the MIT License. See License.txt in the project root for * license information. * * Code generated by Microsoft (R) AutoRest Code Generator. */ package com.microsoft.azure.management.datafactory.v2018_06_01; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonTypeInfo; import com.fasterxml.jackson.annotation.JsonTypeName; /** * Sftp write settings. */ @JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.PROPERTY, property = "type", defaultImpl = SftpWriteSettings.class) @JsonTypeName("SftpWriteSettings") public class SftpWriteSettings extends StoreWriteSettings { /** * Specifies the timeout for writing each chunk to SFTP server. Default * value: 01:00:00 (one hour). Type: string (or Expression with resultType * string). */ @JsonProperty(value = "operationTimeout") private Object operationTimeout; /** * Upload to temporary file(s) and rename. Disable this option if your SFTP * server doesn't support rename operation. Type: boolean (or Expression * with resultType boolean). */ @JsonProperty(value = "useTempFileRename") private Object useTempFileRename; /** * Get specifies the timeout for writing each chunk to SFTP server. Default value: 01:00:00 (one hour). Type: string (or Expression with resultType string). * * @return the operationTimeout value */ public Object operationTimeout() { return this.operationTimeout; } /** * Set specifies the timeout for writing each chunk to SFTP server. Default value: 01:00:00 (one hour). Type: string (or Expression with resultType string). * * @param operationTimeout the operationTimeout value to set * @return the SftpWriteSettings object itself. */ public SftpWriteSettings withOperationTimeout(Object operationTimeout) { this.operationTimeout = operationTimeout; return this; } /** * Get upload to temporary file(s) and rename. Disable this option if your SFTP server doesn't support rename operation. Type: boolean (or Expression with resultType boolean). * * @return the useTempFileRename value */ public Object useTempFileRename() { return this.useTempFileRename; } /** * Set upload to temporary file(s) and rename. Disable this option if your SFTP server doesn't support rename operation. Type: boolean (or Expression with resultType boolean). * * @param useTempFileRename the useTempFileRename value to set * @return the SftpWriteSettings object itself. */ public SftpWriteSettings withUseTempFileRename(Object useTempFileRename) { this.useTempFileRename = useTempFileRename; return this; } }
{ "pile_set_name": "Github" }
null
null
/* SPDX-License-Identifier: GPL-2.0-only */ /* * linux/sound/soc/pxa/pxa2xx-i2s.h */ #ifndef _PXA2XX_I2S_H #define _PXA2XX_I2S_H /* I2S clock */ #define PXA2XX_I2S_SYSCLK 0 #endif
{ "pile_set_name": "Github" }
null
null
commandlinefu_id: 5243 translator: weibo: '' hide: true command: |- :!pylint -e % summary: |- check python syntax in vim
{ "pile_set_name": "Github" }
null
null
<?xml version="1.0"?> <!DOCTYPE OpenGLAPI SYSTEM "gl_API.dtd"> <!-- Note: no GLX protocol info yet. --> <OpenGLAPI> <category name="GL_ARB_texture_storage_multisample" number="141"> <function name="TexStorage2DMultisample" es2="3.1"> <param name="target" type="GLenum"/> <param name="samples" type="GLsizei"/> <param name="internalformat" type="GLenum"/> <param name="width" type="GLsizei"/> <param name="height" type="GLsizei"/> <param name="fixedsamplelocations" type="GLboolean"/> </function> <function name="TexStorage3DMultisample" es2="3.2"> <param name="target" type="GLenum"/> <param name="samples" type="GLsizei"/> <param name="internalformat" type="GLenum"/> <param name="width" type="GLsizei"/> <param name="height" type="GLsizei"/> <param name="depth" type="GLsizei"/> <param name="fixedsamplelocations" type="GLboolean"/> </function> <function name="TextureStorage2DMultisampleEXT"> <param name="texture" type="GLuint"/> <param name="target" type="GLenum"/> <param name="samples" type="GLsizei"/> <param name="internalformat" type="GLenum"/> <param name="width" type="GLsizei"/> <param name="height" type="GLsizei"/> <param name="fixedsamplelocations" type="GLboolean"/> </function> <function name="TextureStorage3DMultisampleEXT"> <param name="texture" type="GLuint"/> <param name="target" type="GLenum"/> <param name="samples" type="GLsizei"/> <param name="internalformat" type="GLenum"/> <param name="width" type="GLsizei"/> <param name="height" type="GLsizei"/> <param name="depth" type="GLsizei"/> <param name="fixedsamplelocations" type="GLboolean"/> </function> </category> </OpenGLAPI>
{ "pile_set_name": "Github" }
null
null
SUMMARY="Python signature tools" DESCRIPTION="Python function signatures from PEP362 for Python 2.6, 2.7 and 3.2+." HOMEPAGE="http://funcsigs.readthedocs.org" SOURCE_URI="https://pypi.python.org/packages/94/4a/db842e7a0545de1cdb0439bb80e6e42dfe82aaeaadd4072f2263a4fbed23/funcsigs-1.0.2.tar.gz" REVISION="2" LICENSE="Apache v2" COPYRIGHT="2013 Aaron Iles" CHECKSUM_SHA256="a7bb0f2cf3a3fd1ab2732cb49eba4252c2af4240442415b4abce3b87022a8f50" ARCHITECTURES="any" PROVIDES=" funcsigs=$portVersion " REQUIRES=" haiku " BUILD_REQUIRES=" haiku_devel " PYTHON_PACKAGES=(python python36 python3) PYTHON_VERSIONS=(2.7 3.6 3.7) for i in "${!PYTHON_PACKAGES[@]}"; do pythonPackage=${PYTHON_PACKAGES[i]} pythonVersion=${PYTHON_VERSIONS[$i]} eval "PROVIDES_${pythonPackage}=\"\ ${portName}_$pythonPackage = $portVersion\ \"; \ REQUIRES_$pythonPackage=\"\ haiku\n\ cmd:python$pythonVersion\ \"" BUILD_REQUIRES="$BUILD_REQUIRES setuptools_$pythonPackage" BUILD_PREREQUIRES="$BUILD_PREREQUIRES cmd:python$pythonVersion " done INSTALL() { for i in "${!PYTHON_PACKAGES[@]}"; do pythonPackage=${PYTHON_PACKAGES[i]} pythonVersion=${PYTHON_VERSIONS[$i]} python=python$pythonVersion installLocation=$prefix/lib/$python/vendor-packages/ export PYTHONPATH=$installLocation:$PYTHONPATH mkdir -p $installLocation rm -rf build $python setup.py build install \ --root=/ --prefix=$prefix packageEntries $pythonPackage \ $prefix/lib/python* done }
{ "pile_set_name": "Github" }
null
null
/* poppler-qt.h: qt interface to poppler * Copyright (C) 2005, Net Integration Technologies, Inc. * Copyright (C) 2005, 2007, Brad Hards <bradh@frogmouth.net> * Copyright (C) 2005-2010, Albert Astals Cid <aacid@kde.org> * Copyright (C) 2005, Stefan Kebekus <stefan.kebekus@math.uni-koeln.de> * Copyright (C) 2006-2010, Pino Toscano <pino@kde.org> * Copyright (C) 2009 Shawn Rutledge <shawn.t.rutledge@gmail.com> * Copyright (C) 2010 Suzuki Toshiya <mpsuzuki@hiroshima-u.ac.jp> * Copyright (C) 2010 Matthias Fauconneau <matthias.fauconneau@gmail.com> * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation; either version 2, or (at your option) * any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street - Fifth Floor, Boston, MA 02110-1301, USA. */ #ifndef __POPPLER_QT_H__ #define __POPPLER_QT_H__ #include "poppler-annotation.h" #include "poppler-link.h" #include "poppler-optcontent.h" #include "poppler-page-transition.h" #include <QtCore/QByteArray> #include <QtCore/QDateTime> #include <QtCore/QSet> #include <QtXml/QDomDocument> #include "poppler-export.h" class EmbFile; class Sound; class AnnotMovie; /** The %Poppler Qt4 binding. */ namespace Poppler { class Document; class DocumentData; class PageData; class FormField; class TextBoxData; class PDFConverter; class PSConverter; /** Debug/error function. This function type is used for debugging & error output; the first parameter is the actual message, the second is the unaltered closure argument which was passed to the setDebugErrorFunction call. \since 0.16 */ typedef void (*PopplerDebugFunc)(const QString & /*message*/, const QVariant & /*closure*/); /** Set a new debug/error output function. If not set, by default error and debug messages will be sent to the Qt \p qDebug() function. \param debugFunction the new debug function \param closure user data which will be passes as-is to the debug function \since 0.16 */ POPPLER_QT4_EXPORT void setDebugErrorFunction(PopplerDebugFunc debugFunction, const QVariant &closure); /** Describes the physical location of text on a document page This very simple class describes the physical location of text on the page. It consists of - a QString that contains the text - a QRectF that gives a box that describes where on the page the text is found. */ class POPPLER_QT4_EXPORT TextBox { friend class Page; public: /** The default constructor sets the \p text and the rectangle that contains the text. Coordinated for the \p bBox are in points = 1/72 of an inch. */ TextBox(const QString& text, const QRectF &bBox); /** Destructor. */ ~TextBox(); /** Returns the text of this text box */ QString text() const; /** Returns the position of the text, in point, i.e., 1/72 of an inch \since 0.8 */ QRectF boundingBox() const; /** Returns the pointer to the next text box, if there is one. Otherwise, it returns a null pointer. */ TextBox *nextWord() const; /** Returns the bounding box of the \p i -th characted of the word. */ QRectF charBoundingBox(int i) const; /** Returns whether there is a space character after this text box */ bool hasSpaceAfter() const; private: Q_DISABLE_COPY(TextBox) TextBoxData *m_data; }; class FontInfoData; /** Container class for information about a font within a PDF document */ class POPPLER_QT4_EXPORT FontInfo { friend class Document; public: /** The type of font. */ enum Type { unknown, Type1, Type1C, Type1COT, Type3, TrueType, TrueTypeOT, CIDType0, CIDType0C, CIDType0COT, CIDTrueType, CIDTrueTypeOT }; /// \cond PRIVATE /** Create a new font information container. */ FontInfo(); /** Create a new font information container. */ FontInfo( const FontInfoData &fid ); /// \endcond /** Copy constructor. */ FontInfo( const FontInfo &fi ); /** Destructor. */ ~FontInfo(); /** The name of the font. Can be QString::null if the font has no name */ QString name() const; /** The path of the font file used to represent this font on this system, or a null string is the font is embedded */ QString file() const; /** Whether the font is embedded in the file, or not \return true if the font is embedded */ bool isEmbedded() const; /** Whether the font provided is only a subset of the full font or not. This only has meaning if the font is embedded. \return true if the font is only a subset */ bool isSubset() const; /** The type of font encoding \return a enumerated value corresponding to the font encoding used \sa typeName for a string equivalent */ Type type() const; /** The name of the font encoding used \note if you are looking for the name of the font (as opposed to the encoding format used), you probably want name(). \sa type for a enumeration version */ QString typeName() const; /** Standard assignment operator */ FontInfo& operator=( const FontInfo &fi ); private: FontInfoData *m_data; }; class FontIteratorData; /** Iterator for reading the fonts in a document. FontIterator provides a Java-style iterator for reading the fonts in a document. You can use it in the following way: \code Poppler::FontIterator* it = doc->newFontIterator(); while (it->hasNext()) { QList<Poppler::FontInfo> fonts = it->next(); // do something with the fonts } // after doing the job, the iterator must be freed delete it; \endcode \since 0.12 */ class POPPLER_QT4_EXPORT FontIterator { friend class Document; friend class DocumentData; public: /** Destructor. */ ~FontIterator(); /** Returns the fonts of the current page and then advances the iterator to the next page. */ QList<FontInfo> next(); /** Checks whether there is at least one more page to iterate, ie returns false when the iterator is beyond the last page. */ bool hasNext() const; /** Returns the current page where the iterator is. */ int currentPage() const; private: Q_DISABLE_COPY( FontIterator ) FontIterator( int, DocumentData *dd );
{ "pile_set_name": "Github" }
null
null
/* * Copyright (c) 2012 Catalin Badea * Licensed under the simplified BSD license. * See Documentation/Licenses/BSD-simplified.txt for more information. */ /* * Copyright (c) 2013-2016 Isode Limited. * All rights reserved. * See the COPYING file for more information. */ #pragma once #include <set> #include <QDate> #include <Swift/Controllers/UIInterfaces/HistoryWindow.h> #include <Swift/QtUI/QtTabbable.h> #include <Swift/QtUI/ui_QtHistoryWindow.h> namespace Swift { class QtTabbable; class QtTreeWidget; class QtWebKitChatView; class QtChatTheme; class SettingsProvider; class UIEventStream; class QtHistoryWindow : public QtTabbable, public HistoryWindow { Q_OBJECT public: QtHistoryWindow(SettingsProvider*, UIEventStream*); ~QtHistoryWindow(); void activate(); void setRosterModel(Roster*); void addMessage(const std::string& message, const std::string& senderName, bool senderIsSelf, const std::string& avatarPath, const boost::posix_time::ptime& time, bool addAtTheTop); void resetConversationView(); void resetConversationViewTopInsertPoint(); void setDate(const boost::gregorian::date& date); void closeEvent(QCloseEvent* event); void showEvent(QShowEvent* event); std::string getSearchBoxText(); boost::gregorian::date getLastVisibleDate(); virtual std::string getID() const; signals: void fontResized(int); public slots: void handleFontResized(int fontSizeSteps); protected slots: void handleScrollRequested(int pos); void handleScrollReachedTop(); void handleScrollReachedBottom(); void handleReturnPressed(); void handleCalendarClicked(const QDate& date); void handlePreviousButtonClicked(); void handleNextButtonClicked(); private: void handleSomethingSelectedChanged(RosterItem* item); Ui::QtHistoryWindow ui_; QtChatTheme* theme_; QtWebKitChatView* conversation_; QtTreeWidget* conversationRoster_; std::set<QDate> dates_; int idCounter_; bool previousTopMessageWasSelf_; QString previousTopSenderName_; bool previousBottomMessageWasSelf_; QString previousBottomSenderName_; }; }
{ "pile_set_name": "Github" }
null
null
(function() { var dfs = {"am_pm":["နံနက်","ညနေ"],"day_name":["တနင်္ဂနွေ","တနင်္လာ","အင်္ဂါ","ဗုဒ္ဓဟူး","ကြာသပတေး","သောကြာ","စနေ"],"day_short":["နွေ","လာ","ဂါ","ဟူး","တေး","ကြာ","နေ"],"era":["ဘီစီ","အေဒီ"],"era_name":["ခရစ်တော် မပေါ်မီကာလ","ခရစ်တော် ပေါ်ထွန်းပြီးကာလ"],"month_name":["ဇန်နဝါရီ","ဖေဖော်ဝါရီ","မတ်","ဧပြီ","မေ","ဇွန်","ဇူလိုင်","ဩဂုတ်","စက်တင်ဘာ","အောက်တိုဘာ","နိုဝင်ဘာ","ဒီဇင်ဘာ"],"month_short":["ဇန်","ဖေ","မတ်","ဧ","မေ","ဇွန်","ဇူ","ဩ","စက်","အောက်","နို","ဒီ"],"order_full":"MDY","order_long":"MDY","order_medium":"MDY","order_short":"MDY"}; var nfs = {"decimal_separator":".","grouping_separator":",","minus":"-"}; var df = {SHORT_PADDED_CENTURY:function(d){if(d){return(((d.getMonth()+101)+'').substring(1)+'/'+((d.getDate()+101)+'').substring(1)+'/'+d.getFullYear());}},SHORT:function(d){if(d){return((d.getMonth()+1)+'/'+d.getDate()+'/'+(d.getFullYear()+'').substring(2));}},SHORT_NOYEAR:function(d){if(d){return((d.getMonth()+1)+'/'+d.getDate());}},SHORT_NODAY:function(d){if(d){return((d.getMonth()+1)+' '+(d.getFullYear()+'').substring(2));}},MEDIUM:function(d){if(d){return(dfs.month_short[d.getMonth()]+' '+d.getDate()+','+' '+d.getFullYear());}},MEDIUM_NOYEAR:function(d){if(d){return(dfs.month_short[d.getMonth()]+' '+d.getDate());}},MEDIUM_WEEKDAY_NOYEAR:function(d){if(d){return(dfs.day_short[d.getDay()]+' '+dfs.month_short[d.getMonth()]+' '+d.getDate());}},LONG_NODAY:function(d){if(d){return(dfs.month_name[d.getMonth()]+' '+d.getFullYear());}},LONG:function(d){if(d){return(dfs.month_name[d.getMonth()]+' '+d.getDate()+','+' '+d.getFullYear());}},FULL:function(d){if(d){return(dfs.day_name[d.getDay()]+','+' '+dfs.month_name[d.getMonth()]+' '+d.getDate()+','+' '+d.getFullYear());}}}; window.icu = window.icu || new Object(); var icu = window.icu; icu.getCountry = function() { return "MM" }; icu.getCountryName = function() { return "မြန်မာ" }; icu.getDateFormat = function(formatCode) { var retVal = {}; retVal.format = df[formatCode]; return retVal; }; icu.getDateFormats = function() { return df; }; icu.getDateFormatSymbols = function() { return dfs; }; icu.getDecimalFormat = function(places) { var retVal = {}; retVal.format = function(n) { var ns = n < 0 ? Math.abs(n).toFixed(places) : n.toFixed(places); var ns2 = ns.split('.'); s = ns2[0]; var d = ns2[1]; var rgx = /(\d+)(\d{3})/;while(rgx.test(s)){s = s.replace(rgx, '$1' + nfs["grouping_separator"] + '$2');} return (n < 0 ? nfs["minus"] : "") + s + nfs["decimal_separator"] + d;}; return retVal; }; icu.getDecimalFormatSymbols = function() { return nfs; }; icu.getIntegerFormat = function() { var retVal = {}; retVal.format = function(i) { var s = i < 0 ? Math.abs(i).toString() : i.toString(); var rgx = /(\d+)(\d{3})/;while(rgx.test(s)){s = s.replace(rgx, '$1' + nfs["grouping_separator"] + '$2');} return i < 0 ? nfs["minus"] + s : s;}; return retVal; }; icu.getLanguage = function() { return "my" }; icu.getLanguageName = function() { return "ဗမာ" }; icu.getLocale = function() { return "my-MM" }; icu.getLocaleName = function() { return "ဗမာ (မြန်မာ)" }; })();
{ "pile_set_name": "Github" }
null
null
// Copyright (c) 2015 Marshall A. Greenblatt. All rights reserved. // // Redistribution and use in source and binary forms, with or without // modification, are permitted provided that the following conditions are // met: // // * Redistributions of source code must retain the above copyright // notice, this list of conditions and the following disclaimer. // * Redistributions in binary form must reproduce the above // copyright notice, this list of conditions and the following disclaimer // in the documentation and/or other materials provided with the // distribution. // * Neither the name of Google Inc. nor the name Chromium Embedded // Framework nor the names of its contributors may be used to endorse // or promote products derived from this software without specific prior // written permission. // // THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS // "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT // LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR // A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT // OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, // SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT // LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, // DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY // THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT // (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE // OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. // // --------------------------------------------------------------------------- // // The contents of this file must follow a specific format in order to // support the CEF translator tool. See the translator.README.txt file in the // tools directory for more information. // // THIS FILE IS FOR TESTING PURPOSES ONLY. // // The APIs defined in this file are for testing purposes only. They should only // be included from unit test targets. // #ifndef CEF_INCLUDE_TEST_CEF_TEST_H_ #define CEF_INCLUDE_TEST_CEF_TEST_H_ #pragma once #if !defined(BUILDING_CEF_SHARED) && !defined(WRAPPING_CEF_SHARED) && \ !defined(UNIT_TEST) #error This file can be included for unit tests only #endif #include <map> #include <vector> #include "include/cef_base.h" class CefTranslatorTestRefPtrClient; class CefTranslatorTestRefPtrClientChild; class CefTranslatorTestRefPtrLibrary; class CefTranslatorTestRefPtrLibraryChild; class CefTranslatorTestScopedClient; class CefTranslatorTestScopedClientChild; class CefTranslatorTestScopedLibrary; class CefTranslatorTestScopedLibraryChild; // Test values. #define TEST_INT_VAL 5 #define TEST_INT_VAL2 60 #define TEST_BOOL_VAL true #define TEST_DOUBLE_VAL 4.543 #define TEST_LONG_VAL -65 #define TEST_SIZET_VAL 3U #define TEST_STRING_VAL "My test string" #define TEST_STRING_VAL2 "My 2nd test string" #define TEST_STRING_VAL3 "My 3rd test string" #define TEST_STRING_KEY "key0" #define TEST_STRING_KEY2 "key1" #define TEST_STRING_KEY3 "key2" #define TEST_X_VAL 44 #define TEST_Y_VAL 754 #define TEST_X_VAL2 900 #define TEST_Y_VAL2 300 /// // Class for testing all of the possible data transfer types. /// /*--cef(source=library)--*/ class CefTranslatorTest : public CefBaseRefCounted { public: /// // Create the test object. /// /*--cef()--*/ static CefRefPtr<CefTranslatorTest> Create(); // PRIMITIVE VALUES /// // Return a void value. /// /*--cef()--*/ virtual void GetVoid() =0; /// // Return a bool value. /// /*--cef()--*/ virtual bool GetBool() =0; /// // Return an int value. /// /*--cef()--*/ virtual int GetInt() =0; /// // Return a double value. /// /*--cef()--*/ virtual double GetDouble() =0; /// // Return a long value. /// /*--cef()--*/ virtual long GetLong() =0; /// // Return a size_t value. /// /*--cef()--*/ virtual size_t GetSizet() =0; /// // Set a void value. /// /*--cef()--*/ virtual bool SetVoid() =0; /// // Set a bool value. /// /*--cef()--*/ virtual bool SetBool(bool val) =0; /// // Set an int value. /// /*--cef()--*/ virtual bool SetInt(int val) =0; /// // Set a double value. /// /*--cef()--*/ virtual bool SetDouble(double val) =0; /// // Set a long value. /// /*--cef()--*/ virtual bool SetLong(long val) =0; /// // Set a size_t value. /// /*--cef()--*/ virtual bool SetSizet(size_t val) =0; // PRIMITIVE LIST VALUES // Test both with and without a typedef. typedef std::vector<int> IntList; /// // Set a int list value. /// /*--cef()--*/ virtual bool SetIntList(const std::vector<int>& val) =0; /// // Return an int list value by out-param. /// /*--cef(count_func=val:GetIntListSize)--*/ virtual bool GetIntListByRef(IntList& val) =0; /// // Return the number of points that will be output above. /// /*--cef()--*/ virtual size_t GetIntListSize() = 0; // STRING VALUES /// // Return a string value. /// /*--cef()--*/ virtual CefString GetString() =0; /// // Set a string value. /// /*--cef()--*/ virtual bool SetString(const CefString& val) =0; /// // Return a string value by out-param. /// /*--cef()--*/ virtual void GetStringByRef(CefString& val) =0; // STRING LIST VALUES // Test both with and without a typedef. typedef std::vector<CefString> StringList; /// // Set a string list value. /// /*--cef()--*/ virtual bool SetStringList(const std::vector<CefString>& val) =0; /// // Return a string list value by out-param. /// /*--cef()--*/ virtual bool GetStringListByRef(StringList& val) =0; // STRING MAP VALUES // Test both with and without a typedef. typedef std::map<CefString, CefString> StringMap; /// // Set a string map value. /// /*--cef()--*/ virtual bool SetStringMap(const StringMap& val) =0; /// // Return a string map value by out-param. /// /*--cef()--*/ virtual bool GetStringMapByRef(std::map<CefString, CefString>& val) =0; // STRING MULTIMAP VALUES // Test both with and without a typedef. typedef std::multimap<CefString, CefString> StringMultimap; /// // Set a string multimap value. /// /*--cef()--*/ virtual bool SetStringMultimap( const std::multimap<CefString, C
{ "pile_set_name": "Github" }
null
null
# -*- encoding: binary -*- require_relative '../../../spec_helper' require 'zlib' describe "Zlib::Inflate#set_dictionary" do it "sets the inflate dictionary" do deflated = "x\273\024\341\003\313KLJNIMK\317\310\314\002\000\025\206\003\370" i = Zlib::Inflate.new begin i << deflated flunk 'Zlib::NeedDict not raised' rescue Zlib::NeedDict i.set_dictionary 'aaaaaaaaaa' end i.finish.should == 'abcdefghij' end end
{ "pile_set_name": "Github" }
null
null
# This is a part of the Microsoft Foundation Classes C++ library. # Copyright (c) Microsoft Corporation. All rights reserved. # # This source code is only intended as a supplement to the # Microsoft Foundation Classes Reference and related # electronic documentation provided with the library. # See these sources for detailed information regarding the # Microsoft Foundation Classes product. PROJ=MAKEHM OBJS=makehm.obj makehm.res CONSOLE=1 NO_PCH=1 UNICODE=0 !include <mfcsamps.mak>
{ "pile_set_name": "Github" }
null
null
## PGLowLatencyAudio Plugin for BlackBerry10, using Cordova. Plays audio .wav files using openAL, ALUT, Qdir, and QtCore libraries. For a sample application demonstrating the use of this API, please see the [LowLatencySequencer](https://github.com/blackberry/Cordova-Samples/tree/master/LowLatencySequencer) ## Version History 1.0.0 Initial Release 1.0.1 Shutsdown audio channels when not in use ## Installation The plugin can be installed from source or NPM using one of the following commands in your Cordova project location: NPM: cordova plugin add cordova-plugin-bb-nativeaudio Source: cordova plugin add path-to-plugin/PGLowLatencyAudio To start off, in the directory PGLowLatencyAudio/www contains the API. Every function is called using PGLowLatencyAudio, and we have the follow functions: preloadAudio: function (data, path, voices, success, fail) { exec(success, fail, service, "preloadAudio", { data: data, path: path, voices: voices }); }, unload: function (data, success, fail) { exec(success, fail, service, "unload", { data: data }); }, play: function (data, success, fail) { exec(success, fail, service, "play", { data: data }); }, stop: function (data, success, fail) { exec(success, fail, service, "stop", { data: data }); }, getDuration: function (data, success, fail) { exec(success, fail, service, "getDuration", { data: data }); }, loop: function (data, success, fail) { exec(success, fail, service, "loop", { data: data }); } Note: In the exampled below we use the success call back to display messages for debugging purposes. To remove these messages, simply remove 'alert(echoValue)' from the function call, however if you do run into troubles, these call backs should provide useful information to debug. If you wanted you could include a fail function to each of these, for example your fail function could be function(){alert("FAIL")}; ## Examples: If in our Cordova Applications www application folder, we have the path assets/sounds, to our sound location we can do the following: ---------------------------------------------------------------------------------- ### preloadAudio Preloads an audio file into a buffer so it can be played automatically without loading. Takes in three parameters, the file name, the path to the sounds, and how many unique voices it can have. Voices are how many simultaneous sounds that can be played at once. Example: PGLowLatencyAudio.preloadAudio("bounce.wav", "assets/sounds/", 1, function(echoValue) { alert(echoValue);}, }); ---------------------------------------------------------------------------------- ### unload Unloads an audio file from the current buffer it holds up. Used to free and allocate space in openAL. Takes in one parameter, file name. Example: PGLowLatencyAudio.unload("bounce.wav", function(echoValue) { alert(echoValue); }); ---------------------------------------------------------------------------------- ### play Plays an audio file using openAL. Takes in one parameter, file name. Example: PGLowLatencyAudio.play("bounce.wav", function(echoValue) { alert(echoValue); }); ---------------------------------------------------------------------------------- ### stop Stops an audio file from playing or looping. Takes one parameter, file name. Example: PGLowLatencyAudio.stop("bounce.wav", function(echoValue) { alert(echoValue); }); ---------------------------------------------------------------------------------- ### getDuration Get the duration of a file. Takes one parameter, file name. Example: PGLowLatencyAudio.getDuration("bounce.wav", function(duration) { if (duration > 6.0) { alert(“Greater than 6”); } else { alert(“Less than 6”); } }); ---------------------------------------------------------------------------------- ### loop Loops an audio file indefinitely until either unloaded or stopped. Takes in one parameter, file name. Example: PGLowLatencyAudio.loop("background.wav", function(echoValue) { alert(echoValue); }); ---------------------------------------------------------------------------------- The Native portion of the plugin is called using JNEXT.invoke, and inputting either of the following strings, 'load', 'unload', 'play', 'stop', 'loop'. For more information about how to run and build Cordova applications, refer to: https://github.com/blackberry/cordova-blackberry/tree/master/blackberry10 ## Disclaimer 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.
{ "pile_set_name": "Github" }
null
null
@comment $NetBSD: PLIST,v 1.1.1.1 2010/03/09 22:05:53 snj Exp $ lib/ioquake3/baseq3/pak1.pk3 lib/ioquake3/baseq3/pak2.pk3 lib/ioquake3/baseq3/pak3.pk3 lib/ioquake3/baseq3/pak4.pk3 lib/ioquake3/baseq3/pak5.pk3 lib/ioquake3/baseq3/pak6.pk3 lib/ioquake3/baseq3/pak7.pk3 lib/ioquake3/baseq3/pak8.pk3 lib/ioquake3/missionpack/pak1.pk3 lib/ioquake3/missionpack/pak2.pk3 lib/ioquake3/missionpack/pak3.pk3
{ "pile_set_name": "Github" }
null
null
<Type Name="FilterInputStream" FullName="GLib.FilterInputStream"> <TypeSignature Language="C#" Value="public class FilterInputStream : GLib.InputStream" /> <TypeSignature Language="ILAsm" Value=".class public auto ansi beforefieldinit FilterInputStream extends GLib.InputStream" /> <AssemblyInfo> <AssemblyName>gio-sharp</AssemblyName> </AssemblyInfo> <Base> <BaseTypeName>GLib.InputStream</BaseTypeName> </Base> <Interfaces /> <Docs> <summary>To be added.</summary> <remarks>To be added.</remarks> <since version="Gtk# 2.14" /> </Docs> <Members> <Member MemberName=".ctor"> <MemberSignature Language="C#" Value="protected FilterInputStream ();" /> <MemberSignature Language="ILAsm" Value=".method familyhidebysig specialname rtspecialname instance void .ctor() cil managed" /> <MemberType>Constructor</MemberType> <Parameters /> <Docs> <summary>To be added.</summary> <remarks>To be added.</remarks> <since version="Gtk# 2.14" /> </Docs> </Member> <Member MemberName=".ctor"> <MemberSignature Language="C#" Value="public FilterInputStream (IntPtr raw);" /> <MemberSignature Language="ILAsm" Value=".method public hidebysig specialname rtspecialname instance void .ctor(native int raw) cil managed" /> <MemberType>Constructor</MemberType> <Parameters> <Parameter Name="raw" Type="System.IntPtr" /> </Parameters> <Docs> <param name="raw">Native object pointer.</param> <summary>Internal constructor</summary> <remarks>This is not typically used by C# code. Exposed primarily for use by language bindings to wrap native object instances.</remarks> <since version="Gtk# 2.14" /> </Docs> </Member> <Member MemberName="BaseStream"> <MemberSignature Language="C#" Value="public GLib.InputStream BaseStream { get; }" /> <MemberSignature Language="ILAsm" Value=".property instance class GLib.InputStream BaseStream" /> <MemberType>Property</MemberType> <Attributes> <Attribute> <AttributeName>GLib.Property("base-stream")</AttributeName> </Attribute> </Attributes> <ReturnValue> <ReturnType>GLib.InputStream</ReturnType> </ReturnValue> <Docs> <summary>To be added.</summary> <value>To be added.</value> <remarks>To be added.</remarks> <since version="Gtk# 2.14" /> </Docs> </Member> <Member MemberName="CloseBaseStream"> <MemberSignature Language="C#" Value="public bool CloseBaseStream { get; set; }" /> <MemberSignature Language="ILAsm" Value=".property instance bool CloseBaseStream" /> <MemberType>Property</MemberType> <Attributes> <Attribute> <AttributeName>GLib.Property("close-base-stream")</AttributeName> </Attribute> </Attributes> <ReturnValue> <ReturnType>System.Boolean</ReturnType> </ReturnValue> <Docs> <summary>To be added.</summary> <value>To be added.</value> <remarks>To be added.</remarks> <since version="Gtk# 3.0" /> </Docs> </Member> <Member MemberName="GType"> <MemberSignature Language="C#" Value="public static GLib.GType GType { get; }" /> <MemberSignature Language="ILAsm" Value=".property valuetype GLib.GType GType" /> <MemberType>Property</MemberType> <ReturnValue> <ReturnType>GLib.GType</ReturnType> </ReturnValue> <Docs> <summary>GType Property.</summary> <value>The native <see cref="T:GLib.GType" /> value.</value> <remarks>Returns the native <see cref="T:GLib.GType" /> value for <see cref="T:GLib.FilterInputStream" />.</remarks> <since version="Gtk# 2.14" /> </Docs> </Member> </Members> </Type>
{ "pile_set_name": "Github" }
null
null
/* * File: engine_common.h * Author: cl * * Created on June 10, 2011, 8:38 PM */ #ifndef ENGINE_COMMON_H #define ENGINE_COMMON_H #define COLOR_TEXTURE_UNIT GL_TEXTURE0 #define COLOR_TEXTURE_UNIT_INDEX 0 #define SHADOW_TEXTURE_UNIT GL_TEXTURE1 #define SHADOW_TEXTURE_UNIT_INDEX 1 #define NORMAL_TEXTURE_UNIT GL_TEXTURE2 #define NORMAL_TEXTURE_UNIT_INDEX 2 #define RANDOM_TEXTURE_UNIT GL_TEXTURE3 #define RANDOM_TEXTURE_UNIT_INDEX 3 #define DISPLACEMENT_TEXTURE_UNIT GL_TEXTURE4 #define DISPLACEMENT_TEXTURE_UNIT_INDEX 4 #endif /* ENGINE_COMMON_H */
{ "pile_set_name": "Github" }
null
null