text
stringlengths 2
100k
| meta
dict |
---|---|
153 74 313 243 0.28
| {
"pile_set_name": "Github"
} |
form=五律
tags=
常时岂不别,
此别异常情。
南国初闻雁,
中原未息兵。
暗蛩侵语歇,
疏磬入吟清。
曾听无生说,
辞师话此行。
| {
"pile_set_name": "Github"
} |
import {
blockchainTests,
constants,
expect,
filterLogsToArguments,
verifyEventsFromLogs,
} from '@0x/contracts-test-utils';
import { SafeMathRevertErrors } from '@0x/contracts-utils';
import { BigNumber, hexUtils } from '@0x/utils';
import * as _ from 'lodash';
import { StakingRevertErrors } from '../../src';
import { artifacts } from '../artifacts';
import {
TestMixinStakingPoolContract,
TestMixinStakingPoolEvents,
TestMixinStakingPoolStakingPoolCreatedEventArgs as StakingPoolCreated,
} from '../wrappers';
blockchainTests.resets('MixinStakingPool unit tests', env => {
let testContract: TestMixinStakingPoolContract;
let operator: string;
let maker: string;
let notOperatorOrMaker: string;
before(async () => {
[operator, maker, notOperatorOrMaker] = await env.getAccountAddressesAsync();
testContract = await TestMixinStakingPoolContract.deployFrom0xArtifactAsync(
artifacts.TestMixinStakingPool,
env.provider,
env.txDefaults,
artifacts,
);
});
function toNextPoolId(lastPoolId: string): string {
return hexUtils.leftPad(new BigNumber(lastPoolId.slice(2), 16).plus(1));
}
function randomOperatorShare(): number {
return _.random(0, constants.PPM_100_PERCENT);
}
interface CreatePoolOpts {
poolId: string;
operator: string;
operatorShare: number;
}
async function createPoolAsync(opts?: Partial<CreatePoolOpts>): Promise<CreatePoolOpts> {
const _opts = {
poolId: hexUtils.random(),
operator,
operatorShare: randomOperatorShare(),
...opts,
};
await testContract
.setPoolById(_opts.poolId, {
operator: _opts.operator,
operatorShare: _opts.operatorShare,
})
.awaitTransactionSuccessAsync();
return _opts;
}
async function addMakerToPoolAsync(poolId: string, _maker: string): Promise<void> {
await testContract.setPoolIdByMaker(poolId, _maker).awaitTransactionSuccessAsync();
}
describe('onlyStakingPoolOperator modifier', () => {
it('fails if not called by the pool operator', async () => {
const { poolId } = await createPoolAsync();
const tx = testContract.testOnlyStakingPoolOperatorModifier(poolId).callAsync({ from: notOperatorOrMaker });
const expectedError = new StakingRevertErrors.OnlyCallableByPoolOperatorError(notOperatorOrMaker, poolId);
return expect(tx).to.revertWith(expectedError);
});
it('fails if called by a pool maker', async () => {
const { poolId } = await createPoolAsync();
await addMakerToPoolAsync(poolId, maker);
const tx = testContract.testOnlyStakingPoolOperatorModifier(poolId).callAsync({ from: maker });
const expectedError = new StakingRevertErrors.OnlyCallableByPoolOperatorError(maker, poolId);
return expect(tx).to.revertWith(expectedError);
});
it('succeeds if called by the pool operator', async () => {
const { poolId } = await createPoolAsync();
await testContract.testOnlyStakingPoolOperatorModifier(poolId).callAsync({ from: operator });
});
});
describe('createStakingPool()', () => {
let nextPoolId: string;
before(async () => {
nextPoolId = toNextPoolId(await testContract.lastPoolId().callAsync());
});
it('fails if the next pool ID overflows', async () => {
await testContract.setLastPoolId(hexUtils.toHex(constants.MAX_UINT256)).awaitTransactionSuccessAsync();
const tx = testContract.createStakingPool(randomOperatorShare(), false).awaitTransactionSuccessAsync();
const expectedError = new SafeMathRevertErrors.Uint256BinOpError(
SafeMathRevertErrors.BinOpErrorCodes.AdditionOverflow,
constants.MAX_UINT256,
new BigNumber(1),
);
return expect(tx).to.revertWith(expectedError);
});
it('fails if the operator share is invalid', async () => {
const operatorShare = constants.PPM_100_PERCENT + 1;
const tx = testContract.createStakingPool(operatorShare, false).awaitTransactionSuccessAsync();
const expectedError = new StakingRevertErrors.OperatorShareError(
StakingRevertErrors.OperatorShareErrorCodes.OperatorShareTooLarge,
nextPoolId,
operatorShare,
);
return expect(tx).to.revertWith(expectedError);
});
it('operator can create and own multiple pools', async () => {
const { logs: logs1 } = await testContract
.createStakingPool(randomOperatorShare(), false)
.awaitTransactionSuccessAsync();
const { logs: logs2 } = await testContract
.createStakingPool(randomOperatorShare(), false)
.awaitTransactionSuccessAsync();
const createEvents = filterLogsToArguments<StakingPoolCreated>(
[...logs1, ...logs2],
TestMixinStakingPoolEvents.StakingPoolCreated,
);
expect(createEvents).to.be.length(2);
const poolIds = createEvents.map(e => e.poolId);
expect(poolIds[0]).to.not.eq(poolIds[1]);
const pools = await Promise.all(
poolIds.map(async poolId => testContract.getStakingPool(poolId).callAsync()),
);
expect(pools[0].operator).to.eq(pools[1].operator);
});
it('operator can only be maker of one pool', async () => {
await testContract.createStakingPool(randomOperatorShare(), true).awaitTransactionSuccessAsync();
const { logs } = await testContract
.createStakingPool(randomOperatorShare(), true)
.awaitTransactionSuccessAsync();
const createEvents = filterLogsToArguments<StakingPoolCreated>(
logs,
TestMixinStakingPoolEvents.StakingPoolCreated,
);
const makerPool = await testContract.poolIdByMaker(operator).callAsync();
expect(makerPool).to.eq(createEvents[0].poolId);
});
it('computes correct next pool ID', async () => {
const { logs } = await testContract
.createStakingPool(randomOperatorShare(), false)
.awaitTransactionSuccessAsync();
const createEvents = filterLogsToArguments<StakingPoolCreated>(
logs,
TestMixinStakingPoolEvents.StakingPoolCreated,
);
const poolId = createEvents[0].poolId;
expect(poolId).to.eq(nextPoolId);
});
it('increments last pool ID counter', async () => {
await testContract.createStakingPool(randomOperatorShare(), false).awaitTransactionSuccessAsync();
const lastPoolIdAfter = await testContract.lastPoolId().callAsync();
expect(lastPoolIdAfter).to.eq(nextPoolId);
});
it('records pool details', async () => {
const operatorShare = randomOperatorShare();
await testContract.createStakingPool(operatorShare, false).awaitTransactionSuccessAsync({ from: operator });
const pool = await testContract.getStakingPool(nextPoolId).callAsync();
expect(pool.operator).to.eq(operator);
expect(pool.operatorShare).to.bignumber.eq(operatorShare);
});
it('records pool details when operator share is 100%', async () => {
const operatorShare = constants.PPM_100_PERCENT;
await testContract.createStakingPool(operatorShare, false).awaitTransactionSuccessAsync({ from: operator });
const pool = await testContract.getStakingPool(nextPoolId).callAsync();
expect(pool.operator).to.eq(operator);
expect(pool.operatorShare).to.bignumber.eq(operatorShare);
});
it('records pool details when operator share is 0%', async () => {
const operatorShare = constants.ZERO_AMOUNT;
await testContract.createStakingPool(operatorShare, false).awaitTransactionSuccessAsync({ from: operator });
const pool = await testContract.getStakingPool(nextPoolId).callAsync();
expect(pool.operator).to.eq(operator);
expect(pool.operatorShare).to.bignumber.eq(operatorShare);
});
it('returns the next pool ID', async () => {
const poolId = await testContract.createStakingPool(randomOperatorShare(), false).callAsync({
from: operator,
});
expect(poolId).to.eq(nextPoolId);
});
it('can add operator as a maker', async () => {
const operatorShare = randomOperatorShare();
await testContract.createStakingPool(operatorShare, true).awaitTransactionSuccessAsync({ from: operator });
const makerPoolId = await testContract.poolIdByMaker(operator).callAsync();
expect(makerPoolId).to.eq(nextPoolId);
});
it('emits a `StakingPoolCreated` event', async () => {
const operatorShare = randomOperatorShare();
const { logs } = await testContract.createStakingPool(operatorShare, false).awaitTransactionSuccessAsync({
from: operator,
});
verifyEventsFromLogs(
logs,
[
{
poolId: nextPoolId,
operator,
operatorShare: new BigNumber(operatorShare),
},
],
TestMixinStakingPoolEvents.StakingPoolCreated,
);
});
it('emits a `MakerStakingPoolSet` event when also joining as a maker', async () => {
const operatorShare = randomOperatorShare();
const { logs } = await testContract.createStakingPool(operatorShare, true).awaitTransactionSuccessAsync({
from: operator,
});
verifyEventsFromLogs(
logs,
[
{
makerAddress: operator,
poolId: nextPoolId,
},
],
TestMixinStakingPoolEvents.MakerStakingPoolSet,
);
});
});
describe('decreaseStakingPoolOperatorShare()', () => {
it('fails if not called by operator', async () => {
const { poolId, operatorShare } = await createPoolAsync();
const tx = testContract
.decreaseStakingPoolOperatorShare(poolId, operatorShare - 1)
.awaitTransactionSuccessAsync({ from: notOperatorOrMaker });
const expectedError = new StakingRevertErrors.OnlyCallableByPoolOperatorError(notOperatorOrMaker, poolId);
return expect(tx).to.revertWith(expectedError);
});
it('fails if called by maker', async () => {
const { poolId, operatorShare } = await createPoolAsync();
await addMakerToPoolAsync(poolId, maker);
const tx = testContract
.decreaseStakingPoolOperatorShare(poolId, operatorShare - 1)
.awaitTransactionSuccessAsync({ from: maker });
const expectedError = new StakingRevertErrors.OnlyCallableByPoolOperatorError(maker, poolId);
return expect(tx).to.revertWith(expectedError);
});
it('fails if operator share is greater than current', async () => {
const { poolId, operatorShare } = await createPoolAsync();
const tx = testContract
.decreaseStakingPoolOperatorShare(poolId, operatorShare + 1)
.awaitTransactionSuccessAsync({ from: operator });
const expectedError = new StakingRevertErrors.OperatorShareError(
StakingRevertErrors.OperatorShareErrorCodes.CanOnlyDecreaseOperatorShare,
poolId,
operatorShare + 1,
);
return expect(tx).to.revertWith(expectedError);
});
it('fails if operator share is greater than PPM_100_PERCENT', async () => {
const { poolId } = await createPoolAsync();
const tx = testContract
.decreaseStakingPoolOperatorShare(poolId, constants.PPM_100_PERCENT + 1)
.awaitTransactionSuccessAsync({ from: operator });
const expectedError = new StakingRevertErrors.OperatorShareError(
StakingRevertErrors.OperatorShareErrorCodes.OperatorShareTooLarge,
poolId,
constants.PPM_100_PERCENT + 1,
);
return expect(tx).to.revertWith(expectedError);
});
it('records new operator share', async () => {
const { poolId, operatorShare } = await createPoolAsync();
await testContract
.decreaseStakingPoolOperatorShare(poolId, operatorShare - 1)
.awaitTransactionSuccessAsync({ from: operator });
const pool = await testContract.getStakingPool(poolId).callAsync();
expect(pool.operatorShare).to.bignumber.eq(operatorShare - 1);
});
it('does not modify operator share if equal to current', async () => {
const { poolId, operatorShare } = await createPoolAsync();
await testContract.decreaseStakingPoolOperatorShare(poolId, operatorShare).awaitTransactionSuccessAsync({
from: operator,
});
const pool = await testContract.getStakingPool(poolId).callAsync();
expect(pool.operatorShare).to.bignumber.eq(operatorShare);
});
it('does not modify operator', async () => {
const { poolId, operatorShare } = await createPoolAsync();
await testContract
.decreaseStakingPoolOperatorShare(poolId, operatorShare - 1)
.awaitTransactionSuccessAsync({ from: operator });
const pool = await testContract.getStakingPool(poolId).callAsync();
expect(pool.operator).to.eq(operator);
});
it('emits an `OperatorShareDecreased` event', async () => {
const { poolId, operatorShare } = await createPoolAsync();
const { logs } = await testContract
.decreaseStakingPoolOperatorShare(poolId, operatorShare - 1)
.awaitTransactionSuccessAsync({ from: operator });
verifyEventsFromLogs(
logs,
[
{
poolId,
oldOperatorShare: new BigNumber(operatorShare),
newOperatorShare: new BigNumber(operatorShare - 1),
},
],
TestMixinStakingPoolEvents.OperatorShareDecreased,
);
});
});
describe('joinStakingPoolAsMaker()', () => {
it('records sender as maker for the pool', async () => {
const { poolId } = await createPoolAsync();
await testContract.joinStakingPoolAsMaker(poolId).awaitTransactionSuccessAsync({ from: maker });
const makerPoolId = await testContract.poolIdByMaker(maker).callAsync();
expect(makerPoolId).to.eq(poolId);
});
it('operator can join as maker for the pool', async () => {
const { poolId } = await createPoolAsync();
await testContract.joinStakingPoolAsMaker(poolId).awaitTransactionSuccessAsync({ from: operator });
const makerPoolId = await testContract.poolIdByMaker(operator).callAsync();
expect(makerPoolId).to.eq(poolId);
});
it('can join the same pool as a maker twice', async () => {
const { poolId } = await createPoolAsync();
await testContract.joinStakingPoolAsMaker(poolId).awaitTransactionSuccessAsync({ from: maker });
await testContract.joinStakingPoolAsMaker(poolId).awaitTransactionSuccessAsync({ from: maker });
const makerPoolId = await testContract.poolIdByMaker(maker).callAsync();
expect(makerPoolId).to.eq(poolId);
});
it('can only be a maker in one pool at a time', async () => {
const { poolId: poolId1 } = await createPoolAsync();
const { poolId: poolId2 } = await createPoolAsync();
await testContract.joinStakingPoolAsMaker(poolId1).awaitTransactionSuccessAsync({ from: maker });
let makerPoolId = await testContract.poolIdByMaker(maker).callAsync();
expect(makerPoolId).to.eq(poolId1);
await testContract.joinStakingPoolAsMaker(poolId2).awaitTransactionSuccessAsync({ from: maker });
makerPoolId = await testContract.poolIdByMaker(maker).callAsync();
expect(makerPoolId).to.eq(poolId2);
});
it('emits a `MakerStakingPoolSet` event', async () => {
const { poolId } = await createPoolAsync();
const { logs } = await testContract.joinStakingPoolAsMaker(poolId).awaitTransactionSuccessAsync({
from: maker,
});
verifyEventsFromLogs(
logs,
[
{
makerAddress: maker,
poolId,
},
],
TestMixinStakingPoolEvents.MakerStakingPoolSet,
);
});
});
});
// tslint:disable: max-file-line-count
| {
"pile_set_name": "Github"
} |
(library (name async_rpc) (public_name async.async_rpc)
(c_names rpc_transport_low_latency_stubs)
(preprocess (pps ppx_jane -allow-unannotated-ignores -check-doc-comments))
(libraries async_kernel async_rpc_kernel async_unix core)) | {
"pile_set_name": "Github"
} |
戶
| {
"pile_set_name": "Github"
} |
<SOUI title="DUI-DEMO" width="600" height="400" appwin="0" resize="1" translucent="0">
<root skin="skin.bkframe" cache="1">
<window pos="0,0,-0,-0">
<text pos="|0,|0" offset="-0.5,-0.5">这是一个子窗口</text>
<button pos="|0,[30,@100,@30" offset="-0.5,0" name="btn_open_soui">open soui</button>
</window>
</root>
</SOUI>
| {
"pile_set_name": "Github"
} |
package jsoniter
import (
"fmt"
"strconv"
)
type stringAny struct {
baseAny
val string
}
func (any *stringAny) Get(path ...interface{}) Any {
if len(path) == 0 {
return any
}
return &invalidAny{baseAny{}, fmt.Errorf("GetIndex %v from simple value", path)}
}
func (any *stringAny) Parse() *Iterator {
return nil
}
func (any *stringAny) ValueType() ValueType {
return StringValue
}
func (any *stringAny) MustBeValid() Any {
return any
}
func (any *stringAny) LastError() error {
return nil
}
func (any *stringAny) ToBool() bool {
str := any.ToString()
if str == "0" {
return false
}
for _, c := range str {
switch c {
case ' ', '\n', '\r', '\t':
default:
return true
}
}
return false
}
func (any *stringAny) ToInt() int {
return int(any.ToInt64())
}
func (any *stringAny) ToInt32() int32 {
return int32(any.ToInt64())
}
func (any *stringAny) ToInt64() int64 {
if any.val == "" {
return 0
}
flag := 1
startPos := 0
if any.val[0] == '+' || any.val[0] == '-' {
startPos = 1
}
if any.val[0] == '-' {
flag = -1
}
endPos := startPos
for i := startPos; i < len(any.val); i++ {
if any.val[i] >= '0' && any.val[i] <= '9' {
endPos = i + 1
} else {
break
}
}
parsed, _ := strconv.ParseInt(any.val[startPos:endPos], 10, 64)
return int64(flag) * parsed
}
func (any *stringAny) ToUint() uint {
return uint(any.ToUint64())
}
func (any *stringAny) ToUint32() uint32 {
return uint32(any.ToUint64())
}
func (any *stringAny) ToUint64() uint64 {
if any.val == "" {
return 0
}
startPos := 0
if any.val[0] == '-' {
return 0
}
if any.val[0] == '+' {
startPos = 1
}
endPos := startPos
for i := startPos; i < len(any.val); i++ {
if any.val[i] >= '0' && any.val[i] <= '9' {
endPos = i + 1
} else {
break
}
}
parsed, _ := strconv.ParseUint(any.val[startPos:endPos], 10, 64)
return parsed
}
func (any *stringAny) ToFloat32() float32 {
return float32(any.ToFloat64())
}
func (any *stringAny) ToFloat64() float64 {
if len(any.val) == 0 {
return 0
}
// first char invalid
if any.val[0] != '+' && any.val[0] != '-' && (any.val[0] > '9' || any.val[0] < '0') {
return 0
}
// extract valid num expression from string
// eg 123true => 123, -12.12xxa => -12.12
endPos := 1
for i := 1; i < len(any.val); i++ {
if any.val[i] == '.' || any.val[i] == 'e' || any.val[i] == 'E' || any.val[i] == '+' || any.val[i] == '-' {
endPos = i + 1
continue
}
// end position is the first char which is not digit
if any.val[i] >= '0' && any.val[i] <= '9' {
endPos = i + 1
} else {
endPos = i
break
}
}
parsed, _ := strconv.ParseFloat(any.val[:endPos], 64)
return parsed
}
func (any *stringAny) ToString() string {
return any.val
}
func (any *stringAny) WriteTo(stream *Stream) {
stream.WriteString(any.val)
}
func (any *stringAny) GetInterface() interface{} {
return any.val
}
| {
"pile_set_name": "Github"
} |
package com.trolltech.unittests;
import static org.junit.Assert.assertEquals;
import static org.junit.Assert.assertFalse;
import static org.junit.Assert.assertTrue;
import org.junit.After;
import org.junit.Before;
import org.junit.BeforeClass;
import org.junit.Test;
import com.trolltech.qt.core.QAbstractFileEngine;
import com.trolltech.qt.core.QBuffer;
import com.trolltech.qt.core.QIODevice;
import com.trolltech.qt.core.QIODevice.OpenMode;
import com.trolltech.qt.qtjambi.util.RetroTranslatorHelper;
import com.trolltech.qt.xmlpatterns.QXmlFormatter;
import com.trolltech.qt.xmlpatterns.QXmlItem;
import com.trolltech.qt.xmlpatterns.QXmlName;
import com.trolltech.qt.xmlpatterns.QXmlQuery;
import com.trolltech.qt.xmlpatterns.QXmlResultItems;
import com.trolltech.qt.xmlpatterns.QXmlSerializer;
public class TestQXmlFormatter extends QApplicationTest {
QXmlQuery query;
QXmlSerializer serializer;
QXmlResultItems xmlResultItems;
QXmlFormatter formatter;
String samplePath1 = "doc('classpath:com/trolltech/unittests/xquerySample1.xml')";
String samplePath2 = "doc('classpath:com/trolltech/unittests/xmlSample2.xml')";
//@BeforeClass
//public static void init() {
// QAbstractFileEngine.addSearchPathForResourceEngine(".");
//}
@Before
public void setUp() throws Exception {
query = new QXmlQuery();
xmlResultItems = new QXmlResultItems();
}
@After
public void tearDown() throws Exception {
query = null;
}
@Test
public void testConstruct() {
assertFalse(query == null);
assertFalse(query.isValid());
}
@Test
public void testValid() {
query.setQuery("doc('')");
assertTrue(query.isValid());
}
@Test
public void testEvaluateToString() {
query.setQuery(samplePath2 + "/persons/person/firstname[1]");
String result = query.evaluateTo();
String[] expected = { "<firstname>John</firstname>",
"<firstname>Jane</firstname>", "<firstname>Baby</firstname>" };
String[] results = RetroTranslatorHelper.split(result, "\n");
int i = 0;
for (String str : results) {
assertEquals(expected[i++], str);
}
}
@Test
public void testEvaluateToQXmlSerializer() {
query.setQuery(samplePath1 + "/a/p");
QBuffer buffer = new QBuffer();
assertTrue(buffer.open(QIODevice.OpenModeFlag.ReadWrite));
TestSerializerClass clazz = new TestSerializerClass(query, buffer);
assertTrue(query.isValid());
query.evaluateTo(clazz.outputDevice());
}
@Test
public void testEvaluateToQXmlResultItems() {
query.setQuery(samplePath1 + "/a/p");
assertTrue(query.isValid());
query.evaluateTo(xmlResultItems);
QXmlItem item = xmlResultItems.next();
while(!item.isNull()) {
if (item.isNode()) {
query.setFocus(item);
query.setQuery(samplePath1 + "/a/p/string()");
String s = query.evaluateTo();
// We are seeing EOL characters appended to the results here
if(s.length() > 0 && Character.codePointAt(s, s.length() - 1) == '\n')
s = s.substring(0, s.length() - 1);
assertEquals("Some Text in p", s);
}
item = xmlResultItems.next();
}
}
}
class TestSerializerClass extends QXmlSerializer {
public TestSerializerClass(QXmlQuery query, QIODevice outputDevice) {
super(query, outputDevice);
// TODO Auto-generated constructor stub
}
@Override
public void attribute(QXmlName name, String value) {
System.out.println("TestSerializerClass#attribute(QXmlName,String): " + ((value != null) ? value.toString() : value));
}
@Override
public void atomicValue(Object value) {
System.out.println("TestSerializerClass#atomicValue(Object): " + ((value != null) ? value.toString() : value));
}
@Override
public void startDocument() {
System.out.println("TestSerializerClass#startDocument(): doc start");
}
@Override
public void characters(String str) {
System.out.println("TestSerializerClass#characters(String): " + str);
}
}
| {
"pile_set_name": "Github"
} |
#ifndef CAFFE2_OPERATORS_LOGIT_OP_H_
#define CAFFE2_OPERATORS_LOGIT_OP_H_
#include "caffe2/core/context.h"
#include "caffe2/core/export_caffe2_op_to_c10.h"
#include "caffe2/core/operator.h"
#include "caffe2/operators/elementwise_ops.h"
C10_DECLARE_EXPORT_CAFFE2_OP_TO_C10(Logit)
namespace caffe2 {
template <class Context>
struct LogitFunctor {
explicit LogitFunctor(OperatorBase& op)
: eps_(op.GetSingleArgument<float>("eps", 1e-6f)) {
CAFFE_ENFORCE_GT(eps_, 0.0);
CAFFE_ENFORCE_LT(eps_, 0.5);
}
template <typename T>
bool operator()(const int size, const T* X, T* Y, Context* context) const;
const float eps_;
};
template <typename T, class Context>
class LogitGradientOp final : public Operator<Context> {
public:
USE_OPERATOR_CONTEXT_FUNCTIONS;
template <class... Args>
explicit LogitGradientOp(Args&&... args)
: Operator<Context>(std::forward<Args>(args)...),
eps_(this->template GetSingleArgument<float>("eps", 1e-6f)) {}
~LogitGradientOp() {}
bool RunOnDevice() override;
protected:
float eps_;
};
} // namespace caffe2
#endif // CAFFE2_OPERATORS_LOGIT_OP_H_
| {
"pile_set_name": "Github"
} |
Language="Português"
Region="Portugal"
OK="OK"
Apply="Aplicar"
Cancel="Cancelar"
Close="Fechar"
Save="Guardar"
Discard="Rejeitar"
Disable="Desativar"
Yes="Sim"
No="Não"
Add="Adicionar"
Remove="Remover"
Rename="Renomear"
Interact="Interagir"
Filters="Filtros"
Properties="Propriedades"
MoveUp="Mover para Cima"
MoveDown="Mover para Baixo"
Settings="Definições"
Display="Ecrã"
Name="Nome"
Exit="Sair"
Mixer="Misturador"
Browse="Localizar"
Mono="Mono"
Stereo="Estéreo"
DroppedFrames="Quadros Perdidos %1 (%2%)"
StudioProgramProjector="Projetor de ecrã inteiro (Programa)"
PreviewProjector="Projetor de ecrã inteiro (pré-visualização)"
SceneProjector="Projetor de ecrã inteiro (cena)"
SourceProjector="Projetor de ecrã inteiro (fonte)"
StudioProgramWindow="Projetor em modo de janela (Programa)"
PreviewWindow="Projetor em janela (pré-visualização)"
SceneWindow="Projetor em janela (Cena)"
SourceWindow="Projetor em janela (Fonte)"
MultiviewProjector="Multi-visualização (Ecrã inteiro)"
MultiviewWindowed="Multi-visualização (Modo de Janela)"
Clear="Limpar"
Revert="Reverter"
Show="Mostrar"
Hide="Ocultar"
UnhideAll="Esconder Tudo"
Untitled="Sem título"
New="Novo"
Duplicate="Duplicar"
Enable="Ativar"
DisableOSXVSync="Desabilitar o OSX V-Sync"
ResetOSXVSyncOnExit="Redefinir o OSX V-Sync na saída"
HighResourceUsage="Codificação sobrecarregado! Considere diminuir a configurações de vídeo ou usar uma predefinição mais rápido de codificação."
Transition="Transição"
QuickTransitions="Transições rápidas"
Left="Esquerda"
Right="Direita"
Top="Cima"
Bottom="Baixo"
Reset="Repor"
Hours="Horas"
Minutes="Minutos"
Seconds="Segundos"
Deprecated="Descontinuado"
ReplayBuffer="Reproduzir Buffer"
Import="Importar"
Export="Exportar"
Copy="Copiar"
Paste="Colar"
PasteReference="Colar (Referência)"
PasteDuplicate="Colar (Duplicado)"
RemuxRecordings="Remux de gravações"
Next="Continuar"
Back="Anterior"
Defaults="Predefinições"
HideMixer="Esconder no Mixer"
TransitionOverride="Substituir Transição"
None="Nenhum"
StudioMode.Preview="Pré-visualização"
StudioMode.Program="Programa"
ShowInMultiview="Mostrar no Multiview"
VerticalLayout="Vista Vertical"
Group="Grupo"
DoNotShowAgain="Não mostrar novamente"
AlreadyRunning.Title="O OBS já está em execução"
AlreadyRunning.Text="O OBS já está em execução! Tem de desligar a instância existente do OBS antes de iniciar uma nova. Se o OBS estiver definido para correr na bandeja do sistema, por favor verifique se está aberto lá."
AlreadyRunning.LaunchAnyway="Executar de qualquer modo"
DockCloseWarning.Title="Janela Fechar dockável"
DockCloseWarning.Text="Acabaste de fechar uma janela acoplável. Se você quiser mostrá-la novamente, use o menu Exibir → Docks na barra de menus."
Auth.Authing.Title="Autenticação..."
Auth.Authing.Text="Autenticando com %1, por favor espere..."
Auth.AuthFailure.Title="Falha na autenticação"
Auth.AuthFailure.Text="Falha na autenticação com %1:\n\n%2: %3"
Auth.InvalidScope.Title="Autenticação Necessária"
Auth.InvalidScope.Text="Os requisitos de autenticação para %1 mudaram. Algumas funcionalidades podem não estar disponíveis."
Auth.LoadingChannel.Title="Carregando informação do canal..."
Auth.LoadingChannel.Text="A carregar informação do canal para %1, por favor espere..."
Auth.ChannelFailure.Title="Erro ao carregar canal"
Auth.ChannelFailure.Text="Erro ao carregar informaões do canal do %1\n\n%2: %3"
Auth.Chat="Chat"
Auth.StreamInfo="Informação da Transmissão"
TwitchAuth.Stats="Estatísticas da Twitch"
TwitchAuth.Feed="Alimentação de atividade de Twitch"
Copy.Filters="Copiar filtros"
Paste.Filters="Colar Filtros"
BrowserPanelInit.Title="Inicializando o Browser..."
BrowserPanelInit.Text="Inicializando o navegador, por favor espere..."
BandwidthTest.Region="Região"
BandwidthTest.Region.US="Estados Unidos"
BandwidthTest.Region.EU="Europa"
BandwidthTest.Region.Asia="Ásia"
BandwidthTest.Region.Other="Outro"
Basic.FirstStartup.RunWizard="Gostaria de executar o assistente de configuração automática? Pode também definir as suas configurações na janela principal."
Basic.FirstStartup.RunWizard.NoClicked="Se muder de ideias pode correr o assistente de configuração automática a qualquer momento no menu Ferramentas."
Basic.AutoConfig="Assistente de Configuração Automática"
Basic.AutoConfig.ApplySettings="Aplicar definições"
Basic.AutoConfig.StartPage="Informação de utilização"
Basic.AutoConfig.StartPage.SubTitle="Especifique qual vai ser a utilização do programa"
Basic.AutoConfig.StartPage.PrioritizeStreaming="Otimizar para transmissão, gravação é secundária"
Basic.AutoConfig.StartPage.PrioritizeRecording="Otimizar para gravação, a transmissão é secundária"
Basic.AutoConfig.VideoPage="Definições de video"
Basic.AutoConfig.VideoPage.SubTitle="Especifique as definições de video que pretende"
Basic.AutoConfig.VideoPage.BaseResolution.UseCurrent="Usar atual (%1x%2)"
Basic.AutoConfig.VideoPage.BaseResolution.Display="Monitor %1 (%2x%3)"
Basic.AutoConfig.VideoPage.FPS.UseCurrent="Usar atual (%1)"
Basic.AutoConfig.VideoPage.FPS.PreferHighFPS="60 ou 30, com prioridade a 60"
Basic.AutoConfig.VideoPage.FPS.PreferHighRes="60 ou 30, com prioridade a alta resolução"
Basic.AutoConfig.VideoPage.CanvasExplanation="Nota: A resolução base do canvas não é necessariamente a mesma que resolução da gravação ou stream. A resolução da gravação/stream pode ser reduzida para diminuir o uso de recursos e os requisitos de bitrate."
Basic.AutoConfig.StreamPage="Informação de Transmissão"
Basic.AutoConfig.StreamPage.SubTitle="Por favor introduza a informação necessária"
Basic.AutoConfig.StreamPage.ConnectAccount="Conectar Conta (opcional)"
Basic.AutoConfig.StreamPage.DisconnectAccount="Desconectar Conta"
Basic.AutoConfig.StreamPage.DisconnectAccount.Confirm.Title="Desconectar Conta?"
Basic.AutoConfig.StreamPage.DisconnectAccount.Confirm.Text="Esta alteração será aplicada imediatamente. De certeza que queres desconectar a tua conta?"
Basic.AutoConfig.StreamPage.UseStreamKey="Usar Chave de Stream"
Basic.AutoConfig.StreamPage.Service="Serviço"
Basic.AutoConfig.StreamPage.Service.ShowAll="Mostrar Tudo..."
Basic.AutoConfig.StreamPage.Service.Custom="Personalizado..."
Basic.AutoConfig.StreamPage.Server="Servidor"
Basic.AutoConfig.StreamPage.StreamKey="Chave de Transmissão"
Basic.AutoConfig.StreamPage.StreamKey.LinkToSite="(Link)"
Basic.AutoConfig.StreamPage.PerformBandwidthTest="Estimar bitrate com teste de largura de banda (pode demorar alguns minutos)"
Basic.AutoConfig.StreamPage.PreferHardwareEncoding="Preferir codificação de hardware"
Basic.AutoConfig.StreamPage.PreferHardwareEncoding.ToolTip="A Codificação de Hardware elimina maior parte da utilização do CPU mas pode precisar de uma bitrate maior para obter o mesmo nível de qualidade."
Basic.AutoConfig.StreamPage.StreamWarning.Title="Aviso de Transmissão"
Basic.AutoConfig.StreamPage.StreamWarning.Text="O teste de largura de banda vai transimitir dados de video aleatórios sem audio para o seu canal. É recomendado desligar temporariamente gravações do stream e definir o stream como privado até o teste estar completo. Continuar?"
Basic.AutoConfig.TestPage="Resultados Finais"
Basic.AutoConfig.TestPage.SubTitle.Testing="O programa está agora a executar testes para estimar as definições ideais"
Basic.AutoConfig.TestPage.SubTitle.Complete="Teste completo"
Basic.AutoConfig.TestPage.TestingBandwidth="A executar teste de largura de banda, pode demorar alguns minutos..."
Basic.AutoConfig.TestPage.TestingBandwidth.Connecting="A Conectar a: %1..."
Basic.AutoConfig.TestPage.TestingBandwidth.ConnectFailed="Falha ao conectar a qualquer um servidor, por favor verifique a sua conexão de internet e tente novamente."
Basic.AutoConfig.TestPage.TestingBandwidth.Server="A testar largura de banda para: %1"
Basic.AutoConfig.TestPage.TestingStreamEncoder="A testar codificador de stream, poderá demorar algum tempo..."
Basic.AutoConfig.TestPage.TestingRecordingEncoder="A testar codificador de gravação, poderá demorar algum tempo..."
Basic.AutoConfig.TestPage.TestingRes="A testar resoluções, poderá demorar algum tempo..."
Basic.AutoConfig.TestPage.TestingRes.Fail="Erro ao iniciar o codificador"
Basic.AutoConfig.TestPage.TestingRes.Resolution="A testar %1x%2 %3 FPS..."
Basic.AutoConfig.TestPage.Result.StreamingEncoder="Codificador de stream"
Basic.AutoConfig.TestPage.Result.RecordingEncoder="Codificador de Gravação"
Basic.AutoConfig.TestPage.Result.Header="O programa determinou que estas definições são as mais ideais para si:"
Basic.AutoConfig.TestPage.Result.Footer="Para utilizar estas definições, carregue em Aplicar Definições. Para reconfigurar o assistente e tentar novamente, carregue em Voltar. Para configurar manualmente as definições, carregue em Cancelar e abra as Definições."
Basic.Stats="Estados"
Basic.Stats.CPUUsage="Utilização de CPU"
Basic.Stats.HDDSpaceAvailable="Espaço em disco disponível"
Basic.Stats.MemoryUsage="Utilização de Memória"
Basic.Stats.AverageTimeToRender="Tempo médio para processar uma frame"
Basic.Stats.SkippedFrames="Frames saltadas devido ao lag do codificador"
Basic.Stats.MissedFrames="Frames perdidas devido ao lag de renderização"
Basic.Stats.Output.Stream="Transmissão"
Basic.Stats.Output.Recording="Gravação"
Basic.Stats.Status="Estado"
Basic.Stats.Status.Recording="A Gravar"
Basic.Stats.Status.Live="Ao Vivo"
Basic.Stats.Status.Reconnecting="A Reconectar"
Basic.Stats.Status.Inactive="Inactivo"
Basic.Stats.DroppedFrames="Frames perdidas (Rede)"
Basic.Stats.MegabytesSent="Total saída de dados"
Basic.Stats.Bitrate="Taxa de Bits"
ResetUIWarning.Title="De certeza que queres reiniciar a interface?"
ResetUIWarning.Text="Reiniciar a interface irá esconder docks adicionais. Vais ter de as ativar outra vez a partir no menu ver se quiseres torná-las visíveis.\n\nDe certeza que queres reiniciar a interface?"
Updater.Title="Nova atualização disponível"
Updater.Text="Existe uma nova atualização disponível:"
Updater.UpdateNow="Atualizar Agora"
Updater.RemindMeLater="Lembrar-me mais tarde"
Updater.Skip="Saltar Versão"
Updater.Running.Title="Programa atualmente ativo"
Updater.Running.Text="Existem Outputs ativos atualmente, por favor desligar quaisquer Outputs ativos antes de começar a atualização"
Updater.NoUpdatesAvailable.Title="Nenhuma atualização disponível"
Updater.NoUpdatesAvailable.Text="Não existem atualizações atualmente"
Updater.FailedToLaunch="Falha ao iniciar as atualizações"
Updater.GameCaptureActive.Title="Captura de Jogo ativa"
Updater.GameCaptureActive.Text="Biblioteca da captura do jogo está a ser utilizada de momento. Por favor feche qualquer jogo/programa que esteja a ser capturado (ou dê restart ao Windows) e tente novamente."
QuickTransitions.SwapScenes="Trocar pré-visualização/saída de cenas Depois de uma Transição"
QuickTransitions.SwapScenesTT="Troca as cenas de output e de pré-visualização após a transição (se a cena de output original ainda existir.)\nIsto não desfaz qualquer alteração que possa ter havido com a cena de output original."
QuickTransitions.DuplicateScene="Duplicar cena"
QuickTransitions.DuplicateSceneTT="Ao editar a mesma cena, permite editar a transformação/visibilidade de fontes sem modificar o output.\nPara editar as propriedades de fontes sem modificar o output, ativa o 'Duplicar Fontes'.\nMudar este valor vai reiniciar a cena atual de output (se ainda existir)."
QuickTransitions.EditProperties="Duplicar Fontes"
QuickTransitions.EditPropertiesTT="Quando a editar a mesma cena, permite a edição das propriedades de fontes sem modificar a saida.\nIsto só pode ser usado se 'Duplicar Cena' está ativado.\nAlgumas fontes (como a captura e fontes de media) não suportam isto e não podem ser editados separadamente.\nModificar este valor vai redefinir a atual saída de cena (se ele ainda existir).\n\nAviso: Porque fontes vão ser duplicados, isto pode requisitar um sistema extra ou recursos de vídeo."
QuickTransitions.HotkeyName="Transição rápida: %1"
Basic.AddTransition="Adicionar Transição Configurável"
Basic.RemoveTransition="Remover transição configurável"
Basic.TransitionProperties="Propriedades da transição"
Basic.SceneTransitions="Transições de cena"
Basic.TransitionDuration="Duração"
Basic.TogglePreviewProgramMode="Modo de estúdio"
TransitionNameDlg.Text="Por favor, escreva o nome da transição"
TransitionNameDlg.Title="Nome da transição"
TitleBar.Profile="Perfil"
TitleBar.Scenes="Cenas"
NameExists.Title="O nome já existe"
NameExists.Text="O nome já encontra-se em utilização."
NoNameEntered.Title="Por favor, introduz um nome válido"
NoNameEntered.Text="Não pode utilizar nomes vazios."
ConfirmStart.Title="Começar a transmitir?"
ConfirmStart.Text="Tem a certeza que quer começar a transmissão?"
ConfirmStop.Title="Parar a transmissão?"
ConfirmStop.Text="Tem a certeza que quer parar a transmissão?"
ConfirmBWTest.Title="Iniciar teste de largura de banda?"
ConfirmBWTest.Text="Você tem o OBS configurado no modo de teste de largura de banda. Este modo permite o teste de rede sem que o seu canal entre em funcionamento. Uma vez terminado o teste, você precisará desativá-lo para que os espectadores possam ver sua transmissão.\n\nVocê quer continuar?"
ConfirmExit.Title="Sair do OBS?"
ConfirmExit.Text="O OBS está ligado. Todas as transmissões e gravações serão paradas. Tem a certeza de que pretende sair?"
ConfirmRemove.Title="Comfirmar Remover"
ConfirmRemove.Text="Tem a certeza que quer remover '$1'?"
ConfirmRemove.TextMultiple="Tem a certeza de que pretende remover %1 itens?"
Output.StartStreamFailed="Falha ao iniciar a stream"
Output.StartRecordingFailed="Falha ao iniciar a gravação"
Output.StartReplayFailed="Falha ao iniciar o buffer de repetição"
Output.StartFailedGeneric="Falha ao iniciar o output. Verifica o log para mais detalhes.\n\nNota: Se estás a usar codificadores NVENC ou AMD, certifica-te de que os drivers da placa gráfica estão atualizados."
Output.ConnectFail.Title="Falha ao ligar"
Output.ConnectFail.BadPath="Caminho ou endereço de ligação inválido. Por favor, verifique as suas definições para confirmar que são válidas."
Output.ConnectFail.ConnectFailed="Falhou a ligação ao servidor"
Output.ConnectFail.InvalidStream="Não foi possível acessar o canal especificado ou chave de transmissão, por favor ré-verifique a sua chave de transmissão. Se é correto, pode haver um problema de conexão com o servidor."
Output.ConnectFail.Error="Ocurreu um erro inesperado ao ligar-se ao servidor. Mais informação no ficheiro Log."
Output.ConnectFail.Disconnected="Desligado do servidor."
Output.RecordFail.Title="Não foi possível iniciar a gravação"
Output.RecordFail.Unsupported="O formato de saída ou não é suportado ou não suporta mais do que uma faixa de áudio. Por favor, verifique as suas definições e tente novamente."
Output.RecordNoSpace.Title="Espaço em disco insuficiente"
Output.RecordNoSpace.Msg="Não há espaço em disco suficiente para continuar a gravação."
Output.RecordError.Title="Erro de gravação"
Output.RecordError.Msg="Ocorreu um erro desconhecido durante a gravação."
Output.ReplayBuffer.NoHotkey.Title="Nenhuma atalho adicionado!"
Output.ReplayBuffer.NoHotkey.Msg="Nenhum atalho gravado para o buffer de repetição. Por favor defina o atalho \"Gravar\" para gravar as repetições da gravação."
Output.BadPath.Title="Caminho de Ficheiro de Gravação Inválido"
Output.BadPath.Text="O caminho de ficheiro de gravação definido é inválido. Por favor verifique as definições e confirme que um caminho válido foi introduzido."
LogReturnDialog="Envio de Log Sucedido"
LogReturnDialog.CopyURL="Copiar endereço"
LogReturnDialog.ErrorUploadingLog="Erro no envio de ficheiro Log"
Remux.SourceFile="Gravação do OBS"
Remux.TargetFile="Ficheiro de destino"
Remux.Remux="Remisturar"
Remux.Stop="Parar Remuxing"
Remux.ClearFinished="Limpar Itens Finalizados"
Remux.ClearAll="Limpar Todos os Itens"
Remux.OBSRecording="Gravação do OBS"
Remux.FinishedTitle="Remistura concluída"
Remux.Finished="Gravação remisturada"
Remux.FinishedError="Gravação remisturada, mas o ficheiro pode estar incompleto"
Remux.SelectRecording="Selecione Gravação OBS..."
Remux.SelectTarget="Select target file..."
Remux.FileExistsTitle="O ficheiro de destino existe"
Remux.FileExists="Os seguintes ficheiros de destino já existem. Deseja substituí-los?"
Remux.ExitUnfinishedTitle="Remistura em progresso"
Remux.ExitUnfinished="A remistura não está concluída. Ao parar agora pode tornar o ficheiro de destino inutilizável.\nTem a certeza de que pretende para a remistura?"
Remux.HelpText="Arrasta ficheiros para esta janela para fazer remux, ou selectiona uma célula \"Gravação do OBS\" vazia para procurar por um ficheiro."
UpdateAvailable="Nova atualização disponível"
UpdateAvailable.Text="Versão %1.%2.%3 está agora disponível. <a href='%4'>Clique aqui para descarregar</a>"
Basic.DesktopDevice1="Desktop Audio"
Basic.DesktopDevice2="Desktop Audio 2"
Basic.AuxDevice1="Mic/Aux"
Basic.AuxDevice2="Mic/Aux 2"
Basic.AuxDevice3="Mic/Aux 3"
Basic.AuxDevice4="Mic/Aux 4"
Basic.Scene="Cena"
Basic.DisplayCapture="Captura de Ecrã"
Basic.Main.PreviewConextMenu.Enable="Ativar pré-visualização"
ScaleFiltering="Filtragem de escala"
ScaleFiltering.Point="Ponto"
ScaleFiltering.Bilinear="Bilinear"
ScaleFiltering.Bicubic="Bicubico"
ScaleFiltering.Lanczos="Lanczos"
ScaleFiltering.Area="Área"
Deinterlacing="Desentrelaçamento"
Deinterlacing.Discard="Discartar"
Deinterlacing.Retro="Retro"
Deinterlacing.Blend="Misturar"
Deinterlacing.Blend2x="Misturar 2x"
Deinterlacing.Linear="Linear"
Deinterlacing.Linear2x="Linear 2x"
Deinterlacing.Yadif="Yadif"
Deinterlacing.Yadif2x="Yadif 2x"
Deinterlacing.TopFieldFirst="Campo Superior Primeiro"
Deinterlacing.BottomFieldFirst="Campo Inferior Primeiro"
VolControl.SliderUnmuted="Barra de volume para '%1': %2"
VolControl.SliderMuted="Barra de volume para '%1': %2 (atualmente silenciado)"
VolControl.Mute="Silêncio '%1'"
VolControl.Properties="Propriedades de '%1'"
Basic.Main.AddSceneDlg.Title="Adicionar Cena"
Basic.Main.AddSceneDlg.Text="Por favor introduza o nome da cena"
Basic.Main.DefaultSceneName.Text="Cena %1"
Basic.Main.AddSceneCollection.Title="Adicionar um coleção de cena"
Basic.Main.AddSceneCollection.Text="Por favor, introduza o nome da coleção de cena"
Basic.Main.RenameSceneCollection.Title="Renomear a coleção de cena"
AddProfile.Title="Adicionar perfil"
AddProfile.Text="Por favor, introduza o nome do perfil"
RenameProfile.Title="Renomear perfil"
Basic.Main.MixerRename.Title="Renomear fonte de áudio"
Basic.Main.MixerRename.Text="Introduza o nome da fonte de audio"
Basic.Main.PreviewDisabled="A pré-visualização está desativada atualmente"
Basic.SourceSelect="Criar/Selecionar Fonte"
Basic.SourceSelect.CreateNew="Criar Novo"
Basic.SourceSelect.AddExisting="Adicionar Existente"
Basic.SourceSelect.AddVisible="Tornar a fonte visível"
Basic.PropertiesWindow="Propriedades para '%1'"
Basic.PropertiesWindow.AutoSelectFormat="%1 (seleção automática: %2)"
Basic.PropertiesWindow.SelectColor="Selecione a cor"
Basic.PropertiesWindow.SelectFont="Selecionar tipo de letra"
Basic.PropertiesWindow.ConfirmTitle="Definições alteradas"
Basic.PropertiesWindow.Confirm="Há alterações não guardadas. Pretende mantê-las?"
Basic.PropertiesWindow.NoProperties="Sem propriedades disponíveis"
Basic.PropertiesWindow.AddFiles="Adicionar ficheiros"
Basic.PropertiesWindow.AddDir="Adicionar diretório"
Basic.PropertiesWindow.AddURL="Adicionar caminho ou endereço"
Basic.PropertiesWindow.AddEditableListDir="Adicionar diretório a '%1'"
Basic.PropertiesWindow.AddEditableListFiles="Adicionar ficheiros a '%1'"
Basic.PropertiesWindow.AddEditableListEntry="Adicionar entrada a '%1'"
Basic.PropertiesWindow.EditEditableListEntry="Editar entrada a '%1'"
Basic.PropertiesView.FPS.Simple="Valores de FPS simples"
Basic.PropertiesView.FPS.Rational="Valores de FPS racionais"
Basic.PropertiesView.FPS.ValidFPSRanges="Intervalos de FPS válidos:"
Basic.InteractionWindow="A interagir com '%1'"
Basic.StatusBar.Reconnecting="Desligado. A ligar em %2 segundo(s) (tentativa %1)"
Basic.StatusBar.AttemptingReconnect="A tentar religar... (tentativa %1)"
Basic.StatusBar.ReconnectSuccessful="Religação sucedida"
Basic.StatusBar.Delay="Atraso (%1 segundo(s))"
Basic.StatusBar.DelayStartingIn="Atraso (a iniciar em %1 segundo(s))"
Basic.StatusBar.DelayStoppingIn="Atraso (a parar em %1 segundo(s))"
Basic.StatusBar.DelayStartingStoppingIn="Atraso (a parar em %1 segundo(s), a iniciar em %2 segundo(s))"
Basic.Filters="Filtros"
Basic.Filters.AsyncFilters="Filtros de áudio/vídeo"
Basic.Filters.AudioFilters="Filtros de áudio"
Basic.Filters.EffectFilters="Filtros de efeito"
Basic.Filters.Title="Filtros para '%1'"
Basic.Filters.AddFilter.Title="Nome do filtro"
Basic.Filters.AddFilter.Text="Por favor, especifique o nome do filtro"
Basic.TransformWindow="Transformação de Elemento de Cena"
Basic.TransformWindow.Position="Posição"
Basic.TransformWindow.Rotation="Rotação"
Basic.TransformWindow.Size="Tamanho"
Basic.TransformWindow.Alignment="Alinhamento da Posição"
Basic.TransformWindow.BoundsType="Tipo da Caixa de Rebordo"
Basic.TransformWindow.BoundsAlignment="Alinhamento da Caixa de Rebordo"
Basic.TransformWindow.Bounds="Tamanho da Caixa de Rebordo"
Basic.TransformWindow.Crop="Recortar"
Basic.TransformWindow.Alignment.TopLeft="Superior Esquerdo"
Basic.TransformWindow.Alignment.TopCenter="Superior Central"
Basic.TransformWindow.Alignment.TopRight="Superior Direito"
Basic.TransformWindow.Alignment.CenterLeft="Centro Esquerda"
Basic.TransformWindow.Alignment.Center="Centro"
Basic.TransformWindow.Alignment.CenterRight="Centro Direito"
Basic.TransformWindow.Alignment.BottomLeft="Inferior Esquerdo"
Basic.TransformWindow.Alignment.BottomCenter="Inferior Centro"
Basic.TransformWindow.Alignment.BottomRight="Inferior Direito"
Basic.TransformWindow.BoundsType.None="Sem Bordas"
Basic.TransformWindow.BoundsType.MaxOnly="Apenas Tamanho Máximo"
Basic.TransformWindow.BoundsType.ScaleInner="Escalar até às bordas internas"
Basic.TransformWindow.BoundsType.ScaleOuter="Escalar até às bordas externas"
Basic.TransformWindow.BoundsType.ScaleToWidth="Escalar até à largura das bordas"
Basic.TransformWindow.BoundsType.ScaleToHeight="Escalar até à altura das bordas"
Basic.TransformWindow.BoundsType.Stretch="Esticar até às bordas"
Basic.Main.AddSourceHelp.Title="Não é Possível Adicionar Fonte"
Basic.Main.AddSourceHelp.Text="Precisa de pelo menos uma cena para adicionar uma fonte."
Basic.Main.Scenes="Cenas"
Basic.Main.Sources="Fontes"
Basic.Main.Controls="Controlos"
Basic.Main.Connecting="A ligar..."
Basic.Main.StartRecording="Começar Gravação"
Basic.Main.StartReplayBuffer="Iniciar Replay Buffer"
Basic.Main.StartStreaming="Iniciar transmissão"
Basic.Main.StopRecording="Parar Gravação"
Basic.Main.StoppingRecording="A parar gravação..."
Basic.Main.StopReplayBuffer="Parar Replay Buffer"
Basic.Main.StoppingReplayBuffer="A Parar Replay Buffer..."
Basic.Main.StopStreaming="Parar transmissão"
Basic.Main.StoppingStreaming="A parar transmissão..."
Basic.Main.ForceStopStreaming="Parar transmissão (ignorar atraso)"
Basic.Main.Group="Grupo %1"
Basic.Main.GroupItems="Agrupar Itens Selecionados"
Basic.Main.Ungroup="Desagrupar"
Basic.MainMenu.File="&Ficheiro"
Basic.MainMenu.File.Export="&Exportar"
Basic.MainMenu.File.Import="&Importar"
Basic.MainMenu.File.ShowRecordings="Most&rar gravações"
Basic.MainMenu.File.Remux="Re&misturar gravações"
Basic.MainMenu.File.Settings="Definiçõe&s"
Basic.MainMenu.File.ShowSettingsFolder="Mostrar pasta das definições"
Basic.MainMenu.File.ShowProfileFolder="Mostrar pasta do perfil"
Basic.MainMenu.AlwaysOnTop="Sempre em Cim&a"
Basic.MainMenu.File.Exit="Sair (&X)"
Basic.MainMenu.Edit="&Editar"
Basic.MainMenu.Edit.Undo="Desfazer (&U)"
Basic.MainMenu.Edit.Redo="&Refazer"
Basic.MainMenu.Edit.UndoAction="Desfazer $1 (&U)"
Basic.MainMenu.Edit.RedoAction="&Refazer $1"
Basic.MainMenu.Edit.LockPreview="B&loquear pré-visualização"
Basic.MainMenu.Edit.Scale="Pré-vi&sualizar Escala"
Basic.MainMenu.Edit.Scale.Window="Escalar à Janela"
Basic.MainMenu.Edit.Scale.Canvas="Canvas (%1x%2)"
Basic.MainMenu.Edit.Scale.Output="Saída (%1x%2)"
Basic.MainMenu.Edit.Transform="&Transformar"
Basic.MainMenu.Edit.Transform.EditTransform="&Editar Transformação..."
Basic.MainMenu.Edit.Transform.CopyTransform="Copiar e Transformar"
Basic.MainMenu.Edit.Transform.PasteTransform="Colar e Transformar"
Basic.MainMenu.Edit.Transform.ResetTransform="&Reset Transform"
Basic.MainMenu.Edit.Transform.Rotate90CW="Rodar 90 graus CW"
Basic.MainMenu.Edit.Transform.Rotate90CCW="Rodar 90 graus CCW"
Basic.MainMenu.Edit.Transform.Rotate180="Rodar 180 graus"
Basic.MainMenu.Edit.Transform.FlipHorizontal="Inverter &Horizontalmente"
Basic.MainMenu.Edit.Transform.FlipVertical="Inverter &Verticalmente"
Basic.MainMenu.Edit.Transform.FitToScreen="Escalar ao ecrã (&F)"
Basic.MainMenu.Edit.Transform.StretchToScreen="E&sticar ao ecrã"
Basic.MainMenu.Edit.Transform.CenterToScreen="&Centrar ao ecrã"
Basic.MainMenu.Edit.Order="&Ordem"
Basic.MainMenu.Edit.Order.MoveUp="Mover para Cima (&U)"
Basic.MainMenu.Edit.Order.MoveDown="Mover para Baixo (&D)"
Basic.MainMenu.Edit.Order.MoveToTop="Mover para p &Topo"
Basic.MainMenu.Edit.Order.MoveToBottom="Mover para o Fundo (&B)"
Basic.MainMenu.Edit.AdvAudio="Propriedades &avançadas de áudio"
Basic.MainMenu.View="&Ver"
Basic.MainMenu.View.Toolbars="Barras de ferramen&tas"
Basic.MainMenu.View.Docks="Âncoras"
Basic.MainMenu.View.Docks.ResetUI="Reiniciar Interface"
Basic.MainMenu.View.Docks.LockUI="Bloquear Interface"
Basic.MainMenu.View.Toolbars.Listboxes="&Lista de Caixas"
Basic.MainMenu.View.SceneTransitions="Transições de &cenas"
Basic.MainMenu.View.StatusBar="Barra de e&stado"
Basic.MainMenu.View.Fullscreen.Interface="Interface de ecrã inteiro"
Basic.MainMenu.SceneCollection="Coleção de cena (&S)"
Basic.MainMenu.Profile="&Perfil"
Basic.MainMenu.Profile.Import="Importar perfil"
Basic.MainMenu.Profile.Export="Exportar Perfil"
Basic.MainMenu.SceneCollection.Import="Importar Coleção de Cenas"
Basic.MainMenu.SceneCollection.Export="Exportar Coleção de Cenas"
Basic.MainMenu.Profile.Exists="O perfil já existe"
Basic.MainMenu.SceneCollection.Exists="A coleção de cenas já existe"
Basic.MainMenu.Tools="Ferramen&tas"
Basic.MainMenu.Help="Ajuda (&H)"
Basic.MainMenu.Help.HelpPortal="&Portal de Ajuda"
Basic.MainMenu.Help.Website="Visitar &website"
Basic.MainMenu.Help.Discord="Juntar-se ao Server de &Discord"
Basic.MainMenu.Help.Logs="Ficeiros de &Log"
Basic.MainMenu.Help.Logs.ShowLogs="Mo&strar ficheiros de registo"
Basic.MainMenu.Help.Logs.UploadCurrentLog="Enviar Ficheiro &Currente de Log"
Basic.MainMenu.Help.Logs.UploadLastLog="Enviar Ultímo Ficheiro de &Log"
Basic.MainMenu.Help.Logs.ViewCurrentLog="&Ver registo atual"
Basic.MainMenu.Help.CheckForUpdates="Procurar atualizações"
Basic.MainMenu.Help.CrashLogs="&Relatórios de Erro"
Basic.MainMenu.Help.CrashLogs.ShowLogs="Mo&strar Relatórios de Erro"
Basic.MainMenu.Help.CrashLogs.UploadLastLog="Submeter Ú<imo Relatório de Erro"
Basic.MainMenu.Help.About="&Acerca"
Basic.Settings.ProgramRestart="O programa necessita de ser reinicializado para estas alterações terem efeito."
Basic.Settings.ConfirmTitle="Confirmar Alterações"
Basic.Settings.Confirm="Voçê tem alterações não salvadas. Deseja salvar as alterações?"
Basic.Settings.General="Geral"
Basic.Settings.General.Theme="Tema"
Basic.Settings.General.Language="Idioma"
Basic.Settings.General.EnableAutoUpdates="Verificar atualizações no arranque"
Basic.Settings.General.OpenStatsOnStartup="Abrir diálogo de estatísticas no arranque"
Basic.Settings.General.WarnBeforeStartingStream="Mostrar caixa de diálogo de confirmação ao iniciar transmissões"
Basic.Settings.General.WarnBeforeStoppingStream="Mostrar caixa de diálogo de confirmação ao parar transmissões"
Basic.Settings.General.Projectors="Projetores"
Basic.Settings.General.HideProjectorCursor="Esconder o cursor em projetores"
Basic.Settings.General.ProjectorAlwaysOnTop="Pôr os projetores sempre por cima"
Basic.Settings.General.Snapping="Alinhamentos com encaixe na Cena"
Basic.Settings.General.ScreenSnapping="Alinhar Fontes ao canto do ecrã"
Basic.Settings.General.CenterSnapping="Alinhar Fontes ao centro horizontal e vertical"
Basic.Settings.General.SourceSnapping="Alinhar Fontes a outras fontes"
Basic.Settings.General.SnapDistance="Sensibilidade do Snap"
Basic.Settings.General.RecordWhenStreaming="Gravar automaticamente quando estiver a transmitir"
Basic.Settings.General.KeepRecordingWhenStreamStops="Continuar a gravar quando a transmissão parar"
Basic.Settings.General.ReplayBufferWhileStreaming="Começar automaticamente o replay buffer quando transmitir"
Basic.Settings.General.KeepReplayBufferStreamStops="Manter o replay buffer ativo quando a transmissão parar"
Basic.Settings.General.SysTray="Bandeja do Sistema"
Basic.Settings.General.SysTrayWhenStarted="Minimizar para a área de notificações quando iniciado"
Basic.Settings.General.SystemTrayHideMinimize="Minimizar sempre para a área de notoficações em vez da barra de tarefas"
Basic.Settings.General.SaveProjectors="Guardar projectores ao sair"
Basic.Settings.General.Preview="Pré-visualização"
Basic.Settings.General.OverflowHidden="Esconder excesso"
Basic.Settings.General.OverflowAlwaysVisible="Tornar excesso visível"
Basic.Settings.General.OverflowSelectionHidden="Mostrar excesso mesmo quando a fonte está invisível"
Basic.Settings.General.SwitchOnDoubleClick="Transição para cena ao fazer duplo clique"
Basic.Settings.General.StudioPortraitLayout="Habilitar layout horizontal/vertical"
Basic.Settings.General.TogglePreviewProgramLabels="Mostrar etiquetas de pré-visualização/programas"
Basic.Settings.General.Multiview="Multiview"
Basic.Settings.General.Multiview.MouseSwitch="Clique para alternar entre cenas"
Basic.Settings.General.Multiview.DrawSourceNames="Mostrar nome das cenas"
Basic.Settings.General.Multiview.DrawSafeAreas="Desenhar áreas seguras (EBU R 95)"
Basic.Settings.General.MultiviewLayout="Layout do Multiview"
Basic.Settings.General.MultiviewLayout.Horizontal.Top="Horizontal, Topo (8 Cenas)"
Basic.Settings.General.MultiviewLayout.Horizontal.Bottom="Horizontal, Fundo (8 Cenas)"
Basic.Settings.General.MultiviewLayout.Vertical.Left="Vertical, Esquerda (8 Cenas)"
Basic.Settings.General.MultiviewLayout.Vertical.Right="Vertical, Direita (8 Cenas)"
Basic.Settings.General.MultiviewLayout.Horizontal.Extended.Top="Horizontal, Topo (24 Cenas)"
Basic.Settings.Stream="Transmissão"
Basic.Settings.Stream.StreamType="Tipo de transmissão"
Basic.Settings.Stream.Custom.UseAuthentication="Usar autenticação"
Basic.Settings.Stream.Custom.Username="Nome de usuário"
Basic.Settings.Stream.Custom.Password="Senha"
Basic.Settings.Stream.BandwidthTestMode="Habilitar Modo de Teste de Largura de Banda"
Basic.Settings.Output="Saída"
Basic.Settings.Output.Format="Formato de gravação"
Basic.Settings.Output.Encoder="Codificador"
Basic.Settings.Output.SelectDirectory="Selecione o diretório de gravação"
Basic.Settings.Output.SelectFile="Selecione ficheiro de gravação"
Basic.Settings.Output.EnforceBitrate="Forçar limites de taxa de bits de serviço de transmissão"
Basic.Settings.Output.Mode="Modo de saída"
Basic.Settings.Output.Mode.Simple="Simples"
Basic.Settings.Output.Mode.Adv="Avançado"
Basic.Settings.Output.Mode.FFmpeg="Saída FFmpeg"
Basic.Settings.Output.UseReplayBuffer="Ativar Replay Buffer"
Basic.Settings.Output.ReplayBuffer.SecondsMax="Tempo Máximo de Replay (Segundos)"
Basic.Settings.Output.ReplayBuffer.MegabytesMax="Memória Máxima (Megabytes)"
Basic.Settings.Output.ReplayBuffer.Estimate="Utilização estimada de memória: %1 MB"
Basic.Settings.Output.ReplayBuffer.EstimateUnknown="Não é possível estimar a utilização de memória. Defina o limite máximo de memória."
Basic.Settings.Output.ReplayBuffer.HotkeyMessage="(Nota: Certifica-te de definires uma tecla de atalho para o replay buffer na secção de teclas de atalho)"
Basic.Settings.Output.ReplayBuffer.Prefix="Buffer de repetição de nome prefixo"
Basic.Settings.Output.ReplayBuffer.Suffix="Sufixo"
Basic.Settings.Output.Simple.SavePath="Caminho da gravação"
Basic.Settings.Output.Simple.RecordingQuality="Qualidade da gravação"
Basic.Settings.Output.Simple.RecordingQuality.Stream="A mesma da transmissão"
Basic.Settings.Output.Simple.RecordingQuality.Small="Alta qualidade, Tamanho médio"
Basic.Settings.Output.Simple.RecordingQuality.HQ="Qualidade indistinguível, Tamanho de Arquivo Grande"
Basic.Settings.Output.Simple.RecordingQuality.Lossless="Sem perda de qualidade, Tamanho de Arquivo Enorme"
Basic.Settings.Output.Simple.Warn.VideoBitrate="Aviso: O bitrate do vídeo de transmissão será definido para %1, que é o limite superior para o dispositivo atual de transmissão. Se tens a certeza de que queres ir acima de %1, ativa opções de codificação avançadas e desmarca a opçáo \"Impor limites de bitrate do serviço de transmissao\"."
Basic.Settings.Output.Simple.Warn.AudioBitrate="Aviso: O bitrate do áudio de transmissão será definido para %1, que é o limite superior para o dispositivo atual de transmissão. Se tens a certeza de que queres ir acima de %1, ativa opções de codificação avançadas e desmarca a opçáo \"Impor limites de bitrate do serviço de transmissao\"."
Basic.Settings.Output.Simple.Warn.Encoder="Aviso: Gravar com um codificador de software com uma qualidade diferente da transmissão vai exigir mais da CPU se transmitires e gravares ao mesmo tempo."
Basic.Settings.Output.Simple.Warn.Lossless="Aviso: Qualidade sem perdas cria ficheiros com tamanhos tremendos! A qualidade sem perdas pode usar até 7 gigabytes de espaço no disco por minuto a altas resoluções e framerates. Não é recomendado usar qualidade sem perdas para gravações longas a não ser que tenhas muito espaço disponível no disco."
Basic.Settings.Output.Simple.Warn.Lossless.Msg="Tem a certeza de que pretende utilizar a qualidade sem perdas?"
Basic.Settings.Output.Simple.Warn.Lossless.Title="Aviso de qualidade sem perda!"
Basic.Settings.Output.Simple.Encoder.Software="Software (x264)"
Basic.Settings.Output.Simple.Encoder.Hardware.QSV="Hardware (QSV)"
Basic.Settings.Output.Simple.Encoder.Hardware.AMD="Hardware (AMD)"
Basic.Settings.Output.Simple.Encoder.Hardware.NVENC="Hardware (NVENC)"
Basic.Settings.Output.Simple.Encoder.SoftwareLowCPU="Software (x264 baixa utilização da CPU pré-ajustada, aumenta o tamanho do arquivo)"
Basic.Settings.Output.VideoBitrate="Bitrate de Vídeo"
Basic.Settings.Output.AudioBitrate="Bitrate de Áudio"
Basic.Settings.Output.Reconnect="Religar Automaticamente"
Basic.Settings.Output.RetryDelay="Atraso de Tentatica de Religação (segundos)"
Basic.Settings.Output.MaxRetries="Número Máximo de Tentativas de Religação"
Basic.Settings.Output.Advanced="Ativar definições avançadas de codificação"
Basic.Settings.Output.EncoderPreset="Predefinição do codificador"
Basic.Settings.Output.CustomEncoderSettings="Definições de codificação personalizadas"
Basic.Settings.Output.CustomMuxerSettings="Configurações personalizadas do Muxer"
Basic.Settings.Output.NoSpaceFileName="Gerar o Nome do Arquivo sem espaço"
Basic.Settings.Output.Adv.Rescale="Redimensionar saída"
Basic.Settings.Output.Adv.AudioTrack="Faixa de áudio"
Basic.Settings.Output.Adv.Streaming="Transmissão"
Basic.Settings.Output.Adv.ApplyServiceSettings="Impor definições de codificação no serviço de transmissão"
Basic.Settings.Output.Adv.Audio.Track1="Faixa 1"
Basic.Settings.Output.Adv.Audio.Track2="Faixa 2"
Basic.Settings.Output.Adv.Audio.Track3="Faixa 3"
Basic.Settings.Output.Adv.Audio.Track4="Faixa 4"
Basic.Settings.Output.Adv.Audio.Track5="Faixa 5"
Basic.Settings.Output.Adv.Audio.Track6="Faixa 6"
Basic.Settings.Output.Adv.Recording="Gravação"
Basic.Settings.Output.Adv.Recording.Type="Tipo"
Basic.Settings.Output.Adv.Recording.Type.Standard="Padrão"
Basic.Settings.Output.Adv.Recording.Type.FFmpegOutput="Saída personalizada (FFmpeg)"
Basic.Settings.Output.Adv.Recording.UseStreamEncoder="(Utilizar o codificador da transmissão)"
Basic.Settings.Output.Adv.Recording.Filename="Formatação do nome do arquivo"
Basic.Settings.Output.Adv.Recording.OverwriteIfExists="Substituir, se o arquivo existe"
Basic.Settings.Output.Adv.FFmpeg.Type="Tipo de saída FFmpeg"
Basic.Settings.Output.Adv.FFmpeg.Type.URL="Exportar para endereço"
Basic.Settings.Output.Adv.FFmpeg.Type.RecordToFile="Exportar para ficheiro"
Basic.Settings.Output.Adv.FFmpeg.SaveFilter.Common="Formatos de gravação comuns"
Basic.Settings.Output.Adv.FFmpeg.SaveFilter.All="Todos os ficheiros"
Basic.Settings.Output.Adv.FFmpeg.SavePathURL="Caminho ou endereço do ficheiro"
Basic.Settings.Output.Adv.FFmpeg.Format="Formato do recipiente"
Basic.Settings.Output.Adv.FFmpeg.FormatAudio="Áudio"
Basic.Settings.Output.Adv.FFmpeg.FormatVideo="Vídeo"
Basic.Settings.Output.Adv.FFmpeg.FormatDefault="Formato predefinido"
Basic.Settings.Output.Adv.FFmpeg.FormatDesc="Descrição do formato do recipiente"
Basic.Settings.Output.Adv.FFmpeg.FormatDescDef="Codificador de áudio/vídeo adivinhado a partir do caminho ou endereço do ficheiro"
Basic.Settings.Output.Adv.FFmpeg.AVEncoderDefault="Codificador predefinido"
Basic.Settings.Output.Adv.FFmpeg.AVEncoderDisable="Desativar codificador"
Basic.Settings.Output.Adv.FFmpeg.VEncoder="Codificador de vídeo"
Basic.Settings.Output.Adv.FFmpeg.VEncoderSettings="Definições do codificador de vídeo (se houver)"
Basic.Settings.Output.Adv.FFmpeg.AEncoder="Codificador de áudio"
Basic.Settings.Output.Adv.FFmpeg.AEncoderSettings="Definições do codificador de áudio (se houver)"
Basic.Settings.Output.Adv.FFmpeg.MuxerSettings="Configurações Muxer (se houver)"
Basic.Settings.Output.Adv.FFmpeg.GOPSize="Intervalo de Keyframes (frames)"
Basic.Settings.Output.Adv.FFmpeg.IgnoreCodecCompat="Mostrar todos os codecs (mesmo que potencialmente incompatíveis)"
FilenameFormatting.completer="%CCYY-%MM-%DD %hh-%mm-%ss\n%YY-%MM-%DD %hh-%mm-%ss\n%Y-%m-%d %H-%M-%S\n%y-%m-%d %H-%M-%S\n%a %Y-%m-%d %H-%M-%S\n%A %Y-%m-%d %H-%M-%S\n%Y-%b-%d %H-%M-%S\n%Y-%B-%d %H-%M-%S\n%Y-%m-%d %I-%M-%S-%p\n%Y-%m-%d %H-%M-%S-%z\n%Y-%m-%d %H-%M-%S-%Z"
FilenameFormatting.TT="%CCYY Ano, quatro dígitos\n%YY Ano, últimos dois dígitos (00-99)\n%MM Mês em número decimal (01-12)\n%DD Dia do mês, com zero em prefixo (01-31)\n%hh Hora em formato 24h (00-23)\n%mm Minuto (00-59)\n%ss Segundo (00-61)\n%% Um sinal % \n%a Dia da semana abreviado\n%A Dia da semana completo\n%b Mês abreviado\n%B Mês completo\n%d Dia do mês, com zero em prefixo (01-31)\n%H Hora em formato 24h (00-23)\n%I Hora em formato 12h (01-12)\n%m Mês em número decimal (01-12)\n%M Minuto (00-59)\n%p Designação AM ou PM\n%S Segundo (00-61)\n%y Ano, últimos dois dígitos (00-99)\n%Y Ano\n%z ISO 8601 offset de UTC ou de fuso horário completo ou abreviado\n name or abbreviation\n%Z Fuso horário completo ou abreviado\n"
Basic.Settings.Video="Vídeo"
Basic.Settings.Video.Adapter="Adaptador de Vídeo"
Basic.Settings.Video.BaseResolution="Resolução de base (tela)"
Basic.Settings.Video.ScaledResolution="Resolução de saída (escalado)"
Basic.Settings.Video.DownscaleFilter="Filtro de Escalamento"
Basic.Settings.Video.DisableAeroWindows="Desactivar Aero (apenas no Windows)"
Basic.Settings.Video.FPS="FPS"
Basic.Settings.Video.FPSCommon="Valor de FPS Comum"
Basic.Settings.Video.FPSInteger="Valor de FPS Íntegro"
Basic.Settings.Video.FPSFraction="Valor de FPS Fracional"
Basic.Settings.Video.Numerator="Numerador"
Basic.Settings.Video.Denominator="Demoninador"
Basic.Settings.Video.Renderer="Renderizador"
Basic.Settings.Video.InvalidResolution="Resolução Inválida, Tem de ser [largura]x[altura] (ex. 1920x1080)"
Basic.Settings.Video.CurrentlyActive="A Saída de Vídeo encontra-se activa. Por favor desligue a saída de vídeo para mudar as definições de vídeo."
Basic.Settings.Video.DisableAero="Desativar Aero"
Basic.Settings.Video.DownscaleFilter.Bilinear="Bilinear (mais rápido, mas desfocada se escalar)"
Basic.Settings.Video.DownscaleFilter.Bicubic="Bicúbico (escalamento nítido, 16 amostras)"
Basic.Settings.Video.DownscaleFilter.Lanczos="Lanczos (escalamento nítido, 32 amostras)"
Basic.Settings.Audio="Áudio"
Basic.Settings.Audio.SampleRate="Frequência de Samplagem"
Basic.Settings.Audio.Channels="Canias"
Basic.Settings.Audio.MeterDecayRate.Fast="Rápido"
Basic.Settings.Audio.MeterDecayRate.Medium="Médio (Tipo I PPM)"
Basic.Settings.Audio.MeterDecayRate.Slow="Lento (Tipo II PPM)"
Basic.Settings.Audio.PeakMeterType="Tipo de Medidor de Pico"
Basic.Settings.Audio.PeakMeterType.SamplePeak="Pico Pré-definido"
Basic.Settings.Audio.PeakMeterType.TruePeak="Pico Verdadeiro (Maior Uso da CPU)"
Basic.Settings.Audio.MultiChannelWarning.Enabled="AVISO: O som surround está ativo."
Basic.Settings.Audio.MultichannelWarning="Se transmitir, verifique se o seu serviço de transmissão suporta tanto ingestão de áudio surround como playback de áudio surround. Twitch, Facebook 360 Live, Mixer RTMP, Smashcast são exemplos onde o áudio surround é totalmente suportado. Embora o Facebook Live e o YouTube Live aceitem os dois ingestão de áudio surround, o Facebook Live transforma-o em stereo, e o YouTube Live só toca dois canais.\n\nOs filtros de áudio do OBS são compatíveis com áudio surround, embora não esteja garantido o suporte para plugins VST."
Basic.Settings.Audio.MultichannelWarning.Title="Ativar audio surround?"
Basic.Settings.Audio.MultichannelWarning.Confirm="Tem a certeza que quer ativar audio surround?"
Basic.Settings.Audio.EnablePushToMute="Ativar o push-to-mute"
Basic.Settings.Audio.PushToMuteDelay="Atrado do push-to-mute"
Basic.Settings.Audio.EnablePushToTalk="Ativar o push-to-talk"
Basic.Settings.Audio.PushToTalkDelay="Atraso do push-to-talk"
Basic.Settings.Audio.UnknownAudioDevice="[Dispositivo não conectado ou não disponível]"
Basic.Settings.Audio.Disabled="Desativado"
Basic.Settings.Advanced="Avançado"
Basic.Settings.Advanced.General.ProcessPriority="Prioridade do precesso"
Basic.Settings.Advanced.General.ProcessPriority.High="Alta"
Basic.Settings.Advanced.General.ProcessPriority.AboveNormal="Acima do normal"
Basic.Settings.Advanced.General.ProcessPriority.Normal="Normal"
Basic.Settings.Advanced.General.ProcessPriority.BelowNormal="Abaixo do normal"
Basic.Settings.Advanced.General.ProcessPriority.Idle="Inativo"
Basic.Settings.Advanced.FormatWarning="Aviso: Formatos de cor diferentes de NV12 destinam-se principalmente a gravação e não são recomendados durante a transmissão. A transmissão pode incorrer numa maior utilização do processador devido à conversão do formato de cor."
Basic.Settings.Advanced.Audio.BufferingTime="Tempo de carregamento do áudio"
Basic.Settings.Advanced.Video.ColorFormat="Formato de cor"
Basic.Settings.Advanced.Video.ColorRange.Partial="Parcial"
Basic.Settings.Advanced.Video.ColorRange.Full="Total"
Basic.Settings.Advanced.Audio.MonitoringDevice.Default="Predefinição"
Basic.Settings.Advanced.Audio.DisableAudioDucking="Desativar o ducking de audio do Windows"
Basic.Settings.Advanced.StreamDelay="Atraso na trasmissão"
Basic.Settings.Advanced.StreamDelay.Duration="Duração (segundos)"
Basic.Settings.Advanced.StreamDelay.Preserve="Preservar o ponto de corte (aumentar atraso) quando reconectar"
Basic.Settings.Advanced.StreamDelay.MemoryUsage="Utilização estimada de memória: %1 MB"
Basic.Settings.Advanced.Network="Rede"
Basic.Settings.Advanced.Network.BindToIP="Ligar pelo IP"
Basic.Settings.Advanced.Network.EnableNewSocketLoop="Ativar nova codificação de net"
Basic.Settings.Advanced.Network.EnableLowLatencyMode="Modo de baixa latência"
Basic.Settings.Advanced.Hotkeys.DisableHotkeysInFocus="Desativar teclas de atalho quando a janela principal está em foco"
Basic.Settings.Advanced.AutoRemux="Fazer automaticamente remux para mp4"
Basic.Settings.Advanced.AutoRemux.MP4="(gravar como mkv)"
Basic.AdvAudio="Propriedades avançadas de áudio"
Basic.AdvAudio.Name="Nome"
Basic.AdvAudio.Mono="Diminuir para mono"
Basic.AdvAudio.Balance="Equilíbrio"
Basic.AdvAudio.SyncOffset="Atraso de sincronização (ms)"
Basic.AdvAudio.Monitoring="Monitorização de Áudio"
Basic.AdvAudio.Monitoring.None="Monitor Desligado"
Basic.AdvAudio.Monitoring.MonitorOnly="Único Monitor (saída muda)"
Basic.AdvAudio.Monitoring.Both="Monitor e Saída"
Basic.AdvAudio.AudioTracks="Faixas"
Basic.Settings.Hotkeys="Teclas de atalho"
Basic.Settings.Hotkeys.Pair="Combinações de teclas partilhadas com '%1' atuam como alavancas"
Basic.Settings.Hotkeys.Filter="Filtro"
Basic.Hotkeys.SelectScene="Mudar para cena"
Basic.SystemTray.Show="Mostrar"
Basic.SystemTray.Hide="Ocultar"
Basic.SystemTray.Message.Reconnecting="Desligado. A religar..."
Hotkeys.Insert="Insert"
Hotkeys.Delete="Delete"
Hotkeys.Home="Home"
Hotkeys.End="End"
Hotkeys.PageUp="Page Up"
Hotkeys.PageDown="Page Down"
Hotkeys.NumLock="Num Lock"
Hotkeys.ScrollLock="Scroll Lock"
Hotkeys.CapsLock="Caps Lock"
Hotkeys.Backspace="Backspace"
Hotkeys.Tab="Tab"
Hotkeys.Print="Print"
Hotkeys.Pause="Pause"
Hotkeys.Left="Esquerda"
Hotkeys.Right="Direita"
Hotkeys.Up="Cima"
Hotkeys.Down="Baixo"
Hotkeys.Windows="Windows"
Hotkeys.Super="Super"
Hotkeys.Menu="Menu"
Hotkeys.Space="Barra de espaços"
Hotkeys.NumpadNum="Numpad %1"
Hotkeys.NumpadMultiply="Multiplicar do Numpad"
Hotkeys.NumpadDivide="Dividir do Numpad"
Hotkeys.NumpadAdd="Adicionar do Numpad"
Hotkeys.NumpadSubtract="Subtrair do Numpad"
Hotkeys.NumpadDecimal="Decimal do Numpad"
Hotkeys.AppleKeypadNum="%1 (Keypad)"
Hotkeys.AppleKeypadMultiply="* (Keypad)"
Hotkeys.AppleKeypadDivide="/ (Keypad)"
Hotkeys.AppleKeypadAdd="+ (Keypad)"
Hotkeys.AppleKeypadSubtract="+ (Keypad)"
Hotkeys.AppleKeypadDecimal=". (Keypad)"
Hotkeys.AppleKeypadEqual="= (Keypad)"
Hotkeys.MouseButton="Rato %1"
Mute="Silenciar"
Unmute="Tirar de silencioso"
Push-to-mute="Push-to-mute"
Push-to-talk="Push-to-talk"
SceneItemShow="Mostrar '%1'"
SceneItemHide="Ocultar '%1'"
OutputWarnings.NoTracksSelected="Tem de selecionar pelo menos uma faixa"
OutputWarnings.MultiTrackRecording="Aviso: Alguns formatos (como FLV) não suportam várias faixas por gravação"
OutputWarnings.MP4Recording="Aviso: Gravações salvas em MP4/MOV serão irrecuperáveis se o arquivo não puder ser finalizado (por exemplo, como resultado de BSODs, perdas de energia, etc.). Se você quiser gravar várias pistas de áudio, considere usar MKV e remuxar a gravação para MP4/MOV depois de terminada (Arquivo → Remux Recordings)"
FinalScene.Title="Apagar Cena"
FinalScene.Text="É preciso que exista pelo menos uma cena."
NoSources.Title="Sem Fontes"
NoSources.Text="Parece que não adicionaste nenhuma fonte de vídeo ainda, por isso só vai ser produzido um ecrã em branco. De certeza que queres fazer isto?"
NoSources.Text.AddSource="Podes adicionar fontes ao clicar no ícone + dentro da caixa Fontes na janela principal em qualquer altura."
ChangeBG="Definir Cor"
CustomColor="Cor Personalizada"
BrowserSource.EnableHardwareAcceleration="Ativar Aceleração de Hardware para Fontes de Navegador"
About="Acerca"
About.Info="O OBS Studio é um software livre e open source para gravação e streaming de video."
About.Donate="Faça uma Contribuição"
About.GetInvolved="Envolve-te"
About.Authors="Autores"
About.License="Licença"
About.Contribute="Apoiar o Projeto OBS"
ResizeOutputSizeOfSource="Redimensionar output (tamanho da fonte)"
ResizeOutputSizeOfSource.Text="As resoluções base e de output serão redimensionadas para o tamanho da fonte atual."
ResizeOutputSizeOfSource.Continue="Deseja continuar?"
| {
"pile_set_name": "Github"
} |
// Modified by Princeton University on June 9th, 2015
/*
* ========== Copyright Header Begin ==========================================
*
* OpenSPARC T1 Processor File: tso_dma5_int.s
* Copyright (c) 2006 Sun Microsystems, Inc. All Rights Reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES.
*
* The above named program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public
* License version 2 as published by the Free Software Foundation.
*
* The above named 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 work; if not, write to the Free Software
* Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA.
*
* ========== Copyright Header End ============================================
*/
/***************************************************************************
***
*** Test Description : trying DMA with interrupts
***
**********************************************************************/
#define JBI_CONFIG
#define ASI_SWVR_INTR_RECEIVE 0x72
#define ASI_SWVR_UDB_INTR_W 0x73
#define ASI_SWVR_UDB_INTR_R 0x74
#define tmp0 %l0
#define tmp1 %l1
#define tmp2 %l2
#define tmp3 %l3
#define flagr %l5
#define addr0 %o0
#define H_T0_Trap_Instruction_0
#define My_T0_Trap_Instruction_0 \
ta 0x90; \
done;
#define H_HT0_HTrap_Instruction_0 intr0x190_custom_trap
#define H_HT0_Interrupt_0x60 intr0x60_custom_trap
#include "boot.s"
.text
.global main
main:
th_fork(th_main, tmp0)
th_main_0:
clr flagr
setx user_data_start, tmp0, addr0
set 0x55, tmp3
loop00:
sub flagr, 2, tmp0
brnz tmp0, loop00
nop
ba normal_end
th_main_1:
clr flagr
setx user_data_start, tmp0, addr0
add addr0, 0x40, addr0
set 0x455, tmp3
ta 0x30
loop10:
sub flagr, 2, tmp0
brnz tmp0, loop10
nop
ba normal_end
normal_end:
ta T_GOOD_TRAP
bad_end:
ta T_BAD_TRAP
user_text_end:
/***********************************************************************
Test case data start
***********************************************************************/
.data
user_data_start:
.skip 1000
user_data_end:
SECTION .MY_HYP_SEC TEXT_VA = 0x1100150000, DATA_VA = 0x1100160000
attr_text {
Name=.MY_HYP_SEC,
hypervisor
}
.global intr0x60_custom_trap
intr0x60_custom_trap:
ldxa [addr0]ASI_AS_IF_USER_PRIMARY, tmp0
sub tmp0, tmp3, tmp0
brnz tmp0, h_bad_end
nop
stxa %g0, [addr0]ASI_AS_IF_USER_PRIMARY
! Check the correct bit is set in the ASI interrupt registers.
ldxa [%g0] ASI_SWVR_INTR_RECEIVE, tmp0
set 0x10, tmp1
cmp tmp0, tmp1
bne h_bad_end
nop
! Check the correct vector is logged in the ASI interrupt registers.
ldxa [%g0] ASI_SWVR_UDB_INTR_R, tmp0
set 0x4, tmp1
cmp tmp0, tmp1
bne h_bad_end
nop
! Read data J_INT_ADATA0
setx 0x0000009f00000600, tmp0, tmp1
ldx [tmp1], tmp2
! Read data J_INT_ADATA1
setx 0x0000009f00000700, tmp0, tmp1
ldx [tmp1], tmp2
! Clear interrupt busy bit.
setx 0x0000009f00000b00, tmp0, tmp1
ldx [tmp1], tmp2
stx %g0, [tmp1]
inc flagr
retry;
!---------------------------------------------------------------------------
.global intr0x190_custom_trap
intr0x190_custom_trap:
! Initialize jbi interrupt vector.
setx 0x0000009800000a00, tmp0, tmp1
set 0x4, tmp2
stx tmp2, [tmp1]
/***********************************************************************
IOSYNC cycles to start sjm
***********************************************************************/
setx 0xdeadbeefdeadbeef, tmp0, tmp1
setx 0xcf00beef00, tmp0, tmp2
stx tmp1, [tmp2]
setx 0xef00beef00, tmp0, tmp2
stx tmp1, [tmp2]
done;
h_bad_end:
ta T_BAD_TRAP
attr_data {
Name=.MY_HYP_SEC,
hypervisor
}
.global my_hyp_data
.align 0x40
my_hyp_data:
.skip 0x200
.end
| {
"pile_set_name": "Github"
} |
/* Generated by RuntimeBrowser
Image: /System/Library/PrivateFrameworks/PassKitCore.framework/PassKitCore
*/
@interface PKPaymentAuthorizationPrepareTransactionDetailsStateParam : PKPaymentAuthorizationStateParam {
NSString * _currencyCode;
PKPaymentMerchantSession * _merchantSession;
NSString * _secureElementIdentifier;
NSDecimalNumber * _transactionAmount;
}
@property (nonatomic, copy) NSString *currencyCode;
@property (nonatomic, retain) PKPaymentMerchantSession *merchantSession;
@property (nonatomic, copy) NSString *secureElementIdentifier;
@property (nonatomic, copy) NSDecimalNumber *transactionAmount;
+ (id)paramWithMerchantSession:(id)arg1 secureElementIdentifier:(id)arg2 transactionAmount:(id)arg3 currencyCode:(id)arg4;
- (void).cxx_destruct;
- (id)currencyCode;
- (id)description;
- (id)merchantSession;
- (id)secureElementIdentifier;
- (void)setCurrencyCode:(id)arg1;
- (void)setMerchantSession:(id)arg1;
- (void)setSecureElementIdentifier:(id)arg1;
- (void)setTransactionAmount:(id)arg1;
- (id)transactionAmount;
@end
| {
"pile_set_name": "Github"
} |
import java.security.Permission;
import java.util.Scanner;
interface Food {
public String getType();
}
class Pizza implements Food {
public String getType() {
return "Someone ordered a Fast Food!";
}
}
class Cake implements Food {
public String getType() {
return "Someone ordered a Dessert!";
}
}
class FoodFactory {
public Food getFood(String order) {
if (order.equalsIgnoreCase("pizza")) {
return new Pizza();
} else {
return new Cake();
}
}
}
public class JavaFactoryPattern {
@SuppressWarnings("resource")
public static void main(String args[]) {
Do_Not_Terminate.forbidExit();
try {
Scanner sc = new Scanner(System.in);
// creating the factory
FoodFactory foodFactory = new FoodFactory();
// factory instantiates an object
Food food = foodFactory.getFood(sc.nextLine());
System.out.println("The factory returned " + food.getClass());
System.out.println(food.getType());
} catch (Do_Not_Terminate.ExitTrappedException e) {
System.out.println("Unsuccessful Termination!!");
}
}
}
class Do_Not_Terminate {
public static class ExitTrappedException extends SecurityException {
private static final long serialVersionUID = 1L;
}
public static void forbidExit() {
final SecurityManager securityManager = new SecurityManager() {
@Override
public void checkPermission(Permission permission) {
if (permission.getName().contains("exitVM")) {
throw new ExitTrappedException();
}
}
};
System.setSecurityManager(securityManager);
}
}
| {
"pile_set_name": "Github"
} |
<?xml version="1.0" encoding="utf-8"?>
<selector xmlns:android="http://schemas.android.com/apk/res/android">
<item android:drawable="@color/bd_wallet_listitem_bg_grey2" android:state_pressed="true"/>
<item android:drawable="@android:color/transparent"/>
</selector> | {
"pile_set_name": "Github"
} |
<Response xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
<Id>c8e11135-b994-49a9-8740-8d089ab20b32</Id>
<Status>OK</Status>
<ProviderName>Demo AU</ProviderName>
<DateTimeUTC>2011-05-31T01:31:13.0864383Z</DateTimeUTC>
<Invoices>
<Invoice>
<Contact>
<ContactID>755f1475-d255-43a8-bedc-5ea7fd26c71f</ContactID>
<ContactStatus>ACTIVE</ContactStatus>
<Name>Yarra Transport</Name>
<EmailAddress>[email protected]</EmailAddress>
<Addresses>
<Address>
<AddressType>STREET</AddressType>
</Address>
<Address>
<AddressType>POBOX</AddressType>
<AddressLine1>P O Box 5678</AddressLine1>
<City>Melbourne</City>
<PostalCode>3133</PostalCode>
</Address>
</Addresses>
<Phones>
<Phone>
<PhoneType>DDI</PhoneType>
</Phone>
<Phone>
<PhoneType>DEFAULT</PhoneType>
<PhoneNumber>12344321</PhoneNumber>
<PhoneAreaCode>03</PhoneAreaCode>
</Phone>
<Phone>
<PhoneType>FAX</PhoneType>
</Phone>
<Phone>
<PhoneType>MOBILE</PhoneType>
</Phone>
</Phones>
<UpdatedDateUTC>2011-05-06T01:20:55.38</UpdatedDateUTC>
<ContactGroups>
<ContactGroup>
<ContactGroupID>26fcca8d-a03b-4968-a80a-a463d5bf30ee</ContactGroupID>
<Name>Support Clients (monthly)</Name>
<Status>ACTIVE</Status>
</ContactGroup>
</ContactGroups>
<IsSupplier>false</IsSupplier>
<IsCustomer>true</IsCustomer>
</Contact>
<Date>2011-03-19T00:00:00</Date>
<DueDate>2011-03-28T00:00:00</DueDate>
<Status>PAID</Status>
<LineAmountTypes>Exclusive</LineAmountTypes>
<LineItems>
<LineItem>
<Description>Desktop/network support via email & phone.
Per month fixed fee for minimum 20 hours/month.</Description>
<UnitAmount>500.00</UnitAmount>
<TaxType>OUTPUT</TaxType>
<TaxAmount>50.00</TaxAmount>
<LineAmount>500.00</LineAmount>
<AccountCode>200</AccountCode>
<ItemCode>Support-M</ItemCode>
<Quantity>1.0000</Quantity>
</LineItem>
</LineItems>
<SubTotal>500.00</SubTotal>
<TotalTax>50.00</TotalTax>
<Total>550.00</Total>
<UpdatedDateUTC>2008-09-24T17:14:37.663</UpdatedDateUTC>
<CurrencyCode>AUD</CurrencyCode>
<FullyPaidOnDate>2011-03-28T00:00:00</FullyPaidOnDate>
<Type>ACCREC</Type>
<InvoiceID>3fcb9847-b350-412e-ab90-7d9d774ad881</InvoiceID>
<InvoiceNumber>ORC1017</InvoiceNumber>
<Reference>Monthly support</Reference>
<Payments>
<Payment>
<PaymentID>22cf5c38-40d6-4c56-a442-00b147f550d0</PaymentID>
<Date>2011-03-28T00:00:00</Date>
<Amount>550.00</Amount>
</Payment>
</Payments>
<AmountDue>0.00</AmountDue>
<AmountPaid>550.00</AmountPaid>
<AmountCredited>0.00</AmountCredited>
<SentToContact>true</SentToContact>
</Invoice>
</Invoices>
</Response> | {
"pile_set_name": "Github"
} |
---
title: Runtime Changes for Migration from .NET Framework 4.6.2 to 4.7
description: Find information about application compatibility issues from runtime changes that might affect your app when migrating from .NET Framework 4.6.2 to 4.7.
ms.date: "07/10/2019"
ms.assetid: 6f7b5426-3216-4bd1-bafd-4594e441de94
author: "chlowell"
---
# Runtime Changes for Migration from .NET Framework 4.6.2 to 4.7
[!INCLUDE[versionselector](../../../../includes/migration-guide/runtime/versionselector.md)]
If you are migrating from the .NET Framework 4.6.2 to 4.7, review the following topics for application compatibility issues that may affect your app:
## JIT
[!INCLUDE[Incorrect code generation when passing and comparing UInt16 values](~/includes/migration-guide/runtime/jit/incorrect-code-generation-when-passing-comparing-uint16-values.md)]
## Windows Presentation Foundation (WPF)
[!INCLUDE[Crash in Selector when removing an item from a custom INCC collection](~/includes/migration-guide/runtime/wpf/crash-selector-when-removing-an-item-from-custom-incc-collection.md)]
[!INCLUDE[DataGridCellsPanel.BringIndexIntoView throws ArgumentOutOfRangeException](~/includes/migration-guide/runtime/wpf/datagridcellspanelbringindexintoview-throws-argumentoutofrangeexception.md)]
[!INCLUDE[ObjectDisposedException thrown by WPF spellchecker](~/includes/migration-guide/runtime/wpf/objectdisposedexception-thrown-by-wpf-spellchecker.md)]
[!INCLUDE[Resizing a Grid can hang](~/includes/migration-guide/runtime/wpf/resizing-grid-can-hang.md)]
[!INCLUDE[RibbonGroup background is set to transparent in localized builds](~/includes/migration-guide/runtime/wpf/ribbongroup-background-set-transparent-localized-builds.md)]
[!INCLUDE[WPF Printing Stack Update](~/includes/migration-guide/runtime/wpf/wpf-printing-stack-update.md)]
## Windows Workflow Foundation (WF)
[!INCLUDE[Workflow now throws original exception instead of NullReferenceException in some cases](~/includes/migration-guide/runtime/wf/workflow-now-throws-original-exception-instead-nullreferenceexception-some.md)]
[!INCLUDE[Workflow SQL persistence adds primary key clusters and disallows null values in some columns](~/includes/migration-guide/runtime/wf/workflow-sql-persistence-adds-primary-key-clusters-disallows-null-values.md)]
| {
"pile_set_name": "Github"
} |
<!-- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
_______ ___ ____________ ___ _______ ____________________________ _ __
/ __/ _ \/ _ |/ ___/ __/ _ \ / _ \/ __/ _ \/ __/_ __/ _/_ __/ _/ __ \/ |/ /
_\ \/ ___/ __ / /__/ _// // / / , _/ _// ___/ _/ / / _/ / / / _/ // /_/ / /
/___/_/ /_/ |_\___/___/____/ /_/|_/___/_/ /___/ /_/ /___/ /_/ /___/\____/_/|_/
=== FAN-TRANSLATION GUIDE ===
Hello fan-translators! From the bottom of my heart:
thank you for doing this, and, you've no idea what you've gotten yourself into.
There's about 3500 words to translate, including the flashcards & further reading.
Before doing anything, please read all these steps:
https://github.com/ncase/remember#how-to-translate
(emphasis: do NOT edit the original index.html. make a copy of this page!)
To make translation less painful, I've added little HTML comments throughout.
Look for the ones that say "TRANSLATOR NOTE".
And after translating this page, don't forget to go to translations.txt
and "add" your translation there! (further instructions will be there)
Good luck, and many thanks again!
<3,
~ Nicky Case
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -->
<!DOCTYPE html>
<html lang="ca"> <!-- TRANSLATOR NOTE: Remember your 2-letter code? Replace "en" with that! -->
<head>
<!-- Meta Stuff -->
<title>Com Recordar Tot Gairebé Per Sempre</title>
<!-- TRANSLATOR NOTE: Translate the "content" attribute -->
<meta name="description" content="Un còmic interactiu sobre l'art i la ciència de la memòria"/>
<meta content="text/html;charset=utf-8" http-equiv="Content-Type">
<meta content="utf-8" http-equiv="encoding">
<meta charset="utf-8">
<link rel="icon" type="image/png" href="favicon.png">
<!-- Sharing Card Stuff -->
<meta itemprop="name" content="Com Recordar Tot Gairebé Per Sempre"> <!-- TRANSLATE "content" -->
<meta itemprop="description" content="Un còmic interactiu sobre l'art i la ciència de la memòria"> <!-- TRANSLATE "content" -->
<meta itemprop="image" content="https://ncase.me/remember/sharing/thumbnail.png">
<meta name="twitter:title" content="Com Recordar Tot Gairebé Per Sempre"> <!-- TRANSLATE "content" -->
<meta name="twitter:description" content="Un còmic interactiu sobre l'art i la ciència de la memòria"> <!-- TRANSLATE "content" -->
<meta name="twitter:card" content="summary_large_image">
<meta name="twitter:site" content="@ncasenmare">
<meta name="twitter:creator" content="@ncasenmare">
<meta name="twitter:image" content="https://ncase.me/remember/sharing/thumbnail.png">
<meta property="og:title" content="Com Recordar Tot Gairebé Per Sempre"> <!-- TRANSLATE "content" -->
<meta property="og:description" content="Un còmic interactiu sobre l'art i la ciència de la memòria"> <!-- TRANSLATE "content" -->
<meta property="og:type" content="website">
<meta property="og:url" content="https://ncase.me/remember/">
<meta property="og:image" content="https://ncase.me/remember/sharing/thumbnail.png">
<!-- Styles -->
<link rel="stylesheet" type="text/css" href="css/comic.css"/>
<meta name="viewport" content="width=600">
</head>
<body>
<!-- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -->
<!-- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -->
<!-- CHAPTER 0: INTRODUCTION - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -->
<!-- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -->
<!-- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -->
<a name="0"></a>
<div class="divider divider_title">
<iframe class="splash" gotosrc="sims/splash/" scrolling="no"></iframe>
<div id="divider_container">
<div id="chapter_name">
<div style="font-size: 75px">
COM RECORDAR QUALSEVOL COSA PER QUASI-SEMPRE
</div>
<!-- TRANSLATOR NOTE: add a hint of silliness at the end, like "ish" or "sorta" -->
</div>
<div style="text-align:right;">
per nicky case · octubre 2018
<br>
<span id="translation_credits"></span>
<!-- TRANSLATOR NOTE: when you update translations.txt, your name will appear here! -->
</div>
</div>
</div>
<div class="comic">
<div id="language_options"></div>
<!--
TRANSLATOR NOTE:
There may already be "official" translations for terms like "Spaced Repetition" or "Forgetting Curve"!
Go to their Wikipedia pages, scroll down to "Languages" in the left sidebar, and if your language is there,
click on that Wikipedia page, and use the "official" translated term there.
Spaced Repetition: https://en.wikipedia.org/wiki/Spaced_repetition Repetició Espaiada
Forgetting Curve: https://en.wikipedia.org/wiki/Forgetting_curve Corba de l'Oblit
-->
<!--
TRANSLATOR NOTE:
Try to make your translated text about the same length or shorter as the original text.
If that's not possible, and your text doesn't fit in its box, you can modify attributes
"x", "y", "w", "h" to change the box, or add your own custom CSS style to make the font fit.
(CSS properties like "font-size" are very helpful)
-->
<panel w=400 h=650>
<pic src="pics/intro0.png" sx=0 sy=0></pic>
<words x=10 y=10 w=350 h=60>
En la mitologia grega, Mnemosyne, la deessa de la Memòria...
</words>
<words x=30 y=330 w=310 h=60>
...era la mare de les Muses, les deesses de la inspiració.
</words>
<words x=70 y=445 w=90 style="color:#fff" no-bg class="comic_text">
música
</words>
<words x=119 y=494 w=90 style="color:#fff" no-bg class="comic_text">
teatre
</words>
<words x=214 y=464 w=90 style="color:#fff" no-bg class="comic_text">
fanfic raro
</words>
</panel>
<panel w=600 h=60>
<words w=600 x=-15 no-bg>
Així doncs, com els va a la Memòria i la Inspiració en els col·legis?
</words>
</panel>
<panel w=550 h=250>
<pic src="pics/intro0.png" sx=400 sy=0></pic>
<words x=-12 y=81 w=40 no-bg class="comic_text" style="font-size:20px"> bla </words>
<words x=50 y=85 w=40 no-bg class="comic_text" style="font-size:20px"> bla </words>
<words x=114 y=84 w=40 no-bg class="comic_text" style="font-size:20px"> bla </words>
<words x=172 y=91 w=40 no-bg class="comic_text" style="font-size:20px"> bla </words>
<words x=295 y=80 w=40 no-bg class="comic_text" style="font-size:20px"> bla </words>
<words x=363 y=83 w=40 no-bg class="comic_text" style="font-size:20px"> bla </words>
<words x=444 y=81 w=40 no-bg class="comic_text" style="font-size:20px"> bla </words>
<words x=518 y=81 w=40 no-bg class="comic_text" style="font-size:20px"> bla </words>
</panel>
<panel w=500 h=250>
<pic src="pics/intro0.png" sx=400 sy=250></pic>
<words x=155 y=20 w=90 no-bg>
Això.
</words>
<words x=196 y=65 w=270 no-bg>
No només que tècniques comunes com les classes, covar i rellegir són <i>avorrides</i>,
la ciència ha mostrat que <i>ni tan sols funcionen bé</i>.*
</words>
</panel>
<panel w=500 h=30 style="margin-top:-5px">
<words w=500 x=-15 y=-15 no-bg style="width: 500px; font-size:0.8em; text-align: right; color:#999;">
* totes les fonts i enllaços estaran al final del còmic!
</words>
</panel>
<panel w=500 h=350>
<pic src="pics/intro0.png" sx=400 sy=500></pic>
<words x=95 y=30 w=340 no-bg>
I si et dic que hi ha una forma
que funciona bé <i>i</i> és divertida?
</words>
<words x=164 y=141 w=300 no-bg>
I si et dic que hi ha un joc de memòria que, jugant uns 20 minutos al dia,
et permet guardar <i>el que triïs</i> a la teva ment <i>per sempre?*</i>
</words>
</panel>
<panel w=500 h=30 style="margin-top:-5px">
<words w=500 x=-15 y=-15 no-bg style="width: 500px; font-size:0.8em; text-align: right; color:#999;">
* fins que moris
</words>
</panel>
<panel w=600 h=300 bg="#e0e0e0">
<sim x=80 y=0 w=440 h=300 src="sims/singlecard/?card=spaced_rep"></sim>
</panel>
<panel w=500 h=450 fadeInOn="flip_spaced_rep">
<pic src="pics/intro0.png" sx=950 sy=0></pic>
<words x=10 y=10 w=430 h=60>
I és <i>increïble</i>.
Vaig començar a usar Repàs Espaiat a l'inici de l'any per a aprendre francès.
</words>
<words x=30 y=350 w=430 h=60>
En dos <i>mesos</i>, vaig aprendre més paraules que en dos <i>anys</i>
a classes de francès a l'institut.
</words>
</panel>
<panel w=500 h=400>
<pic src="pics/intro0.png" sx=950 sy=450></pic>
<words x=10 y=10 w=400 h=60>
Des de llavors, he usat Repàs Espaiat per a recordar tot tipus de coses...
</words>
<words x=81 y=113 w=100 style="text-align:left" no-bg class="comic_text">
notes de ukelele
</words>
<words x=212 y=114 w=100 style="text-align:left" no-bg class="comic_text">
codi d'ordinador
</words>
<words x=380 y=137 w=100 style="text-align:left" no-bg class="comic_text">
aniversari d'amics
</words>
<words x=188 y=204 w=270 style="text-align:left" no-bg class="comic_text">
qualsevol dada curiosa que trobi en llibres o articles!
</words>
<words x=60 y=300 w=400 h=60>
...i aquest joguet de memòria es va fer una part clau de la meva <i>vida</i>.
</words>
</panel>
<panel w=550 h=350>
<pic src="pics/intro0.png" sx=0 sy=850></pic>
<words x=10 y=10 w=500 h=30>
En resum, Repàs Espaiat = proves + temps.
</words>
<words x=10 y=220 w=500 h=90>
Fas proves amb una dada repetint moltes vegades, però separant les teves repeticions en el temps.
(Però no durarà massa? Veurem més tard que hi ha un truc...)
</words>
</panel>
<panel w=400 h=400>
<pic src="pics/intro0.png" sx=0 sy=1200></pic>
<words x=10 y=20 w=290 no-bg style="font-size:20px">
Repàs Espaiat és gratis, basat en evidència, i tan senzill que ho pots fer amb una <i>caixa de sabates</i>.
</words>
<words x=308 y=265 w=50 no-bg class="comic_text" style="text-align:left; font-size:20px">
nicky calla
</words>
<words x=90 y=130 w=270 no-bg style="font-size:22px">
Llavors, quin és la trampa? Per què no està <i>tothom</i> fent-ho servir?
</words>
</panel>
<panel w=400 h=400>
<pic src="pics/intro0.png" sx=400 sy=1200></pic>
<words x=10 y=20 w=330 no-bg style="font-size:22px">
Doncs, la cosa es que crear <i>qualsevol</i> hàbit nou és difícil,
especialment un estrany com el Repàs Espaiat.
</words>
<words x=292 y=303 w=80 no-bg class="comic_text" style="text-align:left; font-size:20px">
arriba el profe
</words>
<words x=100 y=134 w=270 no-bg>
Per això vaig fer aquest comic interactiu mal dibuixat.
</words>
</panel>
<panel w=400 h=400>
<pic src="pics/intro0.png" sx=800 sy=1200></pic>
<words x=10 y=20 w=300 no-bg style="font-size:22px">
En aquest comic del Repàs<br>Espaiat,
et mostraré PER QUÈ funciona, COM funciona...
</words>
<words x=110 y=140 w=250 no-bg>
...i t'ajudaré perquè que comencis <i>AVUI.</i>
</words>
</panel>
<panel w=600 h=180>
<words w=600 x=-15 no-bg>
També, al llarg del còmic,
pots provar el que has après,
en intervals separats.
<b>És a dir: usaràs Repàs Espaiat per a aprendre sobre el Repàs Espaiat.</b>
<br><br>
Així:
</words>
</panel>
<panel w=600 h=400 bg="#e0e0e0">
<sim x=0 y=0 w=600 h=400 src="sims/multicard/?cards=intro_a,intro_b,intro_c"></sim>
</panel>
<panel w=550 h=450>
<pic src="pics/intro0.png" sx=950 sy=1600></pic>
<words x=10 y=10 w=480 h=90>
Però, no és dolent "aprendre de memòria"?
No ho podem cercar tot, avui dia?
No seria millor aprendre com ser creatius i tenir pensament crític?
</words>
<words x=10 y=320 w=500 h=90 style="font-size:22px">
No <i>hi ha</i> "millor".
La ciència cognitiva mostra
que <i>necessites</i> memorització per a la creativitat i el pensament crític.
(Imagina escriure una redacció sense conèixer les paraules!)
</words>
<words x=187 y=138 w=150 no-bg class="comic_text" style="font-size:40px">
MEMÒRIA
</words>
<words x=22 y=222 w=100 no-bg class="comic_text" style="font-size:20px">
art
</words>
<words x=408 y=224 w=100 no-bg class="comic_text" style="font-size:20px">
ciència
</words>
</panel>
<panel w=550 h=300>
<pic src="pics/intro0.png" sx=0 sy=1600></pic>
<words x=10 y=20 w=310 no-bg>
El Repàs Espaiat no és un "truc per a estudiar".
</words>
<words x=30 y=113 w=320 no-bg style="font-size: 24px" style="font-size: 24px">
És una forma de recuperar el control de la teva <i>ment.</i>
De fer la memòria a llarg termini una <i>opció</i>.
De crear una passió per aprendre de per vida...
</words>
</panel>
<panel w=400 h=550>
<pic src="pics/intro0.png" sx=550 sy=1600></pic>
<words x=20 y=20 w=330 h=30 style="font-size: 21px">
...de fomentar la teva pròpia Musa interior.
</words>
<words x=117 y=131 w=140 no-bg class="comic_text" style="font-size:20px; color:#fff">
Tony Stark gairebé esbufega quan una mà amb guant va baixar per la seva esquena.
La pressió era suau i quasi reconfortant.
Obama va riure. “Dius, el-
</words>
<words x=240 y=480 w=120 h=30>
Comencem.
</words>
</panel>
</div>
<!-- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -->
<!-- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -->
<!-- CHAPTER 1: THE SCIENCE OF SPACED REPETITION - - - - - - - - - - - - - - - - - - - - - - - -->
<!-- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -->
<!-- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -->
<a name="1"></a>
<div class="divider divider_big_height">
<iframe class="splash" gotosrc="sims/splash/" scrolling="no"></iframe>
<div id="divider_container">
<div id="chapter_name">
<div>
LA CIÈNCIA del
REPÀS ESPAIAT
</div>
</div>
<div id="chapter_links"></div>
</div>
</div>
<div class="comic">
<panel w=500 h=450>
<pic src="pics/sci0.png" sx=0 sy=0></pic>
<words x=10 y=10 w=400 h=60>
En 1885, Hermann Ebbinghaus va fer una acció de masoquisme científic.
</words>
<words x=30 y=320 w=430 h=90>
El psicòleg alemany va memoritzar <i>milers</i> de paraules sense sentit,
va anotar quantes s'havia oblidat amb el temps, i va descobrir...
</words>
</panel>
<panel w=400 h=500>
<pic src="pics/sci0.png" sx=500 sy=0></pic>
<words x=60 y=10 w=250>
<b>LA CORBA DE L'OBLIT</b>
</words>
<words x=10 y=310 w=350>
Va observar que oblides la majoria del que aprens en les primeres 24 hores,
i, si no fas repassos, les teves memòries restants es perden exponencialment.*
</words>
</panel>
<panel w=500 h=53 style="margin-top:-5px">
<words w=500 x=-15 y=-10 no-bg style="width: 500px; font-size:0.8em; text-align: right; color:#999; line-height: 1.1em;">
* tècnicament la corba no és <i>exactament</i>
<br>
exponencial, però és igual, s'assembla.
</words>
</panel>
<panel w=500 h=450>
<pic src="pics/sci0.png" sx=900 sy=0></pic>
<words x=10 y=10 w=450 h=90>
Els filòsofs han debatut sobre la memòria durant mil·lennis,
però Ebbinghaus va ser el primer a fer <i>experiments.</i>
(que han estat repetits)
</words>
<words x=193 y=169 w=70 no-bg class="comic_text" style="font-size: 19px; color:rgba(0,0,0,0.35)">
si us plau...
</words>
<words x=278 y=195 w=70 no-bg class="comic_text" style="color:rgba(0,0,0,0.35)">
máta-
</words>
<words x=348 y=234 w=70 no-bg class="comic_text" style="color:rgba(0,0,0,0.35)">
em...
</words>
<words x=20 y=350 w=440 h=60 style="font-size: 24px">
Per aquest motiu, Hermann Ebbinghaus és conegut com
el pioner de la ciència de la memòria.
</words>
</panel>
<panel w=600 h=80>
<words w=600 x=-15 no-bg>
Aquí tens una simulació de la Corba de l'Oblit.
<b>Canvia la velocitat de l'oblit. Què li passa a la corba?</b>
</words>
</panel>
<panel w=600 h=370>
<sim x=0 y=0 w=600 h=370 src="sims/ebbinghaus/?mode=0"></sim>
</panel>
<panel w=600 h=90>
<words w=600 x=-15 no-bg>
Com pots veure, quanta menys velocitat, més plana és la corba,
és a dir, més dura la memòria.
</words>
</panel>
<panel w=400 h=400>
<pic src="pics/sci0.png" sx=0 sy=500></pic>
<words x=10 y=10 w=300>
La velocitat d'oblit d'una persona depèn de la persona i la seva memòria...
</words>
<words x=0 y=145 w=330 no-bg class="comic_text smaller">
hola! com deies que et deies?
</words>
<words x=177 y=186 w=180 no-bg class="comic_text smaller">
jaja. sóc susan.
</words>
</panel>
<panel w=400 h=400>
<pic src="pics/sci0.png" sx=400 sy=500></pic>
<words x=10 y=10 w=360 style="font-size:25px;padding:5px 10px 5px 10px">
Però en general, la "velocitat d'oblit" baixa cada vegada que ho <b>recordes activament</b>.
(comparat amb rellegir passivament)
</words>
<words x=27 y=198 w=120 no-bg class="comic_text smaller">
susan. susan. susan. susan. susan.
</words>
</panel>
<panel w=400 h=400>
<pic src="pics/sci0.png" sx=800 sy=500></pic>
<words x=10 y=10 w=300>
(però, quan deixes de practicar, continua oblidant-se)
</words>
<words x=41 y=121 w=150 no-bg class="comic_text smaller">
doncs, adéu, sarah!
</words>
<words x=191 y=148 w=100 no-bg class="comic_text smaller">
susan.
</words>
<words x=59 y=174 w=150 no-bg class="comic_text smaller">
adéu, sandy!
</words>
<words x=193 y=203 w=100 no-bg class="comic_text smaller">
SUSAN.
</words>
</panel>
<panel w=600 h=120>
<words w=600 x=-15 no-bg>
Una altra vegada la simulació, però amb una sessió de repàs.
<br>
(línia gris: el que seria la memòria <i>sense</i> aquest repàs)
<br>
<b>Canvia el temps del repàs, a veure què li ocorre a la corba:</b>
</words>
</panel>
<panel w=600 h=400>
<sim x=0 y=0 w=600 h=400 src="sims/ebbinghaus/?mode=1"></sim>
</panel>
<panel w=600 h=90>
<words w=600 x=-15 no-bg>
Un repàs només refresca la memòria per un temps, però a la llarga,
per aquest oblit exponencial, un repàs només no canvia res.
</words>
</panel>
<panel w=450 h=400>
<pic src="pics/sci1.png" sx=0 sy=0></pic>
<words x=10 y=10 w=390>
Hi ha una forma millor d'aprendre?<br>
Si que hi ha! El truc de recordar...
</words>
<words x=210 y=330 w=200>
...<i>és quasi oblidar.</i>
</words>
</panel>
<panel w=500 h=300>
<pic src="pics/sci1.png" sx=450 sy=0></pic>
<words x=250 y=20 w=200>
Per a entendre-ho, pensa a entrenar els teus músculs.
No et serveix de res un pes massa lleuger...
</words>
</panel>
<panel w=500 h=300>
<pic src="pics/sci1.png" sx=450 sy=300></pic>
<words x=250 y=20 w=200>
...ni un massa pesat.
</words>
</panel>
<panel w=350 h=350>
<pic src="pics/sci1.png" sx=950 sy=0></pic>
<words x=10 y=10 w=300>
El mateix s'aplica a entrenar el cervell.
Necessites <b>dificultat òptima</b>: el punt òptim de dificultat.
</words>
<words x=55 y=187 w=100 no-bg class="comic_text smaller" style="text-align:left">
còmode
</words>
<words x=55 y=282 w=100 no-bg class="comic_text smaller" style="text-align:left">
incòmode
</words>
<words x=176 y=186 w=120 no-bg class="comic_text smaller">
massa fàcil
</words>
<words x=179 y=229 w=140 no-bg class="comic_text" style="color:#000">
punt òptim
</words>
<words x=176 y=280 w=120 no-bg class="comic_text smaller">
massa difícil
</panel>
<panel w=450 h=400>
<pic src="pics/sci1.png" sx=0 sy=400></pic>
<words x=10 y=10 w=360>
Per tant: el millor per a aprendre alguna cosa, és recordar-ho...
</words>
<words x=60 y=330 w=350>
...<i>quan estàs a punt d'oblidar-ho.</i>
</words>
</panel>
<panel w=600 h=120>
<words w=600 x=-15 no-bg>
La mateixa simulació d'abans ara mostra el
<span style="background:#ffe866">punt òptim</span>,
quan has oblidat <i>només una miqueta.</i>
<b>Posa el repàs en <i>el mitjà</i> del punt òptim. Què ocorre?</b>
</words>
</panel>
<panel w=600 h=400>
<sim x=0 y=0 w=600 h=400 src="sims/ebbinghaus/?mode=2"></sim>
</panel>
<panel w=600 h=90>
<words w=600 x=-15 no-bg>
Ho veus? Si fas un repàs en el moment perfecte,
pots alentir una mica l'oblit!
Però i amb <i>molts</i> repassos?
</words>
</panel>
<panel w=500 h=450>
<pic src="pics/sci2.png" sx=0 sy=0></pic>
<words x=10 y=10 w=430>
Posem que ets una persona
<span class="strikeout">vaga</span>
eficient, així que només fas 4 repassos.
</words>
<words x=30 y=350 w=430>
Pregunta:
<i>quina és la millor forma de repartir els repassos?</i>
</words>
<words x=82 y=198 w=120 no-bg class="comic_text" style="transform: rotate(-16deg);">
susan
</words>
</panel>
<panel w=500 h=350>
<pic src="pics/sci2.png" sx=500 sy=0></pic>
<words x=10 y=10 w=190>
Repartir-los en el temps en trossos iguals?<br>
Anar augmentant-los en trossos cada vegada més grans?
o en trossos més petits?
O fer-ho impredictible, per a mantenir l'atenció?
</words>
<words x=259 y=16 w=100 no-bg class="comic_text smaller" style="text-align:left; color:#000">
= repàs
</words>
<words x=295 y=16 w=100 no-bg class="comic_text smaller" style="text-align:right; color:#000">
temps
</words>
<words x=245 y=61 w=200 no-bg class="comic_text smaller" style="text-align:left; color:#000">
trossos iguals:
</words>
<words x=245 y=126 w=200 no-bg class="comic_text smaller" style="text-align:left; color:#000">
creixents:
</words>
<words x=245 y=198 w=200 no-bg class="comic_text smaller" style="text-align:left; color:#000">
decreixents:
</words>
<words x=245 y=259 w=200 no-bg class="comic_text smaller" style="text-align:left; color:#000">
a l'atzar:
</words>
</panel>
<panel w=400 h=90>
<words h=90 style="font-size: 23px">
<b>Intenta endevinar-ho</b>,
i quan tinguis la resposta, <b>dóna-li la volta a la targeta ↓</b>
</words>
</panel>
<panel w=600 h=300 bg="#e0e0e0">
<sim x=80 y=0 w=440 h=300 src="sims/singlecard/?card=guessgap"></sim>
</panel>
<panel fadeInOn="flip_guessgap" w=600 h=120>
<words w=600 x=-15 y=0 no-bg>
La qual cosa sembla molt contradictori!
Pots demostrar-te que és cert jugant amb la simulació mes abaix.
<b>
Porta tots els repassos al <i>mitjà</i> del <span style="background:#ffe866">punt òptim</span>.
Quins trossos de temps surten?
</b>
</words>
</panel>
<panel w=600 h=520>
<sim x=0 y=0 w=600 h=520 src="sims/ebbinghaus/?mode=3"></sim>
</panel>
<panel w=600 h=120>
<words w=600 x=-15 no-bg>
(Per a provar que no és coincidència,
en aquest altre pots canviar
la velocitat d'oblit i el punt òptim.
Observa com en tots els casos normals,
la millor opció són els "trossos de temps creixents"!)
</words>
</panel>
<panel w=600 h=570>
<sim x=0 y=0 w=600 h=570 src="sims/ebbinghaus/?mode=4"></sim>
</panel>
<panel w=350 h=500>
<pic src="pics/sci2.png" sx=0 sy=450></pic>
<words x=10 y=10 w=300>
<i>Per què</i> els trossos creixen?
Perquè cada vegada que repasses en el punt òptim de l'oblit,
la velocitat d'oblit baixa...
</words>
<words x=25 y=187 w=50 no-bg class="comic_text smaller" style="text-align:left">
ets
</words>
<words x=16 y=177 w=300 no-bg class="comic_text" style="font-size:100px; transform: rotate(-5deg);">
¡SUSAN!
</words>
<words x=218 y=257 w=120 no-bg class="comic_text smaller" style="text-align:right">
–que co
<!-- TRANSLATOR NOTE: don't complete the swearing in your translation.
make it cut off at the edge of the panel. It's... funnier that way? -->
</words>
<words x=10 y=400 w=300>
...pel que trigaràs <i>més</i>
a arribar al punt òptim la pròxima vegada!
</words>
</panel>
<panel w=500 h=500>
<pic src="pics/sci2.png" sx=350 sy=450></pic>
<words x=10 y=10 w=400>
I saps el millor de tot?
Que si fas els teus repassos en el moment just...
</words>
<words x=60 y=400 w=400>
...pots guardar <i>qualsevol quantitat</i> de coses en la teva memòria,
<i>PER SEMPRE.</i>
</words>
</panel>
<panel w=250 h=250>
<pic src="pics/sci2.png" sx=850 sy=450></pic>
</panel>
<panel w=600 h=90>
<words w=600 x=-15 no-bg>
Parlant de fer repassos per a aprendre,
anem a fer memòria sobre el que hem après:
</words>
</panel>
<panel w=600 h=400 bg="#e0e0e0">
<sim x=0 y=0 w=600 h=400 src="sims/multicard/?cards=sci_a,sci_b,intro_b,sci_c"></sim>
</panel>
<panel w=400 h=400>
<pic src="pics/sci2.png" sx=0 sy=950></pic>
<words x=50 y=20 w=300 bg=none>
Pinta bé,
però <i>trobar</i> un horari de Repassos Espaiats ha de ser díficil, oi?
</words>
</panel>
<panel w=400 h=400>
<pic src="pics/sci2.png" sx=400 sy=950></pic>
<words x=50 y=30 w=300 bg=none>
<i>tot el contrari</i>
És tan senzill, que et pots fer un planificador automàtic...
</words>
</panel>
<panel w=400 h=400>
<pic src="pics/sci2.png" sx=800 sy=950></pic>
<words x=30 y=15 w=200 bg=none>
...amb una <i>capsa de sabates.</i>
</words>
</panel>
</div>
<!-- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -->
<!-- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -->
<!-- CHAPTER 2: THE ART OF SPACED REPETITION - - - - - - - - - - - - - - - - - - - - - - - - - -->
<!-- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -->
<!-- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -->
<a name="2"></a>
<div class="divider divider_big_height">
<iframe class="splash" gotosrc="sims/splash/" scrolling="no"></iframe>
<div id="divider_container">
<div id="chapter_name">
<div>
L'ART del
REPÀS ESPAIAT
</div>
</div>
<div id="chapter_links"></div>
</div>
</div>
<div class="comic">
<panel w=500 h=450>
<pic src="pics/leit0.png" sx=0 sy=0></pic>
<words x=10 y=10 w=430 h=60>
No és <i>necessari</i> usar una capsa de sabates,
però és més divertit si la fas servir.
</words>
<words x=3 y=119 w=140 no-bg class="comic_text smaller" style="font-size:22px">
i amb això practico
</words>
<words x=119 y=158 w=120 no-bg class="comic_text smaller" style="font-size:22px">
???
</words>
<words x=246 y=118 w=120 no-bg class="comic_text smaller" style="font-size:22px">
són ENTRENADORS
<!--
TRANSLATOR NOTE:
this is a pun that may not work in all languages.
If it doesn't translate to your language, try coming up with your own pun!
Or, replace this line with: "they help me go far"
-->
</words>
<words x=367 y=116 w=120 no-bg class="comic_text smaller" style="font-size:22px">
ja no som amics
</words>
<words x=30 y=350 w=430 h=60>
(Després veurem diverses <i>apps</i> de Repàs Espaiat,
com Anki i Tinycards)
</words>
</panel>
<panel w=500 h=400>
<pic src="pics/leit0.png" sx=500 sy=0></pic>
<words x=10 y=10 w=430 h=60>
Això es diu la Capsa de Leitner.
És com un joc de cartes que jugues contra tu!
</words>
<words x=30 y=300 w=430 h=60>
Primer divideixes la teva capsa en set "Nivells".
(Pots tenir més o menys nivells si vols)
</words>
</panel>
<panel w=500 h=370>
<pic src="pics/leit0.png" sx=0 sy=480></pic>
<words x=10 y=10 w=430 h=30>
Totes les targetes noves comencen al Nivell 1.
</words>
<words x=30 y=270 w=430 h=60>
(Si estàs començant amb el Repàs Espaiat, recomano 5 targetes noves al dia.)
</words>
</panel>
<panel w=500 h=400>
<pic src="pics/leit0.png" sx=500 sy=480></pic>
<words x=10 y=10 w=430 h=60>
Quan repasses una targeta i l'encertes, <br>
puja <i>un</i> Nivell.
</words>
<words x=30 y=300 w=430 h=60>
(Si arriba a l'últim Nivell, felicitats!
La teva targeta es retira al cel de les targetes.)
</words>
</panel>
<panel w=500 h=430>
<pic src="pics/leit0.png" sx=0 sy=900></pic>
<words x=10 y=10 w=430 h=60>
Però si la repasses i la contestes malament... s'ha de
<i>tornar al Nivel 1.</i>
</words>
<words x=30 y=300 w=430 h=90>
(Si ja està en el Nivell 1, bones notícies:
pots continuar fent-te proves fins que l'encertis,
i pujarla al Nivel 2)
</words>
</panel>
<panel w=500 h=400>
<pic src="pics/leit0.png" sx=0 sy=1370></pic>
<words x=10 y=10 w=430 h=120 style="font-size:22px">
Però quan repassem targetes?
Aquest és el truc.
En la Capsa Leitner, repassem les de Nivell 1 cada dia,
les de Nivell 2 cada dos, les de Nivell 3 cada <i>QUATRE</i> dies,
les de Nivell 5 cada <i>VUIT</i> dies, i així...
</words>
<words x=30 y=300 w=430 h=60 style="font-size: 23px">
El patró consisteix en <i>duplicar els trossos</i> (nombre de dies entre repassos) per a cada Nivell!
</words>
</panel>
<panel w=600 h=60>
<words w=600 x=-15 no-bg>
Així és com es veuria el calendari durant 64 dies:
</words>
</panel>
<panel w=600 h=400 bg="#fff">
<sim x=0 y=0 w=600 h=400 src="sims/calendar/"></sim>
</panel>
<panel w=500 h=490>
<pic src="pics/leit0.png" sx=500 sy=870></pic>
<words x=10 y=10 w=430 h=90>
(Nota: el motiu de repassar el Nivell 1 al final
és perquè així veuràs les teves targetes noves <i>i</i> les que vas oblidar de Nivells superiors.)
</words>
<words x=30 y=330 w=430 h=120>
(Al final d'una sessió diària de Repàs Espaiat,
no deixis targetes en el Nivell 1.
Prova fins que les puguis encertar totes,
i mou-les al Nivell 2!)
</words>
</panel>
<panel w=400 h=400>
<pic src="pics/leit0.png" sx=600 sy=1400></pic>
<words x=10 y=10 w=350 h=90>
(Nota 2: Hi ha <i>apps</i> de Repàs Espaiat com Anki que utilitzen un algoritme més sofisticat...)
</words>
<words x=10 y=300 w=350 h=60 style="font-size: 23px">
(...però en el fons, treballen amb els mateixos principis que la Capsa Leitner)
</words>
</panel>
<panel w=400 h=450>
<pic src="pics/leit0.png" sx=0 sy=1800></pic>
<words x=10 y=10 w=350 h=90>
(Nota 3: Ah, i amb unes quantes targetes i cinta,
pots fer el teu propi calendari plegable!)
</words>
<words x=10 y=350 w=350 h=60>
(al final posaré un tutorial en vídeo per a fer una Capsa Leitner)
</words>
</panel>
<panel w=600 h=80>
<words w=600 x=-15 no-bg>
Ara veurem el joc en acció!
Aquí hi ha una simulació <i>pas a pas</i> de la Capsa Leitner:
<b>(més tard veurem una <i>per mesos</i>)</b>
</words>
</panel>
<panel w=600 h=470 bg="#fff">
<sim x=0 y=0 w=600 h=470 src="sims/leitner/?mode=1"></sim>
</panel>
<panel w=600 h=110>
<words w=600 x=-15 no-bg>
Cada repàs diari dura uns 20-30 minuts.
En comptes de veure un episodi d'una sèrie, pots jugar amb les targetes;
i recordar tot el que vulguis <i>per a tota la vida</i>.
</words>
</panel>
<panel w=500 h=400>
<pic src="pics/leit1.png" sx=0 sy=0></pic>
<words x=10 y=10 w=430 h=60>
Però els hàbits són díficiles. Si comences amb molt, no avançaràs res...
</words>
<words x=20 y=300 w=450 h=60>
Però si comences amb <i>poc</i>, pots agafar impuls,
i fer la bola de neu més i més gran.
</words>
</panel>
<panel w=500 h=690>
<pic src="pics/leit1.png" sx=0 sy=400></pic>
<words x=10 y=10 w=430 h=60>
Per això recomano <i>començar</i> amb 5 targetes noves cada dia.
</words>
<words x=30 y=300 w=430 h=60>
Quan estiguis a gust amb això, pots canviar a 10 noves al dia.
I després 15, 20, 25, 30.
</words>
<words x=10 y=590 w=430 h=60>
I amb 30 noves targetes al dia, podeu aprendre <i>10.000+</ i> nous fets/paraules/etc a <i>l'any.</i>
</words>
<words x=16 y=497 w=200 no-bg class="comic_text smaller" style="text-align:right">
na na na na na na na na na
</words>
<words x=38 y=517 w=200 no-bg class="comic_text smaller" style="text-align:right">
katamari damacy
<!-- TRANSLATOR NOTE: leave this in its japanese.
i don't know what it means, actually. it's a videogame song. -->
</words>
</panel>
<panel w=600 h=80>
<words w=600 x=-15 no-bg>
Aquí està la simulació mes a mes.
Utilitza-la per a calcular per endavant, <i>quantes coses</i> pots aprendre amb el Repàs Espaiat!
</words>
</panel>
<panel w=600 h=470 bg="#fff">
<sim x=0 y=0 w=600 h=470 src="sims/leitner/?mode=2"></sim>
</panel>
<panel w=600 h=110>
<words w=600 x=-15 no-bg>
Ja està. Així és com pots <i>triar</i> fer memòries a llarg termini.
</words>
<words w=600 x=-15 y=50 no-bg>
Assimilem-ho. Descansa, i anem a repassar el que hem après:
</words>
</panel>
<panel w=600 h=400 bg="#e0e0e0">
<sim x=0 y=0 w=600 h=400 src="sims/multicard/?cards=leit_a,intro_a,leit_b,intro_c,leit_c"></sim>
</panel>
<panel w=600 h=80>
<words w=600 x=-15 no-bg>
El Repàs Espaiat gairebé sembla massa bo per a ser cert.
<br>
I ho és... <i>SI</i> caus en unes trampes molt comunes.
</words>
</panel>
<panel w=500 h=450>
<pic src="pics/leit1.png" sx=500 sy=0></pic>
<words x=10 y=5 w=420 h=90>
La memòria no és una prestatgeria
on guardes toms gegants a l'atzar per a impressionar als altres.
</words>
<words x=-15 y=210 w=150 no-bg class="comic_text" style="text-align:left; font-size:27px; transform:rotate(90deg)">
un munt
</words>
<words x=39 y=216 w=150 no-bg class="comic_text" style="text-align:left; font-size:22px; transform:rotate(86deg)">
d'escombraries
</words>
<words x=100 y=211 w=150 no-bg class="comic_text" style="text-align:left; font-size:27px; transform:rotate(74deg)">
que mai
</words>
<words x=144 y=212 w=150 no-bg class="comic_text" style="text-align:left; font-size:27px; transform:rotate(90deg)">
arribaràs
</words>
<words x=199 y=214 w=150 no-bg class="comic_text" style="text-align:left; font-size:27px; transform:rotate(84deg)">
a llegir
</words>
<words x=10 y=350 w=450 h=60>
És a dir: el Repàs fallarà si les teves targetes es veuen
<i>pesades</i>, <i>desconnectades</i> o <i>sense sentit</i>.
</words>
</panel>
<panel w=500 h=450>
<pic src="pics/leit1.png" sx=500 sy=450></pic>
<words x=10 y=10 w=430 h=90 style="font-size: 23px">
En realitat la memòria és com un trencaclosques: ple de peces petites i connectades.
(Així funcionen també les neurones)
</words>
<words x=30 y=380 w=430 h=30>
No es tracta de <i>recollir</i>, sinó de <i>conectar</i>.
</words>
</panel>
<panel w=500 h=400>
<pic src="pics/leit1.png" sx=500 sy=900></pic>
<words x=10 y=10 w=410 h=60>
Així que, per a aprofitar al màxim el Repàs Espaiat,
fes les teves targetes...
</words>
<words x=-38 y=227 w=200 no-bg class="comic_text" style="color:#fff; font-size:30px">
PETITES
</words>
<words x=94 y=257 w=200 no-bg class="comic_text" style="color:#fff; font-size:73px">
CONNECTADES
</words>
<words x=262 y=298 w=200 no-bg class="comic_text" style="color:#fff; font-size:30px">
i AMB SENTIT
</words>
</panel>
<panel w=450 h=60>
<words w=450 x=-15 no-bg>
Anem a veure com...
</words>
</panel>
<panel w=600 h=150>
<pic src="pics/leit2.png" sx=0 sy=0></pic>
<words x=169 y=44 w=400 no-bg style="color:#fff; font-size:80px; text-align:left">
PETITES
</words>
</panel>
<panel w=450 h=50>
<words w=450 x=-15 no-bg>
Aquesta és una targeta dolenta:
</words>
</panel>
<panel w=600 h=300 bg="#e0e0e0">
<sim x=80 y=0 w=440 h=300 src="sims/singlecard/?card=mitochondria_all"></sim>
</panel>
<panel w=450 h=380>
<pic src="pics/leit2.png" sx=0 sy=450></pic>
<words x=10 y=10 w=400 h=30>
Massa gran. Massa informació.
</words>
<words x=10 y=250 w=400 h=90>
La tallarem en peces més petites!
Com a regla d'or, <i>cada targeta hauria de tenir una sola idea.</i>
Així:
</words>
</panel>
<panel w=264 h=180 bg="#e0e0e0">
<sim x=-88 y=-60 w=440 h=300 src="sims/singlecard/?card=mitochondria_1" class="small_card"></sim>
</panel>
<panel w=264 h=180 bg="#e0e0e0">
<sim x=-88 y=-60 w=440 h=300 src="sims/singlecard/?card=mitochondria_2" class="small_card"></sim>
</panel>
<panel w=264 h=180 bg="#e0e0e0">
<sim x=-88 y=-60 w=440 h=300 src="sims/singlecard/?card=mitochondria_3" class="small_card"></sim>
</panel>
<panel w=264 h=180 bg="#e0e0e0">
<sim x=-88 y=-60 w=440 h=300 src="sims/singlecard/?card=mitochondria_4" class="small_card"></sim>
</panel>
<panel w=264 h=180 bg="#e0e0e0">
<sim x=-88 y=-60 w=440 h=300 src="sims/singlecard/?card=mitochondria_5" class="small_card"></sim>
</panel>
<panel w=264 h=180 bg="#e0e0e0">
<sim x=-88 y=-60 w=440 h=300 src="sims/singlecard/?card=mitochondria_6" class="small_card"></sim>
</panel>
<panel w=264 h=180 bg="#e0e0e0">
<sim x=-88 y=-60 w=440 h=300 src="sims/singlecard/?card=mitochondria_7" class="small_card"></sim>
</panel>
<panel w=264 h=180 bg="#e0e0e0">
<sim x=-88 y=-60 w=440 h=300 src="sims/singlecard/?card=mitochondria_8" class="small_card"></sim>
</panel>
<panel w=450 h=90>
<words w=450 x=-15 no-bg>
Dades connectades a dades.
Però hi ha altres formes que les targetes estiguin...
</words>
</panel>
<panel w=600 h=150>
<pic src="pics/leit2.png" sx=0 sy=150></pic>
<words x=169 y=44 w=400 no-bg style="color:#fff; font-size:73px; text-align:left">
CONNECTADES
</words>
</panel>
<panel w=450 h=110>
<words w=450 x=-15 no-bg>
Aquesta targeta... està bé.
Una paraula en català per davant, i en francès per darrere.
<!--
TRANSLATOR NOTE:
If the language you're translating for is NOT French,
replace "English" with [your language]
-->
És el normal per a la majoria de targetes de llenguatges:
</words>
</panel>
<panel w=600 h=300 bg="#e0e0e0">
<sim x=80 y=0 w=440 h=300 src="sims/singlecard/?card=cat"></sim>
</panel>
<panel w=450 h=400>
<pic src="pics/leit2.png" sx=0 sy=800></pic>
<words x=10 y=10 w=400 h=60>
Però saps què faria que es quedés més en la memòria?
</words>
<words x=10 y=300 w=400 h=60>
Si la connectes a
<i>fotos, sons, context, o detalls personals!</i>
Així:
</words>
</panel>
<panel w=600 h=300 bg="#e0e0e0">
<sim x=80 y=0 w=440 h=300 src="sims/singlecard/?card=cat2"></sim>
</panel>
<panel w=600 h=300>
<pic src="pics/leit2.png" sx=600 sy=0></pic>
<words x=10 y=10 w=210>
La cara ara té un dibuix d'un gat (foto)
amb una frase en francès amb un buit (context: gramàtica)
sobre el meu gat de la infància, Stripes. (personal)
</words>
</panel>
<panel w=600 h=300>
<pic src="pics/leit2.png" sx=600 sy=300></pic>
<words x=10 y=10 w=210>
El dors ara té un símbol del gènere del nom (foto),
la seva pronunciació (so*),
i un avís de la versió femenina del nom. (context: argot)
</words>
<words w=330 x=250 y=225 no-bg fontsize=20>
* Òbviament les targetes de paper no tenen sons.
Però apps com Anki/Tinycards sí!
</words>
<audio controls style="position: absolute; top: 105px; left: 280px; transform: scale(0.4) rotate(4deg);">
<source src="audio/chat.mp3" type="audio/mpeg">
</audio>
</panel>
<panel w=450 h=90>
<words w=450 x=-15 no-bg>
Però la connexió <i>més</i> important de totes
és connectar el teu aprenentatge a alguna cosa...
</words>
</panel>
<panel w=600 h=150>
<pic src="pics/leit2.png" sx=0 sy=300></pic>
<words x=169 y=44 w=400 no-bg style="color:#fff; font-size:70px; text-align:left">
AMB SENTIT
</words>
</panel>
<panel w=500 h=350>
<pic src="pics/leit2.png" sx=450 sy=600></pic>
<words x=10 y=10 w=450 h=60 style="font-size: 23px">
Personalment, així es com millor he après:
Primer, intent (èmfasi en <i>intent</i>) <b>fer</b> alguna cosa.
</words>
<words x=11 y=113 w=160 no-bg class="comic_text">
tocar el ukelele
</words>
<words x=183 y=104 w=140 no-bg class="comic_text">
llegir còmics francesos
</words>
<words x=336 y=109 w=100 no-bg class="comic_text">
crear un joc web
</words>
</panel>
<panel w=500 h=350>
<pic src="pics/leit2.png" sx=950 sy=600></pic>
<words x=10 y=10 w=450 h=60>
Inevitablement, m'embussaré.
En aquest moment, buscaré el que necessiti,
i <b>aprendré</b> alguna cosa.
</words>
<words x=6 y=102 w=130 no-bg class="comic_text">
com es toca Fa#?
</words>
<words x=133 y=104 w=180 no-bg class="comic_text">
què significa "attraper"?
</words>
<words x=301 y=109 w=190 no-bg class="comic_text" style="font-size: 23px">
per què javascript és un tros de mer–
<!-- TRANSLATOR NOTE: again, don't complete the swear. have it cut out -->
</words>
</panel>
<panel w=600 h=300 bg="#e0e0e0">
<sim x=80 y=0 w=440 h=300 src="sims/singlecard/?card=learndo&forever_card=yes"></sim>
</panel>
<panel w=450 h=30>
<words w=450 x=-15 y=-15 no-bg>
I així.
</words>
</panel>
<panel w=450 h=400>
<pic src="pics/leit2.png" sx=450 sy=950></pic>
<words x=10 y=10 w=400 h=60>
Aquesta, crec, és la millor forma de mantenir-se motivat mentre s'aprèn:
</words>
<words x=10 y=300 w=400 h=60>
Assegurant-te que el teu aprenentatge ajuda a <i>realitzar alguna cosa que t'importa.</i>
</words>
</panel>
<panel w=600 h=90>
<words w=600 x=-15 no-bg>
Parlant d'aprendre, intentarem recordar el que hem après:
(aquesta és l'antepenúltima vegada!)
</words>
</panel>
<panel w=600 h=400 bg="#e0e0e0">
<sim x=0 y=0 w=600 h=400 src="sims/multicard/?cards=leit_d,sci_c,sci_a,sci_b"></sim>
</panel>
<panel w=400 h=400>
<pic src="pics/leit3.png" sx=0 sy=450></pic>
<words x=10 y=20 w=350 no-bg>
En la comunitat del R.E., el consens és que,
després d'un temps, <b>hauries de fer les teves pròpies targetes.</b>
</words>
<words x=33 y=140 w=230 no-bg>
Així, connectes dades al que <i>tu</i> coneixes, al que <i>a tu</i> t'agrada.
</words>
</panel>
<panel w=400 h=400>
<pic src="pics/leit3.png" sx=400 sy=450></pic>
<words x=10 y=15 w=300 no-bg>
Per això, en <i>l'última</i> part d'aquest còmic interactiu,
faràs les teves <i>pròpies</i> targetes!
</words>
<words x=30 y=165 w=170 no-bg style="font-size: 23px">
I aquestes targetes seran sobre...
</words>
</panel>
<panel w=400 h=400>
<pic src="pics/leit3.png" sx=800 sy=450></pic>
<words x=0 y=10 w=230 fontsize=150 no-bg color="#ffffff">
TU
</words>
</panel>
</div>
<!-- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -->
<!-- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -->
<!-- CHAPTER 3: GET STARTED TODAY! - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -->
<!-- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -->
<!-- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -->
<a name="3"></a>
<div class="divider divider_small_height">
<iframe class="splash" gotosrc="sims/splash/" scrolling="no"></iframe>
<div id="divider_container">
<div id="chapter_name">
<div>
COMENÇA AVUI!
</div>
</div>
<div id="chapter_links"></div>
</div>
</div>
<div class="comic">
<panel w=500 h=350>
<pic src="pics/end0.png" sx=0 sy=0></pic>
<words x=10 y=10 w=480 h=70 style="padding:13px 0px">
Per a ajudar-te a començar <i>avui</i> amb el Repàs Espaiat,
hauràs de respondre quatre preguntes:
</words>
<!--
TRANSLATOR NOTE:
Remember, if your translated word is too big, you can modify the CSS! (especially font-size)
-->
<words x=8 y=227 w=120 no-bg style="color:#fff; font-size:30px">
QUÈ?
</words>
<words x=100 y=252 w=150 no-bg style="color:#fff; font-size:30px">
PER QUÈ?
</words>
<words x=226 y=227 w=120 no-bg style="color:#fff; font-size:30px">
COM?
</words>
<words x=337 y=252 w=120 no-bg style="color:#fff; font-size:30px">
QUAN?
</words>
</panel>
<panel w="600" h="80">
<words w="600" x="-15" no-bg="">
Respondràs a aquestes preguntes fent targetes!
Aquí està la <i>cara</i> de la primera, la nostra primera pregunta:
</words>
</panel>
<panel w=500 h=250 bg="#e0e0e0">
<sim x=29 y=-20 w=440 h=300 src="sims/singlecard/?card=you_what&front_only=yes"
style="width: 440px; height: 300px; transform: scale(0.83,0.83) rotate(3deg);"></sim>
<img src="pics/fcard_frontonly.png" style="width:100%; height:100%; position:absolute; top:0; left:0;"/>
</panel>
<panel w=500 h=450>
<pic src="pics/end0.png" sx=500 sy=0></pic>
<words x=10 y=10 w=430 h=60>
Per exemple, pots usar Repàs Espaiat per a ajudar-te a aprendre...
</words>
<words x=120 y=104 w=100 style="text-align:left" no-bg class="comic_text">
un nou idioma
</words>
<words x=320 y=107 w=100 style="text-align:left" no-bg class="comic_text">
un nou instrument
</words>
<words x=115 y=195 w=100 style="text-align:left" no-bg class="comic_text">
programació
</words>
<words x=340 y=185 w=150 style="text-align:left" no-bg class="comic_text">
detalls de les vides dels teus amics
</words>
<words x=129 y=283 w=200 style="text-align:left" no-bg class="comic_text">
qualsevol cosa interessant!
</words>
<words x=389 y=290 w=100 style="text-align:left" no-bg class="comic_text">
tots els pokémon
</words>
<words x=80 y=380 w=380 h=30>
Ara, escriu <i>la teva</i> resposta en el dors:
</words>
</panel>
<panel w=600 h=350 bg="#e0e0e0">
<sim x=0 y=0 w=600 h=350 src="sims/type/?card=you_what"></sim>
</panel>
<panel fadeInOn="answer_edit_you_what" w="600" h="40" style="margin-bottom: -10px;">
<words w="600" x="-15" y="-10" no-bg="">
(nota: després pots tornar aquí i canviar la teva resposta)
</words>
</panel>
<panel w="600" h="80">
<words w="600" x="-15" no-bg="" style="font-size: 23px">
Però recorda't que perquè funcioni el Repàs,
necessites connectar-ho a alguna cosa que a tu t'importa <i></i>.
La següent pregunta és:
</words>
</panel>
<panel w=500 h=250 bg="#e0e0e0">
<sim x=29 y=-20 w=440 h=300 src="sims/singlecard/?card=you_why&front_only=yes"
style="width: 440px; height: 300px; transform: scale(0.83,0.83) rotate(3deg);"></sim>
<img src="pics/fcard_frontonly.png" style="width:100%; height:100%; position:absolute; top:0; left:0;"/>
</panel>
<panel w=500 h=450>
<pic src="pics/end0.png" sx=1000 sy=0></pic>
<words x=10 y=10 w=430 h=60>
Pot ser que sigui molt filosòfic, així que aquí tens
exemples amb el <i>què</i> i el <i>per què</i>:
</words>
<words x=130 y=105 w=350 style="text-align:left" no-bg class="comic_text">
<b>QUÈ:</b> un nou idioma
<br>
<b>PER QUÈ:</b> per a parlar a amics, família, parella, en el seu idioma natal
</words>
<words x=130 y=210 w=350 style="text-align:left" no-bg class="comic_text">
<b>QUÈ:</b> programació
<br>
<b>PER QUÈ:</b> per a guanyar diners
</words>
<words x=130 y=290 w=350 style="text-align:left" no-bg class="comic_text">
<b>QUÈ:</b> qualsevol cosa interessant
<br>
<b>PER QUÈ:</b> per curiositat!
</words>
<words x=210 y=380 w=250 h=30>
Quin és <i>el teu</i> "per què"?
</words>
</panel>
<panel w=600 h=350 bg="#e0e0e0">
<sim x=0 y=0 w=600 h=350 src="sims/type/?card=you_why"></sim>
</panel>
<panel w="600" h="80">
<words w="600" x="-15" no-bg="">
Ja tens el teu <strong>quin</strong> i el teu <strong>per què</strong>... però necessitem triar un <strong>com</strong>!
Quina eina o app vols usar?
La següent targeta diu:
</words>
</panel>
<panel w=500 h=250 bg="#e0e0e0">
<sim x=29 y=-20 w=440 h=300 src="sims/singlecard/?card=you_how&front_only=yes"
style="width: 440px; height: 300px; transform: scale(0.83,0.83) rotate(3deg);"></sim>
<img src="pics/fcard_frontonly.png" style="width:100%; height:100%; position:absolute; top:0; left:0;"/>
</panel>
<panel w=500 h=700>
<pic src="pics/end0.png" sx=0 sy=450></pic>
<words x=10 y=10 w=450 h=90>
Jo ara utilitzo
<a target="_blank" href="https://en.wikipedia.org/wiki/Leitner_system">La Capsa Leitner</a>,
però els meus amics utilitzen
<a target="_blank" href="https://apps.ankiweb.net/">Anki</a>,
i durant un temps vaig utilitzar
<a target="_blank" href="https://tinycards.duolingo.com/">TinyCards</a>.
Així és com es comparen:
</words>
<words x=160 y=140 w=300 fontsize=21 style="text-align:left" no-bg>
<b>Capsa Leitner</b>
<br>
El bo: manualitat, fàcil d'usar
<br>
El dolent: no tan portàtil com una app
</words>
<words x=160 y=275 w=300 fontsize=21 style="text-align:left" no-bg>
<b>Anki (app)</b>
<br>
El bo: comunitat enorme, codi obert, moltes funcions potents
<br>
El dolent: una mica lletja
</words>
<words x=160 y=405 w=300 fontsize=21 style="text-align:left" no-bg>
<b>TinyCards (app)</b>
<br>
El bo: disseny preciós, fàcil d'usar
<br>
El dolent: màxim de 150 targetes per baralla, no <i>et</i> deixa decidir si vas encertar
</words>
<words x=10 y=530 w=450 h=60>
(Prefereixes una altra cosa?
Altres eines:
<a target="_blank" href="https://www.supermemo.com/">SuperMemo</a>,
<a target="_blank" href="https://www.nimblenotes.com/">NimbleNotes</a>,
<a target="_blank" href="https://mnemosyne-proj.org/">Mnemosyne</a>)
</words>
<words x=110 y=620 w=360 h=40 no-bg fontsize=20>
* <i>anti</i>-avís: <i>no</i> estic afiliat amb cap d'aquestes.
només crec que són bones i útils!
</words>
</panel>
<panel w=600 h=50>
<words w=600 x=-15 no-bg>
Així que, quin serà?
</words>
</panel>
<panel w=600 h=350 bg="#e0e0e0">
<sim x=0 y=0 w=600 h=350 src="sims/type/?card=you_how"></sim>
</panel>
<panel w=500 h=450>
<pic src="pics/end0.png" sx=500 sy=450></pic>
<words x=10 y=10 w=430 h=90>
Només queda una targeta!
En veritat, fer R.E. és bastant fàcil...
però fer-ho <i>com un hàbit diari</i> és difícil.
</words>
<words x=60 y=355 w=400 h=30 no-bg>
Per què? Perquè agafar impuls en <i>qualsevol</i> hàbit nou és difícil.
</words>
</panel>
<panel w=500 h=550>
<pic src="pics/end0.png" sx=1000 sy=450></pic>
<words x=10 y=10 w=430 h=90>
Difícil, però simple.
La ciència dels hàbits mostra que si fas el mateix, donada el mateix senyal,
constantment...
</words>
<words x=0 y=153 w=170 no-bg class="comic_text smaller">
passa un bon dia!
</words>
<words x=72 y=188 w=80 no-bg class="comic_text smaller">
gràcies, igualment!
</words>
<words x=221 y=150 w=170 no-bg class="comic_text smaller">
bones festes!
</words>
<words x=309 y=185 w=80 no-bg class="comic_text smaller">
gràcies, igualment!
</words>
<words x=2 y=300 w=170 no-bg class="comic_text smaller">
aquí tens el canvi!
</words>
<words x=74 y=335 w=80 no-bg class="comic_text smaller">
gràcies, igualment!
</words>
<words x=20 y=450 w=440 h=60>
...es farà un hàbit, per a bé o per a mal.
Per a l'hàbit de E.R., la nostra pregunta és:
</words>
</panel>
<panel w=500 h=250 bg="#e0e0e0">
<sim x=29 y=-20 w=440 h=300 src="sims/singlecard/?card=you_when&front_only=yes"
style="width: 440px; height: 300px; transform: scale(0.83,0.83) rotate(3deg);"></sim>
<img src="pics/fcard_frontonly.png" style="width:100%; height:100%; position:absolute; top:0; left:0;"/>
</panel>
<panel w=500 h=450>
<pic src="pics/end0.png" sx=0 sy=1150></pic>
<words x=10 y=10 w=400 h=60>
Per exemple, podries jugar el joc de Repàs Espaiat...
</words>
<words x=4 y=233 w=130 no-bg class="comic_text">
quan et despertes
</words>
<words x=167 y=233 w=130 no-bg class="comic_text">
al tren o bus
</words>
<words x=335 y=233 w=130 no-bg class="comic_text">
abans de dormir
</words>
<words x=30 y=320 w=430 h=90>
No importa molt <i>quan</i> ho facis, mentre ho facis
diàriament (més o menys, pots saltar-te un dia de tant en tant).
</words>
</panel>
<panel w=400 h=500>
<pic src="pics/end0.png" sx=500 sy=1150></pic>
<words x=10 y=10 w=350 h=90>
(Consell: quan vull crear un hàbit nou,
dibuixo un cercle en un calendari per cada dia que el faci)
</words>
<words x=10 y=370 w=350 h=90>
(És un joc que faig amb mi mateix! L'objectiu és no trencar
la ratxa, i fer la cadena més llarga que pugui.)
</words>
</panel>
<panel w=600 h=50>
<words w=600 x=-15 no-bg>
Ara, ompliu aquesta última targeta:
</words>
</panel>
<panel w=600 h=350 bg="#e0e0e0">
<sim x=0 y=0 w=600 h=350 src="sims/type/?card=you_when"></sim>
</panel>
<panel w=400 h=80>
<words w=400 x=-15 no-bg>
I aquí estan els teus quatre noves targetes, totes elles sobre tu!
</words>
</panel>
<panel w=264 h=180 bg="#e0e0e0">
<sim x=-88 y=-60 w=440 h=300 src="sims/singlecard/?card=you_what&refresh=yes" class="small_card"></sim>
</panel>
<panel w=264 h=180 bg="#e0e0e0">
<sim x=-88 y=-60 w=440 h=300 src="sims/singlecard/?card=you_why&refresh=yes" class="small_card"></sim>
</panel>
<panel w=264 h=180 bg="#e0e0e0">
<sim x=-88 y=-60 w=440 h=300 src="sims/singlecard/?card=you_how&refresh=yes" class="small_card"></sim>
</panel>
<panel w=264 h=180 bg="#e0e0e0">
<sim x=-88 y=-60 w=440 h=300 src="sims/singlecard/?card=you_when&refresh=yes" class="small_card"></sim>
</panel>
<br><br>
<panel w=500 h=250>
<pic src="pics/end1.png" sx=0 sy=0></pic>
<words x=180 y=10 w=250 no-bg style="font-size: 23px">
Però com vaig dir, vull<br> que prenguis control de la teva memòria <i>avui</i>.
</words>
<words x=230 y=130 w=250 no-bg style="font-size: 23px">
No "algun dia", no "demà", <i>AVUI</i>.
</words>
</panel>
<panel w=500 h=250>
<pic src="pics/end1.png" sx=0 sy=250></pic>
<words x=150 y=10 w=120 no-bg>
per a ajudar-te...
</words>
<words x=270 y=95 w=170 no-bg>
baixarem unes
<b style="font-size:30px">
COSETES BONIQUES
</b>
</words>
</panel>
<panel w=600 h=90>
<words x=-15 y=0 w=600 no-bg style="text-align:left" fontsize=30>
<img src="pics/gift.png" style="height:1em"/>
<b>PRIMER:</b>
<span id="gift_wallpaper"></span>
per a recordar-te jugar a Repàs Espaiat diàriament!
</words>
</panel>
<div>
<a target="_blank" id="wallpaper_link">
<img id="wallpaper_image"/><br>
(fes clic per a descarregar ↓)
</a>
</div>
<panel w=600 h=90 style="height: auto; position: relative; left: -15px;">
<words x=-15 y=0 w=570 no-bg style="text-align:left; position:static" fontsize=30>
<img src="pics/gift.png" style="height:1em"/>
<b>SEGON:</b>
<span id="gift_app"></span>
</words>
</panel>
<panel class="not_on_mobile" w=600 h=90>
<words x=-15 y=0 w=600 no-bg style="text-align:left" fontsize=30>
<img src="pics/gift.png" style="height:1em"/>
I finalment,
<b>TERCER:</b>
un .*zip de totes les targetes amb les quals has practicat en aquest còmic!
</words>
</panel>
<panel class="not_on_mobile" w=400 h=100>
<sim x=0 y=0 w=400 h=100 src="sims/downloads/all.html"></sim>
</panel>
<panel class="not_on_mobile" w=600 h=120>
<words x=-15 y=0 w=600 no-bg style="text-align:left">
(Aquestes poden ser les targetes dels primers dies de Repàs Espaiat,
per a ajudar-te a començar! Com a extra, aconseguiràs recordar tot el que
vas aprendre avui, gairebé per sempre.)
</words>
</panel>
<panel w=500 h=350>
<pic src="pics/end1.png" sx=500 sy=0></pic>
<words x=110 y=30 w=250 no-bg>
El que em recorda...
</words>
<words x=200 y=105 w=220 no-bg>
un últim adéu,
pels vells temps,
el cant del cigne!
</words>
<words x=210 y=230 w=250 no-bg>
...repassem les targetes, <i>totes</i> elles:
</words>
</panel>
<panel w=600 h=400 bg="#e0e0e0">
<sim x=0 y=0 w=600 h=400 src="sims/multicard/?final=yes&cards=intro_a,sci_a,leit_a,you_what,intro_b,sci_b,leit_b,you_why,sci_c,leit_c,you_how,leit_d,you_when,intro_c"></sim>
</panel>
<panel w=240 h=300>
<pic src="pics/end1.png" sx=0 sy=500></pic>
<words x=0 y=12 w=210 no-bg>
*Sniff...
Sempre em costa dir adéu...
</words>
</panel>
<panel w=240 h=300>
<pic src="pics/end1.png" sx=240 sy=500></pic>
<words x=-20 y=-10 no-bg fontsize=120 color="rgba(0,0,0,0.5)" style="transform:rotate(10deg)">
PRRF
</words>
</panel>
<panel w=500 h=250>
<pic src="pics/end1.png" sx=480 sy=500></pic>
<words x=160 y=30 w=200 no-bg style="font-size: 23px">
Trobaré a faltar aquesta estona junts...
</words>
<words x=200 y=120 w=250 no-bg>
...però espero que ens continuem recordant!
</words>
</panel>
<panel w=500 h=350>
<pic src="pics/end1.png" sx=0 sy=800></pic>
<words x=10 y=10 w=430 h=90>
Si ets estudiant, espero que el Repàs Espaiat
t'ajudi a prendre les regnes del teu aprenentatge.
</words>
</panel>
<panel w=500 h=350>
<pic src="pics/end1.png" sx=500 sy=800></pic>
<words x=10 y=10 w=430 h=90>
Si ets docent,
si us plau, <i>si us plau</i>, explica-li als teus estudiants sobre el Repàs Espaiat
(i altres hàbits d'estudi útils) aviat.
</words>
</panel>
<panel w=500 h=350>
<pic src="pics/end1.png" sx=1000 sy=800></pic>
<words x=10 y=10 w=430 h=90>
Però siguis estudiant o no, espero que
el Repàs Espaiat t'ajudi a desenvolupar la teva memòria, la teva ment, la teva Musa...
</words>
<words x=168 y=147 w=250 no-bg class="comic_text smaller" style="color:#fff">
"no!" va cridar el mitocondri, segons baixava per la gola càlida i humida de la cèl·lula. "jo no-
</words>
</panel>
<panel w=500 h=550>
<pic src="pics/end1.png" sx=1000 sy=0></pic>
<words x=30 y=30 w=250 no-bg>
...i aprendre un dels grans amors de la vida:
</words>
<words x=120 y=455 w=300 style="text-align:right" no-bg>
un amor durador per aprendre.
</panel>
<panel w=600 h=300 bg="#e0e0e0">
<sim x=80 y=0 w=440 h=300 src="sims/singlecard/?card=the_end"></sim>
</panel>
<panel fadeInOn="flip_the_end" w=600 h=80>
<words w=600 x=-15 y=0 no-bg>
(Vols aprendre més? Crèdits i més informació a baix!)
<br>
↓ ↓ ↓ ↓ ↓
</b>
</words>
</panel>
</div>
<!-- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -->
<!-- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -->
<!-- CREDITS - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -->
<!-- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -->
<!-- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -->
<a name="bye"></a>
<div id="credits">
<div>
<div style="font-size:30px; margin-bottom:0; overflow: hidden;">
<img src="pics/nicky_credits.png" width="100" height="100" style="display: block; float: left;" />
<div style="display: block; position: relative; left: 14px; width: 390px; height: 130px; float: left;">
Escrit, dibuixat i programat per
<br>
<a target="_blank" href="https://ncase.me" style="font-size:2em; display:inline-block; line-height:1em">
Nicky Case
</a>
<br>
<span id="translation_credits_2"></span>
<!-- TRANSLATOR NOTE: again, when you fill in translations.txt, your name will appear here! -->
</div>
</div>
<p style="margin-top:0">
A més, aquest còmic interactiu és
<span style="display:block; margin-top:5px;">
<svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" version="1.1" id="Layer_1" x="0px" y="0px" width="64px" height="64px" viewBox="-0.5 0.5 64 64" enable-background="new -0.5 0.5 64 64" xml:space="preserve">
<g>
<circle fill="#000000" cx="31.325" cy="32.873" r="30.096"/>
<path fill="#FFFFFF" id="text2809_1_" d="M31.5,14.08c-10.565,0-13.222,9.969-13.222,18.42c0,8.452,2.656,18.42,13.222,18.42 c10.564,0,13.221-9.968,13.221-18.42C44.721,24.049,42.064,14.08,31.5,14.08z M31.5,21.026c0.429,0,0.82,0.066,1.188,0.157 c0.761,0.656,1.133,1.561,0.403,2.823l-7.036,12.93c-0.216-1.636-0.247-3.24-0.247-4.437C25.808,28.777,26.066,21.026,31.5,21.026z M36.766,26.987c0.373,1.984,0.426,4.056,0.426,5.513c0,3.723-0.258,11.475-5.69,11.475c-0.428,0-0.822-0.045-1.188-0.136 c-0.07-0.021-0.134-0.043-0.202-0.067c-0.112-0.032-0.23-0.068-0.336-0.11c-1.21-0.515-1.972-1.446-0.874-3.093L36.766,26.987z"/>
<path fill="#FFFFFF" id="path2815_1_" d="M31.433,0.5c-8.877,0-16.359,3.09-22.454,9.3c-3.087,3.087-5.443,6.607-7.082,10.532 C0.297,24.219-0.5,28.271-0.5,32.5c0,4.268,0.797,8.32,2.397,12.168c1.6,3.85,3.921,7.312,6.969,10.396 c3.085,3.049,6.549,5.399,10.398,7.037c3.886,1.602,7.939,2.398,12.169,2.398c4.229,0,8.34-0.826,12.303-2.465 c3.962-1.639,7.496-3.994,10.621-7.081c3.011-2.933,5.289-6.297,6.812-10.106C62.73,41,63.5,36.883,63.5,32.5 c0-4.343-0.77-8.454-2.33-12.303c-1.562-3.885-3.848-7.32-6.857-10.33C48.025,3.619,40.385,0.5,31.433,0.5z M31.567,6.259 c7.238,0,13.412,2.566,18.554,7.709c2.477,2.477,4.375,5.31,5.67,8.471c1.296,3.162,1.949,6.518,1.949,10.061 c0,7.354-2.516,13.454-7.506,18.33c-2.592,2.516-5.502,4.447-8.74,5.781c-3.2,1.334-6.498,1.994-9.927,1.994 c-3.468,0-6.788-0.653-9.949-1.948c-3.163-1.334-6.001-3.238-8.516-5.716c-2.515-2.514-4.455-5.353-5.826-8.516 c-1.333-3.199-2.017-6.498-2.017-9.927c0-3.467,0.684-6.787,2.017-9.949c1.371-3.2,3.312-6.074,5.826-8.628 C18.092,8.818,24.252,6.259,31.567,6.259z"/>
</g>
</svg>
<span style="font-size: 60px; position: relative; top: -12px; left: 8px;">
DOMINI PÚBLIC
</span>
</span>
pel que pots utilitzar-ho amb propòsits educatius, personals, o fins i tot comercials.
Ja tens el meu permís!
<a target="_blank" href="https://github.com/ncase/remember">
(Descarregar el codi)</a>
<a target="_blank" href="https://github.com/ncase/remember#how-to-translate">
(Tradueix aquest còmic)</a>
</p>
<p>
No obstant això, només puc fer això gràcies als meus més de 100 patrons.
Em deixen continuar fent el que estimo. Gràcies! 💖
<a target="_blank" href="https://www.patreon.com/ncase">
(Vols unir-te? Fes *clic aquí!)
</a>
</p>
<hr>
<p style="font-size:50px;margin-bottom:10px">
Lectures Addicionals
</p>
<p>
*Nosequé a lloms de gegants...
Aquí tens les lectures que van fer de Repàs Espaiat una part de la meva vida:
</p>
<ul>
<li>
🤓
<a target="_blank" href="http://augmentingcognition.com/ltm.html">
Augmenting Long-Term Memory</a>
de Michael Nielsen
em va mostrar que el Repàs Espaiat no és només una eina de memorització,
ho és per a crear enteniment profund. Podria ser fins i tot una forma <i>de viure</i>.
</li>
<li>
💬
<a target="_blank" href="https://fluent-forever.com/the-book/">
Fluent Forever</a>
de Gabriel Wyner
em va convèncer per fi a començar (de nou) a aprendre francès,
i crear la Capsa Leitner. (*vaig adaptar el meu calendari de 64 dies d'aquest llibre)
</li>
<li>
🃏
<a target="_blank" href="https://www.supermemo.com/en/articles/20rules">
20 Rules for Cards</a>
de Piotr Wozniak em va ensenyar com treure el màxim partit al Repàs Espaiat.
(Nota: l'autor també va inventar l'algoritme que utilitza Anki!)
</li>
</ul>
I les meves lectures favorites sobre la ciència de l'aprenentatge:
<ul>
<li>
👩🎓
<a target="_blank" href="https://www.amazon.com/Why-Dont-Students-Like-School/dp/047059196X/">
Why Don't Students Like School?</a>
de Daniel Willingham
em va demostrar que la "memorització a seques" és realment <i>necessària</i>
per a la creativitat i el pensament crític.
</li>
<li>
✏️
<a target="_blank" href="http://web.archive.org/web/20190711014620/http://tlcp.depaultla.org/wp-content/uploads/sites/2/2015/05/Dunlosky-et-al-2013-What-Works-What-Doesnt.pdf">
What Works, What Doesn't [PDF]
</a>
de Dunlosky et al
fa un resum de <i>més de 200 estudis</i> sobre diversos mètodes d'aprenentatge.
En resum: tècniques comunes com rellegir o subratllar no funcionen,
tècniques menys comunes com espaiar i acte-avaluar-se sí.
<a target="_blank" href="http://journals.sagepub.com/doi/abs/10.1177/1529100612453266">
(Enllaç al text original)
</a>
</li>
</ul>
<p>
I si vols aprendre més coses jugant,
<a target="_blank" href="https://explorabl.es/">
dóna-hi un cop d'ull a Explorable Explanations!</a> 🕹️
</p>
<hr>
<p style="font-size:50px;margin-bottom:10px">
Més agraïments
</p>
<p>
👀 Gràcies a tots els meus jugadors de prova per fer que aquest projecte no sigui dolent:
<span style="font-size: 19px; line-height: 0px; color: #999;">
Aatish Bhatia, Adam Filinovich, Aimee Jarboe, Alex Jaffe, Amit Patel, Andy Matuschak, B Cavello, Chris Walker, Frank Lantz, Gal Green, Glen Chiacchieri, Hamish Todd, Henry Reich, Jacque Goupil, James Lytle,
Jez Swanson, Josh Comeau, Kayle Sawyer, Levi Robertson, Marcelo Gallardo, Martyna Wasiluk, Michael Nielsen, Mikayla Hutchinson, Mike Gifford, Monica Srivastava, Owen Landgren,
Paul Butler, Paul Simeon, Philipp Wacker, Pontus Granström, Rowan, Sebastian Morr, SpacieCat, Tanya Short, Tim & Alexandra Swast, Tom Hermans, Toph Tucker, Will Harris-Braun, Zeno Rogue
</span>
</p>
<p>
📹 Gràcies a Chris Walker per fer el
<a target="_blank" href="https://www.youtube.com/watch?v=uvF1XuseZFE">
vídeo de creació de la Capsa Leitner!</a>
(Per cert:
<a target="_blank" href="http://polytrope.com/">
Chris fa coses interactives</a>
també!)
</p>
<p>
🐞 Gràcies a Omar Rizwan per ajudar-me a arreglar al pou sense fons d'errors en Safari Mobile
</p>
<p>
🔊 Aquest projecte s'ha fet amb recursos de *Creative *Commons
de Wikimedia Commons i FreeSounds.
<a target="_blank" href="https://github.com/ncase/remember#full-asset-credits">
(Veure tots els crèdits)</a>
</p>
<p>
💖 I insisteixo, gràcies als seguidors de *Patreon per fer això possible:
</p>
<iframe gotosrc="supporters/"></iframe>
<p>
🙏 I finalment, gràcies a <i>tu</i> per ser el tipus de persona que llegeix els crèdits!
Pots
<a target="_blank" href="https://ncase.me/">
jugar a més coses meves</a>,
<a target="_blank" href="https://twitter.com/ncasenmare">
seguir-me en Twitter</a>,
o
<a target="_blank" href="https://www.patreon.com/ncase">
donar-me suport a Patreon</a>.
Espero sincerament que aquest còmic t'hagi pogut ajudar, de qualsevol manera.
</p>
<p>
Feliç aprenentatge!<br>
~ Nicky Case
</p>
<!-- Share buttons, text generated from labels -->
<div id="share_buttons"></div>
</div>
</div>
<!--
TRANSLATOR NOTE:
HA HA YOU THOUGHT YOU WERE DONE?!
NOPE
WE'VE STILL GOT THE INTERFACE LABELS & FLASHCARDS TO TRANSLATE
-->
<!-- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -->
<!-- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -->
<!-- LABELS - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -->
<!-- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -->
<!-- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -->
<div id="labels">
<!-- Chapter Links -->
<span id="label_chapter_links">
<a href="#0">Introducció</a>
·
<a href="#1">La Ciència</a>
·
<a href="#2">L'Art</a>
·
<a href="#3">Comença!</a>
·
<a href="#bye">Crèdits</a>
</span>
<!-- Multi Card Labels -->
<span id="multicard_q">
intenta recordar-ho ↑
i dóna-li la volta ↻
</span>
<span id="multicard_cards_left">
(queden [N] cartes)
</span>
<span id="multicard_a">
t'ho recordaves?
</span>
<span id="multicard_no">
no, una altra cop
</span>
<span id="multicard_yes">
sí, seguim!
</span>
<span id="multicard_done">
tot llest! continua llegint
<br>
↓
</span>
<span id="multicard_done_2">
això és tot, amics!
<br>
↓
</span>
<!-- Ebbinghaus Simulation -->
<span id="ebbinghaus_y_axis">
força de la memòria →
</span>
<span id="ebbinghaus_x_axis">
temps →
</span>
<span id="ebbinghaus_decay">
velocitat:
</span>
<span id="ebbinghaus_forgetting">
<span style="font-size:20px">punt òptim:</span>
</span>
<span id="ebbinghaus_recall">
quan es fa el repàs:
</span>
<span id="ebbinghaus_recalls">
quan es fan els repassos:
</span>
<span id="ebbinghaus_auto">
auto-optimitzar!
</span>
<!-- Leitner Calendar -->
<!--
TRANSLATOR NOTE:
The exact three characters [N] is how the code knows where to put the number.
When you translate, make sure the [N] is there if it was there in the original.
-->
<span id="calendar_day">
En el dia número [N]...
</span>
<span id="calendar_review">
repassar Nivells [N] (<i>en aquest ordre</i>)
</span>
<span id="calendar_loop">
(i després tornem al dia 1!)
</span>
<!-- Leitner Box simulation -->
<span id="leitner_day">
Dia [N]
</span>
<span id="leitner_step_to_review">
repassar: Nivell
</span>
<span id="leitner_step_reviewing">
repassar Nivell [N]
</span>
<span id="leitner_step_new">
afegir [N] targetes noves
</span>
<span id="leitner_step_stats">
total: ¡[N] targetes!
</span>
<span id="leitner_step_stats_2">
([N] retirades)
</span>
<span id="leitner_button_next_step">
següent pas
</span>
<span id="leitner_button_next_day">
seg. dia
</span>
<span id="leitner_button_next_week">
seg. setmana
</span>
<span id="leitner_button_next_month">
seg. mes
</span>
<span id="leitner_slider_new">
[N] targetes noves al dia
</span>
<span id="leitner_slider_wrong">
<i>fallar</i> el [N]% de targetes
</span>
<span id="leitner_reset">
REINICIAR
</span>
<!-- Typing Cards -->
<span id="type_question">
Pregunta:
<!--
TRANSLATOR NOTE: "Q" short for Question.
Dunno if other languages have similar one-letter abbreviations.
If not, just type the full translated word for "Question"
-->
</span>
<span id="type_placeholder">
aquí la teva resposta
</span>
<span id="type_suggestions">
o tria un d'aquests:
</span>
<!-- Suggestions -->
<span id="you_what_suggestions">
<li>Una cosa interessant!</li>
<li>Un llenguatge</li>
<li>Música</li>
<li>Programació</li>
<li>(un altre)</li>
</span>
<span id="you_why_suggestions">
<li>Pels qui vull</li>
<li>Pel meu benefici</li>
<li>Per la meva curiositat</li>
<li>(un altre)</li>
</span>
<span id="you_how_suggestions">
<li>Capsa Leitner</li>
<li>Anki</li>
<li>TinyCards</li>
<li>(un altre)</li>
</span>
<span id="you_when_suggestions">
<li>Al matí</li>
<li>Al tren/bus/metro</li>
<li>A la nit</li>
<li>(un altre)</li>
</span>
<!-- Gifts -->
<span id="gift_wallpaper_what">
QUÈ:
</span>
<span id="gift_wallpaper_why">
PER QUÈ:
</span>
<span id="gift_wallpaper_do_1">
FES-
</span>
<span id="gift_wallpaper_do_2">
ME!
</span>
<span id="gift_wallpaper_filename">
fons de pantalla
</span>
<span id="gift_wallpaper_desktop">
un fons de pantalla,
</span>
<span id="gift_wallpaper_phone">
un fons per al mòbil,
</span>
<span id="gift_app_leitner">
un vídeo (en anglès) del meu amic Chris Walker, de com fer la teva pròpia Capsa Leitner!
<br><br>
<iframe width="560" height="315" src="https://www.youtube-nocookie.com/embed/uvF1XuseZFE?rel=0"
frameborder="0" allow="autoplay; encrypted-media" allowfullscreen
style="display:block; margin:0 auto"></iframe>
<br>
(I aquí hi ha un tutorial semblant, a l'estil IKEA:)
<br><br>
<a target="_blank" href="./pdf/leitner.pdf" style="display: block; text-align: center;">
<img src="./pdf/thumbnail.png" width="450"/><br>clic per descarregar el PDF</a>
</span>
<span id="gift_app_anki">
un enllaç per a
<a target="_blank" href="https://apps.ankiweb.net/">descarregar Anki!</a>
I aquí hi ha un tutorial de com usar-lo:
<br><br>
<iframe width="560" height="315" src="https://www.youtube-nocookie.com/embed/sQkdB3cJwn0?start=180&rel=0"
frameborder="0" allow="autoplay; encrypted-media" allowfullscreen
style="display:block; margin:0 auto"></iframe>
</span>
<span id="gift_app_tiny">
un enllaç a
<a target="_blank" href="https://tinycards.duolingo.com/">
TinyCards!</a>
(recomano mirar els seus
<a target="_blank" href="https://tinycards.duolingo.com/users/TinyGeo">
baralles geogràfiques</a>)
</span>
<span id="gift_app_other">
enllaços a tutorials per a crear una Capsa Leitner
<a target="_blank" href="https://www.youtube.com/watch?v=uvF1XuseZFE">
[vídeo]</a>
<a target="_blank" href="./pdf/leitner.pdf">
[pdf]</a>,
<a target="_blank" href="https://apps.ankiweb.net/">
la app Anki</a>,
i
<a target="_blank" href="https://tinycards.duolingo.com/">
TinyCards</a>!
</span>
<!-- Downloading Cards -->
<span id="download_all">
DESCARREGAR TARGETES
</span>
<span id="download_all_downloading">
DESCARREGANT...
</span>
<span id="download_all_done">
FET! Mira la teva carpeta de Descàrregues.
</span>
<!-- Social Sharing -->
<span id="share_title">
Com Recordar Tot Gairebé Per Sempre
</span>
<span id="share_desc">
un còmic interactiu sobre art i ciència de la memòria
</span>
<!--
TRANSLATOR NOTE:
One more section to go!
-->
<!-- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -->
<!-- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -->
<!-- FLASHCARDS - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -->
<!-- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -->
<!-- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -->
<!--
TRANSLATOR NOTE:
The CSS for the flashcards is really touchy, so DO NOT MODIFY THE CSS.
That means, try as much as possible to make your text shorter or the same length as the original text.
Good luck!
-->
<!-- - - - - - - - - - - - -->
<!-- INTRO - - - - - - - - -->
<!-- - - - - - - - - - - - -->
<span id="flashcard_spaced_rep_front">
<div class="fcard_center" style="height:2.5em">
i el nom d'aquest joc és...
</div>
</span>
<span id="flashcard_spaced_rep_back">
<div class="fcard_bg" src="pics/fcards_intro.png" sx=0 sy=0></div>
<div class="fcard_center" style="color:white; font-size:74px; height:1.6em; line-height:0.8em;">
REPÀS ESPAIAT
</div>
</span>
<span id="flashcard_intro_a_front">
<div id="fc_words" class="fcard_center" style="height:2.5em">
Repàs Espaiat = <span class="underline">____</span> + <span class="underline">____</span>
</div>
</span>
<span id="flashcard_intro_a_back">
<div class="fcard_bg" src="pics/fcards_intro.png" sx=0 sy=240></div>
<div id="fc_words" class="fcard_center" style="height:2.5em">
proves + temps
</div>
</span>
<span id="flashcard_intro_b_front">
<div id="fc_words" class="fcard_center" style="height:4.5em">
3 tècniques d'aprenentatge comuns però inefectives són...
</div>
</span>
<span id="flashcard_intro_b_back">
<div id="fc_words" class="fcard_center" style="height:2.2em">
...classes, covar i rellegir
</div>
</span>
<span id="flashcard_intro_c_front">
<div id="fc_words" class="fcard_center" style="height:4.4em">
En la mitologia grega,
la deessa de <span class="underline">____</span>
era la mare de les deesses de
<span class="underline">________</span>
</div>
</span>
<span id="flashcard_intro_c_back">
<div class="fcard_bg" src="pics/fcards_intro.png" sx=400 sy=0></div>
<div id="fc_words" style="position: absolute; width:250px; top:50px; left:140px; line-height:1.1em;">
Memòria és la mare d'Inspiració
</div>
</span>
<!-- - - - - - - - - - - - -->
<!-- CHAPTER 1: The Science -->
<!-- - - - - - - - - - - - -->
<span id="flashcard_guessgap_front">
<div class="fcard_center" style="height:2.5em">
la millor forma de repartir els repassos és...
</div>
</span>
<span id="flashcard_guessgap_back">
<div class="fcard_bg" src="pics/fcards0.png" sx=0 sy=0></div>
<div class="fcard_center" style="height:2.5em">
¡amb trossos <i>creixents</i>!
</div>
</span>
<span id="flashcard_sci_a_front">
<div id="fc_words" class="fcard_center" style="height:3.5em">
El pioner en ciència experimental de la memòria és...
</div>
</span>
<span id="flashcard_sci_a_back">
<div class="fcard_bg" src="pics/fcards0.png" sx=400 sy=0></div>
<div id="fc_words" style="position: absolute; width: 250px; top: 60px; left:150px; line-height: 1.1em;">
Hermann Ebbinghaus
</div>
</span>
<span id="flashcard_sci_b_front">
<div id="fc_words" class="fcard_center" style="height:3.4em">
La Corba de l'Oblit (<i>sense</i> repassos) té una forma...
</div>
</span>
<span id="flashcard_sci_b_back">
<div class="fcard_bg" src="pics/fcards0.png" sx=0 sy=240></div>
<div id="fc_words" style="position: absolute; width: 280px; top: 70px; left: 100px; font-size:20px; line-height: 1.1em;">
(nota: baixa ràpid i després lent, "reducció exponencial")
</div>
</span>
<span id="flashcard_sci_c_front">
<div id="fc_words" class="fcard_center" style="height:3.4em">
La Corba de l'Oblit (<i>amb</i> repassos ben separats) té una forma...
</div>
</span>
<span id="flashcard_sci_c_back">
<div class="fcard_bg" src="pics/fcards0.png" sx=400 sy=240></div>
<div id="fc_words" style="position: absolute; width: 360px; top: 120px; left: 20px; font-size:20px; line-height: 1.1em;">
(nota: els trossos entre repassos <i>creixen</i> en longitud)
</div>
</span>
<!-- - - - - - - - - - - - -->
<!-- Chapter 2: The Art - - -->
<!-- - - - - - - - - - - - -->
<span id="flashcard_leit_a_front">
<div id="fc_words" class="fcard_center" style="height:4.5em">
En la Capsa Leitner, <span class="underline">______</span>
el tros (nº de dies entre repassos) per cada Nivell
</div>
</span>
<span id="flashcard_leit_a_back">
<div class="fcard_bg" src="pics/fcards_ch2.png" sx=0 sy=720 style="left:-5px"></div>
<div id="fc_words" class="fcard_center" style="height:110px">
dupliquem el tros
</div>
</span>
<span id="flashcard_leit_b_front">
<div id="fc_words" class="fcard_center" style="height:4.5em">
La Capsa Leitner:
<br>
quan <i>encertes</i> una targeta, la mous <span class="underline">______</span> .
</div>
</span>
<span id="flashcard_leit_b_back">
<div class="fcard_bg" src="pics/fcards_ch2.png" sx=0 sy=480></div>
<div id="fc_words" class="fcard_center" style="height:170px">
al següent Nivell
</div>
</span>
<span id="flashcard_leit_c_front">
<div id="fc_words" class="fcard_center" style="height:4.5em">
La Capsa Leitner:
<br>
quan <i>falles</i> una targeta, la tornas<span class="underline">______</span> .
</div>
</span>
<span id="flashcard_leit_c_back">
<div class="fcard_bg" src="pics/fcards_ch2.png" sx=400 sy=480></div>
<div id="fc_words" class="fcard_center" style="height:180px">
al Nivell 1!
</div>
</span>
<span id="flashcard_leit_d_front">
<div id="fc_words" class="fcard_center" style="font-size:30px; height:170px;">
Segons un comic interactiu en internet,
les meves targetes de Repàs Espaiat han de ser
<span class="underline">______</span> ,
<span class="underline">______</span> , i
<span class="underline">______</span> .
</div>
</span>
<span id="flashcard_leit_d_back">
<div class="fcard_bg" src="pics/fcards_ch2.png" sx=400 sy=720></div>
<div id="fc_words" class="fcard_center" style="color:#fff; height:200px; height: 180px; font-size: 25px;">
petites, connectades i amb sentit
</div>
</span>
<span id="flashcard_mitochondria_all_front">
<div class="fcard_bg" src="pics/fcards_ch2.png" sx=0 sy=960></div>
<div class="fcard_center" style="height:160px;">
Què és això?
</div>
</span>
<span id="flashcard_mitochondria_all_back">
<div class="fcard_center" style="height:220px; font-size:20px;">
Aquest orgànul es diu "mitocondri".
El mitocondri és el motor de la cèl·lula.
Es troben en gairebé tots els organismes eucariotes (amb nucli).
La hipòtesi més acceptada sobre l'origen del mitocondri és la Teoria Endosimbiòtica:
fa uns 1500 milions d'anys, una cèl·lula procariota (sense nucli) va sobreviure al fet que se la "mengés"
una altra cèl·lula, i ha continuat vivint dins d'ella des de llavors.
</div>
</span>
<span id="flashcard_mitochondria_1_front">
<div class="fcard_bg" src="pics/fcards_ch2.png" sx=0 sy=960></div>
<div class="fcard_center" style="height:160px;">
Què és això?
</div>
</span>
<span id="flashcard_mitochondria_1_back">
<div class="fcard_center" style="height:1.5em;">
Mitocondri
</div>
</span>
<span id="flashcard_mitochondria_2_front">
<div class="fcard_bg" src="pics/fcards_ch2.png" sx=400 sy=960></div>
<div class="fcard_center" style="height:180px">
El mitocondri és <span class="underline">el _______</span> de la cèl·lula
</div>
</span>
<span id="flashcard_mitochondria_2_back">
<div class="fcard_center" style="height:150px">
motor
<span class="bonus_note">
// nota extra: de debò, estaríem morts sense elles.
</span>
</div>
</span>
<span id="flashcard_mitochondria_3_front">
<div class="fcard_bg" src="pics/fcards_ch2.png" sx=400 sy=960 style="top:45px"></div>
<div class="fcard_center" style="height:180px;">
El mitocondri es troba en gairebé tots els organismes <span class="underline">____</span> .
</div>
</span>
<span id="flashcard_mitochondria_3_back">
<div class="fcard_center" style="height:1.5em">
eucariotes
</div>
</span>
<span id="flashcard_mitochondria_4_front">
<div class="fcard_center" style="height:2.5em">
Les eucariotes són cèl·lules que...
</div>
</span>
<span id="flashcard_mitochondria_4_back">
<div class="fcard_bg" src="pics/fcards_ch2.png" sx=0 sy=1200></div>
<div class="fcard_center" style="width: 200px; left: 170px; top: 20px;">
tenen un nucli
<span class="bonus_note">
// nota extra: "eu"=veritable, "karyon"=nucli
</span>
</div>
</span>
<span id="flashcard_mitochondria_5_front">
<div class="fcard_center" style="height:2.5em">
Les procariotes són cèl·lules que...
</div>
</span>
<span id="flashcard_mitochondria_5_back">
<div class="fcard_bg" src="pics/fcards_ch2.png" sx=400 sy=1200></div>
<div class="fcard_center" style="width: 200px; left: 170px; top: 20px;">
NO tenen nucli
<span class="bonus_note">
// nota extra: "pro"=abans de, "karyon"=nucli
</span>
</div>
</span>
<span id="flashcard_mitochondria_6_front">
<div class="fcard_bg" src="pics/fcards_ch2.png" sx=400 sy=960 style="top:10px"></div>
<div class="fcard_center" style="height:200px; font-size:35px">
La hipòtesi més acceptada sobre l'origen del mitocondri és...
</div>
</span>
<span id="flashcard_mitochondria_6_back">
<div class="fcard_center" style="height:120px">
la Teoria Endosimbiòtica
<span class="bonus_note">
// nota extra: "endo"=dins, "sim"=junts, "bio"=viure
</span>
</div>
</span>
<span id="flashcard_mitochondria_7_front">
<div class="fcard_bg" src="pics/fcards_ch2.png" sx=400 sy=960 style="top:40px"></div>
<div class="fcard_center" style="font-size: 35px; height: 220px;">
Segons la Teoria Endosimbiòtica, el mitocondri va aparèixer fa
<span class="underline">____</span> años
</div>
</span>
<span id="flashcard_mitochondria_7_back">
<div class="fcard_center" style="height:1.5em">
fa uns 1500 milions d'anys
</div>
</span>
<span id="flashcard_mitochondria_8_front">
<div class="fcard_bg" src="pics/fcards_ch2.png" sx=400 sy=960 style="top:40px"></div>
<div class="fcard_center" style="font-size: 37px; height: 220px;">
Segons la Teoria Endosimbiòtica, el mitocondri va aparèixer quan...
</div>
</span>
<span id="flashcard_mitochondria_8_back">
<div class="fcard_bg" src="pics/fcards_ch2.png" sx=0 sy=1440></div>
<div class="fcard_center" style="height:230px">
quan una altra cèl·lula va menjar una procariota
</div>
</span>
<span id="flashcard_cat_front">
<div class="fcard_center" style="height:100px">
<div style="font-size:120px; height:102px;">
gat
<!--
TRANSLATOR NOTE:
If your language is NOT French, then change this to "cat" in YOUR language
-->
</div>
<div>
(català)
<!--
TRANSLATOR NOTE:
If your language is NOT French, then change this to YOUR language
-->
</div>
</div>
</span>
<span id="flashcard_cat_back">
<div class="fcard_center" style="height:100px">
<!--
TRANSLATOR NOTE: DO NOT TRANSLATE. Leave as French!
-->
<div style="font-size:120px; height:75px;">
chat
</div>
<div>
(francès)
</div>
</div>
</span>
<span id="flashcard_cat2_front">
<div class="fcard_bg" src="pics/fcards_ch2.png" sx=0 sy=0></div>
<div class="fcard_center"></div>
</span>
<span id="flashcard_cat2_back">
<div class="fcard_bg" src="pics/fcards_ch2.png" sx=400 sy=0></div>
<div class="fcard_center">
<audio controls id="HACK_audio" style="position: absolute; top: 115px; left: 30px; transform: scale(0.5);">
<source gotosrc="../../audio/chat.mp3" type="audio/mpeg">
</audio>
</div>
</span>
<span id="flashcard_learndo_front">
<div class="fcard_bg" src="pics/fcards_ch2.png" sx=0 sy=240></div>
<div class="fcard_center" style="height:195px; font-size:33px;">
i torno a fer coses... ↻
</div>
</span>
<span id="flashcard_learndo_back">
<div class="fcard_bg" src="pics/fcards_ch2.png" sx=400 sy=240></div>
<div class="fcard_center" style="height:195px; font-size:33px;">
i torno a aprendre... ↻
</div>
</span>
<!-- - - - - - - - - - - - -->
<!-- Chapter 3: Get Started -->
<!-- - - - - - - - - - - - -->
<span id="flashcard_you_what_front">
<div class="fcard_bg" src="pics/fcards_ch3.png" sx=0 sy=0></div>
<div id="fc_words" style="line-height: 1.1em; position: absolute; width: 190px; margin: 0; top: 50px; left: 180px;">
QUÈ vols aprendre?
</div>
</span>
<span id="flashcard_you_what_back">
<div id="fc_words" class="fcard_center" editable="you_what" style="height:1.2em">
Qualsevol cosa interessant!
</div>
</span>
<span id="flashcard_you_why_front">
<div class="fcard_bg" src="pics/fcards_ch3.png" sx=400 sy=0></div>
<div id="fc_words" style="line-height: 1.1em; position: absolute; width: 190px; margin: 0; top: 50px; left: 180px;">
PER QUÈ vols aprendre?
</div>
</span>
<span id="flashcard_you_why_back">
<div id="fc_words" class="fcard_center" editable="you_why" style="height:1.2em">
Per curiositat
</div>
</span>
<span id="flashcard_you_how_front">
<div class="fcard_bg" src="pics/fcards_ch3.png" sx=0 sy=240></div>
<div id="fc_words" style="line-height: 1.1em; position: absolute; width: 190px; margin: 0; top:31px; left: 180px;font-size:35px">
COM vols fer R.E.?
</div>
</span>
<span id="flashcard_you_how_back">
<div id="fc_words" class="fcard_center" editable="you_how" style="height:1.2em">
Capsa Leitner
</div>
</span>
<span id="flashcard_you_when_front">
<div class="fcard_bg" src="pics/fcards_ch3.png" sx=400 sy=240></div>
<div id="fc_words" style="line-height: 1.1em; position: absolute; width: 190px; margin: 0; top:31px; left: 180px;font-size:35px">
QUAN vols fer R.E.?
</div>
</span>
<span id="flashcard_you_when_back">
<div id="fc_words" class="fcard_center" editable="you_when" style="height:1.2em">
A les nits
</div>
</span>
<span id="flashcard_the_end_front">
<div class="fcard_bg" src="pics/fcards_ch3.png" sx=0 sy=480></div>
</span>
<span id="flashcard_the_end_back">
<div class="fcard_bg" src="pics/fcards_ch3.png" sx=400 sy=480></div>
<div id="fc_words" class="fcard_center" style="top:30px; font-size:50px;">
FI
</div>
</span>
</div>
<!--
TRANSLATOR NOTE:
Congrats! NOW you've translated everything!
Again, from the deepest part of my heart, I want to sincerely thank you
for helping spread this page to more people, in more languages.
Oh wait, just one more thing: go to translations.txt,
and add your translation there so this project "knows" your page exists.
And once that's done, send a Pull Request, and your translation will go live!
THANK YOU! <3
~ Nicky Case
-->
</body>
</html>
<script src="js/howler.core.min.js"></script>
<script src="js/minpubsub.src.js"></script>
<script src="js/comic.js"></script>
| {
"pile_set_name": "Github"
} |
.\" Automatically generated by Pod::Man 4.14 (Pod::Simple 3.40)
.\"
.\" Standard preamble:
.\" ========================================================================
.de Sp \" Vertical space (when we can't use .PP)
.if t .sp .5v
.if n .sp
..
.de Vb \" Begin verbatim text
.ft CW
.nf
.ne \\$1
..
.de Ve \" End verbatim text
.ft R
.fi
..
.\" Set up some character translations and predefined strings. \*(-- will
.\" give an unbreakable dash, \*(PI will give pi, \*(L" will give a left
.\" double quote, and \*(R" will give a right double quote. \*(C+ will
.\" give a nicer C++. Capital omega is used to do unbreakable dashes and
.\" therefore won't be available. \*(C` and \*(C' expand to `' in nroff,
.\" nothing in troff, for use with C<>.
.tr \(*W-
.ds C+ C\v'-.1v'\h'-1p'\s-2+\h'-1p'+\s0\v'.1v'\h'-1p'
.ie n \{\
. ds -- \(*W-
. ds PI pi
. if (\n(.H=4u)&(1m=24u) .ds -- \(*W\h'-12u'\(*W\h'-12u'-\" diablo 10 pitch
. if (\n(.H=4u)&(1m=20u) .ds -- \(*W\h'-12u'\(*W\h'-8u'-\" diablo 12 pitch
. ds L" ""
. ds R" ""
. ds C` ""
. ds C' ""
'br\}
.el\{\
. ds -- \|\(em\|
. ds PI \(*p
. ds L" ``
. ds R" ''
. ds C`
. ds C'
'br\}
.\"
.\" Escape single quotes in literal strings from groff's Unicode transform.
.ie \n(.g .ds Aq \(aq
.el .ds Aq '
.\"
.\" If the F register is >0, we'll generate index entries on stderr for
.\" titles (.TH), headers (.SH), subsections (.SS), items (.Ip), and index
.\" entries marked with X<> in POD. Of course, you'll have to process the
.\" output yourself in some meaningful fashion.
.\"
.\" Avoid warning from groff about undefined register 'F'.
.de IX
..
.nr rF 0
.if \n(.g .if rF .nr rF 1
.if (\n(rF:(\n(.g==0)) \{\
. if \nF \{\
. de IX
. tm Index:\\$1\t\\n%\t"\\$2"
..
. if !\nF==2 \{\
. nr % 0
. nr F 2
. \}
. \}
.\}
.rr rF
.\"
.\" Accent mark definitions (@(#)ms.acc 1.5 88/02/08 SMI; from UCB 4.2).
.\" Fear. Run. Save yourself. No user-serviceable parts.
. \" fudge factors for nroff and troff
.if n \{\
. ds #H 0
. ds #V .8m
. ds #F .3m
. ds #[ \f1
. ds #] \fP
.\}
.if t \{\
. ds #H ((1u-(\\\\n(.fu%2u))*.13m)
. ds #V .6m
. ds #F 0
. ds #[ \&
. ds #] \&
.\}
. \" simple accents for nroff and troff
.if n \{\
. ds ' \&
. ds ` \&
. ds ^ \&
. ds , \&
. ds ~ ~
. ds /
.\}
.if t \{\
. ds ' \\k:\h'-(\\n(.wu*8/10-\*(#H)'\'\h"|\\n:u"
. ds ` \\k:\h'-(\\n(.wu*8/10-\*(#H)'\`\h'|\\n:u'
. ds ^ \\k:\h'-(\\n(.wu*10/11-\*(#H)'^\h'|\\n:u'
. ds , \\k:\h'-(\\n(.wu*8/10)',\h'|\\n:u'
. ds ~ \\k:\h'-(\\n(.wu-\*(#H-.1m)'~\h'|\\n:u'
. ds / \\k:\h'-(\\n(.wu*8/10-\*(#H)'\z\(sl\h'|\\n:u'
.\}
. \" troff and (daisy-wheel) nroff accents
.ds : \\k:\h'-(\\n(.wu*8/10-\*(#H+.1m+\*(#F)'\v'-\*(#V'\z.\h'.2m+\*(#F'.\h'|\\n:u'\v'\*(#V'
.ds 8 \h'\*(#H'\(*b\h'-\*(#H'
.ds o \\k:\h'-(\\n(.wu+\w'\(de'u-\*(#H)/2u'\v'-.3n'\*(#[\z\(de\v'.3n'\h'|\\n:u'\*(#]
.ds d- \h'\*(#H'\(pd\h'-\w'~'u'\v'-.25m'\f2\(hy\fP\v'.25m'\h'-\*(#H'
.ds D- D\\k:\h'-\w'D'u'\v'-.11m'\z\(hy\v'.11m'\h'|\\n:u'
.ds th \*(#[\v'.3m'\s+1I\s-1\v'-.3m'\h'-(\w'I'u*2/3)'\s-1o\s+1\*(#]
.ds Th \*(#[\s+2I\s-2\h'-\w'I'u*3/5'\v'-.3m'o\v'.3m'\*(#]
.ds ae a\h'-(\w'a'u*4/10)'e
.ds Ae A\h'-(\w'A'u*4/10)'E
. \" corrections for vroff
.if v .ds ~ \\k:\h'-(\\n(.wu*9/10-\*(#H)'\s-2\u~\d\s+2\h'|\\n:u'
.if v .ds ^ \\k:\h'-(\\n(.wu*10/11-\*(#H)'\v'-.4m'^\v'.4m'\h'|\\n:u'
. \" for low resolution devices (crt and lpr)
.if \n(.H>23 .if \n(.V>19 \
\{\
. ds : e
. ds 8 ss
. ds o a
. ds d- d\h'-1'\(ga
. ds D- D\h'-1'\(hy
. ds th \o'bp'
. ds Th \o'LP'
. ds ae ae
. ds Ae AE
.\}
.rm #[ #] #H #V #F C
.\" ========================================================================
.\"
.IX Title "SSL_GET_ALL_ASYNC_FDS 3"
.TH SSL_GET_ALL_ASYNC_FDS 3 "2020-09-22" "1.1.1h" "OpenSSL"
.\" For nroff, turn off justification. Always turn off hyphenation; it makes
.\" way too many mistakes in technical documents.
.if n .ad l
.nh
.SH "NAME"
SSL_waiting_for_async, SSL_get_all_async_fds, SSL_get_changed_async_fds \&\- manage asynchronous operations
.SH "SYNOPSIS"
.IX Header "SYNOPSIS"
.Vb 2
\& #include <openssl/async.h>
\& #include <openssl/ssl.h>
\&
\& int SSL_waiting_for_async(SSL *s);
\& int SSL_get_all_async_fds(SSL *s, OSSL_ASYNC_FD *fd, size_t *numfds);
\& int SSL_get_changed_async_fds(SSL *s, OSSL_ASYNC_FD *addfd, size_t *numaddfds,
\& OSSL_ASYNC_FD *delfd, size_t *numdelfds);
.Ve
.SH "DESCRIPTION"
.IX Header "DESCRIPTION"
\&\fBSSL_waiting_for_async()\fR determines whether an \s-1SSL\s0 connection is currently
waiting for asynchronous operations to complete (see the \s-1SSL_MODE_ASYNC\s0 mode in
\&\fBSSL_CTX_set_mode\fR\|(3)).
.PP
\&\fBSSL_get_all_async_fds()\fR returns a list of file descriptor which can be used in a
call to \fBselect()\fR or \fBpoll()\fR to determine whether the current asynchronous
operation has completed or not. A completed operation will result in data
appearing as \*(L"read ready\*(R" on the file descriptor (no actual data should be read
from the file descriptor). This function should only be called if the \s-1SSL\s0 object
is currently waiting for asynchronous work to complete (i.e.
\&\s-1SSL_ERROR_WANT_ASYNC\s0 has been received \- see \fBSSL_get_error\fR\|(3)). Typically the
list will only contain one file descriptor. However, if multiple asynchronous
capable engines are in use then more than one is possible. The number of file
descriptors returned is stored in \fB*numfds\fR and the file descriptors themselves
are in \fB*fds\fR. The \fBfds\fR parameter may be \s-1NULL\s0 in which case no file
descriptors are returned but \fB*numfds\fR is still populated. It is the callers
responsibility to ensure sufficient memory is allocated at \fB*fds\fR so typically
this function is called twice (once with a \s-1NULL\s0 \fBfds\fR parameter and once
without).
.PP
\&\fBSSL_get_changed_async_fds()\fR returns a list of the asynchronous file descriptors
that have been added and a list that have been deleted since the last
\&\s-1SSL_ERROR_WANT_ASYNC\s0 was received (or since the \s-1SSL\s0 object was created if no
\&\s-1SSL_ERROR_WANT_ASYNC\s0 has been received). Similar to \fBSSL_get_all_async_fds()\fR it
is the callers responsibility to ensure that \fB*addfd\fR and \fB*delfd\fR have
sufficient memory allocated, although they may be \s-1NULL.\s0 The number of added fds
and the number of deleted fds are stored in \fB*numaddfds\fR and \fB*numdelfds\fR
respectively.
.SH "RETURN VALUES"
.IX Header "RETURN VALUES"
\&\fBSSL_waiting_for_async()\fR will return 1 if the current \s-1SSL\s0 operation is waiting
for an async operation to complete and 0 otherwise.
.PP
\&\fBSSL_get_all_async_fds()\fR and \fBSSL_get_changed_async_fds()\fR return 1 on success or
0 on error.
.SH "NOTES"
.IX Header "NOTES"
On Windows platforms the openssl/async.h header is dependent on some
of the types customarily made available by including windows.h. The
application developer is likely to require control over when the latter
is included, commonly as one of the first included headers. Therefore,
it is defined as an application developer's responsibility to include
windows.h prior to async.h.
.SH "SEE ALSO"
.IX Header "SEE ALSO"
\&\fBSSL_get_error\fR\|(3), \fBSSL_CTX_set_mode\fR\|(3)
.SH "HISTORY"
.IX Header "HISTORY"
The \fBSSL_waiting_for_async()\fR, \fBSSL_get_all_async_fds()\fR
and \fBSSL_get_changed_async_fds()\fR functions were added in OpenSSL 1.1.0.
.SH "COPYRIGHT"
.IX Header "COPYRIGHT"
Copyright 2016\-2020 The OpenSSL Project Authors. All Rights Reserved.
.PP
Licensed under the OpenSSL license (the \*(L"License\*(R"). You may not use
this file except in compliance with the License. You can obtain a copy
in the file \s-1LICENSE\s0 in the source distribution or at
<https://www.openssl.org/source/license.html>.
| {
"pile_set_name": "Github"
} |
from django.db import models
from django.utils.encoding import python_2_unicode_compatible
class User(models.Model):
username = models.CharField(max_length=12, unique=True)
serial = models.IntegerField()
class UserSite(models.Model):
user = models.ForeignKey(User, to_field="username")
data = models.IntegerField()
class Place(models.Model):
name = models.CharField(max_length=50)
class Restaurant(Place):
pass
class Manager(models.Model):
retaurant = models.ForeignKey(Restaurant)
name = models.CharField(max_length=50)
class Network(models.Model):
name = models.CharField(max_length=15)
@python_2_unicode_compatible
class Host(models.Model):
network = models.ForeignKey(Network)
hostname = models.CharField(max_length=25)
def __str__(self):
return self.hostname
| {
"pile_set_name": "Github"
} |
/**
* @license
* Copyright 2018 Google LLC
*
* Use of this source code is governed by an MIT-style
* license that can be found in the LICENSE file or at
* https://opensource.org/licenses/MIT.
* =============================================================================
*/
import {ConstraintSerialization} from '../constraint_config';
import {InitializerSerialization} from '../initializer_config';
import {RegularizerSerialization} from '../regularizer_config';
import {BaseLayerSerialization, LayerConfig} from '../topology_config';
export interface BatchNormalizationLayerConfig extends LayerConfig {
axis?: number;
momentum?: number;
epsilon?: number;
center?: boolean;
scale?: boolean;
beta_initializer?: InitializerSerialization;
gamma_initializer?: InitializerSerialization;
moving_mean_initializer?: InitializerSerialization;
moving_variance_initializer?: InitializerSerialization;
beta_constraint?: ConstraintSerialization;
gamma_constraint?: ConstraintSerialization;
beta_regularizer?: RegularizerSerialization;
gamma_regularizer?: RegularizerSerialization;
}
// Update batchNormalizationLayerClassNames below in concert with this.
export type BatchNormalizationLayerSerialization =
BaseLayerSerialization<'BatchNormalization', BatchNormalizationLayerConfig>;
export type NormalizationLayerSerialization =
BatchNormalizationLayerSerialization;
export type NormalizationLayerClassName =
NormalizationLayerSerialization['class_name'];
// We can't easily extract a string[] from the string union type, but we can
// recapitulate the list, enforcing at compile time that the values are valid.
/**
* A string array of valid NormalizationLayer class names.
*
* This is guaranteed to match the `NormalizationLayerClassName` union
* type.
*/
export const normalizationLayerClassNames: NormalizationLayerClassName[] = [
'BatchNormalization',
];
| {
"pile_set_name": "Github"
} |
.size 8000
.text@100
jp lbegin
.data@143
c0
.text@150
lbegin:
xor a, a
ldff(26), a
ld a, 30
ldff(00), a
xor a, a
ldff(ff), a
inc a
ldff(4d), a
stop, 00
ldff(4d), a
ld a, 10
ld b, 22
ld c, 30
ld d, 10
lbegin_init_wave_ram:
ldff(c), a
inc c
add a, b
dec d
jrnz lbegin_init_wave_ram
ld a, 80
ldff(26), a
ld a, 80
ldff(1a), a
ld a, ff
ldff(1d), a
ld a, 87
ldff(1e), a
nop
ldff a, (30)
jp lprint_a
.text@7000
lprint_a:
push af
ld b, 91
call lwaitly_b
xor a, a
ldff(40), a
ld bc, 7a00
ld hl, 8000
ld d, 00
lprint_copytiles:
ld a, (bc)
inc bc
ld(hl++), a
dec d
jrnz lprint_copytiles
pop af
ld b, a
swap a
and a, 0f
ld(9800), a
ld a, b
and a, 0f
ld(9801), a
ld a, c0
ldff(47), a
ld a, 80
ldff(68), a
ld a, ff
ldff(69), a
ldff(69), a
ldff(69), a
ldff(69), a
ldff(69), a
ldff(69), a
xor a, a
ldff(69), a
ldff(69), a
ldff(43), a
ld a, 91
ldff(40), a
lprint_limbo:
jr lprint_limbo
.text@7400
lwaitly_b:
ld c, 44
lwaitly_b_loop:
ldff a, (c)
cmp a, b
jrnz lwaitly_b_loop
ret
.data@7a00
00 00 7f 7f 41 41 41 41
41 41 41 41 41 41 7f 7f
00 00 08 08 08 08 08 08
08 08 08 08 08 08 08 08
00 00 7f 7f 01 01 01 01
7f 7f 40 40 40 40 7f 7f
00 00 7f 7f 01 01 01 01
3f 3f 01 01 01 01 7f 7f
00 00 41 41 41 41 41 41
7f 7f 01 01 01 01 01 01
00 00 7f 7f 40 40 40 40
7e 7e 01 01 01 01 7e 7e
00 00 7f 7f 40 40 40 40
7f 7f 41 41 41 41 7f 7f
00 00 7f 7f 01 01 02 02
04 04 08 08 10 10 10 10
00 00 3e 3e 41 41 41 41
3e 3e 41 41 41 41 3e 3e
00 00 7f 7f 41 41 41 41
7f 7f 01 01 01 01 7f 7f
00 00 08 08 22 22 41 41
7f 7f 41 41 41 41 41 41
00 00 7e 7e 41 41 41 41
7e 7e 41 41 41 41 7e 7e
00 00 3e 3e 41 41 40 40
40 40 40 40 41 41 3e 3e
00 00 7e 7e 41 41 41 41
41 41 41 41 41 41 7e 7e
00 00 7f 7f 40 40 40 40
7f 7f 40 40 40 40 7f 7f
00 00 7f 7f 40 40 40 40
7f 7f 40 40 40 40 40 40
| {
"pile_set_name": "Github"
} |
Car 0 1 0 1129.443750 153.645833 1240.706250 197.916667 0 0 0 0 0 0 0 0.976535
Car 0 1 0 567.309375 176.432292 617.765625 224.609375 0 0 0 0 0 0 0 0.986277
Car 0 1 0 509.737500 179.687500 533.025000 197.916667 0 0 0 0 0 0 0 0.471234
| {
"pile_set_name": "Github"
} |
<?php
/*
* This file is part of the Ladybug package.
*
* (c) Raul Fraile <[email protected]>
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
*/
namespace Ladybug\Renderer;
use Ladybug\Format;
/**
* PhpRenderer serializes a collection of nodes in PHP
*
* @author Raul Fraile <[email protected]>
*/
class PhpRenderer extends AbstractRenderer
{
public function render(array $nodes, array $extraData = array())
{
return array_merge(array(
'nodes' => $nodes
), $extraData);
}
public function getFormat()
{
return Format\PhpFormat::FORMAT_NAME;
}
}
| {
"pile_set_name": "Github"
} |
//
// Generated by class-dump 3.5 (64 bit) (Debug version compiled Jun 9 2015 22:53:21).
//
// class-dump is Copyright (C) 1997-1998, 2000-2001, 2004-2014 by Steve Nygard.
//
#import <Cocoa/NSUserDefaults.h>
@interface NSUserDefaults (iPhotoExtensions)
- (long long)integerForKey:(id)arg1 valueIfNotFound:(long long)arg2;
- (BOOL)hasObjectForKey:(id)arg1;
@end
| {
"pile_set_name": "Github"
} |
var LodashWrapper = require('../internal/LodashWrapper');
/**
* Executes the chained sequence and returns the wrapped result.
*
* @name commit
* @memberOf _
* @category Chain
* @returns {Object} Returns the new `lodash` wrapper instance.
* @example
*
* var array = [1, 2];
* var wrapped = _(array).push(3);
*
* console.log(array);
* // => [1, 2]
*
* wrapped = wrapped.commit();
* console.log(array);
* // => [1, 2, 3]
*
* wrapped.last();
* // => 3
*
* console.log(array);
* // => [1, 2, 3]
*/
function wrapperCommit() {
return new LodashWrapper(this.value(), this.__chain__);
}
module.exports = wrapperCommit;
| {
"pile_set_name": "Github"
} |
Although there are multiple ways to perform a single task, here are few of the commonly used network architectures for the mentioned use-cases:
| Problem | Core Architecture |
|--|--|
| Image Classification | CNN |
| Anomaly Detection | Autoencoder |
| Time Series classification | RNN/LSTM/Computation graph
| Prediction problems on sequence data | RNN/LSTM
| Recommender Systems | RL
Note that, the optimal architectural decision can vary upon the type of data dealt with and whether it is supervised/unsupervised.
- For prediction problems with simple CSV data (non-sequential), MLP(Multilayer perceptron) would be just enough and will give best results compared to other complex architectures. MLP is nothing but the deep neural net with an input layer and output layer and multiple hidden layers in between these two layers. Hidden layers receive input from the input layer and output layers receive input from hidden layers. If there are multiple hidden layers, each layer will take inputs from preceding hidden layer.
- Time series data or anything that involves sequential data is going to need a RNN or LSTM. RNN is optimal to handle sequential data. If we want to track long term dependencies in the data, an LSTM might be the best option. LSTM is a variant from RNN with a memory unit which is capable to hold long term dependencies.
- Anomaly detection problems involve feature analysis of each and every sample. We dont need to have labels here. We basically try to encode the data and decode it back to see the outliers in the feature. An autoencoder will be perfect fit for this purpose and lot of better variants like VAE (Variational autoencoder) are possible to construct using DL4J.
- DL4J have its on subsidiary library for reinforcement learning called RL4J. Recommender systems use reinforcement learning algorithms to solve recommendation problems. We can also feed the data in image/video/text format to a feed forward network/CNN and then generate classified actions. That is to chose the policy upon given action.
| {
"pile_set_name": "Github"
} |
# V71 Migration Guide
Some of the major changes included in version 71 are breaking, but in relatively minor ways. Read on for details.
## Go Modules
The library now fully supports [Go Modules](https://github.com/golang/go/wiki/Modules), Go's preferred packaging system which is built into the language. Requires that previously looked like:
``` go
import (
"github.com/stripe/stripe-go"
"github.com/stripe/stripe-go/customer"
)
```
Should now also include a major version:
``` go
import (
"github.com/stripe/stripe-go/v71"
"github.com/stripe/stripe-go/v71/customer"
)
```
This convention is recognized by the Go toolchain. After adding a major version to paths, just run `go build`, `go install`, `go test`, etc. and it will automatically fetch stripe-go and do the right thing.
Go Modules are supported on every version of Go supported by Stripe and basic awareness for them has been backported as far as Go 1.9.
Upgrading to stripe-go v71 will be difficult for projects using [Dep](https://github.com/golang/dep). There have been attempts to [contribute minimal Go Module awareness](https://github.com/golang/dep/pull/1963) to the project, but no support has been able to make it in. As Dep is now unmaintained for all intents and purposes, if you're still using it, we recommend moving your project to Go Modules instead. Because Go Modules are Dep-aware (even if the vice versa is not true), this is likely easier than you'd intuitively think because the tooling supports it automatically. See the official [post on migrating to Go Modules](https://blog.golang.org/migrating-to-go-modules) for more details.
## API response information
All API resource structs now have a `LastResponse` that allows access to useful information on the API request that generated them. For example:
``` go
customer, err := customer.New(params)
fmt.Printf("request ID = %s\n", customer.LastResponse.RequestID)
```
Note that although `LastResponse` is available on any struct that might be returned from a API call, it will only be populated for the top-level API resource that was received. e.g. When fetching an invoice from `GET /invoices/:id`, the invoice's `LastResponse` is populated, but that of its invoice items is not. However, when fetching an invoice item from `GET /invoiceitems/:id`, `LastResponse` for that invoice item is populated.
The full struct in `LastResponse` makes these properties available:
``` go
// APIResponse encapsulates some common features of a response from the
// Stripe API.
type APIResponse struct {
// Header contain a map of all HTTP header keys to values. Its behavior and
// caveats are identical to that of http.Header.
Header http.Header
// IdempotencyKey contains the idempotency key used with this request.
// Idempotency keys are a Stripe-specific concept that helps guarantee that
// requests that fail and need to be retried are not duplicated.
IdempotencyKey string
// RawJSON contains the response body as raw bytes.
RawJSON []byte
// RequestID contains a string that uniquely identifies the Stripe request.
// Used for debugging or support purposes.
RequestID string
// Status is a status code and message. e.g. "200 OK"
Status string
// StatusCode is a status code as integer. e.g. 200
StatusCode int
}
```
## `BackendConfig` now takes pointers
The types for primitives on `BackendConfig` now take pointers:
* `EnableTelemetry` changes from `bool` to `*bool`.
* `MaxNetworkRetries` changes from `int` to `*int64`.
* `URL` changes from `string` to `*string`.
We made the change so that we can distinguish between a value that was let unset by the user versus one which has defaulted to empty (i.e. `MaxNetworkRetries` as a vanilla `int` left unset is indistinguishable from one that's been set to `0` explicitly).
Use the standard `stripe.*` class of parameter helpers to set these easily:
``` go
config := &stripe.BackendConfig{
MaxNetworkRetries: stripe.Int64(2),
}
```
## `MaxNetworkRetries` now defaults to 2
The library now retries intermittently failed requests by default (i.e. if the feature has not been explicitly configured by the user) up to **two times**. This can be changed back to the previous behavior of no retries using `MaxNetworkRetries` on `BackendConfig`:
``` go
config := &stripe.BackendConfig{
MaxNetworkRetries: stripe.Int64(0), // Zero retries
}
```
## `LeveledLogger` now default
Deprecated logging infrastructure has been removed, notably the top-level variables `stripe.LogLevel` and `stripe.Logger`. Use `DefaultLeveledLogger` instead:
``` go
stripe.DefaultLeveledLogger = &stripe.LeveledLogger{
Level: stripe.LevelDebug,
}
```
Or set `LeveledLogger` explicitly on a `BackendConfig`:
``` go
config := &stripe.BackendConfig{
LeveledLogger: &stripe.LeveledLogger{
Level: stripe.LevelDebug,
},
}
```
## Only errors are logged by default
If no logging has been configured, stripe-go will now show **only errors by default**. Previously, it logged both errors and informational messages. This behavior can be reverted by setting the default logger to informational:
``` go
stripe.DefaultLeveledLogger = &stripe.LeveledLogger{
Level: stripe.LevelInfo,
}
```
## Other API changes
* [#1052](https://github.com/stripe/stripe-go/pull/1052) Beta features have been removed from Issuing APIs
* [#1068](https://github.com/stripe/stripe-go/pull/1068) Other breaking API changes
* `PaymentIntent` is now expandable on `Charge`
* `Percentage` was removed as a filter when listing `TaxRate`
* Removed `RenewalInterval` on `SubscriptionSchedule`
* Removed `Country` and `RoutingNumber` from `ChargePaymentMethodDetailsAcssDebit`
| {
"pile_set_name": "Github"
} |
{
"_args": [
[
"[email protected]",
"/Users/xingchenhe/Documents/work/git.code.oa.com/live-demo-component"
]
],
"_development": true,
"_from": "[email protected]",
"_id": "[email protected]",
"_inBundle": false,
"_integrity": "sha1-Tg1W1slmL9MeQwEcS5WqSZVUIdM=",
"_location": "/require-uncached",
"_phantomChildren": {},
"_requested": {
"type": "version",
"registry": true,
"raw": "[email protected]",
"name": "require-uncached",
"escapedName": "require-uncached",
"rawSpec": "1.0.3",
"saveSpec": null,
"fetchSpec": "1.0.3"
},
"_requiredBy": [
"/eslint"
],
"_resolved": "https://registry.npmjs.org/require-uncached/-/require-uncached-1.0.3.tgz",
"_spec": "1.0.3",
"_where": "/Users/xingchenhe/Documents/work/git.code.oa.com/live-demo-component",
"author": {
"name": "Sindre Sorhus",
"email": "[email protected]",
"url": "sindresorhus.com"
},
"bugs": {
"url": "https://github.com/sindresorhus/require-uncached/issues"
},
"dependencies": {
"caller-path": "^0.1.0",
"resolve-from": "^1.0.0"
},
"description": "Require a module bypassing the cache",
"devDependencies": {
"ava": "*",
"heapdump": "^0.3.7",
"xo": "^0.16.0"
},
"engines": {
"node": ">=0.10.0"
},
"files": [
"index.js"
],
"homepage": "https://github.com/sindresorhus/require-uncached#readme",
"keywords": [
"require",
"cache",
"uncache",
"uncached",
"module",
"fresh",
"bypass"
],
"license": "MIT",
"name": "require-uncached",
"repository": {
"type": "git",
"url": "git+https://github.com/sindresorhus/require-uncached.git"
},
"scripts": {
"heapdump": "node heapdump.js",
"test": "xo && ava"
},
"version": "1.0.3",
"xo": {
"rules": {
"import/no-dynamic-require": "off"
}
}
}
| {
"pile_set_name": "Github"
} |
/*============================================================================
This C source file is part of the SoftFloat IEEE Floating-Point Arithmetic
Package, Release 3e, by John R. Hauser.
Copyright 2011, 2012, 2013, 2014, 2015 The Regents of the University of
California. All rights reserved.
Redistribution and use in source and binary forms, with or without
modification, are permitted provided that the following conditions are met:
1. Redistributions of source code must retain the above copyright notice,
this list of conditions, and the following disclaimer.
2. Redistributions in binary form must reproduce the above copyright notice,
this list of conditions, and the following disclaimer in the documentation
and/or other materials provided with the distribution.
3. Neither the name of the University nor the names of its contributors may
be used to endorse or promote products derived from this software without
specific prior written permission.
THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS "AS IS", AND ANY
EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE, ARE
DISCLAIMED. IN NO EVENT SHALL THE REGENTS 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 <stdint.h>
#include "platform.h"
#include "primitiveTypes.h"
#include "specialize.h"
#include "softfloat.h"
/*----------------------------------------------------------------------------
| Interpreting the unsigned integer formed from concatenating `uiA64' and
| `uiA0' as an 80-bit extended floating-point value, and likewise interpreting
| the unsigned integer formed from concatenating `uiB64' and `uiB0' as another
| 80-bit extended floating-point value, and assuming at least on of these
| floating-point values is a NaN, returns the bit pattern of the combined NaN
| result. If either original floating-point value is a signaling NaN, the
| invalid exception is raised.
*----------------------------------------------------------------------------*/
struct uint128
softfloat_propagateNaNExtF80UI(
uint_fast16_t uiA64,
uint_fast64_t uiA0,
uint_fast16_t uiB64,
uint_fast64_t uiB0
)
{
struct uint128 uiZ;
if (
softfloat_isSigNaNExtF80UI( uiA64, uiA0 )
|| softfloat_isSigNaNExtF80UI( uiB64, uiB0 )
) {
softfloat_raiseFlags( softfloat_flag_invalid );
}
uiZ.v64 = defaultNaNExtF80UI64;
uiZ.v0 = defaultNaNExtF80UI0;
return uiZ;
}
| {
"pile_set_name": "Github"
} |
// Generated by the protocol buffer compiler. DO NOT EDIT!
// source: POGOProtos/Settings/Master/GymLevelSettings.proto
#pragma warning disable 1591, 0612, 3021
#region Designer generated code
using pb = global::Google.Protobuf;
using pbc = global::Google.Protobuf.Collections;
using pbr = global::Google.Protobuf.Reflection;
using scg = global::System.Collections.Generic;
namespace POGOProtos.Settings.Master {
/// <summary>Holder for reflection information generated from POGOProtos/Settings/Master/GymLevelSettings.proto</summary>
public static partial class GymLevelSettingsReflection {
#region Descriptor
/// <summary>File descriptor for POGOProtos/Settings/Master/GymLevelSettings.proto</summary>
public static pbr::FileDescriptor Descriptor {
get { return descriptor; }
}
private static pbr::FileDescriptor descriptor;
static GymLevelSettingsReflection() {
byte[] descriptorData = global::System.Convert.FromBase64String(
string.Concat(
"CjFQT0dPUHJvdG9zL1NldHRpbmdzL01hc3Rlci9HeW1MZXZlbFNldHRpbmdz",
"LnByb3RvEhpQT0dPUHJvdG9zLlNldHRpbmdzLk1hc3RlciJ3ChBHeW1MZXZl",
"bFNldHRpbmdzEhsKE3JlcXVpcmVkX2V4cGVyaWVuY2UYASADKAUSFAoMbGVh",
"ZGVyX3Nsb3RzGAIgAygFEhUKDXRyYWluZXJfc2xvdHMYAyADKAUSGQoRc2Vh",
"cmNoX3JvbGxfYm9udXMYBCADKAViBnByb3RvMw=="));
descriptor = pbr::FileDescriptor.FromGeneratedCode(descriptorData,
new pbr::FileDescriptor[] { },
new pbr::GeneratedClrTypeInfo(null, new pbr::GeneratedClrTypeInfo[] {
new pbr::GeneratedClrTypeInfo(typeof(global::POGOProtos.Settings.Master.GymLevelSettings), global::POGOProtos.Settings.Master.GymLevelSettings.Parser, new[]{ "RequiredExperience", "LeaderSlots", "TrainerSlots", "SearchRollBonus" }, null, null, null)
}));
}
#endregion
}
#region Messages
public sealed partial class GymLevelSettings : pb::IMessage<GymLevelSettings> {
private static readonly pb::MessageParser<GymLevelSettings> _parser = new pb::MessageParser<GymLevelSettings>(() => new GymLevelSettings());
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public static pb::MessageParser<GymLevelSettings> Parser { get { return _parser; } }
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public static pbr::MessageDescriptor Descriptor {
get { return global::POGOProtos.Settings.Master.GymLevelSettingsReflection.Descriptor.MessageTypes[0]; }
}
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
pbr::MessageDescriptor pb::IMessage.Descriptor {
get { return Descriptor; }
}
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public GymLevelSettings() {
OnConstruction();
}
partial void OnConstruction();
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public GymLevelSettings(GymLevelSettings other) : this() {
requiredExperience_ = other.requiredExperience_.Clone();
leaderSlots_ = other.leaderSlots_.Clone();
trainerSlots_ = other.trainerSlots_.Clone();
searchRollBonus_ = other.searchRollBonus_.Clone();
}
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public GymLevelSettings Clone() {
return new GymLevelSettings(this);
}
/// <summary>Field number for the "required_experience" field.</summary>
public const int RequiredExperienceFieldNumber = 1;
private static readonly pb::FieldCodec<int> _repeated_requiredExperience_codec
= pb::FieldCodec.ForInt32(10);
private readonly pbc::RepeatedField<int> requiredExperience_ = new pbc::RepeatedField<int>();
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public pbc::RepeatedField<int> RequiredExperience {
get { return requiredExperience_; }
}
/// <summary>Field number for the "leader_slots" field.</summary>
public const int LeaderSlotsFieldNumber = 2;
private static readonly pb::FieldCodec<int> _repeated_leaderSlots_codec
= pb::FieldCodec.ForInt32(18);
private readonly pbc::RepeatedField<int> leaderSlots_ = new pbc::RepeatedField<int>();
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public pbc::RepeatedField<int> LeaderSlots {
get { return leaderSlots_; }
}
/// <summary>Field number for the "trainer_slots" field.</summary>
public const int TrainerSlotsFieldNumber = 3;
private static readonly pb::FieldCodec<int> _repeated_trainerSlots_codec
= pb::FieldCodec.ForInt32(26);
private readonly pbc::RepeatedField<int> trainerSlots_ = new pbc::RepeatedField<int>();
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public pbc::RepeatedField<int> TrainerSlots {
get { return trainerSlots_; }
}
/// <summary>Field number for the "search_roll_bonus" field.</summary>
public const int SearchRollBonusFieldNumber = 4;
private static readonly pb::FieldCodec<int> _repeated_searchRollBonus_codec
= pb::FieldCodec.ForInt32(34);
private readonly pbc::RepeatedField<int> searchRollBonus_ = new pbc::RepeatedField<int>();
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public pbc::RepeatedField<int> SearchRollBonus {
get { return searchRollBonus_; }
}
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public override bool Equals(object other) {
return Equals(other as GymLevelSettings);
}
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public bool Equals(GymLevelSettings other) {
if (ReferenceEquals(other, null)) {
return false;
}
if (ReferenceEquals(other, this)) {
return true;
}
if(!requiredExperience_.Equals(other.requiredExperience_)) return false;
if(!leaderSlots_.Equals(other.leaderSlots_)) return false;
if(!trainerSlots_.Equals(other.trainerSlots_)) return false;
if(!searchRollBonus_.Equals(other.searchRollBonus_)) return false;
return true;
}
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public override int GetHashCode() {
int hash = 1;
hash ^= requiredExperience_.GetHashCode();
hash ^= leaderSlots_.GetHashCode();
hash ^= trainerSlots_.GetHashCode();
hash ^= searchRollBonus_.GetHashCode();
return hash;
}
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public override string ToString() {
return pb::JsonFormatter.ToDiagnosticString(this);
}
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public void WriteTo(pb::CodedOutputStream output) {
requiredExperience_.WriteTo(output, _repeated_requiredExperience_codec);
leaderSlots_.WriteTo(output, _repeated_leaderSlots_codec);
trainerSlots_.WriteTo(output, _repeated_trainerSlots_codec);
searchRollBonus_.WriteTo(output, _repeated_searchRollBonus_codec);
}
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public int CalculateSize() {
int size = 0;
size += requiredExperience_.CalculateSize(_repeated_requiredExperience_codec);
size += leaderSlots_.CalculateSize(_repeated_leaderSlots_codec);
size += trainerSlots_.CalculateSize(_repeated_trainerSlots_codec);
size += searchRollBonus_.CalculateSize(_repeated_searchRollBonus_codec);
return size;
}
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public void MergeFrom(GymLevelSettings other) {
if (other == null) {
return;
}
requiredExperience_.Add(other.requiredExperience_);
leaderSlots_.Add(other.leaderSlots_);
trainerSlots_.Add(other.trainerSlots_);
searchRollBonus_.Add(other.searchRollBonus_);
}
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public void MergeFrom(pb::CodedInputStream input) {
uint tag;
while ((tag = input.ReadTag()) != 0) {
switch(tag) {
default:
input.SkipLastField();
break;
case 10:
case 8: {
requiredExperience_.AddEntriesFrom(input, _repeated_requiredExperience_codec);
break;
}
case 18:
case 16: {
leaderSlots_.AddEntriesFrom(input, _repeated_leaderSlots_codec);
break;
}
case 26:
case 24: {
trainerSlots_.AddEntriesFrom(input, _repeated_trainerSlots_codec);
break;
}
case 34:
case 32: {
searchRollBonus_.AddEntriesFrom(input, _repeated_searchRollBonus_codec);
break;
}
}
}
}
}
#endregion
}
#endregion Designer generated code
| {
"pile_set_name": "Github"
} |
/*
Simple DirectMedia Layer
Copyright (C) 1997-2019 Sam Lantinga <[email protected]>
This software is provided 'as-is', without any express or implied
warranty. In no event will the authors be held liable for any damages
arising from the use of this software.
Permission is granted to anyone to use this software for any purpose,
including commercial applications, and to alter it and redistribute it
freely, subject to the following restrictions:
1. The origin of this software must not be misrepresented; you must not
claim that you wrote the original software. If you use this software
in a product, an acknowledgment in the product documentation would be
appreciated but is not required.
2. Altered source versions must be plainly marked as such, and must not be
misrepresented as being the original software.
3. This notice may not be removed or altered from any source distribution.
*/
#include "../../SDL_internal.h"
#if SDL_VIDEO_DRIVER_COCOA
#include "SDL_cocoamousetap.h"
/* Event taps are forbidden in the Mac App Store, so we can only enable this
* code if your app doesn't need to ship through the app store.
* This code makes it so that a grabbed cursor cannot "leak" a mouse click
* past the edge of the window if moving the cursor too fast.
*/
#if SDL_MAC_NO_SANDBOX
#include "SDL_keyboard.h"
#include "SDL_cocoavideo.h"
#include "../../thread/SDL_systhread.h"
#include "../../events/SDL_mouse_c.h"
typedef struct {
CFMachPortRef tap;
CFRunLoopRef runloop;
CFRunLoopSourceRef runloopSource;
SDL_Thread *thread;
SDL_sem *runloopStartedSemaphore;
} SDL_MouseEventTapData;
static const CGEventMask movementEventsMask =
CGEventMaskBit(kCGEventLeftMouseDragged)
| CGEventMaskBit(kCGEventRightMouseDragged)
| CGEventMaskBit(kCGEventMouseMoved);
static const CGEventMask allGrabbedEventsMask =
CGEventMaskBit(kCGEventLeftMouseDown) | CGEventMaskBit(kCGEventLeftMouseUp)
| CGEventMaskBit(kCGEventRightMouseDown) | CGEventMaskBit(kCGEventRightMouseUp)
| CGEventMaskBit(kCGEventOtherMouseDown) | CGEventMaskBit(kCGEventOtherMouseUp)
| CGEventMaskBit(kCGEventLeftMouseDragged) | CGEventMaskBit(kCGEventRightMouseDragged)
| CGEventMaskBit(kCGEventMouseMoved);
static CGEventRef
Cocoa_MouseTapCallback(CGEventTapProxy proxy, CGEventType type, CGEventRef event, void *refcon)
{
SDL_MouseEventTapData *tapdata = (SDL_MouseEventTapData*)refcon;
SDL_Mouse *mouse = SDL_GetMouse();
SDL_Window *window = SDL_GetKeyboardFocus();
NSWindow *nswindow;
NSRect windowRect;
CGPoint eventLocation;
switch (type) {
case kCGEventTapDisabledByTimeout:
{
CGEventTapEnable(tapdata->tap, true);
return NULL;
}
case kCGEventTapDisabledByUserInput:
{
return NULL;
}
default:
break;
}
if (!window || !mouse) {
return event;
}
if (mouse->relative_mode) {
return event;
}
if (!(window->flags & SDL_WINDOW_INPUT_GRABBED)) {
return event;
}
/* This is the same coordinate system as Cocoa uses. */
nswindow = ((SDL_WindowData *) window->driverdata)->nswindow;
eventLocation = CGEventGetUnflippedLocation(event);
windowRect = [nswindow contentRectForFrameRect:[nswindow frame]];
if (!NSMouseInRect(NSPointFromCGPoint(eventLocation), windowRect, NO)) {
/* This is in CGs global screenspace coordinate system, which has a
* flipped Y.
*/
CGPoint newLocation = CGEventGetLocation(event);
if (eventLocation.x < NSMinX(windowRect)) {
newLocation.x = NSMinX(windowRect);
} else if (eventLocation.x >= NSMaxX(windowRect)) {
newLocation.x = NSMaxX(windowRect) - 1.0;
}
if (eventLocation.y <= NSMinY(windowRect)) {
newLocation.y -= (NSMinY(windowRect) - eventLocation.y + 1);
} else if (eventLocation.y > NSMaxY(windowRect)) {
newLocation.y += (eventLocation.y - NSMaxY(windowRect));
}
CGWarpMouseCursorPosition(newLocation);
CGAssociateMouseAndMouseCursorPosition(YES);
if ((CGEventMaskBit(type) & movementEventsMask) == 0) {
/* For click events, we just constrain the event to the window, so
* no other app receives the click event. We can't due the same to
* movement events, since they mean that our warp cursor above
* behaves strangely.
*/
CGEventSetLocation(event, newLocation);
}
}
return event;
}
static void
SemaphorePostCallback(CFRunLoopTimerRef timer, void *info)
{
SDL_SemPost((SDL_sem*)info);
}
static int
Cocoa_MouseTapThread(void *data)
{
SDL_MouseEventTapData *tapdata = (SDL_MouseEventTapData*)data;
/* Tap was created on main thread but we own it now. */
CFMachPortRef eventTap = tapdata->tap;
if (eventTap) {
/* Try to create a runloop source we can schedule. */
CFRunLoopSourceRef runloopSource = CFMachPortCreateRunLoopSource(kCFAllocatorDefault, eventTap, 0);
if (runloopSource) {
tapdata->runloopSource = runloopSource;
} else {
CFRelease(eventTap);
SDL_SemPost(tapdata->runloopStartedSemaphore);
/* TODO: Both here and in the return below, set some state in
* tapdata to indicate that initialization failed, which we should
* check in InitMouseEventTap, after we move the semaphore check
* from Quit to Init.
*/
return 1;
}
} else {
SDL_SemPost(tapdata->runloopStartedSemaphore);
return 1;
}
tapdata->runloop = CFRunLoopGetCurrent();
CFRunLoopAddSource(tapdata->runloop, tapdata->runloopSource, kCFRunLoopCommonModes);
CFRunLoopTimerContext context = {.info = tapdata->runloopStartedSemaphore};
/* We signal the runloop started semaphore *after* the run loop has started, indicating it's safe to CFRunLoopStop it. */
CFRunLoopTimerRef timer = CFRunLoopTimerCreate(kCFAllocatorDefault, CFAbsoluteTimeGetCurrent(), 0, 0, 0, &SemaphorePostCallback, &context);
CFRunLoopAddTimer(tapdata->runloop, timer, kCFRunLoopCommonModes);
CFRelease(timer);
/* Run the event loop to handle events in the event tap. */
CFRunLoopRun();
/* Make sure this is signaled so that SDL_QuitMouseEventTap knows it can safely SDL_WaitThread for us. */
if (SDL_SemValue(tapdata->runloopStartedSemaphore) < 1) {
SDL_SemPost(tapdata->runloopStartedSemaphore);
}
CFRunLoopRemoveSource(tapdata->runloop, tapdata->runloopSource, kCFRunLoopCommonModes);
/* Clean up. */
CGEventTapEnable(tapdata->tap, false);
CFRelease(tapdata->runloopSource);
CFRelease(tapdata->tap);
tapdata->runloopSource = NULL;
tapdata->tap = NULL;
return 0;
}
void
Cocoa_InitMouseEventTap(SDL_MouseData* driverdata)
{
SDL_MouseEventTapData *tapdata;
driverdata->tapdata = SDL_calloc(1, sizeof(SDL_MouseEventTapData));
tapdata = (SDL_MouseEventTapData*)driverdata->tapdata;
tapdata->runloopStartedSemaphore = SDL_CreateSemaphore(0);
if (tapdata->runloopStartedSemaphore) {
tapdata->tap = CGEventTapCreate(kCGSessionEventTap, kCGHeadInsertEventTap,
kCGEventTapOptionDefault, allGrabbedEventsMask,
&Cocoa_MouseTapCallback, tapdata);
if (tapdata->tap) {
/* Tap starts disabled, until app requests mouse grab */
CGEventTapEnable(tapdata->tap, false);
tapdata->thread = SDL_CreateThreadInternal(&Cocoa_MouseTapThread, "Event Tap Loop", 512 * 1024, tapdata);
if (tapdata->thread) {
/* Success - early out. Ownership transferred to thread. */
return;
}
CFRelease(tapdata->tap);
}
SDL_DestroySemaphore(tapdata->runloopStartedSemaphore);
}
SDL_free(driverdata->tapdata);
driverdata->tapdata = NULL;
}
void
Cocoa_EnableMouseEventTap(SDL_MouseData *driverdata, SDL_bool enabled)
{
SDL_MouseEventTapData *tapdata = (SDL_MouseEventTapData*)driverdata->tapdata;
if (tapdata && tapdata->tap)
{
CGEventTapEnable(tapdata->tap, !!enabled);
}
}
void
Cocoa_QuitMouseEventTap(SDL_MouseData *driverdata)
{
SDL_MouseEventTapData *tapdata = (SDL_MouseEventTapData*)driverdata->tapdata;
int status;
if (tapdata == NULL) {
/* event tap was already cleaned up (possibly due to CGEventTapCreate
* returning null.)
*/
return;
}
/* Ensure that the runloop has been started first.
* TODO: Move this to InitMouseEventTap, check for error conditions that can
* happen in Cocoa_MouseTapThread, and fall back to the non-EventTap way of
* grabbing the mouse if it fails to Init.
*/
status = SDL_SemWaitTimeout(tapdata->runloopStartedSemaphore, 5000);
if (status > -1) {
/* Then stop it, which will cause Cocoa_MouseTapThread to return. */
CFRunLoopStop(tapdata->runloop);
/* And then wait for Cocoa_MouseTapThread to finish cleaning up. It
* releases some of the pointers in tapdata. */
SDL_WaitThread(tapdata->thread, &status);
}
SDL_free(driverdata->tapdata);
driverdata->tapdata = NULL;
}
#else /* SDL_MAC_NO_SANDBOX */
void
Cocoa_InitMouseEventTap(SDL_MouseData *unused)
{
}
void
Cocoa_EnableMouseEventTap(SDL_MouseData *driverdata, SDL_bool enabled)
{
}
void
Cocoa_QuitMouseEventTap(SDL_MouseData *driverdata)
{
}
#endif /* !SDL_MAC_NO_SANDBOX */
#endif /* SDL_VIDEO_DRIVER_COCOA */
/* vi: set ts=4 sw=4 expandtab: */
| {
"pile_set_name": "Github"
} |
/**
* Copyright (c) 2013-present, Facebook, Inc.
* All rights reserved.
*
* This source code is licensed under the BSD-style license found in the
* LICENSE file in the root directory of this source tree. An additional grant
* of patent rights can be found in the PATENTS file in the same directory.
*
* @providesModule keyMirrorRecursive
* @flow weak
* @typechecks
*/
'use strict';
var invariant = require('./invariant');
/**
* Constructs an enumeration with keys equal to their value. If the value is an
* object, the method is run recursively, including the parent key as a suffix.
* An optional prefix can be provided that will be prepended to each value.
*
* For example:
*
* var ACTIONS = keyMirror({FOO: null, BAR: { BAZ: null, BOZ: null }}});
* ACTIONS.BAR.BAZ = 'BAR.BAZ';
*
* Input: {key1: null, key2: { nested1: null, nested2: null }}}
* Output: {key1: key1, key2: { nested1: nested1, nested2: nested2 }}}
*
* var CONSTANTS = keyMirror({FOO: {BAR: null}}, 'NameSpace');
* console.log(CONSTANTS.FOO.BAR); // NameSpace.FOO.BAR
*/
function keyMirrorRecursive<T>(obj: T, prefix?: ?string): T {
return keyMirrorRecursiveInternal(obj, prefix);
}
function keyMirrorRecursiveInternal(
/*object*/obj,
/*?string*/prefix) /*object*/{
var ret = {};
var key;
invariant(isObject(obj), 'keyMirrorRecursive(...): Argument must be an object.');
for (key in obj) {
if (!obj.hasOwnProperty(key)) {
continue;
}
var val = obj[key];
var newPrefix = prefix ? prefix + '.' + key : key;
if (isObject(val)) {
val = keyMirrorRecursiveInternal(val, newPrefix);
} else {
val = newPrefix;
}
ret[key] = val;
}
return ret;
}
function isObject(obj) /*boolean*/{
return obj instanceof Object && !Array.isArray(obj);
}
module.exports = keyMirrorRecursive; | {
"pile_set_name": "Github"
} |
/* For information on usage and redistribution, and for a DISCLAIMER OF ALL
* WARRANTIES, see the file, "LICENSE.txt," in this distribution.
iem_matrix written by Thomas Musil (c) IEM KUG Graz Austria 2002 - 2006 */
#include "m_pd.h"
#include "math.h"
/* -------------------------- spherical_line ------------------------------ */
typedef struct _spherical_line
{
t_object x_obj;
int x_dim;
double *x_work2;
double *x_buf2;
t_atom *x_at;
} t_spherical_line;
static t_class *spherical_line_class;
static void spherical_line_rot_z(t_spherical_line *x, double *vec, double angle)
{
int i;
double s=sin(angle);
double c=cos(angle);
double sum=0.0;
dw += row*dim2;
for(i=0; i<dim2; i++)
{
*db++ = *dw++;
}
}
static void spherical_line_copy_row2buf(t_spherical_line *x, int row)
{
int dim2 = 2*x->x_dim;
int i;
double *dw=x->x_work2;
double *db=x->x_buf2;
dw += row*dim2;
for(i=0; i<dim2; i++)
{
*db++ = *dw++;
}
}
static void spherical_line_copy_buf2row(t_spherical_line *x, int row)
{
int dim2 = 2*x->x_dim;
int i;
double *dw=x->x_work2;
double *db=x->x_buf2;
dw += row*dim2;
for(i=0; i<dim2; i++)
{
*dw++ = *db++;
}
}
static void spherical_line_copy_row2row(t_spherical_line *x, int src_row, int dst_row)
{
int dim2 = 2*x->x_dim;
int i;
double *dw_src=x->x_work2;
double *dw_dst=x->x_work2;
dw_src += src_row*dim2;
dw_dst += dst_row*dim2;
for(i=0; i<dim2; i++)
{
*dw_dst++ = *dw_src++;
}
}
static void spherical_line_xch_rows(t_spherical_line *x, int row1, int row2)
{
spherical_line_copy_row2buf(x, row1);
spherical_line_copy_row2row(x, row2, row1);
spherical_line_copy_buf2row(x, row2);
}
static void spherical_line_mul_row(t_spherical_line *x, int row, double mul)
{
int dim2 = 2*x->x_dim;
int i;
double *dw=x->x_work2;
dw += row*dim2;
for(i=0; i<dim2; i++)
{
(*dw++) *= mul;
}
}
static void spherical_line_mul_buf_and_add2row(t_spherical_line *x, int row, double mul)
{
int dim2 = 2*x->x_dim;
int i;
double *dw=x->x_work2;
double *db=x->x_buf2;
dw += row*dim2;
for(i=0; i<dim2; i++)
{
*dw++ += (*db++)*mul;
}
}
static int spherical_line_eval_which_element_of_col_not_zero(t_spherical_line *x, int col, int start_row)
{
int dim = x->x_dim;
int dim2 = 2*dim;
int i, j;
double *dw=x->x_work2;
int ret=-1;
dw += start_row*dim2 + col;
j = 0;
for(i=start_row; i<dim; i++)
{
if( (*dw > 1.0e-10) || (*dw < -1.0e-10) )
{
ret = i;
i = dim+1;
}
dw += dim2;
}
return(ret);
}
static void spherical_line_matrix(t_spherical_line *x, t_symbol *s, int argc, t_atom *argv)
{
int dim = x->x_dim;
int dim2 = 2*dim;
int i, j, nz;
int r,c;
double *db=x->x_work2;
double rcp, *dv=db;
t_atom *at=x->x_at;
if(argc != (dim*dim + 2))
{
post("spherical_line ERROR: wrong dimension of input-list");
return;
}
r = (int)(atom_getint(argv++));
c = (int)(atom_getint(argv++));
if(r != dim)
{
post("spherical_line ERROR: wrong number of rows of input-list");
return;
}
if(c != dim)
{
post("spherical_line ERROR: wrong number of cols of input-list");
return;
}
for(i=0; i<dim; i++) /* init */
{
for(j=0; j<dim; j++)
{
*dv++ = (double)(atom_getfloat(argv++));
}
for(j=0; j<dim; j++)
{
if(j == i)
*dv++ = 1.0;
else
*dv++ = 0.0;
}
}
/* make 1 in main-diagonale, and 0 below */
for(i=0; i<dim; i++)
{
nz = spherical_line_eval_which_element_of_col_not_zero(x, i, i);
if(nz < 0)
{
post("spherical_line ERROR: matrix not regular");
return;
}
else
{
if(nz != i)
{
spherical_line_xch_rows(x, i, nz);
}
dv = db + i*dim2 + i;
rcp = 1.0 /(*dv);
spherical_line_mul_row(x, i, rcp);
spherical_line_copy_row2buf(x, i);
for(j=i+1; j<dim; j++)
{
dv += dim2;
rcp = -(*dv);
spherical_line_mul_buf_and_add2row(x, j, rcp);
}
}
}
/* make 0 above the main diagonale */
for(i=dim-1; i>=0; i--)
{
dv = db + i*dim2 + i;
spherical_line_copy_row2buf(x, i);
for(j=i-1; j>=0; j--)
{
dv -= dim2;
rcp = -(*dv);
spherical_line_mul_buf_and_add2row(x, j, rcp);
}
}
at = x->x_at;
SETFLOAT(at, (t_float)dim);
at++;
SETFLOAT(at, (t_float)dim);
at++;
dv = db;
dv += dim;
for(i=0; i<dim; i++) /* output left half of double-matrix */
{
for(j=0; j<dim; j++)
{
SETFLOAT(at, (t_float)(*dv++));
at++;
}
dv += dim;
}
outlet_anything(x->x_obj.ob_outlet, gensym("matrix"), argc, x->x_at);
}
static void spherical_line_free(t_spherical_line *x)
{
freebytes(x->x_work2, 2 * x->x_dim * x->x_dim * sizeof(double));
freebytes(x->x_buf2, 2 * x->x_dim * sizeof(double));
freebytes(x->x_at, (x->x_dim * x->x_dim + 2) * sizeof(t_atom));
}
static void *spherical_line_new(t_floatarg fdim)
{
t_spherical_line *x = (t_spherical_line *)pd_new(spherical_line_class);
int dim = (int)fdim;
if(dim < 1)
dim = 1;
x->x_dim = dim;
x->x_work2 = (double *)getbytes(2 * x->x_dim * x->x_dim * sizeof(double));
x->x_buf2 = (double *)getbytes(2 * x->x_dim * sizeof(double));
x->x_at = (t_atom *)getbytes((x->x_dim * x->x_dim + 2) * sizeof(t_atom));
outlet_new(&x->x_obj, &s_list);
return (x);
}
static void spherical_line_setup(void)
{
spherical_line_class = class_new(gensym("spherical_line"), (t_newmethod)spherical_line_new, (t_method)spherical_line_free,
sizeof(t_spherical_line), 0, A_FLOAT, 0);
class_addmethod(spherical_line_class, (t_method)spherical_line_matrix, gensym("matrix"), A_GIMME, 0);
// class_sethelpsymbol(spherical_line_class, gensym("iemhelp/spherical_line-help"));
}
| {
"pile_set_name": "Github"
} |
import React from "react";
import GooglePlay from "../assets/images/googleplay-badge.svg";
import AppleStore from "../assets/images/applestore-badge.svg";
import { Link } from "@material-ui/core";
export interface Props {
iconSize: number;
googlePlayLink: string;
appleStoreLink: string;
targetBlank?: boolean;
className?: string;
}
export default function (props: Props) {
const target = props.targetBlank ? "_blank" : undefined;
const width = props.iconSize;
return (
<div className={props.className}>
<Link href={props.googlePlayLink} target={target}>
<img src={GooglePlay} alt="google play" style={{ width }} />
</Link>
<Link href={props.appleStoreLink} target={target}>
<img src={AppleStore} alt="apple store" style={{ width }} />
</Link>
</div >
)
} | {
"pile_set_name": "Github"
} |
module github.com/GoogleCloudPlatform/golang-samples/functions/firebase/upper
require (
cloud.google.com/go/firestore v1.2.0
firebase.google.com/go/v4 v4.0.0
)
go 1.11
| {
"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.
*/
package com.facebook.imagepipeline.producers;
public interface ThreadHandoffProducerQueue {
void addToQueueOrExecute(Runnable runnable);
void startQueueing();
void stopQueuing();
void remove(Runnable runnable);
boolean isQueueing();
}
| {
"pile_set_name": "Github"
} |
//----------------------------------------------------------------------------------------------
// <copyright file="HolographicThermal.cs" company="Microsoft Corporation">
// Licensed under the MIT License. See LICENSE.TXT in the project root license information.
// </copyright>
//----------------------------------------------------------------------------------------------
using System;
using System.Runtime.Serialization;
using System.Threading.Tasks;
namespace Microsoft.Tools.WindowsDevicePortal
{
/// <summary>
/// Thermal State enumeration
/// </summary>
public enum ThermalStages
{
/// <summary>
/// No thermal stage
/// </summary>
Normal,
/// <summary>
/// Warm stage
/// </summary>
Warm,
/// <summary>
/// Critical stage
/// </summary>
Critical,
/// <summary>
/// Unknown stage
/// </summary>
Unknown = 9999
}
/// <content>
/// Wrappers for Holographic Thermal methods
/// </content>
public partial class DevicePortal
{
/// <summary>
/// API for getting the thermal stage
/// </summary>
public static readonly string ThermalStageApi = "api/holographic/thermal/stage";
/// <summary>
/// Gets the current thermal stage reading from the device.
/// </summary>
/// <returns>ThermalStages enum value.</returns>
/// <remarks>This method is only supported on HoloLens.</remarks>
public async Task<ThermalStages> GetThermalStageAsync()
{
if (!Utilities.IsHoloLens(this.Platform, this.DeviceFamily))
{
throw new NotSupportedException("This method is only supported on HoloLens.");
}
ThermalStage thermalStage = await this.GetAsync<ThermalStage>(ThermalStageApi);
return thermalStage.Stage;
}
#region Data contract
/// <summary>
/// Object representation of thermal stage
/// </summary>
[DataContract]
public class ThermalStage
{
/// <summary>
/// Gets the raw stage value
/// </summary>
[DataMember(Name = "CurrentStage")]
public int StageRaw { get; private set; }
/// <summary>
/// Gets the enumeration value of the thermal stage
/// </summary>
public ThermalStages Stage
{
get
{
ThermalStages stage = ThermalStages.Unknown;
try
{
stage = (ThermalStages)Enum.ToObject(typeof(ThermalStages), this.StageRaw);
if (!Enum.IsDefined(typeof(ThermalStages), stage))
{
stage = ThermalStages.Unknown;
}
}
catch
{
stage = ThermalStages.Unknown;
}
return stage;
}
}
}
#endregion // Data contract
}
}
| {
"pile_set_name": "Github"
} |
/*
* nautilus-progress-persistence-handler.c: file operation progress notification handler.
*
* Copyright (C) 2007, 2011, 2015 Red Hat, Inc.
*
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License as
* published by the Free Software Foundation; either version 2 of the
* License, or (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* General Public License for more details.
*
* You should have received a copy of the GNU General Public
* License along with this program; if not, see <http://www.gnu.org/licenses/>.
*
* Authors: Alexander Larsson <[email protected]>
* Cosimo Cecchi <[email protected]>
* Carlos Soriano <[email protected]>
*
*/
#include <config.h>
#include "nautilus-progress-persistence-handler.h"
#include "nautilus-application.h"
#include "nautilus-progress-info-widget.h"
#include <glib/gi18n.h>
#include "nautilus-progress-info.h"
#include "nautilus-progress-info-manager.h"
struct _NautilusProgressPersistenceHandler
{
GObject parent_instance;
NautilusProgressInfoManager *manager;
NautilusApplication *app;
guint active_infos;
};
G_DEFINE_TYPE (NautilusProgressPersistenceHandler, nautilus_progress_persistence_handler, G_TYPE_OBJECT);
/* Our policy for showing progress notification is the following:
* - file operations that end within two seconds do not get notified in any way
* - if no file operations are running, and one passes the two seconds
* timeout, a window is displayed with the progress
* - if the window is closed, we show a resident notification, depending on
* the capabilities of the notification daemon running in the session
* - if some file operations are running, and another one passes the two seconds
* timeout, and the window is showing, we add it to the window directly
* - in the same case, but when the window is not showing, we update the resident
* notification, changing its message
* - when one file operation finishes, if it's not the last one, we only update the
* resident notification's message
* - in the same case, if it's the last one, we close the resident notification,
* and trigger a transient one
* - in the same case, but the window was showing, we just hide the window
*/
static gboolean server_has_persistence (void);
static void
show_file_transfers (NautilusProgressPersistenceHandler *self)
{
GFile *home;
home = g_file_new_for_path (g_get_home_dir ());
nautilus_application_open_location (self->app, home, NULL, NULL);
g_object_unref (home);
}
static void
action_show_file_transfers (GSimpleAction *action,
GVariant *parameter,
gpointer user_data)
{
NautilusProgressPersistenceHandler *self;
self = NAUTILUS_PROGRESS_PERSISTENCE_HANDLER (user_data);
show_file_transfers (self);
}
static GActionEntry progress_persistence_entries[] =
{
{ "show-file-transfers", action_show_file_transfers, NULL, NULL, NULL }
};
static void
progress_persistence_handler_update_notification (NautilusProgressPersistenceHandler *self)
{
GNotification *notification;
gchar *body;
if (!server_has_persistence ())
{
return;
}
notification = g_notification_new (_("File Operations"));
g_notification_set_default_action (notification, "app.show-file-transfers");
g_notification_add_button (notification, _("Show Details"),
"app.show-file-transfers");
body = g_strdup_printf (ngettext ("%'d file operation active",
"%'d file operations active",
self->active_infos),
self->active_infos);
g_notification_set_body (notification, body);
nautilus_application_send_notification (self->app,
"progress", notification);
g_object_unref (notification);
g_free (body);
}
void
nautilus_progress_persistence_handler_make_persistent (NautilusProgressPersistenceHandler *self)
{
GList *windows;
windows = nautilus_application_get_windows (self->app);
if (self->active_infos > 0 && windows == NULL)
{
progress_persistence_handler_update_notification (self);
}
}
static void
progress_persistence_handler_show_complete_notification (NautilusProgressPersistenceHandler *self)
{
GNotification *complete_notification;
if (!server_has_persistence ())
{
return;
}
complete_notification = g_notification_new (_("File Operations"));
g_notification_set_body (complete_notification,
_("All file operations have been successfully completed"));
nautilus_application_send_notification (self->app,
"transfer-complete",
complete_notification);
g_object_unref (complete_notification);
}
static void
progress_persistence_handler_hide_notification (NautilusProgressPersistenceHandler *self)
{
if (!server_has_persistence ())
{
return;
}
nautilus_application_withdraw_notification (self->app,
"progress");
}
static void
progress_info_finished_cb (NautilusProgressInfo *info,
NautilusProgressPersistenceHandler *self)
{
GtkWindow *last_active_window;
self->active_infos--;
last_active_window = gtk_application_get_active_window (GTK_APPLICATION (self->app));
if (self->active_infos > 0)
{
if (last_active_window == NULL)
{
progress_persistence_handler_update_notification (self);
}
}
else
{
if ((last_active_window == NULL) || !gtk_window_has_toplevel_focus (last_active_window))
{
progress_persistence_handler_hide_notification (self);
progress_persistence_handler_show_complete_notification (self);
}
}
}
static void
handle_new_progress_info (NautilusProgressPersistenceHandler *self,
NautilusProgressInfo *info)
{
GList *windows;
g_signal_connect (info, "finished",
G_CALLBACK (progress_info_finished_cb), self);
self->active_infos++;
windows = nautilus_application_get_windows (self->app);
if (windows == NULL)
{
progress_persistence_handler_update_notification (self);
}
}
typedef struct
{
NautilusProgressInfo *info;
NautilusProgressPersistenceHandler *self;
} TimeoutData;
static void
timeout_data_free (TimeoutData *data)
{
g_clear_object (&data->self);
g_clear_object (&data->info);
g_slice_free (TimeoutData, data);
}
static TimeoutData *
timeout_data_new (NautilusProgressPersistenceHandler *self,
NautilusProgressInfo *info)
{
TimeoutData *retval;
retval = g_slice_new0 (TimeoutData);
retval->self = g_object_ref (self);
retval->info = g_object_ref (info);
return retval;
}
static gboolean
new_op_started_timeout (TimeoutData *data)
{
NautilusProgressInfo *info = data->info;
NautilusProgressPersistenceHandler *self = data->self;
if (nautilus_progress_info_get_is_paused (info))
{
return TRUE;
}
if (!nautilus_progress_info_get_is_finished (info))
{
handle_new_progress_info (self, info);
}
timeout_data_free (data);
return FALSE;
}
static void
release_application (NautilusProgressInfo *info,
NautilusProgressPersistenceHandler *self)
{
/* release the GApplication hold we acquired */
g_application_release (g_application_get_default ());
}
static void
progress_info_started_cb (NautilusProgressInfo *info,
NautilusProgressPersistenceHandler *self)
{
TimeoutData *data;
/* hold GApplication so we never quit while there's an operation pending */
g_application_hold (g_application_get_default ());
g_signal_connect (info, "finished",
G_CALLBACK (release_application), self);
data = timeout_data_new (self, info);
/* timeout for the progress window to appear */
g_timeout_add_seconds (2,
(GSourceFunc) new_op_started_timeout,
data);
}
static void
new_progress_info_cb (NautilusProgressInfoManager *manager,
NautilusProgressInfo *info,
NautilusProgressPersistenceHandler *self)
{
g_signal_connect (info, "started",
G_CALLBACK (progress_info_started_cb), self);
}
static void
nautilus_progress_persistence_handler_dispose (GObject *obj)
{
NautilusProgressPersistenceHandler *self = NAUTILUS_PROGRESS_PERSISTENCE_HANDLER (obj);
g_clear_object (&self->manager);
G_OBJECT_CLASS (nautilus_progress_persistence_handler_parent_class)->dispose (obj);
}
static gboolean
server_has_persistence (void)
{
static gboolean retval = FALSE;
GDBusConnection *conn;
GVariant *result;
char **cap, **caps;
static gboolean initialized = FALSE;
if (initialized)
{
return retval;
}
initialized = TRUE;
conn = g_application_get_dbus_connection (g_application_get_default ());
result = g_dbus_connection_call_sync (conn,
"org.freedesktop.Notifications",
"/org/freedesktop/Notifications",
"org.freedesktop.Notifications",
"GetCapabilities",
g_variant_new ("()"),
G_VARIANT_TYPE ("(as)"),
G_DBUS_CALL_FLAGS_NONE,
-1, NULL, NULL);
if (result == NULL)
{
return FALSE;
}
g_variant_get (result, "(^a&s)", &caps);
for (cap = caps; *cap != NULL; cap++)
{
if (g_strcmp0 ("persistence", *cap) == 0)
{
retval = TRUE;
}
}
g_free (caps);
g_variant_unref (result);
return retval;
}
static void
nautilus_progress_persistence_handler_init (NautilusProgressPersistenceHandler *self)
{
self->manager = nautilus_progress_info_manager_dup_singleton ();
g_signal_connect (self->manager, "new-progress-info",
G_CALLBACK (new_progress_info_cb), self);
}
static void
nautilus_progress_persistence_handler_class_init (NautilusProgressPersistenceHandlerClass *klass)
{
GObjectClass *oclass;
oclass = G_OBJECT_CLASS (klass);
oclass->dispose = nautilus_progress_persistence_handler_dispose;
}
NautilusProgressPersistenceHandler *
nautilus_progress_persistence_handler_new (GObject *app)
{
NautilusProgressPersistenceHandler *self;
self = g_object_new (NAUTILUS_TYPE_PROGRESS_PERSISTENCE_HANDLER, NULL);
self->app = NAUTILUS_APPLICATION (app);
g_action_map_add_action_entries (G_ACTION_MAP (self->app),
progress_persistence_entries, G_N_ELEMENTS (progress_persistence_entries),
self);
return self;
}
| {
"pile_set_name": "Github"
} |
// Decompiled by Jad v1.5.8f. Copyright 2001 Pavel Kouznetsov.
// Jad home page: http://www.kpdus.com/jad.html
// Decompiler options: packimports(3)
// Source File Name: ProgramMenuBar.java
package acm.program;
import java.awt.CheckboxMenuItem;
import java.awt.MenuShortcut;
import java.awt.event.ActionEvent;
import java.awt.event.ActionListener;
import javax.swing.JCheckBoxMenuItem;
import javax.swing.KeyStroke;
import javax.swing.event.ChangeEvent;
import javax.swing.event.ChangeListener;
class OldStyleCheckBoxMenuItem extends CheckboxMenuItem
implements ActionListener, ChangeListener
{
public OldStyleCheckBoxMenuItem(JCheckBoxMenuItem jcheckboxmenuitem)
{
super(jcheckboxmenuitem.getText());
twin = jcheckboxmenuitem;
addActionListener(this);
twin.addChangeListener(this);
setState(twin.getState());
setEnabled(twin.isEnabled());
KeyStroke keystroke = twin.getAccelerator();
if(keystroke != null)
setShortcut(createShortcut(keystroke));
}
public void actionPerformed(ActionEvent actionevent)
{
twin.doClick(0);
}
public void stateChanged(ChangeEvent changeevent)
{
setState(twin.getState());
setEnabled(twin.isEnabled());
}
private MenuShortcut createShortcut(KeyStroke keystroke)
{
boolean flag = (keystroke.getModifiers() & 1) != 0;
return new MenuShortcut(keystroke.getKeyCode(), flag);
}
private JCheckBoxMenuItem twin;
}
| {
"pile_set_name": "Github"
} |
; requires Windows 2000 Service Pack 3, Windows 98, Windows 98 Second Edition, Windows ME, Windows Server 2003, Windows XP Service Pack 2
; requires Windows Installer 3.0
; http://www.microsoft.com/en-us/download/details.aspx?id=3387
[CustomMessages]
vcredist2005_title=Visual C++ 2005 Redistributable
vcredist2005_title_x64=Visual C++ 2005 64-Bit Redistributable
vcredist2005_title_ia64=Visual C++ 2005 Itanium Redistributable
en.vcredist2005_size=2.6 MB
de.vcredist2005_size=2,6 MB
en.vcredist2005_size_x64=4.1 MB
de.vcredist2005_size_x64=4,1 MB
en.vcredist2005_size_ia64=8.8 MB
de.vcredist2005_size_ia64=8,8 MB
[Code]
const
vcredist2005_url = 'http://download.microsoft.com/download/d/3/4/d342efa6-3266-4157-a2ec-5174867be706/vcredist_x86.exe';
vcredist2005_url_x64 = 'http://download.microsoft.com/download/9/1/4/914851c6-9141-443b-bdb4-8bad3a57bea9/vcredist_x64.exe';
vcredist2005_url_ia64 = 'http://download.microsoft.com/download/8/1/6/816129e4-7f2f-4ba6-b065-684223e2fe1e/vcredist_IA64.exe';
vcredist2005_productcode = '{A49F249F-0C91-497F-86DF-B2585E8E76B7}';
vcredist2005_productcode_x64 = '{6E8E85E8-CE4B-4FF5-91F7-04999C9FAE6A}';
vcredist2005_productcode_ia64 = '{03ED71EA-F531-4927-AABD-1C31BCE8E187}';
procedure vcredist2005();
begin
if (not msiproduct(GetString(vcredist2005_productcode, vcredist2005_productcode_x64, vcredist2005_productcode_ia64))) then
AddProduct('vcredist2005' + GetArchitectureString() + '.exe',
'/q:a /c:"install /qb /l',
CustomMessage('vcredist2005_title' + GetArchitectureString()),
CustomMessage('vcredist2005_size' + GetArchitectureString()),
GetString(vcredist2005_url, vcredist2005_url_x64, vcredist2005_url_ia64),
false, false, false);
end;
[Setup]
| {
"pile_set_name": "Github"
} |
# Copyright (c) 2014-2020 Maltrail developers (https://github.com/stamparm/maltrail/)
# See the file 'LICENSE' for copying permission
# Reference: https://twitter.com/malwrhunterteam/status/1121825095792590849
# Reference: https://twitter.com/James_inthe_box/status/1121825506133811201
olex.live
# Reference: https://twitter.com/malwrhunterteam/status/1121858510441132032
# Reference: https://twitter.com/James_inthe_box/status/1121868484642631680
branchesv.com
# Reference: https://twitter.com/malwrhunterteam/status/1126013665155670016
# Reference: https://twitter.com/James_inthe_box/status/1126096193862287360
159.69.88.115:443
# Reference: https://twitter.com/James_inthe_box/status/1185530740911423488
vdscloud.net
| {
"pile_set_name": "Github"
} |
/*
* YAFFS: Yet another FFS. A NAND-flash specific file system.
*
* Copyright (C) 2002-2011 Aleph One Ltd.
* for Toby Churchill Ltd and Brightstar Engineering
*
* Created by Timothy Manning <[email protected]>
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License version 2 as
* published by the Free Software Foundation.
*/
#include "yaffsfs.h"
struct error_entry {
int code;
const char *text;
};
static const struct error_entry error_list[] = {
{ ENOMEM , "ENOMEM" },
{ EBUSY , "EBUSY"},
{ ENODEV , "ENODEV"},
{ EINVAL , "EINVAL"},
{ EBADF , "EBADF"},
{ EACCES , "EACCES"},
{ EXDEV , "EXDEV" },
{ ENOENT , "ENOENT"},
{ ENOSPC , "ENOSPC"},
{ ERANGE , "ERANGE"},
{ ENODATA, "ENODATA"},
{ ENOTEMPTY, "ENOTEMPTY"},
{ ENAMETOOLONG, "ENAMETOOLONG"},
{ ENOMEM , "ENOMEM"},
{ EEXIST , "EEXIST"},
{ ENOTDIR , "ENOTDIR"},
{ EISDIR , "EISDIR"},
{ ENFILE, "ENFILE"},
{ EROFS, "EROFS"},
{ EFAULT, "EFAULT"},
{ 0, NULL }
};
const char *yaffs_error_to_str(int err)
{
const struct error_entry *e = error_list;
if (err < 0)
err = -err;
while (e->code && e->text) {
if (err == e->code)
return e->text;
e++;
}
return "Unknown error code";
}
| {
"pile_set_name": "Github"
} |
<!DOCTYPE HTML>
<title>Test for 'unicode-bidi' on table cells</title>
<fieldset style="unicode-bidi: bidi-override; direction: rtl; text-align: left">
cba
</fieldset>
| {
"pile_set_name": "Github"
} |
[
{
"afsName": "whiteRock",
"pngs": [
{
"path": "rock_big.P.png",
"frameNum.col": 4,
"frameNum.row": 9,
"totalFrameNum": 36,
"isHaveShadow": true,
"isPjtSingle": true,
"isShadowSingle": false,
"subspecs": [
{
"type": "handle",
"animLabel": "Big_Light_Bald",
"subIdx": 0,
"AnimActionParams":[
{ "actionEName": "Idle", "dir": "Center", "brokenLvl": 0, "type": "singleFrame", "lFrameIdx": 0, "isOpaque": true },
{ "actionEName": "Idle", "dir": "Center", "brokenLvl": 1, "type": "singleFrame", "lFrameIdx": 1, "isOpaque": true },
{ "actionEName": "Idle", "dir": "L", "brokenLvl": 0, "type": "singleFrame", "lFrameIdx": 4, "isOpaque": true },
{ "actionEName": "Idle", "dir": "L", "brokenLvl": 1, "type": "singleFrame", "lFrameIdx": 5, "isOpaque": true },
{ "actionEName": "Idle", "dir": "LT", "brokenLvl": 0, "type": "singleFrame", "lFrameIdx": 8, "isOpaque": true },
{ "actionEName": "Idle", "dir": "LT", "brokenLvl": 1, "type": "singleFrame", "lFrameIdx": 9, "isOpaque": true },
{ "actionEName": "Idle", "dir": "T", "brokenLvl": 0, "type": "singleFrame", "lFrameIdx": 12, "isOpaque": true },
{ "actionEName": "Idle", "dir": "T", "brokenLvl": 1, "type": "singleFrame", "lFrameIdx": 13, "isOpaque": true },
{ "actionEName": "Idle", "dir": "RT", "brokenLvl": 0, "type": "singleFrame", "lFrameIdx": 16, "isOpaque": true },
{ "actionEName": "Idle", "dir": "RT", "brokenLvl": 1, "type": "singleFrame", "lFrameIdx": 17, "isOpaque": true },
{ "actionEName": "Idle", "dir": "R", "brokenLvl": 0, "type": "singleFrame", "lFrameIdx": 20, "isOpaque": true },
{ "actionEName": "Idle", "dir": "R", "brokenLvl": 1, "type": "singleFrame", "lFrameIdx": 21, "isOpaque": true },
{ "actionEName": "Idle", "dir": "RB", "brokenLvl": 0, "type": "singleFrame", "lFrameIdx": 24, "isOpaque": true },
{ "actionEName": "Idle", "dir": "RB", "brokenLvl": 1, "type": "singleFrame", "lFrameIdx": 25, "isOpaque": true },
{ "actionEName": "Idle", "dir": "B", "brokenLvl": 0, "type": "singleFrame", "lFrameIdx": 28, "isOpaque": true },
{ "actionEName": "Idle", "dir": "B", "brokenLvl": 1, "type": "singleFrame", "lFrameIdx": 29, "isOpaque": true },
{ "actionEName": "Idle", "dir": "LB", "brokenLvl": 0, "type": "singleFrame", "lFrameIdx": 32, "isOpaque": true },
{ "actionEName": "Idle", "dir": "LB", "brokenLvl": 1, "type": "singleFrame", "lFrameIdx": 33, "isOpaque": true }
]
},
{
"type": "handle",
"animLabel": "Big_Light_Lichen",
"subIdx": 0,
"AnimActionParams":[
{ "actionEName": "Idle", "dir": "Center", "brokenLvl": 0, "type": "singleFrame", "lFrameIdx": 2, "isOpaque": true },
{ "actionEName": "Idle", "dir": "Center", "brokenLvl": 1, "type": "singleFrame", "lFrameIdx": 3, "isOpaque": true },
{ "actionEName": "Idle", "dir": "L", "brokenLvl": 0, "type": "singleFrame", "lFrameIdx": 6, "isOpaque": true },
{ "actionEName": "Idle", "dir": "L", "brokenLvl": 1, "type": "singleFrame", "lFrameIdx": 7, "isOpaque": true },
{ "actionEName": "Idle", "dir": "LT", "brokenLvl": 0, "type": "singleFrame", "lFrameIdx": 10, "isOpaque": true },
{ "actionEName": "Idle", "dir": "LT", "brokenLvl": 1, "type": "singleFrame", "lFrameIdx": 11, "isOpaque": true },
{ "actionEName": "Idle", "dir": "T", "brokenLvl": 0, "type": "singleFrame", "lFrameIdx": 14, "isOpaque": true },
{ "actionEName": "Idle", "dir": "T", "brokenLvl": 1, "type": "singleFrame", "lFrameIdx": 15, "isOpaque": true },
{ "actionEName": "Idle", "dir": "RT", "brokenLvl": 0, "type": "singleFrame", "lFrameIdx": 18, "isOpaque": true },
{ "actionEName": "Idle", "dir": "RT", "brokenLvl": 1, "type": "singleFrame", "lFrameIdx": 19, "isOpaque": true },
{ "actionEName": "Idle", "dir": "R", "brokenLvl": 0, "type": "singleFrame", "lFrameIdx": 22, "isOpaque": true },
{ "actionEName": "Idle", "dir": "R", "brokenLvl": 1, "type": "singleFrame", "lFrameIdx": 23, "isOpaque": true },
{ "actionEName": "Idle", "dir": "RB", "brokenLvl": 0, "type": "singleFrame", "lFrameIdx": 26, "isOpaque": true },
{ "actionEName": "Idle", "dir": "RB", "brokenLvl": 1, "type": "singleFrame", "lFrameIdx": 27, "isOpaque": true },
{ "actionEName": "Idle", "dir": "B", "brokenLvl": 0, "type": "singleFrame", "lFrameIdx": 30, "isOpaque": true },
{ "actionEName": "Idle", "dir": "B", "brokenLvl": 1, "type": "singleFrame", "lFrameIdx": 31, "isOpaque": true },
{ "actionEName": "Idle", "dir": "LB", "brokenLvl": 0, "type": "singleFrame", "lFrameIdx": 34, "isOpaque": true },
{ "actionEName": "Idle", "dir": "LB", "brokenLvl": 1, "type": "singleFrame", "lFrameIdx": 35, "isOpaque": true }
]
}
]
}
]
}
]
| {
"pile_set_name": "Github"
} |
% Generated by roxygen2: do not edit by hand
% Please edit documentation in R/ooxml_run_objects.R
\name{page_size}
\alias{page_size}
\title{page size object}
\usage{
page_size(width = 21/2.54, height = 29.7/2.54, orient = "portrait")
}
\arguments{
\item{width, height}{page width, page height (in inches).}
\item{orient}{page orientation, either 'landscape', either 'portrait'.}
}
\description{
The function creates a representation of the dimensions of a page. The
dimensions are defined by length, width and orientation. If the orientation is
in landscape mode then the length becomes the width and the width becomes the length.
}
\examples{
page_size(orient = "landscape")
}
\seealso{
Other functions for section definition:
\code{\link{page_mar}()},
\code{\link{prop_section}()},
\code{\link{section_columns}()}
}
\concept{functions for section definition}
| {
"pile_set_name": "Github"
} |
/*
* /MathJax/jax/output/HTML-CSS/fonts/Latin-Modern/Operators/Regular/Main.js
*
* Copyright (c) 2009-2014 The MathJax Consortium
*
* 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.
*/
MathJax.OutputJax["HTML-CSS"].FONTDATA.FONTS.LatinModernMathJax_Operators={directory:"Operators/Regular",family:"LatinModernMathJax_Operators",testString:"\u00A0\u2206\u220A\u220C\u220E\u220F\u2210\u2211\u221F\u222C\u222D\u222E\u222F\u2230\u2231",32:[0,0,332,0,0],160:[0,0,332,0,0],8710:[716,0,833,47,785],8714:[443,-57,498,56,442],8716:[730,230,667,80,587],8718:[554,0,666,56,610],8719:[750,250,944,56,887],8720:[750,250,944,56,887],8721:[750,250,1056,56,999],8735:[679,-13,778,56,722],8748:[805,306,1035,56,979],8749:[805,306,1405,56,1349],8750:[805,306,665,56,609],8751:[805,306,1035,56,979],8752:[805,306,1405,56,1349],8753:[805,306,695,56,667],8754:[805,306,700,56,672],8755:[805,306,682,56,644],8758:[422,-78,278,86,192],8759:[422,-78,516,86,430],8760:[504,-230,778,56,722],8761:[422,-78,906,56,850],8762:[504,4,778,56,722],8763:[536,36,773,56,717],8766:[466,-34,901,56,845],8767:[492,-8,778,56,722],8772:[603,103,778,56,722],8775:[603,103,778,56,722],8777:[603,103,773,56,717],8779:[541,41,773,56,717],8780:[541,-36,778,56,722],8788:[422,-78,906,56,850],8789:[422,-78,906,56,850],8792:[619,-133,778,56,722],8793:[752,-133,778,56,722],8794:[752,-133,778,56,722],8795:[810,-133,778,56,722],8797:[793,-133,778,56,722],8798:[684,-133,778,56,722],8799:[803,-133,778,56,722],8802:[730,230,778,56,722],8803:[561,61,778,56,722],8813:[730,230,778,56,722],8820:[691,191,776,55,719],8821:[691,191,776,55,719],8824:[776,276,778,76,701],8825:[776,276,778,76,701],8836:[730,230,778,85,693],8837:[730,230,778,85,693],8844:[604,20,667,61,607],8845:[604,20,667,61,607],8860:[592,92,796,56,740],8870:[684,0,445,56,389],8871:[684,0,445,56,389],8875:[684,0,653,56,597],8886:[400,-100,1078,56,1022],8887:[400,-100,1078,56,1022],8889:[603,103,818,56,762],8893:[684,17,642,55,585],8894:[679,109,900,56,844],8895:[679,-13,778,56,722],8896:[780,264,833,51,781],8897:[764,280,833,51,781],8898:[772,250,833,50,784],8899:[750,272,833,50,784],8903:[586,86,802,56,745],8917:[750,250,778,56,722],8924:[631,119,778,76,702],8925:[631,119,778,76,702],8930:[730,230,778,76,702],8931:[730,230,778,76,702],8932:[627,211,778,76,702],8933:[627,211,778,76,702],8944:[500,0,613,56,556],10752:[743,243,1111,63,1049],10753:[743,243,1111,63,1049],10754:[743,243,1111,63,1049],10755:[750,272,833,50,784],10756:[750,272,833,50,784],10757:[764,264,833,50,784],10758:[764,264,833,50,784],10761:[740,240,1092,55,1036],10764:[805,306,1775,56,1719],10769:[805,306,695,56,667],10799:[496,-3,778,142,636]};MathJax.Callback.Queue(["initFont",MathJax.OutputJax["HTML-CSS"],"LatinModernMathJax_Operators"],["loadComplete",MathJax.Ajax,MathJax.OutputJax["HTML-CSS"].fontDir+"/Operators/Regular/Main.js"]);
| {
"pile_set_name": "Github"
} |
//===----------------------------------------------------------------------===//
//
// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
// See https://llvm.org/LICENSE.txt for license information.
// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
//
//===----------------------------------------------------------------------===//
// <functional>
// class function<R(ArgTypes...)>
// const std::type_info& target_type() const;
// This test runs in C++03, but we have deprecated using std::function in C++03.
// ADDITIONAL_COMPILE_FLAGS: -D_LIBCPP_DISABLE_DEPRECATION_WARNINGS
// UNSUPPORTED: -fno-rtti
#include <functional>
#include <typeinfo>
#include <cassert>
#include "test_macros.h"
class A
{
int data_[10];
public:
static int count;
A()
{
++count;
for (int i = 0; i < 10; ++i)
data_[i] = i;
}
A(const A&) {++count;}
~A() {--count;}
int operator()(int i) const
{
for (int j = 0; j < 10; ++j)
i += data_[j];
return i;
}
int foo(int) const {return 1;}
};
int A::count = 0;
int g(int) {return 0;}
int main(int, char**)
{
{
std::function<int(int)> f = A();
assert(f.target_type() == typeid(A));
}
{
std::function<int(int)> f;
assert(f.target_type() == typeid(void));
}
return 0;
}
| {
"pile_set_name": "Github"
} |
#pragma once
#ifndef MESSMER_FSPP_TEST_FUSE_RMDIR_TESTUTILS_FUSERMDIRTEST_H_
#define MESSMER_FSPP_TEST_FUSE_RMDIR_TESTUTILS_FUSERMDIRTEST_H_
#include "../../../testutils/FuseTest.h"
class FuseRmdirTest: public FuseTest {
public:
const char *DIRNAME = "/mydir";
void Rmdir(const char *dirname);
int RmdirReturnError(const char *dirname);
::testing::Action<void(const boost::filesystem::path&)> FromNowOnReturnDoesntExistOnLstat();
};
#endif
| {
"pile_set_name": "Github"
} |
🎲🎲🎲 EXIT CODE: 1 🎲🎲🎲
🟥🟥🟥 STDERR️️ 🟥🟥🟥️
No profile named test
🟥🟥🟥 JSON STDERR 🟥🟥🟥
{
"message": "no profile named test",
"error": {}
}
| {
"pile_set_name": "Github"
} |
version https://git-lfs.github.com/spec/v1
oid sha256:790f69255b83eeeb9990cd573df5b46721a7910bd8e48bfaa8d3abf4de0623f2
size 159237
| {
"pile_set_name": "Github"
} |
obj-$(CONFIG_FANOTIFY) += fanotify.o fanotify_user.o
| {
"pile_set_name": "Github"
} |
// +build linux,386 linux,arm linux,mips linux,mipsle
// Copyright 2014 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.
package unix
func init() {
// On 32-bit Linux systems, the fcntl syscall that matches Go's
// Flock_t type is SYS_FCNTL64, not SYS_FCNTL.
fcntl64Syscall = SYS_FCNTL64
}
| {
"pile_set_name": "Github"
} |
pixdesc-bgr24 30134c7e6c9298df1d830398edca22b9
| {
"pile_set_name": "Github"
} |
<?php
/**
* Translation file
* @copyright Copyright (c) 2014-2019 Benjamin BALET
* @license http://opensource.org/licenses/AGPL-3.0 AGPL-3.0
* @link https://github.com/bbalet/jorani
* @since 0.1.0
* @author dario brignone <[email protected]>
*/
$lang['hr_employees_title'] = 'Elenco dipendenti';
$lang['hr_employees_thead_tip_edit'] = 'modifica utente';
$lang['hr_employees_thead_tip_entitlment'] = 'giorni spettanti';
$lang['hr_employees_thead_link_leaves'] = 'Ferie';
$lang['hr_employees_thead_link_extra'] = 'Extra';
$lang['hr_employees_thead_link_balance'] = 'Saldo ferie';
$lang['hr_employees_thead_link_create_leave'] = 'Inserisci una richiesta di ferie';
$lang['hr_employees_thead_link_calendar'] = 'Yearly calendar';
$lang['hr_employees_thead_link_presence'] = 'Report presenze';
$lang['hr_employees_thead_link_delegation'] = 'Deleghe';
$lang['hr_employees_thead_id'] = 'ID';
$lang['hr_employees_thead_firstname'] = 'Nome';
$lang['hr_employees_thead_lastname'] = 'Cognome';
$lang['hr_employees_thead_email'] = 'E-mail';
$lang['hr_employees_thead_entity'] = 'Entità';
$lang['hr_employees_thead_contract'] = 'Contratto';
$lang['hr_employees_thead_manager'] = 'Gestore';
$lang['hr_employees_thead_identifier'] = 'identificatore';
$lang['hr_employees_thead_datehired'] = 'Data assunzione';
$lang['hr_employees_thead_position'] = 'Position';
$lang['hr_employees_button_create_user'] = 'Crea';
$lang['hr_employees_button_export'] = 'Esporta questo elenco';
$lang['hr_employees_popup_entitlment_title'] = 'Giorni spettanti';
$lang['hr_employees_popup_entitlment_button_cancel'] = 'Annulla';
$lang['hr_employees_popup_entitlment_button_close'] = 'Chiudi';
$lang['hr_employees_button_select'] = 'Seleziona';
$lang['hr_employees_field_entity'] = 'Entità';
$lang['hr_employees_popup_entity_title'] = 'Seleziona un\'entità';
$lang['hr_employees_popup_entity_button_ok'] = 'OK';
$lang['hr_employees_popup_entity_button_cancel'] = 'Annulla';
$lang['hr_employees_description'] = 'Click tasto destro / pressione lunga';
$lang['hr_employees_field_subdepts'] = 'Includi sotto-reparti';
$lang['hr_employees_button_all'] = 'All';
$lang['hr_employees_button_active'] = 'Active';
$lang['hr_employees_button_inactive'] = 'Inactive';
$lang['hr_employees_button_selection'] = 'Selection';
$lang['hr_employees_button_select_all'] = 'Select all';
$lang['hr_employees_button_deselect_all'] = 'Deselect all';
$lang['hr_employees_button_select_manager'] = 'Select Manager';
$lang['hr_employees_button_select_contract'] = 'Select Contract';
$lang['hr_employees_button_select_entity'] = 'Select Entity';
$lang['hr_employees_popup_contract_title'] = 'Select Contract';
$lang['hr_employees_button_entitleddays'] = 'Entitled days';
$lang['hr_employees_button_create_request'] = 'Submit a leave request';
$lang['hr_employees_popup_manager_title'] = 'Select the manager';
$lang['hr_employees_multiple_edit_selection_msg'] = 'You must select at least one employee into the table';
$lang['hr_export_employees_title'] = 'Elenco dipendenti';
$lang['hr_export_employees_thead_id'] = 'ID';
$lang['hr_export_employees_thead_firstname'] = 'Nome';
$lang['hr_export_employees_thead_lastname'] = 'Cognome';
$lang['hr_export_employees_thead_email'] = 'E-mail';
$lang['hr_export_employees_thead_entity'] = 'Entità';
$lang['hr_export_employees_thead_contract'] = 'Contratto';
$lang['hr_export_employees_thead_manager'] = 'Gestore';
$lang['hr_leaves_title'] = 'Elenco ferie richieste';
$lang['hr_leaves_html_title'] = 'Elenco ferie per il dipendente #';
$lang['hr_leaves_thead_tip_edit'] = 'modifica';
$lang['hr_leaves_thead_tip_accept'] = 'accetta';
$lang['hr_leaves_thead_tip_reject'] = 'rifiuta';
$lang['hr_leaves_thead_tip_delete'] = 'elimina';
$lang['hr_leaves_thead_tip_history'] = 'show history';
$lang['hr_leaves_thead_id'] = 'ID';
$lang['hr_leaves_thead_status'] = 'Stato';
$lang['hr_leaves_thead_start'] = 'Data inizio';
$lang['hr_leaves_thead_end'] = 'Data fine';
$lang['hr_leaves_thead_duration'] = 'Durata';
$lang['hr_leaves_thead_type'] = 'Tipologia';
$lang['hr_leaves_button_export'] = 'Esporta questo elenco';
$lang['hr_leaves_button_list'] = 'Elenco dipendenti';
$lang['hr_leaves_popup_delete_title'] = 'Elimina richiesta di ferie';
$lang['hr_leaves_popup_delete_message'] = 'Stai per cancellare una richiesta di ferie, questa procedura è irreversibile';
$lang['hr_leaves_popup_delete_question'] = 'Vuoi proseguire?';
$lang['hr_leaves_popup_delete_button_yes'] = 'Si';
$lang['hr_leaves_popup_delete_button_no'] = 'No';
$lang['hr_leaves_deleted_title'] = 'List of deleted leave requests';
$lang['hr_export_leaves_title'] = 'Elenco ferie richieste';
$lang['hr_export_leaves_thead_id'] = 'ID';
$lang['hr_export_leaves_thead_status'] = 'Stato';
$lang['hr_export_leaves_thead_start'] = 'Data inizio';
$lang['hr_export_leaves_thead_end'] = 'Data fine';
$lang['hr_export_leaves_thead_duration'] = 'Durata';
$lang['hr_export_leaves_thead_type'] = 'Tipologia';
$lang['hr_leaves_create_title'] = 'Invia una richiesta di ferie';
$lang['hr_leaves_create_field_start'] = 'Data inizio';
$lang['hr_leaves_create_field_end'] = 'Data fine';
$lang['hr_leaves_create_field_type'] = 'Tipologia ferie';
$lang['hr_leaves_create_field_duration'] = 'Durata';
$lang['hr_leaves_create_field_duration_message'] = 'Hai superato i giorni a tua disposizione';
$lang['hr_leaves_create_field_overlapping_message'] = 'Hai effettuato una richiesta di ferie per gli stessi giorni.';
$lang['hr_leaves_create_field_cause'] = 'Motivazione (opzionale)';
$lang['hr_leaves_create_field_status'] = 'Stato';
$lang['hr_leaves_create_button_create'] = 'Richiedi ferie';
$lang['hr_leaves_create_button_cancel'] = 'Annulla';
$lang['hr_leaves_create_flash_msg_success'] = 'La richiesta di ferie è stata creata con successo';
$lang['hr_leaves_create_flash_msg_error'] = 'La richiesta di ferie è stata creata con successo oppure aggiornata, ma non hai un manager.';
$lang['hr_leaves_flash_spn_list_days_off'] = '%s non-working days in the period';
$lang['hr_leaves_flash_msg_overlap_dayoff'] = 'Your leave request matches with a non-working day.';
$lang['hr_leaves_validate_mandatory_js_msg'] = '"Il campo " + fieldname + " è obbligatorio."';
$lang['hr_leaves_validate_flash_msg_no_contract'] = 'Sembra che tu non abbia un contratto. Sei pregato di contattare il tuo responsabile delle Risorse Umane / Manager';
$lang['hr_leaves_validate_flash_msg_overlap_period'] = 'Non è possibile creare una richiesta di congedo per due periodi di ferie annuali. Si prega di creare due diverse richieste di ferie.';
$lang['hr_overtime_title'] = 'Elenco di richieste di straordinario';
$lang['hr_overtime_html_title'] = 'Elenco richieste di straordinario per il dipendente #';
$lang['hr_overtime_thead_tip_edit'] = 'modifica';
$lang['hr_overtime_thead_tip_accept'] = 'accetta';
$lang['hr_overtime_thead_tip_reject'] = 'rifiuta';
$lang['hr_overtime_thead_tip_delete'] = 'elimina';
$lang['hr_overtime_thead_id'] = 'ID';
$lang['hr_overtime_thead_status'] = 'Stato';
$lang['hr_overtime_thead_date'] = 'Data';
$lang['hr_overtime_thead_duration'] = 'Durata';
$lang['hr_overtime_thead_cause'] = 'Motivo';
$lang['hr_overtime_button_export'] = 'Esporta questo elenco';
$lang['hr_overtime_button_list'] = 'Elenco dipendenti';
$lang['hr_overtime_popup_delete_title'] = 'Elimina richiesta di straordinario';
$lang['hr_overtime_popup_delete_message'] = 'Stai per eliminare una richiesta di straordinario, questa procedura è irreversibile';
$lang['hr_overtime_popup_delete_question'] = 'Vuoi proseguire?';
$lang['hr_overtime_popup_delete_button_yes'] = 'Si';
$lang['hr_overtime_popup_delete_button_no'] = 'No';
$lang['hr_export_overtime_title'] = 'Elenco di richieste di straordinario';
$lang['hr_export_overtime_thead_id'] = 'ID';
$lang['hr_export_overtime_thead_status'] = 'Stato';
$lang['hr_export_overtime_thead_date'] = 'Data';
$lang['hr_export_overtime_thead_duration'] = 'Durata';
$lang['hr_export_overtime_thead_cause'] = 'Motivo';
$lang['hr_summary_title'] = 'Saldo ferie per l\'utente #';
$lang['hr_summary_thead_type'] = 'Tipologia ferie';
$lang['hr_summary_thead_available'] = 'Disponibile';
$lang['hr_summary_thead_taken'] = 'Occupato';
$lang['hr_summary_thead_entitled'] = 'Spettante';
$lang['hr_summary_thead_description'] = 'Descrizione';
$lang['hr_summary_flash_msg_error'] = 'Questo dipendente non ha un contratto';
$lang['hr_summary_button_list'] = 'Elenco dipendenti';
$lang['hr_summary_date_field'] = 'Data del report';
$lang['hr_presence_title'] = 'Report presenze';
$lang['hr_presence_description'] = 'Per impostazione predefinita, questo report mostra i valori del mese scorso. Si prega di notare che l\'elenco delle ferie mostra solo le richieste di ferie accettate.';
$lang['hr_presence_thead_tip_edit'] = 'modifica';
$lang['hr_presence_thead_id'] = 'ID';
$lang['hr_presence_thead_start'] = 'Data inizio';
$lang['hr_presence_thead_end'] = 'Data fine';
$lang['hr_presence_thead_duration'] = 'Durata';
$lang['hr_presence_thead_type'] = 'Tipologia';
$lang['hr_presence_button_execute'] = 'Esegui';
$lang['hr_presence_button_list'] = 'Elenco dipendenti';
$lang['hr_presence_employee'] = 'Dipendente';
$lang['hr_presence_contract'] = 'Contratto';
$lang['hr_presence_month'] = 'Mese';
$lang['hr_presence_days'] = 'Numero di giorni';
$lang['hr_presence_working_days'] = 'Numero di giorni lavorativi';
$lang['hr_presence_non_working_days'] = 'Numero di giorni non lavorativi';
$lang['hr_presence_leave_duration'] = 'Durata delle ferie';
$lang['hr_presence_work_duration'] = 'Durata delle presenze';
$lang['hr_presence_overlapping_detected'] = 'Rilevata sovrapposizione';
$lang['hr_presence_no_contract'] = 'Il dipendente non ha un contratto';
$lang['hr_presence_please_check'] = 'Si prega di controllare';
$lang['hr_presence_leaves_list_title'] = 'Elenco ferie nel mese';
$lang['hr_presence_button_export'] = 'Esporta';
| {
"pile_set_name": "Github"
} |
package system
import "syscall"
func LUtimesNano(path string, ts []syscall.Timespec) error {
return ErrNotSupportedPlatform
}
func UtimesNano(path string, ts []syscall.Timespec) error {
return syscall.UtimesNano(path, ts)
}
| {
"pile_set_name": "Github"
} |
// © 2016 and later: Unicode, Inc. and others.
// License & terms of use: http://www.unicode.org/copyright.html#License
bg{
Version{"2.1.19.14"}
collations{
standard{
Sequence{"[reorder Cyrl]"}
Version{"31.0.1"}
}
}
}
| {
"pile_set_name": "Github"
} |
data "aws_ip_ranges" "european_ec2" {
regions = ["eu-west-1", "eu-central-1"]
services = ["ec2"]
}
resource "aws_security_group" "from_europe" {
name = "from_europe"
ingress {
from_port = "443"
to_port = "443"
protocol = "tcp"
cidr_blocks = slice(data.aws_ip_ranges.european_ec2.cidr_blocks, 0, 50)
}
tags = {
CreateDate = data.aws_ip_ranges.european_ec2.create_date
SyncToken = data.aws_ip_ranges.european_ec2.sync_token
}
}
| {
"pile_set_name": "Github"
} |
/*
* Copyright 2014 NAVER Corp.
*
* 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.navercorp.pinpoint.collector.receiver.thrift.udp;
import org.apache.thrift.TBase;
import java.net.DatagramSocket;
import java.util.List;
import java.util.Objects;
/**
* @author emeroad
*/
public class TBaseFilterChain<T> implements TBaseFilter<T> {
private final TBaseFilter<T>[] filterChain;
public TBaseFilterChain(List<TBaseFilter<T>> tBaseFilter) {
Objects.requireNonNull(tBaseFilter, "tBaseFilter");
@SuppressWarnings("unchecked")
final TBaseFilter<T>[] newArray = (TBaseFilter<T>[]) new TBaseFilter[0];
this.filterChain = tBaseFilter.toArray(newArray);
}
@Override
public boolean filter(DatagramSocket localSocket, TBase<?, ?> tBase, T remoteHostAddress) {
for (TBaseFilter tBaseFilter : filterChain) {
@SuppressWarnings("unchecked")
final boolean filter = tBaseFilter.filter(localSocket, tBase, remoteHostAddress);
if (filter == TBaseFilter.BREAK) {
return BREAK;
}
}
return TBaseFilter.CONTINUE;
}
}
| {
"pile_set_name": "Github"
} |
//
// Generated by class-dump 3.5 (64 bit).
//
// class-dump is Copyright (C) 1997-1998, 2000-2001, 2004-2013 by Steve Nygard.
//
#import "PBCodable.h"
#import "NSCopying.h"
@class NSData;
@interface _NMRMediaRemoteGetStateMessageProfobuf : PBCodable <NSCopying>
{
double _timestamp;
NSData *_applicationInfoDigest;
NSData *_knownDigest;
NSData *_nowPlayingInfoDigest;
int _state;
NSData *_supportedCommandsDigest;
CDStruct_9b124259 _has;
}
- (void)copyTo:(id)arg1;
- (void)writeTo:(id)arg1;
- (BOOL)readFrom:(id)arg1;
- (void)mergeFrom:(id)arg1;
@property(nonatomic) BOOL hasState;
@property(retain, nonatomic) NSData *knownDigest; // @synthesize knownDigest=_knownDigest;
@property(readonly, nonatomic) BOOL hasSupportedCommandsDigest;
@property(readonly, nonatomic) BOOL hasApplicationInfoDigest;
@property(readonly, nonatomic) BOOL hasNowPlayingInfoDigest;
@property(readonly, nonatomic) BOOL hasKnownDigest;
@property(retain, nonatomic) NSData *supportedCommandsDigest; // @synthesize supportedCommandsDigest=_supportedCommandsDigest;
@property(retain, nonatomic) NSData *applicationInfoDigest; // @synthesize applicationInfoDigest=_applicationInfoDigest;
@property(retain, nonatomic) NSData *nowPlayingInfoDigest; // @synthesize nowPlayingInfoDigest=_nowPlayingInfoDigest;
@property(nonatomic) BOOL hasTimestamp;
- (void).cxx_destruct;
- (id)dictionaryRepresentation;
- (id)copyWithZone:(struct _NSZone *)arg1;
@property(nonatomic) int state; // @synthesize state=_state;
@property(nonatomic) double timestamp; // @synthesize timestamp=_timestamp;
- (id)description;
- (unsigned int)hash;
- (BOOL)isEqual:(id)arg1;
@end
| {
"pile_set_name": "Github"
} |
module Bench.Pos.Explorer.ServerBench
( runTimeBenchmark
, runSpaceBenchmark
) where
import Universum
import Criterion.Main (bench, defaultConfig, defaultMainWith, nfIO)
import Criterion.Types (Config (..))
import Weigh (io, mainWith)
import Test.QuickCheck (arbitrary, generate)
import Pos.Explorer.DB (defaultPageSize)
import Pos.Explorer.ExplorerMode (ExplorerTestParams,
runExplorerTestMode)
import Pos.Explorer.ExtraContext (ExtraContext (..), makeMockExtraCtx)
import Pos.Explorer.TestUtil (BlockNumber, SlotsPerEpoch,
generateValidExplorerMockableMode)
import Pos.Explorer.Web.ClientTypes (CBlockEntry)
import Pos.Explorer.Web.Server (getBlocksPage, getBlocksTotal)
import Test.Pos.Chain.Genesis.Dummy (dummyEpochSlots)
import Test.Pos.Chain.Txp.Arbitrary.Unsafe ()
import Test.Pos.Configuration (withDefConfigurations)
----------------------------------------------------------------
-- Mocked functions
----------------------------------------------------------------
type BenchmarkTestParams = (ExplorerTestParams, ExtraContext)
-- | @getBlocksTotal@ function for benchmarks.
getBlocksTotalBench :: BenchmarkTestParams -> IO Integer
getBlocksTotalBench (testParams, extraContext) =
withDefConfigurations $ \_ _ _ -> runExplorerTestMode
testParams
extraContext
getBlocksTotal
-- | @getBlocksPage@ function for the last page for benchmarks.
getBlocksPageBench :: BenchmarkTestParams -> IO (Integer, [CBlockEntry])
getBlocksPageBench (testParams, extraContext) =
withDefConfigurations $ \_ _ _ ->
runExplorerTestMode testParams extraContext
$ getBlocksPage
dummyEpochSlots
Nothing
(Just $ fromIntegral defaultPageSize)
-- | This is used to generate the test environment. We don't do this while benchmarking
-- the functions since that would include the time/memory required for the generation of the
-- mock blockchain (test environment), and we don't want to include that in our benchmarks.
generateTestParams
:: BlockNumber
-> SlotsPerEpoch
-> IO BenchmarkTestParams
generateTestParams totalBlocksNumber slotsPerEpoch = do
testParams <- testParamsGen
-- We replace the "real" blockchain with our custom generated one.
mode <- generateValidExplorerMockableMode totalBlocksNumber slotsPerEpoch
-- The extra context so we can mock the functions.
let extraContext :: ExtraContext
extraContext = withDefConfigurations $ \_ _ _ -> makeMockExtraCtx mode
pure (testParams, extraContext)
where
-- | Generated test parameters.
testParamsGen :: IO ExplorerTestParams
testParamsGen = generate arbitrary
-- | Extracted common code. This needs to be run before the benchmarks since we don't
-- want to include time/memory of the test data generation in the benchmarks.
usingGeneratedBlocks :: IO (BenchmarkTestParams, BenchmarkTestParams, BenchmarkTestParams)
usingGeneratedBlocks = do
blocks100 <- generateTestParams 100 10
blocks1000 <- generateTestParams 1000 10
blocks10000 <- generateTestParams 10000 10
pure (blocks100, blocks1000, blocks10000)
----------------------------------------------------------------
-- Time benchmark
----------------------------------------------------------------
-- | Time @getBlocksPage@.
runTimeBenchmark :: IO ()
runTimeBenchmark = do
-- Generate the test environment before the benchmarks.
(blocks100, blocks1000, blocks10000) <- usingGeneratedBlocks
defaultMainWith getBlocksPageConfig
[ bench "getBlocksTotal 100 blocks" $ nfIO $ getBlocksTotalBench blocks100
, bench "getBlocksTotal 1000 blocks" $ nfIO $ getBlocksTotalBench blocks1000
, bench "getBlocksTotal 10000 blocks" $ nfIO $ getBlocksTotalBench blocks10000
, bench "getBlocksPage 100 blocks" $ nfIO $ getBlocksPageBench blocks100
, bench "getBlocksPage 1000 blocks" $ nfIO $ getBlocksPageBench blocks1000
, bench "getBlocksPage 10000 blocks" $ nfIO $ getBlocksPageBench blocks10000
]
where
-- | Configuration.
getBlocksPageConfig :: Config
getBlocksPageConfig = defaultConfig
{ reportFile = Just "bench/results/ServerBackend.html"
}
----------------------------------------------------------------
-- Space benchmark
----------------------------------------------------------------
-- | Space @getBlocksPage@.
runSpaceBenchmark :: IO ()
runSpaceBenchmark = do
-- Generate the test environment before the benchmarks.
(blocks100, blocks1000, blocks10000) <- usingGeneratedBlocks
mainWith $ do
io "getBlocksTotal 100 blocks" getBlocksTotalBench blocks100
io "getBlocksTotal 1000 blocks" getBlocksTotalBench blocks1000
io "getBlocksTotal 10000 blocks" getBlocksTotalBench blocks10000
io "getBlocksPage 100 blocks" getBlocksPageBench blocks100
io "getBlocksPage 1000 blocks" getBlocksPageBench blocks1000
io "getBlocksPage 10000 blocks" getBlocksPageBench blocks10000
| {
"pile_set_name": "Github"
} |
# (C) Datadog, Inc. 2018-present
# All rights reserved
# Licensed under a 3-clause BSD style license (see LICENSE)
from six import iteritems
from datadog_checks.base.checks.kube_leader import KubeLeaderElectionMixin
from datadog_checks.base.checks.openmetrics import OpenMetricsBaseCheck
from datadog_checks.base.config import is_affirmative
class KubeControllerManagerCheck(KubeLeaderElectionMixin, OpenMetricsBaseCheck):
DEFAULT_METRIC_LIMIT = 0
DEFAULT_IGNORE_DEPRECATED = False
DEFAUT_RATE_LIMITERS = [
"bootstrap_signer",
"cronjob_controller",
"daemon_controller",
"deployment_controller",
"endpoint_controller",
"gc_controller",
"job_controller",
"namespace_controller",
"node_ipam_controller",
"node_lifecycle_controller",
"persistentvolume_protection_controller",
"persistentvolumeclaim_protection_controller",
"replicaset_controller",
"replication_controller",
"resource_quota_controller",
"root_ca_cert_publisher",
"route_controller",
"service_controller",
"serviceaccount_controller",
"serviceaccount_tokens_controller",
"token_cleaner",
"ttl_after_finished_controller",
]
DEFAULT_QUEUES = [
"bootstrap_signer_queue",
"certificate",
"claims",
"ClusterRoleAggregator",
"daemonset",
"deployment",
"disruption",
"endpoint",
"garbage_collector_attempt_to_delete",
"garbage_collector_attempt_to_orphan",
"garbage_collector_graph_changes",
"horizontalpodautoscaler",
"job",
"namespace",
"pvcprotection",
"pvcs",
"pvLabels",
"pvprotection",
"replicaset",
"replicationmanager",
"resource_quota_controller_resource_changes",
"resourcequota_primary",
"resourcequota_priority",
"root-ca-cert-publisher",
"service",
"serviceaccount",
"serviceaccount_tokens_secret",
"serviceaccount_tokens_service",
"statefulset",
"token_cleaner",
"ttl_jobs_to_delete",
"ttlcontroller",
"volumes",
]
LEADER_ELECTION_CONFIG = {
"namespace": "kube_controller_manager",
"record_kind": "endpoints",
"record_name": "kube-controller-manager",
"record_namespace": "kube-system",
}
def __init__(self, name, init_config, instances):
self.QUEUE_METRICS_TRANSFORMERS = {
'_adds': self.queue_adds,
'_depth': self.queue_depth,
'_queue_latency': self.queue_latency,
'_retries': self.queue_retries,
'_work_duration': self.queue_work_duration,
}
self.WORKQUEUE_METRICS_RENAMING = {
'workqueue_adds_total': 'queue.adds',
'workqueue_retries_total': 'queue.retries',
'workqueue_depth': 'queue.depth',
'workqueue_unfinished_work_seconds': 'queue.work_unfinished_duration',
'workqueue_longest_running_processor_seconds': 'queue.work_longest_duration',
'workqueue_queue_duration_seconds': 'queue.queue_duration', # replace _queue_latency
'workqueue_work_duration_seconds': 'queue.process_duration', # replace _work_duration
}
super(KubeControllerManagerCheck, self).__init__(
name,
init_config,
instances,
default_instances={
"kube_controller_manager": {
'prometheus_url': 'http://localhost:10252/metrics',
'namespace': 'kube_controller_manager',
'metrics': [
{'go_goroutines': 'goroutines'},
{'go_threads': 'threads'},
{'process_open_fds': 'open_fds'},
{'process_max_fds': 'max_fds'},
{'rest_client_requests_total': 'client.http.requests'},
{'node_collector_evictions_number': 'nodes.evictions'},
{'node_collector_unhealthy_nodes_in_zone': 'nodes.unhealthy'},
{'node_collector_zone_size': 'nodes.count'},
],
}
},
default_namespace="kube_controller_manager",
)
def check(self, instance):
# Get the configuration for this specific instance
scraper_config = self.get_scraper_config(instance)
# Populate the metric transformers dict
transformers = {}
limiters = self.DEFAUT_RATE_LIMITERS + instance.get("extra_limiters", [])
for limiter in limiters:
transformers[limiter + "_rate_limiter_use"] = self.rate_limiter_use
queues = self.DEFAULT_QUEUES + instance.get("extra_queues", [])
for queue in queues:
for metric, func in iteritems(self.QUEUE_METRICS_TRANSFORMERS):
transformers[queue + metric] = func
# Support new metrics (introduced in v1.14.0)
for metric_name in self.WORKQUEUE_METRICS_RENAMING:
transformers[metric_name] = self.workqueue_transformer
self.ignore_deprecated_metrics = instance.get("ignore_deprecated", self.DEFAULT_IGNORE_DEPRECATED)
if self.ignore_deprecated_metrics:
self._filter_metric = self._ignore_deprecated_metric
self.process(scraper_config, metric_transformers=transformers)
# Check the leader-election status
if is_affirmative(instance.get('leader_election', True)):
leader_config = self.LEADER_ELECTION_CONFIG
leader_config["tags"] = instance.get("tags", [])
self.check_election_status(leader_config)
def _ignore_deprecated_metric(self, metric, scraper_config):
return metric.documentation.startswith("(Deprecated)")
def _tag_and_submit(self, metric, scraper_config, metric_name, tag_name, tag_value_trim):
# Get tag value from original metric name or return trying
if not metric.name.endswith(tag_value_trim):
self.log.debug("Cannot process metric %s with expected suffix %s", metric.name, tag_value_trim)
return
tag_value = metric.name[: -len(tag_value_trim)]
for sample in metric.samples:
sample[self.SAMPLE_LABELS][tag_name] = tag_value
self.submit_openmetric(metric_name, metric, scraper_config)
def rate_limiter_use(self, metric, scraper_config):
self._tag_and_submit(metric, scraper_config, "rate_limiter.use", "limiter", "_rate_limiter_use")
def queue_adds(self, metric, scraper_config):
self._tag_and_submit(metric, scraper_config, "queue.adds", "queue", "_adds")
def queue_depth(self, metric, scraper_config):
self._tag_and_submit(metric, scraper_config, "queue.depth", "queue", "_depth")
def queue_latency(self, metric, scraper_config):
self._tag_and_submit(metric, scraper_config, "queue.latency", "queue", "_queue_latency")
def queue_retries(self, metric, scraper_config):
self._tag_and_submit(metric, scraper_config, "queue.retries", "queue", "_retries")
def queue_work_duration(self, metric, scraper_config):
self._tag_and_submit(metric, scraper_config, "queue.work_duration", "queue", "_work_duration")
# for new metrics
def workqueue_transformer(self, metric, scraper_config):
self._tag_renaming_and_submit(metric, scraper_config, self.WORKQUEUE_METRICS_RENAMING[metric.name])
def _tag_renaming(self, metric, new_tag_name, old_tag_name):
for sample in metric.samples:
sample[self.SAMPLE_LABELS][new_tag_name] = sample[self.SAMPLE_LABELS][old_tag_name]
del sample[self.SAMPLE_LABELS][old_tag_name]
def _tag_renaming_and_submit(self, metric, scraper_config, new_metric_name):
# rename the tag "name" to "queue" and submit this metric with the new metrics_name
self._tag_renaming(metric, "queue", "name")
self.submit_openmetric(new_metric_name, metric, scraper_config)
| {
"pile_set_name": "Github"
} |
Cache-Control: no-cache, no-store, max-age=0, must-revalidate, post-check=0, pre-check=0
Cf-Ray: 3a9369a53c4608f0-CDG
Content-Language: en
Content-Type: text/html; charset=utf-8
Date: Thu, 05 Oct 2017 21:18:18 GMT
Expires: Sun, 19 Nov 1978 05:00:00 GMT
Link: <https://www.card.com/app>; rel="canonical",<https://www.card.com/app>; rel="shortlink"
Server: cloudflare-nginx
Status: 200
Strict-Transport-Security: max-age=15552000; preload
Vary: Accept-Encoding
X-Content-Type-Options: nosniff nosniff
X-Frame-Options: SameOrigin SAMEORIGIN
X-Generator: Drupal 7 (http://drupal.org)
X-Mission: Do something insanely great in financial services.
X-Recruiting: If you're reading this, maybe you should be working at CARD.com. Check out https://www.CARD.com/careers
X-Ua-Compatible: IE=Edge,chrome=1
| {
"pile_set_name": "Github"
} |
/*
* Driver for Microtune MT2266 "Direct conversion low power broadband tuner"
*
* Copyright (c) 2007 Olivier DANET <[email protected]>
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*/
#ifndef MT2266_H
#define MT2266_H
struct dvb_frontend;
struct i2c_adapter;
struct mt2266_config {
u8 i2c_address;
};
#if defined(CONFIG_MEDIA_TUNER_MT2266) || (defined(CONFIG_MEDIA_TUNER_MT2266_MODULE) && defined(MODULE))
extern struct dvb_frontend * mt2266_attach(struct dvb_frontend *fe, struct i2c_adapter *i2c, struct mt2266_config *cfg);
#else
static inline struct dvb_frontend * mt2266_attach(struct dvb_frontend *fe, struct i2c_adapter *i2c, struct mt2266_config *cfg)
{
printk(KERN_WARNING "%s: driver disabled by Kconfig\n", __func__);
return NULL;
}
#endif // CONFIG_MEDIA_TUNER_MT2266
#endif
| {
"pile_set_name": "Github"
} |
Implementor (Front-End)
Is the language design fit for front-end implementation?
For each of the new aspects, are the new grammar and legality
rules clear enough to implement?
For each new Restriction, is the intent and meaning of the restriction
sufficiently clear and detailed to be implemented?
Ident: FE-YM1
Section: 6.1.4
Page/para: 26 .. 28
Comment: The description of mode refinement in not clear enough for
implementation. I suggest that this section is reformatted, with a clear
intent, some examples, an intuition behind the names "moded_item eligible"
and "independent". It could be clearer also if this section was preceded
by the description of Global and Param aspects. I am also in favor of the
merge of Global and Param aspects suggested by Steve.
Status: This detail has been vastly simplified and moved into the relevant
sections that use it. [JIB]
Ident: FE-YM2
Section: 6.1.5
Page/para: 29
Comment: The description of global aspect seems to suppose a constructive
approach, when it says
"A name that denotes a global variable appearing in a precondition or
postcondition aspect of a subprogram must also appear in the
global_aspect of the same subprogram."
Also, the legality rules mentions the special case of X'First, X'Last, etc.
for arrays, without doing the same for discriminants.
Also, the comments in examples should be phrased in user terms, so "global
variable V may be read by the subprogram" instead of "V is a mode in global
item" which simply duplicates the example code.
Status: First two points are addressed since the relevant rules have been removed.
Final point on comments has been actioned. [JIB]
Ident: FE-YM3
Section: 6.1.6
Page/para: 30
Comment: The description of param aspect is inconsistent with the description
of the global aspect. For example it does not say anything about X'First,
X'Last, etc. for an array X. I strongly suggest we follow Steve's idea of
combining the descriptions of param and global aspects.
Status: The detail on param aspects has now been removed. [JIB]
Ident: FE-YM4
Section: 6.1.7
Page/para: 31
Comment: The description of dependency aspect introduces BNF non-terminals
before the BNF grammar is given, which is slightly confusing.
I am not clear about the definition of imports and exports (especially true
in the retrospective approach). Should a global aspect be given every time a
dependency aspect is given? Or should global variables be deduced from
the dependency aspect?
Status: Updates made to address the non-terminals issue. Imports and exports
renamed as inputs and outputs and definitions improved. The LRM as it
currently stands does not mandate a global aspect every time a depends
aspect is given. Rather it states a rule that a global aspect should
be synthesized if one does not exist. [JIB]
Ident: FE-YM5
Section: 6.1.7
Page/para: 32
Comment: What is the name for the dependency aspect? Earlier in the LRM it is
said "Dependency", here it says "Depends".
Status: All references to this updated to be Depends aspect. [JIB]
Ident: FE-YM6
Section: 6.1.7
Page/para: 33
Comment: The legality rules for dependency aspect are not clear. Rule 8 is
completely confused, probably as a result of a merge. Rule 9 is not clear:
what if A(I) is an export, and A(J).F also? It may appear that A(J).F is
a subcomponent of A(I) if I=J at run time.
Status: The corresponding rules are no longer relevant so have been removed. [JIB]
Ident: FE-YM7
Section: 6.1.7
Page/para: 33 .. 34
Comment: The static semantics for dependency aspects are not clear enough for
implementation. I suggest rewording more in line with Ada RM.
Status: These have now been reworded. [JIB]
Ident: FE-YM8
Section: 6.3.3
Page/para: 36/1
Comment: This is the first occurrence of refined_global_aspect without previous
definition. This is also the first occurrence of restriction Strict_Modes,
also without a previous definition. Wording is currently too complex to
be implemented. It mentions "executable path" without prior definition.
Status:
Ident: FE-YM9
Section: 6.3.4
Page/para: 36
Comment: Why allow global aspects on a stub? AFAIK, a stub cannot have
Pre/Post aspects, only the body can.
Status:
Ident: FE-YM10
Section: 6.3.4
Page/para: 36
Comment: It is said that
"If the subprogram has a refined_global_aspect (see Refined Global Aspect),
this has to be checked for consitency with the global_aspect and influences
the rules for checking the implementation of its body as described below."
but, if a subprogram has a refined_global_aspect, it cannot have a
global_aspect. Only its declaration can have one, and I see no need to
discuss that in 6.3.4 on subprogram bodies.
Status:
Ident: FE-YM11
Section: 6.3.4
Page/para: 36
Comment: It is said that in the 2nd legality rule:
"A subprogram, shall not declare, immediately within its body, an entity of
the same name as a moded_item or the name of the object of which the
moded_item is a subcomponent, [...]"
What is the rationale for this rule? This looks like a coding standard rule
from SPARK 2005 to me, not something that we should enforce in SPARK 2014.
Status:
-----------------------------------------
Comments form Jon Burton
Ident: FE-JIB12
Section: General
Page/para: N/A
Comment: There are references throughout the document to being "in SPARK 2014" and "out of SPARK 2014". Since not
being in SPARK 2014 is not an obstacle to compilation but in certain circumstances we may wish to enforce
that only SPARK 2014 constructs are used, then it is not clear from the LRM as it currently stands what should
be done when implementing legality rules if a given syntactic entity is found not to be in SPARK 2014.
Status:
Ident: FE-JIB13
Section: General
Page/para: N/A
Comment: The definition in the LRM of what is in and what is out of SPARK 2014 is incomplete in that it does not cover
all syntactic entities. For example, when is a subprogram body in SPARK 2014? Or section 6.1.1 says that the
post-condition of a subprogram declaration must be in SPARK 2014 if the subprogram declaration itself is to be
in SPARK 2014; however, I can t find anywhere a definition of what it means for a post-condition to be in SPARK
2014.
Status:
Ident: FE-JIB14
Section: General
Page/para: N/A
Comment: Throughout the document, there is narrative text that is intended purely to provide context and
there is text that appears to be narrative since it does not appear under a specific heading
such as Legality Rules but is obviously intended to be implemented. It would be good if every
rule to be implemented could appear under a heading that makes clear it is to be implemented.
For example, in section 11 on exceptions, the first and third paragraphs provide contextual
information, while the second paragraph gives the rule to be implemented. The same applies to the
text throughout the document that defines syntactic entities as being in or out of SPARK 2014.
Status:
Ident: FE-JIB15
Section: 4.1.3
Page/para: 13
Comment: This section defines a general principle and then gives one specific example. It is not clear if
this specific example is to be implemented due to it being stated here, or if it is just an
example. That is, is there only one such element in this set of illegal items, or are they
distributed across the rest of the document.
Status:
Ident: FE-JIB16
Section: 4.3.4
Page/para: pp 14-15
Comment: This section needs to be written as a series of numbered requirements rather than as a narrative,
with headings such as Legality Rules, etc, so we know what exactly needs to be implemented and to allow easy
apportionment to the tool architecture.
Status:
Ident: FE-JIB17
Section: 6.1.7
Page/para: 32/Syntax
Comments: If a conditional dependency is used, then a given export may be derived from null.
However, as far as I can see an export cannot be derived from null when a non-conditional dependency is given.
Status: This has been corrected. [JIB]
Ident: FE-JIB18
Section: 6.1.7
Page/para: 33/item 8
Comment: Possibly a cut and paste error as the first two sentences don t make sense.
Status: No longer relevant as the corresponding rules have been removed. [JIB]
Ident: FE-JIB19
Section: 6.1.7
Page/para: 33/ N/A
Comment: There appears to be some duplication/overlap between rules here: items 4 and 9, items 6 and 10, items 7 and 11.
Status: This has been fixed. [JIB]
Ident: FE-JIB20
Section: 7.1.2
Page/para: 45/ N/A
Comment: Static Semantics items 1-3: are these really legality rules?
Status: No longer relevant due to updates that have been made. [JIB]
Ident: FE-JIB21
Section: 7.1.4
Page/para: 47/Legality Rules
Comment: Should this list not be more extensive, providing counterparts of some of the legality rules given in
section 6.1.7?
Status: Text has now been updated to explicitly include those rules from subprogram Depends that are
relevant to package Depends. [JIB]
Ident: FE-JIB22
Section: 7.2.8
Page/para: 58/Legality Rules
Comment: Item 2: I assume this means the legality rules defined in the Ada RM (since there are some rules defined
under Global Aspects in this document section 6.1.5, p.29 that constrain preconditions).
Status:
Ident: FE-JIB23
Section: 7.2.9
Page/para: 59/Legality Rules
Comment: Item 2: I assume this means the legality rules defined in the Ada RM (since there are some rules defined
under Global Aspects in this document section 6.1.5, p.29 that constrain postconditions).
Status:
Ident: FE-JIB24
Section: A
Page/para: 78/6.2
Comment: Strict_Modes is to be handled by flow analysis. Is checking by the flow analyser
compatible with being specified
as a pragma Restriction, when a Restriction violation leads to a compile-time error?
Status:
Ident: FE-JIB25
Section: A
Page/para: 79/6.4.2
Comment: Global_Aspects_Required, Global_Aspects_On_Procedure_Decalarations, Array_Elements_Assumed_To_Overlap,
Abstract_State_Aspects_Required and Initializes_Aspects_Required appear to be instructions to the flow analyser
rather than restrictions as such (since if the thing they require is absent then an assumption is made
regarding what it should be, rather than an error being flagged). Is it OK that they are handled as pragma
Restrictions, when a Restriction violation leads to a compile-time error?
Status:
| {
"pile_set_name": "Github"
} |
{
"name": "NETGEAR WNR2000v5",
"author": "fofa",
"version": "0.1.0",
"matches": [
{
"search": "headers",
"text": "NETGEAR WNR2000v5"
}
]
} | {
"pile_set_name": "Github"
} |
{
"blocks": [
{
"key": "8s1v3",
"text": "",
"type": "unstyled",
"depth": 0,
"inlineStyleRanges": [],
"entityRanges": [],
"data": {}
},
{
"key": "1u5r4",
"text": " ",
"type": "atomic",
"depth": 0,
"inlineStyleRanges": [],
"entityRanges": [
{
"offset": 0,
"length": 1,
"key": 0
}
],
"data": {}
},
{
"key": "bsrvp",
"text": "",
"type": "unstyled",
"depth": 0,
"inlineStyleRanges": [],
"entityRanges": [],
"data": {}
}
],
"entityMap": {
"0": {
"type": "wix-draft-plugin-giphy",
"mutability": "IMMUTABLE",
"data": {
"config": {
"size": "content",
"alignment": "center"
},
"gif": {
"originalUrl": "https://media1.giphy.com/media/hrk8ehR4lCZ27FtjPA/giphy_s.gif",
"stillUrl": "https://media1.giphy.com/media/hrk8ehR4lCZ27FtjPA/giphy_s.gif",
"height": 400,
"width": 480
}
}
}
},
"VERSION": "5.1.1"
} | {
"pile_set_name": "Github"
} |
// Copyright © 2013 Steve Francia <[email protected]>.
//
// 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 cobra is a commander providing a simple interface to create powerful modern CLI interfaces.
// In addition to providing an interface, Cobra simultaneously provides a controller to organize your application code.
package cobra
import (
"bytes"
"fmt"
"io"
"os"
"path/filepath"
"sort"
"strings"
flag "github.com/spf13/pflag"
)
// Command is just that, a command for your application.
// E.g. 'go run ...' - 'run' is the command. Cobra requires
// you to define the usage and description as part of your command
// definition to ensure usability.
type Command struct {
// Use is the one-line usage message.
Use string
// Aliases is an array of aliases that can be used instead of the first word in Use.
Aliases []string
// SuggestFor is an array of command names for which this command will be suggested -
// similar to aliases but only suggests.
SuggestFor []string
// Short is the short description shown in the 'help' output.
Short string
// Long is the long message shown in the 'help <this-command>' output.
Long string
// Example is examples of how to use the command.
Example string
// ValidArgs is list of all valid non-flag arguments that are accepted in bash completions
ValidArgs []string
// Expected arguments
Args PositionalArgs
// ArgAliases is List of aliases for ValidArgs.
// These are not suggested to the user in the bash completion,
// but accepted if entered manually.
ArgAliases []string
// BashCompletionFunction is custom functions used by the bash autocompletion generator.
BashCompletionFunction string
// Deprecated defines, if this command is deprecated and should print this string when used.
Deprecated string
// Hidden defines, if this command is hidden and should NOT show up in the list of available commands.
Hidden bool
// Annotations are key/value pairs that can be used by applications to identify or
// group commands.
Annotations map[string]string
// The *Run functions are executed in the following order:
// * PersistentPreRun()
// * PreRun()
// * Run()
// * PostRun()
// * PersistentPostRun()
// All functions get the same args, the arguments after the command name.
//
// PersistentPreRun: children of this command will inherit and execute.
PersistentPreRun func(cmd *Command, args []string)
// PersistentPreRunE: PersistentPreRun but returns an error.
PersistentPreRunE func(cmd *Command, args []string) error
// PreRun: children of this command will not inherit.
PreRun func(cmd *Command, args []string)
// PreRunE: PreRun but returns an error.
PreRunE func(cmd *Command, args []string) error
// Run: Typically the actual work function. Most commands will only implement this.
Run func(cmd *Command, args []string)
// RunE: Run but returns an error.
RunE func(cmd *Command, args []string) error
// PostRun: run after the Run command.
PostRun func(cmd *Command, args []string)
// PostRunE: PostRun but returns an error.
PostRunE func(cmd *Command, args []string) error
// PersistentPostRun: children of this command will inherit and execute after PostRun.
PersistentPostRun func(cmd *Command, args []string)
// PersistentPostRunE: PersistentPostRun but returns an error.
PersistentPostRunE func(cmd *Command, args []string) error
// SilenceErrors is an option to quiet errors down stream.
SilenceErrors bool
// SilenceUsage is an option to silence usage when an error occurs.
SilenceUsage bool
// DisableFlagParsing disables the flag parsing.
// If this is true all flags will be passed to the command as arguments.
DisableFlagParsing bool
// DisableAutoGenTag defines, if gen tag ("Auto generated by spf13/cobra...")
// will be printed by generating docs for this command.
DisableAutoGenTag bool
// DisableSuggestions disables the suggestions based on Levenshtein distance
// that go along with 'unknown command' messages.
DisableSuggestions bool
// SuggestionsMinimumDistance defines minimum levenshtein distance to display suggestions.
// Must be > 0.
SuggestionsMinimumDistance int
// name is the command name, usually the executable's name.
name string
// commands is the list of commands supported by this program.
commands []*Command
// parent is a parent command for this command.
parent *Command
// Max lengths of commands' string lengths for use in padding.
commandsMaxUseLen int
commandsMaxCommandPathLen int
commandsMaxNameLen int
// commandsAreSorted defines, if command slice are sorted or not.
commandsAreSorted bool
// args is actual args parsed from flags.
args []string
// flagErrorBuf contains all error messages from pflag.
flagErrorBuf *bytes.Buffer
// flags is full set of flags.
flags *flag.FlagSet
// pflags contains persistent flags.
pflags *flag.FlagSet
// lflags contains local flags.
lflags *flag.FlagSet
// iflags contains inherited flags.
iflags *flag.FlagSet
// parentsPflags is all persistent flags of cmd's parents.
parentsPflags *flag.FlagSet
// globNormFunc is the global normalization function
// that we can use on every pflag set and children commands
globNormFunc func(f *flag.FlagSet, name string) flag.NormalizedName
// output is an output writer defined by user.
output io.Writer
// usageFunc is usage func defined by user.
usageFunc func(*Command) error
// usageTemplate is usage template defined by user.
usageTemplate string
// flagErrorFunc is func defined by user and it's called when the parsing of
// flags returns an error.
flagErrorFunc func(*Command, error) error
// helpTemplate is help template defined by user.
helpTemplate string
// helpFunc is help func defined by user.
helpFunc func(*Command, []string)
// helpCommand is command with usage 'help'. If it's not defined by user,
// cobra uses default help command.
helpCommand *Command
}
// SetArgs sets arguments for the command. It is set to os.Args[1:] by default, if desired, can be overridden
// particularly useful when testing.
func (c *Command) SetArgs(a []string) {
c.args = a
}
// SetOutput sets the destination for usage and error messages.
// If output is nil, os.Stderr is used.
func (c *Command) SetOutput(output io.Writer) {
c.output = output
}
// SetUsageFunc sets usage function. Usage can be defined by application.
func (c *Command) SetUsageFunc(f func(*Command) error) {
c.usageFunc = f
}
// SetUsageTemplate sets usage template. Can be defined by Application.
func (c *Command) SetUsageTemplate(s string) {
c.usageTemplate = s
}
// SetFlagErrorFunc sets a function to generate an error when flag parsing
// fails.
func (c *Command) SetFlagErrorFunc(f func(*Command, error) error) {
c.flagErrorFunc = f
}
// SetHelpFunc sets help function. Can be defined by Application.
func (c *Command) SetHelpFunc(f func(*Command, []string)) {
c.helpFunc = f
}
// SetHelpCommand sets help command.
func (c *Command) SetHelpCommand(cmd *Command) {
c.helpCommand = cmd
}
// SetHelpTemplate sets help template to be used. Application can use it to set custom template.
func (c *Command) SetHelpTemplate(s string) {
c.helpTemplate = s
}
// SetGlobalNormalizationFunc sets a normalization function to all flag sets and also to child commands.
// The user should not have a cyclic dependency on commands.
func (c *Command) SetGlobalNormalizationFunc(n func(f *flag.FlagSet, name string) flag.NormalizedName) {
c.Flags().SetNormalizeFunc(n)
c.PersistentFlags().SetNormalizeFunc(n)
c.globNormFunc = n
for _, command := range c.commands {
command.SetGlobalNormalizationFunc(n)
}
}
// OutOrStdout returns output to stdout.
func (c *Command) OutOrStdout() io.Writer {
return c.getOut(os.Stdout)
}
// OutOrStderr returns output to stderr
func (c *Command) OutOrStderr() io.Writer {
return c.getOut(os.Stderr)
}
func (c *Command) getOut(def io.Writer) io.Writer {
if c.output != nil {
return c.output
}
if c.HasParent() {
return c.parent.getOut(def)
}
return def
}
// UsageFunc returns either the function set by SetUsageFunc for this command
// or a parent, or it returns a default usage function.
func (c *Command) UsageFunc() (f func(*Command) error) {
if c.usageFunc != nil {
return c.usageFunc
}
if c.HasParent() {
return c.Parent().UsageFunc()
}
return func(c *Command) error {
c.mergePersistentFlags()
err := tmpl(c.OutOrStderr(), c.UsageTemplate(), c)
if err != nil {
c.Println(err)
}
return err
}
}
// Usage puts out the usage for the command.
// Used when a user provides invalid input.
// Can be defined by user by overriding UsageFunc.
func (c *Command) Usage() error {
return c.UsageFunc()(c)
}
// HelpFunc returns either the function set by SetHelpFunc for this command
// or a parent, or it returns a function with default help behavior.
func (c *Command) HelpFunc() func(*Command, []string) {
if c.helpFunc != nil {
return c.helpFunc
}
if c.HasParent() {
return c.Parent().HelpFunc()
}
return func(c *Command, a []string) {
c.mergePersistentFlags()
err := tmpl(c.OutOrStdout(), c.HelpTemplate(), c)
if err != nil {
c.Println(err)
}
}
}
// Help puts out the help for the command.
// Used when a user calls help [command].
// Can be defined by user by overriding HelpFunc.
func (c *Command) Help() error {
c.HelpFunc()(c, []string{})
return nil
}
// UsageString return usage string.
func (c *Command) UsageString() string {
tmpOutput := c.output
bb := new(bytes.Buffer)
c.SetOutput(bb)
c.Usage()
c.output = tmpOutput
return bb.String()
}
// FlagErrorFunc returns either the function set by SetFlagErrorFunc for this
// command or a parent, or it returns a function which returns the original
// error.
func (c *Command) FlagErrorFunc() (f func(*Command, error) error) {
if c.flagErrorFunc != nil {
return c.flagErrorFunc
}
if c.HasParent() {
return c.parent.FlagErrorFunc()
}
return func(c *Command, err error) error {
return err
}
}
var minUsagePadding = 25
// UsagePadding return padding for the usage.
func (c *Command) UsagePadding() int {
if c.parent == nil || minUsagePadding > c.parent.commandsMaxUseLen {
return minUsagePadding
}
return c.parent.commandsMaxUseLen
}
var minCommandPathPadding = 11
// CommandPathPadding return padding for the command path.
func (c *Command) CommandPathPadding() int {
if c.parent == nil || minCommandPathPadding > c.parent.commandsMaxCommandPathLen {
return minCommandPathPadding
}
return c.parent.commandsMaxCommandPathLen
}
var minNamePadding = 11
// NamePadding returns padding for the name.
func (c *Command) NamePadding() int {
if c.parent == nil || minNamePadding > c.parent.commandsMaxNameLen {
return minNamePadding
}
return c.parent.commandsMaxNameLen
}
// UsageTemplate returns usage template for the command.
func (c *Command) UsageTemplate() string {
if c.usageTemplate != "" {
return c.usageTemplate
}
if c.HasParent() {
return c.parent.UsageTemplate()
}
return `Usage:{{if .Runnable}}
{{.UseLine}}{{end}}{{if .HasAvailableSubCommands}}
{{.CommandPath}} [command]{{end}}{{if gt (len .Aliases) 0}}
Aliases:
{{.NameAndAliases}}{{end}}{{if .HasExample}}
Examples:
{{.Example}}{{end}}{{if .HasAvailableSubCommands}}
Available Commands:{{range .Commands}}{{if (or .IsAvailableCommand (eq .Name "help"))}}
{{rpad .Name .NamePadding }} {{.Short}}{{end}}{{end}}{{end}}{{if .HasAvailableLocalFlags}}
Flags:
{{.LocalFlags.FlagUsages | trimTrailingWhitespaces}}{{end}}{{if .HasAvailableInheritedFlags}}
Global Flags:
{{.InheritedFlags.FlagUsages | trimTrailingWhitespaces}}{{end}}{{if .HasHelpSubCommands}}
Additional help topics:{{range .Commands}}{{if .IsAdditionalHelpTopicCommand}}
{{rpad .CommandPath .CommandPathPadding}} {{.Short}}{{end}}{{end}}{{end}}{{if .HasAvailableSubCommands}}
Use "{{.CommandPath}} [command] --help" for more information about a command.{{end}}
`
}
// HelpTemplate return help template for the command.
func (c *Command) HelpTemplate() string {
if c.helpTemplate != "" {
return c.helpTemplate
}
if c.HasParent() {
return c.parent.HelpTemplate()
}
return `{{with (or .Long .Short)}}{{. | trimTrailingWhitespaces}}
{{end}}{{if or .Runnable .HasSubCommands}}{{.UsageString}}{{end}}`
}
func hasNoOptDefVal(name string, fs *flag.FlagSet) bool {
flag := fs.Lookup(name)
if flag == nil {
return false
}
return flag.NoOptDefVal != ""
}
func shortHasNoOptDefVal(name string, fs *flag.FlagSet) bool {
if len(name) == 0 {
return false
}
flag := fs.ShorthandLookup(name[:1])
if flag == nil {
return false
}
return flag.NoOptDefVal != ""
}
func stripFlags(args []string, c *Command) []string {
if len(args) == 0 {
return args
}
c.mergePersistentFlags()
commands := []string{}
flags := c.Flags()
Loop:
for len(args) > 0 {
s := args[0]
args = args[1:]
switch {
case strings.HasPrefix(s, "--") && !strings.Contains(s, "=") && !hasNoOptDefVal(s[2:], flags):
// If '--flag arg' then
// delete arg from args.
fallthrough // (do the same as below)
case strings.HasPrefix(s, "-") && !strings.Contains(s, "=") && len(s) == 2 && !shortHasNoOptDefVal(s[1:], flags):
// If '-f arg' then
// delete 'arg' from args or break the loop if len(args) <= 1.
if len(args) <= 1 {
break Loop
} else {
args = args[1:]
continue
}
case s != "" && !strings.HasPrefix(s, "-"):
commands = append(commands, s)
}
}
return commands
}
// argsMinusFirstX removes only the first x from args. Otherwise, commands that look like
// openshift admin policy add-role-to-user admin my-user, lose the admin argument (arg[4]).
func argsMinusFirstX(args []string, x string) []string {
for i, y := range args {
if x == y {
ret := []string{}
ret = append(ret, args[:i]...)
ret = append(ret, args[i+1:]...)
return ret
}
}
return args
}
// Find the target command given the args and command tree
// Meant to be run on the highest node. Only searches down.
func (c *Command) Find(args []string) (*Command, []string, error) {
if c == nil {
return nil, nil, fmt.Errorf("Called find() on a nil Command")
}
var innerfind func(*Command, []string) (*Command, []string)
innerfind = func(c *Command, innerArgs []string) (*Command, []string) {
argsWOflags := stripFlags(innerArgs, c)
if len(argsWOflags) == 0 {
return c, innerArgs
}
nextSubCmd := argsWOflags[0]
matches := make([]*Command, 0)
for _, cmd := range c.commands {
if cmd.Name() == nextSubCmd || cmd.HasAlias(nextSubCmd) { // exact name or alias match
return innerfind(cmd, argsMinusFirstX(innerArgs, nextSubCmd))
}
if EnablePrefixMatching {
if strings.HasPrefix(cmd.Name(), nextSubCmd) { // prefix match
matches = append(matches, cmd)
}
for _, x := range cmd.Aliases {
if strings.HasPrefix(x, nextSubCmd) {
matches = append(matches, cmd)
}
}
}
}
// only accept a single prefix match - multiple matches would be ambiguous
if len(matches) == 1 {
return innerfind(matches[0], argsMinusFirstX(innerArgs, argsWOflags[0]))
}
return c, innerArgs
}
commandFound, a := innerfind(c, args)
if commandFound.Args == nil {
return commandFound, a, legacyArgs(commandFound, stripFlags(a, commandFound))
}
return commandFound, a, nil
}
func (c *Command) findSuggestions(arg string) string {
if c.DisableSuggestions {
return ""
}
if c.SuggestionsMinimumDistance <= 0 {
c.SuggestionsMinimumDistance = 2
}
suggestionsString := ""
if suggestions := c.SuggestionsFor(arg); len(suggestions) > 0 {
suggestionsString += "\n\nDid you mean this?\n"
for _, s := range suggestions {
suggestionsString += fmt.Sprintf("\t%v\n", s)
}
}
return suggestionsString
}
// SuggestionsFor provides suggestions for the typedName.
func (c *Command) SuggestionsFor(typedName string) []string {
suggestions := []string{}
for _, cmd := range c.commands {
if cmd.IsAvailableCommand() {
levenshteinDistance := ld(typedName, cmd.Name(), true)
suggestByLevenshtein := levenshteinDistance <= c.SuggestionsMinimumDistance
suggestByPrefix := strings.HasPrefix(strings.ToLower(cmd.Name()), strings.ToLower(typedName))
if suggestByLevenshtein || suggestByPrefix {
suggestions = append(suggestions, cmd.Name())
}
for _, explicitSuggestion := range cmd.SuggestFor {
if strings.EqualFold(typedName, explicitSuggestion) {
suggestions = append(suggestions, cmd.Name())
}
}
}
}
return suggestions
}
// VisitParents visits all parents of the command and invokes fn on each parent.
func (c *Command) VisitParents(fn func(*Command)) {
if c.HasParent() {
fn(c.Parent())
c.Parent().VisitParents(fn)
}
}
// Root finds root command.
func (c *Command) Root() *Command {
if c.HasParent() {
return c.Parent().Root()
}
return c
}
// ArgsLenAtDash will return the length of f.Args at the moment when a -- was
// found during arg parsing. This allows your program to know which args were
// before the -- and which came after. (Description from
// https://godoc.org/github.com/spf13/pflag#FlagSet.ArgsLenAtDash).
func (c *Command) ArgsLenAtDash() int {
return c.Flags().ArgsLenAtDash()
}
func (c *Command) execute(a []string) (err error) {
if c == nil {
return fmt.Errorf("Called Execute() on a nil Command")
}
if len(c.Deprecated) > 0 {
c.Printf("Command %q is deprecated, %s\n", c.Name(), c.Deprecated)
}
// initialize help flag as the last point possible to allow for user
// overriding
c.InitDefaultHelpFlag()
err = c.ParseFlags(a)
if err != nil {
return c.FlagErrorFunc()(c, err)
}
// If help is called, regardless of other flags, return we want help.
// Also say we need help if the command isn't runnable.
helpVal, err := c.Flags().GetBool("help")
if err != nil {
// should be impossible to get here as we always declare a help
// flag in InitDefaultHelpFlag()
c.Println("\"help\" flag declared as non-bool. Please correct your code")
return err
}
if helpVal || !c.Runnable() {
return flag.ErrHelp
}
c.preRun()
argWoFlags := c.Flags().Args()
if c.DisableFlagParsing {
argWoFlags = a
}
if err := c.ValidateArgs(argWoFlags); err != nil {
return err
}
for p := c; p != nil; p = p.Parent() {
if p.PersistentPreRunE != nil {
if err := p.PersistentPreRunE(c, argWoFlags); err != nil {
return err
}
break
} else if p.PersistentPreRun != nil {
p.PersistentPreRun(c, argWoFlags)
break
}
}
if c.PreRunE != nil {
if err := c.PreRunE(c, argWoFlags); err != nil {
return err
}
} else if c.PreRun != nil {
c.PreRun(c, argWoFlags)
}
if c.RunE != nil {
if err := c.RunE(c, argWoFlags); err != nil {
return err
}
} else {
c.Run(c, argWoFlags)
}
if c.PostRunE != nil {
if err := c.PostRunE(c, argWoFlags); err != nil {
return err
}
} else if c.PostRun != nil {
c.PostRun(c, argWoFlags)
}
for p := c; p != nil; p = p.Parent() {
if p.PersistentPostRunE != nil {
if err := p.PersistentPostRunE(c, argWoFlags); err != nil {
return err
}
break
} else if p.PersistentPostRun != nil {
p.PersistentPostRun(c, argWoFlags)
break
}
}
return nil
}
func (c *Command) preRun() {
for _, x := range initializers {
x()
}
}
// Execute uses the args (os.Args[1:] by default)
// and run through the command tree finding appropriate matches
// for commands and then corresponding flags.
func (c *Command) Execute() error {
_, err := c.ExecuteC()
return err
}
// ExecuteC executes the command.
func (c *Command) ExecuteC() (cmd *Command, err error) {
// Regardless of what command execute is called on, run on Root only
if c.HasParent() {
return c.Root().ExecuteC()
}
// windows hook
if preExecHookFn != nil {
preExecHookFn(c)
}
// initialize help as the last point possible to allow for user
// overriding
c.InitDefaultHelpCmd()
var args []string
// Workaround FAIL with "go test -v" or "cobra.test -test.v", see #155
if c.args == nil && filepath.Base(os.Args[0]) != "cobra.test" {
args = os.Args[1:]
} else {
args = c.args
}
cmd, flags, err := c.Find(args)
if err != nil {
// If found parse to a subcommand and then failed, talk about the subcommand
if cmd != nil {
c = cmd
}
if !c.SilenceErrors {
c.Println("Error:", err.Error())
c.Printf("Run '%v --help' for usage.\n", c.CommandPath())
}
return c, err
}
err = cmd.execute(flags)
if err != nil {
// Always show help if requested, even if SilenceErrors is in
// effect
if err == flag.ErrHelp {
cmd.HelpFunc()(cmd, args)
return cmd, nil
}
// If root command has SilentErrors flagged,
// all subcommands should respect it
if !cmd.SilenceErrors && !c.SilenceErrors {
c.Println("Error:", err.Error())
}
// If root command has SilentUsage flagged,
// all subcommands should respect it
if !cmd.SilenceUsage && !c.SilenceUsage {
c.Println(cmd.UsageString())
}
}
return cmd, err
}
func (c *Command) ValidateArgs(args []string) error {
if c.Args == nil {
return nil
}
return c.Args(c, args)
}
// InitDefaultHelpFlag adds default help flag to c.
// It is called automatically by executing the c or by calling help and usage.
// If c already has help flag, it will do nothing.
func (c *Command) InitDefaultHelpFlag() {
c.mergePersistentFlags()
if c.Flags().Lookup("help") == nil {
usage := "help for "
if c.Name() == "" {
usage += "this command"
} else {
usage += c.Name()
}
c.Flags().BoolP("help", "h", false, usage)
}
}
// InitDefaultHelpCmd adds default help command to c.
// It is called automatically by executing the c or by calling help and usage.
// If c already has help command or c has no subcommands, it will do nothing.
func (c *Command) InitDefaultHelpCmd() {
if !c.HasSubCommands() {
return
}
if c.helpCommand == nil {
c.helpCommand = &Command{
Use: "help [command]",
Short: "Help about any command",
Long: `Help provides help for any command in the application.
Simply type ` + c.Name() + ` help [path to command] for full details.`,
Run: func(c *Command, args []string) {
cmd, _, e := c.Root().Find(args)
if cmd == nil || e != nil {
c.Printf("Unknown help topic %#q\n", args)
c.Root().Usage()
} else {
cmd.InitDefaultHelpFlag() // make possible 'help' flag to be shown
cmd.Help()
}
},
}
}
c.RemoveCommand(c.helpCommand)
c.AddCommand(c.helpCommand)
}
// ResetCommands used for testing.
func (c *Command) ResetCommands() {
c.commands = nil
c.helpCommand = nil
c.parentsPflags = nil
}
// Sorts commands by their names.
type commandSorterByName []*Command
func (c commandSorterByName) Len() int { return len(c) }
func (c commandSorterByName) Swap(i, j int) { c[i], c[j] = c[j], c[i] }
func (c commandSorterByName) Less(i, j int) bool { return c[i].Name() < c[j].Name() }
// Commands returns a sorted slice of child commands.
func (c *Command) Commands() []*Command {
// do not sort commands if it already sorted or sorting was disabled
if EnableCommandSorting && !c.commandsAreSorted {
sort.Sort(commandSorterByName(c.commands))
c.commandsAreSorted = true
}
return c.commands
}
// AddCommand adds one or more commands to this parent command.
func (c *Command) AddCommand(cmds ...*Command) {
for i, x := range cmds {
if cmds[i] == c {
panic("Command can't be a child of itself")
}
cmds[i].parent = c
// update max lengths
usageLen := len(x.Use)
if usageLen > c.commandsMaxUseLen {
c.commandsMaxUseLen = usageLen
}
commandPathLen := len(x.CommandPath())
if commandPathLen > c.commandsMaxCommandPathLen {
c.commandsMaxCommandPathLen = commandPathLen
}
nameLen := len(x.Name())
if nameLen > c.commandsMaxNameLen {
c.commandsMaxNameLen = nameLen
}
// If global normalization function exists, update all children
if c.globNormFunc != nil {
x.SetGlobalNormalizationFunc(c.globNormFunc)
}
c.commands = append(c.commands, x)
c.commandsAreSorted = false
}
}
// RemoveCommand removes one or more commands from a parent command.
func (c *Command) RemoveCommand(cmds ...*Command) {
commands := []*Command{}
main:
for _, command := range c.commands {
for _, cmd := range cmds {
if command == cmd {
command.parent = nil
continue main
}
}
commands = append(commands, command)
}
c.commands = commands
// recompute all lengths
c.commandsMaxUseLen = 0
c.commandsMaxCommandPathLen = 0
c.commandsMaxNameLen = 0
for _, command := range c.commands {
usageLen := len(command.Use)
if usageLen > c.commandsMaxUseLen {
c.commandsMaxUseLen = usageLen
}
commandPathLen := len(command.CommandPath())
if commandPathLen > c.commandsMaxCommandPathLen {
c.commandsMaxCommandPathLen = commandPathLen
}
nameLen := len(command.Name())
if nameLen > c.commandsMaxNameLen {
c.commandsMaxNameLen = nameLen
}
}
}
// Print is a convenience method to Print to the defined output, fallback to Stderr if not set.
func (c *Command) Print(i ...interface{}) {
fmt.Fprint(c.OutOrStderr(), i...)
}
// Println is a convenience method to Println to the defined output, fallback to Stderr if not set.
func (c *Command) Println(i ...interface{}) {
c.Print(fmt.Sprintln(i...))
}
// Printf is a convenience method to Printf to the defined output, fallback to Stderr if not set.
func (c *Command) Printf(format string, i ...interface{}) {
c.Print(fmt.Sprintf(format, i...))
}
// CommandPath returns the full path to this command.
func (c *Command) CommandPath() string {
if c.HasParent() {
return c.Parent().CommandPath() + " " + c.Name()
}
return c.Name()
}
// UseLine puts out the full usage for a given command (including parents).
func (c *Command) UseLine() string {
var useline string
if c.HasParent() {
useline = c.parent.CommandPath() + " " + c.Use
} else {
useline = c.Use
}
if c.HasAvailableFlags() && !strings.Contains(useline, "[flags]") {
useline += " [flags]"
}
return useline
}
// DebugFlags used to determine which flags have been assigned to which commands
// and which persist.
func (c *Command) DebugFlags() {
c.Println("DebugFlags called on", c.Name())
var debugflags func(*Command)
debugflags = func(x *Command) {
if x.HasFlags() || x.HasPersistentFlags() {
c.Println(x.Name())
}
if x.HasFlags() {
x.flags.VisitAll(func(f *flag.Flag) {
if x.HasPersistentFlags() && x.persistentFlag(f.Name) != nil {
c.Println(" -"+f.Shorthand+",", "--"+f.Name, "["+f.DefValue+"]", "", f.Value, " [LP]")
} else {
c.Println(" -"+f.Shorthand+",", "--"+f.Name, "["+f.DefValue+"]", "", f.Value, " [L]")
}
})
}
if x.HasPersistentFlags() {
x.pflags.VisitAll(func(f *flag.Flag) {
if x.HasFlags() {
if x.flags.Lookup(f.Name) == nil {
c.Println(" -"+f.Shorthand+",", "--"+f.Name, "["+f.DefValue+"]", "", f.Value, " [P]")
}
} else {
c.Println(" -"+f.Shorthand+",", "--"+f.Name, "["+f.DefValue+"]", "", f.Value, " [P]")
}
})
}
c.Println(x.flagErrorBuf)
if x.HasSubCommands() {
for _, y := range x.commands {
debugflags(y)
}
}
}
debugflags(c)
}
// Name returns the command's name: the first word in the use line.
func (c *Command) Name() string {
if c.name == "" {
name := c.Use
i := strings.Index(name, " ")
if i >= 0 {
name = name[:i]
}
c.name = name
}
return c.name
}
// HasAlias determines if a given string is an alias of the command.
func (c *Command) HasAlias(s string) bool {
for _, a := range c.Aliases {
if a == s {
return true
}
}
return false
}
// NameAndAliases returns string containing name and all aliases
func (c *Command) NameAndAliases() string {
return strings.Join(append([]string{c.Name()}, c.Aliases...), ", ")
}
// HasExample determines if the command has example.
func (c *Command) HasExample() bool {
return len(c.Example) > 0
}
// Runnable determines if the command is itself runnable.
func (c *Command) Runnable() bool {
return c.Run != nil || c.RunE != nil
}
// HasSubCommands determines if the command has children commands.
func (c *Command) HasSubCommands() bool {
return len(c.commands) > 0
}
// IsAvailableCommand determines if a command is available as a non-help command
// (this includes all non deprecated/hidden commands).
func (c *Command) IsAvailableCommand() bool {
if len(c.Deprecated) != 0 || c.Hidden {
return false
}
if c.HasParent() && c.Parent().helpCommand == c {
return false
}
if c.Runnable() || c.HasAvailableSubCommands() {
return true
}
return false
}
// IsAdditionalHelpTopicCommand determines if a command is an additional
// help topic command; additional help topic command is determined by the
// fact that it is NOT runnable/hidden/deprecated, and has no sub commands that
// are runnable/hidden/deprecated.
// Concrete example: https://github.com/spf13/cobra/issues/393#issuecomment-282741924.
func (c *Command) IsAdditionalHelpTopicCommand() bool {
// if a command is runnable, deprecated, or hidden it is not a 'help' command
if c.Runnable() || len(c.Deprecated) != 0 || c.Hidden {
return false
}
// if any non-help sub commands are found, the command is not a 'help' command
for _, sub := range c.commands {
if !sub.IsAdditionalHelpTopicCommand() {
return false
}
}
// the command either has no sub commands, or no non-help sub commands
return true
}
// HasHelpSubCommands determines if a command has any available 'help' sub commands
// that need to be shown in the usage/help default template under 'additional help
// topics'.
func (c *Command) HasHelpSubCommands() bool {
// return true on the first found available 'help' sub command
for _, sub := range c.commands {
if sub.IsAdditionalHelpTopicCommand() {
return true
}
}
// the command either has no sub commands, or no available 'help' sub commands
return false
}
// HasAvailableSubCommands determines if a command has available sub commands that
// need to be shown in the usage/help default template under 'available commands'.
func (c *Command) HasAvailableSubCommands() bool {
// return true on the first found available (non deprecated/help/hidden)
// sub command
for _, sub := range c.commands {
if sub.IsAvailableCommand() {
return true
}
}
// the command either has no sub comamnds, or no available (non deprecated/help/hidden)
// sub commands
return false
}
// HasParent determines if the command is a child command.
func (c *Command) HasParent() bool {
return c.parent != nil
}
// GlobalNormalizationFunc returns the global normalization function or nil if doesn't exists.
func (c *Command) GlobalNormalizationFunc() func(f *flag.FlagSet, name string) flag.NormalizedName {
return c.globNormFunc
}
// Flags returns the complete FlagSet that applies
// to this command (local and persistent declared here and by all parents).
func (c *Command) Flags() *flag.FlagSet {
if c.flags == nil {
c.flags = flag.NewFlagSet(c.Name(), flag.ContinueOnError)
if c.flagErrorBuf == nil {
c.flagErrorBuf = new(bytes.Buffer)
}
c.flags.SetOutput(c.flagErrorBuf)
}
return c.flags
}
// LocalNonPersistentFlags are flags specific to this command which will NOT persist to subcommands.
func (c *Command) LocalNonPersistentFlags() *flag.FlagSet {
persistentFlags := c.PersistentFlags()
out := flag.NewFlagSet(c.Name(), flag.ContinueOnError)
c.LocalFlags().VisitAll(func(f *flag.Flag) {
if persistentFlags.Lookup(f.Name) == nil {
out.AddFlag(f)
}
})
return out
}
// LocalFlags returns the local FlagSet specifically set in the current command.
func (c *Command) LocalFlags() *flag.FlagSet {
c.mergePersistentFlags()
if c.lflags == nil {
c.lflags = flag.NewFlagSet(c.Name(), flag.ContinueOnError)
if c.flagErrorBuf == nil {
c.flagErrorBuf = new(bytes.Buffer)
}
c.lflags.SetOutput(c.flagErrorBuf)
}
c.lflags.SortFlags = c.Flags().SortFlags
addToLocal := func(f *flag.Flag) {
if c.lflags.Lookup(f.Name) == nil && c.parentsPflags.Lookup(f.Name) == nil {
c.lflags.AddFlag(f)
}
}
c.Flags().VisitAll(addToLocal)
c.PersistentFlags().VisitAll(addToLocal)
return c.lflags
}
// InheritedFlags returns all flags which were inherited from parents commands.
func (c *Command) InheritedFlags() *flag.FlagSet {
c.mergePersistentFlags()
if c.iflags == nil {
c.iflags = flag.NewFlagSet(c.Name(), flag.ContinueOnError)
if c.flagErrorBuf == nil {
c.flagErrorBuf = new(bytes.Buffer)
}
c.iflags.SetOutput(c.flagErrorBuf)
}
local := c.LocalFlags()
c.parentsPflags.VisitAll(func(f *flag.Flag) {
if c.iflags.Lookup(f.Name) == nil && local.Lookup(f.Name) == nil {
c.iflags.AddFlag(f)
}
})
return c.iflags
}
// NonInheritedFlags returns all flags which were not inherited from parent commands.
func (c *Command) NonInheritedFlags() *flag.FlagSet {
return c.LocalFlags()
}
// PersistentFlags returns the persistent FlagSet specifically set in the current command.
func (c *Command) PersistentFlags() *flag.FlagSet {
if c.pflags == nil {
c.pflags = flag.NewFlagSet(c.Name(), flag.ContinueOnError)
if c.flagErrorBuf == nil {
c.flagErrorBuf = new(bytes.Buffer)
}
c.pflags.SetOutput(c.flagErrorBuf)
}
return c.pflags
}
// ResetFlags is used in testing.
func (c *Command) ResetFlags() {
c.flagErrorBuf = new(bytes.Buffer)
c.flagErrorBuf.Reset()
c.flags = flag.NewFlagSet(c.Name(), flag.ContinueOnError)
c.flags.SetOutput(c.flagErrorBuf)
c.pflags = flag.NewFlagSet(c.Name(), flag.ContinueOnError)
c.pflags.SetOutput(c.flagErrorBuf)
}
// HasFlags checks if the command contains any flags (local plus persistent from the entire structure).
func (c *Command) HasFlags() bool {
return c.Flags().HasFlags()
}
// HasPersistentFlags checks if the command contains persistent flags.
func (c *Command) HasPersistentFlags() bool {
return c.PersistentFlags().HasFlags()
}
// HasLocalFlags checks if the command has flags specifically declared locally.
func (c *Command) HasLocalFlags() bool {
return c.LocalFlags().HasFlags()
}
// HasInheritedFlags checks if the command has flags inherited from its parent command.
func (c *Command) HasInheritedFlags() bool {
return c.InheritedFlags().HasFlags()
}
// HasAvailableFlags checks if the command contains any flags (local plus persistent from the entire
// structure) which are not hidden or deprecated.
func (c *Command) HasAvailableFlags() bool {
return c.Flags().HasAvailableFlags()
}
// HasAvailablePersistentFlags checks if the command contains persistent flags which are not hidden or deprecated.
func (c *Command) HasAvailablePersistentFlags() bool {
return c.PersistentFlags().HasAvailableFlags()
}
// HasAvailableLocalFlags checks if the command has flags specifically declared locally which are not hidden
// or deprecated.
func (c *Command) HasAvailableLocalFlags() bool {
return c.LocalFlags().HasAvailableFlags()
}
// HasAvailableInheritedFlags checks if the command has flags inherited from its parent command which are
// not hidden or deprecated.
func (c *Command) HasAvailableInheritedFlags() bool {
return c.InheritedFlags().HasAvailableFlags()
}
// Flag climbs up the command tree looking for matching flag.
func (c *Command) Flag(name string) (flag *flag.Flag) {
flag = c.Flags().Lookup(name)
if flag == nil {
flag = c.persistentFlag(name)
}
return
}
// Recursively find matching persistent flag.
func (c *Command) persistentFlag(name string) (flag *flag.Flag) {
if c.HasPersistentFlags() {
flag = c.PersistentFlags().Lookup(name)
}
if flag == nil {
c.updateParentsPflags()
flag = c.parentsPflags.Lookup(name)
}
return
}
// ParseFlags parses persistent flag tree and local flags.
func (c *Command) ParseFlags(args []string) error {
if c.DisableFlagParsing {
return nil
}
beforeErrorBufLen := c.flagErrorBuf.Len()
c.mergePersistentFlags()
err := c.Flags().Parse(args)
// Print warnings if they occurred (e.g. deprecated flag messages).
if c.flagErrorBuf.Len()-beforeErrorBufLen > 0 && err == nil {
c.Print(c.flagErrorBuf.String())
}
return err
}
// Parent returns a commands parent command.
func (c *Command) Parent() *Command {
return c.parent
}
// mergePersistentFlags merges c.PersistentFlags() to c.Flags()
// and adds missing persistent flags of all parents.
func (c *Command) mergePersistentFlags() {
c.updateParentsPflags()
c.Flags().AddFlagSet(c.PersistentFlags())
c.Flags().AddFlagSet(c.parentsPflags)
}
// updateParentsPflags updates c.parentsPflags by adding
// new persistent flags of all parents.
// If c.parentsPflags == nil, it makes new.
func (c *Command) updateParentsPflags() {
if c.parentsPflags == nil {
c.parentsPflags = flag.NewFlagSet(c.Name(), flag.ContinueOnError)
c.parentsPflags.SetOutput(c.flagErrorBuf)
c.parentsPflags.SortFlags = false
}
c.Root().PersistentFlags().AddFlagSet(flag.CommandLine)
c.VisitParents(func(parent *Command) {
c.parentsPflags.AddFlagSet(parent.PersistentFlags())
})
}
| {
"pile_set_name": "Github"
} |
/*
* Copyright (c) 2012 The Broad Institute
*
* Permission is hereby granted, free of charge, to any person
* obtaining a copy of this software and associated documentation
* files (the "Software"), to deal in the Software without
* restriction, including without limitation the rights to use,
* copy, modify, merge, publish, distribute, sublicense, and/or sell
* copies of the Software, and to permit persons to whom the
* Software is furnished to do so, subject to the following
* conditions:
*
* The above copyright notice and this permission notice shall be
* included in all copies or substantial portions of the Software.
*
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
* EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES
* OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
* NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT
* HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
* WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
* FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR
* THE USE OR OTHER DEALINGS IN THE SOFTWARE.
*/
package htsjdk.variant.variantcontext;
/**
* Summary types for Genotype objects
*
* @author Your Name
* @since Date created
*/
public enum GenotypeType {
/** The sample is no-called (all alleles are NO_CALL */
NO_CALL,
/** The sample is homozygous reference */
HOM_REF,
/** The sample is heterozygous, with at least one ref and at least one one alt in any order */
HET,
/** All alleles are non-reference */
HOM_VAR,
/** There is no allele data availble for this sample (alleles.isEmpty) */
UNAVAILABLE,
/** Some chromosomes are NO_CALL and others are called */
MIXED // no-call and call in the same genotype
}
| {
"pile_set_name": "Github"
} |
idx label predict radius correct time
0 3 -1 0.0000 0 0:00:25.277525
20 7 -1 0.0000 0 0:00:25.280295
40 4 -1 0.0000 0 0:00:25.312113
60 7 7 1.1335 1 0:00:25.330478
80 8 8 0.7339 1 0:00:25.361639
100 4 -1 0.0000 0 0:00:25.367384
120 8 8 1.0432 1 0:00:25.373904
140 6 -1 0.0000 0 0:00:25.365849
160 2 2 0.1815 1 0:00:25.373245
180 0 0 1.9030 1 0:00:25.381032
200 5 3 1.1048 0 0:00:25.362778
220 7 7 2.9454 1 0:00:25.359231
240 1 1 2.8264 1 0:00:25.374952
260 8 -1 0.0000 0 0:00:25.393386
280 9 9 2.9657 1 0:00:25.386574
300 6 6 0.4565 1 0:00:25.396945
320 3 5 0.4611 0 0:00:25.388421
340 2 4 0.2889 0 0:00:25.399884
360 9 -1 0.0000 0 0:00:25.377118
380 6 6 0.4698 1 0:00:25.380279
400 9 9 2.1956 1 0:00:25.381670
420 4 -1 0.0000 0 0:00:25.376905
440 1 1 0.7372 1 0:00:25.391186
460 5 5 1.2299 1 0:00:25.389553
480 8 9 1.3032 0 0:00:25.396229
500 4 6 0.2631 0 0:00:25.398701
520 5 5 0.5232 1 0:00:25.406920
540 1 -1 0.0000 0 0:00:25.415105
560 0 0 1.2286 1 0:00:25.399276
580 4 4 0.2536 1 0:00:25.412121
600 8 8 0.8861 1 0:00:25.405511
620 7 -1 0.0000 0 0:00:25.404981
640 5 3 1.4822 0 0:00:25.401526
660 9 9 3.1280 1 0:00:25.399230
680 9 9 0.0600 1 0:00:25.393586
700 7 7 1.4200 1 0:00:25.412755
720 4 9 0.0751 0 0:00:25.415305
740 2 -1 0.0000 0 0:00:25.413241
760 3 9 0.0552 0 0:00:25.421890
780 9 9 0.3724 1 0:00:25.423250
800 7 7 2.2047 1 0:00:25.416491
820 6 -1 0.0000 0 0:00:25.417202
840 7 7 3.5669 1 0:00:25.423036
860 4 4 1.6090 1 0:00:25.413028
880 8 8 3.0735 1 0:00:25.418678
900 2 6 0.1899 0 0:00:25.408339
920 6 2 0.2529 0 0:00:25.403265
940 9 9 0.7770 1 0:00:25.402313
960 9 9 1.4742 1 0:00:25.410137
980 2 6 2.0331 0 0:00:25.411751
1000 5 5 2.9925 1 0:00:25.413168
1020 1 1 0.9077 1 0:00:25.422492
1040 7 5 2.1595 0 0:00:25.401417
1060 9 9 1.8607 1 0:00:25.401351
1080 6 6 1.9374 1 0:00:25.391307
1100 7 8 1.0491 0 0:00:25.399436
1120 5 -1 0.0000 0 0:00:25.394233
1140 6 6 0.4152 1 0:00:25.377983
1160 8 0 0.0105 0 0:00:25.377300
1180 3 3 0.5145 1 0:00:25.384704
1200 8 8 0.8788 1 0:00:25.393584
1220 9 -1 0.0000 0 0:00:25.383141
1240 2 6 1.8272 0 0:00:25.402082
1260 1 9 0.4605 0 0:00:25.396611
1280 3 7 0.7289 0 0:00:25.400540
1300 4 3 0.2405 0 0:00:25.387523
1320 7 7 0.6389 1 0:00:25.410024
1340 1 1 1.7375 1 0:00:25.414987
1360 7 7 0.6441 1 0:00:25.414157
1380 4 5 1.2210 0 0:00:25.417195
1400 5 5 0.2626 1 0:00:25.383873
1420 4 7 0.3532 0 0:00:25.387228
1440 0 0 0.8200 1 0:00:25.383218
1460 6 6 0.5100 1 0:00:25.391108
1480 1 -1 0.0000 0 0:00:25.397134
1500 1 1 0.3622 1 0:00:25.399611
1520 7 7 0.2884 1 0:00:25.403064
1540 8 8 1.9800 1 0:00:25.396844
1560 7 7 3.2514 1 0:00:25.406042
1580 6 1 0.5249 0 0:00:25.396533
1600 8 9 0.3981 0 0:00:25.402593
1620 5 -1 0.0000 0 0:00:25.407220
1640 7 3 0.5812 0 0:00:25.402734
1660 3 -1 0.0000 0 0:00:25.403882
1680 6 6 3.0108 1 0:00:25.388898
1700 5 2 1.0877 0 0:00:25.386725
1720 4 2 0.6984 0 0:00:25.393596
1740 1 1 0.2581 1 0:00:25.398176
1760 0 8 0.3471 0 0:00:25.399244
1780 7 -1 0.0000 0 0:00:25.392434
1800 4 8 1.0848 0 0:00:25.407254
1820 8 -1 0.0000 0 0:00:25.414378
1840 8 -1 0.0000 0 0:00:25.407188
1860 8 8 1.8677 1 0:00:25.405164
1880 1 1 1.5339 1 0:00:25.411318
1900 8 8 2.3607 1 0:00:25.428315
1920 2 2 0.5085 1 0:00:25.421726
1940 5 -1 0.0000 0 0:00:25.418057
1960 2 5 1.7816 0 0:00:25.412396
1980 9 9 1.6491 1 0:00:25.388422
2000 1 6 0.4901 0 0:00:25.452640
2020 9 9 2.9203 1 0:00:25.406378
2040 0 8 0.6535 0 0:00:25.436845
2060 5 5 1.5006 1 0:00:25.450676
2080 1 1 0.6045 1 0:00:25.467824
2100 2 4 0.8699 0 0:00:25.482330
2120 4 8 1.6098 0 0:00:25.479723
2140 9 9 0.8252 1 0:00:25.487391
2160 0 8 1.7581 0 0:00:25.478344
2180 4 4 0.5134 1 0:00:25.467926
2200 0 0 1.4421 1 0:00:25.463375
2220 1 1 1.5424 1 0:00:25.462895
2240 9 9 2.3219 1 0:00:25.472450
2260 4 4 0.3593 1 0:00:25.478653
2280 4 8 0.2538 0 0:00:25.484715
2300 3 -1 0.0000 0 0:00:25.508416
2320 5 2 0.3510 0 0:00:25.509474
2340 7 7 1.5322 1 0:00:25.511876
2360 7 7 0.8953 1 0:00:25.511002
2380 8 8 0.5852 1 0:00:25.503526
2400 0 0 0.5419 1 0:00:25.493725
2420 8 -1 0.0000 0 0:00:25.496072
2440 7 -1 0.0000 0 0:00:25.489232
2460 9 9 0.3710 1 0:00:25.489905
2480 8 8 1.0974 1 0:00:25.505930
2500 4 -1 0.0000 0 0:00:25.497155
2520 1 1 0.4467 1 0:00:25.507908
2540 2 3 0.5016 0 0:00:25.505085
2560 7 -1 0.0000 0 0:00:25.506864
2580 6 6 0.6252 1 0:00:25.510926
2600 8 8 2.4823 1 0:00:25.517447
2620 1 -1 0.0000 0 0:00:25.505684
2640 7 7 2.4399 1 0:00:25.510693
2660 3 -1 0.0000 0 0:00:25.515295
2680 0 0 2.9433 1 0:00:25.527073
2700 9 9 0.7281 1 0:00:25.525367
2720 3 -1 0.0000 0 0:00:25.519392
2740 1 1 0.8071 1 0:00:25.525897
2760 2 -1 0.0000 0 0:00:25.519818
2780 7 7 2.3306 1 0:00:25.522308
2800 4 6 0.4144 0 0:00:25.515613
2820 6 6 2.8130 1 0:00:25.515613
2840 3 3 3.7391 1 0:00:25.516475
2860 5 7 0.2554 0 0:00:25.516950
2880 4 4 2.1941 1 0:00:25.524811
2900 3 5 0.8024 0 0:00:25.528092
2920 2 -1 0.0000 0 0:00:25.527160
2940 3 0 1.6245 0 0:00:25.523432
2960 9 9 0.5909 1 0:00:25.518851
2980 8 1 0.9583 0 0:00:25.525587
3000 5 5 3.4745 1 0:00:25.509960
3020 1 1 1.7053 1 0:00:25.512763
3040 7 7 3.7391 1 0:00:25.511932
3060 7 7 2.0879 1 0:00:25.511364
3080 1 -1 0.0000 0 0:00:25.512143
3100 0 0 2.4680 1 0:00:25.517861
3120 4 6 1.4857 0 0:00:25.515227
3140 8 8 1.2396 1 0:00:25.510041
3160 6 4 0.8241 0 0:00:25.513322
3180 3 -1 0.0000 0 0:00:25.523855
3200 5 7 0.3673 0 0:00:25.518616
3220 3 -1 0.0000 0 0:00:25.509695
3240 4 -1 0.0000 0 0:00:25.512016
3260 7 7 0.6836 1 0:00:25.518918
3280 3 5 0.9980 0 0:00:25.529848
3300 4 4 0.2611 1 0:00:25.535883
3320 2 7 0.8819 0 0:00:25.528623
3340 6 6 0.6381 1 0:00:25.531976
3360 4 6 1.0507 0 0:00:25.530943
3380 8 8 0.4240 1 0:00:25.531693
3400 6 4 0.6919 0 0:00:25.533868
3420 5 6 0.1275 0 0:00:25.534058
3440 2 9 0.2627 0 0:00:25.524092
3460 1 1 1.4935 1 0:00:25.529141
3480 2 2 3.7391 1 0:00:25.526802
3500 1 1 1.1528 1 0:00:25.525383
3520 1 1 2.3778 1 0:00:25.529757
3540 6 6 0.5767 1 0:00:25.528961
3560 1 9 0.8177 0 0:00:25.529067
3580 4 1 0.4370 0 0:00:25.538137
3600 4 2 0.8709 0 0:00:25.537653
3620 0 -1 0.0000 0 0:00:25.522040
3640 6 2 1.2176 0 0:00:25.518310
3660 0 8 0.5365 0 0:00:25.524504
3680 0 -1 0.0000 0 0:00:25.526967
3700 3 5 1.3686 0 0:00:25.523553
3720 2 2 1.3717 1 0:00:25.519580
3740 0 0 1.6994 1 0:00:25.526207
3760 7 7 3.6189 1 0:00:25.531271
3780 4 -1 0.0000 0 0:00:25.514706
3800 9 9 0.4312 1 0:00:25.527896
3820 0 0 0.7994 1 0:00:25.544113
3840 6 3 0.8375 0 0:00:25.534446
3860 7 7 2.4074 1 0:00:25.540410
3880 6 4 0.4218 0 0:00:25.531108
3900 3 -1 0.0000 0 0:00:25.522098
3920 7 9 0.6166 0 0:00:25.541413
3940 6 6 0.1535 1 0:00:25.534859
3960 2 5 0.1110 0 0:00:25.538182
3980 9 7 0.1294 0 0:00:25.534870
4000 8 -1 0.0000 0 0:00:25.322510
4020 8 8 1.0229 1 0:00:25.339922
4040 0 0 2.7098 1 0:00:25.364431
4060 6 6 1.2169 1 0:00:25.395864
4080 1 1 0.6805 1 0:00:25.439759
4100 7 7 3.3667 1 0:00:25.404370
4120 4 0 1.7573 0 0:00:25.390649
4140 5 3 1.8923 0 0:00:25.385658
4160 5 -1 0.0000 0 0:00:25.370554
4180 0 0 0.8225 1 0:00:25.377389
4200 4 2 0.3760 0 0:00:25.390528
4220 4 0 2.9264 0 0:00:25.404569
4240 7 -1 0.0000 0 0:00:25.414623
4260 8 8 0.4888 1 0:00:25.445578
4280 8 -1 0.0000 0 0:00:25.422658
4300 8 8 2.2104 1 0:00:25.407207
4320 1 8 0.4991 0 0:00:25.373947
4340 0 0 0.7665 1 0:00:25.373905
4360 6 9 0.2365 0 0:00:25.394010
4380 9 9 0.5785 1 0:00:25.399260
4400 3 -1 0.0000 0 0:00:25.419962
4420 5 -1 0.0000 0 0:00:25.425730
4440 2 6 0.6457 0 0:00:25.432242
4460 9 -1 0.0000 0 0:00:25.427648
4480 9 9 0.2800 1 0:00:25.418186
4500 3 -1 0.0000 0 0:00:25.385190
4520 3 6 1.3517 0 0:00:25.381728
4540 9 9 3.3766 1 0:00:25.376825
4560 1 1 1.5278 1 0:00:25.407641
4580 6 -1 0.0000 0 0:00:25.412533
4600 4 7 1.7347 0 0:00:25.436025
4620 7 3 1.7412 0 0:00:25.421794
4640 2 -1 0.0000 0 0:00:25.411814
4660 7 -1 0.0000 0 0:00:25.407453
4680 9 1 0.0821 0 0:00:25.402900
4700 6 -1 0.0000 0 0:00:25.395956
4720 8 -1 0.0000 0 0:00:25.418906
4740 5 -1 0.0000 0 0:00:25.418749
4760 3 3 0.3446 1 0:00:25.436906
4780 0 0 0.7820 1 0:00:25.454417
4800 9 9 3.1487 1 0:00:25.441729
4820 3 -1 0.0000 0 0:00:25.421927
4840 0 0 2.7285 1 0:00:25.422300
4860 5 5 1.7802 1 0:00:25.412364
4880 0 2 0.5967 0 0:00:25.435514
4900 3 -1 0.0000 0 0:00:25.441566
4920 7 7 0.8423 1 0:00:25.454417
4940 6 6 0.2170 1 0:00:25.454588
4960 4 6 0.2169 0 0:00:25.449545
4980 1 9 2.1317 0 0:00:25.454429
5000 7 7 3.2990 1 0:00:25.417229
5020 8 8 0.5628 1 0:00:25.429052
5040 3 3 0.8061 1 0:00:25.420690
5060 6 6 0.4561 1 0:00:25.422619
5080 7 7 2.8387 1 0:00:25.441033
5100 3 3 1.1903 1 0:00:25.435442
5120 9 9 0.8187 1 0:00:25.446062
5140 8 8 1.0268 1 0:00:25.429483
5160 0 0 0.6318 1 0:00:25.428502
5180 9 -1 0.0000 0 0:00:25.411139
5200 3 3 3.2334 1 0:00:25.418266
5220 0 0 1.8653 1 0:00:25.428977
5240 1 -1 0.0000 0 0:00:25.443573
5260 0 0 3.2005 1 0:00:25.451869
5280 0 8 1.1276 0 0:00:25.450117
5300 9 9 0.7673 1 0:00:25.438635
5320 7 7 2.0227 1 0:00:25.414757
5340 3 4 0.5552 0 0:00:25.418572
5360 9 9 1.9190 1 0:00:25.416864
5380 1 9 1.9389 0 0:00:25.411008
5400 9 9 0.4504 1 0:00:25.420820
5420 6 6 1.3967 1 0:00:25.430079
5440 9 9 2.7424 1 0:00:25.435209
5460 0 0 2.1009 1 0:00:25.438478
5480 1 1 0.7349 1 0:00:25.439752
5500 8 1 0.3609 0 0:00:25.428692
5520 4 -1 0.0000 0 0:00:25.405882
5540 5 -1 0.0000 0 0:00:25.404202
5560 3 5 0.2268 0 0:00:25.410735
5580 5 6 0.7493 0 0:00:25.420245
5600 6 -1 0.0000 0 0:00:25.434089
5620 3 2 1.0001 0 0:00:25.431207
5640 2 2 0.4964 1 0:00:25.404148
5660 9 9 1.2474 1 0:00:25.413649
5680 2 -1 0.0000 0 0:00:25.415026
5700 3 -1 0.0000 0 0:00:25.413954
5720 9 9 2.7892 1 0:00:25.420115
5740 6 6 0.4411 1 0:00:25.421660
5760 2 2 0.5539 1 0:00:25.434407
5780 7 7 2.1378 1 0:00:25.434445
5800 2 4 0.0083 0 0:00:25.420589
5820 5 6 0.2795 0 0:00:25.437832
5840 2 -1 0.0000 0 0:00:25.418304
5860 0 -1 0.0000 0 0:00:25.413296
5880 0 0 0.8347 1 0:00:25.424296
5900 4 -1 0.0000 0 0:00:25.426293
5920 8 8 3.4902 1 0:00:25.435288
5940 7 4 0.7493 0 0:00:25.447931
5960 2 -1 0.0000 0 0:00:25.441213
5980 9 9 2.1383 1 0:00:25.430087
6000 8 9 0.0411 0 0:00:14.860301
6020 6 6 0.3159 1 0:00:14.821195
6040 2 7 0.0202 0 0:00:14.816311
6060 3 4 0.1383 0 0:00:14.817954
6080 1 1 0.2976 1 0:00:14.795401
6100 1 1 1.2510 1 0:00:14.794775
6120 5 5 2.3089 1 0:00:14.801056
6140 9 9 2.1734 1 0:00:14.793349
6160 2 5 1.3119 0 0:00:14.797621
6180 0 9 0.0042 0 0:00:14.802616
6200 3 -1 0.0000 0 0:00:14.802702
6220 2 6 0.7753 0 0:00:14.808387
6240 2 -1 0.0000 0 0:00:14.814164
6260 2 9 0.2599 0 0:00:14.807114
6280 8 5 0.4906 0 0:00:14.802511
6300 1 -1 0.0000 0 0:00:14.805148
6320 0 0 2.5818 1 0:00:14.807707
6340 3 3 0.5600 1 0:00:14.807278
6360 2 2 0.5841 1 0:00:14.804243
6380 3 6 0.2410 0 0:00:14.808152
6400 0 1 0.9366 0 0:00:14.806608
6420 7 7 0.7898 1 0:00:14.808240
6440 3 -1 0.0000 0 0:00:14.806013
6460 3 -1 0.0000 0 0:00:14.805212
6480 0 0 0.5848 1 0:00:14.806005
6500 7 0 0.2935 0 0:00:14.805233
6520 6 4 0.5837 0 0:00:14.803379
6540 8 8 0.9092 1 0:00:14.804520
6560 6 6 1.1717 1 0:00:14.807118
6580 1 -1 0.0000 0 0:00:14.807878
6600 7 7 3.3976 1 0:00:14.804799
6620 7 7 1.3057 1 0:00:14.805915
6640 5 3 1.5091 0 0:00:14.807687
6660 0 0 1.3905 1 0:00:14.808910
6680 3 3 1.7632 1 0:00:14.804502
6700 6 6 0.7613 1 0:00:14.804168
6720 2 2 1.6869 1 0:00:14.802158
6740 2 6 0.2910 0 0:00:14.802675
6760 5 5 1.2535 1 0:00:14.804569
6780 7 7 2.9264 1 0:00:14.803800
6800 6 6 0.7933 1 0:00:14.805343
6820 1 1 2.4206 1 0:00:14.803974
6840 9 9 1.0092 1 0:00:14.805762
6860 0 0 1.0564 1 0:00:14.805511
6880 2 -1 0.0000 0 0:00:14.805692
6900 3 -1 0.0000 0 0:00:14.805253
6920 5 2 1.8598 0 0:00:14.804023
6940 1 1 3.3223 1 0:00:14.802890
6960 9 8 1.1600 0 0:00:14.804398
6980 0 9 1.3207 0 0:00:14.805171
7000 2 -1 0.0000 0 0:00:14.806458
7020 7 7 0.7599 1 0:00:14.804490
7040 7 8 0.6326 0 0:00:14.812354
7060 8 8 0.5163 1 0:00:14.808834
7080 5 4 0.6671 0 0:00:14.804544
7100 9 3 0.9934 0 0:00:14.805802
7120 7 5 0.1196 0 0:00:14.805370
7140 4 4 0.9076 1 0:00:14.806064
7160 5 5 0.2054 1 0:00:14.806145
7180 6 6 2.6532 1 0:00:14.808418
7200 4 6 0.1723 0 0:00:14.817141
7220 9 9 1.0661 1 0:00:14.816880
7240 0 8 0.9272 0 0:00:14.808798
7260 1 9 0.0506 0 0:00:14.808498
7280 1 1 0.2875 1 0:00:14.804443
7300 3 7 0.3513 0 0:00:14.799837
7320 8 8 0.3948 1 0:00:14.799861
7340 2 4 0.8564 0 0:00:14.800566
7360 2 4 0.2292 0 0:00:14.804331
7380 7 7 0.5944 1 0:00:14.801480
7400 3 3 0.5892 1 0:00:14.801535
7420 3 0 0.9100 0 0:00:14.796295
7440 3 -1 0.0000 0 0:00:14.806538
7460 5 5 3.5669 1 0:00:14.797852
7480 1 8 0.0169 0 0:00:14.801415
7500 6 6 2.4647 1 0:00:14.797469
7520 4 4 0.0336 1 0:00:14.796926
7540 5 5 3.6189 1 0:00:14.803503
7560 0 -1 0.0000 0 0:00:14.797222
7580 8 8 1.4545 1 0:00:14.802129
7600 8 9 0.8209 0 0:00:14.793374
7620 5 3 0.9170 0 0:00:14.800947
7640 9 9 0.8361 1 0:00:14.797469
7660 7 -1 0.0000 0 0:00:14.803110
7680 3 9 0.5405 0 0:00:14.797542
7700 6 6 2.5570 1 0:00:14.794263
7720 5 5 0.8269 1 0:00:14.802490
7740 4 -1 0.0000 0 0:00:14.792564
7760 2 -1 0.0000 0 0:00:14.801007
7780 3 -1 0.0000 0 0:00:14.797375
7800 0 0 1.6144 1 0:00:14.792345
7820 5 8 0.0274 0 0:00:14.801822
7840 1 1 2.4759 1 0:00:14.795069
7860 8 -1 0.0000 0 0:00:14.810373
7880 0 -1 0.0000 0 0:00:14.800530
7900 0 8 0.4580 0 0:00:14.804100
7920 9 8 0.0602 0 0:00:14.797275
7940 2 6 1.3669 0 0:00:14.798099
7960 0 0 0.6289 1 0:00:14.803655
7980 3 -1 0.0000 0 0:00:14.798332
8000 9 9 1.3456 1 0:00:14.808641
8020 6 6 1.4179 1 0:00:14.762631
8040 2 -1 0.0000 0 0:00:14.764618
8060 6 6 0.8492 1 0:00:14.766267
8080 4 6 0.1994 0 0:00:14.771369
8100 6 2 1.4184 0 0:00:14.773125
8120 8 9 0.7402 0 0:00:14.767400
8140 5 4 0.6654 0 0:00:14.771248
8160 6 6 0.1289 1 0:00:14.766337
8180 4 6 0.0723 0 0:00:14.766176
8200 3 -1 0.0000 0 0:00:14.767020
8220 6 6 0.2194 1 0:00:14.769452
8240 7 7 2.7581 1 0:00:14.770330
8260 1 1 1.4424 1 0:00:14.768891
8280 4 -1 0.0000 0 0:00:14.768127
8300 5 2 0.4434 0 0:00:14.768228
8320 7 -1 0.0000 0 0:00:14.769616
8340 5 3 0.3882 0 0:00:14.770301
8360 7 7 0.7916 1 0:00:14.770029
8380 9 9 0.0609 1 0:00:14.771724
8400 0 -1 0.0000 0 0:00:14.768845
8420 3 -1 0.0000 0 0:00:14.769353
8440 5 3 0.0550 0 0:00:14.768311
8460 8 8 2.1838 1 0:00:14.769207
8480 2 -1 0.0000 0 0:00:14.771361
8500 4 4 0.3474 1 0:00:14.777578
8520 8 -1 0.0000 0 0:00:14.771773
8540 4 -1 0.0000 0 0:00:14.770867
8560 7 7 1.8094 1 0:00:14.771112
8580 3 -1 0.0000 0 0:00:14.773410
8600 3 -1 0.0000 0 0:00:14.770651
8620 3 -1 0.0000 0 0:00:14.770820
8640 1 1 2.8482 1 0:00:14.770492
8660 7 5 0.7692 0 0:00:14.771916
8680 3 -1 0.0000 0 0:00:14.770022
8700 3 3 0.8688 1 0:00:14.771732
8720 2 0 2.8294 0 0:00:14.770396
8740 2 4 0.1171 0 0:00:14.767165
8760 8 8 1.4137 1 0:00:14.771594
8780 4 4 0.5215 1 0:00:14.767192
8800 0 0 2.8340 1 0:00:14.766481
8820 2 2 1.9829 1 0:00:14.770411
8840 2 1 0.3840 0 0:00:14.768804
8860 2 2 0.0423 1 0:00:14.768103
8880 1 1 1.0232 1 0:00:14.768848
8900 2 6 0.0545 0 0:00:14.776877
8920 6 6 2.4358 1 0:00:14.773537
8940 6 3 0.4247 0 0:00:14.766408
8960 0 0 2.2634 1 0:00:14.768060
8980 9 9 2.3334 1 0:00:14.768393
9000 8 8 3.6510 1 0:00:14.768613
9020 7 9 0.5179 0 0:00:14.767226
9040 2 5 2.1129 0 0:00:14.769428
9060 9 5 0.9163 0 0:00:14.767474
9080 3 0 0.4147 0 0:00:14.767190
9100 9 -1 0.0000 0 0:00:14.770089
9120 3 0 0.1164 0 0:00:14.767346
9140 7 -1 0.0000 0 0:00:14.768409
9160 5 5 1.2732 1 0:00:14.768383
9180 5 5 3.7391 1 0:00:14.770621
9200 8 8 2.9976 1 0:00:14.768734
9220 8 8 2.6166 1 0:00:14.767564
9240 8 8 0.6918 1 0:00:14.767869
9260 5 5 1.4437 1 0:00:14.766620
9280 9 1 0.1945 0 0:00:14.771050
9300 5 5 0.5509 1 0:00:14.772306
9320 9 9 1.6758 1 0:00:14.774100
9340 1 1 1.6894 1 0:00:14.769770
9360 5 6 0.3139 0 0:00:14.768651
9380 5 3 0.2157 0 0:00:14.770392
9400 6 6 0.1243 1 0:00:14.767935
9420 5 5 0.5948 1 0:00:14.769992
9440 8 8 3.1361 1 0:00:14.771326
9460 3 -1 0.0000 0 0:00:14.768654
9480 2 4 0.7693 0 0:00:14.769531
9500 9 -1 0.0000 0 0:00:14.769530
9520 1 9 0.0183 0 0:00:14.771458
9540 5 5 1.0340 1 0:00:14.770972
9560 9 7 2.1790 0 0:00:14.768457
9580 1 -1 0.0000 0 0:00:14.768504
9600 8 8 1.4737 1 0:00:14.769933
9620 4 7 0.3255 0 0:00:14.769733
9640 5 -1 0.0000 0 0:00:14.770691
9660 6 6 1.7761 1 0:00:14.770072
9680 8 8 1.2456 1 0:00:14.771687
9700 0 0 1.6793 1 0:00:14.770121
9720 8 -1 0.0000 0 0:00:14.778748
9740 3 6 0.6102 0 0:00:14.767655
9760 9 9 0.2037 1 0:00:14.771339
9780 4 6 1.9076 0 0:00:14.766959
9800 1 1 2.6284 1 0:00:14.771176
9820 0 -1 0.0000 0 0:00:14.768250
9840 4 5 0.4644 0 0:00:14.768322
9860 0 -1 0.0000 0 0:00:14.770669
9880 7 7 0.2576 1 0:00:14.771631
9900 8 0 0.9371 0 0:00:14.770635
9920 6 6 1.4197 1 0:00:14.768392
9940 4 7 0.2325 0 0:00:14.771291
9960 2 0 2.4748 0 0:00:14.770124
9980 0 0 2.6469 1 0:00:14.768413
| {
"pile_set_name": "Github"
} |
---
typeface: IBM Plex Sans Condensed
font_file: "'/assets/fonts/ibm-plex-sans-condensed/IBMPlexSansCondensed-Regular.woff'"
---
| {
"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.
*/
body {
margin: 0px;
padding: 0px;
}
table {
padding:0px;
width: 100%;
margin-left: -2px;
margin-right: -2px;
}
acronym {
cursor: help;
border-bottom: 1px dotted #feb;
}
table.bodyTable th, table.bodyTable td {
padding: 2px 4px 2px 4px;
vertical-align: top;
}
div.clear{
clear:both;
visibility: hidden;
}
div.clear hr{
display: none;
}
#bannerLeft, #bannerRight {
font-size: xx-large;
font-weight: bold;
}
#bannerLeft img, #bannerRight img {
margin: 0px;
}
.xleft, #bannerLeft img {
float:left;
}
.xright, #bannerRight {
float:right;
}
#banner {
padding: 0px;
}
#breadcrumbs {
padding: 3px 10px 3px 10px;
}
#leftColumn {
width: 170px;
float:left;
overflow: auto;
}
#bodyColumn {
margin-right: 1.5em;
margin-left: 197px;
}
#legend {
padding: 8px 0 8px 0;
}
#navcolumn {
padding: 8px 4px 0 8px;
}
#navcolumn h5 {
margin: 0;
padding: 0;
font-size: small;
}
#navcolumn ul {
margin: 0;
padding: 0;
font-size: small;
}
#navcolumn li {
list-style-type: none;
background-image: none;
background-repeat: no-repeat;
background-position: 0 0.4em;
padding-left: 16px;
list-style-position: outside;
line-height: 1.2em;
font-size: smaller;
}
#navcolumn li.expanded {
background-image: url(../images/expanded.gif);
}
#navcolumn li.collapsed {
background-image: url(../images/collapsed.gif);
}
#navcolumn li.none {
text-indent: -1em;
margin-left: 1em;
}
#poweredBy {
text-align: center;
}
#navcolumn img {
margin-top: 10px;
margin-bottom: 3px;
}
#poweredBy img {
display:block;
margin: 20px 0 20px 17px;
}
#search img {
margin: 0px;
display: block;
}
#search #q, #search #btnG {
border: 1px solid #999;
margin-bottom:10px;
}
#search form {
margin: 0px;
}
#lastPublished {
font-size: x-small;
}
.navSection {
margin-bottom: 2px;
padding: 8px;
}
.navSectionHead {
font-weight: bold;
font-size: x-small;
}
.section {
padding: 4px;
}
#footer {
padding: 3px 10px 3px 10px;
font-size: x-small;
}
#breadcrumbs {
font-size: x-small;
margin: 0pt;
}
.source {
padding: 12px;
margin: 1em 7px 1em 7px;
}
.source pre {
margin: 0px;
padding: 0px;
}
#navcolumn img.imageLink, .imageLink {
padding-left: 0px;
padding-bottom: 0px;
padding-top: 0px;
padding-right: 2px;
border: 0px;
margin: 0px;
}
| {
"pile_set_name": "Github"
} |
require('../../modules/es6.reflect.define-property');
module.exports = require('../../modules/$.core').Reflect.defineProperty; | {
"pile_set_name": "Github"
} |
set (libname "adis16448")
set (libdescription "Industrial Grade Ten Degrees of Freedom Inertial Sensor")
set (module_src ${libname}.cxx)
set (module_hpp ${libname}.hpp)
upm_module_init(mraa)
| {
"pile_set_name": "Github"
} |
//
// Generated by class-dump 3.5 (64 bit) (Debug version compiled Oct 25 2017 03:49:04).
//
// class-dump is Copyright (C) 1997-1998, 2000-2001, 2004-2015 by Steve Nygard.
//
#import "TLayer.h"
@class NSColor;
@interface TCircularProgressLayer : TLayer
{
double _endAngle;
double _animationDuration;
struct TNSRef<NSColor, void> _fillColor;
_Bool _progressAnimationCompleted;
function_b1fce659 _progressDidCompleteHandler;
}
+ (BOOL)needsDisplayForKey:(id)arg1;
- (id).cxx_construct;
- (void).cxx_destruct;
@property(nonatomic) double animationDuration; // @synthesize animationDuration=_animationDuration;
@property double endAngle; // @synthesize endAngle=_endAngle;
- (void)callProgressAnimationDidCompleteHandlerIfNeeded;
@property(readonly, nonatomic) _Bool isProgressAnimationCompleted; // @dynamic isProgressAnimationCompleted;
- (void)setProgressDidCompleteHandler:(const function_b1fce659 *)arg1;
- (void)drawInContext:(struct CGContext *)arg1;
@property(retain, nonatomic) NSColor *fillColor; // @dynamic fillColor;
@property(nonatomic) double fractionComplete; // @dynamic fractionComplete;
- (void)setEndAngleAnimated:(double)arg1;
- (id)actionForKey:(id)arg1;
- (id)initWithLayer:(id)arg1;
- (id)init;
@end
| {
"pile_set_name": "Github"
} |
/* strrchr with SSE4.2
Copyright (C) 2009 Free Software Foundation, Inc.
This file is part of the GNU C Library.
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, write to the Free
Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
02111-1307 USA. */
#include <sysdep.h>
#include <init-arch.h>
/* Define multiple versions only for the definition in libc and for
the DSO. In static binaries we need strrchr before the initialization
happened. */
#if defined SHARED && !defined NOT_IN_libc
.text
ENTRY(strrchr)
.type strrchr, @gnu_indirect_function
cmpl $0, __cpu_features+KIND_OFFSET(%rip)
jne 1f
call __init_cpu_features
1: leaq __strrchr_sse2(%rip), %rax
testl $bit_SSE4_2, __cpu_features+CPUID_OFFSET+index_SSE4_2(%rip)
jz 2f
leaq __strrchr_sse42(%rip), %rax
2: ret
END(strrchr)
/*
This implementation uses SSE4 instructions to compare up to 16 bytes
at a time looking for the last occurrence of the character c in the
string s:
char *strrchr (const char *s, int c);
We use 0x4a:
_SIDD_SBYTE_OPS
| _SIDD_CMP_EQUAL_EACH
| _SIDD_MOST_SIGNIFICANT
on pcmpistri to compare xmm/mem128
0 1 2 3 4 5 6 7 8 9 A B C D E F
X X X X X X X X X X X X X X X X
against xmm
0 1 2 3 4 5 6 7 8 9 A B C D E F
C C C C C C C C C C C C C C C C
to find out if the first 16byte data element has a byte C and the
last offset. There are 4 cases:
1. The first 16byte data element has EOS and has the byte C at the
last offset X.
2. The first 16byte data element is valid and has the byte C at the
last offset X.
3. The first 16byte data element has EOS and doesn't have the byte C.
4. The first 16byte data element is valid and doesn't have the byte C.
Here is the table of ECX, CFlag, ZFlag and SFlag for 3 cases:
case ECX CFlag ZFlag SFlag
1 X 1 1 0
2 X 1 0 0
3 16 0 1 0
4 16 0 0 0
We exit from the loop for cases 1 and 3 with jz which branches
when ZFlag is 1. If CFlag == 1, ECX has the offset X for case 1. */
.section .text.sse4.2,"ax",@progbits
.align 16
.type __strrchr_sse42, @function
__strrchr_sse42:
cfi_startproc
CALL_MCOUNT
testb %sil, %sil
je __strend_sse4
xor %eax,%eax /* RAX has the last occurrence of s. */
movd %esi, %xmm1
punpcklbw %xmm1, %xmm1
movl %edi, %esi
punpcklbw %xmm1, %xmm1
andl $15, %esi
pshufd $0, %xmm1, %xmm1
movq %rdi, %r8
je L(loop)
/* Handle unaligned string using psrldq. */
leaq L(psrldq_table)(%rip), %rdx
andq $-16, %r8
movslq (%rdx,%rsi,4),%r9
movdqa (%r8), %xmm0
addq %rdx, %r9
jmp *%r9
/* Handle unaligned string with offset 1 using psrldq. */
.p2align 4
L(psrldq_1):
psrldq $1, %xmm0
.p2align 4
L(unaligned_pcmpistri):
pcmpistri $0x4a, %xmm1, %xmm0
jnc L(unaligned_no_byte)
leaq (%rdi,%rcx), %rax
L(unaligned_no_byte):
/* Find the length of the unaligned string. */
pcmpistri $0x3a, %xmm0, %xmm0
movl $16, %edx
subl %esi, %edx
cmpl %ecx, %edx
/* Return RAX if the unaligned fragment to next 16B already
contain the NULL terminator. */
jg L(exit)
addq $16, %r8
/* Loop start on aligned string. */
.p2align 4
L(loop):
pcmpistri $0x4a, (%r8), %xmm1
jbe L(match_or_eos)
addq $16, %r8
jmp L(loop)
.p2align 4
L(match_or_eos):
je L(had_eos)
L(match_no_eos):
leaq (%r8,%rcx), %rax
addq $16, %r8
jmp L(loop)
.p2align 4
L(had_eos):
jnc L(exit)
leaq (%r8,%rcx), %rax
.p2align 4
L(exit):
ret
/* Handle unaligned string with offset 15 using psrldq. */
.p2align 4
L(psrldq_15):
psrldq $15, %xmm0
jmp L(unaligned_pcmpistri)
/* Handle unaligned string with offset 14 using psrldq. */
.p2align 4
L(psrldq_14):
psrldq $14, %xmm0
jmp L(unaligned_pcmpistri)
/* Handle unaligned string with offset 13 using psrldq. */
.p2align 4
L(psrldq_13):
psrldq $13, %xmm0
jmp L(unaligned_pcmpistri)
/* Handle unaligned string with offset 12 using psrldq. */
.p2align 4
L(psrldq_12):
psrldq $12, %xmm0
jmp L(unaligned_pcmpistri)
/* Handle unaligned string with offset 11 using psrldq. */
.p2align 4
L(psrldq_11):
psrldq $11, %xmm0
jmp L(unaligned_pcmpistri)
/* Handle unaligned string with offset 10 using psrldq. */
.p2align 4
L(psrldq_10):
psrldq $10, %xmm0
jmp L(unaligned_pcmpistri)
/* Handle unaligned string with offset 9 using psrldq. */
.p2align 4
L(psrldq_9):
psrldq $9, %xmm0
jmp L(unaligned_pcmpistri)
/* Handle unaligned string with offset 8 using psrldq. */
.p2align 4
L(psrldq_8):
psrldq $8, %xmm0
jmp L(unaligned_pcmpistri)
/* Handle unaligned string with offset 7 using psrldq. */
.p2align 4
L(psrldq_7):
psrldq $7, %xmm0
jmp L(unaligned_pcmpistri)
/* Handle unaligned string with offset 6 using psrldq. */
.p2align 4
L(psrldq_6):
psrldq $6, %xmm0
jmp L(unaligned_pcmpistri)
/* Handle unaligned string with offset 5 using psrldq. */
.p2align 4
L(psrldq_5):
psrldq $5, %xmm0
jmp L(unaligned_pcmpistri)
/* Handle unaligned string with offset 4 using psrldq. */
.p2align 4
L(psrldq_4):
psrldq $4, %xmm0
jmp L(unaligned_pcmpistri)
/* Handle unaligned string with offset 3 using psrldq. */
.p2align 4
L(psrldq_3):
psrldq $3, %xmm0
jmp L(unaligned_pcmpistri)
/* Handle unaligned string with offset 2 using psrldq. */
.p2align 4
L(psrldq_2):
psrldq $2, %xmm0
jmp L(unaligned_pcmpistri)
cfi_endproc
.size __strrchr_sse42, .-__strrchr_sse42
.section .rodata.sse4.2,"a",@progbits
.p2align 4
L(psrldq_table):
.int L(loop) - L(psrldq_table)
.int L(psrldq_1) - L(psrldq_table)
.int L(psrldq_2) - L(psrldq_table)
.int L(psrldq_3) - L(psrldq_table)
.int L(psrldq_4) - L(psrldq_table)
.int L(psrldq_5) - L(psrldq_table)
.int L(psrldq_6) - L(psrldq_table)
.int L(psrldq_7) - L(psrldq_table)
.int L(psrldq_8) - L(psrldq_table)
.int L(psrldq_9) - L(psrldq_table)
.int L(psrldq_10) - L(psrldq_table)
.int L(psrldq_11) - L(psrldq_table)
.int L(psrldq_12) - L(psrldq_table)
.int L(psrldq_13) - L(psrldq_table)
.int L(psrldq_14) - L(psrldq_table)
.int L(psrldq_15) - L(psrldq_table)
# undef ENTRY
# define ENTRY(name) \
.type __strrchr_sse2, @function; \
.align 16; \
__strrchr_sse2: cfi_startproc; \
CALL_MCOUNT
# undef END
# define END(name) \
cfi_endproc; .size __strrchr_sse2, .-__strrchr_sse2
# undef libc_hidden_builtin_def
/* It doesn't make sense to send libc-internal strrchr calls through a PLT.
The speedup we get from using SSE4.2 instruction is likely eaten away
by the indirect call in the PLT. */
# define libc_hidden_builtin_def(name) \
.globl __GI_strrchr; __GI_strrchr = __strrchr_sse2
#endif
#include "../strrchr.S"
| {
"pile_set_name": "Github"
} |
def _impl(ctx):
srcdir = ctx.file.conf.dirname
out = ctx.outputs.out
ctx.actions.run(
inputs = ctx.files.srcs,
outputs = [out],
executable = ctx.file.sphinx,
arguments = [srcdir, out.path],
use_default_shell_env = True,
mnemonic = "SphinxBuild",
)
return DefaultInfo(files = depset([out]))
sphinx = rule(
attrs = {
"srcs": attr.label_list(
mandatory = True,
allow_files = True,
),
"conf": attr.label(
mandatory = True,
allow_single_file = True,
),
"out": attr.output(mandatory = True),
"sphinx": attr.label(
default = Label("//bzl:sphinx"),
allow_single_file = True,
executable = True,
cfg = "host",
),
},
implementation = _impl,
)
| {
"pile_set_name": "Github"
} |
package zk
import (
"sync"
"testing"
"time"
)
type logWriter struct {
t *testing.T
p string
}
func (lw logWriter) Write(b []byte) (int, error) {
lw.t.Logf("%s%s", lw.p, string(b))
return len(b), nil
}
func TestBasicCluster(t *testing.T) {
ts, err := StartTestCluster(t, 3, nil, logWriter{t: t, p: "[ZKERR] "})
if err != nil {
t.Fatal(err)
}
defer ts.Stop()
zk1, _, err := ts.Connect(0)
if err != nil {
t.Fatalf("Connect returned error: %+v", err)
}
defer zk1.Close()
zk2, _, err := ts.Connect(1)
if err != nil {
t.Fatalf("Connect returned error: %+v", err)
}
defer zk2.Close()
time.Sleep(time.Second * 5)
if _, err := zk1.Create("/gozk-test", []byte("foo-cluster"), 0, WorldACL(PermAll)); err != nil {
t.Fatalf("Create failed on node 1: %+v", err)
}
if by, _, err := zk2.Get("/gozk-test"); err != nil {
t.Fatalf("Get failed on node 2: %+v", err)
} else if string(by) != "foo-cluster" {
t.Fatal("Wrong data for node 2")
}
}
// If the current leader dies, then the session is reestablished with the new one.
func TestClientClusterFailover(t *testing.T) {
tc, err := StartTestCluster(t, 3, nil, logWriter{t: t, p: "[ZKERR] "})
if err != nil {
t.Fatal(err)
}
defer tc.Stop()
zk, evCh, err := tc.ConnectAll()
if err != nil {
t.Fatalf("Connect returned error: %+v", err)
}
defer zk.Close()
sl := NewStateLogger(evCh)
hasSessionEvent1 := sl.NewWatcher(sessionStateMatcher(StateHasSession)).Wait(8 * time.Second)
if hasSessionEvent1 == nil {
t.Fatalf("Failed to connect and get session")
}
if _, err := zk.Create("/gozk-test", []byte("foo-cluster"), 0, WorldACL(PermAll)); err != nil {
t.Fatalf("Create failed on node 1: %+v", err)
}
hasSessionWatcher2 := sl.NewWatcher(sessionStateMatcher(StateHasSession))
// Kill the current leader
tc.StopServer(hasSessionEvent1.Server)
// Wait for the session to be reconnected with the new leader.
if hasSessionWatcher2.Wait(8*time.Second) == nil {
t.Fatalf("Failover failed")
}
if by, _, err := zk.Get("/gozk-test"); err != nil {
t.Fatalf("Get failed on node 2: %+v", err)
} else if string(by) != "foo-cluster" {
t.Fatal("Wrong data for node 2")
}
}
// If a ZooKeeper cluster looses quorum then a session is reconnected as soon
// as the quorum is restored.
func TestNoQuorum(t *testing.T) {
tc, err := StartTestCluster(t, 3, nil, logWriter{t: t, p: "[ZKERR] "})
if err != nil {
t.Fatal(err)
}
defer tc.Stop()
zk, evCh, err := tc.ConnectAllTimeout(4 * time.Second)
if err != nil {
t.Fatalf("Connect returned error: %+v", err)
}
defer zk.Close()
sl := NewStateLogger(evCh)
// Wait for initial session to be established
hasSessionEvent1 := sl.NewWatcher(sessionStateMatcher(StateHasSession)).Wait(8 * time.Second)
if hasSessionEvent1 == nil {
t.Fatalf("Failed to connect and get session")
}
initialSessionID := zk.sessionID
DefaultLogger.Printf(" Session established: id=%d, timeout=%d", zk.sessionID, zk.sessionTimeoutMs)
// Kill the ZooKeeper leader and wait for the session to reconnect.
DefaultLogger.Printf(" Kill the leader")
disconnectWatcher1 := sl.NewWatcher(sessionStateMatcher(StateDisconnected))
hasSessionWatcher2 := sl.NewWatcher(sessionStateMatcher(StateHasSession))
tc.StopServer(hasSessionEvent1.Server)
disconnectedEvent1 := disconnectWatcher1.Wait(8 * time.Second)
if disconnectedEvent1 == nil {
t.Fatalf("Failover failed, missed StateDisconnected event")
}
if disconnectedEvent1.Server != hasSessionEvent1.Server {
t.Fatalf("Unexpected StateDisconnected event, expected=%s, actual=%s",
hasSessionEvent1.Server, disconnectedEvent1.Server)
}
hasSessionEvent2 := hasSessionWatcher2.Wait(8 * time.Second)
if hasSessionEvent2 == nil {
t.Fatalf("Failover failed, missed StateHasSession event")
}
// Kill the ZooKeeper leader leaving the cluster without quorum.
DefaultLogger.Printf(" Kill the leader")
disconnectWatcher2 := sl.NewWatcher(sessionStateMatcher(StateDisconnected))
tc.StopServer(hasSessionEvent2.Server)
disconnectedEvent2 := disconnectWatcher2.Wait(8 * time.Second)
if disconnectedEvent2 == nil {
t.Fatalf("Failover failed, missed StateDisconnected event")
}
if disconnectedEvent2.Server != hasSessionEvent2.Server {
t.Fatalf("Unexpected StateDisconnected event, expected=%s, actual=%s",
hasSessionEvent2.Server, disconnectedEvent2.Server)
}
// Make sure that we keep retrying connecting to the only remaining
// ZooKeeper server, but the attempts are being dropped because there is
// no quorum.
DefaultLogger.Printf(" Retrying no luck...")
var firstDisconnect *Event
begin := time.Now()
for time.Since(begin) < 6*time.Second {
disconnectedEvent := sl.NewWatcher(sessionStateMatcher(StateDisconnected)).Wait(4 * time.Second)
if disconnectedEvent == nil {
t.Fatalf("Disconnected event expected")
}
if firstDisconnect == nil {
firstDisconnect = disconnectedEvent
continue
}
if disconnectedEvent.Server != firstDisconnect.Server {
t.Fatalf("Disconnect from wrong server: expected=%s, actual=%s",
firstDisconnect.Server, disconnectedEvent.Server)
}
}
// Start a ZooKeeper node to restore quorum.
hasSessionWatcher3 := sl.NewWatcher(sessionStateMatcher(StateHasSession))
tc.StartServer(hasSessionEvent1.Server)
// Make sure that session is reconnected with the same ID.
hasSessionEvent3 := hasSessionWatcher3.Wait(8 * time.Second)
if hasSessionEvent3 == nil {
t.Fatalf("Session has not been reconnected")
}
if zk.sessionID != initialSessionID {
t.Fatalf("Wrong session ID: expected=%d, actual=%d", initialSessionID, zk.sessionID)
}
// Make sure that the session is not dropped soon after reconnect
e := sl.NewWatcher(sessionStateMatcher(StateDisconnected)).Wait(6 * time.Second)
if e != nil {
t.Fatalf("Unexpected disconnect")
}
}
func TestWaitForClose(t *testing.T) {
ts, err := StartTestCluster(t, 1, nil, logWriter{t: t, p: "[ZKERR] "})
if err != nil {
t.Fatal(err)
}
defer ts.Stop()
zk, _, err := ts.Connect(0)
if err != nil {
t.Fatalf("Connect returned error: %+v", err)
}
timeout := time.After(30 * time.Second)
CONNECTED:
for {
select {
case ev := <-zk.eventChan:
if ev.State == StateConnected {
break CONNECTED
}
case <-timeout:
zk.Close()
t.Fatal("Timeout")
}
}
zk.Close()
for {
select {
case _, ok := <-zk.eventChan:
if !ok {
return
}
case <-timeout:
t.Fatal("Timeout")
}
}
}
func TestBadSession(t *testing.T) {
ts, err := StartTestCluster(t, 1, nil, logWriter{t: t, p: "[ZKERR] "})
if err != nil {
t.Fatal(err)
}
defer ts.Stop()
zk, _, err := ts.ConnectAll()
if err != nil {
t.Fatalf("Connect returned error: %+v", err)
}
defer zk.Close()
if err := zk.Delete("/gozk-test", -1); err != nil && err != ErrNoNode {
t.Fatalf("Delete returned error: %+v", err)
}
zk.conn.Close()
time.Sleep(time.Millisecond * 100)
if err := zk.Delete("/gozk-test", -1); err != nil && err != ErrNoNode {
t.Fatalf("Delete returned error: %+v", err)
}
}
type EventLogger struct {
events []Event
watchers []*EventWatcher
lock sync.Mutex
wg sync.WaitGroup
}
func NewStateLogger(eventCh <-chan Event) *EventLogger {
el := &EventLogger{}
el.wg.Add(1)
go func() {
defer el.wg.Done()
for event := range eventCh {
el.lock.Lock()
for _, sw := range el.watchers {
if !sw.triggered && sw.matcher(event) {
sw.triggered = true
sw.matchCh <- event
}
}
DefaultLogger.Printf(" event received: %v\n", event)
el.events = append(el.events, event)
el.lock.Unlock()
}
}()
return el
}
func (el *EventLogger) NewWatcher(matcher func(Event) bool) *EventWatcher {
ew := &EventWatcher{matcher: matcher, matchCh: make(chan Event, 1)}
el.lock.Lock()
el.watchers = append(el.watchers, ew)
el.lock.Unlock()
return ew
}
func (el *EventLogger) Events() []Event {
el.lock.Lock()
transitions := make([]Event, len(el.events))
copy(transitions, el.events)
el.lock.Unlock()
return transitions
}
func (el *EventLogger) Wait4Stop() {
el.wg.Wait()
}
type EventWatcher struct {
matcher func(Event) bool
matchCh chan Event
triggered bool
}
func (ew *EventWatcher) Wait(timeout time.Duration) *Event {
select {
case event := <-ew.matchCh:
return &event
case <-time.After(timeout):
return nil
}
}
func sessionStateMatcher(s State) func(Event) bool {
return func(e Event) bool {
return e.Type == EventSession && e.State == s
}
}
| {
"pile_set_name": "Github"
} |
<Project Sdk="Microsoft.NET.Sdk" ToolsVersion="15.0">
<!-- nupkg information -->
<PropertyGroup>
<Title>Google.Apis.ServiceManagement.v1 Client Library</Title>
<Version>1.49.0.2090</Version>
<Authors>Google Inc.</Authors>
<Copyright>Copyright 2017 Google Inc.</Copyright>
<PackageTags>Google</PackageTags>
<PackageProjectUrl>https://github.com/google/google-api-dotnet-client</PackageProjectUrl>
<PackageLicenseFile>LICENSE</PackageLicenseFile>
<RepositoryType>git</RepositoryType>
<RepositoryUrl>https://github.com/google/google-api-dotnet-client</RepositoryUrl>
<PackageIconUrl>https://www.gstatic.com/images/branding/product/1x/google_developers_64dp.png</PackageIconUrl>
<Description>
Google APIs Client Library for working with Servicemanagement v1.
Supported Platforms:
- .NET Framework 4.5+
- .NET Standard 1.3 and .NET Standard 2.0; providing .NET Core support.
Legacy platforms:
- .NET Framework 4.0
- Windows 8 Apps
- Windows Phone 8.1
- Windows Phone Silverlight 8.0
Incompatible platforms:
- .NET Framework < 4.0
- Silverlight
- UWP (will build, but is known not to work at runtime)
- Xamarin
More documentation on the API is available at:
https://developers.google.com/api-client-library/dotnet/apis/servicemanagement/v1
The package source code is available at:
https://github.com/google/google-api-dotnet-client/tree/master/Src/Generated
</Description>
</PropertyGroup>
<ItemGroup>
<None Include="../../../LICENSE" Pack="true" PackagePath="" />
</ItemGroup>
<!-- build properties -->
<PropertyGroup>
<TargetFrameworks>netstandard2.0;netstandard1.3;netstandard1.0;net45;net40</TargetFrameworks>
<SignAssembly>true</SignAssembly>
<AssemblyOriginatorKeyFile>..\..\..\google.apis.snk</AssemblyOriginatorKeyFile>
<DebugType>portable</DebugType>
<GenerateDocumentationFile>true</GenerateDocumentationFile>
<NoWarn>1570,1587,1591</NoWarn>
</PropertyGroup>
<!-- common dependencies -->
<ItemGroup>
<PackageReference Include="ConfigureAwaitChecker.Analyzer" Version="1.0.1" PrivateAssets="All" />
<PackageReference Include="SourceLink.Create.CommandLine" Version="2.8.0" PrivateAssets="All" />
</ItemGroup>
<!-- per-target dependencies -->
<ItemGroup Condition="'$(TargetFramework)'=='netstandard2.0'">
<PackageReference Include="Google.Apis" Version="1.49.0" />
<PackageReference Include="Google.Apis.Auth" Version="1.49.0" />
</ItemGroup>
<ItemGroup Condition="'$(TargetFramework)'=='netstandard1.3'">
<PackageReference Include="Google.Apis" Version="1.49.0" />
<PackageReference Include="Google.Apis.Auth" Version="1.49.0" />
</ItemGroup>
<PropertyGroup Condition="'$(TargetFramework)'=='netstandard1.0'">
<PackageTargetFallback>portable-net45+win8+wpa81+wp8</PackageTargetFallback>
<AppConfig>app.netstandard10.config</AppConfig>
</PropertyGroup>
<ItemGroup Condition="'$(TargetFramework)'=='netstandard1.0'">
<PackageReference Include="Google.Apis" Version="[1.25.0]" ExcludeAssets="build" />
<PackageReference Include="Google.Apis.Auth" Version="[1.25.0]" ExcludeAssets="build" />
<PackageReference Include="Microsoft.NETCore.Portable.Compatibility" Version="1.0.1" />
</ItemGroup>
<ItemGroup Condition="'$(TargetFramework)'=='net45'">
<PackageReference Include="Google.Apis" Version="1.49.0" />
<PackageReference Include="Google.Apis.Auth" Version="1.49.0" />
</ItemGroup>
<PropertyGroup Condition="'$(TargetFramework)'=='net40'">
<AutoUnifyAssemblyReferences>false</AutoUnifyAssemblyReferences>
<AppConfig>app.net40.config</AppConfig>
</PropertyGroup>
<ItemGroup Condition="'$(TargetFramework)'=='net40'">
<PackageReference Include="Google.Apis" Version="[1.10.0]" ExcludeAssets="build" />
<PackageReference Include="Google.Apis.Auth" Version="[1.10.0]" ExcludeAssets="build" />
</ItemGroup>
</Project>
| {
"pile_set_name": "Github"
} |
// cgo -godefs -- -Wall -Werror -static -I/tmp/include linux/types.go | go run mkpost.go
// Code generated by the command above; see README.md. DO NOT EDIT.
// +build mips64le,linux
package unix
const (
SizeofPtr = 0x8
SizeofLong = 0x8
)
type (
_C_long int64
)
type Timespec struct {
Sec int64
Nsec int64
}
type Timeval struct {
Sec int64
Usec int64
}
type Timex struct {
Modes uint32
Offset int64
Freq int64
Maxerror int64
Esterror int64
Status int32
Constant int64
Precision int64
Tolerance int64
Time Timeval
Tick int64
Ppsfreq int64
Jitter int64
Shift int32
Stabil int64
Jitcnt int64
Calcnt int64
Errcnt int64
Stbcnt int64
Tai int32
_ [44]byte
}
type Time_t int64
type Tms struct {
Utime int64
Stime int64
Cutime int64
Cstime int64
}
type Utimbuf struct {
Actime int64
Modtime int64
}
type Rusage struct {
Utime Timeval
Stime Timeval
Maxrss int64
Ixrss int64
Idrss int64
Isrss int64
Minflt int64
Majflt int64
Nswap int64
Inblock int64
Oublock int64
Msgsnd int64
Msgrcv int64
Nsignals int64
Nvcsw int64
Nivcsw int64
}
type Stat_t struct {
Dev uint32
Pad1 [3]uint32
Ino uint64
Mode uint32
Nlink uint32
Uid uint32
Gid uint32
Rdev uint32
Pad2 [3]uint32
Size int64
Atim Timespec
Mtim Timespec
Ctim Timespec
Blksize uint32
Pad4 uint32
Blocks int64
}
type Dirent struct {
Ino uint64
Off int64
Reclen uint16
Type uint8
Name [256]int8
_ [5]byte
}
type Flock_t struct {
Type int16
Whence int16
Start int64
Len int64
Pid int32
_ [4]byte
}
const (
FADV_DONTNEED = 0x4
FADV_NOREUSE = 0x5
)
type RawSockaddr struct {
Family uint16
Data [14]int8
}
type RawSockaddrAny struct {
Addr RawSockaddr
Pad [96]int8
}
type Iovec struct {
Base *byte
Len uint64
}
type Msghdr struct {
Name *byte
Namelen uint32
Iov *Iovec
Iovlen uint64
Control *byte
Controllen uint64
Flags int32
_ [4]byte
}
type Cmsghdr struct {
Len uint64
Level int32
Type int32
}
const (
SizeofIovec = 0x10
SizeofMsghdr = 0x38
SizeofCmsghdr = 0x10
)
const (
SizeofSockFprog = 0x10
)
type PtraceRegs struct {
Regs [32]uint64
Lo uint64
Hi uint64
Epc uint64
Badvaddr uint64
Status uint64
Cause uint64
}
type FdSet struct {
Bits [16]int64
}
type Sysinfo_t struct {
Uptime int64
Loads [3]uint64
Totalram uint64
Freeram uint64
Sharedram uint64
Bufferram uint64
Totalswap uint64
Freeswap uint64
Procs uint16
Pad uint16
Totalhigh uint64
Freehigh uint64
Unit uint32
_ [0]int8
_ [4]byte
}
type Ustat_t struct {
Tfree int32
Tinode uint64
Fname [6]int8
Fpack [6]int8
_ [4]byte
}
type EpollEvent struct {
Events uint32
_ int32
Fd int32
Pad int32
}
const (
POLLRDHUP = 0x2000
)
type Sigset_t struct {
Val [16]uint64
}
const _C__NSIG = 0x80
type Termios struct {
Iflag uint32
Oflag uint32
Cflag uint32
Lflag uint32
Line uint8
Cc [23]uint8
Ispeed uint32
Ospeed uint32
}
type Taskstats struct {
Version uint16
Ac_exitcode uint32
Ac_flag uint8
Ac_nice uint8
Cpu_count uint64
Cpu_delay_total uint64
Blkio_count uint64
Blkio_delay_total uint64
Swapin_count uint64
Swapin_delay_total uint64
Cpu_run_real_total uint64
Cpu_run_virtual_total uint64
Ac_comm [32]int8
Ac_sched uint8
Ac_pad [3]uint8
_ [4]byte
Ac_uid uint32
Ac_gid uint32
Ac_pid uint32
Ac_ppid uint32
Ac_btime uint32
Ac_etime uint64
Ac_utime uint64
Ac_stime uint64
Ac_minflt uint64
Ac_majflt uint64
Coremem uint64
Virtmem uint64
Hiwater_rss uint64
Hiwater_vm uint64
Read_char uint64
Write_char uint64
Read_syscalls uint64
Write_syscalls uint64
Read_bytes uint64
Write_bytes uint64
Cancelled_write_bytes uint64
Nvcsw uint64
Nivcsw uint64
Ac_utimescaled uint64
Ac_stimescaled uint64
Cpu_scaled_run_real_total uint64
Freepages_count uint64
Freepages_delay_total uint64
Thrashing_count uint64
Thrashing_delay_total uint64
Ac_btime64 uint64
}
type cpuMask uint64
const (
_NCPUBITS = 0x40
)
const (
CBitFieldMaskBit0 = 0x1
CBitFieldMaskBit1 = 0x2
CBitFieldMaskBit2 = 0x4
CBitFieldMaskBit3 = 0x8
CBitFieldMaskBit4 = 0x10
CBitFieldMaskBit5 = 0x20
CBitFieldMaskBit6 = 0x40
CBitFieldMaskBit7 = 0x80
CBitFieldMaskBit8 = 0x100
CBitFieldMaskBit9 = 0x200
CBitFieldMaskBit10 = 0x400
CBitFieldMaskBit11 = 0x800
CBitFieldMaskBit12 = 0x1000
CBitFieldMaskBit13 = 0x2000
CBitFieldMaskBit14 = 0x4000
CBitFieldMaskBit15 = 0x8000
CBitFieldMaskBit16 = 0x10000
CBitFieldMaskBit17 = 0x20000
CBitFieldMaskBit18 = 0x40000
CBitFieldMaskBit19 = 0x80000
CBitFieldMaskBit20 = 0x100000
CBitFieldMaskBit21 = 0x200000
CBitFieldMaskBit22 = 0x400000
CBitFieldMaskBit23 = 0x800000
CBitFieldMaskBit24 = 0x1000000
CBitFieldMaskBit25 = 0x2000000
CBitFieldMaskBit26 = 0x4000000
CBitFieldMaskBit27 = 0x8000000
CBitFieldMaskBit28 = 0x10000000
CBitFieldMaskBit29 = 0x20000000
CBitFieldMaskBit30 = 0x40000000
CBitFieldMaskBit31 = 0x80000000
CBitFieldMaskBit32 = 0x100000000
CBitFieldMaskBit33 = 0x200000000
CBitFieldMaskBit34 = 0x400000000
CBitFieldMaskBit35 = 0x800000000
CBitFieldMaskBit36 = 0x1000000000
CBitFieldMaskBit37 = 0x2000000000
CBitFieldMaskBit38 = 0x4000000000
CBitFieldMaskBit39 = 0x8000000000
CBitFieldMaskBit40 = 0x10000000000
CBitFieldMaskBit41 = 0x20000000000
CBitFieldMaskBit42 = 0x40000000000
CBitFieldMaskBit43 = 0x80000000000
CBitFieldMaskBit44 = 0x100000000000
CBitFieldMaskBit45 = 0x200000000000
CBitFieldMaskBit46 = 0x400000000000
CBitFieldMaskBit47 = 0x800000000000
CBitFieldMaskBit48 = 0x1000000000000
CBitFieldMaskBit49 = 0x2000000000000
CBitFieldMaskBit50 = 0x4000000000000
CBitFieldMaskBit51 = 0x8000000000000
CBitFieldMaskBit52 = 0x10000000000000
CBitFieldMaskBit53 = 0x20000000000000
CBitFieldMaskBit54 = 0x40000000000000
CBitFieldMaskBit55 = 0x80000000000000
CBitFieldMaskBit56 = 0x100000000000000
CBitFieldMaskBit57 = 0x200000000000000
CBitFieldMaskBit58 = 0x400000000000000
CBitFieldMaskBit59 = 0x800000000000000
CBitFieldMaskBit60 = 0x1000000000000000
CBitFieldMaskBit61 = 0x2000000000000000
CBitFieldMaskBit62 = 0x4000000000000000
CBitFieldMaskBit63 = 0x8000000000000000
)
type SockaddrStorage struct {
Family uint16
_ [118]int8
_ uint64
}
type HDGeometry struct {
Heads uint8
Sectors uint8
Cylinders uint16
Start uint64
}
type Statfs_t struct {
Type int64
Bsize int64
Frsize int64
Blocks uint64
Bfree uint64
Files uint64
Ffree uint64
Bavail uint64
Fsid Fsid
Namelen int64
Flags int64
Spare [5]int64
}
type TpacketHdr struct {
Status uint64
Len uint32
Snaplen uint32
Mac uint16
Net uint16
Sec uint32
Usec uint32
_ [4]byte
}
const (
SizeofTpacketHdr = 0x20
)
type RTCPLLInfo struct {
Ctrl int32
Value int32
Max int32
Min int32
Posmult int32
Negmult int32
Clock int64
}
type BlkpgPartition struct {
Start int64
Length int64
Pno int32
Devname [64]uint8
Volname [64]uint8
_ [4]byte
}
const (
BLKPG = 0x20001269
)
type XDPUmemReg struct {
Addr uint64
Len uint64
Size uint32
Headroom uint32
Flags uint32
_ [4]byte
}
type CryptoUserAlg struct {
Name [64]int8
Driver_name [64]int8
Module_name [64]int8
Type uint32
Mask uint32
Refcnt uint32
Flags uint32
}
type CryptoStatAEAD struct {
Type [64]int8
Encrypt_cnt uint64
Encrypt_tlen uint64
Decrypt_cnt uint64
Decrypt_tlen uint64
Err_cnt uint64
}
type CryptoStatAKCipher struct {
Type [64]int8
Encrypt_cnt uint64
Encrypt_tlen uint64
Decrypt_cnt uint64
Decrypt_tlen uint64
Verify_cnt uint64
Sign_cnt uint64
Err_cnt uint64
}
type CryptoStatCipher struct {
Type [64]int8
Encrypt_cnt uint64
Encrypt_tlen uint64
Decrypt_cnt uint64
Decrypt_tlen uint64
Err_cnt uint64
}
type CryptoStatCompress struct {
Type [64]int8
Compress_cnt uint64
Compress_tlen uint64
Decompress_cnt uint64
Decompress_tlen uint64
Err_cnt uint64
}
type CryptoStatHash struct {
Type [64]int8
Hash_cnt uint64
Hash_tlen uint64
Err_cnt uint64
}
type CryptoStatKPP struct {
Type [64]int8
Setsecret_cnt uint64
Generate_public_key_cnt uint64
Compute_shared_secret_cnt uint64
Err_cnt uint64
}
type CryptoStatRNG struct {
Type [64]int8
Generate_cnt uint64
Generate_tlen uint64
Seed_cnt uint64
Err_cnt uint64
}
type CryptoStatLarval struct {
Type [64]int8
}
type CryptoReportLarval struct {
Type [64]int8
}
type CryptoReportHash struct {
Type [64]int8
Blocksize uint32
Digestsize uint32
}
type CryptoReportCipher struct {
Type [64]int8
Blocksize uint32
Min_keysize uint32
Max_keysize uint32
}
type CryptoReportBlkCipher struct {
Type [64]int8
Geniv [64]int8
Blocksize uint32
Min_keysize uint32
Max_keysize uint32
Ivsize uint32
}
type CryptoReportAEAD struct {
Type [64]int8
Geniv [64]int8
Blocksize uint32
Maxauthsize uint32
Ivsize uint32
}
type CryptoReportComp struct {
Type [64]int8
}
type CryptoReportRNG struct {
Type [64]int8
Seedsize uint32
}
type CryptoReportAKCipher struct {
Type [64]int8
}
type CryptoReportKPP struct {
Type [64]int8
}
type CryptoReportAcomp struct {
Type [64]int8
}
type LoopInfo struct {
Number int32
Device uint32
Inode uint64
Rdevice uint32
Offset int32
Encrypt_type int32
Encrypt_key_size int32
Flags int32
Name [64]int8
Encrypt_key [32]uint8
Init [2]uint64
Reserved [4]int8
_ [4]byte
}
type TIPCSubscr struct {
Seq TIPCServiceRange
Timeout uint32
Filter uint32
Handle [8]int8
}
type TIPCSIOCLNReq struct {
Peer uint32
Id uint32
Linkname [68]int8
}
type TIPCSIOCNodeIDReq struct {
Peer uint32
Id [16]int8
}
| {
"pile_set_name": "Github"
} |
// Copyright 2013 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.
package vardecl
// Prerequisites.
import "math"
func f() {}
func g() (x, y int) { return }
var m map[string]int
// Var decls must have a type or an initializer.
var _ int
var _, _ int
// The first error message is produced by the parser.
// In a real-world scenario, the type-checker would not be run
// in this case and the 2nd error message would not appear.
var _ /* ERROR "missing variable type" */ /* ERROR "missing type or init expr" */
var _ /* ERROR "missing variable type" */ /* ERROR "missing type or init expr" */, _
var _ /* ERROR "missing variable type" */ /* ERROR "missing type or init expr" */, _, _
// The initializer must be an expression.
var _ = int /* ERROR "not an expression" */
var _ = f /* ERROR "used as value" */ ()
// Identifier and expression arity must match.
var _, _ = 1, 2
var _ = 1, 2 /* ERROR "extra init expr 2" */
var _, _ = 1 /* ERROR "assignment count mismatch" */
var _, _, _ /* ERROR "missing init expr for _" */ = 1, 2
var _ = g /* ERROR "2-valued g" */ ()
var _, _ = g()
var _, _, _ = g /* ERROR "assignment count mismatch" */ ()
var _ = m["foo"]
var _, _ = m["foo"]
var _, _, _ = m /* ERROR "assignment count mismatch" */ ["foo"]
var _, _ int = 1, 2
var _ int = 1, 2 /* ERROR "extra init expr 2" */
var _, _ int = 1 /* ERROR "assignment count mismatch" */
var _, _, _ /* ERROR "missing init expr for _" */ int = 1, 2
var (
_, _ = 1, 2
_ = 1, 2 /* ERROR "extra init expr 2" */
_, _ = 1 /* ERROR "assignment count mismatch" */
_, _, _ /* ERROR "missing init expr for _" */ = 1, 2
_ = g /* ERROR "2-valued g" */ ()
_, _ = g()
_, _, _ = g /* ERROR "assignment count mismatch" */ ()
_ = m["foo"]
_, _ = m["foo"]
_, _, _ = m /* ERROR "assignment count mismatch" */ ["foo"]
_, _ int = 1, 2
_ int = 1, 2 /* ERROR "extra init expr 2" */
_, _ int = 1 /* ERROR "assignment count mismatch" */
_, _, _ /* ERROR "missing init expr for _" */ int = 1, 2
)
// Variables declared in function bodies must be 'used'.
type T struct{}
func (r T) _(a, b, c int) (u, v, w int) {
var x1 /* ERROR "declared but not used" */ int
var x2 /* ERROR "declared but not used" */ int
x1 = 1
(x2) = 2
y1 /* ERROR "declared but not used" */ := 1
y2 /* ERROR "declared but not used" */ := 2
y1 = 1
(y1) = 2
{
var x1 /* ERROR "declared but not used" */ int
var x2 /* ERROR "declared but not used" */ int
x1 = 1
(x2) = 2
y1 /* ERROR "declared but not used" */ := 1
y2 /* ERROR "declared but not used" */ := 2
y1 = 1
(y1) = 2
}
if x /* ERROR "declared but not used" */ := 0; a < b {}
switch x /* ERROR "declared but not used" */, y := 0, 1; a {
case 0:
_ = y
case 1:
x /* ERROR "declared but not used" */ := 0
}
var t interface{}
switch t /* ERROR "declared but not used" */ := t.(type) {}
switch t /* ERROR "declared but not used" */ := t.(type) {
case int:
}
switch t /* ERROR "declared but not used" */ := t.(type) {
case int:
case float32, complex64:
t = nil
}
switch t := t.(type) {
case int:
case float32, complex64:
_ = t
}
switch t := t.(type) {
case int:
case float32:
case string:
_ = func() string {
return t
}
}
switch t := t; t /* ERROR "declared but not used" */ := t.(type) {}
var z1 /* ERROR "declared but not used" */ int
var z2 int
_ = func(a, b, c int) (u, v, w int) {
z1 = a
(z1) = b
a = z2
return
}
var s []int
var i /* ERROR "declared but not used" */ , j int
for i, j = range s {
_ = j
}
for i, j /* ERROR "declared but not used" */ := range s {
_ = func() int {
return i
}
}
return
}
// Invalid (unused) expressions must not lead to spurious "declared but not used errors"
func _() {
var a, b, c int
var x, y int
x, y = a /* ERROR assignment count mismatch */ , b, c
_ = x
_ = y
}
func _() {
var x int
return x /* ERROR no result values expected */
return math /* ERROR no result values expected */ .Sin(0)
}
func _() int {
var x, y int
return /* ERROR wrong number of return values */ x, y
}
// Short variable declarations must declare at least one new non-blank variable.
func _() {
_ := /* ERROR no new variables */ 0
_, a := 0, 1
_, a := /* ERROR no new variables */ 0, 1
_, a, b := 0, 1, 2
_, _, _ := /* ERROR no new variables */ 0, 1, 2
_ = a
_ = b
}
// TODO(gri) consolidate other var decl checks in this file | {
"pile_set_name": "Github"
} |
#ifndef crypto_stream_salsa208_H
#define crypto_stream_salsa208_H
/*
* WARNING: This is just a stream cipher. It is NOT authenticated encryption.
* While it provides some protection against eavesdropping, it does NOT
* provide any security against active attacks.
* Unless you know what you're doing, what you are looking for is probably
* the crypto_box functions.
*/
#include <stddef.h>
#include "export.h"
#ifdef __cplusplus
# ifdef __GNUC__
# pragma GCC diagnostic ignored "-Wlong-long"
# endif
extern "C" {
#endif
#define crypto_stream_salsa208_KEYBYTES 32U
SODIUM_EXPORT
size_t crypto_stream_salsa208_keybytes(void);
#define crypto_stream_salsa208_NONCEBYTES 8U
SODIUM_EXPORT
size_t crypto_stream_salsa208_noncebytes(void);
SODIUM_EXPORT
int crypto_stream_salsa208(unsigned char *c, unsigned long long clen,
const unsigned char *n, const unsigned char *k);
SODIUM_EXPORT
int crypto_stream_salsa208_xor(unsigned char *c, const unsigned char *m,
unsigned long long mlen, const unsigned char *n,
const unsigned char *k);
SODIUM_EXPORT
void crypto_stream_salsa208_keygen(unsigned char k[crypto_stream_salsa208_KEYBYTES]);
#ifdef __cplusplus
}
#endif
#endif
| {
"pile_set_name": "Github"
} |
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="com.billy.android.swipe.androidx"/>
| {
"pile_set_name": "Github"
} |
using System.Collections.Generic;
using System.Linq;
using System.Threading;
using AsmResolver.Collections;
using AsmResolver.DotNet.Signatures;
using AsmResolver.DotNet.Collections;
using AsmResolver.PE.DotNet.Metadata.Tables;
using AsmResolver.PE.DotNet.Metadata.Tables.Rows;
namespace AsmResolver.DotNet
{
/// <summary>
/// Represents a single property in a type definition of a .NET module.
/// </summary>
public class PropertyDefinition :
MetadataMember,
IHasSemantics,
IHasCustomAttribute,
IHasConstant,
IOwnedCollectionElement<TypeDefinition>
{
private readonly LazyVariable<string> _name;
private readonly LazyVariable<TypeDefinition> _declaringType;
private readonly LazyVariable<PropertySignature> _signature;
private readonly LazyVariable<Constant> _constant;
private IList<MethodSemantics> _semantics;
private IList<CustomAttribute> _customAttributes;
/// <summary>
/// Initializes a new property definition.
/// </summary>
/// <param name="token">The token of the property.</param>
protected PropertyDefinition(MetadataToken token)
: base(token)
{
_name = new LazyVariable<string>(GetName);
_signature = new LazyVariable<PropertySignature>(GetSignature);
_declaringType = new LazyVariable<TypeDefinition>(GetDeclaringType);
_constant = new LazyVariable<Constant>(GetConstant);
}
/// <summary>
/// Creates a new property definition.
/// </summary>
/// <param name="name">The name of the property.</param>
/// <param name="attributes">The attributes.</param>
/// <param name="signature">The signature of the property.</param>
public PropertyDefinition(string name, PropertyAttributes attributes, PropertySignature signature)
: this(new MetadataToken(TableIndex.Property,0))
{
Name = name;
Attributes = attributes;
Signature = signature;
}
/// <summary>
/// Gets or sets the attributes associated to the field.
/// </summary>
public PropertyAttributes Attributes
{
get;
set;
}
/// <summary>
/// Gets or sets a value indicating the property uses a special name.
/// </summary>
public bool IsSpecialName
{
get => (Attributes & PropertyAttributes.SpecialName) != 0;
set => Attributes = (Attributes & ~PropertyAttributes.SpecialName)
| (value ? PropertyAttributes.SpecialName : 0);
}
/// <summary>
/// Gets or sets a value indicating the property uses a special name used by the runtime.
/// </summary>
public bool IsRuntimeSpecialName
{
get => (Attributes & PropertyAttributes.RtSpecialName) != 0;
set => Attributes = (Attributes & ~PropertyAttributes.RtSpecialName)
| (value ? PropertyAttributes.RtSpecialName : 0);
}
/// <summary>
/// Gets or sets a value indicating the property has a default value.
/// </summary>
public bool HasDefault
{
get => (Attributes & PropertyAttributes.HasDefault) != 0;
set => Attributes = (Attributes & ~PropertyAttributes.HasDefault)
| (value ? PropertyAttributes.HasDefault : 0);
}
/// <inheritdoc />
public string Name
{
get => _name.Value;
set => _name.Value = value;
}
/// <inheritdoc />
public string FullName => FullNameGenerator.GetPropertyFullName(Name, DeclaringType, Signature);
/// <summary>
/// Gets or sets the signature of the property. This includes the property type, as well as any parameters the
/// property might define.
/// </summary>
public PropertySignature Signature
{
get => _signature.Value;
set => _signature.Value = value;
}
/// <inheritdoc />
public ModuleDefinition Module => DeclaringType?.Module;
/// <summary>
/// Gets the type that defines the property.
/// </summary>
public TypeDefinition DeclaringType
{
get => _declaringType.Value;
private set => _declaringType.Value = value;
}
ITypeDescriptor IMemberDescriptor.DeclaringType => DeclaringType;
TypeDefinition IOwnedCollectionElement<TypeDefinition>.Owner
{
get => DeclaringType;
set => DeclaringType = value;
}
/// <inheritdoc />
public IList<MethodSemantics> Semantics
{
get
{
if (_semantics is null)
Interlocked.CompareExchange(ref _semantics, GetSemantics(), null);
return _semantics;
}
}
/// <inheritdoc />
public IList<CustomAttribute> CustomAttributes
{
get
{
if (_customAttributes is null)
Interlocked.CompareExchange(ref _customAttributes, GetCustomAttributes(), null);
return _customAttributes;
}
}
/// <inheritdoc />
public Constant Constant
{
get => _constant.Value;
set => _constant.Value = value;
}
/// <summary>
/// Gets the method definition representing the get accessor of this property definition.
/// </summary>
public MethodDefinition GetMethod =>
Semantics.FirstOrDefault(s => s.Attributes == MethodSemanticsAttributes.Getter)?.Method;
/// <summary>
/// Gets the method definition representing the set accessor of this property definition.
/// </summary>
public MethodDefinition SetMethod =>
Semantics.FirstOrDefault(s => s.Attributes == MethodSemanticsAttributes.Setter)?.Method;
/// <inheritdoc />
public bool IsAccessibleFromType(TypeDefinition type) =>
Semantics.Any(s => s.Method.IsAccessibleFromType(type));
IMemberDefinition IMemberDescriptor.Resolve() => this;
/// <summary>
/// Obtains the name of the property definition.
/// </summary>
/// <returns>The name.</returns>
/// <remarks>
/// This method is called upon initialization of the <see cref="Name"/> property.
/// </remarks>
protected virtual string GetName() => null;
/// <summary>
/// Obtains the signature of the property definition.
/// </summary>
/// <returns>The signature.</returns>
/// <remarks>
/// This method is called upon initialization of the <see cref="Signature"/> property.
/// </remarks>
protected virtual PropertySignature GetSignature() => null;
/// <summary>
/// Obtains the declaring type of the property definition.
/// </summary>
/// <returns>The declaring type.</returns>
/// <remarks>
/// This method is called upon initialization of the <see cref="DeclaringType"/> property.
/// </remarks>
protected virtual TypeDefinition GetDeclaringType() => null;
/// <summary>
/// Obtains the methods associated to this property definition.
/// </summary>
/// <returns>The method semantic objects.</returns>
/// <remarks>
/// This method is called upon initialization of the <see cref="Semantics"/> property.
/// </remarks>
protected virtual IList<MethodSemantics> GetSemantics() =>
new MethodSemanticsCollection(this);
/// <summary>
/// Obtains the list of custom attributes assigned to the member.
/// </summary>
/// <returns>The attributes</returns>
/// <remarks>
/// This method is called upon initialization of the <see cref="CustomAttributes"/> property.
/// </remarks>
protected virtual IList<CustomAttribute> GetCustomAttributes() =>
new OwnedCollection<IHasCustomAttribute, CustomAttribute>(this);
/// <summary>
/// Obtains the constant value assigned to the property definition.
/// </summary>
/// <returns>The constant.</returns>
/// <remarks>
/// This method is called upon initialization of the <see cref="Constant"/> property.
/// </remarks>
protected virtual Constant GetConstant() => null;
/// <inheritdoc />
public override string ToString() => FullName;
}
} | {
"pile_set_name": "Github"
} |
module sub
(
output signed [3:0] as,
output [3:0] bs);
endmodule
module t
wire signed [3:0] as; // From sub of sub.v
wire [3:0] bs; // From sub of sub.v
sub sub (/*AUTOINST*/
// Outputs
.as (as[3:0]),
.bs (bs[3:0]));
endmodule
// Local Variables:
// verilog-auto-inst-vector: t
// End:
| {
"pile_set_name": "Github"
} |
package jetbrick.template.exec.invoker;
import jetbrick.template.exec.AbstractJetxTest;
import jetbrick.util.StringUtils;
import org.junit.Assert;
import org.junit.Test;
public class InvokeFunctionTest extends AbstractJetxTest {
@Override
public void initializeEngine() {
engine.getGlobalResolver().registerFunctions(StringUtils.class);
}
@Test
public void test() {
Assert.assertEquals("123", eval("${trim(' 123 ')}"));
Assert.assertEquals("000", eval("${repeat('0', 3)}"));
Assert.assertEquals("?,?,?", eval("${repeat('?', ',', 3)}"));
}
}
| {
"pile_set_name": "Github"
} |
# AIGames
```
use AI to play some games.
You can star this repository to keep track of the project if it's helpful for you, thank you for your support.
```
# Contents
| Name | Number of implemented algorithms | Code | In Chinese |
| :----: | :----: | :----: | :----: |
| AISnake | 2 | [click](https://github.com/CharlesPikachu/AIGames/tree/master/AISnake) | AI贪吃蛇 |
| AITetris | 1 | [click](https://github.com/CharlesPikachu/AIGames/tree/master/AITetris) | AI俄罗斯方块 |
| AIGobang | 1 | [click](https://github.com/CharlesPikachu/AIGames/tree/master/AIGobang) | AI五子棋 |
| AITRexRush | 3 | [click](https://github.com/CharlesPikachu/AIGames/tree/master/AITRexRush) | AIChrome浏览器小恐龙游戏 |
| AIPong | 1 | [click](https://github.com/CharlesPikachu/AIGames/tree/master/AIPong) | AI乒乓球 |
| AIPianoTiles | 1 | [click](https://github.com/CharlesPikachu/AIGames/tree/master/AIPianoTiles) | AI别再踩白块了 |
| AIPacman | 1 | [click](https://github.com/CharlesPikachu/AIGames/tree/master/AIPacman) | AI吃豆人 |
| AIFlappyBird | 2 | [click](https://github.com/CharlesPikachu/AIGames/tree/master/AIFlappyBird) | AI飞扬的小鸟 |
# More
#### WeChat Official Accounts
*Charles_pikachu*
 | {
"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.asterix.hivecompat.io;
import java.io.DataInput;
import java.io.DataInputStream;
import java.io.DataOutput;
import java.io.DataOutputStream;
import java.io.EOFException;
import java.io.IOException;
import java.rmi.server.UID;
import java.security.MessageDigest;
import java.util.Arrays;
import java.util.List;
import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;
import org.apache.hadoop.conf.Configuration;
import org.apache.hadoop.fs.ChecksumException;
import org.apache.hadoop.fs.FSDataInputStream;
import org.apache.hadoop.fs.FSDataOutputStream;
import org.apache.hadoop.fs.FileSystem;
import org.apache.hadoop.fs.Path;
import org.apache.hadoop.hive.conf.HiveConf;
import org.apache.hadoop.hive.serde2.ColumnProjectionUtils;
import org.apache.hadoop.hive.serde2.columnar.BytesRefArrayWritable;
import org.apache.hadoop.hive.serde2.columnar.BytesRefWritable;
import org.apache.hadoop.hive.serde2.columnar.LazyDecompressionCallback;
import org.apache.hadoop.hive.shims.ShimLoader;
import org.apache.hadoop.io.IOUtils;
import org.apache.hadoop.io.LongWritable;
import org.apache.hadoop.io.SequenceFile.Metadata;
import org.apache.hadoop.io.Text;
import org.apache.hadoop.io.VersionMismatchException;
import org.apache.hadoop.io.Writable;
import org.apache.hadoop.io.WritableComparable;
import org.apache.hadoop.io.WritableUtils;
import org.apache.hadoop.io.compress.CompressionCodec;
import org.apache.hadoop.io.compress.CompressionInputStream;
import org.apache.hadoop.io.compress.CompressionOutputStream;
import org.apache.hadoop.io.compress.Compressor;
import org.apache.hadoop.io.compress.Decompressor;
import org.apache.hadoop.util.Progressable;
import org.apache.hadoop.util.ReflectionUtils;
/**
* <code>RCFile</code>s, short of Record Columnar File, are flat files
* consisting of binary key/value pairs, which shares much similarity with
* <code>SequenceFile</code>.
*
* RCFile stores columns of a table in a record columnar way. It first
* partitions rows horizontally into row splits. and then it vertically
* partitions each row split in a columnar way. RCFile first stores the meta
* data of a row split, as the key part of a record, and all the data of a row
* split as the value part. When writing, RCFile.Writer first holds records'
* value bytes in memory, and determines a row split if the raw bytes size of
* buffered records overflow a given parameter<tt>Writer.columnsBufferSize</tt>,
* which can be set like: <code>conf.setInt(COLUMNS_BUFFER_SIZE_CONF_STR,
4 * 1024 * 1024)</code> .
* <p>
* <code>RCFile</code> provides {@link Writer}, {@link Reader} and classes for
* writing, reading respectively.
* </p>
*
* <p>
* RCFile stores columns of a table in a record columnar way. It first
* partitions rows horizontally into row splits. and then it vertically
* partitions each row split in a columnar way. RCFile first stores the meta
* data of a row split, as the key part of a record, and all the data of a row
* split as the value part.
* </p>
*
* <p>
* RCFile compresses values in a more fine-grained manner then record level
* compression. However, It currently does not support compress the key part
* yet. The actual compression algorithm used to compress key and/or values can
* be specified by using the appropriate {@link CompressionCodec}.
* </p>
*
* <p>
* The {@link Reader} is used to read and explain the bytes of RCFile.
* </p>
*
* <h4 id="Formats">RCFile Formats</h4>
*
*
* <h5 id="Header">RC Header</h5>
* <ul>
* <li>version - 3 bytes of magic header <b>RCF</b>, followed by 1 byte of
* actual version number (e.g. RCF1)</li>
* <li>compression - A boolean which specifies if compression is turned on for
* keys/values in this file.</li>
* <li>compression codec - <code>CompressionCodec</code> class which is used
* for compression of keys and/or values (if compression is enabled).</li>
* <li>metadata - {@link Metadata} for this file.</li>
* <li>sync - A sync marker to denote end of the header.</li>
* </ul>
*
* <h5>RCFile Format</h5>
* <ul>
* <li><a href="#Header">Header</a></li>
* <li>Record
* <li>Key part
* <ul>
* <li>Record length in bytes</li>
* <li>Key length in bytes</li>
* <li>Number_of_rows_in_this_record(vint)</li>
* <li>Column_1_ondisk_length(vint)</li>
* <li>Column_1_row_1_value_plain_length</li>
* <li>Column_1_row_2_value_plain_length</li>
* <li>...</li>
* <li>Column_2_ondisk_length(vint)</li>
* <li>Column_2_row_1_value_plain_length</li>
* <li>Column_2_row_2_value_plain_length</li>
* <li>...</li>
* </ul>
* </li>
* </li>
* <li>Value part
* <ul>
* <li>Compressed or plain data of [column_1_row_1_value,
* column_1_row_2_value,....]</li>
* <li>Compressed or plain data of [column_2_row_1_value,
* column_2_row_2_value,....]</li>
* </ul>
* </li>
* </ul>
* <p>
* <pre>
* {@code
* The following is a pseudo-BNF grammar for RCFile. Comments are prefixed
* with dashes:
*
* rcfile ::=
* <file-header>
* <rcfile-rowgroup>+
*
* file-header ::=
* <file-version-header>
* <file-key-class-name> (only exists if version is seq6)
* <file-value-class-name> (only exists if version is seq6)
* <file-is-compressed>
* <file-is-block-compressed> (only exists if version is seq6)
* [<file-compression-codec-class>]
* <file-header-metadata>
* <file-sync-field>
*
* -- The normative RCFile implementation included with Hive is actually
* -- based on a modified version of Hadoop's SequenceFile code. Some
* -- things which should have been modified were not, including the code
* -- that writes out the file version header. Consequently, RCFile and
* -- SequenceFile originally shared the same version header. A newer
* -- release has created a unique version string.
*
* file-version-header ::= Byte[4] {'S', 'E', 'Q', 6}
* | Byte[4] {'R', 'C', 'F', 1}
*
* -- The name of the Java class responsible for reading the key buffer
* -- component of the rowgroup.
*
* file-key-class-name ::=
* Text {"org.apache.asterix.hivecompat.io.RCFile$KeyBuffer"}
*
* -- The name of the Java class responsible for reading the value buffer
* -- component of the rowgroup.
*
* file-value-class-name ::=
* Text {"org.apache.asterix.hivecompat.io.RCFile$ValueBuffer"}
*
* -- Boolean variable indicating whether or not the file uses compression
* -- for the key and column buffer sections.
*
* file-is-compressed ::= Byte[1]
*
* -- A boolean field indicating whether or not the file is block compressed.
* -- This field is *always* false. According to comments in the original
* -- RCFile implementation this field was retained for backwards
* -- compatability with the SequenceFile format.
*
* file-is-block-compressed ::= Byte[1] {false}
*
* -- The Java class name of the compression codec iff <file-is-compressed>
* -- is true. The named class must implement
* -- org.apache.hadoop.io.compress.CompressionCodec.
* -- The expected value is org.apache.hadoop.io.compress.GzipCodec.
*
* file-compression-codec-class ::= Text
*
* -- A collection of key-value pairs defining metadata values for the
* -- file. The Map is serialized using standard JDK serialization, i.e.
* -- an Int corresponding to the number of key-value pairs, followed by
* -- Text key and value pairs. The following metadata properties are
* -- mandatory for all RCFiles:
* --
* -- hive.io.rcfile.column.number: the number of columns in the RCFile
*
* file-header-metadata ::= Map<Text, Text>
*
* -- A 16 byte marker that is generated by the writer. This marker appears
* -- at regular intervals at the beginning of rowgroup-headers, and is
* -- intended to enable readers to skip over corrupted rowgroups.
*
* file-sync-hash ::= Byte[16]
*
* -- Each row group is split into three sections: a header, a set of
* -- key buffers, and a set of column buffers. The header section includes
* -- an optional sync hash, information about the size of the row group, and
* -- the total number of rows in the row group. Each key buffer
* -- consists of run-length encoding data which is used to decode
* -- the length and offsets of individual fields in the corresponding column
* -- buffer.
*
* rcfile-rowgroup ::=
* <rowgroup-header>
* <rowgroup-key-data>
* <rowgroup-column-buffers>
*
* rowgroup-header ::=
* [<rowgroup-sync-marker>, <rowgroup-sync-hash>]
* <rowgroup-record-length>
* <rowgroup-key-length>
* <rowgroup-compressed-key-length>
*
* -- rowgroup-key-data is compressed if the column data is compressed.
* rowgroup-key-data ::=
* <rowgroup-num-rows>
* <rowgroup-key-buffers>
*
* -- An integer (always -1) signaling the beginning of a sync-hash
* -- field.
*
* rowgroup-sync-marker ::= Int
*
* -- A 16 byte sync field. This must match the <file-sync-hash> value read
* -- in the file header.
*
* rowgroup-sync-hash ::= Byte[16]
*
* -- The record-length is the sum of the number of bytes used to store
* -- the key and column parts, i.e. it is the total length of the current
* -- rowgroup.
*
* rowgroup-record-length ::= Int
*
* -- Total length in bytes of the rowgroup's key sections.
*
* rowgroup-key-length ::= Int
*
* -- Total compressed length in bytes of the rowgroup's key sections.
*
* rowgroup-compressed-key-length ::= Int
*
* -- Number of rows in the current rowgroup.
*
* rowgroup-num-rows ::= VInt
*
* -- One or more column key buffers corresponding to each column
* -- in the RCFile.
*
* rowgroup-key-buffers ::= <rowgroup-key-buffer>+
*
* -- Data in each column buffer is stored using a run-length
* -- encoding scheme that is intended to reduce the cost of
* -- repeated column field values. This mechanism is described
* -- in more detail in the following entries.
*
* rowgroup-key-buffer ::=
* <column-buffer-length>
* <column-buffer-uncompressed-length>
* <column-key-buffer-length>
* <column-key-buffer>
*
* -- The serialized length on disk of the corresponding column buffer.
*
* column-buffer-length ::= VInt
*
* -- The uncompressed length of the corresponding column buffer. This
* -- is equivalent to column-buffer-length if the RCFile is not compressed.
*
* column-buffer-uncompressed-length ::= VInt
*
* -- The length in bytes of the current column key buffer
*
* column-key-buffer-length ::= VInt
*
* -- The column-key-buffer contains a sequence of serialized VInt values
* -- corresponding to the byte lengths of the serialized column fields
* -- in the corresponding rowgroup-column-buffer. For example, consider
* -- an integer column that contains the consecutive values 1, 2, 3, 44.
* -- The RCFile format stores these values as strings in the column buffer,
* -- e.g. "12344". The length of each column field is recorded in
* -- the column-key-buffer as a sequence of VInts: 1,1,1,2. However,
* -- if the same length occurs repeatedly, then we replace repeated
* -- run lengths with the complement (i.e. negative) of the number of
* -- repetitions, so 1,1,1,2 becomes 1,~2,2.
*
* column-key-buffer ::= Byte[column-key-buffer-length]
*
* rowgroup-column-buffers ::= <rowgroup-value-buffer>+
*
* -- RCFile stores all column data as strings regardless of the
* -- underlying column type. The strings are neither length-prefixed or
* -- null-terminated, and decoding them into individual fields requires
* -- the use of the run-length information contained in the corresponding
* -- column-key-buffer.
*
* rowgroup-column-buffer ::= Byte[column-buffer-length]
*
* Byte ::= An eight-bit byte
*
* VInt ::= Variable length integer. The high-order bit of each byte
* indicates whether more bytes remain to be read. The low-order seven
* bits are appended as increasingly more significant bits in the
* resulting integer value.
*
* Int ::= A four-byte integer in big-endian format.
*
* Text ::= VInt, Chars (Length prefixed UTF-8 characters)
* }
* </pre>
* </p>
*/
public class RCFile {
private static final Log LOG = LogFactory.getLog(RCFile.class);
public static final String RECORD_INTERVAL_CONF_STR = "hive.io.rcfile.record.interval";
public static final String COLUMN_NUMBER_METADATA_STR = "hive.io.rcfile.column.number";
public static final String COLUMN_NUMBER_CONF_STR = "hive.io.rcfile.column.number.conf";
public static final String TOLERATE_CORRUPTIONS_CONF_STR =
"hive.io.rcfile.tolerate.corruptions";
// HACK: We actually need BlockMissingException, but that is not available
// in all hadoop versions.
public static final String BLOCK_MISSING_MESSAGE =
"Could not obtain block";
// All of the versions should be place in this list.
private static final int ORIGINAL_VERSION = 0; // version with SEQ
private static final int NEW_MAGIC_VERSION = 1; // version with RCF
private static final int CURRENT_VERSION = NEW_MAGIC_VERSION;
// The first version of RCFile used the sequence file header.
private static final byte[] ORIGINAL_MAGIC = new byte[] {
(byte) 'S', (byte) 'E', (byte) 'Q'};
// the version that was included with the original magic, which is mapped
// into ORIGINAL_VERSION
private static final byte ORIGINAL_MAGIC_VERSION_WITH_METADATA = 6;
private static final byte[] ORIGINAL_MAGIC_VERSION = new byte[] {
(byte) 'S', (byte) 'E', (byte) 'Q', ORIGINAL_MAGIC_VERSION_WITH_METADATA
};
// The 'magic' bytes at the beginning of the RCFile
private static final byte[] MAGIC = new byte[] {
(byte) 'R', (byte) 'C', (byte) 'F'};
private static final int SYNC_ESCAPE = -1; // "length" of sync entries
private static final int SYNC_HASH_SIZE = 16; // number of bytes in hash
private static final int SYNC_SIZE = 4 + SYNC_HASH_SIZE; // escape + hash
/** The number of bytes between sync points. */
public static final int SYNC_INTERVAL = 100 * SYNC_SIZE;
/**
* KeyBuffer is the key of each record in RCFile. Its on-disk layout is as
* below:
*
* <ul>
* <li>record length in bytes,it is the sum of bytes used to store the key
* part and the value part.</li>
* <li>Key length in bytes, it is how many bytes used by the key part.</li>
* <li>number_of_rows_in_this_record(vint),</li>
* <li>column_1_ondisk_length(vint),</li>
* <li>column_1_row_1_value_plain_length,</li>
* <li>column_1_row_2_value_plain_length,</li>
* <li>....</li>
* <li>column_2_ondisk_length(vint),</li>
* <li>column_2_row_1_value_plain_length,</li>
* <li>column_2_row_2_value_plain_length,</li>
* <li>.... .</li>
* <li>{the end of the key part}</li>
* </ul>
*/
public static class KeyBuffer implements WritableComparable {
// each column's length in the value
private int[] eachColumnValueLen = null;
private int[] eachColumnUncompressedValueLen = null;
// stores each cell's length of a column in one DataOutputBuffer element
private NonSyncDataOutputBuffer[] allCellValLenBuffer = null;
// how many rows in this split
private int numberRows = 0;
// how many columns
private int columnNumber = 0;
// return the number of columns recorded in this file's header
public int getColumnNumber() {
return columnNumber;
}
@SuppressWarnings("unused")
@Deprecated
public KeyBuffer(){
}
KeyBuffer(int columnNum) {
columnNumber = columnNum;
eachColumnValueLen = new int[columnNumber];
eachColumnUncompressedValueLen = new int[columnNumber];
allCellValLenBuffer = new NonSyncDataOutputBuffer[columnNumber];
}
@SuppressWarnings("unused")
@Deprecated
KeyBuffer(int numberRows, int columnNum) {
this(columnNum);
this.numberRows = numberRows;
}
public void nullColumn(int columnIndex) {
eachColumnValueLen[columnIndex] = 0;
eachColumnUncompressedValueLen[columnIndex] = 0;
allCellValLenBuffer[columnIndex] = new NonSyncDataOutputBuffer();
}
/**
* add in a new column's meta data.
*
* @param columnValueLen
* this total bytes number of this column's values in this split
* @param colValLenBuffer
* each cell's length of this column's in this split
*/
void setColumnLenInfo(int columnValueLen,
NonSyncDataOutputBuffer colValLenBuffer,
int columnUncompressedValueLen, int columnIndex) {
eachColumnValueLen[columnIndex] = columnValueLen;
eachColumnUncompressedValueLen[columnIndex] = columnUncompressedValueLen;
allCellValLenBuffer[columnIndex] = colValLenBuffer;
}
@Override
public void readFields(DataInput in) throws IOException {
eachColumnValueLen = new int[columnNumber];
eachColumnUncompressedValueLen = new int[columnNumber];
allCellValLenBuffer = new NonSyncDataOutputBuffer[columnNumber];
numberRows = WritableUtils.readVInt(in);
for (int i = 0; i < columnNumber; i++) {
eachColumnValueLen[i] = WritableUtils.readVInt(in);
eachColumnUncompressedValueLen[i] = WritableUtils.readVInt(in);
int bufLen = WritableUtils.readVInt(in);
if (allCellValLenBuffer[i] == null) {
allCellValLenBuffer[i] = new NonSyncDataOutputBuffer();
} else {
allCellValLenBuffer[i].reset();
}
allCellValLenBuffer[i].write(in, bufLen);
}
}
@Override
public void write(DataOutput out) throws IOException {
// out.writeInt(numberRows);
WritableUtils.writeVLong(out, numberRows);
for (int i = 0; i < eachColumnValueLen.length; i++) {
WritableUtils.writeVLong(out, eachColumnValueLen[i]);
WritableUtils.writeVLong(out, eachColumnUncompressedValueLen[i]);
NonSyncDataOutputBuffer colRowsLenBuf = allCellValLenBuffer[i];
int bufLen = colRowsLenBuf.getLength();
WritableUtils.writeVLong(out, bufLen);
out.write(colRowsLenBuf.getData(), 0, bufLen);
}
}
/**
* get number of bytes to store the keyBuffer.
*
* @return number of bytes used to store this KeyBuffer on disk
* @throws IOException
*/
public int getSize() throws IOException {
int ret = 0;
ret += WritableUtils.getVIntSize(numberRows);
for (int i = 0; i < eachColumnValueLen.length; i++) {
ret += WritableUtils.getVIntSize(eachColumnValueLen[i]);
ret += WritableUtils.getVIntSize(eachColumnUncompressedValueLen[i]);
ret += WritableUtils.getVIntSize(allCellValLenBuffer[i].getLength());
ret += allCellValLenBuffer[i].getLength();
}
return ret;
}
@Override
public int compareTo(Object arg0) {
throw new RuntimeException("compareTo not supported in class "
+ this.getClass().getName());
}
public int[] getEachColumnUncompressedValueLen() {
return eachColumnUncompressedValueLen;
}
public int[] getEachColumnValueLen() {
return eachColumnValueLen;
}
/**
* @return the numberRows
*/
public int getNumberRows() {
return numberRows;
}
}
/**
* ValueBuffer is the value of each record in RCFile. Its on-disk layout is as
* below:
* <ul>
* <li>Compressed or plain data of [column_1_row_1_value,
* column_1_row_2_value,....]</li>
* <li>Compressed or plain data of [column_2_row_1_value,
* column_2_row_2_value,....]</li>
* </ul>
*/
public static class ValueBuffer implements WritableComparable {
class LazyDecompressionCallbackImpl implements LazyDecompressionCallback {
int index = -1;
int colIndex = -1;
public LazyDecompressionCallbackImpl(int index, int colIndex) {
super();
this.index = index;
this.colIndex = colIndex;
}
@Override
public byte[] decompress() throws IOException {
if (decompressedFlag[index] || codec == null) {
return loadedColumnsValueBuffer[index].getData();
}
NonSyncDataOutputBuffer compressedData = compressedColumnsValueBuffer[index];
decompressBuffer.reset();
DataInputStream valueIn = new DataInputStream(deflatFilter);
deflatFilter.resetState();
if (deflatFilter instanceof SchemaAwareCompressionInputStream) {
((SchemaAwareCompressionInputStream)deflatFilter).setColumnIndex(colIndex);
}
decompressBuffer.reset(compressedData.getData(),
keyBuffer.eachColumnValueLen[colIndex]);
NonSyncDataOutputBuffer decompressedColBuf = loadedColumnsValueBuffer[index];
decompressedColBuf.reset();
decompressedColBuf.write(valueIn,
keyBuffer.eachColumnUncompressedValueLen[colIndex]);
decompressedFlag[index] = true;
numCompressed--;
return decompressedColBuf.getData();
}
}
// used to load columns' value into memory
private NonSyncDataOutputBuffer[] loadedColumnsValueBuffer = null;
private NonSyncDataOutputBuffer[] compressedColumnsValueBuffer = null;
private boolean[] decompressedFlag = null;
private int numCompressed;
private LazyDecompressionCallbackImpl[] lazyDecompressCallbackObjs = null;
private boolean lazyDecompress = true;
boolean inited = false;
// used for readFields
KeyBuffer keyBuffer;
private int columnNumber = 0;
// set true for columns that needed to skip loading into memory.
boolean[] skippedColIDs = null;
CompressionCodec codec;
Decompressor valDecompressor = null;
NonSyncDataInputBuffer decompressBuffer = new NonSyncDataInputBuffer();
CompressionInputStream deflatFilter = null;
@SuppressWarnings("unused")
@Deprecated
public ValueBuffer() throws IOException {
}
@SuppressWarnings("unused")
@Deprecated
public ValueBuffer(KeyBuffer keyBuffer) throws IOException {
this(keyBuffer, keyBuffer.columnNumber, null, null, true);
}
@SuppressWarnings("unused")
@Deprecated
public ValueBuffer(KeyBuffer keyBuffer, boolean[] skippedColIDs)
throws IOException {
this(keyBuffer, keyBuffer.columnNumber, skippedColIDs, null, true);
}
@SuppressWarnings("unused")
@Deprecated
public ValueBuffer(KeyBuffer currentKey, int columnNumber,
boolean[] skippedCols, CompressionCodec codec) throws IOException {
this(currentKey, columnNumber, skippedCols, codec, true);
}
public ValueBuffer(KeyBuffer currentKey, int columnNumber,
boolean[] skippedCols, CompressionCodec codec, boolean lazyDecompress)
throws IOException {
this.lazyDecompress = lazyDecompress;
keyBuffer = currentKey;
this.columnNumber = columnNumber;
if (skippedCols != null && skippedCols.length > 0) {
skippedColIDs = skippedCols;
} else {
skippedColIDs = new boolean[columnNumber];
for (int i = 0; i < skippedColIDs.length; i++) {
skippedColIDs[i] = false;
}
}
int skipped = 0;
for (boolean currentSkip : skippedColIDs) {
if (currentSkip) {
skipped++;
}
}
loadedColumnsValueBuffer = new NonSyncDataOutputBuffer[columnNumber
- skipped];
decompressedFlag = new boolean[columnNumber - skipped];
lazyDecompressCallbackObjs = new LazyDecompressionCallbackImpl[columnNumber
- skipped];
compressedColumnsValueBuffer = new NonSyncDataOutputBuffer[columnNumber
- skipped];
this.codec = codec;
if (codec != null) {
valDecompressor = CodecPool.getDecompressor(codec);
deflatFilter = codec.createInputStream(decompressBuffer,
valDecompressor);
}
if (codec != null) {
numCompressed = decompressedFlag.length;
} else {
numCompressed = 0;
}
for (int k = 0, readIndex = 0; k < columnNumber; k++) {
if (skippedColIDs[k]) {
continue;
}
loadedColumnsValueBuffer[readIndex] = new NonSyncDataOutputBuffer();
if (codec != null) {
decompressedFlag[readIndex] = false;
lazyDecompressCallbackObjs[readIndex] = new LazyDecompressionCallbackImpl(
readIndex, k);
compressedColumnsValueBuffer[readIndex] = new NonSyncDataOutputBuffer();
} else {
decompressedFlag[readIndex] = true;
}
readIndex++;
}
}
@SuppressWarnings("unused")
@Deprecated
public void setColumnValueBuffer(NonSyncDataOutputBuffer valBuffer,
int addIndex) {
loadedColumnsValueBuffer[addIndex] = valBuffer;
}
@Override
public void readFields(DataInput in) throws IOException {
int addIndex = 0;
int skipTotal = 0;
for (int i = 0; i < columnNumber; i++) {
int vaRowsLen = keyBuffer.eachColumnValueLen[i];
// skip this column
if (skippedColIDs[i]) {
skipTotal += vaRowsLen;
continue;
}
if (skipTotal != 0) {
in.skipBytes(skipTotal);
skipTotal = 0;
}
NonSyncDataOutputBuffer valBuf;
if (codec != null){
// load into compressed buf first
valBuf = compressedColumnsValueBuffer[addIndex];
} else {
valBuf = loadedColumnsValueBuffer[addIndex];
}
valBuf.reset();
valBuf.write(in, vaRowsLen);
if (codec != null) {
decompressedFlag[addIndex] = false;
if (!lazyDecompress) {
lazyDecompressCallbackObjs[addIndex].decompress();
decompressedFlag[addIndex] = true;
}
}
addIndex++;
}
if (codec != null) {
numCompressed = decompressedFlag.length;
}
if (skipTotal != 0) {
in.skipBytes(skipTotal);
}
}
@Override
public void write(DataOutput out) throws IOException {
if (codec != null) {
for (NonSyncDataOutputBuffer currentBuf : compressedColumnsValueBuffer) {
out.write(currentBuf.getData(), 0, currentBuf.getLength());
}
} else {
for (NonSyncDataOutputBuffer currentBuf : loadedColumnsValueBuffer) {
out.write(currentBuf.getData(), 0, currentBuf.getLength());
}
}
}
public void nullColumn(int columnIndex) {
if (codec != null) {
compressedColumnsValueBuffer[columnIndex].reset();
} else {
loadedColumnsValueBuffer[columnIndex].reset();
}
}
public void clearColumnBuffer() throws IOException {
decompressBuffer.reset();
}
public void close() {
for (NonSyncDataOutputBuffer element : loadedColumnsValueBuffer) {
IOUtils.closeStream(element);
}
if (codec != null) {
IOUtils.closeStream(decompressBuffer);
if (valDecompressor != null) {
// Make sure we only return valDecompressor once.
CodecPool.returnDecompressor(valDecompressor);
valDecompressor = null;
}
}
}
@Override
public int compareTo(Object arg0) {
throw new RuntimeException("compareTo not supported in class "
+ this.getClass().getName());
}
}
/**
* Create a metadata object with alternating key-value pairs.
* Eg. metadata(key1, value1, key2, value2)
*/
public static Metadata createMetadata(Text... values) {
if (values.length % 2 != 0) {
throw new IllegalArgumentException("Must have a matched set of " +
"key-value pairs. " + values.length+
" strings supplied.");
}
Metadata result = new Metadata();
for(int i=0; i < values.length; i += 2) {
result.set(values[i], values[i+1]);
}
return result;
}
/**
* Write KeyBuffer/ValueBuffer pairs to a RCFile. RCFile's format is
* compatible with SequenceFile's.
*
*/
public static class Writer {
Configuration conf;
FSDataOutputStream out;
CompressionCodec codec = null;
Metadata metadata = null;
// Insert a globally unique 16-byte value every few entries, so that one
// can seek into the middle of a file and then synchronize with record
// starts and ends by scanning for this value.
long lastSyncPos; // position of last sync
byte[] sync; // 16 random bytes
{
try {
MessageDigest digester = MessageDigest.getInstance("MD5");
long time = System.currentTimeMillis();
digester.update((new UID() + "@" + time).getBytes());
sync = digester.digest();
} catch (Exception e) {
throw new RuntimeException(e);
}
}
// how many records the writer buffers before it writes to disk
private int RECORD_INTERVAL = Integer.MAX_VALUE;
// the max size of memory for buffering records before writes them out
private int columnsBufferSize = 4 * 1024 * 1024; // 4M
// the conf string for COLUMNS_BUFFER_SIZE
public static String COLUMNS_BUFFER_SIZE_CONF_STR = "hive.io.rcfile.record.buffer.size";
// how many records already buffered
private int bufferedRecords = 0;
private final ColumnBuffer[] columnBuffers;
private int columnNumber = 0;
private final int[] columnValuePlainLength;
KeyBuffer key = null;
private final int[] plainTotalColumnLength;
private final int[] comprTotalColumnLength;
boolean useNewMagic = true;
/*
* used for buffering appends before flush them out
*/
class ColumnBuffer {
// used for buffer a column's values
NonSyncDataOutputBuffer columnValBuffer;
// used to store each value's length
NonSyncDataOutputBuffer valLenBuffer;
/*
* use a run-length encoding. We only record run length if a same
* 'prevValueLen' occurs more than one time. And we negative the run
* length to distinguish a runLength and a normal value length. For
* example, if the values' lengths are 1,1,1,2, we record 1, ~2,2. And for
* value lengths 1,2,3 we record 1,2,3.
*/
int runLength = 0;
int prevValueLength = -1;
ColumnBuffer() throws IOException {
columnValBuffer = new NonSyncDataOutputBuffer();
valLenBuffer = new NonSyncDataOutputBuffer();
}
public void append(BytesRefWritable data) throws IOException {
data.writeDataTo(columnValBuffer);
int currentLen = data.getLength();
if (prevValueLength < 0) {
startNewGroup(currentLen);
return;
}
if (currentLen != prevValueLength) {
flushGroup();
startNewGroup(currentLen);
} else {
runLength++;
}
}
private void startNewGroup(int currentLen) {
prevValueLength = currentLen;
runLength = 0;
}
public void clear() throws IOException {
valLenBuffer.reset();
columnValBuffer.reset();
prevValueLength = -1;
runLength = 0;
}
public void flushGroup() throws IOException {
if (prevValueLength >= 0) {
WritableUtils.writeVLong(valLenBuffer, prevValueLength);
if (runLength > 0) {
WritableUtils.writeVLong(valLenBuffer, ~runLength);
}
runLength = -1;
prevValueLength = -1;
}
}
}
public long getLength() throws IOException {
return out.getPos();
}
/** Constructs a RCFile Writer. */
public Writer(FileSystem fs, Configuration conf, Path name) throws IOException {
this(fs, conf, name, null, new Metadata(), null);
}
/**
* Constructs a RCFile Writer.
*
* @param fs
* the file system used
* @param conf
* the configuration file
* @param name
* the file name
* @throws IOException
*/
public Writer(FileSystem fs, Configuration conf, Path name,
Progressable progress, CompressionCodec codec) throws IOException {
this(fs, conf, name, progress, new Metadata(), codec);
}
/**
* Constructs a RCFile Writer.
*
* @param fs
* the file system used
* @param conf
* the configuration file
* @param name
* the file name
* @param progress a progress meter to update as the file is written
* @param metadata a string to string map in the file header
* @throws IOException
*/
public Writer(FileSystem fs, Configuration conf, Path name,
Progressable progress, Metadata metadata, CompressionCodec codec) throws IOException {
this(fs, conf, name, fs.getConf().getInt("io.file.buffer.size", 4096),
ShimLoader.getHadoopShims().getDefaultReplication(fs, name),
ShimLoader.getHadoopShims().getDefaultBlockSize(fs, name), progress,
metadata, codec);
}
/**
*
* Constructs a RCFile Writer.
*
* @param fs
* the file system used
* @param conf
* the configuration file
* @param name
* the file name
* @param bufferSize the size of the file buffer
* @param replication the number of replicas for the file
* @param blockSize the block size of the file
* @param progress the progress meter for writing the file
* @param metadata a string to string map in the file header
* @throws IOException
*/
public Writer(FileSystem fs, Configuration conf, Path name, int bufferSize,
short replication, long blockSize, Progressable progress,
Metadata metadata, CompressionCodec codec) throws IOException {
RECORD_INTERVAL = conf.getInt(RECORD_INTERVAL_CONF_STR, RECORD_INTERVAL);
columnNumber = conf.getInt(COLUMN_NUMBER_CONF_STR, 0);
if (metadata == null) {
metadata = new Metadata();
}
metadata.set(new Text(COLUMN_NUMBER_METADATA_STR), new Text(""
+ columnNumber));
columnsBufferSize = conf.getInt(COLUMNS_BUFFER_SIZE_CONF_STR,
4 * 1024 * 1024);
columnValuePlainLength = new int[columnNumber];
columnBuffers = new ColumnBuffer[columnNumber];
for (int i = 0; i < columnNumber; i++) {
columnBuffers[i] = new ColumnBuffer();
}
init(conf, fs.create(name, true, bufferSize, replication,
blockSize, progress), codec, metadata);
initializeFileHeader();
writeFileHeader();
finalizeFileHeader();
key = new KeyBuffer(columnNumber);
plainTotalColumnLength = new int[columnNumber];
comprTotalColumnLength = new int[columnNumber];
}
/** Write the initial part of file header. */
void initializeFileHeader() throws IOException {
if (useNewMagic) {
out.write(MAGIC);
out.write(CURRENT_VERSION);
} else {
out.write(ORIGINAL_MAGIC_VERSION);
}
}
/** Write the final part of file header. */
void finalizeFileHeader() throws IOException {
out.write(sync); // write the sync bytes
out.flush(); // flush header
}
boolean isCompressed() {
return codec != null;
}
/** Write and flush the file header. */
void writeFileHeader() throws IOException {
if (useNewMagic) {
out.writeBoolean(isCompressed());
} else {
Text.writeString(out, KeyBuffer.class.getName());
Text.writeString(out, ValueBuffer.class.getName());
out.writeBoolean(isCompressed());
out.writeBoolean(false);
}
if (isCompressed()) {
Text.writeString(out, (codec.getClass()).getName());
}
metadata.write(out);
}
void init(Configuration conf, FSDataOutputStream out,
CompressionCodec codec, Metadata metadata) throws IOException {
this.conf = conf;
this.out = out;
this.codec = codec;
this.metadata = metadata;
this.useNewMagic =
conf.getBoolean(HiveConf.ConfVars.HIVEUSEEXPLICITRCFILEHEADER.varname, true);
}
/** Returns the compression codec of data in this file. */
@SuppressWarnings("unused")
@Deprecated
public CompressionCodec getCompressionCodec() {
return codec;
}
/** create a sync point. */
public void sync() throws IOException {
if (sync != null && lastSyncPos != out.getPos()) {
out.writeInt(SYNC_ESCAPE); // mark the start of the sync
out.write(sync); // write sync
lastSyncPos = out.getPos(); // update lastSyncPos
}
}
/** Returns the configuration of this file. */
@SuppressWarnings("unused")
@Deprecated
Configuration getConf() {
return conf;
}
private void checkAndWriteSync() throws IOException {
if (sync != null && out.getPos() >= lastSyncPos + SYNC_INTERVAL) {
sync();
}
}
private int columnBufferSize = 0;
/**
* Append a row of values. Currently it only can accept <
* {@link BytesRefArrayWritable}. If its <code>size()</code> is less than the
* column number in the file, zero bytes are appended for the empty columns.
* If its size() is greater then the column number in the file, the exceeded
* columns' bytes are ignored.
*
* @param val a BytesRefArrayWritable with the list of serialized columns
* @throws IOException
*/
public void append(Writable val) throws IOException {
if (!(val instanceof BytesRefArrayWritable)) {
throw new UnsupportedOperationException(
"Currently the writer can only accept BytesRefArrayWritable");
}
BytesRefArrayWritable columns = (BytesRefArrayWritable) val;
int size = columns.size();
for (int i = 0; i < size; i++) {
BytesRefWritable cu = columns.get(i);
int plainLen = cu.getLength();
columnBufferSize += plainLen;
columnValuePlainLength[i] += plainLen;
columnBuffers[i].append(cu);
}
if (size < columnNumber) {
for (int i = columns.size(); i < columnNumber; i++) {
columnBuffers[i].append(BytesRefWritable.ZeroBytesRefWritable);
}
}
bufferedRecords++;
if ((columnBufferSize > columnsBufferSize)
|| (bufferedRecords >= RECORD_INTERVAL)) {
flushRecords();
}
}
private void flushRecords() throws IOException {
key.numberRows = bufferedRecords;
Compressor compressor = null;
NonSyncDataOutputBuffer valueBuffer = null;
CompressionOutputStream deflateFilter = null;
DataOutputStream deflateOut = null;
boolean isCompressed = isCompressed();
int valueLength = 0;
if (isCompressed) {
ReflectionUtils.setConf(codec, this.conf);
compressor = CodecPool.getCompressor(codec);
valueBuffer = new NonSyncDataOutputBuffer();
deflateFilter = codec.createOutputStream(valueBuffer, compressor);
deflateOut = new DataOutputStream(deflateFilter);
}
for (int columnIndex = 0; columnIndex < columnNumber; columnIndex++) {
ColumnBuffer currentBuf = columnBuffers[columnIndex];
currentBuf.flushGroup();
NonSyncDataOutputBuffer columnValue = currentBuf.columnValBuffer;
int colLen;
int plainLen = columnValuePlainLength[columnIndex];
if (isCompressed) {
if (deflateFilter instanceof SchemaAwareCompressionOutputStream) {
((SchemaAwareCompressionOutputStream)deflateFilter).
setColumnIndex(columnIndex);
}
deflateFilter.resetState();
deflateOut.write(columnValue.getData(), 0, columnValue.getLength());
deflateOut.flush();
deflateFilter.finish();
// find how much compressed data was added for this column
colLen = valueBuffer.getLength() - valueLength;
} else {
colLen = columnValuePlainLength[columnIndex];
}
valueLength += colLen;
key.setColumnLenInfo(colLen, currentBuf.valLenBuffer, plainLen,
columnIndex);
plainTotalColumnLength[columnIndex] += plainLen;
comprTotalColumnLength[columnIndex] += colLen;
columnValuePlainLength[columnIndex] = 0;
}
int keyLength = key.getSize();
if (keyLength < 0) {
throw new IOException("negative length keys not allowed: " + key);
}
if (compressor != null) {
CodecPool.returnCompressor(compressor);
}
// Write the key out
writeKey(key, keyLength + valueLength, keyLength);
// write the value out
if (isCompressed) {
out.write(valueBuffer.getData(), 0, valueBuffer.getLength());
} else {
for(int columnIndex=0; columnIndex < columnNumber; ++columnIndex) {
NonSyncDataOutputBuffer buf =
columnBuffers[columnIndex].columnValBuffer;
out.write(buf.getData(), 0, buf.getLength());
}
}
// clear the columnBuffers
clearColumnBuffers();
bufferedRecords = 0;
columnBufferSize = 0;
}
/**
* flush a block out without doing anything except compressing the key part.
*/
public void flushBlock(KeyBuffer keyBuffer, ValueBuffer valueBuffer,
int recordLen, int keyLength,
@SuppressWarnings("unused") int compressedKeyLen) throws IOException {
writeKey(keyBuffer, recordLen, keyLength);
valueBuffer.write(out);
}
private void writeKey(KeyBuffer keyBuffer, int recordLen,
int keyLength) throws IOException {
checkAndWriteSync(); // sync
out.writeInt(recordLen); // total record length
out.writeInt(keyLength); // key portion length
if(this.isCompressed()) {
Compressor compressor = CodecPool.getCompressor(codec);
NonSyncDataOutputBuffer compressionBuffer =
new NonSyncDataOutputBuffer();
CompressionOutputStream deflateFilter =
codec.createOutputStream(compressionBuffer, compressor);
DataOutputStream deflateOut = new DataOutputStream(deflateFilter);
//compress key and write key out
compressionBuffer.reset();
deflateFilter.resetState();
keyBuffer.write(deflateOut);
deflateOut.flush();
deflateFilter.finish();
int compressedKeyLen = compressionBuffer.getLength();
out.writeInt(compressedKeyLen);
out.write(compressionBuffer.getData(), 0, compressedKeyLen);
CodecPool.returnCompressor(compressor);
} else {
out.writeInt(keyLength);
keyBuffer.write(out);
}
}
private void clearColumnBuffers() throws IOException {
for (int i = 0; i < columnNumber; i++) {
columnBuffers[i].clear();
}
}
public synchronized void close() throws IOException {
if (bufferedRecords > 0) {
flushRecords();
}
clearColumnBuffers();
if (out != null) {
// Close the underlying stream if we own it...
out.flush();
out.close();
out = null;
}
for (int i = 0; i < columnNumber; i++) {
LOG.info("Column#" + i + " : Plain Total Column Value Length: "
+ plainTotalColumnLength[i]
+ ", Compr Total Column Value Length: " + comprTotalColumnLength[i]);
}
}
}
/**
* Read KeyBuffer/ValueBuffer pairs from a RCFile.
*
*/
public static class Reader {
private static class SelectedColumn {
public int colIndex;
public int rowReadIndex;
public int runLength;
public int prvLength;
public boolean isNulled;
}
private final Path file;
private final FSDataInputStream in;
private byte version;
private CompressionCodec codec = null;
private Metadata metadata = null;
private final byte[] sync = new byte[SYNC_HASH_SIZE];
private final byte[] syncCheck = new byte[SYNC_HASH_SIZE];
private boolean syncSeen;
private long lastSeenSyncPos = 0;
private long headerEnd;
private final long end;
private int currentKeyLength;
private int currentRecordLength;
private final Configuration conf;
private final ValueBuffer currentValue;
private int readRowsIndexInBuffer = 0;
private int recordsNumInValBuffer = 0;
private int columnNumber = 0;
private int loadColumnNum;
private int passedRowsNum = 0;
// Should we try to tolerate corruption? Default is No.
private boolean tolerateCorruptions = false;
private boolean decompress = false;
private Decompressor keyDecompressor;
NonSyncDataOutputBuffer keyDecompressedData = new NonSyncDataOutputBuffer();
//Current state of each selected column - e.g. current run length, etc.
// The size of the array is equal to the number of selected columns
private final SelectedColumn[] selectedColumns;
// map of original column id -> index among selected columns
private final int[] revPrjColIDs;
// column value lengths for each of the selected columns
private final NonSyncDataInputBuffer[] colValLenBufferReadIn;
/** Create a new RCFile reader. */
public Reader(FileSystem fs, Path file, Configuration conf) throws IOException {
this(fs, file, conf.getInt("io.file.buffer.size", 4096), conf, 0, fs
.getFileStatus(file).getLen());
}
/** Create a new RCFile reader. */
public Reader(FileSystem fs, Path file, int bufferSize, Configuration conf,
long start, long length) throws IOException {
tolerateCorruptions = conf.getBoolean(
TOLERATE_CORRUPTIONS_CONF_STR, false);
conf.setInt("io.file.buffer.size", bufferSize);
this.file = file;
in = openFile(fs, file, bufferSize, length);
this.conf = conf;
end = start + length;
boolean succeed = false;
try {
if (start > 0) {
seek(0);
init();
seek(start);
} else {
init();
}
succeed = true;
} finally {
if (!succeed) {
if (in != null) {
try {
in.close();
} catch(IOException e) {
if (LOG != null && LOG.isDebugEnabled()) {
LOG.debug("Exception in closing " + in, e);
}
}
}
}
}
columnNumber = Integer.parseInt(metadata.get(
new Text(COLUMN_NUMBER_METADATA_STR)).toString());
List<Integer> notSkipIDs = ColumnProjectionUtils
.getReadColumnIDs(conf);
boolean[] skippedColIDs = new boolean[columnNumber];
if(ColumnProjectionUtils.isReadAllColumns(conf)) {
Arrays.fill(skippedColIDs, false);
} else if (notSkipIDs.size() > 0) {
Arrays.fill(skippedColIDs, true);
for (int read : notSkipIDs) {
if (read < columnNumber) {
skippedColIDs[read] = false;
}
}
} else {
// select count(1)
Arrays.fill(skippedColIDs, true);
}
loadColumnNum = columnNumber;
if (skippedColIDs.length > 0) {
for (boolean skippedColID : skippedColIDs) {
if (skippedColID) {
loadColumnNum -= 1;
}
}
}
revPrjColIDs = new int[columnNumber];
// get list of selected column IDs
selectedColumns = new SelectedColumn[loadColumnNum];
colValLenBufferReadIn = new NonSyncDataInputBuffer[loadColumnNum];
for (int i = 0, j = 0; i < columnNumber; ++i) {
if (!skippedColIDs[i]) {
SelectedColumn col = new SelectedColumn();
col.colIndex = i;
col.runLength = 0;
col.prvLength = -1;
col.rowReadIndex = 0;
selectedColumns[j] = col;
colValLenBufferReadIn[j] = new NonSyncDataInputBuffer();
revPrjColIDs[i] = j;
j++;
} else {
revPrjColIDs[i] = -1;
}
}
currentKey = createKeyBuffer();
boolean lazyDecompress = !tolerateCorruptions;
currentValue = new ValueBuffer(
null, columnNumber, skippedColIDs, codec, lazyDecompress);
}
/**
* Return the metadata (Text to Text map) that was written into the
* file.
*/
public Metadata getMetadata() {
return metadata;
}
/**
* Return the metadata value associated with the given key.
* @param key the metadata key to retrieve
*/
public Text getMetadataValueOf(Text key) {
return metadata.get(key);
}
/**
* Override this method to specialize the type of
* {@link FSDataInputStream} returned.
*/
protected FSDataInputStream openFile(FileSystem fs, Path file,
int bufferSize, long length) throws IOException {
return fs.open(file, bufferSize);
}
private void init() throws IOException {
byte[] magic = new byte[MAGIC.length];
in.readFully(magic);
if (Arrays.equals(magic, ORIGINAL_MAGIC)) {
byte vers = in.readByte();
if (vers != ORIGINAL_MAGIC_VERSION_WITH_METADATA) {
throw new IOException(file + " is a version " + vers +
" SequenceFile instead of an RCFile.");
}
version = ORIGINAL_VERSION;
} else {
if (!Arrays.equals(magic, MAGIC)) {
throw new IOException(file + " not a RCFile and has magic of " +
new String(magic));
}
// Set 'version'
version = in.readByte();
if (version > CURRENT_VERSION) {
throw new VersionMismatchException((byte) CURRENT_VERSION, version);
}
}
if (version == ORIGINAL_VERSION) {
try {
Class<?> keyCls = conf.getClassByName(Text.readString(in));
Class<?> valCls = conf.getClassByName(Text.readString(in));
if (!keyCls.equals(KeyBuffer.class)
|| !valCls.equals(ValueBuffer.class)) {
throw new IOException(file + " not a RCFile");
}
} catch (ClassNotFoundException e) {
throw new IOException(file + " not a RCFile", e);
}
}
decompress = in.readBoolean(); // is compressed?
if (version == ORIGINAL_VERSION) {
// is block-compressed? it should be always false.
boolean blkCompressed = in.readBoolean();
if (blkCompressed) {
throw new IOException(file + " not a RCFile.");
}
}
// setup the compression codec
if (decompress) {
String codecClassname = Text.readString(in);
try {
Class<? extends CompressionCodec> codecClass = conf.getClassByName(
codecClassname).asSubclass(CompressionCodec.class);
codec = ReflectionUtils.newInstance(codecClass, conf);
} catch (ClassNotFoundException cnfe) {
throw new IllegalArgumentException(
"Unknown codec: " + codecClassname, cnfe);
}
keyDecompressor = CodecPool.getDecompressor(codec);
}
metadata = new Metadata();
metadata.readFields(in);
in.readFully(sync); // read sync bytes
headerEnd = in.getPos();
}
/** Return the current byte position in the input file. */
public synchronized long getPosition() throws IOException {
return in.getPos();
}
/**
* Set the current byte position in the input file.
*
* <p>
* The position passed must be a position returned by
* {@link RCFile.Writer#getLength()} when writing this file. To seek to an
* arbitrary position, use {@link RCFile.Reader#sync(long)}. In another
* words, the current seek can only seek to the end of the file. For other
* positions, use {@link RCFile.Reader#sync(long)}.
*/
public synchronized void seek(long position) throws IOException {
in.seek(position);
}
/**
* Resets the values which determine if there are more rows in the buffer
*
* This can be used after one calls seek or sync, if one called next before that.
* Otherwise, the seek or sync will have no effect, it will continue to get rows from the
* buffer built up from the call to next.
*/
public synchronized void resetBuffer() {
readRowsIndexInBuffer = 0;
recordsNumInValBuffer = 0;
}
/** Seek to the next sync mark past a given position. */
public synchronized void sync(long position) throws IOException {
if (position + SYNC_SIZE >= end) {
seek(end);
return;
}
//this is to handle syn(pos) where pos < headerEnd.
if (position < headerEnd) {
// seek directly to first record
in.seek(headerEnd);
// note the sync marker "seen" in the header
syncSeen = true;
return;
}
try {
seek(position + 4); // skip escape
int prefix = sync.length;
int n = conf.getInt("io.bytes.per.checksum", 512);
byte[] buffer = new byte[prefix+n];
n = (int)Math.min(n, end - in.getPos());
/* fill array with a pattern that will never match sync */
Arrays.fill(buffer, (byte)(~sync[0]));
while(n > 0 && (in.getPos() + n) <= end) {
position = in.getPos();
in.readFully(buffer, prefix, n);
/* the buffer has n+sync bytes */
for(int i = 0; i < n; i++) {
int j;
for(j = 0; j < sync.length && sync[j] == buffer[i+j]; j++) {
/* nothing */
}
if(j == sync.length) {
/* simplified from (position + (i - prefix) + sync.length) - SYNC_SIZE */
in.seek(position + i - SYNC_SIZE);
return;
}
}
/* move the last 16 bytes to the prefix area */
System.arraycopy(buffer, buffer.length - prefix, buffer, 0, prefix);
n = (int)Math.min(n, end - in.getPos());
}
} catch (ChecksumException e) { // checksum failure
handleChecksumException(e);
}
}
private void handleChecksumException(ChecksumException e) throws IOException {
if (conf.getBoolean("io.skip.checksum.errors", false)) {
LOG.warn("Bad checksum at " + getPosition() + ". Skipping entries.");
sync(getPosition() + conf.getInt("io.bytes.per.checksum", 512));
} else {
throw e;
}
}
private KeyBuffer createKeyBuffer() {
return new KeyBuffer(columnNumber);
}
/**
* Read and return the next record length, potentially skipping over a sync
* block.
*
* @return the length of the next record or -1 if there is no next record
* @throws IOException
*/
private synchronized int readRecordLength() throws IOException {
if (in.getPos() >= end) {
return -1;
}
int length = in.readInt();
if (sync != null && length == SYNC_ESCAPE) { // process
// a
// sync entry
lastSeenSyncPos = in.getPos() - 4; // minus SYNC_ESCAPE's length
in.readFully(syncCheck); // read syncCheck
if (!Arrays.equals(sync, syncCheck)) {
throw new IOException("File is corrupt!");
}
syncSeen = true;
if (in.getPos() >= end) {
return -1;
}
length = in.readInt(); // re-read length
} else {
syncSeen = false;
}
return length;
}
private void seekToNextKeyBuffer() throws IOException {
if (!keyInit) {
return;
}
if (!currentValue.inited) {
in.skip(currentRecordLength - currentKeyLength);
}
}
private int compressedKeyLen = 0;
NonSyncDataInputBuffer keyDataIn = new NonSyncDataInputBuffer();
NonSyncDataInputBuffer keyDecompressBuffer = new NonSyncDataInputBuffer();
NonSyncDataOutputBuffer keyTempBuffer = new NonSyncDataOutputBuffer();
KeyBuffer currentKey = null;
boolean keyInit = false;
protected int nextKeyBuffer() throws IOException {
seekToNextKeyBuffer();
currentRecordLength = readRecordLength();
if (currentRecordLength == -1) {
keyInit = false;
return -1;
}
currentKeyLength = in.readInt();
compressedKeyLen = in.readInt();
if (decompress) {
keyTempBuffer.reset();
keyTempBuffer.write(in, compressedKeyLen);
keyDecompressBuffer.reset(keyTempBuffer.getData(), compressedKeyLen);
CompressionInputStream deflatFilter = codec.createInputStream(
keyDecompressBuffer, keyDecompressor);
DataInputStream compressedIn = new DataInputStream(deflatFilter);
deflatFilter.resetState();
keyDecompressedData.reset();
keyDecompressedData.write(compressedIn, currentKeyLength);
keyDataIn.reset(keyDecompressedData.getData(), currentKeyLength);
currentKey.readFields(keyDataIn);
} else {
currentKey.readFields(in);
}
keyInit = true;
currentValue.inited = false;
readRowsIndexInBuffer = 0;
recordsNumInValBuffer = currentKey.numberRows;
for (int selIx = 0; selIx < selectedColumns.length; selIx++) {
SelectedColumn col = selectedColumns[selIx];
int colIx = col.colIndex;
NonSyncDataOutputBuffer buf = currentKey.allCellValLenBuffer[colIx];
colValLenBufferReadIn[selIx].reset(buf.getData(), buf.getLength());
col.rowReadIndex = 0;
col.runLength = 0;
col.prvLength = -1;
col.isNulled = colValLenBufferReadIn[selIx].getLength() == 0;
}
return currentKeyLength;
}
protected void currentValueBuffer() throws IOException {
if (!keyInit) {
nextKeyBuffer();
}
currentValue.keyBuffer = currentKey;
currentValue.clearColumnBuffer();
currentValue.readFields(in);
currentValue.inited = true;
}
public boolean nextBlock() throws IOException {
int keyLength = nextKeyBuffer();
if(keyLength > 0) {
currentValueBuffer();
return true;
}
return false;
}
private boolean rowFetched = false;
// use this buffer to hold column's cells value length for usages in
// getColumn(), instead of using colValLenBufferReadIn directly.
private final NonSyncDataInputBuffer fetchColumnTempBuf = new NonSyncDataInputBuffer();
/**
* Fetch all data in the buffer for a given column. This is useful for
* columnar operators, which perform operations on an array data of one
* column. It should be used together with {@link #nextColumnsBatch()}.
* Calling getColumn() with not change the result of
* {@link #next(LongWritable)} and
* {@link #getCurrentRow(BytesRefArrayWritable)}.
*
* @param columnID the number of the column to get 0 to N-1
* @throws IOException
*/
public BytesRefArrayWritable getColumn(int columnID,
BytesRefArrayWritable rest) throws IOException {
int selColIdx = revPrjColIDs[columnID];
if (selColIdx == -1) {
return null;
}
if (rest == null) {
rest = new BytesRefArrayWritable();
}
rest.resetValid(recordsNumInValBuffer);
if (!currentValue.inited) {
currentValueBuffer();
}
int columnNextRowStart = 0;
fetchColumnTempBuf.reset(currentKey.allCellValLenBuffer[columnID]
.getData(), currentKey.allCellValLenBuffer[columnID].getLength());
SelectedColumn selCol = selectedColumns[selColIdx];
byte[] uncompData = null;
ValueBuffer.LazyDecompressionCallbackImpl decompCallBack = null;
boolean decompressed = currentValue.decompressedFlag[selColIdx];
if (decompressed) {
uncompData =
currentValue.loadedColumnsValueBuffer[selColIdx].getData();
} else {
decompCallBack = currentValue.lazyDecompressCallbackObjs[selColIdx];
}
for (int i = 0; i < recordsNumInValBuffer; i++) {
colAdvanceRow(selColIdx, selCol);
int length = selCol.prvLength;
BytesRefWritable currentCell = rest.get(i);
if (decompressed) {
currentCell.set(uncompData, columnNextRowStart, length);
} else {
currentCell.set(decompCallBack, columnNextRowStart, length);
}
columnNextRowStart = columnNextRowStart + length;
}
return rest;
}
/**
* Read in next key buffer and throw any data in current key buffer and
* current value buffer. It will influence the result of
* {@link #next(LongWritable)} and
* {@link #getCurrentRow(BytesRefArrayWritable)}
*
* @return whether there still has records or not
* @throws IOException
*/
@SuppressWarnings("unused")
@Deprecated
public synchronized boolean nextColumnsBatch() throws IOException {
passedRowsNum += (recordsNumInValBuffer - readRowsIndexInBuffer);
return nextKeyBuffer() > 0;
}
/**
* Returns how many rows we fetched with next(). It only means how many rows
* are read by next(). The returned result may be smaller than actual number
* of rows passed by, because {@link #seek(long)},
* {@link #nextColumnsBatch()} can change the underlying key buffer and
* value buffer.
*
* @return next row number
* @throws IOException
*/
public synchronized boolean next(LongWritable readRows) throws IOException {
if (hasRecordsInBuffer()) {
readRows.set(passedRowsNum);
readRowsIndexInBuffer++;
passedRowsNum++;
rowFetched = false;
return true;
} else {
keyInit = false;
}
int ret = -1;
if (tolerateCorruptions) {
ret = nextKeyValueTolerateCorruptions();
} else {
try {
ret = nextKeyBuffer();
} catch (EOFException eof) {
eof.printStackTrace();
}
}
return (ret > 0) && next(readRows);
}
private int nextKeyValueTolerateCorruptions() throws IOException {
long currentOffset = in.getPos();
int ret;
try {
ret = nextKeyBuffer();
this.currentValueBuffer();
} catch (IOException ioe) {
// A BlockMissingException indicates a temporary error,
// not a corruption. Re-throw this exception.
String msg = ioe.getMessage();
if (msg != null && msg.startsWith(BLOCK_MISSING_MESSAGE)) {
LOG.warn("Re-throwing block-missing exception" + ioe);
throw ioe;
}
// We have an IOException other than a BlockMissingException.
LOG.warn("Ignoring IOException in file " + file +
" after offset " + currentOffset, ioe);
ret = -1;
} catch (Throwable t) {
// We got an exception that is not IOException
// (typically OOM, IndexOutOfBounds, InternalError).
// This is most likely a corruption.
LOG.warn("Ignoring unknown error in " + file +
" after offset " + currentOffset, t);
ret = -1;
}
return ret;
}
public boolean hasRecordsInBuffer() {
return readRowsIndexInBuffer < recordsNumInValBuffer;
}
/**
* get the current row used,make sure called {@link #next(LongWritable)}
* first.
*
* @throws IOException
*/
public synchronized void getCurrentRow(BytesRefArrayWritable ret) throws IOException {
if (!keyInit || rowFetched) {
return;
}
if (tolerateCorruptions) {
if (!currentValue.inited) {
currentValueBuffer();
}
ret.resetValid(columnNumber);
} else {
if (!currentValue.inited) {
currentValueBuffer();
// do this only when not initialized, but we may need to find a way to
// tell the caller how to initialize the valid size
ret.resetValid(columnNumber);
}
}
// we do not use BytesWritable here to avoid the byte-copy from
// DataOutputStream to BytesWritable
if (currentValue.numCompressed > 0) {
for (int j = 0; j < selectedColumns.length; ++j) {
SelectedColumn col = selectedColumns[j];
int i = col.colIndex;
if (col.isNulled) {
ret.set(i, null);
} else {
BytesRefWritable ref = ret.unCheckedGet(i);
colAdvanceRow(j, col);
if (currentValue.decompressedFlag[j]) {
ref.set(currentValue.loadedColumnsValueBuffer[j].getData(),
col.rowReadIndex, col.prvLength);
} else {
ref.set(currentValue.lazyDecompressCallbackObjs[j],
col.rowReadIndex, col.prvLength);
}
col.rowReadIndex += col.prvLength;
}
}
} else {
// This version of the loop eliminates a condition check and branch
// and is measurably faster (20% or so)
for (int j = 0; j < selectedColumns.length; ++j) {
SelectedColumn col = selectedColumns[j];
int i = col.colIndex;
if (col.isNulled) {
ret.set(i, null);
} else {
BytesRefWritable ref = ret.unCheckedGet(i);
colAdvanceRow(j, col);
ref.set(currentValue.loadedColumnsValueBuffer[j].getData(),
col.rowReadIndex, col.prvLength);
col.rowReadIndex += col.prvLength;
}
}
}
rowFetched = true;
}
/**
* Advance column state to the next now: update offsets, run lengths etc
* @param selCol - index among selectedColumns
* @param col - column object to update the state of. prvLength will be
* set to the new read position
* @throws IOException
*/
private void colAdvanceRow(int selCol, SelectedColumn col) throws IOException {
if (col.runLength > 0) {
--col.runLength;
} else {
int length = (int) WritableUtils.readVLong(colValLenBufferReadIn[selCol]);
if (length < 0) {
// we reach a runlength here, use the previous length and reset
// runlength
col.runLength = (~length) - 1;
} else {
col.prvLength = length;
col.runLength = 0;
}
}
}
/** Returns true iff the previous call to next passed a sync mark. */
@SuppressWarnings("unused")
public boolean syncSeen() {
return syncSeen;
}
/** Returns the last seen sync position. */
public long lastSeenSyncPos() {
return lastSeenSyncPos;
}
/** Returns the name of the file. */
@Override
public String toString() {
return file.toString();
}
@SuppressWarnings("unused")
public boolean isCompressedRCFile() {
return this.decompress;
}
/** Close the reader. */
public void close() {
IOUtils.closeStream(in);
currentValue.close();
if (decompress) {
IOUtils.closeStream(keyDecompressedData);
if (keyDecompressor != null) {
// Make sure we only return keyDecompressor once.
CodecPool.returnDecompressor(keyDecompressor);
keyDecompressor = null;
}
}
}
/**
* return the KeyBuffer object used in the reader. Internally in each
* reader, there is only one KeyBuffer object, which gets reused for every
* block.
*/
public KeyBuffer getCurrentKeyBufferObj() {
return this.currentKey;
}
/**
* return the ValueBuffer object used in the reader. Internally in each
* reader, there is only one ValueBuffer object, which gets reused for every
* block.
*/
public ValueBuffer getCurrentValueBufferObj() {
return this.currentValue;
}
//return the current block's length
public int getCurrentBlockLength() {
return this.currentRecordLength;
}
//return the current block's key length
public int getCurrentKeyLength() {
return this.currentKeyLength;
}
//return the current block's compressed key length
public int getCurrentCompressedKeyLen() {
return this.compressedKeyLen;
}
//return the CompressionCodec used for this file
public CompressionCodec getCompressionCodec() {
return this.codec;
}
}
}
| {
"pile_set_name": "Github"
} |
--- gnuplot-4.2.0/docs/Makefile.in 2006-08-09 23:09:48.000000000 +0200
+++ gnuplot/docs/Makefile.in 2007-06-20 15:59:32.000000000 +0200
@@ -70,8 +70,8 @@
INFO_DEPS = $(srcdir)/gnuplot.info
-CC = @CC@
-CPP = @CPP@
+CC = $(HOSTCC)
+CPP = $(CC) -E
DEFS = @DEFS@
DEFAULT_INCLUDES = -I. -I$(srcdir) -I.. -I$(top_builddir)
CPPFLAGS = @CPPFLAGS@
@@ -327,16 +327,20 @@
@rm -f alldoc2gih
./doc2gih $(srcdir)/gnuplot.doc gnuplot.gih
-doc2gih: doc2gih.o termdoc.o
- $(LINK) doc2gih.o termdoc.o $(LIBS)
+doc2gih: doc2gih.c termdoc.c
+ $(HOSTCC) -I../src -I../term \
+ -DHAVE_STRERROR -DHAVE_STDLIB_H -DHAVE_STDBOOL_H \
+ -DHAVE_STRING_H -DHAVE_MEMCPY doc2gih.c termdoc.c -o $@
# To include all terminals in the .gih file
allgih: alldoc2gih $(srcdir)/gnuplot.doc
@rm -f doc2gih
./alldoc2gih $(srcdir)/gnuplot.doc gnuplot.gih
-alldoc2gih: alldoc2gih.o termdoc.o
- $(LINK) alldoc2gih.o termdoc.o $(LIBS)
+alldoc2gih: alldoc2gih.c termdoc.c
+ $(HOSTCC) -I../src -I../term \
+ -DHAVE_STRERROR -DHAVE_STDLIB_H -DHAVE_STDBOOL_H \
+ -DHAVE_STRING_H -DHAVE_MEMCPY alldoc2gih.c termdoc.c -o $@
alldoc2gih.o: doc2gih.c $(BUILT_SOURCES)
$(COMPILE) -DALL_TERM_DOC -c $(srcdir)/doc2gih.c
| {
"pile_set_name": "Github"
} |
import { Base } from '../core/Base';
import { Value, VectorValue, ConstantValue, Random1D, Random2D, Random3D } from '../math/Value';
import { Vector3 } from '../math/Vector3';
import { Vector2 } from '../math/Vector2';
import { Particle } from './Particle';
interface IValueGetter1D {
get(): number;
}
interface IValueGetterND<T> {
get(out: T): T;
}
interface IParticleEmitterOption {
max?: number;
amount?: number;
life?: IValueGetter1D;
position?: IValueGetterND<Vector3>;
rotation?: IValueGetterND<Vector3>;
velocity?: IValueGetterND<Vector3>;
angularVelocity?: IValueGetterND<Vector3>;
spriteSize?: IValueGetter1D;
weight?: IValueGetter1D;
}
export class Emitter extends Base {
constructor(option?: IParticleEmitterOption);
max: number;
amount: number;
life: IValueGetter1D;
position: IValueGetterND<Vector3>;
rotation: IValueGetterND<Vector3>;
velocity: IValueGetterND<Vector3>;
angularVelocity: IValueGetterND<Vector3>;
spriteSize: IValueGetter1D;
weight: IValueGetter1D;
emit(out: Particle[]): void;
kill(particle: Particle): void;
static constant(constant: number): ConstantValue;
static vector<T>(vector: T): VectorValue<T>;
static random1D(min: number, max: number): Random1D;
static random2D(min: Vector2, max: Vector2): Random2D;
static random3D(min: Vector3, max: Vector3): Random3D;
}
| {
"pile_set_name": "Github"
} |
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1">
<title>EchoBot</title>
<style>
body {
margin: 0px;
padding: 0px;
font-family: Segoe UI;
}
html,
body {
height: 100%;
}
header {
background-image: url("data:image/svg+xml,%3Csvg version='1.1' id='Layer_1' xmlns='http://www.w3.org/2000/svg' xmlns:xlink='http://www.w3.org/1999/xlink' x='0px' y='0px' viewBox='0 0 4638.9 651.6' style='enable-background:new 0 0 4638.9 651.6;' xml:space='preserve'%3E%3Cstyle type='text/css'%3E .st0%7Bfill:%2355A0E0;%7D .st1%7Bfill:none;%7D .st2%7Bfill:%230058A8;%7D .st3%7Bfill:%23328BD8;%7D .st4%7Bfill:%23B6DCF1;%7D .st5%7Bopacity:0.2;fill:url(%23SVGID_1_);enable-background:new ;%7D%0A%3C/style%3E%3Crect y='1.1' class='st0' width='4640' height='646.3'/%3E%3Cpath class='st1' d='M3987.8,323.6L4310.3,1.1h-65.6l-460.1,460.1c-17.5,17.5-46.1,17.5-63.6,0L3260.9,1.1H0v646.3h3660.3 L3889,418.7c17.5-17.5,46.1-17.5,63.6,0l228.7,228.7h66.6l-260.2-260.2C3970.3,369.8,3970.3,341.1,3987.8,323.6z'/%3E%3Cpath class='st2' d='M3784.6,461.2L4244.7,1.1h-983.9l460.1,460.1C3738.4,478.7,3767.1,478.7,3784.6,461.2z'/%3E%3Cpath class='st3' d='M4640,1.1h-329.8l-322.5,322.5c-17.5,17.5-17.5,46.1,0,63.6l260.2,260.2H4640L4640,1.1L4640,1.1z'/%3E%3Cpath class='st4' d='M3889,418.8l-228.7,228.7h521.1l-228.7-228.7C3935.2,401.3,3906.5,401.3,3889,418.8z'/%3E%3ClinearGradient id='SVGID_1_' gradientUnits='userSpaceOnUse' x1='3713.7576' y1='438.1175' x2='3911.4084' y2='14.2535' gradientTransform='matrix(1 0 0 -1 0 641.3969)'%3E%3Cstop offset='0' style='stop-color:%23FFFFFF;stop-opacity:0.5'/%3E%3Cstop offset='1' style='stop-color:%23FFFFFF'/%3E%3C/linearGradient%3E%3Cpath class='st5' d='M3952.7,124.5c-17.5-17.5-46.1-17.5-63.6,0l-523,523h1109.6L3952.7,124.5z'/%3E%3C/svg%3E%0A");
background-repeat: no-repeat;
background-size: 100%;
background-position: right;
background-color: #55A0E0;
width: 100%;
font-size: 44px;
height: 120px;
color: white;
padding: 30px 0 40px 0px;
display: inline-block;
}
.header-icon {
background-image: url("data:image/svg+xml;utf8,%3Csvg%20version%3D%221.1%22%20id%3D%22Layer_1%22%20xmlns%3D%22http%3A//www.w3.org/2000/svg%22%20xmlns%3Axlink%3D%22http%3A//www.w3.org/1999/xlink%22%20x%3D%220px%22%20y%3D%220px%22%0A%09%20viewBox%3D%220%200%20150.2%20125%22%20style%3D%22enable-background%3Anew%200%200%20150.2%20125%3B%22%20xml%3Aspace%3D%22preserve%22%3E%0A%3Cstyle%20type%3D%22text/css%22%3E%0A%09.st0%7Bfill%3Anone%3B%7D%0A%09.st1%7Bfill%3A%23FFFFFF%3B%7D%0A%3C/style%3E%0A%3Crect%20x%3D%220.5%22%20class%3D%22st0%22%20width%3D%22149.7%22%20height%3D%22125%22/%3E%0A%3Cg%3E%0A%09%3Cpath%20class%3D%22st1%22%20d%3D%22M59%2C102.9L21.8%2C66c-3.5-3.5-3.5-9.1%2C0-12.5l37-36.5l2.9%2C3l-37%2C36.4c-1.8%2C1.8-1.8%2C4.7%2C0%2C6.6l37.2%2C37L59%2C102.9z%22%0A%09%09/%3E%0A%3C/g%3E%0A%3Cg%3E%0A%09%3Cpath%20class%3D%22st1%22%20d%3D%22M92.5%2C102.9l-3-3l37.2-37c0.9-0.9%2C1.4-2%2C1.4-3.3c0-1.2-0.5-2.4-1.4-3.3L89.5%2C20l2.9-3l37.2%2C36.4%0A%09%09c1.7%2C1.7%2C2.6%2C3.9%2C2.6%2C6.3s-0.9%2C4.6-2.6%2C6.3L92.5%2C102.9z%22/%3E%0A%3C/g%3E%0A%3Cg%3E%0A%09%3Cpath%20class%3D%22st1%22%20d%3D%22M90.1%2C68.4c-4.5%2C0-8-3.5-8-8.1c0-4.5%2C3.5-8.1%2C8-8.1c4.4%2C0%2C8%2C3.7%2C8%2C8.1C98.1%2C64.7%2C94.4%2C68.4%2C90.1%2C68.4z%0A%09%09%20M90.1%2C56.5c-2.2%2C0-3.8%2C1.7-3.8%2C3.9c0%2C2.2%2C1.7%2C3.9%2C3.8%2C3.9c1.9%2C0%2C3.8-1.6%2C3.8-3.9S91.9%2C56.5%2C90.1%2C56.5z%22/%3E%0A%3C/g%3E%0A%3Cg%3E%0A%09%3Cpath%20class%3D%22st1%22%20d%3D%22M61.4%2C68.4c-4.5%2C0-8-3.5-8-8.1c0-4.5%2C3.5-8.1%2C8-8.1c4.4%2C0%2C8%2C3.7%2C8%2C8.1C69.5%2C64.7%2C65.8%2C68.4%2C61.4%2C68.4z%0A%09%09%20M61.4%2C56.5c-2.2%2C0-3.8%2C1.7-3.8%2C3.9c0%2C2.2%2C1.7%2C3.9%2C3.8%2C3.9c1.9%2C0%2C3.8-1.6%2C3.8-3.9S63.3%2C56.5%2C61.4%2C56.5z%22/%3E%0A%3C/g%3E%0A%3C/svg%3E%0A");
background-repeat: no-repeat;
float: left;
height: 140px;
width: 140px;
display: inline-block;
vertical-align: middle;
}
.header-text {
padding-left: 1%;
color: #FFFFFF;
font-family: "Segoe UI";
font-size: 72px;
font-weight: 300;
letter-spacing: 0.35px;
line-height: 96px;
display: inline-block;
vertical-align: middle;
}
.header-inner-container {
min-width: 480px;
max-width: 1366px;
margin-left: auto;
margin-right: auto;
vertical-align: middle;
}
.header-inner-container::after {
content: "";
clear: both;
display: table;
}
.main-content-area {
padding-left: 30px;
}
.content-title {
color: #000000;
font-family: "Segoe UI";
font-size: 46px;
font-weight: 300;
line-height: 62px;
}
.main-text {
color: #808080;
font-size: 24px;
font-family: "Segoe UI";
font-size: 24px;
font-weight: 200;
line-height: 32px;
}
.main-text-p1{
padding-top: 48px;
padding-bottom: 28px;
}
.endpoint {
height: 32px;
width: 571px;
color: #808080;
font-family: "Segoe UI";
font-size: 24px;
font-weight: 200;
line-height: 32px;
padding-top: 28px;
}
.how-to-build-section {
padding-top: 20px;
padding-left: 30px;
}
.how-to-build-section>h3 {
font-size: 16px;
font-weight: 600;
letter-spacing: 0.35px;
line-height: 22px;
margin: 0 0 24px 0;
text-transform: uppercase;
}
.step-container {
display: flex;
align-items: stretch;
position: relative;
}
.step-container dl {
border-left: 1px solid #A0A0A0;
display: block;
padding: 0 24px;
margin: 0;
}
.step-container dl>dt::before {
background-color: white;
border: 1px solid #A0A0A0;
border-radius: 100%;
content: '';
left: 47px;
height: 11px;
position: absolute;
width: 11px;
}
.step-container dl>.test-bullet::before {
background-color: blue;
}
.step-container dl>dt {
display: block;
font-size: inherit;
font-weight: bold;
line-height: 20px;
}
.step-container dl>dd {
font-size: inherit;
line-height: 20px;
margin-left: 0;
padding-bottom: 32px;
}
.step-container:last-child dl {
border-left: 1px solid transparent;
}
.ctaLink {
background-color: transparent;
border: 1px solid transparent;
color: #006AB1;
cursor: pointer;
font-weight: 600;
padding: 0;
white-space: normal;
}
.ctaLink:focus {
outline: 1px solid #00bcf2;
}
.ctaLink:hover {
text-decoration: underline;
}
.step-icon {
display: flex;
height: 38px;
margin-right: 15px;
width: 38px;
}
.step-icon>div {
height: 30px;
width: 30px;
background-repeat: no-repeat;
}
.ms-logo-container {
min-width: 580px;
max-width: 980px;
margin-left: auto;
margin-right: auto;
left: 0;
right: 0;
transition: bottom 400ms;
}
.ms-logo {
float: right;
background-image: url("data:image/svg+xml;utf8,%0A%3Csvg%20version%3D%221.1%22%20id%3D%22MS-symbol%22%20xmlns%3D%22http%3A//www.w3.org/2000/svg%22%20xmlns%3Axlink%3D%22http%3A//www.w3.org/1999/xlink%22%20x%3D%220px%22%20y%3D%220px%22%0A%09%20viewBox%3D%220%200%20400%20120%22%20style%3D%22enable-background%3Anew%200%200%20400%20120%3B%22%20xml%3Aspace%3D%22preserve%22%3E%0A%3Cstyle%20type%3D%22text/css%22%3E%0A%09.st0%7Bfill%3Anone%3B%7D%0A%09.st1%7Bfill%3A%23737474%3B%7D%0A%09.st2%7Bfill%3A%23D63F26%3B%7D%0A%09.st3%7Bfill%3A%23167D3E%3B%7D%0A%09.st4%7Bfill%3A%232E76BC%3B%7D%0A%09.st5%7Bfill%3A%23FDB813%3B%7D%0A%3C/style%3E%0A%3Crect%20x%3D%220.6%22%20class%3D%22st0%22%20width%3D%22398.7%22%20height%3D%22119%22/%3E%0A%3Cpath%20class%3D%22st1%22%20d%3D%22M171.3%2C38.4v43.2h-7.5V47.7h-0.1l-13.4%2C33.9h-5l-13.7-33.9h-0.1v33.9h-6.9V38.4h10.8l12.4%2C32h0.2l13.1-32H171.3%0A%09z%20M177.6%2C41.7c0-1.2%2C0.4-2.2%2C1.3-3c0.9-0.8%2C1.9-1.2%2C3.1-1.2c1.3%2C0%2C2.4%2C0.4%2C3.2%2C1.3c0.8%2C0.8%2C1.3%2C1.8%2C1.3%2C3c0%2C1.2-0.4%2C2.2-1.3%2C3%0A%09c-0.9%2C0.8-1.9%2C1.2-3.2%2C1.2s-2.3-0.4-3.1-1.2C178%2C43.8%2C177.6%2C42.8%2C177.6%2C41.7z%20M185.7%2C50.6v31h-7.3v-31H185.7z%20M207.8%2C76.3%0A%09c1.1%2C0%2C2.3-0.3%2C3.6-0.8c1.3-0.5%2C2.5-1.2%2C3.6-2v6.8c-1.2%2C0.7-2.5%2C1.2-4%2C1.5c-1.5%2C0.3-3.1%2C0.5-4.9%2C0.5c-4.6%2C0-8.3-1.4-11.1-4.3%0A%09c-2.9-2.9-4.3-6.6-4.3-11c0-5%2C1.5-9.1%2C4.4-12.3c2.9-3.2%2C7-4.8%2C12.4-4.8c1.4%2C0%2C2.7%2C0.2%2C4.1%2C0.5c1.4%2C0.4%2C2.5%2C0.8%2C3.3%2C1.2v7%0A%09c-1.1-0.8-2.3-1.5-3.4-1.9c-1.2-0.5-2.4-0.7-3.6-0.7c-2.9%2C0-5.2%2C0.9-7%2C2.8c-1.8%2C1.9-2.7%2C4.4-2.7%2C7.6c0%2C3.1%2C0.8%2C5.6%2C2.5%2C7.3%0A%09C202.6%2C75.4%2C204.9%2C76.3%2C207.8%2C76.3z%20M235.7%2C50.1c0.6%2C0%2C1.1%2C0%2C1.6%2C0.1s0.9%2C0.2%2C1.2%2C0.3v7.4c-0.4-0.3-0.9-0.5-1.7-0.8%0A%09c-0.7-0.3-1.6-0.4-2.7-0.4c-1.8%2C0-3.3%2C0.8-4.5%2C2.3c-1.2%2C1.5-1.9%2C3.8-1.9%2C7v15.6h-7.3v-31h7.3v4.9h0.1c0.7-1.7%2C1.7-3%2C3-4%0A%09C232.2%2C50.6%2C233.8%2C50.1%2C235.7%2C50.1z%20M238.9%2C66.6c0-5.1%2C1.4-9.2%2C4.3-12.2c2.9-3%2C6.9-4.5%2C12.1-4.5c4.8%2C0%2C8.6%2C1.4%2C11.3%2C4.3%0A%09c2.7%2C2.9%2C4.1%2C6.8%2C4.1%2C11.7c0%2C5-1.4%2C9-4.3%2C12c-2.9%2C3-6.8%2C4.5-11.8%2C4.5c-4.8%2C0-8.6-1.4-11.4-4.2C240.3%2C75.3%2C238.9%2C71.4%2C238.9%2C66.6z%0A%09%20M246.5%2C66.3c0%2C3.2%2C0.7%2C5.7%2C2.2%2C7.4c1.5%2C1.7%2C3.6%2C2.6%2C6.3%2C2.6c2.7%2C0%2C4.7-0.9%2C6.1-2.6c1.4-1.7%2C2.1-4.2%2C2.1-7.6c0-3.3-0.7-5.8-2.2-7.5%0A%09c-1.4-1.7-3.4-2.5-6-2.5c-2.7%2C0-4.7%2C0.9-6.2%2C2.7C247.2%2C60.5%2C246.5%2C63%2C246.5%2C66.3z%20M281.5%2C58.8c0%2C1%2C0.3%2C1.9%2C1%2C2.5%0A%09c0.7%2C0.6%2C2.1%2C1.3%2C4.4%2C2.2c2.9%2C1.2%2C5%2C2.5%2C6.1%2C3.9c1.2%2C1.5%2C1.8%2C3.2%2C1.8%2C5.3c0%2C2.9-1.1%2C5.3-3.4%2C7c-2.2%2C1.8-5.3%2C2.7-9.1%2C2.7%0A%09c-1.3%2C0-2.7-0.2-4.3-0.5c-1.6-0.3-2.9-0.7-4-1.2v-7.2c1.3%2C0.9%2C2.8%2C1.7%2C4.3%2C2.2c1.5%2C0.5%2C2.9%2C0.8%2C4.2%2C0.8c1.6%2C0%2C2.9-0.2%2C3.6-0.7%0A%09c0.8-0.5%2C1.2-1.2%2C1.2-2.3c0-1-0.4-1.9-1.2-2.5c-0.8-0.7-2.4-1.5-4.6-2.4c-2.7-1.1-4.6-2.4-5.7-3.8c-1.1-1.4-1.7-3.2-1.7-5.4%0A%09c0-2.8%2C1.1-5.1%2C3.3-6.9c2.2-1.8%2C5.1-2.7%2C8.6-2.7c1.1%2C0%2C2.3%2C0.1%2C3.6%2C0.4c1.3%2C0.2%2C2.5%2C0.6%2C3.4%2C0.9v6.9c-1-0.6-2.1-1.2-3.4-1.7%0A%09c-1.3-0.5-2.6-0.7-3.8-0.7c-1.4%2C0-2.5%2C0.3-3.2%2C0.8C281.9%2C57.1%2C281.5%2C57.8%2C281.5%2C58.8z%20M297.9%2C66.6c0-5.1%2C1.4-9.2%2C4.3-12.2%0A%09c2.9-3%2C6.9-4.5%2C12.1-4.5c4.8%2C0%2C8.6%2C1.4%2C11.3%2C4.3c2.7%2C2.9%2C4.1%2C6.8%2C4.1%2C11.7c0%2C5-1.4%2C9-4.3%2C12c-2.9%2C3-6.8%2C4.5-11.8%2C4.5%0A%09c-4.8%2C0-8.6-1.4-11.4-4.2C299.4%2C75.3%2C297.9%2C71.4%2C297.9%2C66.6z%20M305.5%2C66.3c0%2C3.2%2C0.7%2C5.7%2C2.2%2C7.4c1.5%2C1.7%2C3.6%2C2.6%2C6.3%2C2.6%0A%09c2.7%2C0%2C4.7-0.9%2C6.1-2.6c1.4-1.7%2C2.1-4.2%2C2.1-7.6c0-3.3-0.7-5.8-2.2-7.5c-1.4-1.7-3.4-2.5-6-2.5c-2.7%2C0-4.7%2C0.9-6.2%2C2.7%0A%09C306.3%2C60.5%2C305.5%2C63%2C305.5%2C66.3z%20M353.9%2C56.6h-10.9v25h-7.4v-25h-5.2v-6h5.2v-4.3c0-3.3%2C1.1-5.9%2C3.2-8c2.1-2.1%2C4.8-3.1%2C8.1-3.1%0A%09c0.9%2C0%2C1.7%2C0%2C2.4%2C0.1c0.7%2C0.1%2C1.3%2C0.2%2C1.8%2C0.4V42c-0.2-0.1-0.7-0.3-1.3-0.5c-0.6-0.2-1.3-0.3-2.1-0.3c-1.5%2C0-2.7%2C0.5-3.5%2C1.4%0A%09s-1.2%2C2.4-1.2%2C4.2v3.7h10.9v-7l7.3-2.2v9.2h7.4v6h-7.4v14.5c0%2C1.9%2C0.3%2C3.3%2C1%2C4c0.7%2C0.8%2C1.8%2C1.2%2C3.3%2C1.2c0.4%2C0%2C0.9-0.1%2C1.5-0.3%0A%09c0.6-0.2%2C1.1-0.4%2C1.6-0.7v6c-0.5%2C0.3-1.2%2C0.5-2.3%2C0.7c-1.1%2C0.2-2.1%2C0.3-3.2%2C0.3c-3.1%2C0-5.4-0.8-6.9-2.5c-1.5-1.6-2.3-4.1-2.3-7.4%0A%09V56.6z%22/%3E%0A%3Cg%3E%0A%09%3Crect%20x%3D%2231%22%20y%3D%2224%22%20class%3D%22st2%22%20width%3D%2234.2%22%20height%3D%2234.2%22/%3E%0A%09%3Crect%20x%3D%2268.8%22%20y%3D%2224%22%20class%3D%22st3%22%20width%3D%2234.2%22%20height%3D%2234.2%22/%3E%0A%09%3Crect%20x%3D%2231%22%20y%3D%2261.8%22%20class%3D%22st4%22%20width%3D%2234.2%22%20height%3D%2234.2%22/%3E%0A%09%3Crect%20x%3D%2268.8%22%20y%3D%2261.8%22%20class%3D%22st5%22%20width%3D%2234.2%22%20height%3D%2234.2%22/%3E%0A%3C/g%3E%0A%3C/svg%3E%0A");
}
.ms-logo-container>div {
min-height: 60px;
width: 150px;
background-repeat: no-repeat;
}
.row {
padding: 90px 0px 0 20px;
min-width: 480px;
max-width: 1366px;
margin-left: auto;
margin-right: auto;
}
.column {
float: left;
width: 45%;
padding-right: 20px;
}
.row:after {
content: "";
display: table;
clear: both;
}
a {
text-decoration: none;
}
.download-the-emulator {
height: 20px;
color: #0063B1;
font-size: 15px;
line-height: 20px;
padding-bottom: 70px;
}
.how-to-iframe {
max-width: 700px !important;
min-width: 650px !important;
height: 700px !important;
}
.remove-frame-height {
height: 10px;
}
@media only screen and (max-width: 1300px) {
.ms-logo {
padding-top: 30px;
}
.header-text {
font-size: 40x;
}
.column {
float: none;
padding-top: 30px;
width: 100%;
}
.ms-logo-container {
padding-top: 30px;
min-width: 480px;
max-width: 650px;
margin-left: auto;
margin-right: auto;
}
.row {
padding: 20px 0px 0 20px;
min-width: 480px;
max-width: 650px;
margin-left: auto;
margin-right: auto;
}
}
@media only screen and (max-width: 1370px) {
header {
background-color: #55A0E0;
background-size: auto 200px;
}
}
@media only screen and (max-width: 1230px) {
header {
background-color: #55A0E0;
background-size: auto 200px;
}
.header-text {
font-size: 44px;
}
.header-icon {
height: 120px;
width: 120px;
}
}
@media only screen and (max-width: 1000px) {
header {
background-color: #55A0E0;
background-image: none;
}
}
@media only screen and (max-width: 632px) {
.header-text {
font-size: 32px;
}
.row {
padding: 10px 0px 0 10px;
max-width: 490px !important;
min-width: 410px !important;
}
.endpoint {
font-size: 25px;
}
.main-text {
font-size: 20px;
}
.step-container dl>dd {
font-size: 14px;
}
.column {
padding-right: 5px;
}
.header-icon {
height: 110px;
width: 110px;
}
.how-to-iframe {
max-width: 480px !important;
min-width: 400px !important;
height: 650px !important;
overflow: hidden;
}
}
.remove-frame-height {
max-height: 10px;
}
</style>
<script>
document.addEventListener('DOMContentLoaded', function () {
loadFrame();
});
var loadFrame = function () {
var iframe = document.createElement('iframe');
iframe.setAttribute("id", "iframe");
var offLineHTMLContent = "";
var frameElement = document.getElementById("how-to-iframe");
if (window.navigator.onLine) {
iframe.src = 'https://docs.botframework.com/static/abs/pages/f5.htm';
iframe.setAttribute("scrolling", "no");
iframe.setAttribute("frameborder", "0");
iframe.setAttribute("width", "100%");
iframe.setAttribute("height", "100%");
var frameDiv = document.getElementById("how-to-iframe");
frameDiv.appendChild(iframe);
} else {
frameElement.classList.add("remove-frame-height");
}
};
</script>
</head>
<body>
<header class="header">
<div class="header-inner-container">
<div class="header-icon" style="display: inline-block"></div>
<div class="header-text" style="display: inline-block">EchoBot</div>
</div>
</header>
<div class="row">
<div class="column" class="main-content-area">
<div class="content-title">Your bot is ready!</div>
<div class="main-text main-text-p1">You can test your bot in the Bot Framework Emulator<br />
by connecting to http://localhost:3978/api/messages.</div>
<div class="main-text download-the-emulator"><a class="ctaLink" href="https://aka.ms/bot-framework-F5-download-emulator"
target="_blank">Download the Emulator</a></div>
<div class="main-text">Visit <a class="ctaLink" href="https://aka.ms/bot-framework-F5-abs-home" target="_blank">Azure
Bot Service</a> to register your bot and add it to<br />
various channels. The bot's endpoint URL typically looks
like this:</div>
<div class="endpoint">https://<i>your_bots_hostname</i>/api/messages</div>
</div>
<div class="column how-to-iframe" id="how-to-iframe"></div>
</div>
<div class="ms-logo-container">
<div class="ms-logo"></div>
</div>
</body>
</html>
| {
"pile_set_name": "Github"
} |
/**
* Copyright (C) 2001-2020 by RapidMiner and the contributors
*
* Complete list of developers available at our web site:
*
* http://rapidminer.com
*
* This program is free software: you can redistribute it and/or modify it under the terms of the
* GNU Affero General Public License as published by the Free Software Foundation, either version 3
* of the License, or (at your option) any later version.
*
* This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without
* even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* Affero General Public License for more details.
*
* You should have received a copy of the GNU Affero General Public License along with this program.
* If not, see http://www.gnu.org/licenses/.
*/
package com.rapidminer.operator.generator;
import java.util.Random;
/**
* Helper class for clusters information.
*
* @author Ingo Mierswa
*/
public class Cluster {
double[] coordinates;
double[] sigmas;
double size;
int label;
public Cluster(double[] coordinates, double[] sigmas, double size, int label) {
this.coordinates = coordinates;
this.sigmas = sigmas;
this.size = size;
this.label = label;
}
public double[] createArguments(Random random) {
double[] args = new double[coordinates.length];
for (int i = 0; i < args.length; i++) {
args[i] = coordinates[i] + random.nextGaussian() * sigmas[i];
}
return args;
}
}
| {
"pile_set_name": "Github"
} |
{% block code %}
/* ==========================================================================
@code
========================================================================== */
code, pre {
font-family: monospace !important;
}
pre {
border-left: 1px solid {{ color_silver }};
margin: 0 0 1em;
padding: 0 0 0 1em;
white-space: pre;
white-space: pre-wrap;
word-break: break-all;
}
h1 code, h2 code, h3 code, h4 code, h5 code, h6 code {
font: inherit;
}
{% block highlighting %}
{# code highlighting doesn't work for ebooks: on e-ink readers, the colored
code is difficult to read. On advanced readers, such as the iPad, the colored code
isn't properly rendered with a monospaced font #}
{% endblock %}
{% endblock %}
| {
"pile_set_name": "Github"
} |
'use strict';
module.exports = {
version: '1.2.3'
};
| {
"pile_set_name": "Github"
} |
//
// QBCBlobObjectAccessAnswer.h
// ContentService
//
// Copyright 2010 QuickBlox team. All rights reserved.
//
#import <Foundation/Foundation.h>
@interface QBCBlobObjectAccessAnswer : EntityAnswer {
@protected
QBCBlobObjectAccess* blobObjectAccess;
NSMutableString* paramsBuffer;
}
@property (nonatomic, retain) NSMutableString* paramsBuffer;
@property (nonatomic, readonly) QBCBlobObjectAccess* blobObjectAccess;
@end
| {
"pile_set_name": "Github"
} |
import { Scene, PointLayer } from '@antv/l7';
import { GaodeMap } from '@antv/l7-maps';
const scene = new Scene({
id: 'map',
map: new GaodeMap({
pitch: 0,
style: 'dark',
center: [ 112, 23.69 ],
zoom: 2.5
})
});
scene.on('loaded', () => {
fetch(
'https://gw.alipayobjects.com/os/basement_prod/9078fd36-ce8d-4ee2-91bc-605db8315fdf.csv'
)
.then(res => res.text())
.then(data => {
const pointLayer = new PointLayer({})
.source(data, {
parser: {
type: 'csv',
x: 'Longitude',
y: 'Latitude'
}
})
.shape('circle')
.active(true)
.animate(true)
.size(56)
.color('#4cfd47')
.style({
opacity: 1
});
scene.addLayer(pointLayer);
});
});
| {
"pile_set_name": "Github"
} |
//
// ImageProcessor.swift
// Kingfisher
//
// Created by Wei Wang on 2016/08/26.
//
// Copyright (c) 2016 Wei Wang <[email protected]>
//
// Permission is hereby granted, free of charge, to any person obtaining a copy
// of this software and associated documentation files (the "Software"), to deal
// in the Software without restriction, including without limitation the rights
// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
// copies of the Software, and to permit persons to whom the Software is
// furnished to do so, subject to the following conditions:
//
// The above copyright notice and this permission notice shall be included in
// all copies or substantial portions of the Software.
//
// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
// THE SOFTWARE.
import Foundation
import CoreGraphics
/// The item which could be processed by an `ImageProcessor`
///
/// - image: Input image
/// - data: Input data
public enum ImageProcessItem {
case image(Image)
case data(Data)
}
/// An `ImageProcessor` would be used to convert some downloaded data to an image.
public protocol ImageProcessor {
/// Identifier of the processor. It will be used to identify the processor when
/// caching and retriving an image. You might want to make sure that processors with
/// same properties/functionality have the same identifiers, so correct processed images
/// could be retrived with proper key.
///
/// - Note: Do not supply an empty string for a customized processor, which is already taken by
/// the `DefaultImageProcessor`. It is recommended to use a reverse domain name notation
/// string of your own for the identifier.
var identifier: String { get }
/// Process an input `ImageProcessItem` item to an image for this processor.
///
/// - parameter item: Input item which will be processed by `self`
/// - parameter options: Options when processing the item.
///
/// - returns: The processed image.
///
/// - Note: The return value will be `nil` if processing failed while converting data to image.
/// If input item is already an image and there is any errors in processing, the input
/// image itself will be returned.
/// - Note: Most processor only supports CG-based images.
/// watchOS is not supported for processers containing filter, the input image will be returned directly on watchOS.
func process(item: ImageProcessItem, options: KingfisherOptionsInfo) -> Image?
}
typealias ProcessorImp = ((ImageProcessItem, KingfisherOptionsInfo) -> Image?)
public extension ImageProcessor {
/// Append an `ImageProcessor` to another. The identifier of the new `ImageProcessor`
/// will be "\(self.identifier)|>\(another.identifier)".
///
/// - parameter another: An `ImageProcessor` you want to append to `self`.
///
/// - returns: The new `ImageProcessor`. It will process the image in the order
/// of the two processors concatenated.
public func append(another: ImageProcessor) -> ImageProcessor {
let newIdentifier = identifier.appending("|>\(another.identifier)")
return GeneralProcessor(identifier: newIdentifier) {
item, options in
if let image = self.process(item: item, options: options) {
return another.process(item: .image(image), options: options)
} else {
return nil
}
}
}
}
fileprivate struct GeneralProcessor: ImageProcessor {
let identifier: String
let p: ProcessorImp
func process(item: ImageProcessItem, options: KingfisherOptionsInfo) -> Image? {
return p(item, options)
}
}
/// The default processor. It convert the input data to a valid image.
/// Images of .PNG, .JPEG and .GIF format are supported.
/// If an image is given, `DefaultImageProcessor` will do nothing on it and just return that image.
public struct DefaultImageProcessor: ImageProcessor {
/// A default `DefaultImageProcessor` could be used across.
public static let `default` = DefaultImageProcessor()
public let identifier = ""
/// Initialize a `DefaultImageProcessor`
///
/// - returns: An initialized `DefaultImageProcessor`.
public init() {}
public func process(item: ImageProcessItem, options: KingfisherOptionsInfo) -> Image? {
switch item {
case .image(let image):
return image
case .data(let data):
return Kingfisher<Image>.image(data: data, scale: options.scaleFactor, preloadAllGIFData: options.preloadAllGIFData)
}
}
}
/// Processor for making round corner images. Only CG-based images are supported in macOS,
/// if a non-CG image passed in, the processor will do nothing.
public struct RoundCornerImageProcessor: ImageProcessor {
public let identifier: String
/// Corner radius will be applied in processing.
public let cornerRadius: CGFloat
/// Target size of output image should be. If `nil`, the image will keep its original size after processing.
public let targetSize: CGSize?
/// Initialize a `RoundCornerImageProcessor`
///
/// - parameter cornerRadius: Corner radius will be applied in processing.
/// - parameter targetSize: Target size of output image should be. If `nil`,
/// the image will keep its original size after processing.
/// Default is `nil`.
///
/// - returns: An initialized `RoundCornerImageProcessor`.
public init(cornerRadius: CGFloat, targetSize: CGSize? = nil) {
self.cornerRadius = cornerRadius
self.targetSize = targetSize
if let size = targetSize {
self.identifier = "com.onevcat.Kingfisher.RoundCornerImageProcessor(\(cornerRadius)_\(size))"
} else {
self.identifier = "com.onevcat.Kingfisher.RoundCornerImageProcessor(\(cornerRadius))"
}
}
public func process(item: ImageProcessItem, options: KingfisherOptionsInfo) -> Image? {
switch item {
case .image(let image):
let size = targetSize ?? image.kf.size
return image.kf.image(withRoundRadius: cornerRadius, fit: size)
case .data(_):
return (DefaultImageProcessor.default >> self).process(item: item, options: options)
}
}
}
/// Processor for resizing images. Only CG-based images are supported in macOS.
public struct ResizingImageProcessor: ImageProcessor {
public let identifier: String
/// Target size of output image should be.
public let targetSize: CGSize
/// Initialize a `ResizingImageProcessor`
///
/// - parameter targetSize: Target size of output image should be.
///
/// - returns: An initialized `ResizingImageProcessor`.
public init(targetSize: CGSize) {
self.targetSize = targetSize
self.identifier = "com.onevcat.Kingfisher.ResizingImageProcessor(\(targetSize))"
}
public func process(item: ImageProcessItem, options: KingfisherOptionsInfo) -> Image? {
switch item {
case .image(let image):
return image.kf.resize(to: targetSize)
case .data(_):
return (DefaultImageProcessor.default >> self).process(item: item, options: options)
}
}
}
/// Processor for adding blur effect to images. `Accelerate.framework` is used underhood for
/// a better performance. A simulated Gaussian blur with specified blur radius will be applied.
public struct BlurImageProcessor: ImageProcessor {
public let identifier: String
/// Blur radius for the simulated Gaussian blur.
public let blurRadius: CGFloat
/// Initialize a `BlurImageProcessor`
///
/// - parameter blurRadius: Blur radius for the simulated Gaussian blur.
///
/// - returns: An initialized `BlurImageProcessor`.
public init(blurRadius: CGFloat) {
self.blurRadius = blurRadius
self.identifier = "com.onevcat.Kingfisher.BlurImageProcessor(\(blurRadius))"
}
public func process(item: ImageProcessItem, options: KingfisherOptionsInfo) -> Image? {
switch item {
case .image(let image):
let radius = blurRadius * options.scaleFactor
return image.kf.blurred(withRadius: radius)
case .data(_):
return (DefaultImageProcessor.default >> self).process(item: item, options: options)
}
}
}
/// Processor for adding an overlay to images. Only CG-based images are supported in macOS.
public struct OverlayImageProcessor: ImageProcessor {
public var identifier: String
/// Overlay color will be used to overlay the input image.
public let overlay: Color
/// Fraction will be used when overlay the color to image.
public let fraction: CGFloat
/// Initialize an `OverlayImageProcessor`
///
/// - parameter overlay: Overlay color will be used to overlay the input image.
/// - parameter fraction: Fraction will be used when overlay the color to image.
/// From 0.0 to 1.0. 0.0 means solid color, 1.0 means transparent overlay.
///
/// - returns: An initialized `OverlayImageProcessor`.
public init(overlay: Color, fraction: CGFloat = 0.5) {
self.overlay = overlay
self.fraction = fraction
self.identifier = "com.onevcat.Kingfisher.OverlayImageProcessor(\(overlay.hex)_\(fraction))"
}
public func process(item: ImageProcessItem, options: KingfisherOptionsInfo) -> Image? {
switch item {
case .image(let image):
return image.kf.overlaying(with: overlay, fraction: fraction)
case .data(_):
return (DefaultImageProcessor.default >> self).process(item: item, options: options)
}
}
}
/// Processor for tint images with color. Only CG-based images are supported.
public struct TintImageProcessor: ImageProcessor {
public let identifier: String
/// Tint color will be used to tint the input image.
public let tint: Color
/// Initialize a `TintImageProcessor`
///
/// - parameter tint: Tint color will be used to tint the input image.
///
/// - returns: An initialized `TintImageProcessor`.
public init(tint: Color) {
self.tint = tint
self.identifier = "com.onevcat.Kingfisher.TintImageProcessor(\(tint.hex))"
}
public func process(item: ImageProcessItem, options: KingfisherOptionsInfo) -> Image? {
switch item {
case .image(let image):
return image.kf.tinted(with: tint)
case .data(_):
return (DefaultImageProcessor.default >> self).process(item: item, options: options)
}
}
}
/// Processor for applying some color control to images. Only CG-based images are supported.
/// watchOS is not supported.
public struct ColorControlsProcessor: ImageProcessor {
public let identifier: String
/// Brightness changing to image.
public let brightness: CGFloat
/// Contrast changing to image.
public let contrast: CGFloat
/// Saturation changing to image.
public let saturation: CGFloat
/// InputEV changing to image.
public let inputEV: CGFloat
/// Initialize a `ColorControlsProcessor`
///
/// - parameter brightness: Brightness changing to image.
/// - parameter contrast: Contrast changing to image.
/// - parameter saturation: Saturation changing to image.
/// - parameter inputEV: InputEV changing to image.
///
/// - returns: An initialized `ColorControlsProcessor`
public init(brightness: CGFloat, contrast: CGFloat, saturation: CGFloat, inputEV: CGFloat) {
self.brightness = brightness
self.contrast = contrast
self.saturation = saturation
self.inputEV = inputEV
self.identifier = "com.onevcat.Kingfisher.ColorControlsProcessor(\(brightness)_\(contrast)_\(saturation)_\(inputEV))"
}
public func process(item: ImageProcessItem, options: KingfisherOptionsInfo) -> Image? {
switch item {
case .image(let image):
return image.kf.adjusted(brightness: brightness, contrast: contrast, saturation: saturation, inputEV: inputEV)
case .data(_):
return (DefaultImageProcessor.default >> self).process(item: item, options: options)
}
}
}
/// Processor for applying black and white effect to images. Only CG-based images are supported.
/// watchOS is not supported.
public struct BlackWhiteProcessor: ImageProcessor {
public let identifier = "com.onevcat.Kingfisher.BlackWhiteProcessor"
/// Initialize a `BlackWhiteProcessor`
///
/// - returns: An initialized `BlackWhiteProcessor`
public init() {}
public func process(item: ImageProcessItem, options: KingfisherOptionsInfo) -> Image? {
return ColorControlsProcessor(brightness: 0.0, contrast: 1.0, saturation: 0.0, inputEV: 0.7)
.process(item: item, options: options)
}
}
/// Concatenate two `ImageProcessor`s. `ImageProcessor.appen(another:)` is used internally.
///
/// - parameter left: First processor.
/// - parameter right: Second processor.
///
/// - returns: The concatenated processor.
public func >>(left: ImageProcessor, right: ImageProcessor) -> ImageProcessor {
return left.append(another: right)
}
fileprivate extension Color {
var hex: String {
var r: CGFloat = 0
var g: CGFloat = 0
var b: CGFloat = 0
var a: CGFloat = 0
getRed(&r, green: &g, blue: &b, alpha: &a)
let rInt = Int(r * 255) << 24
let gInt = Int(g * 255) << 16
let bInt = Int(b * 255) << 8
let aInt = Int(a * 255)
let rgba = rInt | gInt | bInt | aInt
return String(format:"#%08x", rgba)
}
}
| {
"pile_set_name": "Github"
} |
Графин Андрей | Software engineer, Яндекс
| {
"pile_set_name": "Github"
} |
<nav id="navbar" class="navbar has-shadow">
<div class="container">
<div class="navbar-brand">
<a class="navbar-item" href="#">193Eric</a>
<div class="navbar-burger burger" data-target="navMenu">
<span></span>
<span></span>
<span></span>
</div>
</div>
<div id="navMenu" class="navbar-menu">
<div class="navbar-start">
<a class="navbar-item" href="/">主页</a>
<a class="navbar-item" href="/about">关于</a>
</div>
<div class="navbar-end">
{% if ctx.session.user.isAdmin %}
<div class="navbar-item">
<a class="button is-small is-primary" href="/category">分类</a>
</div>
{% endif %}
{% if ctx.session.user %}
<div class="navbar-item">
<a class="button is-small is-primary" href="/posts/new">写文章</a>
</div>
<div class="navbar-item">
<a href="/user/{{ctx.session.user.name}}">{{ctx.session.user.name}}</a>
</div>
<div class="navbar-item">
<a href="/signout">退出</a>
</div>
{% else %}
<div class="navbar-item">
<a class="button is-small is-primary" href="/signup">注册</a>
</div>
<div class="navbar-item">
<a class="button is-small" href="/signin">登录</a>
</div>
{% endif %}
</div>
</div>
</div>
</nav>
| {
"pile_set_name": "Github"
} |
module.exports = {
config: {
url: 'https://www.googleapis.com/drive/v3/files',
method: 'POST',
paramsSerializer: function() {},
data: {
name: 'DELETE_ME',
mimeType: 'application/vnd.google-apps.folder'
},
headers: {
'x-goog-api-client': 'gdcl/3.2.0 gl-node/13.6.0 auth/5.7.0',
'Accept-Encoding': 'gzip',
'User-Agent': 'google-api-nodejs-client/3.2.0 (gzip)',
Authorization:
'Bearer ya29.ImC9BywXlhVkxuephNATM6BJO1shRIfJHtOLjcqtGt_ORmzMIi93kJBQnPoy5OGeJ9RjLGQw78B_IGDmsQ6r7MMCnbhFTeGSf4nQalfrOWhwNKGSIzlw5u0_u3LyqFg0-DQ',
'Content-Type': 'application/json',
Accept: 'application/json'
},
params: {},
validateStatus: function() {},
retry: true,
body:
'{"name":"DELETE_ME","mimeType":"application/vnd.google-apps.folder"}',
responseType: 'json'
},
data: {
kind: 'drive#file',
id: '1upGfeKN9Vy5tzTTfk5jI7P3BzvnJCqw2',
name: 'DELETE_ME',
mimeType: 'application/vnd.google-apps.folder'
},
headers: {
'alt-svc':
'quic=":443"; ma=2592000; v="46,43",h3-Q050=":443"; ma=2592000,h3-Q049=":443"; ma=2592000,h3-Q048=":443"; ma=2592000,h3-Q046=":443"; ma=2592000,h3-Q043=":443"; ma=2592000',
'cache-control': 'no-cache, no-store, max-age=0, must-revalidate',
connection: 'close',
'content-encoding': 'gzip',
'content-type': 'application/json; charset=UTF-8',
date: 'Mon, 17 Feb 2020 23:35:07 GMT',
expires: 'Mon, 01 Jan 1990 00:00:00 GMT',
pragma: 'no-cache',
server: 'GSE',
'transfer-encoding': 'chunked',
vary: 'Origin, X-Origin',
'x-content-type-options': 'nosniff',
'x-frame-options': 'SAMEORIGIN',
'x-xss-protection': '1; mode=block'
},
status: 200,
statusText: 'OK',
request: { responseURL: 'https://www.googleapis.com/drive/v3/files' }
}
| {
"pile_set_name": "Github"
} |
fileFormatVersion: 2
guid: e1049e74bc92a6b418376c7ef839dff2
ScriptedImporter:
internalIDToNameTable: []
externalObjects: {}
serializedVersion: 2
userData:
assetBundleName:
assetBundleVariant:
script: {fileID: 11500000, guid: 625f186215c104763be7675aa2d941aa, type: 3}
| {
"pile_set_name": "Github"
} |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.