text
stringlengths 2
14k
| meta
dict |
|---|---|
/*
* Viry3D
* Copyright 2014-2019 by Stack - stackos@qq.com
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
#include "String.h"
#include "memory/Memory.h"
#include <stdarg.h>
#if VR_WINDOWS
#include <Windows.h>
#endif
namespace Viry3D
{
static const char BASE64_TABLE[] = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/";
String String::Format(const char* format, ...)
{
String result;
va_list vs;
va_start(vs, format);
int size = vsnprintf(nullptr, 0, format, vs);
va_end(vs);
char* buffer = Memory::Alloc<char>(size + 1);
buffer[size] = 0;
va_start(vs, format);
size = vsnprintf(buffer, size + 1, format, vs);
va_end(vs);
result.m_string = buffer;
Memory::Free(buffer, size + 1);
return result;
}
String String::Base64(const char* bytes, int size)
{
int size_pad = size;
if (size_pad % 3 != 0)
{
size_pad += 3 - (size_pad % 3);
}
int round = size_pad / 3;
std::string str(round * 4, '\0');
int index;
char a, b, c;
for (int i = 0; i < round; ++i)
{
a = 0; b = 0; c = 0;
index = i * 3 + 0;
if (index < size) a = bytes[index];
index = i * 3 + 1;
if (index < size) b = bytes[index];
index = i * 3 + 2;
if (index < size) c = bytes[index];
str[i * 4 + 0] = BASE64_TABLE[(a & 0xfc) >> 2];
str[i * 4 + 1] = BASE64_TABLE[((a & 0x3) << 4) | ((b & 0xf0) >> 4)];
str[i * 4 + 2] = BASE64_TABLE[((b & 0xf) << 2) | ((c & 0xc0) >> 6)];
str[i * 4 + 3] = BASE64_TABLE[c & 0x3f];
}
for (int i = size_pad - size, j = 0; i > 0; --i, ++j)
{
str[(round - 1) * 4 + 3 - j] = '=';
}
return String(str.c_str());
}
String String::Utf8ToGb2312(const String& str)
{
#if VR_WINDOWS
int size = MultiByteToWideChar(CP_UTF8, 0, str.CString(), str.Size(), nullptr, 0);
wchar_t* wstr = (wchar_t*) calloc(1, (size + 1) * 2);
MultiByteToWideChar(CP_UTF8, 0, str.CString(), str.Size(), wstr, size);
size = WideCharToMultiByte(CP_ACP, 0, wstr, size, nullptr, 0, nullptr, false);
char* cstr = (char*) calloc(1, size + 1);
WideCharToMultiByte(CP_ACP, 0, wstr, size, cstr, size, nullptr, false);
String ret = cstr;
free(cstr);
free(wstr);
return ret;
#else
return str;
#endif
}
String String::Gb2312ToUtf8(const String& str)
{
#if VR_WINDOWS
int size = MultiByteToWideChar(CP_ACP, 0, str.CString(), str.Size(), nullptr, 0);
wchar_t* wstr = (wchar_t*) calloc(1, (size + 1) * 2);
MultiByteToWideChar(CP_ACP, 0, str.CString(), str.Size(), wstr, size);
size = WideCharToMultiByte(CP_UTF8, 0, wstr, size, nullptr, 0, nullptr, false);
char* cstr = (char*) calloc(1, size + 1);
WideCharToMultiByte(CP_UTF8, 0, wstr, size, cstr, size, nullptr, false);
String ret = cstr;
free(cstr);
free(wstr);
return ret;
#else
return str;
#endif
}
String String::UrlDecode(const String& str)
{
std::string dest = str.CString();
int i = 0;
int j = 0;
char c;
int size = (int) str.Size();
while (i < size)
{
c = str[i];
switch (c)
{
case '+':
dest[j++] = ' ';
i++;
break;
case '%':
{
while (i + 2 < size && c == '%')
{
auto sub = str.Substring(i + 1, 2);
char v = (char) strtol(sub.CString(), nullptr, 16);
dest[j++] = v;
i += 3;
if (i < size)
{
c = str[i];
}
}
}
break;
default:
dest[j++] = c;
i++;
break;
}
}
return String(dest.c_str(), j);
}
String::String()
{
}
String::String(const char *str):
m_string(str)
{
}
String::String(const char* str, int size) :
m_string(str, size)
{
}
String::String(const ByteBuffer& buffer) :
m_string((const char*) buffer.Bytes(), buffer.Size())
{
}
int String::Size() const
{
return (int) m_string.size();
}
bool String::Empty() const
{
return m_string.empty();
}
bool String::operator ==(const String& right) const
{
if (this->Size() == right.Size())
{
return Memory::Compare(this->m_string.data(), right.m_string.data(), (int) m_string.size()) == 0;
}
return false;
}
bool String::operator !=(const String& right) const
{
return !(*this == right);
}
bool String::operator ==(const char* right) const
{
if (right && this->Size() == strlen(right))
{
return Memory::Compare(this->m_string.data(), right, this->Size()) == 0;
}
return false;
}
bool String::operator !=(const char* right) const
{
return !(*this == right);
}
bool operator ==(const char* left, const String& right)
{
return right == left;
}
bool operator !=(const char* left, const String& right)
{
return right != left;
}
String String::operator +(const String& right) const
{
String result;
result.m_string = m_string + right.m_string;
return result;
}
String& String::operator +=(const String& right)
{
*this = *this + right;
return *this;
}
|
{
"pile_set_name": "Github"
}
|
<component name="libraryTable">
<library name="Maven: org.springframework.cloud:spring-cloud-bus:1.3.0.RELEASE">
<CLASSES>
<root url="jar://$USER_HOME$/.m2/repository/org/springframework/cloud/spring-cloud-bus/1.3.0.RELEASE/spring-cloud-bus-1.3.0.RELEASE.jar!/" />
</CLASSES>
<JAVADOC>
<root url="jar://$USER_HOME$/.m2/repository/org/springframework/cloud/spring-cloud-bus/1.3.0.RELEASE/spring-cloud-bus-1.3.0.RELEASE-javadoc.jar!/" />
</JAVADOC>
<SOURCES>
<root url="jar://$USER_HOME$/.m2/repository/org/springframework/cloud/spring-cloud-bus/1.3.0.RELEASE/spring-cloud-bus-1.3.0.RELEASE-sources.jar!/" />
</SOURCES>
</library>
</component>
|
{
"pile_set_name": "Github"
}
|
// This file is part of libigl, a simple c++ geometry processing library.
//
// Copyright (C) 2013 Alec Jacobson <alecjacobson@gmail.com>
//
// This Source Code Form is subject to the terms of the Mozilla Public License
// v. 2.0. If a copy of the MPL was not distributed with this file, You can
// obtain one at http://mozilla.org/MPL/2.0/.
#include "forward_kinematics.h"
#include <functional>
#include <iostream>
IGL_INLINE void igl::forward_kinematics(
const Eigen::MatrixXd & C,
const Eigen::MatrixXi & BE,
const Eigen::VectorXi & P,
const std::vector<
Eigen::Quaterniond,Eigen::aligned_allocator<Eigen::Quaterniond> > & dQ,
const std::vector<Eigen::Vector3d> & dT,
std::vector<
Eigen::Quaterniond,Eigen::aligned_allocator<Eigen::Quaterniond> > & vQ,
std::vector<Eigen::Vector3d> & vT)
{
using namespace std;
using namespace Eigen;
const int m = BE.rows();
assert(m == P.rows());
assert(m == (int)dQ.size());
assert(m == (int)dT.size());
vector<bool> computed(m,false);
vQ.resize(m);
vT.resize(m);
// Dynamic programming
function<void (int) > fk_helper = [&] (int b)
{
if(!computed[b])
{
if(P(b) < 0)
{
// base case for roots
vQ[b] = dQ[b];
const Vector3d r = C.row(BE(b,0)).transpose();
vT[b] = r-dQ[b]*r + dT[b];
}else
{
// Otherwise first compute parent's
const int p = P(b);
fk_helper(p);
vQ[b] = vQ[p] * dQ[b];
const Vector3d r = C.row(BE(b,0)).transpose();
vT[b] = vT[p] - vQ[b]*r + vQ[p]*(r + dT[b]);
}
computed[b] = true;
}
};
for(int b = 0;b<m;b++)
{
fk_helper(b);
}
}
IGL_INLINE void igl::forward_kinematics(
const Eigen::MatrixXd & C,
const Eigen::MatrixXi & BE,
const Eigen::VectorXi & P,
const std::vector<
Eigen::Quaterniond,Eigen::aligned_allocator<Eigen::Quaterniond> > & dQ,
std::vector<
Eigen::Quaterniond,Eigen::aligned_allocator<Eigen::Quaterniond> > & vQ,
std::vector<Eigen::Vector3d> & vT)
{
std::vector<Eigen::Vector3d> dT(BE.rows(),Eigen::Vector3d(0,0,0));
return forward_kinematics(C,BE,P,dQ,dT,vQ,vT);
}
IGL_INLINE void igl::forward_kinematics(
const Eigen::MatrixXd & C,
const Eigen::MatrixXi & BE,
const Eigen::VectorXi & P,
const std::vector<
Eigen::Quaterniond,Eigen::aligned_allocator<Eigen::Quaterniond> > & dQ,
const std::vector<Eigen::Vector3d> & dT,
Eigen::MatrixXd & T)
{
using namespace Eigen;
using namespace std;
vector< Quaterniond,aligned_allocator<Quaterniond> > vQ;
vector< Vector3d> vT;
forward_kinematics(C,BE,P,dQ,dT,vQ,vT);
const int dim = C.cols();
T.resize(BE.rows()*(dim+1),dim);
for(int e = 0;e<BE.rows();e++)
{
Affine3d a = Affine3d::Identity();
a.translate(vT[e]);
a.rotate(vQ[e]);
T.block(e*(dim+1),0,dim+1,dim) =
a.matrix().transpose().block(0,0,dim+1,dim);
}
}
IGL_INLINE void igl::forward_kinematics(
const Eigen::MatrixXd & C,
const Eigen::MatrixXi & BE,
const Eigen::VectorXi & P,
const std::vector<
Eigen::Quaterniond,Eigen::aligned_allocator<Eigen::Quaterniond> > & dQ,
Eigen::MatrixXd & T)
{
std::vector<Eigen::Vector3d> dT(BE.rows(),Eigen::Vector3d(0,0,0));
return forward_kinematics(C,BE,P,dQ,dT,T);
}
#ifdef IGL_STATIC_LIBRARY
// Explicit template instantiation
#endif
|
{
"pile_set_name": "Github"
}
|
<?php
namespace Kirby\Database;
use Kirby\Exception\InvalidArgumentException;
use PHPUnit\Framework\TestCase;
use ReflectionProperty;
/**
* @coversDefaultClass Kirby\Database\Db
*/
class DbTest extends TestCase
{
public function setUp(): void
{
Db::connect([
'database' => ':memory:',
'type' => 'sqlite'
]);
// create a dummy user table which we can use for our tests
Db::execute('
CREATE TABLE "users" (
"id" INTEGER PRIMARY KEY AUTOINCREMENT NOT NULL UNIQUE,
"username" TEXT UNIQUE ON CONFLICT FAIL NOT NULL,
"fname" TEXT,
"lname" TEXT,
"password" TEXT NOT NULL,
"email" TEXT NOT NULL
);
');
// insert some silly dummy data
Db::insert('users', [
'username' => 'john',
'fname' => 'John',
'lname' => 'Lennon',
'email' => 'john@test.com',
'password' => 'beatles'
]);
Db::insert('users', [
'username' => 'paul',
'fname' => 'Paul',
'lname' => 'McCartney',
'email' => 'paul@test.com',
'password' => 'beatles'
]);
Db::insert('users', [
'username' => 'george',
'fname' => 'George',
'lname' => 'Harrison',
'email' => 'george@test.com',
'password' => 'beatles'
]);
}
/**
* @covers ::connect
*/
public function testConnect()
{
$db = Db::connect();
$this->assertInstanceOf(Database::class, $db);
// cached instance
$this->assertSame($db, Db::connect());
// new instance
$this->assertNotSame($db, Db::connect([
'type' => 'sqlite',
'database' => ':memory:'
]));
// new instance with custom options
$db = Db::connect([
'type' => 'sqlite',
'database' => ':memory:',
'prefix' => 'test_'
]);
$this->assertSame('test_', $db->prefix());
// cache of the new instance
$this->assertSame($db, Db::connect());
}
/**
* @covers ::connection
*/
public function testConnection()
{
$this->assertInstanceOf(Database::class, Db::connection());
}
/**
* @covers ::table
*/
public function testTable()
{
$tableProp = new ReflectionProperty(Query::class, 'table');
$tableProp->setAccessible(true);
$query = Db::table('users');
$this->assertInstanceOf(Query::class, $query);
$this->assertSame('users', $tableProp->getValue($query));
}
/**
* @covers ::query
*/
public function testQuery()
{
$result = Db::query('SELECT * FROM users WHERE username = :username', ['username' => 'paul'], ['fetch' => 'array', 'iterator' => 'array']);
$this->assertSame('paul', $result[0]['username']);
}
/**
* @covers ::execute
*/
public function testExecute()
{
$result = Db::query('SELECT * FROM users WHERE username = :username', ['username' => 'paul'], ['fetch' => 'array', 'iterator' => 'array']);
$this->assertSame('paul', $result[0]['username']);
$result = Db::execute('DELETE FROM users WHERE username = :username', ['username' => 'paul']);
$this->assertTrue($result);
$result = Db::query('SELECT * FROM users WHERE username = :username', ['username' => 'paul'], ['fetch' => 'array', 'iterator' => 'array']);
$this->assertEmpty($result);
}
/**
* @covers ::__callStatic
*/
public function testCallStatic()
{
Db::connect([
'database' => ':memory:',
'type' => 'sqlite',
'prefix' => 'myprefix_'
]);
Db::$queries['test'] = function ($test) {
return $test . ' test';
};
$this->assertSame('This is a test', Db::test('This is a'));
unset(Db::$queries['test']);
$this->assertSame('sqlite', Db::type());
$this->assertSame('myprefix_', Db::prefix());
}
/**
* @covers ::__callStatic
*/
public function testCallStaticInvalid()
{
$this->expectException(InvalidArgumentException::class);
$this->expectExceptionMessage('Invalid static Db method: thisIsInvalid');
Db::thisIsInvalid();
}
/**
* @coversNothing
*/
public function testSelect()
{
$result = Db::select('users');
$this->assertSame(3, $result->count());
$result = Db::select('users', 'username', ['username' => 'paul']);
$this->assertSame(1, $result->count());
$this->assertSame('paul', $result->first()->username());
$result = Db::select('users', 'username', null, 'username ASC', 1, 1);
$this->assertSame(1, $result->count());
$this->assertSame('john', $result->first()->username());
}
/**
* @coversNothing
*/
public function testFirst()
{
$result = Db::first('users');
$this->assertSame('john', $result->username());
$result = Db::first('users', '*', ['username' => 'paul']);
$this->assertSame('paul', $result->username());
$result = Db::first('users', '*', null, 'username ASC');
$this->assertSame('george', $result->username());
$result = Db::row('users');
$this->assertSame('john', $result->username());
$result = Db::one('users');
$this->assertSame('john', $result->username());
}
/**
* @coversNothing
*/
public function testColumn()
{
$result = Db::column('users', 'username');
$this->assertSame(['john', 'paul', 'george'], $result->toArray());
$result = Db::column('users', 'username', ['username' => 'paul']);
$this->assertSame(['paul'], $result->toArray());
$result = Db::column('users', 'username', null, 'username ASC');
$this->assertSame(['george', 'john', 'paul'], $result->toArray());
$result = Db::column('users', 'username', null, 'username ASC', 1, 1);
$this->assertSame(['john'], $result->toArray());
}
/**
* @coversNothing
*/
public function testInsert()
{
$result = Db::insert('users', [
'username' => 'ringo',
'fname' => 'Ringo',
'lname' => 'Starr',
'email' => 'ringo@test.com',
'password' => 'beatles'
]);
$this->assertSame(4, $result);
$this->assertSame('ringo@test.com', Db::row('users', '*', ['username' => 'ringo'])->email());
}
/**
* @coversNothing
*/
public function testUpdate()
{
$result = Db::update('users', ['email' => 'john@gmail.com'], ['username' => 'john']);
$this->assertTrue($result);
$this->assertSame('john@gmail.com', Db::row('users', '*', ['username' => 'john'])->email());
$this->assert
|
{
"pile_set_name": "Github"
}
|
JSON backend
------------
.. toctree::
:maxdepth: 2
.. automodule:: cork.json_backend
:members:
:inherited-members:
:undoc-members:
|
{
"pile_set_name": "Github"
}
|
好奇心原文链接:[魅蓝也出了全面屏手机,但看上去和之前一个模版_智能_好奇心日报-张智伟](https://www.qdaily.com/articles/49328.html)
WebArchive归档链接:[魅蓝也出了全面屏手机,但看上去和之前一个模版_智能_好奇心日报-张智伟](http://web.archive.org/web/20180131040811/http://www.qdaily.com:80/articles/49328.html)

|
{
"pile_set_name": "Github"
}
|
/* @flow */
/* eslint-disable no-console */
import type DOMRenderer from '../../../flowtypes/DOMRenderer'
function addClassNameSorting(renderer: DOMRenderer) {
const existingRenderRule = renderer.renderRule.bind(renderer)
renderer.renderRule = (...args) => {
const className = existingRenderRule(...args)
return className
.split(/\s+/g)
.sort((a, b) => (a < b ? -1 : a > b ? +1 : 0))
.join(' ')
}
return renderer
}
export default function sortClassNames() {
return addClassNameSorting
}
|
{
"pile_set_name": "Github"
}
|
<?php
/**
* Mockery
*
* LICENSE
*
* This source file is subject to the new BSD license that is bundled
* with this package in the file LICENSE.txt.
* It is also available through the world-wide-web at this URL:
* http://github.com/padraic/mockery/blob/master/LICENSE
* 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 padraic@php.net so we can send you a copy immediately.
*
* @category Mockery
* @package Mockery
* @copyright Copyright (c) 2010 Pádraic Brady (http://blog.astrumfutura.com)
* @license http://github.com/padraic/mockery/blob/master/LICENSE New BSD License
*/
namespace Mockery;
class Undefined
{
/**
* Call capturing to merely return this same object.
*
* @param string $method
* @param array $args
* @return self
*/
public function __call($method, array $args)
{
return $this;
}
/**
* Return a string, avoiding E_RECOVERABLE_ERROR
*
* @return string
*/
public function __toString()
{
return __CLASS__ . ":" . spl_object_hash($this);
}
}
|
{
"pile_set_name": "Github"
}
|
package docker
import (
"github.com/containers/image/v5/docker/reference"
"github.com/containers/image/v5/types"
)
// bicTransportScope returns a BICTransportScope appropriate for ref.
func bicTransportScope(ref dockerReference) types.BICTransportScope {
// Blobs can be reused across the whole registry.
return types.BICTransportScope{Opaque: reference.Domain(ref.ref)}
}
// newBICLocationReference returns a BICLocationReference appropriate for ref.
func newBICLocationReference(ref dockerReference) types.BICLocationReference {
// Blobs are scoped to repositories (the tag/digest are not necessary to reuse a blob).
return types.BICLocationReference{Opaque: ref.ref.Name()}
}
// parseBICLocationReference returns a repository for encoded lr.
func parseBICLocationReference(lr types.BICLocationReference) (reference.Named, error) {
return reference.ParseNormalizedNamed(lr.Opaque)
}
|
{
"pile_set_name": "Github"
}
|
// Copyright (c) 2013, Suryandaru Triandana <syndtr@gmail.com>
// All rights reserved.
//
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
// Package capability provides utilities for manipulating POSIX capabilities.
package capability
type Capabilities interface {
// Get check whether a capability present in the given
// capabilities set. The 'which' value should be one of EFFECTIVE,
// PERMITTED, INHERITABLE or BOUNDING.
Get(which CapType, what Cap) bool
// Empty check whether all capability bits of the given capabilities
// set are zero. The 'which' value should be one of EFFECTIVE,
// PERMITTED, INHERITABLE or BOUNDING.
Empty(which CapType) bool
// Full check whether all capability bits of the given capabilities
// set are one. The 'which' value should be one of EFFECTIVE,
// PERMITTED, INHERITABLE or BOUNDING.
Full(which CapType) bool
// Set sets capabilities of the given capabilities sets. The
// 'which' value should be one or combination (OR'ed) of EFFECTIVE,
// PERMITTED, INHERITABLE or BOUNDING.
Set(which CapType, caps ...Cap)
// Unset unsets capabilities of the given capabilities sets. The
// 'which' value should be one or combination (OR'ed) of EFFECTIVE,
// PERMITTED, INHERITABLE or BOUNDING.
Unset(which CapType, caps ...Cap)
// Fill sets all bits of the given capabilities kind to one. The
// 'kind' value should be one or combination (OR'ed) of CAPS or
// BOUNDS.
Fill(kind CapType)
// Clear sets all bits of the given capabilities kind to zero. The
// 'kind' value should be one or combination (OR'ed) of CAPS or
// BOUNDS.
Clear(kind CapType)
// String return current capabilities state of the given capabilities
// set as string. The 'which' value should be one of EFFECTIVE,
// PERMITTED, INHERITABLE or BOUNDING.
StringCap(which CapType) string
// String return current capabilities state as string.
String() string
// Load load actual capabilities value. This will overwrite all
// outstanding changes.
Load() error
// Apply apply the capabilities settings, so all changes will take
// effect.
Apply(kind CapType) error
}
// NewPid create new initialized Capabilities object for given pid.
func NewPid(pid int) (Capabilities, error) {
return newPid(pid)
}
// NewFile create new initialized Capabilities object for given named file.
func NewFile(name string) (Capabilities, error) {
return newFile(name)
}
|
{
"pile_set_name": "Github"
}
|
'use strict';
const url = require('url');
const got = require('got');
const registryUrl = require('registry-url');
const registryAuthToken = require('registry-auth-token');
const semver = require('semver');
module.exports = (name, opts) => {
const scope = name.split('/')[0];
const regUrl = registryUrl(scope);
const pkgUrl = url.resolve(regUrl, encodeURIComponent(name).replace(/^%40/, '@'));
const authInfo = registryAuthToken(regUrl, {recursive: true});
opts = Object.assign({
version: 'latest'
}, opts);
const headers = {
accept: 'application/vnd.npm.install-v1+json; q=1.0, application/json; q=0.8, */*'
};
if (opts.fullMetadata) {
delete headers.accept;
}
if (authInfo) {
headers.authorization = `${authInfo.type} ${authInfo.token}`;
}
return got(pkgUrl, {json: true, headers})
.then(res => {
let data = res.body;
let version = opts.version;
if (opts.allVersions) {
return data;
}
if (data['dist-tags'][version]) {
data = data.versions[data['dist-tags'][version]];
} else if (version) {
if (!data.versions[version]) {
const versions = Object.keys(data.versions);
version = semver.maxSatisfying(versions, version);
if (!version) {
throw new Error('Version doesn\'t exist');
}
}
data = data.versions[version];
if (!data) {
throw new Error('Version doesn\'t exist');
}
}
return data;
})
.catch(err => {
if (err.statusCode === 404) {
throw new Error(`Package \`${name}\` doesn't exist`);
}
throw err;
});
};
|
{
"pile_set_name": "Github"
}
|
// Copyright Aleksey Gurtovoy 2000-2004
// Copyright David Abrahams 2003-2004
//
// Distributed under the Boost Software License, Version 1.0.
// (See accompanying file LICENSE_1_0.txt or copy at
// http://www.boost.org/LICENSE_1_0.txt)
//
// Preprocessed version of "boost/mpl/map/map10.hpp" header
// -- DO NOT modify by hand!
namespace boost { namespace mpl {
template<
typename P0
>
struct map1
: m_item<
typename P0::first
, typename P0::second
, map0< >
>
{
typedef map1 type;
};
template<
typename P0, typename P1
>
struct map2
: m_item<
typename P1::first
, typename P1::second
, map1<P0>
>
{
typedef map2 type;
};
template<
typename P0, typename P1, typename P2
>
struct map3
: m_item<
typename P2::first
, typename P2::second
, map2< P0,P1 >
>
{
typedef map3 type;
};
template<
typename P0, typename P1, typename P2, typename P3
>
struct map4
: m_item<
typename P3::first
, typename P3::second
, map3< P0,P1,P2 >
>
{
typedef map4 type;
};
template<
typename P0, typename P1, typename P2, typename P3, typename P4
>
struct map5
: m_item<
typename P4::first
, typename P4::second
, map4< P0,P1,P2,P3 >
>
{
typedef map5 type;
};
template<
typename P0, typename P1, typename P2, typename P3, typename P4
, typename P5
>
struct map6
: m_item<
typename P5::first
, typename P5::second
, map5< P0,P1,P2,P3,P4 >
>
{
typedef map6 type;
};
template<
typename P0, typename P1, typename P2, typename P3, typename P4
, typename P5, typename P6
>
struct map7
: m_item<
typename P6::first
, typename P6::second
, map6< P0,P1,P2,P3,P4,P5 >
>
{
typedef map7 type;
};
template<
typename P0, typename P1, typename P2, typename P3, typename P4
, typename P5, typename P6, typename P7
>
struct map8
: m_item<
typename P7::first
, typename P7::second
, map7< P0,P1,P2,P3,P4,P5,P6 >
>
{
typedef map8 type;
};
template<
typename P0, typename P1, typename P2, typename P3, typename P4
, typename P5, typename P6, typename P7, typename P8
>
struct map9
: m_item<
typename P8::first
, typename P8::second
, map8< P0,P1,P2,P3,P4,P5,P6,P7 >
>
{
typedef map9 type;
};
template<
typename P0, typename P1, typename P2, typename P3, typename P4
, typename P5, typename P6, typename P7, typename P8, typename P9
>
struct map10
: m_item<
typename P9::first
, typename P9::second
, map9< P0,P1,P2,P3,P4,P5,P6,P7,P8 >
>
{
typedef map10 type;
};
}}
|
{
"pile_set_name": "Github"
}
|
<?xml version="1.0" encoding="utf-8"?>
<!--
This file is automatically generated by Visual Studio .Net. It is
used to store generic object data source configuration information.
Renaming the file extension or editing the content of this file may
cause the file to be unrecognizable by the program.
-->
<GenericObjectDataSource DisplayName="GetNextDeparturesWithDetailsResponse" Version="1.0" xmlns="urn:schemas-microsoft-com:xml-msdatasource">
<TypeInfo>Huxley.ldbStaffServiceReference.GetNextDeparturesWithDetailsResponse, Service References.ldbStaffServiceReference.Reference.cs.dll, Version=0.0.0.0, Culture=neutral, PublicKeyToken=null</TypeInfo>
</GenericObjectDataSource>
|
{
"pile_set_name": "Github"
}
|
// Copyright 2020 The Cockroach Authors.
//
// Use of this software is governed by the Business Source License
// included in the file licenses/BSL.txt.
//
// As of the Change Date specified in that file, in accordance with
// the Business Source License, use of this software will be governed
// by the Apache License, Version 2.0, included in the file
// licenses/APL.txt.
package errorutil
// TenantSQLDeprecatedWrapper is a helper to annotate uses of components that
// are in the progress of being phased out due to work towards multi-tenancy.
// It is usually usually used under a layer of abstraction that is aware of
// the wrapped object's type.
//
// Deprecated objects are broadly objects that reach deeply into the KV layer
// and which will be inaccessible from a SQL tenant server. Their uses in SQL
// fall into two categories:
//
// - functionality essential for multi-tenancy, i.e. a use which will
// have to be removed before we can start SQL tenant servers.
// - non-essential functionality, which will be disabled when run in
// a SQL tenant server. It may or may not be a long-term goal to remove
// this usage; this is determined on a case-by-case basis.
//
// As work towards multi-tenancy is taking place, semi-dedicated SQL tenant
// servers are supported. These are essentially SQL tenant servers that get
// to reach into the KV layer as needed while the first category above is
// being whittled down.
//
// This wrapper aids that process by offering two methods corresponding to
// the categories above:
//
// Deprecated() trades in a reference to Github issue (tracking the removal of
// an essential usage) for the wrapped object; OptionalErr() returns the wrapped
// object only if the wrapper was set up to allow this.
//
// Note that the wrapped object will in fact always have to be present as long
// as calls to Deprecated() exist. However, when running semi-dedicated SQL
// tenants, the wrapper should be set up with exposed=false so that it can
// pretend that the object is in fact not available.
//
// Finally, once all Deprecated() calls have been removed, it is possible to
// treat the wrapper as a pure option type, i.e. wrap a nil value with
// exposed=false.
type TenantSQLDeprecatedWrapper struct {
v interface{}
exposed bool
}
// MakeTenantSQLDeprecatedWrapper wraps an arbitrary object. When the 'exposed'
// parameter is set to true, Optional() will return the object.
func MakeTenantSQLDeprecatedWrapper(v interface{}, exposed bool) TenantSQLDeprecatedWrapper {
return TenantSQLDeprecatedWrapper{v: v, exposed: exposed}
}
// Optional returns the wrapped object if it is available (meaning that the
// wrapper was set up to make it available). This should be called by
// functionality that relies on the wrapped object but can be disabled when this
// is desired.
//
// Optional functionality should be used sparingly as it increases the
// maintenance and testing burden. It is preferable to use OptionalErr()
// (and return the error) where possible.
func (w TenantSQLDeprecatedWrapper) Optional() (interface{}, bool) {
if !w.exposed {
return nil, false
}
return w.v, true
}
// OptionalErr calls Optional and returns an error (referring to the optionally
// supplied Github issues) if the wrapped object is not available.
func (w TenantSQLDeprecatedWrapper) OptionalErr(issue int) (interface{}, error) {
v, ok := w.Optional()
if !ok {
return nil, UnsupportedWithMultiTenancy(issue)
}
return v, nil
}
|
{
"pile_set_name": "Github"
}
|
<div class="content-wrapper">
<section class="content-header">
<h1>Kotak Pesan</h1>
<ol class="breadcrumb">
<li><a href="<?= site_url('hom_sid')?>"><i class="fa fa-home"></i> Home</a></li>
<li class="active">Kotak Pesan</li>
</ol>
</section>
<section class="content" id="maincontent">
<form id="mainform" name="mainform" action="" method="post">
<div class="row">
<?php $this->load->view('mailbox/menu_mailbox') ?>
<div class="col-md-9">
<div class="box box-info">
<div class="box-header with-border">
<a href="<?= site_url('mailbox/form') ?>" class="btn btn-social btn-flat btn-success btn-sm visible-xs-block visible-sm-inline-block visible-md-inline-block visible-lg-inline-block" title="Tulis Pesan"><i class="fa fa-plus"></i> Tulis Pesan</a>
<a href="#confirm-delete" title="Arsipkan Data" <?php if(!$filter_archived) : ?>onclick="deleteAllBox('mainform','<?=site_url("mailbox/archive_all/$kat/$p/$o")?>')"<?php endif ?> class="btn btn-social btn-flat btn-danger btn-sm visible-xs-block visible-sm-inline-block visible-md-inline-block visible-lg-inline-block hapus-terpilih" <?php $filter_archived and print('disabled') ?>><i class='fa fa-file-archive-o'></i> Arsipkan Data Terpilih</a>
<a href="<?= site_url("mailbox/clear/$kat/$p/$o") ?>" class="btn btn-social btn-flat bg-purple btn-sm visible-xs-block visible-sm-inline-block visible-md-inline-block visible-lg-inline-block"><i class="fa fa-refresh"></i>Bersihkan Filter</a>
</div>
<div class="box-body">
<div class="row">
<div class="col-sm-12">
<div class="dataTables_wrapper form-inline dt-bootstrap no-footer">
<form id="mainform" name="mainform" action="" method="post">
<div class="row">
<div class="col-sm-9">
<div class="form-group">
<select class="form-control input-sm select2-nik-ajax" id="nik" style="width:100%" name="nik" data-url="<?= site_url('mailbox/list_pendaftar_mandiri_ajax')?>" onchange="formAction('mainform', '<?=site_url("mailbox/filter_nik/$kat")?>')">
<?php if ($individu): ?>
<option value="<?= $individu['nik']?>" selected><?= $individu['nik'] .' - '.$individu['nama']?></option>
<?php else : ?>
<option value="0" selected>Semua Pendaftar Layanan Mandiri</option>
<?php endif;?>
</select>
</div>
<div class="form-group">
<select class="form-control input-sm " name="status" onchange="formAction('mainform','<?=site_url("mailbox/filter_status/$kat")?>')">
<option value="">Semua</option>
<option value="1" <?php if ($filter_status==1): ?>selected<?php endif ?>>Sudah Dibaca</option>
<option value="2" <?php if ($filter_status==2): ?>selected<?php endif ?>>Belum Dibaca</option>
<option value="3" <?php if ($filter_archived): ?>selected<?php endif ?>>Diarsipkan</option>
</select>
</div>
</div>
<div class="col-sm-3">
<div class="box-tools">
<div class="input-group input-group-sm pull-right">
<input name="cari" id="cari" class="form-control" placeholder="Cari..." type="text" value="<?=html_escape($cari)?>" onkeypress="if (event.keyCode == 13):$('#'+'mainform').attr('action','<?=site_url("mailbox/search/$kat")?>');$('#'+'mainform').submit();endif;">
<div class="input-group-btn">
<button type="submit" class="btn btn-default" onclick="$('#'+'mainform').attr('action', '<?=site_url("mailbox/search/$kat")?>');$('#'+'mainform').submit();"><i class="fa fa-search"></i></button>
</div>
</div>
</div>
</div>
</div>
<div class="row">
<div class="col-sm-12">
<div class="table-responsive">
<table class="table table-bordered table-striped dataTable table-hover">
<thead class="bg-gray disabled color-palette">
<tr>
<th><input type="checkbox" id="checkall"/></th>
<th>No</th>
<th>Aksi</th>
<?php if ($o==2): ?>
<th><a href="<?= site_url("mailbox/index/$kat/$p/1")?>"><?= $owner ?> <i class='fa fa-sort-asc fa-sm'></i></a></th>
<?php elseif ($o==1): ?>
<th><a href="<?= site_url("mailbox/index/$kat/$p/2")?>"><?= $owner ?> <i class='fa fa-sort-desc fa-sm'></i></a></th>
<?php else: ?>
<th><a href="<?= site_url("mailbox/index/$kat/$p/1")?>"><?= $owner ?> <i class='fa fa-sort fa-sm'></i></a></th>
<?php endif; ?>
<?php if ($o==4): ?>
<th nowrap><a href="<?= site_url("mailbox/index/$kat/$p/3")?>">NIK <i class='fa fa-sort-asc fa-sm'></i></a></th>
<?php elseif ($o==3): ?>
<th nowrap><a href="<?= site_url("mailbox/index/$kat/$p/4")?>">NIK <i class='fa fa-sort-desc fa-sm'></i></a></th>
<?php else: ?>
<th nowrap><a href="<?= site_url("mailbox/index/$kat/$p/3")?>">NIK <i class='fa fa-sort fa-sm'></i></a></th>
<?php endif; ?>
<th>Subjek Pesan</th>
<?php if ($o==8): ?>
<th nowrap><a href="<?= site_url("mailbox/index/$kat/$p/7")?>">Status Pesan <i class='fa fa-sort-asc fa-sm'></i></a></th>
<?php elseif ($o==7): ?>
<th nowrap><a href="<?= site_url("mailbox/index/$kat/$p/8")?>">Status Pesan <i class='fa fa-sort-desc fa-sm'></i></a></th>
<?php else: ?>
<th nowrap><a href="<?= site_url("mailbox/index/$kat/$p/7")?>">Status Pesan <i class='fa fa-sort fa-sm'></i></a></th>
<?php endif; ?>
<?php if ($o==10): ?>
<th><a href="<?= site_url("mailbox/index/$kat/$p/9")?>">D
|
{
"pile_set_name": "Github"
}
|
require('../../modules/es6.object.get-own-property-descriptor');
var $Object = require('../../modules/_core').Object;
module.exports = function getOwnPropertyDescriptor(it, key) {
return $Object.getOwnPropertyDescriptor(it, key);
};
|
{
"pile_set_name": "Github"
}
|
# Add project specific ProGuard rules here.
# By default, the flags in this file are appended to flags specified
# in D:\Android\sdk/tools/proguard/proguard-android.txt
# You can edit the include path and order by changing the proguardFiles
# directive in build.gradle.
#
# For more details, see
# http://developer.android.com/guide/developing/tools/proguard.html
# Add any project specific keep options here:
# If your project uses WebView with JS, uncomment the following
# and specify the fully qualified class name to the JavaScript interface
# class:
#-keepclassmembers class fqcn.of.javascript.interface.for.webview {
# public *;
#}
|
{
"pile_set_name": "Github"
}
|
:030000000219FDE5
:03000B000200AA46
:03002B0002015679
:03005B000202E8B6
:030073000202D5B1
:1000800002030406080C10182030406080040608A3
:100090000C10182030406080A0C00003070F1F0D17
:1000A0000D0403060D0502030202C2AFC0D0C0E07A
:1000B000206214E5256009E473E525F4F58AD2622F
:1000C000D0E0D0D0D2AF3285268AC262E526F46075
:1000D00029D0E0D0D0C293C295C297D2AF32C2939A
:1000E000C295C297206F0C206509740ED5E0FDE51E
:1000F0007B4290D0E0D0D0D2AF32758A00C28DD290
:100100006201F301B9306805206502D29301B9306C
:100110006805206502D29501B9306805206502D2D4
:100120009701B9C29230680A206507740CD5E0FDCA
:10013000D29301B9C29430680A206507740CD5E0E7
:10014000FDD29501B9C29630680A206507740CD5B6
:10015000E0FDD29701B9C2AFC2AD53E6EFC0D0C047
:10016000E0D2D3D2AFC2CEE52A600720744F152A61
:1001700021BD7800790020742EE580307E01F430B6
:10018000E30278FF53DACF207E0343DA20307E0388
:1001900043DA10C2D8C271E580307E01F430E30248
:1001A00079FFC3E89970CB306103752A402074034E
:1001B000752A40885CD270E86003755F0020740D7A
:1001C000E52B6004152B21CD43DA01C2D820700243
:1001D00021E0A85C206102C27020740221DE882226
:1001E0007882B6040385222420CF0AD0E0D0D04301
:1001F000E610D2AD32C2CF053A7802E52A6005306A
:100200007402152AC3E55C94014005755F00412125
:10021000756000756900E55F2401F55F5003755F47
:10022000FF7982B7020D306E1DC3E522943240166D
:10023000854C227982B7030E306E0BC3E5229432CF
:100240004004798E8722C3E5239522600840041577
:100250002341550523D8CA0569E56970021569D59A
:100260006A69756A017808E56B60497805C3E569D4
:10027000956B4057C3E569956C50087801756A0322
:1002800002028FC3E569956D50057801756A01C357
:10029000E5629524401E7982B7040241C0206E14A5
:1002A000852462E569046003856B69756A017523BD
:1002B0003C0202CBE5622850057562FF41C0F56241
:1002C000E5620470067560FF7569FFD0E0D0D04329
:1002D000E610D2AD32C2AF53E67F7592FA7593FF46
:1002E000C260759104D2AF32C2AF53E6EFC2ADC067
:1002F000D0C0E0C0F0D2D3D2AFA8FBA9FCC2D830A6
:100300007102614F53DACF207E0343DA10307E034F
:1003100043DA20D271E580307E01F420E3026126C9
:1003200088278928A13453DACF207E0343DA20308E
:100330007E0343DA10C2D8C271307402A120780063
:10034000E580307E01F430E302A120885CA10853EF
:10035000DACF207E0343DA20307E0343DA10C27105
:10036000206102812853DACF207E0343DA10307EE9
:100370000343DA20C2D8D27188578958C3E895550B
:10038000F8E99556F97B007E087A00C3E8948CE979
:1003900094005005755B00811A882178A2E6A82197
:1003A0006055C3E894C8E994005008E4D2E4FB7AAD
:1003B0000A61F5C3E89468E994015008E4D2E3FBCC
:1003C0007A0F61F5C3E894D0E994025008E4D2E2D0
:1003D000FB7A1E61F5C3E894A0E994055008E4D2C5
:1003E000E1FB7A3C61F5C3E89498E994085008E48D
:1003F000D2E0FB7A787E00C3E89559FCE9955AFD76
:1004000030E70AECF42401FCEDF43400FD755B00E8
:10041000C3EC9AED9E5003755B018859895A855744
:10042000558558567802A108C3E89527F8E995281C
:10043000F9307C0281EC307B0281EC307A0281E57C
:10044000207502814BE9FDE8FC816AE9C313F9E8F4
:1004500013F830790281E5E9C313F9E813F830782D
:100460000281E5E9C313FDE813FC20612CC3EC9481
:0F0470001CED940240028181ED701EC3EC94C814
:10047F0050180529E52970021529C3E529940A505A
:10048F0002A120755C00D270A120E5296002152918
:10049F007400207F037896E624FAFEE43400FFC34D
:1004AF00EC9EFCED9FFD50067800790081ECC3ECCB
:1004BF0094FFED9400400678FF790081ECEC857293
:1004CF00F0A4C5F0A2F733F87900400302050878CD
:1004DF00FF7900020508E9C313F9E813F8307C0E21
:1004EF00E9600278FFC3E81338F8E43400F9C3E891
:1004FF0094FFE99400400278FF885CD2702061027B
:10050F00A120741FF4552F4BF52FC274EB7002D23C
:10051F0074752A40307403752A0A306102A13420A1
:10052F00740353DAFE207403752B20D0F0D0E0D083
:10053F00D0D2AD43E610327901020564790302058A
:10054F0064790A020564791E020564796402056400
:10055F0079C80205647817E4D5E0FDD8FAD9F622F8
:10056F007A147B7802058B7A107B8C02058B7A0DBF
:10057F007BB402058B7A0B7BC802058BE573D5E044
:10058F0001227902E4C294D5E0FDD295D5E0FDC2
|
{
"pile_set_name": "Github"
}
|
/*
* Copyright (C) 2015-2016 Apple Inc. All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
* are met:
* 1. Redistributions of source code must retain the above copyright
* notice, this list of conditions and the following disclaimer.
* 2. Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in the
* documentation and/or other materials provided with the distribution.
*
* THIS SOFTWARE IS PROVIDED BY APPLE INC. ``AS IS'' AND ANY
* EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
* PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE INC. OR
* CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
* EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
* PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
* PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY
* OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
#include "config.h"
#include "DFGNodeOrigin.h"
#if ENABLE(DFG_JIT)
namespace JSC { namespace DFG {
void NodeOrigin::dump(PrintStream& out) const
{
out.print("{semantic: ", semantic, ", forExit: ", forExit, ", exitOK: ", exitOK, ", wasHoisted: ", wasHoisted, "}");
}
} } // namespace JSC::DFG
#endif // ENABLE(DFG_JIT)
|
{
"pile_set_name": "Github"
}
|
/* ----------------------------------------------------------------------------
* SAM Software Package License
* ----------------------------------------------------------------------------
* Copyright (c) 2012, Atmel Corporation
*
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following condition is met:
*
* - Redistributions of source code must retain the above copyright notice,
* this list of conditions and the disclaimer below.
*
* Atmel's name may not be used to endorse or promote products derived from
* this software without specific prior written permission.
*
* DISCLAIMER: THIS SOFTWARE IS PROVIDED BY ATMEL "AS IS" AND ANY EXPRESS OR
* IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
* MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT ARE
* DISCLAIMED. IN NO EVENT SHALL ATMEL BE LIABLE FOR ANY DIRECT, INDIRECT,
* INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
* LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA,
* OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
* LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
* NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE,
* EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
* ----------------------------------------------------------------------------
*/
INCLUDE sam4s8_sram.ld
|
{
"pile_set_name": "Github"
}
|
{
"culture": "ar",
"texts": {
"ThisFieldIsRequired": "الحقل مطلوب",
"MaxLenghtErrorMessage": "اقصى طول للحقل '{0}' حرف"
}
}
|
{
"pile_set_name": "Github"
}
|
package mods.eln.node;
import cpw.mods.fml.relauncher.Side;
import cpw.mods.fml.relauncher.SideOnly;
import mods.eln.misc.Direction;
import net.minecraft.client.gui.GuiScreen;
import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.inventory.Container;
import java.io.DataInputStream;
public interface INodeEntity {
String getNodeUuid();
void serverPublishUnserialize(DataInputStream stream);
void serverPacketUnserialize(DataInputStream stream);
@SideOnly(Side.CLIENT)
GuiScreen newGuiDraw(Direction side, EntityPlayer player);
Container newContainer(Direction side, EntityPlayer player);
}
|
{
"pile_set_name": "Github"
}
|
/*
* $Id: TestRequestUtilsPopulate.java 471754 2006-11-06 14:55:09Z husted $
*
* Licensed to the Apache Software Foundation (ASF) under one
* or more contributor license agreements. See the NOTICE file
* distributed with this work for additional information
* regarding copyright ownership. The ASF licenses this file
* to you under the Apache License, Version 2.0 (the
* "License"); you may not use this file except in compliance
* with the License. You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing,
* software distributed under the License is distributed on an
* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
* KIND, either express or implied. See the License for the
* specific language governing permissions and limitations
* under the License.
*/
package org.apache.struts.util;
import javax.servlet.ServletException;
import junit.framework.Test;
import junit.framework.TestSuite;
import org.apache.struts.action.ActionMapping;
import org.apache.struts.util.RequestUtils;
import org.apache.struts.Globals;
import org.apache.struts.mock.TestMockBase;
import org.apache.struts.mock.MockFormBean;
import org.apache.struts.mock.MockMultipartRequestHandler;
/**
* Unit tests for the RequestUtil's <code>populate</code> method.
*
* @version $Rev: 471754 $
*/
public class TestRequestUtilsPopulate extends TestMockBase {
/**
* Defines the testcase name for JUnit.
*
* @param theName the testcase's name.
*/
public TestRequestUtilsPopulate(String theName) {
super(theName);
}
/**
* Start the tests.
*
* @param theArgs the arguments. Not used
*/
public static void main(String[] theArgs) {
junit.awtui.TestRunner.main(
new String[] { TestRequestUtilsPopulate.class.getName()});
}
/**
* @return a test suite (<code>TestSuite</code>) that includes all methods
* starting with "test"
*/
public static Test suite() {
// All methods starting with "test" will be executed in the test suite.
return new TestSuite(TestRequestUtilsPopulate.class);
}
public void setUp() {
super.setUp();
}
public void tearDown() {
super.tearDown();
}
/**
* Ensure that the getMultipartRequestHandler cannot be seen in
* a subclass of ActionForm.
*
* The purpose of this test is to ensure that Bug #38534 is fixed.
*
*/
public void testMultipartVisibility() throws Exception {
String mockMappingName = "mockMapping";
String stringValue = "Test";
MockFormBean mockForm = new MockFormBean();
ActionMapping mapping = new ActionMapping();
mapping.setName(mockMappingName);
// Set up the mock HttpServletRequest
request.setMethod("POST");
request.setContentType("multipart/form-data");
request.setAttribute(Globals.MULTIPART_KEY, MockMultipartRequestHandler.class.getName());
request.setAttribute(Globals.MAPPING_KEY, mapping);
request.addParameter("stringProperty", stringValue);
request.addParameter("multipartRequestHandler.mapping.name", "Bad");
// Check the Mapping/ActionForm before
assertNull("Multipart Handler already set", mockForm.getMultipartRequestHandler());
assertEquals("Mapping name not set correctly", mockMappingName, mapping.getName());
// Try to populate
try {
RequestUtils.populate(mockForm, request);
} catch(ServletException se) {
// Expected BeanUtils.populate() to throw a NestedNullException
// which gets wrapped in RequestUtils in a ServletException
assertEquals("Unexpected type of Exception thrown", "BeanUtils.populate", se.getMessage());
}
// Check the Mapping/ActionForm after
assertNotNull("Multipart Handler Missing", mockForm.getMultipartRequestHandler());
assertEquals("Mapping name has been modified", mockMappingName, mapping.getName());
}
}
|
{
"pile_set_name": "Github"
}
|
@model MonitoringWebApp.Models.ChangePasswordViewModel
@{
ViewBag.Title = "Change Password";
}
<h2>@ViewBag.Title.</h2>
@using (Html.BeginForm("ChangePassword", "Manage", FormMethod.Post, new { @class = "form-horizontal", role = "form" }))
{
@Html.AntiForgeryToken()
<h4>Change Password Form</h4>
<hr />
@Html.ValidationSummary("", new { @class = "text-danger" })
<div class="form-group">
@Html.LabelFor(m => m.OldPassword, new { @class = "col-md-2 control-label" })
<div class="col-md-10">
@Html.PasswordFor(m => m.OldPassword, new { @class = "form-control" })
</div>
</div>
<div class="form-group">
@Html.LabelFor(m => m.NewPassword, new { @class = "col-md-2 control-label" })
<div class="col-md-10">
@Html.PasswordFor(m => m.NewPassword, new { @class = "form-control" })
</div>
</div>
<div class="form-group">
@Html.LabelFor(m => m.ConfirmPassword, new { @class = "col-md-2 control-label" })
<div class="col-md-10">
@Html.PasswordFor(m => m.ConfirmPassword, new { @class = "form-control" })
</div>
</div>
<div class="form-group">
<div class="col-md-offset-2 col-md-10">
<input type="submit" value="Change password" class="btn btn-default" />
</div>
</div>
}
@section Scripts {
@Scripts.Render("~/bundles/jqueryval")
}
|
{
"pile_set_name": "Github"
}
|
(ns restql.core.statement.resolve-chained-values-test
(:require [clojure.test :refer :all]
[restql.core.statement.resolve-chained-values :refer [resolve-chained-values]]))
(deftest resolve-chained-values-test
(testing "Do nothing if theres no with chained"
(is (= {:from :resource-name :with {:id 1}}
(resolve-chained-values {:from :resource-name :with {:id 1}}
{}))))
(testing "Returns a statement with :empty-chained as value if done-resource status code is not in 399 >= status >= 200"
(is (= {:from :resource-name, :with {:id :empty-chained}}
(resolve-chained-values {:from :resource-name :with {:id [:done-resource :id]}}
[[:done-resource {:status 422 :body "ERROR"}]])))
(is (= {:from :resource-name :with {:id [:empty-chained 2]}}
(resolve-chained-values {:from :resource-name :with {:id [:done-resource :id]}}
[[:done-resource [{:status 400 :body "ERROR"} {:body {:id 2}}]]]))))
(testing "Returns a statement with single done resource value"
(is (= {:from :resource-name :with {:id 1}}
(resolve-chained-values {:from :resource-name :with {:id [:done-resource :id]}}
[[:done-resource {:body {:id 1}}]])))
(is (= {:from :resource-name :with {:id 1 :name "clojurist"}}
(resolve-chained-values {:from :resource-name :with {:id 1 :name [:done-resource :resource-id]}}
[[:done-resource {:body {:resource-id "clojurist"}}]])))
(is (= {:from :resource-name :with {:id 1 :name ["clojurist"]}}
(resolve-chained-values {:from :resource-name :with {:id 1 :name [:done-resource :resource-id]}}
[[:done-resource {:body {:resource-id ["clojurist"]}}]]))))
(testing "Returns a statement with multiple done resource value"
(is (= {:from :resource-name :with {:id [1 2]}}
(resolve-chained-values {:from :resource-name :with {:id [:done-resource :id]}}
[[:done-resource [{:body {:id 1}} {:body {:id 2}}]]]))))
(testing "Returns a statement with single list value"
(is (= {:from :resource-name :with {:id [1 2] :name ["a" "b"]}}
(resolve-chained-values {:from :resource-name :with {:id [:done-resource :id] :name ["a" "b"]}}
[[:done-resource {:body {:id [1 2]}}]]))))
(testing "Returns a statement with single list value"
(is (= {:from :resource-name :with {:id [[1 2] [2 3]] :name ["a" "b"]}}
(resolve-chained-values {:from :resource-name :with {:id [:done-resource :id] :name ["a" "b"]}}
[[:done-resource [{:body {:id [1 2]}}
{:body {:id [2 3]}}]]]))))
(testing "Returns a statement with multiple list value"
(is (= {:from :sidekick :with {:id [[1 2] [3 4]]} :method :get}
(resolve-chained-values {:from :sidekick :with {:id [:heroes :sidekickId]} :method :get}
[[:heroes {:resource :heroes :body [{:id "A" :sidekickId [1 2]}
{:id "B" :sidekickId [3 4]}]}]])))
(is (= {:from :sidekick :with {:id [[[1 2] [3 4]]]} :method :get}
(resolve-chained-values {:from :sidekick :with {:id [:heroes :sidekickId]} :method :get}
[[:heroes [{:resource :heroes :body [{:id "A" :sidekickId [1 2]}
{:id "B" :sidekickId [3 4]}]}]]]))))
(testing "Returns a statement with single list value"
(is (= {:from :resource-name :with {:id [1 nil] :name ["a" "b"]}}
(resolve-chained-values {:from :resource-name :with {:id [:done-resource :id] :name ["a" "b"]}}
[[:done-resource [{:body {:id 1 :class "rest"}} {:body {:id nil :class "rest"}}]]]))))
(testing "Returns a statement with empty param"
(is (= {:from :resource-name :with {:id [1 nil] :name ["a" "b"]}}
(resolve-chained-values {:from :resource-name :with {:id [:done-resource :id] :name ["a" "b"]}}
[[:done-resource [{:body {:id 1 :class "rest"}} {:body {:class "rest"}}]]]))))
(testing "Resolve a statement with lists and nested values"
(is (= {:from :done-resource :with {:name ["clojure" "java"]}}
(resolve-chained-values {:from :done-resource :with {:name [:resource-id :language :id]}}
[[:resource-id {:body {:language {:id ["clojure" "java"]}}}]])))
(is (= {:from :done-resource :with {:name "clojure"}}
(resolve-chained-values {:from :done-resource :with {:name [:resource-id :language :id]}}
[[:resource-id {:body {:language {:id "clojure"}}}]])))
(is (= {:from :done-resource :with {:name ["clojure"]}}
(resolve-chained-values {:from :done-resource :with {:name [:resource-id :language :id]}}
[[:resource-id {:body {:language [{:id "clojure"}]}}]])))
(is (= {:from :done-resource :with {:name ["clojure" "java"]}}
(resolve-chained-values {:from :done-resource :with {:name [:resource-id :language :id]}}
[[:resource-id {:body {:language [{:id "clojure"} {:id "java"}]}}]])))
(is (= {:from :done-resource :with {:name ["python" "elixir"]}}
(resolve-chained-values {:from :done-resource :with {:name [:resource-id :language :xpto :id]}}
[[:resource-id {:body {:language [{:xpto {:id "python"}} {:xpto {:id "elixir"}}]}}]])))
(is (= {:from :done-resource :with {:name [["python" "123"] ["elixir" "345"]]}}
(resolve-chained-values {:from :done-resource :with {:name [:resource-id :language :xpto :id]}}
[[:resource-id {:body {:language [{:xpto {:id ["python" "123"]}} {:xpto {:id ["elixir" "345"]}}]}}]])))
(is (= {:from :done-resource :with {:name [["python" "123"] ["elixir" "345"]]}}
(resolve-chained-values {:from :done-resource :with {:name [:resource-id :language :xpto :asdf :id]}}
[[:resource-id {:body {:language [{:xpto {:asdf [{:id "python"} {:id "123"}]}} {:xpto {:asdf [{:id "elixir"} {:id "345"}]}}]}}]])))
(is (= {:from :weapon, :in :villain.weapons, :with {:id [[["DAGGER"] ["GUN"]] [["SWORD"] ["SHOTGUN"]]]}, :method :get}
(resolve-chained-values {:from :weapon, :in :villain.weapons, :with {:id [:villain :weapons]}, :method :
|
{
"pile_set_name": "Github"
}
|
// Package buffer implements a buffer for serialization, consisting of a chain of []byte-s to
// reduce copying and to allow reuse of individual chunks.
package buffer
import (
"io"
"sync"
)
// PoolConfig contains configuration for the allocation and reuse strategy.
type PoolConfig struct {
StartSize int // Minimum chunk size that is allocated.
PooledSize int // Minimum chunk size that is reused, reusing chunks too small will result in overhead.
MaxSize int // Maximum chunk size that will be allocated.
}
var config = PoolConfig{
StartSize: 128,
PooledSize: 512,
MaxSize: 32768,
}
// Reuse pool: chunk size -> pool.
var buffers = map[int]*sync.Pool{}
func initBuffers() {
for l := config.PooledSize; l <= config.MaxSize; l *= 2 {
buffers[l] = new(sync.Pool)
}
}
func init() {
initBuffers()
}
// Init sets up a non-default pooling and allocation strategy. Should be run before serialization is done.
func Init(cfg PoolConfig) {
config = cfg
initBuffers()
}
// putBuf puts a chunk to reuse pool if it can be reused.
func putBuf(buf []byte) {
size := cap(buf)
if size < config.PooledSize {
return
}
if c := buffers[size]; c != nil {
c.Put(buf[:0])
}
}
// getBuf gets a chunk from reuse pool or creates a new one if reuse failed.
func getBuf(size int) []byte {
if size < config.PooledSize {
return make([]byte, 0, size)
}
if c := buffers[size]; c != nil {
v := c.Get()
if v != nil {
return v.([]byte)
}
}
return make([]byte, 0, size)
}
// Buffer is a buffer optimized for serialization without extra copying.
type Buffer struct {
// Buf is the current chunk that can be used for serialization.
Buf []byte
toPool []byte
bufs [][]byte
}
// EnsureSpace makes sure that the current chunk contains at least s free bytes,
// possibly creating a new chunk.
func (b *Buffer) EnsureSpace(s int) {
if cap(b.Buf)-len(b.Buf) >= s {
return
}
l := len(b.Buf)
if l > 0 {
if cap(b.toPool) != cap(b.Buf) {
// Chunk was reallocated, toPool can be pooled.
putBuf(b.toPool)
}
if cap(b.bufs) == 0 {
b.bufs = make([][]byte, 0, 8)
}
b.bufs = append(b.bufs, b.Buf)
l = cap(b.toPool) * 2
} else {
l = config.StartSize
}
if l > config.MaxSize {
l = config.MaxSize
}
b.Buf = getBuf(l)
b.toPool = b.Buf
}
// AppendByte appends a single byte to buffer.
func (b *Buffer) AppendByte(data byte) {
if cap(b.Buf) == len(b.Buf) { // EnsureSpace won't be inlined.
b.EnsureSpace(1)
}
b.Buf = append(b.Buf, data)
}
// AppendBytes appends a byte slice to buffer.
func (b *Buffer) AppendBytes(data []byte) {
for len(data) > 0 {
if cap(b.Buf) == len(b.Buf) { // EnsureSpace won't be inlined.
b.EnsureSpace(1)
}
sz := cap(b.Buf) - len(b.Buf)
if sz > len(data) {
sz = len(data)
}
b.Buf = append(b.Buf, data[:sz]...)
data = data[sz:]
}
}
// AppendBytes appends a string to buffer.
func (b *Buffer) AppendString(data string) {
for len(data) > 0 {
if cap(b.Buf) == len(b.Buf) { // EnsureSpace won't be inlined.
b.EnsureSpace(1)
}
sz := cap(b.Buf) - len(b.Buf)
if sz > len(data) {
sz = len(data)
}
b.Buf = append(b.Buf, data[:sz]...)
data = data[sz:]
}
}
// Size computes the size of a buffer by adding sizes of every chunk.
func (b *Buffer) Size() int {
size := len(b.Buf)
for _, buf := range b.bufs {
size += len(buf)
}
return size
}
// DumpTo outputs the contents of a buffer to a writer and resets the buffer.
func (b *Buffer) DumpTo(w io.Writer) (written int, err error) {
var n int
for _, buf := range b.bufs {
if err == nil {
n, err = w.Write(buf)
written += n
}
putBuf(buf)
}
if err == nil {
n, err = w.Write(b.Buf)
written += n
}
putBuf(b.toPool)
b.bufs = nil
b.Buf = nil
b.toPool = nil
return
}
// BuildBytes creates a single byte slice with all the contents of the buffer. Data is
// copied if it does not fit in a single chunk.
func (b *Buffer) BuildBytes() []byte {
if len(b.bufs) == 0 {
ret := b.Buf
b.toPool = nil
b.Buf = nil
return ret
}
ret := make([]byte, 0, b.Size())
for _, buf := range b.bufs {
ret = append(ret, buf...)
putBuf(buf)
}
ret = append(ret, b.Buf...)
putBuf(b.toPool)
b.bufs = nil
b.toPool = nil
b.Buf = nil
return ret
}
|
{
"pile_set_name": "Github"
}
|
using Models.Produce.NH;
using NHibernate;
using NHibernate.Cfg;
namespace Sample_WebApi.Controllers {
public static class ProduceNHConfig {
private static Configuration _configuration;
private static ISessionFactory _sessionFactory;
static ProduceNHConfig()
{
var modelAssembly = typeof(ItemOfProduce).Assembly;
// Configure NHibernate
_configuration = new Configuration();
_configuration.Configure(); //configure from the app.config
_configuration.SetProperty("connection.connection_string_name", "ProduceTPHConnection");
_configuration.AddAssembly(modelAssembly); // mapping is in this assembly
_sessionFactory = _configuration.BuildSessionFactory();
}
public static Configuration Configuration
{
get { return _configuration; }
}
public static ISessionFactory SessionFactory
{
get { return _sessionFactory; }
}
public static ISession OpenSession()
{
ISession session = _sessionFactory.OpenSession();
return session;
}
}
}
|
{
"pile_set_name": "Github"
}
|
/*
* Copyright 2016 Crown Copyright
*
* 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 stroom.explorer.client.event;
import com.google.gwt.event.shared.EventHandler;
import com.google.gwt.event.shared.GwtEvent;
import com.google.gwt.event.shared.HasHandlers;
import com.gwtplatform.mvp.client.Layer;
import stroom.widget.tab.client.presenter.TabData;
public class OpenExplorerTabEvent extends GwtEvent<OpenExplorerTabEvent.Handler> {
private static Type<Handler> TYPE;
private final TabData tabData;
private final Layer layer;
private OpenExplorerTabEvent(final TabData tabData, final Layer layer) {
this.tabData = tabData;
this.layer = layer;
}
public static void fire(final HasHandlers handlers, final TabData tabData, final Layer layer) {
handlers.fireEvent(new OpenExplorerTabEvent(tabData, layer));
}
public static Type<Handler> getType() {
if (TYPE == null) {
TYPE = new Type<>();
}
return TYPE;
}
@Override
public Type<Handler> getAssociatedType() {
return getType();
}
@Override
protected void dispatch(final Handler handler) {
handler.onOpen(this);
}
public TabData getTabData() {
return tabData;
}
public Layer getLayer() {
return layer;
}
public interface Handler extends EventHandler {
void onOpen(OpenExplorerTabEvent event);
}
}
|
{
"pile_set_name": "Github"
}
|
#!/home/architect/.virtualenvs/asciivmssconsole3/bin/python3.6
import os
import sys
import platform
our_version = "python" + str(sys.version_info.major) + "." + str(sys.version_info.minor)
our_abs_path = os.path.dirname(os.path.abspath(__file__))
#Linux or Windows?
oursystem = platform.system();
if (oursystem == "Linux"):
program_prefix = "bin";
program_suffix = "lib/" + our_version + "/site-packages/asciivmssdashboard/console.py"
python_path = our_abs_path + "/python" + str(sys.version_info.major) + " "
else:
program_prefix = "Scripts";
program_suffix = "lib/" + "site-packages/asciivmssdashboard/console.py"
python_path = our_abs_path.replace("Scripts", "\python.exe ")
#Ok, now we have our packages full path. Or should...
our_abs_final_path = our_abs_path.replace(program_prefix, program_suffix)
#We got some difficulties with Python installation files on Ubuntu...
#Python Binary first...
if os.path.exists(python_path[:-1]):
print("-> Python installation seems OK...")
else:
print(python_path)
print("--> Seems like the Python installation path: " + python_path + "is broken, trying an alternative path...")
python_path = python_path.replace("local/", "")
#Now our package files...
if os.path.exists(our_abs_final_path):
print("-> Our Python package installation seems OK...")
else:
print("--> Seems like our package installation path: " + our_abs_final_path + " is broken, trying an alternative path...")
our_abs_final_path = our_abs_final_path.replace("site-packages", "dist-packages")
dash_script = python_path + our_abs_final_path
#Well, now we have a good guess where our script is installed...
print("Executing: " + dash_script)
print("Wait a second...")
os.system(dash_script)
|
{
"pile_set_name": "Github"
}
|
// 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 !gccgo
#include "textflag.h"
//
// System call support for AMD64, OpenBSD
//
// Just jump to package syscall's implementation for all these functions.
// The runtime may know about them.
TEXT ·Syscall(SB),NOSPLIT,$0-56
JMP syscall·Syscall(SB)
TEXT ·Syscall6(SB),NOSPLIT,$0-80
JMP syscall·Syscall6(SB)
TEXT ·Syscall9(SB),NOSPLIT,$0-104
JMP syscall·Syscall9(SB)
TEXT ·RawSyscall(SB),NOSPLIT,$0-56
JMP syscall·RawSyscall(SB)
TEXT ·RawSyscall6(SB),NOSPLIT,$0-80
JMP syscall·RawSyscall6(SB)
|
{
"pile_set_name": "Github"
}
|
#ifndef BOOST_MPL_RATIONAL_C_HPP_INCLUDED
#define BOOST_MPL_RATIONAL_C_HPP_INCLUDED
// Copyright Aleksey Gurtovoy 2000-2004
//
// Distributed under the Boost Software License, Version 1.0.
// (See accompanying file LICENSE_1_0.txt or copy at
// http://www.boost.org/LICENSE_1_0.txt)
//
// See http://www.boost.org/libs/mpl for documentation.
// $Id$
// $Date$
// $Revision$
#include <boost/mpl/aux_/config/static_constant.hpp>
namespace boost { namespace mpl {
template<
typename IntegerType
, IntegerType N
, IntegerType D = 1
>
struct rational_c
{
BOOST_STATIC_CONSTANT(IntegerType, numerator = N);
BOOST_STATIC_CONSTANT(IntegerType, denominator = D);
typedef rational_c<IntegerType,N,D> type;
rational_c() {}
};
}}
#endif // BOOST_MPL_RATIONAL_C_HPP_INCLUDED
|
{
"pile_set_name": "Github"
}
|
<!DOCTYPE html>
<html lang="en">
<head>
<link href="/css/video-js.css" rel="stylesheet">
<!-- If you'd like to support IE8 -->
<script src="/js/videojs-ie8.min.js"></script>
<!-- Global site tag (gtag.js) - Google Analytics -->
<script async src="https://www.googletagmanager.com/gtag/js?id=UA-108121762-1"></script>
<script>
window.dataLayer = window.dataLayer || [];
function gtag(){dataLayer.push(arguments);}
gtag('js', new Date());
gtag('config', 'UA-108121762-1');
</script>
<title>Star Wars: The Clone Wars (2008 - 2015) Full Episodes | ItSaturday.com</title>
<meta charset="utf-8">
<link rel="stylesheet" href="/css/bootstrap.min.css">
<link rel="stylesheet" type="text/css" href="/css/main.css">
<link rel="stylesheet" type="text/css" href="https://maxcdn.bootstrapcdn.com/font-awesome/4.5.0/css/font-awesome.min.css">
<link rel="stylesheet" type="text/css" href="/css/bootcomplete.css">
<script src="/js/jquery.min.js"></script>
<script src="/js/jquery-ui-1.12.1.custom/jquery-ui.min.js"></script>
<script src="/js/Lettering.js-master/jquery.lettering.js"></script>
<script src="/js/jquery_lazyload.js" type="text/javascript"></script>
<script src="https://npmcdn.com/tether@1.2.4/dist/js/tether.min.js"></script>
<script src="/js/bootstrap.min.js"></script>
<script src="/js/EasyAutocomplete-1.3.5/jquery.easy-autocomplete.js"></script>
<link rel="stylesheet" href="/js/EasyAutocomplete-1.3.5/easy-autocomplete.min.css">
<meta name="keywords" content=""/>
<meta property="og:title" content="Star Wars: The Clone Wars (2008 - 2015) Full Episodes"/>
<meta property="og:description" content=""/>
<meta property="og:type" content=""/>
<meta property="og:url" content="http://www.itsaturday.com/Star-Wars-The-Clone-Wars-S6-Ep13---Sacrifice.html"/>
<meta property="og:image" content="http://www.itsaturday.com/images/seriesImages/2023/Star-Wars-The-Clone-Wars-2008--2015-Full-Episodes.jpg"/>
<meta property="og:site_name" content="http://www.itsaturday.com"/>
<meta name="twitter:card" content="summary">
<meta name="twitter:site" content="@">
<meta name="twitter:url" content="http://www.itsaturday.com/Star-Wars-The-Clone-Wars-S6-Ep13---Sacrifice.html">
<meta name="twitter:title" content="Star Wars: The Clone Wars (2008 - 2015) Full Episodes">
<meta name="twitter:description" content="">
<meta name="twitter:image" content="http://www.itsaturday.com/images/seriesImages/2023/Star-Wars-The-Clone-Wars-2008--2015-Full-Episodes.jpg">
<meta property="fb:app_id" content="?"/>
<meta name="verify-v1" content="?"/>
<meta itemprop="url" content="http://www.itsaturday.com/Star-Wars-The-Clone-Wars-S6-Ep13---Sacrifice.html"/>
<link rel="image_src" href="http://www.itsaturday.com/images/seriesImages/2023/Star-Wars-The-Clone-Wars-2008--2015-Full-Episodes.jpg"/>
<link rel="videothumbnail" href="http://www.itsaturday.com/images/seriesImages/2023/Star-Wars-The-Clone-Wars-2008--2015-Full-Episodes.jpg" type="image/jpeg"/>
<script>
$("document").ready(function () {
lazyload();
});
</script>
</head>
<body>
<div class="header container">
<div class="row hundred">
<div class="float-left" style="width: 240px; margin-left: 20px;">
<h1 class="h1" id="toggle" id="logo">
<h1 id="logo">
<a href="/" class="link-unstyled">
<span class="char1">I</span><span class="char2">t</span><span class="char3 spacer-char">S</span><span
class="char4">a</span><span class="char5">t</span><span class="char6">u</span><span
class="char7">r</span><span class="char8">d</span><span class="char9">a</span><span
class="char3">y</span><span class="char2">!</span>
</a>
</h1>
</h1>
</div>
<form action="/search/" method="get"><div class="float-left row" style="margin-top: 15px;" >
<div class="searchboxwrapper col-12" >
<input id="search-input" type="text" class="searchbox rounded" style="" placeholder="Series, Episode, Year..." autocomplete="off" name="q"/>
<input class="searchsubmit rounded" type="submit" id="searchsubmit" value="">
</div>
</form>
</div>
</div>
</div>
<script>
</script>
<script>
$(document).ready(function () {
var options = {
url: function(phrase) {
return "_search.php?q=" + phrase + "&format=json";
},
getValue: "text",
template: {
type: "links",
fields: {
link: "website-link"
}
},
ajaxSettings: {
dataType: "json",
method: "POST",
data: {
dataType: "json"
}
},
preparePostData: function (data) {
data.phrase = $("#search-input").val();
return data;
},
requestDelay: 400
};
$("#search-input").easyAutocomplete(options);
$('input.typeahead').typeahead(options);
$("#demo1 h1").lettering();
$("#demo2 h1").lettering('words');
$("#demo3 p").lettering('lines');
$("#demo4 h1").lettering('words').children("span").lettering();
$("#demo5 h1").lettering().children("span").css({
'display': 'inline-block',
'-webkit-transform': 'rotate(-25deg)'
});
});
</script>
<script>
$('#toggle').click(function () {
$("#toggle").effect("shake");
$('#toggle').wiggle({
waggle: 5, // amount of wiggle
duration: 2, // how long to wiggle (in seconds)
interval: 200, // how often to waggle (in milliseconds)
wiggleCallback: function (elem) {
// callback whenever the element is wiggled
}
});
});
</script>
<div class="sidebar col-3 rounded-bottom">
<h1 class="h3">Star Wars: The Clone Wars </h1>
<div class="list-group"><div class="bg-success rounded highlight"><span class="link-unstyled"><i class="fa fa-play-circle fa-fw"></i>S1 Ep1 – Ambush</span></div><div class="half-rule"></div><a class="link-group-item list-group-item-padding
|
{
"pile_set_name": "Github"
}
|
var expect = require("chai").expect;
module.exports = function(helpers) {
var widget = helpers.mount(require.resolve("./index"), {});
expect(widget.getEl("foo").className).to.equal("foo");
expect(widget.getEl("bar").className).to.equal("bar");
expect(widget.getEl("foo-bar").className).to.equal("foo-bar");
};
|
{
"pile_set_name": "Github"
}
|
/*
* Summary: interface for the encoding conversion functions
* Description: interface for the encoding conversion functions needed for
* XML basic encoding and iconv() support.
*
* Related specs are
* rfc2044 (UTF-8 and UTF-16) F. Yergeau Alis Technologies
* [ISO-10646] UTF-8 and UTF-16 in Annexes
* [ISO-8859-1] ISO Latin-1 characters codes.
* [UNICODE] The Unicode Consortium, "The Unicode Standard --
* Worldwide Character Encoding -- Version 1.0", Addison-
* Wesley, Volume 1, 1991, Volume 2, 1992. UTF-8 is
* described in Unicode Technical Report #4.
* [US-ASCII] Coded Character Set--7-bit American Standard Code for
* Information Interchange, ANSI X3.4-1986.
*
* Copy: See Copyright for the status of this software.
*
* Author: Daniel Veillard
*/
#ifndef __XML_CHAR_ENCODING_H__
#define __XML_CHAR_ENCODING_H__
#include <libxml/xmlversion.h>
#ifdef LIBXML_ICONV_ENABLED
#include <iconv.h>
#endif
#ifdef LIBXML_ICU_ENABLED
#include <unicode/ucnv.h>
#endif
#ifdef __cplusplus
extern "C" {
#endif
/*
* xmlCharEncoding:
*
* Predefined values for some standard encodings.
* Libxml does not do beforehand translation on UTF8 and ISOLatinX.
* It also supports ASCII, ISO-8859-1, and UTF16 (LE and BE) by default.
*
* Anything else would have to be translated to UTF8 before being
* given to the parser itself. The BOM for UTF16 and the encoding
* declaration are looked at and a converter is looked for at that
* point. If not found the parser stops here as asked by the XML REC. A
* converter can be registered by the user using xmlRegisterCharEncodingHandler
* but the current form doesn't allow stateful transcoding (a serious
* problem agreed !). If iconv has been found it will be used
* automatically and allow stateful transcoding, the simplest is then
* to be sure to enable iconv and to provide iconv libs for the encoding
* support needed.
*
* Note that the generic "UTF-16" is not a predefined value. Instead, only
* the specific UTF-16LE and UTF-16BE are present.
*/
typedef enum {
XML_CHAR_ENCODING_ERROR= -1, /* No char encoding detected */
XML_CHAR_ENCODING_NONE= 0, /* No char encoding detected */
XML_CHAR_ENCODING_UTF8= 1, /* UTF-8 */
XML_CHAR_ENCODING_UTF16LE= 2, /* UTF-16 little endian */
XML_CHAR_ENCODING_UTF16BE= 3, /* UTF-16 big endian */
XML_CHAR_ENCODING_UCS4LE= 4, /* UCS-4 little endian */
XML_CHAR_ENCODING_UCS4BE= 5, /* UCS-4 big endian */
XML_CHAR_ENCODING_EBCDIC= 6, /* EBCDIC uh! */
XML_CHAR_ENCODING_UCS4_2143=7, /* UCS-4 unusual ordering */
XML_CHAR_ENCODING_UCS4_3412=8, /* UCS-4 unusual ordering */
XML_CHAR_ENCODING_UCS2= 9, /* UCS-2 */
XML_CHAR_ENCODING_8859_1= 10,/* ISO-8859-1 ISO Latin 1 */
XML_CHAR_ENCODING_8859_2= 11,/* ISO-8859-2 ISO Latin 2 */
XML_CHAR_ENCODING_8859_3= 12,/* ISO-8859-3 */
XML_CHAR_ENCODING_8859_4= 13,/* ISO-8859-4 */
XML_CHAR_ENCODING_8859_5= 14,/* ISO-8859-5 */
XML_CHAR_ENCODING_8859_6= 15,/* ISO-8859-6 */
XML_CHAR_ENCODING_8859_7= 16,/* ISO-8859-7 */
XML_CHAR_ENCODING_8859_8= 17,/* ISO-8859-8 */
XML_CHAR_ENCODING_8859_9= 18,/* ISO-8859-9 */
XML_CHAR_ENCODING_2022_JP= 19,/* ISO-2022-JP */
XML_CHAR_ENCODING_SHIFT_JIS=20,/* Shift_JIS */
XML_CHAR_ENCODING_EUC_JP= 21,/* EUC-JP */
XML_CHAR_ENCODING_ASCII= 22 /* pure ASCII */
} xmlCharEncoding;
/**
* xmlCharEncodingInputFunc:
* @out: a pointer to an array of bytes to store the UTF-8 result
* @outlen: the length of @out
* @in: a pointer to an array of chars in the original encoding
* @inlen: the length of @in
*
* Take a block of chars in the original encoding and try to convert
* it to an UTF-8 block of chars out.
*
* Returns the number of bytes written, -1 if lack of space, or -2
* if the transcoding failed.
* The value of @inlen after return is the number of octets consumed
* if the return value is positive, else unpredictiable.
* The value of @outlen after return is the number of octets consumed.
*/
typedef int (* xmlCharEncodingInputFunc)(unsigned char *out, int *outlen,
const unsigned char *in, int *inlen);
/**
* xmlCharEncodingOutputFunc:
* @out: a pointer to an array of bytes to store the result
* @outlen: the length of @out
* @in: a pointer to an array of UTF-8 chars
* @inlen: the length of @in
*
* Take a block of UTF-8 chars in and try to convert it to another
* encoding.
* Note: a first call designed to produce heading info is called with
* in = NULL. If stateful this should also initialize the encoder state.
*
* Returns the number of bytes written, -1 if lack of space, or -2
* if the transcoding failed.
* The value of @inlen after return is the number of octets consumed
* if the return value is positive, else unpredictiable.
* The value of @outlen after return is the number of octets produced.
*/
typedef int (* xmlCharEncodingOutputFunc)(unsigned char *out, int *outlen,
const unsigned char *in, int *inlen);
/*
* Block defining the handlers for non UTF-8 encodings.
* If iconv is supported, there are two extra fields.
*/
#ifdef LIBXML_ICU_ENABLED
struct _uconv_t {
UConverter *uconv; /* for conversion between an encoding and UTF-16 */
UConverter *utf8; /* for conversion between UTF-8 and UTF-16 */
};
typedef struct _uconv_t uconv_t;
#endif
typedef struct _xmlCharEncodingHandler xmlCharEncodingHandler;
typedef xmlCharEncodingHandler *xmlCharEncodingHandlerPtr;
struct _xmlCharEncodingHandler {
char *name;
xmlCharEncodingInputFunc input;
xmlCharEncodingOutputFunc output;
#ifdef LIBXML_ICONV_ENABLED
iconv_t iconv_in;
iconv_t iconv_out;
#endif /* LIBXML_ICONV_ENABLED */
#ifdef LIBXML_ICU_ENABLED
uconv_t *uconv_in;
uconv_t *uconv_out;
#endif /* LIBXML_ICU_ENABLED */
};
#ifdef __cplusplus
}
#endif
#include <libxml/tree.h>
#ifdef __cplusplus
extern "C" {
#endif
/*
* Interfaces for encoding handlers.
*/
XMLPUBFUN void XMLCALL
xmlInitCharEncodingHandlers (void);
XMLPUBFUN void XMLCALL
xmlCleanupCharEncodingHandlers (void);
XMLPUBFUN void XMLCALL
xmlRegisterCharEncodingHandler (xmlCharEncodingHandlerPtr handler);
XMLPUBFUN xmlCharEncodingHandlerPtr XMLCALL
xmlGetCharEncodingHandler (xmlCharEncoding enc);
XMLPUBF
|
{
"pile_set_name": "Github"
}
|
// Copyright 2018 Google LLC
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.
#include "google/cloud/storage/client.h"
#include "google/cloud/storage/oauth2/google_credentials.h"
#include <nlohmann/json.hpp>
#include <iostream>
int main() {
// Adding openssl to the global namespace when the user does not explicitly
// asks for it is too much namespace pollution. The application may not want
// that many dependencies. Also, on Windows that may drag really unwanted
// dependencies.
#ifdef OPENSSL_VERSION_NUMBER
#error "OPENSSL should not be included by storage public headers"
#endif // OPENSSL_VERSION_NUMBER
// Adding libcurl to the global namespace when the user does not explicitly
// asks for it is too much namespace pollution. The application may not want
// that many dependencies. Also, on Windows that may drag really unwanted
// dependencies.
#ifdef LIBCURL_VERSION
#error "LIBCURL should not be included by storage public headers"
#endif // OPENSSL_VERSION_NUMBER
std::cout << "PASSED: this is a compile-time test\n";
return 0;
}
|
{
"pile_set_name": "Github"
}
|
// Copyright 2017 The CrunchyCrypt Authors.
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.
#ifndef CRUNCHY_ALGS_MAC_MAC_INTERFACE_H_
#define CRUNCHY_ALGS_MAC_MAC_INTERFACE_H_
#include <stddef.h>
#include <memory>
#include <string>
#include "absl/strings/string_view.h"
#include "crunchy/util/status.h"
namespace crunchy {
// An interface for computing a cryptographic MAC.
class MacInterface {
public:
virtual ~MacInterface() = default;
// Signs the given std::string and returns the signature.
virtual StatusOr<std::string> Sign(absl::string_view input) const = 0;
// Verifies a signature.
virtual Status Verify(absl::string_view input,
absl::string_view signature) const = 0;
// Returns the length of a signature
virtual size_t GetSignatureLength() const = 0;
};
class MacFactory {
public:
virtual ~MacFactory() = default;
virtual size_t GetKeyLength() const = 0;
virtual size_t GetSignatureLength() const = 0;
virtual StatusOr<std::unique_ptr<MacInterface>> Make(
absl::string_view key) const = 0;
};
} // namespace crunchy
#endif // CRUNCHY_ALGS_MAC_MAC_INTERFACE_H_
|
{
"pile_set_name": "Github"
}
|
VERIFICATION
Verification is intended to assist the Chocolatey moderators and community
in verifying that this package's contents are trustworthy.
The embedded software have been downloaded from the listed download
location on <>
and can be verified by doing the following:
1. Download the following <https://ketarin.org/downloads/Ketarin/Ketarin-1.8.11.zip>
2. Get the checksum using one of the following methods:
- Using powershell function 'Get-FileHash'
- Use chocolatey utility 'checksum.exe'
3. The checksums should match the following:
checksum type: sha256
checksum: EE02CE6715983EA7876957775607F54B899617C31F38F3301BB91AE6D175AAC7
The file 'LICENSE.txt' has been obtained from <https://www.gnu.org/licenses/gpl-2.0.txt>
|
{
"pile_set_name": "Github"
}
|
/*
* Copyright 2013-2020 the original author or authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package org.cloudfoundry.client.v2.spacequotadefinitions;
import com.fasterxml.jackson.annotation.JsonIgnore;
import org.immutables.value.Value;
/**
* The request payload for the Retrieve a Particular Space Quota Definition operation
*/
@Value.Immutable
abstract class _GetSpaceQuotaDefinitionRequest {
/**
* The space quota definition id
*/
@JsonIgnore
abstract String getSpaceQuotaDefinitionId();
}
|
{
"pile_set_name": "Github"
}
|
<?php
// +----------------------------------------------------------------------
// | ThinkPHP [ WE CAN DO IT JUST THINK IT ]
// +----------------------------------------------------------------------
// | Copyright (c) 2009 http://thinkphp.cn All rights reserved.
// +----------------------------------------------------------------------
// | Licensed ( http://www.apache.org/licenses/LICENSE-2.0 )
// +----------------------------------------------------------------------
// | Author: liu21st <liu21st@gmail.com>
// +----------------------------------------------------------------------
namespace Think\Crypt\Driver;
/**
* Base64 加密实现类
*/
class Think {
/**
* 加密字符串
* @param string $str 字符串
* @param string $key 加密key
* @param integer $expire 有效期(秒)
* @return string
*/
public static function encrypt($data,$key,$expire=0) {
$expire = sprintf('%010d', $expire ? $expire + time():0);
$key = md5($key);
$data = base64_encode($expire.$data);
$x = 0;
$len = strlen($data);
$l = strlen($key);
$char = $str = '';
for ($i = 0; $i < $len; $i++) {
if ($x == $l) $x = 0;
$char .= substr($key, $x, 1);
$x++;
}
for ($i = 0; $i < $len; $i++) {
$str .= chr(ord(substr($data, $i, 1)) + (ord(substr($char, $i, 1)))%256);
}
return str_replace(array('+','/','='),array('-','_',''),base64_encode($str));
}
/**
* 解密字符串
* @param string $str 字符串
* @param string $key 加密key
* @return string
*/
public static function decrypt($data,$key) {
$key = md5($key);
$data = str_replace(array('-','_'),array('+','/'),$data);
$mod4 = strlen($data) % 4;
if ($mod4) {
$data .= substr('====', $mod4);
}
$data = base64_decode($data);
$x = 0;
$len = strlen($data);
$l = strlen($key);
$char = $str = '';
for ($i = 0; $i < $len; $i++) {
if ($x == $l) $x = 0;
$char .= substr($key, $x, 1);
$x++;
}
for ($i = 0; $i < $len; $i++) {
if (ord(substr($data, $i, 1))<ord(substr($char, $i, 1))) {
$str .= chr((ord(substr($data, $i, 1)) + 256) - ord(substr($char, $i, 1)));
}else{
$str .= chr(ord(substr($data, $i, 1)) - ord(substr($char, $i, 1)));
}
}
$data = base64_decode($str);
$expire = substr($data,0,10);
if($expire > 0 && $expire < time()) {
return '';
}
$data = substr($data,10);
return $data;
}
}
|
{
"pile_set_name": "Github"
}
|
// warning: This file is auto generated by `npm run build:tests`
// Do not edit by hand!
process.env.TZ = 'UTC'
var expect = require('chai').expect
var ini_set = require('../../../../src/php/info/ini_set') // eslint-disable-line no-unused-vars,camelcase
var ini_get = require('../../../../src/php/info/ini_get') // eslint-disable-line no-unused-vars,camelcase
var arsort = require('../../../../src/php/array/arsort.js') // eslint-disable-line no-unused-vars,camelcase
describe('src/php/array/arsort.js (tested in test/languages/php/array/test-arsort.js)', function () {
it.skip('should pass example 1', function (done) {
var expected = {a: 'orange', d: 'lemon', b: 'banana', c: 'apple'}
var $data = {d: 'lemon', a: 'orange', b: 'banana', c: 'apple'}
arsort($data)
var result = $data
expect(result).to.deep.equal(expected)
done()
})
it('should pass example 2', function (done) {
var expected = {a: 'orange', d: 'lemon', b: 'banana', c: 'apple'}
ini_set('locutus.sortByReference', true)
var $data = {d: 'lemon', a: 'orange', b: 'banana', c: 'apple'}
arsort($data)
var result = $data
expect(result).to.deep.equal(expected)
done()
})
})
|
{
"pile_set_name": "Github"
}
|
# Up and Running
One can get up and running with endpoints in several ways.
#### Using npm
The primary way to use endpoints is to install it as an npm
package.
`npm install endpoints`
endpoints uses semantic versioning. Major breaking API changes
will only happen on major version releases.
#### Using the github repository
Because endpoints is in active, not-yet-major-versioned
development, one may be interested in using endpoints from
the github repository.
To do this, add this line to the dependencies in your `package.json`:
`"endpoints": "git://github.com/endpoints/endpoints.git"`
|
{
"pile_set_name": "Github"
}
|
## SPDX-License-Identifier: GPL-2.0-only
# -----------------------------------------------------------------
entries
# -----------------------------------------------------------------
# Status Register A
# -----------------------------------------------------------------
# Status Register B
# -----------------------------------------------------------------
# Status Register C
#96 4 r 0 status_c_rsvd
#100 1 r 0 uf_flag
#101 1 r 0 af_flag
#102 1 r 0 pf_flag
#103 1 r 0 irqf_flag
# -----------------------------------------------------------------
# Status Register D
#104 7 r 0 status_d_rsvd
#111 1 r 0 valid_cmos_ram
# -----------------------------------------------------------------
# Diagnostic Status Register
#112 8 r 0 diag_rsvd1
# -----------------------------------------------------------------
0 120 r 0 reserved_memory
#120 264 r 0 unused
# -----------------------------------------------------------------
# RTC_BOOT_BYTE (coreboot hardcoded)
384 1 e 4 boot_option
388 4 h 0 reboot_counter
#390 2 r 0 unused?
# -----------------------------------------------------------------
# coreboot config options: console
#392 3 r 0 unused
395 4 e 6 debug_level
#399 1 r 0 unused
# coreboot config options: cpu
400 1 e 2 hyper_threading
#401 7 r 0 unused
# coreboot config options: southbridge
408 1 e 1 nmi
#409 2 e 7 power_on_after_fail
411 1 e 8 sata_mode
#412 4 r 0 unused
# coreboot config options: bootloader
#Used by ChromeOS:
416 128 r 0 vbnv
# coreboot config options: northbridge
544 3 e 11 gfx_uma_size
#547 437 r 0 unused
# SandyBridge MRC Scrambler Seed values
896 32 r 0 mrc_scrambler_seed
928 32 r 0 mrc_scrambler_seed_s3
# coreboot config options: check sums
984 16 h 0 check_sum
#1000 24 r 0 amd_reserved
# -----------------------------------------------------------------
enumerations
#ID value text
1 0 Disable
1 1 Enable
2 0 Enable
2 1 Disable
4 0 Fallback
4 1 Normal
6 0 Emergency
6 1 Alert
6 2 Critical
6 3 Error
6 4 Warning
6 5 Notice
6 6 Info
6 7 Debug
6 8 Spew
7 0 Disable
7 1 Enable
7 2 Keep
8 0 AHCI
8 1 Compatible
11 0 32M
11 1 64M
11 2 96M
11 3 128M
11 4 160M
11 5 192M
11 6 224M
# -----------------------------------------------------------------
checksums
checksum 392 415 984
|
{
"pile_set_name": "Github"
}
|
"use strict";
module.exports = PermissionsClient;
/**
* Used to access Jira REST endpoints in '/rest/api/2/permissions'
*
* @param {JiraClient} jiraClient
* @constructor PermissionsClient
*/
function PermissionsClient(jiraClient) {
this.jiraClient = jiraClient;
/**
* Returns all permissions that are present in the JIRA instance
* - Global, Project and the global ones added by plugins
*
* @method getAllPermissions
* @memberOf PermissionsClient#
* @param opts The request options sent to the Jira API.
* @param [callback] Called when the permissions have been returned.
* @return {Promise} Resolved when the permissions have been returned.
*/
this.getAllPermissions = function (opts, callback) {
var options = {
uri: this.jiraClient.buildURL('/permissions'),
method: 'GET',
json: true,
followAllRedirects: true
};
return this.jiraClient.makeRequest(options, callback);
}
}
|
{
"pile_set_name": "Github"
}
|
/*
* Copyright 2000-2012 JetBrains s.r.o.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package com.intellij.codeInsight.completion.originInfo;
/**
* @author Max Medvedev
*/
public interface OriginInfoAwareElement {
@javax.annotation.Nullable
String getOriginInfo();
}
|
{
"pile_set_name": "Github"
}
|
<?xml version="1.0" encoding="utf-8"?>
<!--~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
~ Mirakel is an Android App for managing your ToDo-Lists
~
~ Copyright (c) 2013-2015 Anatolij Zelenin, Georg Semmler.
~
~ This program is free software: you can redistribute it and/or modify
~ it under the terms of the GNU General Public License as published by
~ the Free Software Foundation, either version 3 of the License, or
~ any later version.
~
~ This program is distributed in the hope that it will be useful,
~ but WITHOUT ANY WARRANTY; without even the implied warranty of
~ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
~ GNU General Public License for more details.
~
~ You should have received a copy of the GNU General Public License
~ along with this program. If not, see <http://www.gnu.org/licenses/>.
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~-->
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:id="@+id/datepicker_dialog"
android:layout_width="wrap_content"
android:layout_height="fill_parent"
android:gravity="center"
android:orientation="vertical" >
<LinearLayout
android:id="@+id/datepicker_header"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:orientation="vertical" >
<include layout="@layout/date_picker_header_view" />
<include layout="@layout/date_picker_selected_date" />
</LinearLayout>
<include layout="@layout/date_picker_view_animator" />
<View
android:layout_width="fill_parent"
android:layout_height="1.0dip"
android:background="@color/line_background" />
<include layout="@layout/date_picker_done_button" />
</LinearLayout>
|
{
"pile_set_name": "Github"
}
|
{% extends 'events/registration/emails/registration_creation_to_managers.html' %}
{% block registration_body %}{% endblock %}
{% block subject_message -%}
Registration {{ registration.state.title|lower }}
{%- endblock %}
{% block registration_header_text %}
The registration {{ render_registration_info() }}
is now <strong>{{ registration.state.title|lower }}</strong>.
{{ render_text_pending() }}
{{ render_text_manage() }}
{% endblock %}
|
{
"pile_set_name": "Github"
}
|
// Copyright (c) Microsoft Corporation.
// Licensed under the MIT License.
#include "pch.h"
#include "TestCommon.h"
#include <AppInstallerRuntime.h>
#include <winget/Settings.h>
#include <winget/UserSettings.h>
#include <AppInstallerErrors.h>
#include <filesystem>
#include <string>
#include <chrono>
using namespace AppInstaller::Settings;
using namespace AppInstaller::Runtime;
using namespace std::string_view_literals;
using namespace std::chrono_literals;
namespace
{
static constexpr std::string_view s_goodJson = "{}";
static constexpr std::string_view s_badJson = "{";
static constexpr std::string_view s_settings = "settings.json"sv;
static constexpr std::string_view s_settingsBackup = "settings.json.backup"sv;
void DeleteUserSettingsFiles()
{
auto settingsPath = UserSettings::SettingsFilePath();
if (std::filesystem::exists(settingsPath))
{
std::filesystem::remove(settingsPath);
}
auto settingsBackupPath = GetPathTo(Streams::BackupUserSettings);
if (std::filesystem::exists(settingsBackupPath))
{
std::filesystem::remove(settingsBackupPath);
}
}
struct UserSettingsTest : UserSettings
{
};
}
TEST_CASE("UserSettingsFilePaths", "[settings]")
{
auto settingsPath = UserSettings::SettingsFilePath();
auto expectedPath = GetPathTo(PathName::UserFileSettings) / "settings.json";
REQUIRE(settingsPath == expectedPath);
}
TEST_CASE("UserSettingsType", "[settings]")
{
// These are all the possible combinations between (7 of them are impossible):
// 1 - No settings.json file exists
// 2 - Bad settings.json file
// 3 - No settings.json.backup file exists
// 4 - Bad settings.json.backup file exists.
DeleteUserSettingsFiles();
SECTION("No setting.json No setting.json.backup")
{
UserSettingsTest userSettingTest;
REQUIRE(userSettingTest.GetType() == UserSettingsType::Default);
}
SECTION("No setting.json Bad setting.json.backup")
{
SetSetting(Streams::BackupUserSettings, s_badJson);
UserSettingsTest userSettingTest;
REQUIRE(userSettingTest.GetType() == UserSettingsType::Default);
}
SECTION("No setting.json Good setting.json.backup")
{
SetSetting(Streams::BackupUserSettings, s_goodJson);
UserSettingsTest userSettingTest;
REQUIRE(userSettingTest.GetType() == UserSettingsType::Backup);
}
SECTION("Bad setting.json No setting.json.backup")
{
SetSetting(Streams::PrimaryUserSettings, s_badJson);
UserSettingsTest userSettingTest;
REQUIRE(userSettingTest.GetType() == UserSettingsType::Default);
}
SECTION("Bad setting.json Bad setting.json.backup")
{
SetSetting(Streams::PrimaryUserSettings, s_badJson);
SetSetting(Streams::BackupUserSettings, s_badJson);
UserSettingsTest userSettingTest;
REQUIRE(userSettingTest.GetType() == UserSettingsType::Default);
}
SECTION("Bad setting.json Good setting.json.backup")
{
SetSetting(Streams::PrimaryUserSettings, s_badJson);
SetSetting(Streams::BackupUserSettings, s_goodJson);
UserSettingsTest userSettingTest;
REQUIRE(userSettingTest.GetType() == UserSettingsType::Backup);
}
SECTION("Good setting.json No setting.json.backup")
{
SetSetting(Streams::PrimaryUserSettings, s_goodJson);
UserSettingsTest userSettingTest;
REQUIRE(userSettingTest.GetType() == UserSettingsType::Standard);
}
SECTION("Good setting.json Bad setting.json.backup")
{
SetSetting(Streams::PrimaryUserSettings, s_goodJson);
SetSetting(Streams::BackupUserSettings, s_badJson);
UserSettingsTest userSettingTest;
REQUIRE(userSettingTest.GetType() == UserSettingsType::Standard);
}
SECTION("Good setting.json Good setting.json.backup")
{
SetSetting(Streams::PrimaryUserSettings, s_goodJson);
SetSetting(Streams::BackupUserSettings, s_goodJson);
UserSettingsTest userSettingTest;
REQUIRE(userSettingTest.GetType() == UserSettingsType::Standard);
}
}
TEST_CASE("UserSettingsCreateFiles", "[settings]")
{
DeleteUserSettingsFiles();
auto settingsPath = UserSettings::SettingsFilePath();
auto settingsBackupPath = GetPathTo(Streams::BackupUserSettings);
SECTION("No settings.json create new")
{
REQUIRE(!std::filesystem::exists(settingsPath));
REQUIRE(!std::filesystem::exists(settingsBackupPath));
UserSettingsTest userSettingTest;
REQUIRE(userSettingTest.GetType() == UserSettingsType::Default);
userSettingTest.PrepareToShellExecuteFile();
REQUIRE(std::filesystem::exists(settingsPath));
REQUIRE(!std::filesystem::exists(settingsBackupPath));
}
SECTION("Good settings.json create new backup")
{
SetSetting(Streams::PrimaryUserSettings, s_goodJson);
REQUIRE(std::filesystem::exists(settingsPath));
REQUIRE(!std::filesystem::exists(settingsBackupPath));
UserSettingsTest userSettingTest;
REQUIRE(userSettingTest.GetType() == UserSettingsType::Standard);
userSettingTest.PrepareToShellExecuteFile();
REQUIRE(std::filesystem::exists(settingsPath));
REQUIRE(std::filesystem::exists(settingsBackupPath));
}
}
TEST_CASE("SettingProgressBar", "[settings]")
{
DeleteUserSettingsFiles();
SECTION("Default value")
{
UserSettingsTest userSettingTest;
REQUIRE(userSettingTest.Get<Setting::ProgressBarVisualStyle>() == VisualStyle::Accent);
REQUIRE(userSettingTest.GetWarnings().size() == 0);
}
SECTION("Accent")
{
std::string_view json = R"({ "visual": { "progressBar": "accent" } })";
SetSetting(Streams::PrimaryUserSettings, json);
UserSettingsTest userSettingTest;
REQUIRE(userSettingTest.Get<Setting::ProgressBarVisualStyle>() == VisualStyle::Accent);
REQUIRE(userSettingTest.GetWarnings().size() == 0);
}
SECTION("Rainbow")
{
std::string_view json = R"({ "visual": { "progressBar": "rainbow" } })";
SetSetting(Streams::PrimaryUserSettings, json);
UserSettingsTest userSettingTest;
REQUIRE(userSettingTest.Get<Setting::ProgressBarVisualStyle>() == VisualStyle::Rainbow);
REQUIRE(userSettingTest.GetWarnings().size() == 0);
}
SECTION("retro")
{
std::string_view json = R"({ "visual": { "progressBar": "retro" } })";
SetSetting(Streams::PrimaryUserSettings, json);
UserSettingsTest userSettingTest;
REQUIRE(userSettingTest.Get<Setting::ProgressBarVisualStyle>() == VisualStyle::Retro);
REQUIRE(userSettingTest.GetWarnings().size() == 0);
}
SECTION("Bad value")
{
std::string_view json = R"({ "visual": { "progressBar": "fake" } })";
SetSetting(Streams::PrimaryUserSettings, json);
UserSettingsTest userSettingTest;
REQUIRE(userSettingTest.Get<Setting::ProgressBarVisualStyle>() == VisualStyle::Accent);
REQUIRE(userSettingTest.GetWarnings().size() == 1);
}
SECTION("
|
{
"pile_set_name": "Github"
}
|
// mksysnum_darwin.pl /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.10.sdk/usr/include/sys/syscall.h
// MACHINE GENERATED BY THE ABOVE COMMAND; DO NOT EDIT
// +build 386,darwin
package unix
const (
SYS_SYSCALL = 0
SYS_EXIT = 1
SYS_FORK = 2
SYS_READ = 3
SYS_WRITE = 4
SYS_OPEN = 5
SYS_CLOSE = 6
SYS_WAIT4 = 7
SYS_LINK = 9
SYS_UNLINK = 10
SYS_CHDIR = 12
SYS_FCHDIR = 13
SYS_MKNOD = 14
SYS_CHMOD = 15
SYS_CHOWN = 16
SYS_GETFSSTAT = 18
SYS_GETPID = 20
SYS_SETUID = 23
SYS_GETUID = 24
SYS_GETEUID = 25
SYS_PTRACE = 26
SYS_RECVMSG = 27
SYS_SENDMSG = 28
SYS_RECVFROM = 29
SYS_ACCEPT = 30
SYS_GETPEERNAME = 31
SYS_GETSOCKNAME = 32
SYS_ACCESS = 33
SYS_CHFLAGS = 34
SYS_FCHFLAGS = 35
SYS_SYNC = 36
SYS_KILL = 37
SYS_GETPPID = 39
SYS_DUP = 41
SYS_PIPE = 42
SYS_GETEGID = 43
SYS_SIGACTION = 46
SYS_GETGID = 47
SYS_SIGPROCMASK = 48
SYS_GETLOGIN = 49
SYS_SETLOGIN = 50
SYS_ACCT = 51
SYS_SIGPENDING = 52
SYS_SIGALTSTACK = 53
SYS_IOCTL = 54
SYS_REBOOT = 55
SYS_REVOKE = 56
SYS_SYMLINK = 57
SYS_READLINK = 58
SYS_EXECVE = 59
SYS_UMASK = 60
SYS_CHROOT = 61
SYS_MSYNC = 65
SYS_VFORK = 66
SYS_MUNMAP = 73
SYS_MPROTECT = 74
SYS_MADVISE = 75
SYS_MINCORE = 78
SYS_GETGROUPS = 79
SYS_SETGROUPS = 80
SYS_GETPGRP = 81
SYS_SETPGID = 82
SYS_SETITIMER = 83
SYS_SWAPON = 85
SYS_GETITIMER = 86
SYS_GETDTABLESIZE = 89
SYS_DUP2 = 90
SYS_FCNTL = 92
SYS_SELECT = 93
SYS_FSYNC = 95
SYS_SETPRIORITY = 96
SYS_SOCKET = 97
SYS_CONNECT = 98
SYS_GETPRIORITY = 100
SYS_BIND = 104
SYS_SETSOCKOPT = 105
SYS_LISTEN = 106
SYS_SIGSUSPEND = 111
SYS_GETTIMEOFDAY = 116
SYS_GETRUSAGE = 117
SYS_GETSOCKOPT = 118
SYS_READV = 120
SYS_WRITEV = 121
SYS_SETTIMEOFDAY = 122
SYS_FCHOWN = 123
SYS_FCHMOD = 124
SYS_SETREUID = 126
SYS_SETREGID = 127
SYS_RENAME = 128
SYS_FLOCK = 131
SYS_MKFIFO = 132
SYS_SENDTO = 133
SYS_SHUTDOWN = 134
SYS_SOCKETPAIR = 135
SYS_MKDIR = 136
SYS_RMDIR = 137
SYS_UTIMES = 138
SYS_FUTIMES = 139
SYS_ADJTIME = 140
SYS_GETHOSTUUID = 142
SYS_SETSID = 147
SYS_GETPGID = 151
SYS_SETPRIVEXEC = 152
SYS_PREAD = 153
SYS_PWRITE = 154
SYS_NFSSVC = 155
SYS_STATFS = 157
SYS_FSTATFS = 158
SYS_UNMOUNT = 159
SYS_GETFH = 161
SYS_QUOTACTL = 165
SYS_MOUNT = 167
SYS_CSOPS = 169
SYS_CSOPS_AUDITTOKEN = 170
SYS_WAITID = 173
SYS_KDEBUG_TRACE64 = 179
SYS_KDEBUG_TRACE = 180
SYS_SETGID = 181
SYS_SETEGID = 182
SYS_SETEUID = 183
SYS_SIGRETURN = 184
SYS_CHUD = 185
SYS_FDATASYNC = 187
SYS_STAT = 188
SYS_FSTAT = 189
SYS_LSTAT = 190
SYS_PATHCONF = 191
SYS_FPATHCONF = 192
SYS_GETRLIMIT = 194
SYS_SETRLIMIT = 195
SYS_GETDIRENTRIES = 196
SYS_MMAP = 197
SYS_LSEEK = 199
SYS_TRUNCATE = 200
SYS_FTRUNCATE = 201
SYS_SYSCTL = 202
SYS_MLOCK = 203
SYS_MUNLOCK = 204
SYS_UNDELETE = 205
SYS_OPEN_DPROTECTED_NP = 216
SYS_GETATTRLIST = 220
SYS_SETATTRLIST = 221
SYS_GETDIRENTRIESATTR = 222
SYS_EXCHANGEDATA = 223
SYS_SEARCHFS = 225
SYS_DELETE = 226
SYS_COPYFILE = 227
SYS_FGETATTRLIST = 228
SYS_FSETATTRLIST = 229
SYS_POLL = 230
SYS_WATCHEVENT = 231
SYS_WAITEVENT = 232
SYS_MODWATCH = 233
SYS_GETXATTR = 234
SYS_FGETXATTR = 235
SYS_SETXATTR = 236
SYS_FSETXATTR = 237
SYS_REMOVEXATTR = 238
SYS_FREMOVEXATTR = 239
SYS_LISTXATTR = 240
SYS_FLISTXATTR = 241
SYS_FSCTL = 242
SYS_INITGROUPS = 243
SYS_POSIX_SPAWN = 244
SYS_FFSCTL = 245
SYS_NFSCLNT = 247
SYS_FHOPEN = 248
SYS_MINHERIT = 250
SYS_SEMSYS = 251
SYS_MSGSYS = 252
SYS_SHMSYS = 253
SYS_SEMCTL = 254
SYS_SEMGET = 255
SYS_SEMOP = 256
SYS_MSGCTL = 258
SYS_MSGGET = 259
SYS_MSGSND = 260
SYS_MSGRCV = 261
SYS_SHMAT = 262
SYS_SHMCTL = 263
SYS_SHMDT = 264
SYS_SHMGET = 265
SYS_SHM_OPEN = 266
SYS_SHM_UNLINK = 267
SYS_SEM_OPEN = 268
SYS_SEM_CLOSE = 269
SYS_SEM_UNLINK = 270
SYS_SEM_WAIT = 271
SYS_SEM_TRYWAIT = 272
SYS_SEM_POST = 273
SYS_SYSCTLBYNAME = 274
SYS_OPEN_EXTENDED = 277
SYS_UMASK
|
{
"pile_set_name": "Github"
}
|
// -*- C++ -*-
// VisualBoyAdvance - Nintendo Gameboy/GameboyAdvance (TM) emulator.
// Copyright (C) 1999-2003 Forgotten
// Copyright (C) 2004 Forgotten and the VBA development team
// 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., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
#if !defined(AFX_GBMAPVIEW_H__4CD23D38_F2CD_4B95_AE76_2781591DD077__INCLUDED_)
#define AFX_GBMAPVIEW_H__4CD23D38_F2CD_4B95_AE76_2781591DD077__INCLUDED_
#if _MSC_VER > 1000
#pragma once
#endif // _MSC_VER > 1000
// GBMapView.h : header file
//
#include "BitmapControl.h"
#include "ColorControl.h"
#include "ZoomControl.h"
#include "ResizeDlg.h"
#include "IUpdate.h"
#include "../System.h" // Added by ClassView
/////////////////////////////////////////////////////////////////////////////
// GBMapView dialog
class GBMapView : public ResizeDlg, IUpdateListener
{
private:
BITMAPINFO bmpInfo;
u8 *data;
int bank;
int bg;
int w;
int h;
BitmapControl mapView;
ZoomControl mapViewZoom;
ColorControl color;
bool autoUpdate;
// Construction
public:
afx_msg LRESULT OnColInfo(WPARAM wParam, LPARAM lParam);
afx_msg LRESULT OnMapInfo(WPARAM wParam, LPARAM lParam);
u32 GetClickAddress(int x, int y);
void update();
void paint();
void render();
void savePNG(const char *name);
void saveBMP(const char *name);
~GBMapView();
GBMapView(CWnd* pParent = NULL); // standard constructor
// Dialog Data
//{{AFX_DATA(GBMapView)
enum { IDD = IDD_GB_MAP_VIEW };
// NOTE: the ClassWizard will add data members here
//}}AFX_DATA
// Overrides
// ClassWizard generated virtual function overrides
//{{AFX_VIRTUAL(GBMapView)
protected:
virtual void DoDataExchange(CDataExchange* pDX); // DDX/DDV support
virtual void PostNcDestroy();
//}}AFX_VIRTUAL
// Implementation
protected:
// Generated message map functions
//{{AFX_MSG(GBMapView)
afx_msg void OnSave();
afx_msg void OnRefresh();
virtual BOOL OnInitDialog();
afx_msg void OnBg0();
afx_msg void OnBg1();
afx_msg void OnBank0();
afx_msg void OnBank1();
afx_msg void OnStretch();
afx_msg void OnAutoUpdate();
afx_msg void OnClose();
//}}AFX_MSG
DECLARE_MESSAGE_MAP()
};
//{{AFX_INSERT_LOCATION}}
// Microsoft Visual C++ will insert additional declarations immediately before the previous line.
#endif // !defined(AFX_GBMAPVIEW_H__4CD23D38_F2CD_4B95_AE76_2781591DD077__INCLUDED_)
|
{
"pile_set_name": "Github"
}
|
var jwt = require ('./jwt');
/**
* Adds ID token validation to Passport verification process.
*
* Parent passport-oauth2 library handles the verifier based on the number
* of arguments and changes the order if passReqToCallback is passed
* in with the strategy options. This wrapper will make the length of
* arguments consistent and add support for passReqToCallback.
*
* @param {Function} verify
* @param {Object} strategyOptions
* @param {Object} authParams
*/
function verifyWrapper (verify, strategyOptions, authParams) {
if (strategyOptions.passReqToCallback) {
return function (req, accessToken, refreshToken, params, profile, done) {
handleIdTokenValidation(strategyOptions, authParams, params);
verify.apply(null, arguments);
}
} else {
return function (accessToken, refreshToken, params, profile, done) {
handleIdTokenValidation(strategyOptions, authParams, params);
verify.apply(null, arguments);
}
}
}
/**
* Perform ID token validation if an ID token was requested during login.
*
* @param {Object} strategyOptions
* @param {Object} authParams
* @param {Object} params
*/
function handleIdTokenValidation (strategyOptions, authParams, params) {
if (authParams && authParams.scope && authParams.scope.includes('openid')) {
jwt.verify(params.id_token, {
aud: strategyOptions.clientID,
iss: 'https://' + strategyOptions.domain + '/',
leeway: strategyOptions.leeway,
maxAge: strategyOptions.maxAge,
nonce: authParams.nonce
});
}
}
module.exports = verifyWrapper;
|
{
"pile_set_name": "Github"
}
|
# contrib
Stuff that is not part of the package distribution, but can be useful in special cases.
|
{
"pile_set_name": "Github"
}
|
/*
* Copyright 2014 the original author or authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package org.gradle.integtests.tooling.r22
import org.gradle.integtests.tooling.CancellationSpec
import org.gradle.integtests.tooling.fixture.TestResultHandler
import org.gradle.integtests.tooling.r18.BrokenAction
import org.gradle.tooling.BuildCancelledException
import org.gradle.tooling.GradleConnector
import org.gradle.tooling.ProjectConnection
import org.gradle.tooling.model.GradleProject
class CancellationCrossVersionSpec extends CancellationSpec {
def "can cancel build during settings phase"() {
settingsFile << waitForCancel()
buildFile << """
throw new RuntimeException("should not run")
"""
def cancel = GradleConnector.newCancellationTokenSource()
def sync = server.expectAndBlock("registered")
def resultHandler = new TestResultHandler()
when:
withConnection { ProjectConnection connection ->
def build = connection.newBuild()
build.forTasks(':sub:broken')
build.withCancellationToken(cancel.token())
collectOutputs(build)
build.run(resultHandler)
sync.waitForAllPendingCalls(resultHandler)
cancel.cancel()
sync.releaseAll()
resultHandler.finished()
}
then:
buildWasCancelled(resultHandler)
}
def "can cancel build during configuration phase"() {
file("gradle.properties") << "org.gradle.configureondemand=${configureOnDemand}"
setupCancelInConfigurationBuild()
def cancel = GradleConnector.newCancellationTokenSource()
def sync = server.expectAndBlock("registered")
def resultHandler = new TestResultHandler()
when:
withConnection { ProjectConnection connection ->
def build = connection.newBuild()
build.forTasks(':sub:broken')
build.withCancellationToken(cancel.token())
collectOutputs(build)
build.run(resultHandler)
sync.waitForAllPendingCalls(resultHandler)
cancel.cancel()
sync.releaseAll()
resultHandler.finished()
}
then:
buildWasCancelled(resultHandler)
where:
configureOnDemand << [true, false]
}
def "can cancel model creation during configuration phase"() {
file("gradle.properties") << "org.gradle.configureondemand=${configureOnDemand}"
setupCancelInConfigurationBuild()
def cancel = GradleConnector.newCancellationTokenSource()
def sync = server.expectAndBlock("registered")
def resultHandler = new TestResultHandler()
when:
withConnection { ProjectConnection connection ->
def model = connection.model(GradleProject)
model.withCancellationToken(cancel.token())
collectOutputs(model)
model.get(resultHandler)
sync.waitForAllPendingCalls(resultHandler)
cancel.cancel()
sync.releaseAll()
resultHandler.finished()
}
then:
configureWasCancelled(resultHandler, "Could not fetch model of type 'GradleProject' using")
where:
configureOnDemand << [true, false]
}
def "can cancel build action execution during configuration phase"() {
file("gradle.properties") << "org.gradle.configureondemand=${configureOnDemand}"
setupCancelInConfigurationBuild()
def cancel = GradleConnector.newCancellationTokenSource()
def sync = server.expectAndBlock("registered")
def resultHandler = new TestResultHandler()
when:
withConnection { ProjectConnection connection ->
def action = connection.action(new BrokenAction())
action.withCancellationToken(cancel.token())
collectOutputs(action)
action.run(resultHandler)
sync.waitForAllPendingCalls(resultHandler)
cancel.cancel()
sync.releaseAll()
resultHandler.finished()
}
then:
configureWasCancelled(resultHandler, "Could not run build action using")
where:
configureOnDemand << [true, false]
}
def "can cancel build and skip some tasks"() {
buildFile << """
task hang {
doLast {
${waitForCancel()}
}
}
task notExecuted(dependsOn: hang) {
doLast {
throw new RuntimeException("should not run")
}
}
"""
def cancel = GradleConnector.newCancellationTokenSource()
def sync = server.expectAndBlock("registered")
def resultHandler = new TestResultHandler()
when:
withConnection { ProjectConnection connection ->
def build = connection.newBuild()
build.forTasks('notExecuted')
build.withCancellationToken(cancel.token())
collectOutputs(build)
build.run(resultHandler)
sync.waitForAllPendingCalls(resultHandler)
cancel.cancel()
sync.releaseAll()
resultHandler.finished()
}
then:
taskWasCancelled(resultHandler, ":hang")
}
def "does not fail when scheduled tasks complete within the cancellation timeout"() {
buildFile << """
task hang {
doLast {
${waitForCancel()}
}
}
"""
def cancel = GradleConnector.newCancellationTokenSource()
def sync = server.expectAndBlock("registered")
def resultHandler = new TestResultHandler()
when:
withConnection { ProjectConnection connection ->
def build = connection.newBuild()
build.forTasks('hang')
build.withCancellationToken(cancel.token())
collectOutputs(build)
build.run(resultHandler)
sync.waitForAllPendingCalls(resultHandler)
cancel.cancel()
sync.releaseAll()
resultHandler.finished()
}
then:
noExceptionThrown()
}
def "can cancel build through forced stop"() {
// in-process call does not support forced stop
toolingApi.requireDaemons()
buildFile << """
task hang {
doLast {
${server.callFromBuild("waiting")}
}
}
"""
def cancel = GradleConnector.newCancellationTokenSource()
def sync = server.expectAndBlock("waiting")
def resultHandler = new TestResultHandler()
when:
withConnection { ProjectConnection connection ->
def build = connection.newBuild()
build.forTasks('hang')
build.withCancellationToken(cancel.token())
collectOutputs(build)
build.run(resultHandler)
sync.waitForAllPendingCalls(resultHandler)
cancel.cancel()
resultHandler.finished()
}
then:
resultHandler.assertFailedWith(BuildCancelledException)
resultHandler.failure.message.startsWith("Could not execute build using")
if (targetDist.toolingApiHasCauseOnForcedCancel) {
resultHandler.failure.cause.message.startsWith("Daemon was stopped to handle build cancel request.")
}
// TODO - should have a failure report in the logging output
}
}
|
{
"pile_set_name": "Github"
}
|
<?xml version="1.0" encoding="utf-8"?>
<Project DefaultTargets="Build" ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<PropertyGroup>
<Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
<Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
<ProductVersion>8.0.30703</ProductVersion>
<SchemaVersion>2.0</SchemaVersion>
<ProjectGuid>{9D5C83B5-70D5-4CC2-9DB7-78B23DC8F255}</ProjectGuid>
<ProjectTypeGuids>{EFBA0AD7-5A72-4C68-AF49-83D382785DCF};{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}</ProjectTypeGuids>
<OutputType>Library</OutputType>
<RootNamespace>Xamarin.Android.LocaleTests</RootNamespace>
<AndroidApplication>True</AndroidApplication>
<AndroidResgenFile>Resources\Resource.designer.cs</AndroidResgenFile>
<AndroidResgenClass>Resource</AndroidResgenClass>
<MonoAndroidResourcePrefix>Resources</MonoAndroidResourcePrefix>
<MonoAndroidAssetsPrefix>Assets</MonoAndroidAssetsPrefix>
<AssemblyName>Xamarin.Android.Locale-Tests</AssemblyName>
<AndroidManifest>Properties\AndroidManifest.xml</AndroidManifest>
<AndroidSupportedAbis>armeabi-v7a;x86</AndroidSupportedAbis>
<AndroidUseSharedRuntime>False</AndroidUseSharedRuntime>
</PropertyGroup>
<Import Project="..\..\..\Configuration.props" />
<PropertyGroup>
<TargetFrameworkVersion>$(AndroidFrameworkVersion)</TargetFrameworkVersion>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
<DebugSymbols>true</DebugSymbols>
<Optimize>false</Optimize>
<OutputPath>..\..\..\bin\TestDebug</OutputPath>
<DefineConstants>DEBUG;</DefineConstants>
<ErrorReport>prompt</ErrorReport>
<WarningLevel>4</WarningLevel>
<AndroidLinkMode>None</AndroidLinkMode>
<ConsolePause>false</ConsolePause>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
<Optimize>true</Optimize>
<OutputPath>..\..\..\bin\TestRelease</OutputPath>
<ErrorReport>prompt</ErrorReport>
<WarningLevel>4</WarningLevel>
<ConsolePause>false</ConsolePause>
</PropertyGroup>
<ItemGroup>
<Reference Include="System" />
<Reference Include="System.Xml" />
<Reference Include="System.Core" />
<Reference Include="Mono.Android" />
<Reference Include="Xamarin.Android.NUnitLite" />
</ItemGroup>
<ItemGroup>
<Compile Include="EnvironmentTests.cs" />
<Compile Include="MainActivity.cs" />
<Compile Include="Resources\Resource.designer.cs" />
<Compile Include="Properties\AssemblyInfo.cs" />
<Compile Include="TestInstrumentation.cs" />
<Compile Include="SatelliteAssemblyTests.cs" />
<Compile Include="GlobalizationTests.cs" />
<Compile Include="TimeZoneTests.cs" />
</ItemGroup>
<ItemGroup>
<None Include="Resources\AboutResources.txt" />
<None Include="Assets\AboutAssets.txt" />
<None Include="Properties\AndroidManifest.xml" />
</ItemGroup>
<ItemGroup>
<AndroidResource Include="Resources\drawable\Icon.png" />
</ItemGroup>
<Import Project="$(MSBuildExtensionsPath)\Xamarin\Android\Xamarin.Android.CSharp.targets" />
<Import Project="Xamarin.Android.Locale-Tests.projitems" />
<Import Project="..\..\..\build-tools\scripts\TestApks.targets" />
<ItemGroup>
<EmbeddedResource Include="strings.de-DE.resx" />
<EmbeddedResource Include="strings.fr-FR.resx" />
<EmbeddedResource Include="strings.resx" />
</ItemGroup>
<ItemGroup>
<AndroidEnvironment Include="Environment.txt" />
</ItemGroup>
<ItemGroup>
<ProjectReference Include="..\LibraryResources\LibraryResources.csproj">
<Project>{05768F39-7BAF-43E6-971E-712F5771E88E}</Project>
<Name>LibraryResources</Name>
</ProjectReference>
</ItemGroup>
</Project>
|
{
"pile_set_name": "Github"
}
|
# Copyright 2017 Google Inc.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
# ==============================================================================
"""DNC Cores.
These modules create a DNC core. They take input, pass parameters to the memory
access module, and integrate the output of memory to form an output.
"""
from __future__ import absolute_import, division, print_function
import collections
import numpy as np
import tensorflow as tf
import access
import sonnet as snt
DNCState = collections.namedtuple('DNCState', ('access_output', 'access_state',
'controller_state'))
class DNC(snt.RNNCore):
"""DNC core module.
Contains controller and memory access module.
"""
def __init__(self,
access_config,
controller_config,
output_size,
clip_value=None,
name='dnc'):
"""Initializes the DNC core.
Args:
access_config: dictionary of access module configurations.
controller_config: dictionary of controller (LSTM) module configurations.
output_size: output dimension size of core.
clip_value: clips controller and core output values to between
`[-clip_value, clip_value]` if specified.
name: module name (default 'dnc').
Raises:
TypeError: if direct_input_size is not None for any access module other
than KeyValueMemory.
"""
super(DNC, self).__init__(name=name)
with self._enter_variable_scope():
self._controller = snt.LSTM(**controller_config)
self._access = access.MemoryAccess(**access_config)
self._access_output_size = np.prod(self._access.output_size.as_list())
self._output_size = output_size
self._clip_value = clip_value or 0
self._output_size = tf.TensorShape([output_size])
self._state_size = DNCState(
access_output=self._access_output_size,
access_state=self._access.state_size,
controller_state=self._controller.state_size)
def _clip_if_enabled(self, x):
if self._clip_value > 0:
return tf.clip_by_value(x, -self._clip_value, self._clip_value)
else:
return x
def _build(self, inputs, prev_state):
"""Connects the DNC core into the graph.
Args:
inputs: Tensor input.
prev_state: A `DNCState` tuple containing the fields `access_output`,
`access_state` and `controller_state`. `access_state` is a 3-D Tensor
of shape `[batch_size, num_reads, word_size]` containing read words.
`access_state` is a tuple of the access module's state, and
`controller_state` is a tuple of controller module's state.
Returns:
A tuple `(output, next_state)` where `output` is a tensor and `next_state`
is a `DNCState` tuple containing the fields `access_output`,
`access_state`, and `controller_state`.
"""
prev_access_output = prev_state.access_output
prev_access_state = prev_state.access_state
prev_controller_state = prev_state.controller_state
batch_flatten = snt.BatchFlatten()
controller_input = tf.concat(
[batch_flatten(inputs), batch_flatten(prev_access_output)], 1)
controller_output, controller_state = self._controller(
controller_input, prev_controller_state)
controller_output = self._clip_if_enabled(controller_output)
controller_state = snt.nest.map(self._clip_if_enabled, controller_state)
access_output, access_state = self._access(controller_output,
prev_access_state)
output = tf.concat([controller_output, batch_flatten(access_output)], 1)
output = snt.Linear(
output_size=self._output_size.as_list()[0],
name='output_linear')(output)
output = self._clip_if_enabled(output)
return output, DNCState(
access_output=access_output,
access_state=access_state,
controller_state=controller_state)
def initial_state(self, batch_size, dtype=tf.float32):
return DNCState(
controller_state=self._controller.initial_state(batch_size, dtype),
access_state=self._access.initial_state(batch_size, dtype),
access_output=tf.zeros(
[batch_size] + self._access.output_size.as_list(), dtype))
@property
def state_size(self):
return self._state_size
@property
def output_size(self):
return self._output_size
|
{
"pile_set_name": "Github"
}
|
using System.Reflection;
using System.Runtime.CompilerServices;
using System.Runtime.InteropServices;
// General Information about an assembly is controlled through the following
// set of attributes. Change these attribute values to modify the information
// associated with an assembly.
[assembly: AssemblyTitle("Tests")]
[assembly: AssemblyDescription("")]
[assembly: AssemblyConfiguration("")]
[assembly: AssemblyCompany("")]
[assembly: AssemblyProduct("Tests")]
[assembly: AssemblyCopyright("Copyright © 2013")]
[assembly: AssemblyTrademark("")]
[assembly: AssemblyCulture("")]
// Setting ComVisible to false makes the types in this assembly not visible
// to COM components. If you need to access a type in this assembly from
// COM, set the ComVisible attribute to true on that type.
[assembly: ComVisible(false)]
// The following GUID is for the ID of the typelib if this project is exposed to COM
[assembly: Guid("7c7c72e6-bf10-4db9-82df-3fc57c3d2dd0")]
// Version information for an assembly consists of the following four values:
//
// Major Version
// Minor Version
// Build Number
// Revision
//
// You can specify all the values or you can default the Build and Revision Numbers
// by using the '*' as shown below:
// [assembly: AssemblyVersion("1.0.*")]
[assembly: AssemblyVersion("1.0.0.0")]
[assembly: AssemblyFileVersion("1.0.0.0")]
|
{
"pile_set_name": "Github"
}
|
<?xml version="1.0" encoding="utf-8"?>
<!--
This file is automatically generated by Visual Studio .Net. It is
used to store generic object data source configuration information.
Renaming the file extension or editing the content of this file may
cause the file to be unrecognizable by the program.
-->
<GenericObjectDataSource DisplayName="Task" Version="1.0" xmlns="urn:schemas-microsoft-com:xml-msdatasource">
<TypeInfo>AlanJuden.MvcReportViewer.ReportService.Task, Web References.ReportService.Reference.cs.dll, Version=0.0.0.0, Culture=neutral, PublicKeyToken=null</TypeInfo>
</GenericObjectDataSource>
|
{
"pile_set_name": "Github"
}
|
/*
* Copyright (c) Facebook, Inc. and its affiliates.
*
* This source code is licensed under the MIT license found in the
* LICENSE file in the root directory of this source tree.
*/
#pragma once
#include <react/components/view/ViewProps.h>
#include <react/core/propsConversions.h>
#include <react/graphics/Color.h>
#include <react/imagemanager/primitives.h>
#include <cinttypes>
#include <vector>
namespace facebook {
namespace react {
struct AndroidDialogPickerItemsStruct {
std::string label;
int color;
};
static inline void fromRawValue(
const RawValue &value,
AndroidDialogPickerItemsStruct &result) {
auto map = (better::map<std::string, RawValue>)value;
auto label = map.find("label");
if (label != map.end()) {
fromRawValue(label->second, result.label);
}
auto color = map.find("color");
// C++ props are not used on Android at the moment, so we can leave
// result.color uninitialized if the JS prop has a null value. TODO: revisit
// this once we start using C++ props on Android.
if (color != map.end() && color->second.hasValue()) {
fromRawValue(color->second, result.color);
}
}
static inline std::string toString(
const AndroidDialogPickerItemsStruct &value) {
return "[Object AndroidDialogPickerItemsStruct]";
}
static inline void fromRawValue(
const RawValue &value,
std::vector<AndroidDialogPickerItemsStruct> &result) {
auto items = (std::vector<RawValue>)value;
for (const auto &item : items) {
AndroidDialogPickerItemsStruct newItem;
fromRawValue(item, newItem);
result.emplace_back(newItem);
}
}
class AndroidDialogPickerProps final : public ViewProps {
public:
AndroidDialogPickerProps() = default;
AndroidDialogPickerProps(
const AndroidDialogPickerProps &sourceProps,
const RawProps &rawProps);
#pragma mark - Props
const SharedColor color{};
const bool enabled{true};
const std::vector<AndroidDialogPickerItemsStruct> items{};
const std::string prompt{""};
const int selected{0};
};
} // namespace react
} // namespace facebook
|
{
"pile_set_name": "Github"
}
|
/*
* Dummy C program to hand to g-ir-scanner for finding the
* Activatable classes.
*
*/
# include <girepository.h>
# include "astroid_activatable.h"
int main (int argc, char ** argv) {
GOptionContext *ctx;
GError *error = NULL;
ctx = g_option_context_new (NULL);
g_option_context_add_group (ctx, g_irepository_get_option_group ());
if (!g_option_context_parse (ctx, &argc, &argv, &error)) {
g_print ("astroid girmain: %s\n", error->message);
return 1;
}
return 0;
}
|
{
"pile_set_name": "Github"
}
|
<p>{{myData
|
{
"pile_set_name": "Github"
}
|
/**
* Range.js
*
* Copyright 2009, Moxiecode Systems AB
* Released under LGPL License.
*
* License: http://tinymce.moxiecode.com/license
* Contributing: http://tinymce.moxiecode.com/contributing
*/
(function(ns) {
// Range constructor
function Range(dom) {
var t = this,
doc = dom.doc,
EXTRACT = 0,
CLONE = 1,
DELETE = 2,
TRUE = true,
FALSE = false,
START_OFFSET = 'startOffset',
START_CONTAINER = 'startContainer',
END_CONTAINER = 'endContainer',
END_OFFSET = 'endOffset',
extend = tinymce.extend,
nodeIndex = dom.nodeIndex;
extend(t, {
// Inital states
startContainer : doc,
startOffset : 0,
endContainer : doc,
endOffset : 0,
collapsed : TRUE,
commonAncestorContainer : doc,
// Range constants
START_TO_START : 0,
START_TO_END : 1,
END_TO_END : 2,
END_TO_START : 3,
// Public methods
setStart : setStart,
setEnd : setEnd,
setStartBefore : setStartBefore,
setStartAfter : setStartAfter,
setEndBefore : setEndBefore,
setEndAfter : setEndAfter,
collapse : collapse,
selectNode : selectNode,
selectNodeContents : selectNodeContents,
compareBoundaryPoints : compareBoundaryPoints,
deleteContents : deleteContents,
extractContents : extractContents,
cloneContents : cloneContents,
insertNode : insertNode,
surroundContents : surroundContents,
cloneRange : cloneRange
});
function setStart(n, o) {
_setEndPoint(TRUE, n, o);
};
function setEnd(n, o) {
_setEndPoint(FALSE, n, o);
};
function setStartBefore(n) {
setStart(n.parentNode, nodeIndex(n));
};
function setStartAfter(n) {
setStart(n.parentNode, nodeIndex(n) + 1);
};
function setEndBefore(n) {
setEnd(n.parentNode, nodeIndex(n));
};
function setEndAfter(n) {
setEnd(n.parentNode, nodeIndex(n) + 1);
};
function collapse(ts) {
if (ts) {
t[END_CONTAINER] = t[START_CONTAINER];
t[END_OFFSET] = t[START_OFFSET];
} else {
t[START_CONTAINER] = t[END_CONTAINER];
t[START_OFFSET] = t[END_OFFSET];
}
t.collapsed = TRUE;
};
function selectNode(n) {
setStartBefore(n);
setEndAfter(n);
};
function selectNodeContents(n) {
setStart(n, 0);
setEnd(n, n.nodeType === 1 ? n.childNodes.length : n.nodeValue.length);
};
function compareBoundaryPoints(h, r) {
var sc = t[START_CONTAINER], so = t[START_OFFSET], ec = t[END_CONTAINER], eo = t[END_OFFSET],
rsc = r.startContainer, rso = r.startOffset, rec = r.endContainer, reo = r.endOffset;
// Check START_TO_START
if (h === 0)
return _compareBoundaryPoints(sc, so, rsc, rso);
// Check START_TO_END
if (h === 1)
return _compareBoundaryPoints(ec, eo, rsc, rso);
// Check END_TO_END
if (h === 2)
return _compareBoundaryPoints(ec, eo, rec, reo);
// Check END_TO_START
if (h === 3)
return _compareBoundaryPoints(sc, so, rec, reo);
};
function deleteContents() {
_traverse(DELETE);
};
function extractContents() {
return _traverse(EXTRACT);
};
function cloneContents() {
return _traverse(CLONE);
};
function insertNode(n) {
var startContainer = this[START_CONTAINER],
startOffset = this[START_OFFSET], nn, o;
// Node is TEXT_NODE or CDATA
if ((startContainer.nodeType === 3 || startContainer.nodeType === 4) && startContainer.nodeValue) {
if (!startOffset) {
// At the start of text
startContainer.parentNode.insertBefore(n, startContainer);
} else if (startOffset >= startContainer.nodeValue.length) {
// At the end of text
dom.insertAfter(n, startContainer);
} else {
// Middle, need to split
nn = startContainer.splitText(startOffset);
startContainer.parentNode.insertBefore(n, nn);
}
} else {
// Insert element node
if (startContainer.childNodes.length > 0)
o = startContainer.childNodes[startOffset];
if (o)
startContainer.insertBefore(n, o);
else
startContainer.appendChild(n);
}
};
function surroundContents(n) {
var f = t.extractContents();
t.insertNode(n);
n.appendChild(f);
t.selectNode(n);
};
function cloneRange() {
return extend(new Range(dom), {
startContainer : t[START_CONTAINER],
startOffset : t[START_OFFSET],
endContainer : t[END_CONTAINER],
endOffset : t[END_OFFSET],
collapsed : t.collapsed,
commonAncestorContainer : t.commonAncestorContainer
});
};
// Private methods
function _getSelectedNode(container, offset) {
var child;
if (container.nodeType == 3 /* TEXT_NODE */)
return container;
if (offset < 0)
return container;
child = container.firstChild;
while (child && offset > 0) {
--offset;
child = child.nextSibling;
}
if (child)
return child;
return container;
};
function _isCollapsed() {
return (t[START_CONTAINER] == t[END_CONTAINER] && t[START_OFFSET] == t[END_OFFSET]);
};
function _compareBoundaryPoints(containerA, offsetA, containerB, offsetB) {
var c, offsetC, n, cmnRoot, childA, childB;
// In the first case the boundary-points have the same container. A is before B
// if its offset is less than the offset of B, A is equal to B if its offset is
// equal to the offset of B, and A is after B if its offset is greater than the
// offset of B.
if (containerA == containerB) {
if (offsetA == offsetB)
return 0; // equal
if (offsetA < offsetB)
return -1; // before
return 1; // after
}
// In the second case a child node C of the container of A is an ancestor
// container of B. In this case, A is before B if the offset of A is less than or
// equal to the index of the child node C and A is after B otherwise.
c = containerB;
while (c && c.parentNode != containerA)
c = c.parentNode;
if (c) {
offsetC = 0;
n = containerA.firstChild;
while (n != c && offsetC < offsetA) {
offsetC++;
n = n.nextSibling;
}
if (offsetA <= offsetC)
return -1; // before
return 1; // after
}
|
{
"pile_set_name": "Github"
}
|
# ms.js: miliseconds conversion utility
```js
ms('2 days') // 172800000
ms('1d') // 86400000
ms('10h') // 36000000
ms('2.5 hrs') // 9000000
ms('2h') // 7200000
ms('1m') // 60000
ms('5s') // 5000
ms('100') // 100
```
```js
ms(60000) // "1m"
ms(2 * 60000) // "2m"
ms(ms('10 hours')) // "10h"
```
```js
ms(60000, { long: true }) // "1 minute"
ms(2 * 60000, { long: true }) // "2 minutes"
ms(ms('10 hours'), { long: true }) // "10 hours"
```
- Node/Browser compatible. Published as [`ms`](https://www.npmjs.org/package/ms) in [NPM](http://nodejs.org/download).
- If a number is supplied to `ms`, a string with a unit is returned.
- If a string that contains the number is supplied, it returns it as
a number (e.g: it returns `100` for `'100'`).
- If you pass a string with a number and a valid unit, the number of
equivalent ms is returned.
## License
MIT
|
{
"pile_set_name": "Github"
}
|
<?php
namespace ManaPHP\Exception;
use ManaPHP\Exception;
class RuntimeException extends Exception
{
}
|
{
"pile_set_name": "Github"
}
|
/*
* Copyright (C) 2005-2018 Team Kodi
* This file is part of Kodi - https://kodi.tv
*
* SPDX-License-Identifier: GPL-2.0-or-later
* See LICENSES/README.md for more information.
*/
#include "CryptThreading.h"
#include "threads/Thread.h"
#include "utils/log.h"
#include <openssl/crypto.h>
//! @todo Remove support for OpenSSL <1.0 in v19
#define KODI_OPENSSL_NEEDS_LOCK_CALLBACK (OPENSSL_VERSION_NUMBER < 0x10100000L)
#define KODI_OPENSSL_USE_THREADID (OPENSSL_VERSION_NUMBER >= 0x10000000L)
#if KODI_OPENSSL_NEEDS_LOCK_CALLBACK
namespace
{
CCriticalSection* getlock(int index)
{
return g_cryptThreadingInitializer.GetLock(index);
}
void lock_callback(int mode, int type, const char* file, int line)
{
if (mode & CRYPTO_LOCK)
getlock(type)->lock();
else
getlock(type)->unlock();
}
#if KODI_OPENSSL_USE_THREADID
void thread_id(CRYPTO_THREADID* tid)
{
// C-style cast required due to vastly differing native ID return types
CRYPTO_THREADID_set_numeric(tid, (unsigned long)CThread::GetCurrentThreadId());
}
#else
unsigned long thread_id()
{
// C-style cast required due to vastly differing native ID return types
return (unsigned long)CThread::GetCurrentThreadId();
}
#endif
}
#endif
CryptThreadingInitializer::CryptThreadingInitializer()
{
#if KODI_OPENSSL_NEEDS_LOCK_CALLBACK
// OpenSSL < 1.1 needs integration code to support multi-threading
// This is absolutely required for libcurl if it uses the OpenSSL backend
m_locks.resize(CRYPTO_num_locks());
#if KODI_OPENSSL_USE_THREADID
CRYPTO_THREADID_set_callback(thread_id);
#else
CRYPTO_set_id_callback(thread_id);
#endif
CRYPTO_set_locking_callback(lock_callback);
#endif
}
CryptThreadingInitializer::~CryptThreadingInitializer()
{
#if KODI_OPENSSL_NEEDS_LOCK_CALLBACK
CSingleLock l(m_locksLock);
#if !KODI_OPENSSL_USE_THREADID
CRYPTO_set_id_callback(nullptr);
#endif
CRYPTO_set_locking_callback(nullptr);
m_locks.clear();
#endif
}
CCriticalSection* CryptThreadingInitializer::GetLock(int index)
{
CSingleLock l(m_locksLock);
auto& curlock = m_locks[index];
if (!curlock)
{
curlock.reset(new CCriticalSection());
}
return curlock.get();
}
|
{
"pile_set_name": "Github"
}
|
// RUN: llvm-mc -triple=aarch64 -show-encoding -mattr=+sve < %s \
// RUN: | FileCheck %s --check-prefixes=CHECK-ENCODING,CHECK-INST
// RUN: not llvm-mc -triple=aarch64 -show-encoding < %s 2>&1 \
// RUN: | FileCheck %s --check-prefix=CHECK-ERROR
// RUN: llvm-mc -triple=aarch64 -filetype=obj -mattr=+sve < %s \
// RUN: | llvm-objdump -d -mattr=+sve - | FileCheck %s --check-prefix=CHECK-INST
// RUN: llvm-mc -triple=aarch64 -filetype=obj -mattr=+sve < %s \
// RUN: | llvm-objdump -d - | FileCheck %s --check-prefix=CHECK-UNKNOWN
fcmeq p0.h, p0/z, z0.h, #0.0
// CHECK-INST: fcmeq p0.h, p0/z, z0.h, #0.0
// CHECK-ENCODING: [0x00,0x20,0x52,0x65]
// CHECK-ERROR: instruction requires: sve
// CHECK-UNKNOWN: 00 20 52 65 <unknown>
fcmeq p0.s, p0/z, z0.s, #0.0
// CHECK-INST: fcmeq p0.s, p0/z, z0.s, #0.0
// CHECK-ENCODING: [0x00,0x20,0x92,0x65]
// CHECK-ERROR: instruction requires: sve
// CHECK-UNKNOWN: 00 20 92 65 <unknown>
fcmeq p0.d, p0/z, z0.d, #0.0
// CHECK-INST: fcmeq p0.d, p0/z, z0.d, #0.0
// CHECK-ENCODING: [0x00,0x20,0xd2,0x65]
// CHECK-ERROR: instruction requires: sve
// CHECK-UNKNOWN: 00 20 d2 65 <unknown>
fcmeq p0.h, p0/z, z0.h, z1.h
// CHECK-INST: fcmeq p0.h, p0/z, z0.h, z1.h
// CHECK-ENCODING: [0x00,0x60,0x41,0x65]
// CHECK-ERROR: instruction requires: sve
// CHECK-UNKNOWN: 00 60 41 65 <unknown>
fcmeq p0.s, p0/z, z0.s, z1.s
// CHECK-INST: fcmeq p0.s, p0/z, z0.s, z1.s
// CHECK-ENCODING: [0x00,0x60,0x81,0x65]
// CHECK-ERROR: instruction requires: sve
// CHECK-UNKNOWN: 00 60 81 65 <unknown>
fcmeq p0.d, p0/z, z0.d, z1.d
// CHECK-INST: fcmeq p0.d, p0/z, z0.d, z1.d
// CHECK-ENCODING: [0x00,0x60,0xc1,0x65]
// CHECK-ERROR: instruction requires: sve
// CHECK-UNKNOWN: 00 60 c1 65 <unknown>
|
{
"pile_set_name": "Github"
}
|
<?xml version="1.0" encoding="UTF-8"?>
<!--
~ Copyright 2016 chronicle.software
~
~ 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.
-->
<project xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns="http://maven.apache.org/POM/4.0.0"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<parent>
<groupId>net.openhft</groupId>
<artifactId>java-parent-pom</artifactId>
<version>1.1.23</version>
<relativePath/>
</parent>
<modelVersion>4.0.0</modelVersion>
<artifactId>compiler</artifactId>
<version>2.3.7-SNAPSHOT</version>
<packaging>bundle</packaging>
<name>OpenHFT/Java-Runtime-Compiler</name>
<description>Java Runtime Compiler library.</description>
<dependencyManagement>
<dependencies>
<dependency>
<groupId>net.openhft</groupId>
<artifactId>third-party-bom</artifactId>
<type>pom</type>
<version>3.19.2</version>
<scope>import</scope>
</dependency>
</dependencies>
</dependencyManagement>
<dependencies>
<dependency>
<groupId>org.slf4j</groupId>
<artifactId>slf4j-api</artifactId>
</dependency>
<dependency>
<groupId>org.jetbrains</groupId>
<artifactId>annotations</artifactId>
</dependency>
<dependency>
<groupId>org.easymock</groupId>
<artifactId>easymock</artifactId>
<scope>test</scope>
</dependency>
<dependency>
<groupId>junit</groupId>
<artifactId>junit</artifactId>
<scope>test</scope>
</dependency>
<dependency>
<groupId>org.slf4j</groupId>
<artifactId>slf4j-simple</artifactId>
<scope>test</scope>
</dependency>
</dependencies>
<build>
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-compiler-plugin</artifactId>
<version>3.8.1</version>
<configuration>
<source>1.8</source>
<target>1.8</target>
</configuration>
</plugin>
<plugin>
<groupId>org.codehaus.mojo</groupId>
<artifactId>exec-maven-plugin</artifactId>
<version>3.0.0</version>
<executions>
<execution>
<id>compiler-test</id>
<phase>integration-test</phase>
<goals>
<goal>exec</goal>
</goals>
</execution>
</executions>
<configuration>
<classpathScope>test</classpathScope>
<executable>java</executable>
<arguments>
<argument>-classpath</argument>
<classpath/>
<argument>net.openhft.compiler.CompilerTest</argument>
</arguments>
</configuration>
</plugin>
<!--
generate maven dependencies versions file that can be used later
to install the right bundle in test phase.
The file is:
target/classes/META-INF/maven/dependencies.properties
-->
<plugin>
<groupId>org.apache.servicemix.tooling</groupId>
<artifactId>depends-maven-plugin</artifactId>
<version>1.4.0</version>
<executions>
<execution>
<id>generate-depends-file</id>
<goals>
<goal>generate-depends-file</goal>
</goals>
</execution>
</executions>
</plugin>
<plugin>
<groupId>org.apache.felix</groupId>
<artifactId>maven-bundle-plugin</artifactId>
<version>5.1.1</version>
<extensions>true</extensions>
<configuration>
<instructions>
<Bundle-SymbolicName>${project.groupId}.${project.artifactId}</Bundle-SymbolicName>
<Bundle-Name>OpenHFT :: ${project.artifactId}</Bundle-Name>
<Bundle-Version>${project.version}</Bundle-Version>
<Export-Package>
net.openhft.compiler.*;-noimport:=true
</Export-Package>
</instructions>
</configuration>
<executions>
<!--
This execution makes sure that the manifest is available
when the tests are executed
-->
<execution>
<goals>
<goal>manifest</goal>
</goals>
</execution>
</executions>
</plugin>
</plugins>
</build>
<scm>
<url>scm:git:git@github.com:OpenHFT/Java-Runtime-Compiler.git</url>
<connection>scm:git:git@github.com:OpenHFT/Java-Runtime-Compiler.git</connection>
<developerConnection>scm:git:git@github.com:OpenHFT/Java-Runtime-Compiler.git
</developerConnection>
<tag>master</tag>
</scm>
</project>
|
{
"pile_set_name": "Github"
}
|
import BuildArtifacts
import RunnerModels
import SimulatorPoolModels
public struct RuntimeDumpApplicationTestSupport: Hashable {
/** Path to hosting application*/
public let appBundle: AppBundleLocation
/** Path to Fbsimctl to run simulator*/
public let simulatorControlTool: SimulatorControlTool
public init(
appBundle: AppBundleLocation,
simulatorControlTool: SimulatorControlTool
) {
self.appBundle = appBundle
self.simulatorControlTool = simulatorControlTool
}
}
|
{
"pile_set_name": "Github"
}
|
// SPDX-License-Identifier: GPL-2.0-only
/*
* Copyright 2014, Michael Ellerman, IBM Corp.
*/
#include <signal.h>
#include <stdio.h>
#include <stdlib.h>
#include <stdbool.h>
#include <sys/types.h>
#include <sys/wait.h>
#include <unistd.h>
#include "ebb.h"
/*
* Tests a cpu event vs an EBB - in that order. The EBB should force the cpu
* event off the PMU.
*/
static int setup_cpu_event(struct event *event, int cpu)
{
event_init_named(event, 0x400FA, "PM_RUN_INST_CMPL");
event->attr.exclude_kernel = 1;
event->attr.exclude_hv = 1;
event->attr.exclude_idle = 1;
SKIP_IF(require_paranoia_below(1));
FAIL_IF(event_open_with_cpu(event, cpu));
FAIL_IF(event_enable(event));
return 0;
}
int cpu_event_vs_ebb(void)
{
union pipe read_pipe, write_pipe;
struct event event;
int cpu, rc;
pid_t pid;
SKIP_IF(!ebb_is_supported());
cpu = pick_online_cpu();
FAIL_IF(cpu < 0);
FAIL_IF(bind_to_cpu(cpu));
FAIL_IF(pipe(read_pipe.fds) == -1);
FAIL_IF(pipe(write_pipe.fds) == -1);
pid = fork();
if (pid == 0) {
/* NB order of pipes looks reversed */
exit(ebb_child(write_pipe, read_pipe));
}
/* We setup the cpu event first */
rc = setup_cpu_event(&event, cpu);
if (rc) {
kill_child_and_wait(pid);
return rc;
}
/* Signal the child to install its EBB event and wait */
if (sync_with_child(read_pipe, write_pipe))
/* If it fails, wait for it to exit */
goto wait;
/* Signal the child to run */
FAIL_IF(sync_with_child(read_pipe, write_pipe));
wait:
/* We expect the child to succeed */
FAIL_IF(wait_for_child(pid));
FAIL_IF(event_disable(&event));
FAIL_IF(event_read(&event));
event_report(&event);
/* The cpu event may have run */
return 0;
}
int main(void)
{
return test_harness(cpu_event_vs_ebb, "cpu_event_vs_ebb");
}
|
{
"pile_set_name": "Github"
}
|
# Folio-UI-Collection
UI components and live documentation for Folio iOS app
<img src="https://user-images.githubusercontent.com/40610/44827008-1aaf7b00-ac4c-11e8-83ba-c5fa4572b6e2.png" width=320> <img src="https://user-images.githubusercontent.com/40610/44827011-1c793e80-ac4c-11e8-888b-b72330f669c1.png" width=320>
<img src="https://user-images.githubusercontent.com/40610/44827012-1daa6b80-ac4c-11e8-9a33-912bb52621cd.png" width=320> <img src="https://user-images.githubusercontent.com/40610/44827014-21d68900-ac4c-11e8-92c4-5fcc3d49aba1.png" width=320>
<img src="https://user-images.githubusercontent.com/40610/44827016-2307b600-ac4c-11e8-9173-c8816530a995.png" width=320> <img src="https://user-images.githubusercontent.com/40610/44827018-2438e300-ac4c-11e8-84fd-26d55ba417ff.png" width=320>
<img src="https://user-images.githubusercontent.com/40610/44827026-29962d80-ac4c-11e8-8f24-c9dd1bd94e7c.png" width=320>
<img src="https://user-images.githubusercontent.com/40610/46520335-912c4200-c8b6-11e8-8ce7-2f4b62c06f46.gif" width=320>
## Dark Theme
<img src="https://user-images.githubusercontent.com/40610/66788380-54ac1100-ef22-11e9-8c6f-df78819945be.png" width=600px>
|
{
"pile_set_name": "Github"
}
|
/*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS HEADER.
*
* Copyright (c) 1997-2017 Oracle and/or its affiliates. All rights reserved.
*
* The contents of this file are subject to the terms of either the GNU
* General Public License Version 2 only ("GPL") or the Common Development
* and Distribution License("CDDL") (collectively, the "License"). You
* may not use this file except in compliance with the License. You can
* obtain a copy of the License at
* https://oss.oracle.com/licenses/CDDL+GPL-1.1
* or LICENSE.txt. See the License for the specific
* language governing permissions and limitations under the License.
*
* When distributing the software, include this License Header Notice in each
* file and include the License file at LICENSE.txt.
*
* GPL Classpath Exception:
* Oracle designates this particular file as subject to the "Classpath"
* exception as provided by Oracle in the GPL Version 2 section of the License
* file that accompanied this code.
*
* Modifications:
* If applicable, add the following below the License Header, with the fields
* enclosed by brackets [] replaced by your own identifying information:
* "Portions Copyright [year] [name of copyright owner]"
*
* Contributor(s):
* If you wish your version of this file to be governed by only the CDDL or
* only the GPL Version 2, indicate your decision by adding "[Contributor]
* elects to include this software in this distribution under the [CDDL or GPL
* Version 2] license." If you don't indicate a single choice of license, a
* recipient has the option to distribute your version of this file under
* either the CDDL, the GPL Version 2 or to extend the choice of license to
* its licensees as provided above. However, if you add GPL Version 2 code
* and therefore, elected the GPL Version 2 license, then the option applies
* only if the new code is made subject to such option by the copyright
* holder.
*/
package com.sun.xml.bind.v2.model.nav;
import java.lang.reflect.GenericArrayType;
import java.lang.reflect.ParameterizedType;
import java.lang.reflect.Type;
import java.lang.reflect.TypeVariable;
import java.lang.reflect.WildcardType;
/**
* @author Kohsuke Kawaguchi
*/
abstract class TypeVisitor<T,P> {
public final T visit( Type t, P param ) {
assert t!=null;
if (t instanceof Class)
return onClass((Class)t,param);
if (t instanceof ParameterizedType)
return onParameterizdType( (ParameterizedType)t,param);
if(t instanceof GenericArrayType)
return onGenericArray((GenericArrayType)t,param);
if(t instanceof WildcardType)
return onWildcard((WildcardType)t,param);
if(t instanceof TypeVariable)
return onVariable((TypeVariable)t,param);
// covered all the cases
assert false;
throw new IllegalArgumentException();
}
protected abstract T onClass(Class c, P param);
protected abstract T onParameterizdType(ParameterizedType p, P param);
protected abstract T onGenericArray(GenericArrayType g, P param);
protected abstract T onVariable(TypeVariable v, P param);
protected abstract T onWildcard(WildcardType w, P param);
}
|
{
"pile_set_name": "Github"
}
|
/*
* board initialization should put one of these into dev->platform_data
* and place the isp1760 onto platform_bus named "isp1760-hcd".
*/
#ifndef __LINUX_USB_ISP1760_H
#define __LINUX_USB_ISP1760_H
struct isp1760_platform_data {
unsigned is_isp1761:1; /* Chip is ISP1761 */
unsigned bus_width_16:1; /* 16/32-bit data bus width */
unsigned port1_otg:1; /* Port 1 supports OTG */
unsigned analog_oc:1; /* Analog overcurrent */
unsigned dack_polarity_high:1; /* DACK active high */
unsigned dreq_polarity_high:1; /* DREQ active high */
};
#endif /* __LINUX_USB_ISP1760_H */
|
{
"pile_set_name": "Github"
}
|
/* Copyright (C) 1999-2020 Free Software Foundation, Inc.
This file is part of the GNU C Library.
Contributed by Andreas Jaeger <aj@suse.de>, 1999 and
Jakub Jelinek <jakub@redhat.com>, 2000.
The GNU C 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.
The GNU C 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 the GNU C Library; if not, see
<https://www.gnu.org/licenses/>. */
int process_elf32_file (const char *file_name, const char *lib, int *flag,
unsigned int *osversion, char **soname,
void *file_contents, size_t file_length);
int process_elf64_file (const char *file_name, const char *lib, int *flag,
unsigned int *osversion, char **soname,
void *file_contents, size_t file_length);
/* Returns 0 if everything is ok, != 0 in case of error. */
int
process_elf_file (const char *file_name, const char *lib, int *flag,
unsigned int *osversion, char **soname, void *file_contents,
size_t file_length)
{
ElfW(Ehdr) *elf_header = (ElfW(Ehdr) *) file_contents;
int ret, file_flag = 0;
switch (elf_header->e_machine)
{
case EM_X86_64:
if (elf_header->e_ident[EI_CLASS] == ELFCLASS64)
/* X86-64 64bit libraries are always libc.so.6+. */
file_flag = FLAG_X8664_LIB64|FLAG_ELF_LIBC6;
else
/* X32 libraries are always libc.so.6+. */
file_flag = FLAG_X8664_LIBX32|FLAG_ELF_LIBC6;
break;
#ifndef SKIP_EM_IA_64
case EM_IA_64:
if (elf_header->e_ident[EI_CLASS] == ELFCLASS64)
{
/* IA64 64bit libraries are always libc.so.6+. */
file_flag = FLAG_IA64_LIB64|FLAG_ELF_LIBC6;
break;
}
goto failed;
#endif
case EM_386:
if (elf_header->e_ident[EI_CLASS] == ELFCLASS32)
break;
/* Fall through. */
default:
#ifndef SKIP_EM_IA_64
failed:
#endif
error (0, 0, _("%s is for unknown machine %d.\n"),
file_name, elf_header->e_machine);
return 1;
}
if (elf_header->e_ident[EI_CLASS] == ELFCLASS32)
ret = process_elf32_file (file_name, lib, flag, osversion, soname,
file_contents, file_length);
else
ret = process_elf64_file (file_name, lib, flag, osversion, soname,
file_contents, file_length);
if (!ret && file_flag)
*flag = file_flag;
return ret;
}
#undef __ELF_NATIVE_CLASS
#undef process_elf_file
#define process_elf_file process_elf32_file
#define __ELF_NATIVE_CLASS 32
#include "elf/readelflib.c"
#undef __ELF_NATIVE_CLASS
#undef process_elf_file
#define process_elf_file process_elf64_file
#define __ELF_NATIVE_CLASS 64
#include "elf/readelflib.c"
|
{
"pile_set_name": "Github"
}
|
@rem
@rem Copyright 2015 the original author or authors.
@rem
@rem Licensed under the Apache License, Version 2.0 (the "License");
@rem you may not use this file except in compliance with the License.
@rem You may obtain a copy of the License at
@rem
@rem https://www.apache.org/licenses/LICENSE-2.0
@rem
@rem Unless required by applicable law or agreed to in writing, software
@rem distributed under the License is distributed on an "AS IS" BASIS,
@rem WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
@rem See the License for the specific language governing permissions and
@rem limitations under the License.
@rem
@if "%DEBUG%" == "" @echo off
@rem ##########################################################################
@rem
@rem Gradle startup script for Windows
@rem
@rem ##########################################################################
@rem Set local scope for the variables with windows NT shell
if "%OS%"=="Windows_NT" setlocal
set DIRNAME=%~dp0
if "%DIRNAME%" == "" set DIRNAME=.
set APP_BASE_NAME=%~n0
set APP_HOME=%DIRNAME%
@rem Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script.
set DEFAULT_JVM_OPTS="-Xmx64m" "-Xms64m"
@rem LUCENE-9471: workaround for gradle leaving junk temp. files behind.
SET GRADLE_TEMPDIR=%DIRNAME%\.gradle\tmp
IF NOT EXIST "%GRADLE_TEMPDIR%" MKDIR "%GRADLE_TEMPDIR%"
SET DEFAULT_JVM_OPTS=%DEFAULT_JVM_OPTS% "-Djava.io.tmpdir=%GRADLE_TEMPDIR%"
@rem Find java.exe
if defined JAVA_HOME goto findJavaFromJavaHome
set JAVA_EXE=java.exe
%JAVA_EXE% -version >NUL 2>&1
if "%ERRORLEVEL%" == "0" goto init
echo.
echo ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH.
echo.
echo Please set the JAVA_HOME variable in your environment to match the
echo location of your Java installation.
goto fail
:findJavaFromJavaHome
set JAVA_HOME=%JAVA_HOME:"=%
set JAVA_EXE=%JAVA_HOME%/bin/java.exe
if exist "%JAVA_EXE%" goto init
echo.
echo ERROR: JAVA_HOME is set to an invalid directory: %JAVA_HOME%
echo.
echo Please set the JAVA_HOME variable in your environment to match the
echo location of your Java installation.
goto fail
:init
@rem Get command-line arguments, handling Windows variants
if not "%OS%" == "Windows_NT" goto win9xME_args
:win9xME_args
@rem Slurp the command line arguments.
set CMD_LINE_ARGS=
set _SKIP=2
:win9xME_args_slurp
if "x%~1" == "x" goto execute
set CMD_LINE_ARGS=%*
:execute
@rem LUCENE-9266: verify and download the gradle wrapper jar if we don't have one.
set GRADLE_WRAPPER_JAR=%APP_HOME%\gradle\wrapper\gradle-wrapper.jar
"%JAVA_EXE%" --source 11 "%APP_HOME%/buildSrc/src/main/java/org/apache/lucene/gradle/WrapperDownloader.java" "%GRADLE_WRAPPER_JAR%"
IF %ERRORLEVEL% NEQ 0 goto fail
@rem Setup the command line
set CLASSPATH=%GRADLE_WRAPPER_JAR%
@rem Don't fork a daemon mode on initial run that generates local defaults.
SET GRADLE_DAEMON_CTRL=
IF NOT EXIST "%DIRNAME%\gradle.properties" SET GRADLE_DAEMON_CTRL=--no-daemon
@rem Execute Gradle
"%JAVA_EXE%" %DEFAULT_JVM_OPTS% %JAVA_OPTS% %GRADLE_OPTS% "-Dorg.gradle.appname=%APP_BASE_NAME%" -classpath "%CLASSPATH%" org.gradle.wrapper.GradleWrapperMain %GRADLE_DAEMON_CTRL% %CMD_LINE_ARGS%
:end
@rem End local scope for the variables with windows NT shell
if "%ERRORLEVEL%"=="0" goto mainEnd
:fail
rem Set variable GRADLE_EXIT_CONSOLE if you need the _script_ return code instead of
rem the _cmd.exe /c_ return code!
if not "" == "%GRADLE_EXIT_CONSOLE%" exit 1
exit /b 1
:mainEnd
if "%OS%"=="Windows_NT" endlocal
:omega
|
{
"pile_set_name": "Github"
}
|
<?php
use Illuminate\Http\Request;
use Illuminate\Support\Facades\Route;
/*
|--------------------------------------------------------------------------
| API Routes
|--------------------------------------------------------------------------
|
| Here is where you can register API routes for your application. These
| routes are loaded by the RouteServiceProvider within a group which
| is assigned the "api" middleware group. Enjoy building your API!
|
*/
Route::middleware('auth:api')->get('/user', function (Request $request) {
return $request->user();
});
|
{
"pile_set_name": "Github"
}
|
/*
* Copyright (c) Enalean, 2019 - Present. All Rights Reserved.
*
* This file is a part of Tuleap.
*
* Tuleap 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.
*
* Tuleap 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 Tuleap. If not, see <http://www.gnu.org/licenses/>.
*/
import angular from "angular";
import tuleap_pullrequest_module from "../../app.js";
import "angular-mocks";
import { createAngularPromiseWrapper } from "../../../../../../../tests/jest/angular-promise-wrapper.js";
describe("ReviewersService", () => {
let $rootScope, $httpBackend, ReviewersService, TlpModalService, wrapPromise, pull_request;
beforeEach(() => {
angular.mock.module(tuleap_pullrequest_module);
angular.mock.inject(function (
_$rootScope_,
_$httpBackend_,
_ReviewersService_,
_TlpModalService_
) {
$rootScope = _$rootScope_;
$httpBackend = _$httpBackend_;
ReviewersService = _ReviewersService_;
TlpModalService = _TlpModalService_;
});
wrapPromise = createAngularPromiseWrapper($rootScope);
pull_request = {
id: 1,
};
});
describe("getReviewers", () => {
let expected_url;
beforeEach(() => {
expected_url = "/api/v1/pull_requests/" + pull_request.id + "/reviewers";
});
it("Given a pull request with no reviewer, then it will return an empty array", async () => {
$httpBackend.expectGET(expected_url).respond({
users: [],
});
const promise = wrapPromise(ReviewersService.getReviewers(pull_request));
$httpBackend.flush();
expect(await promise).toEqual([]);
});
it("Given a pull request with 2 reviewers, then it will return an array with 2 users", async () => {
$httpBackend.expectGET(expected_url).respond({
users: [
{
id: 1,
username: "lorem",
},
{
id: 2,
username: "ipsum",
},
],
});
const promise = wrapPromise(ReviewersService.getReviewers(pull_request));
$httpBackend.flush();
const result = await promise;
expect(result.length).toEqual(2);
expect(result[1].username).toEqual("ipsum");
});
});
describe("buildUserRepresentationsForPut", () => {
it("Given an array of user representations, then it will return an array of PUT user representations based on user ids", () => {
const user_representations = [
{
avatar_url: "https://example.com/avatar.png",
display_name: "Bob Lemoche (bob)",
has_avatar: true,
id: 102,
is_anonymous: false,
ldap_id: "102",
real_name: "Bob Lemoche",
uri: "users/102",
user_url: "/users/bob",
username: "bob",
},
{
avatar_url: "https://example.com/avatar.png",
display_name: "Woody Bacon (woody)",
email: "woody@test",
has_avatar: false,
id: 103,
is_anonymous: false,
ldap_id: "103",
real_name: "Woody Bacon",
selected: true,
status: "A",
uri: "users/103",
user_url: "/users/woody",
username: "woody",
},
];
const small_representations = ReviewersService.buildUserRepresentationsForPut(
user_representations
);
expect(small_representations).toEqual([{ id: 102 }, { id: 103 }]);
});
});
describe("updateReviewers", () => {
let expected_url, user_representations;
beforeEach(() => {
expected_url = "/api/v1/pull_requests/" + pull_request.id + "/reviewers";
user_representations = [{ id: 102 }, { id: 103 }];
});
it("Give a pull request and user representations with merge permissions, then it will call a REST route and return a 204 status", async () => {
$httpBackend
.expectPUT(expected_url, {
users: user_representations,
})
.respond(204);
const promise = ReviewersService.updateReviewers(pull_request, user_representations);
$httpBackend.flush();
const result = await wrapPromise(promise);
expect(result.status).toEqual(204);
});
it("Give a pull request and user representations with wrong permissions, then it will call a REST route and open error modal", async () => {
jest.spyOn(TlpModalService, "open").mockImplementation(() => {});
$httpBackend.expectPUT(expected_url, { users: user_representations }).respond(400, {
error: "Nope",
});
const promise = ReviewersService.updateReviewers(pull_request, user_representations);
$httpBackend.flush();
await wrapPromise(promise);
expect(TlpModalService.open).toHaveBeenCalled();
});
});
});
|
{
"pile_set_name": "Github"
}
|
<?xml version="1.0" encoding="utf-8"?>
<!-- Copyright (C) 2010 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
dd
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.
-->
<android.support.v7.view.menu.ActionMenuItemView
xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="center"
android:gravity="center"
android:focusable="true"
android:paddingTop="4dip"
android:paddingBottom="4dip"
android:paddingLeft="8dip"
android:paddingRight="8dip"
android:textAppearance="?attr/actionMenuTextAppearance"
android:textColor="?attr/actionMenuTextColor"
style="?attr/actionButtonStyle"/>
|
{
"pile_set_name": "Github"
}
|
/*
Copyright 2019 The Kubernetes Authors.
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
*/
package fake
import (
v1beta1 "k8s.io/api/events/v1beta1"
types "k8s.io/apimachinery/pkg/types"
core "k8s.io/client-go/testing"
)
// CreateWithEventNamespace creats a new event. Returns the copy of the event the server returns, or an error.
func (c *FakeEvents) CreateWithEventNamespace(event *v1beta1.Event) (*v1beta1.Event, error) {
action := core.NewRootCreateAction(eventsResource, event)
if c.ns != "" {
action = core.NewCreateAction(eventsResource, c.ns, event)
}
obj, err := c.Fake.Invokes(action, event)
if obj == nil {
return nil, err
}
return obj.(*v1beta1.Event), err
}
// UpdateWithEventNamespace replaces an existing event. Returns the copy of the event the server returns, or an error.
func (c *FakeEvents) UpdateWithEventNamespace(event *v1beta1.Event) (*v1beta1.Event, error) {
action := core.NewRootUpdateAction(eventsResource, event)
if c.ns != "" {
action = core.NewUpdateAction(eventsResource, c.ns, event)
}
obj, err := c.Fake.Invokes(action, event)
if obj == nil {
return nil, err
}
return obj.(*v1beta1.Event), err
}
// PatchWithEventNamespace patches an existing event. Returns the copy of the event the server returns, or an error.
func (c *FakeEvents) PatchWithEventNamespace(event *v1beta1.Event, data []byte) (*v1beta1.Event, error) {
pt := types.StrategicMergePatchType
action := core.NewRootPatchAction(eventsResource, event.Name, pt, data)
if c.ns != "" {
action = core.NewPatchAction(eventsResource, c.ns, event.Name, pt, data)
}
obj, err := c.Fake.Invokes(action, event)
if obj == nil {
return nil, err
}
return obj.(*v1beta1.Event), err
}
|
{
"pile_set_name": "Github"
}
|
if (`SELECT $PS_PROTOCOL + $SP_PROTOCOL + $CURSOR_PROTOCOL
+ $VIEW_PROTOCOL > 0`)
{
--skip Need normal protocol
}
# The main testing script
--source suite/opt_trace/include/subquery.inc
|
{
"pile_set_name": "Github"
}
|
class AssignContentHostToSmartProxies < ActiveRecord::Migration[4.2]
def up
SmartProxy.reset_column_information
SmartProxy.all.each do |proxy|
content_host = ::Katello::System.where(:name => proxy.name).order("created_at DESC").first
if content_host
proxy.content_host_id = content_host.id
proxy.save!
end
end
end
def down
SmartProxy.all.each do |proxy|
proxy.content_host_id = nil
proxy.save!
end
end
end
|
{
"pile_set_name": "Github"
}
|
package org.bndtools.core.editors.pkginfo;
import org.bndtools.core.editors.BndResourceMarkerAnnotationModel;
import org.eclipse.core.resources.IFile;
import org.eclipse.jface.text.source.IAnnotationModel;
import org.eclipse.ui.editors.text.TextFileDocumentProvider;
public class PackageInfoDocumentProvider extends TextFileDocumentProvider {
@Override
protected IAnnotationModel createAnnotationModel(IFile file) {
return new BndResourceMarkerAnnotationModel(file);
}
}
|
{
"pile_set_name": "Github"
}
|
/*
* Licensed to the Apache Software Foundation (ASF) under one
* or more contributor license agreements. See the NOTICE file
* distributed with this work for additional information
* regarding copyright ownership. The ASF licenses this file
* to you under the Apache License, Version 2.0 (the
* "License"); you may not use this file except in compliance
* with the License. You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing,
* software distributed under the License is distributed on an
* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
* KIND, either express or implied. See the License for the
* specific language governing permissions and limitations
* under the License.
*/
package org.apache.sysds.runtime.data;
import org.apache.commons.lang.math.IntRange;
import org.apache.sysds.common.Types.ValueType;
import org.apache.sysds.runtime.DMLRuntimeException;
import java.io.Serializable;
import java.util.Arrays;
import java.util.stream.IntStream;
import static org.apache.sysds.runtime.data.TensorBlock.DEFAULT_DIMS;
public class DataTensorBlock implements Serializable {
private static final long serialVersionUID = 3410679389807309521L;
private static final int VALID_VALUE_TYPES_LENGTH = ValueType.values().length - 1;
protected int[] _dims;
protected BasicTensorBlock[] _colsdata = new BasicTensorBlock[VALID_VALUE_TYPES_LENGTH];
protected ValueType[] _schema = null;
/**
* Contains the (column) index in `_colsdata` for a certain column of the `DataTensor`. Which `_colsdata` to use is specified by the `_schema`
*/
protected int[] _colsToIx = null;
/**
* Contains the column of `DataTensor` an `_colsdata` (column) index corresponds to.
*/
protected int[][] _ixToCols = null;
public DataTensorBlock() {
this(new ValueType[0], DEFAULT_DIMS);
}
public DataTensorBlock(int ncols, ValueType vt) {
this(vt, new int[]{0, ncols});
}
public DataTensorBlock(ValueType[] schema) {
_dims = new int[]{0, schema.length};
_schema = schema;
_colsToIx = new int[_schema.length];
_ixToCols = new int[VALID_VALUE_TYPES_LENGTH][];
int[] typeIxCounter = new int[VALID_VALUE_TYPES_LENGTH];
for (int i = 0; i < schema.length; i++) {
int type = schema[i].ordinal();
_colsToIx[i] = typeIxCounter[type]++;
}
for (int i = 0; i < schema.length; i++) {
int type = schema[i].ordinal();
if (_ixToCols[type] == null) {
_ixToCols[type] = new int[typeIxCounter[type]];
typeIxCounter[type] = 0;
}
_ixToCols[type][typeIxCounter[type]++] = i;
}
}
public DataTensorBlock(ValueType[] schema, int[] dims) {
_dims = dims;
_schema = schema;
_colsToIx = new int[_schema.length];
_ixToCols = new int[VALID_VALUE_TYPES_LENGTH][];
int[] typeIxCounter = new int[VALID_VALUE_TYPES_LENGTH];
for (int i = 0; i < schema.length; i++) {
int type = schema[i].ordinal();
_colsToIx[i] = typeIxCounter[type]++;
}
for (int i = 0; i < schema.length; i++) {
int type = schema[i].ordinal();
if (_ixToCols[type] == null) {
_ixToCols[type] = new int[typeIxCounter[type]];
typeIxCounter[type] = 0;
}
_ixToCols[type][typeIxCounter[type]++] = i;
}
reset();
}
public DataTensorBlock(ValueType vt, int[] dims) {
_dims = dims;
_schema = new ValueType[getDim(1)];
Arrays.fill(_schema, vt);
_colsToIx = new IntRange(0, getDim(1)).toArray();
_ixToCols = new int[VALID_VALUE_TYPES_LENGTH][];
_ixToCols[vt.ordinal()] = new IntRange(0, getDim(1)).toArray();
reset();
}
public DataTensorBlock(ValueType[] schema, int[] dims, String[][] data) {
this(schema, dims);
allocateBlock();
for (int i = 0; i < schema.length; i++) {
int[] ix = new int[dims.length];
ix[1] = _colsToIx[i];
BasicTensorBlock current = _colsdata[schema[i].ordinal()];
for (int j = 0; j < data[i].length; j++) {
current.set(ix, data[i][j]);
TensorBlock.getNextIndexes(_dims, ix);
if (ix[1] != _colsToIx[i]) {
// We want to stay in the current column
if (ix[1] == 0)
ix[1] = _colsToIx[i];
else {
ix[1] = _colsToIx[i];
ix[0]++;
}
}
}
}
}
public DataTensorBlock(double val) {
_dims = new int[]{1, 1};
_schema = new ValueType[]{ValueType.FP64};
_colsToIx = new int[]{0};
_ixToCols = new int[VALID_VALUE_TYPES_LENGTH][];
_ixToCols[ValueType.FP64.ordinal()] = new int[]{0};
_colsdata = new BasicTensorBlock[VALID_VALUE_TYPES_LENGTH];
_colsdata[ValueType.FP64.ordinal()] = new BasicTensorBlock(val);
}
public DataTensorBlock(DataTensorBlock that) {
copy(that);
}
public DataTensorBlock(BasicTensorBlock that) {
_dims = that._dims;
_schema = new ValueType[_dims[1]];
Arrays.fill(_schema, that._vt);
_colsToIx = IntStream.range(0, _dims[1]).toArray();
_ixToCols = new int[VALID_VALUE_TYPES_LENGTH][];
_ixToCols[that._vt.ordinal()] = IntStream.range(0, _dims[1]).toArray();
_colsdata = new BasicTensorBlock[VALID_VALUE_TYPES_LENGTH];
_colsdata[that._vt.ordinal()] = that;
}
public void reset() {
reset(_dims);
}
public void reset(int[] dims) {
if (dims.length < 2)
throw new DMLRuntimeException("DataTensor.reset(int[]) invalid number of tensor dimensions: " + dims.length);
if (dims[1] > _dims[1])
throw new DMLRuntimeException("DataTensor.reset(int[]) columns can not be added without a provided schema," +
" use reset(int[],ValueType[]) instead");
for (int i = 0; i < dims.length; i++) {
if (dims[i] < 0)
throw new DMLRuntimeException("DataTensor.reset(int[]) invalid dimension " + i + ": " + dims[i]);
}
_dims = dims;
if (getDim(1) < _schema.length) {
ValueType[] schema = new ValueType[getDim(1)];
System.arraycopy(_schema, 0, schema, 0, getDim
|
{
"pile_set_name": "Github"
}
|
/*
* Licensed to the Apache Software Foundation (ASF) under one or more
* contributor license agreements. See the NOTICE file distributed with
* this work for additional information regarding copyright ownership.
* The ASF licenses this file to You under the Apache License, Version 2.0
* (the "License"); you may not use this file except in compliance with
* the License. You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package org.apache.spark.examples.ml;
import org.apache.spark.sql.SparkSession;
// $example on$
import java.util.Arrays;
import org.apache.spark.ml.feature.VectorAssembler;
import org.apache.spark.ml.linalg.VectorUDT;
import org.apache.spark.ml.linalg.Vectors;
import org.apache.spark.sql.Dataset;
import org.apache.spark.sql.Row;
import org.apache.spark.sql.RowFactory;
import org.apache.spark.sql.types.*;
import static org.apache.spark.sql.types.DataTypes.*;
// $example off$
public class JavaVectorAssemblerExample {
public static void main(String[] args) {
SparkSession spark = SparkSession
.builder()
.appName("JavaVectorAssemblerExample")
.getOrCreate();
// $example on$
StructType schema = createStructType(new StructField[]{
createStructField("id", IntegerType, false),
createStructField("hour", IntegerType, false),
createStructField("mobile", DoubleType, false),
createStructField("userFeatures", new VectorUDT(), false),
createStructField("clicked", DoubleType, false)
});
Row row = RowFactory.create(0, 18, 1.0, Vectors.dense(0.0, 10.0, 0.5), 1.0);
Dataset<Row> dataset = spark.createDataFrame(Arrays.asList(row), schema);
VectorAssembler assembler = new VectorAssembler()
.setInputCols(new String[]{"hour", "mobile", "userFeatures"})
.setOutputCol("features");
Dataset<Row> output = assembler.transform(dataset);
System.out.println("Assembled columns 'hour', 'mobile', 'userFeatures' to vector column " +
"'features'");
output.select("features", "clicked").show(false);
// $example off$
spark.stop();
}
}
|
{
"pile_set_name": "Github"
}
|
#!/usr/local/bin/perl
&doit(100,"Pentium 100 32",0.0195,0.1000,0.6406,4.6100); # pentium-100
&doit(200,"PPro 200 32",0.0070,0.0340,0.2087,1.4700); # pentium-100
&doit( 25,"R3000 25 32",0.0860,0.4825,3.2417,23.8833); # R3000-25
&doit(200,"R4400 200 32",0.0137,0.0717,0.4730,3.4367); # R4400 32bit
&doit(180,"R10000 180 32",0.0061,0.0311,0.1955,1.3871); # R10000 32bit
&doit(180,"R10000 180 64",0.0034,0.0149,0.0880,0.5933); # R10000 64bit
&doit(400,"DEC 21164 400 64",0.0022,0.0105,0.0637,0.4457); # R10000 64bit
sub doit
{
local($mhz,$label,@data)=@_;
for ($i=0; $i <= $#data; $i++)
{
$data[$i]=1/$data[$i]*200/$mhz;
}
printf("%s %6.1f %6.1f %6.1f %6.1f\n",$label,@data);
}
|
{
"pile_set_name": "Github"
}
|
/*
* Ample SDK - JavaScript GUI Framework
*
* Copyright (c) 2012 Sergey Ilinsky
* Dual licensed under the MIT and GPL licenses.
* See: http://www.amplesdk.com/about/licensing/
*
*/
var cXULElement_menu = function(){};
cXULElement_menu.prototype = new cXULElement("menu");
cXULElement_menu.prototype.$hoverable = true;
// Public Properties
cXULElement_menu.prototype.menupopup = null; // Reference link to a menupopup element
// Class Events Handlers
cXULElement_menu.handlers = {
"mouseenter": function(oEvent) {
if (this.parentNode.selectedItem || this.parentNode instanceof cXULElement_menupopup)
this.parentNode.selectItem(this);
},
"mousedown": function(oEvent) {
if (oEvent.target == this) {
if (!this.$isAccessible())
return;
if (oEvent.button == 0)
this.$activate();
}
},
"DOMActivate": function(oEvent) {
if (oEvent.target.parentNode instanceof cXULElement_menubar)
this.parentNode.selectItem(this.parentNode.selectedItem == this ? null : this);
},
"DOMNodeInserted": function(oEvent) {
if (oEvent.target.parentNode == this) {
if (oEvent.target instanceof cXULElement_menupopup)
this.menupopup = oEvent.target;
}
},
"DOMNodeRemoved": function(oEvent) {
if (oEvent.target.parentNode == this) {
if (oEvent.target instanceof cXULElement_menupopup)
this.menupopup = null;
}
}
};
cXULElement_menu.prototype.$mapAttribute = function(sName, sValue) {
if (sName == "open") {
// TODO
}
else
if (sName == "selected") {
this.$setPseudoClass("selected", sValue == "true");
if (this.parentNode instanceof cXULElement_menupopup)
this.$setPseudoClass("selected", sValue == "true", "arrow");
}
else
if (sName == "label")
this.$getContainer("label").innerHTML = ample.$encodeXMLCharacters(sValue || '');
else
if (sName == "image") {
if (this.parentNode instanceof cXULElement_menupopup)
this.$getContainer("image").style.backgroundImage = sValue ? "url(" + sValue + ")" : '';
}
else
if (sName == "disabled") {
this.$setPseudoClass("disabled", sValue == "true");
if (this.parentNode instanceof cXULElement_menupopup)
this.$setPseudoClass("disabled", sValue == "true", "arrow");
}
else
cXULElement.prototype.$mapAttribute.call(this, sName, sValue);
};
// Element Render: open
cXULElement_menu.prototype.$getTagOpen = function() {
if (this.parentNode instanceof cXULElement_menupopup)
return '<tr class="xul-menu' + (!this.$isAccessible() ? " disabled" : "") + (this.hasAttribute("class") ? " " + this.getAttribute("class") : "") + '">\
<td width="18"><div class="xul-menu--image"' +(this.hasAttribute("image") ? ' style="background-image:url('+ ample.$encodeXMLCharacters(this.getAttribute("image")) + ')"' : '')+ '></div></td>\
<td nowrap="nowrap" class="xul-menu--label">' + (this.hasAttribute("label") ? ample.$encodeXMLCharacters(this.getAttribute("label")) : ' ')+ '</td>\
<td valign="top" class="xul-menupopup--gateway">';
else
return ' <td nowrap="nowrap" valign="center" class="xul-menu' + (!this.$isAccessible() ? " disabled" : "") + (this.hasAttribute("class") ? " " + this.getAttribute("class") : "") + '">\
<div class="xul-menu--label">' + (this.hasAttribute("label") ? ample.$encodeXMLCharacters(this.getAttribute("label")) : ' ') + '</div>\
<div class="xul-menu--gateway">';
};
// Element Render: close
cXULElement_menu.prototype.$getTagClose = function() {
if (this.parentNode instanceof cXULElement_menupopup)
return '</td>\
<td width="16"><div class="xul-menu--arrow' + (!this.$isAccessible() ? ' disabled' : '') + '"><br /></div></td>\
</tr>';
else
return ' </div>\
</td>';
};
// Register Element
ample.extend(cXULElement_menu);
|
{
"pile_set_name": "Github"
}
|
sprite $certificatemanager [66x57/16] {
00CCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCC0
0CCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCC
CCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCC
CCCCC9779CCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCC
CCCC700007CCCBAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAACCCC
CCC90000009CC6000000000000000000000000000000000000000000000000ACCC
CCC70000008CC6000000000000000000000000000000000000000000000000ACCC
CCC70000008CC6000000000000000000000000000000000000000000000000ACCC
CCC9000000ACC6000000000000000000000000000000000000000000000000ACCC
CCCC700007CCCBAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAACCCC
CCCCCA88ACCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCC
CCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCC
CCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCC
CCCC6666666666666666666666666666666666666666666666666666666666BCCC
CCCC0000000000000000000000000000000000000000000000000000000000ACCC
CCCC0000000000000000000000000007709000000000000000000000000000ACCC
CCCC0000000000000000000000000C9CCCCAA9000000000000000000000000ACCC
CCCC00000000000000000000000A9CCCCCCCCB990000000000000000000000ACCC
CCCC00000000000000000000000CCCCCCCCCCCCA0000000000000000000000ACCC
CCCC000000000000000000000BCCCCCCCCCCCCCCC800000000000000000000ACCC
CCCC000000000000000000000ACCCCCCCCCCCCBCC700000000000000000000ACCC
CCCC00000000000000000000BCCCCCCCCCCCC70BCC90000000000000000000ACCC
CCCC00000000000000000000BCCCCCCCCCCB6000BC80000000000000000000ACCC
CCCC00000000000000000006CCCCCBCCCCB00006CCA0000000000000000000ACCC
CCCC0000000000000000000ACCCC60CCC900006CCCC7000000000000000000ACCC
CCCC00000000000000000000CCC6006C800006CCCCA0000000000000000000ACCC
CCCC0000000000000000000BCC70000000006CCCCCC7000000000000000000ACCC
CCCC00000000000000000006CCB000000006CCCCCCA0000000000000000000ACCC
CCCC00000000000000000000BCCB0000006CCCCCCC80000000000000000000ACCC
CCCC00000000000000000000BCCCB00006CCCCCCCC90000000000000000000ACCC
CCCC000000000000000000000BCCCB006CCCCCCCC700000000000000000000ACCC
CCCC000000000000000000000BCCCCB6CCCCCCCCC700000000000000000000ACCC
CCCC00000000000000000000007CCCCCCCCCCCCB0000000000000000000000ACCC
CCCC0000000000000000000000699CCCCCCCCB890000000000000000000000ACCC
CCCC0000000000000000000000660C9CCBCAA9060000000000000000000000ACCC
CCCC0000000000000000000000CC700770A000AC6000000000000000000000ACCC
CCCC0000000000000000000000CCBAC66A09C9CC6000000000000000000000ACCC
CCCC0000000000000000000000CCCCCBCCBCCCCC6000000000000000000000ACCC
CCCC0000000000000000000000CCCCCCCCCCCCCC6000000000000000000000ACCC
CCCC0000000000000000000000CCCCCCCCCCCCCC6000000000000000000000ACCC
CCCC0000000000000000000000CCCCCCB9CCCCCC6000000000000000000000ACCC
CCCC0000000000000000000000CCCCCA007CCCCC6000000000000000000000ACCC
CCCC0000000000000000000000CCCC900006CCCC6000000000000000000000ACCC
CCCC0000000000000000000000CCC70000006BCC6000000000000000000000ACCC
CCCC0000000000000000000000CC6000000000BC6000000000000000000000ACCC
CCCC0000000000000000000000B60000000000096000000000000000000000ACCC
CCCC0000000000000000000000000000000000000000000000000000000000ACCC
CCCC0000000000000000000000000000000000000000000000000000000000ACCC
CCCC6666666666666666666666666666666666666666666666666666666666BCCC
CCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCC
DCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCD
FDCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCE
FFEDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDFF
FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF
FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF
0FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF
0FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF0
}
sprite $AWSCertificateManager_certificatemanager [66x57/16] {
00CCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCC0
0CCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCC
CCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCC
CCCCC9779CCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCC
CCCC700007CCCBAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAACCCC
CCC90000009CC6000000000000000000000000000000000000000000000000ACCC
CCC70000008CC6000000000000000000000000000000000000000000000000ACCC
CCC70000008CC6000000000000000000000000000000000000000000000000ACCC
CCC9000000ACC6000000000000000000000000000000000000000000000000ACCC
CCCC700007CCCBAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAACCCC
CCCCCA88ACCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCC
CCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCC
CCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCC
CCCC6666666666666666666666666666666666666666666666666666666666BCCC
CCCC0000000000000000000000000000000000000000000000000000000000ACCC
CCCC0000000000000000000000000007709000000000000000000000000000ACCC
CCCC0000000000000000000000000C9CCCCAA9000000000000000000000000ACCC
CCCC00000000000000000000000A9CCCCCCCCB990000000000000000000000ACCC
CCCC00000000000000000000000CCCCCCCCCCCCA0000000000000000000000ACCC
CCCC000000000000000000000BCCCCCCCCCCCCCCC800000000000000000000ACCC
CCCC000000000000000000000ACCCCCCCCCCCCBCC700000000000000000000ACCC
CCCC00000000000000000000BCCCCCCCCCCCC70BCC90000000000000000000ACCC
CCCC00000000000000000000BCCCCCCCCCCB6000BC80000000000000000000ACCC
CCCC00000000000000000006CCCCCBCCCCB00006CCA0000000000000000000ACCC
CCCC0000000000000000000ACCCC60CCC900006CCCC7000000000000000000ACCC
CCCC00000000000000000000CCC6006C800006CCCCA0000000000000000000ACCC
CCCC0000000000000000000BCC70000000006CCCCCC7000000000000000000ACCC
CCCC00000000000000000006CCB000000006CCCCCCA0000000000000000000ACCC
CCCC00000000000000000000BCCB0000006CCCCCCC80000000000000000000ACCC
CCCC00000000000000000000BCCCB00006CCCCCCCC90000000000000000000ACCC
CCCC000000000000000000000BCCCB006CCCCCCCC700000000000000000000ACCC
CCCC000000000000000000000BCCCCB6CCCCCCCCC700000000000000000000ACCC
CCCC00000000000000000000007CCCCCCCCCCCCB0000000000000000000000ACCC
CCCC0000000000000000000000699CCCCCCCCB890000000000000000000000ACCC
CCCC0000000000000000000000660C9CCBCAA9060000000000000000000000ACCC
CCCC0000000000000000000000CC700770A000AC6000000000000000000000ACCC
CCCC0000000000000000000000CCBAC66A09C9CC6000000000000000000000ACCC
CCCC0000000000000000000000CCCCCBCCBCCCCC6000000000000000000000ACCC
CCCC0000000000000000000000CCCCCCCCCCCCCC6000000000000000000000ACCC
CCCC0000000000000000000000CCCCCCCCCCCCCC6000000000000000000000ACCC
CCCC0000000000000000000000CCCCCCB9CCCCCC6000000000000000000000ACCC
CCCC0000000000000000000000CCCCCA007CCCCC6000000000000000000000ACCC
CCCC0000000000000000000000CCCC900006CCCC6000000000000000000000ACCC
CCCC0000000000000000000000CCC70000006BCC6000000000000000000000ACCC
CCCC0000000000000000000000CC6000000000BC6000000000000000000000ACCC
CCCC0000000000000000000000B60000000000096000000000000000000000ACCC
CCCC0000000000000000000000000000000000000000000000000000000000ACCC
CCCC0000000000000000000000000000000000000000000000000000000000ACCC
CCCC6666666666666666666666666666666666666666666666666666666666BCCC
CCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCC
DCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCD
FDCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCE
FFEDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDFF
FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF
FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF
0FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF
0FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF0
}
!define CERTIFICATEMANAGER(alias) PUML_ENTITY(component,#769D3F,AWSCertificateManager_certificatemanager,alias,certificatemanager)
!definelong CERTIFICATEMANAGER(alias,label,e_type="component",e_color="#769D3F",e_stereo="certificatemanager",e_sprite="AWSCertificateManager_certificatemanager")
PUML_ENTITY(e_type,e_color,e_sprite,label,alias,e_stereo)
!enddefinelong
!define AWSCERTIFICATEMANAGER_CERTIFICATEMANAGER(alias) PUML_ENTITY(component,#769D3F,AWSCertificateManager_certificatemanager,alias,AWSCertificateManager\ncertificatemanager)
!definelong AWSCERTIFICATEMANAGER_CERTIFICATEMANAGER(alias,label,e_type="component",e_color="#769D3F",e_stereo="AWSCertificateManager\\ncertificatemanager",e_sprite="AWSCertificateManager_certificatemanager")
PUML_ENTITY(e_type,
|
{
"pile_set_name": "Github"
}
|
package config
import (
"bytes"
"fmt"
"testing"
)
func testConfig(cfg *Config, t *testing.T) {
if v, err := cfg.GetBool("a"); err != nil {
t.Fatal(err)
} else if v != true {
t.Fatal(v)
}
checkInt := func(t *testing.T, cfg *Config, key string, check int) {
if v, err := cfg.GetInt(key); err != nil {
t.Fatal(err)
} else if v != check {
t.Fatal(fmt.Sprintf("%s %d != %d", key, v, check))
}
}
checkInt(t, cfg, "b", 100)
checkInt(t, cfg, "kb", 1024)
checkInt(t, cfg, "k", 1000)
checkInt(t, cfg, "mb", 1024*1024)
checkInt(t, cfg, "m", 1000*1000)
checkInt(t, cfg, "gb", 1024*1024*1024)
checkInt(t, cfg, "g", 1000*1000*1000)
}
func TestGetConfig(t *testing.T) {
cfg := NewConfig()
cfg.Values["a"] = "true"
cfg.Values["b"] = "100"
cfg.Values["kb"] = "1kb"
cfg.Values["k"] = "1k"
cfg.Values["mb"] = "1mb"
cfg.Values["m"] = "1m"
cfg.Values["gb"] = "1gb"
cfg.Values["g"] = "1g"
testConfig(cfg, t)
}
func TestReadWriteConfig(t *testing.T) {
var b = []byte(`
# comment
a = true
b = 100
kb = 1kb
k = 1k
mb = 1mb
m = 1m
gb = 1gb
g = 1g
`)
cfg, err := ReadConfig(b)
if err != nil {
t.Fatal(err)
}
testConfig(cfg, t)
var buf bytes.Buffer
if err := cfg.Write(&buf); err != nil {
t.Fatal(err)
}
cfg.Values = make(map[string]string)
if err := cfg.Read(&buf); err != nil {
t.Fatal(err)
}
testConfig(cfg, t)
}
|
{
"pile_set_name": "Github"
}
|
using System;
using System.Collections.Generic;
public class MyDict<S,T> {
public void Add (S key, T value) {
S[] sa = new S[1];
T[] ta = new T[1];
sa[0] = key;
ta[0] = value;
}
}
public abstract class FastFunc<S,T> {
public abstract S Invoke (T bla);
}
public class StringFastFunc : FastFunc<string, int> {
public override string Invoke (int bla) {
return bla.ToString ();
}
}
public class ArrayFastFunc : FastFunc<byte [], int> {
public override byte [] Invoke (int bla) {
return new byte [bla];
}
}
public class IntCache<T> {
MyDict<int,T> cache;
public T Invoke (FastFunc<T,int> f, int bla) {
if (cache == null)
cache = new MyDict <int,T> ();
T value = f.Invoke (bla);
cache.Add (bla, value);
return value;
}
}
public class main {
public static int Main () {
StringFastFunc sff = new StringFastFunc ();
ArrayFastFunc aff = new ArrayFastFunc ();
IntCache<string> ics = new IntCache<string> ();
MyDict<string,string> dss = new MyDict<string,string> ();
dss.Add ("123", "456");
ics.Invoke (sff, 123);
ics.Invoke (sff, 456);
IntCache<byte []> ica = new IntCache<byte []> ();
ica.Invoke (aff, 1);
ica.Invoke (aff, 2);
ica.Invoke (aff, 3);
return 0;
}
}
|
{
"pile_set_name": "Github"
}
|
body.forest_page_index {
font-family: "Century Gothic", CenturyGothic, AppleGothic, sans-serif;
text-align: center;
color: #333;
header {
position: absolute;
top: 0;
left: 0;
right: 0;
padding: 10px 20px;
z-index: 10;
}
#logo a {
float: left;
line-height: 20px;
font-size: 14px;
text-decoration: none;
color: #888;
}
#links_container {
float: right;
}
#links_container a {
font-size: 14px;
line-height: 20px;
text-decoration: none;
color: #888;
margin-left: 15px;
}
#links_container a:visited {
color: #888;
}
#links_container a:hover {
color: #681a94;
}
.clear {
clear: both;
}
canvas {
display: block;
}
#control_container {
position: fixed;
bottom: 0;
left: 0;
padding: 5px;
background-color: rgba(0,0,0,0.3);
li {
background-color: rgba(255,255,255,0.5);
}
.label {
padding: 10px 0;
}
.control {
margin: 5px;
}
img {
box-shadow: 0 0 3px rgba(0,0,0,0.15);
cursor: pointer;
border-radius: 5px;
&:active {
box-shadow: 0 0 3px rgba(0,0,0,0.5);
}
}
.color {
border: 1px solid rgba(255,255,255,0.8);
width: 50px;
text-align: center;
padding: 5px;
box-shadow: 0 0 3px rgba(0,0,0,0.5) inset;
}
button.control {
cursor: pointer;
border: none;
width: 80px;
padding: 5px 10px;
margin: 10px;
margin-bottom: 20px;
background-color: #681a94;
color: #fff;
border-radius: 5px;
box-shadow: 0 0 1px rgba(255,255,255,0.5) inset,
0 0 1px rgba(0,0,0,0.5);
text-shadow: 0 0 1px rgba(0,0,0,0.2);
&:active {
background-color: #491368;
box-shadow: 0 0 1px rgba(0,0,0,0.5) inset,
0 0 1px rgba(0,0,0,0.5);
}
}
}
}
|
{
"pile_set_name": "Github"
}
|
import * as React from 'react';
import { shallow } from 'enzyme';
import { Heading } from './../../src/elements/Heading';
describe('Heading', () => {
it('should render a p with .heading', () => {
const component = shallow(<Heading>My Heading</Heading>);
expect(component.contains(<p className='heading'>My Heading</p>)).toBe(true);
});
it('should render a div with .heading', () => {
const component = shallow(<Heading tag='div'>My Heading</Heading>);
expect(component.contains(<div className='heading'>My Heading</div>)).toBe(true);
});
it('should render a p with .heading and custom classNames', () => {
const component = shallow(<Heading className='custom'><span>Any Content</span></Heading>);
expect(component.hasClass('heading')).toBe(true);
expect(component.hasClass('custom')).toBe(true);
});
});
|
{
"pile_set_name": "Github"
}
|
#include "parse_c_type.c"
#include "realize_c_type.c"
#define CFFI_VERSION_MIN 0x2601
#define CFFI_VERSION_MAX 0x27FF
typedef struct FFIObject_s FFIObject;
typedef struct LibObject_s LibObject;
static PyTypeObject FFI_Type; /* forward */
static PyTypeObject Lib_Type; /* forward */
#include "ffi_obj.c"
#include "cglob.c"
#include "lib_obj.c"
#include "cdlopen.c"
#include "commontypes.c"
#include "call_python.c"
static int init_ffi_lib(PyObject *m)
{
PyObject *x;
int i, res;
static char init_done = 0;
if (PyType_Ready(&FFI_Type) < 0)
return -1;
if (PyType_Ready(&Lib_Type) < 0)
return -1;
if (!init_done) {
if (init_global_types_dict(FFI_Type.tp_dict) < 0)
return -1;
FFIError = PyErr_NewException("ffi.error", NULL, NULL);
if (FFIError == NULL)
return -1;
if (PyDict_SetItemString(FFI_Type.tp_dict, "error", FFIError) < 0)
return -1;
if (PyDict_SetItemString(FFI_Type.tp_dict, "CType",
(PyObject *)&CTypeDescr_Type) < 0)
return -1;
if (PyDict_SetItemString(FFI_Type.tp_dict, "CData",
(PyObject *)&CData_Type) < 0)
return -1;
for (i = 0; all_dlopen_flags[i].name != NULL; i++) {
x = PyInt_FromLong(all_dlopen_flags[i].value);
if (x == NULL)
return -1;
res = PyDict_SetItemString(FFI_Type.tp_dict,
all_dlopen_flags[i].name, x);
Py_DECREF(x);
if (res < 0)
return -1;
}
init_done = 1;
}
x = (PyObject *)&FFI_Type;
Py_INCREF(x);
if (PyModule_AddObject(m, "FFI", x) < 0)
return -1;
x = (PyObject *)&Lib_Type;
Py_INCREF(x);
if (PyModule_AddObject(m, "Lib", x) < 0)
return -1;
return 0;
}
static int make_included_tuples(char *module_name,
const char *const *ctx_includes,
PyObject **included_ffis,
PyObject **included_libs)
{
Py_ssize_t num = 0;
const char *const *p_include;
if (ctx_includes == NULL)
return 0;
for (p_include = ctx_includes; *p_include; p_include++) {
num++;
}
*included_ffis = PyTuple_New(num);
*included_libs = PyTuple_New(num);
if (*included_ffis == NULL || *included_libs == NULL)
goto error;
num = 0;
for (p_include = ctx_includes; *p_include; p_include++) {
PyObject *included_ffi, *included_lib;
PyObject *m = PyImport_ImportModule(*p_include);
if (m == NULL)
goto import_error;
included_ffi = PyObject_GetAttrString(m, "ffi");
PyTuple_SET_ITEM(*included_ffis, num, included_ffi);
included_lib = (included_ffi == NULL) ? NULL :
PyObject_GetAttrString(m, "lib");
PyTuple_SET_ITEM(*included_libs, num, included_lib);
Py_DECREF(m);
if (included_lib == NULL)
goto import_error;
if (!FFIObject_Check(included_ffi) ||
!LibObject_Check(included_lib))
goto import_error;
num++;
}
return 0;
import_error:
PyErr_Format(PyExc_ImportError,
"while loading %.200s: failed to import ffi, lib from %.200s",
module_name, *p_include);
error:
Py_XDECREF(*included_ffis); *included_ffis = NULL;
Py_XDECREF(*included_libs); *included_libs = NULL;
return -1;
}
static PyObject *_my_Py_InitModule(char *module_name)
{
#if PY_MAJOR_VERSION >= 3
struct PyModuleDef *module_def, local_module_def = {
PyModuleDef_HEAD_INIT,
module_name,
NULL,
-1,
NULL, NULL, NULL, NULL, NULL
};
/* note: the 'module_def' is allocated dynamically and leaks,
but anyway the C extension module can never be unloaded */
module_def = PyMem_Malloc(sizeof(struct PyModuleDef));
if (module_def == NULL)
return PyErr_NoMemory();
*module_def = local_module_def;
return PyModule_Create(module_def);
#else
return Py_InitModule(module_name, NULL);
#endif
}
static PyObject *b_init_cffi_1_0_external_module(PyObject *self, PyObject *arg)
{
PyObject *m, *modules_dict;
FFIObject *ffi;
LibObject *lib;
Py_ssize_t version, num_exports;
char *module_name, *exports, *module_name_with_lib;
void **raw;
const struct _cffi_type_context_s *ctx;
raw = (void **)PyLong_AsVoidPtr(arg);
if (raw == NULL)
return NULL;
module_name = (char *)raw[0];
version = (Py_ssize_t)raw[1];
exports = (char *)raw[2];
ctx = (const struct _cffi_type_context_s *)raw[3];
if (version < CFFI_VERSION_MIN || version > CFFI_VERSION_MAX) {
if (!PyErr_Occurred())
PyErr_Format(PyExc_ImportError,
"cffi extension module '%s' uses an unknown version tag %p. "
"This module might need a more recent version of cffi "
"than the one currently installed, which is %s",
module_name, (void *)version, CFFI_VERSION);
return NULL;
}
/* initialize the exports array */
num_exports = 25;
if (ctx->flags & 1) /* set to mean that 'extern "Python"' is used */
num_exports = 26;
memcpy(exports, (char *)cffi_exports, num_exports * sizeof(void *));
/* make the module object */
m = _my_Py_InitModule(module_name);
if (m == NULL)
return NULL;
/* build the FFI and Lib object inside this new module */
ffi = ffi_internal_new(&FFI_Type, ctx);
Py_XINCREF(ffi); /* make the ffi object really immortal */
if (ffi == NULL || PyModule_AddObject(m, "ffi", (PyObject *)ffi) < 0)
return NULL;
lib = lib_internal_new(ffi, module_name, NULL);
if (lib == NULL || PyModule_AddObject(m, "lib", (PyObject *)lib) < 0)
return NULL;
if (make_included_tuples(module_name, ctx->includes,
&ffi->types_builder.included_ffis,
|
{
"pile_set_name": "Github"
}
|
'use strict';
Object.defineProperty(exports, "__esModule", { value: true });
const Modem = require("docker-modem");
const container_1 = require("./container");
const image_1 = require("./image");
const volume_1 = require("./volume");
const network_1 = require("./network");
const node_1 = require("./node");
const plugin_1 = require("./plugin");
const secret_1 = require("./secret");
const service_1 = require("./service");
const swarm_1 = require("./swarm");
const task_1 = require("./task");
/**
* Docker class with all methods
*/
class Docker {
/**
* Creates the Docker Object
* @param {Object} opts Docker options
*/
constructor(opts) {
this.modem = new Modem(opts);
this.container = new container_1.default(this.modem);
this.image = new image_1.default(this.modem);
this.volume = new volume_1.default(this.modem);
this.network = new network_1.default(this.modem);
this.node = new node_1.default(this.modem);
this.plugin = new plugin_1.default(this.modem);
this.secret = new secret_1.default(this.modem);
this.service = new service_1.default(this.modem);
this.swarm = new swarm_1.default(this.modem);
this.task = new task_1.default(this.modem);
}
/**
* Validate credentials for a registry and get identity token,
* if available, for accessing the registry without password
* https://docs.docker.com/engine/reference/api/docker_remote_api_v1.24/#/check-auth-configuration
* @param {Object} opts Auth options
* @return {Promise} Promise returning the result
*/
auth(opts) {
const call = {
path: '/auth?',
method: 'POST',
options: opts,
statusCodes: {
200: true,
204: true,
500: 'server error'
}
};
return new Promise((resolve, reject) => {
this.modem.dial(call, (err, data) => {
if (err)
return reject(err);
resolve(data);
});
});
}
/**
* Get system wide information about docker
* https://docs.docker.com/engine/reference/api/docker_remote_api_v1.24/#/display-system-wide-information
* @return {Promise} Promise returning the result
*/
info() {
const call = {
path: '/info?',
method: 'GET',
statusCodes: {
200: true,
500: 'server error'
}
};
return new Promise((resolve, reject) => {
this.modem.dial(call, (err, data) => {
if (err)
return reject(err);
resolve(data);
});
});
}
/**
* Get docker version information of server
* https://docs.docker.com/engine/reference/api/docker_remote_api_v1.24/#/show-the-docker-version-information
* @return {Promise} Promise returning the result
*/
version() {
const call = {
path: '/version?',
method: 'GET',
statusCodes: {
200: true,
500: 'server error'
}
};
return new Promise((resolve, reject) => {
this.modem.dial(call, (err, data) => {
if (err)
return reject(err);
resolve(data);
});
});
}
/**
* Ping the docker server
* https://docs.docker.com/engine/reference/api/docker_remote_api_v1.24/#/ping-the-docker-server
* @return {Promise} Promise returning the result
*/
ping() {
const call = {
path: '/_ping?',
method: 'GET',
statusCodes: {
200: true,
500: 'server error'
}
};
return new Promise((resolve, reject) => {
this.modem.dial(call, (err, data) => {
if (err)
return reject(err);
resolve(data);
});
});
}
/**
* Get container events from docker, can be in real time via streaming or via polling (with since)
* https://docs.docker.com/engine/reference/api/docker_remote_api_v1.24/#/monitor-docker-s-events
* @param {Object} opts Options to send with the request (optional)
* @return {Promise} Promise returning the result
*/
events(opts = {}) {
const call = {
path: '/events?',
method: 'GET',
options: opts,
isStream: true,
statusCodes: {
200: true,
500: 'server error'
}
};
return new Promise((resolve, reject) => {
this.modem.dial(call, (err, data) => {
if (err)
return reject(err);
resolve(data);
});
});
}
}
exports.Docker = Docker;
//# sourceMappingURL=docker.js.map
|
{
"pile_set_name": "Github"
}
|
/*
Fontname: -Misc-Fixed-Medium-R-Normal--7-70-75-75-C-50-ISO10646-1
Copyright: Public domain font. Share and enjoy.
Glyphs: 191/1848
BBX Build Mode: 0
*/
const uint8_t u8g2_font_5x7_tf[1677] U8G2_FONT_SECTION("u8g2_font_5x7_tf") =
"\277\0\2\2\3\3\3\4\4\5\7\0\377\6\377\6\0\1\22\2/\6p \5\0\275\1!\6\261\261"
"\31)\42\7[\267IV\0#\12-\261\253\206\252\206\252\0$\12-\261[\65\330 \245\5%\11\64"
"\261\311 \366\6\1&\11,\261\213)V\61\5'\5\231\267\31(\7r\261S\315\0)\10r\261\211"
"\251R\0*\7k\261I\325j+\12-\261\315(\16\231Q\4,\7[\257S%\0-\6\14\265\31"
"\1.\6R\261\31\1/\7$\263\7\261\15\60\10s\261\253\134\25\0\61\7s\261K\262\65\62\12\64"
"\261S\61\203X\216\0\63\13\64\261\31\31$\215dR\0\64\12\64\261\215\252\32\61\203\4\65\12\64\261"
"\31\32l$\223\2\66\12\64\261S\31\254(\223\2\67\13\64\261\31\31\304\14b\6\21\70\12\64\261S"
"\61\251(\223\2\71\12\64\261SQ\246\15\222\2:\7j\261\31q\4;\10\63\257\263\221*\1<\10"
"k\261M\65\310 =\10\34\263\31\31\215\0>\11k\261\311 \203T\2\77\11s\261k\246\14\23\0"
"@\11\64\261SQ\335H\1A\11\64\261SQ\216)\3B\12\64\261Yq\244(G\2C\13\64\261"
"SQ\203\14bR\0D\11\64\261Y\321\71\22\0E\13\64\261\31\32\254\14\62\30\1F\13\64\261\31"
"\32\254\14\62\310\0G\12\64\261SQ\203\64\323\0H\10\64\261\211rL\63I\7s\261Y\261\65J"
"\13\64\261\7\31d\220\201L\12K\12\64\261\211*I\231\312\0L\14\64\261\311 \203\14\62\310`\4"
"M\11\64\261\211\343\210f\0N\10\64\261\211k\251\63O\11\64\261S\321\231\24\0P\12\64\261YQ"
"\216\224A\6Q\12<\257S\321\134I\243\0R\11\64\261YQ\216\324\14S\12\64\261S\61eT&"
"\5T\7s\261Y\261\13U\10\64\261\211\236I\1V\11\64\261\211\316$\25\0W\11\64\261\211\346\70"
"b\0X\12\64\261\211\62I\25e\0Y\10s\261IVY\1Z\12\64\261\31\31\304\66\30\1[\7"
"s\261\31\261\71\134\11$\263\311(\243\214\2]\7s\261\231\315\21^\5S\271k_\6\14\261\31\1"
"`\6R\271\211\1a\10$\261\33Q\251\2b\13\64\261\311 \203\25\345H\0c\7#\261\233\31\10"
"d\12\64\261\7\31\244\21e\32e\11$\261Sid\240\0f\11\64\261\255\312\231A\4g\11,\257"
"\33\61\251\214\6h\12\64\261\311 \203\25\315\0i\10s\261\313HV\3j\11{\257\315\260T\25\0"
"k\13\64\261\311 \203\224d*\3l\7s\261\221]\3m\10$\261IiH\31n\7$\261Y\321"
"\14o\10$\261SQ&\5p\11,\257YQ\216\224\1q\11,\257\33Q\246\15\2r\10$\261Y"
"Q\203\14s\10$\261\33\32\15\5t\12\64\261\313 \316\14\62\22u\7$\261\211f\32v\7c\261"
"IV\5w\7$\261\211r\34x\10$\261\211I\252\30y\11,\257\211\62\225%\0z\10$\261\31"
"\261\34\1{\10s\261MI\326 |\5\261\261\71}\12s\261\311 \252\230\42\0~\7\24\271K*"
"\1\240\5\0\275\1\241\6\261\261I#\242\11\64\257\215#\65g\2\243\10,\261UqV\2\244\13-"
"\261\311 \315\24W\6\1\245\11s\261I\252Z\61\1\246\6\251\261Q\2\247\10{\257\233\252\222\13\250"
"\6K\273I\1\251\15=\257[\31\250\64U\322 -\0\252\6\33\267[I\253\7\35\263\213\262\1\254"
"\7\24\263\31\31\4\255\5K\265\31\256\14=\257[\31\214\64\247\6i\1\257\6\14\273\31\1\260\6["
"\267\353\2\261\13\65\261\315(\16\231Q\34\2\262\6b\265Q\6\263\6b\265\31i\264\6R\271S\0"
"\265\10,\257\211\346H\31\266\10\64\261\33j\365\3\267\6R\265\31\1\270\6R\257S\0\271\7c\265"
"K\62\15\272\6\33\267\353\2\273\10\35\263\211\245L\0\274\14<\257\311 \203\14bT\33\4\275\15<"
"\257\311 \203\14\222\6\61\3\1\276\13<\257\221\32D\25\325\6\1\277\11s\261\313\60\305T\1\300\11"
"\64\261SQ\216)\3\301\11\64\261SQ\216)\3\302\11\64\261SQ\216)\3\303\11\64\261SQ\216"
")\3\304\12\64\261\211I\305\61e\0\305
|
{
"pile_set_name": "Github"
}
|
{if in_array('state', $optionalFields)}
<script>
var stateNotRequired = true;
</script>
{/if}
<script type="text/javascript" src="{$BASE_PATH_JS}/StatesDropdown.js"></script>
{if $registrationDisabled}
{include file="$template/includes/alert.tpl" type="error" msg=$LANG.registerCreateAccount|cat:' <strong><a href="cart.php" class="alert-link">'|cat:$LANG.registerCreateAccountOrder|cat:'</a></strong>'}
{/if}
{if $errormessage}
{include file="$template/includes/alert.tpl" type="error" errorshtml=$errormessage}
{/if}
{if !$registrationDisabled}
<form method="post" class="using-password-strength" action="{$smarty.server.PHP_SELF}" role="form">
<input type="hidden" name="register" value="true"/>
<div class="row">
<div class="col-md-6">
<div class="form-group">
<label for="firstname" class="control-label">{$LANG.clientareafirstname}</label>
<input type="text" name="firstname" id="firstname" value="{$clientfirstname}" class="form-control" {if !in_array('firstname', $optionalFields)}required{/if} />
</div>
<div class="form-group">
<label for="lastname" class="control-label">{$LANG.clientarealastname}</label>
<input type="text" name="lastname" id="lastname" value="{$clientlastname}" class="form-control" {if !in_array('lastname', $optionalFields)}required{/if} />
</div>
<div class="form-group">
<label for="companyname" class="control-label">{$LANG.clientareacompanyname}</label>
<input type="text" name="companyname" id="companyname" value="{$clientcompanyname}" class="form-control"/>
</div>
<div class="form-group">
<label for="email" class="control-label">{$LANG.clientareaemail}</label>
<input type="email" name="email" id="email" value="{$clientemail}" class="form-control"/>
</div>
<div id="newPassword1" class="form-group has-feedback">
<label for="inputNewPassword1" class="control-label">{$LANG.clientareapassword}</label>
<input type="password" class="form-control" id="inputNewPassword1" name="password" autocomplete="off" />
<span class="form-control-feedback glyphicon glyphicon-password"></span>
{include file="$template/includes/pwstrength.tpl"}
</div>
<div id="newPassword2" class="form-group has-feedback">
<label for="inputNewPassword2" class="control-label">{$LANG.clientareaconfirmpassword}</label>
<input type="password" class="form-control" id="inputNewPassword2" name="password2" autocomplete="off" />
<span class="form-control-feedback glyphicon glyphicon-password"></span>
<div id="inputNewPassword2Msg">
</div>
</div>
</div>
<div class="col-md-6">
<div class="form-group">
<label for="address1" class="control-label">{$LANG.clientareaaddress1}</label>
<input type="text" name="address1" id="address1" value="{$clientaddress1}" class="form-control" {if !in_array('address1', $optionalFields)}required{/if} />
</div>
<div class="form-group">
<label for="address2" class="control-label">{$LANG.clientareaaddress2}</label>
<input type="text" name="address2" id="address2" value="{$clientaddress2}" class="form-control"/>
</div>
<div class="form-group">
<label for="city" class="control-label">{$LANG.clientareacity}</label>
<input type="text" name="city" id="city" value="{$clientcity}" class="form-control" {if !in_array('city', $optionalFields)}required{/if} />
</div>
<div class="form-group">
<label for="state" class="control-label">{$LANG.clientareastate}</label>
<input type="text" name="state" id="state" value="{$clientstate}" class="form-control" {if !in_array('state', $optionalFields)}required{/if} />
</div>
<div class="form-group">
<label for="postcode" class="control-label">{$LANG.clientareapostcode}</label>
<input type="text" name="postcode" id="postcode" value="{$clientpostcode}" class="form-control" {if !in_array('postcode', $optionalFields)}required{/if} />
</div>
<div class="form-group">
<label for="country" class="control-label">{$LANG.clientareacountry}</label>
<select id="country" name="country" class="form-control">
{foreach $clientcountries as $countryCode => $countryName}
<option value="{$countryCode}"{if (!$clientcountry && $countryCode eq $defaultCountry) || ($countryCode eq $clientcountry)} selected="selected"{/if}>
{$countryName}
</option>
{/foreach}
</select>
</div>
<div class="form-group">
<label for="phonenumber" class="control-label">{$LANG.clientareaphonenumber}</label>
<input type="tel" name="phonenumber" id="phonenumber" value="{$clientphonenumber}" class="form-control" {if !in_array('phonenumber', $optionalFields)}required{/if} />
</div>
{if $customfields}
{foreach from=$customfields key=num item=customfield}
<div class="form-group">
<label class="control-label" for="customfield{$customfield.id}">{$customfield.name}</label>
<div class="control">
{$customfield.input} {$customfield.description}
</div>
</div>
{/foreach}
{/if}
{if $currencies}
<div class="form-group">
<label for="currency" class="control-label">{$LANG.choosecurrency}</label>
<select id="currency" name="currency" class="form-control">
{foreach from=$currencies item=curr}
<option value="{$curr.id}"{if !$smarty.post.currency && $curr.default || $smarty.post.currency eq $curr.id } selected{/if}>{$curr.code}</option>
{/foreach}
</select>
</div>
{/if}
</div>
</div>
{if $securityquestions}
<div class="panel panel-default">
<div class="panel-heading">
<h3 class="panel-title">{$LANG.clientareasecurityquestion}:</h3>
</div>
<div class="panel-body">
<div class="form-group col-sm-12">
<select name="securityqid" id="securityqid" class="form-control">
{foreach key=num item=question from=$securityquestions}
<option value={$question.id}>{$question.question}</option>
{/foreach}
</select>
</div>
<div class="form-group">
<label class="col-sm-4 control-label" for="securityqans">{$LANG.clientareasecurityanswer}</label>
<div class="col-sm-6">
<input type="password" name="securityqans" id="securityqans" class="form-control" autocomplete="off" />
</div>
</div>
</div>
</div>
{/if}
{
|
{
"pile_set_name": "Github"
}
|
/*
===========================================================================
Doom 3 GPL Source Code
Copyright (C) 1999-2011 id Software LLC, a ZeniMax Media company.
This file is part of the Doom 3 GPL Source Code (?Doom 3 Source Code?).
Doom 3 Source Code 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.
Doom 3 Source Code is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with Doom 3 Source Code. If not, see <http://www.gnu.org/licenses/>.
In addition, the Doom 3 Source Code is also subject to certain additional terms. You should have received a copy of these additional terms immediately following the terms and conditions of the GNU General Public License which accompanied the Doom 3 Source Code. If not, please request a copy in writing from id Software at the address below.
If you have questions concerning this license or the applicable additional terms, you may contact in writing id Software LLC, c/o ZeniMax Media Inc., Suite 120, Rockville, Maryland 20850 USA.
===========================================================================
*/
#include "../precompiled.h"
#pragma hdrstop
/*
=============
idJointMat::ToJointQuat
=============
*/
idJointQuat idJointMat::ToJointQuat( void ) const {
idJointQuat jq;
float trace;
float s;
float t;
int i;
int j;
int k;
static int next[3] = { 1, 2, 0 };
trace = mat[0 * 4 + 0] + mat[1 * 4 + 1] + mat[2 * 4 + 2];
if ( trace > 0.0f ) {
t = trace + 1.0f;
s = idMath::InvSqrt( t ) * 0.5f;
jq.q[3] = s * t;
jq.q[0] = ( mat[1 * 4 + 2] - mat[2 * 4 + 1] ) * s;
jq.q[1] = ( mat[2 * 4 + 0] - mat[0 * 4 + 2] ) * s;
jq.q[2] = ( mat[0 * 4 + 1] - mat[1 * 4 + 0] ) * s;
} else {
i = 0;
if ( mat[1 * 4 + 1] > mat[0 * 4 + 0] ) {
i = 1;
}
if ( mat[2 * 4 + 2] > mat[i * 4 + i] ) {
i = 2;
}
j = next[i];
k = next[j];
t = ( mat[i * 4 + i] - ( mat[j * 4 + j] + mat[k * 4 + k] ) ) + 1.0f;
s = idMath::InvSqrt( t ) * 0.5f;
jq.q[i] = s * t;
jq.q[3] = ( mat[j * 4 + k] - mat[k * 4 + j] ) * s;
jq.q[j] = ( mat[i * 4 + j] + mat[j * 4 + i] ) * s;
jq.q[k] = ( mat[i * 4 + k] + mat[k * 4 + i] ) * s;
}
jq.t[0] = mat[0 * 4 + 3];
jq.t[1] = mat[1 * 4 + 3];
jq.t[2] = mat[2 * 4 + 3];
return jq;
}
|
{
"pile_set_name": "Github"
}
|
require 'spec_helper'
describe NodeGroup, :type => :model do
describe "associations" do
before { @node_group = build(:node_group) }
it { should have_many(:node_classes).through(:node_group_class_memberships) }
it { should have_many(:nodes).through(:node_group_memberships) }
end
describe "when destroying" do
before :each do
@group = create(:node_group)
end
it "should disassociate nodes" do
node = create(:node)
node.node_groups << @group
@group.destroy
node.node_groups.reload.should be_empty
node.node_group_memberships.reload.should be_empty
end
it "should disassociate node_classes" do
node_class = create(:node_class)
@group.node_classes << node_class
@group.destroy
node_class.node_group_children.reload.should be_empty
node_class.node_group_class_memberships.reload.should be_empty
end
it "should disassociate node_groups" do
group_last = create(:node_group)
group_first = create(:node_group)
group_first.node_groups << @group
@group.node_groups << group_last
@group.destroy
group_first.reload.node_groups.should be_empty
group_first.node_group_edges_out.should be_empty
NodeGroupEdge.all.should be_empty
end
end
describe "when including groups" do
before :each do
@node_group_a = create(:node_group, :name => 'A')
@node_group_b = create(:node_group, :name => 'B')
end
describe "by id" do
it "should not allow a group to include itself" do
@node_group_a.assigned_node_group_ids = @node_group_a.id
@node_group_a.save
@node_group_a.should_not be_valid
@node_group_a.errors.full_messages.should include("Validation failed: Creating a dependency from group 'A' to itself creates a cycle")
@node_group_a.node_groups.should be_empty
end
it "should not allow a cycle to be formed" do
@node_group_b.node_groups << @node_group_a
@node_group_a.assigned_node_group_ids = @node_group_b.id
@node_group_a.save
@node_group_a.should_not be_valid
@node_group_a.errors.full_messages.should include("Validation failed: Creating a dependency from group 'A' to group 'B' creates a cycle")
@node_group_a.node_groups.should be_empty
end
it "should allow a group to be included twice through inheritance" do
@node_group_c = create(:node_group)
@node_group_d = create(:node_group)
@node_group_a.node_groups << @node_group_c
@node_group_b.node_groups << @node_group_c
@node_group_d.assigned_node_group_ids = [@node_group_a.id, @node_group_b.id]
@node_group_d.should be_valid
@node_group_d.errors.should be_empty
@node_group_d.node_groups.should include(@node_group_a,@node_group_b)
end
end
describe "by name" do
it "should not allow a group to include itself" do
@node_group_a.assigned_node_group_names = @node_group_a.name
@node_group_a.save
@node_group_a.should_not be_valid
@node_group_a.errors.full_messages.should include("Validation failed: Creating a dependency from group 'A' to itself creates a cycle")
@node_group_a.node_groups.should be_empty
end
it "should not allow a cycle to be formed" do
@node_group_b.node_groups << @node_group_a
@node_group_a.assigned_node_group_names = @node_group_b.name
@node_group_a.save
@node_group_a.should_not be_valid
@node_group_a.errors.full_messages.should include("Validation failed: Creating a dependency from group 'A' to group 'B' creates a cycle")
@node_group_a.node_groups.should be_empty
end
it "should allow a group to be included twice through inheritance" do
@node_group_c = create(:node_group)
@node_group_d = create(:node_group)
@node_group_a.node_groups << @node_group_c
@node_group_b.node_groups << @node_group_c
@node_group_d.assigned_node_group_names = [@node_group_a.name, @node_group_b.name]
@node_group_d.should be_valid
@node_group_d.errors.should be_empty
@node_group_d.node_groups.should include(@node_group_a,@node_group_b)
end
end
end
describe "when including classes" do
before :each do
@node_group = create(:node_group)
@node_class_a = create(:node_class, :name => 'class_a')
@node_class_b = create(:node_class, :name => 'class_b')
end
describe "by id" do
describe "with a single id" do
it "should set the class" do
@node_group.assigned_node_class_ids = @node_class_a.id
@node_group.should be_valid
@node_group.errors.should be_empty
@node_group.node_classes.size.should == 1
@node_group.node_classes.should include(@node_class_a)
end
end
describe "with multiple ids" do
it "should set the classes" do
@node_group.assigned_node_class_ids = [@node_class_a.id, @node_class_b.id]
@node_group.should be_valid
@node_group.errors.should be_empty
@node_group.node_classes.size.should == 2
@node_group.node_classes.should include(@node_class_a, @node_class_b)
end
end
end
describe "by name" do
describe "with a single name" do
it "should set the class" do
@node_group.assigned_node_class_names = @node_class_a.name
@node_group.should be_valid
@node_group.errors.should be_empty
@node_group.node_classes.size.should == 1
@node_group.node_classes.should include(@node_class_a)
end
end
describe "with multiple names" do
it "should set the classes" do
@node_group.assigned_node_class_names = [@node_class_a.name, @node_class_b.name]
@node_group.should be_valid
@node_group.errors.should be_empty
@node_group.node_classes.size.should == 2
@node_group.node_classes.should include(@node_class_a, @node_class_b)
end
end
end
describe "by name, and id" do
it "should add all specified classes" do
@node_group.assigned_node_class_names = @node_class_a.name
@node_group.assigned_node_class_ids = @node_class_b.id
@node_group.should be_valid
@node_group.errors.should be_empty
@node_group.node_classes.size.should == 2
@node
|
{
"pile_set_name": "Github"
}
|
/*
Copyright 2013 KLab Inc.
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
*/
//
// CiOSTmpFile.cpp
// GameEngine
//
//
//
#include <unistd.h>
#include <fcntl.h>
#include "CiOSPathConv.h"
#include "CiOSTmpFile.h"
#include "CPFInterface.h"
CiOSTmpFile::CiOSTmpFile(const char * path) : m_fullpath(0)
{
m_fullpath = CiOSPathConv::getInstance().fullpath(path);
// 平成24年11月27日(火)
// ファイルが存在しない場合に該当ファイルが生成されない事への対応と
// 権限の付与を行いました。
m_fd = open(m_fullpath, O_WRONLY | O_CREAT | O_TRUNC, S_IRUSR | S_IWUSR);
CPFInterface::getInstance().platform().excludePathFromBackup(m_fullpath);
}
CiOSTmpFile::~CiOSTmpFile()
{
if(m_fd > 0) {
close(m_fd);
}
delete [] m_fullpath;
}
size_t
CiOSTmpFile::writeTmp(void *ptr, size_t size)
{
return write(m_fd, ptr, size);
}
|
{
"pile_set_name": "Github"
}
|
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/>
<meta http-equiv="X-UA-Compatible" content="IE=9"/>
<title>CMSIS-DSP: arm_pid_init_q15.c File Reference</title>
<link href="tabs.css" rel="stylesheet" type="text/css"/>
<link href="cmsis.css" rel="stylesheet" type="text/css" />
<script type="text/javascript" src="jquery.js"></script>
<script type="text/javascript" src="dynsections.js"></script>
<link href="navtree.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="resize.js"></script>
<script type="text/javascript" src="navtree.js"></script>
<script type="text/javascript">
$(document).ready(initResizable);
</script>
<link href="search/search.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="search/search.js"></script>
<script type="text/javascript">
$(document).ready(function() { searchBox.OnSelectItem(0); });
</script>
<link href="stylsheetf" rel="stylesheet" type="text/css" />
</head>
<body>
<div id="top"><!-- do not remove this div, it is closed by doxygen! -->
<div id="titlearea">
<table cellspacing="0" cellpadding="0">
<tbody>
<tr style="height: 46px;">
<td id="projectlogo"><img alt="Logo" src="CMSIS_Logo_Final.png"/></td>
<td style="padding-left: 0.5em;">
<div id="projectname">CMSIS-DSP
 <span id="projectnumber">Version 1.4.4</span>
</div>
<div id="projectbrief">CMSIS DSP Software Library</div>
</td>
</tr>
</tbody>
</table>
</div>
<!-- end header part -->
<div id="CMSISnav" class="tabs1">
<ul class="tablist">
<li><a href="../../General/html/index.html"><span>CMSIS</span></a></li>
<li><a href="../../Core/html/index.html"><span>CORE</span></a></li>
<li><a href="../../Driver/html/index.html"><span>Driver</span></a></li>
<li class="current"><a href="../../DSP/html/index.html"><span>DSP</span></a></li>
<li><a href="../../RTOS/html/index.html"><span>RTOS API</span></a></li>
<li><a href="../../Pack/html/index.html"><span>Pack</span></a></li>
<li><a href="../../SVD/html/index.html"><span>SVD</span></a></li>
</ul>
</div>
<!-- Generated by Doxygen 1.8.2 -->
<script type="text/javascript">
var searchBox = new SearchBox("searchBox", "search",false,'Search');
</script>
<div id="navrow1" class="tabs">
<ul class="tablist">
<li><a href="index.html"><span>Main Page</span></a></li>
<li><a href="pages.html"><span>Usage and Description</span></a></li>
<li><a href="modules.html"><span>Reference</span></a></li>
<li>
<div id="MSearchBox" class="MSearchBoxInactive">
<span class="left">
<img id="MSearchSelect" src="search/mag_sel.png"
onmouseover="return searchBox.OnSearchSelectShow()"
onmouseout="return searchBox.OnSearchSelectHide()"
alt=""/>
<input type="text" id="MSearchField" value="Search" accesskey="S"
onfocus="searchBox.OnSearchFieldFocus(true)"
onblur="searchBox.OnSearchFieldFocus(false)"
onkeyup="searchBox.OnSearchFieldChange(event)"/>
</span><span class="right">
<a id="MSearchClose" href="javascript:searchBox.CloseResultsWindow()"><img id="MSearchCloseImg" border="0" src="search/close.png" alt=""/></a>
</span>
</div>
</li>
</ul>
</div>
</div><!-- top -->
<div id="side-nav" class="ui-resizable side-nav-resizable">
<div id="nav-tree">
<div id="nav-tree-contents">
<div id="nav-sync" class="sync"></div>
</div>
</div>
<div id="splitbar" style="-moz-user-select:none;"
class="ui-resizable-handle">
</div>
</div>
<script type="text/javascript">
$(document).ready(function(){initNavTree('arm__pid__init__q15_8c.html','');});
</script>
<div id="doc-content">
<!-- window showing the filter options -->
<div id="MSearchSelectWindow"
onmouseover="return searchBox.OnSearchSelectShow()"
onmouseout="return searchBox.OnSearchSelectHide()"
onkeydown="return searchBox.OnSearchSelectKey(event)">
<a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(0)"><span class="SelectionMark"> </span>All</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(1)"><span class="SelectionMark"> </span>Data Structures</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(2)"><span class="SelectionMark"> </span>Files</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(3)"><span class="SelectionMark"> </span>Functions</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(4)"><span class="SelectionMark"> </span>Variables</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(5)"><span class="SelectionMark"> </span>Typedefs</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(6)"><span class="SelectionMark"> </span>Enumerations</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(7)"><span class="SelectionMark"> </span>Enumerator</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(8)"><span class="SelectionMark"> </span>Macros</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(9)"><span class="SelectionMark"> </span>Groups</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(10)"><span class="SelectionMark"> </span>Pages</a></div>
<!-- iframe showing the search results (closed by default) -->
<div id="MSearchResultsWindow">
<iframe src="javascript:void(0)" frameborder="0"
name="MSearchResults" id="MSearchResults">
</iframe>
</div>
<div class="header">
<div class="summary">
<a href="#func-members">Functions</a> </div>
<div class="headertitle">
<div class="title">arm_pid_init_q15.c File Reference</div> </div>
</div><!--header-->
<div class="contents">
<table class="memberdecls">
<tr class="heading"><td colspan
|
{
"pile_set_name": "Github"
}
|
package com.ullink.slack.simpleslackapi;
import lombok.Data;
@Data
public class SlackTeam {
private final String id;
private final String name;
private final String domain;
}
|
{
"pile_set_name": "Github"
}
|
/*++
Copyright (c) 2004 - 2006, Intel Corporation. All rights reserved.<BR>
This program and the accompanying materials
are licensed and made available under the terms and conditions of the BSD License
which accompanies this distribution. The full text of the license may be found at
http://opensource.org/licenses/bsd-license.php
THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
Module Name:
CpuFuncs.h
Abstract:
--*/
#ifndef _CPU_FUNCS_H_
#define _CPU_FUNCS_H_
#define EFI_CPUID_SIGNATURE 0x0
#define EFI_CPUID_VERSION_INFO 0x1
#define EFI_CPUID_CACHE_INFO 0x2
#define EFI_CPUID_SERIAL_NUMBER 0x3
#define EFI_CPUID_EXTENDED_FUNCTION 0x80000000
#define EFI_CPUID_EXTENDED_CPU_SIG 0x80000001
#define EFI_CPUID_BRAND_STRING1 0x80000002
#define EFI_CPUID_BRAND_STRING2 0x80000003
#define EFI_CPUID_BRAND_STRING3 0x80000004
//
// CPUID version information masks
// Note: leaving masks here is for the compatibility
// use EfiCpuVersion (...) instead
//
#define EFI_CPUID_FAMILY 0x0F00
#define EFI_CPUID_MODEL 0x00F0
#define EFI_CPUID_STEPPING 0x000F
#define EFI_CPUID_PENTIUM_M 0x0600
#define EFI_CPUID_BANIAS 0x0090
#define EFI_CPUID_DOTHAN 0x00D0
#define EFI_CPUID_NETBURST 0x0F00
#define EFI_MSR_IA32_PLATFORM_ID 0x17
#define EFI_MSR_IA32_APIC_BASE 0x1B
#define EFI_MSR_EBC_HARD_POWERON 0x2A
#define EFI_MSR_EBC_SOFT_POWERON 0x2B
#define BINIT_DRIVER_DISABLE 0x40
#define INTERNAL_MCERR_DISABLE 0x20
#define INITIATOR_MCERR_DISABLE 0x10
#define EFI_MSR_EBC_FREQUENCY_ID 0x2C
#define EFI_MSR_IA32_BIOS_UPDT_TRIG 0x79
#define EFI_MSR_IA32_BIOS_SIGN_ID 0x8B
#define EFI_MSR_PSB_CLOCK_STATUS 0xCD
#define EFI_APIC_GLOBAL_ENABLE 0x800
#define EFI_MSR_IA32_MISC_ENABLE 0x1A0
#define LIMIT_CPUID_MAXVAL_ENABLE_BIT 0x00400000
#define AUTOMATIC_THERMAL_CONTROL_ENABLE_BIT 0x00000008
#define COMPATIBLE_FPU_OPCODE_ENABLE_BIT 0x00000004
#define LOGICAL_PROCESSOR_PRIORITY_ENABLE_BIT 0x00000002
#define FAST_STRING_ENABLE_BIT 0x00000001
#define EFI_CACHE_VARIABLE_MTRR_BASE 0x200
#define EFI_CACHE_VARIABLE_MTRR_END 0x20F
#define EFI_CACHE_IA32_MTRR_DEF_TYPE 0x2FF
#define EFI_CACHE_VALID_ADDRESS 0xFFFFFF000
#define EFI_CACHE_MTRR_VALID 0x800
#define EFI_CACHE_FIXED_MTRR_VALID 0x400
#define EFI_MSR_VALID_MASK 0xFFFFFFFFF
#define EFI_IA32_MTRR_FIX64K_00000 0x250
#define EFI_IA32_MTRR_FIX16K_80000 0x258
#define EFI_IA32_MTRR_FIX16K_A0000 0x259
#define EFI_IA32_MTRR_FIX4K_C0000 0x268
#define EFI_IA32_MTRR_FIX4K_C8000 0x269
#define EFI_IA32_MTRR_FIX4K_D0000 0x26A
#define EFI_IA32_MTRR_FIX4K_D8000 0x26B
#define EFI_IA32_MTRR_FIX4K_E0000 0x26C
#define EFI_IA32_MTRR_FIX4K_E8000 0x26D
#define EFI_IA32_MTRR_FIX4K_F0000 0x26E
#define EFI_IA32_MTRR_FIX4K_F8000 0x26F
#define EFI_IA32_MCG_CAP 0x179
#define EFI_IA32_MCG_CTL 0x17B
#define EFI_IA32_MC0_CTL 0x400
#define EFI_IA32_MC0_STATUS 0x401
#define EFI_CACHE_UNCACHEABLE 0
#define EFI_CACHE_WRITECOMBINING 1
#define EFI_CACHE_WRITETHROUGH 4
#define EFI_CACHE_WRITEPROTECTED 5
#define EFI_CACHE_WRITEBACK 6
//
// Combine f(FamilyId), m(Model), s(SteppingId) to a single 32 bit number
//
#define EfiMakeCpuVersion(f, m, s) \
(((UINT32) (f) << 16) | ((UINT32) (m) << 8) | ((UINT32) (s)))
typedef struct {
UINT32 HeaderVersion;
UINT32 UpdateRevision;
UINT32 Date;
UINT32 ProcessorId;
UINT32 Checksum;
UINT32 LoaderRevision;
UINT32 ProcessorFlags;
UINT32 DataSize;
UINT32 TotalSize;
UINT8 Reserved[12];
} EFI_CPU_MICROCODE_HEADER;
typedef struct {
UINT32 ExtSigCount;
UINT32 ExtChecksum;
UINT8 Reserved[12];
UINT32 ProcessorId;
UINT32 ProcessorFlags;
UINT32 Checksum;
} EFI_CPU_MICROCODE_EXT_HEADER;
typedef struct {
UINT32 RegEax;
UINT32 RegEbx;
UINT32 RegEcx;
UINT32 RegEdx;
} EFI_CPUID_REGISTER;
VOID
EfiWriteMsr (
IN UINT32 Input,
IN UINT64 Value
)
/*++
Routine Description:
Write Cpu MSR
Arguments:
Input -The index value to select the register
Value -The value to write to the selected register
Returns:
None
--*/
;
UINT64
EfiReadMsr (
IN UINT32 Input
)
/*++
Routine Description:
Read Cpu MSR.
Arguments:
Input: -The index value to select the register
Returns:
Return the read data
--*/
;
VOID
EfiCpuid (
IN UINT32 RegEax,
OUT EFI_CPUID_REGISTER *Reg
)
/*++
Routine Description
|
{
"pile_set_name": "Github"
}
|
gcr.io/google_containers/hyperkube-arm:v1.16.2
|
{
"pile_set_name": "Github"
}
|
package pcap
import (
"io"
"github.com/brimsec/zq/pkg/nano"
"github.com/brimsec/zq/pkg/ranger"
"github.com/brimsec/zq/pkg/slicer"
)
func NewSlicer(seeker io.ReadSeeker, index Index, span nano.Span) (*slicer.Reader, error) {
slices, err := GenerateSlices(index, span)
if err != nil {
return nil, err
}
return slicer.NewReader(seeker, slices)
}
// GenerateSlices takes an index and time span and generates a list of
// slices that should be read to enumerate the relevant chunks of an
// underlying pcap file. Extra packets may appear in the resulting stream
// but all packets that fall within the time range will be produced, i.e.,
// another layering of time filtering should be applied to resulting packets.
func GenerateSlices(index Index, span nano.Span) ([]slicer.Slice, error) {
var slices []slicer.Slice
for _, section := range index {
pslice, err := FindPacketSlice(section.Index, span)
if err == ErrNoPcapsFound {
continue
}
if err != nil {
return nil, err
}
for _, slice := range section.Blocks {
slices = append(slices, slice)
}
slices = append(slices, pslice)
}
return slices, nil
}
func FindPacketSlice(e ranger.Envelope, span nano.Span) (slicer.Slice, error) {
if len(e) == 0 {
return slicer.Slice{}, ErrNoPcapsFound
}
d := e.FindSmallestDomain(ranger.Range{uint64(span.Ts), uint64(span.End())})
gap := d.X1 - d.X0
if gap == 0 {
return slicer.Slice{}, ErrNoPcapsFound
}
return slicer.Slice{d.X0, d.X1 - d.X0}, nil
}
|
{
"pile_set_name": "Github"
}
|
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.